@cardenelabs/cdl 0.17.1 → 0.18.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/react.cjs CHANGED
@@ -4037,6 +4037,8 @@ function layout(diag) {
4037
4037
  states: diag.states,
4038
4038
  phases: diag.phases,
4039
4039
  ...diag.derived ? { derived: diag.derived } : {},
4040
+ // 矢印をいつ出すか (#582)。 描き手が読む欄なので、そのまま持ち越す
4041
+ ...diag.edgeReveal ? { edgeReveal: diag.edgeReveal } : {},
4040
4042
  bboxes,
4041
4043
  collisions,
4042
4044
  nearCollisions,
@@ -4194,6 +4196,7 @@ var EDGE_HEADS = [
4194
4196
  ];
4195
4197
  var EDGE_HEAD_FILL_DEFAULT = "solid";
4196
4198
  var EDGE_HEAD_FILLS = ["solid", "hollow"];
4199
+ var EDGE_REVEAL_DEFAULT = "phase";
4197
4200
 
4198
4201
  // src/formula/evaluator.ts
4199
4202
  function evaluate(ast, ctxOrResolver) {
@@ -14197,6 +14200,19 @@ function CdlStage({
14197
14200
  svgRef
14198
14201
  }) {
14199
14202
  const activeSet = new Set(currentPhase?.activate ?? []);
14203
+ const \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370 = react.useMemo(() => {
14204
+ if ((laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) === "all") return () => true;
14205
+ const \u521D\u51FA = /* @__PURE__ */ new Map();
14206
+ laid.phases.forEach((p, i) => {
14207
+ for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
14208
+ });
14209
+ const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
14210
+ return (edgeId) => {
14211
+ const first = \u521D\u51FA.get(edgeId);
14212
+ if (first === void 0) return true;
14213
+ return \u4ECA < 0 || \u4ECA >= first;
14214
+ };
14215
+ }, [laid.phases, currentPhase]);
14200
14216
  const drawSet = new Set(currentPhase?.draw ?? []);
14201
14217
  const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
14202
14218
  const { lifelineStarts, uniformFooterTop } = react.useMemo(() => {
@@ -14356,7 +14372,7 @@ function CdlStage({
14356
14372
  },
14357
14373
  lane.id
14358
14374
  )),
14359
- laid.edges.map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeView, { edge, active: activeSet.has(edge.id), progress, stateValues }, edge.id)),
14375
+ laid.edges.filter((edge) => \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeView, { edge, active: activeSet.has(edge.id), progress, stateValues }, edge.id)),
14360
14376
  laid.nodes.map((node) => {
14361
14377
  const \u63CF\u304F = drawSet.has(node.id);
14362
14378
  const view = /* @__PURE__ */ jsxRuntime.jsx(
@@ -14372,8 +14388,8 @@ function CdlStage({
14372
14388
  );
14373
14389
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: view }, node.id);
14374
14390
  }),
14375
- laid.edges.filter((edge) => Boolean(edge.dThrough)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
14376
- laid.edges.map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
14391
+ laid.edges.filter((edge) => Boolean(edge.dThrough) && \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
14392
+ laid.edges.filter((edge) => \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
14377
14393
  CdlEdgeLabelView,
14378
14394
  {
14379
14395
  edge,