slice-machine-ui 1.26.1-beta.11 → 1.26.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/chunks/127-5f39b7de8178c2e4.js +1 -0
- package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad5c4eb28d4b155.js} +1 -1
- package/out/_next/static/chunks/453-4e2d00a3515202f4.js +1 -0
- package/out/_next/static/chunks/46-bd45510ac2a839b5.js +10 -0
- package/out/_next/static/chunks/614-af117b661cd3429a.js +1 -0
- package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
- package/out/_next/static/chunks/91-aa2369249805fb5a.js +1 -0
- package/out/_next/static/chunks/96-24fed6adc069e313.js +1 -0
- package/out/_next/static/chunks/pages/{_app-6177e3581af44083.js → _app-2e45ed74db68cb0a.js} +3 -3
- package/out/_next/static/chunks/pages/changelog-ac1004bdd31d17f8.js +1 -0
- package/out/_next/static/chunks/pages/changes-5c4bd80747884a8c.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-5b08515fec5e6668.js +1 -0
- package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-75e8eddec659f440.js} +1 -1
- package/out/_next/static/chunks/pages/index-16754a04037cf9c1.js +1 -0
- package/out/_next/static/chunks/pages/labs-d6f2feb6720ee64c.js +1 -0
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-41fc6d4f726fdfb9.js +1 -0
- package/out/_next/static/chunks/pages/settings-7ad1540dc0af794d.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9941e7eeb9d4d084.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8c8d4de562fca8ac.js +1 -0
- package/out/_next/static/chunks/pages/slices-801310de228fd05e.js +1 -0
- package/out/_next/static/css/17da9daaa8986410.css +1 -0
- package/out/_next/static/css/{27f2b9b9c9f65885.css → 663a1bac4ce890da.css} +1 -1
- package/out/_next/static/css/c36992b18975f9b9.css +1 -0
- package/out/_next/static/css/{243a4d347efcfd53.css → df904982b9637c1a.css} +1 -1
- package/out/_next/static/umd9mjV29cCbZplewdOPw/_buildManifest.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/sentry.client.config.ts +2 -1
- package/src/ErrorBoundary.tsx +2 -1
- package/src/apiClient.ts +12 -7
- package/src/components/Card/Card.stories.tsx +4 -3
- package/src/components/CodeBlock/CodeBlock.tsx +6 -5
- package/src/components/Count/Count.tsx +2 -1
- package/src/components/HoverCard/HoverCard.tsx +3 -2
- package/src/components/SideNav/SideNav.stories.tsx +3 -2
- package/src/components/SideNav/SideNav.tsx +3 -2
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -2
- package/src/components/Table/Table.test.tsx +4 -3
- package/src/domain/__tests__/customType.test.ts +0 -184
- package/src/domain/__tests__/group.test.ts +161 -0
- package/src/domain/__tests__/slice.test.ts +3 -2
- package/src/domain/customType.ts +0 -191
- package/src/domain/group.ts +89 -0
- package/src/domain/slice.ts +29 -12
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -1
- package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +2 -1
- package/src/features/changelog/useSliceMachineReleaseNotes.ts +2 -1
- package/src/features/changelog/useSliceMachineVersions.ts +2 -1
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +9 -8
- package/src/features/changes/PushChangesButton.tsx +5 -4
- package/src/features/changes/StatusBadge.tsx +3 -2
- package/src/features/customTypes/EditDropdown.tsx +4 -3
- package/src/features/customTypes/PageTypeOnboarding.tsx +4 -3
- package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +5 -4
- package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +5 -4
- package/src/features/customTypes/actions/convertCustomToPageType.ts +3 -2
- package/src/features/customTypes/actions/createCustomType.ts +4 -3
- package/src/features/customTypes/actions/deleteCustomType.ts +2 -1
- package/src/features/customTypes/actions/renameCustomType.ts +2 -1
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +6 -5
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +21 -17
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +7 -6
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -3
- package/src/features/customTypes/customTypesBuilder/useCustomType.ts +2 -1
- package/src/features/customTypes/customTypesConfig.ts +3 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +8 -7
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +12 -11
- package/src/features/customTypes/customTypesTable/useCustomTypes.ts +6 -5
- package/src/features/documentation/MarkdownRenderer/index.tsx +4 -3
- package/src/features/documentation/useDocumentation.ts +2 -1
- package/src/features/environments/actions/getActiveEnvironment.ts +2 -1
- package/src/features/environments/actions/getEnvironments.ts +1 -1
- package/src/features/environments/actions/setEnvironment.ts +3 -2
- package/src/features/inAppGuide/InAppGuideContext.tsx +2 -1
- package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -3
- package/src/features/inAppGuide/inAppGuideContent.tsx +2 -1
- package/src/features/labs/labsList/LabsPage.tsx +7 -6
- package/src/features/labs/labsList/useLab.tsx +2 -1
- package/src/features/settings/SettingsPage.tsx +9 -8
- package/src/features/settings/git/ConnectGitRepository.tsx +11 -10
- package/src/features/settings/git/GitOwnerSelect.tsx +2 -1
- package/src/features/settings/git/GitProvider.ts +5 -4
- package/src/features/settings/git/GitProviderConnectButtons.tsx +2 -1
- package/src/features/settings/git/GitRepositoriesList.tsx +6 -5
- package/src/features/settings/git/GitRepositoriesSearch.tsx +7 -6
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +4 -3
- package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
- package/src/features/settings/git/useGitOwners.ts +2 -1
- package/src/features/settings/git/useGitRepos.ts +2 -1
- package/src/features/settings/git/useLinkedGitRepos.ts +3 -2
- package/src/features/settings/git/useWriteAPIToken.ts +3 -2
- package/src/features/slices/actions/addSlicesToSliceZone.ts +3 -2
- package/src/features/slices/actions/createSlice.ts +5 -4
- package/src/features/slices/actions/deleteSlice.ts +2 -1
- package/src/features/slices/actions/renameSlice.ts +5 -4
- package/src/features/slices/actions/uploadSliceScreenshot.ts +3 -2
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +5 -4
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +2 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +10 -9
- package/src/features/slices/convertLegacySlice/types.ts +2 -2
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +9 -8
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +7 -6
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +7 -6
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +5 -4
- package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +1 -1
- package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +5 -4
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +9 -8
- package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +3 -2
- package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
- package/src/features/sync/AutoSyncProvider.tsx +10 -9
- package/src/features/sync/actions/pushChanges.ts +4 -3
- package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -3
- package/src/features/sync/fetchUnSyncChanges.ts +4 -4
- package/src/features/sync/getUnSyncChanges.ts +5 -5
- package/src/features/sync/useUnSyncChanges.ts +5 -4
- package/src/hooks/useAdapterName.ts +2 -1
- package/src/hooks/useAuthStatus.ts +3 -2
- package/src/hooks/useCurrentSlice.tsx +5 -4
- package/src/hooks/useEditorContent.ts +4 -3
- package/src/hooks/useExperimentVariant.ts +2 -1
- package/src/hooks/useIsEmptyProject.ts +2 -1
- package/src/hooks/useRepositoryInformation.ts +3 -2
- package/src/hooks/useSMTracker.ts +5 -4
- package/src/hooks/useScreenshotChangesModal.ts +4 -3
- package/src/hooks/useServerState.ts +4 -3
- package/src/hooks/useSliceMachineConfig.ts +2 -1
- package/src/hooks/useSliceMachineRunningVersion.ts +2 -1
- package/src/hooks/useUpdateAvailable.ts +2 -1
- package/{components → src/legacy/components}/App/index.tsx +9 -8
- package/{components → src/legacy/components}/AppLayout/index.tsx +8 -7
- package/{components → src/legacy/components}/Changelog/index.tsx +5 -4
- package/{components → src/legacy/components}/Changelog/navigation/index.tsx +5 -4
- package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +5 -4
- package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +2 -1
- package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +3 -2
- package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -13
- package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -2
- package/{components → src/legacy/components}/CodeBlock/index.tsx +2 -1
- package/{components → src/legacy/components}/ConfigErrors/index.jsx +3 -2
- package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +11 -10
- package/{components → src/legacy/components}/DeleteCTModal/index.tsx +7 -6
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +3 -2
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +6 -5
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +6 -5
- package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +7 -6
- package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -5
- package/{components → src/legacy/components}/EmptyState/index.tsx +2 -1
- package/{components → src/legacy/components}/FormFields/Input.tsx +2 -1
- package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +17 -16
- package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +8 -7
- package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +7 -6
- package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +7 -6
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -5
- package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +2 -1
- package/{components → src/legacy/components}/Forms/formsValidator.ts +4 -3
- package/{components → src/legacy/components}/ListItem/Header.tsx +2 -1
- package/{components → src/legacy/components}/ListItem/index.tsx +3 -2
- package/{components → src/legacy/components}/LoginModal/index.tsx +20 -19
- package/{components → src/legacy/components}/ModalFormCard/index.tsx +3 -2
- package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +12 -11
- package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -12
- package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +3 -2
- package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -2
- package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/VideoItem.tsx +15 -14
- package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/index.test.tsx +7 -9
- package/{components → src/legacy/components}/Navigation/index.tsx +21 -20
- package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +10 -9
- package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +7 -6
- package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +6 -5
- package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +11 -10
- package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +2 -1
- package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
- package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -6
- package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -2
- package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +3 -2
- package/{components → src/legacy/components}/Simulator/index.tsx +12 -11
- package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +2 -1
- package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -1
- package/{components → src/legacy/components}/Tooltip/index.jsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +11 -10
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +10 -9
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -2
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +23 -19
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +29 -28
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +7 -6
- package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +42 -49
- package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/index.tsx +13 -12
- package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +15 -11
- package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +9 -8
- package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +12 -8
- package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +4 -3
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +14 -10
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +7 -3
- package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +7 -9
- package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +2 -1
- package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
- package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/Slice.ts +17 -3
- package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +3 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +62 -67
- package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +5 -4
- package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -5
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -4
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +7 -6
- package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +2 -1
- package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
- package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
- package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
- package/{lib → src/legacy/lib}/models/server/ServerState.ts +2 -2
- package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
- package/src/modules/availableCustomTypes/index.ts +10 -9
- package/src/modules/availableCustomTypes/types.ts +2 -2
- package/src/modules/environment/index.ts +7 -6
- package/src/modules/environment/types.ts +1 -1
- package/src/modules/modal/index.ts +2 -1
- package/src/modules/slices/index.ts +12 -8
- package/src/modules/slices/selector.ts +1 -1
- package/src/modules/slices/types.ts +2 -2
- package/src/modules/useSliceMachineActions.ts +10 -6
- package/src/modules/userContext/index.ts +6 -5
- package/{pages → src/pages}/_app.tsx +22 -22
- package/{pages → src/pages}/changelog.tsx +2 -1
- package/{pages → src/pages}/changes.tsx +25 -21
- package/src/pages/custom-types/[customTypeId].tsx +1 -0
- package/{pages → src/pages}/custom-types.tsx +2 -1
- package/{pages → src/pages}/index.tsx +4 -3
- package/src/pages/labs.tsx +1 -0
- package/src/pages/page-types/[pageTypeId].tsx +1 -0
- package/src/pages/settings.tsx +1 -0
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +4 -3
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +3 -2
- package/{pages → src/pages}/slices.tsx +24 -23
- package/src/redux/reducer.ts +7 -6
- package/src/redux/store.ts +2 -1
- package/src/redux/type.ts +7 -6
- package/src/utils/getContentTypeForTracking.ts +21 -0
- package/test/__setup__.ts +10 -8
- package/test/__testutils__/createTestPlugin.ts +3 -2
- package/test/__testutils__/createTestProject.ts +5 -4
- package/test/__testutils__/index.tsx +6 -5
- package/test/__testutils__/mockAWSACLAPI.ts +1 -1
- package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
- package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
- package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
- package/test/__testutils__/readMSWFormData.ts +1 -1
- package/test/components/IframeRenderer.test.ts +3 -2
- package/test/lib/builders/EditModal.test.tsx +5 -3
- package/test/lib/builders/buildersUtils.test.ts +3 -3
- package/test/lib/consts.test.ts +6 -2
- package/test/lib/models/common/CustomType.test.ts +6 -2
- package/test/lib/models/common/ModelStatus.test.ts +6 -4
- package/test/lib/models/common/Slice.test.ts +3 -2
- package/test/lib/models/common/widgets/index.test.ts +8 -4
- package/test/lib/utils/index.test.ts +3 -2
- package/test/lib/utils/preferWroomBase.test.ts +3 -2
- package/test/lib/utils/shared/customTypes.test.ts +2 -1
- package/test/pages/slices.test.tsx +10 -10
- package/test/src/modules/__fixtures__/serverState.ts +1 -1
- package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
- package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
- package/test/src/modules/environment.test.ts +3 -5
- package/test/src/modules/loading.test.ts +3 -3
- package/test/src/modules/modal.test.ts +5 -5
- package/test/src/modules/slices.test.ts +3 -2
- package/test/src/modules/userContext.test.ts +3 -3
- package/test/src/normalizers/customType.test.ts +16 -3
- package/test/src/utils/fieldNameCreator.test.ts +1 -1
- package/tsconfig.json +1 -6
- package/vite.config.ts +1 -7
- package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
- package/lib/models/common/widgets/withGroup.ts +0 -19
- package/out/_next/static/6WrgMw0SELcypoJCYNiKd/_buildManifest.js +0 -1
- package/out/_next/static/chunks/25-607d5cfe6492f4e8.js +0 -1
- package/out/_next/static/chunks/286-6ee80333008646b9.js +0 -1
- package/out/_next/static/chunks/318-c84322cba57be932.js +0 -1
- package/out/_next/static/chunks/382-8194eab141c7ea2f.js +0 -1
- package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
- package/out/_next/static/chunks/727-b53258380c1a11f1.js +0 -1
- package/out/_next/static/chunks/799-68887319f3169f78.js +0 -1
- package/out/_next/static/chunks/pages/changelog-2d061c06b2b82e28.js +0 -1
- package/out/_next/static/chunks/pages/changes-cde59d56dc849106.js +0 -1
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-89ccb93ce7409ad0.js +0 -1
- package/out/_next/static/chunks/pages/index-b5817351a77c6d40.js +0 -1
- package/out/_next/static/chunks/pages/labs-0fc7d01b8c9bfc2a.js +0 -1
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-dbf86fe3a94dc892.js +0 -1
- package/out/_next/static/chunks/pages/settings-897ad13a08f73048.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js +0 -1
- package/out/_next/static/chunks/pages/slices-391f6c4b30af0759.js +0 -1
- package/out/_next/static/css/0e0d6c4ec6bf7373.css +0 -1
- package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
- package/pages/custom-types/[customTypeId].tsx +0 -1
- package/pages/labs.tsx +0 -1
- package/pages/page-types/[pageTypeId].tsx +0 -1
- package/pages/settings.tsx +0 -1
- /package/out/_next/static/{6WrgMw0SELcypoJCYNiKd → umd9mjV29cCbZplewdOPw}/_ssgManifest.js +0 -0
- /package/{components → src/legacy/components}/AuthInstructions/index.jsx +0 -0
- /package/{components → src/legacy/components}/Button/index.tsx +0 -0
- /package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
- /package/{components → src/legacy/components}/Card/Default.jsx +0 -0
- /package/{components → src/legacy/components}/Card/Preview.jsx +0 -0
- /package/{components → src/legacy/components}/Card/WithTabs/components.jsx +0 -0
- /package/{components → src/legacy/components}/Card/WithTabs/index.jsx +0 -0
- /package/{components → src/legacy/components}/Card/index.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +0 -0
- /package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesEmptyState/index.ts +0 -0
- /package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
- /package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
- /package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
- /package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +0 -0
- /package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
- /package/{components → src/legacy/components}/DropDownSelector/index.tsx +0 -0
- /package/{components → src/legacy/components}/Flex/index.tsx +0 -0
- /package/{components → src/legacy/components}/FormFields/Array.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/Checkbox.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +0 -0
- /package/{components → src/legacy/components}/FormFields/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.module.css +0 -0
- /package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
- /package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/components/InputBox.tsx +0 -0
- /package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
- /package/{components → src/legacy/components}/FullPage/index.tsx +0 -0
- /package/{components → src/legacy/components}/Grid/index.tsx +0 -0
- /package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +0 -0
- /package/{components → src/legacy/components}/ItemHeader/index.tsx +0 -0
- /package/{components → src/legacy/components}/Li/index.tsx +0 -0
- /package/{components → src/legacy/components}/ListItem/utils.js +0 -0
- /package/{components → src/legacy/components}/LoadingPage/index.tsx +0 -0
- /package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
- /package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
- /package/{components → src/legacy/components}/Navigation/index.module.css +0 -0
- /package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
- /package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +0 -0
- /package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
- /package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +0 -0
- /package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
- /package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
- /package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +0 -0
- /package/{components → src/legacy/components}/SliceMachineModal/index.tsx +0 -0
- /package/{components → src/legacy/components}/ToasterContainer/index.tsx +0 -0
- /package/{components → src/legacy/components}/Warnings/index.jsx +0 -0
- /package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
- /package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
- /package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
- /package/{lib → src/legacy/lib}/builders/common/Zone/components/EmptyState/index.tsx +0 -0
- /package/{lib → src/legacy/lib}/consts.ts +0 -0
- /package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/defaults.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/fields.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/index.ts +0 -0
- /package/{lib → src/legacy/lib}/forms/types.ts +0 -0
- /package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Environment.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Fields.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Group.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Library.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Slices.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
- /package/{lib → src/legacy/lib}/models/common/widgets/index.ts +0 -0
- /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/index.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
- /package/{pages → src/pages}/api/embed.js +0 -0
|
@@ -3,15 +3,15 @@ import "react-datepicker/dist/react-datepicker.css";
|
|
|
3
3
|
import "react-tabs/style/react-tabs.css";
|
|
4
4
|
import "react-toastify/dist/ReactToastify.css";
|
|
5
5
|
import "rc-drawer/assets/index.css";
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
6
|
+
import "@/styles/drawer.css";
|
|
7
|
+
import "@/styles/globals.css";
|
|
8
|
+
import "@/styles/hljs.css";
|
|
9
|
+
import "@/styles/intercom.css";
|
|
10
|
+
import "@/styles/keyframes.css";
|
|
11
|
+
import "@/styles/modal.css";
|
|
12
|
+
import "@/styles/starry-night.css";
|
|
13
|
+
import "@/styles/tabs.css";
|
|
14
|
+
import "@/styles/toaster.css";
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
17
|
Box,
|
|
@@ -19,10 +19,6 @@ import {
|
|
|
19
19
|
ThemeProvider,
|
|
20
20
|
TooltipProvider,
|
|
21
21
|
} from "@prismicio/editor-ui";
|
|
22
|
-
import { ErrorBoundary } from "@src/ErrorBoundary";
|
|
23
|
-
import { InAppGuideProvider } from "@src/features/inAppGuide/InAppGuideContext";
|
|
24
|
-
import { InAppGuideDialog } from "@src/features/inAppGuide/InAppGuideDialog";
|
|
25
|
-
import { AutoSyncProvider } from "@src/features/sync/AutoSyncProvider";
|
|
26
22
|
import { ConnectedRouter } from "connected-next-router";
|
|
27
23
|
import type { NextPage } from "next";
|
|
28
24
|
import type { AppContext, AppInitialProps } from "next/app";
|
|
@@ -36,15 +32,19 @@ import type { Persistor } from "redux-persist/es/types";
|
|
|
36
32
|
import { PersistGate } from "redux-persist/integration/react";
|
|
37
33
|
import { ThemeProvider as ThemeUIThemeProvider, useThemeUI } from "theme-ui";
|
|
38
34
|
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import
|
|
44
|
-
import {
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
35
|
+
import { getState } from "@/apiClient";
|
|
36
|
+
import { ErrorBoundary } from "@/ErrorBoundary";
|
|
37
|
+
import { InAppGuideProvider } from "@/features/inAppGuide/InAppGuideContext";
|
|
38
|
+
import { InAppGuideDialog } from "@/features/inAppGuide/InAppGuideDialog";
|
|
39
|
+
import { AutoSyncProvider } from "@/features/sync/AutoSyncProvider";
|
|
40
|
+
import { RouteChangeProvider } from "@/hooks/useRouteChange";
|
|
41
|
+
import SliceMachineApp from "@/legacy/components/App";
|
|
42
|
+
import LoadingPage from "@/legacy/components/LoadingPage";
|
|
43
|
+
import ToastContainer from "@/legacy/components/ToasterContainer";
|
|
44
|
+
import { normalizeFrontendCustomTypes } from "@/legacy/lib/models/common/normalizers/customType";
|
|
45
|
+
import type ServerState from "@/legacy/lib/models/server/ServerState";
|
|
46
|
+
import configureStore from "@/redux/store";
|
|
47
|
+
import theme from "@/theme";
|
|
48
48
|
|
|
49
49
|
type NextPageWithLayout = NextPage & {
|
|
50
50
|
CustomLayout?: React.FC<{ children: ReactNode }>;
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
+
import { PushChangesLimit } from "@slicemachine/manager";
|
|
2
|
+
import Head from "next/head";
|
|
3
|
+
import { useRouter } from "next/router";
|
|
4
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { toast } from "react-toastify";
|
|
6
|
+
import { BaseStyles } from "theme-ui";
|
|
7
|
+
|
|
8
|
+
import { getState } from "@/apiClient";
|
|
9
|
+
import { BreadcrumbItem } from "@/components/Breadcrumb";
|
|
10
|
+
import { NoChangesBlankSlate } from "@/features/changes/BlankSlates";
|
|
11
|
+
import { PushChangesButton } from "@/features/changes/PushChangesButton";
|
|
12
|
+
import { pushChanges } from "@/features/sync/actions/pushChanges";
|
|
13
|
+
import { useAutoSync } from "@/features/sync/AutoSyncProvider";
|
|
14
|
+
import { useUnSyncChanges } from "@/features/sync/useUnSyncChanges";
|
|
15
|
+
import { useAuthStatus } from "@/hooks/useAuthStatus";
|
|
16
|
+
import { useNetwork } from "@/hooks/useNetwork";
|
|
1
17
|
import {
|
|
2
18
|
AppLayout,
|
|
3
19
|
AppLayoutActions,
|
|
4
20
|
AppLayoutBreadcrumb,
|
|
5
21
|
AppLayoutContent,
|
|
6
22
|
AppLayoutHeader,
|
|
7
|
-
} from "
|
|
8
|
-
import {
|
|
9
|
-
|
|
23
|
+
} from "@/legacy/components/AppLayout";
|
|
24
|
+
import {
|
|
25
|
+
AuthErrorPage,
|
|
26
|
+
OfflinePage,
|
|
27
|
+
} from "@/legacy/components/ChangesEmptyState";
|
|
28
|
+
import { ChangesItems } from "@/legacy/components/ChangesItems";
|
|
10
29
|
import {
|
|
11
30
|
HardDeleteDocumentsDrawer,
|
|
12
31
|
SoftDeleteDocumentsDrawer,
|
|
13
|
-
} from "
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import { BreadcrumbItem } from "@src/components/Breadcrumb";
|
|
17
|
-
import { NoChangesBlankSlate } from "@src/features/changes/BlankSlates";
|
|
18
|
-
import { PushChangesButton } from "@src/features/changes/PushChangesButton";
|
|
19
|
-
import { pushChanges } from "@src/features/sync/actions/pushChanges";
|
|
20
|
-
import { useAutoSync } from "@src/features/sync/AutoSyncProvider";
|
|
21
|
-
import { useUnSyncChanges } from "@src/features/sync/useUnSyncChanges";
|
|
22
|
-
import { useAuthStatus } from "@src/hooks/useAuthStatus";
|
|
23
|
-
import { useNetwork } from "@src/hooks/useNetwork";
|
|
24
|
-
import { AuthStatus } from "@src/modules/userContext/types";
|
|
25
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
26
|
-
import Head from "next/head";
|
|
27
|
-
import { useRouter } from "next/router";
|
|
28
|
-
import React, { useEffect, useMemo, useState } from "react";
|
|
29
|
-
import { toast } from "react-toastify";
|
|
30
|
-
import { BaseStyles } from "theme-ui";
|
|
32
|
+
} from "@/legacy/components/DeleteDocumentsDrawer";
|
|
33
|
+
import { AuthStatus } from "@/modules/userContext/types";
|
|
34
|
+
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
31
35
|
|
|
32
36
|
const Changes: React.FunctionComponent = () => {
|
|
33
37
|
const {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomTypesBuilderPage as default } from "@/features/customTypes/customTypesBuilder/CustomTypesBuilderPage";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "@src/features/customTypes/customTypesTable/CustomTypesTablePage";
|
|
2
1
|
import { type FC } from "react";
|
|
3
2
|
|
|
3
|
+
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "@/features/customTypes/customTypesTable/CustomTypesTablePage";
|
|
4
|
+
|
|
4
5
|
const CustomTypesTablePage: FC = () => {
|
|
5
6
|
return <CustomTypesTablePageTemplate format="custom" />;
|
|
6
7
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "@src/features/customTypes/customTypesTable/CustomTypesTablePage";
|
|
2
|
-
import { PageTypeOnboarding } from "@src/features/customTypes/PageTypeOnboarding";
|
|
3
|
-
import { useIsEmptyProject } from "@src/hooks/useIsEmptyProject";
|
|
4
1
|
import { type FC } from "react";
|
|
5
2
|
|
|
3
|
+
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "@/features/customTypes/customTypesTable/CustomTypesTablePage";
|
|
4
|
+
import { PageTypeOnboarding } from "@/features/customTypes/PageTypeOnboarding";
|
|
5
|
+
import { useIsEmptyProject } from "@/hooks/useIsEmptyProject";
|
|
6
|
+
|
|
6
7
|
const PageTypesTablePage: FC = () => {
|
|
7
8
|
const isEmptyProject = useIsEmptyProject();
|
|
8
9
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LabsPage as default } from "@/features/labs/labsList/LabsPage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomTypesBuilderPage as default } from "@/features/customTypes/customTypesBuilder/CustomTypesBuilderPage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SettingsPage as default } from "@/features/settings/SettingsPage";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import SliceBuilder from "@lib/builders/SliceBuilder";
|
|
2
|
-
import { SliceBuilderProvider } from "@src/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
3
|
-
import useCurrentSlice from "@src/hooks/useCurrentSlice";
|
|
4
1
|
import Head from "next/head";
|
|
5
2
|
import { useRouter } from "next/router";
|
|
6
3
|
|
|
4
|
+
import { SliceBuilderProvider } from "@/features/slices/sliceBuilder/SliceBuilderProvider";
|
|
5
|
+
import useCurrentSlice from "@/hooks/useCurrentSlice";
|
|
6
|
+
import SliceBuilder from "@/legacy/lib/builders/SliceBuilder";
|
|
7
|
+
|
|
7
8
|
export default function SlicePage() {
|
|
8
9
|
const router = useRouter();
|
|
9
10
|
const { slice: initialSlice, variation: defaultVariation } =
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import Simulator from "@components/Simulator";
|
|
2
|
-
import useCurrentSlice from "@src/hooks/useCurrentSlice";
|
|
3
1
|
import Head from "next/head";
|
|
4
2
|
import { useRouter } from "next/router";
|
|
5
3
|
|
|
4
|
+
import useCurrentSlice from "@/hooks/useCurrentSlice";
|
|
5
|
+
import Simulator from "@/legacy/components/Simulator";
|
|
6
|
+
|
|
6
7
|
export default function SimulatorPage() {
|
|
7
8
|
const router = useRouter();
|
|
8
9
|
const { slice, variation } = useCurrentSlice();
|
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppLayout,
|
|
3
|
-
AppLayoutActions,
|
|
4
|
-
AppLayoutBreadcrumb,
|
|
5
|
-
AppLayoutContent,
|
|
6
|
-
AppLayoutHeader,
|
|
7
|
-
} from "@components/AppLayout";
|
|
8
|
-
import { DeleteSliceModal } from "@components/DeleteSliceModal";
|
|
9
|
-
import EmptyState from "@components/EmptyState";
|
|
10
|
-
import { CreateSliceModal } from "@components/Forms/CreateSliceModal";
|
|
11
|
-
import { RenameSliceModal } from "@components/Forms/RenameSliceModal";
|
|
12
|
-
import Grid from "@components/Grid";
|
|
13
|
-
import ScreenshotChangesModal from "@components/ScreenshotChangesModal";
|
|
14
|
-
import { SliceToastMessage } from "@components/ToasterContainer";
|
|
15
|
-
import { VIDEO_WHAT_ARE_SLICES } from "@lib/consts";
|
|
16
|
-
import { ComponentUI } from "@lib/models/common/ComponentUI";
|
|
17
|
-
import { LibraryUI } from "@lib/models/common/LibraryUI";
|
|
18
1
|
import { Button } from "@prismicio/editor-ui";
|
|
19
2
|
import { SharedSlice as SharedSliceType } from "@prismicio/types-internal/lib/customtypes";
|
|
20
|
-
import { BreadcrumbItem } from "@src/components/Breadcrumb";
|
|
21
|
-
import { SharedSliceCard } from "@src/features/slices/sliceCards/SharedSliceCard";
|
|
22
|
-
import { SLICES_CONFIG } from "@src/features/slices/slicesConfig";
|
|
23
|
-
import { useScreenshotChangesModal } from "@src/hooks/useScreenshotChangesModal";
|
|
24
|
-
import { getLibraries, getRemoteSlices } from "@src/modules/slices";
|
|
25
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
26
3
|
import Head from "next/head";
|
|
27
4
|
import { useRouter } from "next/router";
|
|
28
5
|
import React, { useState } from "react";
|
|
@@ -30,6 +7,30 @@ import { useSelector } from "react-redux";
|
|
|
30
7
|
import { toast } from "react-toastify";
|
|
31
8
|
import { BaseStyles, Flex, Link, Text } from "theme-ui";
|
|
32
9
|
|
|
10
|
+
import { BreadcrumbItem } from "@/components/Breadcrumb";
|
|
11
|
+
import { SharedSliceCard } from "@/features/slices/sliceCards/SharedSliceCard";
|
|
12
|
+
import { SLICES_CONFIG } from "@/features/slices/slicesConfig";
|
|
13
|
+
import { useScreenshotChangesModal } from "@/hooks/useScreenshotChangesModal";
|
|
14
|
+
import {
|
|
15
|
+
AppLayout,
|
|
16
|
+
AppLayoutActions,
|
|
17
|
+
AppLayoutBreadcrumb,
|
|
18
|
+
AppLayoutContent,
|
|
19
|
+
AppLayoutHeader,
|
|
20
|
+
} from "@/legacy/components/AppLayout";
|
|
21
|
+
import { DeleteSliceModal } from "@/legacy/components/DeleteSliceModal";
|
|
22
|
+
import EmptyState from "@/legacy/components/EmptyState";
|
|
23
|
+
import { CreateSliceModal } from "@/legacy/components/Forms/CreateSliceModal";
|
|
24
|
+
import { RenameSliceModal } from "@/legacy/components/Forms/RenameSliceModal";
|
|
25
|
+
import Grid from "@/legacy/components/Grid";
|
|
26
|
+
import ScreenshotChangesModal from "@/legacy/components/ScreenshotChangesModal";
|
|
27
|
+
import { SliceToastMessage } from "@/legacy/components/ToasterContainer";
|
|
28
|
+
import { VIDEO_WHAT_ARE_SLICES } from "@/legacy/lib/consts";
|
|
29
|
+
import { ComponentUI } from "@/legacy/lib/models/common/ComponentUI";
|
|
30
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
31
|
+
import { getLibraries, getRemoteSlices } from "@/modules/slices";
|
|
32
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
33
|
+
|
|
33
34
|
const SlicesIndex: React.FunctionComponent = () => {
|
|
34
35
|
const router = useRouter();
|
|
35
36
|
const { modalPayload, onOpenModal } = useScreenshotChangesModal();
|
package/src/redux/reducer.ts
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
* were to do this in store.js, reducers wouldn't be hot reloadable.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { availableCustomTypesReducer } from "@src/modules/availableCustomTypes";
|
|
7
|
-
import { environmentReducer } from "@src/modules/environment";
|
|
8
|
-
import { loadingReducer } from "@src/modules/loading";
|
|
9
|
-
import { modalReducer } from "@src/modules/modal";
|
|
10
|
-
import { slicesReducer } from "@src/modules/slices";
|
|
11
|
-
import { userContextReducer } from "@src/modules/userContext";
|
|
12
6
|
import { routerReducer } from "connected-next-router";
|
|
13
7
|
import { combineReducers, Reducer } from "redux";
|
|
14
8
|
|
|
9
|
+
import { availableCustomTypesReducer } from "@/modules/availableCustomTypes";
|
|
10
|
+
import { environmentReducer } from "@/modules/environment";
|
|
11
|
+
import { loadingReducer } from "@/modules/loading";
|
|
12
|
+
import { modalReducer } from "@/modules/modal";
|
|
13
|
+
import { slicesReducer } from "@/modules/slices";
|
|
14
|
+
import { userContextReducer } from "@/modules/userContext";
|
|
15
|
+
|
|
15
16
|
/** Creates the main reducer */
|
|
16
17
|
const createReducer = (): Reducer =>
|
|
17
18
|
combineReducers({
|
package/src/redux/store.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
2
1
|
import { createRouterMiddleware } from "connected-next-router";
|
|
3
2
|
import { applyMiddleware, compose, createStore, Store } from "redux";
|
|
4
3
|
import { persistReducer, persistStore } from "redux-persist";
|
|
5
4
|
import { Persistor } from "redux-persist/es/types"; // defaults to localStorage for web
|
|
6
5
|
import storage from "redux-persist/lib/storage";
|
|
7
6
|
|
|
7
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
8
|
+
|
|
8
9
|
import createReducer from "./reducer";
|
|
9
10
|
|
|
10
11
|
const persistConfig = {
|
package/src/redux/type.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { AvailableCustomTypesStoreType } from "@src/modules/availableCustomTypes/types";
|
|
2
|
-
import { EnvironmentStoreType } from "@src/modules/environment/types";
|
|
3
|
-
import { LoadingStoreType } from "@src/modules/loading/types";
|
|
4
|
-
import { ModalStoreType } from "@src/modules/modal/types";
|
|
5
|
-
import { SlicesStoreType } from "@src/modules/slices/types";
|
|
6
|
-
import { UserContextStoreType } from "@src/modules/userContext/types";
|
|
7
1
|
import { RouterState } from "connected-next-router/types";
|
|
8
2
|
|
|
3
|
+
import { AvailableCustomTypesStoreType } from "@/modules/availableCustomTypes/types";
|
|
4
|
+
import { EnvironmentStoreType } from "@/modules/environment/types";
|
|
5
|
+
import { LoadingStoreType } from "@/modules/loading/types";
|
|
6
|
+
import { ModalStoreType } from "@/modules/modal/types";
|
|
7
|
+
import { SlicesStoreType } from "@/modules/slices/types";
|
|
8
|
+
import { UserContextStoreType } from "@/modules/userContext/types";
|
|
9
|
+
|
|
9
10
|
export type SliceMachineStoreType = {
|
|
10
11
|
modal: ModalStoreType;
|
|
11
12
|
loading: LoadingStoreType;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines the content type of a given URL's pathname. This method is
|
|
3
|
+
* designed for the `field:*` tracking event, but may be used elsewhere.
|
|
4
|
+
*
|
|
5
|
+
* @param pathname - A URL's pathname.
|
|
6
|
+
*
|
|
7
|
+
* @throws {Error} Thrown when not on a slice, custom type, or page type page.
|
|
8
|
+
*/
|
|
9
|
+
export function getContentTypeForTracking(
|
|
10
|
+
pathname: string,
|
|
11
|
+
): "page type" | "custom type" | "slice" {
|
|
12
|
+
if (pathname.startsWith("/slices/")) {
|
|
13
|
+
return "slice";
|
|
14
|
+
} else if (pathname.startsWith("/custom-types/")) {
|
|
15
|
+
return "custom type";
|
|
16
|
+
} else if (pathname.startsWith("/page-types/")) {
|
|
17
|
+
return "page type";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
throw new Error(`Did not detect a content type from: ${pathname}`);
|
|
21
|
+
}
|
package/test/__setup__.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { FormData } from "formdata-polyfill/esm.min";
|
|
4
|
-
import { setupServer, SetupServer } from "msw/node";
|
|
5
|
-
import { cleanup } from "@testing-library/react";
|
|
6
|
-
import { createMockFactory, MockFactory } from "@prismicio/mock";
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
2
|
+
|
|
7
3
|
import * as fs from "node:fs/promises";
|
|
8
|
-
import * as path from "node:path";
|
|
9
4
|
import * as os from "node:os";
|
|
5
|
+
import * as path from "node:path";
|
|
10
6
|
|
|
7
|
+
import { createMockFactory, MockFactory } from "@prismicio/mock";
|
|
11
8
|
import { createSliceMachineManager } from "@slicemachine/manager";
|
|
12
9
|
import { createSliceMachineManagerMSWHandler } from "@slicemachine/manager/test";
|
|
13
|
-
import "@testing-library/
|
|
10
|
+
import { cleanup } from "@testing-library/react";
|
|
11
|
+
import { FormData } from "formdata-polyfill/esm.min";
|
|
12
|
+
import { SetupServer, setupServer } from "msw/node";
|
|
13
|
+
import fetch, { Blob, File, Headers, Request, Response } from "node-fetch";
|
|
14
|
+
import { afterAll, afterEach, beforeAll, beforeEach, vi } from "vitest";
|
|
15
|
+
|
|
14
16
|
import pkg from "../package.json";
|
|
15
17
|
import { createTestPlugin } from "./__testutils__/createTestPlugin";
|
|
16
18
|
import { createTestProject } from "./__testutils__/createTestProject";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import * as crypto from "node:crypto";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
defineSliceMachinePlugin,
|
|
3
|
-
SliceMachinePluginOptions,
|
|
4
5
|
SliceMachineHookTypes,
|
|
5
6
|
SliceMachinePlugin,
|
|
7
|
+
SliceMachinePluginOptions,
|
|
6
8
|
} from "@slicemachine/plugin-kit";
|
|
7
9
|
import { expect } from "vitest";
|
|
8
|
-
import * as crypto from "node:crypto";
|
|
9
10
|
|
|
10
11
|
const sha1 = (data: crypto.BinaryLike): string => {
|
|
11
12
|
return crypto.createHash("sha1").update(data).digest("hex");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SliceMachineConfig } from "@slicemachine/manager";
|
|
1
|
+
import * as crypto from "node:crypto";
|
|
3
2
|
import * as fs from "node:fs/promises";
|
|
4
|
-
import * as path from "node:path";
|
|
5
3
|
import * as os from "node:os";
|
|
6
|
-
import * as
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
|
|
6
|
+
import { SliceMachineConfig } from "@slicemachine/manager";
|
|
7
7
|
import type { SliceMachinePlugin } from "@slicemachine/plugin-kit";
|
|
8
|
+
import { expect } from "vitest";
|
|
8
9
|
|
|
9
10
|
const sha1 = (data: crypto.BinaryLike): string => {
|
|
10
11
|
return crypto.createHash("sha1").update(data).digest("hex");
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { TooltipProvider } from "@prismicio/editor-ui";
|
|
2
2
|
import { render as rtlRender, RenderOptions } from "@testing-library/react";
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
|
-
import { Store, AnyAction } from "redux";
|
|
5
|
-
|
|
6
4
|
import { Provider } from "react-redux";
|
|
7
|
-
import
|
|
5
|
+
import { AnyAction, Store } from "redux";
|
|
6
|
+
import { BaseStyles, ThemeProvider as ThemeUIThemeProvider } from "theme-ui";
|
|
7
|
+
|
|
8
|
+
import { ErrorBoundary } from "@/ErrorBoundary";
|
|
9
|
+
|
|
8
10
|
import configureStore from "../../src/redux/store";
|
|
11
|
+
import type { SliceMachineStoreType } from "../../src/redux/type";
|
|
9
12
|
import theme from "../../src/theme";
|
|
10
|
-
import { ErrorBoundary } from "@src/ErrorBoundary";
|
|
11
|
-
import { ThemeProvider as ThemeUIThemeProvider, BaseStyles } from "theme-ui";
|
|
12
13
|
|
|
13
14
|
export type RenderArgs = Partial<
|
|
14
15
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { getScaling } from "@/legacy/components/Simulator/components/IframeRenderer";
|
|
3
4
|
|
|
4
5
|
const VIEWPORT_SIZE = { width: 100, height: 100 };
|
|
5
6
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
|
|
3
|
-
import { describe, test, expect, vi } from "vitest";
|
|
4
3
|
import React from "react";
|
|
5
|
-
import { render, act, fireEvent } from "../../__testutils__";
|
|
6
4
|
import Modal from "react-modal";
|
|
7
|
-
import
|
|
5
|
+
import { describe, expect, test, vi } from "vitest";
|
|
6
|
+
|
|
7
|
+
import EditModal from "@/legacy/lib/builders/common/EditModal";
|
|
8
|
+
|
|
9
|
+
import { act, fireEvent, render } from "../../__testutils__";
|
|
8
10
|
|
|
9
11
|
vi.mock("next/router", () => require("next-router-mock"));
|
|
10
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { findWidgetByConfigOrType } from "@/legacy/lib/builders/utils";
|
|
4
|
+
import * as Widgets from "@/legacy/lib/models/common/widgets/withGroup";
|
|
5
5
|
|
|
6
6
|
const dumbConfig = {
|
|
7
7
|
label: "",
|
package/test/lib/consts.test.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
API_ID_REGEX,
|
|
5
|
+
API_ID_RETRO_COMPATIBLE_REGEX,
|
|
6
|
+
} from "@/legacy/lib/consts";
|
|
3
7
|
|
|
4
8
|
describe("Constant", () => {
|
|
5
9
|
test("API_ID_REGEX should block special characters except _", () => {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { describe, expect, test } from "vitest";
|
|
2
1
|
import { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
import {
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CustomTypes,
|
|
6
|
+
CustomTypeSM,
|
|
7
|
+
} from "@/legacy/lib/models/common/CustomType";
|
|
4
8
|
|
|
5
9
|
const customTypeObject = {
|
|
6
10
|
id: "test-page",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { CustomTypes } from "@/legacy/lib/models/common/CustomType";
|
|
2
4
|
import {
|
|
3
|
-
ModelStatus,
|
|
4
5
|
computeModelStatus,
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
ModelStatus,
|
|
7
|
+
} from "@/legacy/lib/models/common/ModelStatus";
|
|
8
|
+
|
|
7
9
|
import { customTypeMock } from "../../../__fixtures__/customType";
|
|
8
10
|
|
|
9
11
|
const model = CustomTypes.toSM(customTypeMock);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { describe, expect, test } from "vitest";
|
|
2
|
-
import { Slices, SliceSM } from "@lib/models/common/Slice";
|
|
3
1
|
import { SharedSlice } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { Slices, SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
4
5
|
|
|
5
6
|
const sliceObject = {
|
|
6
7
|
id: "all_fields",
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Widgets from "@lib/models/common/widgets";
|
|
3
|
-
import { CustomTypes, CustomTypeSM } from "@lib/models/common/CustomType";
|
|
1
|
+
import type { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
4
2
|
import type { UID } from "@prismicio/types-internal/lib/customtypes/widgets";
|
|
5
3
|
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
6
|
-
import
|
|
4
|
+
import { describe, expect, test } from "vitest";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
CustomTypes,
|
|
8
|
+
CustomTypeSM,
|
|
9
|
+
} from "@/legacy/lib/models/common/CustomType";
|
|
10
|
+
import * as Widgets from "@/legacy/lib/models/common/widgets";
|
|
7
11
|
|
|
8
12
|
const widgetEntries = Object.entries(Widgets);
|
|
9
13
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { slugify } from "@/legacy/lib/utils/str";
|
|
3
4
|
|
|
4
5
|
describe("slugify", () => {
|
|
5
6
|
test("returns the same string if valid", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
|
|
3
|
+
import preferWroomBase from "@/legacy/lib/utils/preferWroomBase";
|
|
3
4
|
|
|
4
5
|
describe("src/utils/preferWroomBase", () => {
|
|
5
6
|
test("when endpoint form env.manifest.apiEndpoint is not from wroom.io or wroom.test it should return the base in the from enn.prismicData.base (prismic config)", () => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { filterSliceFromCustomType } from "@lib/utils/shared/customTypes";
|
|
2
1
|
// @ts-expect-error TS(2307) FIXME: Cannot find module '@slicemachine/core/build/model... Remove this comment to see the full error message
|
|
3
2
|
import { CustomTypeSM } from "@slicemachine/core/build/models/CustomType";
|
|
4
3
|
|
|
4
|
+
import { filterSliceFromCustomType } from "@/legacy/lib/utils/shared/customTypes";
|
|
5
|
+
|
|
5
6
|
describe("Slice IO", () => {
|
|
6
7
|
const baseCustomTypeModel: CustomTypeSM = {
|
|
7
8
|
id: "some_custom_type",
|