@admin-layout/client 10.0.9-alpha.65 → 10.0.9-alpha.67

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.
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutCookieProvider.d.ts","sourceRoot":"","sources":["../../src/components/LayoutCookieProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CAqBhG"}
1
+ {"version":3,"file":"LayoutCookieProvider.d.ts","sourceRoot":"","sources":["../../src/components/LayoutCookieProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAQ1D,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CAqBhG"}
@@ -1,15 +1,15 @@
1
- import {jsx,Fragment}from'react/jsx-runtime';import {useEffect}from'react';import {useDispatch}from'react-redux';import {useLoaderData}from'@remix-run/react';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';function LayoutCookieProvider({ children }) {
1
+ import {jsx,Fragment}from'react/jsx-runtime';import {useLayoutEffect}from'react';import {useDispatch}from'react-redux';import {useLoaderData}from'@remix-run/react';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {defaultSettings}from'../config/defaultSettings.js';import {merge}from'lodash-es';function LayoutCookieProvider({ children }) {
2
2
  const { settings } = useLoaderData();
3
3
  const dispatch = useDispatch();
4
4
  const changeSettings = () => {
5
5
  if (settings) {
6
6
  dispatch({
7
7
  type: CHANGE_SETTINGS_ACTION,
8
- payload: settings,
8
+ payload: merge({}, defaultSettings, settings),
9
9
  });
10
10
  }
11
11
  };
12
- useEffect(() => {
12
+ useLayoutEffect(() => {
13
13
  changeSettings();
14
14
  }, [settings, dispatch]);
15
15
  if (typeof window === 'undefined') {
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAS/C,wBAAsB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC;IACjF,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAE,CAYF;AAED,eAAO,MAAM,MAAM,gBAAuB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,oEAiB7D,CAAC;AAEF,eAAO,MAAM,MAAM,gBAAuB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE;;GAO7D,CAAC"}
1
+ {"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAW/C,wBAAsB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC;IACjF,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC,CA2BD;AAED,eAAO,MAAM,MAAM,gBAAuB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,oEAsC7D,CAAC;AAEF,eAAO,MAAM,MAAM,gBAAuB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE;;GAkB7D,CAAC"}
@@ -1,41 +1,88 @@
1
- import {createCookie,json}from'@remix-run/node';import {pick,keys}from'lodash-es';import {config}from'../../config/env-config.js';import {defaultSettings}from'../../config/defaultSettings.js';const settingsCookie = createCookie('settings', {
1
+ import {createCookie,json}from'@remix-run/node';import {merge}from'lodash-es';import {config}from'../../config/env-config.js';import {defaultSettings}from'../../config/defaultSettings.js';import'react';import'common';import'@cdm-logger/client';import'i18next';import'antd/lib/locale/en_US.js';import'antd/lib/locale/zh_CN.js';import'antd/lib/locale/fr_FR.js';import'antd/lib/locale/es_ES.js';import'antd/lib/locale/de_DE.js';import {compareAndSaveSettingsDifferences}from'../../utils/settingsDifference.js';const settingsCookie = createCookie('settings', {
2
2
  maxAge: 60 * 60 * 24 * 30, // 1 month
3
- httpOnly: true,
3
+ httpOnly: false, // Allow client-side access
4
4
  sameSite: 'lax',
5
+ path: '/', // Ensure cookie is available for all paths
5
6
  domain: config.isProd ? config.APP_DOMAIN : undefined,
6
7
  });
7
8
  async function settingsLoaderUtil({ request }) {
8
9
  const cookieHeader = request.headers.get('Cookie');
9
- const settings = await settingsCookie.parse(cookieHeader);
10
+ let settings;
11
+ try {
12
+ settings = await settingsCookie.parse(cookieHeader);
13
+ console.log('Parsed cookie settings:', settings);
14
+ }
15
+ catch (error) {
16
+ console.error('Error parsing settings cookie:', error);
17
+ settings = null;
18
+ }
19
+ // If no settings in cookie, generate default settings
10
20
  if (!settings) {
11
- const updatedSettings = {
12
- ...defaultSettings,
13
- };
14
- const cookie = await settingsCookie.serialize(updatedSettings);
15
- return { settings: updatedSettings, setCookie: cookie };
21
+ const fullSettings = merge({}, defaultSettings, config.LAYOUT_SETTINGS);
22
+ // Only store differences to keep cookie size small
23
+ const diffSettings = await compareAndSaveSettingsDifferences(fullSettings, defaultSettings);
24
+ const cookie = await settingsCookie.serialize(diffSettings);
25
+ return { settings: fullSettings, setCookie: cookie };
16
26
  }
17
- return { settings, setCookie: null };
27
+ // Merge cookie settings with defaults to get complete settings
28
+ const fullSettings = merge({}, defaultSettings, config.LAYOUT_SETTINGS, settings);
29
+ // Refresh the cookie to keep it active
30
+ const cookie = await settingsCookie.serialize(settings);
31
+ return { settings: fullSettings, setCookie: cookie };
18
32
  }
19
33
  const action = async ({ request }) => {
20
- const jsonData = await request.json();
21
- const payload = jsonData?.config;
22
- const cookieHeader = request.headers.get('Cookie');
23
- const settings = await settingsCookie.parse(cookieHeader);
24
- const updatedSettings = {
25
- ...settings,
26
- ...pick(payload, keys(config.LAYOUT_SETTINGS)),
27
- };
28
- return json(updatedSettings, {
29
- headers: {
30
- 'Set-Cookie': await settingsCookie.serialize(updatedSettings),
31
- },
32
- });
34
+ try {
35
+ const jsonData = await request.json();
36
+ const payload = jsonData?.config || {};
37
+ const cookieHeader = request.headers.get('Cookie');
38
+ let existingSettings;
39
+ try {
40
+ existingSettings = await settingsCookie.parse(cookieHeader);
41
+ }
42
+ catch (error) {
43
+ console.error('Error parsing settings cookie in action:', error);
44
+ existingSettings = null;
45
+ }
46
+ // Compare payload and existingSettings, add missing keys from existingSettings to payload with default value
47
+ if (existingSettings) {
48
+ Object.keys(existingSettings).forEach((key) => {
49
+ if (!(key in payload)) {
50
+ payload[key] = defaultSettings[key];
51
+ }
52
+ });
53
+ }
54
+ // Merge everything together
55
+ const fullSettings = merge({}, defaultSettings, config.LAYOUT_SETTINGS, existingSettings || {}, payload);
56
+ // Store only differences from default
57
+ const diffSettings = await compareAndSaveSettingsDifferences(fullSettings, defaultSettings);
58
+ // Create a new cookie with the diff settings
59
+ const newCookie = await settingsCookie.serialize(diffSettings);
60
+ return json(fullSettings, {
61
+ headers: {
62
+ 'Set-Cookie': newCookie,
63
+ },
64
+ });
65
+ }
66
+ catch (error) {
67
+ console.error('Error in action:', error);
68
+ return json({ error: 'Failed to update settings' }, { status: 500 });
69
+ }
33
70
  };
34
71
  const loader = async ({ request }) => {
35
- const { settings, setCookie } = await settingsLoaderUtil({ request });
36
- return json({ settings }, {
37
- headers: {
38
- 'Set-Cookie': setCookie,
39
- },
40
- });
72
+ try {
73
+ const { settings, setCookie } = await settingsLoaderUtil({ request });
74
+ // Always include headers, but only set cookie if provided
75
+ const headers = {};
76
+ if (setCookie) {
77
+ headers['Set-Cookie'] = setCookie;
78
+ }
79
+ return json({ settings }, { headers });
80
+ }
81
+ catch (error) {
82
+ console.error('Error in settings loader:', error);
83
+ // Fall back to default settings
84
+ return json({
85
+ settings: merge({}, defaultSettings, config.LAYOUT_SETTINGS),
86
+ });
87
+ }
41
88
  };export{action,loader,settingsLoaderUtil};//# sourceMappingURL=UpdateSettings.server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":"gMAa0E,oBAAW,GAAA,YAAA,CAAA,UAAA,EAAA;IACjF,MAAQ,EAAA,EAAE,aAAY,EAAA;IACtB,QAAS,EAAA;AACZ,IAYA,QAAA,EAAA,KAAA;AAED,IAAO,MAAA,EAAA,MAAA,CAAA,SAAmC,MAAA,CAAA,UAAA,GAAA,SAAA;;AAAoB,eAAA,kBAAA,CAAA,EAAA,OAAA,EAAA,EAAA;AAmB9D,IAAO,MAAA,sBAAmC,CAAA,OAAA,CAAA,GAAA,CAAA,QAAA,CAAA;IAAE,MAAO,WAAS,MAAA,cAAA,CAAA,KAAA,CAAA,YAAA,CAAA;AAAE,IAAA,IAAA,CAAA,QAAA,EAAA;;YAO5D,GAAA,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":"igBAeY,6BAAc,CAAA,UAAA,EAAA;IACtB,MAAS,EAAA,EAAA,QAAS,EAAA,GAAA,EAAA;AACrB,IA2BA,QAAA,EAAA,KAAA;AAED,IAAO,QAAA,EAAA,KAAA;IAAqC,IAAO,EAAA,GAAE;AAAS,IAAA,MAAA,EAAA,MAAA,CAAA,MAAA,GAAA,MAAA,CAAA,UAAA,GAAA,SAAA;AAwC9D,CAAO,CAAA;AAA4C,eAAS,kBAAA,CAAA,EAAA,OAAA,EAAA,EAAA;AAAE,IAAA,MAAA,YAAA,GAAA,OAAA,CAAA,OAAA,CAAA,GAAA,CAAA,QAAA,CAAA;;IAkB5D,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -75,6 +75,13 @@ export type ISettings = ProSettings & {
75
75
  searchBarOverlay: boolean;
76
76
  scrollThreshold: number;
77
77
  };
78
+ background: {
79
+ type: string;
80
+ color: string;
81
+ image: string;
82
+ video: string;
83
+ videoThumbnail: string;
84
+ };
78
85
  footer: {
79
86
  showFooter: boolean;
80
87
  };
@@ -100,6 +107,12 @@ export type ISettings = ProSettings & {
100
107
  searchBarOverlay: boolean;
101
108
  scrollThreshold: number;
102
109
  };
110
+ background: {
111
+ type: string;
112
+ color: string;
113
+ image: string;
114
+ video: string;
115
+ };
103
116
  footer: {
104
117
  showFooter: boolean;
105
118
  };
@@ -1 +1 @@
1
- {"version":3,"file":"defaultSettings.d.ts","sourceRoot":"","sources":["../../src/config/defaultSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAuE3D,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAA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AAiB,CAAC;oBACrC,gBAAgB,EAAE,OAAO,CAAC;oBAC1B,eAAe,EAAE,MAAM,CAAC;iBAC3B,CAAC;gBACF,UAAU,EAAE;oBACR,IAAI,EAAE,MAAM,CAAC;oBACb,KAAK,EAAE,MAAM,CAAC;oBACd,KAAK,EAAE,MAAM,CAAC;oBACd,KAAK,EAAE,MAAM,CAAC;iBACjB,CAAC;gBACF,MAAM,EAAE;oBACJ,UAAU,EAAE,OAAO,CAAC;iBACvB,CAAC;aACL,CAAC;SACL,CAAC;KACL,CACJ,CAAC;IACF,UAAU,EAAE,GAAG,EAAE,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SA6G7B,CAAC"}
@@ -59,6 +59,13 @@ const SHARED_VIEW_CONFIG = {
59
59
  showSearchSlot: true,
60
60
  height: '64px',
61
61
  },
62
+ background: {
63
+ type: 'color',
64
+ color: 'inherit',
65
+ image: '',
66
+ video: '',
67
+ videoThumbnail: '',
68
+ },
62
69
  footer: { showFooter: true },
63
70
  },
64
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;AACA;AAuEA,MAAM,cAAM,GAAY;IACpB,YAAY,EAAC,OAAA;IACb,WAAgB,EAAA,IAAA;IAChB,YAAc,EAAA;IACd,UAAU,EAAE;;MAEF,iBAAS;IACnB,QAAe,EAAA,IAAA;IACf,sBAAoB;IACpB,cAAa;IACb,cAAc,EAAE;IAChB,aAAY;IACZ,uBAAsB;IACtB,QAAS,EAAA,OAAQ;IACjB,eAAc,EAAA,SAAA;IACd,SAAS,EAAE;IACX,UAAe,EAAA,IAAA;IACf,QAAiB,EAAA,IAAA;IACjB,sBAAqB;IACrB,eAAoB,EAAA,IAAA;IACpB,iBAAgB,mBAAS,CAAA,SAAA;IACzB,gBAAkB,EAAA;IAClB,eAAyB,EAAA,EAAA;;MAED,YAAA,GAAA;IACxB,MAAiB,EAAA,QAAA;IACjB,OAAY,EAAA;AACZ,IAAA,IAAA,EAAA,MAAA;AAGQ,CAAA;AACI,MAAA,SAAA,GAAA;;;;sBAIe;;;;;;cAMb;AACF,IAAA,SAAA;;;;wBAIe,GAAA;;yBAED;sBACU,EAAA,OAAA;oBACC,EAAA,UAAA;4BACD,EAAA;6BACtB,EAAA,WAAA;4BACJ,EAAA,OAAA;AACF,KAAA;AACI,IAAA,OAAA,EAAA;AACI,QAAA,MAAA,EAAA;6BACY;0BACM,EAAA,IAAA;oBACd,MAAgB;;4BAEF,EAAA,IAAA,EAAE;;;qBAGR;6EACO;sBACA;oBACf;2BACU;2BACF;oBACR,SAAgB;;gCAEC,CAAA;+BACD,CAAA;+BACD,CAAA,YAAS;oBAC1B;AACF,IAAA,KAAA,EAAA,aAAQ;;oBAEN,EAAA,IAAA;cACJ,EAAA,SAAA;AACF,IAAA,QAAA,EAAA,OAAQ;AACJ,IAAA,UAAA,EAAA,qBAAQ;qBACI,KAAA;uBACM;2BACE;oBAChB,KAAc;0BACA;qBACD,MAAA;qBACI,EAAA,QAAA;gEACA;wBACX,EAAA;oBACN,EAAe,QAAA;sBACN,EAAA,EAAA;6BACC,EAAA;2BACF,EAAA,2FAAU;4BACF,EAAA,KAAA;qBACD;;;oBAGf;uBACF,EAAA,kBAAA,CAAA,MAAA;AACF,gBAAA,MAAM,EAAE,kBAAA,CAAA,MAAA;;mBAEN,EAAA;gBACJ,OAAA,EAAA,kBAAA,CAAA,OAAA;gBACJ,MAAA,EAAA,kBAAA,CAAA,OAAA;AACL,aACH;SACQ;AACV,KAAA;IACF,UAAA,EAAA,EAAA;AAEF,IAAA,eAAa,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"m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AA;gEACA;wBACX,EAAA;oBACN,EAAe,QAAA;sBACN,EAAA,EAAA;6BACC,EAAA;2BACF,EAAA,2FAAU;4BACF,EAAA,KAAA;qBACD;;;oBAGf;uBACF,EAAA,kBAAA,CAAA,MAAA;AACF,gBAAA,MAAA,EAAA,kBAAY,CAAA,MAAA;;qBAEH;uBACA,EAAA,kBAAS,CAAA,OAAA;sBACT,EAAA,kBAAS,CAAA,OAAA;;AAElB,SAAA;;kBAEE;mBACJ,EAAA,IAAA;qBACJ,EAAA;AACL,QACH,iBAAA,EAAA;YACQ,CAAA,YAAQ,CAAA,MAAA,GAAA,IAAA;AAClB,YAAA,CAAA,YAAiB,CAAA,OAAS,GAAK,IAAA;YACjC,CAAA,YAAA,CAAA,IAAA,GAAA,IAAA;AAEF,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMhD,QAAA,MAAM,SAAS;;;gCAKb,CAAC;AACH,QAAA,IAAI,MAAM,EAAS,OAAO,SAAS,CAAC;AAQpC,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOhD,QAAA,MAAM,SAAS;;;gCAKb,CAAC;AACH,QAAA,IAAI,MAAM,EAAS,OAAO,SAAS,CAAC;AAepC,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import*as envalid from'envalid';import {getEnvironment}from'@common-stack/core';import {defaultSettings}from'./defaultSettings.js';const { json } = envalid;
1
+ import*as envalid from'envalid';import {getEnvironment}from'@common-stack/core';import {defaultSettings}from'./defaultSettings.js';import {merge}from'lodash-es';const { json } = envalid;
2
2
  const env = getEnvironment();
3
3
  const preConfig = envalid.cleanEnv(env, {
4
4
  LAYOUT_SETTINGS: json({
@@ -7,9 +7,16 @@ const preConfig = envalid.cleanEnv(env, {
7
7
  APP_DOMAIN: envalid.str({ default: 'cdebase.dev' }),
8
8
  });
9
9
  let config = {};
10
- // overwrite the layout settings with environment
10
+ // Parse the LAYOUT_SETTINGS if it exists in the environment
11
11
  if (env.LAYOUT_SETTINGS) {
12
- config = { ...preConfig, LAYOUT_SETTINGS: { ...defaultSettings, ...preConfig.LAYOUT_SETTINGS } };
12
+ try {
13
+ const parsedLayoutSettings = JSON.parse(env.LAYOUT_SETTINGS);
14
+ config = { ...preConfig, LAYOUT_SETTINGS: merge({}, defaultSettings, parsedLayoutSettings) };
15
+ }
16
+ catch (error) {
17
+ console.error('Error parsing LAYOUT_SETTINGS:', error);
18
+ config = preConfig;
19
+ }
13
20
  }
14
21
  else {
15
22
  config = preConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":";;kCAaG,CAAA,GAAA,EAAA;AACH,IAAA,eAAmB,EAAA,IAAA,CAAA;AAQnB,QAAO,OAAQ,EAAE,IAAC,CAAA,SAAA,CAAA,eAAA,CAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAeA,MAAA,SAAI,GAAM,OAAS,CAAA,YAAiB,EAAA;AAepC,IAAO,eAAW,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,6 @@
1
1
  export declare const useLayoutSettings: () => {
2
2
  settings: any;
3
3
  setSettings: (config: any) => Promise<any>;
4
+ getSettings: () => Promise<any>;
4
5
  };
5
6
  //# sourceMappingURL=useLayoutSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB;;0BA2DP,GAAG;CA+CzB,CAAC"}
1
+ {"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB;;0BA4BP,GAAG;;CA4CzB,CAAC"}
@@ -1,4 +1,4 @@
1
- import {useEffect,useCallback}from'react';import {useDispatch,useSelector}from'react-redux';import {merge}from'lodash-es';import {defaultSettings}from'../config/defaultSettings.js';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {compareAndSaveSettingsDifferences}from'../utils/settingsDifference.js';const updateColorWeak = (colorWeak) => {
1
+ import {useCallback}from'react';import {useDispatch,useSelector}from'react-redux';import {merge}from'lodash-es';import {defaultSettings}from'../config/defaultSettings.js';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {compareAndSaveSettingsDifferences}from'../utils/settingsDifference.js';const updateColorWeak = (colorWeak) => {
2
2
  // @sri to avoid breaking during SSR, split into to checks
3
3
  if (typeof window !== 'undefined') {
4
4
  const root = document.getElementById('root');
@@ -10,18 +10,6 @@ import {useEffect,useCallback}from'react';import {useDispatch,useSelector}from'r
10
10
  const useLayoutSettings = () => {
11
11
  const dispatch = useDispatch();
12
12
  const settings = useSelector((state) => state.settings);
13
- useEffect(() => {
14
- if (!settings || Object.keys(settings).length === 0) {
15
- void getSettings().then((settingsData) => {
16
- if (settingsData) {
17
- dispatch({
18
- type: CHANGE_SETTINGS_ACTION,
19
- payload: settingsData,
20
- });
21
- }
22
- });
23
- }
24
- }, [dispatch, settings]);
25
13
  const getSettings = useCallback(async () => {
26
14
  try {
27
15
  const response = await fetch('/resources/settings', {
@@ -34,20 +22,7 @@ const useLayoutSettings = () => {
34
22
  throw new Error('Failed to fetch settings');
35
23
  }
36
24
  const diffSettings = await response.json();
37
- // Deep merge the differences with default settings
38
- const mergedSettings = merge({}, defaultSettings, diffSettings);
39
- // Ensure route settings are properly merged
40
- if (diffSettings.routeSettings) {
41
- Object.keys(diffSettings.routeSettings).forEach((route) => {
42
- if (defaultSettings.routeSettings[route]) {
43
- mergedSettings.routeSettings[route] = merge({}, defaultSettings.routeSettings[route], diffSettings.routeSettings[route]);
44
- }
45
- else {
46
- mergedSettings.routeSettings[route] = diffSettings.routeSettings[route];
47
- }
48
- });
49
- }
50
- return mergedSettings;
25
+ return diffSettings.settings;
51
26
  }
52
27
  catch (error) {
53
28
  console.error(error);
@@ -65,9 +40,7 @@ const useLayoutSettings = () => {
65
40
  }
66
41
  }
67
42
  updateColorWeak(!!colorWeak);
68
- // Use the improved difference comparison and saving function
69
43
  const cleanDiffSettings = compareAndSaveSettingsDifferences(config, defaultSettings);
70
- console.log('cleanDiffSettings >>>>>>>>>>>>>>', cleanDiffSettings);
71
44
  const response = await fetch('/resources/settings', {
72
45
  method: 'POST',
73
46
  headers: {
@@ -79,7 +52,6 @@ const useLayoutSettings = () => {
79
52
  throw new Error('Failed to update settings');
80
53
  }
81
54
  const result = await response.json();
82
- console.log('result >>>>>>>>>>>>>>', result);
83
55
  // Merge the full config with default settings before updating the store
84
56
  const mergedSettings = merge({}, defaultSettings, config);
85
57
  dispatch({
@@ -92,5 +64,5 @@ const useLayoutSettings = () => {
92
64
  return null;
93
65
  }
94
66
  }, [dispatch, settings]);
95
- return { settings, setSettings };
67
+ return { settings, setSettings, getSettings };
96
68
  };export{useLayoutSettings};//# sourceMappingURL=useLayoutSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{SearchBarBehavior}from'./interfaces/settings.js';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
1
+ export{SearchBarBehavior}from'./interfaces/settings.js';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{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.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
@@ -1 +1 @@
1
- export{SearchBarBehavior}from'./interfaces/settings.js';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';//# sourceMappingURL=index.native.js.map
1
+ export{SearchBarBehavior}from'./interfaces/settings.js';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{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.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';//# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateMenuLink.d.ts","sourceRoot":"","sources":["../../src/utils/generateMenuLink.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,gBAAgB,oCA2B5B,CAAC"}
1
+ {"version":3,"file":"generateMenuLink.d.ts","sourceRoot":"","sources":["../../src/utils/generateMenuLink.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,gBAAgB,oCAa5B,CAAC"}
@@ -67,24 +67,12 @@ function generatePath(originalPath, params) {
67
67
  return prefix + segments.join('/');
68
68
  }
69
69
  const generateMenuPath = (path, params) => {
70
- // Check if all required parameters exist before attempting to generate the path
71
- const requiredParams = [];
72
- path.split('/').forEach((segment) => {
73
- if (segment.startsWith(':') && !segment.endsWith('?')) {
74
- const paramName = segment.substring(1);
75
- requiredParams.push(paramName);
76
- }
77
- });
78
- // If any required parameter is missing, return null immediately
79
- const missingParams = requiredParams.filter((param) => params[param] === undefined);
80
- if (missingParams.length > 0) {
81
- return null;
82
- }
83
70
  try {
84
71
  const generatedPath = generatePath(path, params);
85
72
  return generatedPath;
86
73
  }
87
74
  catch (err) {
75
+ console.error('Error generating path:', err);
88
76
  console.log('Path:', path);
89
77
  console.log('Params:', params);
90
78
  console.warn(`menu path ${path} is errored due to missing params. If it is not required, please use hidemenu option`);
@@ -1 +1 @@
1
- {"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAO,SAAA,CAAA,KAAsB,EAAA,OAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAO,SAAA,CAAA,KAAsB,EAAA,OAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,4 +5,5 @@ export * from './menuUtils';
5
5
  export * from './matchMenuKeys';
6
6
  export * from './getAntdLocale';
7
7
  export * from './generateMenuLink';
8
+ export * from './settingsDifference';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
@@ -166,7 +166,7 @@ const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) =>
166
166
  }
167
167
  // If there are no differences at all, return early
168
168
  if (Object.keys(diffSettings).length === 0) {
169
- return { success: true, message: 'No changes to save' };
169
+ return {};
170
170
  }
171
171
  // Remove empty objects from the diff
172
172
  // This helps prevent unnecessary properties in the payload
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/client",
3
- "version": "10.0.9-alpha.65",
3
+ "version": "10.0.9-alpha.67",
4
4
  "description": "Sample client for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "ff6ea4882047f02ed426382828e8ec5e063317ed",
40
+ "gitHead": "f7ada2c4bfede9df31d8cc4da070d2f8ed85dd62",
41
41
  "typescript": {
42
42
  "definition": "lib/index.d.ts"
43
43
  }