@xenosystem/blocks 0.14.0 → 0.15.0

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.
@@ -933,6 +933,13 @@ interface XenoFieldToken {
933
933
  tokenName?: string;
934
934
  /** Whether this field accepts a token binding at all. */
935
935
  bindable?: boolean;
936
+ /**
937
+ * The token GROUP this field binds from (`color`, `number`, `shadow`, `typography` — the host's own
938
+ * vocabulary, matched against `XenoInspectorToken.group`). Absent = every token is offered. Until
939
+ * 2026-09-18 the link button bound the FIRST token in the host's list and offered no choice; now it
940
+ * opens a menu of the matching tokens plus Unbind and Create-from-value.
941
+ */
942
+ group?: string;
936
943
  }
937
944
  /** One field descriptor — `PanelConfigField` widened (spec §2). */
938
945
  interface XenoInspectorField {
@@ -964,6 +971,16 @@ interface XenoInspectorField {
964
971
  * (Canvas found it first, 2026-09-18: without it a list could only hold strings).
965
972
  */
966
973
  itemFields?: XenoInspectorField[];
974
+ /**
975
+ * Inside `itemFields` only: draw this sub-field for an item only when a sibling sub-field holds one
976
+ * of these values — `{ field: 'kind', in: ['drop-shadow', 'inner-shadow'] }` hides a shadow's colour
977
+ * and offset on a blur row. Raised by Canvas's Effects stack (2026-09-18): a list draws every
978
+ * sub-field for every item, and half of them were meaningless on half the rows.
979
+ */
980
+ when?: {
981
+ field: string;
982
+ in: XenoFieldValue[];
983
+ };
967
984
  /** For a structured `list`: the label drawn on each item row (e.g. `Fill`, `Shadow`). */
968
985
  itemLabel?: string;
969
986
  /** Axis labels for `vector` (e.g. `['X','Y']`). */
@@ -992,6 +1009,12 @@ interface XenoSectionAction {
992
1009
  icon?: string;
993
1010
  disabled?: boolean;
994
1011
  }
1012
+ /** An entry in a section's searchable grouped Add menu (engine's Add Component). */
1013
+ /** One item of a structured `list` (a field with `itemFields`). */
1014
+ interface XenoListItem {
1015
+ id: string;
1016
+ [subFieldId: string]: XenoFieldValue;
1017
+ }
995
1018
  interface XenoAddMenuItem {
996
1019
  id: string;
997
1020
  label: string;
@@ -1178,6 +1201,8 @@ declare function parseListFieldId(fieldId: string): {
1178
1201
  itemId: string;
1179
1202
  subId: string;
1180
1203
  } | null;
1204
+ /** Whether an item shows a sub-field: no `when`, or the named sibling holds one of the listed values. */
1205
+ declare function itemShowsSubField(sub: XenoInspectorField, item: XenoListItem): boolean;
1181
1206
  declare function findField(schema: XenoInspectorSchema, fieldId: string): XenoInspectorField | undefined;
1182
1207
  /** The section containing a field. */
1183
1208
  declare function findSectionOf(schema: XenoInspectorSchema, fieldId: string): XenoInspectorSection | undefined;
@@ -1636,6 +1661,13 @@ interface InspectorViewField {
1636
1661
  bound: boolean;
1637
1662
  tokenLabel?: string;
1638
1663
  tokenTitle?: string;
1664
+ /** The bindable tokens for this field (its group), then Unbind / Create — the link menu's items. */
1665
+ tokenItems: {
1666
+ id: string;
1667
+ label: string;
1668
+ group?: string;
1669
+ disabled?: boolean;
1670
+ }[];
1639
1671
  showKeyframes: boolean;
1640
1672
  animated: boolean;
1641
1673
  onKeyframe: boolean;
@@ -1735,10 +1767,16 @@ type InspectorUiIntent = {
1735
1767
  } | {
1736
1768
  kind: 'bindToken';
1737
1769
  fieldId: string;
1770
+ } | {
1771
+ kind: 'pickToken';
1772
+ fieldId: string;
1773
+ itemId: string;
1738
1774
  } | {
1739
1775
  kind: 'resetField';
1740
1776
  fieldId: string;
1741
1777
  };
1778
+ /** The link menu's items: the field's group of tokens (all, when it names none), then Unbind and Create-from-value. */
1779
+ declare function tokenItemsFor(field: XenoInspectorField, tokens: readonly XenoInspectorToken[], bound: boolean): InspectorViewField['tokenItems'];
1742
1780
  /** Derive the view state from the live controller — the runtime calls this on every draw. */
1743
1781
  declare function inspectorViewState(c: InspectorPanelController): InspectorViewState;
1744
1782
  /** Apply a `ui` intent to the controller — the runtime's half of the contract. */
@@ -7616,4 +7654,4 @@ declare function TreeIcon({ name, size }: {
7616
7654
  size?: number;
7617
7655
  }): ReactNode;
7618
7656
 
7619
- export { type BlendModeGroup, type BlendModeOption, type Box, BEHAVIOURS$6 as COLOR_BEHAVIOURS, COLOR_DECLARATION, COLOR_RUNTIME_UNITS, COLOR_SPACES, BEHAVIOURS$2 as COMMENTS_BEHAVIOURS, COMMENTS_DECLARATION, COMMENTS_PANEL_ID, COMMENTS_RUNTIME_UNITS, BEHAVIOURS$5 as CURVE_BEHAVIOURS, CURVE_DECLARATION, CURVE_PANEL_ID, CURVE_RUNTIME_UNITS, type ChannelId, ColorPanelController, type ColorPanelControllerOptions, type ColorPanelSerialized, ColorPanelView, type ColorPanelViewProps, type ColorSpace, type ColorStopSink, type ColorToken, type ColorUiIntent, type ColorViewState, CommentsController, type CommentsControllerOptions, type CommentsHostBridge, type CommentsPanelState, CommentsPanelView, type CommentsPanelViewProps, type CommentsRenderContext, type CommentsThreadView, type CommentsUiIntent, type CommentsViewMessage, type CommentsViewModel, type CommentsViewOptions, type CommentsViewReaction, type CommentsViewState, type CommentsViewThread, type ConnectRules, type ConnectVerdict, type CreateColorPanelOptions, type CreateCommentsPanelOptions, type CreateCurvePanelOptions, type CreateFindPanelOptions, type CreateHistoryPanelOptions, type CreateInspectorPanelOptions, type CreateLayersPanelOptions, type CreateNodeGraphPanelOptions, type CreateTreePanelOptions, type CreateViewportPanelOptions, CurveController, type CurveControllerOptions, type CurveDragKind, type CurveDragState, type CurveHostBridge, type CurvePanelState, CurvePanelView, type CurvePanelViewProps, type CurvePreview, type CurveRenderConfig, type CurveRenderContext, CurveSurface, type CurveUiIntent, type CurveViewModel, type CurveViewOptions, type CurveViewState, DEFAULT_BLEND_MODES, DEFAULT_CURVE_ZOOM, DEFAULT_GRAPH_ZOOM, DEFAULT_ICON_MAP, DEFAULT_ORIGINAL_LABEL, type DropInput, EASING_PRESETS, EDIT_SPACES, EMPTY_HISTORY, EMPTY_SCHEMA, EMPTY_TREE, EMPTY_TREE_SOURCE, BEHAVIOURS$3 as FIND_BEHAVIOURS, FIND_DECLARATION, FIND_PANEL_ID, FIND_RUNTIME_UNITS, FindController, type FindControllerOptions, type FindHostBridge, FindKeys, type FindPanelState, FindPanelView, type FindPanelViewProps, type FindRenderContext, type FindUiIntent, type FindViewGroup, type FindViewModel, type FindViewOptions, type FindViewRow, type FindViewState, type FlatRow, type FlattenOptions, GENERIC_ICON, GraphController, type GraphControllerOptions, type GraphDragKind, type GraphDragState, type GraphHostBridge, type GraphPanelState, type GraphPreview, type GraphRenderConfig, type GraphRenderContext, type GraphViewState, BEHAVIOURS$7 as HISTORY_BEHAVIOURS, HISTORY_DECLARATION, HISTORY_RUNTIME_UNITS, type HistoryKeyEvent, HistoryPanelController, type HistoryPanelControllerOptions, type HistoryPanelSerialized, HistoryPanelView, type HistoryPanelViewProps, type ProjectOptions as HistoryProjectOptions, type HistoryRow, type HistoryUiIntent, type HistoryViewRow, type HistoryViewState, type Hsl, type Hsv, IMPLEMENTED_TREE_MODES, BEHAVIOURS$8 as INSPECTOR_BEHAVIOURS, INSPECTOR_DECLARATION, INSPECTOR_RUNTIME_UNITS, type InspectorKeyEvent, InspectorPanelController, type InspectorPanelControllerOptions, type InspectorPanelSerialized, InspectorPanelView, type InspectorPanelViewProps, type ProjectOptions$1 as InspectorProjectOptions, type InspectorUiIntent, type InspectorViewField, type InspectorViewSection, type InspectorViewState, BEHAVIOURS$9 as LAYERS_BEHAVIOURS, LAYERS_DECLARATION, LAYERS_RUNTIME_UNITS, LAYER_COLUMNS, type LayerColumn, type LayersKeyEvent, LayersPanelController, type LayersPanelControllerOptions, type LayersPanelSerialized, LayersPanelView, type LayersPanelViewProps, type LayersUiIntent, type LayersViewRow, type LayersViewState, MIXED, BEHAVIOURS$1 as NODEGRAPH_BEHAVIOURS, NODEGRAPH_DECLARATION, NODEGRAPH_PANEL_ID, NODEGRAPH_RUNTIME_UNITS, NodeGraphPanelView, type NodeGraphPanelViewProps, NodeGraphSurface, type NodeGraphUiIntent, type NodeGraphViewModel, type NodeGraphViewOptions, type NumericConstraints, type OklchDisplay, type ParseResult, type ProjectedSection, type Rgba, SPACE_LABEL, type ScrubOptions, type SelectMods, BEHAVIOURS as TREE_BEHAVIOURS, TREE_DECLARATION, TREE_PANEL_ID, TREE_RUNTIME_UNITS, type TangentEdit, Thumbnail, type ThumbnailProps, TreeController, type TreeControllerOptions, type TreeHostBridge, TreeIcon, type TreeKeyEvent, type TreePanelState, TreePanelView, type TreePanelViewProps, type TreeRenderContext, type TreeRow, TreeScroller, type TreeUiIntent, type TreeViewAction, type TreeViewModel, type TreeViewOptions, type TreeViewRow, type TreeViewState, BEHAVIOURS$4 as VIEWPORT_BEHAVIOURS, VIEWPORT_DECLARATION, VIEWPORT_PANEL_ID, VIEWPORT_RUNTIME_UNITS, VIEWPORT_SLOTS, VIEW_STATE_OPS, ViewportController, type ViewportControllerOptions, type ViewportHostBridge, type ViewportPanelState, ViewportPanelView, type ViewportPanelViewProps, type ViewportRenderContext, ViewportSurface, type ViewportViewModel, type ViewportViewOptions, type ViewportViewState, type XenoAddMenuItem, type XenoAnchorState, type XenoColorValue, type XenoCommentAuthor, type XenoCommentFilter, type XenoCommentMessage, type XenoCommentOp, type XenoCommentReaction, type XenoCommentSort, type XenoCommentThread, type XenoCommitPolicy, type XenoContextMenuRequest, type XenoCurveChannel, type XenoCurveInterpolation, type XenoCurveKey, type XenoCurveKeyRef, type XenoCurveOp, type XenoCurvePoint, XenoCurveScale, type XenoCurveScaleGeometry, type XenoCurveScaleState, type XenoCurveSelection, type XenoCurveSet, type XenoCurveViewport, type XenoCurveZoom, type XenoEasingPreset, type XenoEdge, type XenoFieldAnim, type XenoFieldFocus, type XenoFieldOption, type XenoFieldToken, type XenoFieldType, type XenoFieldValue, type XenoFindMatch, type XenoFindNavigate, type XenoFindOptions, type XenoFindQuery, type XenoFindReplace, type XenoFindResults, type XenoFindStatus, type XenoGradient, type XenoGraph, type XenoGraphOp, XenoGraphScale, type XenoGraphScaleGeometry, type XenoGraphScaleState, type XenoGraphSelection, type XenoGraphViewport, type XenoGraphZoom, type XenoHistoryEntry, type XenoHistoryIntent, type XenoHistoryMemory, type XenoHistoryOrder, type XenoHistoryScope, type XenoHistorySnapshot, type XenoHistorySource, type XenoHistoryState, type XenoHistoryStatus, type XenoInspectorEdit, type XenoInspectorField, type XenoInspectorSchema, type XenoInspectorSection, type XenoInspectorTarget, type XenoInspectorToken, type XenoKeyframeKind, type XenoLayerAdornment, type XenoLayerCap, type XenoLayerKind, type XenoLayerNode, type XenoLayerOp, type XenoLayerTree, type XenoNavigateRequest, type XenoNode, XenoNodeIndex, type XenoPort, type XenoPortDirection, type XenoPortRef, type XenoSectionAction, type XenoTangent, type XenoTangentMode, type XenoTangentSide, type XenoThreadActivate, type XenoThumbnailRequest, type XenoThumbnailResponse, type XenoTreeAction, type XenoTreeBadge, type XenoTreeCaps, type XenoTreeChildState, type XenoTreeChildrenResponse, type XenoTreeError, type XenoTreeGlyph, type XenoTreeIcon, type XenoTreeInvalidate, type XenoTreeMode, type XenoTreeModifiers, type XenoTreeNode, type XenoTreeNodeKind, type XenoTreeOp, type XenoTreeReveal, type XenoTreeSource, type XenoTreeSourceKind, type XenoTreeSourceState, type XenoViewportClient, type XenoViewportKey, type XenoViewportPointer, type XenoViewportSlot, type XenoViewportStats, type XenoViewportSurface, allFields, allIds, anchorStateOf, appliedCount, applyColorUi, applyCommentsUi, applyCurveUi, applyFindUi, applyHistoryUi, applyInspectorUi, applyLayersUi, applyNodeGraphUi, applyPrecision, applyTangentDrag, applyTreeUi, ariaSliderProps, boxesIntersect, canConnect, canRedo, canUndo, childStateOf, clamp, clampAlpha, clampTangent, collectDescendants, colorManifest, colorPanel, colorRuntimeComponents, colorViewManifest, colorViewState, commentsManifest, commentsPanel, commentsViewManifest, commentsViewState, commitPolicyOf, componentsForSpace, computeSurfaceSize, constraintsOf, countIsMeaningful, createColorPanel, createCommentsPanel, createCurvePanel, createFindPanel, createHistoryPanel, createInspectorPanel, createLayersPanel, createNodeGraphPanel, createTreePanel, createViewportPanel, createsCycle, currentRowIndex, curveManifest, curvePanel, curveRuntimeComponents, curveViewManifest, curveViewState, defaultIconFor, displayOrder, distanceToEdge, easeAt, easingPreset, edgeBounds, edgeKey, edgePath, edgesToReplace, edgesTouching, evaluateChannel, fieldMatches, findField, findManifest, findPanel, findPort, findRuntimeComponents, findSectionOf, findViewManifest, findViewState, fitToBounds, fitValueRange, flattenVisible, focusOrder, formatAge, formatNumeric, getAncestors, graphBounds, groupMatches, hasCap, hasDraggableTangents, hasTreeCap, hexFromHsv, highlightSegments, historyManifest, historyPanel, historyRuntimeComponents, historyViewManifest, historyViewState, hslToRgb, hsvFromHex, hsvToRgb, inspectorManifest, inspectorPanel, inspectorRuntimeComponents, inspectorViewManifest, inspectorViewState, interpolateSegment, isAncestorOf, isAnimated, isCollapsed, isColorSpace, isContainer, isEmptyContainer, isFieldEditable, isFieldMixed, isJumpable, isKeyEditable, isLayerColumn, isMixedValue, isOrphaned, isTreeContainer, isValidHex, isViewStateOp, keyRefId, layersManifest, layersPanel, layersRuntimeComponents, layersViewManifest, layersViewState, liveEdges, makeColorValue, matchesFilter, messagesOf, mirrorTangent, nodeBounds, nodegraphManifest, nodegraphPanel, nodegraphRuntimeComponents, nodegraphViewManifest, nodegraphViewState, normalizeColorInput, normalizeHistoryState, normalizeKindKey, normalizeNumeric, normalizeRanges, normalizeSchema, normalizeTree, nudgeValue, oklchToRgb, parseCssColor, parseHexColor, parseListFieldId, parseNumeric, passesFilter, patternError, portHasRoom, portRefId, positionToValue, projectRows, projectSections, rangeBetween, resolveDropTarget, resolveIconName, rgbToHex, rgbToHsl, rgbToHsv, rgbToOklch, rgbaToCssHex, roundRgb, rowIndexOf, rowIndexOfEntry, safeAddColorStop, safeAddColorStops, sameKey, sampleChannel, scrubValue, segmentsAround, solveBezierT, sortThreads, surfaceChanged, tangentsForMode, tangentsToControlPoints, toViewportCoords, totalCount, treeManifest, treePanel, treeRuntimeComponents, treeViewManifest, treeViewState, usesLogScale, valueExtent, valueToPosition, valuesEqual, viewportManifest, viewportPanel, viewportRuntimeComponents, viewportViewManifest, viewportViewState, visibleEdges, walkTree, wheelZoomFactor, zoomAboutCursor, zoomTimeAboutCursor, zoomValueAboutCursor };
7657
+ export { type BlendModeGroup, type BlendModeOption, type Box, BEHAVIOURS$6 as COLOR_BEHAVIOURS, COLOR_DECLARATION, COLOR_RUNTIME_UNITS, COLOR_SPACES, BEHAVIOURS$2 as COMMENTS_BEHAVIOURS, COMMENTS_DECLARATION, COMMENTS_PANEL_ID, COMMENTS_RUNTIME_UNITS, BEHAVIOURS$5 as CURVE_BEHAVIOURS, CURVE_DECLARATION, CURVE_PANEL_ID, CURVE_RUNTIME_UNITS, type ChannelId, ColorPanelController, type ColorPanelControllerOptions, type ColorPanelSerialized, ColorPanelView, type ColorPanelViewProps, type ColorSpace, type ColorStopSink, type ColorToken, type ColorUiIntent, type ColorViewState, CommentsController, type CommentsControllerOptions, type CommentsHostBridge, type CommentsPanelState, CommentsPanelView, type CommentsPanelViewProps, type CommentsRenderContext, type CommentsThreadView, type CommentsUiIntent, type CommentsViewMessage, type CommentsViewModel, type CommentsViewOptions, type CommentsViewReaction, type CommentsViewState, type CommentsViewThread, type ConnectRules, type ConnectVerdict, type CreateColorPanelOptions, type CreateCommentsPanelOptions, type CreateCurvePanelOptions, type CreateFindPanelOptions, type CreateHistoryPanelOptions, type CreateInspectorPanelOptions, type CreateLayersPanelOptions, type CreateNodeGraphPanelOptions, type CreateTreePanelOptions, type CreateViewportPanelOptions, CurveController, type CurveControllerOptions, type CurveDragKind, type CurveDragState, type CurveHostBridge, type CurvePanelState, CurvePanelView, type CurvePanelViewProps, type CurvePreview, type CurveRenderConfig, type CurveRenderContext, CurveSurface, type CurveUiIntent, type CurveViewModel, type CurveViewOptions, type CurveViewState, DEFAULT_BLEND_MODES, DEFAULT_CURVE_ZOOM, DEFAULT_GRAPH_ZOOM, DEFAULT_ICON_MAP, DEFAULT_ORIGINAL_LABEL, type DropInput, EASING_PRESETS, EDIT_SPACES, EMPTY_HISTORY, EMPTY_SCHEMA, EMPTY_TREE, EMPTY_TREE_SOURCE, BEHAVIOURS$3 as FIND_BEHAVIOURS, FIND_DECLARATION, FIND_PANEL_ID, FIND_RUNTIME_UNITS, FindController, type FindControllerOptions, type FindHostBridge, FindKeys, type FindPanelState, FindPanelView, type FindPanelViewProps, type FindRenderContext, type FindUiIntent, type FindViewGroup, type FindViewModel, type FindViewOptions, type FindViewRow, type FindViewState, type FlatRow, type FlattenOptions, GENERIC_ICON, GraphController, type GraphControllerOptions, type GraphDragKind, type GraphDragState, type GraphHostBridge, type GraphPanelState, type GraphPreview, type GraphRenderConfig, type GraphRenderContext, type GraphViewState, BEHAVIOURS$7 as HISTORY_BEHAVIOURS, HISTORY_DECLARATION, HISTORY_RUNTIME_UNITS, type HistoryKeyEvent, HistoryPanelController, type HistoryPanelControllerOptions, type HistoryPanelSerialized, HistoryPanelView, type HistoryPanelViewProps, type ProjectOptions as HistoryProjectOptions, type HistoryRow, type HistoryUiIntent, type HistoryViewRow, type HistoryViewState, type Hsl, type Hsv, IMPLEMENTED_TREE_MODES, BEHAVIOURS$8 as INSPECTOR_BEHAVIOURS, INSPECTOR_DECLARATION, INSPECTOR_RUNTIME_UNITS, type InspectorKeyEvent, InspectorPanelController, type InspectorPanelControllerOptions, type InspectorPanelSerialized, InspectorPanelView, type InspectorPanelViewProps, type ProjectOptions$1 as InspectorProjectOptions, type InspectorUiIntent, type InspectorViewField, type InspectorViewSection, type InspectorViewState, BEHAVIOURS$9 as LAYERS_BEHAVIOURS, LAYERS_DECLARATION, LAYERS_RUNTIME_UNITS, LAYER_COLUMNS, type LayerColumn, type LayersKeyEvent, LayersPanelController, type LayersPanelControllerOptions, type LayersPanelSerialized, LayersPanelView, type LayersPanelViewProps, type LayersUiIntent, type LayersViewRow, type LayersViewState, MIXED, BEHAVIOURS$1 as NODEGRAPH_BEHAVIOURS, NODEGRAPH_DECLARATION, NODEGRAPH_PANEL_ID, NODEGRAPH_RUNTIME_UNITS, NodeGraphPanelView, type NodeGraphPanelViewProps, NodeGraphSurface, type NodeGraphUiIntent, type NodeGraphViewModel, type NodeGraphViewOptions, type NumericConstraints, type OklchDisplay, type ParseResult, type ProjectedSection, type Rgba, SPACE_LABEL, type ScrubOptions, type SelectMods, BEHAVIOURS as TREE_BEHAVIOURS, TREE_DECLARATION, TREE_PANEL_ID, TREE_RUNTIME_UNITS, type TangentEdit, Thumbnail, type ThumbnailProps, TreeController, type TreeControllerOptions, type TreeHostBridge, TreeIcon, type TreeKeyEvent, type TreePanelState, TreePanelView, type TreePanelViewProps, type TreeRenderContext, type TreeRow, TreeScroller, type TreeUiIntent, type TreeViewAction, type TreeViewModel, type TreeViewOptions, type TreeViewRow, type TreeViewState, BEHAVIOURS$4 as VIEWPORT_BEHAVIOURS, VIEWPORT_DECLARATION, VIEWPORT_PANEL_ID, VIEWPORT_RUNTIME_UNITS, VIEWPORT_SLOTS, VIEW_STATE_OPS, ViewportController, type ViewportControllerOptions, type ViewportHostBridge, type ViewportPanelState, ViewportPanelView, type ViewportPanelViewProps, type ViewportRenderContext, ViewportSurface, type ViewportViewModel, type ViewportViewOptions, type ViewportViewState, type XenoAddMenuItem, type XenoAnchorState, type XenoColorValue, type XenoCommentAuthor, type XenoCommentFilter, type XenoCommentMessage, type XenoCommentOp, type XenoCommentReaction, type XenoCommentSort, type XenoCommentThread, type XenoCommitPolicy, type XenoContextMenuRequest, type XenoCurveChannel, type XenoCurveInterpolation, type XenoCurveKey, type XenoCurveKeyRef, type XenoCurveOp, type XenoCurvePoint, XenoCurveScale, type XenoCurveScaleGeometry, type XenoCurveScaleState, type XenoCurveSelection, type XenoCurveSet, type XenoCurveViewport, type XenoCurveZoom, type XenoEasingPreset, type XenoEdge, type XenoFieldAnim, type XenoFieldFocus, type XenoFieldOption, type XenoFieldToken, type XenoFieldType, type XenoFieldValue, type XenoFindMatch, type XenoFindNavigate, type XenoFindOptions, type XenoFindQuery, type XenoFindReplace, type XenoFindResults, type XenoFindStatus, type XenoGradient, type XenoGraph, type XenoGraphOp, XenoGraphScale, type XenoGraphScaleGeometry, type XenoGraphScaleState, type XenoGraphSelection, type XenoGraphViewport, type XenoGraphZoom, type XenoHistoryEntry, type XenoHistoryIntent, type XenoHistoryMemory, type XenoHistoryOrder, type XenoHistoryScope, type XenoHistorySnapshot, type XenoHistorySource, type XenoHistoryState, type XenoHistoryStatus, type XenoInspectorEdit, type XenoInspectorField, type XenoInspectorSchema, type XenoInspectorSection, type XenoInspectorTarget, type XenoInspectorToken, type XenoKeyframeKind, type XenoLayerAdornment, type XenoLayerCap, type XenoLayerKind, type XenoLayerNode, type XenoLayerOp, type XenoLayerTree, type XenoNavigateRequest, type XenoNode, XenoNodeIndex, type XenoPort, type XenoPortDirection, type XenoPortRef, type XenoSectionAction, type XenoTangent, type XenoTangentMode, type XenoTangentSide, type XenoThreadActivate, type XenoThumbnailRequest, type XenoThumbnailResponse, type XenoTreeAction, type XenoTreeBadge, type XenoTreeCaps, type XenoTreeChildState, type XenoTreeChildrenResponse, type XenoTreeError, type XenoTreeGlyph, type XenoTreeIcon, type XenoTreeInvalidate, type XenoTreeMode, type XenoTreeModifiers, type XenoTreeNode, type XenoTreeNodeKind, type XenoTreeOp, type XenoTreeReveal, type XenoTreeSource, type XenoTreeSourceKind, type XenoTreeSourceState, type XenoViewportClient, type XenoViewportKey, type XenoViewportPointer, type XenoViewportSlot, type XenoViewportStats, type XenoViewportSurface, allFields, allIds, anchorStateOf, appliedCount, applyColorUi, applyCommentsUi, applyCurveUi, applyFindUi, applyHistoryUi, applyInspectorUi, applyLayersUi, applyNodeGraphUi, applyPrecision, applyTangentDrag, applyTreeUi, ariaSliderProps, boxesIntersect, canConnect, canRedo, canUndo, childStateOf, clamp, clampAlpha, clampTangent, collectDescendants, colorManifest, colorPanel, colorRuntimeComponents, colorViewManifest, colorViewState, commentsManifest, commentsPanel, commentsViewManifest, commentsViewState, commitPolicyOf, componentsForSpace, computeSurfaceSize, constraintsOf, countIsMeaningful, createColorPanel, createCommentsPanel, createCurvePanel, createFindPanel, createHistoryPanel, createInspectorPanel, createLayersPanel, createNodeGraphPanel, createTreePanel, createViewportPanel, createsCycle, currentRowIndex, curveManifest, curvePanel, curveRuntimeComponents, curveViewManifest, curveViewState, defaultIconFor, displayOrder, distanceToEdge, easeAt, easingPreset, edgeBounds, edgeKey, edgePath, edgesToReplace, edgesTouching, evaluateChannel, fieldMatches, findField, findManifest, findPanel, findPort, findRuntimeComponents, findSectionOf, findViewManifest, findViewState, fitToBounds, fitValueRange, flattenVisible, focusOrder, formatAge, formatNumeric, getAncestors, graphBounds, groupMatches, hasCap, hasDraggableTangents, hasTreeCap, hexFromHsv, highlightSegments, historyManifest, historyPanel, historyRuntimeComponents, historyViewManifest, historyViewState, hslToRgb, hsvFromHex, hsvToRgb, inspectorManifest, inspectorPanel, inspectorRuntimeComponents, inspectorViewManifest, inspectorViewState, interpolateSegment, isAncestorOf, isAnimated, isCollapsed, isColorSpace, isContainer, isEmptyContainer, isFieldEditable, isFieldMixed, isJumpable, isKeyEditable, isLayerColumn, isMixedValue, isOrphaned, isTreeContainer, isValidHex, isViewStateOp, itemShowsSubField, keyRefId, layersManifest, layersPanel, layersRuntimeComponents, layersViewManifest, layersViewState, liveEdges, makeColorValue, matchesFilter, messagesOf, mirrorTangent, nodeBounds, nodegraphManifest, nodegraphPanel, nodegraphRuntimeComponents, nodegraphViewManifest, nodegraphViewState, normalizeColorInput, normalizeHistoryState, normalizeKindKey, normalizeNumeric, normalizeRanges, normalizeSchema, normalizeTree, nudgeValue, oklchToRgb, parseCssColor, parseHexColor, parseListFieldId, parseNumeric, passesFilter, patternError, portHasRoom, portRefId, positionToValue, projectRows, projectSections, rangeBetween, resolveDropTarget, resolveIconName, rgbToHex, rgbToHsl, rgbToHsv, rgbToOklch, rgbaToCssHex, roundRgb, rowIndexOf, rowIndexOfEntry, safeAddColorStop, safeAddColorStops, sameKey, sampleChannel, scrubValue, segmentsAround, solveBezierT, sortThreads, surfaceChanged, tangentsForMode, tangentsToControlPoints, toViewportCoords, tokenItemsFor, totalCount, treeManifest, treePanel, treeRuntimeComponents, treeViewManifest, treeViewState, usesLogScale, valueExtent, valueToPosition, valuesEqual, viewportManifest, viewportPanel, viewportRuntimeComponents, viewportViewManifest, viewportViewState, visibleEdges, walkTree, wheelZoomFactor, zoomAboutCursor, zoomTimeAboutCursor, zoomValueAboutCursor };
@@ -1994,6 +1994,11 @@ function parseListFieldId(fieldId) {
1994
1994
  const m = /^(.+?)\[([^\]]+)\]\.(.+)$/.exec(fieldId);
1995
1995
  return m ? { listId: m[1], itemId: m[2], subId: m[3] } : null;
1996
1996
  }
1997
+ function itemShowsSubField(sub, item) {
1998
+ if (!sub.when) return true;
1999
+ const v = item[sub.when.field];
2000
+ return sub.when.in.some((x) => x === v);
2001
+ }
1997
2002
  function findField(schema, fieldId) {
1998
2003
  for (const section of schema.sections) {
1999
2004
  const found = section.fields.find((f) => f.id === fieldId);
@@ -2980,6 +2985,15 @@ var InspectorPanelController = class {
2980
2985
  import { useCallback as useCallback3, useSyncExternalStore as useSyncExternalStore2 } from "react";
2981
2986
 
2982
2987
  // src/edit/inspector/declaration.ts
2988
+ function tokenItemsFor(field, tokens, bound) {
2989
+ const group = field.token?.group;
2990
+ const matching = tokens.filter((t) => !group || t.group === group);
2991
+ return [
2992
+ ...matching.map((t) => ({ id: `token:${t.id}`, label: t.name, group: "Bind", disabled: field.token?.tokenId === t.id })),
2993
+ { id: "__unbind", label: "Unbind", group: "Value", disabled: !bound },
2994
+ { id: "__create", label: "Create token from value", group: "Value", disabled: bound }
2995
+ ];
2996
+ }
2983
2997
  function inspectorViewState(c) {
2984
2998
  const targets = c.getTargets();
2985
2999
  const multi = targets.length > 1;
@@ -3023,6 +3037,7 @@ function inspectorViewState(c) {
3023
3037
  bound,
3024
3038
  tokenLabel: tokenName,
3025
3039
  tokenTitle: bound ? `Bound to ${tokenName}` : void 0,
3040
+ tokenItems: tokenItemsFor(field, c.getTokens(), bound),
3026
3041
  showKeyframes: sk,
3027
3042
  animated: sk && !!anim.animated,
3028
3043
  onKeyframe: sk && !!anim.onKeyframe,
@@ -3085,6 +3100,12 @@ function applyInspectorUi(c, intent) {
3085
3100
  case "setEasing":
3086
3101
  c.keyframe(intent.fieldId, "setEasing", intent.easing);
3087
3102
  break;
3103
+ case "pickToken": {
3104
+ if (intent.itemId === "__unbind") c.bindToken(intent.fieldId, null);
3105
+ else if (intent.itemId === "__create") c.createToken(intent.fieldId);
3106
+ else if (intent.itemId.startsWith("token:")) c.bindToken(intent.fieldId, intent.itemId.slice(6));
3107
+ break;
3108
+ }
3088
3109
  case "bindToken": {
3089
3110
  const bound = !!c.getSections().flatMap((p) => p.fields).find((f) => f.id === intent.fieldId)?.token?.tokenId;
3090
3111
  c.bindToken(intent.fieldId, bound ? null : c.getTokens()[0]?.id ?? null);
@@ -3208,7 +3229,12 @@ var INSPECTOR_DECLARATION = {
3208
3229
  children: [
3209
3230
  { component: "chrome/Select", when: { item: "showEasing" }, props: { size: { value: "sm" }, options: { item: "easingOptions" }, value: { item: "easing" }, label: { value: "Easing" } }, on: { onChange: ui2("setEasing", { fieldId: { item: "id" }, easing: { arg: "" } }) } },
3210
3231
  { component: "chrome/Badge", when: { item: "showKeyframes" }, props: { size: { value: "sm" } }, children: [text2({ item: "keyframeChip" })] },
3211
- iconButton("Link", { item: "tokenActionLabel" }, ui2("bindToken", { fieldId: { item: "id" } }), { when: { item: "showToken" }, props: { active: { item: "bound" } } }),
3232
+ {
3233
+ component: "chrome/Menu",
3234
+ when: { item: "showToken" },
3235
+ props: { size: { value: "sm" }, trigger: { node: { component: "icons/Link" } }, items: { item: "tokenItems" }, label: { item: "tokenActionLabel" }, align: { value: "end" } },
3236
+ on: { onSelect: ui2("pickToken", { fieldId: { item: "id" }, itemId: { arg: "" } }) }
3237
+ },
3212
3238
  iconButton("Reset", { value: "Reset to default" }, ui2("resetField", { fieldId: { item: "id" } }), { when: { item: "showReset" } })
3213
3239
  ]
3214
3240
  }
@@ -3533,7 +3559,7 @@ function ListWidget({ field, controller, renderField }) {
3533
3559
  items.map((item, i) => /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 2, pad: "none", children: [
3534
3560
  structured && renderField ? /* @__PURE__ */ jsxs2(Stack, { gap: 2, pad: "none", children: [
3535
3561
  field.itemLabel ? /* @__PURE__ */ jsx3(Text2, { role: "caption", children: `${field.itemLabel} ${i + 1}` }) : null,
3536
- field.itemFields.map((sub) => {
3562
+ field.itemFields.filter((sub) => itemShowsSubField(sub, item)).map((sub) => {
3537
3563
  const virtual = controller.getField(`${field.id}[${item.id}].${sub.id}`);
3538
3564
  return virtual ? /* @__PURE__ */ jsx3(Fragment2, { children: renderField(virtual) }, sub.id) : null;
3539
3565
  })
@@ -3649,7 +3675,7 @@ function FieldRow({ row: row2, controller }) {
3649
3675
  trailing: /* @__PURE__ */ jsxs3(Fragment4, { children: [
3650
3676
  row2.showEasing ? /* @__PURE__ */ jsx4(Select2, { size: "sm", options: row2.easingOptions, value: row2.easing, label: "Easing", onChange: (v) => ui10({ kind: "setEasing", fieldId: row2.id, easing: v }) }) : null,
3651
3677
  row2.showKeyframes ? /* @__PURE__ */ jsx4(Badge2, { size: "sm", children: row2.keyframeChip }) : null,
3652
- row2.showToken ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(LinkIcon, {}), label: row2.tokenActionLabel, active: row2.bound, onClick: () => ui10({ kind: "bindToken", fieldId: row2.id }) }) : null,
3678
+ row2.showToken ? /* @__PURE__ */ jsx4(Menu, { size: "sm", trigger: /* @__PURE__ */ jsx4(LinkIcon, {}), items: row2.tokenItems, label: row2.tokenActionLabel, align: "end", onSelect: (id) => ui10({ kind: "pickToken", fieldId: row2.id, itemId: id }) }) : null,
3653
3679
  row2.showReset ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(ResetIcon, {}), label: "Reset to default", onClick: () => ui10({ kind: "resetField", fieldId: row2.id }) }) : null
3654
3680
  ] }),
3655
3681
  children: [
@@ -14338,6 +14364,7 @@ export {
14338
14364
  isTreeContainer,
14339
14365
  isValidHex,
14340
14366
  isViewStateOp,
14367
+ itemShowsSubField,
14341
14368
  keyRefId,
14342
14369
  layersManifest,
14343
14370
  layersPanel,
@@ -14398,6 +14425,7 @@ export {
14398
14425
  tangentsForMode,
14399
14426
  tangentsToControlPoints,
14400
14427
  toViewportCoords,
14428
+ tokenItemsFor,
14401
14429
  totalCount,
14402
14430
  treeManifest,
14403
14431
  treePanel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/blocks",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "XENO Blocks — rung 3 of the front ladder: components composed into a contract-bearing unit (manifest: ports, intents, commands, agent surface), rendered by @xenosystem/workbench. ONE package, one subpath per family (/auth, /edit, /data, /time, /ops, /trust, /agent), one named export per block — XENO PACKAGE NAMING - STANDARD.md.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",