slice-machine-ui 1.23.2-beta.10 → 1.23.2-beta.11
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/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/components/ChangesItems/ChangesItems.tsx +6 -2
- package/components/CustomTypeTable/changesPage.tsx +12 -7
- package/components/DeleteSliceModal/index.tsx +3 -0
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +4 -0
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -1
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +6 -1
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +3 -0
- package/components/LoginModal/index.tsx +40 -2
- package/components/Navigation/ChangesItem.tsx +117 -0
- package/components/Navigation/Environment.tsx +51 -4
- package/components/Navigation/index.css.ts +1 -2
- package/components/Navigation/index.test.tsx +5 -85
- package/components/Navigation/index.tsx +3 -8
- package/lib/builders/SliceBuilder/index.tsx +3 -3
- package/lib/models/common/ModelStatus/index.ts +25 -0
- package/out/404.html +1 -1
- package/out/_next/static/chunks/25-3aa4d4b24167d340.js +1 -0
- package/out/_next/static/chunks/{318-99b5914b60bf1d17.js → 318-19dbcae10cdb6408.js} +1 -1
- package/out/_next/static/chunks/727-de03055e40815a3a.js +1 -0
- package/out/_next/static/chunks/{799-b616401fe0dafdeb.js → 799-0af1215eb2b3c17e.js} +1 -1
- package/out/_next/static/chunks/904-40686b0426716111.js +1 -0
- package/out/_next/static/chunks/pages/{_app-5ec41fc53c1f6405.js → _app-bca191df4ac7078e.js} +24 -24
- package/out/_next/static/chunks/pages/{changelog-02cd80dad6f40878.js → changelog-cb1df3a70b20f1b8.js} +1 -1
- package/out/_next/static/chunks/pages/changes-ccfd715c2bdc4f83.js +1 -0
- package/out/_next/static/chunks/pages/{labs-39b50541a4c370bf.js → labs-2adfb5127f9c4081.js} +1 -1
- package/out/_next/static/chunks/pages/{settings-879686e3a8759dc3.js → settings-94bcd7422e8b237d.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-c498e9c80cae8cce.js → simulator-aaf65fbec8f5839c.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-90bb2ea76d2abf42.js +1 -0
- package/out/_next/static/chunks/pages/slices-e0ce615c38e8338d.js +1 -0
- package/out/_next/static/css/{3c26dbbbd8f4be12.css → 39e089aad1742a3a.css} +1 -1
- package/out/_next/static/{Dz7wwTNVdXvoAjySXz7mE → dS_xZnzzna6Y6uwcTgf90}/_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/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -3
- package/pages/_app.tsx +34 -32
- package/pages/changes.tsx +27 -41
- package/src/components/SideNav/SideNav.css.ts +1 -1
- package/src/components/SideNav/SideNav.tsx +9 -5
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +31 -11
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +4 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +11 -10
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +2 -2
- package/src/features/environments/actions/setEnvironment.ts +3 -3
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +12 -10
- package/src/features/sync/AutoSyncProvider.tsx +252 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css +17 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css.d.ts +5 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +58 -0
- package/src/features/sync/fetchUnSyncChanges.ts +40 -0
- package/src/features/sync/getUnSyncChanges.ts +144 -0
- package/src/features/sync/useUnSyncChanges.ts +32 -0
- package/src/hooks/useActionQueue.tsx +177 -0
- package/src/hooks/useAuthStatus.ts +12 -0
- package/src/icons/SyncFailed.tsx +30 -0
- package/src/icons/Synced.tsx +19 -0
- package/src/icons/Syncing.tsx +23 -0
- package/test/__testutils__/index.tsx +8 -5
- package/components/Navigation/ChangesListItem.tsx +0 -74
- package/components/Navigation/ChangesRightElement.tsx +0 -33
- package/out/_next/static/chunks/25-01f422cea8066349.js +0 -1
- package/out/_next/static/chunks/727-f8fefdd3e50cab2a.js +0 -1
- package/out/_next/static/chunks/904-4653b7a849f4db94.js +0 -1
- package/out/_next/static/chunks/pages/changes-8e9da8fbb809aad3.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-9b893c62b2f2fe4a.js +0 -1
- package/out/_next/static/chunks/pages/slices-4522d604117d8c66.js +0 -1
- package/src/features/autoSave/useAutoSave.tsx +0 -177
- package/src/features/legacyState/actions/getLegacySliceMachineState.ts +0 -53
- package/src/features/legacyState/useLegacySliceMachineState.ts +0 -7
- package/src/hooks/useModelStatus.ts +0 -78
- package/src/hooks/useUnSyncChanges.ts +0 -88
- package/test/components/LoginModal.test.tsx +0 -67
- package/test/src/hooks/useModelStatus.test.ts +0 -115
- /package/out/_next/static/{Dz7wwTNVdXvoAjySXz7mE → dS_xZnzzna6Y6uwcTgf90}/_ssgManifest.js +0 -0
- /package/src/features/{changes → sync}/actions/pushChanges.ts +0 -0
- /package/src/features/{changes → sync}/actions/trackPushChangesSuccess.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,f,
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,n,f,u,d,h,l,k,j,p,g,o,r){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-cf93d16e9c63b6db.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":[s,e,"static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-cb1df3a70b20f1b8.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-5bb55fb464e34768.js",c,n,"static/css/838fd8bb5a7c32b0.css","static/chunks/pages/changes-ccfd715c2bdc4f83.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-3c8e721ec6802127.js"],"/custom-types/[customTypeId]":[s,f,u,d,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-97ab3b90b85d645d.js"],"/labs":["static/chunks/pages/labs-2adfb5127f9c4081.js"],"/page-types/[pageTypeId]":[s,f,u,d,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-84a22c5e480d3fa9.js"],"/settings":["static/css/ca32882a5d2d8d88.css","static/chunks/pages/settings-94bcd7422e8b237d.js"],"/slices":[s,t,b,c,n,"static/css/f8eb526e10bc2441.css","static/chunks/pages/slices-e0ce615c38e8338d.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,f,u,d,h,e,b,i,l,c,k,n,"static/css/b22c0750c14cc089.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-90bb2ea76d2abf42.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-5f78714a35fde4a1.js","static/chunks/777-8c5507e3b119b5dc.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-aaf65fbec8f5839c.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-7a3b5554b806349f.js","static/chunks/25-3aa4d4b24167d340.js","static/chunks/799-0af1215eb2b3c17e.js","static/chunks/183-4feb6bb3eddbc768.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/543-f8766685f7f451e2.js","static/chunks/50-cfc2514205b86001.js","static/chunks/286-ed90373e9a469944.js","static/chunks/f36c6662-03bb5e9d9aa0b0aa.js","static/chunks/4c744e84-e3161d754618373f.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-2c5b6c0367fcde86.js","static/chunks/696-b12edad30a3617e5.js","static/chunks/318-19dbcae10cdb6408.js","static/chunks/727-de03055e40815a3a.js","static/css/be1f49e49a5aa7eb.css","static/chunks/474-5a072e6fac61f703.js","static/chunks/904-40686b0426716111.js","static/css/72465cc1225f28a2.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
package/out/changelog.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/870-0c7a8a9622de78b7.js" defer=""></script><script src="/_next/static/chunks/pages/changelog-cb1df3a70b20f1b8.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changelog","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/changes.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/838fd8bb5a7c32b0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/838fd8bb5a7c32b0.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/8eec4907-b712959d9f984b68.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/918-5bb55fb464e34768.js" defer=""></script><script src="/_next/static/chunks/25-3aa4d4b24167d340.js" defer=""></script><script src="/_next/static/chunks/286-ed90373e9a469944.js" defer=""></script><script src="/_next/static/chunks/pages/changes-ccfd715c2bdc4f83.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changes","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/72465cc1225f28a2.css" as="style"/><link rel="stylesheet" href="/_next/static/css/72465cc1225f28a2.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js" defer=""></script><script src="/_next/static/chunks/4c744e84-e3161d754618373f.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/50-cfc2514205b86001.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/696-b12edad30a3617e5.js" defer=""></script><script src="/_next/static/chunks/474-5a072e6fac61f703.js" defer=""></script><script src="/_next/static/chunks/25-3aa4d4b24167d340.js" defer=""></script><script src="/_next/static/chunks/799-0af1215eb2b3c17e.js" defer=""></script><script src="/_next/static/chunks/318-19dbcae10cdb6408.js" defer=""></script><script src="/_next/static/chunks/904-40686b0426716111.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types/%5BcustomTypeId%5D-97ab3b90b85d645d.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types/[customTypeId]","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/custom-types.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/be1f49e49a5aa7eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/be1f49e49a5aa7eb.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/799-0af1215eb2b3c17e.js" defer=""></script><script src="/_next/static/chunks/727-de03055e40815a3a.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types-3c8e721ec6802127.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/be1f49e49a5aa7eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/be1f49e49a5aa7eb.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/799-0af1215eb2b3c17e.js" defer=""></script><script src="/_next/static/chunks/727-de03055e40815a3a.js" defer=""></script><script src="/_next/static/chunks/pages/index-cf93d16e9c63b6db.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/labs.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/pages/labs-2adfb5127f9c4081.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/labs","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/72465cc1225f28a2.css" as="style"/><link rel="stylesheet" href="/_next/static/css/72465cc1225f28a2.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js" defer=""></script><script src="/_next/static/chunks/4c744e84-e3161d754618373f.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/50-cfc2514205b86001.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/696-b12edad30a3617e5.js" defer=""></script><script src="/_next/static/chunks/474-5a072e6fac61f703.js" defer=""></script><script src="/_next/static/chunks/25-3aa4d4b24167d340.js" defer=""></script><script src="/_next/static/chunks/799-0af1215eb2b3c17e.js" defer=""></script><script src="/_next/static/chunks/318-19dbcae10cdb6408.js" defer=""></script><script src="/_next/static/chunks/904-40686b0426716111.js" defer=""></script><script src="/_next/static/chunks/pages/page-types/%5BpageTypeId%5D-84a22c5e480d3fa9.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/page-types/[pageTypeId]","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/settings.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/ca32882a5d2d8d88.css" as="style"/><link rel="stylesheet" href="/_next/static/css/ca32882a5d2d8d88.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/pages/settings-94bcd7422e8b237d.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/settings","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/72585f70-28b4d7d5384b3703.js" defer=""></script><script src="/_next/static/chunks/18539003-5f78714a35fde4a1.js" defer=""></script><script src="/_next/static/chunks/777-8c5507e3b119b5dc.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D/simulator-aaf65fbec8f5839c.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]/simulator","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/b22c0750c14cc089.css" as="style"/><link rel="stylesheet" href="/_next/static/css/b22c0750c14cc089.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js" defer=""></script><script src="/_next/static/chunks/4c744e84-e3161d754618373f.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/50-cfc2514205b86001.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/696-b12edad30a3617e5.js" defer=""></script><script src="/_next/static/chunks/25-3aa4d4b24167d340.js" defer=""></script><script src="/_next/static/chunks/318-19dbcae10cdb6408.js" defer=""></script><script src="/_next/static/chunks/286-ed90373e9a469944.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D-90bb2ea76d2abf42.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"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"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.css" data-n-g=""/><link rel="preload" href="/_next/static/css/f8eb526e10bc2441.css" as="style"/><link rel="stylesheet" href="/_next/static/css/f8eb526e10bc2441.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/50-cfc2514205b86001.js" defer=""></script><script src="/_next/static/chunks/25-3aa4d4b24167d340.js" defer=""></script><script src="/_next/static/chunks/286-ed90373e9a469944.js" defer=""></script><script src="/_next/static/chunks/pages/slices-e0ce615c38e8338d.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_buildManifest.js" defer=""></script><script src="/_next/static/dS_xZnzzna6Y6uwcTgf90/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices","query":{},"buildId":"dS_xZnzzna6Y6uwcTgf90","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slice-machine-ui",
|
|
3
|
-
"version": "1.23.2-beta.
|
|
3
|
+
"version": "1.23.2-beta.11",
|
|
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": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@radix-ui/react-visually-hidden": "1.0.3",
|
|
39
|
-
"@slicemachine/manager": "0.17.9-beta.
|
|
40
|
-
"start-slicemachine": "0.12.15-beta.
|
|
39
|
+
"@slicemachine/manager": "0.17.9-beta.12",
|
|
40
|
+
"start-slicemachine": "0.12.15-beta.12"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@emotion/react": "11.11.1",
|
package/pages/_app.tsx
CHANGED
|
@@ -34,9 +34,9 @@ import type { Persistor } from "redux-persist/es/types";
|
|
|
34
34
|
import { PersistGate } from "redux-persist/integration/react";
|
|
35
35
|
import { ThemeProvider as ThemeUIThemeProvider, useThemeUI } from "theme-ui";
|
|
36
36
|
|
|
37
|
-
import { AppLayout, AppLayoutContent } from "@components/AppLayout";
|
|
38
37
|
import { InAppGuideProvider } from "@src/features/inAppGuide/InAppGuideContext";
|
|
39
38
|
import { InAppGuideDialog } from "@src/features/inAppGuide/InAppGuideDialog";
|
|
39
|
+
import { AutoSyncProvider } from "@src/features/sync/AutoSyncProvider";
|
|
40
40
|
|
|
41
41
|
import SliceMachineApp from "../components/App";
|
|
42
42
|
import LoadingPage from "../components/LoadingPage";
|
|
@@ -140,39 +140,41 @@ function App({
|
|
|
140
140
|
);
|
|
141
141
|
}}
|
|
142
142
|
renderError={() => (
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
</
|
|
143
|
+
<Box
|
|
144
|
+
justifyContent="center"
|
|
145
|
+
width="100%"
|
|
146
|
+
padding={80}
|
|
147
|
+
>
|
|
148
|
+
<DefaultErrorMessage
|
|
149
|
+
title="Error"
|
|
150
|
+
description="An error occurred while rendering the app."
|
|
151
|
+
/>
|
|
152
|
+
</Box>
|
|
153
153
|
)}
|
|
154
154
|
>
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
<
|
|
158
|
-
<
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
155
|
+
<Suspense fallback={<LoadingPage />}>
|
|
156
|
+
<AutoSyncProvider>
|
|
157
|
+
<InAppGuideProvider>
|
|
158
|
+
<RouteChangeProvider>
|
|
159
|
+
<ComponentLayout>
|
|
160
|
+
<Component {...pageProps} />
|
|
161
|
+
</ComponentLayout>
|
|
162
|
+
</RouteChangeProvider>
|
|
163
|
+
<ErrorBoundary
|
|
164
|
+
onError={(error) => {
|
|
165
|
+
console.error(
|
|
166
|
+
`An error occurred while rendering the in-app guide`,
|
|
167
|
+
error,
|
|
168
|
+
);
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
<Suspense>
|
|
172
|
+
<InAppGuideDialog />
|
|
173
|
+
</Suspense>
|
|
174
|
+
</ErrorBoundary>
|
|
175
|
+
</InAppGuideProvider>
|
|
176
|
+
</AutoSyncProvider>
|
|
177
|
+
</Suspense>
|
|
176
178
|
</ErrorBoundary>
|
|
177
179
|
</PersistGate>
|
|
178
180
|
</ConnectedRouter>
|
package/pages/changes.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Button } from "@prismicio/editor-ui";
|
|
2
|
-
import React, { useMemo, useState } from "react";
|
|
2
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { toast } from "react-toastify";
|
|
4
4
|
import Head from "next/head";
|
|
5
5
|
import { BaseStyles } from "theme-ui";
|
|
6
|
+
import { useRouter } from "next/router";
|
|
7
|
+
|
|
6
8
|
import {
|
|
7
9
|
AppLayout,
|
|
8
10
|
AppLayoutActions,
|
|
@@ -12,60 +14,52 @@ import {
|
|
|
12
14
|
} from "@components/AppLayout";
|
|
13
15
|
import { ChangesItems } from "@components/ChangesItems";
|
|
14
16
|
import { AuthErrorPage, OfflinePage } from "@components/ChangesEmptyState";
|
|
15
|
-
|
|
16
17
|
import { NoChangesBlankSlate } from "@src/features/changes/BlankSlates";
|
|
17
|
-
|
|
18
18
|
import { AuthStatus } from "@src/modules/userContext/types";
|
|
19
|
-
import { unSyncStatuses, useUnSyncChanges } from "@src/hooks/useUnSyncChanges";
|
|
20
19
|
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
21
20
|
import {
|
|
22
21
|
SoftDeleteDocumentsDrawer,
|
|
23
22
|
HardDeleteDocumentsDrawer,
|
|
24
23
|
} from "@components/DeleteDocumentsDrawer";
|
|
25
|
-
import { hasLocal } from "@lib/models/common/ModelData";
|
|
26
|
-
import {
|
|
27
|
-
ChangedCustomType,
|
|
28
|
-
ChangedSlice,
|
|
29
|
-
} from "@lib/models/common/ModelStatus";
|
|
30
24
|
import { PushChangesLimit } from "@slicemachine/manager";
|
|
31
|
-
import { pushChanges } from "@src/features/changes/actions/pushChanges";
|
|
32
25
|
import { getState } from "@src/apiClient";
|
|
26
|
+
import { pushChanges } from "@src/features/sync/actions/pushChanges";
|
|
27
|
+
import { useUnSyncChanges } from "@src/features/sync/useUnSyncChanges";
|
|
28
|
+
import { useNetwork } from "@src/hooks/useNetwork";
|
|
29
|
+
import { useAuthStatus } from "@src/hooks/useAuthStatus";
|
|
30
|
+
import { useAutoSync } from "@src/features/sync/AutoSyncProvider";
|
|
33
31
|
|
|
34
32
|
const Changes: React.FunctionComponent = () => {
|
|
35
33
|
const {
|
|
36
34
|
unSyncedSlices,
|
|
37
35
|
unSyncedCustomTypes,
|
|
36
|
+
changedCustomTypes,
|
|
37
|
+
changedSlices,
|
|
38
38
|
modelsStatuses,
|
|
39
|
-
authStatus,
|
|
40
|
-
isOnline,
|
|
41
39
|
} = useUnSyncChanges();
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
const changedSlices = unSyncedSlices
|
|
45
|
-
.map((s) => ({
|
|
46
|
-
slice: s,
|
|
47
|
-
status: modelsStatuses.slices[s.model.id],
|
|
48
|
-
}))
|
|
49
|
-
.filter((s): s is ChangedSlice => unSyncStatuses.includes(s.status)); // TODO can we sync unSyncStatuses and ChangedSlice?
|
|
50
|
-
const changedCustomTypes = unSyncedCustomTypes
|
|
51
|
-
.map((model) => (hasLocal(model) ? model.local : model.remote))
|
|
52
|
-
.map((ct) => ({
|
|
53
|
-
customType: ct,
|
|
54
|
-
status: modelsStatuses.customTypes[ct.id],
|
|
55
|
-
}))
|
|
56
|
-
.filter((c): c is ChangedCustomType => unSyncStatuses.includes(c.status));
|
|
57
|
-
|
|
58
|
-
return { changedSlices, changedCustomTypes };
|
|
59
|
-
}, [unSyncedSlices, unSyncedCustomTypes, modelsStatuses]);
|
|
60
|
-
|
|
40
|
+
const isOnline = useNetwork();
|
|
41
|
+
const authStatus = useAuthStatus();
|
|
61
42
|
const { pushChangesSuccess, refreshState } = useSliceMachineActions();
|
|
62
43
|
const [isSyncing, setIsSyncing] = useState(false);
|
|
63
44
|
const [openModalData, setOpenModalData] = useState<
|
|
64
45
|
PushChangesLimit | undefined
|
|
65
46
|
>(undefined);
|
|
47
|
+
const { autoSyncStatus } = useAutoSync();
|
|
48
|
+
const router = useRouter();
|
|
66
49
|
|
|
67
50
|
const numberOfChanges = unSyncedSlices.length + unSyncedCustomTypes.length;
|
|
68
51
|
|
|
52
|
+
// Changes page should not be accessible when the autoSyncStatus is syncing, synced or failed
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (
|
|
55
|
+
autoSyncStatus === "synced" ||
|
|
56
|
+
autoSyncStatus === "failed" ||
|
|
57
|
+
autoSyncStatus === "syncing"
|
|
58
|
+
) {
|
|
59
|
+
void router.push("/");
|
|
60
|
+
}
|
|
61
|
+
}, [autoSyncStatus, router]);
|
|
62
|
+
|
|
69
63
|
const onPush = async (confirmDeleteDocuments: boolean) => {
|
|
70
64
|
try {
|
|
71
65
|
setIsSyncing(true);
|
|
@@ -73,23 +67,15 @@ const Changes: React.FunctionComponent = () => {
|
|
|
73
67
|
|
|
74
68
|
const limit = await pushChanges({
|
|
75
69
|
confirmDeleteDocuments,
|
|
76
|
-
changedSlices,
|
|
77
70
|
changedCustomTypes,
|
|
71
|
+
changedSlices,
|
|
78
72
|
});
|
|
79
73
|
|
|
80
74
|
if (limit !== undefined) {
|
|
81
75
|
setOpenModalData(limit);
|
|
82
76
|
} else {
|
|
83
|
-
// TODO(DT-1737): Remove the use of global getState
|
|
84
77
|
const serverState = await getState();
|
|
85
|
-
refreshState(
|
|
86
|
-
env: serverState.env,
|
|
87
|
-
remoteCustomTypes: serverState.remoteCustomTypes,
|
|
88
|
-
customTypes: serverState.customTypes,
|
|
89
|
-
libraries: serverState.libraries,
|
|
90
|
-
remoteSlices: serverState.remoteSlices,
|
|
91
|
-
clientError: serverState.clientError,
|
|
92
|
-
});
|
|
78
|
+
refreshState(serverState);
|
|
93
79
|
|
|
94
80
|
// Update last sync value in local storage
|
|
95
81
|
pushChangesSuccess();
|
|
@@ -173,10 +173,14 @@ export const UpdateInfo: FC<UpdateInfoProps> = ({
|
|
|
173
173
|
Some updates of Slice Machine are available.
|
|
174
174
|
</p>
|
|
175
175
|
|
|
176
|
-
{
|
|
177
|
-
component
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
{
|
|
177
|
+
// TODO(DT-1942): This should be a Button with a link component for
|
|
178
|
+
// accessibility
|
|
179
|
+
createElement(
|
|
180
|
+
component,
|
|
181
|
+
{ ...{ className: styles.updateInfoLink, onClick }, href },
|
|
182
|
+
"Learn more",
|
|
183
|
+
)
|
|
184
|
+
}
|
|
181
185
|
</div>
|
|
182
186
|
);
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Icon,
|
|
9
9
|
IconButton,
|
|
10
10
|
InvisibleButton,
|
|
11
|
+
ProgressCircle,
|
|
11
12
|
Text,
|
|
12
13
|
} from "@prismicio/editor-ui";
|
|
13
14
|
import { Environment } from "@slicemachine/manager/client";
|
|
@@ -21,22 +22,26 @@ import * as styles from "./SideNavEnvironmentSelector.css";
|
|
|
21
22
|
import { LoginIcon } from "@src/icons/LoginIcon";
|
|
22
23
|
|
|
23
24
|
type SideNavEnvironmentSelectorProps = {
|
|
24
|
-
variant?: "default" | "offline" | "unauthorized" | "unauthenticated";
|
|
25
|
-
environments?: Environment[];
|
|
26
25
|
activeEnvironment?: Environment;
|
|
27
|
-
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
environments?: Environment[];
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
variant?: "default" | "offline" | "unauthorized" | "unauthenticated";
|
|
28
30
|
onLogInClick?: () => void;
|
|
31
|
+
onSelect?: (environment: Environment) => void | Promise<void>;
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export const SideNavEnvironmentSelector: FC<SideNavEnvironmentSelectorProps> = (
|
|
32
35
|
props,
|
|
33
36
|
) => {
|
|
34
37
|
const {
|
|
35
|
-
variant = "default",
|
|
36
|
-
environments = [],
|
|
37
38
|
activeEnvironment,
|
|
38
|
-
|
|
39
|
+
disabled = false,
|
|
40
|
+
environments = [],
|
|
41
|
+
loading = false,
|
|
42
|
+
variant = "default",
|
|
39
43
|
onLogInClick,
|
|
44
|
+
onSelect,
|
|
40
45
|
} = props;
|
|
41
46
|
|
|
42
47
|
const isProductionEnvironmentActive = activeEnvironment?.kind === "prod";
|
|
@@ -60,7 +65,7 @@ export const SideNavEnvironmentSelector: FC<SideNavEnvironmentSelectorProps> = (
|
|
|
60
65
|
overflow="hidden"
|
|
61
66
|
alignItems="flex-start"
|
|
62
67
|
>
|
|
63
|
-
{variant === "default"
|
|
68
|
+
{variant === "default" ? (
|
|
64
69
|
<Text component="span" variant="small" color="grey11">
|
|
65
70
|
Environment
|
|
66
71
|
</Text>
|
|
@@ -70,6 +75,12 @@ export const SideNavEnvironmentSelector: FC<SideNavEnvironmentSelectorProps> = (
|
|
|
70
75
|
<InvisibleButton buttonText="Login required" onClick={onLogInClick} />
|
|
71
76
|
) : undefined}
|
|
72
77
|
|
|
78
|
+
{variant === "offline" ? (
|
|
79
|
+
<Text component="span" variant="bold">
|
|
80
|
+
Offline
|
|
81
|
+
</Text>
|
|
82
|
+
) : undefined}
|
|
83
|
+
|
|
73
84
|
{variant === "default" ? (
|
|
74
85
|
<Text
|
|
75
86
|
component="span"
|
|
@@ -93,8 +104,10 @@ export const SideNavEnvironmentSelector: FC<SideNavEnvironmentSelectorProps> = (
|
|
|
93
104
|
|
|
94
105
|
{environments.length > 1 ? (
|
|
95
106
|
<EnvironmentDropdownMenu
|
|
96
|
-
environments={environments}
|
|
97
107
|
activeEnvironment={activeEnvironment}
|
|
108
|
+
disabled={disabled}
|
|
109
|
+
environments={environments}
|
|
110
|
+
loading={loading}
|
|
98
111
|
onSelect={onSelect}
|
|
99
112
|
/>
|
|
100
113
|
) : undefined}
|
|
@@ -107,11 +120,14 @@ type EnvironmentDropdownMenuProps = Pick<
|
|
|
107
120
|
SideNavEnvironmentSelectorProps,
|
|
108
121
|
"activeEnvironment" | "onSelect"
|
|
109
122
|
> & {
|
|
123
|
+
disabled: boolean;
|
|
110
124
|
environments: Environment[];
|
|
125
|
+
loading: boolean;
|
|
111
126
|
};
|
|
112
127
|
|
|
113
128
|
const EnvironmentDropdownMenu: FC<EnvironmentDropdownMenuProps> = (props) => {
|
|
114
|
-
const { environments,
|
|
129
|
+
const { activeEnvironment, disabled, environments, loading, onSelect } =
|
|
130
|
+
props;
|
|
115
131
|
|
|
116
132
|
const nonPersonalEnvironments = environments.filter(
|
|
117
133
|
(environment) => environment.kind !== "dev",
|
|
@@ -122,8 +138,12 @@ const EnvironmentDropdownMenu: FC<EnvironmentDropdownMenuProps> = (props) => {
|
|
|
122
138
|
|
|
123
139
|
return (
|
|
124
140
|
<DropdownMenu modal>
|
|
125
|
-
<DropdownMenuTrigger disabled={
|
|
126
|
-
<IconButton
|
|
141
|
+
<DropdownMenuTrigger disabled={disabled}>
|
|
142
|
+
<IconButton
|
|
143
|
+
icon={loading ? <ProgressCircle /> : "unfoldMore"}
|
|
144
|
+
hiddenLabel="Select environment"
|
|
145
|
+
disabled={disabled}
|
|
146
|
+
/>
|
|
127
147
|
</DropdownMenuTrigger>
|
|
128
148
|
<DropdownMenuContent align="end" minWidth={256}>
|
|
129
149
|
{personalEnvironment ? (
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { Box, Icon, ProgressCircle, Text } from "@prismicio/editor-ui";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ActionQueueStatus } from "@src/hooks/useActionQueue";
|
|
5
5
|
|
|
6
6
|
type AutoSaveStatusIndicatorProps = {
|
|
7
|
-
status:
|
|
7
|
+
status: ActionQueueStatus;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const AutoSaveStatusIndicator: FC<AutoSaveStatusIndicatorProps> = (
|
|
@@ -14,7 +14,7 @@ export const AutoSaveStatusIndicator: FC<AutoSaveStatusIndicatorProps> = (
|
|
|
14
14
|
let autoSaveStatusInfo;
|
|
15
15
|
|
|
16
16
|
switch (status) {
|
|
17
|
-
case "
|
|
17
|
+
case "pending":
|
|
18
18
|
autoSaveStatusInfo = {
|
|
19
19
|
icon: <ProgressCircle color="grey11" />,
|
|
20
20
|
text: "Saving...",
|
|
@@ -26,7 +26,7 @@ export const AutoSaveStatusIndicator: FC<AutoSaveStatusIndicatorProps> = (
|
|
|
26
26
|
text: "Failed to save",
|
|
27
27
|
};
|
|
28
28
|
break;
|
|
29
|
-
case "
|
|
29
|
+
case "done":
|
|
30
30
|
autoSaveStatusInfo = {
|
|
31
31
|
icon: <Icon name="check" color="green11" size="medium" />,
|
|
32
32
|
text: "Auto-saved",
|