slice-machine-ui 1.26.1-beta.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -1
- package/.storybook/preview.tsx +2 -1
- package/out/404.html +1 -1
- package/out/_next/static/QWi-WrYk9EtyMIs1RfQ3_/_buildManifest.js +1 -0
- package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad1d7303abecd2b.js} +1 -1
- package/out/_next/static/chunks/18539003-32a73014bab3a789.js +22 -0
- package/out/_next/static/chunks/188-2e42d5ebef697946.js +1 -0
- package/out/_next/static/chunks/569-2ae3e9666f3bf991.js +1 -0
- package/out/_next/static/chunks/614-5130fbdbcfab2d35.js +1 -0
- package/out/_next/static/chunks/661-78c8c89d258133b8.js +1 -0
- package/out/_next/static/chunks/756-b11a3060cdc2f2d3.js +10 -0
- package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
- package/out/_next/static/chunks/91-67c244a4a034c8de.js +1 -0
- package/out/_next/static/chunks/pages/_app-0fe871bb1059a05c.js +532 -0
- package/out/_next/static/chunks/pages/changelog-3f04a3d8747ae383.js +1 -0
- package/out/_next/static/chunks/pages/changes-ec62e7eb50d6f2be.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-982ecf1d799b6bcf.js +1 -0
- package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-900b40b54b74e6d6.js} +1 -1
- package/out/_next/static/chunks/pages/{index-cf93d16e9c63b6db.js → index-ccd2975faba412f6.js} +1 -1
- package/out/_next/static/chunks/pages/labs-830dde0b85d6dd01.js +1 -0
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-886fc28240831dae.js +1 -0
- package/out/_next/static/chunks/pages/settings-f61144a9387fd6f1.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ad66e6c755798ce7.js +1 -0
- package/out/_next/static/chunks/pages/slices-d65be4ca817a766d.js +1 -0
- package/out/_next/static/css/037ba37d121d4afe.css +1 -0
- package/out/_next/static/css/22f264c93bd9d85f.css +1 -0
- package/out/_next/static/css/6279e95f6aff22d5.css +1 -0
- package/out/_next/static/css/824d6e761aed01d2.css +1 -0
- package/out/_next/static/css/e3ffbc7931a47375.css +1 -0
- package/out/_next/static/css/f01f60095c76c7fb.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 +10 -11
- package/sentry.client.config.ts +2 -1
- package/src/ErrorBoundary.tsx +1 -1
- package/src/apiClient.ts +13 -9
- package/src/components/BaseHoverCard/BaseHoverCard.module.css +18 -0
- package/src/components/BaseHoverCard/BaseHoverCard.module.css.d.ts +7 -0
- package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
- package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
- package/src/components/BaseHoverCard/BaseHoverCard.tsx +2 -2
- package/src/components/BlankSlate/BlankSlate.module.css +74 -0
- package/src/components/BlankSlate/BlankSlate.module.css.d.ts +13 -0
- package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
- package/src/components/BlankSlate/BlankSlate.tsx +1 -1
- package/src/components/BlankSlate/index.ts +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/Card/Card.module.css +202 -0
- package/src/components/Card/Card.module.css.d.ts +22 -0
- package/src/components/Card/Card.stories.tsx +3 -3
- package/src/components/Card/Card.tsx +8 -8
- package/src/components/CodeBlock/CodeBlock.module.css +46 -0
- package/src/components/CodeBlock/CodeBlock.module.css.d.ts +10 -0
- package/src/components/CodeBlock/CodeBlock.tsx +7 -7
- package/src/components/ContentTabs/ContentTabs.tsx +1 -1
- package/src/components/Count/Count.tsx +1 -1
- package/src/components/Divider/Divider.module.css +23 -0
- package/src/components/Divider/Divider.module.css.d.ts +7 -0
- package/src/components/Divider/Divider.stories.tsx +3 -4
- package/src/components/Divider/Divider.tsx +5 -8
- package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
- package/src/components/HoverCard/HoverCard.test.tsx +2 -2
- package/src/components/HoverCard/HoverCard.tsx +2 -2
- package/src/components/HoverCard/index.ts +3 -3
- package/src/components/List/List.css.ts +4 -2
- package/src/components/PageLayout/PageLayout.module.css +1 -1
- package/src/components/SideNav/SideNav.module.css +1 -1
- package/src/components/SideNav/SideNav.stories.tsx +6 -6
- package/src/components/SideNav/SideNav.tsx +8 -8
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +10 -12
- package/src/components/Table/Table.stories.tsx +2 -2
- package/src/components/Table/Table.test.tsx +2 -2
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/Table/index.ts +1 -1
- package/src/components/TextLink/TextLink.stories.tsx +1 -1
- package/src/components/TextLink/TextLink.tsx +1 -1
- package/src/domain/__tests__/customType.test.ts +1 -186
- package/src/domain/__tests__/group.test.ts +161 -0
- package/src/domain/__tests__/slice.test.ts +3 -3
- package/src/domain/customType.ts +1 -193
- package/src/domain/group.ts +89 -0
- package/src/domain/slice.ts +28 -12
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -2
- package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +1 -1
- package/src/features/changelog/useSliceMachineReleaseNotes.ts +1 -1
- package/src/features/changelog/useSliceMachineVersions.ts +2 -2
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +11 -14
- package/src/features/changes/PushChangesButton.tsx +5 -5
- package/src/features/changes/StatusBadge.tsx +2 -2
- package/src/features/customTypes/EditDropdown.tsx +6 -9
- package/src/features/customTypes/PageTypeOnboarding.tsx +5 -5
- package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +11 -12
- package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +11 -10
- package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -4
- package/src/features/customTypes/actions/createCustomType.ts +5 -5
- package/src/features/customTypes/actions/deleteCustomType.ts +3 -3
- package/src/features/customTypes/actions/renameCustomType.ts +3 -3
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -8
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +17 -12
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css +8 -0
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css.d.ts +5 -0
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +8 -8
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +3 -3
- package/src/features/customTypes/customTypesBuilder/useCustomType.ts +1 -1
- package/src/features/customTypes/customTypesConfig.ts +2 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +16 -16
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +9 -9
- package/src/features/customTypes/customTypesTable/useCustomTypes.ts +8 -8
- package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css +11 -0
- package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css.d.ts +6 -0
- package/src/features/documentation/MarkdownRenderer/index.tsx +6 -7
- package/src/features/documentation/useDocumentation.ts +1 -1
- package/src/features/environments/actions/getActiveEnvironment.ts +1 -1
- package/src/features/environments/actions/getEnvironments.ts +1 -1
- package/src/features/environments/actions/setEnvironment.ts +3 -3
- package/src/features/inAppGuide/InAppGuideContext.tsx +2 -2
- package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -4
- package/src/features/inAppGuide/inAppGuideContent.tsx +4 -4
- package/src/features/labs/labsList/LabsList.tsx +2 -2
- package/src/features/labs/labsList/LabsListItem.tsx +1 -1
- package/src/features/labs/labsList/LabsPage.tsx +5 -5
- package/src/features/labs/labsList/useLab.tsx +1 -1
- package/src/features/settings/SettingsPage.tsx +4 -4
- package/src/features/settings/git/ConnectGitRepository.tsx +9 -9
- package/src/features/settings/git/GitOwnerSelect.tsx +1 -1
- package/src/features/settings/git/GitProvider.ts +4 -4
- package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -1
- package/src/features/settings/git/GitRepositoriesList.tsx +5 -5
- package/src/features/settings/git/GitRepositoriesSearch.tsx +5 -5
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +5 -8
- package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
- package/src/features/settings/git/useGitOwners.ts +1 -1
- package/src/features/settings/git/useGitRepos.ts +1 -1
- package/src/features/settings/git/useLinkedGitRepos.ts +2 -2
- package/src/features/settings/git/useWriteAPIToken.ts +2 -2
- package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -2
- package/src/features/slices/actions/createSlice.ts +5 -5
- package/src/features/slices/actions/deleteSlice.ts +1 -1
- package/src/features/slices/actions/renameSlice.ts +4 -4
- package/src/features/slices/actions/uploadSliceScreenshot.ts +2 -2
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +9 -9
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +6 -6
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +12 -12
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +3 -3
- package/src/features/slices/convertLegacySlice/types.ts +2 -2
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +6 -6
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -9
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +4 -4
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +3 -3
- package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +4 -4
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +7 -7
- package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -2
- package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
- package/src/features/sync/AutoSyncProvider.tsx +17 -17
- package/src/features/sync/actions/pushChanges.ts +4 -3
- package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css +1 -1
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -4
- package/src/features/sync/fetchUnSyncChanges.ts +5 -5
- package/src/features/sync/getUnSyncChanges.ts +9 -9
- package/src/features/sync/useUnSyncChanges.ts +5 -5
- package/src/hooks/useActionQueue.tsx +5 -5
- package/src/hooks/useAdapterName.ts +1 -1
- package/src/hooks/useAuthStatus.ts +2 -2
- package/src/hooks/useCurrentSlice.tsx +4 -4
- package/src/hooks/useEditorContent.ts +5 -4
- package/src/hooks/useExperimentVariant.ts +2 -2
- package/src/hooks/useIsEmptyProject.ts +1 -1
- package/src/hooks/useRepositoryInformation.ts +2 -2
- package/src/hooks/useRouteChange.tsx +1 -1
- package/src/hooks/useSMTracker.ts +6 -6
- package/src/hooks/useScreenshotChangesModal.ts +5 -4
- package/src/hooks/useServerState.ts +4 -4
- package/src/hooks/useSliceMachineConfig.ts +2 -2
- package/src/hooks/useSliceMachineRunningVersion.ts +1 -1
- package/src/hooks/useThrottle.ts +1 -1
- package/src/hooks/useUpdateAvailable.ts +1 -1
- package/src/hooks/useWindowDimensions.ts +1 -1
- package/src/hooks/useWindowSize.ts +2 -1
- package/{components → src/legacy/components}/App/index.tsx +8 -8
- package/{components → src/legacy/components}/AppLayout/index.tsx +5 -6
- package/{components → src/legacy/components}/AuthInstructions/index.jsx +1 -1
- package/{components → src/legacy/components}/Button/index.tsx +1 -2
- package/{components → src/legacy/components}/Card/Default.jsx +2 -1
- package/{components → src/legacy/components}/Card/Preview.jsx +1 -1
- package/{components → src/legacy/components}/Card/WithTabs/index.jsx +4 -3
- package/{components → src/legacy/components}/Card/index.tsx +1 -0
- package/{components → src/legacy/components}/Changelog/index.tsx +8 -8
- package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +2 -1
- package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +1 -0
- package/{components → src/legacy/components}/Changelog/navigation/index.tsx +6 -6
- package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +6 -6
- package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
- package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +5 -5
- package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +5 -5
- package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -14
- package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -3
- package/{components → src/legacy/components}/CodeBlock/index.tsx +3 -3
- package/{components → src/legacy/components}/ConfigErrors/index.jsx +4 -3
- package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +9 -8
- package/{components → src/legacy/components}/DeleteCTModal/index.tsx +9 -9
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +4 -4
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +9 -9
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +9 -8
- package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +6 -6
- package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -6
- package/{components → src/legacy/components}/DropDownSelector/index.tsx +2 -4
- package/{components → src/legacy/components}/EmptyState/index.tsx +3 -3
- package/{components → src/legacy/components}/FormFields/Array.jsx +2 -4
- package/{components → src/legacy/components}/FormFields/Checkbox.jsx +1 -1
- package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +1 -1
- package/{components → src/legacy/components}/FormFields/Input.tsx +3 -2
- package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +1 -1
- package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +18 -18
- package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +10 -10
- package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +12 -12
- package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +8 -8
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -6
- package/{components → src/legacy/components}/Forms/components/InputBox.tsx +2 -2
- package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +4 -3
- package/{components → src/legacy/components}/Forms/formsValidator.ts +6 -4
- package/{components → src/legacy/components}/FullPage/index.tsx +1 -1
- package/{components → src/legacy/components}/ListItem/Header.tsx +3 -2
- package/{components → src/legacy/components}/ListItem/index.tsx +8 -10
- package/{components → src/legacy/components}/LoadingPage/index.tsx +1 -0
- package/{components → src/legacy/components}/LoginModal/index.tsx +22 -22
- package/{components → src/legacy/components}/ModalFormCard/index.tsx +7 -6
- package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +18 -16
- package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -13
- package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +2 -2
- package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -3
- package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/VideoItem.tsx +14 -13
- package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
- package/{components → src/legacy/components}/Navigation/index.test.tsx +12 -12
- package/{components → src/legacy/components}/Navigation/index.tsx +20 -21
- package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +12 -12
- package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +6 -6
- package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +7 -7
- package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +12 -15
- package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -1
- package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
- package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +3 -3
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +4 -5
- package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -7
- package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -4
- package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
- package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +4 -5
- package/{components → src/legacy/components}/Simulator/index.tsx +25 -30
- package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +3 -2
- package/{components → src/legacy/components}/ToasterContainer/index.tsx +3 -5
- package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -2
- package/{components → src/legacy/components}/Tooltip/index.jsx +2 -2
- package/{components → src/legacy/components}/Warnings/index.jsx +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -4
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +8 -8
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +11 -11
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -23
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +2 -2
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +3 -2
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +34 -32
- package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +5 -5
- package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +43 -52
- package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +12 -11
- package/{lib/builders/SliceBuilder/Sidebar → src/legacy/lib/builders/SliceBuilder/VariationsList}/AddVariationModal.tsx +7 -7
- package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css +10 -0
- package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css.d.ts +5 -0
- package/src/legacy/lib/builders/SliceBuilder/VariationsList/index.tsx +253 -0
- package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +18 -13
- package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +3 -5
- package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +1 -1
- package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +14 -16
- package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +3 -4
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -2
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -5
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +16 -13
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +15 -9
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css +12 -0
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css.d.ts +5 -0
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +39 -0
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/index.tsx +1 -0
- package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +37 -19
- package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
- package/{lib → src/legacy/lib}/forms/fields.ts +1 -2
- package/{lib → src/legacy/lib}/forms/index.ts +1 -0
- package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +5 -4
- package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +3 -2
- package/{lib → src/legacy/lib}/models/common/Environment.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/Group.ts +3 -2
- package/{lib → src/legacy/lib}/models/common/Library.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
- package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +2 -1
- package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +10 -9
- package/{lib → src/legacy/lib}/models/common/Slice.ts +19 -5
- package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +3 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +5 -7
- package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +2 -3
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +9 -10
- package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +7 -7
- package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +2 -3
- package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -6
- package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +63 -76
- package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +6 -4
- package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +9 -11
- package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +6 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +3 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -7
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -6
- package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +4 -4
- package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +7 -7
- package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +3 -6
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +12 -11
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +3 -6
- package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +4 -5
- package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +4 -5
- package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +3 -1
- package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
- package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
- package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
- package/{lib → src/legacy/lib}/models/server/ServerState.ts +4 -3
- package/{lib → src/legacy/lib}/utils/index.ts +4 -5
- package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
- package/src/modules/availableCustomTypes/index.ts +15 -13
- package/src/modules/availableCustomTypes/types.ts +2 -2
- package/src/modules/environment/index.ts +10 -8
- package/src/modules/environment/types.ts +1 -1
- package/src/modules/loading/index.ts +3 -2
- package/src/modules/modal/index.ts +4 -2
- package/src/modules/slices/index.ts +13 -9
- package/src/modules/slices/selector.ts +1 -1
- package/src/modules/slices/types.ts +2 -2
- package/src/modules/useSliceMachineActions.ts +25 -20
- package/src/modules/userContext/index.ts +5 -3
- package/{pages → src/pages}/_app.tsx +23 -25
- package/{pages → src/pages}/changelog.tsx +1 -1
- package/{pages → src/pages}/changes.tsx +22 -19
- package/src/pages/custom-types/[customTypeId].tsx +1 -0
- package/{pages → src/pages}/custom-types.tsx +1 -1
- package/{pages → src/pages}/index.tsx +3 -3
- package/src/pages/labs.tsx +1 -0
- package/src/pages/page-types/[pageTypeId].tsx +1 -0
- package/src/pages/settings.tsx +1 -0
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +3 -3
- package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -2
- package/{pages → src/pages}/slices.tsx +21 -21
- package/src/redux/reducer.ts +8 -7
- package/src/redux/store.ts +8 -6
- package/src/redux/type.ts +7 -6
- package/src/theme.ts +1 -2
- package/src/utils/getContentTypeForTracking.ts +21 -0
- package/test/__setup__.ts +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 +3 -3
- package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
- package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
- package/test/src/modules/environment.test.ts +3 -5
- package/test/src/modules/loading.test.ts +3 -3
- package/test/src/modules/modal.test.ts +5 -5
- package/test/src/modules/slices.test.ts +3 -2
- package/test/src/modules/userContext.test.ts +3 -3
- package/test/src/normalizers/customType.test.ts +16 -3
- package/test/src/utils/fieldNameCreator.test.ts +1 -1
- package/tsconfig.json +1 -6
- package/vite.config.ts +5 -10
- package/lib/builders/SliceBuilder/Sidebar/index.tsx +0 -157
- package/lib/builders/common/Zone/components/EmptyState/index.tsx +0 -33
- package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
- package/lib/models/common/widgets/withGroup.ts +0 -20
- package/out/_next/static/chunks/18539003-a5a5d48f20a7b261.js +0 -97
- package/out/_next/static/chunks/25-792af14760d9df34.js +0 -1
- package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
- package/out/_next/static/chunks/318-77a29f41c3a027e3.js +0 -1
- package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
- package/out/_next/static/chunks/727-d0d6a29f0793bde2.js +0 -1
- package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
- package/out/_next/static/chunks/869-868567cc5e32452f.js +0 -1
- package/out/_next/static/chunks/pages/_app-59bc66a6d9d39383.js +0 -436
- package/out/_next/static/chunks/pages/changelog-055db8139a22a592.js +0 -1
- package/out/_next/static/chunks/pages/changes-f43ad4ab5e00f9b9.js +0 -1
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-ad5936d95fafff44.js +0 -1
- package/out/_next/static/chunks/pages/labs-73a12d2fe0233fb9.js +0 -1
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-5ccb44e013a3b002.js +0 -1
- package/out/_next/static/chunks/pages/settings-417f1d5c1e558c88.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]-a8933b0ef10806cd.js +0 -1
- package/out/_next/static/chunks/pages/slices-3c9b08adf578b020.js +0 -1
- package/out/_next/static/css/0e0d6c4ec6bf7373.css +0 -1
- package/out/_next/static/css/27f2b9b9c9f65885.css +0 -1
- package/out/_next/static/css/57a7e5eb58b45860.css +0 -1
- package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
- package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
- package/out/_next/static/css/fa4e416634515cbb.css +0 -1
- package/out/_next/static/p-7eJUu7gNSRAriJWjZOw/_buildManifest.js +0 -1
- package/pages/custom-types/[customTypeId].tsx +0 -1
- package/pages/labs.tsx +0 -1
- package/pages/page-types/[pageTypeId].tsx +0 -1
- package/pages/settings.tsx +0 -1
- package/src/components/BaseHoverCard/BaseHoverCard.css.ts +0 -25
- package/src/components/BlankSlate/BlankSlate.css.ts +0 -96
- package/src/components/Card/Card.css.ts +0 -188
- package/src/components/CodeBlock/CodeBlock.css.ts +0 -37
- package/src/components/Divider/Divider.css.ts +0 -31
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.css.ts +0 -12
- package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.css.ts +0 -13
- package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +0 -8
- package/out/_next/static/{p-7eJUu7gNSRAriJWjZOw → QWi-WrYk9EtyMIs1RfQ3_}/_ssgManifest.js +0 -0
- package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
- package/{components → src/legacy/components}/Card/WithTabs/components.jsx +1 -1
- package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
- package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/{components → src/legacy/components}/ChangesEmptyState/index.ts +1 -1
- package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +1 -1
- package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
- package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
- package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
- package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +1 -1
- package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
- package/{components → src/legacy/components}/Flex/index.tsx +0 -0
- package/{components → src/legacy/components}/FormFields/index.ts +0 -0
- package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
- package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
- package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
- package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
- package/{components → src/legacy/components}/Forms/RenameVariationModal/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/formsTypes.ts +0 -0
- package/{components → src/legacy/components}/Grid/index.tsx +0 -0
- package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +1 -1
- package/{components → src/legacy/components}/ItemHeader/index.tsx +1 -1
- package/{components → src/legacy/components}/Li/index.tsx +0 -0
- package/{components → src/legacy/components}/ListItem/utils.js +0 -0
- package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
- package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
- package/{components → src/legacy/components}/Navigation/index.module.css +0 -0
- package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
- package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +1 -1
- package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
- package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +1 -1
- package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
- package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
- package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +1 -1
- package/{components → src/legacy/components}/SliceMachineModal/index.tsx +1 -1
- package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
- package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
- package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
- package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
- package/{lib → src/legacy/lib}/consts.ts +0 -0
- package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
- package/{lib → src/legacy/lib}/forms/defaults.ts +1 -1
- package/{lib → src/legacy/lib}/forms/types.ts +0 -0
- package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +4 -4
- package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Fields.ts +1 -1
- package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Slices.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +3 -3
- package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +2 -2
- package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +5 -5
- package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
- package/{lib → src/legacy/lib}/models/common/widgets/index.ts +1 -1
- /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
- /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
- /package/{pages → src/pages}/api/embed.js +0 -0
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import { omit } from "lodash";
|
|
1
2
|
import { Reducer } from "redux";
|
|
2
|
-
import { AvailableCustomTypesStoreType } from "./types";
|
|
3
3
|
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
|
|
5
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
6
|
+
import {
|
|
7
|
+
hasLocal,
|
|
8
|
+
hasLocalAndRemote,
|
|
9
|
+
LocalOrRemoteCustomType,
|
|
10
|
+
RemoteOnlyCustomType,
|
|
11
|
+
} from "@/legacy/lib/models/common/ModelData";
|
|
7
12
|
import {
|
|
8
13
|
normalizeFrontendCustomType,
|
|
9
14
|
normalizeFrontendCustomTypes,
|
|
10
|
-
} from "
|
|
11
|
-
import {
|
|
15
|
+
} from "@/legacy/lib/models/common/normalizers/customType";
|
|
16
|
+
import { filterSliceFromCustomType } from "@/legacy/lib/utils/shared/customTypes";
|
|
17
|
+
import { refreshStateCreator } from "@/modules/environment";
|
|
18
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
19
|
+
|
|
12
20
|
import { sliceDeleteSuccess } from "../slices";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
LocalOrRemoteCustomType,
|
|
16
|
-
RemoteOnlyCustomType,
|
|
17
|
-
hasLocal,
|
|
18
|
-
hasLocalAndRemote,
|
|
19
|
-
} from "@lib/models/common/ModelData";
|
|
21
|
+
import { AvailableCustomTypesStoreType } from "./types";
|
|
20
22
|
|
|
21
23
|
// Action Creators
|
|
22
24
|
export const customTypeSaveSuccess = createAction("CUSTOM_TYPE/SAVE_SUCCESS")<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CustomTypeSM } from "
|
|
2
|
-
import { LocalOrRemoteCustomType } from "
|
|
1
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
2
|
+
import { LocalOrRemoteCustomType } from "@/legacy/lib/models/common/ModelData";
|
|
3
3
|
|
|
4
4
|
export type AvailableCustomTypesStoreType = Readonly<
|
|
5
5
|
Record<CustomTypeSM["id"], LocalOrRemoteCustomType>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import type { APIEndpoints, PackageManager } from "@slicemachine/manager";
|
|
1
2
|
import { Reducer } from "redux";
|
|
2
|
-
import { EnvironmentStoreType } from "./types";
|
|
3
3
|
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { FrontEndEnvironment } from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
4
|
+
|
|
5
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
6
|
+
import { FrontEndEnvironment } from "@/legacy/lib/models/common/Environment";
|
|
7
|
+
import ErrorWithStatus from "@/legacy/lib/models/common/ErrorWithStatus";
|
|
8
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
9
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
10
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
11
|
+
|
|
11
12
|
import { AuthStatus } from "../userContext/types";
|
|
13
|
+
import { EnvironmentStoreType } from "./types";
|
|
12
14
|
|
|
13
15
|
// Action Creators
|
|
14
16
|
export const refreshStateCreator = createAction("STATE/REFRESH.RESPONSE")<{
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Reducer } from "redux";
|
|
2
1
|
import mapValues from "lodash/mapValues";
|
|
2
|
+
import { Reducer } from "redux";
|
|
3
3
|
import { SliceMachineStoreType } from "src/redux/type";
|
|
4
|
-
import { LoadingStoreType, LoadingKeysEnum } from "./types";
|
|
5
4
|
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
6
5
|
|
|
6
|
+
import { LoadingKeysEnum, LoadingStoreType } from "./types";
|
|
7
|
+
|
|
7
8
|
export const initialState: LoadingStoreType = {
|
|
8
9
|
...(mapValues(LoadingKeysEnum, () => false) as Record<
|
|
9
10
|
LoadingKeysEnum,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import mapValues from "lodash/mapValues";
|
|
2
2
|
import { Reducer } from "redux";
|
|
3
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
4
3
|
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
6
|
+
|
|
7
|
+
import { ModalKeysEnum, ModalStoreType } from "./types";
|
|
6
8
|
|
|
7
9
|
export const initialState: ModalStoreType = {
|
|
8
10
|
...(mapValues(ModalKeysEnum, () => false) as Record<ModalKeysEnum, boolean>),
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
2
1
|
import { Reducer } from "redux";
|
|
2
|
+
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
3
|
+
|
|
4
|
+
import { SaveSliceMockRequest } from "@/apiClient";
|
|
5
|
+
import {
|
|
6
|
+
ComponentUI,
|
|
7
|
+
ScreenshotUI,
|
|
8
|
+
} from "@/legacy/lib/models/common/ComponentUI";
|
|
9
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
10
|
+
import { LocalOrRemoteSlice } from "@/legacy/lib/models/common/ModelData";
|
|
11
|
+
import { normalizeFrontendSlices } from "@/legacy/lib/models/common/normalizers/slices";
|
|
12
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
13
|
+
import { refreshStateCreator } from "@/modules/environment";
|
|
14
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
3
15
|
|
|
4
|
-
import { LocalOrRemoteSlice } from "@lib/models/common/ModelData";
|
|
5
|
-
import { normalizeFrontendSlices } from "@lib/models/common/normalizers/slices";
|
|
6
|
-
import { SliceSM } from "@lib/models/common/Slice";
|
|
7
|
-
import { LibraryUI } from "@models/common/LibraryUI";
|
|
8
|
-
import { SaveSliceMockRequest } from "@src/apiClient";
|
|
9
|
-
import { refreshStateCreator } from "@src/modules/environment";
|
|
10
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
11
16
|
import { SlicesStoreType } from "./types";
|
|
12
|
-
import { ComponentUI, ScreenshotUI } from "@lib/models/common/ComponentUI";
|
|
13
17
|
|
|
14
18
|
// Action Creators
|
|
15
19
|
export const sliceCreateSuccess = createAction("SLICES/CREATE_SUCCESS")<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LibraryUI } from "
|
|
2
|
-
import { SliceSM } from "
|
|
1
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
2
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
3
3
|
|
|
4
4
|
export type SlicesStoreType = {
|
|
5
5
|
libraries: ReadonlyArray<LibraryUI>;
|
|
@@ -1,39 +1,44 @@
|
|
|
1
|
+
import { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
1
2
|
import { useDispatch } from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { modalCloseCreator, modalOpenCreator } from "./modal";
|
|
5
|
-
import { startLoadingActionCreator, stopLoadingActionCreator } from "./loading";
|
|
3
|
+
|
|
4
|
+
import { SaveSliceMockRequest } from "@/apiClient";
|
|
6
5
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import ServerState from "@models/server/ServerState";
|
|
6
|
+
ComponentUI,
|
|
7
|
+
ScreenshotUI,
|
|
8
|
+
} from "@/legacy/lib/models/common/ComponentUI";
|
|
9
|
+
import { CustomTypes } from "@/legacy/lib/models/common/CustomType";
|
|
10
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
11
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
12
|
+
import ServerState from "@/legacy/lib/models/server/ServerState";
|
|
13
|
+
|
|
16
14
|
import {
|
|
17
15
|
customTypeCreateSuccess,
|
|
18
16
|
customTypeDeleteSuccess,
|
|
19
17
|
customTypeRenameSuccess,
|
|
20
18
|
customTypeSaveSuccess,
|
|
21
19
|
} from "./availableCustomTypes";
|
|
20
|
+
import { refreshStateCreator } from "./environment";
|
|
21
|
+
import { startLoadingActionCreator, stopLoadingActionCreator } from "./loading";
|
|
22
|
+
import { LoadingKeysEnum } from "./loading/types";
|
|
23
|
+
import { modalCloseCreator, modalOpenCreator } from "./modal";
|
|
24
|
+
import { ModalKeysEnum } from "./modal/types";
|
|
22
25
|
import {
|
|
23
26
|
sliceCreateSuccess,
|
|
24
27
|
sliceDeleteSuccess,
|
|
25
28
|
sliceGenerateCustomScreenshotSuccess,
|
|
26
|
-
sliceUpdateSuccess,
|
|
27
29
|
sliceRenameSuccess,
|
|
28
30
|
sliceUpdateMockSuccess,
|
|
31
|
+
sliceUpdateSuccess,
|
|
29
32
|
} from "./slices";
|
|
33
|
+
import {
|
|
34
|
+
changesPushSuccess,
|
|
35
|
+
hasSeenChangesToolTipCreator,
|
|
36
|
+
hasSeenSimulatorToolTipCreator,
|
|
37
|
+
hasSeenTutorialsToolTipCreator,
|
|
38
|
+
sendAReviewCreator,
|
|
39
|
+
skipReviewCreator,
|
|
40
|
+
} from "./userContext";
|
|
30
41
|
import { UserReviewType } from "./userContext/types";
|
|
31
|
-
import { CustomTypes } from "@lib/models/common/CustomType";
|
|
32
|
-
import { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
33
|
-
import { ComponentUI, ScreenshotUI } from "../../lib/models/common/ComponentUI";
|
|
34
|
-
import { LibraryUI } from "@lib/models/common/LibraryUI";
|
|
35
|
-
import { SliceSM } from "@lib/models/common/Slice";
|
|
36
|
-
import { SaveSliceMockRequest } from "@src/apiClient";
|
|
37
42
|
|
|
38
43
|
const useSliceMachineActions = () => {
|
|
39
44
|
const dispatch = useDispatch();
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { Reducer } from "redux";
|
|
2
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
3
2
|
import { ActionType, createAction, getType } from "typesafe-actions";
|
|
3
|
+
|
|
4
|
+
import ErrorWithStatus from "@/legacy/lib/models/common/ErrorWithStatus";
|
|
4
5
|
import {
|
|
5
6
|
AuthStatus,
|
|
6
7
|
UserContextStoreType,
|
|
7
8
|
UserReviewState,
|
|
8
9
|
UserReviewType,
|
|
9
|
-
} from "
|
|
10
|
+
} from "@/modules/userContext/types";
|
|
11
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
12
|
+
|
|
10
13
|
import { refreshStateCreator } from "../environment";
|
|
11
|
-
import ErrorWithStatus from "@lib/models/common/ErrorWithStatus";
|
|
12
14
|
|
|
13
15
|
// NOTE: Be careful every key written in this store is persisted in the localstorage
|
|
14
16
|
|
|
@@ -3,16 +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
|
-
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import "@src/styles/toaster.css";
|
|
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";
|
|
16
15
|
|
|
17
16
|
import {
|
|
18
17
|
Box,
|
|
@@ -26,27 +25,26 @@ import type { AppContext, AppInitialProps } from "next/app";
|
|
|
26
25
|
import dynamic from "next/dynamic";
|
|
27
26
|
import Head from "next/head";
|
|
28
27
|
import Router from "next/router";
|
|
29
|
-
import { type FC, type ReactNode, useEffect, useState
|
|
28
|
+
import { type FC, type ReactNode, Suspense, useEffect, useState } from "react";
|
|
30
29
|
import { Provider } from "react-redux";
|
|
31
30
|
import type { Store } from "redux";
|
|
32
31
|
import type { Persistor } from "redux-persist/es/types";
|
|
33
32
|
import { PersistGate } from "redux-persist/integration/react";
|
|
34
33
|
import { ThemeProvider as ThemeUIThemeProvider, useThemeUI } from "theme-ui";
|
|
35
34
|
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import configureStore from "
|
|
48
|
-
import
|
|
49
|
-
import theme from "../src/theme";
|
|
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";
|
|
50
48
|
|
|
51
49
|
type NextPageWithLayout = NextPage & {
|
|
52
50
|
CustomLayout?: React.FC<{ children: ReactNode }>;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
+
import { PushChangesLimit } from "@slicemachine/manager";
|
|
2
|
+
import Head from "next/head";
|
|
3
|
+
import { useRouter } from "next/router";
|
|
1
4
|
import React, { useEffect, useMemo, useState } from "react";
|
|
2
5
|
import { toast } from "react-toastify";
|
|
3
|
-
import Head from "next/head";
|
|
4
6
|
import { BaseStyles } from "theme-ui";
|
|
5
|
-
import { useRouter } from "next/router";
|
|
6
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";
|
|
7
17
|
import {
|
|
8
18
|
AppLayout,
|
|
9
19
|
AppLayoutActions,
|
|
10
20
|
AppLayoutBreadcrumb,
|
|
11
21
|
AppLayoutContent,
|
|
12
22
|
AppLayoutHeader,
|
|
13
|
-
} from "
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
import { AuthStatus } from "@src/modules/userContext/types";
|
|
20
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
23
|
+
} from "@/legacy/components/AppLayout";
|
|
24
|
+
import {
|
|
25
|
+
AuthErrorPage,
|
|
26
|
+
OfflinePage,
|
|
27
|
+
} from "@/legacy/components/ChangesEmptyState";
|
|
28
|
+
import { ChangesItems } from "@/legacy/components/ChangesItems";
|
|
21
29
|
import {
|
|
22
|
-
SoftDeleteDocumentsDrawer,
|
|
23
30
|
HardDeleteDocumentsDrawer,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import { useUnSyncChanges } from "@src/features/sync/useUnSyncChanges";
|
|
29
|
-
import { useNetwork } from "@src/hooks/useNetwork";
|
|
30
|
-
import { useAuthStatus } from "@src/hooks/useAuthStatus";
|
|
31
|
-
import { useAutoSync } from "@src/features/sync/AutoSyncProvider";
|
|
31
|
+
SoftDeleteDocumentsDrawer,
|
|
32
|
+
} from "@/legacy/components/DeleteDocumentsDrawer";
|
|
33
|
+
import { AuthStatus } from "@/modules/userContext/types";
|
|
34
|
+
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
32
35
|
|
|
33
36
|
const Changes: React.FunctionComponent = () => {
|
|
34
37
|
const {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomTypesBuilderPage as default } from "@/features/customTypes/customTypesBuilder/CustomTypesBuilderPage";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FC } from "react";
|
|
2
2
|
|
|
3
|
-
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "
|
|
3
|
+
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "@/features/customTypes/customTypesTable/CustomTypesTablePage";
|
|
4
4
|
|
|
5
5
|
const CustomTypesTablePage: FC = () => {
|
|
6
6
|
return <CustomTypesTablePageTemplate format="custom" />;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type FC } from "react";
|
|
2
2
|
|
|
3
|
-
import { CustomTypesTablePage as CustomTypesTablePageTemplate } from "
|
|
4
|
-
import { PageTypeOnboarding } from "
|
|
5
|
-
import { useIsEmptyProject } from "
|
|
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
7
|
const PageTypesTablePage: FC = () => {
|
|
8
8
|
const isEmptyProject = useIsEmptyProject();
|
|
@@ -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,9 @@
|
|
|
1
1
|
import Head from "next/head";
|
|
2
2
|
import { useRouter } from "next/router";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
8
|
export default function SlicePage() {
|
|
9
9
|
const router = useRouter();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Head from "next/head";
|
|
2
2
|
import { useRouter } from "next/router";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import useCurrentSlice from "@/hooks/useCurrentSlice";
|
|
5
|
+
import Simulator from "@/legacy/components/Simulator";
|
|
6
6
|
|
|
7
7
|
export default function SimulatorPage() {
|
|
8
8
|
const router = useRouter();
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { Button } from "@prismicio/editor-ui";
|
|
2
|
-
import
|
|
2
|
+
import { SharedSlice as SharedSliceType } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import Head from "next/head";
|
|
4
|
-
import { BaseStyles, Flex, Text, Link } from "theme-ui";
|
|
5
|
-
import { useSelector } from "react-redux";
|
|
6
4
|
import { useRouter } from "next/router";
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
7
7
|
import { toast } from "react-toastify";
|
|
8
|
-
import {
|
|
8
|
+
import { BaseStyles, Flex, Link, Text } from "theme-ui";
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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";
|
|
13
14
|
import {
|
|
14
15
|
AppLayout,
|
|
15
16
|
AppLayoutActions,
|
|
16
17
|
AppLayoutBreadcrumb,
|
|
17
18
|
AppLayoutContent,
|
|
18
19
|
AppLayoutHeader,
|
|
19
|
-
} from "
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { SliceToastMessage } from "@components/ToasterContainer";
|
|
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
34
|
const SlicesIndex: React.FunctionComponent = () => {
|
|
35
35
|
const router = useRouter();
|
package/src/redux/reducer.ts
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* were to do this in store.js, reducers wouldn't be hot reloadable.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { combineReducers, Reducer } from "redux";
|
|
7
|
-
import { modalReducer } from "@src/modules/modal";
|
|
8
|
-
import { loadingReducer } from "@src/modules/loading";
|
|
9
|
-
import { userContextReducer } from "@src/modules/userContext";
|
|
10
|
-
import { environmentReducer } from "@src/modules/environment";
|
|
11
|
-
import { availableCustomTypesReducer } from "@src/modules/availableCustomTypes";
|
|
12
|
-
import { slicesReducer } from "@src/modules/slices";
|
|
13
6
|
import { routerReducer } from "connected-next-router";
|
|
7
|
+
import { combineReducers, Reducer } from "redux";
|
|
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";
|
|
14
15
|
|
|
15
16
|
/** Creates the main reducer */
|
|
16
17
|
const createReducer = (): Reducer =>
|
package/src/redux/store.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { createStore, compose, applyMiddleware, Store } from "redux";
|
|
2
|
-
import createReducer from "./reducer";
|
|
3
|
-
import { persistStore, persistReducer } from "redux-persist";
|
|
4
|
-
import storage from "redux-persist/lib/storage";
|
|
5
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
6
|
-
import { Persistor } from "redux-persist/es/types"; // defaults to localStorage for web
|
|
7
1
|
import { createRouterMiddleware } from "connected-next-router";
|
|
2
|
+
import { applyMiddleware, compose, createStore, Store } from "redux";
|
|
3
|
+
import { persistReducer, persistStore } from "redux-persist";
|
|
4
|
+
import { Persistor } from "redux-persist/es/types"; // defaults to localStorage for web
|
|
5
|
+
import storage from "redux-persist/lib/storage";
|
|
6
|
+
|
|
7
|
+
import { SliceMachineStoreType } from "@/redux/type";
|
|
8
|
+
|
|
9
|
+
import createReducer from "./reducer";
|
|
8
10
|
|
|
9
11
|
const persistConfig = {
|
|
10
12
|
key: "root",
|
package/src/redux/type.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ModalStoreType } from "@src/modules/modal/types";
|
|
2
|
-
import { LoadingStoreType } from "@src/modules/loading/types";
|
|
3
|
-
import { UserContextStoreType } from "@src/modules/userContext/types";
|
|
4
|
-
import { EnvironmentStoreType } from "@src/modules/environment/types";
|
|
5
|
-
import { AvailableCustomTypesStoreType } from "@src/modules/availableCustomTypes/types";
|
|
6
|
-
import { SlicesStoreType } from "@src/modules/slices/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;
|
package/src/theme.ts
CHANGED
|
@@ -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";
|