@knovator/pagecreator 0.0.3 → 0.2.0
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 +21 -9
- package/index.d.ts +1 -4
- package/package.json +2 -6
- package/index.js +0 -713
- package/lib/components/common/Card/banner/banner.d.ts +0 -3
- package/lib/components/common/Card/simple-card/simple-card.d.ts +0 -3
- package/lib/components/common/collection-item/collection-item.d.ts +0 -3
- package/lib/components/page/page.d.ts +0 -3
- package/lib/components/widget/carousel-widget/carousel-widget.d.ts +0 -3
- package/lib/components/widget/fixed-widget/fixed-widget.d.ts +0 -3
- package/lib/components/widget/widget.d.ts +0 -3
- package/lib/icons/Next.d.ts +0 -2
- package/lib/icons/Previous.d.ts +0 -2
- package/lib/types/api.d.ts +0 -59
- package/lib/types/common.d.ts +0 -3
- package/lib/types/components.d.ts +0 -54
- package/lib/types/index.d.ts +0 -3
- package/lib/utils/helper.d.ts +0 -8
- package/style.css +0 -1
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ We can use `@knovator/pagecreator` in React/Next application, we can create one
|
|
|
112
112
|
import { Widget } from '@knovator/pagecreator';
|
|
113
113
|
|
|
114
114
|
<Widget
|
|
115
|
-
|
|
115
|
+
imageBaseUrl=''
|
|
116
116
|
widgetData={}
|
|
117
117
|
onClick={...}
|
|
118
118
|
>
|
|
@@ -120,19 +120,29 @@ import { Widget } from '@knovator/pagecreator';
|
|
|
120
120
|
**Props**
|
|
121
121
|
- `widgetData`
|
|
122
122
|
- [widgetData](data-formats.md#widgetdata)
|
|
123
|
-
- `
|
|
124
|
-
- baseUrl to
|
|
125
|
-
- `formatItem` (optional): `(item:
|
|
123
|
+
- `imageBaseUrl`
|
|
124
|
+
- baseUrl to append before image urls
|
|
125
|
+
- `formatItem` (optional): `(item: ItemData) => JSX.Element`
|
|
126
126
|
- Customize look of Items
|
|
127
|
-
- `onClick` (optional): `(item:
|
|
127
|
+
- `onClick` (optional): `(item: ItemData) => void;`
|
|
128
128
|
- OnItem click handler
|
|
129
|
+
- `hideTitle` (optional): boolean;
|
|
130
|
+
- Do not show the title if true
|
|
131
|
+
- `settings` (optional): [react-slick Settings](https://react-slick.neostack.com/docs/api)
|
|
132
|
+
- Settings to apply for carousel widget
|
|
133
|
+
- `className` (optional): string
|
|
134
|
+
- Class name for widget
|
|
135
|
+
- `formatHeader` (optional): `(title: string, data: WidgetData) => string | JSX.Element`
|
|
136
|
+
- Function to format the widget header
|
|
137
|
+
- `formatFooter` (optional): `(data: WidgetData) => string | JSX.Element`
|
|
138
|
+
- Function to format the widget footer
|
|
129
139
|
|
|
130
140
|
### Page
|
|
131
141
|
```jsx
|
|
132
142
|
import { Page } from '@knovator/pagecreator';
|
|
133
143
|
|
|
134
144
|
<Page
|
|
135
|
-
|
|
145
|
+
imageBaseUrl=''
|
|
136
146
|
pageData={...}
|
|
137
147
|
onClick={...}
|
|
138
148
|
>
|
|
@@ -140,14 +150,16 @@ import { Page } from '@knovator/pagecreator';
|
|
|
140
150
|
**Props**
|
|
141
151
|
- `title` (optional)
|
|
142
152
|
- Title to show on page
|
|
143
|
-
- `
|
|
153
|
+
- `imageBaseUrl`
|
|
144
154
|
- baseUrl to start prefix image urls
|
|
145
155
|
- `pageData`
|
|
146
156
|
- [PageData](data-formats.md#pagedata)
|
|
147
|
-
- `formatItem` (optional): `(CODE: string, item:
|
|
157
|
+
- `formatItem` (optional): `(CODE: string, item: ItemData) => JSX.Element;`
|
|
148
158
|
- Customize look of Items
|
|
149
|
-
- `onClick` (optional): `(CODE: string, item:
|
|
159
|
+
- `onClick` (optional): `(CODE: string, item: ItemData) => JSX.Element;`
|
|
150
160
|
- On Item click handler
|
|
161
|
+
- `hideWidgetTitles` (optional): boolean
|
|
162
|
+
- Flag to hide widget titles
|
|
151
163
|
|
|
152
164
|
### getData
|
|
153
165
|
It's possible to fetch data by yourself and pass them to `Widget` or `Page` components, but if you need easy solution you can use `getData` function.
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knovator/pagecreator",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git@github.com:knovator/pagecreator.git"
|
|
@@ -22,9 +22,5 @@
|
|
|
22
22
|
"style.css",
|
|
23
23
|
"index.d.ts",
|
|
24
24
|
"index.js"
|
|
25
|
-
]
|
|
26
|
-
"module": "./index.js",
|
|
27
|
-
"main": "./index.js",
|
|
28
|
-
"type": "module",
|
|
29
|
-
"types": "./index.d.ts"
|
|
25
|
+
]
|
|
30
26
|
}
|
package/index.js
DELETED
|
@@ -1,713 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import Slider from 'react-slick';
|
|
3
|
-
|
|
4
|
-
function FixedWidget(_ref) {
|
|
5
|
-
var widgetData = _ref.widgetData,
|
|
6
|
-
formatItem = _ref.formatItem;
|
|
7
|
-
return jsx("div", Object.assign({
|
|
8
|
-
className: "grid grid-cols-".concat(widgetData.mobilePerRow, " md:grid-cols-").concat(widgetData.tabletPerRow, " lg:grid-cols-").concat(widgetData.webPerRow)
|
|
9
|
-
}, {
|
|
10
|
-
children: widgetData.widgetType === 'Image' ? widgetData.tiles.map(function (tile) {
|
|
11
|
-
return formatItem(tile);
|
|
12
|
-
}) : widgetData.collectionItems.map(function (item) {
|
|
13
|
-
return formatItem(item);
|
|
14
|
-
})
|
|
15
|
-
}));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/******************************************************************************
|
|
19
|
-
Copyright (c) Microsoft Corporation.
|
|
20
|
-
|
|
21
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
-
purpose with or without fee is hereby granted.
|
|
23
|
-
|
|
24
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
-
***************************************************************************** */
|
|
32
|
-
|
|
33
|
-
function __rest(s, e) {
|
|
34
|
-
var t = {};
|
|
35
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
36
|
-
t[p] = s[p];
|
|
37
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
39
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
40
|
-
t[p[i]] = s[p[i]];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
46
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
47
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
48
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
49
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
50
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
51
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
var Next = function Next() {
|
|
56
|
-
return jsx("svg", Object.assign({
|
|
57
|
-
width: "12",
|
|
58
|
-
height: "12",
|
|
59
|
-
viewBox: "0 0 12 12",
|
|
60
|
-
fill: "none",
|
|
61
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
62
|
-
}, {
|
|
63
|
-
children: jsx("path", {
|
|
64
|
-
d: "M9.129 5.25L5.106 1.227L6.1665 0.166504L12 6L6.1665 11.8335L5.106 10.773L9.129 6.75H0V5.25H9.129Z",
|
|
65
|
-
fill: "#40B5E8"
|
|
66
|
-
})
|
|
67
|
-
}));
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var Previous = function Previous() {
|
|
71
|
-
return jsx("svg", Object.assign({
|
|
72
|
-
width: "12",
|
|
73
|
-
height: "12",
|
|
74
|
-
viewBox: "0 0 12 12",
|
|
75
|
-
fill: "none",
|
|
76
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
77
|
-
}, {
|
|
78
|
-
children: jsx("path", {
|
|
79
|
-
d: "M2.871 5.25L6.894 1.227L5.8335 0.166504L0 6L5.8335 11.8335L6.894 10.773L2.871 6.75H12V5.25H2.871Z",
|
|
80
|
-
fill: "#40B5E8"
|
|
81
|
-
})
|
|
82
|
-
}));
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
var SlickArrowLeft = function SlickArrowLeft(_a) {
|
|
86
|
-
var currentSlide = _a.currentSlide;
|
|
87
|
-
_a.slideCount;
|
|
88
|
-
var props = __rest(_a, ["currentSlide", "slideCount"]);
|
|
89
|
-
|
|
90
|
-
return jsx("button", Object.assign({}, props, {
|
|
91
|
-
className: 'slick-prev slick-arrow' + (currentSlide === 0 ? ' slick-disabled' : ''),
|
|
92
|
-
"aria-hidden": "true",
|
|
93
|
-
"aria-disabled": currentSlide === 0 ? true : false,
|
|
94
|
-
type: "button"
|
|
95
|
-
}, {
|
|
96
|
-
children: jsx(Previous, {})
|
|
97
|
-
}));
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
var SlickArrowRight = function SlickArrowRight(_a) {
|
|
101
|
-
var currentSlide = _a.currentSlide,
|
|
102
|
-
slideCount = _a.slideCount,
|
|
103
|
-
props = __rest(_a, ["currentSlide", "slideCount"]);
|
|
104
|
-
|
|
105
|
-
return jsx("button", Object.assign({}, props, {
|
|
106
|
-
className: 'slick-next slick-arrow' + (slideCount && currentSlide === slideCount - 1 ? ' slick-disabled' : ''),
|
|
107
|
-
"aria-hidden": "true",
|
|
108
|
-
"aria-disabled": slideCount && currentSlide === slideCount - 1 ? true : false,
|
|
109
|
-
type: "button"
|
|
110
|
-
}, {
|
|
111
|
-
children: jsx(Next, {})
|
|
112
|
-
}));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
function CarouselWidget(_ref) {
|
|
116
|
-
var widgetData = _ref.widgetData,
|
|
117
|
-
formatItem = _ref.formatItem,
|
|
118
|
-
settings = _ref.settings;
|
|
119
|
-
var defaultSettings = {
|
|
120
|
-
dots: false,
|
|
121
|
-
infinite: true,
|
|
122
|
-
slidesToShow: widgetData.mobilePerRow,
|
|
123
|
-
slidesToScroll: 1,
|
|
124
|
-
autoplay: widgetData.autoPlay,
|
|
125
|
-
autoplaySpeed: 1500,
|
|
126
|
-
pauseOnHover: true,
|
|
127
|
-
nextArrow: jsx(SlickArrowRight, {}),
|
|
128
|
-
prevArrow: jsx(SlickArrowLeft, {}),
|
|
129
|
-
responsive: [{
|
|
130
|
-
breakpoint: 768,
|
|
131
|
-
settings: {
|
|
132
|
-
slidesToShow: widgetData.tabletPerRow
|
|
133
|
-
}
|
|
134
|
-
}, {
|
|
135
|
-
breakpoint: 1024,
|
|
136
|
-
settings: {
|
|
137
|
-
arrows: false,
|
|
138
|
-
slidesToShow: widgetData.webPerRow
|
|
139
|
-
}
|
|
140
|
-
}]
|
|
141
|
-
};
|
|
142
|
-
if (!widgetData) return null;
|
|
143
|
-
return jsx(Slider, Object.assign({}, settings ? settings : defaultSettings, {
|
|
144
|
-
children: widgetData.widgetType === 'Image' ? widgetData.tiles.map(function (tile) {
|
|
145
|
-
return jsx("div", {
|
|
146
|
-
children: formatItem(tile)
|
|
147
|
-
});
|
|
148
|
-
}) : widgetData.collectionItems.map(function (item) {
|
|
149
|
-
return jsx("div", {
|
|
150
|
-
children: formatItem(item)
|
|
151
|
-
});
|
|
152
|
-
})
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function Banner(_ref) {
|
|
157
|
-
var imageAltText = _ref.imageAltText,
|
|
158
|
-
imageUrl = _ref.imageUrl,
|
|
159
|
-
_onClick = _ref.onClick;
|
|
160
|
-
return jsx("div", Object.assign({
|
|
161
|
-
className: "kpc_banner"
|
|
162
|
-
}, {
|
|
163
|
-
children: jsx("img", {
|
|
164
|
-
src: imageUrl,
|
|
165
|
-
alt: imageAltText,
|
|
166
|
-
className: "kpc_banner-image",
|
|
167
|
-
onClick: function onClick() {
|
|
168
|
-
return _onClick && _onClick();
|
|
169
|
-
}
|
|
170
|
-
})
|
|
171
|
-
}));
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function CollectionItem(_ref) {
|
|
175
|
-
var name = _ref.name,
|
|
176
|
-
_onClick = _ref.onClick;
|
|
177
|
-
return jsx("div", Object.assign({
|
|
178
|
-
className: "kpc_item",
|
|
179
|
-
onClick: function onClick() {
|
|
180
|
-
return _onClick && _onClick();
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
children: jsx("p", Object.assign({
|
|
184
|
-
className: "kpc_item-text"
|
|
185
|
-
}, {
|
|
186
|
-
children: name || 'Laurem Ipsum'
|
|
187
|
-
}))
|
|
188
|
-
}));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function Widget(_ref) {
|
|
192
|
-
var widgetData = _ref.widgetData,
|
|
193
|
-
apiBaseUrl = _ref.apiBaseUrl,
|
|
194
|
-
formatItem = _ref.formatItem,
|
|
195
|
-
_onClick = _ref.onClick,
|
|
196
|
-
settings = _ref.settings;
|
|
197
|
-
|
|
198
|
-
var formatTile = function formatTile(tile) {
|
|
199
|
-
var _a;
|
|
200
|
-
|
|
201
|
-
if (typeof formatItem === 'function' && formatItem) return formatItem(tile);else if (widgetData.widgetType === 'Image') return jsx(Banner, {
|
|
202
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
203
|
-
// @ts-ignore
|
|
204
|
-
imageUrl: "".concat(apiBaseUrl).concat((_a = tile.img) === null || _a === void 0 ? void 0 : _a.uri),
|
|
205
|
-
imageAltText: tile._id,
|
|
206
|
-
onClick: function onClick() {
|
|
207
|
-
return _onClick && _onClick(tile);
|
|
208
|
-
}
|
|
209
|
-
}, tile._id);else return jsx(CollectionItem, Object.assign({
|
|
210
|
-
onClick: function onClick() {
|
|
211
|
-
return _onClick && _onClick(tile);
|
|
212
|
-
}
|
|
213
|
-
}, tile), tile._id);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
if (!widgetData) return null;
|
|
217
|
-
return jsxs("div", Object.assign({
|
|
218
|
-
className: "kpc_widget"
|
|
219
|
-
}, {
|
|
220
|
-
children: [jsx("h2", Object.assign({
|
|
221
|
-
className: "kpc_widget-title"
|
|
222
|
-
}, {
|
|
223
|
-
children: widgetData.selectionTitle
|
|
224
|
-
})), jsx("div", Object.assign({
|
|
225
|
-
className: "kpc_widget-body"
|
|
226
|
-
}, {
|
|
227
|
-
children: widgetData.selectionType === 'Carousel' ? jsx(CarouselWidget, {
|
|
228
|
-
settings: settings,
|
|
229
|
-
apiBaseUrl: apiBaseUrl,
|
|
230
|
-
widgetData: widgetData,
|
|
231
|
-
formatItem: formatTile
|
|
232
|
-
}) : jsx(FixedWidget, {
|
|
233
|
-
apiBaseUrl: apiBaseUrl,
|
|
234
|
-
widgetData: widgetData,
|
|
235
|
-
formatItem: formatTile
|
|
236
|
-
})
|
|
237
|
-
}))]
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function Page(_ref) {
|
|
242
|
-
var title = _ref.title,
|
|
243
|
-
apiBaseUrl = _ref.apiBaseUrl,
|
|
244
|
-
pageData = _ref.pageData,
|
|
245
|
-
formatItem = _ref.formatItem,
|
|
246
|
-
onClick = _ref.onClick;
|
|
247
|
-
if (!pageData) return null;
|
|
248
|
-
return jsxs("div", Object.assign({
|
|
249
|
-
className: "kpc_page"
|
|
250
|
-
}, {
|
|
251
|
-
children: [jsx("h1", Object.assign({
|
|
252
|
-
className: "kpc_page-title"
|
|
253
|
-
}, {
|
|
254
|
-
children: title
|
|
255
|
-
})), jsx("div", Object.assign({
|
|
256
|
-
className: "kpc_page-widgets"
|
|
257
|
-
}, {
|
|
258
|
-
children: pageData.widgets.map(function (widgetData, index) {
|
|
259
|
-
return jsx(Widget, {
|
|
260
|
-
widgetData: widgetData,
|
|
261
|
-
apiBaseUrl: apiBaseUrl,
|
|
262
|
-
formatItem: formatItem && function (tileData) {
|
|
263
|
-
return formatItem(widgetData.code, tileData);
|
|
264
|
-
},
|
|
265
|
-
onClick: onClick && function (tileData) {
|
|
266
|
-
return onClick(widgetData.code, tileData);
|
|
267
|
-
}
|
|
268
|
-
}, index);
|
|
269
|
-
})
|
|
270
|
-
}))]
|
|
271
|
-
}));
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
var regeneratorRuntime$1 = {exports: {}};
|
|
275
|
-
|
|
276
|
-
var _typeof = {exports: {}};
|
|
277
|
-
|
|
278
|
-
(function (module) {
|
|
279
|
-
function _typeof(obj) {
|
|
280
|
-
"@babel/helpers - typeof";
|
|
281
|
-
|
|
282
|
-
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
283
|
-
return typeof obj;
|
|
284
|
-
} : function (obj) {
|
|
285
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
286
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
290
|
-
}(_typeof));
|
|
291
|
-
|
|
292
|
-
(function (module) {
|
|
293
|
-
var _typeof$1 = _typeof.exports["default"];
|
|
294
|
-
|
|
295
|
-
function _regeneratorRuntime() {
|
|
296
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
297
|
-
|
|
298
|
-
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
299
|
-
return exports;
|
|
300
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
301
|
-
var exports = {},
|
|
302
|
-
Op = Object.prototype,
|
|
303
|
-
hasOwn = Op.hasOwnProperty,
|
|
304
|
-
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
305
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
306
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
307
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
308
|
-
|
|
309
|
-
function define(obj, key, value) {
|
|
310
|
-
return Object.defineProperty(obj, key, {
|
|
311
|
-
value: value,
|
|
312
|
-
enumerable: !0,
|
|
313
|
-
configurable: !0,
|
|
314
|
-
writable: !0
|
|
315
|
-
}), obj[key];
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
try {
|
|
319
|
-
define({}, "");
|
|
320
|
-
} catch (err) {
|
|
321
|
-
define = function define(obj, key, value) {
|
|
322
|
-
return obj[key] = value;
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
327
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
328
|
-
generator = Object.create(protoGenerator.prototype),
|
|
329
|
-
context = new Context(tryLocsList || []);
|
|
330
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
331
|
-
var state = "suspendedStart";
|
|
332
|
-
return function (method, arg) {
|
|
333
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
334
|
-
|
|
335
|
-
if ("completed" === state) {
|
|
336
|
-
if ("throw" === method) throw arg;
|
|
337
|
-
return doneResult();
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
for (context.method = method, context.arg = arg;;) {
|
|
341
|
-
var delegate = context.delegate;
|
|
342
|
-
|
|
343
|
-
if (delegate) {
|
|
344
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
345
|
-
|
|
346
|
-
if (delegateResult) {
|
|
347
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
348
|
-
return delegateResult;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
353
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
354
|
-
context.dispatchException(context.arg);
|
|
355
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
356
|
-
state = "executing";
|
|
357
|
-
var record = tryCatch(innerFn, self, context);
|
|
358
|
-
|
|
359
|
-
if ("normal" === record.type) {
|
|
360
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
361
|
-
return {
|
|
362
|
-
value: record.arg,
|
|
363
|
-
done: context.done
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
}(innerFn, self, context), generator;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function tryCatch(fn, obj, arg) {
|
|
374
|
-
try {
|
|
375
|
-
return {
|
|
376
|
-
type: "normal",
|
|
377
|
-
arg: fn.call(obj, arg)
|
|
378
|
-
};
|
|
379
|
-
} catch (err) {
|
|
380
|
-
return {
|
|
381
|
-
type: "throw",
|
|
382
|
-
arg: err
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
exports.wrap = wrap;
|
|
388
|
-
var ContinueSentinel = {};
|
|
389
|
-
|
|
390
|
-
function Generator() {}
|
|
391
|
-
|
|
392
|
-
function GeneratorFunction() {}
|
|
393
|
-
|
|
394
|
-
function GeneratorFunctionPrototype() {}
|
|
395
|
-
|
|
396
|
-
var IteratorPrototype = {};
|
|
397
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
398
|
-
return this;
|
|
399
|
-
});
|
|
400
|
-
var getProto = Object.getPrototypeOf,
|
|
401
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
402
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
403
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
404
|
-
|
|
405
|
-
function defineIteratorMethods(prototype) {
|
|
406
|
-
["next", "throw", "return"].forEach(function (method) {
|
|
407
|
-
define(prototype, method, function (arg) {
|
|
408
|
-
return this._invoke(method, arg);
|
|
409
|
-
});
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
414
|
-
function invoke(method, arg, resolve, reject) {
|
|
415
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
416
|
-
|
|
417
|
-
if ("throw" !== record.type) {
|
|
418
|
-
var result = record.arg,
|
|
419
|
-
value = result.value;
|
|
420
|
-
return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
421
|
-
invoke("next", value, resolve, reject);
|
|
422
|
-
}, function (err) {
|
|
423
|
-
invoke("throw", err, resolve, reject);
|
|
424
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
425
|
-
result.value = unwrapped, resolve(result);
|
|
426
|
-
}, function (error) {
|
|
427
|
-
return invoke("throw", error, resolve, reject);
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
reject(record.arg);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
var previousPromise;
|
|
435
|
-
|
|
436
|
-
this._invoke = function (method, arg) {
|
|
437
|
-
function callInvokeWithMethodAndArg() {
|
|
438
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
439
|
-
invoke(method, arg, resolve, reject);
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
448
|
-
var method = delegate.iterator[context.method];
|
|
449
|
-
|
|
450
|
-
if (undefined === method) {
|
|
451
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
452
|
-
if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
453
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
return ContinueSentinel;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
460
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
461
|
-
var info = record.arg;
|
|
462
|
-
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);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
function pushTryEntry(locs) {
|
|
466
|
-
var entry = {
|
|
467
|
-
tryLoc: locs[0]
|
|
468
|
-
};
|
|
469
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
function resetTryEntry(entry) {
|
|
473
|
-
var record = entry.completion || {};
|
|
474
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
function Context(tryLocsList) {
|
|
478
|
-
this.tryEntries = [{
|
|
479
|
-
tryLoc: "root"
|
|
480
|
-
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
function values(iterable) {
|
|
484
|
-
if (iterable) {
|
|
485
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
486
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
487
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
488
|
-
|
|
489
|
-
if (!isNaN(iterable.length)) {
|
|
490
|
-
var i = -1,
|
|
491
|
-
next = function next() {
|
|
492
|
-
for (; ++i < iterable.length;) {
|
|
493
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
return next.value = undefined, next.done = !0, next;
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
return next.next = next;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
return {
|
|
504
|
-
next: doneResult
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
function doneResult() {
|
|
509
|
-
return {
|
|
510
|
-
value: undefined,
|
|
511
|
-
done: !0
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
516
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
517
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
518
|
-
}, exports.mark = function (genFun) {
|
|
519
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
520
|
-
}, exports.awrap = function (arg) {
|
|
521
|
-
return {
|
|
522
|
-
__await: arg
|
|
523
|
-
};
|
|
524
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
525
|
-
return this;
|
|
526
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
527
|
-
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
528
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
529
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
530
|
-
return result.done ? result.value : iter.next();
|
|
531
|
-
});
|
|
532
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
533
|
-
return this;
|
|
534
|
-
}), define(Gp, "toString", function () {
|
|
535
|
-
return "[object Generator]";
|
|
536
|
-
}), exports.keys = function (object) {
|
|
537
|
-
var keys = [];
|
|
538
|
-
|
|
539
|
-
for (var key in object) {
|
|
540
|
-
keys.push(key);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
return keys.reverse(), function next() {
|
|
544
|
-
for (; keys.length;) {
|
|
545
|
-
var key = keys.pop();
|
|
546
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
return next.done = !0, next;
|
|
550
|
-
};
|
|
551
|
-
}, exports.values = values, Context.prototype = {
|
|
552
|
-
constructor: Context,
|
|
553
|
-
reset: function reset(skipTempReset) {
|
|
554
|
-
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) {
|
|
555
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
556
|
-
}
|
|
557
|
-
},
|
|
558
|
-
stop: function stop() {
|
|
559
|
-
this.done = !0;
|
|
560
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
561
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
562
|
-
return this.rval;
|
|
563
|
-
},
|
|
564
|
-
dispatchException: function dispatchException(exception) {
|
|
565
|
-
if (this.done) throw exception;
|
|
566
|
-
var context = this;
|
|
567
|
-
|
|
568
|
-
function handle(loc, caught) {
|
|
569
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
573
|
-
var entry = this.tryEntries[i],
|
|
574
|
-
record = entry.completion;
|
|
575
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
576
|
-
|
|
577
|
-
if (entry.tryLoc <= this.prev) {
|
|
578
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
579
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
580
|
-
|
|
581
|
-
if (hasCatch && hasFinally) {
|
|
582
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
583
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
584
|
-
} else if (hasCatch) {
|
|
585
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
586
|
-
} else {
|
|
587
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
588
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
abrupt: function abrupt(type, arg) {
|
|
594
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
595
|
-
var entry = this.tryEntries[i];
|
|
596
|
-
|
|
597
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
598
|
-
var finallyEntry = entry;
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
604
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
605
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
606
|
-
},
|
|
607
|
-
complete: function complete(record, afterLoc) {
|
|
608
|
-
if ("throw" === record.type) throw record.arg;
|
|
609
|
-
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;
|
|
610
|
-
},
|
|
611
|
-
finish: function finish(finallyLoc) {
|
|
612
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
613
|
-
var entry = this.tryEntries[i];
|
|
614
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
615
|
-
}
|
|
616
|
-
},
|
|
617
|
-
"catch": function _catch(tryLoc) {
|
|
618
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
619
|
-
var entry = this.tryEntries[i];
|
|
620
|
-
|
|
621
|
-
if (entry.tryLoc === tryLoc) {
|
|
622
|
-
var record = entry.completion;
|
|
623
|
-
|
|
624
|
-
if ("throw" === record.type) {
|
|
625
|
-
var thrown = record.arg;
|
|
626
|
-
resetTryEntry(entry);
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
return thrown;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
throw new Error("illegal catch attempt");
|
|
634
|
-
},
|
|
635
|
-
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
636
|
-
return this.delegate = {
|
|
637
|
-
iterator: values(iterable),
|
|
638
|
-
resultName: resultName,
|
|
639
|
-
nextLoc: nextLoc
|
|
640
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
641
|
-
}
|
|
642
|
-
}, exports;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
646
|
-
}(regeneratorRuntime$1));
|
|
647
|
-
|
|
648
|
-
// TODO(Babel 8): Remove this file.
|
|
649
|
-
|
|
650
|
-
var runtime = regeneratorRuntime$1.exports();
|
|
651
|
-
var regenerator = runtime;
|
|
652
|
-
|
|
653
|
-
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
654
|
-
try {
|
|
655
|
-
regeneratorRuntime = runtime;
|
|
656
|
-
} catch (accidentalStrictMode) {
|
|
657
|
-
if (typeof globalThis === "object") {
|
|
658
|
-
globalThis.regeneratorRuntime = runtime;
|
|
659
|
-
} else {
|
|
660
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
function getData(_ref) {
|
|
665
|
-
var url = _ref.url,
|
|
666
|
-
code = _ref.code,
|
|
667
|
-
token = _ref.token;
|
|
668
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
669
|
-
var response, data;
|
|
670
|
-
return regenerator.wrap(function _callee$(_context) {
|
|
671
|
-
while (1) {
|
|
672
|
-
switch (_context.prev = _context.next) {
|
|
673
|
-
case 0:
|
|
674
|
-
_context.next = 2;
|
|
675
|
-
return fetch(url, {
|
|
676
|
-
method: 'POST',
|
|
677
|
-
headers: {
|
|
678
|
-
'Content-Type': 'application/json',
|
|
679
|
-
Authorization: token ? "Bearer ".concat(token) : ''
|
|
680
|
-
},
|
|
681
|
-
body: JSON.stringify({
|
|
682
|
-
code: code
|
|
683
|
-
})
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
case 2:
|
|
687
|
-
response = _context.sent;
|
|
688
|
-
|
|
689
|
-
if (response.ok) {
|
|
690
|
-
_context.next = 5;
|
|
691
|
-
break;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
throw new Error(response.statusText);
|
|
695
|
-
|
|
696
|
-
case 5:
|
|
697
|
-
_context.next = 7;
|
|
698
|
-
return response.json();
|
|
699
|
-
|
|
700
|
-
case 7:
|
|
701
|
-
data = _context.sent;
|
|
702
|
-
return _context.abrupt("return", data['data']);
|
|
703
|
-
|
|
704
|
-
case 9:
|
|
705
|
-
case "end":
|
|
706
|
-
return _context.stop();
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
}, _callee);
|
|
710
|
-
}));
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
export { Page, Widget, getData };
|
package/lib/icons/Next.d.ts
DELETED
package/lib/icons/Previous.d.ts
DELETED
package/lib/types/api.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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
|
-
}
|
package/lib/types/common.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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 | CollectionItemType) => JSX.Element;
|
|
37
|
-
onClick?: (item: TileData | CollectionItemType) => void;
|
|
38
|
-
settings?: Settings;
|
|
39
|
-
}
|
|
40
|
-
export interface WidgetTypeProps extends WidgetProps {
|
|
41
|
-
formatItem: (item: CollectionItemType | TileData) => JSX.Element;
|
|
42
|
-
}
|
|
43
|
-
export interface PageProps {
|
|
44
|
-
title?: string;
|
|
45
|
-
apiBaseUrl: string;
|
|
46
|
-
pageData: PageData;
|
|
47
|
-
formatItem?: (CODE: string, item: TileData | CollectionItemType) => JSX.Element;
|
|
48
|
-
onClick?: (CODE: string, item: TileData | CollectionItemType) => JSX.Element;
|
|
49
|
-
}
|
|
50
|
-
export interface CollectionItemProps {
|
|
51
|
-
name?: string;
|
|
52
|
-
onClick?: () => void;
|
|
53
|
-
}
|
|
54
|
-
export {};
|
package/lib/types/index.d.ts
DELETED
package/lib/utils/helper.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
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}}
|