@webiny/app-admin 6.4.12-beta.1 → 6.4.12-beta.10

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.
Files changed (63) hide show
  1. package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js.map +1 -1
  2. package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js.map +1 -1
  3. package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
  4. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
  5. package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +1 -1
  6. package/base/Base/LexicalPreset.js +1 -1
  7. package/base/Base/LexicalPreset.js.map +1 -1
  8. package/base/Base/Menus.js.map +1 -1
  9. package/base/Base/RoutesConfig.js.map +1 -1
  10. package/base/Base/Tenant.js.map +1 -1
  11. package/base/Base/UserMenu.js.map +1 -1
  12. package/base/Base.js.map +1 -1
  13. package/base/ui/Brand.js.map +1 -1
  14. package/base/ui/Dashboard.js.map +1 -1
  15. package/base/ui/FileManager.js.map +1 -1
  16. package/base/ui/LoginScreen.js.map +1 -1
  17. package/base/ui/Logo.js.map +1 -1
  18. package/base/ui/Navigation.js.map +1 -1
  19. package/base/ui/NotFound.js.map +1 -1
  20. package/base/ui/Tags.js.map +1 -1
  21. package/base/ui/TenantSelector.js.map +1 -1
  22. package/base/ui/UserMenu/UserMenu.js.map +1 -1
  23. package/base/ui/UserMenu/UserMenuHandle.js.map +1 -1
  24. package/base/ui/UserMenu.js.map +1 -1
  25. package/components/Buttons/useButtons.js.map +1 -1
  26. package/components/Dialogs/DialogParamsContext.js.map +1 -1
  27. package/components/Dialogs/DialogsContext.js.map +1 -1
  28. package/components/Filters/FiltersToggle.js.map +1 -1
  29. package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
  30. package/components/IconPicker/IconPickerTab.js.map +1 -1
  31. package/components/IconPicker/IconRenderer.js.map +1 -1
  32. package/components/IconPicker/config/IconType.js.map +1 -1
  33. package/components/IconPicker/config/index.js.map +1 -1
  34. package/components/IconPicker/plugins/customPlugin.js.map +1 -1
  35. package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
  36. package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
  37. package/components/IconPicker/types.js.map +1 -1
  38. package/components/LexicalEditor/DefaultLexicalEditorConfig.js +1 -1
  39. package/components/LexicalEditor/DefaultLexicalEditorConfig.js.map +1 -1
  40. package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
  41. package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
  42. package/components/Wcp.js +6 -6
  43. package/components/Wcp.js.map +1 -1
  44. package/config/AdminConfig/LexicalTheme/Typography.js +4 -4
  45. package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -1
  46. package/config/AdminConfig/Menu.js.map +1 -1
  47. package/config/AdminConfig/Theme.js +1 -1
  48. package/config/AdminConfig/Theme.js.map +1 -1
  49. package/config/AdminConfig.js +2 -2
  50. package/config/AdminConfig.js.map +1 -1
  51. package/config/createAdminConfig.js.map +1 -1
  52. package/features/formModel/FormView.js.map +1 -1
  53. package/features/formModel/createFieldRenderer.js.map +1 -1
  54. package/features/formModel/demo/FormModelDemo.js.map +1 -1
  55. package/hooks/useHotkeys.js +3 -1
  56. package/hooks/useHotkeys.js.map +1 -1
  57. package/package.json +33 -33
  58. package/permissions/PermissionRenderer.js.map +1 -1
  59. package/permissions/PermissionValueContext.js.map +1 -1
  60. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
  61. package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -1
  62. package/presentation/security/hooks/useSecurity.js +2 -2
  63. package/presentation/security/hooks/useSecurity.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { Button, FormComponentDescription, FormComponentLabel, IconButton } from \"@webiny/admin-ui\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport type { IObjectFieldItemVM } from \"~/features/formModel/index.js\";\nimport { NestedLayout } from \"./ObjectFieldComponents.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n keyValueTags: {\n fieldType: \"object\";\n settings?: { addItemLabel?: string };\n };\n }\n}\n\nexport const KeyValueTagsRenderer = createObjectFieldRenderer(({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n return <KeyValueTagsList field={field} />;\n});\n\nconst KeyValueTagsList = createObjectFieldRenderer<\"keyValueTags\">(({ field }) => {\n const settings = field.rendererSettings;\n\n const hasItems = field.items.length > 0;\n\n return (\n <>\n {field.label && <FormComponentLabel text={field.label} />}\n {field.description && <FormComponentDescription text={field.description} />}\n {hasItems ? (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map(item => (\n <TagRow key={item.key} item={item} disabled={field.disabled} />\n ))}\n </div>\n ) : null}\n {!field.disabled ? (\n <div className={\"mt-md\"}>\n <Button\n onClick={() => field.addItem()}\n text={settings?.addItemLabel ?? \"Add tag\"}\n variant={\"secondary\"}\n size={\"sm\"}\n icon={<AddIcon />}\n />\n </div>\n ) : null}\n </>\n );\n});\n\nconst TagRow = observer(({ item, disabled }: { item: IObjectFieldItemVM; disabled: boolean }) => {\n const inlineLayout = [{ type: \"row\" as const, fields: item.fields }];\n\n return (\n <div className={\"flex items-center gap-sm\"}>\n <div className={\"flex-1 gap-md\"}>\n <NestedLayout layout={inlineLayout} />\n </div>\n {!disabled && (\n <IconButton\n variant={\"ghost\"}\n size={\"lg\"}\n icon={<DeleteIcon />}\n onClick={() => item.remove()}\n />\n )}\n </div>\n );\n});\n"],"names":["KeyValueTagsRenderer","createObjectFieldRenderer","field","KeyValueTagsList","settings","hasItems","FormComponentLabel","FormComponentDescription","item","TagRow","Button","AddIcon","observer","disabled","inlineLayout","NestedLayout","IconButton","DeleteIcon"],"mappings":";;;;;;;AAkBO,MAAMA,uBAAuBC,0BAA0B,CAAC,EAAEC,KAAK,EAAE;IACpE,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAGX,OAAO,WAAP,GAAO,oBAACC,kBAAgBA;QAAC,OAAOD;;AACpC;AAEA,MAAMC,mBAAmBF,0BAA0C,CAAC,EAAEC,KAAK,EAAE;IACzE,MAAME,WAAWF,MAAM,gBAAgB;IAEvC,MAAMG,WAAWH,MAAM,KAAK,CAAC,MAAM,GAAG;IAEtC,OAAO,WAAP,GACI,0CACKA,MAAM,KAAK,IAAI,WAAJ,GAAI,oBAACI,oBAAkBA;QAAC,MAAMJ,MAAM,KAAK;QACpDA,MAAM,WAAW,IAAI,WAAJ,GAAI,oBAACK,0BAAwBA;QAAC,MAAML,MAAM,WAAW;QACtEG,WAAW,WAAXA,GACG,oBAAC;QAAI,WAAW;OACXH,MAAM,KAAK,CAAC,GAAG,CAACM,CAAAA,OAAAA,WAAAA,GACb,oBAACC,QAAMA;YAAC,KAAKD,KAAK,GAAG;YAAE,MAAMA;YAAM,UAAUN,MAAM,QAAQ;eAGnE,MACH,AAACA,MAAM,QAAQ,GAUZ,OAVe,WAAH,GACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACQ,QAAMA;QACH,SAAS,IAAMR,MAAM,OAAO;QAC5B,MAAME,UAAU,gBAAgB;QAChC,SAAS;QACT,MAAM;QACN,oBAAM,oBAACO,gBAAOA;;AAMtC;AAEA,MAAMF,SAASG,SAAS,CAAC,EAAEJ,IAAI,EAAEK,QAAQ,EAAmD;IACxF,MAAMC,eAAe;QAAC;YAAE,MAAM;YAAgB,QAAQN,KAAK,MAAM;QAAC;KAAE;IAEpE,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACO,cAAYA;QAAC,QAAQD;SAEzB,CAACD,YAAY,WAAZA,GACE,oBAACG,YAAUA;QACP,SAAS;QACT,MAAM;QACN,oBAAM,oBAACC,2BAAUA;QACjB,SAAS,IAAMT,KAAK,MAAM;;AAK9C"}
1
+ {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { Button, FormComponentDescription, FormComponentLabel, IconButton } from \"@webiny/admin-ui\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport type { IObjectFieldItemVM } from \"~/features/formModel/index.js\";\nimport { NestedLayout } from \"./ObjectFieldComponents.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n keyValueTags: {\n fieldType: \"object\";\n settings?: { addItemLabel?: string };\n };\n }\n}\n\nexport const KeyValueTagsRenderer = createObjectFieldRenderer(({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n return <KeyValueTagsList field={field} />;\n});\n\nconst KeyValueTagsList = createObjectFieldRenderer<\"keyValueTags\">(({ field }) => {\n const settings = field.rendererSettings;\n\n const hasItems = field.items.length > 0;\n\n return (\n <>\n {field.label && <FormComponentLabel text={field.label} />}\n {field.description && <FormComponentDescription text={field.description} />}\n {hasItems ? (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map(item => (\n <TagRow key={item.key} item={item} disabled={field.disabled} />\n ))}\n </div>\n ) : null}\n {!field.disabled ? (\n <div className={\"mt-md\"}>\n <Button\n onClick={() => field.addItem()}\n text={settings?.addItemLabel ?? \"Add tag\"}\n variant={\"secondary\"}\n size={\"sm\"}\n icon={<AddIcon />}\n />\n </div>\n ) : null}\n </>\n );\n});\n\nconst TagRow = observer(({ item, disabled }: { item: IObjectFieldItemVM; disabled: boolean }) => {\n const inlineLayout = [{ type: \"row\" as const, fields: item.fields }];\n\n return (\n <div className={\"flex items-center gap-sm\"}>\n <div className={\"flex-1 gap-md\"}>\n <NestedLayout layout={inlineLayout} />\n </div>\n {!disabled && (\n <IconButton\n variant={\"ghost\"}\n size={\"lg\"}\n icon={<DeleteIcon />}\n onClick={() => item.remove()}\n />\n )}\n </div>\n );\n});\n"],"names":["KeyValueTagsRenderer","createObjectFieldRenderer","field","KeyValueTagsList","settings","hasItems","FormComponentLabel","FormComponentDescription","item","TagRow","Button","AddIcon","observer","disabled","inlineLayout","NestedLayout","IconButton","DeleteIcon"],"mappings":";;;;;;;AAkBO,MAAMA,uBAAuBC,0BAA0B,CAAC,EAAEC,KAAK,EAAE;IACpE,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAGX,OAAO,WAAP,GAAO,oBAACC,kBAAAA;QAAiB,OAAOD;;AACpC;AAEA,MAAMC,mBAAmBF,0BAA0C,CAAC,EAAEC,KAAK,EAAE;IACzE,MAAME,WAAWF,MAAM,gBAAgB;IAEvC,MAAMG,WAAWH,MAAM,KAAK,CAAC,MAAM,GAAG;IAEtC,OAAO,WAAP,GACI,0CACKA,MAAM,KAAK,IAAI,WAAJ,GAAI,oBAACI,oBAAkBA;QAAC,MAAMJ,MAAM,KAAK;QACpDA,MAAM,WAAW,IAAI,WAAJ,GAAI,oBAACK,0BAAwBA;QAAC,MAAML,MAAM,WAAW;QACtEG,WAAW,WAAXA,GACG,oBAAC;QAAI,WAAW;OACXH,MAAM,KAAK,CAAC,GAAG,CAACM,CAAAA,OAAAA,WAAAA,GACb,oBAACC,QAAAA;YAAO,KAAKD,KAAK,GAAG;YAAE,MAAMA;YAAM,UAAUN,MAAM,QAAQ;eAGnE,MACH,AAACA,MAAM,QAAQ,GAUZ,OAVe,WAAH,GACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACQ,QAAMA;QACH,SAAS,IAAMR,MAAM,OAAO;QAC5B,MAAME,UAAU,gBAAgB;QAChC,SAAS;QACT,MAAM;QACN,oBAAM,oBAACO,gBAAOA;;AAMtC;AAEA,MAAMF,SAASG,SAAS,CAAC,EAAEJ,IAAI,EAAEK,QAAQ,EAAmD;IACxF,MAAMC,eAAe;QAAC;YAAE,MAAM;YAAgB,QAAQN,KAAK,MAAM;QAAC;KAAE;IAEpE,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACO,cAAYA;QAAC,QAAQD;SAEzB,CAACD,YAAY,WAAZA,GACE,oBAACG,YAAUA;QACP,SAAS;QACT,MAAM;QACN,oBAAM,oBAACC,2BAAUA;QACjB,SAAS,IAAMT,KAAK,MAAM;;AAK9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as CloneIcon } from \"@webiny/icons/library_add.svg\";\nimport { ReactComponent as ArrowUpIcon } from \"@webiny/icons/expand_less.svg\";\nimport { ReactComponent as ArrowDownIcon } from \"@webiny/icons/expand_more.svg\";\nimport { ReactComponent as HorizontalRuleIcon } from \"@webiny/icons/horizontal_rule.svg\";\nimport type { IObjectFieldItemVM, IObjectFieldVM } from \"~/features/formModel/index.js\";\nimport { useConfirmationDialog } from \"~/hooks/useConfirmationDialog.js\";\nimport { NestedLayout } from \"./ObjectFieldComponents.js\";\nimport { AddTemplateButton } from \"./TemplatePicker.js\";\n\ninterface MultiValueDynamicZoneProps {\n field: IObjectFieldVM;\n showContainer?: boolean;\n}\n\nexport const MultiValueDynamicZone = observer(\n ({ field, showContainer = true }: MultiValueDynamicZoneProps) => {\n const itemCount = field.items.length;\n\n const content = (\n <div className={\"flex flex-col gap-lg\"}>\n {itemCount > 0 ? (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n className={\"gap-md flex flex-col\"}\n >\n {field.items.map((item, index) => (\n <TemplatedListItem\n key={item.key}\n item={item}\n index={index}\n total={itemCount}\n templates={field.availableTemplates}\n disabled={field.disabled}\n />\n ))}\n </Accordion>\n ) : null}\n {!field.disabled && (\n <AddTemplateButton\n templates={field.availableTemplates}\n onSelect={template => field.addItem(template.id)}\n />\n )}\n </div>\n );\n\n if (!showContainer) {\n return content;\n }\n\n const label = `${field.label || \"\"}${itemCount ? ` (${itemCount})` : \"\"}`;\n\n return (\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item\n icon={\n <Accordion.Item.Icon\n color={\"accent\"}\n label={\"Dynamic Zone\"}\n icon={<HorizontalRuleIcon />}\n />\n }\n title={label}\n defaultOpen={true}\n >\n {content}\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\ninterface TemplatedListItemProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n templates: { id: string; label: string }[];\n disabled: boolean;\n}\n\nconst TemplatedListItem = observer(\n ({ item, index, total, templates, disabled }: TemplatedListItemProps) => {\n const { showConfirmation } = useConfirmationDialog({\n title: \"Delete item\",\n message: \"Are you sure you want to delete this item? This action is not reversible.\",\n acceptLabel: \"Yes, I'm sure!\",\n cancelLabel: \"No, leave it.\"\n });\n\n const template = templates.find(t => t.id === item.templateId);\n const title = template?.label || `Item #${index + 1}`;\n\n const onDelete = () => {\n showConfirmation(() => {\n item.remove();\n });\n };\n\n const actions = (\n <>\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowUpIcon />} content={\"Move up\"} />}\n onClick={item.moveUp}\n disabled={index === 0}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowDownIcon />} content={\"Move down\"} />}\n onClick={item.moveDown}\n disabled={index === total - 1}\n />\n <Accordion.Item.Action.Separator />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<CloneIcon />} content={\"Duplicate\"} />}\n onClick={item.duplicate}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<DeleteIcon />} content={\"Delete\"} />}\n onClick={onDelete}\n />\n </>\n );\n\n return (\n <Accordion.Item title={title} actions={disabled ? null : actions} defaultOpen={false}>\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n );\n }\n);\n"],"names":["MultiValueDynamicZone","observer","field","showContainer","itemCount","content","Accordion","item","index","TemplatedListItem","AddTemplateButton","template","label","HorizontalRuleIcon","total","templates","disabled","showConfirmation","useConfirmationDialog","t","title","onDelete","actions","Tooltip","ArrowUpIcon","ArrowDownIcon","CloneIcon","DeleteIcon","NestedLayout"],"mappings":";;;;;;;;;;;AAkBO,MAAMA,wBAAwBC,SACjC,CAAC,EAAEC,KAAK,EAAEC,gBAAgB,IAAI,EAA8B;IACxD,MAAMC,YAAYF,MAAM,KAAK,CAAC,MAAM;IAEpC,MAAMG,UAAU,WAAVA,GACF,oBAAC;QAAI,WAAW;OACXD,YAAY,IAAI,WAAJ,GACT,oBAACE,WAASA;QACN,YAAY;QACZ,SAAS;QACT,WAAW;OAEVJ,MAAM,KAAK,CAAC,GAAG,CAAC,CAACK,MAAMC,QAAAA,WAAAA,GACpB,oBAACC,mBAAiBA;YACd,KAAKF,KAAK,GAAG;YACb,MAAMA;YACN,OAAOC;YACP,OAAOJ;YACP,WAAWF,MAAM,kBAAkB;YACnC,UAAUA,MAAM,QAAQ;eAIpC,MACH,CAACA,MAAM,QAAQ,IAAI,WAAJ,GACZ,oBAACQ,mBAAiBA;QACd,WAAWR,MAAM,kBAAkB;QACnC,UAAUS,CAAAA,WAAYT,MAAM,OAAO,CAACS,SAAS,EAAE;;IAM/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QAClB,oBAAM,oBAACiB,SAAOA;YAAC,uBAAS,oBAACG,gCAASA;YAAK,SAAS;;QAChD,SAASnB,KAAK,SAAS;sBAE3B,oBAACD,UAAU,IAAI,CAAC,MAAM;QAClB,oBAAM,oBAACiB,SAAOA;YAAC,uBAAS,oBAACI,gBAAUA;YAAK,SAAS;;QACjD,SAASN;;IAKrB,OAAO,WAAP,GACI,oBAACf,UAAU,IAAI;QAAC,OAAOc;QAAO,SAASJ,WAAW,OAAOM;QAAS,aAAa;qBAC3E,oBAACM,cAAYA;QAAC,QAAQrB,KAAK,MAAM;;AAG7C"}
1
+ {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as CloneIcon } from \"@webiny/icons/library_add.svg\";\nimport { ReactComponent as ArrowUpIcon } from \"@webiny/icons/expand_less.svg\";\nimport { ReactComponent as ArrowDownIcon } from \"@webiny/icons/expand_more.svg\";\nimport { ReactComponent as HorizontalRuleIcon } from \"@webiny/icons/horizontal_rule.svg\";\nimport type { IObjectFieldItemVM, IObjectFieldVM } from \"~/features/formModel/index.js\";\nimport { useConfirmationDialog } from \"~/hooks/useConfirmationDialog.js\";\nimport { NestedLayout } from \"./ObjectFieldComponents.js\";\nimport { AddTemplateButton } from \"./TemplatePicker.js\";\n\ninterface MultiValueDynamicZoneProps {\n field: IObjectFieldVM;\n showContainer?: boolean;\n}\n\nexport const MultiValueDynamicZone = observer(\n ({ field, showContainer = true }: MultiValueDynamicZoneProps) => {\n const itemCount = field.items.length;\n\n const content = (\n <div className={\"flex flex-col gap-lg\"}>\n {itemCount > 0 ? (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n className={\"gap-md flex flex-col\"}\n >\n {field.items.map((item, index) => (\n <TemplatedListItem\n key={item.key}\n item={item}\n index={index}\n total={itemCount}\n templates={field.availableTemplates}\n disabled={field.disabled}\n />\n ))}\n </Accordion>\n ) : null}\n {!field.disabled && (\n <AddTemplateButton\n templates={field.availableTemplates}\n onSelect={template => field.addItem(template.id)}\n />\n )}\n </div>\n );\n\n if (!showContainer) {\n return content;\n }\n\n const label = `${field.label || \"\"}${itemCount ? ` (${itemCount})` : \"\"}`;\n\n return (\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item\n icon={\n <Accordion.Item.Icon\n color={\"accent\"}\n label={\"Dynamic Zone\"}\n icon={<HorizontalRuleIcon />}\n />\n }\n title={label}\n defaultOpen={true}\n >\n {content}\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\ninterface TemplatedListItemProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n templates: { id: string; label: string }[];\n disabled: boolean;\n}\n\nconst TemplatedListItem = observer(\n ({ item, index, total, templates, disabled }: TemplatedListItemProps) => {\n const { showConfirmation } = useConfirmationDialog({\n title: \"Delete item\",\n message: \"Are you sure you want to delete this item? This action is not reversible.\",\n acceptLabel: \"Yes, I'm sure!\",\n cancelLabel: \"No, leave it.\"\n });\n\n const template = templates.find(t => t.id === item.templateId);\n const title = template?.label || `Item #${index + 1}`;\n\n const onDelete = () => {\n showConfirmation(() => {\n item.remove();\n });\n };\n\n const actions = (\n <>\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowUpIcon />} content={\"Move up\"} />}\n onClick={item.moveUp}\n disabled={index === 0}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowDownIcon />} content={\"Move down\"} />}\n onClick={item.moveDown}\n disabled={index === total - 1}\n />\n <Accordion.Item.Action.Separator />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<CloneIcon />} content={\"Duplicate\"} />}\n onClick={item.duplicate}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<DeleteIcon />} content={\"Delete\"} />}\n onClick={onDelete}\n />\n </>\n );\n\n return (\n <Accordion.Item title={title} actions={disabled ? null : actions} defaultOpen={false}>\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n );\n }\n);\n"],"names":["MultiValueDynamicZone","observer","field","showContainer","itemCount","content","Accordion","item","index","TemplatedListItem","AddTemplateButton","template","label","HorizontalRuleIcon","total","templates","disabled","showConfirmation","useConfirmationDialog","t","title","onDelete","actions","Tooltip","ArrowUpIcon","ArrowDownIcon","CloneIcon","DeleteIcon","NestedLayout"],"mappings":";;;;;;;;;;;AAkBO,MAAMA,wBAAwBC,SACjC,CAAC,EAAEC,KAAK,EAAEC,gBAAgB,IAAI,EAA8B;IACxD,MAAMC,YAAYF,MAAM,KAAK,CAAC,MAAM;IAEpC,MAAMG,UAAU,WAAVA,GACF,oBAAC;QAAI,WAAW;OACXD,YAAY,IAAI,WAAJ,GACT,oBAACE,WAASA;QACN,YAAY;QACZ,SAAS;QACT,WAAW;OAEVJ,MAAM,KAAK,CAAC,GAAG,CAAC,CAACK,MAAMC,QAAAA,WAAAA,GACpB,oBAACC,mBAAAA;YACG,KAAKF,KAAK,GAAG;YACb,MAAMA;YACN,OAAOC;YACP,OAAOJ;YACP,WAAWF,MAAM,kBAAkB;YACnC,UAAUA,MAAM,QAAQ;eAIpC,MACH,CAACA,MAAM,QAAQ,IAAI,WAAJ,GACZ,oBAACQ,mBAAiBA;QACd,WAAWR,MAAM,kBAAkB;QACnC,UAAUS,CAAAA,WAAYT,MAAM,OAAO,CAACS,SAAS,EAAE;;IAM/D,IAAI,CAACR,eACD,OAAOE;IAGX,MAAMO,QAAQ,GAAGV,MAAM,KAAK,IAAI,KAAKE,YAAY,CAAC,EAAE,EAAEA,UAAU,CAAC,CAAC,GAAG,IAAI;IAEzE,OAAO,WAAP,GACI,oBAACE,WAASA;QAAC,YAAY;QAAQ,SAAS;qBACpC,oBAACA,UAAU,IAAI;QACX,oBACI,oBAACA,UAA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AACf,UAAU,IAAI;QAAC,OAAOc;QAAO,SAASJ,WAAW,OAAOM;QAAS,aAAa;qBAC3E,oBAACM,cAAYA;QAAC,QAAQrB,KAAK,MAAM;;AAG7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { Accordion } from \"@webiny/admin-ui\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport { ListItemRenderer, AddItemButton } from \"./ObjectFieldComponents.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n container?: boolean;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n addItemLabel?: string;\n };\n };\n }\n}\n\nexport const ObjectAccordionMultipleRenderer = createObjectFieldRenderer<\"objectAccordionMultiple\">(\n ({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n const settings = field.rendererSettings;\n const showContainer = settings?.container !== false;\n\n const addButton = (\n <AddItemButton\n label={settings?.addItemLabel ?? `Add ${field.label || \"Item\"}`}\n disabled={field.disabled}\n onAdd={() => field.addItem()}\n />\n );\n\n if (!showContainer) {\n return (\n <div className={\"flex flex-col gap-lg\"}>\n <ListItems field={field} />\n {addButton}\n </div>\n );\n }\n\n const label = `${field.label || \"\"} ${field.items.length ? `(${field.items.length})` : \"\"}`;\n\n return (\n <div className={\"flex flex-col gap-lg\"}>\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item title={label} defaultOpen={true}>\n <ListItems field={field} />\n </Accordion.Item>\n </Accordion>\n {addButton}\n </div>\n );\n }\n);\n\nconst ListItems = createObjectFieldRenderer<\"objectAccordionMultiple\">(({ field }) => {\n const settings = field.rendererSettings;\n\n return (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map((item, index) => (\n <ListItemRenderer\n key={item.key}\n item={item}\n index={index}\n total={field.items.length}\n label={field.label}\n itemTitle={settings?.itemTitle}\n disabled={field.disabled}\n />\n ))}\n </div>\n );\n});\n"],"names":["ObjectAccordionMultipleRenderer","createObjectFieldRenderer","field","settings","showContainer","addButton","AddItemButton","ListItems","label","Accordion","item","index","ListItemRenderer"],"mappings":";;;;AAmBO,MAAMA,kCAAkCC,0BAC3C,CAAC,EAAEC,KAAK,EAAE;IACN,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAGX,MAAMC,WAAWD,MAAM,gBAAgB;IACvC,MAAME,gBAAgBD,UAAU,cAAc;IAE9C,MAAME,YAAY,WAAZA,GACF,oBAACC,eAAaA;QACV,OAAOH,UAAU,gBAAgB,CAAC,IAAI,EAAED,MAAM,KAAK,IAAI,QAAQ;QAC/D,UAAUA,MAAM,QAAQ;QACxB,OAAO,IAAMA,MAAM,OAAO;;IAIlC,IAAI,CAACE,eACD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACG,WAASA;QAAC,OAAOL;QACjBG;IAKb,MAAMG,QAAQ,GAAGN,MAAM,KAAK,IAAI,GAAG,CAAC,EAAEA,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAEA,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAE3F,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACO,WAASA;QAAC,YAAY;QAAQ,SAAS;qBACpC,oBAACA,UAAU,IAAI;QAAC,OAAOD;QAAO,aAAa;qBACvC,oBAACD,WAASA;QAAC,OAAOL;UAGzBG;AAGb;AAGJ,MAAME,YAAYN,0BAAqD,CAAC,EAAEC,KAAK,EAAE;IAC7E,MAAMC,WAAWD,MAAM,gBAAgB;IAEvC,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXA,MAAM,KAAK,CAAC,GAAG,CAAC,CAACQ,MAAMC,QAAAA,WAAAA,GACpB,oBAACC,kBAAgBA;YACb,KAAKF,KAAK,GAAG;YACb,MAAMA;YACN,OAAOC;YACP,OAAOT,MAAM,KAAK,CAAC,MAAM;YACzB,OAAOA,MAAM,KAAK;YAClB,WAAWC,UAAU;YACrB,UAAUD,MAAM,QAAQ;;AAK5C"}
1
+ {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { Accordion } from \"@webiny/admin-ui\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport { ListItemRenderer, AddItemButton } from \"./ObjectFieldComponents.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n container?: boolean;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n addItemLabel?: string;\n };\n };\n }\n}\n\nexport const ObjectAccordionMultipleRenderer = createObjectFieldRenderer<\"objectAccordionMultiple\">(\n ({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n const settings = field.rendererSettings;\n const showContainer = settings?.container !== false;\n\n const addButton = (\n <AddItemButton\n label={settings?.addItemLabel ?? `Add ${field.label || \"Item\"}`}\n disabled={field.disabled}\n onAdd={() => field.addItem()}\n />\n );\n\n if (!showContainer) {\n return (\n <div className={\"flex flex-col gap-lg\"}>\n <ListItems field={field} />\n {addButton}\n </div>\n );\n }\n\n const label = `${field.label || \"\"} ${field.items.length ? `(${field.items.length})` : \"\"}`;\n\n return (\n <div className={\"flex flex-col gap-lg\"}>\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item title={label} defaultOpen={true}>\n <ListItems field={field} />\n </Accordion.Item>\n </Accordion>\n {addButton}\n </div>\n );\n }\n);\n\nconst ListItems = createObjectFieldRenderer<\"objectAccordionMultiple\">(({ field }) => {\n const settings = field.rendererSettings;\n\n return (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map((item, index) => (\n <ListItemRenderer\n key={item.key}\n item={item}\n index={index}\n total={field.items.length}\n label={field.label}\n itemTitle={settings?.itemTitle}\n disabled={field.disabled}\n />\n ))}\n </div>\n );\n});\n"],"names":["ObjectAccordionMultipleRenderer","createObjectFieldRenderer","field","settings","showContainer","addButton","AddItemButton","ListItems","label","Accordion","item","index","ListItemRenderer"],"mappings":";;;;AAmBO,MAAMA,kCAAkCC,0BAC3C,CAAC,EAAEC,KAAK,EAAE;IACN,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAGX,MAAMC,WAAWD,MAAM,gBAAgB;IACvC,MAAME,gBAAgBD,UAAU,cAAc;IAE9C,MAAME,YAAY,WAAZA,GACF,oBAACC,eAAaA;QACV,OAAOH,UAAU,gBAAgB,CAAC,IAAI,EAAED,MAAM,KAAK,IAAI,QAAQ;QAC/D,UAAUA,MAAM,QAAQ;QACxB,OAAO,IAAMA,MAAM,OAAO;;IAIlC,IAAI,CAACE,eACD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACG,WAAAA;QAAU,OAAOL;QACjBG;IAKb,MAAMG,QAAQ,GAAGN,MAAM,KAAK,IAAI,GAAG,CAAC,EAAEA,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAEA,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAE3F,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACO,WAASA;QAAC,YAAY;QAAQ,SAAS;qBACpC,oBAACA,UAAU,IAAI;QAAC,OAAOD;QAAO,aAAa;qBACvC,oBAACD,WAAAA;QAAU,OAAOL;UAGzBG;AAGb;AAGJ,MAAME,YAAYN,0BAAqD,CAAC,EAAEC,KAAK,EAAE;IAC7E,MAAMC,WAAWD,MAAM,gBAAgB;IAEvC,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXA,MAAM,KAAK,CAAC,GAAG,CAAC,CAACQ,MAAMC,QAAAA,WAAAA,GACpB,oBAACC,kBAAgBA;YACb,KAAKF,KAAK,GAAG;YACb,MAAMA;YACN,OAAOC;YACP,OAAOT,MAAM,KAAK,CAAC,MAAM;YACzB,OAAOA,MAAM,KAAK;YAClB,WAAWC,UAAU;YACrB,UAAUD,MAAM,QAAQ;;AAK5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Button, IconButton } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as ArrowUp } from \"@webiny/icons/arrow_upward.svg\";\nimport { ReactComponent as ArrowDown } from \"@webiny/icons/arrow_downward.svg\";\nimport type { IObjectFieldItemVM, LayoutNodeVM } from \"~/features/formModel/index.js\";\nimport { LayoutNodeRenderer } from \"~/features/formModel/FormView.js\";\nimport { resolveItemTitle } from \"./resolveItemTitle.js\";\n/**\n * Walks a resolved layout sub-tree. Used by dynamic-zone renderers to render\n * a templated object's children via per-template layouts (Phase 8c).\n */\nexport const NestedLayout = observer(({ layout }: { layout: LayoutNodeVM[] }) => {\n return (\n <div className={\"flex flex-col gap-md\"}>\n {layout.map((node, index) => (\n <LayoutNodeRenderer key={index} node={node} />\n ))}\n </div>\n );\n});\n\nexport interface ListItemRendererProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n label?: string;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n disabled: boolean;\n}\n\nexport const ListItemRenderer = observer(\n ({ item, index, total, label, itemTitle, disabled }: ListItemRendererProps) => {\n const [open, setOpen] = useState(false);\n const hasFocusRequest = item.fields.some(f => f.focusRequested);\n\n useEffect(() => {\n if (hasFocusRequest) {\n setOpen(true);\n }\n }, [hasFocusRequest]);\n\n const actions = (\n <>\n <IconButton\n icon={<ArrowDown />}\n onClick={e => {\n e.stopPropagation();\n item.moveDown();\n }}\n variant=\"ghost\"\n disabled={index === total - 1}\n />\n <IconButton\n icon={<ArrowUp />}\n onClick={e => {\n e.stopPropagation();\n item.moveUp();\n }}\n variant=\"ghost\"\n disabled={index === 0}\n />\n <Accordion.Item.Action.Separator />\n <IconButton\n icon={<DeleteIcon />}\n onClick={e => {\n e.stopPropagation();\n item.remove();\n }}\n variant=\"ghost\"\n />\n </>\n );\n\n return (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n openClosedIndicatorPosition={\"left\"}\n >\n <Accordion.Item\n title={resolveItemTitle(item, index, label, itemTitle)}\n actions={disabled ? null : actions}\n open={open}\n onOpenChange={setOpen}\n >\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\nexport interface AddItemButtonProps {\n label?: string;\n disabled: boolean;\n onAdd: () => void;\n}\n\nexport const AddItemButton = ({ label, disabled, onAdd }: AddItemButtonProps) => {\n return (\n <div>\n <Button\n text={label || \"Add Item\"}\n variant={\"secondary\"}\n size={\"sm\"}\n onClick={onAdd}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"names":["NestedLayout","observer","layout","node","index","LayoutNodeRenderer","ListItemRenderer","item","total","label","itemTitle","disabled","open","setOpen","useState","hasFocusRequest","f","useEffect","actions","IconButton","ArrowDown","e","ArrowUp","Accordion","DeleteIcon","resolveItemTitle","AddItemButton","onAdd","Button"],"mappings":";;;;;;;;AAaO,MAAMA,eAAeC,SAAS,CAAC,EAAEC,MAAM,EAA8B,GACjE,WAAP,GACI,oBAAC;QAAI,WAAW;OACXA,OAAO,GAAG,CAAC,CAACC,MAAMC,QAAAA,WAAAA,GACf,oBAACC,oBAAkBA;YAAC,KAAKD;YAAO,MAAMD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S;QACT,MAAM;QACN,SAASkB;QACT,UAAUhB"}
1
+ {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Button, IconButton } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as ArrowUp } from \"@webiny/icons/arrow_upward.svg\";\nimport { ReactComponent as ArrowDown } from \"@webiny/icons/arrow_downward.svg\";\nimport type { IObjectFieldItemVM, LayoutNodeVM } from \"~/features/formModel/index.js\";\nimport { LayoutNodeRenderer } from \"~/features/formModel/FormView.js\";\nimport { resolveItemTitle } from \"./resolveItemTitle.js\";\n/**\n * Walks a resolved layout sub-tree. Used by dynamic-zone renderers to render\n * a templated object's children via per-template layouts (Phase 8c).\n */\nexport const NestedLayout = observer(({ layout }: { layout: LayoutNodeVM[] }) => {\n return (\n <div className={\"flex flex-col gap-md\"}>\n {layout.map((node, index) => (\n <LayoutNodeRenderer key={index} node={node} />\n ))}\n </div>\n );\n});\n\nexport interface ListItemRendererProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n label?: string;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n disabled: boolean;\n}\n\nexport const ListItemRenderer = observer(\n ({ item, index, total, label, itemTitle, disabled }: ListItemRendererProps) => {\n const [open, setOpen] = useState(false);\n const hasFocusRequest = item.fields.some(f => f.focusRequested);\n\n useEffect(() => {\n if (hasFocusRequest) {\n setOpen(true);\n }\n }, [hasFocusRequest]);\n\n const actions = (\n <>\n <IconButton\n icon={<ArrowDown />}\n onClick={e => {\n e.stopPropagation();\n item.moveDown();\n }}\n variant=\"ghost\"\n disabled={index === total - 1}\n />\n <IconButton\n icon={<ArrowUp />}\n onClick={e => {\n e.stopPropagation();\n item.moveUp();\n }}\n variant=\"ghost\"\n disabled={index === 0}\n />\n <Accordion.Item.Action.Separator />\n <IconButton\n icon={<DeleteIcon />}\n onClick={e => {\n e.stopPropagation();\n item.remove();\n }}\n variant=\"ghost\"\n />\n </>\n );\n\n return (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n openClosedIndicatorPosition={\"left\"}\n >\n <Accordion.Item\n title={resolveItemTitle(item, index, label, itemTitle)}\n actions={disabled ? null : actions}\n open={open}\n onOpenChange={setOpen}\n >\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\nexport interface AddItemButtonProps {\n label?: string;\n disabled: boolean;\n onAdd: () => void;\n}\n\nexport const AddItemButton = ({ label, disabled, onAdd }: AddItemButtonProps) => {\n return (\n <div>\n <Button\n text={label || \"Add Item\"}\n variant={\"secondary\"}\n size={\"sm\"}\n onClick={onAdd}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"names":["NestedLayout","observer","layout","node","index","LayoutNodeRenderer","ListItemRenderer","item","total","label","itemTitle","disabled","open","setOpen","useState","hasFocusRequest","f","useEffect","actions","IconButton","ArrowDown","e","ArrowUp","Accordion","DeleteIcon","resolveItemTitle","AddItemButton","onAdd","Button"],"mappings":";;;;;;;;AAaO,MAAMA,eAAeC,SAAS,CAAC,EAAEC,MAAM,EAA8B,GACjE,WAAP,GACI,oBAAC;QAAI,WAAW;OACXA,OAAO,GAAG,CAAC,CAACC,MAAMC,QAAAA,WAAAA,GACf,oBAACC,oBAAkBA;YAAC,KAAKD;YAAO,MAAMD;;AAe/C,MAAMG,mBAAmBL,SAC5B,CAAC,EAAEM,IAAI,EAAEH,KAAK,EAAEI,KAAK,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAyB;IACtE,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAS;IACjC,MAAMC,kBAAkBR,KAAK,MAAM,CAAC,IAAI,CAACS,CAAAA,IAAKA,EAAE,cAAc;IAE9DC,UAAU;QACN,IAAIF,iBACAF,QAAQ;IAEhB,GAAG;QAACE;KAAgB;IAEpB,MAAMG,UAAU,WAAVA,GACF,wDACI,oBAACC,YAAUA;QACP,oBAAM,oBAACC,mCAASA;QAChB,SAASC,CAAAA;YACLA,EAAE,eAAe;YACjBd,KAAK,QAAQ;QACjB;QACA,SAAQ;QACR,UAAUH,UAAUI,QAAQ;sBAEhC,oBAACW,YAAUA;QACP,oBAAM,oBAACG,iCAAOA;QACd,SAASD,CAAAA;YACLA,EAAE,eAAe;YACjBd,KAAK,MAAM;QACf;QACA,SAAQ;QACR,UAAUH,AAAU,MAAVA;sBAEd,oBAACmB,UAAU,IAAI,CAAC,MAAM,CAAC,SAAS,uBAChC,oBAACJ,YAAUA;QACP,oBAAM,oBAACK,gBAAUA;QACjB,SAASH,CAAAA;YACLA,EAAE,eAAe;YACjBd,KAAK,MAAM;QACf;QACA,SAAQ;;IAKpB,OAAO,WAAP,GACI,oBAACgB,WAASA;QACN,YAAY;QACZ,SAAS;QACT,6BAA6B;qBAE7B,oBAACA,UAAU,IAAI;QACX,OAAOE,iBAAiBlB,MAAMH,OAAOK,OAAOC;QAC5C,SAASC,WAAW,OAAOO;QAC3B,MAAMN;QACN,cAAcC;qBAEd,oBAACb,cAAAA;QAAa,QAAQO,KAAK,MAAM;;AAIjD;AASG,MAAMmB,gBAAgB,CAAC,EAAEjB,KAAK,EAAEE,QAAQ,EAAEgB,KAAK,EAAsB,GACjE,WAAP,GACI,oBAAC,2BACG,oBAACC,QAAMA;QACH,MAAMnB,SAAS;QACf,SAAS;QACT,MAAM;QACN,SAASkB;QACT,UAAUhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Button, Dialog, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusIcon } from \"@webiny/icons/add_circle_outline.svg\";\nimport type { ITemplateIcon, ITemplateVM } from \"~/features/formModel/index.js\";\n\nconst normalizeIcon = (icon: ITemplateIcon | undefined): IconProp | undefined => {\n if (!icon) {\n return undefined;\n }\n return icon.name.split(\"/\") as IconProp;\n};\n\nexport interface AddTemplateButtonProps {\n templates: ITemplateVM[];\n onSelect: (template: ITemplateVM) => void;\n label?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n}\n\nexport const AddTemplateButton = ({\n templates,\n onSelect,\n label = \"Add a template\",\n size = \"sm\",\n variant = \"tertiary\"\n}: AddTemplateButtonProps) => {\n return (\n <div className={\"flex justify-between items-center\"}>\n <Dialog\n size={\"lg\"}\n className={\"w-[800px]\"}\n trigger={<Button size={size} variant={variant} text={label} icon={<AddIcon />} />}\n title={\"Insert a template\"}\n info={<></>}\n >\n <TemplateGallery templates={templates} onSelect={onSelect} />\n </Dialog>\n </div>\n );\n};\n\ninterface TemplateGalleryProps {\n templates: ITemplateVM[];\n onSelect: (template: ITemplateVM) => void;\n}\n\nconst TemplateGallery = ({ templates, onSelect }: TemplateGalleryProps) => {\n return (\n <div className={\"gap-md flex flex-wrap p-xs\"}>\n {templates.map(template => (\n <TemplateCard key={template.id} template={template} onSelect={onSelect} />\n ))}\n </div>\n );\n};\n\ninterface TemplateCardProps {\n template: ITemplateVM;\n onSelect: (template: ITemplateVM) => void;\n}\n\nconst TemplateCard = ({ template, onSelect }: TemplateCardProps) => {\n const [isHovered, setIsHovered] = useState(false);\n const icon = normalizeIcon(template.icon);\n\n return (\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={\n \"flex flex-col justify-between bg-neutral-base overflow-hidden rounded-lg w-[173px] relative shadow-sm\"\n }\n >\n <div>\n <div className={\"flex items-center justify-center py-xxl w-full bg-neutral-dimmed\"}>\n {icon ? (\n <FontAwesomeIcon\n className={\"text-neutral-xstrong\"}\n icon={icon}\n style={{ width: 40, height: 40 }}\n />\n ) : null}\n </div>\n <div className={\"py-sm-extra px-md\"}>\n <Text size={\"md\"} className={\"mb-xs text-neutral-primary font-semibold\"}>\n {template.label}\n </Text>\n </div>\n </div>\n\n {isHovered && (\n <Dialog.Close asChild>\n <div\n className={\n \"absolute inset-0 flex items-center justify-center bg-white/80 cursor-pointer\"\n }\n onClick={() => onSelect(template)}\n >\n <Button size={\"lg\"} variant={\"primary\"} icon={<PlusIcon />}>\n Insert\n </Button>\n </div>\n </Dialog.Close>\n )}\n </div>\n );\n};\n"],"names":["normalizeIcon","icon","AddTemplateButton","templates","onSelect","label","size","variant","Dialog","Button","AddIcon","TemplateGallery","template","TemplateCard","isHovered","setIsHovered","useState","FontAwesomeIcon","Text","PlusIcon"],"mappings":";;;;;AAQA,MAAMA,gBAAgB,CAACC;IACnB,IAAI,CAACA,MACD;IAEJ,OAAOA,KAAK,IAAI,CAAC,KAAK,CAAC;AAC3B;AAUO,MAAMC,oBAAoB,CAAC,EAC9BC,SAAS,EACTC,QAAQ,EACRC,QAAQ,gBAAgB,EACxBC,OAAO,IAAI,EACXC,UAAU,UAAU,EACC,GACd,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,QAAMA;QACH,MAAM;QACN,WAAW;QACX,uBAAS,oBAACC,QAAMA;YAAC,MAAMH;YAAM,SAASC;YAAS,MAAMF;YAAO,oBAAM,oBAACK,gBAAOA;;QAC1E,OAAO;QACP,oBAAM;qBAEN,oBAACC,iBAAeA;QAAC,WAAWR;QAAW,UAAUC;;AAWjE,MAAMO,kBAAkB,CAAC,EAAER,SAAS,EAAEC,QAAQ,EAAwB,GAC3D,WAAP,GACI,oBAAC;QAAI,WAAW;OACXD,UAAU,GAAG,CAACS,CAAAA,WAAAA,WAAAA,GACX,oBAACC,cAAYA;YAAC,KAAKD,SAAS,EAAE;YAAE,UAAUA;YAAU,UAAUR;;AAW9E,MAAMS,eAAe,CAAC,EAAED,QAAQ,EAAER,QAAQ,EAAqB;IAC3D,MAAM,CAACU,WAAWC,aAAa,GAAGC,SAAS;IAC3C,MAAMf,OAAOD,cAAcY,SAAS,IAAI;IAExC,OAAO,WAAP,GACI,oBAAC;QACG,cAAc,IAAMG,aAAa;QACjC,cAAc,IAAMA,aAAa;QACjC,WACI;qBAGJ,oBAAC,2BACG,oBAAC;QAAI,WAAW;OACXd,OAAO,WAAPA,GACG,oBAACgB,iBAAeA;QACZ,WAAW;QACX,MAAMhB;QACN,OAAO;YAAE,OAAO;YAAI,QAAQ;QAAG;SAEnC,qBAER,oBAAC;QAAI,WAAW;qBACZ,oBAACiB,MAAIA;QAAC,MAAM;QAAM,WAAW;OACxBN,SAAS,KAAK,KAK1BE,aAAa,WAAbA,GACG,oBAACN,OAAO,KAAK;QAAC;qBACV,oBAAC;QACG,WACI;QAEJ,SAAS,IAAMJ,SAASQ;qBAExB,oBAACH,QAAMA;QAAC,MAAM;QAAM,SAAS;QAAW,oBAAM,oBAACU,uCAAQA;OAAK;AAQpF"}
1
+ {"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Button, Dialog, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusIcon } from \"@webiny/icons/add_circle_outline.svg\";\nimport type { ITemplateIcon, ITemplateVM } from \"~/features/formModel/index.js\";\n\nconst normalizeIcon = (icon: ITemplateIcon | undefined): IconProp | undefined => {\n if (!icon) {\n return undefined;\n }\n return icon.name.split(\"/\") as IconProp;\n};\n\nexport interface AddTemplateButtonProps {\n templates: ITemplateVM[];\n onSelect: (template: ITemplateVM) => void;\n label?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n}\n\nexport const AddTemplateButton = ({\n templates,\n onSelect,\n label = \"Add a template\",\n size = \"sm\",\n variant = \"tertiary\"\n}: AddTemplateButtonProps) => {\n return (\n <div className={\"flex justify-between items-center\"}>\n <Dialog\n size={\"lg\"}\n className={\"w-[800px]\"}\n trigger={<Button size={size} variant={variant} text={label} icon={<AddIcon />} />}\n title={\"Insert a template\"}\n info={<></>}\n >\n <TemplateGallery templates={templates} onSelect={onSelect} />\n </Dialog>\n </div>\n );\n};\n\ninterface TemplateGalleryProps {\n templates: ITemplateVM[];\n onSelect: (template: ITemplateVM) => void;\n}\n\nconst TemplateGallery = ({ templates, onSelect }: TemplateGalleryProps) => {\n return (\n <div className={\"gap-md flex flex-wrap p-xs\"}>\n {templates.map(template => (\n <TemplateCard key={template.id} template={template} onSelect={onSelect} />\n ))}\n </div>\n );\n};\n\ninterface TemplateCardProps {\n template: ITemplateVM;\n onSelect: (template: ITemplateVM) => void;\n}\n\nconst TemplateCard = ({ template, onSelect }: TemplateCardProps) => {\n const [isHovered, setIsHovered] = useState(false);\n const icon = normalizeIcon(template.icon);\n\n return (\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={\n \"flex flex-col justify-between bg-neutral-base overflow-hidden rounded-lg w-[173px] relative shadow-sm\"\n }\n >\n <div>\n <div className={\"flex items-center justify-center py-xxl w-full bg-neutral-dimmed\"}>\n {icon ? (\n <FontAwesomeIcon\n className={\"text-neutral-xstrong\"}\n icon={icon}\n style={{ width: 40, height: 40 }}\n />\n ) : null}\n </div>\n <div className={\"py-sm-extra px-md\"}>\n <Text size={\"md\"} className={\"mb-xs text-neutral-primary font-semibold\"}>\n {template.label}\n </Text>\n </div>\n </div>\n\n {isHovered && (\n <Dialog.Close asChild>\n <div\n className={\n \"absolute inset-0 flex items-center justify-center bg-white/80 cursor-pointer\"\n }\n onClick={() => onSelect(template)}\n >\n <Button size={\"lg\"} variant={\"primary\"} icon={<PlusIcon />}>\n Insert\n </Button>\n </div>\n </Dialog.Close>\n )}\n </div>\n );\n};\n"],"names":["normalizeIcon","icon","AddTemplateButton","templates","onSelect","label","size","variant","Dialog","Button","AddIcon","TemplateGallery","template","TemplateCard","isHovered","setIsHovered","useState","FontAwesomeIcon","Text","PlusIcon"],"mappings":";;;;;AAQA,MAAMA,gBAAgB,CAACC;IACnB,IAAI,CAACA,MACD;IAEJ,OAAOA,KAAK,IAAI,CAAC,KAAK,CAAC;AAC3B;AAUO,MAAMC,oBAAoB,CAAC,EAC9BC,SAAS,EACTC,QAAQ,EACRC,QAAQ,gBAAgB,EACxBC,OAAO,IAAI,EACXC,UAAU,UAAU,EACC,GACd,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,QAAMA;QACH,MAAM;QACN,WAAW;QACX,uBAAS,oBAACC,QAAMA;YAAC,MAAMH;YAAM,SAASC;YAAS,MAAMF;YAAO,oBAAM,oBAACK,gBAAOA;;QAC1E,OAAO;QACP,oBAAM;qBAEN,oBAACC,iBAAAA;QAAgB,WAAWR;QAAW,UAAUC;;AAWjE,MAAMO,kBAAkB,CAAC,EAAER,SAAS,EAAEC,QAAQ,EAAwB,GAC3D,WAAP,GACI,oBAAC;QAAI,WAAW;OACXD,UAAU,GAAG,CAACS,CAAAA,WAAAA,WAAAA,GACX,oBAACC,cAAAA;YAAa,KAAKD,SAAS,EAAE;YAAE,UAAUA;YAAU,UAAUR;;AAW9E,MAAMS,eAAe,CAAC,EAAED,QAAQ,EAAER,QAAQ,EAAqB;IAC3D,MAAM,CAACU,WAAWC,aAAa,GAAGC,SAAS;IAC3C,MAAMf,OAAOD,cAAcY,SAAS,IAAI;IAExC,OAAO,WAAP,GACI,oBAAC;QACG,cAAc,IAAMG,aAAa;QACjC,cAAc,IAAMA,aAAa;QACjC,WACI;qBAGJ,oBAAC,2BACG,oBAAC;QAAI,WAAW;OACXd,OAAO,WAAPA,GACG,oBAACgB,iBAAeA;QACZ,WAAW;QACX,MAAMhB;QACN,OAAO;YAAE,OAAO;YAAI,QAAQ;QAAG;SAEnC,qBAER,oBAAC;QAAI,WAAW;qBACZ,oBAACiB,MAAIA;QAAC,MAAM;QAAM,WAAW;OACxBN,SAAS,KAAK,KAK1BE,aAAa,WAAbA,GACG,oBAACN,OAAO,KAAK;QAAC;qBACV,oBAAC;QACG,WACI;QAEJ,SAAS,IAAMJ,SAASQ;qBAExB,oBAACH,QAAMA;QAAC,MAAM;QAAM,SAAS;QAAW,oBAAM,oBAACU,uCAAQA;OAAK;AAQpF"}
@@ -4,7 +4,7 @@ import { FloatingLinkEditorPlugin } from "@webiny/lexical-editor";
4
4
  import { AdminConfig } from "../../config/AdminConfig.js";
5
5
  import { LexicalTheme } from "../../config/AdminConfig/LexicalTheme.js";
6
6
  import { LexicalLinkForm } from "../../components/index.js";
7
- const { Color: Color, Typography: Typography } = LexicalTheme;
7
+ const { Color, Typography } = LexicalTheme;
8
8
  const LexicalPreset = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Color, {
9
9
  id: "color1",
10
10
  label: "Primary color",
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/LexicalPreset.js","sources":["../../../src/base/Base/LexicalPreset.tsx"],"sourcesContent":["import React from \"react\";\nimport { LexicalEditorConfig } from \"@webiny/lexical-editor/components/LexicalEditorConfig/LexicalEditorConfig.js\";\nimport { FloatingLinkEditorPlugin } from \"@webiny/lexical-editor\";\nimport { AdminConfig } from \"../../config/AdminConfig.js\";\nimport { LexicalTheme } from \"~/config/AdminConfig/LexicalTheme.js\";\nimport { LexicalLinkForm } from \"~/components/index.js\";\n\nconst { Color, Typography } = LexicalTheme;\n\nexport const LexicalPreset = () => {\n return (\n <>\n <AdminConfig>\n {/* Colors */}\n <Color id={\"color1\"} label=\"Primary color\" value={\"var(--wa-theme-color1)\"} />\n <Color id={\"color2\"} label=\"Secondary color\" value={\"var(--wa-theme-color2)\"} />\n <Color id={\"color3\"} label=\"Regular color\" value={\"var(--wa-theme-color3)\"} />\n {/* Typography */}\n <Typography.Heading\n id={\"heading1\"}\n label={\"Heading 1\"}\n tag={\"h1\"}\n className={\"wa-heading-1\"}\n />\n <Typography.Heading\n id={\"heading2\"}\n label={\"Heading 2\"}\n tag={\"h2\"}\n className={\"wa-heading-2\"}\n />\n <Typography.Heading\n id={\"heading3\"}\n label={\"Heading 3\"}\n tag={\"h3\"}\n className={\"wa-heading-3\"}\n />\n\n <Typography.Paragraph\n id={\"paragraph1\"}\n label={\"Paragraph\"}\n tag={\"p\"}\n className={\"wa-paragraph-1\"}\n />\n\n <Typography.Quote\n id={\"quote\"}\n label={\"Quote\"}\n tag={\"blockquote\"}\n className={\"wa-blockquote-1\"}\n />\n <Typography.List\n id={\"list1\"}\n label={\"Unordered list\"}\n tag={\"ul\"}\n className={\"wa-unordered-list-1\"}\n />\n <Typography.List\n id={\"list2\"}\n label={\"Ordered list\"}\n tag={\"ol\"}\n className={\"wa-ordered-list-1\"}\n />\n </AdminConfig>\n <LexicalEditorConfig>\n <LexicalEditorConfig.Plugin\n name={\"floatingLinkEditor\"}\n element={<FloatingLinkEditorPlugin LinkForm={LexicalLinkForm} />}\n />\n </LexicalEditorConfig>\n </>\n );\n};\n"],"names":["Color","Typography","LexicalTheme","LexicalPreset","AdminConfig","LexicalEditorConfig","FloatingLinkEditorPlugin","LexicalLinkForm"],"mappings":";;;;;;AAOA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,YAAAA,UAAU,EAAE,GAAGC;AAEvB,MAAMC,gBAAgB,IAClB,WAAP,GACI,wDACI,oBAACC,aAAWA,MAAAA,WAAAA,GAER,oBAACJ,OAAKA;QAAC,IAAI;QAAU,OAAM;QAAgB,OAAO;sBAClD,oBAACA,OAAKA;QAAC,IAAI;QAAU,OAAM;QAAkB,OAAO;sBACpD,oBAACA,OAAKA;QAAC,IAAI;QAAU,OAAM;QAAgB,OAAO;sBAElD,oBAACC,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAGf,oBAACA,WAAW,SAAS;QACjB,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAGf,oBAACA,WAAW,KAAK;QACb,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,IAAI;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,IAAI;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;uBAGnB,oBAACI,qBAAmBA,MAAAA,WAAAA,GAChB,oBAACA,oBAAoB,MAAM;QACvB,MAAM;QACN,uBAAS,oBAACC,0BAAwBA;YAAC,UAAUC"}
1
+ {"version":3,"file":"base/Base/LexicalPreset.js","sources":["../../../src/base/Base/LexicalPreset.tsx"],"sourcesContent":["import React from \"react\";\nimport { LexicalEditorConfig } from \"@webiny/lexical-editor/components/LexicalEditorConfig/LexicalEditorConfig.js\";\nimport { FloatingLinkEditorPlugin } from \"@webiny/lexical-editor\";\nimport { AdminConfig } from \"../../config/AdminConfig.js\";\nimport { LexicalTheme } from \"~/config/AdminConfig/LexicalTheme.js\";\nimport { LexicalLinkForm } from \"~/components/index.js\";\n\nconst { Color, Typography } = LexicalTheme;\n\nexport const LexicalPreset = () => {\n return (\n <>\n <AdminConfig>\n {/* Colors */}\n <Color id={\"color1\"} label=\"Primary color\" value={\"var(--wa-theme-color1)\"} />\n <Color id={\"color2\"} label=\"Secondary color\" value={\"var(--wa-theme-color2)\"} />\n <Color id={\"color3\"} label=\"Regular color\" value={\"var(--wa-theme-color3)\"} />\n {/* Typography */}\n <Typography.Heading\n id={\"heading1\"}\n label={\"Heading 1\"}\n tag={\"h1\"}\n className={\"wa-heading-1\"}\n />\n <Typography.Heading\n id={\"heading2\"}\n label={\"Heading 2\"}\n tag={\"h2\"}\n className={\"wa-heading-2\"}\n />\n <Typography.Heading\n id={\"heading3\"}\n label={\"Heading 3\"}\n tag={\"h3\"}\n className={\"wa-heading-3\"}\n />\n\n <Typography.Paragraph\n id={\"paragraph1\"}\n label={\"Paragraph\"}\n tag={\"p\"}\n className={\"wa-paragraph-1\"}\n />\n\n <Typography.Quote\n id={\"quote\"}\n label={\"Quote\"}\n tag={\"blockquote\"}\n className={\"wa-blockquote-1\"}\n />\n <Typography.List\n id={\"list1\"}\n label={\"Unordered list\"}\n tag={\"ul\"}\n className={\"wa-unordered-list-1\"}\n />\n <Typography.List\n id={\"list2\"}\n label={\"Ordered list\"}\n tag={\"ol\"}\n className={\"wa-ordered-list-1\"}\n />\n </AdminConfig>\n <LexicalEditorConfig>\n <LexicalEditorConfig.Plugin\n name={\"floatingLinkEditor\"}\n element={<FloatingLinkEditorPlugin LinkForm={LexicalLinkForm} />}\n />\n </LexicalEditorConfig>\n </>\n );\n};\n"],"names":["Color","Typography","LexicalTheme","LexicalPreset","AdminConfig","LexicalEditorConfig","FloatingLinkEditorPlugin","LexicalLinkForm"],"mappings":";;;;;;AAOA,MAAM,EAAEA,KAAK,EAAEC,UAAU,EAAE,GAAGC;AAEvB,MAAMC,gBAAgB,IAClB,WAAP,GACI,wDACI,oBAACC,aAAWA,MAAAA,WAAAA,GAER,oBAACJ,OAAAA;QAAM,IAAI;QAAU,OAAM;QAAgB,OAAO;sBAClD,oBAACA,OAAAA;QAAM,IAAI;QAAU,OAAM;QAAkB,OAAO;sBACpD,oBAACA,OAAAA;QAAM,IAAI;QAAU,OAAM;QAAgB,OAAO;sBAElD,oBAACC,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAGf,oBAACA,WAAW,SAAS;QACjB,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAGf,oBAACA,WAAW,KAAK;QACb,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,IAAI;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,IAAI;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;uBAGnB,oBAACI,qBAAmBA,MAAAA,WAAAA,GAChB,oBAACA,oBAAoB,MAAM;QACvB,MAAM;QACN,uBAAS,oBAACC,0BAAwBA;YAAC,UAAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/Menus.js","sources":["../../../src/base/Base/Menus.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DashboardIcon } from \"@webiny/icons/space_dashboard.svg\";\nimport { ReactComponent as SettingsIcon } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as UpgradeIcon } from \"@webiny/icons/electric_bolt.svg\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\nimport { useWcp } from \"~/presentation/wcp/useWcp.js\";\n\nexport const Menus = React.memo(() => {\n const wcp = useWcp();\n const hasWcpLicense = Boolean(wcp.getProject());\n\n return (\n <AdminConfig>\n <Menu\n name={\"home\"}\n pin={\"start\"}\n element={\n <Menu.Link\n to={\"/\"}\n text={\"Home\"}\n icon={<Menu.Link.Icon label=\"Home\" element={<DashboardIcon />} />}\n />\n }\n />\n <Menu\n name={\"settings\"}\n hideIfEmpty={true}\n pin={\"end\"}\n element={\n <Menu.Item\n text={\"Settings\"}\n icon={<Menu.Link.Icon label=\"Settings\" element={<SettingsIcon />} />}\n />\n }\n />\n\n <Menu\n parent={\"settings\"}\n name=\"settings.system\"\n element={<Menu.Group text=\"System\" collapsible={false} />}\n />\n\n {!hasWcpLicense && (\n <Menu.Footer\n name={\"upgrade\"}\n element={\n <Menu.Link\n text={\"Upgrade\"}\n icon={<Menu.Link.Icon label=\"Upgrade\" element={<UpgradeIcon />} />}\n to={\"https://www.webiny.com/pricing\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n className={\n \"[&_a]:text-accent-primary! [&_svg]:fill-accent-default! font-semibold\"\n }\n />\n }\n />\n )}\n </AdminConfig>\n );\n});\n\nMenus.displayName = \"Menus\";\n"],"names":["Menus","React","wcp","useWcp","hasWcpLicense","Boolean","AdminConfig","Menu","DashboardIcon","SettingsIcon","UpgradeIcon"],"mappings":";;;;;;;AAQO,MAAMA,QAAQ,WAAHA,GAAGC,MAAAA,IAAU,CAAC;IAC5B,MAAMC,MAAMC;IACZ,MAAMC,gBAAgBC,QAAQH,IAAI,UAAU;IAE5C,OAAO,WAAP,GACI,oBAACI,aAAWA,MAAAA,WAAAA,GACR,oBAACC,MAAIA;QACD,MAAM;QACN,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,IAAI;YACJ,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAO,uBAAS,oBAACC,gBAAaA;;;sBAItE,oBAACD,MAAIA;QACD,MAAM;QACN,aAAa;QACb,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAW,uBAAS,oBAACE,6BAAYA;;;sBAKzE,oBAACF,MAAIA;QACD,QAAQ;QACR,MAAK;QACL,uBAAS,oBAACA,KAAK,KAAK;YAAC,MAAK;YAAS,aAAa;;QAGnD,CAACH,iBAAiB,WAAjBA,GACE,oBAACG,KAAK,MAAM;QACR,MAAM;QACN,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAU,uBAAS,oBAACG,kCAAWA;;YAC3D,IAAI;YACJ,KAAK;YACL,QAAQ;YACR,WACI;;;AAQhC;AAEAV,MAAM,WAAW,GAAG"}
1
+ {"version":3,"file":"base/Base/Menus.js","sources":["../../../src/base/Base/Menus.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DashboardIcon } from \"@webiny/icons/space_dashboard.svg\";\nimport { ReactComponent as SettingsIcon } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as UpgradeIcon } from \"@webiny/icons/electric_bolt.svg\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\nimport { useWcp } from \"~/presentation/wcp/useWcp.js\";\n\nexport const Menus = React.memo(() => {\n const wcp = useWcp();\n const hasWcpLicense = Boolean(wcp.getProject());\n\n return (\n <AdminConfig>\n <Menu\n name={\"home\"}\n pin={\"start\"}\n element={\n <Menu.Link\n to={\"/\"}\n text={\"Home\"}\n icon={<Menu.Link.Icon label=\"Home\" element={<DashboardIcon />} />}\n />\n }\n />\n <Menu\n name={\"settings\"}\n hideIfEmpty={true}\n pin={\"end\"}\n element={\n <Menu.Item\n text={\"Settings\"}\n icon={<Menu.Link.Icon label=\"Settings\" element={<SettingsIcon />} />}\n />\n }\n />\n\n <Menu\n parent={\"settings\"}\n name=\"settings.system\"\n element={<Menu.Group text=\"System\" collapsible={false} />}\n />\n\n {!hasWcpLicense && (\n <Menu.Footer\n name={\"upgrade\"}\n element={\n <Menu.Link\n text={\"Upgrade\"}\n icon={<Menu.Link.Icon label=\"Upgrade\" element={<UpgradeIcon />} />}\n to={\"https://www.webiny.com/pricing\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n className={\n \"[&_a]:text-accent-primary! [&_svg]:fill-accent-default! font-semibold\"\n }\n />\n }\n />\n )}\n </AdminConfig>\n );\n});\n\nMenus.displayName = \"Menus\";\n"],"names":["Menus","React","wcp","useWcp","hasWcpLicense","Boolean","AdminConfig","Menu","DashboardIcon","SettingsIcon","UpgradeIcon"],"mappings":";;;;;;;AAQO,MAAMA,QAAQ,WAARA,GAAQC,MAAAA,IAAU,CAAC;IAC5B,MAAMC,MAAMC;IACZ,MAAMC,gBAAgBC,QAAQH,IAAI,UAAU;IAE5C,OAAO,WAAP,GACI,oBAACI,aAAWA,MAAAA,WAAAA,GACR,oBAACC,MAAIA;QACD,MAAM;QACN,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,IAAI;YACJ,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAO,uBAAS,oBAACC,gBAAaA;;;sBAItE,oBAACD,MAAIA;QACD,MAAM;QACN,aAAa;QACb,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAW,uBAAS,oBAACE,6BAAYA;;;sBAKzE,oBAACF,MAAIA;QACD,QAAQ;QACR,MAAK;QACL,uBAAS,oBAACA,KAAK,KAAK;YAAC,MAAK;YAAS,aAAa;;QAGnD,CAACH,iBAAiB,WAAjBA,GACE,oBAACG,KAAK,MAAM;QACR,MAAM;QACN,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAU,uBAAS,oBAACG,kCAAWA;;YAC3D,IAAI;YACJ,KAAK;YACL,QAAQ;YACR,WACI;;;AAQhC;AAEAV,MAAM,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/RoutesConfig.js","sources":["../../../src/base/Base/RoutesConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dashboard } from \"~/base/ui/Dashboard.js\";\nimport { AdminLayout } from \"~/components/AdminLayout.js\";\nimport { NotFound } from \"~/base/ui/NotFound.js\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Routes } from \"~/routes.js\";\nimport { Route } from \"~/config/AdminConfig/Route.js\";\nimport { FormModelDemo } from \"~/features/formModel/demo/FormModelDemo.js\";\n\nexport const RoutesConfig = React.memo(() => {\n return (\n <AdminConfig>\n <Route\n route={Routes.Dashboard}\n element={\n <AdminLayout title={\"Welcome!\"}>\n <Dashboard />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.FormModelDemo}\n element={\n <AdminLayout title={\"FormModel Demo\"}>\n <FormModelDemo />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.CatchAll}\n element={\n <AdminLayout title={\"Not Accessible\"}>\n <NotFound />\n </AdminLayout>\n }\n />\n </AdminConfig>\n );\n});\n\nRoutesConfig.displayName = \"Routes\";\n"],"names":["RoutesConfig","React","AdminConfig","Route","Routes","AdminLayout","Dashboard","FormModelDemo","NotFound"],"mappings":";;;;;;;;AASO,MAAMA,eAAe,WAAHA,GAAGC,MAAAA,IAAU,CAAC,IAC5B,WAAP,GACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,OAAKA;QACF,OAAOC,OAAO,SAAS;QACvB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACC,WAASA;sBAKtB,oBAACH,OAAKA;QACF,OAAOC,OAAO,aAAa;QAC3B,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACE,eAAaA;sBAK1B,oBAACJ,OAAKA;QACF,OAAOC,OAAO,QAAQ;QACtB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACG,UAAQA;;AAQjCR,aAAa,WAAW,GAAG"}
1
+ {"version":3,"file":"base/Base/RoutesConfig.js","sources":["../../../src/base/Base/RoutesConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dashboard } from \"~/base/ui/Dashboard.js\";\nimport { AdminLayout } from \"~/components/AdminLayout.js\";\nimport { NotFound } from \"~/base/ui/NotFound.js\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Routes } from \"~/routes.js\";\nimport { Route } from \"~/config/AdminConfig/Route.js\";\nimport { FormModelDemo } from \"~/features/formModel/demo/FormModelDemo.js\";\n\nexport const RoutesConfig = React.memo(() => {\n return (\n <AdminConfig>\n <Route\n route={Routes.Dashboard}\n element={\n <AdminLayout title={\"Welcome!\"}>\n <Dashboard />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.FormModelDemo}\n element={\n <AdminLayout title={\"FormModel Demo\"}>\n <FormModelDemo />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.CatchAll}\n element={\n <AdminLayout title={\"Not Accessible\"}>\n <NotFound />\n </AdminLayout>\n }\n />\n </AdminConfig>\n );\n});\n\nRoutesConfig.displayName = \"Routes\";\n"],"names":["RoutesConfig","React","AdminConfig","Route","Routes","AdminLayout","Dashboard","FormModelDemo","NotFound"],"mappings":";;;;;;;;AASO,MAAMA,eAAe,WAAfA,GAAeC,MAAAA,IAAU,CAAC,IAC5B,WAAP,GACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,OAAKA;QACF,OAAOC,OAAO,SAAS;QACvB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACC,WAASA;sBAKtB,oBAACH,OAAKA;QACF,OAAOC,OAAO,aAAa;QAC3B,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACE,eAAaA;sBAK1B,oBAACJ,OAAKA;QACF,OAAOC,OAAO,QAAQ;QACtB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACG,UAAQA;;AAQjCR,aAAa,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/Tenant.js","sources":["../../../src/base/Base/Tenant.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { ReactComponent as SquareLogo } from \"./Tenant/wby-square.svg\";\nimport { ReactComponent as HorizontalLogo } from \"./Tenant/wby-horizontal.svg\";\n\nexport const Tenant = React.memo(() => {\n const { Title, Logo } = AdminConfig;\n return (\n <AdminConfig.Public>\n <Title value={\"Webiny\"} />\n <Logo\n squareLogo={<SquareLogo alt={\"Webiny\"} width={32} />}\n horizontalLogo={<HorizontalLogo width={175} />}\n />\n </AdminConfig.Public>\n );\n});\n\nTenant.displayName = \"Tenant\";\n"],"names":["Tenant","React","Title","Logo","AdminConfig","SquareLogo","HorizontalLogo"],"mappings":";;;;AAKO,MAAMA,SAAS,WAAHA,GAAGC,MAAAA,IAAU,CAAC;IAC7B,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGC;IACxB,OAAO,WAAP,GACI,oBAACA,YAAY,MAAM,sBACf,oBAACF,OAAAA;QAAM,OAAO;sBACd,oBAACC,MAAAA;QACG,0BAAY,oBAACE,gBAAUA;YAAC,KAAK;YAAU,OAAO;;QAC9C,8BAAgB,oBAACC,kCAAcA;YAAC,OAAO;;;AAIvD;AAEAN,OAAO,WAAW,GAAG"}
1
+ {"version":3,"file":"base/Base/Tenant.js","sources":["../../../src/base/Base/Tenant.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { ReactComponent as SquareLogo } from \"./Tenant/wby-square.svg\";\nimport { ReactComponent as HorizontalLogo } from \"./Tenant/wby-horizontal.svg\";\n\nexport const Tenant = React.memo(() => {\n const { Title, Logo } = AdminConfig;\n return (\n <AdminConfig.Public>\n <Title value={\"Webiny\"} />\n <Logo\n squareLogo={<SquareLogo alt={\"Webiny\"} width={32} />}\n horizontalLogo={<HorizontalLogo width={175} />}\n />\n </AdminConfig.Public>\n );\n});\n\nTenant.displayName = \"Tenant\";\n"],"names":["Tenant","React","Title","Logo","AdminConfig","SquareLogo","HorizontalLogo"],"mappings":";;;;AAKO,MAAMA,SAAS,WAATA,GAASC,MAAAA,IAAU,CAAC;IAC7B,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGC;IACxB,OAAO,WAAP,GACI,oBAACA,YAAY,MAAM,sBACf,oBAACF,OAAAA;QAAM,OAAO;sBACd,oBAACC,MAAAA;QACG,0BAAY,oBAACE,gBAAUA;YAAC,KAAK;YAAU,OAAO;;QAC9C,8BAAgB,oBAACC,kCAAcA;YAAC,OAAO;;;AAIvD;AAEAN,OAAO,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base/UserMenu.js","sources":["../../../src/base/Base/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { SignOut } from \"./UserMenu/SignOut.js\";\nimport { UserInfo } from \"./UserMenu/UserInfo.js\";\nimport { ExitTenant } from \"./UserMenu/ExitTenant.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\n\nexport const UserMenu = React.memo(() => {\n return (\n <AdminConfig>\n <Menu.User name={\"userInfo\"} element={<UserInfo />} />\n <Menu.User name={\"exitTenant\"} element={<ExitTenant />} />\n <Menu.User name={\"signOut\"} element={<SignOut />} />\n </AdminConfig>\n );\n});\n\nUserMenu.displayName = \"UserMenu\";\n"],"names":["UserMenu","React","AdminConfig","Menu","UserInfo","ExitTenant","SignOut"],"mappings":";;;;;;AAOO,MAAMA,WAAW,WAAHA,GAAGC,MAAAA,IAAU,CAAC,IACxB,WAAP,GACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,KAAK,IAAI;QAAC,MAAM;QAAY,uBAAS,oBAACC,UAAQA;sBAC/C,oBAACD,KAAK,IAAI;QAAC,MAAM;QAAc,uBAAS,oBAACE,YAAUA;sBACnD,oBAACF,KAAK,IAAI;QAAC,MAAM;QAAW,uBAAS,oBAACG,SAAOA;;AAKzDN,SAAS,WAAW,GAAG"}
1
+ {"version":3,"file":"base/Base/UserMenu.js","sources":["../../../src/base/Base/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { SignOut } from \"./UserMenu/SignOut.js\";\nimport { UserInfo } from \"./UserMenu/UserInfo.js\";\nimport { ExitTenant } from \"./UserMenu/ExitTenant.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\n\nexport const UserMenu = React.memo(() => {\n return (\n <AdminConfig>\n <Menu.User name={\"userInfo\"} element={<UserInfo />} />\n <Menu.User name={\"exitTenant\"} element={<ExitTenant />} />\n <Menu.User name={\"signOut\"} element={<SignOut />} />\n </AdminConfig>\n );\n});\n\nUserMenu.displayName = \"UserMenu\";\n"],"names":["UserMenu","React","AdminConfig","Menu","UserInfo","ExitTenant","SignOut"],"mappings":";;;;;;AAOO,MAAMA,WAAW,WAAXA,GAAWC,MAAAA,IAAU,CAAC,IACxB,WAAP,GACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,KAAK,IAAI;QAAC,MAAM;QAAY,uBAAS,oBAACC,UAAQA;sBAC/C,oBAACD,KAAK,IAAI;QAAC,MAAM;QAAc,uBAAS,oBAACE,YAAUA;sBACnD,oBAACF,KAAK,IAAI;QAAC,MAAM;QAAW,uBAAS,oBAACG,SAAOA;;AAKzDN,SAAS,WAAW,GAAG"}
package/base/Base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base/Base.js","sources":["../../src/base/Base.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { Menus } from \"./Base/Menus.js\";\nimport { RoutesConfig } from \"./Base/RoutesConfig.js\";\nimport { Tenant } from \"./Base/Tenant.js\";\nimport { UserMenu } from \"./Base/UserMenu.js\";\nimport { LexicalPreset } from \"./Base/LexicalPreset.js\";\nimport { DefaultFieldRenderers } from \"./Base/DefaultFieldRenderers.js\";\nimport { DefaultLayoutRenderers } from \"./Base/DefaultLayoutRenderers.js\";\nimport { DefaultLexicalEditorConfig } from \"~/components/LexicalEditor/DefaultLexicalEditorConfig.js\";\n\nconst BaseExtension = () => {\n return (\n <>\n <Tenant />\n <Menus />\n <UserMenu />\n <RoutesConfig />\n <LexicalPreset />\n <DefaultFieldRenderers />\n <DefaultLayoutRenderers />\n <DefaultLexicalEditorConfig />\n </>\n );\n};\n\nexport const Base = memo(BaseExtension);\n"],"names":["BaseExtension","Tenant","Menus","UserMenu","RoutesConfig","LexicalPreset","DefaultFieldRenderers","DefaultLayoutRenderers","DefaultLexicalEditorConfig","Base","memo"],"mappings":";;;;;;;;;AAUA,MAAMA,gBAAgB,IACX,WAAP,GACI,wDACI,oBAACC,QAAMA,OAAAA,WAAAA,GACP,oBAACC,OAAKA,OAAAA,WAAAA,GACN,oBAACC,UAAQA,OAAAA,WAAAA,GACT,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,wBAAsBA,OAAAA,WAAAA,GACvB,oBAACC,4BAA0BA;AAKhC,MAAMC,OAAO,WAAHA,GAAGC,KAAKV"}
1
+ {"version":3,"file":"base/Base.js","sources":["../../src/base/Base.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { Menus } from \"./Base/Menus.js\";\nimport { RoutesConfig } from \"./Base/RoutesConfig.js\";\nimport { Tenant } from \"./Base/Tenant.js\";\nimport { UserMenu } from \"./Base/UserMenu.js\";\nimport { LexicalPreset } from \"./Base/LexicalPreset.js\";\nimport { DefaultFieldRenderers } from \"./Base/DefaultFieldRenderers.js\";\nimport { DefaultLayoutRenderers } from \"./Base/DefaultLayoutRenderers.js\";\nimport { DefaultLexicalEditorConfig } from \"~/components/LexicalEditor/DefaultLexicalEditorConfig.js\";\n\nconst BaseExtension = () => {\n return (\n <>\n <Tenant />\n <Menus />\n <UserMenu />\n <RoutesConfig />\n <LexicalPreset />\n <DefaultFieldRenderers />\n <DefaultLayoutRenderers />\n <DefaultLexicalEditorConfig />\n </>\n );\n};\n\nexport const Base = memo(BaseExtension);\n"],"names":["BaseExtension","Tenant","Menus","UserMenu","RoutesConfig","LexicalPreset","DefaultFieldRenderers","DefaultLayoutRenderers","DefaultLexicalEditorConfig","Base","memo"],"mappings":";;;;;;;;;AAUA,MAAMA,gBAAgB,IACX,WAAP,GACI,wDACI,oBAACC,QAAMA,OAAAA,WAAAA,GACP,oBAACC,OAAKA,OAAAA,WAAAA,GACN,oBAACC,UAAQA,OAAAA,WAAAA,GACT,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,wBAAsBA,OAAAA,WAAAA,GACvB,oBAACC,4BAA0BA;AAKhC,MAAMC,OAAO,WAAPA,GAAOC,KAAKV"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/Brand.js","sources":["../../../src/base/ui/Brand.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Brand = makeDecoratable(\"Brand\", () => {\n return <BrandRenderer />;\n});\n\nexport const BrandRenderer = makeDecoratable(\"BrandRenderer\", createVoidComponent());\n"],"names":["Brand","makeDecoratable","BrandRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,QAAQC,gBAAgB,SAAS,IACnC,WAAP,GAAO,oBAACC,eAAaA;AAGlB,MAAMA,gBAAgBD,gBAAgB,iBAAiBE"}
1
+ {"version":3,"file":"base/ui/Brand.js","sources":["../../../src/base/ui/Brand.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Brand = makeDecoratable(\"Brand\", () => {\n return <BrandRenderer />;\n});\n\nexport const BrandRenderer = makeDecoratable(\"BrandRenderer\", createVoidComponent());\n"],"names":["Brand","makeDecoratable","BrandRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,QAAQC,gBAAgB,SAAS,IACnC,WAAP,GAAO,oBAACC,eAAAA;AAGL,MAAMA,gBAAgBD,gBAAgB,iBAAiBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/Dashboard.js","sources":["../../../src/base/ui/Dashboard.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Dashboard = makeDecoratable(\"Dashboard\", () => {\n return <DashboardRenderer />;\n});\n\nexport const DashboardRenderer = makeDecoratable(\"DashboardRenderer\", createVoidComponent());\n"],"names":["Dashboard","makeDecoratable","DashboardRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB,aAAa,IAC3C,WAAP,GAAO,oBAACC,mBAAiBA;AAGtB,MAAMA,oBAAoBD,gBAAgB,qBAAqBE"}
1
+ {"version":3,"file":"base/ui/Dashboard.js","sources":["../../../src/base/ui/Dashboard.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Dashboard = makeDecoratable(\"Dashboard\", () => {\n return <DashboardRenderer />;\n});\n\nexport const DashboardRenderer = makeDecoratable(\"DashboardRenderer\", createVoidComponent());\n"],"names":["Dashboard","makeDecoratable","DashboardRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB,aAAa,IAC3C,WAAP,GAAO,oBAACC,mBAAAA;AAGL,MAAMA,oBAAoBD,gBAAgB,qBAAqBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/FileManager.js","sources":["../../../src/base/ui/FileManager.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { Portal } from \"@webiny/admin-ui\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/react-composition\";\n\nexport interface FileManagerOnChange<T> {\n (value: T): void;\n}\n\n/**\n * Represents a file object managed by the File Manager.\n */\nexport interface FileManagerFileItem {\n // Required - every DAM must provide these\n id: string;\n src: string;\n name: string;\n type: string; // MIME type\n size: number; // bytes\n // Required for images (apps depend on these for Next.js Image, etc.)\n width?: number;\n height?: number;\n // DAM-specific metadata\n [key: string]: any;\n}\n\nexport type FileManagerRenderPropParams<TValue> = {\n showFileManager: (onChange?: FileManagerOnChange<TValue>) => void;\n};\n\ninterface SingleFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;\n}\n\ninterface MultiFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;\n}\n\nexport type MultipleProps =\n | {\n multiple?: never;\n multipleMaxCount?: never;\n multipleMaxSize?: never;\n onChange?: FileManagerOnChange<FileManagerFileItem>;\n render?: SingleFileRenderProp;\n }\n | {\n multiple: true;\n multipleMaxCount?: number;\n multipleMaxSize?: number | string;\n onChange?: FileManagerOnChange<FileManagerFileItem[]>;\n render?: MultiFileRenderProp;\n };\n\nexport type FileManagerProps = {\n accept?: string[];\n images?: boolean;\n maxSize?: number | string;\n onClose?: () => void;\n onUploadCompletion?: (files: FileManagerFileItem[]) => void;\n own?: boolean;\n scope?: string;\n tags?: string[];\n show?: boolean;\n overlay?: boolean;\n} & MultipleProps;\n\n// This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\n\nexport type FileManagerRendererProps = DistributiveOmit<FileManagerProps, \"render\">;\n\nconst FileManagerRenderer = makeDecoratable(\n \"FileManagerRenderer\",\n createVoidComponent<FileManagerRendererProps>()\n);\n\ntype ShowFileManagerProps =\n | FileManagerOnChange<FileManagerFileItem>\n | FileManagerOnChange<FileManagerFileItem[]>\n | undefined;\n\nconst BaseFileManager = ({ render, onChange, ...rest }: FileManagerProps) => {\n const [isFileManagerVisible, setFileManagerVisible] = useState(rest.show);\n const onChangeRef = useRef(onChange);\n\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n const handleShowFileManager = useCallback((newOnChange: ShowFileManagerProps) => {\n if (typeof newOnChange === \"function\") {\n onChangeRef.current = newOnChange;\n }\n setFileManagerVisible(true);\n }, []);\n\n const handleCloseFileManager = useCallback(() => {\n setFileManagerVisible(false);\n }, []);\n\n const renderFileManager = () => {\n if (!isFileManagerVisible) {\n return null;\n }\n\n // Render as overlay\n if (rest.overlay) {\n return (\n <Portal>\n {/*@ts-expect-error*/}\n <FileManagerRenderer\n onClose={handleCloseFileManager}\n onChange={onChangeRef.current}\n {...rest}\n />\n </Portal>\n );\n }\n\n // Render inline\n return (\n // @ts-expect-error\n <FileManagerRenderer\n onClose={handleCloseFileManager}\n onChange={onChangeRef.current}\n {...rest}\n />\n );\n };\n\n const renderContent = () => {\n const renderProps = { showFileManager: handleShowFileManager };\n\n if (render) {\n return render(renderProps);\n }\n\n return null;\n };\n\n return (\n <>\n {renderFileManager()}\n {renderContent()}\n </>\n );\n};\n\nexport const FileManager = Object.assign(BaseFileManager, { Renderer: FileManagerRenderer });\n"],"names":["FileManagerRenderer","makeDecoratable","createVoidComponent","BaseFileManager","render","onChange","rest","isFileManagerVisible","setFileManagerVisible","useState","onChangeRef","useRef","useEffect","handleShowFileManager","useCallback","newOnChange","handleCloseFileManager","renderFileManager","Portal","renderContent","renderProps","FileManager","Object"],"mappings":";;;AAuEA,MAAMA,sBAAsBC,gBACxB,uBACAC;AAQJ,MAAMC,kBAAkB,CAAC,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGC,MAAwB;IACpE,MAAM,CAACC,sBAAsBC,sBAAsB,GAAGC,SAASH,KAAK,IAAI;IACxE,MAAMI,cAAcC,OAAON;IAE3BO,UAAU;QACNF,YAAY,OAAO,GAAGL;IAC1B,GAAG;QAACA;KAAS;IAEb,MAAMQ,wBAAwBC,YAAY,CAACC;QACvC,IAAI,AAAuB,cAAvB,OAAOA,aACPL,YAAY,OAAO,GAAGK;QAE1BP,sBAAsB;IAC1B,GAAG,EAAE;IAEL,MAAMQ,yBAAyBF,YAAY;QACvCN,sBAAsB;IAC1B,GAAG,EAAE;IAEL,MAAMS,oBAAoB;QACtB,IAAI,CAACV,sBACD,OAAO;QAIX,IAAID,KAAK,OAAO,EACZ,OAAO,WAAP,GACI,oBAACY,QAAMA,MAAAA,WAAAA,GAEH,oBAAClB,qBAAmBA;YAChB,SAASgB;YACT,UAAUN,YAAY,OAAO;YAC5B,GAAGJ,IAAI;;QAOxB,O,cAEI,oBAACN,qBAAmBA;YAChB,SAASgB;YACT,UAAUN,YAAY,OAAO;YAC5B,GAAGJ,IAAI;;IAGpB;IAEA,MAAMa,gBAAgB;QAClB,MAAMC,cAAc;YAAE,iBAAiBP;QAAsB;QAE7D,IAAIT,QACA,OAAOA,OAAOgB;QAGlB,OAAO;IACX;IAEA,OAAO,WAAP,GACI,0CACKH,qBACAE;AAGb;AAEO,MAAME,cAAcC,OAAO,MAAM,CAACnB,iBAAiB;IAAE,UAAUH;AAAoB"}
1
+ {"version":3,"file":"base/ui/FileManager.js","sources":["../../../src/base/ui/FileManager.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { Portal } from \"@webiny/admin-ui\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/react-composition\";\n\nexport interface FileManagerOnChange<T> {\n (value: T): void;\n}\n\n/**\n * Represents a file object managed by the File Manager.\n */\nexport interface FileManagerFileItem {\n // Required - every DAM must provide these\n id: string;\n src: string;\n name: string;\n type: string; // MIME type\n size: number; // bytes\n // Required for images (apps depend on these for Next.js Image, etc.)\n width?: number;\n height?: number;\n // DAM-specific metadata\n [key: string]: any;\n}\n\nexport type FileManagerRenderPropParams<TValue> = {\n showFileManager: (onChange?: FileManagerOnChange<TValue>) => void;\n};\n\ninterface SingleFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;\n}\n\ninterface MultiFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;\n}\n\nexport type MultipleProps =\n | {\n multiple?: never;\n multipleMaxCount?: never;\n multipleMaxSize?: never;\n onChange?: FileManagerOnChange<FileManagerFileItem>;\n render?: SingleFileRenderProp;\n }\n | {\n multiple: true;\n multipleMaxCount?: number;\n multipleMaxSize?: number | string;\n onChange?: FileManagerOnChange<FileManagerFileItem[]>;\n render?: MultiFileRenderProp;\n };\n\nexport type FileManagerProps = {\n accept?: string[];\n images?: boolean;\n maxSize?: number | string;\n onClose?: () => void;\n onUploadCompletion?: (files: FileManagerFileItem[]) => void;\n own?: boolean;\n scope?: string;\n tags?: string[];\n show?: boolean;\n overlay?: boolean;\n} & MultipleProps;\n\n// This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\n\nexport type FileManagerRendererProps = DistributiveOmit<FileManagerProps, \"render\">;\n\nconst FileManagerRenderer = makeDecoratable(\n \"FileManagerRenderer\",\n createVoidComponent<FileManagerRendererProps>()\n);\n\ntype ShowFileManagerProps =\n | FileManagerOnChange<FileManagerFileItem>\n | FileManagerOnChange<FileManagerFileItem[]>\n | undefined;\n\nconst BaseFileManager = ({ render, onChange, ...rest }: FileManagerProps) => {\n const [isFileManagerVisible, setFileManagerVisible] = useState(rest.show);\n const onChangeRef = useRef(onChange);\n\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n const handleShowFileManager = useCallback((newOnChange: ShowFileManagerProps) => {\n if (typeof newOnChange === \"function\") {\n onChangeRef.current = newOnChange;\n }\n setFileManagerVisible(true);\n }, []);\n\n const handleCloseFileManager = useCallback(() => {\n setFileManagerVisible(false);\n }, []);\n\n const renderFileManager = () => {\n if (!isFileManagerVisible) {\n return null;\n }\n\n // Render as overlay\n if (rest.overlay) {\n return (\n <Portal>\n {/*@ts-expect-error*/}\n <FileManagerRenderer\n onClose={handleCloseFileManager}\n onChange={onChangeRef.current}\n {...rest}\n />\n </Portal>\n );\n }\n\n // Render inline\n return (\n // @ts-expect-error\n <FileManagerRenderer\n onClose={handleCloseFileManager}\n onChange={onChangeRef.current}\n {...rest}\n />\n );\n };\n\n const renderContent = () => {\n const renderProps = { showFileManager: handleShowFileManager };\n\n if (render) {\n return render(renderProps);\n }\n\n return null;\n };\n\n return (\n <>\n {renderFileManager()}\n {renderContent()}\n </>\n );\n};\n\nexport const FileManager = Object.assign(BaseFileManager, { Renderer: FileManagerRenderer });\n"],"names":["FileManagerRenderer","makeDecoratable","createVoidComponent","BaseFileManager","render","onChange","rest","isFileManagerVisible","setFileManagerVisible","useState","onChangeRef","useRef","useEffect","handleShowFileManager","useCallback","newOnChange","handleCloseFileManager","renderFileManager","Portal","renderContent","renderProps","FileManager","Object"],"mappings":";;;AAuEA,MAAMA,sBAAsBC,gBACxB,uBACAC;AAQJ,MAAMC,kBAAkB,CAAC,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGC,MAAwB;IACpE,MAAM,CAACC,sBAAsBC,sBAAsB,GAAGC,SAASH,KAAK,IAAI;IACxE,MAAMI,cAAcC,OAAON;IAE3BO,UAAU;QACNF,YAAY,OAAO,GAAGL;IAC1B,GAAG;QAACA;KAAS;IAEb,MAAMQ,wBAAwBC,YAAY,CAACC;QACvC,IAAI,AAAuB,cAAvB,OAAOA,aACPL,YAAY,OAAO,GAAGK;QAE1BP,sBAAsB;IAC1B,GAAG,EAAE;IAEL,MAAMQ,yBAAyBF,YAAY;QACvCN,sBAAsB;IAC1B,GAAG,EAAE;IAEL,MAAMS,oBAAoB;QACtB,IAAI,CAACV,sBACD,OAAO;QAIX,IAAID,KAAK,OAAO,EACZ,OAAO,WAAP,GACI,oBAACY,QAAMA,MAAAA,WAAAA,GAEH,oBAAClB,qBAAAA;YACG,SAASgB;YACT,UAAUN,YAAY,OAAO;YAC5B,GAAGJ,IAAI;;QAOxB,O,cAEI,oBAACN,qBAAAA;YACG,SAASgB;YACT,UAAUN,YAAY,OAAO;YAC5B,GAAGJ,IAAI;;IAGpB;IAEA,MAAMa,gBAAgB;QAClB,MAAMC,cAAc;YAAE,iBAAiBP;QAAsB;QAE7D,IAAIT,QACA,OAAOA,OAAOgB;QAGlB,OAAO;IACX;IAEA,OAAO,WAAP,GACI,0CACKH,qBACAE;AAGb;AAEO,MAAME,cAAcC,OAAO,MAAM,CAACnB,iBAAiB;IAAE,UAAUH;AAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/LoginScreen.js","sources":["../../../src/base/ui/LoginScreen.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\nimport { Tags, useTags } from \"./Tags.js\";\n\nexport interface LoginScreenProps {\n children: React.ReactNode;\n}\n\nexport const useIsInLoginScreen = () => {\n const { location } = useTags();\n return location === \"loginScreen\";\n};\n\nexport const LoginScreen = ({ children }: LoginScreenProps) => {\n return (\n <Tags tags={{ location: \"loginScreen\" }}>\n <LoginScreenRenderer>\n <Tags tags={{ location: \"loggedIn\" }}>{children}</Tags>\n </LoginScreenRenderer>\n </Tags>\n );\n};\n\nexport const LoginScreenRenderer = makeDecoratable(\n \"LoginScreenRenderer\",\n createVoidComponent<LoginScreenProps>()\n);\n\nexport const LoginScreenComponent = LoginScreenRenderer;\n"],"names":["useIsInLoginScreen","location","useTags","LoginScreen","children","Tags","LoginScreenRenderer","makeDecoratable","createVoidComponent","LoginScreenComponent"],"mappings":";;;AAQO,MAAMA,qBAAqB;IAC9B,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,OAAOD,AAAa,kBAAbA;AACX;AAEO,MAAME,cAAc,CAAC,EAAEC,QAAQ,EAAoB,GAC/C,WAAP,GACI,oBAACC,MAAIA;QAAC,MAAM;YAAE,UAAU;QAAc;qBAClC,oBAACC,qBAAmBA,MAAAA,WAAAA,GAChB,oBAACD,MAAIA;QAAC,MAAM;YAAE,UAAU;QAAW;OAAID;AAMhD,MAAME,sBAAsBC,gBAC/B,uBACAC;AAGG,MAAMC,uBAAuBH"}
1
+ {"version":3,"file":"base/ui/LoginScreen.js","sources":["../../../src/base/ui/LoginScreen.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\nimport { Tags, useTags } from \"./Tags.js\";\n\nexport interface LoginScreenProps {\n children: React.ReactNode;\n}\n\nexport const useIsInLoginScreen = () => {\n const { location } = useTags();\n return location === \"loginScreen\";\n};\n\nexport const LoginScreen = ({ children }: LoginScreenProps) => {\n return (\n <Tags tags={{ location: \"loginScreen\" }}>\n <LoginScreenRenderer>\n <Tags tags={{ location: \"loggedIn\" }}>{children}</Tags>\n </LoginScreenRenderer>\n </Tags>\n );\n};\n\nexport const LoginScreenRenderer = makeDecoratable(\n \"LoginScreenRenderer\",\n createVoidComponent<LoginScreenProps>()\n);\n\nexport const LoginScreenComponent = LoginScreenRenderer;\n"],"names":["useIsInLoginScreen","location","useTags","LoginScreen","children","Tags","LoginScreenRenderer","makeDecoratable","createVoidComponent","LoginScreenComponent"],"mappings":";;;AAQO,MAAMA,qBAAqB;IAC9B,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,OAAOD,AAAa,kBAAbA;AACX;AAEO,MAAME,cAAc,CAAC,EAAEC,QAAQ,EAAoB,GAC/C,WAAP,GACI,oBAACC,MAAIA;QAAC,MAAM;YAAE,UAAU;QAAc;qBAClC,oBAACC,qBAAAA,MAAAA,WAAAA,GACG,oBAACD,MAAIA;QAAC,MAAM;YAAE,UAAU;QAAW;OAAID;AAMhD,MAAME,sBAAsBC,gBAC/B,uBACAC;AAGG,MAAMC,uBAAuBH"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/Logo.js","sources":["../../../src/base/ui/Logo.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Logo = makeDecoratable(\"Logo\", () => {\n return <LogoRenderer />;\n});\n\nexport const LogoRenderer = makeDecoratable(\"LogoRenderer\", createVoidComponent());\n"],"names":["Logo","makeDecoratable","LogoRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,OAAOC,gBAAgB,QAAQ,IACjC,WAAP,GAAO,oBAACC,cAAYA;AAGjB,MAAMA,eAAeD,gBAAgB,gBAAgBE"}
1
+ {"version":3,"file":"base/ui/Logo.js","sources":["../../../src/base/ui/Logo.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Logo = makeDecoratable(\"Logo\", () => {\n return <LogoRenderer />;\n});\n\nexport const LogoRenderer = makeDecoratable(\"LogoRenderer\", createVoidComponent());\n"],"names":["Logo","makeDecoratable","LogoRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,OAAOC,gBAAgB,QAAQ,IACjC,WAAP,GAAO,oBAACC,cAAAA;AAGL,MAAMA,eAAeD,gBAAgB,gBAAgBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/Navigation.js","sources":["../../../src/base/ui/Navigation.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\nimport { Tags, useTags } from \"~/base/ui/Tags.js\";\n\nexport const useIsInNavigation = () => {\n const { location } = useTags();\n return location === \"navigation\";\n};\n\nexport const Navigation = makeDecoratable(\"Navigation\", () => {\n return (\n <Tags tags={{ location: \"navigation\" }}>\n <NavigationRenderer />\n </Tags>\n );\n});\n\nexport const NavigationRenderer = makeDecoratable(\"NavigationRenderer\", createVoidComponent());\n"],"names":["useIsInNavigation","location","useTags","Navigation","makeDecoratable","Tags","NavigationRenderer","createVoidComponent"],"mappings":";;;AAIO,MAAMA,oBAAoB;IAC7B,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,OAAOD,AAAa,iBAAbA;AACX;AAEO,MAAME,aAAaC,gBAAgB,cAAc,IAC7C,WAAP,GACI,oBAACC,MAAIA;QAAC,MAAM;YAAE,UAAU;QAAa;qBACjC,oBAACC,oBAAkBA;AAKxB,MAAMA,qBAAqBF,gBAAgB,sBAAsBG"}
1
+ {"version":3,"file":"base/ui/Navigation.js","sources":["../../../src/base/ui/Navigation.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\nimport { Tags, useTags } from \"~/base/ui/Tags.js\";\n\nexport const useIsInNavigation = () => {\n const { location } = useTags();\n return location === \"navigation\";\n};\n\nexport const Navigation = makeDecoratable(\"Navigation\", () => {\n return (\n <Tags tags={{ location: \"navigation\" }}>\n <NavigationRenderer />\n </Tags>\n );\n});\n\nexport const NavigationRenderer = makeDecoratable(\"NavigationRenderer\", createVoidComponent());\n"],"names":["useIsInNavigation","location","useTags","Navigation","makeDecoratable","Tags","NavigationRenderer","createVoidComponent"],"mappings":";;;AAIO,MAAMA,oBAAoB;IAC7B,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,OAAOD,AAAa,iBAAbA;AACX;AAEO,MAAME,aAAaC,gBAAgB,cAAc,IAC7C,WAAP,GACI,oBAACC,MAAIA;QAAC,MAAM;YAAE,UAAU;QAAa;qBACjC,oBAACC,oBAAAA;AAKN,MAAMA,qBAAqBF,gBAAgB,sBAAsBG"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/NotFound.js","sources":["../../../src/base/ui/NotFound.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const NotFound = makeDecoratable(\"NotFound\", () => {\n return <NotFoundRenderer />;\n});\n\nexport const NotFoundRenderer = makeDecoratable(\"NotFoundRenderer\", createVoidComponent());\n"],"names":["NotFound","makeDecoratable","NotFoundRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,WAAWC,gBAAgB,YAAY,IACzC,WAAP,GAAO,oBAACC,kBAAgBA;AAGrB,MAAMA,mBAAmBD,gBAAgB,oBAAoBE"}
1
+ {"version":3,"file":"base/ui/NotFound.js","sources":["../../../src/base/ui/NotFound.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const NotFound = makeDecoratable(\"NotFound\", () => {\n return <NotFoundRenderer />;\n});\n\nexport const NotFoundRenderer = makeDecoratable(\"NotFoundRenderer\", createVoidComponent());\n"],"names":["NotFound","makeDecoratable","NotFoundRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,WAAWC,gBAAgB,YAAY,IACzC,WAAP,GAAO,oBAACC,kBAAAA;AAGL,MAAMA,mBAAmBD,gBAAgB,oBAAoBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/Tags.js","sources":["../../../src/base/ui/Tags.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\n\ntype TagsContext = Record<string, string | boolean>;\n\nconst TagsContext = createContext<TagsContext>({});\nTagsContext.displayName = \"TagsContext\";\n\ninterface TagsProps {\n tags: Record<string, string | boolean>;\n children: React.ReactNode;\n}\n\nexport const Tags = ({ tags, children }: TagsProps) => {\n const parentContext = useContext(TagsContext);\n\n return (\n <TagsContext.Provider value={{ ...parentContext, ...tags }}>\n {children}\n </TagsContext.Provider>\n );\n};\n\nexport const useTags = () => {\n return useContext(TagsContext);\n};\n"],"names":["TagsContext","createContext","Tags","tags","children","parentContext","useContext","useTags"],"mappings":";AAIA,MAAMA,cAAc,WAAHA,GAAGC,cAA2B,CAAC;AAChDD,YAAY,WAAW,GAAG;AAOnB,MAAME,OAAO,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAa;IAC9C,MAAMC,gBAAgBC,WAAWN;IAEjC,OAAO,WAAP,GACI,oBAACA,YAAY,QAAQ;QAAC,OAAO;YAAE,GAAGK,aAAa;YAAE,GAAGF,IAAI;QAAC;OACpDC;AAGb;AAEO,MAAMG,UAAU,IACZD,WAAWN"}
1
+ {"version":3,"file":"base/ui/Tags.js","sources":["../../../src/base/ui/Tags.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\n\ntype TagsContext = Record<string, string | boolean>;\n\nconst TagsContext = createContext<TagsContext>({});\nTagsContext.displayName = \"TagsContext\";\n\ninterface TagsProps {\n tags: Record<string, string | boolean>;\n children: React.ReactNode;\n}\n\nexport const Tags = ({ tags, children }: TagsProps) => {\n const parentContext = useContext(TagsContext);\n\n return (\n <TagsContext.Provider value={{ ...parentContext, ...tags }}>\n {children}\n </TagsContext.Provider>\n );\n};\n\nexport const useTags = () => {\n return useContext(TagsContext);\n};\n"],"names":["TagsContext","createContext","Tags","tags","children","parentContext","useContext","useTags"],"mappings":";AAIA,MAAMA,cAAc,WAAdA,GAAcC,cAA2B,CAAC;AAChDD,YAAY,WAAW,GAAG;AAOnB,MAAME,OAAO,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAa;IAC9C,MAAMC,gBAAgBC,WAAWN;IAEjC,OAAO,WAAP,GACI,oBAACA,YAAY,QAAQ;QAAC,OAAO;YAAE,GAAGK,aAAa;YAAE,GAAGF,IAAI;QAAC;OACpDC;AAGb;AAEO,MAAMG,UAAU,IACZD,WAAWN"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/TenantSelector.js","sources":["../../../src/base/ui/TenantSelector.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const TenantSelector = makeDecoratable(\"TenantSelector\", () => {\n return <TenantSelectorRenderer />;\n});\n\nexport const TenantSelectorRenderer = makeDecoratable(\n \"TenantSelectorRenderer\",\n createVoidComponent()\n);\n"],"names":["TenantSelector","makeDecoratable","TenantSelectorRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,iBAAiBC,gBAAgB,kBAAkB,IACrD,WAAP,GAAO,oBAACC,wBAAsBA;AAG3B,MAAMA,yBAAyBD,gBAClC,0BACAE"}
1
+ {"version":3,"file":"base/ui/TenantSelector.js","sources":["../../../src/base/ui/TenantSelector.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const TenantSelector = makeDecoratable(\"TenantSelector\", () => {\n return <TenantSelectorRenderer />;\n});\n\nexport const TenantSelectorRenderer = makeDecoratable(\n \"TenantSelectorRenderer\",\n createVoidComponent()\n);\n"],"names":["TenantSelector","makeDecoratable","TenantSelectorRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,iBAAiBC,gBAAgB,kBAAkB,IACrD,WAAP,GAAO,oBAACC,wBAAAA;AAGL,MAAMA,yBAAyBD,gBAClC,0BACAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/UserMenu/UserMenu.js","sources":["../../../../src/base/ui/UserMenu/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const UserMenu = makeDecoratable(\"UserMenu\", () => {\n return <UserMenuRenderer />;\n});\n\nexport const UserMenuRenderer = makeDecoratable(\"UserMenuRenderer\", createVoidComponent());\n"],"names":["UserMenu","makeDecoratable","UserMenuRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,WAAWC,gBAAgB,YAAY,IACzC,WAAP,GAAO,oBAACC,kBAAgBA;AAGrB,MAAMA,mBAAmBD,gBAAgB,oBAAoBE"}
1
+ {"version":3,"file":"base/ui/UserMenu/UserMenu.js","sources":["../../../../src/base/ui/UserMenu/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const UserMenu = makeDecoratable(\"UserMenu\", () => {\n return <UserMenuRenderer />;\n});\n\nexport const UserMenuRenderer = makeDecoratable(\"UserMenuRenderer\", createVoidComponent());\n"],"names":["UserMenu","makeDecoratable","UserMenuRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,WAAWC,gBAAgB,YAAY,IACzC,WAAP,GAAO,oBAACC,kBAAAA;AAGL,MAAMA,mBAAmBD,gBAAgB,oBAAoBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/UserMenu/UserMenuHandle.js","sources":["../../../../src/base/ui/UserMenu/UserMenuHandle.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const UserMenuHandle = makeDecoratable(\"UserMenuHandle\", () => {\n return <UserMenuHandleRenderer />;\n});\n\nexport const UserMenuHandleRenderer = makeDecoratable(\n \"UserMenuHandleRenderer\",\n createVoidComponent()\n);\n"],"names":["UserMenuHandle","makeDecoratable","UserMenuHandleRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,iBAAiBC,gBAAgB,kBAAkB,IACrD,WAAP,GAAO,oBAACC,wBAAsBA;AAG3B,MAAMA,yBAAyBD,gBAClC,0BACAE"}
1
+ {"version":3,"file":"base/ui/UserMenu/UserMenuHandle.js","sources":["../../../../src/base/ui/UserMenu/UserMenuHandle.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const UserMenuHandle = makeDecoratable(\"UserMenuHandle\", () => {\n return <UserMenuHandleRenderer />;\n});\n\nexport const UserMenuHandleRenderer = makeDecoratable(\n \"UserMenuHandleRenderer\",\n createVoidComponent()\n);\n"],"names":["UserMenuHandle","makeDecoratable","UserMenuHandleRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,iBAAiBC,gBAAgB,kBAAkB,IACrD,WAAP,GAAO,oBAACC,wBAAAA;AAGL,MAAMA,yBAAyBD,gBAClC,0BACAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"base/ui/UserMenu.js","sources":["../../../src/base/ui/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport * from \"./UserMenu/UserMenuItem.js\";\nexport * from \"./UserMenu/UserMenuLink.js\";\nexport * from \"./UserMenu/UserMenuSeparator.js\";\n\n// UserMenu\nexport const UserMenu = makeDecoratable(\"UserMenu\", () => {\n return <UserMenuRenderer />;\n});\n\nexport const UserMenuRenderer = makeDecoratable(\"UserMenuRenderer\", createVoidComponent());\n\n// UserMenuHandle\nexport const UserMenuHandle = makeDecoratable(\"UserMenuHandle\", () => {\n return <UserMenuHandleRenderer />;\n});\n\nexport const UserMenuHandleRenderer = makeDecoratable(\n \"UserMenuHandleRenderer\",\n createVoidComponent()\n);\n"],"names":["UserMenu","makeDecoratable","UserMenuRenderer","createVoidComponent","UserMenuHandle","UserMenuHandleRenderer"],"mappings":";;;;;AAQO,MAAMA,WAAWC,gBAAgB,YAAY,IACzC,WAAP,GAAO,oBAACC,kBAAgBA;AAGrB,MAAMA,mBAAmBD,gBAAgB,oBAAoBE;AAG7D,MAAMC,iBAAiBH,gBAAgB,kBAAkB,IACrD,WAAP,GAAO,oBAACI,wBAAsBA;AAG3B,MAAMA,yBAAyBJ,gBAClC,0BACAE"}
1
+ {"version":3,"file":"base/ui/UserMenu.js","sources":["../../../src/base/ui/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport * from \"./UserMenu/UserMenuItem.js\";\nexport * from \"./UserMenu/UserMenuLink.js\";\nexport * from \"./UserMenu/UserMenuSeparator.js\";\n\n// UserMenu\nexport const UserMenu = makeDecoratable(\"UserMenu\", () => {\n return <UserMenuRenderer />;\n});\n\nexport const UserMenuRenderer = makeDecoratable(\"UserMenuRenderer\", createVoidComponent());\n\n// UserMenuHandle\nexport const UserMenuHandle = makeDecoratable(\"UserMenuHandle\", () => {\n return <UserMenuHandleRenderer />;\n});\n\nexport const UserMenuHandleRenderer = makeDecoratable(\n \"UserMenuHandleRenderer\",\n createVoidComponent()\n);\n"],"names":["UserMenu","makeDecoratable","UserMenuRenderer","createVoidComponent","UserMenuHandle","UserMenuHandleRenderer"],"mappings":";;;;;AAQO,MAAMA,WAAWC,gBAAgB,YAAY,IACzC,WAAP,GAAO,oBAACC,kBAAAA;AAGL,MAAMA,mBAAmBD,gBAAgB,oBAAoBE;AAG7D,MAAMC,iBAAiBH,gBAAgB,kBAAkB,IACrD,WAAP,GAAO,oBAACI,wBAAAA;AAGL,MAAMA,yBAAyBJ,gBAClC,0BACAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/Buttons/useButtons.js","sources":["../../../src/components/Buttons/useButtons.tsx"],"sourcesContent":["import React from \"react\";\nimport { ButtonDefault, ButtonPrimary, ButtonSecondary, IconButton } from \"./Buttons.js\";\n\nexport interface ButtonsProviderContext {\n ButtonDefault: typeof ButtonDefault;\n ButtonPrimary: typeof ButtonPrimary;\n ButtonSecondary: typeof ButtonSecondary;\n IconButton: typeof IconButton;\n}\n\nconst ButtonsContext = React.createContext<ButtonsProviderContext | undefined>(undefined);\n\ninterface ButtonsProviderProps {\n children: React.ReactNode;\n}\n\nexport const ButtonsProvider = ({ children }: ButtonsProviderProps) => {\n return (\n <ButtonsContext.Provider\n value={{ ButtonDefault, ButtonPrimary, ButtonSecondary, IconButton }}\n >\n {children}\n </ButtonsContext.Provider>\n );\n};\n\nexport const useButtons = (): ButtonsProviderContext => {\n const context = React.useContext(ButtonsContext);\n\n if (!context) {\n throw new Error(\"useButtons must be used within a ButtonsContext\");\n }\n\n return context;\n};\n"],"names":["ButtonsContext","React","undefined","ButtonsProvider","children","ButtonDefault","ButtonPrimary","ButtonSecondary","IconButton","useButtons","context","Error"],"mappings":";;AAUA,MAAMA,iBAAiB,WAAHA,GAAGC,MAAAA,aAAmB,CAAqCC;AAMxE,MAAMC,kBAAkB,CAAC,EAAEC,QAAQ,EAAwB,GACvD,WAAP,GACI,oBAACJ,eAAe,QAAQ;QACpB,OAAO;YAAEK,eAAaA;YAAEC,eAAaA;YAAEC,iBAAeA;YAAEC,YAAUA;QAAC;OAElEJ;AAKN,MAAMK,aAAa;IACtB,MAAMC,UAAUT,MAAAA,UAAgB,CAACD;IAEjC,IAAI,CAACU,SACD,MAAM,IAAIC,MAAM;IAGpB,OAAOD;AACX"}
1
+ {"version":3,"file":"components/Buttons/useButtons.js","sources":["../../../src/components/Buttons/useButtons.tsx"],"sourcesContent":["import React from \"react\";\nimport { ButtonDefault, ButtonPrimary, ButtonSecondary, IconButton } from \"./Buttons.js\";\n\nexport interface ButtonsProviderContext {\n ButtonDefault: typeof ButtonDefault;\n ButtonPrimary: typeof ButtonPrimary;\n ButtonSecondary: typeof ButtonSecondary;\n IconButton: typeof IconButton;\n}\n\nconst ButtonsContext = React.createContext<ButtonsProviderContext | undefined>(undefined);\n\ninterface ButtonsProviderProps {\n children: React.ReactNode;\n}\n\nexport const ButtonsProvider = ({ children }: ButtonsProviderProps) => {\n return (\n <ButtonsContext.Provider\n value={{ ButtonDefault, ButtonPrimary, ButtonSecondary, IconButton }}\n >\n {children}\n </ButtonsContext.Provider>\n );\n};\n\nexport const useButtons = (): ButtonsProviderContext => {\n const context = React.useContext(ButtonsContext);\n\n if (!context) {\n throw new Error(\"useButtons must be used within a ButtonsContext\");\n }\n\n return context;\n};\n"],"names":["ButtonsContext","React","undefined","ButtonsProvider","children","ButtonDefault","ButtonPrimary","ButtonSecondary","IconButton","useButtons","context","Error"],"mappings":";;AAUA,MAAMA,iBAAiB,WAAjBA,GAAiBC,MAAAA,aAAmB,CAAqCC;AAMxE,MAAMC,kBAAkB,CAAC,EAAEC,QAAQ,EAAwB,GACvD,WAAP,GACI,oBAACJ,eAAe,QAAQ;QACpB,OAAO;YAAEK,eAAaA;YAAEC,eAAaA;YAAEC,iBAAeA;YAAEC,YAAUA;QAAC;OAElEJ;AAKN,MAAMK,aAAa;IACtB,MAAMC,UAAUT,MAAAA,UAAgB,CAACD;IAEjC,IAAI,CAACU,SACD,MAAM,IAAIC,MAAM;IAGpB,OAAOD;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/Dialogs/DialogParamsContext.js","sources":["../../../src/components/Dialogs/DialogParamsContext.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nexport interface DialogParamsContextValue {\n params: Record<string, unknown>;\n closeDialog: () => void;\n}\n\nexport const DialogParamsContext = createContext<DialogParamsContextValue | undefined>(undefined);\n\nexport const useDialogParamsContext = () => {\n const context = useContext(DialogParamsContext);\n\n if (!context) {\n throw new Error(\n \"useDialog must be used inside a named dialog registered via AdminConfig.Dialog\"\n );\n }\n\n return context;\n};\n"],"names":["DialogParamsContext","createContext","undefined","useDialogParamsContext","context","useContext","Error"],"mappings":";AAOO,MAAMA,sBAAsB,WAAHA,GAAGC,cAAoDC;AAEhF,MAAMC,yBAAyB;IAClC,MAAMC,UAAUC,WAAWL;IAE3B,IAAI,CAACI,SACD,MAAM,IAAIE,MACN;IAIR,OAAOF;AACX"}
1
+ {"version":3,"file":"components/Dialogs/DialogParamsContext.js","sources":["../../../src/components/Dialogs/DialogParamsContext.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nexport interface DialogParamsContextValue {\n params: Record<string, unknown>;\n closeDialog: () => void;\n}\n\nexport const DialogParamsContext = createContext<DialogParamsContextValue | undefined>(undefined);\n\nexport const useDialogParamsContext = () => {\n const context = useContext(DialogParamsContext);\n\n if (!context) {\n throw new Error(\n \"useDialog must be used inside a named dialog registered via AdminConfig.Dialog\"\n );\n }\n\n return context;\n};\n"],"names":["DialogParamsContext","createContext","undefined","useDialogParamsContext","context","useContext","Error"],"mappings":";AAOO,MAAMA,sBAAsB,WAAtBA,GAAsBC,cAAoDC;AAEhF,MAAMC,yBAAyB;IAClC,MAAMC,UAAUC,WAAWL;IAE3B,IAAI,CAACI,SACD,MAAM,IAAIE,MACN;IAIR,OAAOF;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/Dialogs/DialogsContext.js","sources":["../../../src/components/Dialogs/DialogsContext.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport React, { useState } from \"react\";\nimport type { GenericFormData } from \"@webiny/form\";\nimport { createProvider } from \"@webiny/app\";\nimport { generateId } from \"@webiny/utils\";\nimport { useSnackbar } from \"~/hooks/index.js\";\nimport { Dialog, type DialogProps } from \"./Dialog.js\";\nimport { DialogParamsContext } from \"./DialogParamsContext.js\";\nimport { useAdminConfig } from \"~/config/AdminConfig.js\";\n\ninterface ShowDialogParams {\n title: ReactNode;\n description?: ReactNode;\n dismissible?: boolean;\n content: ReactNode;\n actions?: React.JSX.Element;\n icon?: React.JSX.Element;\n info?: ReactNode;\n acceptLabel?: ReactNode;\n cancelLabel?: ReactNode;\n loadingLabel?: string;\n dataLoadingLabel?: string;\n onAccept?: (data: GenericFormData) => void;\n onClose?: () => void;\n formData?: DialogProps[\"formData\"];\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n}\n\nexport interface DialogsContext {\n showDialog: (params: ShowDialogParams) => () => void;\n closeAllDialogs: () => void;\n openNamedDialog: (name: string, params: Record<string, unknown>) => void;\n closeNamedDialog: () => void;\n}\n\ninterface DialogsProviderProps {\n children: ReactNode;\n}\n\ninterface DialogState extends ShowDialogParams {\n id: string;\n open: boolean;\n loading: boolean;\n element?: React.JSX.Element;\n}\n\nexport const initializeState = (params: Partial<DialogState> = {}): DialogState => ({\n id: `dialog-${generateId()}`,\n title: params.title ?? `Confirmation`,\n description: params.description,\n dismissible: params.dismissible,\n icon: params.icon,\n info: params.info,\n content: params.content,\n acceptLabel: params.acceptLabel === null ? null : (params.acceptLabel ?? `Confirm`),\n cancelLabel: params.cancelLabel === null ? null : (params.cancelLabel ?? `Cancel`),\n loadingLabel: params.loadingLabel ?? `Loading...`,\n dataLoadingLabel: params.dataLoadingLabel ?? `Loading...`,\n onAccept: params.onAccept,\n onClose: params.onClose,\n open: params.open ?? false,\n loading: params.loading ?? false,\n element: params.element,\n formData: params.formData ?? {},\n size: params.size ?? \"md\"\n});\n\nexport const DialogsContext = React.createContext<DialogsContext | undefined>(undefined);\n\ninterface NamedDialogIntent {\n name: string;\n params: Record<string, unknown>;\n}\n\nexport const DialogsProvider = ({ children }: DialogsProviderProps) => {\n const { showSnackbar } = useSnackbar();\n const [dialogs, setDialogs] = useState<Map<string, DialogState>>(new Map());\n const [namedDialogIntent, setNamedDialogIntent] = useState<NamedDialogIntent | null>(null);\n const { dialogs: registeredDialogs } = useAdminConfig();\n\n const showDialog = (params: ShowDialogParams) => {\n const newDialog = initializeState({ ...params, open: true });\n setDialogs(dialogs => new Map(dialogs).set(newDialog.id, newDialog));\n return () => closeDialog(newDialog.id);\n };\n\n const closeDialog = (id: string) => {\n const dialog = dialogs.get(id);\n\n // Call the onClose callback if it exists\n if (dialog?.onClose && typeof dialog.onClose === \"function\") {\n try {\n dialog.onClose();\n } catch (error) {\n // Log error but don't prevent dialog cleanup\n console.error(\"Error in dialog onClose callback:\", error);\n }\n }\n\n setDialogs(dialogs => {\n const newDialogs = new Map(dialogs);\n newDialogs.delete(id);\n return newDialogs;\n });\n };\n\n const closeAllDialogs = () => {\n setDialogs(new Map());\n };\n\n const openNamedDialog = (name: string, params: Record<string, unknown>) => {\n setNamedDialogIntent({ name, params });\n };\n\n const closeNamedDialog = () => {\n setNamedDialogIntent(null);\n };\n\n const onSubmit = async (id: string, data: GenericFormData) => {\n const dialog = dialogs.get(id);\n if (!dialog) {\n return;\n }\n\n try {\n if (typeof dialog.onAccept === \"function\") {\n setDialogs(dialogs => {\n const newDialogs = new Map(dialogs);\n newDialogs.set(id, { ...dialog, loading: true });\n return newDialogs;\n });\n\n await dialog.onAccept(data);\n }\n } catch (error) {\n showSnackbar(error.message);\n } finally {\n setDialogs(dialogs => {\n const newDialogs = new Map(dialogs);\n newDialogs.set(id, { ...dialog, loading: false });\n return newDialogs;\n });\n closeDialog(id);\n }\n };\n\n const context = {\n showDialog,\n closeDialog,\n closeAllDialogs,\n openNamedDialog,\n closeNamedDialog\n };\n\n return (\n <DialogsContext.Provider value={context}>\n {children}\n {Array.from(dialogs.values()).map(dialog => (\n <Dialog\n key={dialog.id}\n description={dialog.description}\n dismissible={dialog.dismissible ?? true}\n icon={dialog.icon ?? <></>}\n title={dialog.title}\n content={dialog.content}\n open={dialog.open}\n info={dialog.info}\n acceptLabel={dialog.acceptLabel}\n cancelLabel={dialog.cancelLabel}\n loadingLabel={dialog.loadingLabel}\n dataLoadingLabel={dialog.dataLoadingLabel}\n loading={dialog.loading}\n closeDialog={() => {\n closeDialog(dialog.id);\n dialog.onClose && dialog.onClose();\n }}\n onSubmit={data => onSubmit(dialog.id, data)}\n formData={dialog.formData}\n size={dialog.size}\n />\n ))}\n {namedDialogIntent &&\n (() => {\n const registration = registeredDialogs.find(\n d => d.name === namedDialogIntent.name\n );\n if (!registration) {\n return null;\n }\n return (\n <DialogParamsContext.Provider\n value={{\n params: namedDialogIntent.params,\n closeDialog: closeNamedDialog\n }}\n >\n {registration.element}\n </DialogParamsContext.Provider>\n );\n })()}\n </DialogsContext.Provider>\n );\n};\n\nexport const createDialogsProvider = () => {\n return createProvider(Component => {\n return function DialogsProviderDecorator({ children }: DialogsProviderProps) {\n return (\n <DialogsProvider>\n <Component>{children}</Component>\n </DialogsProvider>\n );\n };\n });\n};\n"],"names":["initializeState","params","generateId","DialogsContext","React","undefined","DialogsProvider","children","showSnackbar","useSnackbar","dialogs","setDialogs","useState","Map","namedDialogIntent","setNamedDialogIntent","registeredDialogs","useAdminConfig","showDialog","newDialog","closeDialog","id","dialog","error","console","newDialogs","closeAllDialogs","openNamedDialog","name","closeNamedDialog","onSubmit","data","context","Array","Dialog","registration","d","DialogParamsContext","createDialogsProvider","createProvider","Component"],"mappings":";;;;;;;AA8CO,MAAMA,kBAAkB,CAACC,SAA+B,CAAC,CAAC,GAAmB;QAChF,IAAI,CAAC,OAAO,EAAEC,cAAc;QAC5B,OAAOD,OAAO,KAAK,IAAI;QACvB,aAAaA,OAAO,WAAW;QAC/B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,MAAMA,OAAO,IAAI;QACjB,SAASA,OAAO,OAAO;QACvB,aAAaA,AAAuB,SAAvBA,OAAO,WAAW,GAAY,OAAQA,OAAO,WAAW,IAAI;QACzE,aAAaA,AAAuB,SAAvBA,OAAO,WAAW,GAAY,OAAQA,OAAO,WAAW,IAAI;QACzE,cAAcA,OAAO,YAAY,IAAI;QACrC,kBAAkBA,OAAO,gBAAgB,IAAI;QAC7C,UAAUA,OAAO,QAAQ;QACzB,SAASA,OAAO,OAAO;QACvB,MAAMA,OAAO,IAAI,IAAI;QACrB,SAASA,OAAO,OAAO,IAAI;QAC3B,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ACzB,MAAMA,OAAO,IAAI;aAGxBR,qBACI,AAAC;QACE,MAAMqB,eAAenB,kBAAkB,IAAI,CACvCoB,CAAAA,IAAKA,EAAE,IAAI,KAAKtB,kBAAkB,IAAI;QAE1C,IAAI,CAACqB,cACD,OAAO;QAEX,OAAO,WAAP,GACI,oBAACE,oBAAoB,QAAQ;YACzB,OAAO;gBACH,QAAQvB,kBAAkB,MAAM;gBAChC,aAAae;YACjB;WAECM,aAAa,OAAO;IAGjC;AAGhB;AAEO,MAAMG,wBAAwB,IAC1BC,eAAeC,CAAAA,YACX,SAAkC,EAAEjC,QAAQ,EAAwB;YACvE,OAAO,WAAP,GACI,oBAACD,iBAAeA,MAAAA,WAAAA,GACZ,oBAACkC,WAAAA,MAAWjC;QAGxB"}
1
+ {"version":3,"file":"components/Dialogs/DialogsContext.js","sources":["../../../src/components/Dialogs/DialogsContext.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport React, { useState } from \"react\";\nimport type { GenericFormData } from \"@webiny/form\";\nimport { createProvider } from \"@webiny/app\";\nimport { generateId } from \"@webiny/utils\";\nimport { useSnackbar } from \"~/hooks/index.js\";\nimport { Dialog, type DialogProps } from \"./Dialog.js\";\nimport { DialogParamsContext } from \"./DialogParamsContext.js\";\nimport { useAdminConfig } from \"~/config/AdminConfig.js\";\n\ninterface ShowDialogParams {\n title: ReactNode;\n description?: ReactNode;\n dismissible?: boolean;\n content: ReactNode;\n actions?: React.JSX.Element;\n icon?: React.JSX.Element;\n info?: ReactNode;\n acceptLabel?: ReactNode;\n cancelLabel?: ReactNode;\n loadingLabel?: string;\n dataLoadingLabel?: string;\n onAccept?: (data: GenericFormData) => void;\n onClose?: () => void;\n formData?: DialogProps[\"formData\"];\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n}\n\nexport interface DialogsContext {\n showDialog: (params: ShowDialogParams) => () => void;\n closeAllDialogs: () => void;\n openNamedDialog: (name: string, params: Record<string, unknown>) => void;\n closeNamedDialog: () => void;\n}\n\ninterface DialogsProviderProps {\n children: ReactNode;\n}\n\ninterface DialogState extends ShowDialogParams {\n id: string;\n open: boolean;\n loading: boolean;\n element?: React.JSX.Element;\n}\n\nexport const initializeState = (params: Partial<DialogState> = {}): DialogState => ({\n id: `dialog-${generateId()}`,\n title: params.title ?? `Confirmation`,\n description: params.description,\n dismissible: params.dismissible,\n icon: params.icon,\n info: params.info,\n content: params.content,\n acceptLabel: params.acceptLabel === null ? null : (params.acceptLabel ?? `Confirm`),\n cancelLabel: params.cancelLabel === null ? null : (params.cancelLabel ?? `Cancel`),\n loadingLabel: params.loadingLabel ?? `Loading...`,\n dataLoadingLabel: params.dataLoadingLabel ?? `Loading...`,\n onAccept: params.onAccept,\n onClose: params.onClose,\n open: params.open ?? false,\n loading: params.loading ?? false,\n element: params.element,\n formData: params.formData ?? {},\n size: params.size ?? \"md\"\n});\n\nexport const DialogsContext = React.createContext<DialogsContext | undefined>(undefined);\n\ninterface NamedDialogIntent {\n name: string;\n params: Record<string, unknown>;\n}\n\nexport const DialogsProvider = ({ children }: DialogsProviderProps) => {\n const { showSnackbar } = useSnackbar();\n const [dialogs, setDialogs] = useState<Map<string, DialogState>>(new Map());\n const [namedDialogIntent, setNamedDialogIntent] = useState<NamedDialogIntent | null>(null);\n const { dialogs: registeredDialogs } = useAdminConfig();\n\n const showDialog = (params: ShowDialogParams) => {\n const newDialog = initializeState({ ...params, open: true });\n setDialogs(dialogs => new Map(dialogs).set(newDialog.id, newDialog));\n return () => closeDialog(newDialog.id);\n };\n\n const closeDialog = (id: string) => {\n const dialog = dialogs.get(id);\n\n // Call the onClose callback if it exists\n if (dialog?.onClose && typeof dialog.onClose === \"function\") {\n try {\n dialog.onClose();\n } catch (error) {\n // Log error but don't prevent dialog cleanup\n console.error(\"Error in dialog onClose callback:\", error);\n }\n }\n\n setDialogs(dialogs => {\n const newDialogs = new Map(dialogs);\n newDialogs.delete(id);\n return newDialogs;\n });\n };\n\n const closeAllDialogs = () => {\n setDialogs(new Map());\n };\n\n const openNamedDialog = (name: string, params: Record<string, unknown>) => {\n setNamedDialogIntent({ name, params });\n };\n\n const closeNamedDialog = () => {\n setNamedDialogIntent(null);\n };\n\n const onSubmit = async (id: string, data: GenericFormData) => {\n const dialog = dialogs.get(id);\n if (!dialog) {\n return;\n }\n\n try {\n if (typeof dialog.onAccept === \"function\") {\n setDialogs(dialogs => {\n const newDialogs = new Map(dialogs);\n newDialogs.set(id, { ...dialog, loading: true });\n return newDialogs;\n });\n\n await dialog.onAccept(data);\n }\n } catch (error) {\n showSnackbar(error.message);\n } finally {\n setDialogs(dialogs => {\n const newDialogs = new Map(dialogs);\n newDialogs.set(id, { ...dialog, loading: false });\n return newDialogs;\n });\n closeDialog(id);\n }\n };\n\n const context = {\n showDialog,\n closeDialog,\n closeAllDialogs,\n openNamedDialog,\n closeNamedDialog\n };\n\n return (\n <DialogsContext.Provider value={context}>\n {children}\n {Array.from(dialogs.values()).map(dialog => (\n <Dialog\n key={dialog.id}\n description={dialog.description}\n dismissible={dialog.dismissible ?? true}\n icon={dialog.icon ?? <></>}\n title={dialog.title}\n content={dialog.content}\n open={dialog.open}\n info={dialog.info}\n acceptLabel={dialog.acceptLabel}\n cancelLabel={dialog.cancelLabel}\n loadingLabel={dialog.loadingLabel}\n dataLoadingLabel={dialog.dataLoadingLabel}\n loading={dialog.loading}\n closeDialog={() => {\n closeDialog(dialog.id);\n dialog.onClose && dialog.onClose();\n }}\n onSubmit={data => onSubmit(dialog.id, data)}\n formData={dialog.formData}\n size={dialog.size}\n />\n ))}\n {namedDialogIntent &&\n (() => {\n const registration = registeredDialogs.find(\n d => d.name === namedDialogIntent.name\n );\n if (!registration) {\n return null;\n }\n return (\n <DialogParamsContext.Provider\n value={{\n params: namedDialogIntent.params,\n closeDialog: closeNamedDialog\n }}\n >\n {registration.element}\n </DialogParamsContext.Provider>\n );\n })()}\n </DialogsContext.Provider>\n );\n};\n\nexport const createDialogsProvider = () => {\n return createProvider(Component => {\n return function DialogsProviderDecorator({ children }: DialogsProviderProps) {\n return (\n <DialogsProvider>\n <Component>{children}</Component>\n </DialogsProvider>\n );\n };\n });\n};\n"],"names":["initializeState","params","generateId","DialogsContext","React","undefined","DialogsProvider","children","showSnackbar","useSnackbar","dialogs","setDialogs","useState","Map","namedDialogIntent","setNamedDialogIntent","registeredDialogs","useAdminConfig","showDialog","newDialog","closeDialog","id","dialog","error","console","newDialogs","closeAllDialogs","openNamedDialog","name","closeNamedDialog","onSubmit","data","context","Array","Dialog","registration","d","DialogParamsContext","createDialogsProvider","createProvider","Component"],"mappings":";;;;;;;AA8CO,MAAMA,kBAAkB,CAACC,SAA+B,CAAC,CAAC,GAAmB;QAChF,IAAI,CAAC,OAAO,EAAEC,cAAc;QAC5B,OAAOD,OAAO,KAAK,IAAI;QACvB,aAAaA,OAAO,WAAW;QAC/B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,MAAMA,OAAO,IAAI;QACjB,SAASA,OAAO,OAAO;QACvB,aAAaA,AAAuB,SAAvBA,OAAO,WAAW,GAAY,OAAQA,OAAO,WAAW,IAAI;QACzE,aAAaA,AAAuB,SAAvBA,OAAO,WAAW,GAAY,OAAQA,OAAO,WAAW,IAAI;QACzE,cAAcA,OAAO,YAAY,IAAI;QACrC,kBAAkBA,OAAO,gBAAgB,IAAI;QAC7C,UAAUA,OAAO,QAAQ;QACzB,SAASA,OAAO,OAAO;QACvB,MAAMA,OAAO,IAAI,IAAI;QACrB,SAASA,OAAO,OAAO,IAAI;QAC3B,SAASA,OAAO,OAAO;QACvB,UAAUA,OAAO,QAAQ,IAAI,CAAC;QAC9B,MAAMA,OAAO,IAAI,IAAI;IACzB;AAEO,MAAME,iBAAiB,WAAjBA,GAAiBC,MAAAA,aAAmB,CAA6BC;AAOvE,MAAMC,kBAAkB,CAAC,EAAEC,QAAQ,EAAwB;IAC9D,MAAM,EAAEC,YAAY,EAAE,GAAGC;IACzB,MAAM,CAACC,SAASC,WAAW,G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WAECM,aAAa,OAAO;IAGjC;AAGhB;AAEO,MAAMG,wBAAwB,IAC1BC,eAAeC,CAAAA,YACX,SAAkC,EAAEjC,QAAQ,EAAwB;YACvE,OAAO,WAAP,GACI,oBAACD,iBAAAA,MAAAA,WAAAA,GACG,oBAACkC,WAAAA,MAAWjC;QAGxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/Filters/FiltersToggle.js","sources":["../../../src/components/Filters/FiltersToggle.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconButton, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as FilterIcon } from \"@webiny/icons/filter_list.svg\";\nimport { ReactComponent as CloseFilterIcon } from \"@webiny/icons/filter_list_off.svg\";\n\ninterface IconProps {\n showingFilters?: boolean;\n}\n\nconst Icon = ({ showingFilters }: IconProps) => {\n return showingFilters ? <CloseFilterIcon /> : <FilterIcon />;\n};\nconst IconComponent = React.memo(Icon);\n\nexport interface FiltersToggleProps {\n onFiltersToggle: () => void;\n showingFilters: boolean;\n \"data-testid\"?: string;\n}\n\nexport const FiltersToggle = (props: FiltersToggleProps) => {\n return (\n <Tooltip\n side={\"bottom\"}\n content={props.showingFilters ? \"Hide filters\" : \"Show filters\"}\n trigger={\n <IconButton\n variant={\"ghost\"}\n icon={<IconComponent showingFilters={props.showingFilters} />}\n onClick={props.onFiltersToggle}\n data-testid={props[\"data-testid\"]}\n />\n }\n />\n );\n};\n"],"names":["Icon","showingFilters","CloseFilterIcon","FilterIcon","IconComponent","React","FiltersToggle","props","Tooltip","IconButton"],"mappings":";;;;AASA,MAAMA,OAAO,CAAC,EAAEC,cAAc,EAAa,GAChCA,iBAAiB,WAAjBA,GAAiB,oBAACC,oCAAeA,QAAAA,WAAAA,GAAM,oBAACC,gBAAUA;AAE7D,MAAMC,gBAAgB,WAAHA,GAAGC,MAAAA,IAAU,CAACL;AAQ1B,MAAMM,gBAAgB,CAACC,QACnB,WAAP,GACI,oBAACC,SAAOA;QACJ,MAAM;QACN,SAASD,MAAM,cAAc,GAAG,iBAAiB;QACjD,uBACI,oBAACE,YAAUA;YACP,SAAS;YACT,oBAAM,oBAACL,eAAaA;gBAAC,gBAAgBG,MAAM,cAAc;;YACzD,SAASA,MAAM,eAAe;YAC9B,eAAaA,KAAK,CAAC,cAAc"}
1
+ {"version":3,"file":"components/Filters/FiltersToggle.js","sources":["../../../src/components/Filters/FiltersToggle.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconButton, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as FilterIcon } from \"@webiny/icons/filter_list.svg\";\nimport { ReactComponent as CloseFilterIcon } from \"@webiny/icons/filter_list_off.svg\";\n\ninterface IconProps {\n showingFilters?: boolean;\n}\n\nconst Icon = ({ showingFilters }: IconProps) => {\n return showingFilters ? <CloseFilterIcon /> : <FilterIcon />;\n};\nconst IconComponent = React.memo(Icon);\n\nexport interface FiltersToggleProps {\n onFiltersToggle: () => void;\n showingFilters: boolean;\n \"data-testid\"?: string;\n}\n\nexport const FiltersToggle = (props: FiltersToggleProps) => {\n return (\n <Tooltip\n side={\"bottom\"}\n content={props.showingFilters ? \"Hide filters\" : \"Show filters\"}\n trigger={\n <IconButton\n variant={\"ghost\"}\n icon={<IconComponent showingFilters={props.showingFilters} />}\n onClick={props.onFiltersToggle}\n data-testid={props[\"data-testid\"]}\n />\n }\n />\n );\n};\n"],"names":["Icon","showingFilters","CloseFilterIcon","FilterIcon","IconComponent","React","FiltersToggle","props","Tooltip","IconButton"],"mappings":";;;;AASA,MAAMA,OAAO,CAAC,EAAEC,cAAc,EAAa,GAChCA,iBAAiB,WAAjBA,GAAiB,oBAACC,oCAAeA,QAAAA,WAAAA,GAAM,oBAACC,gBAAUA;AAE7D,MAAMC,gBAAgB,WAAhBA,GAAgBC,MAAAA,IAAU,CAACL;AAQ1B,MAAMM,gBAAgB,CAACC,QACnB,WAAP,GACI,oBAACC,SAAOA;QACJ,MAAM;QACN,SAASD,MAAM,cAAc,GAAG,iBAAiB;QACjD,uBACI,oBAACE,YAAUA;YACP,SAAS;YACT,oBAAM,oBAACL,eAAAA;gBAAc,gBAAgBG,MAAM,cAAc;;YACzD,SAASA,MAAM,eAAe;YAC9B,eAAaA,KAAK,CAAC,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/IconPicker/IconPickerPresenterProvider.js","sources":["../../../src/components/IconPicker/IconPickerPresenterProvider.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { IconPickerPresenterInterface } from \"./IconPickerPresenter.js\";\n\ninterface IconPickerPresenterProviderProps {\n presenter: IconPickerPresenterInterface;\n children: React.ReactNode;\n}\n\nconst IconPickerPresenterContext = React.createContext<IconPickerPresenterInterface | undefined>(\n undefined\n);\n\nexport const IconPickerPresenterProvider = ({\n presenter,\n children\n}: IconPickerPresenterProviderProps) => {\n return (\n <IconPickerPresenterContext.Provider value={presenter}>\n {children}\n </IconPickerPresenterContext.Provider>\n );\n};\n\nexport function useIconPicker() {\n const context = React.useContext(IconPickerPresenterContext);\n if (!context) {\n throw Error(`Missing <IconPickerPresenterProvider> in the component tree!`);\n }\n return context;\n}\n"],"names":["IconPickerPresenterContext","React","undefined","IconPickerPresenterProvider","presenter","children","useIconPicker","context","Error"],"mappings":";AASA,MAAMA,6BAA6B,WAAHA,GAAGC,MAAAA,aAAmB,CAClDC;AAGG,MAAMC,8BAA8B,CAAC,EACxCC,SAAS,EACTC,QAAQ,EACuB,GACxB,WAAP,GACI,oBAACL,2BAA2B,QAAQ;QAAC,OAAOI;OACvCC;AAKN,SAASC;IACZ,MAAMC,UAAUN,MAAAA,UAAgB,CAACD;IACjC,IAAI,CAACO,SACD,MAAMC,MAAM;IAEhB,OAAOD;AACX"}
1
+ {"version":3,"file":"components/IconPicker/IconPickerPresenterProvider.js","sources":["../../../src/components/IconPicker/IconPickerPresenterProvider.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { IconPickerPresenterInterface } from \"./IconPickerPresenter.js\";\n\ninterface IconPickerPresenterProviderProps {\n presenter: IconPickerPresenterInterface;\n children: React.ReactNode;\n}\n\nconst IconPickerPresenterContext = React.createContext<IconPickerPresenterInterface | undefined>(\n undefined\n);\n\nexport const IconPickerPresenterProvider = ({\n presenter,\n children\n}: IconPickerPresenterProviderProps) => {\n return (\n <IconPickerPresenterContext.Provider value={presenter}>\n {children}\n </IconPickerPresenterContext.Provider>\n );\n};\n\nexport function useIconPicker() {\n const context = React.useContext(IconPickerPresenterContext);\n if (!context) {\n throw Error(`Missing <IconPickerPresenterProvider> in the component tree!`);\n }\n return context;\n}\n"],"names":["IconPickerPresenterContext","React","undefined","IconPickerPresenterProvider","presenter","children","useIconPicker","context","Error"],"mappings":";AASA,MAAMA,6BAA6B,WAA7BA,GAA6BC,MAAAA,aAAmB,CAClDC;AAGG,MAAMC,8BAA8B,CAAC,EACxCC,SAAS,EACTC,QAAQ,EACuB,GACxB,WAAP,GACI,oBAACL,2BAA2B,QAAQ;QAAC,OAAOI;OACvCC;AAKN,SAASC;IACZ,MAAMC,UAAUN,MAAAA,UAAgB,CAACD;IACjC,IAAI,CAACO,SACD,MAAMC,MAAM;IAEhB,OAAOD;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/IconPicker/IconPickerTab.js","sources":["../../../src/components/IconPicker/IconPickerTab.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { ReactComponent as SearchIcon } from \"@webiny/icons/search.svg\";\nimport { List } from \"react-virtualized\";\nimport groupBy from \"lodash/groupBy.js\";\n\nimport { Text, DelayedOnChange, Input, Tabs, Icon as IconComponent } from \"@webiny/admin-ui\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\n\nimport { useIconPicker } from \"./IconPickerPresenterProvider.js\";\nimport { useIconType } from \"./config/IconType.js\";\nimport { IconPickerCell, IconPickerRow } from \"./components/index.js\";\nimport type { Icon, IconPickerGridRow } from \"./types.js\";\nimport { ICON_PICKER_SIZE } from \"./types.js\";\n\nconst COLUMN_COUNT = 8;\n\nexport const IconPickerTabRenderer = makeDecoratable(\"IconPickerTabRenderer\", () => null);\n\nconst getRows = (icons: Icon[], size?: string) => {\n // Group the icons by their category.\n const groupedObjects = groupBy(icons, \"category\");\n const rows: IconPickerGridRow[] = [];\n\n // Iterate over each category in the grouped icons.\n for (const key in groupedObjects) {\n // Skip any group where the key is `undefined` (these icons will be handled separately).\n if (key !== \"undefined\") {\n const rowIcons = groupedObjects[key];\n\n // Add a row for the category name.\n rows.push({ type: \"category-name\", name: key });\n\n // Split the icons in this category into groups of COLUMN_COUNT and add them as rows.\n while (rowIcons.length) {\n rows.push({\n type: \"icons\",\n icons: rowIcons.splice(0, size === ICON_PICKER_SIZE.SMALL ? 6 : COLUMN_COUNT)\n });\n }\n }\n }\n\n // Handle icons that don't have a category (key is `undefined`).\n if (groupedObjects.undefined) {\n const rowIcons = groupedObjects.undefined;\n\n // Add a row for the `Uncategorized` category name.\n rows.push({ type: \"category-name\", name: \"Uncategorized\" });\n\n // Split these icons into groups of COLUMN_COUNT and add them as rows.\n while (rowIcons.length) {\n rows.push({\n type: \"icons\",\n icons: rowIcons.splice(0, size === ICON_PICKER_SIZE.SMALL ? 6 : COLUMN_COUNT)\n });\n }\n }\n\n return rows;\n};\n\nconst useIconTypeRows = (type: string) => {\n const presenter = useIconPicker();\n const icons = presenter.vm.icons.filter(icon => icon.type === type);\n const rows = getRows(icons, presenter.vm.size);\n\n return {\n isEmpty: rows.length === 0,\n rows,\n rowCount: rows.length\n };\n};\n\ninterface RenderRowProps {\n onIconClick: (icon: Icon) => void;\n style: Record<string, any>;\n row: IconPickerGridRow;\n cellDecorator: CellDecorator;\n}\n\nconst RowRenderer = ({ row, style, cellDecorator, onIconClick }: RenderRowProps) => {\n const presenter = useIconPicker();\n const value = presenter.vm.selectedIcon;\n\n if (row.type === \"category-name\") {\n return (\n <IconPickerRow style={style}>\n <Text size={\"sm\"} className={\"uppercase self-end text-neutral-muted mb-sm\"}>\n {row.name}\n </Text>\n </IconPickerRow>\n );\n }\n\n return (\n <IconPickerRow style={style}>\n {row.icons.map((item, itemKey) => (\n <Fragment key={itemKey}>\n {cellDecorator(\n <IconPickerCell\n key={itemKey}\n icon={item}\n isActive={item.name === value?.name}\n onIconClick={() => onIconClick(item)}\n />\n )}\n </Fragment>\n ))}\n </IconPickerRow>\n );\n};\n\ninterface CellDecorator {\n (cell: React.ReactElement): React.ReactElement;\n}\n\nconst noopDecorator: CellDecorator = cell => cell;\n\nexport interface IconPickerTabProps {\n label: string;\n value: string;\n onChange: (icon: Icon) => void;\n actions?: React.ReactElement;\n cellDecorator?: CellDecorator;\n}\n\nexport const IconPickerTab = ({\n label,\n value,\n actions,\n onChange,\n cellDecorator = noopDecorator\n}: IconPickerTabProps) => {\n const { type } = useIconType();\n const { isEmpty, rowCount, rows } = useIconTypeRows(type);\n const presenter = useIconPicker();\n const size = presenter.vm.size;\n\n return (\n <Tabs.Tab\n value={value}\n trigger={label}\n content={\n <div>\n <div className={\"flex items-center justify-center gap-sm\"}>\n <DelayedOnChange\n value={presenter.vm.filter}\n onChange={value => presenter.setFilter(value)}\n >\n {({ value, onChange }) => (\n <Input\n value={value}\n onChange={value => onChange(value as unknown as string)}\n placeholder={\"Search icons...\"}\n variant={\"secondary\"}\n size={\"md\"}\n startIcon={\n <IconComponent\n icon={<SearchIcon />}\n label={\"Search icons\"}\n />\n }\n />\n )}\n </DelayedOnChange>\n {actions ? <div>{actions}</div> : null}\n </div>\n <div className={\"relative\"}>\n {isEmpty ? (\n <div className={\"pt-md text-neutral-strong\"}>\n <Text>{\"No results found.\"}</Text>\n </div>\n ) : (\n <List\n className={\"outline-none\"}\n rowRenderer={({ key, ...props }) => (\n <RowRenderer\n key={key}\n row={rows[props.index]}\n cellDecorator={cellDecorator}\n onIconClick={onChange}\n {...props}\n />\n )}\n width={size === ICON_PICKER_SIZE.SMALL ? 232 : 312}\n height={size === ICON_PICKER_SIZE.SMALL ? 240 : 350}\n rowCount={rowCount}\n rowHeight={40}\n />\n )}\n </div>\n </div>\n }\n />\n );\n};\n"],"names":["COLUMN_COUNT","IconPickerTabRenderer","makeDecoratable","getRows","icons","size","groupedObjects","groupBy","rows","key","rowIcons","ICON_PICKER_SIZE","useIconTypeRows","type","presenter","useIconPicker","icon","RowRenderer","row","style","cellDecorator","onIconClick","value","IconPickerRow","Text","item","itemKey","Fragment","IconPickerCell","noopDecorator","cell","IconPickerTab","label","actions","onChange","useIconType","isEmpty","rowCount","Tabs","DelayedOnChange","Input","IconComponent","SearchIcon","List","props"],"mappings":";;;;;;;;;;AAcA,MAAMA,eAAe;AAEd,MAAMC,wBAAwBC,gBAAgB,yBAAyB,IAAM;AAEpF,MAAMC,UAAU,CAACC,OAAeC;IAE5B,MAAMC,iBAAiBC,QAAQH,OAAO;IACtC,MAAMI,OAA4B,EAAE;IAGpC,IAAK,MAAMC,OAAOH,eAEd,IAAIG,AAAQ,gBAARA,KAAqB;QACrB,MAAMC,WAAWJ,cAAc,CAACG,IAAI;QAGpCD,KAAK,IAAI,CAAC;YAAE,MAAM;YAAiB,MAAMC;QAAI;QAG7C,MAAOC,SAAS,MAAM,CAClBF,KAAK,IAAI,CAAC;YACN,MAAM;YACN,OAAOE,SAAS,MAAM,CAAC,GAAGL,SAASM,iBAAiB,KAAK,GAAG,IAAIX;QACpE;IAER;IAIJ,IAAIM,eAAe,SAAS,EAAE;QAC1B,MAAMI,WAAWJ,eAAe,SAAS;QAGzCE,KAAK,IAAI,CAAC;YAAE,MAAM;YAAiB,MAAM;QAAgB;QAGzD,MAAOE,SAAS,MAAM,CAClBF,KAAK,IAAI,CAAC;YACN,MAAM;YACN,OAAOE,SAAS,MAAM,CAAC,GAAGL,SAASM,iBAAiB,KAAK,GAAG,IAAIX;QACpE;IAER;IAEA,OAAOQ;AACX;AAEA,MAAMI,kBAAkB,CAACC;IACrB,MAAMC,YAAYC;IAClB,MAAMX,QAAQU,UAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAACE,CAAAA,OAAQA,KAAK,IAAI,KAAKH;IAC9D,MAAML,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MAAM;YAC1B,UAAUQ,CAAAA,QAASR,UAAU,SAAS,CAACQ;WAEtC,CAAC,EAAEA,KAAK,EAAEY,QAAQ,EAAE,iBACjB,oBAACM,OAAKA;gBACF,OAAOlB;gBACP,UAAUA,CAAAA,QAASY,SAASZ;gBAC5B,aAAa;gBACb,SAAS;gBACT,MAAM;gBACN,yBACI,oBAACmB,MAAaA;oBACV,oBAAM,oBAACC,gBAAUA;oBACjB,OAAO;;iBAM1BT,UAAU,WAAVA,GAAU,oBAAC,aAAKA,WAAiB,qBAEtC,oBAAC;YAAI,WAAW;WACXG,UAAU,WAAVA,GACG,oBAAC;YAAI,WAAW;yBACZ,oBAACZ,MAAIA,MAAE,sCAGX,oBAACmB,MAAIA;YACD,WAAW;YACX,aAAa,CAAC,EAAElC,GAAG,EAAE,GAAGmC,OAAO,iBAC3B,oBAAC3B,aAAWA;oBACR,KAAKR;oBACL,KAAKD,IAAI,CAACoC,MAAM,KAAK,CAAC;oBACtB,eAAexB;oBACf,aAAac;oBACZ,GAAGU,KAAK;;YAGjB,OAAOvC,SAASM,iBAAiB,KAAK,GAAG,MAAM;YAC/C,QAAQN,SAASM,iBAAiB,KAAK,GAAG,MAAM;YAChD,UAAU0B;YACV,WAAW;;;AAQ3C"}
1
+ {"version":3,"file":"components/IconPicker/IconPickerTab.js","sources":["../../../src/components/IconPicker/IconPickerTab.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { ReactComponent as SearchIcon } from \"@webiny/icons/search.svg\";\nimport { List } from \"react-virtualized\";\nimport groupBy from \"lodash/groupBy.js\";\n\nimport { Text, DelayedOnChange, Input, Tabs, Icon as IconComponent } from \"@webiny/admin-ui\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\n\nimport { useIconPicker } from \"./IconPickerPresenterProvider.js\";\nimport { useIconType } from \"./config/IconType.js\";\nimport { IconPickerCell, IconPickerRow } from \"./components/index.js\";\nimport type { Icon, IconPickerGridRow } from \"./types.js\";\nimport { ICON_PICKER_SIZE } from \"./types.js\";\n\nconst COLUMN_COUNT = 8;\n\nexport const IconPickerTabRenderer = makeDecoratable(\"IconPickerTabRenderer\", () => null);\n\nconst getRows = (icons: Icon[], size?: string) => {\n // Group the icons by their category.\n const groupedObjects = groupBy(icons, \"category\");\n const rows: IconPickerGridRow[] = [];\n\n // Iterate over each category in the grouped icons.\n for (const key in groupedObjects) {\n // Skip any group where the key is `undefined` (these icons will be handled separately).\n if (key !== \"undefined\") {\n const rowIcons = groupedObjects[key];\n\n // Add a row for the category name.\n rows.push({ type: \"category-name\", name: key });\n\n // Split the icons in this category into groups of COLUMN_COUNT and add them as rows.\n while (rowIcons.length) {\n rows.push({\n type: \"icons\",\n icons: rowIcons.splice(0, size === ICON_PICKER_SIZE.SMALL ? 6 : COLUMN_COUNT)\n });\n }\n }\n }\n\n // Handle icons that don't have a category (key is `undefined`).\n if (groupedObjects.undefined) {\n const rowIcons = groupedObjects.undefined;\n\n // Add a row for the `Uncategorized` category name.\n rows.push({ type: \"category-name\", name: \"Uncategorized\" });\n\n // Split these icons into groups of COLUMN_COUNT and add them as rows.\n while (rowIcons.length) {\n rows.push({\n type: \"icons\",\n icons: rowIcons.splice(0, size === ICON_PICKER_SIZE.SMALL ? 6 : COLUMN_COUNT)\n });\n }\n }\n\n return rows;\n};\n\nconst useIconTypeRows = (type: string) => {\n const presenter = useIconPicker();\n const icons = presenter.vm.icons.filter(icon => icon.type === type);\n const rows = getRows(icons, presenter.vm.size);\n\n return {\n isEmpty: rows.length === 0,\n rows,\n rowCount: rows.length\n };\n};\n\ninterface RenderRowProps {\n onIconClick: (icon: Icon) => void;\n style: Record<string, any>;\n row: IconPickerGridRow;\n cellDecorator: CellDecorator;\n}\n\nconst RowRenderer = ({ row, style, cellDecorator, onIconClick }: RenderRowProps) => {\n const presenter = useIconPicker();\n const value = presenter.vm.selectedIcon;\n\n if (row.type === \"category-name\") {\n return (\n <IconPickerRow style={style}>\n <Text size={\"sm\"} className={\"uppercase self-end text-neutral-muted mb-sm\"}>\n {row.name}\n </Text>\n </IconPickerRow>\n );\n }\n\n return (\n <IconPickerRow style={style}>\n {row.icons.map((item, itemKey) => (\n <Fragment key={itemKey}>\n {cellDecorator(\n <IconPickerCell\n key={itemKey}\n icon={item}\n isActive={item.name === value?.name}\n onIconClick={() => onIconClick(item)}\n />\n )}\n </Fragment>\n ))}\n </IconPickerRow>\n );\n};\n\ninterface CellDecorator {\n (cell: React.ReactElement): React.ReactElement;\n}\n\nconst noopDecorator: CellDecorator = cell => cell;\n\nexport interface IconPickerTabProps {\n label: string;\n value: string;\n onChange: (icon: Icon) => void;\n actions?: React.ReactElement;\n cellDecorator?: CellDecorator;\n}\n\nexport const IconPickerTab = ({\n label,\n value,\n actions,\n onChange,\n cellDecorator = noopDecorator\n}: IconPickerTabProps) => {\n const { type } = useIconType();\n const { isEmpty, rowCount, rows } = useIconTypeRows(type);\n const presenter = useIconPicker();\n const size = presenter.vm.size;\n\n return (\n <Tabs.Tab\n value={value}\n trigger={label}\n content={\n <div>\n <div className={\"flex items-center justify-center gap-sm\"}>\n <DelayedOnChange\n value={presenter.vm.filter}\n onChange={value => presenter.setFilter(value)}\n >\n {({ value, onChange }) => (\n <Input\n value={value}\n onChange={value => onChange(value as unknown as string)}\n placeholder={\"Search icons...\"}\n variant={\"secondary\"}\n size={\"md\"}\n startIcon={\n <IconComponent\n icon={<SearchIcon />}\n label={\"Search icons\"}\n />\n }\n />\n )}\n </DelayedOnChange>\n {actions ? <div>{actions}</div> : null}\n </div>\n <div className={\"relative\"}>\n {isEmpty ? (\n <div className={\"pt-md text-neutral-strong\"}>\n <Text>{\"No results found.\"}</Text>\n </div>\n ) : (\n <List\n className={\"outline-none\"}\n rowRenderer={({ key, ...props }) => (\n <RowRenderer\n key={key}\n row={rows[props.index]}\n cellDecorator={cellDecorator}\n onIconClick={onChange}\n {...props}\n />\n )}\n width={size === ICON_PICKER_SIZE.SMALL ? 232 : 312}\n height={size === ICON_PICKER_SIZE.SMALL ? 240 : 350}\n rowCount={rowCount}\n rowHeight={40}\n />\n )}\n </div>\n </div>\n }\n />\n );\n};\n"],"names":["COLUMN_COUNT","IconPickerTabRenderer","makeDecoratable","getRows","icons","size","groupedObjects","groupBy","rows","key","rowIcons","ICON_PICKER_SIZE","useIconTypeRows","type","presenter","useIconPicker","icon","RowRenderer","row","style","cellDecorator","onIconClick","value","IconPickerRow","Text","item","itemKey","Fragment","IconPickerCell","noopDecorator","cell","IconPickerTab","label","actions","onChange","useIconType","isEmpty","rowCount","Tabs","DelayedOnChange","Input","IconComponent","SearchIcon","List","props"],"mappings":";;;;;;;;;;AAcA,MAAMA,eAAe;AAEd,MAAMC,wBAAwBC,gBAAgB,yBAAyB,IAAM;AAEpF,MAAMC,UAAU,CAACC,OAAeC;IAE5B,MAAMC,iBAAiBC,QAAQH,OAAO;IACtC,MAAMI,OAA4B,EAAE;IAGpC,IAAK,MAAMC,OAAOH,eAEd,IAAIG,AAAQ,gBAARA,KAAqB;QACrB,MAAMC,WAAWJ,cAAc,CAACG,IAAI;QAGpCD,KAAK,IAAI,CAAC;YAAE,MAAM;YAAiB,MAAMC;QAAI;QAG7C,MAAOC,SAAS,MAAM,CAClBF,KAAK,IAAI,CAAC;YACN,MAAM;YACN,OAAOE,SAAS,MAAM,CAAC,GAAGL,SAASM,iBAAiB,KAAK,GAAG,IAAIX;QACpE;IAER;IAIJ,IAAIM,eAAe,SAAS,EAAE;QAC1B,MAAMI,WAAWJ,eAAe,SAAS;QAGzCE,KAAK,IAAI,CAAC;YAAE,MAAM;YAAiB,MAAM;QAAgB;QAGzD,MAAOE,SAAS,MAAM,CAClBF,KAAK,IAAI,CAAC;YACN,MAAM;YACN,OAAOE,SAAS,MAAM,CAAC,GAAGL,SAASM,iBAAiB,KAAK,GAAG,IAAIX;QACpE;IAER;IAEA,OAAOQ;AACX;AAEA,MAAMI,kBAAkB,CAACC;IACrB,MAAMC,YAAYC;IAClB,MAAMX,QAAQU,UAAU,EAAE,CAAC,KAAK,CAAC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