@cardenelabs/dragon 0.10.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 +25 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/compile.ts +23 -15
- package/src/index.ts +1 -1
- package/src/v05/parser.ts +25 -5
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,7 +2233,6 @@ 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"],
|
|
@@ -4985,7 +4996,7 @@ function compileTree(doc, onNotice) {
|
|
|
4985
4996
|
const data = doc.actors.map((a) => {
|
|
4986
4997
|
const id = slugify(a.name);
|
|
4987
4998
|
const p3 = \u89AA.get(id);
|
|
4988
|
-
return { id,
|
|
4999
|
+
return { id, ...\u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a), ...p3 !== void 0 ? { parent: p3 } : {} };
|
|
4989
5000
|
});
|
|
4990
5001
|
b.node(`${slugify(doc.title)}-chart`, {
|
|
4991
5002
|
lane: "chart",
|
|
@@ -5250,7 +5261,7 @@ function \u653E\u5C04\u3067\u63CF\u3051\u306A\u3044\u6B04\u3092\u66F8\u3044\u305
|
|
|
5250
5261
|
}
|
|
5251
5262
|
function \u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a) {
|
|
5252
5263
|
const \u7D9A\u304D = [a.subtitle, a.value].map((x) => x?.trim()).filter((x) => !!x);
|
|
5253
|
-
return
|
|
5264
|
+
return { title: a.name, ...\u7D9A\u304D.length > 0 ? { subtitle: \u7D9A\u304D.join(" ") } : {} };
|
|
5254
5265
|
}
|
|
5255
5266
|
function compileMind(doc, onNotice) {
|
|
5256
5267
|
const b = cdl.diagram(slugify(doc.title), { topic: doc.title });
|
|
@@ -5342,7 +5353,7 @@ function compileMind(doc, onNotice) {
|
|
|
5342
5353
|
\u8A18\u9332\u3059\u308B(a);
|
|
5343
5354
|
branches.push({
|
|
5344
5355
|
id,
|
|
5345
|
-
|
|
5356
|
+
...\u653E\u5C04\u306B\u51FA\u3059\u6587\u5B57(a),
|
|
5346
5357
|
parent: \u89AA.get(id) ?? rootId,
|
|
5347
5358
|
...a.tone ? { tone: a.tone } : {}
|
|
5348
5359
|
});
|
|
@@ -5363,7 +5374,15 @@ function compileMind(doc, onNotice) {
|
|
|
5363
5374
|
...\u56F3\u306E\u5C0F\u898B\u51FA\u3057(doc),
|
|
5364
5375
|
w: W,
|
|
5365
5376
|
h: H,
|
|
5366
|
-
mindData:
|
|
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
|
+
})()
|
|
5367
5386
|
});
|
|
5368
5387
|
return b.build();
|
|
5369
5388
|
}
|
|
@@ -8127,6 +8146,7 @@ exports.MAX_INPUT_ELEMENTS = MAX_INPUT_ELEMENTS;
|
|
|
8127
8146
|
exports.MAX_PART_SCALE = MAX_PART_SCALE;
|
|
8128
8147
|
exports.NODE_KIND_ALIAS = NODE_KIND_ALIAS;
|
|
8129
8148
|
exports.NODE_KIND_VALID = NODE_KIND_VALID;
|
|
8149
|
+
exports.PHASE_ITEM_WORDS = PHASE_ITEM_WORDS;
|
|
8130
8150
|
exports.PRESET_TYPES = PRESET_TYPES;
|
|
8131
8151
|
exports.RELATIVE_GAP_DEFAULT = RELATIVE_GAP_DEFAULT;
|
|
8132
8152
|
exports.TONE_ALIAS = TONE_ALIAS;
|