@cardenelabs/cdl 0.18.0 → 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.js CHANGED
@@ -21272,6 +21272,7 @@ function labelTextOpacity(line) {
21272
21272
  function CdlEdgeView({
21273
21273
  edge,
21274
21274
  active,
21275
+ drawing,
21275
21276
  progress,
21276
21277
  stateValues
21277
21278
  }) {
@@ -21296,6 +21297,7 @@ function CdlEdgeView({
21296
21297
  "data-cdl-from": edge.from,
21297
21298
  "data-cdl-to": edge.to,
21298
21299
  "data-cdl-active": active ? "true" : "false",
21300
+ "data-cdl-drawing": drawing ? "true" : "false",
21299
21301
  "data-cdl-path-d": edge.d,
21300
21302
  "data-cdl-label-x": edge.labelX,
21301
21303
  "data-cdl-label-y": edge.labelY,
@@ -21327,6 +21329,7 @@ function CdlEdgeView({
21327
21329
  {
21328
21330
  edge,
21329
21331
  active,
21332
+ drawing,
21330
21333
  progress,
21331
21334
  color,
21332
21335
  marker,
@@ -21354,6 +21357,7 @@ function CdlEdgeView({
21354
21357
  function SolidEdgePath({
21355
21358
  edge,
21356
21359
  active,
21360
+ drawing,
21357
21361
  progress,
21358
21362
  color,
21359
21363
  marker,
@@ -21361,7 +21365,7 @@ function SolidEdgePath({
21361
21365
  dashed,
21362
21366
  stateValues
21363
21367
  }) {
21364
- const visibleD = active ? pathSubpath(edge.d, progress) : edge.d;
21368
+ const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
21365
21369
  const defaultWidth = active ? 5 : 2.5;
21366
21370
  const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
21367
21371
  const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
@@ -28805,19 +28809,36 @@ function CdlStage({
28805
28809
  svgRef
28806
28810
  }) {
28807
28811
  const activeSet = new Set(currentPhase?.activate ?? []);
28808
- const \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370 = useMemo(() => {
28809
- if ((laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) === "all") return () => true;
28812
+ const \u77E2\u5370\u306E\u51FA\u756A = useMemo(() => {
28810
28813
  const \u521D\u51FA = /* @__PURE__ */ new Map();
28811
28814
  laid.phases.forEach((p, i) => {
28812
28815
  for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
28813
28816
  });
28814
28817
  const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
28815
- return (edgeId) => {
28816
- const first = \u521D\u51FA.get(edgeId);
28817
- if (first === void 0) return true;
28818
- return \u4ECA < 0 || \u4ECA >= first;
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
+ }
28819
28840
  };
28820
- }, [laid.phases, currentPhase]);
28841
+ }, [laid.phases, currentPhase, laid.edgeReveal]);
28821
28842
  const drawSet = new Set(currentPhase?.draw ?? []);
28822
28843
  const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
28823
28844
  const { lifelineStarts, uniformFooterTop } = useMemo(() => {
@@ -28977,7 +28998,17 @@ function CdlStage({
28977
28998
  },
28978
28999
  lane.id
28979
29000
  )),
28980
- laid.edges.filter((edge) => \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).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
+ )),
28981
29012
  laid.nodes.map((node) => {
28982
29013
  const \u63CF\u304F = drawSet.has(node.id);
28983
29014
  const view = /* @__PURE__ */ jsx(
@@ -28993,8 +29024,8 @@ function CdlStage({
28993
29024
  );
28994
29025
  return /* @__PURE__ */ jsx("g", { children: view }, node.id);
28995
29026
  }),
28996
- laid.edges.filter((edge) => Boolean(edge.dThrough) && \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
28997
- laid.edges.filter((edge) => \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).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(
28998
29029
  CdlEdgeLabelView,
28999
29030
  {
29000
29031
  edge,