@melt-js/libs-vue3-leva 0.0.0-stage → 2026.11.6-3

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/README.md CHANGED
@@ -1,3 +1,77 @@
1
- # Temporary Holding Version
1
+ # @melt-js/libs-vue3-leva
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Vue 3 的属性面板(leva 风格):`PropsPlayground` + `PropsPanel` + schema 生成 CLI,同时是一个 hel 远程包。
4
+
5
+ - **自包含**:面板组件、schema 生成脚本都在本包内,和 `libs-vue2-leva` 各自独立维护(两边实现已分叉,改动互不影响)
6
+ - **不认任何具体组件**:组件映射和 schema 都由宿主传进来
7
+ - **schema 由脚本从源码注释生成**:`vdoc-parser` 解析 props 上方的 JSDoc(`@description`),输出到组件目录旁边
8
+ - Vue 2 / Vue 3 的差异只有三处兼容点:`value`/`input` 与 `modelValue`/`update:modelValue` 双写、`$set` 判空、`beforeDestroy` / `beforeUnmount` 各挂一次
9
+
10
+ ## 远程使用
11
+
12
+ ```bash
13
+ pnpm libs-vue3-leva:dev # 10040,直接打开是本包调试页
14
+ pnpm libs-vue3-leva:build # 发布用产物,资源地址指向 unpkg
15
+ ```
16
+
17
+ ```ts
18
+ import { preFetchLib } from 'hel-micro'
19
+ await preFetchLib('libs-vue3-leva', { custom: { host: 'http://localhost:10040', skipFetchHelMeta: true } })
20
+
21
+ // 路由懒加载的页面里(此时已预加载完成)取组件
22
+ const { PropsPlayground } = await import('@melt-js/libs-vue3-leva')
23
+ ```
24
+
25
+ ```vue
26
+ <props-playground
27
+ :components="components"
28
+ :schemas="schemas"
29
+ :presets="presets"
30
+ :listeners="listeners"
31
+ :stage-classes="stageClasses"
32
+ :stage-styles="stageStyles"
33
+ :slot-html="slotHtml"
34
+ />
35
+ ```
36
+
37
+ - `components`:`{ 组件名: 组件 }`
38
+ - `schemas`:`{ 组件名: propsSchema.json 的内容 }`
39
+ - `presets`:可选,`{ 组件名: { items: [...] } }`,面板不生成控件的复杂 props / 插槽配套数据;同时会作为面板的初始值
40
+ - `listeners`:可选,`{ 组件名: { select: (item) => ... } }`,透传给组件的 `v-on`
41
+ - `stageClasses` / `stageStyles`:可选,`{ 组件名: 'is-dark' }` / `{ 组件名: { height: '480px' } }`
42
+ - `slotHtml`:可选,`{ 组件名: { default: '<p>内容</p>', title: '标题' } }`,支持 `default` / `title` / `action` / `footer` / `filters` / `actions` / `start` / `end` / `tool` / `rightTool`
43
+
44
+ `PropsPanel` 也可以单独用:`:schema` + `v-model`。
45
+
46
+ ## schema 生成
47
+
48
+ 组件包(如 `comps-vue3`)用 `workspace:*` 引本包,把 `gen:schema` 指向 CLI:
49
+
50
+ ```json
51
+ {
52
+ "dependencies": { "@melt-js/libs-vue3-leva": "workspace:*" },
53
+ "bin": "vue3-leva-gen-schema",
54
+ "scripts": { "gen:schema": "vue3-leva-gen-schema" }
55
+ }
56
+ ```
57
+
58
+ 组件包根目录放 `playground.config.mjs`:
59
+
60
+ ```js
61
+ export default {
62
+ components: [{ name: 'CircularMenu', file: 'src/components/CircularMenu.vue' }],
63
+ hints: { CircularMenu: { openText: { options: { a: 'a', b: 'b' } } } },
64
+ }
65
+ ```
66
+
67
+ ```bash
68
+ vue3-leva-gen-schema # 生成 / 更新 propsSchema.json
69
+ vue3-leva-gen-schema --check # CI:schema 与源码不一致时退出码 1
70
+ ```
71
+
72
+ 约定:
73
+
74
+ - 优先用带 `@description` 的 JSDoc;没有 JSDoc 时,生成器会把 props 上方的 `// 注释`(没有注释时用属性名)补成 `@description`,方便老组件直接接入
75
+ - `index.vue` 写到同目录 `propsSchema.json`,单文件组件写 `Foo.propsSchema.json`
76
+ - 字符串字面量联合(`'a' | 'b'`)会生成下拉 `options`
77
+ - Vue 3 的 props 请用对象形式 `defineProps({ ... })`(`withDefaults(defineProps<...>())` 解析不到 props,类型用 `PropType<T>` 保留)
@@ -0,0 +1 @@
1
+ .props-panel[data-v-7cfac513]{width:100%;min-width:0}.props-panel__pane[data-v-7cfac513]{width:100%}.props-panel__hint[data-v-7cfac513]{margin:8px 0 0;color:#667085;font-size:12px;line-height:1.5}.props-playground[data-v-77b60ab6]{display:flex;flex-direction:column;gap:12px;min-width:0}.props-playground__bar[data-v-77b60ab6]{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}.props-playground__tabs[data-v-77b60ab6]{display:flex;flex-wrap:wrap;gap:6px}.props-playground__action[data-v-77b60ab6],.props-playground__tab[data-v-77b60ab6]{padding:6px 12px;border:1px solid #d0d5dd;border-radius:999px;background:#fff;color:#344054;font-family:inherit;font-size:12px;font-weight:600;line-height:1.4;cursor:pointer;transition:color .2s,background-color .2s,border-color .2s}.props-playground__action[data-v-77b60ab6]:hover,.props-playground__tab[data-v-77b60ab6]:hover{border-color:#2563eb;color:#2563eb}.props-playground__tab.is-active[data-v-77b60ab6]{border-color:#2563eb;background:#2563eb;color:#fff}.props-playground__body[data-v-77b60ab6]{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;align-items:start}.props-playground__stage[data-v-77b60ab6]{height:640px;overflow:auto;border:1px solid #d0d5dd;border-radius:12px;background:#fff}.props-playground__stage.is-dark[data-v-77b60ab6]{background:#0b1220}.props-playground__panel[data-v-77b60ab6]{position:sticky;top:16px}.props-playground__empty[data-v-77b60ab6]{margin:0;padding:24px;color:#667085;font-size:13px}@media (max-width:900px){.props-playground__body[data-v-77b60ab6]{grid-template-columns:1fr}.props-playground__stage[data-v-77b60ab6]{height:480px}.props-playground__panel[data-v-77b60ab6]{position:static}}
@@ -0,0 +1,25 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('hel-lib-proxy')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'hel-lib-proxy'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["libs-vue3-leva"] = {}, global.helLibProxy));
5
+ })(this, (function (exports, helLibProxy) { 'use strict';
6
+
7
+ const LIB_NAME = 'libs-vue3-leva';
8
+
9
+ /*
10
+ |--------------------------------------------------------------------------
11
+ |
12
+ | 组件类型导出文件,同时也作为 rollup 的打包入口:打包后是一个仅包含 hel-lib-proxy
13
+ | 的空壳文件,真正的组件在运行时由 hel 通过 hel_dist 载入
14
+ |
15
+ |--------------------------------------------------------------------------
16
+ */
17
+
18
+ const dtlib = helLibProxy.exposeLib(LIB_NAME);
19
+
20
+ exports.default = dtlib;
21
+ exports.dtlib = dtlib;
22
+
23
+ Object.defineProperty(exports, '__esModule', { value: true });
24
+
25
+ }));
@@ -0,0 +1,66 @@
1
+ {
2
+ "app": {
3
+ "name": "libs-vue3-leva",
4
+ "app_group_name": "libs-vue3-leva",
5
+ "git_repo_url": "",
6
+ "online_version": "2026.11.6-3",
7
+ "build_version": "2026.11.6-3",
8
+ "platform": "unpkg",
9
+ "create_at": "2026-11-06T14:39:34.152Z"
10
+ },
11
+ "version": {
12
+ "plugin_ver": "5.4.3",
13
+ "extract_mode": "build",
14
+ "sub_app_name": "libs-vue3-leva",
15
+ "sub_app_version": "libs-vue3-leva@2026.11.6-3",
16
+ "version_tag": "2026.11.6-3",
17
+ "src_map": {
18
+ "webDirPath": "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist",
19
+ "htmlIndexSrc": "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/index.html",
20
+ "extractMode": "all",
21
+ "iframeSrc": "",
22
+ "chunkCssSrcList": [
23
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/\\css\\69.afeb2ccb.css"
24
+ ],
25
+ "chunkJsSrcList": [
26
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/js/app.61d2eb12.js",
27
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/\\js\\69.12d21618.js",
28
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/\\js\\app.61d2eb12.js"
29
+ ],
30
+ "staticCssSrcList": [],
31
+ "staticJsSrcList": [
32
+ "https://unpkg.com/vue@3.5.44/dist/vue.global.prod.js"
33
+ ],
34
+ "relativeCssSrcList": [],
35
+ "relativeJsSrcList": [],
36
+ "headAssetList": [
37
+ {
38
+ "tag": "staticScript",
39
+ "append": false,
40
+ "attrs": {
41
+ "src": "https://unpkg.com/vue@3.5.44/dist/vue.global.prod.js"
42
+ }
43
+ },
44
+ {
45
+ "tag": "script",
46
+ "append": true,
47
+ "attrs": {
48
+ "src": "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/js/app.61d2eb12.js",
49
+ "defer": "defer"
50
+ }
51
+ }
52
+ ],
53
+ "bodyAssetList": [],
54
+ "otherSrcList": [
55
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/\\index.html",
56
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/\\js\\69.12d21618.js.map",
57
+ "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/\\js\\app.61d2eb12.js.map"
58
+ ],
59
+ "srvModSrcList": [],
60
+ "srvModSrcIndex": ""
61
+ },
62
+ "html_content": "<!doctype html><html lang=\"\"><head><meta charset=\"utf-8\"/><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"/><title>@melt-js/libs-vue3-leva</title><script data-helappend=\"0\" src=\"https://unpkg.com/vue@3.5.44/dist/vue.global.prod.js\"></script><script defer=\"defer\" src=\"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/js/app.61d2eb12.js\"></script></head><body><noscript><strong>We're sorry but @melt-js/libs-vue3-leva doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=\"app\"></div></body></html>",
63
+ "create_at": "2026-11-06T14:39:34.152Z",
64
+ "desc": "this version meta is created by hel-dev-utils@5.4.3"
65
+ }
66
+ }
@@ -0,0 +1 @@
1
+ <!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>@melt-js/libs-vue3-leva</title><script data-helappend="0" src="https://unpkg.com/vue@3.5.44/dist/vue.global.prod.js"></script><script defer="defer" src="https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-3/hel_dist/js/app.61d2eb12.js"></script></head><body><noscript><strong>We're sorry but @melt-js/libs-vue3-leva doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>