slice-machine-ui 1.26.1-beta.2 → 1.26.1-beta.21
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/.eslintrc.js +6 -1
- package/.storybook/preview.tsx +2 -1
- package/out/404.html +1 -1
- package/out/_next/static/chunks/127-6451528762141246.js +1 -0
- package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad1d7303abecd2b.js} +1 -1
- package/out/_next/static/chunks/18539003-8854ec97730b0755.js +22 -0
- package/out/_next/static/chunks/569-2ae3e9666f3bf991.js +1 -0
- package/out/_next/static/chunks/614-873c38acd991869b.js +1 -0
- package/out/_next/static/chunks/756-61dc56b98d01e964.js +10 -0
- package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
- package/out/_next/static/chunks/91-717d764a224ac07f.js +1 -0
- package/out/_next/static/chunks/96-d28e81d2b1c10a08.js +1 -0
- package/out/_next/static/chunks/pages/_app-b18f49d5323fa9eb.js +530 -0
- package/out/_next/static/chunks/pages/changelog-042822d12df57669.js +1 -0
- package/out/_next/static/chunks/pages/changes-194f6cf187fa6ee7.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-ff73a06702296c34.js +1 -0
- package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-900b40b54b74e6d6.js} +1 -1
- package/out/_next/static/chunks/pages/{index-cf93d16e9c63b6db.js → index-ccd2975faba412f6.js} +1 -1
- package/out/_next/static/chunks/pages/labs-7a4fe64cb86b59e8.js +1 -0
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-30d471f6127ebed7.js +1 -0
- package/out/_next/static/chunks/pages/settings-419384d4d43070c2.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c431bb8d59974559.js +1 -0
- package/out/_next/static/chunks/pages/slices-98f88ac46b6ad58b.js +1 -0
- package/out/_next/static/css/22f264c93bd9d85f.css +1 -0
- package/out/_next/static/css/321d78460d2d69bc.css +1 -0
- package/out/_next/static/css/a686f7612f1943ed.css +1 -0
- package/out/_next/static/css/c47241940651ef2f.css +1 -0
- package/out/_next/static/css/dc201720b301472d.css +1 -0
- package/out/_next/static/css/e5745b5b0494af29.css +1 -0
- package/out/_next/static/jEpmnNgSaQQGEtlMfn4ek/_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 +10 -8
- package/sentry.client.config.ts +2 -1
- package/src/ErrorBoundary.tsx +1 -1
- package/src/apiClient.ts +13 -9
- package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
- package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
- package/src/components/BaseHoverCard/BaseHoverCard.tsx +1 -1
- package/src/components/BlankSlate/BlankSlate.module.css +74 -0
- package/src/components/BlankSlate/BlankSlate.module.css.d.ts +13 -0
- package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
- package/src/components/BlankSlate/BlankSlate.tsx +1 -1
- package/src/components/BlankSlate/index.ts +1 -1
- package/src/components/Breadcrumb/Breadcrumb.module.css +11 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css.d.ts +6 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +34 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +43 -25
- package/src/components/Breadcrumb/index.ts +1 -1
- package/src/components/Card/Card.stories.tsx +3 -3
- package/src/components/Card/Card.tsx +3 -2
- package/src/components/CodeBlock/CodeBlock.module.css +46 -0
- package/src/components/CodeBlock/CodeBlock.module.css.d.ts +10 -0
- package/src/components/CodeBlock/CodeBlock.tsx +7 -7
- package/src/components/ContentTabs/ContentTabs.module.css +60 -0
- package/src/components/ContentTabs/ContentTabs.module.css.d.ts +12 -0
- package/src/components/ContentTabs/ContentTabs.tsx +2 -2
- package/src/components/Count/Count.tsx +1 -1
- package/src/components/Divider/Divider.module.css +23 -0
- package/src/components/Divider/Divider.module.css.d.ts +7 -0
- package/src/components/Divider/Divider.stories.tsx +3 -4
- package/src/components/Divider/Divider.tsx +5 -8
- package/src/components/HoverCard/HoverCard.module.css +79 -0
- package/src/components/HoverCard/HoverCard.module.css.d.ts +13 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
- package/src/components/HoverCard/HoverCard.test.tsx +2 -2
- package/src/components/HoverCard/HoverCard.tsx +3 -3
- package/src/components/HoverCard/index.ts +3 -3
- package/src/components/PageLayout/PageLayout.module.css +1 -1
- package/src/components/SideNav/SideNav.module.css +1 -1
- package/src/components/SideNav/SideNav.stories.tsx +6 -6
- package/src/components/SideNav/SideNav.tsx +8 -8
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +10 -12
- package/src/components/Table/Table.stories.tsx +2 -2
- package/src/components/Table/Table.test.tsx +2 -2
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/Table/index.ts +1 -1
- package/src/components/TextLink/TextLink.module.css +58 -0
- package/src/components/TextLink/TextLink.module.css.d.ts +11 -0
- package/src/components/TextLink/TextLink.stories.tsx +1 -1
- package/src/components/TextLink/TextLink.tsx +5 -5
- package/src/domain/__tests__/customType.test.ts +1 -186
- package/src/domain/__tests__/group.test.ts +161 -0
- package/src/domain/__tests__/slice.test.ts +41 -0
- package/src/domain/customType.ts +1 -193
- package/src/domain/group.ts +89 -0
- package/src/domain/slice.ts +53 -12
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -2
- package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +1 -1
- package/src/features/changelog/useSliceMachineReleaseNotes.ts +1 -1
- package/src/features/changelog/useSliceMachineVersions.ts +2 -2
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +11 -14
- package/src/features/changes/PushChangesButton.tsx +5 -5
- package/src/features/changes/StatusBadge.tsx +2 -2
- package/src/features/customTypes/EditDropdown.tsx +6 -9
- package/src/features/customTypes/PageTypeOnboarding.tsx +5 -5
- package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +16 -18
- package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +11 -10
- package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -4
- package/src/features/customTypes/actions/createCustomType.ts +5 -5
- package/src/features/customTypes/actions/deleteCustomType.ts +3 -3
- package/src/features/customTypes/actions/renameCustomType.ts +3 -3
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -8
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +25 -15
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +7 -7
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +3 -3
- package/src/features/customTypes/customTypesBuilder/useCustomType.ts +1 -1
- package/src/features/customTypes/customTypesConfig.ts +2 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +16 -16
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +19 -20
- package/src/features/customTypes/customTypesTable/useCustomTypes.ts +8 -8
- package/src/features/documentation/MarkdownRenderer/index.tsx +5 -6
- package/src/features/documentation/useDocumentation.ts +1 -1
- package/src/features/environments/actions/getActiveEnvironment.ts +1 -1
- package/src/features/environments/actions/getEnvironments.ts +1 -1
- package/src/features/environments/actions/setEnvironment.ts +3 -3
- package/src/features/inAppGuide/InAppGuideContext.tsx +2 -2
- package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -4
- package/src/features/inAppGuide/inAppGuideContent.tsx +4 -4
- package/src/features/labs/labsList/LabsList.tsx +2 -2
- package/src/features/labs/labsList/LabsListItem.tsx +1 -1
- package/src/features/labs/labsList/LabsPage.tsx +8 -5
- package/src/features/labs/labsList/useLab.tsx +1 -1
- package/src/features/settings/SettingsPage.tsx +7 -4
- package/src/features/settings/git/ConnectGitRepository.tsx +9 -9
- package/src/features/settings/git/GitOwnerSelect.tsx +1 -1
- package/src/features/settings/git/GitProvider.ts +4 -4
- package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -1
- package/src/features/settings/git/GitRepositoriesList.tsx +5 -5
- package/src/features/settings/git/GitRepositoriesSearch.tsx +5 -5
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +5 -8
- package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
- package/src/features/settings/git/useGitOwners.ts +1 -1
- package/src/features/settings/git/useGitRepos.ts +1 -1
- package/src/features/settings/git/useLinkedGitRepos.ts +2 -2
- package/src/features/settings/git/useWriteAPIToken.ts +2 -2
- package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -2
- package/src/features/slices/actions/createSlice.ts +5 -5
- package/src/features/slices/actions/deleteSlice.ts +1 -1
- package/src/features/slices/actions/renameSlice.ts +4 -4
- package/src/features/slices/actions/uploadSliceScreenshot.ts +2 -2
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +10 -10
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +7 -7
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css +14 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css.d.ts +6 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +12 -12
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +5 -8
- package/src/features/slices/convertLegacySlice/types.ts +2 -2
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +6 -6
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -9
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +4 -4
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +3 -3
- package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +8 -0
- package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +4 -4
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +7 -7
- package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -2
- package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
- package/src/features/sync/AutoSyncProvider.tsx +17 -17
- package/src/features/sync/actions/pushChanges.ts +4 -3
- package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css +1 -1
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -4
- package/src/features/sync/fetchUnSyncChanges.ts +5 -5
- package/src/features/sync/getUnSyncChanges.ts +9 -9
- package/src/features/sync/useUnSyncChanges.ts +5 -5
- package/src/hooks/useActionQueue.tsx +5 -5
- package/src/hooks/useAdapterName.ts +1 -1
- package/src/hooks/useAuthStatus.ts +2 -2
- package/src/hooks/useCurrentSlice.tsx +4 -4
- package/src/hooks/useEditorContent.ts +5 -4
- package/src/hooks/useExperimentVariant.ts +2 -2
- package/src/hooks/useIsEmptyProject.ts +1 -1
- package/src/hooks/useRepositoryInformation.ts +2 -2
- package/src/hooks/useRouteChange.tsx +1 -1
- package/src/hooks/useSMTracker.ts +6 -6
- package/src/hooks/useScreenshotChangesModal.ts +4 -3
- package/src/hooks/useServerState.ts +4 -4
- package/src/hooks/useSliceMachineConfig.ts +2 -2
- package/src/hooks/useSliceMachineRunningVersion.ts +1 -1
- package/src/hooks/useThrottle.ts +1 -1
- package/src/hooks/useUpdateAvailable.ts +1 -1
- package/src/hooks/useWindowDimensions.ts +1 -1
- package/src/hooks/useWindowSize.ts +2 -1
- package/{components → src/legacy/components}/App/index.tsx +8 -8
- package/{components → src/legacy/components}/AppLayout/index.tsx +6 -7
- package/{components → src/legacy/components}/AuthInstructions/index.jsx +1 -1
- package/{components → src/legacy/components}/Button/index.tsx +1 -2
- package/{components → src/legacy/components}/Card/Default.jsx +2 -1
- package/{components → src/legacy/components}/Card/Preview.jsx +1 -1
- package/{components → src/legacy/components}/Card/WithTabs/index.jsx +4 -3
- package/{components → src/legacy/components}/Card/index.tsx +1 -0
- package/{components → src/legacy/components}/Changelog/index.tsx +8 -8
- package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +2 -1
- package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +1 -0
- package/{components → src/legacy/components}/Changelog/navigation/index.tsx +6 -6
- package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +6 -6
- package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
- package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +5 -5
- package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +5 -5
- package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -14
- package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -3
- package/{components → src/legacy/components}/CodeBlock/index.tsx +3 -3
- package/{components → src/legacy/components}/ConfigErrors/index.jsx +4 -3
- package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +9 -8
- package/{components → src/legacy/components}/DeleteCTModal/index.tsx +9 -9
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +4 -4
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +9 -9
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +9 -8
- package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +6 -6
- package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -6
- package/{components → src/legacy/components}/DropDownSelector/index.tsx +2 -4
- package/{components → src/legacy/components}/EmptyState/index.tsx +3 -3
- package/{components → src/legacy/components}/FormFields/Array.jsx +2 -4
- package/{components → src/legacy/components}/FormFields/Checkbox.jsx +1 -1
- package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +1 -1
- package/{components → src/legacy/components}/FormFields/Input.tsx +3 -2
- package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +1 -1
- package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +18 -18
- package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +10 -10
- package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +12 -12
- package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +8 -8
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css +5 -0
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +7 -7
- package/{components → src/legacy/components}/Forms/components/InputBox.tsx +2 -2
- package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +4 -3
- package/{components → src/legacy/components}/Forms/formsValidator.ts +6 -4
- package/{components → src/legacy/components}/FullPage/index.tsx +1 -1
- package/{components → src/legacy/components}/ListItem/Header.tsx +3 -2
- package/{components → src/legacy/components}/ListItem/index.tsx +8 -10
- package/{components → src/legacy/components}/LoadingPage/index.tsx +1 -0
- package/{components → src/legacy/components}/LoginModal/index.tsx +22 -22
- package/{components → src/legacy/components}/ModalFormCard/index.tsx +7 -6
- package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +18 -16
- package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -13
- package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +2 -2
- package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -3
- package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/VideoItem.tsx +14 -13
- package/src/legacy/components/Navigation/index.module.css +3 -0
- package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/index.test.tsx +12 -12
- package/{components → src/legacy/components}/Navigation/index.tsx +20 -21
- package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +12 -12
- package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +6 -6
- package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +7 -7
- package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +12 -15
- package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -1
- package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
- package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +3 -3
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +4 -5
- package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -7
- package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -4
- package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +4 -5
- package/{components → src/legacy/components}/Simulator/index.tsx +25 -30
- package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +3 -2
- package/{components → src/legacy/components}/ToasterContainer/index.tsx +3 -5
- package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -2
- package/{components → src/legacy/components}/Tooltip/index.jsx +2 -2
- package/{components → src/legacy/components}/Warnings/index.jsx +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -4
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +8 -8
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +11 -11
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -23
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +2 -2
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +3 -2
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +32 -32
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +5 -5
- package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +273 -0
- package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +7 -7
- package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/index.tsx +45 -37
- package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +12 -11
- package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +13 -9
- package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +3 -5
- package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +1 -1
- package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +14 -16
- package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +3 -4
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -2
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -5
- 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 +16 -13
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +15 -9
- package/{lib → src/legacy/lib}/builders/common/Zone/components/EmptyState/index.tsx +2 -2
- package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +7 -10
- package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
- package/{lib → src/legacy/lib}/forms/fields.ts +1 -2
- package/{lib → src/legacy/lib}/forms/index.ts +1 -0
- package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +5 -4
- package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +3 -2
- package/{lib → src/legacy/lib}/models/common/Environment.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/Group.ts +3 -2
- package/{lib → src/legacy/lib}/models/common/Library.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
- package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +10 -9
- package/{lib → src/legacy/lib}/models/common/Slice.ts +19 -5
- package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +3 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +5 -7
- package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +2 -3
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +9 -10
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +7 -7
- package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +2 -3
- package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -6
- package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +63 -76
- package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +6 -4
- package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +9 -11
- package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +3 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -7
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -6
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +4 -4
- package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +7 -7
- package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +3 -6
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +12 -11
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +3 -6
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +4 -5
- package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +4 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +3 -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 +4 -3
- package/{lib → src/legacy/lib}/utils/index.ts +4 -5
- package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
- package/src/modules/availableCustomTypes/index.ts +15 -13
- package/src/modules/availableCustomTypes/types.ts +2 -2
- package/src/modules/environment/index.ts +10 -8
- package/src/modules/environment/types.ts +1 -1
- package/src/modules/loading/index.ts +3 -2
- package/src/modules/modal/index.ts +4 -2
- package/src/modules/slices/index.ts +13 -9
- package/src/modules/slices/selector.ts +1 -1
- package/src/modules/slices/types.ts +2 -2
- package/src/modules/useSliceMachineActions.ts +25 -20
- package/src/modules/userContext/index.ts +5 -3
- package/{pages → src/pages}/_app.tsx +23 -25
- package/{pages → src/pages}/changelog.tsx +1 -1
- package/{pages → src/pages}/changes.tsx +25 -19
- package/src/pages/custom-types/[customTypeId].tsx +1 -0
- package/{pages → src/pages}/custom-types.tsx +1 -1
- package/{pages → src/pages}/index.tsx +3 -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 +3 -3
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -2
- package/{pages → src/pages}/slices.tsx +24 -21
- package/src/redux/reducer.ts +8 -7
- package/src/redux/store.ts +8 -6
- package/src/redux/type.ts +7 -6
- package/src/theme.ts +1 -2
- package/src/utils/getContentTypeForTracking.ts +21 -0
- package/test/__setup__.ts +12 -7
- 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 +3 -3
- 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 +5 -10
- package/components/Forms/RenameVariationModal/RenameVariationModal.css.ts +0 -7
- package/components/Navigation/index.css.ts +0 -5
- package/lib/builders/SliceBuilder/FieldZones/index.tsx +0 -216
- package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
- package/lib/models/common/widgets/withGroup.ts +0 -20
- package/out/_next/static/M7hTqxKEI7x7a09i22lAK/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-a5a5d48f20a7b261.js +0 -97
- package/out/_next/static/chunks/25-792af14760d9df34.js +0 -1
- package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
- package/out/_next/static/chunks/318-d6f1200138628ec3.js +0 -1
- package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
- package/out/_next/static/chunks/727-2c302be2def92786.js +0 -1
- package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
- package/out/_next/static/chunks/904-c9221a5cb09524e8.js +0 -1
- package/out/_next/static/chunks/pages/_app-7c41eb6cdd942b9e.js +0 -436
- package/out/_next/static/chunks/pages/changelog-5c9ac93faf0df06b.js +0 -1
- package/out/_next/static/chunks/pages/changes-3e4989e09fd412a8.js +0 -1
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-d1a4a07e6b600fa6.js +0 -1
- package/out/_next/static/chunks/pages/labs-6f5925cd6cdcee9e.js +0 -1
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-a724ff12ef322020.js +0 -1
- package/out/_next/static/chunks/pages/settings-f0620e5b727cda03.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8d7043e6638d65cd.js +0 -1
- package/out/_next/static/chunks/pages/slices-77cff50b1df13579.js +0 -1
- package/out/_next/static/css/238631d146c5ed97.css +0 -1
- package/out/_next/static/css/72465cc1225f28a2.css +0 -1
- package/out/_next/static/css/838fd8bb5a7c32b0.css +0 -1
- package/out/_next/static/css/b22c0750c14cc089.css +0 -1
- package/out/_next/static/css/be1f49e49a5aa7eb.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/src/components/BlankSlate/BlankSlate.css.ts +0 -96
- package/src/components/Breadcrumb/Breadcrumb.css.ts +0 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.ts +0 -32
- package/src/components/CodeBlock/CodeBlock.css.ts +0 -37
- package/src/components/ContentTabs/ContentTabs.css.ts +0 -49
- package/src/components/Divider/Divider.css.ts +0 -31
- package/src/components/HoverCard/HoverCard.css.ts +0 -105
- package/src/components/TextLink/TextLink.css.ts +0 -65
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.css.ts +0 -15
- package/out/_next/static/{M7hTqxKEI7x7a09i22lAK → jEpmnNgSaQQGEtlMfn4ek}/_ssgManifest.js +0 -0
- package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
- package/{components → src/legacy/components}/Card/WithTabs/components.jsx +1 -1
- package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
- package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/{components → src/legacy/components}/ChangesEmptyState/index.ts +1 -1
- package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +1 -1
- 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 +1 -1
- package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
- package/{components → src/legacy/components}/Flex/index.tsx +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/index.ts +0 -0
- package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
- package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
- package/{components → src/legacy/components}/Grid/index.tsx +0 -0
- package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +1 -1
- package/{components → src/legacy/components}/ItemHeader/index.tsx +1 -1
- 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}/MissingLibraries/index.tsx +0 -0
- package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
- package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
- package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +1 -1
- package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
- package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +1 -1
- 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 +1 -1
- package/{components → src/legacy/components}/SliceMachineModal/index.tsx +1 -1
- 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/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}/consts.ts +0 -0
- package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
- package/{lib → src/legacy/lib}/forms/defaults.ts +1 -1
- 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 +1 -1
- package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +4 -4
- package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Fields.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/Manifest.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 +2 -2
- 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/Date/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +3 -3
- package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +5 -5
- package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/widgets/index.ts +1 -1
- /package/{lib → src/legacy/lib}/prismic/endpoints.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
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogActions,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogHeader,
|
|
7
|
+
} from "@prismicio/editor-ui";
|
|
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";
|
|
15
|
+
import {
|
|
16
|
+
addField,
|
|
17
|
+
deleteField,
|
|
18
|
+
deleteRepeatableZone,
|
|
19
|
+
reorderField,
|
|
20
|
+
updateField,
|
|
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";
|
|
37
|
+
|
|
38
|
+
const dataTipText = ` The non-repeatable zone
|
|
39
|
+
is for fields<br/> that should appear once, like a<br/>
|
|
40
|
+
section title.
|
|
41
|
+
`;
|
|
42
|
+
const dataTipText2 = `The repeatable zone is for a group<br/>
|
|
43
|
+
of fields that you want to be able to repeat an<br/>
|
|
44
|
+
indeterminate number of times, like FAQs`;
|
|
45
|
+
|
|
46
|
+
const FieldZones: FC = () => {
|
|
47
|
+
const { slice, setSlice, variation } = useSliceState();
|
|
48
|
+
const [
|
|
49
|
+
isDeleteRepeatableZoneDialogOpen,
|
|
50
|
+
setIsDeleteRepeatableZoneDialogOpen,
|
|
51
|
+
] = useState(false);
|
|
52
|
+
const groupsInSlicesExperiment = useGroupsInSlicesExperiment();
|
|
53
|
+
|
|
54
|
+
// We won't show the Repeatable Zone if no items are configured.
|
|
55
|
+
const hasItems = Boolean(
|
|
56
|
+
variation.items && Object.keys(variation.items).length > 0,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const _onDeleteItem = (widgetArea: WidgetsArea) => (key: string) => {
|
|
60
|
+
if (
|
|
61
|
+
groupsInSlicesExperiment.eligible &&
|
|
62
|
+
widgetArea === WidgetsArea.Items &&
|
|
63
|
+
variation.items &&
|
|
64
|
+
Object.keys(variation.items).length <= 1
|
|
65
|
+
) {
|
|
66
|
+
setIsDeleteRepeatableZoneDialogOpen(true);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const newSlice = deleteField({
|
|
71
|
+
slice,
|
|
72
|
+
variationId: variation.id,
|
|
73
|
+
widgetArea,
|
|
74
|
+
fieldId: key,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
setSlice(newSlice);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const _onSave =
|
|
81
|
+
(widgetArea: WidgetsArea) =>
|
|
82
|
+
({
|
|
83
|
+
apiId: previousKey,
|
|
84
|
+
newKey,
|
|
85
|
+
value,
|
|
86
|
+
}: {
|
|
87
|
+
apiId: string;
|
|
88
|
+
newKey: string;
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
|
+
value: any;
|
|
91
|
+
}) => {
|
|
92
|
+
const newSlice = updateField({
|
|
93
|
+
slice,
|
|
94
|
+
variationId: variation.id,
|
|
95
|
+
widgetArea,
|
|
96
|
+
previousFieldId: previousKey,
|
|
97
|
+
newFieldId: newKey,
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
99
|
+
newField: value,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
setSlice(newSlice);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const _onSaveNewField =
|
|
106
|
+
(widgetArea: WidgetsArea) =>
|
|
107
|
+
({
|
|
108
|
+
id,
|
|
109
|
+
label,
|
|
110
|
+
widgetTypeName,
|
|
111
|
+
}: {
|
|
112
|
+
id: string;
|
|
113
|
+
label: string;
|
|
114
|
+
widgetTypeName: keyof typeof Widgets;
|
|
115
|
+
}) => {
|
|
116
|
+
const widget = sliceBuilderWidgetsArray.find(
|
|
117
|
+
(sliceBuilderWidget) =>
|
|
118
|
+
sliceBuilderWidget.CUSTOM_NAME === widgetTypeName ||
|
|
119
|
+
sliceBuilderWidget.TYPE_NAME === widgetTypeName,
|
|
120
|
+
);
|
|
121
|
+
if (!widget) {
|
|
122
|
+
throw new Error(`Unsupported Field Type: ${widgetTypeName}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const newField = widget.create(label) as SlicePrimaryFieldSM;
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
widget.schema.validateSync(newField, { stripUnknown: false });
|
|
129
|
+
} catch (error) {
|
|
130
|
+
throw new Error(`Model is invalid for widget "${newField.type}".`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const newSlice = addField({
|
|
134
|
+
slice,
|
|
135
|
+
variationId: variation.id,
|
|
136
|
+
widgetArea,
|
|
137
|
+
newFieldId: id,
|
|
138
|
+
newField:
|
|
139
|
+
newField.type === GroupFieldType ? Groups.fromSM(newField) : newField,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
setSlice(newSlice);
|
|
143
|
+
|
|
144
|
+
void telemetry.track({
|
|
145
|
+
event: "field:added",
|
|
146
|
+
id,
|
|
147
|
+
name: label,
|
|
148
|
+
type: newField.type,
|
|
149
|
+
isInAGroup: false,
|
|
150
|
+
contentType: getContentTypeForTracking(window.location.pathname),
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const _onDragEnd = (widgetArea: WidgetsArea) => (result: DropResult) => {
|
|
155
|
+
if (ensureDnDDestination(result)) return;
|
|
156
|
+
|
|
157
|
+
const { source, destination } = result;
|
|
158
|
+
if (!destination) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const newSlice = reorderField({
|
|
163
|
+
slice,
|
|
164
|
+
variationId: variation.id,
|
|
165
|
+
widgetArea,
|
|
166
|
+
sourceIndex: source.index,
|
|
167
|
+
destinationIndex: destination.index,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// When removing redux and replacing it by a simple useState, react-beautiful-dnd (that is deprecated library) was making the fields flickering on reorder.
|
|
171
|
+
// The problem seems to come from the react non-synchronous way to handle our state update that didn't work well with the library.
|
|
172
|
+
// It's a hack and since it's used on an old pure JavaScript code with a deprecated library it will be removed when updating the UI of the fields.
|
|
173
|
+
flushSync(() => setSlice(newSlice));
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const onDeleteRepeatableZone = () => {
|
|
177
|
+
const newSlice = deleteRepeatableZone({ slice, variationId: variation.id });
|
|
178
|
+
|
|
179
|
+
setSlice(newSlice);
|
|
180
|
+
setIsDeleteRepeatableZoneDialogOpen(false);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<List>
|
|
185
|
+
<Zone
|
|
186
|
+
zoneType="slice"
|
|
187
|
+
tabId={undefined}
|
|
188
|
+
title="Fields"
|
|
189
|
+
dataTip={dataTipText}
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
191
|
+
fields={variation.primary}
|
|
192
|
+
EditModal={EditModal}
|
|
193
|
+
widgetsArray={
|
|
194
|
+
groupsInSlicesExperiment.eligible
|
|
195
|
+
? sliceBuilderWidgetsArray
|
|
196
|
+
: groupBuilderWidgetsArray
|
|
197
|
+
}
|
|
198
|
+
onDeleteItem={_onDeleteItem(WidgetsArea.Primary)}
|
|
199
|
+
onSave={_onSave(WidgetsArea.Primary)}
|
|
200
|
+
onSaveNewField={_onSaveNewField(WidgetsArea.Primary)}
|
|
201
|
+
onDragEnd={_onDragEnd(WidgetsArea.Primary)}
|
|
202
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
203
|
+
poolOfFieldsToCheck={variation.primary || []}
|
|
204
|
+
renderHintBase={({ item }) =>
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
206
|
+
`slice.primary${transformKeyAccessor(item.key)}`
|
|
207
|
+
}
|
|
208
|
+
renderFieldAccessor={(key) =>
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
210
|
+
`slice.primary${transformKeyAccessor(key)}`
|
|
211
|
+
}
|
|
212
|
+
testId="static-zone-content"
|
|
213
|
+
isRepeatableCustomType={undefined}
|
|
214
|
+
/>
|
|
215
|
+
{!groupsInSlicesExperiment.eligible || hasItems ? (
|
|
216
|
+
<Zone
|
|
217
|
+
zoneType="slice"
|
|
218
|
+
tabId={undefined}
|
|
219
|
+
isRepeatable
|
|
220
|
+
title="Repeatable Zone"
|
|
221
|
+
dataTip={dataTipText2}
|
|
222
|
+
widgetsArray={groupBuilderWidgetsArray}
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
224
|
+
fields={variation.items}
|
|
225
|
+
EditModal={EditModal}
|
|
226
|
+
onDeleteItem={_onDeleteItem(WidgetsArea.Items)}
|
|
227
|
+
onSave={_onSave(WidgetsArea.Items)}
|
|
228
|
+
onSaveNewField={_onSaveNewField(WidgetsArea.Items)}
|
|
229
|
+
onDragEnd={_onDragEnd(WidgetsArea.Items)}
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
231
|
+
poolOfFieldsToCheck={variation.items || []}
|
|
232
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
233
|
+
renderHintBase={({ item }) => `item${transformKeyAccessor(item.key)}`}
|
|
234
|
+
renderFieldAccessor={(key) =>
|
|
235
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
236
|
+
`slice.items[i]${transformKeyAccessor(key)}`
|
|
237
|
+
}
|
|
238
|
+
testId="slice-repeatable-zone"
|
|
239
|
+
isRepeatableCustomType={undefined}
|
|
240
|
+
/>
|
|
241
|
+
) : null}
|
|
242
|
+
<Dialog
|
|
243
|
+
size="small"
|
|
244
|
+
open={isDeleteRepeatableZoneDialogOpen}
|
|
245
|
+
onOpenChange={(open) => setIsDeleteRepeatableZoneDialogOpen(open)}
|
|
246
|
+
>
|
|
247
|
+
<DialogHeader icon="delete" title="Delete field" />
|
|
248
|
+
<DialogContent>
|
|
249
|
+
<Box padding={24} gap={12} flexDirection="column">
|
|
250
|
+
<strong>
|
|
251
|
+
This action will permanently remove the repeatable zone from the{" "}
|
|
252
|
+
{slice.model.name} slice.
|
|
253
|
+
</strong>
|
|
254
|
+
<div>
|
|
255
|
+
To reimplement repeatable fields later, use a group field instead
|
|
256
|
+
of the repeatable zone.
|
|
257
|
+
</div>
|
|
258
|
+
</Box>
|
|
259
|
+
<DialogActions
|
|
260
|
+
ok={{
|
|
261
|
+
text: "Delete",
|
|
262
|
+
color: "tomato",
|
|
263
|
+
onClick: () => onDeleteRepeatableZone(),
|
|
264
|
+
}}
|
|
265
|
+
cancel={{ text: "Cancel" }}
|
|
266
|
+
/>
|
|
267
|
+
</DialogContent>
|
|
268
|
+
</Dialog>
|
|
269
|
+
</List>
|
|
270
|
+
);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export default FieldZones;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { Box, Button } from "@prismicio/editor-ui";
|
|
2
|
+
import { Field, Form, Formik } from "formik";
|
|
3
|
+
import { camelCase } from "lodash";
|
|
1
4
|
import React, { useEffect, useState } from "react";
|
|
2
5
|
import Select from "react-select";
|
|
3
|
-
import {
|
|
4
|
-
import { Button, Box } from "@prismicio/editor-ui";
|
|
5
|
-
import { Text, Label, Input } from "theme-ui";
|
|
6
|
-
import { camelCase } from "lodash";
|
|
6
|
+
import { Input, Label, Text } from "theme-ui";
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { VariationSM } from "
|
|
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
12
|
const Error = ({ msg }: { msg?: string }) => (
|
|
13
13
|
<Text as="span" sx={{ fontSize: 12, color: "error", mt: "5px", ml: 2 }}>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Box, Button, Gradient } from "@prismicio/editor-ui";
|
|
1
|
+
import { Box, Button, Gradient, theme } from "@prismicio/editor-ui";
|
|
2
2
|
import { useRouter } from "next/router";
|
|
3
3
|
import { type FC, useState } from "react";
|
|
4
4
|
import { toast } from "react-toastify";
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import useSliceMachineActions from "
|
|
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
19
|
type DialogState =
|
|
20
20
|
| { type: "ADD_VARIATION"; variation?: undefined; loading?: boolean }
|
|
@@ -73,32 +73,40 @@ export const Sidebar: FC = () => {
|
|
|
73
73
|
variationId={v.id}
|
|
74
74
|
/>
|
|
75
75
|
))}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
{/*
|
|
77
|
+
* As `PageLayoutContent` has a `16px` bottom padding, we need to apply
|
|
78
|
+
* an equal negative margin to the `div` if we want it to sit flush with
|
|
79
|
+
* the bottom of the page.
|
|
80
|
+
* TODO(PBD-1080): write the new `ScrollAreaEndGradient` component
|
|
81
|
+
* instead of using a `div`.
|
|
82
|
+
*/}
|
|
83
|
+
<div
|
|
84
|
+
style={{
|
|
85
|
+
bottom: theme.space[0],
|
|
86
|
+
marginBottom: `-${theme.space[16]}`,
|
|
87
|
+
position: "sticky",
|
|
88
|
+
}}
|
|
87
89
|
>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}}
|
|
93
|
-
startIcon="add"
|
|
94
|
-
// Set `position` to `relative` to position `Button` on top of
|
|
95
|
-
// `Gradient`.
|
|
96
|
-
sx={{ position: "relative" }}
|
|
97
|
-
color="grey"
|
|
90
|
+
<Box
|
|
91
|
+
backgroundColor="grey2"
|
|
92
|
+
flexDirection="column"
|
|
93
|
+
padding={{ bottom: 40, inline: 24 }}
|
|
98
94
|
>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
<Gradient sx={{ left: 0, position: "absolute", right: 0 }} />
|
|
96
|
+
<Button
|
|
97
|
+
color="grey"
|
|
98
|
+
onClick={() => {
|
|
99
|
+
setDialog({ type: "ADD_VARIATION" });
|
|
100
|
+
}}
|
|
101
|
+
startIcon="add"
|
|
102
|
+
// Set `position` to `relative` to position `Button` on top of
|
|
103
|
+
// `Gradient`.
|
|
104
|
+
sx={{ position: "relative" }}
|
|
105
|
+
>
|
|
106
|
+
Add a new variation
|
|
107
|
+
</Button>
|
|
108
|
+
</Box>
|
|
109
|
+
</div>
|
|
102
110
|
</Box>
|
|
103
111
|
<ScreenshotChangesModal
|
|
104
112
|
slices={sliceFilterFn([slice])}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { Button, tokens } from "@prismicio/editor-ui";
|
|
2
|
-
import React, { PropsWithChildren, useEffect, useRef } from "react";
|
|
3
|
-
|
|
4
|
-
import { SIMULATOR_WINDOW_ID, VIDEO_SIMULATOR_TOOLTIP } from "@lib/consts";
|
|
5
2
|
import { useRouter } from "next/router";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import { PlayCircleIcon } from "@src/icons/PlayCircleIcon";
|
|
9
|
-
import { userHasSeenSimulatorToolTip } from "@src/modules/userContext";
|
|
3
|
+
import React, { PropsWithChildren, useEffect, useRef } from "react";
|
|
10
4
|
import { useSelector } from "react-redux";
|
|
11
|
-
import
|
|
12
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
13
|
-
import { telemetry } from "@src/apiClient";
|
|
5
|
+
import ReactTooltip from "react-tooltip";
|
|
14
6
|
|
|
7
|
+
import { telemetry } from "@/apiClient";
|
|
15
8
|
import {
|
|
16
9
|
HoverCard,
|
|
17
10
|
HoverCardCloseButton,
|
|
18
11
|
HoverCardDescription,
|
|
19
12
|
HoverCardMedia,
|
|
20
13
|
HoverCardTitle,
|
|
21
|
-
} from "
|
|
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";
|
|
22
23
|
|
|
23
24
|
const SimulatorOnboardingTooltip: React.FC<
|
|
24
25
|
PropsWithChildren<{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Box } from "@prismicio/editor-ui";
|
|
2
2
|
import { type FC } from "react";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import
|
|
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";
|
|
8
8
|
import {
|
|
9
9
|
AppLayout,
|
|
10
10
|
AppLayoutActions,
|
|
@@ -12,10 +12,11 @@ import {
|
|
|
12
12
|
AppLayoutBreadcrumb,
|
|
13
13
|
AppLayoutContent,
|
|
14
14
|
AppLayoutHeader,
|
|
15
|
-
} from "
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
import
|
|
15
|
+
} from "@/legacy/components/AppLayout";
|
|
16
|
+
import SimulatorButton from "@/legacy/lib/builders/SliceBuilder/SimulatorButton";
|
|
17
|
+
|
|
18
|
+
import FieldZones from "./FieldZones";
|
|
19
|
+
import { Sidebar } from "./Sidebar";
|
|
19
20
|
|
|
20
21
|
export const SliceBuilder: FC = () => {
|
|
21
22
|
const { slice, actionQueueStatus } = useSliceState();
|
|
@@ -24,7 +25,10 @@ export const SliceBuilder: FC = () => {
|
|
|
24
25
|
<AppLayout>
|
|
25
26
|
<AppLayoutHeader>
|
|
26
27
|
<AppLayoutBackButton url="/slices" />
|
|
27
|
-
<AppLayoutBreadcrumb
|
|
28
|
+
<AppLayoutBreadcrumb>
|
|
29
|
+
<BreadcrumbItem>Slices</BreadcrumbItem>
|
|
30
|
+
<BreadcrumbItem active>{slice.model.name}</BreadcrumbItem>
|
|
31
|
+
</AppLayoutBreadcrumb>
|
|
28
32
|
<AppLayoutActions>
|
|
29
33
|
<AutoSaveStatusIndicator status={actionQueueStatus} />
|
|
30
34
|
<SimulatorButton disabled={actionQueueStatus !== "done"} />
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { Fragment } from "react";
|
|
2
|
-
|
|
3
1
|
import { useField } from "formik";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Box } from "theme-ui";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
FormFieldCheckbox,
|
|
7
7
|
FormFieldInput,
|
|
8
|
-
} from "
|
|
8
|
+
} from "@/legacy/components/FormFields";
|
|
9
9
|
|
|
10
10
|
import { FormTypes } from "../../../forms/types";
|
|
11
11
|
|
|
12
|
-
import { Box } from "theme-ui";
|
|
13
|
-
|
|
14
12
|
const WidgetFormField = ({ fieldName, formField, fields, initialValues }) => {
|
|
15
13
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
16
14
|
const [field, meta, helpers] = useField(fieldName);
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import Modal from "react-modal";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { Box, Close, Flex, Button, useThemeUI } from "theme-ui";
|
|
5
|
-
|
|
2
|
+
import { Box, Button, Close, Flex, useThemeUI } from "theme-ui";
|
|
6
3
|
import * as yup from "yup";
|
|
7
|
-
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
8
|
-
|
|
9
|
-
import { createInitialValues, createFieldNameFromKey } from "@lib/forms";
|
|
10
4
|
|
|
11
|
-
import Card from "
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
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";
|
|
17
16
|
|
|
18
17
|
import { findWidgetByConfigOrType } from "../../utils";
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
import { DeprecatedMockConfigMessage } from "@lib/models/common/DeprecatedMockConfigMessage";
|
|
18
|
+
import WidgetFormField from "./Field";
|
|
19
|
+
import WidgetForm from "./Form";
|
|
22
20
|
|
|
23
21
|
if (process.env.NODE_ENV !== "test") {
|
|
24
22
|
Modal.setAppElement("#__next");
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import Modal from "react-modal";
|
|
2
|
-
import SliceMachineModal from "@components/SliceMachineModal";
|
|
3
|
-
|
|
4
2
|
import { Close, Flex, Heading } from "theme-ui";
|
|
5
3
|
|
|
6
|
-
import Card from "
|
|
7
|
-
import { Flex as FlexGrid
|
|
4
|
+
import Card from "@/legacy/components/Card";
|
|
5
|
+
import { Col, Flex as FlexGrid } from "@/legacy/components/Flex";
|
|
6
|
+
import SliceMachineModal from "@/legacy/components/SliceMachineModal";
|
|
8
7
|
|
|
9
8
|
import FieldTypeCard from "./FieldTypeCard";
|
|
10
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ReactTooltip from "react-tooltip";
|
|
2
1
|
import { FaRegQuestionCircle } from "react-icons/fa";
|
|
2
|
+
import ReactTooltip from "react-tooltip";
|
|
3
3
|
|
|
4
|
-
import { ReactTooltipPortal } from "
|
|
4
|
+
import { ReactTooltipPortal } from "@/legacy/components/ReactTooltipPortal";
|
|
5
5
|
|
|
6
6
|
interface ErrorTooltip {
|
|
7
7
|
error?: string;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { NestableWidget, UID } from "@prismicio/types-internal/lib/customtypes";
|
|
1
2
|
import React, { useState } from "react";
|
|
2
|
-
import { useThemeUI, Text, Button, Flex, Box } from "theme-ui";
|
|
3
|
-
|
|
4
|
-
import { BsCode } from "react-icons/bs";
|
|
5
3
|
import { BiCopy } from "react-icons/bi";
|
|
4
|
+
import { BsCode } from "react-icons/bs";
|
|
6
5
|
import { MdCheck } from "react-icons/md";
|
|
7
|
-
import
|
|
6
|
+
import { Box, Button, Flex, Text, useThemeUI } from "theme-ui";
|
|
8
7
|
|
|
9
|
-
import
|
|
8
|
+
import Code from "@/legacy/components/CodeBlock";
|
|
10
9
|
|
|
11
10
|
const buttonIconStyle: React.CSSProperties = {
|
|
12
11
|
position: "relative",
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Formik, Form, Field } from "formik";
|
|
3
|
-
import { Input, Flex, Text, useThemeUI } from "theme-ui";
|
|
1
|
+
import { Button } from "@prismicio/editor-ui";
|
|
4
2
|
import * as CSS from "csstype";
|
|
3
|
+
import { Field, Form, Formik } from "formik";
|
|
4
|
+
import { Ref, SetStateAction, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Flex, Input, Text, useThemeUI } from "theme-ui";
|
|
5
6
|
import { AnyObjectSchema } from "yup";
|
|
6
|
-
import { Button } from "@prismicio/editor-ui";
|
|
7
|
-
|
|
8
|
-
import { validateId } from "@lib/forms/defaults";
|
|
9
|
-
import { createInitialValues, createValidationSchema } from "@lib/forms";
|
|
10
|
-
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
11
|
-
import { slugify } from "@lib/utils/str";
|
|
12
|
-
import { AnyWidget } from "@lib/models/common/widgets/Widget";
|
|
13
7
|
|
|
14
|
-
import { ErrorTooltip } from "./ErrorTooltip";
|
|
15
|
-
import { InputType } from "@lib/forms/fields";
|
|
16
8
|
import {
|
|
17
9
|
getInputFieldStyles,
|
|
18
10
|
InputFieldStyles,
|
|
19
|
-
} from "
|
|
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
|
+
|
|
22
|
+
import { ErrorTooltip } from "./ErrorTooltip";
|
|
20
23
|
|
|
21
24
|
interface NewField {
|
|
22
25
|
widgetTypeName: string;
|