@heycys/gallery 0.1.1 → 0.1.2
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.
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/browser/editor/components/columns/page.mjs +4 -4
- package/browser/editor/components/embed/index.mjs +2 -2
- package/browser/editor/components/flowchart/add.mjs +7 -6
- package/browser/editor/components/flowchart/page.mjs +1 -1
- package/browser/editor/components/icons.mjs +8 -0
- package/browser/editor/components/image/crop.mjs +6 -9
- package/browser/editor/components/installed/index.mjs +11 -4
- package/browser/editor/components/installed/page.mjs +27 -16
- package/browser/editor/components/installed/served.mjs +6 -5
- package/browser/editor/components/instances.mjs +18 -0
- package/browser/editor/components/list/page.mjs +3 -6
- package/browser/editor/components/registry.mjs +13 -4
- package/browser/editor/components/table/index.mjs +59 -2
- package/browser/editor/components/table/page.mjs +1 -1
- package/browser/editor/page/annotate/card.mjs +3 -6
- package/browser/editor/page/autosave.mjs +310 -37
- package/browser/editor/page/board/client.mjs +57 -0
- package/browser/editor/page/board/hint.mjs +145 -0
- package/browser/editor/page/board/history.mjs +119 -0
- package/browser/editor/page/board/index.mjs +970 -0
- package/browser/editor/page/board/settings.mjs +209 -0
- package/browser/editor/page/caret.mjs +1 -1
- package/browser/editor/page/changes/bar.mjs +6 -14
- package/browser/editor/page/changes/index.mjs +2 -2
- package/browser/editor/page/clipboard/import/html.mjs +29 -6
- package/browser/editor/page/clipboard/import/inline.mjs +32 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +58 -13
- package/browser/editor/page/clipboard/import/read.mjs +6 -1
- package/browser/editor/page/clipboard/import/to-blocks.mjs +44 -12
- package/browser/editor/page/clipboard/import/yuque.mjs +622 -0
- package/browser/editor/page/clipboard/index.mjs +124 -13
- package/browser/editor/page/clipboard/own/blocks.mjs +11 -11
- package/browser/editor/page/clipboard/own/chart-keys.mjs +41 -28
- package/browser/editor/page/clipboard/own/selection.mjs +1 -1
- package/browser/editor/page/columns/index.mjs +48 -46
- package/browser/editor/page/commit.mjs +80 -22
- package/browser/editor/page/conflicts.mjs +7 -7
- package/browser/editor/page/core.mjs +31 -15
- package/browser/editor/page/custom-page.mjs +106 -0
- package/browser/editor/page/editor.mjs +51 -14
- package/browser/editor/page/emoji-picker/styles.mjs +7 -12
- package/browser/editor/page/emoji-picker/upload.mjs +2 -2
- package/browser/editor/page/handle/index.mjs +5 -8
- package/browser/editor/page/history.mjs +24 -4
- package/browser/editor/page/links/index.mjs +5 -3
- package/browser/editor/page/links/pages.mjs +27 -9
- package/browser/editor/page/look.mjs +54 -3
- package/browser/editor/page/margin.mjs +18 -3
- package/browser/editor/page/media-menu/index.mjs +6 -7
- package/browser/editor/page/menu.mjs +18 -7
- package/browser/editor/page/notices.mjs +2 -2
- package/browser/editor/page/page-objects.mjs +13 -2
- package/browser/editor/page/panel.mjs +4 -9
- package/browser/editor/page/present-links.mjs +11 -2
- package/browser/editor/page/resize/index.mjs +42 -29
- package/browser/editor/page/served.mjs +14 -0
- package/browser/editor/page/session.mjs +48 -4
- package/browser/editor/page/slash-menu/index.mjs +3 -3
- package/browser/editor/page/table/cells.mjs +102 -46
- package/browser/editor/page/table/icons.mjs +2 -0
- package/browser/editor/page/table/index.mjs +29 -10
- package/browser/editor/page/table/pictures.mjs +299 -0
- package/browser/editor/page/table/views.mjs +150 -0
- package/browser/editor/page/text-select/index.mjs +26 -12
- package/browser/editor/page/todo-writes.mjs +75 -0
- package/browser/editor/page/typing/index.mjs +53 -3
- package/browser/editor/page/ui.mjs +13 -0
- package/browser/shared/block-packs.mjs +404 -0
- package/browser/shared/board-places.mjs +224 -0
- package/browser/shared/card-size.mjs +59 -0
- package/browser/shared/colors.mjs +3 -2
- package/browser/shared/component-catalog.mjs +323 -46
- package/browser/shared/component-source.mjs +37 -0
- package/browser/shared/components/index.mjs +12 -3
- package/browser/shared/components/installed.mjs +35 -3
- package/browser/shared/components/page.mjs +18 -8
- package/browser/shared/components/state.mjs +5 -1
- package/browser/shared/document-look.mjs +10 -5
- package/browser/shared/drafts.mjs +432 -0
- package/browser/shared/extension-sidebar.mjs +126 -0
- package/browser/shared/extensions.mjs +79 -0
- package/browser/shared/file-table.mjs +101 -0
- package/browser/shared/i18n/en.mjs +307 -27
- package/browser/shared/json-layout.mjs +47 -0
- package/browser/shared/net-cache.mjs +133 -0
- package/browser/shared/net-keys.mjs +32 -0
- package/browser/shared/net-policy.mjs +177 -0
- package/browser/shared/outline-shape.mjs +128 -0
- package/browser/shared/outline.mjs +331 -67
- package/browser/shared/pack-manifest.mjs +77 -0
- package/browser/shared/page-address.mjs +6 -3
- package/browser/shared/page-cards.mjs +308 -0
- package/browser/shared/page-links.mjs +69 -6
- package/browser/shared/pages.mjs +388 -0
- package/browser/shared/paths.mjs +6 -0
- package/browser/shared/preview-server.mjs +3 -7
- package/browser/shared/session.mjs +8 -1
- package/browser/shared/shipped-blocks.mjs +299 -0
- package/browser/shared/table-chart.mjs +33 -1
- package/browser/shared/todos.mjs +83 -0
- package/browser/shared/user-directory.mjs +24 -0
- package/browser/shared/versions.mjs +14 -0
- package/browser/shared/web-links.mjs +134 -0
- package/browser/shared/workspace-columns.mjs +120 -0
- package/browser/shared/workspace-name.mjs +154 -0
- package/browser/shared/workspace-query.mjs +125 -0
- package/browser/shared/workspace-registry.mjs +272 -0
- package/browser/shared/workspace.mjs +171 -20
- package/dist/chunk-2NRBY6AJ.mjs +2 -0
- package/dist/chunk-32ZUEFZ7.mjs +2 -0
- package/dist/chunk-35NQ4PLQ.mjs +2 -0
- package/dist/chunk-3KJHLHUO.mjs +2 -0
- package/dist/chunk-3NJACR4W.mjs +2 -0
- package/dist/chunk-4AV456RQ.mjs +2 -0
- package/dist/chunk-4OZWXZE5.mjs +5 -0
- package/dist/chunk-5XYHDBJ5.mjs +2 -0
- package/dist/chunk-5ZJA7CXT.mjs +2 -0
- package/dist/chunk-6A53MZYZ.mjs +2 -0
- package/dist/chunk-6EXH3ORZ.mjs +166 -0
- package/dist/chunk-6EZ7FNIK.mjs +3 -0
- package/dist/{chunk-V5JTW2LH.mjs → chunk-6QBHU4DF.mjs} +1 -1
- package/dist/{chunk-Y6RLRPG3.mjs → chunk-6VTU6KEO.mjs} +1 -1
- package/dist/chunk-B4P2CM2J.mjs +3 -0
- package/dist/{chunk-FDLXYYG4.mjs → chunk-BPL64HGA.mjs} +1 -1
- package/dist/chunk-BVEFGE4B.mjs +2 -0
- package/dist/{chunk-LS4F7JUM.mjs → chunk-BZ5RAF7L.mjs} +1 -1
- package/dist/chunk-CRJEG7MT.mjs +2 -0
- package/dist/{chunk-LCTHTZIL.mjs → chunk-D4CKRD3V.mjs} +91 -91
- package/dist/chunk-D4EURAX4.mjs +4 -0
- package/dist/chunk-DQCE7TJY.mjs +5 -0
- package/dist/chunk-DR73Y2UJ.mjs +3 -0
- package/dist/{chunk-TMYZB6AV.mjs → chunk-EKNHM3P4.mjs} +1 -1
- package/dist/{chunk-GB5SOYQJ.mjs → chunk-ERLAIBOA.mjs} +2 -2
- package/dist/chunk-EURLTOTZ.mjs +4 -0
- package/dist/chunk-FJYN7RTH.mjs +4 -0
- package/dist/chunk-FWNRPMCJ.mjs +12 -0
- package/dist/chunk-FWW4CSAZ.mjs +2 -0
- package/dist/{chunk-2B5E4CDJ.mjs → chunk-GPIWQ4X4.mjs} +1 -1
- package/dist/chunk-GY3FAUVM.mjs +2 -0
- package/dist/chunk-HLYV7RIH.mjs +2 -0
- package/dist/chunk-HMYTM3GT.mjs +15 -0
- package/dist/chunk-IA4PSIMD.mjs +2 -0
- package/dist/chunk-JEUK3ZO7.mjs +2 -0
- package/dist/chunk-KTKHRC6H.mjs +2 -0
- package/dist/chunk-L7UP52JO.mjs +2 -0
- package/dist/{chunk-SYGN7GLU.mjs → chunk-MHW7ZKOU.mjs} +1 -1
- package/dist/chunk-N76HWBA3.mjs +10 -0
- package/dist/chunk-N7AZZLGT.mjs +548 -0
- package/dist/chunk-NAMN3RAF.mjs +2 -0
- package/dist/{chunk-5ZKJ3H4P.mjs → chunk-NFMCP2HI.mjs} +3 -3
- package/dist/chunk-NG375ILQ.mjs +2 -0
- package/dist/chunk-NVRNLK25.mjs +6 -0
- package/dist/chunk-NWFBE2YA.mjs +2 -0
- package/dist/chunk-NWR2LT5B.mjs +2 -0
- package/dist/chunk-OJKMINIU.mjs +20 -0
- package/dist/{chunk-4FS7Z7WR.mjs → chunk-OUUP3WKT.mjs} +1 -1
- package/dist/{chunk-BGGDRNYQ.mjs → chunk-OW5NWPOJ.mjs} +1 -1
- package/dist/chunk-PAREWQGB.mjs +4 -0
- package/dist/chunk-POQSE4C2.mjs +2 -0
- package/dist/chunk-PUOQ65NC.mjs +2 -0
- package/dist/{chunk-XNROSH2T.mjs → chunk-PVER7LSC.mjs} +2 -2
- package/dist/chunk-PZDLJJTJ.mjs +3 -0
- package/dist/chunk-Q47PLKIJ.mjs +15 -0
- package/dist/chunk-Q4UEPUWF.mjs +2 -0
- package/dist/chunk-QKXMPUXC.mjs +2 -0
- package/dist/chunk-QOUEFUCH.mjs +16 -0
- package/dist/chunk-RFDZXFJF.mjs +13 -0
- package/dist/chunk-RKPWLGZ3.mjs +4 -0
- package/dist/chunk-RMECZA2K.mjs +2 -0
- package/dist/{chunk-7DTINW6U.mjs → chunk-SQ6Y2ZMA.mjs} +2 -2
- package/dist/chunk-SX4LJYT6.mjs +8 -0
- package/dist/chunk-SXHBYZST.mjs +16 -0
- package/dist/chunk-TANZRINB.mjs +2 -0
- package/dist/chunk-TEZAWDSQ.mjs +2 -0
- package/dist/chunk-UBBRTJ2R.mjs +24 -0
- package/dist/chunk-UFNYFFKO.mjs +20 -0
- package/dist/chunk-UGWYKHBL.mjs +170 -0
- package/dist/chunk-UKSHDZZ6.mjs +2 -0
- package/dist/chunk-UNOYVIYR.mjs +2 -0
- package/dist/{chunk-E7LWZRXY.mjs → chunk-V6RIYQZZ.mjs} +1 -1
- package/dist/chunk-VJPFVNNW.mjs +15 -0
- package/dist/chunk-VS3ZMVGX.mjs +5 -0
- package/dist/chunk-VTKNEYT3.mjs +6 -0
- package/dist/chunk-VXACTLO3.mjs +3 -0
- package/dist/chunk-YI43RG4P.mjs +2 -0
- package/dist/chunk-YQGT4AB2.mjs +6 -0
- package/dist/chunk-ZB4H7ZN4.mjs +2 -0
- package/dist/{chunk-IVDLMMBD.mjs → chunk-ZHEHPMBK.mjs} +1 -1
- package/dist/chunk-ZTHICSSF.mjs +2 -0
- package/dist/chunk-ZUNVAXLH.mjs +2 -0
- package/dist/chunk-ZWPMCK7P.mjs +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{chunk-U6KNPJPR.mjs → update-fetch.mjs} +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/board.css +95 -0
- package/kit/board.js +250 -0
- package/kit/charts.js +5 -71
- package/kit/code.js +14 -14
- package/kit/report.css +255 -17
- package/kit/runtime.js +1600 -125
- package/kit/state.js +10 -1
- package/kit/tables.js +128 -43
- package/kit/ui.js +77 -35
- package/package.json +2 -1
- package/packs/gallery/card/component.json +14 -0
- package/packs/gallery/card/example.html +10 -0
- package/packs/gallery/card/preview.svg +1 -0
- package/packs/gallery/card/style.css +6 -0
- package/packs/gallery/card/template.html +6 -0
- package/packs/gallery/card/writing.md +14 -0
- package/packs/gallery/chart-card/component.json +15 -0
- package/packs/gallery/chart-card/example.html +14 -0
- package/packs/gallery/chart-card/kit.js +130 -0
- package/packs/gallery/chart-card/preview.svg +1 -0
- package/packs/gallery/chart-card/style.css +42 -0
- package/packs/gallery/chart-card/template.html +13 -0
- package/packs/gallery/chart-card/writing.md +20 -0
- package/packs/gallery/chart-view/component.json +20 -0
- package/packs/gallery/chart-view/example.html +13 -0
- package/packs/gallery/chart-view/kit.js +355 -0
- package/packs/gallery/chart-view/preview.svg +1 -0
- package/packs/gallery/chart-view/style.css +94 -0
- package/packs/gallery/chart-view/template.html +3 -0
- package/packs/gallery/chart-view/writing.md +22 -0
- package/packs/gallery/countdown/component.json +18 -0
- package/packs/gallery/countdown/example.html +3 -0
- package/packs/gallery/countdown/kit.js +156 -0
- package/packs/gallery/countdown/preview.svg +1 -0
- package/packs/gallery/countdown/style.css +130 -0
- package/packs/gallery/countdown/template.html +3 -0
- package/packs/gallery/countdown/writing.md +22 -0
- package/packs/gallery/habit/component.json +14 -0
- package/packs/gallery/habit/example.html +3 -0
- package/packs/gallery/habit/kit.js +295 -0
- package/packs/gallery/habit/preview.svg +1 -0
- package/packs/gallery/habit/style.css +246 -0
- package/packs/gallery/habit/template.html +3 -0
- package/packs/gallery/habit/writing.md +21 -0
- package/packs/gallery/heatmap/component.json +18 -0
- package/packs/gallery/heatmap/example.html +3 -0
- package/packs/gallery/heatmap/kit.js +351 -0
- package/packs/gallery/heatmap/preview.svg +1 -0
- package/packs/gallery/heatmap/style.css +201 -0
- package/packs/gallery/heatmap/template.html +3 -0
- package/packs/gallery/heatmap/writing.md +21 -0
- package/packs/gallery/kanban/component.json +18 -0
- package/packs/gallery/kanban/example.html +12 -0
- package/packs/gallery/kanban/kit.js +540 -0
- package/packs/gallery/kanban/preview.svg +1 -0
- package/packs/gallery/kanban/style.css +212 -0
- package/packs/gallery/kanban/template.html +3 -0
- package/packs/gallery/kanban/writing.md +20 -0
- package/packs/gallery/metric/component.json +22 -0
- package/packs/gallery/metric/example.html +15 -0
- package/packs/gallery/metric/kit.js +248 -0
- package/packs/gallery/metric/preview.svg +1 -0
- package/packs/gallery/metric/style.css +92 -0
- package/packs/gallery/metric/template.html +3 -0
- package/packs/gallery/metric/writing.md +23 -0
- package/packs/gallery/note/component.json +14 -0
- package/packs/gallery/note/example.html +3 -0
- package/packs/gallery/note/kit.js +102 -0
- package/packs/gallery/note/preview.svg +1 -0
- package/packs/gallery/note/style.css +76 -0
- package/packs/gallery/note/template.html +3 -0
- package/packs/gallery/note/writing.md +18 -0
- package/packs/gallery/pack.json +8 -0
- package/packs/gallery/recent/component.json +13 -0
- package/packs/gallery/recent/example.html +1 -0
- package/packs/gallery/recent/kit.js +238 -0
- package/packs/gallery/recent/preview.svg +1 -0
- package/packs/gallery/recent/style.css +158 -0
- package/packs/gallery/recent/template.html +1 -0
- package/packs/gallery/recent/writing.md +15 -0
- package/packs/gallery/static/component.json +13 -0
- package/packs/gallery/static/example.html +11 -0
- package/packs/gallery/static/preview.svg +1 -0
- package/packs/gallery/static/style.css +138 -0
- package/packs/gallery/static/template.html +1 -0
- package/packs/gallery/static/writing.md +18 -0
- package/packs/gallery/stats/component.json +13 -0
- package/packs/gallery/stats/example.html +1 -0
- package/packs/gallery/stats/kit.js +166 -0
- package/packs/gallery/stats/preview.svg +1 -0
- package/packs/gallery/stats/style.css +151 -0
- package/packs/gallery/stats/template.html +1 -0
- package/packs/gallery/stats/writing.md +11 -0
- package/packs/gallery/today/component.json +12 -0
- package/packs/gallery/today/example.html +1 -0
- package/packs/gallery/today/kit.js +185 -0
- package/packs/gallery/today/preview.svg +1 -0
- package/packs/gallery/today/style.css +120 -0
- package/packs/gallery/today/template.html +1 -0
- package/packs/gallery/today/writing.md +14 -0
- package/packs/gallery/todos/component.json +19 -0
- package/packs/gallery/todos/example.html +3 -0
- package/packs/gallery/todos/kit.js +342 -0
- package/packs/gallery/todos/preview.svg +1 -0
- package/packs/gallery/todos/style.css +267 -0
- package/packs/gallery/todos/template.html +3 -0
- package/packs/gallery/todos/writing.md +30 -0
- package/packs/gallery/weather/component.json +19 -0
- package/packs/gallery/weather/example.html +3 -0
- package/packs/gallery/weather/kit.js +312 -0
- package/packs/gallery/weather/preview.svg +1 -0
- package/packs/gallery/weather/style.css +258 -0
- package/packs/gallery/weather/template.html +3 -0
- package/packs/gallery/weather/writing.md +26 -0
- package/packs/gallery-soft/pack.json +8 -0
- package/release.json +12 -10
- package/sdk/doc-kit.d.ts +396 -5
- package/sdk/doc-state.d.ts +2 -0
- package/skill/SKILL.md +56 -23
- package/skill/references/block-script.md +140 -0
- package/skill/references/building-blocks.md +257 -0
- package/skill/references/extensions.md +59 -0
- package/skill/references/pages-and-data.md +221 -0
- package/skill/references/writing-html.md +6 -4
- package/skill/sdk/doc-kit.d.ts +396 -5
- package/skill/sdk/doc-state.d.ts +2 -0
- package/web/assets/index-BK2e_07w.js +13 -0
- package/web/assets/index-CWFI83mF.css +1 -0
- package/web/index.html +2 -2
- package/dist/chunk-3HIRPVLU.mjs +0 -2
- package/dist/chunk-5MHMDLZD.mjs +0 -4
- package/dist/chunk-64K7IPLO.mjs +0 -255
- package/dist/chunk-6QXGZM36.mjs +0 -8
- package/dist/chunk-6RGJOMJP.mjs +0 -16
- package/dist/chunk-AJ73XJF3.mjs +0 -2
- package/dist/chunk-AUZGSZJH.mjs +0 -13
- package/dist/chunk-BFE45AKL.mjs +0 -2
- package/dist/chunk-BXO2ZY5P.mjs +0 -2
- package/dist/chunk-CEH4MRCC.mjs +0 -2
- package/dist/chunk-CY2FNNAB.mjs +0 -16
- package/dist/chunk-DFUDV4LX.mjs +0 -2
- package/dist/chunk-DKXG4XDG.mjs +0 -2
- package/dist/chunk-EZQ34M3F.mjs +0 -124
- package/dist/chunk-EZY3WC6Z.mjs +0 -15
- package/dist/chunk-FUKQNOQS.mjs +0 -9
- package/dist/chunk-JPOSLGOC.mjs +0 -6
- package/dist/chunk-L3QKH4OK.mjs +0 -26
- package/dist/chunk-LAE5NQ4B.mjs +0 -2
- package/dist/chunk-LEF6DRCK.mjs +0 -59
- package/dist/chunk-NO5NJCHO.mjs +0 -2
- package/dist/chunk-NQPVAU63.mjs +0 -2
- package/dist/chunk-NSKUTQ5J.mjs +0 -5
- package/dist/chunk-O35FIXRB.mjs +0 -2
- package/dist/chunk-P2CAZPDP.mjs +0 -3
- package/dist/chunk-PL6GHLGD.mjs +0 -15
- package/dist/chunk-QJIR2BLP.mjs +0 -6
- package/dist/chunk-QUPLVPB2.mjs +0 -7
- package/dist/chunk-R7BNENLY.mjs +0 -4
- package/dist/chunk-S6O4UHLC.mjs +0 -2
- package/dist/chunk-SGJWQKEI.mjs +0 -2
- package/dist/chunk-TX6JH7TR.mjs +0 -2
- package/dist/chunk-TYK6VNAB.mjs +0 -10
- package/dist/chunk-UALRNVSE.mjs +0 -4
- package/dist/chunk-V3HXVQEM.mjs +0 -2
- package/dist/chunk-V5VXUJKG.mjs +0 -2
- package/dist/chunk-VBXMADMP.mjs +0 -2
- package/dist/chunk-VNV55RUA.mjs +0 -2
- package/dist/chunk-VPD2PS35.mjs +0 -2
- package/dist/chunk-W4VKN3GF.mjs +0 -7
- package/dist/chunk-W5BXXPDJ.mjs +0 -3
- package/dist/chunk-XUNHRCOG.mjs +0 -6
- package/skill/references/building-components.md +0 -367
- package/web/assets/index-Bh74DfsV.css +0 -1
- package/web/assets/index-UW0RyFFt.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--font:ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--mono:"SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace;--sb-w:270px;--dur:.2s;--texPri:#2c2c2b;--texSec:#7d7a75;--texTer:#a19e99;--texAcc:#5f5e59;--texDis:#bcbab6;--icoPri:#5c5a55;--icoSec:#8e8b86;--sidIco:#91918e;--borPri:#e6e5e3;--borSec:#f0efed;--borPriTra:#1c13011c;--borStrTra:#1b150030;--crumbSep:#d4d3cf;--bacPri:#fff;--bacSec:#f9f8f7;--bacEle:#fff;--popBac:#fff;--sidBac:#f3f2ef;--pageBac:#fff;--galleryPageBac:#f8f8f7;--bacIntTra:#211b170d;--bacTerTra:#2a1c0012;--inputBac:#f2f1ee99;--codeBg:#f9f8f7;--blue:#2383e2;--blueLine:#2383e291;--blueBg:#2383e224;--bluBacIntTra:#0079e413;--select:#2383e224;--red:#eb5757;--star:#cb912f;--btnPriBg:#2383e224;--btnPriBgHi:#2383e238;--btnPriTex:#1a69bd;--btnDanBg:#eb575724;--btnDanBgHi:#eb575738;--btnDanTex:#c4403c;--overlay:#0f0f0f99;--tipBg:#0f0f0f;--tipTex:#f0efed;--tipSub:#a19e99;--scrollThumb:#2a1c0024;--shaOutLg:0px 20px 24px 0px #1919190d, 0px 5px 8px 0px #19191907, 0px 0px 0px 1px #2a1c0012;--gra-tx:#7d7a75;--gra-sw:#f0efed;--gra-bg:#2a1c0012;--gra-bd:#1c13011c;--bro-tx:#9f765a;--bro-sw:#f5ede9;--bro-bg:#8b2e0016;--bro-bd:#7f330028;--ora-tx:#d27b2d;--ora-sw:#fbebde;--ora-bg:#e0650121;--ora-bd:#c4580034;--yel-tx:#cb9434;--yel-sw:#f9f3dc;--yel-bg:#d3a80023;--yel-bd:#d19c0048;--gre-tx:#50946e;--gre-sw:#e8f1ec;--gre-bg:#00642d17;--gre-bd:#00602628;--blu-tx:#387dc9;--blu-sw:#e5f2fc;--blu-bg:#007cd718;--blu-bd:#0076d934;--pur-tx:#9a6bb4;--pur-sw:#f3ebf9;--pur-bg:#6600b214;--pur-bd:#5c00a324;--pin-tx:#c14c8a;--pin-sw:#fae9f1;--pin-bg:#c5005d16;--pin-bd:#b7004e27;--red-tx:#cf5148;--red-sw:#fce9e7;--red-bg:#df160018;--red-bd:#ce18002a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--texPri:#f0efed;--texSec:#ada9a3;--texTer:#7d7a75;--texAcc:#bcbab6;--texDis:#5f5e59;--icoPri:#a9a69e;--icoSec:#ada9a3;--sidIco:#9b9b9b;--borPri:#383836;--borSec:#2c2c2b;--borPriTra:#ffffeb1a;--borStrTra:#fffceb4e;--crumbSep:#383836;--bacPri:#191919;--bacSec:#202020;--bacEle:#202020;--popBac:#252525;--sidBac:#141413;--pageBac:#181818;--galleryPageBac:#181818;--bacIntTra:#ffffff0e;--bacTerTra:#fffff315;--bluBacIntTra:#4499ff1e;--inputBac:#ffffff0e;--codeBg:#ffffff08;--star:#d99e35;--overlay:#0f0f0fcc;--btnPriBg:#439bff3d;--btnPriBgHi:#439bff57;--btnPriTex:#7ab8ff;--btnDanBg:#ff685c3d;--btnDanBgHi:#ff685c57;--btnDanTex:#ff9a90;--tipBg:#2f2f2f;--tipTex:#f0efed;--tipSub:#9b9b9b;--scrollThumb:#fffff324;--shaOutLg:0px 0px 0px 1px #383836, 0px 14px 28px -6px #19191933, 0px 2px 4px -1px #1919191e;--gra-sw:#383836;--gra-bg:#ffffeb1a;--gra-bd:#ffffeb1a;--bro-sw:#45362d;--bro-bg:#ffb18131;--bro-bd:#ffb18131;--ora-sw:#53361f;--ora-bg:#ff934b47;--ora-bd:#ff934b47;--yel-sw:#504425;--yel-bg:#ffcd4b3d;--yel-bd:#ffcd4b3d;--gre-sw:#263d30;--gre-bg:#6cffac28;--gre-bd:#6cffac28;--blu-sw:#233850;--blu-bg:#439bff3d;--blu-bd:#439bff3d;--pur-sw:#3c2d47;--pur-bg:#c87dff33;--pur-bd:#c87dff33;--pin-sw:#4e2b3c;--pin-bg:#ff67b13b;--pin-bd:#ff67b13b;--red-sw:#502c29;--red-bg:#ff685c3d;--red-bd:#ff685c3d;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}:root[data-theme=dark]{--texPri:#f0efed;--texSec:#ada9a3;--texTer:#7d7a75;--texAcc:#bcbab6;--texDis:#5f5e59;--icoPri:#a9a69e;--icoSec:#ada9a3;--sidIco:#9b9b9b;--borPri:#383836;--borSec:#2c2c2b;--borPriTra:#ffffeb1a;--borStrTra:#fffceb4e;--crumbSep:#383836;--bacPri:#191919;--bacSec:#202020;--bacEle:#202020;--popBac:#252525;--sidBac:#141413;--pageBac:#181818;--galleryPageBac:#181818;--bacIntTra:#ffffff0e;--bacTerTra:#fffff315;--bluBacIntTra:#4499ff1e;--inputBac:#ffffff0e;--codeBg:#ffffff08;--star:#d99e35;--overlay:#0f0f0fcc;--btnPriBg:#439bff3d;--btnPriBgHi:#439bff57;--btnPriTex:#7ab8ff;--btnDanBg:#ff685c3d;--btnDanBgHi:#ff685c57;--btnDanTex:#ff9a90;--tipBg:#2f2f2f;--tipTex:#f0efed;--tipSub:#9b9b9b;--scrollThumb:#fffff324;--shaOutLg:0px 0px 0px 1px #383836, 0px 14px 28px -6px #19191933, 0px 2px 4px -1px #1919191e;--gra-sw:#383836;--gra-bg:#ffffeb1a;--gra-bd:#ffffeb1a;--bro-sw:#45362d;--bro-bg:#ffb18131;--bro-bd:#ffb18131;--ora-sw:#53361f;--ora-bg:#ff934b47;--ora-bd:#ff934b47;--yel-sw:#504425;--yel-bg:#ffcd4b3d;--yel-bd:#ffcd4b3d;--gre-sw:#263d30;--gre-bg:#6cffac28;--gre-bd:#6cffac28;--blu-sw:#233850;--blu-bg:#439bff3d;--blu-bd:#439bff3d;--pur-sw:#3c2d47;--pur-bg:#c87dff33;--pur-bd:#c87dff33;--pin-sw:#4e2b3c;--pin-bg:#ff67b13b;--pin-bd:#ff67b13b;--red-sw:#502c29;--red-bg:#ff685c3d;--red-bd:#ff685c3d;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}html{scrollbar-color:var(--scrollThumb) transparent}body{font-family:var(--font);background:var(--bacPri);color:var(--texPri);-webkit-font-smoothing:antialiased;font-size:16px;line-height:1.5;overflow:hidden}button{font:inherit;color:inherit;cursor:pointer;text-align:inherit;background:0 0;border:0;margin:0;padding:0}svg{fill:none;stroke:currentColor;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round;width:100%;height:100%;display:block}svg.fill{fill:currentColor;stroke:none}svg.solid{fill:currentColor}svg.lu{stroke-width:1.75px}.ic{display:contents}body.preload *{transition:none!important}@keyframes pop-in{0%{opacity:0;transform:translateY(-2px)}}.app{height:100dvh;font-size:14px;display:flex}.main{background:var(--bacPri);flex-direction:column;flex:1;min-width:0;font-size:16px;display:flex;position:relative}.icon-btn{width:28px;height:28px;color:var(--icoSec);border-radius:6px;flex:none;justify-content:center;align-items:center;transition:background 20ms ease-in;display:inline-flex}.icon-btn svg{width:20px;height:20px}.icon-btn svg.lu{width:18px;height:18px}.icon-btn:hover{background:var(--bacIntTra)}.ghost-btn{height:28px;color:var(--texTer);white-space:nowrap;border-radius:6px;align-items:center;gap:6px;padding:0 8px;font-size:14px;display:inline-flex}.ghost-btn svg{width:16px;height:16px}.ghost-btn:hover{background:var(--bacIntTra)}.ghost-btn.sm{height:24px}.row-act{width:20px;height:20px;color:var(--icoSec);border-radius:4px;flex:none;justify-content:center;align-items:center;display:flex}.row-act svg{width:16px;height:16px}.row-act:hover{background:var(--bacTerTra)}.pg-icon{width:20px;height:20px;color:var(--sidIco);flex:none;justify-content:center;align-items:center;font-size:16px;line-height:1;display:inline-flex}.pg-icon svg.lu{width:18px;height:18px}.pg-icon .page-icon{object-fit:cover;border-radius:3px;width:18px;height:18px;display:block}.pg-icon .page-icon.site-icon{object-fit:contain;border-radius:3px;width:16px;height:16px}.pg-icon .glyph-icon{background:currentColor;width:18px;height:18px;display:block;-webkit-mask:none 50%/contain no-repeat;mask:none 50%/contain no-repeat}.glyph-icon[data-icon$=_gray\.svg]{color:var(--lightningcss-light,#55534e)var(--lightningcss-dark,#d3d3d3)}.glyph-icon[data-icon$=_lightgray\.svg]{color:var(--lightningcss-light,#a6a299)var(--lightningcss-dark,#7f7f7f)}.glyph-icon[data-icon$=_brown\.svg]{color:var(--lightningcss-light,#9f6b53)var(--lightningcss-dark,#aa755f)}.glyph-icon[data-icon$=_yellow\.svg]{color:var(--lightningcss-light,#cb912f)var(--lightningcss-dark,#ca8e1b)}.glyph-icon[data-icon$=_orange\.svg]{color:var(--lightningcss-light,#d9730d)var(--lightningcss-dark,#d87620)}.glyph-icon[data-icon$=_green\.svg]{color:var(--lightningcss-light,#448361)var(--lightningcss-dark,#2d9964)}.glyph-icon[data-icon$=_blue\.svg]{color:var(--lightningcss-light,#337ea9)var(--lightningcss-dark,#2e7cd1)}.glyph-icon[data-icon$=_purple\.svg]{color:var(--lightningcss-light,#9065b0)var(--lightningcss-dark,#8d5bc1)}.glyph-icon[data-icon$=_pink\.svg]{color:var(--lightningcss-light,#c14c8a)var(--lightningcss-dark,#c94079)}.glyph-icon[data-icon$=_red\.svg]{color:var(--lightningcss-light,#d44c47)var(--lightningcss-dark,#cd4945)}.menu{z-index:1000;background:var(--popBac);min-width:240px;max-width:320px;box-shadow:var(--shaOutLg);-webkit-user-select:none;user-select:none;border-radius:10px;outline:none;padding:6px 0;font-size:14px;line-height:1.2;animation:.12s ease-out pop-in;position:fixed;top:0;left:0}.menu-head{color:var(--texSec);padding:6px 12px;font-size:12px;font-weight:500;line-height:14px}.menu-item{cursor:pointer;height:28px;color:var(--texPri);border-radius:6px;align-items:center;gap:8px;margin:0 4px 1px;padding:0 8px;display:flex}.menu:not(.controlled) .menu-item:hover,.menu-item.active{background:var(--bacIntTra)}.menu-item.danger:hover,.menu-item.danger.active{color:var(--red)}.menu-item.off,.menu-item.off:hover,.menu-item.off .mi-icon,.menu-item.off:hover .mi-icon{color:var(--texDis);cursor:default}.menu:not(.controlled) .menu-item.off:hover{background:0 0}.menu-item.danger:not(.off):hover .mi-icon,.menu-item.danger:not(.off).active .mi-icon{color:var(--red)}.mi-icon{width:20px;height:20px;color:var(--icoPri);flex:none;justify-content:center;align-items:center;display:flex}.mi-icon svg{width:18px;height:18px}.mi-icon svg.lu{width:16px;height:16px}.mi-label{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.mi-line{text-overflow:ellipsis;display:block;overflow:hidden}.mi-detail{color:var(--texTer);margin-top:2px;font-size:12px}.mi-kbd{max-width:45%;color:var(--texTer);white-space:nowrap;text-overflow:ellipsis;flex:none;margin-left:8px;font-size:12px;overflow:hidden}.mi-kbd:empty{display:none}.mi-arrow{width:16px;height:16px;color:var(--texTer);flex:none}.mi-arrow svg{stroke-width:1.6px}.mi-check{width:16px;height:16px;color:var(--texPri);flex:none}.mi-check svg{stroke-width:1.8px}.mi-switch{box-sizing:border-box;background:#8783784d;border-radius:44px;flex:none;align-items:center;width:28px;height:16px;margin-left:8px;padding:2px;transition:background .2s;display:flex;position:relative}.mi-switch.on{background:var(--blue)}.mi-switch>span{background:#fff;border-radius:50%;flex:none;width:12px;height:12px;transition:transform .2s ease-out;box-shadow:0 1px 2px #0f0f0f33}.mi-switch.on>span{transform:translate(12px)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .mi-switch:not(.on){background:#caccce4d}}:root[data-theme=dark] .mi-switch:not(.on){background:#caccce4d}.menu-sep{background:var(--bacTerTra);height:1px;margin:3px 12px 4px}.menu-foot{color:var(--texTer);padding:4px 12px 2px;font-size:12px;line-height:1.6}.menu-note{color:var(--texSec);padding:4px 12px 8px;font-size:13px;line-height:1.6}.menu-empty{color:var(--texTer);padding:8px 12px;font-size:13px}.menu-sub{min-width:180px}.menu-wide{width:320px}.pop-search{padding:2px 8px 6px}.pop-input{border:1px solid var(--borPriTra);background:var(--inputBac);width:100%;height:28px;color:var(--texPri);font:inherit;border-radius:6px;outline:none;padding:0 8px;font-size:14px}.pop-input:focus{border-color:var(--blue);box-shadow:0 0 0 1px var(--blue)}.pop-list{max-height:320px;overflow-y:auto}.trash-item{border-radius:6px;align-items:center;gap:8px;height:30px;margin:0 4px;padding:0 4px 0 8px;display:flex}.trash-item:hover{background:var(--bacIntTra)}.trash-item .t{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.tip{z-index:3000;pointer-events:none;background:var(--tipBg);max-width:260px;color:var(--tipTex);box-shadow:var(--shaOutLg);overflow-wrap:anywhere;opacity:0;border-radius:6px;padding:4px 8px;font-size:12px;font-weight:500;line-height:1.45;transition:opacity .1s;position:fixed;top:0;left:0}.tip.show{opacity:1}.tip .sub{color:var(--tipSub);font-weight:400}.toast{z-index:2500;background:var(--tipBg);width:fit-content;max-width:min(640px,100vw - 32px);color:var(--tipTex);box-shadow:var(--shaOutLg);opacity:0;pointer-events:none;border-radius:8px;align-items:center;gap:10px;margin:0 auto;padding:8px 14px;font-size:14px;transition:opacity .18s,transform .18s;display:flex;position:fixed;bottom:24px;left:0;right:0;transform:translateY(10px)}.toast.show{opacity:1;transform:none}.toast.show button{pointer-events:auto}.toast.error:before{content:"";background:#ff6b6b;border-radius:50%;flex:none;width:6px;height:6px}.toast button{white-space:nowrap;color:#5ea8f2;border-radius:4px;flex:none;margin-right:-6px;padding:2px 6px;font-weight:500}.toast button:hover{background:#ffffff14}.dialog-overlay{align-items:flex-start;padding-top:18vh}.dialog{background:var(--popBac);width:min(420px,100%);box-shadow:var(--shaOutLg);border-radius:12px;padding:20px 20px 16px;animation:.12s ease-out pop-in}.dialog-title{color:var(--texPri);font-size:16px;font-weight:600;line-height:1.4}.dialog-message{color:var(--texSec);margin-top:8px;font-size:14px;line-height:1.6}.dialog-actions{justify-content:flex-end;gap:8px;margin-top:18px;display:flex}.dialog-btn{height:32px;color:var(--texPri);white-space:nowrap;border-radius:6px;padding:0 14px;font-size:14px;transition:background 20ms ease-in}.dialog-btn:hover:not(:disabled){background:var(--bacIntTra)}.dialog-btn:focus-visible{background:var(--bacTerTra);outline:none}.dialog-btn.primary{background:var(--btnPriBg);color:var(--btnPriTex);font-weight:500}.dialog-btn.primary:hover:not(:disabled),.dialog-btn.primary:focus-visible{background:var(--btnPriBgHi)}.dialog-btn.danger.primary{background:var(--btnDanBg);color:var(--btnDanTex)}.dialog-btn.danger.primary:hover:not(:disabled),.dialog-btn.danger.primary:focus-visible{background:var(--btnDanBgHi)}.dialog-btn:disabled{opacity:.5;cursor:default}.modal{z-index:1500;background:var(--overlay);justify-content:center;align-items:flex-start;padding:12vh 16px 0;display:flex;position:fixed;inset:0}.search-panel{background:var(--popBac);width:min(620px,100%);box-shadow:var(--shaOutLg);border-radius:12px;animation:.12s ease-out pop-in;overflow:hidden}.search-bar{border-bottom:1px solid var(--borSec);align-items:center;gap:10px;height:52px;padding:0 16px;display:flex}.search-bar svg{width:20px;height:20px;color:var(--icoSec);flex:none}.search-bar input{min-width:0;color:var(--texPri);font:inherit;background:0 0;border:0;outline:0;flex:1;font-size:16px}.search-bar input::placeholder{color:var(--texTer)}.search-list{max-height:60vh;padding:4px 0 8px;overflow-y:auto}.search-item{cursor:pointer;border-radius:6px;align-items:center;gap:10px;height:36px;margin:0 6px;padding:0 10px;display:flex}.search-item.active{background:var(--bacIntTra)}.search-item .t{white-space:nowrap;text-overflow:ellipsis;flex:none;max-width:60%;overflow:hidden}.search-item .path{text-align:right;min-width:0;color:var(--texTer);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12px;overflow:hidden}.search-main{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.search-line{align-items:center;gap:10px;min-width:0;display:flex}.search-item.with-hit{align-items:flex-start;height:auto;min-height:36px;padding-top:6px;padding-bottom:6px}.search-item.with-hit .pg-icon{margin-top:1px}.search-snippet{min-width:0;color:var(--texSec);white-space:nowrap;text-overflow:ellipsis;font-size:13px;line-height:18px;overflow:hidden}.search-item.more{align-items:center;height:28px;min-height:0;padding:0 10px 0 40px}.search-item mark{color:var(--texPri);background:0 0;font-weight:600}.search-note{color:var(--texTer);padding:6px 16px 2px;font-size:12px}.link-view{background:var(--pageBac);flex:1;min-height:0;position:relative}.link-view.off,.link-pane.off{display:none}.link-pane{display:flex;position:absolute;inset:0}.link-frame{background:#fff;border:0;flex:1;width:100%;height:100%;display:block}.link-refused{flex:1}.link-refused-icon{width:36px;height:36px;color:var(--texTer);margin-bottom:6px}.link-refused-icon svg{width:36px;height:36px}.link-refused-url{word-break:break-all;max-width:min(560px,90%)!important;color:var(--texTer)!important;font-size:13px!important}.report-view{flex:1;min-height:0;position:relative}.report-frame{background:var(--pageBac);border:0;width:100%;height:100%;display:block}body.dragging iframe,body.resizing iframe{pointer-events:none}.report-state{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:6px;min-height:0;padding:24px;display:flex}.report-state h2{margin:0;font-size:20px;font-weight:600}.report-state p{max-width:460px;color:var(--texSec);margin:0;font-size:14px;line-height:1.6}.report-state .muted{color:var(--texTer)}.report-state-actions{gap:8px;margin-top:10px;display:flex}.report-frame[data-pending]{opacity:0;pointer-events:none;position:absolute;inset:0}.card-underlay{z-index:900;background:var(--overlay);animation:.16s ease-out card-underlay-fade;position:fixed;inset:0}body.card-open .sb-resizer,body.card-open .sb-edge{pointer-events:none}@keyframes card-underlay-fade{0%{opacity:0}}@media (prefers-reduced-motion:reduce){.card-underlay{animation:none}}.report-view.off{display:none}.xf-overlay{z-index:1500;background:var(--overlay);justify-content:center;align-items:center;padding:16px;display:flex;position:fixed;inset:0}.xf-export,.xf-import{background:var(--popBac);box-shadow:var(--shaOutLg);color:var(--texPri);border-radius:12px;animation:.12s ease-out pop-in}.xf-export{width:320px;max-width:100%;padding:24px;font-size:14px}.xf-row{justify-content:space-between;align-items:center;height:28px;display:flex}.xf-label{color:var(--texTer);white-space:nowrap;margin-inline-end:auto;line-height:21px}.xf-select{white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;height:28px;color:var(--texPri);border-radius:6px;align-items:center;gap:6px;margin-inline-end:-6px;padding:0 8px;line-height:1.2;transition:background 20ms ease-in;display:flex}.xf-select:hover,.xf-select.open{background:var(--bacIntTra)}.xf-select svg{width:14px;height:14px;color:var(--icoSec);stroke-width:1.6px}.xf-select:focus-visible,.xf-btn:focus-visible,.xf-choose:focus-visible{background:var(--bacTerTra);outline:none}.xf-switch:focus-visible{box-shadow:0 0 0 3px var(--blueBg);outline:none}.xf-scale-row{height:32px}.xf-scale{background:var(--inputBac);width:60px;height:28px;box-shadow:0 0 0 1px var(--borPriTra);color:var(--texPri);font:inherit;text-align:end;border:none;border-radius:6px;outline:none;padding:4px 10px;font-size:14px}.xf-scale:focus{box-shadow:0 0 0 1px var(--blue) inset, 0 0 0 1px var(--blue)}.xf-error{min-height:32px;color:var(--red);align-items:center;padding:4px 0;font-size:12px;line-height:16px;display:flex}.xf-switch-row{height:32px}.xf-switch-row .xf-label{line-height:20px}.xf-switch{box-sizing:content-box;cursor:pointer;background:#8783784d;border-radius:44px;flex-shrink:0;width:26px;height:14px;padding:2px;transition:background .2s,box-shadow .2s;display:flex;position:relative}.xf-switch.on{background:var(--blue)}.xf-switch>span{background:#fff;border-radius:44px;width:14px;height:14px;transition:transform .2s ease-out,background .2s ease-out}.xf-switch.on>span{transform:translate(12px)}.xf-switch.disabled{opacity:.4;cursor:default}@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .xf-switch:not(.on){background:#caccce4d}}:root[data-theme=dark] .xf-switch:not(.on){background:#caccce4d}.xf-actions{justify-content:flex-end;align-items:center;gap:8px;margin-top:16px;display:flex}.xf-btn{white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:6px;justify-content:center;align-items:center;height:28px;padding:0 8px;font-size:14px;line-height:1.2;transition:background 20ms ease-in;display:inline-flex}.xf-btn.gray{color:var(--texSec)}.xf-btn.gray:hover{background:var(--bacIntTra)}.xf-btn.blue{background:var(--btnPriBg);color:var(--btnPriTex);font-weight:500}.xf-btn.blue:hover,.xf-btn.blue:focus-visible{background:var(--btnPriBgHi)}.xf-btn[aria-disabled=true]{opacity:.4;pointer-events:none}.menu.menu-select{z-index:1600;width:180px;min-width:180px}.menu-select .mi-icon:empty{display:none}.xf-import{flex-direction:column;gap:14px;width:min(460px,100vw - 32px);padding:20px 20px 18px;font-size:14px;display:flex}.xf-import-head{flex-direction:column;gap:2px;min-width:0;display:flex}.xf-import-title{font-size:16px;font-weight:600;line-height:1.4}.xf-import-where{color:var(--texSec);white-space:nowrap;text-overflow:ellipsis;font-size:13px;line-height:1.5;overflow:hidden}.xf-drop{border:1px dashed var(--borStrTra);color:var(--texPri);cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:10px;flex-direction:column;align-items:center;gap:6px;padding:30px 16px 26px;transition:background .12s,border-color .12s;display:flex}.xf-drop:hover{background:var(--bacIntTra)}.xf-drop.dragging{border-color:var(--blue);background:var(--bluBacIntTra)}.xf-drop:focus-visible{background:var(--bacTerTra);outline:none}.xf-drop svg{width:28px;height:28px;color:var(--icoSec);stroke-width:1.4px;margin-bottom:4px;transition:color .12s}.xf-drop.dragging svg{color:var(--blue)}.xf-drop-main{line-height:20px}.xf-choose{color:var(--blue);margin-inline-start:2px}.xf-drop-kinds,.xf-import-note{color:var(--texTer);font-size:12px;line-height:16px}.pref-overlay{z-index:1500;background:var(--overlay);justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.pref-dialog{background:var(--bacPri);width:min(880px,100%);height:min(86vh,900px);box-shadow:var(--shaOutLg);border-radius:12px;flex-direction:column;animation:.12s ease-out pop-in;display:flex;overflow:hidden}.pref-head{border-bottom:1px solid var(--borSec);flex:none;align-items:center;gap:10px;height:48px;padding:0 12px 0 20px;display:flex}.pref-title{color:var(--texPri);flex:none;font-size:14px;font-weight:600}.pref-sub{white-space:nowrap;text-overflow:ellipsis;min-width:0;color:var(--texSec);flex:1;font-size:13px;overflow:hidden}.pref-actions{flex:none;align-items:center;gap:4px;display:flex}.pref-save{height:28px;color:var(--btnPriTex);background:var(--btnPriBg);white-space:nowrap;border-radius:6px;flex:none;padding:0 10px;font-size:14px;font-weight:500}.pref-save:hover:not(:disabled),.pref-save:focus-visible{background:var(--btnPriBgHi);outline:none}.pref-save:disabled{opacity:.5;cursor:default}.pref-note{border-bottom:1px solid var(--borSec);background:var(--bacSec);color:var(--texSec);overflow-wrap:anywhere;flex:none;padding:8px 20px;font-size:13px;line-height:1.5}.pref-body{background:var(--bacPri);flex:1;min-height:0;position:relative}.pref-frame{background:var(--pageBac);border:0;width:100%;height:100%;position:absolute;inset:0}.pref-frame[data-pending]{opacity:0;pointer-events:none}.pref-loading{opacity:0;height:2px;animation:.2s ease-out .3s forwards pref-loading-in;position:absolute;top:0;left:0;right:0;overflow:hidden}.pref-loading:before{content:"";background:var(--borStrTra);border-radius:1px;width:24%;animation:1.6s ease-in-out infinite pref-loading-pass;position:absolute;top:0;bottom:0;left:0}@keyframes pref-loading-in{to{opacity:1}}@keyframes pref-loading-pass{0%{transform:translate(-100%)}to{transform:translate(417%)}}@media (prefers-reduced-motion:reduce){.pref-loading:before{width:100%;animation:none}}.comp-dialog{width:min(640px,100%);height:min(86vh,720px)}.comp-body{flex:1;min-height:0;padding:4px 20px 20px;overflow-y:auto}.comp-group{color:var(--texPri);margin:16px 0 4px;font-size:14px;font-weight:600}.comp-lead,.comp-empty{color:var(--texSec);padding:4px 0 8px;font-size:13px;line-height:1.5}.comp-problem{color:var(--texPri);margin-top:12px;font-size:13px;line-height:1.5}.comp-row{border-top:1px solid var(--borSec);align-items:center;gap:16px;padding:8px 0;display:flex}.comp-row.comp-block{gap:8px;padding:6px 0}.comp-icon{width:20px;height:20px;color:var(--icoPri);flex:none;justify-content:center;align-items:center;display:flex}.comp-icon svg{stroke-width:1.25px;width:20px;height:20px}.comp-name{min-width:0;color:var(--texPri);overflow-wrap:anywhere;flex:1;font-size:14px;line-height:20px}.comp-row.comp-pkg{padding:0;display:block}.comp-line{border-radius:6px;align-items:center;gap:8px;margin:0 -8px;padding:2px 8px;display:flex}.comp-line:hover{background:var(--bacIntTra)}.comp-head{text-align:left;min-width:0;min-height:28px;font:inherit;color:inherit;cursor:pointer;background:0 0;flex:1;align-items:center;gap:8px;padding:0;display:flex}.comp-head .comp-name{flex:0 auto}.comp-chev{width:14px;height:14px;color:var(--texTer);flex:none}.comp-chev svg{stroke-width:1.6px;transition:transform .15s ease-out}.comp-row[data-open] .comp-chev svg{transform:rotate(90deg)}.comp-tag{color:var(--texTer);flex:none;margin-left:auto;padding-left:8px;font-size:12px}.comp-detail{flex-direction:column;gap:2px;padding:0 0 10px 28px;display:flex}.comp-meta{max-width:100%;color:var(--texTer);overflow-wrap:anywhere;font-size:12px;line-height:18px;display:block}.comp-note{color:var(--texSec);overflow-wrap:anywhere;font-size:13px;line-height:18px}.comp-state{color:var(--texTer)}.comp-opts{flex-direction:column;margin-top:6px;display:flex}.comp-opt{text-align:left;font:inherit;color:inherit;cursor:pointer;background:0 0;border-radius:6px;align-items:center;gap:16px;margin:0 -8px;padding:6px 8px;display:flex}.comp-opt:hover{background:var(--bacIntTra)}.comp-opt-text{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.comp-opt .comp-toggle-name{color:var(--texPri);font-size:14px;line-height:20px}.comp-opt-hint{color:var(--texSec);overflow-wrap:anywhere;font-size:13px;line-height:18px}.comp-opt .mi-switch{margin:0}.comp-opt[aria-disabled=true]{cursor:default;opacity:.5}.comp-opt[aria-disabled=true]:hover{background:0 0}.comp-packs{grid-template-columns:repeat(auto-fill,minmax(176px,1fr));gap:8px;margin:4px 0 8px;display:grid}.comp-pack{background:var(--bacIntTra);border-radius:10px;align-items:center;gap:8px;min-height:64px;padding:0 12px 0 0;display:flex;position:relative}.comp-pack:hover{background:var(--bacTerTra)}.comp-pack-open{text-align:left;min-width:0;font:inherit;color:inherit;cursor:pointer;background:0 0;border-radius:10px 0 0 10px;flex:1;align-self:stretch;align-items:center;gap:10px;padding:10px 0 10px 12px;display:flex}.comp-pack-open:focus-visible,.comp-pack-add:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}.comp-pack-icon{background:var(--bacPri);width:32px;height:32px;color:var(--icoPri);border-radius:8px;flex:none;justify-content:center;align-items:center;font-size:18px;line-height:1;display:flex}.comp-pack-icon svg{stroke-width:1.25px;width:18px;height:18px}.comp-pack-words{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.comp-pack-name{color:var(--texPri);white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:500;line-height:20px;overflow:hidden}.comp-pack-meta{min-width:0;color:var(--texTer);white-space:nowrap;text-overflow:ellipsis;gap:8px;font-size:12px;line-height:16px;display:flex;overflow:hidden}.comp-pack-author{text-overflow:ellipsis;min-width:0;overflow:hidden}.comp-pack[data-off] .comp-pack-name{color:var(--texSec)}.comp-pack-add{font:inherit;color:var(--texSec);cursor:pointer;justify-content:center;padding:0 12px}.comp-pack-add .comp-pack-icon{width:20px;height:20px;color:var(--texSec);background:0 0}.comp-pack-add .comp-pack-icon svg{stroke-width:1.6px;width:16px;height:16px}.comp-pack-add .comp-pack-name{color:var(--texSec);flex:none;font-weight:400}.comp-pack-add[aria-expanded=true]{background:var(--bacTerTra)}.comp-import{flex-direction:column;align-items:flex-start;gap:4px;margin:0 0 8px;display:flex}.comp-import-row{align-items:center;gap:8px;width:100%;display:flex}.comp-import-row .pop-input{flex:1;min-width:0}.comp-import-row .dialog-btn{flex:none;height:28px;padding:0 12px;font-size:13px}.comp-import-pick{height:24px;font:inherit;color:var(--texSec);cursor:pointer;background:0 0;border-radius:6px;margin:0 -6px;padding:0 6px;font-size:13px}.comp-import-pick:hover:not(:disabled){background:var(--bacIntTra)}.comp-import-error{color:var(--red);overflow-wrap:anywhere;font-size:13px;line-height:1.5}.comp-back{height:26px;font:inherit;color:var(--texSec);cursor:pointer;background:0 0;border-radius:6px;align-items:center;gap:4px;margin:0 0 6px -6px;padding:0 8px 0 6px;font-size:13px;display:inline-flex}.comp-back:hover{background:var(--bacIntTra)}.comp-pack-head{align-items:center;gap:10px;padding:2px 0 6px;display:flex}.comp-pack-view>.comp-note{margin-bottom:6px}.comp-pack-view .comp-lead{padding-top:6px}.comp-toggle{cursor:pointer;background:0 0;flex:none;align-items:center;height:24px;padding:0;display:flex}.comp-toggle .mi-switch{margin:0}.comp-toggle[aria-disabled=true]{cursor:default;opacity:.5}.present{z-index:2000;background:var(--bacPri);position:fixed;inset:0}.present-frame{background:var(--pageBac);transform-origin:0 0;border:0;width:100%;height:100%;position:absolute;top:0;left:0}.present-ink{pointer-events:none;touch-action:none;width:100%;height:100%;position:absolute;inset:0}.present:is([data-tool=laser],[data-tool=pen],[data-tool=marker],[data-tool=eraser]) .present-ink{pointer-events:auto}.present[data-tool=laser] .present-ink{cursor:none}.present[data-tool=pen] .present-ink{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='4' fill='%23e03e3e' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 8 8,crosshair}.present[data-tool=marker] .present-ink{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Crect x='3' y='3' width='16' height='16' rx='5' fill='rgba(255,204,0,.55)' stroke='rgba(120,90,0,.55)' stroke-width='1'/%3E%3C/svg%3E") 11 11,crosshair}.present[data-tool=eraser] .present-ink{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='10' fill='rgba(140,140,140,.28)' stroke='rgba(110,110,110,.9)' stroke-width='1.5'/%3E%3C/svg%3E") 12 12,default}.present-notice{background:var(--tipBg);color:var(--tipTex);box-shadow:var(--shaOutLg);white-space:nowrap;pointer-events:none;border-radius:8px;padding:8px 14px;font-size:14px;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}.present-bar{background:var(--popBac);box-shadow:var(--shaOutLg);border-radius:10px;align-items:center;gap:2px;padding:4px;transition:opacity .3s;display:flex;position:absolute;bottom:16px;left:16px}.present-bar.idle{opacity:.25}.present-btn{width:32px;height:32px;color:var(--icoPri);border-radius:6px;justify-content:center;align-items:center;display:flex}.present-btn:hover{background:var(--bacIntTra)}.present-btn[aria-pressed=true]{background:var(--bacTerTra);color:var(--texPri)}.present-btn:disabled{opacity:.35;pointer-events:none}.present-btn svg{width:18px;height:18px}.present-sep{background:var(--borSec);flex:none;width:1px;height:18px;margin:0 4px}.present-zoom{min-width:48px;height:32px;color:var(--texPri);font-variant-numeric:tabular-nums;text-align:center;border-radius:6px;flex:none;padding:0 4px;font-size:13px}.present-zoom:hover{background:var(--bacIntTra)}.present-ink{mix-blend-mode:multiply}:root[data-theme=dark] .present-ink{mix-blend-mode:screen}@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .present-ink{mix-blend-mode:screen}}body:has(.present) .toast{display:none}.sb-container{z-index:20;width:var(--sb-w);background:var(--sidBac);transition:width var(--dur) ease;flex:none;position:relative}.sb-container.collapsed{width:0}.sb-anchor{z-index:9;width:0;position:absolute;top:0;bottom:0;left:0}.sidebar{width:var(--sb-w);height:100%;transition-property:width,opacity,transform,visibility;transition-duration:var(--dur);flex-direction:column;transition-timing-function:ease;display:flex;position:relative}.sidebar .float-bg{z-index:-1;background:var(--sidBac);box-shadow:var(--shaOutLg);border-radius:0 14px 14px 0;display:none;position:absolute;inset:0}.sb-inner{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.sidebar.floating{height:calc(100vh - 91px);transform:translateX(calc(20px - var(--sb-w))) translateY(59px);opacity:0;visibility:hidden;pointer-events:none}.sidebar.floating .float-bg{display:block}.sidebar.floating .sb-inner{border-radius:0 14px 14px 0}.sidebar.floating:before{content:"";height:15px;position:absolute;top:-15px;left:0;right:0}.sidebar.floating.peek{opacity:1;visibility:visible;pointer-events:auto;transform:translate(0)translateY(59px)}.sidebar.mobile{height:auto;width:min(var(--sb-w), 86vw);visibility:hidden;pointer-events:none;position:fixed;top:0;bottom:0;left:0;transform:translate(-100%)}.sidebar.mobile .float-bg{display:block}.sidebar.mobile .sb-inner{border-radius:0 14px 14px 0}.sidebar.mobile.mobile-open{visibility:visible;pointer-events:auto;transform:none}.sb-backdrop{z-index:1;background:var(--overlay);display:none;position:fixed;inset:0}.sb-backdrop.show{display:block}.sb-edge{z-index:8;width:32px;display:none;position:fixed;top:44px;bottom:0;left:0}.app.peekable .sb-edge{display:block}.sb-resizer{cursor:col-resize;z-index:10;width:12px;position:absolute;top:0;bottom:0;right:-11px}.sb-resizer:after{content:"";background:0 0;width:2px;transition:background .15s;position:absolute;top:0;bottom:0;left:-1px}.sb-resizer:hover:after,body.resizing .sb-resizer:after{background:var(--borStrTra)}body.resizing,body.resizing *{cursor:col-resize!important;-webkit-user-select:none!important;user-select:none!important}body.resizing .sb-container,body.resizing .sidebar{transition:none!important}.sb-head{flex-direction:column;flex:none;gap:1px;padding:8px 8px 4px;transition:box-shadow .15s;display:flex}.sb-head.scrolled{box-shadow:0 1px 0 var(--borSec)}.sb-top{align-items:center;gap:5px;height:28px;margin-bottom:7px;padding-left:5px;display:flex}.sidebar.floating .sb-top{display:none}.sb-brand{white-space:nowrap;min-width:0;color:var(--texPri);cursor:default;-webkit-user-select:none;user-select:none;font-family:Iowan Old Style,Palatino Linotype,Palatino,Book Antiqua,Georgia,serif;font-size:19px;font-weight:400;line-height:28px;overflow:hidden}.sb-act{min-width:0;height:30px;color:var(--texSec);text-align:left;border-radius:6px;align-items:center;gap:8px;padding:0 8px;font-size:14px;font-weight:500;transition:background 20ms ease-in;display:flex}.sb-act:hover{background:var(--bacIntTra)}.sb-act-icon{width:22px;height:20px;color:var(--sidIco);flex:none;justify-content:center;align-items:center;display:flex}.sb-act-icon svg{width:18px;height:18px}.sb-act-label{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.sb-brand.home{cursor:pointer}.sb-pages{flex-direction:column;gap:1px;margin-top:3px;display:flex}.sb-page{cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.sb-act.selected{background:var(--bacIntTra);color:var(--texPri)}.sb-act.selected:hover,.sb-act.menu-open,.sb-page:focus-visible{background:var(--bacTerTra)}.sb-page .pg-icon{justify-content:center;align-items:center;width:20px;height:20px;display:flex}.sb-page.renaming{cursor:default}.sb-page .row-rename{margin:0 -2px 0 -6px;font-weight:400}.sb-scroll{scrollbar-width:thin;scrollbar-color:var(--scrollThumb) transparent;flex:1;min-height:0;padding:6px 0 12px;position:relative;overflow:hidden auto}.section{margin:0 8px 4px}.section.expanded{padding-bottom:12px}.sec-head{-webkit-user-select:none;user-select:none;align-items:center;height:30px;padding:0 2px;display:flex}.sec-toggle{border-radius:6px;flex:0 auto;align-items:center;gap:2px;min-width:0;height:22px;padding:0 4px 0 6px;display:inline-flex}.sec-text{white-space:nowrap;text-overflow:ellipsis;min-width:0;line-height:16px;overflow:hidden}.sec-toggle:hover,.sec-head.menu-open .sec-toggle{background:var(--bacIntTra)}.sec-label{color:var(--texTer);font-size:12px;font-weight:500;line-height:16px}.sec-chev{width:12px;height:12px;color:var(--texTer);opacity:0;flex:none;transition:opacity .1s}.sec-chev svg{stroke-width:1.8px;transition:transform .2s ease-out}.section.expanded .sec-chev svg{transform:rotate(90deg)}.sec-toggle:hover .sec-chev,.sec-head.menu-open .sec-chev{opacity:1}.tree{margin-top:1px}.row{height:30px;padding:5px 8px 5px calc(8px + var(--depth,0) * 8px);cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--texAcc);border-radius:6px;align-items:center;margin-bottom:1px;font-size:14px;display:flex;position:relative}.row:hover,.row.menu-open{background:var(--bacIntTra)}.row.selected{background:var(--bacIntTra);color:var(--texPri)}.row.selected:hover,.row.selected.menu-open{background:var(--bacTerTra)}.row-icon{flex:none;justify-content:center;align-items:center;width:22px;height:20px;margin-right:8px;display:flex;position:relative}.row-chevron{width:20px;height:20px;color:var(--texTer);opacity:0;border-radius:4px;justify-content:center;align-items:center;display:flex;position:absolute;top:0;left:1px}.row-chevron svg{stroke-width:1.8px;width:12px;height:12px;transition:transform .2s ease-out}.node.open>.row .row-chevron svg{transform:rotate(90deg)}.row.has-kids:hover .row-chevron{opacity:1}.row.has-kids:hover .pg-icon{opacity:0}.row-chevron:hover{background:var(--bacTerTra)}.row-title{white-space:nowrap;text-overflow:ellipsis;flex:0 auto;min-width:0;line-height:21px;overflow:hidden}.row-actions{flex:none;align-items:center;gap:2px;margin-left:auto;padding-left:4px;display:none}.row:hover .row-actions,.row.menu-open .row-actions{display:flex}.row.renaming{cursor:default}.row.renaming .row-actions{display:none}.row-rename{background:var(--inputBac);min-width:0;height:24px;color:var(--texPri);font:inherit;box-shadow:inset 0 0 0 1px var(--blueLine), 0 0 0 2px var(--blueBg);border:0;border-radius:4px;outline:none;flex:1;margin:0 -2px 0 -6px;padding:0 6px;font-size:14px}@media (hover:none){.row.has-kids .row-chevron{opacity:1}.row.has-kids .pg-icon{opacity:0}}body.dragging,body.dragging *{cursor:grabbing!important;-webkit-user-select:none!important;user-select:none!important}body.dragging .row:not(.selected):hover{background:0 0}body.dragging .row-actions{display:none!important}body.dragging .row:hover .row-chevron{opacity:0}body.dragging .row:hover .pg-icon{opacity:1}.row.drag-src{opacity:.4}.row.drop-inside{background:var(--blueBg)!important}.drop-line{background:var(--blueLine);pointer-events:none;z-index:5;border-radius:2px;height:3px;display:none;position:absolute}.drop-line.show{display:block}.drag-ghost{z-index:3000;pointer-events:none;background:var(--popBac);height:30px;color:var(--texPri);box-shadow:var(--shaOutLg);opacity:.9;white-space:nowrap;border-radius:6px;align-items:center;gap:8px;padding:0 10px 0 8px;font-size:14px;display:flex;position:fixed;top:0;left:0;overflow:hidden}.drag-ghost .t{text-overflow:ellipsis;overflow:hidden}.sb-foot{flex:none;align-items:center;gap:4px;height:44px;padding:0 8px;display:flex}.ws-btn{min-width:0;height:28px;color:var(--texSec);text-align:left;border-radius:6px;flex:1;align-items:center;gap:8px;padding:0 6px 0 8px;font-size:14px;font-weight:500;display:flex}.ws-btn svg{width:18px;height:18px;color:var(--sidIco);flex:none}.ws-btn:hover,.ws-btn.menu-open{background:var(--bacIntTra)}.ws-name{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}@media (width<=768px){.sb-resizer{display:none}}.sb-note{color:var(--texTer);margin:4px 16px;font-size:13px}.sb-note.inset{margin:2px 8px 4px;padding-left:8px}.ws-dot{background:var(--texDis);border-radius:50%;flex:none;width:7px;height:7px}.ws-dot.ready{background:var(--gre-tx)}.ws-dot.loading{background:var(--yel-tx)}.ws-dot.offline,.ws-dot.error{background:var(--red-tx)}.sb-new-line{flex-direction:column;display:flex;position:relative}.sec-head{position:relative}.sec-actions{flex:none;align-items:center;gap:2px;margin-left:auto;padding-left:4px;padding-right:6px;display:none}.sec-head:hover .sec-actions,.sec-head.menu-open .sec-actions{display:flex}.sec-head .row-rename{flex:none;width:calc(100% - 8px);height:24px;margin:0 4px;font-size:12px}body.dragging .sec-actions{display:none!important}.section.drag-src{opacity:.4}.sb-empty{height:26px;margin:2px 0 4px;padding:0 8px 0 38px;line-height:26px}.sb-ext-note{overflow-wrap:anywhere;line-height:1.5}.row-tag{min-width:0;color:var(--texTer);white-space:nowrap;text-align:right;text-overflow:ellipsis;flex:1 1 0;padding-left:6px;font-size:12px;overflow:hidden}.row:hover .row-tag,.row.menu-open .row-tag{display:none}.link-form{padding:0 0 2px}.link-field{padding:2px 12px 6px;display:block}.link-label{color:var(--texSec);margin-bottom:4px;font-size:12px;display:block}.link-error{color:var(--red);margin:0 12px 6px;font-size:13px;line-height:1.5}.link-actions{justify-content:flex-end;gap:8px;padding:6px 12px 4px;display:flex}.link-actions .dialog-btn{height:28px;padding:0 12px;font-size:13px}.row.missing .row-title,.row.missing .pg-icon{color:var(--texTer);opacity:.7}.sec-above{color:var(--texTer);margin-left:4px;font-size:12px;font-weight:400;line-height:16px}.project-form{padding:0 0 2px}.project-path{align-items:center;gap:8px;padding:2px 12px 8px;display:flex}.project-path .pop-input{flex:1;min-width:0}.project-path .dialog-btn{flex:none;height:28px;padding:0 12px;font-size:13px}.project-list{border-top:1px solid var(--borSec);scrollbar-width:thin;scrollbar-color:var(--scrollThumb) transparent;max-height:300px;padding:4px 6px;overflow-y:auto}.project-row{height:30px;padding:5px 8px 5px calc(4px + var(--depth,0) * 8px);cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--texAcc);border-radius:6px;align-items:center;gap:8px;margin-bottom:1px;font-size:14px;display:flex}.project-row:hover{background:var(--bacIntTra)}.project-row.selected{background:var(--bacIntTra);color:var(--texPri)}.project-row.selected:hover{background:var(--bacTerTra)}.project-toggle{width:20px;height:20px;color:var(--texTer);border-radius:4px;flex:none;justify-content:center;align-items:center;display:flex}.project-toggle:hover:not(:disabled){background:var(--bacTerTra)}.project-toggle svg{stroke-width:1.8px;width:12px;height:12px;transition:transform .2s ease-out}.project-toggle[aria-expanded=true] svg{transform:rotate(90deg)}.project-toggle:disabled{visibility:hidden}.project-row .mi-icon{color:var(--sidIco)}.project-document{padding-left:calc(4px + 28px + var(--depth,0) * 8px)}.project-above{color:var(--texTer);margin-left:6px;font-size:12px;font-weight:400}.project-count{color:var(--texTer);flex:none;font-size:12px}.tb-right .icon-btn.annot-open,.tb-right .icon-btn.annot-open:hover{background:var(--bacTerTra)}.menu.annot-list{width:320px;margin-top:4px}.annot-list .menu-scroll{max-height:384px;overflow-y:auto}.annot-list .menu-scroll .menu-item{height:44px}.annot-list .menu-scroll .mi-icon{display:none}.topbar{background:var(--bacPri);z-index:5;flex:none;align-items:center;gap:8px;height:44px;padding:0 12px;display:flex;position:relative}.topbar.tb-page{background:var(--galleryPageBac)}.tb-left{flex:1;align-items:center;min-width:0;display:flex}.tb-menu{color:var(--icoPri);margin:0 4px 0 1px;display:none}.app.sb-collapsed .tb-menu{display:inline-flex}.crumbs{align-items:center;min-width:0;display:flex;overflow:hidden}.crumb-wrap{display:contents}.crumb{white-space:nowrap;min-width:0;max-width:220px;height:24px;color:var(--texPri);border-radius:6px;align-items:center;gap:6px;padding:2px 6px;font-size:14px;display:inline-flex}.crumb:hover{background:var(--bacIntTra)}.crumb .t{text-overflow:ellipsis;overflow:hidden}.crumb .emoji{font-size:14px;line-height:1}.crumb.crumb-rename{width:220px;padding:0}.crumb-rename .row-rename{margin:0}.crumb-sep{color:var(--crumbSep);-webkit-user-select:none;user-select:none;flex:none;margin:0 1px;font-size:13px}.crumb-pop{z-index:1000;background:var(--popBac);width:180px;max-height:calc(100vh - 16px);box-shadow:var(--shaOutLg);-webkit-user-select:none;user-select:none;scrollbar-width:thin;scrollbar-color:var(--scrollThumb) transparent;border-radius:10px;flex-direction:column;gap:1px;padding:4px;font-size:14px;line-height:1.2;display:flex;position:fixed;top:0;left:0;overflow-y:auto}.crumb-pop-head{color:var(--texSec);white-space:nowrap;flex:none;margin:6px 0 8px;padding:0 8px;font-size:12px;font-weight:500}.crumb-pop-item{cursor:pointer;height:28px;color:var(--texPri);border-radius:6px;flex:none;align-items:center;gap:8px;padding:0 8px;display:flex}.crumb-pop-item:hover,.crumb-pop-item.open,.crumb-pop-item.trigger{background:var(--bacIntTra)}.crumb-pop-item.current{background:var(--bluBacIntTra)}.crumb-pop-item .t{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.crumb-pop-item.more{color:var(--texSec)}.crumb-pop-arrow{width:16px;height:16px;color:var(--texDis);flex:none}.crumb-pop-arrow svg{stroke-width:1.8px}.tb-right{flex:none;align-items:center;gap:2px;display:flex}.tb-right .icon-btn{color:var(--icoPri)}.tb-right .icon-btn.on{color:var(--star)}.tb-right .icon-btn.menu-open{background:var(--bacIntTra)}.edited{color:var(--texTer);white-space:nowrap;margin-right:8px;font-size:14px}@media (width<=1000px){.edited{display:none}}.session-badge{white-space:nowrap;border-radius:10px;flex:none;margin-left:8px;padding:1px 8px;font-size:12px;line-height:20px}.session-badge.muted{color:var(--texTer)}.session-badge.warn{color:var(--ora-tx);background:var(--ora-bg)}.session-badge.danger{color:var(--red-tx);background:var(--red-bg)}.menu.look-menu{width:224px;max-width:none;padding-bottom:8px}.look-fonts,.look-row{gap:4px;padding:0 8px;display:flex}.look-fonts{margin-bottom:4px}.look-font,.look-option{min-width:0;color:var(--texPri);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;flex:1 1 0;transition:background 20ms ease-in}.look-font{flex-direction:column;align-items:center;padding:8px 4px 6px;display:flex}.look-glyph{white-space:nowrap;height:30px;font-size:24px;line-height:30px}.look-caption{color:var(--texSec);white-space:nowrap;text-overflow:ellipsis;max-width:100%;margin-top:2px;font-size:12px;line-height:16px;overflow:hidden}.look-option{white-space:nowrap;justify-content:center;align-items:center;height:28px;padding:0 4px;font-size:14px;display:flex}.look-font:hover,.look-option:hover{background:var(--bacIntTra)}.look-row.look-off .look-option{opacity:.45}.look-font.on .look-glyph,.look-option.on{color:var(--blue)}.look-font:focus-visible,.look-option:focus-visible{background:var(--bacTerTra);outline:none}.look-menu .menu-sep{margin:8px 12px 4px}.link-crumb{cursor:default}.link-crumb:hover{background:0 0}.link-crumb .pg-icon{flex:none;justify-content:center;align-items:center;width:18px;height:18px;display:flex}.link-crumb .pg-icon svg,.link-crumb .pg-icon img{width:16px;height:16px}.tb-open{color:var(--texSec);margin-right:2px}
|
package/web/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Gallery</title>
|
|
7
7
|
<link rel="icon" href="data:," />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BK2e_07w.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CWFI83mF.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="preload">
|
|
12
12
|
<div id="root"></div>
|
package/dist/chunk-3HIRPVLU.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
import{b as a,g as c,h as m}from"./chunk-5ZKJ3H4P.mjs";import{b as r,f as i,i as l}from"./chunk-NSKUTQ5J.mjs";import"./chunk-5L7RYZCL.mjs";import{reportsDirectory as p}from"../browser/shared/paths.mjs";var f=5e3;async function h(u){let{positional:e,options:w}=i({options:["--no-browser"],argv:u});if(e.length>1)throw new r("Name one document at most.");let{slug:n=null,block:g=null}=e.length?await l(e[0]):{};console.log(`\u5DE5\u4F5C\u533A\uFF1A${p}`);let o=await c({slug:n,baseline:n!==null});if(o.ok||console.error(o.message),n!==null&&o.reason!=="missing"){let{roundBegins:s}=await import("./chunk-CEH4MRCC.mjs");await s(n,o.ok?{}:{wait:f})}o.ok||process.exit(1);let t=await m(n,o,g);for(let s of t)console.log(s);console.log(await a(t,w))}export{h as run};
|
package/dist/chunk-5MHMDLZD.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
import{a as d,b as m,d as f}from"./chunk-64K7IPLO.mjs";import{readFileSync as $,realpathSync as O}from"node:fs";import l from"node:path";import{fileURLToPath as k}from"node:url";var x=l.dirname(k(import.meta.url));function g(t=x){for(let e=t;;e=l.dirname(e)){try{let i=JSON.parse($(l.join(e,"package.json"),"utf8"));if(i.name==="@heycys/gallery")return i.version}catch{}if(l.dirname(e)===e)return"0.0.0"}}var y={init:()=>import("./chunk-U6KNPJPR.mjs"),new:()=>import("./chunk-VBXMADMP.mjs"),import:()=>import("./chunk-XUNHRCOG.mjs"),open:()=>import("./chunk-3HIRPVLU.mjs"),serve:()=>import("./chunk-XNROSH2T.mjs"),stop:()=>import("./chunk-TMYZB6AV.mjs"),check:()=>import("./chunk-V5VXUJKG.mjs"),export:()=>import("./chunk-DKXG4XDG.mjs"),qa:()=>import("./chunk-JPOSLGOC.mjs"),list:()=>import("./chunk-V3HXVQEM.mjs"),move:()=>import("./chunk-LS4F7JUM.mjs"),set:()=>import("./chunk-W5BXXPDJ.mjs"),component:()=>import("./chunk-AJ73XJF3.mjs"),skill:()=>import("./chunk-BXO2ZY5P.mjs")},E=new Set(["stop","init","skill"]),S=(t,e)=>`${t.split(`
|
|
3
|
-
`)[0]} (gallery ${e?`${e} --help`:"help"} says more)`,w=t=>/^--.|^-[A-Za-z]/.test(t);function j(t){let e=t.indexOf("--"),i=e===-1?t:t.slice(0,e),u=e===-1?[]:t.slice(e),n=[],s=null;for(let o=0;o<i.length;o++){let r=i[o];if(r==="--workspace"||r.startsWith("--workspace=")){let a=r.includes("=")?r.slice(r.indexOf("=")+1):o+1<i.length&&!w(i[o+1])?i[++o]:"";if(!a)return{error:"--workspace takes a folder: --workspace <dir>",usage:f};if(s!==null&&l.resolve(s)!==l.resolve(a))return{error:`Two workspaces named: ${s} and ${a}.`,usage:f};s=a;continue}n.push(r)}if(n[0]==="--version"||n[0]==="-v"||n[0]==="-V")return n.length===1&&u.length===0?{version:!0}:{error:"--version takes nothing else.",usage:f};if(n.length===0||n[0]==="help"||n[0]==="--help"||n[0]==="-h"){let o=n[0]==="help"?n[1]:void 0;return o===void 0?{help:f}:Object.hasOwn(m,o)?{help:m[o]}:{error:`No such command: ${o} (${d.join(", ")}).`,usage:f}}let[c,...p]=n;if(!Object.hasOwn(y,c))return{error:w(c)?`Unknown option: ${c} (the command comes first: gallery <command> [options]).`:`No such command: ${c} (${d.join(", ")}).`,usage:f};let h=[...p,...u];if(p.some(o=>o==="--help"||o==="-h"))return{help:m[c]};if(c==="init"){let o=new Set(["--from"]),r=[];for(let a=0;a<p.length;a++)o.has(p[a])?a++:w(p[a])||r.push(p[a]);if(r.push(...u.slice(1)),r.length>1)return{error:"Name one folder at most.",usage:m.init,command:c};if(r.length===1){if(s!==null&&l.resolve(s)!==l.resolve(r[0]))return{error:`Two workspaces named: ${r[0]} and --workspace ${s}.`,usage:m.init,command:c};s=r[0]}}return{command:c,argv:h,flag:s}}var N=(t,e)=>`Cannot write the workspace ${t} (${e}): allow Gallery to write there, or pass --workspace <a folder you may write>.`,A=(t,e=!0)=>e?`${l.join(t,"gallery.json")} is not Gallery's (another program's file of that name): pass --workspace <another folder> for Gallery's documents.`:`${l.join(t,"gallery.json")} does not read as JSON: mend the file, or pass --workspace <another folder> for Gallery's documents.`;async function G(t=process.argv.slice(2)){process.stdout.on("error",o=>{throw o.code==="EPIPE"&&process.exit(process.exitCode??0),o});let e=j(t);if(e.version)return void console.log(g());if(e.help)return void console.log(e.help);e.error&&(console.error(`${e.error}
|
|
4
|
-
${S(e.usage,e.command)}`),process.exit(2));let{command:i,flag:u}=e,{findWorkspace:n}=await import("../browser/shared/workspace.mjs"),s=n({flag:u});if(process.env.GALLERY_WORKSPACE=s.root,!E.has(i)){let{ensureWorkspace:o}=await import("../browser/shared/workspace.mjs");try{let{ours:r,reads:a}=await o(s.root);r||(console.error(A(s.root,a)),process.exit(1))}catch(r){if(!r.code)throw r;console.error(N(s.root,r.code)),process.exit(1)}}let{UsageError:c,usageFailureText:p}=await import("./chunk-2B5E4CDJ.mjs"),h=await y[i]();try{await h.run(e.argv,{command:i,workspace:s.root,how:s.how,version:g()})}catch(o){if(!(o instanceof c))throw o;console.error(p(m[i],o.message,o.synopsis)),process.exit(2)}}var v=t=>{try{return O.native(t)}catch{return null}};process.argv[1]&&v(process.argv[1])===v(k(import.meta.url))&&G();export{g as a,j as b,N as c,A as d,G as e};
|
package/dist/chunk-64K7IPLO.mjs
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
var n=["init","new","import","open","serve","stop","check","export","qa","list","move","set","component","skill"],a=`The workspace (the folder of your documents) is --workspace <dir>, else GALLERY_WORKSPACE, else the
|
|
3
|
-
nearest folder up from here holding gallery.json (gallery init makes one), else ~/Documents/Gallery (on Windows
|
|
4
|
-
the Documents folder Explorer shows, OneDrive's when OneDrive backs it up).`,e=`A document is named by its slug, by its link (\u5468\u62A5-k3xv9q2a, what gallery list shows after /#) or by a
|
|
5
|
-
whole address, as a user hands one over (http://127.0.0.1:4317/#\u5468\u62A5-k3xv9q2a, a block's id after a / or not): the
|
|
6
|
-
words in a link are a label, and a title changed since leaves the address good.`,o={init:`Usage: gallery init [<dir>] [--from <old reports dir>]
|
|
7
|
-
Makes a workspace: <dir> (else the workspace found as every command finds it) with its gallery.json
|
|
8
|
-
and .gallery/ (never over a gallery.json that is there). Prints \u5DE5\u4F5C\u533A\uFF1A<abs>\uFF08\u65B0\u5EFA or \u5DF2\u6709\uFF09.
|
|
9
|
-
--from copies the documents of an older Gallery (its reports/ folder: one folder a document, each
|
|
10
|
-
holding report.html or doc.html) into the workspace: every document whose slug is free here (the
|
|
11
|
-
others listed as skipped), its preferences.md when the workspace has none, the sidebar's order, the
|
|
12
|
-
\u5199\u4F5C\u504F\u597D page, the custom emoji and the documents' recent versions. The old folder is only read:
|
|
13
|
-
nothing there is changed, moved or deleted.
|
|
14
|
-
Exits 1 when the workspace cannot be written or --from names no folder.`,new:`Usage: gallery new <slug> "<title>" ["<description>"] [--under <document>] [--after <document> | --first] [--no-preview] [--no-browser]
|
|
15
|
-
A new document in <workspace>/<slug>/ from the starter: its doc.html, holding the starter's section
|
|
16
|
-
to replace, and doc.json, with the title and the description (\u65B0\u6587\u6863 when none is given). Where it goes
|
|
17
|
-
in the sidebar's tree: under --under's document, last (first with --first), or right after --after's
|
|
18
|
-
(at that one's level); neither, at the top level, last. A document is named there by its slug, link
|
|
19
|
-
or address (gallery help says how), and must be there, not in the trash; the \u5199\u4F5C\u504F\u597D page holds none.
|
|
20
|
-
Then says where it went (Placed it \u2026), where it wrote (the workspace), where the user's writing preferences are (\u5199\u4F5C\u504F\u597D,
|
|
21
|
-
<workspace>/preferences.md, to read first: made from Gallery's default when there are none yet) and
|
|
22
|
-
the next steps (the first: send the user the address now), and last starts this workspace's Gallery
|
|
23
|
-
server (or uses the one running: it runs on after this command), opens the default browser at the
|
|
24
|
-
document and prints the address to give the user, as gallery open does. --no-preview (or
|
|
25
|
-
GALLERY_NO_PREVIEW=1) leaves the server alone; --no-browser (or GALLERY_NO_BROWSER=1) opens no
|
|
26
|
-
browser. Editing needs Chrome or Edge.
|
|
27
|
-
A title or a description that starts with "-" and a letter would be read as an option: put "--"
|
|
28
|
-
before the arguments (gallery new q3-review -- "-Q3 \u56DE\u987E").
|
|
29
|
-
Exits 1 when the document exists, or the slug is the workspace's own (exports, the \u5199\u4F5C\u504F\u597D page's) or
|
|
30
|
-
a document's in the trash, or a document --under or --after names is not there (nothing made), or
|
|
31
|
-
the new one could not be placed (made, at the top level); 2 for a document named that is in the trash.`,import:`Usage: gallery import <file> [<slug> ["<title>"]] [--no-preview] [--no-browser]
|
|
32
|
-
New documents made of a file, as the workbench's \u5BFC\u5165 makes them: Markdown (.md .markdown .mdx .txt
|
|
33
|
-
.text), HTML (.html .htm .xhtml, a Gallery export too), a table (.csv .tsv), Word (.docx), PDF (.pdf,
|
|
34
|
-
its text), EPUB (.epub) or a .zip of them (a Notion export: one document a page, nested as there).
|
|
35
|
-
The first document's title is the argument's, else the file's (front matter, first heading, name);
|
|
36
|
-
its slug the argument's, else made of the title's Latin words (lowercase kebab-case, a number added
|
|
37
|
-
when it is taken, as gallery new would refuse it). The pictures a Markdown file links to by relative addresses are copied into
|
|
38
|
-
<slug>/assets/. Then says what it made, what it could not bring as the file has it (by line), the
|
|
39
|
-
text the preview leaves read-only, the workspace, \u5199\u4F5C\u504F\u597D, the next steps (the first: send the user
|
|
40
|
-
the address now), and last, as gallery new does, the browser opened at the first document and the
|
|
41
|
-
server's address to give the user (--no-preview, or GALLERY_NO_PREVIEW=1, leaves the server alone;
|
|
42
|
-
--no-browser, or GALLERY_NO_BROWSER=1, opens no browser).
|
|
43
|
-
Put "--" before a title that starts with "-" and a letter.
|
|
44
|
-
Exits 1 when the file is not there, cannot be read, or gallery new would refuse the slug; 2 for a
|
|
45
|
-
kind it does not take.`,open:`Usage: gallery open [<slug>] [--no-browser]
|
|
46
|
-
Starts this workspace's Gallery server (or uses the one running: it runs on after this command, its
|
|
47
|
-
log in <workspace>/.gallery/logs/server.log), waits until it answers, and opens the default browser
|
|
48
|
-
at the workbench, or at the document <slug>, at its block when an address names one (--no-browser,
|
|
49
|
-
or GALLERY_NO_BROWSER=1, opens none).
|
|
50
|
-
${e}
|
|
51
|
-
Prints the workspace, the server, the document's page alone (the Agent's own, with a slug) and last
|
|
52
|
-
the address to give the user. Editing needs Chrome or Edge: open the address there.
|
|
53
|
-
With a slug and no qa baseline yet, it first keeps one of the document as it is now, so that the
|
|
54
|
-
first gallery qa after the changes pictures what changed.
|
|
55
|
-
Exits 1 when there is no such document, no server answers, or the workspace's server takes the
|
|
56
|
-
request and gives no answer (a second server is never started beside it).`,serve:`Usage: gallery serve [--port <n>]
|
|
57
|
-
Runs this workspace's Gallery server in the foreground until Ctrl+C (gallery open runs one in the
|
|
58
|
-
background instead). Prints the address once it answers. --port picks the port (else the last one
|
|
59
|
-
this workspace used, else the first free one from 4317).
|
|
60
|
-
Exits 1 when a server of this workspace runs already (its address said) or the port is taken.`,stop:`Usage: gallery stop
|
|
61
|
-
Stops this workspace's Gallery server, the one gallery open or gallery new started: it finishes the
|
|
62
|
-
saves in its queue first. A server npm run dev runs (Gallery's own development) is stopped where it runs.
|
|
63
|
-
Exits 0 when it stopped or none runs, 1 when it could not be stopped.`,check:`Usage: gallery check [<slug>...] [--allow-failures]
|
|
64
|
-
Checks each named document (none named: every document of the workspace) on its own.
|
|
65
|
-
${e}
|
|
66
|
-
Reads it as its preview shows it (natural HTML made the kit's in memory) and writes nothing: what the export will
|
|
67
|
-
write as the kit's markup is printed by line, and the blocks it will give an id (each at its line
|
|
68
|
-
when they are ten at most); first, once, what the preview wrote as the kit's markup when the reader
|
|
69
|
-
edited the document, and the \u6279\u6CE8 it deleted because their words are gone. Problems to act on first
|
|
70
|
-
("fix") come before the others ("note").
|
|
71
|
-
Exits 1 when a document fails, unless --allow-failures.`,export:`Usage: gallery export <slug>... [--allow-failures]
|
|
72
|
-
gallery export --all [--allow-failures]
|
|
73
|
-
Hands each named document in: its doc.html (report.html in an older document) written as its
|
|
74
|
-
preview shows it, natural HTML as the kit's markup and every block given an id (through the
|
|
75
|
-
workspace's server while one runs); then checks it and writes one standalone offline file per
|
|
76
|
-
passing document, <workspace>/exports/<slug>.html. A document the quick checks fail is not handed in.
|
|
77
|
-
${e}
|
|
78
|
-
It says first, once, what the preview wrote when the reader edited a document and the \u6279\u6CE8 it deleted;
|
|
79
|
-
then the failures ("FAIL <slug>: N problems"), the exports made, the notes to act on first ("fix")
|
|
80
|
-
and the others ("note"), what the hand-in wrote by line, which files to re-read before editing them,
|
|
81
|
-
and last, for each document exported, \u4EA4\u7ED9\u7528\u6237\uFF08\u79BB\u7EBF\u6587\u4EF6\uFF09\uFF1A and the export's absolute path.
|
|
82
|
-
Exits 1 when a document fails, unless --allow-failures.`,qa:`Usage: gallery qa <slug>... [--tiles] [--blocks <id,\u2026>] [--no-export]
|
|
83
|
-
gallery qa --all [--tiles] [--no-export]
|
|
84
|
-
Looks at each named document's export (<workspace>/exports/<slug>.html; one with none yet, or one not
|
|
85
|
-
made from its doc.html and its component packages as they are now, is exported first, as gallery
|
|
86
|
-
export does, unless --no-export) as a reader's browser shows it: Chrome or Edge, headless, at 1024, 736 and 360px wide
|
|
87
|
-
and in a laptop's 1024\xD7768 window, every disclosure open, each Sheet and detail card shown in turn.
|
|
88
|
-
${e}
|
|
89
|
-
Each finding is said with its place in the document's file (doc.html:<line>, report.html:<line> in
|
|
90
|
-
an older document): fail (errors, broken pictures, charts that drew nothing, the page wider than the
|
|
91
|
-
window\u2026), warn (columns or rows out of sight, overlapping text\u2026), info, unverified (no browser, a
|
|
92
|
-
wait that ran out\u2026). Pictures go to <workspace>/.gallery/qa/<slug>/ (its absolute path printed):
|
|
93
|
-
flagged/, changed/ and cards/ (the blocks changed since the last look, and the cards not pictured
|
|
94
|
-
yet), blocks/ (--blocks <id,\u2026>, one document only; the ids split at commas or spaces, and one the
|
|
95
|
-
document has not refused before anything is looked at), tiles/ (--tiles: the page in tiles). Each run
|
|
96
|
-
empties its own folders first: flagged/ every run, changed/ and cards/ a plain run, blocks/ a --blocks
|
|
97
|
-
run, tiles/ a --tiles run. A --blocks run says, before its verdict, the changed blocks and the cards
|
|
98
|
-
it did not picture: a plain run pictures them. First, once, as gallery check says them, what the
|
|
99
|
-
preview wrote when the reader edited the document and the \u6279\u6CE8 it deleted. Then the verdict, and
|
|
100
|
-
last, on a line of its own, the export's absolute path after \u4EA4\u7ED9\u7528\u6237\uFF08\u79BB\u7EBF\u6587\u4EF6\uFF09\uFF1A.
|
|
101
|
-
GALLERY_BROWSER=<executable> picks the browser. A browser that does not start is tried once more
|
|
102
|
-
with a fresh profile.
|
|
103
|
-
Exits 1 when anything fails (or the export it ran first did), 3 when something could not be
|
|
104
|
-
verified (UNVERIFIED: no browser, or one that did not start), 2 when an export is missing or stale
|
|
105
|
-
with --no-export or --blocks names an id the document has not, else 0. A warning never fails.`,list:`Usage: gallery list [<words>...]
|
|
106
|
-
gallery list --tree [<document>]
|
|
107
|
-
The workspace's documents, for an Agent to find the one the user means: each one's slug and title,
|
|
108
|
-
its description, where it is in the sidebar's tree when it is under another (\u4F4D\u7F6E\uFF1Athe documents above
|
|
109
|
-
it, from the top), its address (\u5730\u5740\uFF1A/#<link>, after the port of the workspace's server), when its file
|
|
110
|
-
was last written and where that file is, the one edited last first.
|
|
111
|
-
With words, only those whose title, description or slug holds any of them (case alike, Chinese found
|
|
112
|
-
inside words), the best first, then those whose text holds them, each with its first place there
|
|
113
|
-
(\u6B63\u6587\uFF1A\u2026); with a document's link or whole address, that document, or that it is in the trash.
|
|
114
|
-
--tree lists them as the sidebar shows them, in its order, each under the one it is under, indented
|
|
115
|
-
two spaces a level: a line each, its slug, its title (its emoji before it), its description and its
|
|
116
|
-
last edit. --tree <document>: that document and the documents under it, after its \u4F4D\u7F6E line.
|
|
117
|
-
${e}
|
|
118
|
-
First, the workspace and where \u5199\u4F5C\u504F\u597D is (made from Gallery's default when there is none yet).
|
|
119
|
-
Exits 1 when --tree names a document that is not there, 2 one in the trash.`,move:`Usage: gallery move <document> (--under <document> | --top) [--after <document> | --first]
|
|
120
|
-
Moves a document in the sidebar's tree, with the documents under it: under --under's document, to the
|
|
121
|
-
top level (--top), or where it is now (neither); right after --after's document (one at that level,
|
|
122
|
-
whose level it is when neither --under nor --top says one), first (--first), else last. Written
|
|
123
|
-
through the workspace's running server when there is one (an open workbench shows it at once), else
|
|
124
|
-
here. Nothing in the documents' files changes: links between documents go by their folders, which
|
|
125
|
-
stay where they are.
|
|
126
|
-
${e}
|
|
127
|
-
Prints where it went and where it was, then its place (\u4F4D\u7F6E\uFF1A\u2026, as gallery list says it).
|
|
128
|
-
Exits 0 when it moved or is there already; 1 when a document named is not there or is the \u5199\u4F5C\u504F\u597D page
|
|
129
|
-
(listed apart: it moves nowhere and holds none), when the place is under itself or a document under
|
|
130
|
-
it, or --after names one at another level; 2 for a document in the trash.`,set:`Usage: gallery set <document> [--title "<title>"] [--icon <icon>|none] [--description "<text>"]
|
|
131
|
-
Changes a document's title, page icon or description as the workbench's \u91CD\u547D\u540D and the page's icon
|
|
132
|
-
picker do: the title in doc.html (the h1 of its header, and <title> where that holds the h1's words,
|
|
133
|
-
else the whole of it) and in doc.json; the icon in the header (div.doc-icon before the h1: made,
|
|
134
|
-
changed, or taken away with none) and in doc.json; the description in doc.json. An icon is an emoji,
|
|
135
|
-
an icon of the \u56FE\u6807 tab (/icons/<name>_<color>.svg, Tabler's /icons/tabler/<name>_<color>.svg, the
|
|
136
|
-
colors gray, lightgray, brown, yellow, orange, green, blue, purple, pink, red) or a picture of the
|
|
137
|
-
document's folder (assets/<file>). doc.html is written as an Agent writes it, the rest of it as it
|
|
138
|
-
is: the page open in the browser shows it, and the workbench's sidebar the new title and icon.
|
|
139
|
-
A title that starts with "-" and a letter is written --title="-Q3 \u56DE\u987E".
|
|
140
|
-
${e}
|
|
141
|
-
Prints what changed, then the files to re-read before editing them.
|
|
142
|
-
Exits 1 when the document is not there or is the \u5199\u4F5C\u504F\u597D page, its page has no h1.doc-title, its
|
|
143
|
-
doc.json does not read, or the picture is not in its folder; 2 for an icon that is none of these.`,component:`Usage: gallery component new <id> [--script] [--flow]
|
|
144
|
-
gallery component list
|
|
145
|
-
gallery component show <id>
|
|
146
|
-
gallery component check <id>
|
|
147
|
-
gallery component try <slug> [<instance id>] --press <selector> [--keep]
|
|
148
|
-
gallery component try <slug> [<instance id>] --drag <selector> --to <selector> [--keep]
|
|
149
|
-
gallery component try <slug> [<instance id>] --key <selector> <key> [--keep]
|
|
150
|
-
A component package is a block to use again, kept in the workspace: components/<scope>/<name>/. An id
|
|
151
|
-
is <scope>/<name>, or a <name> alone in the scope local; a document uses one by an element naming it.
|
|
152
|
-
new starts a package: component.json, template.html, example.html, writing.md and style.css, and with
|
|
153
|
-
--script a kit.js; with --flow a slot, body, in place of its paragraph, where a document writes blocks
|
|
154
|
-
of its own. It passes check as it stands, and says what to write next.
|
|
155
|
-
Exits 1 when the id is taken.
|
|
156
|
-
list says what the workspace has now: the components to write with, each with its version, then those
|
|
157
|
-
not to write with now and why: hidden, disabled, one that does not load, a manifest one level too shallow;
|
|
158
|
-
and last the blocks of Gallery's own the user hid.
|
|
159
|
-
show says how to write one: its parts, its writing.md and its example.
|
|
160
|
-
Exits 1 when there is no such component or it does not load.
|
|
161
|
-
check says what is wrong with one, each problem ("FAIL") at its place in the package's files, each note
|
|
162
|
-
never a failure, in five sections: 1 the manifest, with template.html there, text parts that hold
|
|
163
|
-
words and marks alone, and a note on a Chinese name no word of its words spells whole in pinyin, a
|
|
164
|
-
syllable a character, by how many syllables a word reads as; 2 kit.js: what a browser refuses, what
|
|
165
|
-
an export refuses, what it registers, a type check against sdk/; 3 style.css: every selector in the
|
|
166
|
-
instance, what an export cannot hold, and a note on one that goes down into a slot; 4 template.html
|
|
167
|
-
and example.html, each read as a document's page by what gallery check runs, and template.html as what
|
|
168
|
-
a menu can put in; 5
|
|
169
|
-
both in a temporary document, exported and opened as gallery qa opens one, in Chrome or Edge under the export's
|
|
170
|
-
policy: what the console and the policy say, a dialog or a window it opens, mount then dehydrate then
|
|
171
|
-
mount and copies put back giving the same DOM (a drawing neither the manifest's runtime nor dehydrate
|
|
172
|
-
names piles up, and what piles up outside the instance is named too), a slot the component writes in
|
|
173
|
-
or moves, a text part the component redraws, a data part a mount changes, a write with no gesture
|
|
174
|
-
once the page takes edits, the way back to the file (a way back line: what the component's example wrote, each part with how many of its
|
|
175
|
-
lines the write took out and put in, and that the server took it; a note on a write that lays a part
|
|
176
|
-
out anew, and on a list a card is dropped on that listens for dragover and not for dragenter), a page
|
|
177
|
-
wider than the window, and the pictures, in <workspace>/.gallery/qa/components/<id>/, its absolute
|
|
178
|
-
path printed, emptied each run: overview-light.png and overview-dark.png, the three widths of a theme
|
|
179
|
-
side by side, then each at 360, 736 and 1024px wide, light and dark, and edit-1024-light.png and
|
|
180
|
-
edit-360-light.png, as the editing page draws it, said when they are the export's. Section 5 waits
|
|
181
|
-
until what it needs passes; a page that stops answering or loads itself again ends it, and is said;
|
|
182
|
-
with no browser, one that does not start or goes while it looks, or a folder it cannot write, it says
|
|
183
|
-
so and the rest stands. A package the user turned off is checked as any, with a note saying so.
|
|
184
|
-
GALLERY_BROWSER=<executable> picks the browser.
|
|
185
|
-
Exits 1 when anything fails, 3 when nothing did and no browser ran it (UNVERIFIED), else 0.
|
|
186
|
-
Exits 2 for an id no package can have.
|
|
187
|
-
try makes one gesture a reader makes on an instance in a document, with the pointer and the keys, and
|
|
188
|
-
says what it wrote. It starts the workspace's server (or uses the one running), as gallery open does,
|
|
189
|
-
and opens the document's page alone, editable (the Agent \u81EA\u7528 address), in Chrome or Edge, headless, in
|
|
190
|
-
a profile of its own, and waits until the server has told the page of the writes made before it (a
|
|
191
|
-
package changed, doc.html written), which load it again. Each selector is the first element of the
|
|
192
|
-
instance it finds: --press, a press at its middle; --drag \u2026 --to, pressed there, moved in steps to the
|
|
193
|
-
middle of another and released a moment after the move that comes onto it; --key, the key (Enter,
|
|
194
|
-
Space, ArrowRight, a letter, Shift+Tab) with the focus on it, as Tab gives it. <slug> names the
|
|
195
|
-
document, as its link or a whole address does too (gallery help says how), and the instance is named
|
|
196
|
-
by its data-block-id, or by its package's id where the document holds one of it; with one instance in
|
|
197
|
-
the document, not at all. Once <html>'s data-ge-save says saved again it prints a Gesture line, what it
|
|
198
|
-
did to which element, and a Wrote line: each part of the instance in doc.html with how many of its
|
|
199
|
-
lines the gesture took out and put in, and that nothing outside the instance changed, data-block-id
|
|
200
|
-
aside, which a save gives (what did is someone else's, which stays). Then it presses Ctrl+Z once, the
|
|
201
|
-
focus where the gesture left it but off a field of the instance, as a reader undoes, and an Undone line
|
|
202
|
-
says doc.html is as it was; --keep leaves the write (a Kept line). Last, a picture of the instance after
|
|
203
|
-
the gesture, <workspace>/.gallery/qa/<slug>/try/after.png, its absolute path printed, emptied each run.
|
|
204
|
-
A first save of an edit writes a document's plain HTML as the kit's markup, which the Wrote line says
|
|
205
|
-
and which stays: the file is compared as its page shows it. A trial cut off after its gesture (the page
|
|
206
|
-
offline, a card held for the reader, a load of its own, the browser gone) reads doc.html and says what
|
|
207
|
-
it holds of the gesture.
|
|
208
|
-
Exits 1 when the gesture wrote nothing (what came of it said: no context.edit, one the page refused, an
|
|
209
|
-
HTML5 drag dropped nowhere, a selector that finds nothing as the component failed), when one Ctrl+Z did
|
|
210
|
-
not give doc.html back, when the component failed, or when a trial cut off left the gesture's write in
|
|
211
|
-
doc.html, said with the parts it holds, for you to put back; 2 for a mistake in the command line: a
|
|
212
|
-
selector that finds nothing shown in the instance, an instance the document has not among them, a drag
|
|
213
|
-
that ends on what it drags; 3 when the trial was not seen through and doc.html holds nothing of the
|
|
214
|
-
gesture (UNVERIFIED: no server or browser ran it, a card waits for the reader, someone else wrote
|
|
215
|
-
doc.html meanwhile, which stays), the line saying what doc.html holds.`,skill:`Usage: gallery skill install [--agent claude|codex] [--project] [--dir <path>]
|
|
216
|
-
Writes the Gallery skill that matches this gallery command (what an Agent reads to write documents
|
|
217
|
-
with it: SKILL.md, references/, sdk/) where the Agent reads skills:
|
|
218
|
-
Claude Code ~/.claude/skills/gallery (CLAUDE_CONFIG_DIR/skills/gallery when that is set)
|
|
219
|
-
Codex ~/.codex/skills/gallery (CODEX_HOME/skills/gallery when that is set)
|
|
220
|
-
for each of them whose folder is there (neither: Claude Code's), or the one --agent names. --project
|
|
221
|
-
writes it into this folder's .claude/skills/gallery (.codex/skills/gallery for Codex) instead, for
|
|
222
|
-
this project alone; --dir <path> writes it into <path> itself, the skill's own folder, for any other agent.
|
|
223
|
-
A Gallery skill there is replaced (nothing done when it holds the same files). An older Gallery's
|
|
224
|
-
skill (the whole tools: package.json and src/, or reports/, its SKILL.md named gallery or
|
|
225
|
-
html-report-studio), there or anywhere in that skills folder, has its documents copied into the
|
|
226
|
-
workspace first, as gallery init --from copies them, and its exports into <workspace>/exports/ where
|
|
227
|
-
the name is free; then it is moved to <workspace>/.gallery/old-skill-<date>/ (never deleted), so that
|
|
228
|
-
the Agent sees one Gallery skill. Says what it did and where; then open a new Agent session.
|
|
229
|
-
Exits 1, changing nothing, when a target holds something else or an older skill's preview server
|
|
230
|
-
still runs (stop it first); 1 too when an older skill cannot be moved (its documents are copied).`},r=o.component.split(`
|
|
231
|
-
`).filter(t=>/^(?:Usage:)?\s*gallery component try /.test(t)).map((t,s)=>s===0?`Usage: ${t.trimStart()}`:t).join(`
|
|
232
|
-
`),i=`Usage: gallery <command> [options] [--workspace <dir>]
|
|
233
|
-
Gallery: documents written as HTML, edited in the browser, exported as one offline file.
|
|
234
|
-
|
|
235
|
-
gallery init [<dir>] [--from <old reports dir>] make a workspace (copy an older Gallery's documents)
|
|
236
|
-
gallery new <slug> "<title>" ["<description>"] a new document; starts the server, opens the browser
|
|
237
|
-
gallery import <file> [<slug> ["<title>"]] documents made of a file (Markdown, HTML, Word, PDF\u2026)
|
|
238
|
-
gallery open [<slug>] [--no-browser] start or reuse the server and open the browser
|
|
239
|
-
gallery serve [--port <n>] run the server in the foreground
|
|
240
|
-
gallery stop stop the workspace's server
|
|
241
|
-
gallery check [<slug>...] check documents (none named: all)
|
|
242
|
-
gallery export <slug>... | --all write <workspace>/exports/<slug>.html
|
|
243
|
-
gallery qa <slug>... [--blocks a,b] [--tiles] look at exports in Chrome or Edge
|
|
244
|
-
gallery list [<words>...] | --tree [<slug>] the documents, those the words name, or the tree
|
|
245
|
-
gallery move <slug> --under <slug> | --top move a document (and those under it) in the tree
|
|
246
|
-
gallery set <slug> --title|--icon|--description change a document's title, icon or description
|
|
247
|
-
gallery component new|list|show|check [<id>] make, list, read and check component packages
|
|
248
|
-
gallery component try <slug> --press <selector> a reader's gesture on an instance, and what it wrote
|
|
249
|
-
gallery skill install [--agent claude|codex] write the Agent's skill for this version
|
|
250
|
-
gallery help [<command>] this, or a command's whole usage
|
|
251
|
-
gallery --version the version
|
|
252
|
-
|
|
253
|
-
${e}
|
|
254
|
-
${a}
|
|
255
|
-
Editing in the browser and gallery qa need Chrome or Edge. Node 22.13 or newer.`;export{n as a,o as b,r as c,i as d};
|
package/dist/chunk-6QXGZM36.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
import{a as g}from"./chunk-HYMEEXKN.mjs";import{createRequire as re}from"node:module";import{typescriptFile as ae}from"../browser/shared/paths.mjs";var ce=re(import.meta.url),B=null;function fe(){return B??=ce(ae??"typescript"),B}var $=new Proxy({},{get:(e,n)=>fe()[n]});import _ from"node:fs/promises";import h from"node:path";import{COMPONENTS as D,instancesOf as ue}from"../browser/shared/components/index.mjs";import{PACKAGE_MARK as q}from"../browser/shared/components/installed.mjs";import{MATH_IGNORED_TAGS as pe}from"../browser/shared/components/math.mjs";import{attr as x,elementsOf as b,walk as y}from"../browser/shared/html-tree.mjs";import I from"node:path";import de from"node:vm";var L=()=>{throw new Error("esbuild is not in the release: Gallery 0.1.1 calls it only in a source checkout")},Le=L,J=L;var Te=new Proxy({},{get:L});import{projectRoot as le}from"../browser/shared/paths.mjs";var T=I.join(le,"src","shared","components","index.mjs");function F(e){let{outputFiles:n}=J({stdin:{contents:`import { FLOWS, FLOW_BLOCKS, runtimeDescriptions } from ${JSON.stringify(e)}; module.exports = { descriptions: runtimeDescriptions(), flows: FLOWS, blockFlows: FLOW_BLOCKS };`,resolveDir:I.dirname(e),loader:"js"},bundle:!0,write:!1,format:"cjs",platform:"node",logLevel:"silent"}),s={module:{exports:null}};return de.runInNewContext(n[0].text,s),JSON.parse(JSON.stringify(s.module.exports))}var W=(e=T)=>F(e).descriptions,G=(e=T)=>F(e).flows,U=(e=T)=>F(e).blockFlows;import{kitPublicDirectory as me,projectRoot as H,release as Y,vendorDirectory as z}from"../browser/shared/paths.mjs";var P=h.join(H,"node_modules"),he=h.join(P,"d3","dist","d3.min.js"),S=Y?h.join(z,"katex"):h.join(P,"katex","dist"),xe=h.join(S,"fonts"),He=h.join(S,"contrib","mhchem.min.js"),u=[{id:"styles",file:"report.css",build:{styles:"styles/index.css"},always:!0},{id:"katex-styles",vendor:{path:"/vendor/katex/katex.min.css",source:h.join(S,"katex.min.css")}},{id:"runtime",file:"runtime.js",build:{bundle:"runtime/index.js",options:()=>({minify:!1,define:{__COMPONENT_RUNTIME__:JSON.stringify(W()),__COMPONENT_FLOWS__:JSON.stringify(G()),__COMPONENT_BLOCK_FLOWS__:JSON.stringify(U())}})},api:"DocKit",always:!0},{id:"code",file:"code.js",build:{bundle:"code.js",options:{minify:!0,legalComments:"inline"}},api:"DocCode",after:["runtime"]},{id:"state",file:"state.js",build:{read:"state.js"},api:"DocState",always:!0},{id:"sheets",file:"sheets.js",build:{read:"sheets.js"},api:"DocSheets",after:["runtime","state"]},{id:"tokens",file:"tokens.js",build:{read:"tokens.js"},api:"DocTokens",always:!0},{id:"ui",file:"ui.js",build:{bundle:"ui.js",options:{minify:!1}},added:!0,after:["runtime","state","tokens"]},{id:"dialogs",file:"dialogs.js",build:{read:"dialogs.js"},api:"DocDialogs",after:["runtime"]},{id:"katex",vendor:{path:"/vendor/katex/katex.min.js",source:h.join(S,"katex.min.js")},umd:!0},{id:"katex-auto-render",vendor:{path:"/vendor/katex/auto-render.min.js",source:h.join(S,"contrib","auto-render.min.js")},umd:!0,after:["katex"]},{id:"math",file:"math.js",build:{bundle:"math-bundle.js",options:{minify:!1,legalComments:"inline",alias:{katex:h.join(H,"src","render","kit","page-katex.js")},nodePaths:[h.join(P,"katex")]}},api:"DocMath",after:["runtime","katex-styles","katex","katex-auto-render"]},{id:"d3",vendor:{path:"/vendor/d3.v7.9.0.min.js",source:he},api:"d3",umd:!0},{id:"charts",file:"charts.js",build:{bundle:"charts/index.js",options:{minify:!1}},api:"DocCharts",after:["runtime","tokens"]},{id:"tables",file:"tables.js",build:{bundle:"tables/index.js",options:{minify:!1}},api:"DocTables",after:["runtime"]}],m=e=>e.file?`/kit/${e.file}`:e.vendor.path,ge=e=>e.file?h.join(me,e.file):h.join(z,...e.vendor.path.split("/").slice(2));if(Y)for(let e of u)e.vendor&&(e.vendor.source=ge(e));var O=e=>m(e).endsWith(".css"),E=e=>e.file?"data-doc-kit":"data-doc-vendor",C=e=>u.find(n=>n.id===e),w=(e,n=m(e))=>O(e)?`<link rel="stylesheet" href="${n}" ${E(e)}="${e.id}">`:`<script src="${n}" ${E(e)}="${e.id}"></script>`,we=u.map(e=>({id:e.id,tag:w(e),always:!!e.always,element:O(e)?"style":"script",attribute:E(e)}));function Ye(e,n=m){let s=new Set,i=t=>{s.has(t)||(s.add(t),C(t)?.after?.forEach(i))};return e.forEach(i),u.filter(t=>s.has(t.id)&&!t.always&&!t.added).map(t=>w(t,n(t)))}function ye(e=u,n=D){let s=[],i=e.map(t=>t.id);for(let t of new Set(i.filter((a,o)=>i.indexOf(a)!==o)))s.push(`the asset "${t}" is listed twice`);for(let t of e){!!t.file==!!t.vendor&&s.push(`the asset "${t.id}" is a kit file (file) or a vendor file (vendor), one of them`),t.file&&!["read","bundle","styles"].some(o=>typeof t.build?.[o]=="string")&&s.push(`the kit file "${t.file}" does not say how it is made (build: read, bundle or styles)`),t.vendor&&!(t.vendor.path&&t.vendor.source)&&s.push(`the vendor asset "${t.id}" needs its public path and its source`);for(let o of t.after??[])i.includes(o)?i.indexOf(o)>i.indexOf(t.id)&&s.push(`the asset "${t.id}" loads after "${o}", which the list puts after it`):s.push(`the asset "${t.id}" loads after "${o}", which is no asset`);let a=n.filter(o=>(o.assets??[]).includes(t.id));!t.always&&!t.api&&!t.added&&a.length===0&&s.push(`no report would keep the asset "${t.id}": it is not always kept, defines no global and no component needs it`)}for(let t of n)for(let a of t.assets??[])i.includes(a)||s.push(`the component "${t.id}" needs "${a}", which is no asset`);return s}{let e=ye();if(e.length>0)throw new Error(`src/render/assets.mjs: ${e.join("; ")}`)}var K=/^(?:|module|(?:text|application)\/(?:x-)?(?:javascript|ecmascript)|text\/javascript1\.[0-5]|text\/(?:jscript|livescript))$/,$e=/^application\/(?:\S+\+)?json$/,N=e=>(x(e,"type")??"").trim().toLowerCase();function V(e){let n=$.createSourceFile("report.js",e,$.ScriptTarget.Latest,!1,$.ScriptKind.JS),s=[],i=[n];for(;i.length>0;){let t=i.pop();if(t.kind>=$.SyntaxKind.FirstJSDocNode&&t.kind<=$.SyntaxKind.LastJSDocNode)continue;let a=t.getChildren(n);a.length===0&&s.push(e.slice(t.getStart(n),t.end));for(let o=a.length-1;o>=0;o-=1)i.push(a[o])}return s.join(" ")}var Q=e=>new RegExp(`\\b(?:${e.filter(n=>n.api).map(n=>n.api).join("|")})\\b`);function ke(e,n){let s=[],i=t=>{n.test(t)&&s.push(V(t))};return y(e,t=>{t.tagName==="script"&&x(t,"src")===void 0&&K.test(N(t))&&i(t.childNodes.map(a=>a.value??"").join(""));for(let{name:a,value:o}of t.attrs??[]){if(/^on/.test(a)){i(o);continue}let f=o.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(!/^javascript:/i.test(f))continue;let r=f.slice(11);try{r=decodeURIComponent(r)}catch{}i(r)}}),s.join(`
|
|
3
|
-
`)}function je(e,n){let s=[],i=(o,f)=>{for(let r of o.childNodes??[]){let c=r.sourceCodeLocation;r.nodeName==="#comment"||f&&r.nodeName==="#text"?c&&s.push([c.startOffset,c.endOffset]):r.tagName==="script"?i(r,$e.test(N(r))):r.tagName&&i(r.content??r,f||pe.includes(r.tagName))}};i(e,!1);let t="",a=0;for(let[o,f]of s.sort((r,c)=>r[0]-c[0]))o<a||(t+=`${n.slice(a,o)} `,a=f);return t+n.slice(a)}function R(e,n=u,s=D){let i=n.reduce((c,d)=>c.replaceAll(w(d),""),e),t=g(i),a=je(t,i),o=ke(t,Q(n)),f=new Set,r=c=>{f.has(c)||(f.add(c),(n.find(d=>d.id===c)?.after??[]).forEach(r))};for(let c of s){if(!(c.assets??[]).length)continue;((c.uses??[]).some(l=>l.test(a))||c.match&&ue(t,c).length>0)&&c.assets.forEach(r)}for(let c of n)c.api&&new RegExp(`\\b${c.api}\\b`).test(o)&&r(c.id);return f}function ze(e,n=D){let s=R(e,u,n),i=[];for(let t of u){let a=w(t);if(t.always||t.added||s.has(t.id)||!e.includes(a))continue;let o=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp(`[ \\t]*${o}[ \\t]*\\r?\\n?`),""),i.push(t.id)}return{html:e,removed:i,used:s}}function M(e,n){let s=[];return y(n,i=>{let t=Z(i),a=t===void 0?void 0:u.find(f=>m(f)===t.trim()),o=i.sourceCodeLocation;!a||!o||s.push({asset:a,start:o.startOffset,end:o.endOffset,line:o.startLine,exact:e.slice(o.startOffset,o.endOffset)===w(a)})},{inTemplates:!1}),s}var X=e=>e.tagName==="style"||e.tagName==="link"&&(x(e,"rel")??"").toLowerCase().split(/\s+/).includes("stylesheet"),Z=e=>e.tagName==="script"?x(e,"src"):X(e)?x(e,"href"):void 0,j=e=>!!e.sourceCodeLocation,A=e=>e.includes(`\r
|
|
4
|
-
`)?`\r
|
|
5
|
-
`:`
|
|
6
|
-
`;function k(e,n,{closing:s=!1}={}){let i=n===0?0:e.lastIndexOf(`
|
|
7
|
-
`,n-1)+1,t=e.slice(i,n);if(!/^[ \t]*$/.test(t))return{at:n,text:o=>o};let a=s?`${t} `:t;return{at:i,text:o=>`${a}${o}${A(e)}`}}function v(e,n){let s=/^[ \t]*/.exec(e.slice(e.lastIndexOf(`
|
|
8
|
-
`,n-1)+1))[0];return{at:n,text:i=>`${A(e)}${s}${i}`}}function ee(e){let n;return y(e,s=>{!n&&s.tagName==="main"&&(n=s)},{inTemplates:!1}),n}var Oe="http://www.w3.org/1999/xhtml";function be(e){let n=e;for(let s=e.parentNode;s?.tagName;s=s.parentNode)s.namespaceURI!==Oe&&(n=s);return n}function te(e,n,s){let i=b(n).find(o=>o.tagName==="html"),t=b(i??{}).find(o=>o.tagName==="head"),a=b(i??{}).find(o=>o.tagName==="body");if(s){let o=b(t??{}).filter(j),f=o.find(X);if(f)return k(e,f.sourceCodeLocation.startOffset);if(t?.sourceCodeLocation?.endTag)return k(e,t.sourceCodeLocation.endTag.startOffset,{closing:!0});if(o.length>0)return v(e,o.at(-1).sourceCodeLocation.endOffset);if(t?.sourceCodeLocation)return v(e,t.sourceCodeLocation.startTag.endOffset);let r=a?.sourceCodeLocation?.startTag?.startOffset??b(a??{}).find(j)?.sourceCodeLocation.startOffset;if(r!==void 0)return k(e,r)}else{let o=ee(n),f=d=>{for(let l=d.parentNode;l;l=l.parentNode)if(l===o)return!1;return!o?.sourceCodeLocation||d.sourceCodeLocation.startOffset>o.sourceCodeLocation.startOffset},r;if(y(a??{},d=>{!r&&d.tagName==="script"&&j(d)&&K.test(N(d))&&f(d)&&(r=d)},{inTemplates:!1}),r)return k(e,be(r).sourceCodeLocation.startOffset);let c=a?.sourceCodeLocation?.endTag??i?.sourceCodeLocation?.endTag;if(c)return k(e,c.startOffset,{closing:!0})}return{at:e.length,text:o=>`${A(e)}${o}`}}function oe(e,n,{free:s}){let i=M(e,n),t=new Map;for(let a of[!0,!1]){let o=u.filter(d=>O(d)===a),f=d=>i.find(l=>l.asset===d),r=o.map(f).find(Boolean),c=r?k(e,r.start):s?te(e,n,a):null;for(let d of o){let l=f(d);l?(t.set(d.id,{at:l.start,written:l}),c=v(e,l.end)):c&&t.set(d.id,c)}}return t}function ne(e,n,{tree:s=g(e),free:i,href:t=m}){let a=[];for(let[r,c]of oe(e,s,{free:i})){let d=C(r);c.written?c.written.exact&&t(d)!==m(d)&&a.push({at:c.written.start,end:c.written.end,text:w(d,t(d))}):n.has(r)&&a.push({at:c.at,end:c.at,text:c.text(w(d,t(d)))})}if(a.length===0)return e;a.sort((r,c)=>r.at-c.at);let o="",f=0;for(let{at:r,end:c,text:d}of a)o+=e.slice(f,r)+d,f=c;return o+e.slice(f)}function Ve(e,{used:n=R(e),href:s=m}={}){let i=g(e),t=x(ee(i)??{},"data-doc-id")!==void 0,a=new Set(u.filter(o=>o.always||n.has(o.id)||o.added&&t).map(o=>o.id));return ne(e,a,{tree:i,free:!0,href:s})}function Qe(e){let n=R(e);return ne(e,new Set(u.filter(s=>!s.always&&!s.added&&n.has(s.id)).map(s=>s.id)),{free:!1})}function Xe(e,{styles:n,scripts:s}){let i=g(e),t=[];y(i,r=>{let c=u.find(d=>m(d)===Z(r)?.trim().split("?")[0]);c&&j(r)&&t.push({style:O(c),end:r.sourceCodeLocation.endOffset})},{inTemplates:!1});let a=[[!0,n],[!1,s]].filter(([,r])=>r.length>0).map(([r,c])=>{let d=t.filter(p=>p.style===r).at(-1),l=d?v(e,d.end):te(e,i,r);return{at:l.at,text:c.map(l.text).join("")}}),o="",f=0;for(let{at:r,text:c}of a.sort((d,l)=>d.at-l.at))o+=e.slice(f,r)+c,f=r;return o+e.slice(f)}function Ze(e,n=g(e)){let s=[],i=[];if(y(n,o=>{let f=["data-doc-kit","data-doc-vendor"].find(r=>x(o,r)?.endsWith("-inline"))??(x(o,q)===void 0?void 0:q);f&&j(o)&&i.push({line:o.sourceCodeLocation.startLine,mark:`${f}="${x(o,f)}"`})},{inTemplates:!1}),i.length>0){let o=i.length>1?`, and ${i.length-1} more on line${i.length>2?"s":""} ${se(i.slice(1).map(({line:f})=>f))}`:"";s.push(`line ${i[0].line}: an export's inline copy of the kit (${i[0].mark}${o}), which a document's source never holds (the kit's tags are put in as the document is shown, so it would load twice): bring an exported file in with \u5BFC\u5165 instead of copying it in`)}let t=M(e,n);for(let{asset:o,line:f,exact:r}of t)r||s.push(`line ${f}: ${m(o)} is not loaded by the kit's own tag, ${w(o)}: take the tag out (the kit's tags are put in as the document is shown and exported)`);for(let o of u){let f=t.filter(r=>r.asset===o).map(r=>r.line);f.length>1&&s.push(`${m(o)} is loaded ${f.length} times (lines ${f.join(", ")}): keep one tag, or none`)}let a=o=>t.find(f=>f.asset===o);for(let o of u){let f=a(o);if(f)for(let r of o.after??[]){let c=a(C(r));c&&c.start>f.start&&s.push(`line ${f.line}: ${m(c.asset)} (line ${c.line}) must load before ${m(o)}`)}}return[...new Set(s)]}var se=e=>e.length>1?`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`:e[0];function et(e,n=g(e)){let s=Q(u),i=[],t;return y(n,a=>{if(a.tagName!=="script"||x(a,"src")!==void 0||!j(a)||N(a)==="module"||!K.test(N(a)))return;let o=a.childNodes.map(p=>p.value??"").join("");if(!s.test(o))return;let f=V(o);t??=oe(e,n,{free:!0});let{startOffset:r,startLine:c}=a.sourceCodeLocation,d=u.filter(p=>p.api&&new RegExp(`\\b${p.api}\\b`).test(f)&&t.get(p.id).at>r),l=d.filter(p=>!t.get(p.id).written);l.length>0&&i.push(`line ${c}: this script names ${se(l.map(p=>p.api))} before the kit's scripts load (they are put in after </main>): move the script after </main>`);for(let p of d.filter(ie=>t.get(ie.id).written))i.push(`line ${c}: this script names ${p.api} before ${m(p)} loads (line ${t.get(p.id).written.line}): move the script after that tag`)},{inTemplates:!1}),i}function tt(e,n){let s=new Set,i="",t=0;for(let{asset:a,start:o,end:f,exact:r}of M(e,g(e)))!r||s.has(a.id)||(s.add(a.id),i+=e.slice(t,o)+n(we.find(c=>c.id===a.id)),t=f);return i+e.slice(t)}var ot=new Set(u.filter(e=>!O(e)).map(m)),nt=new Set(u.filter(O).map(m));async function Se({inlineFonts:e=!1}={}){let n=await _.readFile(C("katex-styles").vendor.source,"utf8");if(n=n.replace(/src:url\((fonts\/[^)]+\.woff2)\) format\("woff2"\),url\(fonts\/[^)]+\.woff\) format\("woff"\),url\(fonts\/[^)]+\.ttf\) format\("truetype"\)/g,'src:url($1) format("woff2")'),!e)return n;let s=[...new Set([...n.matchAll(/url\(fonts\/([^)]+\.woff2)\)/g)].map(i=>i[1]))];for(let i of s){let t=await _.readFile(h.join(xe,i));n=n.replaceAll(`url(fonts/${i})`,`url(data:font/woff2;base64,${t.toString("base64")})`)}return n}function st(e,{inline:n=!1}={}){return e.id==="katex-styles"?Se({inlineFonts:n}):_.readFile(e.vendor.source,"utf8")}export{$ as a,Le as b,xe as c,He as d,u as e,m as f,ge as g,Ye as h,ze as i,Ve as j,Qe as k,Xe as l,Ze as m,et as n,tt as o,ot as p,nt as q,st as r};
|
package/dist/chunk-6RGJOMJP.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
import{d as je,e as Oe}from"./chunk-QJIR2BLP.mjs";import{d as ve}from"./chunk-P2CAZPDP.mjs";import{a as de,c as lt,d as $e,e as xe,f as Se}from"./chunk-E7LWZRXY.mjs";import{a as me,d as pe,e as we,f as he,g as ye}from"./chunk-TYK6VNAB.mjs";import{b as ge,c as ke,e as be,g as Bt}from"./chunk-CY2FNNAB.mjs";import{a as ie}from"./chunk-UMHUSOPJ.mjs";import{F as le,G as ue,H as Ut,a as W}from"./chunk-L3QKH4OK.mjs";import{d as ce,q as fe}from"./chunk-W4VKN3GF.mjs";import{createHmac as _n,randomBytes as Gt}from"node:crypto";import{existsSync as Ln,mkdirSync as Un,readFileSync as Bn,writeFileSync as Wn}from"node:fs";import Y from"node:fs/promises";import I from"node:path";import{FILE as Yn}from"../browser/shared/annotations.mjs";import{escapeTyped as Zn}from"../browser/shared/escape.mjs";import{writeAtomic as Tt}from"../browser/shared/files.mjs";import{sendJson as _}from"../browser/shared/http.mjs";import{REQUEST_ID as Ct}from"../browser/shared/ids.mjs";import{UPLOAD_REQUEST_LIMIT as Cn}from"../browser/shared/media.mjs";import{reportsDirectory as zn}from"../browser/shared/paths.mjs";import{sameDirectory as Gn}from"../browser/shared/preview-server.mjs";import{slugPattern as et}from"../browser/shared/reports.mjs";import{documentDirectory as Hn,documentFiles as jt,isDocumentSource as Kn}from"../browser/shared/workspace.mjs";import Wt from"node:fs/promises";import Ne from"node:path";import{checkAnnotations as pn,cleanAnchor as wn,cleanItem as Ae,FILE as hn,itemsText as yn,readItems as gn,treeText as Ee}from"../browser/shared/annotations.mjs";import{writeAtomic as kn}from"../browser/shared/files.mjs";import{slugPattern as bn}from"../browser/shared/reports.mjs";import{documentDirectory as Re,documentFiles as $n}from"../browser/shared/workspace.mjs";var xn=600*1e3,Sn=600*1e3;function vn(f){let{units:c,boxes:g}=ue(f),m=[...c].sort((p,y)=>p.elStart-y.elStart),$=new Map(m.map((p,y)=>[p.id,y])),u=new Map(m.map(p=>[p.id,Ee(p.node)])),O={h2:null,h3:null,h4:null};return m.map(p=>{let y=[];for(let E=p;E;E=E.parent===null?null:c[E.parent]){let v=g[E.box];if(v?.kind==="panel"&&v.key!==null){let J=c.find(U=>U.kind==="tab"&&U.parent===v.unit&&U.key===v.key);J&&y.unshift({tab:u.get(J.id)})}let G=v?.unit===null||v?.unit===void 0?null:c[v.unit];if(G?.tag==="details"&&v.kind==="details"){let J=G.node.childNodes.find(U=>U.tagName==="summary");J&&y.push({details:Ee(J)})}}let M=y.find(E=>E.tab)?.tab,T=y.find(E=>E.details)?.details,L=[M,O.h2,O.h3,O.h4,T].filter(Boolean);return p.tag==="h2"?Object.assign(O,{h2:u.get(p.id),h3:null,h4:null}):p.tag==="h3"?Object.assign(O,{h3:u.get(p.id),h4:null}):p.tag==="h4"&&(O.h4=u.get(p.id)),{id:p.blockId,text:u.get(p.id),parent:p.parent===null?null:$.get(p.parent)??null,where:L,heading:/^h[2-4]$/.test(p.tag)}})}function Te({reportsDirectory:f,read:c,write:g=kn,dropped:m=()=>{},now:$=Date.now}){let u=new Map,O=new Map,p=new Map,y=(s,w)=>{let r=p.get(s);if(r?.text===w)return r.units;let o=vn(w);return p.set(s,{text:w,units:o}),o},M=s=>Ne.join(Re(s,f),hn),T=s=>typeof s=="string"&&bn.test(s);async function L(s){let w=await Wt.readFile(M(s),"utf8").catch(()=>null);return{text:w,items:w===null?[]:gn(w)}}async function E(s,w,r){let o=yn(w);return o===r||(o===null?await Wt.rm(M(s),{force:!0}):await g(M(s),o)),v(o)}let v=s=>s===null?"":W(s),G=s=>{let w=u.get(s)??new Map;for(let[r,o]of w)$()-o>xn&&w.delete(r);return[...w.keys()]},J=(s,w)=>w.forEach(r=>u.get(s)?.delete(r)),U=s=>{let w=O.get(s)??O.set(s,new Map).get(s);for(let[r,o]of w)$()-o>Sn&&w.delete(r);return w};async function D(s,{keep:w=null,items:r=null,before:o=void 0}={}){let k=r?{items:r,text:o}:await L(s),b=await c(s).catch(()=>null);if(!b)return{items:k.items,units:[],places:new Map,version:v(k.text),missing:!0};let R=y(s,b.text),N=U(s),h=pn(k.items,R,{keep:new Set([...N.keys(),w])});for(let j of N.keys())h.waiting.has(j)||N.delete(j);if(h.dropped.length>0){let j=u.get(s)??u.set(s,new Map).get(s);for(let F of h.dropped)j.set(F.id,$())}let x=h.changed||r?await E(s,h.items,k.text):v(k.text);return h.dropped.length>0&&m(s,h.dropped),{items:h.items,units:R,places:h.places,version:x,missing:!1}}let B=(s,{items:w,version:r})=>({ok:!0,version:r,items:w,dropped:G(s)});async function H(s){if(!T(s))return[400,{ok:!1,reason:"body"}];let w=await D(s);return w.missing?[404,{ok:!1,reason:"missing"}]:[200,B(s,w)]}async function nt(s){if(!T(s))return[400,{ok:!1,reason:"body"}];let w=await D(s);if(w.missing)return[404,{ok:!1,reason:"missing"}];let r=null,o=$n(Re(s,f));try{r=JSON.parse(await Wt.readFile(o.json,"utf8"))}catch{}let k=await c(s).catch(()=>null),b=/<h1\b[^>]*>([\s\S]*?)<\/h1>/i.exec(k?.text??"")?.[1]?.replace(/<[^>]*>/g,"").trim(),R=typeof r?.title=="string"&&r.title.trim()?r.title.trim():b||s,N=w.units.some(x=>x.heading),h=w.items.map(x=>{let j=w.units[w.places.get(x.id)?.at],F=j?.where?.length?j.where:j?.heading?[j.text]:[];return{where:F,top:N&&F.length===0,blocks:x.anchor.blocks.filter(X=>w.units.some(rt=>rt.id===X)),whole:x.anchor.kind==="blocks",quote:x.anchor.quote,text:x.text}});return[200,{ok:!0,title:R,path:Ne.resolve(o.html),items:h}]}async function K(s){let{slug:w}=s??{};if(!T(w))return[400,{ok:!1,reason:"body"}];if(!await c(w).catch(()=>null))return[404,{ok:!1,reason:"missing"}];let r=await L(w);if(s.anchors&&typeof s.anchors=="object"&&!Array.isArray(s.anchors)){let N=r.items.map(x=>{let j=Object.hasOwn(s.anchors,x.id)?wn(s.anchors[x.id]):null;return j&&j.kind===x.anchor.kind?{...x,anchor:j}:x}),h=await E(w,N,r.text);return[200,B(w,{items:N,version:h})]}let o=r.items,k=null,b=null;if(s.put!==void 0){let N=o.find(x=>x.id===s.put?.id),h=Ae({...s.put,created:N?.created??s.put?.created});if(!h)return[400,{ok:!1,reason:"item"}];o=N?o.map(x=>x.id===h.id?h:x):[...o,h],k=h.id,N||U(w).set(h.id,$()),J(w,[h.id])}else if(typeof s.remove=="string")o=o.filter(N=>N.id!==s.remove);else if(s.clear===!0)b=o,o=[];else if(Array.isArray(s.restore)){let N=new Map(o.map(j=>[j.id,j])),h=s.restore.map(j=>Ae(j,j?.updated)).filter(j=>j&&!(N.get(j.id)?.updated>j.updated)),x=new Set(h.map(j=>j.id));for(let j of x)N.has(j)||U(w).set(j,$());o=[...o.filter(j=>!x.has(j.id)),...h],J(w,[...x])}else return[400,{ok:!1,reason:"body"}];let R=await D(w,{keep:k,items:o,before:r.text});return[200,{...B(w,R),...b?{removed:b}:{}}]}async function q(s){if(!T(s))return;let{text:w}=await L(s);w!==null&&await D(s)}return{list:H,copy:nt,change:K,afterWrite:q}}import ut from"node:fs/promises";import dt from"node:path";import{writeAtomic as Me}from"../browser/shared/files.mjs";import{slugPattern as Yt}from"../browser/shared/reports.mjs";var Rt=1,St={seen:"seen.html",base:"base.html",state:"state.json"},jn=4,On=1800*1e3;function Fe({stateDirectory:f=null,shown:c,folderOf:g,isPage:m=()=>!1,log:$=null,now:u=Date.now,quiet:O=On}){let p=new Map,y=r=>dt.join(f,"changes",r),M=Promise.resolve(),T=r=>{let o=M.then(r);return M=o.catch(k=>$?.(`changes: ${k.message}`)),o};async function L(r){if(!f)return p.get(r)?.state??null;try{let o=JSON.parse(await ut.readFile(dt.join(y(r),St.state),"utf8"));return o?.v===Rt&&typeof o.seen=="string"?o:null}catch{return null}}async function E(r,o){return f?ut.readFile(dt.join(y(r),St[o]),"utf8").catch(()=>null):p.get(r)?.[o]??null}async function v(r,o,k={}){if(!f){let b=p.get(r)??{};p.set(r,{...b,...k,state:o});return}await ut.mkdir(y(r),{recursive:!0});for(let[b,R]of Object.entries(k))R===null?await ut.rm(dt.join(y(r),St[b]),{force:!0}):await Me(dt.join(y(r),St[b]),R);await Me(dt.join(y(r),St.state),`${JSON.stringify(o)}
|
|
3
|
-
`)}async function G(r){p.delete(r),f&&await ut.rm(y(r),{recursive:!0,force:!0,maxRetries:3})}let J=async r=>Math.round((await ut.stat(g(r)).catch(()=>null))?.birthtimeMs??0),U=r=>r?.base?`${r.since}|${r.writes}`:null,D=r=>Number.isFinite(r?.draft)&&u()-r.draft<O?r.draft:null,B=(r,o,k,b=D(r))=>[{v:Rt,born:r?.born??0,seen:o,...b===null?{}:{draft:b}},{seen:k,base:null}];async function H(r){let o=await L(r);if(!o)return null;let k=await J(r);return o.born&&k&&o.born!==k?(await G(r),null):o}async function nt(r,o){if(typeof o!="string"||!Yt.test(r)||m(r))return!1;let k=W(o),b=await H(r);if(!b)return await v(r,{v:Rt,born:await J(r),seen:k},{seen:o}),!1;if(b.seen===k)return!1;let R=await E(r,"seen"),N=new Date(u()).toISOString();if(R===null)return await v(r,...B(b,k,o)),!1;let h=c(R),x=c(o);if(!b.base){if(!lt(h,x))return await v(r,...B(b,k,o)),!1;if(D(b)!==null||$e(h))return await v(r,...B(b,k,o,u())),!1;let{draft:X,...rt}=b;return await v(r,{...rt,seen:k,base:W(h),since:N,at:N,writes:1},{seen:o,base:h}),!0}let j=await E(r,"base");if(j===null||!lt(j,x))return await v(r,...B(b,k,o)),!0;let F=lt(h,x)!==null;return await v(r,{...b,seen:k,...F?{at:N,writes:b.writes+1}:{}},{seen:o}),F}async function K(r,o,k,b){if(!Yt.test(r)||m(r))return!1;let R=await H(r),N=W(o);if(!R?.base)return await v(r,...B(R??{born:await J(r)},N,o,b?null:D(R))),!1;let h=await E(r,"base");if(h!==null&&k)try{h=k(h)}catch(x){$?.(`changes: ${r}: the baseline did not take the edit (${x.message})`)}return h===null||!lt(h,c(o))?(await v(r,...B(R,N,o)),!0):(await v(r,{...R,seen:N,base:W(h)},{seen:o,base:h}),!1)}async function q(r,o){if(!Yt.test(r)||m(r))return{ended:!1,moved:!1};let k=typeof o=="string"?await nt(r,o):!1,b=await H(r);if(b?.draft===void 0)return{ended:!1,moved:k};let{draft:R,...N}=b;return await v(r,N),{ended:D(b)!==null,moved:k}}let s=new Map;async function w(r,o){await nt(r,o);let k=c(o),b=W(k),R=await H(r);if(!R?.base)return{pending:!1,version:b};let N=`${r} ${R.base} ${b}`,h=s.get(N);if(h===void 0){let x=await E(r,"base");for(h=x===null?null:lt(x,k),s.set(N,h);s.size>jn;)s.delete(s.keys().next().value)}return h?{pending:!0,version:b,stamp:U(R),since:R.since,writes:R.writes,...h}:{pending:!1,version:b}}return{look:(r,o)=>T(()=>nt(r,o)),wrote:(r,o,k=null,{reader:b=!1}={})=>T(()=>K(r,o,k,b)),endDraft:(r,o=null)=>T(()=>q(r,o)),read:(r,o)=>T(()=>w(r,o)),stamp:r=>T(async()=>U(await H(r))),snapshot:r=>T(async()=>{let o=await H(r);return o?{state:o,seen:await E(r,"seen"),base:await E(r,"base")}:null}),clear:r=>T(async()=>{let o=await H(r);o?.base&&await v(r,{v:Rt,born:o.born,seen:o.seen},{base:null})}),restore:(r,o)=>T(async()=>{o?.state&&await v(r,o.state,{seen:o.seen,base:o.base})}),forget:r=>T(()=>G(r)),idle:()=>T(async()=>{})}}import{randomBytes as Nn}from"node:crypto";import ot from"node:fs/promises";import mt from"node:path";import{FILE as An,readItems as En}from"../browser/shared/annotations.mjs";import{writeAtomic as Rn}from"../browser/shared/files.mjs";import{documentDirectory as Tn}from"../browser/shared/workspace.mjs";var Mn=20,Pe=/^\d{8}T\d{6}Z-[a-f0-9]{8}\.json$/,Ie=80,Je=({stateDirectory:f,slug:c})=>mt.join(f,"dropped-annotations",c),_e=f=>({id:f.id,text:f.text,quote:f.anchor?.quote??"",kind:f.anchor?.kind??"text"});async function Le({stateDirectory:f,reportsDirectory:c,slug:g,time:m,items:$}){let u=Je({stateDirectory:f,reportsDirectory:c,slug:g});await ot.mkdir(u,{recursive:!0});let O=m.replace(/[-:]/g,"").replace(/\.\d+Z$/,"Z");await Rn(mt.join(u,`${O}-${Nn(4).toString("hex")}.json`),JSON.stringify({time:m,items:$}));let p=(await ot.readdir(u)).filter(y=>Pe.test(y)).sort();await Promise.all(p.slice(0,Math.max(0,p.length-Mn)).map(y=>ot.rm(mt.join(u,y),{force:!0})))}async function Mr({stateDirectory:f,reportsDirectory:c,slug:g}){let m=Je({stateDirectory:f,reportsDirectory:c,slug:g}),$=(await ot.readdir(m).catch(()=>[])).filter(p=>Pe.test(p)).sort();if($.length===0)return[];let u=new Set(En(await ot.readFile(mt.join(Tn(g,c),An),"utf8").catch(()=>"")).map(p=>p.id)),O=[];for(let p of $){let y=mt.join(m,p);try{let M=JSON.parse(await ot.readFile(y,"utf8")),T=Array.isArray(M?.items)?M.items.filter(L=>typeof L?.id=="string"&&!u.has(L.id)):[];typeof M?.time=="string"&&T.length&&O.push({time:M.time,items:T})}catch{}await ot.rm(y,{force:!0}).catch(()=>{})}return O}var Fn=(f,c=new Date)=>{let g=new Date(f),m=u=>String(u).padStart(2,"0"),$=`${m(g.getHours())}:${m(g.getMinutes())}`;return g.toDateString()===c.toDateString()?$:`${g.getFullYear()}-${m(g.getMonth()+1)}-${m(g.getDate())} ${$}`},De=f=>{let c=String(f??"").replace(/\s+/g," ").trim();return JSON.stringify(c.length>Ie?`${c.slice(0,Ie-1)}\u2026`:c)};function Zt(f,{time:c=null,items:g},{today:m=new Date}={}){let $=mt.resolve(f),u=`${g.length} \u6279\u6CE8 (annotation${g.length===1?"":"s"})`;return[`annotations ${$}: ${c?`at ${Fn(c,m)}, `:""}Gallery deleted ${u} whose words are gone from the document (rewritten or deleted):`,...g.map(({id:O,text:p,quote:y,kind:M})=>` ${O} ${De(p)} on ${M==="blocks"?"the blocks ":""}${De(y)}`)]}function Fr(f,c,{today:g=new Date}={}){return c.length?[...c.flatMap(m=>Zt(f,m,{today:g}))," they were the reader's: say in your hand-off which your edit carried out and which you left, and never write them back"]:[]}import{randomBytes as In}from"node:crypto";import pt from"node:fs/promises";import vt from"node:path";import{writeAtomic as Dn}from"../browser/shared/files.mjs";var Pn=20,Ue=/^\d{8}T\d{6}Z-[a-f0-9]{8}\.json$/,Be=({stateDirectory:f,slug:c})=>vt.join(f,"rewrites",c);async function We({stateDirectory:f,reportsDirectory:c,slug:g,time:m,changes:$}){let u=Be({stateDirectory:f,reportsDirectory:c,slug:g});await pt.mkdir(u,{recursive:!0});let O=m.replace(/[-:]/g,"").replace(/\.\d+Z$/,"Z");await Dn(vt.join(u,`${O}-${In(4).toString("hex")}.json`),JSON.stringify({time:m,changes:$}));let p=(await pt.readdir(u)).filter(y=>Ue.test(y)).sort();await Promise.all(p.slice(0,Math.max(0,p.length-Pn)).map(y=>pt.rm(vt.join(u,y),{force:!0})))}async function Ye({stateDirectory:f,reportsDirectory:c,slug:g}){let m=Be({stateDirectory:f,reportsDirectory:c,slug:g}),$=(await pt.readdir(m).catch(()=>[])).filter(O=>Ue.test(O)).sort(),u=[];for(let O of $){let p=vt.join(m,O);try{let y=JSON.parse(await pt.readFile(p,"utf8"));typeof y?.time=="string"&&Array.isArray(y.changes)&&u.push(y)}catch{}await pt.rm(p,{force:!0}).catch(()=>{})}return u}var Jn=(f,c=new Date)=>{let g=new Date(f),m=u=>String(u).padStart(2,"0"),$=`${m(g.getHours())}:${m(g.getMinutes())}`;return g.toDateString()===c.toDateString()?$:`${g.getFullYear()}-${m(g.getMonth()+1)}-${m(g.getDate())} ${$}`};function Lr(f,c,{today:g=new Date}={}){if(!c.length)return[];let m=vt.resolve(f),$=[];for(let{time:u,changes:O}of c){let p=[];for(let{line:y,rule:M,key:T}of[...O].sort((L,E)=>L.line-E.line)){let L=`line ${y} ${M}${T?` ${T}`:""}`;p.includes(L)||p.push(L)}$.push(`preview ${m}: at ${Jn(u,g)}, when the reader edited the page, the preview wrote your natural HTML as the kit's markup: ${p.join(", ")}`),$.push(...O.filter(y=>y.note).map(({line:y,rule:M,note:T})=>` line ${y}, ${M}: ${T}`))}return $.push(" re-read the file before editing it (those lines are the file's as you had left it)"),$}import{EMPTY_STYLE as Qn,emptyWordsScript as Vn,showEmpty as qn}from"../browser/editor/components/placeholder.mjs";import{TOKENS as Xn}from"../browser/editor/page/look.mjs";import{MARGIN_STYLE as tr,earlyMarginScript as er}from"../browser/editor/page/margin.mjs";var zt=/^[a-f0-9]{16}$/,Ht=2*1024*1024,nr=Cn,Ze=50,Ce=/^\d{8}T\d{6}Z-[a-f0-9]{16}\.html$/,rr=30,ze=3,Ge=200,wt="\u6587\u4EF6\u4E00\u518D\u88AB\u4FEE\u6539\uFF08\u4F8B\u5982 AI \u6B63\u5728\u5199\u5165\uFF09\uFF0C\u7A0D\u540E\u518D\u540C\u6B65",ar="\u8FD9\u6B21\u7684\u4FEE\u6539\u592A\u5927\uFF0C\u4E00\u6B21\u5B58\u4E0D\u4E0B",or=250,Mt=Symbol("again"),sr="/__gallery/edit/src/editor/page/editor.mjs",ir=f=>new Promise(c=>setTimeout(c,f));function cr(f,c=Ht){return new Promise((g,m)=>{let $=[],u=0;f.on("data",O=>{u+=O.length,u>c?$.length=0:$.push(O)}),f.on("end",()=>u>c?m(new Error("too-large")):g(Buffer.concat($).toString("utf8"))),f.on("error",m)})}function fr(f){if(!f)return Gt(16).toString("hex");let c=I.join(f,"token");try{let m=Bn(c,"utf8").trim();if(/^[a-f0-9]{32}$/.test(m))return m}catch{}let g=Gt(16).toString("hex");try{Un(f,{recursive:!0,mode:448}),Wn(c,g,{mode:384})}catch{}return g}function ma({reportsDirectory:f=zn,stateDirectory:c=null,write:g=Tt,ids:m=!0,finish:$=M=>M,log:u=null,settling:O={},reviewing:p={},onChanges:y=()=>{}}={}){let M=fr(c),T=Oe(O),L=O.wait??je,E=async(t,n,e)=>{let a=await g(t,n,e);return a!==!1&&Kn(I.basename(t))&&T.wrote(I.basename(I.dirname(t)),n),a},v=t=>Hn(t,f),G=t=>jt(v(t)).html,J=new Map,U=c&&I.join(c,"snapshots"),D=Promise.resolve(),B=Promise.resolve(),H=async(t,n,e,{by:a="time"}={})=>{let i=(await Y.readdir(t)).filter(l=>n.test(l));if(i.length<=e)return;let d=a==="name"?i.sort():(await Promise.all(i.map(async l=>({name:l,time:(await Y.stat(I.join(t,l))).mtimeMs})))).sort((l,S)=>l.time-S.time).map(({name:l})=>l);await Promise.all(d.slice(0,d.length-e).map(l=>Y.rm(I.join(t,l),{force:!0})))},nt=(t,n)=>{U&&(D=D.then(async()=>{let e=I.join(U,`${t}.html`),a=new Date;try{await Y.utimes(e,a,a);return}catch{}await Y.mkdir(U,{recursive:!0}),await Tt(e,n),await H(U,/^[a-f0-9]{16}\.html$/,Ze)}).catch(()=>{}))},K=(t,n)=>{c&&(D=D.then(async()=>{let e=I.join(c,"history",t),a=W(n);if(await Y.mkdir(e,{recursive:!0}),(await Y.readdir(e)).filter(l=>Ce.test(l)).sort().at(-1)?.endsWith(`-${a}.html`))return;let d=new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d+Z$/,"Z");await Tt(I.join(e,`${d}-${a}.html`),n),await H(e,Ce,rr,{by:"name"})}).catch(()=>{}))},q=new Map,s=t=>c&&I.join(c,"receipts",t),w=(t,n,e,a)=>{for(q.set(`${t} ${n}`,{digest:e,answer:a});q.size>Ge*4;)q.delete(q.keys().next().value);let i=s(t);i&&(D=D.then(async()=>{await Y.mkdir(i,{recursive:!0}),await Tt(I.join(i,`${n}.json`),JSON.stringify({digest:e,answer:a})),await H(i,{test:d=>d.endsWith(".json")&&Ct.test(d.slice(0,-5))},Ge)}).catch(()=>{}))},r=async(t,n)=>{let e=q.get(`${t} ${n}`);if(e)return e;let a=s(t);if(!a)return null;await D;try{let i=JSON.parse(await Y.readFile(I.join(a,`${n}.json`),"utf8"));return typeof i?.digest=="string"&&i.answer?.ok?i:null}catch{return null}},o=new Map,k=(t,n)=>{let e=new Date().toISOString();if(!c)return void o.set(t,[...o.get(t)??[],{time:e,changes:n}].slice(-20));D=D.then(()=>We({stateDirectory:c,reportsDirectory:f,slug:t,time:e,changes:n})).catch(()=>{})},b=async t=>{if(!c){let n=o.get(t)??[];return o.delete(t),n}return await D,Ye({stateDirectory:c,reportsDirectory:f,slug:t})},R=(t,n)=>{for(J.delete(t),J.set(t,n);J.size>Ze;)J.delete(J.keys().next().value);nt(t,n)},N=async t=>{if(J.has(t))return J.get(t);if(!U||!zt.test(t))return null;await D;let n=await Y.readFile(I.join(U,`${t}.html`),"utf8").catch(()=>null);return n===null||W(n)!==t?null:(R(t,n),n)},h=new Map,x=t=>{let n=h.get(t);if(n)return n;let e=ge(t,{finish:$});for(h.set(t,e);h.size>8;)h.delete(h.keys().next().value);return e},j=I.join(I.resolve(f),".gallery","pages"),F=Fe({...p,stateDirectory:c,shown:t=>x(t).text,folderOf:v,log:u,isPage:t=>I.resolve(v(t)).startsWith(j+I.sep)}),X=(t,n)=>n.then(e=>{e&&y(t)},e=>u?.(`${t}: the Agent's changes not kept (${e.message})`));async function rt(t,n=void 0){if(typeof t!="string"||!et.test(t))return null;let e=G(t),a=n!==void 0?n:await Y.readFile(e,"utf8").catch(()=>null);if(a===null)return null;let{text:i,changes:d}=x(a);return{file:e,source:a,text:i,version:W(i),changes:d}}async function st(t){if(typeof t!="string"||!et.test(t))return{source:null,held:!1,signs:[],wait:0,own:!1};let n=G(t),e=await Y.readFile(n,"utf8").catch(()=>null),a=(await Y.stat(n).catch(()=>null))?.mtimeMs??0;return{source:e,...T.judge(t,{source:e,mtime:a})}}async function ht(t,n=Date.now()+L){for(;;){let e=await st(t);if(!e.held||Date.now()>=n)return e;await ir(Math.max(0,Math.min(or,n-Date.now())))}}async function Ft(t,{wait:n=L}={}){let e=await ht(t,Date.now()+n);return rt(t,e.held&&e.taken!==void 0?e.taken:e.source)}function He(t,n,{editor:e=sr,kitTags:a=()=>[]}={}){let{html:i,map:d}=de(n);R(d.version,n);let l=ce(f),S=fe(l).map(({assets:C,...V})=>({...V,kit:a(C)})),A=`<script type="application/json" id="doc-edit-map" data-doc-dev>${JSON.stringify({slug:t,token:M,...d,components:S,hidden:l.settings.hidden}).replace(/</g,"\\u003c")}</script>
|
|
4
|
-
<script data-doc-dev>document.currentScript.remove(); import(${JSON.stringify(e)});</script>`,Z=`<style data-doc-dev>.doc-display { display: none; }</style>
|
|
5
|
-
<style data-doc-dev data-ge-palette>${Xn}</style>
|
|
6
|
-
<style data-doc-dev>${Qn}</style>
|
|
7
|
-
<script data-doc-dev>${Vn()}</script>
|
|
8
|
-
<script data-doc-dev>document.currentScript.remove(); document.documentElement.setAttribute("data-ge-order", "file");</script>
|
|
9
|
-
<style data-doc-dev data-ge-margin-style>${tr}</style>
|
|
10
|
-
<script data-doc-dev>document.currentScript.remove(); ${er(t,{notes:Ln(I.join(v(t),Yn))})}</script>`;return{html:qn(i),snippet:A,head:Z}}let Ke=t=>R(W(t),t);async function it(t,n=Ht){if(t.method!=="POST")return{error:[405,{ok:!1,reason:"method"}]};let e=t.headers.host??"",a=t.socket.localPort;if(e!==`127.0.0.1:${a}`&&e!==`localhost:${a}`)return{error:[403,{ok:!1,reason:"host"}]};if(t.headers.origin!==`http://${e}`)return{error:[403,{ok:!1,reason:"origin"}]};if(t.headers["x-gallery-token"]!==M)return{error:[403,{ok:!1,reason:"token"}]};if(!/^application\/json\b/i.test(t.headers["content-type"]??""))return{error:[415,{ok:!1,reason:"type"}]};try{return{body:JSON.parse(await cr(t,n))}}catch(i){return{error:i.message==="too-large"?[413,{ok:!1,reason:"body",message:ar}]:[400,{ok:!1,reason:"body"}]}}}async function Qe(t,n){let{slug:e,opening:a,known:i=null,texts:d=[],units:l=[],touch:S=[],pageIds:P=null,request:A=null,agent:Z=!1}=t;if(typeof e!="string"||!et.test(e)||![d,l,S].every(Array.isArray))return[400,{ok:!1,reason:"body"}];if(A!==null&&(typeof A!="string"||!Ct.test(A)))return[400,{ok:!1,reason:"body"}];let C=A===null?null:W(JSON.stringify([a??null,d,l,S])),V=await Kt(t);if(V)return V;let z=at=>(A!==null&&w(e,A,C,at),[200,at]),Q=G(e),tt=typeof a=="string"&&zt.test(a)?await N(a):null,ee=at=>_n("sha256",M).update(`${e}
|
|
11
|
-
${at}`).digest("hex").slice(0,32);for(let at=1;;at++){let{source:$t,held:un}=await st(e);if($t===null)return[404,{ok:!1,reason:"missing"}];if(un)return Date.now()<n?Mt:[409,{ok:!1,reason:"busy",message:wt}];X(e,F.look(e,$t));let{text:xt,changes:Lt}=x($t),ne=[],At=pe({current:xt,opening:tt,texts:d,units:l,touch:S,ids:m?()=>{let Et=typeof m=="function"?m():Ut();return ne.push(Et),Et}:!1,seal:ee,pageIds:P}),{title:re,icon:ae,...oe}=At,ft=At.text===xt?xt:$(At.text);ft!==At.text&&(oe.version=W(ft));let se={...oe,foreign:typeof i=="string"&&W(xt)!==i};if(ft===xt)return z({ok:!0,...se,wrote:!1,notes:[]});if(K(e,$t),!await E(Q,ft,{expect:$t})){if(at===ze)return[409,{ok:!1,reason:"busy",message:wt}];continue}K(e,ft),X(e,F.wrote(e,ft,Et=>{let mn=0;return xe(Et,{opening:tt,texts:d,units:l,touch:S,pageIds:P,seal:ee,ids:m?()=>ne[mn++]??(typeof m=="function"?m():Ut()):!1})},{reader:Z!==!0})),Lt.length&&(u&&u(Bt(Q,Lt).join(`
|
|
12
|
-
`)),k(e,Lt));let dn=[...re?await Ot(I.dirname(Q),re):[],...ae!==void 0?await It(I.dirname(Q),ae):[]];return z({ok:!0,...se,wrote:!0,notes:dn})}}async function Kt({slug:t,opening:n,texts:e=[],units:a=[],touch:i=[],request:d=null}){if(typeof t!="string"||!et.test(t)||typeof d!="string"||!Ct.test(d)||![e,a,i].every(Array.isArray))return null;let l=await r(t,d);return l?l.digest===W(JSON.stringify([n??null,e,a,i]))?[200,{...l.answer,again:!0}]:[409,{ok:!1,reason:"request",message:"\u540C\u4E00\u6B21\u4FDD\u5B58\u7684\u5185\u5BB9\u4E0D\u4E00\u81F4"}]:null}async function Ve(t,n){let{slug:e,opening:a,texts:i=[],units:d=[],instances:l=[],pageIds:S=null}=t;if(typeof e!="string"||!et.test(e)||!Array.isArray(i)||!Array.isArray(d)||!Array.isArray(l))return[400,{ok:!1,reason:"body"}];let{source:P,held:A}=await st(e);if(A)return Date.now()<n?Mt:[409,{ok:!1,reason:"busy",message:wt}];let Z=await rt(e,P);if(Z===null)return[404,{ok:!1,reason:"missing"}];let{text:C,version:V}=Z,z=typeof a=="string"&&zt.test(a)?await N(a):null;return[200,{ok:!0,version:V,reverted:ye({current:C,opening:z,texts:i,pageIds:S}),units:we({current:C,units:d}),parts:he({current:C,instances:l,pageIds:S})}]}let qe=600*1e3,yt=new Map;async function Qt(t,n){let e=v(t),a=null;try{a=JSON.parse(await Y.readFile(jt(e).json,"utf8"))}catch{}let{title:i,icon:d}=be(n,a);i&&typeof a?.title=="string"&&a.title!==i.to&&await Ot(e,{from:a.title,to:i.to,synced:!0}),d&&!d.missing&&await It(e,d.to)}async function Xe(t,n){let{slug:e,action:a,stamp:i=null,undo:d=null}=t;if(typeof e!="string"||!et.test(e)||!["accept","revert","undo"].includes(a))return[400,{ok:!1,reason:"body"}];let l=G(e),{source:S,held:P}=await st(e);if(S===null)return[404,{ok:!1,reason:"missing"}];if(P)return Date.now()<n?Mt:[409,{ok:!1,reason:"busy",message:wt}];if(a==="undo"){for(let[Q,tt]of yt)Date.now()-tt.at>qe&&yt.delete(Q);let z=typeof d=="string"?yt.get(d):null;return!z||z.slug!==e?[404,{ok:!1,reason:"gone",message:"\u64A4\u9500\u5DF2\u7ECF\u8FC7\u671F"}]:S!==z.after?[409,{ok:!1,reason:"moved-on",message:"\u64A4\u56DE\u4E4B\u540E\u6587\u6863\u53C8\u6539\u8FC7\u4E86\uFF0C\u6CA1\u6CD5\u64A4\u9500"}]:(K(e,S),await E(l,z.before,{expect:S})?(K(e,z.before),yt.delete(d),await Qt(e,z.before),await F.restore(e,z.saved),await F.wrote(e,z.before),y(e),[200,{ok:!0,version:W(x(z.before).text)}]):[409,{ok:!1,reason:"busy",message:wt}])}await F.look(e,S);let A=await F.snapshot(e),Z=A?.state?.base?`${A.state.since}|${A.state.writes}`:null;if(Z===null)return[200,{ok:!0,none:!0}];if(Z!==i)return[409,{ok:!1,reason:"changed",message:"Agent \u521A\u521A\u53C8\u6539\u4E86\u6587\u6863\uFF0C\u518D\u770B\u4E00\u773C"}];if(a==="accept")return await F.clear(e),y(e),[200,{ok:!0}];let C=A.base;if(K(e,S),!await E(l,C,{expect:S}))return[409,{ok:!1,reason:"busy",message:wt}];K(e,C),await Qt(e,C);let V=Gt(8).toString("hex");return yt.set(V,{slug:e,before:S,after:C,saved:A,at:Date.now()}),await F.clear(e),await F.wrote(e,C),y(e),[200,{ok:!0,version:W(x(C).text),undo:V}]}async function tn(t,n){let e=await it(t);if(e.error)return _(n,...e.error);let a=e.body??{};try{if(a.action!=="read")return _(n,...await qt(a,Xe));if(typeof a.slug!="string"||!et.test(a.slug))return _(n,400,{ok:!1,reason:"body"});let i=await Ft(a.slug,{wait:0});return i===null?_(n,404,{ok:!1,reason:"missing"}):_(n,200,{ok:!0,...await F.read(a.slug,i.source)})}catch(i){return _(n,500,{ok:!1,reason:"write",message:i.message})}}async function Ot(t,{from:n,to:e,synced:a}){let i=["\u6807\u9898\u5DF2\u66F4\u65B0",...a?[]:["\u5355\u72EC\u6253\u5F00\u6216\u5BFC\u51FA\u65F6\u7684\u9875\u9762\u540D\u79F0\u539F\u672C\u5C31\u548C\u6807\u9898\u4E0D\u540C\uFF0C\u6CA1\u6709\u8DDF\u7740\u6539"]],d=jt(t).json,l=await Y.readFile(d,"utf8").catch(()=>""),S=null;try{S=JSON.parse(l)}catch{}if(S?.title!==n)return[...i,"\u641C\u7D22\u548C\u4FA7\u680F\u91CC\uFF08\u6CA1\u6253\u5F00\u8FD9\u4EFD\u6587\u6863\u65F6\uFF09\u7684\u6587\u6863\u540D\u539F\u672C\u5C31\u548C\u6807\u9898\u4E0D\u540C\uFF0C\u6CA1\u6709\u8DDF\u7740\u6539"];let P=new RegExp(`("title"\\s*:\\s*)${JSON.stringify(n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`),A=P.test(l)?l.replace(P,(Z,C)=>C+JSON.stringify(e)):`${JSON.stringify({...S,title:e},null,2)}
|
|
13
|
-
`;try{await E(d,A)}catch(Z){return u?.(`${I.basename(d)}'s title was not written (${Z.code??Z.message}): ${d}`),[...i,"\u641C\u7D22\u548C\u4FA7\u680F\u91CC\uFF08\u6CA1\u6253\u5F00\u8FD9\u4EFD\u6587\u6863\u65F6\uFF09\u7684\u6587\u6863\u540D\u6CA1\u80FD\u8DDF\u7740\u6539"]}return i}async function It(t,n){let e=jt(t).json,a=null;try{a=JSON.parse(await Y.readFile(e,"utf8"))}catch{}if(!a||typeof a!="object")return u?.(`${I.basename(e)} could not be read, so its icon was not written: ${e}`),["\u9875\u9762\u56FE\u6807\u5DF2\u66F4\u6362\uFF0C\u4F46\u641C\u7D22\u548C\u4FA7\u680F\u91CC\uFF08\u6CA1\u6253\u5F00\u8FD9\u4EFD\u6587\u6863\u65F6\uFF09\u7684\u56FE\u6807\u6CA1\u80FD\u8DDF\u7740\u6362"];if((a.icon??null)===n)return[];let{icon:i,...d}=a,l=n===null?d:{...d,icon:n};try{await E(e,`${JSON.stringify(l,null,2)}
|
|
14
|
-
`)}catch(S){return u?.(`${I.basename(e)}'s icon was not written (${S.code??S.message}): ${e}`),["\u9875\u9762\u56FE\u6807\u5DF2\u66F4\u6362\uFF0C\u4F46\u641C\u7D22\u548C\u4FA7\u680F\u91CC\uFF08\u6CA1\u6253\u5F00\u8FD9\u4EFD\u6587\u6863\u65F6\uFF09\u7684\u56FE\u6807\u6CA1\u80FD\u8DDF\u7740\u6362"]}return[]}async function en(t,n){let e=typeof n=="string"?n.replace(/\s+/g," ").trim():"";if(!e)return{ok:!1,reason:"title",message:"\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"};let a=G(t),i=await Y.readFile(a,"utf8").catch(()=>null);if(i===null)return{ok:!1,reason:"missing"};X(t,F.look(t,i));let d=ie(i),l=le(d).find(A=>A.kind==="title");if(!l)return{ok:!1,reason:"no-title",message:"\u8FD9\u4EFD\u6587\u6863\u6CA1\u6709\u6807\u9898"};let S=Zn(e),P=me({current:d,edits:[{id:l.id,parts:[{keep:!0,html:S}]}],ids:m});return P.ok?P.text!==i&&!await E(a,P.text,{expect:i})?{ok:!1,reason:"changed-again"}:(P.text!==i&&X(t,F.wrote(t,P.text,A=>Se(A,S))),{ok:!0,title:e,notes:P.title?await Ot(I.dirname(a),P.title):[]}):{ok:!1,reason:"conflict"}}let gt=t=>(n,e)=>{let a=B.then(()=>t(n));return B=a.catch(()=>{}),a.then(([i,d])=>_(e,i,d),i=>_(e,500,{ok:!1,reason:"write",message:i.message}))},Vt=(t,{early:n=null}={})=>async(e,a)=>{let i=await it(e);if(i.error)return _(a,...i.error);let d=i.body??{};try{let l=n&&await n(d);return l?_(a,...l):_(a,...await qt(d,t))}catch(l){return _(a,500,{ok:!1,reason:"write",message:l.message})}};async function qt(t,n){let e=Date.now()+L;for(;;){await ht(t.slug,e);let a=B.then(()=>n(t,e));B=a.catch(()=>{});let i=await a;if(i!==Mt)return i}}async function Dt(t,{reader:n=!1}={}){if(typeof t!="string"||!et.test(t))return{ok:!1,reason:"missing",message:"\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863"};let e=v(t),{html:a,json:i}=jt(e);for(let d=1;;d++){let{source:l,held:S}=n?await st(t):{source:await Y.readFile(a,"utf8").catch(()=>null),held:!1};if(l===null)return{ok:!1,reason:"missing",message:"\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863"};if(S)return{ok:!1,reason:"busy",message:"\u6587\u4EF6\u4E00\u518D\u88AB\u4FEE\u6539\uFF08\u4F8B\u5982 AI \u6B63\u5728\u5199\u5165\uFF09\uFF0C\u6CA1\u6709\u5199\u5165"};X(t,F.look(t,l));let P=null;try{P=JSON.parse(await Y.readFile(i,"utf8"))}catch{}let{text:A,changes:Z,added:C,given:V,repeated:z,title:Q,icon:tt}=ke(l,{finish:$,next:typeof m=="function"?m:void 0,metadata:P});if(A!==l){if(K(t,l),!await E(a,A,{expect:l})){if(d===ze)return{ok:!1,reason:"busy",message:"\u6587\u4EF6\u4E00\u518D\u88AB\u4FEE\u6539\uFF08\u4F8B\u5982 AI \u6B63\u5728\u5199\u5165\uFF09\uFF0C\u6CA1\u6709\u5199\u5165"};continue}K(t,A),X(t,F.wrote(t,A)),n&&Z.length&&(u&&u(Bt(a,Z).join(`
|
|
15
|
-
`)),k(t,Z))}return Q&&typeof P?.title=="string"&&P.title!==Q.to&&await Ot(e,{from:P.title,to:Q.to,synced:Q.page}),tt&&!tt.missing&&await It(e,tt.to),{ok:!0,changes:A===l?[]:Z,added:A===l?0:C,given:A===l?[]:V,repeated:z,written:A!==l,title:Q,icon:tt}}}let nn=async(t,{reader:n=!1}={})=>{n&&await ht(t);let e=B.then(()=>Dt(t,{reader:n}));return B=e.catch(()=>{}),e};async function Pt(t){let n=await it(t);if(n.error)return{refused:n.error};let{slug:e,workspace:a}=n.body??{};return typeof e!="string"||!et.test(e)||typeof a!="string"?{refused:[400,{ok:!1,reason:"body"}]}:Gn(a,f)?{slug:e}:{refused:[409,{ok:!1,reason:"elsewhere",message:"\u8FD9\u4E2A\u9884\u89C8\u670D\u52A1\u5668\u7BA1\u7684\u662F\u53E6\u4E00\u4E2A\u76EE\u5F55\u7684\u6587\u6863"}]}}async function rn(t,n){try{let e=B.then(async()=>{let{slug:d,refused:l}=await Pt(t);if(l)return{answer:l};let S=await Dt(d);return{slug:S.ok?d:null,answer:[S.ok?200:S.reason==="missing"?404:409,S]}});B=e.catch(()=>{});let{slug:a,answer:i}=await e;return a&&await _t(a),_(n,...i)}catch(e){return _(n,500,{ok:!1,reason:"write",message:e.message})}}async function an(t){let{slug:n,refused:e}=await Pt(t);return e||(await _t(n),[200,{ok:!0}])}async function Xt(t){let{source:n}=await ht(t),{ended:e,moved:a}=await F.endDraft(t,n);return a&&y(t),e}async function on(t){let{slug:n,refused:e}=await Pt(t);return e||[200,{ok:!0,ended:await Xt(n)}]}let ct=ve({reportsDirectory:f}),kt=Te({reportsDirectory:f,read:t=>Ft(t,{wait:0}),write:E,dropped:(t,n)=>{let e=n.map(_e);u&&u(Zt(I.join(v(t),"annotations.json"),{items:e}).join(`
|
|
16
|
-
`)),c&&(D=D.then(()=>Le({stateDirectory:c,reportsDirectory:f,slug:t,time:new Date().toISOString(),items:e})).catch(()=>{}))}}),te=Promise.resolve(),Jt=t=>{let n=te.then(t);return te=n.catch(()=>{}),n},sn=t=>(n,e)=>Jt(()=>t(n)).then(([a,i])=>_(e,a,i),a=>_(e,500,{ok:!1,reason:"write",message:a.message})),cn=300,bt=new Map;async function _t(t){let n=bt.get(t);n&&(clearTimeout(n.timer),bt.delete(t));let e=Jt(()=>kt.afterWrite(t));n&&e.then(n.resolve,n.reject),await e.catch(a=>u?.(`${t}: annotations not checked: ${a.message}`)),await D}let fn=t=>{let n=t.headers.host??"",e=t.socket.localPort;return n!==`127.0.0.1:${e}`&&n!==`localhost:${e}`?[403,{ok:!1,reason:"host"}]:t.headers["x-gallery-token"]!==M?[403,{ok:!1,reason:"token"}]:null};async function ln(t){if(t.method==="GET"){let e=fn(t);if(e)return e;let a=new URL(t.url??"/","http://localhost").searchParams;return a.get("as")==="copy"?kt.copy(a.get("slug")):kt.list(a.get("slug"))}let n=await it(t);return n.error??kt.change(n.body)}let Nt=(t,n=Ht)=>async e=>{let a=await it(e,n);return a.error??t(a.body)};return{token:M,preview:He,opened:Ke,check:it,upload:gt(Nt(ct.upload,nr)),addEmoji:gt(Nt(ct.addEmoji)),unfurl:gt(Nt(ct.unfurl)),annotations:sn(ln),checkAnnotations(t){let n=bt.get(t);return n||(n={timer:0},n.done=new Promise((e,a)=>Object.assign(n,{resolve:e,reject:a})),bt.set(t,n)),clearTimeout(n.timer),n.timer=setTimeout(()=>{bt.delete(t),Jt(()=>kt.afterWrite(t)).then(n.resolve,n.reject)},cn),n.done},frameable:gt(Nt(ct.frameable)),listEmojis:ct.listEmojis,readEmoji:ct.readEmoji,respond:gt,keepVersion:K,renameReport:en,read:rt,settled:st,whenTaken:ht,readTaken:Ft,takeRewrites:b,handIn:nn,handInReport:Dt,handInRequest:rn,settleRequest:(t,n)=>an(t).then(([e,a])=>_(n,e,a),e=>_(n,500,{ok:!1,reason:"write",message:e.message})),settleNotes:_t,roundRequest:(t,n)=>on(t).then(([e,a])=>_(n,e,a),e=>_(n,500,{ok:!1,reason:"write",message:e.message})),beginRound:Xt,commit:Vt(Qe,{early:Kt}),reverted:Vt(Ve),changes:tn,noteTaken:(t,n)=>F.look(t,n),forgetChanges:t=>F.forget(t),stored:async()=>{await F.idle(),await D}}}export{Mr as a,Fr as b,Ye as c,Lr as d,ma as e};
|
package/dist/chunk-AJ73XJF3.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-LEF6DRCK.mjs";import"./chunk-TX6JH7TR.mjs";import"./chunk-64K7IPLO.mjs";import"./chunk-NSKUTQ5J.mjs";import"./chunk-BGGDRNYQ.mjs";import"./chunk-6QXGZM36.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-W4VKN3GF.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{e as keyOf,d as missingSaid,b as packageFolder,a as packageNamed,f as run,c as shallowSaid};
|