slice-machine-ui 1.17.0 → 1.17.1-dev-next-release.1

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.
Files changed (28) hide show
  1. package/components/App/index.tsx +1 -1
  2. package/components/ReviewModal/{index.tsx → ReviewForm.tsx} +36 -96
  3. package/components/ReviewModal/ReviewFormSelect.tsx +35 -0
  4. package/components/ReviewModal/ReviewModal.tsx +70 -0
  5. package/components/ReviewModal/index.ts +1 -0
  6. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +3 -3
  7. package/out/404.html +1 -1
  8. package/out/_next/static/{jHU7kBgrJsOz0C26j7MEu → MSX-wke8KllW7Qt4pNFB-}/_buildManifest.js +1 -1
  9. package/out/_next/static/chunks/{590-b89154069f96f832.js → 590-ab38d53732035bf0.js} +1 -1
  10. package/out/_next/static/chunks/{933-036e3a075aa0224c.js → 933-97c3cebf5fb84a17.js} +1 -1
  11. package/out/_next/static/chunks/pages/{_app-9b9687856bd650bd.js → _app-81ecd630066c27f8.js} +2 -2
  12. package/out/changelog.html +1 -1
  13. package/out/changes.html +1 -1
  14. package/out/custom-types/[customTypeId].html +1 -1
  15. package/out/custom-types.html +1 -1
  16. package/out/index.html +1 -1
  17. package/out/labs.html +1 -1
  18. package/out/page-types/[pageTypeId].html +1 -1
  19. package/out/slices/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
  20. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  21. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  22. package/out/slices.html +1 -1
  23. package/package.json +4 -4
  24. package/src/modules/useSliceMachineActions.ts +13 -3
  25. package/src/modules/userContext/index.ts +21 -6
  26. package/src/modules/userContext/types.ts +14 -1
  27. package/test/src/modules/userContext.test.ts +26 -10
  28. /package/out/_next/static/{jHU7kBgrJsOz0C26j7MEu → MSX-wke8KllW7Qt4pNFB-}/_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-9b9687856bd650bd.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/jHU7kBgrJsOz0C26j7MEu/_buildManifest.js" defer=""></script><script src="/_next/static/jHU7kBgrJsOz0C26j7MEu/_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":"jHU7kBgrJsOz0C26j7MEu","runtimeConfig":{"sentryEnvironment":"production"},"nextExport":true,"isFallback":false,"appGip":true,"scriptLoader":[]}</script></body></html>
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-81ecd630066c27f8.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/MSX-wke8KllW7Qt4pNFB-/_buildManifest.js" defer=""></script><script src="/_next/static/MSX-wke8KllW7Qt4pNFB-/_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":"MSX-wke8KllW7Qt4pNFB-","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.17.0",
3
+ "version": "1.17.1-dev-next-release.1",
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.14.0",
35
- "start-slicemachine": "^0.12.0"
34
+ "@slicemachine/manager": "^0.14.1-dev-next-release.1",
35
+ "start-slicemachine": "^0.12.1-dev-next-release.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": "f3f7a5d5aa242d504b16a7563a06982d59a3b4dc"
133
+ "gitHead": "34c74688bfe351628415bbd28e85df29bf902360"
134
134
  }
@@ -23,7 +23,7 @@ import {
23
23
  renameAvailableCustomType,
24
24
  } from "./availableCustomTypes";
25
25
  import { createSlice, deleteSliceCreator, renameSliceCreator } from "./slices";
26
- import { UserContextStoreType } from "./userContext/types";
26
+ import { UserContextStoreType, UserReviewType } from "./userContext/types";
27
27
  import { GenericToastTypes, openToasterCreator } from "./toaster";
28
28
  import {
29
29
  initCustomTypeStoreCreator,
@@ -134,8 +134,18 @@ const useSliceMachineActions = () => {
134
134
  dispatch(stopLoadingActionCreator({ loadingKey: LoadingKeysEnum.LOGIN }));
135
135
 
136
136
  // UserContext module
137
- const skipReview = () => dispatch(skipReviewCreator());
138
- const sendAReview = () => dispatch(sendAReviewCreator());
137
+ const skipReview = (reviewType: UserReviewType) =>
138
+ dispatch(
139
+ skipReviewCreator({
140
+ reviewType,
141
+ })
142
+ );
143
+ const sendAReview = (reviewType: UserReviewType) =>
144
+ dispatch(
145
+ sendAReviewCreator({
146
+ reviewType,
147
+ })
148
+ );
139
149
  const setUpdatesViewed = (versions: UserContextStoreType["updatesViewed"]) =>
140
150
  dispatch(updatesViewedCreator(versions));
141
151
  const setSeenSimulatorToolTip = () =>
@@ -4,6 +4,8 @@ import { ActionType, createAction, getType } from "typesafe-actions";
4
4
  import {
5
5
  AuthStatus,
6
6
  UserContextStoreType,
7
+ UserReviewState,
8
+ UserReviewType,
7
9
  } from "@src/modules/userContext/types";
8
10
  import { refreshStateCreator } from "../environment";
9
11
  import ErrorWithStatus from "@lib/models/common/ErrorWithStatus";
@@ -12,7 +14,10 @@ import { changesPushCreator } from "../pushChangesSaga";
12
14
  // NOTE: Be careful every key written in this store is persisted in the localstorage
13
15
 
14
16
  const initialState: UserContextStoreType = {
15
- hasSendAReview: false,
17
+ userReview: {
18
+ onboarding: false,
19
+ advancedRepository: false,
20
+ },
16
21
  updatesViewed: {
17
22
  latest: null,
18
23
  latestNonBreaking: null,
@@ -25,9 +30,13 @@ const initialState: UserContextStoreType = {
25
30
  };
26
31
 
27
32
  // Actions Creators
28
- export const sendAReviewCreator = createAction("USER_CONTEXT/SEND_REVIEW")();
33
+ export const sendAReviewCreator = createAction("USER_CONTEXT/SEND_REVIEW")<{
34
+ reviewType: UserReviewType;
35
+ }>();
29
36
 
30
- export const skipReviewCreator = createAction("USER_CONTEXT/SKIP_REVIEW")();
37
+ export const skipReviewCreator = createAction("USER_CONTEXT/SKIP_REVIEW")<{
38
+ reviewType: UserReviewType;
39
+ }>();
31
40
 
32
41
  export const updatesViewedCreator = createAction("USER_CONTEXT/VIEWED_UPDATES")<
33
42
  UserContextStoreType["updatesViewed"]
@@ -57,8 +66,11 @@ type userContextActions = ActionType<
57
66
  >;
58
67
 
59
68
  // Selectors
60
- export const userHasSendAReview = (state: SliceMachineStoreType): boolean =>
61
- state.userContext.hasSendAReview;
69
+ export const getUserReview = (state: SliceMachineStoreType): UserReviewState =>
70
+ state.userContext.userReview ?? {
71
+ onboarding: state.userContext.hasSendAReview ?? false,
72
+ advancedRepository: false,
73
+ };
62
74
 
63
75
  export const getUpdatesViewed = (
64
76
  state: SliceMachineStoreType
@@ -90,7 +102,10 @@ export const userContextReducer: Reducer<
90
102
  case getType(skipReviewCreator):
91
103
  return {
92
104
  ...state,
93
- hasSendAReview: true,
105
+ userReview: {
106
+ ...state.userReview,
107
+ [action.payload.reviewType]: true,
108
+ },
94
109
  };
95
110
  case getType(updatesViewedCreator): {
96
111
  return {
@@ -6,7 +6,7 @@ export enum AuthStatus {
6
6
  }
7
7
 
8
8
  export type UserContextStoreType = {
9
- hasSendAReview: boolean;
9
+ userReview: UserReviewState;
10
10
  updatesViewed: {
11
11
  latest: string | null;
12
12
  latestNonBreaking: string | null;
@@ -16,4 +16,17 @@ export type UserContextStoreType = {
16
16
  hasSeenChangesToolTip: boolean;
17
17
  authStatus: AuthStatus;
18
18
  lastSyncChange: number | null;
19
+ } & LegacyUserContextStoreType;
20
+
21
+ export type UserReviewState = {
22
+ onboarding: boolean;
23
+ advancedRepository: boolean;
24
+ };
25
+
26
+ export type UserReviewType = keyof UserReviewState;
27
+
28
+ // Allow to handle old property that users can have
29
+ // in their local storage
30
+ type LegacyUserContextStoreType = {
31
+ hasSendAReview?: boolean;
19
32
  };
@@ -20,41 +20,57 @@ describe("[UserContext module]", () => {
20
20
  expect(userContextReducer({}, { type: "NO.MATCH" })).toEqual({});
21
21
  });
22
22
 
23
- it("should update hasSendAReview to true when given USER_CONTEXT/SEND_REVIEW action", () => {
23
+ it("should update user review onboarding to true when given USER_CONTEXT/SEND_REVIEW action", () => {
24
24
  // @ts-expect-error TS(2739) FIXME: Type '{ hasSendAReview: false;... Remove this comment to see the full error message
25
25
  const initialState: UserContextStoreType = {
26
- hasSendAReview: false,
26
+ userReview: {
27
+ onboarding: false,
28
+ advancedRepository: false,
29
+ },
27
30
  updatesViewed: {
28
31
  latest: null,
29
32
  latestNonBreaking: null,
30
33
  },
31
34
  };
32
35
 
33
- const action = sendAReviewCreator();
36
+ const action = sendAReviewCreator({
37
+ reviewType: "onboarding",
38
+ });
34
39
 
35
- const expectedState = {
40
+ const expectedState: UserContextStoreType = {
36
41
  ...initialState,
37
- hasSendAReview: true,
42
+ userReview: {
43
+ onboarding: true,
44
+ advancedRepository: false,
45
+ },
38
46
  };
39
47
 
40
48
  expect(userContextReducer(initialState, action)).toEqual(expectedState);
41
49
  });
42
50
 
43
- it("should update hasSendAReview to true when given USER_CONTEXT/SKIP_REVIEW action", () => {
51
+ it("should update user review onboarding to true when given USER_CONTEXT/SKIP_REVIEW action", () => {
44
52
  // @ts-expect-error TS(2739) FIXME: Type '{ hasSendAReview: false;... Remove this comment to see the full error message
45
53
  const initialState: UserContextStoreType = {
46
- hasSendAReview: false,
54
+ userReview: {
55
+ onboarding: false,
56
+ advancedRepository: false,
57
+ },
47
58
  updatesViewed: {
48
59
  latest: null,
49
60
  latestNonBreaking: null,
50
61
  },
51
62
  };
52
63
 
53
- const action = skipReviewCreator();
64
+ const action = skipReviewCreator({
65
+ reviewType: "onboarding",
66
+ });
54
67
 
55
- const expectedState = {
68
+ const expectedState: UserContextStoreType = {
56
69
  ...initialState,
57
- hasSendAReview: true,
70
+ userReview: {
71
+ onboarding: true,
72
+ advancedRepository: false,
73
+ },
58
74
  };
59
75
 
60
76
  expect(userContextReducer(initialState, action)).toEqual(expectedState);