slice-machine-ui 1.17.1-dev-next-release.1 → 1.18.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/out/404.html +1 -1
- package/out/_next/static/chunks/550-1dafbcec5d50b384.js +1 -0
- package/out/_next/static/chunks/{590-ab38d53732035bf0.js → 590-b89154069f96f832.js} +1 -1
- package/out/_next/static/chunks/{840-d84a2655185995ce.js → 840-39dbcc97d7813e7f.js} +1 -1
- package/out/_next/static/chunks/{933-97c3cebf5fb84a17.js → 933-f0e0417175a08fb8.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-81ecd630066c27f8.js → _app-7273106cbfbb324e.js} +2 -2
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-57edaacb81e17a44.js → [customTypeId]-1b420cadc2703ffc.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-78e57821222c9603.js → custom-types-2f5664d9492b13fb.js} +1 -1
- package/out/_next/static/chunks/pages/{index-9955410413a4598b.js → index-5266b7f0ca55025a.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-c62f5c1608ce3af3.js → [pageTypeId]-926e762906e3ab7a.js} +1 -1
- package/out/_next/static/{MSX-wke8KllW7Qt4pNFB- → qlZhCFx7chEVWL_rXHIqX}/_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 +4 -4
- package/src/domain/__tests__/CustomTypeModel.test.ts +247 -0
- package/src/domain/customType.ts +122 -0
- package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -5
- package/out/_next/static/chunks/799-5c13484e9f945e5d.js +0 -1
- /package/out/_next/static/{MSX-wke8KllW7Qt4pNFB- → qlZhCFx7chEVWL_rXHIqX}/_ssgManifest.js +0 -0
|
@@ -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/d4b59834999106a5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d4b59834999106a5.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/d4b59834999106a5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d4b59834999106a5.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-7273106cbfbb324e.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/909-e4eec905c21ad8ad.js" defer=""></script><script src="/_next/static/chunks/573-8678a91b09707f5d.js" defer=""></script><script src="/_next/static/chunks/377-96290662f5b987a1.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D-5b6c6912b66de61f.js" defer=""></script><script src="/_next/static/qlZhCFx7chEVWL_rXHIqX/_buildManifest.js" defer=""></script><script src="/_next/static/qlZhCFx7chEVWL_rXHIqX/_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/[lib]/[sliceName]/[variation]","query":{},"buildId":"qlZhCFx7chEVWL_rXHIqX","runtimeConfig":{"sentryEnvironment":"production"},"nextExport":true,"isFallback":false,"appGip":true,"scriptLoader":[]}</script></body></html>
|
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-7273106cbfbb324e.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/590-b89154069f96f832.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/qlZhCFx7chEVWL_rXHIqX/_buildManifest.js" defer=""></script><script src="/_next/static/qlZhCFx7chEVWL_rXHIqX/_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":"qlZhCFx7chEVWL_rXHIqX","runtimeConfig":{"sentryEnvironment":"production"},"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.
|
|
3
|
+
"version": "1.18.0",
|
|
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.
|
|
35
|
-
"start-slicemachine": "^0.12.1
|
|
34
|
+
"@slicemachine/manager": "^0.15.0",
|
|
35
|
+
"start-slicemachine": "^0.12.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@emotion/react": "11.11.1",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"vitest": "0.32.0",
|
|
131
131
|
"yup": "0.32.11"
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "70197114a617a1edf1ebd58d6034c1adbb29a5c4"
|
|
134
134
|
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { describe, expect } from "vitest";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CustomType,
|
|
5
|
+
DynamicSection,
|
|
6
|
+
} from "@prismicio/types-internal/lib/customtypes";
|
|
7
|
+
|
|
8
|
+
import * as CustomTypeModel from "../customType";
|
|
9
|
+
|
|
10
|
+
describe("CustomTypeModel test suite", () => {
|
|
11
|
+
const mainSection: DynamicSection = {
|
|
12
|
+
uid: {
|
|
13
|
+
config: {
|
|
14
|
+
label: "MainSectionField",
|
|
15
|
+
},
|
|
16
|
+
type: "UID",
|
|
17
|
+
},
|
|
18
|
+
slices: {
|
|
19
|
+
type: "Slices",
|
|
20
|
+
fieldset: "Slice Zone",
|
|
21
|
+
config: {
|
|
22
|
+
choices: {
|
|
23
|
+
hero_banner: {
|
|
24
|
+
type: "SharedSlice",
|
|
25
|
+
},
|
|
26
|
+
promo_section_image_tiles: {
|
|
27
|
+
type: "SharedSlice",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const anotherSection: DynamicSection = {
|
|
34
|
+
uid: {
|
|
35
|
+
config: {
|
|
36
|
+
label: "AnotherSectionField",
|
|
37
|
+
},
|
|
38
|
+
type: "UID",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const mockCustomType: CustomType = {
|
|
42
|
+
format: "custom",
|
|
43
|
+
id: "id",
|
|
44
|
+
json: {
|
|
45
|
+
mainSection,
|
|
46
|
+
anotherSection,
|
|
47
|
+
},
|
|
48
|
+
label: "lama",
|
|
49
|
+
repeatable: true,
|
|
50
|
+
status: true,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
it("getSectionEntries should return the sections entries", () => {
|
|
54
|
+
expect(CustomTypeModel.getSectionEntries(mockCustomType)).toEqual([
|
|
55
|
+
["mainSection", mainSection],
|
|
56
|
+
["anotherSection", anotherSection],
|
|
57
|
+
]);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("getSectionEntries should return an empty array if there are no sections", () => {
|
|
61
|
+
expect(
|
|
62
|
+
CustomTypeModel.getSectionEntries({
|
|
63
|
+
...mockCustomType,
|
|
64
|
+
json: {},
|
|
65
|
+
})
|
|
66
|
+
).toEqual([]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("getMainSectionEntry should return the first section even if not named Main", () => {
|
|
70
|
+
expect(CustomTypeModel.getMainSectionEntry(mockCustomType)).toEqual([
|
|
71
|
+
"mainSection",
|
|
72
|
+
mainSection,
|
|
73
|
+
]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("getMainSectionEntry should return undefined if there is are sections", () => {
|
|
77
|
+
expect(
|
|
78
|
+
CustomTypeModel.getMainSectionEntry({
|
|
79
|
+
...mockCustomType,
|
|
80
|
+
json: {},
|
|
81
|
+
})
|
|
82
|
+
).toEqual(undefined);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("getSection should return the section matching the key", () => {
|
|
86
|
+
expect(
|
|
87
|
+
CustomTypeModel.getSection(mockCustomType, "anotherSection")
|
|
88
|
+
).toEqual(anotherSection);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("getSection should return undefined if there are no sections", () => {
|
|
92
|
+
expect(
|
|
93
|
+
CustomTypeModel.getSection(
|
|
94
|
+
{
|
|
95
|
+
...mockCustomType,
|
|
96
|
+
json: {},
|
|
97
|
+
},
|
|
98
|
+
"mainSection"
|
|
99
|
+
)
|
|
100
|
+
).toEqual(undefined);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("getSectionSliceZoneConfig should return the config of the given section", () => {
|
|
104
|
+
expect(
|
|
105
|
+
CustomTypeModel.getSectionSliceZoneConfig(mockCustomType, "mainSection")
|
|
106
|
+
).toEqual({
|
|
107
|
+
choices: {
|
|
108
|
+
hero_banner: {
|
|
109
|
+
type: "SharedSlice",
|
|
110
|
+
},
|
|
111
|
+
promo_section_image_tiles: {
|
|
112
|
+
type: "SharedSlice",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("getSectionSliceZoneConfig should return undefined if there are no sections", () => {
|
|
119
|
+
expect(
|
|
120
|
+
CustomTypeModel.getSectionSliceZoneConfig(
|
|
121
|
+
{
|
|
122
|
+
...mockCustomType,
|
|
123
|
+
json: {},
|
|
124
|
+
},
|
|
125
|
+
"mainSection"
|
|
126
|
+
)
|
|
127
|
+
).toEqual(undefined);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("findNextSectionSliceZoneKey should return 'slices'", () => {
|
|
131
|
+
expect(
|
|
132
|
+
CustomTypeModel.findNextSectionSliceZoneKey(
|
|
133
|
+
{
|
|
134
|
+
...mockCustomType,
|
|
135
|
+
json: {
|
|
136
|
+
anotherSection: {},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
"anotherSection"
|
|
140
|
+
)
|
|
141
|
+
).toEqual("slices");
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("findNextSectionSliceZoneKey should return 'slices1'", () => {
|
|
145
|
+
expect(
|
|
146
|
+
CustomTypeModel.findNextSectionSliceZoneKey(
|
|
147
|
+
mockCustomType,
|
|
148
|
+
"anotherSection"
|
|
149
|
+
)
|
|
150
|
+
).toEqual("slices1");
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("findNextSectionSliceZoneKey should return 'slices2'", () => {
|
|
154
|
+
expect(
|
|
155
|
+
CustomTypeModel.findNextSectionSliceZoneKey(
|
|
156
|
+
{
|
|
157
|
+
...mockCustomType,
|
|
158
|
+
json: {
|
|
159
|
+
mainSection,
|
|
160
|
+
SecondSection: {
|
|
161
|
+
slices1: {
|
|
162
|
+
type: "Slices",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
anotherSection,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
"anotherSection"
|
|
169
|
+
)
|
|
170
|
+
).toEqual("slices2");
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("findNextSectionSliceZoneKey should return 'slices3'", () => {
|
|
174
|
+
expect(
|
|
175
|
+
CustomTypeModel.findNextSectionSliceZoneKey(
|
|
176
|
+
{
|
|
177
|
+
...mockCustomType,
|
|
178
|
+
json: {
|
|
179
|
+
mainSection,
|
|
180
|
+
SecondSection: {
|
|
181
|
+
slices2: {
|
|
182
|
+
type: "Slices",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
anotherSection,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
"anotherSection"
|
|
189
|
+
)
|
|
190
|
+
).toEqual("slices3");
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it("createSectionSliceZone should return the given custom type with a slice zone for given section", () => {
|
|
194
|
+
expect(
|
|
195
|
+
CustomTypeModel.createSectionSliceZone(mockCustomType, "anotherSection")
|
|
196
|
+
).toEqual({
|
|
197
|
+
...mockCustomType,
|
|
198
|
+
json: {
|
|
199
|
+
...mockCustomType.json,
|
|
200
|
+
anotherSection: {
|
|
201
|
+
...mockCustomType.json.anotherSection,
|
|
202
|
+
slices1: {
|
|
203
|
+
type: "Slices",
|
|
204
|
+
fieldset: "Slice Zone",
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("createSectionSliceZone should return the same custom type if slice zone already exist for given section", () => {
|
|
212
|
+
expect(
|
|
213
|
+
CustomTypeModel.createSectionSliceZone(mockCustomType, "mainSection")
|
|
214
|
+
).toEqual(mockCustomType);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("convertToPageType should convert the given custom type", () => {
|
|
218
|
+
expect(CustomTypeModel.convertToPageType(mockCustomType)).toEqual({
|
|
219
|
+
...mockCustomType,
|
|
220
|
+
format: "page",
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("convertToPageType should convert the given custom type with a slice zone for Main section when it doesn't exist", () => {
|
|
225
|
+
expect(
|
|
226
|
+
CustomTypeModel.convertToPageType({
|
|
227
|
+
...mockCustomType,
|
|
228
|
+
json: {
|
|
229
|
+
mainSection: {},
|
|
230
|
+
anotherSection,
|
|
231
|
+
},
|
|
232
|
+
})
|
|
233
|
+
).toEqual({
|
|
234
|
+
...mockCustomType,
|
|
235
|
+
json: {
|
|
236
|
+
mainSection: {
|
|
237
|
+
slices: {
|
|
238
|
+
type: "Slices",
|
|
239
|
+
fieldset: "Slice Zone",
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
anotherSection,
|
|
243
|
+
},
|
|
244
|
+
format: "page",
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CustomType,
|
|
3
|
+
DynamicSection,
|
|
4
|
+
DynamicSlicesConfig,
|
|
5
|
+
} from "@prismicio/types-internal/lib/customtypes";
|
|
6
|
+
|
|
7
|
+
export function getSectionEntries(
|
|
8
|
+
customType: CustomType
|
|
9
|
+
): [string, DynamicSection][] {
|
|
10
|
+
return Object.entries(customType.json);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function getMainSectionEntry(
|
|
14
|
+
customType: CustomType
|
|
15
|
+
): [string, DynamicSection] | undefined {
|
|
16
|
+
// Currently we cannot rely on the name of the main section
|
|
17
|
+
// since it's possible to rename it
|
|
18
|
+
const sections = getSectionEntries(customType);
|
|
19
|
+
return sections[0];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getSection(
|
|
23
|
+
customType: CustomType,
|
|
24
|
+
sectionId: string
|
|
25
|
+
): DynamicSection | undefined {
|
|
26
|
+
return customType.json[sectionId];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getSectionSliceZoneConfig(
|
|
30
|
+
customType: CustomType,
|
|
31
|
+
sectionId: string
|
|
32
|
+
): DynamicSlicesConfig | undefined {
|
|
33
|
+
const section = getSection(customType, sectionId);
|
|
34
|
+
|
|
35
|
+
if (section === undefined) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// In Slice Machine we currently only support one slice zone per section
|
|
40
|
+
// so we retrieve the first one
|
|
41
|
+
const maybeSliceZone = Object.values(section).find(
|
|
42
|
+
(value) => value.type === "Slices"
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return maybeSliceZone?.config ?? undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Find the next available key for a slice zone
|
|
49
|
+
// Each section slice zone must have a unique key because
|
|
50
|
+
// all slice zones from a custom type are flattened and
|
|
51
|
+
// it's used as an API id
|
|
52
|
+
export function findNextSectionSliceZoneKey(
|
|
53
|
+
customType: CustomType,
|
|
54
|
+
sectionId: string
|
|
55
|
+
): string {
|
|
56
|
+
const sectionsEntries = getSectionEntries(customType);
|
|
57
|
+
const sectionIndex = sectionsEntries.findIndex(([key]) => key === sectionId);
|
|
58
|
+
|
|
59
|
+
const existingKeys = sectionsEntries.flatMap(([_, section]) =>
|
|
60
|
+
Object.keys(section).filter((key) => section[key].type === "Slices")
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
let i = sectionIndex;
|
|
64
|
+
let proposedKey;
|
|
65
|
+
do {
|
|
66
|
+
proposedKey = `slices${i !== 0 ? i.toString() : ""}`;
|
|
67
|
+
i++;
|
|
68
|
+
} while (existingKeys.includes(proposedKey));
|
|
69
|
+
|
|
70
|
+
return proposedKey;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function createSectionSliceZone(
|
|
74
|
+
customType: CustomType,
|
|
75
|
+
sectionId: string
|
|
76
|
+
): CustomType {
|
|
77
|
+
const maybeSectionSliceZoneConfig = getSectionSliceZoneConfig(
|
|
78
|
+
customType,
|
|
79
|
+
sectionId
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// If the section already has a slice zone, return the custom type as is
|
|
83
|
+
if (maybeSectionSliceZoneConfig) {
|
|
84
|
+
return customType;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Get the next available section key for the slice zone
|
|
88
|
+
const availableSectionSlicesKey = findNextSectionSliceZoneKey(
|
|
89
|
+
customType,
|
|
90
|
+
sectionId
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
...customType,
|
|
95
|
+
json: {
|
|
96
|
+
...customType.json,
|
|
97
|
+
[sectionId]: {
|
|
98
|
+
...customType.json[sectionId],
|
|
99
|
+
[availableSectionSlicesKey]: {
|
|
100
|
+
type: "Slices",
|
|
101
|
+
fieldset: "Slice Zone",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function convertToPageType(customType: CustomType): CustomType {
|
|
109
|
+
let newCustomType: CustomType = {
|
|
110
|
+
...customType,
|
|
111
|
+
format: "page",
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// Create the slice zone for the main section if it doesn't exist
|
|
115
|
+
const mainSectionEntry = getMainSectionEntry(customType);
|
|
116
|
+
if (mainSectionEntry) {
|
|
117
|
+
const [mainSectionKey] = mainSectionEntry;
|
|
118
|
+
newCustomType = createSectionSliceZone(newCustomType, mainSectionKey);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return newCustomType;
|
|
122
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { toast } from "react-toastify";
|
|
2
|
-
|
|
3
2
|
import { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
|
|
4
4
|
import { CustomTypeFormat } from "@slicemachine/manager";
|
|
5
|
+
import { convertToPageType } from "@src/domain/customType";
|
|
5
6
|
import { managerClient } from "@src/managerClient";
|
|
7
|
+
|
|
6
8
|
import { CUSTOM_TYPES_MESSAGES } from "../customTypesMessages";
|
|
7
9
|
|
|
8
10
|
export async function convertCustomToPageType(
|
|
@@ -13,10 +15,7 @@ export async function convertCustomToPageType(
|
|
|
13
15
|
CUSTOM_TYPES_MESSAGES[customType.format as CustomTypeFormat];
|
|
14
16
|
|
|
15
17
|
try {
|
|
16
|
-
const newCustomType
|
|
17
|
-
...customType,
|
|
18
|
-
format: "page",
|
|
19
|
-
};
|
|
18
|
+
const newCustomType = convertToPageType(customType);
|
|
20
19
|
await managerClient.customTypes.updateCustomType({
|
|
21
20
|
model: newCustomType,
|
|
22
21
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[799],{56577:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var r=n(62230),o=n(85244),s=n(98240),a=n(52322),c=n(2784),i=n(75289),l=function(e,t){return e?"".concat(e,"-").concat(t):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,t){var n=e.label,c=e.Icon,d=e.type,m=e.form,p=e.isLoading,h=void 0!==p&&p,f=e.disabled,x=e.onClick,y=e.sx,b=e.iconSize,v=void 0===b?16:b,g=e.iconFill,j=e.variant,_=void 0===j?"primary":j,C=(0,s.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(i.zx,(0,o.Z)((0,r.Z)({ref:t,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===y?{}:y),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),h?{cursor:"wait !important"}:{}),type:d,form:m,disabled:void 0!==f&&f||h,onClick:h?void 0:x,variant:_},C),{children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$j,{size:v,color:u(_),"data-cy":l(C["data-cy"],"spinner")}),c&&n]}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(c,{size:v,fill:g,"data-cy":l(C["data-cy"],"icon")}),n]})}))})},70041:function(e,t,n){"use strict";n.d(t,{W:function(){return c}});var r=n(62230),o=n(52322);n(2784);var s=n(63397),a=n(75289),c=function(e){var t=e.name,n=e.label,c=e.placeholder,i=e.error,l=e.dataCy,u=e.onChange;return(0,o.jsxs)(a.xu,{mb:3,children:[(0,o.jsx)(a.__,{htmlFor:t,mb:2,children:n}),(0,o.jsx)(s.gN,(0,r.Z)({name:t,type:"text",placeholder:c,as:a.II,autoComplete:"off"},u?{onChange:u}:null,l?{"data-cy":l}:null)),i?(0,o.jsx)(a.xv,{"data-cy":l?"".concat(l,"-error"):"input-error",sx:{color:"error",mt:1},children:i}):null]})}},68780:function(e,t,n){"use strict";var r=n(62230),o=n(85244),s=n(52322),a=n(37149),c=n.n(a),i=n(25812),l=n(63397),u=n(75289),d=n(56577),m=n(54132);t.Z=function(e){var t=e.children,n=e.close,a=e.isOpen,p=e.formId,h=e.validate,f=e.onSubmit,x=e.widthInPx,y=e.initialValues,b=e.content.title,v=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,_=e.isLoading,C=void 0!==_&&_,Z=e.buttonLabel,k=void 0===Z?"Save":Z,S=e.dataCy,T=e.actionMessage;return c().setAppElement("#__next"),(0,s.jsx)(i.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:b,style:{content:{width:null!=x?x:"900px"}},children:(0,s.jsx)(l.J9,{validateOnChange:!0,initialValues:y,validate:function(e){return h?h(e):void 0},onSubmit:function(e){f(e)},children:function(e){var a=e.isValid,c=e.isSubmitting,i=e.values,h=e.errors,f=e.touched,x=e.setFieldValue,y=e.setValues;return(0,s.jsx)(l.l0,(0,o.Z)((0,r.Z)({id:p},null!=S?{"data-cy":S}:null),{children:(0,s.jsx)(m.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},v),{Header:function(e){var t=e.radius;return(0,s.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:function(e){var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:[(0,s.jsx)(u.X6,{sx:{fontSize:"20px"},children:b}),(0,s.jsx)(u.x8,{type:"button",onClick:n})]})},Footer:j?null:(0,s.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,s.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof T?T(e):T}),(0,s.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,s.jsx)(u.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:c||C,children:"Cancel"}),(0,s.jsx)(d.z,{label:k,form:p,type:"submit",disabled:!a||c||C,isLoading:c||C,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:a,isSubmitting:c,values:i,errors:h,touched:f,setFieldValue:x,setValues:y})}))}))}})})}},2754:function(e,t,n){"use strict";n.d(t,{R$:function(){return u},Qj:function(){return f},T9:function(){return m},nf:function(){return h},u2:function(){return d},_T:function(){return p}});var r=n(67557),o=n(62230),s=n(85244),a=n(98240),c=n(52322),i=n(6277),l=n(71651);n(41236);var u=function(e){var t=e.backgroundImage,n=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),u=void 0!==t;return(0,c.jsx)("article",(0,s.Z)((0,o.Z)({},l),{className:(0,i.Z)("_18bjhbz0 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9uk _1ecs97d9um _1ecs97d9uo _1ecs97d268 _1ecs97d2dl _1ecs97d9d7 _1ecs97d9ej _1ecs97d9ex _1ecs97d9c7",(0,r.Z)({},"_18bjhbz1 _1ecs97d9cf _1ecs97d9h6",u)),style:(0,o.Z)({backgroundImage:u?"url(".concat(t,")"):void 0},n)}))},d=function(e){return(0,c.jsx)("div",(0,s.Z)((0,o.Z)({},e),{className:"_1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d48s _1ecs97d4g5 _1ecs97d9ep _1ecs97d9f1 _1ecs97d9c7"}))},m=function(e){return(0,c.jsx)("div",(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9rr"}))},p=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},h=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,c.jsx)(l.hE,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97d9lg _1ecs97d9bq _1ecs97d9pm",size:"medium",variant:"secondary"}))}},19345:function(e,t,n){"use strict";n.d(t,{_:function(){return N}});var r=n(22710),o=n(99267),s=n(52322),a=n(2784),c=n(71651),i=n(5632),l=n(90374),u=n(62230),d=n(85244),m=n(88932),p=n(40147),h=n(78656);function f(){return(f=(0,r.Z)(function(e,t){var n,r;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=h.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,d.Z)((0,u.Z)({},e),{format:"page"}),[4,p.j.customTypes.updateCustomType({model:r})];case 2:return o.sent(),t(r),m.Am.success("".concat(n.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return o.sent(),m.Am.error("Internal Error: ".concat(n.name({start:!0,plural:!1})," not converted to page type")),[3,4];case 4:return[2]}})})).apply(this,arguments)}var x=n(67445),y=n(75289),b=n(68780),v=n(70041),g=n(56580),j=n(49471);function _(){return(_=(0,r.Z)(function(e){var t,n,r,s,a,c,i;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=e.model,n=e.newLabel,r=e.onSuccess,s=h.$[t.format],o.label=1;case 1:return o.trys.push([1,3,,4]),a=(0,d.Z)((0,u.Z)({},t),{label:n}),[4,p.j.customTypes.renameCustomType({model:a})];case 2:return o.sent(),r(a),m.Am.success("".concat(s.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return c=o.sent(),i="Internal Error: ".concat(s.name({start:!0,plural:!1})," could not be renamed"),console.error(i,c),m.Am.error(i),[3,4];case 4:return[2]}})})).apply(this,arguments)}var C=function(e){var t,n,c,i=e.isChangesLocal,u=e.customType,d=e.format,m=e.onClose,p=null!==(t=null==u?void 0:u.label)&&void 0!==t?t:"",f=null!==(n=null==u?void 0:u.id)&&void 0!==n?n:"",x=(0,l.Z)(),C=x.renameAvailableCustomTypeSuccess,Z=x.renameSelectedCustomType,k=(0,a.useState)(!1),S=k[0],T=k[1],I=(c=(0,r.Z)(function(e){return(0,o.__generator)(this,function(t){switch(t.label){case 0:if(T(!0),!i)return[3,1];return Z(e.customTypeName),[3,3];case 1:return[4,function(e){return _.apply(this,arguments)}({model:u,newLabel:e.customTypeName,onSuccess:C})];case 2:t.sent(),t.label=3;case 3:return T(!1),m(),[2]}})}),function(e){return c.apply(this,arguments)}),w=(0,g.v9)(function(e){return{customTypeLabels:(0,j.YS)(e)}}).customTypeLabels,z=h.$[d];return(0,s.jsx)(b.Z,{isOpen:!0,dataCy:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:m,onSubmit:function(e){I(e)},initialValues:{customTypeName:p},isLoading:S,content:{title:"Rename a ".concat(z.name({start:!1,plural:!1}))},validate:function(e){var t=e.customTypeName,n={};return t&&t.length||(n.customTypeName="Cannot be empty."),void 0!=n.customTypeName&&w.includes(t)&&p!==t&&(n.customTypeName="".concat(z.name({start:!0,plural:!1})," name is already taken.")),Object.keys(n).length>0?n:void 0},children:function(e){var t=e.errors;return(0,s.jsx)(y.xu,{children:(0,s.jsx)(v.W,{name:"customTypeName",label:"".concat(z.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(z.name({start:!1,plural:!1})),error:t.customTypeName,dataCy:"custom-type-name-input"})})}})},Z=n(25812),k=n(59326),S=n(54132),T=n(65186),I=n(56577);function w(){return(w=(0,r.Z)(function(e){var t,n,r,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=e.customType,n=e.onSuccess,r=h.$[t.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p.j.customTypes.deleteCustomType({id:t.id})];case 2:return o.sent(),n(),m.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(a,s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var z=function(e){var t,n=e.customType,c=e.format,i=e.onClose,u=e.onDeleteCustomTypeSuccess,d=h.$[c],m=(0,a.useState)(!1),p=m[0],f=m[1],x=(0,l.Z)().deleteCustomTypeSuccess,b=(t=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return f(!0),[4,function(e){return w.apply(this,arguments)}({customType:n,onSuccess:function(){return x(n.id)}})];case 1:return e.sent(),u(),[2]}})}),function(){return t.apply(this,arguments)}),v=(0,k.B7)().theme;return(0,s.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return i()},children:(0,s.jsx)(S.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,s.jsxs)(y.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,s.jsxs)(y.kC,{sx:{alignItems:"center"},children:[(0,s.jsx)(T.$vK,{size:20,color:null===(e=v.colors)||void 0===e?void 0:e.greyIcon}),(0,s.jsxs)(y.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,s.jsx)(y.x8,{type:"button",onClick:function(){return i()}})]})},Footer:function(){return(0,s.jsxs)(y.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,s.jsx)(I.z,{label:"Cancel",variant:"secondary",onClick:function(){return i()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==n&&(0,s.jsx)(I.z,{label:"Delete",variant:"danger",isLoading:p,onClick:function(){b()},sx:{minHeight:39,minWidth:78}})]})},children:(0,s.jsxs)("div",{children:["This action will immediately make the following change:",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Delete the"," ",(0,s.jsxs)(y.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==n?void 0:n.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},N=function(e){var t,n=e.format,u=e.customType,d=e.isChangesLocal,m=(0,i.useRouter)(),p=(0,l.Z)().saveCustomTypeSuccess,h=(0,a.useState)(!1),y=h[0],b=h[1],v=(0,a.useState)(!1),g=v[0],j=v[1],_=(0,a.useState)(!1),Z=_[0],k=_[1],S=(t=(0,r.Z)(function(){var e,t;return(0,o.__generator)(this,function(n){switch(n.label){case 0:return k(!0),[4,function(e,t){return f.apply(this,arguments)}(u,p)];case 1:return n.sent(),e=x.cd.custom.getBuilderPagePathname(u.id),m.asPath===e&&(t=x.cd.page.getBuilderPagePathname(u.id),m.replace(t)),k(!1),[2]}})}),function(){return t.apply(this,arguments)}),T=function(){var e,t=x.cd[null!==(e=u.format)&&void 0!==e?e:"custom"].tablePagePathname;m.asPath!==t?m.replace(t):b(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(c.h_,{modal:!0,children:[(0,s.jsx)(c.$F,{disabled:Z,children:(0,s.jsx)(c.zx,{loading:Z,startIcon:"moreVert",variant:"secondary","data-testid":"editDropdown"})}),(0,s.jsxs)(c.AW,{align:"end",children:[(0,s.jsx)(c.Xi,{startIcon:(0,s.jsx)(c.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===n&&!d&&(0,s.jsx)(c.Xi,{startIcon:(0,s.jsx)(c.I5,{name:"driveFileMove"}),onSelect:function(){S()},children:"Convert to page type"}),(0,s.jsx)(c.Xi,{color:"tomato",startIcon:(0,s.jsx)(c.I5,{name:"delete"}),onSelect:function(){b(!0)},children:"Remove"})]})]}),y?(0,s.jsx)(z,{format:n,customType:u,onClose:function(){return b(!1)},onDeleteCustomTypeSuccess:T}):null,g?(0,s.jsx)(C,{format:n,customType:u,isChangesLocal:d,onClose:function(){return j(!1)}}):null]})}},41236:function(){}}]);
|
|
File without changes
|