@blocklet/pages-kit 0.4.125 → 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.
- package/lib/cjs/components/CustomComponentRenderer/state.js +2 -14
- package/lib/cjs/contexts/color.js +14 -7
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/common.js +11 -0
- package/lib/cjs/utils/preload.js +1 -0
- package/lib/cjs/utils/property.js +1 -1
- package/lib/cjs/utils/style.js +3 -12
- package/lib/esm/components/CustomComponentRenderer/state.js +2 -14
- package/lib/esm/contexts/color.js +14 -7
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/common.js +10 -0
- package/lib/esm/utils/preload.js +1 -0
- package/lib/esm/utils/property.js +1 -1
- package/lib/esm/utils/style.js +2 -11
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/common.d.ts +4 -0
- package/lib/types/utils/style.d.ts +2 -4
- package/package.json +1 -1
|
@@ -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 &&
|
|
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
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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'],
|