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,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",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
|
|
3
|
-
import { describe, test, afterEach, beforeEach, expect, vi } from "vitest";
|
|
4
|
-
import mockRouter from "next-router-mock";
|
|
5
3
|
import { Analytics } from "@segment/analytics-node";
|
|
4
|
+
import { createSliceMachineManager } from "@slicemachine/manager";
|
|
5
|
+
import { createSliceMachineManagerMSWHandler } from "@slicemachine/manager/test";
|
|
6
|
+
import mockRouter from "next-router-mock";
|
|
7
|
+
import { createTestPlugin } from "../__testutils__/createTestPlugin";
|
|
8
|
+
import { createTestProject } from "../__testutils__/createTestProject";
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
6
10
|
|
|
7
|
-
import
|
|
8
|
-
import SlicesIndex from "../../pages/slices";
|
|
11
|
+
import SlicesIndex from "@/pages/slices";
|
|
9
12
|
|
|
13
|
+
import pkg from "../../package.json";
|
|
10
14
|
import {
|
|
11
|
-
render,
|
|
12
|
-
fireEvent,
|
|
13
15
|
act,
|
|
16
|
+
fireEvent,
|
|
17
|
+
render,
|
|
14
18
|
screen,
|
|
15
19
|
waitFor,
|
|
16
20
|
within,
|
|
17
21
|
} from "../__testutils__";
|
|
18
|
-
import { createTestPlugin } from "test/__testutils__/createTestPlugin";
|
|
19
|
-
import { createTestProject } from "test/__testutils__/createTestProject";
|
|
20
|
-
import { createSliceMachineManager } from "@slicemachine/manager";
|
|
21
|
-
import { createSliceMachineManagerMSWHandler } from "@slicemachine/manager/test";
|
|
22
22
|
|
|
23
23
|
vi.mock("next/router", () => import("next-router-mock"));
|
|
24
24
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ServerState from "
|
|
1
|
+
import ServerState from "@/legacy/lib/models/server/ServerState";
|
|
2
2
|
|
|
3
3
|
export const dummyServerState: Pick<
|
|
4
4
|
ServerState,
|
|
@@ -21,8 +21,8 @@ export const dummyServerState: Pick<
|
|
|
21
21
|
PrismicUser: "https://user-service.prismic.io/",
|
|
22
22
|
AwsAclProvider:
|
|
23
23
|
"https://0yyeb2g040.execute-api.us-east-1.amazonaws.com/prod/",
|
|
24
|
-
|
|
25
|
-
PrismicUnsplash: "https://unsplash.prismic.io",
|
|
24
|
+
PrismicEmbed: "https://oembed.prismic.io",
|
|
25
|
+
PrismicUnsplash: "https://unsplash.prismic.io/",
|
|
26
26
|
SliceMachineV1: "https://sm-api.prismic.io/v1/",
|
|
27
27
|
},
|
|
28
28
|
shortId: "shortId",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentUI } from "
|
|
2
|
-
import { LibraryUI } from "
|
|
3
|
-
import { SliceSM } from "
|
|
1
|
+
import { ComponentUI } from "@/legacy/lib/models/common/ComponentUI";
|
|
2
|
+
import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
|
|
3
|
+
import { SliceSM } from "@/legacy/lib/models/common/Slice";
|
|
4
4
|
|
|
5
5
|
const DEFAULT_SLICE_SM: SliceSM = {
|
|
6
6
|
id: "blog_section_three_column_cards",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
|
-
import { availableCustomTypesReducer } from "
|
|
4
|
-
import { AvailableCustomTypesStoreType } from "
|
|
5
|
-
import { refreshStateCreator } from "
|
|
3
|
+
import { availableCustomTypesReducer } from "@/modules/availableCustomTypes";
|
|
4
|
+
import { AvailableCustomTypesStoreType } from "@/modules/availableCustomTypes/types";
|
|
5
|
+
import { refreshStateCreator } from "@/modules/environment";
|
|
6
6
|
|
|
7
7
|
import { dummyServerState } from "../__fixtures__/serverState";
|
|
8
8
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "@src/modules/environment";
|
|
7
|
-
import { EnvironmentStoreType } from "@src/modules/environment/types";
|
|
3
|
+
import { environmentReducer, refreshStateCreator } from "@/modules/environment";
|
|
4
|
+
import { EnvironmentStoreType } from "@/modules/environment/types";
|
|
5
|
+
|
|
8
6
|
import { dummyServerState } from "./__fixtures__/serverState";
|
|
9
7
|
|
|
10
8
|
const dummyEnvironmentState: EnvironmentStoreType = dummyServerState.env;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
initialState,
|
|
4
5
|
loadingReducer,
|
|
5
6
|
startLoadingActionCreator,
|
|
6
7
|
stopLoadingActionCreator,
|
|
7
|
-
} from "
|
|
8
|
-
import { LoadingKeysEnum, LoadingStoreType } from "
|
|
9
|
-
import { initialState } from "@src/modules/loading";
|
|
8
|
+
} from "@/modules/loading";
|
|
9
|
+
import { LoadingKeysEnum, LoadingStoreType } from "@/modules/loading/types";
|
|
10
10
|
|
|
11
11
|
const dummyLoadingState: LoadingStoreType = initialState;
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
modalReducer,
|
|
5
|
-
modalOpenCreator,
|
|
6
|
-
modalCloseCreator,
|
|
7
4
|
initialState as modalInitialState,
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
modalCloseCreator,
|
|
6
|
+
modalOpenCreator,
|
|
7
|
+
modalReducer,
|
|
8
|
+
} from "@/modules/modal";
|
|
9
|
+
import { ModalKeysEnum, ModalStoreType } from "@/modules/modal/types";
|
|
10
10
|
|
|
11
11
|
describe("[Modal module]", () => {
|
|
12
12
|
describe("[Reducer]", () => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from "vitest";
|
|
4
|
-
|
|
5
|
-
import {
|
|
4
|
+
|
|
5
|
+
import { slicesReducer } from "@/modules/slices";
|
|
6
|
+
import { SlicesStoreType } from "@/modules/slices/types";
|
|
6
7
|
|
|
7
8
|
const dummySlicesState: SlicesStoreType = {
|
|
8
9
|
libraries: [],
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
userContextReducer,
|
|
5
4
|
sendAReviewCreator,
|
|
6
5
|
skipReviewCreator,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
userContextReducer,
|
|
7
|
+
} from "@/modules/userContext";
|
|
8
|
+
import { UserContextStoreType } from "@/modules/userContext/types";
|
|
9
9
|
|
|
10
10
|
describe("[UserContext module]", () => {
|
|
11
11
|
describe("[Reducer]", () => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { CustomTypeSM } from "@slicemachine/core/build/models/CustomType";
|
|
1
|
+
import { CustomTypeSM } from "@/legacy/lib/models/common/CustomType";
|
|
3
2
|
import {
|
|
4
3
|
normalizeFrontendCustomType,
|
|
5
4
|
normalizeFrontendCustomTypes,
|
|
6
|
-
} from "
|
|
5
|
+
} from "@/legacy/lib/models/common/normalizers/customType";
|
|
7
6
|
|
|
8
7
|
describe("Normalizer - CustomType", () => {
|
|
9
8
|
describe("normalizeFrontendCustomTypes", () => {
|
|
@@ -14,6 +13,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
14
13
|
label: "lama",
|
|
15
14
|
repeatable: false,
|
|
16
15
|
status: true,
|
|
16
|
+
format: "custom",
|
|
17
17
|
tabs: [
|
|
18
18
|
{
|
|
19
19
|
key: "Main",
|
|
@@ -26,6 +26,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
26
26
|
label: "lama",
|
|
27
27
|
repeatable: false,
|
|
28
28
|
status: true,
|
|
29
|
+
format: "custom",
|
|
29
30
|
tabs: [
|
|
30
31
|
{
|
|
31
32
|
key: "Main",
|
|
@@ -40,6 +41,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
40
41
|
label: "lama",
|
|
41
42
|
repeatable: false,
|
|
42
43
|
status: true,
|
|
44
|
+
format: "custom",
|
|
43
45
|
tabs: [
|
|
44
46
|
{
|
|
45
47
|
key: "Main",
|
|
@@ -52,6 +54,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
52
54
|
label: "lama",
|
|
53
55
|
repeatable: false,
|
|
54
56
|
status: true,
|
|
57
|
+
format: "custom",
|
|
55
58
|
tabs: [
|
|
56
59
|
{
|
|
57
60
|
key: "Main",
|
|
@@ -70,6 +73,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
70
73
|
label: "lama",
|
|
71
74
|
repeatable: false,
|
|
72
75
|
status: true,
|
|
76
|
+
format: "custom",
|
|
73
77
|
tabs: [
|
|
74
78
|
{
|
|
75
79
|
key: "Main",
|
|
@@ -82,6 +86,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
82
86
|
label: "lama",
|
|
83
87
|
repeatable: false,
|
|
84
88
|
status: true,
|
|
89
|
+
format: "custom",
|
|
85
90
|
tabs: [
|
|
86
91
|
{
|
|
87
92
|
key: "Main",
|
|
@@ -96,6 +101,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
96
101
|
label: "lama",
|
|
97
102
|
repeatable: false,
|
|
98
103
|
status: true,
|
|
104
|
+
format: "custom",
|
|
99
105
|
tabs: [
|
|
100
106
|
{
|
|
101
107
|
key: "Main",
|
|
@@ -108,6 +114,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
108
114
|
label: "lama",
|
|
109
115
|
repeatable: false,
|
|
110
116
|
status: true,
|
|
117
|
+
format: "custom",
|
|
111
118
|
tabs: [
|
|
112
119
|
{
|
|
113
120
|
key: "Main",
|
|
@@ -126,6 +133,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
126
133
|
label: "lama",
|
|
127
134
|
repeatable: false,
|
|
128
135
|
status: true,
|
|
136
|
+
format: "custom",
|
|
129
137
|
tabs: [
|
|
130
138
|
{
|
|
131
139
|
key: "Main",
|
|
@@ -154,6 +162,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
154
162
|
label: "lama",
|
|
155
163
|
repeatable: false,
|
|
156
164
|
status: true,
|
|
165
|
+
format: "custom",
|
|
157
166
|
tabs: [
|
|
158
167
|
{
|
|
159
168
|
key: "Main",
|
|
@@ -167,6 +176,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
167
176
|
label: "lama",
|
|
168
177
|
repeatable: false,
|
|
169
178
|
status: true,
|
|
179
|
+
format: "custom",
|
|
170
180
|
tabs: [
|
|
171
181
|
{
|
|
172
182
|
key: "Main",
|
|
@@ -184,6 +194,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
184
194
|
label: "lama",
|
|
185
195
|
repeatable: false,
|
|
186
196
|
status: true,
|
|
197
|
+
format: "custom",
|
|
187
198
|
tabs: [
|
|
188
199
|
{
|
|
189
200
|
key: "Main",
|
|
@@ -196,6 +207,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
196
207
|
label: "lama",
|
|
197
208
|
repeatable: false,
|
|
198
209
|
status: true,
|
|
210
|
+
format: "custom",
|
|
199
211
|
tabs: [
|
|
200
212
|
{
|
|
201
213
|
key: "Main",
|
|
@@ -213,6 +225,7 @@ describe("Normalizer - CustomType", () => {
|
|
|
213
225
|
label: "lama",
|
|
214
226
|
repeatable: false,
|
|
215
227
|
status: true,
|
|
228
|
+
format: "custom",
|
|
216
229
|
tabs: [
|
|
217
230
|
{
|
|
218
231
|
key: "Main",
|
package/tsconfig.json
CHANGED
|
@@ -24,12 +24,7 @@
|
|
|
24
24
|
"jsx": "preserve",
|
|
25
25
|
"outDir": "./build",
|
|
26
26
|
"paths": {
|
|
27
|
-
"
|
|
28
|
-
"@components/*": ["components/*"],
|
|
29
|
-
"@lib/*": ["lib/*"],
|
|
30
|
-
"@models/*": ["lib/models/*"],
|
|
31
|
-
"@src/*": ["src/*"],
|
|
32
|
-
"@utils/*": ["lib/utils/*"]
|
|
27
|
+
"@/*": ["./src/*"]
|
|
33
28
|
},
|
|
34
29
|
"incremental": true
|
|
35
30
|
},
|
package/vite.config.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import * as url from "node:url";
|
|
3
|
+
|
|
1
4
|
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
|
-
import { defineConfig } from "vitest/config";
|
|
3
5
|
import react from "@vitejs/plugin-react";
|
|
4
|
-
import
|
|
5
|
-
import * as path from "node:path";
|
|
6
|
+
import { defineConfig } from "vitest/config";
|
|
6
7
|
|
|
7
8
|
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
8
9
|
|
|
@@ -10,13 +11,7 @@ export default defineConfig({
|
|
|
10
11
|
plugins: [react(), vanillaExtractPlugin()],
|
|
11
12
|
resolve: {
|
|
12
13
|
alias: {
|
|
13
|
-
"@
|
|
14
|
-
"@components": path.resolve(__dirname, "./components"),
|
|
15
|
-
"@lib": path.resolve(__dirname, "./lib"),
|
|
16
|
-
"@models": path.resolve(__dirname, "./lib/models"),
|
|
17
|
-
"@src": path.resolve(__dirname, "./src"),
|
|
18
|
-
"@utils": path.resolve(__dirname, "./lib/utils"),
|
|
19
|
-
test: path.resolve(__dirname, "./test"),
|
|
14
|
+
"@": path.resolve(__dirname, "./src"),
|
|
20
15
|
},
|
|
21
16
|
},
|
|
22
17
|
test: {
|