@graphysdk/react-renderer 1.9.0-beta.1789034907363 → 1.9.0-beta.1789110926690

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/dist/editable.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as oo, A as io, At as lo, B as qn, C as Zn, D as x, Dt as so, E as co, Et as Xn, F as X, G as uo, H as et, I as U, It as G, J as ho, K as jn, L as V, N as po, Nt as mo, Ot as go, P as vo, Pt as _, Q as Qt, R as Et, S as fo, T as bo, U as Co, V as Mt, W as Yn, X as yo, Z as So, _ as Jn, at as xo, b as Nt, c as wo, d as To, dt as Ao, et as ee, f as Qn, ft as le, g as ko, gt as J, h as Lo, ht as Ot, i as Po, kt as Io, l as Eo, lt as Mo, m as tt, n as se, nt, o as No, ot as k, p as er, q as Oo, r as $, st as Ro, t as Do, u as zo, ut as _o, v as tr, w as Fo, x as Ho, y as be, z as Rt } from "./history-chords-XaZhRBsb.js";
2
- import { d as ce, n as nr, u as rr } from "./dev.utils-DT-z_GBs.js";
1
+ import { $ as oo, A as io, At as lo, B as qn, C as Zn, D as x, Dt as so, E as co, Et as Xn, F as X, Ft as _, G as uo, H as et, I as U, J as ho, K as jn, L as V, Lt as G, Mt as Yn, N as po, Ot as mo, P as go, Pt as vo, Q as Qt, R as Et, S as fo, T as bo, U as Co, V as Mt, W as Jn, X as yo, Z as So, _ as Qn, at as xo, b as Nt, c as wo, d as To, dt as Ao, et as ee, f as er, ft as le, g as ko, gt as J, h as Lo, ht as Ot, i as Po, kt as Io, l as Eo, lt as Mo, m as tt, n as se, nt, o as No, ot as k, p as tr, q as Oo, r as $, st as Ro, t as Do, u as zo, ut as _o, v as nr, w as Fo, x as Ho, y as be, z as Rt } from "./history-chords-BLPhwLjz.js";
2
+ import { n as ce, t as rr } from "./theme.contract.css-Rb-GELRv.js";
3
3
  import { ARROW_DEFAULTS as Bo, ARROW_STICKER_DECLARATIONS as Vo, ARROW_STROKE_WIDTHS as pt, AddAnnotationCommand as pe, AddHighlightCommand as Go, BORDER_RADIUS_TOKENS as en, COMBO_TYPES as tn, CONSTANT_VARIABLES as $o, DEFAULT_BAR_BORDER_RADIUS as Uo, DEFAULT_POINT_SIZE as Wo, DEFAULT_STROKE_WIDTH as Ko, DIFFERENCE_ARROW_DEFAULTS as ar, DIFFERENCE_ARROW_SIZE_DECLARATIONS as nn, MAX_BAR_WIDTH as qo, MIN_BAR_WIDTH as Zo, MoveAnnotationCommand as Xo, RESTING_HOVER_STATE as or, RemoveAnnotationCommand as ke, RemoveHighlightCommand as jo, SHAPE_DEFAULTS as Yo, SetAxisLabelCommand as Jo, SetAxisPositionCommand as Qo, SetAxisTickModeCommand as ei, SetAxisTicksVisibilityCommand as ti, SetAxisVisibilityCommand as ni, SetBarBorderRadiusCommand as ri, SetBarWidthCommand as ai, SetChartTypeCommand as ir, SetContentCaptionCommand as lr, SetContentSourceCommand as oi, SetContentSubtitleCommand as sr, SetContentTitleCommand as cr, SetDataLabelsFormatCommand as ii, SetDifferenceArrowStyleCommand as li, SetGridLineStyleCommand as si, SetGridLineWidthCommand as ci, SetGridVisibilityCommand as di, SetHeadlineCompareWithCommand as ui, SetHeadlinePositionCommand as hi, SetHeadlineShowCommand as rn, SetHeadlineSizeCommand as pi, SetHighlightDimStyleCommand as mi, SetLayerYScaleTypeCommand as gi, SetLegendAlignCommand as vi, SetLegendDisplayCommand as fi, SetLegendPositionCommand as bi, SetLineInterpolationCommand as Ci, SetLineMissingValuesCommand as yi, SetLineWidthCommand as an, SetMappingCommand as Si, SetNumberFormatAbbreviationCommand as xi, SetNumberFormatDecimalsCommand as on, SetPointSizeCommand as wi, SetPolarInnerRadiusCommand as Ti, SetPolarStartAngleCommand as Ai, SetRuleLabelCommand as ki, SetRuleValueCommand as Li, SetScaleDomainCommand as He, SetScaleReverseCommand as Pi, SetScaleTransformCommand as Ii, SetScaleZeroCommand as ln, SetStatLineCommand as Ei, SetStyleRuleCommand as Le, TEXT_ANNOTATION_DEFAULTS as Mi, TEXT_ANNOTATION_FADE_ALPHA as Ni, ToggleCategoryLabelsCommand as Oi, ToggleContentVisibilityCommand as rt, ToggleDataLabelsCommand as Ri, ToggleGoalLineCommand as Di, ToggleLineFillCommand as zi, ToggleLinePointsVisibilityCommand as _i, ToggleStackTotalsCommand as Fi, UpdateAnnotationCommand as re, alignUnitFractions as Hi, areAnchorsEqual as dr, areEndpointsComparable as Bi, buildEditMenuTriggerRegion as Vi, buildLayerStyleAddress as Gi, buildObservationPredicate as $i, canAnchorDirectLabels as Ui, canBecomeCombo as Wi, canBecomeHeatmap as Ki, canPlaceDataLabels as qi, clampAnnotationTranslation as Zi, computeArrow as ur, createObservationAnchorBuilder as Xi, createObservationAnchorParser as ji, createStyleResolver as at, createValueFormatter as Yi, extractConstantValue as Ji, extractVariableName as Qi, filterLayersByGeoms as bt, findAnnotation as el, findAverageLineLayer as tl, findGoalLineLayer as nl, findHighlightsAtObservation as rl, findKindStyleDeclarations as al, findLayerByGeom as hr, findObservationAttachment as ol, findStyleRule as fe, findTrendLineLayer as il, formatDifferenceLabel as ll, hasMultipleGroups as sl, inferDefaultDifferenceArrowEndpoints as cl, inferDifferenceArrowEndpoints as dl, isComboChartType as ve, isCompanionLayer as pr, isObservationAttachmentKind as ul, isPointWithinEditMenuTrigger as mr, isSafeUrl as hl, projectAnchorToPanel as Ue, readChartType as gr, readComboLineLayerId as pl, readHighlightDimStyle as ml, readMappableAesthetics as gl, readMappedVariable as vl, readObservationIndex as fl, resolveBarBandFraction as bl, resolveComparisonBasis as Cl, resolveGridLineStyle as yl, resolveObservationPoint as vr, resolveShapeAnnotationStyle as Sl, stepDifferenceArrowEndpoint as xl, toPanelCursor as Dt } from "@graphysdk/viz-engine";
4
4
  import { createContext as Oe, useCallback as ie, useContext as Pe, useEffect as O, useId as Ae, useMemo as M, useRef as te, useState as Q } from "react";
5
5
  import { Fragment as j, jsx as n, jsxs as m } from "react/jsx-runtime";
@@ -2600,7 +2600,7 @@ var Lr = "d0bl03", ms = "d0bl04", Pr = "d0bl05", Ct = "d0bl06", gs = "d0bl07", v
2600
2600
  border: `1px solid ${ce.border100}`
2601
2601
  } : {
2602
2602
  background: e,
2603
- border: `1px solid ${go(e, 0.1)}`
2603
+ border: `1px solid ${mo(e, 0.1)}`
2604
2604
  }, Rs = (e) => {
2605
2605
  const { themeValues: t } = nt();
2606
2606
  if (Io(e)) return e.toUpperCase();
@@ -2656,12 +2656,12 @@ var Lr = "d0bl03", ms = "d0bl04", Pr = "d0bl05", Ct = "d0bl06", gs = "d0bl07", v
2656
2656
  strokeLinejoin: "round",
2657
2657
  children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" })
2658
2658
  })
2659
- }), qs = "'Noto Serif', Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'NotoColorEmoji'", Zs = `'Aeonik', 'Aeonik Fallback', ${nr}`, Xs = "'PT Mono', 'Courier New', monospace, 'Apple Color Emoji', 'NotoColorEmoji'", js = "'Intruding Cat', cursive, 'Apple Color Emoji', 'NotoColorEmoji'", St = [
2659
+ }), qs = "'Noto Serif', Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'NotoColorEmoji'", Zs = `'Aeonik', 'Aeonik Fallback', ${Yn}`, Xs = "'PT Mono', 'Courier New', monospace, 'Apple Color Emoji', 'NotoColorEmoji'", js = "'Intruding Cat', cursive, 'Apple Color Emoji', 'NotoColorEmoji'", St = [
2660
2660
  {
2661
2661
  id: "modern",
2662
2662
  label: "Modern",
2663
2663
  preview: "Aa",
2664
- fontFamily: nr
2664
+ fontFamily: Yn
2665
2665
  },
2666
2666
  {
2667
2667
  id: "fresh",
@@ -4277,14 +4277,14 @@ var ad = (e) => {
4277
4277
  },
4278
4278
  "data-testid": "arrow-endpoint-preview",
4279
4279
  "data-annotation-id": t.annotationId,
4280
- children: /* @__PURE__ */ n(tr, {
4280
+ children: /* @__PURE__ */ n(nr, {
4281
4281
  computed: l,
4282
4282
  style: i,
4283
4283
  isAddressable: !1
4284
4284
  })
4285
4285
  });
4286
4286
  }, De = () => {
4287
- const e = Jn();
4287
+ const e = Qn();
4288
4288
  return wt(e);
4289
4289
  }, wt = (e) => {
4290
4290
  if (e.length !== 1) return null;
@@ -5569,7 +5569,7 @@ var Ku = {
5569
5569
  return /* @__PURE__ */ n(zo, {
5570
5570
  annotation: e,
5571
5571
  panel: t,
5572
- style: Qn()(e.id),
5572
+ style: er()(e.id),
5573
5573
  blockRef: r
5574
5574
  });
5575
5575
  }, Ve = (e, t, r) => {
@@ -5605,12 +5605,12 @@ var Ku = {
5605
5605
  panelWidth: t.width,
5606
5606
  panelHeight: t.height
5607
5607
  });
5608
- return a === null ? null : /* @__PURE__ */ n(tr, {
5608
+ return a === null ? null : /* @__PURE__ */ n(nr, {
5609
5609
  computed: a,
5610
5610
  style: r,
5611
5611
  isAddressable: !1
5612
5612
  });
5613
- }, eh = ({ shape: e, panelSize: t }) => /* @__PURE__ */ n(er, {
5613
+ }, eh = ({ shape: e, panelSize: t }) => /* @__PURE__ */ n(tr, {
5614
5614
  shape: e,
5615
5615
  style: tt()(e.id),
5616
5616
  panel: t
@@ -5633,7 +5633,7 @@ var Ku = {
5633
5633
  },
5634
5634
  "data-testid": "shape-resize-preview",
5635
5635
  "data-annotation-id": t.annotationId,
5636
- children: /* @__PURE__ */ n(er, {
5636
+ children: /* @__PURE__ */ n(tr, {
5637
5637
  shape: {
5638
5638
  ...o,
5639
5639
  region: Ut(t.region)
@@ -6068,7 +6068,7 @@ var wa = [
6068
6068
  Icon: Vr
6069
6069
  }
6070
6070
  ], Nh = ({ annotation: e, textBox: t, panelRect: r, frameWidth: a, frameHeight: o, frameElement: i }) => {
6071
- const l = k(), { commands: s } = G(), c = _((b) => b.spec.styles.overrides), u = U(), d = lt(), h = Qn()(e.id), v = bh(e.content), p = Ph(v.font), g = Ih(v.fontSize), f = v.color ?? h.textColor, y = M(() => ({
6071
+ const l = k(), { commands: s } = G(), c = _((b) => b.spec.styles.overrides), u = U(), d = lt(), h = er()(e.id), v = bh(e.content), p = Ph(v.font), g = Ih(v.fontSize), f = v.color ?? h.textColor, y = M(() => ({
6072
6072
  target: "annotation",
6073
6073
  kind: "text",
6074
6074
  annotation: e.id
@@ -6461,7 +6461,7 @@ var Yh = "_1tyillx1", Jh = {
6461
6461
  r,
6462
6462
  a
6463
6463
  ]);
6464
- }, o1 = `[${Yn}]`, Je = (e, t, r) => {
6464
+ }, o1 = `[${Jn}]`, Je = (e, t, r) => {
6465
6465
  if (typeof document.elementsFromPoint != "function") return null;
6466
6466
  const a = document.elementsFromPoint(e, t);
6467
6467
  return i1(a, r);
@@ -6475,7 +6475,7 @@ var Yh = "_1tyillx1", Jh = {
6475
6475
  }
6476
6476
  return null;
6477
6477
  }, l1 = (e) => {
6478
- const t = e.getAttribute(Yn);
6478
+ const t = e.getAttribute(Jn);
6479
6479
  if (t !== "annotation") return null;
6480
6480
  const r = e.getAttribute(Co);
6481
6481
  return r === null || r === "" ? null : {
@@ -6653,7 +6653,7 @@ var Yh = "_1tyillx1", Jh = {
6653
6653
  const e = yo((i) => i.hover.primary), { layers: t, coordSystem: r } = _(Ie((i) => ({
6654
6654
  layers: i.layers,
6655
6655
  coordSystem: i.coordSystem
6656
- }))), { anchorResolver: a } = G(), o = mo();
6656
+ }))), { anchorResolver: a } = G(), o = vo();
6657
6657
  return M(() => {
6658
6658
  if (e === null) return null;
6659
6659
  const i = t.find((c) => c.id === e.layerId);
@@ -6784,7 +6784,7 @@ var Yh = "_1tyillx1", Jh = {
6784
6784
  return !1;
6785
6785
  }
6786
6786
  }, En = "editor", Mn = [], C1 = (e, t, r, a) => {
6787
- const o = La(), { store: i } = Ot(), l = Jn().length > 0, s = X((d) => d.menuTrigger), c = o.kind === "menu", u = M(() => s === null ? Mn : [Vi(s)], [s]);
6787
+ const o = La(), { store: i } = Ot(), l = Qn().length > 0, s = X((d) => d.menuTrigger), c = o.kind === "menu", u = M(() => s === null ? Mn : [Vi(s)], [s]);
6788
6788
  b1(e, t), d1(e, t, r), v1(o, t, r), s1(e), h1(e), a1(e, a), O(() => (i.getState().publishPointerRegions(En, u), () => i.getState().publishPointerRegions(En, Mn)), [i, u]), O(() => (i.getState().setPointerSuspended(c || l), () => i.getState().setPointerSuspended(!1)), [
6789
6789
  i,
6790
6790
  c,
@@ -6879,7 +6879,7 @@ var Yh = "_1tyillx1", Jh = {
6879
6879
  });
6880
6880
  }, e0 = ({ slots: e, ...t }) => /* @__PURE__ */ n(ls, {
6881
6881
  locale: Oo(),
6882
- children: /* @__PURE__ */ n(vo, { children: /* @__PURE__ */ n(io, {
6882
+ children: /* @__PURE__ */ n(go, { children: /* @__PURE__ */ n(io, {
6883
6883
  editors: Hc,
6884
6884
  children: /* @__PURE__ */ n(No, {
6885
6885
  slots: M(() => ({
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./dev.utils-BYWvIyGa.cjs");let i=require("@graphysdk/viz-engine/graph-config");var s=t=>{const e={};for(const[r,n]of Object.entries(t.themeOverrides??{}))if(Object.hasOwn(o.vars,r))if(o.isMeasuredFontTokenKey(r)&&typeof n=="string"){const a=(0,i.parseFontShorthand)(n);if(a===null){h(r,n);continue}e[r]=a}else e[r]=n;return e},h=(t,e)=>{o.IS_DEV&&console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${t}": "${e}" is not a measurable font shorthand (needs a px/em size and a family).`)};exports.convertGraphConfigTheme=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./theme.contract.css-BHtVczcV.cjs");require("@graphysdk/viz-engine/graph-config");var c=e=>{const r={};for(const[t,n]of Object.entries(e.themeOverrides??{}))typeof n!="string"||!i(t)||(r[t]=n);return r},i=e=>Object.hasOwn(o.vars,e);exports.convertGraphConfigTheme=c;
@@ -1,50 +1,25 @@
1
- import { FontLength } from '@graphysdk/viz-engine/graph-config';
2
- import { FontStyle } from '@graphysdk/viz-engine/graph-config';
3
1
  import { GraphConfig } from '@graphysdk/viz-engine/graph-config';
4
2
 
5
3
  /**
6
4
  * Converts a `GraphConfig`'s `themeOverrides` — untyped JSON — to the renderer's typed
7
- * {@link ThemeOverrides}: measured font tokens carrying a CSS `font` shorthand string are parsed
8
- * into their structured {@link FontTokenOverride} equivalent. An unparseable shorthand is dropped
9
- * with a dev warning; keys that are no longer on the theme contract are dropped. The data half,
10
- * including the `appearance.textStyle` fonts (resolved against `ctx.fontList` into graph and
11
- * heading style entries), goes through viz-engine's `convertGraphConfig`.
5
+ * {@link ThemeOverrides}. Only keys still on the theme contract pass through; leftover stylesheet
6
+ * keys (`legendBackground`, `tooltipBackground`, …) are ignored because `convertTextStyles`
7
+ * already lifts them onto `style.legendItem` / `style.tooltip`. The data half, including the
8
+ * `appearance.textStyle` fonts (resolved against `ctx.fontList` into graph and heading style
9
+ * entries), goes through viz-engine's `convertGraphConfig`.
12
10
  */
13
11
  export declare const convertGraphConfigTheme: (config: GraphConfig) => ThemeOverrides;
14
12
 
15
13
  /**
16
- * A structured override of a measured font token. Omitted fields keep the token's default (which
17
- * still cascades from the leaf tokens, e.g. `fontSizeXs`), so `{ weight: 600 }` changes only the
18
- * weight.
14
+ * A partial set of token values layered over a base theme — the shape of leftover chrome
15
+ * overrides. Every token takes its CSS string value.
19
16
  */
20
- declare interface FontTokenOverride {
21
- family?: string;
22
- weight?: number;
23
- style?: FontStyle;
24
- size?: FontLength;
25
- /** Unitless multiplier; sizes HTML line boxes (legend band). Canvas measurement ignores it. */
26
- lineHeight?: number;
27
- }
28
-
29
- /**
30
- * The element font tokens JS measurement reproduces. Overridden structurally
31
- * ({@link FontTokenOverride}); the CSS variable's shorthand is serialized from the same object
32
- * measurement reads, so paint and layout move together.
33
- */
34
- declare type MeasuredFontTokenKey = 'fontLegendLabel';
35
-
36
- /**
37
- * A partial set of token values layered over a base theme. Measured font tokens take a
38
- * {@link FontTokenOverride}; every other token takes its CSS string value.
39
- */
40
- declare type ThemeOverrides = Partial<Omit<ThemeValues, MeasuredFontTokenKey>> & {
41
- [Key in MeasuredFontTokenKey]?: FontTokenOverride;
42
- };
17
+ declare type ThemeOverrides = Partial<ThemeValues>;
43
18
 
44
19
  /** Every theme token mapped to its resolved CSS string value. */
45
20
  declare type ThemeValues = Record<keyof typeof vars, string>;
46
21
 
47
- /** CSS custom-property references for every theme token; read at paint sites as `vars.tooltipBackground`, etc. */
22
+ /** CSS custom-property references for every theme token; read at paint sites as `vars.textPrimary`, etc. */
48
23
  declare const vars: {
49
24
  white: `var(--${string})`;
50
25
  black: `var(--${string})`;
@@ -91,22 +66,12 @@ declare const vars: {
91
66
  overlayBackground: `var(--${string})`;
92
67
  overlayBorderGradient: `var(--${string})`;
93
68
  graphBackground: `var(--${string})`;
94
- legendBackground: `var(--${string})`;
95
- legendBorderColor: `var(--${string})`;
96
69
  legendFocusOutlineColor: `var(--${string})`;
97
- legendTextColor: `var(--${string})`;
98
70
  annotationFrameBorderColor: `var(--${string})`;
99
71
  editMenuTriggerIconColor: `var(--${string})`;
100
- tooltipBorderRadius: `var(--${string})`;
101
- tooltipPaddingBlock: `var(--${string})`;
102
- tooltipPaddingInline: `var(--${string})`;
103
72
  tooltipRowGap: `var(--${string})`;
104
- tooltipShadow: `var(--${string})`;
105
73
  editorControlHeight: `var(--${string})`;
106
74
  legendSwatchGap: `var(--${string})`;
107
- legendPillPaddingInline: `var(--${string})`;
108
- legendPillPaddingBlock: `var(--${string})`;
109
- legendPillBorderWidth: `var(--${string})`;
110
75
  headlineRowGap: `var(--${string})`;
111
76
  canvasDefault: `var(--${string})`;
112
77
  canvasBlue: `var(--${string})`;
@@ -142,8 +107,6 @@ declare const vars: {
142
107
  toolbarButtonBackgroundColorHovered: `var(--${string})`;
143
108
  toolbarButtonBackgroundColorSelected: `var(--${string})`;
144
109
  toolbarSeparatorColor: `var(--${string})`;
145
- tooltipBackground: `var(--${string})`;
146
- tooltipBorderColor: `var(--${string})`;
147
110
  fontFamily: `var(--${string})`;
148
111
  fontFamilyHeading: `var(--${string})`;
149
112
  fontWeightRegular: `var(--${string})`;
@@ -172,7 +135,6 @@ declare const vars: {
172
135
  fontLineHeightHeadingSm: `var(--${string})`;
173
136
  fontLineHeightHeadingMd: `var(--${string})`;
174
137
  fontLineHeightHeadingLg: `var(--${string})`;
175
- fontLegendLabel: `var(--${string})`;
176
138
  fontButton: `var(--${string})`;
177
139
  fontInput: `var(--${string})`;
178
140
  fontInputLabel: `var(--${string})`;
@@ -1,21 +1,11 @@
1
- import { c as a, d as s, t as i } from "./dev.utils-DT-z_GBs.js";
2
- import { parseFontShorthand as f } from "@graphysdk/viz-engine/graph-config";
3
- var m = (o) => {
4
- const e = {};
5
- for (const [r, n] of Object.entries(o.themeOverrides ?? {}))
6
- if (Object.hasOwn(s, r))
7
- if (a(r) && typeof n == "string") {
8
- const t = f(n);
9
- if (t === null) {
10
- c(r, n);
11
- continue;
12
- }
13
- e[r] = t;
14
- } else e[r] = n;
15
- return e;
16
- }, c = (o, e) => {
17
- i && console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${o}": "${e}" is not a measurable font shorthand (needs a px/em size and a family).`);
18
- };
1
+ import { n } from "./theme.contract.css-Rb-GELRv.js";
2
+ import "@graphysdk/viz-engine/graph-config";
3
+ var c = (e) => {
4
+ const r = {};
5
+ for (const [t, o] of Object.entries(e.themeOverrides ?? {}))
6
+ typeof o != "string" || !i(t) || (r[t] = o);
7
+ return r;
8
+ }, i = (e) => Object.hasOwn(n, e);
19
9
  export {
20
- m as convertGraphConfigTheme
10
+ c as convertGraphConfigTheme
21
11
  };