slice-machine-ui 1.26.1-beta.1 → 1.26.1-beta.11
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/components/App/index.tsx +6 -7
- package/components/AppLayout/index.tsx +6 -8
- package/components/AuthInstructions/index.jsx +1 -1
- package/components/Button/index.tsx +1 -2
- package/components/Card/Default.jsx +2 -1
- package/components/Card/Preview.jsx +1 -1
- package/components/Card/WithTabs/components.jsx +1 -1
- package/components/Card/WithTabs/index.jsx +4 -3
- package/components/Card/index.tsx +1 -0
- package/components/Changelog/index.tsx +6 -7
- package/components/Changelog/navigation/VersionBadge.tsx +2 -1
- package/components/Changelog/navigation/VersionTag.tsx +1 -0
- package/components/Changelog/navigation/index.tsx +3 -4
- package/components/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
- package/components/Changelog/versionDetails/UpdateCommandBox.tsx +4 -5
- package/components/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
- package/components/Changelog/versionDetails/index.tsx +4 -5
- package/components/ChangesEmptyState/AuthErrorPage.tsx +2 -3
- package/components/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/components/ChangesEmptyState/index.ts +1 -1
- package/components/ChangesItems/ChangesItems.tsx +9 -10
- package/components/ChangesItems/DevCollaborationExperiment.tsx +2 -3
- package/components/ChangesItems/ErrorBanner.tsx +1 -1
- package/components/CodeBlock/index.tsx +3 -4
- package/components/ConfigErrors/index.jsx +1 -1
- package/components/CustomTypeTable/changesPage.tsx +6 -6
- package/components/DeleteCTModal/index.tsx +6 -7
- package/components/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +2 -3
- package/components/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +8 -9
- package/components/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +8 -8
- package/components/DeleteDocumentsDrawer/index.tsx +1 -1
- package/components/DeleteSliceModal/index.tsx +6 -7
- package/components/DeleteVariationModal/index.tsx +5 -6
- package/components/DropDownSelector/index.tsx +2 -4
- package/components/EmptyState/index.tsx +3 -4
- package/components/FormFields/Array.jsx +2 -4
- package/components/FormFields/Checkbox.jsx +1 -1
- package/components/FormFields/CheckboxControl.jsx +1 -1
- package/components/FormFields/Input.tsx +1 -1
- package/components/FormFields/SelectDefaultValue.jsx +1 -1
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +15 -16
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +9 -10
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +11 -12
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +6 -7
- package/components/Forms/RenameVariationModal/RenameVariationModal.module.css +5 -0
- package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -7
- package/components/Forms/components/InputBox.tsx +2 -2
- package/components/Forms/components/SelectRepeatable.tsx +3 -3
- package/components/Forms/formsValidator.ts +3 -2
- package/components/FullPage/index.tsx +1 -1
- package/components/InputDeleteIcon/index.jsx +1 -1
- package/components/ItemHeader/index.tsx +1 -1
- package/components/ListItem/Header.tsx +1 -1
- package/components/ListItem/index.tsx +7 -10
- package/components/LoadingPage/index.tsx +1 -0
- package/components/LoginModal/index.tsx +22 -23
- package/components/ModalFormCard/index.tsx +5 -5
- package/components/Navigation/ChangesItem.tsx +8 -9
- package/components/Navigation/Environment.tsx +7 -8
- package/components/Navigation/RunningVersion.tsx +1 -2
- package/components/Navigation/UpdateBox.tsx +3 -4
- package/components/Navigation/VideoItem.tsx +16 -16
- package/components/Navigation/index.module.css +3 -0
- package/components/Navigation/index.test.tsx +14 -12
- package/components/Navigation/index.tsx +18 -20
- package/components/ReviewModal/ReviewForm.tsx +12 -13
- package/components/ReviewModal/ReviewFormSelect.tsx +1 -1
- package/components/ReviewModal/ReviewModal.tsx +6 -7
- package/components/ScreenshotChangesModal/VariationDropZone.tsx +7 -8
- package/components/ScreenshotChangesModal/index.tsx +10 -14
- package/components/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -2
- package/components/ScreenshotPreview/index.tsx +1 -1
- package/components/ScreenshotPreviewModal/index.tsx +4 -4
- package/components/Simulator/components/FailedConnect/index.tsx +3 -4
- package/components/Simulator/components/Header/VariationsPopover/index.tsx +3 -5
- package/components/Simulator/components/Header/index.tsx +4 -5
- package/components/Simulator/components/IframeRenderer/index.tsx +3 -5
- package/components/Simulator/components/Toolbar/index.tsx +2 -4
- package/components/Simulator/index.tsx +19 -26
- package/components/SliceMachineDrawer/index.tsx +2 -2
- package/components/SliceMachineIconButton/index.tsx +1 -1
- package/components/SliceMachineModal/index.tsx +1 -1
- package/components/ToasterContainer/index.tsx +3 -5
- package/components/Tooltip/TextWithTooltip.tsx +2 -3
- package/components/Tooltip/index.jsx +2 -3
- package/components/Warnings/index.jsx +1 -1
- package/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +2 -3
- package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +4 -5
- package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +8 -9
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +2 -3
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +3 -3
- package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +21 -22
- package/lib/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/TabModal/delete.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/TabModal/update.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +20 -21
- package/lib/builders/CustomTypeBuilder/index.tsx +4 -5
- package/lib/builders/SliceBuilder/FieldZones/index.tsx +105 -41
- package/lib/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +7 -8
- package/lib/builders/SliceBuilder/Sidebar/index.tsx +7 -8
- package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +9 -12
- package/lib/builders/SliceBuilder/index.tsx +11 -8
- package/lib/builders/common/EditModal/Field.jsx +2 -5
- package/lib/builders/common/EditModal/Form.jsx +1 -1
- package/lib/builders/common/EditModal/index.jsx +11 -17
- package/lib/builders/common/SelectFieldTypeModal/index.jsx +3 -5
- package/lib/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -3
- package/lib/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -6
- package/lib/builders/common/Zone/Card/components/Hints/index.tsx +1 -1
- package/lib/builders/common/Zone/Card/components/NewField.tsx +13 -14
- package/lib/builders/common/Zone/Card/index.jsx +2 -3
- package/lib/builders/common/Zone/components/EmptyState/index.tsx +2 -2
- package/lib/builders/common/Zone/index.jsx +3 -4
- package/lib/forms/defaults.ts +1 -1
- package/lib/forms/fields.ts +1 -2
- package/lib/forms/index.ts +1 -0
- package/lib/models/common/ComponentUI.ts +1 -1
- package/lib/models/common/CustomType/index.ts +5 -4
- package/lib/models/common/CustomType/sliceZone.ts +2 -1
- package/lib/models/common/CustomType/tab.ts +4 -4
- package/lib/models/common/DeprecatedMockConfigMessage.tsx +2 -2
- package/lib/models/common/Environment.ts +2 -2
- package/lib/models/common/Fields.ts +1 -1
- package/lib/models/common/Group.ts +3 -2
- package/lib/models/common/Library.ts +2 -1
- package/lib/models/common/LibraryUI.ts +1 -1
- package/lib/models/common/ModelData.ts +1 -1
- package/lib/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
- package/lib/models/common/ModelStatus/compareSliceModels.ts +2 -1
- package/lib/models/common/ModelStatus/index.ts +10 -9
- package/lib/models/common/Slice.ts +2 -2
- package/lib/models/common/Slices.ts +2 -2
- package/lib/models/common/normalizers/customType.ts +1 -1
- package/lib/models/common/normalizers/slices.ts +3 -2
- package/lib/models/common/widgets/Boolean/index.ts +5 -7
- package/lib/models/common/widgets/Color/index.ts +2 -3
- package/lib/models/common/widgets/ContentRelationship/Form.tsx +7 -9
- package/lib/models/common/widgets/ContentRelationship/index.ts +7 -8
- package/lib/models/common/widgets/Date/index.ts +2 -2
- package/lib/models/common/widgets/Embed/index.ts +2 -2
- package/lib/models/common/widgets/GeoPoint/index.ts +2 -3
- package/lib/models/common/widgets/Group/Form.jsx +3 -4
- package/lib/models/common/widgets/Group/ListItem/index.jsx +13 -23
- package/lib/models/common/widgets/Group/index.ts +4 -3
- package/lib/models/common/widgets/Image/Form.tsx +8 -11
- package/lib/models/common/widgets/Image/components.tsx +5 -5
- package/lib/models/common/widgets/Image/index.ts +3 -5
- package/lib/models/common/widgets/Link/Form.jsx +3 -5
- package/lib/models/common/widgets/Link/index.ts +3 -3
- package/lib/models/common/widgets/LinkToMedia/Form.jsx +2 -4
- package/lib/models/common/widgets/LinkToMedia/index.ts +3 -4
- package/lib/models/common/widgets/Number/index.ts +2 -2
- package/lib/models/common/widgets/Select/FormFields.jsx +7 -8
- package/lib/models/common/widgets/Select/index.ts +3 -6
- package/lib/models/common/widgets/StructuredText/Form.tsx +10 -10
- package/lib/models/common/widgets/StructuredText/index.ts +3 -6
- package/lib/models/common/widgets/StructuredText/options.tsx +2 -2
- package/lib/models/common/widgets/Text/index.ts +5 -5
- package/lib/models/common/widgets/Timestamp/index.ts +4 -5
- package/lib/models/common/widgets/UID/index.ts +4 -5
- package/lib/models/common/widgets/Widget.ts +2 -1
- package/lib/models/common/widgets/index.ts +1 -1
- package/lib/models/common/widgets/withGroup.ts +1 -2
- package/lib/models/server/ServerState.ts +4 -3
- package/lib/utils/index.ts +4 -5
- package/out/404.html +1 -1
- package/out/_next/static/6WrgMw0SELcypoJCYNiKd/_buildManifest.js +1 -0
- package/out/_next/static/chunks/{25-792af14760d9df34.js → 25-607d5cfe6492f4e8.js} +1 -1
- package/out/_next/static/chunks/286-6ee80333008646b9.js +1 -0
- package/out/_next/static/chunks/318-c84322cba57be932.js +1 -0
- package/out/_next/static/chunks/382-8194eab141c7ea2f.js +1 -0
- package/out/_next/static/chunks/727-b53258380c1a11f1.js +1 -0
- package/out/_next/static/chunks/799-68887319f3169f78.js +1 -0
- package/out/_next/static/chunks/pages/{_app-756c037ed6c707e9.js → _app-6177e3581af44083.js} +1 -1
- package/out/_next/static/chunks/pages/changelog-2d061c06b2b82e28.js +1 -0
- package/out/_next/static/chunks/pages/changes-cde59d56dc849106.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-d1a4a07e6b600fa6.js → [customTypeId]-89ccb93ce7409ad0.js} +1 -1
- package/out/_next/static/chunks/pages/index-b5817351a77c6d40.js +1 -0
- package/out/_next/static/chunks/pages/labs-0fc7d01b8c9bfc2a.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-a724ff12ef322020.js → [pageTypeId]-dbf86fe3a94dc892.js} +1 -1
- package/out/_next/static/chunks/pages/settings-897ad13a08f73048.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js +1 -0
- package/out/_next/static/chunks/pages/slices-391f6c4b30af0759.js +1 -0
- package/out/_next/static/css/{838fd8bb5a7c32b0.css → 0e0d6c4ec6bf7373.css} +1 -1
- package/out/_next/static/css/{21654235130d0806.css → 243a4d347efcfd53.css} +1 -1
- package/out/_next/static/css/{b22c0750c14cc089.css → 27f2b9b9c9f65885.css} +1 -1
- package/out/_next/static/css/{72465cc1225f28a2.css → 6e65ff596e3b465e.css} +1 -1
- package/out/_next/static/css/70e3649c6ba13fdc.css +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 +5 -3
- package/pages/_app.tsx +6 -8
- package/pages/changelog.tsx +1 -2
- package/pages/changes.tsx +17 -15
- package/pages/custom-types.tsx +1 -2
- package/pages/index.tsx +1 -2
- package/pages/slices/[lib]/[sliceName]/[variation]/index.tsx +2 -3
- package/pages/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -3
- package/pages/slices.tsx +22 -20
- package/sentry.client.config.ts +1 -1
- package/src/ErrorBoundary.tsx +1 -2
- package/src/apiClient.ts +7 -8
- 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.stories.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 +1 -2
- 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 -8
- 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.module.css +19 -0
- package/src/components/Count/Count.module.css.d.ts +6 -0
- package/src/components/{Counter/Counter.stories.tsx → Count/Count.stories.tsx} +3 -3
- package/src/components/{Counter/Counter.tsx → Count/Count.tsx} +3 -4
- package/src/components/Count/index.ts +1 -0
- package/src/components/Divider/Divider.stories.tsx +1 -1
- 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 -4
- package/src/components/HoverCard/index.ts +3 -3
- package/src/components/SideNav/SideNav.stories.tsx +6 -7
- package/src/components/SideNav/SideNav.tsx +6 -6
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -4
- package/src/components/Table/Table.stories.tsx +2 -2
- package/src/components/Table/Table.test.tsx +1 -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 -2
- package/src/domain/__tests__/slice.test.ts +40 -0
- package/src/domain/customType.ts +1 -2
- package/src/domain/slice.ts +29 -5
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +1 -2
- package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +0 -1
- package/src/features/changelog/useSliceMachineReleaseNotes.ts +0 -1
- package/src/features/changelog/useSliceMachineVersions.ts +0 -1
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +9 -13
- package/src/features/changes/PushChangesButton.tsx +5 -6
- package/src/features/changes/StatusBadge.tsx +2 -3
- package/src/features/customTypes/EditDropdown.tsx +6 -10
- package/src/features/customTypes/PageTypeOnboarding.tsx +4 -5
- package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +12 -15
- package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +7 -7
- package/src/features/customTypes/actions/convertCustomToPageType.ts +2 -3
- package/src/features/customTypes/actions/createCustomType.ts +2 -3
- package/src/features/customTypes/actions/deleteCustomType.ts +2 -3
- package/src/features/customTypes/actions/renameCustomType.ts +2 -3
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -9
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +22 -16
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +4 -5
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +1 -2
- package/src/features/customTypes/customTypesBuilder/useCustomType.ts +0 -1
- package/src/features/customTypes/customTypesConfig.ts +1 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +14 -15
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +21 -23
- package/src/features/customTypes/customTypesTable/useCustomTypes.ts +4 -5
- package/src/features/documentation/MarkdownRenderer/index.tsx +5 -7
- package/src/features/documentation/useDocumentation.ts +0 -1
- package/src/features/environments/actions/getActiveEnvironment.ts +0 -1
- package/src/features/environments/actions/setEnvironment.ts +1 -2
- package/src/features/inAppGuide/InAppGuideContext.tsx +2 -3
- package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -5
- package/src/features/inAppGuide/inAppGuideContent.tsx +1 -2
- 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 +7 -5
- package/src/features/labs/labsList/useLab.tsx +0 -1
- package/src/features/settings/SettingsPage.tsx +8 -6
- package/src/features/settings/git/ConnectGitRepository.tsx +2 -3
- package/src/features/settings/git/GitOwnerSelect.tsx +1 -2
- package/src/features/settings/git/GitProvider.ts +0 -1
- package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -2
- package/src/features/settings/git/GitRepositoriesList.tsx +1 -2
- package/src/features/settings/git/GitRepositoriesSearch.tsx +1 -2
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +3 -4
- package/src/features/settings/git/useGitOwners.ts +0 -1
- package/src/features/settings/git/useGitRepos.ts +0 -1
- package/src/features/settings/git/useLinkedGitRepos.ts +0 -1
- package/src/features/settings/git/useWriteAPIToken.ts +0 -1
- package/src/features/slices/actions/addSlicesToSliceZone.ts +1 -2
- package/src/features/slices/actions/createSlice.ts +3 -4
- package/src/features/slices/actions/deleteSlice.ts +1 -2
- package/src/features/slices/actions/renameSlice.ts +3 -4
- package/src/features/slices/actions/uploadSliceScreenshot.ts +1 -2
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +9 -10
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +7 -8
- 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 +10 -11
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +5 -8
- package/src/features/slices/convertLegacySlice/types.ts +1 -1
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -4
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -10
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +2 -3
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +1 -2
- package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +8 -0
- package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +2 -3
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +4 -5
- package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -3
- package/src/features/sync/AutoSyncProvider.tsx +17 -18
- package/src/features/sync/actions/pushChanges.ts +1 -1
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +2 -3
- package/src/features/sync/fetchUnSyncChanges.ts +1 -1
- package/src/features/sync/getUnSyncChanges.ts +4 -4
- package/src/features/sync/useUnSyncChanges.ts +4 -5
- package/src/hooks/useActionQueue.tsx +5 -5
- package/src/hooks/useAdapterName.ts +0 -1
- package/src/hooks/useAuthStatus.ts +1 -2
- package/src/hooks/useCurrentSlice.tsx +2 -3
- package/src/hooks/useEditorContent.ts +3 -3
- package/src/hooks/useExperimentVariant.ts +0 -1
- package/src/hooks/useIsEmptyProject.ts +0 -1
- package/src/hooks/useRepositoryInformation.ts +2 -3
- package/src/hooks/useRouteChange.tsx +1 -1
- package/src/hooks/useSMTracker.ts +4 -5
- package/src/hooks/useScreenshotChangesModal.ts +3 -3
- package/src/hooks/useServerState.ts +4 -5
- package/src/hooks/useSliceMachineConfig.ts +1 -2
- package/src/hooks/useSliceMachineRunningVersion.ts +0 -1
- package/src/hooks/useThrottle.ts +1 -1
- package/src/hooks/useUpdateAvailable.ts +0 -1
- package/src/hooks/useWindowDimensions.ts +1 -1
- package/src/hooks/useWindowSize.ts +2 -1
- package/src/modules/availableCustomTypes/index.ts +13 -12
- package/src/modules/environment/index.ts +9 -8
- package/src/modules/loading/index.ts +3 -2
- package/src/modules/modal/index.ts +3 -2
- package/src/modules/slices/index.ts +4 -4
- package/src/modules/slices/types.ts +1 -1
- package/src/modules/useSliceMachineActions.ts +22 -21
- package/src/modules/userContext/index.ts +5 -4
- package/src/redux/reducer.ts +5 -5
- package/src/redux/store.ts +6 -5
- package/src/redux/type.ts +4 -4
- package/src/theme.ts +1 -2
- package/test/__setup__.ts +3 -0
- package/vite.config.ts +4 -3
- package/components/Forms/RenameVariationModal/RenameVariationModal.css.ts +0 -7
- package/components/Navigation/index.css.ts +0 -5
- 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/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/changelog-5c9ac93faf0df06b.js +0 -1
- package/out/_next/static/chunks/pages/changes-3e4989e09fd412a8.js +0 -1
- package/out/_next/static/chunks/pages/index-cf93d16e9c63b6db.js +0 -1
- package/out/_next/static/chunks/pages/labs-6f5925cd6cdcee9e.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/be1f49e49a5aa7eb.css +0 -1
- package/out/_next/static/dLmvq3LL0BsWu15laiKoK/_buildManifest.js +0 -1
- 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/Counter/Counter.css.ts +0 -26
- package/src/components/Counter/index.ts +0 -1
- 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/{dLmvq3LL0BsWu15laiKoK → 6WrgMw0SELcypoJCYNiKd}/_ssgManifest.js +0 -0
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
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
|
+
import {
|
|
9
|
+
Box,
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogActions,
|
|
12
|
+
DialogContent,
|
|
13
|
+
DialogHeader,
|
|
14
|
+
} from "@prismicio/editor-ui";
|
|
4
15
|
import {
|
|
5
16
|
FieldType,
|
|
6
17
|
NestableWidget,
|
|
7
18
|
} from "@prismicio/types-internal/lib/customtypes";
|
|
8
|
-
|
|
9
|
-
import { ensureDnDDestination } from "@lib/utils";
|
|
10
|
-
import { transformKeyAccessor } from "@utils/str";
|
|
11
|
-
import * as Widgets from "@lib/models/common/widgets";
|
|
12
|
-
import sliceBuilderWidgetsArray from "@lib/models/common/widgets/sliceBuilderArray";
|
|
19
|
+
import { telemetry } from "@src/apiClient";
|
|
13
20
|
import { List } from "@src/components/List";
|
|
14
|
-
import { WidgetsArea } from "@lib/models/common/Slice";
|
|
15
|
-
import { useSliceState } from "@src/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
16
21
|
import {
|
|
17
22
|
addField,
|
|
18
23
|
deleteField,
|
|
24
|
+
deleteRepeatableZone,
|
|
19
25
|
reorderField,
|
|
20
26
|
updateField,
|
|
21
27
|
} from "@src/domain/slice";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
28
|
+
import { useSliceState } from "@src/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
29
|
+
import { useGroupsInSlicesExperiment } from "@src/features/slices/sliceBuilder/useGroupsInSlicesExperiment";
|
|
30
|
+
import { transformKeyAccessor } from "@utils/str";
|
|
31
|
+
import { FC, useState } from "react";
|
|
32
|
+
import { DropResult } from "react-beautiful-dnd";
|
|
33
|
+
import { flushSync } from "react-dom";
|
|
26
34
|
|
|
27
35
|
const dataTipText = ` The non-repeatable zone
|
|
28
36
|
is for fields<br/> that should appear once, like a<br/>
|
|
@@ -34,8 +42,28 @@ const dataTipText2 = `The repeatable zone is for a group<br/>
|
|
|
34
42
|
|
|
35
43
|
const FieldZones: FC = () => {
|
|
36
44
|
const { slice, setSlice, variation } = useSliceState();
|
|
45
|
+
const [
|
|
46
|
+
isDeleteRepeatableZoneDialogOpen,
|
|
47
|
+
setIsDeleteRepeatableZoneDialogOpen,
|
|
48
|
+
] = useState(false);
|
|
49
|
+
const groupsInSlicesExperiment = useGroupsInSlicesExperiment();
|
|
50
|
+
|
|
51
|
+
// We won't show the Repeatable Zone if no items are configured.
|
|
52
|
+
const hasItems = Boolean(
|
|
53
|
+
variation.items && Object.keys(variation.items).length > 0,
|
|
54
|
+
);
|
|
37
55
|
|
|
38
56
|
const _onDeleteItem = (widgetArea: WidgetsArea) => (key: string) => {
|
|
57
|
+
if (
|
|
58
|
+
groupsInSlicesExperiment.eligible &&
|
|
59
|
+
widgetArea === WidgetsArea.Items &&
|
|
60
|
+
variation.items &&
|
|
61
|
+
Object.keys(variation.items).length <= 1
|
|
62
|
+
) {
|
|
63
|
+
setIsDeleteRepeatableZoneDialogOpen(true);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
39
67
|
const newSlice = deleteField({
|
|
40
68
|
slice,
|
|
41
69
|
variationId: variation.id,
|
|
@@ -154,13 +182,20 @@ const FieldZones: FC = () => {
|
|
|
154
182
|
flushSync(() => setSlice(newSlice));
|
|
155
183
|
};
|
|
156
184
|
|
|
185
|
+
const onDeleteRepeatableZone = () => {
|
|
186
|
+
const newSlice = deleteRepeatableZone({ slice, variationId: variation.id });
|
|
187
|
+
|
|
188
|
+
setSlice(newSlice);
|
|
189
|
+
setIsDeleteRepeatableZoneDialogOpen(false);
|
|
190
|
+
};
|
|
191
|
+
|
|
157
192
|
return (
|
|
158
193
|
<List>
|
|
159
194
|
<Zone
|
|
160
195
|
zoneType="slice"
|
|
161
196
|
zoneTypeFormat={undefined}
|
|
162
197
|
tabId={undefined}
|
|
163
|
-
title="
|
|
198
|
+
title="Fields"
|
|
164
199
|
dataTip={dataTipText}
|
|
165
200
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
166
201
|
fields={variation.primary}
|
|
@@ -183,32 +218,61 @@ const FieldZones: FC = () => {
|
|
|
183
218
|
testId="static-zone-content"
|
|
184
219
|
isRepeatableCustomType={undefined}
|
|
185
220
|
/>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
221
|
+
{!groupsInSlicesExperiment.eligible || hasItems ? (
|
|
222
|
+
<Zone
|
|
223
|
+
zoneType="slice"
|
|
224
|
+
zoneTypeFormat={undefined}
|
|
225
|
+
tabId={undefined}
|
|
226
|
+
isRepeatable
|
|
227
|
+
title="Repeatable Zone"
|
|
228
|
+
dataTip={dataTipText2}
|
|
229
|
+
widgetsArray={sliceBuilderWidgetsArray}
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
231
|
+
fields={variation.items}
|
|
232
|
+
EditModal={EditModal}
|
|
233
|
+
onDeleteItem={_onDeleteItem(WidgetsArea.Items)}
|
|
234
|
+
onSave={_onSave(WidgetsArea.Items)}
|
|
235
|
+
onSaveNewField={_onSaveNewField(WidgetsArea.Items)}
|
|
236
|
+
onDragEnd={_onDragEnd(WidgetsArea.Items)}
|
|
237
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
238
|
+
poolOfFieldsToCheck={variation.items || []}
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
240
|
+
renderHintBase={({ item }) => `item${transformKeyAccessor(item.key)}`}
|
|
241
|
+
renderFieldAccessor={(key) =>
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
243
|
+
`slice.items[i]${transformKeyAccessor(key)}`
|
|
244
|
+
}
|
|
245
|
+
testId="slice-repeatable-zone"
|
|
246
|
+
isRepeatableCustomType={undefined}
|
|
247
|
+
/>
|
|
248
|
+
) : null}
|
|
249
|
+
<Dialog
|
|
250
|
+
size="small"
|
|
251
|
+
open={isDeleteRepeatableZoneDialogOpen}
|
|
252
|
+
onOpenChange={(open) => setIsDeleteRepeatableZoneDialogOpen(open)}
|
|
253
|
+
>
|
|
254
|
+
<DialogHeader icon="delete" title="Delete field" />
|
|
255
|
+
<DialogContent>
|
|
256
|
+
<Box padding={24} gap={12} flexDirection="column">
|
|
257
|
+
<strong>
|
|
258
|
+
This action will permanently remove the Repeatable Zone from the{" "}
|
|
259
|
+
{slice.model.name} slice.
|
|
260
|
+
</strong>
|
|
261
|
+
<div>
|
|
262
|
+
If you need repeatable fields again, use a repeatable group field
|
|
263
|
+
in place of the repeatable zone.
|
|
264
|
+
</div>
|
|
265
|
+
</Box>
|
|
266
|
+
<DialogActions
|
|
267
|
+
ok={{
|
|
268
|
+
text: "Delete",
|
|
269
|
+
color: "tomato",
|
|
270
|
+
onClick: () => onDeleteRepeatableZone(),
|
|
271
|
+
}}
|
|
272
|
+
cancel={{ text: "Cancel" }}
|
|
273
|
+
/>
|
|
274
|
+
</DialogContent>
|
|
275
|
+
</Dialog>
|
|
212
276
|
</List>
|
|
213
277
|
);
|
|
214
278
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import Select from "react-select";
|
|
3
|
-
import { Formik, Form, Field } from "formik";
|
|
4
|
-
import { Button, Box } from "@prismicio/editor-ui";
|
|
5
|
-
import { Text, Label, Input } from "theme-ui";
|
|
6
|
-
import { camelCase } from "lodash";
|
|
7
|
-
|
|
8
|
-
import SliceMachineModal from "@components/SliceMachineModal";
|
|
9
1
|
import Card from "@components/Card/Default";
|
|
2
|
+
import SliceMachineModal from "@components/SliceMachineModal";
|
|
10
3
|
import { VariationSM } from "@lib/models/common/Slice";
|
|
4
|
+
import { Box, Button } from "@prismicio/editor-ui";
|
|
5
|
+
import { Field, Form, Formik } from "formik";
|
|
6
|
+
import { camelCase } from "lodash";
|
|
7
|
+
import React, { useEffect, useState } from "react";
|
|
8
|
+
import Select from "react-select";
|
|
9
|
+
import { Input, Label, Text } from "theme-ui";
|
|
11
10
|
|
|
12
11
|
const Error = ({ msg }: { msg?: string }) => (
|
|
13
12
|
<Text as="span" sx={{ fontSize: 12, color: "error", mt: "5px", ml: 2 }}>
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { Box, Button, Gradient } from "@prismicio/editor-ui";
|
|
2
|
-
import { useRouter } from "next/router";
|
|
3
|
-
import { type FC, useState } from "react";
|
|
4
|
-
import { toast } from "react-toastify";
|
|
5
|
-
|
|
6
1
|
import AddVariationModal from "@builders/SliceBuilder/Sidebar/AddVariationModal";
|
|
7
2
|
import { DeleteVariationModal } from "@components/DeleteVariationModal";
|
|
8
3
|
import { RenameVariationModal } from "@components/Forms/RenameVariationModal";
|
|
9
4
|
import ScreenshotChangesModal from "@components/ScreenshotChangesModal";
|
|
10
5
|
import type { VariationSM } from "@lib/models/common/Slice";
|
|
11
|
-
import {
|
|
12
|
-
import { SLICES_CONFIG } from "@src/features/slices/slicesConfig";
|
|
13
|
-
import { useScreenshotChangesModal } from "@src/hooks/useScreenshotChangesModal";
|
|
6
|
+
import { Box, Button, Gradient } from "@prismicio/editor-ui";
|
|
14
7
|
import { updateSlice } from "@src/apiClient";
|
|
15
8
|
import { copySliceVariation } from "@src/domain/slice";
|
|
16
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";
|
|
17
13
|
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
14
|
+
import { useRouter } from "next/router";
|
|
15
|
+
import { type FC, useState } from "react";
|
|
16
|
+
import { toast } from "react-toastify";
|
|
18
17
|
|
|
19
18
|
type DialogState =
|
|
20
19
|
| { type: "ADD_VARIATION"; variation?: undefined; loading?: boolean }
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import { Button, tokens } from "@prismicio/editor-ui";
|
|
2
|
-
import React, { PropsWithChildren, useEffect, useRef } from "react";
|
|
3
|
-
|
|
4
1
|
import { SIMULATOR_WINDOW_ID, VIDEO_SIMULATOR_TOOLTIP } from "@lib/consts";
|
|
5
|
-
import {
|
|
6
|
-
import ReactTooltip from "react-tooltip";
|
|
7
|
-
|
|
8
|
-
import { PlayCircleIcon } from "@src/icons/PlayCircleIcon";
|
|
9
|
-
import { userHasSeenSimulatorToolTip } from "@src/modules/userContext";
|
|
10
|
-
import { useSelector } from "react-redux";
|
|
11
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
12
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
2
|
+
import { Button, tokens } from "@prismicio/editor-ui";
|
|
13
3
|
import { telemetry } from "@src/apiClient";
|
|
14
|
-
|
|
15
4
|
import {
|
|
16
5
|
HoverCard,
|
|
17
6
|
HoverCardCloseButton,
|
|
@@ -19,6 +8,14 @@ import {
|
|
|
19
8
|
HoverCardMedia,
|
|
20
9
|
HoverCardTitle,
|
|
21
10
|
} from "@src/components/HoverCard";
|
|
11
|
+
import { PlayCircleIcon } from "@src/icons/PlayCircleIcon";
|
|
12
|
+
import { userHasSeenSimulatorToolTip } from "@src/modules/userContext";
|
|
13
|
+
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
14
|
+
import { SliceMachineStoreType } from "@src/redux/type";
|
|
15
|
+
import { useRouter } from "next/router";
|
|
16
|
+
import React, { PropsWithChildren, useEffect, useRef } from "react";
|
|
17
|
+
import { useSelector } from "react-redux";
|
|
18
|
+
import ReactTooltip from "react-tooltip";
|
|
22
19
|
|
|
23
20
|
const SimulatorOnboardingTooltip: React.FC<
|
|
24
21
|
PropsWithChildren<{
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { Box } from "@prismicio/editor-ui";
|
|
2
|
-
import { type FC } from "react";
|
|
3
|
-
|
|
4
|
-
import FieldZones from "./FieldZones";
|
|
5
|
-
import { Sidebar } from "./Sidebar";
|
|
6
|
-
|
|
7
1
|
import SimulatorButton from "@builders/SliceBuilder/SimulatorButton";
|
|
8
2
|
import {
|
|
9
3
|
AppLayout,
|
|
@@ -13,9 +7,15 @@ import {
|
|
|
13
7
|
AppLayoutContent,
|
|
14
8
|
AppLayoutHeader,
|
|
15
9
|
} from "@components/AppLayout";
|
|
10
|
+
import { Box } from "@prismicio/editor-ui";
|
|
11
|
+
import { BreadcrumbItem } from "@src/components/Breadcrumb";
|
|
12
|
+
import { AutoSaveStatusIndicator } from "@src/features/autoSave/AutoSaveStatusIndicator";
|
|
16
13
|
import { FloatingBackButton } from "@src/features/slices/sliceBuilder/FloatingBackButton";
|
|
17
14
|
import { useSliceState } from "@src/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
18
|
-
import {
|
|
15
|
+
import { type FC } from "react";
|
|
16
|
+
|
|
17
|
+
import FieldZones from "./FieldZones";
|
|
18
|
+
import { Sidebar } from "./Sidebar";
|
|
19
19
|
|
|
20
20
|
export const SliceBuilder: FC = () => {
|
|
21
21
|
const { slice, actionQueueStatus } = useSliceState();
|
|
@@ -24,7 +24,10 @@ export const SliceBuilder: FC = () => {
|
|
|
24
24
|
<AppLayout>
|
|
25
25
|
<AppLayoutHeader>
|
|
26
26
|
<AppLayoutBackButton url="/slices" />
|
|
27
|
-
<AppLayoutBreadcrumb
|
|
27
|
+
<AppLayoutBreadcrumb>
|
|
28
|
+
<BreadcrumbItem>Slices</BreadcrumbItem>
|
|
29
|
+
<BreadcrumbItem active>{slice.model.name}</BreadcrumbItem>
|
|
30
|
+
</AppLayoutBreadcrumb>
|
|
28
31
|
<AppLayoutActions>
|
|
29
32
|
<AutoSaveStatusIndicator status={actionQueueStatus} />
|
|
30
33
|
<SimulatorButton disabled={actionQueueStatus !== "done"} />
|
|
@@ -1,16 +1,13 @@
|
|
|
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
8
|
} from "../../../../components/FormFields";
|
|
9
|
-
|
|
10
9
|
import { FormTypes } from "../../../forms/types";
|
|
11
10
|
|
|
12
|
-
import { Box } from "theme-ui";
|
|
13
|
-
|
|
14
11
|
const WidgetFormField = ({ fieldName, formField, fields, initialValues }) => {
|
|
15
12
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
16
13
|
const [field, meta, helpers] = useField(fieldName);
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import Modal from "react-modal";
|
|
2
|
-
import SliceMachineModal from "@components/SliceMachineModal";
|
|
3
|
-
|
|
4
|
-
import { Box, Close, Flex, Button, useThemeUI } from "theme-ui";
|
|
5
|
-
|
|
6
|
-
import * as yup from "yup";
|
|
7
|
-
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
8
|
-
|
|
9
|
-
import { createInitialValues, createFieldNameFromKey } from "@lib/forms";
|
|
10
|
-
|
|
11
1
|
import Card from "@components/Card/WithTabs";
|
|
2
|
+
import { Col, Flex as FlexGrid } from "@components/Flex";
|
|
12
3
|
import ItemHeader from "@components/ItemHeader";
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
import { findWidgetByConfigOrType } from "../../utils";
|
|
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";
|
|
19
8
|
import { removeProp } from "@lib/utils";
|
|
9
|
+
import Modal from "react-modal";
|
|
10
|
+
import { Box, Button, Close, Flex, useThemeUI } from "theme-ui";
|
|
11
|
+
import * as yup from "yup";
|
|
20
12
|
|
|
21
|
-
import {
|
|
13
|
+
import { findWidgetByConfigOrType } from "../../utils";
|
|
14
|
+
import WidgetFormField from "./Field";
|
|
15
|
+
import WidgetForm from "./Form";
|
|
22
16
|
|
|
23
17
|
if (process.env.NODE_ENV !== "test") {
|
|
24
18
|
Modal.setAppElement("#__next");
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Card from "@components/Card";
|
|
2
|
+
import { Col, Flex as FlexGrid } from "@components/Flex";
|
|
2
3
|
import SliceMachineModal from "@components/SliceMachineModal";
|
|
3
|
-
|
|
4
|
+
import Modal from "react-modal";
|
|
4
5
|
import { Close, Flex, Heading } from "theme-ui";
|
|
5
6
|
|
|
6
|
-
import Card from "@components/Card";
|
|
7
|
-
import { Flex as FlexGrid, Col } from "@components/Flex";
|
|
8
|
-
|
|
9
7
|
import FieldTypeCard from "./FieldTypeCard";
|
|
10
8
|
|
|
11
9
|
if (process.env.NODE_ENV !== "test") {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import ReactTooltip from "react-tooltip";
|
|
2
|
-
import { FaRegQuestionCircle } from "react-icons/fa";
|
|
3
|
-
|
|
4
1
|
import { ReactTooltipPortal } from "@components/ReactTooltipPortal";
|
|
2
|
+
import { FaRegQuestionCircle } from "react-icons/fa";
|
|
3
|
+
import ReactTooltip from "react-tooltip";
|
|
5
4
|
|
|
6
5
|
interface ErrorTooltip {
|
|
7
6
|
error?: string;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import Code from "@components/CodeBlock";
|
|
2
|
+
import { NestableWidget, UID } from "@prismicio/types-internal/lib/customtypes";
|
|
1
3
|
import React, { useState } from "react";
|
|
2
|
-
import { useThemeUI, Text, Button, Flex, Box } from "theme-ui";
|
|
3
|
-
|
|
4
|
-
import { BsCode } from "react-icons/bs";
|
|
5
4
|
import { BiCopy } from "react-icons/bi";
|
|
5
|
+
import { BsCode } from "react-icons/bs";
|
|
6
6
|
import { MdCheck } from "react-icons/md";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import { NestableWidget, UID } from "@prismicio/types-internal/lib/customtypes";
|
|
7
|
+
import { Box, Button, Flex, Text, useThemeUI } from "theme-ui";
|
|
10
8
|
|
|
11
9
|
const buttonIconStyle: React.CSSProperties = {
|
|
12
10
|
position: "relative",
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { AnyObjectSchema } from "yup";
|
|
6
|
-
import { Button } from "@prismicio/editor-ui";
|
|
7
|
-
|
|
8
|
-
import { validateId } from "@lib/forms/defaults";
|
|
1
|
+
import {
|
|
2
|
+
getInputFieldStyles,
|
|
3
|
+
InputFieldStyles,
|
|
4
|
+
} from "@components/FormFields/Input";
|
|
9
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";
|
|
10
9
|
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
11
10
|
import { slugify } from "@lib/utils/str";
|
|
12
|
-
import {
|
|
11
|
+
import { Button } from "@prismicio/editor-ui";
|
|
12
|
+
import * as CSS from "csstype";
|
|
13
|
+
import { Field, Form, Formik } from "formik";
|
|
14
|
+
import { Ref, SetStateAction, useEffect, useRef, useState } from "react";
|
|
15
|
+
import { Flex, Input, Text, useThemeUI } from "theme-ui";
|
|
16
|
+
import { AnyObjectSchema } from "yup";
|
|
13
17
|
|
|
14
18
|
import { ErrorTooltip } from "./ErrorTooltip";
|
|
15
|
-
import { InputType } from "@lib/forms/fields";
|
|
16
|
-
import {
|
|
17
|
-
getInputFieldStyles,
|
|
18
|
-
InputFieldStyles,
|
|
19
|
-
} from "@components/FormFields/Input";
|
|
20
19
|
|
|
21
20
|
interface NewField {
|
|
22
21
|
widgetTypeName: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { DragDropContext, Droppable } from "react-beautiful-dnd";
|
|
2
|
-
import { Box, Text } from "theme-ui";
|
|
3
|
-
|
|
4
1
|
import Li from "@components/Li";
|
|
5
2
|
import ListItem from "@components/ListItem";
|
|
6
3
|
import * as Widgets from "@lib/models/common/widgets/withGroup";
|
|
4
|
+
import { DragDropContext, Droppable } from "react-beautiful-dnd";
|
|
5
|
+
import { Box, Text } from "theme-ui";
|
|
7
6
|
|
|
8
7
|
import { findWidgetByConfigOrType } from "../../../utils";
|
|
9
8
|
import Hint from "./components/Hints";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Box, Text, Heading } from "theme-ui";
|
|
2
1
|
import { Button } from "@prismicio/editor-ui";
|
|
2
|
+
import { Box, Heading, Text } from "theme-ui";
|
|
3
3
|
|
|
4
4
|
const ZoneEmptyState = ({
|
|
5
5
|
onEnterSelectMode,
|
|
@@ -13,7 +13,7 @@ const ZoneEmptyState = ({
|
|
|
13
13
|
<Heading as="h5">Add a new field here</Heading>
|
|
14
14
|
<Box sx={{ my: 2 }}>
|
|
15
15
|
<Text sx={{ color: "textClear" }}>
|
|
16
|
-
|
|
16
|
+
Fields are inputs for content (e.g. text, images, links).
|
|
17
17
|
</Text>
|
|
18
18
|
</Box>
|
|
19
19
|
<Box sx={{ display: "flex", justifyContent: "center", marginTop: 16 }}>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Button, Switch, Text } from "@prismicio/editor-ui";
|
|
2
|
+
import { telemetry } from "@src/apiClient";
|
|
3
|
+
import { ListHeader } from "@src/components/List";
|
|
2
4
|
import { array, arrayOf, bool, func, object, shape, string } from "prop-types";
|
|
3
5
|
import { useState } from "react";
|
|
4
6
|
import { BaseStyles } from "theme-ui";
|
|
5
7
|
|
|
6
|
-
import { ListHeader } from "@src/components/List";
|
|
7
|
-
import { telemetry } from "@src/apiClient";
|
|
8
|
-
|
|
9
8
|
import SelectFieldTypeModal from "../SelectFieldTypeModal";
|
|
10
|
-
import NewField from "./Card/components/NewField";
|
|
11
9
|
import Card from "./Card";
|
|
10
|
+
import NewField from "./Card/components/NewField";
|
|
12
11
|
import EmptyState from "./components/EmptyState";
|
|
13
12
|
|
|
14
13
|
const Zone = ({
|
package/lib/forms/defaults.ts
CHANGED
package/lib/forms/fields.ts
CHANGED
package/lib/forms/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { StringOrNull } from "@prismicio/types-internal/lib/validators";
|
|
2
|
-
import { withFallback } from "io-ts-types";
|
|
3
|
-
import * as t from "io-ts";
|
|
4
|
-
import { Tabs, TabSM } from "./tab";
|
|
5
1
|
import { CustomType as CustomTypeInternal } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
+
import { StringOrNull } from "@prismicio/types-internal/lib/validators";
|
|
6
3
|
import { getOrElseW } from "fp-ts/lib/Either";
|
|
4
|
+
import * as t from "io-ts";
|
|
5
|
+
import { withFallback } from "io-ts-types";
|
|
6
|
+
|
|
7
7
|
import { SlicesSM } from "../Slices";
|
|
8
|
+
import { Tabs, TabSM } from "./tab";
|
|
8
9
|
|
|
9
10
|
export * from "./tab";
|
|
10
11
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
1
|
import {
|
|
3
|
-
NestableWidget,
|
|
4
2
|
DynamicSection,
|
|
5
|
-
DynamicWidget,
|
|
6
3
|
DynamicSlices,
|
|
4
|
+
DynamicWidget,
|
|
7
5
|
Group,
|
|
6
|
+
NestableWidget,
|
|
8
7
|
UID,
|
|
9
8
|
} from "@prismicio/types-internal/lib/customtypes";
|
|
10
|
-
import
|
|
9
|
+
import * as t from "io-ts";
|
|
11
10
|
|
|
11
|
+
import { Groups, GroupSM } from "../Group";
|
|
12
12
|
import { SlicesSM, SliceZone } from "../Slices";
|
|
13
13
|
|
|
14
14
|
export const TabFields = t.array(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useRouter } from "next/router";
|
|
2
|
-
import { Box, Button, Text } from "theme-ui";
|
|
3
1
|
import { SIMULATOR_WINDOW_ID } from "@lib/consts";
|
|
2
|
+
import { useRouter } from "next/router";
|
|
4
3
|
import { MdErrorOutline } from "react-icons/md";
|
|
4
|
+
import { Box, Button, Text } from "theme-ui";
|
|
5
5
|
|
|
6
6
|
export const DeprecatedMockConfigMessage = () => {
|
|
7
7
|
const router = useRouter();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { APIEndpoints, PackageManager } from "@slicemachine/manager";
|
|
2
2
|
|
|
3
|
-
import PrismicData from "./PrismicData";
|
|
4
3
|
import type { Manifest } from "./Manifest";
|
|
4
|
+
import PrismicData from "./PrismicData";
|
|
5
5
|
|
|
6
6
|
export interface BackendEnvironment {
|
|
7
7
|
cwd: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
1
|
import { Group } from "@prismicio/types-internal/lib/customtypes/widgets";
|
|
3
2
|
import { StringOrNull } from "@prismicio/types-internal/lib/validators";
|
|
4
|
-
import { FieldsSM } from "./Fields";
|
|
5
3
|
import { getOrElseW } from "fp-ts/lib/Either";
|
|
4
|
+
import * as t from "io-ts";
|
|
5
|
+
|
|
6
|
+
import { FieldsSM } from "./Fields";
|
|
6
7
|
|
|
7
8
|
export const GroupConfig = t.exact(
|
|
8
9
|
t.partial({
|