@xenosystem/blocks 0.14.1 → 0.15.1
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/edit/index.d.ts +27 -1
- package/dist/edit/index.js +59 -7
- package/package.json +1 -1
package/dist/edit/index.d.ts
CHANGED
|
@@ -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 {
|
|
@@ -974,6 +981,12 @@ interface XenoInspectorField {
|
|
|
974
981
|
field: string;
|
|
975
982
|
in: XenoFieldValue[];
|
|
976
983
|
};
|
|
984
|
+
/**
|
|
985
|
+
* Inside `itemFields`: a sub-field with `token.bindable` carries its binding IN THE ITEM as
|
|
986
|
+
* `${subId}Token` (a token id or empty). The row's token menu reads it, and a pick rewrites the item
|
|
987
|
+
* and emits ONE `set` for the list — the same contract as a value edit, so a host binds a stroke's
|
|
988
|
+
* colour or an effect's shadow from the item it already receives.
|
|
989
|
+
*/
|
|
977
990
|
/** For a structured `list`: the label drawn on each item row (e.g. `Fill`, `Shadow`). */
|
|
978
991
|
itemLabel?: string;
|
|
979
992
|
/** Axis labels for `vector` (e.g. `['X','Y']`). */
|
|
@@ -1654,6 +1667,13 @@ interface InspectorViewField {
|
|
|
1654
1667
|
bound: boolean;
|
|
1655
1668
|
tokenLabel?: string;
|
|
1656
1669
|
tokenTitle?: string;
|
|
1670
|
+
/** The bindable tokens for this field (its group), then Unbind / Create — the link menu's items. */
|
|
1671
|
+
tokenItems: {
|
|
1672
|
+
id: string;
|
|
1673
|
+
label: string;
|
|
1674
|
+
group?: string;
|
|
1675
|
+
disabled?: boolean;
|
|
1676
|
+
}[];
|
|
1657
1677
|
showKeyframes: boolean;
|
|
1658
1678
|
animated: boolean;
|
|
1659
1679
|
onKeyframe: boolean;
|
|
@@ -1753,10 +1773,16 @@ type InspectorUiIntent = {
|
|
|
1753
1773
|
} | {
|
|
1754
1774
|
kind: 'bindToken';
|
|
1755
1775
|
fieldId: string;
|
|
1776
|
+
} | {
|
|
1777
|
+
kind: 'pickToken';
|
|
1778
|
+
fieldId: string;
|
|
1779
|
+
itemId: string;
|
|
1756
1780
|
} | {
|
|
1757
1781
|
kind: 'resetField';
|
|
1758
1782
|
fieldId: string;
|
|
1759
1783
|
};
|
|
1784
|
+
/** The link menu's items: the field's group of tokens (all, when it names none), then Unbind and Create-from-value. */
|
|
1785
|
+
declare function tokenItemsFor(field: XenoInspectorField, tokens: readonly XenoInspectorToken[], bound: boolean): InspectorViewField['tokenItems'];
|
|
1760
1786
|
/** Derive the view state from the live controller — the runtime calls this on every draw. */
|
|
1761
1787
|
declare function inspectorViewState(c: InspectorPanelController): InspectorViewState;
|
|
1762
1788
|
/** Apply a `ui` intent to the controller — the runtime's half of the contract. */
|
|
@@ -7634,4 +7660,4 @@ declare function TreeIcon({ name, size }: {
|
|
|
7634
7660
|
size?: number;
|
|
7635
7661
|
}): ReactNode;
|
|
7636
7662
|
|
|
7637
|
-
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, totalCount, treeManifest, treePanel, treeRuntimeComponents, treeViewManifest, treeViewState, usesLogScale, valueExtent, valueToPosition, valuesEqual, viewportManifest, viewportPanel, viewportRuntimeComponents, viewportViewManifest, viewportViewState, visibleEdges, walkTree, wheelZoomFactor, zoomAboutCursor, zoomTimeAboutCursor, zoomValueAboutCursor };
|
|
7663
|
+
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 };
|
package/dist/edit/index.js
CHANGED
|
@@ -2011,7 +2011,9 @@ function findField(schema, fieldId) {
|
|
|
2011
2011
|
if (!list || !sub) return void 0;
|
|
2012
2012
|
const item = (Array.isArray(list.value) ? list.value : []).find((it) => it?.id === v.itemId);
|
|
2013
2013
|
if (!item) return void 0;
|
|
2014
|
-
|
|
2014
|
+
const tokenId = sub.token?.bindable ? item[`${v.subId}Token`] : void 0;
|
|
2015
|
+
const token = sub.token ? { ...sub.token, ...typeof tokenId === "string" && tokenId ? { tokenId } : { tokenId: null } } : void 0;
|
|
2016
|
+
return { ...sub, id: fieldId, value: item[v.subId], disabled: sub.disabled || list.disabled, readOnly: sub.readOnly || list.readOnly, ...token ? { token } : {} };
|
|
2015
2017
|
}
|
|
2016
2018
|
function findSectionOf(schema, fieldId) {
|
|
2017
2019
|
return schema.sections.find((s) => s.fields.some((f) => f.id === fieldId));
|
|
@@ -2673,6 +2675,13 @@ var InspectorPanelController = class {
|
|
|
2673
2675
|
bindToken(fieldId, tokenId) {
|
|
2674
2676
|
const field = findField(this.schema, fieldId);
|
|
2675
2677
|
if (!field) return false;
|
|
2678
|
+
const virtual = parseListFieldId(fieldId);
|
|
2679
|
+
if (virtual) {
|
|
2680
|
+
const items = this.getFieldValue(virtual.listId) ?? [];
|
|
2681
|
+
const next = items.map((it) => it.id === virtual.itemId ? { ...it, [`${virtual.subId}Token`]: tokenId ?? "" } : it);
|
|
2682
|
+
this.emit({ type: "set", targetIds: this.targetIds(), fieldId: virtual.listId, value: next });
|
|
2683
|
+
return true;
|
|
2684
|
+
}
|
|
2676
2685
|
this.emit({ type: "bindToken", targetIds: this.targetIds(), fieldId, tokenId });
|
|
2677
2686
|
return true;
|
|
2678
2687
|
}
|
|
@@ -2985,6 +2994,15 @@ var InspectorPanelController = class {
|
|
|
2985
2994
|
import { useCallback as useCallback3, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
2986
2995
|
|
|
2987
2996
|
// src/edit/inspector/declaration.ts
|
|
2997
|
+
function tokenItemsFor(field, tokens, bound) {
|
|
2998
|
+
const group = field.token?.group;
|
|
2999
|
+
const matching = tokens.filter((t) => !group || t.group === group);
|
|
3000
|
+
return [
|
|
3001
|
+
...matching.map((t) => ({ id: `token:${t.id}`, label: t.name, group: "Bind", disabled: field.token?.tokenId === t.id })),
|
|
3002
|
+
{ id: "__unbind", label: "Unbind", group: "Value", disabled: !bound },
|
|
3003
|
+
{ id: "__create", label: "Create token from value", group: "Value", disabled: bound }
|
|
3004
|
+
];
|
|
3005
|
+
}
|
|
2988
3006
|
function inspectorViewState(c) {
|
|
2989
3007
|
const targets = c.getTargets();
|
|
2990
3008
|
const multi = targets.length > 1;
|
|
@@ -3028,6 +3046,7 @@ function inspectorViewState(c) {
|
|
|
3028
3046
|
bound,
|
|
3029
3047
|
tokenLabel: tokenName,
|
|
3030
3048
|
tokenTitle: bound ? `Bound to ${tokenName}` : void 0,
|
|
3049
|
+
tokenItems: tokenItemsFor(field, c.getTokens(), bound),
|
|
3031
3050
|
showKeyframes: sk,
|
|
3032
3051
|
animated: sk && !!anim.animated,
|
|
3033
3052
|
onKeyframe: sk && !!anim.onKeyframe,
|
|
@@ -3090,6 +3109,12 @@ function applyInspectorUi(c, intent) {
|
|
|
3090
3109
|
case "setEasing":
|
|
3091
3110
|
c.keyframe(intent.fieldId, "setEasing", intent.easing);
|
|
3092
3111
|
break;
|
|
3112
|
+
case "pickToken": {
|
|
3113
|
+
if (intent.itemId === "__unbind") c.bindToken(intent.fieldId, null);
|
|
3114
|
+
else if (intent.itemId === "__create") c.createToken(intent.fieldId);
|
|
3115
|
+
else if (intent.itemId.startsWith("token:")) c.bindToken(intent.fieldId, intent.itemId.slice(6));
|
|
3116
|
+
break;
|
|
3117
|
+
}
|
|
3093
3118
|
case "bindToken": {
|
|
3094
3119
|
const bound = !!c.getSections().flatMap((p) => p.fields).find((f) => f.id === intent.fieldId)?.token?.tokenId;
|
|
3095
3120
|
c.bindToken(intent.fieldId, bound ? null : c.getTokens()[0]?.id ?? null);
|
|
@@ -3213,7 +3238,12 @@ var INSPECTOR_DECLARATION = {
|
|
|
3213
3238
|
children: [
|
|
3214
3239
|
{ 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: "" } }) } },
|
|
3215
3240
|
{ component: "chrome/Badge", when: { item: "showKeyframes" }, props: { size: { value: "sm" } }, children: [text2({ item: "keyframeChip" })] },
|
|
3216
|
-
|
|
3241
|
+
{
|
|
3242
|
+
component: "chrome/Menu",
|
|
3243
|
+
when: { item: "showToken" },
|
|
3244
|
+
props: { size: { value: "sm" }, trigger: { node: { component: "icons/Link" } }, items: { item: "tokenItems" }, label: { item: "tokenActionLabel" }, align: { value: "end" } },
|
|
3245
|
+
on: { onSelect: ui2("pickToken", { fieldId: { item: "id" }, itemId: { arg: "" } }) }
|
|
3246
|
+
},
|
|
3217
3247
|
iconButton("Reset", { value: "Reset to default" }, ui2("resetField", { fieldId: { item: "id" } }), { when: { item: "showReset" } })
|
|
3218
3248
|
]
|
|
3219
3249
|
}
|
|
@@ -3245,15 +3275,16 @@ var INSPECTOR_DECLARATION = {
|
|
|
3245
3275
|
};
|
|
3246
3276
|
|
|
3247
3277
|
// src/edit/inspector/react/InspectorPanelView.tsx
|
|
3248
|
-
import { Badge as Badge2, Column as Column2, EmptyState as EmptyState2, Field, FieldGroup, IconButton as IconButton3, Menu, ScrollArea as ScrollArea2, SearchField as SearchField2, Section, Select as Select2, Stack as Stack2, Text as Text3 } from "@xenosystem/components/chrome";
|
|
3278
|
+
import { Badge as Badge2, Column as Column2, EmptyState as EmptyState2, Field, FieldGroup, IconButton as IconButton3, Menu as Menu2, ScrollArea as ScrollArea2, SearchField as SearchField2, Section, Select as Select2, Stack as Stack2, Text as Text3 } from "@xenosystem/components/chrome";
|
|
3249
3279
|
|
|
3250
3280
|
// src/edit/inspector/react/widgets.tsx
|
|
3251
3281
|
import { useCallback as useCallback2, useRef as useRef3 } from "react";
|
|
3252
|
-
import
|
|
3282
|
+
import "react";
|
|
3253
3283
|
import {
|
|
3254
3284
|
AxisLabel,
|
|
3255
3285
|
IconButton as IconButton2,
|
|
3256
3286
|
Input as Input2,
|
|
3287
|
+
Menu,
|
|
3257
3288
|
ProportionBar,
|
|
3258
3289
|
SegmentedControl,
|
|
3259
3290
|
Select,
|
|
@@ -3540,7 +3571,27 @@ function ListWidget({ field, controller, renderField }) {
|
|
|
3540
3571
|
field.itemLabel ? /* @__PURE__ */ jsx3(Text2, { role: "caption", children: `${field.itemLabel} ${i + 1}` }) : null,
|
|
3541
3572
|
field.itemFields.filter((sub) => itemShowsSubField(sub, item)).map((sub) => {
|
|
3542
3573
|
const virtual = controller.getField(`${field.id}[${item.id}].${sub.id}`);
|
|
3543
|
-
|
|
3574
|
+
if (!virtual) return null;
|
|
3575
|
+
const bound = !!virtual.token?.tokenId;
|
|
3576
|
+
const tokens = controller.getTokens();
|
|
3577
|
+
const menu = sub.token?.bindable && controller.areTokensShown() ? /* @__PURE__ */ jsx3(
|
|
3578
|
+
Menu,
|
|
3579
|
+
{
|
|
3580
|
+
size: "sm",
|
|
3581
|
+
trigger: /* @__PURE__ */ jsx3(LinkIcon, {}),
|
|
3582
|
+
items: tokenItemsFor(virtual, tokens, bound),
|
|
3583
|
+
label: bound ? "Unbind token" : "Bind token",
|
|
3584
|
+
align: "end",
|
|
3585
|
+
onSelect: (id) => {
|
|
3586
|
+
if (id === "__unbind") controller.bindToken(virtual.id, null);
|
|
3587
|
+
else if (id.startsWith("token:")) controller.bindToken(virtual.id, id.slice(6));
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
) : null;
|
|
3591
|
+
return /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 2, pad: "none", children: [
|
|
3592
|
+
bound ? /* @__PURE__ */ jsx3(Text2, { role: "meta", children: virtual.token?.tokenName ?? tokens.find((t) => t.id === virtual.token?.tokenId)?.name ?? virtual.token?.tokenId }) : renderField(virtual),
|
|
3593
|
+
menu
|
|
3594
|
+
] }, sub.id);
|
|
3544
3595
|
})
|
|
3545
3596
|
] }) : /* @__PURE__ */ jsx3(Text2, { role: "meta", children: typeof item === "string" ? item : JSON.stringify(item) }),
|
|
3546
3597
|
editable ? /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
@@ -3625,7 +3676,7 @@ function SectionView({ section, controller }) {
|
|
|
3625
3676
|
badge: section.badge ? /* @__PURE__ */ jsx4(Badge2, { children: section.badge }) : null,
|
|
3626
3677
|
actions: hasActions ? /* @__PURE__ */ jsxs3(Fragment4, { children: [
|
|
3627
3678
|
section.actions.map((action) => /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(ActionGlyph, { glyph: action.glyph }), label: action.label, disabled: action.disabled, onClick: () => ui10({ kind: "runAction", sectionId: section.id, actionId: action.id }) }, action.id)),
|
|
3628
|
-
section.hasAddMenu ? /* @__PURE__ */ jsx4(
|
|
3679
|
+
section.hasAddMenu ? /* @__PURE__ */ jsx4(Menu2, { size: "sm", trigger: "\uFF0B", items: section.addItems, label: section.addLabel, align: "end", onSelect: (id) => ui10({ kind: "addItem", sectionId: section.id, itemId: id }) }) : null
|
|
3629
3680
|
] }) : null,
|
|
3630
3681
|
children: [
|
|
3631
3682
|
section.showEmptyHint ? /* @__PURE__ */ jsx4(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx4(Text3, { role: "caption", children: section.emptyHint }) }) : null,
|
|
@@ -3654,7 +3705,7 @@ function FieldRow({ row: row2, controller }) {
|
|
|
3654
3705
|
trailing: /* @__PURE__ */ jsxs3(Fragment4, { children: [
|
|
3655
3706
|
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,
|
|
3656
3707
|
row2.showKeyframes ? /* @__PURE__ */ jsx4(Badge2, { size: "sm", children: row2.keyframeChip }) : null,
|
|
3657
|
-
row2.showToken ? /* @__PURE__ */ jsx4(
|
|
3708
|
+
row2.showToken ? /* @__PURE__ */ jsx4(Menu2, { 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,
|
|
3658
3709
|
row2.showReset ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(ResetIcon, {}), label: "Reset to default", onClick: () => ui10({ kind: "resetField", fieldId: row2.id }) }) : null
|
|
3659
3710
|
] }),
|
|
3660
3711
|
children: [
|
|
@@ -14404,6 +14455,7 @@ export {
|
|
|
14404
14455
|
tangentsForMode,
|
|
14405
14456
|
tangentsToControlPoints,
|
|
14406
14457
|
toViewportCoords,
|
|
14458
|
+
tokenItemsFor,
|
|
14407
14459
|
totalCount,
|
|
14408
14460
|
treeManifest,
|
|
14409
14461
|
treePanel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/blocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
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",
|