@cardenelabs/dragon 0.46.3 → 0.47.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.
Files changed (86) hide show
  1. package/README.ja.md +4 -2
  2. package/README.md +4 -2
  3. package/dist/cli.cjs +71 -70
  4. package/dist/cli.cjs.map +1 -1
  5. package/dist/cli.js +71 -70
  6. package/dist/cli.js.map +1 -1
  7. package/dist/export.cjs +13 -10
  8. package/dist/export.cjs.map +1 -1
  9. package/dist/export.d.cts +2 -2
  10. package/dist/export.d.ts +2 -2
  11. package/dist/export.js +13 -10
  12. package/dist/export.js.map +1 -1
  13. package/dist/index.cjs +18 -12
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +5 -5
  16. package/dist/index.d.ts +5 -5
  17. package/dist/index.js +18 -12
  18. package/dist/index.js.map +1 -1
  19. package/dist/{ink-DeDtzaTL.d.cts → ink-Sz5_zWte.d.cts} +1 -1
  20. package/dist/{ink-DeDtzaTL.d.ts → ink-Sz5_zWte.d.ts} +1 -1
  21. package/dist/light/{chunk-YO3UBEC3.js → chunk-AHUJ37R3.js} +4 -3
  22. package/dist/light/chunk-AHUJ37R3.js.map +1 -0
  23. package/dist/light/{chunk-SUL4AJLI.cjs → chunk-KNA5HH2H.cjs} +85 -2
  24. package/dist/light/chunk-KNA5HH2H.cjs.map +1 -0
  25. package/dist/light/{chunk-V34DCH34.cjs → chunk-O7RQ6R54.cjs} +84 -83
  26. package/dist/light/chunk-O7RQ6R54.cjs.map +1 -0
  27. package/dist/light/{chunk-DVGDEPCV.js → chunk-VUVRSYH6.js} +84 -1
  28. package/dist/light/chunk-VUVRSYH6.js.map +1 -0
  29. package/dist/light/{git-WBGFDRBD.cjs → git-M63KYUUK.cjs} +66 -68
  30. package/dist/light/git-M63KYUUK.cjs.map +1 -0
  31. package/dist/light/{git-WEJL6VAY.js → git-NMPPSCRM.js} +4 -6
  32. package/dist/light/{git-WEJL6VAY.js.map → git-NMPPSCRM.js.map} +1 -1
  33. package/dist/light/index.cjs +300 -296
  34. package/dist/light/index.cjs.map +1 -1
  35. package/dist/light/index.d.cts +4 -4
  36. package/dist/light/index.d.ts +4 -4
  37. package/dist/light/index.js +49 -45
  38. package/dist/light/index.js.map +1 -1
  39. package/dist/light/{lineup-WLGNGTFX.cjs → lineup-2VWQ74CU.cjs} +42 -44
  40. package/dist/light/lineup-2VWQ74CU.cjs.map +1 -0
  41. package/dist/light/{lineup-6LN6Z5T2.js → lineup-HZ5YTQ36.js} +4 -6
  42. package/dist/light/{lineup-6LN6Z5T2.js.map → lineup-HZ5YTQ36.js.map} +1 -1
  43. package/dist/light/{state-JVAH4TSM.cjs → state-MFCHMESP.cjs} +42 -44
  44. package/dist/light/state-MFCHMESP.cjs.map +1 -0
  45. package/dist/light/{state-DFYTMQI7.js → state-RRAJPRO3.js} +3 -5
  46. package/dist/light/{state-DFYTMQI7.js.map → state-RRAJPRO3.js.map} +1 -1
  47. package/dist/light/{time-M3EGEFDU.js → time-7V7RUEYS.js} +5 -4
  48. package/dist/light/time-7V7RUEYS.js.map +1 -0
  49. package/dist/light/{time-EXRPI34B.cjs → time-RISQEAB7.cjs} +86 -85
  50. package/dist/light/time-RISQEAB7.cjs.map +1 -0
  51. package/dist/light/{tree-MFU54QKY.js → tree-PWSU7R6R.js} +3 -3
  52. package/dist/light/{tree-DECHTXFU.cjs → tree-S23P2PW7.cjs} +62 -62
  53. package/dist/light/{tree-DECHTXFU.cjs.map → tree-S23P2PW7.cjs.map} +1 -1
  54. package/dist/node.cjs +5 -2
  55. package/dist/node.cjs.map +1 -1
  56. package/dist/node.js +5 -2
  57. package/dist/node.js.map +1 -1
  58. package/dist/player.global.js +3 -3
  59. package/package.json +1 -1
  60. package/src/cli.ts +10 -10
  61. package/src/export/index.ts +3 -3
  62. package/src/figure-text.ts +2 -2
  63. package/src/kinds/registry.ts +2 -2
  64. package/src/layout/time.ts +2 -2
  65. package/src/messages.ts +1 -1
  66. package/src/parser.ts +3 -2
  67. package/src/player.ts +13 -5
  68. package/src/render/draw.ts +4 -4
  69. package/src/render/ink.ts +2 -2
  70. package/src/schema.ts +4 -4
  71. package/src/version.ts +3 -3
  72. package/src/words.ts +6 -0
  73. package/dist/light/chunk-CLS6JVKK.cjs +0 -84
  74. package/dist/light/chunk-CLS6JVKK.cjs.map +0 -1
  75. package/dist/light/chunk-DVGDEPCV.js.map +0 -1
  76. package/dist/light/chunk-SUL4AJLI.cjs.map +0 -1
  77. package/dist/light/chunk-V34DCH34.cjs.map +0 -1
  78. package/dist/light/chunk-YDKPEKGZ.js +0 -84
  79. package/dist/light/chunk-YDKPEKGZ.js.map +0 -1
  80. package/dist/light/chunk-YO3UBEC3.js.map +0 -1
  81. package/dist/light/git-WBGFDRBD.cjs.map +0 -1
  82. package/dist/light/lineup-WLGNGTFX.cjs.map +0 -1
  83. package/dist/light/state-JVAH4TSM.cjs.map +0 -1
  84. package/dist/light/time-EXRPI34B.cjs.map +0 -1
  85. package/dist/light/time-M3EGEFDU.js.map +0 -1
  86. /package/dist/light/{tree-MFU54QKY.js.map → tree-PWSU7R6R.js.map} +0 -0
package/README.ja.md CHANGED
@@ -60,6 +60,8 @@ const player = mountDiagram(host, parsed.diagram);
60
60
  図は同梱の字で測った字の幅で組むため、読み込まないと端末の字で描かれ、札から字がはみ出すことがある。
61
61
  CSS と字の file は、束ねる道具 (Vite など) が頁へ運ぶ。
62
62
  この入口は Node の組み込みの module を読まないため、Next.js の Turbopack のように頁を束ねる道具でもそのまま読める。
63
+ 再生の部品が出す字 (釦の読み上げの名前、全体図の札) は英語で出る。
64
+ 日本語で出すには、`mountDiagram` の 3 つ目の引数に `{ lang: "ja" }` を渡し、誤りの文を日本語にするには `parseNotation` にも渡す。
63
65
  原本の file を今の版へ移す `migrateFile` は、Node でだけ動く入口 `@cardenelabs/dragon/node` から引く。
64
66
 
65
67
  `mountDiagram` が返す `player` で段を動かす (`next`、`prev`、`play`、`pause`、`destroy`)。
@@ -136,7 +138,7 @@ step 出荷に回す
136
138
  ```
137
139
 
138
140
  `parseNotation` は記法を原本の JSON に、`printNotation` は原本の JSON を記法に直す。
139
- 誤りの文の言葉は `parseNotation(text, { lang: "en" })` のように渡した言葉で決まり、渡さなければ日本語になる。
141
+ 誤りの文の言葉は `parseNotation(text, { lang: "ja" })` のように渡した言葉で決まり、渡さなければ英語になる。
140
142
  前の形の記法 (`時系列図` か `構成図` で始まる形) は読まず、その行の新しい形を示す誤りで止まる。
141
143
  前の形と新しい形の対応表は [`CHANGELOG.ja.md`](https://github.com/cardene777/dragon/blob/main/CHANGELOG.ja.md) にある。
142
144
 
@@ -316,7 +318,7 @@ dragon export ccip.json --out out
316
318
  | `--width <px>` | 枠の幅。見せ方 (全体を止める / 寄って追う) を選び、寄って追う窓の幅になる |
317
319
  | `--palette <名前>` | 色味 (`clear` / `paper` / `night`、既定は `paper`) |
318
320
  | `--theme <明暗>` | `light` か `dark` |
319
- | `--lang <言葉>` | 図の中の字 (全体図の札、HTML の読み上げの名前、描けない時の断りの文) と、命令が出す使い方の文と誤りの文の言葉 (`ja` か `en`)。記法の file でも JSON の原本でも、既定は `ja` |
321
+ | `--lang <言葉>` | 図の中の字 (全体図の札、HTML の読み上げの名前、描けない時の断りの文) と、命令が出す使い方の文と誤りの文の言葉 (`ja` か `en`)。記法の file でも JSON の原本でも、既定は `en` |
320
322
  | `--fps <数>` | mp4 の 1 秒のコマの数 (既定 30) |
321
323
  | `--gif-fps <数>` | GIF の 1 秒のコマの数 (既定 10) |
322
324
  | `--format <形>` | 書き出す形を `,` で区切る (既定 `mp4,gif,html,png`) |
package/README.md CHANGED
@@ -58,6 +58,8 @@ The font entry only loads the CSS for the two bundled fonts (Noto Sans JP and Je
58
58
  Diagrams are laid out with character widths measured from the bundled fonts, so without it they are drawn in the device's fonts and text can overflow its labels.
59
59
  A bundler (such as Vite) carries the CSS and font files to the page.
60
60
  The entry does not read Node's built-in modules, so it also works with bundlers such as Next.js Turbopack.
61
+ The text the player shows, such as the names read aloud for its buttons and the overview label, is in English.
62
+ For Japanese, pass `{ lang: "ja" }` to `mountDiagram` as the third argument, and to `parseNotation` for its error messages.
61
63
  `migrateFile`, which moves a source file to the current format version, comes from the Node-only entry `@cardenelabs/dragon/node`.
62
64
 
63
65
  Use the `player` returned by `mountDiagram` to move through the steps (`next`, `prev`, `play`, `pause`, `destroy`).
@@ -134,7 +136,7 @@ step Pass to shipping
134
136
  ```
135
137
 
136
138
  `parseNotation` turns the notation into the source JSON, and `printNotation` turns the source JSON back into the notation.
137
- Error messages are in the language you pass, as in `parseNotation(text, { lang: "en" })`, and are in Japanese when you pass none.
139
+ Error messages are in the language you pass, as in `parseNotation(text, { lang: "ja" })`, and are in English when you pass none.
138
140
  The old form of the notation (starting with `時系列図` or `構成図`) is not read, and stops with an error that shows the new form of that line.
139
141
  The table from the old form to the new one is in [`CHANGELOG.md`](https://github.com/cardene777/dragon/blob/main/CHANGELOG.md).
140
142
 
@@ -314,7 +316,7 @@ dragon export ccip.json --out out
314
316
  | `--width <px>` | Frame width. Picks the view (`fixed` / `follow`) and sets the window width for `follow` |
315
317
  | `--palette <name>` | Colors (`clear` / `paper` / `night`, default `paper`) |
316
318
  | `--theme <mode>` | `light` or `dark` |
317
- | `--lang <lang>` | Language of the text in the diagram (overview labels, the names read in HTML, and the message when it cannot draw) and of the command's usage and error messages (`ja` or `en`). Defaults to `ja` for both notation files and source JSON |
319
+ | `--lang <lang>` | Language of the text in the diagram (overview labels, the names read in HTML, and the message when it cannot draw) and of the command's usage and error messages (`ja` or `en`). Defaults to `en` for both notation files and source JSON |
318
320
  | `--fps <n>` | Frames per second of the MP4 (default 30) |
319
321
  | `--gif-fps <n>` | Frames per second of the GIF (default 10) |
320
322
  | `--format <formats>` | The formats to write, separated by `,` (default `mp4,gif,html,png`) |
package/dist/cli.cjs CHANGED
@@ -1640,12 +1640,68 @@ function badges(diagram, layout) {
1640
1640
  return replaceSameSpot(placed);
1641
1641
  }
1642
1642
 
1643
+ // src/words.ts
1644
+ var DEFAULT_LANG = "en";
1645
+ var keys = (table) => Object.keys(table);
1646
+ var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true, tree: true, lineup: true });
1647
+ var STATE_ENDS = ["start", "finish"];
1648
+ var TIME_HEADS = ["scale", "period", "row", "point", "zoom", "mark", "span"];
1649
+ var NOW = "now";
1650
+ var TREE_HEADS = ["leaf", "node"];
1651
+ var LINEUP_HEADS = ["item", "line", "seal", "open", "pick", "stamp"];
1652
+ var LANE_MOST = 12;
1653
+ var LABEL_MOST = 4;
1654
+ var LANE_ATTRS = ["note", "color"];
1655
+ var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS, ...TREE_HEADS, ...LINEUP_HEADS];
1656
+ var AS = "as";
1657
+ var ON = "on";
1658
+ var COPY = "copy";
1659
+ var MERGE = "merge";
1660
+ var FROM = "from";
1661
+ var HEAD = "HEAD";
1662
+ var AT = "at";
1663
+ var OF = "of";
1664
+ var ATTRS = {
1665
+ diagram: ["view"],
1666
+ group: ["note", "color", "icon"],
1667
+ box: ["note", "color", "icon", "link"],
1668
+ source: ["url"],
1669
+ edge: ["carry", "tag", "side", "at", "into"],
1670
+ note: ["color"],
1671
+ set: ["tag"],
1672
+ strip: ["meter"],
1673
+ branch: ["note"],
1674
+ commit: ["hash", "note"],
1675
+ leaf: ["hash"],
1676
+ node: ["hash"],
1677
+ item: ["color", "label"],
1678
+ scale: ["from"],
1679
+ period: ["from"],
1680
+ row: ["color", "empty"],
1681
+ mark: ["color"],
1682
+ span: ["shape", "color"]
1683
+ };
1684
+ var TIME_EDGE_ATTRS = ["at", "into"];
1685
+ var SPAN_SHAPES = ["box"];
1686
+ var DURATION_UNITS = ["ms", "s", "min", "h", "d"];
1687
+ var CARRIES = keys({ coin: true, none: true });
1688
+ var VIEWS = keys({ fixed: true, follow: true });
1689
+ var SIDES = keys({ above: true, below: true, left: true, right: true });
1690
+ var OLD_HEADS = {
1691
+ \u6642\u7CFB\u5217\u56F3: "sequence",
1692
+ \u69CB\u6210\u56F3: "architecture",
1693
+ \u533A\u753B: "group",
1694
+ \u898B\u305B\u65B9: "view",
1695
+ region: "group",
1696
+ view: "view"
1697
+ };
1698
+
1643
1699
  // src/kinds/registry.ts
1644
1700
  var registered = {};
1645
1701
  function registerKind(kind, parts) {
1646
1702
  registered[kind] = parts;
1647
1703
  }
1648
- function kindParts(kind, lang = "ja") {
1704
+ function kindParts(kind, lang = DEFAULT_LANG) {
1649
1705
  const parts = registered[kind];
1650
1706
  if (parts === void 0) throw new Error(FIGURE_TEXT[lang].kindNotLoaded(kind));
1651
1707
  return parts;
@@ -8111,61 +8167,6 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
8111
8167
  return errors === 0;
8112
8168
  }
8113
8169
 
8114
- // src/words.ts
8115
- var keys = (table) => Object.keys(table);
8116
- var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true, tree: true, lineup: true });
8117
- var STATE_ENDS = ["start", "finish"];
8118
- var TIME_HEADS = ["scale", "period", "row", "point", "zoom", "mark", "span"];
8119
- var NOW = "now";
8120
- var TREE_HEADS = ["leaf", "node"];
8121
- var LINEUP_HEADS = ["item", "line", "seal", "open", "pick", "stamp"];
8122
- var LANE_MOST = 12;
8123
- var LABEL_MOST = 4;
8124
- var LANE_ATTRS = ["note", "color"];
8125
- var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS, ...TREE_HEADS, ...LINEUP_HEADS];
8126
- var AS = "as";
8127
- var ON = "on";
8128
- var COPY = "copy";
8129
- var MERGE = "merge";
8130
- var FROM = "from";
8131
- var HEAD = "HEAD";
8132
- var AT = "at";
8133
- var OF = "of";
8134
- var ATTRS = {
8135
- diagram: ["view"],
8136
- group: ["note", "color", "icon"],
8137
- box: ["note", "color", "icon", "link"],
8138
- source: ["url"],
8139
- edge: ["carry", "tag", "side", "at", "into"],
8140
- note: ["color"],
8141
- set: ["tag"],
8142
- strip: ["meter"],
8143
- branch: ["note"],
8144
- commit: ["hash", "note"],
8145
- leaf: ["hash"],
8146
- node: ["hash"],
8147
- item: ["color", "label"],
8148
- scale: ["from"],
8149
- period: ["from"],
8150
- row: ["color", "empty"],
8151
- mark: ["color"],
8152
- span: ["shape", "color"]
8153
- };
8154
- var TIME_EDGE_ATTRS = ["at", "into"];
8155
- var SPAN_SHAPES = ["box"];
8156
- var DURATION_UNITS = ["ms", "s", "min", "h", "d"];
8157
- var CARRIES = keys({ coin: true, none: true });
8158
- var VIEWS = keys({ fixed: true, follow: true });
8159
- var SIDES = keys({ above: true, below: true, left: true, right: true });
8160
- var OLD_HEADS = {
8161
- \u6642\u7CFB\u5217\u56F3: "sequence",
8162
- \u69CB\u6210\u56F3: "architecture",
8163
- \u533A\u753B: "group",
8164
- \u898B\u305B\u65B9: "view",
8165
- region: "group",
8166
- view: "view"
8167
- };
8168
-
8169
8170
  // src/schema.ts
8170
8171
  var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
8171
8172
  var ICON_NAMES = Object.keys(ICONS);
@@ -8291,7 +8292,7 @@ function validateDiagram(input, options = {}) {
8291
8292
  if (validate_diagram_default(input)) return { ok: true };
8292
8293
  const all = validate_diagram_default.errors ?? [];
8293
8294
  const inBranch = new Set(all.filter((error) => error.keyword === "anyOf").flatMap((anyOf) => branchesOf(anyOf, all)));
8294
- const m = FIELD_MESSAGES[options.lang ?? "ja"];
8295
+ const m = FIELD_MESSAGES[options.lang ?? DEFAULT_LANG];
8295
8296
  const errors = all.filter((error) => error.keyword !== "if" && !inBranch.has(error)).map((error) => toFieldError(error, all, m, input));
8296
8297
  return { ok: false, errors };
8297
8298
  }
@@ -8309,7 +8310,7 @@ var newerError = (version, lang) => ({
8309
8310
  });
8310
8311
  function readDiagram(input, options = {}) {
8311
8312
  const newer = newerThanTool(input);
8312
- if (newer !== void 0) return { ok: false, errors: [newerError(newer, options.lang ?? "ja")] };
8313
+ if (newer !== void 0) return { ok: false, errors: [newerError(newer, options.lang ?? DEFAULT_LANG)] };
8313
8314
  const checked = validateDiagram(input, options);
8314
8315
  if (!checked.ok) return checked;
8315
8316
  return { ok: true, diagram: input, warnings: [] };
@@ -8579,7 +8580,7 @@ function findOverlaps(inks, stills, traces = []) {
8579
8580
  });
8580
8581
  return out;
8581
8582
  }
8582
- function describeOverlap(overlap, lang = "ja") {
8583
+ function describeOverlap(overlap, lang = DEFAULT_LANG) {
8583
8584
  const t = FIGURE_TEXT[lang];
8584
8585
  const partName = (part) => part.kind === "icon" ? t.iconOf(part.box) : part.kind === "coin" ? t.coin : t.envelope;
8585
8586
  const name = (spot) => spot.badge ? t.badgeName(spot.text) : spot.part ? partName(spot.part) : t.quoted(spot.text);
@@ -9524,13 +9525,13 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads, dr
9524
9525
  function paletteOf(options, theme) {
9525
9526
  const palette = resolvePalette(options.palette);
9526
9527
  if (!options.colors) return palette;
9527
- const words = FIGURE_TEXT[options.lang ?? "ja"];
9528
+ const words = FIGURE_TEXT[options.lang ?? DEFAULT_LANG];
9528
9529
  const errors = Object.entries(options.colors).flatMap(([name, value]) => !isColorName(name) ? [words.unknownColor(name)] : isColorValue(value) ? [] : [words.unreadableColor(name)]);
9529
9530
  if (errors.length > 0) throw new Error(words.cannotDraw(errors.join(" / ")));
9530
9531
  return { ...palette, [theme]: { ...palette[theme], ...options.colors } };
9531
9532
  }
9532
9533
  function renderDiagram(input, options = {}) {
9533
- const lang = options.lang ?? "ja";
9534
+ const lang = options.lang ?? DEFAULT_LANG;
9534
9535
  const read2 = readDiagram(input, { lang });
9535
9536
  if (!read2.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read2.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
9536
9537
  const diagram = read2.diagram;
@@ -10798,7 +10799,7 @@ function needleSteps(diagram) {
10798
10799
  return [from, at2];
10799
10800
  });
10800
10801
  }
10801
- function layoutTime(diagram, lang = "ja") {
10802
+ function layoutTime(diagram, lang = DEFAULT_LANG) {
10802
10803
  const T = LOOK.time;
10803
10804
  const { margin, gap } = LOOK;
10804
10805
  const R = LOOK.region;
@@ -12174,7 +12175,7 @@ function drawnTexts(rendered, followSvg) {
12174
12175
  }
12175
12176
  async function exportDiagram(input, options) {
12176
12177
  const formats = options.formats ?? FORMATS;
12177
- const lang = options.lang ?? "ja";
12178
+ const lang = options.lang ?? DEFAULT_LANG;
12178
12179
  const rendered = renderDiagram(input, {
12179
12180
  ...options.palette ? { palette: options.palette } : {},
12180
12181
  ...options.theme ? { theme: options.theme } : {},
@@ -13552,7 +13553,7 @@ function parseLines(lines, m) {
13552
13553
  }
13553
13554
  function parseNotation(notation, options = {}) {
13554
13555
  try {
13555
- return { ok: true, diagram: parseLines(tokenize(notation), messagesFor(options.lang ?? "ja")) };
13556
+ return { ok: true, diagram: parseLines(tokenize(notation), messagesFor(options.lang ?? DEFAULT_LANG)) };
13556
13557
  } catch (error) {
13557
13558
  if (!(error instanceof NotationError)) throw error;
13558
13559
  return { ok: false, errors: [{ line: error.line, column: error.column, message: error.message }] };
@@ -13580,7 +13581,7 @@ var CLI_TEXT = {
13580
13581
  " --width <px> \u67A0\u306E\u5E45\u3002\u898B\u305B\u65B9\u3092\u9078\u3073\u3001\u5BC4\u3063\u3066\u898B\u305B\u308B\u7A93\u306E\u5E45\u306B\u306A\u308B",
13581
13582
  ` --palette <\u540D\u524D> \u8272\u5473 (${PALETTE_NAMES})`,
13582
13583
  " --theme <\u660E\u6697> light \u304B dark",
13583
- " --lang <\u8A00\u8449> \u56F3\u306E\u4E2D\u306E\u5B57\u3068\u547D\u4EE4\u306E\u6587\u306E\u8A00\u8449 (ja \u304B en)\u3002\u65E2\u5B9A\u306F ja",
13584
+ " --lang <\u8A00\u8449> \u56F3\u306E\u4E2D\u306E\u5B57\u3068\u547D\u4EE4\u306E\u6587\u306E\u8A00\u8449 (ja \u304B en)\u3002\u65E2\u5B9A\u306F en",
13584
13585
  " --fps <\u6570> mp4 \u306E 1 \u79D2\u306E\u30B3\u30DE\u306E\u6570 (\u65E2\u5B9A 30)",
13585
13586
  " --gif-fps <\u6570> GIF \u306E 1 \u79D2\u306E\u30B3\u30DE\u306E\u6570 (\u65E2\u5B9A 10)",
13586
13587
  " --format <\u5F62> \u66F8\u304D\u51FA\u3059\u5F62\u3092 , \u3067\u533A\u5207\u308B (\u65E2\u5B9A mp4,gif,html,png)"
@@ -13603,7 +13604,7 @@ var CLI_TEXT = {
13603
13604
  " --width <px> Frame width. Picks the view and sets the window width when following",
13604
13605
  ` --palette <name> Colors (${PALETTE_NAMES})`,
13605
13606
  " --theme <mode> light or dark",
13606
- " --lang <lang> Language of the diagram text and command messages (ja or en). Defaults to ja",
13607
+ " --lang <lang> Language of the diagram text and command messages (ja or en). Defaults to en",
13607
13608
  " --fps <n> Frames per second of the mp4 (default 30)",
13608
13609
  " --gif-fps <n> Frames per second of the GIF (default 10)",
13609
13610
  " --format <list> Formats to write, separated by , (default mp4,gif,html,png)"
@@ -13679,7 +13680,7 @@ function read(file, text2, lang) {
13679
13680
  async function main(argv) {
13680
13681
  const [command, ...rest] = argv;
13681
13682
  const chosen = langOf(argv);
13682
- const early = CLI_TEXT[isLang(chosen) ? chosen : "ja"];
13683
+ const early = CLI_TEXT[isLang(chosen) ? chosen : DEFAULT_LANG];
13683
13684
  if (command !== "export") {
13684
13685
  console.error(early.usage);
13685
13686
  return 2;
@@ -13711,7 +13712,7 @@ ${early.usage}`);
13711
13712
  const fps = number(values.fps);
13712
13713
  const gifFps = number(values["gif-fps"]);
13713
13714
  const lang = isLang(chosen) ? chosen : void 0;
13714
- const diagram = read(file, early, lang ?? "ja");
13715
+ const diagram = read(file, early, lang ?? DEFAULT_LANG);
13715
13716
  let result;
13716
13717
  try {
13717
13718
  result = await exportDiagram(diagram, {
@@ -13727,11 +13728,11 @@ ${early.usage}`);
13727
13728
  });
13728
13729
  } catch (error) {
13729
13730
  const path2 = failedPath(error);
13730
- if (path2 !== void 0) throw new Error(CLI_TEXT[lang ?? "ja"].cannotWrite(path2, detail(error)));
13731
+ if (path2 !== void 0) throw new Error(CLI_TEXT[lang ?? DEFAULT_LANG].cannotWrite(path2, detail(error)));
13731
13732
  throw error instanceof Error ? error : new Error(String(error));
13732
13733
  }
13733
13734
  for (const path2 of Object.values(result.files)) console.log(path2);
13734
- const said = lang ?? "ja";
13735
+ const said = lang ?? DEFAULT_LANG;
13735
13736
  for (const overlap of result.overlaps) console.error(CLI_TEXT[said].overlap(overlap.step + 1, describeOverlap(overlap, said)));
13736
13737
  return 0;
13737
13738
  }