@vanduo-oss/vd3-cbun 1.2.0 → 1.3.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/CHANGELOG.md +63 -0
- package/README.md +17 -15
- package/SKILL.md +3 -3
- package/dist/charts/index.cjs +18 -8
- package/dist/charts/index.cjs.map +2 -2
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/index.js +18 -8
- package/dist/charts/index.js.map +2 -2
- package/dist/charts/vue.d.ts +78 -7
- package/dist/code-editor/index.cjs +5 -3
- package/dist/code-editor/index.cjs.map +2 -2
- package/dist/code-editor/index.js +5 -3
- package/dist/code-editor/index.js.map +2 -2
- package/dist/draw/core.d.ts +6 -9
- package/dist/draw/index.cjs +13 -4
- package/dist/draw/index.cjs.map +2 -2
- package/dist/draw/index.d.ts +3 -7
- package/dist/draw/index.js +13 -4
- package/dist/draw/index.js.map +2 -2
- package/dist/draw/shapes.d.ts +12 -0
- package/dist/flowchart/index.cjs +107 -72
- package/dist/flowchart/index.cjs.map +2 -2
- package/dist/flowchart/index.js +107 -72
- package/dist/flowchart/index.js.map +2 -2
- package/dist/flowchart/vd3-flowchart.css +176 -47
- package/dist/hex-grid/index.cjs +90 -62
- package/dist/hex-grid/index.cjs.map +3 -3
- package/dist/hex-grid/index.d.ts +1 -1
- package/dist/hex-grid/index.js +90 -62
- package/dist/hex-grid/index.js.map +3 -3
- package/dist/hex-grid/vue.d.ts +25 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +2 -2
- package/dist/meta.json +53 -53
- package/dist/music-player/index.cjs +3 -4
- package/dist/music-player/index.cjs.map +2 -2
- package/dist/music-player/index.d.ts +9 -1
- package/dist/music-player/index.js +3 -4
- package/dist/music-player/index.js.map +2 -2
- package/dist/music-player/vue.d.ts +49 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,69 @@ All notable changes to `@vanduo-oss/vd3-cbun` are documented here. This file
|
|
|
4
4
|
tracks the PACKAGE only — never docs-site content. Per-component VERSION
|
|
5
5
|
constants are listed alongside each bundle release.
|
|
6
6
|
|
|
7
|
+
## 1.3.1 — 2026-08-02
|
|
8
|
+
|
|
9
|
+
**flowchart** — CSS token mixes no longer blend toward fixed light cream/white
|
|
10
|
+
(`#ffffff`, `#efe7d4`, `#f5ecd8`, …); panels, nodes, handles, and inspector
|
|
11
|
+
chrome now follow `--vd-bg-primary` / `--vd-bg-secondary` so dark mode stays
|
|
12
|
+
coherent with the site palette. Toolbar actions use Draw-style Phosphor icons
|
|
13
|
+
(zoom / reset / fit / undo / redo / clear) instead of faint text glyphs; the
|
|
14
|
+
left shapes rail is a compact icon panel with stronger stroke contrast and
|
|
15
|
+
pressed states. The layout `<select>` always shows the active mode
|
|
16
|
+
(Tree / Radial / Grid) instead of resetting to a placeholder, with a single
|
|
17
|
+
no-repeat caret. Shell `min-height` no longer forces 560px, so short parents
|
|
18
|
+
(docs fullscreen) keep the bottom border visible. Styling + chrome UX only;
|
|
19
|
+
`VD_FLOWCHART_VERSION` remains `1.2.0` (serialization unchanged).
|
|
20
|
+
|
|
21
|
+
## 1.3.0 — 2026-07-24
|
|
22
|
+
|
|
23
|
+
Minor release. **New — chart mark clicks:** `VdChart` (and the typed
|
|
24
|
+
`VdBarChart` / `VdLineChart` / … wrappers) now forward the core's mark-click
|
|
25
|
+
callbacks as an idiomatic Vue emit family — `bar-click`, `point-click`, and
|
|
26
|
+
`slice-click`, each carrying the core `ClickEvent` (`{ event, datum, index }`).
|
|
27
|
+
The wrapper previously dropped the core's `onBarClick` / `onPointClick` /
|
|
28
|
+
`onSliceClick` options, so a `<VdChart>` consumer could not receive a mark click
|
|
29
|
+
at all even though the core's click wiring was already in place. Additive and
|
|
30
|
+
backward-compatible; the `VdChartEmits` type is exported from `./charts`. Takes
|
|
31
|
+
`VD_CHARTS_VERSION` `1.0.1 → 1.1.0`.
|
|
32
|
+
|
|
33
|
+
**Hardening — bounded deserialization (draw + flowchart):** `normalizeDocument()`
|
|
34
|
+
now caps an untrusted / corrupt document, **truncating (never throwing)** beyond
|
|
35
|
+
conservative limits so a shared or hostile document cannot freeze the tab by
|
|
36
|
+
being coerced O(n) and rendered — draw caps `MAX_SHAPES` (10 000) and
|
|
37
|
+
`MAX_POINTS_PER_SHAPE` (100 000); flowchart caps `MAX_NODES` / `MAX_EDGES`
|
|
38
|
+
(10 000 each). The `toJSON()` output is unchanged for in-range documents, so
|
|
39
|
+
`VD_DRAW_VERSION` stays `1.1.0` and `VD_FLOWCHART_VERSION` stays `1.2.0` (both
|
|
40
|
+
load-bearing — serialized into saved documents).
|
|
41
|
+
|
|
42
|
+
**Core bug fixes** (framework-agnostic, no API or serialization change).
|
|
43
|
+
**draw** — the undo history now coalesces only at the top of the stack, so a
|
|
44
|
+
coalescing edit (nudge / style / text) made right after an undo no longer
|
|
45
|
+
overwrites an earlier snapshot and corrupts the redo branch (mirrors the
|
|
46
|
+
flowchart core's guard). **charts** — `renderBarChart` / `renderMultiBarChart`
|
|
47
|
+
clamp the bar baseline into the rendered y-domain, so an explicit `yMin > 0` no
|
|
48
|
+
longer draws bars past the axis floor (matches the area/line clamp).
|
|
49
|
+
**music-player** — a repeat-off playlist now stops and dispatches
|
|
50
|
+
`musicplayer:ended` at the final track instead of wrapping with a modulo and
|
|
51
|
+
looping forever; the wrap stays exclusive to `repeat: 'all'`. **hex-grid** —
|
|
52
|
+
`destroy()` now removes every canvas listener `_setupEvents` attaches (stored
|
|
53
|
+
named handlers), fixing a leak on caller-supplied, reused canvases.
|
|
54
|
+
**code-editor** — the CSS/JavaScript tokenizer now classifies an unterminated
|
|
55
|
+
`/*` block comment to end-of-input as a `comment` instead of `plain`. Minor:
|
|
56
|
+
bundle `1.2.0 → 1.3.0`.
|
|
57
|
+
|
|
58
|
+
Also non-runtime: hex-grid + music-player `vue.d.ts` now type their emit events,
|
|
59
|
+
the draw type surface declares its constants in `shapes.d.ts` (matching runtime),
|
|
60
|
+
and added coverage for the code-editor keymap/`destroy()`, the music-player
|
|
61
|
+
recreate teardown, tokenizer edge classification, and draw `clearHistory()`.
|
|
62
|
+
|
|
63
|
+
Component versions in this release: **charts 1.1.0, code-editor 1.0.1, draw
|
|
64
|
+
1.1.0, flowchart 1.2.0, hex-grid 1.0.1, music-player 1.0.1** — `charts` takes a
|
|
65
|
+
minor bump `1.0.1 → 1.1.0` for the mark-click emits; code-editor, hex-grid, and
|
|
66
|
+
music-player carry their `1.0.1` core-fix patch; `draw` stays `1.1.0` and
|
|
67
|
+
`flowchart` continues its old-line `1.2.0` lineage (the deserialization caps
|
|
68
|
+
change neither `toJSON()` format).
|
|
69
|
+
|
|
7
70
|
## 1.2.0 — 2026-07-22
|
|
8
71
|
|
|
9
72
|
Adds a sixth component, **`draw`** (`@vanduo-oss/vd3-cbun/draw` + `./draw/css`),
|
package/README.md
CHANGED
|
@@ -8,10 +8,11 @@ tree-shakeable subpath exports. It replaces the four per-repo publishes
|
|
|
8
8
|
(`@vanduo-oss/charts`, `@vanduo-oss/flowchart`, `@vanduo-oss/hex-grid`,
|
|
9
9
|
`@vanduo-oss/music-player`) of the old line.
|
|
10
10
|
|
|
11
|
-
**Status: 1.
|
|
11
|
+
**Status: 1.3.1.** Six Vue3-only component families — charts, code-editor, draw,
|
|
12
12
|
flowchart, hex-grid, music-player — each on its own tree-shakeable subpath, with
|
|
13
|
-
the esbuild metafile isolation guard in place. (1.
|
|
14
|
-
|
|
13
|
+
the esbuild metafile isolation guard in place. (1.3.0 adds chart mark-click
|
|
14
|
+
emits + bounded draw/flowchart deserialization; 1.3.1 dark-aware flowchart
|
|
15
|
+
chrome, icon toolbar, and short-parent sizing; see the
|
|
15
16
|
[changelog](./CHANGELOG.md).)
|
|
16
17
|
|
|
17
18
|
## Install
|
|
@@ -57,8 +58,8 @@ import { VD3_CBUN_VERSIONS } from '@vanduo-oss/vd3-cbun';
|
|
|
57
58
|
|
|
58
59
|
Each subpath entry (`dist/<component>/index.js`) re-exports **both** the Vue
|
|
59
60
|
component and its framework-agnostic core (the core aliased with a `Core`
|
|
60
|
-
suffix where the names collide — `VdCodeEditorCore`, `
|
|
61
|
-
`VdHexGridCore`). Isolation
|
|
61
|
+
suffix where the names collide — `VdCodeEditorCore`, `VdDrawCore`,
|
|
62
|
+
`VdFlowchartCore`, `VdHexGridCore`). Isolation
|
|
62
63
|
is not a convention but a build guard: `scripts/build.js` bundles every entry
|
|
63
64
|
separately with `vue` external, emits an esbuild metafile (`dist/meta.json`),
|
|
64
65
|
and **fails the build** if any component entry's inputs reach outside its own
|
|
@@ -69,8 +70,8 @@ to confirm tree-shaking downstream.
|
|
|
69
70
|
|
|
70
71
|
Notes:
|
|
71
72
|
|
|
72
|
-
- `vue
|
|
73
|
-
|
|
73
|
+
- The `vue` peer (see [Install](#install)) is never bundled — it stays external
|
|
74
|
+
in both the esm and cjs outputs.
|
|
74
75
|
- Named exports only — no default exports on any subpath.
|
|
75
76
|
- No IIFE builds and no `./vue` subpaths — the Vue bindings ARE the subpath
|
|
76
77
|
exports; framework-agnostic cores stay exported alongside them.
|
|
@@ -82,11 +83,11 @@ Notes:
|
|
|
82
83
|
The bundle's own semver (`package.json` version) is decoupled from the
|
|
83
84
|
components inside it. Each component carries a VERSION constant tracked in
|
|
84
85
|
`component-versions.json` at the repo root and asserted in tests against the
|
|
85
|
-
exported `VD3_CBUN_VERSIONS` map. charts, code-editor, hex-grid, and
|
|
86
|
-
|
|
87
|
-
`1.2.0`** because `VD_FLOWCHART_VERSION` is load-bearing —
|
|
88
|
-
into user documents via `toJSON().version`. A new component
|
|
89
|
-
at `1.0.0` (`draw` did, in bundle 1.2.0).
|
|
86
|
+
exported `VD3_CBUN_VERSIONS` map. charts, code-editor, hex-grid, and music-player
|
|
87
|
+
sit at `1.0.1`, draw at `1.1.0`; **flowchart continues its
|
|
88
|
+
old-line lineage at `1.2.0`** because `VD_FLOWCHART_VERSION` is load-bearing —
|
|
89
|
+
it is serialized into user documents via `toJSON().version`. A new component
|
|
90
|
+
enters the manifest at `1.0.0` (`draw` did, in bundle 1.2.0).
|
|
90
91
|
|
|
91
92
|
## Theming
|
|
92
93
|
|
|
@@ -113,9 +114,10 @@ tokens works — but it is the canonical source.)
|
|
|
113
114
|
|
|
114
115
|
## Security
|
|
115
116
|
|
|
116
|
-
- **
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
- **No bundled dependencies** — beyond the `vue` peer ([Install](#install)),
|
|
118
|
+
nothing is bundled or required; the build fails if any other module is
|
|
119
|
+
externalized or any `node_modules` input is bundled (the
|
|
120
|
+
[isolation guard](#subpath-import-model)).
|
|
119
121
|
- **Hardened `.npmrc`:** `ignore-scripts`, `minimum-release-age`, `save-exact`,
|
|
120
122
|
`strict-peer-dependencies`, `trust-policy=no-downgrade`,
|
|
121
123
|
`block-exotic-subdeps`, and an explicit `registry`.
|
package/SKILL.md
CHANGED
|
@@ -43,7 +43,7 @@ the scales (`scaleLinear`, `scaleTime`, `scaleBand`, `scalePoint`,
|
|
|
43
43
|
`scaleOrdinal`), accessor/tick helpers (`createAccessor`, `ticks`,
|
|
44
44
|
`niceDomain`), the path builders (`linePath`, `areaPath`, `arcPath`), and
|
|
45
45
|
`resolveTheme`. No name collision, so the core factories keep their own names.
|
|
46
|
-
CSS ships at `@vanduo-oss/vd3-cbun/charts/css`. `VD_CHARTS_VERSION` is `1.0.
|
|
46
|
+
CSS ships at `@vanduo-oss/vd3-cbun/charts/css`. `VD_CHARTS_VERSION` is `1.0.1`.
|
|
47
47
|
|
|
48
48
|
## Code-editor
|
|
49
49
|
|
|
@@ -136,7 +136,7 @@ subpath (coordinate transforms, rotation, distance, plus the terrain tables:
|
|
|
136
136
|
and the `isPassable` / `getMovementCost` / `getTerrainYields` / `getTerrainColor`
|
|
137
137
|
helpers). Hex-grid ships **no CSS** — it renders to a canvas and reads `--vd-*`
|
|
138
138
|
theme tokens off the host element via `getComputedStyle`. `VD_HEX_VERSION` is
|
|
139
|
-
`1.0.
|
|
139
|
+
`1.0.1`.
|
|
140
140
|
|
|
141
141
|
## Music-player
|
|
142
142
|
|
|
@@ -153,7 +153,7 @@ core (no name collision, so it keeps its own name) re-exported alongside
|
|
|
153
153
|
`musicplayer:detach`, `musicplayer:attach`, `musicplayer:minimize`,
|
|
154
154
|
`musicplayer:expand`); the wrapper re-emits each as a Vue event (`@play`,
|
|
155
155
|
`@trackchange`, …, plus `@ready`) carrying `event.detail`. CSS ships at
|
|
156
|
-
`@vanduo-oss/vd3-cbun/music-player/css`. `VD_MUSIC_PLAYER_VERSION` is `1.0.
|
|
156
|
+
`@vanduo-oss/vd3-cbun/music-player/css`. `VD_MUSIC_PLAYER_VERSION` is `1.0.1`.
|
|
157
157
|
|
|
158
158
|
## Theming
|
|
159
159
|
|
package/dist/charts/index.cjs
CHANGED
|
@@ -70,7 +70,7 @@ var DEFAULT_COLORS = [
|
|
|
70
70
|
"#be4bdb",
|
|
71
71
|
"#fd7e14"
|
|
72
72
|
];
|
|
73
|
-
var VD_CHARTS_VERSION = "1.
|
|
73
|
+
var VD_CHARTS_VERSION = "1.1.0";
|
|
74
74
|
var chartId = 0;
|
|
75
75
|
function nextId(prefix) {
|
|
76
76
|
chartId += 1;
|
|
@@ -946,7 +946,7 @@ function renderBarChart(instance) {
|
|
|
946
946
|
drawAnnotations(svg, options, plot, xScale, yScale, theme);
|
|
947
947
|
const labels = dataLabelConfig(options);
|
|
948
948
|
const markGroup = append(svg, svgEl("g", { class: "vd-chart-marks vd-chart-bars" }));
|
|
949
|
-
const baseline = yScale(0);
|
|
949
|
+
const baseline = yScale(Math.min(Math.max(0, yDomain[0]), yDomain[1]));
|
|
950
950
|
rows.forEach((row) => {
|
|
951
951
|
const x = xScale(row.x);
|
|
952
952
|
const y = yScale(row.y);
|
|
@@ -1038,7 +1038,7 @@ function renderMultiBarChart(instance) {
|
|
|
1038
1038
|
drawAnnotations(svg, options, plot, xScale, yScale, theme);
|
|
1039
1039
|
const labels = dataLabelConfig(options);
|
|
1040
1040
|
const markGroup = append(svg, svgEl("g", { class: "vd-chart-marks vd-chart-bars" }));
|
|
1041
|
-
const baseline = yScale(0);
|
|
1041
|
+
const baseline = yScale(Math.min(Math.max(0, yDomain[0]), yDomain[1]));
|
|
1042
1042
|
seriesList.forEach((series) => {
|
|
1043
1043
|
const fill = seriesColor(series, theme);
|
|
1044
1044
|
series.rows.forEach((row) => {
|
|
@@ -1704,7 +1704,7 @@ var CHART_PROPS = {
|
|
|
1704
1704
|
xAxis: { type: Object, default: void 0 },
|
|
1705
1705
|
yAxis: { type: Object, default: void 0 }
|
|
1706
1706
|
};
|
|
1707
|
-
function optionsFrom(target, props) {
|
|
1707
|
+
function optionsFrom(target, props, emit) {
|
|
1708
1708
|
return {
|
|
1709
1709
|
target,
|
|
1710
1710
|
type: props.type,
|
|
@@ -1735,20 +1735,30 @@ function optionsFrom(target, props) {
|
|
|
1735
1735
|
xFormat: props.xFormat,
|
|
1736
1736
|
yFormat: props.yFormat,
|
|
1737
1737
|
xAxis: props.xAxis,
|
|
1738
|
-
yAxis: props.yAxis
|
|
1738
|
+
yAxis: props.yAxis,
|
|
1739
|
+
// Forward the core's mark-click callbacks as the Vue emit family. Passing
|
|
1740
|
+
// all three unconditionally is safe: the core only fires the callback
|
|
1741
|
+
// relevant to the rendered chart type (bars → onBarClick, points →
|
|
1742
|
+
// onPointClick, slices → onSliceClick).
|
|
1743
|
+
onBarClick: (e) => emit("bar-click", e),
|
|
1744
|
+
onPointClick: (e) => emit("point-click", e),
|
|
1745
|
+
onSliceClick: (e) => emit("slice-click", e)
|
|
1739
1746
|
};
|
|
1740
1747
|
}
|
|
1741
1748
|
var VdChart = (0, import_vue.defineComponent)({
|
|
1742
1749
|
name: "VdChart",
|
|
1743
1750
|
props: CHART_PROPS,
|
|
1744
|
-
|
|
1751
|
+
// Mark clicks the core reports through its callbacks are re-emitted here as
|
|
1752
|
+
// idiomatic kebab-case Vue events carrying the core `ClickEvent` payload.
|
|
1753
|
+
emits: ["point-click", "bar-click", "slice-click"],
|
|
1754
|
+
setup(props, { emit }) {
|
|
1745
1755
|
const el = (0, import_vue.ref)(null);
|
|
1746
1756
|
let instance = null;
|
|
1747
1757
|
let currentType = props.type;
|
|
1748
1758
|
const create = () => {
|
|
1749
1759
|
const factory = FACTORIES[props.type] || BarChart;
|
|
1750
1760
|
currentType = props.type;
|
|
1751
|
-
instance = factory(optionsFrom(el.value, props));
|
|
1761
|
+
instance = factory(optionsFrom(el.value, props, emit));
|
|
1752
1762
|
};
|
|
1753
1763
|
(0, import_vue.onMounted)(() => {
|
|
1754
1764
|
if (typeof window === "undefined" || !el.value) return;
|
|
@@ -1792,7 +1802,7 @@ var VdChart = (0, import_vue.defineComponent)({
|
|
|
1792
1802
|
instance.destroy();
|
|
1793
1803
|
create();
|
|
1794
1804
|
} else {
|
|
1795
|
-
instance.update(optionsFrom(el.value, props));
|
|
1805
|
+
instance.update(optionsFrom(el.value, props, emit));
|
|
1796
1806
|
}
|
|
1797
1807
|
},
|
|
1798
1808
|
{ deep: true }
|