@locus-forge/locus-map 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/README.md +21 -6
- package/dist/assets/{abnfDiagram-VCTEODGH-BnTGKKaL.js → abnfDiagram-VCTEODGH-YtlnkH6t.js} +1 -1
- package/dist/assets/{ar-SA-G6X2FPQ2-LY3czoz9.js → ar-SA-G6X2FPQ2-BH5AlOAp.js} +1 -1
- package/dist/assets/{architectureDiagram-5GKGNRK7-BG9h9KRx.js → architectureDiagram-5GKGNRK7-DKYw7IM8.js} +1 -1
- package/dist/assets/{az-AZ-76LH7QW2-Brv6kuM6.js → az-AZ-76LH7QW2-DoI4xcyq.js} +1 -1
- package/dist/assets/{bg-BG-XCXSNQG7-tsQwwvMW.js → bg-BG-XCXSNQG7-CS9_2dp-.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-V9bUuR63.js → blockDiagram-I7D4REHJ-FelDwD1I.js} +1 -1
- package/dist/assets/{bn-BD-2XOGV67Q-0Cou5nNv.js → bn-BD-2XOGV67Q-CoIu5tTK.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-BmCtzbrY.js → c4Diagram-7LVT6UL2-Bh7h9IHP.js} +1 -1
- package/dist/assets/{ca-ES-6MX7JW3Y-pZF7WJUL.js → ca-ES-6MX7JW3Y-DAEHzf3H.js} +1 -1
- package/dist/assets/channel-DXsl7ag_.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-D2iTDmHh.js → chunk-2Q5K7J3B-CgUOCDxa.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-CTxdXZIx.js → chunk-5VM5RSS4-B97oha-s.js} +1 -1
- package/dist/assets/{chunk-F27PBJKO-Hic1X1pm.js → chunk-F27PBJKO-BQGqI2Ej.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-DhLW1JVb.js → chunk-IMKFNOWR-C_sOeFT_.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-_g5twKlC.js → chunk-JWPE2WC7-DG5n2owX.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-DMV4qmkd.js → chunk-POPQ4Y6H-Y-h3THrr.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-BWg83oEL.js → chunk-SVP7TREG-Dn6yBHtF.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-CPmkpa7J.js → chunk-TICWLB2K-Cb_yWOVI.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-KnXvIZ_8.js → chunk-XXDRQBXY-QE51OqTj.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-DLyWZtYF.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-Cb3mb68m.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-BChK_CGh.js → cose-bilkent-JH36ORCC-Bt7ZI9S1.js} +1 -1
- package/dist/assets/{cs-CZ-2BRQDIVT-CtAC2Qjy.js → cs-CZ-2BRQDIVT-BKZzkx2M.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-CdsltaMX.js → cynefin-OW5HDTMX-n6-BmECj.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-bXvXX3Fx.js → cynefinDiagram-5FMLGOSQ-Bq2km1fZ.js} +1 -1
- package/dist/assets/{d3-scale-sM87TD1Z.js → d3-scale-C9oJHYFk.js} +1 -1
- package/dist/assets/{da-DK-5WZEPLOC-DyWwaclV.js → da-DK-5WZEPLOC-DWJm1_Yl.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-CTmiZZVO.js → dagre-GXQ25YYZ-D9EJj_nK.js} +1 -1
- package/dist/assets/{de-DE-XR44H4JA-BDXUBHki.js → de-DE-XR44H4JA-D-5dMJXD.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-Bm8Fy0R_.js → diagram-S7CK7UJ4-DX3qZf_H.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-BU_AmM_A.js → diagram-UQ7AKVKN-lODsxrZ9.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-B78LUoXq.js → diagram-VSXAHHWV-B48xz8Xq.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-DNvWjMlf.js → diagram-VX7I27RA-Dms2AfBa.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-DmFVt1fa.js → diagram-Z3DM3KII-BnwZBeJA.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-CpDna0Jp.js → ebnfDiagram-PWID7BFC-OtcCvaIU.js} +1 -1
- package/dist/assets/{el-GR-BZB4AONW-CNhF7oN2.js → el-GR-BZB4AONW-BZVA3YVN.js} +1 -1
- package/dist/assets/{engines-a8mi_N6S.js → engines-DPbXorS1.js} +1 -1
- package/dist/assets/{erDiagram-RLTQ6QDP-BGD-9OAS.js → erDiagram-RLTQ6QDP-Cnh8Gn9f.js} +1 -1
- package/dist/assets/{es-ES-U4NZUMDT-DXMrJcKL.js → es-ES-U4NZUMDT-DKJIfS-2.js} +1 -1
- package/dist/assets/{eu-ES-A7QVB2H4-BTkMEwMi.js → eu-ES-A7QVB2H4-LHCF7lHc.js} +1 -1
- package/dist/assets/{fa-IR-HGAKTJCU-CgkknSS7.js → fa-IR-HGAKTJCU-CMtLvHxY.js} +1 -1
- package/dist/assets/{fi-FI-Z5N7JZ37-B1K83nId.js → fi-FI-Z5N7JZ37-CUIzm5UM.js} +1 -1
- package/dist/assets/{flowDiagram-HODETNUW-CjU1yR1F.js → flowDiagram-HODETNUW-lneiCvFi.js} +1 -1
- package/dist/assets/{fr-FR-RHASNOE6-CBFZBGMr.js → fr-FR-RHASNOE6-DTJ2WS73.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-bvb8BjSh.js → ganttDiagram-EL5Y4UJY-B2aJ2MDb.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DZXQ_x8t.js → gitGraphDiagram-WWUBYQGX-C74V3MFm.js} +1 -1
- package/dist/assets/{gl-ES-HMX3MZ6V-CON98Mma.js → gl-ES-HMX3MZ6V-BP8M0fQQ.js} +1 -1
- package/dist/assets/{he-IL-6SHJWFNN-CBoFaEdB.js → he-IL-6SHJWFNN-BMd-Q0PW.js} +1 -1
- package/dist/assets/{hi-IN-IWLTKZ5I-BJuoh3dl.js → hi-IN-IWLTKZ5I-Ct52OkX5.js} +1 -1
- package/dist/assets/{hu-HU-A5ZG7DT2-CQruu8XR.js → hu-HU-A5ZG7DT2-NfIL6Jfo.js} +1 -1
- package/dist/assets/{id-ID-SAP4L64H-VhaoENjR.js → id-ID-SAP4L64H-Osl6P1wb.js} +1 -1
- package/dist/assets/index-CyQSsku0.js +624 -0
- package/dist/assets/{index-CDNl17QJ.css → index-DR6sd54W.css} +1 -1
- package/dist/assets/{index-CboxqaL5.js → index-VfiAlFSM.js} +5 -5
- package/dist/assets/{infoDiagram-27XIBGKW-CM9Hap0f.js → infoDiagram-27XIBGKW-BjDMKD-X.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-i8pQztJI.js → ishikawaDiagram-5VMMS53U-DjrBmz8f.js} +1 -1
- package/dist/assets/{it-IT-JPQ66NNP-Dj9BkXfh.js → it-IT-JPQ66NNP-vT-EYZw5.js} +1 -1
- package/dist/assets/{ja-JP-DBVTYXUO-CB2BlfIS.js → ja-JP-DBVTYXUO-DexyPC4p.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-PxcdqONT.js → journeyDiagram-3NMN7TZE-Bs5RL4Ef.js} +1 -1
- package/dist/assets/{kaa-6HZHGXH3-CLnR_zY5.js → kaa-6HZHGXH3-0BLUFlXY.js} +1 -1
- package/dist/assets/{kab-KAB-ZGHBKWFO-8TJr4nPf.js → kab-KAB-ZGHBKWFO-ByGN5_Fc.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-B2p5NBhO.js → kanban-definition-UXKFOSKX-DgcopnbA.js} +1 -1
- package/dist/assets/{kk-KZ-P5N5QNE5-5uZYjZ2e.js → kk-KZ-P5N5QNE5-DlK-wQWu.js} +1 -1
- package/dist/assets/{km-KH-HSX4SM5Z-D54aOpMd.js → km-KH-HSX4SM5Z-BZ75967_.js} +1 -1
- package/dist/assets/{ko-KR-MTYHY66A-Bnm0G6eo.js → ko-KR-MTYHY66A-C-copauZ.js} +1 -1
- package/dist/assets/{ku-TR-6OUDTVRD-CtGCn_eB.js → ku-TR-6OUDTVRD-CNqY-Uj4.js} +1 -1
- package/dist/assets/{layout-BBV3_Svw.js → layout-B8D2HGrb.js} +1 -1
- package/dist/assets/{lt-LT-XHIRWOB4-Bl8G0yv6.js → lt-LT-XHIRWOB4-BopE_XJX.js} +1 -1
- package/dist/assets/{lv-LV-5QDEKY6T-Cax93Eua.js → lv-LV-5QDEKY6T--7hU3JSZ.js} +1 -1
- package/dist/assets/{mindmap-definition-YA3MSWOX-CsOezwmE.js → mindmap-definition-YA3MSWOX-DYOVTEyE.js} +1 -1
- package/dist/assets/{mr-IN-CRQNXWMA-Br7GVyJH.js → mr-IN-CRQNXWMA-DydjVI2G.js} +1 -1
- package/dist/assets/{my-MM-5M5IBNSE-xC6lzTDV.js → my-MM-5M5IBNSE-D6ewM-EV.js} +1 -1
- package/dist/assets/{nb-NO-T6EIAALU-B0i5THqA.js → nb-NO-T6EIAALU--iqOwj15.js} +1 -1
- package/dist/assets/{nl-NL-IS3SIHDZ-CqYhUjP3.js → nl-NL-IS3SIHDZ-Bnhl_SmS.js} +1 -1
- package/dist/assets/{nn-NO-6E72VCQL-rpjr_9Z5.js → nn-NO-6E72VCQL-CIx7sLAQ.js} +1 -1
- package/dist/assets/{oc-FR-POXYY2M6-BlhQ99Ty.js → oc-FR-POXYY2M6-DWt5a8Ow.js} +1 -1
- package/dist/assets/{pa-IN-N4M65BXN-N2XbQgZ_.js → pa-IN-N4M65BXN-BW3LNure.js} +1 -1
- package/dist/assets/{pegDiagram-XKGWAZYB-C2iSJgYQ.js → pegDiagram-XKGWAZYB-ixSY_9-e.js} +1 -1
- package/dist/assets/{pica-DvYcrBvx.js → pica-Dn0N8xAP.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-CUjgOGBw.js → pieDiagram-E7YTZNPT-BbCRV6Qi.js} +1 -1
- package/dist/assets/{pl-PL-T2D74RX3-CnMxn1dA.js → pl-PL-T2D74RX3-7nXJ8SiV.js} +1 -1
- package/dist/assets/{pt-BR-5N22H2LF-Di-jnHb3.js → pt-BR-5N22H2LF-DKGGof4J.js} +1 -1
- package/dist/assets/{pt-PT-UZXXM6DQ-BaAKq8Sh.js → pt-PT-UZXXM6DQ-DCLEXuhk.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-DwwqgJXZ.js → quadrantDiagram-AXDQQJYC-Bvh_H4wg.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-DyRgYGPF.js → railroadDiagram-O6MQD6OU-DHC3neQ8.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-C3ixXeHJ.js → requirementDiagram-BXWQKSXE-DuCkl3u1.js} +1 -1
- package/dist/assets/{ro-RO-JPDTUUEW-BWrclVyo.js → ro-RO-JPDTUUEW-Cwf4k3Ou.js} +1 -1
- package/dist/assets/{ru-RU-B4JR7IUQ-_z0DINaG.js → ru-RU-B4JR7IUQ-sZF6fySs.js} +1 -1
- package/dist/assets/{sankeyDiagram-P5KCCOFB-mKpKYI_w.js → sankeyDiagram-P5KCCOFB-1ELTqwtI.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-ZkNd0Wnj.js → sequenceDiagram-WJ2MYXX4-BK8Ou8Dz.js} +1 -1
- package/dist/assets/{si-LK-N5RQ5JYF-CdKOb383.js → si-LK-N5RQ5JYF-DmYhXIqO.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-hQLGO-0z.js → sizeCapture-INFHLROL-BKwx3lxX.js} +1 -1
- package/dist/assets/{sk-SK-C5VTKIMK-MHJC6ZIe.js → sk-SK-C5VTKIMK-BRLu35YX.js} +1 -1
- package/dist/assets/{sl-SI-NN7IZMDC-BF9YWbZx.js → sl-SI-NN7IZMDC-CMjfvJTr.js} +1 -1
- package/dist/assets/{stateDiagram-D77RDMKH-CRWj3j-B.js → stateDiagram-D77RDMKH-CDwJ9XLN.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-BZjKARGY.js +1 -0
- package/dist/assets/{subset-shared.chunk-DtxXjVIA.js → subset-shared.chunk-DngAvf0H.js} +1 -1
- package/dist/assets/{subset-worker.chunk-DONNSbUF.js → subset-worker.chunk-DkH_mqr5.js} +1 -1
- package/dist/assets/{sv-SE-XGPEYMSR-DkaTkfUY.js → sv-SE-XGPEYMSR-G4S06sbd.js} +1 -1
- package/dist/assets/{swimlanes-42K2YHIH-CFf6j7jO.js → swimlanes-42K2YHIH-Z9u8PDi-.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-D0kM5xmS.js +8 -0
- package/dist/assets/{ta-IN-2NMHFXQM-BfxqXEDI.js → ta-IN-2NMHFXQM-DgBbCQ8S.js} +1 -1
- package/dist/assets/{th-TH-HPSO5L25-DT3vLA39.js → th-TH-HPSO5L25-o9u4fVfq.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-BGP2Dq8M.js → timeline-definition-24CTP7MA-BNgrm1r_.js} +1 -1
- package/dist/assets/{tr-TR-DEFEU3FU-CdfsG7py.js → tr-TR-DEFEU3FU-BqqSdzoL.js} +1 -1
- package/dist/assets/{uk-UA-QMV73CPH-CZrQuC1S.js → uk-UA-QMV73CPH-Dna46aia.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-CaxGPIab.js → vennDiagram-4TSXK5OY-CHwUI40M.js} +1 -1
- package/dist/assets/{vi-VN-M7AON7JQ-DQJk1_KV.js → vi-VN-M7AON7JQ-CbKRBQPB.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-DQxQ-zXH.js → wardleyDiagram-VM6X3IG4-KB0xBjXX.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-DoxdZQ6R.js → xychartDiagram-S5SC5T6Z-B3LOQLL-.js} +1 -1
- package/dist/assets/{zh-CN-LNUGB5OW-DRVBfkOy.js → zh-CN-LNUGB5OW-BFjA6n_2.js} +1 -1
- package/dist/assets/{zh-HK-E62DVLB3-BJHrltss.js → zh-HK-E62DVLB3-BoTU6iS7.js} +1 -1
- package/dist/assets/{zh-TW-RAJ6MFWO-DpMZ5m2x.js → zh-TW-RAJ6MFWO-DB4kdpOS.js} +1 -1
- package/dist/index.html +2 -2
- package/docs/BUNDLE-FORMAT.md +18 -5
- package/docs/DIAGRAM-SOURCE.md +59 -12
- package/docs/LOCAL-DOCUMENT.md +42 -86
- package/docs/MODEL-CONTRACT.md +7 -4
- package/docs/PLANTUML-SOURCE.md +3 -2
- package/docs/VIEWER-LAUNCH.md +29 -22
- package/docs/VIEWER.md +93 -26
- package/docs/adr/ADR-002-2026-12-03-project-selector/ADR-002-2026-12-03-project-selector.md +1 -1
- package/docs/adr/ADR-005-2026-12-04-named-libraries/ADR-005-2026-12-04-named-libraries.md +1 -1
- package/docs/capabilities.json +21 -3
- package/package.json +2 -1
- package/scripts/build-map.mjs +1 -1
- package/scripts/lib/library-directory.mjs +1 -1
- package/scripts/lib/map-build-invocation.mjs +5 -1
- package/scripts/lib/map-viewer-server.mjs +195 -43
- package/scripts/lib/original-materials.mjs +1 -1
- package/scripts/lib/original-report-server.mjs +7 -3
- package/scripts/lib/project-catalog.mjs +264 -97
- package/scripts/lib/project-map-inputs.mjs +1 -1
- package/scripts/lib/project-registry.mjs +151 -47
- package/scripts/lib/sketch-publication.mjs +1 -1
- package/scripts/lib/task-map-build.mjs +1 -1
- package/scripts/lib/view-args.mjs +163 -0
- package/scripts/lib/workflow/reader-surface.mjs +29 -11
- package/scripts/locus-map.mjs +18 -23
- package/scripts/open-map.mjs +96 -51
- package/skills/README.md +2 -1
- package/skills/locus-map/SKILL.md +30 -26
- package/skills/locus-map/assets/artifact-handoff.md +2 -1
- package/skills/locus-map/references/build-environment.md +11 -7
- package/skills/locus-map/references/checks.md +16 -4
- package/skills/locus-map/references/component-checkpoint.md +35 -0
- package/skills/locus-map/references/draw-skill.md +2 -1
- package/skills/locus-map/references/folder.md +2 -2
- package/skills/locus-map/references/selection.md +36 -13
- package/skills/locus-map/references/task-maps.md +5 -0
- package/skills/locus-map/references/visual-composition.md +69 -0
- package/skills/locus-map-draft/SKILL.md +95 -0
- package/skills/locus-map-draft/assets/chosen-direction.md +47 -0
- package/skills/locus-map-draft/references/divergence-and-formats.md +78 -0
- package/skills/locus-map-primitives/SKILL.md +11 -10
- package/skills/locus-map-primitives/assets/batch/README.md +2 -2
- package/skills/locus-map-primitives/assets/batch/build.mjs +1 -1
- package/skills/locus-map-primitives/assets/batch/{project.json → topic.json} +13 -20
- package/skills/locus-map-primitives/references/card-presentation.md +57 -3
- package/skills/locus-map-primitives/references/reading-files.md +1 -1
- package/src/adapter/areas.js +1 -0
- package/src/adapter/semanticAdmission.js +118 -5
- package/src/authoring/buildDiagram.mjs +99 -19
- package/src/authoring/canvas-source-worker.mjs +96 -0
- package/src/authoring/canvasSource.mjs +41 -0
- package/src/authoring/diagramChecks.js +143 -1
- package/src/authoring/diagramSource.js +31 -5
- package/src/authoring/printPlantumlSource.js +13 -2
- package/src/authoring/readDetailsFiles.mjs +100 -19
- package/src/bundle/chain.js +129 -32
- package/src/bundle/chainBrowser.js +26 -2
- package/src/bundle/localDocument.mjs +87 -22
- package/src/bundle/localDocumentClient.js +5 -1
- package/src/bundle/projectClient.js +64 -21
- package/src/chain/validation.js +7 -1
- package/src/contract/readingMaterials.js +18 -2
- package/src/contract/readingTable.js +66 -0
- package/src/main.jsx +25 -1
- package/src/viewer/ControlIcon.jsx +3 -0
- package/src/viewer/DiagramViewer.jsx +70 -30
- package/src/viewer/EmbeddedExcalidrawEditor.jsx +305 -0
- package/src/viewer/HighlightOverlay.jsx +53 -25
- package/src/viewer/Inspector.jsx +109 -39
- package/src/viewer/ProjectLocation.jsx +25 -7
- package/src/viewer/ProjectRail.jsx +20 -7
- package/src/viewer/ProjectViewChainViewer.jsx +254 -83
- package/src/viewer/ReadingTable.jsx +151 -0
- package/src/viewer/SketchCanvas.jsx +133 -84
- package/src/viewer/ViewChainViewer.jsx +557 -57
- package/src/viewer/ViewerSettings.jsx +208 -0
- package/src/viewer/camera.js +50 -18
- package/src/viewer/chainEditorSession.js +160 -35
- package/src/viewer/chainInstallation.js +3 -3
- package/src/viewer/details/CanvasPreview.jsx +303 -0
- package/src/viewer/details/InspectorReadingSettings.jsx +50 -13
- package/src/viewer/details/ReadingFiles.jsx +32 -4
- package/src/viewer/details/details.css +65 -26
- package/src/viewer/diagramControls.css +1 -1
- package/src/viewer/fileError.js +53 -0
- package/src/viewer/geometry.js +12 -0
- package/src/viewer/inspectorPosition.js +54 -31
- package/src/viewer/projectContents.js +248 -55
- package/src/viewer/projectNavigation.js +27 -3
- package/src/viewer/readingTable.css +47 -0
- package/src/viewer/sketchSettling.js +71 -0
- package/src/viewer/useInspectorPosition.js +116 -35
- package/src/viewer/viewChain.css +92 -5
- package/src/viewer/viewer.css +23 -12
- package/dist/assets/channel-Dx9OTBrx.js +0 -1
- package/dist/assets/classDiagram-ZZMXUADV-Da4s894j.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY--H9NrCfO.js +0 -1
- package/dist/assets/index-DBGHN_5E.js +0 -624
- package/dist/assets/stateDiagram-v2-MP3YSRHH-B2DcVJGG.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-DO_W2uN2.js +0 -8
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import * as ExcalidrawPackage from '@excalidraw/excalidraw';
|
|
3
|
+
import { loadSceneFonts } from '@locus-forge/locus-draw/scene/browser';
|
|
4
|
+
|
|
5
|
+
const { CaptureUpdateAction, Excalidraw, restore } = ExcalidrawPackage;
|
|
6
|
+
import { installCatalogFiles } from '../../bundle/catalogFiles.js';
|
|
7
|
+
import { sketchSettings } from '../../bundle/sketch.js';
|
|
8
|
+
import { isGuideElement } from '../../adapter/index.js';
|
|
9
|
+
import { fitCamera } from '../camera.js';
|
|
10
|
+
import { ControlIcon } from '../ControlIcon.jsx';
|
|
11
|
+
|
|
12
|
+
const PREVIEW_UI_OPTIONS = {
|
|
13
|
+
canvasActions: {
|
|
14
|
+
loadScene: false,
|
|
15
|
+
saveToActiveFile: false,
|
|
16
|
+
export: false,
|
|
17
|
+
saveAsImage: false,
|
|
18
|
+
toggleTheme: false,
|
|
19
|
+
},
|
|
20
|
+
tools: { image: false },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function resolveLocusMapInput(canvas) {
|
|
24
|
+
const viewId = canvas.viewId ?? canvas.chain?.rootViewId;
|
|
25
|
+
const scene = canvas.scene
|
|
26
|
+
?? (canvas.scenes instanceof Map ? canvas.scenes.get(viewId) : canvas.scenes?.[viewId])
|
|
27
|
+
?? null;
|
|
28
|
+
const model = (canvas.projected instanceof Map && viewId ? canvas.projected.get(viewId) : null)
|
|
29
|
+
?? canvas.model
|
|
30
|
+
?? null;
|
|
31
|
+
return { model, scene };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function normalizeDrawing(value) {
|
|
35
|
+
if (typeof value === 'string') {
|
|
36
|
+
try { return JSON.parse(value); } catch { return null; }
|
|
37
|
+
}
|
|
38
|
+
return value && typeof value === 'object' ? value : null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function sameCamera(a, b) {
|
|
42
|
+
return Boolean(a && b
|
|
43
|
+
&& Math.abs(a.scrollX - b.scrollX) <= 0.5
|
|
44
|
+
&& Math.abs(a.scrollY - b.scrollY) <= 0.5
|
|
45
|
+
&& Math.abs((a.zoom?.value ?? 1) - (b.zoom?.value ?? 1)) <= 1e-4);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Interactive official Excalidraw preview embedded inside the floating Inspector. */
|
|
49
|
+
export function CanvasPreview({ canvas, title, onOpenFull, compact = false }) {
|
|
50
|
+
const [api, setApi] = useState(null);
|
|
51
|
+
const [loading, setLoading] = useState(Boolean(canvas));
|
|
52
|
+
const [error, setError] = useState(null);
|
|
53
|
+
const stageRef = useRef(null);
|
|
54
|
+
const entryCameraRef = useRef(null);
|
|
55
|
+
const modelRef = useRef(null);
|
|
56
|
+
|
|
57
|
+
const displayTitle = title || canvas?.title || 'Diagram preview';
|
|
58
|
+
const normalizedDrawing = canvas?.format === 'excalidraw' ? normalizeDrawing(canvas.drawing) : null;
|
|
59
|
+
const available = Boolean(
|
|
60
|
+
canvas && (
|
|
61
|
+
(canvas.format === 'locus-map' && resolveLocusMapInput(canvas).scene)
|
|
62
|
+
|| (canvas.format === 'excalidraw' && Array.isArray(normalizedDrawing?.elements))
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const refreshOffsets = useCallback(() => {
|
|
67
|
+
if (!api || !stageRef.current) return;
|
|
68
|
+
const bounds = stageRef.current.getBoundingClientRect();
|
|
69
|
+
const state = api.getAppState();
|
|
70
|
+
if (state.offsetLeft !== bounds.left || state.offsetTop !== bounds.top) api.refresh();
|
|
71
|
+
}, [api]);
|
|
72
|
+
|
|
73
|
+
const computeFitCamera = useCallback(() => {
|
|
74
|
+
if (!api || !stageRef.current) return null;
|
|
75
|
+
api.refresh();
|
|
76
|
+
const rect = stageRef.current.getBoundingClientRect();
|
|
77
|
+
const state = api.getAppState();
|
|
78
|
+
const width = rect.width || state.width;
|
|
79
|
+
const height = rect.height || state.height;
|
|
80
|
+
if (width <= 0 || height <= 0) return null;
|
|
81
|
+
const elements = api.getSceneElements();
|
|
82
|
+
const model = modelRef.current;
|
|
83
|
+
const graph = model ? elements.filter(el => !isGuideElement(model, el)) : elements;
|
|
84
|
+
return fitCamera(graph.length ? graph : elements, { ...state, width, height });
|
|
85
|
+
}, [api]);
|
|
86
|
+
|
|
87
|
+
const fit = useCallback(() => {
|
|
88
|
+
if (!api) return;
|
|
89
|
+
try {
|
|
90
|
+
const next = computeFitCamera();
|
|
91
|
+
if (!next) return;
|
|
92
|
+
entryCameraRef.current = next;
|
|
93
|
+
api.updateScene({ appState: next, captureUpdate: CaptureUpdateAction.NEVER });
|
|
94
|
+
} catch (failure) {
|
|
95
|
+
setError(failure);
|
|
96
|
+
}
|
|
97
|
+
}, [api, computeFitCamera]);
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
window.addEventListener('scroll', refreshOffsets, true);
|
|
101
|
+
return () => window.removeEventListener('scroll', refreshOffsets, true);
|
|
102
|
+
}, [refreshOffsets]);
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!available) {
|
|
106
|
+
setLoading(false);
|
|
107
|
+
setError(null);
|
|
108
|
+
entryCameraRef.current = null;
|
|
109
|
+
modelRef.current = null;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!api || !stageRef.current) return;
|
|
113
|
+
|
|
114
|
+
let cancelled = false;
|
|
115
|
+
let frame = null;
|
|
116
|
+
entryCameraRef.current = null;
|
|
117
|
+
setLoading(true);
|
|
118
|
+
setError(null);
|
|
119
|
+
|
|
120
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
121
|
+
if (cancelled || !api || !stageRef.current) return;
|
|
122
|
+
try {
|
|
123
|
+
api.refresh();
|
|
124
|
+
const entry = entryCameraRef.current;
|
|
125
|
+
if (!entry) return;
|
|
126
|
+
const state = api.getAppState();
|
|
127
|
+
if (!sameCamera(state, entry)) {
|
|
128
|
+
entryCameraRef.current = null;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const next = computeFitCamera();
|
|
132
|
+
if (!next || sameCamera(next, entry)) return;
|
|
133
|
+
entryCameraRef.current = next;
|
|
134
|
+
api.updateScene({ appState: next, captureUpdate: CaptureUpdateAction.NEVER });
|
|
135
|
+
} catch (failure) {
|
|
136
|
+
if (!cancelled) {
|
|
137
|
+
setError(failure);
|
|
138
|
+
setLoading(false);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
resizeObserver.observe(stageRef.current);
|
|
143
|
+
|
|
144
|
+
async function prepareAndInstall() {
|
|
145
|
+
try {
|
|
146
|
+
let prepared;
|
|
147
|
+
if (canvas.format === 'locus-map') {
|
|
148
|
+
const { model, scene } = resolveLocusMapInput(canvas);
|
|
149
|
+
if (!scene || !Array.isArray(scene.elements)) throw new Error('Diagram scene is unavailable.');
|
|
150
|
+
const input = structuredClone(scene);
|
|
151
|
+
await loadSceneFonts(input.elements);
|
|
152
|
+
prepared = { format: 'locus-map', model, input };
|
|
153
|
+
} else if (canvas.format === 'excalidraw') {
|
|
154
|
+
const drawing = normalizedDrawing;
|
|
155
|
+
if (!drawing || !Array.isArray(drawing.elements)) throw new Error('Drawing data is unavailable.');
|
|
156
|
+
const restored = restore(
|
|
157
|
+
{ ...drawing, appState: sketchSettings(drawing.appState ?? {}) },
|
|
158
|
+
null,
|
|
159
|
+
null,
|
|
160
|
+
{ repairBindings: true }
|
|
161
|
+
);
|
|
162
|
+
await loadSceneFonts(restored.elements);
|
|
163
|
+
prepared = { format: 'excalidraw', restored };
|
|
164
|
+
} else {
|
|
165
|
+
throw new Error('Unsupported canvas preview format.');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const installWhenReady = () => {
|
|
169
|
+
if (cancelled) return;
|
|
170
|
+
try {
|
|
171
|
+
if (api.getAppState().isLoading) {
|
|
172
|
+
frame = requestAnimationFrame(installWhenReady);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
api.resetScene();
|
|
176
|
+
if (prepared.format === 'locus-map') {
|
|
177
|
+
modelRef.current = prepared.model;
|
|
178
|
+
const { input } = prepared;
|
|
179
|
+
api.updateScene({
|
|
180
|
+
elements: input.elements,
|
|
181
|
+
appState: {
|
|
182
|
+
...input.appState,
|
|
183
|
+
theme: 'light',
|
|
184
|
+
viewModeEnabled: true,
|
|
185
|
+
zenModeEnabled: true,
|
|
186
|
+
exportEmbedScene: false,
|
|
187
|
+
selectedElementIds: {},
|
|
188
|
+
selectedGroupIds: {},
|
|
189
|
+
activeTool: { type: 'selection', customType: null, locked: false, lastActiveTool: null },
|
|
190
|
+
},
|
|
191
|
+
captureUpdate: CaptureUpdateAction.NEVER,
|
|
192
|
+
});
|
|
193
|
+
if (Object.keys(input.files || {}).length > 0) {
|
|
194
|
+
installCatalogFiles(api, input);
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
modelRef.current = null;
|
|
198
|
+
const { restored } = prepared;
|
|
199
|
+
api.updateScene({
|
|
200
|
+
elements: restored.elements,
|
|
201
|
+
appState: {
|
|
202
|
+
...restored.appState,
|
|
203
|
+
theme: 'light',
|
|
204
|
+
viewModeEnabled: true,
|
|
205
|
+
zenModeEnabled: true,
|
|
206
|
+
exportEmbedScene: false,
|
|
207
|
+
selectedElementIds: {},
|
|
208
|
+
selectedGroupIds: {},
|
|
209
|
+
activeTool: { type: 'selection', customType: null, locked: false, lastActiveTool: null },
|
|
210
|
+
},
|
|
211
|
+
captureUpdate: CaptureUpdateAction.NEVER,
|
|
212
|
+
});
|
|
213
|
+
const files = restored.files ? Object.values(restored.files) : [];
|
|
214
|
+
if (files.length > 0) api.addFiles(files);
|
|
215
|
+
}
|
|
216
|
+
api.history.clear();
|
|
217
|
+
frame = requestAnimationFrame(() => {
|
|
218
|
+
if (cancelled) return;
|
|
219
|
+
try {
|
|
220
|
+
const next = computeFitCamera();
|
|
221
|
+
if (next) {
|
|
222
|
+
entryCameraRef.current = next;
|
|
223
|
+
api.updateScene({ appState: next, captureUpdate: CaptureUpdateAction.NEVER });
|
|
224
|
+
}
|
|
225
|
+
setLoading(false);
|
|
226
|
+
} catch (failure) {
|
|
227
|
+
if (!cancelled) {
|
|
228
|
+
setError(failure);
|
|
229
|
+
setLoading(false);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
} catch (failure) {
|
|
234
|
+
if (!cancelled) {
|
|
235
|
+
setError(failure);
|
|
236
|
+
setLoading(false);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
frame = requestAnimationFrame(installWhenReady);
|
|
242
|
+
} catch (failure) {
|
|
243
|
+
if (!cancelled) {
|
|
244
|
+
setError(failure);
|
|
245
|
+
setLoading(false);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
prepareAndInstall();
|
|
251
|
+
return () => {
|
|
252
|
+
cancelled = true;
|
|
253
|
+
resizeObserver.disconnect();
|
|
254
|
+
if (frame !== null) cancelAnimationFrame(frame);
|
|
255
|
+
};
|
|
256
|
+
}, [api, available, canvas, computeFitCamera]);
|
|
257
|
+
|
|
258
|
+
const handleStageKeyDown = event => {
|
|
259
|
+
if (event.key !== 'Escape' || event.defaultPrevented) return;
|
|
260
|
+
const state = api?.getAppState?.();
|
|
261
|
+
if (state?.openDialog || state?.openMenu || state?.openPopup
|
|
262
|
+
|| stageRef.current?.querySelector('.dropdown-menu, .Modal, .Dialog, .context-menu, [role="dialog"], [role="menu"]')) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const preview = event.currentTarget.closest('.lm-canvas-preview');
|
|
266
|
+
const barControl = preview?.querySelector('.lm-canvas-preview-bar .lm-canvas-fit:not(:disabled), .lm-canvas-preview-bar .lm-canvas-open-full:not(:disabled)')
|
|
267
|
+
?? preview?.querySelector('.lm-canvas-preview-bar button:not(:disabled)');
|
|
268
|
+
if (barControl instanceof HTMLElement) {
|
|
269
|
+
barControl.focus({ preventScroll: true });
|
|
270
|
+
} else {
|
|
271
|
+
const inspector = event.currentTarget.closest('.lm-inspector');
|
|
272
|
+
inspector?.querySelector('.lm-close')?.focus({ preventScroll: true });
|
|
273
|
+
}
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
event.stopPropagation();
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
return <section className="lm-canvas-preview" data-compact={compact || undefined} aria-label={`Canvas preview: ${displayTitle}`}>
|
|
279
|
+
<header className="lm-canvas-preview-bar">
|
|
280
|
+
<span className="lm-canvas-preview-title" title={displayTitle}>{displayTitle}</span>
|
|
281
|
+
<div className="lm-canvas-preview-actions">
|
|
282
|
+
{available && <button type="button" className="lm-canvas-fit" aria-label="Fit preview" title="Fit preview"
|
|
283
|
+
disabled={loading || Boolean(error)} onClick={fit}>Fit</button>}
|
|
284
|
+
{onOpenFull && <button type="button" className="lm-canvas-open-full" aria-label={`Open full canvas: ${displayTitle}`}
|
|
285
|
+
title={`Open full canvas: ${displayTitle}`} onClick={onOpenFull}><ControlIcon name="popout" /></button>}
|
|
286
|
+
</div>
|
|
287
|
+
</header>
|
|
288
|
+
{!available || error
|
|
289
|
+
? <p className="lm-canvas-preview-fallback" role="status">{error?.message || 'Canvas preview is unavailable.'}</p>
|
|
290
|
+
: <div ref={stageRef} tabIndex={-1} className="lm-canvas-preview-stage" onPointerEnter={refreshOffsets} onKeyDown={handleStageKeyDown} onWheel={event => event.stopPropagation()}>
|
|
291
|
+
<Excalidraw
|
|
292
|
+
excalidrawAPI={setApi}
|
|
293
|
+
viewModeEnabled={true}
|
|
294
|
+
zenModeEnabled={true}
|
|
295
|
+
aiEnabled={false}
|
|
296
|
+
validateEmbeddable={false}
|
|
297
|
+
onLinkOpen={(_element, event) => event.preventDefault()}
|
|
298
|
+
langCode="en"
|
|
299
|
+
UIOptions={PREVIEW_UI_OPTIONS}
|
|
300
|
+
/>
|
|
301
|
+
</div>}
|
|
302
|
+
</section>;
|
|
303
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
const key = 'locus-map.inspector.reading.
|
|
3
|
+
const key = 'locus-map.inspector.reading.v2';
|
|
4
|
+
const legacyKey = 'locus-map.inspector.reading.v1';
|
|
5
|
+
const legacyDefaults = { width: 640, height: 500, zoom: 100 };
|
|
4
6
|
const settings = {
|
|
5
|
-
width: { label: 'Width', unit: 'px', initial:
|
|
6
|
-
height: { label: 'Height', unit: 'px', initial:
|
|
7
|
+
width: { label: 'Width', unit: 'px', initial: 760, min: 280, max: 1280, step: 10 },
|
|
8
|
+
height: { label: 'Height', unit: 'px', initial: 720, min: 180, max: 1200, step: 10 },
|
|
7
9
|
zoom: { label: 'Text zoom', unit: '%', initial: 100, min: 75, max: 200, step: 5 },
|
|
8
10
|
};
|
|
9
11
|
|
|
@@ -12,24 +14,47 @@ function bounded(name, value) {
|
|
|
12
14
|
return Number.isFinite(value) ? Math.min(max, Math.max(min, Math.round(value))) : initial;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
function
|
|
17
|
+
function readStored(storageKey) {
|
|
16
18
|
let stored;
|
|
17
19
|
try {
|
|
18
|
-
const cookie = document.cookie.split('; ').find(entry => entry.startsWith(
|
|
19
|
-
if (cookie) stored = JSON.parse(decodeURIComponent(cookie.slice(
|
|
20
|
+
const cookie = document.cookie.split('; ').find(entry => entry.startsWith(storageKey + '='));
|
|
21
|
+
if (cookie) stored = JSON.parse(decodeURIComponent(cookie.slice(storageKey.length + 1)));
|
|
20
22
|
} catch { /* Browser privacy settings can disable cookies. */ }
|
|
21
23
|
if (!stored) {
|
|
22
|
-
try { stored = JSON.parse(window.localStorage.getItem(
|
|
24
|
+
try { stored = JSON.parse(window.localStorage.getItem(storageKey)); } catch { /* Storage is optional. */ }
|
|
25
|
+
}
|
|
26
|
+
return stored && typeof stored === 'object' ? stored : null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function resolveInspectorReadingPreferences(stored, legacy = null) {
|
|
30
|
+
if (stored && typeof stored === 'object') {
|
|
31
|
+
return Object.fromEntries(Object.keys(settings).map(name => [name, bounded(name, stored[name])]));
|
|
32
|
+
}
|
|
33
|
+
if (legacy && typeof legacy === 'object') {
|
|
34
|
+
return Object.fromEntries(Object.keys(settings).map(name => [
|
|
35
|
+
name,
|
|
36
|
+
Number.isFinite(legacy[name]) && legacy[name] !== legacyDefaults[name]
|
|
37
|
+
? bounded(name, legacy[name])
|
|
38
|
+
: settings[name].initial,
|
|
39
|
+
]));
|
|
23
40
|
}
|
|
24
|
-
return Object.fromEntries(Object.keys(settings).map(name => [name,
|
|
41
|
+
return Object.fromEntries(Object.keys(settings).map(name => [name, settings[name].initial]));
|
|
25
42
|
}
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
function readPreferences() {
|
|
45
|
+
return resolveInspectorReadingPreferences(readStored(key), readStored(legacyKey));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function useInspectorReadingSettings(cardRef, onResize) {
|
|
28
49
|
const [values, setValues] = useState(readPreferences);
|
|
50
|
+
const dirtyRef = useRef(false);
|
|
51
|
+
const onResizeRef = useRef(onResize);
|
|
52
|
+
onResizeRef.current = onResize;
|
|
29
53
|
useEffect(() => {
|
|
54
|
+
if (!dirtyRef.current) return;
|
|
30
55
|
const data = JSON.stringify(values);
|
|
31
56
|
// Host-only preferences survive the local viewer choosing a new port.
|
|
32
|
-
// Store only these three bounded display numbers.
|
|
57
|
+
// Store only these three bounded display numbers once customized.
|
|
33
58
|
try { document.cookie = key + '=' + encodeURIComponent(data) + '; Path=/; Max-Age=31536000; SameSite=Strict'; }
|
|
34
59
|
catch { /* A per-origin fallback remains available. */ }
|
|
35
60
|
try { window.localStorage.setItem(key, data); } catch { /* Keep the session controls usable. */ }
|
|
@@ -45,12 +70,24 @@ export function useInspectorReadingSettings(cardRef) {
|
|
|
45
70
|
size[name] = bounded(name, Number.parseFloat(card.style[name]));
|
|
46
71
|
card.style.removeProperty(name);
|
|
47
72
|
}
|
|
48
|
-
if (Object.keys(size).length)
|
|
73
|
+
if (Object.keys(size).length) {
|
|
74
|
+
dirtyRef.current = true;
|
|
75
|
+
onResizeRef.current?.(size);
|
|
76
|
+
setValues(previous => ({ ...previous, ...size }));
|
|
77
|
+
}
|
|
49
78
|
});
|
|
50
79
|
observer.observe(card, { attributes: true, attributeFilter: ['style'] });
|
|
51
80
|
return () => observer.disconnect();
|
|
52
81
|
}, [cardRef]);
|
|
53
|
-
return {
|
|
82
|
+
return {
|
|
83
|
+
values,
|
|
84
|
+
change: (name, value) => {
|
|
85
|
+
const next = bounded(name, value);
|
|
86
|
+
dirtyRef.current = true;
|
|
87
|
+
if (name === 'width' || name === 'height') onResizeRef.current?.({ [name]: next });
|
|
88
|
+
setValues(previous => ({ ...previous, [name]: next }));
|
|
89
|
+
},
|
|
90
|
+
};
|
|
54
91
|
}
|
|
55
92
|
|
|
56
93
|
export function InspectorReadingSettings({ values, change }) {
|
|
@@ -2,6 +2,20 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { hasHtmlOriginal, reportTags } from '../../contract/readingMaterials.js';
|
|
3
3
|
import { ReadingMarkdown } from './ReadingMarkdown.jsx';
|
|
4
4
|
|
|
5
|
+
export function StaticCanvasPreview({ title, onOpenFull, compact = false }) {
|
|
6
|
+
const displayTitle = title || 'Diagram preview';
|
|
7
|
+
return <section className="lm-canvas-preview" data-compact={compact || undefined} aria-label={`Canvas preview: ${displayTitle}`}>
|
|
8
|
+
<header className="lm-canvas-preview-bar">
|
|
9
|
+
<span className="lm-canvas-preview-title" title={displayTitle}>{displayTitle}</span>
|
|
10
|
+
{onOpenFull && <div className="lm-canvas-preview-actions">
|
|
11
|
+
<button type="button" className="lm-canvas-open-full" aria-label={`Open full canvas: ${displayTitle}`}
|
|
12
|
+
title={`Open full canvas: ${displayTitle}`} onClick={onOpenFull}>↗</button>
|
|
13
|
+
</div>}
|
|
14
|
+
</header>
|
|
15
|
+
<p className="lm-canvas-preview-fallback" role="status">Canvas preview is unavailable.</p>
|
|
16
|
+
</section>;
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
function reportElement(node, key, assetUrls) {
|
|
6
20
|
if (typeof node === 'string') return node;
|
|
7
21
|
if (node.tag === 'img') {
|
|
@@ -72,7 +86,7 @@ function MaterialSource({ file, id, binding }) {
|
|
|
72
86
|
</footer>;
|
|
73
87
|
}
|
|
74
88
|
|
|
75
|
-
function Material({ file, id, assetUrls, binding }) {
|
|
89
|
+
function Material({ file, id, assetUrls, binding, canvasAttachments, onOpenCanvas, PreviewComponent = StaticCanvasPreview }) {
|
|
76
90
|
const source = <MaterialSource file={file} id={id} binding={binding} />;
|
|
77
91
|
const href = hasHtmlOriginal(file) && reportAddress(binding?.originalReports?.[id]);
|
|
78
92
|
const original = href && <a className="lm-open-original" href={href} target="_blank" rel="noopener noreferrer">Open full original HTML ↗</a>;
|
|
@@ -80,6 +94,18 @@ function Material({ file, id, assetUrls, binding }) {
|
|
|
80
94
|
if (file.kind === 'original') return <>
|
|
81
95
|
<p>This document is available as a separate original.{unavailable} {original}</p>{source}
|
|
82
96
|
</>;
|
|
97
|
+
if (file.kind === 'canvas') {
|
|
98
|
+
const canvas = canvasAttachments?.get?.(file.canvasId) ?? null;
|
|
99
|
+
const canvasTitle = file.title || file.name;
|
|
100
|
+
return <article className="lm-reading-canvas" aria-label={canvasTitle}>
|
|
101
|
+
<PreviewComponent
|
|
102
|
+
canvas={canvas}
|
|
103
|
+
title={canvasTitle}
|
|
104
|
+
onOpenFull={onOpenCanvas ? () => onOpenCanvas(file.canvasId, file) : undefined}
|
|
105
|
+
/>
|
|
106
|
+
{source}
|
|
107
|
+
</article>;
|
|
108
|
+
}
|
|
83
109
|
return <article aria-label={file.name}>
|
|
84
110
|
{file.kind === 'report' && <p className="lm-material-source">Static HTML view. Interactive content and the original layout are omitted.{unavailable} {original}</p>}
|
|
85
111
|
{file.kind === 'markdown'
|
|
@@ -97,15 +123,17 @@ function SupportingMaterial({ id, title, initiallyOpen, children }) {
|
|
|
97
123
|
</details>;
|
|
98
124
|
}
|
|
99
125
|
|
|
100
|
-
export function ReadingFiles({ reading, elementId, assetUrls, originalBinding, openMaterials = [] }) {
|
|
126
|
+
export function ReadingFiles({ reading, elementId, assetUrls, originalBinding, openMaterials = [], canvasAttachments, onOpenCanvas, PreviewComponent = StaticCanvasPreview }) {
|
|
101
127
|
const ids = reading?.items[elementId];
|
|
102
128
|
if (!ids?.length) return null;
|
|
103
129
|
return <section className="lm-card-section lm-reading-files" aria-label="Reading materials">
|
|
104
130
|
{ids.map((id, index) => {
|
|
105
131
|
const file = reading.files[id];
|
|
106
|
-
const material = <Material file={file} id={id} assetUrls={assetUrls} binding={originalBinding}
|
|
132
|
+
const material = <Material file={file} id={id} assetUrls={assetUrls} binding={originalBinding}
|
|
133
|
+
canvasAttachments={canvasAttachments} onOpenCanvas={onOpenCanvas} PreviewComponent={PreviewComponent} />;
|
|
134
|
+
const summaryTitle = file.kind === 'canvas' ? (file.title || file.sourcePath || file.name) : (file.sourcePath || file.name);
|
|
107
135
|
return index === 0 ? <section key={id} aria-label="Primary document">{material}</section>
|
|
108
|
-
: <SupportingMaterial key={id} id={id} title={
|
|
136
|
+
: <SupportingMaterial key={id} id={id} title={summaryTitle} initiallyOpen={openMaterials.includes(id)}>{material}</SupportingMaterial>;
|
|
109
137
|
})}
|
|
110
138
|
</section>;
|
|
111
139
|
}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
@import 'katex/dist/katex.min.css';
|
|
2
2
|
|
|
3
3
|
/* Deliberately keep the evidence card opaque/light in both native themes. */
|
|
4
|
-
.lm-inspector { position: absolute; z-index: 4; top: 16px; left: 50%; transform: translateX(-50%); width: min(var(--lm-inspector-width,
|
|
4
|
+
.lm-inspector { position: absolute; z-index: 4; top: 16px; left: 50%; transform: translateX(-50%); width: min(var(--lm-inspector-width, 760px), calc(100% - 24px)); min-width: min(280px, var(--lm-inspector-width, 100%), var(--lm-inspector-max-width, 100%), calc(100% - 24px)); height: min(var(--lm-inspector-height, 720px), calc(100% - 24px)); min-height: min(180px, var(--lm-inspector-height, 100%), var(--lm-inspector-max-height, 100%), calc(100% - 24px)); max-width: min(var(--lm-inspector-max-width, 100%), calc(100% - 24px)); max-height: min(var(--lm-inspector-max-height, 100%), calc(100% - 24px)); resize: both; overflow: auto; overscroll-behavior: contain; padding: 16px 18px; background: #fff; opacity: 1; color: var(--lm-text); color-scheme: light; border: 0; border-radius: 10px; box-shadow: 0 3px 18px rgb(0 0 0 / 12%); }
|
|
5
5
|
.lm-inspector[data-parked] { visibility: hidden; }
|
|
6
6
|
.lm-inspector-return { position: absolute; z-index: 5; top: 8px; right: 8px; max-width: calc(100% - 16px); min-height: 32px; padding: 4px 10px; border: 1px solid var(--lm-border); border-radius: 6px; background: white; color: var(--lm-text); cursor: pointer; }
|
|
7
7
|
/* Keep the focused control mounted until focus returns to the visible header. */
|
|
8
8
|
.lm-inspector-return:not([data-needed]):not(:focus) { display: none; }
|
|
9
9
|
.lm-inspector-return:focus-visible { outline: 3px solid #2865c7; }
|
|
10
|
-
|
|
10
|
+
/* Minimalist quiet chrome: borderless circular icon buttons and a soft Path pill. */
|
|
11
|
+
.lm-inspector-top { cursor: grab; touch-action: none; user-select: none; position: sticky; z-index: 1; top: -16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "back title actions close"; align-items: center; gap: 6px; margin: -16px -18px 8px; padding: 8px 10px 6px; background: #fff; font-size: 11px; line-height: 12px; color: var(--lm-muted); }
|
|
11
12
|
.lm-inspector-top:focus-visible { outline: 3px solid #2865c7; outline-offset: -3px; }
|
|
12
13
|
.lm-inspector[data-dragging] .lm-inspector-top { cursor: grabbing; }
|
|
13
|
-
|
|
14
|
-
.lm-inspector-top {
|
|
15
|
-
.lm-inspector-top button {
|
|
14
|
+
.lm-inspector-top .lm-inspector-title { grid-area: title; margin: 0; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--lm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
15
|
+
.lm-inspector .lm-inspector-top button { border: 0; background: transparent; color: #5b6570; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease; }
|
|
16
|
+
.lm-inspector .lm-inspector-top button:hover:not(:disabled) { background: rgb(15 23 42 / 7%); color: #0f172a; }
|
|
17
|
+
.lm-inspector .lm-inspector-top button:disabled { opacity: .3; }
|
|
18
|
+
.lm-inspector .lm-inspector-top button:focus-visible { outline: 2px solid #2865c7; outline-offset: 1px; }
|
|
19
|
+
.lm-inspector-top svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
|
|
20
|
+
.lm-inspector .lm-inspector-top :is(.lm-back, .lm-settings-toggle, .lm-close) { width: 28px; height: 28px; min-width: 28px; min-height: 28px; border-radius: 999px; }
|
|
16
21
|
.lm-inspector-top .lm-back { grid-area: back; }
|
|
17
|
-
.lm-inspector-controls { grid-area: actions; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
|
|
18
|
-
.lm-inspector-top .lm-settings-toggle {
|
|
22
|
+
.lm-inspector-controls { grid-area: actions; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
|
|
23
|
+
.lm-inspector .lm-inspector-top .lm-settings-toggle[aria-expanded="true"] { background: rgb(15 23 42 / 9%); color: #0f172a; }
|
|
19
24
|
.lm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
20
|
-
.lm-inspector .lm-close { grid-area: close;
|
|
25
|
+
.lm-inspector .lm-close { grid-area: close; }
|
|
21
26
|
.lm-inspector-content { font-size: 14px; line-height: 21px; }
|
|
22
|
-
.lm-inspector h2 { margin: 0 0 3px; font-size: 20px; line-height: 26px; font-weight: 600; white-space: pre-line; overflow-wrap: break-word; }
|
|
23
|
-
.lm-inspector h3 { margin: 0 0 6px; font-size: 12px; line-height: 17px; text-transform: none; letter-spacing: 0; }
|
|
27
|
+
:is(.lm-inspector, .lm-docked-inspector) h2 { margin: 0 0 3px; font-size: 20px; line-height: 26px; font-weight: 600; white-space: pre-line; overflow-wrap: break-word; }
|
|
28
|
+
:is(.lm-inspector, .lm-docked-inspector) h3 { margin: 0 0 6px; font-size: 12px; line-height: 17px; text-transform: none; letter-spacing: 0; }
|
|
24
29
|
.lm-card-section { margin-top: 14px; }
|
|
25
30
|
.lm-citation-state { margin: 4px 0 8px; color: #80511c; font-size: 12px; }
|
|
26
31
|
.lm-cited-sources ul { margin: 0; padding-left: 18px; }
|
|
@@ -73,7 +78,7 @@
|
|
|
73
78
|
.lm-source-group-heading code { font-size: 11px; }
|
|
74
79
|
.lm-source-reference > a, .lm-source-reference > span { font-size: 12px; line-height: 17px; font-weight: bold; overflow-wrap: anywhere; }
|
|
75
80
|
.lm-source-reference .lm-source-story { margin: 0; color: var(--lm-muted); font-size: 12px; line-height: 17px; white-space: pre-wrap; }
|
|
76
|
-
.lm-inspector .lm-source-toggle { min-height: 34px; margin-top: 5px; padding: 4px 0; border: 0; background: transparent; color: var(--lm-accent); font-size: 11px; line-height: 12px; font-weight: 700; }
|
|
81
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-source-toggle { min-height: 34px; margin-top: 5px; padding: 4px 0; border: 0; background: transparent; color: var(--lm-accent); font-size: 11px; line-height: 12px; font-weight: 700; }
|
|
77
82
|
.lm-source-details { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--lm-border); }
|
|
78
83
|
.lm-source-details > summary { box-sizing: border-box; min-height: 34px; padding: 8px 0; color: var(--lm-accent); font-size: 11px; line-height: 12px; font-weight: 700; }
|
|
79
84
|
.lm-source-provenance { margin: 5px 0 10px; }
|
|
@@ -81,15 +86,16 @@
|
|
|
81
86
|
.lm-related-links li { font-size: 14px; line-height: 21px; }
|
|
82
87
|
.lm-related-links li + li { margin-top: 3px; }
|
|
83
88
|
.lm-evidence-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--lm-border); }
|
|
84
|
-
.lm-inspector summary { cursor: pointer; }
|
|
85
|
-
.lm-inspector a { color: var(--lm-accent); overflow-wrap: anywhere; }
|
|
89
|
+
:is(.lm-inspector, .lm-docked-inspector) summary { cursor: pointer; }
|
|
90
|
+
:is(.lm-inspector, .lm-docked-inspector) a { color: var(--lm-accent); overflow-wrap: anywhere; }
|
|
86
91
|
|
|
87
92
|
.lm-body li + li { margin-top: 7px; }
|
|
88
93
|
.lm-proposal-note { padding: 9px 11px; background: #fff9e8; color: #664d14; border-radius: 6px; font-size: 12px; line-height: 18px; }
|
|
89
|
-
@container (max-width: 600px) { .lm-inspector { padding: 12px; top: 12px;
|
|
94
|
+
@container (max-width: 600px) { .lm-inspector { padding: 12px; top: 12px; min-width: 0; } .lm-inspector-top { top: -12px; margin: -12px -12px 6px; padding: 7px 10px 5px; cursor: grab; } .lm-metadata, .lm-endpoints > div { grid-template-columns: minmax(0, 1fr); gap: 6px 9px; } }
|
|
95
|
+
@container (max-width: 380px) { .lm-inspector { resize: none; } }
|
|
90
96
|
|
|
91
|
-
.lm-inspector .lm-proposal-source { padding: 0; border: 0; background: transparent; color: var(--lm-accent); font: inherit; text-decoration: underline; }
|
|
92
|
-
.lm-inspector .lm-details-action { width: auto; min-height: 30px; padding: 4px 0; border: 0; background: transparent; color: var(--lm-accent); text-align: left; font-size: 13px; font-weight: 500; }
|
|
97
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-proposal-source { padding: 0; border: 0; background: transparent; color: var(--lm-accent); font: inherit; text-decoration: underline; }
|
|
98
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-details-action { width: auto; min-height: 30px; padding: 4px 0; border: 0; background: transparent; color: var(--lm-accent); text-align: left; font-size: 13px; font-weight: 500; }
|
|
93
99
|
.lm-condition { padding: 10px 12px; border: 1px solid var(--lm-border); border-radius: 10px; background: #f5f5f8; }
|
|
94
100
|
.lm-condition h3 { color: var(--lm-muted); font-weight: 400; }
|
|
95
101
|
.lm-condition p { margin: 0; font-size: 14px; line-height: 1.45; font-style: italic; }
|
|
@@ -97,12 +103,12 @@
|
|
|
97
103
|
.lm-connections, .lm-evidence-section { border-top: 1px solid var(--lm-border); margin-top: 8px; }
|
|
98
104
|
.lm-connections > summary, .lm-evidence-section > summary { padding: 6px 0; cursor: pointer; font-size: 12px; line-height: 16px; font-weight: 600; }
|
|
99
105
|
.lm-connections .lm-relations li + li { margin-top: 2px; }
|
|
100
|
-
.lm-inspector .lm-connections .lm-relations button { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: baseline; min-height: 28px; padding: 3px 5px; margin: 0; border: 0; }
|
|
106
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-connections .lm-relations button { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: baseline; min-height: 28px; padding: 3px 5px; margin: 0; border: 0; }
|
|
101
107
|
.lm-connections .lm-relation-direction, .lm-connections .lm-relation-phrase, .lm-connections .lm-relation-action, .lm-connections .lm-relation-when { font-size: 12px; line-height: 16px; }
|
|
102
108
|
.lm-connections .lm-relation-direction { color: var(--lm-muted); }
|
|
103
109
|
.lm-connections .lm-relation-when { grid-column: 2; }
|
|
104
|
-
.lm-inspector .lm-relations button { padding: 7px 8px; margin: 0 -8px; border-radius: 8px; }
|
|
105
|
-
.lm-inspector .lm-relations button:hover { background: var(--lm-accent-soft); }
|
|
110
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-relations button { padding: 7px 8px; margin: 0 -8px; border-radius: 8px; }
|
|
111
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-relations button:hover { background: var(--lm-accent-soft); }
|
|
106
112
|
|
|
107
113
|
.lm-relation-phrase { display: block; font-size: 14px; line-height: 21px; }
|
|
108
114
|
.lm-relation-phrase .lm-relation-action { display: inline; }
|
|
@@ -146,7 +152,14 @@
|
|
|
146
152
|
.lm-source-observation code { overflow-wrap: anywhere; }
|
|
147
153
|
.lm-source-warning { padding: 10px 12px; border-radius: 8px; background: #fff8ed; line-height: 1.5; }
|
|
148
154
|
|
|
149
|
-
|
|
155
|
+
/* Keep Excalidraw preview stages unzoomed (zoom: 1) so pointer hit coordinates stay exact. */
|
|
156
|
+
.lm-inspector-content:not(:has(.lm-canvas-preview)) { zoom: var(--lm-inspector-zoom, 1); }
|
|
157
|
+
.lm-inspector-content:has(.lm-canvas-preview) > :not(.lm-reading-files):not(.lm-details-section),
|
|
158
|
+
.lm-inspector-content:has(.lm-canvas-preview) .lm-reading-files > :not(:has(.lm-canvas-preview)),
|
|
159
|
+
.lm-inspector-content:has(.lm-canvas-preview) .lm-reading-files > section:has(.lm-canvas-preview) > :not(.lm-canvas-preview):not(:has(.lm-canvas-preview)),
|
|
160
|
+
.lm-inspector-content:has(.lm-canvas-preview) .lm-reading-files > details:has(.lm-canvas-preview) > :not(.lm-canvas-preview):not(:has(.lm-canvas-preview)),
|
|
161
|
+
.lm-inspector-content:has(.lm-canvas-preview) .lm-reading-files article:has(.lm-canvas-preview) > :not(.lm-canvas-preview),
|
|
162
|
+
.lm-inspector-content:has(.lm-canvas-preview) .lm-details-section > :not(.lm-canvas-preview) { zoom: var(--lm-inspector-zoom, 1); }
|
|
150
163
|
.lm-reading-settings { min-width: 0; margin: 12px 0; border: 1px solid var(--lm-border); border-radius: 6px; }
|
|
151
164
|
.lm-reading-settings label { display: grid; grid-template-columns: 5em minmax(52px, 1fr) 4.5em; gap: 6px; align-items: center; }
|
|
152
165
|
.lm-reading-settings input { width: 100%; min-width: 0; }
|
|
@@ -159,21 +172,25 @@
|
|
|
159
172
|
.lm-reading-report { overflow-x: auto; line-height: 1.5; }
|
|
160
173
|
.lm-reading-report table { border-collapse: collapse; margin-block: .75em; }
|
|
161
174
|
.lm-reading-report th, .lm-reading-report td { padding: .3em .6em; border: 1px solid #c6cbd2; }
|
|
162
|
-
.lm-inspector-top .lm-path-actions { display: flex; align-items: center; gap:
|
|
175
|
+
.lm-inspector .lm-inspector-top .lm-path-actions { display: inline-flex; align-items: center; gap: 1px; margin: 0; padding: 2px; border-radius: 7px; background: #f1f5f9; }
|
|
176
|
+
.lm-inspector .lm-inspector-top .lm-path-label { padding: 0 6px; font-size: 10.5px; font-weight: 500; color: #64748b; user-select: none; }
|
|
177
|
+
.lm-inspector .lm-inspector-top .lm-path-actions button { width: auto; min-width: 0; height: 22px; min-height: 22px; padding: 0 8px; border-radius: 5px; color: #334155; font-size: 11.5px; font-weight: 500; }
|
|
178
|
+
.lm-inspector .lm-inspector-top .lm-path-actions button:is(:hover, :focus-visible):not(:disabled) { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgb(15 23 42 / 10%); }
|
|
179
|
+
.lm-inspector .lm-inspector-top .lm-details-action { height: 26px; min-height: 26px; padding: 0 8px; border-radius: 6px; font-size: 12px; }
|
|
163
180
|
.lm-material-source { font-size: 12px; line-height: 1.5; color: var(--lm-muted); margin: 8px 0; }
|
|
164
181
|
.lm-material-source code, .lm-reading-files summary { overflow-wrap: anywhere; }
|
|
165
182
|
.lm-material-source button { font: inherit; }
|
|
166
183
|
|
|
167
184
|
.lm-inspector { container-type: inline-size; }
|
|
168
|
-
@container (max-width:
|
|
169
|
-
.lm-inspector-top { grid-template-columns: auto minmax(
|
|
170
|
-
.lm-inspector-controls { justify-self:
|
|
185
|
+
@container (max-width: 420px) {
|
|
186
|
+
.lm-inspector-top { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back title close" "actions actions actions"; row-gap: 4px; }
|
|
187
|
+
.lm-inspector-controls { justify-self: end; }
|
|
171
188
|
}
|
|
172
189
|
.lm-material-source small { display: block; font-size: inherit; }
|
|
173
190
|
|
|
174
191
|
.lm-source-path { display: flex; align-items: center; gap: 3px; }
|
|
175
192
|
.lm-source-path code { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
176
|
-
.lm-inspector .lm-source-path :is(button, a) { position: relative; flex: none; display: grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 3px; border: 0; background: transparent; color: inherit; cursor: pointer; }
|
|
193
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-source-path :is(button, a) { position: relative; flex: none; display: grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 3px; border: 0; background: transparent; color: inherit; cursor: pointer; }
|
|
177
194
|
.lm-source-path [aria-disabled="true"] { opacity: .6; cursor: default; }
|
|
178
195
|
.lm-source-path svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
|
|
179
196
|
.lm-source-path :is(button, a) span { display: none; position: absolute; z-index: 2; bottom: 100%; right: 0; padding: 2px 6px; white-space: nowrap; background: var(--lm-text); color: var(--lm-surface); border-radius: 4px; }
|
|
@@ -187,4 +204,26 @@
|
|
|
187
204
|
.lm-reading-files table { border-collapse: collapse; }
|
|
188
205
|
.lm-reading-files :is(th, td) { border: 1px solid var(--lm-border); padding: .3em .6em; }
|
|
189
206
|
.lm-markdown-source pre { overflow-x: auto; }
|
|
190
|
-
.lm-inspector .lm-open-original { display: inline-block; font-size: 14px; padding-block: 4px; }
|
|
207
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-open-original { display: inline-block; font-size: 14px; padding-block: 4px; }
|
|
208
|
+
|
|
209
|
+
.lm-canvas-preview { zoom: 1; margin: 8px 0; border: 1px solid var(--lm-border); border-radius: 8px; overflow: hidden; background: #fff; }
|
|
210
|
+
.lm-canvas-preview-bar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--lm-border); background: #f8fafc; font-size: 12px; line-height: 16px; color: var(--lm-text); }
|
|
211
|
+
.lm-canvas-preview-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
212
|
+
.lm-canvas-preview-actions { display: inline-flex; align-items: center; gap: 4px; flex: none; }
|
|
213
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-canvas-preview-bar button { display: inline-flex; align-items: center; justify-content: center; height: 24px; min-height: 24px; padding: 0 7px; border: 1px solid var(--lm-border); border-radius: 5px; background: #fff; color: #334155; font-size: 11.5px; font-weight: 500; line-height: 1; }
|
|
214
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-canvas-preview-bar button:hover:not(:disabled) { background: var(--lm-accent-soft); color: #0f172a; }
|
|
215
|
+
:is(.lm-inspector, .lm-docked-inspector) .lm-canvas-preview-bar .lm-canvas-open-full { width: 24px; padding: 0; }
|
|
216
|
+
.lm-canvas-open-full svg { width: 14px; height: 14px; }
|
|
217
|
+
.lm-canvas-preview-stage { position: relative; width: 100%; height: 268px; overflow: hidden; background: #fff; isolation: isolate; }
|
|
218
|
+
.lm-canvas-preview[data-compact] .lm-canvas-preview-stage { height: 210px; }
|
|
219
|
+
.lm-canvas-preview-fallback { margin: 0; padding: 14px 12px; color: var(--lm-muted); font-size: 12px; line-height: 1.5; }
|
|
220
|
+
.lm-canvas-preview-stage .excalidraw .App-bottom-bar,
|
|
221
|
+
.lm-canvas-preview-stage .excalidraw .App-menu_bottom,
|
|
222
|
+
.lm-canvas-preview-stage .excalidraw .App-menu_top,
|
|
223
|
+
.lm-canvas-preview-stage .excalidraw .zoom-actions,
|
|
224
|
+
.lm-canvas-preview-stage .excalidraw .footer-center,
|
|
225
|
+
.lm-canvas-preview-stage .excalidraw .HelpDialog,
|
|
226
|
+
.lm-canvas-preview-stage .excalidraw .layer-ui__wrapper__footer,
|
|
227
|
+
.lm-canvas-preview-stage .excalidraw .layer-ui__wrapper__top-right,
|
|
228
|
+
.lm-canvas-preview-stage .excalidraw .main-menu-trigger,
|
|
229
|
+
.lm-canvas-preview-stage .excalidraw .HintViewer { display: none !important; }
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
.lm-viewer[data-mode="view"] .App-toolbar-content > .dropdown-menu--mobile { left: auto; right: 0; width: min(260px, calc(100cqw - 28px)); }
|
|
41
41
|
/* View links and fold handles sit above the editor canvas, including its
|
|
42
42
|
native mobile menu. Suspend those hotspots until the menu closes. */
|
|
43
|
-
.lm-viewer-stage:has(.dropdown-menu--mobile) > .lm-drilldowns { visibility: hidden; }
|
|
43
|
+
.lm-viewer-stage:has(.dropdown-menu--mobile) > :is(.lm-drilldowns, .lm-drilldown-tooltips) { visibility: hidden; }
|
|
44
44
|
@container (max-width: 210px) {
|
|
45
45
|
.lm-viewer[data-mode="view"] .App-bottom-bar > .Island:has(.App-toolbar-content > .main-menu-trigger) { margin-bottom: 74px; }
|
|
46
46
|
}
|