@knovator/pagecreator 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/index.d.ts +4 -0
- package/index.js +753 -0
- package/lib/components/common/Card/banner/banner.d.ts +3 -0
- package/lib/components/common/Card/simple-card/simple-card.d.ts +3 -0
- package/lib/components/common/collection-item/collection-item.d.ts +3 -0
- package/lib/components/page/page.d.ts +3 -0
- package/lib/components/widget/carousel-widget/carousel-widget.d.ts +3 -0
- package/lib/components/widget/fixed-widget/fixed-widget.d.ts +3 -0
- package/lib/components/widget/widget.d.ts +3 -0
- package/lib/icons/Next.d.ts +2 -0
- package/lib/icons/Previous.d.ts +2 -0
- package/lib/types/api.d.ts +59 -0
- package/lib/types/common.d.ts +3 -0
- package/lib/types/components.d.ts +54 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/utils/helper.d.ts +8 -0
- package/package.json +30 -0
- package/style.css +1 -0
package/README.md
ADDED
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Slider from 'react-slick';
|
|
3
|
+
|
|
4
|
+
function FixedWidget(_ref) {
|
|
5
|
+
var widgetData = _ref.widgetData,
|
|
6
|
+
formatTile = _ref.formatTile,
|
|
7
|
+
formatItem = _ref.formatItem;
|
|
8
|
+
return jsxs("div", Object.assign({
|
|
9
|
+
className: "grid grid-cols-".concat(widgetData.mobilePerRow, " md:grid-cols-").concat(widgetData.tabletPerRow, " lg:grid-cols-").concat(widgetData.webPerRow)
|
|
10
|
+
}, {
|
|
11
|
+
children: [widgetData.widgetType === 'Image' ? widgetData.tiles.map(function (tile) {
|
|
12
|
+
return formatTile(tile);
|
|
13
|
+
}) : widgetData.collectionItems.map(function (item) {
|
|
14
|
+
return formatItem(item);
|
|
15
|
+
}), widgetData.tiles.map(function (tile) {
|
|
16
|
+
return formatTile(tile);
|
|
17
|
+
})]
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/******************************************************************************
|
|
22
|
+
Copyright (c) Microsoft Corporation.
|
|
23
|
+
|
|
24
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
25
|
+
purpose with or without fee is hereby granted.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
28
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
29
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
30
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
31
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
32
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
33
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
34
|
+
***************************************************************************** */
|
|
35
|
+
|
|
36
|
+
function __rest(s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
49
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
50
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
51
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
52
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
53
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
54
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var Next = function Next() {
|
|
59
|
+
return jsx("svg", Object.assign({
|
|
60
|
+
width: "12",
|
|
61
|
+
height: "12",
|
|
62
|
+
viewBox: "0 0 12 12",
|
|
63
|
+
fill: "none",
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
65
|
+
}, {
|
|
66
|
+
children: jsx("path", {
|
|
67
|
+
d: "M9.129 5.25L5.106 1.227L6.1665 0.166504L12 6L6.1665 11.8335L5.106 10.773L9.129 6.75H0V5.25H9.129Z",
|
|
68
|
+
fill: "#40B5E8"
|
|
69
|
+
})
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var Previous = function Previous() {
|
|
74
|
+
return jsx("svg", Object.assign({
|
|
75
|
+
width: "12",
|
|
76
|
+
height: "12",
|
|
77
|
+
viewBox: "0 0 12 12",
|
|
78
|
+
fill: "none",
|
|
79
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
80
|
+
}, {
|
|
81
|
+
children: jsx("path", {
|
|
82
|
+
d: "M2.871 5.25L6.894 1.227L5.8335 0.166504L0 6L5.8335 11.8335L6.894 10.773L2.871 6.75H12V5.25H2.871Z",
|
|
83
|
+
fill: "#40B5E8"
|
|
84
|
+
})
|
|
85
|
+
}));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var SlickArrowLeft = function SlickArrowLeft(_a) {
|
|
89
|
+
var currentSlide = _a.currentSlide;
|
|
90
|
+
_a.slideCount;
|
|
91
|
+
var props = __rest(_a, ["currentSlide", "slideCount"]);
|
|
92
|
+
|
|
93
|
+
return jsx("button", Object.assign({}, props, {
|
|
94
|
+
className: 'slick-prev slick-arrow' + (currentSlide === 0 ? ' slick-disabled' : ''),
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
"aria-disabled": currentSlide === 0 ? true : false,
|
|
97
|
+
type: "button"
|
|
98
|
+
}, {
|
|
99
|
+
children: jsx(Previous, {})
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
var SlickArrowRight = function SlickArrowRight(_a) {
|
|
104
|
+
var currentSlide = _a.currentSlide,
|
|
105
|
+
slideCount = _a.slideCount,
|
|
106
|
+
props = __rest(_a, ["currentSlide", "slideCount"]);
|
|
107
|
+
|
|
108
|
+
return jsx("button", Object.assign({}, props, {
|
|
109
|
+
className: 'slick-next slick-arrow' + (slideCount && currentSlide === slideCount - 1 ? ' slick-disabled' : ''),
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
"aria-disabled": slideCount && currentSlide === slideCount - 1 ? true : false,
|
|
112
|
+
type: "button"
|
|
113
|
+
}, {
|
|
114
|
+
children: jsx(Next, {})
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
function CarouselWidget(_ref) {
|
|
119
|
+
var widgetData = _ref.widgetData,
|
|
120
|
+
formatTile = _ref.formatTile,
|
|
121
|
+
settings = _ref.settings;
|
|
122
|
+
var defaultSettings = {
|
|
123
|
+
dots: false,
|
|
124
|
+
infinite: true,
|
|
125
|
+
slidesToShow: widgetData.mobilePerRow,
|
|
126
|
+
slidesToScroll: 1,
|
|
127
|
+
autoplay: widgetData.autoPlay,
|
|
128
|
+
autoplaySpeed: 1500,
|
|
129
|
+
pauseOnHover: true,
|
|
130
|
+
nextArrow: jsx(SlickArrowRight, {}),
|
|
131
|
+
prevArrow: jsx(SlickArrowLeft, {}),
|
|
132
|
+
responsive: [{
|
|
133
|
+
breakpoint: 768,
|
|
134
|
+
settings: {
|
|
135
|
+
slidesToShow: widgetData.tabletPerRow
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
breakpoint: 1024,
|
|
139
|
+
settings: {
|
|
140
|
+
arrows: false,
|
|
141
|
+
slidesToShow: widgetData.webPerRow
|
|
142
|
+
}
|
|
143
|
+
}]
|
|
144
|
+
};
|
|
145
|
+
if (!widgetData) return null;
|
|
146
|
+
return jsx(Slider, Object.assign({}, settings ? settings : defaultSettings, {
|
|
147
|
+
children: widgetData.tiles.map(function (tile) {
|
|
148
|
+
return formatTile(tile);
|
|
149
|
+
})
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function SimpleCard(_ref) {
|
|
154
|
+
var imageUrl = _ref.imageUrl,
|
|
155
|
+
imageAltText = _ref.imageAltText,
|
|
156
|
+
subTitle = _ref.subTitle,
|
|
157
|
+
label = _ref.label,
|
|
158
|
+
title = _ref.title,
|
|
159
|
+
_onClick = _ref.onClick;
|
|
160
|
+
return jsxs("div", Object.assign({
|
|
161
|
+
className: "kpc_simple-card",
|
|
162
|
+
onClick: function onClick() {
|
|
163
|
+
return _onClick && _onClick();
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
children: [jsx("div", Object.assign({
|
|
167
|
+
className: "kpc_simple-card-heading"
|
|
168
|
+
}, {
|
|
169
|
+
children: jsx("img", {
|
|
170
|
+
src: imageUrl,
|
|
171
|
+
className: "kpc_simple-card-image",
|
|
172
|
+
alt: imageAltText
|
|
173
|
+
})
|
|
174
|
+
})), jsxs("div", Object.assign({
|
|
175
|
+
className: "kpc_simple-card-body"
|
|
176
|
+
}, {
|
|
177
|
+
children: [label && jsx("p", Object.assign({
|
|
178
|
+
className: "kpc_simple-card-label"
|
|
179
|
+
}, {
|
|
180
|
+
children: label
|
|
181
|
+
})), jsxs("div", Object.assign({
|
|
182
|
+
className: "kpc_simple-card-content"
|
|
183
|
+
}, {
|
|
184
|
+
children: [jsx("h4", Object.assign({
|
|
185
|
+
className: "kpc_simple-card-title"
|
|
186
|
+
}, {
|
|
187
|
+
children: title
|
|
188
|
+
})), subTitle && jsx("p", Object.assign({
|
|
189
|
+
className: "kpc_simple-card-subtitle"
|
|
190
|
+
}, {
|
|
191
|
+
children: subTitle
|
|
192
|
+
}))]
|
|
193
|
+
}))]
|
|
194
|
+
}))]
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function Banner(_ref) {
|
|
199
|
+
var imageAltText = _ref.imageAltText,
|
|
200
|
+
imageUrl = _ref.imageUrl,
|
|
201
|
+
_onClick = _ref.onClick;
|
|
202
|
+
return jsx("div", Object.assign({
|
|
203
|
+
className: "kpc_banner"
|
|
204
|
+
}, {
|
|
205
|
+
children: jsx("img", {
|
|
206
|
+
src: imageUrl,
|
|
207
|
+
alt: imageAltText,
|
|
208
|
+
className: "kpc_banner-image",
|
|
209
|
+
onClick: function onClick() {
|
|
210
|
+
return _onClick && _onClick();
|
|
211
|
+
}
|
|
212
|
+
})
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function CollectionItem(_ref) {
|
|
217
|
+
var name = _ref.name;
|
|
218
|
+
return jsx("div", Object.assign({
|
|
219
|
+
className: "kpc_item"
|
|
220
|
+
}, {
|
|
221
|
+
children: jsx("p", Object.assign({
|
|
222
|
+
className: "kpc_item-text"
|
|
223
|
+
}, {
|
|
224
|
+
children: name
|
|
225
|
+
}))
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function Widget(_ref) {
|
|
230
|
+
var widgetData = _ref.widgetData,
|
|
231
|
+
apiBaseUrl = _ref.apiBaseUrl,
|
|
232
|
+
formatItem = _ref.formatItem,
|
|
233
|
+
_onClick = _ref.onClick;
|
|
234
|
+
|
|
235
|
+
var formatTile = function formatTile(tile) {
|
|
236
|
+
var _a, _b;
|
|
237
|
+
|
|
238
|
+
if (typeof formatItem === 'function' && formatItem) return formatItem(tile);else if (widgetData.widgetType === 'Image') return jsx(Banner, {
|
|
239
|
+
imageUrl: "".concat(apiBaseUrl).concat((_a = tile.img) === null || _a === void 0 ? void 0 : _a.uri),
|
|
240
|
+
imageAltText: tile.altText
|
|
241
|
+
}, tile._id);else return jsx(SimpleCard, {
|
|
242
|
+
onClick: function onClick() {
|
|
243
|
+
return _onClick && _onClick(tile);
|
|
244
|
+
},
|
|
245
|
+
title: tile.title,
|
|
246
|
+
imageUrl: "".concat(apiBaseUrl).concat((_b = tile.img) === null || _b === void 0 ? void 0 : _b.uri),
|
|
247
|
+
imageAltText: tile.altText
|
|
248
|
+
}, tile._id);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
var formatCollectionItem = function formatCollectionItem(item) {
|
|
252
|
+
return jsx(CollectionItem, Object.assign({}, item), item._id);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
if (!widgetData) return null;
|
|
256
|
+
return jsxs("div", Object.assign({
|
|
257
|
+
className: "kpc_widget"
|
|
258
|
+
}, {
|
|
259
|
+
children: [jsx("h2", Object.assign({
|
|
260
|
+
className: "kpc_widget-title"
|
|
261
|
+
}, {
|
|
262
|
+
children: widgetData.selectionTitle
|
|
263
|
+
})), jsx("div", Object.assign({
|
|
264
|
+
className: "kpc_widget-body"
|
|
265
|
+
}, {
|
|
266
|
+
children: widgetData.selectionType === 'Carousel' ? jsx(CarouselWidget, {
|
|
267
|
+
apiBaseUrl: apiBaseUrl,
|
|
268
|
+
widgetData: widgetData,
|
|
269
|
+
formatItem: formatCollectionItem,
|
|
270
|
+
formatTile: formatTile
|
|
271
|
+
}) : jsx(FixedWidget, {
|
|
272
|
+
apiBaseUrl: apiBaseUrl,
|
|
273
|
+
widgetData: widgetData,
|
|
274
|
+
formatItem: formatCollectionItem,
|
|
275
|
+
formatTile: formatTile
|
|
276
|
+
})
|
|
277
|
+
}))]
|
|
278
|
+
}));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function Page(_ref) {
|
|
282
|
+
var title = _ref.title,
|
|
283
|
+
apiBaseUrl = _ref.apiBaseUrl,
|
|
284
|
+
pageData = _ref.pageData,
|
|
285
|
+
formatItem = _ref.formatItem,
|
|
286
|
+
onClick = _ref.onClick;
|
|
287
|
+
if (!pageData) return null;
|
|
288
|
+
return jsxs("div", Object.assign({
|
|
289
|
+
className: "kpc_page"
|
|
290
|
+
}, {
|
|
291
|
+
children: [jsx("h1", Object.assign({
|
|
292
|
+
className: "kpc_page-title"
|
|
293
|
+
}, {
|
|
294
|
+
children: title
|
|
295
|
+
})), jsx("div", Object.assign({
|
|
296
|
+
className: "kpc_page-widgets"
|
|
297
|
+
}, {
|
|
298
|
+
children: pageData.widgets.map(function (widgetData, index) {
|
|
299
|
+
return jsx(Widget, {
|
|
300
|
+
widgetData: widgetData,
|
|
301
|
+
apiBaseUrl: apiBaseUrl,
|
|
302
|
+
formatItem: formatItem && function (tileData) {
|
|
303
|
+
return formatItem(widgetData.code, tileData);
|
|
304
|
+
},
|
|
305
|
+
onClick: onClick && function (tileData) {
|
|
306
|
+
return onClick(widgetData.code, tileData);
|
|
307
|
+
}
|
|
308
|
+
}, index);
|
|
309
|
+
})
|
|
310
|
+
}))]
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
315
|
+
|
|
316
|
+
var _typeof = {exports: {}};
|
|
317
|
+
|
|
318
|
+
(function (module) {
|
|
319
|
+
function _typeof(obj) {
|
|
320
|
+
"@babel/helpers - typeof";
|
|
321
|
+
|
|
322
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
323
|
+
return typeof obj;
|
|
324
|
+
} : function (obj) {
|
|
325
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
326
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
330
|
+
}(_typeof));
|
|
331
|
+
|
|
332
|
+
(function (module) {
|
|
333
|
+
var _typeof$1 = _typeof.exports["default"];
|
|
334
|
+
|
|
335
|
+
function _regeneratorRuntime() {
|
|
336
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
337
|
+
|
|
338
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
339
|
+
return exports;
|
|
340
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
341
|
+
var exports = {},
|
|
342
|
+
Op = Object.prototype,
|
|
343
|
+
hasOwn = Op.hasOwnProperty,
|
|
344
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
345
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
346
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
347
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
348
|
+
|
|
349
|
+
function define(obj, key, value) {
|
|
350
|
+
return Object.defineProperty(obj, key, {
|
|
351
|
+
value: value,
|
|
352
|
+
enumerable: !0,
|
|
353
|
+
configurable: !0,
|
|
354
|
+
writable: !0
|
|
355
|
+
}), obj[key];
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
try {
|
|
359
|
+
define({}, "");
|
|
360
|
+
} catch (err) {
|
|
361
|
+
define = function define(obj, key, value) {
|
|
362
|
+
return obj[key] = value;
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
367
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
368
|
+
generator = Object.create(protoGenerator.prototype),
|
|
369
|
+
context = new Context(tryLocsList || []);
|
|
370
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
371
|
+
var state = "suspendedStart";
|
|
372
|
+
return function (method, arg) {
|
|
373
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
374
|
+
|
|
375
|
+
if ("completed" === state) {
|
|
376
|
+
if ("throw" === method) throw arg;
|
|
377
|
+
return doneResult();
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
for (context.method = method, context.arg = arg;;) {
|
|
381
|
+
var delegate = context.delegate;
|
|
382
|
+
|
|
383
|
+
if (delegate) {
|
|
384
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
385
|
+
|
|
386
|
+
if (delegateResult) {
|
|
387
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
388
|
+
return delegateResult;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
393
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
394
|
+
context.dispatchException(context.arg);
|
|
395
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
396
|
+
state = "executing";
|
|
397
|
+
var record = tryCatch(innerFn, self, context);
|
|
398
|
+
|
|
399
|
+
if ("normal" === record.type) {
|
|
400
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
401
|
+
return {
|
|
402
|
+
value: record.arg,
|
|
403
|
+
done: context.done
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}(innerFn, self, context), generator;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function tryCatch(fn, obj, arg) {
|
|
414
|
+
try {
|
|
415
|
+
return {
|
|
416
|
+
type: "normal",
|
|
417
|
+
arg: fn.call(obj, arg)
|
|
418
|
+
};
|
|
419
|
+
} catch (err) {
|
|
420
|
+
return {
|
|
421
|
+
type: "throw",
|
|
422
|
+
arg: err
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
exports.wrap = wrap;
|
|
428
|
+
var ContinueSentinel = {};
|
|
429
|
+
|
|
430
|
+
function Generator() {}
|
|
431
|
+
|
|
432
|
+
function GeneratorFunction() {}
|
|
433
|
+
|
|
434
|
+
function GeneratorFunctionPrototype() {}
|
|
435
|
+
|
|
436
|
+
var IteratorPrototype = {};
|
|
437
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
438
|
+
return this;
|
|
439
|
+
});
|
|
440
|
+
var getProto = Object.getPrototypeOf,
|
|
441
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
442
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
443
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
444
|
+
|
|
445
|
+
function defineIteratorMethods(prototype) {
|
|
446
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
447
|
+
define(prototype, method, function (arg) {
|
|
448
|
+
return this._invoke(method, arg);
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
454
|
+
function invoke(method, arg, resolve, reject) {
|
|
455
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
456
|
+
|
|
457
|
+
if ("throw" !== record.type) {
|
|
458
|
+
var result = record.arg,
|
|
459
|
+
value = result.value;
|
|
460
|
+
return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
461
|
+
invoke("next", value, resolve, reject);
|
|
462
|
+
}, function (err) {
|
|
463
|
+
invoke("throw", err, resolve, reject);
|
|
464
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
465
|
+
result.value = unwrapped, resolve(result);
|
|
466
|
+
}, function (error) {
|
|
467
|
+
return invoke("throw", error, resolve, reject);
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
reject(record.arg);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
var previousPromise;
|
|
475
|
+
|
|
476
|
+
this._invoke = function (method, arg) {
|
|
477
|
+
function callInvokeWithMethodAndArg() {
|
|
478
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
479
|
+
invoke(method, arg, resolve, reject);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
488
|
+
var method = delegate.iterator[context.method];
|
|
489
|
+
|
|
490
|
+
if (undefined === method) {
|
|
491
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
492
|
+
if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
493
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
return ContinueSentinel;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
500
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
501
|
+
var info = record.arg;
|
|
502
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function pushTryEntry(locs) {
|
|
506
|
+
var entry = {
|
|
507
|
+
tryLoc: locs[0]
|
|
508
|
+
};
|
|
509
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
function resetTryEntry(entry) {
|
|
513
|
+
var record = entry.completion || {};
|
|
514
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function Context(tryLocsList) {
|
|
518
|
+
this.tryEntries = [{
|
|
519
|
+
tryLoc: "root"
|
|
520
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
function values(iterable) {
|
|
524
|
+
if (iterable) {
|
|
525
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
526
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
527
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
528
|
+
|
|
529
|
+
if (!isNaN(iterable.length)) {
|
|
530
|
+
var i = -1,
|
|
531
|
+
next = function next() {
|
|
532
|
+
for (; ++i < iterable.length;) {
|
|
533
|
+
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
return next.value = undefined, next.done = !0, next;
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
return next.next = next;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
return {
|
|
544
|
+
next: doneResult
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function doneResult() {
|
|
549
|
+
return {
|
|
550
|
+
value: undefined,
|
|
551
|
+
done: !0
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
556
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
557
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
558
|
+
}, exports.mark = function (genFun) {
|
|
559
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
560
|
+
}, exports.awrap = function (arg) {
|
|
561
|
+
return {
|
|
562
|
+
__await: arg
|
|
563
|
+
};
|
|
564
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
565
|
+
return this;
|
|
566
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
567
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
568
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
569
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
570
|
+
return result.done ? result.value : iter.next();
|
|
571
|
+
});
|
|
572
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
573
|
+
return this;
|
|
574
|
+
}), define(Gp, "toString", function () {
|
|
575
|
+
return "[object Generator]";
|
|
576
|
+
}), exports.keys = function (object) {
|
|
577
|
+
var keys = [];
|
|
578
|
+
|
|
579
|
+
for (var key in object) {
|
|
580
|
+
keys.push(key);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return keys.reverse(), function next() {
|
|
584
|
+
for (; keys.length;) {
|
|
585
|
+
var key = keys.pop();
|
|
586
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
return next.done = !0, next;
|
|
590
|
+
};
|
|
591
|
+
}, exports.values = values, Context.prototype = {
|
|
592
|
+
constructor: Context,
|
|
593
|
+
reset: function reset(skipTempReset) {
|
|
594
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
|
|
595
|
+
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
stop: function stop() {
|
|
599
|
+
this.done = !0;
|
|
600
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
601
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
602
|
+
return this.rval;
|
|
603
|
+
},
|
|
604
|
+
dispatchException: function dispatchException(exception) {
|
|
605
|
+
if (this.done) throw exception;
|
|
606
|
+
var context = this;
|
|
607
|
+
|
|
608
|
+
function handle(loc, caught) {
|
|
609
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
613
|
+
var entry = this.tryEntries[i],
|
|
614
|
+
record = entry.completion;
|
|
615
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
616
|
+
|
|
617
|
+
if (entry.tryLoc <= this.prev) {
|
|
618
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
619
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
620
|
+
|
|
621
|
+
if (hasCatch && hasFinally) {
|
|
622
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
623
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
624
|
+
} else if (hasCatch) {
|
|
625
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
626
|
+
} else {
|
|
627
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
628
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
abrupt: function abrupt(type, arg) {
|
|
634
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
635
|
+
var entry = this.tryEntries[i];
|
|
636
|
+
|
|
637
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
638
|
+
var finallyEntry = entry;
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
644
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
645
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
646
|
+
},
|
|
647
|
+
complete: function complete(record, afterLoc) {
|
|
648
|
+
if ("throw" === record.type) throw record.arg;
|
|
649
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
650
|
+
},
|
|
651
|
+
finish: function finish(finallyLoc) {
|
|
652
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
653
|
+
var entry = this.tryEntries[i];
|
|
654
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
"catch": function _catch(tryLoc) {
|
|
658
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
659
|
+
var entry = this.tryEntries[i];
|
|
660
|
+
|
|
661
|
+
if (entry.tryLoc === tryLoc) {
|
|
662
|
+
var record = entry.completion;
|
|
663
|
+
|
|
664
|
+
if ("throw" === record.type) {
|
|
665
|
+
var thrown = record.arg;
|
|
666
|
+
resetTryEntry(entry);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return thrown;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
throw new Error("illegal catch attempt");
|
|
674
|
+
},
|
|
675
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
676
|
+
return this.delegate = {
|
|
677
|
+
iterator: values(iterable),
|
|
678
|
+
resultName: resultName,
|
|
679
|
+
nextLoc: nextLoc
|
|
680
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
681
|
+
}
|
|
682
|
+
}, exports;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
686
|
+
}(regeneratorRuntime$1));
|
|
687
|
+
|
|
688
|
+
// TODO(Babel 8): Remove this file.
|
|
689
|
+
|
|
690
|
+
var runtime = regeneratorRuntime$1.exports();
|
|
691
|
+
var regenerator = runtime;
|
|
692
|
+
|
|
693
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
694
|
+
try {
|
|
695
|
+
regeneratorRuntime = runtime;
|
|
696
|
+
} catch (accidentalStrictMode) {
|
|
697
|
+
if (typeof globalThis === "object") {
|
|
698
|
+
globalThis.regeneratorRuntime = runtime;
|
|
699
|
+
} else {
|
|
700
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function getData(_ref) {
|
|
705
|
+
var url = _ref.url,
|
|
706
|
+
code = _ref.code,
|
|
707
|
+
token = _ref.token;
|
|
708
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
709
|
+
var response, data;
|
|
710
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
711
|
+
while (1) {
|
|
712
|
+
switch (_context.prev = _context.next) {
|
|
713
|
+
case 0:
|
|
714
|
+
_context.next = 2;
|
|
715
|
+
return fetch(url, {
|
|
716
|
+
method: 'POST',
|
|
717
|
+
headers: {
|
|
718
|
+
'Content-Type': 'application/json',
|
|
719
|
+
Authorization: token ? "Bearer ".concat(token) : ''
|
|
720
|
+
},
|
|
721
|
+
body: JSON.stringify({
|
|
722
|
+
code: code
|
|
723
|
+
})
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
case 2:
|
|
727
|
+
response = _context.sent;
|
|
728
|
+
|
|
729
|
+
if (response.ok) {
|
|
730
|
+
_context.next = 5;
|
|
731
|
+
break;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
throw new Error(response.statusText);
|
|
735
|
+
|
|
736
|
+
case 5:
|
|
737
|
+
_context.next = 7;
|
|
738
|
+
return response.json();
|
|
739
|
+
|
|
740
|
+
case 7:
|
|
741
|
+
data = _context.sent;
|
|
742
|
+
return _context.abrupt("return", data['data']);
|
|
743
|
+
|
|
744
|
+
case 9:
|
|
745
|
+
case "end":
|
|
746
|
+
return _context.stop();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}, _callee);
|
|
750
|
+
}));
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export { Page, Widget, getData };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ObjectType } from '.';
|
|
2
|
+
export declare type API_INPUT_TYPE = {
|
|
3
|
+
prefix: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface BaseAPIProps {
|
|
7
|
+
config?: ObjectType;
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
token: string | (() => Promise<string>);
|
|
10
|
+
data?: ObjectType;
|
|
11
|
+
url: string;
|
|
12
|
+
method: string;
|
|
13
|
+
onError?: (error: Error) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare type ACTION_TYPES = 'GET_WIDGET_DATA' | 'GET_PAGE_DATA';
|
|
16
|
+
export declare type API_TYPE = {
|
|
17
|
+
url: string;
|
|
18
|
+
method: string;
|
|
19
|
+
};
|
|
20
|
+
export declare type Routes_Input = {
|
|
21
|
+
[K in ACTION_TYPES]?: (data: API_INPUT_TYPE) => API_TYPE;
|
|
22
|
+
};
|
|
23
|
+
export interface PageData {
|
|
24
|
+
_id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
code: string;
|
|
27
|
+
widgets: WidgetData[];
|
|
28
|
+
}
|
|
29
|
+
export interface WidgetData {
|
|
30
|
+
_id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
code: string;
|
|
33
|
+
autoPlay: boolean;
|
|
34
|
+
isActive: boolean;
|
|
35
|
+
selectionTitle: string;
|
|
36
|
+
webPerRow: number;
|
|
37
|
+
mobilePerRow: number;
|
|
38
|
+
tabletPerRow: number;
|
|
39
|
+
widgetType: 'Image' | string;
|
|
40
|
+
selectionType: 'FixedCard' | 'Carousel';
|
|
41
|
+
tiles: TileData[];
|
|
42
|
+
collectionItems: CollectionItemType[];
|
|
43
|
+
}
|
|
44
|
+
export interface TileData {
|
|
45
|
+
_id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
altText: string;
|
|
48
|
+
link: string;
|
|
49
|
+
tileType: 'Web' | 'Mobile';
|
|
50
|
+
img: ImgData;
|
|
51
|
+
}
|
|
52
|
+
export interface ImgData {
|
|
53
|
+
_id: string;
|
|
54
|
+
uri: string;
|
|
55
|
+
}
|
|
56
|
+
export interface CollectionItemType {
|
|
57
|
+
_id: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Settings } from 'react-slick';
|
|
2
|
+
import { TileData, WidgetData, ObjectType, PageData, CollectionItemType } from './';
|
|
3
|
+
interface SlideProps {
|
|
4
|
+
onClick?: (data?: ObjectType) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface BannerProps extends SlideProps {
|
|
7
|
+
imageUrl: string;
|
|
8
|
+
imageAltText: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CardProps {
|
|
11
|
+
imageUrl: string;
|
|
12
|
+
imageAltText: string;
|
|
13
|
+
onClick?: (data?: ObjectType) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface ProductCardProps extends CardProps {
|
|
16
|
+
title: string;
|
|
17
|
+
subTitle?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SimpleCardProps extends ProductCardProps {
|
|
21
|
+
}
|
|
22
|
+
export interface HighlightCardProps extends ProductCardProps {
|
|
23
|
+
highlightedText: string;
|
|
24
|
+
dimmedText: string;
|
|
25
|
+
}
|
|
26
|
+
export interface UserCardProps extends CardProps {
|
|
27
|
+
name: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ReviewCardProps extends UserCardProps {
|
|
30
|
+
stars: number;
|
|
31
|
+
review: string;
|
|
32
|
+
}
|
|
33
|
+
export interface WidgetProps {
|
|
34
|
+
widgetData: WidgetData;
|
|
35
|
+
apiBaseUrl: string;
|
|
36
|
+
formatItem?: (item: TileData) => JSX.Element;
|
|
37
|
+
onClick?: (item: TileData) => void;
|
|
38
|
+
}
|
|
39
|
+
export interface WidgetTypeProps extends WidgetProps {
|
|
40
|
+
formatTile: (item: TileData) => JSX.Element;
|
|
41
|
+
formatItem: (item: CollectionItemType) => JSX.Element;
|
|
42
|
+
settings?: Settings;
|
|
43
|
+
}
|
|
44
|
+
export interface PageProps {
|
|
45
|
+
title?: string;
|
|
46
|
+
apiBaseUrl: string;
|
|
47
|
+
pageData: PageData;
|
|
48
|
+
formatItem?: (CODE: string, item: TileData) => JSX.Element;
|
|
49
|
+
onClick?: (CODE: string, item: TileData) => JSX.Element;
|
|
50
|
+
}
|
|
51
|
+
export interface CollectionItemProps {
|
|
52
|
+
name?: string;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WidgetData, PageData } from '../types';
|
|
2
|
+
interface GetDataParams {
|
|
3
|
+
url: string;
|
|
4
|
+
code: string;
|
|
5
|
+
token?: string | (() => Promise<string>);
|
|
6
|
+
}
|
|
7
|
+
export declare function getData({ url, code, token, }: GetDataParams): Promise<WidgetData | PageData>;
|
|
8
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@knovator/pagecreator",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git@github.com:knovator/pagecreator.git"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"pagecreator",
|
|
10
|
+
"pagebuilder",
|
|
11
|
+
"knovator",
|
|
12
|
+
"chavda-bhavik"
|
|
13
|
+
],
|
|
14
|
+
"author": "knovator (https://knovator.com/)",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"react-slick": "^0.29.0"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"lib",
|
|
20
|
+
"package.json",
|
|
21
|
+
"README.md",
|
|
22
|
+
"style.css",
|
|
23
|
+
"index.d.ts",
|
|
24
|
+
"index.js"
|
|
25
|
+
],
|
|
26
|
+
"module": "./index.js",
|
|
27
|
+
"main": "./index.js",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"types": "./index.d.ts"
|
|
30
|
+
}
|
package/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.slick-slider{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;box-sizing:border-box;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;user-select:none;-khtml-user-select:none}.slick-list,.slick-slider{display:block;position:relative}.slick-list{margin:0;overflow:hidden;padding:0}.slick-list:focus{outline:none}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{transform:translateZ(0)}.slick-track{display:block;left:0;margin-left:auto;margin-right:auto;position:relative;top:0}.slick-track:after,.slick-track:before{content:"";display:table}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{border:1px solid transparent;display:block;height:auto}.slick-arrow.slick-hidden{display:none}.slick-loading .slick-list{background:#fff url(ajax-loader.gif) 50% no-repeat}@font-face{font-family:slick;font-style:normal;font-weight:400;src:url(fonts/slick.eot);src:url(fonts/slick.eot?#iefix) format("embedded-opentype"),url(fonts/slick.woff) format("woff"),url(fonts/slick.ttf) format("truetype"),url(fonts/slick.svg#slick) format("svg")}.slick-next,.slick-prev{border:none;cursor:pointer;display:block;font-size:0;height:20px;line-height:0;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}.slick-next,.slick-next:focus,.slick-next:hover,.slick-prev,.slick-prev:focus,.slick-prev:hover{background:transparent;color:transparent;outline:none}.slick-next:focus:before,.slick-next:hover:before,.slick-prev:focus:before,.slick-prev:hover:before{opacity:1}.slick-next.slick-disabled:before,.slick-prev.slick-disabled:before{opacity:.25}.slick-next:before,.slick-prev:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#fff;font-family:slick;font-size:20px;line-height:1;opacity:.75}.slick-prev{left:-25px}[dir=rtl] .slick-prev{left:auto;right:-25px}.slick-prev:before{content:"←"}[dir=rtl] .slick-prev:before{content:"→"}.slick-next{right:-25px}[dir=rtl] .slick-next{left:-25px;right:auto}.slick-next:before{content:"→"}[dir=rtl] .slick-next:before{content:"←"}.slick-dotted.slick-slider{margin-bottom:30px}.slick-dots{bottom:-25px;display:block;list-style:none;margin:0;padding:0;position:absolute;text-align:center;width:100%}.slick-dots li{display:inline-block;margin:0 5px;padding:0;position:relative}.slick-dots li,.slick-dots li button{cursor:pointer;height:20px;width:20px}.slick-dots li button{background:transparent;border:0;color:transparent;display:block;font-size:0;line-height:0;outline:none;padding:5px}.slick-dots li button:focus,.slick-dots li button:hover{outline:none}.slick-dots li button:focus:before,.slick-dots li button:hover:before{opacity:1}.slick-dots li button:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#000;content:"•";font-family:slick;font-size:6px;height:20px;left:0;line-height:20px;opacity:.25;position:absolute;text-align:center;top:0;width:20px}.slick-dots li.slick-active button:before{color:#000;opacity:.75}/*! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.grid{display:grid}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-none{grid-template-columns:none}.kpc_widget{margin-top:2.5rem}@media (min-width:1024px){.kpc_widget{margin-top:4rem}}.kpc_widget-title{font-size:1.5rem;font-weight:700;line-height:2rem;margin-bottom:.5rem}.kpc_simple-card{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity));border-radius:.5rem;border-width:1px;display:flex;flex-direction:column;gap:.5rem;overflow:hidden;padding:.75rem}.kpc_simple-card-heading{flex-shrink:0}.kpc_simple-card-image{aspect-ratio:1/1;border-radius:.375rem;-o-object-fit:cover;object-fit:cover}.kpc_simple-card-body{display:contents;width:100%}.kpc_simple-card-label{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity));font-size:.75rem;line-height:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kpc_simple-card-content{align-items:center;justify-content:space-between;width:100%}.kpc_simple-card-title{font-size:1.125rem;font-weight:600;line-height:1.75rem;text-align:center}.kpc_simple-card-subtitle{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity));font-size:.75rem;line-height:1rem}.kpc_banner{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity));border-radius:.375rem;border-width:1px;padding:.25rem}.kpc_banner-image{aspect-ratio:1/1;height:100%;width:100%}.kpc_page-title{font-size:1.5rem;font-weight:700;line-height:2rem;margin-bottom:.5rem}.kpc_page-widgets>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.kpc_item{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity));border-radius:.375rem;border-width:2px;padding:.5rem}.kpc_item-text{font-size:1rem;font-weight:500;line-height:1.5rem;text-align:center}@media (min-width:640px){.sm\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.sm\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.sm\:grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.sm\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\:grid-cols-none{grid-template-columns:none}}@media (min-width:768px){.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.md\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.md\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.md\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.md\:grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:grid-cols-none{grid-template-columns:none}}@media (min-width:1024px){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-none{grid-template-columns:none}}@media (min-width:1280px){.xl\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.xl\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.xl\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.xl\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.xl\:grid-cols-none{grid-template-columns:none}}@media (min-width:1536px){.\32xl\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.\32xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\32xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.\32xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.\32xl\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.\32xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.\32xl\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.\32xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.\32xl\:grid-cols-11{grid-template-columns:repeat(11,minmax(0,1fr))}.\32xl\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.\32xl\:grid-cols-none{grid-template-columns:none}}
|