@cardenelabs/cdl 0.17.1 → 0.18.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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as EdgeHead, f as EdgeHeadFill, g as CdlState, h as CdlEventTarget, i as Computed, j as CdlDerivedValue, k as CdlScrollTrigger, L as LaidDiagram, l as CdlDiagramViewProps, m as LaidEdge, n as LaidNode, o as CdlEdge, B as BBox, R as RowMark, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-Dc5Pdf7e.cjs';
2
- export { p as CdlDiagramView, q as CdlEventBinding, r as CdlEventKind, s as CdlFormula, t as CdlPhase, u as EDGE_HEADS, v as EDGE_HEAD_DEFAULT, w as EDGE_HEAD_FILLS, x as EDGE_HEAD_FILL_DEFAULT, y as EDGE_STYLES, I as InteractiveHandlerMap, z as InteractiveSignalsAccessor, A as LaidLane, D as NODE_KINDS, F as ScrollProgressHandle, G as TONES, H as computeEventBindingKey, K as computeFormulaKey, M as computeInputSignalKey, O as computeScrollTriggerKey, P as computed, U as createInteractiveSignalsAccessor, V as createScrollProgressHandle, W as createScrollProgressSignals, X as hasInteractivePrimitives, Y as sequenceBoardMetrics, Z as sequenceStepId, _ as signal } from './render-Dc5Pdf7e.cjs';
1
+ import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as EdgeHead, f as EdgeHeadFill, g as CdlState, h as CdlEventTarget, i as Computed, j as CdlDerivedValue, k as CdlScrollTrigger, L as LaidDiagram, l as CdlDiagramViewProps, m as LaidEdge, n as LaidNode, o as CdlEdge, B as BBox, R as RowMark, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-Czv0tUon.cjs';
2
+ export { p as CdlDiagramView, q as CdlEventBinding, r as CdlEventKind, s as CdlFormula, t as CdlPhase, u as EDGE_HEADS, v as EDGE_HEAD_DEFAULT, w as EDGE_HEAD_FILLS, x as EDGE_HEAD_FILL_DEFAULT, y as EDGE_REVEALS, z as EDGE_REVEAL_DEFAULT, A as EDGE_STYLES, D as EdgeReveal, I as InteractiveHandlerMap, F as InteractiveSignalsAccessor, G as LaidLane, H as NODE_KINDS, K as ScrollProgressHandle, M as TONES, O as computeEventBindingKey, P as computeFormulaKey, U as computeInputSignalKey, V as computeScrollTriggerKey, W as computed, X as createInteractiveSignalsAccessor, Y as createScrollProgressHandle, Z as createScrollProgressSignals, _ as hasInteractivePrimitives, $ as sequenceBoardMetrics, a0 as sequenceStepId, a1 as signal } from './render-Czv0tUon.cjs';
3
3
  import { JSX } from 'react';
4
4
 
5
5
  declare function effect(fn: () => void | (() => void)): () => void;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as EdgeHead, f as EdgeHeadFill, g as CdlState, h as CdlEventTarget, i as Computed, j as CdlDerivedValue, k as CdlScrollTrigger, L as LaidDiagram, l as CdlDiagramViewProps, m as LaidEdge, n as LaidNode, o as CdlEdge, B as BBox, R as RowMark, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-Dc5Pdf7e.js';
2
- export { p as CdlDiagramView, q as CdlEventBinding, r as CdlEventKind, s as CdlFormula, t as CdlPhase, u as EDGE_HEADS, v as EDGE_HEAD_DEFAULT, w as EDGE_HEAD_FILLS, x as EDGE_HEAD_FILL_DEFAULT, y as EDGE_STYLES, I as InteractiveHandlerMap, z as InteractiveSignalsAccessor, A as LaidLane, D as NODE_KINDS, F as ScrollProgressHandle, G as TONES, H as computeEventBindingKey, K as computeFormulaKey, M as computeInputSignalKey, O as computeScrollTriggerKey, P as computed, U as createInteractiveSignalsAccessor, V as createScrollProgressHandle, W as createScrollProgressSignals, X as hasInteractivePrimitives, Y as sequenceBoardMetrics, Z as sequenceStepId, _ as signal } from './render-Dc5Pdf7e.js';
1
+ import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as EdgeHead, f as EdgeHeadFill, g as CdlState, h as CdlEventTarget, i as Computed, j as CdlDerivedValue, k as CdlScrollTrigger, L as LaidDiagram, l as CdlDiagramViewProps, m as LaidEdge, n as LaidNode, o as CdlEdge, B as BBox, R as RowMark, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-Czv0tUon.js';
2
+ export { p as CdlDiagramView, q as CdlEventBinding, r as CdlEventKind, s as CdlFormula, t as CdlPhase, u as EDGE_HEADS, v as EDGE_HEAD_DEFAULT, w as EDGE_HEAD_FILLS, x as EDGE_HEAD_FILL_DEFAULT, y as EDGE_REVEALS, z as EDGE_REVEAL_DEFAULT, A as EDGE_STYLES, D as EdgeReveal, I as InteractiveHandlerMap, F as InteractiveSignalsAccessor, G as LaidLane, H as NODE_KINDS, K as ScrollProgressHandle, M as TONES, O as computeEventBindingKey, P as computeFormulaKey, U as computeInputSignalKey, V as computeScrollTriggerKey, W as computed, X as createInteractiveSignalsAccessor, Y as createScrollProgressHandle, Z as createScrollProgressSignals, _ as hasInteractivePrimitives, $ as sequenceBoardMetrics, a0 as sequenceStepId, a1 as signal } from './render-Czv0tUon.js';
3
3
  import { JSX } from 'react';
4
4
 
5
5
  declare function effect(fn: () => void | (() => void)): () => void;
package/dist/index.js CHANGED
@@ -15371,6 +15371,8 @@ function layout(diag) {
15371
15371
  states: diag.states,
15372
15372
  phases: diag.phases,
15373
15373
  ...diag.derived ? { derived: diag.derived } : {},
15374
+ // 矢印をいつ出すか (#582)。 描き手が読む欄なので、そのまま持ち越す
15375
+ ...diag.edgeReveal ? { edgeReveal: diag.edgeReveal } : {},
15374
15376
  bboxes,
15375
15377
  collisions,
15376
15378
  nearCollisions,
@@ -15529,6 +15531,8 @@ var EDGE_HEADS = [
15529
15531
  ];
15530
15532
  var EDGE_HEAD_FILL_DEFAULT = "solid";
15531
15533
  var EDGE_HEAD_FILLS = ["solid", "hollow"];
15534
+ var EDGE_REVEALS = ["phase", "all"];
15535
+ var EDGE_REVEAL_DEFAULT = "phase";
15532
15536
 
15533
15537
  // src/anim/core/easing.ts
15534
15538
  function cubicBezier(x1, y1, x2, y2) {
@@ -21268,6 +21272,7 @@ function labelTextOpacity(line) {
21268
21272
  function CdlEdgeView({
21269
21273
  edge,
21270
21274
  active,
21275
+ drawing,
21271
21276
  progress,
21272
21277
  stateValues
21273
21278
  }) {
@@ -21292,6 +21297,7 @@ function CdlEdgeView({
21292
21297
  "data-cdl-from": edge.from,
21293
21298
  "data-cdl-to": edge.to,
21294
21299
  "data-cdl-active": active ? "true" : "false",
21300
+ "data-cdl-drawing": drawing ? "true" : "false",
21295
21301
  "data-cdl-path-d": edge.d,
21296
21302
  "data-cdl-label-x": edge.labelX,
21297
21303
  "data-cdl-label-y": edge.labelY,
@@ -21323,6 +21329,7 @@ function CdlEdgeView({
21323
21329
  {
21324
21330
  edge,
21325
21331
  active,
21332
+ drawing,
21326
21333
  progress,
21327
21334
  color,
21328
21335
  marker,
@@ -21350,6 +21357,7 @@ function CdlEdgeView({
21350
21357
  function SolidEdgePath({
21351
21358
  edge,
21352
21359
  active,
21360
+ drawing,
21353
21361
  progress,
21354
21362
  color,
21355
21363
  marker,
@@ -21357,7 +21365,7 @@ function SolidEdgePath({
21357
21365
  dashed,
21358
21366
  stateValues
21359
21367
  }) {
21360
- const visibleD = active ? pathSubpath(edge.d, progress) : edge.d;
21368
+ const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
21361
21369
  const defaultWidth = active ? 5 : 2.5;
21362
21370
  const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
21363
21371
  const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
@@ -28801,6 +28809,36 @@ function CdlStage({
28801
28809
  svgRef
28802
28810
  }) {
28803
28811
  const activeSet = new Set(currentPhase?.activate ?? []);
28812
+ const \u77E2\u5370\u306E\u51FA\u756A = useMemo(() => {
28813
+ const \u521D\u51FA = /* @__PURE__ */ new Map();
28814
+ laid.phases.forEach((p, i) => {
28815
+ for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
28816
+ });
28817
+ const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
28818
+ const \u96A0\u3059 = (laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) !== "all";
28819
+ return {
28820
+ \u51FA\u308B\u304B: (edgeId) => {
28821
+ if (!\u96A0\u3059) return true;
28822
+ const first = \u521D\u51FA.get(edgeId);
28823
+ if (first === void 0) return true;
28824
+ return \u4ECA < 0 || \u4ECA >= first;
28825
+ },
28826
+ /*
28827
+ * この段で初めて出るか (#584)。
28828
+ *
28829
+ * 起点から伸ばすのはこの段だけ。 光っているかで引くと、段をまたいで光り続ける図で
28830
+ * 既に見えている線が毎段引き直される (実測 = 表の図で 3 本とも段が変わるたびに伸び直した)。
28831
+ *
28832
+ * **隠さない図でも初出は数える**。 `all` は「最初から見せる」 だけの指定で、
28833
+ * 伸びる動きまで毎段繰り返してよいという意味ではない。
28834
+ */
28835
+ \u4F38\u3070\u3059\u304B: (edgeId) => {
28836
+ const first = \u521D\u51FA.get(edgeId);
28837
+ if (first === void 0) return false;
28838
+ return \u4ECA === first;
28839
+ }
28840
+ };
28841
+ }, [laid.phases, currentPhase, laid.edgeReveal]);
28804
28842
  const drawSet = new Set(currentPhase?.draw ?? []);
28805
28843
  const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
28806
28844
  const { lifelineStarts, uniformFooterTop } = useMemo(() => {
@@ -28960,7 +28998,17 @@ function CdlStage({
28960
28998
  },
28961
28999
  lane.id
28962
29000
  )),
28963
- laid.edges.map((edge) => /* @__PURE__ */ jsx(CdlEdgeView, { edge, active: activeSet.has(edge.id), progress, stateValues }, edge.id)),
29001
+ laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsx(
29002
+ CdlEdgeView,
29003
+ {
29004
+ edge,
29005
+ active: activeSet.has(edge.id),
29006
+ drawing: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id),
29007
+ progress,
29008
+ stateValues
29009
+ },
29010
+ edge.id
29011
+ )),
28964
29012
  laid.nodes.map((node) => {
28965
29013
  const \u63CF\u304F = drawSet.has(node.id);
28966
29014
  const view = /* @__PURE__ */ jsx(
@@ -28976,8 +29024,8 @@ function CdlStage({
28976
29024
  );
28977
29025
  return /* @__PURE__ */ jsx("g", { children: view }, node.id);
28978
29026
  }),
28979
- laid.edges.filter((edge) => Boolean(edge.dThrough)).map((edge) => /* @__PURE__ */ jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
28980
- laid.edges.map((edge) => /* @__PURE__ */ jsx(
29027
+ laid.edges.filter((edge) => Boolean(edge.dThrough) && \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
29028
+ laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsx(
28981
29029
  CdlEdgeLabelView,
28982
29030
  {
28983
29031
  edge,
@@ -30541,6 +30589,6 @@ function slugify(s) {
30541
30589
  return s.toLowerCase().replace(/[^a-z0-9぀-ゟ゠-ヿ一-龯]+/g, "-").replace(/^-|-$/g, "");
30542
30590
  }
30543
30591
 
30544
- export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLASS_RELATION_LOOK, 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_HEADS, EDGE_HEAD_DEFAULT, EDGE_HEAD_FILLS, EDGE_HEAD_FILL_DEFAULT, EDGE_LABEL_TEXT, EDGE_STUB_OUT, EDGE_STYLES, ER_CARDINALITY_HEAD, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, FSM_ACTION_MARK, 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, SEQUENCE_MESSAGE_LOOK, 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, sequenceBoardMetrics, sequenceStepId, signal, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
30592
+ export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLASS_RELATION_LOOK, 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_HEADS, EDGE_HEAD_DEFAULT, EDGE_HEAD_FILLS, EDGE_HEAD_FILL_DEFAULT, EDGE_LABEL_TEXT, EDGE_REVEALS, EDGE_REVEAL_DEFAULT, EDGE_STUB_OUT, EDGE_STYLES, ER_CARDINALITY_HEAD, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, FSM_ACTION_MARK, 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, SEQUENCE_MESSAGE_LOOK, 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, sequenceBoardMetrics, sequenceStepId, signal, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx };
30545
30593
  //# sourceMappingURL=index.js.map
30546
30594
  //# sourceMappingURL=index.js.map