@admin-layout/client 10.0.9-alpha.42 → 10.0.9-alpha.49

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.
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ type Props = {
3
+ /**
4
+ * You are encouraged to add a fallback that is the same dimensions
5
+ * as the client rendered children. This will avoid content layout
6
+ * shift which is disgusting
7
+ */
8
+ children(): React.ReactNode;
9
+ fallback?: React.ReactNode;
10
+ };
11
+ /**
12
+ * Render the children only after the JS has loaded client-side. Use an optional
13
+ * fallback component if the JS is not yet loaded.
14
+ *
15
+ * Example: Render a Chart component if JS loads, renders a simple FakeChart
16
+ * component server-side or if there is no JS. The FakeChart can have only the
17
+ * UI without the behavior or be a loading spinner or skeleton.
18
+ * ```tsx
19
+ * return (
20
+ * <ClientOnly fallback={<FakeChart />}>
21
+ * {() => <Chart />}
22
+ * </ClientOnly>
23
+ * );
24
+ * ```
25
+ */
26
+ export declare function ClientOnly({ children, fallback }: Props): import("react/jsx-runtime").JSX.Element;
27
+ export {};
28
+ //# sourceMappingURL=Client-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Client-only.d.ts","sourceRoot":"","sources":["../../src/hooks/Client-only.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,KAAK,GAAG;IACT;;;;OAIG;IACH,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAe,EAAE,EAAE,KAAK,2CAE9D"}
@@ -0,0 +1,18 @@
1
+ import {jsx,Fragment}from'react/jsx-runtime';import {useHydrated}from'./use-hydrated.js';/**
2
+ * Render the children only after the JS has loaded client-side. Use an optional
3
+ * fallback component if the JS is not yet loaded.
4
+ *
5
+ * Example: Render a Chart component if JS loads, renders a simple FakeChart
6
+ * component server-side or if there is no JS. The FakeChart can have only the
7
+ * UI without the behavior or be a loading spinner or skeleton.
8
+ * ```tsx
9
+ * return (
10
+ * <ClientOnly fallback={<FakeChart />}>
11
+ * {() => <Chart />}
12
+ * </ClientOnly>
13
+ * );
14
+ * ```
15
+ */
16
+ function ClientOnly({ children, fallback = null }) {
17
+ return useHydrated() ? jsx(Fragment, { children: children() }) : jsx(Fragment, { children: fallback });
18
+ }export{ClientOnly};//# sourceMappingURL=Client-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Client-only.js","sources":["../../src/hooks/Client-only.tsx"],"sourcesContent":[null],"names":[],"mappings":"yFAII;;;;AAIG;AACH;AACA;;AAGJ;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ import { useSettingsLoader, useSetting, usePermissionAutoFetch } from '@adminide-stack/platform-client';
2
+ export { useSettingsLoader, useSetting, usePermissionAutoFetch };
3
+ export * from './Client-only';
4
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAExG,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,sBAAsB,EAAE,CAAC;AACjE,cAAc,eAAe,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './useLayoutSettings';
2
+ export * from './hooks';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Return a boolean indicating if the JS has been hydrated already.
3
+ * When doing Server-Side Rendering, the result will always be false.
4
+ * When doing Client-Side Rendering, the result will always be false on the
5
+ * first render and true from then on. Even if a new component renders it will
6
+ * always start with true.
7
+ *
8
+ * Example: Disable a button that needs JS to work.
9
+ * ```tsx
10
+ * let hydrated = useHydrated();
11
+ * return (
12
+ * <button type="button" disabled={!hydrated} onClick={doSomethingCustom}>
13
+ * Click me
14
+ * </button>
15
+ * );
16
+ * ```
17
+ */
18
+ export declare function useHydrated(): boolean;
19
+ //# sourceMappingURL=use-hydrated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-hydrated.d.ts","sourceRoot":"","sources":["../../src/hooks/use-hydrated.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,YAM1B"}
@@ -0,0 +1,24 @@
1
+ import {useSyncExternalStore}from'react';function subscribe() {
2
+ // biome-ignore lint/suspicious/noEmptyBlockStatements: Mock function
3
+ return () => { };
4
+ }
5
+ /**
6
+ * Return a boolean indicating if the JS has been hydrated already.
7
+ * When doing Server-Side Rendering, the result will always be false.
8
+ * When doing Client-Side Rendering, the result will always be false on the
9
+ * first render and true from then on. Even if a new component renders it will
10
+ * always start with true.
11
+ *
12
+ * Example: Disable a button that needs JS to work.
13
+ * ```tsx
14
+ * let hydrated = useHydrated();
15
+ * return (
16
+ * <button type="button" disabled={!hydrated} onClick={doSomethingCustom}>
17
+ * Click me
18
+ * </button>
19
+ * );
20
+ * ```
21
+ */
22
+ function useHydrated() {
23
+ return useSyncExternalStore(subscribe, () => true, () => false);
24
+ }export{useHydrated};//# sourceMappingURL=use-hydrated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-hydrated.js","sources":["../../src/hooks/use-hydrated.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;AAuBG;AACH;;;;;;;"}
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{getAntdLocale}from'./utils/getAntdLocale.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{defaultSettings}from'./config/defaultSettings.js';export{ThemeProvider,getTheme}from'./antd-themes/ThemeProvider.js';export{airbnbDarkTheme}from'./antd-themes/airbnb-dark-theme.js';export{airbnbLightTheme}from'./antd-themes/airbnb-light-theme.js';export{colorList,getThemeColors}from'./antd-themes/colors.js';export{defaultDarkTheme}from'./antd-themes/default-dark-theme.js';export{defaultLightTheme}from'./antd-themes/default-light-theme.js';export{githubDarkTheme}from'./antd-themes/github-dark-theme.js';export{githubLightTheme}from'./antd-themes/github-light-theme.js';export{slackDarkTheme}from'./antd-themes/slack-dark-theme.js';export{slackLightTheme}from'./antd-themes/slack-light-theme.js';export{spotifyDarkTheme}from'./antd-themes/spotify-dark-theme.js';export{spotifyLightTheme}from'./antd-themes/spotify-light-theme.js';export{themeRegistry}from'./antd-themes/themeRegistry.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';//# sourceMappingURL=index.js.map
1
+ export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{getAntdLocale}from'./utils/getAntdLocale.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{defaultSettings}from'./config/defaultSettings.js';export{ThemeProvider,getTheme}from'./antd-themes/ThemeProvider.js';export{airbnbDarkTheme}from'./antd-themes/airbnb-dark-theme.js';export{airbnbLightTheme}from'./antd-themes/airbnb-light-theme.js';export{colorList,getThemeColors}from'./antd-themes/colors.js';export{defaultDarkTheme}from'./antd-themes/default-dark-theme.js';export{defaultLightTheme}from'./antd-themes/default-light-theme.js';export{githubDarkTheme}from'./antd-themes/github-dark-theme.js';export{githubLightTheme}from'./antd-themes/github-light-theme.js';export{slackDarkTheme}from'./antd-themes/slack-dark-theme.js';export{slackLightTheme}from'./antd-themes/slack-light-theme.js';export{spotifyDarkTheme}from'./antd-themes/spotify-dark-theme.js';export{spotifyLightTheme}from'./antd-themes/spotify-light-theme.js';export{themeRegistry}from'./antd-themes/themeRegistry.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';export{usePermissionAutoFetch,useSetting,useSettingsLoader}from'@adminide-stack/platform-client';export{ClientOnly}from'./hooks/Client-only.js';//# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/client",
3
- "version": "10.0.9-alpha.42",
3
+ "version": "10.0.9-alpha.49",
4
4
  "description": "Sample client for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@common-stack/client-core": "7.1.1-alpha.14",
27
- "common": "10.0.9-alpha.9",
27
+ "common": "10.0.9-alpha.49",
28
28
  "serialize-error": "^8.0.0"
29
29
  },
30
30
  "peerDependencies": {
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "b09941b42df7f01e61709f28c23626ecbbc2c105",
40
+ "gitHead": "28e95aab1a57bc63f377a7ea7e078ab94ccbf71b",
41
41
  "typescript": {
42
42
  "definition": "lib/index.d.ts"
43
43
  }