slice-machine-ui 2.18.1-beta.7 → 2.18.1-beta.8

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 (63) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/{Zy4opMpDS8I-mxQ1kA3m2 → U9WVTg1pSTJVt94SbRE5Y}/_buildManifest.js +1 -1
  3. package/out/_next/static/chunks/{248-43faecb386a16518.js → 248-a9c33f7fbe2da2f1.js} +1 -1
  4. package/out/_next/static/chunks/34-50c64778da33cff6.js +1 -0
  5. package/out/_next/static/chunks/429-aab52070cad2884b.js +3 -0
  6. package/out/_next/static/chunks/{489-234ed5471aa694b3.js → 489-a046ae0fa4f74435.js} +1 -1
  7. package/out/_next/static/chunks/{630-bb6e3db525588f16.js → 630-eae75e90b30f201a.js} +1 -1
  8. package/out/_next/static/chunks/pages/{_app-64feff311539f17b.js → _app-1b4541325b4a29ab.js} +40 -40
  9. package/out/_next/static/chunks/pages/{changelog-ba55ed247c20dc21.js → changelog-3901f2fc937d9648.js} +1 -1
  10. package/out/_next/static/chunks/pages/changes-c58a60af39167147.js +1 -0
  11. package/out/_next/static/chunks/pages/{labs-78ac01d97ab02cd7.js → labs-dd04033db23a58f3.js} +1 -1
  12. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-b127d948a17968d3.js → simulator-f237aaa755dc9a99.js} +1 -1
  13. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-da423aa0da7bc11e.js → [variation]-c8c3e7ffb898261c.js} +1 -1
  14. package/out/_next/static/chunks/pages/{slices-59b857edc9f72d5f.js → slices-0aaae79dcc7b8c55.js} +1 -1
  15. package/out/changelog.html +1 -1
  16. package/out/changes.html +1 -1
  17. package/out/custom-types/[customTypeId].html +1 -1
  18. package/out/custom-types.html +1 -1
  19. package/out/index.html +1 -1
  20. package/out/labs.html +1 -1
  21. package/out/page-types/[pageTypeId].html +1 -1
  22. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  23. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  24. package/out/slices.html +1 -1
  25. package/package.json +3 -3
  26. package/src/features/auth/LogoutButton.tsx +42 -36
  27. package/src/features/builder/fields/contentRelationship/ContentRelationshipFieldPicker.tsx +3 -3
  28. package/src/features/changes/StatusBadge.tsx +1 -9
  29. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +3 -3
  30. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +3 -3
  31. package/src/features/environments/actions/useSetEnvironment.ts +22 -0
  32. package/src/features/environments/useActiveEnvironment.ts +17 -9
  33. package/src/features/environments/useEnvironments.ts +11 -8
  34. package/src/features/errorBoundaries/AppStateErrorBoundary.tsx +108 -0
  35. package/src/{ErrorBoundary.tsx → features/errorBoundaries/DefaultErrorBoundary.tsx} +2 -2
  36. package/src/features/errorBoundaries/index.ts +2 -0
  37. package/src/features/labs/labsList/LabsPage.tsx +3 -3
  38. package/src/features/navigation/Navigation.tsx +7 -8
  39. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -3
  40. package/src/features/sync/AutoSyncProvider.tsx +2 -2
  41. package/src/features/sync/getUnSyncChanges.ts +1 -3
  42. package/src/legacy/components/AppLayout/index.tsx +10 -85
  43. package/src/legacy/components/ChangesEmptyState/UnauthenticatedView.tsx +31 -0
  44. package/src/legacy/components/ChangesEmptyState/index.ts +1 -1
  45. package/src/legacy/components/ChangesItems/ChangesItems.tsx +3 -3
  46. package/src/legacy/components/LoginModal/index.tsx +14 -6
  47. package/src/legacy/components/Navigation/ChangesItem.tsx +2 -6
  48. package/src/legacy/components/Navigation/Environment.tsx +2 -7
  49. package/src/legacy/components/Navigation/SideNavEnvironmentSelector/SideNavEnvironmentSelector.tsx +3 -8
  50. package/src/legacy/components/Simulator/index.tsx +3 -3
  51. package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -3
  52. package/src/modules/userContext/index.ts +5 -5
  53. package/src/modules/userContext/types.ts +2 -3
  54. package/src/pages/_app.tsx +93 -95
  55. package/src/pages/changes.tsx +4 -5
  56. package/src/queryClient.tsx +24 -0
  57. package/test/__testutils__/index.tsx +13 -10
  58. package/out/_next/static/chunks/157-fa8b348c960c8283.js +0 -3
  59. package/out/_next/static/chunks/34-8d9d9b2944824750.js +0 -1
  60. package/out/_next/static/chunks/pages/changes-4c23263cdc8e59c6.js +0 -1
  61. package/src/features/environments/actions/setEnvironment.ts +0 -18
  62. package/src/legacy/components/ChangesEmptyState/AuthErrorPage.tsx +0 -44
  63. /package/out/_next/static/{Zy4opMpDS8I-mxQ1kA3m2 → U9WVTg1pSTJVt94SbRE5Y}/_ssgManifest.js +0 -0
@@ -25,8 +25,8 @@ import {
25
25
  AppLayoutHeader,
26
26
  } from "@/legacy/components/AppLayout";
27
27
  import {
28
- AuthErrorPage,
29
28
  OfflinePage,
29
+ UnauthenticatedView,
30
30
  } from "@/legacy/components/ChangesEmptyState";
31
31
  import { ChangesItems } from "@/legacy/components/ChangesItems";
32
32
  import {
@@ -114,8 +114,8 @@ const Changes: React.FunctionComponent = () => {
114
114
  if (!isOnline) {
115
115
  return <OfflinePage />;
116
116
  }
117
- if (authStatus === AuthStatus.FORBIDDEN) {
118
- return <AuthErrorPage authStatus={authStatus} />;
117
+ if (authStatus === AuthStatus.UNAUTHENTICATED) {
118
+ return <UnauthenticatedView />;
119
119
  }
120
120
  if (numberOfChanges === 0) {
121
121
  return (
@@ -160,8 +160,7 @@ const Changes: React.FunctionComponent = () => {
160
160
  disabled={
161
161
  numberOfChanges === 0 ||
162
162
  !isOnline ||
163
- authStatus === AuthStatus.UNAUTHORIZED ||
164
- authStatus === AuthStatus.FORBIDDEN ||
163
+ authStatus !== AuthStatus.AUTHENTICATED ||
165
164
  isSyncing
166
165
  }
167
166
  loading={isSyncing}
@@ -0,0 +1,24 @@
1
+ import {
2
+ QueryClient,
3
+ QueryClientProvider as RCQueryClientProvider,
4
+ } from "@tanstack/react-query";
5
+ import { ReactNode } from "react";
6
+
7
+ export const queryClient = new QueryClient({
8
+ defaultOptions: {
9
+ queries: {
10
+ staleTime: 5 * 60 * 1000,
11
+ gcTime: 10 * 60 * 1000,
12
+ retry: false,
13
+ refetchOnWindowFocus: "always",
14
+ },
15
+ },
16
+ });
17
+
18
+ export function QueryClientProvider(props: { children: ReactNode }) {
19
+ return (
20
+ <RCQueryClientProvider client={queryClient}>
21
+ {props.children}
22
+ </RCQueryClientProvider>
23
+ );
24
+ }
@@ -5,7 +5,8 @@ import { Provider } from "react-redux";
5
5
  import { AnyAction, Store } from "redux";
6
6
  import { BaseStyles, ThemeProvider as ThemeUIThemeProvider } from "theme-ui";
7
7
 
8
- import { ErrorBoundary } from "@/ErrorBoundary";
8
+ import { DefaultErrorBoundary } from "@/features/errorBoundaries";
9
+ import { QueryClientProvider } from "@/queryClient";
9
10
 
10
11
  import configureStore from "../../src/redux/store";
11
12
  import type { SliceMachineStoreType } from "../../src/redux/type";
@@ -44,15 +45,17 @@ function render(
44
45
  children: any;
45
46
  }) {
46
47
  return (
47
- <ThemeUIThemeProvider theme={theme}>
48
- <TooltipProvider>
49
- <BaseStyles>
50
- <Provider store={store}>
51
- <ErrorBoundary>{children}</ErrorBoundary>
52
- </Provider>
53
- </BaseStyles>
54
- </TooltipProvider>
55
- </ThemeUIThemeProvider>
48
+ <QueryClientProvider>
49
+ <ThemeUIThemeProvider theme={theme}>
50
+ <TooltipProvider>
51
+ <BaseStyles>
52
+ <Provider store={store}>
53
+ <DefaultErrorBoundary>{children}</DefaultErrorBoundary>
54
+ </Provider>
55
+ </BaseStyles>
56
+ </TooltipProvider>
57
+ </ThemeUIThemeProvider>
58
+ </QueryClientProvider>
56
59
  );
57
60
  }
58
61
  return {