@cardenelabs/dragon 0.9.0 → 0.11.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 CHANGED
@@ -2088,6 +2088,9 @@ function ensureAnimate(a, lineNo) {
2088
2088
  if (a) return a;
2089
2089
  return { states: [], phases: [], pos: { line: lineNo } };
2090
2090
  }
2091
+ var PHASE_ITEM_WORDS = ["focus", "badge", "body", "description", "tween", "set", "draw"];
2092
+ var \u6BB5\u306E\u9805\u76EE\u306E\u82F1\u8A9E = PHASE_ITEM_WORDS;
2093
+ var \u6BB5\u306E\u9805\u76EE\u306E\u96C6\u5408 = new Set(PHASE_ITEM_WORDS);
2091
2094
  function parsePhase(block, errors) {
2092
2095
  const head = block[0];
2093
2096
  const m = head.trimmed.match(/^step\s*:\s*(.+)$/);
@@ -2128,6 +2131,15 @@ function parsePhase(block, errors) {
2128
2131
  }
2129
2132
  const key = (propMatch[1] ?? "").toLowerCase();
2130
2133
  const value = (propMatch[2] ?? "").trim();
2134
+ if (!\u6BB5\u306E\u9805\u76EE\u306E\u96C6\u5408.has(key)) {
2135
+ errors.push({
2136
+ line: ln.no,
2137
+ message: `\u6BB5\u306E\u9805\u76EE\u540D\u304C\u8AAD\u3081\u307E\u305B\u3093: "${propMatch[1] ?? ""}"`,
2138
+ hint: \u6BB5\u306E\u9805\u76EE\u306E\u30D2\u30F3\u30C8(propMatch[1] ?? "")
2139
+ });
2140
+ i += 1;
2141
+ continue;
2142
+ }
2131
2143
  if (key === "focus") {
2132
2144
  phase.highlight = parseFocusList(value);
2133
2145
  i += 1;
@@ -2221,11 +2233,15 @@ function \u6BB5\u306E\u9805\u76EE\u306E\u30D2\u30F3\u30C8(\u66F8\u3044\u305F\u54
2221
2233
  const \u82F1\u8A9E = \u6BB5\u306E\u9805\u76EE\u306E\u65E5\u672C\u8A9E[\u66F8\u3044\u305F\u540D\u524D];
2222
2234
  return \u82F1\u8A9E !== void 0 ? `v0.5 \u3067\u306F\u82F1\u8A9E\u3067\u66F8\u304F (\`${\u82F1\u8A9E}\`)` : `\u4F7F\u3048\u308B\u9805\u76EE = ${\u6BB5\u306E\u9805\u76EE\u306E\u82F1\u8A9E.join(", ")}`;
2223
2235
  }
2224
- var \u6BB5\u306E\u9805\u76EE\u306E\u82F1\u8A9E = ["focus", "badge", "body", "description", "tween", "set", "draw"];
2225
2236
  var DRAW_TARGETS = /* @__PURE__ */ new Map([
2226
2237
  ["line", "line"],
2227
2238
  ["bar", "bar"],
2228
- ["pie", "pie"]
2239
+ ["pie", "pie"],
2240
+ ["journey", "journey"],
2241
+ ["mind", "mind"],
2242
+ ["tree", "tree"],
2243
+ ["gantt", "gantt"],
2244
+ ["funnel", "funnel"]
2229
2245
  ]);
2230
2246
  var DRAW_WORDS = new Set(DRAW_TARGETS.keys());
2231
2247
  var \u6BB5\u306E\u9805\u76EE\u306E\u65E5\u672C\u8A9E = {
@@ -4980,7 +4996,7 @@ function compileTree(doc, onNotice) {
4980
4996
  const data = doc.actors.map((a) => {
4981
4997
  const id = slugify(a.name);
4982
4998
  const p3 = \u89AA.get(id);
4983
- return { id, title: a.name, ...p3 !== void 0 ? { parent: p3 } : {} };
4999
+ return { id, ...\u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a), ...p3 !== void 0 ? { parent: p3 } : {} };
4984
5000
  });
4985
5001
  b.node(`${slugify(doc.title)}-chart`, {
4986
5002
  lane: "chart",
@@ -5245,7 +5261,7 @@ function \u653E\u5C04\u3067\u63CF\u3051\u306A\u3044\u6B04\u3092\u66F8\u3044\u305
5245
5261
  }
5246
5262
  function \u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a) {
5247
5263
  const \u7D9A\u304D = [a.subtitle, a.value].map((x) => x?.trim()).filter((x) => !!x);
5248
- return \u7D9A\u304D.length > 0 ? `${a.name} ${\u7D9A\u304D.join(" ")}` : a.name;
5264
+ return { title: a.name, ...\u7D9A\u304D.length > 0 ? { subtitle: \u7D9A\u304D.join(" ") } : {} };
5249
5265
  }
5250
5266
  function compileMind(doc, onNotice) {
5251
5267
  const b = cdl.diagram(slugify(doc.title), { topic: doc.title });
@@ -5337,7 +5353,7 @@ function compileMind(doc, onNotice) {
5337
5353
  \u8A18\u9332\u3059\u308B(a);
5338
5354
  branches.push({
5339
5355
  id,
5340
- title: \u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a),
5356
+ ...\u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a),
5341
5357
  parent: \u89AA.get(id) ?? rootId,
5342
5358
  ...a.tone ? { tone: a.tone } : {}
5343
5359
  });
@@ -5358,7 +5374,15 @@ function compileMind(doc, onNotice) {
5358
5374
  ...\u56F3\u306E\u5C0F\u898B\u51FA\u3057(doc),
5359
5375
  w: W,
5360
5376
  h: H,
5361
- mindData: { rootId, rootTitle: \u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(root), branches }
5377
+ mindData: (() => {
5378
+ const \u4E2D\u5FC3 = \u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(root);
5379
+ return {
5380
+ rootId,
5381
+ rootTitle: \u4E2D\u5FC3.title,
5382
+ ...\u4E2D\u5FC3.subtitle === void 0 ? {} : { rootSubtitle: \u4E2D\u5FC3.subtitle },
5383
+ branches
5384
+ };
5385
+ })()
5362
5386
  });
5363
5387
  return b.build();
5364
5388
  }
@@ -7905,8 +7929,8 @@ var diagram_default = {
7905
7929
  },
7906
7930
  draw: {
7907
7931
  type: "string",
7908
- enum: ["line", "bar", "pie"],
7909
- description: "\u3053\u306E phase \u3067\u8D77\u70B9\u304B\u3089\u63CF\u304F\u3082\u306E\u3002 \u8A9E\u306F\u56F3\u7A2E\u3068\u63C3\u3048\u308B\u3002 line = \u6298\u308C\u7DDA\u304C\u5DE6\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / bar = \u68D2\u304C\u6A2A\u8EF8\u304B\u3089\u4E0A\u3078\u4F38\u3073\u308B / pie = \u6247\u304C 12 \u6642\u304B\u3089\u6642\u8A08\u56DE\u308A\u306B\u958B\u304F"
7932
+ enum: ["line", "bar", "pie", "journey", "mind", "tree", "gantt", "funnel"],
7933
+ description: "\u3053\u306E phase \u3067\u8D77\u70B9\u304B\u3089\u63CF\u304F\u3082\u306E\u3002 \u8A9E\u306F\u56F3\u7A2E\u3068\u63C3\u3048\u308B\u3002 line / journey = \u7DDA\u304C\u5DE6\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / bar = \u68D2\u304C\u6A2A\u8EF8\u304B\u3089\u4E0A\u3078\u4F38\u3073\u308B / pie = \u6247\u304C 12 \u6642\u304B\u3089\u6642\u8A08\u56DE\u308A\u306B\u958B\u304F / mind = \u679D\u304C\u4E2D\u5FC3\u304B\u3089\u5916\u3078\u4F38\u3073\u308B / tree = \u679D\u304C\u6839\u304B\u3089\u4E0B\u3078\u4F38\u3073\u308B / gantt = \u5E2F\u304C\u5404\u59CB\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / funnel = \u6BB5\u304C\u4E0A\u7AEF\u304B\u3089\u9806\u306B\u7A4D\u307E\u308C\u308B"
7910
7934
  },
7911
7935
  tween: {
7912
7936
  type: "object",
@@ -8122,6 +8146,7 @@ exports.MAX_INPUT_ELEMENTS = MAX_INPUT_ELEMENTS;
8122
8146
  exports.MAX_PART_SCALE = MAX_PART_SCALE;
8123
8147
  exports.NODE_KIND_ALIAS = NODE_KIND_ALIAS;
8124
8148
  exports.NODE_KIND_VALID = NODE_KIND_VALID;
8149
+ exports.PHASE_ITEM_WORDS = PHASE_ITEM_WORDS;
8125
8150
  exports.PRESET_TYPES = PRESET_TYPES;
8126
8151
  exports.RELATIVE_GAP_DEFAULT = RELATIVE_GAP_DEFAULT;
8127
8152
  exports.TONE_ALIAS = TONE_ALIAS;