@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
@@ -0,0 +1 @@
1
+ {"version":1,"configuration":"fb722c037d4ba7e38bbfd242442d98bb961b1ced6ab3939ba34351926e242b7c","sources":{"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\material-renderer.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\material-renderer.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\types.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\types.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LGrid.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LGrid.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LGridItem.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LGridItem.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LLayoutEditor.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LLayoutEditor.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LMaterialDragSource.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LMaterialDragSource.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LMaterialRenderer.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LMaterialRenderer.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LMetricCard.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LMetricCard.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\LTrendCard.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\LTrendCard.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\components\\index.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\components\\index.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\composables\\useLayoutEditor.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\composables\\useLayoutEditor.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\composables\\index.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\composables\\index.d.ts"],"D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\src\\index.ts":["D:\\WorkBench\\ldesign\\libraries\\layout\\packages\\vue\\es\\index.d.ts"]}}
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.scripthost.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.full.d.ts","../../../../../node_modules/.pnpm/@vue+shared@3.5.32/node_modules/@vue/shared/dist/shared.d.ts","../../../../../node_modules/.pnpm/@babel+types@8.0.6/node_modules/@babel/types/lib/index.d.ts","../../../../../node_modules/.pnpm/@babel+types@7.29.7/node_modules/@babel/types/lib/index.d.ts","../../../../../node_modules/.pnpm/@babel+parser@7.29.7/node_modules/@babel/parser/typings/babel-parser.d.ts","../../../../../node_modules/.pnpm/@vue+compiler-core@3.5.32/node_modules/@vue/compiler-core/dist/compiler-core.d.ts","../../../../../node_modules/.pnpm/@vue+compiler-dom@3.5.32/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts","../../../../../node_modules/.pnpm/@vue+reactivity@3.5.32/node_modules/@vue/reactivity/dist/reactivity.d.ts","../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.32/node_modules/@vue/runtime-core/dist/runtime-core.d.ts","../../../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.32/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts","../../../../../node_modules/.pnpm/vue@3.5.32_typescript@5.9.3/node_modules/vue/dist/vue.d.mts","../../core/es/types/layout.d.ts","../../core/es/types/patch.d.ts","../../core/es/errors/index.d.ts","../../core/es/types/events.d.ts","../../core/es/types/material.d.ts","../../core/es/types/index.d.ts","../../core/es/schema/factory.d.ts","../../core/es/schema/normalize.d.ts","../../core/es/validation/index.d.ts","../../core/es/migration/index.d.ts","../../core/es/breakpoint/resolver.d.ts","../../core/es/transaction/index.d.ts","../../core/es/materials/registry.d.ts","../../core/es/index.d.ts","../../runtime/es/styles.d.ts","../../runtime/es/runtime.d.ts","../../runtime/es/index.d.ts","../../editor/es/types.d.ts","../../editor/es/engine.d.ts","../../editor/es/editor.d.ts","../../editor/es/index.d.ts","../src/components/material-renderer.ts","../src/types.ts","../src/components/lgrid.ts","../src/components/lgriditem.ts","../src/components/llayouteditor.ts","../src/components/lmaterialdragsource.ts","../src/components/lmaterialrenderer.ts","../src/components/lmetriccard.ts","../src/components/ltrendcard.ts","../src/components/index.ts","../src/composables/uselayouteditor.ts","../src/composables/index.ts","../src/index.ts"],"fileIdsList":[[68],[65,68,69,70,71,72,73,74,75],[63,64,65],[63,64,66,67],[63],[76,79,81],[76,80],[80,81,82],[77,78],[76,77],[76],[84,86,87,88,89,90,91,92],[62,79,84,85],[62,76,79,84],[62,76,83],[62,76,84],[62],[62,76],[94],[62,83],[76,83,84,85,93,95],[76,83,84],[54],[52,53,55],[56],[52],[52,58,59,61],[58,59,60,61],[57,61]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1305d1e76ca44e30fb8b2b8075fa522b83f60c0bcf5d4326a9d2cf79b53724f8","impliedFormat":1},{"version":"f468b74459f1ad4473b36a36d49f2b255f3c6b5d536c81239c2b2971df089eaf","impliedFormat":1},{"version":"e66dd20f48d96e48ee9a807ba2697396978cdf09cca2a4cbf08fbc2d843e27e8","impliedFormat":99},{"version":"556ccd493ec36c7d7cb130d51be66e147b91cc1415be383d71da0f1e49f742a9","impliedFormat":1},{"version":"95aba78013d782537cc5e23868e736bec5d377b918990e28ed56110e3ae8b958","impliedFormat":1},{"version":"524a409ad72186b7f6cb16898c349465cfa876f641d6cb6137b3123d5cfca619","impliedFormat":1},{"version":"ebe84ad8344962b7117a3b95065f47383215020eaf1b626463863b45b4d16e62","impliedFormat":1},{"version":"dc0c80f91a4d46c5c4f625a35601ff3c815e2395e6680bacfa12970fc6d49c93","impliedFormat":1},{"version":"3e74c6f34a28b7c948bfdaf19172000d589093660b3605f8c21c1b30173c729b","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"88ad1af02cacc61bf79683b021d326eeafc91231660a06495c5046d4649ec3a2","impliedFormat":1},{"version":"c0191592be8eb7906f99ac4b8798d80a585b94001ea1a5f50d6ce5b0d13a5c62","impliedFormat":99},"f6a23658c754861e27139cd4b85fc08f499fe333da9816a0b7b0a3a819e5e80b","c71dc2a73350abcdaa763e394b0e972026d592cea7b62dc9b8c1d7b3aa0a77b7","34a3400a45194b2da52ad0648e9f3231bc0654506aa2ee3a4c6a47eddf70d1e4","e7e8e22d2344b6fb56838ba690c8bd077c02ef568ab3f20405894f2b9a84f7af","34f55e28967f47dd972bf7f73f20198b445529dda8479b17bb4ce2df5afc1612","b97260550538e9a7cf0a5e01704738ff78a69c798e4d3b99ac92817e49af6443","1881fd04a9ac9a855bb3b5aa0008767e142a84999aa36be5c8bdaaf705f09fdc","10e742aabb08db15a9748fdda0830979d3976b043af2989c273dd2500a073d23","f8c5d9db1577fc460a9f17bee5eb54be22484b4354fb79430640f2547e4697ef","4ff5ea4131af82549d9ff8eed5f105e570d8c789fb4b3a17c545df3cbef3f06c","2ecdef4667a42cc26f6179231427d5e05dddcfab813175e333a02c7c2d51afe7","6bbaf56145d3037db230641f3f979e1a6680be334eb74d2c4ffaa4c2ef0605aa","e068c7dd6b64d2d10bfd1b3b55ec4bee04dde9d2d34097eee45306a46c5ceec0","0e84f0145fb0f514d3049f612205bb35ed99275f1c71dd4ebead12d5b3416c43","26e598e2abfef3f2513f846769b048151e3632cc1573bb348423d62c63490b25","6d5faa7d926ffc542022c568a2152458d6653db9476f06238e77e630bbb5df8c","f89362f33bf75462e89de94eee94f5937d0a7493ea1d5b09283174905b85a64d","eb44f0fcddfbbcc152d2d51beaf0a7010bd9cd9e6016dfe844f693861c5c2419","f7a5210732f1b8121da1a505212710294c3fefe7fc8ad968f8a1a85c3d7123e3","0f7695978d593085b2cd1383b5b877e97e333816a943cf1b872080e2321c87cb","c99d267b6417fce0bb04e360aaa47a028a0da4356b2e5c4672411e71d57b2384",{"version":"b93553cdc56ced465b8930c70fc1f4b867bbf9d9fc16fbf1b515a3fe1dfaba1a","signature":"f161523b8c1ce8dedfbf499c75c75dc4488486178bf29772c18a2cc781c4509a"},{"version":"085ced983848b70e121a501c886d9737f3a22b96b97bf8153b35001f32414ed6","signature":"0e18f5db7706bfe77e1043afb6bdaf19f035b0af891e68a05327eeb8e70d6ba2"},{"version":"c65b51d1536becc7369418e7193516be97eb93ccc9174878638647c82e9da1bc","signature":"66d74555f9d6c8d610b2244cf28378c8b7118d02d55c1798cab7fdd361f762e5"},{"version":"f90e230d88253d84bdcdde3c6cf6e4d057726bb320335ae1d31c8d4a5bba2aff","signature":"c6879a80982611139f649d53e08cddce04aecc79e0ed249c60fd942cdd9e11dc"},{"version":"954b54d9a0726ec9e655ffafd50dd88cf4ab40aaa0888e09f0b2504b8ec5f1bc","signature":"711aaac62498bcad3f6292ca8d3202683e32e4dd6ed346f4adce3d25562b5a89"},{"version":"45ea00158b5f1a055f09f2380a1dcaa9297251ac1a35a8494550799a8b648136","signature":"a33581a08facad509f00407757716e1e45f8da9eede58715ee196eddc71769fc"},{"version":"0ad26b4d61a6bcb4c3d095bb33273c19463dca91af21ae0d292499f0615c32e5","signature":"8d969d386ba0a4736dbfe32a92a8d648ab9494e01ee57bc7df921f0dde000ade"},{"version":"0901a93bf39c1ad13262ad8e8f6d3da788e71c0c44cd7c7a85299967946255a4","signature":"fd97b8b25c4c3d067951bac07dd6bbb3b84e628bc7dbbd8dda58e91c36205ca8"},{"version":"5ff400b7eb2156addfe821ea18a558fc1257fe5ec064332ba48ae1bdb4852390","signature":"c2f224d85d7e8972f0235aeb93785f39820bd6cff51e5a59c482bbe298c95ed7"},{"version":"8efe23b829b37022239050fe36ba8414a202035a6c9e6c7bef4ba1a4869ee8f5","signature":"9e7cbb9548c560279ee4af597ae97cce8ada22254681662784c676806c11e2b5"},{"version":"50bb8c3fc73cb7caa75dbffbfd8aaee149c65cb4f20a291a56cfcebc36d84097","signature":"ef61ef8662abed1d6b75e727e5efb61b25f2ea68b66bdd044a95cc57d818fb67"},{"version":"f440bded2be0b2f1e82dae9bcb96cf0f1fa104b8268fc1727fed8462586192ed","signature":"37fbbcebc5ebd95004d2589007456315a42603dc42037bc250030e0dc2419e83"},{"version":"2ad2ef9c918bb051f41aa6c0c35d23bbcc56b35b94331dfe539d5978f49772c3","signature":"9880dfe3bfc2431c115ad8f53f5aa386ab6ccd8f7ea68fa1f3e9119e2ee8d5e2"}],"root":[[84,96]],"options":{"allowJs":false,"declaration":true,"declarationDir":"./","declarationMap":false,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":1,"module":99,"noImplicitAny":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":false,"target":7,"tsBuildInfoFile":"./.dts.tsbuildinfo"},"referencedMap":[[73,1],[65,1],[76,2],[75,1],[72,1],[69,1],[70,1],[74,1],[66,3],[68,4],[67,5],[64,5],[71,1],[82,6],[81,7],[83,8],[79,9],[78,10],[77,11],[93,12],[86,13],[87,14],[88,15],[89,15],[90,16],[91,17],[92,17],[84,18],[95,19],[94,20],[96,21],[85,22],[55,23],[56,24],[57,25],[58,26],[59,27],[61,28],[62,29]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96],"version":"5.9.3"}
@@ -1,3 +1,2 @@
1
1
  import type { LGridProps } from '../types';
2
2
  export declare const LGrid: import("vue").DefineComponent<LGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LGridProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
- //# sourceMappingURL=LGrid.d.ts.map
@@ -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
  * ***********************************
@@ -55,8 +55,8 @@ const LGrid = defineComponent({
55
55
  resize();
56
56
  });
57
57
  onBeforeUnmount(() => observer?.disconnect());
58
- watch(() => props.breakpoint, (value) => {
59
- activeBreakpoint.value = value ?? props.document.defaultBreakpointId;
58
+ watch(() => [props.breakpoint, props.document.defaultBreakpointId], ([value, defaultBreakpoint]) => {
59
+ activeBreakpoint.value = value ?? defaultBreakpoint;
60
60
  });
61
61
  expose({ getBreakpoint: () => activeBreakpoint.value });
62
62
  return () => h("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"LGrid.js","names":[],"sources":["../../src/components/LGrid.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n ref,\n type PropType,\n watch,\n} from 'vue'\nimport { resolveGridStyle, resolveItemStyle } from '@composy/layout-runtime'\nimport type { LGridProps } from '../types'\nimport {\n renderMaterialForTarget,\n type VueMaterialSource,\n} from './material-renderer'\n\nexport const LGrid = defineComponent<LGridProps>({\n name: 'LGrid',\n props: {\n document: { type: Object, required: true },\n breakpoint: { type: String, default: undefined },\n readonly: { type: Boolean, default: false },\n materials: {\n type: [Object, Array] as PropType<VueMaterialSource>,\n default: undefined,\n },\n target: { type: String, default: 'vue' },\n },\n setup(props, { slots, expose }) {\n const root = ref<HTMLElement>()\n const activeBreakpoint = ref(\n props.breakpoint ?? props.document.defaultBreakpointId\n )\n const resolved = computed(\n () =>\n props.document.breakpoints.find(\n bp => bp.id === activeBreakpoint.value\n ) ?? props.document.breakpoints[0]\n )\n const gridStyle = computed(() =>\n resolveGridStyle(props.document, resolved.value.id)\n )\n const resize = () => {\n if (props.breakpoint || !root.value) return\n const width = root.value.getBoundingClientRect().width\n const match = props.document.breakpoints.find(\n bp =>\n (bp.minWidth === undefined || width >= bp.minWidth) &&\n (bp.maxWidth === undefined || width < bp.maxWidth)\n )\n activeBreakpoint.value = match?.id ?? props.document.defaultBreakpointId\n }\n let observer: ResizeObserver | undefined\n onMounted(() => {\n if (typeof ResizeObserver !== 'undefined' && root.value) {\n observer = new ResizeObserver(resize)\n observer.observe(root.value)\n }\n resize()\n })\n onBeforeUnmount(() => observer?.disconnect())\n watch(\n () => props.breakpoint,\n value => {\n activeBreakpoint.value = value ?? props.document.defaultBreakpointId\n }\n )\n expose({ getBreakpoint: () => activeBreakpoint.value })\n return () =>\n h(\n 'div',\n {\n ref: root,\n class: 'ldesign-layout-grid',\n style: gridStyle.value,\n dir: gridStyle.value.direction,\n },\n props.document.items.map(item => {\n const placement = item.layout[activeBreakpoint.value]\n if (!placement || placement.hidden) return null\n return h(\n 'div',\n {\n class: 'ldesign-layout-item',\n 'data-layout-item-id': item.id,\n 'data-layout-type': item.type,\n style: resolveItemStyle(item, activeBreakpoint.value),\n tabindex: props.readonly ? undefined : 0,\n },\n slots.item?.({\n item,\n placement,\n breakpointId: activeBreakpoint.value,\n }) ??\n slots.default?.({\n item,\n placement,\n breakpointId: activeBreakpoint.value,\n }) ??\n renderMaterialForTarget(\n props.materials as VueMaterialSource,\n item,\n props.target as 'vue' | 'webcomponent',\n placement,\n activeBreakpoint.value\n )\n )\n })\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAiBO,MAAM,QAAQ,gBAA4B;CAC/C,MAAM;CACN,OAAO;EACL,UAAU;GAAE,MAAM;GAAQ,UAAU;EAAK;EACzC,YAAY;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC/C,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,WAAW;GACT,MAAM,CAAC,QAAQ,KAAK;GACpB,SAAS,KAAA;EACX;EACA,QAAQ;GAAE,MAAM;GAAQ,SAAS;EAAM;CACzC;CACA,MAAM,OAAO,EAAE,OAAO,UAAU;EAC9B,MAAM,OAAO,IAAiB;EAC9B,MAAM,mBAAmB,IACvB,MAAM,cAAc,MAAM,SAAS,mBACrC;EACA,MAAM,WAAW,eAEb,MAAM,SAAS,YAAY,MACzB,OAAM,GAAG,OAAO,iBAAiB,KACnC,KAAK,MAAM,SAAS,YAAY,EACpC;EACA,MAAM,YAAY,eAChB,iBAAiB,MAAM,UAAU,SAAS,MAAM,EAAE,CACpD;EACA,MAAM,eAAe;GACnB,IAAI,MAAM,cAAc,CAAC,KAAK,OAAO;GACrC,MAAM,QAAQ,KAAK,MAAM,sBAAsB,CAAA,CAAE;GACjD,MAAM,QAAQ,MAAM,SAAS,YAAY,MACvC,QACG,GAAG,aAAa,KAAA,KAAa,SAAS,GAAG,cACzC,GAAG,aAAa,KAAA,KAAa,QAAQ,GAAG,SAC7C;GACA,iBAAiB,QAAQ,OAAO,MAAM,MAAM,SAAS;EACvD;EACA,IAAI;EACJ,gBAAgB;GACd,IAAI,OAAO,mBAAmB,eAAe,KAAK,OAAO;IACvD,WAAW,IAAI,eAAe,MAAM;IACpC,SAAS,QAAQ,KAAK,KAAK;GAC7B;GACA,OAAO;EACT,CAAC;EACD,sBAAsB,UAAU,WAAW,CAAC;EAC5C,YACQ,MAAM,aACZ,UAAS;GACP,iBAAiB,QAAQ,SAAS,MAAM,SAAS;EACnD,CACF;EACA,OAAO,EAAE,qBAAqB,iBAAiB,MAAM,CAAC;EACtD,aACE,EACE,OACA;GACE,KAAK;GACL,OAAO;GACP,OAAO,UAAU;GACjB,KAAK,UAAU,MAAM;EACvB,GACA,MAAM,SAAS,MAAM,KAAI,SAAQ;GAC/B,MAAM,YAAY,KAAK,OAAO,iBAAiB;GAC/C,IAAI,CAAC,aAAa,UAAU,QAAQ,OAAO;GAC3C,OAAO,EACL,OACA;IACE,OAAO;IACP,uBAAuB,KAAK;IAC5B,oBAAoB,KAAK;IACzB,OAAO,iBAAiB,MAAM,iBAAiB,KAAK;IACpD,UAAU,MAAM,WAAW,KAAA,IAAY;GACzC,GACA,MAAM,OAAO;IACX;IACA;IACA,cAAc,iBAAiB;GACjC,CAAC,KACC,MAAM,UAAU;IACd;IACA;IACA,cAAc,iBAAiB;GACjC,CAAC,KACD,wBACE,MAAM,WACN,MACA,MAAM,QACN,WACA,iBAAiB,KACnB,CACJ;EACF,CAAC,CACH;CACJ;AACF,CAAC"}
1
+ {"version":3,"file":"LGrid.js","names":[],"sources":["../../src/components/LGrid.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n ref,\n type PropType,\n watch,\n} from 'vue'\nimport { resolveGridStyle, resolveItemStyle } from '@composy/layout-runtime'\nimport type { LGridProps } from '../types'\nimport {\n renderMaterialForTarget,\n type VueMaterialSource,\n} from './material-renderer'\n\nexport const LGrid = defineComponent<LGridProps>({\n name: 'LGrid',\n props: {\n document: { type: Object, required: true },\n breakpoint: { type: String, default: undefined },\n readonly: { type: Boolean, default: false },\n materials: {\n type: [Object, Array] as PropType<VueMaterialSource>,\n default: undefined,\n },\n target: { type: String, default: 'vue' },\n },\n setup(props, { slots, expose }) {\n const root = ref<HTMLElement>()\n const activeBreakpoint = ref(\n props.breakpoint ?? props.document.defaultBreakpointId\n )\n const resolved = computed(\n () =>\n props.document.breakpoints.find(\n bp => bp.id === activeBreakpoint.value\n ) ?? props.document.breakpoints[0]\n )\n const gridStyle = computed(() =>\n resolveGridStyle(props.document, resolved.value.id)\n )\n const resize = () => {\n if (props.breakpoint || !root.value) return\n const width = root.value.getBoundingClientRect().width\n const match = props.document.breakpoints.find(\n bp =>\n (bp.minWidth === undefined || width >= bp.minWidth) &&\n (bp.maxWidth === undefined || width < bp.maxWidth)\n )\n activeBreakpoint.value = match?.id ?? props.document.defaultBreakpointId\n }\n let observer: ResizeObserver | undefined\n onMounted(() => {\n if (typeof ResizeObserver !== 'undefined' && root.value) {\n observer = new ResizeObserver(resize)\n observer.observe(root.value)\n }\n resize()\n })\n onBeforeUnmount(() => observer?.disconnect())\n watch(\n () => [props.breakpoint, props.document.defaultBreakpointId],\n ([value, defaultBreakpoint]) => {\n activeBreakpoint.value = value ?? defaultBreakpoint\n }\n )\n expose({ getBreakpoint: () => activeBreakpoint.value })\n return () =>\n h(\n 'div',\n {\n ref: root,\n class: 'ldesign-layout-grid',\n style: gridStyle.value,\n dir: gridStyle.value.direction,\n },\n props.document.items.map(item => {\n const placement = item.layout[activeBreakpoint.value]\n if (!placement || placement.hidden) return null\n return h(\n 'div',\n {\n class: 'ldesign-layout-item',\n 'data-layout-item-id': item.id,\n 'data-layout-type': item.type,\n style: resolveItemStyle(item, activeBreakpoint.value),\n tabindex: props.readonly ? undefined : 0,\n },\n slots.item?.({\n item,\n placement,\n breakpointId: activeBreakpoint.value,\n }) ??\n slots.default?.({\n item,\n placement,\n breakpointId: activeBreakpoint.value,\n }) ??\n renderMaterialForTarget(\n props.materials as VueMaterialSource,\n item,\n props.target as 'vue' | 'webcomponent',\n placement,\n activeBreakpoint.value\n )\n )\n })\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAiBO,MAAM,QAAQ,gBAA4B;CAC/C,MAAM;CACN,OAAO;EACL,UAAU;GAAE,MAAM;GAAQ,UAAU;EAAK;EACzC,YAAY;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC/C,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,WAAW;GACT,MAAM,CAAC,QAAQ,KAAK;GACpB,SAAS,KAAA;EACX;EACA,QAAQ;GAAE,MAAM;GAAQ,SAAS;EAAM;CACzC;CACA,MAAM,OAAO,EAAE,OAAO,UAAU;EAC9B,MAAM,OAAO,IAAiB;EAC9B,MAAM,mBAAmB,IACvB,MAAM,cAAc,MAAM,SAAS,mBACrC;EACA,MAAM,WAAW,eAEb,MAAM,SAAS,YAAY,MACzB,OAAM,GAAG,OAAO,iBAAiB,KACnC,KAAK,MAAM,SAAS,YAAY,EACpC;EACA,MAAM,YAAY,eAChB,iBAAiB,MAAM,UAAU,SAAS,MAAM,EAAE,CACpD;EACA,MAAM,eAAe;GACnB,IAAI,MAAM,cAAc,CAAC,KAAK,OAAO;GACrC,MAAM,QAAQ,KAAK,MAAM,sBAAsB,CAAA,CAAE;GACjD,MAAM,QAAQ,MAAM,SAAS,YAAY,MACvC,QACG,GAAG,aAAa,KAAA,KAAa,SAAS,GAAG,cACzC,GAAG,aAAa,KAAA,KAAa,QAAQ,GAAG,SAC7C;GACA,iBAAiB,QAAQ,OAAO,MAAM,MAAM,SAAS;EACvD;EACA,IAAI;EACJ,gBAAgB;GACd,IAAI,OAAO,mBAAmB,eAAe,KAAK,OAAO;IACvD,WAAW,IAAI,eAAe,MAAM;IACpC,SAAS,QAAQ,KAAK,KAAK;GAC7B;GACA,OAAO;EACT,CAAC;EACD,sBAAsB,UAAU,WAAW,CAAC;EAC5C,YACQ,CAAC,MAAM,YAAY,MAAM,SAAS,mBAAmB,IAC1D,CAAC,OAAO,uBAAuB;GAC9B,iBAAiB,QAAQ,SAAS;EACpC,CACF;EACA,OAAO,EAAE,qBAAqB,iBAAiB,MAAM,CAAC;EACtD,aACE,EACE,OACA;GACE,KAAK;GACL,OAAO;GACP,OAAO,UAAU;GACjB,KAAK,UAAU,MAAM;EACvB,GACA,MAAM,SAAS,MAAM,KAAI,SAAQ;GAC/B,MAAM,YAAY,KAAK,OAAO,iBAAiB;GAC/C,IAAI,CAAC,aAAa,UAAU,QAAQ,OAAO;GAC3C,OAAO,EACL,OACA;IACE,OAAO;IACP,uBAAuB,KAAK;IAC5B,oBAAoB,KAAK;IACzB,OAAO,iBAAiB,MAAM,iBAAiB,KAAK;IACpD,UAAU,MAAM,WAAW,KAAA,IAAY;GACzC,GACA,MAAM,OAAO;IACX;IACA;IACA,cAAc,iBAAiB;GACjC,CAAC,KACC,MAAM,UAAU;IACd;IACA;IACA,cAAc,iBAAiB;GACjC,CAAC,KACD,wBACE,MAAM,WACN,MACA,MAAM,QACN,WACA,iBAAiB,KACnB,CACJ;EACF,CAAC,CACH;CACJ;AACF,CAAC"}
@@ -49,4 +49,3 @@ export declare const LGridItem: import("vue").DefineComponent<import("vue").Extr
49
49
  materials: VueMaterialSource;
50
50
  target: string;
51
51
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
52
- //# sourceMappingURL=LGridItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LGridItem.d.ts","sourceRoot":"","sources":["../../src/components/LGridItem.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,iBAAiB,EACvB,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,SAAS;;cAGM,MAAM,UAAU;;;;cACX,MAAM,eAAe;;;;;;;;cAGvB,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;;cAJ9B,MAAM,UAAU;;;;cACX,MAAM,eAAe;;;;;;;;cAGvB,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;4EA4BxD,CAAA"}
1
+ {"version":3,"file":"LGridItem.d.ts","sourceRoot":"","sources":["../../src/components/LGridItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,SAAS;;cAGM,MAAM,UAAU;;;;cACX,MAAM,eAAe;;;;;;;;cAGvB,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;;cAJ9B,MAAM,UAAU;;;;cACX,MAAM,eAAe;;;;;;;;cAGvB,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;4EA6BxD,CAAA"}
@@ -2,13 +2,14 @@
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
  * ***********************************
9
9
  */
10
10
  import { renderMaterialForTarget } from "./material-renderer.js";
11
11
  import { defineComponent, h } from "vue";
12
+ import { resolveItemStyle } from "@composy/layout-runtime";
12
13
  //#region src/components/LGridItem.ts
13
14
  const LGridItem = defineComponent({
14
15
  name: "LGridItem",
@@ -38,7 +39,8 @@ const LGridItem = defineComponent({
38
39
  return () => h("div", {
39
40
  class: "ldesign-layout-item",
40
41
  "data-layout-item-id": props.item.id,
41
- "data-layout-type": props.item.type
42
+ "data-layout-type": props.item.type,
43
+ style: resolveItemStyle(props.item, props.breakpointId)
42
44
  }, slots.default?.({
43
45
  item: props.item,
44
46
  placement: props.placement,
@@ -1 +1 @@
1
- {"version":3,"file":"LGridItem.js","names":[],"sources":["../../src/components/LGridItem.ts"],"sourcesContent":["import { defineComponent, h, type PropType } from 'vue'\nimport type { LayoutNode, LayoutPlacement } from '@composy/layout-core'\nimport {\n renderMaterialForTarget,\n type VueMaterialSource,\n} from './material-renderer'\n\nexport const LGridItem = defineComponent({\n name: 'LGridItem',\n props: {\n item: { type: Object as () => LayoutNode, required: true },\n placement: { type: Object as () => LayoutPlacement, required: true },\n breakpointId: { type: String, required: true },\n materials: {\n type: [Object, Array] as PropType<VueMaterialSource>,\n default: undefined,\n },\n target: { type: String, default: 'vue' },\n },\n setup(props, { slots }) {\n return () =>\n h(\n 'div',\n {\n class: 'ldesign-layout-item',\n 'data-layout-item-id': props.item.id,\n 'data-layout-type': props.item.type,\n },\n slots.default?.({\n item: props.item,\n placement: props.placement,\n breakpointId: props.breakpointId,\n }) ??\n renderMaterialForTarget(\n props.materials as VueMaterialSource,\n props.item,\n props.target as 'vue' | 'webcomponent',\n props.placement,\n props.breakpointId\n )\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;AAOO,MAAM,YAAY,gBAAgB;CACvC,MAAM;CACN,OAAO;EACL,MAAM;GAAE,MAAM;GAA4B,UAAU;EAAK;EACzD,WAAW;GAAE,MAAM;GAAiC,UAAU;EAAK;EACnE,cAAc;GAAE,MAAM;GAAQ,UAAU;EAAK;EAC7C,WAAW;GACT,MAAM,CAAC,QAAQ,KAAK;GACpB,SAAS,KAAA;EACX;EACA,QAAQ;GAAE,MAAM;GAAQ,SAAS;EAAM;CACzC;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,aACE,EACE,OACA;GACE,OAAO;GACP,uBAAuB,MAAM,KAAK;GAClC,oBAAoB,MAAM,KAAK;EACjC,GACA,MAAM,UAAU;GACd,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,cAAc,MAAM;EACtB,CAAC,KACC,wBACE,MAAM,WACN,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,YACR,CACJ;CACJ;AACF,CAAC"}
1
+ {"version":3,"file":"LGridItem.js","names":[],"sources":["../../src/components/LGridItem.ts"],"sourcesContent":["import { defineComponent, h, type PropType } from 'vue'\nimport type { LayoutNode, LayoutPlacement } from '@composy/layout-core'\nimport { resolveItemStyle } from '@composy/layout-runtime'\nimport {\n renderMaterialForTarget,\n type VueMaterialSource,\n} from './material-renderer'\n\nexport const LGridItem = defineComponent({\n name: 'LGridItem',\n props: {\n item: { type: Object as () => LayoutNode, required: true },\n placement: { type: Object as () => LayoutPlacement, required: true },\n breakpointId: { type: String, required: true },\n materials: {\n type: [Object, Array] as PropType<VueMaterialSource>,\n default: undefined,\n },\n target: { type: String, default: 'vue' },\n },\n setup(props, { slots }) {\n return () =>\n h(\n 'div',\n {\n class: 'ldesign-layout-item',\n 'data-layout-item-id': props.item.id,\n 'data-layout-type': props.item.type,\n style: resolveItemStyle(props.item, props.breakpointId),\n },\n slots.default?.({\n item: props.item,\n placement: props.placement,\n breakpointId: props.breakpointId,\n }) ??\n renderMaterialForTarget(\n props.materials as VueMaterialSource,\n props.item,\n props.target as 'vue' | 'webcomponent',\n props.placement,\n props.breakpointId\n )\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAQO,MAAM,YAAY,gBAAgB;CACvC,MAAM;CACN,OAAO;EACL,MAAM;GAAE,MAAM;GAA4B,UAAU;EAAK;EACzD,WAAW;GAAE,MAAM;GAAiC,UAAU;EAAK;EACnE,cAAc;GAAE,MAAM;GAAQ,UAAU;EAAK;EAC7C,WAAW;GACT,MAAM,CAAC,QAAQ,KAAK;GACpB,SAAS,KAAA;EACX;EACA,QAAQ;GAAE,MAAM;GAAQ,SAAS;EAAM;CACzC;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,aACE,EACE,OACA;GACE,OAAO;GACP,uBAAuB,MAAM,KAAK;GAClC,oBAAoB,MAAM,KAAK;GAC/B,OAAO,iBAAiB,MAAM,MAAM,MAAM,YAAY;EACxD,GACA,MAAM,UAAU;GACd,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,cAAc,MAAM;EACtB,CAAC,KACC,wBACE,MAAM,WACN,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,YACR,CACJ;CACJ;AACF,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { LayoutDocument } from '@composy/layout-core';
1
+ import { type PropType } from 'vue';
2
+ import type { LayoutDocument, MaterialDefinition, MaterialRegistry } from '@composy/layout-core';
2
3
  import type { LayoutEditorEngine, LayoutEditorOptions } from '@composy/layout-editor';
3
4
  export declare const LLayoutEditor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  document: {
@@ -15,7 +16,7 @@ export declare const LLayoutEditor: import("vue").DefineComponent<import("vue").
15
16
  };
16
17
  preview: () => LayoutEditorOptions["preview"];
17
18
  materials: {
18
- type: ObjectConstructor;
19
+ type: PropType<MaterialRegistry | readonly MaterialDefinition[]>;
19
20
  default: any;
20
21
  };
21
22
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
@@ -35,7 +36,7 @@ export declare const LLayoutEditor: import("vue").DefineComponent<import("vue").
35
36
  };
36
37
  preview: () => LayoutEditorOptions["preview"];
37
38
  materials: {
38
- type: ObjectConstructor;
39
+ type: PropType<MaterialRegistry | readonly MaterialDefinition[]>;
39
40
  default: any;
40
41
  };
41
42
  }>> & Readonly<{
@@ -44,6 +45,5 @@ export declare const LLayoutEditor: import("vue").DefineComponent<import("vue").
44
45
  onReady?: (...args: any[]) => any;
45
46
  }>, {
46
47
  mode: "edit" | "preview" | "readonly";
47
- materials: Record<string, any>;
48
+ materials: MaterialRegistry | readonly MaterialDefinition<import("@composy/layout-core").JsonRecord>[];
48
49
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
49
- //# sourceMappingURL=LLayoutEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LLayoutEditor.d.ts","sourceRoot":"","sources":["../../src/components/LLayoutEditor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,aAAa;;cAGM,MAAM,cAAc;;;;cACtB,MAAM,kBAAkB;;;;cAEhC,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU;;;aAGpC,MAAM,mBAAmB,CAAC,SAAS,CAAC;;;;;;;;;cAN3B,MAAM,cAAc;;;;cACtB,MAAM,kBAAkB;;;;cAEhC,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU;;;aAGpC,MAAM,mBAAmB,CAAC,SAAS,CAAC;;;;;;;;;;;;4EAyDzD,CAAA"}
1
+ {"version":3,"file":"LLayoutEditor.d.ts","sourceRoot":"","sources":["../../src/components/LLayoutEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,QAAQ,EAEd,MAAM,KAAK,CAAA;AAEZ,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,aAAa;;cAGM,MAAM,cAAc;;;;cACtB,MAAM,kBAAkB;;;;cAEhC,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU;;;aAGpC,MAAM,mBAAmB,CAAC,SAAS,CAAC;;cAE5B,QAAQ,CAC/B,gBAAgB,GAAG,SAAS,kBAAkB,EAAE,CACjD;;;;;;;cAVyB,MAAM,cAAc;;;;cACtB,MAAM,kBAAkB;;;;cAEhC,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU;;;aAGpC,MAAM,mBAAmB,CAAC,SAAS,CAAC;;cAE5B,QAAQ,CAC/B,gBAAgB,GAAG,SAAS,kBAAkB,EAAE,CACjD;;;;;;;;;;4EA0DL,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
  * ***********************************
@@ -27,7 +27,7 @@ const LLayoutEditor = defineComponent({
27
27
  },
28
28
  preview: Object,
29
29
  materials: {
30
- type: Object,
30
+ type: [Object, Array],
31
31
  default: void 0
32
32
  }
33
33
  },
@@ -1 +1 @@
1
- {"version":3,"file":"LLayoutEditor.js","names":[],"sources":["../../src/components/LLayoutEditor.ts"],"sourcesContent":["import {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n shallowRef,\n watch,\n} from 'vue'\nimport { createLayoutEditor } from '@composy/layout-editor'\nimport type {\n LayoutDocument,\n MaterialDefinition,\n MaterialRegistry,\n} from '@composy/layout-core'\nimport type {\n LayoutEditorEngine,\n LayoutEditorOptions,\n} from '@composy/layout-editor'\n\nexport const LLayoutEditor = defineComponent({\n name: 'LLayoutEditor',\n props: {\n document: { type: Object as () => LayoutDocument, required: true },\n engine: { type: Object as () => LayoutEditorEngine, required: true },\n mode: {\n type: String as () => 'edit' | 'preview' | 'readonly',\n default: 'edit',\n },\n preview: Object as () => LayoutEditorOptions['preview'],\n materials: { type: Object, default: undefined },\n },\n emits: ['update:document', 'change', 'ready'],\n setup(props, { slots, emit, expose }) {\n const editor = shallowRef(\n createLayoutEditor({\n document: props.document,\n engine: props.engine,\n materials: props.materials as\n MaterialRegistry | readonly MaterialDefinition[] | undefined,\n preview: props.preview,\n })\n )\n let lastEmittedDocument = JSON.stringify(props.document)\n onMounted(() => {\n editor.value.on('document:change', event => {\n lastEmittedDocument = JSON.stringify(event.document)\n emit('update:document', event.document)\n emit('change', event)\n })\n editor.value.mount()\n editor.value.setMode(props.mode)\n emit('ready', editor.value)\n })\n watch(\n () => props.document,\n value => {\n const next = JSON.stringify(value)\n if (next !== lastEmittedDocument) {\n editor.value.load(value)\n lastEmittedDocument = next\n }\n }\n )\n watch(\n () => props.mode,\n value => editor.value.setMode(value)\n )\n const onKeydown = (event: KeyboardEvent) => {\n editor.value.handleKeyboard(event)\n }\n onBeforeUnmount(() => editor.value.destroy())\n expose({ editor })\n return () =>\n h(\n 'div',\n {\n class: 'ldesign-layout-editor',\n 'data-layout-mode': props.mode,\n 'aria-keyshortcuts':\n 'ArrowLeft ArrowRight ArrowUp ArrowDown Delete Control+C Control+V Control+X Control+D',\n onKeydown,\n },\n slots.default?.({ editor: editor.value })\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;AAmBO,MAAM,gBAAgB,gBAAgB;CAC3C,MAAM;CACN,OAAO;EACL,UAAU;GAAE,MAAM;GAAgC,UAAU;EAAK;EACjE,QAAQ;GAAE,MAAM;GAAoC,UAAU;EAAK;EACnE,MAAM;GACJ,MAAM;GACN,SAAS;EACX;EACA,SAAS;EACT,WAAW;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;CAChD;CACA,OAAO;EAAC;EAAmB;EAAU;CAAO;CAC5C,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACpC,MAAM,SAAS,WACb,mBAAmB;GACjB,UAAU,MAAM;GAChB,QAAQ,MAAM;GACd,WAAW,MAAM;GAEjB,SAAS,MAAM;EACjB,CAAC,CACH;EACA,IAAI,sBAAsB,KAAK,UAAU,MAAM,QAAQ;EACvD,gBAAgB;GACd,OAAO,MAAM,GAAG,oBAAmB,UAAS;IAC1C,sBAAsB,KAAK,UAAU,MAAM,QAAQ;IACnD,KAAK,mBAAmB,MAAM,QAAQ;IACtC,KAAK,UAAU,KAAK;GACtB,CAAC;GACD,OAAO,MAAM,MAAM;GACnB,OAAO,MAAM,QAAQ,MAAM,IAAI;GAC/B,KAAK,SAAS,OAAO,KAAK;EAC5B,CAAC;EACD,YACQ,MAAM,WACZ,UAAS;GACP,MAAM,OAAO,KAAK,UAAU,KAAK;GACjC,IAAI,SAAS,qBAAqB;IAChC,OAAO,MAAM,KAAK,KAAK;IACvB,sBAAsB;GACxB;EACF,CACF;EACA,YACQ,MAAM,OACZ,UAAS,OAAO,MAAM,QAAQ,KAAK,CACrC;EACA,MAAM,aAAa,UAAyB;GAC1C,OAAO,MAAM,eAAe,KAAK;EACnC;EACA,sBAAsB,OAAO,MAAM,QAAQ,CAAC;EAC5C,OAAO,EAAE,OAAO,CAAC;EACjB,aACE,EACE,OACA;GACE,OAAO;GACP,oBAAoB,MAAM;GAC1B,qBACE;GACF;EACF,GACA,MAAM,UAAU,EAAE,QAAQ,OAAO,MAAM,CAAC,CAC1C;CACJ;AACF,CAAC"}
1
+ {"version":3,"file":"LLayoutEditor.js","names":[],"sources":["../../src/components/LLayoutEditor.ts"],"sourcesContent":["import {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n shallowRef,\n type PropType,\n watch,\n} from 'vue'\nimport { createLayoutEditor } from '@composy/layout-editor'\nimport type {\n LayoutDocument,\n MaterialDefinition,\n MaterialRegistry,\n} from '@composy/layout-core'\nimport type {\n LayoutEditorEngine,\n LayoutEditorOptions,\n} from '@composy/layout-editor'\n\nexport const LLayoutEditor = defineComponent({\n name: 'LLayoutEditor',\n props: {\n document: { type: Object as () => LayoutDocument, required: true },\n engine: { type: Object as () => LayoutEditorEngine, required: true },\n mode: {\n type: String as () => 'edit' | 'preview' | 'readonly',\n default: 'edit',\n },\n preview: Object as () => LayoutEditorOptions['preview'],\n materials: {\n type: [Object, Array] as PropType<\n MaterialRegistry | readonly MaterialDefinition[]\n >,\n default: undefined,\n },\n },\n emits: ['update:document', 'change', 'ready'],\n setup(props, { slots, emit, expose }) {\n const editor = shallowRef(\n createLayoutEditor({\n document: props.document,\n engine: props.engine,\n materials: props.materials as\n MaterialRegistry | readonly MaterialDefinition[] | undefined,\n preview: props.preview,\n })\n )\n let lastEmittedDocument = JSON.stringify(props.document)\n onMounted(() => {\n editor.value.on('document:change', event => {\n lastEmittedDocument = JSON.stringify(event.document)\n emit('update:document', event.document)\n emit('change', event)\n })\n editor.value.mount()\n editor.value.setMode(props.mode)\n emit('ready', editor.value)\n })\n watch(\n () => props.document,\n value => {\n const next = JSON.stringify(value)\n if (next !== lastEmittedDocument) {\n editor.value.load(value)\n lastEmittedDocument = next\n }\n }\n )\n watch(\n () => props.mode,\n value => editor.value.setMode(value)\n )\n const onKeydown = (event: KeyboardEvent) => {\n editor.value.handleKeyboard(event)\n }\n onBeforeUnmount(() => editor.value.destroy())\n expose({ editor })\n return () =>\n h(\n 'div',\n {\n class: 'ldesign-layout-editor',\n 'data-layout-mode': props.mode,\n 'aria-keyshortcuts':\n 'ArrowLeft ArrowRight ArrowUp ArrowDown Delete Control+C Control+V Control+X Control+D',\n onKeydown,\n },\n slots.default?.({ editor: editor.value })\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;AAoBO,MAAM,gBAAgB,gBAAgB;CAC3C,MAAM;CACN,OAAO;EACL,UAAU;GAAE,MAAM;GAAgC,UAAU;EAAK;EACjE,QAAQ;GAAE,MAAM;GAAoC,UAAU;EAAK;EACnE,MAAM;GACJ,MAAM;GACN,SAAS;EACX;EACA,SAAS;EACT,WAAW;GACT,MAAM,CAAC,QAAQ,KAAK;GAGpB,SAAS,KAAA;EACX;CACF;CACA,OAAO;EAAC;EAAmB;EAAU;CAAO;CAC5C,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACpC,MAAM,SAAS,WACb,mBAAmB;GACjB,UAAU,MAAM;GAChB,QAAQ,MAAM;GACd,WAAW,MAAM;GAEjB,SAAS,MAAM;EACjB,CAAC,CACH;EACA,IAAI,sBAAsB,KAAK,UAAU,MAAM,QAAQ;EACvD,gBAAgB;GACd,OAAO,MAAM,GAAG,oBAAmB,UAAS;IAC1C,sBAAsB,KAAK,UAAU,MAAM,QAAQ;IACnD,KAAK,mBAAmB,MAAM,QAAQ;IACtC,KAAK,UAAU,KAAK;GACtB,CAAC;GACD,OAAO,MAAM,MAAM;GACnB,OAAO,MAAM,QAAQ,MAAM,IAAI;GAC/B,KAAK,SAAS,OAAO,KAAK;EAC5B,CAAC;EACD,YACQ,MAAM,WACZ,UAAS;GACP,MAAM,OAAO,KAAK,UAAU,KAAK;GACjC,IAAI,SAAS,qBAAqB;IAChC,OAAO,MAAM,KAAK,KAAK;IACvB,sBAAsB;GACxB;EACF,CACF;EACA,YACQ,MAAM,OACZ,UAAS,OAAO,MAAM,QAAQ,KAAK,CACrC;EACA,MAAM,aAAa,UAAyB;GAC1C,OAAO,MAAM,eAAe,KAAK;EACnC;EACA,sBAAsB,OAAO,MAAM,QAAQ,CAAC;EAC5C,OAAO,EAAE,OAAO,CAAC;EACjB,aACE,EACE,OACA;GACE,OAAO;GACP,oBAAoB,MAAM;GAC1B,qBACE;GACF;EACF,GACA,MAAM,UAAU,EAAE,QAAQ,OAAO,MAAM,CAAC,CAC1C;CACJ;AACF,CAAC"}
@@ -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
  * ***********************************