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,10 +1,3 @@
|
|
|
1
|
-
import EditModal from "@lib/builders/common/EditModal";
|
|
2
|
-
import Zone from "@lib/builders/common/Zone";
|
|
3
|
-
import { WidgetsArea } from "@lib/models/common/Slice";
|
|
4
|
-
import * as Widgets from "@lib/models/common/widgets";
|
|
5
|
-
import sliceBuilderWidgetsArray from "@lib/models/common/widgets/sliceBuilderArray";
|
|
6
|
-
import { AnyWidget } from "@lib/models/common/widgets/Widget";
|
|
7
|
-
import { ensureDnDDestination } from "@lib/utils";
|
|
8
1
|
import {
|
|
9
2
|
Box,
|
|
10
3
|
Dialog,
|
|
@@ -12,25 +5,35 @@ import {
|
|
|
12
5
|
DialogContent,
|
|
13
6
|
DialogHeader,
|
|
14
7
|
} from "@prismicio/editor-ui";
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from "
|
|
19
|
-
|
|
20
|
-
import {
|
|
8
|
+
import { GroupFieldType } from "@prismicio/types-internal/lib/customtypes";
|
|
9
|
+
import { FC, useState } from "react";
|
|
10
|
+
import { DropResult } from "react-beautiful-dnd";
|
|
11
|
+
import { flushSync } from "react-dom";
|
|
12
|
+
|
|
13
|
+
import { telemetry } from "@/apiClient";
|
|
14
|
+
import { List } from "@/components/List";
|
|
21
15
|
import {
|
|
22
16
|
addField,
|
|
23
17
|
deleteField,
|
|
24
18
|
deleteRepeatableZone,
|
|
25
19
|
reorderField,
|
|
26
20
|
updateField,
|
|
27
|
-
} from "
|
|
28
|
-
import { useSliceState } from "
|
|
29
|
-
import { useGroupsInSlicesExperiment } from "
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
21
|
+
} from "@/domain/slice";
|
|
22
|
+
import { useSliceState } from "@/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
23
|
+
import { useGroupsInSlicesExperiment } from "@/features/slices/sliceBuilder/useGroupsInSlicesExperiment";
|
|
24
|
+
import EditModal from "@/legacy/lib/builders/common/EditModal";
|
|
25
|
+
import Zone from "@/legacy/lib/builders/common/Zone";
|
|
26
|
+
import { Groups } from "@/legacy/lib/models/common/Group";
|
|
27
|
+
import {
|
|
28
|
+
SlicePrimaryFieldSM,
|
|
29
|
+
WidgetsArea,
|
|
30
|
+
} from "@/legacy/lib/models/common/Slice";
|
|
31
|
+
import * as Widgets from "@/legacy/lib/models/common/widgets";
|
|
32
|
+
import groupBuilderWidgetsArray from "@/legacy/lib/models/common/widgets/groupBuilderArray";
|
|
33
|
+
import sliceBuilderWidgetsArray from "@/legacy/lib/models/common/widgets/sliceBuilderArray";
|
|
34
|
+
import { ensureDnDDestination } from "@/legacy/lib/utils";
|
|
35
|
+
import { transformKeyAccessor } from "@/legacy/lib/utils/str";
|
|
36
|
+
import { getContentTypeForTracking } from "@/utils/getContentTypeForTracking";
|
|
34
37
|
|
|
35
38
|
const dataTipText = ` The non-repeatable zone
|
|
36
39
|
is for fields<br/> that should appear once, like a<br/>
|
|
@@ -108,34 +111,21 @@ const FieldZones: FC = () => {
|
|
|
108
111
|
}: {
|
|
109
112
|
id: string;
|
|
110
113
|
label: string;
|
|
111
|
-
widgetTypeName:
|
|
114
|
+
widgetTypeName: keyof typeof Widgets;
|
|
112
115
|
}) => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
const widget = sliceBuilderWidgetsArray.find(
|
|
117
|
+
(sliceBuilderWidget) =>
|
|
118
|
+
sliceBuilderWidget.CUSTOM_NAME === widgetTypeName ||
|
|
119
|
+
sliceBuilderWidget.TYPE_NAME === widgetTypeName,
|
|
120
|
+
);
|
|
118
121
|
if (!widget) {
|
|
119
|
-
|
|
120
|
-
`Could not find widget with type name "${widgetTypeName}". Please contact us!`,
|
|
121
|
-
);
|
|
122
|
+
throw new Error(`Unsupported Field Type: ${widgetTypeName}`);
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
const newField = widget.create(label) as NestableWidget;
|
|
126
|
-
|
|
127
|
-
if (
|
|
128
|
-
newField.type === "Range" ||
|
|
129
|
-
newField.type === "IntegrationFields" ||
|
|
130
|
-
newField.type === "Separator"
|
|
131
|
-
) {
|
|
132
|
-
throw new Error(`Unsupported Field Type: ${newField.type}`);
|
|
133
|
-
}
|
|
125
|
+
const newField = widget.create(label) as SlicePrimaryFieldSM;
|
|
134
126
|
|
|
135
127
|
try {
|
|
136
|
-
|
|
137
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
138
|
-
CurrentWidget.schema.validateSync(newField, { stripUnknown: false });
|
|
128
|
+
widget.schema.validateSync(newField, { stripUnknown: false });
|
|
139
129
|
} catch (error) {
|
|
140
130
|
throw new Error(`Model is invalid for widget "${newField.type}".`);
|
|
141
131
|
}
|
|
@@ -145,7 +135,8 @@ const FieldZones: FC = () => {
|
|
|
145
135
|
variationId: variation.id,
|
|
146
136
|
widgetArea,
|
|
147
137
|
newFieldId: id,
|
|
148
|
-
newField
|
|
138
|
+
newField:
|
|
139
|
+
newField.type === GroupFieldType ? Groups.fromSM(newField) : newField,
|
|
149
140
|
});
|
|
150
141
|
|
|
151
142
|
setSlice(newSlice);
|
|
@@ -154,9 +145,9 @@ const FieldZones: FC = () => {
|
|
|
154
145
|
event: "field:added",
|
|
155
146
|
id,
|
|
156
147
|
name: label,
|
|
157
|
-
type:
|
|
148
|
+
type: newField.type,
|
|
158
149
|
isInAGroup: false,
|
|
159
|
-
contentType:
|
|
150
|
+
contentType: getContentTypeForTracking(window.location.pathname),
|
|
160
151
|
});
|
|
161
152
|
};
|
|
162
153
|
|
|
@@ -193,14 +184,17 @@ const FieldZones: FC = () => {
|
|
|
193
184
|
<List>
|
|
194
185
|
<Zone
|
|
195
186
|
zoneType="slice"
|
|
196
|
-
zoneTypeFormat={undefined}
|
|
197
187
|
tabId={undefined}
|
|
198
188
|
title="Fields"
|
|
199
189
|
dataTip={dataTipText}
|
|
200
190
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
201
191
|
fields={variation.primary}
|
|
202
192
|
EditModal={EditModal}
|
|
203
|
-
widgetsArray={
|
|
193
|
+
widgetsArray={
|
|
194
|
+
groupsInSlicesExperiment.eligible
|
|
195
|
+
? sliceBuilderWidgetsArray
|
|
196
|
+
: groupBuilderWidgetsArray
|
|
197
|
+
}
|
|
204
198
|
onDeleteItem={_onDeleteItem(WidgetsArea.Primary)}
|
|
205
199
|
onSave={_onSave(WidgetsArea.Primary)}
|
|
206
200
|
onSaveNewField={_onSaveNewField(WidgetsArea.Primary)}
|
|
@@ -221,12 +215,11 @@ const FieldZones: FC = () => {
|
|
|
221
215
|
{!groupsInSlicesExperiment.eligible || hasItems ? (
|
|
222
216
|
<Zone
|
|
223
217
|
zoneType="slice"
|
|
224
|
-
zoneTypeFormat={undefined}
|
|
225
218
|
tabId={undefined}
|
|
226
219
|
isRepeatable
|
|
227
220
|
title="Repeatable Zone"
|
|
228
221
|
dataTip={dataTipText2}
|
|
229
|
-
widgetsArray={
|
|
222
|
+
widgetsArray={groupBuilderWidgetsArray}
|
|
230
223
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
231
224
|
fields={variation.items}
|
|
232
225
|
EditModal={EditModal}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import Card from "@components/Card/Default";
|
|
2
|
-
import SliceMachineModal from "@components/SliceMachineModal";
|
|
3
|
-
import { VariationSM } from "@lib/models/common/Slice";
|
|
4
1
|
import { Box, Button } from "@prismicio/editor-ui";
|
|
5
2
|
import { Field, Form, Formik } from "formik";
|
|
6
3
|
import { camelCase } from "lodash";
|
|
@@ -8,6 +5,10 @@ import React, { useEffect, useState } from "react";
|
|
|
8
5
|
import Select from "react-select";
|
|
9
6
|
import { Input, Label, Text } from "theme-ui";
|
|
10
7
|
|
|
8
|
+
import Card from "@/legacy/components/Card/Default";
|
|
9
|
+
import SliceMachineModal from "@/legacy/components/SliceMachineModal";
|
|
10
|
+
import { VariationSM } from "@/legacy/lib/models/common/Slice";
|
|
11
|
+
|
|
11
12
|
const Error = ({ msg }: { msg?: string }) => (
|
|
12
13
|
<Text as="span" sx={{ fontSize: 12, color: "error", mt: "5px", ml: 2 }}>
|
|
13
14
|
{/* eslint-disable-next-line @typescript-eslint/strict-boolean-expressions, @typescript-eslint/prefer-nullish-coalescing */}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import AddVariationModal from "@builders/SliceBuilder/Sidebar/AddVariationModal";
|
|
2
|
-
import { DeleteVariationModal } from "@components/DeleteVariationModal";
|
|
3
|
-
import { RenameVariationModal } from "@components/Forms/RenameVariationModal";
|
|
4
|
-
import ScreenshotChangesModal from "@components/ScreenshotChangesModal";
|
|
5
|
-
import type { VariationSM } from "@lib/models/common/Slice";
|
|
6
1
|
import { Box, Button, Gradient } from "@prismicio/editor-ui";
|
|
7
|
-
import { updateSlice } from "@src/apiClient";
|
|
8
|
-
import { copySliceVariation } from "@src/domain/slice";
|
|
9
|
-
import { useSliceState } from "@src/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
10
|
-
import { SharedSliceCard } from "@src/features/slices/sliceCards/SharedSliceCard";
|
|
11
|
-
import { SLICES_CONFIG } from "@src/features/slices/slicesConfig";
|
|
12
|
-
import { useScreenshotChangesModal } from "@src/hooks/useScreenshotChangesModal";
|
|
13
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
14
2
|
import { useRouter } from "next/router";
|
|
15
3
|
import { type FC, useState } from "react";
|
|
16
4
|
import { toast } from "react-toastify";
|
|
17
5
|
|
|
6
|
+
import { updateSlice } from "@/apiClient";
|
|
7
|
+
import { copySliceVariation } from "@/domain/slice";
|
|
8
|
+
import { useSliceState } from "@/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
9
|
+
import { SharedSliceCard } from "@/features/slices/sliceCards/SharedSliceCard";
|
|
10
|
+
import { SLICES_CONFIG } from "@/features/slices/slicesConfig";
|
|
11
|
+
import { useScreenshotChangesModal } from "@/hooks/useScreenshotChangesModal";
|
|
12
|
+
import { DeleteVariationModal } from "@/legacy/components/DeleteVariationModal";
|
|
13
|
+
import { RenameVariationModal } from "@/legacy/components/Forms/RenameVariationModal";
|
|
14
|
+
import ScreenshotChangesModal from "@/legacy/components/ScreenshotChangesModal";
|
|
15
|
+
import AddVariationModal from "@/legacy/lib/builders/SliceBuilder/Sidebar/AddVariationModal";
|
|
16
|
+
import type { VariationSM } from "@/legacy/lib/models/common/Slice";
|
|
17
|
+
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
18
|
+
|
|
18
19
|
type DialogState =
|
|
19
20
|
| { type: "ADD_VARIATION"; variation?: undefined; loading?: boolean }
|
|
20
21
|
| { type: "RENAME_VARIATION"; variation: VariationSM; loading?: boolean }
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { SIMULATOR_WINDOW_ID, VIDEO_SIMULATOR_TOOLTIP } from "@lib/consts";
|
|
2
1
|
import { Button, tokens } from "@prismicio/editor-ui";
|
|
3
|
-
import {
|
|
2
|
+
import { useRouter } from "next/router";
|
|
3
|
+
import React, { PropsWithChildren, useEffect, useRef } from "react";
|
|
4
|
+
import { useSelector } from "react-redux";
|
|
5
|
+
import ReactTooltip from "react-tooltip";
|
|
6
|
+
|
|
7
|
+
import { telemetry } from "@/apiClient";
|
|
4
8
|
import {
|
|
5
9
|
HoverCard,
|
|
6
10
|
HoverCardCloseButton,
|
|
7
11
|
HoverCardDescription,
|
|
8
12
|
HoverCardMedia,
|
|
9
13
|
HoverCardTitle,
|
|
10
|
-
} from "
|
|
11
|
-
import { PlayCircleIcon } from "
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
14
|
+
} from "@/components/HoverCard";
|
|
15
|
+
import { PlayCircleIcon } from "@/icons/PlayCircleIcon";
|
|
16
|
+
import {
|
|
17
|
+
SIMULATOR_WINDOW_ID,
|
|
18
|
+
VIDEO_SIMULATOR_TOOLTIP,
|
|
19
|
+
} from "@/legacy/lib/consts";
|
|
20
|
+
import { userHasSeenSimulatorToolTip } from "@/modules/userContext";
|
|
21
|
+
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
22
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
19
23
|
|
|
20
24
|
const SimulatorOnboardingTooltip: React.FC<
|
|
21
25
|
PropsWithChildren<{
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Box } from "@prismicio/editor-ui";
|
|
2
|
+
import { type FC } from "react";
|
|
3
|
+
|
|
4
|
+
import { BreadcrumbItem } from "@/components/Breadcrumb";
|
|
5
|
+
import { AutoSaveStatusIndicator } from "@/features/autoSave/AutoSaveStatusIndicator";
|
|
6
|
+
import { FloatingBackButton } from "@/features/slices/sliceBuilder/FloatingBackButton";
|
|
7
|
+
import { useSliceState } from "@/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
2
8
|
import {
|
|
3
9
|
AppLayout,
|
|
4
10
|
AppLayoutActions,
|
|
@@ -6,13 +12,8 @@ import {
|
|
|
6
12
|
AppLayoutBreadcrumb,
|
|
7
13
|
AppLayoutContent,
|
|
8
14
|
AppLayoutHeader,
|
|
9
|
-
} from "
|
|
10
|
-
import
|
|
11
|
-
import { BreadcrumbItem } from "@src/components/Breadcrumb";
|
|
12
|
-
import { AutoSaveStatusIndicator } from "@src/features/autoSave/AutoSaveStatusIndicator";
|
|
13
|
-
import { FloatingBackButton } from "@src/features/slices/sliceBuilder/FloatingBackButton";
|
|
14
|
-
import { useSliceState } from "@src/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
15
|
-
import { type FC } from "react";
|
|
15
|
+
} from "@/legacy/components/AppLayout";
|
|
16
|
+
import SimulatorButton from "@/legacy/lib/builders/SliceBuilder/SimulatorButton";
|
|
16
17
|
|
|
17
18
|
import FieldZones from "./FieldZones";
|
|
18
19
|
import { Sidebar } from "./Sidebar";
|
|
@@ -5,7 +5,8 @@ import { Box } from "theme-ui";
|
|
|
5
5
|
import {
|
|
6
6
|
FormFieldCheckbox,
|
|
7
7
|
FormFieldInput,
|
|
8
|
-
} from "
|
|
8
|
+
} from "@/legacy/components/FormFields";
|
|
9
|
+
|
|
9
10
|
import { FormTypes } from "../../../forms/types";
|
|
10
11
|
|
|
11
12
|
const WidgetFormField = ({ fieldName, formField, fields, initialValues }) => {
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import Card from "@components/Card/WithTabs";
|
|
2
|
-
import { Col, Flex as FlexGrid } from "@components/Flex";
|
|
3
|
-
import ItemHeader from "@components/ItemHeader";
|
|
4
|
-
import SliceMachineModal from "@components/SliceMachineModal";
|
|
5
|
-
import { createFieldNameFromKey, createInitialValues } from "@lib/forms";
|
|
6
|
-
import { DeprecatedMockConfigMessage } from "@lib/models/common/DeprecatedMockConfigMessage";
|
|
7
|
-
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
8
|
-
import { removeProp } from "@lib/utils";
|
|
9
1
|
import Modal from "react-modal";
|
|
10
2
|
import { Box, Button, Close, Flex, useThemeUI } from "theme-ui";
|
|
11
3
|
import * as yup from "yup";
|
|
12
4
|
|
|
5
|
+
import Card from "@/legacy/components/Card/WithTabs";
|
|
6
|
+
import { Col, Flex as FlexGrid } from "@/legacy/components/Flex";
|
|
7
|
+
import ItemHeader from "@/legacy/components/ItemHeader";
|
|
8
|
+
import SliceMachineModal from "@/legacy/components/SliceMachineModal";
|
|
9
|
+
import {
|
|
10
|
+
createFieldNameFromKey,
|
|
11
|
+
createInitialValues,
|
|
12
|
+
} from "@/legacy/lib/forms";
|
|
13
|
+
import { DeprecatedMockConfigMessage } from "@/legacy/lib/models/common/DeprecatedMockConfigMessage";
|
|
14
|
+
import * as Widgets from "@/legacy/lib/models/common/widgets/withGroup";
|
|
15
|
+
import { removeProp } from "@/legacy/lib/utils";
|
|
16
|
+
|
|
13
17
|
import { findWidgetByConfigOrType } from "../../utils";
|
|
14
18
|
import WidgetFormField from "./Field";
|
|
15
19
|
import WidgetForm from "./Form";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import Card from "@components/Card";
|
|
2
|
-
import { Col, Flex as FlexGrid } from "@components/Flex";
|
|
3
|
-
import SliceMachineModal from "@components/SliceMachineModal";
|
|
4
1
|
import Modal from "react-modal";
|
|
5
2
|
import { Close, Flex, Heading } from "theme-ui";
|
|
6
3
|
|
|
4
|
+
import Card from "@/legacy/components/Card";
|
|
5
|
+
import { Col, Flex as FlexGrid } from "@/legacy/components/Flex";
|
|
6
|
+
import SliceMachineModal from "@/legacy/components/SliceMachineModal";
|
|
7
|
+
|
|
7
8
|
import FieldTypeCard from "./FieldTypeCard";
|
|
8
9
|
|
|
9
10
|
if (process.env.NODE_ENV !== "test") {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ReactTooltipPortal } from "@components/ReactTooltipPortal";
|
|
2
1
|
import { FaRegQuestionCircle } from "react-icons/fa";
|
|
3
2
|
import ReactTooltip from "react-tooltip";
|
|
4
3
|
|
|
4
|
+
import { ReactTooltipPortal } from "@/legacy/components/ReactTooltipPortal";
|
|
5
|
+
|
|
5
6
|
interface ErrorTooltip {
|
|
6
7
|
error?: string;
|
|
7
8
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import Code from "@components/CodeBlock";
|
|
2
1
|
import { NestableWidget, UID } from "@prismicio/types-internal/lib/customtypes";
|
|
3
2
|
import React, { useState } from "react";
|
|
4
3
|
import { BiCopy } from "react-icons/bi";
|
|
@@ -6,6 +5,8 @@ import { BsCode } from "react-icons/bs";
|
|
|
6
5
|
import { MdCheck } from "react-icons/md";
|
|
7
6
|
import { Box, Button, Flex, Text, useThemeUI } from "theme-ui";
|
|
8
7
|
|
|
8
|
+
import Code from "@/legacy/components/CodeBlock";
|
|
9
|
+
|
|
9
10
|
const buttonIconStyle: React.CSSProperties = {
|
|
10
11
|
position: "relative",
|
|
11
12
|
top: "3px",
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getInputFieldStyles,
|
|
3
|
-
InputFieldStyles,
|
|
4
|
-
} from "@components/FormFields/Input";
|
|
5
|
-
import { createInitialValues, createValidationSchema } from "@lib/forms";
|
|
6
|
-
import { validateId } from "@lib/forms/defaults";
|
|
7
|
-
import { InputType } from "@lib/forms/fields";
|
|
8
|
-
import { AnyWidget } from "@lib/models/common/widgets/Widget";
|
|
9
|
-
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
10
|
-
import { slugify } from "@lib/utils/str";
|
|
11
1
|
import { Button } from "@prismicio/editor-ui";
|
|
12
2
|
import * as CSS from "csstype";
|
|
13
3
|
import { Field, Form, Formik } from "formik";
|
|
@@ -15,6 +5,20 @@ import { Ref, SetStateAction, useEffect, useRef, useState } from "react";
|
|
|
15
5
|
import { Flex, Input, Text, useThemeUI } from "theme-ui";
|
|
16
6
|
import { AnyObjectSchema } from "yup";
|
|
17
7
|
|
|
8
|
+
import {
|
|
9
|
+
getInputFieldStyles,
|
|
10
|
+
InputFieldStyles,
|
|
11
|
+
} from "@/legacy/components/FormFields/Input";
|
|
12
|
+
import {
|
|
13
|
+
createInitialValues,
|
|
14
|
+
createValidationSchema,
|
|
15
|
+
} from "@/legacy/lib/forms";
|
|
16
|
+
import { validateId } from "@/legacy/lib/forms/defaults";
|
|
17
|
+
import { InputType } from "@/legacy/lib/forms/fields";
|
|
18
|
+
import { AnyWidget } from "@/legacy/lib/models/common/widgets/Widget";
|
|
19
|
+
import * as Widgets from "@/legacy/lib/models/common/widgets/withGroup";
|
|
20
|
+
import { slugify } from "@/legacy/lib/utils/str";
|
|
21
|
+
|
|
18
22
|
import { ErrorTooltip } from "./ErrorTooltip";
|
|
19
23
|
|
|
20
24
|
interface NewField {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import Li from "@components/Li";
|
|
2
|
-
import ListItem from "@components/ListItem";
|
|
3
|
-
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
4
1
|
import { DragDropContext, Droppable } from "react-beautiful-dnd";
|
|
5
2
|
import { Box, Text } from "theme-ui";
|
|
6
3
|
|
|
4
|
+
import Li from "@/legacy/components/Li";
|
|
5
|
+
import ListItem from "@/legacy/components/ListItem";
|
|
6
|
+
import * as Widgets from "@/legacy/lib/models/common/widgets/withGroup";
|
|
7
|
+
|
|
7
8
|
import { findWidgetByConfigOrType } from "../../../utils";
|
|
8
9
|
import Hint from "./components/Hints";
|
|
9
10
|
|
|
@@ -16,6 +17,7 @@ const FieldZone = ({
|
|
|
16
17
|
onDragEnd,
|
|
17
18
|
renderFieldAccessor,
|
|
18
19
|
onDeleteItem,
|
|
20
|
+
onSave,
|
|
19
21
|
showHints,
|
|
20
22
|
newField,
|
|
21
23
|
renderHintBase,
|
|
@@ -81,6 +83,8 @@ const FieldZone = ({
|
|
|
81
83
|
parentSnapshot: snapshot,
|
|
82
84
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
83
85
|
deleteItem: onDeleteItem,
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
87
|
+
saveItem: onSave,
|
|
84
88
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
|
85
89
|
draggableId: `list-item-${item.key}`,
|
|
86
90
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Button, Switch, Text } from "@prismicio/editor-ui";
|
|
2
|
-
import { telemetry } from "@src/apiClient";
|
|
3
|
-
import { ListHeader } from "@src/components/List";
|
|
4
2
|
import { array, arrayOf, bool, func, object, shape, string } from "prop-types";
|
|
5
3
|
import { useState } from "react";
|
|
6
4
|
import { BaseStyles } from "theme-ui";
|
|
7
5
|
|
|
6
|
+
import { telemetry } from "@/apiClient";
|
|
7
|
+
import { ListHeader } from "@/components/List";
|
|
8
|
+
import { getContentTypeForTracking } from "@/utils/getContentTypeForTracking";
|
|
9
|
+
|
|
8
10
|
import SelectFieldTypeModal from "../SelectFieldTypeModal";
|
|
9
11
|
import Card from "./Card";
|
|
10
12
|
import NewField from "./Card/components/NewField";
|
|
@@ -12,7 +14,6 @@ import EmptyState from "./components/EmptyState";
|
|
|
12
14
|
|
|
13
15
|
const Zone = ({
|
|
14
16
|
zoneType /* type of the zone: customType or slice */,
|
|
15
|
-
zoneTypeFormat /* format of the zone: custom or page (or undefined if not a custom type) */,
|
|
16
17
|
tabId,
|
|
17
18
|
title /* text info to display in Card Header */,
|
|
18
19
|
fields /* widgets registered in the zone */,
|
|
@@ -61,12 +62,7 @@ const Zone = ({
|
|
|
61
62
|
name: model.config.label,
|
|
62
63
|
type: model.type,
|
|
63
64
|
isInAGroup: false,
|
|
64
|
-
contentType:
|
|
65
|
-
zoneType === "customType"
|
|
66
|
-
? zoneTypeFormat === "page"
|
|
67
|
-
? "page type"
|
|
68
|
-
: "custom type"
|
|
69
|
-
: "slice",
|
|
65
|
+
contentType: getContentTypeForTracking(window.location.pathname),
|
|
70
66
|
});
|
|
71
67
|
};
|
|
72
68
|
const enterSelectMode = () => {
|
|
@@ -158,6 +154,8 @@ const Zone = ({
|
|
|
158
154
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
159
155
|
onDeleteItem={onDeleteItem}
|
|
160
156
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
157
|
+
onSave={onSave}
|
|
158
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
161
159
|
testId={testId}
|
|
162
160
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
163
161
|
isRepeatableCustomType={isRepeatableCustomType}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { SIMULATOR_WINDOW_ID } from "@lib/consts";
|
|
2
1
|
import { useRouter } from "next/router";
|
|
3
2
|
import { MdErrorOutline } from "react-icons/md";
|
|
4
3
|
import { Box, Button, Text } from "theme-ui";
|
|
5
4
|
|
|
5
|
+
import { SIMULATOR_WINDOW_ID } from "@/legacy/lib/consts";
|
|
6
|
+
|
|
6
7
|
export const DeprecatedMockConfigMessage = () => {
|
|
7
8
|
const router = useRouter();
|
|
8
9
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CustomTypeSM } from "
|
|
2
|
-
import type { Screenshot } from "
|
|
3
|
-
import type { SliceSM } from "
|
|
1
|
+
import type { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
2
|
+
import type { Screenshot } from "@/legacy/lib/models/common/Library";
|
|
3
|
+
import type { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
4
4
|
|
|
5
5
|
// Generics
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentUI } from "
|
|
2
|
-
import { CustomTypeSM } from "
|
|
1
|
+
import { ComponentUI } from "@/legacy/lib/models/common/ComponentUI";
|
|
2
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
hasLocal,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
GroupFieldType,
|
|
3
|
+
NestableWidget,
|
|
2
4
|
SharedSlice,
|
|
3
5
|
Variation,
|
|
4
6
|
} from "@prismicio/types-internal/lib/customtypes";
|
|
@@ -6,6 +8,7 @@ import { getOrElseW } from "fp-ts/lib/Either";
|
|
|
6
8
|
import * as t from "io-ts";
|
|
7
9
|
|
|
8
10
|
import { FieldsSM } from "./Fields";
|
|
11
|
+
import { Groups, GroupSM } from "./Group";
|
|
9
12
|
|
|
10
13
|
const IMAGE_PLACEHOLDER_URL =
|
|
11
14
|
"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";
|
|
@@ -15,6 +18,14 @@ export enum WidgetsArea {
|
|
|
15
18
|
Items = "items",
|
|
16
19
|
}
|
|
17
20
|
|
|
21
|
+
export const SlicePrimaryFieldSM = t.union([GroupSM, NestableWidget]);
|
|
22
|
+
export type SlicePrimaryFieldSM = t.TypeOf<typeof SlicePrimaryFieldSM>;
|
|
23
|
+
|
|
24
|
+
export const SlicePrimaryFieldsSM = t.array(
|
|
25
|
+
t.type({ key: t.string, value: SlicePrimaryFieldSM }),
|
|
26
|
+
);
|
|
27
|
+
export type SlicePrimaryFieldsSM = t.TypeOf<typeof SlicePrimaryFieldsSM>;
|
|
28
|
+
|
|
18
29
|
export const VariationSM = t.intersection([
|
|
19
30
|
t.type({
|
|
20
31
|
id: t.string,
|
|
@@ -25,7 +36,7 @@ export const VariationSM = t.intersection([
|
|
|
25
36
|
}),
|
|
26
37
|
t.partial({
|
|
27
38
|
imageUrl: t.string,
|
|
28
|
-
primary:
|
|
39
|
+
primary: SlicePrimaryFieldsSM,
|
|
29
40
|
items: FieldsSM,
|
|
30
41
|
display: t.string,
|
|
31
42
|
}),
|
|
@@ -55,7 +66,10 @@ export const Variations = {
|
|
|
55
66
|
Variation.decode({
|
|
56
67
|
...variation,
|
|
57
68
|
primary: variation.primary?.reduce(
|
|
58
|
-
(acc, { key, value }) => ({
|
|
69
|
+
(acc, { key, value }) => ({
|
|
70
|
+
...acc,
|
|
71
|
+
[key]: value.type === GroupFieldType ? Groups.fromSM(value) : value,
|
|
72
|
+
}),
|
|
59
73
|
{},
|
|
60
74
|
),
|
|
61
75
|
items: variation.items?.reduce(
|
|
@@ -80,7 +94,7 @@ export const Variations = {
|
|
|
80
94
|
primary: Object.entries(variation.primary || {}).map(
|
|
81
95
|
([key, value]) => ({
|
|
82
96
|
key,
|
|
83
|
-
value,
|
|
97
|
+
value: value.type === GroupFieldType ? Groups.toSM(value) : value,
|
|
84
98
|
}),
|
|
85
99
|
),
|
|
86
100
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CustomTypeSM } from "
|
|
2
|
-
import { LocalOrRemoteCustomType } from "
|
|
1
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
2
|
+
import { LocalOrRemoteCustomType } from "@/legacy/lib/models/common/ModelData";
|
|
3
3
|
|
|
4
4
|
export const normalizeFrontendCustomType = (
|
|
5
5
|
localCustomType: CustomTypeSM,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, Library } from "
|
|
2
|
-
import { SliceSM } from "
|
|
1
|
+
import { Component, Library } from "@/legacy/lib/models/common/Library";
|
|
2
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
3
3
|
|
|
4
4
|
import { LocalOrRemoteSlice } from "../ModelData";
|
|
5
5
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Col, Flex as FlexGrid } from "@components/Flex";
|
|
2
|
-
import WidgetFormField from "@lib/builders/common/EditModal/Field";
|
|
3
|
-
import { createFieldNameFromKey } from "@lib/forms";
|
|
4
|
-
import { DefaultFields } from "@lib/forms/defaults";
|
|
5
|
-
import { selectAllCustomTypes } from "@src/modules/availableCustomTypes";
|
|
6
1
|
import { FormikProps } from "formik";
|
|
7
2
|
import { useSelector } from "react-redux";
|
|
8
3
|
import Select from "react-select";
|
|
9
4
|
import { Box, Label } from "theme-ui";
|
|
10
5
|
import * as yup from "yup";
|
|
11
6
|
|
|
7
|
+
import { Col, Flex as FlexGrid } from "@/legacy/components/Flex";
|
|
8
|
+
import WidgetFormField from "@/legacy/lib/builders/common/EditModal/Field";
|
|
9
|
+
import { createFieldNameFromKey } from "@/legacy/lib/forms";
|
|
10
|
+
import { DefaultFields } from "@/legacy/lib/forms/defaults";
|
|
11
|
+
import { selectAllCustomTypes } from "@/modules/availableCustomTypes";
|
|
12
|
+
|
|
12
13
|
import { hasLocal } from "../../ModelData";
|
|
13
14
|
|
|
14
15
|
const FormFields = {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { hasLocal } from "@lib/models/common/ModelData";
|
|
2
1
|
import { Link } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
3
|
-
import { selectAllCustomTypes } from "@src/modules/availableCustomTypes";
|
|
4
2
|
import { MdSettingsEthernet } from "react-icons/md";
|
|
5
3
|
import { useSelector } from "react-redux";
|
|
6
4
|
import * as yup from "yup";
|
|
7
5
|
|
|
6
|
+
import { hasLocal } from "@/legacy/lib/models/common/ModelData";
|
|
7
|
+
import { selectAllCustomTypes } from "@/modules/availableCustomTypes";
|
|
8
|
+
|
|
8
9
|
import { linkConfigSchema } from "../Link";
|
|
9
10
|
import { Widget } from "../Widget";
|
|
10
11
|
import Form, { FormFields } from "./Form";
|