@pecot/visual-mcp 1.1.0 → 1.3.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 (145) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/assets/slidev/deck-lint.config.js +2 -2
  3. package/assets/slidev/deck-lint.env.config.js +2 -2
  4. package/assets/slidev/package.json +7 -7
  5. package/assets/slidev/runtime/package.json +11 -11
  6. package/assets/slidev/scripts/eslint/_shared/dist/lib/drawio-geometry.js +10 -10
  7. package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.d.ts +2 -2
  8. package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.js +4 -4
  9. package/assets/slidev/scripts/eslint/_shared/dist/tsconfig.tsbuildinfo +1 -1
  10. package/assets/slidev/scripts/eslint/_shared/lib/drawio-geometry.ts +10 -10
  11. package/assets/slidev/scripts/eslint/_shared/lib/text-measurer.ts +4 -4
  12. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-content-before-frontmatter.js +1 -1
  13. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-marker-cell.js +4 -4
  14. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-page.js +1 -1
  15. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-asset-prefix.js +1 -1
  16. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-filename-prefix.js +1 -1
  17. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-scaled-drawio.js +3 -3
  18. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-triple-hyphen-in-frontmatter.js +3 -3
  19. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-unknown-props.js +3 -3
  20. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/one-slide-per-file.js +1 -1
  21. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-matching-length.js +1 -1
  22. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-slides-entry.js +1 -1
  23. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/validate-clicks.js +7 -7
  24. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/tsconfig.tsbuildinfo +1 -1
  25. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-content-before-frontmatter.ts +1 -1
  26. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-marker-cell.ts +4 -4
  27. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-page.ts +1 -1
  28. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-asset-prefix.ts +1 -1
  29. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-filename-prefix.ts +1 -1
  30. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-scaled-drawio.ts +3 -3
  31. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-triple-hyphen-in-frontmatter.ts +3 -3
  32. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-unknown-props.ts +3 -3
  33. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/one-slide-per-file.ts +1 -1
  34. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-matching-length.ts +1 -1
  35. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-slides-entry.ts +1 -1
  36. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/validate-clicks.ts +7 -7
  37. package/assets/slidev/scripts/eslint/slidev-pages-lint/package.json +1 -1
  38. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/max-chars.js +6 -6
  39. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint-body.js +3 -3
  40. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint.js +2 -2
  41. package/assets/slidev/scripts/eslint/text-constraints/dist/tsconfig.tsbuildinfo +1 -1
  42. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/max-chars.ts +6 -6
  43. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint-body.ts +3 -3
  44. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint.ts +2 -2
  45. package/assets/slidev/scripts/eslint/text-constraints/package.json +1 -1
  46. package/assets/slidev/scripts/eslint/validate-references/dist/index.js +1 -1
  47. package/assets/slidev/scripts/eslint/validate-references/dist/lib/schema-validator.js +1 -1
  48. package/assets/slidev/scripts/eslint/validate-references/dist/lib/semantic-validator.js +12 -12
  49. package/assets/slidev/scripts/eslint/validate-references/dist/tsconfig.tsbuildinfo +1 -1
  50. package/assets/slidev/scripts/eslint/validate-references/index.ts +1 -1
  51. package/assets/slidev/scripts/eslint/validate-references/lib/schema-validator.ts +2 -2
  52. package/assets/slidev/scripts/eslint/validate-references/lib/semantic-validator.ts +12 -12
  53. package/assets/slidev/scripts/eslint/validate-references/package.json +1 -1
  54. package/cli/dist/cli.js +11 -10
  55. package/cli/dist/commands/chromium/host-dependencies.js +14 -7
  56. package/cli/dist/commands/drawio/export.js +27 -24
  57. package/cli/dist/commands/drawio/theme.js +8 -8
  58. package/cli/dist/commands/drawio/url.js +40 -32
  59. package/cli/dist/commands/evidence-xlsx/create.js +19 -18
  60. package/cli/dist/commands/pptx-ooxml/preview.js +26 -30
  61. package/cli/dist/commands/slidev-project/create.js +27 -26
  62. package/cli/dist/commands/slidev-project/linked-theme.js +5 -5
  63. package/cli/dist/commands/slidev-project/lint.js +29 -27
  64. package/cli/dist/commands/slidev-project/sync.js +35 -34
  65. package/cli/dist/commands/slidev-project/theme.js +19 -18
  66. package/cli/dist/commands/slidev-to-pptx/convert.d.ts +4 -0
  67. package/cli/dist/commands/slidev-to-pptx/convert.js +88 -75
  68. package/cli/dist/diagnostics.d.ts +38 -0
  69. package/cli/dist/diagnostics.js +46 -0
  70. package/cli/dist/domain/_shared/ports.d.ts +0 -1
  71. package/cli/dist/domain/_shared/text-check.js +2 -2
  72. package/cli/dist/domain/drawio/export.js +4 -4
  73. package/cli/dist/domain/drawio/label-text.js +1 -1
  74. package/cli/dist/domain/drawio/url.d.ts +11 -7
  75. package/cli/dist/domain/drawio/url.js +67 -45
  76. package/cli/dist/domain/evidence-xlsx/image-dimensions.js +14 -14
  77. package/cli/dist/domain/evidence-xlsx/spec-schema.js +26 -26
  78. package/cli/dist/domain/pptx-ooxml/merge.js +3 -3
  79. package/cli/dist/domain/pptx-ooxml/prerender-replace.d.ts +1 -0
  80. package/cli/dist/domain/pptx-ooxml/prerender-replace.js +3 -3
  81. package/cli/dist/domain/slidev-project/generated-files.d.ts +1 -1
  82. package/cli/dist/domain/slidev-project/generated-files.js +36 -36
  83. package/cli/dist/domain/slidev-project/initial-pages.js +4 -4
  84. package/cli/dist/domain/slidev-project/lint.js +11 -11
  85. package/cli/dist/domain/slidev-project/sync.js +13 -13
  86. package/cli/dist/domain/slidev-project/warnings.js +4 -4
  87. package/cli/dist/domain/slidev-theme/declaration.js +9 -9
  88. package/cli/dist/domain/slidev-theme/references.js +10 -10
  89. package/cli/dist/domain/slidev-theme/store-layout.js +6 -6
  90. package/cli/dist/domain/slidev-theme/talk-theme.js +13 -13
  91. package/cli/dist/domain/slidev-theme/theme-spec.js +5 -5
  92. package/cli/dist/domain/slidev-to-pptx/errors.js +3 -3
  93. package/cli/dist/infra/_shared/dependency-root.js +4 -4
  94. package/cli/dist/infra/_shared/patch-apply.js +6 -5
  95. package/cli/dist/infra/_shared/runtime-install.d.ts +12 -84
  96. package/cli/dist/infra/_shared/runtime-install.js +74 -108
  97. package/cli/dist/infra/_shared/slidev-bin.js +1 -1
  98. package/cli/dist/infra/drawio/icons.js +3 -3
  99. package/cli/dist/infra/drawio/pdf.js +1 -1
  100. package/cli/dist/infra/drawio/screenshot.js +10 -9
  101. package/cli/dist/infra/evidence-xlsx/workbook-writer.js +2 -2
  102. package/cli/dist/infra/playwright/chromium.js +4 -3
  103. package/cli/dist/infra/playwright/host-dependencies.js +8 -8
  104. package/cli/dist/infra/playwright/launch.js +5 -5
  105. package/cli/dist/infra/pptx-ooxml/soffice.js +2 -2
  106. package/cli/dist/infra/slidev-project/eslint-runner.js +10 -9
  107. package/cli/dist/infra/slidev-project/fs.js +6 -6
  108. package/cli/dist/infra/slidev-theme/store.js +18 -15
  109. package/cli/dist/infra/slidev-to-pptx/cache-store.js +6 -6
  110. package/cli/dist/infra/slidev-to-pptx/console-logger.d.ts +5 -5
  111. package/cli/dist/infra/slidev-to-pptx/console-logger.js +19 -20
  112. package/cli/dist/infra/slidev-to-pptx/dom-converter.d.ts +1 -1
  113. package/cli/dist/infra/slidev-to-pptx/dom-converter.js +12 -12
  114. package/cli/dist/infra/slidev-to-pptx/index.js +1 -9
  115. package/cli/dist/infra/slidev-to-pptx/pipeline.d.ts +2 -2
  116. package/cli/dist/infra/slidev-to-pptx/pipeline.js +56 -56
  117. package/cli/dist/infra/slidev-to-pptx/prerender-capture.js +14 -14
  118. package/cli/dist/infra/slidev-to-pptx/prerender.js +10 -10
  119. package/cli/dist/infra/slidev-to-pptx/runner.js +1 -0
  120. package/cli/dist/infra/slidev-to-pptx/scanner.js +10 -10
  121. package/cli/dist/infra/slidev-to-pptx/server.d.ts +2 -1
  122. package/cli/dist/infra/slidev-to-pptx/server.js +3 -3
  123. package/cli/dist/infra/slidev-to-pptx/single-pass-worker.js +39 -39
  124. package/cli/dist/infra/slidev-to-pptx/slide-worker.js +3 -3
  125. package/cli/dist/infra/slidev-to-pptx/visibility-helpers.js +8 -8
  126. package/cli/dist/mcp/dev-server-registry.js +10 -9
  127. package/cli/dist/mcp/queue.js +1 -1
  128. package/cli/dist/mcp/result.js +4 -4
  129. package/cli/dist/mcp/serve.js +5 -3
  130. package/cli/dist/mcp/server.js +2 -2
  131. package/cli/dist/mcp/tools/_shared.d.ts +1 -1
  132. package/cli/dist/mcp/tools/_shared.js +47 -38
  133. package/cli/dist/mcp/tools/drawio.js +23 -22
  134. package/cli/dist/mcp/tools/evidence.js +8 -8
  135. package/cli/dist/mcp/tools/setup.js +26 -26
  136. package/cli/dist/mcp/tools/slide-dev.js +20 -20
  137. package/cli/dist/mcp/tools/slide-page.js +39 -37
  138. package/cli/dist/mcp/tools/slide-theme.js +6 -6
  139. package/cli/dist/mcp/tools/slide.js +52 -50
  140. package/cli/dist/mcp/windows-path.js +8 -7
  141. package/cli/dist/node-runtime.d.ts +6 -1
  142. package/cli/dist/node-runtime.js +16 -8
  143. package/npm-shrinkwrap.json +46 -52
  144. package/package.json +6 -6
  145. package/vendor/text-rules/dist/source-hash +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pecot-v",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "pecot-v(pecot-visual)— 可視化・ドキュメント系スキル集(v-drawio, v-slidev, v-evidence)",
5
5
  "author": {
6
6
  "name": "pecot"
@@ -38,8 +38,8 @@ export function defineDeckLintConfig({ referencesDirectories, panels, markerLayo
38
38
  const isValid = Array.isArray(referencesDirectories) && isRecord(panels) && Array.isArray(markerLayouts) && isRecord(rules)
39
39
  if (!isValid) {
40
40
  throw new TypeError(
41
- 'defineDeckLintConfig の引数が不正です。'
42
- + 'referencesDirectories と markerLayouts は配列、panels と rules は object で渡してください',
41
+ 'invalid argument to defineDeckLintConfig '
42
+ + '(fix: pass referencesDirectories and markerLayouts as arrays, and panels and rules as objects)',
43
43
  )
44
44
  }
45
45
  const settings = { 'slidev-theme': { referencesDirectories, panels, markerLayouts } }
@@ -10,13 +10,13 @@ const ENV_NAME = 'PECOTV_DECK_LINT'
10
10
  function readLintFromEnvironment() {
11
11
  const text = process.env[ENV_NAME]
12
12
  if (text === undefined || text === '') {
13
- throw new Error(`${ENV_NAME} が未設定です。slide theme --json の lint を JSON で渡してください`)
13
+ throw new Error(`${ENV_NAME} is not set (fix: pass the lint value of slide theme --json as JSON)`)
14
14
  }
15
15
  try {
16
16
  return JSON.parse(text)
17
17
  }
18
18
  catch (error) {
19
- throw new Error(`${ENV_NAME} を JSON として読めません: ${error instanceof Error ? error.message : String(error)}`)
19
+ throw new Error(`${ENV_NAME} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`)
20
20
  }
21
21
  }
22
22
 
@@ -29,17 +29,17 @@
29
29
  "@google/design.md": "0.4.0",
30
30
  "@types/js-yaml": "^4.0.9",
31
31
  "@types/node": "^22.20.5",
32
- "c8": "^10.1.3",
33
- "eslint": "^10.13.0",
32
+ "c8": "^12.0.0",
33
+ "eslint": "^10.14.0",
34
34
  "eslint-config-prettier": "^10.1.8",
35
- "eslint-plugin-vue": "^10.11.1",
36
- "globals": "^17.13.0",
35
+ "eslint-plugin-vue": "^10.12.0",
36
+ "globals": "^17.14.0",
37
37
  "jszip": "^3.10.2",
38
- "playwright": "^1.64.1",
38
+ "playwright": "^1.65.0",
39
39
  "typescript": "npm:@typescript/typescript6@^6.0.2",
40
- "typescript-eslint": "^8.72.0",
40
+ "typescript-eslint": "^8.72.1",
41
41
  "typescript7": "npm:typescript@^7.0.2",
42
- "vue-eslint-parser": "^10.4.1",
42
+ "vue-eslint-parser": "^10.4.2",
43
43
  "yaml": "^2.9.1"
44
44
  },
45
45
  "nx": {
@@ -5,26 +5,26 @@
5
5
  "type": "module",
6
6
  "private": true,
7
7
  "license": "MIT",
8
- "//peer-reason": "peer は slidev-theme-* の peerDependencies と同じ版に固定する。@slidev/* は SLIDEV_CORE_VERSION に合わせる。",
8
+ "//peer-reason": "peer は slidev-theme-* の peerDependencies と同じ版に固定する。@slidev/* は @slidev/cli と同じ版にする。",
9
9
  "//override-reason": "overrides は root の pnpm-workspace.yaml の写し。lodash-es は overrides に置くと EOVERRIDE になる。",
10
10
  "dependencies": {
11
- "@shikijs/langs": "4.5.0",
12
- "@shikijs/themes": "4.5.0",
13
- "@slidev/cli": "53.0.0",
14
- "@slidev/client": "53.0.0",
11
+ "@shikijs/langs": "4.6.0",
12
+ "@shikijs/themes": "4.6.0",
13
+ "@slidev/cli": "53.1.0",
14
+ "@slidev/client": "53.1.0",
15
15
  "@slidev/theme-default": "^0.25.0",
16
- "@slidev/types": "53.0.0",
17
- "@vueuse/core": "14.4.0",
16
+ "@slidev/types": "53.1.0",
17
+ "@vueuse/core": "15.0.0",
18
18
  "dayjs": "1.11.23",
19
19
  "html2canvas": "1.4.1",
20
20
  "lodash-es": "4.18.1",
21
- "shiki": "4.5.0",
21
+ "shiki": "4.6.0",
22
22
  "uuid": "13.0.2",
23
- "vite": "^8.3.0",
24
- "vue": "3.5.44"
23
+ "vite": "^8.3.7",
24
+ "vue": "3.5.45"
25
25
  },
26
26
  "devDependencies": {
27
- "dom-to-pptx": "2.1.1"
27
+ "dom-to-pptx": "2.1.2"
28
28
  },
29
29
  "overrides": {
30
30
  "dompurify": "^3.4.17",
@@ -127,7 +127,7 @@ function stripXmlComments(xml) {
127
127
  */
128
128
  function scanCells(xml) {
129
129
  if (typeof xml !== 'string' || xml.trim() === '') {
130
- throw new DrawioGeometryError('empty-xml', 'draw.io の XML が空です');
130
+ throw new DrawioGeometryError('empty-xml', 'draw.io XML is empty');
131
131
  }
132
132
  const source = stripXmlComments(xml);
133
133
  const cells = [];
@@ -147,7 +147,7 @@ function scanCells(xml) {
147
147
  if (closing) {
148
148
  const top = stack.pop();
149
149
  if (top?.name === 'diagram' && !top.hasChild && between.trim() !== '') {
150
- throw new DrawioGeometryError('compressed', '圧縮形式の <diagram> は非対応です。draw.io の「ファイル → プロパティ → 圧縮」を外して保存してください');
150
+ throw new DrawioGeometryError('compressed', 'compressed <diagram> is not supported (fix: turn off File > Properties > Compressed in draw.io and save)');
151
151
  }
152
152
  if (name === 'mxCell')
153
153
  current = null;
@@ -161,12 +161,12 @@ function scanCells(xml) {
161
161
  if (parent)
162
162
  parent.hasChild = true;
163
163
  if (name === 'object' || name === 'UserObject') {
164
- throw new DrawioGeometryError('wrapped-cell', `<${name}> で包んだセルは非対応です(セルにプロパティやリンクを付けると生成されます)。プロパティを外した mxCell にしてください`);
164
+ throw new DrawioGeometryError('wrapped-cell', `cell wrapped in <${name}> is not supported; it is generated when a cell has properties or a link (fix: remove the properties so the cell is a plain mxCell)`);
165
165
  }
166
166
  if (name === 'diagram') {
167
167
  diagramCount += 1;
168
168
  if (diagramCount > 1) {
169
- throw new DrawioGeometryError('multi-page', '複数ページの draw.io ファイルは非対応です。1 ページだけのファイルにしてください');
169
+ throw new DrawioGeometryError('multi-page', 'multi-page draw.io file is not supported (fix: use a file with one page)');
170
170
  }
171
171
  }
172
172
  if (name === 'mxGraphModel')
@@ -219,7 +219,7 @@ function scanCells(xml) {
219
219
  stack.push({ name, hasChild: false });
220
220
  }
221
221
  if (modelCount === 0) {
222
- throw new DrawioGeometryError('no-model', 'draw.io の XML に <mxGraphModel> がありません');
222
+ throw new DrawioGeometryError('no-model', 'draw.io XML has no <mxGraphModel>');
223
223
  }
224
224
  return cells;
225
225
  }
@@ -332,20 +332,20 @@ export function parseDrawio(xml) {
332
332
  export function resolveCellRect(model, cellId) {
333
333
  const cell = model.byId.get(cellId);
334
334
  if (!cell) {
335
- throw new DrawioGeometryError('unknown-cell', `セル "${cellId}" が図にありません`);
335
+ throw new DrawioGeometryError('unknown-cell', `cell not found in the diagram: ${cellId}`);
336
336
  }
337
337
  if (cell.edge) {
338
- throw new DrawioGeometryError('edge-cell', `セル "${cellId}" は線(edge)です。マーカーは図形(vertex)の ID を指定してください`);
338
+ throw new DrawioGeometryError('edge-cell', `cell is an edge: ${cellId} (fix: give the ID of a vertex for the marker)`);
339
339
  }
340
340
  if (!cell.vertex) {
341
- throw new DrawioGeometryError('not-vertex', `セル "${cellId}" はレイヤ等の図形でないセルです。図形(vertex)の ID を指定してください`);
341
+ throw new DrawioGeometryError('not-vertex', `cell is not a vertex, such as a layer: ${cellId} (fix: give the ID of a vertex)`);
342
342
  }
343
343
  if (model.isHidden(cell)) {
344
- throw new DrawioGeometryError('hidden-cell', `セル "${cellId}" は非表示(visible="0")です`);
344
+ throw new DrawioGeometryError('hidden-cell', `cell is hidden (visible="0"): ${cellId}`);
345
345
  }
346
346
  const rect = model.vertexRect(cell);
347
347
  if (!rect) {
348
- throw new DrawioGeometryError('relative-cell', `セル "${cellId}" は親に対する相対配置(relative="1")のため位置を決められません`);
348
+ throw new DrawioGeometryError('relative-cell', `cell is placed relative to its parent (relative="1"), so its position cannot be determined: ${cellId}`);
349
349
  }
350
350
  return { ...rect, crisp: crispOffsetOf(strokeOf(cell.style).width) };
351
351
  }
@@ -1,9 +1,9 @@
1
1
  export declare function stripHtmlTags(text: string): string;
2
2
  export declare function isFullWidth(codePoint: number): boolean;
3
3
  export declare function fullWidthEquivalent(text: string): number;
4
- export declare const BOLD_REQUIRED_MESSAGE = "\u8981\u70B9\u306E\u592A\u5B57\u5F37\u8ABF\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u8981\u70B9\u3060\u3051\u3092 <strong>\u2026</strong> \u3067\u56F2\u3093\u3067\u304F\u3060\u3055\u3044\u3002\u5168\u6587\u3092\u56F2\u3080\u3068\u5F37\u8ABF\u306B\u306A\u308A\u307E\u305B\u3093\u3002<b> \u3068 Markdown \u306E ** \u306F\u4E0D\u53EF\uFF09";
4
+ export declare const BOLD_REQUIRED_MESSAGE = "no bold emphasis on the key point (fix: wrap only the key point in <strong>\u2026</strong>; wrapping the whole text is not emphasis; <b> and Markdown ** are not allowed)";
5
5
  export declare function hasBoldEmphasis(text: string): boolean;
6
- export declare const EM_DISALLOWED_MESSAGE = "<em> \u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08\u5F37\u8ABF\u306F <strong> \u306E\u307F\u3002<em> \u306F\u524A\u9664\u3057\u3066\u8A9E\u53E5\u3060\u3051\u6B8B\u3057\u3066\u304F\u3060\u3055\u3044\uFF09";
6
+ export declare const EM_DISALLOWED_MESSAGE = "<em> is not allowed; use <strong> for emphasis only (fix: remove <em> and keep the words)";
7
7
  export declare function hasDisallowedEmTag(text: string): boolean;
8
8
  export interface TextConstraint {
9
9
  min_chars?: number;
@@ -29,7 +29,7 @@ export function fullWidthEquivalent(text) {
29
29
  // 太字強調は <strong> のみを認める(テンプレートの強調規範を <strong> に一本化しており <b> は不可)。
30
30
  // 属性付き・大文字タグは許容し、中身が空の <strong></strong> は強調とみなさない。
31
31
  const STRONG_TAG_PATTERN = /<strong(?:\s[^>]*)?>([\s\S]*?)<\/strong\s*>/gi;
32
- export const BOLD_REQUIRED_MESSAGE = '要点の太字強調がありません(要点だけを <strong>…</strong> で囲んでください。全文を囲むと強調になりません。<b> と Markdown の ** は不可)';
32
+ export const BOLD_REQUIRED_MESSAGE = 'no bold emphasis on the key point (fix: wrap only the key point in <strong>…</strong>; wrapping the whole text is not emphasis; <b> and Markdown ** are not allowed)';
33
33
  // 全文が strong に覆われていると強調の対比が消えるため、強調とみなさない。
34
34
  // 複数の strong で分割して全文を覆うケースも同じ扱いにする。
35
35
  export function hasBoldEmphasis(text) {
@@ -49,7 +49,7 @@ export function hasBoldEmphasis(text) {
49
49
  }
50
50
  // <em> は強調記法として不可(強調は <strong> のみ)。属性付き・大文字タグも検出する。
51
51
  const EM_TAG_PATTERN = /<em(?:\s[^>]*)?>/i;
52
- export const EM_DISALLOWED_MESSAGE = '<em> は使えません(強調は <strong> のみ。<em> は削除して語句だけ残してください)';
52
+ export const EM_DISALLOWED_MESSAGE = '<em> is not allowed; use <strong> for emphasis only (fix: remove <em> and keep the words)';
53
53
  export function hasDisallowedEmTag(text) {
54
54
  if (typeof text !== 'string') {
55
55
  return false;
@@ -67,7 +67,7 @@ export function validateText(text, constraint) {
67
67
  if (minChars != null && fwe < minChars) {
68
68
  errors.push({
69
69
  type: 'minChars',
70
- message: `${fwe}文字です(最小${minChars}文字)`,
70
+ message: `${fwe} chars (min: ${minChars})`,
71
71
  actual: fwe,
72
72
  limit: minChars,
73
73
  });
@@ -76,7 +76,7 @@ export function validateText(text, constraint) {
76
76
  if (maxChars != null && fwe > maxChars) {
77
77
  errors.push({
78
78
  type: 'maxChars',
79
- message: `${fwe}文字です(最大${maxChars}文字)`,
79
+ message: `${fwe} chars (max: ${maxChars})`,
80
80
  actual: fwe,
81
81
  limit: maxChars,
82
82
  });