slice-machine-ui 1.18.1-dev-next-release.3 → 1.18.1-dev-next-release.5
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/components/Button/index.tsx +2 -2
- package/components/Changelog/index.tsx +1 -1
- package/components/Changelog/versionDetails/UpdateCommandBox.tsx +1 -1
- package/components/ChangesItems/ChangesItems.tsx +2 -2
- package/components/CustomTypeTable/changesPage.tsx +1 -1
- package/components/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +3 -3
- package/components/DeleteDocumentsDrawer/ReferencesErrorDrawer.tsx +3 -3
- package/components/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +3 -3
- package/components/DeleteSliceModal/index.tsx +1 -1
- package/components/FormFields/CheckboxControl.jsx +1 -1
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +5 -5
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +1 -1
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +1 -1
- package/components/Forms/formsValidator.ts +2 -2
- package/components/Grid/index.tsx +1 -1
- package/components/Li/index.tsx +2 -2
- package/components/ListItem/index.tsx +2 -2
- package/components/ListItem/utils.js +1 -1
- package/components/LoginModal/index.tsx +2 -2
- package/components/ModalFormCard/index.tsx +2 -2
- package/components/Navigation/VideoItem.tsx +2 -2
- package/components/Navigation/index.test.tsx +8 -8
- package/components/Navigation/index.tsx +2 -2
- package/components/ReviewModal/ReviewForm.tsx +1 -1
- package/components/ReviewModal/ReviewModal.tsx +4 -4
- package/components/ScreenshotChangesModal/VariationDropZone.tsx +6 -6
- package/components/ScreenshotChangesModal/index.tsx +3 -3
- package/components/ScreenshotPreviewModal/index.tsx +2 -2
- package/components/Simulator/components/Header/index.tsx +1 -1
- package/components/Simulator/components/IframeRenderer/index.tsx +2 -2
- package/components/Simulator/components/SetupModal/index.tsx +1 -1
- package/components/Simulator/components/Toolbar/index.tsx +2 -2
- package/components/Simulator/index.tsx +5 -5
- package/components/Tooltip/TextWithTooltip.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +2 -2
- package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +4 -4
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +12 -12
- package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/index.tsx +1 -1
- package/lib/builders/SliceBuilder/FieldZones/index.tsx +4 -4
- package/lib/builders/SliceBuilder/Header/SimulatorButton/index.tsx +1 -1
- package/lib/builders/SliceBuilder/Header/VariationsPopover/index.tsx +1 -1
- package/lib/builders/SliceBuilder/Header/index.tsx +2 -2
- package/lib/builders/SliceBuilder/index.tsx +2 -2
- package/lib/builders/common/EditModal/Form.jsx +1 -1
- package/lib/builders/common/EditModal/index.jsx +3 -3
- package/lib/builders/common/Zone/Card/components/NewField.tsx +7 -7
- package/lib/builders/common/Zone/index.jsx +2 -2
- package/lib/builders/utils/index.ts +1 -1
- package/lib/forms/defaults.ts +3 -3
- package/lib/forms/fields.ts +3 -3
- package/lib/forms/index.ts +3 -3
- package/lib/models/common/ComponentUI.ts +3 -3
- package/lib/models/common/CustomType/group.ts +2 -2
- package/lib/models/common/CustomType/index.ts +4 -4
- package/lib/models/common/CustomType/tab.ts +7 -7
- package/lib/models/common/ErrorWithStatus.ts +4 -1
- package/lib/models/common/Fields.ts +1 -1
- package/lib/models/common/Group.ts +5 -5
- package/lib/models/common/Library.ts +1 -1
- package/lib/models/common/Manifest.ts +4 -4
- package/lib/models/common/ModelData.ts +6 -6
- package/lib/models/common/ModelStatus/compareCustomTypeModels.ts +1 -1
- package/lib/models/common/ModelStatus/compareSliceModels.ts +4 -4
- package/lib/models/common/ModelStatus/index.ts +5 -5
- package/lib/models/common/Screenshots.ts +1 -1
- package/lib/models/common/Slice.ts +7 -7
- package/lib/models/common/Slices.ts +5 -5
- package/lib/models/common/UserProfile.ts +1 -1
- package/lib/models/common/Variation.ts +6 -6
- package/lib/models/common/normalizers/customType.ts +3 -3
- package/lib/models/common/normalizers/slices.ts +2 -2
- package/lib/models/common/widgets/Boolean/index.ts +2 -2
- package/lib/models/common/widgets/ContentRelationship/Form.tsx +2 -2
- package/lib/models/common/widgets/ContentRelationship/index.ts +2 -2
- package/lib/models/common/widgets/Group/ListItem/index.jsx +3 -3
- package/lib/models/common/widgets/Image/Form.tsx +3 -3
- package/lib/models/common/widgets/StructuredText/Form.tsx +2 -2
- package/lib/models/common/widgets/StructuredText/index.ts +2 -2
- package/lib/utils/index.ts +1 -1
- package/lib/utils/poll.ts +3 -3
- package/lib/utils/shared/customTypes.ts +1 -1
- package/next.config.mjs +3 -3
- package/out/404.html +1 -1
- package/out/_next/static/chunks/125-e3857af2068bbedf.js +11 -0
- package/out/_next/static/chunks/pages/{_app-24537d01d860293a.js → _app-b04ec71c46729221.js} +12 -12
- package/out/_next/static/{cjz0yUXdEAw1xeqGTjS8s → j0GKKng3reAX2Jcp0Dw_g}/_buildManifest.js +1 -1
- 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/slices/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +5 -5
- package/pages/_app.tsx +1 -1
- package/pages/api/embed.js +1 -1
- package/pages/slices.tsx +4 -4
- package/src/apiClient.ts +11 -11
- package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
- package/src/components/HoverCard/HoverCard.tsx +1 -1
- package/src/components/SideNav/SideNav.tsx +2 -2
- package/src/components/Table/Table.test.tsx +1 -1
- package/src/components/TextLink/TextLink.tsx +1 -1
- package/src/domain/__tests__/CustomTypeModel.test.ts +19 -19
- package/src/domain/customType.ts +10 -10
- package/src/domain/slice.ts +5 -5
- package/src/features/changes/StatusBadge.tsx +1 -1
- package/src/features/customTypes/EditDropdown.tsx +1 -1
- package/src/features/customTypes/PageTypeOnboarding.tsx +2 -2
- package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +7 -7
- package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +24 -22
- package/src/features/customTypes/actions/convertCustomToPageType.ts +3 -3
- package/src/features/customTypes/actions/deleteCustomType.ts +1 -1
- package/src/features/customTypes/actions/renameCustomType.ts +1 -1
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +3 -3
- package/src/features/customTypes/customTypesConfig.ts +3 -3
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +2 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +3 -3
- package/src/features/customTypes/customTypesTable/createCustomType.ts +2 -2
- package/src/features/customTypes/customTypesTable/useCustomTypes.ts +7 -7
- package/src/features/labs/labsList/LabsList.tsx +3 -3
- package/src/features/labs/labsList/useLab.tsx +1 -1
- package/src/features/slices/actions/addSlicesToSliceZone.ts +1 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +2 -2
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +5 -5
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +11 -11
- package/src/features/slicesTemplates/useSlicesTemplates.ts +1 -1
- package/src/hooks/useCurrentSlice.tsx +2 -2
- package/src/hooks/useElementSize.ts +1 -1
- package/src/hooks/useModelStatus.ts +13 -10
- package/src/hooks/useRouteChange.tsx +1 -1
- package/src/hooks/useSMTracker.ts +2 -2
- package/src/hooks/useSliceMachineConfig.ts +1 -1
- package/src/hooks/useThrottle.ts +10 -7
- package/src/hooks/useUnSyncChanges.ts +5 -5
- package/src/hooks/useWindowDimensions.ts +1 -1
- package/src/modules/availableCustomTypes/index.ts +19 -19
- package/src/modules/environment/index.ts +6 -6
- package/src/modules/loading/index.ts +3 -3
- package/src/modules/modal/index.ts +2 -2
- package/src/modules/pushChangesSaga/index.ts +7 -7
- package/src/modules/pushChangesSaga/trackPushChangesSuccess.ts +3 -3
- package/src/modules/screenshots/actions.ts +2 -2
- package/src/modules/screenshots/sagas.ts +9 -9
- package/src/modules/selectedCustomType/actions.ts +10 -10
- package/src/modules/selectedCustomType/reducer.ts +26 -26
- package/src/modules/selectedCustomType/sagas.ts +5 -5
- package/src/modules/selectedCustomType/selectors.ts +4 -4
- package/src/modules/selectedCustomType/stateHelpers.ts +1 -1
- package/src/modules/selectedSlice/actions.ts +4 -4
- package/src/modules/selectedSlice/reducer.ts +7 -7
- package/src/modules/selectedSlice/sagas.ts +4 -4
- package/src/modules/selectedSlice/selectors.ts +5 -5
- package/src/modules/simulator/index.ts +20 -17
- package/src/modules/slices/index.ts +18 -18
- package/src/modules/toaster/index.tsx +3 -3
- package/src/modules/toaster/utils.tsx +1 -1
- package/src/modules/useSliceMachineActions.ts +43 -41
- package/src/modules/userContext/index.ts +9 -9
- package/src/redux/store.ts +2 -2
- package/src/theme.ts +1 -1
- package/src/utils/editor.ts +1 -1
- package/src/utils/fieldNameCreator.ts +2 -2
- package/test/__setup__.ts +18 -7
- package/test/__testutils__/createPrismicAuthLoginResponse.ts +1 -1
- package/test/__testutils__/createTestPlugin.ts +1 -1
- package/test/__testutils__/createTestProject.ts +3 -3
- package/test/__testutils__/index.tsx +1 -1
- package/test/__testutils__/mockAWSACLAPI.ts +9 -9
- package/test/__testutils__/mockCustomTypesAPI.ts +16 -16
- package/test/__testutils__/mockPrismicAuthAPI.ts +3 -3
- package/test/__testutils__/mockPrismicUserAPI.ts +4 -4
- package/test/__testutils__/readMSWFormData.ts +3 -3
- package/test/components/CreateCustomTypeModal.test.tsx +1 -1
- package/test/components/LoginModal.test.tsx +2 -2
- package/test/lib/builders/EditModal.test.tsx +5 -5
- package/test/lib/builders/buildersUtils.test.ts +13 -13
- package/test/lib/models/common/CustomType/sliceZone.test.ts +2 -2
- package/test/lib/models/common/ModelStatus.test.ts +1 -1
- package/test/lib/models/common/widgets/index.test.ts +6 -6
- package/test/lib/utils/shared/customTypes.test.ts +1 -1
- package/test/pages/custom-types.test.tsx +7 -7
- package/test/pages/simulator.test.tsx +5 -5
- package/test/pages/slices.test.tsx +4 -4
- package/test/src/hooks/useModelStatus.test.ts +2 -3
- package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +2 -2
- package/test/src/modules/availableCustomTypes/index.test.ts +20 -18
- package/test/src/modules/environment.test.ts +2 -2
- package/test/src/modules/loading.test.ts +1 -1
- package/test/src/modules/modal.test.ts +1 -1
- package/test/src/modules/pushChangesSaga.test.ts +10 -10
- package/test/src/modules/screenshots/sagas.test.ts +5 -5
- package/test/src/modules/selectedCustomType/reducer.test.ts +25 -25
- package/test/src/modules/selectedCustomType/sagas.test.ts +3 -3
- package/test/src/modules/selectedSlice/__testutils__/getRefreshStateCreatorPayloadData.ts +1 -1
- package/test/src/modules/selectedSlice/reducer.test.ts +12 -12
- package/test/src/modules/selectedSlice/sagas.test.ts +6 -6
- package/test/src/modules/simulator.test.ts +10 -10
- package/test/src/modules/slices.test.ts +5 -5
- package/test/src/modules/toaster/utils.test.ts +3 -3
- package/test/src/normalizers/customType.test.ts +5 -5
- package/test/src/utils/fieldNameCreator.test.ts +1 -1
- package/out/_next/static/chunks/125-84464edfe25651eb.js +0 -19
- /package/out/_next/static/{cjz0yUXdEAw1xeqGTjS8s → j0GKKng3reAX2Jcp0Dw_g}/_ssgManifest.js +0 -0
package/out/slices.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>Slice Machine</title><meta name="next-head-count" content="3"/><link rel="preload" href="/_next/static/css/66b3836ab88b0c5c.css" as="style"/><link rel="stylesheet" href="/_next/static/css/66b3836ab88b0c5c.css" data-n-g=""/><link rel="preload" href="/_next/static/css/22d69420bda374a7.css" as="style"/><link rel="stylesheet" href="/_next/static/css/22d69420bda374a7.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>Slice Machine</title><meta name="next-head-count" content="3"/><link rel="preload" href="/_next/static/css/66b3836ab88b0c5c.css" as="style"/><link rel="stylesheet" href="/_next/static/css/66b3836ab88b0c5c.css" data-n-g=""/><link rel="preload" href="/_next/static/css/22d69420bda374a7.css" as="style"/><link rel="stylesheet" href="/_next/static/css/22d69420bda374a7.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-b04ec71c46729221.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/590-ab38d53732035bf0.js" defer=""></script><script src="/_next/static/chunks/573-8678a91b09707f5d.js" defer=""></script><script src="/_next/static/chunks/pages/slices-b686960d7d228e36.js" defer=""></script><script src="/_next/static/j0GKKng3reAX2Jcp0Dw_g/_buildManifest.js" defer=""></script><script src="/_next/static/j0GKKng3reAX2Jcp0Dw_g/_ssgManifest.js" defer=""></script></head><body><div id="__next"><style data-emotion="css-global 413pep">html{--theme-ui-colors-text:#25252D;--theme-ui-colors-textClear:#6F6E77;--theme-ui-colors-grayLight:#E8E8ED;--theme-ui-colors-hoverBackground:#f2f2f2;--theme-ui-colors-background:#FFF;--theme-ui-colors-backgroundClear:#FFF;--theme-ui-colors-primary:#5D40F7;--theme-ui-colors-purpleLight:#F6F1FC;--theme-ui-colors-purpleLight01:#6548FF1A;--theme-ui-colors-purple12:#F1EEFE;--theme-ui-colors-purpleStrong:#5842C3;--theme-ui-colors-whiteButtonText:#1A1523;--theme-ui-colors-codeBlockBackground:#32275F;--theme-ui-colors-failedConnectText:#86848D;--theme-ui-colors-changesWarning-background:#FFECC7;--theme-ui-colors-changesWarning-color:#5C0C17;--theme-ui-colors-greyIcon:#6F6E77;--theme-ui-colors-greyIconDisabled:#C9D0D8;--theme-ui-colors-missingScreenshotBanner-color:#5C0C17;--theme-ui-colors-missingScreenshotBanner-bg:#FFECC7;--theme-ui-colors-badge-new-bg:#DBEDDB;--theme-ui-colors-badge-new-color:#05644D;--theme-ui-colors-badge-modified-bg:#FFECC7;--theme-ui-colors-badge-modified-color:#5C0C17;--theme-ui-colors-badge-synced-bg:purple12;--theme-ui-colors-badge-synced-color:#5842C3;--theme-ui-colors-badge-deleted-bg:rgba(203, 36, 49, 0.1);--theme-ui-colors-badge-unknown-bg:#F3F5F7;--theme-ui-colors-badge-unknown-color:#9AA4AF;--theme-ui-colors-codeBlockBorder:#545454;--theme-ui-colors-secondary:#F9FAFB;--theme-ui-colors-danger:#CB2431;--theme-ui-colors-highlight:hsl(10, 40%, 90%);--theme-ui-colors-purple:#5B3DF5;--theme-ui-colors-purple08:#5842C3;--theme-ui-colors-muted:#F9F9FB;--theme-ui-colors-icons:#8091A5;--theme-ui-colors-gray:#F8F9FA;--theme-ui-colors-grey01:#F3F5F7;--theme-ui-colors-grey02:#E6E6EA;--theme-ui-colors-grey03:#F4F2F4;--theme-ui-colors-grey04:#9AA4AF;--theme-ui-colors-grey05:#667587;--theme-ui-colors-grey07:#F9F8F9;--theme-ui-colors-grey10:#86848D;--theme-ui-colors-grey12:#1A1523;--theme-ui-colors-greyTransparent:rgba(37, 37, 45, 0.4);--theme-ui-colors-borders:#E4E2E4;--theme-ui-colors-bordersFocused:#6E56CF;--theme-ui-colors-deep:#0E2150;--theme-ui-colors-deep1:#A0ADE7;--theme-ui-colors-lightGreen:#EBF8F1;--theme-ui-colors-lightOrange:#FDF4EC;--theme-ui-colors-darkOrange:#C17C10;--theme-ui-colors-error:#E55737;--theme-ui-colors-success:#3AB97A;--theme-ui-colors-headSection:#fff;--theme-ui-colors-warning:#E67E22;--theme-ui-colors-warning02:#ED811C;--theme-ui-colors-sidebar:#F1F1F4;--theme-ui-colors-link:#6E56CF;--theme-ui-colors-choggleBox:#5163BA;--theme-ui-colors-darkBorder:#DCDBDD;--theme-ui-colors-code-border:#DFE1E5;--theme-ui-colors-code-blue:#3B41BD;--theme-ui-colors-code-gray:#667587;--theme-ui-colors-code-orange:#EA6D46;--theme-ui-colors-code-green:#3AB97A;color:var(--theme-ui-colors-text);background-color:var(--theme-ui-colors-background);}html.theme-ui-light,.theme-ui-light html{--theme-ui-colors-text:#25252D;--theme-ui-colors-textClear:#6F6E77;--theme-ui-colors-grayLight:#E8E8ED;--theme-ui-colors-hoverBackground:#f2f2f2;--theme-ui-colors-background:#FFF;--theme-ui-colors-backgroundClear:#FFF;--theme-ui-colors-primary:#5D40F7;--theme-ui-colors-purpleLight:#F6F1FC;--theme-ui-colors-purpleLight01:#6548FF1A;--theme-ui-colors-purple12:#F1EEFE;--theme-ui-colors-purpleStrong:#5842C3;--theme-ui-colors-whiteButtonText:#1A1523;--theme-ui-colors-codeBlockBackground:#32275F;--theme-ui-colors-failedConnectText:#86848D;--theme-ui-colors-changesWarning-background:#FFECC7;--theme-ui-colors-changesWarning-color:#5C0C17;--theme-ui-colors-greyIcon:#6F6E77;--theme-ui-colors-greyIconDisabled:#C9D0D8;--theme-ui-colors-missingScreenshotBanner-color:#5C0C17;--theme-ui-colors-missingScreenshotBanner-bg:#FFECC7;--theme-ui-colors-badge-new-bg:#DBEDDB;--theme-ui-colors-badge-new-color:#05644D;--theme-ui-colors-badge-modified-bg:#FFECC7;--theme-ui-colors-badge-modified-color:#5C0C17;--theme-ui-colors-badge-synced-bg:purple12;--theme-ui-colors-badge-synced-color:#5842C3;--theme-ui-colors-badge-deleted-bg:rgba(203, 36, 49, 0.1);--theme-ui-colors-badge-unknown-bg:#F3F5F7;--theme-ui-colors-badge-unknown-color:#9AA4AF;--theme-ui-colors-codeBlockBorder:#545454;--theme-ui-colors-secondary:#F9FAFB;--theme-ui-colors-danger:#CB2431;--theme-ui-colors-highlight:hsl(10, 40%, 90%);--theme-ui-colors-purple:#5B3DF5;--theme-ui-colors-purple08:#5842C3;--theme-ui-colors-muted:#F9F9FB;--theme-ui-colors-icons:#8091A5;--theme-ui-colors-gray:#F8F9FA;--theme-ui-colors-grey01:#F3F5F7;--theme-ui-colors-grey02:#E6E6EA;--theme-ui-colors-grey03:#F4F2F4;--theme-ui-colors-grey04:#9AA4AF;--theme-ui-colors-grey05:#667587;--theme-ui-colors-grey07:#F9F8F9;--theme-ui-colors-grey10:#86848D;--theme-ui-colors-grey12:#1A1523;--theme-ui-colors-greyTransparent:rgba(37, 37, 45, 0.4);--theme-ui-colors-borders:#E4E2E4;--theme-ui-colors-bordersFocused:#6E56CF;--theme-ui-colors-deep:#0E2150;--theme-ui-colors-deep1:#A0ADE7;--theme-ui-colors-lightGreen:#EBF8F1;--theme-ui-colors-lightOrange:#FDF4EC;--theme-ui-colors-darkOrange:#C17C10;--theme-ui-colors-error:#E55737;--theme-ui-colors-success:#3AB97A;--theme-ui-colors-headSection:#fff;--theme-ui-colors-warning:#E67E22;--theme-ui-colors-warning02:#ED811C;--theme-ui-colors-sidebar:#F1F1F4;--theme-ui-colors-link:#6E56CF;--theme-ui-colors-choggleBox:#5163BA;--theme-ui-colors-darkBorder:#DCDBDD;--theme-ui-colors-code-border:#DFE1E5;--theme-ui-colors-code-blue:#3B41BD;--theme-ui-colors-code-gray:#667587;--theme-ui-colors-code-orange:#EA6D46;--theme-ui-colors-code-green:#3AB97A;}html.theme-ui-dark,.theme-ui-dark html{--theme-ui-colors-text:#fff;--theme-ui-colors-textClear:#6E707B;--theme-ui-colors-hoverBackground:#202020;--theme-ui-colors-grey02:#E6E6EA;--theme-ui-colors-background:#202022;--theme-ui-colors-backgroundClear:#28282C;--theme-ui-colors-primary:#4E54D7;--theme-ui-colors-secondary:#28282C;--theme-ui-colors-icons:#5D5D71;--theme-ui-colors-gray:#1D1D1F;--theme-ui-colors-borders:#3A3A46;--theme-ui-colors-deep:#28282C;--theme-ui-colors-headSection:#28282C;--theme-ui-colors-warning:#E67E22;--theme-ui-colors-sidebar:#28282C;--theme-ui-colors-code-border:#5D5D6F;--theme-ui-colors-code-blue:#3B41BD;--theme-ui-colors-code-gray:#667587;--theme-ui-colors-code-orange:#EA6D46;--theme-ui-colors-code-green:#3AB97A;--theme-ui-colors-link:#A9A9C6;--theme-ui-colors-choggleBox:#fff;}</style><style data-emotion="css-global h19pgh">*{box-sizing:border-box;}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;line-height:1.5;font-weight:400;}body{margin:0;}</style><style data-emotion="css yvak7d">.css-yvak7d{box-sizing:border-box;margin:0;min-width:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:calc(100vh - 57px);width:100vw;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}</style><div class="css-yvak7d"><style data-emotion="css uqm8ih">.css-uqm8ih{box-sizing:border-box;margin:0;min-width:0;color:var(--theme-ui-colors-primary);overflow:visible;}</style><svg stroke-width="4" viewBox="0 0 32 32" width="48" height="48" fill="none" stroke="currentColor" role="img" id="spinner" class="css-uqm8ih"><title>Loading</title><circle stroke-width="4" r="12" cx="16" cy="16" fill="none" opacity="0.125"></circle><circle stroke-width="4" r="12" cx="16" cy="16" fill="none" stroke-dasharray="20 110"><animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 16 16" to="360 16 16" dur="750ms" repeatCount="indefinite"></animateTransform></circle></svg></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices","query":{},"buildId":"j0GKKng3reAX2Jcp0Dw_g","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"isFallback":false,"appGip":true,"scriptLoader":[]}</script></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slice-machine-ui",
|
|
3
|
-
"version": "1.18.1-dev-next-release.
|
|
3
|
+
"version": "1.18.1-dev-next-release.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A visual builder for your Slice Models with all the tools you need to generate data models and mock CMS content locally.",
|
|
6
6
|
"repository": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"start-slicemachine": "./bin/start-slicemachine.cjs"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@slicemachine/manager": "^0.15.1-dev-next-release.
|
|
35
|
-
"start-slicemachine": "^0.12.2-dev-next-release.
|
|
34
|
+
"@slicemachine/manager": "^0.15.1-dev-next-release.5",
|
|
35
|
+
"start-slicemachine": "^0.12.2-dev-next-release.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@emotion/react": "11.11.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"cross-env": "7.0.3",
|
|
77
77
|
"depcheck": "1.4.3",
|
|
78
78
|
"eslint": "8.37.0",
|
|
79
|
-
"eslint-config-prettier": "
|
|
79
|
+
"eslint-config-prettier": "9.0.0",
|
|
80
80
|
"eslint-import-resolver-typescript": "3.5.3",
|
|
81
81
|
"eslint-plugin-import": "2.27.5",
|
|
82
82
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"vitest": "0.32.0",
|
|
131
131
|
"yup": "0.32.11"
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "94bdad34ffb639b584d6032a493c77a707649d2c"
|
|
134
134
|
}
|
package/pages/_app.tsx
CHANGED
package/pages/api/embed.js
CHANGED
|
@@ -2,7 +2,7 @@ import { extract } from "@extractus/oembed-extractor";
|
|
|
2
2
|
|
|
3
3
|
export default async function handler(req, res) {
|
|
4
4
|
const oembed = await extract(
|
|
5
|
-
"https://twitter.com/rachelnabors/status/1354790533646979073?s=20"
|
|
5
|
+
"https://twitter.com/rachelnabors/status/1354790533646979073?s=20",
|
|
6
6
|
);
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
8
8
|
res.status(200).json(oembed);
|
package/pages/slices.tsx
CHANGED
|
@@ -44,12 +44,12 @@ const SlicesIndex: React.FunctionComponent = () => {
|
|
|
44
44
|
(store: SliceMachineStoreType) => ({
|
|
45
45
|
remoteSlices: getRemoteSlices(store),
|
|
46
46
|
libraries: getLibraries(store),
|
|
47
|
-
})
|
|
47
|
+
}),
|
|
48
48
|
);
|
|
49
49
|
const [isCreateSliceModalOpen, setIsCreateSliceModalOpen] = useState(false);
|
|
50
50
|
|
|
51
51
|
const localLibraries: LibraryUI[] = libraries.filter(
|
|
52
|
-
(library) => library.isLocal
|
|
52
|
+
(library) => library.isLocal,
|
|
53
53
|
);
|
|
54
54
|
const sortedLibraries: LibraryUI[] = libraries.map((library) => {
|
|
55
55
|
// Sort slices
|
|
@@ -188,7 +188,7 @@ const SlicesIndex: React.FunctionComponent = () => {
|
|
|
188
188
|
onOpenModal({
|
|
189
189
|
sliceFilterFn: (s) =>
|
|
190
190
|
s.filter(
|
|
191
|
-
(e) => e.model.id === slice.model.id
|
|
191
|
+
(e) => e.model.id === slice.model.id,
|
|
192
192
|
),
|
|
193
193
|
});
|
|
194
194
|
}}
|
|
@@ -226,7 +226,7 @@ const SlicesIndex: React.FunctionComponent = () => {
|
|
|
226
226
|
toast.success(
|
|
227
227
|
SliceToastMessage({
|
|
228
228
|
path: `${libraryName}/${newSlice.name}/model.json`,
|
|
229
|
-
})
|
|
229
|
+
}),
|
|
230
230
|
);
|
|
231
231
|
}}
|
|
232
232
|
onClose={() => {
|
package/src/apiClient.ts
CHANGED
|
@@ -43,8 +43,8 @@ export const getState = async (): Promise<ServerState> => {
|
|
|
43
43
|
url: URL.createObjectURL(screenshot.data),
|
|
44
44
|
},
|
|
45
45
|
];
|
|
46
|
-
}
|
|
47
|
-
)
|
|
46
|
+
},
|
|
47
|
+
),
|
|
48
48
|
),
|
|
49
49
|
};
|
|
50
50
|
}),
|
|
@@ -56,7 +56,7 @@ export const getState = async (): Promise<ServerState> => {
|
|
|
56
56
|
remoteCustomTypes: rawState.remoteCustomTypes.map(
|
|
57
57
|
(remoteCustomTypeModel) => {
|
|
58
58
|
return CustomTypes.toSM(remoteCustomTypeModel);
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
60
|
),
|
|
61
61
|
remoteSlices: rawState.remoteSlices.map((remoteSliceModel) => {
|
|
62
62
|
return Slices.toSM(remoteSliceModel);
|
|
@@ -69,7 +69,7 @@ export const getState = async (): Promise<ServerState> => {
|
|
|
69
69
|
/** Custom Type Routes * */
|
|
70
70
|
|
|
71
71
|
export const saveCustomType = async (
|
|
72
|
-
customType: CustomTypeSM
|
|
72
|
+
customType: CustomTypeSM,
|
|
73
73
|
): ReturnType<SliceMachineManagerClient["customTypes"]["updateCustomType"]> => {
|
|
74
74
|
return await managerClient.customTypes.updateCustomType({
|
|
75
75
|
model: CustomTypes.fromSM(customType),
|
|
@@ -79,7 +79,7 @@ export const saveCustomType = async (
|
|
|
79
79
|
/** Slice Routes * */
|
|
80
80
|
export const renameSlice = async (
|
|
81
81
|
slice: SliceSM,
|
|
82
|
-
libName: string
|
|
82
|
+
libName: string,
|
|
83
83
|
): ReturnType<SliceMachineManagerClient["slices"]["renameSlice"]> => {
|
|
84
84
|
return await managerClient.slices.renameSlice({
|
|
85
85
|
libraryID: libName,
|
|
@@ -94,7 +94,7 @@ export const deleteSlice = async (sliceId: string, libName: string) =>
|
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
export const generateSliceScreenshotApiClient = async (
|
|
97
|
-
params: ScreenshotRequest
|
|
97
|
+
params: ScreenshotRequest,
|
|
98
98
|
): Promise<
|
|
99
99
|
| {
|
|
100
100
|
url: string;
|
|
@@ -130,7 +130,7 @@ export const generateSliceScreenshotApiClient = async (
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
export const generateSliceCustomScreenshotApiClient = async (
|
|
133
|
-
params: CustomScreenshotRequest
|
|
133
|
+
params: CustomScreenshotRequest,
|
|
134
134
|
): Promise<{
|
|
135
135
|
url: string;
|
|
136
136
|
errors: Awaited<
|
|
@@ -151,7 +151,7 @@ export const generateSliceCustomScreenshotApiClient = async (
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
export const updateSliceApiClient = async (
|
|
154
|
-
component: ComponentUI
|
|
154
|
+
component: ComponentUI,
|
|
155
155
|
): Promise<
|
|
156
156
|
Awaited<ReturnType<(typeof managerClient)["slices"]["updateSlice"]>>
|
|
157
157
|
> => {
|
|
@@ -222,7 +222,7 @@ export type ReadSliceMockRequest = {
|
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
export const readSliceMocks = async (
|
|
225
|
-
payload: ReadSliceMockRequest
|
|
225
|
+
payload: ReadSliceMockRequest,
|
|
226
226
|
): ReturnType<SliceMachineManagerClient["slices"]["readSliceMocks"]> => {
|
|
227
227
|
return await managerClient.slices.readSliceMocks({
|
|
228
228
|
libraryID: payload.libraryID,
|
|
@@ -231,7 +231,7 @@ export const readSliceMocks = async (
|
|
|
231
231
|
};
|
|
232
232
|
|
|
233
233
|
export const saveSliceMock = async (
|
|
234
|
-
payload: SaveSliceMockRequest
|
|
234
|
+
payload: SaveSliceMockRequest,
|
|
235
235
|
): ReturnType<SliceMachineManagerClient["slices"]["updateSliceMocks"]> => {
|
|
236
236
|
return await managerClient.slices.updateSliceMocks({
|
|
237
237
|
libraryID: payload.libraryID,
|
|
@@ -271,7 +271,7 @@ export const getChangelogApiClient = async (): Promise<PackageChangelog> => {
|
|
|
271
271
|
releaseNote: releaseNotes ?? null,
|
|
272
272
|
kind: versionWithKind.kind,
|
|
273
273
|
};
|
|
274
|
-
})
|
|
274
|
+
}),
|
|
275
275
|
);
|
|
276
276
|
|
|
277
277
|
return {
|
|
@@ -11,7 +11,7 @@ describe("BaseHoverCard", () => {
|
|
|
11
11
|
const { user } = render(
|
|
12
12
|
<BaseHoverCard trigger={<button>Hello</button>}>
|
|
13
13
|
<div>hover content</div>
|
|
14
|
-
</BaseHoverCard
|
|
14
|
+
</BaseHoverCard>,
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
expect(screen.queryByText("hover content")).not.toBeInTheDocument();
|
|
@@ -124,7 +124,7 @@ export const SideNavLink: FC<SideNavLinkProps> = ({
|
|
|
124
124
|
<span className={styles.linkText}>{title}</span>
|
|
125
125
|
{RightElement}
|
|
126
126
|
</div>
|
|
127
|
-
|
|
127
|
+
</>,
|
|
128
128
|
);
|
|
129
129
|
|
|
130
130
|
type RightElementProps = PropsWithChildren<
|
|
@@ -172,7 +172,7 @@ export const UpdateInfo: FC<UpdateInfoProps> = ({
|
|
|
172
172
|
{createElement(
|
|
173
173
|
component,
|
|
174
174
|
{ ...{ className: styles.updateInfoLink, onClick }, href },
|
|
175
|
-
"Learn more"
|
|
175
|
+
"Learn more",
|
|
176
176
|
)}
|
|
177
177
|
</div>
|
|
178
178
|
);
|
|
@@ -62,7 +62,7 @@ describe("CustomTypeModel test suite", () => {
|
|
|
62
62
|
CustomTypeModel.getSectionEntries({
|
|
63
63
|
...mockCustomType,
|
|
64
64
|
json: {},
|
|
65
|
-
})
|
|
65
|
+
}),
|
|
66
66
|
).toEqual([]);
|
|
67
67
|
});
|
|
68
68
|
|
|
@@ -78,13 +78,13 @@ describe("CustomTypeModel test suite", () => {
|
|
|
78
78
|
CustomTypeModel.getMainSectionEntry({
|
|
79
79
|
...mockCustomType,
|
|
80
80
|
json: {},
|
|
81
|
-
})
|
|
81
|
+
}),
|
|
82
82
|
).toEqual(undefined);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
it("getSection should return the section matching the key", () => {
|
|
86
86
|
expect(
|
|
87
|
-
CustomTypeModel.getSection(mockCustomType, "anotherSection")
|
|
87
|
+
CustomTypeModel.getSection(mockCustomType, "anotherSection"),
|
|
88
88
|
).toEqual(anotherSection);
|
|
89
89
|
});
|
|
90
90
|
|
|
@@ -95,14 +95,14 @@ describe("CustomTypeModel test suite", () => {
|
|
|
95
95
|
...mockCustomType,
|
|
96
96
|
json: {},
|
|
97
97
|
},
|
|
98
|
-
"mainSection"
|
|
99
|
-
)
|
|
98
|
+
"mainSection",
|
|
99
|
+
),
|
|
100
100
|
).toEqual(undefined);
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
it("getSectionSliceZoneConfig should return the config of the given section", () => {
|
|
104
104
|
expect(
|
|
105
|
-
CustomTypeModel.getSectionSliceZoneConfig(mockCustomType, "mainSection")
|
|
105
|
+
CustomTypeModel.getSectionSliceZoneConfig(mockCustomType, "mainSection"),
|
|
106
106
|
).toEqual({
|
|
107
107
|
choices: {
|
|
108
108
|
hero_banner: {
|
|
@@ -122,8 +122,8 @@ describe("CustomTypeModel test suite", () => {
|
|
|
122
122
|
...mockCustomType,
|
|
123
123
|
json: {},
|
|
124
124
|
},
|
|
125
|
-
"mainSection"
|
|
126
|
-
)
|
|
125
|
+
"mainSection",
|
|
126
|
+
),
|
|
127
127
|
).toEqual(undefined);
|
|
128
128
|
});
|
|
129
129
|
|
|
@@ -136,8 +136,8 @@ describe("CustomTypeModel test suite", () => {
|
|
|
136
136
|
anotherSection: {},
|
|
137
137
|
},
|
|
138
138
|
},
|
|
139
|
-
"anotherSection"
|
|
140
|
-
)
|
|
139
|
+
"anotherSection",
|
|
140
|
+
),
|
|
141
141
|
).toEqual("slices");
|
|
142
142
|
});
|
|
143
143
|
|
|
@@ -145,8 +145,8 @@ describe("CustomTypeModel test suite", () => {
|
|
|
145
145
|
expect(
|
|
146
146
|
CustomTypeModel.findNextSectionSliceZoneKey(
|
|
147
147
|
mockCustomType,
|
|
148
|
-
"anotherSection"
|
|
149
|
-
)
|
|
148
|
+
"anotherSection",
|
|
149
|
+
),
|
|
150
150
|
).toEqual("slices1");
|
|
151
151
|
});
|
|
152
152
|
|
|
@@ -165,8 +165,8 @@ describe("CustomTypeModel test suite", () => {
|
|
|
165
165
|
anotherSection,
|
|
166
166
|
},
|
|
167
167
|
},
|
|
168
|
-
"anotherSection"
|
|
169
|
-
)
|
|
168
|
+
"anotherSection",
|
|
169
|
+
),
|
|
170
170
|
).toEqual("slices2");
|
|
171
171
|
});
|
|
172
172
|
|
|
@@ -185,14 +185,14 @@ describe("CustomTypeModel test suite", () => {
|
|
|
185
185
|
anotherSection,
|
|
186
186
|
},
|
|
187
187
|
},
|
|
188
|
-
"anotherSection"
|
|
189
|
-
)
|
|
188
|
+
"anotherSection",
|
|
189
|
+
),
|
|
190
190
|
).toEqual("slices3");
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
it("createSectionSliceZone should return the given custom type with a slice zone for given section", () => {
|
|
194
194
|
expect(
|
|
195
|
-
CustomTypeModel.createSectionSliceZone(mockCustomType, "anotherSection")
|
|
195
|
+
CustomTypeModel.createSectionSliceZone(mockCustomType, "anotherSection"),
|
|
196
196
|
).toEqual({
|
|
197
197
|
...mockCustomType,
|
|
198
198
|
json: {
|
|
@@ -210,7 +210,7 @@ describe("CustomTypeModel test suite", () => {
|
|
|
210
210
|
|
|
211
211
|
it("createSectionSliceZone should return the same custom type if slice zone already exist for given section", () => {
|
|
212
212
|
expect(
|
|
213
|
-
CustomTypeModel.createSectionSliceZone(mockCustomType, "mainSection")
|
|
213
|
+
CustomTypeModel.createSectionSliceZone(mockCustomType, "mainSection"),
|
|
214
214
|
).toEqual(mockCustomType);
|
|
215
215
|
});
|
|
216
216
|
|
|
@@ -229,7 +229,7 @@ describe("CustomTypeModel test suite", () => {
|
|
|
229
229
|
mainSection: {},
|
|
230
230
|
anotherSection,
|
|
231
231
|
},
|
|
232
|
-
})
|
|
232
|
+
}),
|
|
233
233
|
).toEqual({
|
|
234
234
|
...mockCustomType,
|
|
235
235
|
json: {
|
package/src/domain/customType.ts
CHANGED
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "@prismicio/types-internal/lib/customtypes";
|
|
6
6
|
|
|
7
7
|
export function getSectionEntries(
|
|
8
|
-
customType: CustomType
|
|
8
|
+
customType: CustomType,
|
|
9
9
|
): [string, DynamicSection][] {
|
|
10
10
|
return Object.entries(customType.json);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function getMainSectionEntry(
|
|
14
|
-
customType: CustomType
|
|
14
|
+
customType: CustomType,
|
|
15
15
|
): [string, DynamicSection] | undefined {
|
|
16
16
|
// Currently we cannot rely on the name of the main section
|
|
17
17
|
// since it's possible to rename it
|
|
@@ -21,14 +21,14 @@ export function getMainSectionEntry(
|
|
|
21
21
|
|
|
22
22
|
export function getSection(
|
|
23
23
|
customType: CustomType,
|
|
24
|
-
sectionId: string
|
|
24
|
+
sectionId: string,
|
|
25
25
|
): DynamicSection | undefined {
|
|
26
26
|
return customType.json[sectionId];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export function getSectionSliceZoneConfig(
|
|
30
30
|
customType: CustomType,
|
|
31
|
-
sectionId: string
|
|
31
|
+
sectionId: string,
|
|
32
32
|
): DynamicSlicesConfig | undefined {
|
|
33
33
|
const section = getSection(customType, sectionId);
|
|
34
34
|
|
|
@@ -39,7 +39,7 @@ export function getSectionSliceZoneConfig(
|
|
|
39
39
|
// In Slice Machine we currently only support one slice zone per section
|
|
40
40
|
// so we retrieve the first one
|
|
41
41
|
const maybeSliceZone = Object.values(section).find(
|
|
42
|
-
(value) => value.type === "Slices"
|
|
42
|
+
(value) => value.type === "Slices",
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
return maybeSliceZone?.config ?? undefined;
|
|
@@ -51,13 +51,13 @@ export function getSectionSliceZoneConfig(
|
|
|
51
51
|
// it's used as an API id
|
|
52
52
|
export function findNextSectionSliceZoneKey(
|
|
53
53
|
customType: CustomType,
|
|
54
|
-
sectionId: string
|
|
54
|
+
sectionId: string,
|
|
55
55
|
): string {
|
|
56
56
|
const sectionsEntries = getSectionEntries(customType);
|
|
57
57
|
const sectionIndex = sectionsEntries.findIndex(([key]) => key === sectionId);
|
|
58
58
|
|
|
59
59
|
const existingKeys = sectionsEntries.flatMap(([_, section]) =>
|
|
60
|
-
Object.keys(section).filter((key) => section[key].type === "Slices")
|
|
60
|
+
Object.keys(section).filter((key) => section[key].type === "Slices"),
|
|
61
61
|
);
|
|
62
62
|
|
|
63
63
|
let i = sectionIndex;
|
|
@@ -72,11 +72,11 @@ export function findNextSectionSliceZoneKey(
|
|
|
72
72
|
|
|
73
73
|
export function createSectionSliceZone(
|
|
74
74
|
customType: CustomType,
|
|
75
|
-
sectionId: string
|
|
75
|
+
sectionId: string,
|
|
76
76
|
): CustomType {
|
|
77
77
|
const maybeSectionSliceZoneConfig = getSectionSliceZoneConfig(
|
|
78
78
|
customType,
|
|
79
|
-
sectionId
|
|
79
|
+
sectionId,
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
// If the section already has a slice zone, return the custom type as is
|
|
@@ -87,7 +87,7 @@ export function createSectionSliceZone(
|
|
|
87
87
|
// Get the next available section key for the slice zone
|
|
88
88
|
const availableSectionSlicesKey = findNextSectionSliceZoneKey(
|
|
89
89
|
customType,
|
|
90
|
-
sectionId
|
|
90
|
+
sectionId,
|
|
91
91
|
);
|
|
92
92
|
|
|
93
93
|
return {
|
package/src/domain/slice.ts
CHANGED
|
@@ -11,7 +11,7 @@ export function countMissingScreenshots(slice: ComponentUI): number {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function getNonSharedSliceLabel(
|
|
14
|
-
slice: CompositeSlice | LegacySlice
|
|
14
|
+
slice: CompositeSlice | LegacySlice,
|
|
15
15
|
): string {
|
|
16
16
|
return (
|
|
17
17
|
slice.config?.label ??
|
|
@@ -26,14 +26,14 @@ export function getNonSharedSliceLabel(
|
|
|
26
26
|
|
|
27
27
|
export function getScreenshotUrl(
|
|
28
28
|
slice: ComponentUI,
|
|
29
|
-
variation: VariationSM
|
|
29
|
+
variation: VariationSM,
|
|
30
30
|
): string | undefined {
|
|
31
31
|
return slice.screenshots[variation.id]?.url;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export function getFieldMappingFingerprint(
|
|
35
35
|
slice: LegacySlice | CompositeSlice | VariationSM,
|
|
36
|
-
sliceName: string
|
|
36
|
+
sliceName: string,
|
|
37
37
|
): {
|
|
38
38
|
primary: string;
|
|
39
39
|
items: string;
|
|
@@ -69,12 +69,12 @@ export function getFieldMappingFingerprint(
|
|
|
69
69
|
primary: JSON.stringify(
|
|
70
70
|
Object.keys(primary)
|
|
71
71
|
.sort()
|
|
72
|
-
.map((key) => [key, primary[key]])
|
|
72
|
+
.map((key) => [key, primary[key]]),
|
|
73
73
|
),
|
|
74
74
|
items: JSON.stringify(
|
|
75
75
|
Object.keys(items)
|
|
76
76
|
.sort()
|
|
77
|
-
.map((key) => [key, items[key]])
|
|
77
|
+
.map((key) => [key, items[key]]),
|
|
78
78
|
),
|
|
79
79
|
};
|
|
80
80
|
}
|
|
@@ -49,7 +49,7 @@ export const EditDropdown: FC<EditDropdownProps> = ({
|
|
|
49
49
|
CUSTOM_TYPES_CONFIG.custom.getBuilderPagePathname(customType.id);
|
|
50
50
|
if (router.asPath === customPagePathname) {
|
|
51
51
|
const pagePagePathname = CUSTOM_TYPES_CONFIG.page.getBuilderPagePathname(
|
|
52
|
-
customType.id
|
|
52
|
+
customType.id,
|
|
53
53
|
);
|
|
54
54
|
void router.replace(pagePagePathname);
|
|
55
55
|
setCustomTypeBeingConverted(false);
|
|
@@ -17,9 +17,9 @@ export function PageTypeOnboarding() {
|
|
|
17
17
|
(store: SliceMachineStoreType) => ({
|
|
18
18
|
isCreatingCustomType: isLoading(
|
|
19
19
|
store,
|
|
20
|
-
LoadingKeysEnum.CREATE_CUSTOM_TYPE
|
|
20
|
+
LoadingKeysEnum.CREATE_CUSTOM_TYPE,
|
|
21
21
|
),
|
|
22
|
-
})
|
|
22
|
+
}),
|
|
23
23
|
);
|
|
24
24
|
// State to ensure button loader is still visible while redirecting
|
|
25
25
|
const [isButtonLoading, setIsButtonLoading] = useState(false);
|
|
@@ -22,7 +22,7 @@ mockRouter.useParser(
|
|
|
22
22
|
createDynamicRouteParser([
|
|
23
23
|
"/page-types/[pageTypeId]",
|
|
24
24
|
"/custom-types/[customTypeId]",
|
|
25
|
-
])
|
|
25
|
+
]),
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
const formats = [
|
|
@@ -79,7 +79,7 @@ describe.each(formats)(
|
|
|
79
79
|
// Get form input
|
|
80
80
|
const renamedCustomType = `My renamed ${format} type`;
|
|
81
81
|
const nameInput = within(form).getByPlaceholderText(
|
|
82
|
-
`A display name for the ${format} type
|
|
82
|
+
`A display name for the ${format} type`,
|
|
83
83
|
);
|
|
84
84
|
|
|
85
85
|
// Clear the name and type a new one
|
|
@@ -92,10 +92,10 @@ describe.each(formats)(
|
|
|
92
92
|
const folder =
|
|
93
93
|
customType.format === "page" ? "Page types" : "Custom types";
|
|
94
94
|
expect(
|
|
95
|
-
screen.getByTestId(`breadcrumb-${folder}-${renamedCustomType}`)
|
|
95
|
+
screen.getByTestId(`breadcrumb-${folder}-${renamedCustomType}`),
|
|
96
96
|
).toBeVisible();
|
|
97
97
|
});
|
|
98
|
-
}
|
|
98
|
+
},
|
|
99
99
|
);
|
|
100
100
|
|
|
101
101
|
function createCustomTypeMock(format: CustomTypeFormat): CustomType {
|
|
@@ -155,7 +155,7 @@ async function renderCustomTypesBuilderPage({
|
|
|
155
155
|
createSliceMachineManagerMSWHandler({
|
|
156
156
|
url: "http://localhost:3000/_manager",
|
|
157
157
|
sliceMachineManager: manager,
|
|
158
|
-
})
|
|
158
|
+
}),
|
|
159
159
|
);
|
|
160
160
|
|
|
161
161
|
const customTypeMockStore = {
|
|
@@ -165,7 +165,7 @@ async function renderCustomTypesBuilderPage({
|
|
|
165
165
|
...obj,
|
|
166
166
|
[item.id]: { local: CustomTypes.toSM(item) },
|
|
167
167
|
}),
|
|
168
|
-
{}
|
|
168
|
+
{},
|
|
169
169
|
),
|
|
170
170
|
environment: {
|
|
171
171
|
manifest: { apiEndpoint: "https://foo.cdn.prismic.io/api/v2" },
|
|
@@ -179,7 +179,7 @@ async function renderCustomTypesBuilderPage({
|
|
|
179
179
|
|
|
180
180
|
const folder = customType.format === "page" ? "Page types" : "Custom types";
|
|
181
181
|
expect(
|
|
182
|
-
screen.getByTestId(`breadcrumb-${folder}-${customType.label as string}`)
|
|
182
|
+
screen.getByTestId(`breadcrumb-${folder}-${customType.label as string}`),
|
|
183
183
|
).toBeVisible();
|
|
184
184
|
|
|
185
185
|
return renderResults;
|