@heycys/gallery 0.2.2 → 0.2.4
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/README.md +1 -1
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/assets/preview/runtime.js +156 -0
- package/assets/preview/shell.html +107 -0
- package/assets/writing-preferences.md +1 -1
- package/browser/editor/components/divider/index.mjs +1 -1
- package/browser/editor/page/annotate/card.mjs +6 -0
- package/browser/editor/page/annotate/index.mjs +22 -2
- package/browser/editor/page/columns/index.mjs +1 -1
- package/browser/editor/page/conflicts.mjs +1 -1
- package/browser/editor/page/drag/index.mjs +1 -1
- package/browser/editor/page/editor.mjs +43 -5
- package/browser/editor/page/focus.mjs +104 -0
- package/browser/editor/page/handle/index.mjs +14 -2
- package/browser/editor/page/links/index.mjs +2 -2
- package/browser/editor/page/quiet.mjs +3 -3
- package/browser/editor/page/resize/index.mjs +1 -1
- package/browser/editor/page/session.mjs +4 -1
- package/browser/editor/page/ui.mjs +1 -1
- package/browser/shared/annotations.mjs +22 -3
- package/browser/shared/block-packs.mjs +13 -4
- package/browser/shared/document-look.mjs +14 -0
- package/browser/shared/drafts.mjs +1 -1
- package/browser/shared/extension-manifest.mjs +40 -12
- package/browser/shared/favorite-merge.mjs +17 -0
- package/browser/shared/favorites.mjs +77 -0
- package/browser/shared/i18n/en.mjs +123 -24
- package/browser/shared/outline-ops.mjs +109 -0
- package/browser/shared/outline.mjs +6 -0
- package/browser/shared/pages.mjs +20 -8
- package/browser/shared/paths.mjs +5 -2
- package/browser/shared/preference-documents.mjs +137 -0
- package/browser/shared/presence.mjs +94 -0
- package/browser/shared/preview-server.mjs +8 -5
- package/browser/shared/qa-levels.mjs +9 -1
- package/browser/shared/session.mjs +4 -0
- package/browser/shared/shipped-blocks.mjs +22 -4
- package/browser/shared/startup.mjs +101 -0
- package/browser/shared/workspace-address.mjs +3 -0
- package/browser/shared/workspace-columns.mjs +1 -1
- package/browser/shared/workspace-look.mjs +21 -8
- package/browser/shared/workspace-registry.mjs +6 -3
- package/browser/shared/workspace.mjs +37 -10
- package/browser/shared/writing-preferences.mjs +2 -42
- package/dist/chunk-25LYSMAE.mjs +2 -0
- package/dist/chunk-2I6ZVC5O.mjs +2 -0
- package/dist/{chunk-M4NRDYI5.mjs → chunk-2MYTOOP6.mjs} +1 -1
- package/dist/chunk-2VNENLER.mjs +2 -0
- package/dist/chunk-3FERXZF5.mjs +4 -0
- package/dist/chunk-3M6SBBGU.mjs +2 -0
- package/dist/chunk-3VCAAF34.mjs +2 -0
- package/dist/{chunk-JXXHAXYH.mjs → chunk-3ZTRLGSA.mjs} +1 -1
- package/dist/chunk-4FRA5AUE.mjs +2 -0
- package/dist/chunk-4LR2QEC2.mjs +4 -0
- package/dist/chunk-56SVJENP.mjs +966 -0
- package/dist/chunk-5CQISL2G.mjs +4 -0
- package/dist/{chunk-RRKJMHNX.mjs → chunk-5I5ZDDWC.mjs} +5 -5
- package/dist/chunk-5IHDLEB4.mjs +10 -0
- package/dist/chunk-5LRDMV7O.mjs +2 -0
- package/dist/chunk-5MVUYRKG.mjs +5 -0
- package/dist/chunk-5TLLIZT7.mjs +2 -0
- package/dist/chunk-6ILJWFYW.mjs +4 -0
- package/dist/chunk-6N25CJ6Y.mjs +3 -0
- package/dist/{chunk-SQ6Y2ZMA.mjs → chunk-7DTINW6U.mjs} +2 -2
- package/dist/chunk-7KWAGKIK.mjs +2 -0
- package/dist/chunk-7WNUOAFK.mjs +2 -0
- package/dist/chunk-7XCRW5RC.mjs +2 -0
- package/dist/{chunk-ERE2BXYV.mjs → chunk-7XSDTILF.mjs} +1 -1
- package/dist/chunk-ABKYFOVR.mjs +2 -0
- package/dist/chunk-AMUF7PUN.mjs +2 -0
- package/dist/{chunk-PLB7L22J.mjs → chunk-B2EIMERT.mjs} +2 -2
- package/dist/{chunk-QNECWMGR.mjs → chunk-B45IAAU6.mjs} +1 -1
- package/dist/chunk-B6RAGF4R.mjs +2 -0
- package/dist/chunk-BSJKFE7I.mjs +4 -0
- package/dist/chunk-C72EEVLK.mjs +2 -0
- package/dist/chunk-CRAUKZ23.mjs +4 -0
- package/dist/chunk-F4CT35KL.mjs +2 -0
- package/dist/chunk-F63BNJLG.mjs +2 -0
- package/dist/chunk-FBKUPS44.mjs +2 -0
- package/dist/chunk-FL52ZL5Z.mjs +15 -0
- package/dist/chunk-FOZCU4VW.mjs +2 -0
- package/dist/chunk-G5HV7BC3.mjs +2 -0
- package/dist/{chunk-ERLAIBOA.mjs → chunk-GB5SOYQJ.mjs} +2 -2
- package/dist/chunk-GN3SG3IF.mjs +2 -0
- package/dist/{chunk-6QWQXHAV.mjs → chunk-HFTBVEZK.mjs} +1 -1
- package/dist/chunk-IOW5HLRK.mjs +2 -0
- package/dist/chunk-IQ3GJNTI.mjs +6 -0
- package/dist/chunk-K6SPFBUJ.mjs +2 -0
- package/dist/chunk-K7Y7SPTS.mjs +2 -0
- package/dist/chunk-L2IJCEUH.mjs +2 -0
- package/dist/{chunk-GPIWQ4X4.mjs → chunk-L3VT6LM4.mjs} +1 -1
- package/dist/chunk-L4WLQYFC.mjs +5 -0
- package/dist/{chunk-FFV733MA.mjs → chunk-LAMCAGK6.mjs} +1 -1
- package/dist/chunk-LHGKPMTI.mjs +2 -0
- package/dist/chunk-LJZIYVNA.mjs +3 -0
- package/dist/chunk-LSVCTLS2.mjs +2 -0
- package/dist/chunk-LZY74XTP.mjs +2 -0
- package/dist/chunk-MC4LRSVH.mjs +2 -0
- package/dist/chunk-MCEXN4G5.mjs +2 -0
- package/dist/chunk-MTLAOCFF.mjs +181 -0
- package/dist/chunk-MZ66LN3B.mjs +2 -0
- package/dist/chunk-N5QWJRRI.mjs +2 -0
- package/dist/chunk-NF4MMOUB.mjs +2 -0
- package/dist/chunk-NHJYAJ73.mjs +3 -0
- package/dist/chunk-NRSD7SVY.mjs +2 -0
- package/dist/chunk-NT23I4XW.mjs +2 -0
- package/dist/chunk-NUALABIS.mjs +3 -0
- package/dist/chunk-NW6LAU22.mjs +2 -0
- package/dist/chunk-NWWHDGKF.mjs +5 -0
- package/dist/chunk-OFRCVMSJ.mjs +2 -0
- package/dist/chunk-OKVQQ3CX.mjs +4 -0
- package/dist/chunk-OM24O4KR.mjs +8 -0
- package/dist/{chunk-4B2TB5K2.mjs → chunk-PBMOC7KA.mjs} +2 -2
- package/dist/chunk-PVTCP43W.mjs +2 -0
- package/dist/chunk-Q62HZAJS.mjs +2 -0
- package/dist/chunk-QBJWIR3Q.mjs +2 -0
- package/dist/chunk-QDSEZX7Z.mjs +6 -0
- package/dist/chunk-QR4V4A2Z.mjs +15 -0
- package/dist/{chunk-QVGOPHOF.mjs → chunk-QRLVVZ3R.mjs} +1 -1
- package/dist/chunk-QW3QG67J.mjs +2 -0
- package/dist/chunk-R2T2EVWY.mjs +8 -0
- package/dist/{chunk-GJJRBGMY.mjs → chunk-R5RERE6G.mjs} +1 -1
- package/dist/chunk-RFHEWT3Y.mjs +5 -0
- package/dist/chunk-RS2Z2JQP.mjs +2 -0
- package/dist/chunk-S6YEC4GE.mjs +16 -0
- package/dist/chunk-SHZLMGGW.mjs +2 -0
- package/dist/chunk-TALJQM2O.mjs +2 -0
- package/dist/chunk-TLNJWEFY.mjs +22 -0
- package/dist/{chunk-6Q7ASAXJ.mjs → chunk-TQZU7D7C.mjs} +1 -1
- package/dist/chunk-UTKNWYBA.mjs +2 -0
- package/dist/chunk-V3TM3TEN.mjs +2 -0
- package/dist/chunk-V3XROSP5.mjs +7 -0
- package/dist/{chunk-6QBHU4DF.mjs → chunk-V5JTW2LH.mjs} +1 -1
- package/dist/chunk-VAXLSISW.mjs +4 -0
- package/dist/chunk-VBHI3RG6.mjs +2 -0
- package/dist/{chunk-6L6V7YR2.mjs → chunk-VKZJRGDR.mjs} +1 -1
- package/dist/chunk-VZXZM7NS.mjs +2 -0
- package/dist/chunk-WDS6HEPE.mjs +2 -0
- package/dist/chunk-WHGANNEY.mjs +13 -0
- package/dist/chunk-WMJWC4QY.mjs +56 -0
- package/dist/{chunk-VZ2RQ3AM.mjs → chunk-WWONJJQS.mjs} +1 -1
- package/dist/chunk-X4WNLFIK.mjs +2 -0
- package/dist/chunk-XNNCQROX.mjs +11 -0
- package/dist/chunk-XRYECF23.mjs +170 -0
- package/dist/{chunk-K3JKPFL5.mjs → chunk-Z4NEXXFK.mjs} +1 -1
- package/dist/{chunk-236JJXWY.mjs → chunk-ZFVF2YPV.mjs} +2 -2
- package/dist/chunk-ZM2IX3R2.mjs +2 -0
- package/dist/chunk-ZNGGDUZI.mjs +2 -0
- package/dist/chunk-ZOEJQOKT.mjs +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/update-fetch.mjs +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/runtime.js +1 -0
- package/package.json +1 -1
- package/release.json +4 -4
- package/skill/SKILL.md +54 -148
- package/skill/references/building-blocks.md +4 -4
- package/skill/references/charts-and-figures.md +73 -0
- package/skill/references/extensions.md +47 -4
- package/skill/references/pages-and-data.md +22 -3
- package/skill/references/preference-files.md +7 -0
- package/skill/references/previews.md +17 -0
- package/skill/references/writing-html.md +21 -82
- package/web/assets/index-B4uUluLM.js +15 -0
- package/web/assets/index-C3vHT8sH.css +1 -0
- package/web/index.html +2 -2
- package/dist/chunk-2KAVXMKG.mjs +0 -4
- package/dist/chunk-2T4PZQEP.mjs +0 -2
- package/dist/chunk-3SKOU6OZ.mjs +0 -10
- package/dist/chunk-3XZOA7AH.mjs +0 -170
- package/dist/chunk-4KUO7R2M.mjs +0 -16
- package/dist/chunk-4OZWXZE5.mjs +0 -5
- package/dist/chunk-4SNV4HA5.mjs +0 -2
- package/dist/chunk-53XDTHTG.mjs +0 -4
- package/dist/chunk-5XV3YYLG.mjs +0 -2
- package/dist/chunk-65NTKF4N.mjs +0 -6
- package/dist/chunk-6GV3CBB2.mjs +0 -2
- package/dist/chunk-6NLXUKAY.mjs +0 -4
- package/dist/chunk-6XD6U3QA.mjs +0 -5
- package/dist/chunk-7EFHNQ5B.mjs +0 -3
- package/dist/chunk-7ISBBDJR.mjs +0 -2
- package/dist/chunk-7M2BQQGZ.mjs +0 -2
- package/dist/chunk-7UZUQQ7Q.mjs +0 -554
- package/dist/chunk-ALZ6ZENZ.mjs +0 -3
- package/dist/chunk-BLNQUR5R.mjs +0 -168
- package/dist/chunk-BMX3VUHY.mjs +0 -2
- package/dist/chunk-BN7M3IN7.mjs +0 -8
- package/dist/chunk-C257H6IA.mjs +0 -2
- package/dist/chunk-CHQU37CA.mjs +0 -2
- package/dist/chunk-DR73Y2UJ.mjs +0 -3
- package/dist/chunk-E4IHAIJ7.mjs +0 -2
- package/dist/chunk-EURLTOTZ.mjs +0 -4
- package/dist/chunk-F4ZA6JRZ.mjs +0 -3
- package/dist/chunk-GKOBB6DH.mjs +0 -2
- package/dist/chunk-GMJD7ID3.mjs +0 -2
- package/dist/chunk-IA2SIEJQ.mjs +0 -2
- package/dist/chunk-JEUK3ZO7.mjs +0 -2
- package/dist/chunk-JPG2LBQM.mjs +0 -11
- package/dist/chunk-KLQP46Y3.mjs +0 -4
- package/dist/chunk-LMUZQK5O.mjs +0 -2
- package/dist/chunk-MKIBJTJZ.mjs +0 -6
- package/dist/chunk-MNWJ4EZY.mjs +0 -2
- package/dist/chunk-NHP66IWR.mjs +0 -5
- package/dist/chunk-OEIJLMPI.mjs +0 -2
- package/dist/chunk-PDZR3L3C.mjs +0 -2
- package/dist/chunk-PUOQ65NC.mjs +0 -2
- package/dist/chunk-Q4MS6OFC.mjs +0 -2
- package/dist/chunk-Q7P3Q5YX.mjs +0 -13
- package/dist/chunk-QP7BOHE4.mjs +0 -2
- package/dist/chunk-S3SX3COT.mjs +0 -20
- package/dist/chunk-TANZRINB.mjs +0 -2
- package/dist/chunk-UGWMMEJ5.mjs +0 -15
- package/dist/chunk-ULXSPX5H.mjs +0 -5
- package/dist/chunk-USIHBCSW.mjs +0 -15
- package/dist/chunk-VPMRP2TL.mjs +0 -2
- package/dist/chunk-WFGPMCTZ.mjs +0 -4
- package/dist/chunk-XZCFPKGO.mjs +0 -2
- package/dist/chunk-ZFGMJVJC.mjs +0 -2
- package/web/assets/index-FLb9jCfl.css +0 -1
- package/web/assets/index-czjrXVjf.js +0 -15
- /package/dist/{chunk-PAREWQGB.mjs → chunk-NOGQX56R.mjs} +0 -0
|
@@ -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:#fff;--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;--floatOutline:#2a1c0012;--shaOutLg:0px 20px 24px 0px #1919190d, 0px 5px 8px 0px #19191907, 0px 0px 0px 1px var(--floatOutline);--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:#191919;--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;--floatOutline:#383836;--shaOutLg:0px 0px 0px 1px var(--floatOutline), 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:#191919;--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;--floatOutline:#383836;--shaOutLg:0px 0px 0px 1px var(--floatOutline), 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}.sandbox-banner{text-align:center;color:var(--texPri);background:var(--yel-sw);flex:none;padding:2px 12px;font-size:12px;font-weight:500}:is(.icon-btn,.g-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}:is(.icon-btn,.g-icon-btn) svg{width:20px;height:20px}:is(.icon-btn,.g-icon-btn) svg.lu{width:18px;height:18px}:is(.icon-btn,.g-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 svg.page-outline{width:16px;height:16px}.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.muted .mi-label,.menu-item.muted .mi-detail{color:var(--texDis)}.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}:is(.mi-switch,.g-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}:is(.mi-switch,.g-switch).on{background:var(--blue)}:is(.mi-switch,.g-switch)>span{background:#fff;border-radius:50%;flex:none;width:12px;height:12px;transition:transform .2s ease-out;box-shadow:0 1px 2px #0f0f0f33}:is(.mi-switch,.g-switch).on>span{transform:translate(12px)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]) :is(.mi-switch,.g-switch):not(.on){background:#caccce4d}}:root[data-theme=dark] :is(.mi-switch,.g-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}.settings-menu{width:240px}.pop-search{padding:2px 8px 6px}:is(.pop-input,.g-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}:is(.pop-input,.g-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}:is(.dialog-btn,.g-btn){height:32px;color:var(--texPri);white-space:nowrap;border-radius:6px;padding:0 14px;font-size:14px;transition:background 20ms ease-in}:is(.dialog-btn,.g-btn):hover:not(:disabled){background:var(--bacIntTra)}:is(.dialog-btn,.g-btn):focus-visible{background:var(--bacTerTra);outline:none}:is(.dialog-btn,.g-btn).primary{background:var(--btnPriBg);color:var(--btnPriTex);font-weight:500}:is(.dialog-btn,.g-btn).primary:hover:not(:disabled),:is(.dialog-btn,.g-btn).primary:focus-visible{background:var(--btnPriBgHi)}:is(.dialog-btn,.g-btn).danger.primary{background:var(--btnDanBg);color:var(--btnDanTex)}:is(.dialog-btn,.g-btn).danger.primary:hover:not(:disabled),:is(.dialog-btn,.g-btn).danger.primary:focus-visible{background:var(--btnDanBgHi)}:is(.dialog-btn,.g-btn):disabled{opacity:.5;cursor:default}.trash-head{justify-content:space-between;align-items:center;gap:16px;display:flex}.trash-head .trash-clear{border:0;height:26px;padding:0 8px;font-size:12px}.pref-overlay.ext-overlay{align-items:flex-start;padding-top:12vh}.pref-dialog.ext-dialog{height:auto;max-height:min(720px,100%)}.ext-empty{text-align:center;flex-direction:column;align-items:center;gap:6px;padding:40px 24px 28px;display:flex}.ext-empty .ext-icon{background:var(--bacIntTra);width:40px;height:40px;color:var(--icoSec);border-radius:10px;flex:none;font-size:18px;line-height:1}.ext-empty .ext-icon svg{stroke-width:1.25px;width:20px;height:20px}.ext-empty-title{color:var(--texPri);margin-top:6px;font-size:14px;font-weight:500;line-height:20px}.ext-empty-hint{max-width:380px;color:var(--texSec);font-size:13px;line-height:1.5}.ext-add{background:var(--bacIntTra);width:100%;height:40px;color:var(--texSec);font:inherit;cursor:pointer;border-radius:10px;justify-content:center;align-items:center;gap:6px;font-size:14px;display:flex}.ext-add:hover,.ext-add[aria-expanded=true]{background:var(--bacTerTra)}.ext-add:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:6px}.ext-add svg{stroke-width:1.6px;width:16px;height:16px}.ext-add+.ext-import{margin-top:8px}.comp-import.ext-import{gap:8px}.ext-import .comp-import-pick{margin:0}.ext-card[data-off] .comp-pack-icon{opacity:.55;filter:grayscale()}.ext-card .comp-toggle:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:44px}.ext-state{align-items:center;gap:6px;min-width:0;display:inline-flex}.ext-state:before{content:"";background:var(--blue);border-radius:50%;flex:none;width:6px;height:6px}.ext-state[data-tone=error]{color:var(--red)}.ext-state[data-tone=error]:before{background:var(--red)}.comp-pack-meta .ext-state{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.comp-pack-meta .ext-state[data-tone=info]{color:var(--texSec)}.ext-view .comp-pack-head .comp-pack-icon{background:var(--bacIntTra)}.ext-view>.comp-note{margin-bottom:6px}.ext-view>.ext-state{margin:2px 0 8px;font-size:13px;line-height:18px;display:flex}.ext-view>.ext-state[data-tone=info]{color:var(--texSec)}.ext-rows{margin-top:10px}.ext-row{border-top:1px solid var(--borSec);grid-template-columns:20px 76px minmax(0,1fr) auto;align-items:center;gap:0 10px;min-height:40px;display:grid}.ext-row:last-child{border-bottom:1px solid var(--borSec)}.ext-row .comp-icon svg{width:18px;height:18px}.ext-row-label{color:var(--texPri);white-space:nowrap;font-size:14px;line-height:20px}.ext-row-value{min-width:0;color:var(--texSec);white-space:nowrap;text-overflow:ellipsis;font-size:13px;line-height:18px;overflow:hidden}.ext-row-value code{font-family:var(--mono);font-size:12px}.ext-link{height:26px;color:var(--texSec);font:inherit;white-space:nowrap;cursor:pointer;border-radius:6px;flex:none;padding:0 8px;font-size:13px}.ext-link:hover{background:var(--bacIntTra);color:var(--texPri)}.ext-link:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}.ext-state .ext-link{height:20px;color:var(--btnPriTex);margin:-1px 0;padding:0 6px;font-weight:500}.ext-remove{color:var(--red);margin:14px 0 0 -8px}.ext-remove:hover{color:var(--red)}.ext-icon{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.ext-icon img{object-fit:contain;width:24px;height:24px}.ext-dialog .comp-pack-icon .page-icon{width:24px;height:24px}.ext-view>.ext-state{overflow-wrap:anywhere;white-space:pre-wrap}@media (width<=560px){.ext-row{grid-template-columns:20px 64px minmax(0,1fr);row-gap:4px;padding:6px 0}.ext-row>.ext-link{grid-column:3;justify-self:start}}.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-back-icon{flex:none;width:14px;height:14px;display:flex}.comp-back-icon svg{stroke-width:1.6px;transform:rotate(180deg)}.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}.gallery-extension-anchor:empty{display:none}.gallery-extension-anchor:has(>.gallery-extension-slot:empty){display:none}.gallery-extension-slot.topbar-end{align-items:center;gap:6px;display:flex}.gallery-extension-slot.sidebar-footer{flex-direction:column;display:flex}.extension-setting{justify-content:space-between;align-items:center;gap:16px;padding:16px 0;display:flex}.extension-setting p{margin:6px 0}.extension-setting small{overflow-wrap:anywhere;opacity:.65}.wp-dialog{container-type:inline-size}.menu.wp-menu{z-index:1600}.wp-tabs{border-bottom:1px solid var(--borSec);flex:none;align-items:center;gap:8px;height:44px;padding:0 12px;display:flex}.wp-strip{scrollbar-width:none;flex:1;align-items:center;gap:2px;min-width:0;height:100%;display:flex;position:relative;overflow:auto hidden}.wp-strip::-webkit-scrollbar{display:none}.wp-tab{height:28px;color:var(--texSec);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:6px;outline:none;flex:none;align-items:center;gap:6px;padding:0 10px;font-size:14px;transition:background 20ms ease-in;display:flex}.wp-tab:hover{background:var(--bacIntTra)}.wp-tab[aria-selected=true]{background:var(--bacIntTra);color:var(--texPri);font-weight:500}.wp-tab[aria-selected=true]:hover{background:var(--bacTerTra)}.wp-tab:focus-visible{box-shadow:0 0 0 2px var(--blue)}.wp-tab-off .wp-tab-name{color:var(--texTer)}.wp-tag{color:var(--texTer);font-size:12px;font-weight:400}.wp-tab .pop-input{width:8em;height:24px;margin:0 -6px;padding:0 6px;font-size:14px;font-weight:400}.wp-tab.wp-dragging{opacity:.4}.wp-new{width:28px;height:28px;color:var(--icoSec);cursor:pointer;border-radius:6px;flex:none;justify-content:center;align-items:center;display:flex}.wp-new:hover{background:var(--bacIntTra)}.wp-new svg{stroke-width:1.6px;width:16px;height:16px}.wp-enable{height:28px;color:var(--texSec);font:inherit;cursor:pointer;border-radius:6px;flex:none;align-items:center;gap:8px;padding:0 4px 0 8px;font-size:13px;display:flex}.wp-enable:hover{background:var(--bacIntTra)}.wp-enable .mi-switch{margin:0}.wp-enable:focus-visible,.wp-new:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}@container (width<=520px){.wp-enable-label{display:none}}.wp-editor{flex-direction:column;flex:1;min-height:0;display:flex}.wp-editor[hidden]{display:none}.wp-tab{position:relative}.wp-tab[data-drop]:after{content:"";background:var(--blue);width:2px;position:absolute;top:0;bottom:0}.wp-tab[data-drop=before]:after{left:-1px}.wp-tab[data-drop=after]:after{right:-1px}.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}.hist-dialog{width:min(920px,100%);height:min(86vh,760px)}.hist-body{flex:1;min-height:0;display:flex}.hist-view{background:var(--bacPri);flex:1;min-width:0;padding:24px 40px 32px;overflow-y:auto}.hist-side{border-left:1px solid var(--borSec);background:var(--bacPri);flex-direction:column;flex:none;width:280px;display:flex}.hist-list{flex:1;min-height:0;padding:6px;overflow-y:auto}.hist-foot{border-top:1px solid var(--borSec);flex:none;justify-content:flex-end;padding:10px 12px;display:flex}.hist-empty{color:var(--texSec);padding:12px 8px;font-size:13px;line-height:1.5}.hist-item{text-align:left;width:100%;font:inherit;color:inherit;cursor:pointer;background:0 0;border-radius:6px;flex-direction:column;align-items:stretch;gap:2px;padding:7px 10px;display:flex}.hist-item:hover{background:var(--bacIntTra)}.hist-item[aria-selected=true]{background:var(--bacTerTra)}.hist-item:focus-visible{background:var(--bacTerTra);outline:none}.hist-line{align-items:baseline;gap:6px;min-width:0;display:flex}.hist-time{color:var(--texPri);white-space:nowrap;font-size:14px;font-weight:500;line-height:20px}.hist-tag{color:var(--btnPriTex);background:var(--btnPriBg);border-radius:4px;flex:none;padding:0 5px;font-size:12px;line-height:18px}.hist-who{color:var(--texSec);white-space:nowrap;margin-left:auto;font-size:12px;line-height:20px}.hist-sum{color:var(--texSec);overflow-wrap:anywhere;font-size:12px;line-height:18px}.hist-block{color:var(--texTer);white-space:nowrap;text-overflow:ellipsis;font-size:12px;line-height:18px;overflow:hidden}.hist-row{color:var(--texPri);white-space:pre-wrap;overflow-wrap:anywhere;gap:6px;margin:0 0 6px;font-size:15px;line-height:1.65;display:flex}.hist-title{margin-bottom:14px;font-size:26px;font-weight:700;line-height:1.3}.hist-h2{margin-top:14px;font-size:20px;font-weight:600;line-height:1.4}.hist-h3,.hist-h4,.hist-h5,.hist-h6{margin-top:10px;font-size:17px;font-weight:600;line-height:1.45}.hist-marker{min-width:14px;color:var(--texSec);flex:none}.hist-more{color:var(--texTer);margin-top:12px;font-size:13px}@media (width<=640px){.hist-body{flex-direction:column-reverse}.hist-side{border-left:0;border-bottom:1px solid var(--borSec);width:auto;max-height:50%}.hist-view{padding:16px}}.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 :is(.icon-btn,.g-icon-btn,.row-act){color:var(--sidIco)}.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-web-button{z-index:10;background:var(--sidBac);width:36px;height:36px;color:var(--sidIco);box-shadow:0 0 0 1px var(--floatOutline), 0 2px 8px #00000024;touch-action:none;-webkit-user-select:none;user-select:none;cursor:grab;transition:transform var(--dur) ease;border:0;border-radius:50%;justify-content:center;align-items:center;display:flex;position:fixed;top:0;left:0}.sb-web-button svg{pointer-events:none;width:18px;height:18px}.sb-web-button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.sb-web-button.dragging{cursor:grabbing;transition:none}.sb-web-drag-cover{z-index:8;cursor:grabbing;position:fixed;inset:0}@media (prefers-reduced-motion:reduce){.sb-web-button{transition:none}}.sb-resizer{cursor:col-resize;z-index:10;width:4px;position:absolute;top:0;bottom:0;right:-2px}.sb-resizer:after{content:"";background:0 0;width:2px;transition:background .15s;position:absolute;top:0;bottom:0;left:0}.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-rows{flex-direction:column;gap:1px;display:flex;position:relative}.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 .sb-page-actions{margin-right:-2px;padding-right:0}.sb-page:hover .sb-page-actions,.sb-page.menu-open .sb-page-actions{display:flex}.sb-act.drag-src{opacity:.4}body.dragging .sb-act:not(.selected):hover{background:0 0}body.dragging .sb-page-actions{display:none!important}.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:6px;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}:is(.ws-btn,.g-sidebar-row){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}:is(.ws-btn,.g-sidebar-row) svg{width:18px;height:18px;color:var(--sidIco);flex:none}:is(.ws-btn,.g-sidebar-row):hover,:is(.ws-btn,.g-sidebar-row).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)}.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-B4uUluLM.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C3vHT8sH.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="preload">
|
|
12
12
|
<div id="root"></div>
|
package/dist/chunk-2KAVXMKG.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{e as D,f as x}from"./chunk-XZCFPKGO.mjs";import{a as d,b as u,c as w,d as y}from"./chunk-S3SX3COT.mjs";import{b as c,d as f,e as m,g as p,h as g,i as a,j as h}from"./chunk-VRPVVMRB.mjs";import{k as l}from"./chunk-PLB7L22J.mjs";import{a as s}from"./chunk-UMHUSOPJ.mjs";import S from"node:path";import{FILE as j}from"../browser/shared/annotations.mjs";import{editStateDirectory as L,reportsDirectory as i}from"../browser/shared/paths.mjs";import{documentDirectory as $,documentFiles as k}from"../browser/shared/workspace.mjs";function O({say:e=!0}={}){return o=>{let{text:t,changes:n}=c(o.html,{finish:l});if(e&&n.length&&console.log(p(o.htmlPath,n,{pending:!0}).join(`
|
|
3
|
-
`)),e){let r=f(o.html);r.length&&console.log(D(o.htmlPath,r,r.length,{pending:!0}).join(`
|
|
4
|
-
`));for(let N of x(o.htmlPath,m(s(o.html),o.metadata),{pending:!0}))console.log(N)}return t}}function b(e){for(let o of e){for(let t of g(o.html))console.log(`note ${o.slug}: ${t} (read-only in the preview)`);for(let t of a(o.html))console.log(`note ${o.slug}: ${t}`);for(let t of h(o.html))console.log(`note ${o.slug}: ${t}`)}}async function q(e){for(let o of e){let t=await w({stateDirectory:L,reportsDirectory:i,slug:o});for(let n of y(k($(o,i)).html,t))console.log(n)}}async function z(e){for(let o of e){let t=await d({stateDirectory:L,reportsDirectory:i,slug:o});for(let n of u(S.join($(o,i),j),t))console.log(n)}}export{O as a,b,q as c,z as d};
|
package/dist/chunk-2T4PZQEP.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,g,h}from"./chunk-C257H6IA.mjs";import"./chunk-3XZOA7AH.mjs";import"./chunk-BN7M3IN7.mjs";import"./chunk-JEUK3ZO7.mjs";import"./chunk-6QWQXHAV.mjs";import"./chunk-2OHANJ6Q.mjs";import"./chunk-7UZUQQ7Q.mjs";import"./chunk-4B2TB5K2.mjs";import"./chunk-KLQP46Y3.mjs";import"./chunk-4OZWXZE5.mjs";import"./chunk-3SKOU6OZ.mjs";import"./chunk-PLB7L22J.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-E7656LR7.mjs";import"./chunk-TKWEX4FD.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{c as HOME_NOT_MADE,g as emptyRequiredOf,d as missingPageSaid,a as pageAddressOf,b as pageAloneOf,h as run,e as setsOf,f as settingsGiven};
|
package/dist/chunk-3SKOU6OZ.mjs
DELETED
|
@@ -1,10 +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 i,l as C}from"./chunk-PLB7L22J.mjs";import{a as g,c as w}from"./chunk-HYMEEXKN.mjs";import{g as j,o as A,p as S}from"./chunk-TKWEX4FD.mjs";import f from"node:path";import{attr as P,hasClass as z,walk as D}from"../browser/shared/html-tree.mjs";import{projectRoot as F,sdkDirectory as O,typeRoots as Y}from"../browser/shared/paths.mjs";var H=new Set(["application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"]);function y(t,{diffs:s=!1,tree:r=g(t)}={}){let n=[];return D(r,a=>{if(a.tagName!=="script"||P(a,"src")!==void 0)return;let o=(P(a,"type")||"").trim().toLowerCase(),l=s&&o==="application/json"&&a.parentNode?.tagName?a.parentNode:null,e=l&&z(l,"doc-diff")?"__declaredDiff(":void 0;if(!e&&o&&o!=="module"&&!H.has(o))return;let{startTag:c,endTag:p}=a.sourceCodeLocation??{};c&&n.push({start:c.endOffset,end:p?.startOffset??t.length,module:o==="module",...e?{call:e}:{}})},{inTemplates:!1}),n}function L(t,s,r=[]){let n=[],a=0,o="",l=e=>e.replace(/[^\r\n]/g," ");for(let{start:e,end:c,call:p}of s){let u=o+l(t.slice(a+o.length,e));if(p){let h=V(u,p,o.length);if(h===null){r.push(e);continue}u=h}n.push(u,t.slice(e,c)),a=c,o=p?");":""}return n.push(o+l(t.slice(a+o.length)),`
|
|
3
|
-
export {};
|
|
4
|
-
`),n.join("")}function V(t,s,r){let n=t.length;for(;;){let a=Math.max(t.lastIndexOf(`
|
|
5
|
-
`,n-1)+1,r),o=t[n-1]==="\r"?n-1:n;if(o-a>=s.length)return t.slice(0,o-s.length)+s+t.slice(o);if(a<=r)return null;n=a-1}}function Pt(t,s=g(t)){return L(t,y(t,{tree:s}))}var q=new Set(["href","src","action","formaction"]),X=t=>{try{return decodeURIComponent(t)}catch{return t}};function Z(t,s){let r=y(t,{tree:s}).map(({start:n,end:a})=>({code:t.slice(n,a),start:n,where:"the document's script"}));return D(s,n=>{for(let{name:a,value:o}of n.attrs){let l=n.sourceCodeLocation?.attrs?.[a]?.startLine??n.sourceCodeLocation?.startLine,e=q.has(a)?o.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,""):"";/^on[a-z]+$/.test(a)?r.push({code:o,line:l,where:`the ${a} attribute of <${n.tagName}>`}):/^javascript:/i.test(e)&&r.push({code:X(e.slice(11)),line:l,where:`the javascript: address of <${n.tagName} ${a}>`})}},{inTemplates:!1}),r}var R=new Set(["fetch","XMLHttpRequest","WebSocket","EventSource","sendBeacon","import"]),E=new Set(["window","globalThis","self"]),Q=t=>i.isIdentifier(t)?t.text==="navigator":i.isPropertyAccessExpression(t)&&t.name.text==="navigator"&&i.isIdentifier(t.expression)&&E.has(t.expression.text);function I(t){let{initializer:s}=i.walkUpBindingElementsAndPatterns(t);return!!s&&i.isIdentifier(s)&&E.has(s.text)}function tt(t){let s=t.parent;return i.isPropertyAccessExpression(s)&&s.name===t?i.isIdentifier(s.expression)&&E.has(s.expression.text):i.isBindingElement(s)&&s.propertyName===t?I(s):!((i.isPropertyAssignment(s)||i.isMethodDeclaration(s)||i.isPropertyDeclaration(s)||i.isGetAccessorDeclaration(s)||i.isSetAccessorDeclaration(s))&&s.name===t)}function et(t,s){return i.isIdentifier(t)&&s.has(t.text)&&tt(t)?{name:t.text,reference:i.isPropertyAccessExpression(t.parent)&&t.parent.name===t?t.parent:t}:i.isElementAccessExpression(t)&&i.isIdentifier(t.expression)&&E.has(t.expression.text)&&i.isStringLiteralLike(t.argumentExpression)&&s.has(t.argumentExpression.text)?{name:t.argumentExpression.text,reference:t}:i.isPropertyAccessExpression(t)&&s.has(t.name.text)&&t.name.text==="sendBeacon"&&Q(t.expression)?{name:"sendBeacon",reference:t}:s.has("import")&&i.isCallExpression(t)&&t.expression.kind===i.SyntaxKind.ImportKeyword?{name:"import",reference:t.expression}:null}function st(t,s){let r=new Map,n=(e,c)=>{let p=e.parent;for(;p&&!c(p);)p=p.parent;return p??t},a=e=>i.isFunctionLike(e)||i.isBlock(e)||i.isCaseBlock(e)||i.isForStatement(e)||i.isForInStatement(e)||i.isForOfStatement(e),o=e=>i.isFunctionExpression(e)||i.isClassExpression(e)?e:i.isFunctionDeclaration(e)||i.isClassDeclaration(e)?n(e,a):i.isCatchClause(e.parent)?e.parent:n(e,i.getCombinedNodeFlags(e)&i.NodeFlags.BlockScoped?a:i.isFunctionLike),l=e=>{(i.isParameter(e)||i.isVariableDeclaration(e)||i.isBindingElement(e)||i.isFunctionDeclaration(e)||i.isClassDeclaration(e)||i.isFunctionExpression(e)||i.isClassExpression(e))&&e.name&&i.isIdentifier(e.name)&&s.has(e.name.text)&&!(i.isBindingElement(e)&&I(e))&&r.set(e.name.text,[...r.get(e.name.text)??[],o(e)]),i.forEachChild(e,l)};return l(t),r}function rt(t,s=[]){for(let r=t;r;r=r.parent)if(s.includes(r))return!0;return!1}function Nt(t,s,{tree:r=g(t)}={}){let n=[];for(let{code:a,start:o,line:l,where:e}of Z(t,r))for(let{name:c,how:p,at:u}of k(a,s))n.push({name:c,how:p,line:l??w(t,o+u),where:e});return n.sort((a,o)=>a.line-o.line)}function k(t,s){if(![...s].some(l=>t.includes(l)))return[];let r=[],n=i.createSourceFile("code.js",t,i.ScriptTarget.Latest,!0,i.ScriptKind.JS),a=st(n,s),o=l=>{let e=et(l,s),c=e?.reference.parent;if(e&&!i.isTypeOfExpression(c)&&!(i.isIdentifier(e.reference)&&rt(l,a.get(e.name)))){let p=(i.isCallExpression(c)||i.isNewExpression(c))&&c.expression===e.reference?i.isNewExpression(c)?"new":"call":"use";r.push({name:e.name,how:p,at:l.getStart(n)})}i.forEachChild(l,o)};return o(n),r}var nt=new Set([2304,2552]),it=new Set([2300,2451,2448,2449,2450]),M=t=>nt.has(t)||it.has(t)||t>=1e3&&t<2e3;function at(t,s,r){if(!t.file||r.has(t)||M(t.code))return!1;let n=t.start??-1;return s.some(a=>!a.call&&a.start<=n&&n<a.end)}var ot=(t,s)=>/\bNumberValue\b/.test(t)||/\bd3\.(?:min|max|extent)\(/.test(s)?"; here d3 reads values of no type as strings: give the data its shape once with JSDoc, /** @type {Array<{ label: string, value: number }>} */ const rows = data;, and d3.min or d3.max may give undefined (?? 0)":"";function B(t){let s={allowJs:!0,checkJs:!0,noEmit:!0,allowUmdGlobalAccess:!0,strict:!0,noImplicitAny:!1,target:i.ScriptTarget.ES2022,module:i.ModuleKind.ESNext,moduleResolution:i.ModuleResolutionKind.Bundler,lib:["lib.es2022.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts"],types:["d3"],typeRoots:Y,skipLibCheck:!1},r=i.createCompilerHost(s),n=r.readFile.bind(r),a=r.fileExists.bind(r);return r.readFile=o=>t.get(f.resolve(o))??n(o),r.fileExists=o=>t.has(f.resolve(o))||a(o),i.createProgram([f.join(O,"index.d.ts"),...t.keys()],s,r)}var ct=/\bDoc[A-Z]\w*/,lt=(t,s)=>ct.test(s)||(t.relatedInformation??[]).some(({file:r})=>r&&f.resolve(r.fileName).startsWith(O+f.sep)),N={katex:"katex","katex-auto-render":"renderMathInElement"};function Dt(t,{assets:s=[]}={}){let r=f.join(F,"reports","__package__","kit.js"),n=t.replace(/^([ \t]*)(?:<!--|-->)/gm,"$1//"),a=s.filter(c=>Object.hasOwn(N,c)).map(c=>`declare const ${N[c]}: any;
|
|
6
|
-
`),o=B(new Map([[r,`${n}
|
|
7
|
-
export {};
|
|
8
|
-
`],...a.length?[[f.join(f.dirname(r),"assets.d.ts"),a.join("")]]:[]])),l=new Set(o.getSyntacticDiagnostics()),e=new Map;for(let c of i.getPreEmitDiagnostics(o)){if(!c.file||f.resolve(c.file.fileName)!==r)continue;let{line:p}=c.file.getLineAndCharacterOfPosition(c.start??0),u=i.flattenDiagnosticMessageText(c.messageText," "),h=`${p} ${u}`;e.has(h)||e.set(h,{line:p+1,code:c.code,message:u,refused:l.has(c)||M(c.code)||lt(c,u)})}return[...e.values()]}function Ft(t){let s=new Map,r=new Map,n=new Map,a=[];for(let e of t){let c=y(e.html,{diffs:!0}),p=[c.filter(m=>!m.module),...c.filter(m=>m.module).map(m=>[m])],u=f.join(F,"reports",f.basename(f.dirname(e.htmlPath)),f.basename(e.htmlPath)),h=[];p.forEach((m,x)=>{let d=`${u}.${x}.js`;s.set(d,L(e.html,m,h)),r.set(d,f.resolve(e.htmlPath)),n.set(d,m)});for(let m of h){let x=e.html.slice(0,m).split(`
|
|
9
|
-
`),d=f.resolve(e.htmlPath);a.push({htmlPath:f.resolve(e.htmlPath),text:`${d}:${x.length}:${x.at(-1).length+1} a declared diff's options could not be checked: write its <script type="application/json"> tag on a line of its own`})}}let o=B(s),l=new Set(o.getSyntacticDiagnostics());return[...a,...i.getPreEmitDiagnostics(o).map(e=>{let c=e.file?.getLineAndCharacterOfPosition(e.start||0),p=e.file?r.get(f.resolve(e.file.fileName))??null:null,u=p||e.file?.fileName,h=u?f.resolve(u):"SDK",m=i.flattenDiagnosticMessageText(e.messageText," "),x=p!==null&&at(e,n.get(f.resolve(e.file.fileName))??[],l);return{htmlPath:p,text:`${h}${c?`:${c.line+1}:${c.character+1}`:""} TS${e.code}: ${m}`,typeOnly:x,...x?{note:`line ${c.line+1}: TS${e.code} in the document's script (column ${c.character+1}): ${m} (strict TypeScript's word on a type: a note, not a failure; the browser runs the script as written: guard the value where it can really be null or of another type${ot(m,e.file.text.split(`
|
|
10
|
-
`)[c.line]??"")})`}:{}}})]}import{readFileSync as _}from"node:fs";import{BODY as pt,isInstance as ft}from"../browser/shared/components/index.mjs";import{ATTRIBUTE as K,PACKAGE_MARK as $}from"../browser/shared/components/installed.mjs";import{cssReferences as G,cssWithAddresses as ut}from"../browser/shared/css-references.mjs";import{packageScript as mt,scriptText as ht,styleText as xt}from"../browser/shared/export-wrap.mjs";import{attr as b,walk as U}from"../browser/shared/html-tree.mjs";import{mediaTypeOf as gt}from"../browser/shared/media.mjs";var dt=new RegExp(K,"i");function zt(t,{packages:s}=j(),r=null){if(!dt.test(t))return[];let n=new Set;return U(r??g(t),a=>{ft(a)&&n.add(b(a,K))},pt),[...n].map(a=>s.get(a)).filter(Boolean)}function Yt(t,s){if(s.length===0)return t;let r=s.map(A);return C(t,{styles:r.flatMap(({styles:n})=>n),scripts:r.flatMap(({scripts:n})=>n)})}function T(t,s){try{return _(S(t,s)).toString("utf8").replace(/^\uFEFF/,"")}catch{return null}}var W=/^(?:data:|#|$)/i,wt=/^(?:[a-z][a-z0-9+.-]*:|\/)/i,J=t=>t.replace(/^\.\//,"").replace(/[?#].*$/,""),Et=(t,s)=>ut(s,G(s),({value:r,kind:n})=>{let a=J(r);if(n==="import"||W.test(r)||!t.files.includes(a))return null;let o=S(t,a);return o&&`data:${gt(a)};base64,${_(o).toString("base64")}`}),v=new Set(["eval","Function"]),St=new Set([...R,...v]),yt={call:t=>`calls ${t}(\u2026)`,new:t=>`creates new ${t}(\u2026)`,use:t=>`uses ${t}`};function kt(t){if(!t.files.includes("style.css"))return[];let s=T(t,"style.css")??"";return G(s).flatMap(({value:r,kind:n,index:a})=>{let o=n==="import"?"has an @import, which an export cannot hold: write what it imports into style.css":W.test(r)?null:wt.test(r)?`loads ${r}: external resources are not portable`:t.files.includes(J(r))?null:`names ${r}, which an export cannot hold: put the file in the package and name it in its assets`;return o?[{line:w(s,a),what:o}]:[]})}function $t(t){if(!t.files.includes("kit.js"))return[];let s=T(t,"kit.js")??"";return k(s,St).filter(({name:r,how:n})=>n!=="use"||!v.has(r)).map(({name:r,how:n,at:a})=>({line:w(s,a),what:`${yt[n](r)}: ${v.has(r)?"an export runs no code made from words":"the export blocks the network; put its data in the instance"}`}))}var Ht=t=>t.flatMap(s=>[...kt(s).map(({what:r})=>`${s.id}: its style.css ${r}`),...$t(s).map(({line:r,what:n})=>`${s.id}: line ${r} of its kit.js ${n}`)]);function bt(t,s){let r=`${$}="${t.id}"`,n=T(t,s);return n===null?null:s==="kit.js"?`<script ${r}>${ht(mt(n))}</script>`:`<style ${r}>${xt(Et(t,n))}</style>`}function Vt(t,{packages:s}){if(!t.includes($))return t;let r=[];U(g(t),o=>{let l=s.get(b(o,$)),e=o.tagName==="link"?"style.css":o.tagName==="script"&&b(o,"src")!==void 0?"kit.js":null,c=o.sourceCodeLocation,p=l&&e&&c?bt(l,e):null;p&&r.push({start:c.startOffset,end:c.endOffset,copy:p})},{inTemplates:!1});let n="",a=0;for(let{start:o,end:l,copy:e}of r)n+=t.slice(a,o)+e,a=l;return n+t.slice(a)}export{Pt as a,R as b,Nt as c,k as d,Dt as e,Ft as f,zt as g,Yt as h,T as i,kt as j,$t as k,Ht as l,Vt as m};
|
package/dist/chunk-3XZOA7AH.mjs
DELETED
|
@@ -1,170 +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 w}from"./chunk-JEUK3ZO7.mjs";import{a as te}from"./chunk-6QWQXHAV.mjs";import{d as F,e as W}from"./chunk-7UZUQQ7Q.mjs";import{a as H,b as L,d as G,e as $,f as E,g as R,h as U,i as q,j as Y,o as V,r as X,s as Q,t as Z}from"./chunk-KLQP46Y3.mjs";import{a as P,b as d,f as ee}from"./chunk-4OZWXZE5.mjs";import{i as K}from"./chunk-3SKOU6OZ.mjs";import{f as S,j as C,s as _,t as B,v as j}from"./chunk-TKWEX4FD.mjs";import v from"node:fs";import N from"node:path";import{blocksHidden as $e}from"../browser/editor/components/registry.mjs";import{inLanguage as be,told as ve}from"../browser/shared/i18n/index.mjs";import{PACK_ID as xe}from"../browser/shared/pack-manifest.mjs";import{readKeys as Se,writeKey as se}from"../browser/shared/net-keys.mjs";import{HOST as Ne,netHostsOf as Oe}from"../browser/shared/net-policy.mjs";import{PACKAGE_ID as je,SLOT as Ee}from"../browser/shared/components/installed.mjs";import{DEVICE_NAMES as Ae,layoutOf as A,PACKAGE_MANIFEST as ie,shallowPackages as le}from"../browser/shared/workspace.mjs";var fe=(e,t,{script:o,flow:n,data:a,page:s})=>`{
|
|
3
|
-
"id": "${e}",
|
|
4
|
-
"apiVersion": 1,
|
|
5
|
-
"version": "0.1.0",
|
|
6
|
-
"name": { "zh": "${t}", "en": "${t}" },
|
|
7
|
-
"description": { "zh": "\u4E00\u4E2A\u53EF\u4EE5\u53CD\u590D\u4F7F\u7528\u7684\u5757", "en": "A block to use again" },
|
|
8
|
-
"words": "${t}",${s?`
|
|
9
|
-
"places": ["page"],
|
|
10
|
-
"card": { "sizes": [[4, 3], [2, 3]], "resize": true },`:""}
|
|
11
|
-
"parts": {
|
|
12
|
-
"title": { "at": ":scope > h3", "edit": "${s?"none":"text"}" }${a?`,
|
|
13
|
-
"items": { "at": ":scope > script", "edit": "data" }`:n?`,
|
|
14
|
-
"body": { "edit": "flow" }`:`,
|
|
15
|
-
"text": { "at": ":scope > p", "edit": "${s?"none":"text"}", "optional": true }`}
|
|
16
|
-
},${o?`
|
|
17
|
-
"runtime": { "generated": [".component-drawn"] },`:""}
|
|
18
|
-
"markdown": "parts"
|
|
19
|
-
}
|
|
20
|
-
`,oe=(e,t,o,{blocks:n,json:a})=>`<div data-doc-component="${e}">
|
|
21
|
-
<h3>${t}</h3>
|
|
22
|
-
${a?` <script type="application/json">${a}</script>`:n?` <div data-doc-slot="body">
|
|
23
|
-
${n.map(s=>` ${s}
|
|
24
|
-
`).join("")} </div>`:` <p>${o}</p>`}
|
|
25
|
-
</div>
|
|
26
|
-
`,we=["<p>\u8FD9\u91CC\u5199\u8FD9\u4E2A\u5757\u5728\u4E00\u4EFD\u6587\u6863\u91CC\u7684\u6837\u5B50\u3002</p>","<ul>"," <li>\u63D2\u69FD\u91CC\u5199\u6587\u6863\u81EA\u5DF1\u7684\u5757</li>"," <li>\u6BB5\u843D\u3001\u5217\u8868\u3001\u8868\u683C\u90FD\u53EF\u4EE5</li>","</ul>"],ge=(e,{flow:t,data:o})=>`/* Every selector starts at the instance, so that nothing here reaches the rest of the page.${t?` Each step is
|
|
27
|
-
a >, so that none reaches into the slot, whose blocks read as the page's.`:""} */
|
|
28
|
-
[data-doc-component="${e}"] { padding: 12px 16px; border: 1px solid var(--doc-border); border-radius: 8px; }
|
|
29
|
-
[data-doc-component="${e}"] > h3 { margin-top: 0; }
|
|
30
|
-
${o?`/* The hidden attribute hides a control whatever display the rules below give it (the kit holds [hidden] over a
|
|
31
|
-
style): the field and the buttons are drawn hidden where nothing is written, an export. */
|
|
32
|
-
[data-doc-component="${e}"] .component-list { margin: 0 0 8px; padding: 0; list-style: none; }
|
|
33
|
-
[data-doc-component="${e}"] .component-list > li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; }
|
|
34
|
-
[data-doc-component="${e}"] .component-field { display: block; box-sizing: border-box; width: 100%; padding: 4px 8px; border: 1px solid var(--doc-border); border-radius: 6px; background: transparent; color: inherit; font: inherit; }
|
|
35
|
-
[data-doc-component="${e}"] .component-remove { padding: 0 8px; border: 1px solid var(--doc-border); border-radius: 6px; background: transparent; color: var(--doc-muted); font: inherit; cursor: pointer; }
|
|
36
|
-
`:""}`,ue=(e,t,{script:o,flow:n,data:a,page:s})=>`# ${t}
|
|
37
|
-
|
|
38
|
-
What this block is for, and when ${s?"a custom page":"a document"} uses it rather than a block of Gallery's own.
|
|
39
|
-
|
|
40
|
-
## How to write it
|
|
41
|
-
|
|
42
|
-
Write the element as example.html does: \`gallery block show ${e}\` prints it. Each part, and what goes in it:
|
|
43
|
-
|
|
44
|
-
- the title, its \`h3\`: required${s?", written in the file (a page shows it as written)":""}.
|
|
45
|
-
${a?'- the items, its `<script type="application/json">`: `{"items":[{"text":"\u2026"}]}`, each item a line a reader adds on the block and takes away with its button. Leave the items of a block that is there alone: they are the reader\'s.\n':n?'- the body, its `<div data-doc-slot="body">`: required, the document\'s own blocks, written as anywhere in the document (paragraphs, lists, tables, formulas).\n':"- the text, its `p`: optional.\n"}${s?`
|
|
46
|
-
## On a page
|
|
47
|
-
|
|
48
|
-
A card of a custom page: \`gallery page add <slug> ${e}\` puts one on it, at the first free spot by its size (4 \xD7 3, or 2 \xD7 3), which the user may change by dragging its edge.
|
|
49
|
-
`:""}
|
|
50
|
-
## How it looks
|
|
51
|
-
|
|
52
|
-
What a reader sees of it, and what it shows while it is empty.${a?" Where nothing is written (an export) its field and buttons are not shown.":""}
|
|
53
|
-
${o?`
|
|
54
|
-
## Its script
|
|
55
|
-
|
|
56
|
-
kit.js runs with the rights of a document's own script. What it draws, it draws in what the manifest's \`runtime\` names${n?", outside the slot: it reads the slot and never writes in it":""}.${a?" It reads the items with `context.readJSON` and writes them back with `context.editJSON`, one write for each add or removal (one undo step); `example()` adds an item, by the function the field calls, and works on an empty instance too.":""}
|
|
57
|
-
`:""}`,ke=e=>`// Starts each instance from what the file says, and draws in a node the manifest's runtime names:
|
|
58
|
-
// the kit takes that off an instance before it starts one again, as an undo may put one back.
|
|
59
|
-
DocKit.component({
|
|
60
|
-
id: "${e}",
|
|
61
|
-
on: ["source"],
|
|
62
|
-
mount(host, context) {
|
|
63
|
-
const drawn = document.createElement("div");
|
|
64
|
-
drawn.className = "component-drawn";
|
|
65
|
-
host.append(drawn);
|
|
66
|
-
const draw = () => { drawn.textContent = context.part("title")?.textContent ?? ""; };
|
|
67
|
-
draw();
|
|
68
|
-
return { update: draw };
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
`,ye=e=>`// A list of lines a reader keeps in this block. Its data part, items, is a script of JSON:
|
|
72
|
-
// {"items":[{"text":"\u2026"}]}. The block draws what it holds on every \`source\` (an undo, an Agent's write,
|
|
73
|
-
// the page coming to edit) and writes only on a reader's gesture: a line typed in the field (DocKit.input:
|
|
74
|
-
// Enter or leaving the field, never while an input method composes) and a press of a line's button, each
|
|
75
|
-
// one context.editJSON, one undo step. A control that writes is drawn only while context.canEdit() and
|
|
76
|
-
// hidden otherwise, as an export needs (the hidden attribute: the kit holds it over any display).
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The items \`data\` holds (context.readJSON's, or the draft context.editJSON hands a change); throws
|
|
80
|
-
* saying why when it is no { "items": [] }, and the block draws nothing over it.
|
|
81
|
-
* @param {any} data
|
|
82
|
-
* @returns {{ text: string }[]}
|
|
83
|
-
*/
|
|
84
|
-
function itemsOf(data) {
|
|
85
|
-
if (data === null || typeof data !== "object" || !Array.isArray(data.items)) throw new Error('its data is no { "items": [] }');
|
|
86
|
-
return data.items;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* One item more, one write: what the field calls once the reader is done with it, and the example too.
|
|
91
|
-
* Whether it was taken.
|
|
92
|
-
* @param {DocComponentContext} context
|
|
93
|
-
* @param {string} text
|
|
94
|
-
*/
|
|
95
|
-
function addItem(context, text) {
|
|
96
|
-
return context.editJSON("items", (data) => {
|
|
97
|
-
itemsOf(data).push({ text });
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The item numbered \`index\` taken away, one write: what a line's button calls. Whether it was taken.
|
|
103
|
-
* @param {DocComponentContext} context
|
|
104
|
-
* @param {number} index
|
|
105
|
-
*/
|
|
106
|
-
function removeItem(context, index) {
|
|
107
|
-
return context.editJSON("items", (data) => {
|
|
108
|
-
itemsOf(data).splice(index, 1);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
DocKit.component({
|
|
113
|
-
id: "${e}",
|
|
114
|
-
on: ["source", "editable"],
|
|
115
|
-
mount(host, context) {
|
|
116
|
-
const drawn = document.createElement("div");
|
|
117
|
-
drawn.className = "component-drawn";
|
|
118
|
-
const list = document.createElement("ul");
|
|
119
|
-
list.className = "component-list";
|
|
120
|
-
const field = document.createElement("input");
|
|
121
|
-
field.className = "component-field";
|
|
122
|
-
field.type = "text";
|
|
123
|
-
field.placeholder = "\u5199\u4E00\u6761\uFF0C\u56DE\u8F66\u6DFB\u52A0";
|
|
124
|
-
drawn.append(list, field);
|
|
125
|
-
host.append(drawn);
|
|
126
|
-
const typed = DocKit.input(field, {
|
|
127
|
-
signal: context.signal,
|
|
128
|
-
commit(value) {
|
|
129
|
-
if (value.trim() && addItem(context, value.trim())) typed.set("");
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
context.listen(list, "click", (event) => {
|
|
133
|
-
const button = event.target instanceof Element ? event.target.closest("button") : null;
|
|
134
|
-
if (button && context.canEdit()) removeItem(context, Number(button.value));
|
|
135
|
-
});
|
|
136
|
-
const draw = () => {
|
|
137
|
-
const data = context.readJSON("items");
|
|
138
|
-
if (data === undefined) return; // no JSON: the instance has failed, and Gallery shows what it holds
|
|
139
|
-
let items;
|
|
140
|
-
try {
|
|
141
|
-
items = itemsOf(data);
|
|
142
|
-
} catch (error) {
|
|
143
|
-
return context.fail(error);
|
|
144
|
-
}
|
|
145
|
-
const writes = context.canEdit();
|
|
146
|
-
list.replaceChildren(...items.map((item, index) => {
|
|
147
|
-
const line = document.createElement("li");
|
|
148
|
-
const words = document.createElement("span");
|
|
149
|
-
words.textContent = item.text;
|
|
150
|
-
const remove = document.createElement("button");
|
|
151
|
-
remove.type = "button";
|
|
152
|
-
remove.className = "component-remove";
|
|
153
|
-
remove.value = String(index);
|
|
154
|
-
remove.textContent = "\u5220\u9664";
|
|
155
|
-
remove.hidden = !writes;
|
|
156
|
-
line.append(words, remove);
|
|
157
|
-
return line;
|
|
158
|
-
}));
|
|
159
|
-
field.hidden = !writes;
|
|
160
|
-
};
|
|
161
|
-
draw();
|
|
162
|
-
return { update: draw };
|
|
163
|
-
},
|
|
164
|
-
example(host, context) {
|
|
165
|
-
addItem(context, "\u53C8\u4E00\u6761");
|
|
166
|
-
},
|
|
167
|
-
});
|
|
168
|
-
`;function ne(e,{script:t=!1,flow:o=!1,data:n=!1,page:a=!1}={}){let s=e.split("/")[1],l={script:t||n,flow:o,data:n,page:a};return{"component.json":fe(e,s,l),"template.html":oe(e,"\u6807\u9898","\u5199\u5728\u8FD9\u91CC\u3002",{blocks:o&&["<p></p>"],json:n&&'{"items":[]}'}),"example.html":oe(e,"\u4E00\u4E2A\u4F8B\u5B50","\u8FD9\u91CC\u5199\u8FD9\u4E2A\u5757\u5728\u4E00\u4EFD\u6587\u6863\u91CC\u7684\u6837\u5B50\u3002",{blocks:o&&we,json:n&&'{"items":[{"text":"\u7B2C\u4E00\u6761"},{"text":"\u7B2C\u4E8C\u6761"}]}'}),"writing.md":ue(e,s,l),"style.css":ge(e,l),...l.script?{"kit.js":n?ye(e):ke(e)}:{}}}var x="local";function re(e){let t=e.includes("/")?e:`${x}/${e}`;if(!je.test(t))throw new d(`Not a block's id: ${e} (<scope>/<name>, each in lowercase letters, digits and hyphens; a <name> alone is ${x}/<name>).`);let o=t.split("/").find(n=>Ae.has(n));if(o)throw new d(`Not a block's id: ${e} (Windows keeps ${o} for a device).`);return t}function Ie(e,t){let o=re(t),n=t.includes("/")?null:$(t);if(!n)return o;let a=S(e);return a.packages.has(o)||a.problems.has(o)||v.existsSync(M(e,o))?o:n.id}var M=(e,t)=>N.join(A(e).components,...t.split("/")),u=e=>e.pack===H?e.name:e.id,z=()=>G().map(u).join(", "),ce=({name:e,file:t})=>`${w(t)} is one level too shallow, and no catalog reads it: a custom block is components/<scope>/<name>/, so move it to components/${x}/${e}/`;function Ce(e,t){let o=le(e).find(({name:s})=>s===t.split("/")[1]),n=E(t)&&$(t);if(n)return`No block ${t} in ${w(A(e).components)}: it is one of Gallery's own, which gallery block add ${u(n)} puts in.`;let a=t.startsWith(`${x}/`)?$(t.slice(x.length+1)):null;return o?ce(o):`No block ${t} in ${w(A(e).components)}: gallery block list says which there are${a?`; Gallery has a block of that name, ${a.id}`:""}.`}function Ge(e,t,{script:o,flow:n,data:a,page:s,recipe:l}){let r=t.split("/")[0],m=$(t);if(E(t))throw new d(`The scope ${r}/ is kept for Gallery's own blocks: give yours another (${x}/<name>, or a <name> alone)${m?`; gallery block add ${u(m)} puts Gallery's in, and gallery block new <id> --recipe ${u(m)} starts one of yours from it`:""}.`);if(R(e).packs?.[r])throw new d(`The scope ${r}/ is the pack ${r}'s, which gallery block pack install put in (installing it again would not keep a block of yours there): give yours another (${x}/<name>, or a <name> alone).`);let h=l===void 0?null:$(l);if(l!==void 0&&!h)throw new d(`No block of Gallery's own is called ${l}: ${z()||"none"}.`);let f=M(e,t);if(v.existsSync(f)||S(e).problems.has(t)){let c=!v.existsSync(N.join(f,ie));console.error(c?`A folder is there with no component.json: ${w(f)}: move it, or give this block another name.`:`Block already exists: ${w(f)}: gallery block show ${t} says what it is; give a new one another name.`),process.exit(1)}let i=h?V(h,t):ne(t,{script:o,flow:n,data:a,page:s});try{v.mkdirSync(f,{recursive:!0});for(let c of L(Object.keys(i)))v.mkdirSync(N.dirname(N.join(f,c)),{recursive:!0}),v.writeFileSync(N.join(f,c),i[c])}catch(c){if(!c.code)throw c;console.error(`Cannot write ${w(f)} (${c.code}).`),process.exit(1)}if(console.log(`Created ${w(f)}: ${Object.keys(i).join(", ")}`),h){console.log(`Made from Gallery's ${h.id} ${h.version}, every word that named it naming ${t}: change its name, words and description in component.json first (two blocks of one name read alike in "/"), and in the same files what is still ${h.name}'s: preview.svg (the picture the menu shows beside the description, still ${h.name}'s drawing: draw yours or delete it), writing.md (how to write it, still about ${h.name}) and example.html (the instance check runs and show prints, still ${h.name}'s words), then what you came for (references/building-blocks.md has every field and the rules), and run gallery block check ${t}, which passes as it stands now.`);return}let p=o||a;console.log(`Next: say in component.json what it is (its name, description and parts), write template.html, what ${s?"a custom page's \u6DFB\u52A0\u81EA\u5B9A\u4E49\u5757 puts on it":'"/" puts in a document'}, and example.html, an instance as a writer would fill it, then writing.md and style.css${p?" and kit.js":""} (references/building-blocks.md has every field and the rules${n?", and Slots what its slot body holds":""}${s?"; references/pages-and-data.md a card's size and settings and what it reads":""}${p?"; references/block-script.md its script and how it writes back":""}), and run gallery block check ${t}, which passes as it stands now.`),a&&console.log("It keeps a list of lines (the part items, a script of JSON on one line, as context.editJSON writes it): kit.js reads it with context.readJSON and writes it with context.editJSON, from a field (DocKit.input) and a button, hidden where nothing is written; example() adds a line by the function the field calls, and works on template.html's empty instance. Rename the part, the fields of its JSON and the controls for what the block keeps."),s?console.log(`It is a custom page's card (places ["page"], a card of two sizes): gallery page add <slug> ${t} puts one on a page, then gallery page try <slug> <card id> <gesture> tries a reader's gesture on it${a?' (--type .component-field "words" --then Enter)':""}; for a document too, put "document" in places.`):a&&console.log(`In a document: write the element as example.html does, then gallery block try <slug> --type .component-field "words" --then Enter tries the field (the part and the class are the scaffold's: rename them with the block).`)}function Pe(e,t){let o=$(t);if(!o)throw new d(`No block of Gallery's own is called ${t}: ${z()||"none"} (gallery block list says each).`);let n;try{n=q(e,o)}catch(s){if(s.code!=="changed")throw s;console.error(`${w(s.folder)} was changed after gallery block add put it there (or another hand put it there), so it is not replaced: to keep those changes, make a block of your own from Gallery's with gallery block new <id> --recipe ${u(o)} and move them into it; to take Gallery's ${o.version}, delete the folder and run gallery block add ${u(o)} again.`),process.exit(1)}let a=o.places.includes("document")?`a document can write it now (gallery block show ${o.id} says how)`:"custom pages can place it now";n.did==="same"?console.log(`${o.id} ${o.version} is in already, as Gallery ships it: ${w(n.folder)}`):n.did==="updated"?console.log(`Updated ${o.id} from ${n.from??"an older version"} to ${o.version}: ${w(n.folder)}`):console.log(`Added ${o.id} ${o.version}: ${w(n.folder)}`),n.did!=="same"&&console.log(`It is Gallery's, as it ships: no check or try is needed, and ${a}. Change nothing in its folder, or gallery block add will not update it again: for a block like it of your own, gallery block new <id> --recipe ${u(o)}.`)}var k=({zh:e,en:t})=>e===t?e:`${e} / ${t}`;function Ke(e){if(B(e))return null;let t=_(e);return t?C("en",t):"it has no template.html"}var Je={disabled:"disabled by the user: its instances show as they stand, no script and no style"},I=e=>e?.length?` \u8981\u7528\uFF1A${e.join(", ")}`:"";function ae(e,{id:t,name:o,version:n,description:a,state:s,needs:l},r){console.log(`${t} ${k(o)}`);let h=(e.settings.packsOff??[]).includes(t.split("/")[0])?`available; its pack ${t.split("/")[0]} is switched off in \u8BBE\u7F6E \u203A \u7EC4\u4EF6\u5217\u8868, so no menu or library offers it, and a document can still write it`:r==="document"&&s==="hidden"?"available; not in the document's menus, by the user's switch, and a document can still write it":"available";console.log(` \u7248\u672C\uFF1A${n}\uFF08${h}\uFF09`),console.log(` \u8BF4\u660E\uFF1A${k(a)}`),I(l)&&console.log(I(l));let f=r==="document"&&Ke(e.packages.get(t));f&&console.log(` \u6A21\u677F\uFF1Athe menus cannot insert it, and a document can still write it: ${f}`)}function Te(e){let t=S(e),o=j(t),n=o.filter(({reason:i})=>i),a=o.filter(({reason:i})=>!i),s=a.filter(({state:i})=>i!=="disabled"),l=s.filter(({places:i})=>i.includes("document")),r=s.filter(({places:i})=>i.includes("page")),m=le(e),h=G().map(i=>({block:i,state:U(e,i)})).filter(({block:i,state:p})=>!p.added||p.behind||p.changed&&Y(i.version,p.version)),f=$e(t.settings.hidden);if(console.log(`\u5DE5\u4F5C\u533A\uFF1A${w(e)}`),a.length+n.length+m.length===0)console.log("No custom blocks yet. A document is written with Gallery's blocks and whole blocks; gallery block add <name> puts one of Gallery's own in (below), and gallery block new <id> starts one when the user wants a block to use again.");else{console.log(l.length?`\u6587\u6863\u91CC\u53EF\u7528 (in documents: ${l.length}; gallery block show <id> says how to write each):`:"\u6587\u6863\u91CC\u53EF\u7528 (in documents): none now.");for(let p of l)ae(t,p,"document");console.log(r.length?`\u81EA\u5B9A\u4E49\u9875\u53EF\u7528 (on custom pages: ${r.length}):`:"\u81EA\u5B9A\u4E49\u9875\u53EF\u7528 (on custom pages): none now.");for(let p of r)p.places.includes("document")?console.log(`${p.id} ${k(p.name)} (above: in documents too)`):ae(t,p,"page");let i=a.filter(({state:p})=>p==="disabled");i.length+n.length+m.length>0&&console.log("Not to use now:");for(let{id:p,name:c,version:y,state:O}of i)console.log(`${p} ${k(c)} ${y} ${Je[O]}`);for(let{id:p,reason:c,version:y}of n)console.log(`${p}${y?` ${y}`:""} does not load: ${c.en}`);for(let p of m)console.log(ce(p))}h.length&&console.log("Gallery's own blocks, to add as they are (no check or try needed):");for(let{block:i,state:p}of h){let c=i.places.map(y=>y==="document"?"documents":"custom pages").join(" and ");console.log(`${i.id} ${k(i.title)} ${i.version} (${c})`),console.log(` \u8BF4\u660E\uFF1A${k(i.description)}`),p.changed?console.log(` the workspace's copy (${p.version??"no version"}) was changed after it was added, so it is not updated: to take Gallery's ${i.version}, delete ${w(M(e,i.id))} and run gallery block add ${u(i)} (to keep the changes, gallery block new <id> --recipe ${u(i)} and move them into it)`):console.log(p.added?` gallery block add ${u(i)} (the workspace has ${p.version??"an older one"}: this updates it)`:` gallery block add ${u(i)}`)}f.length&&console.log(`Built-in blocks the user took out of the document's menus (a document can still write them): ${f.join(", ")}`)}var De=(e,{at:t,edit:o,optional:n,min:a,max:s})=>{let l=[n?"optional":"",a!==void 0?`at least ${a}`:"",s!==void 0?`at most ${s}`:""].filter(Boolean),r=o==="flow"?`${Ee}="${e}"`:t;return` ${e} ${r} ${o==="flow"?"flow (blocks of the document: write any block in it)":o}${l.length?` (${l.join(", ")})`:""}`};function de(e,t,o){console.log(`${t} ${k(e.name)}`),console.log(` \u7248\u672C\uFF1A${e.version}\uFF08${o}\uFF09`),console.log(` \u8BF4\u660E\uFF1A${k(e.description)}`),console.log(` \u7528\u5728\uFF1A${e.places.map(l=>l==="document"?"documents":"custom pages").join(", ")}`),I(e.needs)&&console.log(I(e.needs)),console.log(` ${w(e.folder)}`);let n=Object.entries(e.parts);console.log(n.length?"Parts (edit text: the user types there; flow: blocks of the document; none, or data: the component's):":"No parts.");for(let[l,r]of n)console.log(De(l,r));let a=K(e,"writing.md")?.trimEnd();console.log(a?`How to write it (writing.md):
|
|
169
|
-
${a}`:"How to write it: the block has no writing.md.");let s=K(e,"example.html")?.trimEnd();console.log(s?`The example (example.html):
|
|
170
|
-
${s}`:"The example: the block has no example.html.")}function Me(e,t){let o=S(e),n=o.problems.get(t),a=o.packages.get(t)??(n?.off?n:void 0);if(!a){let r=n?.problem,m=!r&&E(t)?$(t):null;if(m)return Fe(m);console.error(r?`${t} does not load: ${C("en",r)}`:Ce(e,t)),process.exit(1)}let{state:s}=j(o).find(r=>r.id===t),l={normal:"available",hidden:"available; not in the document's menus, by the user's switch",disabled:"disabled by the user"}[s]??s;de(a,t,l),console.log("In a document: write the element as the example does, straight in the page or a section, with no data-block-id, which the export gives it.")}async function ze(e,t,o,{remove:n}){let a=Se(e);if(t===void 0){let s=[...new Set(j(S(e)).flatMap(({needs:m})=>Oe(m??[])))],l=Object.keys(a).sort();console.log(l.length?`Keys kept (.gallery/keys.json), by host: ${l.join(", ")}.`:"No key kept (.gallery/keys.json holds none).");let r=s.filter(m=>!l.includes(m)).sort();r.length&&console.log(`Hosts the workspace's blocks reach with no key: ${r.join(", ")} (a key is needed only where a block's address names {key}).`);return}if(!Ne.test(t))throw new d(`Not a host a block's needs can name: ${t} (a lowercase name, no scheme, port or path; *. before it for the names under it).`);if(n){if(o!==void 0)throw new d("gallery block key <host> --remove takes no key.");return t in a?(await se(e,t,null),console.log(`Took away the key for ${t}. A block's address that names {key} on it is refused (code "key") until one is kept again.`)):console.log(`No key kept for ${t}: nothing to take away.`)}if(o===void 0)return console.log(t in a?`A key is kept for ${t} (never printed): an address on it that names {key} is fetched with it.`:`No key kept for ${t}: gallery block key ${t} <key> keeps one.`);if(!o.trim()||/[\r\n]/.test(o))throw new d("A key is one line of characters, not empty.");await se(e,t,o),console.log(`Kept the key for ${t} in ${w(A(e).keys)}, which no page, export or cache holds: Gallery writes it where a block's address on ${t} names {key}, as it fetches for the block. Never write the key into a block's files or a page: they are shown and exported.`)}function Fe(e){let t=JSON.parse(v.readFileSync(N.join(e.folder,ie),"utf8"));de({name:e.title,description:e.description,version:e.version,places:e.places,needs:t.needs,folder:e.folder,parts:t.parts??{}},e.id,"Gallery's own, not in this workspace yet");let o=e.places.includes("document")?", and a document writes it as the example above does, straight in the page or a section, with no data-block-id, which the export gives it":`, and gallery page add <slug> ${u(e)} puts a card of it on a custom page`;console.log(`Not in this workspace yet: gallery block add ${u(e)} puts it in as it ships (no check, no try)${o}.`)}var he=e=>be("en",()=>ve(e))??e.message,J=(e,t)=>t.length?[` ${e}: ${t.join(", ")}`]:[];function We(e,t){let o;try{o=X(e,te(t))}catch(a){if(!a.code)throw a;console.error(`Not installed: ${he(a)}`),process.exit(1)}let n=o.added.length+o.updated.length+o.same.length+o.kept.length;o.from===null?console.log(`Installed the pack ${o.id} ${o.version} (${k(o.name)}), ${n} block${n===1?"":"s"}: ${w(o.folder)}`):o.did==="updated"?console.log(`Updated the pack ${o.id} from ${o.from??"an older version"} to ${o.version}: ${w(o.folder)}`):console.log(`The pack ${o.id} ${o.version} is in already, as installed: ${w(o.folder)}`);for(let a of[...J("added",o.added),...o.did==="updated"?J("updated",o.updated):[],...J("taken out (not in this version)",o.removed)])console.log(a);o.kept.length&&console.log(` kept as they are, changed since they were installed: ${o.kept.join(", ")} (to take this version's, delete the block's folder and install the pack again)`),o.ownKept&&console.log(" its pack.json was changed since it was installed, and is kept as it is"),console.log(`Its blocks are offered in "/" and \u6DFB\u52A0\u81EA\u5B9A\u4E49\u5757 while its switch in \u8BBE\u7F6E \u203A \u7EC4\u4EF6\u5217\u8868 is on (gallery block pack list says each pack's); gallery block list says each block.`)}function D(e){let t=Z(e);console.log(`\u5DE5\u4F5C\u533A\uFF1A${w(e)}`);let o={default:"the default pack, where a block made with no pack named goes",official:"Gallery's own",installed:"a pack installed",own:"the workspace's own blocks, no pack.json"};for(let n of t){let a=[n.version?`${n.id} ${n.version}`:n.id,o[n.kind],n.enabled?"on":"off",`${n.blocks} block${n.blocks===1?"":"s"}`,...n.author?[`by ${n.author}`]:[]];console.log(`${k(n.name)} (${a.join(", ")})`),n.description&&console.log(` \u8BF4\u660E\uFF1A${k(n.description)}`),n.problem&&console.log(` its pack.json does not read: ${n.problem.en}`),n.changed.length&&console.log(` changed since it was installed: ${n.changed.join(", ")}${n.newer?` (Gallery's is ${n.newer}, not put over them)`:""}`)}t.every(({kind:n})=>n==="default")&&console.log("No other block packs: gallery block pack install <folder|zip> installs one.")}function _e(e,t){if(!xe.test(t))throw new d(`Not a pack's id: ${t} (lowercase letters, digits and hyphens: gallery block pack list says each).`);let o;try{o=Q(e,t)}catch(n){if(!n.code)throw n;console.error(`Not removed: ${he(n)}`),process.exit(1)}console.log(`Removed the pack ${o.id}${o.version?` ${o.version}`:""} (${o.blocks.length} block${o.blocks.length===1?"":"s"}): what documents and pages hold of its blocks stays, shown as blocks that are not there.`)}var T={install:We,list:D,remove:_e};function Be(e,t,o){if(!t)throw new d("Say what to do with packs: install <folder|zip>, list, remove <pack>.");if(!Object.hasOwn(T,t))throw new d(`No such pack command: ${t} (install, list, remove).`);if(T[t]===D){if(o.length)throw new d("gallery block pack list takes nothing else.");return D(e)}if(o.length!==1)throw new d(t==="install"?"gallery block pack install takes one folder or zip: gallery block pack install <folder|zip>.":"gallery block pack remove takes one pack's id: gallery block pack remove <pack>.");return T[t](e,o[0])}var g={new:(e,t,o)=>Ge(e,t,o),add:Pe,list:Te,show:Me,check:async(e,t,{documents:o})=>(await import("./chunk-NHP66IWR.mjs")).checkCommand(e,t,{documents:o}),try:async(e,t)=>(await import("./chunk-7ISBBDJR.mjs")).tryCommand(e,t),key:ze,pack:Be},He=["--press","--drag","--to","--key","--type","--select","--then","--steps"],Le={"--key":"--key takes a selector and a key: --key <selector> <key> (Enter, Space, ArrowRight, a letter, Shift+Tab).","--type":"--type takes a selector and the words to type: --type <selector> <words> (quoted when they hold a blank).","--select":"--select takes a selector and an option: --select <selector> <value> (the option's value or its words)."};function pe(e){let t=e.indexOf("--"),o=new Set,n={};for(let[a,s]of Object.entries(Le)){let l=(t===-1?e:e.slice(0,t)).findIndex(h=>h===a||h.startsWith(`${a}=`));if(l===-1)continue;let r=l+(e[l].includes("=")?1:2),m=e[r];if(m===void 0||r===t||P(m)||o.has(r))throw new d(s);o.add(r),n[a]=m}return{argv:e.filter((a,s)=>!o.has(s)),seconds:n}}function pt(e){let{argv:t,seconds:o}=pe(e);return{argv:t,key:o["--key"]??null}}async function mt(e,{workspace:t}){try{return await Re(e,t)}catch(o){let n=e.find(a=>!P(a));throw o instanceof d&&n==="try"&&(o.synopsis=F),o instanceof d&&n==="pack"&&(o.synopsis=W),o}}async function Re(e,t){let{argv:o,seconds:n}=pe(e),{positional:a,options:s,values:l}=ee({options:["--script","--flow","--data","--page","--keep","--documents","--replace","--remove"],values:[...He,"--recipe"],argv:o}),r=l.get("--recipe"),m=new Map([...l].filter(([b])=>b!=="--recipe")),[h,f,...i]=a,p=Object.keys(g).join(", ");if(!h)throw new d(`Say what to do: ${p}.`);if(!Object.hasOwn(g,h))throw new d(`No such block command: ${h} (${p}).`);let c=g[h];for(let b of["--script","--flow","--data","--page"])if(s.has(b)&&c!==g.new)throw new d(`${b} goes with new, not ${h}.`);if(s.has("--documents")&&c!==g.check)throw new d(`--documents goes with check, not ${h}.`);if(s.has("--remove")&&c!==g.key)throw new d(`--remove goes with key, not ${h}.`);if(r!==void 0&&c!==g.new)throw new d(`--recipe goes with new, not ${h}.`);let y=["--script","--flow","--data","--page"].filter(b=>s.has(b));if(r!==void 0&&y.length)throw new d(`--recipe makes a block of what Gallery's ${r} holds: ${y[0]} goes with a new block of none.${y[0]==="--page"&&$(r)?.places.includes("page")?` ${r} already is a card for a custom page (its places hold page): leave --page out.`:""}`);if(s.has("--flow")&&s.has("--data"))throw new d("--flow and --data do not go together: --flow is a slot for blocks of the document's own, --data a list of lines a reader keeps in the block's JSON. Make the one you need with new, and add the other by hand.");if(s.has("--flow")&&s.has("--page"))throw new d("--flow and --page do not go together: a custom page renders no document's blocks, so a block for a page has no slot.");let O=[...m.keys(),...Object.keys(n).filter(b=>!m.has(b)),...s.has("--keep")?["--keep"]:[],...s.has("--replace")?["--replace"]:[]];if(c===g.try)return c(t,{named:a.slice(1),values:m,seconds:n,keep:s.has("--keep"),replace:s.has("--replace")});if(O.length)throw new d(`${O[0]} goes with try, not ${h}.`);if(c===g.list){if(f!==void 0)throw new d(`gallery block ${h} takes nothing else.`);return c(t)}if(c===g.pack)return c(t,f,i);if(c===g.key){if(i.length>1)throw new d("gallery block key takes a host and its key: gallery block key <host> <key>.");return c(t,f,i[0],{remove:s.has("--remove")})}if(c===g.add){if(f===void 0||i.length>0)throw new d(`gallery block add takes one name of Gallery's own blocks: ${z()}.`);return c(t,f)}if(f===void 0||i.length>0)throw new d(`gallery block ${h} takes one id.`);let me=c===g.show||c===g.check?Ie(t,f):re(f);return c(t,me,{script:s.has("--script"),flow:s.has("--flow"),data:s.has("--data"),page:s.has("--page"),documents:s.has("--documents"),recipe:r})}export{re as a,Ie as b,M as c,u as d,ce as e,Ce as f,He as g,pe as h,pt as i,mt as j};
|
package/dist/chunk-4KUO7R2M.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{a as Te}from"./chunk-JEUK3ZO7.mjs";import{a as Ne,b as Oe,c as Xe,d as Ze,g as Ae,h as et}from"./chunk-PUOQ65NC.mjs";import{g as Qe}from"./chunk-6NLXUKAY.mjs";import{b as je}from"./chunk-VRPVVMRB.mjs";import{p as Se}from"./chunk-USIHBCSW.mjs";import{a as ce}from"./chunk-HYMEEXKN.mjs";import{a as Ee,f as le,p as ze}from"./chunk-TKWEX4FD.mjs";import T from"node:fs/promises";import pe from"node:os";import x from"node:path";import{pathToFileURL as De}from"node:url";import{instancesOf as ot,isInstance as bt}from"../browser/shared/components/index.mjs";import{ATTRIBUTE as $t,FALLBACK as xt,INSTANCE as he,SLOT as vt,SLOT_PART as tt}from"../browser/shared/components/installed.mjs";import{jsonIn as Et}from"../browser/shared/json-layout.mjs";import{QUERY_ROUTE as St}from"../browser/shared/workspace-query.mjs";import{documentDirectory as jt,documentFiles as Tt,layoutOf as it,listDocumentSlugs as Nt,PACKAGE_MANIFEST as Ot}from"../browser/shared/workspace.mjs";var At="in a browser, under the export's policy",de=(e=null)=>e?`the instances in ${e}, in a browser under the export's policy`:"the workspace's documents",q="component-check",ae=[360,736,1024],Le=["light","dark"],Lt=[1024,360],nt=1e4,rt=6e4,se=3e4,Dn=12e4,lt=2e3,Rt=3e3,Dt=60,Mn=15e3,Mt=2,Pt=8,Ct=se/2,_t=/^(?:wasm-)?eval$/,It=new Set(["TargetCloseError","ConnectionClosedError"]),Pn=e=>e.evaluateOnNewDocument(Ft,St);function Ft(e){let t=globalThis.fetch;if(typeof t!="function"||globalThis.__galleryQueries)return;let i={pending:new Map,count:0};globalThis.__galleryQueries=i,globalThis.fetch=function(r,n){let a=t.apply(this,arguments);try{let p=new URL(typeof r=="string"?r:r?.url??String(r),location.href);if(p.pathname===e){let u=++i.count,w=/\/__gallery\/components\/([a-z0-9-]+\/[a-z0-9-]+)\/kit\.js/.exec(new Error().stack??"");i.pending.set(u,{kind:p.searchParams.get("kind"),block:w?w[1]:null,at:Date.now()});let l=()=>{i.pending.delete(u)};Promise.resolve(a).then(l,l)}}catch{}return a}}var oe=e=>String(e?.message??e).split(`
|
|
3
|
-
`)[0],ct=(e,t)=>`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${e}</title></head><body><main class="doc-page" data-doc-id="${e}">${t}
|
|
4
|
-
</main></body></html>
|
|
5
|
-
`,Bt=({example:e,template:t})=>`<p>example.html</p>${e}
|
|
6
|
-
<hr><p>template.html</p>${t}`,Ht=e=>{for(let t=e.parentNode;t;t=t.parentNode)if(bt(t))return!0;return!1},dt=(e,t)=>ot(e,t).filter(i=>!Ht(i)),Me=(e,t)=>dt(ce(e),t).map(({sourceCodeLocation:{startLine:i,startOffset:r,endOffset:n}})=>({line:i,markup:e.slice(r,n)}));async function ht(e,t){let i=x.join(t,"components",...e.id.split("/"));for(let r of[Ot,"template.html",...e.files]){let n=ze(e,r);if(!n)continue;let a=await T.readFile(n);await T.mkdir(x.dirname(x.join(i,r)),{recursive:!0}),await T.writeFile(x.join(i,r),r==="kit.js"?`${a}
|
|
7
|
-
//# sourceURL=kit.js
|
|
8
|
-
`:a)}}async function Wt(e,{example:t,template:i},r){await ht(e,r);let n=x.join(r,q);await T.mkdir(n);let a=`${t}
|
|
9
|
-
`,p=je(ct(q,Bt({example:t,template:i}))).text;await T.writeFile(x.join(n,"doc.html"),p),await T.writeFile(x.join(n,"doc.json"),JSON.stringify({title:q,description:q,type:"component"}));let w=await(await Se({directory:r,catalog:le(r)}))(q),l=x.join(r,"export.html");await T.writeFile(l,w);let f=a.split(`
|
|
10
|
-
`).length-1,s=Me(p,e).map(({line:c})=>c>f?{file:"template.html",line:c-f}:{file:"example.html",line:c});return{html:w,file:l,places:s,source:p}}function qt({match:e,instance:t,slot:i,parts:r,boards:n}){if(!Object.entries(r).some(([l,{edit:f}])=>f==="data"&&!n.includes(l)))return[];let a=[...document.querySelectorAll(e)].filter(l=>!l.parentElement.closest(t)),p=l=>l.parentElement?.closest(`${t}, ${i}`)??null,u=l=>`<${l.localName}${l.classList.length?` class="${l.getAttribute("class")}"`:""}>`,w=l=>{let f=(l.textContent||l.getAttribute("aria-label")||l.getAttribute("placeholder")||l.getAttribute("title")||"").replace(/\s+/g," ").trim().slice(0,24);return`${u(l)}${f?` "${f}"`:""}`};return a.flatMap((l,f)=>{let s=[...l.querySelectorAll("button, input, select, textarea")].filter(c=>p(c)===l).filter(c=>{if(c.disabled||c.readOnly||c.type==="hidden")return!1;let h=c.getBoundingClientRect(),b=getComputedStyle(c);return h.width>0&&h.height>0&&b.visibility!=="hidden"&&b.display!=="none"});return s.length?[{at:f,what:s.slice(0,3).map(w).join(", "),counts:[s.length]}]:[]})}async function Gt({match:e,instance:t,slotPart:i,slotName:r,fallback:n,parts:a,boards:p,at:u,source:w,still:l,step:f,times:s,typed:c,typing:h}){let b=()=>[...document.querySelectorAll(e)].filter(o=>!o.parentElement.closest(t)),k=o=>new Promise(d=>setTimeout(d,o)),g=()=>new Promise(o=>{requestAnimationFrame(o),setTimeout(o,100)}),m=async o=>{await g(),await g();let d=o.outerHTML;for(let y=0,v=Date.now()+l;y<3;){if(Date.now()>v)return null;await k(f);let E=o.outerHTML;y=E===d?y+1:0,d=E}return d},_=o=>{let d=document.createElement("template");return d.innerHTML=o,d.content.firstElementChild},$=o=>`<${o.localName}${o.classList.length?` class="${o.getAttribute("class")}"`:""}>`,S=o=>o.nodeType===1?$(o):`the words "${o.data.trim().slice(0,40)}"`,B=o=>[...o.childNodes].filter(d=>d.nodeType===1||d.nodeType===3&&d.data.trim()),H=(o,d)=>["style","class"].includes(d)&&!o.getAttribute(d)?.trim()?null:o.getAttribute(d),D=(o,d)=>{for(let E of new Set([...o.getAttributeNames(),...d.getAttributeNames()]))if(H(o,E)!==H(d,E))return`${E} on ${$(d)}, ${JSON.stringify(H(o,E))} then ${JSON.stringify(H(d,E))}`;let[y,v]=[B(o),B(d)];for(let E=0;E<Math.max(y.length,v.length);E++){let[N,M]=[y[E],v[E]];if(!N||!M)return`${$(d)} ${N?`without ${S(N)}`:`with ${S(M)} more`}`;if(N.nodeType!==M.nodeType||N.localName!==M.localName||N.nodeType===3&&N.data.trim()!==M.data.trim())return`in ${$(d)}, ${S(N)} then ${S(M)}`;let I=N.nodeType===1?D(N,M):null;if(I)return I}return null},ue=o=>{let d=new Map;for(let y of o)d.set($(y),(d.get($(y))??0)+1);return d},_e=()=>[...document.querySelectorAll("*")].filter(o=>!o.closest(t)),Ie=o=>[...o.at(-1).keys()].filter(d=>o.length>2&&o.every((y,v)=>v===0||(y.get(d)??0)>(o[v-1].get(d)??0))),Fe=o=>o.parentElement?.closest(`${t}, ${i}`)??null,Be=o=>[...o.querySelectorAll(i)].filter(d=>Fe(d)===o),G=o=>{let d=o.cloneNode(!0);return Be(d).forEach(y=>y.replaceChildren()),d},Z=o=>Be(o).map(d=>{let y=[];for(let v=d.parentElement;v&&v!==o;v=v.parentElement)y.unshift($(v));return{name:d.getAttribute(r),place:y.join(" > "),blocks:[...DocKit.dehydrate(d.cloneNode(!0)).children].map(v=>v.localName).join(" "),html:DocKit.dehydrate(d.cloneNode(!0)).outerHTML}}),we=(o,d,y,{markup:v=!0}={})=>o.flatMap(({name:E,place:N,blocks:M,html:I})=>{let A=d.find(W=>W.name===E),X=A?A.place!==N?`moved the slot ${E} (${A.place?`in ${A.place}`:"straight in the instance"}, where the file has it ${N?`in ${N}`:"straight in the instance"})`:A.blocks!==M?`changed the blocks the slot ${E} holds (${M||"none"}, then ${A.blocks||"none"})`:v&&A.html!==I?`changed what the slot ${E} holds`:null:`took the slot ${E} off the instance`;return X?[{kind:"written-in",part:E,how:`${X}, ${y}`}]:[]}),He=o=>d=>Fe(d)===o,fe=(o,d=()=>!0)=>Object.entries(a).filter(([,{edit:y}])=>d(y)).flatMap(([y,v])=>[...o.querySelectorAll(v.at)].filter(He(o)).map(E=>({name:y,node:E}))),ee=o=>fe(o,d=>d==="text"),K=o=>Object.entries(a).filter(([,{edit:d}])=>d==="data").map(([d,y])=>({name:d,node:[...o.querySelectorAll(y.at)].find(He(o))})).filter(({node:d})=>d),C=[],V=b()[u];if(!V)return[{kind:"gone"}];if(V.hasAttribute(n))return[{kind:"fallback"}];let me=await m(V);if(me===null)return[{kind:"moving"}];let ie=_(w),We=Z(V);C.push(...we(Z(ie),We,"as it mounts",{markup:!1}));let ge=ee(ie);ee(V).forEach(({name:o,node:d},y)=>{ge[y]&&ge[y].node.innerHTML!==d.innerHTML&&C.push({kind:"redrawn",part:o,how:`the file says ${JSON.stringify(ge[y].node.textContent.trim())}, the page ${JSON.stringify(d.textContent.trim())}`})});let ke=DocKit.dehydrate(V.cloneNode(!0)),[qe,Ge]=[G(ie),G(ke)],ye=D(qe,Ge);if(ye){let o=fe(Ge),d=fe(qe).find(({node:y},v)=>o[v]&&D(y,o[v].node))?.name;C.push({kind:"left",what:ye,...d?{part:d}:{}})}let ft=K(ke);for(let[o,{name:d,node:y}]of K(ie).entries())!ye&&ft[o]?.node.innerHTML!==y.innerHTML&&C.push({kind:"data",part:d});let Q=[],be=new MutationObserver(o=>Q.push(...o));be.observe(document.documentElement,{subtree:!0,childList:!0,characterData:!0});let Ue=new Set,Je=o=>{Q.push(...be.takeRecords());for(let{name:d,node:y}of o)(!y.isConnected||Q.some(({target:v})=>y.contains(v)))&&Ue.add(d);Q.length=0},$e=[me],xe=[ue(_e())],Ke=o=>{$e.push(o),xe.push(ue(_e())),C.push(...we(We,Z(j),"as it mounts again"))},j=ke,ve=ee(j);Q.length=0,V.replaceWith(j);let U=await m(j);if(Je(ve),U!==null){Ke(U);for(let o=0;o<s&&U!==null;o++){let d=j.cloneNode(!0);ve=ee(d),Q.length=0,j.replaceWith(d),j=d,U=await m(j),Je(ve),U!==null&&Ke(U)}}be.disconnect(),U===null&&C.push({kind:"moving"});for(let o of Ue)C.push({kind:"redrawn",part:o,how:"a mount changes it"});let Ve=$e.map(o=>ue(G(_(o)).querySelectorAll("*"))),Ye=Ie(Ve);for(let o of Ye)C.push({kind:"piles",what:o,counts:Ve.map(d=>d.get(o)??0)});for(let o of Ie(xe))C.push({kind:"piles",what:o,outside:!0,counts:xe.map(d=>d.get(o)??0)});if(!Ye.length){let o=$e.slice(1).map(d=>D(G(_(me)),G(_(d)))).find(Boolean);o&&C.push({kind:"changed",what:o})}let re=U===null?[]:ee(j).filter(({node:o})=>o.textContent.trim()),mt=[...new Set([...new Map(re.map(o=>[o.name,o])).values(),...re])].slice(0,c),gt=Date.now()+h;for(let{node:o}of mt){if(Date.now()>gt)break;let d=document.createTreeWalker(o,NodeFilter.SHOW_TEXT).nextNode(),y=d.data;d.data=`${y}\u2026`;let v=re.map(({node:N})=>N.textContent);await m(j);let E=re.find(({node:N},M)=>!N.isConnected||N.textContent!==v[M]);if(E){C.push({kind:"redrawn",part:E.name,how:"a change of its words does not stand"});break}d.data=y,await m(j)}return U!==null&&K(j).length>0&&C.push(...await kt()),C;async function kt(){let o=[],d=null,y=!1,v="as it hears that it can write (the editable signal)",E=[],N=I=>{if(I.target!==j)return;let{parts:A,run:X}=I.detail,W=A.map(({part:O})=>O.innerHTML),P=A.map(({part:O})=>O.cloneNode(!0)),te=X(Object.fromEntries(A.map(({name:O},R)=>[O,P[R]]))),J=A.find(({part:O},R)=>O.innerHTML!==W[R]),Y=A.find(({part:O},R)=>P[R].cloneNode(!1).outerHTML!==O.cloneNode(!1).outerHTML);if(J&&A.forEach(({part:O},R)=>{O.innerHTML=W[R]}),!y){let O=J??Y??A.find((R,ne)=>P[ne].innerHTML!==W[ne]);O&&!E.some(R=>R.when===v)?E.push({kind:"unasked",part:O.name,when:v}):te&&!O&&I.preventDefault();return}J?d??=`it writes the part ${J.name} on the page, not the draft context.edit hands it, so the editor refuses the edit`:te&&Y&&(d??=`it changes the part ${Y.name}'s own tag or attributes, which are the file's: a change writes what a part holds, so the editor refuses the edit`),!(J||!te||Y)&&(A.forEach(({part:O},R)=>{o.push({part:O,before:W[R]}),O.replaceChildren(...P[R].childNodes)}),I.preventDefault())};document.addEventListener("doc-component-edit",N);try{return[...await M(),...E]}finally{document.removeEventListener("doc-component-edit",N)}async function M(){dispatchEvent(new Event("doc-editable")),await m(j),v="as it mounts";let I=j.cloneNode(!0);j.replaceWith(I),j=I;let A=await m(j);v="as it hears its part changed (the source signal)";let X=Z(j),W=DocKit.dehydrate(j.cloneNode(!0)),P=[];y=!0;try{if(!DocKit.example(j))return K(j).every(({name:F})=>p.includes(F))?[]:[{kind:"no-example"}]}catch(F){return[{kind:"example",what:`it throws: ${F?.message??F}`}]}finally{y=!1}let te=await m(j),J=DocKit.dehydrate(j.cloneNode(!0)),Y=Object.fromEntries(K(J).map(({name:F,node:z},yt)=>[F,z.innerHTML,K(W)[yt]?.node.innerHTML]).filter(([,F,z])=>F!==z));d?P.push({kind:"example",what:d}):o.length===0?P.push({kind:"example",what:"context.edit was not taken: it was not called, or it answered false, and the console says why"}):Object.keys(Y).length===0?P.push({kind:"example",what:"it changes nothing a part holds"}):P.push({kind:"wrote",parts:Y});for(let F of[W,J])for(let{node:z}of K(F))z.textContent="";let O=D(G(W),G(J));O&&P.push({kind:"example",what:`it changes what is no data part: ${O}`}),P.push(...we(X,Z(j),"as its example makes its edit"));for(let{part:F,before:z}of o.reverse())F.innerHTML=z;let R=await m(j),ne=A!==null&&R!==null?D(G(_(A)),G(_(R))):null;return te===null||R===null?P.push({kind:"moving"}):ne&&!O&&P.push({kind:"undo",what:ne}),P}}}var Ut=e=>e.map(({name:t,removed:i,added:r,lines:n})=>`${t} (-${i} +${r} of its ${n} line${n===1?"":"s"})`).join(" and "),Jt="a write changes the lines it means and no others: a row moved by context.rows, which takes the blank before it along, JSON written back by context.editJSON and laid out in template.html and example.html as it writes it (block-script.md, Two examples)";function Re(e,t){try{return JSON.parse(e),Et(e,JSON.parse(t))===t}catch{return!1}}var Kt="it changes nothing a part holds";function Vt({kind:e,what:t,part:i,how:r,when:n,counts:a,outside:p,parts:u,back:w,line:l,json:f},s,{script:c}){let h=k=>({...s,what:k}),b=k=>({...s,what:k,note:!0});switch(e){case"wrote":return{...s,told:!0,what:`its example wrote ${Ut(u)}; the server took it${w?"; put back as an undo does, it shows what it showed":""}`};case"laid":return b(`its example's write lays the part ${i} out anew (${r}): ${Jt}${f?`; this write is context.editJSON's, and what the file held is laid out otherwise: lay ${i} out as it writes it`:""}`);case"drops":return{...b(`${t} listens for dragover and not for dragenter: a drop goes where both are cancelled, and the move that enters it asks dragenter alone, so that a release then (on a card's words, its padding) drops nothing: cancel dragenter as dragover is cancelled (preventDefault)`),file:"kit.js",line:l};case"controls":return{...b(`where nothing is written (this look is an export: context.canEdit() is false) the instance of ${s.file}${s.line?`:${s.line}`:""} still shows ${t}${a[0]>3?` and ${a[0]-3} more`:""}, enabled, and the block has a data part: a reader presses a control that writes to no effect, and the export says the block can be edited. Draw a control that writes only while context.canEdit(), and hide it by the hidden attribute (the kit holds [hidden] over any display the style gives it) or disable it; ignore this for a control that only changes what a reader looks at, a filter or a tab, which an export keeps. Compare 1024-light.png with edit-1024-light.png: the second is what a reader who can edit sees`),file:"kit.js",line:void 0};case"gone":return h("the page does not hold this instance");case"fallback":return h(c?"its component failed or never started: the instance shows what it holds, read-only":"the instance shows as one of no custom block");case"moving":return b("what it shows never holds still (an animation?), so its mounts could not be compared");case"redrawn":return h(`the component redraws its text part ${i}: ${r}. A text part is the file's, what the user types in: read it, and draw in what is the component's`);case"left":return h(`dehydrate does not leave it as the file has it, so a copy of the view would hold what the kit made of it: ${t}. ${i?`That stands in its part ${i}, which is the file's: read a part, and draw in what is the component's`:"Name what it draws in the manifest's runtime, or take it off in dehydrate"}`);case"data":return h(`a mount changes its data part ${i}, so that a page would write what the component left there, with nothing edited: read a data part, and change it by context.edit alone`);case"no-example":return b("it has a data part and its component offers no example of an edit, so nothing has tried the way back to the file: give DocKit.component an example(host, context) that makes a small context.edit");case"example":return t===Kt?{...s,file:"kit.js",line:void 0,what:`its example(host, context) changes nothing a part holds on the instance of ${s.file}${s.line?`:${s.line}`:""}: the check runs it on every instance of example.html and of template.html, and template.html's is empty, with nothing to change a value of (the first entry of a list it does not hold yet). Make example() make a change that works on an empty instance too (add an entry, set a field), and have it call the function a reader's control calls, so that it tries the code a reader runs`}:h(`its example: ${t}`);case"refused":return h("what its example wrote cannot go in the file: a script, a handler, an address of code, data-block-id or data-ge-*, what does not read back as itself, or what is no JSON in a script of data");case"undo":return h(`with what its example wrote put back, as an undo does, it does not show what it showed: ${t}: draw from the part, and on the source signal`);case"unasked":return h(`it writes its data part ${i} with no reader's gesture, ${n}, once the page takes edits: a page would write it each time it opened. Call context.edit on a gesture alone, a press, a drop or a key, and draw what the part holds as it is`);case"written-in":return h(`kit.js ${r}: a slot is the document's, its blocks the reader's: read it with context.part, never write in it or move it, and draw outside it`);case"piles":return h(p?`${t} piles up outside the instance on each put-back (${a.join(", then ")} of them), so an undo adds another: a component draws in its instance, and what it has to put elsewhere it takes away again in destroy`:`${t} piles up on each put-back (${a.join(", then ")} of them): it is declared in neither the manifest's runtime nor dehydrate, so an undo adds another`);default:return h(`a mount does not give the same DOM again: ${t}`)}}var Yt=e=>[...new Map(e.toReversed().map(t=>[`${t.finding.kind}|${t.finding.part??""}|${["piles","example"].includes(t.finding.kind)?t.finding.what:""}|${t.finding.when??""}|${t.finding.line??""}`,t])).values()].toReversed(),zt=4e6;function Pe(e,t,i=(r,n)=>r===n){let[r,n]=[e.split(`
|
|
11
|
-
`),t.split(`
|
|
12
|
-
`)],a=0;for(;a<r.length&&a<n.length&&i(r[a],n[a]);)a++;let p=0;for(;p<r.length-a&&p<n.length-a&&i(r[r.length-1-p],n[n.length-1-p]);)p++;let[u,w]=[r.slice(a,r.length-p),n.slice(a,n.length-p)];if(u.length===0&&w.length===0)return[];if(u.length*w.length>zt)return[{removed:u,added:w}];let l=Array.from({length:u.length+1},()=>new Uint32Array(w.length+1));for(let c=u.length-1;c>=0;c--)for(let h=w.length-1;h>=0;h--)l[c][h]=i(u[c],w[h])?l[c+1][h+1]+1:Math.max(l[c+1][h],l[c][h+1]);let f=[],s=null;for(let c=0,h=0;c<u.length||h<w.length;)c<u.length&&h<w.length&&i(u[c],w[h])?(s=null,c++,h++):(s||f.push(s={removed:[],added:[]}),h<w.length&&(c===u.length||l[c][h+1]>=l[c+1][h])?s.added.push(w[h++]):s.removed.push(u[c++]));return f}function Qt(e,t){let i=n=>n.filter(a=>a.trim()).length,r=Pe(e,t);return{removed:r.reduce((n,a)=>n+i(a.removed),0),added:r.reduce((n,a)=>n+i(a.added),0),lines:i(e.split(`
|
|
13
|
-
`))}}function Cn(e,t){let i=r=>r.map(n=>n.trim()).filter(Boolean);return Pe(e,t).map(({removed:r,added:n})=>({removed:i(r),added:i(n)})).filter(({removed:r,added:n})=>r.length+n.length>0)}function at(e,t){let i=0,r=0;for(let[n,a]of e.entries())if(n>0&&i>0&&i<t&&r++,i+=a.replace(/\s+/g,"").length,i>=t)break;return r}function Xt(e,t){let i=r=>r.filter(n=>!n.trim()).length;for(let{removed:r,added:n}of Pe(e,t,(a,p)=>a.trim()===p.trim())){if(i(n)>i(r))return"a line left blank";let[a,p]=[r.join("").replace(/\s+/g,""),n.join("").replace(/\s+/g,"")],u=0;for(;u<a.length&&u<p.length&&a[u]===p[u];)u++;let w=0;for(;w<a.length-u&&w<p.length-u&&a[a.length-1-w]===p[p.length-1-w];)w++;for(let[l,f,s]of[[u,r,n],[w,r.toReversed(),n.toReversed()]]){let[c,h]=[at(f,l)+1,at(s,l)+1];if(c!==h)return`${c} line${c===1?"":"s"} became ${h}`}}return null}function Zt(e,t){let i=Xt(e,t);return i&&!(Re(e,t)&&Re(e,e))?i:null}function en(e,{source:t,found:i,at:r,findings:n}){let a=Qe(t,dt(ce(t),i)[r],e.parts,new Map([[i.id,i]]));if(!a)return[{kind:"refused"}];let p=Object.keys(e.parts),u=a.map(({start:l,end:f,text:s},c)=>({name:p[c],before:t.slice(l,f),after:s}));return[{kind:"wrote",back:!n.some(({kind:l})=>l==="undo"||l==="moving"),parts:u.map(({name:l,before:f,after:s})=>({name:l,...Qt(f,s)}))},...u.flatMap(({name:l,before:f,after:s})=>{let c=Zt(f,s);return c?[{kind:"laid",part:l,how:c,json:Re(f,s)}]:[]})]}var tn=2e3;function nn({match:e,instance:t,at:i,most:r}){let n=[...document.querySelectorAll(e)].filter(a=>!a.parentElement.closest(t))[i];return n?[window,document,n,...n.querySelectorAll("*")].slice(0,r):[]}function an(e){return e.map((t,i)=>i<2?{parent:i-1,named:""}:{parent:i===2?1:e.indexOf(t.parentElement),named:`<${t.localName}${t.classList.length?` class="${t.getAttribute("class")}"`:""}>`})}function sn(){let e=new DragEvent("dragenter",{bubbles:!0,cancelable:!0,composed:!0,dataTransfer:new DataTransfer});return this.dispatchEvent(e),e.defaultPrevented}async function on(e,{match:t,at:i}){let r=new Map,n=({scriptId:a,url:p})=>r.set(a,p);e.on("Debugger.scriptParsed",n);try{await e.send("Debugger.enable"),await e.send("Debugger.setSkipAllPauses",{skip:!0});let{result:a}=await e.send("Runtime.evaluate",{expression:`(${nn})(${JSON.stringify({match:t,instance:he,at:i,most:tn})})`,objectGroup:"drops"}),{result:p}=await e.send("Runtime.callFunctionOn",{objectId:a.objectId,functionDeclaration:String(an),arguments:[{objectId:a.objectId}],returnByValue:!0}),{result:u}=await e.send("Runtime.getProperties",{objectId:a.objectId,ownProperties:!0}),w=u.filter(({name:c,value:h})=>/^\d+$/.test(c)&&h?.objectId).sort((c,h)=>Number(c.name)-Number(h.name)),l=[];for(let{value:c}of w)l.push((await e.send("DOMDebugger.getEventListeners",{objectId:c.objectId})).listeners);let f=(c,h)=>l[c]?.some(b=>b.type===h),s=[];for(let c=2;c<l.length;c++){let h=l[c].find(k=>k.type==="dragover"&&r.get(k.scriptId)==="kit.js");if(!h)continue;let b=!1;for(let k=c;k>=2&&!b;k=p.value[k].parent)b=f(k,"dragenter");if(!b&&(f(0,"dragenter")||f(1,"dragenter"))){let{result:k}=await e.send("Runtime.callFunctionOn",{objectId:w[c].value.objectId,functionDeclaration:String(sn),returnByValue:!0});b=k.value===!0}b||s.push({kind:"drops",what:p.value[c].named,line:h.lineNumber+1})}return s}finally{e.off("Debugger.scriptParsed",n),await e.send("Runtime.releaseObjectGroup",{objectGroup:"drops"}).catch(()=>{}),await e.send("Debugger.disable").catch(()=>{})}}function rn(e,t){let i={errors:new Map,notes:new Set,failed:new Set,dialogs:new Set,windows:0,opened:[],asked:1,pending:[]},r=n=>{let[a]=n.split(`
|
|
14
|
-
`);i.errors.has(a)||i.errors.set(a,Number(/\bkit\.js:(\d+)/.exec(n)?.[1])||null)};return e.on("pageerror",n=>r(n.stack??n.message)),e.on("console",n=>{let a=n.type();!["error","warn","warning"].includes(a)||!Xe(n,t,["kit.js"])||i.pending.push(Promise.all(n.args().map(p=>p.evaluate(u=>u instanceof Error?u.stack:String(u)).catch(()=>""))).then(p=>{let u=p.join(" ")||n.text();a==="error"?r(u):i.notes.add(u.split(`
|
|
15
|
-
`)[0])}))}),e.on("requestfailed",n=>{n.frame()===e.mainFrame()&&!n.isNavigationRequest()&&i.failed.add(n.url())}),e.on("request",n=>{n.isNavigationRequest()&&n.frame()===e.mainFrame()&&i.opened.push(n.url())}),i}async function ln(e,t){let i=await e.createCDPSession();return await i.send("Page.enable"),i.on("Page.javascriptDialogOpening",({type:r})=>{t.add(r),i.send("Page.handleJavaScriptDialog",{accept:!1}).catch(()=>{})}),i}function L(e,t,i=se){let r=0,n=()=>Object.assign(new Error(t),{stuck:!0,doing:t,limit:i}),a=new Promise((u,w)=>{r=setTimeout(()=>w(n()),i)}),p=e.catch(u=>{throw It.has(u.name)?n():Object.assign(u,{doing:t})});return Promise.race([p,a]).finally(()=>clearTimeout(r))}var cn=e=>`${Number((e/1e3).toFixed(1))} s`,pt=e=>`the browser did not answer within ${cn(e.limit)}, waiting until ${e.doing}`,Ce=e=>new Promise(t=>{if(!e.connected)return t(!0);e.once("disconnected",()=>t(!0)),setTimeout(()=>t(!1),lt)});function dn({match:e,instance:t}){let{clientWidth:i,scrollWidth:r}=document.documentElement;if(r<=i+1)return null;let n=[...document.querySelectorAll(e)].filter(a=>!a.parentElement.closest(t));return{wide:r,at:n.findIndex(a=>[a,...a.querySelectorAll("*")].some(p=>p.getBoundingClientRect().right>i+1))}}var st=16,hn="#8f8f8f";async function pn(e,t,i){let r=await Promise.all(t.map(async n=>`data:image/png;base64,${(await T.readFile(n)).toString("base64")}`));await e.setViewport({width:ae.reduce((n,a)=>n+a,0)+st*(ae.length-1),height:900}),await e.setContent(`<!doctype html><body style="margin: 0; display: flex; align-items: flex-start; gap: ${st}px; background: ${hn}">${r.map((n,a)=>`<img src="${n}" width="${ae[a]}" alt="" style="display: block">`).join("")}</body>`,{waitUntil:"load"}),await e.screenshot({path:i,fullPage:!0})}async function ut(e,{file:t,html:i,source:r,places:n,found:a,out:p,loading:u,answer:w=se}){let l=(m,_)=>L(m,_,w),f=await l(e.createBrowserContext(),"a browser context opened"),s=await l(f.newPage(),"a tab opened"),c=De(t).href,h=rn(s,c),b=await l(ln(s,h.dialogs),"the tab was set to refuse dialogs");f.on("targetcreated",m=>{m.type()==="page"&&(h.windows+=1,m.page().then(_=>_?.close()).then(()=>s.bringToFront()).catch(()=>{}))});let k={heard:h,blocked:[],late:[],taken:[],overviews:[],edited:[],asExport:[],answers:[],wide:[],stuck:null,stopped:null,gone:null},g=async m=>k.late.push(...await L(et(s,{timeout:nt}),m,3*nt+se));await l(Ze(s),"the tab was set to keep what the policy blocks"),await l(s.setViewport({width:736,height:900}),"the window went to 736px"),await l(s.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]),"the light theme came");try{await L(s.goto(c,{waitUntil:"load",timeout:0}),"the page opened",u),await g("the page opened");for(let $ of Le){await L(s.emulateMediaFeatures([{name:"prefers-color-scheme",value:$}]),`the ${$} theme came`);for(let S of ae){if(await L(s.setViewport({width:S,height:900}),`the window went to ${S}px`),await g(`it was drawn at ${S}px`),$===Le[0]){let H=await L(s.evaluate(dn,{match:a.match,instance:he}),`it was measured at ${S}px`);H&&k.wide.push({width:S,...H})}let B=x.join(p,`${S}-${$}.png`);await L(s.screenshot({path:B,fullPage:!0}),`it was pictured at ${S}px`),k.taken.push(B)}}await L(s.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]),"the light theme came"),await L(s.setViewport({width:736,height:900}),"the window went to 736px");let m=Me(i,a);for(let{at:$,...S}of await L(s.evaluate(qt,{match:a.match,instance:he,slot:tt,parts:a.parts,boards:a.settings?.length?[Ee]:[]}),"the page was asked what each instance still shows"))k.answers.push({finding:{kind:"controls",...S},place:n[$]});let _=a.files.includes("kit.js")&&Object.values(a.parts).some(({edit:$})=>$==="data");for(let $=0;$<m.length;$++){let S=await L(s.evaluate(Gt,{match:a.match,instance:he,slotPart:tt,slotName:vt,fallback:xt,parts:a.parts,boards:a.settings?.length?[Ee]:[],at:$,source:m[$].markup,still:Rt,step:Dt,times:Mt,typed:Pt,typing:Ct}),"an instance was put back"),B=S.find(({kind:D})=>D==="wrote"),H=[...S.filter(D=>D!==B),...B?en(B,{source:r,found:a,at:$,findings:S}):[]];_&&!S.some(({kind:D})=>D==="gone"||D==="fallback")&&H.push(...await L(on(b,{match:a.match,at:$}),"the page was asked what an instance listens to")),k.answers.push(...H.map(D=>({finding:D,place:n[$]})))}k.blocked=await L(s.evaluate(()=>globalThis.__qaViolations),"the page was asked what it blocked"),h.asked+=1,await L(s.goto(c,{waitUntil:"load",timeout:0}),"the page opened again",u),await g("the page opened again"),await L(s.evaluate(()=>dispatchEvent(new Event("doc-editable"))),"the page was told it takes edits"),await g("it was drawn as the editing page draws it");for(let $ of Lt){await L(s.setViewport({width:$,height:900}),`the window went to ${$}px`),await g(`it was drawn at ${$}px as the editing page draws it`);let S=x.join(p,`edit-${$}-light.png`);await L(s.screenshot({path:S,fullPage:!0}),`it was pictured at ${$}px as the editing page draws it`),k.edited.push(S),(await T.readFile(S)).equals(await T.readFile(x.join(p,`${$}-light.png`)))&&k.asExport.push(S)}k.blocked.push(...await L(s.evaluate(()=>globalThis.__qaViolations),"the page was asked what it blocked"));for(let $ of Le){let S=x.join(p,`overview-${$}.png`);await L(pn(s,ae.map(B=>x.join(p,`${B}-${$}.png`)),S),`the ${$} pictures were put side by side`),k.overviews.push(S)}}catch(m){if(m.syscall)throw m;await Ce(e)?k.gone=m.doing??"the page answered":m.stuck?k.stuck=m.doing:k.stopped=oe(m)}return await Promise.race([Promise.all(h.pending),new Promise(m=>setTimeout(m,lt).unref())]),k}var un=(e,t)=>e.startsWith(t)?e.slice(t.length):e;function wn(e,t,i){let r=new Map;for(let{url:n,directive:a,source:p,line:u}of e){if(_t.test(n)){let l=!p&&u>0;r.set(`${n}|${p}|${u}`,{file:l?"kit.js":"the page",...l?{line:u}:{},what:"the export's policy blocks code made from words (eval, new Function, a string given to setTimeout): an export runs none"});continue}let w=/^[a-z][a-z0-9+.-]*$/.test(n)?t.filter(l=>l.startsWith(`${n}:`)):[];for(let l of w.length?w:[n])r.set(`${l}|${a}`,{file:"the page",what:`the export's policy blocks ${un(l,i)||"something"} (${a}): ${a==="img-src"?"a picture of an instance is a data: address, or a file its style names":"an export holds all it needs"}`})}return[...r.values()]}function wt({heard:e,blocked:t,late:i,answers:r,wide:n,stuck:a,stopped:p},{places:u,script:w,folder:l}){let f=Yt(r).map(({finding:g,place:m})=>Vt(g,m,{script:w})),s=[...e.failed],c=s.filter(g=>!t.some(m=>m.url&&g.startsWith(m.url))),h=e.opened.length>e.asked?"it loads itself again (location.reload(), a new location.href), so a reader's page would not stay":a?`it stopped answering while waiting until ${a}${w?": a script that never ends, or a component that changes what it hears (a text part, on its source signal)":""}`:p&&`the look at it stopped: ${p}`,b=n.map(({width:g,wide:m})=>`${m}px wide in a ${g}px window`).join(", "),k=u[n.find(({at:g})=>g>=0)?.at]??{file:"the page"};return{problems:[...[...e.errors].map(([g,m])=>({file:m?"kit.js":"the page",line:m,what:`the console says ${g}`})),...wn(t,s,l),...c.map(g=>({file:"the page",what:`it could not load ${g.slice(0,120)}`})),...[...e.dialogs].map(g=>({file:"the page",what:`it opens a dialog (${g}), which stops a reader's page until it is answered: show what it says in the instance`})),...e.windows?[{file:"the page",what:"it opens a window, which takes a reader away from the page: show it in the instance, or link to it"}]:[],...h?[{file:"the page",what:h}]:[],...n.length?[{...k,what:`the page is ${b}: a reader scrolls the whole page sideways, and gallery qa fails it: let it fit the window (max-width: 100%), or put what is wider in a frame of its own that scrolls`}]:[],...f.filter(({note:g,told:m})=>!g&&!m)],notes:[...[...e.notes].map(g=>({file:"the page",what:`the console says ${g}`})),...f.filter(({note:g})=>g),...i.map(g=>({file:"the page",what:`waited for ${g}`}))],told:f.filter(({told:g})=>g)}}async function _n(e,t,{example:i,template:r},{find:n=Ne,start:a=Ae,loading:p=rt,answer:u=se}={}){let w=At,l=null,f=null;try{l=await T.mkdtemp(x.join(pe.tmpdir(),"gallery-component-check-"));let s=await Wt(t,{example:i,template:r},l),c=n();if(!c)return{title:w,unverified:"no Chrome, Edge or Chromium found (GALLERY_BROWSER=<its executable> picks one)"};try{f=await a({executablePath:c,args:Oe()})}catch(g){return{title:w,unverified:`the browser ${c} did not start, twice, each time with a fresh profile (${oe(g)}; GALLERY_BROWSER=<its executable> picks another)`}}let h=x.join(it(e).qa,"components",...t.id.split("/"));await T.rm(h,{recursive:!0,force:!0}),await T.mkdir(h,{recursive:!0});let b=await ut(f.browser,{...s,found:t,out:h,loading:p,answer:u}),k=wt(b,{places:s.places,script:t.files.includes("kit.js"),folder:De(`${l}${x.sep}`).href});return b.gone?{title:w,...k,unverified:`the browser went while waiting until ${b.gone}, so it says nothing of the block`}:{title:w,...k,...b.taken.length?{pictures:{folder:h,overviews:b.overviews.map(g=>x.basename(g)),each:b.taken.map(g=>x.basename(g)),edited:b.edited.map(g=>x.basename(g)),asExport:b.asExport.map(g=>x.basename(g))}}:{}}}catch(s){return s.reason==="check"?{title:w,problems:s.failures.map(c=>({file:"the export",what:c}))}:s.syscall?{title:w,unverified:`cannot write ${Te(s.syscall==="mkdtemp"?pe.tmpdir():s.path)} (${s.code})`}:f&&await Ce(f.browser)?{title:w,unverified:"the browser went before the page opened"}:s.stuck?{title:w,problems:[{file:"the page",what:`${pt(s)}, so the look stopped and the browser was closed`}]}:{title:w,problems:[{file:"the page",what:`the look at it stopped: ${oe(s)}`}]}}finally{await f?.close(),l&&await T.rm(l,{recursive:!0,force:!0,maxRetries:5,retryDelay:200}).catch(()=>{})}}async function fn(e,t){let i=[];for(let r of await Nt(e)){let n=jt(r,e),a=Tt(n).html,p=await T.readFile(a,"utf8").catch(()=>null);if(p===null)continue;let u=ot(ce(p),t),w=f=>{for(let s=f.parentNode;s;s=s.parentNode)if(u.includes(s))return!0;return!1},l=u.filter(f=>!w(f)).map(({sourceCodeLocation:{startLine:f,startOffset:s,endOffset:c}})=>({line:f,markup:p.slice(s,c)}));l.length&&i.push({slug:r,place:`${r}/${x.basename(a)}`,directory:n,instances:l})}return i}async function mn(e,t,i,r){let n=t.instances.map(({line:s,markup:c})=>`<p>${t.place}:${s}</p>${c}`).join(`
|
|
16
|
-
`);for(let s of new Set([e.id,...[...n.matchAll(new RegExp(`${$t}="([^"]+)"`,"g"))].map(([,c])=>c)])){let c=s===e.id?e:i.get(s);c&&await ht(c,r)}let a=x.join(r,q);await T.mkdir(a),await T.cp(x.join(t.directory,"assets"),x.join(a,"assets"),{recursive:!0}).catch(s=>{if(s.code!=="ENOENT")throw s});let p=je(ct(q,n)).text;await T.writeFile(x.join(a,"doc.html"),p),await T.writeFile(x.join(a,"doc.json"),JSON.stringify({title:q,description:q,type:"component"}));let w=await(await Se({directory:r,catalog:le(r)}))(q),l=x.join(r,"export.html");await T.writeFile(l,w);let f=Me(p,e).map((s,c)=>({file:t.place,line:t.instances[c]?.line??null}));return{html:w,file:l,places:f,source:p}}async function In(e,t,{find:i=Ne,start:r=Ae,loading:n=rt}={}){let a=await fn(e,t);if(a.length===0)return[{title:de(),none:`none holds an instance of ${t.id}`}];let p=i();if(!p)return[{title:de(),unverified:"no Chrome, Edge or Chromium found (GALLERY_BROWSER=<its executable> picks one)"}];let u;try{u=await r({executablePath:p,args:Oe()})}catch(f){return[{title:de(),unverified:`the browser ${p} did not start, twice, each time with a fresh profile (${oe(f)}; GALLERY_BROWSER=<its executable> picks another)`}]}let{packages:w}=le(e),l=[];try{for(let f of a){let s=de(f.place),c=null;try{c=await T.mkdtemp(x.join(pe.tmpdir(),"gallery-component-check-"));let h=await mn(t,f,w,c),b=x.join(it(e).qa,"components",...t.id.split("/"),"documents",f.slug);await T.rm(b,{recursive:!0,force:!0}),await T.mkdir(b,{recursive:!0});let k=await ut(u.browser,{...h,found:t,out:b,loading:n}),g=wt(k,{places:h.places,script:t.files.includes("kit.js"),folder:De(`${c}${x.sep}`).href});if(k.gone){l.push({title:s,...g,unverified:`the browser went while waiting until ${k.gone}, so it says nothing of these instances`});break}l.push({title:s,...g,...k.taken.length?{pictures:{folder:b,overviews:k.overviews.map(m=>x.basename(m)),each:k.taken.map(m=>x.basename(m)),edited:k.edited.map(m=>x.basename(m)),asExport:k.asExport.map(m=>x.basename(m)),documents:!0}}:{}})}catch(h){if(h.reason==="check")l.push({title:s,problems:h.failures.map(b=>({file:f.place,what:`its instances, exported alone: ${b}`}))});else if(h.syscall)l.push({title:s,unverified:`cannot write ${Te(h.syscall==="mkdtemp"?pe.tmpdir():h.path)} (${h.code})`});else if(await Ce(u.browser)){l.push({title:s,unverified:"the browser went before the page opened"});break}else if(h.stuck){l.push({title:s,problems:[{file:"the page",what:`${pt(h)}, so the look at them stopped, the browser was closed, and no document after them was looked at`}]});break}else l.push({title:s,problems:[{file:"the page",what:`the look at them stopped: ${oe(h)}`}]})}finally{c&&await T.rm(c,{recursive:!0,force:!0,maxRetries:5,retryDelay:200}).catch(()=>{})}}}finally{await u.close()}return l}export{At as a,de as b,rt as c,se as d,Dn as e,Rt as f,Dt as g,Mn as h,Pn as i,oe as j,ct as k,Ut as l,Jt as m,Qt as n,Cn as o,Zt as p,ln as q,L as r,cn as s,pt as t,Ce as u,_n as v,In as w};
|
package/dist/chunk-4OZWXZE5.mjs
DELETED
|
@@ -1,5 +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 y from"node:fs";import{fileURLToPath as S}from"node:url";import{namedPlace as h}from"../browser/shared/page-address.mjs";import{pageLinks as w}from"../browser/shared/page-links.mjs";import{reportsDirectory as b}from"../browser/shared/paths.mjs";import{listReportSlugs as g,slugPattern as x}from"../browser/shared/reports.mjs";import{RESERVED as v,isSlugName as N,listTrash as O}from"../browser/shared/workspace.mjs";var m=e=>/^--.|^-[A-Za-z]/.test(e),a=class extends Error{constructor(n){super(n),this.name="UsageError"}};function A(e){let n=y.readFileSync(S(e),"utf8").split(/\r?\n/),t=n.findIndex(s=>!s.startsWith("//"));return n.slice(0,t===-1?n.length:t).map(s=>s.replace(/^\/\/ ?/,"")).join(`
|
|
3
|
-
`)}var E=e=>/^Usage: (gallery \S+|npm run \S+|node \S+)/.exec(e)?.[1]??"this command",P=e=>e.split(`
|
|
4
|
-
`)[0],R=(e,n,t=P(e))=>{let s=E(e);return`${n}
|
|
5
|
-
${t} (${s}${s.startsWith("npm run")?" --":""} --help says more)`},T=e=>{let n=e.indexOf("--");return(n===-1?e:e.slice(0,n)).some(t=>t==="--help"||t==="-h")};function $({options:e=[],values:n=[],argv:t=process.argv.slice(2)}={}){let s=t.indexOf("--"),[o,r]=s===-1?[t,[]]:[t.slice(0,s),t.slice(s+1)],l=[],u=new Set,p=new Map;for(let c=0;c<o.length;c++){let i=o[c],[f,k]=i.startsWith("--")&&i.includes("=")?[i.slice(0,i.indexOf("=")),i.slice(i.indexOf("=")+1)]:[i,void 0];if(!m(i))l.push(i);else if(n.includes(f)){let d=k??(c+1<o.length&&!m(o[c+1])?o[++c]:void 0);if(!d)throw new a(`${f} takes a value`);p.set(f,d)}else if(e.includes(i))u.add(i);else throw new a(`Unknown option: ${i}`)}return{positional:[...l,...r],options:u,values:p}}function U(e){if(!x.test(e))throw new a(`Not a document's slug: ${e} (lowercase kebab-case).`);if(v.has(e))throw new a(`Not a document's slug: ${e} (a name the workspace keeps for itself).`);return e}async function L(e){let n=await O(b),t=n.filter(({kind:r})=>r==="document"),s=h(e,w(t));if(s)return`${e} is a document in the trash ("${t.find(({slug:r})=>r===s.slug).title}"): it has to be restored in the workbench first.`;let o=n.find(({kind:r,slug:l})=>r==="page"&&l===e);return o?`${e} is a custom page in the trash ("${o.title}"), not a document: once it is restored in the workbench, gallery page open ${e} opens it.`:null}async function W(e){let n=(await g()).filter(N),t=h(e,w(n.map(o=>({slug:o}))));if(t)return t;let s=await L(e);if(s)throw new a(s);if(!x.test(e))throw new a(`Not a document's slug, link or address: ${e} (gallery list shows them).`);return{slug:U(e),block:null}}async function D({options:e=[],values:n=[],argv:t,noneIsAll:s=!1}={}){let{positional:o,options:r,values:l}=$({options:["--all",...e],values:n,argv:t}),u=r.has("--all");if(u&&o.length>0)throw new a("Name documents or pass --all, not both.");if(!u&&o.length===0&&!s)throw new a("Name a document (or pass --all).");let p=await Promise.all(o.map(W));return{slugs:u||o.length===0?await g():[...new Set(p.map(({slug:c})=>c))],options:r,values:l}}async function Z(e,{documents:n=!1,...t}={}){let s=A(e),o=t.argv??process.argv.slice(2);T(o)&&(console.log(s),process.exit(0));try{return n?await D({...t,argv:o}):$({...t,argv:o})}catch(r){if(!(r instanceof a))throw r;console.error(R(s,r.message)),process.exit(2)}}export{m as a,a as b,A as c,R as d,T as e,$ as f,U as g,L as h,W as i,D as j,Z as k};
|
package/dist/chunk-4SNV4HA5.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}from"./chunk-BLNQUR5R.mjs";import"./chunk-6GV3CBB2.mjs";import"./chunk-DR73Y2UJ.mjs";import"./chunk-M4NRDYI5.mjs";import"./chunk-PUOQ65NC.mjs";import"./chunk-6QWQXHAV.mjs";import"./chunk-6Q7ASAXJ.mjs";import"./chunk-S3SX3COT.mjs";import"./chunk-GJJRBGMY.mjs";import"./chunk-JPG2LBQM.mjs";import"./chunk-ALZ6ZENZ.mjs";import"./chunk-IA4PSIMD.mjs";import"./chunk-2OHANJ6Q.mjs";import"./chunk-F4ZA6JRZ.mjs";import"./chunk-7M2BQQGZ.mjs";import"./chunk-6NLXUKAY.mjs";import"./chunk-VRPVVMRB.mjs";import"./chunk-4B2TB5K2.mjs";import"./chunk-KLQP46Y3.mjs";import"./chunk-USIHBCSW.mjs";import"./chunk-3SKOU6OZ.mjs";import"./chunk-ZTHICSSF.mjs";import"./chunk-PLB7L22J.mjs";import"./chunk-PAREWQGB.mjs";import"./chunk-BFJGHSQN.mjs";import"./chunk-U5XL7D6A.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-UMHUSOPJ.mjs";import"./chunk-W5NPH5UA.mjs";import"./chunk-ECZBLQKK.mjs";import"./chunk-E7656LR7.mjs";import"./chunk-TKWEX4FD.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{a as startProductionServer};
|
package/dist/chunk-53XDTHTG.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{g as i,h as g}from"./chunk-BN7M3IN7.mjs";import{b as m,f as u}from"./chunk-4OZWXZE5.mjs";import"./chunk-5L7RYZCL.mjs";import{spawn as P}from"node:child_process";import h from"node:fs/promises";import R from"node:path";import{projectRoot as v,release as G,reportsDirectory as S}from"../browser/shared/paths.mjs";import{answerOf as k,findPreviewServer as x,portIsFree as y,readAnnouncement as b}from"../browser/shared/preview-server.mjs";import{serviceLocation as E}from"../browser/shared/service-location.mjs";import{registerQuietly as A}from"../browser/shared/workspace-registry.mjs";import{defaultWorkspace as C}from"../browser/shared/workspace.mjs";var n=C(),I=a=>new Promise(t=>setTimeout(t,a));async function V(a){await A(S);let{positional:t,values:l}=u({values:["--port"],argv:a});if(t.length>0)throw new m(`gallery serve takes no arguments: ${t[0]}`);let o=l.has("--port")?Number(l.get("--port")):null;if(o!==null&&!(Number.isInteger(o)&&o>0&&o<65536))throw new m(`--port takes a port number: ${l.get("--port")}`);let s=await b(),f=s?await k(s,1e4):"no";f!=="no"&&(console.error(`The shared Gallery server runs already: ${i(s.port)} (pid ${s.pid}${f==="busy"?", not answering now":""}). gallery stop stops it; one server serves a Gallery data directory.`),process.exit(1));let r=null;if(o!==null)await y(o)||(console.error(`Port ${o} is taken: name another (--port), or leave it out for the first free one.`),process.exit(1)),r=o;else{for(let e of await g())if(await y(e)){r=e;break}r===null&&(console.error("No port from 4317 is free: name one (--port <n>)."),process.exit(1))}if(G){process.env.GALLERY_SERVER_KIND="cli";let{startProductionServer:e}=await import("./chunk-4SNV4HA5.mjs");await e({reportsDirectory:n,port:r,kind:"cli"}),await h.writeFile(E().lastPortFile,`${r}
|
|
3
|
-
`).catch(()=>{}),console.log(`Gallery serves ${n} at ${i(r)} (Chrome or Edge). Ctrl+C stops it.`);return}let{writeSharedAssets:$}=await import("./chunk-6L6V7YR2.mjs");await $();let c=P(process.execPath,[R.join(v,"node_modules","vite","bin","vite.js"),"--host","127.0.0.1","--port",String(r),"--strictPort"],{cwd:v,env:{...process.env,GALLERY_WORKSPACE:n,GALLERY_SERVER_KIND:"cli"},stdio:"inherit"});for(let e of["SIGINT","SIGTERM"])process.on(e,()=>c.kill(e));let w=new Promise(e=>c.once("exit",(d,p)=>e(d??(p?1:0))));for(;;){let e=await Promise.race([w.then(p=>({code:p})),I(300).then(()=>null)]);if(e&&process.exit(e.code),(await x({answering:!0,timeout:2e3}))?.pid===c.pid)break}await h.writeFile(E().lastPortFile,`${r}
|
|
4
|
-
`).catch(()=>{}),console.log(`Gallery serves ${n} at ${i(r)} (Chrome or Edge). Ctrl+C stops it.`),process.exit(await w)}export{V as run};
|
package/dist/chunk-5XV3YYLG.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,g}from"./chunk-XZCFPKGO.mjs";import"./chunk-S3SX3COT.mjs";import"./chunk-IA4PSIMD.mjs";import"./chunk-F4ZA6JRZ.mjs";import"./chunk-7M2BQQGZ.mjs";import"./chunk-6NLXUKAY.mjs";import"./chunk-VRPVVMRB.mjs";import"./chunk-USIHBCSW.mjs";import"./chunk-3SKOU6OZ.mjs";import"./chunk-ZTHICSSF.mjs";import"./chunk-PLB7L22J.mjs";import"./chunk-PAREWQGB.mjs";import"./chunk-BFJGHSQN.mjs";import"./chunk-U5XL7D6A.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-UMHUSOPJ.mjs";import"./chunk-W5NPH5UA.mjs";import"./chunk-ECZBLQKK.mjs";import"./chunk-E7656LR7.mjs";import"./chunk-TKWEX4FD.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{a as handInReports,e as idLines,f as inStepLines,d as noteNew,b as previewSettled,g as rereadLine,c as roundBegins};
|
package/dist/chunk-65NTKF4N.mjs
DELETED
|
@@ -1,6 +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 Q}from"./chunk-PDZR3L3C.mjs";import{c as _,d as z,e as B,l as G}from"./chunk-BN7M3IN7.mjs";import"./chunk-ZFGMJVJC.mjs";import"./chunk-QP7BOHE4.mjs";import{i as q}from"./chunk-GMJD7ID3.mjs";import{a as b,b as J}from"./chunk-JEUK3ZO7.mjs";import{a as Z}from"./chunk-GJJRBGMY.mjs";import{a as ee}from"./chunk-JPG2LBQM.mjs";import"./chunk-ALZ6ZENZ.mjs";import"./chunk-IA4PSIMD.mjs";import{c as V,d as Y,e as M}from"./chunk-RRKJMHNX.mjs";import"./chunk-2OHANJ6Q.mjs";import"./chunk-F4ZA6JRZ.mjs";import"./chunk-7M2BQQGZ.mjs";import"./chunk-6NLXUKAY.mjs";import{b as W,h as X}from"./chunk-VRPVVMRB.mjs";import"./chunk-WFGPMCTZ.mjs";import"./chunk-7UZUQQ7Q.mjs";import{b as T,f as C,g as H}from"./chunk-4OZWXZE5.mjs";import"./chunk-ZTHICSSF.mjs";import{k as U}from"./chunk-PLB7L22J.mjs";import{b as K}from"./chunk-PAREWQGB.mjs";import"./chunk-BFJGHSQN.mjs";import"./chunk-U5XL7D6A.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-UMHUSOPJ.mjs";import"./chunk-W5NPH5UA.mjs";import"./chunk-ECZBLQKK.mjs";import"./chunk-E7656LR7.mjs";import"./chunk-TKWEX4FD.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";import v from"node:fs/promises";import se from"node:os";import x from"node:path";import{IMPORT_EXT as re,kindOf as ie}from"../browser/shared/import-types.mjs";import{reportsDirectory as O}from"../browser/shared/paths.mjs";import{kebab as S}from"../browser/shared/web-links.mjs";import{documentDirectory as oe,documentFiles as E,newDocSlug as ae}from"../browser/shared/workspace.mjs";var ce=Object.values(re).flat().join(" "),j=(d,g)=>`${d} ${g}${d===1?"":"s"}`;function fe(d,g,p){let n=(f,r=g)=>(r.match(f)??[]).length,c=n(/<ol class="doc-flow"/g,p),$=n(/<li id="fn-\d+"/g,p),w=[[n(/<section class="doc-section"/g),"section"],[n(/<h[2-4][\s>]/g),"heading"],[n(/<p[\s>]/g),"paragraph"],[n(/<(?:ul|ol)[\s>]/g),"list"],[n(/<table\b/g),"table"],[n(/class="doc-math-(?:inline|block)"/g,p),"formula"],[n(/<div class="doc-code"/g),"code block"],[n(/<figure class="doc-image"/g),"picture"],[c,"flow"],[$,"footnote"]].filter(([f])=>f>0).map(([f,r])=>j(f,r)),h=(d.raws?.length??0)-c-($?1:0);return h>0&&w.push(`${j(h,"HTML block")} kept as written`),w}async function Se(d){let{positional:g,options:p}=C({options:["--no-preview","--no-browser"],argv:d}),[n,c,$]=g;if(g.length<1||g.length>3||!n)throw new T("Name the file; then the slug and the title, if you choose them.");let w=ie(n);if(!w)throw new T(`Not a kind of file gallery import takes: ${n} (${ce}).`);c!==void 0&&H(c);let h=x.resolve(n);await v.stat(h).then(i=>i.isFile(),()=>!1)||(console.error(`No such file: ${n}`),process.exit(1));let f=c!==void 0?await Q(c):null;f&&(console.error(f),process.exit(1));let r=x.basename(h),F=await v.mkdtemp(x.join(se.tmpdir(),"gallery-import-")),L,y,R;try{let i,u=[];if(w==="markdown")i=[{...await Y(h,F),from:r,children:[]}];else try{({pages:i,skipped:u}=await V([{file:h,name:r}],F))}catch(e){console.error(`${r} could not be read: ${e.message}`),process.exit(1)}i.length===0&&(console.error(`Nothing in ${r} could be read as a page${u.length?` (not taken: ${u.join(", ")})`:""}.`),process.exit(1)),$?.trim()&&(i[0]={...i[0],title:$.replace(/\s+/g," ").trim()});let I=new Map,te=ee({edits:{},reports:{},reportsDirectory:O});y=(await Z(i,{create:async(e,t,l,{lang:s})=>{let{directory:o}=await K(e,t,l,{blank:!0,lang:s});I.set(e,await v.readFile(E(o).html,"utf8"))},slugOf:(e,t)=>{if(t===0&&c!==void 0)return c;let l=S(e.title)||S(e.from?.replace(/\.[^.]+$/,"")??"")||S(r.replace(/\.[^.]+$/,""));return l?te.freeSlug(l):ae(O)},folderOf:e=>oe(e,O),fill:e=>M(e),place:(e,t)=>q(e,{parent:t})})).made;let P=[],A=(e,t)=>{P.push({page:e,depth:t});for(let l of e.children??[])A(l,t+1)};for(let e of i)A(e,0);let m=await Promise.all(P.map(async({page:e,depth:t},l)=>{let s=y[l],o=oe(s,O),a=E(o).html,k=await v.readFile(a,"utf8"),ne=(await M({source:I.get(s),nodes:e.nodes,icon:e.icon,own:e.own})).replace(/<p>\u{E000}\d+\u{E001}<\/p>/gu,""),le=X(W(k,{finish:U}).text);return{slug:s,depth:t,page:e,directory:o,htmlFile:a,made:fe(e,ne,k),readOnly:le}}));if(L={slug:y[0]},m.length===1){let[{page:e,directory:t,htmlFile:l,made:s,readOnly:o}]=m;if(console.log(`Created ${b(l)} and ${x.basename(E(t).json)} from ${r}`),console.log(`Title: ${e.title}`),console.log(`Made: ${s.length?s.join(", "):"nothing but the title"}${e.files.length?` (${j(e.files.length,"file")} in ${b(x.join(t,"assets"))})`:""}`),e.notes?.length){console.log(`Not brought as the file has it (${e.notes.length}):`);for(let a of e.notes)console.log(` ${a.line?`line ${a.line}: `:""}${a.text}`)}if(o.length){console.log(`Text the preview leaves read-only (${o.length}), by doc.html's lines as gallery check gives them:`);for(let a of o)console.log(` ${a}`)}}else{console.log(`Created ${j(m.length,"document")} from ${r} (each nested as in the file):`);for(let{slug:l,depth:s,page:o,htmlFile:a,made:k}of m)console.log(`${" ".repeat(s+1)}${l} ${o.title} ${b(a)}`),console.log(`${" ".repeat(s+2)}Made: ${k.length?k.join(", "):"nothing but the title"}${o.files.length?` (${j(o.files.length,"file")} in its assets/)`:""}`);let e=m.flatMap(({slug:l,page:s})=>(s.notes??[]).map(o=>` ${l}: ${o.line?`line ${o.line}: `:""}${o.text}`));e.length&&console.log(`Not brought as the file has it (${e.length}):
|
|
3
|
-
${e.join(`
|
|
4
|
-
`)}`);let t=m.flatMap(({slug:l,readOnly:s})=>s.map(o=>` ${l}: ${o}`));t.length&&console.log(`Text the preview leaves read-only (${t.length}), by doc.html's lines as gallery check gives them:
|
|
5
|
-
${t.join(`
|
|
6
|
-
`)}`)}u.length&&console.log(`Not taken from ${r} (${u.length}): ${u.join(", ")}`);for(let e of await J())console.log(e);R=`edit ${b(m[0].htmlFile)}${m.length>1?" (and the others)":""} into the document as \u5199\u4F5C\u504F\u597D asks.`}finally{await v.rm(F,{recursive:!0,force:!0})}let N=await G(L.slug,{skipped:B(p),command:`gallery import ${r}`});console.log(_(N,R)),console.log(`Hand in: gallery export ${y.join(" ")}, then gallery qa ${y.join(" ")}`);let D=await z(N,p);D&&console.log(D);for(let i of N)console.log(i)}export{Se as run};
|