@rinova/playground 0.1.5 → 0.7.0
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 +6 -7
- package/dist/PlaygroundRoot-Bcq7hG6m.js +4114 -0
- package/dist/bash-DXbFn1Mw.js +2 -0
- package/dist/diff-BbCHXb9k.js +2 -0
- package/dist/html-BheHDAwJ.js +10 -0
- package/dist/index.js +646 -5
- package/dist/less-DcFvX2iI.js +2 -0
- package/dist/light-plus-DuoQWI9Q.js +3 -0
- package/dist/markdown-qYHfSPvL.js +2 -0
- package/dist/marked.esm-CNYX-ybC.js +1796 -0
- package/dist/{App-DUVLlDOI.js → plugin-S72dg7Tb.js} +556 -1700
- package/dist/style.css +2857 -554
- package/dist/tokyo-night-A7e3DMsQ.js +3 -0
- package/dist/types/app/App.vue.d.ts +1 -0
- package/dist/types/app/PlaygroundApiTable.vue.d.ts +16 -0
- package/dist/types/app/PlaygroundEditorPicker.vue.d.ts +3 -0
- package/dist/types/app/PlaygroundModuleApi.vue.d.ts +17 -0
- package/dist/types/app/PlaygroundPage.vue.d.ts +30 -0
- package/dist/types/app/{PlaygroundSourcePanel.vue.d.ts → PlaygroundPageIndex.vue.d.ts} +4 -4
- package/dist/types/app/PlaygroundPluginPanel.vue.d.ts +3 -0
- package/dist/types/app/PlaygroundPluginSlot.vue.d.ts +12 -0
- package/dist/types/app/PlaygroundPluginWrappers.vue.d.ts +25 -0
- package/dist/types/app/PlaygroundRoot.vue.d.ts +4 -0
- package/dist/types/app/{PlaygroundParamsPanel.vue.d.ts → PlaygroundSceneArgs.vue.d.ts} +1 -1
- package/dist/types/app/PlaygroundSceneOutput.vue.d.ts +6 -0
- package/dist/types/app/PlaygroundSceneSection.vue.d.ts +16 -0
- package/dist/types/app/{PlaygroundStage.vue.d.ts → PlaygroundSceneSource.vue.d.ts} +0 -1
- package/dist/types/app/PlaygroundSidebar.vue.d.ts +19 -8
- package/dist/types/app/viewport.d.ts +39 -0
- package/dist/types/code/CodeBlock.vue.d.ts +19 -1
- package/dist/types/code/clipboard.d.ts +2 -0
- package/dist/types/code/find.d.ts +42 -0
- package/dist/types/code/highlighter.d.ts +9 -2
- package/dist/types/code/openInEditor.d.ts +35 -0
- package/dist/types/{app/PlaygroundGroupIndex.vue.d.ts → components/PwApiBrief.vue.d.ts} +9 -9
- package/dist/types/components/PwButton.vue.d.ts +2 -2
- package/dist/types/components/PwDemo.vue.d.ts +39 -0
- package/dist/types/components/PwDemoGrid.vue.d.ts +32 -0
- package/dist/types/components/PwInput.vue.d.ts +8 -8
- package/dist/types/components/PwSceneBoundary.vue.d.ts +20 -0
- package/dist/types/components/PwSceneNote.vue.d.ts +19 -0
- package/dist/types/components/PwTooltip.vue.d.ts +3 -0
- package/dist/types/components/prose/PwCallout.vue.d.ts +24 -0
- package/dist/types/components/prose/PwMarkdown.vue.d.ts +11 -0
- package/dist/types/components/prose/PwProse.vue.d.ts +27 -0
- package/dist/types/components/prose/PwStep.vue.d.ts +27 -0
- package/dist/types/components/prose/PwSteps.vue.d.ts +26 -0
- package/dist/types/components/prose/enhance.d.ts +4 -0
- package/dist/types/components/prose/index.d.ts +7 -0
- package/dist/types/components/prose/markdown-scene.d.ts +10 -0
- package/dist/types/components/prose/parse.d.ts +20 -0
- package/dist/types/components/prose/render.d.ts +22 -0
- package/dist/types/components/scene.d.ts +5 -0
- package/dist/types/config.d.ts +38 -10
- package/dist/types/index.d.ts +11 -4
- package/dist/types/module-api.d.ts +55 -0
- package/dist/types/payload/args.d.ts +5 -3
- package/dist/types/payload/context.d.ts +3 -0
- package/dist/types/payload/output.d.ts +4 -2
- package/dist/types/plugin.d.ts +119 -0
- package/dist/types/scene-meta.d.ts +38 -3
- package/dist/types/shims.d.ts +26 -8
- package/dist/types/types.d.ts +107 -20
- package/dist/vue-B_A2yz16.js +30 -0
- package/dist/yaml-CoEYOy4X.js +2 -0
- package/package.json +3 -5
- package/dist/assets/editor.worker-G4Kxf7Y6.js +0 -15827
- package/dist/assets/ts.worker-Dee0cZZb.js +0 -164076
- package/dist/dist-B0hittbo.js +0 -151
- package/dist/editor.api-YVDhnHI-.js +0 -126730
- package/dist/editor.css +0 -1
- package/dist/editor.worker-VDFPHiZj.js +0 -5
- package/dist/monaco.contribution-CaO2YABh.js +0 -220
- package/dist/output-CGawAeuu.js +0 -80
- package/dist/ts.worker-CpQm_d0w.js +0 -5
- package/dist/tsMode-BOlRJVVo.js +0 -52173
- package/dist/types/app/PlaygroundToolbar.vue.d.ts +0 -22
- package/dist/types/code/CodeEditor.vue.d.ts +0 -18
- package/dist/types/code/monaco.d.ts +0 -6
- package/dist/vitesse-dark-B9O9KI0c.js +0 -3
- package/dist/vitesse-light-Cs2DYTIe.js +0 -3
- package/dist/vue-tjAT-6a9.js +0 -36
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @rinova/playground
|
|
2
2
|
|
|
3
|
-
Vue3 的「文件即场景」组件演示框架。往 `src/scenes/` 里放 `.vue`
|
|
3
|
+
Vue3 的「文件即场景」组件演示框架。往 `src/scenes/` 里放 `.vue` 文件,侧栏、预览、源码面板、输入/输出面板自己就长出来了 —— 没有注册 API,没有配置要改。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
pnpm add @rinova/playground
|
|
@@ -83,7 +83,6 @@ const size = ref<'sm' | 'md' | 'lg'>('lg')
|
|
|
83
83
|
| `sources` | `true` | 是否显示源码面板 |
|
|
84
84
|
| `codeViewer` | `'monaco'` | `'monaco'` 只读编辑器 / `'shiki'` 静态高亮块(更轻,不加载编辑器 worker) |
|
|
85
85
|
| `theme.ui` | `'auto'` | `'light' \| 'dark' \| 'auto'` |
|
|
86
|
-
| `theme.code` | 随明暗用 `vitesse-light` / `vitesse-dark` | **v0.1 尚未接线,改这个值暂时无效** |
|
|
87
86
|
| `exclude` | — | 排除的 glob(相对 `scenes` 根) |
|
|
88
87
|
| `base` | Vite 默认 | 部署子路径 |
|
|
89
88
|
| `port` | Vite 默认(5173) | dev server 端口 |
|
|
@@ -107,7 +106,7 @@ const size = ref<'sm' | 'md' | 'lg'>('lg')
|
|
|
107
106
|
|
|
108
107
|
`SceneMeta` 类型里还有 `payload` 字段,但构建期拿不到组件状态,**请改用下面的 `useSceneArgs` / `useSceneOutput`**。
|
|
109
108
|
|
|
110
|
-
### useSceneArgs ——
|
|
109
|
+
### useSceneArgs —— 输入面板
|
|
111
110
|
|
|
112
111
|
```ts
|
|
113
112
|
const args = useSceneArgs(
|
|
@@ -125,18 +124,18 @@ const args = useSceneArgs(
|
|
|
125
124
|
|
|
126
125
|
> 字面量会被拓宽成 `string`,直接传给只接受联合类型的 prop 会报 TS2322,所以写 `'md' as 'sm' | 'md' | 'lg'`。
|
|
127
126
|
|
|
128
|
-
### useSceneOutput ——
|
|
127
|
+
### useSceneOutput —— 输出快照
|
|
129
128
|
|
|
130
129
|
```ts
|
|
131
130
|
useSceneOutput(() => ({ size: args.size, clicked: count.value }))
|
|
132
131
|
```
|
|
133
132
|
|
|
134
|
-
面板以 400ms 轮询这个 getter
|
|
133
|
+
面板以 400ms 轮询这个 getter,把返回值显示在输出区。
|
|
135
134
|
|
|
136
135
|
### 一个场景多个 demo —— 参数槽位
|
|
137
136
|
|
|
138
137
|
同一场景里放多个 demo 时,各自调用一次并在选项里写 `slot`,面板会按槽位名分块,
|
|
139
|
-
|
|
138
|
+
互不干扰(改一块的输入只影响那一个 demo):
|
|
140
139
|
|
|
141
140
|
```ts
|
|
142
141
|
const primary = useSceneArgs({ label: '主按钮', size: 'md' }, { slot: '主按钮' })
|
|
@@ -174,7 +173,7 @@ toast('保存失败', 'error') // 'info' | 'success' | 'warning' | 'error'
|
|
|
174
173
|
|
|
175
174
|
- 场景与外壳无 DOM 隔离,必须写 scoped
|
|
176
175
|
- 源码面板只读,不支持编辑(实时预览也已明确不做:只在 dev 可用,价值不足)
|
|
177
|
-
- `
|
|
176
|
+
- 代码配色随外壳明暗固定使用 `light-plus` / `tokyo-night`,暂不提供配置项
|
|
178
177
|
- 只支持 Vue3,不支持 React / Svelte
|
|
179
178
|
|
|
180
179
|
## 相关包
|