@sparkelf/dsh-genui 0.11.4-patch.2 → 0.13.0-sparkelf.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/CHANGELOG.md +76 -0
- package/ICON-NAMES.md +30 -0
- package/README.md +26 -28
- package/README.zh-CN.md +26 -28
- package/SKILL.md +128 -19
- package/THIRD_PARTY_NOTICES.md +42 -0
- package/assets/genui-icon.svg +20 -0
- package/assets/genui-logo.svg +18 -0
- package/lib/assets/icons.js +1 -0
- package/lib/assets/mermaid.js +325 -325
- package/lib/assets/standalone-runtime.js +10 -9
- package/lib/client.js +32 -31
- package/lib/index.js +489 -80
- package/lib/types/client/action-context.d.ts +1 -1
- package/lib/types/client/artifact/types.d.ts +1 -1
- package/lib/types/client/asset-loader.d.ts +2 -2
- package/lib/types/client/blocks/blocks.d.ts +12 -0
- package/lib/types/client/blocks/icon.d.ts +4 -0
- package/lib/types/client/dom-fence.d.ts +2 -1
- package/lib/types/client/fence-render.d.ts +5 -21
- package/lib/types/client/file-address.d.ts +4 -0
- package/lib/types/client/file-link-context.d.ts +49 -0
- package/lib/types/client/file-link.d.ts +17 -0
- package/lib/types/client/gallery.d.ts +8 -2
- package/lib/types/client/genui-runtime/diagnostics.d.ts +1 -1
- package/lib/types/client/genui-runtime/limits.d.ts +4 -0
- package/lib/types/client/genui-runtime/schema.d.ts +14 -1
- package/lib/types/client/guard.d.ts +4 -1
- package/lib/types/client/i18n/en.d.ts +5 -1
- package/lib/types/client/i18n/index.d.ts +1 -1
- package/lib/types/client/icons/asset-icons.d.ts +1 -0
- package/lib/types/client/icons/icon-data-full.d.ts +23 -0
- package/lib/types/client/icons/icon-data.d.ts +24 -0
- package/lib/types/client/icons/icon-lazy.d.ts +18 -0
- package/lib/types/client/icons/icon-names-full.d.ts +12 -0
- package/lib/types/client/index.d.ts +5 -15
- package/lib/types/client/inline.d.ts +1 -1
- package/lib/types/client/mermaid-colors.d.ts +2 -0
- package/lib/types/client/mermaid-core.d.ts +2 -1
- package/lib/types/client/mermaid-lazy.d.ts +5 -1
- package/lib/types/client/panel-command.d.ts +21 -1
- package/lib/types/client/panel.d.ts +6 -1
- package/lib/types/client/primitive-adapter.d.ts +0 -2
- package/lib/types/client/session-resolver.d.ts +13 -2
- package/lib/types/client/source-fence.d.ts +1 -1
- package/lib/types/client/spec.d.ts +107 -3
- package/lib/types/client/standalone/asset-loader.d.ts +1 -1
- package/lib/types/client/standalone/primitive-adapter.d.ts +0 -4
- package/lib/types/plugin/fence-feedback.d.ts +11 -7
- package/lib/types/plugin/index.d.ts +6 -2
- package/lib/types/shared/fence-language.d.ts +14 -0
- package/lib/types/shared/fence-repair.d.ts +2 -1
- package/lib/types/shared/fence-resolve.d.ts +1 -1
- package/package.json +92 -83
- package/src/client/EChartNode.tsx +17 -3
- package/src/client/GenuiBlock.module.css +411 -76
- package/src/client/action-context.ts +5 -15
- package/src/client/artifact/ArtifactExport.module.css +34 -3
- package/src/client/artifact/ExportableGenuiBlock.tsx +23 -2
- package/src/client/artifact/portability.ts +6 -1
- package/src/client/artifact/types.ts +1 -1
- package/src/client/asset-loader.ts +3 -3
- package/src/client/blocks/advanced.tsx +101 -14
- package/src/client/blocks/blocks.tsx +143 -0
- package/src/client/blocks/charts.tsx +22 -6
- package/src/client/blocks/icon.tsx +93 -0
- package/src/client/blocks/image.tsx +1 -0
- package/src/client/blocks/render-node.tsx +84 -52
- package/src/client/dom-fence.tsx +546 -72
- package/src/client/fence-render.tsx +5 -21
- package/src/client/file-address.ts +37 -0
- package/src/client/file-link-context.tsx +116 -0
- package/src/client/file-link.ts +46 -0
- package/src/client/gallery.ts +161 -133
- package/src/client/genui-runtime/diagnostics.ts +1 -1
- package/src/client/genui-runtime/limits.ts +4 -0
- package/src/client/genui-runtime/normalize.ts +42 -6
- package/src/client/genui-runtime/schema.ts +39 -7
- package/src/client/guard.ts +170 -15
- package/src/client/i18n/en.ts +5 -1
- package/src/client/i18n/index.ts +1 -1
- package/src/client/i18n/zh.ts +5 -1
- package/src/client/icons/asset-icons.ts +16 -0
- package/src/client/icons/icon-data-full.ts +5715 -0
- package/src/client/icons/icon-data.ts +507 -0
- package/src/client/icons/icon-lazy.ts +80 -0
- package/src/client/icons/icon-names-full.ts +12 -0
- package/src/client/index.tsx +27 -51
- package/src/client/inline.ts +17 -6
- package/src/client/mermaid-colors.ts +40 -0
- package/src/client/mermaid-core.ts +69 -61
- package/src/client/mermaid-lazy.ts +99 -4
- package/src/client/panel-command.ts +16 -2
- package/src/client/panel.tsx +18 -5
- package/src/client/primitive-adapter.ts +0 -11
- package/src/client/session-resolver.ts +12 -21
- package/src/client/source-fence.ts +4 -2
- package/src/client/spec.ts +116 -2
- package/src/client/standalone/asset-loader.ts +1 -1
- package/src/client/standalone/primitive-adapter.tsx +1 -9
- package/src/client/table-details.ts +4 -3
- package/src/plugin/fence-feedback.ts +60 -14
- package/src/plugin/index.ts +45 -20
- package/src/plugin/tool.ts +11 -2
- package/src/shared/fence-language.ts +30 -0
- package/src/shared/fence-repair.ts +37 -1
- package/src/shared/fence-resolve.ts +1 -1
- package/tsdown.config.ts +7 -8
- package/lib/invariant.js +0 -19
- package/lib/types/plugin/invariant.d.ts +0 -15
- package/src/plugin/invariant.ts +0 -30
|
@@ -46,6 +46,12 @@ function readToken(name: string, fallback: string, el?: HTMLElement | null): str
|
|
|
46
46
|
return fallback
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/** Read a px-valued font token as a number for ECharts textStyle fields. */
|
|
50
|
+
function readFontSize(name: string, fallback: number, el?: HTMLElement | null): number {
|
|
51
|
+
const parsed = Number.parseFloat(readToken(name, '', el))
|
|
52
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
/** Resolve the host accent and label colors for ECharts theming. */
|
|
50
56
|
function themeColors(el?: HTMLElement | null): {
|
|
51
57
|
accent: string
|
|
@@ -54,6 +60,9 @@ function themeColors(el?: HTMLElement | null): {
|
|
|
54
60
|
labelTertiary: string
|
|
55
61
|
border: string
|
|
56
62
|
bgLayer1: string
|
|
63
|
+
fontData: number
|
|
64
|
+
fontMeta: number
|
|
65
|
+
fontDisplay: number
|
|
57
66
|
} {
|
|
58
67
|
return {
|
|
59
68
|
accent: readToken('--dsw-alias-state-business-primary', '#4f8ef7', el),
|
|
@@ -62,6 +71,11 @@ function themeColors(el?: HTMLElement | null): {
|
|
|
62
71
|
labelTertiary: readToken('--dsw-alias-label-tertiary', '#6b6b6b', el),
|
|
63
72
|
border: readToken('--dsw-alias-border-l1', 'rgba(255,255,255,0.12)', el),
|
|
64
73
|
bgLayer1: readToken('--dsw-alias-bg-layer-1', '#1a1a1e', el),
|
|
74
|
+
// The --dsl-g-* scale is declared on the .block/.panel roots; the chart
|
|
75
|
+
// container inherits it. Detached renders fall back to these literals.
|
|
76
|
+
fontData: readFontSize('--dsl-g-font-data', 12, el),
|
|
77
|
+
fontMeta: readFontSize('--dsl-g-font-meta', 12.5, el),
|
|
78
|
+
fontDisplay: readFontSize('--dsl-g-font-display', 28, el),
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
81
|
|
|
@@ -226,8 +240,8 @@ function presetOption(node: GenuiEChart, el?: HTMLElement | null): Record<string
|
|
|
226
240
|
splitLine: { show: false },
|
|
227
241
|
axisLabel: { show: false },
|
|
228
242
|
pointer: { show: false },
|
|
229
|
-
title: { offsetCenter: [0, '32%'], color: t.labelTertiary, fontSize:
|
|
230
|
-
detail: { valueAnimation: true, fontSize:
|
|
243
|
+
title: { offsetCenter: [0, '32%'], color: t.labelTertiary, fontSize: t.fontData },
|
|
244
|
+
detail: { valueAnimation: true, fontSize: t.fontDisplay, offsetCenter: [0, '2%'], formatter: '{value}', color: t.labelPrimary },
|
|
231
245
|
data: [{ value: Number(d.value) || 0, name: d.label }],
|
|
232
246
|
})),
|
|
233
247
|
}
|
|
@@ -307,7 +321,7 @@ function presetOption(node: GenuiEChart, el?: HTMLElement | null): Record<string
|
|
|
307
321
|
type: 'graph',
|
|
308
322
|
layout: 'force',
|
|
309
323
|
roam: true,
|
|
310
|
-
label: { show: true, color: t.labelSecondary, fontSize:
|
|
324
|
+
label: { show: true, color: t.labelSecondary, fontSize: t.fontMeta },
|
|
311
325
|
force: { repulsion: 200, edgeLength: 80 },
|
|
312
326
|
lineStyle: { color: t.border, curveness: 0.1 },
|
|
313
327
|
emphasis: { focus: 'adjacency' },
|