@forsion/unit 2.13.4 → 2.13.5
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/main.mjs +112 -9
- package/package.json +1 -1
- package/release.json +5 -5
- package/web/assets/ArtificialView-BD1yHz1N.js +1 -0
- package/web/assets/AutomationBuilder-B09c-5Bi.js +1 -0
- package/web/assets/CalendarConfigView-Bd-ZDGPO.js +1 -0
- package/web/assets/CalendarSide-B0RVbOsg.js +1 -0
- package/web/assets/CalendarView-BHio-n_r.js +3 -0
- package/web/assets/CalendarView-t91KpUG7.css +1 -0
- package/web/assets/CapabilityMenu-DyHTEYLr.js +1 -0
- package/web/assets/Chrome-C7F6fdDp.js +1 -0
- package/web/assets/{CodeView-GZ0BAgoW.js → CodeView-BGOnrGhB.js} +3 -3
- package/web/assets/CtxMenuButtons-BYjrbUKS.js +1 -0
- package/web/assets/DashboardGridView-CR-R_qV8.js +25 -0
- package/web/assets/DashboardGridView-RoVFSkNO.css +1 -0
- package/web/assets/EventCard-QyYorE1_.js +1 -0
- package/web/assets/ExcalidrawCanvas-BgcFPMpU.css +1 -0
- package/web/assets/ExcalidrawCanvas-lwJCN6uB.js +1 -0
- package/web/assets/FloatingToc-DO7SH8Ku.js +1 -0
- package/web/assets/GitCloneDialog-CbW-RJak.js +1 -0
- package/web/assets/{GitCloneDialog-Bj9G3o-n.css → GitCloneDialog-DOxZk2K0.css} +1 -1
- package/web/assets/HomepageView-Bx8FbWlY.css +1 -0
- package/web/assets/HomepageView-CHJEhf9c.js +4 -0
- package/web/assets/ImageStudioPanels-CgVf0wiq.js +3 -0
- package/web/assets/ImageStudioView-4WcX0_V4.js +1 -0
- package/web/assets/InlineAiPanel-CdIPINsA.js +1 -0
- package/web/assets/InlineFiles-CAIyTk1n.js +1 -0
- package/web/assets/{MarkdownBlock-DQTuoen3.css → MarkdownBlock-Cqfk5DhC.css} +1 -1
- package/web/assets/MarkdownBlock-DSItkLhu.js +58 -0
- package/web/assets/ModelPill--CU3XTIQ.js +2 -0
- package/web/assets/{ModelPill-CzdNh7Mt.css → ModelPill-BiUsuhy3.css} +1 -1
- package/web/assets/MuseLibraryView-PlS7HAlV.js +2 -0
- package/web/assets/MuseView-CvsO62Fo.js +7 -0
- package/web/assets/{PageHistoryPanel-Bn4-XmdK.js → PageHistoryPanel-CDh7nm78.js} +2 -2
- package/web/assets/{PdfAnnotator-Cq8cklTz.js → PdfAnnotator-DafvjP3U.js} +3 -3
- package/web/assets/PenRow-CEy-s6SF.js +1 -0
- package/web/assets/PluginToolCard-BmTRr5JT.css +1 -0
- package/web/assets/PluginToolCard-DCzLhsCA.js +2 -0
- package/web/assets/ProductView-AUqnTwmQ.js +1 -0
- package/web/assets/SettingsPage-B9mmkWaM.js +3 -0
- package/web/assets/StudioGuestSurface-OOhRA8nt.js +1 -0
- package/web/assets/TodoListView-BkgMe44I.js +1 -0
- package/web/assets/Tooltip-DOYi44eY.js +1 -0
- package/web/assets/UnifiedPage-CTmQpf2T.css +1 -0
- package/web/assets/UnifiedPage-s7-tDSwG.js +712 -0
- package/web/assets/ViewSelectionBar-WmSWMFsR.js +2 -0
- package/web/assets/appStore-DDOkzWDA.js +456 -0
- package/web/assets/appStore-iy8_Tmac.css +1 -0
- package/web/assets/arrow-up-right-BptN64d-.js +1 -0
- package/web/assets/{artificial-BzLFkChP.css → artificial-BubVxExB.css} +1 -1
- package/web/assets/astryxBridge-BL56QfEv.js +69 -0
- package/web/assets/astryxBridge-djzCiy4v.css +1 -0
- package/web/assets/automationListSource-B1jz6q0t.js +1 -0
- package/web/assets/boardSurface-CP4HNmcm.js +1 -0
- package/web/assets/calendarNavStore-DCi7VBmM.js +1 -0
- package/web/assets/canvasPrefs-ArsX3NFO.js +1 -0
- package/web/assets/chatBoxSurface-DRsDr-MT.js +1 -0
- package/web/assets/chevron-up-ChXNh14u.js +1 -0
- package/web/assets/{client-CaivGZFR.js → client-fKy9CWk0.js} +5 -5
- package/web/assets/code-xml-DCCD9eCS.js +1 -0
- package/web/assets/{codeStudioStore-DhyMazGT.js → codeStudioStore-BgLfCDK2.js} +8 -8
- package/web/assets/codingNavigation-BrkLENBZ.css +1 -0
- package/web/assets/contextMenuSurface-BF593l2M.js +1 -0
- package/web/assets/copy-plus-ClKrSgM7.js +1 -0
- package/web/assets/create-DYmVT68X.js +14 -0
- package/web/assets/dashboardSurface-C6cbR3oG.js +1 -0
- package/web/assets/dbStore-BIG5Mfh2.js +1 -0
- package/web/assets/deskCapture-q-jRDIcc.js +1 -0
- package/web/assets/{diff2html-Daje9Kkm.js → diff2html-Di8qIz6O.js} +2 -2
- package/web/assets/{docx-preview-CABR7n30.js → docx-preview-B-URZXdP.js} +1 -1
- package/web/assets/draft-CBSW5tHx.js +2 -0
- package/web/assets/drawingStore-CGvTqqYW.js +7 -0
- package/web/assets/file-down-Z913cCyQ.js +1 -0
- package/web/assets/floatingTocSurface-DGwTiqvU.js +1 -0
- package/web/assets/foldActions-DGIPTmE1.js +1 -0
- package/web/assets/folder-1OJQeDI1.js +1 -0
- package/web/assets/folder-minus-D_j1SwHu.js +1 -0
- package/web/assets/folder-plus-DP9sFr26.js +1 -0
- package/web/assets/gestures-ZhFAENNZ.js +1 -0
- package/web/assets/git-branch-BMajF2cu.js +1 -0
- package/web/assets/homeCardStatus-5R7XkxFL.js +1 -0
- package/web/assets/i18n-CAf4PT1o.css +1 -0
- package/web/assets/i18n.generated-DW_l6CkR.js +15 -0
- package/web/assets/imageStudio-CwG21Bat.css +1 -0
- package/web/assets/imageStudio-DC_syDtx.js +4 -0
- package/web/assets/index-B8A3nKeL.js +1 -0
- package/web/assets/{index-BGfvNj7R.js → index-BDZIQnEx.js} +2 -2
- package/web/assets/index-BYKR7EVg.js +1 -0
- package/web/assets/index-BeW45J9J.js +7 -0
- package/web/assets/index-BnJguNqI.js +1 -0
- package/web/assets/index-BniT-A2n.js +1 -0
- package/web/assets/index-C--E96Ul.js +1 -0
- package/web/assets/index-CI2esW1X.js +1 -0
- package/web/assets/index-CIKPZc3Q.js +1 -0
- package/web/assets/index-COzdD7mZ.js +13 -0
- package/web/assets/index-CPfmhZ3Z.js +1 -0
- package/web/assets/index-CVLDDD5Z.js +1 -0
- package/web/assets/index-CWXpOSI2.js +1 -0
- package/web/assets/index-Cg1FWM_p.js +1 -0
- package/web/assets/index-CmsN2Zm2.js +1 -0
- package/web/assets/index-CtCYv9bF.js +1 -0
- package/web/assets/index-CtRdzpNh.js +1 -0
- package/web/assets/index-D-ClOPbg.js +1 -0
- package/web/assets/{index-gt5JBIFf.js → index-DfhEDV2T.js} +2 -2
- package/web/assets/index-Dr6YmrrT.js +1 -0
- package/web/assets/index-SpegRFQV.js +1 -0
- package/web/assets/index-bF04pF8q.js +3 -0
- package/web/assets/index-fDB1l4d-.js +3398 -0
- package/web/assets/index-jzlU5luC.js +1 -0
- package/web/assets/{index-O05r2Ty6.js → index-uhvJ8AiJ.js} +1 -1
- package/web/assets/{invitePage-Bgveo6Hj.js → invitePage-iOT1zBvp.js} +1 -1
- package/web/assets/{ipc-B6hkgxQL.js → ipc-SAPDwyQ4.js} +1 -1
- package/web/assets/{jszip.min-eU-k-vEy.js → jszip.min-B3n1FGCb.js} +1 -1
- package/web/assets/launchpad-C9U9hpWJ.css +1 -0
- package/web/assets/launchpad-CcmSwlJl.js +2 -0
- package/web/assets/layout-grid-oIyIGbc5.js +1 -0
- package/web/assets/linkFollow-uke1Xtit.js +8 -0
- package/web/assets/listFold-BeNv2v6M.js +1 -0
- package/web/assets/lock-open-D2nMg0ga.js +1 -0
- package/web/assets/log-out-D70NCXC4.js +1 -0
- package/web/assets/magnet-Cqmm97W8.js +1 -0
- package/web/assets/main-B9aT0WXG.js +15 -0
- package/web/assets/main-BlVApHpj.css +1 -0
- package/web/assets/markdownEditorSurface-BiDH0__r.css +1 -0
- package/web/assets/markdownEditorSurface-zUzFity2.js +3 -0
- package/web/assets/mediaPlayer-DB4KUvua.js +1 -0
- package/web/assets/message-square-plus-BvUfAAZm.js +1 -0
- package/web/assets/{messages-CKtabOqy.js → messages-GQUjmbwW.js} +1 -1
- package/web/assets/minimize-2-CMhzL6ZW.js +1 -0
- package/web/assets/mobileEntry-6u7TYC4s.css +1 -0
- package/web/assets/mobileEntry-BnHzrdoC.js +13 -0
- package/web/assets/modelPickerSurface-Dtz40Ae2.js +1 -0
- package/web/assets/nativeDownload-DsGyUSJ5.js +1 -0
- package/web/assets/nativeSheetMenu--iihXNVd.js +1 -0
- package/web/assets/pageStore-CyvNZEYX.js +13 -0
- package/web/assets/pageStore-ys8L4rjF.css +1 -0
- package/web/assets/{pageTree-BYYPgZm_.js → pageTree-Ci2qzrs1.js} +3 -3
- package/web/assets/pen-line-DC3lbEY1.js +1 -0
- package/web/assets/pen-tool-DD5_N4lZ.js +1 -0
- package/web/assets/pencil--sWwxHdP.js +1 -0
- package/web/assets/phoneList-BpLxxdq6.css +1 -0
- package/web/assets/phoneList-DKRMxQHf.js +1 -0
- package/web/assets/pluginChat-82zZt47Y.js +2 -0
- package/web/assets/react-b7FrqRQR.js +1 -0
- package/web/assets/recordSurface-vUX25Z8R.js +1 -0
- package/web/assets/redo-2-CqlqhWrI.js +1 -0
- package/web/assets/rotate-ccw-D8kni6Ni.js +1 -0
- package/web/assets/selectionActions-DIq0xDm8.js +2 -0
- package/web/assets/selectionBarSurface-B94e5JW_.js +1 -0
- package/web/assets/sessionTitle-Ctp4iNKu.js +1 -0
- package/web/assets/settingsPageSurface-C9TA3mJg.js +1 -0
- package/web/assets/sharePage-CY04XCAf.js +2 -0
- package/web/assets/{shareViewer-BiMqIBxP.js → shareViewer-DweNF8Ch.js} +2 -2
- package/web/assets/star-B0sZEmbj.js +1 -0
- package/web/assets/tableSurface-CSBYBw5P.js +1 -0
- package/web/assets/tanguProbe-B8Qv2vcm.js +6 -0
- package/web/assets/{terminalView-lbcBgG0c.js → terminalView-BLGdmdl7.js} +3 -3
- package/web/assets/type-Dt7RNB9g.js +1 -0
- package/web/assets/undo-2-QimgpLBn.js +1 -0
- package/web/assets/{unitAccount-DGwGsmC3.js → unitAccount-DL3jfd84.js} +1 -1
- package/web/assets/{unitBridge-CE2yAvm0.js → unitBridge-BSsCy1zP.js} +1 -1
- package/web/assets/{unitCloudTransport-BGFwkaDM.js → unitCloudTransport-CI_6H0TU.js} +1 -1
- package/web/assets/unitOwnerAccess-CiQ7nD7E.js +1 -0
- package/web/assets/unitShim-Dl2ksNp-.js +5 -0
- package/web/assets/upload-Dy7svciS.js +1 -0
- package/web/assets/userSpaces-oMHIWgYe.js +1 -0
- package/web/assets/viewportLock-B0l1GU_k.css +1 -0
- package/web/assets/viewportLock-BZq5PTeN.js +738 -0
- package/web/assets/zoom-in-DDEtY_Go.js +1 -0
- package/web/excalidraw/excalidraw.js +4 -2
- package/web/index.html +12 -13
- package/web/assets/ArtificialView-DLh75dAI.js +0 -1
- package/web/assets/AutomationBuilder-DNWWGnFr.js +0 -1
- package/web/assets/CalendarConfigView-G7je7k9-.js +0 -1
- package/web/assets/CalendarView-B2MtaOJk.js +0 -1
- package/web/assets/CapabilityMenu-DJaZ_Cyt.js +0 -1
- package/web/assets/CheckboxInput-FYXLaZke.js +0 -1
- package/web/assets/Chrome-CFonajM4.js +0 -1
- package/web/assets/DashboardGridView-D9s9pez_.css +0 -1
- package/web/assets/DashboardGridView-Xgw4wa0_.js +0 -17
- package/web/assets/EventCard-_39F_I5M.js +0 -1
- package/web/assets/ExcalidrawCanvas-4uYrLYin.css +0 -1
- package/web/assets/ExcalidrawCanvas-rXujil36.js +0 -1
- package/web/assets/FloatingToc-DNqAkkI0.js +0 -1
- package/web/assets/GitCloneDialog-CQx-O4j1.js +0 -1
- package/web/assets/HomepageView-DcWmTPQO.css +0 -1
- package/web/assets/HomepageView-MYEk3RCs.js +0 -3
- package/web/assets/ImageStudioPanels-4wnb2XF4.js +0 -3
- package/web/assets/ImageStudioView-qrmW8pfx.js +0 -1
- package/web/assets/InlineAiPanel-B3kd1ob2.js +0 -1
- package/web/assets/InlineFiles-Clnqh9jD.js +0 -1
- package/web/assets/MarkdownBlock-DT_wsaja.js +0 -58
- package/web/assets/ModelPill-JaIH3ffZ.js +0 -2
- package/web/assets/MuseLibraryView-DOJVVeU6.js +0 -2
- package/web/assets/MuseView-uxTmjVQa.js +0 -6
- package/web/assets/PenRow-COOYAaxx.js +0 -1
- package/web/assets/ProductView-DPTveulg.js +0 -1
- package/web/assets/RightPanel-BJUacrsf.js +0 -4
- package/web/assets/RightPanel-D0zk1g3I.css +0 -1
- package/web/assets/SketchCard-B_UU5sxV.js +0 -641
- package/web/assets/StudioGuestSurface-yBa4QKfX.js +0 -1
- package/web/assets/TargetHealthNotice-BLzDB-Xl.css +0 -1
- package/web/assets/TargetHealthNotice-CgkdTdhB.js +0 -47
- package/web/assets/TodoListView-CricdCfW.js +0 -1
- package/web/assets/Tooltip-o8ZqIb3L.js +0 -1
- package/web/assets/UnifiedPage-BWAyqj65.js +0 -69
- package/web/assets/UnifiedPage-CWXc_mo1.css +0 -1
- package/web/assets/ViewSelectionBar-35x8TiLA.js +0 -2
- package/web/assets/appStore-CI1_L5OS.js +0 -3357
- package/web/assets/appStore-DQc2marq.css +0 -1
- package/web/assets/approvalText-Cy2UAUAQ.js +0 -2
- package/web/assets/arrow-up-right-BDsMFoNQ.js +0 -1
- package/web/assets/astryxBridge-CF_hpqC2.css +0 -1
- package/web/assets/astryxBridge-CH_c5xjo.js +0 -70
- package/web/assets/automationListSource-CB6AWkL_.js +0 -1
- package/web/assets/boardSurface-CLvEUjbF.js +0 -1
- package/web/assets/book-open-BLzEdGfu.js +0 -1
- package/web/assets/calendarNavStore-BHUNxDx8.js +0 -1
- package/web/assets/canvasPrefs-CvE7mgyq.js +0 -1
- package/web/assets/chatBoxSurface-CuuHLzs5.js +0 -1
- package/web/assets/circle-question-mark-BM4ZRxQS.js +0 -1
- package/web/assets/circle-x-DTcNGZDT.js +0 -1
- package/web/assets/code-xml-AE3mT4T5.js +0 -1
- package/web/assets/codingNavigation-B0kVsy4x.js +0 -53
- package/web/assets/codingNavigation-DHCidM4N.css +0 -1
- package/web/assets/create-1JI2I47p.js +0 -14
- package/web/assets/dashboardSurface-CIE5HybN.js +0 -1
- package/web/assets/deskCapture-COW7aG5Y.js +0 -1
- package/web/assets/emoji-DZ9CA_3l.css +0 -1
- package/web/assets/emoji-DphwSxPx.js +0 -1
- package/web/assets/floatingTocSurface-BOm2QYBK.js +0 -1
- package/web/assets/foldActions-DNbJPlPl.js +0 -1
- package/web/assets/folder-DotgUhYD.js +0 -1
- package/web/assets/folder-plus-aJgL9NeP.js +0 -1
- package/web/assets/gestures-dqncPOwo.js +0 -1
- package/web/assets/git-branch-CwR2qic6.js +0 -1
- package/web/assets/hack2gate-dark-Dx2RtDRI.jpg +0 -0
- package/web/assets/hack2gate-light-DRKq9tyS.jpg +0 -0
- package/web/assets/hand-XNkzNiW2.js +0 -1
- package/web/assets/hard-drive-CfWKRoAE.js +0 -1
- package/web/assets/i18n-CykmULlm.css +0 -1
- package/web/assets/i18n.generated-BwynSSMk.js +0 -15
- package/web/assets/imageStudio-CWgLpC_d.js +0 -2
- package/web/assets/imageStudio-DZ0qGU2s.css +0 -1
- package/web/assets/index-B65ULikK.js +0 -1
- package/web/assets/index-BIIeiIap.js +0 -1
- package/web/assets/index-BOzsniE1.js +0 -297
- package/web/assets/index-BfrjVzia.js +0 -13
- package/web/assets/index-Bi9UtjVz.js +0 -1
- package/web/assets/index-C1uilc9i.js +0 -1
- package/web/assets/index-C3Dc3Ivz.js +0 -1
- package/web/assets/index-CJF_Ld1Y.js +0 -1
- package/web/assets/index-CMARP4oV.js +0 -1
- package/web/assets/index-C_RsQVNm.js +0 -7
- package/web/assets/index-ChyxZMm8.js +0 -1
- package/web/assets/index-CoKcOaZg.js +0 -1
- package/web/assets/index-CuviSCbk.js +0 -1
- package/web/assets/index-Cw43kua8.js +0 -1
- package/web/assets/index-D1fu6XQN.js +0 -3
- package/web/assets/index-DG-hXb63.js +0 -1
- package/web/assets/index-DjnTfJpN.js +0 -1
- package/web/assets/index-Dtw0abst.js +0 -1
- package/web/assets/index-W3ErfZiX.js +0 -1
- package/web/assets/index-Yc56b3XX.js +0 -1
- package/web/assets/index-d4jCdYJH.js +0 -1
- package/web/assets/index-siHtlYTM.js +0 -1
- package/web/assets/launchpad-C2c1MSVX.css +0 -1
- package/web/assets/layout-grid-CraV7nhh.js +0 -1
- package/web/assets/linkFollow-BpvDWzUx.js +0 -8
- package/web/assets/list-tree-cLJw-jYQ.js +0 -1
- package/web/assets/listFold-M8s5JYEC.js +0 -1
- package/web/assets/lock-DBkXXwaI.js +0 -1
- package/web/assets/lock-open-C-9-AWct.js +0 -1
- package/web/assets/log-out-C8bDXj9P.js +0 -1
- package/web/assets/main-BiS_5wrB.css +0 -1
- package/web/assets/main-CMk6twzA.js +0 -20
- package/web/assets/markdownEditorSurface-Bql20IAf.css +0 -1
- package/web/assets/markdownEditorSurface-DgQ0TUWH.js +0 -3
- package/web/assets/message-square-plus-8pfimvem.js +0 -1
- package/web/assets/minus-CfA9fAN3.js +0 -1
- package/web/assets/mobileEntry-DS1vohuL.css +0 -1
- package/web/assets/mobileEntry-NcMcK0LV.js +0 -13
- package/web/assets/nativeDownload-CNtwSCy0.js +0 -1
- package/web/assets/pageChrome-BR4cfIaA.js +0 -1
- package/web/assets/pageChrome-BbUhILy0.css +0 -1
- package/web/assets/pen-tool-C5ftHCnm.js +0 -1
- package/web/assets/pencil-ehhM9_9k.js +0 -1
- package/web/assets/phoneList-B6gwUJZF.js +0 -9
- package/web/assets/phoneList-iRdfiKA8.css +0 -1
- package/web/assets/pluginChat-DTTWWiUS.js +0 -2
- package/web/assets/redo-2-DCEAgQlN.js +0 -1
- package/web/assets/rotate-ccw-DdkrbRAB.js +0 -1
- package/web/assets/selectionActions-BQD2kox1.js +0 -2
- package/web/assets/selectionBarSurface-CzUZmJDJ.js +0 -1
- package/web/assets/server-Ddu9f1k3.js +0 -1
- package/web/assets/sharePage-CNrm2xTC.js +0 -2
- package/web/assets/star-Dxv7XANS.js +0 -1
- package/web/assets/tableSurface-Bly1iCXc.js +0 -1
- package/web/assets/terminal-CAmmC9cV.js +0 -1
- package/web/assets/type-Dz6rnTvG.js +0 -1
- package/web/assets/undo-2-B7izWNb_.js +0 -1
- package/web/assets/unitOwnerAccess-D4nKS6Gg.js +0 -1
- package/web/assets/unitShim-2_2hhGxS.js +0 -5
- package/web/assets/upload-DqpRRAhG.js +0 -1
- package/web/assets/userSpaces-VFu4s05v.js +0 -1
- package/web/assets/viewportLock-3AOdDmwi.js +0 -631
- package/web/assets/viewportLock-djvL8fUQ.css +0 -1
- package/web/assets/zoom-in-Bf-eKTnH.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as g,r as A,u as L,d as b,j as e,I as K}from"./index-BOzsniE1.js";import{kv as U,kw as V,kx as W,ky as S,kz as _,kA as T,kB as G,kl as F,kC as w,aL as J,fD as X,kD as M,kE as Y,kF as $,kG as Q,kH as Z,kI as ee,kJ as O,kK as P,fR as ae,kL as te,kM as ne}from"./appStore-CI1_L5OS.js";import{n as ce}from"./nativeDownload-CNtwSCy0.js";A({"calevtact.deleted":{zh:"已删除「{title}」",en:"Deleted “{title}”"},"calevtact.untitled":{zh:"未命名",en:"Untitled"},"calevtact.undo":{zh:"撤销",en:"Undo"}});function se(s,c,a){const l=U(s,c.rowId);s.isNoteView||ce({text:g("calevtact.deleted",{title:a||g("calevtact.untitled")}),level:"info",action:{label:g("calevtact.undo"),run:()=>V(s,c,l)}})}A({"evcard.editEvent":{zh:"编辑事件:{title}",en:"Edit event: {title}"},"evcard.untitled":{zh:"未命名",en:"Untitled"},"evcard.close":{zh:"关闭",en:"Close"},"evcard.name":{zh:"名称",en:"Name"},"evcard.done":{zh:"完成",en:"Done"},"evcard.openNote":{zh:"打开笔记",en:"Open note"},"evcard.openDb":{zh:"打开多维表",en:"Open database"},"evcard.delete":{zh:"删除",en:"Delete"},"evcard.rowlinkReadonly":{zh:"关联表列请在表格里编辑",en:"Edit related rows in the table"},"evcard.noOptions":{zh:"(无选项,请在表格里添加)",en:"(No options — add them in the table)"}});function le(s){const c=s.zoom||1,a=360,l=380,n=8*c;let d=s.right+n;d+a*c>window.innerWidth&&(d=Math.max(n,s.left-a*c-n));const i=Math.max(n,Math.min(s.top,window.innerHeight-l*c-n));return{left:d/c,top:i/c}}const re={text:O,number:ee,checkbox:Z,date:T,select:Q,multiselect:$,url:Y,page:S};function ie({col:s}){const c=M(s.type);if(c?.icon)return e.jsx(e.Fragment,{children:c.icon});const a=re[P(s.type)]??O;return e.jsx(a,{})}function pe({ev:s,at:c,onClose:a}){const{t:l}=L(),{db:n,row:d,colId:i,title:o}=s,h=!!n.readonly&&!n.writeCell,t=!n.readonly,m=!n.readonly,u=n.columns[0],v=m&&!(n.isNoteView&&u?.type==="page"),f=n.columns.filter(r=>r.id!==u?.id&&r.id!==i),B=le(c),x=i?W(s.raw):null,[N,y]=b.useState(!1),H=s.color??"var(--accent, #6c5ce7)",j=b.useRef(null),C=b.useRef(null),E=b.useRef(a);E.current=a;const I=!n.readonly||!!n.openRow;return b.useEffect(()=>{const r=document.activeElement instanceof HTMLElement?document.activeElement:null,q=window.requestAnimationFrame(()=>{(j.current?.querySelector(".amx-cal-card-title:not(.amx-cal-card-title-ro)")??C.current)?.focus()}),D=p=>{if(p.key==="Escape"){p.preventDefault(),E.current();return}if(p.key!=="Tab"||!j.current)return;const k=Array.from(j.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(!k.length)return;const R=k[0],z=k[k.length-1];p.shiftKey&&document.activeElement===R?(p.preventDefault(),z.focus()):!p.shiftKey&&document.activeElement===z&&(p.preventDefault(),R.focus())};return window.addEventListener("keydown",D),()=>{window.cancelAnimationFrame(q),window.removeEventListener("keydown",D),r?.focus()}},[]),e.jsx("div",{className:"amx-cal-cardcatch",onMouseDown:a,children:e.jsx("div",{className:"amx-cal-cardwrap",ref:j,role:"dialog","aria-modal":"true","aria-label":l("evcard.editEvent",{title:o||l("evcard.untitled")}),style:B,onMouseDown:r=>r.stopPropagation(),children:e.jsxs("div",{className:"amx-cal-cardin",children:[e.jsxs("div",{className:"amx-cal-card-top",children:[e.jsxs("span",{className:"amx-cal-card-src",children:[e.jsx("span",{className:"amx-cal-card-dot",style:{background:H}}),n.name]}),e.jsx("button",{className:"amx-cal-card-x",ref:C,onClick:a,"aria-label":l("evcard.close"),children:"×"})]}),e.jsxs("div",{className:"amx-cal-card-head",children:[e.jsx("span",{className:"amx-cal-card-ico amx-cal-card-headico",children:e.jsx(S,{})}),v?e.jsx("input",{className:"amx-cal-card-title","aria-label":l("evcard.name"),value:o,placeholder:l("evcard.untitled"),onChange:r=>_(n,d.rowId,r.target.value)}):e.jsx("div",{className:"amx-cal-card-title amx-cal-card-title-ro",children:o||l("evcard.untitled")})]}),i&&e.jsxs("div",{className:"amx-cal-card-row amx-cal-card-timerow",children:[e.jsx("span",{className:"amx-cal-card-ico",children:e.jsx(T,{})}),e.jsxs("div",{className:"amx-cal-card-timebody",children:[x&&!(N&&!h)&&e.jsxs("button",{type:"button",className:"amx-cal-card-timebtn",disabled:h,onClick:()=>y(!0),children:[e.jsxs("span",{className:"amx-cal-card-timehead",children:[x.head,x.badge&&e.jsx("span",{className:"amx-cal-card-badge",children:x.badge})]}),x.date&&e.jsx("span",{className:"amx-cal-card-timesub",children:x.date})]}),!h&&(N||!x)&&e.jsxs("div",{className:"amx-cal-card-timeedit",children:[e.jsx(G,{value:s.raw,onChange:r=>F(n,d.rowId,i,r),autoFocus:N}),x&&e.jsx("button",{type:"button",className:"amx-cal-card-timedone",onClick:()=>y(!1),children:l("evcard.done")})]})]})]}),f.length>0&&e.jsx("div",{className:"amx-cal-card-props",children:f.map(r=>e.jsxs("div",{className:"amx-cal-card-row amx-cal-card-prop",children:[e.jsxs("span",{className:"amx-cal-card-key",children:[e.jsx("span",{className:"amx-cal-card-ico",children:e.jsx(ie,{col:r})}),e.jsx("span",{className:"amx-cal-card-keyt",children:r.name})]}),e.jsx("div",{className:"amx-cal-card-ctl",children:m?e.jsx(oe,{db:n,row:d,col:r}):e.jsx("span",{className:"amx-cal-card-val",children:w(d.cells[r.id])||"—"})})]},r.id))}),(I||t)&&e.jsxs("div",{className:"amx-cal-card-foot",children:[I&&e.jsxs("button",{className:"amx-cal-card-open",onClick:()=>{n.openRow?n.openRow(d.rowId):X(n.path),a()},children:[e.jsx(J,{size:13})," ",n.openRow?l("evcard.openNote"):l("evcard.openDb")]}),t&&e.jsx("button",{className:"amx-cal-card-del",onClick:()=>{se(n,d,o),a()},children:l("evcard.delete")})]})]})})})}const de=new Set(["rowlink","lookup","formula","file"]);function oe({db:s,row:c,col:a}){const{t:l}=L(),n=M(a.type),d=P(a.type),i=K(c.cells[a.id],d),o=t=>F(s,c.rowId,a.id,t),h=ae(t=>a.type==="rowlink"&&a.refDb?t.entries[a.refDb]?.data??null:null);if(n){const t=n.Cell;return e.jsx(t,{value:i,column:a,onChange:o})}if(de.has(a.type)){const t=c.cells[a.id];let m=w(t);return a.type==="rowlink"&&h&&(m=te(t).map(u=>{const v=h.rows.find(f=>f.id===u);return v?ne(h,v,a.titleCol):"已失联"}).join(", ")),e.jsx("span",{className:"amx-cal-card-val",title:a.type==="rowlink"?l("evcard.rowlinkReadonly"):void 0,children:m||"—"})}switch(d){case"checkbox":return e.jsx("input",{"aria-label":a.name,className:"amx-cal-card-check",type:"checkbox",checked:i===!0,onChange:t=>o(t.target.checked?!0:void 0)});case"number":return e.jsx("input",{className:"amx-cal-card-input","aria-label":a.name,type:"number",value:i??"",onChange:t=>t.target.value===""?o(void 0):Number.isFinite(Number(t.target.value))&&o(Number(t.target.value))});case"date":return e.jsx("input",{"aria-label":a.name,className:"amx-cal-card-input",type:"date",value:i,onChange:t=>o(t.target.value||void 0)});case"select":return e.jsxs("select",{"aria-label":a.name,className:"amx-cal-card-input amx-cal-card-select",value:i,onChange:t=>o(t.target.value||void 0),children:[e.jsx("option",{value:"",children:"—"}),(a.options??[]).map(t=>e.jsx("option",{value:t,children:t},t))]});case"multiselect":{const t=i??[];return e.jsxs("div",{className:"amx-cal-card-chips",children:[(a.options??[]).map(m=>{const u=t.includes(m);return e.jsx("button",{className:`amx-cal-card-chip${u?" on":""}`,"aria-pressed":u,onClick:()=>{const v=u?t.filter(f=>f!==m):[...t,m];o(v.length?v:void 0)},children:m},m)}),(a.options??[]).length===0&&e.jsx("span",{className:"amx-cal-card-key",children:l("evcard.noOptions")})]})}case"page":return e.jsx("span",{className:"amx-cal-card-val",children:w(c.cells[a.id])||"—"});default:return e.jsx("input",{"aria-label":a.name,className:"amx-cal-card-input",value:i,onChange:t=>o(t.target.value||void 0)})}}export{pe as E,se as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.tangu-lovable .amx-boardhost .excalidraw,.tangu-soft .amx-boardhost .excalidraw,html .excalidraw.amx-board-portal{--island-bg-color: var(--bg-card);--island-bg-color-alt: var(--sidebar-bg);--default-bg-color: var(--bg);--popup-bg-color: var(--bg-card);--popup-secondary-bg-color: var(--sidebar-bg);--sidebar-bg-color: var(--bg-card);--color-surface-lowest: var(--bg-card);--color-surface-low: var(--sidebar-bg);--color-surface-mid: var(--bg);--color-surface-high: var(--accent-light);--color-surface-primary-container: var(--accent-light);--ui-font: var(--font-ui);--text-primary-color: var(--text);--color-on-surface: var(--text);--popup-text-color: var(--text);--input-label-color: var(--text-light);--keybinding-color: var(--text-faint);--color-muted: var(--text-muted);--color-muted-darker: var(--text-faint);--color-disabled: var(--text-ghost);--default-border-color: var(--border);--dialog-border-color: var(--border);--input-border-color: var(--border);--sidebar-border-color: var(--border);--list-border-color: var(--border);--color-border-outline: var(--overlay-strong);--color-border-outline-variant: var(--border);--color-primary: var(--accent-ink);--color-primary-hover: var(--accent-hover);--color-primary-darker: var(--accent-hover);--color-primary-darkest: var(--accent-hover);--color-primary-light: var(--accent-light);--color-primary-light-darker: var(--accent-light);--color-brand-hover: var(--accent-hover);--color-brand-active: var(--accent-hover);--color-selection: var(--accent-ink);--select-highlight-color: var(--accent-ink);--focus-highlight-color: var(--accent-ink);--link-color: var(--accent-ink);--link-color-hover: var(--accent-hover);--color-icon-white: var(--on-accent);--color-on-primary-container: var(--text);--border-radius-md: var(--radius-md);--border-radius-lg: var(--radius-lg);--shadow-island: var(--card-shadow);--shadow-island-stronger: var(--card-shadow);--modal-shadow: var(--card-shadow);--library-dropdown-shadow: var(--card-shadow);--sidebar-shadow: var(--card-shadow);--button-hover-bg: var(--overlay-light);--button-active-bg: var(--overlay-medium);--button-active-border: var(--overlay-strong);--input-bg-color: var(--bg-card);--input-hover-bg-color: var(--overlay-subtle);--overlay-bg-color: var(--overlay-light);--scrollbar-thumb: var(--overlay-medium);--scrollbar-thumb-hover: var(--overlay-strong);--color-danger: var(--danger)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as U,d as i,j as t,t as K,r as xe,ct as Ge,cu as We}from"./index-BOzsniE1.js";import{p as Je,c as Qe,d as et,s as tt,f as at,h as ke,n as ot,u as nt,C as ue,r as rt,i as st,E as lt,M as N,j as ct,k as it}from"./PenRow-COOYAaxx.js";import{J as dt,a7 as ut,fQ as ht,tj as pt,ff as De,lp as Fe,cE as He,d$ as mt,tq as he,tr as Le,ts as pe,tt as ft,tu as xt,tv as bt,af as ze,an as me,tw as gt,tx as fe}from"./appStore-CI1_L5OS.js";import{F as vt,T as yt}from"./type-Dz6rnTvG.js";import{P as wt}from"./pencil-ehhM9_9k.js";import{M as Be}from"./minus-CfA9fAN3.js";import{H as jt}from"./hand-XNkzNiW2.js";import{L as St}from"./lock-DBkXXwaI.js";import"./client-CaivGZFR.js";import"./pen-tool-C5ftHCnm.js";import"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";const Et=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]],Oe=dt("diamond",Et),oe=["left","mid","right"],M={left:["lock","hand"],mid:["selection","shape","line","freedraw","highlighter","text","eraser"],right:["frame","laser"]},Nt=[...M.left,...M.mid,...M.right],se="amx.boardToolbar",X=new Set;let C=null;const kt=e=>e<9?String(e+1):e===9?"0":null;function $e(e){const a=new Set,d={left:[],mid:[],right:[]},n=e??{};for(const s of oe)for(const o of Array.isArray(n[s])?n[s]:[])typeof o!="string"||!Nt.includes(o)||a.has(o)||(a.add(o),d[s].push(o));for(const s of oe)for(const o of M[s])a.has(o)||d[s].push(o);return d}const q=()=>{if(C)return C;try{const e=localStorage.getItem(se);if(e)return C=$e(JSON.parse(e))}catch{}return C=M},Lt=e=>{C=$e(e);try{localStorage.setItem(se,JSON.stringify(C))}catch{}for(const a of X)a()},zt=()=>{C=M;try{localStorage.removeItem(se)}catch{}for(const e of X)e()},Rt=e=>oe.every(a=>e[a].length===M[a].length&&e[a].every((d,n)=>d===M[a][n])),_e=e=>(X.add(e),()=>X.delete(e));function Ct(e,a,d,n){const s={left:[...e.left],mid:[...e.mid],right:[...e.right]};for(const o of oe){const r=s[o].indexOf(a);r>=0&&s[o].splice(r,1)}return s[d].splice(Math.max(0,Math.min(n,s[d].length)),0,a),s}typeof window<"u"&&window.addEventListener("storage",e=>{if(e.key===se){C=null;for(const a of X)a()}});xe({"boardtoolbar.shapeRectangle":{zh:"矩形",en:"Rectangle"},"boardtoolbar.shapeDiamond":{zh:"菱形",en:"Diamond"},"boardtoolbar.shapeEllipse":{zh:"椭圆",en:"Ellipse"},"boardtoolbar.lineArrow":{zh:"箭头",en:"Arrow"},"boardtoolbar.lineSegment":{zh:"线段",en:"Line"},"boardtoolbar.toolLock":{zh:"保持工具选中",en:"Keep tool selected"},"boardtoolbar.toolHand":{zh:"抓手",en:"Hand"},"boardtoolbar.toolSelection":{zh:"选择",en:"Selection"},"boardtoolbar.toolShape":{zh:"形状",en:"Shape"},"boardtoolbar.toolLine":{zh:"线",en:"Line"},"boardtoolbar.toolFreedraw":{zh:"画笔",en:"Draw"},"boardtoolbar.toolHighlighter":{zh:"荧光笔",en:"Highlighter"},"boardtoolbar.toolText":{zh:"文字",en:"Text"},"boardtoolbar.toolEraser":{zh:"橡皮",en:"Eraser"},"boardtoolbar.toolFrame":{zh:"画框",en:"Frame"},"boardtoolbar.toolLaser":{zh:"激光笔",en:"Laser pointer"}});const ne=["rectangle","diamond","ellipse"],re=["arrow","line"],Mt=()=>({shape:"rectangle",line:"arrow"}),At={rectangle:He,diamond:Oe,ellipse:Fe},Pt={arrow:De,line:Be},Re={get rectangle(){return K("boardtoolbar.shapeRectangle")},get diamond(){return K("boardtoolbar.shapeDiamond")},get ellipse(){return K("boardtoolbar.shapeEllipse")}},Ce={get arrow(){return K("boardtoolbar.lineArrow")},get line(){return K("boardtoolbar.lineSegment")}},It={lock:"boardtoolbar.toolLock",hand:"boardtoolbar.toolHand",selection:"boardtoolbar.toolSelection",shape:"boardtoolbar.toolShape",line:"boardtoolbar.toolLine",freedraw:"boardtoolbar.toolFreedraw",highlighter:"boardtoolbar.toolHighlighter",text:"boardtoolbar.toolText",eraser:"boardtoolbar.toolEraser",frame:"boardtoolbar.toolFrame",laser:"boardtoolbar.toolLaser"};function Ye(e,a,d){const n=a.getAppState();switch(e){case"lock":a.setActiveTool({...n.activeTool,locked:!n.activeTool.locked});return;case"shape":a.setActiveTool({type:d.group.current.shape});return;case"line":a.setActiveTool({type:d.group.current.line});return;case"freedraw":Qe(a,d.pen),a.setActiveTool({type:"freedraw"});return;case"highlighter":Je(a,d.pen,"highlighter");return;default:a.setActiveTool({type:e})}}function Tt(e,a){switch(e){case"lock":return St;case"hand":return jt;case"selection":return mt;case"shape":return At[a.shape];case"line":return Pt[a.line];case"freedraw":return wt;case"highlighter":return pt;case"text":return yt;case"eraser":return ht;case"frame":return vt;case"laser":return ut}}function Dt(e,a,d){const n=a.tool;switch(e){case"lock":return a.locked;case"shape":return ne.includes(n);case"line":return re.includes(n);case"freedraw":return n==="freedraw"&&d.active!=="highlighter";case"highlighter":return n==="freedraw"&&d.active==="highlighter";default:return n===e}}const Me=["left","mid","right"];function Ft({api:e,ui:a,refs:d}){const{t:n}=U(),s=i.useSyncExternalStore(_e,q,q),[o,r]=i.useState(null),m=i.useRef(null),b=i.useRef(null),u=o?.layout??s;if(!e)return null;const le=d.group.current,A=d.pen.current,Z=(f,x)=>{const g=b.current;if(!g)return null;let y=null,B=1/0;for(const v of Me){const R=g.querySelector(`[data-seg="${v}"]`);if(!R)continue;const j=R.getBoundingClientRect();if(f>=j.left&&f<=j.right){y=v;break}const J=f<j.left?j.left-f:f-j.right;J<B&&(B=J,y=v)}if(!y)return null;const L=[...g.querySelectorAll(`[data-seg="${y}"] [data-tool]`)];let E=L.length;for(let v=0;v<L.length;v++){const R=L[v].getBoundingClientRect();if(f<R.left+R.width/2){E=v;break}}const z=L.findIndex(v=>v.dataset.tool===x);return z>=0&&z<E&&E--,{seg:y,index:E}},G=(f,x)=>{f.button===0&&(m.current={x:f.clientX,y:f.clientY,id:x,moved:!1},f.currentTarget.setPointerCapture(f.pointerId))},W=f=>{const x=m.current;if(!x||!x.moved&&Math.hypot(f.clientX-x.x,f.clientY-x.y)<5)return;x.moved=!0;const g=Z(f.clientX,x.id);g&&r({id:x.id,layout:Ct(s,x.id,g.seg,g.index)})},P=i.useRef(0),V=f=>{const x=m.current;m.current=null,f.currentTarget.releasePointerCapture?.(f.pointerId),P.current=x?.moved?Date.now():0,x?.moved&&o&&Lt(o.layout),r(null)},H=f=>{if(Date.now()-P.current<400){P.current=0;return}Ye(f,e,d)};return t.jsx("div",{className:"amx-toolbar",ref:b,"data-dragging":o?"":void 0,children:Me.map((f,x)=>t.jsxs("div",{className:"amx-toolbar-seg","data-seg":f,children:[x>0&&t.jsx("span",{className:"amx-toolbar-sep","aria-hidden":!0}),u[f].map((g,y)=>{const B=Tt(g,le),L=Dt(g,a,A),E=f==="mid"?kt(y):null,z=n(It[g]);return t.jsxs("button",{type:"button","data-tool":g,"data-on":L||void 0,"data-drag":o?.id===g||void 0,className:"amx-tool",title:E?`${z} — ${E}`:z,"aria-label":z,"aria-pressed":L,onPointerDown:v=>G(v,g),onPointerMove:W,onPointerUp:V,onClick:()=>H(g),onPointerCancel:()=>{m.current=null,P.current=0,r(null)},children:[t.jsx(B,{size:17}),E&&t.jsx("span",{className:"amx-tool-key",children:E})]},g)})]},f))})}xe({"panelextras.secPen":{zh:"笔",en:"Pen"},"panelextras.secStroke":{zh:"笔触",en:"Stroke"},"panelextras.capRound":{zh:"圆头",en:"Round cap"},"panelextras.capButt":{zh:"方头",en:"Flat cap"},"panelextras.secShape":{zh:"形状",en:"Shape"},"panelextras.secLine":{zh:"线",en:"Line"}});const Ht={rectangle:He,diamond:Oe,ellipse:Fe},Bt={arrow:De,line:Be};function te({title:e,children:a}){return t.jsxs("fieldset",{className:"amx-panelsec",children:[t.jsx("legend",{children:e}),a]})}function Ot({api:e,ui:a,pen:d,group:n}){const{t:s}=U();if(!e)return null;const o=a.tool;if(o==="freedraw"){const r=d.current.active==="highlighter";return t.jsxs(t.Fragment,{children:[t.jsx(te,{title:s("panelextras.secPen"),children:t.jsx(et,{api:e,ui:a,state:d})}),r&&t.jsx(te,{title:s("panelextras.secStroke"),children:t.jsx("div",{className:"amx-panelrow buttonList",children:[!1,!0].map(m=>{const b=a.capRound===m,u=s(m?"panelextras.capRound":"panelextras.capButt");return t.jsx("label",{className:b?"active":"",title:u,"data-on":b||void 0,onClick:()=>tt(e,m),children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-label":u,children:t.jsx("line",{x1:"4",y1:"9",x2:"14",y2:"9",stroke:"currentColor",strokeWidth:"7",strokeLinecap:m?"round":"butt"})})},String(m))})})})]})}return ne.includes(o)?t.jsx(te,{title:s("panelextras.secShape"),children:t.jsx("div",{className:"amx-panelrow buttonList",children:ne.map(r=>{const m=Ht[r],b=o===r;return t.jsx("label",{className:b?"active":"",title:Re[r],"data-on":b||void 0,onClick:()=>{n.current.shape=r,e.setActiveTool({type:r})},children:t.jsx(m,{size:16,"aria-label":Re[r]})},r)})})}):re.includes(o)?t.jsx(te,{title:s("panelextras.secLine"),children:t.jsx("div",{className:"amx-panelrow buttonList",children:re.map(r=>{const m=Bt[r],b=o===r;return t.jsx("label",{className:b?"active":"",title:Ce[r],"data-on":b||void 0,onClick:()=>{n.current.line=r,e.setActiveTool({type:r})},children:t.jsx(m,{size:16,"aria-label":Ce[r]})},r)})})}):null}const $t=()=>({tool:"selection",locked:!1,snapshot:null,capRound:null}),_t=(e,a)=>e.tool===a.tool&&e.locked===a.locked&&e.snapshot===a.snapshot&&e.capRound===a.capRound;xe({"excalicanvas.addPage":{zh:"+ 新建页面",en:"+ New page"},"excalicanvas.delBlankPage":{zh:"删掉这张空白页",en:"Delete this blank page"},"excalicanvas.modeFull":{zh:"常规",en:"Standard"},"excalicanvas.modeCompact":{zh:"紧凑",en:"Compact"},"excalicanvas.paper":{zh:"纸张",en:"Paper"},"excalicanvas.paperNone":{zh:"无限",en:"Infinite"},"excalicanvas.portrait":{zh:"纵向",en:"Portrait"},"excalicanvas.landscape":{zh:"横向",en:"Landscape"},"excalicanvas.flow":{zh:"页面排布",en:"Page layout"},"excalicanvas.flowV":{zh:"上下",en:"Top to bottom"},"excalicanvas.flowH":{zh:"左右",en:"Left to right"},"excalicanvas.grid":{zh:"网格",en:"Grid"},"excalicanvas.gridH":{zh:"横线",en:"Horizontal"},"excalicanvas.gridV":{zh:"竖线",en:"Vertical"},"excalicanvas.opacity":{zh:"淡浓",en:"Opacity"},"excalicanvas.uiMode":{zh:"属性面板",en:"Properties panel"},"excalicanvas.allBoards":{zh:"所有白板",en:"All boards"},"excalicanvas.toolbar":{zh:"工具栏",en:"Toolbar"},"excalicanvas.resetOrder":{zh:"恢复默认顺序",en:"Reset to default order"}});const ae=4,Yt="linear-gradient(90deg, var(--amx-grid-line) 0 1px, transparent 1px)",Ut="linear-gradient(180deg, var(--amx-grid-line) 0 1px, transparent 1px)",Ae=(e,a,d)=>Math.min(Math.max(e,a),d),Pe=(e,a)=>(e%a+a)%a;function Ie(e,a,d){const[n,s]=i.useState(null);return i.useEffect(()=>{if(!e)return;let o=null;const r=()=>{const b=e.querySelector(a);if(!b){o&&(o.remove(),o=null,s(null));return}if(o&&o.parentElement===b)return;o?.remove();const u=document.createElement("div");u.className=d,b.insertBefore(u,b.firstChild),o=u,s(u)};r();const m=new MutationObserver(r);return m.observe(e,{childList:!0,subtree:!0}),()=>{m.disconnect(),o?.remove(),s(null)}},[e,a,d]),n}function Vt(e){i.useEffect(()=>{const a=new Map,d=o=>{o.classList.contains("amx-board-portal")||o.classList.add("amx-board-portal"),o.style.zoom!==e&&(o.style.zoom=e)},n=o=>{if(!(o instanceof HTMLElement)||!o.classList.contains("excalidraw")||o.closest(".amx-boardhost")||(d(o),a.has(o)))return;const r=new MutationObserver(()=>d(o));r.observe(o,{attributes:!0,attributeFilter:["class","style"]}),a.set(o,r)};for(const o of[...document.body.children])n(o);const s=new MutationObserver(o=>{for(const r of o){for(const m of r.addedNodes)n(m);for(const m of r.removedNodes)m instanceof HTMLElement&&a.has(m)&&(a.get(m)?.disconnect(),a.delete(m))}});return s.observe(document.body,{childList:!0}),()=>{s.disconnect();for(const o of a.values())o.disconnect()}},[e])}function ia({initialData:e,theme:a,langCode:d,settings:n,onSettings:s,onSceneChange:o,registerApplier:r,viewMode:m=!1}){const{t:b}=U(),[u,le]=i.useState(null),A=i.useRef(null),Z=i.useRef([]),G=i.useRef(null),W=i.useRef(null),P=i.useRef(null),V=i.useRef(!1),[H,f]=i.useState(null),[x,g]=i.useState(null),y=i.useMemo(()=>he(n)?Le(n,x):{min:0,max:0},[n,x]),B=i.useMemo(()=>Array.from({length:y.max-y.min+1},(c,l)=>y.min+l),[y]),L=i.useMemo(()=>Le({...n,pageFirst:0,pageLast:0},x),[n,x]),E=i.useSyncExternalStore(at,ke,ke),z=i.useRef(ot()),v=i.useRef(Mt()),R=i.useMemo(()=>({pen:z,group:v}),[]),[j,J]=i.useState($t),[Ue,Ve]=i.useState(""),[be,ge]=i.useState(null),ve=Ie(be,".App-toolbar","amx-toolbar-slot"),ye=Ie(be,".Island > .selected-shape-actions, .Island > .compact-shape-actions, .Island.compact-shape-actions","amx-panel-slot");Vt(Ue),nt(u,j.tool,j.snapshot,z),i.useEffect(()=>{ne.includes(j.tool)&&(v.current.shape=j.tool),re.includes(j.tool)&&(v.current.line=j.tool)},[j.tool]),i.useEffect(()=>{if(!u)return;const c=l=>{if(l.metaKey||l.ctrlKey||l.altKey||!/^[0-9]$/.test(l.key))return;const h=A.current?.querySelector(".excalidraw"),p=l.target;if(!h||!p||!h.contains(p)||p.isContentEditable||p.tagName==="INPUT"||p.tagName==="TEXTAREA")return;const S=q().mid[l.key==="0"?9:Number(l.key)-1];S&&(l.preventDefault(),l.stopImmediatePropagation(),Ye(S,u,R))};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[u,R]),i.useEffect(()=>{u?.setDesktopUIMode(E)},[u,E]),i.useEffect(()=>{if(!(!u||!r))return r(c=>{const l=u.getSceneElementsIncludingDeleted(),h=Ge(l,c.elements??[]);if(We(h,l))return;u.updateScene({elements:rt(h,null),captureUpdate:ue.NEVER});const p=Object.values(c.files??{});p.length&&u.addFiles(p)})},[u,r]),i.useEffect(()=>{const c=u&&A.current?.querySelector(".excalidraw");if(!c)return;const l=document.createElement("div");return l.style.display="contents",c.insertBefore(l,c.firstChild),f(l),ge(c),()=>{l.remove(),f(null),ge(null)}},[u]);const O=i.useCallback(c=>{const l=G.current,h=Z.current.filter(w=>!!w);if(!l||!h.length)return;const p=c.zoom.value,S=he(n),I=n.gridV*p,Q=n.gridH*p,ee=[],ie=[],de=[],Ke=S||I<ae?0:Pe(c.scrollX*p,I),Xe=S||Q<ae?0:Pe(c.scrollY*p,Q);I>=ae&&(ee.push(Yt),ie.push(`${I}px 100%`),de.push(`${Ke}px 0px`)),Q>=ae&&(ee.push(Ut),ie.push(`100% ${Q}px`),de.push(`0px ${Xe}px`));for(const w of h)w.style.backgroundImage=ee.join(", "),w.style.backgroundSize=ie.join(", "),w.style.backgroundPosition=de.join(", "),w.style.opacity=n.gridOpacity>=100?"":String(n.gridOpacity/100),w.style.display=ee.length||S?"":"none";if(!S){Object.assign(h[0].style,{left:"0px",top:"0px",width:"100%",height:"100%"}),l.style.display="none";return}const je=(w,k,T)=>{if(!w)return;const D=(k.x+c.scrollX)*p,Y=(k.y+c.scrollY)*p,F=22,qe=n.flow==="h"?T?D+k.w*p+F:D-F:D+k.w*p/2,Ze=n.flow==="h"?Y+k.h*p/2:T?Y+k.h*p+F:Y-F;w.style.left=`${qe}px`,w.style.top=`${Ze}px`},Se=[];for(let w=0;w<h.length;w++){const k=pe(n,y.min+w);if(!k)continue;const T=(k.x+c.scrollX)*p,D=(k.y+c.scrollY)*p,Y=k.w*p,F=k.h*p;Object.assign(h[w].style,{left:`${T}px`,top:`${D}px`,width:`${Y}px`,height:`${F}px`}),Se.push(`M${T.toFixed(1)} ${D.toFixed(1)}H${(T+Y).toFixed(1)}V${(D+F).toFixed(1)}H${T.toFixed(1)}Z`)}const Ee=pe(n,y.min),Ne=pe(n,y.max);Ee&&je(W.current,Ee,!1),Ne&&je(P.current,Ne,!0),l.style.display="",l.style.clipPath=`path(evenodd,"M0 0H${l.offsetWidth}V${l.offsetHeight}H0Z ${Se.join(" ")}")`},[n,y]),$=i.useCallback(c=>{if(!u||V.current)return c;const l=u.getAppState();if(l.cursorButton==="down")return c;const h=ft(n,{scrollX:c.scrollX,scrollY:c.scrollY,zoom:c.zoom.value,width:l.width,height:l.height},x);if(!h)return c;V.current=!0;try{u.updateScene({appState:{scrollX:h.scrollX,scrollY:h.scrollY,zoom:{value:h.zoom}},captureUpdate:ue.NEVER})}finally{V.current=!1}return{scrollX:h.scrollX,scrollY:h.scrollY,zoom:{value:h.zoom}}},[u,n,x]),ce=i.useCallback(c=>{const l=xt(c);g(h=>h&&l&&h.minX===l.minX&&h.minY===l.minY&&h.maxX===l.maxX&&h.maxY===l.maxY?h:l)},[]),we=i.useRef(n.flow);i.useEffect(()=>{const c=we.current,l=n.flow;if(we.current=l,c===l||!u||!n.paper)return;const h=u.getSceneElements();h.length&&u.updateScene({elements:h.map(p=>{const S=bt(n,c,l,p.x,p.y);return S.x===p.x&&S.y===p.y?p:st(p,{x:S.x,y:S.y})}),captureUpdate:ue.IMMEDIATELY})},[u,n]),i.useEffect(()=>{!u||!H||(ce(u.getSceneElements()),O($(u.getAppState())))},[u,H,O,$,ce]);const _=i.useCallback(()=>{const c=A.current;if(!c)return;const l=c.parentElement?.currentCSSZoom??1,h=Math.abs(l-1)>1e-6?String(1/l):"";c.style.zoom!==h&&(c.style.zoom=h),Ve(p=>p===h?p:h)},[]);return i.useEffect(()=>(_(),window.addEventListener(ze,_),()=>window.removeEventListener(ze,_)),[_]),i.useEffect(()=>{const c=A.current;if(!c||!u||typeof ResizeObserver>"u")return;const l=new ResizeObserver(()=>{_(),O($(u.getAppState()))});return l.observe(c),()=>l.disconnect()},[u,O,$,_]),t.jsxs("div",{className:"amx-boardhost",ref:A,children:[t.jsx(lt,{onExcalidrawAPI:le,initialData:e,theme:a,langCode:d,viewModeEnabled:m,onScrollChange:(c,l,h)=>O($({scrollX:c,scrollY:l,zoom:h})),onChange:(c,l,h)=>{ce(c),O($(l));const p=l.currentStrokeOptions,S={tool:l.activeTool.type,locked:!!l.activeTool.locked,snapshot:l.resetCustomPen??null,capRound:p?!!p.options?.start?.cap:null};J(I=>_t(I,S)?I:S),o(it(c,l,h,"local"))},children:t.jsxs(N,{children:[t.jsx(N.DefaultItems.LoadScene,{}),t.jsx(N.DefaultItems.SaveToActiveFile,{}),t.jsx(N.DefaultItems.Export,{}),t.jsx(N.DefaultItems.SaveAsImage,{}),t.jsx(N.DefaultItems.SearchMenu,{}),t.jsx(N.DefaultItems.Help,{}),t.jsx(N.DefaultItems.ClearCanvas,{}),t.jsx(N.Separator,{}),t.jsx(N.DefaultItems.ToggleTheme,{allowSystemTheme:!1}),t.jsx(N.DefaultItems.ChangeCanvasBackground,{}),t.jsx(N.Separator,{}),t.jsx(N.ItemCustom,{children:t.jsx(qt,{settings:n,onSettings:s,uiMode:E,onUiMode:ct})})]})}),ve&&me.createPortal(t.jsx(Ft,{api:u,ui:j,refs:R}),ve),ye&&me.createPortal(t.jsx(Ot,{api:u,ui:j,pen:z,group:v}),ye),H&&me.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"amx-matte",ref:G,onWheel:Kt}),B.map((c,l)=>t.jsx("div",{className:"amx-grid","data-page":c,ref:h=>{Z.current[l]=h}},c)),!!he(n)&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"amx-pageadd","data-end":"before","data-flow":n.flow,ref:W,children:[t.jsx("button",{onClick:()=>s({pageFirst:n.pageFirst-1}),children:b("excalicanvas.addPage")}),n.pageFirst<L.min&&t.jsx("button",{className:"amx-pageadd-del",title:b("excalicanvas.delBlankPage"),onClick:()=>s({pageFirst:n.pageFirst+1}),children:"−"})]}),t.jsxs("div",{className:"amx-pageadd","data-end":"after","data-flow":n.flow,ref:P,children:[t.jsx("button",{onClick:()=>s({pageLast:n.pageLast+1}),children:b("excalicanvas.addPage")}),n.pageLast>L.max&&t.jsx("button",{className:"amx-pageadd-del",title:b("excalicanvas.delBlankPage"),onClick:()=>s({pageLast:n.pageLast-1}),children:"−"})]})]})]}),H)]})}function Kt(e){const a=e.currentTarget.closest(".excalidraw")?.querySelector("canvas.excalidraw__canvas.interactive");a&&(e.preventDefault(),a.dispatchEvent(new WheelEvent("wheel",{deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,bubbles:!0,cancelable:!0})))}const Xt=[{id:"full",labelKey:"excalicanvas.modeFull"},{id:"compact",labelKey:"excalicanvas.modeCompact"}];function qt({settings:e,onSettings:a,uiMode:d,onUiMode:n}){const{t:s}=U(),o=a;return t.jsxs("div",{className:"amx-bs",children:[t.jsx("div",{className:"amx-bs-h",children:s("excalicanvas.paper")}),t.jsxs("div",{className:"amx-bs-row",children:[t.jsx("button",{className:"amx-bs-chip","data-on":!e.paper||void 0,onClick:()=>o({paper:null}),children:s("excalicanvas.paperNone")}),gt.map(r=>t.jsx("button",{className:"amx-bs-chip","data-on":e.paper===r||void 0,onClick:()=>o({paper:r}),children:r},r))]}),e.paper&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"amx-bs-row",children:[t.jsx("button",{className:"amx-bs-chip","data-on":!e.landscape||void 0,onClick:()=>o({landscape:!1}),children:s("excalicanvas.portrait")}),t.jsx("button",{className:"amx-bs-chip","data-on":e.landscape||void 0,onClick:()=>o({landscape:!0}),children:s("excalicanvas.landscape")})]}),t.jsx("div",{className:"amx-bs-h",children:s("excalicanvas.flow")}),t.jsxs("div",{className:"amx-bs-row",children:[t.jsx("button",{className:"amx-bs-chip","data-on":e.flow==="v"||void 0,onClick:()=>o({flow:"v"}),children:s("excalicanvas.flowV")}),t.jsx("button",{className:"amx-bs-chip","data-on":e.flow==="h"||void 0,onClick:()=>o({flow:"h"}),children:s("excalicanvas.flowH")})]})]}),t.jsx("div",{className:"amx-bs-h",children:s("excalicanvas.grid")}),t.jsx(Te,{label:s("excalicanvas.gridH"),value:e.gridH,onChange:r=>o({gridH:r})}),t.jsx(Te,{label:s("excalicanvas.gridV"),value:e.gridV,onChange:r=>o({gridV:r})}),t.jsx(Gt,{value:e.gridOpacity,disabled:e.gridH<=0&&e.gridV<=0,onCommit:r=>o({gridOpacity:r})}),t.jsxs("div",{className:"amx-bs-h",children:[s("excalicanvas.uiMode")," ",t.jsx("span",{className:"amx-bs-note",children:s("excalicanvas.allBoards")})]}),t.jsx("div",{className:"amx-bs-row",children:Xt.map(r=>t.jsx("button",{className:"amx-bs-chip","data-on":d===r.id||void 0,onClick:()=>n(r.id),children:s(r.labelKey)},r.id))}),t.jsx(Zt,{})]})}function Zt(){const{t:e}=U(),a=i.useSyncExternalStore(_e,q,q);return Rt(a)?null:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"amx-bs-h",children:[e("excalicanvas.toolbar")," ",t.jsx("span",{className:"amx-bs-note",children:e("excalicanvas.allBoards")})]}),t.jsx("div",{className:"amx-bs-row",children:t.jsx("button",{className:"amx-bs-chip",onClick:()=>zt(),children:e("excalicanvas.resetOrder")})})]})}function Gt({value:e,disabled:a,onCommit:d}){const{t:n}=U(),[s,o]=i.useState(e);return i.useEffect(()=>o(e),[e]),t.jsxs("label",{className:"amx-bs-check",children:[t.jsx("span",{className:"amx-bs-lbl",children:n("excalicanvas.opacity")}),t.jsx("input",{className:"amx-bs-range",type:"range",min:10,max:100,step:5,disabled:a,value:s,onChange:r=>{const m=Number(r.target.value);o(m);for(const b of r.currentTarget.closest(".excalidraw")?.querySelectorAll(".amx-grid")??[])b.style.opacity=m>=100?"":String(m/100)},onPointerUp:()=>d(s),onKeyUp:()=>d(s)}),t.jsxs("span",{className:"amx-bs-note",children:[s,"%"]})]})}function Te({label:e,value:a,onChange:d}){const[n,s]=i.useState(String(a||fe));i.useEffect(()=>{a>0&&s(String(a))},[a]);const o=()=>{const r=Math.round(Number(n)),m=Number.isFinite(r)&&r>0?Ae(r,4,400):fe;s(String(m)),a>0&&m!==a&&d(m)};return t.jsxs("label",{className:"amx-bs-check",children:[t.jsx("input",{type:"checkbox",checked:a>0,onChange:r=>d(r.target.checked?Ae(Math.round(Number(n))||fe,4,400):0)}),t.jsx("span",{className:"amx-bs-lbl",children:e}),t.jsx("input",{className:"amx-bs-num",type:"number",min:4,max:400,disabled:a<=0,value:n,onChange:r=>s(r.target.value),onBlur:o,onKeyDown:r=>{r.key==="Enter"&&o()}}),t.jsx("span",{className:"amx-bs-note",children:"px"})]})}export{ia as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as l,j as m}from"./index-BOzsniE1.js";import"./appStore-CI1_L5OS.js";const U="h1, h2, h3, [data-lcl-toc-title]";function h(t){return t?typeof t=="function"?t():"current"in t?t.current:t:null}const W=t=>{const u=/^H([1-6])$/.exec(t.tagName)?.[1],c=t.dataset.lclTocLevel??u??"1",d=Number(c),s=(t.dataset.lclTocTitle??t.textContent??"").trim();return s?{text:s,level:Number.isFinite(d)?Math.max(0,Math.min(6,Math.round(d))):1,primary:t.hasAttribute("data-lcl-toc-primary")||t.dataset.lclTocKind==="primary"}:null};function _(t,u){return t.length===u.length&&t.every((c,d)=>{const s=u[d];return c.target===s.target&&c.text===s.text&&c.level===s.level&&c.primary===s.primary&&c.onSelect===s.onSelect})}function P({scrollContainer:t,contentRoot:u,selector:c=U,itemFromElement:d=W,label:s="Table of contents",minItems:$=2,hideBelow:T=520,topOffset:y=24,topInset:p,side:A="left",scanTrigger:R,placement:j="overlay"}){const[v,w]=l.useState([]),[K,E]=l.useState(null),[z,F]=l.useState(!1),[B,M]=l.useState(!1),[C,X]=l.useState(!1),f=l.useRef(null),k=l.useRef(new WeakMap),q=l.useRef(0),S=l.useCallback(()=>{const e=h(t),r=h(u)??e;if(!r){w(a=>a.length?[]:a);return}let n;try{n=r.querySelectorAll(c)}catch(a){console.error(`[lcl] FloatingToc ignored invalid selector "${c}"`,a),w(g=>g.length?[]:g);return}const o=[];n.forEach((a,g)=>{let i=null;try{i=d(a,g)}catch(I){console.error("[lcl] FloatingToc item reader failed",I)}const L=String(i?.text??"").trim();if(!i||!L)return;let b=k.current.get(a);b||(b=`lcl-ftoc-${++q.current}`,k.current.set(a,b));const N=Number(i.level);o.push({...i,key:b,target:a,text:L,level:Number.isFinite(N)?Math.max(0,Math.min(6,Math.round(N))):1})}),w(a=>_(a,o)?a:o)},[u,d,t,c]);l.useEffect(()=>{S();const e=h(t),r=h(u)??e;if(!r||typeof MutationObserver>"u")return;let n=0;const o=new MutationObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(S)});return o.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{cancelAnimationFrame(n),o.disconnect()}},[u,S,R,t]),l.useEffect(()=>{const e=h(t);if(!e)return;const r=()=>X(T>0&&e.getBoundingClientRect().width<=T);if(r(),typeof ResizeObserver>"u")return;const n=new ResizeObserver(r);return n.observe(e),()=>n.disconnect()},[T,t]),l.useEffect(()=>{const e=h(t);if(!e||!v.length){E(null);return}let r=0;const n=()=>{r=0;const a=e.getBoundingClientRect().top+y+(p?.(e)??0)+1;let g=v[0];for(const i of v)if(!(!i.target.isConnected||!e.contains(i.target)))if(i.target.getBoundingClientRect().top<=a)g=i;else break;E(g?.key??null)},o=()=>{r||(r=requestAnimationFrame(n))};return n(),e.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",o),()=>{cancelAnimationFrame(r),e.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[v,t,y,p]),l.useEffect(()=>()=>{f.current!=null&&window.clearTimeout(f.current)},[]);const D=l.useCallback(e=>{const r=h(t);if(r){if(e.onSelect)try{e.onSelect()}catch(n){console.error("[lcl] FloatingToc navigation failed",n)}else if(r.contains(e.target)){const n=e.target.getBoundingClientRect().top-r.getBoundingClientRect().top+r.scrollTop;r.scrollTo({top:Math.max(0,n-y-(p?.(r)??0)),behavior:"smooth"})}E(e.key)}},[t,y,p]),H=()=>{f.current!=null&&window.clearTimeout(f.current),f.current=null,F(!0)},O=()=>{f.current!=null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>F(!1),150)};if(v.length<Math.max(1,$)||C)return null;const x=z||B;return m.jsx("div",{className:`lcl-ftoc-frame is-${j}`,"data-side":A,children:m.jsx("nav",{className:`lcl-ftoc${x?" open":""}`,style:x?void 0:{height:`min(44vh, ${v.length*6+12}px)`},onMouseEnter:H,onMouseLeave:O,onFocusCapture:()=>M(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||M(!1)},onKeyDown:e=>{e.key==="Escape"&&(F(!1),M(!1),e.target?.blur?.())},"aria-label":s,children:v.map(e=>{const r=K===e.key,n=(e.level===0?18:e.level===1?14:e.level===2?11:8)+(r?6:0);return m.jsxs("button",{type:"button",className:`lcl-ftoc-item${r?" active":""}${e.primary?" primary":""}`,onClick:()=>D(e),title:e.text,"aria-current":r?"location":void 0,style:{paddingInlineStart:x?8+e.level*10:0},children:[m.jsx("span",{className:"lcl-ftoc-bar",style:{transform:x?"translateX(0) scaleX(1)":`translateX(${e.level*3}px) scaleX(${n/4})`}}),m.jsx("span",{className:"lcl-ftoc-text",children:e.text})]},e.key)})})})}export{P as F};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as U,j as t,u as q,d as r}from"./index-BOzsniE1.js";import{jL as E,aU as z,g$ as R,jM as P,q as w,jN as T}from"./appStore-CI1_L5OS.js";import{c as D}from"./nativeDownload-CNtwSCy0.js";import{L as A}from"./lock-DBkXXwaI.js";import{G as $}from"./git-branch-CwR2qic6.js";import"./ipc-B6hkgxQL.js";import"./client-CaivGZFR.js";U({"gitClone.title":{zh:"从 Git 克隆",en:"Clone from Git"},"gitClone.subtitle":{zh:"把仓库克隆到这台电脑上,并加成一个项目。",en:"Clones the repository to this computer and adds it as a project."},"gitClone.tabUrl":{zh:"网址",en:"URL"},"gitClone.urlPlaceholder":{zh:"仓库地址,以 https:// 或 git@ 开头",en:"Repository address, starting with https:// or git@"},"gitClone.loading":{zh:"正在读取仓库列表…",en:"Loading repositories…"},"gitClone.empty":{zh:"这个账号下还没有仓库。",en:"This account has no repositories yet."},"gitClone.noHost":{zh:"这里用不了。登录 Forsion 后再试,或者用「网址」。",en:"Not available here. Sign in to Forsion and try again, or use URL."},"gitClone.githubUnlinked":{zh:"还没绑定 GitHub 账号。绑定后这里会列出你的仓库。",en:"No GitHub account is linked yet. Link one to list your repositories here."},"gitClone.link":{zh:"去绑定",en:"Link GitHub"},"gitClone.listFailed":{zh:"没能读到仓库列表。可以用「网址」直接贴地址。",en:"Could not load the repository list. You can paste an address under URL instead."},"gitClone.private":{zh:"私有",en:"Private"},"gitClone.public":{zh:"公开",en:"Public"},"gitClone.folderName":{zh:"文件夹名",en:"Folder name"},"gitClone.into":{zh:"放在",en:"Location"},"gitClone.choose":{zh:"选择文件夹…",en:"Choose folder…"},"gitClone.change":{zh:"更改…",en:"Change…"},"gitClone.confirm":{zh:"克隆",en:"Clone"},"gitClone.cloning":{zh:"正在克隆…",en:"Cloning…"},"gitClone.cloningHint":{zh:"大的仓库要等一会儿,别关掉这个窗口。",en:"Large repositories take a while. Keep this window open."},"gitClone.err.invalid_remote_url":{zh:"这个地址用不了。仓库地址要以 https:// 或 git@ 开头,而且不能把密码写在地址里。",en:"That address cannot be used. A repository address must start with https:// or git@ and must not contain a password."},"gitClone.err.invalid_folder_name":{zh:"文件夹名不能用。不要带斜杠或冒号,也不要以 - 开头。",en:"That folder name cannot be used. Leave out slashes and colons, and do not start it with a hyphen."},"gitClone.err.invalid_folder":{zh:"要放进去的文件夹不存在,重新选一个。",en:"The folder to clone into does not exist. Choose another one."},"gitClone.err.target_exists":{zh:"这个文件夹里已经有同名的东西了。换个文件夹名,或者换个位置。",en:"There is already something with that name in this folder. Use another folder name or another location."},"gitClone.err.remote_unreachable":{zh:"没能克隆:地址不对、没有权限,或者网络不通。",en:"Could not clone: the address is wrong, you have no access, or the network is down."},"gitClone.err.git_timeout":{zh:"克隆超时了。仓库很大时,可以在终端里克隆,再用「添加项目」把文件夹加进来。",en:"Cloning timed out. For a very large repository, clone it in a terminal, then add the folder as a project."},"gitClone.err.git_unavailable":{zh:"这台电脑上没有可用的 git。",en:"git is not available on this computer."},"gitClone.err.github_not_linked":{zh:"GitHub 没有接受这次请求:这台电脑上没有可用的 GitHub 凭据,你的 Forsion 账号也还没有绑定 GitHub 账号。",en:"GitHub refused this request: this computer has no working GitHub credentials, and your Forsion account has no GitHub account linked."},"gitClone.err.github_relink_required":{zh:"绑定的 GitHub 账号已经失效。在账户中心的「账号安全」里重新绑定后再试。",en:"The linked GitHub account no longer works. Link it again under Security in the account centre, then try again."},"gitClone.err.github_unavailable":{zh:"暂时领不到绑定的 GitHub 账号的凭据。确认已登录 Forsion 并且网络正常,稍后再试。",en:"Credentials for the linked GitHub account are unavailable right now. Check that you are signed in to Forsion and online, then try again."},"gitClone.err.forsion_git_unavailable":{zh:"暂时领不到 Forsion Git 的凭据。确认已登录 Forsion 并且网络正常,稍后再试。",en:"Forsion Git credentials are unavailable right now. Check that you are signed in to Forsion and online, then try again."},"gitClone.err.forsion_git_needs_setup":{zh:"你的 Forsion 账号还没有开通 Forsion Git。先在网页上登录一次 Forsion Git,再回来重试。",en:"Your Forsion account is not set up on Forsion Git yet. Sign in to Forsion Git on the web once, then try again."},"gitClone.err.unsupported":{zh:"当前连接的引擎不支持克隆,更新引擎后再试。",en:"The connected engine does not support cloning yet. Update it and try again."}});const M=new Set(["invalid_remote_url","invalid_folder_name","invalid_folder","target_exists","remote_unreachable","git_timeout","git_unavailable","github_not_linked","github_relink_required","github_unavailable","forsion_git_unavailable","forsion_git_needs_setup"]),B=a=>(a.trim().replace(/[/\\]+$/,"").split(/[/\\:]/).pop()??"").replace(/\.git$/i,"").replace(/^-+/,""),m=D(()=>({req:null}));function X(){return m.getState().req?Promise.resolve(null):new Promise(a=>{m.setState({req:{resolve:a}})})}function Z(){const a=m(o=>o.req);if(!a)return null;const n=o=>{m.getState().req===a&&(m.setState({req:null}),a.resolve(o))};return t.jsx("div",{className:"am-app tangu-lovable",style:{display:"contents"},children:t.jsx(K,{onDone:n})})}function K({onDone:a}){const{t:n}=q(),[o,k]=r.useState("forsion"),[p,f]=r.useState({}),[c,G]=r.useState(""),[b,j]=r.useState(""),[F,H]=r.useState(!1),[d,S]=r.useState(""),[l,x]=r.useState(!1),[u,h]=r.useState(null),C=window.tangu?.openAccountCenter?()=>{window.tangu.openAccountCenter("security")}:void 0,v=()=>{l||a(null)};E(v);const _=e=>{f(i=>({...i,[e]:{state:"loading"}})),P(w(),e).then(i=>{f(g=>({...g,[e]:i?{state:"ok",repos:i}:{state:"none"}})),!i&&e==="forsion"&&k(g=>g==="forsion"?"url":g)},i=>f(g=>({...g,[e]:{state:i?.code==="github_not_linked"||i?.code==="github_relink_required"?"unlinked":"failed"}})))};r.useEffect(()=>{o!=="url"&&!p[o]&&_(o)},[o]),r.useEffect(()=>{const e=()=>{p.github?.state==="unlinked"&&_("github")};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[p.github?.state]);const y=e=>{G(e),h(null),F||j(B(e))},L=async()=>{const e=await window.tangu?.pickDirectory?.({purpose:"project"});e&&(S(e),h(null))},N=async()=>{if(!(l||!c.trim()||!b.trim()||!d)){x(!0),h(null);try{a(await T(w(),c.trim(),d,b.trim()))}catch(e){const i=typeof e?.code=="string"?e.code:"";h({message:M.has(i)?n(`gitClone.err.${i}`):e?.status===404?n("gitClone.err.unsupported"):String(e?.message||e),info:typeof e?.info=="string"&&e.info&&i==="remote_unreachable"?e.info:void 0,link:i==="github_not_linked"||i==="github_relink_required"}),x(!1)}}},s=o==="url"?null:p[o];return t.jsx("div",{className:"dialog-overlay",onMouseDown:v,children:t.jsxs("div",{className:"dialog git-clone-dialog",role:"dialog","aria-modal":"true","aria-label":n("gitClone.title"),"data-git-clone":!0,onMouseDown:e=>e.stopPropagation(),children:[t.jsxs("div",{children:[t.jsx("div",{className:"dialog-title",children:n("gitClone.title")}),t.jsx("div",{className:"dialog-msg",children:n("gitClone.subtitle")})]}),t.jsx("div",{className:"git-clone-tabs",role:"tablist",children:["forsion","github","url"].map(e=>t.jsx("button",{type:"button",role:"tab","aria-selected":o===e,className:o===e?"on":"","data-git-clone-tab":e,disabled:l,onClick:()=>k(e),children:e==="forsion"?"Forsion Git":e==="github"?"GitHub":n("gitClone.tabUrl")},e))}),o==="url"?t.jsx("input",{className:"dialog-input",autoFocus:!0,spellCheck:!1,value:c,disabled:l,placeholder:n("gitClone.urlPlaceholder"),"data-git-clone-url":!0,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key==="Enter"&&N()}}):t.jsxs("div",{className:"dialog-list git-clone-list","data-git-clone-list":s?.state??"loading",children:[(!s||s.state==="loading")&&t.jsxs("div",{className:"dialog-msg git-clone-note",children:[t.jsx(z,{size:13,className:"spin"}),n("gitClone.loading")]}),s?.state==="none"&&t.jsx("div",{className:"dialog-msg git-clone-note",children:n("gitClone.noHost")}),s?.state==="failed"&&t.jsx("div",{className:"dialog-msg git-clone-note",children:n("gitClone.listFailed")}),s?.state==="unlinked"&&t.jsxs("div",{className:"dialog-msg git-clone-note",children:[n("gitClone.githubUnlinked"),C&&t.jsx("button",{type:"button",className:"dialog-btn","data-git-clone-link":!0,onClick:C,children:n("gitClone.link")})]}),s?.state==="ok"&&!s.repos.length&&t.jsx("div",{className:"dialog-msg git-clone-note",children:n("gitClone.empty")}),s?.state==="ok"&&s.repos.map(e=>t.jsxs("button",{type:"button",className:`dialog-listitem git-clone-repo${c===e.cloneUrl?" on":""}`,"aria-pressed":c===e.cloneUrl,disabled:l,onClick:()=>y(e.cloneUrl),children:[e.private?t.jsx(A,{size:13}):t.jsx($,{size:13}),t.jsx("strong",{children:e.fullName}),t.jsx("span",{className:"git-clone-chip",children:n(e.private?"gitClone.private":"gitClone.public")}),e.updatedAt&&t.jsx("small",{children:R(e.updatedAt)})]},e.cloneUrl))]}),t.jsxs("div",{className:"git-clone-where",children:[t.jsx("label",{htmlFor:"git-clone-name",children:n("gitClone.folderName")}),t.jsx("input",{id:"git-clone-name",className:"dialog-input",spellCheck:!1,value:b,disabled:l,maxLength:100,onChange:e=>{j(e.target.value),H(!0),h(null)}}),t.jsx("span",{children:n("gitClone.into")}),t.jsxs("div",{className:"git-clone-parent",children:[t.jsx("code",{title:d||void 0,children:t.jsx("bdi",{children:d||"—"})}),t.jsx("button",{type:"button",className:"dialog-btn","data-git-clone-parent":!0,disabled:l,onClick:()=>{L()},children:n(d?"gitClone.change":"gitClone.choose")})]})]}),u&&t.jsxs("div",{className:"git-clone-error",role:"alert","data-git-clone-error":!0,children:[t.jsx("p",{children:u.message}),u.info&&t.jsx("pre",{children:u.info}),u.link&&C&&t.jsx("button",{type:"button",className:"dialog-btn",onClick:C,children:n("gitClone.link")})]}),l&&t.jsx("div",{className:"dialog-msg git-clone-note",children:n("gitClone.cloningHint")}),t.jsxs("div",{className:"dialog-actions",children:[t.jsx("button",{className:"dialog-btn",disabled:l,onClick:v,children:n("common.cancel")}),t.jsxs("button",{className:"dialog-btn","data-primary":!0,"data-git-clone-confirm":!0,disabled:l||!c.trim()||!b.trim()||!d,onClick:()=>{N()},children:[l&&t.jsx(z,{size:13,className:"spin"}),n(l?"gitClone.cloning":"gitClone.confirm")]})]})]})})}export{Z as GitCloneHost,X as askGitClone,B as cloneFolderName};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Dancing Script;font-style:normal;font-weight:600;font-display:swap;src:url(./DancingScript-Bold-latin-CWNX0RqN.woff2) format("woff2")}.hp-root{position:relative;box-sizing:border-box;height:100%;overflow:clip;display:flex;--hp-padding-block: clamp(24px, 5vh, 48px);padding:calc(var(--hp-chrome-top, 0px) + var(--hp-padding-block)) 24px calc(var(--hp-chrome-bottom, 0px) + var(--hp-padding-block));isolation:isolate;background:var(--bg);--hp-glass-tint: color-mix(in srgb, var(--bg-card) 46%, transparent);--hp-glass-thick-tint: color-mix(in srgb, var(--bg-card) 58%, transparent);--hp-glass-sheen: var(--gl-sheen, linear-gradient(145deg, color-mix(in srgb, var(--bg-card) 20%, transparent), transparent 48%, color-mix(in srgb, var(--accent-ink) 4%, transparent)));--hp-glass-filter: var(--gl-blur-float, blur(40px) saturate(160%))}.hp-wallpaper,.hp-wallpaper-art,.hp-wallpaper-edge,.hp-wallpaper-tone,.hp-glow{position:absolute;inset:0;pointer-events:none}.hp-wallpaper{z-index:-5;background-position:center;background-size:cover;transform:scale(1.001);transition:transform .52s var(--ease-spring),filter .42s var(--ease-out)}.hp-root:not([data-wallpaper=true]) .hp-wallpaper{background:radial-gradient(ellipse 72% 58% at 12% 4%,color-mix(in srgb,var(--accent-ink) 11%,transparent),transparent 72%),radial-gradient(ellipse 62% 68% at 92% 92%,color-mix(in srgb,var(--accent-ink) 7%,var(--bg-card)),transparent 76%),linear-gradient(145deg,color-mix(in srgb,var(--bg) 94%,var(--accent-ink) 6%),var(--bg) 48%,color-mix(in srgb,var(--bg) 96%,var(--bg-card) 4%))}.hp-wallpaper-art{z-index:-4;overflow:hidden;opacity:.78;transition:opacity var(--duration-slow) var(--ease-out),transform .52s var(--ease-spring),filter .42s var(--ease-out)}.hp-wallpaper-art:before,.hp-wallpaper-art:after,.hp-theme-preview:before,.hp-theme-preview:after{content:"";position:absolute;pointer-events:none}.hp-root[data-wallpaper=true] .hp-wallpaper-art{opacity:0}.hp-root[data-theme-preset=rings] .hp-wallpaper-art,.hp-theme-preview[data-preset=rings]{background:radial-gradient(circle at 76% 27%,color-mix(in srgb,var(--accent-ink) 13%,transparent) 0 7%,transparent 7.4%),repeating-radial-gradient(circle at 76% 27%,transparent 0 54px,color-mix(in srgb,var(--accent-ink) 16%,transparent) 55px 56px,transparent 57px 94px)}.hp-root[data-theme-preset=rings] .hp-wallpaper-art{-webkit-mask-image:linear-gradient(115deg,transparent 8%,#000 48%,transparent 94%);mask-image:linear-gradient(115deg,transparent 8%,#000 48%,transparent 94%)}.hp-root[data-theme-preset=rings] .hp-wallpaper-art:before,.hp-theme-preview[data-preset=rings]:before{width:54%;height:70%;right:-9%;top:-16%;border:1px solid color-mix(in srgb,var(--accent-ink) 28%,transparent);border-radius:50%;transform:rotate(-24deg)}.hp-root[data-theme-preset=topography] .hp-wallpaper-art,.hp-theme-preview[data-preset=topography]{background:repeating-radial-gradient(ellipse at 9% 92%,transparent 0 34px,color-mix(in srgb,var(--accent-ink) 15%,transparent) 35px 36px,transparent 37px 66px)}.hp-root[data-theme-preset=topography] .hp-wallpaper-art{-webkit-mask-image:linear-gradient(35deg,#000 2%,rgba(0,0,0,.78) 48%,transparent 88%);mask-image:linear-gradient(35deg,#000 2%,rgba(0,0,0,.78) 48%,transparent 88%)}.hp-root[data-theme-preset=topography] .hp-wallpaper-art:after,.hp-theme-preview[data-preset=topography]:after{width:46%;height:38%;left:3%;bottom:5%;border:1px solid color-mix(in srgb,var(--accent-ink) 26%,transparent);border-radius:48% 58% 44% 62%;transform:rotate(-9deg)}.hp-root[data-theme-preset=weave] .hp-wallpaper-art,.hp-theme-preview[data-preset=weave]{background:repeating-linear-gradient(31deg,transparent 0 47px,color-mix(in srgb,var(--accent-ink) 12%,transparent) 48px 49px,transparent 50px 96px),repeating-linear-gradient(-31deg,transparent 0 63px,color-mix(in srgb,var(--border) 52%,transparent) 64px 65px,transparent 66px 128px)}.hp-root[data-theme-preset=weave] .hp-wallpaper-art{-webkit-mask-image:radial-gradient(ellipse 68% 72% at 50% 48%,#000 8%,rgba(0,0,0,.74) 58%,transparent 100%);mask-image:radial-gradient(ellipse 68% 72% at 50% 48%,#000 8%,rgba(0,0,0,.74) 58%,transparent 100%)}.hp-root[data-theme-preset=hack2gate] .hp-wallpaper,.hp-theme-preview[data-preset=hack2gate]{background-image:url(./hack2gate-light-DRKq9tyS.jpg)}html.dark .hp-root[data-theme-preset=hack2gate] .hp-wallpaper,html.dark .hp-theme-preview[data-preset=hack2gate]{background-image:url(./hack2gate-dark-Dx2RtDRI.jpg)}.hp-theme-preview[data-preset=hack2gate]{background-size:cover;background-position:center}.hp-wallpaper-edge{z-index:-3;opacity:.46;background:linear-gradient(to right,color-mix(in srgb,var(--bg) 92%,transparent),transparent 18%,transparent 82%,color-mix(in srgb,var(--bg) 92%,transparent)),linear-gradient(to bottom,color-mix(in srgb,var(--bg) 82%,transparent),transparent 20%,transparent 72%,color-mix(in srgb,var(--bg) 94%,transparent));mask-image:radial-gradient(ellipse 74% 76% at center,transparent 39%,rgba(0,0,0,.58) 74%,#000 100%);-webkit-mask-image:radial-gradient(ellipse 74% 76% at center,transparent 39%,rgba(0,0,0,.58) 74%,#000 100%);backdrop-filter:blur(14px) saturate(118%);-webkit-backdrop-filter:blur(14px) saturate(118%);transition:opacity var(--duration-slow) var(--ease-out)}.hp-root[data-wallpaper=true] .hp-wallpaper-edge{opacity:1;backdrop-filter:blur(24px) saturate(128%);-webkit-backdrop-filter:blur(24px) saturate(128%)}.hp-root[data-wallpaper=true][data-vignette=false] .hp-wallpaper-edge{opacity:.64}.hp-wallpaper-tone{z-index:-2;opacity:0;background:var(--hp-center-scrim, linear-gradient(transparent, transparent)),linear-gradient(to bottom,color-mix(in srgb,var(--bg) 24%,transparent),transparent 34%),linear-gradient(to right,color-mix(in srgb,var(--bg) 24%,transparent),transparent 15%,transparent 85%,color-mix(in srgb,var(--bg) 24%,transparent)),radial-gradient(ellipse at center,transparent 36%,color-mix(in srgb,var(--bg) 64%,transparent) 100%);transition:opacity var(--duration-slow) var(--ease-out)}.hp-root[data-wallpaper=true] .hp-wallpaper-tone{opacity:1}.hp-root[data-wallpaper=true][data-vignette=false] .hp-wallpaper-tone{opacity:.36}.hp-root[data-vignette=true]{--hp-center-scrim: radial-gradient(ellipse 46% 40% at 50% 56%, color-mix(in srgb, var(--bg) 40%, transparent), transparent 78%)}.hp-glow{z-index:-1;background:var(--glow, none)}.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:blur(8px) brightness(.86);transform:scale(1.045)}.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:blur(15px) brightness(.8) saturate(.9);transform:scale(1.065)}.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper-art{filter:blur(8px) brightness(.82) saturate(.9);transform:scale(1.045)}.hp-wallpaper-button{position:absolute;z-index:5;top:calc(var(--hp-chrome-top, 0px) + 16px);right:16px;width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--bg-card);color:var(--text-muted);box-shadow:var(--icon-shadow);cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-spring)}.hp-wallpaper-button:hover,.hp-wallpaper-button.on{color:var(--text);background:var(--bg-hover);transform:scale(1.05)}.hp-root .hp-wallpaper-button{background:color-mix(in srgb,var(--bg-card) 64%,transparent);backdrop-filter:blur(22px) saturate(145%);-webkit-backdrop-filter:blur(22px) saturate(145%)}.hp-wallpaper-file{display:none}.hp-wallpaper-credit{position:absolute;z-index:2;right:18px;bottom:12px;max-width:min(420px,54%);overflow:hidden;color:var(--text-light);font-size:var(--ui-font-caption, 11px);line-height:1.3;opacity:.58;text-overflow:ellipsis;white-space:nowrap}.hp-stack{position:relative;width:min(840px,100%);margin:auto;display:flex;flex-direction:column;align-items:center;gap:22px;transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.hp-title,.hp-composer,.hp-spaces{transition:opacity .32s var(--ease-out),transform .36s var(--ease-spring)}.hp-composer-focused .hp-title{opacity:.58;transform:translateY(-5px) scale(.985)}.hp-composer-focused .hp-composer{transform:translateY(-2px) scale(1.012)}.hp-composer-focused .hp-spaces{opacity:.74;transform:translateY(5px) scale(.988)}.hp-layer-focused .hp-stack{opacity:.18;transform:scale(.965)}.hp-secondary-open .hp-stack{opacity:0;transform:scale(.955);pointer-events:none}.hp-stack.leaving{opacity:0;transform:scale(.985)}@keyframes hp-rise{0%{transform:translateY(10px)}to{transform:none}}.hp-title,.hp-composer,.hp-spaces{animation:hp-rise var(--duration-slow) var(--ease-out) backwards}.hp-composer{animation-delay:60ms}.hp-spaces{animation-delay:.12s}.hp-title{text-align:center;-webkit-user-select:none;user-select:none}.hp-brand{margin-bottom:3px;color:var(--text);opacity:.38;font-family:Dancing Script,Snell Roundhand,Segoe Script,cursive;font-size:clamp(30px,4vw,42px);font-weight:700;line-height:1.2}.hp-clock{color:var(--text);font-size:clamp(48px,6vw,58px);font-weight:300;font-variant-numeric:tabular-nums;letter-spacing:-.035em;line-height:1}.hp-date{margin-top:9px;color:var(--text-muted);font-size:var(--ui-font-meta, 12px)}.hp-greet{margin-top:3px;color:var(--text-light);font-size:var(--ui-font-body, 13px)}.hp-root[data-wallpaper=true] .hp-brand{opacity:.62}.hp-root[data-wallpaper=true] .hp-date,.hp-root[data-wallpaper=true] .hp-greet{color:var(--text);opacity:.7}.hp-composer{width:100%}.hp-projectbar{display:flex;align-items:center;flex-wrap:wrap-reverse;gap:6px;padding:0 4px 6px}.hp-composer .t2c-inner{width:100%;max-width:none;padding:0}.hp-composer .t2c-card{box-shadow:var(--card-shadow)}.hp-spaces{box-sizing:border-box;width:100%;padding:10px;border:var(--border-width) solid transparent;border-radius:var(--radius-lg);background:transparent}.hp-root .hp-composer .t2c-card{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;isolation:isolate}.hp-root .hp-composer .t2c-card:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}.hp-root[data-wallpaper=true] .hp-spaces{border-color:transparent;background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}.hp-root .hp-composer .t2c-card.dragover{border-color:var(--accent-ink)}html[data-glass=off] .hp-root .hp-composer .t2c-card:before,html[data-glass=off] .hp-root[data-wallpaper=true] .hp-spaces,html[data-glass=off] .hp-root .hp-organizer-panel:before,html[data-glass=off] .hp-root .hp-folder-panel:before,html[data-glass=off] .hp-root .hp-organizer-grid .hp-tile-icon,html[data-glass=off] .hp-root .hp-organizer-new>span,html[data-glass=off] .hp-root .hp-wallpaper-button,html[data-glass=off] .hp-root .hp-wallpaper-edge,html[data-glass=off] .hp-root .hp-folder-head,html[data-glass=off] .hp-root .hp-organizer-head,html[data-glass=off] .hp-root .hp-wallpaper-sheet{background:var(--bg-card);backdrop-filter:none;-webkit-backdrop-filter:none}.hp-root .hp-composer .engine-picker-hint,.hp-root .hp-composer .agent-select-team{position:relative;isolation:isolate;padding:2px 10px;border-radius:var(--radius-pill)}.hp-root .hp-composer .project-pill{position:relative;isolation:isolate}.hp-root .hp-composer .engine-picker-hint:before,.hp-root .hp-composer .agent-select-team:before,.hp-root .hp-composer .project-pill:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:color-mix(in srgb,var(--bg-card) 64%,transparent);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}html[data-glass=off] .hp-root .hp-composer .engine-picker-hint:before,html[data-glass=off] .hp-root .hp-composer .agent-select-team:before,html[data-glass=off] .hp-root .hp-composer .project-pill:before{background:var(--bg-card);backdrop-filter:none;-webkit-backdrop-filter:none}.hp-root .hp-composer .engine-picker-hint.is-default{display:none}.hp-space-row{width:100%;min-width:0;display:flex;align-items:stretch;gap:5px}.hp-pinned-zone{box-sizing:border-box;flex:0 1 auto;width:max-content;min-width:170px;max-width:min(42%,350px);display:flex;align-items:flex-start;gap:4px;padding:2px;overflow-x:auto;overscroll-behavior-x:contain;border:var(--border-width) solid transparent;border-radius:var(--radius-md);transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.hp-pinned-zone[data-over=true]{border-color:color-mix(in srgb,var(--accent-ink) 50%,transparent);background:color-mix(in srgb,var(--accent-light) 68%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent-ink) 12%,transparent)}.hp-space-divider{flex:0 0 1px;align-self:stretch;min-height:54px;margin:10px 5px;border-radius:var(--radius-pill, 999px);background:color-mix(in srgb,var(--border-strong) 68%,transparent)}.hp-space-main{flex:1 1 0;min-width:0;display:flex;overflow-x:auto;overscroll-behavior-x:contain}.hp-pinned-zone .hp-tile,.hp-space-main .hp-tile{flex:0 0 82px}.hp-pinned-action{cursor:pointer;touch-action:auto}.hp-pinned-action:active{cursor:pointer}.hp-dock{display:flex;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start;gap:4px}.hp-tile{position:relative;box-sizing:border-box;width:82px;min-height:78px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:8px 5px 7px;border:var(--border-width) solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--text-muted);box-shadow:none;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;transition:transform var(--duration-fast) var(--ease-spring),color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),opacity var(--duration-fast) var(--ease-out)}.hp-tile:hover{color:var(--text);background:var(--bg-hover);transform:translateY(-2px)}.hp-tile:active{cursor:grabbing;transform:scale(.97)}.hp-tile.dragging{opacity:.16;cursor:grabbing}.hp-tile-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-md);background:var(--overlay-light, color-mix(in srgb, var(--text) 7%, transparent));color:var(--text-light);transition:transform var(--duration-fast) var(--ease-spring),background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.hp-tile:hover .hp-tile-icon{background:var(--overlay-medium, var(--bg-hover));color:var(--text)}.hp-tile-name{width:100%;overflow:hidden;color:inherit;font-size:var(--ui-font-caption, 11px);line-height:1.2;text-align:center;text-overflow:ellipsis;white-space:nowrap}.hp-tile[data-over]{border-color:var(--accent);box-shadow:0 0 0 .5px var(--accent)}.hp-folder[data-over] .hp-tile-icon{transform:scale(1.12);background:color-mix(in srgb,var(--accent) 16%,var(--overlay-light))}.hp-fpreview{display:grid;grid-template-columns:repeat(2,12px);grid-auto-rows:12px;place-content:center;gap:2px;background:var(--overlay-medium, var(--bg-hover))}.hp-fmini{display:inline-flex;align-items:center;justify-content:center;opacity:.82}.hp-folder.on{color:var(--text);background:var(--bg-hover)}.hp-folder-count,.hp-more-count{position:absolute;top:5px;right:6px;min-width:17px;height:17px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;border-radius:var(--radius-pill, 999px);background:var(--bg-card);color:var(--text-faint);font-size:var(--ui-font-caption, 11px);font-variant-numeric:tabular-nums}.hp-more{cursor:pointer}.hp-more-count{color:var(--accent-ink)}.hp-drag-overlay{pointer-events:none;cursor:grabbing;background:var(--bg-card);border-color:var(--accent);box-shadow:var(--card-shadow);opacity:.96;transform:rotate(1deg) scale(1.04)}.hp-spaces-empty{padding:20px 12px 22px;color:var(--text-faint);font-size:var(--ui-font-meta, 12px);text-align:center}@keyframes hp-stage-in{0%{opacity:0}to{opacity:1}}@keyframes hp-folder-open{0%{transform:translate(var(--hp-folder-dx),var(--hp-folder-dy)) scale(.24)}to{transform:none}}.hp-folder-stage,.hp-organizer-stage,.hp-wallpaper-stage{position:absolute;z-index:20;inset:0;display:grid;place-items:center;padding:calc(var(--hp-chrome-top, 0px) + 24px) 24px calc(var(--hp-chrome-bottom, 0px) + 24px)}.hp-folder-stage:before,.hp-organizer-stage:before,.hp-wallpaper-stage:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:color-mix(in srgb,var(--overlay-scrim) 72%,transparent);animation:hp-stage-in var(--duration-fast) var(--ease-out) both}.hp-folder-stage:before,.hp-organizer-stage:before{background:color-mix(in srgb,var(--overlay-scrim) 36%,transparent)}.hp-organizer-stage{z-index:20;overflow:auto}.hp-folder-panel,.hp-organizer-panel{position:relative;isolation:isolate;border-radius:var(--radius-chat-surface);box-shadow:var(--card-shadow)}.hp-root .hp-folder-panel:before,.hp-root .hp-organizer-panel:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--hp-glass-sheen),var(--hp-glass-thick-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter)}.hp-folder-panel{box-sizing:border-box;width:min(680px,100%);min-height:min(330px,calc(100% - 16px));max-height:min(620px,calc(100% - 16px));overflow:hidden;display:flex;flex-direction:column;padding:18px;border:0;background:transparent;transform-origin:center;animation:hp-folder-open .36s var(--ease-spring) backwards}.hp-root .hp-wallpaper-sheet{border-color:color-mix(in srgb,var(--border) 76%,transparent);background:color-mix(in srgb,var(--bg-card) 70%,transparent);backdrop-filter:blur(34px) saturate(155%);-webkit-backdrop-filter:blur(34px) saturate(155%)}.hp-folder-head{flex:none;width:min(480px,calc(100% - 24px));margin-inline:auto;padding:6px 7px 6px 9px;border:var(--border-width) solid color-mix(in srgb,var(--border) 76%,transparent);border-radius:var(--radius-pill, 999px);background:color-mix(in srgb,var(--bg-card) 58%,transparent);backdrop-filter:blur(28px) saturate(150%);-webkit-backdrop-filter:blur(28px) saturate(150%)}.hp-folder-head,.hp-wallpaper-head{display:flex;align-items:center;justify-content:space-between;gap:18px}.hp-folder-head>button,.hp-wallpaper-head>button{width:30px;height:30px;flex:none;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.hp-folder-head>button:hover,.hp-wallpaper-head>button:hover{color:var(--text);background:var(--bg-hover)}.hp-folder-identity{min-width:0;display:flex;align-items:center;gap:12px}.hp-folder-identity>span:last-child{min-width:0;display:flex;flex-direction:column}.hp-folder-identity strong{overflow:hidden;color:var(--text);font-size:var(--ui-font-heading, 14px);text-overflow:ellipsis;white-space:nowrap}.hp-folder-identity small{color:var(--text-faint);font-size:var(--ui-font-caption, 11px)}.hp-folder-hero{width:44px;height:44px;flex:none;display:inline-flex;align-items:center;justify-content:center}.hp-folder-hero>.hp-tile-icon{width:44px;height:44px}.hp-folder-hero>.hp-tile-name,.hp-folder-hero>.hp-folder-count{display:none}.hp-folder-grid{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-wrap:wrap;align-content:safe center;align-items:center;justify-content:center;gap:18px;padding:26px 4px 20px}.hp-folder-app{width:96px;min-width:0;min-height:104px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:10px 7px;border:var(--border-width) solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--text-light);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:grab;touch-action:none;transition:color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-spring),opacity var(--duration-fast) var(--ease-out)}.hp-folder-app:hover{color:var(--text);background:var(--bg-hover);transform:translateY(-3px)}.hp-folder-app:active{cursor:grabbing}.hp-folder-app.dragging{opacity:.18}.hp-folder-app>span:last-child{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hp-folder-app-icon{width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-md);background:var(--overlay-light)}.hp-folder-empty{margin:auto;max-width:270px;color:var(--text-faint);font-size:var(--ui-font-meta, 12px);line-height:1.6;text-align:center}.hp-folder-panel footer{flex:none;padding-top:12px;color:var(--text-ghost);font-size:var(--ui-font-caption, 11px);text-align:center}.hp-organizer-panel{box-sizing:border-box;width:min(590px,100%);max-height:calc(100% - 8px);overflow:hidden;display:flex;flex-direction:column;align-items:stretch;padding:8px 10px 7px;animation:hp-rise .36s var(--ease-spring) backwards}.hp-organizer-head{min-height:42px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:14px;width:min(440px,calc(100% - 24px));margin:0 auto 9px;padding:5px 7px 5px 8px;border:var(--border-width) solid color-mix(in srgb,var(--border) 76%,transparent);border-radius:var(--radius-pill, 999px);background:color-mix(in srgb,var(--bg-card) 58%,transparent);backdrop-filter:blur(28px) saturate(150%);-webkit-backdrop-filter:blur(28px) saturate(150%)}.hp-organizer-head>div{min-width:0;display:flex;align-items:center;gap:9px}.hp-organizer-head>div>span:nth-child(2){min-width:0;display:flex;flex-direction:column}.hp-organizer-head strong{color:var(--text);font-size:var(--ui-font-meta, 12px);line-height:1.3}.hp-organizer-head small{color:var(--text-faint);font-size:var(--ui-font-caption, 11px)}.hp-organizer-mark{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:50%;background:var(--overlay-light);color:var(--text-light)}.hp-organizer-head>button{width:30px;height:30px;flex:none;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.hp-organizer-head>button:hover{color:var(--text);background:var(--bg-hover)}.hp-organizer-grid{box-sizing:border-box;display:grid;grid-template-columns:repeat(6,78px);grid-auto-rows:78px;align-content:start;justify-content:center;justify-items:center;gap:6px 8px;min-height:0;max-height:414px;overflow-y:auto;overscroll-behavior:contain;padding:5px 8px;scroll-padding-block:5px}.hp-organizer-grid .hp-tile,.hp-organizer-new{width:78px;min-height:78px;padding:5px 3px;gap:5px}.hp-organizer-grid .hp-tile{color:var(--text-light)}.hp-organizer-grid .hp-tile-icon,.hp-organizer-new>span{width:40px;height:40px;background:color-mix(in srgb,var(--bg-card) 54%,transparent);backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%);box-shadow:var(--icon-shadow)}.hp-organizer-grid .hp-tile:hover{color:var(--text)}.hp-organizer-new{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:5px 3px;border:var(--border-width) solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--text-muted);font:inherit;cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-spring)}.hp-organizer-new>span{display:grid;place-items:center;border-radius:var(--radius-md);box-shadow:none}.hp-organizer-new small{max-width:100%;overflow:hidden;font-size:var(--ui-font-caption, 11px);text-overflow:ellipsis;white-space:nowrap}.hp-organizer-new:hover{color:var(--text);background:var(--bg-hover);transform:translateY(-2px)}.hp-organizer-grid .hp-tile-name,.hp-organizer-new small{font-size:var(--ui-font-caption, 11px)}.hp-organizer-panel>footer{flex:none;padding-top:7px;color:var(--text-ghost);font-size:var(--ui-font-caption, 11px);text-align:center}.hp-wallpaper-stage{z-index:30;justify-items:end}.hp-wallpaper-sheet{box-sizing:border-box;width:min(420px,100%);max-height:100%;overflow:auto;padding:18px;border:var(--border-width) solid var(--border);border-radius:calc(var(--radius-lg) + 4px);background:var(--bg-card);box-shadow:var(--card-shadow);animation:hp-rise var(--duration-slow) var(--ease-out) both}.hp-wallpaper-head>div{min-width:0;display:flex;flex-direction:column}.hp-wallpaper-head strong{color:var(--text);font-size:var(--ui-font-heading, 14px)}.hp-wallpaper-head span{color:var(--text-faint);font-size:var(--ui-font-caption, 11px);line-height:1.4}.hp-wallpaper-sources{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;margin-top:17px;padding:3px;border:var(--border-width) solid var(--border);border-radius:var(--radius-md);background:var(--overlay-subtle)}.hp-wallpaper-sources button{min-width:0;height:30px;display:inline-flex;align-items:center;justify-content:center;gap:4px;border:0;border-radius:calc(var(--radius-md) - 3px);background:transparent;color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer}.hp-wallpaper-sources button:hover{color:var(--text)}.hp-wallpaper-sources button.on{background:var(--bg-card);color:var(--text);box-shadow:var(--btn-shadow)}.hp-wallpaper-loading,.hp-wallpaper-error{min-height:126px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:20px;color:var(--text-faint);font-size:var(--ui-font-caption, 11px);line-height:1.5;text-align:center}.hp-wallpaper-error{min-height:48px;color:var(--danger)}.hp-theme-presets{padding-top:13px}.hp-theme-presets>p{margin:0 1px 9px;color:var(--text-faint);font-size:var(--ui-font-caption, 11px);line-height:1.45}.hp-theme-presets>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.hp-theme-presets button{position:relative;min-width:0;display:grid;grid-template-rows:auto 22px;overflow:hidden;padding:0;border:var(--border-width) solid transparent;border-radius:var(--radius-sm);background:var(--overlay-subtle);color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer;transition:transform var(--duration-fast) var(--ease-spring),border-color var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.hp-theme-presets button:hover{color:var(--text);transform:translateY(-2px)}.hp-theme-presets button.on{border-color:color-mix(in srgb,var(--accent-ink) 72%,var(--border));color:var(--text)}.hp-theme-presets button>span:nth-child(2){align-self:center;padding-inline:7px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.hp-theme-presets button>i{position:absolute;top:6px;right:6px;width:18px;height:18px;display:grid;place-items:center;border-radius:50%;background:var(--action-fill);color:var(--on-action);font-style:normal}.hp-theme-preview{position:relative;min-height:76px;overflow:hidden;background-color:color-mix(in srgb,var(--bg) 94%,var(--accent-ink) 6%)}.hp-wallpaper-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 1px 9px}.hp-wallpaper-switch,.hp-wallpaper-refresh{display:inline-flex;align-items:center;gap:7px;border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer}.hp-wallpaper-switch>span{position:relative;width:27px;height:16px;border-radius:var(--radius-pill, 999px);background:var(--overlay-strong)}.hp-wallpaper-switch>span:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--bg-card);transition:transform var(--duration-fast) var(--ease-spring)}.hp-wallpaper-switch.on>span{background:var(--action-fill)}.hp-wallpaper-switch.on>span:after{transform:translate(11px)}.hp-wallpaper-refresh:hover{color:var(--text)}.hp-wallpaper-refresh:disabled{opacity:.45;cursor:wait}.hp-wallpaper-refresh:disabled svg{animation:hp-spin .85s linear infinite}@keyframes hp-spin{to{transform:rotate(1turn)}}.hp-wallpaper-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.hp-wallpaper-grid button{position:relative;aspect-ratio:5 / 3;overflow:hidden;padding:0;border:var(--border-width) solid transparent;border-radius:var(--radius-sm);background:var(--overlay-light);cursor:pointer;transition:transform var(--duration-fast) var(--ease-spring),border-color var(--duration-fast) var(--ease-out)}.hp-wallpaper-grid button:hover{transform:translateY(-2px)}.hp-wallpaper-grid button.on{border-color:var(--accent-ink)}.hp-wallpaper-grid img{width:100%;height:100%;display:block;object-fit:cover}.hp-wallpaper-grid button>span{position:absolute;right:5px;bottom:5px;width:19px;height:19px;display:grid;place-items:center;border-radius:50%;background:var(--action-fill);color:var(--on-action)}.hp-wallpaper-custom{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:14px 1px 6px}.hp-wallpaper-custom-preview{grid-column:1 / -1;aspect-ratio:16 / 7;border-radius:var(--radius-md);background-color:var(--overlay-light);background-position:center;background-size:cover}.hp-wallpaper-custom>div:nth-child(2){min-width:0;display:flex;flex-direction:column}.hp-wallpaper-custom strong{color:var(--text);font-size:var(--ui-font-caption, 11px)}.hp-wallpaper-custom span{color:var(--text-faint);font-size:var(--ui-font-caption, 11px)}.hp-wallpaper-custom button{min-height:29px;display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:0 8px;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-muted);font:inherit;font-size:var(--ui-font-caption, 11px);cursor:pointer}.hp-wallpaper-custom button:hover{color:var(--text);background:var(--bg-hover)}.hp-wallpaper-options{margin-top:14px;padding-top:8px;border-top:var(--border-width) solid var(--border)}.hp-wallpaper-options>button{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:7px 3px;border:0;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}.hp-wallpaper-options>button>span{min-width:0;display:flex;flex-direction:column}.hp-wallpaper-options strong{font-size:var(--ui-font-caption, 11px)}.hp-wallpaper-options small{color:var(--text-faint);font-size:var(--ui-font-caption, 11px);font-weight:400}.hp-wallpaper-options i{position:relative;width:27px;height:16px;flex:none;border-radius:var(--radius-pill, 999px);background:var(--overlay-strong)}.hp-wallpaper-options i:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--bg-card);transition:transform var(--duration-fast) var(--ease-spring)}.hp-wallpaper-options button.on i{background:var(--action-fill)}.hp-wallpaper-options button.on i:after{transform:translate(11px)}@media(max-width:620px){.hp-root{padding-inline:12px;--hp-padding-block: 24px}.hp-wallpaper-button{top:calc(var(--hp-chrome-top, 0px) + 10px);right:10px}.hp-stack{gap:18px}.hp-clock{font-size:46px}.hp-brand{font-size:30px}.hp-dock{gap:2px}.hp-tile{width:70px;min-height:74px}.hp-pinned-zone{min-width:146px;max-width:48%;gap:2px}.hp-pinned-zone .hp-tile,.hp-space-main .hp-tile{flex-basis:70px}.hp-space-divider{margin-inline:3px}.hp-composer .t2c-card{padding-inline:11px}.hp-folder-stage,.hp-organizer-stage,.hp-wallpaper-stage{padding:calc(var(--hp-chrome-top, 0px) + 10px) 10px calc(var(--hp-chrome-bottom, 0px) + 10px)}.hp-organizer-panel{width:min(390px,100%);padding-inline:2px}.hp-organizer-grid{grid-template-columns:repeat(4,72px);grid-auto-rows:76px;gap:4px 6px}.hp-organizer-grid .hp-tile,.hp-organizer-new{width:72px;min-height:76px}.hp-folder-panel{min-height:300px;padding:14px}.hp-folder-grid{gap:5px}.hp-folder-app{width:82px;min-height:92px}.hp-wallpaper-sheet{width:100%;padding:15px}.hp-wallpaper-credit{display:none}}@media(max-width:390px){.hp-organizer-panel{width:min(300px,100%)}.hp-organizer-grid{grid-template-columns:repeat(3,72px)}.hp-theme-presets>div{grid-template-columns:1fr}}@media(max-height:700px){.hp-root{--hp-padding-block: 20px}.hp-stack{gap:16px}.hp-brand{font-size:28px}.hp-clock{font-size:44px}.hp-date{margin-top:6px}}@media(max-height:520px){.hp-root{--hp-padding-block: 12px}.hp-stack{gap:10px}.hp-brand{display:none}.hp-clock{font-size:32px}.hp-date{margin-top:3px;font-size:var(--ui-font-caption, 11px)}.hp-greet{display:none}}@media(prefers-reduced-motion:reduce){.hp-title,.hp-composer,.hp-spaces,.hp-folder-panel,.hp-folder-stage,.hp-folder-stage:before,.hp-organizer-panel,.hp-organizer-stage,.hp-organizer-stage:before,.hp-wallpaper-sheet,.hp-wallpaper-stage,.hp-wallpaper-stage:before{animation:none}.hp-stack,.hp-wallpaper,.hp-wallpaper-art,.hp-tile,.hp-tile-icon,.hp-folder-app{transition-duration:.01ms!important}.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-composer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper,.hp-root[data-focus-blur=true].hp-layer-focused .hp-wallpaper-art,.hp-root[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:none;transform:none}.hp-tile:hover,.hp-tile:active,.hp-folder-app:hover,.hp-drag-overlay{transform:none}}.hp-still .hp-title,.hp-still .hp-composer,.hp-still .hp-spaces,.hp-still .hp-folder-panel,.hp-still .hp-folder-stage,.hp-still .hp-folder-stage:before,.hp-still .hp-organizer-panel,.hp-still .hp-organizer-stage,.hp-still .hp-organizer-stage:before,.hp-still .hp-wallpaper-sheet,.hp-still .hp-wallpaper-stage,.hp-still .hp-wallpaper-stage:before{animation:none}.hp-still[data-focus-blur=true].hp-composer-focused .hp-wallpaper,.hp-still[data-focus-blur=true].hp-composer-focused .hp-wallpaper-art,.hp-still[data-focus-blur=true].hp-layer-focused .hp-wallpaper,.hp-still[data-focus-blur=true].hp-layer-focused .hp-wallpaper-art,.hp-still[data-focus-blur=true].hp-secondary-open .hp-wallpaper{filter:none;transform:none}.hp-still .hp-tile,.hp-still .hp-tile-icon,.hp-still .hp-folder-app{transition-duration:.01ms!important}.hp-root.hp-phone{--hp-dp: calc(1px / var(--uiz, 1));--hp-padding-block: calc(18 * var(--hp-dp));padding-inline:calc(18 * var(--hp-dp))}.hp-phone .hp-stack{align-items:stretch;height:100%;margin:0;gap:calc(14 * var(--hp-dp))}.hp-phone .hp-title{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:calc(6 * var(--hp-dp));text-align:left;margin-bottom:auto}.hp-phone .hp-brand{flex:0 0 100%;order:1;margin:0 0 calc(4 * var(--hp-dp));font-size:var(--ui-font-title, 16px)}.hp-phone .hp-greet{flex:0 0 100%;order:2;margin:0;color:var(--text);font-size:var(--ui-font-display, 20px);font-weight:600;line-height:1.25}.hp-phone .hp-date{order:3;margin-top:calc(6 * var(--hp-dp));font-size:var(--ui-font-body, 13px)}.hp-phone .hp-clock{order:4;font-size:var(--ui-font-body, 13px);font-weight:400;letter-spacing:0;line-height:inherit;color:var(--text-muted)}.hp-phone .hp-clock:before{content:"·";margin-right:calc(6 * var(--hp-dp))}.hp-root.hp-phone[data-wallpaper=true] .hp-greet{opacity:1}.hp-root.hp-phone[data-wallpaper=true] .hp-clock{color:var(--text);opacity:.7}.hp-phone .hp-cards{order:2;display:grid;grid-template-columns:1fr 1fr;gap:calc(12 * var(--hp-dp))}.hp-phone .hp-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-content:space-between;column-gap:calc(10 * var(--hp-dp));row-gap:calc(8 * var(--hp-dp));min-height:calc(104 * var(--hp-dp));padding:calc(16 * var(--hp-dp));border:0;border-radius:var(--radius-lg, 16px);background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter);box-shadow:var(--card-shadow);color:var(--text);font-family:var(--font-ui);text-align:left}.hp-phone .hp-card:active{transform:scale(.98)}.hp-phone .hp-card-icon{display:inline-flex;align-self:center;color:var(--text-muted)}.hp-phone .hp-card-icon>svg{width:calc(24 * var(--hp-dp));height:calc(24 * var(--hp-dp))}.hp-phone .hp-card-name{align-self:center;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ui-font-heading, 14px);font-weight:600}.hp-phone .hp-card-status{grid-column:1 / -1;min-width:0;min-height:1.3em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ui-font-caption, 11px);line-height:1.3;color:var(--text-muted)}.hp-phone .hp-pill{order:3;display:flex;align-items:center;gap:calc(12 * var(--hp-dp));height:calc(54 * var(--hp-dp));padding:0 calc(8 * var(--hp-dp)) 0 calc(20 * var(--hp-dp));border:0;border-radius:var(--radius-pill, 999px);background:var(--hp-glass-sheen),var(--hp-glass-tint);backdrop-filter:var(--hp-glass-filter);-webkit-backdrop-filter:var(--hp-glass-filter);box-shadow:var(--card-shadow);color:var(--text-muted);font-family:var(--font-ui);font-size:var(--ui-font-body, 13px);text-align:left}.hp-phone .hp-pill-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hp-phone .hp-pill-text[data-draft]{color:var(--text)}.hp-phone .hp-pill-mic{align-self:stretch;display:grid;place-items:center;width:calc(44 * var(--hp-dp));margin-inline:calc(-8 * var(--hp-dp))}.hp-phone .hp-pill-mic>svg{width:calc(20 * var(--hp-dp));height:calc(20 * var(--hp-dp))}.hp-phone .hp-pill-send{display:grid;place-items:center;width:calc(38 * var(--hp-dp));height:calc(38 * var(--hp-dp));border-radius:50%;background:var(--accent);color:var(--on-accent, #fff)}.hp-phone .hp-pill-send>svg{width:calc(18 * var(--hp-dp));height:calc(18 * var(--hp-dp))}.hp-phone .hp-composer{order:3}.hp-root.hp-phone:not(.hp-composer-focused) .hp-composer{display:none}.hp-root.hp-phone.hp-composer-focused .hp-pill,.hp-root.hp-phone.hp-composer-focused .hp-cards{display:none}.hp-root.hp-phone.hp-composer-focused .hp-composer{transform:none}.hp-root.hp-phone.hp-composer-focused .hp-title{opacity:1;transform:none}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{u as be,d as x,j as e,r as An}from"./index-BOzsniE1.js";import{J as nn,l as On,x as Ce,m as ne,g7 as Wn,l2 as Ve,l3 as zn,l4 as Tn,l5 as Rn,a0 as Ln,cF as _n,bu as Fn,gb as me,l6 as ge,l7 as fe,l8 as Ge,aM as xe,aR as je,aW as $n,l9 as sn,aq as Bn,ar as Hn,b as Un,u as F,a_ as tn,hW as Vn,la as Gn,lb as qn,lc as Kn,iF as Jn,ld as Yn,iG as Xn,le as Zn,an as Qn,ax as z,lf as es,lg as ns,lh as on,li as Se,a9 as ss,ge as qe,au as Ke,e5 as ts,e2 as os,y as we,t as Je,fW as as,cM as rs,fK as is,lj as ls,lk as cs,av as Ye,at as ds,ll as ps,b7 as us,ak as hs}from"./appStore-CI1_L5OS.js";import{b as ms,e as gs}from"./phoneList-B6gwUJZF.js";import"./client-CaivGZFR.js";import{a6 as fs,a7 as xs,a8 as js,a9 as ws,aa as vs,ab as bs,C as Cs,G as Ss}from"./TargetHealthNotice-CgkdTdhB.js";import{U as ks}from"./upload-DqpRRAhG.js";import{F as ys}from"./folder-plus-aJgL9NeP.js";import{L as Ns}from"./log-out-C8bDXj9P.js";import{P as Ms}from"./pencil-ehhM9_9k.js";import"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";import"./codeStudioStore-DhyMazGT.js";import"./RightPanel-BJUacrsf.js";import"./book-open-BLzEdGfu.js";import"./folder-DotgUhYD.js";import"./ModelPill-JaIH3ffZ.js";import"./create-1JI2I47p.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-8pfimvem.js";import"./emoji-DphwSxPx.js";import"./hand-XNkzNiW2.js";import"./pageChrome-BR4cfIaA.js";import"./server-Ddu9f1k3.js";import"./rotate-ccw-DdkrbRAB.js";const Ps=[["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ds=nn("folder-minus",Ps);const Es=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Xe=nn("grid-2x2",Es),an="forsion.homepage.wallpaper.v1",Is=32*1024*1024,rn={source:"theme",themePreset:"rings",bingDaily:!0,focusBlur:!0,vignette:!0,bing:null},T=t=>typeof t=="string"?t:"";function Ze(t){const s=T(t);try{const i=new URL(s);return i.protocol==="https:"&&(i.hostname==="www.bing.com"||i.hostname.endsWith(".bing.com"))?i.toString():""}catch{return""}}function ke(t){if(!t||typeof t!="object")return null;const s=t,i=Ze(s.url);if(!i)return null;const p=Ze(s.thumbnailUrl)||i,c=T(s.startDate);return{id:T(s.id)||c||i,url:i,thumbnailUrl:p,title:T(s.title),copyright:T(s.copyright),startDate:c}}function As(t){if(!t||typeof t!="object")return{...rn};const s=t,i=s.source==="bing"||s.source==="custom"?s.source:"theme",p=s.themePreset==="topography"||s.themePreset==="weave"||s.themePreset==="hack2gate"?s.themePreset:"rings";return{source:i,themePreset:p,bingDaily:s.bingDaily!==!1,focusBlur:s.focusBlur!==!1,vignette:s.vignette!==!1,bing:ke(s.bing)}}function Os(){try{return As(JSON.parse(localStorage.getItem(an)||"null"))}catch{return{...rn}}}function Ws(t){try{localStorage.setItem(an,JSON.stringify(t))}catch{}}function zs(t){return(Array.isArray(t)?t:t&&typeof t=="object"&&Array.isArray(t.images)?t.images:[]).flatMap(i=>{if(!i||typeof i!="object")return[];const p=i,c=T(p.urlbase),d=T(p.url),o=c?`https://www.bing.com${c}_UHD.jpg`:d.startsWith("/")?`https://www.bing.com${d}`:d,g=c?`https://www.bing.com${c}_400x240.jpg`:o,u=ke({id:T(p.startdate)||c||o,url:o,thumbnailUrl:g,title:p.title,copyright:p.copyright,startDate:p.startdate});return u?[u]:[]})}async function Ts(t){if(window.tangu?.wallpaperListBing){const i=await window.tangu.wallpaperListBing(t==="zh"?"zh-CN":"en-US",8);if(!i.ok)throw new Error(i.error||"Bing wallpaper unavailable");return i.items.map(ke).filter(p=>!!p)}const s=await fetch(`/api/wallpaper/daily?mkt=${t==="zh"?"zh-CN":"en-US"}&n=8&idx=0`);if(!s.ok)throw new Error(`HTTP ${s.status}`);return zs(await s.json())}const Rs="forsion-homepage",se="wallpaper",ye="custom";function Ls(){return new Promise((t,s)=>{const i=indexedDB.open(Rs,1);i.onupgradeneeded=()=>{i.result.objectStoreNames.contains(se)||i.result.createObjectStore(se)},i.onsuccess=()=>t(i.result),i.onerror=()=>s(i.error||new Error("IndexedDB unavailable"))})}async function Ne(t,s){const i=await Ls();try{return await new Promise((p,c)=>{const d=i.transaction(se,t),o=s(d.objectStore(se));let g;o.onsuccess=()=>{g=o.result},o.onerror=()=>c(o.error||d.error||new Error("Wallpaper storage failed")),d.oncomplete=()=>p(g),d.onerror=()=>c(d.error||new Error("Wallpaper storage failed")),d.onabort=()=>c(d.error||new Error("Wallpaper storage aborted"))})}finally{i.close()}}async function _s(){const t=await Ne("readonly",s=>s.get(ye));return t instanceof Blob&&t.type.startsWith("image/")?t:null}async function Fs(t){if(!t.type.startsWith("image/"))throw new Error("NOT_IMAGE");if(t.size>Is)throw new Error("TOO_LARGE");await Ne("readwrite",s=>s.put(t,ye))}async function $s(){await Ne("readwrite",t=>t.delete(ye))}const ln="forsion_home_cards_v1",cn=6;function Bs(){try{const t=JSON.parse(localStorage.getItem(ln)??"null");return Array.isArray(t)?t.filter(s=>typeof s=="string"):null}catch{return null}}function Hs(t){try{return localStorage.setItem(ln,JSON.stringify(t)),!0}catch{return!1}}function Us(t,s,i){const p=(t??[]).map(c=>s.find(d=>d.id===c)).filter(c=>!!c).slice(0,cn);return p.length?p:[...i]}const te="home",Vs=140,Gs=6,dn="forsion.homepage.pinned-spaces.v1",ve="homepage:pinned-spaces",V="homepage:pinned:",qs=["rb-market","rb-achievements"],Ks=["rings","topography","weave","hack2gate"],Qe=t=>{const s=es(t);return s.length?s:sn(t)};function Js({onDispatch:t,onStartCall:s,onInputModeChange:i}){const p=Un(a=>a.vaultRoot),c=Ce(a=>a.activeSpaceId),d=fs(null),o=F(tn(a=>({cfg:a.cfg,desktopConfig:a.desktopConfig,desktopMode:a.desktopMode,homeDir:a.homeDir,defaultWsDir:a.defaultWsDir,focusDirs:a.focusDirs,modelsResp:a.modelsResp,newChatWs:a.newChatWs,newChatCfg:a.newChatCfg,newChatModel:a.newChatModel,sessionMode:a.sessionMode,setSessionMode:a.setSessionMode,engines:a.engines,engineCaps:a.engineCaps,agentDefs:a.agentDefs,defaultAgentSlug:a.defaultAgentSlug,skillsList:a.skillsList,connState:a.connState,voiceOnByAgent:a.voiceOnByAgent,ensureEngineCaps:a.ensureEngineCaps,refreshVoiceMode:a.refreshVoiceMode,setSessionModel:a.setSessionModel,setNewChatCfg:a.setNewChatCfg,setSessionThinking:a.setSessionThinking,setDefaultModel:a.setDefaultModel,setModelContextWindow:a.setModelContextWindow,setVoiceMode:a.setVoiceMode,setExecConfig:a.setExecConfig,openSettings:a.openSettings,setNewChatWs:a.setNewChatWs,addLocalWorkspace:a.addLocalWorkspace,cloneGitProject:a.cloneGitProject,addCloudProject:a.addCloudProject,workspaces:a.workspaces,sessions:a.sessions,archivedSessions:a.archivedSessions,cloudProjects:a.cloudProjects,channelWorkspaces:a.channelWorkspaces,tr:a.tr})));Vn();const g=Gn(o),u=xs(),f=x.useMemo(()=>o.workspaces(),[o.workspaces,o.sessions,o.archivedSessions,o.cloudProjects,o.channelWorkspaces,o.defaultWsDir,o.homeDir,o.tr,p]),b=qn(o.sessionMode,g),C=b==="chat"||g.kind==="cloud"||g.kind==="rootless",l=x.useMemo(()=>Kn(Jn(Yn({execMode:C?"sandbox":"host",...Xn(o.desktopConfig,!C,b),cwd:C?void 0:g.path||void 0,...o.newChatCfg},b),p)),[C,b,o.desktopConfig,o.newChatCfg,g.path,p]),y=Zn(o)||"",S=o.modelsResp?.models?o.modelsResp.models.filter(a=>(a.modelType||"llm")==="llm"&&(!C||a.source==="forsion")):null,j=l.agentSlug||o.defaultAgentSlug,G=j?!!o.voiceOnByAgent[j]:!1;return x.useEffect(()=>{o.ensureEngineCaps(l.engineId||void 0)},[l.engineId,o.ensureEngineCaps]),x.useEffect(()=>{j&&o.refreshVoiceMode(j)},[j,o.refreshVoiceMode]),e.jsxs("div",{className:"hp-composer","data-kb-rise":!0,onClick:a=>a.stopPropagation(),onPointerDownCapture:()=>i(!0),onPointerDown:a=>a.stopPropagation(),onFocusCapture:()=>i(!0),onBlurCapture:a=>{a.relatedTarget instanceof Node&&!a.currentTarget.contains(a.relatedTarget)&&i(!1)},onKeyDownCapture:a=>{a.key==="Escape"&&a.target.matches?.(".t2c-ta")&&(a.target.blur(),i(!1))},children:[e.jsx("div",{className:"newchat-pickers",children:e.jsx(js,{sessionId:null,cfg:l})}),e.jsxs("div",{className:"hp-projectbar",children:[e.jsx(ws,{}),e.jsx(vs,{workspaces:u??f,value:g.key,onChange:o.setNewChatWs,onAddProject:!u&&window.tangu?.pickDirectory?()=>{o.addLocalWorkspace()}:void 0,onCloneProject:!u&&window.tangu?.pickDirectory?()=>{o.cloneGitProject()}:void 0,onAddCloudProject:u?void 0:a=>{o.addCloudProject(a)}}),e.jsx(bs,{})]}),e.jsx(Cs,{sessionId:null,liveOwner:c==="home",prepareLiveSession:s,autoFocus:!1,disabled:o.connState!=="ok",disabledPlaceholder:d,running:!1,execConfig:l,models:S,modelsResponse:o.modelsResp,modelId:y,onModelChange:a=>o.setSessionModel(a,null),engines:o.engines,engineId:l.engineId,engineModels:l.engineId?o.engineCaps[l.engineId]?.models??[]:void 0,engineModelId:l.engineModelId,onEngineModelChange:a=>o.setNewChatCfg(v=>({...v,engineModelId:a||void 0})),engineCommands:l.engineId?o.engineCaps[l.engineId]?.commands??[]:void 0,thinkingLevel:l.thinkingLevel,ultra:l.ultra,onThinkingChange:(a,v)=>o.setSessionThinking(a,null,void 0,v),defaultModelIds:{backgroundModelId:o.desktopConfig?.backgroundModelId||"",imageModelId:o.cfg.imageModelId||"",visionModelId:o.cfg.visionModelId||""},onDefaultModelChange:o.setDefaultModel,onContextWindowChange:(a,v)=>{o.setModelContextWindow(a,v)},maxIterations:l.maxIterations,onMaxIterationsChange:a=>o.setNewChatCfg(v=>({...v,maxIterations:a})),verifyCommand:l.verifyCommand,onVerifyCommandChange:a=>o.setNewChatCfg(v=>({...v,verifyCommand:a||void 0})),planMode:l.planMode,onPlanModeChange:a=>o.setNewChatCfg(v=>({...v,planMode:a})),preset:l.preset,onPresetChange:a=>o.setSessionMode(a),voiceMode:G,onVoiceModeChange:j?a=>{o.setVoiceMode(j,a)}:void 0,groupChat:l.groupChat,groupAgents:l.groupAgents,groupTempAgents:l.groupTempAgents,onGroupChange:a=>o.setNewChatCfg(v=>({...v,...a})),skills:o.skillsList,agents:o.agentDefs,currentAgentSlug:j,onOpenSettings:()=>o.openSettings("skills"),onExecConfigChange:a=>o.setExecConfig(a,null),onSend:(a,v,P,E,N)=>t(a,v,P,E,N),onStop:()=>{},autoRefFromMain:!1})]})}function $({tile:t}){return t.kind==="space"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hp-tile-icon",children:t.space.icon&&e.jsx(t.space.icon,{size:21})}),e.jsx("span",{className:"hp-tile-name",children:z(t.space.name)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"hp-tile-icon hp-fpreview",children:[t.members.slice(0,4).map(s=>e.jsx("span",{className:"hp-fmini",children:s.icon&&e.jsx(s.icon,{size:11})},s.id)),t.members.length===0&&e.jsx(ss,{size:19})]}),e.jsx("span",{className:"hp-tile-name",children:t.folder.name}),e.jsx("span",{className:"hp-folder-count",children:t.members.length})]})}function Ys(){try{const t=JSON.parse(localStorage.getItem(dn)||"[]");return Array.isArray(t)?[...new Set(t.filter(s=>typeof s=="string"&&s!==te))]:[]}catch{return[]}}function Xs({item:t}){const s=t.icon,i=t.tooltip?z(t.tooltip):"";return e.jsxs("button",{type:"button",className:"hp-tile hp-pinned-action","data-fixed-id":t.id,draggable:!1,"aria-label":i||void 0,title:i,onClick:t.onClick,children:[e.jsx("span",{className:"hp-tile-icon",children:s&&e.jsx(s,{size:21})}),e.jsx("span",{className:"hp-tile-name",children:i})]})}function Zs({space:t,onLaunch:s}){const i=`${V}${t.id}`,{attributes:p,listeners:c,setNodeRef:d,transform:o,isDragging:g}=ps({id:i}),u={kind:"space",id:`space:${t.id}`,space:t};return e.jsx("button",{ref:d,type:"button",className:`hp-tile hp-pinned-space${g?" dragging":""}`,"data-space-id":t.id,style:{transform:Se.Transform.toString(o)},"aria-label":z(t.name),title:z(t.name),...p,...c,onClick:()=>{g||s(t.id)},children:e.jsx($,{tile:u})})}function Qs({actions:t,spaces:s,onLaunch:i,labelText:p}){const{isOver:c,setNodeRef:d}=ns({id:ve});return e.jsxs("div",{ref:d,className:"hp-pinned-zone","data-over":c||void 0,"aria-label":p,children:[t.map(o=>e.jsx(Xs,{item:o},o.id)),s.map(o=>e.jsx(Zs,{space:o,onLaunch:i},o.id))]})}function en({tile:t,over:s,open:i,onOpen:p,onLaunch:c,onMenu:d}){const{attributes:o,listeners:g,setNodeRef:u,transform:f,transition:b,isDragging:C}=on({id:t.id}),l=t.kind==="space"?z(t.space.name):t.folder.name,y={transform:Se.Transform.toString(f),transition:b?`${b}, color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out)`:void 0};return e.jsx("button",{ref:u,type:"button",style:y,className:`hp-tile${t.kind==="folder"?" hp-folder":""}${C?" dragging":""}${i?" on":""}`,"data-id":t.id,"data-over":s||void 0,"aria-label":l,title:l,...o,...g,onClick:S=>{C||(t.kind==="folder"?(S.stopPropagation(),p(S,t.id)):c(t.space.id))},onContextMenu:t.kind==="folder"?S=>d(S,t.id):void 0,children:e.jsx($,{tile:t})})}function et({member:t,onLaunch:s,onMenu:i}){const p=`space:${t.id}`,{attributes:c,listeners:d,setNodeRef:o,transform:g,transition:u,isDragging:f}=on({id:p});return e.jsxs("button",{ref:o,type:"button",className:`hp-folder-app${f?" dragging":""}`,style:{transform:Se.Transform.toString(g),transition:u},"data-id":p,title:z(t.name),...c,...d,onClick:()=>{f||s(t.id)},onContextMenu:b=>i(b,p),children:[e.jsx("span",{className:"hp-folder-app-icon",children:t.icon&&e.jsx(t.icon,{size:24})}),e.jsx("span",{children:z(t.name)})]})}function nt(t){const s=()=>{const c=new Date;return{time:os(c),date:ts(c,{locale:t}),hour:c.getHours()}},[i,p]=x.useState(s);return x.useEffect(()=>{const c=()=>p(o=>{const g=s();return g.time===o.time&&g.date===o.date?o:g});c();const d=setInterval(c,1e3);return()=>clearInterval(d)},[t]),i}function st(){const[t,s]=x.useState("");return x.useEffect(()=>{let i=!0;const p=()=>{window.tangu?.authStatus?.().then(d=>{i&&s(d?.loggedIn&&(d.nickname||d.username)||"")}).catch(()=>{})};p();const c=window.tangu?.onAuthChanged?.(p);return()=>{i=!1,c?.()}},[]),t}function tt(){const t=Ce(u=>u.spaces),s=ne(u=>u.order),p=ne(u=>u.folders).filter(u=>u.zone==="top"),c=u=>t.find(f=>`space:${f.id}`===u),d=new Set(p.flatMap(u=>u.items)),o=Hn([...t.map(u=>`space:${u.id}`),...p.map(u=>u.id)],s).filter(u=>!d.has(u)),g=[];for(const u of o){if(u===`space:${te}`)continue;const f=p.find(C=>C.id===u);if(f){g.push({kind:"folder",id:u,folder:f,members:f.items.map(c).filter(C=>!!C)});continue}const b=c(u);b&&g.push({kind:"space",id:u,space:b})}return{tiles:g,topIds:o,order:s}}An({"home.folderMenu.renameTitle":{zh:"重命名收纳夹",en:"Rename folder"},"home.folderMenu.rename":{zh:"重命名",en:"Rename"},"home.folderMenu.dissolve":{zh:"解散收纳夹",en:"Dissolve folder"},"home.folderMenu.moveOut":{zh:"移出收纳夹",en:"Move out"},"home.pill":{zh:"问点什么…",en:"Ask anything…"},"home.card.continue":{zh:"继续:{title}",en:"Continue: {title}"},"home.card.claimable":{zh:"{n} 项可领取",en:"{n} to claim"},"home.card.earned":{zh:"已得 {n} 项",en:"{n} earned"},"home.card.installed":{zh:"已装 {n} 个插件",en:"{n} plugins installed"},"home.cards.editTitle":{zh:"主页卡片",en:"Home cards"},"home.cards.editHint":{zh:"勾选的显示在主页,1 到 {max} 张,按勾选的先后排。",en:"Checked ones show on Home (1 to {max}), in the order you check them."},"home.cards.done":{zh:"完成",en:"Done"}});function ot({tiles:t,actions:s,onLaunch:i}){const{t:p}=be(),c=at(),[d,o]=x.useState(Bs),g=l=>({id:`space:${l.id}`,name:z(l.name),statusId:l.id,spaceId:l.id,icon:l.icon,open:()=>i(l.id)}),u=t.filter(l=>l.kind==="space").map(l=>g(l.space)),f=[...t.flatMap(l=>l.kind==="space"?[l.space]:l.members).map(g),...s.map(l=>({id:l.id,name:l.tooltip?z(l.tooltip):"",statusId:l.id,icon:l.icon,open:()=>l.onClick?.()}))],b=Us(d,f,[...u.slice(0,2),...f.filter(l=>!l.spaceId)]),C=async()=>{const l=b.map(j=>j.id),y=await cs({title:p("home.cards.editTitle"),items:f.map(j=>({id:`card:${j.id}`,label:j.name,icon:j.icon&&"imageUrl"in j.icon&&j.icon.imageUrl?j.icon.nativeFallback:j.icon})),checked:l.map(j=>`card:${j}`),footer:p("home.cards.editHint",{max:String(cn)}),done:p("home.cards.done")}),S=y.handled?y.value?.checked.map(j=>j.slice(5)):void 0;!S?.length||S.join(`
|
|
2
|
-
`)===l.join(`
|
|
3
|
-
`)||Hs(S)&&o(S)};return e.jsx("section",{className:"hp-cards",children:b.map(l=>e.jsxs("button",{type:"button",className:"hp-card",...l.spaceId?{"data-space-id":l.spaceId}:{"data-fixed-id":l.id},onClick:y=>{y.stopPropagation(),l.open()},onContextMenu:y=>{y.preventDefault(),y.stopPropagation(),C()},children:[e.jsx("span",{className:"hp-card-icon",children:l.icon&&e.jsx(l.icon,{})}),e.jsx("span",{className:"hp-card-name",children:l.name}),e.jsx("span",{className:"hp-card-status",children:c(l.statusId)})]},l.id))})}function at(){const{t}=be(),s=F(d=>d.sessions[0]),i=as(d=>d.recents[0]),p=rs(d=>d.plugins.filter(o=>!o.builtin&&!o.preinstalled).length),c=is(tn(d=>({counters:d.counters,claimed:d.claimed,pluginSeries:d.pluginSeries})));return d=>{if(d==="tangu")return s?t("home.card.continue",{title:Ss(s.title,t)}):"";if(d==="amadeus")return i?(i.split("/").pop()??i).replace(/\.md$/i,""):"";if(d==="rb-market")return p?t("home.card.installed",{n:String(p)}):"";if(d==="rb-achievements"){const o=ls(c).flatMap(f=>f.achievements),g=o.filter(f=>!c.claimed[f.id]&&(c.counters[f.event]||0)>=f.goal).length,u=o.filter(f=>c.claimed[f.id]).length;return g?t("home.card.claimable",{n:String(g)}):u?t("home.card.earned",{n:String(u)}):""}return""}}function Et(t){const{t:s,locale:i}=be(),p=i==="zh",c=nt(i),d=st(),o=On(),g=Ce(n=>n.spaces),u=ne(n=>n.items),{tiles:f,topIds:b,order:C}=tt(),[l,y]=x.useState(Ys),[S,j]=x.useState(null),[G,a]=x.useState(null),[v,P]=x.useState(!1),[E,N]=x.useState(null),[A,D]=x.useState(null),[pn,Me]=x.useState(!1),[oe,ae]=x.useState(!1),[q,B]=x.useState(!1),[m,re]=x.useState(Os),[R,ie]=x.useState(null),[H,un]=x.useState([]),[Pe,De]=x.useState(!1),[Ee,K]=x.useState(""),[hn,mn]=x.useState(0),J=x.useRef(null),le=x.useRef(null),L=x.useRef(null),Y=x.useRef(null),[Ie]=x.useState(()=>{try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}),ce=Wn(Ve(Rn,{activationConstraint:{distance:6}}),Ve(Tn,{coordinateGetter:zn}));x.useEffect(()=>{Ws(m)},[m]),x.useEffect(()=>{try{localStorage.setItem(dn,JSON.stringify(l))}catch{}},[l]),x.useEffect(()=>{let n=!0;return _s().then(r=>{if(n){if(!r){re(h=>h.source==="custom"?{...h,source:"theme"}:h);return}ie(URL.createObjectURL(r))}}).catch(()=>{}),()=>{n=!1}},[]),x.useEffect(()=>()=>{R&&URL.revokeObjectURL(R)},[R]),x.useEffect(()=>{if(m.source!=="bing")return;let n=!0;return De(!0),K(""),Ts(i).then(r=>{n&&(un(r),r[0]&&re(h=>h.source==="bing"&&h.bingDaily&&h.bing?.id!==r[0].id?{...h,bing:r[0]}:h))}).catch(()=>{n&&K(s("home.wallpaper.bingError"))}).finally(()=>{n&&De(!1)}),()=>{n=!1}},[hn,i,s,m.source]),x.useEffect(()=>()=>{L.current&&(window.clearTimeout(L.current),L.current=null);const n=Y.current;Y.current=null,n?.()},[]);const de=n=>L.current?!1:Ie?(n(),!0):(Me(!0),Y.current=n,L.current=window.setTimeout(()=>{L.current=null,Y.current=null,n(),Me(!1)},Vs),!0),U=n=>{const r=us?hs()?.openSpace:void 0;r?r(n):de(()=>we(n))},X=g.some(n=>n.id==="tangu"),Ae=c.hour<5?"home.greet.night":c.hour<11?"home.greet.morning":c.hour<18?"home.greet.afternoon":"home.greet.evening",O=()=>ne.getState(),gn=()=>{N(null),P(!1),D(null)},Z=m.source==="bing"?m.bing?.url||null:m.source==="custom"?R:null,W=n=>{re(r=>({...r,...n}))},fn=n=>{if(n==="custom"&&!R){le.current?.click();return}if(n==="bing"){W({source:n,bing:m.bing||H[0]||null});return}W({source:n})},xn=n=>{n&&(K(""),Fs(n).then(()=>{ie(URL.createObjectURL(n)),W({source:"custom"})}).catch(r=>{K(s(r instanceof Error&&r.message==="TOO_LARGE"?"home.wallpaper.tooLarge":"home.wallpaper.invalid"))}))},jn=()=>{$s().catch(()=>{}),ie(null),W({source:"theme"})},wn=(n,r)=>{if(!n||n===r)return;const h=ds(C,b),w=h.indexOf(r);O().setZoneOrder("top",Ke(h,n,w>=0?w:h.length))},vn=(n,r)=>{!n||n===r||n.startsWith("folder:")||(O().moveIntoFolder(r,n),O().setZoneOrder("top",Ye(C,b,n)))},bn=n=>{O().moveOutOfFolder(n),O().setZoneOrder("top",[...Ye(C,b,n),n]),P(!0)},Cn=()=>{D(null),qe(p?"新建收纳夹":"New folder",p?"收纳夹":"Folder").then(n=>{const r=n?.trim();r&&(O().addFolder("top",r),P(!0))})},Oe=()=>{j(null),a(null)},We=n=>{N(null),D(null),j(String(n.active.id))},ze=n=>a(n.over?String(n.over.id):null),Te=n=>Oe(),Re=n=>{const r=String(n.active.id),h=n.over?String(n.over.id):null;if(Oe(),r.startsWith(V)){if(h!==ve){const k=r.slice(V.length);y(I=>I.filter(Ue=>Ue!==k))}return}if(h===ve){const k=f.find(I=>I.id===r);k?.kind==="space"&&k.space.id!==te&&y(I=>I.includes(k.space.id)?I:[...I,k.space.id]);return}if(!h||r===h)return;const w=f.find(k=>k.id===h);!r.startsWith("folder:")&&w?.kind==="folder"?vn(r,h):wn(r,h)},pe=(n,r,h)=>{n.preventDefault(),n.stopPropagation(),N(null),D({x:n.clientX,y:n.clientY,kind:r,id:h})},Le=(n,r)=>{const h=n.currentTarget.getBoundingClientRect(),w=J.current?.getBoundingClientRect();D(null),P(!1),N(k=>k?.id===r?null:{id:r,dx:w?h.left+h.width/2-(w.left+w.width/2):0,dy:w?h.top+h.height/2-(w.top+w.height/2):0})},M=E?f.find(n=>n.id===E.id):void 0,Q=M?.kind==="folder"?M.members:[],ee=f.slice(0,Gs),_e=Math.max(0,f.length-ee.length),_=S?f.find(n=>n.id===S):void 0,ue=S?.startsWith(V)?g.find(n=>n.id===S.slice(V.length)):void 0,Sn=l.map(n=>g.find(r=>r.id===n)).filter(n=>!!n),Fe=qs.map(n=>u.find(r=>r.id===n)).filter(n=>!!n),kn=Math.max(0,g.length-(g.some(n=>n.id===te)?1:0)),yn=n=>{if(!M||M.kind!=="folder"||!n.over)return;const r=String(n.active.id),h=String(n.over.id);if(r===h)return;const w=M.folder.items.indexOf(h);O().setFolderItems(M.id,Ke(M.folder.items,r,w<0?M.folder.items.length:w))},Nn=(n,r,h,w,k)=>X?new Promise(I=>{de(()=>{we("tangu"),Je.getState().openView("chat",{followActive:!0,reuseKey:"primary"},"main"),I(F.getState().send(n,r,h,w,k,null))})||I(!1)}):Promise.resolve(!1),Mn=()=>X?new Promise(n=>{de(()=>{we("tangu"),Je.getState().openView("chat",{followActive:!0,reuseKey:"primary"},"main");const h=F.getState().activeId;F.getState().newSession().then(()=>{const w=F.getState().activeId;n(w&&w!==h?w:null)},()=>n(null))})||n(null)}):Promise.resolve(null),he=()=>{const n=document.activeElement;n instanceof HTMLTextAreaElement&&n.matches(".hp-composer .t2c-ta")&&n.blur(),ae(!1)},Pn=(n=!1)=>{Qn.flushSync(()=>ae(!0));const r=J.current?.querySelector(".hp-composer");n?r?.querySelector(".t2c-mic-control")?.click():r?.querySelector(".t2c-ta")?.focus()},[$e,Dn]=x.useState("");x.useEffect(()=>{o&&!oe&&Dn(J.current?.querySelector(".hp-composer .t2c-ta")?.value.trim()??"")},[o,oe]);const Be=()=>{he(),B(!1),N(null),D(null),P(!0)},En=n=>{n.target.closest('button, input, textarea, [contenteditable="true"], .hp-composer, .ctx-menu, .hp-wallpaper-sheet')||(n.preventDefault(),n.stopPropagation(),D(null),E?N(null):v?P(!1):q?B(!1):Be())},He=n=>n.kind==="member"?[{id:"move-out",label:s("home.folderMenu.moveOut"),icon:e.jsx(Ns,{size:13}),run:()=>{bn(n.id),D(null),N(null)}}]:[{id:"rename",label:s("home.folderMenu.rename"),icon:e.jsx(Ms,{size:13}),run:()=>{const r=n.id,h=f.find(w=>w.id===r);D(null),qe(s("home.folderMenu.renameTitle"),h?.kind==="folder"?h.folder.name:"").then(w=>{const k=w?.trim();k&&O().renameFolder(r,k)})}},{id:"dissolve",label:s("home.folderMenu.dissolve"),icon:e.jsx(Ds,{size:13}),run:()=>{O().removeFolder(n.id),D(null)}}],In=ms(A,()=>{if(!A)return null;const n=A.kind==="folder"?f.find(r=>r.id===A.id):void 0;return{...n?.kind==="folder"?{title:n.folder.name}:{},sections:[{items:He(A)}]}},()=>D(null));return e.jsxs("div",{ref:J,className:`hp-root${o?" hp-phone":""}${Ie?" hp-still":""}${oe?" hp-composer-focused":""}${q?" hp-layer-focused":""}${E||v?" hp-secondary-open":""}`,"data-wallpaper":Z||m.themePreset==="hack2gate"?"true":void 0,"data-theme-preset":m.themePreset,"data-focus-blur":m.focusBlur?"true":"false","data-vignette":m.vignette?"true":"false",onPointerDown:n=>{n.target.closest(".hp-composer")||he()},onContextMenu:En,onClick:gn,children:[e.jsx("div",{className:"hp-wallpaper",style:Z?{backgroundImage:`url(${JSON.stringify(Z)})`}:void 0,"aria-hidden":!0}),e.jsx("div",{className:"hp-wallpaper-art","aria-hidden":!0}),e.jsx("div",{className:"hp-wallpaper-edge","aria-hidden":!0}),e.jsx("div",{className:"hp-wallpaper-tone","aria-hidden":!0}),e.jsx("div",{className:"hp-glow","aria-hidden":!0}),e.jsx("button",{type:"button",className:`hp-wallpaper-button${q?" on":""}`,"aria-label":s("home.wallpaper.open"),title:s("home.wallpaper.open"),onClick:n=>{n.stopPropagation(),he(),D(null),N(null),P(!1),B(r=>!r)},children:e.jsx(Ln,{size:16})}),e.jsxs("div",{className:`hp-stack${pn?" leaving":""}`,children:[e.jsxs("div",{className:"hp-title",children:[e.jsx("div",{className:"hp-brand",children:"Forsion is All You Need"}),e.jsx("div",{className:"hp-clock",children:c.time}),e.jsx("div",{className:"hp-date",children:c.date}),e.jsx("div",{className:"hp-greet",children:d?s(Ae+".named",{name:d}):s(Ae)})]}),X&&e.jsx(Js,{onDispatch:Nn,onStartCall:Mn,onInputModeChange:ae}),o&&X&&e.jsxs("button",{type:"button",className:"hp-pill","data-act":"home-pill",onClick:n=>{n.stopPropagation(),Pn(!!n.target.closest(".hp-pill-mic"))},children:[e.jsx("span",{className:"hp-pill-text","data-draft":$e?"":void 0,children:$e||s("home.pill")}),e.jsx("span",{className:"hp-pill-mic","aria-hidden":!0,children:e.jsx(_n,{})}),e.jsx("span",{className:"hp-pill-send","aria-hidden":!0,children:e.jsx(Fn,{})})]}),o&&e.jsx(ot,{tiles:f,actions:Fe,onLaunch:U}),!o&&e.jsx("section",{className:"hp-spaces","data-total":f.length,children:e.jsxs(me,{sensors:ce,collisionDetection:Qe,onDragStart:We,onDragOver:ze,onDragCancel:Te,onDragEnd:Re,children:[e.jsxs("div",{className:"hp-space-row",children:[e.jsx(Qs,{actions:Fe,spaces:Sn,labelText:s("home.pinnedSpaces"),onLaunch:U}),e.jsx("span",{className:"hp-space-divider","aria-hidden":!0}),e.jsx("div",{className:"hp-space-main",children:ee.length>0?e.jsx(ge,{items:ee.map(n=>n.id),strategy:fe,children:e.jsxs("div",{className:"hp-dock",children:[ee.map(n=>e.jsx(en,{tile:n,over:G===n.id,open:E?.id===n.id,onOpen:Le,onLaunch:U,onMenu:(r,h)=>pe(r,"folder",h)},n.id)),_e>0&&e.jsxs("button",{type:"button",className:"hp-tile hp-more",onClick:n=>{n.stopPropagation(),Be()},title:s("home.showAll"),children:[e.jsx("span",{className:"hp-tile-icon",children:e.jsx(Xe,{size:20})}),e.jsx("span",{className:"hp-tile-name",children:s("home.showAll")}),e.jsxs("span",{className:"hp-more-count",children:["+",_e]})]})]})}):e.jsx("div",{className:"hp-spaces-empty",children:s("home.noSpaces")})})]}),e.jsxs(Ge,{dropAnimation:null,children:[_&&!v&&e.jsx("div",{className:`hp-tile hp-drag-overlay${_.kind==="folder"?" hp-folder":""}`,children:e.jsx($,{tile:_})}),ue&&!v&&e.jsx("div",{className:"hp-tile hp-drag-overlay hp-pinned-space",children:e.jsx($,{tile:{kind:"space",id:`space:${ue.id}`,space:ue}})})]})]})})]}),e.jsx("input",{ref:le,className:"hp-wallpaper-file",type:"file",accept:"image/*",onChange:n=>{xn(n.currentTarget.files?.[0]),n.currentTarget.value=""}}),Z&&m.source==="bing"&&m.bing?.copyright&&e.jsx("div",{className:"hp-wallpaper-credit",title:m.bing.copyright,children:m.bing.copyright}),q&&e.jsx("div",{className:"hp-wallpaper-stage",onClick:()=>B(!1),children:e.jsxs("section",{className:"hp-wallpaper-sheet","aria-label":s("home.wallpaper.title"),onClick:n=>n.stopPropagation(),children:[e.jsxs("header",{className:"hp-wallpaper-head",children:[e.jsxs("div",{children:[e.jsx("strong",{children:s("home.wallpaper.title")}),e.jsx("span",{children:s("home.wallpaper.subtitle")})]}),e.jsx("button",{type:"button",onClick:()=>B(!1),"aria-label":s("common.close"),children:e.jsx(xe,{size:16})})]}),e.jsx("div",{className:"hp-wallpaper-sources","aria-label":s("home.wallpaper.source"),children:["theme","bing","custom"].map(n=>e.jsxs("button",{type:"button",className:m.source===n?"on":"","aria-pressed":m.source===n,"data-source":n,onClick:()=>fn(n),children:[m.source===n&&e.jsx(je,{size:12}),s(`home.wallpaper.${n}`)]},n))}),Ee&&e.jsx("div",{className:"hp-wallpaper-error",children:Ee}),m.source==="theme"&&e.jsxs("div",{className:"hp-theme-presets",children:[e.jsx("p",{children:s("home.wallpaper.themeHint")}),e.jsx("div",{children:Ks.map(n=>e.jsxs("button",{type:"button",className:m.themePreset===n?"on":"","data-preset":n,"aria-pressed":m.themePreset===n,onClick:()=>W({source:"theme",themePreset:n}),children:[e.jsx("span",{className:"hp-theme-preview","data-preset":n,"aria-hidden":!0}),e.jsx("span",{children:s(`home.wallpaper.preset.${n}`)}),m.themePreset===n&&e.jsx("i",{children:e.jsx(je,{size:11})})]},n))})]}),m.source==="bing"&&e.jsxs("div",{className:"hp-wallpaper-bing",children:[e.jsxs("div",{className:"hp-wallpaper-row",children:[e.jsxs("button",{type:"button",className:`hp-wallpaper-switch${m.bingDaily?" on":""}`,role:"switch","aria-checked":m.bingDaily,onClick:()=>{const n=!m.bingDaily;W({bingDaily:n,bing:n&&H[0]||m.bing})},children:[e.jsx("span",{"aria-hidden":!0})," ",s("home.wallpaper.daily")]}),e.jsxs("button",{type:"button",className:"hp-wallpaper-refresh",disabled:Pe,onClick:()=>mn(n=>n+1),children:[e.jsx($n,{size:13})," ",s("home.wallpaper.refresh")]})]}),Pe&&H.length===0&&e.jsx("div",{className:"hp-wallpaper-loading",children:s("home.wallpaper.loading")}),H.length>0&&e.jsx("div",{className:"hp-wallpaper-grid",children:H.map((n,r)=>e.jsxs("button",{type:"button",className:m.bing?.id===n.id?"on":"",title:n.copyright||n.title,"aria-label":n.title||n.copyright||s("home.wallpaper.bing"),onClick:()=>W({source:"bing",bing:n,bingDaily:r===0&&m.bingDaily}),children:[e.jsx("img",{src:n.thumbnailUrl,alt:""}),m.bing?.id===n.id&&e.jsx("span",{children:e.jsx(je,{size:12})})]},n.id))})]}),m.source==="custom"&&e.jsxs("div",{className:"hp-wallpaper-custom",children:[e.jsx("div",{className:"hp-wallpaper-custom-preview",style:R?{backgroundImage:`url(${JSON.stringify(R)})`}:void 0}),e.jsxs("div",{children:[e.jsx("strong",{children:s("home.wallpaper.customReady")}),e.jsx("span",{children:s("home.wallpaper.customHint")})]}),e.jsxs("button",{type:"button",onClick:()=>le.current?.click(),children:[e.jsx(ks,{size:13})," ",s("home.wallpaper.replace")]}),e.jsx("button",{type:"button",onClick:jn,children:s("home.wallpaper.remove")})]}),e.jsxs("div",{className:"hp-wallpaper-options",children:[e.jsxs("button",{type:"button",className:m.focusBlur?"on":"",role:"switch","aria-checked":m.focusBlur,onClick:()=>W({focusBlur:!m.focusBlur}),children:[e.jsxs("span",{children:[e.jsx("strong",{children:s("home.wallpaper.focusBlur")}),e.jsx("small",{children:s("home.wallpaper.focusBlurHint")})]}),e.jsx("i",{"aria-hidden":!0})]}),e.jsxs("button",{type:"button",className:m.vignette?"on":"",role:"switch","aria-checked":m.vignette,onClick:()=>W({vignette:!m.vignette}),children:[e.jsxs("span",{children:[e.jsx("strong",{children:s("home.wallpaper.vignette")}),e.jsx("small",{children:s("home.wallpaper.vignetteHint")})]}),e.jsx("i",{"aria-hidden":!0})]})]})]})}),v&&e.jsx("div",{className:"hp-organizer-stage",onClick:()=>P(!1),children:e.jsxs("section",{className:"hp-organizer-panel","aria-label":s("home.organizer.title"),onClick:n=>n.stopPropagation(),children:[e.jsxs("header",{className:"hp-organizer-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"hp-organizer-mark",children:e.jsx(Xe,{size:16})}),e.jsxs("span",{children:[e.jsx("strong",{children:s("home.organizer.title")}),e.jsx("small",{children:s("home.spaceCount",{n:kn})})]})]}),e.jsx("button",{type:"button",onClick:()=>P(!1),"aria-label":s("common.close"),children:e.jsx(xe,{size:16})})]}),e.jsxs(me,{sensors:ce,collisionDetection:Qe,onDragStart:We,onDragOver:ze,onDragCancel:Te,onDragEnd:Re,children:[e.jsx(ge,{items:f.map(n=>n.id),strategy:fe,children:e.jsxs("div",{className:"hp-organizer-grid",children:[f.map(n=>e.jsx(en,{tile:n,over:G===n.id,open:!1,onOpen:Le,onLaunch:r=>{P(!1),U(r)},onMenu:(r,h)=>pe(r,"folder",h)},n.id)),e.jsxs("button",{type:"button",className:"hp-organizer-new",onClick:Cn,children:[e.jsx("span",{children:e.jsx(ys,{size:22})}),e.jsx("small",{children:s("home.newFolder")})]})]})}),e.jsx(Ge,{dropAnimation:null,children:_&&e.jsx("div",{className:`hp-tile hp-drag-overlay${_.kind==="folder"?" hp-folder":""}`,children:e.jsx($,{tile:_})})})]}),e.jsx("footer",{children:s("home.organizer.hint")})]})}),E&&M?.kind==="folder"&&e.jsx("div",{className:"hp-folder-stage",onClick:()=>N(null),children:e.jsxs("section",{className:"hp-folder-panel",style:{"--hp-folder-dx":`${E.dx}px`,"--hp-folder-dy":`${E.dy}px`},"aria-label":M.folder.name,onClick:n=>n.stopPropagation(),children:[e.jsxs("header",{className:"hp-folder-head",children:[e.jsxs("div",{className:"hp-folder-identity",children:[e.jsx("span",{className:"hp-folder-hero",children:e.jsx($,{tile:M})}),e.jsxs("span",{children:[e.jsx("strong",{children:M.folder.name}),e.jsx("small",{children:s("home.folderCount",{n:Q.length})})]})]}),e.jsx("button",{type:"button",onClick:()=>N(null),"aria-label":s("common.close"),children:e.jsx(xe,{size:16})})]}),Q.length===0&&e.jsx("div",{className:"hp-folder-empty",children:s("home.folderEmpty")}),Q.length>0&&e.jsx(me,{sensors:ce,collisionDetection:sn,onDragEnd:yn,children:e.jsx(ge,{items:M.folder.items,strategy:fe,children:e.jsx("div",{className:"hp-folder-grid",children:Q.map(n=>e.jsx(et,{member:n,onLaunch:r=>{N(null),U(r)},onMenu:(r,h)=>pe(r,"member",h)},n.id))})})}),e.jsx("footer",{children:s("home.folderHint")})]})}),A&&In&&e.jsx(Bn,{className:"ctx-menu",x:A.x,y:A.y,onClick:n=>n.stopPropagation(),children:e.jsx(gs,{items:He(A)})})]})}export{Et as HomepageView};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{u as M,d as j,j as e,t as E}from"./index-BOzsniE1.js";import{J as P,u as L,T,lq as O,ci as K,ln as F,X as B,aU as W,aA as $,hS as Q,bu as J,bv as Z,bw as ee,bK as ie,aV as te,hL as ae,t as se}from"./appStore-CI1_L5OS.js";import"./client-CaivGZFR.js";import{L as ne}from"./phoneList-B6gwUJZF.js";import{v as oe,E as re,o as le,u as S,b as D,i as k,r as q,c as de,m as H,d as ce,f as me,t as ue}from"./RightPanel-BJUacrsf.js";import{C as he}from"./codingNavigation-B0kVsy4x.js";import{q as pe,t as ge,a as _,v as xe,w as je,x as U,L as V,y as Se,z as fe,e as be,p as ve,I as ye,b as we,d as Ce}from"./imageStudio-CWgLpC_d.js";import{L as Ne}from"./lock-DBkXXwaI.js";import{L as ke}from"./lock-open-C-9-AWct.js";import{G as Ie}from"./git-branch-CwR2qic6.js";import{R as Me}from"./rotate-ccw-DdkrbRAB.js";import{L as ze}from"./layout-grid-CraV7nhh.js";import"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";import"./pencil-ehhM9_9k.js";import"./book-open-BLzEdGfu.js";import"./folder-plus-aJgL9NeP.js";import"./folder-DotgUhYD.js";import"./upload-DqpRRAhG.js";import"./TargetHealthNotice-CgkdTdhB.js";import"./codeStudioStore-DhyMazGT.js";import"./ModelPill-JaIH3ffZ.js";import"./create-1JI2I47p.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-8pfimvem.js";import"./emoji-DphwSxPx.js";import"./hand-XNkzNiW2.js";import"./pageChrome-BR4cfIaA.js";import"./server-Ddu9f1k3.js";import"./pdf.worker.min-CGb3BKV9.js";import"./code-xml-AE3mT4T5.js";import"./zoom-in-Bf-eKTnH.js";import"./InlineFiles-Clnqh9jD.js";import"./undo-2-B7izWNb_.js";import"./arrow-up-right-BDsMFoNQ.js";import"./minus-CfA9fAN3.js";import"./SketchCard-B_UU5sxV.js";import"./terminal-CAmmC9cV.js";import"./circle-x-DTcNGZDT.js";import"./circle-question-mark-BM4ZRxQS.js";import"./FloatingToc-DNqAkkI0.js";import"./MarkdownBlock-DT_wsaja.js";import"./index-DjnTfJpN.js";import"./linkFollow-BpvDWzUx.js";import"./selectionActions-BQD2kox1.js";import"./listFold-M8s5JYEC.js";import"./ViewSelectionBar-35x8TiLA.js";import"./InlineAiPanel-B3kd1ob2.js";const Ee=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],Le=P("crop",Ee);const $e=[["path",{d:"m3 7 5 5-5 5V7",key:"couhi7"}],["path",{d:"m21 7-5 5 5 5V7",key:"6ouia7"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 2v2",key:"tus03m"}]],Pe=P("flip-horizontal-2",$e);const Fe=[["path",{d:"m17 3-5 5-5-5h10",key:"1ftt6x"}],["path",{d:"m17 21-5-5-5 5h10",key:"1m0wmu"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}]],Re=P("flip-vertical-2",Fe);function Ae({image:i,onApply:l,onCancel:n}){const{t:r}=M(),a=pe(i.blob),[c,p]=j.useState(i.crop||{x:0,y:0,w:i.width,h:i.height}),s=j.useRef(null),d=j.useRef(null),f=o=>{const m=Math.max(0,Math.min(i.width-1,Math.round(o.x))),b=Math.max(0,Math.min(i.height-1,Math.round(o.y)));return{x:m,y:b,w:Math.max(1,Math.min(i.width-m,Math.round(o.w))),h:Math.max(1,Math.min(i.height-b,Math.round(o.h)))}};return e.jsxs("div",{className:"ims-crop",onKeyDown:o=>{o.key==="Escape"&&(o.stopPropagation(),n())},children:[e.jsx("h4",{children:r("imageStudio.crop")}),e.jsx("p",{children:r("imageStudio.cropHint")}),e.jsxs("div",{ref:d,className:"ims-crop-stage",style:{aspectRatio:i.width/i.height},onPointerDown:o=>{const m=o.currentTarget.getBoundingClientRect(),b=o.target.dataset.edge||"move";s.current={pointer:o.pointerId,x:o.clientX,y:o.clientY,base:c,edge:b,sx:i.width/m.width,sy:i.height/m.height},o.currentTarget.setPointerCapture(o.pointerId),o.preventDefault()},onPointerMove:o=>{const m=s.current;if(!m||m.pointer!==o.pointerId)return;const b=(o.clientX-m.x)*m.sx,g=(o.clientY-m.y)*m.sy,h=m.base;if(m.edge==="move")p(f({...h,x:Math.max(0,Math.min(i.width-h.w,h.x+b)),y:Math.max(0,Math.min(i.height-h.h,h.y+g))}));else{const y=m.edge.includes("w")?Math.max(0,Math.min(h.x+h.w-1,h.x+b)):h.x,t=m.edge.includes("n")?Math.max(0,Math.min(h.y+h.h-1,h.y+g)):h.y,x=m.edge.includes("e")?Math.min(i.width,Math.max(h.x+1,h.x+h.w+b)):h.x+h.w,v=m.edge.includes("s")?Math.min(i.height,Math.max(h.y+1,h.y+h.h+g)):h.y+h.h;p(f({x:y,y:t,w:x-y,h:v-t}))}},onPointerUp:()=>{s.current=null},onPointerCancel:()=>{s.current=null},children:[a&&e.jsx("img",{src:a,alt:i.name,draggable:!1}),e.jsx("div",{className:"ims-crop-box",style:{left:`${c.x/i.width*100}%`,top:`${c.y/i.height*100}%`,width:`${c.w/i.width*100}%`,height:`${c.h/i.height*100}%`},children:["nw","ne","sw","se"].map(o=>e.jsx("span",{"data-edge":o,className:`ims-crop-handle ${o}`},o))})]}),e.jsxs("select",{"aria-label":r("imageStudio.cropRatio"),defaultValue:"",onChange:o=>{const m=Number(o.target.value)||i.width/i.height,b=Math.min(i.width,i.height*m),g=b/m;p(f({x:(i.width-b)/2,y:(i.height-g)/2,w:b,h:g}))},children:[e.jsx("option",{value:"",disabled:!0,children:r("imageStudio.cropRatio")}),e.jsx("option",{value:"0",children:r("imageStudio.original")}),[[1,"1:1"],[.8,"4:5"],[2/3,"2:3"],[16/9,"16:9"],[9/16,"9:16"]].map(([o,m])=>e.jsx("option",{value:o,children:m},m))]}),e.jsx("div",{className:"ims-fields",children:["x","y","w","h"].map(o=>e.jsxs("label",{children:[r(`imageStudio.${o}`),e.jsx("input",{type:"number","aria-label":r(`imageStudio.crop.${o}`),value:c[o],min:o==="x"||o==="y"?0:1,max:o==="x"||o==="w"?i.width:i.height,onChange:m=>p(f({...c,[o]:Number(m.target.value)||0}))})]},o))}),e.jsxs("div",{className:"ims-button-row",children:[e.jsx("button",{onClick:n,children:r("imageStudio.cancel")}),e.jsx("button",{className:"ims-primary",disabled:!oe(c,i.width,i.height),onClick:()=>l(c),children:r("imageStudio.applyCrop")})]})]})}const Te=re,qe=["low","medium","high","xhigh","max"];function Be(i,l,n,r){const[a,c]=n.split(":").map(Number),p=1+Math.max(.1,Math.min(1,r)),s=Math.ceil(Math.max(i*p,l*p*a/c)),d=Math.ceil(s*c/a);return{w:s,h:d,x:Math.floor((s-i)/2),y:Math.floor((d-l)/2)}}async function De(i,l,n,r,a){if(!i.length||i.length>8)throw new Error(E("imageStudio.ai.referenceLimit"));if(l!=="expand")return Promise.all(i.map(s=>ge(s,a)));const c=await _([i[0]],!0,1024),p=await xe(c);try{const s=Be(p.width,p.height,n,r),d=Math.min(1,1536/Math.max(s.w,s.h)),f=document.createElement("canvas");f.width=Math.round(s.w*d),f.height=Math.round(s.h*d);const o=f.getContext("2d");if(!o)throw new Error("Canvas unavailable");o.drawImage(p,s.x*d,s.y*d,p.width*d,p.height*d);const m=await new Promise((g,h)=>f.toBlob(y=>y?g(y):h(new Error("PNG encoding failed")),"image/png")),b=await je(m);return[{name:"expand-reference.png",mimeType:"image/png",size:m.size,data:b.split(",")[1]}]}finally{p.close()}}function He(i,l,n,r,a,c=""){return[E(`imageStudio.ai.prompt.${i}`),E(`imageStudio.ai.sourcePrompt.${i==="expand"?"current":a}`),l.trim(),E("imageStudio.ai.outputPrompt",{ratio:n.requested,engineRatio:n.engine,count:r}),c?E("imageStudio.ai.qualityPrompt",{quality:c}):""].filter(Boolean).join(`
|
|
2
|
-
|
|
3
|
-
`)}function _e({board:i,images:l}){const{t:n}=M(),[r,a]=j.useState("edit"),[c,p]=j.useState(""),[s,d]=j.useState("original"),[f,o]=j.useState("current"),[m,b]=j.useState(1),[g,h]=j.useState(.5),[y,t]=j.useState(""),[x,v]=j.useState(!1),[w,R]=j.useState(""),N=L(u=>!!(i.sessionId&&u.runningBySession[i.sessionId])),C=le(l[0],s),X=async()=>{v(!0),R("");let u=[];try{const I=await U(i.id);if(S.getState().activeId!==i.id)return;if(L.getState().runningBySession[I])throw new Error(n("imageStudio.ai.wait"));u=S.getState().beginGeneration(i.id,I,{count:m,aspect:C.aspect,ratio:C.requested,kind:"edit",sourceIds:l.map(Y=>Y.id)});const A=r==="expand"?"current":f,G=await De(l,r,C.requested,g,A);if(!await L.getState().send(He(r,c,C,m,A,y),G,void 0,void 0,void 0,I))throw new Error(n("imageStudio.ai.sendFailed"));S.getState().activateGeneration(u)}catch(I){u.length&&S.getState().failGeneration(i.id,{ids:u}),R(I instanceof Error?I.message:String(I))}finally{v(!1)}};return e.jsxs("details",{className:"ims-ai",open:!0,children:[e.jsxs("summary",{children:[e.jsx(T,{size:15}),n("imageStudio.ai.title"),e.jsxs("span",{children:[l.length," ",n("imageStudio.ai.references")]})]}),e.jsxs("div",{className:"ims-ai-body",children:[e.jsx("div",{className:"ims-ai-modes",role:"group","aria-label":n("imageStudio.ai.mode"),children:["edit","background","expand"].map(u=>e.jsx("button",{"aria-pressed":r===u,disabled:N||x||u!=="edit"&&l.length!==1,onClick:()=>a(u),children:n(`imageStudio.ai.${u}`)},u))}),e.jsx("p",{className:"ims-caption",children:n(`imageStudio.ai.hint.${r}`)}),e.jsx("textarea",{"aria-label":n("imageStudio.ai.instruction"),placeholder:n("imageStudio.ai.placeholder"),value:c,onChange:u=>p(u.target.value),maxLength:8e3,rows:3,disabled:x||N}),e.jsxs("label",{className:"ims-ai-source",children:[n("imageStudio.ai.source"),e.jsxs("select",{"aria-label":n("imageStudio.ai.source"),value:r==="expand"?"current":f,onChange:u=>o(u.target.value),disabled:x||N||r==="expand",children:[e.jsx("option",{value:"current",children:n("imageStudio.ai.source.current")}),e.jsx("option",{value:"original",children:n("imageStudio.ai.source.original")})]})]}),e.jsxs("div",{className:"ims-fields",children:[e.jsxs("label",{children:[n("imageStudio.ai.ratio"),e.jsxs("select",{"aria-label":n("imageStudio.ai.ratio"),value:s,onChange:u=>d(u.target.value),disabled:x||N,children:[e.jsx("option",{value:"original",children:n("imageStudio.ai.ratio.original",{ratio:C.originalLabel})}),Te.map(u=>e.jsx("option",{value:u,children:u},u))]})]}),e.jsxs("label",{children:[n("imageStudio.ai.count"),e.jsx("select",{"aria-label":n("imageStudio.ai.count"),value:m,onChange:u=>b(Number(u.target.value)),disabled:x||N,children:[1,2,3,4].map(u=>e.jsx("option",{children:u},u))})]}),e.jsxs("label",{children:[n("imageStudio.ai.quality"),e.jsxs("select",{"aria-label":n("imageStudio.ai.quality"),value:y,onChange:u=>t(u.target.value),disabled:x||N,children:[e.jsx("option",{value:"",children:n("imageStudio.ai.quality.default")}),qe.map(u=>e.jsx("option",{value:u,children:n(`imageStudio.ai.quality.${u}`)},u))]})]})]}),C.requested!==C.engine&&e.jsx("p",{className:"ims-caption ims-ai-ratio-note",children:n("imageStudio.ai.ratioFit",{ratio:C.requested,engineRatio:C.engine})}),(y==="xhigh"||y==="max")&&e.jsx("p",{className:"ims-caption",children:n("imageStudio.ai.qualityNote")}),r==="expand"&&e.jsxs("label",{children:[n("imageStudio.ai.margin"),e.jsx("input",{"aria-label":n("imageStudio.ai.margin"),type:"range",min:".1",max:"1",step:".1",value:g,onChange:u=>h(Number(u.target.value))}),e.jsxs("output",{children:[Math.round(g*100),"%"]})]}),e.jsxs("button",{className:"ims-primary",disabled:x||N||!l.length||l.length>8||r==="edit"&&!c.trim(),onClick:()=>{X()},children:[e.jsx(T,{size:15}),n(N||x?"imageStudio.ai.running":"imageStudio.ai.submit")]}),e.jsx("p",{className:"ims-caption",children:n("imageStudio.ai.preserve")}),w&&e.jsx("p",{role:"alert",children:w})]})]})}function qi(){const{t:i}=M(),l=S(d=>d.boards),n=S(d=>d.activeId),r=S(d=>d.ready);j.useEffect(()=>{S.getState().hydrate()},[]);const a=j.useMemo(()=>Object.values(l).sort((d,f)=>f.updatedAt-d.updatedAt).slice(0,12),[l]),c=d=>{d(),se.getState().openView("image-studio",{},"main")},p=()=>c(()=>S.getState().create(i("imageStudio.untitled"))),s=ae();return e.jsxs("nav",{className:`csn ims-nav${s?" pl-fab-room":""}`,"aria-label":i("imageStudio.title"),children:[e.jsxs("div",{className:"csn-section",children:[!s&&e.jsx("span",{className:"csn-heading",children:i("imageStudio.nav.create")}),!s&&e.jsxs("button",{type:"button",className:"csn-item",disabled:!r,onClick:p,children:[e.jsx($,{size:16}),i("imageStudio.new")]}),e.jsxs("button",{type:"button",className:"csn-item","aria-current":r&&!n?"page":void 0,onClick:()=>c(()=>S.getState().close()),children:[e.jsx(ze,{size:16}),i("imageStudio.projects")]})]}),a.length>0&&e.jsxs("div",{className:"csn-section",children:[e.jsx("span",{className:"csn-heading",children:i("imageStudio.nav.recent")}),a.map(d=>{const f=de(d,1)[0];return e.jsxs("button",{type:"button",className:"csn-item",title:d.name,"aria-current":d.id===n?"page":void 0,onClick:()=>c(()=>S.getState().open(d.id)),children:[f?e.jsx("span",{className:"ims-nav-thumb",children:e.jsx(ye,{image:f})}):e.jsx(F,{size:16}),e.jsx("span",{className:"ims-nav-name",children:d.name})]},d.id)})]}),s&&r&&e.jsx(ne,{label:i("imageStudio.new"),icon:e.jsx($,{}),onClick:p})]})}function Bi(i){const{t:l}=M(),n=S(s=>s.activeId?s.boards[s.activeId]:void 0),[r,a]=j.useState(!1),[c,p]=j.useState("");return j.useEffect(()=>{S.getState().hydrate()},[]),j.useEffect(()=>{n?.sessionId&&L.getState().loadSessionHistory(n.sessionId)},[n?.sessionId]),n?.sessionId?e.jsx("div",{className:"ims-chat","data-image-studio-chat":n.id,children:e.jsx(he,{...i,params:{...i.params,followActive:!1,sessionId:n.sessionId,childSurface:!0}},n.sessionId)}):e.jsxs("div",{className:"ims-panel ims-chat-empty",children:[e.jsx(B,{size:26,strokeWidth:1.3}),e.jsx("h3",{children:l("imageStudio.chat")}),e.jsx("p",{children:l(n?"imageStudio.chatHint":"imageStudio.choose")}),n&&e.jsxs("button",{className:"ims-primary",disabled:r,onClick:async()=>{a(!0),p("");try{await U(n.id)}catch(s){p(String(s))}finally{a(!1)}},children:[r?e.jsx(W,{size:15,className:"ims-spin"}):e.jsx($,{size:15}),l("imageStudio.connect")]}),c&&e.jsx("p",{role:"alert",children:l("imageStudio.error",{error:c})})]})}function Di(){const{t:i}=M(),l=S(s=>s.activeId?s.boards[s.activeId]:void 0),n=S(s=>s.selection),[r,a]=j.useState(""),c=l?D(l).reverse().filter(s=>s.name.toLocaleLowerCase().includes(r.toLocaleLowerCase())):[],p=(s,d)=>l&&S.getState().update(l.id,f=>H(f,o=>o.id===s?{...o,...d}:o));return e.jsxs("section",{className:"ims-panel ims-layers",children:[e.jsx("h3",{children:i("imageStudio.layers")}),e.jsx("input",{type:"search","aria-label":i("imageStudio.searchLayers"),placeholder:i("imageStudio.searchLayers"),value:r,onChange:s=>a(s.target.value)}),e.jsx("div",{className:"ims-asset-list",children:c.map(s=>e.jsxs("div",{className:`ims-layer-row${n.includes(s.id)?" is-selected":""}`,"data-layer-id":s.id,children:[e.jsxs("button",{className:"ims-asset","aria-pressed":n.includes(s.id),onClick:d=>S.setState({selection:d.shiftKey?n.includes(s.id)?n.filter(f=>f!==s.id):[...n,s.id]:[s.id]}),children:[e.jsx("div",{className:"ims-layer-thumb",children:e.jsx(V,{item:s})}),e.jsxs("span",{children:[e.jsx("strong",{children:s.name}),e.jsx("small",{children:i(`imageStudio.kind.${Se(s)}`)})]})]}),e.jsx("button",{"aria-label":i(s.hidden?"imageStudio.show":"imageStudio.hide"),title:i(s.hidden?"imageStudio.show":"imageStudio.hide"),onClick:()=>p(s.id,{hidden:!s.hidden}),children:s.hidden?e.jsx(O,{size:14}):e.jsx(K,{size:14})}),e.jsx("button",{"aria-label":i(s.locked?"imageStudio.unlock":"imageStudio.lock"),title:i(s.locked?"imageStudio.unlock":"imageStudio.lock"),onClick:()=>p(s.id,{locked:!s.locked}),children:s.locked?e.jsx(Ne,{size:14}):e.jsx(ke,{size:14})})]},s.id))}),!c.length&&e.jsxs("div",{className:"ims-panel-empty",children:[e.jsx(F,{size:26}),e.jsx("p",{children:i(r.trim()?"imageStudio.noLayers":"imageStudio.layersEmpty")})]}),e.jsx("p",{className:"ims-caption",children:i("imageStudio.layersHint")})]})}function z({label:i,value:l,onChange:n,min:r=-1e5,max:a=1e5}){const[c,p]=j.useState(String(Math.round(l*100)/100));j.useEffect(()=>p(String(Math.round(l*100)/100)),[l]);const s=()=>{const d=Number(c);c.trim()&&Number.isFinite(d)?n(Math.max(r,Math.min(a,d))):p(String(l))};return e.jsxs("label",{children:[i,e.jsx("input",{type:"number","aria-label":i,value:c,min:r,max:a,onChange:d=>p(d.target.value),onBlur:s,onKeyDown:d=>{d.key==="Enter"&&d.currentTarget.blur()}})]})}function Hi(){const{t:i}=M(),l=S(t=>t.activeId?t.boards[t.activeId]:void 0),n=S(t=>t.selection),r=l?D(l).filter(t=>n.includes(t.id)):[],a=r[0],c=a&&k(a)&&a.parentId?l?.images.find(t=>t.id===a.parentId):void 0,[p,s]=j.useState(""),[d,f]=j.useState(!1),[o,m]=j.useState(!1);j.useEffect(()=>{m(!1),s("")},[l?.id,a?.id]);const b=async t=>{f(!0),s("");try{await t()}catch(x){s(String(x))}finally{f(!1)}};if(!l||!a)return e.jsxs("div",{className:"ims-panel ims-panel-empty",children:[e.jsx(F,{size:26}),e.jsx("p",{children:i("imageStudio.select")})]});const g=t=>S.getState().update(l.id,x=>H(x,v=>v.id===a.id&&!v.locked?{...v,...t}:v)),h=t=>{k(a)&&g(ue(a,t))},y=(t,x)=>{let v={x:a.x,y:a.y,w:a.w,h:a.h,[t]:x};if(k(a)&&(t==="w"||t==="h")){const w=ce(a);v={...v,...t==="w"?{h:x*w.h/w.w}:{w:x*w.w/w.h}}}S.getState().update(l.id,w=>me(w,new Map([[a.id,v]])))};return e.jsxs("section",{className:"ims-panel ims-inspector",children:[e.jsx("h3",{children:i(r.length>1?"imageStudio.selection":"imageStudio.inspector")}),r.every(k)&&e.jsx(_e,{board:l,images:r.filter(k)},`${l.id}:${n.join(",")}`),r.length===1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ims-preview",style:{aspectRatio:a.w/a.h},children:e.jsx(V,{item:a})}),e.jsxs("fieldset",{disabled:a.locked,className:"ims-properties",children:[e.jsx("input",{"aria-label":i("imageStudio.layerName"),value:a.name,onChange:t=>g({name:t.target.value})}),e.jsx("div",{className:"ims-fields",children:["x","y","w","h"].map(t=>e.jsx(z,{label:i(`imageStudio.${t}`),value:a[t],min:t==="w"||t==="h"?1:-1e5,onChange:x=>y(t,x)},t))}),k(a)?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ims-meta",children:[e.jsx("span",{children:i("imageStudio.original")}),e.jsxs("span",{children:[a.width," × ",a.height]})]}),c&&e.jsxs("button",{className:"ims-lineage",onClick:()=>S.setState({selection:[c.id]}),children:[e.jsx(Ie,{size:14}),e.jsx("span",{children:i("imageStudio.versionOf")}),e.jsx("strong",{children:c.name})]}),e.jsxs("div",{className:"ims-button-row ims-transform",children:[e.jsx("button",{title:i("imageStudio.crop"),"aria-label":i("imageStudio.crop"),onClick:()=>m(!o),children:e.jsx(Le,{size:16})}),e.jsx("button",{title:i("imageStudio.rotate"),"aria-label":i("imageStudio.rotate"),onClick:()=>h({rotation:((a.rotation||0)+90)%360}),children:e.jsx(Q,{size:16})}),e.jsx("button",{title:i("imageStudio.flipX"),"aria-label":i("imageStudio.flipX"),onClick:()=>h({flipX:!a.flipX}),children:e.jsx(Pe,{size:16})}),e.jsx("button",{title:i("imageStudio.flipY"),"aria-label":i("imageStudio.flipY"),onClick:()=>h({flipY:!a.flipY}),children:e.jsx(Re,{size:16})})]}),o&&e.jsx(Ae,{image:a,onCancel:()=>m(!1),onApply:t=>{h({crop:t}),m(!1)}},a.id),e.jsx(z,{label:i("imageStudio.angle"),value:a.rotation||0,min:0,max:359,onChange:t=>h({rotation:t})}),e.jsx("button",{onClick:()=>h({crop:void 0,rotation:0,flipX:!1,flipY:!1}),children:i("imageStudio.resetTransform")}),e.jsx("div",{className:"ims-adjustments",children:["brightness","contrast","saturation"].map(t=>e.jsxs("label",{children:[e.jsxs("span",{children:[i(`imageStudio.${t}`),e.jsxs("output",{children:[a[t],"%"]})]}),e.jsx("input",{"aria-label":i(`imageStudio.${t}`),type:"range",min:"0",max:"200",step:"5",value:a[t],onChange:x=>g({[t]:Number(x.target.value)})})]},t))}),e.jsxs("button",{onClick:()=>g({brightness:100,contrast:100,saturation:100}),children:[e.jsx(Me,{size:14}),i("imageStudio.reset")]})]}):e.jsxs(e.Fragment,{children:[a.kind==="frame"&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:[i("imageStudio.framePreset"),e.jsxs("select",{"aria-label":i("imageStudio.framePreset"),value:"",onChange:t=>{const[x,v]=t.target.value.split("x").map(Number);g({w:x,h:v})},children:[e.jsx("option",{value:"",disabled:!0,children:i("imageStudio.customSize")}),e.jsx("option",{value:"1080x1080",children:"1:1 · 1080 × 1080"}),e.jsx("option",{value:"1080x1350",children:"4:5 · 1080 × 1350"}),e.jsx("option",{value:"1080x1920",children:"9:16 · 1080 × 1920"}),e.jsx("option",{value:"1920x1080",children:"16:9 · 1920 × 1080"})]})]}),e.jsx("p",{children:i("imageStudio.frameHint")})]}),a.kind==="text"&&e.jsxs(e.Fragment,{children:[e.jsx("textarea",{"aria-label":i("imageStudio.textContent"),value:a.text,maxLength:1e4,rows:4,onChange:t=>g({text:t.target.value})}),e.jsxs("div",{className:"ims-fields",children:[e.jsxs("label",{children:[i("imageStudio.font"),e.jsx("select",{"aria-label":i("imageStudio.font"),value:a.fontFamily,onChange:t=>g({fontFamily:t.target.value}),children:["sans-serif","serif","monospace"].map(t=>e.jsx("option",{value:t,children:i(`imageStudio.font.${t}`)},t))})]}),e.jsx(z,{label:i("imageStudio.fontSize"),value:a.fontSize,min:6,max:500,onChange:t=>g({fontSize:t})})]}),e.jsxs("div",{className:"ims-fields",children:[e.jsxs("label",{children:[i("imageStudio.textAlign"),e.jsx("select",{"aria-label":i("imageStudio.textAlign"),value:a.align,onChange:t=>g({align:t.target.value}),children:["left","center","right"].map(t=>e.jsx("option",{value:t,children:i(`imageStudio.align.${t}`)},t))})]}),e.jsxs("label",{className:"ims-checkbox",children:[e.jsx("input",{type:"checkbox",checked:a.bold,onChange:t=>g({bold:t.target.checked})}),i("imageStudio.bold")]})]})]}),e.jsxs("div",{className:"ims-fields",children:[e.jsxs("label",{children:[i("imageStudio.fill"),e.jsx("input",{type:"color","aria-label":i("imageStudio.fill"),value:a.fill==="transparent"?"#ffffff":a.fill,onChange:t=>g({fill:t.target.value})})]}),a.kind!=="text"&&e.jsxs("label",{children:[i("imageStudio.stroke"),e.jsx("input",{type:"color","aria-label":i("imageStudio.stroke"),value:a.stroke,onChange:t=>g({stroke:t.target.value})})]})]}),a.kind!=="text"&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"ims-checkbox",children:[e.jsx("input",{type:"checkbox",checked:a.fill==="transparent",onChange:t=>g({fill:t.target.checked?"transparent":"#ffffff"})}),i("imageStudio.noFill")]}),e.jsxs("div",{className:"ims-fields",children:[e.jsx(z,{label:i("imageStudio.strokeWidth"),value:a.strokeWidth,min:0,max:100,onChange:t=>g({strokeWidth:t})}),e.jsx(z,{label:i("imageStudio.radius"),value:a.radius,min:0,max:1e3,onChange:t=>g({radius:t})})]})]})]})]}),a.locked&&e.jsx("p",{children:i("imageStudio.lockedHint")}),k(a)&&a.prompt&&e.jsxs("details",{className:"ims-prompt",children:[e.jsx("summary",{children:i("imageStudio.prompt")}),e.jsx("p",{children:a.prompt})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{children:i("imageStudio.selectedCount",{count:r.length})}),e.jsx("div",{className:"ims-align",children:["left","center","right","top","middle","bottom"].map(t=>e.jsx("button",{onClick:()=>S.getState().update(l.id,x=>fe(x,n,t)),children:i(`imageStudio.align.${t}`)},t))})]}),e.jsxs("div",{className:"ims-button-row",children:[e.jsx("button",{title:i("imageStudio.layerUp"),"aria-label":i("imageStudio.layerUp"),onClick:()=>S.getState().update(l.id,t=>q(t,n,"up")),children:e.jsx(J,{size:15})}),e.jsx("button",{title:i("imageStudio.layerDown"),"aria-label":i("imageStudio.layerDown"),onClick:()=>S.getState().update(l.id,t=>q(t,n,"down")),children:e.jsx(Z,{size:15})}),e.jsx("button",{title:i("imageStudio.remove"),"aria-label":i("imageStudio.remove"),onClick:be,children:e.jsx(ee,{size:15})})]}),e.jsxs("div",{className:"ims-panel-actions",children:[e.jsxs("button",{disabled:d||r.every(t=>t.hidden),onClick:()=>{b(we)},children:[e.jsx(B,{size:14}),i("imageStudio.reference")]}),e.jsxs("button",{onClick:()=>ve(!0),children:[e.jsx(ie,{size:14}),i("imageStudio.duplicate")]}),r.length===1&&k(a)&&e.jsxs("button",{className:"ims-primary",disabled:d,onClick:()=>{b(async()=>Ce(await _([a],!0),a.name.replace(/\.[^.]+$/,"")+".png"))},children:[e.jsx(te,{size:14}),i("imageStudio.export")]})]}),p&&e.jsx("p",{role:"alert",children:i("imageStudio.error",{error:p})})]})}export{Di as ImageStudioAssets,Bi as ImageStudioChat,Hi as ImageStudioInspector,qi as ImageStudioNav,z as NumberField};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as U,d as o,j as t}from"./index-BOzsniE1.js";import{J as xe,aM as fe,aU as te,aV as R,X as Z,lm as Se,bK as je,bu as $e,bv as Re,bw as ve,a9 as Ae,aA as Be,V as Ue,ea as Fe,ln as He,x as Ve,ba as _e,u as qe,g2 as Ke,gg as q,aS as We,P as Ye,lo as Xe,T as Ge,d$ as Qe,cE as Je,lp as Ze,gc as et}from"./appStore-CI1_L5OS.js";import"./client-CaivGZFR.js";import{u as tt}from"./gestures-dqncPOwo.js";import{C as st,a as it}from"./Chrome-CFonajM4.js";import{b as M,i as be,u as r,a as at,C as nt,r as ce,m as rt,c as ot,d as ye,e as ue,f as me,g as lt,n as dt,h as ct}from"./RightPanel-BJUacrsf.js";import{s as ut,d as ee,r as mt,h as gt,a as pt,b as we,c as Ce,p as B,e as ke,I as ht,i as xt,f as ft,l as St,u as jt,g as A,S as ge,j as vt,k as K,L as bt,m as yt,n as wt,o as Ct}from"./imageStudio-CWgLpC_d.js";import{L as kt}from"./lock-DBkXXwaI.js";import{L as zt}from"./lock-open-C-9-AWct.js";import{U as W}from"./upload-DqpRRAhG.js";/* empty css */import{F as Nt,R as It}from"./redo-2-DCEAgQlN.js";import{U as Et}from"./undo-2-B7izWNb_.js";import{L as Pt}from"./layout-grid-CraV7nhh.js";import{A as Lt}from"./arrow-up-right-BDsMFoNQ.js";import{H as Tt}from"./hand-XNkzNiW2.js";import{T as Mt,F as Dt}from"./type-Dz6rnTvG.js";import"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";import"./minus-CfA9fAN3.js";import"./pencil-ehhM9_9k.js";import"./book-open-BLzEdGfu.js";import"./folder-plus-aJgL9NeP.js";import"./folder-DotgUhYD.js";import"./InlineFiles-Clnqh9jD.js";const Ot=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],$t=xe("clipboard-paste",Ot);const Rt=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],At=xe("copy-plus",Rt);function Bt({board:s,selection:i,onClose:j}){const{t:c}=U(),[g,v]=o.useState("png"),[b,C]=o.useState(1),[l,p]=o.useState("transparent"),[S,y]=o.useState(.92),[N,w]=o.useState(!1),[u,d]=o.useState(""),z=ut(s,i),P=z?.bounds,L=Math.round((P?.w||0)*b),D=Math.round((P?.h||0)*b),O=!P||L<1||D<1||L*D>4e7||Math.max(L,D)>16384;return t.jsxs("section",{className:"ims-export ims-panel","aria-label":c("imageStudio.exportOptions"),children:[t.jsxs("div",{className:"ims-section-head",children:[t.jsx("h3",{children:c("imageStudio.exportOptions")}),t.jsx("button",{"aria-label":c("imageStudio.close"),onClick:j,children:t.jsx(fe,{size:15})})]}),t.jsxs("div",{className:"ims-fields",children:[t.jsxs("label",{children:[c("imageStudio.format"),t.jsx("select",{"aria-label":c("imageStudio.format"),value:g,onChange:h=>v(h.target.value),children:["png","jpeg","webp","svg"].map(h=>t.jsx("option",{value:h,children:h.toUpperCase()},h))})]}),t.jsxs("label",{children:[c("imageStudio.scale"),t.jsx("select",{"aria-label":c("imageStudio.scale"),value:b,onChange:h=>C(Number(h.target.value)),children:[.5,1,2,3].map(h=>t.jsxs("option",{value:h,children:[h,"×"]},h))})]}),t.jsxs("label",{children:[c("imageStudio.background"),t.jsxs("select",{"aria-label":c("imageStudio.background"),value:l,onChange:h=>p(h.target.value),children:[t.jsx("option",{value:"transparent",children:c("imageStudio.transparent")}),t.jsx("option",{value:"#ffffff",children:c("imageStudio.white")}),t.jsx("option",{value:"#000000",children:c("imageStudio.black")})]})]}),(g==="jpeg"||g==="webp")&&t.jsxs("label",{children:[c("imageStudio.quality"),t.jsx("input",{"aria-label":c("imageStudio.quality"),type:"range",min:".1",max:"1",step:".05",value:S,onChange:h=>y(Number(h.target.value))})]})]}),t.jsxs("p",{children:[L," × ",D," px · ",c(i.length?"imageStudio.selectedOnly":"imageStudio.allVisible")]}),g==="svg"&&t.jsx("p",{children:c("imageStudio.svgHint")}),g==="jpeg"&&l==="transparent"&&t.jsx("p",{children:c("imageStudio.jpegHint")}),O&&t.jsx("p",{role:"alert",children:c("imageStudio.exportLimit")}),t.jsxs("button",{className:"ims-primary",disabled:N||O,onClick:async()=>{w(!0),d("");try{ee(await mt(s,i,{format:g,scale:b,background:l,quality:S}),`${s.name}.${g==="jpeg"?"jpg":g}`)}catch(h){d(String(h))}finally{w(!1)}},children:[N?t.jsx(te,{className:"ims-spin",size:15}):t.jsx(R,{size:15}),c("imageStudio.download")]}),u&&t.jsx("p",{role:"alert",children:c("imageStudio.error",{error:u})})]})}function Ut({target:s,board:i,busy:j,onClose:c,onImport:g,onExport:v,onInspect:b,run:C}){const{t:l}=U(),p=i?M(i).filter(d=>s.ids.includes(d.id)):[],S=p.length===1&&be(p[0])?p[0]:void 0,y=p.filter(d=>!d.locked).map(d=>d.id),N=/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl+",w=d=>()=>{i&&r.getState().activeId!==i.id||(r.setState({selection:p.map(z=>z.id)}),d())},u=[];return S&&u.push({label:l("imageStudio.downloadImage"),icon:t.jsx(R,{size:14}),disabled:j,run:w(()=>{C(async()=>ee(await pt([S],!0),S.name.replace(/\.[^.]+$/,"")+".png"))})},{label:l("imageStudio.downloadOriginal"),icon:t.jsx(R,{size:14}),run:w(()=>{const d={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"}[S.blob.type]||"png";ee(S.blob,S.name.replace(/\.[^.]+$/,"")+"-original."+d)})}),p.length&&i?u.push({label:l("imageStudio.exportSelection"),icon:t.jsx(R,{size:14}),disabled:j,run:w(v)},{label:l("imageStudio.reference"),icon:t.jsx(Z,{size:14}),separatorBefore:!0,disabled:j||p.length>8,run:w(()=>{C(we)})},{label:l("imageStudio.inspector"),icon:t.jsx(Se,{size:14}),run:w(b)},{label:l("imageStudio.copyObjects"),icon:t.jsx(je,{size:14}),shortcut:`${N}C`,separatorBefore:!0,run:w(Ce)},{label:l("imageStudio.duplicate"),icon:t.jsx(At,{size:14}),shortcut:`${N}D`,run:w(()=>B(!0))},{label:l("imageStudio.layerUp"),icon:t.jsx($e,{size:14}),separatorBefore:!0,disabled:!y.length,run:w(()=>r.getState().update(i.id,d=>ce(d,y,"up")))},{label:l("imageStudio.layerDown"),icon:t.jsx(Re,{size:14}),disabled:!y.length,run:w(()=>r.getState().update(i.id,d=>ce(d,y,"down")))},{label:l(y.length?"imageStudio.lock":"imageStudio.unlock"),icon:y.length?t.jsx(kt,{size:14}):t.jsx(zt,{size:14}),run:w(()=>r.getState().update(i.id,d=>rt(d,z=>s.ids.includes(z.id)?{...z,locked:!!y.length}:z)))},{label:l("imageStudio.remove"),icon:t.jsx(ve,{size:14}),shortcut:"⌫",separatorBefore:!0,danger:!0,disabled:!y.length,run:w(ke)}):u.push({label:l("imageStudio.import"),icon:t.jsx(W,{size:14}),disabled:j,run:g},{label:l("imageStudio.pasteObjects"),icon:t.jsx($t,{size:14}),shortcut:`${N}V`,disabled:!i||!gt(),run:w(()=>B())},{label:l("imageStudio.selectAll"),icon:t.jsx(at,{size:14}),disabled:!i?.images.length&&!i?.elements?.length,run:()=>r.setState({selection:i?M(i).filter(d=>!d.hidden).map(d=>d.id):[]})},{label:l("imageStudio.exportBoard"),icon:t.jsx(R,{size:14}),separatorBefore:!0,disabled:j||!i||!M(i).some(d=>!d.hidden),run:w(v)}),t.jsx(nt,{menu:{x:s.x,y:s.y,items:u},onClose:c,autoFocus:!0})}const pe=4/3,Ft=.05;function Ht({board:s}){const i=ot(s,2);if(!i.length)return t.jsx("span",{className:"ims-cover is-empty",children:t.jsx("span",{className:"ims-cover-in",children:t.jsx(He,{size:22,strokeWidth:1.4})})});const j=i.map(g=>{const v=ye(g);return v.w/v.h}),c=Math.min(1,(1-Ft*(i.length-1))*pe/j.reduce((g,v)=>g+v,0));return t.jsx("span",{className:"ims-cover",children:t.jsx("span",{className:"ims-cover-in",children:i.map((g,v)=>t.jsx("span",{className:"ims-cover-img",style:{width:`${j[v]*c/pe*100}%`,aspectRatio:String(j[v])},children:t.jsx(ht,{image:g})},g.id))})})}function Vt(){const{t:s,locale:i}=U(),j=r(u=>u.boards),[c,g]=o.useState(""),[v,b]=o.useState(!1),[C,l]=o.useState(""),p=o.useRef(null),S=o.useMemo(()=>Object.values(j).sort((u,d)=>d.updatedAt-u.updatedAt),[j]),y=c.trim().toLocaleLowerCase(),N=y?S.filter(u=>u.name.toLocaleLowerCase().includes(y)):S,w=async u=>{b(!0),l("");try{const d=await xt(u),z=r.getState().create(d.name);r.getState().update(z,P=>({...d,id:P.id}))}catch(d){l(String(d))}finally{b(!1)}};return t.jsx("div",{className:"csl-launchpad ims-launch",children:t.jsx("div",{className:"csl-inner",children:t.jsxs("main",{className:"csl-catalog",children:[t.jsxs("header",{className:"csl-catalog-header",children:[t.jsxs("div",{children:[t.jsx("h1",{children:s("imageStudio.projects")}),t.jsx("p",{children:s("imageStudio.launch.subtitle")})]}),t.jsxs("div",{className:"csl-catalog-actions",children:[t.jsxs("button",{type:"button",className:"csl-import",disabled:v,onClick:()=>p.current?.click(),children:[t.jsx(Ae,{size:15}),s("imageStudio.restore")]}),t.jsxs("button",{type:"button",className:"csl-new",onClick:()=>r.getState().create(s("imageStudio.untitled")),children:[t.jsx(Be,{size:16}),s("imageStudio.new")]})]})]}),C&&t.jsx("div",{className:"ims-error",role:"alert",children:s("imageStudio.error",{error:C})}),S.length>0&&t.jsx("div",{className:"csl-catalog-toolbar",children:t.jsxs("label",{className:"csl-search",children:[t.jsx(Ue,{size:15}),t.jsx("input",{type:"search","aria-label":s("imageStudio.launch.search"),placeholder:s("imageStudio.launch.search"),value:c,onChange:u=>g(u.target.value)})]})}),N.length?t.jsx("div",{className:"ims-launch-grid",role:"group","aria-label":s("imageStudio.projects"),children:N.map(u=>t.jsxs("button",{type:"button",className:"ims-launch-card","data-project-id":u.id,onClick:()=>r.getState().open(u.id),children:[t.jsx(Ht,{board:u}),t.jsxs("span",{className:"ims-launch-meta",children:[t.jsx("strong",{children:u.name}),t.jsxs("small",{children:[s("imageStudio.itemCount",{count:M(u).length})," · ",Fe(u.updatedAt,{locale:i})]})]})]},u.id))}):t.jsxs("div",{className:"csl-empty",children:[t.jsx("strong",{children:s(S.length?"imageStudio.launch.noMatch":"imageStudio.launch.empty")}),!S.length&&t.jsx("p",{children:s("imageStudio.launch.emptyHint")})]}),t.jsx("input",{ref:p,type:"file",accept:".json",hidden:!0,onChange:u=>{const d=u.target.files?.[0];u.target.value="",d&&w(d)}})]})})})}const he=[];function fs(s){const{t:i}=U(),j=r(l=>l.ready),c=r(l=>l.error),g=r(l=>l.activeId);o.useEffect(()=>{r.getState().hydrate();const l=()=>{r.getState().flush()},p=S=>{const y=r.getState();(y.saving||y.ready&&y.error)&&(l(),S.preventDefault(),S.returnValue="")};return window.addEventListener("pagehide",l),window.addEventListener("beforeunload",p),()=>{window.removeEventListener("pagehide",l),window.removeEventListener("beforeunload",p),l()}},[]);const v=Ve(l=>l.activeSpaceId==="image-studio")&&_e()==="main",b=!!g,C=o.useRef(!1);return o.useEffect(()=>{!j||!v||(b?ft():St(C.current),C.current=b)},[j,v,b]),j?g?t.jsx(_t,{},g):t.jsx(Vt,{}):t.jsx("div",{className:"ims-panel ims-panel-empty",children:c?t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",children:i("imageStudio.error",{error:c})}),t.jsx("button",{onClick:()=>{r.getState().hydrate()},children:i("imageStudio.retry")})]}):t.jsx(te,{className:"ims-spin"})})}function _t(){const{t:s}=U(),i=r(e=>e.activeId?e.boards[e.activeId]:void 0),j=r(e=>e.saving),c=r(e=>e.error),g=r(e=>i&&e.past[i.id]?.length||0),v=r(e=>i&&e.future[i.id]?.length||0),b=r(e=>e.selection),C=r(e=>i&&e.placeholders[i.id]||he),l=qe(e=>!!(i?.sessionId&&e.runningBySession[i.sessionId])),[p,S]=o.useState(!1),[y,N]=o.useState(""),[w,u]=o.useState(0),[d,z]=o.useState(!1),[P,L]=o.useState(!1),[D,O]=o.useState(!1),h=o.useRef(null),[se,ze]=o.useState(!0),[ie,Ne]=o.useState(!1),[Ie,Y]=o.useState(!1),I=o.useRef(null),F=o.useRef(null),[ae,ne]=o.useState(null),Ee=o.useCallback(()=>{ne(null),I.current?.focus({preventScroll:!0})},[]),m=Ke(I,`image-studio:${i?.id||""}`,void 0,{x:56,y:64,z:1}),H=i?.images||[],T=i?M(i):[],V=T.filter(e=>!e.hidden),Pe=!T.length&&!g&&!v,X=[...V,...C],_=o.useRef(!0);o.useEffect(()=>(_.current=!0,()=>{_.current=!1}),[]);const re=o.useCallback(e=>{_.current&&N(e)},[]);jt(i||qt,re,w);const x=tt(I,m,{boxes:()=>new Map(V.map(e=>[e.id,e])),identity:()=>i?.id,commit:e=>{i&&r.getState().update(i.id,a=>me(a,e))},constrain:(e,a)=>{if(a.kind!=="resize")return e;const n=H.find(Oe=>Oe.id===a.key),f=e.get(a.key);if(!n||!f)return e;const k=ye(n),E=Math.max(48,f.w),De=E*k.h/k.w;return new Map(e).set(a.key,{...f,w:E,h:De})},hitKey:e=>e.closest("[data-image-id]")?.dataset.imageId||null,isEditing:e=>!!T.find(a=>a.id===e)?.locked,hitEdge:e=>e.dataset.resize||null,onDelete:e=>{i&&r.getState().update(i.id,a=>ue(a,M(a).filter(n=>n.locked||!e.includes(n.id))))},onDoubleClick:e=>{e&&(r.setState({selection:[e]}),A(K))},onContextMenu:(e,a)=>{const n=e?x.sel.includes(e)?x.sel:[e]:[];x.setSel(n),r.setState({selection:n}),ne({x:a.clientX,y:a.clientY,ids:n})},minW:48,minH:48,repel:!1},se);o.useEffect(()=>x.bind(I.current),[x.bind]),o.useEffect(()=>m.bindWheel(I.current),[m.bindWheel]),o.useEffect(()=>{const e=()=>{O(!1),h.current=null};return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[]);const oe=o.useRef(x.sel);o.useEffect(()=>{oe.current!==x.sel&&(oe.current=x.sel,r.setState({selection:x.sel}))},[x.sel]),o.useEffect(()=>{if(b.join("|")!==x.sel.join("|")){x.setSel(b);const e=T.find(a=>a.id===b[0]);if(e){const{w:a,h:n}=q(I.current),f=m.vpRef.current,k=(e.x+e.w/2)*f.z+f.x,E=(e.y+e.h/2)*f.z+f.y;(k<0||k>a||E<0||E>n)&&m.centerOn(e.x+e.w/2,e.y+e.h/2)}}},[b,x.setSel]);const le=o.useRef(0);o.useEffect(()=>{const e=T.length+C.length;e>le.current&&m.fitTo(X,64),le.current=e},[T,C,m.fitTo]);const $=async e=>{S(!0),N("");try{await e()}catch(a){re(String(a))}finally{_.current&&S(!1)}},G=()=>i?.id||r.getState().create(s("imageStudio.untitled")),de=async e=>{const a=await Promise.all(e.map(f=>Ct(f,f.name,"import")));if(!a.length)return;const n=G();r.getState().update(n,f=>{const k=[...f.images];for(const E of a)k.push({...E,...ct(E.width,E.height,k)});return{...f,images:k}})},Le=e=>{$(async()=>{const a=G();await yt(a,s(e))})},Q=T.filter(e=>b.includes(e.id)),Te=i&&x.live?M(me(i,x.live)):T,J=e=>{const a=G(),{w:n,h:f}=q(I.current),k=dt(e,s(`imageStudio.new.${e}`),(n/2-m.vp.x)/m.vp.z,(f/2-m.vp.y)/m.vp.z);k.x-=k.w/2,k.y-=k.h/2,r.getState().update(a,E=>ue(E,[...M(E),k])),r.setState({selection:[k.id]}),A(K)},Me=e=>{const{w:a,h:n}=q(I.current);m.setVp(et(m.vp,m.vp.z*e,a/2,n/2))};return t.jsxs("div",{className:"ims",onKeyDownCapture:e=>{if(e.target.closest('input, select, textarea, button, [contenteditable="true"]'))return;const a=e.metaKey||e.ctrlKey,n=e.key.toLowerCase();let f=!0;a&&n==="z"&&i?r.getState().undo(i.id,e.shiftKey):a&&n==="c"?Ce():a&&n==="v"?B():a&&n==="d"?B(!0):a&&n==="e"?z(!0):!a&&n==="t"?J("text"):!a&&n==="f"?J("frame"):!a&&n==="h"?L(!0):!a&&n==="v"?L(!1):n===" "?O(!0):(n==="escape"&&(L(!1),z(!1)),f=!1),f&&(e.preventDefault(),e.stopPropagation())},onKeyUpCapture:e=>{e.key===" "&&(O(!1),e.preventDefault(),e.stopPropagation())},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(O(!1),h.current=null)},children:[t.jsxs("header",{className:"ims-header",children:[t.jsxs("button",{className:"ims-back",title:s("imageStudio.back"),onClick:()=>r.getState().close(),children:[t.jsx(We,{size:15}),t.jsx("span",{children:i?.name})]}),t.jsxs("div",{className:"ims-head-actions",children:[i&&t.jsx("button",{disabled:p,title:s("imageStudio.backup"),"aria-label":s("imageStudio.backup"),onClick:()=>{$(()=>wt(i))},children:t.jsx(Nt,{size:16})}),t.jsxs("button",{className:"ims-primary",disabled:!V.length||p,onClick:()=>z(!d),children:[t.jsx(R,{size:14}),t.jsx("span",{children:s("imageStudio.exportOptions")})]})]})]}),t.jsxs("div",{className:"ims-toolbar",role:"toolbar","aria-label":s("imageStudio.title"),children:[t.jsxs("button",{disabled:p,onClick:()=>F.current?.click(),children:[t.jsx(W,{size:15}),t.jsx("span",{children:s("imageStudio.import")})]}),!Pe&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"ims-divider"}),t.jsx("button",{disabled:!g,title:s("imageStudio.undo"),"aria-label":s("imageStudio.undo"),onClick:()=>i&&r.getState().undo(i.id),children:t.jsx(Et,{size:15})}),t.jsx("button",{disabled:!v,title:s("imageStudio.redo"),"aria-label":s("imageStudio.redo"),onClick:()=>i&&r.getState().undo(i.id,!0),children:t.jsx(It,{size:15})}),t.jsx("button",{disabled:!H.some(e=>!e.locked&&!e.hidden),title:s("imageStudio.arrange"),"aria-label":s("imageStudio.arrange"),onClick:()=>{if(i){const e=lt(H.filter(a=>!a.locked&&!a.hidden));r.getState().update(i.id,a=>({...a,images:a.images.map(n=>e.find(f=>f.id===n.id)||n)})),m.fitTo(e)}},children:t.jsx(Pt,{size:15})}),t.jsx("button",{disabled:!Q.length,title:s("imageStudio.remove"),"aria-label":s("imageStudio.remove"),onClick:ke,children:t.jsx(ve,{size:15})}),t.jsx("button",{disabled:!Q.length,title:s("imageStudio.duplicate"),"aria-label":s("imageStudio.duplicate"),onClick:()=>B(!0),children:t.jsx(je,{size:15})}),t.jsx("button",{disabled:!Q.length||p,title:s("imageStudio.reference"),"aria-label":s("imageStudio.reference"),onClick:()=>{$(we)},children:t.jsx(Z,{size:15})})]}),t.jsx("span",{className:"ims-toolbar-space"}),[[ge,Z,"imageStudio.chat"],[vt,Ye,"imageStudio.layers"],[K,Se,"imageStudio.inspector"]].map(([e,a,n])=>t.jsx("button",{title:s(n),"aria-label":s(n),onClick:()=>A(e),children:t.jsx(a,{size:16})},e))]}),d&&i&&t.jsx(Bt,{board:i,selection:b,onClose:()=>z(!1)}),c&&t.jsxs("div",{className:"ims-error",role:"alert",children:[s("imageStudio.saveError"),t.jsx("button",{onClick:()=>{r.getState().flush()},children:s("imageStudio.retry")})]}),y&&t.jsxs("div",{className:"ims-error",role:"alert",children:[s("imageStudio.error",{error:y}),t.jsx("button",{onClick:()=>{N(""),u(e=>e+1)},children:s("imageStudio.retry")})]}),t.jsxs("div",{ref:I,className:`ims-stage${P||D?" is-panning":""}`,tabIndex:0,onContextMenu:e=>e.stopPropagation(),onPointerDownCapture:e=>{e.button===2||!(P||D)||e.target.closest(".amx-stage-tools, .amx-stage-hud, .amx-stage-minimap")||(e.stopPropagation(),e.preventDefault(),e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),h.current={id:e.pointerId,x:e.clientX,y:e.clientY,vx:m.vp.x,vy:m.vp.y})},onPointerMoveCapture:e=>{const a=h.current;if(!a||a.id!==e.pointerId)return;e.stopPropagation();const{u:n}=q(I.current);m.setVp({...m.vp,x:a.vx+(e.clientX-a.x)/n,y:a.vy+(e.clientY-a.y)/n})},onPointerUpCapture:e=>{h.current?.id===e.pointerId&&(e.stopPropagation(),h.current=null)},onPointerCancel:()=>{h.current=null},"aria-label":s("imageStudio.title"),onDragOver:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),Y(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Y(!1)},onDrop:e=>{e.preventDefault(),Y(!1),p||$(()=>de(Array.from(e.dataTransfer.files)))},children:[t.jsx("div",{className:"ims-grid",style:Xe(m.vp)}),t.jsxs("div",{className:"ims-world",style:{transform:`translate(${m.vp.x}px, ${m.vp.y}px) scale(${m.vp.z})`},children:[V.map(e=>{const a=Te.find(n=>n.id===e.id)||e;return t.jsxs("div",{"data-image-id":e.id,className:`ims-layer ${be(e)?"ims-image":`ims-${e.kind}`}${x.sel.includes(e.id)?" is-selected":""}${e.locked?" is-locked":""}`,style:{left:a.x,top:a.y,width:a.w,height:a.h},children:[t.jsx(bt,{item:e}),t.jsx("div",{className:"ims-image-label",children:e.name}),x.sel.includes(e.id)&&!e.locked&&t.jsx("div",{className:"ims-resize","data-resize":"se"})]},e.id)}),C.map(e=>{const a=H.find(n=>n.id===e.sourceIds[0]);return t.jsxs("div",{"data-generation-id":e.id,className:`ims-generation${e.status==="failed"?" is-failed":""}`,style:{left:e.x,top:e.y,width:e.w,height:e.h},role:e.status==="failed"?"alert":"status","aria-live":"polite",onPointerDown:n=>n.stopPropagation(),children:[t.jsx("div",{className:"ims-generation-sheen"}),t.jsxs("div",{className:"ims-generation-copy",children:[t.jsx(Ge,{size:20,strokeWidth:1.5}),t.jsx("strong",{children:s(e.kind==="edit"?"imageStudio.generation.editing":"imageStudio.generation.creating")}),t.jsx("span",{children:e.status==="failed"?s("imageStudio.generation.failed"):s(e.status==="preparing"?"imageStudio.generation.preparing":"imageStudio.generation.running")}),a&&t.jsx("small",{children:s("imageStudio.generation.versionOf",{name:a.name})}),e.count>1&&t.jsxs("small",{children:[e.index+1," / ",e.count]})]}),e.status==="failed"&&t.jsxs("div",{className:"ims-generation-actions amx-stage-tools",children:[t.jsx("button",{onClick:()=>A(ge),children:s("imageStudio.generation.openChat")}),t.jsx("button",{title:s("imageStudio.generation.dismiss"),"aria-label":s("imageStudio.generation.dismiss"),onClick:()=>r.getState().removeGeneration(i.id,e.id),children:t.jsx(fe,{size:14})})]})]},e.id)}),x.marquee&&t.jsx("div",{className:"ims-marquee",style:{left:x.marquee.x,top:x.marquee.y,width:x.marquee.w,height:x.marquee.h}})]}),!T.length&&!C.length&&t.jsxs("div",{className:"ims-empty amx-stage-tools",children:[t.jsxs("div",{className:"ims-eyebrow",children:[s("imageStudio.title")," ",t.jsx("span",{children:"/"})," ",s("imageStudio.new")]}),t.jsx("h1",{children:s("imageStudio.headline")}),t.jsx("p",{children:s("imageStudio.intro")}),t.jsx("div",{className:"ims-starters",children:["poster","product","illustration"].map(e=>t.jsxs("button",{disabled:p,onClick:()=>Le(`imageStudio.${e}Prompt`),children:[t.jsx("span",{children:s(`imageStudio.${e}`)}),t.jsx(Lt,{size:14})]},e))}),t.jsxs("button",{className:"ims-empty-import",disabled:p,onClick:()=>F.current?.click(),children:[t.jsx(W,{size:16}),s("imageStudio.import")]}),t.jsx("small",{children:s("imageStudio.importLimit")})]}),!C.length&&(l||p)&&t.jsxs("div",{className:"ims-progress amx-stage-tools",role:"status",children:[t.jsx(te,{size:15,className:"ims-spin"}),s(l?"imageStudio.generating":"imageStudio.busy")]}),Ie&&t.jsxs("div",{className:"ims-drop",children:[t.jsx(W,{size:28}),s("imageStudio.drop")]}),t.jsxs("div",{className:"ims-create-tools amx-stage-tools",role:"toolbar","aria-label":s("imageStudio.canvasTools"),children:[t.jsx("button",{title:s("imageStudio.selectTool"),"aria-label":s("imageStudio.selectTool"),"aria-pressed":!P,onClick:()=>{L(!1),I.current?.focus()},children:t.jsx(Qe,{size:17})}),t.jsx("button",{title:s("imageStudio.handTool"),"aria-label":s("imageStudio.handTool"),"aria-pressed":P,onClick:()=>{L(!0),I.current?.focus()},children:t.jsx(Tt,{size:17})}),t.jsx("span",{}),[["text",Mt],["rectangle",Je],["ellipse",Ze],["frame",Dt]].map(([e,a])=>t.jsx("button",{title:s(`imageStudio.add.${e}`),"aria-label":s(`imageStudio.add.${e}`),onClick:()=>J(e),children:t.jsx(a,{size:17})},e))]}),ie&&t.jsx(st,{hostRef:I,vp:m.vp,items:X.map(e=>({key:e.id,kind:"card",box:e})),onCenter:m.centerOn}),t.jsx(it,{zoom:m.vp.z,onZoomBy:Me,onFit:()=>m.fitTo(X),snap:se,onSnap:ze,mini:ie,onMini:Ne})]}),t.jsxs("footer",{className:"ims-footer",children:[t.jsx("span",{title:s("imageStudio.hint"),children:s(i?c?"imageStudio.unsaved":j?"imageStudio.saving":"imageStudio.local":"imageStudio.empty")}),i&&t.jsx("input",{"aria-label":s("imageStudio.name"),value:i.name,onChange:e=>r.getState().update(i.id,a=>({...a,name:e.target.value}),!1)}),t.jsx("span",{children:s("imageStudio.itemCount",{count:T.length})})]}),ae&&t.jsx(Ut,{target:ae,board:i,busy:p,onClose:Ee,onImport:()=>F.current?.click(),onExport:()=>z(!0),onInspect:()=>A(K),run:$}),t.jsx("input",{ref:F,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",multiple:!0,hidden:!0,onChange:e=>{const a=Array.from(e.target.files||[]);e.target.value="",$(()=>de(a))}})]})}const qt={version:1,id:"",name:"",updatedAt:0,sessionId:null,images:[],collected:[]};export{fs as ImageStudioView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as $,u as H,d as r,j as t,r as Q}from"./index-BOzsniE1.js";import{aq as V,cj as W,T as X}from"./appStore-CI1_L5OS.js";import"./client-CaivGZFR.js";const Y=[{id:"Chinese (Simplified)",label:"简体中文"},{id:"English",label:"English"},{id:"Japanese",label:"日本語"},{id:"Korean",label:"한국어"},{id:"French",label:"Français"},{id:"German",label:"Deutsch"},{id:"Spanish",label:"Español"},{id:"Russian",label:"Русский"}],D=(g,d)=>(g.match(d)||[]).length;function te(g,d=$()){const o=g.replace(/[\s\p{P}\p{S}\d]/gu,"");if(!o)return d==="zh"?"English":"Chinese (Simplified)";const b=!/[-ヿ]/.test(o)&&D(o,/[㐀-鿿豈-]/g)/o.length>.3;return d==="zh"?b?"English":"Chinese (Simplified)":D(o,/[A-Za-z]/g)/o.length>.9?"Chinese (Simplified)":"English"}Q({"inlineai.action.improve":{zh:"润色",en:"Improve writing"},"inlineai.action.fix":{zh:"修正拼写与语法",en:"Fix spelling and grammar"},"inlineai.action.shorter":{zh:"精简",en:"Make shorter"},"inlineai.action.longer":{zh:"扩写",en:"Make longer"},"inlineai.action.summarize":{zh:"总结",en:"Summarize"},"inlineai.action.translate":{zh:"翻译",en:"Translate"},"inlineai.action.continue":{zh:"续写",en:"Continue writing"},"inlineai.action.custom":{zh:"自定义指令…",en:"Custom instruction…"},"inlineai.label":{zh:"AI 写作",en:"AI writing"},"inlineai.placeholder":{zh:"告诉 Tangu 要写什么,留空则续写",en:"Tell Tangu what to write, or leave empty to continue"},"inlineai.placeholderSel":{zh:"告诉 Tangu 怎么改选中的文字",en:"Tell Tangu how to change the selection"},"inlineai.send":{zh:"生成",en:"Generate"},"inlineai.generating":{zh:"正在生成…",en:"Generating…"},"inlineai.stop":{zh:"停止",en:"Stop"},"inlineai.replace":{zh:"替换",en:"Replace"},"inlineai.insertBelow":{zh:"插入下方",en:"Insert below"},"inlineai.insert":{zh:"插入",en:"Insert"},"inlineai.discard":{zh:"丢弃",en:"Discard"},"inlineai.retry":{zh:"重试",en:"Try again"},"inlineai.hint":{zh:"预览:确认后才写入笔记",en:"Preview: nothing is written until you confirm"},"inlineai.toolText":{zh:"模型写出了工具调用的样子,但这里什么都没有执行",en:"The model wrote something that looks like a tool call, but nothing was run"},"inlineai.errEmptyResult":{zh:"没有生成任何内容",en:"Nothing was generated"},"inlineai.unavailable":{zh:"这里用不了正文 AI",en:"In-note AI is not available here"},"inlineai.targetChanged":{zh:"选中的文字在生成期间被改过,结果已插入到下方",en:"The selection changed while generating, so the result was inserted below it"},"inlineai.copy":{zh:"复制",en:"Copy"},"inlineai.copied":{zh:"已复制",en:"Copied"},"inlineai.close":{zh:"关闭",en:"Close"},"inlineai.targetLang":{zh:"目标语言",en:"Target language"},"inlineai.byMt":{zh:"机器翻译 · {name}",en:"Machine translation · {name}"}});function ie({x:g,y:d,anchorTop:o,title:b,hasSelection:m,askFirst:k,run:M,onApply:s,onClose:c,editorEl:N,language:f}){const{t:i}=H(),[a,h]=r.useState(k?"ask":"running"),[x,F]=r.useState(""),[u,v]=r.useState(""),[G,E]=r.useState(""),[B,T]=r.useState(!1),[q,O]=r.useState(""),[J,C]=r.useState(!1),w=r.useRef(null),p=r.useRef(""),R=r.useRef(void 0),S=r.useRef(null),y=r.useRef(null),I=r.useRef(N);I.current=N;const z=n=>{w.current?.abort();const e=new AbortController;w.current=e,R.current=n,p.current="",v(""),E(""),T(!1),h("running"),M(n,l=>{e.signal.aborted||(p.current+=l,v(p.current))},e.signal).then(l=>{if(e.signal.aborted)return;const P=String(l.text??"");v(P),T(!!l.toolCallText),O(l.model?l.model.mt?i("inlineai.byMt",{name:l.model.name}):l.model.name:""),P.trim()?h("done"):(E(i("inlineai.errEmptyResult")),h("error"))}).catch(l=>{e.signal.aborted||(E(String(l?.message||l)),h("error"))})},U=()=>{w.current?.abort(),p.current.trim()?(v(p.current),h("done")):k?h("ask"):c()};r.useEffect(()=>(k?requestAnimationFrame(()=>S.current?.focus()):z(void 0),()=>w.current?.abort()),[]);const L=m?"replace":"insert",K=n=>{const e=document.activeElement;return!e||e===document.body||e===document.documentElement?!0:y.current?.contains(e)?!n||e===y.current:s?!!I.current?.contains(e):!e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])')},j=r.useRef({phase:a,text:u,primary:L});j.current={phase:a,text:u,primary:L},r.useEffect(()=>{const n=e=>{e.isComposing||e.keyCode===229||(e.key==="Escape"&&K(!1)?(e.preventDefault(),e.stopPropagation(),c()):s&&e.key==="Enter"&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&j.current.phase==="done"&&K(!0)&&(e.preventDefault(),e.stopPropagation(),s(j.current.primary,j.current.text)))};return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[c,s]),r.useEffect(()=>{if(s)return;const n=e=>{y.current?.contains(e.target)||c()};return document.addEventListener("mousedown",n,!0),()=>document.removeEventListener("mousedown",n,!0)},[s,c]);const Z=()=>{navigator.clipboard?.writeText(u).then(()=>{C(!0),window.setTimeout(()=>C(!1),1500)}).catch(()=>{})},_=n=>t.jsx("button",{type:"button",className:`btn sm${n?" primary":""}`,"data-act":"copy",onClick:Z,children:i(J?"inlineai.copied":"inlineai.copy")});return t.jsxs(V,{innerRef:n=>{y.current=n},className:"ui-popover am-ai-panel",x:g,y:d,anchorTop:o,prefer:"below",role:"dialog","aria-label":s?i("inlineai.label"):b,"data-testid":"inline-ai-panel","data-phase":a,"data-readonly":s?void 0:"",children:[t.jsxs("div",{className:"am-ai-head",children:[f?t.jsx(W,{size:14,"aria-hidden":!0}):t.jsx(X,{size:14,"aria-hidden":!0}),t.jsx("span",{className:"am-ai-title",children:b}),f&&t.jsx("select",{className:"am-ai-lang","aria-label":i("inlineai.targetLang"),"data-testid":"inline-ai-lang",value:f.value,onChange:n=>f.onChange(n.target.value),children:Y.map(n=>t.jsx("option",{value:n.id,children:n.label},n.id))}),a!=="ask"&&t.jsx("span",{className:"am-ai-hint","data-testid":"inline-ai-hint",children:a==="running"?i("inlineai.generating"):a==="done"&&q||(s?i("inlineai.hint"):"")})]}),a==="ask"&&t.jsxs("div",{className:"am-ai-ask",children:[t.jsx("textarea",{ref:S,className:"am-ai-input",rows:2,value:x,placeholder:i(m?"inlineai.placeholderSel":"inlineai.placeholder"),onChange:n=>F(n.target.value),onKeyDown:n=>{if(n.key!=="Enter"||n.shiftKey||n.nativeEvent.isComposing||n.keyCode===229)return;n.preventDefault(),n.stopPropagation();const e=x.trim();!e&&m||z(e||void 0)}}),t.jsxs("div",{className:"am-ai-actions",children:[t.jsx("button",{type:"button",className:"btn sm primary","data-act":"send",disabled:m&&!x.trim(),onClick:()=>z(x.trim()||void 0),children:i("inlineai.send")}),t.jsx("button",{type:"button",className:"btn sm","data-act":"discard",onClick:c,children:i("inlineai.discard")})]})]}),a!=="ask"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"am-ai-preview","data-testid":"inline-ai-preview",children:u||(a==="running"?"…":"")}),a==="error"&&t.jsx("div",{className:"am-ai-error",role:"alert",children:G}),B&&a==="done"&&t.jsx("div",{className:"am-ai-error",children:i("inlineai.toolText")}),t.jsxs("div",{className:"am-ai-actions",children:[a==="running"&&t.jsx("button",{type:"button",className:"btn sm","data-act":"stop",onClick:U,children:i("inlineai.stop")}),a==="done"&&s&&m&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"btn sm primary","data-act":"replace",onClick:()=>s("replace",u),children:i("inlineai.replace")}),t.jsx("button",{type:"button",className:"btn sm","data-act":"below",onClick:()=>s("below",u),children:i("inlineai.insertBelow")})]}),a==="done"&&s&&!m&&t.jsx("button",{type:"button",className:"btn sm primary","data-act":"insert",onClick:()=>s("insert",u),children:i("inlineai.insert")}),a==="done"&&_(!s),(a==="done"||a==="error")&&t.jsx("button",{type:"button",className:"btn sm","data-act":"retry",onClick:()=>z(R.current),children:i("inlineai.retry")}),t.jsx("button",{type:"button",className:"btn sm","data-act":"discard",onClick:c,children:i(s?"inlineai.discard":"inlineai.close")})]})]})]})}export{ie as I,te as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,d as y}from"./index-BOzsniE1.js";import{tc as v,m7 as f,c8 as b,m9 as p,m8 as x,td as z,lx as T}from"./appStore-CI1_L5OS.js";import{n as S}from"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";import"./client-CaivGZFR.js";const L=t=>(t.mime?.startsWith("image/")??!1)||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(t.name);function R(t){const n=t.match(/^data:([^;]+);base64,(.*)$/),e=p(n?.[2]||"");return{mimeType:n?.[1]||"application/octet-stream",bytes:e,size:e.length}}function k(t,n,e,i){e=t.sourceSessionId||e;const o=i==="host"?v(e):null,l=a=>{S({text:a?.message||String(a),level:"error"})},r=o?.downloadHostFile;return{name:t.name,path:o?.local&&t.path&&/^([/~]|[A-Za-z]:[\\/])/.test(t.path)?t.path:void 0,load:async()=>{if(t.dataUrl)return R(t.dataUrl);if(!t.path)return null;if(o){const c=await o.readHostFile(t.path);return c.tooLarge?{tooLarge:!0,size:c.size}:{mimeType:c.mimeType,bytes:p(c.content),size:c.size}}const a=await x(b(e),e,t.path);return{mimeType:a.mimeType,bytes:p(a.content),size:a.size}},download:t.path?i==="host"?r?()=>{r(t.path,t.name).catch(l)}:void 0:()=>{f(b(e),e,t.path).catch(l)}:void 0}}const U=({f:t,onClick:n})=>{const e=T(t.mime||"",t.name);return s.jsxs("button",{className:"inline-file-card",title:t.name,onClick:n,children:[s.jsx(e,{size:15}),s.jsx("span",{className:"inline-file-name",children:t.name})]})},E=({f:t,cfg:n,sessionId:e,execMode:i,onClick:o})=>{e=t.sourceSessionId||e;const l=t.dataUrl||(t.path&&i!=="host"?z(b(e),e,t.path):null),[r,a]=y.useState(l),[c,h]=y.useState(!1),d=y.useRef(null);return y.useEffect(()=>{if(h(!1),l){a(l);return}let u=!1;return(async()=>{if(!t.path)return;const j=i==="host"?v(e):null;try{let g=null,F="";if(j){const m=await j.readHostFile(t.path);if(u)return;if(m.tooLarge){h(!0);return}g=p(m.content),F=m.mimeType}else if(i!=="host"){const m=await x(b(e),e,t.path);if(u)return;g=p(m.content),F=m.mimeType}if(!g||u)return;const w=URL.createObjectURL(new Blob([g],{type:F||t.mime||"image/png"}));d.current=w,a(w)}catch{u||h(!0)}})(),()=>{u=!0,d.current&&(URL.revokeObjectURL(d.current),d.current=null)}},[t.path,t.dataUrl]),c?s.jsx(U,{f:t,onClick:o}):r?s.jsx("img",{className:"inline-file-img",src:r,alt:t.name,title:t.name,onClick:o,draggable:!1,onError:()=>h(!0)}):null},B=({files:t,cfg:n,sessionId:e,execMode:i,onOpenPreview:o})=>{if(!t.length)return null;const l=r=>o?.(k(r,n,e,i));return s.jsx("div",{className:"inline-file-grid",children:t.map((r,a)=>L(r)?s.jsx(E,{f:r,cfg:n,sessionId:e,execMode:i,onClick:()=>l(r)},a):s.jsx(U,{f:r,onClick:()=>l(r)},a))})};export{B as InlineFiles,k as targetFor};
|