@graphysdk/react-renderer 2.0.0-beta.1786440210947 → 2.0.0-beta.1787130761469

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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./font-values-CStAZ2d1.cjs");var h=(r,e)=>{const n=r.appearance?.textStyle;return{...m(r.themeOverrides),...e&&n?g(n,e):void 0}},p=r=>{const e=r.trim().replace(/\s*\/\s*/g,"/").split(/\s+/);let n="normal",o=400,t=0;for(;t<e.length;){const l=e[t];if(l===void 0)return null;if(l==="normal")t++;else if(s.isFontStyle(l))n=l,t++;else{const v=s.parseFontWeight(l);if(v===null)break;o=v,t++}}const i=e[t];if(i===void 0)return null;const[a="",d]=i.split("/"),u=s.parseFontLength(a);if(u===null)return null;const c=d===void 0?null:s.parseUnitlessLineHeight(d),f=e.slice(t+1).join(" ").trim();return f===""?null:{style:n,weight:o,size:u,family:f,...c!==null?{lineHeight:c}:{}}},g=(r,e)=>{const n=i=>i===void 0?void 0:e.find(a=>a.id===i)?.fontFamily,o=n(r.body?.fontId),t=n(r.heading?.fontId);return{...o?{fontFamilyDefault:o}:void 0,...t?{fontFamilyHeading:t}:void 0}},m=r=>{if(r===void 0)return;const e={};for(const[n,o]of Object.entries(r))if(s.isMeasuredFontTokenKey(n)&&typeof o=="string"){const t=p(o);if(t===null){y(n,o);continue}e[n]=t}else e[n]=o;return e},y=(r,e)=>{process.env.NODE_ENV!=="production"&&console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${r}": "${e}" is not a measurable font shorthand (needs a px/em size and a family).`)};exports.convertGraphConfigTheme=h;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./typography-CsG_IWDd.cjs");let s=require("@graphysdk/viz-engine/graph-config");var v=(e,n)=>{const r=e.appearance?.textStyle;return{...c(e.themeOverrides),...n&&r?l(r,n):void 0}},l=(e,n)=>{const r=a=>a===void 0?void 0:n.find(i=>i.id===a)?.fontFamily,o=r(e.body?.fontId),t=r(e.heading?.fontId);return{...o?{fontFamilyDefault:o}:void 0,...t?{fontFamilyHeading:t}:void 0}},c=e=>{if(e===void 0)return;const n={};for(const[r,o]of Object.entries(e))if(d.isMeasuredFontTokenKey(r)&&typeof o=="string"){const t=(0,s.parseFontShorthand)(o);if(t===null){f(r,o);continue}n[r]=t}else n[r]=o;return n},f=(e,n)=>{process.env.NODE_ENV!=="production"&&console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${e}": "${n}" is not a measurable font shorthand (needs a px/em size and a family).`)};exports.convertGraphConfigTheme=v;
@@ -1,3 +1,5 @@
1
+ import { FontLength } from '@graphysdk/viz-engine/graph-config';
2
+ import { FontStyle } from '@graphysdk/viz-engine/graph-config';
1
3
  import { GraphConfig } from '@graphysdk/viz-engine/graph-config';
2
4
 
3
5
  /**
@@ -10,26 +12,12 @@ import { GraphConfig } from '@graphysdk/viz-engine/graph-config';
10
12
  */
11
13
  export declare const convertGraphConfigTheme: (config: GraphConfig, fontList?: FontListInput) => ThemeOverrides;
12
14
 
13
- declare const FONT_STYLES: readonly ["normal", "italic", "oblique"];
14
-
15
- /**
16
- * A CSS length keeping its unit so measurement can treat it like CSS paint does: em scales with
17
- * `textScale` (see `emToPx`), px stays absolute.
18
- */
19
- declare interface FontLength {
20
- value: number;
21
- unit: 'px' | 'em';
22
- }
23
-
24
15
  /** Host font catalog mapping each font id a `GraphConfig` may reference to a CSS `font-family` string. */
25
16
  export declare type FontListInput = Array<{
26
17
  id: string;
27
18
  fontFamily: string;
28
19
  }>;
29
20
 
30
- /** A CSS `font-style` keyword accepted by a measured font token override. */
31
- declare type FontStyle = (typeof FONT_STYLES)[number];
32
-
33
21
  /**
34
22
  * A structured override of a measured font token. Omitted fields keep the token's default (which
35
23
  * still cascades from the leaf tokens, e.g. `fontSizeXs`), so `{ weight: 600 }` changes only the
@@ -49,7 +37,7 @@ declare interface FontTokenOverride {
49
37
  * ({@link FontTokenOverride}); the CSS variable's shorthand is serialized from the same object
50
38
  * measurement reads, so paint and layout move together.
51
39
  */
52
- declare type MeasuredFontTokenKey = 'fontDataLabel' | 'fontStackTotal' | 'fontCategoryLabel' | 'fontTickLabel' | 'fontAxisLabel' | 'fontLegendLabel' | 'fontGoalLineLabel';
40
+ declare type MeasuredFontTokenKey = 'fontLegendLabel';
53
41
 
54
42
  /**
55
43
  * A partial set of token values layered over a base theme — the shape of the `themeOverrides`
@@ -123,22 +111,13 @@ declare const vars: {
123
111
  trendPositiveColor: `var(--${string})`;
124
112
  trendNeutralColor: `var(--${string})`;
125
113
  defaultAnnotationArrowStroke: `var(--${string})`;
126
- defaultAnnotationShapeStroke: `var(--${string})`;
127
114
  defaultAnnotationShapeFill: `var(--${string})`;
128
115
  arrowAnnotationStickerOutlineColor: `var(--${string})`;
129
116
  arrowAnnotationStickerOutlineColorInverse: `var(--${string})`;
130
117
  annotationFrameBorderColor: `var(--${string})`;
131
118
  editMenuTriggerIconColor: `var(--${string})`;
132
119
  heatmapEmptyTileBackground: `var(--${string})`;
133
- dataLabelOutsideBackground: `var(--${string})`;
134
- dataLabelTextColor: `var(--${string})`;
135
- dataLabelInsideTextColor: `var(--${string})`;
136
- stackTotalTextColor: `var(--${string})`;
137
- stackTotalBackground: `var(--${string})`;
138
- stackTotalStroke: `var(--${string})`;
139
120
  gridLineWidth: `var(--${string})`;
140
- gridLineDash: `var(--${string})`;
141
- gridLineDotted: `var(--${string})`;
142
121
  tooltipBorderRadius: `var(--${string})`;
143
122
  tooltipBorderWidth: `var(--${string})`;
144
123
  tooltipPaddingBlock: `var(--${string})`;
@@ -146,7 +125,6 @@ declare const vars: {
146
125
  tooltipRowGap: `var(--${string})`;
147
126
  tooltipShadow: `var(--${string})`;
148
127
  editorControlHeight: `var(--${string})`;
149
- tickLabelOffset: `var(--${string})`;
150
128
  legendItemGap: `var(--${string})`;
151
129
  legendSwatchGap: `var(--${string})`;
152
130
  legendSwatchWidth: `var(--${string})`;
@@ -227,11 +205,6 @@ declare const vars: {
227
205
  fontLineHeightHeadingSm: `var(--${string})`;
228
206
  fontLineHeightHeadingMd: `var(--${string})`;
229
207
  fontLineHeightHeadingLg: `var(--${string})`;
230
- fontTickLabel: `var(--${string})`;
231
- fontAxisLabel: `var(--${string})`;
232
- fontDataLabel: `var(--${string})`;
233
- fontStackTotal: `var(--${string})`;
234
- fontCategoryLabel: `var(--${string})`;
235
208
  fontLegendLabel: `var(--${string})`;
236
209
  fontSeriesLabel: `var(--${string})`;
237
210
  fontTooltipLabel: `var(--${string})`;
@@ -245,7 +218,6 @@ declare const vars: {
245
218
  fontTooltipCaptionSmall: `var(--${string})`;
246
219
  fontTrendTag: `var(--${string})`;
247
220
  fontTrendTagSmall: `var(--${string})`;
248
- fontGoalLineLabel: `var(--${string})`;
249
221
  fontPieLabel: `var(--${string})`;
250
222
  fontPieChartTotal: `var(--${string})`;
251
223
  fontDifferenceArrowSmall: `var(--${string})`;
@@ -1,58 +1,32 @@
1
- import { i as v, n as h, p, r as m, t as g } from "./font-values-CPxYeqns.js";
2
- var w = (r, e) => {
3
- const n = r.appearance?.textStyle;
1
+ import { l as d } from "./typography-DUFp65Tx.js";
2
+ import { parseFontShorthand as s } from "@graphysdk/viz-engine/graph-config";
3
+ var p = (e, n) => {
4
+ const r = e.appearance?.textStyle;
4
5
  return {
5
- ...b(r.themeOverrides),
6
- ...e && n ? F(n, e) : void 0
6
+ ...f(e.themeOverrides),
7
+ ...n && r ? v(r, n) : void 0
7
8
  };
8
- }, y = (r) => {
9
- const e = r.trim().replace(/\s*\/\s*/g, "/").split(/\s+/);
10
- let n = "normal", i = 400, t = 0;
11
- for (; t < e.length; ) {
12
- const s = e[t];
13
- if (s === void 0) return null;
14
- if (s === "normal") t++;
15
- else if (g(s))
16
- n = s, t++;
17
- else {
18
- const u = m(s);
19
- if (u === null) break;
20
- i = u, t++;
21
- }
22
- }
23
- const o = e[t];
24
- if (o === void 0) return null;
25
- const [a = "", l] = o.split("/"), d = h(a);
26
- if (d === null) return null;
27
- const c = l === void 0 ? null : v(l), f = e.slice(t + 1).join(" ").trim();
28
- return f === "" ? null : {
29
- style: n,
30
- weight: i,
31
- size: d,
32
- family: f,
33
- ...c !== null ? { lineHeight: c } : {}
34
- };
35
- }, F = (r, e) => {
36
- const n = (o) => o === void 0 ? void 0 : e.find((a) => a.id === o)?.fontFamily, i = n(r.body?.fontId), t = n(r.heading?.fontId);
9
+ }, v = (e, n) => {
10
+ const r = (a) => a === void 0 ? void 0 : n.find((i) => i.id === a)?.fontFamily, o = r(e.body?.fontId), t = r(e.heading?.fontId);
37
11
  return {
38
- ...i ? { fontFamilyDefault: i } : void 0,
12
+ ...o ? { fontFamilyDefault: o } : void 0,
39
13
  ...t ? { fontFamilyHeading: t } : void 0
40
14
  };
41
- }, b = (r) => {
42
- if (r === void 0) return;
43
- const e = {};
44
- for (const [n, i] of Object.entries(r)) if (p(n) && typeof i == "string") {
45
- const t = y(i);
15
+ }, f = (e) => {
16
+ if (e === void 0) return;
17
+ const n = {};
18
+ for (const [r, o] of Object.entries(e)) if (d(r) && typeof o == "string") {
19
+ const t = s(o);
46
20
  if (t === null) {
47
- k(n, i);
21
+ l(r, o);
48
22
  continue;
49
23
  }
50
- e[n] = t;
51
- } else e[n] = i;
52
- return e;
53
- }, k = (r, e) => {
54
- process.env.NODE_ENV !== "production" && console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${r}": "${e}" is not a measurable font shorthand (needs a px/em size and a family).`);
24
+ n[r] = t;
25
+ } else n[r] = o;
26
+ return n;
27
+ }, l = (e, n) => {
28
+ process.env.NODE_ENV !== "production" && console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${e}": "${n}" is not a measurable font shorthand (needs a px/em size and a family).`);
55
29
  };
56
30
  export {
57
- w as convertGraphConfigTheme
31
+ p as convertGraphConfigTheme
58
32
  };