slice-machine-ui 1.26.1-beta.11 → 1.26.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/chunks/127-5f39b7de8178c2e4.js +1 -0
- package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad5c4eb28d4b155.js} +1 -1
- package/out/_next/static/chunks/453-4e2d00a3515202f4.js +1 -0
- package/out/_next/static/chunks/46-bd45510ac2a839b5.js +10 -0
- package/out/_next/static/chunks/614-af117b661cd3429a.js +1 -0
- package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
- package/out/_next/static/chunks/91-aa2369249805fb5a.js +1 -0
- package/out/_next/static/chunks/96-24fed6adc069e313.js +1 -0
- package/out/_next/static/chunks/pages/{_app-6177e3581af44083.js → _app-2e45ed74db68cb0a.js} +3 -3
- package/out/_next/static/chunks/pages/changelog-ac1004bdd31d17f8.js +1 -0
- package/out/_next/static/chunks/pages/changes-5c4bd80747884a8c.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-5b08515fec5e6668.js +1 -0
- package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-75e8eddec659f440.js} +1 -1
- package/out/_next/static/chunks/pages/index-16754a04037cf9c1.js +1 -0
- package/out/_next/static/chunks/pages/labs-d6f2feb6720ee64c.js +1 -0
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-41fc6d4f726fdfb9.js +1 -0
- package/out/_next/static/chunks/pages/settings-7ad1540dc0af794d.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9941e7eeb9d4d084.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8c8d4de562fca8ac.js +1 -0
- package/out/_next/static/chunks/pages/slices-801310de228fd05e.js +1 -0
- package/out/_next/static/css/17da9daaa8986410.css +1 -0
- package/out/_next/static/css/{27f2b9b9c9f65885.css → 663a1bac4ce890da.css} +1 -1
- package/out/_next/static/css/c36992b18975f9b9.css +1 -0
- package/out/_next/static/css/{243a4d347efcfd53.css → df904982b9637c1a.css} +1 -1
- package/out/_next/static/umd9mjV29cCbZplewdOPw/_buildManifest.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/sentry.client.config.ts +2 -1
- package/src/ErrorBoundary.tsx +2 -1
- package/src/apiClient.ts +12 -7
- package/src/components/Card/Card.stories.tsx +4 -3
- package/src/components/CodeBlock/CodeBlock.tsx +6 -5
- package/src/components/Count/Count.tsx +2 -1
- package/src/components/HoverCard/HoverCard.tsx +3 -2
- package/src/components/SideNav/SideNav.stories.tsx +3 -2
- package/src/components/SideNav/SideNav.tsx +3 -2
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -2
- package/src/components/Table/Table.test.tsx +4 -3
- package/src/domain/__tests__/customType.test.ts +0 -184
- package/src/domain/__tests__/group.test.ts +161 -0
- package/src/domain/__tests__/slice.test.ts +3 -2
- package/src/domain/customType.ts +0 -191
- package/src/domain/group.ts +89 -0
- package/src/domain/slice.ts +29 -12
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -1
- package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +2 -1
- package/src/features/changelog/useSliceMachineReleaseNotes.ts +2 -1
- package/src/features/changelog/useSliceMachineVersions.ts +2 -1
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +9 -8
- package/src/features/changes/PushChangesButton.tsx +5 -4
- package/src/features/changes/StatusBadge.tsx +3 -2
- package/src/features/customTypes/EditDropdown.tsx +4 -3
- package/src/features/customTypes/PageTypeOnboarding.tsx +4 -3
- package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +5 -4
- package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +5 -4
- package/src/features/customTypes/actions/convertCustomToPageType.ts +3 -2
- package/src/features/customTypes/actions/createCustomType.ts +4 -3
- package/src/features/customTypes/actions/deleteCustomType.ts +2 -1
- package/src/features/customTypes/actions/renameCustomType.ts +2 -1
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +6 -5
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +21 -17
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +7 -6
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -3
- package/src/features/customTypes/customTypesBuilder/useCustomType.ts +2 -1
- package/src/features/customTypes/customTypesConfig.ts +3 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +8 -7
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +12 -11
- package/src/features/customTypes/customTypesTable/useCustomTypes.ts +6 -5
- package/src/features/documentation/MarkdownRenderer/index.tsx +4 -3
- package/src/features/documentation/useDocumentation.ts +2 -1
- package/src/features/environments/actions/getActiveEnvironment.ts +2 -1
- package/src/features/environments/actions/getEnvironments.ts +1 -1
- package/src/features/environments/actions/setEnvironment.ts +3 -2
- package/src/features/inAppGuide/InAppGuideContext.tsx +2 -1
- package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -3
- package/src/features/inAppGuide/inAppGuideContent.tsx +2 -1
- package/src/features/labs/labsList/LabsPage.tsx +7 -6
- package/src/features/labs/labsList/useLab.tsx +2 -1
- package/src/features/settings/SettingsPage.tsx +9 -8
- package/src/features/settings/git/ConnectGitRepository.tsx +11 -10
- package/src/features/settings/git/GitOwnerSelect.tsx +2 -1
- package/src/features/settings/git/GitProvider.ts +5 -4
- package/src/features/settings/git/GitProviderConnectButtons.tsx +2 -1
- package/src/features/settings/git/GitRepositoriesList.tsx +6 -5
- package/src/features/settings/git/GitRepositoriesSearch.tsx +7 -6
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +4 -3
- package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
- package/src/features/settings/git/useGitOwners.ts +2 -1
- package/src/features/settings/git/useGitRepos.ts +2 -1
- package/src/features/settings/git/useLinkedGitRepos.ts +3 -2
- package/src/features/settings/git/useWriteAPIToken.ts +3 -2
- package/src/features/slices/actions/addSlicesToSliceZone.ts +3 -2
- package/src/features/slices/actions/createSlice.ts +5 -4
- package/src/features/slices/actions/deleteSlice.ts +2 -1
- package/src/features/slices/actions/renameSlice.ts +5 -4
- package/src/features/slices/actions/uploadSliceScreenshot.ts +3 -2
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +5 -4
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +2 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +10 -9
- package/src/features/slices/convertLegacySlice/types.ts +2 -2
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +9 -8
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +7 -6
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +7 -6
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +5 -4
- package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +1 -1
- package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +5 -4
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +9 -8
- package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +3 -2
- package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
- package/src/features/sync/AutoSyncProvider.tsx +10 -9
- package/src/features/sync/actions/pushChanges.ts +4 -3
- package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -3
- package/src/features/sync/fetchUnSyncChanges.ts +4 -4
- package/src/features/sync/getUnSyncChanges.ts +5 -5
- package/src/features/sync/useUnSyncChanges.ts +5 -4
- package/src/hooks/useAdapterName.ts +2 -1
- package/src/hooks/useAuthStatus.ts +3 -2
- package/src/hooks/useCurrentSlice.tsx +5 -4
- package/src/hooks/useEditorContent.ts +4 -3
- package/src/hooks/useExperimentVariant.ts +2 -1
- package/src/hooks/useIsEmptyProject.ts +2 -1
- package/src/hooks/useRepositoryInformation.ts +3 -2
- package/src/hooks/useSMTracker.ts +5 -4
- package/src/hooks/useScreenshotChangesModal.ts +4 -3
- package/src/hooks/useServerState.ts +4 -3
- package/src/hooks/useSliceMachineConfig.ts +2 -1
- package/src/hooks/useSliceMachineRunningVersion.ts +2 -1
- package/src/hooks/useUpdateAvailable.ts +2 -1
- package/{components → src/legacy/components}/App/index.tsx +9 -8
- package/{components → src/legacy/components}/AppLayout/index.tsx +8 -7
- package/{components → src/legacy/components}/Changelog/index.tsx +5 -4
- package/{components → src/legacy/components}/Changelog/navigation/index.tsx +5 -4
- package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +5 -4
- package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +2 -1
- package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +3 -2
- package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -13
- package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -2
- package/{components → src/legacy/components}/CodeBlock/index.tsx +2 -1
- package/{components → src/legacy/components}/ConfigErrors/index.jsx +3 -2
- package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +11 -10
- package/{components → src/legacy/components}/DeleteCTModal/index.tsx +7 -6
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +3 -2
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +6 -5
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +6 -5
- package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +7 -6
- package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -5
- package/{components → src/legacy/components}/EmptyState/index.tsx +2 -1
- package/{components → src/legacy/components}/FormFields/Input.tsx +2 -1
- package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +17 -16
- package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +8 -7
- package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +7 -6
- package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +7 -6
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -5
- package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +2 -1
- package/{components → src/legacy/components}/Forms/formsValidator.ts +4 -3
- package/{components → src/legacy/components}/ListItem/Header.tsx +2 -1
- package/{components → src/legacy/components}/ListItem/index.tsx +3 -2
- package/{components → src/legacy/components}/LoginModal/index.tsx +20 -19
- package/{components → src/legacy/components}/ModalFormCard/index.tsx +3 -2
- package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +12 -11
- package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -12
- package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +3 -2
- package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -2
- package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/VideoItem.tsx +15 -14
- package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/index.test.tsx +7 -9
- package/{components → src/legacy/components}/Navigation/index.tsx +21 -20
- package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +10 -9
- package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +7 -6
- package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +6 -5
- package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +11 -10
- package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +2 -1
- package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
- package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -6
- package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -2
- package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +3 -2
- package/{components → src/legacy/components}/Simulator/index.tsx +12 -11
- package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +2 -1
- package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -1
- package/{components → src/legacy/components}/Tooltip/index.jsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +11 -10
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +10 -9
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -2
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +23 -19
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +29 -28
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +7 -6
- package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +42 -49
- package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/index.tsx +13 -12
- package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +15 -11
- package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +9 -8
- package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +12 -8
- package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +4 -3
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +14 -10
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +7 -3
- package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +7 -9
- package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +2 -1
- package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
- package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/Slice.ts +17 -3
- package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +3 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +62 -67
- package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +5 -4
- package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -5
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -4
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +7 -6
- package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +2 -1
- package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
- package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
- package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
- package/{lib → src/legacy/lib}/models/server/ServerState.ts +2 -2
- package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
- package/src/modules/availableCustomTypes/index.ts +10 -9
- package/src/modules/availableCustomTypes/types.ts +2 -2
- package/src/modules/environment/index.ts +7 -6
- package/src/modules/environment/types.ts +1 -1
- package/src/modules/modal/index.ts +2 -1
- package/src/modules/slices/index.ts +12 -8
- package/src/modules/slices/selector.ts +1 -1
- package/src/modules/slices/types.ts +2 -2
- package/src/modules/useSliceMachineActions.ts +10 -6
- package/src/modules/userContext/index.ts +6 -5
- package/{pages → src/pages}/_app.tsx +22 -22
- package/{pages → src/pages}/changelog.tsx +2 -1
- package/{pages → src/pages}/changes.tsx +25 -21
- package/src/pages/custom-types/[customTypeId].tsx +1 -0
- package/{pages → src/pages}/custom-types.tsx +2 -1
- package/{pages → src/pages}/index.tsx +4 -3
- package/src/pages/labs.tsx +1 -0
- package/src/pages/page-types/[pageTypeId].tsx +1 -0
- package/src/pages/settings.tsx +1 -0
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +4 -3
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +3 -2
- package/{pages → src/pages}/slices.tsx +24 -23
- package/src/redux/reducer.ts +7 -6
- package/src/redux/store.ts +2 -1
- package/src/redux/type.ts +7 -6
- package/src/utils/getContentTypeForTracking.ts +21 -0
- package/test/__setup__.ts +10 -8
- package/test/__testutils__/createTestPlugin.ts +3 -2
- package/test/__testutils__/createTestProject.ts +5 -4
- package/test/__testutils__/index.tsx +6 -5
- package/test/__testutils__/mockAWSACLAPI.ts +1 -1
- package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
- package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
- package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
- package/test/__testutils__/readMSWFormData.ts +1 -1
- package/test/components/IframeRenderer.test.ts +3 -2
- package/test/lib/builders/EditModal.test.tsx +5 -3
- package/test/lib/builders/buildersUtils.test.ts +3 -3
- package/test/lib/consts.test.ts +6 -2
- package/test/lib/models/common/CustomType.test.ts +6 -2
- package/test/lib/models/common/ModelStatus.test.ts +6 -4
- package/test/lib/models/common/Slice.test.ts +3 -2
- package/test/lib/models/common/widgets/index.test.ts +8 -4
- package/test/lib/utils/index.test.ts +3 -2
- package/test/lib/utils/preferWroomBase.test.ts +3 -2
- package/test/lib/utils/shared/customTypes.test.ts +2 -1
- package/test/pages/slices.test.tsx +10 -10
- package/test/src/modules/__fixtures__/serverState.ts +1 -1
- package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
- package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
- package/test/src/modules/environment.test.ts +3 -5
- package/test/src/modules/loading.test.ts +3 -3
- package/test/src/modules/modal.test.ts +5 -5
- package/test/src/modules/slices.test.ts +3 -2
- package/test/src/modules/userContext.test.ts +3 -3
- package/test/src/normalizers/customType.test.ts +16 -3
- package/test/src/utils/fieldNameCreator.test.ts +1 -1
- package/tsconfig.json +1 -6
- package/vite.config.ts +1 -7
- package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
- package/lib/models/common/widgets/withGroup.ts +0 -19
- package/out/_next/static/6WrgMw0SELcypoJCYNiKd/_buildManifest.js +0 -1
- package/out/_next/static/chunks/25-607d5cfe6492f4e8.js +0 -1
- package/out/_next/static/chunks/286-6ee80333008646b9.js +0 -1
- package/out/_next/static/chunks/318-c84322cba57be932.js +0 -1
- package/out/_next/static/chunks/382-8194eab141c7ea2f.js +0 -1
- package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
- package/out/_next/static/chunks/727-b53258380c1a11f1.js +0 -1
- package/out/_next/static/chunks/799-68887319f3169f78.js +0 -1
- package/out/_next/static/chunks/pages/changelog-2d061c06b2b82e28.js +0 -1
- package/out/_next/static/chunks/pages/changes-cde59d56dc849106.js +0 -1
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-89ccb93ce7409ad0.js +0 -1
- package/out/_next/static/chunks/pages/index-b5817351a77c6d40.js +0 -1
- package/out/_next/static/chunks/pages/labs-0fc7d01b8c9bfc2a.js +0 -1
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-dbf86fe3a94dc892.js +0 -1
- package/out/_next/static/chunks/pages/settings-897ad13a08f73048.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js +0 -1
- package/out/_next/static/chunks/pages/slices-391f6c4b30af0759.js +0 -1
- package/out/_next/static/css/0e0d6c4ec6bf7373.css +0 -1
- package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
- package/pages/custom-types/[customTypeId].tsx +0 -1
- package/pages/labs.tsx +0 -1
- package/pages/page-types/[pageTypeId].tsx +0 -1
- package/pages/settings.tsx +0 -1
- /package/out/_next/static/{6WrgMw0SELcypoJCYNiKd → umd9mjV29cCbZplewdOPw}/_ssgManifest.js +0 -0
- /package/{components → src/legacy/components}/AuthInstructions/index.jsx +0 -0
- /package/{components → src/legacy/components}/Button/index.tsx +0 -0
- /package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
- /package/{components → src/legacy/components}/Card/Default.jsx +0 -0
- /package/{components → src/legacy/components}/Card/Preview.jsx +0 -0
- /package/{components → src/legacy/components}/Card/WithTabs/components.jsx +0 -0
- /package/{components → src/legacy/components}/Card/WithTabs/index.jsx +0 -0
- /package/{components → src/legacy/components}/Card/index.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesEmptyState/index.ts +0 -0
- /package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
- /package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
- /package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +0 -0
- /package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
- /package/{components → src/legacy/components}/DropDownSelector/index.tsx +0 -0
- /package/{components → src/legacy/components}/Flex/index.tsx +0 -0
- /package/{components → src/legacy/components}/FormFields/Array.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/Checkbox.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.module.css +0 -0
- /package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/components/InputBox.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
- /package/{components → src/legacy/components}/FullPage/index.tsx +0 -0
- /package/{components → src/legacy/components}/Grid/index.tsx +0 -0
- /package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +0 -0
- /package/{components → src/legacy/components}/ItemHeader/index.tsx +0 -0
- /package/{components → src/legacy/components}/Li/index.tsx +0 -0
- /package/{components → src/legacy/components}/ListItem/utils.js +0 -0
- /package/{components → src/legacy/components}/LoadingPage/index.tsx +0 -0
- /package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
- /package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
- /package/{components → src/legacy/components}/Navigation/index.module.css +0 -0
- /package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
- /package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +0 -0
- /package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
- /package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +0 -0
- /package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
- /package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
- /package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +0 -0
- /package/{components → src/legacy/components}/SliceMachineModal/index.tsx +0 -0
- /package/{components → src/legacy/components}/ToasterContainer/index.tsx +0 -0
- /package/{components → src/legacy/components}/Warnings/index.jsx +0 -0
- /package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
- /package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
- /package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/Zone/components/EmptyState/index.tsx +0 -0
- /package/{lib → src/legacy/lib}/consts.ts +0 -0
- /package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/defaults.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/fields.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/index.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/types.ts +0 -0
- /package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Environment.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Fields.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Group.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Library.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Slices.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/index.ts +0 -0
- /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/index.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
- /package/{pages → src/pages}/api/embed.js +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
|
|
3
|
-
import { describe, test, afterEach, beforeEach, expect, vi } from "vitest";
|
|
4
|
-
import mockRouter from "next-router-mock";
|
|
5
3
|
import { Analytics } from "@segment/analytics-node";
|
|
4
|
+
import { createSliceMachineManager } from "@slicemachine/manager";
|
|
5
|
+
import { createSliceMachineManagerMSWHandler } from "@slicemachine/manager/test";
|
|
6
|
+
import mockRouter from "next-router-mock";
|
|
7
|
+
import { createTestPlugin } from "../__testutils__/createTestPlugin";
|
|
8
|
+
import { createTestProject } from "../__testutils__/createTestProject";
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
6
10
|
|
|
7
|
-
import
|
|
8
|
-
import SlicesIndex from "../../pages/slices";
|
|
11
|
+
import SlicesIndex from "@/pages/slices";
|
|
9
12
|
|
|
13
|
+
import pkg from "../../package.json";
|
|
10
14
|
import {
|
|
11
|
-
render,
|
|
12
|
-
fireEvent,
|
|
13
15
|
act,
|
|
16
|
+
fireEvent,
|
|
17
|
+
render,
|
|
14
18
|
screen,
|
|
15
19
|
waitFor,
|
|
16
20
|
within,
|
|
17
21
|
} from "../__testutils__";
|
|
18
|
-
import { createTestPlugin } from "test/__testutils__/createTestPlugin";
|
|
19
|
-
import { createTestProject } from "test/__testutils__/createTestProject";
|
|
20
|
-
import { createSliceMachineManager } from "@slicemachine/manager";
|
|
21
|
-
import { createSliceMachineManagerMSWHandler } from "@slicemachine/manager/test";
|
|
22
22
|
|
|
23
23
|
vi.mock("next/router", () => import("next-router-mock"));
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentUI } from "
|
|
2
|
-
import { LibraryUI } from "
|
|
3
|
-
import { SliceSM } from "
|
|
1
|
+
import { ComponentUI } from "@/legacy/lib/models/common/ComponentUI";
|
|
2
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
3
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
4
4
|
|
|
5
5
|
const DEFAULT_SLICE_SM: SliceSM = {
|
|
6
6
|
id: "blog_section_three_column_cards",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
|
-
import { availableCustomTypesReducer } from "
|
|
4
|
-
import { AvailableCustomTypesStoreType } from "
|
|
5
|
-
import { refreshStateCreator } from "
|
|
3
|
+
import { availableCustomTypesReducer } from "@/modules/availableCustomTypes";
|
|
4
|
+
import { AvailableCustomTypesStoreType } from "@/modules/availableCustomTypes/types";
|
|
5
|
+
import { refreshStateCreator } from "@/modules/environment";
|
|
6
6
|
|
|
7
7
|
import { dummyServerState } from "../__fixtures__/serverState";
|
|
8
8
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "@src/modules/environment";
|
|
7
|
-
import { EnvironmentStoreType } from "@src/modules/environment/types";
|
|
3
|
+
import { environmentReducer, refreshStateCreator } from "@/modules/environment";
|
|
4
|
+
import { EnvironmentStoreType } from "@/modules/environment/types";
|
|
5
|
+
|
|
8
6
|
import { dummyServerState } from "./__fixtures__/serverState";
|
|
9
7
|
|
|
10
8
|
const dummyEnvironmentState: EnvironmentStoreType = dummyServerState.env;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
initialState,
|
|
4
5
|
loadingReducer,
|
|
5
6
|
startLoadingActionCreator,
|
|
6
7
|
stopLoadingActionCreator,
|
|
7
|
-
} from "
|
|
8
|
-
import { LoadingKeysEnum, LoadingStoreType } from "
|
|
9
|
-
import { initialState } from "@src/modules/loading";
|
|
8
|
+
} from "@/modules/loading";
|
|
9
|
+
import { LoadingKeysEnum, LoadingStoreType } from "@/modules/loading/types";
|
|
10
10
|
|
|
11
11
|
const dummyLoadingState: LoadingStoreType = initialState;
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
modalReducer,
|
|
5
|
-
modalOpenCreator,
|
|
6
|
-
modalCloseCreator,
|
|
7
4
|
initialState as modalInitialState,
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
modalCloseCreator,
|
|
6
|
+
modalOpenCreator,
|
|
7
|
+
modalReducer,
|
|
8
|
+
} from "@/modules/modal";
|
|
9
|
+
import { ModalKeysEnum, ModalStoreType } from "@/modules/modal/types";
|
|
10
10
|
|
|
11
11
|
describe("[Modal module]", () => {
|
|
12
12
|
describe("[Reducer]", () => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from "vitest";
|
|
4
|
-
|
|
5
|
-
import {
|
|
4
|
+
|
|
5
|
+
import { slicesReducer } from "@/modules/slices";
|
|
6
|
+
import { SlicesStoreType } from "@/modules/slices/types";
|
|
6
7
|
|
|
7
8
|
const dummySlicesState: SlicesStoreType = {
|
|
8
9
|
libraries: [],
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
userContextReducer,
|
|
5
4
|
sendAReviewCreator,
|
|
6
5
|
skipReviewCreator,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
userContextReducer,
|
|
7
|
+
} from "@/modules/userContext";
|
|
8
|
+
import { UserContextStoreType } from "@/modules/userContext/types";
|
|
9
9
|
|
|
10
10
|
describe("[UserContext module]", () => {
|
|
11
11
|
describe("[Reducer]", () => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { CustomTypeSM } from "@slicemachine/core/build/models/CustomType";
|
|
1
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
3
2
|
import {
|
|
4
3
|
normalizeFrontendCustomType,
|
|
5
4
|
normalizeFrontendCustomTypes,
|
|
6
|
-
} from "
|
|
5
|
+
} from "@/legacy/lib/models/common/normalizers/customType";
|
|
7
6
|
|
|
8
7
|
describe("Normalizer - CustomType", () => {
|
|
9
8
|
describe("normalizeFrontendCustomTypes", () => {
|
|
@@ -14,6 +13,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
14
13
|
label: "lama",
|
|
15
14
|
repeatable: false,
|
|
16
15
|
status: true,
|
|
16
|
+
format: "custom",
|
|
17
17
|
tabs: [
|
|
18
18
|
{
|
|
19
19
|
key: "Main",
|
|
@@ -26,6 +26,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
26
26
|
label: "lama",
|
|
27
27
|
repeatable: false,
|
|
28
28
|
status: true,
|
|
29
|
+
format: "custom",
|
|
29
30
|
tabs: [
|
|
30
31
|
{
|
|
31
32
|
key: "Main",
|
|
@@ -40,6 +41,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
40
41
|
label: "lama",
|
|
41
42
|
repeatable: false,
|
|
42
43
|
status: true,
|
|
44
|
+
format: "custom",
|
|
43
45
|
tabs: [
|
|
44
46
|
{
|
|
45
47
|
key: "Main",
|
|
@@ -52,6 +54,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
52
54
|
label: "lama",
|
|
53
55
|
repeatable: false,
|
|
54
56
|
status: true,
|
|
57
|
+
format: "custom",
|
|
55
58
|
tabs: [
|
|
56
59
|
{
|
|
57
60
|
key: "Main",
|
|
@@ -70,6 +73,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
70
73
|
label: "lama",
|
|
71
74
|
repeatable: false,
|
|
72
75
|
status: true,
|
|
76
|
+
format: "custom",
|
|
73
77
|
tabs: [
|
|
74
78
|
{
|
|
75
79
|
key: "Main",
|
|
@@ -82,6 +86,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
82
86
|
label: "lama",
|
|
83
87
|
repeatable: false,
|
|
84
88
|
status: true,
|
|
89
|
+
format: "custom",
|
|
85
90
|
tabs: [
|
|
86
91
|
{
|
|
87
92
|
key: "Main",
|
|
@@ -96,6 +101,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
96
101
|
label: "lama",
|
|
97
102
|
repeatable: false,
|
|
98
103
|
status: true,
|
|
104
|
+
format: "custom",
|
|
99
105
|
tabs: [
|
|
100
106
|
{
|
|
101
107
|
key: "Main",
|
|
@@ -108,6 +114,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
108
114
|
label: "lama",
|
|
109
115
|
repeatable: false,
|
|
110
116
|
status: true,
|
|
117
|
+
format: "custom",
|
|
111
118
|
tabs: [
|
|
112
119
|
{
|
|
113
120
|
key: "Main",
|
|
@@ -126,6 +133,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
126
133
|
label: "lama",
|
|
127
134
|
repeatable: false,
|
|
128
135
|
status: true,
|
|
136
|
+
format: "custom",
|
|
129
137
|
tabs: [
|
|
130
138
|
{
|
|
131
139
|
key: "Main",
|
|
@@ -154,6 +162,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
154
162
|
label: "lama",
|
|
155
163
|
repeatable: false,
|
|
156
164
|
status: true,
|
|
165
|
+
format: "custom",
|
|
157
166
|
tabs: [
|
|
158
167
|
{
|
|
159
168
|
key: "Main",
|
|
@@ -167,6 +176,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
167
176
|
label: "lama",
|
|
168
177
|
repeatable: false,
|
|
169
178
|
status: true,
|
|
179
|
+
format: "custom",
|
|
170
180
|
tabs: [
|
|
171
181
|
{
|
|
172
182
|
key: "Main",
|
|
@@ -184,6 +194,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
184
194
|
label: "lama",
|
|
185
195
|
repeatable: false,
|
|
186
196
|
status: true,
|
|
197
|
+
format: "custom",
|
|
187
198
|
tabs: [
|
|
188
199
|
{
|
|
189
200
|
key: "Main",
|
|
@@ -196,6 +207,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
196
207
|
label: "lama",
|
|
197
208
|
repeatable: false,
|
|
198
209
|
status: true,
|
|
210
|
+
format: "custom",
|
|
199
211
|
tabs: [
|
|
200
212
|
{
|
|
201
213
|
key: "Main",
|
|
@@ -213,6 +225,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
213
225
|
label: "lama",
|
|
214
226
|
repeatable: false,
|
|
215
227
|
status: true,
|
|
228
|
+
format: "custom",
|
|
216
229
|
tabs: [
|
|
217
230
|
{
|
|
218
231
|
key: "Main",
|
package/tsconfig.json
CHANGED
|
@@ -24,12 +24,7 @@
|
|
|
24
24
|
"jsx": "preserve",
|
|
25
25
|
"outDir": "./build",
|
|
26
26
|
"paths": {
|
|
27
|
-
"
|
|
28
|
-
"@components/*": ["components/*"],
|
|
29
|
-
"@lib/*": ["lib/*"],
|
|
30
|
-
"@models/*": ["lib/models/*"],
|
|
31
|
-
"@src/*": ["src/*"],
|
|
32
|
-
"@utils/*": ["lib/utils/*"]
|
|
27
|
+
"@/*": ["./src/*"]
|
|
33
28
|
},
|
|
34
29
|
"incremental": true
|
|
35
30
|
},
|
package/vite.config.ts
CHANGED
|
@@ -11,13 +11,7 @@ export default defineConfig({
|
|
|
11
11
|
plugins: [react(), vanillaExtractPlugin()],
|
|
12
12
|
resolve: {
|
|
13
13
|
alias: {
|
|
14
|
-
"@
|
|
15
|
-
"@components": path.resolve(__dirname, "./components"),
|
|
16
|
-
"@lib": path.resolve(__dirname, "./lib"),
|
|
17
|
-
"@models": path.resolve(__dirname, "./lib/models"),
|
|
18
|
-
"@src": path.resolve(__dirname, "./src"),
|
|
19
|
-
"@utils": path.resolve(__dirname, "./lib/utils"),
|
|
20
|
-
test: path.resolve(__dirname, "./test"),
|
|
14
|
+
"@": path.resolve(__dirname, "./src"),
|
|
21
15
|
},
|
|
22
16
|
},
|
|
23
17
|
test: {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BooleanWidget } from "./Boolean";
|
|
2
|
-
import { ColorWidget } from "./Color";
|
|
3
|
-
import { ContentRelationshipWidget } from "./ContentRelationship";
|
|
4
|
-
import { DateWidget } from "./Date";
|
|
5
|
-
import { EmbedWidget } from "./Embed";
|
|
6
|
-
import { GeoPointWidget } from "./GeoPoint";
|
|
7
|
-
import { ImageWidget } from "./Image";
|
|
8
|
-
import { LinkWidget } from "./Link";
|
|
9
|
-
import { LinkToMediaWidget } from "./LinkToMedia";
|
|
10
|
-
import { NumberWidget } from "./Number";
|
|
11
|
-
import { SelectWidget } from "./Select";
|
|
12
|
-
import { StructuredTextWidget } from "./StructuredText";
|
|
13
|
-
import { TextWidget } from "./Text";
|
|
14
|
-
import { TimestampWidget } from "./Timestamp";
|
|
15
|
-
|
|
16
|
-
export default [
|
|
17
|
-
StructuredTextWidget,
|
|
18
|
-
ImageWidget,
|
|
19
|
-
LinkWidget,
|
|
20
|
-
LinkToMediaWidget,
|
|
21
|
-
ContentRelationshipWidget,
|
|
22
|
-
SelectWidget,
|
|
23
|
-
BooleanWidget,
|
|
24
|
-
DateWidget,
|
|
25
|
-
TimestampWidget,
|
|
26
|
-
EmbedWidget,
|
|
27
|
-
NumberWidget,
|
|
28
|
-
GeoPointWidget,
|
|
29
|
-
ColorWidget,
|
|
30
|
-
TextWidget,
|
|
31
|
-
];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { Color } from ".";
|
|
2
|
-
export { ContentRelationship } from ".";
|
|
3
|
-
export { Date } from ".";
|
|
4
|
-
export { Embed } from ".";
|
|
5
|
-
export { GeoPoint } from ".";
|
|
6
|
-
export { Image } from ".";
|
|
7
|
-
export { Link } from ".";
|
|
8
|
-
export { LinkToMedia } from ".";
|
|
9
|
-
export { Number } from ".";
|
|
10
|
-
export { Select } from ".";
|
|
11
|
-
export { StructuredText } from ".";
|
|
12
|
-
export { Text } from ".";
|
|
13
|
-
export { Timestamp } from ".";
|
|
14
|
-
export { UID } from ".";
|
|
15
|
-
export { Boolean } from "./";
|
|
16
|
-
export { GroupWidget as Group } from "./Group";
|
|
17
|
-
|
|
18
|
-
export const SharedSlice = null;
|
|
19
|
-
export const SliceZone = null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,n,d,f,u,h,l,k,j,p,g,o,r){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-b5817351a77c6d40.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":[s,e,"static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-2d061c06b2b82e28.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-5bb55fb464e34768.js",c,n,"static/css/0e0d6c4ec6bf7373.css","static/chunks/pages/changes-cde59d56dc849106.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-3c8e721ec6802127.js"],"/custom-types/[customTypeId]":[s,d,f,u,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-89ccb93ce7409ad0.js"],"/labs":["static/chunks/pages/labs-0fc7d01b8c9bfc2a.js"],"/page-types/[pageTypeId]":[s,d,f,u,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-dbf86fe3a94dc892.js"],"/settings":["static/css/ca32882a5d2d8d88.css","static/chunks/pages/settings-897ad13a08f73048.js"],"/slices":[s,t,b,c,n,"static/css/f8eb526e10bc2441.css","static/chunks/pages/slices-391f6c4b30af0759.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,d,f,u,h,e,b,i,l,c,k,n,"static/css/27f2b9b9c9f65885.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-a5a5d48f20a7b261.js","static/chunks/46-d22d7a121254e31d.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-7a3b5554b806349f.js","static/chunks/25-607d5cfe6492f4e8.js","static/chunks/799-68887319f3169f78.js","static/chunks/183-ebd633fed7c74545.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/543-f8766685f7f451e2.js","static/chunks/50-cfc2514205b86001.js","static/chunks/286-6ee80333008646b9.js","static/chunks/f36c6662-03bb5e9d9aa0b0aa.js","static/chunks/4c744e84-e3161d754618373f.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-2c5b6c0367fcde86.js","static/chunks/696-b992b9e1ce75777e.js","static/chunks/318-c84322cba57be932.js","static/chunks/727-b53258380c1a11f1.js","static/css/70e3649c6ba13fdc.css","static/chunks/210-aee6116139329803.js","static/chunks/382-8194eab141c7ea2f.js","static/css/6e65ff596e3b465e.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{54132:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var o=t(62230),i=t(85244),r=t(98240),c=t(52322);t(2784);var d=t(75289),s=function(e){var n=e.bg,t=e.background,i=e.sx,r=e.withRadius,s=e.radius,a=e.children;return(0,c.jsx)(d.xu,{sx:(0,o.Z)({p:4,bg:n||t},r?{borderBottomLeftRadius:s,borderBottomRightRadius:s}:null,i),children:a})},a=function(e){var n=e.Header,t=void 0===n?null:n,a=e.SubHeader,l=void 0===a?null:a,u=e.Body,h=void 0===u?null:u,v=e.Footer,m=void 0===v?null:v,f=e.borderFooter,b=e.radius,_=void 0===b?"6px":b,p=e.bodySx,x=e.footerSx,g=e.sx,C=e.bg,j=e.background,Z=e.children,k=(0,r.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,c.jsxs)(d.Zb,(0,i.Z)((0,o.Z)({sx:(0,o.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:_},void 0===g?null:g)},k),{children:[t?(0,c.jsx)(t,{radius:_}):null,l?(0,c.jsx)(l,{radius:_}):null,(0,c.jsxs)(s,{bg:C,background:j,sx:void 0===p?{}:p,withRadius:!m,children:[h?(0,c.jsx)(h,{}):null,Z||null]}),m?(0,c.jsx)(s,{bg:C,background:j,sx:(0,o.Z)({},void 0!==f&&f?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===x?{}:x),radius:_,withRadius:!0,children:"object"==typeof m?m:(0,c.jsx)(m,{})}):null]}))}},75329:function(e,n,t){"use strict";t.d(n,{Sn:function(){return d},lS:function(){return o},nG:function(){return i},pq:function(){return s},rd:function(){return c},xo:function(){return r}});var o=["components"],i=["png","jpg","jpeg"],r=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,c="placeholders/What_are_Slices_mrvome",d="SM_HELP_VIDEOS/mock_data",s="slice-machine-simulator"},24804:function(e,n,t){"use strict";t.d(n,{Zb:function(){return b},T$:function(){return p},eW:function(){return x},ZB:function(){return _},Lm:function(){return g}});var o=t(67557),i=t(62230),r=t(85244),c=t(98240),d=t(52322),s=t(50002),a=t(22715),l=t(6277),u=t(2784);t(71457);var h={solid:"_1ecs97d3c _1ecs97dap _1ecs97d4pk _1ecs97d4wx",outlined:"_1ecs97d2i _1ecs97d9v _1ecs97dw _1ecs97d89 _1ecs97d2w _1ecs97da9 _1ecs97d4oq _1ecs97d4w3 _1ecs97d4oc _1ecs97d4vp"},v={div:"_1ecs97dez0 _1ecs97dez3 _1ecs97dezd",img:"kedahr9 _1ecs97df77 _1ecs97dezn"},m={small:"kedahr2",medium:"kedahr3"},f={solid:"kedahr4 _1ecs97d1u _1ecs97d97 _1ecs97d4pe _1ecs97d4wr",outlined:"kedahr5 _1ecs97d18 _1ecs97d8l _1ecs97d4o6 _1ecs97d4vj"},b=function(e){var n,t=e.checked,a=e.size,v=e.variant,b=void 0===v?"solid":v,_=(e.interactive,e.disabled,e.onClick,e.href,e.component),p=void 0===_?"a":_,x=(e.replace,(0,c.Z)(e,["checked","size","variant","interactive","disabled","onClick","href","component","replace"])),g=(0,r.Z)((0,i.Z)({},x),{className:(0,l.W)("_1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dez1 _1ecs97dezr _1ecs97dezv",m[void 0===a?"medium":a],f[b],(n={},(0,o.Z)(n,"kedahr6",e.interactive),(0,o.Z)(n,h[b],e.interactive),n)),"data-state":!0===(void 0!==t&&t)?"checked":void 0});return!0===e.interactive&&void 0===e.href?(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},g),{"data-disabled":!0===e.disabled?"":void 0,onClick:function(n){if(!0!==e.disabled&&void 0!==e.onClick){var t=n.target;(0,s.JY)(t)===n.currentTarget&&e.onClick(n)}},tabIndex:!0===e.disabled?void 0:0})):!0===e.interactive?(0,u.createElement)(p,(0,i.Z)((0,r.Z)((0,i.Z)({},g),{href:e.href,onClick:function(e){var n=e.target;(0,s.JY)(n)!==e.currentTarget&&e.preventDefault()}}),"a"===p?{}:{replace:e.replace})):(0,d.jsx)("div",(0,i.Z)({},g))},_=function(e){var n=e.className,t=e.component,o=void 0===t?"img":t,s=e.overlay,a=(0,c.Z)(e,["className","component","overlay"]);return(0,d.jsxs)("div",{className:"kedahr7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df7d _1ecs97dezv",children:[(0,u.createElement)(o,(0,r.Z)((0,i.Z)({},a),{className:(0,l.W)(v[o],n)})),Boolean(s)?(0,d.jsx)("div",{className:"kedahra _1ecs97dez0 _1ecs97dez3 _1ecs97df9d _1ecs97dezt _1ecs97df0i",children:s}):void 0]})},p=function(e){return(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"kedahrc kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df71 _1ecs97dezi"}))},x=function(e){var n=e.action,t=e.subtitle,o=e.title,s=(0,c.Z)(e,["action","subtitle","title"]);return(0,d.jsxs)("div",(0,r.Z)((0,i.Z)({},s),{className:"kedahrd kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df92 _1ecs97df73",children:[(0,d.jsxs)("div",{className:"kedahre _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df51",children:[(0,d.jsx)(a.xv,{component:"span",noWrap:!0,variant:"bold",children:o}),(0,d.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",children:t})]}),n]}))},g=function(e){var n=e.children,t=(0,c.Z)(e,["children"]);return(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},t),{className:"kedahrf _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97df6v _1ecs97dfb5 _1ecs97dezh _1ecs97dfhi _1ecs97dezt",children:(0,d.jsx)(a.xv,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:n})}))}},34728:function(e,n,t){"use strict";t.d(n,{O:function(){return d}});var o=t(52322),i=t(32681),r=t(22715),c=t(79096),d=function(e){var n=function(e){var n=s[e.modelType];switch(e.modelStatus){case i.GJ.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(n," exists only locally. Upon sync, it will be pushed to your remote repository.")};case i.GJ.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(n," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case i.GJ.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(n," is in sync with the remote repository.")};case i.GJ.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(n," has been deleted locally.")};case i.GJ.Unknown:if(!e.isOnline)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (no internet connection)."};if(e.authStatus===c.t.UNAUTHORIZED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};if(e.authStatus===c.t.FORBIDDEN)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (you don't have access to the repository)."};default:return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (unknown error)."}}}(e),t=n.badgeColor,d=n.badgeTitle,a=n.tooltipContent;return(0,o.jsx)(r.u,{content:a,side:"bottom",children:(0,o.jsx)(r.Ct,{color:t,title:d})})},s={CustomType:"type",Slice:"slice"}},71749:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var o=t(62230),i=t(85244),r=t(52322),c=t(67557),d=t(17064),s={build:function(e){var n;return(0,i.Z)((0,o.Z)({},e),{screenshots:(n=e.screenshots)?Object.entries(n).reduce(function(e,n){var t,r=(0,d.Z)(n,2),s=r[0],a=r[1];return a.hash?(0,i.Z)((0,o.Z)({},e),(0,c.Z)({},s,(0,o.Z)({},a,{hash:a.hash}))):e},{}):{}})},variation:function(e,n){if(e.model.variations.length)return n?e.model.variations.find(function(e){return e.id===n}):e.model.variations[0]}},a=t(22715),l=t(24804),u=t(5479),h=t(34728),v=t(49451),m=function(e){return(0,r.jsx)("svg",(0,i.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.5C4 4.67157 4.67157 4 5.5 4H18.5C19.3284 4 20 4.67157 20 5.5V12.4413C20 12.4512 19.9997 12.461 19.9991 12.4707C20.0072 12.6083 19.9586 12.7485 19.8536 12.8536C19.6583 13.0488 19.3417 13.0488 19.1464 12.8536L16.3536 10.0607C16.1583 9.8654 15.8417 9.8654 15.6464 10.0607L11.8536 13.8536C11.6583 14.0488 11.3417 14.0488 11.1464 13.8536L9.35355 12.0607C9.15829 11.8654 8.84171 11.8654 8.64645 12.0607L5 15.7071V18.5C5 18.7761 5.22386 19 5.5 19H12.5C12.7761 19 13 19.2239 13 19.5C13 19.7761 12.7761 20 12.5 20H5.5C4.67157 20 4 19.3284 4 18.5V15.5003V15.4997V5.5ZM11.5 12.7929L14.9393 9.35355C15.5251 8.76777 16.4749 8.76777 17.0607 9.35355L19 11.2929V5.5C19 5.22386 18.7761 5 18.5 5H5.5C5.22386 5 5 5.22386 5 5.5V14.2929L7.93934 11.3536C8.52513 10.7678 9.47487 10.7678 10.0607 11.3536L11.5 12.7929ZM16.5 13C16.7761 13 17 13.2239 17 13.5V16H19.5C19.7761 16 20 16.2239 20 16.5C20 16.7761 19.7761 17 19.5 17H17V19.5C17 19.7761 16.7761 20 16.5 20C16.2239 20 16 19.7761 16 19.5V17H13.5C13.2239 17 13 16.7761 13 16.5C13 16.2239 13.2239 16 13.5 16H16V13.5C16 13.2239 16.2239 13 16.5 13Z",fill:"currentColor"})}))},f=t(39097),b=t.n(f),_=function(e){var n,t=e.action,c=e.isComingSoon,d=void 0!==c&&c,f=e.isDeleted,_=e.onUpdateScreenshot,g=e.selected,C=void 0!==g&&g,j=e.slice,Z=e.variant,k=e.variationId,y=s.variation(j,k);if(!y)return null;var z=(0,u.d7)(j,y),S=d||void 0!==f&&f,w=!S&&!!_,T="outlined"===Z,N=void 0!==k;return n="selection"===e.mode?{disabled:S,interactive:!0,onClick:function(){e.onSelectedChange(!C)}}:S?{interactive:!1}:{component:b(),href:v.Y.getBuilderPagePathname({libraryName:j.href,sliceName:j.model.name,variationId:y.id}),interactive:!0,replace:e.replace},(0,r.jsxs)(l.Zb,(0,i.Z)((0,o.Z)({"aria-label":"".concat(j.model.name," ").concat(y.name," slice card"),checked:C,"data-testid":"shared-slice-card"},n,"outlined"===Z?{size:"small",variant:"outlined"}:{}),{children:[void 0!==z?(0,r.jsx)(l.ZB,{alt:"Preview image",overlay:w&&!T?(0,r.jsx)(a.xu,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(p,{onClick:_})}):void 0,src:z}):(0,r.jsx)(l.ZB,{component:"div",children:(0,r.jsxs)(a.xu,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,r.jsx)(a.xv,{color:"grey11",component:"span",children:"No screenshot available"}),w&&!T?(0,r.jsx)(p,{onClick:_}):void 0]})}),(0,r.jsx)(l.eW,{action:"checkbox"===t.type&&"selection"===e.mode?(0,r.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(a.XZ,{checked:C,disabled:S,onCheckedChange:e.onSelectedChange})}):"menu"===t.type?(0,r.jsxs)(a.h_,{modal:!0,children:[(0,r.jsx)(a.$F,{disabled:S,children:(0,r.jsx)(a.hU,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,r.jsxs)(a.AW,{align:"end","data-testid":"slice-action-icon-dropdown",children:[w&&T?(0,r.jsx)(a.Xi,{onSelect:_,startIcon:(0,r.jsx)(m,{}),children:"Update screenshot"}):void 0,(0,r.jsx)(a.Xi,{onSelect:t.onRename,startIcon:(0,r.jsx)(a.I5,{name:"edit"}),children:"Rename"}),!0===t.removeDisabled&&N?(0,r.jsx)(a.u,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,r.jsx)(x,{disabled:!0,onSelect:t.onRemove})}):(0,r.jsx)(x,{disabled:!0===t.removeDisabled,onSelect:t.onRemove})]})]}):"remove"===t.type?(0,r.jsx)(a.hU,{icon:"close",onClick:function(){return!S&&t.onRemove()},hiddenLabel:"Remove slice"}):"status"===t.type?(0,r.jsx)(h.O,{authStatus:t.authStatus,isOnline:t.isOnline,modelStatus:t.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,r.jsxs)(r.Fragment,{children:[N?y.id:"".concat(j.model.variations.length," variation").concat(j.model.variations.length>1?"s":""),d?(0,r.jsxs)(a.xv,{color:"purple11",component:"span",variant:"small",children:[" ","• (coming soon)"]}):void 0]}),title:N?y.name:j.model.name}),w&&!N&&(0,u.cx)(j)>0?(0,r.jsx)(l.Lm,{children:"Missing screenshot"}):void 0]}))},p=function(e){return(0,r.jsx)(a.zx,{onClick:e.onClick,renderStartIcon:function(){return(0,r.jsx)(m,{color:a.TV.color.greyLight11})},color:"grey",children:"Update screenshot"})},x=function(e){return(0,r.jsx)(a.Xi,(0,i.Z)((0,o.Z)({},e),{color:"tomato",startIcon:(0,r.jsx)(a.I5,{name:"delete"}),children:"Delete"}))}},49451:function(e,n,t){"use strict";t.d(n,{Y:function(){return o}});var o={getBuilderPagePathname:function(e){return"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}}},71457:function(){}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[286],{15836:function(e,n,r){"use strict";r.d(n,{Z:function(){return L}});var i,t,s=r(62230),o=r(85244),a=r(52322),l=r(54132),c=r(25812),u=r(36416),d=r.n(u),x=function(e){var n=e.children;return(0,a.jsx)("kbd",{className:d().root,children:n})},p=function(e){return(0,a.jsxs)("svg",(0,o.Z)((0,s.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,a.jsx)("path",{d:"M9.66862 19.9993C11.1406 19.9993 12.3353 18.8047 12.3353 17.3327V14.666H9.66862C8.19662 14.666 7.00195 15.8607 7.00195 17.3327C7.00195 18.8047 8.19662 19.9993 9.66862 19.9993Z",fill:"#0ACF83"}),(0,a.jsx)("path",{d:"M7.00195 12.0007C7.00195 10.5287 8.19662 9.33398 9.66862 9.33398H12.3353V14.6673H9.66862C8.19662 14.6673 7.00195 13.4727 7.00195 12.0007Z",fill:"#A259FF"}),(0,a.jsx)("path",{d:"M7.00195 6.66667C7.00195 5.19467 8.19662 4 9.66862 4H12.3353V9.33333H9.66862C8.19662 9.33333 7.00195 8.13867 7.00195 6.66667Z",fill:"#F24E1E"}),(0,a.jsx)("path",{d:"M12.334 4H15.0007C16.4727 4 17.6673 5.19467 17.6673 6.66667C17.6673 8.13867 16.4727 9.33333 15.0007 9.33333H12.334V4Z",fill:"#FF7262"}),(0,a.jsx)("path",{d:"M17.6673 12.0007C17.6673 13.4727 16.4727 14.6673 15.0007 14.6673C13.5287 14.6673 12.334 13.4727 12.334 12.0007C12.334 10.5287 13.5287 9.33398 15.0007 9.33398C16.4727 9.33398 17.6673 10.5287 17.6673 12.0007Z",fill:"#1ABCFE"})]}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,a.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]}))},h=r(77174),f=r(24340),v=r(90374);(t=i||(i={})).Mac="Mac",t.Linux="Linux",t.Windows="Windows";var g=function(){var e=navigator.userAgent,n=i.Linux;return Object.values(i).forEach(function(r){e.includes(r)&&(n=r)}),n},m=r(2784),j=r(951),b=r(75100),y=r(56580),C=r(75289),F=r(22710),w=r(99267),E=r(61931),I=r(75329),S=r(67557),D=r(82770),k=r(88932);function Z(e){return _.apply(this,arguments)}function _(){return(_=(0,F.Z)(function(e){var n,r,i,t,a,l,c,u,d,x;return(0,w.__generator)(this,function(p){switch(p.label){case 0:n=e.variationId,r=e.slice,i=e.file,t=e.method,p.label=1;case 1:return p.trys.push([1,3,,4]),(a=new FormData).append("file",i),a.append("libraryName",r.from),a.append("sliceName",r.model.name),a.append("variationId",n),[4,(0,D.XQ)({libraryName:r.from,sliceId:r.model.id,variationId:n,file:i})];case 2:if(c=(l=p.sent()).errors,u=l.url,c.length>0)throw c;return D.Xe.track({event:"screenshot-taken",type:"custom",method:t}),[2,(0,o.Z)((0,s.Z)({},r),{screenshots:(0,o.Z)((0,s.Z)({},r.screenshots),(0,S.Z)({},n,{url:u}))})];case 3:return d=p.sent(),x="Screenshot not saved",console.error(x,d),k.Am.error(x),[3,4];case 4:return[2]}})})).apply(this,arguments)}var M=r(76473),R=function(e){var n=e.inputFile,r=e.handleFile,i=e.children,t=e.isDragActive;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.__,{htmlFor:"input-file",variant:"buttons.white",sx:{p:2,px:0,display:"flex",justifyContent:"center",width:200,alignItems:"center",flex:1},children:i||"Select file"}),(0,a.jsx)("input",{id:"input-file",type:"file",ref:n,style:{display:"none"},accept:I.nG.map(function(e){return"image/".concat(e)}).join(","),onChange:function(e){var n;r(null===(n=e.target.files)||void 0===n?void 0:n[0],t)}})]})},H=function(){return(0,a.jsx)(C.kC,{variant:"boxes.centered",sx:{p:2,position:"absolute",height:"100%",width:"100%",background:"rgba(249, 248, 249, 0.7)",backdropFilter:"blur(5px)",zIndex:"1",pointerEvents:"none"},children:(0,a.jsxs)(C.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,a.jsx)(A,{isActive:!0}),(0,a.jsx)(C.xv,{sx:{my:2},children:"Drop file here"}),(0,a.jsx)(C.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})})},A=function(e){var n=e.isActive;return(0,a.jsx)(C.kC,{sx:{p:1,borderRadius:"50%",bg:n?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,a.jsx)(j.IEK,{style:{color:n?"#6E56CF":"#6F6E77",fontSize:"34px"}})})},z=function(e){var n,r,i,t,l,c,u=e.variationID,d=e.slice,x=e.imageTypes,p=void 0===x?I.nG:x,h=e.onUploadSuccess,f=d.screenshots[u],g=(0,v.Z)().saveSliceCustomScreenshotSuccess,j=(0,m.useState)(!1),b=j[0],y=j[1],S=(0,m.useState)(!1),D=S[0],_=S[1],z=(0,m.useState)(!1),O=z[0],V=z[1];(0,M.y1)(["meta+v","ctrl+v"],function(){q()},[u,d,]);var P,B,L=(i=(r={onHandleFile:(n=(0,F.Z)(function(e,n){var r,i;return(0,w.__generator)(this,function(t){switch(t.label){case 0:return V(!0),[4,Z({slice:d,file:e,method:n?"dragAndDrop":"upload",variationId:u})];case 1:return r=t.sent(),_(!1),(i=null==r?void 0:r.screenshots[u])&&(g(u,i,r),h&&h(r)),V(!1),[2]}})}),function(e,r){return n.apply(this,arguments)})}).onHandleFile,t=(0,m.useRef)(null),l=(0,F.Z)(function(e,n){return(0,w.__generator)(this,function(r){switch(r.label){case 0:if(!e)return[3,2];return[4,i(e,n)];case 1:r.sent(),(null==t?void 0:t.current)&&(t.current.value=""),r.label=2;case 2:return[2]}})}),{handleFile:c=function(e,n){return l.apply(this,arguments)},inputFile:t,FileInputRenderer:R,fileInputProps:{inputFile:t,handleFile:c}}),N=L.FileInputRenderer,T=L.fileInputProps,U=(P=(0,F.Z)(function(e){var n,r;return(0,w.__generator)(this,function(i){switch(i.label){case 0:if(e.size>128e6)return[2,k.Am.error("File is too big. Max file size: 128Mb.")];return V(!0),[4,Z({slice:d,file:e,method:"dragAndDrop",variationId:u})];case 1:return(r=null==(n=i.sent())?void 0:n.screenshots[u])&&(g(u,r,n),h&&h(n)),V(!1),[2]}})}),function(e){return P.apply(this,arguments)}),W="function"==typeof navigator.clipboard.read,q=(B=(0,F.Z)(function(){var e,n,r,i,t;return(0,w.__generator)(this,function(s){switch(s.label){case 0:if(!W)return[2];s.label=1;case 1:return s.trys.push([1,5,,6]),[4,navigator.clipboard.read()];case 2:if(!(void 0!==(e=s.sent())[0])||!(void 0!==(n=e[0].types.find(function(e){return p.map(function(e){return"image/".concat(e)}).includes(e)}))))return[3,4];return[4,e[0].getType(n)];case 3:return r=s.sent(),i=new File([r],"file"),[2,U(i)];case 4:return[3,6];case 5:return t=s.sent(),console.error("Could not paste file",t),[3,6];case 6:return[2]}})}),function(){return B.apply(this,arguments)}),G=function(e){e.preventDefault(),y(!1);var n,r=null===(n=e.dataTransfer.files)||void 0===n?void 0:n[0];if(void 0!==r)return p.some(function(e){return"image/".concat(e)===r.type})?void U(r):k.Am.error("Only files of type ".concat(p.join(", ")," are accepted."))},X=function(e){return function(n){n.preventDefault(),y(e)}},K=function(e){return function(n){n.preventDefault(),_(e)}};return(0,a.jsxs)(C.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:X(!0),onDragLeave:X(!1),onDragOver:X(!0),onMouseEnter:K(!0),onMouseLeave:K(!1),onSubmit:function(e){return e.preventDefault()},onDrop:G,children:[O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.$j,{}),(0,a.jsx)(C.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,O||void 0===f?null:(0,a.jsx)(E.q,{src:f.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),O?null:(0,a.jsx)(C.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:D||void 0===f?"visible":"hidden"},children:(0,a.jsx)(C.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,a.jsxs)(C.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,a.jsx)(A,{isActive:b}),(0,a.jsx)(C.xv,{sx:{my:2},children:W?"Paste, drop or ...":"Drop or ..."}),(0,a.jsx)(N,(0,o.Z)((0,s.Z)({},T),{isDragActive:b})),(0,a.jsx)(C.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),b?(0,a.jsx)(H,{}):null]})},O=function(){var e,n=[i.Windows,i.Linux].includes(g())?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x,{children:"ctrl"})," + ",(0,a.jsx)(x,{children:"shift"})," + ",(0,a.jsx)(x,{children:"c"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x,{children:"cmd"})," + ",(0,a.jsx)(x,{children:"shift"})," + ",(0,a.jsx)(x,{children:"c"})]});return(0,a.jsxs)(C.kC,{sx:{pl:"4px",alignItems:"center",color:"#000",borderRadius:"6px",fontSize:"12px",lineHeight:"24px",border:"1px solid #E4E2E4",boxShadow:"0px 1px 0px 0px rgba(0, 0, 0, 0.04)",width:"100%",minHeight:"40px"},children:[(0,a.jsx)(p,{}),(0,a.jsxs)("div",{children:["Use\xa0",n," to copy any frame as .png, then just paste it here"]})]})},V=function(e){var n=e.isValid;return(0,a.jsx)(C.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:n?(0,a.jsx)(j.Ypm,{style:{fontSize:"16px"}}):(0,a.jsx)(b.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},P=function(e){var n=e.slice,r=e.onSelectVariation,i=e.variationSelector;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.model.name}),(0,a.jsx)(C.xu,{children:(0,a.jsx)(C.xu,{as:"ul",sx:{pl:0,my:3},children:n.model.variations.map(function(e){var t=i.sliceID,l=i.variationID,c=t===n.model.id&&l===e.id;return(0,a.jsx)(C.xu,{as:"li",sx:(0,o.Z)((0,s.Z)({listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px"},c&&{bg:"#EDECEE",fontWeight:"500"}),{":hover":{bg:"#EDECEE"}}),onClick:function(){return r({sliceID:n.model.id,variationID:e.id})},children:(0,a.jsxs)(C.kC,{sx:{alignItems:"center"},children:[(0,a.jsx)(V,{isValid:!!n.screenshots[e.id]}),(0,a.jsx)(C.xv,{sx:{ml:2},children:e.name})]})},"".concat(n.model.id,"-").concat(e.id))})})})]})},B=function(e,n){return e||(n.length?{sliceID:n[0].model.id,variationID:n[0].model.variations[0].id}:void 0)},L=function(e){var n=e.slices,r=e.defaultVariationSelector,i=e.onUploadSuccess,t=(0,v.Z)().closeModals,s=(0,y.v9)(function(e){return{isOpen:(0,h.gP)(e,f.q.SCREENSHOTS)}}).isOpen,o=(0,m.useState)(B(r,n)),u=o[0],d=o[1];if((0,m.useEffect)(function(){d(B(r,n))},[null==r?void 0:r.sliceID,null==r?void 0:r.variationID,s,]),0===n.length||!u)return null;var x,p="function"==typeof navigator.clipboard.read;return(0,a.jsx)(c.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return t()},children:(0,a.jsx)(l.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,a.jsxs)(C.kC,{sx:{position:"sticky",top:0,zIndex:1,background:"gray",p:"16px",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,a.jsx)(C.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,a.jsx)(C.x8,{type:"button",onClick:function(){return t()}})]})},Footer:null,children:(0,a.jsxs)(C.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,a.jsx)(C.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:n.map(function(e,n){return(0,a.jsx)(P,{slice:e,variationSelector:u,onSelectVariation:d},"".concat(e.model.id,"-").concat(n))})}),(0,a.jsxs)(C.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[p?(0,a.jsx)(O,{}):void 0,(x=n.find(function(e){return e.model.id===u.sliceID}))?(0,a.jsx)(z,{variationID:u.variationID,slice:x,onUploadSuccess:i}):null]})]})})})}},61931:function(e,n,r){"use strict";r.d(n,{q:function(){return c}});var i=r(62230),t=r(52322),s=r(2784),o=r(65186),a=r(75289),l=(0,s.memo)(function(e){var n=e.src;return(0,t.jsx)(a.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),c=function(e){var n=e.src,r=e.sx;return(0,t.jsx)(a.kC,{sx:(0,i.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},r),children:void 0!==n?(0,t.jsx)(l,{src:n}):(0,t.jsxs)(a.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,t.jsx)(o.eJU,{}),"You have no screenshot yet."]})})}},47731:function(e,n,r){"use strict";r.d(n,{H:function(){return s}});var i=r(90374),t=r(2784),s=function(){var e=(0,i.Z)().openScreenshotsModal,n=(0,t.useState)({sliceFilterFn:function(e){return e}}),r=n[0],s=n[1];return{modalPayload:r,onOpenModal:function(n){s(n),e()}}}},36416:function(e){e.exports={root:"Kbd_root__nBos2"}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[318],{39576:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322),o=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}},l=t(61183);t(2784);var a=t(59326),s=t(75289);l.Z.registerLanguage("svelte",o);var c=["javascript","bash","xml","html","json"],u=function(e){var n,t=e.children,o=e.lang,u=e.sx,d=e.codeStyle,f=e.codeClass,p=e.Header,x=(0,a.B7)().theme,m=o?l.Z.highlight(t,{language:"vue"===o?"html":o}).value:l.Z.highlightAuto(t,c).value;return(0,r.jsxs)(s.kC,{as:"pre",sx:u,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=x.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:m}})]})}},3026:function(e,n,t){"use strict";t.d(n,{J:function(){return c},k:function(){return s}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322);t(2784);var a=t(75289),s=function(e){var n=e.children,t=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},t)},s),{children:n}))},c=function(e){var n=e.children,t=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===t?2:t)-1,"%"),mb:1},children:n})}},59872:function(e,n,t){"use strict";t.d(n,{$w:function(){return i},Hq:function(){return d},tM:function(){return u}});var i,r=t(62230),o=t(85244),l=t(52322),a=t(63397);t(2784);var s,c=t(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var u=function(e){var n={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}});case i.WARNING:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}});default:return n}},d=function(e){var n=e.sx,t=e.field,s=e.meta,d=e.formField,f=e.fieldName,p=e.fields,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||d.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===n?{}:n,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[d.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:d.placeholder||d.label||f},d.fieldLevelValidation&&x?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,t),{as:c.II,sx:u(h),disabled:m||d.disabled}))]})}},34066:function(e,n,t){"use strict";t.d(n,{kp:function(){return c},sP:function(){return d},w8:function(){return f},Hq:function(){return p.Hq}});var i=t(62230),r=t(85244),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=function(e){var n=e.field,t=e.meta,c=e.fieldName,u=e.label,d=e.focusOnNewEntry,f=void 0===d||d,p=e.inputPlaceholder,x=e.buttonLabel,m=(0,a.useState)(t.value.length),h=m[0],v=m[1],g=(0,a.useRef)(Array(t.value.length));return(0,a.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,a.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[u,t.touched&&t.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:t.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},n),{render:function(e){return(0,o.jsxs)("div",{children:[n.value&&n.value.length>0?n.value.map(function(n,t){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(t),value:n,ref:function(e){return g.current[t]=e},onChange:function(n){var i=n.target.value;return e.replace(t,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(t)},children:"-"})]},"".concat(c,"-").concat(+t+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(n.value.length,"")},children:x})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,a=e.fieldName,c=e.onChange,d=(0,u.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},d),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!n.value)},checked:n.value}),t]}))},f=function(e){var n=e.field,t=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,a.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(d,{meta:{value:f},fieldName:n.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof t?t(l,f):t})},p=t(59872)},71168:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(75289),c=(0,a.forwardRef)(function(e,n){var t=e.children,a=e.Component,c=void 0===a?s.kC:a,u=e.sx,d=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===u?{}:u),ref:n},d),{children:t}))});n.Z=c},28728:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(62230),r=t(85244),o=t(52322),l=t(5446),a=t(2784),s=t(40023),c=t(951),u=t(8799),d=t(18978),f=t(59326),p=t(75289),x=t(71168),m=t(39031),h=t(98240),v=t(39295),g=t(33710),b=function(e){var n=e.text,t=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),u=(0,a.useState)(null),d=u[0],f=u[1],x=function(){f(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return x(),window.addEventListener("resize",x),function(){window.removeEventListener("resize",x)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.xv,(0,r.Z)((0,i.Z)({"data-for":n,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:t,ref:c},s),{children:n})),d&&(0,o.jsx)(v.X,{children:(0,o.jsx)(g.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},y=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(n=l.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=l.colors)||void 0===t?void 0:t.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var n=e.item,t=e.index,h=e.deleteItem,v=e.enterEditMode,g=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,k=e.CustomEditElements,C=e.widget,S=e.draggableId,I=e.testId,F=e.isRepeatableCustomType,E=e.children,w=(0,f.B7)().theme,T=n.key,A=n.value,_=A.config,N=A.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:S,index:t,children:function(e){var s,f,S,A,R;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(x.Z,(0,r.Z)((0,i.Z)({"data-testid":I,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(m.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:d.Fm7,color:null===(s=w.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:w,text:(null==_?void 0:_.label)||T,sliceFieldName:b&&b(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(p.kC,{children:[k||null,Z||(0,o.jsx)(m.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=w.colors)||void 0===f?void 0:f.icons},onClick:function(){return v([T,n.value],g,t)}}),!(!0===F&&"UID"==N)&&(0,o.jsxs)(l.v2,{children:[(0,o.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(u.FQA,{size:20,color:null===(S=w.colors)||void 0===S?void 0:S.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(A=w.colors)||void 0===A?void 0:A.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(R=w.colors)||void 0===R?void 0:R.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),E]}))})}})})}},39031:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(75289),s=function(e,n){return n?{border:function(e){var n=e.colors;return"1px solid ".concat(n.error)}}:e?{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)}}:{border:function(e){var n=e.colors;return"1px solid ".concat(n.borders)}}},c=function(e){var n=e.sx,t=e.onClick,c=e.label,u=e.Icon,d=e.error,f=e.size,p=void 0===f?16:f,x=e.fitButton,m=e.active,h=e.useActive,v=e.activeSx,g=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===t?function(){return null}:t,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==m&&m,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},89853:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=t(34066),u=t(78610),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,l.U$)(n),3),x=p[0],m=p[1],h=p[2],v=t.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===u.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:m,field:x,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[t.type===u.h.INPUT?(0,o.jsx)(c.Hq,{meta:m,field:x,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===u.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:m,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},4092:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(2784),s=t(92928),c=t(75289),u=t(54132),d=t(98240),f=t(59326),p=function(e){var n=e.children,t=(0,d.Z)(e,["children"]);return(0,l.jsx)(c.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},t),{children:n}))};p.tabsRole="TabList";var x=function(e){var n=e.children,t=(0,d.Z)(e,["children"]),o=(0,f.B7)().theme;return(0,l.jsx)(s.OK,(0,r.Z)((0,i.Z)({},t),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},t.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:n}))};x.tabsRole="Tab";var m=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,d=e.bodySx,f=e.footerSx,m=e.defaultIndex,h=void 0===m?0:m,v=(0,a.useState)(h),g=v[0],b=v[1];return(0,l.jsx)(u.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},f),bodySx:(0,i.Z)({p:0},d),sx:{border:"none"},Header:r,Footer:t,children:(0,l.jsxs)(s.mQ,{defaultIndex:h,onSelect:function(e){return b(e)},children:[(0,l.jsx)(p,{children:(o||[]).map(function(e){return(0,l.jsx)(x,{children:e},e)})}),a.Children.map(n,function(e,n){return(0,l.jsx)(c.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===g?"block":"none"},children:(0,l.jsx)(s.x4,{children:e})})})]})})},h=(0,a.memo)(m),v=t(3026),g=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(n=o.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=o.colors)||void 0===t?void 0:t.primary}}),(0,l.jsx)(c.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(c.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},b=t(25812),y=t(60113),j=t(75329),Z=t(5632),k=t(65186),C=function(){var e=(0,Z.useRouter)();return(0,l.jsxs)(c.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(k.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(c.xu,{sx:{height:"12px"}}),(0,l.jsx)(c.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(c.xu,{sx:{height:"8px"}}),(0,l.jsx)(c.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(c.xu,{sx:{height:"24px"}}),(0,l.jsx)(c.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),j.pq)},children:"Go to the Slice Simulator"})]})},S=t(83239),I=t(83462),F=t(37149),E=t.n(F),w=t(65413),T=t(99968),A=t(89853),_=t(67557),N=t(77033),R=t(63397),M=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,u=e.FormFields,f=e.children;return(0,l.jsx)(c.xu,{children:(0,l.jsx)(R.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,d.Z)(e,["id"])).reduce(function(e,n){var t=(0,o.Z)(n,2),l=t[0],a=t[1];if((void 0===a?"undefined":(0,N.Z)(a))!==Boolean&&!a){var s,c=null===(s=u[l])||void 0===s?void 0:s.defaultValue;if(void 0!==c)return(0,r.Z)((0,i.Z)({},e),(0,_.Z)({},l,c))}return(0,r.Z)((0,i.Z)({},e),(0,_.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(R.l0,{id:n,children:f((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},z=(0,a.memo)(M);E().setAppElement("#__next");var B=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,u=e.zoneType,d=(0,f.B7)().theme;if(!t.isOpen)return null;var p=(0,o.Z)(t.field,2),x=p[0],m=p[1],j=(0,T.t)(S,m.config,m.type);if(!j)return(0,l.jsxs)("div",{children:[m.type," not found"]});var Z=j.Meta.icon,k=j.FormFields,F=j.Form,E=j.schema,_=(0,i.Z)({},(0,y.f7)((0,I.B9)(k,"id")),j.prepareInitialValues?j.prepareInitialValues(m.config):m.config),N=function(){try{return{res:E.validateSync({type:m.type,config:_},{stripUnknown:!0})}}catch(e){return{err:e}}}(),R=N.res,M=N.err;M&&(console.error("[EditModal] Failed to validate field of type ".concat(m.type,".\n Please update model.json accordingly.")),console.error(M));var B={id:x,config:R?R.config:_},q=(0,o.Z)(k.id.validate.matches,2),D=q[0],O=q[1],P=w.object().shape({id:w.string().matches(D,O).min(3).max(35).required(),config:E.fields.config}),V="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(b.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(z,{apiId:x,formId:V,initialValues:B,validationSchema:P,FormFields:k,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:x,newKey:t,value:(0,i.Z)({},m,r)}),n()},children:function(e){var t=e.values,s=t.id,f=t.config.label,p=e.isValid,x=e.isSubmitting,m=e.initialValues,b=F?(0,l.jsx)(F,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(v.k,{children:Object.entries(k).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(v.J,{children:(0,l.jsx)(A.Z,{fieldName:(0,y.lm)(t),formField:i,fields:a,initialValues:m})},t)})},"field-model-tab-content"),j=["Field Model"],S=[b];if("slice"===u){var I=(0,l.jsx)(c.xu,{children:(0,l.jsx)(C,{})},"mock-data-tab-content");j.push("Mock Data"),S.push(I)}return(0,l.jsx)(h,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:j,Header:function(e){var t=e.radius;return(0,l.jsxs)(c.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t},children:[(0,l.jsx)(g,{theme:d,text:f||s,WidgetIcon:Z}),(0,l.jsx)(c.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(c.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(c.xu,{sx:{ml:"auto"}}),(0,l.jsx)(c.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(c.zx,{form:V,type:"submit",disabled:!p&&x,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:S})}})})}},75012:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(62230),r=t(85244),o=t(52322),l=t(54132),a=t(3026),s=t(25812),c=t(37149),u=t.n(c),d=t(75289),f=t(59326),p=function(e){var n=e.title,t=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(d.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},"&:hover":{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":n,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(n,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(d.xu,{ml:1,children:[(0,o.jsx)(d.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(d.xv,{as:"p",variant:"xs",children:t})]})]})};u().setAppElement("#__next");var x=function(e){var n=e.data,t=e.close,c=e.onSelect,u=e.widgetsArray;return n.isOpen?(0,o.jsx)(s.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(l.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(d.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(d.X6,{children:"Add a new field"}),(0,o.jsx)(d.x8,{onClick:t})]})},children:(0,o.jsx)(a.k,{children:u.filter(function(e){return e}).map(function(e){var n=e.Meta,t=e.TYPE_NAME,l=e.CUSTOM_NAME;return(0,o.jsx)(a.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return c(l||t)}}))},l||t)})})})}):null}},70697:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var i=t(22710),r=t(99267),o=t(52322),l=t(81038),a=t(2784),s=t(49857),c=t(39576),u=t(77245),d=t(8799),f=t(65186),p=t(59326),x=t(75289),m={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,l=e.lang,s=(0,p.B7)().theme,h=(0,a.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(x.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(x.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.vcz,{size:26,color:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(c.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:l,children:r})]}),(0,o.jsx)(x.xu,{children:(0,o.jsxs)(x.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(f.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(u.LhG,{size:16,style:m}),(0,o.jsx)(x.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=function(e){var n=e.show,t=e.renderHintBase,a=e.item,c=t({item:a}),u=(0,s.ZP)(c,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,l.j.snippets.readSnippets({fieldPath:c.split("."),model:a.value})];case 1:return[2,e.sent()]}})})),d=u.data,f=u.error;if(f&&console.error(f),!d||f)return null;var p=d.snippets||[];return p[0]?(0,o.jsx)("div",{style:{display:n?"initial":"none"},children:(0,o.jsx)(h,{code:p[0].code,lang:p[0].language})}):null}},9620:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(59872),s=t(60113),c=t(90569),u=t(83239),d=t(38876),f=t(22715),p=t(63397),x=t(2784),m=t(75289),h=t(59326),v=t(39295),g=t(18978),b=t(33710),y=function(e){var n=e.error;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.X,{children:(0,l.jsx)(b.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(g.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},j=function(e){var n=e.innerRef,t=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(m.II,(0,r.Z)((0,i.Z)({},t),{ref:n}))},Z=function(e){var n=e.widgetTypeName,t=e.fields,o=e.onSave,v=e.onCancelNewField,g=(0,x.useRef)(null),b=(0,h.B7)().theme,Z=(0,x.useState)(!0),k=Z[0],C=Z[1];(0,x.useEffect)(function(){g.current&&g.current.focus()},[g]);var S=u[n];if(!S)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var I=S.FormFields,F=S.Meta.icon,E={id:I.id,label:I.label},w=(0,r.Z)((0,i.Z)({},(0,s.f7)(E),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,s.gc)(E),A=function(e,n,t){t(k&&!E.id.disabled?(0,r.Z)((0,i.Z)({},n),{label:e.target.value,id:(0,d.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},n),{label:e.target.value}))},_=function(e,n){n("id",e.target.value),C(!1)};return(0,l.jsx)(p.J9,{onSubmit:o,validationSchema:T,initialValues:w,children:function(e){var n,o,s=e.errors,u=e.values,d=e.setValues,x=e.setFieldValue,h=e.submitForm;return(0,l.jsx)(p.l0,{"data-testid":"new-field-form",children:(0,l.jsxs)(m.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var n,t;return"1px solid ".concat((null===(n=e.colors)||void 0===n?void 0:null===(t=n.borders)||void 0===t?void 0:t.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,l.jsx)(F,{style:{color:null===(n=b.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=b.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(m.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(m.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(p.gN,{onChange:function(e){return A(e,u,d)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:g,sx:(0,r.Z)((0,i.Z)({},(0,a.tM)(E.label.disabled?a.$w.DISABLED:s.label?a.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,l.jsx)(y,{error:s.label})]}),(0,l.jsxs)(m.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(m.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(p.gN,{onChange:function(e){return _(e,x)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:E.id.disabled,validate:function(e){return(0,c.u)({value:e,fields:t,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,a.tM)(E.id.disabled?a.$w.DISABLED:s.id?a.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,l.jsx)(y,{error:s.id})]}),(0,l.jsxs)(m.kC,{sx:{gap:2},children:[(0,l.jsx)(f.zx,{onClick:v,color:"grey",children:"Cancel"}),(0,l.jsx)(f.zx,{onClick:function(){h()},children:"Add"})]})]})})}})}},8482:function(e,n,t){"use strict";t.d(n,{Z:function(){return I}});var i=t(62230),r=t(85244),o=t(17064),l=t(81541),a=t(52322),s=t(22715),c=t(82770),u=t(28173),d=t(13980),f=t(2784),p=t(65077),x=t(75012),m=t(71168),h=t(28728),v=t(83239),g=t(40023),b=t(75289),y=t(99968),j=t(70697),Z=function(e){var n=e.fields,t=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,u=e.renderFieldAccessor,d=e.onDeleteItem,f=e.showHints,p=e.newField,x=e.renderHintBase,Z=e.isRepeatable,k=e.testId,C=e.isRepeatableCustomType;return(0,a.jsx)(g.Z5,{onDragEnd:c,children:(0,a.jsx)(g.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(b.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":k,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,p=c.config,g=c.type,k=(0,y.t)(v,p,g);if(!k)return(0,a.jsx)(m.Z,{children:(0,a.jsxs)(b.xv,{children:['Field type "',g,'" not supported']})});var S={item:e,index:n,tabId:o,widget:k,showHints:f,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:C,testId:"list-item-".concat(e.key)};if(k.CustomListItem){var I=k.CustomListItem;return(0,a.jsx)(I,(0,i.Z)({},S))}var F=(0,a.jsx)(j.Z,{item:e,show:f,isRepeatable:Z,renderHintBase:x,Widgets:v,typeName:k.CUSTOM_NAME||k.TYPE_NAME});return(0,a.jsx)(h.Z,(0,r.Z)((0,i.Z)({},S),{HintElement:F}))}),e.placeholder,p]}))}})})},k=t(9620),C=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(b.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(b.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(b.xu,{sx:{my:2},children:(0,a.jsx)(b.xv,{sx:{color:"textClear"},children:"Fields are inputs for content (e.g. text, images, links)."})}),(0,a.jsx)(b.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return n()},"data-testid":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},S=function(e){var n=e.zoneType,t=e.zoneTypeFormat,d=e.tabId,m=e.title,h=e.fields,v=e.poolOfFieldsToCheck,g=e.widgetsArray,b=e.isRepeatable,y=e.onDeleteItem,j=e.onSaveNewField,S=e.onDragEnd,I=e.EditModal,F=e.onSave,E=e.dataTip,w=e.renderHintBase,T=e.renderFieldAccessor,A=e.testId,_=e.isRepeatableCustomType,N=Object.entries(v).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?g.filter(function(e){return"UID"!==e.TYPE_NAME}):g,R=(0,f.useState)(!1),M=R[0],z=R[1],B=(0,f.useState)({isOpen:!1}),q=B[0],D=B[1],O=(0,f.useState)({isOpen:!1}),P=O[0],V=O[1],L=(0,f.useState)(null),H=L[0],J=L[1],U=function(e){D({isOpen:!0,field:e});var i=(0,o.Z)(e,2),r=i[0],l=i[1];c.Xe.track({event:"field:settings-opened",id:r,name:l.config.label,type:l.type,isInAGroup:!1,contentType:"customType"===n?"page"===t?"page type":"custom type":"slice"})},W=function(){V({isOpen:!0})},$=function(){D({isOpen:!1})},G=function(){return V({isOpen:!1})},Y=function(e){J({widgetTypeName:e,fields:h}),V({isOpen:!1})},X=function(){return J(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Bu,{actions:h.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:M,onCheckedChange:z,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(b?"Repeatable":"Static","-field"),onClick:W,startIcon:"add",color:"grey",disabled:null!==H,children:"Add a new field"})]}):void 0,children:m}),0!==h.length||H?h.length>0||H?(0,a.jsx)(p.xR,{children:(0,a.jsx)(Z,{tabId:d,isRepeatable:b,fields:h,showHints:M,dataTip:E,title:m,renderFieldAccessor:T,renderHintBase:w,enterEditMode:U,enterSelectMode:W,onDragEnd:S,onDeleteItem:y,testId:A,isRepeatableCustomType:_,newField:H&&(0,a.jsx)(k.Z,(0,r.Z)((0,i.Z)({},H),{fields:v||h,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];j.apply(void 0,(0,l.Z)(n)),J(null)},onCancelNewField:X}))})}):void 0:(0,a.jsx)(p.xR,{children:(0,a.jsx)(C,{onEnterSelectMode:function(){return W()},zoneName:b?"Repeatable":"Static"})}),(0,a.jsx)(I,{data:q,close:$,onSave:F,fields:v,zoneType:n}),(0,a.jsx)(x.Z,{data:P,close:G,onSelect:Y,widgetsArray:N})]})};S.propTypes={isRepeatable:d.bool,title:d.string.isRequired,dataTip:d.string.isRequired,onSave:d.func.isRequired,onSaveNewField:d.func.isRequired,onDragEnd:d.func.isRequired,onDeleteItem:d.func.isRequired,poolOfFieldsToCheck:(0,d.arrayOf)((0,d.shape)({key:d.string,value:d.object})),renderHintBase:d.func.isRequired,renderFieldAccessor:d.func.isRequired,widgetsArray:d.array.isRequired,fields:(0,d.arrayOf)((0,d.shape)({key:d.string.isRequired,value:(0,d.shape)({config:d.object,fields:d.array,type:d.string.isRequired})}))};var I=S},99968:function(e,n,t){"use strict";t.d(n,{t:function(){return i}});var i=function(e,n,t){if("Link"===t)switch(null==n?void 0:n.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}return e[t]}},90569:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(75329),r=t(34671),o=function(e){var n=e.value,t=e.fields,i=e.initialId;return n?t.find(function(e){return e.key===n})&&n!==i?'Field "'.concat(n,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},34671:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(60113),r=t(78610),o=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(n,s)},required:n,label:e,defaultValue:t,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,u=n||{},d=u.min,f=u.max,p=u.required,x=u.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(d,l),max:(0,i.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},60113:function(e,n,t){"use strict";t.d(n,{MJ:function(){return d},f7:function(){return f},gc:function(){return p},lm:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),l=t(17064),a=t(81541),s=t(65413),c=t(78610),u=function(e){return"id"===e?"id":"config.".concat(e)},d=function(e,n){return Array.isArray(e)?e:"boolean"==typeof e&&e?n:null},f=function(e){return Object.entries(e).reduce(function(e,n){var t,a=(0,l.Z)(n,2),s=a[0],u=null===(t=a[1]).defaultValue?void 0:void 0!==t.defaultValue?t.defaultValue:t.type===c.h.CHECKBOX||(t.type===c.h.INPUT?"":t.type===c.h.SELECT?[]:void 0);return void 0!==u?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,u)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,n){var t=(0,l.Z)(n,2),c=t[0],u=t[1],d=u.validate,f=u.yupType;if(!d)return e;if("function"==typeof d)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,d(c,u)));var p=s[f]();return Object.entries(d).filter(function(e){return e&&e[1]}).forEach(function(e){var n,t=(0,l.Z)(e,2),i=t[0],r=t[1];if(r&&p[i]){p=(n=p)[i].apply(n,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},78610:function(e,n,t){"use strict";var i,r;t.d(n,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},82910:function(e,n,t){"use strict";t.d(n,{H:function(){return f}});var i=t(8799),r=t(65413),o=t(60113),l=t(90569),a=t(34671),s=t(83462),c={icon:i.XGl,title:"Boolean",description:"An input that is either true or false"},u={label:l.J.label,id:l.J.id,placeholder_false:(0,a.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,a.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,a.Jg)("Default to true")},d=r.object().shape({type:r.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,s.B9)(u,"id"))}),f={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:c,schema:d,FormFields:u}},12174:function(e,n,t){"use strict";t.d(n,{S:function(){return c}});var i,r=t(65186),o=t(83462),l={icon:r.jqW,title:"Color",description:"A color picker"},a=(0,o.zg)("Color"),s=a.TYPE_NAME,c={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:a.FormFields,TYPE_NAME:s,schema:a.schema,Meta:l}},86495:function(e,n,t){"use strict";t.d(n,{l:function(){return C}});var i=t(62230),r=t(85244),o=t(7819),l=t(31667),a=t(65186),s=t(56580),c=t(65413),u=t(348),d=t(17064),f=t(52322),p=t(3026),x=t(89853),m=t(60113),h=t(90569),v=t(36131),g=t(75289),b={label:h.J.label,id:h.J.id,customtypes:{validate:function(){return c.array().of(c.string())}}},y=function(e){var n=e.initialValues,t=e.values,a=e.fields,c=e.setFieldValue,u=(0,s.v9)(l.Ch).filter(o.TG),h=u.map(function(e){return{value:e.local.id,label:e.local.label}}),y=t.config.customtypes?t.config.customtypes.map(function(e){var n=u.find(function(n){return n.local.id===e});return{value:null==n?void 0:n.local.id,label:null==n?void 0:n.local.label}}):null;return(0,f.jsxs)(p.k,{children:[Object.entries(b).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,d.Z)(e,2),i=t[0],r=t[1];return(0,f.jsx)(p.J,{children:(0,f.jsx)(x.Z,{fieldName:(0,m.lm)(i),formField:r,fields:a,initialValues:n})},i)}),(0,f.jsx)(p.J,{children:(0,f.jsxs)(g.xu,{sx:{mt:2,alignItems:"center"},children:[(0,f.jsx)(g.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,f.jsx)(v.ZP,{isMulti:!0,name:"origin",options:h,onChange:function(e){e&&c("config.customtypes",e.map(function(e){return e.value}))},value:y,theme:function(e){return(0,r.Z)((0,i.Z)({},e),{colors:(0,r.Z)((0,i.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},j={icon:a.I2R,title:"Content Relationship",description:"Define content relations & internal links"},Z=u.I.shape({label:c.string().max(35,"String is too long. Max: 35"),select:c.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:c.array(c.string()).strict().optional()}),k=c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:Z}),C={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:j,schema:k,TYPE_NAME:"Link",FormFields:b,CUSTOM_NAME:"ContentRelationship",Form:y,prepareInitialValues:function(e){var n=(0,s.v9)(l.Ch).filter(o.TG);return(null==e?void 0:e.customtypes)?(0,r.Z)((0,i.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}}},71516:function(e,n,t){"use strict";t.d(n,{v:function(){return a}});var i,r=t(65186),o=(0,t(83462).zg)("Date"),l=o.FormFields,a={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Date",schema:o.schema,Meta:{icon:r.f$3,title:"Date",description:"A calendar date picker"}}},79583:function(e,n,t){"use strict";t.d(n,{S:function(){return a}});var i,r=t(34543),o=(0,t(83462).zg)("Embed"),l=o.FormFields,a={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Embed",schema:o.schema,Meta:{icon:r.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}}},37191:function(e,n,t){"use strict";t.d(n,{X:function(){return s}});var i,r=t(65186),o=t(65413),l=t(90569),a={label:l.J.label,id:l.J.id},s={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:a,TYPE_NAME:"GeoPoint",schema:o.object().shape({type:o.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:o.object().shape({label:o.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:r.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}}},64118:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var i=t(8799),r=t(65413),o=t(60113),l=t(83462),a=t(62230),s=t(85244),c=t(17064),u=t(52322),d=t(2784),f=t(3026),p=t(89853),x=t(90569),m=t(63397),h=t(75289),v=t(98240),g=t(34066),b=t(39031),y=t(65186),j=function(e){var n=e.onClick,t=e.error,r=e.onDelete,o=e.active,l=e.text,s=e.sx;return(0,u.jsx)(b.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:o,sx:(0,a.Z)({position:"relative",width:"64px",height:"64px"},s),Icon:function(){return(0,u.jsxs)(d.Fragment,{children:[(0,u.jsxs)(h.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,u.jsx)(i.jnY,{size:22}),(0,u.jsx)(h.xv,{mt:1,children:l})]}),r?(0,u.jsx)(h.Ct,{onClick:r,variant:"circle-right",children:(0,u.jsx)(y.B4e,{})}):null]})}})},Z=function(e){var n=e.onClick;return(0,u.jsx)(b.Z,{fitButton:!0,onClick:n,sx:{width:"64px",height:"64px",border:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}},Icon:function(){return(0,u.jsx)(h.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,u.jsx)(i.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},k=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,c.Z)((0,m.U$)(n),2),o=(r[0],r[1]),l=void 0!==t&&t?"*":"";return i?(0,u.jsxs)(d.Fragment,{children:[(0,u.jsx)(C,{name:"".concat(n,".name"),label:"Name".concat(l),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,u.jsx)(S,{name:"".concat(n,".width"),label:"Width (px)".concat(l),placeholder:" ",sx:{mb:3}}),(0,u.jsx)(S,{name:"".concat(n,".height"),label:"Height (px)".concat(l),placeholder:" "})]}):null},C=function(e){var n=e.name,t=e.label,i=e.placeholder,r=e.meta,o=e.isConstraint,l=(0,v.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,c.Z)((0,m.U$)(n),1)[0];return(0,u.jsx)(g.Hq,(0,s.Z)((0,a.Z)({},l),{fieldName:n,meta:r,formField:{label:t,placeholder:i},field:o?{value:"main",readOnly:!0}:{value:d.value},variant:o?"disabled":"primary"}))},S=function(e){var n=e.name,t=e.label,i=e.placeholder,r=(0,v.Z)(e,["name","label","placeholder"]),o=(0,c.Z)((0,m.U$)(n),2),l=o[0],d=o[1];return(0,u.jsx)(g.Hq,(0,s.Z)((0,a.Z)({},r),{fieldName:n,formField:{label:t,placeholder:i},meta:d,field:{min:0,type:"number",value:l.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},I=function(){return r.number().nullable().transform(function(e,n){return""===n?null:e})},F={label:x.J.label,id:x.J.id,constraint:{validate:function(){return r.object().defined().shape({width:I(),height:I()})}},thumbnails:{validate:function(){return r.array().defined().of(r.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var n="number"==typeof e.width&&e.width,t="number"==typeof e.height&&e.height;return e.name&&(n||t)}}))}}},E={name:"",width:"",height:""},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,t=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||n||t?n||t?"".concat(n||"auto","x").concat(t||"auto"):"...":"auto"},T=function(e){var n=e.initialValues,t=e.values,i=e.errors,r=e.fields,l=e.touched,x=(0,d.useState)(0),v=x[0],g=x[1],b=t.config,y=b.thumbnails,C=b.constraint;return(0,d.useEffect)(function(){g(y.length)},[y.length]),(0,u.jsxs)(f.k,{children:[Object.entries(F).map(function(e){var t=(0,c.Z)(e,2),i=t[0],l=t[1];return(0,u.jsx)(f.J,{children:(0,u.jsx)(p.Z,{fieldName:(0,o.lm)(i),formField:l,fields:r,initialValues:n})},i)}),(0,u.jsxs)(f.J,{children:[(0,u.jsx)(h.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,u.jsx)(h.Zb,{p:3,children:(0,u.jsx)(m.F2,{name:"config.thumbnails",render:function(n){var t=n.push,r=n.remove;return(0,u.jsxs)(d.Fragment,{children:[(0,u.jsxs)(h.kC,{mb:3,children:[(0,u.jsx)(j,{active:0===v,text:w(C,!0),sx:{mr:2},onClick:function(){return g(0)}}),y.map(function(e,n){return(0,u.jsx)(j,{sx:{mr:3},active:v===+n+1,text:w(e),error:!!i.thumbnails&&!!l.thumbnails&&!!l.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return r(n)},onClick:function(){return g(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,u.jsx)(Z,{onClick:function(){t(E)}})]}),(0,u.jsx)(k,(0,s.Z)((0,a.Z)({},e),{display:0===v,prefix:"config.constraint"})),y.map(function(n,t){return(0,d.createElement)(k,(0,s.Z)((0,a.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:v===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},A=r.object().shape({type:r.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(F,"id"))}),_={Meta:{icon:i.jnY,title:"Image",description:"A responsive image field with constraints"},Form:T,schema:A,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:F,TYPE_NAME:"Image"}},348:function(e,n,t){"use strict";t.d(n,{h:function(){return g},I:function(){return v}});var i=t(34543),r=t(65413),o=t(62230),l=t(85244),a=t(17064),s=t(52322),c=t(3026),u=t(89853),d=t(60113),f=t(90569),p=t(34671),x=(0,l.Z)((0,o.Z)({},f.J),{allowTargetBlank:(0,p.Jg)("Allow target blank",!1,!1)}),m=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(c.k,{children:Object.entries(x).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(c.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,d.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},h={icon:i.eR7,title:"Link",description:"A link to web, media or Prismic document"},v=r.object().shape({label:r.string().optional(),useAsTitle:r.boolean().optional(),placeholder:r.string().optional(),select:r.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:r.array(r.string()).strict().optional(),masks:r.array(r.string()).optional(),tags:r.array(r.string()).optional(),allowTargetBlank:r.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),g={Meta:h,FormFields:x,schema:r.object().shape({type:r.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:v.optional()}),Form:m,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"}},33949:function(e,n,t){"use strict";t.d(n,{H:function(){return v}});var i=t(348),r=t(65186),o=t(65413),l=t(62230),a=t(17064),s=t(52322),c=t(3026),u=t(89853),d=t(60113),f=t(90569),p=(0,l.Z)({},f.J),x=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(c.k,{children:Object.entries(p).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(c.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,d.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:r.x2k,title:"Link to media",description:"A link to files, document and media"},h=i.I.shape({select:o.string().required().matches(/^media$/,{excludeEmptyString:!0})}),v={Meta:m,FormFields:p,schema:o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"}},51490:function(e,n,t){"use strict";t.d(n,{L:function(){return a}});var i,r=t(951),o=(0,t(83462).zg)("Number"),l=o.FormFields,a={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Number",schema:o.schema,Meta:{icon:r.JUs,title:"Number",description:"A number input field"}}},74269:function(e,n,t){"use strict";t.d(n,{u:function(){return b}});var i=t(65186),r=t(65413),o=t(60113),l=t(83462),a=t(62230),s=t(85244),c=t(52322),u=t(34066),d=t(90569),f=t(78610),p=t(63397),x=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},m=function(e,n){return n?e:void 0},h=(0,s.Z)((0,a.Z)({},d.J),{default_value:{type:f.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return r.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(n){return n===e})}})},component:function(e){var n,t=null===(n=(0,p.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,c.jsx)(u.w8,(0,s.Z)((0,a.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:m,label:x}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,c.jsx)(u.kp,(0,a.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),v={icon:i.dzP,title:"Select",description:"A dropdown field of options for content creators."},g=r.object().shape({type:r.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(h,"id"))}),b={FormFields:h,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:g,Meta:v,TYPE_NAME:"Select"}},810:function(e,n,t){"use strict";t.d(n,{P:function(){return M}});var i=t(62230),r=t(65186),o=t(65413),l=t(60113),a=t(83462),s=t(85244),c=t(17064),u=t(81541),d=t(52322),f=t(3026),p=t(39031),x=t(89853),m=t(90569),h=t(34671),v=t(47927),g=t(76635),b=t(2784),y=t(75289),j=t(8799),Z=t(34543),k=function(e){return function(n){var t=n.size;return(0,d.jsx)("span",{style:{fontSize:t},children:e})}},C=[{value:"paragraph",label:"P",icon:k("p")},{value:"preformatted",label:"PRE",icon:k("pre")},{value:"heading1",label:"H1",icon:k("h1")},{value:"heading2",label:"H2",icon:k("h2")},{value:"heading3",label:"H3",icon:k("h3")},{value:"heading4",label:"H4",icon:k("h4")},{value:"heading5",label:"H5",icon:k("h5")},{value:"heading6",label:"H6",icon:k("h6")},{value:"strong",label:"Strong",icon:k((0,d.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:k((0,d.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:k((0,d.jsx)(Z.eR7,{}))},{value:"image",label:"image",icon:k((0,d.jsx)(Z.LFN,{}))},{value:"embed",label:"embed",icon:k((0,d.jsx)(Z.xqv,{}))},{value:"list-item",label:"list",icon:k((0,d.jsx)(Z.SnF,{}))},{value:"o-list-item",label:"o",icon:k((0,d.jsx)(j.KyO,{}))},{value:"rtl",label:"rtl",icon:k("rtl")},],S=C.map(function(e){return e.value}),I=function(e){return!S.find(function(n){return!e.includes(n)})},F=function(e){var n=e.split(",");return C.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,u.Z)(e).concat([i]):e},[])};function E(e,n){return(0,v.has)("parent",e)&&(0,g.isObject)(e.parent)&&(0,v.has)(n,e.parent)&&(0,g.isString)(e.parent[n])?e.parent[n]:null}function w(e){return function(){return o.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=E(t,e),r=E(t,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!S.includes(e)})}})}}var T=(0,s.Z)((0,i.Z)({},m.J),{allowTargetBlank:(0,h.Jg)("Allow target blank for links"),single:{validate:w("single")},multi:{validate:w("multi")}}),A=["config.single","config.multi"],_=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,a=e.setFieldValue,s=i.config,m=s.single,h=s.multi,v=m?F(m):h&&F(h)||S,g=(0,b.useState)(!m),j=g[0],Z=g[1],k=(0,b.useState)(v),E=k[0],w=k[1];return(0,b.useEffect)(function(){var e=j?1:0;a(A[e],E.join(",")),setTimeout(function(){a(A[1-e],void 0)},100)},[j,E]),(0,d.jsxs)(f.k,{children:[Object.entries(T).map(function(e){var n=(0,c.Z)(e,2),i=n[0],r=n[1];return(0,d.jsx)(f.J,{children:(0,d.jsx)(x.Z,{fieldName:(0,l.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,d.jsxs)(f.J,{children:[(0,d.jsxs)(y.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,d.jsx)(y.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(I(E))return w([]);w(S)},children:I(E)?"Unselect All":"Select all"})]}),C.map(function(e){return(0,d.jsx)(p.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:E.includes(e.value),onClick:function(){if(E.find(function(n){return n===e.value}))return w(E.filter(function(n){return n!==e.value}));w((0,u.Z)(E).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[j?"multi":"single"])?(0,d.jsx)(y.xu,{sx:{position:"absolute"},children:(0,d.jsx)(y.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[j?"multi":"single"]})}):null]}),(0,d.jsx)(f.J,{children:(0,d.jsx)(y.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,d.jsxs)(y.__,{variant:"label.border",children:[(0,d.jsx)(y.XZ,{checked:j,onChange:function(){return Z(!j)}}),"Allow multiple paragraphs"]})})})]})},N={icon:r.BAW,title:"Rich Text",description:"A rich text field with formatting options"},R=o.object().shape({type:o.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,a.B9)((0,i.Z)({},T,{labels:{yupType:"array",validate:{}}}),"id"))}),M={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:S.join(",")}}},FormFields:T,Meta:N,schema:R,TYPE_NAME:"StructuredText",Form:_}},89928:function(e,n,t){"use strict";t.d(n,{y:function(){return u}});var i=t(65186),r=t(65413),o=t(60113),l=t(90569),a=t(83462),s=l.J,c=r.object().shape({type:r.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,a.B9)(s,"id"))}),u={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:i.SQS,title:"Key Text",description:"A simple text string field"},schema:c,TYPE_NAME:"Text",FormFields:s}},64797:function(e,n,t){"use strict";t.d(n,{d:function(){return u}});var i,r=t(65186),o=t(65413),l=t(60113),a=t(90569),s=t(83462),c=a.J,u={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:o.object().shape({type:o.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,s.B9)(c,"id"))}),FormFields:c,TYPE_NAME:"Timestamp",Meta:{icon:r.f$3,title:"Timestamp",description:"A calendar date picker with time"}}},2353:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.H},Color:function(){return r.S},ContentRelationship:function(){return o.l},Date:function(){return l.v},Embed:function(){return a.S},GeoPoint:function(){return s.X},Image:function(){return c.b},Link:function(){return u.h},LinkToMedia:function(){return d.H},Number:function(){return f.L},Select:function(){return p.u},StructuredText:function(){return x.P},Text:function(){return m.y},Timestamp:function(){return h.d},UID:function(){return I}});var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797),v=t(62230),g=t(85244),b=t(65186),y=t(65413),j=t(60113),Z=t(90569),k=t(83462),C={label:Z.J.label,id:(0,g.Z)((0,v.Z)({},Z.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:Z.J.placeholder},S=y.object().shape({type:y.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,j.gc)((0,k.B9)(C,"id"))}),I={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:b.izl,title:"UID",description:"Unique Identifier"},schema:S,TYPE_NAME:"UID",FormFields:C}},44384:function(e,n,t){"use strict";var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797);n.Z=[x.P,c.b,u.h,d.H,o.l,p.u,i.H,l.v,h.d,a.S,f.L,s.X,r.S,m.y,]},83239:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return r.Boolean},Color:function(){return r.Color},ContentRelationship:function(){return r.ContentRelationship},Date:function(){return r.Date},Embed:function(){return r.Embed},GeoPoint:function(){return r.GeoPoint},Group:function(){return q},Image:function(){return r.Image},Link:function(){return r.Link},LinkToMedia:function(){return r.LinkToMedia},Number:function(){return r.Number},Select:function(){return r.Select},SharedSlice:function(){return D},SliceZone:function(){return O},StructuredText:function(){return r.StructuredText},Text:function(){return r.Text},Timestamp:function(){return r.Timestamp},UID:function(){return r.UID}});var i,r=t(2353),o=t(65186),l=t(65413),a=t(62230),s=t(85244),c=t(17064),u=t(52322),d=t(3026),f=t(89853),p=t(60113),x=t(90569),m=t(34671),h=t(75289),v=(0,s.Z)((0,a.Z)({},x.J),{repeat:(0,m.Jg)("Repeatable",!1,!0)}),g=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,u.jsxs)(d.k,{children:[Object.entries(v).filter(function(e){return"repeat"!==(0,c.Z)(e,1)[0]}).map(function(e){var i=(0,c.Z)(e,2),r=i[0],o=i[1];return(0,u.jsx)(d.J,{children:(0,u.jsx)(f.Z,{fieldName:(0,p.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,u.jsx)(d.J,{children:(0,u.jsx)(h.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,u.jsxs)(h.__,{variant:"label.border",sx:{mb:0},children:[(0,u.jsx)(h.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},b=t(98240),y=t(81541),j=t(99968),Z=t(28728),k=t(4092),C=t(75012),S=t(70697),I=t(9620),F=t(14137),E=t(44384),w=t(83462),T=t(82770),A=t(91061),_=t(81787),N=t(38876),R=t(2784),M=t(40023),z=t(28316),B=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),o=e.isRepeatable,l=e.item,d=e.draggableId,f=(e.renderFieldAccessor,(0,b.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","renderFieldAccessor"])),p=(0,R.useState)(!1),x=p[0],m=p[1],v=(0,R.useState)(null),g=v[0],B=v[1],q=(0,R.useState)({isOpen:!1}),D=q[0],O=q[1],P=(0,_.G)(),V=P.customType,L=P.setCustomType,H=function(e){B({widgetTypeName:e}),m(!1)},J=function(){B(null)},U=function(){O({isOpen:!1})},W=function(e){var t=e.id,i=e.label,o=e.widgetTypeName,a=r[o].create(i),s=F.L$.fromSM(a),c=(0,A.kQ)({customType:V,sectionId:n,groupFieldId:l.key,newField:s,newFieldId:t});L(c),T.Xe.track({event:"field:added",id:t,name:i,type:o,isInAGroup:!0,contentType:"page"===V.format?"page type":"custom type"})},$=function(e){var t=e.apiId,i=e.newKey,o=e.value;if(!(0,w.Ss)(r,o.type)){var a=F.L$.fromSM(o),s=(0,A.l9)({customType:V,sectionId:n,groupFieldId:l.key,previousFieldId:t,newFieldId:i,newField:a});L(s)}},G=function(e){if(!(0,w.uS)(e)){var t=e.source,i=e.destination;if(i){var r=t.index,o=i.index,a=(0,A.GA)({customType:V,sectionId:n,groupFieldId:l.key,sourceIndex:r,destinationIndex:o});(0,z.flushSync)(function(){return L(a)})}}},Y=function(e){var t=(0,A.j6)({customType:V,sectionId:n,groupFieldId:l.key,fieldId:e});L(t)},X=function(e){O({isOpen:!0,field:e});var n=(0,c.Z)(e,2),t=n[0],i=n[1];T.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:"page"===V.format?"page type":"custom type"})};return(0,u.jsxs)(R.Fragment,{children:[(0,u.jsx)(Z.Z,(0,s.Z)((0,a.Z)({item:l,widget:t,draggableId:d,renderFieldAccessor:function(e){return"data.".concat(l.key,".[...]")}},f),{CustomEditElements:[(0,u.jsx)(h.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return m(!0)},children:"Add Field"},"custom-edit-element-".concat(l.key)),],children:(0,u.jsx)(h.xu,{sx:{ml:4},children:(0,u.jsx)(M.Z5,{onDragEnd:G,children:(0,u.jsx)(M.bK,{droppableId:"".concat(n,"-").concat(l.key,"-zone"),children:function(e){return(0,u.jsxs)("ul",(0,s.Z)((0,a.Z)({ref:e.innerRef},e.droppableProps),{children:[l.value.config.fields.map(function(e,n){var t=e.value,c=t.config,d=t.type,f=(0,j.t)(r,c,d);if(!f)return null;var p={item:e,index:n,widget:f,key:e.key,enterEditMode:X,deleteItem:Y,renderFieldAccessor:function(e){return"data.".concat(l.key,".").concat(e)},draggableId:"group-".concat(l.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(l.key,"-").concat(e.key)},x=(0,u.jsx)(S.Z,{item:e,show:i,isRepeatable:o,renderHintBase:function(e){var n=e.item;return"data.".concat(l.key).concat((0,N.Ti)(n.key))},Widgets:r,typeName:f.CUSTOM_NAME||f.TYPE_NAME});return(0,u.jsx)(Z.Z,(0,s.Z)((0,a.Z)({},p),{HintElement:x}))}),e.placeholder,g&&(0,u.jsx)(I.Z,(0,s.Z)((0,a.Z)({},g),{fields:l.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];W.apply(void 0,(0,y.Z)(n)),B(null)},onCancelNewField:J}))]}))}})})})})),(0,u.jsx)(C.Z,{data:{isOpen:x},close:function(){return m(!1)},onSelect:H,widgetsArray:E.Z}),(0,u.jsx)(k.Z,{data:D,close:U,onSave:$,fields:l.value.config.fields})]})},q={Meta:{icon:o.cC1,title:"Group",description:"A Group of Prismic fields"},Form:g,FormFields:v,schema:l.object().shape({type:l.string().matches(/^Group$/,{excludeEmptyString:!0}).required(),config:l.object().shape({fields:l.array(),label:l.string(),placeholder:l.string(),repeat:l.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:B,TYPE_NAME:"Group"},D=null,O=null},83462:function(e,n,t){"use strict";t.d(n,{B9:function(){return s},Ss:function(){return u},uS:function(){return c},zg:function(){return d}});var i=t(98240),r=t(9849),o=t(65413),l=t(60113),a=t(90569),s=function(e,n){return e[n],(0,i.Z)(e,[n].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},u=function(e,n){return!e[n]&&(console.log('Could not find widget with type name "'.concat(n,'".')),!0)},d=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return s},Bu:function(){return c}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715);t(82432),t(84779);var s=function(e){return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_2a96i71 _1ecs97dez0 _1ecs97dez2 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezb _1ecs97dezr"}))},c=function(e){var n=e.actions,t=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:"_2a96i73 _2a96i72 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97d6r8 _1ecs97d6yl _1ecs97df2l _1ecs97dez1 _1ecs97df71 _1ecs97dfie _1ecs97d18 _1ecs97d8l _1ecs97df29 _1ecs97df92 _1ecs97dfi1",children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dezd _1ecs97df92 _1ecs97dezj _1ecs97df51",children:n}):null]}))}},47976:function(e,n,t){"use strict";t.d(n,{X:function(){return o}});var i=t(52322),r=t(22715),o=function(e){var n,t=e.status;switch(t){case"pending":n={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":n={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":n={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[n.icon,(0,i.jsx)(r.xv,{color:"grey11",children:n.text})]})}},81787:function(e,n,t){"use strict";t.d(n,{G:function(){return h},k:function(){return m}});var i=t(22710),r=t(99267),o=t(52322),l=t(74217),a=t(82770),s=t(91061),c=t(50950),u=t(26921),d=t(90374),f=t(2784),p=t(78656),x=(0,f.createContext)(void 0);function m(e){var n=e.children,t=e.initialCustomType,m=(0,f.useState)(t),h=m[0],v=m[1],g=(0,s.y6)(h),b=p.$[g],y=(0,u.c)({errorMessage:b.autoSaveFailed}),j=y.actionQueueStatus,Z=y.setNextAction,k=(0,d.Z)().saveCustomTypeSuccess,C=(0,l.R9)(k),S=(0,c.g)().syncChanges,I=(0,f.useCallback)(function(e){v(e),Z((0,i.Z)(function(){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,a.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return C(e),S(),[2]}})}))},[Z,C,S]),F=(0,f.useMemo)(function(){return{actionQueueStatus:j,customType:h,setCustomType:I}},[j,h,I]);return(0,o.jsx)(x.Provider,{value:F,children:"function"==typeof n?n(F):n})}function h(){var e=(0,f.useContext)(x);if(!e)throw Error("CustomTypeProvider not found");return e}},84779:function(){},82432:function(){}}]);
|