@dooc-dev/dooc 0.0.6 → 0.0.8
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/dist/client.global.js +1 -0
- package/dist/code-worker.global.js +11 -11
- package/dist/code.global.js +75 -75
- package/dist/edit.global.js +234 -231
- package/dist/{compiler → engine/compiler}/bundle-urls.js +1 -4
- package/dist/{compiler → engine/compiler}/check-prose.d.ts +1 -1
- package/dist/{compiler → engine/compiler}/check-prose.js +1 -1
- package/dist/{compiler → engine/compiler}/check.js +15 -27
- package/dist/{compiler → engine/compiler}/code-blocks.js +3 -1
- package/dist/{compiler → engine/compiler}/code-languages.js +1 -2
- package/dist/{compiler → engine/compiler}/compile.d.ts +5 -4
- package/dist/{compiler → engine/compiler}/compile.js +91 -32
- package/dist/{compiler → engine/compiler}/config.js +1 -3
- package/dist/{compiler → engine/compiler}/dialect.d.ts +1 -3
- package/dist/{compiler → engine/compiler}/dialect.js +8 -52
- package/dist/{compiler → engine/compiler}/dxf.js +1 -1
- package/dist/{compiler → engine/compiler}/export.js +15 -8
- package/dist/{compiler → engine/compiler}/figures.js +26 -22
- package/dist/{compiler → engine/compiler}/file-cache.d.ts +1 -2
- package/dist/{compiler → engine/compiler}/file-cache.js +8 -15
- package/dist/{compiler → engine/compiler}/files.js +49 -38
- package/dist/{compiler → engine/compiler}/fonts.js +1 -3
- package/dist/{compiler → engine/compiler}/from-mdast.js +1 -1
- package/dist/engine/compiler/host.d.ts +10 -0
- package/dist/engine/compiler/host.js +16 -0
- package/dist/{compiler → engine/compiler}/icons.d.ts +3 -0
- package/dist/{compiler → engine/compiler}/icons.js +28 -10
- package/dist/{compiler → engine/compiler}/ignored-files.d.ts +2 -0
- package/dist/{compiler → engine/compiler}/ignored-files.js +12 -3
- package/dist/{compiler → engine/compiler}/locales.js +2 -8
- package/dist/{compiler → engine/compiler}/manifest.d.ts +3 -2
- package/dist/engine/compiler/manifest.js +46 -0
- package/dist/{compiler → engine/compiler}/ops.d.ts +4 -1
- package/dist/{compiler → engine/compiler}/ops.js +36 -21
- package/dist/engine/compiler/schema-file-references.d.ts +2 -0
- package/dist/engine/compiler/schema-file-references.js +82 -0
- package/dist/engine/compiler/serialize.d.ts +2 -0
- package/dist/engine/compiler/serialize.js +5 -0
- package/dist/{compiler → engine/compiler}/subformat-schema.js +1 -3
- package/dist/{compiler → engine/compiler}/subformats.d.ts +10 -0
- package/dist/{compiler → engine/compiler}/subformats.js +122 -18
- package/dist/{compiler → engine/compiler}/textfile-remote.js +1 -2
- package/dist/{compiler → engine/compiler}/textfile.js +4 -6
- package/dist/{compiler → engine/compiler}/theme-variants.js +1 -1
- package/dist/{compiler → engine/compiler}/zip.js +1 -1
- package/dist/{core → engine/core}/blocks.d.ts +6 -4
- package/dist/{core → engine/core}/content-metadata.d.ts +6 -1
- package/dist/{core → engine/core}/content-metadata.js +84 -18
- package/dist/{core → engine/core}/content-types.d.ts +4 -2
- package/dist/{core → engine/core}/html.d.ts +7 -0
- package/dist/{core → engine/core}/html.js +44 -3
- package/dist/{core → engine/core}/icons.d.ts +3 -0
- package/dist/engine/core/icons.js +20 -0
- package/dist/{core → engine/core}/routing.d.ts +2 -0
- package/dist/{core → engine/core}/routing.js +9 -0
- package/dist/{core → engine/core}/schema-refs.d.ts +1 -1
- package/dist/{core → engine/core}/schema-refs.js +3 -1
- package/dist/engine/core/subformat-references.d.ts +5 -0
- package/dist/engine/core/subformat-references.js +33 -0
- package/dist/{core → engine/core}/subformats.d.ts +7 -0
- package/dist/{core → engine/core}/subformats.js +5 -1
- package/dist/{core → engine/core}/taxonomy.d.ts +2 -3
- package/dist/{core → engine/core}/taxonomy.js +1 -5
- package/dist/flow.global.js +1031 -1057
- package/dist/frontend/application-request.d.ts +14 -0
- package/dist/frontend/application-request.js +36 -0
- package/dist/frontend/document-application.d.ts +200 -0
- package/dist/{viewer/serve.js → frontend/document-application.js} +1611 -1670
- package/dist/frontend/figure-preview.d.ts +4 -0
- package/dist/{viewer → frontend}/figure-preview.js +4 -4
- package/dist/{viewer → frontend}/file-references.d.ts +1 -1
- package/dist/{viewer → frontend}/file-references.js +3 -3
- package/dist/{viewer → frontend}/font-picker.d.ts +1 -1
- package/dist/{viewer → frontend}/font-settings.d.ts +1 -1
- package/dist/{viewer → frontend}/language-picker.js +112 -18
- package/dist/{viewer → frontend}/locales/eng.json +16 -2
- package/dist/{viewer → frontend}/locales/jpn.json +16 -2
- package/dist/{viewer → frontend}/locales/zho.json +16 -2
- package/dist/{viewer → frontend}/nav-focus.js +2 -0
- package/dist/{viewer → frontend}/plugin-blocks.js +2 -2
- package/dist/{viewer → frontend}/resize.js +14 -2
- package/dist/frontend/resource-download.d.ts +2 -0
- package/dist/frontend/resource-download.js +43 -0
- package/dist/{viewer → frontend}/resource-library.d.ts +9 -2
- package/dist/{viewer → frontend}/resource-library.js +133 -37
- package/dist/{core → frontend}/schema-graph-flow.d.ts +1 -1
- package/dist/{core → frontend}/schema-graph-flow.js +1 -1
- package/dist/{viewer → frontend}/search.d.ts +2 -2
- package/dist/{viewer → frontend}/search.js +26 -8
- package/dist/graph/{abnfDiagram-S7VZAUFO-ASBULSKE.js → abnfDiagram-S7VZAUFO-GAGCW2J5.js} +1 -1
- package/dist/graph/{architecture-WOLXFQ4H-V57EDXXY.js → architecture-WOLXFQ4H-AWAC3VBS.js} +1 -1
- package/dist/graph/{architectureDiagram-YGSQEFNW-GIMP347N.js → architectureDiagram-YGSQEFNW-WQ7QKSUJ.js} +1 -1
- package/dist/graph/{blockDiagram-APKKGZFW-RDL2T4JW.js → blockDiagram-APKKGZFW-H7ZNJMOM.js} +1 -1
- package/dist/graph/{bpmnIcons-APHXDYXF-TWOSQNUQ.js → bpmnIcons-APHXDYXF-EAVPNTFE.js} +1 -1
- package/dist/graph/{c4Diagram-KJ2TOQU5-75LIUC4F.js → c4Diagram-KJ2TOQU5-3IYS34YL.js} +1 -1
- package/dist/graph/{chunk-KU6GTEMS.js → chunk-3CJU2RDX.js} +1 -1
- package/dist/graph/{chunk-ISO77HML.js → chunk-5N2X2DXU.js} +1 -1
- package/dist/graph/{chunk-YCRLJT2S.js → chunk-67BPVAXC.js} +1 -1
- package/dist/graph/{chunk-26TUJSYJ.js → chunk-6CDZONCA.js} +1 -1
- package/dist/graph/{chunk-I3DMZIHV.js → chunk-7ASYMKN2.js} +1 -1
- package/dist/graph/{chunk-K2KLZU7M.js → chunk-7JQUFVT4.js} +2 -2
- package/dist/graph/{chunk-BBD5CEDC.js → chunk-7LSMJ4VU.js} +1 -1
- package/dist/graph/{chunk-EG5UVNOC.js → chunk-7UKJADAE.js} +1 -1
- package/dist/graph/{chunk-BZAMCJ6B.js → chunk-AARGNXTW.js} +1 -1
- package/dist/graph/{chunk-HOPPTA6H.js → chunk-BOXAA5AP.js} +2 -2
- package/dist/graph/{chunk-N3OHKGRZ.js → chunk-BTMPKSGF.js} +1 -1
- package/dist/graph/{chunk-QCJUF4YA.js → chunk-DIDARDST.js} +1 -1
- package/dist/graph/{chunk-R63JUMUK.js → chunk-EWYECPNJ.js} +1 -1
- package/dist/graph/{chunk-3YJHMOOA.js → chunk-FD7ZFC7R.js} +1 -1
- package/dist/graph/chunk-GWYODWCE.js +1 -0
- package/dist/graph/{chunk-IC23EEF6.js → chunk-HKRJKXEE.js} +1 -1
- package/dist/graph/{chunk-PW2RGZ3O.js → chunk-I5LEUF24.js} +1 -1
- package/dist/graph/{chunk-OFZLK5G4.js → chunk-ICJPOOXG.js} +1 -1
- package/dist/graph/{chunk-KT4VPQD5.js → chunk-IVZHB6RS.js} +2 -2
- package/dist/graph/{chunk-VM2H7G2R.js → chunk-JZGXHT3J.js} +1 -1
- package/dist/graph/{chunk-HJG2HUYJ.js → chunk-LSRL537V.js} +1 -1
- package/dist/graph/{chunk-C6J4A356.js → chunk-N44XPVUD.js} +1 -1
- package/dist/graph/{chunk-JD7ZBJD2.js → chunk-NDAMZVXQ.js} +1 -1
- package/dist/graph/{chunk-QEEA3KYY.js → chunk-QLS7NIYR.js} +1 -1
- package/dist/graph/{chunk-JRSH5GNS.js → chunk-QQIGL7OP.js} +1 -1
- package/dist/graph/chunk-SQE76S5B.js +1 -0
- package/dist/graph/{chunk-ZMCB7VP2.js → chunk-WQHTQAFY.js} +1 -1
- package/dist/graph/{classDiagram-v2-L25IHNXF-JL7LVDZH.js → classDiagram-v2-L25IHNXF-HNTCDTNK.js} +1 -1
- package/dist/graph/{cose-bilkent-JH36ORCC-PNM3EYPB.js → cose-bilkent-JH36ORCC-2GVA7XKO.js} +1 -1
- package/dist/graph/{cynefin-EF2NZ3EQ-PSXP3DXL.js → cynefin-EF2NZ3EQ-TCI65RAQ.js} +1 -1
- package/dist/graph/{cynefinDiagram-L36ESFBY-QVY54CXO.js → cynefinDiagram-L36ESFBY-OKQ5BLVF.js} +1 -1
- package/dist/graph/{dagre-SPEB5RXH-HPGQXBZJ.js → dagre-SPEB5RXH-KZEBD52K.js} +1 -1
- package/dist/graph/{diagram-3B7GL73J-DWH5WS2P.js → diagram-3B7GL73J-ESCBJM3O.js} +1 -1
- package/dist/graph/{diagram-DNEMPZML-TEGH2U5I.js → diagram-DNEMPZML-ZIBUSQZI.js} +1 -1
- package/dist/graph/{diagram-L3MUGCDN-X4MREUWR.js → diagram-L3MUGCDN-IGK62IPN.js} +1 -1
- package/dist/graph/{diagram-LA4NIPWU-NXT746HG.js → diagram-LA4NIPWU-2KZCOFJ5.js} +1 -1
- package/dist/graph/{diagram-MHCOC4E2-JGHXSAGS.js → diagram-MHCOC4E2-EYAAB236.js} +1 -1
- package/dist/graph/{diagram-XPFHEONP-ZHZPBLT4.js → diagram-XPFHEONP-OZ5ARGMG.js} +1 -1
- package/dist/graph/{ebnfDiagram-UZSYDL2S-SMF6KJ43.js → ebnfDiagram-UZSYDL2S-M3XJHARD.js} +1 -1
- package/dist/graph/{erDiagram-EYBAPDEH-B3JNJ357.js → erDiagram-EYBAPDEH-Y7KUBH7A.js} +1 -1
- package/dist/graph/{eventmodeling-K75KTNOO-WG6DDYMC.js → eventmodeling-K75KTNOO-ROLYRDEP.js} +1 -1
- package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
- package/dist/graph/{ganttDiagram-23REXITY-YXBYWFOJ.js → ganttDiagram-23REXITY-JSBTFSSJ.js} +1 -1
- package/dist/graph/{gitGraph-VSP46ZUC-VBFWJBBT.js → gitGraph-VSP46ZUC-ZCBCDVNF.js} +1 -1
- package/dist/graph/{gitGraphDiagram-STJD7YCW-4FZDCFGV.js → gitGraphDiagram-STJD7YCW-3ZA5FT3G.js} +1 -1
- package/dist/graph/{info-OHQRW6UA-ALVDUVYV.js → info-OHQRW6UA-JKJGOQNY.js} +1 -1
- package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
- package/dist/graph/{ishikawaDiagram-M35NCXHK-FRZD2PWQ.js → ishikawaDiagram-M35NCXHK-YLEU44DY.js} +1 -1
- package/dist/graph/{journeyDiagram-OPLOXDXO-7Z66JCPR.js → journeyDiagram-OPLOXDXO-ZHJV66ZT.js} +1 -1
- package/dist/graph/{kanban-definition-BZKZHSQY-NN5AIKTE.js → kanban-definition-BZKZHSQY-SDU25WUM.js} +1 -1
- package/dist/graph/{katex-DXDNVO6V.js → katex-WSLZOTY7.js} +1 -1
- package/dist/graph/{mindmap-definition-I2QAS2VK-HDPCABN2.js → mindmap-definition-I2QAS2VK-XQNBCYHN.js} +1 -1
- package/dist/graph/{packet-JDAUHWVQ-5MQIBWAH.js → packet-JDAUHWVQ-Y3H77ERD.js} +1 -1
- package/dist/graph/{pegDiagram-FD4XPPHP-H2BFNCKT.js → pegDiagram-FD4XPPHP-YO4VWH6V.js} +1 -1
- package/dist/graph/{pie-XZMESJXO-T5VRKHVT.js → pie-XZMESJXO-PRER4XL5.js} +1 -1
- package/dist/graph/{pieDiagram-J4AKIIQI-O3NJSVD3.js → pieDiagram-J4AKIIQI-TJ5WOOSV.js} +1 -1
- package/dist/graph/{quadrantDiagram-XTYBLID2-TMTZJI3P.js → quadrantDiagram-XTYBLID2-G6MSSZLW.js} +1 -1
- package/dist/graph/{radar-ABXABTNO-C6FXIBYW.js → radar-ABXABTNO-M6MV34GM.js} +1 -1
- package/dist/graph/{railroad-I3PHUGI6-ZSO5JXB3.js → railroad-I3PHUGI6-YIWPGN6Q.js} +1 -1
- package/dist/graph/{railroad-abnf-LNEFI6M7-CI4GQRHB.js → railroad-abnf-LNEFI6M7-7JHLZ2R7.js} +1 -1
- package/dist/graph/{railroad-ebnf-DWYD2UWJ-MUENNCGK.js → railroad-ebnf-DWYD2UWJ-V55BXEWY.js} +1 -1
- package/dist/graph/{railroad-peg-JR7BVNR7-N3X5GGIX.js → railroad-peg-JR7BVNR7-XCGKDRMK.js} +1 -1
- package/dist/graph/{railroadDiagram-MRQ6NCDL-JHWS23UO.js → railroadDiagram-MRQ6NCDL-RACSFXC4.js} +1 -1
- package/dist/graph/{requirementDiagram-Y7LWUY3S-7DVLPO4B.js → requirementDiagram-Y7LWUY3S-4LQIQWHQ.js} +1 -1
- package/dist/graph/{sankeyDiagram-WGJFYUXA-Z5L4R5TR.js → sankeyDiagram-WGJFYUXA-K3RXG5FB.js} +1 -1
- package/dist/graph/schema-graph-global.js +17 -17
- package/dist/graph/{sequenceDiagram-5NDRBG5M-RCTU25NT.js → sequenceDiagram-5NDRBG5M-Y6RBHRS3.js} +1 -1
- package/dist/graph/{sizeCapture-INFHLROL-RROY32P5.js → sizeCapture-INFHLROL-TJW3VUGH.js} +1 -1
- package/dist/graph/{stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js → stateDiagram-v2-FJ4FJNEA-4M5WZORG.js} +1 -1
- package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
- package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
- package/dist/graph/{timeline-definition-SEUHKTQE-ZQSMIVAS.js → timeline-definition-SEUHKTQE-IHISQ4Q7.js} +1 -1
- package/dist/graph/{treeView-D4JQ5SDB-42S7U73N.js → treeView-D4JQ5SDB-EVGY4VYS.js} +1 -1
- package/dist/graph/{treemap-SAJKECNS-RUBYQ7XF.js → treemap-SAJKECNS-LN3SMFRX.js} +1 -1
- package/dist/graph/{usecaseDiagram-AFA6YXN4-57RDRYXF.js → usecaseDiagram-AFA6YXN4-B645A3J6.js} +1 -1
- package/dist/graph/{vennDiagram-NNMJR3RB-5C3LVAV6.js → vennDiagram-NNMJR3RB-K3HWMON6.js} +1 -1
- package/dist/graph/{wardley-7MLQ67FV-NV5HXTTC.js → wardley-7MLQ67FV-RRWOELC6.js} +1 -1
- package/dist/graph/{wardleyDiagram-S7YFUSEH-6D5BKXHM.js → wardleyDiagram-S7YFUSEH-DMMWKJEK.js} +1 -1
- package/dist/graph/{xychartDiagram-GGNKY7IX-6ET3ZM67.js → xychartDiagram-GGNKY7IX-K6MUQVXR.js} +1 -1
- package/dist/install.sh +68 -0
- package/dist/plugins.global.js +62 -62
- package/dist/{viewer → server}/assets.d.ts +2 -0
- package/dist/server/assets.js +7 -0
- package/dist/{viewer → server}/build-plugins.js +4 -4
- package/dist/{viewer → server}/build.d.ts +2 -1
- package/dist/{viewer → server}/build.js +31 -15
- package/dist/{cli.js → server/cli.js} +223 -56
- package/dist/server/editor-tools.d.ts +1 -0
- package/dist/server/editor-tools.js +1 -0
- package/dist/{viewer → server}/extension-pack.js +2 -2
- package/dist/{viewer → server}/extensions.d.ts +1 -1
- package/dist/{viewer → server}/extensions.js +3 -3
- package/dist/server/git-diff.d.ts +10 -0
- package/dist/{viewer → server}/git-diff.js +45 -10
- package/dist/server/git-origin.d.ts +4 -0
- package/dist/server/git-origin.js +103 -0
- package/dist/server/git.d.ts +9 -0
- package/dist/{viewer → server}/git.js +50 -6
- package/dist/server/history.d.ts +14 -0
- package/dist/server/history.js +205 -0
- package/dist/{viewer → server}/hmr.d.ts +0 -22
- package/dist/server/hmr.js +168 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/{index.js → server/index.js} +16 -16
- package/dist/{viewer → server}/ja-lint.d.ts +1 -1
- package/dist/{viewer → server}/languages.d.ts +1 -1
- package/dist/{viewer → server}/languages.js +3 -3
- package/dist/{mcp.d.ts → server/mcp.d.ts} +2 -2
- package/dist/{mcp.js → server/mcp.js} +60 -21
- package/dist/{viewer → server}/plugin-config.d.ts +2 -2
- package/dist/{viewer → server}/plugin-config.js +2 -2
- package/dist/{plugins → server/plugins}/local-storage.d.ts +1 -1
- package/dist/{plugins → server/plugins}/local-storage.js +1 -1
- package/dist/{plugins → server/plugins}/runtime.d.ts +4 -4
- package/dist/{plugins → server/plugins}/runtime.js +4 -4
- package/dist/{viewer → server}/plugins.d.ts +3 -3
- package/dist/{viewer → server}/plugins.js +14 -13
- package/dist/server/resource-library.d.ts +1 -0
- package/dist/server/resource-library.js +1 -0
- package/dist/server/self.d.ts +5 -0
- package/dist/server/self.js +98 -0
- package/dist/server/serve.d.ts +61 -0
- package/dist/server/serve.js +503 -0
- package/dist/server/static-client.d.ts +4 -0
- package/dist/server/static-client.js +117 -0
- package/dist/server/workspace-server.d.ts +16 -0
- package/dist/server/workspace-server.js +266 -0
- package/dist/{viewer → server}/workspace.d.ts +6 -1
- package/dist/{viewer → server}/workspace.js +46 -0
- package/dist/subformats.global.js +92 -6
- package/dist/ui.global.js +85 -72
- package/dist/workspace/client.d.ts +13 -0
- package/dist/workspace/client.js +114 -0
- package/dist/{viewer → workspace}/code-file.d.ts +1 -1
- package/dist/{viewer → workspace}/code-file.js +7 -7
- package/dist/workspace/connection.d.ts +27 -0
- package/dist/workspace/connection.js +38 -0
- package/dist/{viewer → workspace}/editor-tools.d.ts +7 -1
- package/dist/{viewer → workspace}/editor-tools.js +12 -9
- package/dist/{viewer → workspace}/git-types.d.ts +7 -0
- package/dist/workspace/github.d.ts +4 -0
- package/dist/workspace/github.js +99 -0
- package/dist/workspace/history.d.ts +46 -0
- package/dist/workspace/history.js +86 -0
- package/dist/workspace/protocol.d.ts +38 -0
- package/dist/workspace/protocol.js +20 -0
- package/dist/workspace/resource-download.d.ts +1 -0
- package/dist/workspace/resource-download.js +8 -0
- package/dist/workspace/server.d.ts +9 -0
- package/dist/workspace/server.js +48 -0
- package/dist/{viewer → workspace}/site-icon.js +9 -10
- package/dist/{viewer → workspace}/site-title.js +6 -7
- package/dist/{viewer → workspace}/textfile.d.ts +1 -1
- package/dist/{viewer → workspace}/textfile.js +5 -5
- package/dist/workspace-worker.global.js +2859 -0
- package/package.json +43 -21
- package/dist/compiler/manifest.js +0 -37
- package/dist/compiler/serialize.d.ts +0 -3
- package/dist/compiler/serialize.js +0 -16
- package/dist/core/icons.js +0 -5
- package/dist/graph/chunk-3RNHDNP5.js +0 -1
- package/dist/graph/chunk-5UUEAHTN.js +0 -1
- package/dist/graph/chunk-6T55RVVR.js +0 -1
- package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +0 -27
- package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +0 -1
- package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +0 -2
- package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +0 -1
- package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +0 -8
- package/dist/index.d.ts +0 -17
- package/dist/viewer/assets.js +0 -3
- package/dist/viewer/figure-preview.d.ts +0 -4
- package/dist/viewer/git-diff.d.ts +0 -6
- package/dist/viewer/git.d.ts +0 -5
- package/dist/viewer/hmr.js +0 -341
- package/dist/viewer/serve.d.ts +0 -216
- /package/dist/{compiler → engine/compiler}/asset-references.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/asset-references.js +0 -0
- /package/dist/{compiler → engine/compiler}/bundle-urls.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/check-types.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/check-types.js +0 -0
- /package/dist/{compiler → engine/compiler}/check.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/code-blocks.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/code-languages.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/config.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/drawio.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/drawio.js +0 -0
- /package/dist/{compiler → engine/compiler}/dxf.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/export.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/figures.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/files.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/fonts.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/format.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/format.js +0 -0
- /package/dist/{compiler → engine/compiler}/from-mdast.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/language-codes.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/language-codes.js +0 -0
- /package/dist/{compiler → engine/compiler}/locales.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/public-file.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/public-file.js +0 -0
- /package/dist/{compiler → engine/compiler}/subformat-schema.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/terms.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/terms.js +0 -0
- /package/dist/{compiler → engine/compiler}/textfile-remote.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/textfile.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/theme-variants.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/zip.d.ts +0 -0
- /package/dist/{core → engine/core}/blocks.js +0 -0
- /package/dist/{core → engine/core}/code-file.d.ts +0 -0
- /package/dist/{core → engine/core}/code-file.js +0 -0
- /package/dist/{core → engine/core}/code-grammars.d.ts +0 -0
- /package/dist/{core → engine/core}/code-grammars.js +0 -0
- /package/dist/{core → engine/core}/content-types.js +0 -0
- /package/dist/{core → engine/core}/escape-html.d.ts +0 -0
- /package/dist/{core → engine/core}/escape-html.js +0 -0
- /package/dist/{core → engine/core}/extension-package.d.ts +0 -0
- /package/dist/{core → engine/core}/extension-package.js +0 -0
- /package/dist/{core → engine/core}/figure-frame.d.ts +0 -0
- /package/dist/{core → engine/core}/figure-frame.js +0 -0
- /package/dist/{core → engine/core}/file-embed.d.ts +0 -0
- /package/dist/{core → engine/core}/file-embed.js +0 -0
- /package/dist/{core → engine/core}/files.d.ts +0 -0
- /package/dist/{core → engine/core}/files.js +0 -0
- /package/dist/{core → engine/core}/graph-common.d.ts +0 -0
- /package/dist/{core → engine/core}/graph-common.js +0 -0
- /package/dist/{core → engine/core}/graph.d.ts +0 -0
- /package/dist/{core → engine/core}/graph.js +0 -0
- /package/dist/{core → engine/core}/inline.d.ts +0 -0
- /package/dist/{core → engine/core}/inline.js +0 -0
- /package/dist/{core → engine/core}/json-tools.d.ts +0 -0
- /package/dist/{core → engine/core}/json-tools.js +0 -0
- /package/dist/{core → engine/core}/language.d.ts +0 -0
- /package/dist/{core → engine/core}/language.js +0 -0
- /package/dist/{core → engine/core}/languages/ja.d.ts +0 -0
- /package/dist/{core → engine/core}/languages/ja.js +0 -0
- /package/dist/{core → engine/core}/markdown.d.ts +0 -0
- /package/dist/{core → engine/core}/markdown.js +0 -0
- /package/dist/{core → engine/core}/previewers.d.ts +0 -0
- /package/dist/{core → engine/core}/previewers.js +0 -0
- /package/dist/{core → engine/core}/schema-comments.d.ts +0 -0
- /package/dist/{core → engine/core}/schema-comments.js +0 -0
- /package/dist/{core → engine/core}/schema-fields.d.ts +0 -0
- /package/dist/{core → engine/core}/schema-fields.js +0 -0
- /package/dist/{core → engine/core}/schema-graph.d.ts +0 -0
- /package/dist/{core → engine/core}/schema-graph.js +0 -0
- /package/dist/{core → engine/core}/subformat-record.d.ts +0 -0
- /package/dist/{core → engine/core}/subformat-record.js +0 -0
- /package/dist/{core → engine/core}/term-reference.d.ts +0 -0
- /package/dist/{core → engine/core}/term-reference.js +0 -0
- /package/dist/{core → engine/core}/textfile.d.ts +0 -0
- /package/dist/{core → engine/core}/textfile.js +0 -0
- /package/dist/{core → engine/core}/theme-variants.d.ts +0 -0
- /package/dist/{core → engine/core}/theme-variants.js +0 -0
- /package/dist/{core → engine/core}/workspace.d.ts +0 -0
- /package/dist/{core → engine/core}/workspace.js +0 -0
- /package/dist/{viewer → frontend}/bundle-network.d.ts +0 -0
- /package/dist/{viewer → frontend}/bundle-network.js +0 -0
- /package/dist/{core → frontend}/flow-base-css.generated.d.ts +0 -0
- /package/dist/{core → frontend}/flow-base-css.generated.js +0 -0
- /package/dist/{core → frontend}/flow-css.d.ts +0 -0
- /package/dist/{core → frontend}/flow-css.js +0 -0
- /package/dist/{viewer → frontend}/font-picker.js +0 -0
- /package/dist/{viewer → frontend}/font-settings.js +0 -0
- /package/dist/{viewer → frontend}/i18n.d.ts +0 -0
- /package/dist/{viewer → frontend}/i18n.js +0 -0
- /package/dist/{viewer → frontend}/language-picker.d.ts +0 -0
- /package/dist/{viewer → frontend}/lazy-preview.d.ts +0 -0
- /package/dist/{viewer → frontend}/lazy-preview.js +0 -0
- /package/dist/{viewer → frontend}/nav-focus.d.ts +0 -0
- /package/dist/{viewer → frontend}/nav-update.d.ts +0 -0
- /package/dist/{viewer → frontend}/nav-update.js +0 -0
- /package/dist/{viewer → frontend}/plugin-blocks.d.ts +0 -0
- /package/dist/{viewer → frontend}/plugin-style.d.ts +0 -0
- /package/dist/{viewer → frontend}/plugin-style.js +0 -0
- /package/dist/{viewer → frontend}/plugin-view.d.ts +0 -0
- /package/dist/{viewer → frontend}/plugin-view.js +0 -0
- /package/dist/{viewer → frontend}/resize.d.ts +0 -0
- /package/dist/{core → frontend}/schema-graph-mount.d.ts +0 -0
- /package/dist/{core → frontend}/schema-graph-mount.js +0 -0
- /package/dist/{core → frontend}/table-ui.d.ts +0 -0
- /package/dist/{core → frontend}/table-ui.js +0 -0
- /package/dist/{core → frontend}/terms-ui.d.ts +0 -0
- /package/dist/{core → frontend}/terms-ui.js +0 -0
- /package/dist/{viewer → frontend}/theme-picker.d.ts +0 -0
- /package/dist/{viewer → frontend}/theme-picker.js +0 -0
- /package/dist/{core → frontend}/toc-ui.d.ts +0 -0
- /package/dist/{core → frontend}/toc-ui.js +0 -0
- /package/dist/{core → frontend}/video-ui.d.ts +0 -0
- /package/dist/{core → frontend}/video-ui.js +0 -0
- /package/dist/graph/{chunk-GYT4IYBZ.js → chunk-RJFVWYCA.js} +0 -0
- /package/dist/{viewer → server}/build-plugins.d.ts +0 -0
- /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
- /package/dist/{viewer → server}/extension-pack.d.ts +0 -0
- /package/dist/{viewer → server}/fonts/LICENSE.txt +0 -0
- /package/dist/{viewer → server}/fonts/udev-gothic-regular.woff2 +0 -0
- /package/dist/{viewer → server}/fonts.d.ts +0 -0
- /package/dist/{viewer → server}/fonts.js +0 -0
- /package/dist/{viewer → server}/ja-lint.js +0 -0
- /package/dist/{viewer → workspace}/git-types.js +0 -0
- /package/dist/{viewer → workspace}/site-icon.d.ts +0 -0
- /package/dist/{viewer → workspace}/site-title.d.ts +0 -0
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { basename, extname } from "node:path";
|
|
2
1
|
import { bundledLanguagesInfo } from "shiki/langs";
|
|
3
2
|
import { visit } from "unist-util-visit";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
3
|
+
import { parseContentSource } from "../engine/compiler/code-blocks.js";
|
|
4
|
+
import { basename, extname } from "../engine/compiler/host.js";
|
|
5
|
+
import { readManifest } from "../engine/compiler/manifest.js";
|
|
6
|
+
import { loadSubformat, parseSubformatRecord, subformatIconSvg, subformatRelations, validateSubformatRecord, } from "../engine/compiler/subformats.js";
|
|
7
|
+
import { parseTermSource } from "../engine/compiler/terms.js";
|
|
8
|
+
import { readTextfile, selectTextfileRange } from "../engine/compiler/textfile.js";
|
|
9
|
+
import { flattenTree } from "../engine/core/content-metadata.js";
|
|
10
|
+
import { parseFileEmbed } from "../engine/core/file-embed.js";
|
|
11
|
+
import { fileExtension } from "../engine/core/files.js";
|
|
12
|
+
import { blocksHtml, escapeHtml } from "../engine/core/html.js";
|
|
13
|
+
import { libraryIcon, SEARCH_ICON_PATH } from "../engine/core/icons.js";
|
|
14
|
+
import { termComparator } from "../engine/core/language.js";
|
|
15
|
+
import { parseMdast } from "../engine/core/markdown.js";
|
|
16
|
+
import { subformatReferences } from "../engine/core/subformat-references.js";
|
|
17
|
+
import { subformatChange } from "../engine/core/subformats.js";
|
|
18
|
+
import { CODE_TEMPLATES } from "../engine/core/taxonomy.js";
|
|
19
|
+
import { parseTextfileRange } from "../engine/core/textfile.js";
|
|
15
20
|
const codeFormat = (language) => /^(text|txt|plain|plaintext)$/.test(language)
|
|
16
21
|
? "text"
|
|
17
22
|
: (bundledLanguagesInfo.find((entry) => entry.id === language || entry.aliases?.includes(language))?.id ?? language);
|
|
@@ -34,8 +39,16 @@ export const resourceIndex = (root, files, domains = []) => {
|
|
|
34
39
|
throw new Error("Schema is not available in the workspace");
|
|
35
40
|
const loaded = loadSubformat(root, config, domains);
|
|
36
41
|
formats.set(config.ext, loaded);
|
|
42
|
+
let iconSvg;
|
|
43
|
+
try {
|
|
44
|
+
iconSvg = subformatIconSvg(root, config);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// The subformat page reports a broken icon; listings fall back to the default.
|
|
48
|
+
}
|
|
37
49
|
result.subformats.push({
|
|
38
50
|
...config,
|
|
51
|
+
...(iconSvg ? { iconSvg } : {}),
|
|
39
52
|
fields: loaded.fields,
|
|
40
53
|
template: loaded.template,
|
|
41
54
|
defaultFolder: manifest.defaultSubformatFolder,
|
|
@@ -46,6 +59,7 @@ export const resourceIndex = (root, files, domains = []) => {
|
|
|
46
59
|
result.errors.push(`${config.schema}: ${error instanceof Error ? error.message : String(error)}`);
|
|
47
60
|
}
|
|
48
61
|
}
|
|
62
|
+
result.relations = subformatRelations(root, result.subformats, domains);
|
|
49
63
|
const urls = new Map();
|
|
50
64
|
const urlPreviews = new Map();
|
|
51
65
|
const references = new Map();
|
|
@@ -83,19 +97,6 @@ export const resourceIndex = (root, files, domains = []) => {
|
|
|
83
97
|
: undefined;
|
|
84
98
|
if (!target)
|
|
85
99
|
return;
|
|
86
|
-
if (!/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(target)) {
|
|
87
|
-
try {
|
|
88
|
-
const file = parseFileReference(target).file.replace(/^(\.\/)+/, "");
|
|
89
|
-
if (localFile(file) && formats.has(fileExtension(file))) {
|
|
90
|
-
const sources = references.get(file) ?? [];
|
|
91
|
-
sources.push(source);
|
|
92
|
-
references.set(file, sources);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
// Invalid references are reported by the compiler.
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
100
|
const preview = node.type === "image" || node.type === "imageReference";
|
|
100
101
|
if (preview && !/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(target)) {
|
|
101
102
|
try {
|
|
@@ -181,8 +182,39 @@ export const resourceIndex = (root, files, domains = []) => {
|
|
|
181
182
|
});
|
|
182
183
|
validateTerms(raw, source);
|
|
183
184
|
}
|
|
184
|
-
else
|
|
185
|
-
|
|
185
|
+
else {
|
|
186
|
+
const tree = parseMdast(raw);
|
|
187
|
+
scan(tree, file);
|
|
188
|
+
for (const ref of subformatReferences(tree)) {
|
|
189
|
+
if (!formats.has(fileExtension(ref.file)))
|
|
190
|
+
continue;
|
|
191
|
+
const sources = references.get(ref.file) ?? [];
|
|
192
|
+
sources.push({ file, line: ref.line });
|
|
193
|
+
references.set(ref.file, sources);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
result.errors.push(`${file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// A format with its own Library page lists every file of that type, like subformat records.
|
|
202
|
+
const listed = new Set(flattenTree(manifest.tree).flatMap((node) => node.library && node.library !== "termth" && Object.hasOwn(CODE_TEMPLATES, node.library)
|
|
203
|
+
? [node.library]
|
|
204
|
+
: []));
|
|
205
|
+
const embedded = new Set(result.codeblocks.map((item) => item.reference?.file));
|
|
206
|
+
for (const file of paths) {
|
|
207
|
+
const format = fileExtension(file);
|
|
208
|
+
if (!listed.has(format) || embedded.has(file))
|
|
209
|
+
continue;
|
|
210
|
+
try {
|
|
211
|
+
result.codeblocks.push({
|
|
212
|
+
language: format,
|
|
213
|
+
format,
|
|
214
|
+
caption: file,
|
|
215
|
+
content: readTextfile(root, file),
|
|
216
|
+
source: { file, line: 1 },
|
|
217
|
+
});
|
|
186
218
|
}
|
|
187
219
|
catch (error) {
|
|
188
220
|
result.errors.push(`${file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -202,10 +234,62 @@ export const resourceTabs = (view) => view === "files"
|
|
|
202
234
|
["urls", "URLs"],
|
|
203
235
|
["url-previews", "URL previews"],
|
|
204
236
|
]
|
|
205
|
-
.map(([key, label]) => `<a href="/
|
|
237
|
+
.map(([key, label]) => `<a href="/_library/${key}"${view === key ? ' aria-current="page"' : ""}>${libraryIcon(key) ?? ""}<span data-i18n="${label}">${label}</span></a>`)
|
|
206
238
|
.join("")}</nav>`;
|
|
207
239
|
const sourceLink = ({ file, line }) => `<a class="resource-source" href="/_files/file/${encodeURIComponent(file)}#L${line}" data-resource-source="${escapeHtml(file)}" data-resource-line="${line}" title="${escapeHtml(file)}:L${line}"><span class="resource-source-file">${escapeHtml(file)}</span><span>L${line}</span></a>`;
|
|
208
|
-
|
|
240
|
+
const codeItems = (codeblocks, page) => {
|
|
241
|
+
const terms = new Map();
|
|
242
|
+
const items = codeblocks.flatMap(({ language, format, caption, content, source, reference }) => {
|
|
243
|
+
const location = reference ?? source;
|
|
244
|
+
const parsed = page
|
|
245
|
+
? parseContentSource(language, content, `${location.file}#L${location.line}`)
|
|
246
|
+
: undefined;
|
|
247
|
+
const term = parsed?.blocks[0];
|
|
248
|
+
if (term?.type === "term" && !parsed?.errors.length) {
|
|
249
|
+
// Merge uses of the same definition, but keep distinct files and range contents.
|
|
250
|
+
const key = JSON.stringify([location.file, location.line, content]);
|
|
251
|
+
const item = terms.get(key) ?? {
|
|
252
|
+
entry: term.entry,
|
|
253
|
+
source: location,
|
|
254
|
+
references: new Map(),
|
|
255
|
+
};
|
|
256
|
+
if (source.file !== location.file || source.line !== location.line)
|
|
257
|
+
item.references.set(JSON.stringify(source), source);
|
|
258
|
+
terms.set(key, item);
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
const name = page
|
|
262
|
+
? caption !== source.file && caption !== reference?.file
|
|
263
|
+
? caption
|
|
264
|
+
: ""
|
|
265
|
+
: caption || (reference ? reference.file + (reference.range ?? "") : "");
|
|
266
|
+
const blocks = parsed && !parsed.errors.length && parsed.blocks.length
|
|
267
|
+
? parsed.blocks
|
|
268
|
+
: [
|
|
269
|
+
{
|
|
270
|
+
type: "code",
|
|
271
|
+
lang: language === "mermaid" ? "text" : language,
|
|
272
|
+
lines: content.split("\n"),
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
const errors = parsed?.errors.length
|
|
276
|
+
? `<ul class="resource-errors">${parsed.errors.map((error) => `<li>${escapeHtml(error.message)}</li>`).join("")}</ul>`
|
|
277
|
+
: "";
|
|
278
|
+
return [
|
|
279
|
+
`<details class="resource-item resource-code"${page ? " open" : ""} data-resource-item data-resource-group="${escapeHtml(format)}"><summary>${page ? "" : `${libraryIcon(format) ?? ""}<span class="resource-badge">${escapeHtml(format)}</span>`}${name ? `<span class="resource-name" title="${escapeHtml(name)}">${escapeHtml(name)}</span>` : ""}${sourceLink(source)}</summary><div class="resource-body">${reference ? `<div class="resource-sources">${sourceLink(reference)}</div>` : ""}${errors}${blocksHtml(blocks)}</div></details>`,
|
|
280
|
+
];
|
|
281
|
+
});
|
|
282
|
+
const compare = termComparator(undefined);
|
|
283
|
+
return [
|
|
284
|
+
...[...terms.values()]
|
|
285
|
+
.sort((a, b) => compare(a.entry, b.entry))
|
|
286
|
+
.map(({ entry, source, references }) => `<div class="resource-item resource-term" data-resource-item data-resource-group="termth">${blocksHtml([{ type: "term", entry }])}<div class="resource-term-sources">${sourceLink(source)}${references.size ? `<details><summary><span data-i18n="references">references</span> (${references.size})</summary><div class="resource-sources">${[...references.values()].map(sourceLink).join("")}</div></details>` : ""}</div></div>`),
|
|
287
|
+
...items,
|
|
288
|
+
];
|
|
289
|
+
};
|
|
290
|
+
export const resourceLibraryHtml = (index, view, pageTitle,
|
|
291
|
+
/** Library page: use each format's preview without the format picker. */
|
|
292
|
+
page = false) => {
|
|
209
293
|
const subformatsOnly = view === "subformats";
|
|
210
294
|
const groupLabel = subformatsOnly ? "Subformats" : view === "codeblocks" ? "Format" : "Domain";
|
|
211
295
|
const urls = view === "url-previews" ? index.urlPreviews : index.urls;
|
|
@@ -222,20 +306,20 @@ export const resourceLibraryHtml = (index, view, pageTitle) => {
|
|
|
222
306
|
const items = subformatsOnly
|
|
223
307
|
? []
|
|
224
308
|
: view === "codeblocks"
|
|
225
|
-
? index.codeblocks
|
|
226
|
-
const name = caption || (reference ? reference.file + (reference.range ?? "") : "");
|
|
227
|
-
return `<details class="resource-item resource-code" data-resource-item data-resource-group="${escapeHtml(format)}"><summary><span class="resource-badge">${escapeHtml(format)}</span>${name ? `<span class="resource-name" title="${escapeHtml(name)}">${escapeHtml(name)}</span>` : ""}${sourceLink(source)}</summary><div class="resource-body">${reference ? `<div class="resource-sources">${sourceLink(reference)}</div>` : ""}${blocksHtml([{ type: "code", lang: language === "mermaid" ? "text" : language, lines: content.split("\n") }])}</div></details>`;
|
|
228
|
-
})
|
|
309
|
+
? codeItems(index.codeblocks, page)
|
|
229
310
|
: urls.map(({ url, host, sources }) => `<details class="resource-item resource-url" data-resource-item data-resource-group="${escapeHtml(host)}"><summary><a class="resource-name" href="${escapeHtml(url)}" title="${escapeHtml(url)}" target="_blank" rel="noopener noreferrer">${escapeHtml(url)}</a><span class="resource-usage" title="references" data-i18n-title="references">${sources.length}</span></summary><div class="resource-body resource-sources">${sources.map(sourceLink).join("")}</div></details>`);
|
|
311
|
+
const relations = subformatsOnly && pageTitle === undefined && index.relations?.edges.length
|
|
312
|
+
? index.relations
|
|
313
|
+
: undefined;
|
|
230
314
|
const filterGroups = subformatsOnly ? index.subformats.map((item) => item.ext) : groups;
|
|
231
|
-
const selector = filterGroups.length || subformatsOnly
|
|
315
|
+
const selector = !page && (filterGroups.length || subformatsOnly)
|
|
232
316
|
? `<select data-resource-filter${subformatsOnly ? " data-subformat-filter hidden" : ""} aria-label="${groupLabel}" data-i18n-aria-label="${groupLabel}">${subformatsOnly ? (filterGroups.length ? "" : '<option value="" data-i18n="Subformats">Subformats</option>') : '<option value="" data-i18n="All">All</option>'}${filterGroups
|
|
233
317
|
.map((group) => {
|
|
234
318
|
const collection = index.subformats.find((item) => item.ext === group);
|
|
235
319
|
const change = collection && subformatChange(collection);
|
|
236
320
|
return `<option value="${escapeHtml(group)}"${change ? ` data-subformat-change="${change}"` : ""}>${escapeHtml(group)}</option>`;
|
|
237
321
|
})
|
|
238
|
-
.join("")}</select>`
|
|
322
|
+
.join("")}${relations ? '<option value="*" data-i18n="Relations">Relations</option>' : ""}</select>`
|
|
239
323
|
: "";
|
|
240
324
|
const selectedChange = index.subformats[0] && subformatChange(index.subformats[0]);
|
|
241
325
|
const filter = pageTitle !== undefined
|
|
@@ -245,10 +329,22 @@ export const resourceLibraryHtml = (index, view, pageTitle) => {
|
|
|
245
329
|
: selector;
|
|
246
330
|
const search = `<label class="resource-search"><svg width="13" height="13" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="${SEARCH_ICON_PATH}"/></svg><input type="search" data-resource-search placeholder="Search resources" aria-label="Search resources" data-i18n-placeholder="Search resources" data-i18n-aria-label="Search resources"></label>`;
|
|
247
331
|
const subformats = subformatsOnly || (view === "codeblocks" && index.subformats.length)
|
|
248
|
-
? `<template data-subformats>${escapeHtml(JSON.stringify(index.subformats))}</template><div data-subformat-board role="region" hidden></div>`
|
|
332
|
+
? `<template data-subformats>${escapeHtml(JSON.stringify(index.subformats))}</template><div data-subformat-board role="region" hidden></div>${relations ? `<div data-subformat-relations hidden>${blocksHtml([{ type: "schemaGraph", graph: relations }])}</div>` : ""}`
|
|
249
333
|
: "";
|
|
250
334
|
const emptyMessage = subformatsOnly && !index.subformats.length
|
|
251
335
|
? "No subformats configured. Add subformats to dooc.yaml."
|
|
252
336
|
: "No matching resources";
|
|
253
|
-
return `<section class="resource-results" data-resource-results${pageTitle !== undefined ? ` data-subformat-page="${escapeHtml(index.subformats[0]?.ext ?? "")}"` : ""}><div class="resource-toolbar">${subformatsOnly ? `<div class="resource-query">${filter}</div>` :
|
|
337
|
+
return `<section class="resource-results" data-resource-results${page ? " data-resource-page" : ""}${pageTitle !== undefined ? ` data-subformat-page="${escapeHtml(index.subformats[0]?.ext ?? "")}"` : ""}><div class="resource-toolbar">${subformatsOnly ? `<div class="resource-query">${filter}</div>` : `${page ? "" : '<span data-i18n="Name">Name</span>'}${search}${filter}`}${subformatsOnly ? "" : `<span class="resource-count" data-resource-count role="status" aria-live="polite">${items.length}</span>`}</div>${subformats}${index.errors.length && !page ? `<details class="resource-errors"><summary><span data-i18n="Files with errors">Files with errors</span> (${index.errors.length})</summary><ul>${index.errors.map((error) => `<li>${escapeHtml(error)}</li>`).join("")}</ul></details>` : ""}<div class="resource-items resource-${view}">${items.join("")}</div><p class="resource-empty" data-resource-empty${items.length ? " hidden" : ""} data-i18n="${emptyMessage}">${emptyMessage}</p></section>`;
|
|
338
|
+
};
|
|
339
|
+
/** A Library view shown as a site page: one block format, `urls` or `url-previews`. */
|
|
340
|
+
export const libraryPageHtml = (index, view, title) => {
|
|
341
|
+
const heading = `<h1 class="subformat-page-title">${escapeHtml(title)}</h1>`;
|
|
342
|
+
if (view === "urls" || view === "url-previews")
|
|
343
|
+
return heading + resourceLibraryHtml({ ...index, subformats: [] }, view, undefined, true);
|
|
344
|
+
return (heading +
|
|
345
|
+
resourceLibraryHtml({
|
|
346
|
+
...index,
|
|
347
|
+
subformats: [],
|
|
348
|
+
codeblocks: index.codeblocks.filter((item) => item.format === view),
|
|
349
|
+
}, "codeblocks", undefined, true));
|
|
254
350
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from "react";
|
|
2
|
-
import { type SchemaGraphClientData } from "
|
|
2
|
+
import { type SchemaGraphClientData } from "../engine/core/schema-graph.js";
|
|
3
3
|
export interface SchemaGraphFlowProps {
|
|
4
4
|
data: SchemaGraphClientData;
|
|
5
5
|
/** Height in normal view (default = sized to content, max 62vh). */
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
// theme isn't loaded).
|
|
14
14
|
import { applyNodeChanges, Background, BackgroundVariant, BaseEdge, ControlButton, Controls, Handle, MarkerType, MiniMap, Position, ReactFlow, ReactFlowProvider, useReactFlow, } from "@xyflow/react";
|
|
15
15
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
16
|
-
import { routeSchemaEdges, schemaFlowEdges, } from "
|
|
16
|
+
import { routeSchemaEdges, schemaFlowEdges, } from "../engine/core/schema-graph.js";
|
|
17
17
|
const STORE_PREFIX = "docs:sg:";
|
|
18
18
|
const FRAME_PAD = 14;
|
|
19
19
|
const FG = "var(--doc-fg, #000000)";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Site } from "
|
|
1
|
+
import type { Site } from "../server/serve.js";
|
|
2
2
|
export interface SearchSection {
|
|
3
3
|
/** text: rendered document text; file: a file name; folder: a folder document's path. */
|
|
4
4
|
kind: "text" | "file" | "folder";
|
|
@@ -15,4 +15,4 @@ export declare const searchSections: (index: SearchSection[], query: string, cur
|
|
|
15
15
|
snippet: string;
|
|
16
16
|
})[];
|
|
17
17
|
export declare const SEARCH_LABELS: string[];
|
|
18
|
-
export declare const mountSearch: (initial: SearchSection[], search: typeof searchSections, labels: Record<string, string>, published: boolean) => void;
|
|
18
|
+
export declare const mountSearch: (initial: SearchSection[], search: typeof searchSections, labels: Record<string, string>, published: boolean, requestFile?: typeof fetch) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inlineSegmenter } from "../core/inline.js";
|
|
2
|
-
import { docPath } from "../core/routing.js";
|
|
3
|
-
import { docDisplayName } from "../core/taxonomy.js";
|
|
1
|
+
import { inlineSegmenter } from "../engine/core/inline.js";
|
|
2
|
+
import { docPath } from "../engine/core/routing.js";
|
|
3
|
+
import { docDisplayName } from "../engine/core/taxonomy.js";
|
|
4
4
|
/** `files` are workspace files that open at /_files/file/<path> (edit mode only). */
|
|
5
5
|
export const searchIndex = (site, files = []) => {
|
|
6
6
|
const parents = new Set(site.entries.map((entry) => entry.parent));
|
|
@@ -161,7 +161,7 @@ export const SEARCH_LABELS = [
|
|
|
161
161
|
"Copy failed",
|
|
162
162
|
];
|
|
163
163
|
// Embedded by page(); keep browser behavior independent of the editor bundle.
|
|
164
|
-
export const mountSearch = (initial, search, labels, published) => {
|
|
164
|
+
export const mountSearch = (initial, search, labels, published, requestFile = fetch) => {
|
|
165
165
|
const svg = (d, size = 14) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
166
166
|
const kinds = {
|
|
167
167
|
text: { icon: svg("M5 6h14M5 11h14M5 16h9"), label: "Matches text" },
|
|
@@ -361,11 +361,20 @@ export const mountSearch = (initial, search, labels, published) => {
|
|
|
361
361
|
let docked = false;
|
|
362
362
|
let other = "";
|
|
363
363
|
const dockButton = dialog.querySelector(".search-dock");
|
|
364
|
+
const sidebar = document.getElementById("sidebar");
|
|
365
|
+
const maxDockWidth = () => innerWidth -
|
|
366
|
+
(sidebar?.getBoundingClientRect().width ?? 0) -
|
|
367
|
+
240 -
|
|
368
|
+
(document.getElementById("panel") ? 320 : 0);
|
|
364
369
|
const dock = (value) => {
|
|
370
|
+
dockButton.disabled = maxDockWidth() < 240;
|
|
371
|
+
value = value && !dockButton.disabled;
|
|
365
372
|
if (value !== docked)
|
|
366
373
|
[dialog.style.cssText, other] = [other, dialog.style.cssText];
|
|
367
374
|
docked = value;
|
|
368
375
|
dialog.classList.toggle("search-docked", value);
|
|
376
|
+
if (value)
|
|
377
|
+
dialog.style.width = `${Math.min(Number.parseFloat(dialog.style.width) || 320, maxDockWidth())}px`;
|
|
369
378
|
dockButton.innerHTML = svg(value ? "M14 4h6v6M20 4l-9 9M18 14v6H4V6h6" : "M4 5h16v14H4zM15 5v14");
|
|
370
379
|
dockButton.dataset.label = value ? "Float search" : "Move search to sidebar";
|
|
371
380
|
dockButton.title = t(dockButton.dataset.label);
|
|
@@ -381,7 +390,7 @@ export const mountSearch = (initial, search, labels, published) => {
|
|
|
381
390
|
if (docked) {
|
|
382
391
|
// As a sidebar only the left edge resizes the panel.
|
|
383
392
|
if (resize && dx)
|
|
384
|
-
dialog.style.width = `${clamp(rect.width + dx, 240,
|
|
393
|
+
dialog.style.width = `${clamp(rect.width + dx, 240, maxDockWidth())}px`;
|
|
385
394
|
return;
|
|
386
395
|
}
|
|
387
396
|
const width = clamp(rect.width + (resize ? dx : 0), 280, innerWidth - 16);
|
|
@@ -438,10 +447,14 @@ export const mountSearch = (initial, search, labels, published) => {
|
|
|
438
447
|
position(dialog.getBoundingClientRect(), fx * (event.key === "ArrowRight" ? step : event.key === "ArrowLeft" ? -step : 0), fy * (event.key === "ArrowDown" ? step : event.key === "ArrowUp" ? -step : 0), resize);
|
|
439
448
|
});
|
|
440
449
|
}
|
|
441
|
-
|
|
450
|
+
const fit = () => {
|
|
451
|
+
dock(docked);
|
|
442
452
|
if (dialog.open)
|
|
443
453
|
position(dialog.getBoundingClientRect(), 0, 0);
|
|
444
|
-
}
|
|
454
|
+
};
|
|
455
|
+
window.addEventListener("resize", fit);
|
|
456
|
+
if (sidebar)
|
|
457
|
+
new ResizeObserver(fit).observe(sidebar);
|
|
445
458
|
const open = async () => {
|
|
446
459
|
const request = ++revision;
|
|
447
460
|
language =
|
|
@@ -462,7 +475,7 @@ export const mountSearch = (initial, search, labels, published) => {
|
|
|
462
475
|
if (published)
|
|
463
476
|
return;
|
|
464
477
|
try {
|
|
465
|
-
const response = await
|
|
478
|
+
const response = await requestFile(`/api/search${language ? `?lang=${encodeURIComponent(language)}` : ""}`);
|
|
466
479
|
if (!response.ok)
|
|
467
480
|
throw new Error(String(response.status));
|
|
468
481
|
const data = (await response.json());
|
|
@@ -490,6 +503,11 @@ export const mountSearch = (initial, search, labels, published) => {
|
|
|
490
503
|
void open();
|
|
491
504
|
}
|
|
492
505
|
}, true);
|
|
506
|
+
document.addEventListener("dooc:workspace-changed", () => {
|
|
507
|
+
revision++;
|
|
508
|
+
index = [];
|
|
509
|
+
dialog.close();
|
|
510
|
+
});
|
|
493
511
|
input.addEventListener("input", render);
|
|
494
512
|
input.addEventListener("keydown", (event) => {
|
|
495
513
|
if (event.isComposing)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as u,c as f}from"./chunk-
|
|
1
|
+
import{a,b as u,c as f}from"./chunk-LSRL537V.js";import{a as m}from"./chunk-HKRJKXEE.js";import{b as p}from"./chunk-FD7ZFC7R.js";import"./chunk-QYTM6GY3.js";import"./chunk-XQS73SBQ.js";import"./chunk-GF4TOPUK.js";import"./chunk-SCEY3ZPT.js";import"./chunk-3LU66YMI.js";import"./chunk-O656ZI37.js";import"./chunk-BVXT562I.js";import"./chunk-ARAJTKOH.js";import"./chunk-ZSZXN4BT.js";import{b as l}from"./chunk-5OO6DATX.js";import"./chunk-PDH25ALM.js";import"./chunk-MPR575IN.js";import"./chunk-JSHWCPFJ.js";import"./chunk-Z4FIZ7CR.js";import"./chunk-QYAXYFNI.js";import"./chunk-LT6LXKCR.js";import"./chunk-67BPVAXC.js";import"./chunk-IVZHB6RS.js";import{b as s}from"./chunk-QQIGL7OP.js";import{a as t}from"./chunk-RJFVWYCA.js";import"./chunk-SQE76S5B.js";var v=l().RailroadAbnf.parser.LangiumParser,i=t(e=>{let r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=t(e=>{let r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=t(e=>{if(e.includes("*")){let[n,o]=e.split("*"),c=n?parseInt(n,10):0,d=o?parseInt(o,10):1/0;return{min:c,max:d}}let r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=t(e=>{let r=A(e.primary);if(!e.repeat)return r;let{min:n,max:o}=b(e.repeat);return n===0&&o===1?{type:"optional",element:r}:{type:"repetition",element:r,min:n,max:o}},"transformElement"),A=t(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{m(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:t(e=>{a.clear(),s.debug("[ABNF Parser] Starting Langium parse");let r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);let n=r.value;s.debug("[ABNF Parser] Parsed rules:",n.rules.length),h(n),s.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},I={parser:R,db:a,renderer:f,styles:u};export{I as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as r}from"./chunk-SCEY3ZPT.js";import"./chunk-LT6LXKCR.js";import"./chunk-
|
|
1
|
+
import{a as e,b as r}from"./chunk-SCEY3ZPT.js";import"./chunk-LT6LXKCR.js";import"./chunk-SQE76S5B.js";export{e as ArchitectureModule,r as createArchitectureServices};
|