@composy/layout-vue 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/dist/index.css +2383 -0
- package/dist/index.js +2665 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.css +1 -0
- package/dist/index.min.js +1 -0
- package/es/components/LGrid.d.ts +3 -0
- package/es/components/LGrid.d.ts.map +1 -0
- package/es/components/LGrid.js +91 -0
- package/es/components/LGrid.js.map +1 -0
- package/es/components/LGridItem.d.ts +52 -0
- package/es/components/LGridItem.d.ts.map +1 -0
- package/es/components/LGridItem.js +52 -0
- package/es/components/LGridItem.js.map +1 -0
- package/es/components/LLayoutEditor.d.ts +49 -0
- package/es/components/LLayoutEditor.d.ts.map +1 -0
- package/es/components/LLayoutEditor.js +81 -0
- package/es/components/LLayoutEditor.js.map +1 -0
- package/es/components/LLayoutWorkspace.js +17 -0
- package/es/components/LLayoutWorkspace.js.map +1 -0
- package/es/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.js +2217 -0
- package/es/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/es/components/LMaterialDragSource.d.ts +55 -0
- package/es/components/LMaterialDragSource.d.ts.map +1 -0
- package/es/components/LMaterialDragSource.js +92 -0
- package/es/components/LMaterialDragSource.js.map +1 -0
- package/es/components/LMaterialRenderer.d.ts +63 -0
- package/es/components/LMaterialRenderer.d.ts.map +1 -0
- package/es/components/LMaterialRenderer.js +48 -0
- package/es/components/LMaterialRenderer.js.map +1 -0
- package/es/components/LMetricCard.d.ts +29 -0
- package/es/components/LMetricCard.d.ts.map +1 -0
- package/es/components/LMetricCard.js +39 -0
- package/es/components/LMetricCard.js.map +1 -0
- package/es/components/LTrendCard.d.ts +17 -0
- package/es/components/LTrendCard.d.ts.map +1 -0
- package/es/components/LTrendCard.js +36 -0
- package/es/components/LTrendCard.js.map +1 -0
- package/es/components/index.d.ts +10 -0
- package/es/components/index.d.ts.map +1 -0
- package/es/components/index.js +19 -0
- package/es/components/material-renderer.d.ts +26 -0
- package/es/components/material-renderer.d.ts.map +1 -0
- package/es/components/material-renderer.js +96 -0
- package/es/components/material-renderer.js.map +1 -0
- package/es/composables/index.d.ts +2 -0
- package/es/composables/index.d.ts.map +1 -0
- package/es/composables/index.js +12 -0
- package/es/composables/useLayoutEditor.d.ts +3 -0
- package/es/composables/useLayoutEditor.d.ts.map +1 -0
- package/es/composables/useLayoutEditor.js +22 -0
- package/es/composables/useLayoutEditor.js.map +1 -0
- package/es/index.d.ts +7 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +22 -0
- package/es/style/css.js +1 -0
- package/es/style/index.js +1 -0
- package/es/style/index.less +1 -0
- package/es/style/workspace.css +2370 -0
- package/es/types.d.ts +26 -0
- package/es/types.d.ts.map +1 -0
- package/es/types.js +10 -0
- package/lib/components/LGrid.cjs +92 -0
- package/lib/components/LGrid.cjs.map +1 -0
- package/lib/components/LGrid.d.ts +3 -0
- package/lib/components/LGridItem.cjs +53 -0
- package/lib/components/LGridItem.cjs.map +1 -0
- package/lib/components/LGridItem.d.ts +52 -0
- package/lib/components/LLayoutEditor.cjs +82 -0
- package/lib/components/LLayoutEditor.cjs.map +1 -0
- package/lib/components/LLayoutEditor.d.ts +49 -0
- package/lib/components/LLayoutWorkspace.cjs +21 -0
- package/lib/components/LLayoutWorkspace.cjs.map +1 -0
- package/lib/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.cjs +2217 -0
- package/lib/components/LLayoutWorkspace.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/lib/components/LMaterialDragSource.cjs +93 -0
- package/lib/components/LMaterialDragSource.cjs.map +1 -0
- package/lib/components/LMaterialDragSource.d.ts +55 -0
- package/lib/components/LMaterialRenderer.cjs +49 -0
- package/lib/components/LMaterialRenderer.cjs.map +1 -0
- package/lib/components/LMaterialRenderer.d.ts +63 -0
- package/lib/components/LMetricCard.cjs +40 -0
- package/lib/components/LMetricCard.cjs.map +1 -0
- package/lib/components/LMetricCard.d.ts +29 -0
- package/lib/components/LTrendCard.cjs +37 -0
- package/lib/components/LTrendCard.cjs.map +1 -0
- package/lib/components/LTrendCard.d.ts +17 -0
- package/lib/components/index.cjs +27 -0
- package/lib/components/index.d.ts +10 -0
- package/lib/components/material-renderer.cjs +99 -0
- package/lib/components/material-renderer.cjs.map +1 -0
- package/lib/components/material-renderer.d.ts +26 -0
- package/lib/composables/index.cjs +13 -0
- package/lib/composables/index.d.ts +2 -0
- package/lib/composables/useLayoutEditor.cjs +23 -0
- package/lib/composables/useLayoutEditor.cjs.map +1 -0
- package/lib/composables/useLayoutEditor.d.ts +3 -0
- package/lib/index.cjs +29 -0
- package/lib/index.d.ts +7 -0
- package/lib/package.json +3 -0
- package/lib/style/css.js +1 -0
- package/lib/style/index.css +2 -0
- package/lib/style/index.js +1 -0
- package/lib/style/workspace.css +2378 -0
- package/lib/types.cjs +11 -0
- package/lib/types.d.ts +26 -0
- package/package.json +117 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LDesign Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @composy/layout-vue
|
|
2
|
+
|
|
3
|
+
Vue 3 adapters for the document-first LDesign Layout packages.
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
<LGrid :document="document">
|
|
7
|
+
<template #item="{ item }">
|
|
8
|
+
<WidgetRenderer :type="item.type" :props="item.props" />
|
|
9
|
+
</template>
|
|
10
|
+
</LGrid>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
传入 `materials` 后,插槽仍然拥有最高优先级;没有插槽时会按物料的 `vue`、Web Component 或 HTML
|
|
14
|
+
renderer descriptor 自动渲染:
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<LGrid :document="document" :materials="materials" />
|
|
18
|
+
<LMaterialDragSource :editor="editor" :material="materials.get('analytics/metric')" />
|
|
19
|
+
|
|
20
|
+
<!-- 在自定义 grid-item 中复用同一套注册表解析 -->
|
|
21
|
+
<LMaterialRenderer
|
|
22
|
+
:item="item"
|
|
23
|
+
:materials="materials"
|
|
24
|
+
target="vue"
|
|
25
|
+
:breakpoint-id="breakpointId"
|
|
26
|
+
class="layout-item-content"
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
物料定义可以使用 `category`、`keywords` 和 `size`
|
|
31
|
+
驱动物料面板的分类、搜索和宽高配置;拖入后编辑器会在所有断点补齐 `defaultLayout`,并继承
|
|
32
|
+
`constraints`。
|
|
33
|
+
|
|
34
|
+
The package exports `LGrid`, `LGridItem`, `LMaterialRenderer`, `LLayoutEditor`,
|
|
35
|
+
`LMaterialDragSource`, `LMetricCard`, `LTrendCard`, and `useLayoutEditor`. `LMetricCard` and
|
|
36
|
+
`LTrendCard` are small reference materials showing the Vue renderer contract; application packages
|
|
37
|
+
can register their own component objects in exactly the same way. Document updates are emitted only
|
|
38
|
+
after a committed editor transaction.
|
|
39
|
+
|
|
40
|
+
`LLayoutEditor` also accepts the optional `preview` object from the framework-neutral editor. Pass a
|
|
41
|
+
separate container to switch between the GridStack editor layer and CSS Grid preview while keeping
|
|
42
|
+
the document, selection, and active breakpoint:
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<LLayoutEditor :document="document" :engine="engine" :preview="{ container: previewElement }" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 工作台
|
|
49
|
+
|
|
50
|
+
`LLayoutWorkspace`
|
|
51
|
+
是可直接挂载的完整布局工作台,包含物料注册、搜索与分类筛选、全局开发目标切换(原生 Web Component /
|
|
52
|
+
Vue
|
|
53
|
+
3)、GridStack 拖拽编辑、断点与横竖屏、缩放平移、代码输出、高亮、复制下载和真实预览弹窗。工作台内部只通过公开的 core/editor/runtime/compiler 契约工作,应用只需提供可选的
|
|
54
|
+
`document` 与 `materials`:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { LLayoutWorkspace } from '@composy/layout-vue'
|
|
58
|
+
import '@composy/layout-vue/style/workspace.css'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<LLayoutWorkspace v-model:document="document" :materials="materials" @change="handleLayoutChange" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
组件会在每次已提交的编辑事务后触发 `update:document` 与 `change`,因此可以直接使用
|
|
66
|
+
`v-model:document` 保存布局。
|
|
67
|
+
|
|
68
|
+
`LMaterialRenderer` 是物料渲染的唯一目标选择入口:`target="vue"` 使用注册表中
|
|
69
|
+
`renderers.vue.component` 的真实 Vue 组件,`target="webcomponent"` 使用
|
|
70
|
+
`renderers.webcomponent.tagName` 的自定义元素。它不会把 Vue 组件实例写入布局文档,适合在 `LGrid`
|
|
71
|
+
插槽、预览弹窗和第三方 grid-item 中复用。
|
|
72
|
+
|
|
73
|
+
右侧代码检查器只展示当前头部开发目标:原生目标是 HTML/CSS Grid 与 Web
|
|
74
|
+
Component 标签,Vue 目标是引用注册物料组件的 Vue SFC。两种输出都只使用 CSS
|
|
75
|
+
Grid 与注册物料 renderer,不包含 GridStack 运行时依赖;“预览”保留工作区上下文,“实时预览”打开同一文档的目标运行时弹窗。
|