allyhub 0.20.0 → 0.22.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/dist/commands/cloud-tools.js +5 -5
- package/dist/commands/export.js +1 -1
- package/dist/commands/frames.js +8 -8
- package/dist/commands/index.js +1 -1
- package/dist/commands/run.js +2 -0
- package/dist/commands.json +1 -1
- package/dist/help.js +3 -3
- package/dist/main.js +4 -4
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/elements.js +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/palette.js +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/blocks/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/migrate.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/call.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +2 -1
- package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/blocks.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -5
- package/dist/node_modules/@allyhub/doc/dist/shapes.js +2 -2
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +3 -3
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +9 -1
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +151 -151
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +173 -173
- package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +1 -2
- package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +2 -0
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +106 -101
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +26 -1
- package/dist/node_modules/@allyhub/formats/dist/tolerant.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
- package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
- package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
- package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
- package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
- package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/dist/index.js +8 -8
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/tiles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +2 -2
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +15 -14
- package/dist/run-register.js +2 -0
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-BkVJMd53.js → abnfDiagram-WEYOIA3C-D6qI3rai.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-C6rnaynZ.js → architecture-WOLXFQ4H-B3V6ggq8.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-D3vrh8LK.js → architectureDiagram-ZHVYKT53-IauNyxXn.js} +1 -1
- package/editor-web/assets/article-BHjKp5We.js +3 -0
- package/editor-web/assets/article-BlNKv1Cn.js +7 -0
- package/editor-web/assets/bar-button-CJmpgNg4.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-BKngt8H7.js → blockDiagram-RJAE7QA3-yXhlfxbH.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-j7sUELqF.js → c4Diagram-XDPPPE54-B-anrhvt.js} +1 -1
- package/editor-web/assets/{calc-worker-Cr4a0xmt.js → calc-worker-BpAgQE9E.js} +3 -3
- package/editor-web/assets/channel-Bhb-_8v6.js +1 -0
- package/editor-web/assets/chip-pNQlYa2W.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-BXa-uRSi.js → chunk-2E7WHVMD-QPOni4XB.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-B3ntcsZN.js → chunk-4EMNKR2T-DG1FCRRI.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-AMvnFwUg.js → chunk-55XCU76K-mKuMXpnC.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-BA6esfFu.js → chunk-7S6XSTFO-CgZAazgt.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BT_vANXs.js → chunk-AQDTSKZB-BRU84phF.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-DoUgmzGB.js → chunk-DSNLSHJZ-zku9oeG3.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-DtnIrCZb.js → chunk-HAGFOTED-CaUkBv_0.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-BlPwQx3_.js → chunk-HNE4Q36P-BQz4ZCJf.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-D2r7jp2r.js → chunk-NQOKRVIF-CHVBEDkg.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-Cmc0_F5o.js → chunk-UHW7PFBP-DrYeJo1e.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-nJSMqAr0.js → chunk-VQ5W62QI-D8ToVCUe.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-Btq2nbF6.js → chunk-WQQL4CDK-DZ0tyi9F.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-DTbcCoGt.js → chunk-YZO67HFG-BLe7PXER.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-DVwkg-2N.js → chunk-ZAUX2LTX-ByaeSIre.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-BV39jOOE.js → chunk-ZCHMQSOR-DdMJr_t5.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Cj74-fhM.js → classDiagram-v2-4MYWR3UA-DDpq7fFC.js} +1 -1
- package/editor-web/assets/collaborator-CbTacvkB.js +1 -0
- package/editor-web/assets/color-picker-CDeICDN5.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-C0CkiipV.js → cynefin-EF2NZ3EQ-CMivy2fr.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-hdsnJ4cI.js → cynefinDiagram-WF24UDRP-GtxT_9wW.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-CC7WSgaK.js → dagre-NK4GIZVX-Bn1O2Hjl.js} +1 -1
- package/editor-web/assets/deck-Cohd-G5m.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-DmaVm13J.js → diagram-CBK3MWTC-W715PWZw.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-De8jqp7b.js → diagram-I5XIIV2D-BKObZPn2.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-B5pBTulX.js → diagram-ODIL2UCW-UtQxEPoW.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BYsXg5_w.js → diagram-PFBEJUXE-CpLGEK-k.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-DZ8f6bYe.js → diagram-RJA3I4VV-DGyMXoHb.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-qXHUsauD.js → diagram-TYUNFSNR-Dy_Ewr8V.js} +1 -1
- package/editor-web/assets/dist-0I0Obj60.js +19 -0
- package/editor-web/assets/dist-6ugUm4dS.js +6 -0
- package/editor-web/assets/dist-B0rUvCi2.js +1 -0
- package/editor-web/assets/{dist-DAhe-kFC.js → dist-B8_6sJ_V.js} +1 -1
- package/editor-web/assets/dist-CKD_paj_.js +1 -0
- package/editor-web/assets/dist-CKUW5NzS.js +3 -0
- package/editor-web/assets/dist-Ca9Gsuu0.js +24 -0
- package/editor-web/assets/dist-Cc8v9lfc.js +1 -0
- package/editor-web/assets/dist-CynBNzYv.js +1 -0
- package/editor-web/assets/{dist-9kuRjUTN.js → dist-D7M5YTq2.js} +6 -6
- package/editor-web/assets/dist-D9tsFc2N.js +16 -0
- package/editor-web/assets/dist-DNMKDcLg.js +35 -0
- package/editor-web/assets/dist-Doj7_HUI.js +547 -0
- package/editor-web/assets/dist-DptBQzJR.js +1 -0
- package/editor-web/assets/dist-DzKB210A.js +5 -0
- package/editor-web/assets/{dist-B3rd02Cg.js → dist-H9rTuNhb.js} +6 -6
- package/editor-web/assets/{dist-DA72-4WB.js → dist-QLXI7XGS.js} +1 -1
- package/editor-web/assets/dist-RyGsFHE0.js +4 -0
- package/editor-web/assets/dist-oeSWr2LE.js +19 -0
- package/editor-web/assets/dist-wD_hHJ8_.js +19 -0
- package/editor-web/assets/{docx-draw-L54blreB.js → docx-draw-B5cM77hc.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-B7-IfVI-.js → ebnfDiagram-V4P3TTPT-GPYcx6dU.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Gj_WaeBn.js → elk-QONTBCTQ-Bi0r4UFM.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-BDF6Qoqx.js → erDiagram-KYQIGQAA-DrOSrnci.js} +1 -1
- package/editor-web/assets/esm-jIPnpbBD.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-elxVXXEe.js → eventmodeling-K75KTNOO-Dw-MjgUb.js} +1 -1
- package/editor-web/assets/eye-DwfE1USj.js +1 -0
- package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CEogW3jW.js → ganttDiagram-R7GPNTJY-Bwe8cQqi.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-Bh9cRWFa.js → gitGraph-VSP46ZUC-DsAcAKP0.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BQAvdM_V.js → gitGraphDiagram-PDYL7XHY-aObRwdru.js} +1 -1
- package/editor-web/assets/hint-F4fIBnVU.js +1 -0
- package/editor-web/assets/index-Cah2zchD.css +2 -0
- package/editor-web/assets/index-D-MNVykg.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-CdPrqere.js → info-OHQRW6UA-DBPN8JFr.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-uwIMeP44.js → infoDiagram-MVDRKAX5-Bx26Hq7M.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-rtfvqK7E.js → ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-mmhfIyVG.js → journeyDiagram-BOSHW7O7-B5g4W2Dx.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-Fe7jBsi-.js → kanban-definition-FNSA4HC5-U8YNlxN7.js} +1 -1
- package/editor-web/assets/layout-CuWN7_3k.js +1 -0
- package/editor-web/assets/{mermaid-parser.core-BxOSjBH9.js → mermaid-parser.core-DYLQlYDo.js} +3 -3
- package/editor-web/assets/{mermaid.core-BOln9YdH.js → mermaid.core-qNJmZ0b4.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-M3Q1LOtO.js → mindmap-definition-6OY57UG3-CI5aBWbK.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-Dbb0TUG6.js → packet-JDAUHWVQ-BBclMGlJ.js} +1 -1
- package/editor-web/assets/palette-DchDLJj6.js +1 -0
- package/editor-web/assets/panes-BShVq38A.js +3 -0
- package/editor-web/assets/{pegDiagram-ECIUJNBX-BZMRpSFC.js → pegDiagram-ECIUJNBX-B3pljPTu.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-Ctm9XdKp.js → pie-XZMESJXO-B7WzimHm.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-cGbs5ZTl.js → pieDiagram-GNMPY74T-tM1Da50-.js} +1 -1
- package/editor-web/assets/progress-D1Uv3d1b.js +6 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-BUe_zsxT.js → quadrantDiagram-D57K4MC3-BEq_Shj9.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-CCmKtqLs.js → radar-ABXABTNO-v2jJSW5T.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-k-yhjhjA.js → railroad-I3PHUGI6-6W3Z4F8Y.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-B-PvntB3.js → railroad-abnf-LNEFI6M7-DxIN7Zrt.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Ds2rua1h.js → railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-jNZ2wEp2.js → railroad-peg-JR7BVNR7-i2LjEP5t.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-CTqSQ15w.js → railroadDiagram-Y72NRBL7-DhsyVKbG.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-CUblhR5M.js → requirementDiagram-EQYSW5RA-Du2k7i1E.js} +1 -1
- package/editor-web/assets/ribbon-tabs-Bxuj_hct.js +1 -0
- package/editor-web/assets/row-DqS4-5b1.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-nSz6zDX3.js → sankeyDiagram-SY24JHO5-CDnRMu7J.js} +1 -1
- package/editor-web/assets/schemas-CnlOL0u4.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DxTpOYuo.js → sequenceDiagram-BLEHNHQU-BUXBhWYW.js} +1 -1
- package/editor-web/assets/{session-BhClkDyr.js → session--OJYv_B7.js} +1 -1
- package/editor-web/assets/{snapshots-DwGHDN3t.js → snapshots-DYooVfOx.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C3e14iHY.js → stateDiagram-v2-A6IESKWZ-Enb8LZUA.js} +1 -1
- package/editor-web/assets/surface-BUoi7cmR.js +1 -0
- package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-DPPdzNzu.js → swimlanes-B3ENRKFQ-pnpjgTrl.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +8 -0
- package/editor-web/assets/switch-b6GCy_ix.js +1 -0
- package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
- package/editor-web/assets/tablet-C6oePHEW.js +1 -0
- package/editor-web/assets/textarea-Bu6uPEqT.js +1 -0
- package/editor-web/assets/themes-D_ISkWVz.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-DRTJ1_Er.js → timeline-definition-JXYKGLGB-C4pR18kd.js} +1 -1
- package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
- package/editor-web/assets/{treeView-D4JQ5SDB-BYJ_m-i5.js → treeView-D4JQ5SDB-kzNGeAv6.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-BcU6I6Rg.js → treemap-SAJKECNS-Buhb5wzt.js} +1 -1
- package/editor-web/assets/updating-Cbxw83_O.js +1 -0
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-YV92pS4o.js → usecaseDiagram-WPOLBNNX-CL-xLQWl.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-oAvfHZtf.js → vennDiagram-Q3Y3IDCW-bwsyCcdK.js} +1 -1
- package/editor-web/assets/{video-SJvDRCJK.js → video-8MxWX9f5.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-BLNiqxtt.js → wardley-7MLQ67FV-DXsLgedI.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-SppgC6xW.js → wardleyDiagram-IVAIDKWA-Cn0ph953.js} +1 -1
- package/editor-web/assets/{words-BUlNNuH2.js → words-B2jQwWpp.js} +1 -1
- package/editor-web/assets/{words-zMedmPWc.js → words-DgMuEmDO.js} +1 -1
- package/editor-web/assets/workbook-BDWkQ149.js +41 -0
- package/editor-web/assets/x-BAJilkKD.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-BHMn_jwJ.js → xychartDiagram-4URNHDU4-CfXnqGWZ.js} +1 -1
- package/editor-web/index.html +6 -6
- package/package.json +5 -2
- package/editor-web/assets/article-DHf6mOY_.js +0 -7
- package/editor-web/assets/article-Dns1-Xh-.js +0 -3
- package/editor-web/assets/bar-button-CKPfx2AB.js +0 -1
- package/editor-web/assets/channel-CVWSV3su.js +0 -1
- package/editor-web/assets/chip-Bn_9JRRG.js +0 -1
- package/editor-web/assets/collaborator-XiHOxwGM.js +0 -1
- package/editor-web/assets/deck-DQpNIS2p.js +0 -1
- package/editor-web/assets/dist--z0ZHp4T.js +0 -16
- package/editor-web/assets/dist-B5GOGGEe.js +0 -1
- package/editor-web/assets/dist-Bx6q9kCu.js +0 -1
- package/editor-web/assets/dist-C4hHtrJr.js +0 -1
- package/editor-web/assets/dist-CCXJewsi.js +0 -19
- package/editor-web/assets/dist-CfK2BLl8.js +0 -4
- package/editor-web/assets/dist-Cmux3oJ_.js +0 -1
- package/editor-web/assets/dist-Cspf85KV.js +0 -6
- package/editor-web/assets/dist-DOrGo1GD.js +0 -19
- package/editor-web/assets/dist-DjiCHlSu.js +0 -35
- package/editor-web/assets/dist-Do4a40Wn.js +0 -19
- package/editor-web/assets/dist-FKEWS3Co.js +0 -547
- package/editor-web/assets/dist-QKd2i6kG.js +0 -5
- package/editor-web/assets/dist-SGnOfLhx.js +0 -24
- package/editor-web/assets/dist-VmVB7tl4.js +0 -3
- package/editor-web/assets/esm-PQD5Pn8a.js +0 -21
- package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +0 -1
- package/editor-web/assets/hint-CbwoSBMw.js +0 -1
- package/editor-web/assets/index-CXisi0Cj.css +0 -2
- package/editor-web/assets/index-wMlfx8aT.js +0 -28
- package/editor-web/assets/layout-SWqqA0yV.js +0 -1
- package/editor-web/assets/progress-DZQTiRLv.js +0 -6
- package/editor-web/assets/ribbon-DajdQ_Ya.js +0 -1
- package/editor-web/assets/row-Bei9HNEe.js +0 -1
- package/editor-web/assets/schemas-C21MyseF.js +0 -1
- package/editor-web/assets/split-DBAbwPZ5.js +0 -3
- package/editor-web/assets/surface-CIF0Ae0z.js +0 -1
- package/editor-web/assets/swatch-BUzr_XmH.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +0 -8
- package/editor-web/assets/switch-DrZxoPQS.js +0 -1
- package/editor-web/assets/syntax-emXV4DnN.js +0 -1
- package/editor-web/assets/tabs-BwU2E7bU.js +0 -1
- package/editor-web/assets/textarea-BX_ax3X8.js +0 -1
- package/editor-web/assets/tolerant-DM9s0Mt1.js +0 -1
- package/editor-web/assets/type-CvZ0HZsV.js +0 -41
- package/editor-web/assets/workbook-BZKYx4WB.js +0 -41
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t,c as n,d as r,f as i,h as a,s as o,u as s}from"./react-Byupo4pA.js";import{Et as c,ht as l,n as u,yt as d}from"./x-BAJilkKD.js";import{S as f,_ as p,w as m}from"./schemas-DlRAoVtq.js";import{F as h,g,j as _,x as v}from"./snapshots-DYooVfOx.js";import{t as y}from"./jsx-runtime-DePvh3-m.js";import{i as b}from"./dist-6ugUm4dS.js";import{t as x}from"./createLucideIcon-euu7Wcd9.js";import{t as ee}from"./zoom-in-yAGKspfC.js";import{n as te,t as ne}from"./updating-Cbxw83_O.js";var S=x(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),C=e(t(),1),w=y(),T=m([p(),p(),p()]),E={"scenery/viewer":h(f({item:_,camera:f({position:T,target:T}).optional()}),g,`The address of a scenery's viewer page, for a sandboxed frame: it tells what the person does by postMessage.`)},re=v(E),D=d({en:{title:`3D scenery`,loading:`Loading the scenery`,zoomIn:`Zoom in`,back:`Back`,size:(e,t,n)=>`${e} × ${t} × ${n} m`},"zh-cn":{title:`3D 布景`,loading:`正在加载布景`,zoomIn:`放大`,back:`返回`,size:(e,t,n)=>`${e} × ${t} × ${n} 米`},"zh-tw":{title:`3D 布景`,loading:`正在載入布景`,zoomIn:`放大`,back:`返回`,size:(e,t,n)=>`${e} × ${t} × ${n} 公尺`},ja:{title:`3D セット`,loading:`セットを読み込み中`,zoomIn:`ズームイン`,back:`戻る`,size:(e,t,n)=>`${e} × ${t} × ${n} m`},ko:{title:`3D 세트`,loading:`세트를 불러오는 중`,zoomIn:`확대`,back:`뒤로`,size:(e,t,n)=>`${e} × ${t} × ${n} m`},es:{title:`Decorado 3D`,loading:`Cargando el decorado`,zoomIn:`Acercar`,back:`Atrás`,size:(e,t,n)=>`${e} × ${t} × ${n} m`},fr:{title:`Décor 3D`,loading:`Chargement du décor`,zoomIn:`Zoomer`,back:`Retour`,size:(e,t,n)=>`${e} × ${t} × ${n} m`},de:{title:`3D-Kulisse`,loading:`Kulisse wird geladen`,zoomIn:`Heranzoomen`,back:`Zurück`,size:(e,t,n)=>`${e} × ${t} × ${n} m`},pt:{title:`Cenário 3D`,loading:`Carregando o cenário`,zoomIn:`Aproximar`,back:`Voltar`,size:(e,t,n)=>`${e} × ${t} × ${n} m`}}),O=8;function k(e,t,n,r=8){let i={left:n.left+O,top:n.top+O},a={left:Math.max(i.left,n.right-O-t.width),top:Math.max(i.top,n.bottom-O-t.height)},o=e=>Math.max(i.left,Math.min(e,a.left)),s=e=>Math.max(i.top,Math.min(e,a.top)),c=o(e.left),l=e.bottom+r;if(l<=a.top)return{left:c,top:l};let u=e.top-r-t.height;if(u>=i.top)return{left:c,top:u};let d=e.right+r;return{left:d<=a.left?d:o(e.left-r-t.width),top:s((e.top+e.bottom)/2-t.height/2)}}var A=e=>e>=1?e.toFixed(2):e>=.1?e.toFixed(3):e.toFixed(4),j=1500,M={width:300,height:56},N=e=>[e[0],e[1],e[2]],ie=e=>Array.isArray(e)&&e.length===3&&e.every(e=>typeof e==`number`);function ae(e){if(typeof e!=`object`||!e)return;let t=e;if(t.allyhub===!0){if(t.type===`error`)return{type:`error`,message:typeof t.message==`string`?t.message:``};if(t.type===`scenery`&&typeof t.event==`object`)return{type:`scenery`,event:t.event}}}function P({className:e}){return(0,w.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col`,children:[(0,w.jsx)(b,{}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,w.jsx)(F,{...e===void 0?{}:{className:e}})})]})}function F({className:e}){let t=o(),d=n(),f=D.of(d?.locale),p=d?.item,m=p?.id,h=p?.entry,g=(0,C.useRef)(null),_=(0,C.useRef)(null),v=(0,C.useRef)(void 0),[y,b]=(0,C.useState)({n:0}),[x,T]=(0,C.useState)(),[E,O]=(0,C.useState)(),P=a(E),[F,oe]=(0,C.useState)(),[se,I]=(0,C.useState)(),[ce,L]=(0,C.useState)([]),[R,z]=(0,C.useState)(null),[B,le]=(0,C.useState)({hover:null,select:null}),[V,H]=(0,C.useState)(!1);(0,C.useEffect)(()=>{if(m===void 0)return;let e=!0,n=y.from;return re(t,`scenery/viewer`,{item:m,...n?{camera:{position:N(n.position),target:N(n.target)}}:{}}).then(t=>{e&&(T({n:y.n,url:t.url}),O(t.probe))},t=>{e&&I({n:y.n,message:t instanceof Error?t.message:String(t)})}),()=>{e=!1}},[t,m,y]),s(m,()=>{let e=v.current;b(t=>({n:t.n+1,...e?{from:e}:{}}))});let U=(0,C.useCallback)(e=>{g.current?.contentWindow?.postMessage({allyhub:!0,command:e},`*`)},[]),W=(0,C.useRef)([]),G=(0,C.useRef)(new Map),K=(0,C.useRef)(!1),q=()=>{let e=g.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0};i({hold:()=>Promise.resolve({key:`${m??``}@${String(y.n)}@${JSON.stringify(v.current??null)}`,what:`The 3D scene ${m??``}`,...h===void 0?{}:{source:{path:h}}}),locate:()=>Promise.resolve({elements:[]})}),r({element:()=>g.current,pictures:()=>new Promise(e=>{let t=q();W.current.push(n=>{e(t?[{rect:t,mime:n.slice(5,n.indexOf(`;`)),data:n.slice(n.indexOf(`,`)+1)}]:[])}),K.current&&U({type:`shot`})}),locate:async e=>{let t=q(),n=await Promise.all(c(e).map(({x:e,y:n})=>new Promise(r=>{let i=crypto.randomUUID(),a=setTimeout(()=>{G.current.delete(i),r(null)},j);G.current.set(i,e=>{clearTimeout(a),r(e)}),U({type:`pick`,id:i,x:e-(t?.x??0),y:n-(t?.y??0)})})));return{elements:[...new Set(n.flatMap(e=>e?[e.path.join(` > `)]:[]))].map(e=>({name:`the object ${e}`,...h===void 0?{}:{source:{path:h}}}))}},pick:e=>new Promise(t=>{let n=q(),r=crypto.randomUUID(),i=setTimeout(()=>{G.current.delete(r),t(void 0)},j);G.current.set(r,e=>{clearTimeout(i),t(e?.screen&&n?{element:{name:`the object ${e.path.join(` > `)}`,...h===void 0?{}:{source:{path:h}}},outline:[e.screen.map(([e,t])=>({x:n.x+e,y:n.y+t}))]}:void 0)}),U({type:`pick`,id:r,x:e.x-(n?.x??0),y:e.y-(n?.y??0)})})}),(0,C.useEffect)(()=>{let e=_.current;if(!e)return;let t=e=>{K.current&&(e.preventDefault(),U({type:`wheel`,deltaY:e.deltaY,ctrlKey:e.ctrlKey}))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>{e.removeEventListener(`wheel`,t)}},[U]);let J=(0,C.useRef)(null);(0,C.useEffect)(()=>{J.current=R},[R]),(0,C.useEffect)(()=>{let e=e=>{if(!x||e.source!==g.current?.contentWindow)return;let t=ae(e.data);if(!t)return;if(t.type===`error`){I({n:x.n,message:t.message});return}let n=t.event;switch(n.type){case`ready`:oe(x.n),L(n.cameras),K.current=!0,W.current.forEach(()=>{U({type:`shot`})}),J.current&&U({type:`select`,path:J.current.path});return;case`select`:z(n.object);return;case`camera`:{let e=n.camera;ie(e.target)&&(v.current={position:e.position,target:e.target,...e.lens===void 0?{}:{lens:e.lens}}),H(n.framed);return}case`place`:le({hover:n.hover,select:n.select});return;case`shot`:W.current.shift()?.(n.picture);return;case`picked`:G.current.get(n.id)?.(n.object),G.current.delete(n.id);return;default:return}};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[U,t,x]);let ue=(0,C.useCallback)(()=>{R&&U({type:`select`,path:null}),z(null)},[U,R]),[Y,de]=(0,C.useState)({width:0,height:0});(0,C.useEffect)(()=>{let e=_.current;if(!e)return;let t=new ResizeObserver(()=>{de({width:e.clientWidth,height:e.clientHeight})});return t.observe(e),()=>{t.disconnect()}},[]);let X=R?B.select:null,Z=R&&X?k({left:X.x,top:X.y,right:X.x+X.width,bottom:X.y+X.height},M,{left:0,top:0,right:Y.width,bottom:Y.height}):void 0,Q=x!==void 0&&F===x.n,$=se?.n===y.n;return(0,w.jsxs)(`div`,{ref:_,"data-testid":`scenery-viewer`,className:l(`bg-paper relative size-full overflow-hidden`,e),onKeyDown:e=>{e.key===`Escape`&&R&&ue()},children:[x&&P!==void 0&&(0,w.jsx)(`iframe`,{ref:g,src:x.url,title:f.title,...P?{sandbox:`allow-scripts`}:{},"data-testid":`scenery-frame`,...Q?{"data-ready":``}:{},className:l(`absolute inset-0 size-full border-0 transition-opacity`,Q?`opacity-100`:`opacity-0`)},x.n),!Q&&!$&&(0,w.jsx)(`p`,{className:`text-lead absolute inset-0 grid place-items-center text-sm`,children:f.loading}),$&&(Q?(0,w.jsx)(te,{}):(0,w.jsx)(ne,{className:`absolute inset-0 flex items-center justify-center`})),Q&&B.hover&&(0,w.jsx)(`div`,{"aria-hidden":!0,className:`border-pencil pointer-events-none absolute rounded-sm border border-dashed`,style:{left:B.hover.x,top:B.hover.y,width:B.hover.width,height:B.hover.height}}),Q&&R&&B.select&&(0,w.jsx)(`div`,{"aria-hidden":!0,className:`border-pencil pointer-events-none absolute rounded-sm border-2`,style:{left:B.select.x,top:B.select.y,width:B.select.width,height:B.select.height}}),Q&&(0,w.jsxs)(`div`,{className:`pointer-events-none absolute inset-x-3 bottom-3 flex flex-wrap items-center gap-1.5`,children:[ce.map(e=>(0,w.jsx)(u,{size:`sm`,variant:`outline`,className:`bg-card pointer-events-auto`,"data-testid":`scenery-camera`,onClick:()=>{U({type:`camera`,name:e})},children:e},e)),V&&(0,w.jsxs)(u,{size:`sm`,variant:`outline`,className:`bg-card pointer-events-auto ml-auto`,"data-testid":`scenery-back`,onClick:()=>{U({type:`back`})},children:[(0,w.jsx)(S,{size:14}),f.back]})]}),Z&&R&&(0,w.jsxs)(`div`,{role:`dialog`,"aria-label":R.path.join(` › `),"data-testid":`scenery-card`,className:`bg-card animate-set-in shadow-overlay absolute z-10 flex items-start gap-2 rounded-lg border p-3`,style:{left:Z.left,top:Z.top,width:M.width},children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:R.path.join(` › `)}),(0,w.jsx)(`p`,{className:`text-lead text-xs`,children:f.size(A(R.size[0]),A(R.size[1]),A(R.size[2]))})]}),(0,w.jsxs)(u,{size:`sm`,variant:`ghost`,"data-testid":`scenery-zoom`,onClick:()=>{U({type:`frame`,path:R.path})},children:[(0,w.jsx)(ee,{size:14}),f.zoomIn]})]})]})}export{P as SceneryViewer,P as default,D as WORDS,k as cardPlace,A as metres};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{Et as s,ht as c,kt as l,n as u,t as d}from"./x-BAJilkKD.js";import{C as f,S as p,_ as m,a as ee,l as h,s as g}from"./schemas-DlRAoVtq.js";import{t as _}from"./session--OJYv_B7.js";import{t as v}from"./jsx-runtime-DePvh3-m.js";import{C as y,_ as b,d as x,f as S,g as C,h as w,u as T}from"./bar-button-CJmpgNg4.js";import{C as te,E as ne,S as re,b as ie,i as ae}from"./dist-6ugUm4dS.js";import{t as E}from"./createLucideIcon-euu7Wcd9.js";import{t as oe}from"./arrow-down-D-QZrqcz.js";import{t as se}from"./arrow-up-B1zjKUHX.js";import{t as ce}from"./chart-no-axes-column-Dyy25XZ_.js";import{a as le,d as ue,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as D}from"./panes-BShVq38A.js";import{n as ve,t as ye}from"./undo-2-DCbMWoug.js";import{h as be}from"./index-D-MNVykg.js";import{n as xe,r as Se,t as O}from"./updating-Cbxw83_O.js";import{t as k}from"./collaborator-CbTacvkB.js";import{c as Ce,d as A,i as j,n as M,p as N,s as P}from"./browser-DEGNhKTV.js";import{S as F,b as we,d as Te,f as Ee,i as De,l as Oe,m as ke,n as I,p as Ae,t as L,u as je,v as Me,y as R}from"./words-B2jQwWpp.js";var z=E(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),B=E(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),V=[`following`,`mentionedUsers`,`subscribers`,`verified`],H=f().regex(/^[0-9]{1,19}$/u,`a post's id: 1 to 19 digits`),U=p({file:f().min(1),alt:f().optional()},{error:e=>e.code===`invalid_type`?`a medium is { file: ./picture.png, alt: … }: its file, from this file's folder, and its alt text`:void 0}),W=p({options:g(f()),duration_minutes:m().int()},{error:e=>e.code===`invalid_type`?`a poll is { options: [ … ], duration_minutes: … }`:void 0}),Ne=p({text:f().default(``).transform(e=>e.replace(/\n+$/u,``)),media:g(U).optional(),poll:W.optional(),made_with_ai:h().optional(),paid_partnership:h().optional(),reply:p({in_reply_to_tweet_id:H}).optional(),quote_tweet_id:H.optional()},{error:e=>e.code===`invalid_type`?`a post is { text: …, media: [ … ], poll: … }`:void 0}),Pe=p({reply_settings:ee(V).optional(),posts:g(Ne,{error:`posts is the list of its posts: posts: [ { text: … }, … ]`}).min(1,`posts holds at least one post`)},{error:e=>e.code===`invalid_type`?`an x-post's file is { posts: [ { text: … }, … ] }, with reply_settings beside posts`:void 0});function Fe(e,t){let n=e;for(let e of t)if(A(n)){let t=n.items.find(t=>t.key?.value===e);if(!t)return n;n=t.value??t.key}else if(N(n)&&typeof e==`number`){let t=n.items[e];if(!t)return n;n=t}else return n;return n}function G(e){let t=new j,n=M(e,{lineCounter:t,prettyErrors:!1}),r=e=>{let r=Fe(n.contents,e)?.range?.[0];return r===void 0?void 0:t.linePos(r).line};if(n.errors.length>0)return{errors:n.errors.map(e=>({path:[],message:e.message})),line:e=>e.length===0&&n.errors[0]?.linePos?.[0]?n.errors[0].linePos[0].line:r(e)};let i=Pe.safeParse(n.toJS());return i.success?{value:i.data,errors:[],line:r}:{errors:i.error.issues.map(e=>({path:e.path.filter(e=>typeof e==`string`||typeof e==`number`),message:e.message})),line:r}}function K(e,t){let n=e.createNode(t);return t.includes(`
|
|
2
|
+
`)&&(n.type=Ce.BLOCK_LITERAL),n}var q=e=>JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))):t),J=(e,t)=>q(e)===q(t);function Ie(e){return{text:e.text,media:e.media===void 0||e.media.length===0?void 0:e.media,poll:e.poll}}function Le(e,t){let n=M(e),r=G(e).value;if(r!==void 0&&J(r,t))return e;A(n.contents)||(n.contents=new P),t.reply_settings===void 0?n.deleteIn([`reply_settings`]):n.getIn([`reply_settings`])!==t.reply_settings&&n.setIn([`reply_settings`],t.reply_settings);let i=n.getIn([`posts`]),a=N(i)?i:void 0,o=(a?.items??[]).map(e=>A(e)?e:void 0),s=(r?.posts??[]).map(e=>q(e)),c=new Set,l=t.posts.map(()=>void 0);t.posts.forEach((e,t)=>{let n=s.findIndex((t,n)=>!c.has(n)&&o[n]&&t===q(e));n>=0&&(c.add(n),l[t]=n)}),t.posts.forEach((e,t)=>{l[t]===void 0&&o[t]&&!c.has(t)&&(c.add(t),l[t]=t)});let u=t.posts.map((e,t)=>{let r=l[t],i=r===void 0?void 0:o[r],a=Ie(e);if(!i){let t=n.createNode({});t.set(`text`,K(n,e.text));for(let e of[`media`,`poll`])a[e]!==void 0&&t.set(e,n.createNode(a[e]));return t}let s=i.get(`text`);(typeof s!=`string`||s.replace(/\n+$/u,``)!==e.text)&&i.set(`text`,K(n,e.text));for(let e of[`media`,`poll`]){let t=a[e],r=i.get(e,!0);t===void 0?r!==void 0&&i.delete(e):J(r?.toJSON?.(),t)||i.set(e,n.createNode(t))}return i});return a?a.items=u:n.setIn([`posts`],n.createNode(u)),n.toString({flowCollectionPadding:!1,lineWidth:0})}function Re(e,t,n){let r=(e,t,n)=>J(t,e)?n:t,i=t.posts.length===e.posts.length?n.posts.length:n.posts.length===e.posts.length?t.posts.length:n.posts.length,a=[];for(let o=0;o<i;o++){let i=e.posts[o],s=t.posts[o],c=n.posts[o],l=c??s;if(l===void 0)continue;if(s===void 0||c===void 0||i===void 0){a.push(l);continue}let u={...c,text:r(i.text,s.text,c.text)};delete u.media,delete u.poll,a.push({...u,...Y(`media`,r(i.media,s.media,c.media)),...Y(`poll`,r(i.poll,s.poll,c.poll))})}let o={...n,posts:a};return delete o.reply_settings,{...o,...Y(`reply_settings`,r(e.reply_settings,t.reply_settings,n.reply_settings))}}function Y(e,t){return t===void 0?{}:{[e]:t}}var X=e(n(),1),Z=v();function ze(e){let t=e?.part??e?.board;if(typeof t!=`string`)return;let n=/^post-(\d+)$/u.exec(t)?.[1];return n===void 0?void 0:Number(n)-1}var Be=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ve(e,t){let n=e?.posts??[],r=t.posts;for(let e=0;e<r.length;e++)if(!Be(n[e],r[e]))return e;if(n.length>r.length&&r.length>0)return r.length-1}function He(e,t){let n=G(e),r=n.value?.posts.length??0,i=e.split(`
|
|
3
|
+
`).length;for(let e=0;e<r;e++){let a=n.line([`posts`,e]);if(a===void 0)continue;let o=e+1<r?n.line([`posts`,e+1]):void 0,s=o===void 0?i:o-1;if(a<=t.to&&t.from<=s)return e}}function Ue(e,t){if(e.from!==void 0&&e.path===t.path)return He(t.text,{from:e.from,to:e.to??e.from})}var We=class e{session;file;unreadable=!1;landed;snapshot;listeners=new Set;amending;stops=[];constructor(e){this.session=e,this.read(e.text),this.snapshot=this.make(),e.attach({save:e=>{if(this.file===void 0||this.unreadable)return;let t=Le(e,this.file);return t===e?void 0:t},take:(e,t,n)=>{let r=G(e),i=G(t).value,a=n?.kind===`agent`&&r.value?Ve(i,r.value):void 0;a!==void 0&&(this.landed={post:a,at:Date.now()}),r.value?(this.file=this.file===void 0||i===void 0?r.value:Re(i,this.file,r.value),this.unreadable=!1):(this.file=void 0,this.unreadable=!0),this.emit()}}),this.stops.push(e.onState(()=>{this.emit()}),e.onUndo(()=>{this.emit()}))}read(e){let t=G(e);this.file=t.value,this.unreadable=t.value===void 0}static async open(t,n){return new e(await _.open(t,n))}make(){return{file:this.file,state:this.session.state,canUndo:this.session.canUndo,canRedo:this.session.canRedo,unreadable:this.unreadable,landed:this.landed}}emit(){this.snapshot=this.make();for(let e of this.listeners)e()}get text(){return this.session.text}get(){return this.snapshot}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}edit(e,t,n){let r=this.file;if(r===void 0||this.unreadable)return;let i=t(r);if(i!==r){if(n!==void 0&&this.amending?.key===n&&this.session.canUndo){let e=this.amending.from;this.session.undo(),this.push(this.amending.label,e,i)}else this.amending=n===void 0?void 0:{key:n,from:r,label:e},this.push(e,r,i)}}settle(){this.amending=void 0}push(e,t,n){this.file=n,this.session.pushEdit({label:e,undo:()=>{this.file=t,this.emit()},redo:()=>{this.file=n,this.emit()}}),this.emit()}undo(){this.amending=void 0,this.session.undo()}redo(){this.amending=void 0,this.session.redo()}async close(){for(let e of this.stops.splice(0))e();await this.session.close()}},Q=(e,t,n)=>({...e,posts:e.posts.map((e,r)=>r===t?n(e):e)});function Ge(e,t){let n={...e};return t===void 0||t.length===0?delete n.media:n.media=t,n}function Ke(e){let t={...e};return delete t.poll,t}function qe({text:e}){let t=L(),{weighted:n}=we(e),r=F.length.most,i=r-n,a=i<0&&n<=F.length.premium,o=n>F.length.premium,s=Math.min(1,n/r),l=2*Math.PI*9;return(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs tabular-nums`,"aria-label":i>=0?t.left(i):t.over(-i),"data-testid":`x-count`,children:[i<=20?(0,Z.jsx)(`span`,{className:c(o?`text-destructive`:a?`text-warning`:`text-muted-foreground`),children:a?n:i}):null,(0,Z.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 22 22`,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`11`,cy:`11`,r:9,fill:`none`,stroke:`var(--ak-x-line)`,strokeWidth:`2`}),(0,Z.jsx)(`circle`,{cx:`11`,cy:`11`,r:9,fill:`none`,stroke:o?`#f4212e`:a||i<=20?`#ffd400`:`var(--ak-x-link)`,strokeWidth:`2`,strokeDasharray:`${String(s*l)} ${String(l)}`,transform:`rotate(-90 11 11)`})]})]})}function Je(e){let t=L();return(0,Z.jsx)(D,{alt:e.alt??``,onAlt:e.onAlt,most:F.alt,trigger:(0,Z.jsx)(u,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,"aria-label":t.altText,children:t.alt})})}function Ye(e){let t=L();return(0,Z.jsx)(u,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media absolute top-2 right-2 rounded-full`,"aria-label":t.removeMedium,onClick:e.onRemove,children:(0,Z.jsx)(d,{})})}function Xe(e){let t=L(),{options:n,duration_minutes:r}=e.poll,i={days:Math.floor(r/1440),hours:Math.floor(r%1440/60),minutes:r%60},a=(t,n)=>{let r={...i,[t]:Math.max(0,Math.floor(n))};e.onChange({...e.poll,duration_minutes:r.days*1440+r.hours*60+r.minutes})};return(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 rounded-2xl border border-[var(--ak-x-line)] p-3`,"data-testid":`x-poll`,children:[n.map((r,i)=>{let a=R(r)-F.poll.option;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(`input`,{className:`aria-invalid:border-destructive h-10 flex-1 rounded-md border border-[var(--ak-x-line)] bg-transparent px-3 text-[15px] outline-none focus:border-[var(--ak-x-link)]`,value:r,"aria-invalid":a>0||void 0,maxLength:F.poll.option,placeholder:t.option(i+1),"aria-label":t.option(i+1),onChange:t=>{e.onChange({...e.poll,options:n.map((e,n)=>n===i?t.target.value:e)},`option-${String(i)}`)}}),a>0?(0,Z.jsx)(`span`,{className:`text-destructive text-sm`,children:t.over(a)}):null,n.length>F.poll.least?(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":t.removeOption,onClick:()=>{e.onChange({...e.poll,options:n.filter((e,t)=>t!==i)})},children:(0,Z.jsx)(d,{})}):null]},i)}),n.length<F.poll.most?(0,Z.jsxs)(u,{variant:`ghost`,size:`sm`,className:`self-start text-[var(--ak-x-link)]`,onClick:()=>{e.onChange({...e.poll,options:[...n,``]})},children:[(0,Z.jsx)(be,{}),t.addOption]}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 border-t border-[var(--ak-x-line)] pt-2 text-sm`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground mr-auto self-center`,children:t.pollLength}),[`days`,`hours`,`minutes`].map(e=>(0,Z.jsxs)(`label`,{className:`flex flex-col gap-0.5 text-xs`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:t[e]}),(0,Z.jsx)(`input`,{type:`number`,min:0,className:`h-8 w-16 rounded-md border border-[var(--ak-x-line)] bg-transparent px-2 text-sm`,value:i[e],onChange:t=>{a(e,Number(t.target.value))}})]},e)),(0,Z.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:e.onRemove,children:t.removePoll})]})]})}function Ze(e){let t=L(),n=t.replies[e.value??`everyone`];return(0,Z.jsxs)(T,{children:[(0,Z.jsx)(y,{asChild:!0,disabled:e.disabled,children:(0,Z.jsxs)(u,{variant:`ghost`,size:`sm`,className:`ak-x-c-replies -ml-2 gap-1 px-2 font-bold text-[var(--ak-x-link)]`,children:[(0,Z.jsx)(z,{}),n]})}),(0,Z.jsxs)(S,{align:`start`,className:`w-72`,children:[(0,Z.jsx)(w,{children:t.whoCanReply}),(0,Z.jsx)(C,{value:e.value??`everyone`,onValueChange:t=>{e.onChange(t===`everyone`?void 0:V.includes(t)?t:void 0)},children:[`everyone`,...V].map(e=>(0,Z.jsx)(b,{value:e,children:t.replies[e]},e))})]})]})}function Qe(e){let t=L(),n=e.post.made_with_ai===!0||e.post.paid_partnership===!0;return(0,Z.jsxs)(T,{children:[(0,Z.jsx)(y,{asChild:!0,children:(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-[var(--ak-x-link)]`,"aria-label":t.disclosure,title:t.disclosure,"aria-pressed":n,children:(0,Z.jsx)(B,{className:c(n&&`fill-current`)})})}),(0,Z.jsxs)(S,{align:`start`,className:`w-56`,children:[(0,Z.jsx)(w,{children:t.disclosure}),(0,Z.jsx)(x,{checked:e.post.made_with_ai===!0,onCheckedChange:t=>{e.onChange({made_with_ai:t})},children:t.madeWithAi}),(0,Z.jsx)(x,{checked:e.post.paid_partnership===!0,onCheckedChange:t=>{e.onChange({paid_partnership:t})},children:t.paidPartnership})]})]})}function $(e){return(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-[var(--ak-x-link)] disabled:text-[var(--ak-x-muted)]`,"aria-label":e.label,title:e.label,disabled:e.disabled,onClick:e.onClick,children:e.children})}var $e=3e4;function et({doc:e,dir:n,entry:o}){let c=L(),f=r(),p=a(),[m,ee]=he(),h=(0,X.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),[g,_]=(0,X.useState)(),[v,y]=(0,X.useState)(0),[b,x]=(0,X.useState)(),S=(0,X.useRef)([]);(0,X.useEffect)(()=>{if(b===void 0)return;let e=S.current[b.post];e!=null&&(e.focus(),e.setSelectionRange(b.at,b.at),y(b.post),x(void 0))},[b]);let{shown:C,updating:w}=Se(h.file),T=p||w,{agent:E,following:D}=t(),Ce=ne(),A=(()=>{if(E?.doing===void 0)return;let t=ze(E.place);if(t!==void 0)return t;let n=h.landed!==void 0&&h.landed.at>=E.at-$e;return n&&E.source?.path===o?h.landed?.post:(E.source?Ue(E.source,{path:o,text:e.text}):void 0)??(n?h.landed?.post:void 0)})(),j=A!==void 0&&A<(C?.posts.length??0)?A:void 0,M=(0,X.useRef)([]),N=(0,X.useRef)([]);(0,X.useEffect)(()=>{if(D&&j!==void 0)for(let e of[M.current[j],N.current[j]])e?.scrollIntoView({block:`nearest`})},[D,j,h.landed]);let P=me(n,(C?.posts??[]).flatMap(e=>(e.media??[]).map(e=>e.file)));i({hold:()=>Promise.resolve({key:`${o}@${String(e.text.length)}`,what:`The X post ${o}${(C?.posts.length??0)>1?`, a thread of ${String(C?.posts.length??0)} posts`:``}`,source:{path:o}}),locate:t=>{let n=C?.posts??[],r=G(e.text),i=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},a=e=>e!==void 0&&l(t,e),c=n.flatMap((e,t)=>{if(!a(i(M.current[t]))&&!a(i(N.current[t])))return[];let n=r.line([`posts`,t]);return[{name:`post ${String(t+1)} of the thread`,source:{path:o,...n===void 0?{}:{line:n}},...e.text===``?{}:{text:e.text}}]}),u=s(t)[0],d=e=>e!==void 0&&u!==void 0&&u.x>=e.x&&u.x<=e.x+e.width&&u.y>=e.y&&u.y<=e.y+e.height,f=n.findIndex((e,t)=>d(i(M.current[t]))),p=n.findIndex((e,t)=>d(i(N.current[t]))),m=f>=0?`in post ${String(f+1)}, where it is written`:p>=0?`in post ${String(p+1)}, as X's timeline will show it`:void 0;return Promise.resolve({elements:c,...m===void 0?{}:{where:m}})}});let we=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`z`&&(t.preventDefault(),t.shiftKey?e.redo():e.undo())},I=(t,n,r)=>{T||e.edit(t,n,r)},R=e=>(e.media??[]).map(e=>{let t=P.get(e.file),n=le(e.file),r=n?void 0:Me(e.file.split(`.`).pop()??``);return t===void 0?{kind:`made`,label:n?c.made:e.file}:{kind:r??`picture`,src:t,alt:e.alt,file:e.file}}),z=(0,Z.jsx)(ae,{start:(0,Z.jsxs)(Z.Fragment,{children:[T||m!==`edit`?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":c.undo,title:c.undo,disabled:!h.canUndo,onClick:()=>{e.undo()},children:(0,Z.jsx)(ye,{})}),(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":c.redo,title:c.redo,disabled:!h.canRedo,onClick:()=>{e.redo()},children:(0,Z.jsx)(ve,{})})]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsx)(_e,{pane:m,onPane:ee})]}),saved:{state:h.state},exports:{}}),B=f?.theme===`dark`;if(C===void 0)return(0,Z.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`x-post-editor`,children:[z,(0,Z.jsx)(O,{className:`flex min-h-0 flex-1 items-center justify-center`})]});let V=C.posts,H=Math.min(v,V.length-1),U=e=>{I(c.steps.add,t=>({...t,posts:[...t.posts.slice(0,e+1),{text:``},...t.posts.slice(e+1)]})),x({post:e+1,at:0})},W=e=>{let t=V[e],n=V[e-1];if(t===void 0||n===void 0)return!1;let r=e=>(e.media?.length??0)>0||e.poll!==void 0;if(r(t)&&r(n))return!1;let i=n.text===``||t.text===``?``:`
|
|
4
|
+
|
|
5
|
+
`;return I(c.steps.join,a=>({...a,posts:[...a.posts.slice(0,e-1),{...n,...r(t)?{...t.media?{media:t.media}:{},...t.poll?{poll:t.poll}:{}}:{},text:n.text+i+t.text},...a.posts.slice(e+1)]})),x({post:e-1,at:n.text.length+i.length}),!0},Ne=(0,Z.jsx)(`div`,{className:`ak-x ak-x-editing ak-x-composer`,"data-theme":B?`dark`:`light`,children:V.map((t,r)=>{let i=r===V.length-1,a=r===H,s=t.media??[],l=s.filter(e=>Me(e.file.split(`.`).pop()??``)===`picture`||le(e.file)).length,f=s.length>=F.pictures||s.length>l;return(0,Z.jsxs)(`div`,{ref:e=>{M.current[r]=e},className:`ak-x-c-post`,"data-here":a?``:void 0,"data-testid":`x-post`,onFocusCapture:()=>{y(r)},onPointerDown:()=>{y(r)},children:[(0,Z.jsxs)(`div`,{className:`ak-x-side`,children:[(0,Z.jsx)(`div`,{className:`ak-x-avatar`,"aria-hidden":`true`,children:je.name.slice(0,1)}),i?null:(0,Z.jsx)(`div`,{className:`ak-x-thread-line`})]}),(0,Z.jsxs)(`div`,{className:`ak-x-body`,children:[a&&r>0&&!T?(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`ak-x-c-remove`,"aria-label":c.remove,title:c.remove,onClick:()=>{I(c.steps.remove,e=>({...e,posts:e.posts.filter((e,t)=>t!==r)})),x({post:r-1,at:V[r-1]?.text.length??0})},children:(0,Z.jsx)(d,{})}):null,(0,Z.jsxs)(`div`,{className:`ak-x-field`,children:[(0,Z.jsx)(Ee,{text:t.text,whole:!0}),(0,Z.jsx)(`textarea`,{ref:e=>{S.current[r]=e},dir:`auto`,value:t.text,placeholder:r===0?c.whatsHappening:c.addAnother,"aria-label":r===0?c.whatsHappening:c.addAnother,readOnly:T,"data-testid":`x-text`,onChange:e=>{let t=e.target.value;I(c.steps.text,e=>Q(e,r,e=>({...e,text:t})),`text-${String(r)}`)},onBlur:()=>{e.settle()},onKeyDown:e=>{let t=e.currentTarget;if(e.key===`Backspace`&&r>0&&t.selectionStart===0&&t.selectionEnd===0&&!T){W(r)&&e.preventDefault();return}if(e.key!==`Enter`||!(e.metaKey||e.ctrlKey))return;e.preventDefault();let n=t.selectionStart;I(c.steps.split,e=>{let t=e.posts[r];if(!t)return e;let i=t.text.slice(0,n).replace(/\s+$/u,``),a=t.text.slice(n).replace(/^\s+/u,``);return{...e,posts:[...e.posts.slice(0,r),{...t,text:i},{text:a},...e.posts.slice(r+1)]}}),x({post:r+1,at:0})}})]}),(0,Z.jsx)(Oe,{media:R(t),onAlt:T?void 0:e=>(0,Z.jsx)(Je,{alt:s[e]?.alt,onAlt:t=>{I(c.steps.alt,n=>Q(n,r,n=>({...n,media:(n.media??[]).map((n,r)=>{if(r!==e)return n;let i={file:n.file};return t.trim()===``?i:{...i,alt:t}})})))}}),onMedium:T?void 0:e=>(0,Z.jsx)(Ye,{onRemove:()=>{I(c.steps.media,t=>Q(t,r,t=>Ge(t,(t.media??[]).filter((t,n)=>n!==e))))}})}),t.poll===void 0?null:T?(0,Z.jsx)(`div`,{className:`ak-x-poll`,children:t.poll.options.map((e,t)=>(0,Z.jsx)(`div`,{className:`ak-x-option`,dir:`auto`,children:e},t))}):(0,Z.jsx)(Xe,{poll:t.poll,onChange:(e,t)=>{I(c.steps.poll,t=>Q(t,r,t=>({...t,poll:e})),t===void 0?void 0:`${t}-${String(r)}`)},onRemove:()=>{I(c.steps.poll,e=>Q(e,r,e=>Ke(e)))}}),t.quote_tweet_id===void 0?null:(0,Z.jsx)(Ae,{id:t.quote_tweet_id}),a?(0,Z.jsx)(Ze,{value:C.reply_settings,disabled:T,onChange:e=>{I(c.whoCanReply,t=>{let n={...t};return e===void 0?delete n.reply_settings:n.reply_settings=e,n})}}):null,a&&!T?(0,Z.jsxs)(`div`,{className:`ak-x-c-tools`,children:[(0,Z.jsxs)(ie,{open:g===r,onOpenChange:e=>{_(e?r:void 0)},children:[(0,Z.jsx)(te,{asChild:!0,children:(0,Z.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-[var(--ak-x-link)] disabled:text-[var(--ak-x-muted)]`,"aria-label":c.addMedia,title:c.addMedia,disabled:f||t.poll!==void 0,children:(0,Z.jsx)(ue,{})})}),(0,Z.jsx)(re,{className:`w-auto`,align:`start`,children:(0,Z.jsx)(de,{self:o,types:De,testId:`x-picker`,onPick:e=>{_(void 0),I(c.steps.media,t=>Q(t,r,t=>({...t,media:[...t.media??[],{file:ge(n,e)}]})))}})})]}),(0,Z.jsx)($,{label:c.addPoll,disabled:t.poll!==void 0||s.length>0,onClick:()=>{I(c.steps.poll,e=>Q(e,r,e=>({...e,poll:{options:[``,``],duration_minutes:1440}})))},children:(0,Z.jsx)(ce,{})}),(0,Z.jsx)(Qe,{post:t,onChange:e=>{I(c.disclosure,t=>Q(t,r,t=>{let n={...t,...e};return n.made_with_ai!==!0&&delete n.made_with_ai,n.paid_partnership!==!0&&delete n.paid_partnership,n}))}}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsx)($,{label:c.moveUp,disabled:r===0,onClick:()=>{I(c.steps.move,e=>{let t=[...e.posts],[n]=t.splice(r,1);return n&&t.splice(r-1,0,n),{...e,posts:t}}),y(r-1)},children:(0,Z.jsx)(se,{})}),(0,Z.jsx)($,{label:c.moveDown,disabled:i,onClick:()=>{I(c.steps.move,e=>{let t=[...e.posts],[n]=t.splice(r,1);return n&&t.splice(r+1,0,n),{...e,posts:t}}),y(r+1)},children:(0,Z.jsx)(oe,{})}),(0,Z.jsx)(qe,{text:t.text}),(0,Z.jsx)(`span`,{className:`bg-rule mx-1 h-6 w-px`,"aria-hidden":`true`}),(0,Z.jsx)(u,{variant:`outline`,size:`icon-xs`,className:`rounded-full border-[var(--ak-x-line)] text-[var(--ak-x-link)]`,"aria-label":c.addPost,title:c.addPost,onClick:()=>{U(r)},children:(0,Z.jsx)(be,{})})]}):null]}),E&&j===r?(0,Z.jsx)(k,{"data-testid":`x-agent-box`,label:Ce(E),className:`inset-x-1 inset-y-0`}):null]},r)})}),Pe=(0,Z.jsx)(`div`,{className:`ak-x`,"data-theme":B?`dark`:`light`,children:V.map((e,t)=>(0,Z.jsxs)(`div`,{ref:e=>{N.current[t]=e},className:`relative`,children:[(0,Z.jsx)(Te,{post:{text:e.text,media:R(e),poll:e.poll,quote:e.quote_tweet_id},joined:t<V.length-1,published:!0}),E&&j===t?(0,Z.jsx)(k,{"data-testid":`x-agent-shown`,className:`inset-0`}):null]},t))});return(0,Z.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`x-post-editor`,onKeyDown:we,children:[z,(0,Z.jsx)(ke.Provider,{value:fe,children:(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[w?(0,Z.jsx)(xe,{}):null,(0,Z.jsx)(pe,{pane:m,edit:Ne,preview:Pe,width:598,background:B?`#000000`:`#ffffff`,testId:`x-preview`})]})})]})}function tt(){let e=L(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,X.useState)(),[l,u]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return We.open(t,i).then(t=>{n?(e=t,c(t)):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,Z.jsx)(`div`,{className:`flex size-full`,"data-testid":`x-post-editor`,"data-state":`updating`,children:(0,Z.jsx)(O,{})}):!s||i===void 0?(0,Z.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`x-post-editor`,"data-state":`loading`,children:e.loading}):(0,Z.jsx)(et,{doc:s,dir:a,entry:i})}export{We as PostDocument,I as WORDS,tt as XPostEditor,tt as default};
|