@deot/docs-playground 1.0.10 → 1.1.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/README.md +5 -1
- package/dist/index.cjs +604 -290
- package/dist/index.d.ts +26 -4
- package/dist/index.js +600 -291
- package/dist/index.style.css +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -49,7 +49,10 @@ const files = ref({
|
|
|
49
49
|
| `viewport` | `'auto' \| number \| [number, number]` | `'auto'` | 运行时宽度,或固定宽高。 |
|
|
50
50
|
| `viewportOptions` | `PlaygroundViewport[]` | `['auto', 375]` | 可切换的视口列表。 |
|
|
51
51
|
| `styleless` | `boolean` | `false` | 只渲染无工具栏的运行时预览。 |
|
|
52
|
-
| `
|
|
52
|
+
| `title` | `string` | `''` | 顶栏标题;空串或不传不渲染标题文本。runtime / 双视图始终保留顶栏;files-only 仅在有标题时显示顶栏。带标题时生成锚点(`#` 链接),规则对齐 markdown-it-anchor。 |
|
|
53
|
+
| `id` | `string` | `''` | 标题锚点 id;未传时从 `title` 自动生成。仅挂在内联 runtime 标题上,弹窗不重复。 |
|
|
54
|
+
| `expandable` | `true \| number` | `undefined` | 开启预览高度展开;未传不显示控件;`true` 展开到剩余视口;正数为目标高度(px)。 |
|
|
55
|
+
| `previewScroller` | `boolean` | `false` | 在 iframe 内用 `@deot/vc` Scroller 替换原生滚动条;开启后会动态探测 `Scroller`,不存在则回退原生滚动。 |
|
|
53
56
|
| `options` | `PlaygroundOptions` | `{}` | 传给 Vue REPL store 的实例级选项;`cdnURL` 会同时作用于预览样式和默认 import map。 |
|
|
54
57
|
| `previewOptions` | `SandboxProps['previewOptions']` | `undefined` | 传给当前 iframe 的 preview 选项。 |
|
|
55
58
|
| `locale` | `Language` | `en-US` | 界面语言;未传入时使用上层 Locale Provider。 |
|
|
@@ -78,6 +81,7 @@ Playground 只接受来自自身 iframe 的导航消息。宿主应用应监听
|
|
|
78
81
|
| `resolveHighlightLanguage(filename)` | 将常见扩展名映射为 highlight.js 语言。 |
|
|
79
82
|
| `registerVueHighlight(api?)` | 向 highlight.js 注册 Vue SFC 语法。 |
|
|
80
83
|
| `vueHighlight` | Vue SFC 的 highlight.js 语言定义。 |
|
|
84
|
+
| `slugifyPlaygroundTitle(title)` / `resolvePlaygroundTitleId(title, id?)` | 标题锚点 id,规则对齐 markdown-it-anchor。 |
|
|
81
85
|
| `DEFAULT_CDN_URL` | 默认 CDN 根地址(jsDelivr)。 |
|
|
82
86
|
| `createBuiltinImports(cdnURL?)` / `createBuiltinStyles(cdnURL?)` | 按 CDN 生成内置 import map 与预览样式表 URL。 |
|
|
83
87
|
| `normalizeCdnURL(value?)` | 规范化 CDN 根地址。 |
|