@firecms/collection_editor 3.1.0-canary.9e89e98 → 3.1.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.es.js +372 -325
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +371 -324
- package/dist/index.umd.js.map +1 -1
- package/dist/ui/collection_editor/AICollectionGeneratorPopover.d.ts +5 -1
- package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +4 -0
- package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -1
- package/package.json +12 -12
- package/src/ConfigControllerProvider.tsx +1 -0
- package/src/ui/collection_editor/AICollectionGeneratorPopover.tsx +18 -1
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +3 -2
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +13 -4
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +4 -1
- package/src/ui/collection_editor/GeneralSettingsForm.tsx +9 -7
- package/src/ui/collection_editor/PropertyEditView.tsx +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useAuthController, useCustomizationController, toSnakeCase, singular, I
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { useState, useEffect, useMemo, createContext, useContext, useRef, useDeferredValue, useCallback } from "react";
|
|
6
6
|
import equal from "react-fast-compare";
|
|
7
|
-
import { Chip, Typography, cls, Tooltip, IconButton, TextField, DebouncedTextField, BooleanSwitchWithLabel, SelectItem, Select, ExpandablePanel, Dialog, Container, VerticalSplitIcon, SquareIcon, ToggleButtonGroup, ListIcon, AppsIcon, ViewKanbanIcon, getColorSchemeForKey, getColorSchemeForSeed, Badge, SettingsIcon, FindInPageIcon, Button, CircularProgress, Paper, DialogTitle, ColorPicker, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, defaultBorderMixin, DeleteIcon, MoreVertIcon, VerticalAlignTopIcon, MenuItem, VerticalAlignBottomIcon, Menu, AddIcon, SelectGroup, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, Card, CloseIcon, Tab, Tabs, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, ArrowBackIcon, LoadingButton, CheckIcon, UndoIcon, SaveIcon } from "@firecms/ui";
|
|
7
|
+
import { Chip, Typography, cls, Tooltip, IconButton, TextField, DebouncedTextField, BooleanSwitchWithLabel, HistoryIcon, SelectItem, Select, SearchIcon, ExpandablePanel, Dialog, Container, VerticalSplitIcon, SquareIcon, ToggleButtonGroup, ListIcon, AppsIcon, ViewKanbanIcon, getColorSchemeForKey, getColorSchemeForSeed, Badge, SettingsIcon, FindInPageIcon, Button, CircularProgress, Paper, DialogTitle, ColorPicker, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, defaultBorderMixin, DeleteIcon, MoreVertIcon, VerticalAlignTopIcon, MenuItem, VerticalAlignBottomIcon, Menu, AddIcon, SelectGroup, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, Card, CloseIcon, Tab, Tabs, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, ArrowBackIcon, LoadingButton, CheckIcon, UndoIcon, SaveIcon } from "@firecms/ui";
|
|
8
8
|
import * as Yup from "yup";
|
|
9
9
|
import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
|
|
10
10
|
import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
|
|
@@ -22,7 +22,7 @@ const YupSchema = Yup.object().shape({
|
|
|
22
22
|
path: Yup.string().required("Required")
|
|
23
23
|
});
|
|
24
24
|
function GeneralSettingsForm(t0) {
|
|
25
|
-
const $ = c(
|
|
25
|
+
const $ = c(146);
|
|
26
26
|
const {
|
|
27
27
|
isNewCollection,
|
|
28
28
|
parentCollection
|
|
@@ -419,52 +419,70 @@ function GeneralSettingsForm(t0) {
|
|
|
419
419
|
} else {
|
|
420
420
|
t56 = $[94];
|
|
421
421
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
422
|
+
let t57;
|
|
423
|
+
if ($[95] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
424
|
+
t57 = /* @__PURE__ */ jsx(HistoryIcon, { size: "smallest" });
|
|
425
|
+
$[95] = t57;
|
|
426
|
+
} else {
|
|
427
|
+
t57 = $[95];
|
|
428
|
+
}
|
|
429
|
+
const t58 = values.history === null || values.history === void 0 ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
|
|
430
|
+
let t59;
|
|
431
|
+
if ($[96] !== t58) {
|
|
432
|
+
t59 = /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
433
|
+
t57,
|
|
434
|
+
t58
|
|
435
|
+
] });
|
|
427
436
|
$[96] = t58;
|
|
437
|
+
$[97] = t59;
|
|
428
438
|
} else {
|
|
429
|
-
|
|
439
|
+
t59 = $[97];
|
|
430
440
|
}
|
|
431
|
-
const t59 = values.history === void 0 ? null : values.history;
|
|
432
441
|
let t60;
|
|
433
|
-
if ($[
|
|
434
|
-
t60 =
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
|
|
438
|
-
$[
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
if ($[98] !== setFieldValue) {
|
|
443
|
+
t60 = (v_0) => setFieldValue("history", v_0);
|
|
444
|
+
$[98] = setFieldValue;
|
|
445
|
+
$[99] = t60;
|
|
446
|
+
} else {
|
|
447
|
+
t60 = $[99];
|
|
448
|
+
}
|
|
449
|
+
const t61 = values.history === void 0 ? null : values.history;
|
|
450
|
+
let t62;
|
|
451
|
+
if ($[100] !== t59 || $[101] !== t60 || $[102] !== t61) {
|
|
452
|
+
t62 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t59, onValueChange: t60, value: t61 });
|
|
453
|
+
$[100] = t59;
|
|
454
|
+
$[101] = t60;
|
|
455
|
+
$[102] = t61;
|
|
456
|
+
$[103] = t62;
|
|
457
|
+
} else {
|
|
458
|
+
t62 = $[103];
|
|
459
|
+
}
|
|
460
|
+
let t63;
|
|
461
|
+
if ($[104] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
462
|
+
t63 = /* @__PURE__ */ jsxs(FieldCaption, { children: [
|
|
445
463
|
"When enabled, each document in this collection will have a history of changes. This is useful for auditing purposes. The data is stored in a subcollection of the document in your database, called ",
|
|
446
464
|
/* @__PURE__ */ jsx("b", { children: "__history" }),
|
|
447
465
|
"."
|
|
448
466
|
] });
|
|
449
|
-
$[
|
|
467
|
+
$[104] = t63;
|
|
450
468
|
} else {
|
|
451
|
-
|
|
469
|
+
t63 = $[104];
|
|
452
470
|
}
|
|
453
|
-
let
|
|
454
|
-
if ($[
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
471
|
+
let t64;
|
|
472
|
+
if ($[105] !== t62) {
|
|
473
|
+
t64 = /* @__PURE__ */ jsxs("div", { children: [
|
|
474
|
+
t62,
|
|
475
|
+
t63
|
|
458
476
|
] });
|
|
459
|
-
$[
|
|
460
|
-
$[
|
|
477
|
+
$[105] = t62;
|
|
478
|
+
$[106] = t64;
|
|
461
479
|
} else {
|
|
462
|
-
|
|
480
|
+
t64 = $[106];
|
|
463
481
|
}
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
if ($[
|
|
467
|
-
|
|
482
|
+
const t65 = typeof values.customId === "object";
|
|
483
|
+
let t66;
|
|
484
|
+
if ($[107] !== setFieldValue) {
|
|
485
|
+
t66 = (v_1) => {
|
|
468
486
|
if (v_1 === "code_defined") {
|
|
469
487
|
throw new Error("This should not happen");
|
|
470
488
|
}
|
|
@@ -480,166 +498,176 @@ function GeneralSettingsForm(t0) {
|
|
|
480
498
|
}
|
|
481
499
|
}
|
|
482
500
|
};
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
501
|
+
$[107] = setFieldValue;
|
|
502
|
+
$[108] = t66;
|
|
485
503
|
} else {
|
|
486
|
-
|
|
504
|
+
t66 = $[108];
|
|
487
505
|
}
|
|
488
|
-
const
|
|
489
|
-
let t66;
|
|
490
|
-
let t67;
|
|
506
|
+
const t67 = typeof values.customId === "object" ? "code_defined" : values.customId === true ? "true" : values.customId === "optional" ? "optional" : "false";
|
|
491
507
|
let t68;
|
|
492
|
-
if ($[106] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
493
|
-
t66 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
494
|
-
t67 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
|
|
495
|
-
t68 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
496
|
-
$[106] = t66;
|
|
497
|
-
$[107] = t67;
|
|
498
|
-
$[108] = t68;
|
|
499
|
-
} else {
|
|
500
|
-
t66 = $[106];
|
|
501
|
-
t67 = $[107];
|
|
502
|
-
t68 = $[108];
|
|
503
|
-
}
|
|
504
508
|
let t69;
|
|
505
|
-
if ($[109] !== t63 || $[110] !== t64 || $[111] !== t65) {
|
|
506
|
-
t69 = /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t63, onValueChange: t64, value: t65, renderValue: _temp$g, children: [
|
|
507
|
-
t66,
|
|
508
|
-
t67,
|
|
509
|
-
t68
|
|
510
|
-
] });
|
|
511
|
-
$[109] = t63;
|
|
512
|
-
$[110] = t64;
|
|
513
|
-
$[111] = t65;
|
|
514
|
-
$[112] = t69;
|
|
515
|
-
} else {
|
|
516
|
-
t69 = $[112];
|
|
517
|
-
}
|
|
518
509
|
let t70;
|
|
519
|
-
if ($[
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
510
|
+
if ($[109] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
511
|
+
t68 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
512
|
+
t69 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
|
|
513
|
+
t70 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
514
|
+
$[109] = t68;
|
|
515
|
+
$[110] = t69;
|
|
516
|
+
$[111] = t70;
|
|
517
|
+
} else {
|
|
518
|
+
t68 = $[109];
|
|
519
|
+
t69 = $[110];
|
|
520
|
+
t70 = $[111];
|
|
524
521
|
}
|
|
525
522
|
let t71;
|
|
526
|
-
if ($[114] !==
|
|
527
|
-
t71 = /* @__PURE__ */ jsxs("
|
|
523
|
+
if ($[112] !== t65 || $[113] !== t66 || $[114] !== t67) {
|
|
524
|
+
t71 = /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t65, onValueChange: t66, value: t67, renderValue: _temp$g, children: [
|
|
525
|
+
t68,
|
|
528
526
|
t69,
|
|
529
527
|
t70
|
|
530
528
|
] });
|
|
531
|
-
$[
|
|
529
|
+
$[112] = t65;
|
|
530
|
+
$[113] = t66;
|
|
531
|
+
$[114] = t67;
|
|
532
532
|
$[115] = t71;
|
|
533
533
|
} else {
|
|
534
534
|
t71 = $[115];
|
|
535
535
|
}
|
|
536
536
|
let t72;
|
|
537
|
-
if ($[116]
|
|
538
|
-
t72 = (
|
|
539
|
-
$[116] =
|
|
540
|
-
|
|
537
|
+
if ($[116] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
538
|
+
t72 = /* @__PURE__ */ jsx(FieldCaption, { children: "Configure how document IDs are generated when creating new entities." });
|
|
539
|
+
$[116] = t72;
|
|
540
|
+
} else {
|
|
541
|
+
t72 = $[116];
|
|
542
|
+
}
|
|
543
|
+
let t73;
|
|
544
|
+
if ($[117] !== t71) {
|
|
545
|
+
t73 = /* @__PURE__ */ jsxs("div", { children: [
|
|
546
|
+
t71,
|
|
547
|
+
t72
|
|
548
|
+
] });
|
|
549
|
+
$[117] = t71;
|
|
550
|
+
$[118] = t73;
|
|
541
551
|
} else {
|
|
542
|
-
|
|
552
|
+
t73 = $[118];
|
|
543
553
|
}
|
|
544
|
-
const t73 = values.textSearchEnabled ?? false;
|
|
545
554
|
let t74;
|
|
546
|
-
if ($[
|
|
547
|
-
t74 = /* @__PURE__ */
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
555
|
+
if ($[119] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
556
|
+
t74 = /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
557
|
+
/* @__PURE__ */ jsx(SearchIcon, { size: "smallest" }),
|
|
558
|
+
"Enable text search for this collection"
|
|
559
|
+
] });
|
|
560
|
+
$[119] = t74;
|
|
551
561
|
} else {
|
|
552
|
-
t74 = $[
|
|
562
|
+
t74 = $[119];
|
|
553
563
|
}
|
|
554
564
|
let t75;
|
|
555
|
-
if ($[
|
|
556
|
-
t75 =
|
|
565
|
+
if ($[120] !== setFieldValue) {
|
|
566
|
+
t75 = (v_2) => setFieldValue("textSearchEnabled", v_2);
|
|
567
|
+
$[120] = setFieldValue;
|
|
557
568
|
$[121] = t75;
|
|
558
569
|
} else {
|
|
559
570
|
t75 = $[121];
|
|
560
571
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
] });
|
|
567
|
-
$[122] = t74;
|
|
572
|
+
const t76 = values.textSearchEnabled ?? false;
|
|
573
|
+
let t77;
|
|
574
|
+
if ($[122] !== t75 || $[123] !== t76) {
|
|
575
|
+
t77 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: t74, onValueChange: t75, value: t76 });
|
|
576
|
+
$[122] = t75;
|
|
568
577
|
$[123] = t76;
|
|
578
|
+
$[124] = t77;
|
|
569
579
|
} else {
|
|
570
|
-
|
|
580
|
+
t77 = $[124];
|
|
571
581
|
}
|
|
572
|
-
let
|
|
573
|
-
if ($[
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
582
|
+
let t78;
|
|
583
|
+
if ($[125] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
584
|
+
t78 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
|
|
585
|
+
$[125] = t78;
|
|
586
|
+
} else {
|
|
587
|
+
t78 = $[125];
|
|
588
|
+
}
|
|
589
|
+
let t79;
|
|
590
|
+
if ($[126] !== t77) {
|
|
591
|
+
t79 = /* @__PURE__ */ jsxs("div", { children: [
|
|
592
|
+
t77,
|
|
593
|
+
t78
|
|
578
594
|
] });
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
$[126] = t76;
|
|
582
|
-
$[127] = t77;
|
|
595
|
+
$[126] = t77;
|
|
596
|
+
$[127] = t79;
|
|
583
597
|
} else {
|
|
584
|
-
|
|
598
|
+
t79 = $[127];
|
|
585
599
|
}
|
|
586
|
-
let
|
|
587
|
-
if ($[128]
|
|
588
|
-
|
|
600
|
+
let t80;
|
|
601
|
+
if ($[128] !== t64 || $[129] !== t73 || $[130] !== t79) {
|
|
602
|
+
t80 = /* @__PURE__ */ jsxs(ExpandablePanel, { title: t56, initiallyExpanded: false, className: "mt-4", innerClassName: "p-4 flex flex-col gap-4", children: [
|
|
603
|
+
t64,
|
|
604
|
+
t73,
|
|
605
|
+
t79
|
|
606
|
+
] });
|
|
607
|
+
$[128] = t64;
|
|
608
|
+
$[129] = t73;
|
|
609
|
+
$[130] = t79;
|
|
610
|
+
$[131] = t80;
|
|
611
|
+
} else {
|
|
612
|
+
t80 = $[131];
|
|
613
|
+
}
|
|
614
|
+
let t81;
|
|
615
|
+
if ($[132] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
616
|
+
t81 = /* @__PURE__ */ jsx("div", { style: {
|
|
589
617
|
height: "52px"
|
|
590
618
|
} });
|
|
591
|
-
$[
|
|
619
|
+
$[132] = t81;
|
|
592
620
|
} else {
|
|
593
|
-
|
|
621
|
+
t81 = $[132];
|
|
594
622
|
}
|
|
595
|
-
const
|
|
596
|
-
let
|
|
597
|
-
if ($[
|
|
598
|
-
|
|
623
|
+
const t82 = typeof values.icon === "string" ? values.icon : void 0;
|
|
624
|
+
let t83;
|
|
625
|
+
if ($[133] !== setFieldValue) {
|
|
626
|
+
t83 = (icon) => {
|
|
599
627
|
setIconDialogOpen(false);
|
|
600
628
|
setFieldValue("icon", icon);
|
|
601
629
|
};
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
630
|
+
$[133] = setFieldValue;
|
|
631
|
+
$[134] = t83;
|
|
604
632
|
} else {
|
|
605
|
-
|
|
633
|
+
t83 = $[134];
|
|
606
634
|
}
|
|
607
|
-
let
|
|
608
|
-
if ($[
|
|
609
|
-
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
612
|
-
$[
|
|
635
|
+
let t84;
|
|
636
|
+
if ($[135] !== t82 || $[136] !== t83) {
|
|
637
|
+
t84 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: t82, onIconSelected: t83 }) });
|
|
638
|
+
$[135] = t82;
|
|
639
|
+
$[136] = t83;
|
|
640
|
+
$[137] = t84;
|
|
613
641
|
} else {
|
|
614
|
-
|
|
642
|
+
t84 = $[137];
|
|
615
643
|
}
|
|
616
|
-
let
|
|
617
|
-
if ($[
|
|
618
|
-
|
|
619
|
-
$[
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
644
|
+
let t85;
|
|
645
|
+
if ($[138] !== iconDialogOpen || $[139] !== t84) {
|
|
646
|
+
t85 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t84 });
|
|
647
|
+
$[138] = iconDialogOpen;
|
|
648
|
+
$[139] = t84;
|
|
649
|
+
$[140] = t85;
|
|
622
650
|
} else {
|
|
623
|
-
|
|
651
|
+
t85 = $[140];
|
|
624
652
|
}
|
|
625
|
-
let
|
|
626
|
-
if ($[
|
|
627
|
-
|
|
653
|
+
let t86;
|
|
654
|
+
if ($[141] !== t12 || $[142] !== t55 || $[143] !== t80 || $[144] !== t85) {
|
|
655
|
+
t86 = /* @__PURE__ */ jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxs(Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
628
656
|
t12,
|
|
629
657
|
t55,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
658
|
+
t80,
|
|
659
|
+
t81,
|
|
660
|
+
t85
|
|
633
661
|
] }) });
|
|
634
|
-
$[
|
|
635
|
-
$[
|
|
636
|
-
$[
|
|
637
|
-
$[
|
|
638
|
-
$[
|
|
662
|
+
$[141] = t12;
|
|
663
|
+
$[142] = t55;
|
|
664
|
+
$[143] = t80;
|
|
665
|
+
$[144] = t85;
|
|
666
|
+
$[145] = t86;
|
|
639
667
|
} else {
|
|
640
|
-
|
|
668
|
+
t86 = $[145];
|
|
641
669
|
}
|
|
642
|
-
return
|
|
670
|
+
return t86;
|
|
643
671
|
}
|
|
644
672
|
function _temp$g(value) {
|
|
645
673
|
if (value === "code_defined") {
|
|
@@ -8563,7 +8591,7 @@ function PropertyFormDialog(t0) {
|
|
|
8563
8591
|
onPropertyChanged = $[6];
|
|
8564
8592
|
open = $[7];
|
|
8565
8593
|
}
|
|
8566
|
-
const formexRef = useRef();
|
|
8594
|
+
const formexRef = useRef(void 0);
|
|
8567
8595
|
let t1;
|
|
8568
8596
|
if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
8569
8597
|
t1 = (helpers) => {
|
|
@@ -12359,7 +12387,8 @@ function AICollectionGeneratorPopover({
|
|
|
12359
12387
|
generateCollection,
|
|
12360
12388
|
trigger,
|
|
12361
12389
|
size = "small",
|
|
12362
|
-
showLabel = true
|
|
12390
|
+
showLabel = true,
|
|
12391
|
+
onAnalyticsEvent
|
|
12363
12392
|
}) {
|
|
12364
12393
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
12365
12394
|
const [prompt, setPrompt] = useState("");
|
|
@@ -12372,6 +12401,10 @@ function AICollectionGeneratorPopover({
|
|
|
12372
12401
|
if (!prompt.trim()) return;
|
|
12373
12402
|
setLoading(true);
|
|
12374
12403
|
setError(null);
|
|
12404
|
+
const mode = existingCollection ? "modify" : "create";
|
|
12405
|
+
onAnalyticsEvent?.("ai_collection_generate_start", {
|
|
12406
|
+
mode
|
|
12407
|
+
});
|
|
12375
12408
|
try {
|
|
12376
12409
|
const collectionsContext = existingCollections.map((c2) => ({
|
|
12377
12410
|
path: c2.path,
|
|
@@ -12396,6 +12429,10 @@ function AICollectionGeneratorPopover({
|
|
|
12396
12429
|
onGenerated(result.collection, result.operations);
|
|
12397
12430
|
setMenuOpen(false);
|
|
12398
12431
|
setPrompt("");
|
|
12432
|
+
onAnalyticsEvent?.("ai_collection_generate_success", {
|
|
12433
|
+
mode,
|
|
12434
|
+
operationsCount: result.operations?.length
|
|
12435
|
+
});
|
|
12399
12436
|
snackbarController.open({
|
|
12400
12437
|
type: "success",
|
|
12401
12438
|
message: existingCollection ? "Collection updated with AI suggestions" : "Collection generated successfully"
|
|
@@ -12404,6 +12441,10 @@ function AICollectionGeneratorPopover({
|
|
|
12404
12441
|
console.error("Error generating collection:", e);
|
|
12405
12442
|
const errorMessage = e instanceof CollectionGenerationApiError ? e.message : "Failed to generate collection. Please try again.";
|
|
12406
12443
|
setError(errorMessage);
|
|
12444
|
+
onAnalyticsEvent?.("ai_collection_generate_error", {
|
|
12445
|
+
mode,
|
|
12446
|
+
error: errorMessage
|
|
12447
|
+
});
|
|
12407
12448
|
snackbarController.open({
|
|
12408
12449
|
type: "error",
|
|
12409
12450
|
message: errorMessage
|
|
@@ -12439,12 +12480,13 @@ function AICollectionGeneratorPopover({
|
|
|
12439
12480
|
] }) });
|
|
12440
12481
|
}
|
|
12441
12482
|
function CollectionEditorWelcomeView(t0) {
|
|
12442
|
-
const $ = c(
|
|
12483
|
+
const $ = c(66);
|
|
12443
12484
|
const {
|
|
12444
12485
|
parentCollection,
|
|
12445
12486
|
onContinue,
|
|
12446
12487
|
existingCollectionPaths,
|
|
12447
|
-
generateCollection
|
|
12488
|
+
generateCollection,
|
|
12489
|
+
onAnalyticsEvent
|
|
12448
12490
|
} = t0;
|
|
12449
12491
|
const {
|
|
12450
12492
|
pathSuggestions
|
|
@@ -12504,203 +12546,204 @@ function CollectionEditorWelcomeView(t0) {
|
|
|
12504
12546
|
}, size: "small", children: suggestion }, suggestion)) })
|
|
12505
12547
|
] });
|
|
12506
12548
|
let t9;
|
|
12507
|
-
if ($[7] !== generateCollection || $[8] !==
|
|
12549
|
+
if ($[7] !== generateCollection || $[8] !== onAnalyticsEvent || $[9] !== onContinue || $[10] !== setValues) {
|
|
12508
12550
|
t9 = generateCollection && /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
12509
12551
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Describe your collection to AI:" }),
|
|
12510
12552
|
/* @__PURE__ */ jsx(AICollectionGeneratorPopover, { onGenerated: (generatedCollection) => {
|
|
12511
12553
|
setValues(generatedCollection);
|
|
12512
12554
|
onContinue();
|
|
12513
|
-
}, generateCollection, trigger: /* @__PURE__ */ jsx(Button, { variant: "outlined", startIcon: /* @__PURE__ */ jsx(AIIcon, { size: "small" }), children: "Generate with AI" }) })
|
|
12555
|
+
}, generateCollection, onAnalyticsEvent, trigger: /* @__PURE__ */ jsx(Button, { variant: "outlined", startIcon: /* @__PURE__ */ jsx(AIIcon, { size: "small" }), children: "Generate with AI" }) })
|
|
12514
12556
|
] });
|
|
12515
12557
|
$[7] = generateCollection;
|
|
12516
|
-
$[8] =
|
|
12517
|
-
$[9] =
|
|
12518
|
-
$[10] =
|
|
12558
|
+
$[8] = onAnalyticsEvent;
|
|
12559
|
+
$[9] = onContinue;
|
|
12560
|
+
$[10] = setValues;
|
|
12561
|
+
$[11] = t9;
|
|
12519
12562
|
} else {
|
|
12520
|
-
t9 = $[
|
|
12563
|
+
t9 = $[11];
|
|
12521
12564
|
}
|
|
12522
12565
|
let t10;
|
|
12523
|
-
if ($[
|
|
12566
|
+
if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12524
12567
|
t10 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Create from JSON configuration:" });
|
|
12525
|
-
$[
|
|
12568
|
+
$[12] = t10;
|
|
12526
12569
|
} else {
|
|
12527
|
-
t10 = $[
|
|
12570
|
+
t10 = $[12];
|
|
12528
12571
|
}
|
|
12529
12572
|
let t11;
|
|
12530
|
-
if ($[
|
|
12573
|
+
if ($[13] !== setJsonImportOpen) {
|
|
12531
12574
|
t11 = () => setJsonImportOpen(true);
|
|
12532
|
-
$[
|
|
12533
|
-
$[
|
|
12575
|
+
$[13] = setJsonImportOpen;
|
|
12576
|
+
$[14] = t11;
|
|
12534
12577
|
} else {
|
|
12535
|
-
t11 = $[
|
|
12578
|
+
t11 = $[14];
|
|
12536
12579
|
}
|
|
12537
12580
|
let t12;
|
|
12538
|
-
if ($[
|
|
12581
|
+
if ($[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12539
12582
|
t12 = /* @__PURE__ */ jsx(CodeIcon, { size: "small" });
|
|
12540
|
-
$[
|
|
12583
|
+
$[15] = t12;
|
|
12541
12584
|
} else {
|
|
12542
|
-
t12 = $[
|
|
12585
|
+
t12 = $[15];
|
|
12543
12586
|
}
|
|
12544
12587
|
let t13;
|
|
12545
|
-
if ($[
|
|
12588
|
+
if ($[16] !== t11) {
|
|
12546
12589
|
t13 = /* @__PURE__ */ jsx(Button, { variant: "outlined", onClick: t11, startIcon: t12, children: "Paste JSON Configuration" });
|
|
12547
|
-
$[
|
|
12548
|
-
$[
|
|
12590
|
+
$[16] = t11;
|
|
12591
|
+
$[17] = t13;
|
|
12549
12592
|
} else {
|
|
12550
|
-
t13 = $[
|
|
12593
|
+
t13 = $[17];
|
|
12551
12594
|
}
|
|
12552
12595
|
let t14;
|
|
12553
|
-
if ($[
|
|
12596
|
+
if ($[18] !== setJsonImportOpen) {
|
|
12554
12597
|
t14 = () => setJsonImportOpen(false);
|
|
12555
|
-
$[
|
|
12556
|
-
$[
|
|
12598
|
+
$[18] = setJsonImportOpen;
|
|
12599
|
+
$[19] = t14;
|
|
12557
12600
|
} else {
|
|
12558
|
-
t14 = $[
|
|
12601
|
+
t14 = $[19];
|
|
12559
12602
|
}
|
|
12560
12603
|
let t15;
|
|
12561
|
-
if ($[
|
|
12604
|
+
if ($[20] !== onContinue || $[21] !== setValues) {
|
|
12562
12605
|
t15 = (collection) => {
|
|
12563
12606
|
setValues(collection);
|
|
12564
12607
|
onContinue();
|
|
12565
12608
|
};
|
|
12566
|
-
$[
|
|
12567
|
-
$[
|
|
12568
|
-
$[
|
|
12609
|
+
$[20] = onContinue;
|
|
12610
|
+
$[21] = setValues;
|
|
12611
|
+
$[22] = t15;
|
|
12569
12612
|
} else {
|
|
12570
|
-
t15 = $[
|
|
12613
|
+
t15 = $[22];
|
|
12571
12614
|
}
|
|
12572
12615
|
let t16;
|
|
12573
|
-
if ($[
|
|
12616
|
+
if ($[23] !== jsonImportOpen || $[24] !== t14 || $[25] !== t15) {
|
|
12574
12617
|
t16 = /* @__PURE__ */ jsx(CollectionJsonImportDialog, { open: jsonImportOpen, onClose: t14, onImport: t15 });
|
|
12575
|
-
$[
|
|
12576
|
-
$[
|
|
12577
|
-
$[
|
|
12578
|
-
$[
|
|
12618
|
+
$[23] = jsonImportOpen;
|
|
12619
|
+
$[24] = t14;
|
|
12620
|
+
$[25] = t15;
|
|
12621
|
+
$[26] = t16;
|
|
12579
12622
|
} else {
|
|
12580
|
-
t16 = $[
|
|
12623
|
+
t16 = $[26];
|
|
12581
12624
|
}
|
|
12582
12625
|
let t17;
|
|
12583
|
-
if ($[
|
|
12626
|
+
if ($[27] !== t13 || $[28] !== t16) {
|
|
12584
12627
|
t17 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
12585
12628
|
t10,
|
|
12586
12629
|
t13,
|
|
12587
12630
|
t16
|
|
12588
12631
|
] });
|
|
12589
|
-
$[
|
|
12590
|
-
$[
|
|
12591
|
-
$[
|
|
12632
|
+
$[27] = t13;
|
|
12633
|
+
$[28] = t16;
|
|
12634
|
+
$[29] = t17;
|
|
12592
12635
|
} else {
|
|
12593
|
-
t17 = $[
|
|
12636
|
+
t17 = $[29];
|
|
12594
12637
|
}
|
|
12595
12638
|
let t18;
|
|
12596
|
-
if ($[
|
|
12639
|
+
if ($[30] !== t17 || $[31] !== t9) {
|
|
12597
12640
|
t18 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-8", children: [
|
|
12598
12641
|
t9,
|
|
12599
12642
|
t17
|
|
12600
12643
|
] });
|
|
12601
|
-
$[
|
|
12602
|
-
$[
|
|
12603
|
-
$[
|
|
12644
|
+
$[30] = t17;
|
|
12645
|
+
$[31] = t9;
|
|
12646
|
+
$[32] = t18;
|
|
12604
12647
|
} else {
|
|
12605
|
-
t18 = $[
|
|
12648
|
+
t18 = $[32];
|
|
12606
12649
|
}
|
|
12607
12650
|
let t19;
|
|
12608
|
-
if ($[
|
|
12651
|
+
if ($[33] !== onContinue || $[34] !== parentCollection) {
|
|
12609
12652
|
t19 = !parentCollection && /* @__PURE__ */ jsxs("div", { children: [
|
|
12610
12653
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "mb-2", children: "● Create a collection from a file (csv, json, xls, xslx...)" }),
|
|
12611
12654
|
/* @__PURE__ */ jsx(ImportFileUpload, { onDataAdded: (data, propertiesOrder) => onContinue(data, propertiesOrder) })
|
|
12612
12655
|
] });
|
|
12613
|
-
$[
|
|
12614
|
-
$[
|
|
12615
|
-
$[
|
|
12656
|
+
$[33] = onContinue;
|
|
12657
|
+
$[34] = parentCollection;
|
|
12658
|
+
$[35] = t19;
|
|
12616
12659
|
} else {
|
|
12617
|
-
t19 = $[
|
|
12660
|
+
t19 = $[35];
|
|
12618
12661
|
}
|
|
12619
12662
|
let t20;
|
|
12620
|
-
if ($[
|
|
12663
|
+
if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12621
12664
|
t20 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "● Select a template:" });
|
|
12622
|
-
$[
|
|
12665
|
+
$[36] = t20;
|
|
12623
12666
|
} else {
|
|
12624
|
-
t20 = $[
|
|
12667
|
+
t20 = $[36];
|
|
12625
12668
|
}
|
|
12626
12669
|
let t21;
|
|
12627
|
-
if ($[
|
|
12670
|
+
if ($[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12628
12671
|
t21 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: productsCollectionTemplate.icon });
|
|
12629
|
-
$[
|
|
12672
|
+
$[37] = t21;
|
|
12630
12673
|
} else {
|
|
12631
|
-
t21 = $[
|
|
12674
|
+
t21 = $[37];
|
|
12632
12675
|
}
|
|
12633
12676
|
let t22;
|
|
12634
|
-
if ($[
|
|
12677
|
+
if ($[38] !== onContinue || $[39] !== setValues) {
|
|
12635
12678
|
t22 = /* @__PURE__ */ jsx(TemplateButton, { title: "Products", subtitle: "A collection of products with images, prices and stock", icon: t21, onClick: () => {
|
|
12636
12679
|
setValues(productsCollectionTemplate);
|
|
12637
12680
|
onContinue();
|
|
12638
12681
|
} });
|
|
12639
|
-
$[
|
|
12640
|
-
$[
|
|
12641
|
-
$[
|
|
12682
|
+
$[38] = onContinue;
|
|
12683
|
+
$[39] = setValues;
|
|
12684
|
+
$[40] = t22;
|
|
12642
12685
|
} else {
|
|
12643
|
-
t22 = $[
|
|
12686
|
+
t22 = $[40];
|
|
12644
12687
|
}
|
|
12645
12688
|
let t23;
|
|
12646
|
-
if ($[
|
|
12689
|
+
if ($[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12647
12690
|
t23 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: usersCollectionTemplate.icon });
|
|
12648
|
-
$[
|
|
12691
|
+
$[41] = t23;
|
|
12649
12692
|
} else {
|
|
12650
|
-
t23 = $[
|
|
12693
|
+
t23 = $[41];
|
|
12651
12694
|
}
|
|
12652
12695
|
let t24;
|
|
12653
|
-
if ($[
|
|
12696
|
+
if ($[42] !== onContinue || $[43] !== setValues) {
|
|
12654
12697
|
t24 = /* @__PURE__ */ jsx(TemplateButton, { title: "Users", subtitle: "A collection of users with emails, names and roles", icon: t23, onClick: () => {
|
|
12655
12698
|
setValues(usersCollectionTemplate);
|
|
12656
12699
|
onContinue();
|
|
12657
12700
|
} });
|
|
12658
|
-
$[
|
|
12659
|
-
$[
|
|
12660
|
-
$[
|
|
12701
|
+
$[42] = onContinue;
|
|
12702
|
+
$[43] = setValues;
|
|
12703
|
+
$[44] = t24;
|
|
12661
12704
|
} else {
|
|
12662
|
-
t24 = $[
|
|
12705
|
+
t24 = $[44];
|
|
12663
12706
|
}
|
|
12664
12707
|
let t25;
|
|
12665
|
-
if ($[
|
|
12708
|
+
if ($[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12666
12709
|
t25 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: blogCollectionTemplate.icon });
|
|
12667
|
-
$[
|
|
12710
|
+
$[45] = t25;
|
|
12668
12711
|
} else {
|
|
12669
|
-
t25 = $[
|
|
12712
|
+
t25 = $[45];
|
|
12670
12713
|
}
|
|
12671
12714
|
let t26;
|
|
12672
|
-
if ($[
|
|
12715
|
+
if ($[46] !== onContinue || $[47] !== setValues) {
|
|
12673
12716
|
t26 = /* @__PURE__ */ jsx(TemplateButton, { title: "Blog posts", subtitle: "A collection of blog posts with images, authors and complex content", icon: t25, onClick: () => {
|
|
12674
12717
|
setValues(blogCollectionTemplate);
|
|
12675
12718
|
onContinue();
|
|
12676
12719
|
} });
|
|
12677
|
-
$[
|
|
12678
|
-
$[
|
|
12679
|
-
$[
|
|
12720
|
+
$[46] = onContinue;
|
|
12721
|
+
$[47] = setValues;
|
|
12722
|
+
$[48] = t26;
|
|
12680
12723
|
} else {
|
|
12681
|
-
t26 = $[
|
|
12724
|
+
t26 = $[48];
|
|
12682
12725
|
}
|
|
12683
12726
|
let t27;
|
|
12684
|
-
if ($[
|
|
12727
|
+
if ($[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
12685
12728
|
t27 = /* @__PURE__ */ jsx(Icon, { size: "small", iconKey: pagesCollectionTemplate.icon });
|
|
12686
|
-
$[
|
|
12729
|
+
$[49] = t27;
|
|
12687
12730
|
} else {
|
|
12688
|
-
t27 = $[
|
|
12731
|
+
t27 = $[49];
|
|
12689
12732
|
}
|
|
12690
12733
|
let t28;
|
|
12691
|
-
if ($[
|
|
12734
|
+
if ($[50] !== onContinue || $[51] !== setValues) {
|
|
12692
12735
|
t28 = /* @__PURE__ */ jsx(TemplateButton, { title: "Pages", subtitle: "A collection of pages with images, authors and complex content", icon: t27, onClick: () => {
|
|
12693
12736
|
setValues(pagesCollectionTemplate);
|
|
12694
12737
|
onContinue();
|
|
12695
12738
|
} });
|
|
12696
|
-
$[
|
|
12697
|
-
$[
|
|
12698
|
-
$[
|
|
12739
|
+
$[50] = onContinue;
|
|
12740
|
+
$[51] = setValues;
|
|
12741
|
+
$[52] = t28;
|
|
12699
12742
|
} else {
|
|
12700
|
-
t28 = $[
|
|
12743
|
+
t28 = $[52];
|
|
12701
12744
|
}
|
|
12702
12745
|
let t29;
|
|
12703
|
-
if ($[
|
|
12746
|
+
if ($[53] !== t22 || $[54] !== t24 || $[55] !== t26 || $[56] !== t28) {
|
|
12704
12747
|
t29 = /* @__PURE__ */ jsxs("div", { className: "my-2", children: [
|
|
12705
12748
|
t20,
|
|
12706
12749
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -12710,16 +12753,16 @@ function CollectionEditorWelcomeView(t0) {
|
|
|
12710
12753
|
t28
|
|
12711
12754
|
] })
|
|
12712
12755
|
] });
|
|
12713
|
-
$[
|
|
12714
|
-
$[
|
|
12715
|
-
$[
|
|
12716
|
-
$[
|
|
12717
|
-
$[
|
|
12756
|
+
$[53] = t22;
|
|
12757
|
+
$[54] = t24;
|
|
12758
|
+
$[55] = t26;
|
|
12759
|
+
$[56] = t28;
|
|
12760
|
+
$[57] = t29;
|
|
12718
12761
|
} else {
|
|
12719
|
-
t29 = $[
|
|
12762
|
+
t29 = $[57];
|
|
12720
12763
|
}
|
|
12721
12764
|
let t30;
|
|
12722
|
-
if ($[
|
|
12765
|
+
if ($[58] !== T0 || $[59] !== t18 || $[60] !== t19 || $[61] !== t29 || $[62] !== t6 || $[63] !== t7 || $[64] !== t8) {
|
|
12723
12766
|
t30 = /* @__PURE__ */ jsx("div", { className: t3, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t4, className: t5, children: [
|
|
12724
12767
|
t6,
|
|
12725
12768
|
t7,
|
|
@@ -12728,16 +12771,16 @@ function CollectionEditorWelcomeView(t0) {
|
|
|
12728
12771
|
t19,
|
|
12729
12772
|
t29
|
|
12730
12773
|
] }) });
|
|
12731
|
-
$[
|
|
12732
|
-
$[
|
|
12733
|
-
$[
|
|
12734
|
-
$[
|
|
12735
|
-
$[
|
|
12736
|
-
$[
|
|
12737
|
-
$[
|
|
12738
|
-
$[
|
|
12774
|
+
$[58] = T0;
|
|
12775
|
+
$[59] = t18;
|
|
12776
|
+
$[60] = t19;
|
|
12777
|
+
$[61] = t29;
|
|
12778
|
+
$[62] = t6;
|
|
12779
|
+
$[63] = t7;
|
|
12780
|
+
$[64] = t8;
|
|
12781
|
+
$[65] = t30;
|
|
12739
12782
|
} else {
|
|
12740
|
-
t30 = $[
|
|
12783
|
+
t30 = $[65];
|
|
12741
12784
|
}
|
|
12742
12785
|
return t30;
|
|
12743
12786
|
}
|
|
@@ -13562,7 +13605,8 @@ function CollectionEditorInternal({
|
|
|
13562
13605
|
existingEntities,
|
|
13563
13606
|
initialView: initialViewProp,
|
|
13564
13607
|
expandKanban,
|
|
13565
|
-
generateCollection
|
|
13608
|
+
generateCollection,
|
|
13609
|
+
onAnalyticsEvent
|
|
13566
13610
|
}) {
|
|
13567
13611
|
const importConfig = useImportConfig();
|
|
13568
13612
|
const navigation = useNavigationController();
|
|
@@ -13848,7 +13892,7 @@ function CollectionEditorInternal({
|
|
|
13848
13892
|
return /* @__PURE__ */ jsxs(DialogContent, { fullHeight: true, children: [
|
|
13849
13893
|
/* @__PURE__ */ jsx(Formex, { value: formController, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13850
13894
|
!isNewCollection && /* @__PURE__ */ jsxs("div", { className: cls("px-4 py-2 w-full flex items-center justify-end gap-2 bg-surface-50 dark:bg-surface-950 border-b", defaultBorderMixin), children: [
|
|
13851
|
-
generateCollection && /* @__PURE__ */ jsx(AICollectionGeneratorPopover, { existingCollection: values_1, onGenerated: handleAIGenerated, generateCollection }),
|
|
13895
|
+
generateCollection && /* @__PURE__ */ jsx(AICollectionGeneratorPopover, { existingCollection: values_1, onGenerated: handleAIGenerated, generateCollection, onAnalyticsEvent }),
|
|
13852
13896
|
/* @__PURE__ */ jsxs(Tabs, { value: currentView, onValueChange: (v) => setCurrentView(v), children: [
|
|
13853
13897
|
/* @__PURE__ */ jsx(Tab, { value: "general", children: "General" }),
|
|
13854
13898
|
/* @__PURE__ */ jsx(Tab, { value: "display", children: "Display" }),
|
|
@@ -13859,7 +13903,7 @@ function CollectionEditorInternal({
|
|
|
13859
13903
|
/* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
|
|
13860
13904
|
currentView === "loading" && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
13861
13905
|
currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsx(extraView.View, { path }),
|
|
13862
|
-
currentView === "welcome" && /* @__PURE__ */ jsx(CollectionEditorWelcomeView, { path, onContinue: onWelcomeScreenContinue, existingCollectionPaths: existingPaths, parentCollection, generateCollection }),
|
|
13906
|
+
currentView === "welcome" && /* @__PURE__ */ jsx(CollectionEditorWelcomeView, { path, onContinue: onWelcomeScreenContinue, existingCollectionPaths: existingPaths, parentCollection, generateCollection, onAnalyticsEvent }),
|
|
13863
13907
|
currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
|
|
13864
13908
|
currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
|
|
13865
13909
|
currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsx(ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
|
|
@@ -13926,7 +13970,9 @@ function applyPropertyConfigs(collection, propertyConfigs) {
|
|
|
13926
13970
|
const propertiesResult = {};
|
|
13927
13971
|
if (properties) {
|
|
13928
13972
|
Object.keys(properties).forEach((key) => {
|
|
13929
|
-
|
|
13973
|
+
const prop = properties[key];
|
|
13974
|
+
if (prop == null) return;
|
|
13975
|
+
propertiesResult[key] = applyPropertiesConfig(prop, propertyConfigs);
|
|
13930
13976
|
});
|
|
13931
13977
|
}
|
|
13932
13978
|
return {
|
|
@@ -13936,7 +13982,7 @@ function applyPropertyConfigs(collection, propertyConfigs) {
|
|
|
13936
13982
|
}
|
|
13937
13983
|
function applyPropertiesConfig(property, propertyConfigs) {
|
|
13938
13984
|
let internalProperty = property;
|
|
13939
|
-
if (propertyConfigs && typeof internalProperty === "object" && internalProperty.propertyConfig) {
|
|
13985
|
+
if (propertyConfigs && internalProperty && typeof internalProperty === "object" && internalProperty.propertyConfig) {
|
|
13940
13986
|
const propertyConfig = propertyConfigs[internalProperty.propertyConfig];
|
|
13941
13987
|
if (propertyConfig && isPropertyBuilder(propertyConfig.property)) {
|
|
13942
13988
|
internalProperty = propertyConfig.property;
|
|
@@ -13980,7 +14026,7 @@ const validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
13980
14026
|
const ConfigControllerContext = React__default.createContext({});
|
|
13981
14027
|
const CollectionEditorContext = React__default.createContext({});
|
|
13982
14028
|
const ConfigControllerProvider = React__default.memo(function ConfigControllerProvider2(t0) {
|
|
13983
|
-
const $ = c(
|
|
14029
|
+
const $ = c(72);
|
|
13984
14030
|
const {
|
|
13985
14031
|
children,
|
|
13986
14032
|
collectionConfigController,
|
|
@@ -14159,8 +14205,8 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14159
14205
|
t7 = $[17];
|
|
14160
14206
|
}
|
|
14161
14207
|
let t8;
|
|
14162
|
-
if ($[18] !== collectionConfigController || $[19] !== collectionInference || $[20] !== currentDialog || $[21] !== extraView || $[22] !== generateCollection || $[23] !== getData || $[24] !== getUser || $[25] !==
|
|
14163
|
-
t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, getUser, generateCollection, handleClose: t7 });
|
|
14208
|
+
if ($[18] !== collectionConfigController || $[19] !== collectionInference || $[20] !== currentDialog || $[21] !== extraView || $[22] !== generateCollection || $[23] !== getData || $[24] !== getUser || $[25] !== onAnalyticsEvent || $[26] !== reservedGroups || $[27] !== t6 || $[28] !== t7) {
|
|
14209
|
+
t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, getUser, generateCollection, onAnalyticsEvent, handleClose: t7 });
|
|
14164
14210
|
$[18] = collectionConfigController;
|
|
14165
14211
|
$[19] = collectionInference;
|
|
14166
14212
|
$[20] = currentDialog;
|
|
@@ -14168,12 +14214,13 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14168
14214
|
$[22] = generateCollection;
|
|
14169
14215
|
$[23] = getData;
|
|
14170
14216
|
$[24] = getUser;
|
|
14171
|
-
$[25] =
|
|
14172
|
-
$[26] =
|
|
14173
|
-
$[27] =
|
|
14174
|
-
$[28] =
|
|
14217
|
+
$[25] = onAnalyticsEvent;
|
|
14218
|
+
$[26] = reservedGroups;
|
|
14219
|
+
$[27] = t6;
|
|
14220
|
+
$[28] = t7;
|
|
14221
|
+
$[29] = t8;
|
|
14175
14222
|
} else {
|
|
14176
|
-
t8 = $[
|
|
14223
|
+
t8 = $[29];
|
|
14177
14224
|
}
|
|
14178
14225
|
const t9 = Boolean(currentPropertyDialog);
|
|
14179
14226
|
const t10 = Boolean(currentPropertyDialog?.propertyKey);
|
|
@@ -14181,7 +14228,7 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14181
14228
|
const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
|
|
14182
14229
|
const t13 = currentPropertyDialog?.collectionEditable ?? false;
|
|
14183
14230
|
let t14;
|
|
14184
|
-
if ($[
|
|
14231
|
+
if ($[30] !== currentPropertyDialog || $[31] !== getData || $[32] !== navigation) {
|
|
14185
14232
|
t14 = currentPropertyDialog?.existingEntities || getData && currentPropertyDialog?.editedCollectionId ? async () => {
|
|
14186
14233
|
let data = [];
|
|
14187
14234
|
if (currentPropertyDialog?.existingEntities) {
|
|
@@ -14195,15 +14242,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14195
14242
|
}
|
|
14196
14243
|
return data;
|
|
14197
14244
|
} : void 0;
|
|
14198
|
-
$[
|
|
14199
|
-
$[
|
|
14200
|
-
$[
|
|
14201
|
-
$[
|
|
14245
|
+
$[30] = currentPropertyDialog;
|
|
14246
|
+
$[31] = getData;
|
|
14247
|
+
$[32] = navigation;
|
|
14248
|
+
$[33] = t14;
|
|
14202
14249
|
} else {
|
|
14203
|
-
t14 = $[
|
|
14250
|
+
t14 = $[33];
|
|
14204
14251
|
}
|
|
14205
14252
|
let t15;
|
|
14206
|
-
if ($[
|
|
14253
|
+
if ($[34] !== collectionConfigController || $[35] !== currentPropertyDialog || $[36] !== snackbarController) {
|
|
14207
14254
|
t15 = (t162) => {
|
|
14208
14255
|
const {
|
|
14209
14256
|
id: id_0,
|
|
@@ -14232,15 +14279,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14232
14279
|
return false;
|
|
14233
14280
|
});
|
|
14234
14281
|
};
|
|
14235
|
-
$[
|
|
14236
|
-
$[
|
|
14237
|
-
$[
|
|
14238
|
-
$[
|
|
14282
|
+
$[34] = collectionConfigController;
|
|
14283
|
+
$[35] = currentPropertyDialog;
|
|
14284
|
+
$[36] = snackbarController;
|
|
14285
|
+
$[37] = t15;
|
|
14239
14286
|
} else {
|
|
14240
|
-
t15 = $[
|
|
14287
|
+
t15 = $[37];
|
|
14241
14288
|
}
|
|
14242
14289
|
let t16;
|
|
14243
|
-
if ($[
|
|
14290
|
+
if ($[38] !== collectionConfigController || $[39] !== currentPropertyDialog?.currentPropertiesOrder || $[40] !== currentPropertyDialog?.editedCollectionId || $[41] !== currentPropertyDialog?.namespace || $[42] !== currentPropertyDialog?.parentCollectionIds || $[43] !== currentPropertyDialog?.propertyKey || $[44] !== snackbarController) {
|
|
14244
14291
|
t16 = () => {
|
|
14245
14292
|
if (!currentPropertyDialog?.propertyKey) {
|
|
14246
14293
|
return;
|
|
@@ -14263,21 +14310,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14263
14310
|
return false;
|
|
14264
14311
|
});
|
|
14265
14312
|
};
|
|
14266
|
-
$[
|
|
14267
|
-
$[
|
|
14268
|
-
$[
|
|
14269
|
-
$[
|
|
14270
|
-
$[
|
|
14271
|
-
$[
|
|
14272
|
-
$[
|
|
14273
|
-
$[
|
|
14313
|
+
$[38] = collectionConfigController;
|
|
14314
|
+
$[39] = currentPropertyDialog?.currentPropertiesOrder;
|
|
14315
|
+
$[40] = currentPropertyDialog?.editedCollectionId;
|
|
14316
|
+
$[41] = currentPropertyDialog?.namespace;
|
|
14317
|
+
$[42] = currentPropertyDialog?.parentCollectionIds;
|
|
14318
|
+
$[43] = currentPropertyDialog?.propertyKey;
|
|
14319
|
+
$[44] = snackbarController;
|
|
14320
|
+
$[45] = t16;
|
|
14274
14321
|
} else {
|
|
14275
|
-
t16 = $[
|
|
14322
|
+
t16 = $[45];
|
|
14276
14323
|
}
|
|
14277
14324
|
let t17;
|
|
14278
14325
|
let t18;
|
|
14279
14326
|
let t19;
|
|
14280
|
-
if ($[
|
|
14327
|
+
if ($[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
14281
14328
|
t17 = () => {
|
|
14282
14329
|
setCurrentPropertyDialog(void 0);
|
|
14283
14330
|
};
|
|
@@ -14285,66 +14332,66 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
14285
14332
|
setCurrentPropertyDialog(void 0);
|
|
14286
14333
|
};
|
|
14287
14334
|
t19 = {};
|
|
14288
|
-
$[
|
|
14289
|
-
$[
|
|
14290
|
-
$[
|
|
14335
|
+
$[46] = t17;
|
|
14336
|
+
$[47] = t18;
|
|
14337
|
+
$[48] = t19;
|
|
14291
14338
|
} else {
|
|
14292
|
-
t17 = $[
|
|
14293
|
-
t18 = $[
|
|
14294
|
-
t19 = $[
|
|
14339
|
+
t17 = $[46];
|
|
14340
|
+
t18 = $[47];
|
|
14341
|
+
t19 = $[48];
|
|
14295
14342
|
}
|
|
14296
14343
|
let t20;
|
|
14297
|
-
if ($[
|
|
14344
|
+
if ($[49] !== currentPropertyDialog) {
|
|
14298
14345
|
t20 = currentPropertyDialog?.collection?.properties ? Object.keys(currentPropertyDialog.collection.properties) : [];
|
|
14299
|
-
$[
|
|
14300
|
-
$[
|
|
14346
|
+
$[49] = currentPropertyDialog;
|
|
14347
|
+
$[50] = t20;
|
|
14301
14348
|
} else {
|
|
14302
|
-
t20 = $[
|
|
14349
|
+
t20 = $[50];
|
|
14303
14350
|
}
|
|
14304
14351
|
const t21 = currentPropertyDialog?.property;
|
|
14305
14352
|
const t22 = currentPropertyDialog?.propertyKey;
|
|
14306
14353
|
let t23;
|
|
14307
|
-
if ($[
|
|
14354
|
+
if ($[51] !== propertyConfigs || $[52] !== t10 || $[53] !== t11 || $[54] !== t12 || $[55] !== t13 || $[56] !== t14 || $[57] !== t15 || $[58] !== t16 || $[59] !== t20 || $[60] !== t21 || $[61] !== t22 || $[62] !== t9) {
|
|
14308
14355
|
t23 = /* @__PURE__ */ jsx(PropertyFormDialog, { open: t9, includeIdAndName: true, existingProperty: t10, autoUpdateId: t11, autoOpenTypeSelect: t12, inArray: false, collectionEditable: t13, getData: t14, onPropertyChanged: t15, onPropertyChangedImmediate: false, onDelete: t16, onError: _temp3, onOkClicked: t17, onCancel: t18, initialErrors: t19, forceShowErrors: false, existingPropertyKeys: t20, allowDataInference: true, propertyConfigs, property: t21, propertyKey: t22 });
|
|
14309
|
-
$[
|
|
14310
|
-
$[
|
|
14311
|
-
$[
|
|
14312
|
-
$[
|
|
14313
|
-
$[
|
|
14314
|
-
$[
|
|
14315
|
-
$[
|
|
14316
|
-
$[
|
|
14317
|
-
$[
|
|
14318
|
-
$[
|
|
14319
|
-
$[
|
|
14320
|
-
$[
|
|
14321
|
-
$[
|
|
14356
|
+
$[51] = propertyConfigs;
|
|
14357
|
+
$[52] = t10;
|
|
14358
|
+
$[53] = t11;
|
|
14359
|
+
$[54] = t12;
|
|
14360
|
+
$[55] = t13;
|
|
14361
|
+
$[56] = t14;
|
|
14362
|
+
$[57] = t15;
|
|
14363
|
+
$[58] = t16;
|
|
14364
|
+
$[59] = t20;
|
|
14365
|
+
$[60] = t21;
|
|
14366
|
+
$[61] = t22;
|
|
14367
|
+
$[62] = t9;
|
|
14368
|
+
$[63] = t23;
|
|
14322
14369
|
} else {
|
|
14323
|
-
t23 = $[
|
|
14370
|
+
t23 = $[63];
|
|
14324
14371
|
}
|
|
14325
14372
|
let t24;
|
|
14326
|
-
if ($[
|
|
14373
|
+
if ($[64] !== children || $[65] !== t23 || $[66] !== t5 || $[67] !== t8) {
|
|
14327
14374
|
t24 = /* @__PURE__ */ jsxs(CollectionEditorContext.Provider, { value: t5, children: [
|
|
14328
14375
|
children,
|
|
14329
14376
|
t8,
|
|
14330
14377
|
t23
|
|
14331
14378
|
] });
|
|
14332
|
-
$[
|
|
14333
|
-
$[
|
|
14334
|
-
$[
|
|
14335
|
-
$[
|
|
14336
|
-
$[
|
|
14379
|
+
$[64] = children;
|
|
14380
|
+
$[65] = t23;
|
|
14381
|
+
$[66] = t5;
|
|
14382
|
+
$[67] = t8;
|
|
14383
|
+
$[68] = t24;
|
|
14337
14384
|
} else {
|
|
14338
|
-
t24 = $[
|
|
14385
|
+
t24 = $[68];
|
|
14339
14386
|
}
|
|
14340
14387
|
let t25;
|
|
14341
|
-
if ($[
|
|
14388
|
+
if ($[69] !== collectionConfigController || $[70] !== t24) {
|
|
14342
14389
|
t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
|
|
14343
|
-
$[
|
|
14344
|
-
$[
|
|
14345
|
-
$[
|
|
14390
|
+
$[69] = collectionConfigController;
|
|
14391
|
+
$[70] = t24;
|
|
14392
|
+
$[71] = t25;
|
|
14346
14393
|
} else {
|
|
14347
|
-
t25 = $[
|
|
14394
|
+
t25 = $[71];
|
|
14348
14395
|
}
|
|
14349
14396
|
return t25;
|
|
14350
14397
|
}, equal);
|