@cardenelabs/cdl 0.6.0 → 0.7.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.
- package/dist/index.cjs +131 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +130 -68
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +129 -67
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +129 -67
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -0
- package/src/kinds/mind-map.tsx +27 -4
- package/src/kinds/tree.tsx +29 -4
- package/src/render/nodes.tsx +6 -5
- package/src/render/payload-binding.ts +65 -3
package/dist/index.d.cts
CHANGED
|
@@ -3407,4 +3407,26 @@ type StateMachine2Builder = {
|
|
|
3407
3407
|
*/
|
|
3408
3408
|
declare function stateMachine2(preset: StateMachine2Preset): StateMachine2Builder;
|
|
3409
3409
|
|
|
3410
|
-
|
|
3410
|
+
/**
|
|
3411
|
+
* 全 state の現時点 value を計算 (現在 phase + これまでの phase の最終 tween 値を集約)。
|
|
3412
|
+
* - set = 即時切替 (phase 到達で value 上書き、 lerp なし)
|
|
3413
|
+
* - tween = 数値補間 (現 phase 中は progress で lerp、 過去 phase は to 固定)
|
|
3414
|
+
*
|
|
3415
|
+
* 段の値を出した後に `laid.derived` (他の値から自動で決まる値) を参照順で解いて足す。
|
|
3416
|
+
* 毎 frame ここを通るので、 掛け算 / 比較のような端点 2 点では表せない関係も途中の値が
|
|
3417
|
+
* 正しくなる。 同じ名前が `states` にもある場合は解けた値が勝ち、 解けなければ初期値が残る。
|
|
3418
|
+
*/
|
|
3419
|
+
declare function computeStateValues(laid: LaidDiagram, phaseIdx: number, progress: number): Record<string, string>;
|
|
3420
|
+
/**
|
|
3421
|
+
* template literal `{stateId}` を values map で置換 (未解決は `{id}` のまま)。
|
|
3422
|
+
* array signal 拡張 (SSOT): 値が JSON array (例 `"[1,2,3]"`) の signal に対しては、
|
|
3423
|
+
* `{sig[0]}` = 要素 0 の値、 `{sig.length}` = 要素数、
|
|
3424
|
+
* `{sig.sum}` / `{sig.max}` / `{sig.min}` / `{sig.avg}` = 数値集約 (非数値 element は 0 扱い)。
|
|
3425
|
+
* array 記法対象外 signal は従来通り `{sig}` で単純置換。
|
|
3426
|
+
*
|
|
3427
|
+
* 名前に使える文字は `template-name.ts` が決める (engine 全体で 1 つ)。 ここだけで
|
|
3428
|
+
* 定義すると、 式を書ける側との間で「読めるが書けない」 「書けるが読めない」 名前ができる。
|
|
3429
|
+
*/
|
|
3430
|
+
declare function interpolate(template: string, values: Record<string, string>): string;
|
|
3431
|
+
|
|
3432
|
+
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, type AnimationChain, type AuthorIntentOptions, type AuthorIntentReport, type BinaryOp, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDerivedValue, CdlDiagram, CdlDiagramThumbnail, CdlEdge, type CdlEventHandler, CdlEventTarget, CdlInput, CdlLane, CdlNode, CdlScrollTrigger, CdlState, type ChartBuilder, type ChartDatum, type ChartPreset, type ChartType, type ClassDiagramBuilder, type ClassDiagramPreset, type ClassRelationType, Computed, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, type DerivedNotice, type DerivedNoticeKind, type DerivedResult, type DiagramAdapter, type DiagramBuilder, type Discrepancy, type DiscrepancyKind, type DomVerifyReport, EDGE_LABEL_TEXT, EDGE_STUB_OUT, type EdgeLabelLine, type EdgeLabelTextSpec, EdgeStyle, type ErBuilder, type ErEntity, type ErPreset, type ErRelation, type ErRelationCardinality, type EventAttachHandle, type EventChain, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, type FlowBuilder, type FlowPreset, type FlowStepInput, type FlowchartBuilder, type FlowchartEdge, type FlowchartNode, type FlowchartNodeShape, type FlowchartPreset, type FormulaAst, type FormulaContext, type FsmState, type FsmStateNested, type FsmTransition, type FsmTransitionExt, type FunnelBuilder, type FunnelPreset, type FunnelStage, type GanttBuilder, type GanttPreset, type GanttTask, type GenericDiagramSpec, type GenericDiscrepancy, type GenericDiscrepancyKind, type GenericVerifyOptions, type Rect as GeometryRect, type Segment as GeometrySegment, type InfraConnection, type InfraNode, type InfrastructureBuilder, type InfrastructurePreset, type InputChain, type IntentDiscrepancy, type IntentDiscrepancyKind, JourneyEmotion, type JourneyStep, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, LaidDiagram, LaidEdge, LaidNode, type LayoutWithValidationOptions, type LayoutWithValidationResult, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, type MathFnName, type MindBranch, type MindMapBuilder, type MindMapPreset, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, type NetworkBuilder, type NetworkDevice, type NetworkDeviceKind, type NetworkLink, type NetworkPreset, NodeKind, type PageLike, type PhaseBuilder, type QuadrantBuilder, type QuadrantItem, type QuadrantPreset, type QuadrantQuadrantLabel, ROW_GAP_VARIANCE_TOL, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, type SequenceBuilder, type SequencePreset, type SequenceStep, Side, Signal, type StateMachine2Builder, type StateMachine2Preset, type StateMachineBuilder, type StateMachinePreset, type SweepReport, type SwimlanePreset, TARGET_LABEL_PATH_DIST, Tone, type TopologyBuilder, type TopologyConnection, type TopologyContainer, type TopologyGroupBuilder, type TopologyPreset, type TreeBuilder, type TreeNode, type TreePreset, type UmlClass, type UmlRelation, type UserJourneyBuilder, type UserJourneyPreset, type ValidateOptions, type ValidationProfile, type VerifyOptions, type Violation, type VisualAxis, type VisualValidationReport, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeScrollProgress, computeStateValues, computeViewportScale, countEdgeCrossings, createFormulaComputeds, createInputSignals, diagram, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, parseFormula, pointRectEdgeDistance, pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect, sequence, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
|
package/dist/index.d.ts
CHANGED
|
@@ -3407,4 +3407,26 @@ type StateMachine2Builder = {
|
|
|
3407
3407
|
*/
|
|
3408
3408
|
declare function stateMachine2(preset: StateMachine2Preset): StateMachine2Builder;
|
|
3409
3409
|
|
|
3410
|
-
|
|
3410
|
+
/**
|
|
3411
|
+
* 全 state の現時点 value を計算 (現在 phase + これまでの phase の最終 tween 値を集約)。
|
|
3412
|
+
* - set = 即時切替 (phase 到達で value 上書き、 lerp なし)
|
|
3413
|
+
* - tween = 数値補間 (現 phase 中は progress で lerp、 過去 phase は to 固定)
|
|
3414
|
+
*
|
|
3415
|
+
* 段の値を出した後に `laid.derived` (他の値から自動で決まる値) を参照順で解いて足す。
|
|
3416
|
+
* 毎 frame ここを通るので、 掛け算 / 比較のような端点 2 点では表せない関係も途中の値が
|
|
3417
|
+
* 正しくなる。 同じ名前が `states` にもある場合は解けた値が勝ち、 解けなければ初期値が残る。
|
|
3418
|
+
*/
|
|
3419
|
+
declare function computeStateValues(laid: LaidDiagram, phaseIdx: number, progress: number): Record<string, string>;
|
|
3420
|
+
/**
|
|
3421
|
+
* template literal `{stateId}` を values map で置換 (未解決は `{id}` のまま)。
|
|
3422
|
+
* array signal 拡張 (SSOT): 値が JSON array (例 `"[1,2,3]"`) の signal に対しては、
|
|
3423
|
+
* `{sig[0]}` = 要素 0 の値、 `{sig.length}` = 要素数、
|
|
3424
|
+
* `{sig.sum}` / `{sig.max}` / `{sig.min}` / `{sig.avg}` = 数値集約 (非数値 element は 0 扱い)。
|
|
3425
|
+
* array 記法対象外 signal は従来通り `{sig}` で単純置換。
|
|
3426
|
+
*
|
|
3427
|
+
* 名前に使える文字は `template-name.ts` が決める (engine 全体で 1 つ)。 ここだけで
|
|
3428
|
+
* 定義すると、 式を書ける側との間で「読めるが書けない」 「書けるが読めない」 名前ができる。
|
|
3429
|
+
*/
|
|
3430
|
+
declare function interpolate(template: string, values: Record<string, string>): string;
|
|
3431
|
+
|
|
3432
|
+
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, type AnimationChain, type AuthorIntentOptions, type AuthorIntentReport, type BinaryOp, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDerivedValue, CdlDiagram, CdlDiagramThumbnail, CdlEdge, type CdlEventHandler, CdlEventTarget, CdlInput, CdlLane, CdlNode, CdlScrollTrigger, CdlState, type ChartBuilder, type ChartDatum, type ChartPreset, type ChartType, type ClassDiagramBuilder, type ClassDiagramPreset, type ClassRelationType, Computed, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, type DerivedNotice, type DerivedNoticeKind, type DerivedResult, type DiagramAdapter, type DiagramBuilder, type Discrepancy, type DiscrepancyKind, type DomVerifyReport, EDGE_LABEL_TEXT, EDGE_STUB_OUT, type EdgeLabelLine, type EdgeLabelTextSpec, EdgeStyle, type ErBuilder, type ErEntity, type ErPreset, type ErRelation, type ErRelationCardinality, type EventAttachHandle, type EventChain, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, type FlowBuilder, type FlowPreset, type FlowStepInput, type FlowchartBuilder, type FlowchartEdge, type FlowchartNode, type FlowchartNodeShape, type FlowchartPreset, type FormulaAst, type FormulaContext, type FsmState, type FsmStateNested, type FsmTransition, type FsmTransitionExt, type FunnelBuilder, type FunnelPreset, type FunnelStage, type GanttBuilder, type GanttPreset, type GanttTask, type GenericDiagramSpec, type GenericDiscrepancy, type GenericDiscrepancyKind, type GenericVerifyOptions, type Rect as GeometryRect, type Segment as GeometrySegment, type InfraConnection, type InfraNode, type InfrastructureBuilder, type InfrastructurePreset, type InputChain, type IntentDiscrepancy, type IntentDiscrepancyKind, JourneyEmotion, type JourneyStep, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, LaidDiagram, LaidEdge, LaidNode, type LayoutWithValidationOptions, type LayoutWithValidationResult, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, type MathFnName, type MindBranch, type MindMapBuilder, type MindMapPreset, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, type NetworkBuilder, type NetworkDevice, type NetworkDeviceKind, type NetworkLink, type NetworkPreset, NodeKind, type PageLike, type PhaseBuilder, type QuadrantBuilder, type QuadrantItem, type QuadrantPreset, type QuadrantQuadrantLabel, ROW_GAP_VARIANCE_TOL, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, type SequenceBuilder, type SequencePreset, type SequenceStep, Side, Signal, type StateMachine2Builder, type StateMachine2Preset, type StateMachineBuilder, type StateMachinePreset, type SweepReport, type SwimlanePreset, TARGET_LABEL_PATH_DIST, Tone, type TopologyBuilder, type TopologyConnection, type TopologyContainer, type TopologyGroupBuilder, type TopologyPreset, type TreeBuilder, type TreeNode, type TreePreset, type UmlClass, type UmlRelation, type UserJourneyBuilder, type UserJourneyPreset, type ValidateOptions, type ValidationProfile, type VerifyOptions, type Violation, type VisualAxis, type VisualValidationReport, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeScrollProgress, computeStateValues, computeViewportScale, countEdgeCrossings, createFormulaComputeds, createInputSignals, diagram, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, parseFormula, pointRectEdgeDistance, pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect, sequence, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
|
package/dist/index.js
CHANGED
|
@@ -20926,6 +20926,31 @@ function resolveJourneyData(steps, values) {
|
|
|
20926
20926
|
return e.ok ? { ...s, emotion: e.value } : { ...s, emotion: e.value, unresolved: true };
|
|
20927
20927
|
});
|
|
20928
20928
|
}
|
|
20929
|
+
function resolveBoundText(raw, values) {
|
|
20930
|
+
if (!raw.includes("{")) return { value: raw, ok: true };
|
|
20931
|
+
const resolved = interpolate(raw, values);
|
|
20932
|
+
return hasUnresolvedRef(resolved) ? { value: resolved, ok: false } : { value: resolved, ok: true };
|
|
20933
|
+
}
|
|
20934
|
+
function resolveTreeData(nodes, values) {
|
|
20935
|
+
if (!nodes.some((n) => n.title.includes("{"))) return nodes;
|
|
20936
|
+
return nodes.map((n) => {
|
|
20937
|
+
const title = resolveBoundText(n.title, values);
|
|
20938
|
+
const \u89E3\u6C7A\u5F8C = { ...n, title: title.value };
|
|
20939
|
+
return title.ok ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
20940
|
+
});
|
|
20941
|
+
}
|
|
20942
|
+
function resolveMindData(data, values) {
|
|
20943
|
+
const \u8AAD\u3080 = data.rootTitle.includes("{") || data.branches.some((b) => b.title.includes("{"));
|
|
20944
|
+
if (!\u8AAD\u3080) return data;
|
|
20945
|
+
const root = resolveBoundText(data.rootTitle, values);
|
|
20946
|
+
const branches = data.branches.map((b) => {
|
|
20947
|
+
const title = resolveBoundText(b.title, values);
|
|
20948
|
+
const \u89E3\u6C7A\u5F8C2 = { ...b, title: title.value };
|
|
20949
|
+
return title.ok ? \u89E3\u6C7A\u5F8C2 : { ...\u89E3\u6C7A\u5F8C2, unresolved: true };
|
|
20950
|
+
});
|
|
20951
|
+
const \u89E3\u6C7A\u5F8C = { ...data, rootTitle: root.value, branches };
|
|
20952
|
+
return root.ok ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
20953
|
+
}
|
|
20929
20954
|
function ChartLineNode({
|
|
20930
20955
|
node,
|
|
20931
20956
|
active,
|
|
@@ -21490,10 +21515,14 @@ function toneColor3(tone) {
|
|
|
21490
21515
|
}
|
|
21491
21516
|
var MIND_TONES = ["accent", "teal", "success", "warning", "info", "error"];
|
|
21492
21517
|
var MIND_BOX_GAP = 24;
|
|
21493
|
-
function MindMapNode({
|
|
21518
|
+
function MindMapNode({
|
|
21519
|
+
node,
|
|
21520
|
+
active,
|
|
21521
|
+
stateValues = {}
|
|
21522
|
+
}) {
|
|
21494
21523
|
const x0 = node.cx - node.w / 2;
|
|
21495
21524
|
const y0 = node.cy - node.h / 2;
|
|
21496
|
-
const mindData = node.mindData;
|
|
21525
|
+
const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
|
|
21497
21526
|
if (!mindData) return /* @__PURE__ */ jsx("g", { transform: `translate(${x0} ${y0})` });
|
|
21498
21527
|
const PAD = 40;
|
|
21499
21528
|
const canvasCx = node.w / 2;
|
|
@@ -21529,7 +21558,7 @@ function MindMapNode({ node, active }) {
|
|
|
21529
21558
|
},
|
|
21530
21559
|
`edge-${i}`
|
|
21531
21560
|
)),
|
|
21532
|
-
layout2.nodes.map((n) => /* @__PURE__ */ jsxs("g", { children: [
|
|
21561
|
+
layout2.nodes.map((n) => /* @__PURE__ */ jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
|
|
21533
21562
|
/* @__PURE__ */ jsx(
|
|
21534
21563
|
"rect",
|
|
21535
21564
|
{
|
|
@@ -21570,7 +21599,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
21570
21599
|
y: cy,
|
|
21571
21600
|
w: rootW,
|
|
21572
21601
|
h: rootH,
|
|
21573
|
-
isRoot: true
|
|
21602
|
+
isRoot: true,
|
|
21603
|
+
...mindData.unresolved ? { unresolved: true } : {}
|
|
21574
21604
|
});
|
|
21575
21605
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
21576
21606
|
for (const br of mindData.branches) {
|
|
@@ -21673,7 +21703,17 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
21673
21703
|
);
|
|
21674
21704
|
y = (ys[0] + ys[ys.length - 1]) / 2;
|
|
21675
21705
|
}
|
|
21676
|
-
nodes.push({
|
|
21706
|
+
nodes.push({
|
|
21707
|
+
id: node.id,
|
|
21708
|
+
title: node.title,
|
|
21709
|
+
x,
|
|
21710
|
+
y,
|
|
21711
|
+
w,
|
|
21712
|
+
h,
|
|
21713
|
+
tone: myTone,
|
|
21714
|
+
isRoot: false,
|
|
21715
|
+
...node.unresolved ? { unresolved: true } : {}
|
|
21716
|
+
});
|
|
21677
21717
|
nodePos.set(node.id, { x, y });
|
|
21678
21718
|
nodeSide.set(node.id, isLeft ? "left" : "right");
|
|
21679
21719
|
nodeHalfW.set(node.id, w / 2);
|
|
@@ -21993,10 +22033,14 @@ function QuadrantNode({
|
|
|
21993
22033
|
})
|
|
21994
22034
|
] });
|
|
21995
22035
|
}
|
|
21996
|
-
function TreeNode({
|
|
22036
|
+
function TreeNode({
|
|
22037
|
+
node,
|
|
22038
|
+
active,
|
|
22039
|
+
stateValues = {}
|
|
22040
|
+
}) {
|
|
21997
22041
|
const x0 = node.cx - node.w / 2;
|
|
21998
22042
|
const y0 = node.cy - node.h / 2;
|
|
21999
|
-
const treeNodes = node.treeData ?? [];
|
|
22043
|
+
const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
|
|
22000
22044
|
const gradientId = `tree-root-grad-${node.id}`;
|
|
22001
22045
|
const PAD_TOP = 40;
|
|
22002
22046
|
const PAD_RIGHT = 24;
|
|
@@ -22051,60 +22095,68 @@ function TreeNode({ node, active }) {
|
|
|
22051
22095
|
layout2.nodes.map((n) => {
|
|
22052
22096
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
22053
22097
|
const isRoot = n.depth === 0;
|
|
22054
|
-
return /* @__PURE__ */ jsx(
|
|
22055
|
-
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
|
|
22061
|
-
|
|
22062
|
-
|
|
22063
|
-
|
|
22064
|
-
|
|
22065
|
-
|
|
22066
|
-
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
|
|
22081
|
-
|
|
22082
|
-
|
|
22083
|
-
|
|
22084
|
-
|
|
22085
|
-
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
|
|
22091
|
-
|
|
22092
|
-
|
|
22093
|
-
|
|
22094
|
-
|
|
22095
|
-
|
|
22096
|
-
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
y: n.h
|
|
22100
|
-
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
|
|
22104
|
-
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
22098
|
+
return /* @__PURE__ */ jsx(
|
|
22099
|
+
"g",
|
|
22100
|
+
{
|
|
22101
|
+
"data-cdl-unresolved": n.unresolved ? "true" : void 0,
|
|
22102
|
+
transform: `translate(${PAD_LEFT + n.x - n.w / 2} ${PAD_TOP + n.y - n.h / 2})`,
|
|
22103
|
+
children: isRoot ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22104
|
+
/* @__PURE__ */ jsx(
|
|
22105
|
+
"rect",
|
|
22106
|
+
{
|
|
22107
|
+
"data-cdl-role": "tree-node",
|
|
22108
|
+
x: 0,
|
|
22109
|
+
y: 0,
|
|
22110
|
+
width: n.w,
|
|
22111
|
+
height: n.h,
|
|
22112
|
+
rx: 12,
|
|
22113
|
+
fill: `url(#${gradientId})`
|
|
22114
|
+
}
|
|
22115
|
+
),
|
|
22116
|
+
/* @__PURE__ */ jsx(
|
|
22117
|
+
"text",
|
|
22118
|
+
{
|
|
22119
|
+
x: n.w / 2,
|
|
22120
|
+
y: n.h / 2 + 5,
|
|
22121
|
+
fontSize: 13,
|
|
22122
|
+
fontWeight: 700,
|
|
22123
|
+
textAnchor: "middle",
|
|
22124
|
+
fill: "var(--cdl-text-on-tone, #ffffff)",
|
|
22125
|
+
children: n.title
|
|
22126
|
+
}
|
|
22127
|
+
)
|
|
22128
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22129
|
+
/* @__PURE__ */ jsx(
|
|
22130
|
+
"rect",
|
|
22131
|
+
{
|
|
22132
|
+
"data-cdl-role": "tree-node",
|
|
22133
|
+
x: 0,
|
|
22134
|
+
y: 0,
|
|
22135
|
+
width: n.w,
|
|
22136
|
+
height: n.h,
|
|
22137
|
+
rx: 9,
|
|
22138
|
+
fill: "var(--cdl-chip-fill, #f4f6fb)",
|
|
22139
|
+
stroke: accent,
|
|
22140
|
+
strokeWidth: 1.5
|
|
22141
|
+
}
|
|
22142
|
+
),
|
|
22143
|
+
/* @__PURE__ */ jsx("rect", { x: 0, y: 0, width: 4, height: n.h, rx: 2, fill: accent }),
|
|
22144
|
+
/* @__PURE__ */ jsx(
|
|
22145
|
+
"text",
|
|
22146
|
+
{
|
|
22147
|
+
x: n.w / 2 + 2,
|
|
22148
|
+
y: n.h / 2 + 4,
|
|
22149
|
+
fontSize: 12,
|
|
22150
|
+
fontWeight: 600,
|
|
22151
|
+
textAnchor: "middle",
|
|
22152
|
+
fill: "var(--cdl-chip-text, #1a1f2a)",
|
|
22153
|
+
children: n.title
|
|
22154
|
+
}
|
|
22155
|
+
)
|
|
22156
|
+
] })
|
|
22157
|
+
},
|
|
22158
|
+
`n-${n.id}`
|
|
22159
|
+
);
|
|
22108
22160
|
})
|
|
22109
22161
|
] });
|
|
22110
22162
|
}
|
|
@@ -22167,7 +22219,16 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
22167
22219
|
}
|
|
22168
22220
|
const y = depth * depthGap + depthGap / 2;
|
|
22169
22221
|
posOf.set(n.id, { x, y });
|
|
22170
|
-
nodes.push({
|
|
22222
|
+
nodes.push({
|
|
22223
|
+
id: n.id,
|
|
22224
|
+
title: n.title,
|
|
22225
|
+
x,
|
|
22226
|
+
y,
|
|
22227
|
+
w: nodeW,
|
|
22228
|
+
h: nodeH,
|
|
22229
|
+
depth,
|
|
22230
|
+
...n.unresolved ? { unresolved: true } : {}
|
|
22231
|
+
});
|
|
22171
22232
|
return x;
|
|
22172
22233
|
};
|
|
22173
22234
|
for (const r of roots) if (!placed.has(r.id)) place(r, 0);
|
|
@@ -26316,9 +26377,10 @@ function CdlNodeView({
|
|
|
26316
26377
|
return /* @__PURE__ */ jsx(EventNode, { node: resolvedNode, active, progress });
|
|
26317
26378
|
case "card":
|
|
26318
26379
|
return /* @__PURE__ */ jsx(CardNode, { node: resolvedNode, active });
|
|
26319
|
-
// 図表
|
|
26320
|
-
// (`render/payload-binding.ts` が描画直前に解決する)。
|
|
26321
|
-
//
|
|
26380
|
+
// 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
|
|
26381
|
+
// (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
|
|
26382
|
+
// 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
|
|
26383
|
+
// 親子の繋がりと、描かれない欄 (補足) は解決しない。
|
|
26322
26384
|
case "chart-line":
|
|
26323
26385
|
return /* @__PURE__ */ jsx(ChartLineNode, { node: resolvedNode, active, stateValues });
|
|
26324
26386
|
case "chart-pie":
|
|
@@ -26328,13 +26390,13 @@ function CdlNodeView({
|
|
|
26328
26390
|
case "gantt-timeline":
|
|
26329
26391
|
return /* @__PURE__ */ jsx(GanttNode, { node: resolvedNode, active, stateValues });
|
|
26330
26392
|
case "mind-map":
|
|
26331
|
-
return /* @__PURE__ */ jsx(MindMapNode, { node: resolvedNode, active });
|
|
26393
|
+
return /* @__PURE__ */ jsx(MindMapNode, { node: resolvedNode, active, stateValues });
|
|
26332
26394
|
case "funnel-stages":
|
|
26333
26395
|
return /* @__PURE__ */ jsx(FunnelNode, { node: resolvedNode, active, stateValues });
|
|
26334
26396
|
case "quadrant-matrix":
|
|
26335
26397
|
return /* @__PURE__ */ jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
|
|
26336
26398
|
case "tree-hierarchy":
|
|
26337
|
-
return /* @__PURE__ */ jsx(TreeNode, { node: resolvedNode, active });
|
|
26399
|
+
return /* @__PURE__ */ jsx(TreeNode, { node: resolvedNode, active, stateValues });
|
|
26338
26400
|
case "journey-map":
|
|
26339
26401
|
return /* @__PURE__ */ jsx(UserJourneyNode, { node: resolvedNode, active, stateValues });
|
|
26340
26402
|
case "shape-file":
|
|
@@ -28048,6 +28110,6 @@ function slugify(s) {
|
|
|
28048
28110
|
return s.toLowerCase().replace(/[^a-z0-9-ゟ゠-ヿ一-龯]+/g, "-").replace(/^-|-$/g, "");
|
|
28049
28111
|
}
|
|
28050
28112
|
|
|
28051
|
-
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDiagramThumbnail, CdlDiagramView, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, EDGE_LABEL_TEXT, EDGE_STUB_OUT, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, NODE_KINDS, ROW_GAP_VARIANCE_TOL, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, TARGET_LABEL_PATH_DIST, TONES, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeEventBindingKey, computeFormulaKey, computeInputSignalKey, computeScrollProgress, computeScrollTriggerKey, computeViewportScale, computed, countEdgeCrossings, createFormulaComputeds, createInputSignals, createInteractiveSignalsAccessor, createScrollProgressHandle, createScrollProgressSignals, diagram, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, hasInteractivePrimitives, infrastructure, inputDefaultValue, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, parseFormula, pointRectEdgeDistance, pointToSegmentDistance2 as pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect2 as segmentsIntersect, sequence, signal, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
|
|
28113
|
+
export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDiagramThumbnail, CdlDiagramView, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, EDGE_LABEL_TEXT, EDGE_STUB_OUT, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, NODE_KINDS, ROW_GAP_VARIANCE_TOL, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, TARGET_LABEL_PATH_DIST, TONES, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeEventBindingKey, computeFormulaKey, computeInputSignalKey, computeScrollProgress, computeScrollTriggerKey, computeStateValues, computeViewportScale, computed, countEdgeCrossings, createFormulaComputeds, createInputSignals, createInteractiveSignalsAccessor, createScrollProgressHandle, createScrollProgressSignals, diagram, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, hasInteractivePrimitives, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, parseFormula, pointRectEdgeDistance, pointToSegmentDistance2 as pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect2 as segmentsIntersect, sequence, signal, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
|
|
28052
28114
|
//# sourceMappingURL=index.js.map
|
|
28053
28115
|
//# sourceMappingURL=index.js.map
|