@e-xi/xion 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/bin/icon-generator.d.ts +22 -0
- package/dist/bin/index.d.ts +5 -0
- package/dist/bin/index.js +92 -0
- package/dist/bin/logo-generator.d.ts +22 -0
- package/dist/chunk-files/chunk-34OODP7M.js +147 -0
- package/dist/chunk-files/chunk-3KBZWBNP.js +51 -0
- package/dist/chunk-files/chunk-3R6EJDYR.js +10 -0
- package/dist/chunk-files/chunk-3RVKOFMP.js +68 -0
- package/dist/chunk-files/chunk-3S5OTD47.js +35 -0
- package/dist/chunk-files/chunk-3XB4IEWO.js +195 -0
- package/dist/chunk-files/chunk-3XOVD6UX.js +8 -0
- package/dist/chunk-files/chunk-4HEDNQUP.js +426 -0
- package/dist/chunk-files/chunk-4SSGMLEE.js +934 -0
- package/dist/chunk-files/chunk-5PKWVAQP.js +92 -0
- package/dist/chunk-files/chunk-6BOPFOZD.js +19 -0
- package/dist/chunk-files/chunk-6FDO72PN.js +25 -0
- package/dist/chunk-files/chunk-6X74EPRM.js +0 -0
- package/dist/chunk-files/chunk-B2FI5WI5.js +67 -0
- package/dist/chunk-files/chunk-B7DTBTWQ.js +74 -0
- package/dist/chunk-files/chunk-BFD2LHLK.js +60 -0
- package/dist/chunk-files/chunk-BJOPQNB2.js +319 -0
- package/dist/chunk-files/chunk-BMOLIJ3W.js +89 -0
- package/dist/chunk-files/chunk-BPTFUGTP.js +97 -0
- package/dist/chunk-files/chunk-CSUNGWAE.js +405 -0
- package/dist/chunk-files/chunk-D5ZV4VMI.js +627 -0
- package/dist/chunk-files/chunk-DD6WZ4NY.js +841 -0
- package/dist/chunk-files/chunk-DEODEAKM.js +19 -0
- package/dist/chunk-files/chunk-DRMV3M5V.js +1970 -0
- package/dist/chunk-files/chunk-EQTU45UO.js +21 -0
- package/dist/chunk-files/chunk-F7YTK2MY.js +154 -0
- package/dist/chunk-files/chunk-FMQTZ3QV.js +17 -0
- package/dist/chunk-files/chunk-FPN7JYR4.js +67 -0
- package/dist/chunk-files/chunk-FULHNQ4O.js +1243 -0
- package/dist/chunk-files/chunk-GN2FNR3Z.js +259 -0
- package/dist/chunk-files/chunk-GROGDGEL.js +177 -0
- package/dist/chunk-files/chunk-GUOSVDXA.js +34 -0
- package/dist/chunk-files/chunk-HT5V5A7S.js +6 -0
- package/dist/chunk-files/chunk-ID3YDA2K.js +19 -0
- package/dist/chunk-files/chunk-IH3R2NDR.js +230 -0
- package/dist/chunk-files/chunk-IMGYTSWY.js +261 -0
- package/dist/chunk-files/chunk-J34MOWJP.js +26 -0
- package/dist/chunk-files/chunk-KFK47PDH.js +77 -0
- package/dist/chunk-files/chunk-KFV4GXVE.js +11 -0
- package/dist/chunk-files/chunk-LFHJJQW3.js +723 -0
- package/dist/chunk-files/chunk-LQ67F6EY.js +32 -0
- package/dist/chunk-files/chunk-MJ6Q3TIX.js +703 -0
- package/dist/chunk-files/chunk-OUFO3LM4.js +135 -0
- package/dist/chunk-files/chunk-P4CX6I4J.js +14 -0
- package/dist/chunk-files/chunk-PL5KNBCY.js +78 -0
- package/dist/chunk-files/chunk-PVWRRUOK.js +11 -0
- package/dist/chunk-files/chunk-Q7LCZIQP.js +15 -0
- package/dist/chunk-files/chunk-Q7YMMN7J.js +220 -0
- package/dist/chunk-files/chunk-RAVPJRBA.js +118 -0
- package/dist/chunk-files/chunk-RN7AI33H.js +26 -0
- package/dist/chunk-files/chunk-RODB64YF.js +148 -0
- package/dist/chunk-files/chunk-SVTZ4T6S.js +10 -0
- package/dist/chunk-files/chunk-T3QCAOCO.js +20 -0
- package/dist/chunk-files/chunk-U4XEWVBH.js +19 -0
- package/dist/chunk-files/chunk-UCMR6V67.js +746 -0
- package/dist/chunk-files/chunk-UFYEZIUE.js +1269 -0
- package/dist/chunk-files/chunk-UIJUY7QZ.js +18 -0
- package/dist/chunk-files/chunk-VGDNICVG.js +67 -0
- package/dist/chunk-files/chunk-W2I3I7U7.js +35 -0
- package/dist/chunk-files/chunk-WGYOMA43.js +33 -0
- package/dist/chunk-files/chunk-WKVLVI6N.js +44 -0
- package/dist/chunk-files/chunk-WOJ2UKI7.js +11 -0
- package/dist/chunk-files/chunk-Y3OEXVQ2.js +59 -0
- package/dist/chunk-files/chunk-YLZRRUY7.js +6 -0
- package/dist/chunk-files/chunk-YTHS2ZV7.js +51 -0
- package/dist/chunk-files/chunk-YXAEUJKJ.js +331 -0
- package/dist/chunk-files/chunk-YZOJOLFL.js +121 -0
- package/dist/main/app/app-lifecycle-abstract.d.ts +190 -0
- package/dist/main/app/app-lifecycle.d.ts +7 -0
- package/dist/main/app/icons/icon.ico +0 -0
- package/dist/main/app/index.d.ts +8 -0
- package/dist/main/app/index.js +1226 -0
- package/dist/main/app/types/app.d.ts +74 -0
- package/dist/main/app/xo-app-abstract.d.ts +464 -0
- package/dist/main/app/xo-app.d.ts +23 -0
- package/dist/main/auth/index.d.ts +8 -0
- package/dist/main/auth/index.js +109 -0
- package/dist/main/auth/jwt-auth-manager.d.ts +302 -0
- package/dist/main/auth/jwt-auth-provider-abstract.d.ts +100 -0
- package/dist/main/auth/jwt-auth-refresh-rejected-error.d.ts +12 -0
- package/dist/main/auth/jwt-auth-session-changed-error.d.ts +12 -0
- package/dist/main/auth/types/jwt-auth-manager.d.ts +13 -0
- package/dist/main/banner/banner-abstract.d.ts +38 -0
- package/dist/main/banner/banner-manager.d.ts +20 -0
- package/dist/main/banner/index.d.ts +6 -0
- package/dist/main/banner/index.js +10 -0
- package/dist/main/banner/types/banner.d.ts +17 -0
- package/dist/main/config/app-config.d.ts +6 -0
- package/dist/main/config/index.d.ts +13 -0
- package/dist/main/config/index.js +33 -0
- package/dist/main/config/logger-config.d.ts +6 -0
- package/dist/main/config/remote-service-config.d.ts +6 -0
- package/dist/main/config/tray-config.d.ts +6 -0
- package/dist/main/config/types/app.d.ts +38 -0
- package/dist/main/config/types/logger.d.ts +82 -0
- package/dist/main/config/types/window.d.ts +35 -0
- package/dist/main/config/updater-config.d.ts +6 -0
- package/dist/main/config/window/main-window-config.d.ts +6 -0
- package/dist/main/config/window/setting-window-config.d.ts +6 -0
- package/dist/main/file-association/file-association-handlers-abstract.d.ts +23 -0
- package/dist/main/file-association/file-association-manager-abstract.d.ts +87 -0
- package/dist/main/file-association/file-association-manager.d.ts +13 -0
- package/dist/main/file-association/handlers/app-file-association-handlers.d.ts +12 -0
- package/dist/main/file-association/index.d.ts +8 -0
- package/dist/main/file-association/index.js +13 -0
- package/dist/main/file-association/types/file-association.d.ts +31 -0
- package/dist/main/ipc/handlers/app-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/auth-handlers.d.ts +12 -0
- package/dist/main/ipc/handlers/clipboard-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/contex-menu-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/dialog-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/file-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/log-handlers.d.ts +45 -0
- package/dist/main/ipc/handlers/remote-service-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/shell-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/theme-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/updater-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/window-handlers.d.ts +13 -0
- package/dist/main/ipc/index.d.ts +20 -0
- package/dist/main/ipc/index.js +60 -0
- package/dist/main/ipc/ipc-handlers-abstract.d.ts +23 -0
- package/dist/main/ipc/ipc-manager-abstract.d.ts +46 -0
- package/dist/main/ipc/ipc-manager.d.ts +13 -0
- package/dist/main/ipc/types/ipc-handler.d.ts +22 -0
- package/dist/main/ipc/utils/ipc-handler-util.d.ts +24 -0
- package/dist/main/logger/index.d.ts +4 -0
- package/dist/main/logger/index.js +13 -0
- package/dist/main/logger/xo-logger.d.ts +113 -0
- package/dist/main/menu/consts/menu-type.d.ts +1 -0
- package/dist/main/menu/index.d.ts +8 -0
- package/dist/main/menu/index.js +28 -0
- package/dist/main/menu/menu-items.d.ts +192 -0
- package/dist/main/menu/menu-manager-abstract.d.ts +273 -0
- package/dist/main/menu/menu-manager.d.ts +12 -0
- package/dist/main/menu/types/menu.d.ts +101 -0
- package/dist/main/mode/app-mode.d.ts +32 -0
- package/dist/main/mode/index.d.ts +5 -0
- package/dist/main/mode/index.js +9 -0
- package/dist/main/mode/types/mode.d.ts +25 -0
- package/dist/main/protocol/consts/protocol-keys.d.ts +10 -0
- package/dist/main/protocol/handlers/app-protocol-handlers.d.ts +12 -0
- package/dist/main/protocol/index.d.ts +9 -0
- package/dist/main/protocol/index.js +15 -0
- package/dist/main/protocol/protocol-handlers-abstract.d.ts +23 -0
- package/dist/main/protocol/protocol-manager-abstract.d.ts +85 -0
- package/dist/main/protocol/protocol-manager.d.ts +13 -0
- package/dist/main/protocol/types/protocol.d.ts +33 -0
- package/dist/main/remote-service/consts/remote-service-methods.d.ts +5 -0
- package/dist/main/remote-service/index.d.ts +7 -0
- package/dist/main/remote-service/index.js +17 -0
- package/dist/main/remote-service/remote-service-manager-abstract.d.ts +303 -0
- package/dist/main/remote-service/remote-service-manager.d.ts +7 -0
- package/dist/main/remote-service/types/remote-service.d.ts +9 -0
- package/dist/main/renderer-protocol/handlers/renderer-remote-service-protocol-handlers.d.ts +130 -0
- package/dist/main/renderer-protocol/handlers/renderer-root-protocol-handlers.d.ts +65 -0
- package/dist/main/renderer-protocol/index.d.ts +9 -0
- package/dist/main/renderer-protocol/index.js +18 -0
- package/dist/main/renderer-protocol/renderer-protocol-handlers-abstract.d.ts +23 -0
- package/dist/main/renderer-protocol/renderer-protocol-manager-abstract.d.ts +78 -0
- package/dist/main/renderer-protocol/renderer-protocol-manager.d.ts +13 -0
- package/dist/main/renderer-protocol/types/renderer-protocol.d.ts +34 -0
- package/dist/main/shortcut/handlers/app-shortcut-handlers.d.ts +11 -0
- package/dist/main/shortcut/handlers/window-shortcut-handlers.d.ts +11 -0
- package/dist/main/shortcut/index.d.ts +9 -0
- package/dist/main/shortcut/index.js +17 -0
- package/dist/main/shortcut/shortcut-handlers-abstract.d.ts +18 -0
- package/dist/main/shortcut/shortcut-manager-abstract.d.ts +121 -0
- package/dist/main/shortcut/shortcut-manager.d.ts +12 -0
- package/dist/main/shortcut/types/shortcut.d.ts +50 -0
- package/dist/main/store/app-store.d.ts +179 -0
- package/dist/main/store/index.d.ts +7 -0
- package/dist/main/store/index.js +13 -0
- package/dist/main/store/jwt-auth-store.d.ts +36 -0
- package/dist/main/store/types/app-store.d.ts +46 -0
- package/dist/main/store/types/jwt-auth-store.d.ts +14 -0
- package/dist/main/theme/consts/theme-sources.d.ts +10 -0
- package/dist/main/theme/index.d.ts +7 -0
- package/dist/main/theme/index.js +16 -0
- package/dist/main/theme/theme-manager-abstract.d.ts +93 -0
- package/dist/main/theme/theme-manager.d.ts +7 -0
- package/dist/main/theme/types/theme.d.ts +38 -0
- package/dist/main/tray/consts/tray-animation-name.d.ts +1 -0
- package/dist/main/tray/consts/tray-icon-name.d.ts +1 -0
- package/dist/main/tray/icons/blur.ico +0 -0
- package/dist/main/tray/icons/error.ico +0 -0
- package/dist/main/tray/icons/focus.ico +0 -0
- package/dist/main/tray/icons/none.ico +0 -0
- package/dist/main/tray/icons/offline.ico +0 -0
- package/dist/main/tray/icons/online.ico +0 -0
- package/dist/main/tray/icons/success.ico +0 -0
- package/dist/main/tray/index.d.ts +11 -0
- package/dist/main/tray/index.js +27 -0
- package/dist/main/tray/tray-animation.d.ts +48 -0
- package/dist/main/tray/tray-icon.d.ts +51 -0
- package/dist/main/tray/tray-lifecycle-abstract.d.ts +154 -0
- package/dist/main/tray/tray-lifecycle.d.ts +7 -0
- package/dist/main/tray/tray-manager.d.ts +173 -0
- package/dist/main/tray/types/tray.d.ts +81 -0
- package/dist/main/updater/dev-app-update.yml +5 -0
- package/dist/main/updater/index.d.ts +6 -0
- package/dist/main/updater/index.js +20 -0
- package/dist/main/updater/types/updater.d.ts +167 -0
- package/dist/main/updater/updater-manager-abstract.d.ts +237 -0
- package/dist/main/updater/updater-manager.d.ts +7 -0
- package/dist/main/utils/file-association-util.d.ts +43 -0
- package/dist/main/utils/index.d.ts +14 -0
- package/dist/main/utils/index.js +105 -0
- package/dist/main/utils/menu-util.d.ts +12 -0
- package/dist/main/utils/protocol-util.d.ts +49 -0
- package/dist/main/utils/runtime-config-util.d.ts +75 -0
- package/dist/main/utils/shortcut-util.d.ts +38 -0
- package/dist/main/utils/tray-util.d.ts +18 -0
- package/dist/main/utils/window-util.d.ts +55 -0
- package/dist/main/utils/xo-app-root-util.d.ts +30 -0
- package/dist/main/utils/xo-app-util.d.ts +24 -0
- package/dist/main/utils/xo-path-util.d.ts +59 -0
- package/dist/main/utils/xo-util.d.ts +17 -0
- package/dist/main/window/index.d.ts +10 -0
- package/dist/main/window/index.js +36 -0
- package/dist/main/window/main/main-window-lifecycle.d.ts +7 -0
- package/dist/main/window/main/main-window-type.d.ts +5 -0
- package/dist/main/window/setting/setting-window-lifecycle.d.ts +7 -0
- package/dist/main/window/setting/setting-window-type.d.ts +5 -0
- package/dist/main/window/types/window.d.ts +86 -0
- package/dist/main/window/window-lifecycle-abstract.d.ts +514 -0
- package/dist/main/window/window-manager.d.ts +422 -0
- package/dist/preload/bridge/bridge-abstract.d.ts +11 -0
- package/dist/preload/bridge/bridge.d.ts +35 -0
- package/dist/preload/bridge/index.d.ts +6 -0
- package/dist/preload/bridge/index.js +117 -0
- package/dist/preload/bridge/preload.cjs +1706 -0
- package/dist/preload/bridge/preload.internal.d.ts +1 -0
- package/dist/preload/bridge/types/bridge.d.ts +19 -0
- package/dist/preload/bridges/app/app-bridge.d.ts +142 -0
- package/dist/preload/bridges/app/types/app.d.ts +65 -0
- package/dist/preload/bridges/auth/auth-bridge.d.ts +36 -0
- package/dist/preload/bridges/auth/types/auth.d.ts +23 -0
- package/dist/preload/bridges/clipboard/clipboard-bridge.d.ts +37 -0
- package/dist/preload/bridges/clipboard/types/clipboard.d.ts +23 -0
- package/dist/preload/bridges/context-menu/context-menu-bridge.d.ts +27 -0
- package/dist/preload/bridges/context-menu/types/context-menu.d.ts +19 -0
- package/dist/preload/bridges/dialog/dialog-bridge.d.ts +30 -0
- package/dist/preload/bridges/dialog/types/dialog.d.ts +41 -0
- package/dist/preload/bridges/file/file-bridge.d.ts +34 -0
- package/dist/preload/bridges/file/types/file.d.ts +21 -0
- package/dist/preload/bridges/index.d.ts +29 -0
- package/dist/preload/bridges/index.js +40 -0
- package/dist/preload/bridges/ipc/ipc-bridge.d.ts +43 -0
- package/dist/preload/bridges/ipc/types/ipc.d.ts +23 -0
- package/dist/preload/bridges/log/log-bridge.d.ts +52 -0
- package/dist/preload/bridges/log/types/log.d.ts +20 -0
- package/dist/preload/bridges/remote-service/remote-service-bridge.d.ts +55 -0
- package/dist/preload/bridges/remote-service/types/remote-service.d.ts +29 -0
- package/dist/preload/bridges/shell/shell-bridge.d.ts +27 -0
- package/dist/preload/bridges/shell/types/shell.d.ts +19 -0
- package/dist/preload/bridges/theme/theme-bridge.d.ts +32 -0
- package/dist/preload/bridges/theme/types/theme.d.ts +21 -0
- package/dist/preload/bridges/updater/types/updater.d.ts +35 -0
- package/dist/preload/bridges/updater/updater-bridge.d.ts +66 -0
- package/dist/preload/bridges/window/internal/route-redirect-buffer.d.ts +36 -0
- package/dist/preload/bridges/window/types/window.d.ts +53 -0
- package/dist/preload/bridges/window/window-bridge.d.ts +118 -0
- package/dist/preload/utils/bridge-util.d.ts +43 -0
- package/dist/preload/utils/index.d.ts +4 -0
- package/dist/preload/utils/index.js +7 -0
- package/dist/renderer/app/bootstrap-renderer.d.ts +6 -0
- package/dist/renderer/app/index.d.ts +5 -0
- package/dist/renderer/app/index.js +164 -0
- package/dist/renderer/app/styles-element-plus.internal.d.ts +2 -0
- package/dist/renderer/app/styles-xion.internal.d.ts +2 -0
- package/dist/renderer/app/types/app.d.ts +51 -0
- package/dist/renderer/components/captcha/internal/captcha-controller.d.ts +280 -0
- package/dist/renderer/components/captcha/internal/captcha-css-property.d.ts +25 -0
- package/dist/renderer/components/captcha/internal/captcha-defaults.d.ts +33 -0
- package/dist/renderer/components/captcha/internal/captcha-errors.d.ts +21 -0
- package/dist/renderer/components/captcha/internal/captcha-helper.d.ts +72 -0
- package/dist/renderer/components/captcha/internal/captcha-injector.d.ts +16 -0
- package/dist/renderer/components/captcha/internal/captcha-runtime-types.d.ts +153 -0
- package/dist/renderer/components/captcha/internal/captcha-service.d.ts +22 -0
- package/dist/renderer/components/captcha/internal/captcha-slide-types.d.ts +62 -0
- package/dist/renderer/components/captcha/internal/captcha-ui-patch.d.ts +43 -0
- package/dist/renderer/components/captcha/internal/captcha-wasm-loader.d.ts +36 -0
- package/dist/renderer/components/captcha/style/index.less +132 -0
- package/dist/renderer/components/captcha/types/captcha.d.ts +132 -0
- package/dist/renderer/components/captcha/xo-captcha-host.vue +151 -0
- package/dist/renderer/components/captcha/xo-captcha.vue +83 -0
- package/dist/renderer/components/captcha.d.ts +40 -0
- package/dist/renderer/components/context-menu/types/context-menu.d.ts +55 -0
- package/dist/renderer/components/context-menu/xo-context-menu-items.vue +112 -0
- package/dist/renderer/components/context-menu/xo-context-menu.vue +356 -0
- package/dist/renderer/components/context-menu.d.ts +32 -0
- package/dist/renderer/components/divider/types/divider.d.ts +31 -0
- package/dist/renderer/components/divider/xo-divider.vue +176 -0
- package/dist/renderer/components/form/types/form-flex-row.d.ts +21 -0
- package/dist/renderer/components/form/types/form-flex.d.ts +49 -0
- package/dist/renderer/components/form/xo-form-flex-row.vue +122 -0
- package/dist/renderer/components/form/xo-form-flex.vue +115 -0
- package/dist/renderer/components/index.d.ts +70 -0
- package/dist/renderer/components/index.js +1282 -0
- package/dist/renderer/components/layouts/types/app-layout.d.ts +29 -0
- package/dist/renderer/components/layouts/types/mini-layout.d.ts +23 -0
- package/dist/renderer/components/layouts/types/simple-layout.d.ts +17 -0
- package/dist/renderer/components/layouts/xo-app-layout.vue +350 -0
- package/dist/renderer/components/layouts/xo-mini-layout.vue +207 -0
- package/dist/renderer/components/layouts/xo-simple-layout.vue +43 -0
- package/dist/renderer/components/pages/types/app-page.d.ts +25 -0
- package/dist/renderer/components/pages/types/bootstrap-page.d.ts +35 -0
- package/dist/renderer/components/pages/types/dynamic-page.d.ts +20 -0
- package/dist/renderer/components/pages/types/settings-page.d.ts +23 -0
- package/dist/renderer/components/pages/xo-app-page.vue +230 -0
- package/dist/renderer/components/pages/xo-bootstrap-page.vue +93 -0
- package/dist/renderer/components/pages/xo-dynamic-page.vue +28 -0
- package/dist/renderer/components/pages/xo-settings-page.vue +143 -0
- package/dist/renderer/components/radio-group/types/radio-group.d.ts +30 -0
- package/dist/renderer/components/radio-group/xo-radio-group.vue +38 -0
- package/dist/renderer/components/service-status-bar/types/service-status-bar.d.ts +65 -0
- package/dist/renderer/components/service-status-bar/xo-service-status-bar.vue +193 -0
- package/dist/renderer/components/settings-components/types/setting-app-opacity.d.ts +19 -0
- package/dist/renderer/components/settings-components/types/setting-log-level.d.ts +23 -0
- package/dist/renderer/components/settings-components/types/setting-shortcut-keys-record-for-form-flex-rows.d.ts +47 -0
- package/dist/renderer/components/settings-components/types/setting-shortcut-keys-record.d.ts +23 -0
- package/dist/renderer/components/settings-components/types/setting-window-material.d.ts +23 -0
- package/dist/renderer/components/settings-components/xo-setting-app-opacity.vue +105 -0
- package/dist/renderer/components/settings-components/xo-setting-log-level.vue +84 -0
- package/dist/renderer/components/settings-components/xo-setting-shortcut-keys-record-for-form-flex-rows.vue +37 -0
- package/dist/renderer/components/settings-components/xo-setting-shortcut-keys-record.vue +74 -0
- package/dist/renderer/components/settings-components/xo-setting-window-material.vue +83 -0
- package/dist/renderer/components/settings-pages/types/setting-page-folder.d.ts +41 -0
- package/dist/renderer/components/settings-pages/types/setting-page-general.d.ts +23 -0
- package/dist/renderer/components/settings-pages/types/setting-page-remote-service.d.ts +19 -0
- package/dist/renderer/components/settings-pages/types/setting-page-updater.d.ts +27 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-folder.vue +137 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-general.vue +255 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-remote-service.vue +183 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-updater.vue +350 -0
- package/dist/renderer/components/shortcut-keys-record/types/shortcut-keys-record.d.ts +25 -0
- package/dist/renderer/components/shortcut-keys-record/xo-shortcut-keys-record.vue +161 -0
- package/dist/renderer/components/side-bar/types/sidebar-logo.d.ts +39 -0
- package/dist/renderer/components/side-bar/xo-sidebar-logo.vue +133 -0
- package/dist/renderer/components/spacing-line/types/spacing-line.d.ts +17 -0
- package/dist/renderer/components/spacing-line/xo-spacing-line.vue +53 -0
- package/dist/renderer/components/theme-switch/types/theme-switch-mini.d.ts +21 -0
- package/dist/renderer/components/theme-switch/types/theme-switch.d.ts +45 -0
- package/dist/renderer/components/theme-switch/xo-theme-switch-mini.vue +93 -0
- package/dist/renderer/components/theme-switch/xo-theme-switch.vue +200 -0
- package/dist/renderer/components/title-bar/types/title-bar.d.ts +58 -0
- package/dist/renderer/components/title-bar/xo-title-bar.vue +364 -0
- package/dist/renderer/components/types/sidebar-menu.d.ts +37 -0
- package/dist/renderer/components/types/vue.d.ts +9 -0
- package/dist/renderer/components/updater/types/updater.d.ts +97 -0
- package/dist/renderer/components/updater/xo-updater.vue +1190 -0
- package/dist/renderer/components/window-control/types/window-control.d.ts +17 -0
- package/dist/renderer/components/window-control/xo-window-control.vue +193 -0
- package/dist/renderer/composables/index.d.ts +7 -0
- package/dist/renderer/composables/index.js +570 -0
- package/dist/renderer/composables/use-xo-boolean.d.ts +14 -0
- package/dist/renderer/composables/use-xo-data-loader.d.ts +73 -0
- package/dist/renderer/composables/use-xo-form-control.d.ts +84 -0
- package/dist/renderer/composables/use-xo-updater-action.d.ts +25 -0
- package/dist/renderer/global/index.d.ts +4 -0
- package/dist/renderer/global/index.js +0 -0
- package/dist/renderer/global/types/window.d.ts +21 -0
- package/dist/renderer/icons/demo.css +539 -0
- package/dist/renderer/icons/iconfont.css +490 -0
- package/dist/renderer/services/index.d.ts +6 -0
- package/dist/renderer/services/index.js +444 -0
- package/dist/renderer/services/orval-axios-mutator.d.ts +9 -0
- package/dist/renderer/services/types/xo-api.d.ts +92 -0
- package/dist/renderer/services/xo-api-requester.d.ts +129 -0
- package/dist/renderer/store/app/app-store.d.ts +68 -0
- package/dist/renderer/store/auth/auth-store.d.ts +43 -0
- package/dist/renderer/store/index.d.ts +9 -0
- package/dist/renderer/store/index.js +595 -0
- package/dist/renderer/store/remote-service/remote-service-store.d.ts +52 -0
- package/dist/renderer/store/theme/theme-store.d.ts +52 -0
- package/dist/renderer/store/updater/updater-store.d.ts +88 -0
- package/dist/renderer/store/window/window-store.d.ts +58 -0
- package/dist/renderer/styles/css/element-plus.less +280 -0
- package/dist/renderer/styles/css/iconfont-patch.less +6 -0
- package/dist/renderer/styles/css/reset.less +83 -0
- package/dist/renderer/styles/css/scrollbar.less +56 -0
- package/dist/renderer/styles/index.less +35 -0
- package/dist/renderer/styles/mixin.less +144 -0
- package/dist/renderer/styles/var/element-plus/dark.less +32 -0
- package/dist/renderer/styles/var/element-plus/root.less +88 -0
- package/dist/renderer/styles/var/global/dark.less +10 -0
- package/dist/renderer/styles/var/global/root.less +46 -0
- package/dist/renderer/styles/var/layout/dark.less +7 -0
- package/dist/renderer/styles/var/layout/root.less +9 -0
- package/dist/renderer/styles/var/scrollbar/dark.less +13 -0
- package/dist/renderer/styles/var/scrollbar/root.less +35 -0
- package/dist/renderer/utils/auth-route-util.d.ts +117 -0
- package/dist/renderer/utils/context-util.d.ts +13 -0
- package/dist/renderer/utils/error-util.d.ts +12 -0
- package/dist/renderer/utils/index.d.ts +14 -0
- package/dist/renderer/utils/index.js +1522 -0
- package/dist/renderer/utils/keyboard-util.d.ts +86 -0
- package/dist/renderer/utils/message-util.d.ts +161 -0
- package/dist/renderer/utils/renderer-log-util.d.ts +44 -0
- package/dist/renderer/utils/renderer-util.d.ts +37 -0
- package/dist/renderer/utils/router-util.d.ts +186 -0
- package/dist/renderer/utils/shortcut-util.d.ts +20 -0
- package/dist/renderer/utils/storage-util.d.ts +85 -0
- package/dist/renderer/utils/types/vue-router.d.ts +17 -0
- package/dist/shared/app/consts/app-launch-mode.d.ts +9 -0
- package/dist/shared/app/consts/update-mode.d.ts +8 -0
- package/dist/shared/app/consts/window-close-behavior.d.ts +8 -0
- package/dist/shared/app/consts/window-material.d.ts +8 -0
- package/dist/shared/app/consts/xion-name.d.ts +5 -0
- package/dist/shared/app/electron-app-config.d.ts +5 -0
- package/dist/shared/app/index.d.ts +16 -0
- package/dist/shared/app/index.js +30 -0
- package/dist/shared/app/types/app-info.d.ts +32 -0
- package/dist/shared/app/types/app-launch-mode.d.ts +13 -0
- package/dist/shared/app/types/app-paths.d.ts +27 -0
- package/dist/shared/app/types/general-settings.d.ts +27 -0
- package/dist/shared/app/types/on-window-close.d.ts +13 -0
- package/dist/shared/app/types/update-mode.d.ts +13 -0
- package/dist/shared/app/types/window-material.d.ts +2 -0
- package/dist/shared/auth/const/auth-status.d.ts +2 -0
- package/dist/shared/auth/index.d.ts +5 -0
- package/dist/shared/auth/index.js +5 -0
- package/dist/shared/auth/types/auth.d.ts +78 -0
- package/dist/shared/color/consts/color.d.ts +5 -0
- package/dist/shared/color/index.d.ts +5 -0
- package/dist/shared/color/index.js +6 -0
- package/dist/shared/color/types/color.d.ts +26 -0
- package/dist/shared/electron-builder/index.d.ts +4 -0
- package/dist/shared/electron-builder/index.js +0 -0
- package/dist/shared/electron-builder/types/electron-builder-options.d.ts +34 -0
- package/dist/shared/errors/index.d.ts +4 -0
- package/dist/shared/errors/index.js +10 -0
- package/dist/shared/errors/ipc-invoke-error.d.ts +32 -0
- package/dist/shared/ipc/channels/app-channels.d.ts +56 -0
- package/dist/shared/ipc/channels/auth-channels.d.ts +14 -0
- package/dist/shared/ipc/channels/clipboard-channels.d.ts +14 -0
- package/dist/shared/ipc/channels/context-menu-channels.d.ts +10 -0
- package/dist/shared/ipc/channels/dialog-channels.d.ts +12 -0
- package/dist/shared/ipc/channels/file-channels.d.ts +12 -0
- package/dist/shared/ipc/channels/log-channels.d.ts +14 -0
- package/dist/shared/ipc/channels/remote-service-channels.d.ts +20 -0
- package/dist/shared/ipc/channels/shell-channels.d.ts +10 -0
- package/dist/shared/ipc/channels/theme-channels.d.ts +12 -0
- package/dist/shared/ipc/channels/updater-channels.d.ts +26 -0
- package/dist/shared/ipc/channels/window-channels.d.ts +44 -0
- package/dist/shared/ipc/consts/ipc-channel.d.ts +1 -0
- package/dist/shared/ipc/index.d.ts +19 -0
- package/dist/shared/ipc/index.js +46 -0
- package/dist/shared/ipc/ipc-result.d.ts +20 -0
- package/dist/shared/ipc/types/ipc-logger.d.ts +27 -0
- package/dist/shared/ipc/types/ipc.d.ts +61 -0
- package/dist/shared/logger/consts/log-levels.d.ts +14 -0
- package/dist/shared/logger/index.d.ts +4 -0
- package/dist/shared/logger/index.js +10 -0
- package/dist/shared/menu/consts/menu-command.d.ts +1 -0
- package/dist/shared/menu/index.d.ts +6 -0
- package/dist/shared/menu/index.js +10 -0
- package/dist/shared/menu/menu-command.d.ts +24 -0
- package/dist/shared/menu/types/menu.d.ts +72 -0
- package/dist/shared/mode/consts/command.d.ts +10 -0
- package/dist/shared/mode/consts/mode.d.ts +22 -0
- package/dist/shared/mode/index.d.ts +5 -0
- package/dist/shared/mode/index.js +18 -0
- package/dist/shared/remote-service/const/remote-service.d.ts +8 -0
- package/dist/shared/remote-service/index.d.ts +5 -0
- package/dist/shared/remote-service/index.js +38 -0
- package/dist/shared/remote-service/types/remote-service.d.ts +146 -0
- package/dist/shared/renderer/index.d.ts +7 -0
- package/dist/shared/renderer/index.js +0 -0
- package/dist/shared/renderer/types/element-plus.d.ts +20 -0
- package/dist/shared/renderer/types/input.d.ts +11 -0
- package/dist/shared/renderer/types/options.d.ts +22 -0
- package/dist/shared/renderer/types/switch.d.ts +11 -0
- package/dist/shared/renderer-protocol/consts/renderer-protocol-keys.d.ts +10 -0
- package/dist/shared/renderer-protocol/index.d.ts +5 -0
- package/dist/shared/renderer-protocol/index.js +6 -0
- package/dist/shared/renderer-protocol/types/renderer-protocol.d.ts +7 -0
- package/dist/shared/runtime/index.d.ts +4 -0
- package/dist/shared/runtime/index.js +0 -0
- package/dist/shared/runtime/types/runtime.d.ts +20 -0
- package/dist/shared/shortcut/consts/shortcut-handler-ids.d.ts +9 -0
- package/dist/shared/shortcut/consts/shortcut-id.d.ts +1 -0
- package/dist/shared/shortcut/index.d.ts +6 -0
- package/dist/shared/shortcut/index.js +10 -0
- package/dist/shared/shortcut/types/shortcut.d.ts +13 -0
- package/dist/shared/utils/bytes-util.d.ts +16 -0
- package/dist/shared/utils/index.d.ts +15 -0
- package/dist/shared/utils/index.js +42 -0
- package/dist/shared/utils/ipc-util.d.ts +12 -0
- package/dist/shared/utils/log-util.d.ts +33 -0
- package/dist/shared/utils/menu-util.d.ts +12 -0
- package/dist/shared/utils/number-util.d.ts +12 -0
- package/dist/shared/utils/object-util.d.ts +88 -0
- package/dist/shared/utils/regexp-util.d.ts +22 -0
- package/dist/shared/utils/shortcut-util.d.ts +12 -0
- package/dist/shared/utils/string-util.d.ts +14 -0
- package/dist/shared/utils/time-util.d.ts +32 -0
- package/dist/shared/utils/validator-util.d.ts +12 -0
- package/dist/shared/utils/window-shared-util.d.ts +26 -0
- package/dist/shared/window/consts/window-record-id.d.ts +2 -0
- package/dist/shared/window/consts/window-type-name.d.ts +1 -0
- package/dist/shared/window/identity/main-window-identity.d.ts +5 -0
- package/dist/shared/window/identity/setting-window-identity.d.ts +5 -0
- package/dist/shared/window/index.d.ts +8 -0
- package/dist/shared/window/index.js +23 -0
- package/dist/shared/window/types/window.d.ts +84 -0
- package/dist/types/index.d.ts +102 -0
- package/dist/types/index.js +0 -0
- package/dist/vite/build/build-chunk.d.ts +53 -0
- package/dist/vite/build/build-csp-update.d.ts +80 -0
- package/dist/vite/build/build-obfuscation.d.ts +33 -0
- package/dist/vite/build/component-map.d.ts +38 -0
- package/dist/vite/build/component-resolver.d.ts +6 -0
- package/dist/vite/build/index.d.ts +9 -0
- package/dist/vite/build/index.js +18 -0
- package/dist/vite/build/types/build.d.ts +13 -0
- package/dist/vite/config/electron-app-config.d.ts +6 -0
- package/dist/vite/config/electron-builder-config.d.ts +8 -0
- package/dist/vite/config/electron-vite-config.d.ts +9 -0
- package/dist/vite/config/index.d.ts +11 -0
- package/dist/vite/config/index.js +2259 -0
- package/dist/vite/config/types/electron-app-options.d.ts +22 -0
- package/dist/vite/config/types/electron-builder-options.d.ts +16 -0
- package/dist/vite/config/types/electron-vite-options.d.ts +43 -0
- package/dist/vite/config/types/vite-obfuscation.d.ts +36 -0
- package/dist/vite/config/vite-obfuscation-config.d.ts +6 -0
- package/dist/vite/mode/index.d.ts +4 -0
- package/dist/vite/mode/index.js +8 -0
- package/dist/vite/mode/vite-mode.d.ts +37 -0
- package/dist/vite/orval/index.d.ts +4 -0
- package/dist/vite/orval/index.js +75 -0
- package/dist/vite/orval/orval-global-types.d.ts +23 -0
- package/dist/vite/utils/file-write-vite-util.d.ts +30 -0
- package/dist/vite/utils/index.d.ts +5 -0
- package/dist/vite/utils/index.js +10 -0
- package/dist/vite/utils/runtime-config-vite-util.d.ts +39 -0
- package/package.json +287 -0
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IpcResult
|
|
3
|
+
} from "./chunk-W2I3I7U7.js";
|
|
4
|
+
import {
|
|
5
|
+
XoPathUtil
|
|
6
|
+
} from "./chunk-BPTFUGTP.js";
|
|
7
|
+
import {
|
|
8
|
+
MainWindowIdentity
|
|
9
|
+
} from "./chunk-KFV4GXVE.js";
|
|
10
|
+
import {
|
|
11
|
+
AppChannels,
|
|
12
|
+
ClipboardChannels,
|
|
13
|
+
DialogChannels,
|
|
14
|
+
FileChannels,
|
|
15
|
+
LogChannels,
|
|
16
|
+
ShellChannels
|
|
17
|
+
} from "./chunk-RAVPJRBA.js";
|
|
18
|
+
import {
|
|
19
|
+
UpdaterChannels
|
|
20
|
+
} from "./chunk-LQ67F6EY.js";
|
|
21
|
+
import {
|
|
22
|
+
ContextMenuChannels,
|
|
23
|
+
WindowChannels
|
|
24
|
+
} from "./chunk-BFD2LHLK.js";
|
|
25
|
+
import {
|
|
26
|
+
SettingWindowIdentity
|
|
27
|
+
} from "./chunk-PVWRRUOK.js";
|
|
28
|
+
import {
|
|
29
|
+
LogUtil
|
|
30
|
+
} from "./chunk-BMOLIJ3W.js";
|
|
31
|
+
import {
|
|
32
|
+
RemoteServiceChannels
|
|
33
|
+
} from "./chunk-RN7AI33H.js";
|
|
34
|
+
import {
|
|
35
|
+
isLogLevel
|
|
36
|
+
} from "./chunk-WKVLVI6N.js";
|
|
37
|
+
import {
|
|
38
|
+
AppLaunchMode,
|
|
39
|
+
WindowCloseBehavior,
|
|
40
|
+
WindowMaterials
|
|
41
|
+
} from "./chunk-Y3OEXVQ2.js";
|
|
42
|
+
import {
|
|
43
|
+
ThemeChannels
|
|
44
|
+
} from "./chunk-UIJUY7QZ.js";
|
|
45
|
+
import {
|
|
46
|
+
AuthChannels
|
|
47
|
+
} from "./chunk-T3QCAOCO.js";
|
|
48
|
+
import {
|
|
49
|
+
ProtocolUtil
|
|
50
|
+
} from "./chunk-KFK47PDH.js";
|
|
51
|
+
import {
|
|
52
|
+
AppMode
|
|
53
|
+
} from "./chunk-GN2FNR3Z.js";
|
|
54
|
+
|
|
55
|
+
// src/main/ipc/ipc-handlers-abstract.ts
|
|
56
|
+
var IpcHandlersAbstract = class {
|
|
57
|
+
/**
|
|
58
|
+
* Xion 应用
|
|
59
|
+
* @type {XoAppAbstract}
|
|
60
|
+
* @protected
|
|
61
|
+
*/
|
|
62
|
+
xoApp;
|
|
63
|
+
/**
|
|
64
|
+
* 构造函数
|
|
65
|
+
* @param {XoAppAbstract} xoApp Xion 应用
|
|
66
|
+
*/
|
|
67
|
+
constructor(xoApp) {
|
|
68
|
+
this.xoApp = xoApp;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/main/ipc/handlers/app-handlers.ts
|
|
73
|
+
import { app } from "electron";
|
|
74
|
+
var AppHandlers = class extends IpcHandlersAbstract {
|
|
75
|
+
/**
|
|
76
|
+
* 处理器映射
|
|
77
|
+
* @returns {XoIpc.HandlerMap}
|
|
78
|
+
* @constructor
|
|
79
|
+
*/
|
|
80
|
+
handlerMap() {
|
|
81
|
+
return {
|
|
82
|
+
/** 获取应用信息 */
|
|
83
|
+
[AppChannels.getInfo]: async () => {
|
|
84
|
+
const protocols = ProtocolUtil.getRuntimeProtocols(this.xoApp.getAppConfig()?.eletronAppConfig?.protocols);
|
|
85
|
+
const info = {
|
|
86
|
+
appId: this.xoApp.getAppConfig()?.eletronAppConfig?.appId,
|
|
87
|
+
name: this.xoApp.getAppConfig()?.eletronAppConfig?.productName,
|
|
88
|
+
version: app.getVersion(),
|
|
89
|
+
mode: AppMode.getMode(),
|
|
90
|
+
platform: process.platform,
|
|
91
|
+
isPackaged: app.isPackaged,
|
|
92
|
+
protocol: protocols[0] ?? void 0,
|
|
93
|
+
protocols,
|
|
94
|
+
rendererProtocol: this.xoApp.getAppConfig()?.eletronAppConfig?.rendererProtocol,
|
|
95
|
+
locale: app.getLocale()
|
|
96
|
+
};
|
|
97
|
+
return IpcResult.success(info);
|
|
98
|
+
},
|
|
99
|
+
/** 获取应用目录 */
|
|
100
|
+
[AppChannels.getPaths]: async () => {
|
|
101
|
+
const paths = {
|
|
102
|
+
userData: XoPathUtil.userData(),
|
|
103
|
+
sessionData: XoPathUtil.sessionData(),
|
|
104
|
+
logs: XoPathUtil.logs(),
|
|
105
|
+
crashDumps: XoPathUtil.crashDumps(),
|
|
106
|
+
temp: XoPathUtil.temp(),
|
|
107
|
+
updaterCacheDir: XoPathUtil.updaterCacheDir()
|
|
108
|
+
};
|
|
109
|
+
return IpcResult.success(paths);
|
|
110
|
+
},
|
|
111
|
+
/** 获取通用设置 */
|
|
112
|
+
[AppChannels.getGeneralSettings]: async () => {
|
|
113
|
+
const store = this.xoApp.getAppStore();
|
|
114
|
+
const settings = {
|
|
115
|
+
opacity: store.getOpacity(),
|
|
116
|
+
windowMaterial: store.getWindowMaterial() ?? "none",
|
|
117
|
+
shortcuts: store.getShortcuts(),
|
|
118
|
+
logLevel: store.getLogLevel(),
|
|
119
|
+
launchOnStartup: store.getLaunchOnStartup(),
|
|
120
|
+
appLaunchMode: store.getAppLaunchMode(),
|
|
121
|
+
windowCloseBehavior: store.getWindowCloseBehavior()
|
|
122
|
+
};
|
|
123
|
+
return IpcResult.success(settings);
|
|
124
|
+
},
|
|
125
|
+
/** 获取 APP 透明度 */
|
|
126
|
+
[AppChannels.getOpacity]: async () => {
|
|
127
|
+
return IpcResult.success(this.xoApp.getAppStore().getOpacity());
|
|
128
|
+
},
|
|
129
|
+
/** 设置 APP 透明度 */
|
|
130
|
+
[AppChannels.setOpacity]: async (_event, opacity) => {
|
|
131
|
+
const nextOpacity = opacity === void 0 || !Number.isFinite(opacity) ? 1 : Math.max(0, Math.min(1, opacity / 100));
|
|
132
|
+
this.xoApp.getAppStore().setOpacity(nextOpacity);
|
|
133
|
+
this.xoApp.getWindowManager().setAllWindowOpacity(nextOpacity);
|
|
134
|
+
return IpcResult.success();
|
|
135
|
+
},
|
|
136
|
+
/** 获取快捷窗口材质 */
|
|
137
|
+
[AppChannels.getWindowMaterial]: async () => {
|
|
138
|
+
return IpcResult.success(this.xoApp.getAppStore().getWindowMaterial() ?? this.xoApp.getAppConfig()?.windowMaterial);
|
|
139
|
+
},
|
|
140
|
+
/** 设置快捷窗口材质 */
|
|
141
|
+
[AppChannels.setWindowMaterial]: async (_event, windowMaterial) => {
|
|
142
|
+
const nextWindowMaterial = windowMaterial && WindowMaterials.includes(windowMaterial) ? windowMaterial : void 0;
|
|
143
|
+
this.xoApp.getAppStore().setWindowMaterial(nextWindowMaterial);
|
|
144
|
+
this.xoApp.getWindowManager().setAllWindowMaterial(nextWindowMaterial);
|
|
145
|
+
return IpcResult.success();
|
|
146
|
+
},
|
|
147
|
+
/** 获取应用启动模式 */
|
|
148
|
+
[AppChannels.getAppLaunchMode]: async () => {
|
|
149
|
+
return IpcResult.success(this.xoApp.getAppStore().getAppLaunchMode());
|
|
150
|
+
},
|
|
151
|
+
/** 设置应用启动模式 */
|
|
152
|
+
[AppChannels.setAppLaunchMode]: async (_event, appLaunchMode) => {
|
|
153
|
+
const launchMode = appLaunchMode && AppLaunchMode.includes(appLaunchMode) ? appLaunchMode : "window";
|
|
154
|
+
this.xoApp.getAppStore().setAppLaunchMode(launchMode);
|
|
155
|
+
return IpcResult.success();
|
|
156
|
+
},
|
|
157
|
+
/** 获取是否开机启动 */
|
|
158
|
+
[AppChannels.getLaunchOnStartup]: async () => {
|
|
159
|
+
return IpcResult.success(this.xoApp.getAppStore().getLaunchOnStartup());
|
|
160
|
+
},
|
|
161
|
+
/** 设置是否开机启动 */
|
|
162
|
+
[AppChannels.setLaunchOnStartup]: async (_event, launchOnStartup) => {
|
|
163
|
+
const openAtLogin = launchOnStartup === true;
|
|
164
|
+
this.xoApp.getAppStore().setLaunchOnStartup(openAtLogin);
|
|
165
|
+
app.setLoginItemSettings({ openAtLogin });
|
|
166
|
+
return IpcResult.success();
|
|
167
|
+
},
|
|
168
|
+
/** 获取关闭窗口行为 */
|
|
169
|
+
[AppChannels.getWindowCloseBehavior]: async () => {
|
|
170
|
+
return IpcResult.success(this.xoApp.getAppStore().getWindowCloseBehavior());
|
|
171
|
+
},
|
|
172
|
+
/** 设置关闭窗口行为 */
|
|
173
|
+
[AppChannels.setWindowCloseBehavior]: async (_event, windowCloseBehavior) => {
|
|
174
|
+
const behavior = windowCloseBehavior && WindowCloseBehavior.includes(windowCloseBehavior) ? windowCloseBehavior : "minimize";
|
|
175
|
+
this.xoApp.getAppStore().setWindowCloseBehavior(behavior);
|
|
176
|
+
return IpcResult.success();
|
|
177
|
+
},
|
|
178
|
+
/** 获取日志等级 */
|
|
179
|
+
[AppChannels.getLogLevel]: async () => {
|
|
180
|
+
return IpcResult.success(this.xoApp.getLogLevel());
|
|
181
|
+
},
|
|
182
|
+
/** 设置日志等级 */
|
|
183
|
+
[AppChannels.setLogLevel]: async (_event, logLevel) => {
|
|
184
|
+
if (isLogLevel(logLevel)) {
|
|
185
|
+
this.xoApp.setLogLevel(logLevel);
|
|
186
|
+
}
|
|
187
|
+
return IpcResult.success();
|
|
188
|
+
},
|
|
189
|
+
/** 获取快捷键配置 */
|
|
190
|
+
[AppChannels.getShortcuts]: async () => {
|
|
191
|
+
return IpcResult.success(this.xoApp.getShortcutManager().getStoreShortcuts());
|
|
192
|
+
},
|
|
193
|
+
/** 设置快捷键配置 */
|
|
194
|
+
[AppChannels.setShortcuts]: async (_event, shortcuts = {}) => {
|
|
195
|
+
this.xoApp.getShortcutManager().setShortcuts(shortcuts);
|
|
196
|
+
return IpcResult.success();
|
|
197
|
+
},
|
|
198
|
+
/** 设置单个快捷键配置 */
|
|
199
|
+
[AppChannels.setShortcut]: async (_event, shortcut) => {
|
|
200
|
+
this.xoApp.getShortcutManager().setShortcut(shortcut);
|
|
201
|
+
return IpcResult.success();
|
|
202
|
+
},
|
|
203
|
+
/** 删除快捷键配置 */
|
|
204
|
+
[AppChannels.deleteShortcut]: async (_event, id) => {
|
|
205
|
+
this.xoApp.getShortcutManager().deleteShortcut(id);
|
|
206
|
+
return IpcResult.success();
|
|
207
|
+
},
|
|
208
|
+
/** 重定向指定窗口路由 */
|
|
209
|
+
[AppChannels.redirectWindowRoute]: async (_event, request) => {
|
|
210
|
+
return IpcResult.success(await this.xoApp.getWindowManager().redirectRoute(request));
|
|
211
|
+
},
|
|
212
|
+
/** 重定向主窗口路由 */
|
|
213
|
+
[AppChannels.redirectMainWindowRoute]: async (_event, request) => {
|
|
214
|
+
return IpcResult.success(await this.xoApp.getWindowManager().redirectRoute({
|
|
215
|
+
...request,
|
|
216
|
+
windowIdentity: MainWindowIdentity
|
|
217
|
+
}));
|
|
218
|
+
},
|
|
219
|
+
/** 重定向设置窗口路由 */
|
|
220
|
+
[AppChannels.redirectSettingWindowRoute]: async (_event, request) => {
|
|
221
|
+
return IpcResult.success(await this.xoApp.getWindowManager().redirectRoute({
|
|
222
|
+
...request,
|
|
223
|
+
windowIdentity: SettingWindowIdentity
|
|
224
|
+
}));
|
|
225
|
+
},
|
|
226
|
+
/** 显示主窗口 */
|
|
227
|
+
[AppChannels.showMainWindow]: async (_event, request) => {
|
|
228
|
+
await this.xoApp.showMainWindow();
|
|
229
|
+
if (request?.route || request?.routeName) {
|
|
230
|
+
await this.xoApp.getWindowManager().redirectRoute({
|
|
231
|
+
...request,
|
|
232
|
+
windowIdentity: MainWindowIdentity
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return IpcResult.success(true);
|
|
236
|
+
},
|
|
237
|
+
/** 显示设置窗口 */
|
|
238
|
+
[AppChannels.showSettingWindow]: async (_event, request) => {
|
|
239
|
+
await this.xoApp.showSettingWindow();
|
|
240
|
+
if (request?.route || request?.routeName) {
|
|
241
|
+
await this.xoApp.getWindowManager().redirectRoute({
|
|
242
|
+
...request,
|
|
243
|
+
windowIdentity: SettingWindowIdentity
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return IpcResult.success(true);
|
|
247
|
+
},
|
|
248
|
+
/** 重启应用 */
|
|
249
|
+
[AppChannels.restart]: async () => {
|
|
250
|
+
setImmediate(() => this.xoApp.restart());
|
|
251
|
+
return IpcResult.success();
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// src/main/ipc/handlers/auth-handlers.ts
|
|
258
|
+
var AuthHandlers = class extends IpcHandlersAbstract {
|
|
259
|
+
/**
|
|
260
|
+
* 处理器映射
|
|
261
|
+
* @returns {XoIpc.HandlerMap}
|
|
262
|
+
*/
|
|
263
|
+
handlerMap() {
|
|
264
|
+
return {
|
|
265
|
+
/** 获取认证状态 */
|
|
266
|
+
[AuthChannels.getState]: async () => {
|
|
267
|
+
return IpcResult.success(this.xoApp.getAuthManager().getState());
|
|
268
|
+
},
|
|
269
|
+
/** 登录 */
|
|
270
|
+
[AuthChannels.login]: async (_event, request) => {
|
|
271
|
+
return IpcResult.success(await this.xoApp.getAuthManager().login(request));
|
|
272
|
+
},
|
|
273
|
+
/** 退出登录 */
|
|
274
|
+
[AuthChannels.logout]: async () => {
|
|
275
|
+
return IpcResult.success(await this.xoApp.getAuthManager().logout());
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// src/main/ipc/handlers/clipboard-handlers.ts
|
|
282
|
+
import { clipboard, nativeImage } from "electron";
|
|
283
|
+
var ClipboardHandlers = class extends IpcHandlersAbstract {
|
|
284
|
+
/**
|
|
285
|
+
* 处理器映射
|
|
286
|
+
* @returns {XoIpc.HandlerMap}
|
|
287
|
+
* @constructor
|
|
288
|
+
*/
|
|
289
|
+
handlerMap() {
|
|
290
|
+
return {
|
|
291
|
+
/** 读取文本 */
|
|
292
|
+
[ClipboardChannels.readText]: async () => {
|
|
293
|
+
return IpcResult.success(clipboard.readText());
|
|
294
|
+
},
|
|
295
|
+
/** 写入文本 */
|
|
296
|
+
[ClipboardChannels.writeText]: async (_event, text) => {
|
|
297
|
+
clipboard.writeText(text);
|
|
298
|
+
return IpcResult.success();
|
|
299
|
+
},
|
|
300
|
+
/** 写入图片 */
|
|
301
|
+
[ClipboardChannels.writeImage]: async (_event, dataURL) => {
|
|
302
|
+
clipboard.writeImage(nativeImage.createFromDataURL(dataURL));
|
|
303
|
+
return IpcResult.success();
|
|
304
|
+
},
|
|
305
|
+
/** 清空剪切板 */
|
|
306
|
+
[ClipboardChannels.clear]: async () => {
|
|
307
|
+
clipboard.clear();
|
|
308
|
+
return IpcResult.success();
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/main/ipc/handlers/contex-menu-handlers.ts
|
|
315
|
+
var ContexMenuHandlers = class extends IpcHandlersAbstract {
|
|
316
|
+
/**
|
|
317
|
+
* 处理器映射
|
|
318
|
+
* @returns {XoIpc.HandlerMap}
|
|
319
|
+
* @constructor
|
|
320
|
+
*/
|
|
321
|
+
handlerMap() {
|
|
322
|
+
return {
|
|
323
|
+
/** 执行菜单命令 */
|
|
324
|
+
[ContextMenuChannels.executeCommand]: async (_event, request) => {
|
|
325
|
+
const success = await this.xoApp.getMenuManager().executeCommand(request);
|
|
326
|
+
return IpcResult.success(success);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// src/main/ipc/handlers/dialog-handlers.ts
|
|
333
|
+
import { BrowserWindow, dialog } from "electron";
|
|
334
|
+
var DialogHandlers = class extends IpcHandlersAbstract {
|
|
335
|
+
/**
|
|
336
|
+
* 处理器映射
|
|
337
|
+
* @returns {XoIpc.HandlerMap}
|
|
338
|
+
* @constructor
|
|
339
|
+
*/
|
|
340
|
+
handlerMap() {
|
|
341
|
+
return {
|
|
342
|
+
/** 打开文件 */
|
|
343
|
+
[DialogChannels.openFile]: async (event) => {
|
|
344
|
+
const window = BrowserWindow.fromWebContents(event.sender);
|
|
345
|
+
const options = {
|
|
346
|
+
properties: ["openFile"]
|
|
347
|
+
};
|
|
348
|
+
const result = window ? await dialog.showOpenDialog(window, options) : await dialog.showOpenDialog(options);
|
|
349
|
+
return IpcResult.success({
|
|
350
|
+
canceled: result.canceled,
|
|
351
|
+
filePaths: result.filePaths
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
/** 打开目录 */
|
|
355
|
+
[DialogChannels.openDir]: async (event) => {
|
|
356
|
+
const window = BrowserWindow.fromWebContents(event.sender);
|
|
357
|
+
const options = {
|
|
358
|
+
properties: ["openDirectory"]
|
|
359
|
+
};
|
|
360
|
+
const result = window ? await dialog.showOpenDialog(window, options) : await dialog.showOpenDialog(options);
|
|
361
|
+
return IpcResult.success({
|
|
362
|
+
canceled: result.canceled,
|
|
363
|
+
filePaths: result.filePaths
|
|
364
|
+
});
|
|
365
|
+
},
|
|
366
|
+
/** 保存文件 */
|
|
367
|
+
[DialogChannels.saveFile]: async (event) => {
|
|
368
|
+
const window = BrowserWindow.fromWebContents(event.sender);
|
|
369
|
+
const options = {};
|
|
370
|
+
const result = window ? await dialog.showSaveDialog(window, options) : await dialog.showSaveDialog(options);
|
|
371
|
+
return IpcResult.success({
|
|
372
|
+
canceled: result.canceled,
|
|
373
|
+
filePath: result.filePath ?? null
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// src/main/ipc/handlers/file-handlers.ts
|
|
381
|
+
import fs from "node:fs/promises";
|
|
382
|
+
var FileHandlers = class extends IpcHandlersAbstract {
|
|
383
|
+
/**
|
|
384
|
+
* 处理器映射
|
|
385
|
+
* @returns {XoIpc.HandlerMap}
|
|
386
|
+
* @constructor
|
|
387
|
+
*/
|
|
388
|
+
handlerMap() {
|
|
389
|
+
return {
|
|
390
|
+
/** 读取文本 */
|
|
391
|
+
[FileChannels.readText]: async (_event, path) => {
|
|
392
|
+
let text = await fs.readFile(path, "utf8");
|
|
393
|
+
return IpcResult.success(text);
|
|
394
|
+
},
|
|
395
|
+
/** 写入文本 */
|
|
396
|
+
[FileChannels.writeText]: async (_event, request) => {
|
|
397
|
+
await fs.writeFile(request.path, request.content, "utf8");
|
|
398
|
+
return IpcResult.success(true);
|
|
399
|
+
},
|
|
400
|
+
/** 文件是否存在 */
|
|
401
|
+
[FileChannels.exists]: async (_event, path) => {
|
|
402
|
+
try {
|
|
403
|
+
await fs.access(path);
|
|
404
|
+
return IpcResult.success(true);
|
|
405
|
+
} catch (error) {
|
|
406
|
+
const code = error instanceof Error ? error.code : void 0;
|
|
407
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
408
|
+
return IpcResult.success(false);
|
|
409
|
+
}
|
|
410
|
+
throw error;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
// src/main/ipc/handlers/log-handlers.ts
|
|
418
|
+
import { BrowserWindow as BrowserWindow2 } from "electron";
|
|
419
|
+
var MaxLogsPerSecond = 20;
|
|
420
|
+
var MaxRequestBytes = 64 * 1024;
|
|
421
|
+
var LogHandlers = class extends IpcHandlersAbstract {
|
|
422
|
+
/** 每个渲染进程的日志限流记录 */
|
|
423
|
+
rateLimits = /* @__PURE__ */ new Map();
|
|
424
|
+
/**
|
|
425
|
+
* 处理器映射
|
|
426
|
+
* @returns {XoIpc.HandlerMap}
|
|
427
|
+
* @constructor
|
|
428
|
+
*/
|
|
429
|
+
handlerMap() {
|
|
430
|
+
return {
|
|
431
|
+
[LogChannels.debug]: async (event, request) => this.write(event, "debug", request),
|
|
432
|
+
[LogChannels.info]: async (event, request) => this.write(event, "info", request),
|
|
433
|
+
[LogChannels.warn]: async (event, request) => this.write(event, "warn", request),
|
|
434
|
+
[LogChannels.error]: async (event, request) => this.write(event, "error", request)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* 写入渲染进程日志
|
|
439
|
+
* @param {Electron.IpcMainInvokeEvent} event IPC 事件
|
|
440
|
+
* @param {XoIpcLogger.Level} level 日志等级
|
|
441
|
+
* @param {XoIpcLogger.Request} request 日志请求
|
|
442
|
+
* @returns {Promise<XoIpc.Result>}
|
|
443
|
+
* @private
|
|
444
|
+
*/
|
|
445
|
+
async write(event, level, request) {
|
|
446
|
+
if (!this.isAllowedSender(event)) {
|
|
447
|
+
return IpcResult.fail("\u4E0D\u5141\u8BB8\u7684\u65E5\u5FD7\u8C03\u7528\u6765\u6E90");
|
|
448
|
+
}
|
|
449
|
+
if (!this.consumeRateLimit(event.sender.id)) {
|
|
450
|
+
return IpcResult.fail("\u6E32\u67D3\u8FDB\u7A0B\u65E5\u5FD7\u5199\u5165\u8FC7\u4E8E\u9891\u7E41");
|
|
451
|
+
}
|
|
452
|
+
if (!request || typeof request.message !== "string" || !Array.isArray(request.data) || !this.isAllowedRequestSize(request)) {
|
|
453
|
+
return IpcResult.fail("\u6E32\u67D3\u8FDB\u7A0B\u65E5\u5FD7\u53C2\u6570\u65E0\u6548");
|
|
454
|
+
}
|
|
455
|
+
const normalized = LogUtil.normalizeRequest(request.message, request.data);
|
|
456
|
+
switch (level) {
|
|
457
|
+
case "debug":
|
|
458
|
+
this.xoApp.rendererLog.debug(normalized.message, ...normalized.data);
|
|
459
|
+
break;
|
|
460
|
+
case "info":
|
|
461
|
+
this.xoApp.rendererLog.info(normalized.message, ...normalized.data);
|
|
462
|
+
break;
|
|
463
|
+
case "warn":
|
|
464
|
+
this.xoApp.rendererLog.warn(normalized.message, ...normalized.data);
|
|
465
|
+
break;
|
|
466
|
+
case "error":
|
|
467
|
+
this.xoApp.rendererLog.error(normalized.message, ...normalized.data);
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
return IpcResult.success();
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* 验证 IPC 来源为受管理窗口的主 frame
|
|
474
|
+
* @param {Electron.IpcMainInvokeEvent} event IPC 事件
|
|
475
|
+
* @returns {boolean}
|
|
476
|
+
* @private
|
|
477
|
+
*/
|
|
478
|
+
isAllowedSender(event) {
|
|
479
|
+
const window = BrowserWindow2.fromWebContents(event.sender);
|
|
480
|
+
return Boolean(window && !window.isDestroyed() && event.senderFrame === event.sender.mainFrame);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* 检查日志请求序列化大小
|
|
484
|
+
* @param {XoIpcLogger.Request} request 日志请求
|
|
485
|
+
* @returns {boolean}
|
|
486
|
+
* @private
|
|
487
|
+
*/
|
|
488
|
+
isAllowedRequestSize(request) {
|
|
489
|
+
try {
|
|
490
|
+
return Buffer.byteLength(JSON.stringify(request), "utf8") <= MaxRequestBytes;
|
|
491
|
+
} catch {
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* 消耗一次日志限流额度
|
|
497
|
+
* @param {number} senderId WebContents ID
|
|
498
|
+
* @returns {boolean}
|
|
499
|
+
* @private
|
|
500
|
+
*/
|
|
501
|
+
consumeRateLimit(senderId) {
|
|
502
|
+
const now = Date.now();
|
|
503
|
+
const current = this.rateLimits.get(senderId);
|
|
504
|
+
if (!current || now - current.startedAt >= 1e3) {
|
|
505
|
+
this.rateLimits.set(senderId, { startedAt: now, count: 1 });
|
|
506
|
+
return true;
|
|
507
|
+
}
|
|
508
|
+
if (current.count >= MaxLogsPerSecond) {
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
current.count++;
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
// src/main/ipc/handlers/remote-service-handlers.ts
|
|
517
|
+
var RemoteServiceHandlers = class extends IpcHandlersAbstract {
|
|
518
|
+
/**
|
|
519
|
+
* 处理器映射
|
|
520
|
+
* @returns {XoIpc.HandlerMap}
|
|
521
|
+
* @constructor
|
|
522
|
+
*/
|
|
523
|
+
handlerMap() {
|
|
524
|
+
return {
|
|
525
|
+
/** 获取远程服务状态 */
|
|
526
|
+
[RemoteServiceChannels.getState]: async () => {
|
|
527
|
+
return IpcResult.success(this.xoApp.getRemoteServiceManager().getState());
|
|
528
|
+
},
|
|
529
|
+
/** 获取远程服务设置 */
|
|
530
|
+
[RemoteServiceChannels.getSettings]: async () => {
|
|
531
|
+
return IpcResult.success(this.xoApp.getRemoteServiceManager().getEffectiveSettings());
|
|
532
|
+
},
|
|
533
|
+
/** 设置远程服务用户设置 */
|
|
534
|
+
[RemoteServiceChannels.setSettings]: async (_event, settings) => {
|
|
535
|
+
this.xoApp.getRemoteServiceManager().setSettings(settings);
|
|
536
|
+
return IpcResult.success();
|
|
537
|
+
},
|
|
538
|
+
/** 重置远程服务用户设置 */
|
|
539
|
+
[RemoteServiceChannels.resetSettings]: async () => {
|
|
540
|
+
this.xoApp.getRemoteServiceManager().resetSettings();
|
|
541
|
+
return IpcResult.success();
|
|
542
|
+
},
|
|
543
|
+
/** 请求远程服务 API */
|
|
544
|
+
[RemoteServiceChannels.request]: async (event, request) => {
|
|
545
|
+
const response = await this.xoApp.getRemoteServiceManager().request(request, event.sender.session);
|
|
546
|
+
return IpcResult.success(response);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
// src/main/ipc/handlers/shell-handlers.ts
|
|
553
|
+
import { shell } from "electron";
|
|
554
|
+
import { access } from "node:fs/promises";
|
|
555
|
+
var ShellHandlers = class extends IpcHandlersAbstract {
|
|
556
|
+
/**
|
|
557
|
+
* 处理器映射
|
|
558
|
+
* @returns {XoIpc.HandlerMap}
|
|
559
|
+
* @constructor
|
|
560
|
+
*/
|
|
561
|
+
handlerMap() {
|
|
562
|
+
return {
|
|
563
|
+
/** 使用系统默认程序打开路径 */
|
|
564
|
+
[ShellChannels.openPath]: async (_event, path) => {
|
|
565
|
+
try {
|
|
566
|
+
await access(path);
|
|
567
|
+
} catch {
|
|
568
|
+
throw new Error(`\u8DEF\u5F84\u4E0D\u5B58\u5728\u6216\u65E0\u6CD5\u8BBF\u95EE`);
|
|
569
|
+
}
|
|
570
|
+
const error = await shell.openPath(path);
|
|
571
|
+
if (error) {
|
|
572
|
+
throw new Error(error);
|
|
573
|
+
}
|
|
574
|
+
return IpcResult.success();
|
|
575
|
+
},
|
|
576
|
+
/** 在文件管理器中显示路径 */
|
|
577
|
+
[ShellChannels.showItemInFolder]: async (_event, path) => {
|
|
578
|
+
shell.showItemInFolder(path);
|
|
579
|
+
return IpcResult.success();
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
// src/main/ipc/handlers/theme-handlers.ts
|
|
586
|
+
import { BrowserWindow as BrowserWindow3 } from "electron";
|
|
587
|
+
var ThemeHandlers = class extends IpcHandlersAbstract {
|
|
588
|
+
/**
|
|
589
|
+
* 处理器映射
|
|
590
|
+
* @returns {XoIpc.HandlerMap}
|
|
591
|
+
* @constructor
|
|
592
|
+
*/
|
|
593
|
+
handlerMap() {
|
|
594
|
+
return {
|
|
595
|
+
/** 获取主题状态 */
|
|
596
|
+
[ThemeChannels.getState]: async (event) => {
|
|
597
|
+
const window = BrowserWindow3.fromWebContents(event.sender) ?? void 0;
|
|
598
|
+
const state = this.xoApp.getThemeManager().getState(window);
|
|
599
|
+
return IpcResult.success(state);
|
|
600
|
+
},
|
|
601
|
+
/** 设置主题来源 */
|
|
602
|
+
[ThemeChannels.setSource]: async (_event, source) => {
|
|
603
|
+
this.xoApp.getThemeManager().setSource(source ?? "system");
|
|
604
|
+
return IpcResult.success();
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
// src/main/ipc/handlers/updater-handlers.ts
|
|
611
|
+
var UpdaterHandlers = class extends IpcHandlersAbstract {
|
|
612
|
+
/**
|
|
613
|
+
* 处理器映射
|
|
614
|
+
* @returns {XoIpc.HandlerMap}
|
|
615
|
+
* @constructor
|
|
616
|
+
*/
|
|
617
|
+
handlerMap() {
|
|
618
|
+
return {
|
|
619
|
+
/** 检查更新 */
|
|
620
|
+
[UpdaterChannels.checkForUpdates]: async () => {
|
|
621
|
+
await this.xoApp.getUpdaterManager().checkForUpdates();
|
|
622
|
+
return IpcResult.success();
|
|
623
|
+
},
|
|
624
|
+
/** 下载更新 */
|
|
625
|
+
[UpdaterChannels.downloadUpdate]: async () => {
|
|
626
|
+
await this.xoApp.getUpdaterManager().downloadUpdate();
|
|
627
|
+
return IpcResult.success();
|
|
628
|
+
},
|
|
629
|
+
/** 取消下载 */
|
|
630
|
+
[UpdaterChannels.cancelDownload]: async () => {
|
|
631
|
+
return IpcResult.success(this.xoApp.getUpdaterManager().cancelDownload());
|
|
632
|
+
},
|
|
633
|
+
/** 退出并安装更新 */
|
|
634
|
+
[UpdaterChannels.quitAndInstall]: async () => {
|
|
635
|
+
this.xoApp.getUpdaterManager().quitAndInstall();
|
|
636
|
+
return IpcResult.success();
|
|
637
|
+
},
|
|
638
|
+
/** 获取更新器状态 */
|
|
639
|
+
[UpdaterChannels.getState]: async () => {
|
|
640
|
+
return IpcResult.success(this.xoApp.getUpdaterManager().getState());
|
|
641
|
+
},
|
|
642
|
+
/** 获取更新器设置 */
|
|
643
|
+
[UpdaterChannels.getSettings]: async () => {
|
|
644
|
+
return IpcResult.success(this.xoApp.getUpdaterManager().getSettings());
|
|
645
|
+
},
|
|
646
|
+
/** 设置更新器用户设置 */
|
|
647
|
+
[UpdaterChannels.setSettings]: async (_event, settings) => {
|
|
648
|
+
this.xoApp.getUpdaterManager().setSettings(settings);
|
|
649
|
+
return IpcResult.success();
|
|
650
|
+
},
|
|
651
|
+
/** 重置更新器用户设置 */
|
|
652
|
+
[UpdaterChannels.resetSettings]: async () => {
|
|
653
|
+
this.xoApp.getUpdaterManager().resetSettings();
|
|
654
|
+
return IpcResult.success();
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
// src/main/ipc/handlers/window-handlers.ts
|
|
661
|
+
import { BrowserWindow as BrowserWindow4 } from "electron";
|
|
662
|
+
var WindowHandlers = class extends IpcHandlersAbstract {
|
|
663
|
+
/**
|
|
664
|
+
* 处理器映射
|
|
665
|
+
* @returns {XoIpc.HandlerMap}
|
|
666
|
+
* @constructor
|
|
667
|
+
*/
|
|
668
|
+
handlerMap() {
|
|
669
|
+
return {
|
|
670
|
+
/** 渲染进程首屏渲染完成 */
|
|
671
|
+
[WindowChannels.ready]: async (event) => {
|
|
672
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
673
|
+
if (window) {
|
|
674
|
+
this.xoApp.getWindowManager().rendererReady(window);
|
|
675
|
+
}
|
|
676
|
+
return IpcResult.success();
|
|
677
|
+
},
|
|
678
|
+
/** 是否等待 Renderer 渲染完成后再显示窗口 */
|
|
679
|
+
[WindowChannels.shouldShowAfterRendererReady]: async (event) => {
|
|
680
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
681
|
+
return IpcResult.success(this.xoApp.getWindowManager().shouldShowAfterRendererReady(window ?? void 0));
|
|
682
|
+
},
|
|
683
|
+
/** 获取窗口状态 */
|
|
684
|
+
[WindowChannels.getState]: async (event) => {
|
|
685
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
686
|
+
return IpcResult.success(this.xoApp.getWindowManager().getWindowState(window));
|
|
687
|
+
},
|
|
688
|
+
/** 获取当前已打开窗口标识 */
|
|
689
|
+
[WindowChannels.getOpenedWindowIdentities]: async () => {
|
|
690
|
+
return IpcResult.success(this.xoApp.getWindowManager().getOpenedWindowIdentities());
|
|
691
|
+
},
|
|
692
|
+
/** 最小化窗口 */
|
|
693
|
+
[WindowChannels.minimize]: async (event) => {
|
|
694
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
695
|
+
window?.minimize();
|
|
696
|
+
return IpcResult.success();
|
|
697
|
+
},
|
|
698
|
+
/** 最大化窗口 */
|
|
699
|
+
[WindowChannels.maximize]: async (event) => {
|
|
700
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
701
|
+
window?.maximize();
|
|
702
|
+
return IpcResult.success();
|
|
703
|
+
},
|
|
704
|
+
/** 是否已最大化 */
|
|
705
|
+
[WindowChannels.isMaximized]: async (event) => {
|
|
706
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
707
|
+
return IpcResult.success(window?.isMaximized() ?? false);
|
|
708
|
+
},
|
|
709
|
+
/** 取消最大化窗口 */
|
|
710
|
+
[WindowChannels.unmaximize]: async (event) => {
|
|
711
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
712
|
+
window?.unmaximize();
|
|
713
|
+
return IpcResult.success();
|
|
714
|
+
},
|
|
715
|
+
/** 全屏窗口 */
|
|
716
|
+
[WindowChannels.fullScreen]: async (event) => {
|
|
717
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
718
|
+
window?.setFullScreen(true);
|
|
719
|
+
return IpcResult.success();
|
|
720
|
+
},
|
|
721
|
+
/** 退出全屏窗口 */
|
|
722
|
+
[WindowChannels.exitFullScreen]: async (event) => {
|
|
723
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
724
|
+
window?.setFullScreen(false);
|
|
725
|
+
return IpcResult.success();
|
|
726
|
+
},
|
|
727
|
+
/** 重新加载窗口 */
|
|
728
|
+
[WindowChannels.reload]: async (event) => {
|
|
729
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
730
|
+
window?.reload();
|
|
731
|
+
return IpcResult.success();
|
|
732
|
+
},
|
|
733
|
+
/** 居中窗口 */
|
|
734
|
+
[WindowChannels.center]: async (event) => {
|
|
735
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
736
|
+
window?.center();
|
|
737
|
+
return IpcResult.success();
|
|
738
|
+
},
|
|
739
|
+
/** 隐藏窗口 */
|
|
740
|
+
[WindowChannels.hide]: async (event) => {
|
|
741
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
742
|
+
window && this.xoApp.getWindowManager().hideByWindow(window);
|
|
743
|
+
return IpcResult.success();
|
|
744
|
+
},
|
|
745
|
+
/** 还原窗口 */
|
|
746
|
+
[WindowChannels.restore]: async (event) => {
|
|
747
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
748
|
+
window?.restore();
|
|
749
|
+
return IpcResult.success();
|
|
750
|
+
},
|
|
751
|
+
/** 切换窗口置顶 */
|
|
752
|
+
[WindowChannels.toggleAlwaysOnTop]: async (event) => {
|
|
753
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
754
|
+
window && this.xoApp.getWindowManager().toggleAlwaysOnTopByWindow(window);
|
|
755
|
+
return IpcResult.success();
|
|
756
|
+
},
|
|
757
|
+
/** 切换侧边栏折叠 */
|
|
758
|
+
[WindowChannels.toggleSidebarFold]: async (event) => {
|
|
759
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
760
|
+
window && this.xoApp.getWindowManager().toggleSidebarFoldByWindow(window);
|
|
761
|
+
return IpcResult.success(true);
|
|
762
|
+
},
|
|
763
|
+
/** 关闭窗口 */
|
|
764
|
+
[WindowChannels.close]: async (event) => {
|
|
765
|
+
const window = BrowserWindow4.fromWebContents(event.sender);
|
|
766
|
+
window && this.xoApp.getWindowManager().closeByWindow(window);
|
|
767
|
+
return IpcResult.success();
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
// src/main/ipc/utils/ipc-handler-util.ts
|
|
774
|
+
var IpcHandlerUtil = class _IpcHandlerUtil {
|
|
775
|
+
/**
|
|
776
|
+
* 包装IPC处理器
|
|
777
|
+
* @param {XoIpc.Handler} handler 原始处理器
|
|
778
|
+
* @returns {XoIpc.Handler}
|
|
779
|
+
*/
|
|
780
|
+
static wrap(handler) {
|
|
781
|
+
return async (event, request) => {
|
|
782
|
+
try {
|
|
783
|
+
const result = await handler(event, request);
|
|
784
|
+
return _IpcHandlerUtil.isResult(result) ? result : IpcResult.success(result);
|
|
785
|
+
} catch (error) {
|
|
786
|
+
return IpcResult.fail(_IpcHandlerUtil.toMessage(error));
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* 判断是否为IPC结果
|
|
792
|
+
* @param {unknown} value 值
|
|
793
|
+
* @returns {value is XoIpc.Result}
|
|
794
|
+
*/
|
|
795
|
+
static isResult(value) {
|
|
796
|
+
if (!value || typeof value !== "object") {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
const result = value;
|
|
800
|
+
return typeof result.success === "boolean" && typeof result.code === "number" && typeof result.message === "string";
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* 转换错误消息
|
|
804
|
+
* @param {unknown} error 错误
|
|
805
|
+
* @returns {string}
|
|
806
|
+
*/
|
|
807
|
+
static toMessage(error) {
|
|
808
|
+
if (error instanceof Error) {
|
|
809
|
+
return error.message || error.name;
|
|
810
|
+
}
|
|
811
|
+
return String(error);
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
// src/main/ipc/ipc-manager-abstract.ts
|
|
816
|
+
import { ipcMain } from "electron";
|
|
817
|
+
var IpcManagerAbstract = class {
|
|
818
|
+
/**
|
|
819
|
+
* 是否已注册
|
|
820
|
+
* @type {boolean}
|
|
821
|
+
* @private
|
|
822
|
+
*/
|
|
823
|
+
registered = false;
|
|
824
|
+
/**
|
|
825
|
+
* 已注册处理器类
|
|
826
|
+
* @type {Set<XoIpc.HandlersConstructor>}
|
|
827
|
+
* @private
|
|
828
|
+
*/
|
|
829
|
+
registeredHandlerClasses = /* @__PURE__ */ new Set();
|
|
830
|
+
/**
|
|
831
|
+
* 已注册通道
|
|
832
|
+
* @type {Set<XoIpc.Channel>}
|
|
833
|
+
* @private
|
|
834
|
+
*/
|
|
835
|
+
registeredChannels = /* @__PURE__ */ new Set();
|
|
836
|
+
/**
|
|
837
|
+
* Xion 应用
|
|
838
|
+
* @type {XoAppAbstract}
|
|
839
|
+
* @protected
|
|
840
|
+
*/
|
|
841
|
+
xoApp;
|
|
842
|
+
/**
|
|
843
|
+
* 构造函数
|
|
844
|
+
* @param {XoAppAbstract} xoApp Xion 应用
|
|
845
|
+
*/
|
|
846
|
+
constructor(xoApp) {
|
|
847
|
+
this.xoApp = xoApp;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* 注册所有处理器
|
|
851
|
+
*/
|
|
852
|
+
register() {
|
|
853
|
+
if (this.registered) {
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
this.registered = true;
|
|
857
|
+
const handlerClasses = [
|
|
858
|
+
// 内置应用处理器
|
|
859
|
+
AppHandlers,
|
|
860
|
+
// 内置 JWT 认证处理器
|
|
861
|
+
AuthHandlers,
|
|
862
|
+
// 内置对话框处理器
|
|
863
|
+
DialogHandlers,
|
|
864
|
+
// 内置剪切板处理器
|
|
865
|
+
ClipboardHandlers,
|
|
866
|
+
// 内置文件处理器
|
|
867
|
+
FileHandlers,
|
|
868
|
+
// 内置渲染进程日志处理器
|
|
869
|
+
LogHandlers,
|
|
870
|
+
// 内置主题处理器
|
|
871
|
+
ThemeHandlers,
|
|
872
|
+
// 内置更新器处理器
|
|
873
|
+
UpdaterHandlers,
|
|
874
|
+
// 内置远程服务处理器
|
|
875
|
+
RemoteServiceHandlers,
|
|
876
|
+
// 内置菜单处理器
|
|
877
|
+
ContexMenuHandlers,
|
|
878
|
+
// 内置 Shell 处理器
|
|
879
|
+
ShellHandlers,
|
|
880
|
+
// 内置窗口处理器
|
|
881
|
+
WindowHandlers,
|
|
882
|
+
// 自定义处理器
|
|
883
|
+
...this.handlers()
|
|
884
|
+
];
|
|
885
|
+
for (const HandlerClass of handlerClasses) {
|
|
886
|
+
if (this.registeredHandlerClasses.has(HandlerClass)) {
|
|
887
|
+
throw new Error(`IPC \u5904\u7406\u5668\u91CD\u590D\u6CE8\u518C: ${HandlerClass.name}`);
|
|
888
|
+
}
|
|
889
|
+
this.registeredHandlerClasses.add(HandlerClass);
|
|
890
|
+
const handlerMap = new HandlerClass(this.xoApp).handlerMap();
|
|
891
|
+
for (const [channel, handler] of Object.entries(handlerMap)) {
|
|
892
|
+
if (!handler) {
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (this.registeredChannels.has(channel)) {
|
|
896
|
+
throw new Error(`IPC \u901A\u9053\u91CD\u590D\u6CE8\u518C: ${channel}`);
|
|
897
|
+
}
|
|
898
|
+
this.registeredChannels.add(channel);
|
|
899
|
+
ipcMain.handle(channel, IpcHandlerUtil.wrap(handler));
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
// src/main/ipc/ipc-manager.ts
|
|
906
|
+
var IpcManager = class extends IpcManagerAbstract {
|
|
907
|
+
/**
|
|
908
|
+
* 处理器列表
|
|
909
|
+
* @returns {XoIpc.HandlersConstructor[]}
|
|
910
|
+
* @protected
|
|
911
|
+
*/
|
|
912
|
+
handlers() {
|
|
913
|
+
return [];
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
export {
|
|
918
|
+
IpcHandlersAbstract,
|
|
919
|
+
AppHandlers,
|
|
920
|
+
AuthHandlers,
|
|
921
|
+
ClipboardHandlers,
|
|
922
|
+
ContexMenuHandlers,
|
|
923
|
+
DialogHandlers,
|
|
924
|
+
FileHandlers,
|
|
925
|
+
LogHandlers,
|
|
926
|
+
RemoteServiceHandlers,
|
|
927
|
+
ShellHandlers,
|
|
928
|
+
ThemeHandlers,
|
|
929
|
+
UpdaterHandlers,
|
|
930
|
+
WindowHandlers,
|
|
931
|
+
IpcHandlerUtil,
|
|
932
|
+
IpcManagerAbstract,
|
|
933
|
+
IpcManager
|
|
934
|
+
};
|