@heycys/gallery 0.0.0-stage → 0.1.1

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 (806) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/THIRD-PARTY-NOTICES.md +3303 -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 +64 -0
  11. package/browser/editor/components/code/index.mjs +327 -0
  12. package/browser/editor/components/code/page.mjs +561 -0
  13. package/browser/editor/components/colors.mjs +50 -0
  14. package/browser/editor/components/columns/index.mjs +104 -0
  15. package/browser/editor/components/columns/page.mjs +310 -0
  16. package/browser/editor/components/details/index.mjs +73 -0
  17. package/browser/editor/components/details/page.mjs +86 -0
  18. package/browser/editor/components/dialog/index.mjs +84 -0
  19. package/browser/editor/components/dialog/page.mjs +201 -0
  20. package/browser/editor/components/divider/index.mjs +48 -0
  21. package/browser/editor/components/embed/icons.mjs +11 -0
  22. package/browser/editor/components/embed/index.mjs +123 -0
  23. package/browser/editor/components/embed/page.mjs +309 -0
  24. package/browser/editor/components/figure/index.mjs +87 -0
  25. package/browser/editor/components/figure/page.mjs +42 -0
  26. package/browser/editor/components/file/icons.mjs +14 -0
  27. package/browser/editor/components/file/index.mjs +77 -0
  28. package/browser/editor/components/file/page.mjs +114 -0
  29. package/browser/editor/components/flowchart/add.mjs +123 -0
  30. package/browser/editor/components/flowchart/index.mjs +246 -0
  31. package/browser/editor/components/flowchart/page.mjs +453 -0
  32. package/browser/editor/components/heading/index.mjs +53 -0
  33. package/browser/editor/components/heading/page.mjs +6 -0
  34. package/browser/editor/components/highlight/index.mjs +63 -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 +48 -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 +179 -0
  43. package/browser/editor/components/installed/page.mjs +523 -0
  44. package/browser/editor/components/installed/served.mjs +35 -0
  45. package/browser/editor/components/kit.mjs +67 -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 +192 -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 +859 -0
  66. package/browser/editor/components/rows.mjs +16 -0
  67. package/browser/editor/components/section/index.mjs +42 -0
  68. package/browser/editor/components/section/page.mjs +141 -0
  69. package/browser/editor/components/set-apart.mjs +24 -0
  70. package/browser/editor/components/sheets/index.mjs +137 -0
  71. package/browser/editor/components/sheets/page.mjs +227 -0
  72. package/browser/editor/components/sheets/pills.mjs +226 -0
  73. package/browser/editor/components/table/grid.mjs +73 -0
  74. package/browser/editor/components/table/index.mjs +308 -0
  75. package/browser/editor/components/table/page.mjs +683 -0
  76. package/browser/editor/components/table/slots.mjs +41 -0
  77. package/browser/editor/components/widget/index.mjs +50 -0
  78. package/browser/editor/page/annotate/anchors.mjs +230 -0
  79. package/browser/editor/page/annotate/card.mjs +102 -0
  80. package/browser/editor/page/annotate/index.mjs +1656 -0
  81. package/browser/editor/page/at-menu/index.mjs +317 -0
  82. package/browser/editor/page/autosave.mjs +1023 -0
  83. package/browser/editor/page/beside.mjs +21 -0
  84. package/browser/editor/page/block-info.mjs +63 -0
  85. package/browser/editor/page/block-menu/colors.mjs +84 -0
  86. package/browser/editor/page/block-menu/index.mjs +217 -0
  87. package/browser/editor/page/blocks.mjs +255 -0
  88. package/browser/editor/page/caret.mjs +682 -0
  89. package/browser/editor/page/changes/bar.mjs +102 -0
  90. package/browser/editor/page/changes/ghost.mjs +206 -0
  91. package/browser/editor/page/changes/gone-words.mjs +94 -0
  92. package/browser/editor/page/changes/index.mjs +447 -0
  93. package/browser/editor/page/changes/words.mjs +27 -0
  94. package/browser/editor/page/chip-fills.mjs +126 -0
  95. package/browser/editor/page/clipboard/import/colors.mjs +192 -0
  96. package/browser/editor/page/clipboard/import/html.mjs +792 -0
  97. package/browser/editor/page/clipboard/import/inline.mjs +232 -0
  98. package/browser/editor/page/clipboard/import/languages.mjs +42 -0
  99. package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
  100. package/browser/editor/page/clipboard/import/math.mjs +100 -0
  101. package/browser/editor/page/clipboard/import/office.mjs +245 -0
  102. package/browser/editor/page/clipboard/import/read.mjs +120 -0
  103. package/browser/editor/page/clipboard/import/rich.mjs +29 -0
  104. package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
  105. package/browser/editor/page/clipboard/index.mjs +816 -0
  106. package/browser/editor/page/clipboard/own/blocks.mjs +211 -0
  107. package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
  108. package/browser/editor/page/clipboard/own/describe.mjs +124 -0
  109. package/browser/editor/page/clipboard/own/export.mjs +167 -0
  110. package/browser/editor/page/clipboard/own/ids.mjs +39 -0
  111. package/browser/editor/page/clipboard/own/index.mjs +13 -0
  112. package/browser/editor/page/clipboard/own/rules.mjs +44 -0
  113. package/browser/editor/page/clipboard/own/selection.mjs +159 -0
  114. package/browser/editor/page/clipboard/own/writers.mjs +315 -0
  115. package/browser/editor/page/columns/index.mjs +360 -0
  116. package/browser/editor/page/commit.mjs +1813 -0
  117. package/browser/editor/page/conflicts.mjs +249 -0
  118. package/browser/editor/page/convert.mjs +831 -0
  119. package/browser/editor/page/core.mjs +1693 -0
  120. package/browser/editor/page/drag/drop.mjs +307 -0
  121. package/browser/editor/page/drag/index.mjs +351 -0
  122. package/browser/editor/page/drag/preview.mjs +126 -0
  123. package/browser/editor/page/edge-scroll.mjs +50 -0
  124. package/browser/editor/page/editor.mjs +1780 -0
  125. package/browser/editor/page/emoji-picker/emoji-tab.mjs +287 -0
  126. package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
  127. package/browser/editor/page/emoji-picker/grid.mjs +81 -0
  128. package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
  129. package/browser/editor/page/emoji-picker/icons.mjs +31 -0
  130. package/browser/editor/page/emoji-picker/index.mjs +166 -0
  131. package/browser/editor/page/emoji-picker/styles.mjs +161 -0
  132. package/browser/editor/page/emoji-picker/support.mjs +204 -0
  133. package/browser/editor/page/emoji-picker/upload.mjs +236 -0
  134. package/browser/editor/page/export-report.mjs +23 -0
  135. package/browser/editor/page/fills.mjs +62 -0
  136. package/browser/editor/page/find/index.mjs +107 -0
  137. package/browser/editor/page/flags.mjs +70 -0
  138. package/browser/editor/page/fold/index.mjs +348 -0
  139. package/browser/editor/page/fold/rule.mjs +125 -0
  140. package/browser/editor/page/folded.mjs +23 -0
  141. package/browser/editor/page/format-bar/bar.mjs +449 -0
  142. package/browser/editor/page/format-bar/brush.mjs +77 -0
  143. package/browser/editor/page/format-bar/colors.mjs +46 -0
  144. package/browser/editor/page/format-bar/index.mjs +404 -0
  145. package/browser/editor/page/formula/index.mjs +236 -0
  146. package/browser/editor/page/formula/panel.mjs +336 -0
  147. package/browser/editor/page/formula/symbols.mjs +156 -0
  148. package/browser/editor/page/frame.mjs +74 -0
  149. package/browser/editor/page/frames.mjs +196 -0
  150. package/browser/editor/page/geometry.mjs +402 -0
  151. package/browser/editor/page/gesture.mjs +45 -0
  152. package/browser/editor/page/handle/index.mjs +650 -0
  153. package/browser/editor/page/handle-sizes.mjs +14 -0
  154. package/browser/editor/page/hints/index.mjs +84 -0
  155. package/browser/editor/page/history.mjs +401 -0
  156. package/browser/editor/page/insert/index.mjs +256 -0
  157. package/browser/editor/page/kept.mjs +38 -0
  158. package/browser/editor/page/links/address.mjs +40 -0
  159. package/browser/editor/page/links/index.mjs +866 -0
  160. package/browser/editor/page/links/pages.mjs +131 -0
  161. package/browser/editor/page/links/views.mjs +369 -0
  162. package/browser/editor/page/long-runs.mjs +75 -0
  163. package/browser/editor/page/look.mjs +77 -0
  164. package/browser/editor/page/made.mjs +24 -0
  165. package/browser/editor/page/margin.mjs +373 -0
  166. package/browser/editor/page/markdown/index.mjs +88 -0
  167. package/browser/editor/page/markdown/rules.mjs +33 -0
  168. package/browser/editor/page/marks.mjs +377 -0
  169. package/browser/editor/page/media-menu/index.mjs +158 -0
  170. package/browser/editor/page/menu.mjs +544 -0
  171. package/browser/editor/page/merge.mjs +124 -0
  172. package/browser/editor/page/notices.mjs +142 -0
  173. package/browser/editor/page/offered.mjs +32 -0
  174. package/browser/editor/page/outline/folds.mjs +53 -0
  175. package/browser/editor/page/outline/index.mjs +783 -0
  176. package/browser/editor/page/outline/list.mjs +184 -0
  177. package/browser/editor/page/outline/read.mjs +201 -0
  178. package/browser/editor/page/outline/strip.mjs +287 -0
  179. package/browser/editor/page/outline/tree.mjs +248 -0
  180. package/browser/editor/page/overlay-layer.mjs +227 -0
  181. package/browser/editor/page/overlays.mjs +205 -0
  182. package/browser/editor/page/own.mjs +28 -0
  183. package/browser/editor/page/pads.mjs +71 -0
  184. package/browser/editor/page/page-objects.mjs +105 -0
  185. package/browser/editor/page/panel.mjs +65 -0
  186. package/browser/editor/page/placement.mjs +58 -0
  187. package/browser/editor/page/post.mjs +41 -0
  188. package/browser/editor/page/present-links.mjs +50 -0
  189. package/browser/editor/page/quiet.mjs +48 -0
  190. package/browser/editor/page/resize/index.mjs +327 -0
  191. package/browser/editor/page/select-all/index.mjs +262 -0
  192. package/browser/editor/page/selection/delete.mjs +61 -0
  193. package/browser/editor/page/selection/index.mjs +164 -0
  194. package/browser/editor/page/selection/marquee.mjs +174 -0
  195. package/browser/editor/page/session.mjs +168 -0
  196. package/browser/editor/page/slash-menu/index.mjs +291 -0
  197. package/browser/editor/page/storage.mjs +48 -0
  198. package/browser/editor/page/sync-state.mjs +267 -0
  199. package/browser/editor/page/table/aligns.mjs +29 -0
  200. package/browser/editor/page/table/cell-bar.mjs +141 -0
  201. package/browser/editor/page/table/cells.mjs +527 -0
  202. package/browser/editor/page/table/icons.mjs +40 -0
  203. package/browser/editor/page/table/index.mjs +990 -0
  204. package/browser/editor/page/table/lists.mjs +187 -0
  205. package/browser/editor/page/table/widths.mjs +313 -0
  206. package/browser/editor/page/tex.mjs +32 -0
  207. package/browser/editor/page/text-select/index.mjs +671 -0
  208. package/browser/editor/page/tooltip.mjs +98 -0
  209. package/browser/editor/page/type-grid.mjs +83 -0
  210. package/browser/editor/page/typing/code-edges.mjs +274 -0
  211. package/browser/editor/page/typing/index.mjs +282 -0
  212. package/browser/editor/page/typing/leave.mjs +68 -0
  213. package/browser/editor/page/ui.mjs +160 -0
  214. package/browser/shared/annotations.mjs +569 -0
  215. package/browser/shared/code-folds.mjs +14 -0
  216. package/browser/shared/code-languages.mjs +70 -0
  217. package/browser/shared/code-lines.mjs +30 -0
  218. package/browser/shared/colors.mjs +30 -0
  219. package/browser/shared/component-catalog.mjs +573 -0
  220. package/browser/shared/components/bookmark.mjs +26 -0
  221. package/browser/shared/components/callout.mjs +9 -0
  222. package/browser/shared/components/chart.mjs +20 -0
  223. package/browser/shared/components/code.mjs +37 -0
  224. package/browser/shared/components/columns.mjs +16 -0
  225. package/browser/shared/components/details.mjs +15 -0
  226. package/browser/shared/components/dialog.mjs +28 -0
  227. package/browser/shared/components/diff.mjs +18 -0
  228. package/browser/shared/components/divider.mjs +6 -0
  229. package/browser/shared/components/embed.mjs +25 -0
  230. package/browser/shared/components/figure.mjs +14 -0
  231. package/browser/shared/components/file.mjs +23 -0
  232. package/browser/shared/components/heading.mjs +6 -0
  233. package/browser/shared/components/highlight.mjs +9 -0
  234. package/browser/shared/components/icon.mjs +18 -0
  235. package/browser/shared/components/image.mjs +39 -0
  236. package/browser/shared/components/index.mjs +396 -0
  237. package/browser/shared/components/installed.mjs +232 -0
  238. package/browser/shared/components/list.mjs +146 -0
  239. package/browser/shared/components/math.mjs +49 -0
  240. package/browser/shared/components/mention.mjs +33 -0
  241. package/browser/shared/components/page.mjs +46 -0
  242. package/browser/shared/components/paragraph.mjs +9 -0
  243. package/browser/shared/components/quote.mjs +6 -0
  244. package/browser/shared/components/section.mjs +8 -0
  245. package/browser/shared/components/sheets.mjs +80 -0
  246. package/browser/shared/components/state.mjs +20 -0
  247. package/browser/shared/components/table.mjs +49 -0
  248. package/browser/shared/components/text.mjs +14 -0
  249. package/browser/shared/components/widget.mjs +10 -0
  250. package/browser/shared/copy-ids.mjs +72 -0
  251. package/browser/shared/css-references.mjs +110 -0
  252. package/browser/shared/document-look.mjs +178 -0
  253. package/browser/shared/emoji/custom.mjs +91 -0
  254. package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
  255. package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
  256. package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
  257. package/browser/shared/emoji/data/README.md +28 -0
  258. package/browser/shared/emoji/data/categories.json +1 -0
  259. package/browser/shared/emoji/data/icons.json +1 -0
  260. package/browser/shared/emoji/data/keywords-en.json +1 -0
  261. package/browser/shared/emoji/data/keywords-zh.json +1 -0
  262. package/browser/shared/emoji/data/names.json +1 -0
  263. package/browser/shared/emoji/data/positions.json +1 -0
  264. package/browser/shared/emoji/data/twemoji-index.json +1 -0
  265. package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
  266. package/browser/shared/emoji/data.mjs +194 -0
  267. package/browser/shared/emoji/emoji.mjs +38 -0
  268. package/browser/shared/emoji/glyphs.mjs +134 -0
  269. package/browser/shared/emoji/icon-value.mjs +91 -0
  270. package/browser/shared/escape.mjs +20 -0
  271. package/browser/shared/export-wrap.mjs +89 -0
  272. package/browser/shared/files.mjs +33 -0
  273. package/browser/shared/html-tree.mjs +59 -0
  274. package/browser/shared/http.mjs +22 -0
  275. package/browser/shared/i18n/en.mjs +1223 -0
  276. package/browser/shared/i18n/index.mjs +132 -0
  277. package/browser/shared/ids.mjs +24 -0
  278. package/browser/shared/import-types.mjs +23 -0
  279. package/browser/shared/inline-spacing.mjs +97 -0
  280. package/browser/shared/layers.mjs +42 -0
  281. package/browser/shared/long-runs.mjs +39 -0
  282. package/browser/shared/media.mjs +162 -0
  283. package/browser/shared/new-names.mjs +67 -0
  284. package/browser/shared/number-reading.mjs +92 -0
  285. package/browser/shared/old-names.mjs +143 -0
  286. package/browser/shared/outline.mjs +194 -0
  287. package/browser/shared/page-address.mjs +140 -0
  288. package/browser/shared/page-links.mjs +86 -0
  289. package/browser/shared/paths.mjs +73 -0
  290. package/browser/shared/preferences.mjs +116 -0
  291. package/browser/shared/preview-server.mjs +247 -0
  292. package/browser/shared/qa-levels.mjs +93 -0
  293. package/browser/shared/reading-place.mjs +91 -0
  294. package/browser/shared/renamed-storage.mjs +220 -0
  295. package/browser/shared/reports.mjs +46 -0
  296. package/browser/shared/search.mjs +85 -0
  297. package/browser/shared/session.mjs +77 -0
  298. package/browser/shared/table-chart.mjs +113 -0
  299. package/browser/shared/table-hides.mjs +120 -0
  300. package/browser/shared/table-slots.mjs +75 -0
  301. package/browser/shared/words.mjs +23 -0
  302. package/browser/shared/workspace-look.mjs +91 -0
  303. package/browser/shared/workspace.mjs +535 -0
  304. package/browser/shared/writing-preferences.mjs +68 -0
  305. package/browser/shared/zoom.mjs +57 -0
  306. package/dist/chunk-2B5E4CDJ.mjs +2 -0
  307. package/dist/chunk-342HXE3Q.mjs +2 -0
  308. package/dist/chunk-3HIRPVLU.mjs +2 -0
  309. package/dist/chunk-43B75J5T.mjs +2 -0
  310. package/dist/chunk-4FS7Z7WR.mjs +2 -0
  311. package/dist/chunk-4K5KC6V2.mjs +2 -0
  312. package/dist/chunk-5L7RYZCL.mjs +2 -0
  313. package/dist/chunk-5MHMDLZD.mjs +4 -0
  314. package/dist/chunk-5ZKJ3H4P.mjs +8 -0
  315. package/dist/chunk-64K7IPLO.mjs +255 -0
  316. package/dist/chunk-6QXGZM36.mjs +8 -0
  317. package/dist/chunk-6RGJOMJP.mjs +16 -0
  318. package/dist/chunk-742D2WWJ.mjs +19 -0
  319. package/dist/chunk-7DTINW6U.mjs +48 -0
  320. package/dist/chunk-A55HN5OK.mjs +2 -0
  321. package/dist/chunk-AGDILNWB.mjs +2 -0
  322. package/dist/chunk-AJ73XJF3.mjs +2 -0
  323. package/dist/chunk-AUZGSZJH.mjs +13 -0
  324. package/dist/chunk-BFE45AKL.mjs +2 -0
  325. package/dist/chunk-BGGDRNYQ.mjs +10 -0
  326. package/dist/chunk-BXO2ZY5P.mjs +2 -0
  327. package/dist/chunk-C564NU2H.mjs +77 -0
  328. package/dist/chunk-CEH4MRCC.mjs +2 -0
  329. package/dist/chunk-CY2FNNAB.mjs +16 -0
  330. package/dist/chunk-DFUDV4LX.mjs +2 -0
  331. package/dist/chunk-DKXG4XDG.mjs +2 -0
  332. package/dist/chunk-E7LWZRXY.mjs +4 -0
  333. package/dist/chunk-EZQ34M3F.mjs +124 -0
  334. package/dist/chunk-EZY3WC6Z.mjs +15 -0
  335. package/dist/chunk-FDLXYYG4.mjs +4 -0
  336. package/dist/chunk-FUKQNOQS.mjs +9 -0
  337. package/dist/chunk-GB5SOYQJ.mjs +7 -0
  338. package/dist/chunk-GRAXKKG4.mjs +2 -0
  339. package/dist/chunk-HYMEEXKN.mjs +4 -0
  340. package/dist/chunk-IVDLMMBD.mjs +2 -0
  341. package/dist/chunk-JPOSLGOC.mjs +6 -0
  342. package/dist/chunk-JVHHHGEA.mjs +3 -0
  343. package/dist/chunk-L3QKH4OK.mjs +26 -0
  344. package/dist/chunk-LAE5NQ4B.mjs +2 -0
  345. package/dist/chunk-LCTHTZIL.mjs +960 -0
  346. package/dist/chunk-LEF6DRCK.mjs +59 -0
  347. package/dist/chunk-LKX55H76.mjs +2 -0
  348. package/dist/chunk-LS4F7JUM.mjs +2 -0
  349. package/dist/chunk-MAFIGVXY.mjs +2 -0
  350. package/dist/chunk-NO5NJCHO.mjs +2 -0
  351. package/dist/chunk-NQPVAU63.mjs +2 -0
  352. package/dist/chunk-NSKUTQ5J.mjs +5 -0
  353. package/dist/chunk-O35FIXRB.mjs +2 -0
  354. package/dist/chunk-P2CAZPDP.mjs +3 -0
  355. package/dist/chunk-PL6GHLGD.mjs +15 -0
  356. package/dist/chunk-QAIHRH3I.mjs +13 -0
  357. package/dist/chunk-QJIR2BLP.mjs +6 -0
  358. package/dist/chunk-QR6A54KJ.mjs +3 -0
  359. package/dist/chunk-QUPLVPB2.mjs +7 -0
  360. package/dist/chunk-R7BNENLY.mjs +4 -0
  361. package/dist/chunk-S6O4UHLC.mjs +2 -0
  362. package/dist/chunk-SGJWQKEI.mjs +2 -0
  363. package/dist/chunk-SYGN7GLU.mjs +2 -0
  364. package/dist/chunk-TMYZB6AV.mjs +2 -0
  365. package/dist/chunk-TX6JH7TR.mjs +2 -0
  366. package/dist/chunk-TYK6VNAB.mjs +10 -0
  367. package/dist/chunk-U3SSPL4K.mjs +8 -0
  368. package/dist/chunk-U6KNPJPR.mjs +2 -0
  369. package/dist/chunk-UALRNVSE.mjs +4 -0
  370. package/dist/chunk-UH4SIXTR.mjs +2 -0
  371. package/dist/chunk-UMHUSOPJ.mjs +2 -0
  372. package/dist/chunk-V3HXVQEM.mjs +2 -0
  373. package/dist/chunk-V5JTW2LH.mjs +27 -0
  374. package/dist/chunk-V5VXUJKG.mjs +2 -0
  375. package/dist/chunk-V6XZ4VIR.mjs +2 -0
  376. package/dist/chunk-VBXMADMP.mjs +2 -0
  377. package/dist/chunk-VNV55RUA.mjs +2 -0
  378. package/dist/chunk-VPD2PS35.mjs +2 -0
  379. package/dist/chunk-W3BGBJQW.mjs +2 -0
  380. package/dist/chunk-W4VKN3GF.mjs +7 -0
  381. package/dist/chunk-W5BXXPDJ.mjs +3 -0
  382. package/dist/chunk-W7XHE4CT.mjs +2 -0
  383. package/dist/chunk-XNROSH2T.mjs +4 -0
  384. package/dist/chunk-XUNHRCOG.mjs +6 -0
  385. package/dist/chunk-Y34NR5JL.mjs +2 -0
  386. package/dist/chunk-Y6RLRPG3.mjs +3 -0
  387. package/dist/chunk-YEY3RSFQ.mjs +2 -0
  388. package/dist/cli.mjs +2 -0
  389. package/dist/server.mjs +2 -0
  390. package/dist/worker.mjs +5 -0
  391. package/kit/charts.js +355 -0
  392. package/kit/code.js +164 -0
  393. package/kit/dialogs.js +157 -0
  394. package/kit/math.js +2004 -0
  395. package/kit/report.css +2932 -0
  396. package/kit/runtime.js +1782 -0
  397. package/kit/sheets.js +123 -0
  398. package/kit/state.js +217 -0
  399. package/kit/tables.js +1499 -0
  400. package/kit/tokens.js +29 -0
  401. package/kit/ui.js +658 -0
  402. package/package.json +41 -4
  403. package/release.json +25 -0
  404. package/sdk/column-widths.d.ts +56 -0
  405. package/sdk/doc-charts.d.ts +82 -0
  406. package/sdk/doc-code.d.ts +28 -0
  407. package/sdk/doc-dialogs.d.ts +4 -0
  408. package/sdk/doc-kit.d.ts +147 -0
  409. package/sdk/doc-math.d.ts +3 -0
  410. package/sdk/doc-sheets.d.ts +15 -0
  411. package/sdk/doc-state.d.ts +41 -0
  412. package/sdk/doc-tables.d.ts +24 -0
  413. package/sdk/doc-tokens.d.ts +22 -0
  414. package/sdk/index.d.ts +30 -0
  415. package/skill/SKILL.md +150 -0
  416. package/skill/agents/openai.yaml +5 -0
  417. package/skill/references/building-components.md +367 -0
  418. package/skill/references/example-report.html +356 -0
  419. package/skill/references/writing-html.md +187 -0
  420. package/skill/sdk/column-widths.d.ts +56 -0
  421. package/skill/sdk/doc-charts.d.ts +82 -0
  422. package/skill/sdk/doc-code.d.ts +28 -0
  423. package/skill/sdk/doc-dialogs.d.ts +4 -0
  424. package/skill/sdk/doc-kit.d.ts +147 -0
  425. package/skill/sdk/doc-math.d.ts +3 -0
  426. package/skill/sdk/doc-sheets.d.ts +15 -0
  427. package/skill/sdk/doc-state.d.ts +41 -0
  428. package/skill/sdk/doc-tables.d.ts +24 -0
  429. package/skill/sdk/doc-tokens.d.ts +22 -0
  430. package/skill/sdk/index.d.ts +30 -0
  431. package/starter/doc.html +21 -0
  432. package/starter/doc.json +5 -0
  433. package/vendor/d3.v7.9.0.min.js +2 -0
  434. package/vendor/katex/auto-render.min.js +1 -0
  435. package/vendor/katex/contrib/mhchem.min.js +1 -0
  436. package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  437. package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  438. package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  439. package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  440. package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  441. package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  442. package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  443. package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  444. package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  445. package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  446. package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  447. package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  448. package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  449. package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  450. package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  451. package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  452. package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  453. package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  454. package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  455. package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  456. package/vendor/katex/katex.min.css +1 -0
  457. package/vendor/katex/katex.min.js +1 -0
  458. package/vendor/pdfjs/LICENSE +177 -0
  459. package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  460. package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  461. package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  462. package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  463. package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  464. package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  465. package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  466. package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  467. package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  468. package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  469. package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  470. package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  471. package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  472. package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  473. package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  474. package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  475. package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  476. package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  477. package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  478. package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  479. package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  480. package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  481. package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  482. package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  483. package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  484. package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  485. package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  486. package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  487. package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  488. package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  489. package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  490. package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  491. package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  492. package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  493. package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  494. package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  495. package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  496. package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  497. package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  498. package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  499. package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  500. package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  501. package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  502. package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  503. package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  504. package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  505. package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  506. package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  507. package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  508. package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  509. package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  510. package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  511. package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  512. package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  513. package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  514. package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  515. package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  516. package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  517. package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  518. package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  519. package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  520. package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  521. package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  522. package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  523. package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  524. package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  525. package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  526. package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  527. package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  528. package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  529. package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  530. package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  531. package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  532. package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  533. package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  534. package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  535. package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  536. package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  537. package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  538. package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  539. package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  540. package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  541. package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  542. package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  543. package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  544. package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  545. package/vendor/pdfjs/cmaps/H.bcmap +0 -0
  546. package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  547. package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  548. package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  549. package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  550. package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  551. package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  552. package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  553. package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  554. package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  555. package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  556. package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  557. package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  558. package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  559. package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  560. package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  561. package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  562. package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  563. package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  564. package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  565. package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  566. package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  567. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  568. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  569. package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  570. package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  571. package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  572. package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  573. package/vendor/pdfjs/cmaps/LICENSE +36 -0
  574. package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  575. package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  576. package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  577. package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  578. package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  579. package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  580. package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  581. package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  582. package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  583. package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  584. package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  585. package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  586. package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  587. package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  588. package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  589. package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  590. package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  591. package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  592. package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  593. package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  594. package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  595. package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  596. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  597. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  598. package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  599. package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  600. package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  601. package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  602. package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  603. package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  604. package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  605. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  606. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  607. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  608. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  609. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  610. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  611. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  612. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  613. package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  614. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  615. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  616. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  617. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  618. package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  619. package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  620. package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  621. package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  622. package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  623. package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  624. package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  625. package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  626. package/vendor/pdfjs/cmaps/V.bcmap +0 -0
  627. package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  628. package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
  629. package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
  630. package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  631. package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  632. package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  633. package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  634. package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  635. package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  636. package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  637. package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  638. package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  639. package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  640. package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  641. package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  642. package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  643. package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  644. package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  645. package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  646. package/vendor/types/@types/d3/LICENSE +21 -0
  647. package/vendor/types/@types/d3/index.d.ts +39 -0
  648. package/vendor/types/@types/d3/package.json +81 -0
  649. package/vendor/types/@types/d3-array/LICENSE +21 -0
  650. package/vendor/types/@types/d3-array/index.d.ts +1118 -0
  651. package/vendor/types/@types/d3-array/package.json +56 -0
  652. package/vendor/types/@types/d3-axis/LICENSE +21 -0
  653. package/vendor/types/@types/d3-axis/index.d.ts +293 -0
  654. package/vendor/types/@types/d3-axis/package.json +47 -0
  655. package/vendor/types/@types/d3-brush/LICENSE +21 -0
  656. package/vendor/types/@types/d3-brush/index.d.ts +255 -0
  657. package/vendor/types/@types/d3-brush/package.json +42 -0
  658. package/vendor/types/@types/d3-chord/LICENSE +21 -0
  659. package/vendor/types/@types/d3-chord/index.d.ts +471 -0
  660. package/vendor/types/@types/d3-chord/package.json +40 -0
  661. package/vendor/types/@types/d3-color/LICENSE +21 -0
  662. package/vendor/types/@types/d3-color/index.d.ts +669 -0
  663. package/vendor/types/@types/d3-color/package.json +55 -0
  664. package/vendor/types/@types/d3-contour/LICENSE +21 -0
  665. package/vendor/types/@types/d3-contour/index.d.ts +222 -0
  666. package/vendor/types/@types/d3-contour/package.json +38 -0
  667. package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
  668. package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
  669. package/vendor/types/@types/d3-delaunay/package.json +30 -0
  670. package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
  671. package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
  672. package/vendor/types/@types/d3-dispatch/package.json +51 -0
  673. package/vendor/types/@types/d3-drag/LICENSE +21 -0
  674. package/vendor/types/@types/d3-drag/index.d.ts +395 -0
  675. package/vendor/types/@types/d3-drag/package.json +42 -0
  676. package/vendor/types/@types/d3-dsv/LICENSE +21 -0
  677. package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
  678. package/vendor/types/@types/d3-dsv/package.json +45 -0
  679. package/vendor/types/@types/d3-ease/LICENSE +21 -0
  680. package/vendor/types/@types/d3-ease/index.d.ts +316 -0
  681. package/vendor/types/@types/d3-ease/package.json +40 -0
  682. package/vendor/types/@types/d3-fetch/LICENSE +21 -0
  683. package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
  684. package/vendor/types/@types/d3-fetch/package.json +37 -0
  685. package/vendor/types/@types/d3-force/LICENSE +21 -0
  686. package/vendor/types/@types/d3-force/index.d.ts +899 -0
  687. package/vendor/types/@types/d3-force/package.json +45 -0
  688. package/vendor/types/@types/d3-format/LICENSE +21 -0
  689. package/vendor/types/@types/d3-format/index.d.ts +337 -0
  690. package/vendor/types/@types/d3-format/package.json +45 -0
  691. package/vendor/types/@types/d3-geo/LICENSE +21 -0
  692. package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
  693. package/vendor/types/@types/d3-geo/package.json +48 -0
  694. package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
  695. package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
  696. package/vendor/types/@types/d3-hierarchy/package.json +50 -0
  697. package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
  698. package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
  699. package/vendor/types/@types/d3-interpolate/package.json +47 -0
  700. package/vendor/types/@types/d3-path/LICENSE +21 -0
  701. package/vendor/types/@types/d3-path/index.d.ts +108 -0
  702. package/vendor/types/@types/d3-path/package.json +41 -0
  703. package/vendor/types/@types/d3-polygon/LICENSE +21 -0
  704. package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
  705. package/vendor/types/@types/d3-polygon/package.json +40 -0
  706. package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
  707. package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
  708. package/vendor/types/@types/d3-quadtree/package.json +45 -0
  709. package/vendor/types/@types/d3-random/LICENSE +21 -0
  710. package/vendor/types/@types/d3-random/index.d.ts +313 -0
  711. package/vendor/types/@types/d3-random/package.json +41 -0
  712. package/vendor/types/@types/d3-scale/LICENSE +21 -0
  713. package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
  714. package/vendor/types/@types/d3-scale/package.json +53 -0
  715. package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
  716. package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
  717. package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
  718. package/vendor/types/@types/d3-selection/LICENSE +21 -0
  719. package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
  720. package/vendor/types/@types/d3-selection/package.json +56 -0
  721. package/vendor/types/@types/d3-shape/LICENSE +21 -0
  722. package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
  723. package/vendor/types/@types/d3-shape/package.json +53 -0
  724. package/vendor/types/@types/d3-time/LICENSE +21 -0
  725. package/vendor/types/@types/d3-time/index.d.ts +697 -0
  726. package/vendor/types/@types/d3-time/package.json +46 -0
  727. package/vendor/types/@types/d3-time-format/LICENSE +21 -0
  728. package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
  729. package/vendor/types/@types/d3-time-format/package.json +40 -0
  730. package/vendor/types/@types/d3-timer/LICENSE +21 -0
  731. package/vendor/types/@types/d3-timer/index.d.ts +68 -0
  732. package/vendor/types/@types/d3-timer/package.json +45 -0
  733. package/vendor/types/@types/d3-transition/LICENSE +21 -0
  734. package/vendor/types/@types/d3-transition/index.d.ts +664 -0
  735. package/vendor/types/@types/d3-transition/package.json +47 -0
  736. package/vendor/types/@types/d3-zoom/LICENSE +21 -0
  737. package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
  738. package/vendor/types/@types/d3-zoom/package.json +48 -0
  739. package/vendor/types/@types/geojson/LICENSE +21 -0
  740. package/vendor/types/@types/geojson/index.d.ts +202 -0
  741. package/vendor/types/@types/geojson/package.json +46 -0
  742. package/vendor/typescript/LICENSE.txt +55 -0
  743. package/vendor/typescript/lib.decorators.d.ts +384 -0
  744. package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
  745. package/vendor/typescript/lib.dom.d.ts +39429 -0
  746. package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
  747. package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
  748. package/vendor/typescript/lib.es2015.core.d.ts +597 -0
  749. package/vendor/typescript/lib.es2015.d.ts +28 -0
  750. package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
  751. package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
  752. package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
  753. package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
  754. package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
  755. package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
  756. package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
  757. package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
  758. package/vendor/typescript/lib.es2016.d.ts +21 -0
  759. package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
  760. package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
  761. package/vendor/typescript/lib.es2017.d.ts +26 -0
  762. package/vendor/typescript/lib.es2017.date.d.ts +31 -0
  763. package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
  764. package/vendor/typescript/lib.es2017.object.d.ts +49 -0
  765. package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
  766. package/vendor/typescript/lib.es2017.string.d.ts +45 -0
  767. package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
  768. package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
  769. package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
  770. package/vendor/typescript/lib.es2018.d.ts +24 -0
  771. package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
  772. package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
  773. package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
  774. package/vendor/typescript/lib.es2019.array.d.ts +79 -0
  775. package/vendor/typescript/lib.es2019.d.ts +24 -0
  776. package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
  777. package/vendor/typescript/lib.es2019.object.d.ts +33 -0
  778. package/vendor/typescript/lib.es2019.string.d.ts +37 -0
  779. package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
  780. package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
  781. package/vendor/typescript/lib.es2020.d.ts +27 -0
  782. package/vendor/typescript/lib.es2020.date.d.ts +42 -0
  783. package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
  784. package/vendor/typescript/lib.es2020.number.d.ts +28 -0
  785. package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
  786. package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
  787. package/vendor/typescript/lib.es2020.string.d.ts +44 -0
  788. package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
  789. package/vendor/typescript/lib.es2021.d.ts +23 -0
  790. package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
  791. package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
  792. package/vendor/typescript/lib.es2021.string.d.ts +33 -0
  793. package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
  794. package/vendor/typescript/lib.es2022.array.d.ts +121 -0
  795. package/vendor/typescript/lib.es2022.d.ts +25 -0
  796. package/vendor/typescript/lib.es2022.error.d.ts +75 -0
  797. package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
  798. package/vendor/typescript/lib.es2022.object.d.ts +26 -0
  799. package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
  800. package/vendor/typescript/lib.es2022.string.d.ts +25 -0
  801. package/vendor/typescript/lib.es5.d.ts +4601 -0
  802. package/vendor/typescript/package.json +4 -0
  803. package/vendor/typescript/typescript.js +446 -0
  804. package/web/assets/index-Bh74DfsV.css +1 -0
  805. package/web/assets/index-UW0RyFFt.js +13 -0
  806. package/web/index.html +14 -0
@@ -0,0 +1,783 @@
1
+ import { IN_LAYER, Z } from "../../../shared/layers.mjs";
2
+ import { onOutlineOpen, onPreferences, outlineOpen, preference, setPreference } from "../../../shared/preferences.mjs";
3
+ import { t } from "../../../shared/i18n/index.mjs";
4
+ import { SHEETS } from "../../components/kit.mjs";
5
+ import { reveal } from "../folded.mjs";
6
+ import { task } from "../frames.mjs";
7
+ import { cancelOnEscape, endsGesture, gestureLock } from "../gesture.mjs";
8
+ import { MARGIN, listFits, onMargin, outlineMost, outlineWidth, setMargin } from "../margin.mjs";
9
+ import { drawOver, shapeOf } from "../overlay-layer.mjs";
10
+ import { onSettle, own } from "../overlays.mjs";
11
+ import { local } from "../storage.mjs";
12
+ import { hideTooltip, tooltipAt } from "../tooltip.mjs";
13
+ import { addStyle, element } from "../ui.mjs";
14
+ import { carryFolds, foldsOf, keepFolds } from "./folds.mjs";
15
+ import { LIST, ROW, createList } from "./list.mjs";
16
+ import { entriesOf, touchesOutline } from "./read.mjs";
17
+ import { STRIP_TOP, createStrip } from "./strip.mjs";
18
+ import { currentOf, followTop, glideFrom, keysOf, markedRow, nodesOf, pathTo, rowsOf, signatureOf, spyLine, treeOf } from "./tree.mjs";
19
+
20
+ // 目录: the page's outline at the right of the editor area (docs/editor.md, "The outline and the right side"), while the
21
+ // reader has it on for this report (the top bar's 更多 › 目录: shared/preferences.mjs outlineOpen, each
22
+ // report's own, off until switched on there; the page follows a switch at once, made in the workbench
23
+ // or in another tab of the same report). Never on a page opened on its own in a frame (?solo), in 演示视图 (no
24
+ // editor), an export or print. The editor starts it before the page's blocks are made editable
25
+ // (editor.mjs start, before enter: the headings' kinds marked from the map, core.mjs markKinds), and it
26
+ // is drawn at once, with no fade, and given a frame to show in: it comes with the page; switched on, it
27
+ // fades in; switched off, it goes at once.
28
+ //
29
+ // What it lists (read.mjs, tree.mjs): the heading blocks, nested by level, a tabs area's tabs as pills
30
+ // with their headings under them. Its form is margin.mjs's: the list in full at the window's right
31
+ // edge, the column in the middle of what it leaves (200px unless the reader dragged its guide: a quiet
32
+ // list on the page's background, a hairline guide down its left close to its top level's titles, the
33
+ // current row's segment dark on it), or, with less room, its strip (strip.mjs), which shows the list
34
+ // as a card while the pointer is on it, each of its lines lighting its own row. A form that changes after the page came is faded in (the list sliding a
35
+ // little from the right), never there all at once.
36
+ //
37
+ // - A click on a heading's row scrolls the page smoothly (at once with reduced motion; from more than
38
+ // two windows away at once to a window short of it, gliding the rest) to put the heading 24px below
39
+ // the window's top, as 演示视图's 上一节/下一节, then lights it for a moment (a quiet gray, in the
40
+ // overlay layer of its block; gone with the heading, or once it is hidden). A hidden tab is shown
41
+ // first, a closed disclosure opened (reading state: nothing is saved). The row is current at once and
42
+ // stays so until the page has moved 40px from where the jump left it. The reader taking the page over
43
+ // during the jump (the wheel, a key that scrolls, the scrollbar, a press in the page) ends it there:
44
+ // it never pulls the page back. A tab's row shows that tab and scrolls to its tab row.
45
+ // - A jump leaves the text: its selection goes (the format bar with it, which stood over the heading
46
+ // gone to). Chosen by the pointer, the page is the reader's: the focus leaves the outline (the keys
47
+ // that read scroll the page, a letter types nothing; a click in the text edits there). Chosen by a key
48
+ // (Enter, Space), the focus stays in the tree, where PageUp/PageDown scroll the page. Esc leaves the
49
+ // tree: for the caret where it was while no jump has moved the page, else for the page where it is.
50
+ // - The current heading (the spy): the one furthest down, of those with a box on the page, whose top
51
+ // has passed a line min(120px, 30% of the window) below the window's top, the first in order of those
52
+ // level with it (headings side by side in columns); none above the first. Over the page's last window
53
+ // the line comes down with the scroll to the window's bottom (tree.mjs spyLine), so the last short
54
+ // sections each get their turn. Inside a folded row, that row is marked. The list keeps the current
55
+ // row at most a third of its clear view down (the rows to come below it) and two rows from its top
56
+ // at least, scrolling (smoothly) as little as that takes; not while the pointer is over it, or the
57
+ // reader scrolled it in the last 1.5s (the pointer gone after that, a row scrolled out of sight is
58
+ // brought back). The wheel over it scrolls it, and at its ends the page.
59
+ // - A triangle at a parent's left folds or unfolds it (a folded one always shows it; an open one while
60
+ // the pointer is over the rows or the keyboard is in the list, the guide fading out meanwhile: each
61
+ // just short of its title, a top-level one on the guide, the titles never moving); what is folded is kept for the report (folds.mjs), so the page the workbench shows again after an Agent's write folds the same, and
62
+ // follows a heading whose key changes (one with no block id, keyed by its text, typed in or given its
63
+ // id as it is saved). The top level's headings are bold.
64
+ // - Its guide line, dragged, makes the list wider or narrower (160 to 360px, as far as the room lets
65
+ // it while the column keeps its edge room at both sides), the column staying in the middle of what
66
+ // it leaves (margin.mjs: its two rooms giving or taking half each); let go, the width is the
67
+ // reader's for every report (shared/preferences.mjs outlineWidth); Esc puts it back.
68
+ // - Its guide line clicked (pressed and let go before the pointer went CLICK px across, the sidebar's
69
+ // edge's rule) collapses the list to its strip, even where the room gives the list: the reader's for
70
+ // every report, as the width (outlineCollapsed, which the page's head reads too: margin.mjs). The
71
+ // guide in the strip's card clicked takes it back: the list in full where the room allows it
72
+ // (margin.mjs listFits), else the strip stays (never forced) and the list comes once there is room.
73
+ // Each guide says so in a tooltip by the pointer (a tall target), the card's why nothing opened.
74
+ // - It follows the page as it changes (one reading a frame at most, the rows drawn again only when
75
+ // what they show changed): headings typed, renamed, added, deleted, moved, undone, tabs renamed or
76
+ // shown; not while an input method composes (its letters are no title yet: read once it commits).
77
+ // It is the editor's own UI (data-doc-dev): a press on it starts no box selection, the handle
78
+ // does not show by it, and while a block is dragged or a box drawn it lets the pointer through.
79
+
80
+ const DOCK = { top: 52, left: MARGIN.guide, right: 8 }; // the list's room in the dock: below the page's top room, from 8px in (where the column's right room ends: margin.mjs; its guide LIST.guide further in), 8px short of the scrollbar
81
+ const CARD = 56; // the strip's card: as wide as the list chosen, and this much more
82
+ const CARD_PAD = 8; // and its list this far in from its left edge (as far in as the card's right padding)
83
+ const GUIDE_FADE = 120; // ms the guide fades out as the triangles show, and in as they go (at once with reduced motion: the kit's base.css)
84
+ // The pointer's rest after it left the rows (for the grip, or along the guide from one top-level triangle to another,
85
+ // across the grip between them) before the triangles go and the guide comes back (the grip's darker bar comes as late).
86
+ const LEAVE = 120;
87
+ // What shows the triangles and fades the guide: the pointer on a row (its triangle included), the keys in the list (the
88
+ // focus seen). The pointer on the list but on no row (its gutter, left of the grip) shows nothing: crossing it to the grip
89
+ // changes nothing.
90
+ const OVER = ":has(.ge-outline-row:hover), :focus-visible, :has(:focus-visible)";
91
+ const GRIPS = ".ge-outline-grip, .ge-outline-card-grip"; // the guide's grips (in the list's scroller, the card's)
92
+ const ENTER = { ms: 160, slide: 8 }; // the list in full coming after the page did: faded in, sliding this far from the right
93
+ const RESIZING = "data-ge-outline-resize"; // on the document element while the guide is dragged
94
+ const CLICK = 3; // px across the pointer goes on the guide before a press is a drag, not a click (the workbench's sidebar edge: Sidebar.tsx Resizer)
95
+ const JUMP_TOP = 24; // a heading's top after a jump, below the window's
96
+ const STAY = 40; // px the page moves after a jump before the heading gone to stops being the current one
97
+ const FOLLOW_QUIET = 1500; // ms after the reader scrolled the list, it is not scrolled to the current row
98
+ const FOLLOW_LEAST = 2 * ROW; // the current row at least two rows below the list's clear top (tree.mjs followTop)
99
+ const FADE = { top: 24, bottom: 32 }; // the list's faded ends while there is more (STYLE)
100
+ const PAGE = 0.875; // PageUp/PageDown in the tree scroll the page by this much of the window, as the browser's do
101
+ const LINE = 40; // and ↑/↓ by this much, with the focus on the page after a press in the list (as the browser does)
102
+ const FLASH = { hold: 600, fade: 600 };
103
+ const UI_FONT = `ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif`;
104
+ // The current row and the tabs' pills in a medium weight where the system's Chinese face has one
105
+ // (PingFang, on Apple's systems). Elsewhere (Microsoft YaHei has none) 500 draws a title's Latin words in
106
+ // Segoe's semibold beside regular Chinese, so they keep 400 there: the color and the guide's segment
107
+ // mark the current row, the fill the tab shown.
108
+ const MEDIUM = /Mac|iPhone|iPad/.test(globalThis.navigator?.platform ?? "") ? 500 : 400;
109
+ // The keys that scroll the page: pressed during a jump, the reader takes the page over.
110
+ const SCROLL_KEYS = new Set(["PageUp", "PageDown", "Home", "End", " ", "ArrowUp", "ArrowDown"]);
111
+
112
+ const STYLE = `
113
+ .ge-outline, .ge-outline-strip, .ge-outline-card { font: 400 14px/22px ${UI_FONT}; color: var(--ge-tx2); -webkit-user-select: none; user-select: none; }
114
+ .ge-outline svg, .ge-outline-strip svg, .ge-outline-card svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
115
+ .ge-outline[hidden], .ge-outline-strip[hidden], .ge-outline-card[hidden] { display: none; }
116
+
117
+ /* The dock: fixed at the window's right edge, its whole height, the list from the page's top room down; only the list and its guide take the pointer. */
118
+ .ge-outline { position: fixed; top: 0; right: 0; bottom: 0; z-index: ${Z.outline}; width: ${MARGIN.full}px; box-sizing: border-box; padding: ${DOCK.top}px ${DOCK.right}px 0 ${DOCK.left}px; display: flex; flex-direction: column; pointer-events: none; }
119
+ .ge-outline-frame { position: relative; flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
120
+ /* The list scrolls by itself with no scrollbar (none to move its rows as it comes and goes, none beside the page's own): its fades say there is more; the wheel and a touch move it, and at its ends go on to the page (no wheel trapped over it). */
121
+ .ge-outline-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
122
+ .ge-outline-scroll::-webkit-scrollbar { display: none; }
123
+ .ge-outline-frame > .ge-outline-scroll { padding-bottom: 24px; pointer-events: auto; }
124
+ .ge-outline-scroll[data-more="up"] { -webkit-mask-image: linear-gradient(transparent, #000 24px); mask-image: linear-gradient(transparent, #000 24px); }
125
+ .ge-outline-scroll[data-more="down"] { -webkit-mask-image: linear-gradient(#000 calc(100% - 32px), transparent); mask-image: linear-gradient(#000 calc(100% - 32px), transparent); }
126
+ .ge-outline-scroll[data-more="up down"] { -webkit-mask-image: linear-gradient(transparent, #000 24px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(transparent, #000 24px, #000 calc(100% - 32px), transparent); }
127
+ /* The guide's grip (MARGIN.grip left of its hairline, 5px right): dragged, the list wider or narrower; clicked, the list collapsed to its strip; under the pointer (a moment after it came) and while dragged, the guide a wider, darker bar. It stands in the list's scroller, placed by the frame (the card), so it lies under a top-level triangle shown (z-index): that triangle, its row's, takes its own box; the grip the rest of the guide (rows with no triangle shown, above and below one), and every one hidden (visibility: no target). */
128
+ .ge-outline-grip, .ge-outline-card-grip { position: absolute; z-index: 1; width: 9px; pointer-events: auto; }
129
+ .ge-outline-grip { left: ${LIST.guide - MARGIN.grip}px; top: 0; bottom: 24px; cursor: col-resize; }
130
+ .ge-outline-grip::after, .ge-outline-card-grip::after { content: ""; position: absolute; left: 3px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; transition: background-color 120ms ease; }
131
+ .ge-outline-grip:hover::after, .ge-outline-card-grip[data-fits]:hover::after { background: var(--ge-line-strong); transition-delay: 120ms; }
132
+ :root[${RESIZING}] .ge-outline-grip::after { background: color-mix(in srgb, var(--ge-tx3) 70%, transparent); transition-delay: 0s; }
133
+ :root[${RESIZING}] .ge-outline-scroll { pointer-events: none; }
134
+ ${gestureLock(RESIZING, { cursor: "col-resize", select: true })}
135
+
136
+ /* The list (list.mjs LIST): a hairline guide a little in from its left edge, close to the top level's titles, the current row's segment darker on it, the lit row's blue (whole pixels: crisp at any scale); the rows from right of the guide (a top-level one's fill reaching across it to take in its triangle: below). */
137
+ .ge-outline-list { position: relative; padding-left: ${LIST.row}px; outline: none; }
138
+ .ge-outline-list::before { content: ""; position: absolute; left: ${LIST.guide}px; top: 4px; bottom: 4px; width: 1px; background: var(--ge-line-strong); }
139
+ .ge-outline-list[data-empty]::before { display: none; }
140
+ .ge-outline-mark { position: absolute; left: ${LIST.guide - 1}px; top: 0; width: 2px; height: 16px; border-radius: 1px; background: var(--ge-tx); pointer-events: none; }
141
+ .ge-outline-mark[data-hot] { background: var(--ge-accent); }
142
+ .ge-outline-mark[hidden] { display: none; }
143
+ /* While the pointer is on the rows or the keys are in the list (OVER), the triangles show and the guide (its hairline, its segments) fades out at once; the rows left, it comes back a moment later (LEAVE), so the pointer going along the guide from one top-level triangle to another, across the grip, keeps them. */
144
+ .ge-outline-list::before, .ge-outline-list > .ge-outline-mark { transition: opacity ${GUIDE_FADE}ms ease ${LEAVE}ms; }
145
+ .ge-outline-list:is(${OVER})::before, .ge-outline-list:is(${OVER}) > .ge-outline-mark { opacity: 0; transition-delay: 0s; }
146
+ .ge-outline-row { position: relative; display: flex; align-items: center; height: ${ROW}px; box-sizing: border-box; padding: 0 6px 0 calc(${LIST.text}px + var(--ge-depth, 0) * ${LIST.step}px); border-radius: 6px; cursor: pointer; white-space: nowrap; outline: none; }
147
+ .ge-outline-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
148
+ /* A row's fill (under the pointer, the keys' focus, lit from the strip, pressed) takes in its triangle's column: it starts at the row's left (2px clear of the hairline) or ${LIST.step + LIST.text - LIST.twist - LIST.gap}px left of the column, whichever is further left (that room is what a second-level row's fill leaves left of its triangle). Only a top-level row's column stands left of the row (across the guide), so only its fill reaches further, a step (LIST.step) further left, past the hairline, its triangle in the grey as a deeper one is (the user's of 2026-11-07), a leaf's as its siblings'. That part is the row's shadow, no target: the pointer there is still the list's gutter or the grip. */
149
+ .ge-outline-row { --ge-row-fill: transparent; background: var(--ge-row-fill); box-shadow: min(0px, calc((var(--ge-depth, 0) - 1) * ${LIST.step}px)) 0 var(--ge-row-fill); }
150
+ .ge-outline-row:is(:hover, :focus-visible, [data-hot]) { color: var(--ge-tx); --ge-row-fill: var(--ge-hover); }
151
+ .ge-outline-row:active { --ge-row-fill: var(--ge-press); }
152
+ .ge-outline-row[data-current] { color: var(--ge-tx); font-weight: ${MEDIUM}; }
153
+ /* The top level's headings bold: at the top, or right under a tab (its pill keeps its own look). */
154
+ .ge-outline-row[data-top] { font-weight: 600; }
155
+ /* The triangle at a parent's left, out of the row's flow (its title where a leaf's is), in its indentation just short of its title, at every level the same: a top-level one on the guide, over its grip (above it: z-index). A folded one always shows (pointing right), an open one (pointing down) while the pointer is on the rows or the keys are in the list (the focus seen: a fold by the pointer leaves the focus on its row, unseen; the timing above). No grey under the pointer, only while pressed. */
156
+ .ge-outline-twist { position: absolute; z-index: 2; top: ${(ROW - 16) / 2}px; left: calc(var(--ge-depth, 0) * ${LIST.step}px + ${LIST.text - LIST.twist - LIST.gap}px); width: ${LIST.twist}px; height: 16px; border-radius: 4px; color: var(--ge-tx3); }
157
+ .ge-outline-twist svg { width: 16px; margin-left: ${(LIST.twist - 16) / 2}px; fill: currentColor; transition: transform 120ms ease; }
158
+ .ge-outline-twist:hover { color: var(--ge-tx2); }
159
+ .ge-outline-twist:active { background: var(--ge-press); }
160
+ .ge-outline-row[aria-expanded="true"] .ge-outline-twist svg { transform: rotate(90deg); }
161
+ .ge-outline-row[aria-expanded="true"] .ge-outline-twist { visibility: hidden; transition: visibility 0s linear ${LEAVE}ms; }
162
+ .ge-outline-list:is(${OVER}) .ge-outline-row[aria-expanded="true"] .ge-outline-twist { visibility: visible; transition-delay: 0s; }
163
+ /* A tabs area's tab: its name as a pill at the rows' size (its text in line with the rows beside it), the tab shown filled as the page's pills, the others ringed by a hairline (plain, they read as less than their own headings). */
164
+ .ge-outline-row[data-kind="tab"] .ge-outline-text { margin-left: -4px; }
165
+ .ge-outline-tab { display: inline-block; max-width: 100%; box-sizing: border-box; height: 22px; padding: 0 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; font-weight: ${MEDIUM}; line-height: 22px; box-shadow: inset 0 0 0 1px var(--ge-line-strong); }
166
+ .ge-outline-row[data-shown] .ge-outline-tab { background: var(--ge-hover); color: var(--ge-tx); box-shadow: none; }
167
+ .ge-outline-row[data-shown]:is(:hover, :focus-visible, [data-hot]) .ge-outline-tab { background: transparent; }
168
+ .ge-outline-empty { padding: 4px 0 4px ${LIST.text}px; color: var(--ge-tx3); white-space: normal; }
169
+
170
+ /* The strip: short lines, each its own target: the one under the pointer blue, longer and thicker. */
171
+ .ge-outline-strip { position: fixed; top: 0; right: 0; bottom: 0; z-index: ${Z.outline}; width: ${MARGIN.strip}px; pointer-events: none; }
172
+ .ge-outline-ticks { position: absolute; top: ${STRIP_TOP}px; right: 4px; width: 28px; box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-end; gap: var(--ge-tick-gap, 6px); padding: 8px 6px; border-radius: 6px; cursor: pointer; pointer-events: auto; outline: none; }
173
+ .ge-outline-ticks:focus-visible { background: var(--ge-hover); }
174
+ .ge-outline-ticks i { display: block; flex: none; width: var(--ge-tick, 16px); height: 2px; border-radius: 1px; background: var(--ge-line-strong); transform-origin: right center; transition: width 120ms ease-out, transform 120ms ease-out, background-color 120ms ease-out; }
175
+ .ge-outline-ticks:is(:hover, :focus-visible, [aria-expanded="true"]) i { background: color-mix(in srgb, var(--ge-tx3) 75%, transparent); }
176
+ .ge-outline-ticks i[data-current] { background: var(--ge-tx); }
177
+ .ge-outline-ticks i[data-hot] { width: calc(var(--ge-tick, 16px) + 6px); background: var(--ge-accent); transform: scaleY(1.5); }
178
+ .ge-outline-none { display: block; width: 16px; height: 16px; color: var(--ge-tx3); }
179
+ /* Its card: the list over the page beside the strip, its top level with the strip's lines, the menus' surface; the list scrolls inside it, faded at its ends as in full. */
180
+ .ge-outline-card { position: fixed; z-index: ${Z.menu}; top: ${STRIP_TOP}px; right: ${MARGIN.strip + 4}px; width: ${MARGIN.full + CARD}px; max-height: calc(100vh - ${STRIP_TOP + 16}px); box-sizing: border-box; display: flex; flex-direction: column; padding: 8px 8px 8px ${CARD_PAD}px; border-radius: 10px; background: var(--ge-bg); box-shadow: var(--ge-shadow-pop); }
181
+ /* Its guide's grip (about the hairline, CARD_PAD + LIST.guide in; in the card's scroller as the dock's is in its own, under a top-level triangle shown): clicked, the list in full again; a hand and the darker bar only where the room allows it (data-fits). */
182
+ .ge-outline-card-grip { left: ${CARD_PAD + LIST.guide - MARGIN.grip}px; top: 8px; bottom: 8px; }
183
+ .ge-outline-card-grip[data-fits] { cursor: pointer; }
184
+
185
+ /* While a block is dragged, a box drawn, text selected across blocks or something resized, the outline lets the pointer through. */
186
+ :root:is([data-ge-drag], [data-ge-marquee], [data-ge-cross], [data-ge-resize], [data-ge-gap-drag], [data-ge-tdrag], [data-ge-tresize], [data-ge-tcells]) :is(.ge-outline-scroll, .ge-outline-ticks, .ge-outline-grip, .ge-outline-card-grip) { pointer-events: none; }
187
+
188
+ /* A heading lit for a moment after a jump: its fill's shape, a quiet gray. */
189
+ .ge-outline-flash { z-index: ${IN_LAYER.tint}; pointer-events: none; background: var(--ge-outline-flash); }
190
+
191
+ @media print { .ge-outline, .ge-outline-strip, .ge-outline-card { display: none; } }
192
+ `;
193
+
194
+ const still = () => globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
195
+ const editableAt = (node) => (node?.nodeType === 1 && node.closest?.('[contenteditable="true"]')) || null;
196
+ const shown = (node) => Boolean(node?.isConnected && node.getClientRects().length > 0);
197
+
198
+ let made = null; // the page's outline: one
199
+
200
+ /** slug: the report's (what is folded is kept under it). Returns { holds(target): a node of the outline, shown: whether it shows (in full or as its strip) }. */
201
+ export function createOutline({ slug }) {
202
+ if (made) return made;
203
+ const main = document.querySelector("main");
204
+ if (!main) return { holds: () => false, shown: false };
205
+ addStyle(STYLE);
206
+
207
+ let on = outlineOpen(slug); // this report's switch (off until switched on here)
208
+ let chosen = preference("outlineWidth"); // the list's width in full as the reader dragged it (0: the default)
209
+ let collapsed = preference("outlineCollapsed"); // the reader collapsed the list to its strip (a click on its guide)
210
+ let form = null; // the form shown: "full", "strip" or null
211
+ let tree = [];
212
+ let rows = [];
213
+ let heads = []; // the heading nodes in the outline's order
214
+ let drawnSignature = null; // what the rows drawn show (tree.mjs signatureOf), and with which folds
215
+ let dirty = true; // the page changed: read it again
216
+ const folded = foldsOf(local, slug);
217
+ const keyOfRef = new WeakMap(); // a node's element -> its key read last (a fold follows a key that changes)
218
+ let chosenKey = null; // the heading a click went to: current until the page moves STAY from where it landed
219
+ let jumping = false; // a jump's scroll under way (from the click until it lands)
220
+ let jumps = 0; // jumps begun (a frame's start of one taken over meanwhile, or followed by another, does nothing)
221
+ let landedAt = null; // the page's scrollY where the jump landed
222
+ let settling = null; // the jump's scroll waiting for its end: (arrived) => void ends it
223
+ let markedKey = null; // the node marked last (to keep it in view only when it changes)
224
+ let pointerIn = false;
225
+ let listScrolled = 0; // when the reader last scrolled the list
226
+ let returnTo = null; // { host, range }: where the caret was when the outline took the focus
227
+ let composing = false; // an input method composing: its letters are no title yet
228
+ let flashing = null; // { node, heading }: the heading lit after a jump
229
+
230
+ const list = createList({ jump: go, fold: toggle, escape: giveBack, page: (direction) => page(direction) });
231
+ // The grip in the scroller, before the list, placed by the frame (it neither scrolls nor counts in what
232
+ // scrolls): in one stacking context with the rows' triangles (the scroller's, masked at its ends), so a
233
+ // top-level one shown stands over it (STYLE).
234
+ const grip = element("div", { class: "ge-outline-grip", role: "separator", "aria-orientation": "vertical", "aria-label": t("拖动调整目录宽度") });
235
+ const scroller = element("div", { class: "ge-outline-scroll" }, grip, list.node);
236
+ const dock = element("nav", { class: "ge-outline", "aria-label": t("目录"), "data-doc-dev": "", hidden: "" }, element("div", { class: "ge-outline-frame" }, scroller));
237
+ const strip = createStrip({
238
+ list,
239
+ opened: () => frames.wake(),
240
+ closed: () => frames.wake(),
241
+ escape: () => giveBack(),
242
+ choose: (index) => { if (rows[index]) go(rows[index].node); },
243
+ });
244
+ document.body.append(dock, strip.strip, strip.card);
245
+
246
+ // ---------- reading the page ----------
247
+
248
+ function read() {
249
+ tree = treeOf(entriesOf(main));
250
+ const nodes = nodesOf(tree);
251
+ const moves = [];
252
+ for (const node of nodes) {
253
+ if (!node.ref) continue;
254
+ const before = keyOfRef.get(node.ref);
255
+ if (before !== undefined && before !== node.key) moves.push([before, node.key]);
256
+ keyOfRef.set(node.ref, node.key);
257
+ }
258
+ if (carryFolds(folded, moves)) keepFolds(local, slug, folded, keysOf(tree));
259
+ heads = nodes.filter((node) => node.kind === "heading");
260
+ rows = rowsOf(tree, folded);
261
+ }
262
+
263
+ // The heading the reader is at (tree.mjs currentOf), of those with a box on the page; the line it
264
+ // must pass comes down over the page's last window (spyLine: the last short sections each get their turn).
265
+ function spied() {
266
+ const tops = heads.map((node) => (node.ref?.isConnected ? node.ref.getClientRects()[0]?.top ?? null : null));
267
+ const line = spyLine({ scrollY, maxScroll: document.documentElement.scrollHeight - innerHeight, view: innerHeight, base: Math.min(120, innerHeight * 0.3) });
268
+ const at = currentOf(tops, line);
269
+ return at >= 0 ? heads[at] : null;
270
+ }
271
+
272
+ function currentNode() {
273
+ if (chosenKey !== null) {
274
+ const chosen = heads.find((node) => node.key === chosenKey);
275
+ if (shown(chosen?.ref)) return chosen; // not one a tab switched since has hidden
276
+ chosenKey = null;
277
+ }
278
+ return spied();
279
+ }
280
+
281
+ // One frame: the page read again when it changed (not while an input method composes), the rows
282
+ // drawn when what they show did, the current row marked, the strip's lines, the edges of the list.
283
+ function run() {
284
+ if (!form) return false;
285
+ if (dirty && !composing) {
286
+ dirty = false;
287
+ read();
288
+ const signature = `${signatureOf(tree)}\u0003${[...folded].join("\u0001")}`;
289
+ if (signature !== drawnSignature) {
290
+ drawnSignature = signature;
291
+ list.render(rows, folded, -1);
292
+ markedKey = null;
293
+ } else list.update(rows);
294
+ }
295
+ if (flashing && !shown(flashing.heading)) unflash(); // its heading hidden (a tab switched) or gone
296
+ const current = currentNode();
297
+ const marked = markedRow(rows, current && pathTo(tree, current), folded);
298
+ list.mark(marked);
299
+ if (form === "strip") strip.draw(rows, marked);
300
+ const key = rows[marked]?.node.key ?? null;
301
+ if (key !== markedKey) {
302
+ const first = markedKey === null;
303
+ markedKey = key;
304
+ follow(marked, { smooth: !first });
305
+ }
306
+ edges();
307
+ return false;
308
+ }
309
+ const frames = task("outline", {
310
+ run,
311
+ fail: () => { drawnSignature = null; dirty = true; },
312
+ });
313
+ const wake = () => { if (form) frames.wake(); };
314
+
315
+ // The list scrolled to keep the current row in its band (tree.mjs followTop: at most a third of the
316
+ // way down, so reading down the rows to come fill the rest; two rows from the top at least), as little
317
+ // as that takes; not while the pointer is over the outline or the reader just scrolled it. `hidden`:
318
+ // only when the row is out of the list's clear view (the reader's own scroll kept while it shows).
319
+ function follow(index, { smooth = true, hidden = false } = {}) {
320
+ const box = form === "full" ? scroller : strip.open ? strip.scroll : null;
321
+ const row = list.rowAt(index);
322
+ if (!box || !row || pointerIn || Date.now() - listScrolled < FOLLOW_QUIET) return;
323
+ const frame = box.getBoundingClientRect();
324
+ const rect = row.getBoundingClientRect();
325
+ if (hidden && rect.top >= frame.top + FADE.top && rect.bottom <= frame.bottom - FADE.bottom) return;
326
+ const top = rect.top - frame.top + box.scrollTop;
327
+ const to = followTop({ top, row: ROW, scrollTop: box.scrollTop, view: box.clientHeight, full: box.scrollHeight, least: FOLLOW_LEAST, fade: FADE });
328
+ if (to !== null) box.scrollTo({ top: to, behavior: smooth && !still() ? "smooth" : "instant" });
329
+ }
330
+
331
+ // The pointer gone from the outline: once the list has been left alone FOLLOW_QUIET, it comes back to
332
+ // the current row if the reader scrolled it out of sight (the wheel over it).
333
+ let backTimer = 0;
334
+ function backSoon() {
335
+ clearTimeout(backTimer);
336
+ backTimer = setTimeout(() => { if (!pointerIn) follow(list.marked, { hidden: true }); }, Math.max(0, FOLLOW_QUIET - (Date.now() - listScrolled)) + 50);
337
+ }
338
+
339
+ // The list's fades at its ends while there is more above or below (in full, or in the strip's card).
340
+ function edges() {
341
+ const box = form === "full" ? scroller : strip.open ? strip.scroll : null;
342
+ if (!box) return;
343
+ const more = [];
344
+ if (box.scrollTop > 1) more.push("up");
345
+ if (box.scrollTop + box.clientHeight < box.scrollHeight - 1) more.push("down");
346
+ const value = more.join(" ");
347
+ if ((box.getAttribute("data-more") ?? "") !== value) {
348
+ if (value) box.setAttribute("data-more", value);
349
+ else box.removeAttribute("data-more");
350
+ }
351
+ }
352
+
353
+ // The grips stand in the scrollers but are not the list (placed by the frame, the card): the wheel over one scrolls the page.
354
+ const onList = (target) => holds(target) && !target.closest?.(GRIPS) ? target.closest?.(".ge-outline-scroll") ?? null : null;
355
+ for (const box of [scroller, strip.scroll]) {
356
+ box.addEventListener("scroll", edges, { passive: true });
357
+ for (const type of ["wheel", "touchmove"]) box.addEventListener(type, (event) => { if (onList(event.target)) listScrolled = Date.now(); }, { passive: true });
358
+ }
359
+ for (const node of [dock, strip.strip, strip.card]) {
360
+ node.addEventListener("pointerenter", () => { pointerIn = true; });
361
+ node.addEventListener("pointerleave", () => { pointerIn = false; backSoon(); wake(); });
362
+ }
363
+
364
+ // ---------- folding ----------
365
+
366
+ function toggle(node) {
367
+ if (folded.has(node.key)) folded.delete(node.key);
368
+ else folded.add(node.key);
369
+ keepFolds(local, slug, folded, keysOf(tree));
370
+ dirty = true;
371
+ frames.wake();
372
+ }
373
+
374
+ // ---------- going to a heading ----------
375
+
376
+ // The page scrolled to put `target` JUMP_TOP below the window's top; `then(end, wanted)` once the
377
+ // scroll is over (`end`: the scrollY it went for, `wanted`: where the target was then, unclamped).
378
+ // More than two windows away, the page goes at once to a window short of it and glides the rest
379
+ // (tree.mjs glideFrom: the browser's glide over 14000px took 1.5s). Over means: at its end, or no
380
+ // longer moving towards it (a scrollend, or 1.5s gone by, then looked at again while it still moves:
381
+ // a slow machine's glide is waited for, the reader's scroll is not).
382
+ function scrollToTarget(target, then) {
383
+ settling?.(false);
384
+ const top = Math.round(target.getBoundingClientRect().top + scrollY - JUMP_TOP);
385
+ const end = Math.max(0, Math.min(top, document.documentElement.scrollHeight - innerHeight));
386
+ let timer = 0;
387
+ const done = (arrived = true) => {
388
+ if (settling !== done) return;
389
+ settling = null;
390
+ clearTimeout(timer);
391
+ removeEventListener("scrollend", check);
392
+ if (arrived) then?.(end, top);
393
+ };
394
+ function check() {
395
+ if (settling !== done) return;
396
+ const left = Math.abs(scrollY - end);
397
+ if (left < 1) return done(true);
398
+ clearTimeout(timer);
399
+ timer = setTimeout(() => {
400
+ if (Math.abs(scrollY - end) < left - 0.5) timer = setTimeout(check, 250); // still on its way
401
+ else done(true);
402
+ }, 60);
403
+ }
404
+ settling = done;
405
+ if (Math.abs(end - scrollY) < 1) {
406
+ done(true);
407
+ return;
408
+ }
409
+ const from = still() ? null : glideFrom(scrollY, end, innerHeight);
410
+ if (from !== null) scrollTo({ top: from, behavior: "instant" });
411
+ addEventListener("scrollend", check);
412
+ timer = setTimeout(check, 1500);
413
+ scrollTo({ top: end, behavior: still() ? "instant" : "smooth" });
414
+ }
415
+
416
+ // Scrolled to `target`, and again while it is not there yet and the page can still go (what was just
417
+ // shown lays itself out as the page scrolls: a tab's tables, a disclosure's content), then `then()`.
418
+ // A scroll that ended somewhere else than it went for, the page laid out as it was, was the reader's
419
+ // (the scrollbar): the jump ends there, never pulling the page back. One the page's layout moved (the
420
+ // browser keeping what was in view where it was as a tab's tables laid themselves out above it) lands
421
+ // again. While it goes, the list says so (data-going: the browser scenarios wait for it).
422
+ function land(target, then, tries = 0) {
423
+ jumping = true;
424
+ list.node.setAttribute("data-going", "");
425
+ scrollToTarget(target, (end, wanted) => {
426
+ const max = document.documentElement.scrollHeight - innerHeight;
427
+ const clamped = end > max && scrollY >= max - 1; // the page got shorter meanwhile: as far as it goes
428
+ const shifted = Math.abs(Math.round(target.getBoundingClientRect().top + scrollY - JUMP_TOP) - wanted) > 1;
429
+ if (Math.abs(scrollY - end) > 1 && !clamped && !shifted) return stopJump();
430
+ const off = Math.round(target.getBoundingClientRect().top) - JUMP_TOP;
431
+ const room = off > 0 ? max - scrollY : scrollY;
432
+ if (Math.abs(off) > 2 && room > 1 && tries < 3 && target.isConnected) return land(target, then, tries + 1);
433
+ jumping = false;
434
+ list.node.removeAttribute("data-going");
435
+ then?.();
436
+ });
437
+ }
438
+
439
+ // The jump ended before it landed: the page is the reader's, the spy says where they are.
440
+ function stopJump() {
441
+ settling?.(false);
442
+ jumping = false;
443
+ chosenKey = null;
444
+ landedAt = null;
445
+ list.node.removeAttribute("data-going");
446
+ wake();
447
+ }
448
+
449
+ function unflash() {
450
+ flashing?.node.remove();
451
+ flashing = null;
452
+ }
453
+
454
+ function flash(heading) {
455
+ unflash();
456
+ const shape = shown(heading) ? shapeOf(heading) : null;
457
+ if (!shape) return;
458
+ const node = element("div", { class: "ge-outline-flash", "data-doc-dev": "" });
459
+ const entry = { node, heading };
460
+ own(node, "outline-flash", { owner: heading, alive: () => flashing === entry && heading.isConnected });
461
+ drawOver(node, shape, { x: 4, y: 2, radius: 4 });
462
+ flashing = entry;
463
+ setTimeout(() => {
464
+ if (flashing !== entry) return;
465
+ const gone = () => { if (flashing === entry) unflash(); };
466
+ const fade = still() ? null : node.animate?.([{ opacity: 1 }, { opacity: 0 }], { duration: FLASH.fade, easing: "ease-in", fill: "forwards" });
467
+ if (fade) fade.onfinish = gone;
468
+ else gone();
469
+ }, FLASH.hold);
470
+ }
471
+ // After a change of the page (history: a change, an undo, a redo), at once: a heading lit and gone with it is let go.
472
+ onSettle(() => { if (flashing && !shown(flashing.heading)) unflash(); });
473
+
474
+ // A jump leaves the text: its selection goes (the format bar, a selection's strips with it: they stood
475
+ // over the heading gone to), and Esc has no caret to give back (the page is where the reader went).
476
+ function leaveText() {
477
+ returnTo = null;
478
+ const selection = getSelection();
479
+ if (selection.rangeCount && main.contains(selection.anchorNode)) selection.removeAllRanges();
480
+ }
481
+
482
+ // `keyboard`: chosen by Enter or Space, the focus stays in the tree; by the pointer, the page is the
483
+ // reader's: the focus leaves the outline (the keys that read scroll the page, a letter types nothing).
484
+ function go(node, { keyboard = false } = {}) {
485
+ const jump = ++jumps;
486
+ const begin = (target, then) => requestAnimationFrame(() => { if (jump === jumps && jumping) land(target, then); });
487
+ if (node.kind === "tab") {
488
+ const area = node.ref?.closest(SHEETS.match);
489
+ if (!area) return;
490
+ const key = node.ref.getAttribute(SHEETS.tabKey);
491
+ reveal([...area.children].find((child) => child.getAttribute(SHEETS.panelKey) === key) ?? area);
492
+ chosenKey = null;
493
+ landedAt = null;
494
+ jumping = true;
495
+ begin(node.ref.closest(SHEETS.rowAt) ?? area);
496
+ } else {
497
+ const heading = node.ref;
498
+ if (!heading?.isConnected) return;
499
+ reveal(heading); // a fold hiding it opened, not its own (fold/)
500
+ chosenKey = node.key;
501
+ landedAt = null;
502
+ jumping = true;
503
+ begin(heading, () => {
504
+ landedAt = scrollY;
505
+ flash(heading);
506
+ });
507
+ }
508
+ leaveText();
509
+ // Chosen by a key, the card closes (the focus back on the strip); by the pointer, it stays while the pointer is on it.
510
+ if (strip.open && (keyboard || (!strip.keyed && !pointerIn))) strip.closeCard({ focus: keyboard });
511
+ if (!keyboard) toPage();
512
+ frames.wake();
513
+ }
514
+
515
+ // The focus on the page itself, out of the outline and the text: a letter types nothing, the keys that
516
+ // read scroll the page (below), the editor's keys for the page (undo, select-all) are the page's.
517
+ function toPage() {
518
+ const active = document.activeElement;
519
+ if (active && active !== document.body && (holds(active) || main.contains(active))) active.blur();
520
+ }
521
+
522
+ // With the focus on the page itself after a press in the list (a jump by the pointer), the browser
523
+ // scrolls the list with the keys that read (it scrolls what holds the focus, else what was pressed
524
+ // last): the page is scrolled instead, by what those keys scroll it with nothing pressed there.
525
+ let pressedInList = false;
526
+ document.addEventListener("pointerdown", (event) => { pressedInList = Boolean(event.target?.closest?.(".ge-outline-scroll")); }, true);
527
+ addEventListener("keydown", (event) => {
528
+ if (!pressedInList || event.defaultPrevented || document.activeElement !== document.body || event.ctrlKey || event.metaKey || event.altKey || event.isComposing) return;
529
+ const step = Math.round(innerHeight * PAGE);
530
+ const by = event.shiftKey ? (event.key === " " ? -step : undefined) : { PageDown: step, PageUp: -step, " ": step, ArrowDown: LINE, ArrowUp: -LINE }[event.key];
531
+ const behavior = still() ? "instant" : "smooth";
532
+ if (by !== undefined) scrollBy({ top: by, behavior });
533
+ else if (!event.shiftKey && (event.key === "Home" || event.key === "End")) scrollTo({ top: event.key === "Home" ? 0 : document.documentElement.scrollHeight, behavior });
534
+ else return;
535
+ event.preventDefault();
536
+ });
537
+
538
+ // PageUp/PageDown in the tree: the page scrolls, as with the focus on it (the list, with no scrollbar, is not paged).
539
+ function page(direction) {
540
+ scrollBy({ top: direction * Math.round(innerHeight * PAGE), behavior: still() ? "instant" : "smooth" });
541
+ }
542
+
543
+ // The reader taking the page over during a jump: the wheel or a touch (not on the outline's own
544
+ // list), a key that scrolls the page (not the rows' own keys), a press in the page or on its scrollbar.
545
+ const takeOver = () => { if (jumping) stopJump(); };
546
+ // The wheel over the list scrolls it, and at its end in the wheel's way the page: then it is the reader's.
547
+ const listEnd = (box, down) => (down ? box.scrollTop + box.clientHeight >= box.scrollHeight - 1 : box.scrollTop <= 0);
548
+ addEventListener("wheel", (event) => {
549
+ const box = onList(event.target);
550
+ if (!box || listEnd(box, event.deltaY > 0)) takeOver();
551
+ }, { passive: true, capture: true });
552
+ addEventListener("touchstart", (event) => { if (!holds(event.target)) takeOver(); }, { passive: true, capture: true });
553
+ addEventListener("keydown", (event) => {
554
+ if (!jumping || !SCROLL_KEYS.has(event.key)) return;
555
+ if (list.holds(event.target) && event.key !== "PageUp" && event.key !== "PageDown") return;
556
+ takeOver();
557
+ }, true);
558
+ addEventListener("pointerdown", (event) => { if (!holds(event.target)) takeOver(); }, true);
559
+ // After it landed, the heading gone to stays current until the page has moved STAY px.
560
+ addEventListener("scroll", () => {
561
+ if (!jumping && chosenKey !== null && (landedAt === null || Math.abs(scrollY - landedAt) > STAY)) {
562
+ chosenKey = null;
563
+ landedAt = null;
564
+ }
565
+ wake();
566
+ }, { passive: true });
567
+
568
+ // ---------- the focus ----------
569
+
570
+ // The caret's place when the outline takes the focus from the text, given back by Esc.
571
+ document.addEventListener("focusin", (event) => {
572
+ if (!holds(event.target)) return;
573
+ const host = editableAt(event.relatedTarget);
574
+ if (!host || holds(host)) return;
575
+ const selection = getSelection();
576
+ const range = selection.rangeCount ? selection.getRangeAt(0) : null;
577
+ returnTo = { host, range: range && host.contains(range.startContainer) ? range.cloneRange() : null };
578
+ }, true);
579
+
580
+ function giveBack() {
581
+ if (strip.open) {
582
+ strip.closeCard({ focus: true });
583
+ return;
584
+ }
585
+ const back = returnTo;
586
+ returnTo = null;
587
+ if (back?.host?.isConnected) {
588
+ back.host.focus({ preventScroll: true });
589
+ if (back.range) {
590
+ const selection = getSelection();
591
+ selection.removeAllRanges();
592
+ selection.addRange(back.range);
593
+ }
594
+ } else toPage();
595
+ }
596
+
597
+ // ---------- shown or not, in which form ----------
598
+
599
+ // The outline in the form the room gives it (null: none), the list as wide as the room gives it. Drawn
600
+ // at once as the page comes (no frame shows it empty); a form coming after that fades in (`fade`);
601
+ // one going goes at once (the reader switching it off too). The focus in it stays in it as its form
602
+ // changes (on its row in full, on the strip's button).
603
+ function show(layout, { fade = false } = {}) {
604
+ if (layout.outline === "full") dock.style.width = `${layout.dock}px`;
605
+ const next = on ? layout.outline : null;
606
+ if (next === form) return;
607
+ const active = document.activeElement;
608
+ const focusedRow = list.node.contains(active) ? Number(active.closest?.(".ge-outline-row")?.dataset.index ?? -1) : -1;
609
+ const hadFocus = holds(active);
610
+ const was = form;
611
+ form = next;
612
+ if (was === "full") dock.hidden = true;
613
+ if (was === "strip") strip.show(false);
614
+ if (form === "full") {
615
+ if (list.node.parentNode !== scroller) scroller.append(list.node);
616
+ for (const animation of dock.getAnimations?.() ?? []) animation.cancel();
617
+ dock.hidden = false;
618
+ if (fade && !still()) dock.animate?.([{ opacity: 0, transform: `translateX(${ENTER.slide}px)` }, { opacity: 1, transform: "none" }], { duration: ENTER.ms, easing: "ease-out" });
619
+ } else if (form === "strip") strip.show(true, { fade });
620
+ if (!form) return;
621
+ dirty = true;
622
+ markedKey = null;
623
+ try {
624
+ run();
625
+ } catch {
626
+ drawnSignature = null;
627
+ dirty = true;
628
+ frames.wake(); // drawn by the loop, which says what went wrong
629
+ }
630
+ if (hadFocus) {
631
+ if (form === "full") list.focus(focusedRow >= 0 ? focusedRow : Math.max(0, list.marked));
632
+ else strip.focusButton();
633
+ }
634
+ }
635
+
636
+ // The strip's card as wide as the list chosen, and a little more.
637
+ const cardWidth = () => { strip.card.style.width = `${outlineWidth(chosen, MARGIN) + CARD}px`; };
638
+ cardWidth();
639
+
640
+ // Shown in the form the room gives it as the editor starts, at once (it comes with the page), then
641
+ // as the room changes (the window, the list's width, the reader's collapse) and switched on or off by
642
+ // the reader, faded in (switched off, gone at once). Another page of the origin dragging the list's
643
+ // width or collapsing it (every report's): followed. This report's outline switched by another page (the workbench's top bar,
644
+ // the report in another tab): followed; another report's switch changes nothing here.
645
+ show(setMargin({ outline: on, outlineWidth: chosen, collapsed }));
646
+ onMargin((layout) => show(layout, { fade: true }));
647
+ onPreferences(() => {
648
+ const fold = preference("outlineCollapsed");
649
+ if (fold !== collapsed) {
650
+ endSizing(false);
651
+ collapsed = fold;
652
+ setMargin({ collapsed });
653
+ }
654
+ const width = preference("outlineWidth");
655
+ if (width === chosen || sizing) return;
656
+ chosen = width;
657
+ cardWidth();
658
+ setMargin({ outlineWidth: chosen });
659
+ });
660
+ onOutlineOpen(() => {
661
+ const next = outlineOpen(slug);
662
+ if (next === on) return;
663
+ on = next;
664
+ show(setMargin({ outline: on }), { fade: true });
665
+ });
666
+
667
+ // ---------- the width, collapsed ----------
668
+
669
+ // The guide dragged: the list wider or narrower as the pointer goes (the column staying in the middle
670
+ // of what it leaves: margin.mjs), within 160px and what leaves the column its edge room at both sides
671
+ // (outlineMost), once the pointer has gone CLICK px across (let go short of that, it was a click: the
672
+ // list collapsed); let go, the
673
+ // width is the reader's (every report, every page of the origin); Esc, the window losing the focus or
674
+ // the pointer taken away put it back.
675
+ let sizing = null; // { x, width, most, now, before, moved }
676
+ grip.addEventListener("pointerdown", (event) => {
677
+ if (event.button !== 0 || form !== "full") return;
678
+ event.preventDefault();
679
+ const width = Math.round(dock.getBoundingClientRect().width);
680
+ sizing = { x: event.clientX, width, most: Math.max(width, outlineMost()), now: width, before: chosen, moved: false };
681
+ try { document.documentElement.setPointerCapture(event.pointerId); } catch {}
682
+ document.documentElement.setAttribute(RESIZING, "");
683
+ });
684
+ document.documentElement.addEventListener("pointermove", (event) => {
685
+ if (!sizing) return;
686
+ if (!sizing.moved && Math.abs(event.clientX - sizing.x) < CLICK) return;
687
+ sizing.moved = true;
688
+ const width = Math.round(Math.max(MARGIN.fullMin, Math.min(sizing.most, sizing.width + sizing.x - event.clientX)));
689
+ if (width === sizing.now) return;
690
+ sizing.now = width;
691
+ setMargin({ outlineWidth: width });
692
+ });
693
+ // Let go where it began (or never moved): nothing chosen, the width chosen before laid out again (the
694
+ // drag gave the layout the width shown, narrower than the one chosen where the room is short). Let go
695
+ // before it moved: a click, the list collapsed.
696
+ function endSizing(keep) {
697
+ if (!sizing) return;
698
+ const { now, before, width, moved } = sizing;
699
+ sizing = null;
700
+ document.documentElement.removeAttribute(RESIZING);
701
+ if (keep && !moved) setCollapsed(true);
702
+ else if (!keep || now === width) setMargin({ outlineWidth: before });
703
+ else {
704
+ chosen = now;
705
+ setPreference("outlineWidth", now);
706
+ cardWidth();
707
+ }
708
+ }
709
+ document.documentElement.addEventListener("pointerup", () => endSizing(true));
710
+ endsGesture({ active: () => Boolean(sizing), cancel: () => endSizing(false) });
711
+ cancelOnEscape({ active: () => Boolean(sizing), cancel: () => endSizing(false) });
712
+
713
+ // The reader's collapse, kept for every report and every page of the origin (the page's head reads it
714
+ // before the page shows); the form is the room's to give (margin.mjs): taken back where the room is
715
+ // short, the strip stays and the list comes once there is room.
716
+ function setCollapsed(value) {
717
+ if (value === collapsed) return;
718
+ collapsed = value;
719
+ setPreference("outlineCollapsed", value);
720
+ setMargin({ collapsed: value });
721
+ }
722
+
723
+ // A tooltip by the pointer on a guide (a tall target: over where the pointer rests, as the
724
+ // workbench's sidebar edge has it), once it has rested there a moment; none while the guide is pressed.
725
+ const tipAt = (event, text, hint) => tooltipAt({ left: event.clientX, right: event.clientX, top: event.clientY, bottom: event.clientY, width: 0, height: 0 }, text, hint);
726
+ function guideTip(node, says) {
727
+ const rest = (event) => {
728
+ if (sizing || event.buttons || document.querySelector(".ge-tip")) return; // shown: it stays where it came
729
+ tipAt(event, ...says());
730
+ };
731
+ node.addEventListener("pointerenter", rest);
732
+ node.addEventListener("pointermove", rest);
733
+ node.addEventListener("pointerleave", hideTooltip);
734
+ node.addEventListener("pointerdown", hideTooltip);
735
+ }
736
+ const waiting = () => t("页面不够宽,变宽后展开");
737
+ guideTip(grip, () => [t("收起目录"), t("拖动调整宽度")]);
738
+ // The card's guide: a hand and its darker bar only where the room gives the list (data-fits), else
739
+ // its tooltip says why a click opens nothing (the list comes once there is room).
740
+ const fits = () => {
741
+ const now = listFits();
742
+ strip.guide.toggleAttribute("data-fits", now);
743
+ return now;
744
+ };
745
+ guideTip(strip.guide, () => [t("展开目录"), fits() ? null : waiting()]);
746
+ strip.guide.addEventListener("pointerenter", fits);
747
+ strip.guide.addEventListener("click", (event) => {
748
+ if (event.button !== 0 || form !== "strip") return;
749
+ const room = fits();
750
+ setCollapsed(false);
751
+ if (!room) tipAt(event, t("展开目录"), waiting());
752
+ });
753
+
754
+
755
+ // The page changing: read again on the next frame when it may change what is listed (one reading
756
+ // a frame however much changed; words typed elsewhere only move the headings: the current one again).
757
+ // Off, nothing is read (showing it reads the page anew).
758
+ new MutationObserver((records) => {
759
+ if (!form) return;
760
+ if (touchesOutline(records)) dirty = true;
761
+ wake();
762
+ }).observe(main, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ["hidden", "open", "aria-selected", "data-block-id", "data-sheet-tab", "data-ge-unit-kind"] });
763
+ // Where the headings are changes without a scroll too (a picture loaded, a disclosure opened, the window resized).
764
+ new ResizeObserver(wake).observe(main);
765
+ addEventListener("resize", wake);
766
+ // An input method composing: what it types is read once it commits (compositionend; Chrome does
767
+ // not always send one, editor.mjs compositionOver: a key, an input or a press that is no part of one ends it too).
768
+ const composed = () => {
769
+ if (!composing) return;
770
+ composing = false;
771
+ wake();
772
+ };
773
+ document.addEventListener("compositionstart", () => { composing = true; }, true);
774
+ document.addEventListener("compositionend", composed, true);
775
+ for (const type of ["keydown", "input"]) document.addEventListener(type, (event) => { if (composing && !event.isComposing && event.keyCode !== 229) composed(); }, true);
776
+ document.addEventListener("pointerdown", composed, true);
777
+
778
+ function holds(target) {
779
+ return Boolean(target?.nodeType === 1 && (dock.contains(target) || strip.holds(target)));
780
+ }
781
+ made = { holds, get shown() { return form !== null; } };
782
+ return made;
783
+ }