@graphysdk/react-renderer 1.9.0-beta.1791459323341 → 1.9.0-beta.1791462722746

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.
@@ -5,7 +5,6 @@ import { CoordSystem } from '@graphysdk/viz-engine';
5
5
  import { DispatchOptions } from '@graphysdk/viz-engine';
6
6
  import { Edge } from '@graphysdk/viz-engine';
7
7
  import { EdgeSizes } from '@graphysdk/viz-engine';
8
- import { EditorPanel } from './editable/panel/editor-panel';
9
8
  import { EditTarget } from '@graphysdk/viz-engine';
10
9
  import { FormattedAxis } from '@graphysdk/viz-engine';
11
10
  import { FormattedHeadline } from '@graphysdk/viz-engine';
@@ -16,9 +15,6 @@ import { IntroStaggerOrder } from '@graphysdk/viz-engine';
16
15
  import { JSX } from 'react/jsx-runtime';
17
16
  import { LegendPosition } from '@graphysdk/viz-engine';
18
17
  import { LineType } from '@graphysdk/viz-engine';
19
- import { PANEL_ROOT_ATTRIBUTE } from './editable/panel/editor-panel';
20
- import { PanelRootProps } from './editable/panel/editor-panel';
21
- import { PanelRootProps as PanelRootProps_2 } from '../panel/editor-panel';
22
18
  import { ReactElement } from 'react';
23
19
  import { ReactNode } from 'react';
24
20
  import { Rect } from '@graphysdk/viz-engine';
@@ -626,7 +622,17 @@ declare type DotNotation<T> = T extends object ? {
626
622
  */
627
623
  export declare const EditableGraphRenderer: ({ slots, mode, ...rest }: GraphRendererProps) => JSX.Element;
628
624
 
629
- export { EditorPanel }
625
+ /**
626
+ * The chart editing panel. A host composes it from the parts hung off this namespace rather than
627
+ * receiving a finished panel, so it can drop, reorder or interleave its own.
628
+ */
629
+ export declare const EditorPanel: {
630
+ Root: ({ handle, children, controls, defaultExpandedSection, className }: PanelRootProps) => JSX.Element;
631
+ Controls: {
632
+ List: ({ children }: ListProps) => JSX.Element;
633
+ Grid: ({ children }: GridProps) => JSX.Element;
634
+ };
635
+ };
630
636
 
631
637
  /** Props the renderer passes to the editor layer filling the `EditorSurface` slot. */
632
638
  declare interface EditorSurfaceSlotProps {
@@ -952,6 +958,11 @@ declare interface GraphSlots {
952
958
  */
953
959
  export declare const GraphTypeSection: ({ title, layout, preview }: OverridableSectionProps) => JSX.Element | null;
954
960
 
961
+ declare interface GridProps {
962
+ /** Controls, laid out two per row. */
963
+ children: ReactNode;
964
+ }
965
+
955
966
  /**
956
967
  * Visibility switches per direction, since a chart often wants horizontal rules and no vertical ones.
957
968
  * Style and thickness stay shared: two directions styled apart read as two grids rather than one.
@@ -1080,6 +1091,10 @@ declare interface LegendSlotProps {
1080
1091
  */
1081
1092
  export declare const LineSection: ({ title, layout, preview }: OverridableSectionProps) => JSX.Element | null;
1082
1093
 
1094
+ declare interface ListProps {
1095
+ children: ReactNode;
1096
+ }
1097
+
1083
1098
  declare type LocaleShape = {
1084
1099
  dir?: TextDirection;
1085
1100
  } & Dictionary<typeof EN_GB>;
@@ -1143,14 +1158,18 @@ export declare type OverridableSectionProps = Partial<Pick<SectionProps, 'title'
1143
1158
 
1144
1159
  declare type OverridePhrase<Phrases, Key extends string> = DeepValue<Phrases, Key> extends PhraseFn<infer P> ? PhraseFn<P> | string : string;
1145
1160
 
1146
- export { PANEL_ROOT_ATTRIBUTE }
1161
+ /**
1162
+ * Marks the panel root in the DOM. Hosts use it to scope their own styles; the react-renderer build
1163
+ * uses it to prove panel markup never reaches the read-only entry.
1164
+ */
1165
+ export declare const PANEL_ROOT_ATTRIBUTE = "data-graphy-editor-panel";
1147
1166
 
1148
1167
  declare interface PanelExpansion {
1149
1168
  expandSection: (title: string) => void;
1150
1169
  collapseAllSections: () => void;
1151
1170
  }
1152
1171
 
1153
- declare interface PanelProps extends Omit<PanelRootProps_2, 'children'> {
1172
+ declare interface PanelProps extends Omit<PanelRootProps, 'children'> {
1154
1173
  /**
1155
1174
  * Replaces the sections entirely. A panel is a convenience over composing them by hand, so the
1156
1175
  * escape hatch is the composition it saves you writing rather than a set of flags on top of it.
@@ -1158,7 +1177,28 @@ declare interface PanelProps extends Omit<PanelRootProps_2, 'children'> {
1158
1177
  children?: ReactNode;
1159
1178
  }
1160
1179
 
1161
- export { PanelRootProps }
1180
+ /** What every ready-made panel forwards, so a panel is a section list over the same root. */
1181
+ export declare interface PanelRootProps {
1182
+ /**
1183
+ * The graph this panel edits. Omit it to edit the `<GraphProvider>` the panel sits inside;
1184
+ * retarget the panel by passing a different handle.
1185
+ */
1186
+ handle?: GraphHandle;
1187
+ /**
1188
+ * The sections to show, in order. Passing them rather than having the panel choose is what lets a
1189
+ * host drop a section, reorder them, or slot one of its own between two of ours.
1190
+ */
1191
+ children: ReactNode;
1192
+ /**
1193
+ * Replacements for individual leaf controls, for this editor panel alone. Omitted members keep the ones
1194
+ * above it, a `ControlRegistryProvider`'s or ours, so a host adopts its own design system one control at a
1195
+ * time rather than all at once.
1196
+ */
1197
+ controls?: ControlRegistry;
1198
+ /** Title of the section open on first render. Omit to start with all of them closed. */
1199
+ defaultExpandedSection?: string;
1200
+ className?: string;
1201
+ }
1162
1202
 
1163
1203
  declare type PhraseFn<P extends Record<string, unknown> = Record<string, unknown>> = (params: P) => string;
1164
1204
 
package/dist/editable.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as $r, $t as Wr, At as ee, Bt as Ur, C as yi, Ct as Si, D as Ci, E as xi, Et as ue, F as wi, G as $, H as Ti, I as A, J as Ai, Jt as ki, K as Li, Mt as Pi, N as Ii, O as Kr, P as Ei, Q as dn, S as Oi, T as Le, Tt as Mi, U as Ni, Ut as Ri, W as Z, X as U, Xt as qr, Y as Di, Yt as _i, Z as un, Zt as Fi, _ as Me, _t as zi, b as Xr, bn as Bi, c as jr, ct as Hi, d as Gi, dt as ie, en as Zr, et as hn, f as Vi, fn as Yr, g as Jr, gn as R, gt as $i, h as pn, i as Wi, it as Qr, jt as Ui, k as yt, kt as Xe, l as Ki, ln as qi, lt as _n, m as Xi, mn as q, n as le, nn as mn, nt as ji, o as Zi, on as Yi, ot as Ji, p as ea, pt as St, q as Fn, qt as Qi, r as K, rn as He, rt as ta, sn as el, st as tl, t as nl, tn as ce, tt as Ct, u as rl, ut as al, v as ol, vn as z, vt as P, wt as il, x as ll, xt as Ne, y as sl, yt as cl, z as dl, zt as ul } from "./history-chords-CDlWUzvz.js";
1
+ import { $ as $r, $t as Wr, At as ee, Bt as Ur, C as yi, Ct as Si, D as Ci, E as xi, Et as ue, F as wi, G as $, H as Ti, I as A, J as Ai, Jt as ki, K as Li, Mt as Pi, N as Ii, O as Kr, P as Ei, Q as dn, S as Oi, T as Le, Tt as Mi, U as Ni, Ut as Ri, W as Z, X as U, Xt as qr, Y as Di, Yt as _i, Z as un, Zt as Fi, _ as Me, _t as zi, b as Xr, bn as Bi, c as jr, ct as Hi, d as Gi, dt as ie, en as Zr, et as hn, f as Vi, fn as Yr, g as Jr, gn as R, gt as $i, h as pn, i as Wi, it as Qr, jt as Ui, k as yt, kt as Xe, l as Ki, ln as qi, lt as _n, m as Xi, mn as q, n as le, nn as mn, nt as ji, o as Zi, on as Yi, ot as Ji, p as ea, pt as St, q as Fn, qt as Qi, r as K, rn as He, rt as ta, sn as el, st as tl, t as nl, tn as ce, tt as Ct, u as rl, ut as al, v as ol, vn as z, vt as P, wt as il, x as ll, xt as Ne, y as sl, yt as cl, z as dl, zt as ul } from "./history-chords-BC3MDlXg.js";
2
2
  import { ARROW_DEFAULTS as hl, ARROW_STICKER_DECLARATIONS as pl, ARROW_STROKE_WIDTHS_PX as Ft, AddAnnotationCommand as we, AddHighlightCommand as ml, BORDER_RADIUS_TOKENS as zn, COMBO_TYPES as Bn, CONSTANT_VARIABLES as gl, DASH_PRESETS as vl, DEFAULT_BAR_CORNER_RADIUS as fl, DEFAULT_GEOM_COLOR as bl, DEFAULT_POINT_SIZE_PX as yl, DEFAULT_STROKE_WIDTH_PX as Sl, DIFFERENCE_ARROW_DEFAULTS as na, DIFFERENCE_ARROW_SIZE_DECLARATIONS as Hn, InternalError as Cl, MAX_BAR_WIDTH_FRACTION as xl, MIN_BAR_WIDTH_FRACTION as wl, MoveAnnotationCommand as Tl, RESTING_HOVER_STATE as gn, RemoveAnnotationCommand as $e, RemoveHighlightCommand as Al, SHAPE_DEFAULTS as kl, SequenceCommand as Ll, SetAxisLabelCommand as Pl, SetAxisPositionCommand as Il, SetAxisTickModeCommand as El, SetAxisTicksVisibilityCommand as Ol, SetAxisVisibilityCommand as Ml, SetBarCornerRadiusCommand as Nl, SetBarWidthCommand as Rl, SetChartTypeCommand as ra, SetContentCaptionCommand as aa, SetContentSourceCommand as Dl, SetContentSubtitleCommand as oa, SetContentTitleCommand as ia, SetDataLabelsFormatCommand as la, SetDifferenceArrowStyleCommand as _l, SetGridLineStyleCommand as Fl, SetGridLineWidthCommand as zl, SetGridVisibilityCommand as Bl, SetHeadlineCompareWithCommand as Hl, SetHeadlinePositionCommand as Gl, SetHeadlineShowCommand as Gn, SetHeadlineSizeCommand as Vl, SetHighlightDimStyleCommand as $l, SetLayerYScaleTypeCommand as Wl, SetLegendAlignCommand as Ul, SetLegendDisplayCommand as Kl, SetLegendPlacementCommand as ql, SetLegendPositionCommand as Xl, SetLineCurveCommand as jl, SetLineMissingValuesCommand as Zl, SetLineWidthCommand as Vn, SetMappingCommand as Yl, SetNumberFormatAbbreviationCommand as Jl, SetNumberFormatDecimalsCommand as $n, SetObservationsColorCommand as Ql, SetPointSizeCommand as es, SetPolarInnerRadiusCommand as ts, SetPolarStartAngleCommand as ns, SetRuleLabelCommand as rs, SetRuleValueCommand as as, SetScaleDomainCommand as zt, SetScaleReverseCommand as os, SetScaleTransformCommand as is, SetStatLineCommand as ls, SetStyleRuleCommand as Ee, TEXT_ANNOTATION_DEFAULTS as ss, TEXT_ANNOTATION_FADE_ALPHA as cs, ToggleCategoryLabelsCommand as sa, ToggleContentVisibilityCommand as xt, ToggleDataLabelsCommand as ca, ToggleGoalLineCommand as ds, ToggleLineFillCommand as us, ToggleLinePointsCommand as hs, ToggleStackTotalsCommand as da, UpdateAnnotationCommand as he, alignUnitFractions as ps, areAnchorsEqual as ua, areEditTargetsEqual as ha, areEndpointsComparable as ms, buildEditMenuTriggerRegion as gs, buildLayerStyleAddress as vs, buildObservationPredicate as fs, buildObservationsTarget as wt, buildObservationsTargetAtValue as pa, canAnchorDirectLabels as bs, canBecomeCombo as ys, canBecomeHeatmap as Ss, clampAnnotationTranslation as Cs, combineKindStyleDeclarations as Wn, computeArrow as ma, createObservationAnchorBuilder as xs, createObservationAnchorParser as ws, createStyleResolver as Ts, createValueFormatter as ga, createXValueReader as As, filterLayersByGeoms as Ut, findAnnotation as ks, findAverageLineLayer as Ls, findAxisGuide as Ps, findCompanionLayers as va, findGoalLineLayer as Is, findHighlightsAtObservation as Es, findHostLayer as Os, findLayerByGeom as fa, findLayerById as ve, findObservationAttachment as Ms, findStyleRule as Ae, findTrendLineLayer as Ns, formatDifferenceLabel as Rs, getBoundingRect as Kt, getGroupVariables as Ds, getXBand as _s, getYBand as Fs, hasMainAxisBand as zs, hasMultipleGroups as Bs, inferDefaultDifferenceArrowEndpoints as Hs, inferDifferenceArrowEndpoints as Gs, isComboChartType as Ie, isCompanionLayer as ba, isObservationAttachmentKind as Vs, isPointWithinEditMenuTrigger as vn, isSafeUrl as $s, isZeroAnchoredAxis as Ws, measureObservationsBoxes as ya, projectAnchorToPanel as dt, readBroadestObservationsScope as Us, readChartType as Sa, readComboLineLayerId as Ks, readCompanionRowsAtScopeKey as qs, readConstantValue as Xs, readEditTargetKey as Tt, readGeomColor as js, readHighlightDimStyle as Zs, readMainAxis as Ys, readMappableAesthetics as Js, readMappedVariable as Qs, readObservationIndex as Ca, readObservationsColorRoute as ec, readPaletteChoices as tc, readPresentedObservationsColor as nc, readReachableLevels as rc, readRowScopeKey as ac, readRowsAtScopeKey as oc, readScopeXVariable as ic, readStyleCoord as Re, readStyleRulesBeneath as lc, readVariableName as At, resolveArrowAnnotationStyle as fn, resolveBarBandFraction as sc, resolveComparisonBasis as cc, resolveDifferenceArrowAnnotationStyle as dc, resolveEditOutlineStyle as uc, resolveObservationPoint as xa, resolveObservationsTarget as Un, stepDifferenceArrowEndpoint as hc, toDashPreset as qt, toPaintColor as ut, toPanelCursor as kt } from "@graphysdk/viz-engine";
3
3
  import { Fragment as pc, createContext as De, memo as wa, useCallback as ae, useContext as ye, useEffect as _, useId as ke, useLayoutEffect as Oe, useMemo as L, useRef as ne, useState as Q } from "react";
4
4
  import { Fragment as Y, jsx as r, jsxs as m } from "react/jsx-runtime";
@@ -7,6 +7,7 @@ import { useShallow as fe } from "zustand/react/shallow";
7
7
  import { assignInlineVars as Pe } from "@vanilla-extract/dynamic";
8
8
  import { createPortal as Ta } from "react-dom";
9
9
  import be from "clsx";
10
+ import { clamp as Ve } from "lodash-es";
10
11
  import { autoUpdate as gc, flip as vc, offset as fc, shift as bc, useFloating as yc } from "@floating-ui/react-dom";
11
12
  import { Extension as Aa } from "@tiptap/core";
12
13
  import { Bold as Sc } from "@tiptap/extension-bold";
@@ -35,7 +36,6 @@ import { Switch as qn } from "@base-ui/react/switch";
35
36
  import { Input as Dc } from "@base-ui/react/input";
36
37
  import { Menu as G } from "@base-ui/react/menu";
37
38
  import { Toggle as _c } from "@base-ui/react/toggle";
38
- import Ve from "lodash-es/clamp";
39
39
  import { Menu as Te } from "@base-ui/react";
40
40
  import { Accordion as Ue } from "@base-ui/react/accordion";
41
41
  import { Separator as Fc } from "@base-ui/react/separator";
@@ -9,7 +9,7 @@ import { assignInlineVars as _t } from "@vanilla-extract/dynamic";
9
9
  import { createStore as _r } from "zustand/vanilla";
10
10
  import { createPortal as Zo } from "react-dom";
11
11
  import bt, { clsx as Fe } from "clsx";
12
- import Ll from "lodash-es/merge";
12
+ import { merge as Ll } from "lodash-es";
13
13
  import { IntlProvider as Tl } from "react-intl";
14
14
  import { flip as Er, offset as Pr, shift as Rr, useFloating as $o } from "@floating-ui/react-dom";
15
15
  import { getContrast as Ml } from "color2k";
@@ -22,7 +22,7 @@ import './history-chords.css';var Gn = Object.defineProperty, Ol = (e, t) => {
22
22
  });
23
23
  return t || Gn(r, Symbol.toStringTag, { value: "Module" }), r;
24
24
  };
25
- typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "1.9.0-beta.1791459323341");
25
+ typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "1.9.0-beta.1791462722746");
26
26
  function Nl(e) {
27
27
  for (const t of e) (t.severity === "error" ? console.error : console.warn)(`[graphy] ${t.code}: ${t.message}`, t);
28
28
  }