@blocklet/pages-kit 0.4.105 → 0.4.107
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/index.js +9 -5
- package/lib/cjs/components/CustomComponentRenderer/state.js +11 -4
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/property.js +7 -7
- package/lib/esm/components/CustomComponentRenderer/index.js +9 -5
- package/lib/esm/components/CustomComponentRenderer/state.js +11 -4
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/property.js +7 -4
- package/lib/types/components/CustomComponentRenderer/state.d.ts +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import isNil from 'lodash/isNil';
|
|
2
1
|
import * as yaml from 'yaml';
|
|
3
2
|
import { isBrowserEnv, COLOR_CONVERT_FUNCTION_NAME } from './common';
|
|
4
3
|
export function componentUMDName({ componentId }) {
|
|
@@ -97,11 +96,15 @@ export function parsePropertyValue(property, value, { locale, defaultLocale, pro
|
|
|
97
96
|
...(propertyHandlers ?? {}),
|
|
98
97
|
};
|
|
99
98
|
if (mixedPropertyHandlers && property.type && typeof mixedPropertyHandlers[property.type] === 'function') {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
try {
|
|
100
|
+
const handler = mixedPropertyHandlers[property.type];
|
|
101
|
+
const result = handler?.(value);
|
|
103
102
|
return result;
|
|
104
103
|
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
console.error('parse property value in handler error', error);
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
105
108
|
}
|
|
106
109
|
if (property.type === 'json') {
|
|
107
110
|
if (!value)
|
|
@@ -24,7 +24,7 @@ export type CustomComponentType<T = any> = ComponentType<T> & {
|
|
|
24
24
|
};
|
|
25
25
|
export declare function getPropertiesFromCode(m: any): any;
|
|
26
26
|
export declare const customComponentStates: () => UseBoundStore<StoreApi<CustomComponentStates>>;
|
|
27
|
-
export declare function useComponent({ instanceId, componentId, properties, locale, dev }: CustomComponentRendererProps): {
|
|
27
|
+
export declare function useComponent({ instanceId, componentId, properties, locale, dev, props, }: CustomComponentRendererProps): {
|
|
28
28
|
error?: Error;
|
|
29
29
|
Component?: CustomComponentType;
|
|
30
30
|
EditComponent?: CustomComponentType;
|