@composy/layout-vue 0.0.1 → 0.0.2

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 (157) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +82 -75
  3. package/dist/index.css +9 -3
  4. package/dist/index.js +22 -11
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.css +1 -1
  7. package/dist/index.min.js +2038 -1
  8. package/dist/index.min.js.map +1 -0
  9. package/es/.dts-output-manifest.json +1 -0
  10. package/es/.dts.tsbuildinfo +1 -0
  11. package/es/components/LGrid.d.ts +0 -1
  12. package/es/components/LGrid.js +3 -3
  13. package/es/components/LGrid.js.map +1 -1
  14. package/es/components/LGridItem.d.ts +0 -1
  15. package/es/components/LGridItem.d.ts.map +1 -1
  16. package/es/components/LGridItem.js +4 -2
  17. package/es/components/LGridItem.js.map +1 -1
  18. package/es/components/LLayoutEditor.d.ts +5 -5
  19. package/es/components/LLayoutEditor.d.ts.map +1 -1
  20. package/es/components/LLayoutEditor.js +2 -2
  21. package/es/components/LLayoutEditor.js.map +1 -1
  22. package/es/components/LLayoutWorkspace.js +1 -1
  23. package/es/components/LLayoutWorkspace.js.map +1 -1
  24. package/es/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.js +8 -5
  25. package/es/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/es/components/LMaterialDragSource.d.ts +0 -1
  27. package/es/components/LMaterialDragSource.js +1 -1
  28. package/es/components/LMaterialRenderer.d.ts +0 -1
  29. package/es/components/LMaterialRenderer.js +1 -1
  30. package/es/components/LMetricCard.d.ts +0 -1
  31. package/es/components/LMetricCard.js +1 -1
  32. package/es/components/LTrendCard.d.ts +0 -1
  33. package/es/components/LTrendCard.js +1 -1
  34. package/es/components/index.d.ts +0 -1
  35. package/es/components/index.js +3 -3
  36. package/es/components/material-renderer.d.ts +0 -1
  37. package/es/components/material-renderer.d.ts.map +1 -1
  38. package/es/components/material-renderer.js +10 -3
  39. package/es/components/material-renderer.js.map +1 -1
  40. package/es/composables/index.d.ts +0 -1
  41. package/es/composables/index.js +1 -1
  42. package/es/composables/useLayoutEditor.d.ts +0 -1
  43. package/es/composables/useLayoutEditor.js +1 -1
  44. package/es/index.d.ts +0 -1
  45. package/es/index.js +3 -5
  46. package/es/style/css.js +1 -1
  47. package/es/style/index.css +1 -0
  48. package/es/style/index.js +1 -1
  49. package/es/style/workspace.css +18 -2
  50. package/es/types.d.ts +0 -1
  51. package/es/types.js +1 -1
  52. package/esm/components/LGrid.d.ts.map +1 -0
  53. package/esm/components/LGrid.js +91 -0
  54. package/esm/components/LGrid.js.map +1 -0
  55. package/esm/components/LGridItem.d.ts.map +1 -0
  56. package/esm/components/LGridItem.js +54 -0
  57. package/esm/components/LGridItem.js.map +1 -0
  58. package/esm/components/LLayoutEditor.d.ts +50 -0
  59. package/esm/components/LLayoutEditor.d.ts.map +1 -0
  60. package/esm/components/LLayoutEditor.js +81 -0
  61. package/esm/components/LLayoutEditor.js.map +1 -0
  62. package/esm/components/LLayoutWorkspace.js +17 -0
  63. package/esm/components/LLayoutWorkspace.js.map +1 -0
  64. package/esm/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.js +2220 -0
  65. package/esm/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.js.map +1 -0
  66. package/esm/components/LMaterialDragSource.d.ts.map +1 -0
  67. package/esm/components/LMaterialDragSource.js +92 -0
  68. package/esm/components/LMaterialDragSource.js.map +1 -0
  69. package/esm/components/LMaterialRenderer.d.ts.map +1 -0
  70. package/esm/components/LMaterialRenderer.js +48 -0
  71. package/esm/components/LMaterialRenderer.js.map +1 -0
  72. package/esm/components/LMetricCard.d.ts.map +1 -0
  73. package/esm/components/LMetricCard.js +39 -0
  74. package/esm/components/LMetricCard.js.map +1 -0
  75. package/esm/components/LTrendCard.d.ts.map +1 -0
  76. package/esm/components/LTrendCard.js +36 -0
  77. package/esm/components/LTrendCard.js.map +1 -0
  78. package/esm/components/index.d.ts.map +1 -0
  79. package/esm/components/index.js +19 -0
  80. package/esm/components/material-renderer.d.ts.map +1 -0
  81. package/esm/components/material-renderer.js +103 -0
  82. package/esm/components/material-renderer.js.map +1 -0
  83. package/esm/composables/index.d.ts.map +1 -0
  84. package/esm/composables/index.js +12 -0
  85. package/esm/composables/useLayoutEditor.d.ts.map +1 -0
  86. package/esm/composables/useLayoutEditor.js +22 -0
  87. package/esm/composables/useLayoutEditor.js.map +1 -0
  88. package/esm/index.d.ts.map +1 -0
  89. package/esm/index.js +22 -0
  90. package/esm/style/css.js +1 -0
  91. package/esm/style/index.js +1 -0
  92. package/{es → esm}/style/index.less +1 -1
  93. package/esm/style/workspace.css +2379 -0
  94. package/esm/types.d.ts.map +1 -0
  95. package/esm/types.js +10 -0
  96. package/lib/components/LGrid.cjs +3 -3
  97. package/lib/components/LGrid.cjs.map +1 -1
  98. package/lib/components/LGrid.d.cts +2 -0
  99. package/lib/components/LGrid.d.cts.map +1 -0
  100. package/lib/components/LGridItem.cjs +4 -2
  101. package/lib/components/LGridItem.cjs.map +1 -1
  102. package/lib/components/LGridItem.d.cts +51 -0
  103. package/lib/components/LGridItem.d.cts.map +1 -0
  104. package/lib/components/LLayoutEditor.cjs +2 -2
  105. package/lib/components/LLayoutEditor.cjs.map +1 -1
  106. package/lib/components/{LLayoutEditor.d.ts → LLayoutEditor.d.cts} +5 -5
  107. package/lib/components/LLayoutEditor.d.cts.map +1 -0
  108. package/lib/components/LLayoutWorkspace.cjs +1 -1
  109. package/lib/components/LLayoutWorkspace.cjs.map +1 -1
  110. package/lib/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.cjs +8 -5
  111. package/lib/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  112. package/lib/components/LMaterialDragSource.cjs +1 -1
  113. package/lib/components/LMaterialDragSource.d.cts +54 -0
  114. package/lib/components/LMaterialDragSource.d.cts.map +1 -0
  115. package/lib/components/LMaterialRenderer.cjs +1 -1
  116. package/lib/components/LMaterialRenderer.d.cts +62 -0
  117. package/lib/components/LMaterialRenderer.d.cts.map +1 -0
  118. package/lib/components/LMetricCard.cjs +1 -1
  119. package/lib/components/LMetricCard.d.cts +28 -0
  120. package/lib/components/LMetricCard.d.cts.map +1 -0
  121. package/lib/components/LTrendCard.cjs +1 -1
  122. package/lib/components/LTrendCard.d.cts +16 -0
  123. package/lib/components/LTrendCard.d.cts.map +1 -0
  124. package/lib/components/index.cjs +1 -1
  125. package/lib/components/index.d.cts +9 -0
  126. package/lib/components/index.d.cts.map +1 -0
  127. package/lib/components/material-renderer.cjs +10 -3
  128. package/lib/components/material-renderer.cjs.map +1 -1
  129. package/lib/components/material-renderer.d.cts +25 -0
  130. package/lib/components/material-renderer.d.cts.map +1 -0
  131. package/lib/composables/index.cjs +1 -1
  132. package/lib/composables/index.d.cts +1 -0
  133. package/lib/composables/index.d.cts.map +1 -0
  134. package/lib/composables/useLayoutEditor.cjs +1 -1
  135. package/lib/composables/useLayoutEditor.d.cts +2 -0
  136. package/lib/composables/useLayoutEditor.d.cts.map +1 -0
  137. package/lib/index.cjs +1 -1
  138. package/lib/index.d.cts +6 -0
  139. package/lib/index.d.cts.map +1 -0
  140. package/lib/style/index.css +0 -1
  141. package/lib/style/workspace.css +9 -1
  142. package/lib/types.cjs +1 -1
  143. package/lib/types.d.cts +25 -0
  144. package/lib/types.d.cts.map +1 -0
  145. package/package.json +25 -18
  146. /package/{lib → esm}/components/LGrid.d.ts +0 -0
  147. /package/{lib → esm}/components/LGridItem.d.ts +0 -0
  148. /package/{lib → esm}/components/LMaterialDragSource.d.ts +0 -0
  149. /package/{lib → esm}/components/LMaterialRenderer.d.ts +0 -0
  150. /package/{lib → esm}/components/LMetricCard.d.ts +0 -0
  151. /package/{lib → esm}/components/LTrendCard.d.ts +0 -0
  152. /package/{lib → esm}/components/index.d.ts +0 -0
  153. /package/{lib → esm}/components/material-renderer.d.ts +0 -0
  154. /package/{lib → esm}/composables/index.d.ts +0 -0
  155. /package/{lib → esm}/composables/useLayoutEditor.d.ts +0 -0
  156. /package/{lib → esm}/index.d.ts +0 -0
  157. /package/{lib → esm}/types.d.ts +0 -0
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,54 @@
1
+ import type { LayoutPlacement, MaterialDefinition } from '@composy/layout-core';
2
+ import type { LayoutEditor } from '@composy/layout-editor';
3
+ export declare const LMaterialDragSource: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ /** Backwards-compatible shorthand when no full material definition is supplied. */
5
+ type: {
6
+ type: StringConstructor;
7
+ default: any;
8
+ };
9
+ material: {
10
+ type: () => MaterialDefinition;
11
+ default: any;
12
+ };
13
+ props: {
14
+ type: ObjectConstructor;
15
+ default: () => {};
16
+ };
17
+ placement: {
18
+ type: () => Partial<LayoutPlacement>;
19
+ default: any;
20
+ };
21
+ editor: {
22
+ type: () => LayoutEditor;
23
+ required: true;
24
+ };
25
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
26
+ [key: string]: any;
27
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
+ /** Backwards-compatible shorthand when no full material definition is supplied. */
29
+ type: {
30
+ type: StringConstructor;
31
+ default: any;
32
+ };
33
+ material: {
34
+ type: () => MaterialDefinition;
35
+ default: any;
36
+ };
37
+ props: {
38
+ type: ObjectConstructor;
39
+ default: () => {};
40
+ };
41
+ placement: {
42
+ type: () => Partial<LayoutPlacement>;
43
+ default: any;
44
+ };
45
+ editor: {
46
+ type: () => LayoutEditor;
47
+ required: true;
48
+ };
49
+ }>> & Readonly<{}>, {
50
+ props: Record<string, any>;
51
+ type: string;
52
+ placement: Partial<LayoutPlacement>;
53
+ material: MaterialDefinition<import("@composy/layout-core").JsonRecord>;
54
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LMaterialDragSource.d.cts","sourceRoot":"","sources":["../../src/components/LMaterialDragSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,eAAO,MAAM,mBAAmB;IAG5B,mFAAmF;;;;;;cAEvD,MAAM,kBAAkB;;;;;;;;cAGlC,MAAM,OAAO,CAAC,eAAe,CAAC;;;;cAGtB,MAAM,YAAY;;;;;;IAR5C,mFAAmF;;;;;;cAEvD,MAAM,kBAAkB;;;;;;;;cAGlC,MAAM,OAAO,CAAC,eAAe,CAAC;;;;cAGtB,MAAM,YAAY;;;;;;;;4EAyE9C,CAAA"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,62 @@
1
+ import { type PropType } from 'vue';
2
+ import type { LayoutNode, LayoutPlacement } from '@composy/layout-core';
3
+ import { type LayoutRenderTarget, type VueMaterialSource } from './material-renderer';
4
+ /**
5
+ * A target-aware renderer for one registered layout material.
6
+ *
7
+ * `LGrid` owns the placement shell; this component owns the renderer lookup.
8
+ * Consumers can therefore use the same item renderer in an editor, a preview,
9
+ * a modal or their own grid implementation without duplicating framework
10
+ * branching logic.
11
+ */
12
+ export declare const LMaterialRenderer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
+ item: {
14
+ type: PropType<LayoutNode>;
15
+ required: true;
16
+ };
17
+ materials: {
18
+ type: PropType<VueMaterialSource>;
19
+ default: any;
20
+ };
21
+ target: {
22
+ type: PropType<LayoutRenderTarget>;
23
+ default: string;
24
+ };
25
+ placement: {
26
+ type: PropType<LayoutPlacement>;
27
+ default: any;
28
+ };
29
+ breakpointId: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
34
+ [key: string]: any;
35
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
36
+ item: {
37
+ type: PropType<LayoutNode>;
38
+ required: true;
39
+ };
40
+ materials: {
41
+ type: PropType<VueMaterialSource>;
42
+ default: any;
43
+ };
44
+ target: {
45
+ type: PropType<LayoutRenderTarget>;
46
+ default: string;
47
+ };
48
+ placement: {
49
+ type: PropType<LayoutPlacement>;
50
+ default: any;
51
+ };
52
+ breakpointId: {
53
+ type: StringConstructor;
54
+ default: string;
55
+ };
56
+ }>> & Readonly<{}>, {
57
+ materials: VueMaterialSource;
58
+ target: LayoutRenderTarget;
59
+ placement: LayoutPlacement;
60
+ breakpointId: string;
61
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
62
+ export type { LayoutRenderTarget };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LMaterialRenderer.d.cts","sourceRoot":"","sources":["../../src/components/LMaterialRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;cAGF,QAAQ,CAAC,UAAU,CAAC;;;;cAEjB,QAAQ,CAAC,iBAAiB,CAAC;;;;cAIpC,QAAQ,CAAC,kBAAkB,CAAC;;;;cAI5B,QAAQ,CAAC,eAAe,CAAC;;;;;;;;;;;cAVnB,QAAQ,CAAC,UAAU,CAAC;;;;cAEjB,QAAQ,CAAC,iBAAiB,CAAC;;;;cAIpC,QAAQ,CAAC,kBAAkB,CAAC;;;;cAI5B,QAAQ,CAAC,eAAe,CAAC;;;;;;;;;;;;4EAkB7C,CAAA;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Reference Vue material used by the layout examples and as a small,
3
+ * framework-native registration contract for consumers.
4
+ */
5
+ export declare const LMetricCard: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ title: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ value: {
11
+ type: (StringConstructor | NumberConstructor)[];
12
+ default: any;
13
+ };
14
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
15
+ [key: string]: any;
16
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
+ title: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ value: {
22
+ type: (StringConstructor | NumberConstructor)[];
23
+ default: any;
24
+ };
25
+ }>> & Readonly<{}>, {
26
+ title: string;
27
+ value: string | number;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LMetricCard.d.cts","sourceRoot":"","sources":["../../src/components/LMetricCard.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;4EA2BtB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,16 @@
1
+ /** Reference Vue chart material for renderer registration examples. */
2
+ export declare const LTrendCard: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ title: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
8
+ [key: string]: any;
9
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ title: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ }>> & Readonly<{}>, {
15
+ title: string;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LTrendCard.d.cts","sourceRoot":"","sources":["../../src/components/LTrendCard.ts"],"names":[],"mappings":"AAEA,uEAAuE;AACvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;4EAwBrB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,9 @@
1
+ export { LGrid } from './LGrid';
2
+ export { LGridItem } from './LGridItem';
3
+ export { LMaterialRenderer } from './LMaterialRenderer';
4
+ export { LLayoutEditor } from './LLayoutEditor';
5
+ export { default as LLayoutWorkspace } from './LLayoutWorkspace.vue';
6
+ export { LMaterialDragSource } from './LMaterialDragSource';
7
+ export { LMetricCard } from './LMetricCard';
8
+ export { LTrendCard } from './LTrendCard';
9
+ export type { LayoutRenderTarget, VueMaterialSource } from './material-renderer';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -11,9 +11,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
11
11
  let vue = require("vue");
12
12
  let _composy_layout_core = require("@composy/layout-core");
13
13
  //#region src/components/material-renderer.ts
14
+ const registryCache = /* @__PURE__ */ new WeakMap();
14
15
  function resolveRegistry(source) {
15
16
  if (!source) return void 0;
16
- if (Array.isArray(source)) return (0, _composy_layout_core.createMaterialRegistry)(source);
17
+ if (Array.isArray(source)) {
18
+ const cached = registryCache.get(source);
19
+ if (cached) return cached;
20
+ const registry = (0, _composy_layout_core.createMaterialRegistry)(source);
21
+ registryCache.set(source, registry);
22
+ return registry;
23
+ }
17
24
  return source;
18
25
  }
19
26
  function resolveMaterialDefinition(materials, type) {
@@ -89,7 +96,7 @@ function renderMaterialForTarget(materials, item, target, placement, breakpointI
89
96
  }, breakpointId);
90
97
  }
91
98
  function sanitizeMarkup(value) {
92
- return value.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi, "").replace(/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+(?:href|src)\s*=\s*("|')\s*javascript:[^"']*\1/gi, "");
99
+ return value.replace(/<(?:script|style|iframe|object|embed|foreignObject)\b[^>]*>[\s\S]*?<\/(?:script|style|iframe|object|embed|foreignObject)\s*>/gi, "").replace(/<(?:script|style|iframe|object|embed|foreignObject)\b[^>]*>/gi, "").replace(/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+(?:href|src|xlink:href|formaction|srcdoc)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, (match) => /javascript:|data:text\/html/i.test(match) ? "" : match);
93
100
  }
94
101
  //#endregion
95
102
  exports.renderMaterialFallback = renderMaterialFallback;
@@ -1 +1 @@
1
- {"version":3,"file":"material-renderer.cjs","names":[],"sources":["../../src/components/material-renderer.ts"],"sourcesContent":["import { h, type VNode } from 'vue'\nimport {\n createMaterialRegistry,\n type LayoutNode,\n type LayoutPlacement,\n type MaterialDefinition,\n type MaterialRegistry,\n} from '@composy/layout-core'\nexport type VueMaterialSource =\n MaterialRegistry | readonly MaterialDefinition[] | undefined\n\n/**\n * The runtime target used by the layout renderer. It intentionally contains\n * only the two targets supported by the workspace today: a Vue component or a\n * registered native custom element.\n */\nexport type LayoutRenderTarget = 'vue' | 'webcomponent'\n\nfunction resolveRegistry(\n source: VueMaterialSource\n): MaterialRegistry | undefined {\n if (!source) return undefined\n if (Array.isArray(source)) return createMaterialRegistry(source)\n return source as MaterialRegistry\n}\n\nexport function resolveMaterialDefinition(\n materials: VueMaterialSource,\n type: string\n): MaterialDefinition | undefined {\n return resolveRegistry(materials)?.get(type)\n}\n\n/**\n * Render the framework-specific fallback declared by a material.\n * A host-provided item slot always takes precedence over this helper.\n */\nexport function renderMaterialFallback(\n materials: VueMaterialSource,\n item: LayoutNode,\n placement: LayoutPlacement,\n breakpointId: string\n): VNode | undefined {\n const material = resolveMaterialDefinition(materials, item.type)\n const context = { item, placement, breakpointId }\n const vueRenderer = material?.renderers?.vue\n if (vueRenderer?.component) {\n return h(vueRenderer.component as never, {\n ...(item.props ?? {}),\n ...(vueRenderer.tagName ? { is: vueRenderer.tagName } : {}),\n })\n }\n const webComponentRenderer = material?.renderers?.webcomponent\n if (webComponentRenderer?.tagName)\n return h(webComponentRenderer.tagName, {\n ...(item.props ?? {}),\n materialProps: { ...(item.props ?? {}) },\n })\n const htmlRenderer = material?.renderers?.html\n if (htmlRenderer?.render) {\n const rendered = htmlRenderer.render(context)\n if (typeof rendered === 'string')\n return h('div', { innerHTML: sanitizeMarkup(rendered) })\n return rendered as VNode | undefined\n }\n if (htmlRenderer?.tagName)\n return h(htmlRenderer.tagName, { ...(item.props ?? {}) })\n return undefined\n}\n\n/**\n * Render the registered renderer for a concrete target.\n *\n * Keeping this decision in one place is important: grid items, preview\n * surfaces and integrations must not each invent their own component lookup.\n * A material can still provide the legacy html renderer as a final fallback,\n * but a Vue target never silently prefers a web component when its Vue\n * renderer is present (and vice versa).\n */\nexport function renderMaterialForTarget(\n materials: VueMaterialSource,\n item: LayoutNode,\n target: LayoutRenderTarget,\n placement?: LayoutPlacement,\n breakpointId = 'desktop'\n): VNode | undefined {\n const material = resolveMaterialDefinition(materials, item.type)\n const props = { ...(item.props ?? {}) }\n\n if (target === 'vue') {\n const renderer = material?.renderers?.vue\n if (renderer?.component) return h(renderer.component as never, props)\n } else {\n const renderer = material?.renderers?.webcomponent\n if (renderer?.tagName)\n return h(renderer.tagName, {\n ...props,\n // Workspace-provided custom elements use this property to render the\n // same registered material props as the editor/runtime adapters.\n materialProps: props,\n onVnodeMounted: vnode => {\n const el = vnode.el as unknown as Element & {\n materialProps?: Record<string, unknown>\n }\n if (el && 'materialProps' in el) el.materialProps = props\n },\n onVnodeUpdated: vnode => {\n const el = vnode.el as unknown as Element & {\n materialProps?: Record<string, unknown>\n }\n if (el && 'materialProps' in el) el.materialProps = props\n },\n })\n }\n\n const htmlRenderer = material?.renderers?.html\n if (htmlRenderer?.render) {\n const rendered = htmlRenderer.render({\n item,\n placement: placement ??\n item.layout[breakpointId] ?? { x: 0, y: 0, w: 1, h: 1 },\n breakpointId,\n })\n if (typeof rendered === 'string')\n return h('div', { innerHTML: sanitizeMarkup(rendered) })\n return rendered as VNode | undefined\n }\n if (htmlRenderer?.tagName) return h(htmlRenderer.tagName, props)\n\n // Preserve the historical behavior for incomplete third-party definitions\n // so registering only one renderer does not make an item disappear.\n return renderMaterialFallback(\n materials,\n item,\n placement ?? item.layout[breakpointId] ?? { x: 0, y: 0, w: 1, h: 1 },\n breakpointId\n )\n}\n\nfunction sanitizeMarkup(value: string): string {\n return value\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script\\s*>/gi, '')\n .replace(/\\s+on[a-z]+\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]+)/gi, '')\n .replace(/\\s+(?:href|src)\\s*=\\s*(\"|')\\s*javascript:[^\"']*\\1/gi, '')\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAS,gBACP,QAC8B;CAC9B,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,IAAI,MAAM,QAAQ,MAAM,GAAG,QAAA,GAAA,qBAAA,uBAAA,CAA8B,MAAM;CAC/D,OAAO;AACT;AAEO,SAAS,0BACd,WACA,MACgC;CAChC,OAAO,gBAAgB,SAAS,CAAA,EAAG,IAAI,IAAI;AAC7C;AAMO,SAAS,uBACd,WACA,MACA,W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,iBAAgB,UAAS;IACvB,MAAM,KAAK,MAAM;IAGjB,IAAI,MAAM,mBAAmB,IAAI,GAAG,gBAAgB;GACtD;GACA,iBAAgB,UAAS;IACvB,MAAM,KAAK,MAAM;IAGjB,IAAI,MAAM,mBAAmB,IAAI,GAAG,gBAAgB;GACtD;EACF,CAAC;CACL;CAEA,MAAM,eAAe,UAAU,WAAW;CAC1C,IAAI,cAAc,QAAQ;EACxB,MAAM,WAAW,aAAa,OAAO;GACnC;GACA,WAAW,aACT,KAAK,OAAO,iBAAiB;IAAE,GAAG;IAAG,GAAG;IAAG,GAAG;IAAG,GAAG;GAAE;GACxD;EACF,CAAC;EACD,IAAI,OAAO,aAAa,UACtB,QAAA,GAAA,IAAA,EAAA,CAAS,OAAO,EAAE,WAAW,eAAe,QAAQ,EAAE,CAAC;EACzD,OAAO;CACT;CACA,IAAI,cAAc,SAAS,QAAA,GAAA,IAAA,EAAA,CAAS,aAAa,SAAS,KAAK;CAI/D,OAAO,uBACL,WACA,MACA,aAAa,KAAK,OAAO,iBAAiB;EAAE,GAAG;EAAG,GAAG;EAAG,GAAG;EAAG,GAAG;CAAE,GACnE,YACF;AACF;AAEA,SAAS,eAAe,OAAuB;CAC7C,OAAO,MACJ,QAAQ,0CAA0C,EAAE,CAAA,CACpD,QAAQ,mDAAmD,EAAE,CAAA,CAC7D,QAAQ,uDAAuD,EAAE;AACtE"}
1
+ {"version":3,"file":"material-renderer.cjs","names":[],"sources":["../../src/components/material-renderer.ts"],"sourcesContent":["import { h, type VNode } from 'vue'\nimport {\n createMaterialRegistry,\n type LayoutNode,\n type LayoutPlacement,\n type MaterialDefinition,\n type MaterialRegistry,\n} from '@composy/layout-core'\nexport type VueMaterialSource =\n MaterialRegistry | readonly MaterialDefinition[] | undefined\n\nconst registryCache = new WeakMap<object, MaterialRegistry>()\n\n/**\n * The runtime target used by the layout renderer. It intentionally contains\n * only the two targets supported by the workspace today: a Vue component or a\n * registered native custom element.\n */\nexport type LayoutRenderTarget = 'vue' | 'webcomponent'\n\nfunction resolveRegistry(\n source: VueMaterialSource\n): MaterialRegistry | undefined {\n if (!source) return undefined\n if (Array.isArray(source)) {\n const cached = registryCache.get(source)\n if (cached) return cached\n const registry = createMaterialRegistry(source)\n registryCache.set(source, registry)\n return registry\n }\n return source as MaterialRegistry\n}\n\nexport function resolveMaterialDefinition(\n materials: VueMaterialSource,\n type: string\n): MaterialDefinition | undefined {\n return resolveRegistry(materials)?.get(type)\n}\n\n/**\n * Render the framework-specific fallback declared by a material.\n * A host-provided item slot always takes precedence over this helper.\n */\nexport function renderMaterialFallback(\n materials: VueMaterialSource,\n item: LayoutNode,\n placement: LayoutPlacement,\n breakpointId: string\n): VNode | undefined {\n const material = resolveMaterialDefinition(materials, item.type)\n const context = { item, placement, breakpointId }\n const vueRenderer = material?.renderers?.vue\n if (vueRenderer?.component) {\n return h(vueRenderer.component as never, {\n ...(item.props ?? {}),\n ...(vueRenderer.tagName ? { is: vueRenderer.tagName } : {}),\n })\n }\n const webComponentRenderer = material?.renderers?.webcomponent\n if (webComponentRenderer?.tagName)\n return h(webComponentRenderer.tagName, {\n ...(item.props ?? {}),\n materialProps: { ...(item.props ?? {}) },\n })\n const htmlRenderer = material?.renderers?.html\n if (htmlRenderer?.render) {\n const rendered = htmlRenderer.render(context)\n if (typeof rendered === 'string')\n return h('div', { innerHTML: sanitizeMarkup(rendered) })\n return rendered as VNode | undefined\n }\n if (htmlRenderer?.tagName)\n return h(htmlRenderer.tagName, { ...(item.props ?? {}) })\n return undefined\n}\n\n/**\n * Render the registered renderer for a concrete target.\n *\n * Keeping this decision in one place is important: grid items, preview\n * surfaces and integrations must not each invent their own component lookup.\n * A material can still provide the legacy html renderer as a final fallback,\n * but a Vue target never silently prefers a web component when its Vue\n * renderer is present (and vice versa).\n */\nexport function renderMaterialForTarget(\n materials: VueMaterialSource,\n item: LayoutNode,\n target: LayoutRenderTarget,\n placement?: LayoutPlacement,\n breakpointId = 'desktop'\n): VNode | undefined {\n const material = resolveMaterialDefinition(materials, item.type)\n const props = { ...(item.props ?? {}) }\n\n if (target === 'vue') {\n const renderer = material?.renderers?.vue\n if (renderer?.component) return h(renderer.component as never, props)\n } else {\n const renderer = material?.renderers?.webcomponent\n if (renderer?.tagName)\n return h(renderer.tagName, {\n ...props,\n // Workspace-provided custom elements use this property to render the\n // same registered material props as the editor/runtime adapters.\n materialProps: props,\n onVnodeMounted: vnode => {\n const el = vnode.el as unknown as Element & {\n materialProps?: Record<string, unknown>\n }\n if (el && 'materialProps' in el) el.materialProps = props\n },\n onVnodeUpdated: vnode => {\n const el = vnode.el as unknown as Element & {\n materialProps?: Record<string, unknown>\n }\n if (el && 'materialProps' in el) el.materialProps = props\n },\n })\n }\n\n const htmlRenderer = material?.renderers?.html\n if (htmlRenderer?.render) {\n const rendered = htmlRenderer.render({\n item,\n placement: placement ??\n item.layout[breakpointId] ?? { x: 0, y: 0, w: 1, h: 1 },\n breakpointId,\n })\n if (typeof rendered === 'string')\n return h('div', { innerHTML: sanitizeMarkup(rendered) })\n return rendered as VNode | undefined\n }\n if (htmlRenderer?.tagName) return h(htmlRenderer.tagName, props)\n\n // Preserve the historical behavior for incomplete third-party definitions\n // so registering only one renderer does not make an item disappear.\n return renderMaterialFallback(\n materials,\n item,\n placement ?? item.layout[breakpointId] ?? { x: 0, y: 0, w: 1, h: 1 },\n breakpointId\n )\n}\n\nfunction sanitizeMarkup(value: string): string {\n return value\n .replace(\n /<(?:script|style|iframe|object|embed|foreignObject)\\b[^>]*>[\\s\\S]*?<\\/(?:script|style|iframe|object|embed|foreignObject)\\s*>/gi,\n ''\n )\n .replace(\n /<(?:script|style|iframe|object|embed|foreignObject)\\b[^>]*>/gi,\n ''\n )\n .replace(/\\s+on[a-z]+\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]+)/gi, '')\n .replace(\n /\\s+(?:href|src|xlink:href|formaction|srcdoc)\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]+)/gi,\n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S,eAAe,OAAuB;CAC7C,OAAO,MACJ,QACC,kIACA,EACF,CAAA,CACC,QACC,iEACA,EACF,CAAA,CACC,QAAQ,mDAAmD,EAAE,CAAA,CAC7D,QACC,qFACA,UAAU,+BAA+B,KAAK,KAAK,IAAI,KAAK,KAC9D;AACJ"}
@@ -0,0 +1,25 @@
1
+ import { type VNode } from 'vue';
2
+ import { type LayoutNode, type LayoutPlacement, type MaterialDefinition, type MaterialRegistry } from '@composy/layout-core';
3
+ export type VueMaterialSource = MaterialRegistry | readonly MaterialDefinition[] | undefined;
4
+ /**
5
+ * The runtime target used by the layout renderer. It intentionally contains
6
+ * only the two targets supported by the workspace today: a Vue component or a
7
+ * registered native custom element.
8
+ */
9
+ export type LayoutRenderTarget = 'vue' | 'webcomponent';
10
+ export declare function resolveMaterialDefinition(materials: VueMaterialSource, type: string): MaterialDefinition | undefined;
11
+ /**
12
+ * Render the framework-specific fallback declared by a material.
13
+ * A host-provided item slot always takes precedence over this helper.
14
+ */
15
+ export declare function renderMaterialFallback(materials: VueMaterialSource, item: LayoutNode, placement: LayoutPlacement, breakpointId: string): VNode | undefined;
16
+ /**
17
+ * Render the registered renderer for a concrete target.
18
+ *
19
+ * Keeping this decision in one place is important: grid items, preview
20
+ * surfaces and integrations must not each invent their own component lookup.
21
+ * A material can still provide the legacy html renderer as a final fallback,
22
+ * but a Vue target never silently prefers a web component when its Vue
23
+ * renderer is present (and vice versa).
24
+ */
25
+ export declare function renderMaterialForTarget(materials: VueMaterialSource, item: LayoutNode, target: LayoutRenderTarget, placement?: LayoutPlacement, breakpointId?: string): VNode | undefined;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-renderer.d.cts","sourceRoot":"","sources":["../../src/components/material-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAA;AAC7B,MAAM,MAAM,iBAAiB,GAC3B,gBAAgB,GAAG,SAAS,kBAAkB,EAAE,GAAG,SAAS,CAAA;AAI9D;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,cAAc,CAAA;AAgBvD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,MAAM,GACX,kBAAkB,GAAG,SAAS,CAEhC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,eAAe,EAC1B,YAAY,EAAE,MAAM,GACnB,KAAK,GAAG,SAAS,CA0BnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,kBAAkB,EAC1B,SAAS,CAAC,EAAE,eAAe,EAC3B,YAAY,SAAY,GACvB,KAAK,GAAG,SAAS,CAoDnB"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1 @@
1
+ export { useLayoutEditor } from './useLayoutEditor';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,2 @@
1
+ import type { LayoutEditorOptions } from '@composy/layout-editor';
2
+ export declare function useLayoutEditor(options: LayoutEditorOptions): import("vue").ShallowRef<import("@composy/layout-editor").LayoutEditor, import("@composy/layout-editor").LayoutEditor>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLayoutEditor.d.cts","sourceRoot":"","sources":["../../src/composables/useLayoutEditor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAEjE,wBAAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB,0HAK3D"}
package/lib/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,6 @@
1
+ export { LGrid, LGridItem, LMaterialRenderer, LLayoutEditor, LLayoutWorkspace, LMaterialDragSource, LMetricCard, LTrendCard, } from './components';
2
+ export { useLayoutEditor } from './composables';
3
+ export type * from './types';
4
+ export type { LayoutRenderTarget, VueMaterialSource, } from './components/material-renderer';
5
+ export type { LayoutDocument, LayoutNode, LayoutPlacement, MaterialDefinition, } from '@composy/layout-core';
6
+ export type { LayoutEditor, LayoutEditorEngine, LayoutEditorOptions, } from '@composy/layout-editor';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,UAAU,GACX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,mBAAmB,SAAS,CAAA;AAC5B,YAAY,EACV,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,kBAAkB,GACnB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,wBAAwB,CAAA"}
@@ -1,2 +1 @@
1
1
 
2
- /*# sourceMappingURL=src/style/index.less.map */
@@ -1385,6 +1385,15 @@ body > .ui-draggable-dragging[data-layout-material] {
1385
1385
  flex: 1 0 auto;
1386
1386
  }
1387
1387
 
1388
+ /* The editor keeps a native runtime container mounted for fast framework
1389
+ * switching. Vue mode renders the adapter grid in the same stage, so the
1390
+ * native container must stay out of layout flow until Web Component mode is
1391
+ * selected. */
1392
+ .runtime-preview-stage[data-preview-framework="vue"] > .runtime-preview-grid,
1393
+ .vanilla-runtime-stage[data-preview-framework="vue"] > .runtime-preview-grid {
1394
+ display: none !important;
1395
+ }
1396
+
1388
1397
  .layout-item-shell,
1389
1398
  .layout-card {
1390
1399
  position: relative;
@@ -2375,4 +2384,3 @@ body > .ui-draggable-dragging[data-layout-material] {
2375
2384
  color: #c5ceff !important;
2376
2385
  }
2377
2386
 
2378
- /*# sourceMappingURL=src/style/workspace.css.map */
package/lib/types.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * ***********************************
3
3
  * @composy/layout-vue v0.0.1 *
4
4
  * Built with rollup *
5
- * Build time: 2024-08-17 11:47:09 *
5
+ * Build time: 2024-10-12 17:52:50 *
6
6
  * Build mode: production *
7
7
  * Minified: No *
8
8
  * ***********************************
@@ -0,0 +1,25 @@
1
+ import type { LayoutDocument, LayoutNode, LayoutPlacement, MaterialDefinition, MaterialRegistry } from '@composy/layout-core';
2
+ import type { LayoutEditor, LayoutEditorEngine, LayoutEditorOptions } from '@composy/layout-editor';
3
+ import type { LayoutRenderTarget } from './components/material-renderer';
4
+ export interface LayoutItemSlotContext {
5
+ item: LayoutNode;
6
+ placement: LayoutPlacement;
7
+ breakpointId: string;
8
+ }
9
+ export interface LGridProps {
10
+ document: LayoutDocument;
11
+ breakpoint?: string;
12
+ readonly?: boolean;
13
+ materials?: MaterialRegistry | readonly MaterialDefinition[];
14
+ target?: LayoutRenderTarget;
15
+ }
16
+ export interface LLayoutEditorProps {
17
+ document: LayoutDocument;
18
+ engine: LayoutEditorEngine;
19
+ mode?: 'edit' | 'preview' | 'readonly';
20
+ preview?: LayoutEditorOptions['preview'];
21
+ materials?: MaterialRegistry | readonly MaterialDefinition[];
22
+ }
23
+ export interface LLayoutEditorExpose {
24
+ editor: LayoutEditor;
25
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAExE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,eAAe,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;CACrB;AACD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,cAAc,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,kBAAkB,EAAE,CAAA;IAC5D,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAC5B;AACD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,cAAc,CAAA;IACxB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IACtC,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;IACxC,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,kBAAkB,EAAE,CAAA;CAC7D;AACD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAA;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composy/layout-vue",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Vue 3 runtime and editor adapters for LDesign Layout",
5
5
  "keywords": [
6
6
  "grid",
@@ -55,7 +55,7 @@
55
55
  "./index.min.css": "./dist/index.min.css",
56
56
  "./style/workspace.css": "./es/style/workspace.css",
57
57
  "./style/index.css": "./lib/style/index.css",
58
- "./style/index.less": "./es/style/index.less",
58
+ "./style/index.less": "./esm/style/index.less",
59
59
  "./package.json": "./package.json"
60
60
  },
61
61
  "main": "./lib/index.cjs",
@@ -68,50 +68,57 @@
68
68
  "LICENSE",
69
69
  "CHANGELOG.md",
70
70
  "es",
71
+ "esm",
71
72
  "lib",
72
73
  "dist"
73
74
  ],
74
75
  "scripts": {
75
76
  "build": "ldesign-builder build",
77
+ "postbuild": "node scripts/strip-dangling-css-sourcemaps.cjs",
78
+ "clean": "rimraf dist es esm lib",
76
79
  "dev": "vite build --watch",
77
80
  "lint": "eslint . --cache",
78
81
  "lint:check": "eslint . --cache --max-warnings 0",
79
82
  "lint:fix": "eslint . --cache --fix",
80
83
  "type-check": "node scripts/run-vue-tsc.cjs --noEmit",
84
+ "type-check:cjs": "node scripts/run-vue-tsc.cjs --noEmit -p tsconfig.cjs.json",
81
85
  "test": "ltesting run:unit",
82
86
  "test:run": "ltesting run:unit",
83
87
  "test:watch": "ltesting run:unit --watch",
84
88
  "test:coverage": "ltesting run:unit --coverage",
85
89
  "test:changed": "ltesting run:unit --changed",
86
90
  "test:failed": "ltesting run:unit --failed",
87
- "test:ui": "ltesting dashboard"
91
+ "test:ui": "ltesting dashboard",
92
+ "release": "ldesign-release publish --package-dir ."
88
93
  },
89
94
  "dependencies": {
90
- "@composy/layout-core": "^0.0.1",
91
- "@composy/layout-compiler": "^0.0.1",
92
- "@composy/layout-editor": "^0.0.1",
93
- "@composy/layout-gridstack": "^0.0.1",
94
- "@composy/layout-runtime": "^0.0.1",
95
- "gridstack": "^13.0.2",
96
- "lucide": "^0.468.0",
97
- "lucide-vue-next": "^1.0.0"
95
+ "@composy/layout-core": "^0.0.2",
96
+ "@composy/layout-compiler": "^0.0.2",
97
+ "@composy/layout-editor": "^0.0.2",
98
+ "@composy/layout-gridstack": "^0.0.2",
99
+ "@composy/layout-runtime": "^0.0.2",
100
+ "gridstack": "13.0.2",
101
+ "lucide": "1.49.0",
102
+ "lucide-vue-next": "1.0.0"
98
103
  },
99
104
  "peerDependencies": {
100
- "vue": "^3.5.32"
105
+ "vue": "3.5.32"
101
106
  },
102
107
  "devDependencies": {
103
108
  "@antfu/eslint-config": "9.1.0",
104
- "@composy/builder": "^0.0.1",
105
- "@composy/testing": "^0.0.1",
109
+ "@composy/builder": "^0.1.0",
110
+ "@composy/release": "^0.1.0",
111
+ "@composy/testing": "^0.0.2",
106
112
  "eslint": "10.7.0",
113
+ "rimraf": "6.1.3",
107
114
  "typescript": "5.9.3",
108
- "vite": "^8.1.4",
109
- "vue": "3.5.39",
110
- "vue-tsc": "^3.3.7"
115
+ "vite": "8.1.4",
116
+ "vue": "3.5.32",
117
+ "vue-tsc": "3.3.11"
111
118
  },
112
119
  "publishConfig": {
113
120
  "registry": "http://npm.longrise.cn:6286/"
114
121
  },
115
122
  "typings": "./es/index.d.ts",
116
123
  "browser": "./dist/index.js"
117
- }
124
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes