PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.7
Yatra – Travel Booking & Tour Operator Software v3.0.2.7
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / assets / dist / blocks / tour.js

tour.js in Yatra – Travel Booking & Tour Operator Software 3.0.2.7, at assets/dist/blocks/tour.js

145 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(element, blocks, blockEditor, components, i18n, ServerSideRender) {
2 "use strict";
3 function Edit({ attributes: attributes2, setAttributes }) {
4 return /* @__PURE__ */ element.createElement(element.Fragment, null, /* @__PURE__ */ element.createElement(blockEditor.InspectorControls, null, /* @__PURE__ */ element.createElement(components.PanelBody, { title: i18n.__("Trip Settings", "yatra"), initialOpen: true }, /* @__PURE__ */ element.createElement(
5 components.TextControl,
6 {
7 label: i18n.__("Title", "yatra"),
8 value: attributes2.title,
9 onChange: (value) => setAttributes({ title: value })
10 }
11 ), /* @__PURE__ */ element.createElement(
12 components.SelectControl,
13 {
14 label: i18n.__("Order", "yatra"),
15 value: attributes2.order,
16 options: [
17 { label: i18n.__("Descending", "yatra"), value: "desc" },
18 { label: i18n.__("Ascending", "yatra"), value: "asc" }
19 ],
20 onChange: (value) => setAttributes({ order: value })
21 }
22 ), /* @__PURE__ */ element.createElement(
23 components.RangeControl,
24 {
25 label: i18n.__("Number of Tours", "yatra"),
26 value: attributes2.per_page,
27 onChange: (value) => setAttributes({ per_page: value || 10 }),
28 min: 1,
29 max: 50
30 }
31 ), /* @__PURE__ */ element.createElement(
32 components.RangeControl,
33 {
34 label: i18n.__("Columns", "yatra"),
35 value: attributes2.columns,
36 onChange: (value) => setAttributes({
37 columns: value !== void 0 && value !== null ? value : 3
38 }),
39 min: 1,
40 max: 6
41 }
42 ), /* @__PURE__ */ element.createElement(
43 components.ToggleControl,
44 {
45 label: i18n.__("Show only featured tours", "yatra"),
46 checked: attributes2.featured,
47 onChange: (value) => setAttributes({ featured: value })
48 }
49 ), /* @__PURE__ */ element.createElement(
50 components.ToggleControl,
51 {
52 label: i18n.__("Show pagination", "yatra"),
53 checked: attributes2.show_pagination,
54 onChange: (value) => setAttributes({ show_pagination: value })
55 }
56 ))), /* @__PURE__ */ element.createElement("div", { className: "yatra-block-editor-preview" }, /* @__PURE__ */ element.createElement(
57 ServerSideRender,
58 {
59 block: "yatra/tour",
60 attributes: attributes2,
61 key: JSON.stringify(attributes2)
62 }
63 )));
64 }
65 const $schema = "https://schemas.wp.org/trunk/block.json";
66 const apiVersion = 3;
67 const name = "yatra/tour";
68 const title = "Trip";
69 const category = "yatra";
70 const icon = "palmtree";
71 const description = "Display trip listings with customizable options";
72 const keywords = [
73 "tour",
74 "trip",
75 "trips",
76 "tours",
77 "travel",
78 "yatra"
79 ];
80 const textdomain = "yatra";
81 const attributes = {
82 order: {
83 type: "string",
84 "default": "desc"
85 },
86 featured: {
87 type: "boolean",
88 "default": false
89 },
90 per_page: {
91 type: "number",
92 "default": 10
93 },
94 columns: {
95 type: "number",
96 "default": 3
97 },
98 title: {
99 type: "string",
100 "default": "Our Trips"
101 },
102 show_pagination: {
103 type: "boolean",
104 "default": true
105 }
106 };
107 const supports = {
108 html: false,
109 inserter: true,
110 align: [
111 "wide",
112 "full"
113 ]
114 };
115 const editorScript = "yatra-tour-block-editor";
116 const blockMetadata = {
117 $schema,
118 apiVersion,
119 name,
120 title,
121 category,
122 icon,
123 description,
124 keywords,
125 textdomain,
126 attributes,
127 supports,
128 editorScript
129 };
130 const {
131 $schema: _$schema,
132 editorScript: _$editorScript,
133 ...metadata
134 } = blockMetadata;
135 if (blocks.getBlockType(metadata.name)) {
136 blocks.unregisterBlockType(metadata.name);
137 }
138 blocks.registerBlockType(metadata.name, {
139 ...metadata,
140 edit: Edit,
141 save: () => null
142 });
143 })(wp.element, wp.blocks, wp.blockEditor, wp.components, wp.i18n, wp.serverSideRender);
144 //# sourceMappingURL=tour.js.map
145