@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.
- package/README.md +12 -15
- package/dist/editable.cjs +1 -1
- package/dist/editable.css +1 -1
- package/dist/editable.d.ts +239 -63
- package/dist/editable.mjs +3593 -2351
- package/dist/graph-config.cjs +1 -1
- package/dist/graph-config.d.ts +3 -31
- package/dist/graph-config.mjs +21 -47
- package/dist/{history-chords-DAPEqcWx.js → history-chords-BDa-CeNm.js} +3374 -3095
- package/dist/history-chords-BIarPFDp.cjs +1 -0
- package/dist/history-chords.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +30 -45
- package/dist/index.mjs +77 -77
- package/dist/typography-CsG_IWDd.cjs +2 -0
- package/dist/{font-values-CPxYeqns.js → typography-DUFp65Tx.js} +112 -191
- package/licenses/PolyForm-Free-Trial-1.0.0.md +93 -0
- package/licenses/PolyForm-NonCommercial-1.0.0.md +131 -0
- package/licenses/PolyForm-Small-Business-1.0.0.md +121 -0
- package/package.json +10 -2
- package/dist/font-values-CStAZ2d1.cjs +0 -2
- package/dist/history-chords-DFlFEtc_.cjs +0 -1
- /package/dist/{font-values.css → typography.css} +0 -0
package/dist/graph-config.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
package/dist/graph-config.d.ts
CHANGED
|
@@ -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 = '
|
|
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})`;
|
package/dist/graph-config.mjs
CHANGED
|
@@ -1,58 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
...
|
|
6
|
-
...
|
|
6
|
+
...f(e.themeOverrides),
|
|
7
|
+
...n && r ? v(r, n) : void 0
|
|
7
8
|
};
|
|
8
|
-
},
|
|
9
|
-
const
|
|
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
|
-
...
|
|
12
|
+
...o ? { fontFamilyDefault: o } : void 0,
|
|
39
13
|
...t ? { fontFamilyHeading: t } : void 0
|
|
40
14
|
};
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
for (const [
|
|
45
|
-
const t =
|
|
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
|
-
|
|
21
|
+
l(r, o);
|
|
48
22
|
continue;
|
|
49
23
|
}
|
|
50
|
-
|
|
51
|
-
} else
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
process.env.NODE_ENV !== "production" && console.warn(`[react-renderer] Ignoring GraphConfig themeOverrides."${
|
|
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
|
-
|
|
31
|
+
p as convertGraphConfigTheme
|
|
58
32
|
};
|