@graphysdk/react-renderer 1.8.1-beta.1786626875304 → 1.8.1-beta.1786707936521

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-B_MGX5Fo.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-Bd5awt67.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`
@@ -130,15 +118,7 @@ declare const vars: {
130
118
  annotationFrameBorderColor: `var(--${string})`;
131
119
  editMenuTriggerIconColor: `var(--${string})`;
132
120
  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
121
  gridLineWidth: `var(--${string})`;
140
- gridLineDash: `var(--${string})`;
141
- gridLineDotted: `var(--${string})`;
142
122
  tooltipBorderRadius: `var(--${string})`;
143
123
  tooltipBorderWidth: `var(--${string})`;
144
124
  tooltipPaddingBlock: `var(--${string})`;
@@ -146,7 +126,6 @@ declare const vars: {
146
126
  tooltipRowGap: `var(--${string})`;
147
127
  tooltipShadow: `var(--${string})`;
148
128
  editorControlHeight: `var(--${string})`;
149
- tickLabelOffset: `var(--${string})`;
150
129
  legendItemGap: `var(--${string})`;
151
130
  legendSwatchGap: `var(--${string})`;
152
131
  legendSwatchWidth: `var(--${string})`;
@@ -227,11 +206,6 @@ declare const vars: {
227
206
  fontLineHeightHeadingSm: `var(--${string})`;
228
207
  fontLineHeightHeadingMd: `var(--${string})`;
229
208
  fontLineHeightHeadingLg: `var(--${string})`;
230
- fontTickLabel: `var(--${string})`;
231
- fontAxisLabel: `var(--${string})`;
232
- fontDataLabel: `var(--${string})`;
233
- fontStackTotal: `var(--${string})`;
234
- fontCategoryLabel: `var(--${string})`;
235
209
  fontLegendLabel: `var(--${string})`;
236
210
  fontSeriesLabel: `var(--${string})`;
237
211
  fontTooltipLabel: `var(--${string})`;
@@ -245,7 +219,6 @@ declare const vars: {
245
219
  fontTooltipCaptionSmall: `var(--${string})`;
246
220
  fontTrendTag: `var(--${string})`;
247
221
  fontTrendTagSmall: `var(--${string})`;
248
- fontGoalLineLabel: `var(--${string})`;
249
222
  fontPieLabel: `var(--${string})`;
250
223
  fontPieChartTotal: `var(--${string})`;
251
224
  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-BZDSyJGS.js";
2
- var w = (r, e) => {
3
- const n = r.appearance?.textStyle;
1
+ import { l as d } from "./typography-CiDZDGza.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
  };