@bigbinary/neeto-templates-frontend 2.0.2 → 2.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/dist/index.js CHANGED
@@ -1,1301 +1,38 @@
1
- import * as React from 'react';
2
- import { useState, useRef, useCallback, useEffect, createElement, memo } from 'react';
3
- import { noop, removeBy, renameKeys } from '@bigbinary/neeto-cist';
4
- import Modal from '@bigbinary/neetoui/Modal';
5
- import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
6
- import Search from '@bigbinary/neeto-molecules/Search';
7
- import Spinner from '@bigbinary/neetoui/Spinner';
8
- import Typography from '@bigbinary/neetoui/Typography';
9
- import { useTranslation } from 'react-i18next';
10
- import { refetchTags, TagsComponent, NeetoTags } from '@bigbinary/neeto-tags-frontend';
11
- import { useQuery, useInfiniteQuery, keepPreviousData, useMutation, useQueryClient } from '@tanstack/react-query';
12
- import { useMutationWithInvalidation, useBreakpoints } from '@bigbinary/neeto-commons-frontend/react-utils';
13
- import { prop, pluck } from 'ramda';
14
- import axios from 'axios';
15
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
16
- import classnames from 'classnames';
17
- import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
18
- import ResponsiveDevicePicker from '@bigbinary/neeto-molecules/ResponsiveDevicePicker';
19
- import Button from '@bigbinary/neetoui/Button';
20
- import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
21
- import Form from '@bigbinary/neetoui/formik/Form';
22
- import { useParams } from 'react-router-dom';
23
- import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
24
- import { useField, useFormikContext } from 'formik';
25
- import Header from '@bigbinary/neeto-molecules/Header';
26
- import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
27
- import Label from '@bigbinary/neetoui/Label';
28
- import { t as t$1 } from 'i18next';
29
-
30
- function _arrayWithHoles(arr) {
31
- if (Array.isArray(arr)) return arr;
32
- }
33
-
34
- function _iterableToArrayLimit(r, l) {
35
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
36
- if (null != t) {
37
- var e,
38
- n,
39
- i,
40
- u,
41
- a = [],
42
- f = !0,
43
- o = !1;
44
- try {
45
- if (i = (t = t.call(r)).next, 0 === l) {
46
- if (Object(t) !== t) return;
47
- f = !1;
48
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
49
- } catch (r) {
50
- o = !0, n = r;
51
- } finally {
52
- try {
53
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
54
- } finally {
55
- if (o) throw n;
56
- }
57
- }
58
- return a;
59
- }
60
- }
61
-
62
- function _arrayLikeToArray(arr, len) {
63
- if (len == null || len > arr.length) len = arr.length;
64
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
65
- return arr2;
66
- }
67
-
68
- function _unsupportedIterableToArray(o, minLen) {
69
- if (!o) return;
70
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
71
- var n = Object.prototype.toString.call(o).slice(8, -1);
72
- if (n === "Object" && o.constructor) n = o.constructor.name;
73
- if (n === "Map" || n === "Set") return Array.from(o);
74
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
75
- }
76
-
77
- function _nonIterableRest() {
78
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
79
- }
80
-
81
- function _slicedToArray(arr, i) {
82
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
83
- }
84
-
85
- var TEMPLATE_SCREENS = {
86
- LIST: "List",
87
- PREVIEW: "Preview"
88
- };
89
- var DEFAULT_CATEGORY = {
90
- id: "all",
91
- name: "All"
92
- };
93
- var INFINITE_SCROLL_DELAY = 500;
94
- var RESPONSIVE_DEVICES = {
95
- DESKTOP: "desktop",
96
- TABLET: "tablet",
97
- MOBILE: "mobile"
98
- };
99
-
100
- function _typeof(o) {
101
- "@babel/helpers - typeof";
102
-
103
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
104
- return typeof o;
105
- } : function (o) {
106
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
107
- }, _typeof(o);
108
- }
109
-
110
- function _toPrimitive(input, hint) {
111
- if (_typeof(input) !== "object" || input === null) return input;
112
- var prim = input[Symbol.toPrimitive];
113
- if (prim !== undefined) {
114
- var res = prim.call(input, hint || "default");
115
- if (_typeof(res) !== "object") return res;
116
- throw new TypeError("@@toPrimitive must return a primitive value.");
117
- }
118
- return (hint === "string" ? String : Number)(input);
119
- }
120
-
121
- function _toPropertyKey(arg) {
122
- var key = _toPrimitive(arg, "string");
123
- return _typeof(key) === "symbol" ? key : String(key);
124
- }
125
-
126
- function _defineProperty(obj, key, value) {
127
- key = _toPropertyKey(key);
128
- if (key in obj) {
129
- Object.defineProperty(obj, key, {
130
- value: value,
131
- enumerable: true,
132
- configurable: true,
133
- writable: true
134
- });
135
- } else {
136
- obj[key] = value;
137
- }
138
- return obj;
139
- }
140
-
141
- function _arrayWithoutHoles(arr) {
142
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
143
- }
144
-
145
- function _iterableToArray(iter) {
146
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
147
- }
148
-
149
- function _nonIterableSpread() {
150
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
151
- }
152
-
153
- function _toConsumableArray(arr) {
154
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
155
- }
156
-
157
- function createObserverCache() {
158
- var cachesByRoot = new Map();
159
-
160
- function getObserver(_ref) {
161
- var root = _ref.root,
162
- rootMargin = _ref.rootMargin,
163
- threshold = _ref.threshold;
164
- var cacheByRoot = cachesByRoot.get(root);
165
-
166
- if (!cacheByRoot) {
167
- cacheByRoot = new Map();
168
- cachesByRoot.set(root, cacheByRoot);
169
- }
170
-
171
- var cacheKey = JSON.stringify({
172
- rootMargin: rootMargin,
173
- threshold: threshold
174
- });
175
- var cachedObserver = cacheByRoot.get(cacheKey);
176
-
177
- if (!cachedObserver) {
178
- var entryCallbacks = new Map();
179
- var observer = new IntersectionObserver(function (entries) {
180
- entries.forEach(function (entry) {
181
- var callback = entryCallbacks.get(entry.target);
182
- callback == null ? void 0 : callback(entry);
183
- });
184
- }, {
185
- root: root,
186
- rootMargin: rootMargin,
187
- threshold: threshold
188
- });
189
- cachedObserver = {
190
- observer: observer,
191
- entryCallbacks: entryCallbacks
192
- };
193
- cacheByRoot.set(cacheKey, cachedObserver);
194
- }
195
-
196
- return {
197
- observe: function observe(node, callback) {
198
- var _cachedObserver, _cachedObserver2;
199
-
200
- (_cachedObserver = cachedObserver) == null ? void 0 : _cachedObserver.entryCallbacks.set(node, callback);
201
- (_cachedObserver2 = cachedObserver) == null ? void 0 : _cachedObserver2.observer.observe(node);
202
- },
203
- unobserve: function unobserve(node) {
204
- var _cachedObserver3, _cachedObserver4;
205
-
206
- (_cachedObserver3 = cachedObserver) == null ? void 0 : _cachedObserver3.entryCallbacks["delete"](node);
207
- (_cachedObserver4 = cachedObserver) == null ? void 0 : _cachedObserver4.observer.unobserve(node);
208
- }
209
- };
210
- }
211
-
212
- return {
213
- getObserver: getObserver
214
- };
215
- }
216
-
217
- var DEFAULT_ROOT_MARGIN = '0px';
218
- var DEFAULT_THRESHOLD = [0];
219
- var observerCache = /*#__PURE__*/createObserverCache(); // For more info:
220
- // https://developers.google.com/web/updates/2016/04/intersectionobserver
221
- // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
222
-
223
- function useIntersectionObserver(args) {
224
- var _args$rootMargin, _args$threshold;
225
-
226
- var rootMargin = (_args$rootMargin = args == null ? void 0 : args.rootMargin) != null ? _args$rootMargin : DEFAULT_ROOT_MARGIN;
227
- var threshold = (_args$threshold = args == null ? void 0 : args.threshold) != null ? _args$threshold : DEFAULT_THRESHOLD;
228
- var nodeRef = useRef(null);
229
- var rootRef = useRef(null);
230
- var observerRef = useRef(null);
231
-
232
- var _useState = useState(),
233
- entry = _useState[0],
234
- setEntry = _useState[1];
235
-
236
- var observe = useCallback(function () {
237
- var node = nodeRef.current;
238
-
239
- if (!node) {
240
- setEntry(undefined);
241
- return;
242
- }
243
-
244
- var observer = observerCache.getObserver({
245
- root: rootRef.current,
246
- rootMargin: rootMargin,
247
- threshold: threshold
248
- });
249
- observer.observe(node, function (observedEntry) {
250
- setEntry(observedEntry);
251
- });
252
- observerRef.current = observer;
253
- }, [rootMargin, threshold]);
254
- var unobserve = useCallback(function () {
255
- var currentObserver = observerRef.current;
256
- var node = nodeRef.current;
257
-
258
- if (node) {
259
- currentObserver == null ? void 0 : currentObserver.unobserve(node);
260
- }
261
-
262
- observerRef.current = null;
263
- }, []); // React will call the ref callback with the DOM element when the component mounts,
264
- // and call it with null when it unmounts.
265
- // So, we don't need an useEffect etc to unobserve nodes.
266
- // When nodeRef.current is null, it will be unobserved and observe function
267
- // won't do anything.
268
-
269
- var refCallback = useCallback(function (node) {
270
- unobserve();
271
- nodeRef.current = node;
272
- observe();
273
- }, [observe, unobserve]);
274
- var rootRefCallback = useCallback(function (rootNode) {
275
- unobserve();
276
- rootRef.current = rootNode;
277
- observe();
278
- }, [observe, unobserve]);
279
- return [refCallback, {
280
- entry: entry,
281
- rootRef: rootRefCallback
282
- }];
283
- }
284
-
285
- function _extends$1() {
286
- _extends$1 = Object.assign || function (target) {
287
- for (var i = 1; i < arguments.length; i++) {
288
- var source = arguments[i];
289
-
290
- for (var key in source) {
291
- if (Object.prototype.hasOwnProperty.call(source, key)) {
292
- target[key] = source[key];
293
- }
294
- }
295
- }
296
-
297
- return target;
298
- };
299
-
300
- return _extends$1.apply(this, arguments);
301
- }
302
-
303
- function useTrackVisibility(args) {
304
- var _result$entry;
305
-
306
- var _useIntersectionObser = useIntersectionObserver(args),
307
- ref = _useIntersectionObser[0],
308
- result = _useIntersectionObser[1];
309
-
310
- var isVisible = Boolean((_result$entry = result.entry) == null ? void 0 : _result$entry.isIntersecting);
311
-
312
- var _useState = useState(isVisible),
313
- wasEverVisible = _useState[0],
314
- setWasEverVisible = _useState[1];
315
-
316
- if (isVisible && !wasEverVisible) {
317
- setWasEverVisible(true);
318
- }
319
-
320
- return [ref, _extends$1({}, result, {
321
- isVisible: isVisible,
322
- wasEverVisible: wasEverVisible
323
- })];
324
- }
325
-
326
- var DEFAULT_DELAY_IN_MS = 100;
327
-
328
- function useInfiniteScroll(_ref) {
329
- var loading = _ref.loading,
330
- hasNextPage = _ref.hasNextPage,
331
- onLoadMore = _ref.onLoadMore,
332
- rootMargin = _ref.rootMargin,
333
- disabled = _ref.disabled,
334
- _ref$delayInMs = _ref.delayInMs,
335
- delayInMs = _ref$delayInMs === void 0 ? DEFAULT_DELAY_IN_MS : _ref$delayInMs;
336
-
337
- var _useTrackVisibility = useTrackVisibility({
338
- rootMargin: rootMargin
339
- }),
340
- ref = _useTrackVisibility[0],
341
- _useTrackVisibility$ = _useTrackVisibility[1],
342
- rootRef = _useTrackVisibility$.rootRef,
343
- isVisible = _useTrackVisibility$.isVisible;
344
-
345
- var shouldLoadMore = !disabled && !loading && isVisible && hasNextPage; // eslint-disable-next-line consistent-return
346
-
347
- useEffect(function () {
348
- if (shouldLoadMore) {
349
- // When we trigger 'onLoadMore' and new items are added to the list,
350
- // right before they become rendered on the screen, 'loading' becomes false
351
- // and 'isVisible' can be true for a brief time, based on the scroll position.
352
- // So, it triggers 'onLoadMore' just after the first one is finished.
353
- // We use a small delay here to prevent this kind of situations.
354
- // It can be configured by hook args.
355
- var timer = setTimeout(function () {
356
- onLoadMore();
357
- }, delayInMs);
358
- return function () {
359
- clearTimeout(timer);
360
- };
361
- }
362
- }, [onLoadMore, shouldLoadMore, delayInMs]);
363
- return [ref, {
364
- rootRef: rootRef
365
- }];
366
- }
367
-
368
- var _rect, _path;
369
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
370
- const SvgCustom = props => /*#__PURE__*/React.createElement("svg", _extends({
371
- xmlns: "http://www.w3.org/2000/svg",
372
- width: 46,
373
- height: 46,
374
- fill: "none"
375
- }, props), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
376
- width: 40,
377
- height: 40,
378
- x: 3,
379
- y: 2,
380
- fill: "#008068",
381
- rx: 2
382
- })), _path || (_path = /*#__PURE__*/React.createElement("path", {
383
- fill: "#fff",
384
- fillRule: "evenodd",
385
- d: "M23.75 16a.75.75 0 0 0-1.5 0v5.25H17a.75.75 0 0 0 0 1.5h5.25V28a.75.75 0 0 0 1.5 0v-5.25H29a.75.75 0 0 0 0-1.5h-5.25V16Z",
386
- clipRule: "evenodd"
387
- })));
388
-
389
- var IMAGE_SIZE_LIMIT_IN_MEGABYTES = 1;
390
- var NEETO_TEMPLATES_URL = "/neeto_templates_engine/api/v1";
391
- var TEMPLATE_TAGS_URL = "".concat(NEETO_TEMPLATES_URL, "/tags/template_tags");
392
-
393
- //routes of the host
394
- var TEMPLATES_URL = "/api/v1/templates";
395
- var TEMPLATES_SETTINGS_URL = "/api/v1/settings";
396
- var IMAGE_UPLOAD_CONFIG = {
397
- maxImageSize: IMAGE_SIZE_LIMIT_IN_MEGABYTES
398
- };
399
-
400
- var list$1 = function list(params) {
401
- return axios.get(TEMPLATES_URL, {
402
- params: params
403
- });
404
- };
405
- var create$1 = function create(_ref) {
406
- var id = _ref.id;
407
- return axios.post(TEMPLATES_URL, {
408
- template: {
409
- id: id
410
- }
411
- }, {
412
- showToastr: false
413
- });
414
- };
415
- var fetch = function fetch(_ref2) {
416
- var templateId = _ref2.templateId;
417
- return axios.get("".concat(TEMPLATES_SETTINGS_URL, "/").concat(templateId));
418
- };
419
- var update = function update(_ref3) {
420
- var resourceId = _ref3.resourceId,
421
- payload = _ref3.payload;
422
- return axios.put("".concat(TEMPLATES_SETTINGS_URL, "/").concat(resourceId), payload);
423
- };
424
- var templatesApi = {
425
- list: list$1,
426
- create: create$1,
427
- update: update,
428
- fetch: fetch
429
- };
430
-
431
- var QUERY_KEYS = {
432
- TEMPLATES_LIST: "templates-list",
433
- TEMPLATE: "templates-detail",
434
- TEMPLATE_TAGS: "tag-key"
435
- };
436
-
437
- function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
438
- function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
439
- var useFetchTemplates = function useFetchTemplates(_ref) {
440
- var searchTerm = _ref.searchTerm,
441
- category = _ref.category;
442
- return useInfiniteQuery({
443
- queryKey: [QUERY_KEYS.TEMPLATES_LIST, searchTerm, category],
444
- queryFn: function queryFn(_ref2) {
445
- var _ref2$pageParam = _ref2.pageParam,
446
- pageParam = _ref2$pageParam === void 0 ? 1 : _ref2$pageParam;
447
- return templatesApi.list({
448
- page: pageParam,
449
- searchTerm: searchTerm,
450
- category: category
451
- });
452
- },
453
- getNextPageParam: function getNextPageParam(lastPage) {
454
- return lastPage.hasNextPage ? lastPage.page + 1 : undefined;
455
- },
456
- select: function select(data) {
457
- var templates = data.pages.flatMap(prop("templates"));
458
- var lastPage = data.pages[data.pages.length - 1];
459
- return {
460
- templates: templates,
461
- hasNextPage: lastPage.hasNextPage,
462
- page: lastPage.page,
463
- tags: lastPage.tags,
464
- templatesCount: lastPage.templatesCount
465
- };
466
- },
467
- initialPageParam: 1,
468
- placeholderData: keepPreviousData
469
- });
470
- };
471
- var useCreateTemplate = function useCreateTemplate() {
472
- return useMutation({
473
- mutationFn: templatesApi.create
474
- });
475
- };
476
- var useFetchTemplate = function useFetchTemplate(_ref3, options) {
477
- var resourceId = _ref3.resourceId;
478
- return useQuery(_objectSpread$5({
479
- queryKey: [QUERY_KEYS.TEMPLATE, resourceId],
480
- queryFn: function queryFn() {
481
- return templatesApi.fetch({
482
- templateId: resourceId
483
- });
484
- }
485
- }, options));
486
- };
487
- var useUpdateTemplate = function useUpdateTemplate(_ref4) {
488
- var resourceId = _ref4.resourceId;
489
- return useMutationWithInvalidation(function (_ref5) {
490
- var template = _ref5.template;
491
- return templatesApi.update({
492
- resourceId: resourceId,
493
- payload: {
494
- template: template
495
- }
496
- });
497
- }, {
498
- keysToInvalidate: [[QUERY_KEYS.TEMPLATES_LIST], [QUERY_KEYS.TEMPLATE, resourceId]],
499
- onSuccess: function onSuccess() {
500
- refetchTags();
501
- }
502
- });
503
- };
504
-
505
- var BlankCard = function BlankCard(_ref) {
506
- var Icon = _ref.icon,
507
- title = _ref.title,
508
- description = _ref.description,
509
- _ref$onClick = _ref.onClick,
510
- onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
511
- _ref$disabled = _ref.disabled,
512
- disabled = _ref$disabled === void 0 ? false : _ref$disabled;
513
- return /*#__PURE__*/jsxs("div", {
514
- className: "neeto-ui-rounded-lg neeto-ui-bg-white hover:neeto-ui-bg-white neeto-ui-border-primary-500 flex cursor-pointer flex-col items-center justify-center border border-dashed p-6 outline-none transition-all duration-300 ease-in-out hover:border-solid focus:border-solid",
515
- "data-cy": "start-from-scratch-button",
516
- tabIndex: 0,
517
- onClick: !disabled ? onClick : noop,
518
- children: [/*#__PURE__*/jsx("div", {
519
- className: "neeto-ui-text-primary-500 mb-4",
520
- children: /*#__PURE__*/jsx(Icon, {
521
- size: 40
522
- })
523
- }), /*#__PURE__*/jsx(Typography, {
524
- className: "text-center",
525
- lineHeight: "normal",
526
- style: "h5",
527
- weight: "semibold",
528
- children: title
529
- }), /*#__PURE__*/jsx(Typography, {
530
- className: "neeto-ui-text-gray-600 text-center",
531
- lineHeight: "leading-4",
532
- style: "body3",
533
- children: description
534
- })]
535
- });
536
- };
537
-
538
- var Card = function Card(_ref) {
539
- var template = _ref.template,
540
- onClick = _ref.onClick;
541
- return /*#__PURE__*/jsxs("div", {
542
- onClick: onClick,
543
- className: "neeto-template neeto-template-thumbnail neeto-ui-bg-white neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border outline-none transition-colors duration-300 ease-in-out",
544
- "data-cy": "template-card",
545
- tabIndex: 0,
546
- children: [/*#__PURE__*/jsx("div", {
547
- className: "neeto-template__header relative overflow-hidden",
548
- children: /*#__PURE__*/jsx("img", {
549
- className: "neeto-template__image",
550
- "data-cy": "template-thumbnail-image",
551
- src: template.imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
552
- })
553
- }), /*#__PURE__*/jsx("div", {
554
- className: "neeto-template__description neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg px-3 py-1.5",
555
- children: /*#__PURE__*/jsx(Typography, {
556
- className: "neeto-template-thumbnail__title line-clamp-2",
557
- "data-cy": "template-card-title",
558
- lineHeight: "normal",
559
- style: "h5",
560
- children: template.title
561
- })
562
- })]
563
- });
564
- };
565
-
566
- var CategoryItem = function CategoryItem(_ref) {
567
- var label = _ref.label,
568
- count = _ref.count,
569
- isActive = _ref.isActive,
570
- setCurrentCategory = _ref.setCurrentCategory;
571
- return /*#__PURE__*/jsxs("button", {
572
- "data-cy": "category-".concat(joinHyphenCase(label)),
573
- tabIndex: 0,
574
- className: classnames("neeto-ui-rounded-lg outline-none flex w-full items-center justify-between gap-2 border border-solid px-3 py-2 text-sm font-medium leading-4 transition-all duration-300 ease-in-out", {
575
- "neeto-ui-text-gray-700 hover:neeto-ui-bg-gray-200 focus:neeto-ui-bg-gray-200 border-transparent": !isActive,
576
- "neeto-ui-text-gray-800 neeto-ui-bg-white neeto-ui-border-gray-300 focus:neeto-ui-border-gray-500": isActive
577
- }),
578
- onClick: setCurrentCategory,
579
- children: [/*#__PURE__*/jsx("span", {
580
- children: label
581
- }), /*#__PURE__*/jsx("span", {
582
- children: count
583
- })]
584
- });
585
- };
586
-
587
- function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
588
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
589
- var List = function List(_ref) {
590
- var setCurrentScreen = _ref.setCurrentScreen,
591
- setSelectedTemplate = _ref.setSelectedTemplate,
592
- onCreate = _ref.onCreate,
593
- isCreating = _ref.isCreating,
594
- afterCreate = _ref.afterCreate,
595
- refetchResource = _ref.refetchResource;
596
- var _useTranslation = useTranslation(),
597
- t = _useTranslation.t;
598
- var _useState = useState(DEFAULT_CATEGORY),
599
- _useState2 = _slicedToArray(_useState, 2),
600
- currentCategory = _useState2[0],
601
- _setCurrentCategory = _useState2[1];
602
- var _useState3 = useState(""),
603
- _useState4 = _slicedToArray(_useState3, 2),
604
- searchTerm = _useState4[0],
605
- setSearchTerm = _useState4[1];
606
- var _useFetchTemplates = useFetchTemplates({
607
- searchTerm: searchTerm,
608
- category: currentCategory
609
- }),
610
- _useFetchTemplates$ha = _useFetchTemplates.hasNextPage,
611
- hasNextPage = _useFetchTemplates$ha === void 0 ? false : _useFetchTemplates$ha,
612
- fetchNextPage = _useFetchTemplates.fetchNextPage,
613
- isTemplatesLoading = _useFetchTemplates.isLoading,
614
- _useFetchTemplates$da = _useFetchTemplates.data,
615
- data = _useFetchTemplates$da === void 0 ? {} : _useFetchTemplates$da;
616
- var _useInfiniteScroll = useInfiniteScroll({
617
- loading: isTemplatesLoading,
618
- hasNextPage: hasNextPage,
619
- onLoadMore: fetchNextPage,
620
- rootMargin: "0px 0px 700px 0px",
621
- delayInMs: INFINITE_SCROLL_DELAY
622
- }),
623
- _useInfiniteScroll2 = _slicedToArray(_useInfiniteScroll, 2),
624
- sentryRef = _useInfiniteScroll2[0],
625
- rootRef = _useInfiniteScroll2[1].rootRef;
626
- var handleCardClick = function handleCardClick(template) {
627
- setCurrentScreen(TEMPLATE_SCREENS.PREVIEW);
628
- setSelectedTemplate(template);
629
- };
630
- if (isTemplatesLoading) {
631
- return /*#__PURE__*/jsx(PageLoader, {});
632
- }
633
- var _data$tags = data.tags,
634
- tags = _data$tags === void 0 ? [] : _data$tags,
635
- _data$templates = data.templates,
636
- templates = _data$templates === void 0 ? [] : _data$templates,
637
- _data$templatesCount = data.templatesCount,
638
- templatesCount = _data$templatesCount === void 0 ? 0 : _data$templatesCount;
639
- var categories = [_objectSpread$4(_objectSpread$4({}, DEFAULT_CATEGORY), {}, {
640
- count: templatesCount
641
- })].concat(_toConsumableArray(tags));
642
- return /*#__PURE__*/jsxs("div", {
643
- className: "neeto-ui-bg-gray-100 relative flex min-h-full items-start",
644
- children: [/*#__PURE__*/jsxs("div", {
645
- className: "sticky left-0 top-0 w-52 flex-shrink-0 space-y-8 py-6 pl-4 md:w-72 md:pl-10 lg:w-80 xl:pl-16",
646
- children: [/*#__PURE__*/jsxs("div", {
647
- className: "space-y-4",
648
- children: [/*#__PURE__*/jsxs("div", {
649
- className: "space-y-1",
650
- children: [/*#__PURE__*/jsx(Typography, {
651
- "data-cy": "create-new-form-title",
652
- style: "h2",
653
- weight: "semibold",
654
- children: t("neetoTemplate.templates.createNewEntity")
655
- }), /*#__PURE__*/jsx(Typography, {
656
- lineHeight: "normal",
657
- style: "body2",
658
- children: t("neetoTemplate.templates.description")
659
- })]
660
- }), /*#__PURE__*/jsx(Search, {
661
- autoFocus: true,
662
- disableTrimOnBlur: true,
663
- "data-cy": "template-search-input",
664
- placeholder: t("neetoTemplate.templates.search"),
665
- onSearch: function onSearch(value) {
666
- return setSearchTerm(value);
667
- }
668
- })]
669
- }), /*#__PURE__*/jsxs("div", {
670
- className: "space-y-3",
671
- children: [/*#__PURE__*/jsx(Typography, {
672
- className: "uppercase",
673
- "data-cy": "template-categories-label",
674
- style: "h6",
675
- children: t("neetoTemplate.templates.categories")
676
- }), /*#__PURE__*/jsx("div", {
677
- className: "space-y-2",
678
- children: categories.map(function (_ref2) {
679
- var id = _ref2.id,
680
- name = _ref2.name,
681
- count = _ref2.count;
682
- return /*#__PURE__*/createElement(CategoryItem, {
683
- count: count,
684
- isActive: currentCategory.id === id,
685
- key: id,
686
- label: name,
687
- setCurrentCategory: function setCurrentCategory() {
688
- return _setCurrentCategory({
689
- id: id,
690
- name: name
691
- });
692
- }
693
- });
694
- })
695
- })]
696
- })]
697
- }), /*#__PURE__*/jsx("div", {
698
- className: "h-screen w-full overflow-y-auto py-8 pl-5 pr-4 md:pl-8 md:pr-20 xl:px-20",
699
- ref: rootRef,
700
- children: /*#__PURE__*/jsxs("div", {
701
- className: "flex-grow space-y-6",
702
- children: [/*#__PURE__*/jsxs("div", {
703
- className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 lg:gap-5 xl:gap-6 2xl:grid-cols-4",
704
- children: [/*#__PURE__*/jsx(BlankCard, {
705
- description: t("neetoTemplate.templates.blankCard.description"),
706
- disabled: isCreating,
707
- icon: isCreating ? Spinner : SvgCustom,
708
- title: t("neetoTemplate.templates.blankCard.title"),
709
- onClick: onCreate
710
- }), templates.map(function (template, index) {
711
- return /*#__PURE__*/createElement(Card, {
712
- afterCreate: afterCreate,
713
- refetchResource: refetchResource,
714
- template: template,
715
- key: index,
716
- onClick: function onClick() {
717
- return handleCardClick(template);
718
- }
719
- });
720
- })]
721
- }), hasNextPage && /*#__PURE__*/jsx("div", {
722
- className: "my-10 text-center",
723
- ref: sentryRef,
724
- children: /*#__PURE__*/jsx(Spinner, {})
725
- })]
726
- })
727
- })]
728
- });
729
- };
730
-
731
- var Preview$1 = function Preview(_ref) {
732
- var selectedTemplate = _ref.selectedTemplate,
733
- setCurrentScreen = _ref.setCurrentScreen,
734
- afterCreate = _ref.afterCreate,
735
- refetchResource = _ref.refetchResource;
736
- var _useTranslation = useTranslation(),
737
- t = _useTranslation.t;
738
- var _useBreakpoints = useBreakpoints(),
739
- isSize = _useBreakpoints.isSize;
740
- var _useCreateTemplate = useCreateTemplate(),
741
- createTemplate = _useCreateTemplate.mutate,
742
- isCreating = _useCreateTemplate.isPending;
743
- var _useState = useState(RESPONSIVE_DEVICES.DESKTOP),
744
- _useState2 = _slicedToArray(_useState, 2),
745
- selectedDevice = _useState2[0],
746
- setSelectedDevice = _useState2[1];
747
- var handleCreateTemplate = function handleCreateTemplate() {
748
- createTemplate({
749
- id: selectedTemplate.id
750
- }, {
751
- onSuccess: function onSuccess(response) {
752
- afterCreate(response);
753
- refetchResource();
754
- }
755
- });
756
- };
757
- var title = selectedTemplate.title,
758
- previewUrl = selectedTemplate.previewUrl;
759
- return /*#__PURE__*/jsxs("div", {
760
- className: "neeto-templates-full-page-preview flex h-full w-full flex-col",
761
- children: [/*#__PURE__*/jsx("div", {
762
- className: "neeto-templates-full-page-preview__header neeto-ui-border-gray-200 border-b px-4",
763
- children: /*#__PURE__*/jsxs("div", {
764
- className: "mx-auto flex w-full max-w-6xl items-center justify-between py-[9px]",
765
- children: [/*#__PURE__*/jsx("div", {
766
- className: "w-1/3",
767
- children: /*#__PURE__*/jsx(Typography, {
768
- className: "truncate leading-tight",
769
- "data-cy": "preview-template-title",
770
- style: "h3",
771
- weight: "semibold",
772
- children: title
773
- })
774
- }), /*#__PURE__*/jsx("div", {
775
- className: "hidden flex-shrink-0 lg:flex",
776
- children: /*#__PURE__*/jsx(ResponsiveDevicePicker, {
777
- selectedDevice: selectedDevice,
778
- onDeviceChange: setSelectedDevice
779
- })
780
- }), /*#__PURE__*/jsxs("div", {
781
- className: "flex w-1/3 items-center justify-end gap-2",
782
- children: [/*#__PURE__*/jsx(Button, {
783
- className: "flex-shrink-0",
784
- "data-cy": "preview-template-back-button",
785
- style: "secondary",
786
- label: isSize("mobile") ? t("neetoTemplate.templates.back") : t("neetoTemplate.templates.backToTemplates"),
787
- onClick: function onClick() {
788
- return setCurrentScreen(TEMPLATE_SCREENS.LIST);
789
- }
790
- }), /*#__PURE__*/jsx(Button, {
791
- className: "flex-shrink-0",
792
- "data-cy": "preview-use-template-button",
793
- disabled: isCreating,
794
- label: t("neetoTemplate.templates.editTemplate"),
795
- loading: isCreating,
796
- onClick: handleCreateTemplate
797
- })]
798
- })]
799
- })
800
- }), /*#__PURE__*/jsx("div", {
801
- className: "neeto-ui-bg-gray-200 neeto-templates-full-page-preview__holder-wrapper min-h-0 flex-grow",
802
- children: /*#__PURE__*/jsx("div", {
803
- className: classnames("neeto-templates-full-page-preview__holder m-auto", {
804
- "neeto-templates-full-page-preview__holder--desktop": selectedDevice === RESPONSIVE_DEVICES.DESKTOP,
805
- "neeto-templates-full-page-preview__holder--tablet": selectedDevice === RESPONSIVE_DEVICES.TABLET,
806
- "neeto-templates-full-page-preview__holder--mobile": selectedDevice === RESPONSIVE_DEVICES.MOBILE
807
- }),
808
- children: /*#__PURE__*/jsx("div", {
809
- className: "neeto-templates-full-page-preview__device-border h-full w-full",
810
- children: /*#__PURE__*/jsx("iframe", {
811
- className: "neeto-templates-full-page-preview__iframe h-full w-full border-none",
812
- "data-cy": "iframe-id",
813
- src: previewUrl
814
- })
815
- })
816
- })
817
- })]
818
- });
819
- };
820
-
821
- var CreateTemplateModal = function CreateTemplateModal(_ref) {
822
- var isOpen = _ref.isOpen,
823
- onClose = _ref.onClose,
824
- isCreating = _ref.isCreating,
825
- refetchResource = _ref.refetchResource,
826
- _ref$onCreate = _ref.onCreate,
827
- onCreate = _ref$onCreate === void 0 ? noop : _ref$onCreate,
828
- _ref$afterCreate = _ref.afterCreate,
829
- afterCreate = _ref$afterCreate === void 0 ? noop : _ref$afterCreate;
830
- var _useState = useState(TEMPLATE_SCREENS.LIST),
831
- _useState2 = _slicedToArray(_useState, 2),
832
- currentScreen = _useState2[0],
833
- setCurrentScreen = _useState2[1];
834
- var _useState3 = useState({}),
835
- _useState4 = _slicedToArray(_useState3, 2),
836
- selectedTemplate = _useState4[0],
837
- setSelectedTemplate = _useState4[1];
838
- var onModalClose = function onModalClose() {
839
- onClose();
840
- setTimeout(function () {
841
- setCurrentScreen(TEMPLATE_SCREENS.LIST);
842
- }, 300); //To accommodate the animation duration.
843
- };
844
-
845
- return /*#__PURE__*/jsx(Modal, {
846
- isOpen: isOpen,
847
- className: "neeto-template-list h-screen w-screen overflow-y-auto",
848
- closeButton: currentScreen === TEMPLATE_SCREENS.LIST,
849
- size: "fullScreen",
850
- onClose: onModalClose,
851
- children: currentScreen === TEMPLATE_SCREENS.LIST ? /*#__PURE__*/jsx(List, {
852
- afterCreate: afterCreate,
853
- isCreating: isCreating,
854
- onCreate: onCreate,
855
- refetchResource: refetchResource,
856
- setCurrentScreen: setCurrentScreen,
857
- setSelectedTemplate: setSelectedTemplate
858
- }) : /*#__PURE__*/jsx(Preview$1, {
859
- afterCreate: afterCreate,
860
- refetchResource: refetchResource,
861
- selectedTemplate: selectedTemplate,
862
- setCurrentScreen: setCurrentScreen
863
- })
864
- });
865
- };
866
-
867
- var create = function create(payload) {
868
- return axios.post(TEMPLATE_TAGS_URL, {
869
- tag: payload
870
- }, {
871
- showToastr: false
872
- });
873
- };
874
- var list = function list() {
875
- return axios.get(TEMPLATE_TAGS_URL);
876
- };
877
- var templateTagsApi = {
878
- create: create,
879
- list: list
880
- };
881
-
882
- function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
883
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
884
- var useCreateTemplateTag = function useCreateTemplateTag(options) {
885
- return useMutation(_objectSpread$3(_objectSpread$3({
886
- mutationFn: templateTagsApi.create
887
- }, options), {}, {
888
- onSuccess: function onSuccess() {
889
- var _options$onSuccess;
890
- refetchTags();
891
- options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
892
- }
893
- }));
894
- };
895
- var useFetchTemplateTags = function useFetchTemplateTags() {
896
- return useQuery({
897
- queryKey: [QUERY_KEYS.TEMPLATE_TAGS],
898
- queryFn: templateTagsApi.list
899
- });
900
- };
901
-
902
- var FormikImageUploader = function FormikImageUploader(_ref) {
903
- var name = _ref.name;
904
- var _useField = useField(name),
905
- _useField2 = _slicedToArray(_useField, 3),
906
- field = _useField2[0];
907
- _useField2[1];
908
- var setValue = _useField2[2].setValue;
909
- var _useFormikContext = useFormikContext(),
910
- setFieldValue = _useFormikContext.setFieldValue;
911
- var handleImageUpload = function handleImageUpload(file) {
912
- setFieldValue("imageSignedId", file.signedId);
913
- return setValue(file.url);
914
- };
915
- return /*#__PURE__*/jsx(ImageUploader, {
916
- className: "h-52 w-full md:h-80",
917
- src: field.value,
918
- uploadConfig: IMAGE_UPLOAD_CONFIG,
919
- onUploadComplete: handleImageUpload
920
- });
921
- };
922
-
923
- var PageWrapper = function PageWrapper(_ref) {
924
- var children = _ref.children,
925
- className = _ref.className;
926
- return /*#__PURE__*/jsx("div", {
927
- className: classnames("w-full flex-col", className),
928
- children: children
929
- });
930
- };
931
- var PageHeader = function PageHeader(_ref2) {
932
- var title = _ref2.title,
933
- breadcrumbs = _ref2.breadcrumbs;
934
- return /*#__PURE__*/jsx("div", {
935
- className: "w-full px-6",
936
- children: /*#__PURE__*/jsx(Header, {
937
- breadcrumbs: breadcrumbs,
938
- size: "small",
939
- title: title
940
- })
941
- });
942
- };
943
- var customPropEqualityCheck = function customPropEqualityCheck(prevProps, nextProps) {
944
- return prevProps.title === nextProps.title && prevProps.breadcrumbs === nextProps.breadcrumbs;
945
- };
946
- var MemoizedPageHeader = /*#__PURE__*/memo(PageHeader, customPropEqualityCheck);
947
- var PageContent = function PageContent(_ref3) {
948
- var children = _ref3.children,
949
- _ref3$className = _ref3.className,
950
- className = _ref3$className === void 0 ? "" : _ref3$className;
951
- return /*#__PURE__*/jsx(Scrollable, {
952
- className: "w-full px-6 pb-6",
953
- children: /*#__PURE__*/jsx("div", {
954
- className: classnames(["mx-auto max-w-7xl", className]),
955
- children: children
956
- })
957
- });
958
- };
959
-
960
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
961
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
962
- var Tags = function Tags(_ref) {
963
- var allTags = _ref.allTags,
964
- selectedTags = _ref.selectedTags,
965
- onUpdate = _ref.onUpdate,
966
- onCreate = _ref.onCreate,
967
- isLoading = _ref.isLoading,
968
- className = _ref.className,
969
- _ref$labelProps = _ref.labelProps,
970
- labelProps = _ref$labelProps === void 0 ? {} : _ref$labelProps;
971
- var handleTagSelect = function handleTagSelect(newTag) {
972
- return onUpdate([].concat(_toConsumableArray(selectedTags), [newTag]));
973
- };
974
- var handleTagRemove = function handleTagRemove(removedTag) {
975
- var updatedTags = removeBy({
976
- value: removedTag.value
977
- }, selectedTags);
978
- onUpdate(updatedTags);
979
- };
980
- var handleTagCreate = function handleTagCreate(tagName) {
981
- onCreate({
982
- name: tagName
983
- }, {
984
- onSuccess: function onSuccess(_ref2) {
985
- var tag = _ref2.tag;
986
- return handleTagSelect({
987
- value: tag.id,
988
- label: tag.name
989
- });
990
- }
991
- });
992
- };
993
- return /*#__PURE__*/jsxs("div", {
994
- className: className,
995
- children: [labelProps.label && /*#__PURE__*/jsx(Label, _objectSpread$2(_objectSpread$2({}, labelProps), {}, {
996
- children: labelProps.label
997
- })), /*#__PURE__*/jsx("div", {
998
- className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white border p-4",
999
- children: /*#__PURE__*/jsx(TagsComponent, {
1000
- allTags: allTags,
1001
- selectedTags: selectedTags,
1002
- buttonProps: {
1003
- loading: isLoading,
1004
- disabled: isLoading,
1005
- iconPosition: "left"
1006
- },
1007
- onTagCreate: handleTagCreate,
1008
- onTagDelete: handleTagRemove,
1009
- onTagSelect: handleTagSelect
1010
- })
1011
- })]
1012
- });
1013
- };
1014
-
1015
- var Preview = function Preview(_ref) {
1016
- var template = _ref.template,
1017
- imageUrl = _ref.imageUrl;
1018
- return /*#__PURE__*/jsxs("div", {
1019
- className: "neeto-template neeto-ui-bg-white outline-none neeto-ui-shadow-sm hover:neeto-ui-border-gray-400 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border transition-colors duration-300 ease-in-out",
1020
- tabIndex: 0,
1021
- children: [/*#__PURE__*/jsx("div", {
1022
- className: "neeto-template__header",
1023
- children: /*#__PURE__*/jsx("img", {
1024
- className: "neeto-template__image",
1025
- "data-cy": "template-image-preview",
1026
- src: imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
1027
- })
1028
- }), /*#__PURE__*/jsx("div", {
1029
- className: "neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg px-2 py-1.5",
1030
- children: /*#__PURE__*/jsx(Typography, {
1031
- className: "neeto-ui-text-gray-800",
1032
- "data-cy": "template-title-text",
1033
- lineHeight: "normal",
1034
- style: "body2",
1035
- children: template.title
1036
- })
1037
- })]
1038
- });
1039
- };
1040
-
1041
- var buildSelectOptionsBy = function buildSelectOptionsBy(labelField) {
1042
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1043
- var valueField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "id";
1044
- return options.map(function (option) {
1045
- return {
1046
- value: option[valueField],
1047
- label: option[labelField]
1048
- };
1049
- });
1050
- };
1051
- var buildTagOptions = function buildTagOptions() {
1052
- var tags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1053
- return renameKeys({
1054
- id: "value",
1055
- name: "label"
1056
- }, tags);
1057
- };
1058
- var buildTemplateUpdatePayload = function buildTemplateUpdatePayload(values) {
1059
- return {
1060
- image: values.imageSignedId || null,
1061
- tagIds: pluck("value", values === null || values === void 0 ? void 0 : values.tags)
1062
- };
1063
- };
1064
-
1065
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1066
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1067
- var TemplateSettings = function TemplateSettings(_ref) {
1068
- var _ref$onCancelTemplate = _ref.onCancelTemplatePreview,
1069
- onCancelTemplatePreview = _ref$onCancelTemplate === void 0 ? "" : _ref$onCancelTemplate,
1070
- _ref$breadcrumbs = _ref.breadcrumbs,
1071
- breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
1072
- _ref$className = _ref.className,
1073
- className = _ref$className === void 0 ? "" : _ref$className;
1074
- var _useParams = useParams(),
1075
- resourceId = _useParams.id;
1076
- var _useTranslation = useTranslation(),
1077
- t = _useTranslation.t;
1078
- var _useFetchTemplate = useFetchTemplate({
1079
- resourceId: resourceId
1080
- }),
1081
- data = _useFetchTemplate.data,
1082
- isFetchingTemplate = _useFetchTemplate.isLoading;
1083
- var _useUpdateTemplate = useUpdateTemplate({
1084
- resourceId: resourceId
1085
- }),
1086
- updateTemplate = _useUpdateTemplate.mutate,
1087
- isUpdatingTemplate = _useUpdateTemplate.isPending;
1088
- var _useCreateTemplateTag = useCreateTemplateTag(),
1089
- createTemplateTag = _useCreateTemplateTag.mutate,
1090
- isCreatingTags = _useCreateTemplateTag.isPending;
1091
- var _useFetchTemplateTags = useFetchTemplateTags(),
1092
- _useFetchTemplateTags2 = _useFetchTemplateTags.data,
1093
- templateTags = _useFetchTemplateTags2 === void 0 ? {} : _useFetchTemplateTags2,
1094
- isTagsLoading = _useFetchTemplateTags.isLoading;
1095
- var handleSubmit = function handleSubmit(values) {
1096
- updateTemplate({
1097
- template: buildTemplateUpdatePayload(values)
1098
- });
1099
- };
1100
- var isLoading = isFetchingTemplate || isTagsLoading;
1101
- var tags = buildTagOptions(data === null || data === void 0 ? void 0 : data.tags);
1102
- var resourceInitialValues = _objectSpread$1(_objectSpread$1({
1103
- imageUrl: null
1104
- }, data), {}, {
1105
- tags: tags
1106
- });
1107
- return /*#__PURE__*/jsxs(PageWrapper, {
1108
- className: className,
1109
- children: [/*#__PURE__*/jsx(MemoizedPageHeader, {
1110
- breadcrumbs: breadcrumbs,
1111
- title: t("neetoTemplate.templateSettings.title")
1112
- }), /*#__PURE__*/jsx(PageContent, {
1113
- className: classnames({
1114
- "min-h-0": !isLoading,
1115
- "h-full": isLoading
1116
- }),
1117
- children: isLoading ? /*#__PURE__*/jsx(PageLoader, {}) : /*#__PURE__*/jsxs(Fragment, {
1118
- children: [/*#__PURE__*/jsx(Typography, {
1119
- className: "mb-1",
1120
- "data-cy": "thank-you-action-text",
1121
- style: "h2",
1122
- weight: "semibold",
1123
- children: t("neetoTemplate.templateSettings.configureTemplates")
1124
- }), /*#__PURE__*/jsx(Typography, {
1125
- className: "mb-2",
1126
- "data-cy": "thank-you-description-label",
1127
- style: "body2",
1128
- children: t("neetoTemplate.templateSettings.subText")
1129
- }), /*#__PURE__*/jsx(Form, {
1130
- formikProps: {
1131
- enableReinitialize: true,
1132
- initialValues: resourceInitialValues,
1133
- onSubmit: handleSubmit
1134
- },
1135
- children: function children(_ref2) {
1136
- var values = _ref2.values,
1137
- setFieldValue = _ref2.setFieldValue;
1138
- return /*#__PURE__*/jsxs("div", {
1139
- className: "grid grid-cols-2 gap-8 pt-6",
1140
- children: [/*#__PURE__*/jsxs("div", {
1141
- className: "space-y-4",
1142
- children: [/*#__PURE__*/jsx(Typography, {
1143
- className: "mb-3",
1144
- style: "h4",
1145
- weight: "semibold",
1146
- children: t("neetoTemplate.templateSettings.imageLabel")
1147
- }), /*#__PURE__*/jsx(FormikImageUploader, {
1148
- name: "imageUrl"
1149
- }), /*#__PURE__*/jsx(Tags, {
1150
- allTags: buildSelectOptionsBy("name", templateTags.tags),
1151
- className: "space-y-2",
1152
- isLoading: isCreatingTags,
1153
- selectedTags: values.tags,
1154
- labelProps: {
1155
- label: t("neetoTemplate.templateSettings.categoryLabel")
1156
- },
1157
- onCreate: createTemplateTag,
1158
- onUpdate: function onUpdate(tags) {
1159
- return setFieldValue("tags", tags);
1160
- }
1161
- }), /*#__PURE__*/jsx("div", {
1162
- className: "mt-12 flex flex-row items-center justify-start",
1163
- children: /*#__PURE__*/jsx(ActionBlock, {
1164
- isSubmitting: isUpdatingTemplate,
1165
- cancelButtonProps: {
1166
- to: onCancelTemplatePreview,
1167
- "data-cy": "reset-changes-button",
1168
- onClick: noop
1169
- }
1170
- })
1171
- })]
1172
- }), /*#__PURE__*/jsxs("div", {
1173
- children: [/*#__PURE__*/jsx(Typography, {
1174
- className: "mb-3",
1175
- style: "h4",
1176
- weight: "semibold",
1177
- children: t("neetoTemplate.templateSettings.previewLabel")
1178
- }), /*#__PURE__*/jsx(Preview, {
1179
- imageUrl: values.imageUrl,
1180
- template: data
1181
- })]
1182
- })]
1183
- });
1184
- }
1185
- })]
1186
- })
1187
- })]
1188
- });
1189
- };
1190
-
1191
- function _objectWithoutPropertiesLoose(source, excluded) {
1192
- if (source == null) return {};
1193
- var target = {};
1194
- var sourceKeys = Object.keys(source);
1195
- var key, i;
1196
- for (i = 0; i < sourceKeys.length; i++) {
1197
- key = sourceKeys[i];
1198
- if (excluded.indexOf(key) >= 0) continue;
1199
- target[key] = source[key];
1200
- }
1201
- return target;
1202
- }
1203
-
1204
- function _objectWithoutProperties(source, excluded) {
1205
- if (source == null) return {};
1206
- var target = _objectWithoutPropertiesLoose(source, excluded);
1207
- var key, i;
1208
- if (Object.getOwnPropertySymbols) {
1209
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1210
- for (i = 0; i < sourceSymbolKeys.length; i++) {
1211
- key = sourceSymbolKeys[i];
1212
- if (excluded.indexOf(key) >= 0) continue;
1213
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1214
- target[key] = source[key];
1215
- }
1216
- }
1217
- return target;
1218
- }
1219
-
1220
- var TAG_TYPES = [{
1221
- id: 1,
1222
- label: t$1("neetoTemplate.templatesTags.template"),
1223
- url: "".concat(NEETO_TEMPLATES_URL, "/tags/template_tags"),
1224
- columns: [{
1225
- title: t$1("neetoTemplate.templatesTags.numberOfActiveTemplates"),
1226
- key: "templates_count",
1227
- dataIndex: "templatesCount",
1228
- align: "center",
1229
- width: 300,
1230
- sorter: true,
1231
- render: function render(templatesCount) {
1232
- return templatesCount !== 0 ? /*#__PURE__*/jsxs(Typography, {
1233
- style: "body1",
1234
- children: [" ", templatesCount, " "]
1235
- }) : "-";
1236
- }
1237
- }]
1238
- }];
1239
-
1240
- var _excluded = ["breadcrumbs", "tagsPath"];
1241
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1242
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1243
- var TemplateTags = function TemplateTags(_ref) {
1244
- var breadcrumbs = _ref.breadcrumbs,
1245
- tagsPath = _ref.tagsPath,
1246
- otherProps = _objectWithoutProperties(_ref, _excluded);
1247
- var queryClient = useQueryClient();
1248
- var invalidateTags = function invalidateTags() {
1249
- queryClient.invalidateQueries({
1250
- queryKey: [QUERY_KEYS.TEMPLATE_TAGS]
1251
- });
1252
- };
1253
- var invalidateTagsAndTemplates = function invalidateTagsAndTemplates() {
1254
- invalidateTags();
1255
- queryClient.invalidateQueries({
1256
- queryKey: [QUERY_KEYS.TEMPLATES_LIST]
1257
- });
1258
- queryClient.invalidateQueries({
1259
- queryKey: [QUERY_KEYS.TEMPLATE]
1260
- });
1261
- };
1262
- var config = _objectSpread({
1263
- tagTypes: TAG_TYPES,
1264
- tagsMergable: true,
1265
- breadcrumbs: breadcrumbs,
1266
- displayMenu: false,
1267
- tagsPath: tagsPath,
1268
- onTagRowClick: noop,
1269
- createTags: {
1270
- onSuccess: {
1271
- callback: invalidateTags
1272
- }
1273
- },
1274
- updateTags: {
1275
- onSuccess: {
1276
- callback: invalidateTagsAndTemplates
1277
- }
1278
- },
1279
- deleteTags: {
1280
- onSuccess: {
1281
- callback: invalidateTagsAndTemplates
1282
- }
1283
- },
1284
- mergeTags: {
1285
- onSuccess: {
1286
- callback: invalidateTagsAndTemplates
1287
- }
1288
- }
1289
- }, otherProps);
1290
- return /*#__PURE__*/jsx(NeetoTags, {
1291
- config: config
1292
- });
1293
- };
1
+ export { default as CreateTemplateModal } from './CreateTemplateModal.js';
2
+ export { default as TemplateSettings } from './TemplateSettings.js';
3
+ export { default as TemplateTags } from './TemplateTags.js';
4
+ import './useTemplatesApi-81e0a50f.js';
5
+ import './query-ddc455b2.js';
6
+ import '@bigbinary/neeto-tags-frontend';
7
+ import '@tanstack/react-query';
8
+ import '@bigbinary/neeto-commons-frontend/react-utils';
9
+ import 'ramda';
10
+ import 'axios';
11
+ import 'react';
12
+ import '@bigbinary/neeto-cist';
13
+ import '@bigbinary/neetoui/Modal';
14
+ import '@bigbinary/neeto-molecules/PageLoader';
15
+ import '@bigbinary/neeto-molecules/Search';
16
+ import '@bigbinary/neetoui/Spinner';
17
+ import '@bigbinary/neetoui/Typography';
18
+ import 'react-i18next';
19
+ import 'react/jsx-runtime';
20
+ import 'classnames';
21
+ import '@bigbinary/neeto-commons-frontend/utils';
22
+ import '@bigbinary/neeto-molecules/ResponsiveDevicePicker';
23
+ import '@bigbinary/neetoui/Button';
24
+ import '@bigbinary/neetoui/formik/ActionBlock';
25
+ import '@bigbinary/neetoui/formik/Form';
26
+ import 'react-router-dom';
27
+ import '@bigbinary/neeto-image-uploader-frontend';
28
+ import 'formik';
29
+ import '@bigbinary/neeto-molecules/Header';
30
+ import '@bigbinary/neeto-molecules/Scrollable';
31
+ import '@bigbinary/neetoui/Label';
32
+ import 'i18next';
1294
33
 
1295
34
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
1296
35
 
1297
36
  var css = ".neeto-template-list .neeto-ui-modal__close{z-index:1}.neeto-template__header{flex-grow:1;min-height:120px}.neeto-template__image{aspect-ratio:16/9;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;width:100%}.neeto-template__description{min-height:54px}.neeto-template-thumbnail .neeto-template__image{transition:transform .5s ease}.neeto-template-thumbnail .neeto-template-thumbnail__title{transition:color .5s ease}.neeto-template-thumbnail:hover .neeto-template__image{transform:scale(1.08)}.neeto-template-thumbnail:hover .neeto-template-thumbnail__title{color:rgb(var(--neeto-ui-black))!important}.neeto-templates-full-page-preview__holder{transition:all .2s ease-in-out}.neeto-templates-full-page-preview__holder--desktop{height:100%;max-width:100%;width:100%}.neeto-templates-full-page-preview__holder--tablet{height:1024px;margin-top:16px!important;max-height:calc(100% - 32px);max-width:768px}.neeto-templates-full-page-preview__holder--tablet .neeto-templates-full-page-preview__iframe{border:1px solid rgb(var(--neeto-ui-gray-300))!important}.neeto-templates-full-page-preview__holder--mobile{height:896px;margin-top:16px!important;max-height:calc(100% - 32px);max-width:384px}.neeto-templates-full-page-preview__holder--mobile .neeto-templates-full-page-preview__iframe{border:1px solid rgb(var(--neeto-ui-gray-300))!important}.neeto-templates-share-preview{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-gray-300));box-shadow:var(--neeto-ui-shadow-m);display:flex;flex-direction:column;height:calc(100vh - 104px);width:100%}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL3RlbXBsYXRlcy9fdGVtcGxhdGUtbGlzdC5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL3RlbXBsYXRlcy9fc2hhcmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDRSw0Q0FDRSxTQ0FKLENES0Usd0JBRUUsV0FBQSxDQURBLGdCQ0RKLENES0UsdUJBRUUsaUJBQUEsQ0FHQSxlQUFBLENBREEsY0FBQSxDQURBLG1CQUFBLENBQUEsZ0JBQUEsQ0FGQSxVQ0NKLENES0UsNkJBQ0UsZUNISixDRFFFLGlEQUNFLDZCQ0xKLENET0UsMkRBQ0UseUJDTEosQ0RRSSx1REFDRSxxQkNOTixDRFFJLGlFQUNFLDBDQ05OLENEV0EsMkNBQ0UsOEJDUkYsQ0RXQSxvREFFRSxXQUFBLENBQ0EsY0FBQSxDQUZBLFVDTkYsQ0RXQSxtREFFRSxhQUFBLENBRUEseUJBQUEsQ0FEQSw0QkFBQSxDQUZB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GFnZS1wcmV2aWV3X19pZnJhbWUge1xuICBib3JkZXI6IDFweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktZ3JheS0zMDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGVtcGxhdGVzLXNoYXJlLXByZXZpZXcge1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiBjYWxjKDEwMHZoIC0gMTA0cHgpO1xuICBib3JkZXI6IHRoaW4gc29saWQgcmdiKHZhcigtLW5lZXRvLXVpLWdyYXktMzAwKSk7XG4gIGJveC1zaGFkb3c6IHZhcigtLW5lZXRvLXVpLXNoYWRvdy1tKTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgYmFja2dyb3VuZC1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLXdoaXRlKSk7XG59IiwiLm5lZXRvLXRlbXBsYXRlcy1zaGFyZS1wcmV2aWV3IHtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogY2FsYygxMDB2aCAtIDEwNHB4KTtcbiAgYm9yZGVyOiB0aGluIHNvbGlkIHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTMwMCkpO1xuICBib3gtc2hhZG93OiB2YXIoLS1uZWV0by11aS1zaGFkb3ctbSk7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS13aGl0ZSkpO1xufVxuIl19 */";
1298
37
  n(css,{});
1299
-
1300
- export { CreateTemplateModal, TemplateSettings, TemplateTags };
1301
38
  //# sourceMappingURL=index.js.map