@syntrologie/adapt-viz 2.8.0-canary.140

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * adaptive-viz — Lit web component
3
+ *
4
+ * <syntro-viz-chart> renders a chart from the typed ChartProps. Vega-Lite
5
+ * is dynamically imported on first render so the core SDK bundle stays
6
+ * slim — first chart in a session pays the load cost; subsequent charts
7
+ * share the loaded module.
8
+ */
9
+ import { LitElement } from 'lit';
10
+ import type { ChartProps } from './types';
11
+ export declare class ChartWidgetLit extends LitElement {
12
+ #private;
13
+ static properties: {
14
+ chartProps: {
15
+ attribute: boolean;
16
+ };
17
+ };
18
+ chartProps: ChartProps | undefined;
19
+ createRenderRoot(): this;
20
+ updated(changed: Map<string, unknown>): Promise<void>;
21
+ render(): import("lit-html").TemplateResult<1>;
22
+ }
23
+ declare global {
24
+ interface HTMLElementTagNameMap {
25
+ 'syntro-viz-chart': ChartWidgetLit;
26
+ }
27
+ }
28
+ //# sourceMappingURL=ChartWidgetLit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartWidgetLit.d.ts","sourceRoot":"","sources":["../src/ChartWidgetLit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,SAAS,CAAC;AAExD,qBAAa,cAAe,SAAQ,UAAU;;IAC5C,OAAgB,UAAU;;;;MAExB;IAEF,UAAU,EAAE,UAAU,GAAG,SAAS,CAAa;IAGtC,gBAAgB;IAIV,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3D,MAAM;CAkChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * adaptive-viz — Lit web component
3
+ *
4
+ * <syntro-viz-chart> renders a chart from the typed ChartProps. Vega-Lite
5
+ * is dynamically imported on first render so the core SDK bundle stays
6
+ * slim — first chart in a session pays the load cost; subsequent charts
7
+ * share the loaded module.
8
+ */
9
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
12
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13
+ };
14
+ var _ChartWidgetLit_instances, _ChartWidgetLit_renderChart;
15
+ import { html, LitElement } from 'lit';
16
+ import { compileToVegaLite } from './layouts';
17
+ import { buildVegaLiteConfigFromCssVars } from './theme';
18
+ export class ChartWidgetLit extends LitElement {
19
+ constructor() {
20
+ super(...arguments);
21
+ _ChartWidgetLit_instances.add(this);
22
+ this.chartProps = undefined;
23
+ }
24
+ // Render into light DOM so the parent shadow root's CSS variables flow through.
25
+ createRenderRoot() {
26
+ return this;
27
+ }
28
+ async updated(changed) {
29
+ if (changed.has('chartProps')) {
30
+ await __classPrivateFieldGet(this, _ChartWidgetLit_instances, "m", _ChartWidgetLit_renderChart).call(this);
31
+ }
32
+ }
33
+ render() {
34
+ return html `<div data-syntro-viz-chart-container style="width:100%; min-height:200px;"></div>`;
35
+ }
36
+ }
37
+ _ChartWidgetLit_instances = new WeakSet(), _ChartWidgetLit_renderChart = async function _ChartWidgetLit_renderChart() {
38
+ const container = this.querySelector('[data-syntro-viz-chart-container]');
39
+ if (!container)
40
+ return;
41
+ if (!this.chartProps) {
42
+ container.textContent = '(no chart configured)';
43
+ return;
44
+ }
45
+ let spec;
46
+ try {
47
+ spec = compileToVegaLite(this.chartProps);
48
+ }
49
+ catch (err) {
50
+ container.textContent = `Chart error: ${err.message}`;
51
+ return;
52
+ }
53
+ const config = buildVegaLiteConfigFromCssVars(this);
54
+ try {
55
+ const { default: embed } = await import('vega-embed');
56
+ await embed(container, spec, {
57
+ actions: false,
58
+ config: config,
59
+ renderer: 'svg',
60
+ });
61
+ }
62
+ catch (err) {
63
+ container.textContent = `Chart render error: ${err.message}`;
64
+ }
65
+ };
66
+ ChartWidgetLit.properties = {
67
+ chartProps: { attribute: false },
68
+ };
package/dist/cdn.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * adaptive-viz — CDN entrypoint
3
+ *
4
+ * Loaded by the runtime SDK's AppLoader when a tile references
5
+ * adaptive-viz:chart and the package isn't bundled (it isn't — see
6
+ * `syntrologie.bundlingMode: cdn-only` in package.json).
7
+ *
8
+ * The act of importing ./runtime registers the <syntro-viz-chart> custom
9
+ * element and exposes the widget mountable on the manifest.
10
+ */
11
+ import { runtime } from './runtime';
12
+ export { runtime };
13
+ export default runtime;
14
+ //# sourceMappingURL=cdn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,eAAe,OAAO,CAAC"}
package/dist/cdn.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * adaptive-viz — CDN entrypoint
3
+ *
4
+ * Loaded by the runtime SDK's AppLoader when a tile references
5
+ * adaptive-viz:chart and the package isn't bundled (it isn't — see
6
+ * `syntrologie.bundlingMode: cdn-only` in package.json).
7
+ *
8
+ * The act of importing ./runtime registers the <syntro-viz-chart> custom
9
+ * element and exposes the widget mountable on the manifest.
10
+ */
11
+ import { runtime } from './runtime';
12
+ if (typeof window !== 'undefined') {
13
+ const synOS = window.SynOS;
14
+ if (synOS?.appRegistry?.register) {
15
+ synOS.appRegistry.register(runtime);
16
+ }
17
+ }
18
+ export { runtime };
19
+ export default runtime;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * adaptive-viz — Bar layout → Vega-Lite spec
3
+ */
4
+ import type { z } from 'zod';
5
+ import type { barLayoutSchema } from '../schema';
6
+ import type { VegaLiteSpec } from '../types';
7
+ type BarProps = z.infer<typeof barLayoutSchema>;
8
+ export declare function barToVegaLite(props: BarProps): VegaLiteSpec;
9
+ export {};
10
+ //# sourceMappingURL=bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../src/layouts/bar.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEhD,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,GAAG,YAAY,CAsB3D"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * adaptive-viz — Bar layout → Vega-Lite spec
3
+ */
4
+ const VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';
5
+ export function barToVegaLite(props) {
6
+ const encoding = {
7
+ x: { field: props.xField, type: 'nominal' },
8
+ y: { field: props.yField, type: 'quantitative' },
9
+ };
10
+ if (props.colorField) {
11
+ encoding.color = { field: props.colorField, type: 'nominal' };
12
+ }
13
+ const spec = {
14
+ $schema: VEGA_LITE_SCHEMA_URL,
15
+ data: { values: props.data },
16
+ mark: 'bar',
17
+ encoding,
18
+ };
19
+ if (props.title) {
20
+ spec.title = props.title;
21
+ }
22
+ return spec;
23
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * adaptive-viz — Layout dispatcher
3
+ *
4
+ * Given validated ChartProps, produce a Vega-Lite spec ready for rendering.
5
+ * Dispatches by `layout` key. The custom path passes the spec through
6
+ * after the runtime self-contained-data check.
7
+ */
8
+ import type { ChartProps, VegaLiteSpec } from '../types';
9
+ export declare function compileToVegaLite(props: ChartProps): VegaLiteSpec;
10
+ export { barToVegaLite } from './bar';
11
+ export { lineToVegaLite } from './line';
12
+ export { tableToVegaLite } from './table';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMzD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CAgBjE;AAED,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * adaptive-viz — Layout dispatcher
3
+ *
4
+ * Given validated ChartProps, produce a Vega-Lite spec ready for rendering.
5
+ * Dispatches by `layout` key. The custom path passes the spec through
6
+ * after the runtime self-contained-data check.
7
+ */
8
+ import { assertSelfContainedData } from '../validation';
9
+ import { barToVegaLite } from './bar';
10
+ import { lineToVegaLite } from './line';
11
+ import { tableToVegaLite } from './table';
12
+ export function compileToVegaLite(props) {
13
+ switch (props.layout) {
14
+ case 'bar':
15
+ return barToVegaLite(props);
16
+ case 'line':
17
+ return lineToVegaLite(props);
18
+ case 'table':
19
+ return tableToVegaLite(props);
20
+ case 'custom':
21
+ assertSelfContainedData(props.spec);
22
+ return props.spec;
23
+ default:
24
+ throw new Error(`Unknown chart layout: ${props.layout ?? 'undefined'}`);
25
+ }
26
+ }
27
+ export { barToVegaLite } from './bar';
28
+ export { lineToVegaLite } from './line';
29
+ export { tableToVegaLite } from './table';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * adaptive-viz — Line layout → Vega-Lite spec
3
+ */
4
+ import type { z } from 'zod';
5
+ import type { lineLayoutSchema } from '../schema';
6
+ import type { VegaLiteSpec } from '../types';
7
+ type LineProps = z.infer<typeof lineLayoutSchema>;
8
+ export declare function lineToVegaLite(props: LineProps): VegaLiteSpec;
9
+ export {};
10
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../src/layouts/line.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,KAAK,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAElD,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAsB7D"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * adaptive-viz — Line layout → Vega-Lite spec
3
+ */
4
+ const VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';
5
+ export function lineToVegaLite(props) {
6
+ const encoding = {
7
+ x: { field: props.xField, type: 'quantitative' },
8
+ y: { field: props.yField, type: 'quantitative' },
9
+ };
10
+ if (props.seriesField) {
11
+ encoding.color = { field: props.seriesField, type: 'nominal' };
12
+ }
13
+ const spec = {
14
+ $schema: VEGA_LITE_SCHEMA_URL,
15
+ data: { values: props.data },
16
+ mark: 'line',
17
+ encoding,
18
+ };
19
+ if (props.title) {
20
+ spec.title = props.title;
21
+ }
22
+ return spec;
23
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * adaptive-viz — Table layout → Vega-Lite spec
3
+ *
4
+ * Renders a tabular layout as a layered Vega-Lite spec where each column
5
+ * is its own text-mark layer positioned by ordinal x. Suitable for small
6
+ * data tables (<= 50 rows). For large tables, prefer a custom layout
7
+ * with a more efficient rendering strategy.
8
+ */
9
+ import type { z } from 'zod';
10
+ import type { tableLayoutSchema } from '../schema';
11
+ import type { VegaLiteSpec } from '../types';
12
+ type TableProps = z.infer<typeof tableLayoutSchema>;
13
+ export declare function tableToVegaLite(props: TableProps): VegaLiteSpec;
14
+ export {};
15
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/layouts/table.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEpD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CAwB/D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * adaptive-viz — Table layout → Vega-Lite spec
3
+ *
4
+ * Renders a tabular layout as a layered Vega-Lite spec where each column
5
+ * is its own text-mark layer positioned by ordinal x. Suitable for small
6
+ * data tables (<= 50 rows). For large tables, prefer a custom layout
7
+ * with a more efficient rendering strategy.
8
+ */
9
+ const VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';
10
+ export function tableToVegaLite(props) {
11
+ const layer = props.columns.map((col, idx) => ({
12
+ mark: { type: 'text', align: 'left', baseline: 'middle' },
13
+ encoding: {
14
+ x: { value: idx * 120 },
15
+ y: { field: '_row', type: 'ordinal', axis: null },
16
+ text: { field: col.field },
17
+ },
18
+ }));
19
+ // Add a row index so y-encoding has something stable to bind to
20
+ const dataWithRowIdx = props.data.map((row, i) => ({ ...row, _row: i }));
21
+ const spec = {
22
+ $schema: VEGA_LITE_SCHEMA_URL,
23
+ data: { values: dataWithRowIdx },
24
+ layer,
25
+ };
26
+ if (props.title) {
27
+ spec.title = props.title;
28
+ }
29
+ return spec;
30
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * adaptive-viz — Runtime manifest
3
+ *
4
+ * Exports the runtime descriptor consumed by the SDK's AppLoader.
5
+ * Registers the <syntro-viz-chart> custom element as a side effect of
6
+ * importing this module, and exposes the widget mountable used by
7
+ * SmartCanvasRuntime's WidgetRegistry.
8
+ */
9
+ import type { ChartProps } from './types';
10
+ /**
11
+ * Mountable widget interface: receives a container element and the tile's
12
+ * props (validated upstream against chartSchema), returns an unmount fn.
13
+ */
14
+ export declare const ChartWidgetMountable: {
15
+ mount(container: HTMLElement, config?: ChartProps & {
16
+ instanceId?: string;
17
+ }): () => void;
18
+ };
19
+ export declare const runtime: {
20
+ id: string;
21
+ version: string;
22
+ name: string;
23
+ description: string;
24
+ /**
25
+ * No DOM-mutation executors — this widget renders only.
26
+ */
27
+ executors: never[];
28
+ /**
29
+ * Widget definitions for the runtime's WidgetRegistry.
30
+ */
31
+ widgets: {
32
+ id: string;
33
+ component: {
34
+ mount(container: HTMLElement, config?: ChartProps & {
35
+ instanceId?: string;
36
+ }): () => void;
37
+ };
38
+ metadata: {
39
+ name: string;
40
+ description: string;
41
+ icon: string;
42
+ };
43
+ }[];
44
+ };
45
+ export default runtime;
46
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQ1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB;qBACd,WAAW,WAAW,UAAU,GAAG;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;CAU5E,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;IAOlB;;OAEG;;IAGH;;OAEG;;;;6BA1Bc,WAAW,WAAW,UAAU,GAAG;gBAAE,UAAU,CAAC,EAAE,MAAM,CAAA;aAAE;;;;;;;;CAsC5E,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * adaptive-viz — Runtime manifest
3
+ *
4
+ * Exports the runtime descriptor consumed by the SDK's AppLoader.
5
+ * Registers the <syntro-viz-chart> custom element as a side effect of
6
+ * importing this module, and exposes the widget mountable used by
7
+ * SmartCanvasRuntime's WidgetRegistry.
8
+ */
9
+ import { ChartWidgetLit } from './ChartWidgetLit';
10
+ const TAG = 'syntro-viz-chart';
11
+ if (typeof customElements !== 'undefined' && !customElements.get(TAG)) {
12
+ customElements.define(TAG, ChartWidgetLit);
13
+ }
14
+ /**
15
+ * Mountable widget interface: receives a container element and the tile's
16
+ * props (validated upstream against chartSchema), returns an unmount fn.
17
+ */
18
+ export const ChartWidgetMountable = {
19
+ mount(container, config) {
20
+ const { instanceId: _instanceId, ...chartProps } = (config ?? {});
21
+ const el = document.createElement(TAG);
22
+ el.chartProps = chartProps;
23
+ container.appendChild(el);
24
+ return () => el.remove();
25
+ },
26
+ };
27
+ export const runtime = {
28
+ id: 'adaptive-viz',
29
+ version: '1.0.0',
30
+ name: 'Chart',
31
+ description: 'Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) plus a custom escape hatch.',
32
+ /**
33
+ * No DOM-mutation executors — this widget renders only.
34
+ */
35
+ executors: [],
36
+ /**
37
+ * Widget definitions for the runtime's WidgetRegistry.
38
+ */
39
+ widgets: [
40
+ {
41
+ id: 'adaptive-viz:chart',
42
+ component: ChartWidgetMountable,
43
+ metadata: {
44
+ name: 'Chart',
45
+ description: 'Bar / line / table / custom Vega-Lite chart',
46
+ icon: '📊',
47
+ },
48
+ },
49
+ ],
50
+ };
51
+ export default runtime;
@@ -0,0 +1,307 @@
1
+ /**
2
+ * adaptive-viz — Zod schema (source of truth for tile config validation)
3
+ *
4
+ * Discriminated union over `layout`:
5
+ * - "bar" | "line" | "table" → typed wrappers; compiled to Vega-Lite internally
6
+ * - "custom" → free-form Vega-Lite spec; data must be inline
7
+ */
8
+ import { z } from 'zod';
9
+ declare const barLayoutSchema: z.ZodObject<{
10
+ layout: z.ZodLiteral<"bar">;
11
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
12
+ xField: z.ZodString;
13
+ yField: z.ZodString;
14
+ colorField: z.ZodOptional<z.ZodString>;
15
+ title: z.ZodOptional<z.ZodString>;
16
+ }, "strict", z.ZodTypeAny, {
17
+ layout: "bar";
18
+ data: Record<string, unknown>[];
19
+ xField: string;
20
+ yField: string;
21
+ colorField?: string | undefined;
22
+ title?: string | undefined;
23
+ }, {
24
+ layout: "bar";
25
+ data: Record<string, unknown>[];
26
+ xField: string;
27
+ yField: string;
28
+ colorField?: string | undefined;
29
+ title?: string | undefined;
30
+ }>;
31
+ declare const lineLayoutSchema: z.ZodObject<{
32
+ layout: z.ZodLiteral<"line">;
33
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
34
+ xField: z.ZodString;
35
+ yField: z.ZodString;
36
+ seriesField: z.ZodOptional<z.ZodString>;
37
+ title: z.ZodOptional<z.ZodString>;
38
+ }, "strict", z.ZodTypeAny, {
39
+ layout: "line";
40
+ data: Record<string, unknown>[];
41
+ xField: string;
42
+ yField: string;
43
+ title?: string | undefined;
44
+ seriesField?: string | undefined;
45
+ }, {
46
+ layout: "line";
47
+ data: Record<string, unknown>[];
48
+ xField: string;
49
+ yField: string;
50
+ title?: string | undefined;
51
+ seriesField?: string | undefined;
52
+ }>;
53
+ declare const tableLayoutSchema: z.ZodObject<{
54
+ layout: z.ZodLiteral<"table">;
55
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
56
+ columns: z.ZodArray<z.ZodObject<{
57
+ field: z.ZodString;
58
+ header: z.ZodString;
59
+ }, "strict", z.ZodTypeAny, {
60
+ field: string;
61
+ header: string;
62
+ }, {
63
+ field: string;
64
+ header: string;
65
+ }>, "many">;
66
+ title: z.ZodOptional<z.ZodString>;
67
+ }, "strict", z.ZodTypeAny, {
68
+ layout: "table";
69
+ data: Record<string, unknown>[];
70
+ columns: {
71
+ field: string;
72
+ header: string;
73
+ }[];
74
+ title?: string | undefined;
75
+ }, {
76
+ layout: "table";
77
+ data: Record<string, unknown>[];
78
+ columns: {
79
+ field: string;
80
+ header: string;
81
+ }[];
82
+ title?: string | undefined;
83
+ }>;
84
+ export declare const customLayoutSchema: z.ZodEffects<z.ZodObject<{
85
+ layout: z.ZodLiteral<"custom">;
86
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
87
+ title: z.ZodOptional<z.ZodString>;
88
+ }, "strict", z.ZodTypeAny, {
89
+ layout: "custom";
90
+ spec: Record<string, unknown>;
91
+ title?: string | undefined;
92
+ }, {
93
+ layout: "custom";
94
+ spec: Record<string, unknown>;
95
+ title?: string | undefined;
96
+ }>, {
97
+ layout: "custom";
98
+ spec: Record<string, unknown>;
99
+ title?: string | undefined;
100
+ }, {
101
+ layout: "custom";
102
+ spec: Record<string, unknown>;
103
+ title?: string | undefined;
104
+ }>;
105
+ /**
106
+ * z.discriminatedUnion requires plain ZodObject members (no .refine() wrappers).
107
+ * customLayoutSchema uses .refine(), so we use z.union here instead.
108
+ * Runtime performance is still good because all members start with .strict()
109
+ * and the discriminator `layout` literal eliminates candidates early.
110
+ */
111
+ export declare const chartSchema: z.ZodUnion<[z.ZodObject<{
112
+ layout: z.ZodLiteral<"bar">;
113
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
114
+ xField: z.ZodString;
115
+ yField: z.ZodString;
116
+ colorField: z.ZodOptional<z.ZodString>;
117
+ title: z.ZodOptional<z.ZodString>;
118
+ }, "strict", z.ZodTypeAny, {
119
+ layout: "bar";
120
+ data: Record<string, unknown>[];
121
+ xField: string;
122
+ yField: string;
123
+ colorField?: string | undefined;
124
+ title?: string | undefined;
125
+ }, {
126
+ layout: "bar";
127
+ data: Record<string, unknown>[];
128
+ xField: string;
129
+ yField: string;
130
+ colorField?: string | undefined;
131
+ title?: string | undefined;
132
+ }>, z.ZodObject<{
133
+ layout: z.ZodLiteral<"line">;
134
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
135
+ xField: z.ZodString;
136
+ yField: z.ZodString;
137
+ seriesField: z.ZodOptional<z.ZodString>;
138
+ title: z.ZodOptional<z.ZodString>;
139
+ }, "strict", z.ZodTypeAny, {
140
+ layout: "line";
141
+ data: Record<string, unknown>[];
142
+ xField: string;
143
+ yField: string;
144
+ title?: string | undefined;
145
+ seriesField?: string | undefined;
146
+ }, {
147
+ layout: "line";
148
+ data: Record<string, unknown>[];
149
+ xField: string;
150
+ yField: string;
151
+ title?: string | undefined;
152
+ seriesField?: string | undefined;
153
+ }>, z.ZodObject<{
154
+ layout: z.ZodLiteral<"table">;
155
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
156
+ columns: z.ZodArray<z.ZodObject<{
157
+ field: z.ZodString;
158
+ header: z.ZodString;
159
+ }, "strict", z.ZodTypeAny, {
160
+ field: string;
161
+ header: string;
162
+ }, {
163
+ field: string;
164
+ header: string;
165
+ }>, "many">;
166
+ title: z.ZodOptional<z.ZodString>;
167
+ }, "strict", z.ZodTypeAny, {
168
+ layout: "table";
169
+ data: Record<string, unknown>[];
170
+ columns: {
171
+ field: string;
172
+ header: string;
173
+ }[];
174
+ title?: string | undefined;
175
+ }, {
176
+ layout: "table";
177
+ data: Record<string, unknown>[];
178
+ columns: {
179
+ field: string;
180
+ header: string;
181
+ }[];
182
+ title?: string | undefined;
183
+ }>, z.ZodEffects<z.ZodObject<{
184
+ layout: z.ZodLiteral<"custom">;
185
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
186
+ title: z.ZodOptional<z.ZodString>;
187
+ }, "strict", z.ZodTypeAny, {
188
+ layout: "custom";
189
+ spec: Record<string, unknown>;
190
+ title?: string | undefined;
191
+ }, {
192
+ layout: "custom";
193
+ spec: Record<string, unknown>;
194
+ title?: string | undefined;
195
+ }>, {
196
+ layout: "custom";
197
+ spec: Record<string, unknown>;
198
+ title?: string | undefined;
199
+ }, {
200
+ layout: "custom";
201
+ spec: Record<string, unknown>;
202
+ title?: string | undefined;
203
+ }>]>;
204
+ /**
205
+ * Tile widget definitions for unified JSON Schema generation.
206
+ * Maps widget IDs to their props validation schema so the build script
207
+ * can inject if/then constraints on tile.props.
208
+ */
209
+ export declare const tileWidgets: {
210
+ widget: string;
211
+ defName: string;
212
+ propsSchema: z.ZodUnion<[z.ZodObject<{
213
+ layout: z.ZodLiteral<"bar">;
214
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
215
+ xField: z.ZodString;
216
+ yField: z.ZodString;
217
+ colorField: z.ZodOptional<z.ZodString>;
218
+ title: z.ZodOptional<z.ZodString>;
219
+ }, "strict", z.ZodTypeAny, {
220
+ layout: "bar";
221
+ data: Record<string, unknown>[];
222
+ xField: string;
223
+ yField: string;
224
+ colorField?: string | undefined;
225
+ title?: string | undefined;
226
+ }, {
227
+ layout: "bar";
228
+ data: Record<string, unknown>[];
229
+ xField: string;
230
+ yField: string;
231
+ colorField?: string | undefined;
232
+ title?: string | undefined;
233
+ }>, z.ZodObject<{
234
+ layout: z.ZodLiteral<"line">;
235
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
236
+ xField: z.ZodString;
237
+ yField: z.ZodString;
238
+ seriesField: z.ZodOptional<z.ZodString>;
239
+ title: z.ZodOptional<z.ZodString>;
240
+ }, "strict", z.ZodTypeAny, {
241
+ layout: "line";
242
+ data: Record<string, unknown>[];
243
+ xField: string;
244
+ yField: string;
245
+ title?: string | undefined;
246
+ seriesField?: string | undefined;
247
+ }, {
248
+ layout: "line";
249
+ data: Record<string, unknown>[];
250
+ xField: string;
251
+ yField: string;
252
+ title?: string | undefined;
253
+ seriesField?: string | undefined;
254
+ }>, z.ZodObject<{
255
+ layout: z.ZodLiteral<"table">;
256
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
257
+ columns: z.ZodArray<z.ZodObject<{
258
+ field: z.ZodString;
259
+ header: z.ZodString;
260
+ }, "strict", z.ZodTypeAny, {
261
+ field: string;
262
+ header: string;
263
+ }, {
264
+ field: string;
265
+ header: string;
266
+ }>, "many">;
267
+ title: z.ZodOptional<z.ZodString>;
268
+ }, "strict", z.ZodTypeAny, {
269
+ layout: "table";
270
+ data: Record<string, unknown>[];
271
+ columns: {
272
+ field: string;
273
+ header: string;
274
+ }[];
275
+ title?: string | undefined;
276
+ }, {
277
+ layout: "table";
278
+ data: Record<string, unknown>[];
279
+ columns: {
280
+ field: string;
281
+ header: string;
282
+ }[];
283
+ title?: string | undefined;
284
+ }>, z.ZodEffects<z.ZodObject<{
285
+ layout: z.ZodLiteral<"custom">;
286
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
287
+ title: z.ZodOptional<z.ZodString>;
288
+ }, "strict", z.ZodTypeAny, {
289
+ layout: "custom";
290
+ spec: Record<string, unknown>;
291
+ title?: string | undefined;
292
+ }, {
293
+ layout: "custom";
294
+ spec: Record<string, unknown>;
295
+ title?: string | undefined;
296
+ }>, {
297
+ layout: "custom";
298
+ spec: Record<string, unknown>;
299
+ title?: string | undefined;
300
+ }, {
301
+ layout: "custom";
302
+ spec: Record<string, unknown>;
303
+ title?: string | undefined;
304
+ }>]>;
305
+ }[];
306
+ export { barLayoutSchema, lineLayoutSchema, tableLayoutSchema };
307
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EASV,CAAC;AAEZ,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EASX,CAAC;AAEZ,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOZ,CAAC;AAkBZ,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;EAS3B,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKtB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEvB,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC"}
package/dist/schema.js ADDED
@@ -0,0 +1,87 @@
1
+ /**
2
+ * adaptive-viz — Zod schema (source of truth for tile config validation)
3
+ *
4
+ * Discriminated union over `layout`:
5
+ * - "bar" | "line" | "table" → typed wrappers; compiled to Vega-Lite internally
6
+ * - "custom" → free-form Vega-Lite spec; data must be inline
7
+ */
8
+ import { z } from 'zod';
9
+ const dataRow = z.record(z.string(), z.unknown());
10
+ const barLayoutSchema = z
11
+ .object({
12
+ layout: z.literal('bar'),
13
+ data: z.array(dataRow),
14
+ xField: z.string(),
15
+ yField: z.string(),
16
+ colorField: z.string().optional(),
17
+ title: z.string().optional(),
18
+ })
19
+ .strict();
20
+ const lineLayoutSchema = z
21
+ .object({
22
+ layout: z.literal('line'),
23
+ data: z.array(dataRow),
24
+ xField: z.string(),
25
+ yField: z.string(),
26
+ seriesField: z.string().optional(),
27
+ title: z.string().optional(),
28
+ })
29
+ .strict();
30
+ const tableLayoutSchema = z
31
+ .object({
32
+ layout: z.literal('table'),
33
+ data: z.array(dataRow),
34
+ columns: z.array(z.object({ field: z.string(), header: z.string() }).strict()),
35
+ title: z.string().optional(),
36
+ })
37
+ .strict();
38
+ /**
39
+ * Detect whether a Vega-Lite spec has inline data.
40
+ * Vega-Lite supports `data: { values: [...] }` (inline) or `data: { url, name, source }`
41
+ * (external). Self-contained means inline only.
42
+ */
43
+ function hasInlineData(spec) {
44
+ if (!spec || typeof spec !== 'object')
45
+ return false;
46
+ const data = spec.data;
47
+ if (!data || typeof data !== 'object')
48
+ return false;
49
+ const d = data;
50
+ // Reject any external-data forms outright
51
+ if ('url' in d || 'name' in d || 'source' in d)
52
+ return false;
53
+ // Accept inline values array
54
+ return Array.isArray(d.values);
55
+ }
56
+ export const customLayoutSchema = z
57
+ .object({
58
+ layout: z.literal('custom'),
59
+ spec: z.record(z.string(), z.unknown()),
60
+ title: z.string().optional(),
61
+ })
62
+ .strict()
63
+ .refine((v) => hasInlineData(v.spec), {
64
+ message: 'Custom Vega-Lite spec must contain inline data (data.values: [...])',
65
+ });
66
+ /**
67
+ * z.discriminatedUnion requires plain ZodObject members (no .refine() wrappers).
68
+ * customLayoutSchema uses .refine(), so we use z.union here instead.
69
+ * Runtime performance is still good because all members start with .strict()
70
+ * and the discriminator `layout` literal eliminates candidates early.
71
+ */
72
+ export const chartSchema = z.union([
73
+ barLayoutSchema,
74
+ lineLayoutSchema,
75
+ tableLayoutSchema,
76
+ customLayoutSchema,
77
+ ]);
78
+ /**
79
+ * Tile widget definitions for unified JSON Schema generation.
80
+ * Maps widget IDs to their props validation schema so the build script
81
+ * can inject if/then constraints on tile.props.
82
+ */
83
+ export const tileWidgets = [
84
+ { widget: 'adaptive-viz:chart', defName: 'vizChartProps', propsSchema: chartSchema },
85
+ ];
86
+ // Internal re-exports for type derivation (used by types.ts)
87
+ export { barLayoutSchema, lineLayoutSchema, tableLayoutSchema };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * adaptive-viz — Theme bridge
3
+ *
4
+ * Reads the Syntro CSS variables off the host element's computed style and
5
+ * produces a Vega-Lite `config` block that matches the customer brand at
6
+ * compile time. Vega-Lite uses this config as defaults applied across all
7
+ * marks, axes, legends, and titles.
8
+ */
9
+ export interface VegaLiteConfig {
10
+ mark?: Record<string, unknown>;
11
+ title?: Record<string, unknown>;
12
+ axis?: Record<string, unknown>;
13
+ legend?: Record<string, unknown>;
14
+ view?: Record<string, unknown>;
15
+ background?: string;
16
+ }
17
+ export declare function buildVegaLiteConfigFromCssVars(host: HTMLElement): VegaLiteConfig;
18
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CA+BhF"}
package/dist/theme.js ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * adaptive-viz — Theme bridge
3
+ *
4
+ * Reads the Syntro CSS variables off the host element's computed style and
5
+ * produces a Vega-Lite `config` block that matches the customer brand at
6
+ * compile time. Vega-Lite uses this config as defaults applied across all
7
+ * marks, axes, legends, and titles.
8
+ */
9
+ function readVar(style, name) {
10
+ const v = style.getPropertyValue(name).trim();
11
+ return v.length > 0 ? v : undefined;
12
+ }
13
+ export function buildVegaLiteConfigFromCssVars(host) {
14
+ const style = getComputedStyle(host);
15
+ const colorPrimary = readVar(style, '--sc-color-primary');
16
+ const fontFamily = readVar(style, '--sc-font-family');
17
+ const textColor = readVar(style, '--sc-overlay-text-color');
18
+ const tileBg = readVar(style, '--sc-tile-background');
19
+ const config = {};
20
+ if (colorPrimary) {
21
+ config.mark = { color: colorPrimary };
22
+ }
23
+ if (fontFamily) {
24
+ config.title = { font: fontFamily };
25
+ config.axis = { labelFont: fontFamily, titleFont: fontFamily };
26
+ config.legend = { labelFont: fontFamily, titleFont: fontFamily };
27
+ }
28
+ if (textColor) {
29
+ config.axis = { ...(config.axis ?? {}), labelColor: textColor, titleColor: textColor };
30
+ config.legend = { ...(config.legend ?? {}), labelColor: textColor, titleColor: textColor };
31
+ config.title = { ...(config.title ?? {}), color: textColor };
32
+ }
33
+ if (tileBg) {
34
+ config.background = tileBg;
35
+ }
36
+ return config;
37
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * adaptive-viz — Shared TypeScript types
3
+ *
4
+ * The Zod schema in schema.ts is the source of truth for runtime validation.
5
+ * These types are derived from the schema (z.infer) for compile-time use.
6
+ */
7
+ import type { z } from 'zod';
8
+ import type { chartSchema, customLayoutSchema } from './schema';
9
+ export type ChartProps = z.infer<typeof chartSchema>;
10
+ export type CustomLayoutProps = z.infer<typeof customLayoutSchema>;
11
+ /**
12
+ * Vega-Lite spec — typed loosely as `unknown` for now since vega-lite v5's
13
+ * full TS types are heavy and not needed at our boundary. We pass specs
14
+ * straight through to vega-embed which validates them itself.
15
+ */
16
+ export type VegaLiteSpec = Record<string, unknown>;
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEnE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * adaptive-viz — Shared TypeScript types
3
+ *
4
+ * The Zod schema in schema.ts is the source of truth for runtime validation.
5
+ * These types are derived from the schema (z.infer) for compile-time use.
6
+ */
7
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * adaptive-viz — Runtime validation
3
+ *
4
+ * Defensive checks applied after Zod schema validation, before vega-embed
5
+ * compiles + renders the spec. Belt-and-suspenders for things the schema
6
+ * can't statically verify on `custom` layouts.
7
+ */
8
+ import type { VegaLiteSpec } from './types';
9
+ /**
10
+ * Throw if the spec's top-level data isn't inline.
11
+ *
12
+ * TODO(security): This check covers the top-level `data` field only. A
13
+ * thorough security review should also walk:
14
+ * - spec.transform[*].lookup.from.data — transform-level data sources
15
+ * - spec.layer[*].data — per-layer data sources
16
+ * - spec.facet / spec.repeat / spec.concat / spec.hconcat / spec.vconcat — composite specs
17
+ * - spec.params[*] — parameter sources
18
+ * - mark: 'image' marks with a url field — image fetch URLs
19
+ * - geoshape projection sources
20
+ * Until we do that pass, treat the `custom` escape hatch as elevated trust.
21
+ */
22
+ export declare function assertSelfContainedData(spec: VegaLiteSpec): void;
23
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAiBhE"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * adaptive-viz — Runtime validation
3
+ *
4
+ * Defensive checks applied after Zod schema validation, before vega-embed
5
+ * compiles + renders the spec. Belt-and-suspenders for things the schema
6
+ * can't statically verify on `custom` layouts.
7
+ */
8
+ /**
9
+ * Throw if the spec's top-level data isn't inline.
10
+ *
11
+ * TODO(security): This check covers the top-level `data` field only. A
12
+ * thorough security review should also walk:
13
+ * - spec.transform[*].lookup.from.data — transform-level data sources
14
+ * - spec.layer[*].data — per-layer data sources
15
+ * - spec.facet / spec.repeat / spec.concat / spec.hconcat / spec.vconcat — composite specs
16
+ * - spec.params[*] — parameter sources
17
+ * - mark: 'image' marks with a url field — image fetch URLs
18
+ * - geoshape projection sources
19
+ * Until we do that pass, treat the `custom` escape hatch as elevated trust.
20
+ */
21
+ export function assertSelfContainedData(spec) {
22
+ if (!spec || typeof spec !== 'object') {
23
+ throw new Error('Spec must be an object');
24
+ }
25
+ const data = spec.data;
26
+ if (!data || typeof data !== 'object') {
27
+ throw new Error('Spec must have a `data` field with inline `values`');
28
+ }
29
+ const d = data;
30
+ if ('url' in d || 'name' in d || 'source' in d) {
31
+ throw new Error('Custom Vega-Lite spec must have inline data. Got data.url / data.name / data.source — these external-data forms are rejected.');
32
+ }
33
+ if (!Array.isArray(d.values)) {
34
+ throw new Error('Spec data.values must be an inline array');
35
+ }
36
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@syntrologie/adapt-viz",
3
+ "version": "2.8.0-canary.140",
4
+ "description": "Adaptive Viz — Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) and a custom escape hatch.",
5
+ "license": "Proprietary",
6
+ "private": false,
7
+ "author": "Syntrologie <eng@syntrologie.com>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/SyntropyForge/amazing-demos.git",
11
+ "directory": "packages/adaptives/adaptive-viz"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "syntrologie": {
17
+ "bundlingMode": "cdn-only"
18
+ },
19
+ "type": "module",
20
+ "exports": {
21
+ "./runtime": {
22
+ "types": "./dist/runtime.d.ts",
23
+ "import": "./dist/runtime.js"
24
+ },
25
+ "./schema": {
26
+ "types": "./dist/schema.d.ts",
27
+ "import": "./dist/schema.js"
28
+ },
29
+ "./cdn": {
30
+ "types": "./dist/cdn.d.ts",
31
+ "import": "./dist/cdn.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsc",
39
+ "typecheck": "tsc --noEmit",
40
+ "clean": "rm -rf dist",
41
+ "test": "vitest run",
42
+ "test:watch": "vitest",
43
+ "lint": "biome check ."
44
+ },
45
+ "peerDependencies": {
46
+ "lit": "^3.0.0",
47
+ "zod": "^3.0.0"
48
+ },
49
+ "dependencies": {
50
+ "vega": "5.30.0",
51
+ "vega-lite": "5.21.0",
52
+ "vega-embed": "6.26.0"
53
+ },
54
+ "devDependencies": {
55
+ "@open-wc/testing": "4.0.0",
56
+ "@open-wc/testing-helpers": "3.0.1",
57
+ "jsdom": "26.1.0",
58
+ "lit": "3.3.2",
59
+ "typescript": "5.9.3",
60
+ "vitest": "4.0.18",
61
+ "zod": "3.25.76"
62
+ }
63
+ }