@tunasand/sdk 0.0.0-stage → 0.6.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 (168) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +506 -2
  3. package/dist/analytics.d.ts +1 -0
  4. package/dist/analytics.js +43 -0
  5. package/dist/app.d.ts +1 -0
  6. package/dist/app.js +825 -0
  7. package/dist/apps-9u4XMi7E.js +114 -0
  8. package/dist/body.d.ts +1 -0
  9. package/dist/body.js +455 -0
  10. package/dist/bridge-DYAYGV7t.js +74 -0
  11. package/dist/bridge.d.ts +1 -0
  12. package/dist/bridge.js +189 -0
  13. package/dist/cli.d.ts +1 -0
  14. package/dist/cli.js +283 -0
  15. package/dist/client-Derrexwr.js +159 -0
  16. package/dist/customers-C_vJY2_v.js +84 -0
  17. package/dist/customers.d.ts +1 -0
  18. package/dist/customers.js +185 -0
  19. package/dist/declared-C_GvPiGF.js +397 -0
  20. package/dist/delivery.d.ts +1 -0
  21. package/dist/delivery.js +348 -0
  22. package/dist/dev.d.ts +1 -0
  23. package/dist/dev.js +93 -0
  24. package/dist/embed-R-OvDYAw.js +90 -0
  25. package/dist/errorLabels-BcyRbv_i.js +1510 -0
  26. package/dist/i18n.d.ts +1 -0
  27. package/dist/i18n.js +4 -0
  28. package/dist/integrations.d.ts +1 -0
  29. package/dist/integrations.js +62 -0
  30. package/dist/ja-C1HEWWTQ.js +241 -0
  31. package/dist/ja-C6lX0CeJ.js +213 -0
  32. package/dist/model-pmXzGX12.js +152 -0
  33. package/dist/model.d.ts +1 -0
  34. package/dist/model.js +345 -0
  35. package/dist/page-E_cYgZx-.js +138 -0
  36. package/dist/preview.d.ts +1 -0
  37. package/dist/preview.js +1 -0
  38. package/dist/profile-D6t1QMQh.js +223 -0
  39. package/dist/schema-BPHL7Qr-.js +115 -0
  40. package/dist/schema-UQJWRyfJ.js +995 -0
  41. package/dist/schema.d.ts +1 -0
  42. package/dist/schema.js +1 -0
  43. package/dist/src-sazhzYui.js +71 -0
  44. package/dist/types/access/src/handoff.d.ts +52 -0
  45. package/dist/types/access/src/index.d.ts +5 -0
  46. package/dist/types/access/src/jws.d.ts +5 -0
  47. package/dist/types/access/src/jwt.d.ts +35 -0
  48. package/dist/types/access/src/oidc.d.ts +50 -0
  49. package/dist/types/access/src/signed.d.ts +15 -0
  50. package/dist/types/analytics/src/day.d.ts +2 -0
  51. package/dist/types/analytics/src/index.d.ts +5 -0
  52. package/dist/types/analytics/src/schedule.d.ts +2 -0
  53. package/dist/types/analytics/src/shared.d.ts +21 -0
  54. package/dist/types/analytics/src/source.d.ts +19 -0
  55. package/dist/types/analytics/src/store.d.ts +24 -0
  56. package/dist/types/analytics/src/view.d.ts +33 -0
  57. package/dist/types/body/src/components.d.ts +25 -0
  58. package/dist/types/body/src/declared.d.ts +34 -0
  59. package/dist/types/body/src/derive.d.ts +13 -0
  60. package/dist/types/body/src/description.d.ts +8 -0
  61. package/dist/types/body/src/embed.d.ts +16 -0
  62. package/dist/types/body/src/href.d.ts +4 -0
  63. package/dist/types/body/src/html.d.ts +30 -0
  64. package/dist/types/body/src/index.d.ts +19 -0
  65. package/dist/types/body/src/inline.d.ts +20 -0
  66. package/dist/types/body/src/labels/en.d.ts +90 -0
  67. package/dist/types/body/src/labels/ja.d.ts +153 -0
  68. package/dist/types/body/src/library.d.ts +113 -0
  69. package/dist/types/body/src/markdown.d.ts +14 -0
  70. package/dist/types/body/src/normalize.d.ts +5 -0
  71. package/dist/types/body/src/problems.d.ts +103 -0
  72. package/dist/types/body/src/profile.d.ts +80 -0
  73. package/dist/types/body/src/render.d.ts +29 -0
  74. package/dist/types/body/src/schema.d.ts +6 -0
  75. package/dist/types/body/src/standard.d.ts +20 -0
  76. package/dist/types/body/src/types.d.ts +140 -0
  77. package/dist/types/cms-contract/src/apiKeys.d.ts +41 -0
  78. package/dist/types/cms-contract/src/app.d.ts +35 -0
  79. package/dist/types/cms-contract/src/appDependencies.d.ts +265 -0
  80. package/dist/types/cms-contract/src/appProblems.d.ts +22 -0
  81. package/dist/types/cms-contract/src/apps.d.ts +195 -0
  82. package/dist/types/cms-contract/src/assets.d.ts +12 -0
  83. package/dist/types/cms-contract/src/authorize.d.ts +146 -0
  84. package/dist/types/cms-contract/src/bridge.d.ts +318 -0
  85. package/dist/types/cms-contract/src/consents.d.ts +97 -0
  86. package/dist/types/cms-contract/src/customerLabels.d.ts +33 -0
  87. package/dist/types/cms-contract/src/customers.d.ts +266 -0
  88. package/dist/types/cms-contract/src/embeds.d.ts +165 -0
  89. package/dist/types/cms-contract/src/errorLabels.d.ts +269 -0
  90. package/dist/types/cms-contract/src/errorLabelsEn.d.ts +228 -0
  91. package/dist/types/cms-contract/src/errors.d.ts +105 -0
  92. package/dist/types/cms-contract/src/failureStatus.d.ts +124 -0
  93. package/dist/types/cms-contract/src/functionLabels.d.ts +5 -0
  94. package/dist/types/cms-contract/src/functions.d.ts +144 -0
  95. package/dist/types/cms-contract/src/identifiers.d.ts +117 -0
  96. package/dist/types/cms-contract/src/import.d.ts +277 -0
  97. package/dist/types/cms-contract/src/issueLabels.d.ts +435 -0
  98. package/dist/types/cms-contract/src/issueLabelsEn.d.ts +217 -0
  99. package/dist/types/cms-contract/src/migration.d.ts +103 -0
  100. package/dist/types/cms-contract/src/paths.d.ts +23 -0
  101. package/dist/types/cms-contract/src/permissionLabels.d.ts +8 -0
  102. package/dist/types/cms-contract/src/permissions.d.ts +77 -0
  103. package/dist/types/cms-contract/src/problems.d.ts +34 -0
  104. package/dist/types/cms-contract/src/roles.d.ts +57 -0
  105. package/dist/types/cms-contract/src/settingProblems.d.ts +13 -0
  106. package/dist/types/cms-contract/src/settings.d.ts +19 -0
  107. package/dist/types/cms-contract/src/siteArtifact.d.ts +45 -0
  108. package/dist/types/cms-contract/src/siteDeclaration.d.ts +70 -0
  109. package/dist/types/cms-contract/src/transfer.d.ts +57 -0
  110. package/dist/types/cms-contract/src/views.d.ts +21 -0
  111. package/dist/types/cms-contract/src/webhookLabels.d.ts +7 -0
  112. package/dist/types/cms-contract/src/webhooks.d.ts +139 -0
  113. package/dist/types/i18n/src/index.d.ts +50 -0
  114. package/dist/types/i18n/src/problems.d.ts +21 -0
  115. package/dist/types/model/src/asset.d.ts +111 -0
  116. package/dist/types/model/src/audience.d.ts +38 -0
  117. package/dist/types/model/src/brand.d.ts +25 -0
  118. package/dist/types/model/src/capabilities.d.ts +28 -0
  119. package/dist/types/model/src/changes.d.ts +34 -0
  120. package/dist/types/model/src/check.d.ts +15 -0
  121. package/dist/types/model/src/contact.d.ts +22 -0
  122. package/dist/types/model/src/image.d.ts +38 -0
  123. package/dist/types/model/src/index.d.ts +26 -0
  124. package/dist/types/model/src/input.d.ts +26 -0
  125. package/dist/types/model/src/integrity.d.ts +79 -0
  126. package/dist/types/model/src/json.d.ts +2 -0
  127. package/dist/types/model/src/labels/en.d.ts +169 -0
  128. package/dist/types/model/src/labels/ja.d.ts +198 -0
  129. package/dist/types/model/src/legacy.d.ts +2 -0
  130. package/dist/types/model/src/media.d.ts +5 -0
  131. package/dist/types/model/src/mediaUrl.d.ts +67 -0
  132. package/dist/types/model/src/model.d.ts +415 -0
  133. package/dist/types/model/src/page.d.ts +52 -0
  134. package/dist/types/model/src/problems.d.ts +184 -0
  135. package/dist/types/model/src/refs.d.ts +27 -0
  136. package/dist/types/model/src/rules.d.ts +15 -0
  137. package/dist/types/model/src/schema.d.ts +58 -0
  138. package/dist/types/model/src/screens.d.ts +76 -0
  139. package/dist/types/model/src/selfOps.d.ts +30 -0
  140. package/dist/types/model/src/time.d.ts +25 -0
  141. package/dist/types/model/src/typesSource.d.ts +8 -0
  142. package/dist/types/model/src/values.d.ts +24 -0
  143. package/dist/types/platform/src/defaultModel.d.ts +8 -0
  144. package/dist/types/sdk/src/analytics.d.ts +2 -0
  145. package/dist/types/sdk/src/app.d.ts +20 -0
  146. package/dist/types/sdk/src/body.d.ts +2 -0
  147. package/dist/types/sdk/src/bridge.d.ts +92 -0
  148. package/dist/types/sdk/src/cli.d.ts +2 -0
  149. package/dist/types/sdk/src/customers.d.ts +190 -0
  150. package/dist/types/sdk/src/delivery/cache.d.ts +18 -0
  151. package/dist/types/sdk/src/delivery/changes.d.ts +28 -0
  152. package/dist/types/sdk/src/delivery/client.d.ts +90 -0
  153. package/dist/types/sdk/src/delivery/fields.d.ts +48 -0
  154. package/dist/types/sdk/src/delivery/index.d.ts +9 -0
  155. package/dist/types/sdk/src/delivery/media.d.ts +14 -0
  156. package/dist/types/sdk/src/delivery/query.d.ts +85 -0
  157. package/dist/types/sdk/src/delivery/schema.d.ts +19 -0
  158. package/dist/types/sdk/src/delivery/values.d.ts +82 -0
  159. package/dist/types/sdk/src/delivery.d.ts +3 -0
  160. package/dist/types/sdk/src/dev.d.ts +29 -0
  161. package/dist/types/sdk/src/i18n.d.ts +12 -0
  162. package/dist/types/sdk/src/integrations.d.ts +33 -0
  163. package/dist/types/sdk/src/model.d.ts +5 -0
  164. package/dist/types/sdk/src/preview.d.ts +1 -0
  165. package/dist/types/sdk/src/schema.d.ts +21 -0
  166. package/dist/types/sdk/src/site.d.ts +43 -0
  167. package/dist/typesSource-bO0jFw1I.js +88 -0
  168. package/package.json +86 -3
@@ -0,0 +1,90 @@
1
+ /** 本文の検査の問題の英語の文 */
2
+ export declare const BODY_PROBLEM_MESSAGES_EN: {
3
+ readonly inline_component_here: "Inline components cannot be used here";
4
+ readonly inline_component_unavailable: "Inline component {name} cannot be used";
5
+ readonly marks_here: "Marks and links cannot be used here";
6
+ readonly mark_unavailable: "{mark, select, strong {Bold} em {Italic} code {Code} strike {Strikethrough} mark {Highlight} sup {Superscript} sub {Subscript} other {Underline}} cannot be used";
7
+ readonly marks_combined: "Combined marks and marked links cannot be used";
8
+ readonly link_rel_unavailable: "Link rel={rel} cannot be used";
9
+ readonly link_target_unavailable: "Opening links in a new tab cannot be used";
10
+ readonly link_unsafe: "Link target {href} cannot be used (only https://, http://, mailto:, site paths starting with / and in-page links starting with #)";
11
+ readonly text_style_here: "Text styles cannot be used here";
12
+ readonly style_unavailable: "{kind, select, color {Text color} background {Background color} other {Font size}} cannot be used";
13
+ readonly style_name_unknown: "{kind, select, color {Text color} background {Background color} other {Font size}} name {name} is not in the body settings";
14
+ readonly style_empty: "{kind, select, color {Text color} background {Background color} other {Font size}} has no name or value";
15
+ readonly style_value_unsafe: "{kind, select, color {Text color} background {Background color} other {Font size}} value {value} cannot be used";
16
+ readonly named_style_unknown: "Named style {name} is not in the body settings";
17
+ readonly align_unavailable: "Alignment cannot be used";
18
+ readonly table_cells_unavailable: "Table cells with attributes cannot be used";
19
+ readonly table_span_invalid: "Cell spans must be 1 or more";
20
+ readonly variant_unavailable: "Variant {variant} cannot be used";
21
+ readonly heading_unavailable: "Heading {level} cannot be used (available headings: {levels})";
22
+ readonly list_unavailable: "Lists cannot be used";
23
+ readonly list_nested_unavailable: "Nested lists cannot be used";
24
+ readonly list_ordered_unavailable: "Ordered lists cannot be used";
25
+ readonly quote_unavailable: "Quotes cannot be used";
26
+ readonly quote_single: "Quotes are limited to one paragraph";
27
+ readonly quote_cite_unavailable: "Quote citations cannot be used";
28
+ readonly code_unavailable: "Code cannot be used";
29
+ readonly code_caption_unavailable: "Code captions cannot be used";
30
+ readonly code_filename_unavailable: "Code file names cannot be used";
31
+ readonly code_component_lang: "```{lang} code cannot be used (wrap it in :::{component})";
32
+ readonly image_unavailable: "Images cannot be used";
33
+ readonly image_link_unavailable: "Image links cannot be used";
34
+ readonly image_align_unavailable: "Image alignment cannot be used";
35
+ readonly file_unavailable: "Files cannot be used";
36
+ readonly table_unavailable: "Tables cannot be used";
37
+ readonly table_head_required: "Tables require a header row";
38
+ readonly table_caption_required: "Tables require a caption";
39
+ readonly table_caption_unavailable: "Table captions cannot be used";
40
+ readonly divider_unavailable: "Dividers cannot be used";
41
+ readonly html_unavailable: "HTML blocks cannot be used";
42
+ readonly component_unavailable: "Component {name} cannot be used";
43
+ readonly link_href_missing: "Link target is required";
44
+ readonly inline_component_missing: "Inline component {name} does not exist";
45
+ readonly heading_empty: "Heading is required";
46
+ readonly component_missing: "Component {name} does not exist";
47
+ readonly markdown_unparsable: "Cannot parse Markdown: {error}";
48
+ readonly block_problem: "Block {index}: {problem}";
49
+ readonly url_https: "URL must start with https://";
50
+ readonly caption_missing: "Caption is required";
51
+ readonly cite_source_missing: "Source of the citation is required";
52
+ readonly speech_missing: "Speech is required";
53
+ readonly diagram_source_missing: "Diagram source is required";
54
+ readonly diagram_alt_missing: "Diagram alternative text is required";
55
+ readonly gallery_min: "Galleries require at least 2 images";
56
+ readonly link_title_missing: "Link title is required";
57
+ readonly link_ref_format: "ref must be \"collection id/record ID\"";
58
+ readonly embed_id_invalid: "Invalid embed ID";
59
+ readonly prop_key_format: "Prop names must start with a letter and contain only letters and digits";
60
+ readonly prop_enum_string: "enum is only for string props";
61
+ readonly prop_items: "Array props require items (other types cannot have it)";
62
+ readonly prop_properties_object: "properties and required are only for object props";
63
+ readonly prop_required_missing: "Required prop {key} is not in properties";
64
+ readonly component_name_format: "Component names must start with a letter and contain only letters, digits and hyphens";
65
+ readonly component_label_missing: "Component name is required";
66
+ readonly component_name_reserved: "Component name {name} duplicates a core component or a reserved name";
67
+ readonly inline_prop_string: "Inline component props must be strings: {key}";
68
+ readonly component_name_duplicate: "Duplicate component name {name}";
69
+ readonly prop_missing: "{label} is required";
70
+ readonly prop_shape: "{label} has an invalid shape";
71
+ readonly prop_integer: "{label} must be an integer";
72
+ readonly component_props_shape: "Props of {label} have an invalid shape";
73
+ readonly drop_attribute: "attribute {name}";
74
+ readonly drop_style: "style {key}";
75
+ readonly drop_style_value: "value of style {key}";
76
+ readonly drop_class: "class {name}";
77
+ readonly drop_unsafe_link: "unsafe link target";
78
+ readonly drop_element: "element {name}";
79
+ readonly drop_inline_image: "image inside text";
80
+ readonly drop_hoisted_image: "image inside {where, select, paragraph {paragraph} heading {heading} list {list} quote {quote} figure {figure} caption {caption} other {cell}} (moved after it)";
81
+ readonly drop_caption_marks: "marks inside a caption";
82
+ readonly drop_flattened: "{what, select, list {list} heading {heading} quote {quote} code {code} table {table} other {figure}} inside {where, select, paragraph {paragraph} heading {heading} list {list} quote {quote} figure {figure} caption {caption} other {cell}} (made a paragraph)";
83
+ readonly drop_inner_element: "element {name} inside {where, select, paragraph {paragraph} heading {heading} list {list} quote {quote} figure {figure} caption {caption} other {cell}}";
84
+ readonly drop_embed_no_url: "embed without a URL";
85
+ readonly drop_embed_not_https: "embed not using https";
86
+ readonly drop_image_no_src: "image without src";
87
+ readonly drop_list_element: "element {name} inside a list";
88
+ readonly drop_extra_nested_list: "second and later nested lists in a list item (joined)";
89
+ readonly drop_table_element: "element {name} inside a table";
90
+ };
@@ -0,0 +1,153 @@
1
+ /** 本文の検査の問題の文 */
2
+ export declare const BODY_PROBLEM_MESSAGES: {
3
+ readonly drop_attribute: "属性 {name}";
4
+ readonly drop_style: "style の {key}";
5
+ readonly drop_style_value: "style の {key} の値";
6
+ readonly drop_class: "class {name}";
7
+ readonly drop_unsafe_link: "安全でないリンク先";
8
+ readonly drop_element: "要素 {name}";
9
+ readonly drop_inline_image: "文の中の画像";
10
+ readonly drop_hoisted_image: "{where, select, paragraph {文} heading {見出し} list {リスト} quote {引用} figure {figure} caption {キャプション} other {セル}}の中の画像(後へ)";
11
+ readonly drop_caption_marks: "キャプションの中の装飾";
12
+ readonly drop_flattened: "{where, select, paragraph {文} heading {見出し} list {リスト} quote {引用} figure {figure} caption {キャプション} other {セル}}の中の{what, select, list {リスト} heading {見出し} quote {引用} code {コード} table {表} other {図}}(段落に)";
13
+ readonly drop_inner_element: "{where, select, paragraph {文} heading {見出し} list {リスト} quote {引用} figure {figure} caption {キャプション} other {セル}}の中の要素 {name}";
14
+ readonly drop_embed_no_url: "URL のない埋め込み";
15
+ readonly drop_embed_not_https: "https でない埋め込み";
16
+ readonly drop_image_no_src: "src のない画像";
17
+ readonly drop_list_element: "リストの中の要素 {name}";
18
+ readonly drop_extra_nested_list: "リストの項目の中の2つ目以降の入れ子のリスト(つなぐ)";
19
+ readonly drop_table_element: "表の中の要素 {name}";
20
+ readonly url_https: "URL は https://";
21
+ readonly caption_missing: "注記が未入力";
22
+ readonly cite_source_missing: "注の参考資料が未入力";
23
+ readonly speech_missing: "発言が未入力";
24
+ readonly diagram_source_missing: "図の記法が未入力";
25
+ readonly diagram_alt_missing: "図の代替テキストが未入力";
26
+ readonly gallery_min: "ギャラリーの画像は2枚以上";
27
+ readonly link_title_missing: "リンクのタイトルが未入力";
28
+ readonly link_ref_format: "ref は「コレクションの id/レコードの ID」";
29
+ readonly embed_id_invalid: "埋め込みの ID が不正";
30
+ readonly prop_key_format: "引数の名前は英字で始まる英数字";
31
+ readonly prop_enum_string: "選択肢 enum は文字列の引数だけ";
32
+ readonly prop_items: "配列の引数は items が必要(ほかの型は不可)";
33
+ readonly prop_properties_object: "properties・required はオブジェクトの引数だけ";
34
+ readonly prop_required_missing: "必須の引数 {key} が properties にない";
35
+ readonly component_name_format: "部品の名前は英字で始まる英数字とハイフン";
36
+ readonly component_label_missing: "部品の表示名が未入力";
37
+ readonly component_name_reserved: "部品の名前 {name} はコアの部品・予約の名前と重複";
38
+ readonly inline_prop_string: "インラインの部品の引数は文字列だけ: {key}";
39
+ readonly component_name_duplicate: "部品の名前 {name} が重複";
40
+ readonly prop_missing: "{label}が未入力";
41
+ readonly prop_shape: "{label}の形が不正";
42
+ readonly prop_integer: "{label}は整数";
43
+ readonly component_props_shape: "{label}の引数の形が不正";
44
+ readonly inline_component_here: "この場所ではインラインのコンポーネントは使えない";
45
+ readonly inline_component_unavailable: "インラインのコンポーネント {name} は使えない";
46
+ readonly marks_here: "この場所では装飾・リンクは使えない";
47
+ readonly mark_unavailable: "{mark, select, strong {太字} em {斜体} code {コード} strike {取り消し線} mark {蛍光ペン} sup {上付き} sub {下付き} other {下線}}は使えない";
48
+ readonly marks_combined: "装飾の重ね掛け・装飾つきのリンクは使えない";
49
+ readonly link_rel_unavailable: "リンクの rel={rel} は使えない";
50
+ readonly link_target_unavailable: "リンクを別のタブで開く指定は使えない";
51
+ readonly link_unsafe: "リンク先 {href} は使えない(https://・http://・mailto:・/ で始まるサイト内のパス・# で始まるページ内のリンクだけ)";
52
+ readonly text_style_here: "この場所では文字の見た目は使えない";
53
+ readonly style_unavailable: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}は使えない";
54
+ readonly style_name_unknown: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}の名前 {name} は本文の設定にない";
55
+ readonly style_empty: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}の名前と値がない";
56
+ readonly style_value_unsafe: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}の値 {value} は使えない";
57
+ readonly named_style_unknown: "名前のついた装飾 {name} は本文の設定にない";
58
+ readonly align_unavailable: "揃えは使えない";
59
+ readonly table_cells_unavailable: "属性つきの表のセルは使えない";
60
+ readonly table_span_invalid: "セルの結合の数は1以上";
61
+ readonly variant_unavailable: "表示の種類 {variant} は使えない";
62
+ readonly heading_unavailable: "見出し{level}は使えない(使える見出し: {levels})";
63
+ readonly list_unavailable: "リストは使えない";
64
+ readonly list_nested_unavailable: "入れ子のリストは使えない";
65
+ readonly list_ordered_unavailable: "番号のリストは使えない";
66
+ readonly quote_unavailable: "引用は使えない";
67
+ readonly quote_single: "引用は1段落まで";
68
+ readonly quote_cite_unavailable: "引用の出典は使えない";
69
+ readonly code_unavailable: "コードは使えない";
70
+ readonly code_caption_unavailable: "コードの説明は使えない";
71
+ readonly code_filename_unavailable: "コードのファイル名は使えない";
72
+ readonly code_component_lang: "```{lang} のコードは使えない(:::{component} で囲む)";
73
+ readonly image_unavailable: "画像は使えない";
74
+ readonly image_link_unavailable: "画像のリンクは使えない";
75
+ readonly image_align_unavailable: "画像の横の位置は使えない";
76
+ readonly file_unavailable: "ファイルは使えない";
77
+ readonly table_unavailable: "表は使えない";
78
+ readonly table_head_required: "表は見出しの行が必須";
79
+ readonly table_caption_required: "表は説明(caption)が必須";
80
+ readonly table_caption_unavailable: "表の説明は使えない";
81
+ readonly divider_unavailable: "区切りは使えない";
82
+ readonly html_unavailable: "HTML のブロックは使えない";
83
+ readonly component_unavailable: "コンポーネント {name} は使えない";
84
+ readonly link_href_missing: "リンク先が未入力";
85
+ readonly inline_component_missing: "インラインのコンポーネント {name} はない";
86
+ readonly heading_empty: "見出しが未入力";
87
+ readonly component_missing: "コンポーネント {name} はない";
88
+ readonly markdown_unparsable: "解析できない Markdown: {error}";
89
+ readonly block_problem: "{index}番目のブロック: {problem}";
90
+ };
91
+ /**
92
+ * 書き手と AI への Markdown の説明(profile.ts の describeMarkdown)
93
+ * - 記法の中の波かっこは ICU の文字として '{' と '}' で囲む
94
+ */
95
+ export declare const BODY_GUIDE_LABELS: {
96
+ readonly title: "本文の Markdown(下にあるものだけ使用可、ほかは保存で拒否)";
97
+ readonly heading: "- 見出し: {examples}(ID は末尾に '{'#id'}'{plain, select, yes {、装飾なし} other {}})";
98
+ readonly headingExample: "{hashes} 見出し{level}";
99
+ readonly paragraph: "- 段落: 空行で区切る、段落の中の改行は行末に \\";
100
+ readonly variants: "、表示の種類 {syntax} で囲む";
101
+ readonly list: "- リスト: - 項目{ordered, select, yes {・1. 番号つき} other {}}{nested, select, yes {(入れ子は字下げ)} other {(入れ子なし)}}{variants}";
102
+ readonly quote: "- 引用: > 引用文({multiple, select, yes {複数の段落可} other {1段落}}{cite, select, yes {、出典は :::block'{'cite=\"名前\" cite-href=\"https://…\"'}' で囲む} other {}})";
103
+ readonly code: "- コード: ```言語 のフェンス{caption, select, yes {(説明は :::block'{'caption=\"説明\"'}' で囲む)} other {}}";
104
+ readonly codeComponentLang: "- ```{lang} のフェンスは :::{component} の中だけ(フェンスだけでは表示されない)";
105
+ readonly image: "- 画像: ![代替テキスト]({source} \"説明\") だけの段落(\"説明\" はキャプションで任意{variants})";
106
+ readonly imageSource: "参照";
107
+ readonly table: "- 表: GFM の表(見出しの行{head, select, required {は必須} other {なしは :::block'{'nohead'}' で囲む}}{plain, select, yes {、装飾なし} other {}}{caption, select, required {、説明は必須で :::block'{'caption=\"説明\"'}' で囲む} optional {、説明は :::block'{'caption=\"説明\"'}' で囲む} other {}})";
108
+ readonly tableCells: "- 結合や見出しの列のある表: :::table'{'caption=\"説明\"'}' の中に ```json のフェンスで '{'\"rows\": [['{'\"content\": [[\"文字\"]], \"header\": true, \"colspan\": 2'}']]'}'";
109
+ readonly imageAttrs: "- 画像の{what, select, both {リンクと横の位置} link {リンク} other {横の位置}}: :::block'{'{attrs}'}' で囲む";
110
+ readonly codeFilename: "- コードのファイル名: :::block'{'filename=\"名前\"'}' で囲む";
111
+ readonly file: "- ファイル: :::file'{'src=\"参照\" label=\"リンクの文字\"'}'";
112
+ readonly align: "- 段落と見出しの揃え: :::block'{'align=left|center|right|justify'}' で囲む";
113
+ readonly divider: "- 区切り: ---";
114
+ readonly html: "- HTML: ```=html のフェンス";
115
+ readonly marks: "- 装飾: {syntax}{combine, select, no {(重ね掛け不可)} other {}}";
116
+ readonly markSyntax: "{mark, select, strong {**太字**} em {*斜体*} code {`コード`} strike {~~取り消し線~~} mark {:mark[蛍光ペン]} sup {:sup[上付き]} sub {:sub[下付き]} other {:u[下線]}}";
117
+ readonly styleValue: "{key}=\"CSS の値\"";
118
+ readonly styleNames: "styles=\"{names}\" のどれか(空白で区切る)";
119
+ readonly textStyle: "- 文字の見た目: :span[文字]'{'属性'}'(属性: {attrs})";
120
+ readonly link: "- リンク: [文字](https://…){rels, select, none {} other {、rel つきは :link[文字]'{'href=\"https://…\" rel={rels}'}'}}{target, select, yes {、別のタブは :link[文字]'{'href=\"https://…\" target=_blank'}'} other {}}{combine, select, no {(装飾つきは不可)} other {}}";
121
+ readonly component: "- {inline, select, yes {インラインの} other {}}コンポーネント {name}: {description}";
122
+ readonly componentExample: " 例: {example}";
123
+ readonly unused: "- 使えないもの: {items}";
124
+ readonly unusedHeading: "見出し{level}";
125
+ readonly mark: "{mark, select, strong {太字} em {斜体} code {コード} strike {取り消し線} mark {蛍光ペン} sup {上付き} sub {下付き} other {下線}}";
126
+ readonly unusedBlock: "{block, select, list {リスト} quote {引用} code {コード} image {画像} table {表} divider {区切り} other {HTML}}";
127
+ readonly separator: "・";
128
+ readonly listSeparator: "、";
129
+ };
130
+ /** 核の部品の説明と例(library.ts、書き手と AI への説明と管理画面の部品の一覧) */
131
+ export declare const CORE_COMPONENT_LABELS: {
132
+ readonly citeDescription: "注(参考資料の ID を参照、参考資料はコンテンツに結び付けが必要)";
133
+ readonly citeExample: ":cite'{'#出典の ID'}'";
134
+ readonly pendingDescription: "未定の値(方針のページで値が決まっていない箇所)";
135
+ readonly pendingExample: ":pending[未定]";
136
+ readonly speechDescription: "発言(会話の一言を大きく引く、1段落)";
137
+ readonly speechExample: ":::speech\n大きく引く一言\n:::";
138
+ readonly chartDescription: "グラフ(中は JSON、chart は bar・line・pie・heat、caption は必須)";
139
+ readonly chartExample: ":::chart\n```json\n'{'\"chart\": \"bar\", \"unit\": \"%\", \"data\": ['{'\"label\": \"A\", \"value\": 40'}'], \"caption\": \"説明\"'}'\n```\n:::";
140
+ readonly diagramDescription: "図(中は Mermaid、alt は図の内容の説明、caption は必須)";
141
+ readonly diagramExample: ":::diagram'{'alt=\"内容の説明\" caption=\"説明\"'}'\n```mermaid\nflowchart LR\n A --> B\n```\n:::";
142
+ readonly galleryDescription: "複数の画像を2列で配置(画像は2枚以上)";
143
+ readonly galleryExample: ":::gallery\n![](asset/'<'画像の ID'>' \"説明\")\n\n![](asset/'<'画像の ID'>' \"説明\")\n:::";
144
+ readonly linkCardDescription: "リンクのカード(外のページは https と題名、site・desc・画像は任意。中のコンテンツは ref=\"コレクションの id/レコードの ID\")";
145
+ readonly linkCardExample: ":::link-card'{'href=\"https://…\" title=\"ページの題\" site=\"サイト名\" desc=\"説明\"'}'\n:::";
146
+ readonly embedDescription: "外のサービスの埋め込み(provider は {providers}、id はサービスの中の ID、url は元の URL、start は開始の秒)";
147
+ readonly linksDescription: "外部リンクの一覧(1件1行、リンクの title はサイト名、label は小見出しで既定は「参考」)";
148
+ readonly linksExample: ":::links'{'label=\"参考\"'}'\n- [ページの題](https://… \"サイト名\")\n:::";
149
+ readonly declaredRequired: "(必須)";
150
+ readonly declaredProps: "引数: {props}";
151
+ readonly declaredInlineText: "文字";
152
+ readonly declaredJoin: "。";
153
+ };
@@ -0,0 +1,113 @@
1
+ import { z } from 'zod';
2
+ import type { ComponentDef } from './components.js';
3
+ import { type EmbedProvider } from './embed.js';
4
+ /** グラフの項目と値 */
5
+ export type ChartDatum = Readonly<{
6
+ label: string;
7
+ value: number;
8
+ }>;
9
+ /** グラフの色(テーマの系列の番号) */
10
+ export type ChartColor = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
11
+ /**
12
+ * グラフ(コンポーネント chart の props から caption を除いた形)
13
+ * - bar: 横棒、pie: 割合
14
+ * - line: 折れ線(series の values は labels と同じ長さ)
15
+ * - heat: 濃淡の表(rows の values は cols と同じ長さ)
16
+ */
17
+ export type Chart = Readonly<{
18
+ chart: 'bar';
19
+ data: readonly ChartDatum[];
20
+ unit: string;
21
+ color?: ChartColor;
22
+ } | {
23
+ chart: 'line';
24
+ labels: readonly string[];
25
+ series: readonly Readonly<{
26
+ name: string;
27
+ values: readonly number[];
28
+ }>[];
29
+ unit: string;
30
+ } | {
31
+ chart: 'pie';
32
+ data: readonly ChartDatum[];
33
+ unit: string;
34
+ } | {
35
+ chart: 'heat';
36
+ cols: readonly string[];
37
+ rows: readonly Readonly<{
38
+ label: string;
39
+ values: readonly number[];
40
+ }>[];
41
+ unit: string;
42
+ color?: ChartColor;
43
+ }>;
44
+ /** 核のコンポーネントの props(名前ごと、インラインは属性) */
45
+ export type ComponentProps<M> = Readonly<{
46
+ cite: Readonly<{
47
+ id: string;
48
+ }>;
49
+ pending: Readonly<Record<string, never>>;
50
+ speech: Readonly<{
51
+ text: string;
52
+ }>;
53
+ chart: Chart & Readonly<{
54
+ caption: string;
55
+ }>;
56
+ diagram: Readonly<{
57
+ source: string;
58
+ alt: string;
59
+ caption: string;
60
+ }>;
61
+ gallery: Readonly<{
62
+ items: readonly Readonly<{
63
+ media: M;
64
+ caption?: string;
65
+ }>[];
66
+ }>;
67
+ /** 外のページは href と保存のときの OGP のコピー(fetchedAt は取得の日時)、中のコンテンツは ref(コレクションの id/レコードの ID、題名と画像は配信のときに参照先から) */
68
+ 'link-card': Readonly<{
69
+ href: `https://${string}`;
70
+ title: string;
71
+ site?: string;
72
+ desc?: string;
73
+ image?: M;
74
+ fetchedAt?: string;
75
+ }> | Readonly<{
76
+ ref: string;
77
+ title?: string;
78
+ site?: string;
79
+ desc?: string;
80
+ image?: M;
81
+ }>;
82
+ /** 外のサービスの埋め込み(id はサービスの中の ID、url は元の URL、start は開始の秒) */
83
+ embed: Readonly<{
84
+ provider: EmbedProvider;
85
+ id: string;
86
+ url: `https://${string}`;
87
+ width?: number;
88
+ height?: number;
89
+ start?: number;
90
+ title?: string;
91
+ }>;
92
+ links: Readonly<{
93
+ label?: string;
94
+ items: readonly Readonly<{
95
+ href: `https://${string}`;
96
+ title: string;
97
+ site?: string;
98
+ }>[];
99
+ }>;
100
+ }>;
101
+ /** 核のコンポーネントの名前 */
102
+ export type ComponentName = keyof ComponentProps<unknown>;
103
+ /** 核のコンポーネントの定義(props は検査、インラインは属性の検査) */
104
+ export type CoreComponent = ComponentDef<unknown> & Readonly<{
105
+ name: ComponentName;
106
+ props: (media: z.ZodType) => z.ZodType;
107
+ }>;
108
+ /** 注のコンポーネントの名前(本文からの算出 citesOf が参照) */
109
+ export declare const CITE = "cite";
110
+ /** 核のコンポーネント(chart の Markdown は既定の JSON) */
111
+ export declare const CORE_COMPONENTS: readonly CoreComponent[];
112
+ /** 名前から核のコンポーネント(なければ undefined) */
113
+ export declare const coreComponentOf: (name: string) => CoreComponent | undefined;
@@ -0,0 +1,14 @@
1
+ import { type ComponentDef } from './components.js';
2
+ import { type Body } from './types.js';
3
+ /** マッパーの設定(media は画像の参照と Markdown の文字列の変換) */
4
+ export type MarkdownOptions<M> = Readonly<{
5
+ media: Readonly<{
6
+ toSrc(media: M): string;
7
+ fromSrc(src: string): M;
8
+ }>;
9
+ components?: readonly ComponentDef<M>[];
10
+ }>;
11
+ /** 本文を Markdown に */
12
+ export declare function toMarkdown<M>(body: Body<M>, options: MarkdownOptions<M>): string;
13
+ /** Markdown を本文に(解析できない構文は例外) */
14
+ export declare function fromMarkdown<M>(markdown: string, options: MarkdownOptions<M>): Body<M>;
@@ -0,0 +1,5 @@
1
+ import { type Body, type Rich } from './types.js';
2
+ /** インラインの断片の列を正規化 */
3
+ export declare function normalizeRich(rich: Rich): Rich;
4
+ /** 本文を正規化 */
5
+ export declare function normalizeBody<M>(body: Body<M>): Body<M>;
@@ -0,0 +1,103 @@
1
+ import { type ParamsArg } from '../../i18n/src/index.js';
2
+ import { BODY_GUIDE_LABELS, BODY_PROBLEM_MESSAGES, CORE_COMPONENT_LABELS } from './labels/ja.js';
3
+ type Messages = typeof BODY_PROBLEM_MESSAGES;
4
+ export type BodyProblemCode = keyof Messages;
5
+ /** 本文の検査の問題を作る */
6
+ export declare const bodyProblem: import("../../i18n/src/index.js").ProblemFactory<{
7
+ readonly drop_attribute: "属性 {name}";
8
+ readonly drop_style: "style の {key}";
9
+ readonly drop_style_value: "style の {key} の値";
10
+ readonly drop_class: "class {name}";
11
+ readonly drop_unsafe_link: "安全でないリンク先";
12
+ readonly drop_element: "要素 {name}";
13
+ readonly drop_inline_image: "文の中の画像";
14
+ readonly drop_hoisted_image: "{where, select, paragraph {文} heading {見出し} list {リスト} quote {引用} figure {figure} caption {キャプション} other {セル}}の中の画像(後へ)";
15
+ readonly drop_caption_marks: "キャプションの中の装飾";
16
+ readonly drop_flattened: "{where, select, paragraph {文} heading {見出し} list {リスト} quote {引用} figure {figure} caption {キャプション} other {セル}}の中の{what, select, list {リスト} heading {見出し} quote {引用} code {コード} table {表} other {図}}(段落に)";
17
+ readonly drop_inner_element: "{where, select, paragraph {文} heading {見出し} list {リスト} quote {引用} figure {figure} caption {キャプション} other {セル}}の中の要素 {name}";
18
+ readonly drop_embed_no_url: "URL のない埋め込み";
19
+ readonly drop_embed_not_https: "https でない埋め込み";
20
+ readonly drop_image_no_src: "src のない画像";
21
+ readonly drop_list_element: "リストの中の要素 {name}";
22
+ readonly drop_extra_nested_list: "リストの項目の中の2つ目以降の入れ子のリスト(つなぐ)";
23
+ readonly drop_table_element: "表の中の要素 {name}";
24
+ readonly url_https: "URL は https://";
25
+ readonly caption_missing: "注記が未入力";
26
+ readonly cite_source_missing: "注の参考資料が未入力";
27
+ readonly speech_missing: "発言が未入力";
28
+ readonly diagram_source_missing: "図の記法が未入力";
29
+ readonly diagram_alt_missing: "図の代替テキストが未入力";
30
+ readonly gallery_min: "ギャラリーの画像は2枚以上";
31
+ readonly link_title_missing: "リンクのタイトルが未入力";
32
+ readonly link_ref_format: "ref は「コレクションの id/レコードの ID」";
33
+ readonly embed_id_invalid: "埋め込みの ID が不正";
34
+ readonly prop_key_format: "引数の名前は英字で始まる英数字";
35
+ readonly prop_enum_string: "選択肢 enum は文字列の引数だけ";
36
+ readonly prop_items: "配列の引数は items が必要(ほかの型は不可)";
37
+ readonly prop_properties_object: "properties・required はオブジェクトの引数だけ";
38
+ readonly prop_required_missing: "必須の引数 {key} が properties にない";
39
+ readonly component_name_format: "部品の名前は英字で始まる英数字とハイフン";
40
+ readonly component_label_missing: "部品の表示名が未入力";
41
+ readonly component_name_reserved: "部品の名前 {name} はコアの部品・予約の名前と重複";
42
+ readonly inline_prop_string: "インラインの部品の引数は文字列だけ: {key}";
43
+ readonly component_name_duplicate: "部品の名前 {name} が重複";
44
+ readonly prop_missing: "{label}が未入力";
45
+ readonly prop_shape: "{label}の形が不正";
46
+ readonly prop_integer: "{label}は整数";
47
+ readonly component_props_shape: "{label}の引数の形が不正";
48
+ readonly inline_component_here: "この場所ではインラインのコンポーネントは使えない";
49
+ readonly inline_component_unavailable: "インラインのコンポーネント {name} は使えない";
50
+ readonly marks_here: "この場所では装飾・リンクは使えない";
51
+ readonly mark_unavailable: "{mark, select, strong {太字} em {斜体} code {コード} strike {取り消し線} mark {蛍光ペン} sup {上付き} sub {下付き} other {下線}}は使えない";
52
+ readonly marks_combined: "装飾の重ね掛け・装飾つきのリンクは使えない";
53
+ readonly link_rel_unavailable: "リンクの rel={rel} は使えない";
54
+ readonly link_target_unavailable: "リンクを別のタブで開く指定は使えない";
55
+ readonly link_unsafe: "リンク先 {href} は使えない(https://・http://・mailto:・/ で始まるサイト内のパス・# で始まるページ内のリンクだけ)";
56
+ readonly text_style_here: "この場所では文字の見た目は使えない";
57
+ readonly style_unavailable: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}は使えない";
58
+ readonly style_name_unknown: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}の名前 {name} は本文の設定にない";
59
+ readonly style_empty: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}の名前と値がない";
60
+ readonly style_value_unsafe: "{kind, select, color {文字の色} background {背景の色} other {文字の大きさ}}の値 {value} は使えない";
61
+ readonly named_style_unknown: "名前のついた装飾 {name} は本文の設定にない";
62
+ readonly align_unavailable: "揃えは使えない";
63
+ readonly table_cells_unavailable: "属性つきの表のセルは使えない";
64
+ readonly table_span_invalid: "セルの結合の数は1以上";
65
+ readonly variant_unavailable: "表示の種類 {variant} は使えない";
66
+ readonly heading_unavailable: "見出し{level}は使えない(使える見出し: {levels})";
67
+ readonly list_unavailable: "リストは使えない";
68
+ readonly list_nested_unavailable: "入れ子のリストは使えない";
69
+ readonly list_ordered_unavailable: "番号のリストは使えない";
70
+ readonly quote_unavailable: "引用は使えない";
71
+ readonly quote_single: "引用は1段落まで";
72
+ readonly quote_cite_unavailable: "引用の出典は使えない";
73
+ readonly code_unavailable: "コードは使えない";
74
+ readonly code_caption_unavailable: "コードの説明は使えない";
75
+ readonly code_filename_unavailable: "コードのファイル名は使えない";
76
+ readonly code_component_lang: "```{lang} のコードは使えない(:::{component} で囲む)";
77
+ readonly image_unavailable: "画像は使えない";
78
+ readonly image_link_unavailable: "画像のリンクは使えない";
79
+ readonly image_align_unavailable: "画像の横の位置は使えない";
80
+ readonly file_unavailable: "ファイルは使えない";
81
+ readonly table_unavailable: "表は使えない";
82
+ readonly table_head_required: "表は見出しの行が必須";
83
+ readonly table_caption_required: "表は説明(caption)が必須";
84
+ readonly table_caption_unavailable: "表の説明は使えない";
85
+ readonly divider_unavailable: "区切りは使えない";
86
+ readonly html_unavailable: "HTML のブロックは使えない";
87
+ readonly component_unavailable: "コンポーネント {name} は使えない";
88
+ readonly link_href_missing: "リンク先が未入力";
89
+ readonly inline_component_missing: "インラインのコンポーネント {name} はない";
90
+ readonly heading_empty: "見出しが未入力";
91
+ readonly component_missing: "コンポーネント {name} はない";
92
+ readonly markdown_unparsable: "解析できない Markdown: {error}";
93
+ readonly block_problem: "{index}番目のブロック: {problem}";
94
+ }>;
95
+ /** 問題の英語の既定の文(zod の message と検査の issues に入れ、problemOf で戻す) */
96
+ export declare const bodyProblemText: <K extends BodyProblemCode>(code: K, ...params: ParamsArg<Messages[K]>) => string;
97
+ type Guide = typeof BODY_GUIDE_LABELS;
98
+ /** Markdown の説明の文言 */
99
+ export declare const guideText: <K extends keyof Guide>(key: K, ...params: ParamsArg<Guide[K]>) => string;
100
+ type Components = typeof CORE_COMPONENT_LABELS;
101
+ /** 部品の説明の文言(核の部品の説明と、宣言した部品の説明の組み立て) */
102
+ export declare const componentText: <K extends keyof Components>(key: K, ...params: ParamsArg<Components[K]>) => string;
103
+ export {};
@@ -0,0 +1,80 @@
1
+ import type { ComponentDef } from './components.js';
2
+ import { type Body, type HeadingLevel, type Mark } from './types.js';
3
+ /** 本文の設定 */
4
+ export type BodyProfile = Readonly<{
5
+ headings: readonly HeadingLevel[];
6
+ marks: readonly Mark[];
7
+ /** 装飾の重ね掛けと装飾つきのリンク(既定は可) */
8
+ combineMarks?: boolean;
9
+ /** リンクの rel(なしは rel なしのリンクだけ) */
10
+ linkRels?: readonly string[];
11
+ /** 装飾・リンク・インラインのコンポーネントを使用できない場所 */
12
+ plain?: readonly ('heading' | 'tableHead')[];
13
+ /** リンクを別のタブで開く指定(既定は不可) */
14
+ linkTargets?: true;
15
+ /** 文字の見た目(色・背景・大きさは名前の宣言、項目がないものは使用不可、styles は名前のついた装飾の宣言) */
16
+ textStyle?: Readonly<{
17
+ color?: readonly NamedValue[];
18
+ background?: readonly NamedValue[];
19
+ size?: readonly NamedValue[];
20
+ styles?: readonly NamedStyle[];
21
+ }>;
22
+ /** 段落と見出しの揃え */
23
+ align?: true;
24
+ list?: Readonly<{
25
+ ordered: boolean;
26
+ nested: boolean;
27
+ variants?: readonly string[];
28
+ }>;
29
+ quote?: Readonly<{
30
+ multiple: boolean;
31
+ cite: boolean;
32
+ }>;
33
+ /** コード(filename はファイル名、componentLangs はコンポーネントで書く言語とコンポーネントの名前、例: mermaid は図、その言語のフェンスだけのコードは不可) */
34
+ code?: Readonly<{
35
+ caption: boolean;
36
+ filename?: boolean;
37
+ componentLangs?: Readonly<Record<string, string>>;
38
+ }>;
39
+ /** 画像(link は画像のリンク、align は横の位置) */
40
+ image?: Readonly<{
41
+ variants?: readonly string[];
42
+ link?: boolean;
43
+ align?: boolean;
44
+ }>;
45
+ /** 表(cells は属性つきのセル: 見出しのセル・結合・揃え・複数の段落) */
46
+ table?: Readonly<{
47
+ head: 'required' | 'optional';
48
+ caption: 'required' | 'optional' | 'none';
49
+ cells?: boolean;
50
+ }>;
51
+ /** ファイル(実体の参照とリンクの文字) */
52
+ file?: true;
53
+ divider?: true;
54
+ html?: true;
55
+ /** 使用できるコンポーネントの名前(ブロック・インライン) */
56
+ components: readonly string[];
57
+ }>;
58
+ /** 名前のついた値の宣言(label は管理画面の表示名、value はサイトが対応を持たないときの既定の CSS の値) */
59
+ export type NamedValue = Readonly<{
60
+ name: string;
61
+ label: string;
62
+ value?: string;
63
+ }>;
64
+ /** 名前のついた装飾の宣言(見せ方はサイトが名前で決める) */
65
+ export type NamedStyle = Readonly<{
66
+ name: string;
67
+ label: string;
68
+ }>;
69
+ /** 本文の設定に合わない箇所(index は本文のブロックの位置、0から) */
70
+ type BodyProblem = Readonly<{
71
+ index: number;
72
+ message: string;
73
+ }>;
74
+ /** 元の CSS の値として描画してよいか(kind は色か大きさ) */
75
+ export declare const isSafeCssValue: (kind: "color" | "background" | "size", value: string) => boolean;
76
+ /** 本文を設定で検査(合わない箇所をすべて返却) */
77
+ export declare function checkBody<M>(body: Body<M>, profile: BodyProfile): BodyProblem[];
78
+ /** 書き手と AI への Markdown の説明(使用できるものを記法の例つきで列挙し、使用できないものは末尾、mediaExample は画像の参照の例) */
79
+ export declare function describeMarkdown<M>(profile: BodyProfile, components?: readonly ComponentDef<M>[], mediaExample?: string): string;
80
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type Body, type ComponentBlock } from './types.js';
2
+ /** 画像の描画の値 */
3
+ export type RenderedImage = Readonly<{
4
+ url: string;
5
+ width?: number;
6
+ height?: number;
7
+ alt?: string;
8
+ }>;
9
+ /** 描画の設定 */
10
+ export type RenderOptions<M> = Readonly<{
11
+ /** 画像の URL と寸法(null は描画しない) */
12
+ image(media: M): RenderedImage | null;
13
+ /** ファイルの URL(なし・null は描画しない) */
14
+ file?(media: M): Readonly<{
15
+ url: string;
16
+ }> | null;
17
+ /** 名前に対応する CSS の値(undefined は元の値) */
18
+ named?(kind: 'color' | 'background' | 'size', name: string): string | undefined;
19
+ /** 名前のついた装飾の class */
20
+ styleClass?(name: string): string;
21
+ /** コンポーネントの描画(null は既定の描画) */
22
+ component?(block: ComponentBlock, render: (body: Body<M>) => string): string | null;
23
+ /** インラインのコンポーネントの描画(null は中の文字) */
24
+ inlineComponent?(component: string, props: Readonly<Record<string, string>>, text: string): string | null;
25
+ /** HTML のブロックを生のまま描画 */
26
+ allowHtml?: boolean;
27
+ }>;
28
+ /** 本文を HTML に */
29
+ export declare function bodyToHtml<M>(body: Body<M>, options: RenderOptions<M>): string;
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import { type DeclaredComponent } from './declared.js';
3
+ import { type BodyProfile } from './profile.js';
4
+ import { type Block } from './types.js';
5
+ /** 本文の1ブロックの検査(profile は本文の設定、media は画像の参照の検査、declared は導入先が宣言した部品) */
6
+ export declare function blockSchemaOf<M>(profile: BodyProfile, media: z.ZodType<M>, declared?: readonly DeclaredComponent[]): z.ZodType<Block<M>>;
@@ -0,0 +1,20 @@
1
+ import { type DeclaredComponent } from './declared.js';
2
+ import { type MarkdownOptions } from './markdown.js';
3
+ import { type BodyProfile } from './profile.js';
4
+ import type { Body } from './types.js';
5
+ /** 画像の参照と Markdown の文字列の変換(example は説明の例の参照) */
6
+ export type MediaSyntax<M> = MarkdownOptions<M>['media'] & Readonly<{
7
+ example: string;
8
+ }>;
9
+ /** Markdown の解析の結果(problems は設定に合わない箇所のすべて) */
10
+ export type MarkdownResult<M> = Readonly<{
11
+ body: Body<M>;
12
+ }> | Readonly<{
13
+ problems: readonly string[];
14
+ }>;
15
+ /** 本文を Markdown に(declared は導入先が宣言した部品) */
16
+ export declare const bodyToMarkdown: <M>(body: Body<M>, media: MediaSyntax<M>, declared?: readonly DeclaredComponent[]) => string;
17
+ /** Markdown を本文に(解析できない・設定に合わない内容は problems、declared は導入先が宣言した部品) */
18
+ export declare function bodyFromMarkdown<M>(markdown: string, profile: BodyProfile, media: MediaSyntax<M>, declared?: readonly DeclaredComponent[]): MarkdownResult<M>;
19
+ /** 書き手と AI へ最初に提示する Markdown の説明(設定と核のコンポーネント・宣言した部品から作成) */
20
+ export declare const markdownGuide: (profile: BodyProfile, media: Pick<MediaSyntax<unknown>, "example">, declared?: readonly DeclaredComponent[]) => string;