@blocklet/pages-kit 0.4.124 → 0.4.126

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.
@@ -49,7 +49,7 @@ const PRELOAD_COMPONENTS_STATE = window[preload_1.PreloadComponentsStateGlobalVa
49
49
  let states;
50
50
  function importCustomComponent(m, { componentId }) {
51
51
  // check if m is a Promise
52
- if (m && typeof m.then === 'function') {
52
+ if (m && m instanceof Promise) {
53
53
  // handle Promise case
54
54
  return (props) => {
55
55
  const [loading, setLoading] = (0, react_1.useState)(true);
@@ -188,19 +188,7 @@ const customComponentStates = () => {
188
188
  if (typeof m === 'function') {
189
189
  try {
190
190
  const modulePromiseOrObject = m();
191
- // if the module is a promise, we need to wait for it to resolve
192
- if (modulePromiseOrObject instanceof Promise) {
193
- modulePromiseOrObject
194
- .then((m) => {
195
- Component = importCustomComponent(m, { componentId });
196
- })
197
- .catch((err) => {
198
- console.error(`Failed to initialize component ${componentId}:`, err);
199
- });
200
- }
201
- else {
202
- Component = importCustomComponent(modulePromiseOrObject, { componentId });
203
- }
191
+ Component = importCustomComponent(modulePromiseOrObject, { componentId });
204
192
  }
205
193
  catch (err) {
206
194
  console.error(`Failed to initialize component ${componentId}:`, err);
@@ -33,6 +33,13 @@ function useMuiColorPalette() {
33
33
  format: (key, variant) => `${key}.${variant}`,
34
34
  accessor: (key) => theme.palette[key],
35
35
  })),
36
+ // {
37
+ // type: 'did',
38
+ // keys: ['primary', 'secondary'],
39
+ // variants: null,
40
+ // format: (key: string) => `did.${key}`,
41
+ // accessor: () => theme.palette.did,
42
+ // },
36
43
  {
37
44
  type: 'background',
38
45
  keys: ['default', 'paper'],
@@ -47,13 +54,13 @@ function useMuiColorPalette() {
47
54
  format: (key) => `text.${key}`,
48
55
  accessor: () => theme.palette.text,
49
56
  },
50
- {
51
- type: 'action',
52
- keys: ['active', 'hover', 'selected', 'disabled', 'disabledBackground', 'focus'],
53
- variants: null,
54
- format: (key) => `action.${key}`,
55
- accessor: () => theme.palette.action,
56
- },
57
+ // {
58
+ // type: 'action',
59
+ // keys: ['active', 'hover', 'selected', 'disabled', 'disabledBackground', 'focus'],
60
+ // variants: null,
61
+ // format: (key: string) => `action.${key}`,
62
+ // accessor: () => theme.palette.action,
63
+ // },
57
64
  {
58
65
  type: 'grey',
59
66
  keys: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],