@graphysdk/react-renderer 1.8.1-beta.1787250384040 → 1.8.1-beta.1787251516424
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.cjs +1 -1
- package/dist/editable.mjs +1056 -1056
- package/dist/{history-chords-NhthC5su.cjs → history-chords-D9fvuYBP.cjs} +1 -1
- package/dist/{history-chords-CqIMQQEg.js → history-chords-pHvwvxRI.js} +9 -11
- package/dist/history-chords.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +44 -44
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as It, D as _t, Dt as ae, Et as kt, G as Dt, O as $t, Ot as te, Q as Ht, T as xt, Tt as Mt, W as Pt, X as Lt, _t as ce, a as Kt, bt as Ot, ct as Bt, dt as K, ft as le, gt as At, ht as de, i as Yt, it as jt, lt as Ft, m as Ut, mt as A, n as Wt, pt as Vt, r as Xt, rt as Qt, s as zt, t as ue, vt as Jt, w as Zt, yt as er } from "./history-chords-pHvwvxRI.js";
|
|
2
2
|
import { m as rr, t as me } from "./dev.utils-CrfRPKW8.js";
|
|
3
3
|
import { COMPILER_STAGE_KEYS as Y, Geom as ge, GraphCompilationSession as he, areEditTargetsEqual as pe, buildDiagnostic as W, createAnchorResolver as fe, createCompiler as ve, createGraphyBuilder as ye, findAnnotation as be, isCompilerCachingEnabled as Se, resolveDefinition as Ee, setCompilerCachingEnabled as Te } from "@graphysdk/viz-engine";
|
|
4
4
|
import { Component as Ce, useCallback as f, useEffect as $, useId as Ne, useImperativeHandle as Re, useMemo as P, useRef as V, useState as T, useSyncExternalStore as qe } from "react";
|
|
5
5
|
import { Fragment as Ge, jsx as c, jsxs as v } from "react/jsx-runtime";
|
|
6
6
|
import { useStore as X } from "zustand";
|
|
7
7
|
import { createStore as j } from "zustand/vanilla";
|
|
8
|
-
import
|
|
8
|
+
import we from "clsx";
|
|
9
9
|
import './index.css';function B(e) {
|
|
10
10
|
for (const t of e) (t.severity === "error" ? console.error : console.warn)(`[graphy] ${t.code}: ${t.message}`, t);
|
|
11
11
|
}
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var Ie = "_1a5iqpb0", _e = "_1a5iqpb1";
|
|
13
|
+
var ke = "_1a5iqpb3", De = "_1a5iqpb4", $e = "_1a5iqpb5";
|
|
14
14
|
var Q = ({ errors: e }) => {
|
|
15
15
|
const [t, ...r] = e;
|
|
16
16
|
return /* @__PURE__ */ v("div", {
|
|
17
17
|
role: "alert",
|
|
18
|
-
className:
|
|
18
|
+
className: Ie,
|
|
19
19
|
children: [
|
|
20
20
|
/* @__PURE__ */ c("strong", {
|
|
21
|
-
className:
|
|
21
|
+
className: _e,
|
|
22
22
|
children: "This chart could not be rendered."
|
|
23
23
|
}),
|
|
24
24
|
t && /* @__PURE__ */ c(z, { diagnostic: t }),
|
|
@@ -29,7 +29,7 @@ var Q = ({ errors: e }) => {
|
|
|
29
29
|
]
|
|
30
30
|
});
|
|
31
31
|
}, z = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
|
|
32
|
-
className:
|
|
32
|
+
className: ke,
|
|
33
33
|
children: [
|
|
34
34
|
/* @__PURE__ */ c("span", {
|
|
35
35
|
className: De,
|
|
@@ -144,7 +144,7 @@ var xe = class extends Ce {
|
|
|
144
144
|
return [...e.slice(n), t];
|
|
145
145
|
};
|
|
146
146
|
function We(e) {
|
|
147
|
-
const t = e.filter(re), r = /* @__PURE__ */ new Set([...Object.keys(
|
|
147
|
+
const t = e.filter(re), r = /* @__PURE__ */ new Set([...Object.keys(de), ...t.map((a) => a.geom)]), n = [], o = /* @__PURE__ */ new Set();
|
|
148
148
|
for (const a of e) {
|
|
149
149
|
const d = Me(a);
|
|
150
150
|
d === null || r.has(d.type) || o.has(d.type) || (o.add(d.type), n.push({
|
|
@@ -298,7 +298,7 @@ var et = (e) => j((t) => ({
|
|
|
298
298
|
compiled: e,
|
|
299
299
|
setCompiled: (r) => t((n) => n.compiled === r ? n : { compiled: r })
|
|
300
300
|
})), tt = ({ input: e, data: t, customPalettes: r, plugins: n, resolveRenderer: o, anchorResolver: l, onChange: i, onError: a, onWarnings: d }) => {
|
|
301
|
-
const m = K(i), q = K(a),
|
|
301
|
+
const m = K(i), q = K(a), _ = K(d), [{ session: g, compileBus: b }] = T(() => {
|
|
302
302
|
const s = ve({ plugins: n });
|
|
303
303
|
return {
|
|
304
304
|
session: new he(s),
|
|
@@ -312,7 +312,7 @@ var et = (e) => j((t) => ({
|
|
|
312
312
|
p.subscribe(y.notify), C.current = p, y.notify();
|
|
313
313
|
}
|
|
314
314
|
return null;
|
|
315
|
-
}, [y]), [H,
|
|
315
|
+
}, [y]), [H, k] = T(() => {
|
|
316
316
|
const s = g.compile({
|
|
317
317
|
input: e,
|
|
318
318
|
data: t,
|
|
@@ -327,17 +327,17 @@ var et = (e) => j((t) => ({
|
|
|
327
327
|
...ze(s.compiled, o),
|
|
328
328
|
...Ze(s.compiled, o),
|
|
329
329
|
...Je(s.compiled, l)
|
|
330
|
-
] : s.warnings, [o, l]),
|
|
330
|
+
] : s.warnings, [o, l]), w = f((s) => {
|
|
331
331
|
s.length !== 0 && (B(s), q.current?.(s));
|
|
332
332
|
}, [q]), S = f((s) => {
|
|
333
|
-
s.length !== 0 && (B(s),
|
|
334
|
-
}, [
|
|
333
|
+
s.length !== 0 && (B(s), _.current?.(s));
|
|
334
|
+
}, [_]);
|
|
335
335
|
$(() => {
|
|
336
336
|
const s = h.current;
|
|
337
|
-
s && (
|
|
337
|
+
s && (w([...u.errors, ...s.ok ? [] : s.errors]), S([...u.warnings, ...R(s)]), s.ok && b.emit({ kind: "init" }));
|
|
338
338
|
}, [
|
|
339
339
|
b,
|
|
340
|
-
|
|
340
|
+
w,
|
|
341
341
|
S,
|
|
342
342
|
u,
|
|
343
343
|
R
|
|
@@ -350,7 +350,7 @@ var et = (e) => j((t) => ({
|
|
|
350
350
|
if (!s) return;
|
|
351
351
|
s.sealedInput && m.current?.(s.sealedInput);
|
|
352
352
|
const p = N(s.result);
|
|
353
|
-
|
|
353
|
+
k(G(p)), p && w(p), S(R(s.result)), p || b.emit({ kind: s.inputChanged ? "input" : "data" });
|
|
354
354
|
}, [
|
|
355
355
|
e,
|
|
356
356
|
t,
|
|
@@ -358,32 +358,32 @@ var et = (e) => j((t) => ({
|
|
|
358
358
|
g,
|
|
359
359
|
b,
|
|
360
360
|
N,
|
|
361
|
-
|
|
361
|
+
w,
|
|
362
362
|
S,
|
|
363
363
|
G,
|
|
364
364
|
R,
|
|
365
365
|
m
|
|
366
366
|
]);
|
|
367
367
|
const D = f((s) => {
|
|
368
|
-
|
|
368
|
+
k((p) => p === null ? p : G(null)), S(R(s));
|
|
369
369
|
}, [
|
|
370
370
|
G,
|
|
371
371
|
S,
|
|
372
372
|
R
|
|
373
|
-
]),
|
|
373
|
+
]), I = f((s) => {
|
|
374
374
|
s.compiled && C.current?.getState().setCompiled(s.compiled), s.result && D(s.result), s.command && b.emit({
|
|
375
375
|
kind: "command",
|
|
376
376
|
command: s.command
|
|
377
|
-
}), s.input && m.current?.(s.input), s.errors &&
|
|
377
|
+
}), s.input && m.current?.(s.input), s.errors && w([...s.errors]);
|
|
378
378
|
}, [
|
|
379
379
|
D,
|
|
380
380
|
b,
|
|
381
381
|
m,
|
|
382
|
-
|
|
382
|
+
w
|
|
383
383
|
]), E = f((s) => {
|
|
384
|
-
for (const p of s)
|
|
384
|
+
for (const p of s) I(p);
|
|
385
385
|
return s.some((p) => !!p.compiled);
|
|
386
|
-
}, [
|
|
386
|
+
}, [I]), x = f((s, p) => {
|
|
387
387
|
E(g.applyCommand(s, p));
|
|
388
388
|
}, [g, E]), L = f(() => {
|
|
389
389
|
E(g.seal());
|
|
@@ -414,8 +414,8 @@ var et = (e) => j((t) => ({
|
|
|
414
414
|
}),
|
|
415
415
|
notify: () => e.forEach((t) => t())
|
|
416
416
|
};
|
|
417
|
-
}, nt = {}, st = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: l, onError: i, onWarnings: a, customPalettes: d, colorScheme: m = "light", themeOverrides: q = nt, children:
|
|
418
|
-
const [g] = T(() =>
|
|
417
|
+
}, nt = {}, st = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: l, onError: i, onWarnings: a, customPalettes: d, colorScheme: m = "light", themeOverrides: q = nt, children: _ }) => {
|
|
418
|
+
const [g] = T(() => le(r.filter(re))), b = Ne(), [u] = T(() => fe(r)), [h] = T(() => Ke()), { store: y, dispatch: C, seal: G, history: N, subscribe: H, getCompiled: k, compileBus: R, compileErrors: w } = tt({
|
|
419
419
|
input: t,
|
|
420
420
|
data: e,
|
|
421
421
|
customPalettes: d,
|
|
@@ -428,10 +428,10 @@ var et = (e) => j((t) => ({
|
|
|
428
428
|
});
|
|
429
429
|
$(() => {
|
|
430
430
|
if (y)
|
|
431
|
-
return y.subscribe((
|
|
432
|
-
if (
|
|
431
|
+
return y.subscribe((I, E) => {
|
|
432
|
+
if (I.compiled.spec === E.compiled.spec) return;
|
|
433
433
|
const { selection: x, setSelection: L } = h.getState();
|
|
434
|
-
x.length !== 0 && L(Pe(x,
|
|
434
|
+
x.length !== 0 && L(Pe(x, I.compiled.spec));
|
|
435
435
|
});
|
|
436
436
|
}, [y, h]);
|
|
437
437
|
const S = P(() => ({
|
|
@@ -443,15 +443,15 @@ var et = (e) => j((t) => ({
|
|
|
443
443
|
undo: N.undo,
|
|
444
444
|
redo: N.redo,
|
|
445
445
|
subscribe: H,
|
|
446
|
-
getCompiled:
|
|
446
|
+
getCompiled: k,
|
|
447
447
|
getSelection: () => h.getState().selection,
|
|
448
|
-
setSelection: (
|
|
448
|
+
setSelection: (I) => h.getState().setSelection(I),
|
|
449
449
|
subscribeSelection: h.subscribe
|
|
450
450
|
}), [
|
|
451
451
|
S,
|
|
452
452
|
N,
|
|
453
453
|
H,
|
|
454
|
-
|
|
454
|
+
k,
|
|
455
455
|
h
|
|
456
456
|
]);
|
|
457
457
|
const D = P(() => y ? {
|
|
@@ -478,14 +478,14 @@ var et = (e) => j((t) => ({
|
|
|
478
478
|
u
|
|
479
479
|
]);
|
|
480
480
|
return /* @__PURE__ */ c(xe, {
|
|
481
|
-
forcedErrors:
|
|
481
|
+
forcedErrors: w,
|
|
482
482
|
onError: i,
|
|
483
483
|
resetKeys: [t, e],
|
|
484
|
-
children: D ? /* @__PURE__ */ c(
|
|
484
|
+
children: D ? /* @__PURE__ */ c(ae.Provider, {
|
|
485
485
|
value: D,
|
|
486
|
-
children: /* @__PURE__ */ c(
|
|
486
|
+
children: /* @__PURE__ */ c(ce, {
|
|
487
487
|
value: g,
|
|
488
|
-
children:
|
|
488
|
+
children: _
|
|
489
489
|
})
|
|
490
490
|
}) : null
|
|
491
491
|
});
|
|
@@ -526,14 +526,14 @@ var yt = "drqe3uh", bt = "drqe3ui", Z = {
|
|
|
526
526
|
const { recordCompile: u } = o.getState(), h = n.getLastTrigger(), y = n.getLastCompile();
|
|
527
527
|
return h && y && u(h, y), n.subscribe(u);
|
|
528
528
|
}, [o, n]);
|
|
529
|
-
const m = X(o, (u) => u.lastCompile), q = X(o, (u) => u.history),
|
|
529
|
+
const m = X(o, (u) => u.lastCompile), q = X(o, (u) => u.history), _ = n.getCacheStats(), g = m === null && q.length === 0, b = () => {
|
|
530
530
|
d((u) => {
|
|
531
531
|
const h = !u;
|
|
532
532
|
return Te(h), h;
|
|
533
533
|
});
|
|
534
534
|
};
|
|
535
535
|
return /* @__PURE__ */ v("div", {
|
|
536
|
-
className:
|
|
536
|
+
className: we(gt, r),
|
|
537
537
|
style: {
|
|
538
538
|
width: e,
|
|
539
539
|
...t
|
|
@@ -569,7 +569,7 @@ var yt = "drqe3uh", bt = "drqe3ui", Z = {
|
|
|
569
569
|
}),
|
|
570
570
|
!l && !g && /* @__PURE__ */ v(Ge, { children: [/* @__PURE__ */ c(St, {
|
|
571
571
|
delta: m?.stages,
|
|
572
|
-
cumulative:
|
|
572
|
+
cumulative: _
|
|
573
573
|
}), /* @__PURE__ */ c(Et, { entries: q })] })
|
|
574
574
|
]
|
|
575
575
|
});
|
|
@@ -712,9 +712,9 @@ var yt = "drqe3uh", bt = "drqe3ui", Z = {
|
|
|
712
712
|
]);
|
|
713
713
|
}, Rt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, qt = (e) => "key" in e, Gt = (e) => e instanceof HTMLInputElement ? !Nt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
|
|
714
714
|
export {
|
|
715
|
-
|
|
715
|
+
_t as BrandMark,
|
|
716
716
|
Ot as CanvasTextMeasurer,
|
|
717
|
-
|
|
717
|
+
xt as DefaultFooter,
|
|
718
718
|
zt as DefaultGrid,
|
|
719
719
|
Zt as DefaultHeader,
|
|
720
720
|
At as DefaultSwatch,
|
|
@@ -729,13 +729,13 @@ export {
|
|
|
729
729
|
Lt as ThemeProvider,
|
|
730
730
|
dr as UnitSpaceSvg,
|
|
731
731
|
lr as createGraphyKit,
|
|
732
|
-
|
|
732
|
+
Ht as darkTheme,
|
|
733
733
|
Vt as defineGeomRenderer,
|
|
734
|
-
|
|
735
|
-
|
|
734
|
+
It as lightTheme,
|
|
735
|
+
Mt as lightenCss,
|
|
736
736
|
Pe as pruneSelection,
|
|
737
737
|
$t as resolveBrandMarkVisual,
|
|
738
|
-
|
|
738
|
+
kt as useCompiledSelector,
|
|
739
739
|
jt as useElementScreenRect,
|
|
740
740
|
Bt as useGeomHitTest,
|
|
741
741
|
Qt as useGeomHover,
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"visualization",
|
|
12
12
|
"renderer"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.8.1-beta.
|
|
14
|
+
"version": "1.8.1-beta.1787251516424",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"**/*.css.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react-colorful": "^5.6.1",
|
|
56
56
|
"react-intl": "^8.1.3",
|
|
57
57
|
"zustand": "^5.0.12",
|
|
58
|
-
"@graphysdk/viz-engine": "1.8.1-beta.
|
|
58
|
+
"@graphysdk/viz-engine": "1.8.1-beta.1787251516424"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@tiptap/core": "^3.0.0",
|