@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,226 @@
1
+ import { ICONS } from "../../page/menu.mjs";
2
+ import { own } from "../../page/overlays.mjs";
3
+ import { drawAt, shapeOf } from "../../page/overlay-layer.mjs";
4
+ import { keptByComponent } from "../../page/page-objects.mjs";
5
+ import { tooltip } from "../../page/tooltip.mjs";
6
+ import { addStyle, element } from "../../page/ui.mjs";
7
+ import { SHEETS } from "../kit.mjs";
8
+ import { TAB_ICON, iconKind, iconUrl, tabIconValue } from "../../../shared/emoji/icon-value.mjs";
9
+ import { panelFor, tabOf } from "./index.mjs";
10
+ import { newTab } from "./page.mjs";
11
+ import { t } from "../../../shared/i18n/index.mjs";
12
+
13
+ // 选项卡 as Notion's pills (notion-lite's src/blocks/tabs/edit/), while the page is edited. A click
14
+ // on a tab not shown switches to it (sheets.js, as when reading); a click on the tab shown opens
15
+ // its menu below it (重命名, 删除: block-menu/), a second click closes it; the right button opens it
16
+ // on any tab, switching first. Pressing a tab and moving more than a few pixels drags it along its
17
+ // row (drag/: a tab stays in its row). With the pointer on a tab row, + stands after its last tab:
18
+ // a new tab "选项卡 N" at the end, shown and renamed at once (page.mjs newTab; one undo step). An
19
+ // empty tab shows Notion's placeholder: a click there makes a paragraph in it (insert/ clickBlank)
20
+ // and blocks drop into it (drag/drop.mjs). Whenever a row's tabs change (+, deleting, moving, undo
21
+ // and redo), its area starts again (DocKit), so sheets.js knows them.
22
+
23
+ const STYLE = `
24
+ [data-ge-editing] .doc-sheet-tab:focus-visible { outline: 2px solid var(--doc-accent, #2678d8); }
25
+ .ge-layer > .ge-tab-add { pointer-events: auto; }
26
+ .ge-tab-add { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9999px; color: var(--ge-ico2); cursor: pointer; transition: background .1s ease-in-out; }
27
+ .ge-tab-add:hover { background: var(--ge-hover); }
28
+ .ge-tab-add:active { background: var(--ge-press); }
29
+ .ge-tab-add svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
30
+ /* The tab whose menu is open: as the shown tab under the pointer (Notion's .open). */
31
+ [data-ge-editing] .doc-sheet-tab[data-ge-open] { background: light-dark(rgb(33 27 23 / 7.5%), rgb(255 255 255 / 8.25%)); }
32
+ /* A tab being renamed (data-ge-renaming, page.mjs: no :has() on contenteditable, which made every
33
+ host's contenteditable set as the page opens recalculate the page's style): Notion's editing pill, the name a field. */
34
+ [data-ge-editing] .doc-sheet-tab[data-ge-renaming] { padding: 0 8px; background: var(--ge-field); cursor: text; }
35
+ [data-ge-editing] .doc-sheet-tab > [contenteditable="true"] { min-width: 1px; outline: none; -webkit-user-select: text; user-select: text; cursor: text; }
36
+ /* An empty tab: Notion's placeholder, a click makes a paragraph there. It takes the room of the
37
+ empty paragraph the click makes (a line of body text, no margin: flow.css's panel edges), so
38
+ nothing moves when it does; its fill under the pointer reaches 3px past the line (Notion's
39
+ padding), drawn as a shadow that takes no room. */
40
+ [data-ge-editing] [data-doc-sheet]:not(:has(> *))::before { content: ${JSON.stringify(t("空白选项卡。点击或拖动区块到这里。"))}; display: block; border-radius: 1px; color: var(--ge-tx3); cursor: pointer; transition: background 20ms ease-in, box-shadow 20ms ease-in; }
41
+ [data-ge-editing] [data-doc-sheet]:not(:has(> *)):hover::before { background: var(--ge-hover); box-shadow: 0 0 0 3px var(--ge-hover); }
42
+ `;
43
+
44
+ /**
45
+ * The pills' page object (a module of its own, as this one needs a page to load in, which page.mjs does
46
+ * not), with what the editor gives them: active() (whether block tools may show), struct (one undo
47
+ * step of changes to the page's structure, history.mjs), say (a notice) and the Sheet area's page
48
+ * object. Its blockTools(tools) is called by the block tools, which hold the rest: drag (drag/index.mjs),
49
+ * menu (their menu card) and openMenu(tab, rect, side, { onClose }), the block menu (block-menu/).
50
+ */
51
+ export function create({ active, struct, say, pages }) {
52
+ const rename = (tab) => {
53
+ const name = tabOf(tab);
54
+ if (name) pages.sheets.start(name);
55
+ };
56
+ return { blockTools: ({ drag, menu, openMenu }) => tabPills({ active, drag, menu, openMenu, struct, rename, say }) };
57
+ }
58
+
59
+ function tabPills({ active, drag, menu, openMenu, struct, rename, say }) {
60
+ addStyle(STYLE);
61
+ let press = null; // a tab pressed: { tab, x, y, shown: its Sheet showed, dragged }
62
+ let swallow = false; // the click ending a drag switches nothing
63
+ let row = null; // the tab row + stands in
64
+
65
+ const tabAt = (target) => (keptByComponent(target) ? null : target?.closest?.("main " + SHEETS.tabIn) ?? null);
66
+ const openTab = () => document.querySelector(SHEETS.tabIn + "[data-ge-open]"); // the tab whose menu is open
67
+ const keysOf = (area) => [...area.querySelectorAll(SHEETS.tabs)].map((tab) => tab.getAttribute(SHEETS.tabKey)).join(" ");
68
+
69
+ // ---------- a press, a drag, the menu ----------
70
+
71
+ document.addEventListener("pointerdown", (event) => {
72
+ swallow = false;
73
+ const tab = event.button === 0 && active() ? tabAt(event.target) : null;
74
+ const open = tab && openTab();
75
+ if (open && open !== tab) menu.close(); // another tab's menu goes; this one's closes on the click
76
+ press = tab && { tab, x: event.clientX, y: event.clientY, shown: tab.getAttribute("aria-selected") === "true", dragged: false };
77
+ }, true);
78
+ document.addEventListener("pointermove", (event) => {
79
+ if (!press) return;
80
+ if (press.dragged) {
81
+ if (drag.active) drag.move(event.clientX, event.clientY);
82
+ return;
83
+ }
84
+ if (Math.hypot(event.clientX - press.x, event.clientY - press.y) <= 4) return;
85
+ menu.close();
86
+ if (drag.start(press.tab, event.clientX, event.clientY)) press.dragged = true;
87
+ else press = null;
88
+ }, true);
89
+ document.addEventListener("pointerup", (event) => {
90
+ const pressed = press;
91
+ press = null;
92
+ if (!pressed) return;
93
+ if (pressed.dragged) {
94
+ swallow = true;
95
+ if (drag.active) drag.end(true);
96
+ return;
97
+ }
98
+ if (!pressed.shown || tabAt(event.target) !== pressed.tab) return; // the click shows its Sheet (sheets.js)
99
+ if (pressed.tab.hasAttribute("data-ge-open") && menu.isOpen) menu.close();
100
+ else openFor(pressed.tab);
101
+ }, true);
102
+ document.addEventListener("pointercancel", () => {
103
+ press = null;
104
+ if (drag.active) drag.end(false);
105
+ }, true);
106
+ document.addEventListener("click", (event) => {
107
+ if (!swallow) return;
108
+ swallow = false;
109
+ event.preventDefault();
110
+ event.stopPropagation();
111
+ }, true);
112
+ document.addEventListener("contextmenu", (event) => {
113
+ const tab = active() ? tabAt(event.target) : null;
114
+ if (!tab) return;
115
+ event.preventDefault();
116
+ if (tab.getAttribute("aria-selected") !== "true") tab.click();
117
+ openFor(tab);
118
+ }, true);
119
+
120
+ // Its menu below it, the tab drawn as Notion's while it is open.
121
+ function openFor(tab) {
122
+ const rect = tab.getBoundingClientRect();
123
+ hideAdd();
124
+ openMenu(tab, { left: rect.left, right: rect.right, top: rect.top, bottom: rect.bottom }, null, {
125
+ onClose: () => tab.removeAttribute("data-ge-open"),
126
+ });
127
+ tab.setAttribute("data-ge-open", "");
128
+ }
129
+
130
+ // ---------- + ----------
131
+
132
+ const add = element("div", { class: "ge-tab-add", role: "button", "aria-label": t("添加选项卡") });
133
+ add.innerHTML = ICONS.plus;
134
+ tooltip(add, t("添加选项卡"));
135
+ add.addEventListener("pointerdown", (event) => event.preventDefault()); // the focus stays where it is
136
+ add.addEventListener("click", (event) => {
137
+ event.preventDefault();
138
+ if (row?.isConnected) addTab(row);
139
+ });
140
+
141
+ // After the last tab of the row, or at the row's right end while its tabs run past it.
142
+ function place() {
143
+ const last = row?.isConnected && active() ? [...row.querySelectorAll(SHEETS.tabsOfRow)].at(-1) : null;
144
+ const shape = last && shapeOf(row);
145
+ if (!shape) return hideAdd();
146
+ const tab = last.getBoundingClientRect();
147
+ const right = row.getBoundingClientRect().right;
148
+ const shown = row;
149
+ own(add, "tab add", { owner: row, alive: () => row === shown && shown.isConnected });
150
+ drawAt(add, shape.layer, Math.min(tab.right + 4, right - 28) - shape.origin.left, (tab.top + tab.bottom) / 2 - 14 - shape.origin.top);
151
+ }
152
+ function hideAdd() {
153
+ row = null;
154
+ add.remove();
155
+ }
156
+ document.addEventListener("mousemove", (event) => {
157
+ if (add.contains(event.target)) return;
158
+ const over = active() && !openTab() && !keptByComponent(event.target) ? event.target.closest?.("main " + SHEETS.rowAt) ?? null : null;
159
+ if (over === row) return;
160
+ row = over;
161
+ if (row) place();
162
+ else hideAdd();
163
+ }, { passive: true, capture: true });
164
+ addEventListener("scroll", (event) => { if (row && event.target === row) place(); }, { passive: true, capture: true });
165
+ document.documentElement.addEventListener("mouseleave", hideAdd);
166
+
167
+ // A new tab at the end of the row: shown, its name selected to type over (one undo step).
168
+ function addTab(at) {
169
+ const area = at.parentElement;
170
+ const tabs = [...at.querySelectorAll(SHEETS.tabsOfRow)];
171
+ const last = tabs.at(-1);
172
+ const after = last && panelFor(last);
173
+ if (!after) return;
174
+ const { tab, panel, key } = newTab(area, t("选项卡 {0}", tabs.length + 1));
175
+ menu.close();
176
+ struct([at, area], [], () => {
177
+ last.after(tab);
178
+ after.after(panel);
179
+ return { touched: [], focus: null };
180
+ });
181
+ restart(area, key);
182
+ at.scrollTo?.({ left: at.scrollWidth, behavior: "smooth" });
183
+ place();
184
+ rename(tab);
185
+ say(t("已添加选项卡 · 输入名称后按 Enter · Ctrl+Z 撤销"));
186
+ }
187
+
188
+ // ---------- the areas follow their tabs ----------
189
+
190
+ const mounted = new WeakMap(); // area -> the keys of its tabs when it last started here
191
+ function restart(area, show = null) {
192
+ mounted.set(area, keysOf(area));
193
+ const kit = globalThis.DocKit;
194
+ if (!kit) return;
195
+ kit.destroy(area);
196
+ kit.mount(area);
197
+ if (show) globalThis.DocSheets?.get(area)?.set(show);
198
+ }
199
+ new MutationObserver((records) => {
200
+ const areas = new Set(records.map((record) => record.target).filter((node) => node.nodeType === 1 && node.matches(SHEETS.row)).map((node) => node.parentElement));
201
+ for (const area of areas) if (area?.isConnected && area.matches(SHEETS.match) && mounted.get(area) !== keysOf(area)) restart(area);
202
+ if (row) place();
203
+ }).observe(document.querySelector("main") ?? document.body, { childList: true, subtree: true });
204
+ // A tab's emoji, set or taken away: its picture (the server's image of it, as render/emoji.mjs
205
+ // gives it when the page is served).
206
+ new MutationObserver((records) => {
207
+ for (const { target: tab } of records) {
208
+ if (!tab.getAttribute?.(SHEETS.tabKey)) continue;
209
+ const icon = tab.getAttribute("data-tab-icon");
210
+ if (iconKind(icon) === "emoji") tab.style.setProperty(TAB_ICON, tabIconValue(iconUrl(icon)));
211
+ else tab.style.removeProperty(TAB_ICON);
212
+ if (tab.getAttribute("style") === "") tab.removeAttribute("style");
213
+ }
214
+ }).observe(document.querySelector("main") ?? document.body, { attributes: true, attributeFilter: ["data-tab-icon"], subtree: true });
215
+
216
+ return {
217
+ /** Whether a node is a tab of a row or +: a press there is theirs. */
218
+ holds: (node) => Boolean(tabAt(node)) || add.contains(node),
219
+ /** The editing stops (or the block tools go). */
220
+ hide() {
221
+ press = null;
222
+ hideAdd();
223
+ },
224
+ get nodes() { return [add]; },
225
+ };
226
+ }
@@ -0,0 +1,73 @@
1
+ // A table's rows and cells on the page (docs/editor.md, "Tables"), as the commits compare them: the
2
+ // table unit's grid when the file has it written as the kit writes one (its thead's rows, then its tbody's,
3
+ // each of cells, merged ones tiling a rectangle with the others), else null (only its cells' text is
4
+ // edited). Whether it is, the server judged once (source/table.mjs plainTable) and marked on the unit
5
+ // (index.mjs GRID); this reads the mark, it judges nothing. What a commit sends of a table whose grid
6
+ // changed is its rows anew (source/table.mjs): each row and cell by where it was when the page last
7
+ // committed, or new; a cell's text where it changed, its spans where they changed.
8
+
9
+ import { GRID, lookOf, widthOf } from "./index.mjs";
10
+ // An element's identity (core.mjs ELEMENT_ID): a cell retagged (td and th) stays the same cell, as
11
+ // its new element takes the old one's identity (page.mjs retagCell).
12
+ const ID = "data-ge-id";
13
+ const PREFIX = `${Math.random().toString(36).slice(2, 6)}t`;
14
+ let count = 0;
15
+ const idOf = (element) => element.getAttribute(ID) ?? (element.setAttribute(ID, `${PREFIX}${(count++).toString(36)}`), element.getAttribute(ID));
16
+
17
+ /** The table element of a table unit (its frame's, or the table itself). */
18
+ export const tableOf = (unit) => (unit?.localName === "table" ? unit : unit?.querySelector?.(":scope > table") ?? null);
19
+
20
+ /** A table unit's grid: { table, rows: [{ el, head, cells: [{ el, tag, scope, look, width, rowspan, colspan }] }] }, or null when the unit has none (GRID). */
21
+ export function gridOf(unit) {
22
+ const table = unit?.hasAttribute?.(GRID) ? tableOf(unit) : null;
23
+ if (!table) return null;
24
+ return {
25
+ table,
26
+ rows: [...table.querySelectorAll(":scope > thead > tr, :scope > tbody > tr")].map((row) => ({
27
+ el: row,
28
+ id: idOf(row),
29
+ head: row.parentElement.localName === "thead",
30
+ cells: [...row.children].map((cell) => ({ el: cell, id: idOf(cell), tag: cell.localName, scope: cell.localName === "th" ? cell.getAttribute("scope") : null, look: lookOf(cell), width: widthOf(cell), rowspan: cell.rowSpan, colspan: cell.colSpan })),
31
+ })),
32
+ };
33
+ }
34
+
35
+ const sameGrid = (a, b) => a.rows.length === b.rows.length && a.rows.every((row, r) => {
36
+ const other = b.rows[r];
37
+ return row.id === other.id && row.head === other.head && row.cells.length === other.cells.length
38
+ && row.cells.every((cell, c) => cell.id === other.cells[c].id && cell.tag === other.cells[c].tag && cell.scope === other.cells[c].scope && cell.look === other.cells[c].look && cell.width === other.cells[c].width
39
+ && cell.rowspan === other.cells[c].rowspan && cell.colspan === other.cells[c].colspan);
40
+ });
41
+
42
+ /**
43
+ * What a commit sends of a table whose grid changed since `before` (its grid when the page last
44
+ * committed): { rows } (source/table.mjs), or null when it did not change or is not plain now.
45
+ * textOf(cell): a cell's text, and whether it changed ({ html, changed }).
46
+ */
47
+ export function tableChange(before, unit, textOf) {
48
+ const now = gridOf(unit);
49
+ if (!before || !now || sameGrid(before, now)) return null;
50
+ const position = new Map(before.rows.flatMap((row, r) => row.cells.map((cell, c) => [cell.id, [r, c]])));
51
+ const looks = new Map(before.rows.flatMap((row) => row.cells.map((cell) => [cell.id, cell.look])));
52
+ const widths = new Map(before.rows.flatMap((row) => row.cells.map((cell) => [cell.id, cell.width])));
53
+ const spans = new Map(before.rows.flatMap((row) => row.cells.map((cell) => [cell.id, `${cell.rowspan}x${cell.colspan}`])));
54
+ const rows = now.rows.map((row) => {
55
+ const from = before.rows.findIndex((other) => other.id === row.id);
56
+ return {
57
+ head: row.head,
58
+ from: from < 0 ? null : from,
59
+ cells: row.cells.map((cell) => {
60
+ const at = position.get(cell.id) ?? null;
61
+ const { html, changed } = textOf(cell.el);
62
+ // Its look where it changed (a new cell's when it has one).
63
+ const look = at === null ? (cell.look ? cell.look : undefined) : cell.look !== looks.get(cell.id) ? cell.look : undefined;
64
+ // Its column's width where it changed (a new cell's when it has one).
65
+ const width = at === null ? (cell.width ?? undefined) : cell.width !== widths.get(cell.id) ? cell.width : undefined;
66
+ // Its spans where they changed (a new cell's when it is merged).
67
+ const spanned = at === null ? cell.rowspan > 1 || cell.colspan > 1 : spans.get(cell.id) !== `${cell.rowspan}x${cell.colspan}`;
68
+ return { from: at, tag: cell.tag, ...(cell.scope ? { scope: cell.scope } : {}), ...(at === null || changed ? { html } : {}), ...(look !== undefined ? { look } : {}), ...(width !== undefined ? { width } : {}), ...(spanned ? { rowspan: cell.rowspan, colspan: cell.colspan } : {}) };
69
+ }),
70
+ };
71
+ });
72
+ return { rows };
73
+ }
@@ -0,0 +1,306 @@
1
+ import { BLOCK_COLORS } from "../colors.mjs";
2
+ import { svg } from "../icons.mjs";
3
+ import { SPAN } from "../../../shared/media.mjs";
4
+ import { numberValue, rawCellValue } from "../../../shared/number-reading.mjs";
5
+ import { columnWidths, slotsOf, tileSlots, tileSpans } from "../../../shared/table-slots.mjs";
6
+ import { CELL_ALIGN_CLASSES, CELL_BOLD_CLASS, CELL_VALIGN_CLASSES } from "../../../shared/components/table.mjs";
7
+ import { CHART_KEY, CHART_SOURCE } from "../../../shared/table-chart.mjs";
8
+ import { t } from "../../../shared/i18n/index.mjs";
9
+
10
+ const ICON = svg('<rect x="3.25" y="3.75" width="13.5" height="12.5" rx="2"/><path d="M3.25 8h13.5M3.25 12.1h13.5M8.25 3.75v12.5"/>');
11
+
12
+ // 表格: a table in its frame (.doc-table-wrap), with the scope line above it
13
+ // (.doc-table-meta) going along as its lead. One block: its cells are text blocks that may be
14
+ // emptied; rows and columns go in and out only through the table's own operation (page/table/). Its frame's width and scroll height are sizes.
15
+ // The kit lays it out (render/kit/tables.js: column widths, sorting, the frame's scrollbars).
16
+ //
17
+ // Where the engines reach it (src/editor/page/ unless named): convert.mjs (a new one from the "/"
18
+ // menu: page.mjs `create`), resize/ (dragging its right and
19
+ // bottom edges: tableWidthAt, heightAt), page/table/ (its block menu rows: 铺满正文宽度, 恢复默认大小),
20
+ // core.mjs (its scope line goes with it: unitElement, withLeads, markFrames), ../source/ (finding its cells
21
+ // and its lead: table(), leadOf; a cell's data-sort-value following its text: apply.mjs sortKey).
22
+ // clipboard/own/ (copied as itself with its data: `clipboard`, and `build` in page.mjs), src/transfer/markdown.mjs (`read`, `grid`).
23
+ // page.mjs: a new one (a paste: clipboard/); file.mjs: a new one in report.html.
24
+ // Its look: the kit's styles/table.css, laid out and sorted by tables/ (src/render/kit/).
25
+
26
+ /**
27
+ * 识别数字列 off: the kit reads none of the table's columns as numbers (none centered, none sorted by
28
+ * its header: tables/cells.js). On its frame (the unit); a table without it has its numeric
29
+ * columns read (the Agent's). A table made from "/" starts with it; 一键优化 and a table pasted from
30
+ * elsewhere go without.
31
+ */
32
+ export const NUMBERS = "data-number-columns";
33
+ export const TABLE_HEIGHT = "--doc-table-height";
34
+
35
+ /**
36
+ * The mark of a table unit the table's tools are for (grid.mjs, page/table/): the server marks the
37
+ * units of the file it judges plain (source/table.mjs plainTable; the page only reads it), and a
38
+ * table made on the page has it by construction (page.mjs newTable) until the file says.
39
+ */
40
+ export const GRID = "data-ge-grid";
41
+
42
+ export default {
43
+ name: "table",
44
+ listed: () => t("表格"),
45
+ units: {
46
+ table: {
47
+ name: t("表格"),
48
+ icon: ICON,
49
+ match: [
50
+ { rank: 80, tag: "table" },
51
+ { rank: 90, class: "doc-table-wrap" },
52
+ ],
53
+ boxed: true,
54
+ resizable: ".doc-table-wrap[data-ge-unit]", // its right and bottom edges, once it is in the file
55
+ copy: "itself", // within the report a copy keeps all of its markup (its scope line, its frame's size); another report's gets the table's data (tableData) made anew
56
+ attributes: { [NUMBERS]: (value) => value === "off" },
57
+ sizes: {
58
+ [SPAN]: { min: 0.15, max: 3 }, // past 1 the table is wider than the text and scrolls in its frame
59
+ [TABLE_HEIGHT]: { min: 80, max: 4000, px: true, none: true, height: true },
60
+ },
61
+ },
62
+ },
63
+ components: ["doc-table-wrap", "doc-table-meta"],
64
+ hosts: {
65
+ cell: { name: t("表格单元格"), caps: () => ["empty", "links"] },
66
+ },
67
+ types: {
68
+ // Made by a paste or the "/" menu (三列三行, a header row: page.mjs newTable): no class here, so
69
+ // that the Agent's tables keep no type. What it is written with: its rows of cells' inline HTML,
70
+ // whether its first row is a header row and its first column a header column, its cells' looks,
71
+ // whether its numeric columns are read (file.mjs).
72
+ table: {
73
+ menu: ["basic", 14], fresh: 8,
74
+ tag: "div", kind: "table", bare: true, extras: (element, { serializeInner }) => tableData(element, serializeInner),
75
+ // Copied as itself, its tools with it (GRID) in the report it comes from, with its data to be
76
+ // made anew elsewhere; another program's comes as this, as does a grid of cells. Its page.mjs
77
+ // makes it from that.
78
+ clipboard: {
79
+ kind: "table", keeps: [GRID], grid: tableGrid,
80
+ read: (unit, { withPictures }) => tableData(unit, withPictures),
81
+ // Its data, its cells' looks always there, so that a header cell the Agent left plain stays
82
+ // plain, and as much of it as a description can carry (carriableTable: a table an Agent wrote
83
+ // may say what the page's own never do), so that the copy, which is checked as a whole, is
84
+ // never refused for its data.
85
+ data(node, { serializeInner }) {
86
+ const data = tableData(node, serializeInner);
87
+ if (data.rows.length === 0 || data.rows.every((row) => row.length === 0)) return null;
88
+ const carried = carriableTable({ ...data, looks: data.looks ?? data.rows.map((row) => row.map(() => "")) }, (cell) => typeof cell === "string" && cell.length <= MAX_CELL_HTML);
89
+ return carried && { type: "table", ...carried };
90
+ },
91
+ check: (block, { string }) => validTable(block, (cell) => string(cell, MAX_CELL_HTML)) && (block.outside === undefined || block.outside === true),
92
+ text: (block) => block.rows.flat(),
93
+ },
94
+ label: t("表格"), icon: ICON, words: "表格 表 biaoge bg table grid",
95
+ glance: { row: 9, name: "表格", write: "`<table>`, its title a `<caption>`", after: "`div.doc-table-wrap` › `table.doc-table`, the caption a `p.doc-note` above it", rule: "Tables" },
96
+ },
97
+ },
98
+ };
99
+
100
+ // The classes of a cell's look are the table description's (shared/components/table.mjs), the kit's
101
+ // styles/table.css draws them; here they are named for the menus.
102
+ /** A cell's alignments with their names: its words to the left, the middle, the right. */
103
+ export const CELL_ALIGNS = CELL_ALIGN_CLASSES.map((name, index) => [name, [t("左对齐"), t("居中"), t("右对齐")][index]]);
104
+ /** A cell's vertical alignments with their names: its words at its top (the kit's own), middle, bottom. */
105
+ export const CELL_VALIGNS = CELL_VALIGN_CLASSES.map((name, index) => [name, [t("顶端对齐"), t("垂直居中"), t("底端对齐")][index]]);
106
+
107
+ /** A cell's words bold, all of them (the kit's class): the words typed in it later too. */
108
+ export const CELL_BOLD = CELL_BOLD_CLASS;
109
+
110
+ /**
111
+ * The classes that are a cell's look (the table's tools set them, its operation writes them): its
112
+ * color (notion-lite's: one per cell, a text color or a fill, as a block's: components/colors.mjs),
113
+ * its alignment, its vertical alignment and its bold. A cell's other classes are the file's.
114
+ */
115
+ export const CELL_LOOKS = [...BLOCK_COLORS, ...CELL_ALIGNS.map(([name]) => name), ...CELL_VALIGNS.map(([name]) => name), CELL_BOLD];
116
+
117
+ /**
118
+ * The look a cell takes when it becomes a header cell (a th: the header row's or column's toggle, a
119
+ * row or column moved there, a cell made there: page.mjs) and loses when it stops being one: bold,
120
+ * and the gray fill unless it has a color of its own. Nothing else of the kit's sets a header apart.
121
+ */
122
+ export const HEADER_LOOK = [CELL_BOLD, "doc-highlight-gray"];
123
+
124
+ /** A look as a cell may have it: classes of CELL_LOOKS, a color, an alignment, a vertical one and bold at most once each. */
125
+ export function validLook(look) {
126
+ if (typeof look !== "string" || look.length > 200) return false;
127
+ const names = look.split(" ").filter(Boolean);
128
+ const one = (group) => names.filter((name) => group.includes(name)).length <= 1;
129
+ return names.every((name) => CELL_LOOKS.includes(name)) && new Set(names).size === names.length
130
+ && one(BLOCK_COLORS) && one(CELL_ALIGNS.map(([name]) => name)) && one(CELL_VALIGNS.map(([name]) => name));
131
+ }
132
+
133
+ /**
134
+ * Whether the cells of a table's first column (its body rows', top down) hold its rows' names, so
135
+ * that 一键优化 makes it the header column: two at least, each written, none a number (by the kit's
136
+ * reading of the cell, src/shared/number-reading.mjs), no two alike.
137
+ */
138
+ export function rowNames(cells) {
139
+ const texts = cells.map((cell) => cell.textContent.trim());
140
+ return cells.length >= 2 && cells.every((cell, index) => texts[index] && numberValue(rawCellValue(cell)) === null) && new Set(texts).size === texts.length;
141
+ }
142
+
143
+ /**
144
+ * The width the reader gave a cell's column (the table's tools write it on the first row's cells;
145
+ * the kit lays the columns out at it: tables/layout.js manualLayout): "160px", or null.
146
+ */
147
+ export const COLUMN_WIDTH = "--doc-column-width";
148
+ export const widthOf = (cell) => cell.style.getPropertyValue(COLUMN_WIDTH).trim() || null;
149
+ /** The narrowest a column is made (px): by dragging it, and as a cell may have it written. */
150
+ export const MIN_COLUMN_WIDTH = 35;
151
+ /** A width as a cell may have it: whole or fractional pixels, from MIN_COLUMN_WIDTH to 4000. */
152
+ export const validWidth = (width) => width === null || (typeof width === "string" && /^\d{1,4}(\.\d{1,2})?px$/.test(width) && parseFloat(width) >= MIN_COLUMN_WIDTH && parseFloat(width) <= 4000);
153
+
154
+ /** A cell's look: its classes that are one (CELL_LOOKS), in order, as one string. */
155
+ export const lookOf = (cell) => [...cell.classList].filter((name) => CELL_LOOKS.includes(name)).sort().join(" ");
156
+
157
+ /**
158
+ * The height a frame scrolls at without a height of its own: the kit's (styles/table.css, the one
159
+ * place that number is written), asked of the frame with its own height taken off for a moment
160
+ * (Infinity where no kit styles it, and for a frame the kit shows whole: a short table or one
161
+ * mostly of words, data-doc-whole). 一键优化 and the bottom edge's drag (resize/) both ask it.
162
+ */
163
+ export function scrollHeight(unit) {
164
+ const own = unit.style.getPropertyValue(TABLE_HEIGHT);
165
+ unit.style.removeProperty(TABLE_HEIGHT);
166
+ const height = parseFloat(getComputedStyle(unit).maxHeight);
167
+ unit.style.setProperty(TABLE_HEIGHT, own);
168
+ return Number.isFinite(height) ? height : Infinity;
169
+ }
170
+
171
+ /** The most cells a table has (the server writes no more). */
172
+ export const MAX_TABLE_CELLS = 5000;
173
+ const MAX_SPAN = 1000;
174
+
175
+ /**
176
+ * Where a table's cells stand (shared/table-slots.mjs tileSpans), as its slots (matrix, places by "row:index", columns),
177
+ * or null when they tile no rectangle: `node` is a table as tableData describes it.
178
+ */
179
+ export const tableTiling = (node) => tileSpans(node.rows.map((row, r) => ({ head: Boolean(node.header) && r === 0, cells: node.spans?.[r] ?? row.map(() => [1, 1]) })));
180
+
181
+ /**
182
+ * A table's rows as a grid, each cell as `write` writes it, for a Markdown table, which has no merged
183
+ * cells: a merged cell's other slots empty. `columns`: the columns of one whose cells tile no rectangle.
184
+ */
185
+ export function tableGrid(node, columns, write) {
186
+ const tiling = tableTiling(node);
187
+ return node.rows.map((row, r) => {
188
+ const cells = Array(tiling?.columns ?? columns).fill("");
189
+ row.forEach((cell, index) => {
190
+ cells[tiling?.places.get(`${r}:${index}`)?.c ?? index] = write(cell);
191
+ });
192
+ return cells;
193
+ });
194
+ }
195
+
196
+ /**
197
+ * Whether `node` is a table as tableData describes it: its rows of cells (`validCell(html)`: what a cell
198
+ * may hold is the one who asks's to say, the server's allowlist of inline HTML and lists, the
199
+ * clipboard's string that is made again), its flags, its cells' looks, spans and the columns' widths
200
+ * (a row has as many cells as it has, the cells tile a rectangle), and the key a chart reads it by.
201
+ */
202
+ export function validTable(node, validCell) {
203
+ if (node.chart !== undefined && !(typeof node.chart === "string" && CHART_KEY.test(node.chart))) return false;
204
+ if (!Array.isArray(node.rows) || node.rows.length < 1 || node.rows.length > MAX_TABLE_CELLS) return false;
205
+ if (!node.rows.every((row) => Array.isArray(row) && row.length <= MAX_TABLE_CELLS && row.every(validCell))) return false;
206
+ if ((node.header !== undefined && node.header !== true) || (node.column !== undefined && node.column !== true) || (node.numbers !== undefined && node.numbers !== false)) return false;
207
+ if (node.spans !== undefined && !(Array.isArray(node.spans) && node.spans.length === node.rows.length && node.spans.every((row, r) => Array.isArray(row) && row.length === node.rows[r].length
208
+ && row.every((span) => Array.isArray(span) && span.length === 2 && span.every((value) => Number.isInteger(value) && value >= 1 && value <= MAX_SPAN))))) return false;
209
+ const places = tableTiling(node);
210
+ // A row may hold no cell: a merged cell above covers all of it.
211
+ if (!places || places.columns < 1 || node.rows.length * places.columns > MAX_TABLE_CELLS) return false;
212
+ return (node.looks === undefined || (Array.isArray(node.looks) && node.looks.length === node.rows.length
213
+ && node.looks.every((row, r) => Array.isArray(row) && row.length === node.rows[r].length && row.every(validLook))))
214
+ && (node.widths === undefined || (Array.isArray(node.widths) && node.widths.length === places.columns && node.widths.every(validWidth)));
215
+ }
216
+
217
+ /** The most a cell's inline HTML is as a description of a table has it (the clipboard's and the server's). */
218
+ export const MAX_CELL_HTML = 20000;
219
+
220
+ /**
221
+ * The clipboard type of cells copied from a table of the page (page/table/cells.mjs: { v: 1, cells },
222
+ * their inline HTML row by row), which a paste into cells reads first, and one elsewhere as the page's
223
+ * own (page/clipboard/: one cell its text, more a table of them).
224
+ */
225
+ export const CELLS_MIME = "application/x-gallery-cells";
226
+ /** Its name before 2026-10-26: written beside it and read when it is not there (a page of the old version in another tab). */
227
+ export const OLD_CELLS_MIME = "application/x-report-studio-cells";
228
+ /** The cells copied in `data` (a DataTransfer): under CELLS_MIME, else OLD_CELLS_MIME; "" when neither. */
229
+ export const cellsData = (data) => data.getData(CELLS_MIME) || data.getData(OLD_CELLS_MIME);
230
+
231
+ /**
232
+ * A look with what a cell may have of it: the first of the classes of each kind (a color, an
233
+ * alignment, a vertical one) and bold. A table an Agent wrote by hand may give a cell a text color and
234
+ * a fill, which the page's tables never have (notion-lite's: one color a cell).
235
+ */
236
+ function carriedLook(look) {
237
+ const taken = new Set();
238
+ const kinds = [BLOCK_COLORS, CELL_ALIGNS.map(([name]) => name), CELL_VALIGNS.map(([name]) => name)];
239
+ return look.split(" ").filter((name) => {
240
+ const group = kinds.findIndex((names) => names.includes(name));
241
+ if (group >= 0 && taken.has(group)) return false;
242
+ taken.add(group);
243
+ return true;
244
+ }).join(" ");
245
+ }
246
+
247
+ /**
248
+ * What of a table as tableData describes it a description can carry: the table itself when validTable
249
+ * accepts it; else one cell with a color, an alignment, a vertical one and bold at most, a column's
250
+ * width that is one of validWidth's or none; else (a merged cell crossing the header, which the
251
+ * description's single header row cannot say) the table taken apart into its slots, each merged cell's
252
+ * words in the slot it begins at, its look in all of them. Null when nothing of it can be carried.
253
+ */
254
+ export function carriableTable(node, validCell) {
255
+ if (validTable(node, validCell)) return node;
256
+ const { spans, looks, widths, ...rest } = node;
257
+ const own = {
258
+ ...rest,
259
+ ...(looks ? { looks: looks.map((row) => row.map((look) => (validLook(look) ? look : carriedLook(look)))) } : {}),
260
+ ...(widths?.some((width) => validWidth(width) && width) ? { widths: widths.map((width) => (validWidth(width) ? width : null)) } : {}),
261
+ };
262
+ if (validTable({ ...own, ...(spans ? { spans } : {}) }, validCell)) return { ...own, ...(spans ? { spans } : {}) };
263
+ const slots = tileSlots(node.rows.map((row, r) => ({ section: 0, cells: row.map((_, index) => ({ ref: [r, index], rowspan: spans?.[r][index][0] ?? 1, colspan: spans?.[r][index][1] ?? 1 })) })));
264
+ if (!slots) return null;
265
+ const home = (ref) => slots.places.get(ref);
266
+ const from = (grid, r, c, empty) => grid ? grid[slots.matrix[r][c][0]][slots.matrix[r][c][1]] : empty;
267
+ const flat = {
268
+ ...own,
269
+ rows: slots.matrix.map((cells, r) => cells.map((ref, c) => (home(ref).r === r && home(ref).c === c ? from(node.rows, r, c) : ""))),
270
+ ...(own.looks ? { looks: slots.matrix.map((cells, r) => cells.map((_, c) => from(own.looks, r, c))) } : {}),
271
+ };
272
+ return validTable(flat, validCell) ? flat : null;
273
+ }
274
+
275
+ /**
276
+ * A table as it is now, as the page describes it to the server (a new one is written from it:
277
+ * file.mjs) and to the clipboard (another report's copy is made from it: clipboard/own/): its rows of
278
+ * its cells' inline HTML (a cell's lists with it), its header row (a thead) and header column (each
279
+ * body row's cell in the first column a th), its cells' looks when one has one, its columns' widths
280
+ * when one has one, its cells' spans when one is merged (the table's tools may have changed any of
281
+ * them before it is first written), whether its numeric columns are read and the key a chart drawn
282
+ * from it reads it by (`chart`: its frame's data-doc-chart-source, src/shared/table-chart.mjs; a
283
+ * table pasted anew in the report it was copied from keeps it, clipboard/own/chart-keys.mjs). `element`:
284
+ * the table's frame, or the table.
285
+ */
286
+ export function tableData(element, serializeInner) {
287
+ const table = element.localName === "table" ? element : element.querySelector("table");
288
+ const rows = [...(table?.rows ?? [])];
289
+ const slots = rows.length ? slotsOf(rows) : null;
290
+ const heads = table?.tHead?.rows.length ?? 0;
291
+ const header = heads > 0;
292
+ const column = rows.length > heads && Boolean(slots) && rows.slice(heads).every((row, index) => slots.matrix[heads + index][0].localName === "th");
293
+ const looks = rows.map((row) => [...row.cells].map(lookOf));
294
+ const widths = slots ? columnWidths(slots, widthOf) : [];
295
+ const spans = rows.map((row) => [...row.cells].map((cell) => [cell.rowSpan, cell.colSpan]));
296
+ const chart = (element.localName === "table" ? element.closest(".doc-table-wrap") : element)?.getAttribute(CHART_SOURCE);
297
+ return {
298
+ rows: rows.map((row) => [...row.cells].map((cell) => serializeInner(cell))),
299
+ ...(header ? { header: true } : {}), ...(column ? { column: true } : {}),
300
+ ...(looks.some((row) => row.some(Boolean)) ? { looks } : {}),
301
+ ...(widths.some(Boolean) ? { widths } : {}),
302
+ ...(spans.some((row) => row.some(([down, across]) => down > 1 || across > 1)) ? { spans } : {}),
303
+ ...(element.getAttribute(NUMBERS) === "off" ? { numbers: false } : {}),
304
+ ...(chart && CHART_KEY.test(chart) ? { chart } : {}),
305
+ };
306
+ }