@melt-js/libs-vue3-leva 0.0.0-stage → 2026.11.6-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.
- package/README.md +65 -2
- package/hel_dist/css/69.4dbde525.css +1 -0
- package/hel_dist/entry.js +25 -0
- package/hel_dist/hel-meta.json +66 -0
- package/hel_dist/index.html +1 -0
- package/hel_dist/js/69.792743a0.js +4 -0
- package/hel_dist/js/69.792743a0.js.map +1 -0
- package/hel_dist/js/app.a3ea648f.js +16 -0
- package/hel_dist/js/app.a3ea648f.js.map +1 -0
- package/hel_proxy/entry.js +25 -0
- package/hel_proxy_es/entry.js +16 -0
- package/package.json +68 -4
- package/scripts/check.js +13 -0
- package/scripts/gen-schema.mjs +274 -0
- package/scripts/meta.js +21 -0
- package/scripts/prepublishOnly.js +25 -0
- package/scripts/selftest.mjs +28 -0
- package/src/PropsPanel.vue +183 -0
- package/src/PropsPlayground.vue +216 -0
- package/src/configs/subApp.js +1 -0
- package/src/core/panel.js +45 -0
- package/src/core/schema.js +32 -0
- package/src/entrance/libProperties.js +13 -0
- package/src/entrance/libTypes.js +14 -0
- package/src/index.js +3 -0
- package/src/loadApp.js +49 -0
- package/src/main.js +14 -0
package/README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @melt-js/libs-vue3-leva
|
|
2
2
|
|
|
3
|
-
|
|
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 :components="components" :schemas="schemas" :stage-classes="stageClasses" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- `components`:`{ 组件名: 组件 }`
|
|
30
|
+
- `schemas`:`{ 组件名: propsSchema.json 的内容 }`
|
|
31
|
+
- `stageClasses`:可选,`{ 组件名: 'is-dark' }`
|
|
32
|
+
|
|
33
|
+
`PropsPanel` 也可以单独用:`:schema` + `v-model`。
|
|
34
|
+
|
|
35
|
+
## schema 生成
|
|
36
|
+
|
|
37
|
+
组件包(如 `comps-vue3`)用 `workspace:*` 引本包,把 `gen:schema` 指向 CLI:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"dependencies": { "@melt-js/libs-vue3-leva": "workspace:*" },
|
|
42
|
+
"bin": "vue3-leva-gen-schema",
|
|
43
|
+
"scripts": { "gen:schema": "vue3-leva-gen-schema" }
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
组件包根目录放 `playground.config.mjs`:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
export default {
|
|
51
|
+
components: [{ name: 'CircularMenu', file: 'src/components/CircularMenu.vue' }],
|
|
52
|
+
hints: { CircularMenu: { openText: { options: { a: 'a', b: 'b' } } } },
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
vue3-leva-gen-schema # 生成 / 更新 propsSchema.json
|
|
58
|
+
vue3-leva-gen-schema --check # CI:schema 与源码不一致时退出码 1
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
约定:
|
|
62
|
+
|
|
63
|
+
- 只有带 `@description` 的注释才会进 `description`
|
|
64
|
+
- `index.vue` 写到同目录 `propsSchema.json`,单文件组件写 `Foo.propsSchema.json`
|
|
65
|
+
- 字符串字面量联合(`'a' | 'b'`)会生成下拉 `options`
|
|
66
|
+
- 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-7de60b7e]{display:flex;flex-direction:column;gap:12px;min-width:0}.props-playground__bar[data-v-7de60b7e]{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}.props-playground__tabs[data-v-7de60b7e]{display:flex;flex-wrap:wrap;gap:6px}.props-playground__action[data-v-7de60b7e],.props-playground__tab[data-v-7de60b7e]{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-7de60b7e]:hover,.props-playground__tab[data-v-7de60b7e]:hover{border-color:#2563eb;color:#2563eb}.props-playground__tab.is-active[data-v-7de60b7e]{border-color:#2563eb;background:#2563eb;color:#fff}.props-playground__body[data-v-7de60b7e]{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;align-items:start}.props-playground__stage[data-v-7de60b7e]{height:640px;overflow:auto;border:1px solid #d0d5dd;border-radius:12px;background:#fff}.props-playground__stage.is-dark[data-v-7de60b7e]{background:#0b1220}.props-playground__panel[data-v-7de60b7e]{position:sticky;top:16px}.props-playground__empty[data-v-7de60b7e]{margin:0;padding:24px;color:#667085;font-size:13px}@media (max-width:900px){.props-playground__body[data-v-7de60b7e]{grid-template-columns:1fr}.props-playground__stage[data-v-7de60b7e]{height:480px}.props-playground__panel[data-v-7de60b7e]{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-2",
|
|
7
|
+
"build_version": "2026.11.6-2",
|
|
8
|
+
"platform": "unpkg",
|
|
9
|
+
"create_at": "2026-11-06T13:34:53.074Z"
|
|
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-2",
|
|
16
|
+
"version_tag": "2026.11.6-2",
|
|
17
|
+
"src_map": {
|
|
18
|
+
"webDirPath": "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist",
|
|
19
|
+
"htmlIndexSrc": "https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/index.html",
|
|
20
|
+
"extractMode": "all",
|
|
21
|
+
"iframeSrc": "",
|
|
22
|
+
"chunkCssSrcList": [
|
|
23
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/\\css\\69.4dbde525.css"
|
|
24
|
+
],
|
|
25
|
+
"chunkJsSrcList": [
|
|
26
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/js/app.a3ea648f.js",
|
|
27
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/\\js\\69.792743a0.js",
|
|
28
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/\\js\\app.a3ea648f.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-2/hel_dist/js/app.a3ea648f.js",
|
|
49
|
+
"defer": "defer"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"bodyAssetList": [],
|
|
54
|
+
"otherSrcList": [
|
|
55
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/\\index.html",
|
|
56
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/\\js\\69.792743a0.js.map",
|
|
57
|
+
"https://unpkg.com/@melt-js/libs-vue3-leva@2026.11.6-2/hel_dist/\\js\\app.a3ea648f.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-2/hel_dist/js/app.a3ea648f.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-06T13:34:53.074Z",
|
|
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-2/hel_dist/js/app.a3ea648f.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>
|