@heycys/gallery 0.0.0-stage → 0.1.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 (785) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/THIRD-PARTY-NOTICES.md +3253 -0
  4. package/assets/writing-preferences.md +107 -0
  5. package/bin/gallery.mjs +10 -0
  6. package/browser/editor/components/bookmark/icons.mjs +6 -0
  7. package/browser/editor/components/bookmark/index.mjs +80 -0
  8. package/browser/editor/components/bookmark/page.mjs +147 -0
  9. package/browser/editor/components/builders.mjs +19 -0
  10. package/browser/editor/components/callout/index.mjs +39 -0
  11. package/browser/editor/components/callout/page.mjs +13 -0
  12. package/browser/editor/components/code/index.mjs +327 -0
  13. package/browser/editor/components/code/page.mjs +561 -0
  14. package/browser/editor/components/colors.mjs +50 -0
  15. package/browser/editor/components/columns/index.mjs +104 -0
  16. package/browser/editor/components/columns/page.mjs +297 -0
  17. package/browser/editor/components/details/index.mjs +72 -0
  18. package/browser/editor/components/details/page.mjs +86 -0
  19. package/browser/editor/components/dialog/index.mjs +83 -0
  20. package/browser/editor/components/dialog/page.mjs +219 -0
  21. package/browser/editor/components/divider/index.mjs +48 -0
  22. package/browser/editor/components/embed/icons.mjs +11 -0
  23. package/browser/editor/components/embed/index.mjs +123 -0
  24. package/browser/editor/components/embed/page.mjs +309 -0
  25. package/browser/editor/components/figure/index.mjs +87 -0
  26. package/browser/editor/components/figure/page.mjs +33 -0
  27. package/browser/editor/components/file/icons.mjs +14 -0
  28. package/browser/editor/components/file/index.mjs +77 -0
  29. package/browser/editor/components/file/page.mjs +114 -0
  30. package/browser/editor/components/flowchart/add.mjs +123 -0
  31. package/browser/editor/components/flowchart/index.mjs +246 -0
  32. package/browser/editor/components/flowchart/page.mjs +453 -0
  33. package/browser/editor/components/heading/index.mjs +51 -0
  34. package/browser/editor/components/highlight/index.mjs +79 -0
  35. package/browser/editor/components/icon/index.mjs +57 -0
  36. package/browser/editor/components/icon/page.mjs +286 -0
  37. package/browser/editor/components/icons.mjs +45 -0
  38. package/browser/editor/components/image/crop.mjs +189 -0
  39. package/browser/editor/components/image/index.mjs +104 -0
  40. package/browser/editor/components/image/page.mjs +385 -0
  41. package/browser/editor/components/image/viewer.mjs +213 -0
  42. package/browser/editor/components/installed/index.mjs +133 -0
  43. package/browser/editor/components/installed/page.mjs +422 -0
  44. package/browser/editor/components/installed/served.mjs +35 -0
  45. package/browser/editor/components/kit.mjs +64 -0
  46. package/browser/editor/components/list/index.mjs +194 -0
  47. package/browser/editor/components/list/join.mjs +68 -0
  48. package/browser/editor/components/list/numbers.mjs +107 -0
  49. package/browser/editor/components/list/page.mjs +632 -0
  50. package/browser/editor/components/math/index.mjs +88 -0
  51. package/browser/editor/components/math/page.mjs +236 -0
  52. package/browser/editor/components/math/tex-logo.mjs +6 -0
  53. package/browser/editor/components/media/icons.mjs +19 -0
  54. package/browser/editor/components/media/page.mjs +162 -0
  55. package/browser/editor/components/media/parts.mjs +60 -0
  56. package/browser/editor/components/media/size.mjs +20 -0
  57. package/browser/editor/components/media/toolbar.mjs +37 -0
  58. package/browser/editor/components/media/write.mjs +7 -0
  59. package/browser/editor/components/pages.mjs +46 -0
  60. package/browser/editor/components/paragraph/index.mjs +43 -0
  61. package/browser/editor/components/paragraph/page.mjs +52 -0
  62. package/browser/editor/components/placeholder-bar.mjs +17 -0
  63. package/browser/editor/components/placeholder.mjs +128 -0
  64. package/browser/editor/components/quote/index.mjs +33 -0
  65. package/browser/editor/components/registry.mjs +833 -0
  66. package/browser/editor/components/rows.mjs +16 -0
  67. package/browser/editor/components/section/index.mjs +41 -0
  68. package/browser/editor/components/section/page.mjs +141 -0
  69. package/browser/editor/components/sheets/index.mjs +137 -0
  70. package/browser/editor/components/sheets/page.mjs +227 -0
  71. package/browser/editor/components/sheets/pills.mjs +226 -0
  72. package/browser/editor/components/table/grid.mjs +73 -0
  73. package/browser/editor/components/table/index.mjs +306 -0
  74. package/browser/editor/components/table/page.mjs +672 -0
  75. package/browser/editor/components/table/slots.mjs +41 -0
  76. package/browser/editor/components/widget/index.mjs +50 -0
  77. package/browser/editor/page/annotate/anchors.mjs +229 -0
  78. package/browser/editor/page/annotate/card.mjs +102 -0
  79. package/browser/editor/page/annotate/index.mjs +1629 -0
  80. package/browser/editor/page/at-menu/index.mjs +317 -0
  81. package/browser/editor/page/autosave.mjs +977 -0
  82. package/browser/editor/page/beside.mjs +21 -0
  83. package/browser/editor/page/block-info.mjs +63 -0
  84. package/browser/editor/page/block-menu/colors.mjs +82 -0
  85. package/browser/editor/page/block-menu/index.mjs +215 -0
  86. package/browser/editor/page/blocks.mjs +246 -0
  87. package/browser/editor/page/caret.mjs +679 -0
  88. package/browser/editor/page/chip-fills.mjs +126 -0
  89. package/browser/editor/page/clipboard/import/colors.mjs +192 -0
  90. package/browser/editor/page/clipboard/import/html.mjs +792 -0
  91. package/browser/editor/page/clipboard/import/inline.mjs +232 -0
  92. package/browser/editor/page/clipboard/import/languages.mjs +42 -0
  93. package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
  94. package/browser/editor/page/clipboard/import/math.mjs +100 -0
  95. package/browser/editor/page/clipboard/import/office.mjs +245 -0
  96. package/browser/editor/page/clipboard/import/read.mjs +120 -0
  97. package/browser/editor/page/clipboard/import/rich.mjs +29 -0
  98. package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
  99. package/browser/editor/page/clipboard/index.mjs +797 -0
  100. package/browser/editor/page/clipboard/own/blocks.mjs +202 -0
  101. package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
  102. package/browser/editor/page/clipboard/own/describe.mjs +115 -0
  103. package/browser/editor/page/clipboard/own/export.mjs +167 -0
  104. package/browser/editor/page/clipboard/own/ids.mjs +39 -0
  105. package/browser/editor/page/clipboard/own/index.mjs +13 -0
  106. package/browser/editor/page/clipboard/own/rules.mjs +44 -0
  107. package/browser/editor/page/clipboard/own/selection.mjs +159 -0
  108. package/browser/editor/page/clipboard/own/writers.mjs +326 -0
  109. package/browser/editor/page/columns/index.mjs +360 -0
  110. package/browser/editor/page/commit.mjs +1798 -0
  111. package/browser/editor/page/conflicts.mjs +269 -0
  112. package/browser/editor/page/convert.mjs +830 -0
  113. package/browser/editor/page/core.mjs +1655 -0
  114. package/browser/editor/page/drag/drop.mjs +307 -0
  115. package/browser/editor/page/drag/index.mjs +335 -0
  116. package/browser/editor/page/drag/preview.mjs +121 -0
  117. package/browser/editor/page/edge-scroll.mjs +50 -0
  118. package/browser/editor/page/editor.mjs +1725 -0
  119. package/browser/editor/page/emoji-picker/emoji-tab.mjs +278 -0
  120. package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
  121. package/browser/editor/page/emoji-picker/grid.mjs +79 -0
  122. package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
  123. package/browser/editor/page/emoji-picker/icons.mjs +32 -0
  124. package/browser/editor/page/emoji-picker/index.mjs +164 -0
  125. package/browser/editor/page/emoji-picker/styles.mjs +2 -0
  126. package/browser/editor/page/emoji-picker/support.mjs +202 -0
  127. package/browser/editor/page/emoji-picker/upload.mjs +235 -0
  128. package/browser/editor/page/export-report.mjs +23 -0
  129. package/browser/editor/page/fills.mjs +60 -0
  130. package/browser/editor/page/find/index.mjs +107 -0
  131. package/browser/editor/page/flags.mjs +70 -0
  132. package/browser/editor/page/format-bar/bar.mjs +448 -0
  133. package/browser/editor/page/format-bar/brush.mjs +77 -0
  134. package/browser/editor/page/format-bar/colors.mjs +46 -0
  135. package/browser/editor/page/format-bar/index.mjs +404 -0
  136. package/browser/editor/page/formula/index.mjs +236 -0
  137. package/browser/editor/page/formula/panel.mjs +336 -0
  138. package/browser/editor/page/formula/symbols.mjs +156 -0
  139. package/browser/editor/page/frame.mjs +74 -0
  140. package/browser/editor/page/frames.mjs +196 -0
  141. package/browser/editor/page/geometry.mjs +400 -0
  142. package/browser/editor/page/gesture.mjs +45 -0
  143. package/browser/editor/page/handle/index.mjs +639 -0
  144. package/browser/editor/page/handle-sizes.mjs +14 -0
  145. package/browser/editor/page/hints/index.mjs +84 -0
  146. package/browser/editor/page/history.mjs +401 -0
  147. package/browser/editor/page/insert/index.mjs +243 -0
  148. package/browser/editor/page/kept.mjs +38 -0
  149. package/browser/editor/page/links/address.mjs +40 -0
  150. package/browser/editor/page/links/index.mjs +866 -0
  151. package/browser/editor/page/links/pages.mjs +131 -0
  152. package/browser/editor/page/links/views.mjs +369 -0
  153. package/browser/editor/page/look.mjs +65 -0
  154. package/browser/editor/page/made.mjs +24 -0
  155. package/browser/editor/page/margin.mjs +352 -0
  156. package/browser/editor/page/markdown/index.mjs +88 -0
  157. package/browser/editor/page/markdown/rules.mjs +33 -0
  158. package/browser/editor/page/marks.mjs +377 -0
  159. package/browser/editor/page/media-menu/index.mjs +158 -0
  160. package/browser/editor/page/menu.mjs +500 -0
  161. package/browser/editor/page/merge.mjs +100 -0
  162. package/browser/editor/page/notices.mjs +142 -0
  163. package/browser/editor/page/offered.mjs +32 -0
  164. package/browser/editor/page/outline/folds.mjs +52 -0
  165. package/browser/editor/page/outline/index.mjs +697 -0
  166. package/browser/editor/page/outline/list.mjs +172 -0
  167. package/browser/editor/page/outline/read.mjs +201 -0
  168. package/browser/editor/page/outline/strip.mjs +281 -0
  169. package/browser/editor/page/outline/tree.mjs +248 -0
  170. package/browser/editor/page/overlay-layer.mjs +227 -0
  171. package/browser/editor/page/overlays.mjs +205 -0
  172. package/browser/editor/page/own.mjs +28 -0
  173. package/browser/editor/page/pads.mjs +71 -0
  174. package/browser/editor/page/page-objects.mjs +105 -0
  175. package/browser/editor/page/panel.mjs +64 -0
  176. package/browser/editor/page/placement.mjs +58 -0
  177. package/browser/editor/page/post.mjs +41 -0
  178. package/browser/editor/page/present-links.mjs +50 -0
  179. package/browser/editor/page/quiet.mjs +48 -0
  180. package/browser/editor/page/resize/index.mjs +327 -0
  181. package/browser/editor/page/select-all/index.mjs +262 -0
  182. package/browser/editor/page/selection/delete.mjs +59 -0
  183. package/browser/editor/page/selection/index.mjs +157 -0
  184. package/browser/editor/page/selection/marquee.mjs +174 -0
  185. package/browser/editor/page/session.mjs +117 -0
  186. package/browser/editor/page/slash-menu/index.mjs +291 -0
  187. package/browser/editor/page/storage.mjs +48 -0
  188. package/browser/editor/page/sync-state.mjs +267 -0
  189. package/browser/editor/page/table/aligns.mjs +29 -0
  190. package/browser/editor/page/table/cell-bar.mjs +138 -0
  191. package/browser/editor/page/table/cells.mjs +527 -0
  192. package/browser/editor/page/table/icons.mjs +40 -0
  193. package/browser/editor/page/table/index.mjs +985 -0
  194. package/browser/editor/page/table/lists.mjs +187 -0
  195. package/browser/editor/page/table/widths.mjs +308 -0
  196. package/browser/editor/page/tex.mjs +32 -0
  197. package/browser/editor/page/text-select/index.mjs +656 -0
  198. package/browser/editor/page/tooltip.mjs +98 -0
  199. package/browser/editor/page/type-grid.mjs +82 -0
  200. package/browser/editor/page/typing/code-edges.mjs +228 -0
  201. package/browser/editor/page/typing/index.mjs +276 -0
  202. package/browser/editor/page/typing/leave.mjs +68 -0
  203. package/browser/editor/page/ui.mjs +160 -0
  204. package/browser/shared/annotations.mjs +571 -0
  205. package/browser/shared/code-folds.mjs +10 -0
  206. package/browser/shared/code-languages.mjs +70 -0
  207. package/browser/shared/code-lines.mjs +30 -0
  208. package/browser/shared/colors.mjs +28 -0
  209. package/browser/shared/component-catalog.mjs +559 -0
  210. package/browser/shared/components/bookmark.mjs +26 -0
  211. package/browser/shared/components/callout.mjs +7 -0
  212. package/browser/shared/components/chart.mjs +20 -0
  213. package/browser/shared/components/code.mjs +37 -0
  214. package/browser/shared/components/columns.mjs +16 -0
  215. package/browser/shared/components/details.mjs +15 -0
  216. package/browser/shared/components/dialog.mjs +28 -0
  217. package/browser/shared/components/diff.mjs +18 -0
  218. package/browser/shared/components/divider.mjs +6 -0
  219. package/browser/shared/components/embed.mjs +25 -0
  220. package/browser/shared/components/figure.mjs +14 -0
  221. package/browser/shared/components/file.mjs +23 -0
  222. package/browser/shared/components/heading.mjs +6 -0
  223. package/browser/shared/components/highlight.mjs +9 -0
  224. package/browser/shared/components/icon.mjs +18 -0
  225. package/browser/shared/components/image.mjs +39 -0
  226. package/browser/shared/components/index.mjs +342 -0
  227. package/browser/shared/components/installed.mjs +162 -0
  228. package/browser/shared/components/list.mjs +146 -0
  229. package/browser/shared/components/math.mjs +49 -0
  230. package/browser/shared/components/mention.mjs +33 -0
  231. package/browser/shared/components/page.mjs +37 -0
  232. package/browser/shared/components/paragraph.mjs +9 -0
  233. package/browser/shared/components/quote.mjs +6 -0
  234. package/browser/shared/components/section.mjs +8 -0
  235. package/browser/shared/components/sheets.mjs +80 -0
  236. package/browser/shared/components/state.mjs +20 -0
  237. package/browser/shared/components/table.mjs +49 -0
  238. package/browser/shared/components/text.mjs +14 -0
  239. package/browser/shared/components/widget.mjs +10 -0
  240. package/browser/shared/copy-ids.mjs +72 -0
  241. package/browser/shared/css-references.mjs +110 -0
  242. package/browser/shared/emoji/custom.mjs +91 -0
  243. package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
  244. package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
  245. package/browser/shared/emoji/data/README.md +26 -0
  246. package/browser/shared/emoji/data/categories.json +1 -0
  247. package/browser/shared/emoji/data/icons.json +1 -0
  248. package/browser/shared/emoji/data/keywords-en.json +1 -0
  249. package/browser/shared/emoji/data/keywords-zh.json +1 -0
  250. package/browser/shared/emoji/data/names.json +1 -0
  251. package/browser/shared/emoji/data/positions.json +1 -0
  252. package/browser/shared/emoji/data/twemoji-index.json +1 -0
  253. package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
  254. package/browser/shared/emoji/data.mjs +196 -0
  255. package/browser/shared/emoji/emoji.mjs +37 -0
  256. package/browser/shared/emoji/glyphs.mjs +134 -0
  257. package/browser/shared/emoji/icon-value.mjs +90 -0
  258. package/browser/shared/escape.mjs +20 -0
  259. package/browser/shared/export-wrap.mjs +89 -0
  260. package/browser/shared/files.mjs +33 -0
  261. package/browser/shared/html-tree.mjs +53 -0
  262. package/browser/shared/http.mjs +22 -0
  263. package/browser/shared/i18n/en.mjs +1164 -0
  264. package/browser/shared/i18n/index.mjs +132 -0
  265. package/browser/shared/ids.mjs +24 -0
  266. package/browser/shared/import-types.mjs +23 -0
  267. package/browser/shared/inline-spacing.mjs +97 -0
  268. package/browser/shared/layers.mjs +42 -0
  269. package/browser/shared/media.mjs +162 -0
  270. package/browser/shared/new-names.mjs +64 -0
  271. package/browser/shared/number-reading.mjs +92 -0
  272. package/browser/shared/old-names.mjs +143 -0
  273. package/browser/shared/page-address.mjs +140 -0
  274. package/browser/shared/page-links.mjs +86 -0
  275. package/browser/shared/paths.mjs +73 -0
  276. package/browser/shared/preferences.mjs +110 -0
  277. package/browser/shared/preview-server.mjs +247 -0
  278. package/browser/shared/qa-levels.mjs +93 -0
  279. package/browser/shared/reading-place.mjs +91 -0
  280. package/browser/shared/renamed-storage.mjs +220 -0
  281. package/browser/shared/reports.mjs +46 -0
  282. package/browser/shared/search.mjs +85 -0
  283. package/browser/shared/session.mjs +76 -0
  284. package/browser/shared/table-chart.mjs +113 -0
  285. package/browser/shared/table-hides.mjs +120 -0
  286. package/browser/shared/table-slots.mjs +75 -0
  287. package/browser/shared/words.mjs +23 -0
  288. package/browser/shared/workspace.mjs +535 -0
  289. package/browser/shared/writing-preferences.mjs +68 -0
  290. package/browser/shared/zoom.mjs +57 -0
  291. package/dist/chunk-2B5E4CDJ.mjs +2 -0
  292. package/dist/chunk-2PBALTR3.mjs +57 -0
  293. package/dist/chunk-342HXE3Q.mjs +2 -0
  294. package/dist/chunk-3LA3EMDE.mjs +15 -0
  295. package/dist/chunk-43B75J5T.mjs +2 -0
  296. package/dist/chunk-4K5KC6V2.mjs +2 -0
  297. package/dist/chunk-5FRMCDPY.mjs +16 -0
  298. package/dist/chunk-5L7RYZCL.mjs +2 -0
  299. package/dist/chunk-5LEK2CBS.mjs +2 -0
  300. package/dist/chunk-5OFN5AHC.mjs +2 -0
  301. package/dist/chunk-5SIYS5HN.mjs +2 -0
  302. package/dist/chunk-5TEK3RAD.mjs +2 -0
  303. package/dist/chunk-6CYG3Z4V.mjs +2 -0
  304. package/dist/chunk-6U2SLSDN.mjs +3 -0
  305. package/dist/chunk-742D2WWJ.mjs +19 -0
  306. package/dist/chunk-7GHT2UCA.mjs +15 -0
  307. package/dist/chunk-7QQBR7PB.mjs +2 -0
  308. package/dist/chunk-A55HN5OK.mjs +2 -0
  309. package/dist/chunk-ACOPDCNB.mjs +2 -0
  310. package/dist/chunk-AGDILNWB.mjs +2 -0
  311. package/dist/chunk-ATCJYAR4.mjs +2 -0
  312. package/dist/chunk-B3VTYBYR.mjs +960 -0
  313. package/dist/chunk-C564NU2H.mjs +77 -0
  314. package/dist/chunk-C7HWOBIF.mjs +2 -0
  315. package/dist/chunk-DB4WKGYF.mjs +7 -0
  316. package/dist/chunk-E7VYDG2X.mjs +2 -0
  317. package/dist/chunk-EUX7IC5J.mjs +48 -0
  318. package/dist/chunk-EVJ3BX3M.mjs +2 -0
  319. package/dist/chunk-EZY3WC6Z.mjs +15 -0
  320. package/dist/chunk-FQGQH4KM.mjs +2 -0
  321. package/dist/chunk-G7TOXONE.mjs +6 -0
  322. package/dist/chunk-GPF4YWWB.mjs +9 -0
  323. package/dist/chunk-GRAXKKG4.mjs +2 -0
  324. package/dist/chunk-GYQV7Y4J.mjs +120 -0
  325. package/dist/chunk-HMHK3EQ6.mjs +2 -0
  326. package/dist/chunk-HQQMJCQJ.mjs +10 -0
  327. package/dist/chunk-HYMEEXKN.mjs +4 -0
  328. package/dist/chunk-IERUOGC3.mjs +6 -0
  329. package/dist/chunk-ITNLYXXV.mjs +3 -0
  330. package/dist/chunk-L4DVONOG.mjs +2 -0
  331. package/dist/chunk-LAE5NQ4B.mjs +2 -0
  332. package/dist/chunk-LC7YNQFG.mjs +2 -0
  333. package/dist/chunk-LHTFLRB6.mjs +4 -0
  334. package/dist/chunk-LKX55H76.mjs +2 -0
  335. package/dist/chunk-MAFIGVXY.mjs +2 -0
  336. package/dist/chunk-NFIBI4IP.mjs +26 -0
  337. package/dist/chunk-NSKUTQ5J.mjs +5 -0
  338. package/dist/chunk-O52JMOCZ.mjs +2 -0
  339. package/dist/chunk-P2CAZPDP.mjs +3 -0
  340. package/dist/chunk-QAIHRH3I.mjs +13 -0
  341. package/dist/chunk-QMQUXTU4.mjs +12 -0
  342. package/dist/chunk-QR6A54KJ.mjs +3 -0
  343. package/dist/chunk-QVWVFC5K.mjs +6 -0
  344. package/dist/chunk-QYKCJ7FG.mjs +8 -0
  345. package/dist/chunk-QZY6Q64C.mjs +2 -0
  346. package/dist/chunk-TDQP3DKQ.mjs +10 -0
  347. package/dist/chunk-TMYZB6AV.mjs +2 -0
  348. package/dist/chunk-TX6JH7TR.mjs +2 -0
  349. package/dist/chunk-U3SSPL4K.mjs +8 -0
  350. package/dist/chunk-UH4SIXTR.mjs +2 -0
  351. package/dist/chunk-UNUEWH4S.mjs +2 -0
  352. package/dist/chunk-UXUK4PMC.mjs +27 -0
  353. package/dist/chunk-V4CPWKMZ.mjs +2 -0
  354. package/dist/chunk-V6XZ4VIR.mjs +2 -0
  355. package/dist/chunk-VACRB2NE.mjs +3 -0
  356. package/dist/chunk-W63L7367.mjs +7 -0
  357. package/dist/chunk-W7CXPCRV.mjs +6 -0
  358. package/dist/chunk-W7XHE4CT.mjs +2 -0
  359. package/dist/chunk-XINNG4F2.mjs +4 -0
  360. package/dist/chunk-Y34NR5JL.mjs +2 -0
  361. package/dist/chunk-YEY3RSFQ.mjs +2 -0
  362. package/dist/chunk-YL2DPWVS.mjs +4 -0
  363. package/dist/chunk-YXAUQPVK.mjs +8 -0
  364. package/dist/chunk-YZ5Z6H4W.mjs +4 -0
  365. package/dist/chunk-Z52HTUW7.mjs +4 -0
  366. package/dist/chunk-ZBIM6ARY.mjs +216 -0
  367. package/dist/cli.mjs +2 -0
  368. package/dist/server.mjs +2 -0
  369. package/dist/worker.mjs +5 -0
  370. package/kit/charts.js +355 -0
  371. package/kit/code.js +164 -0
  372. package/kit/dialogs.js +157 -0
  373. package/kit/math.js +1988 -0
  374. package/kit/report.css +2821 -0
  375. package/kit/runtime.js +1707 -0
  376. package/kit/sheets.js +123 -0
  377. package/kit/state.js +217 -0
  378. package/kit/tables.js +1449 -0
  379. package/kit/tokens.js +29 -0
  380. package/kit/ui.js +561 -0
  381. package/package.json +41 -4
  382. package/release.json +25 -0
  383. package/sdk/column-widths.d.ts +56 -0
  384. package/sdk/doc-charts.d.ts +82 -0
  385. package/sdk/doc-code.d.ts +28 -0
  386. package/sdk/doc-dialogs.d.ts +4 -0
  387. package/sdk/doc-kit.d.ts +141 -0
  388. package/sdk/doc-math.d.ts +3 -0
  389. package/sdk/doc-sheets.d.ts +15 -0
  390. package/sdk/doc-state.d.ts +41 -0
  391. package/sdk/doc-tables.d.ts +24 -0
  392. package/sdk/doc-tokens.d.ts +22 -0
  393. package/sdk/index.d.ts +30 -0
  394. package/skill/SKILL.md +138 -0
  395. package/skill/agents/openai.yaml +5 -0
  396. package/skill/references/building-components.md +327 -0
  397. package/skill/references/example-report.html +356 -0
  398. package/skill/references/writing-html.md +187 -0
  399. package/skill/sdk/column-widths.d.ts +56 -0
  400. package/skill/sdk/doc-charts.d.ts +82 -0
  401. package/skill/sdk/doc-code.d.ts +28 -0
  402. package/skill/sdk/doc-dialogs.d.ts +4 -0
  403. package/skill/sdk/doc-kit.d.ts +141 -0
  404. package/skill/sdk/doc-math.d.ts +3 -0
  405. package/skill/sdk/doc-sheets.d.ts +15 -0
  406. package/skill/sdk/doc-state.d.ts +41 -0
  407. package/skill/sdk/doc-tables.d.ts +24 -0
  408. package/skill/sdk/doc-tokens.d.ts +22 -0
  409. package/skill/sdk/index.d.ts +30 -0
  410. package/starter/doc.html +21 -0
  411. package/starter/doc.json +5 -0
  412. package/vendor/d3.v7.9.0.min.js +2 -0
  413. package/vendor/katex/auto-render.min.js +1 -0
  414. package/vendor/katex/contrib/mhchem.min.js +1 -0
  415. package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  416. package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  417. package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  418. package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  419. package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  420. package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  421. package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  422. package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  423. package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  424. package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  425. package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  426. package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  427. package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  428. package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  429. package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  430. package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  431. package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  432. package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  433. package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  434. package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  435. package/vendor/katex/katex.min.css +1 -0
  436. package/vendor/katex/katex.min.js +1 -0
  437. package/vendor/pdfjs/LICENSE +177 -0
  438. package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  439. package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  440. package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  441. package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  442. package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  443. package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  444. package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  445. package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  446. package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  447. package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  448. package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  449. package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  450. package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  451. package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  452. package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  453. package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  454. package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  455. package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  456. package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  457. package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  458. package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  459. package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  460. package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  461. package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  462. package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  463. package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  464. package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  465. package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  466. package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  467. package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  468. package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  469. package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  470. package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  471. package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  472. package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  473. package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  474. package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  475. package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  476. package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  477. package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  478. package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  479. package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  480. package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  481. package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  482. package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  483. package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  484. package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  485. package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  486. package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  487. package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  488. package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  489. package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  490. package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  491. package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  492. package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  493. package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  494. package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  495. package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  496. package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  497. package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  498. package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  499. package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  500. package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  501. package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  502. package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  503. package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  504. package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  505. package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  506. package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  507. package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  508. package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  509. package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  510. package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  511. package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  512. package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  513. package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  514. package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  515. package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  516. package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  517. package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  518. package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  519. package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  520. package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  521. package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  522. package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  523. package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  524. package/vendor/pdfjs/cmaps/H.bcmap +0 -0
  525. package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  526. package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  527. package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  528. package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  529. package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  530. package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  531. package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  532. package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  533. package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  534. package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  535. package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  536. package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  537. package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  538. package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  539. package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  540. package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  541. package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  542. package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  543. package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  544. package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  545. package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  546. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  547. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  548. package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  549. package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  550. package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  551. package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  552. package/vendor/pdfjs/cmaps/LICENSE +36 -0
  553. package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  554. package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  555. package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  556. package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  557. package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  558. package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  559. package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  560. package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  561. package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  562. package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  563. package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  564. package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  565. package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  566. package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  567. package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  568. package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  569. package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  570. package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  571. package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  572. package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  573. package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  574. package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  575. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  576. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  577. package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  578. package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  579. package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  580. package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  581. package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  582. package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  583. package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  584. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  585. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  586. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  587. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  588. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  589. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  590. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  591. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  592. package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  593. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  594. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  595. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  596. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  597. package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  598. package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  599. package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  600. package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  601. package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  602. package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  603. package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  604. package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  605. package/vendor/pdfjs/cmaps/V.bcmap +0 -0
  606. package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  607. package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
  608. package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
  609. package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  610. package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  611. package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  612. package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  613. package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  614. package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  615. package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  616. package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  617. package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  618. package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  619. package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  620. package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  621. package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  622. package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  623. package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  624. package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  625. package/vendor/types/@types/d3/LICENSE +21 -0
  626. package/vendor/types/@types/d3/index.d.ts +39 -0
  627. package/vendor/types/@types/d3/package.json +81 -0
  628. package/vendor/types/@types/d3-array/LICENSE +21 -0
  629. package/vendor/types/@types/d3-array/index.d.ts +1118 -0
  630. package/vendor/types/@types/d3-array/package.json +56 -0
  631. package/vendor/types/@types/d3-axis/LICENSE +21 -0
  632. package/vendor/types/@types/d3-axis/index.d.ts +293 -0
  633. package/vendor/types/@types/d3-axis/package.json +47 -0
  634. package/vendor/types/@types/d3-brush/LICENSE +21 -0
  635. package/vendor/types/@types/d3-brush/index.d.ts +255 -0
  636. package/vendor/types/@types/d3-brush/package.json +42 -0
  637. package/vendor/types/@types/d3-chord/LICENSE +21 -0
  638. package/vendor/types/@types/d3-chord/index.d.ts +471 -0
  639. package/vendor/types/@types/d3-chord/package.json +40 -0
  640. package/vendor/types/@types/d3-color/LICENSE +21 -0
  641. package/vendor/types/@types/d3-color/index.d.ts +669 -0
  642. package/vendor/types/@types/d3-color/package.json +55 -0
  643. package/vendor/types/@types/d3-contour/LICENSE +21 -0
  644. package/vendor/types/@types/d3-contour/index.d.ts +222 -0
  645. package/vendor/types/@types/d3-contour/package.json +38 -0
  646. package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
  647. package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
  648. package/vendor/types/@types/d3-delaunay/package.json +30 -0
  649. package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
  650. package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
  651. package/vendor/types/@types/d3-dispatch/package.json +51 -0
  652. package/vendor/types/@types/d3-drag/LICENSE +21 -0
  653. package/vendor/types/@types/d3-drag/index.d.ts +395 -0
  654. package/vendor/types/@types/d3-drag/package.json +42 -0
  655. package/vendor/types/@types/d3-dsv/LICENSE +21 -0
  656. package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
  657. package/vendor/types/@types/d3-dsv/package.json +45 -0
  658. package/vendor/types/@types/d3-ease/LICENSE +21 -0
  659. package/vendor/types/@types/d3-ease/index.d.ts +316 -0
  660. package/vendor/types/@types/d3-ease/package.json +40 -0
  661. package/vendor/types/@types/d3-fetch/LICENSE +21 -0
  662. package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
  663. package/vendor/types/@types/d3-fetch/package.json +37 -0
  664. package/vendor/types/@types/d3-force/LICENSE +21 -0
  665. package/vendor/types/@types/d3-force/index.d.ts +899 -0
  666. package/vendor/types/@types/d3-force/package.json +45 -0
  667. package/vendor/types/@types/d3-format/LICENSE +21 -0
  668. package/vendor/types/@types/d3-format/index.d.ts +337 -0
  669. package/vendor/types/@types/d3-format/package.json +45 -0
  670. package/vendor/types/@types/d3-geo/LICENSE +21 -0
  671. package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
  672. package/vendor/types/@types/d3-geo/package.json +48 -0
  673. package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
  674. package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
  675. package/vendor/types/@types/d3-hierarchy/package.json +50 -0
  676. package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
  677. package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
  678. package/vendor/types/@types/d3-interpolate/package.json +47 -0
  679. package/vendor/types/@types/d3-path/LICENSE +21 -0
  680. package/vendor/types/@types/d3-path/index.d.ts +108 -0
  681. package/vendor/types/@types/d3-path/package.json +41 -0
  682. package/vendor/types/@types/d3-polygon/LICENSE +21 -0
  683. package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
  684. package/vendor/types/@types/d3-polygon/package.json +40 -0
  685. package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
  686. package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
  687. package/vendor/types/@types/d3-quadtree/package.json +45 -0
  688. package/vendor/types/@types/d3-random/LICENSE +21 -0
  689. package/vendor/types/@types/d3-random/index.d.ts +313 -0
  690. package/vendor/types/@types/d3-random/package.json +41 -0
  691. package/vendor/types/@types/d3-scale/LICENSE +21 -0
  692. package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
  693. package/vendor/types/@types/d3-scale/package.json +53 -0
  694. package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
  695. package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
  696. package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
  697. package/vendor/types/@types/d3-selection/LICENSE +21 -0
  698. package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
  699. package/vendor/types/@types/d3-selection/package.json +56 -0
  700. package/vendor/types/@types/d3-shape/LICENSE +21 -0
  701. package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
  702. package/vendor/types/@types/d3-shape/package.json +53 -0
  703. package/vendor/types/@types/d3-time/LICENSE +21 -0
  704. package/vendor/types/@types/d3-time/index.d.ts +697 -0
  705. package/vendor/types/@types/d3-time/package.json +46 -0
  706. package/vendor/types/@types/d3-time-format/LICENSE +21 -0
  707. package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
  708. package/vendor/types/@types/d3-time-format/package.json +40 -0
  709. package/vendor/types/@types/d3-timer/LICENSE +21 -0
  710. package/vendor/types/@types/d3-timer/index.d.ts +68 -0
  711. package/vendor/types/@types/d3-timer/package.json +45 -0
  712. package/vendor/types/@types/d3-transition/LICENSE +21 -0
  713. package/vendor/types/@types/d3-transition/index.d.ts +664 -0
  714. package/vendor/types/@types/d3-transition/package.json +47 -0
  715. package/vendor/types/@types/d3-zoom/LICENSE +21 -0
  716. package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
  717. package/vendor/types/@types/d3-zoom/package.json +48 -0
  718. package/vendor/types/@types/geojson/LICENSE +21 -0
  719. package/vendor/types/@types/geojson/index.d.ts +202 -0
  720. package/vendor/types/@types/geojson/package.json +46 -0
  721. package/vendor/typescript/LICENSE.txt +55 -0
  722. package/vendor/typescript/lib.decorators.d.ts +384 -0
  723. package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
  724. package/vendor/typescript/lib.dom.d.ts +39429 -0
  725. package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
  726. package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
  727. package/vendor/typescript/lib.es2015.core.d.ts +597 -0
  728. package/vendor/typescript/lib.es2015.d.ts +28 -0
  729. package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
  730. package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
  731. package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
  732. package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
  733. package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
  734. package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
  735. package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
  736. package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
  737. package/vendor/typescript/lib.es2016.d.ts +21 -0
  738. package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
  739. package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
  740. package/vendor/typescript/lib.es2017.d.ts +26 -0
  741. package/vendor/typescript/lib.es2017.date.d.ts +31 -0
  742. package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
  743. package/vendor/typescript/lib.es2017.object.d.ts +49 -0
  744. package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
  745. package/vendor/typescript/lib.es2017.string.d.ts +45 -0
  746. package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
  747. package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
  748. package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
  749. package/vendor/typescript/lib.es2018.d.ts +24 -0
  750. package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
  751. package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
  752. package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
  753. package/vendor/typescript/lib.es2019.array.d.ts +79 -0
  754. package/vendor/typescript/lib.es2019.d.ts +24 -0
  755. package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
  756. package/vendor/typescript/lib.es2019.object.d.ts +33 -0
  757. package/vendor/typescript/lib.es2019.string.d.ts +37 -0
  758. package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
  759. package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
  760. package/vendor/typescript/lib.es2020.d.ts +27 -0
  761. package/vendor/typescript/lib.es2020.date.d.ts +42 -0
  762. package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
  763. package/vendor/typescript/lib.es2020.number.d.ts +28 -0
  764. package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
  765. package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
  766. package/vendor/typescript/lib.es2020.string.d.ts +44 -0
  767. package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
  768. package/vendor/typescript/lib.es2021.d.ts +23 -0
  769. package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
  770. package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
  771. package/vendor/typescript/lib.es2021.string.d.ts +33 -0
  772. package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
  773. package/vendor/typescript/lib.es2022.array.d.ts +121 -0
  774. package/vendor/typescript/lib.es2022.d.ts +25 -0
  775. package/vendor/typescript/lib.es2022.error.d.ts +75 -0
  776. package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
  777. package/vendor/typescript/lib.es2022.object.d.ts +26 -0
  778. package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
  779. package/vendor/typescript/lib.es2022.string.d.ts +25 -0
  780. package/vendor/typescript/lib.es5.d.ts +4601 -0
  781. package/vendor/typescript/package.json +4 -0
  782. package/vendor/typescript/typescript.js +446 -0
  783. package/web/assets/index-B6Ai3wsa.js +13 -0
  784. package/web/assets/index-SYPC3EZy.css +1 -0
  785. package/web/index.html +14 -0
@@ -0,0 +1,342 @@
1
+ import bookmark from "./bookmark.mjs";
2
+ import callout from "./callout.mjs";
3
+ import chart from "./chart.mjs";
4
+ import code from "./code.mjs";
5
+ import columns from "./columns.mjs";
6
+ import details from "./details.mjs";
7
+ import diff from "./diff.mjs";
8
+ import dialog from "./dialog.mjs";
9
+ import divider from "./divider.mjs";
10
+ import embed from "./embed.mjs";
11
+ import figure from "./figure.mjs";
12
+ import file from "./file.mjs";
13
+ import heading from "./heading.mjs";
14
+ import highlight from "./highlight.mjs";
15
+ import icon from "./icon.mjs";
16
+ import image from "./image.mjs";
17
+ import installed from "./installed.mjs";
18
+ import list from "./list.mjs";
19
+ import math from "./math.mjs";
20
+ import mention from "./mention.mjs";
21
+ import page from "./page.mjs";
22
+ import paragraph from "./paragraph.mjs";
23
+ import quote from "./quote.mjs";
24
+ import section from "./section.mjs";
25
+ import sheets from "./sheets.mjs";
26
+ import state from "./state.mjs";
27
+ import table from "./table.mjs";
28
+ import text from "./text.mjs";
29
+ import widget from "./widget.mjs";
30
+ import { attr, elementsOf, walk } from "../html-tree.mjs";
31
+ import { ATTRIBUTE, INSTANCE } from "./installed.mjs";
32
+
33
+ // The kit's components as every system sees them (docs/internals.md, "Components"): what each is
34
+ // in a report's markup, one plain-data description each, shared by the kit (how it runs), the
35
+ // checks and the build (src/render/), and the editor (src/editor/). What is no fact of the markup
36
+ // stays with its system: how a component is drawn (src/render/kit/), what files it loads
37
+ // (src/render/assets.mjs, by the ids in `assets`), how it is edited (src/editor/components/).
38
+ //
39
+ // id the component's name (an editor component of the same name edits it)
40
+ // category what kind of block it is (CATEGORIES below); none for the page, inline marks and
41
+ // behaviors (bindings)
42
+ // within the category of the block it lives in, for what is a block's content (a chart is a
43
+ // card's)
44
+ // media a media block (图片, 文件, 网页书签, 嵌入): a card of one picture, file, page or frame with
45
+ // a caption of its own kind under it, made from an empty block and empty until filled; the
46
+ // editor and the server take their names from these (MEDIA_BLOCKS below)
47
+ // pending what is still to change for it to be fully of its category
48
+ // match where it is in a report: a selector of the grammar below (comma for several)
49
+ // assets the shared assets it needs (src/render/assets.mjs)
50
+ // uses when a report uses it, besides its match: patterns of the report's text (its asset
51
+ // tags, comments and the text of code samples taken out: render/assets.mjs
52
+ // usedAssets). Broad on purpose: a false match only keeps an asset
53
+ // parts its structure, by name: { at, edit, optional?, min?, max?, groups? }. at: ":scope > a > b"
54
+ // (children, step by step), one compound selector (any descendant), or a list of those
55
+ // with commas, * any element in either; edit: "text" (its text is written), "flow" (it
56
+ // holds blocks) or "none" (the kit's own UI)
57
+ // flow the elements of it that are flows (a selector, a list of them with commas): blocks stand
58
+ // in them straight, whatever they are (the page, a section, a summary and a panel). A
59
+ // part that is edited as "flow" is one too, and needs no `flow` of its own. Where a flow
60
+ // is spelled out, it is taken from here (FLOWS below)
61
+ // groups false where a plain <div> without a class in the flow is a block of its own, not a
62
+ // group of blocks (the page and a Sheet panel: on the component, or on the part)
63
+ // pairs parts that go together by an attribute's value: { a, attrA, b, attrB }
64
+ // only the parts that are all an instance holds: no other element child (columns: only
65
+ // its columns)
66
+ // empty an instance holding nothing at all is valid: a placeholder the page editor keeps (a
67
+ // media block not filled yet), which the kit shows to no reader
68
+ // shares a part's share of the instance, a custom property in its style attribute: { part,
69
+ // property, min }. Written on every element of the part or on none, each from min to
70
+ // 1 (columns: their widths, laid out in proportion)
71
+ // frame, lead, header, title, tail other elements of a component (a table's frame and the scope
72
+ // line above it, the page's header and the title in it, small
73
+ // text's end part): selectors
74
+ // attrs the attributes an author (an Agent, the editor) writes: { name: what it says }
75
+ // classes the classes an author writes
76
+ // wholes those of `classes` that are a whole block of their own, as the editor takes them (the reading
77
+ // state: a filter, its row, the fields, the list of what was kept; the rest are parts)
78
+ // fills attributes the kit gives an instance when it starts: { selector: [names] } (":host"
79
+ // is the instance itself); the author need not write them
80
+ // runtime what the kit leaves on the page, which an export of the current view takes off
81
+ // again (DocKit.dehydrate; the copy's kit makes it again):
82
+ // generated nodes it adds (selectors)
83
+ // attrs attributes it sets: { selector: [names] }
84
+ // classes classes it sets: { selector: [names] }
85
+ // root { attrs, classes } on <html>
86
+ // and what it leaves that stays:
87
+ // state marks that show reading state (a Sheet chosen, the theme): { selector:
88
+ // [names] }, "html" for <html>
89
+ // internal names used only inside what it generates ("doc-chart-*": a prefix)
90
+ //
91
+ // Only tag, .class, [attr] and [attr=value] make a compound selector, a class and an unquoted value
92
+ // being what CSS calls an identifier and a quoted value one line with no backslash, so the same string
93
+ // finds an element in the browser (Element.matches, querySelectorAll) and in a parsed source
94
+ // (matchesNode below, on parse5's tree).
95
+
96
+ export const COMPONENTS = [
97
+ page, text, mention, // the page; inline marks, links shown with their icon
98
+ paragraph, heading, list, quote, callout, code, divider, math, // basic blocks
99
+ section, highlight, details, dialog, sheets, table, columns, // containers
100
+ figure, chart, image, file, bookmark, embed, // cards (a figure: a chart or a drawing of the report's own; an image, a file, a bookmark, an embed)
101
+ widget, diff, icon, installed, // whole blocks (the page's icon one, in the header; an instance of a component package)
102
+ state, // reading state, bound to blocks of any kind
103
+ ];
104
+
105
+ /** The media blocks (a description's `media`), by id: image, file, bookmark, embed. */
106
+ const media = COMPONENTS.filter((component) => component.media);
107
+ export const MEDIA_BLOCKS = media.map((component) => component.id);
108
+ /** The class of each media block's figure, by id (doc-image, …). */
109
+ export const MEDIA_CLASS = Object.fromEntries(media.map((component) => [component.id, parseCompound(component.match).classes[0]]));
110
+ /** The id of the media block an element is (image, file, bookmark or embed), or null. */
111
+ export const mediaBlockOf = (element) => MEDIA_BLOCKS.find((id) => element?.classList?.contains(MEDIA_CLASS[id])) ?? null;
112
+
113
+ /**
114
+ * The four kinds of block (docs/internals.md, "Components"), by what the reader does with one in
115
+ * the live preview:
116
+ *
117
+ * block 基础块: text edited as text, made and turned into another type on the page, split and
118
+ * merged, moved, deleted, copied
119
+ * container 容器块: holds basic blocks, which are edited as anywhere; moved and deleted as a whole
120
+ * card 卡片块: a figure, framed (a chart, a drawing, a timeline or a diagram of the report's
121
+ * own; a picture, a file, a bookmark, an embedded page): moved and resized as a whole,
122
+ * its title and caption edited, its inside its own
123
+ * whole 整体块: a layout of the report's own that is no figure (a strip of metrics, a panel,
124
+ * controls), or the kit's: free inside (the report's markup, styles and script), moved
125
+ * as a whole, its words edited as words
126
+ */
127
+ export const CATEGORIES = {
128
+ block: { name: "基础块" },
129
+ container: { name: "容器块" },
130
+ card: { name: "卡片块" },
131
+ whole: { name: "整体块" },
132
+ };
133
+
134
+ /** The events the kit sends or listens for on window (or a table). */
135
+ export const EVENTS = {
136
+ "doc-theme-change": "the theme shown changed (ui.js): the reader chose one, the workbench asked for one, or the system's changed while none is chosen",
137
+ "doc-theme-request": "a workbench asks for a theme (ui.js listens)",
138
+ "doc-layout-change": "a card's size changed where widths do not tell (the editor)",
139
+ "doc-editable": "the page takes what a component writes from now on (the editor)",
140
+ "doc-component-edit": "a component's context.edit asks to write a part: the editor cancels it to say it took the edit, the kit writing no file (on the instance)",
141
+ "doc-export-copy-done": "导出当前视图副本 finished (ui.js)",
142
+ "doc-table-sort": "a table's sort changed (tables/, on the table)",
143
+ "doc-jump-request": "演示视图 asks the kit to go to a block of its own page, a step of the history (runtime/reveal.js listens, editor/page/present-links.mjs sends)",
144
+ };
145
+
146
+ /**
147
+ * The flows of a report (docs/render.md, "Flows"): the elements blocks stand in straight — the page,
148
+ * a Sheet panel, the content of a section, a summary, a highlight panel, a disclosure, a detail card
149
+ * and a column — as selectors of the grammar below, in the order of the components. The checks
150
+ * (component-checks.mjs) and the formulas (kit/math.js) take their flows from here; styles/flow.css,
151
+ * where a stylesheet cannot import them, spells the same list once (components.mjs holds it to this).
152
+ * GROUPING_FLOWS are those a plain <div> without a class groups blocks in.
153
+ */
154
+ const flowList = COMPONENTS.flatMap((component) => [
155
+ ...(component.flow ? component.flow.split(",").map((selector) => ({ selector: selector.trim(), groups: component.groups !== false })) : []),
156
+ ...Object.values(component.parts ?? {}).filter((part) => part.edit === "flow").map((part) => ({ selector: part.at.split(">").at(-1).trim(), groups: part.groups !== false })),
157
+ ]);
158
+ export const FLOWS = Object.freeze(flowList.map((flow) => flow.selector));
159
+ export const GROUPING_FLOWS = Object.freeze(flowList.filter((flow) => flow.groups).map((flow) => flow.selector));
160
+ /**
161
+ * Every element blocks stand straight in, as one selector: the flows, and a plain <div> grouping
162
+ * blocks in one of GROUPING_FLOWS; styles/flow.css spells the same list. The page editor and the kit's
163
+ * runtime (given it by the build, __COMPONENT_BLOCK_FLOWS__) read by it which items keep a line of
164
+ * their own (list.mjs keepsLine).
165
+ */
166
+ export const FLOW_BLOCKS = `${FLOWS.join(", ")}, :is(${GROUPING_FLOWS.join(", ")}) > div:not([class])`;
167
+
168
+ /**
169
+ * What the kit's runtime reads of the descriptions (runtime/kernel.js): where each component's
170
+ * instances are (`match`) and what it leaves on the page (`runtime`), of the components that say
171
+ * either. /kit/runtime.js carries these alone (assets.mjs, `define`), so an export holds no prose.
172
+ * A field the kernel starts reading is added to RUNTIME_FIELDS (tests/unit/runtime.mjs checks it).
173
+ */
174
+ export const RUNTIME_FIELDS = ["match", "runtime", "schema"];
175
+ export const runtimeDescriptions = (components = COMPONENTS) => components
176
+ .filter((component) => RUNTIME_FIELDS.some((field) => component[field] !== undefined))
177
+ .map((component) => Object.fromEntries([["id", component.id], ...RUNTIME_FIELDS.filter((field) => component[field] !== undefined).map((field) => [field, component[field]])]));
178
+
179
+ export const componentOf = (id) => COMPONENTS.find((component) => component.id === id) ?? null;
180
+
181
+ // ---------- selectors ----------
182
+
183
+ /** Throws what is wrong with a selector of the grammar: a compound, a list of them, or a chain of them (":scope > a > b"; * any element). */
184
+ export const parseSelector = (selector) => selector.split(",").forEach((one) => one.split(">").map((step) => step.trim()).filter((step) => step !== ":scope" && step !== "*").forEach(parseCompound));
185
+
186
+ // A part's `at` as its pieces, each its steps: [":scope", "a", "b"], or one compound alone.
187
+ const piecesOf = (at) => at.split(",").map((piece) => piece.split(">").map((step) => step.trim()));
188
+
189
+ /** Throws what is wrong with a part's `at`, read as partOf reads it: a list of chains from :scope and compounds, * any element. */
190
+ export function parsePart(at) {
191
+ for (const [first, ...steps] of piecesOf(at)) {
192
+ if ((first === ":scope") !== (steps.length > 0)) throw new Error(`part "${at}": write ":scope > a > b" or one compound selector`);
193
+ for (const step of first === ":scope" ? steps : [first]) if (step !== "*") parseCompound(step);
194
+ }
195
+ }
196
+
197
+ // What stops a compound at `rest`, in what a writer can act on: a descendant, which the grammar has no
198
+ // step for, and an attribute's value that needs its quotes first.
199
+ function compoundFault(rest) {
200
+ if (/^\s/.test(rest)) return "one element, with no space in it: write each step with > (:scope > a > b), or the last step alone, which finds it at any depth";
201
+ const value = /^\[([a-z][a-z0-9-]*)=([^"'\]]+)\]/.exec(rest);
202
+ if (value) return `write its value in quotes: [${value[1]}="${value[2]}"]`;
203
+ return "only tag, .class, [attr] and [attr=value]";
204
+ }
205
+
206
+ /** "figure.doc-figure[data-surface=bounded]" -> { tag, classes, attrs }. */
207
+ export function parseCompound(selector) {
208
+ const out = { tag: null, classes: [], attrs: [] };
209
+ let rest = selector.trim();
210
+ const tag = /^[a-z][a-z0-9]*/.exec(rest);
211
+ if (tag) {
212
+ out.tag = tag[0];
213
+ rest = rest.slice(tag[0].length);
214
+ }
215
+ while (rest) {
216
+ let found;
217
+ if ((found = /^\.(-?[A-Za-z_][A-Za-z0-9_-]*)/.exec(rest))) out.classes.push(found[1]);
218
+ else if ((found = /^\[([a-z][a-z0-9-]*)(?:=(?:"([^"\\\n\r\f]*)"|'([^'\\\n\r\f]*)'|(-?[A-Za-z_][A-Za-z0-9_-]*)))?\]/.exec(rest))) out.attrs.push({ name: found[1], value: found[2] ?? found[3] ?? found[4] ?? null });
219
+ else throw new Error(`selector "${selector}": ${compoundFault(rest)}`);
220
+ rest = rest.slice(found[0].length);
221
+ }
222
+ if (!out.tag && out.classes.length === 0 && out.attrs.length === 0) throw new Error(`empty selector "${selector}"`);
223
+ return out;
224
+ }
225
+
226
+ /** Whether a parsed element (parse5: { tagName, attrs }) matches a selector of the grammar above. */
227
+ export function matchesNode(node, selector) {
228
+ if (!node?.tagName) return false;
229
+ return selector.split(",").some((part) => {
230
+ if (part.trim() === "*") return true;
231
+ const { tag, classes, attrs } = parseCompound(part);
232
+ if (tag && node.tagName !== tag) return false;
233
+ const own = (attr(node, "class") ?? "").split(/\s+/);
234
+ return classes.every((name) => own.includes(name))
235
+ && attrs.every(({ name, value }) => attr(node, name) !== undefined && (value === null || attr(node, name) === value));
236
+ });
237
+ }
238
+
239
+ /** Whether a parsed node is an instance of a component package (installed.mjs): asked of every element by every walk, so by its attribute first, which few have. */
240
+ export const isInstance = (node) => attr(node, ATTRIBUTE) !== undefined && matchesNode(node, INSTANCE);
241
+
242
+ /** A part's elements in a parsed host, each once, in document order. */
243
+ export function partOf(host, at) {
244
+ const pieces = piecesOf(at);
245
+ const chains = pieces.filter(([first]) => first === ":scope");
246
+ const chain = ([, ...steps]) => steps.reduce((nodes, step) => nodes.flatMap((node) => elementsOf(node).filter((child) => matchesNode(child, step))), [host]);
247
+ if (pieces.length === 1 && chains.length === 1) return chain(pieces[0]);
248
+ const chained = new Set(chains.flatMap(chain));
249
+ const anywhere = pieces.filter(([first]) => first !== ":scope").map(([first]) => first).join(",");
250
+ const found = [];
251
+ walk(host, (element) => { if (chained.has(element) || (anywhere && matchesNode(element, anywhere))) found.push(element); });
252
+ return found;
253
+ }
254
+
255
+ /**
256
+ * Each instance of a component in a parsed tree, in document order. What stands in an instance of a
257
+ * component package is its component's and no other's, and such an element is of its own package
258
+ * alone, whatever class it carries.
259
+ */
260
+ export function instancesOf(root, component) {
261
+ const found = [];
262
+ if (component.match) walk(root, (element) => { if (matchesNode(element, component.match) && (!isInstance(element) || attr(element, ATTRIBUTE) === component.id)) found.push(element); }, { stop: isInstance });
263
+ return found;
264
+ }
265
+
266
+ // ---------- vocabulary ----------
267
+
268
+ const namesIn = (selector) => [
269
+ ...[...selector.matchAll(/\[([a-z][a-z0-9-]*)/g)].map((found) => found[1]),
270
+ ...[...selector.matchAll(/\.([A-Za-z0-9_-]+)/g)].map((found) => found[1]),
271
+ ];
272
+
273
+ /**
274
+ * The names of the kit's markup, by who writes them: `authoring` (attributes and classes an author
275
+ * writes, with the components that say so), `runtime` (what the kit sets or generates), and
276
+ * `isInternal(name)` (names inside what it generates).
277
+ */
278
+ export function vocabulary(components = COMPONENTS) {
279
+ const authoring = new Map();
280
+ const runtime = new Map();
281
+ const internal = [];
282
+ const add = (map, name, id) => map.set(name, [...new Set([...(map.get(name) ?? []), id])]);
283
+ for (const component of components) {
284
+ Object.keys(component.attrs ?? {}).forEach((name) => add(authoring, name, component.id));
285
+ (component.classes ?? []).forEach((name) => add(authoring, name, component.id));
286
+ const marks = component.runtime ?? {};
287
+ for (const selector of marks.generated ?? []) namesIn(selector).forEach((name) => add(runtime, name, component.id));
288
+ for (const names of [...Object.values(marks.attrs ?? {}), ...Object.values(marks.classes ?? {}), marks.root?.attrs ?? [], marks.root?.classes ?? [], ...Object.values(marks.state ?? {})]) {
289
+ names.forEach((name) => add(runtime, name, component.id));
290
+ }
291
+ internal.push(...(marks.internal ?? []));
292
+ }
293
+ const isInternal = (name) => internal.some((entry) => (entry.endsWith("*") ? name.startsWith(entry.slice(0, -1)) : name === entry));
294
+ return { authoring, runtime, isInternal };
295
+ }
296
+
297
+ // ---------- checks ----------
298
+
299
+ /** What is wrong with the descriptions (an empty list when nothing): checked by kit:check. */
300
+ export function componentProblems(components = COMPONENTS) {
301
+ const problems = [];
302
+ const ids = components.map((component) => component.id);
303
+ for (const id of new Set(ids.filter((id, index) => ids.indexOf(id) !== index))) problems.push(`component "${id}" is listed twice`);
304
+ for (const component of components) {
305
+ try {
306
+ if (component.match) parseSelector(component.match);
307
+ if (component.flow) parseSelector(component.flow);
308
+ for (const name of ["frame", "lead", "header"]) if (component[name]) parseSelector(component[name]);
309
+ for (const part of Object.values(component.parts ?? {})) parsePart(part.at);
310
+ for (const selector of [...(component.runtime?.generated ?? []), ...Object.keys(component.runtime?.attrs ?? {}), ...Object.keys(component.runtime?.classes ?? {}), ...Object.keys(component.runtime?.state ?? {}), ...Object.keys(component.fills ?? {})]) parseSelector(selector);
311
+ } catch (error) {
312
+ problems.push(`component "${component.id}": ${error.message}`);
313
+ }
314
+ if (component.parts && !component.match) problems.push(`component "${component.id}" has parts but no match`);
315
+ for (const field of ["category", "within"]) {
316
+ if (component[field] !== undefined && !(component[field] in CATEGORIES)) problems.push(`component "${component.id}": ${field} "${component[field]}" is no category (${Object.keys(CATEGORIES).join(", ")})`);
317
+ }
318
+ if (component.category && component.within) problems.push(`component "${component.id}" is a block of its own or a block's content, not both`);
319
+ for (const [name, part] of Object.entries(component.parts ?? {})) {
320
+ if (!["text", "flow", "none"].includes(part.edit)) problems.push(`component "${component.id}": part "${name}" edits as "${part.edit}" (text, flow or none)`);
321
+ }
322
+ for (const { a, b } of component.pairs ?? []) {
323
+ for (const name of [a, b]) if (!component.parts?.[name]) problems.push(`component "${component.id}" pairs an unknown part "${name}"`);
324
+ }
325
+ for (const name of [...(component.only ?? []), ...(component.shares ? [component.shares.part] : [])]) {
326
+ if (!component.parts?.[name]) problems.push(`component "${component.id}" names an unknown part "${name}"`);
327
+ }
328
+ if ((component.assets ?? []).length > 0 && !(component.uses ?? []).length) problems.push(`component "${component.id}" needs assets but nothing tells when a report uses it (uses)`);
329
+ }
330
+ const { authoring, runtime } = vocabulary(components);
331
+ for (const [name, owners] of authoring) {
332
+ if (owners.length > 1) problems.push(`"${name}" is described by several components: ${owners.join(", ")}`);
333
+ if (runtime.has(name)) problems.push(`"${name}" is written by authors (${owners.join(", ")}) and by the kit (${runtime.get(name).join(", ")})`);
334
+ }
335
+ // What the kit fills in is an author's to write as well, or no name of the kit's at all.
336
+ for (const component of components) {
337
+ for (const name of Object.values(component.fills ?? {}).flat()) {
338
+ if (/^(data-|doc-)/.test(name) && !authoring.has(name)) problems.push(`component "${component.id}" fills "${name}", which no component says an author writes`);
339
+ }
340
+ }
341
+ return problems;
342
+ }
@@ -0,0 +1,162 @@
1
+ // An instance of a component package (组件包: <workspace>/components/<scope>/<name>/, read by
2
+ // src/shared/component-catalog.mjs): a block-level div or section naming its package, which is all a
3
+ // system needs to tell where the instance stands. The boundary depends on no catalog, so it holds in
4
+ // a file sent to someone who has no such package, or that has lost it: nothing of Gallery's goes into
5
+ // an instance, whatever it holds (the scan and naturalize, the kit's other components, formulas,
6
+ // spacing and a picture's viewer), but the parts its manifest gives the editor. The rest of it is
7
+ // the component's, its events too. One of no package is shown as it stands, read-only, and the kit marks
8
+ // it so (FALLBACK), a note beside what it holds in a preview, and what a script of data in it holds,
9
+ // which no reader would see, drawn as the kit draws any (DATA_SHOWN).
10
+
11
+ /** The attribute that makes an element an instance, its value the package's id: <scope>/<name>. */
12
+ export const ATTRIBUTE = "data-doc-component";
13
+
14
+ /** What a package's id looks like: <scope>/<name>. */
15
+ export const PACKAGE_ID = /^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/;
16
+
17
+ /** Where a document's instances are: what stops every system at the edge of one. */
18
+ export const INSTANCE = `div[${ATTRIBUTE}], section[${ATTRIBUTE}]`;
19
+
20
+ /** The kit's mark on an instance of no package, for its look (styles/installed.css). */
21
+ export const FALLBACK = "data-doc-fallback";
22
+
23
+ /** The fields and buttons of such an instance, which the kit makes inert: what it holds is read-only. */
24
+ export const CONTROLS = "input, select, textarea, button";
25
+
26
+ /**
27
+ * The fields of an instance, whose keys are their own: Ctrl+Z there is the field's undo, and on a
28
+ * button or anything else the component draws the page's.
29
+ */
30
+ export const FIELDS = "input, textarea, select, [contenteditable]";
31
+
32
+ /** The kit's mark on a control it made inert, which goes with that when an export of the view takes it off. */
33
+ export const CONTROL_MARK = "data-doc-fallback-control";
34
+
35
+ /**
36
+ * The mark on what a page or an export holds of a package, its value the package's id: a tag that
37
+ * loads its files, the line that tells the kit of it, the inline copies of those. No document's source
38
+ * holds one, and an import of an export takes them out.
39
+ */
40
+ export const PACKAGE_MARK = "data-doc-package";
41
+
42
+ /**
43
+ * The page editor's mark on a package's script on its way to a page served without it, its value the
44
+ * package's id: until it has loaded or failed, that its component has not started says nothing.
45
+ */
46
+ export const ARRIVING = "data-ge-arriving";
47
+
48
+ /** What gallery.json's lists make of a package that loads: "disabled", "hidden" or "normal". */
49
+ export const settingState = (id, { hidden, disabled }) => (disabled.includes(id) ? "disabled" : hidden.includes(id) ? "hidden" : "normal");
50
+
51
+ /** The class of the kit's note in such an instance, in a preview alone. */
52
+ export const NOTE = "doc-component-note";
53
+
54
+ /** The class of what the kit draws of a script of data in such an instance (runtime/shown-data.js), wherever it is shown. */
55
+ export const DATA_SHOWN = "doc-component-data";
56
+ /** Its marks, for its look: a value alone at its top, a list of values alone below it, a cell of a few words. */
57
+ export const DATA_ONE = "doc-component-one";
58
+ export const DATA_LINE = "doc-component-line";
59
+ export const DATA_SHORT = "doc-component-short";
60
+
61
+ /**
62
+ * What is no text block, whatever a manifest says of it: an element whose words a reader neither sees
63
+ * nor types (a script, a style, a field's value, a drawing) or that stands around blocks and holds no
64
+ * inline text of its own (a list, a table, a disclosure).
65
+ */
66
+ export const NO_TEXT = new Set([
67
+ "script", "style", "template", "noscript", "textarea", "select", "svg", "math", "iframe", "object", "canvas", "video", "audio", "img", "input", "hr", "br",
68
+ "ul", "ol", "dl", "table", "thead", "tbody", "tfoot", "tr", "details",
69
+ ]);
70
+
71
+ // What takes a page over wherever it stands: a frame or a plugin, a style sheet, or what changes how
72
+ // the page reads (`noscript` and the like, which parsers read two ways).
73
+ const TAKES_OVER = new Set(["iframe", "frame", "frameset", "object", "embed", "applet", "base", "meta", "link", "style", "noscript", "noembed", "noframes", "plaintext", "xmp"]);
74
+ const NO_CODE = /^application\/(?:\S+\+)?json$/i;
75
+ const CODE_ADDRESS = /^(?:javascript|vbscript):/i;
76
+ const ANIMATES = new Set(["animate", "set"]);
77
+ // A style that takes an element out of its block to stand anywhere over the page, or that hides what
78
+ // it says in an escape or a comment. Any other keeps it in its place: a share of a row, a color.
79
+ const LEAVES_ITS_PLACE = /position\s*:\s*(?:fixed|absolute|sticky)|\\|\/\*/i;
80
+
81
+ /**
82
+ * Whether an element a clipboard brings in the markup of an instance may not come onto a page. A copy
83
+ * made from another document is the one instance no file vouches for, and any page can write a
84
+ * clipboard: nothing in it runs (a script but one of data, a handler, an address of code, one an
85
+ * animation writes, a frame's own document), nothing says it is the editor's, and nothing leaves its
86
+ * block for the rest of the page. `attributes`: the element's, [{ name, value }]. The page asks before
87
+ * it makes the block and the server before it writes it, and a template, which a menu puts in as
88
+ * such, is held to the same (component-catalog.mjs templateProblem).
89
+ */
90
+ export function refusedInCopy(tag, attributes) {
91
+ const named = (wanted) => attributes.find(({ name }) => name.toLowerCase() === wanted)?.value ?? "";
92
+ const name = tag.toLowerCase();
93
+ if (TAKES_OVER.has(name) || (name === "script" && !NO_CODE.test(named("type").trim()))) return true;
94
+ if (ANIMATES.has(name) && /href|^on/i.test(named("attributename"))) return true;
95
+ return attributes.some((attribute) => {
96
+ const key = attribute.name.toLowerCase();
97
+ return key.startsWith("on") || key === "srcdoc" || /^data-(?:ge|rs)-/.test(key) || (key === "style" && LEAVES_ITS_PLACE.test(attribute.value)) || CODE_ADDRESS.test(String(attribute.value).replace(/[\u0000- ]/g, ""));
98
+ });
99
+ }
100
+
101
+ /**
102
+ * Whether an element may not stand in what a component writes to a data part: what no copy may hold
103
+ * (refusedInCopy), any script, and a block's identity, which is the file's. The page asks of a draft
104
+ * before anything changes and the server of what a commit carries, whoever sent it.
105
+ */
106
+ export const refusedInData = (tag, attributes) => tag.toLowerCase() === "script" || attributes.some(({ name }) => name.toLowerCase() === "data-block-id") || refusedInCopy(tag, attributes);
107
+
108
+ // What holds no markup as an element's inside: words, or a fragment apart.
109
+ const READ_AS_WORDS = new Set(["template", "textarea", "title"]);
110
+
111
+ /** Whether an element cannot be a data part, a script of data aside: what it holds would not read as what was written. */
112
+ export const noDataPart = (tag) => READ_AS_WORDS.has(tag.toLowerCase()) || refusedInData(tag, []);
113
+
114
+ /** Whether an element is a script of data, the one script a data part may be and none may hold. */
115
+ export const isDataScript = (tag, attributes) => tag.toLowerCase() === "script" && NO_CODE.test((attributes.find(({ name }) => name.toLowerCase() === "type")?.value ?? "").trim());
116
+
117
+ /** Whether `text` may be what such a script holds: JSON, with nothing in it that ends the script or makes a parser read on past its end. */
118
+ export function fitsDataScript(text) {
119
+ if (/<\/script|<!--/i.test(text)) return false;
120
+ try {
121
+ JSON.parse(text);
122
+ return true;
123
+ } catch {
124
+ return false;
125
+ }
126
+ }
127
+
128
+ /**
129
+ * The most a component writes in one commit, in bytes, well inside what a commit carries (service.mjs
130
+ * maxBody): a part holds no more, a page sends no more (commit.mjs `build`, what is left going with its
131
+ * next commit) and the server takes no more of a unit.
132
+ */
133
+ export const DATA_MOST = 1024 * 1024;
134
+
135
+ /** The attribute on an instance that says in which shape it holds its content: a whole number its component chooses. */
136
+ export const SCHEMA = "data-doc-schema";
137
+
138
+ /**
139
+ * Whether an instance says it holds its content in a shape the manifest does not reach (`value`, its
140
+ * SCHEMA; `schema`, the manifest's, 1 where it says none): written by a newer version of the package,
141
+ * it is read-only, its words and all. A value that is no number, or none at all, is no shape anything
142
+ * here can read.
143
+ */
144
+ export const schemaAhead = (value, schema = 1) => value !== null && value !== undefined && !(String(value).trim() !== "" && Number(value) <= schema);
145
+
146
+ /** Where the instances of the package `id` are. */
147
+ export const instanceMatch = (id) => `div[${ATTRIBUTE}="${id}"], section[${ATTRIBUTE}="${id}"]`;
148
+
149
+ export default {
150
+ id: "installed",
151
+ category: "whole",
152
+ match: INSTANCE,
153
+ attrs: {
154
+ "data-doc-component": "the package an instance is of: <scope>/<name>, on a block-level div or section",
155
+ "data-doc-schema": "the shape an instance holds its content in: a whole number its component chooses, read-only past its manifest's schema",
156
+ },
157
+ runtime: {
158
+ generated: [".doc-component-note", ".doc-component-data"],
159
+ attrs: { "[data-doc-fallback]": ["data-doc-fallback"], "[data-doc-fallback-control]": ["data-doc-fallback-control", "inert"] },
160
+ internal: [PACKAGE_MARK, "doc-component-more", DATA_ONE, DATA_LINE, DATA_SHORT], // of what the kit drew of a script of data: a line saying what it left out, and its marks
161
+ },
162
+ };