@blocklet/pages-kit 0.4.32 → 0.4.34

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.
Files changed (50) hide show
  1. package/lib/cjs/api/call.js +7 -18
  2. package/lib/cjs/api/pages-kit.js +5 -17
  3. package/lib/cjs/builtin/async/react-scroll-to-bottom.js +5 -1
  4. package/lib/cjs/builtin/components/LanguageField/index.js +6 -18
  5. package/lib/cjs/builtin/iconify/react.js +1 -1
  6. package/lib/cjs/builtin/page/header.js +8 -5
  7. package/lib/cjs/builtin/session.js +6 -0
  8. package/lib/cjs/builtin/stream.js +1 -1
  9. package/lib/cjs/builtin/utils.js +3 -5
  10. package/lib/cjs/components/CustomComponentRenderer/BlockletReactComponentRenderer.js +5 -19
  11. package/lib/cjs/components/CustomComponentRenderer/DevProvider.js +2 -14
  12. package/lib/cjs/components/CustomComponentRenderer/ErrorComponent.js +2 -14
  13. package/lib/cjs/components/CustomComponentRenderer/index.js +12 -27
  14. package/lib/cjs/components/CustomComponentRenderer/state.js +121 -151
  15. package/lib/cjs/components/ResponsiveImage/index.js +3 -16
  16. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  17. package/lib/cjs/utils/inject-es-module-shims-options.js +1 -2
  18. package/lib/cjs/utils/inject-global-components-dump-json.js +1 -1
  19. package/lib/cjs/utils/inject-global-components.js +29 -20
  20. package/lib/cjs/utils/preload.js +1 -15
  21. package/lib/cjs/utils/property.js +31 -25
  22. package/lib/cjs/utils/typescript/builtin-module-transformer.js +12 -9
  23. package/lib/esm/api/call.js +7 -18
  24. package/lib/esm/api/pages-kit.js +5 -17
  25. package/lib/esm/builtin/async/react-scroll-to-bottom.js +5 -1
  26. package/lib/esm/builtin/components/LanguageField/index.js +6 -18
  27. package/lib/esm/builtin/iconify/react.js +1 -1
  28. package/lib/esm/builtin/page/header.js +8 -5
  29. package/lib/esm/builtin/session.js +5 -0
  30. package/lib/esm/builtin/stream.js +1 -1
  31. package/lib/esm/builtin/utils.js +3 -5
  32. package/lib/esm/components/CustomComponentRenderer/BlockletReactComponentRenderer.js +5 -19
  33. package/lib/esm/components/CustomComponentRenderer/DevProvider.js +2 -14
  34. package/lib/esm/components/CustomComponentRenderer/ErrorComponent.js +2 -14
  35. package/lib/esm/components/CustomComponentRenderer/index.js +12 -27
  36. package/lib/esm/components/CustomComponentRenderer/state.js +121 -151
  37. package/lib/esm/components/ResponsiveImage/index.js +3 -16
  38. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  39. package/lib/esm/utils/inject-es-module-shims-options.js +1 -2
  40. package/lib/esm/utils/inject-global-components-dump-json.js +1 -1
  41. package/lib/esm/utils/inject-global-components.js +29 -20
  42. package/lib/esm/utils/preload.js +1 -15
  43. package/lib/esm/utils/property.js +30 -25
  44. package/lib/esm/utils/typescript/builtin-module-transformer.js +10 -8
  45. package/lib/types/builtin/session.d.ts +13 -0
  46. package/lib/types/tsconfig.tsbuildinfo +1 -1
  47. package/lib/types/types/core.d.ts +11 -2
  48. package/lib/types/utils/property.d.ts +1 -0
  49. package/lib/types/utils/typescript/builtin-module-transformer.d.ts +1 -0
  50. package/package.json +1 -1
@@ -32,7 +32,7 @@ export type CustomComponent = {
32
32
  };
33
33
  };
34
34
  };
35
- export type CustomComponentProperty = CustomComponentCommonProperty | CustomComponentCustomProperty | CustomComponentStringProperty | CustomComponentComponentProperty;
35
+ export type CustomComponentProperty = CustomComponentCommonProperty | CustomComponentCustomProperty | CustomComponentStringProperty | CustomComponentComponentProperty | CustomComponentPropertyWithSubProperties;
36
36
  export interface CustomComponentPropertyBase {
37
37
  id: string;
38
38
  key?: string;
@@ -44,8 +44,17 @@ export interface CustomComponentPropertyBase {
44
44
  };
45
45
  };
46
46
  }
47
+ export interface CustomComponentPropertyWithSubProperties extends CustomComponentPropertyBase {
48
+ type: 'json' | 'yaml' | 'array';
49
+ subProperties?: {
50
+ [id: string]: {
51
+ index: number;
52
+ data: CustomComponentProperty;
53
+ };
54
+ };
55
+ }
47
56
  export interface CustomComponentCommonProperty extends CustomComponentPropertyBase {
48
- type: 'number' | 'boolean' | 'json' | 'url' | 'decimal' | 'yaml' | 'color';
57
+ type: 'number' | 'boolean' | 'url' | 'decimal' | 'color';
49
58
  }
50
59
  export interface CustomComponentCustomProperty extends CustomComponentPropertyBase {
51
60
  type: 'custom';
@@ -19,6 +19,7 @@ export declare function mergeComponent({ componentId, getComponent, locale, defa
19
19
  };
20
20
  } | null;
21
21
  export declare const RenderNestedComponent = "__RENDER_NESTED_COMPONENT__";
22
+ export declare function safeJSONParse(value: string | Record<string, any>): any;
22
23
  export declare function parsePropertyValue(property: NonNullable<CustomComponent['properties']>[string]['data'], value: any, { locale, defaultLocale }: {
23
24
  locale?: string;
24
25
  defaultLocale?: string;
@@ -1,3 +1,4 @@
1
1
  import { SourceFile, TransformerFactory } from 'typescript';
2
2
  export declare const isRelativeModule: (moduleSpecifier: string) => boolean;
3
+ export declare const isAwaitModule: (moduleSpecifier: string) => boolean;
3
4
  export declare const createBuiltinModuleTransformer: (ts: typeof import("typescript")) => TransformerFactory<SourceFile>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit",
3
- "version": "0.4.32",
3
+ "version": "0.4.34",
4
4
  "description": "Pages Kit components and utils for blocklet(s)",
5
5
  "publishConfig": {
6
6
  "access": "public"