@fde-desktop/fde-core 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppEmptyState-Bxpit0JV.js → AppEmptyState-Boej96TB.js} +1 -1
- package/dist/AppEmptyState-CLc00OOG.cjs +1 -0
- package/dist/AppIcon-C8vHUVcb.cjs +1 -0
- package/dist/AppIcon-mtEoyzOb.js +22 -0
- package/dist/AppMenuBar-CAlkNHjj.cjs +1 -0
- package/dist/AppMenuBar-DmSfQRXU.js +197 -0
- package/dist/CalendarApp-DOmjWbpl.js +10 -0
- package/dist/CalendarApp-Z0bCCYsK.cjs +1 -0
- package/dist/ColorPicker-CQRRwY-y.cjs +1 -0
- package/dist/ColorPicker-WCeD3Wjf.js +35 -0
- package/dist/CreateItemApp-BkFFFdX1.cjs +1 -0
- package/dist/CreateItemApp-DR8Y4bwo.js +202 -0
- package/dist/DeviceInfoApp-BXQ9uOwF.cjs +1 -0
- package/dist/DeviceInfoApp-I63mJRWy.js +195 -0
- package/dist/DownloadProgress-CkTGTf0z.cjs +1 -0
- package/dist/DownloadProgress-DnVASsv5.js +39 -0
- package/dist/FilePickerApp-By6-vbag.cjs +1 -0
- package/dist/FilePickerApp-ClHuhm6Z.js +390 -0
- package/dist/FilesApp-BC4UPNuw.cjs +1 -0
- package/dist/FilesApp-D8MqvC5X.js +210 -0
- package/dist/ImageViewerApp-B1niWF75.cjs +1 -0
- package/dist/{ImageViewerApp-BaLP3gkO.js → ImageViewerApp-iojtyFEf.js} +5 -5
- package/dist/{ImageViewerMenuBar-CabGSi9r.js → ImageViewerMenuBar-BIsUokxV.js} +2 -2
- package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +1 -0
- package/dist/MenuEditApp-BHptoJbz.cjs +1 -0
- package/dist/{MenuEditApp-BTRppYnD.js → MenuEditApp-CJUbJaqh.js} +138 -143
- package/dist/MenuEditMenuBar-CCOSPAUe.cjs +1 -0
- package/dist/{MenuEditMenuBar-x1IQrHP2.js → MenuEditMenuBar-DnCL-kaZ.js} +3 -3
- package/dist/NotesApp-BmQIBtJ2.cjs +1 -0
- package/dist/{NotesApp-CQe7UfBC.js → NotesApp-DJ2dGt4-.js} +5 -5
- package/dist/NotesMenuBar-BzojwMtH.cjs +1 -0
- package/dist/{NotesMenuBar-VhpIe68v.js → NotesMenuBar-DILZTjnT.js} +3 -3
- package/dist/{PdfApp-DL_R9-Nc.js → PdfApp-IjY_GtnW.js} +3 -3
- package/dist/PdfApp-krW8UI97.cjs +1 -0
- package/dist/{PdfMenuBar-DZCLSOpR.js → PdfMenuBar-Bd5MTZcZ.js} +1 -1
- package/dist/PdfMenuBar-DWD0Qa3F.cjs +1 -0
- package/dist/SettingsApp-BE22l5UP.cjs +1 -0
- package/dist/SettingsApp-BTFtTFY_.js +1228 -0
- package/dist/SettingsMenuBar-CZE2evG2.cjs +1 -0
- package/dist/{SettingsMenuBar-YWiJHaxq.js → SettingsMenuBar-ktC0viTd.js} +3 -3
- package/dist/UploaderApp-CbypD538.js +263 -0
- package/dist/UploaderApp-D_qD3O70.cjs +1 -0
- package/dist/{VscIcon-DBfVnArE.js → VscIcon-AEENjKOE.js} +1 -1
- package/dist/VscIcon-BYb_Soyy.cjs +1 -0
- package/dist/buildBreadcrumbs-Ccd8i11b.cjs +1 -0
- package/dist/buildBreadcrumbs-noWhu8os.js +45 -0
- package/dist/{desktopStore-F8bgLqFl.js → desktopStore-8cSZlj7s.js} +407 -477
- package/dist/desktopStore-C1jR6Fdb.cjs +1 -0
- package/dist/imageViewerStore-Dfylg59V.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +1646 -1960
- package/dist/menuEditStore-CYwtfD6H.cjs +1 -0
- package/dist/notesStore-CrWTO6oB.cjs +1 -0
- package/dist/settingsAppStore-DuYZNeFf.cjs +1 -0
- package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +1 -0
- package/dist/{useAdaptiveDimensions-AVDc_qPa.js → useAdaptiveDimensions-DxNLJ7R5.js} +1 -1
- package/dist/{useCloseInterceptor-BZd3VILp.js → useCloseInterceptor-CIxhOZx1.js} +1 -1
- package/dist/useCloseInterceptor-CdX-09Ib.cjs +1 -0
- package/dist/useDynamicIcon-CK6SjEv5.cjs +1 -0
- package/dist/useOpenApp-D-FOY88T.cjs +1 -0
- package/dist/{useOpenApp-CBIm7Gzl.js → useOpenApp-DkZLFFCH.js} +51 -67
- package/dist/{useResolvedUrl-DQpLqOoL.js → useResolvedUrl-B6x4xy0x.js} +1 -2
- package/dist/useResolvedUrl-Bb39DpVy.cjs +1 -0
- package/package.json +2 -1
- package/dist/AccordionChevron-DxpOyInK.js +0 -26
- package/dist/AccordionChevron-kn5kSrEc.cjs +0 -1
- package/dist/ActionIcon-Drh4p6Fv.js +0 -145
- package/dist/ActionIcon-alk2zZD6.cjs +0 -1
- package/dist/AppEmptyState-BWCUbf-B.cjs +0 -1
- package/dist/AppIcon-BU7a3ZNH.cjs +0 -1
- package/dist/AppIcon-XumS3bIG.js +0 -80
- package/dist/AppMenuBar-B9U0n1Vv.cjs +0 -1
- package/dist/AppMenuBar-CnIEVjr8.js +0 -2049
- package/dist/Box-DSKR_qaa.js +0 -1579
- package/dist/Box-zW6Twge8.cjs +0 -1
- package/dist/Button-DMlnrqyx.cjs +0 -1
- package/dist/Button-wTOTQKxF.js +0 -178
- package/dist/CalendarApp-B_e1B1Yn.cjs +0 -1
- package/dist/CalendarApp-C-l9D6nd.cjs +0 -1
- package/dist/CalendarApp-D0ftTCTG.js +0 -1399
- package/dist/Center-CmxXB9ql.js +0 -25
- package/dist/Center-DKUE2pER.cjs +0 -1
- package/dist/CheckIcon-CZhtJD1O.cjs +0 -1
- package/dist/CheckIcon-N5qBqXQJ.js +0 -25
- package/dist/CodeServerApp-BOoGwZ7r.cjs +0 -1
- package/dist/CodeServerApp-Be3I5EGg.cjs +0 -1
- package/dist/CodeServerApp-DW18EZxa.js +0 -150
- package/dist/ColorPicker-BCNqi02x.js +0 -997
- package/dist/ColorPicker-BrDE7tMO.cjs +0 -1
- package/dist/CreateItemApp-B12M1E_1.cjs +0 -1
- package/dist/CreateItemApp-TAAprby3.js +0 -400
- package/dist/CreateItemApp-ePB6ujNl.cjs +0 -1
- package/dist/DeviceInfoApp-BMF18BGo.cjs +0 -1
- package/dist/DeviceInfoApp-DRy0H3aT.cjs +0 -1
- package/dist/DeviceInfoApp-lgpwkeRR.js +0 -223
- package/dist/DownloadProgress-EoyCaD5O.js +0 -174
- package/dist/DownloadProgress-VNdj22U8.cjs +0 -1
- package/dist/FileIcon-7JaSR3Gn.js +0 -89
- package/dist/FileIcon-CIXopWLv.cjs +0 -1
- package/dist/FilePickerApp-DaMgEqKh.js +0 -409
- package/dist/FilePickerApp-DjmuSFqa.cjs +0 -1
- package/dist/FilesApp-Bp7wfrBZ.cjs +0 -1
- package/dist/FilesApp-BpJJRKhi.cjs +0 -1
- package/dist/FilesApp-Cj94QG5o.js +0 -225
- package/dist/Group-CtBJSfCo.js +0 -48
- package/dist/Group-Dsrf6lEK.cjs +0 -1
- package/dist/ImageViewerApp-DlHGeB3S.cjs +0 -1
- package/dist/ImageViewerApp-DoXd_Swu.cjs +0 -1
- package/dist/ImageViewerMenuBar-SAI7UNz7.cjs +0 -1
- package/dist/ImageViewerMenuBar-_Jr29gii.cjs +0 -1
- package/dist/MenuEditApp-BJjlPTOa.cjs +0 -1
- package/dist/MenuEditApp-JPsGT-S3.cjs +0 -1
- package/dist/MenuEditMenuBar-BydGkqMw.cjs +0 -1
- package/dist/MenuEditMenuBar-DptlwVPQ.cjs +0 -1
- package/dist/NotesApp-BOcRGO7w.cjs +0 -1
- package/dist/NotesApp-OL07JXRE.cjs +0 -1
- package/dist/NotesMenuBar-BSI_2Y7p.cjs +0 -1
- package/dist/NotesMenuBar-Df6aW85J.cjs +0 -1
- package/dist/Paper-BX_9odR6.js +0 -30
- package/dist/Paper-D8-BaBx2.cjs +0 -1
- package/dist/PdfApp-CNEbty5v.cjs +0 -1
- package/dist/PdfApp-CVv3ZCaM.cjs +0 -1
- package/dist/PdfMenuBar--E6kDyrT.cjs +0 -1
- package/dist/PdfMenuBar-Dj5cJUkg.cjs +0 -1
- package/dist/SettingsApp-BlmHuAjT.js +0 -1831
- package/dist/SettingsApp-CNvIgf5B.cjs +0 -1
- package/dist/SettingsApp-DWxanNE4.cjs +0 -1
- package/dist/SettingsMenuBar-CBoOBCfx.cjs +0 -1
- package/dist/SettingsMenuBar-DQooFkZN.cjs +0 -1
- package/dist/Slider-BUiHxjKO.cjs +0 -1
- package/dist/Slider-t-NcD60t.js +0 -1176
- package/dist/Stack-Bp1Ek2Gp.js +0 -34
- package/dist/Stack-D4jAiRfc.cjs +0 -1
- package/dist/StorybookApp-CDLV_kja.cjs +0 -1
- package/dist/StorybookApp-DKwlPCmo.js +0 -10
- package/dist/TerminalApp-BCB7i1lR.cjs +0 -1
- package/dist/TerminalApp-BYc_gHLe.js +0 -326
- package/dist/TerminalApp-Dviz6aP2.cjs +0 -1
- package/dist/TerminalMenuBar-D5tPmgR_.js +0 -113
- package/dist/TerminalMenuBar-DNshPmCa.cjs +0 -1
- package/dist/TerminalMenuBar-HzMSR7XP.cjs +0 -1
- package/dist/TextInput-C-JtGWn1.js +0 -981
- package/dist/TextInput-CrsmcOip.cjs +0 -1
- package/dist/Tooltip-D5Cd9wtz.cjs +0 -1
- package/dist/Tooltip-DOeIvhrO.js +0 -1142
- package/dist/UnstyledButton-DGaG-e_G.js +0 -25
- package/dist/UnstyledButton-DX2pTahr.cjs +0 -1
- package/dist/UploaderApp-C6xA5Rrf2.cjs +0 -1
- package/dist/UploaderApp-DnHIRxB_.cjs +0 -1
- package/dist/UploaderApp-qBfpukR_.js +0 -488
- package/dist/VscIcon-CcMdrFoJ.cjs +0 -1
- package/dist/create-safe-context-Bboj0GWC.cjs +0 -1
- package/dist/create-safe-context-XT2cxc14.js +0 -12
- package/dist/desktopStore-CZoA9VHO.cjs +0 -1
- package/dist/getRuntime-BFK0-8R1.cjs +0 -1
- package/dist/getRuntime-DAPqFH2W.js +0 -63
- package/dist/imageViewerStore-BB_tssZR.cjs +0 -1
- package/dist/is-element-Bu_JY8Qy.js +0 -7
- package/dist/is-element-CdV0xajp.cjs +0 -1
- package/dist/menuEditStore-CTeM_dns.cjs +0 -1
- package/dist/notesStore-BCEl1D_v.cjs +0 -1
- package/dist/settingsAppStore-CMBc13VU.cjs +0 -1
- package/dist/terminalStore-IWdf4Mm6.js +0 -30
- package/dist/terminalStore-iIuyodfK.cjs +0 -1
- package/dist/use-merged-ref-BT8_u6vW.js +0 -25
- package/dist/use-merged-ref-n9Gw9LNn.cjs +0 -1
- package/dist/use-resolved-styles-api-8OXE2oRq.cjs +0 -1
- package/dist/use-resolved-styles-api-DNUlJJZf.js +0 -21
- package/dist/use-uncontrolled-A4hm9ATM.js +0 -23
- package/dist/use-uncontrolled-DDJVQiM_.cjs +0 -1
- package/dist/useAdaptiveDimensions-CfITBJ_m.cjs +0 -1
- package/dist/useCloseInterceptor-yntBEzNc.cjs +0 -1
- package/dist/useDynamicIcon-DJ_il30E.cjs +0 -1
- package/dist/useOpenApp-DW4x79Zg.cjs +0 -1
- package/dist/useResolvedUrl-BkMPM1fM.cjs +0 -1
- /package/dist/{Colors-zP2AFgU3.cjs → Colors-CNJbU7oq.cjs} +0 -0
- /package/dist/{Colors-ClnDxnyA.js → Colors-CuABn2W4.js} +0 -0
- /package/dist/{imageViewerStore-C5kWz0o7.js → imageViewerStore-COrD02Zu.js} +0 -0
- /package/dist/{menuEditStore-Cj1zAwxQ.js → menuEditStore-CxsgLiQu.js} +0 -0
- /package/dist/{notesStore-BPyRTHEc.js → notesStore-Dgah46U5.js} +0 -0
- /package/dist/{settingsAppStore-BDQ3ts1y.js → settingsAppStore-DHZhi6Rl.js} +0 -0
- /package/dist/{useDynamicIcon-Bf0t2foA.js → useDynamicIcon-_wGeWu-b.js} +0 -0
- /package/dist/{useMenuBarUtils-nmu9yehT.js → useMenuBarUtils-ChAfI7OA.js} +0 -0
- /package/dist/{useMenuBarUtils-nJIPJGIQ.cjs → useMenuBarUtils-DAap0ukp.cjs} +0 -0
package/dist/Center-CmxXB9ql.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { c as e, l as t, n, t as r } from "./Box-DSKR_qaa.js";
|
|
2
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
//#region ../../node_modules/.bun/@mantine+core@9.0.0+9dd69a0af178a974/node_modules/@mantine/core/esm/components/Center/Center.module.mjs
|
|
4
|
-
var a = { root: "m_4451eb3a" }, o = n((n) => {
|
|
5
|
-
let o = t("Center", null, n), { classNames: s, className: c, style: l, styles: u, unstyled: d, vars: f, inline: p, mod: m, attributes: h, ...g } = o, _ = e({
|
|
6
|
-
name: "Center",
|
|
7
|
-
props: o,
|
|
8
|
-
classes: a,
|
|
9
|
-
className: c,
|
|
10
|
-
style: l,
|
|
11
|
-
classNames: s,
|
|
12
|
-
styles: u,
|
|
13
|
-
unstyled: d,
|
|
14
|
-
attributes: h,
|
|
15
|
-
vars: f
|
|
16
|
-
});
|
|
17
|
-
return /* @__PURE__ */ i(r, {
|
|
18
|
-
mod: [{ inline: p }, m],
|
|
19
|
-
..._("root"),
|
|
20
|
-
...g
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
o.classes = a, o.displayName = "@mantine/core/Center";
|
|
24
|
-
//#endregion
|
|
25
|
-
export { o as t };
|
package/dist/Center-DKUE2pER.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./Box-zW6Twge8.cjs`);let t=require(`react/jsx-runtime`);var n={root:`m_4451eb3a`},r=e.n(r=>{let i=e.l(`Center`,null,r),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,inline:d,mod:f,attributes:p,...m}=i,h=e.c({name:`Center`,props:i,classes:n,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:p,vars:u});return(0,t.jsx)(e.t,{mod:[{inline:d},f],...h(`root`),...m})});r.classes=n,r.displayName=`@mantine/core/Center`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./Box-zW6Twge8.cjs`);let t=require(`react/jsx-runtime`);function n({size:n,style:r,...i}){return(0,t.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:n===void 0?r:{width:e.I(n),height:e.I(n),...r},"aria-hidden":!0,...i,children:(0,t.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { I as e } from "./Box-DSKR_qaa.js";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
//#region ../../node_modules/.bun/@mantine+core@9.0.0+9dd69a0af178a974/node_modules/@mantine/core/esm/components/Checkbox/CheckIcon.mjs
|
|
4
|
-
function n({ size: n, style: r, ...i }) {
|
|
5
|
-
return /* @__PURE__ */ t("svg", {
|
|
6
|
-
viewBox: "0 0 10 7",
|
|
7
|
-
fill: "none",
|
|
8
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
-
style: n === void 0 ? r : {
|
|
10
|
-
width: e(n),
|
|
11
|
-
height: e(n),
|
|
12
|
-
...r
|
|
13
|
-
},
|
|
14
|
-
"aria-hidden": !0,
|
|
15
|
-
...i,
|
|
16
|
-
children: /* @__PURE__ */ t("path", {
|
|
17
|
-
d: "M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",
|
|
18
|
-
fill: "currentColor",
|
|
19
|
-
fillRule: "evenodd",
|
|
20
|
-
clipRule: "evenodd"
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { n as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./Box-zW6Twge8.cjs`);const e=require(`./getRuntime-BFK0-8R1.cjs`),t=require(`./Center-DKUE2pER.cjs`),n=require(`./Stack-D4jAiRfc.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`react-i18next`),o=require(`react-icons/fc`);var s=()=>{let{t:r}=(0,a.useTranslation)(`apps`);return(0,i.jsx)(t.t,{"data-testid":`code-server-not-supported`,style:{width:`100%`,height:`100%`},children:(0,i.jsxs)(n.t,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,i.jsx)(e.o,{size:`3rem`,children:(0,i.jsx)(o.FcInfo,{})}),(0,i.jsx)(e.o,{size:`lg`,fw:700,ta:`center`,children:r(`codeServer.notAvailable`)}),(0,i.jsx)(e.o,{size:`sm`,c:`dimmed`,ta:`center`,children:r(`codeServer.notAvailableMessage`)}),(0,i.jsx)(e.o,{size:`sm`,c:`dimmed`,ta:`center`,children:r(`codeServer.dockerRequired`)})]})})},c={container:`_container_1ypq1_1`,loading:`_loading_1ypq1_9`,spinner:`_spinner_1ypq1_19`,spin:`_spin_1ypq1_19`,error:`_error_1ypq1_39`,retryButton:`_retryButton_1ypq1_63`,iframe:`_iframe_1ypq1_79`},l=({window:e,notifyReady:t})=>{let n=e,[a,o]=(0,r.useState)({status:`idle`,url:null,error:null}),s=(0,r.useRef)(!1),l=(0,r.useRef)(!1),u=(0,r.useCallback)(async()=>{if(!l.current){l.current=!0,o(e=>({...e,status:`starting`,error:null}));try{let e=await(await fetch(`/api/code-server/start`,{method:`POST`})).json();e.success&&e.url?o({status:`running`,url:e.url,error:null}):o({status:`error`,url:null,error:e.error||`Failed to start code-server`})}catch(e){o({status:`error`,url:null,error:e instanceof Error?e.message:`Failed to start code-server`})}finally{l.current=!1}}},[]),d=(0,r.useCallback)(async()=>{try{await fetch(`/api/code-server/stop`,{method:`POST`})}catch(e){console.error(`[CodeServerApp] Error stopping code-server:`,e)}},[]);return(0,r.useEffect)(()=>(u(),()=>{d()}),[u,d]),(0,r.useEffect)(()=>{!s.current&&t&&(s.current=!0,t({...n?.contentData??{},status:a.status,restart:u}))},[t,a.status,u,n?.contentData]),(0,r.useEffect)(()=>{s.current&&t&&t({...n?.contentData??{},status:a.status})},[a.status,t,n?.contentData]),a.status===`idle`||a.status===`starting`?(0,i.jsx)(`div`,{className:c.container,children:(0,i.jsxs)(`div`,{className:c.loading,children:[(0,i.jsx)(`div`,{className:c.spinner}),(0,i.jsx)(`p`,{children:`Starting VS Code...`})]})}):a.status===`error`?(0,i.jsx)(`div`,{className:c.container,children:(0,i.jsxs)(`div`,{className:c.error,children:[(0,i.jsx)(`h3`,{children:`Failed to start VS Code`}),(0,i.jsx)(`p`,{children:a.error}),(0,i.jsx)(`button`,{onClick:u,className:c.retryButton,children:`Retry`})]})}):(0,i.jsx)(`div`,{className:c.container,children:(0,i.jsx)(`iframe`,{src:a.url||``,className:c.iframe,title:`VS Code`,allow:`clipboard-read; clipboard-write`})})},u=t=>e.i()?(0,i.jsx)(l,{...t}):(0,i.jsx)(s,{});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./CodeServerApp-BOoGwZ7r.cjs`);exports.default=e.t;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
-
import { i as t, o as n } from "./getRuntime-DAPqFH2W.js";
|
|
3
|
-
import { t as r } from "./Center-CmxXB9ql.js";
|
|
4
|
-
import { t as i } from "./Stack-Bp1Ek2Gp.js";
|
|
5
|
-
import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
6
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
-
import { useTranslation as d } from "react-i18next";
|
|
8
|
-
import { FcInfo as f } from "react-icons/fc";
|
|
9
|
-
//#region src/components/Apps/CodeServerApp/CodeServerNotSupported.tsx
|
|
10
|
-
var p = () => {
|
|
11
|
-
let { t: e } = d("apps");
|
|
12
|
-
return /* @__PURE__ */ l(r, {
|
|
13
|
-
"data-testid": "code-server-not-supported",
|
|
14
|
-
style: {
|
|
15
|
-
width: "100%",
|
|
16
|
-
height: "100%"
|
|
17
|
-
},
|
|
18
|
-
children: /* @__PURE__ */ u(i, {
|
|
19
|
-
align: "center",
|
|
20
|
-
gap: "lg",
|
|
21
|
-
p: "xl",
|
|
22
|
-
maw: 400,
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ l(n, {
|
|
25
|
-
size: "3rem",
|
|
26
|
-
children: /* @__PURE__ */ l(f, {})
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ l(n, {
|
|
29
|
-
size: "lg",
|
|
30
|
-
fw: 700,
|
|
31
|
-
ta: "center",
|
|
32
|
-
children: e("codeServer.notAvailable")
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ l(n, {
|
|
35
|
-
size: "sm",
|
|
36
|
-
c: "dimmed",
|
|
37
|
-
ta: "center",
|
|
38
|
-
children: e("codeServer.notAvailableMessage")
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ l(n, {
|
|
41
|
-
size: "sm",
|
|
42
|
-
c: "dimmed",
|
|
43
|
-
ta: "center",
|
|
44
|
-
children: e("codeServer.dockerRequired")
|
|
45
|
-
})
|
|
46
|
-
]
|
|
47
|
-
})
|
|
48
|
-
});
|
|
49
|
-
}, m = {
|
|
50
|
-
container: "_container_1ypq1_1",
|
|
51
|
-
loading: "_loading_1ypq1_9",
|
|
52
|
-
spinner: "_spinner_1ypq1_19",
|
|
53
|
-
spin: "_spin_1ypq1_19",
|
|
54
|
-
error: "_error_1ypq1_39",
|
|
55
|
-
retryButton: "_retryButton_1ypq1_63",
|
|
56
|
-
iframe: "_iframe_1ypq1_79"
|
|
57
|
-
}, h = /* @__PURE__ */ e({ default: () => _ }), g = ({ window: e, notifyReady: t }) => {
|
|
58
|
-
let n = e, [r, i] = c({
|
|
59
|
-
status: "idle",
|
|
60
|
-
url: null,
|
|
61
|
-
error: null
|
|
62
|
-
}), d = s(!1), f = s(!1), p = a(async () => {
|
|
63
|
-
if (!f.current) {
|
|
64
|
-
f.current = !0, i((e) => ({
|
|
65
|
-
...e,
|
|
66
|
-
status: "starting",
|
|
67
|
-
error: null
|
|
68
|
-
}));
|
|
69
|
-
try {
|
|
70
|
-
let e = await (await fetch("/api/code-server/start", { method: "POST" })).json();
|
|
71
|
-
e.success && e.url ? i({
|
|
72
|
-
status: "running",
|
|
73
|
-
url: e.url,
|
|
74
|
-
error: null
|
|
75
|
-
}) : i({
|
|
76
|
-
status: "error",
|
|
77
|
-
url: null,
|
|
78
|
-
error: e.error || "Failed to start code-server"
|
|
79
|
-
});
|
|
80
|
-
} catch (e) {
|
|
81
|
-
i({
|
|
82
|
-
status: "error",
|
|
83
|
-
url: null,
|
|
84
|
-
error: e instanceof Error ? e.message : "Failed to start code-server"
|
|
85
|
-
});
|
|
86
|
-
} finally {
|
|
87
|
-
f.current = !1;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}, []), h = a(async () => {
|
|
91
|
-
try {
|
|
92
|
-
await fetch("/api/code-server/stop", { method: "POST" });
|
|
93
|
-
} catch (e) {
|
|
94
|
-
console.error("[CodeServerApp] Error stopping code-server:", e);
|
|
95
|
-
}
|
|
96
|
-
}, []);
|
|
97
|
-
return o(() => (p(), () => {
|
|
98
|
-
h();
|
|
99
|
-
}), [p, h]), o(() => {
|
|
100
|
-
!d.current && t && (d.current = !0, t({
|
|
101
|
-
...n?.contentData ?? {},
|
|
102
|
-
status: r.status,
|
|
103
|
-
restart: p
|
|
104
|
-
}));
|
|
105
|
-
}, [
|
|
106
|
-
t,
|
|
107
|
-
r.status,
|
|
108
|
-
p,
|
|
109
|
-
n?.contentData
|
|
110
|
-
]), o(() => {
|
|
111
|
-
d.current && t && t({
|
|
112
|
-
...n?.contentData ?? {},
|
|
113
|
-
status: r.status
|
|
114
|
-
});
|
|
115
|
-
}, [
|
|
116
|
-
r.status,
|
|
117
|
-
t,
|
|
118
|
-
n?.contentData
|
|
119
|
-
]), r.status === "idle" || r.status === "starting" ? /* @__PURE__ */ l("div", {
|
|
120
|
-
className: m.container,
|
|
121
|
-
children: /* @__PURE__ */ u("div", {
|
|
122
|
-
className: m.loading,
|
|
123
|
-
children: [/* @__PURE__ */ l("div", { className: m.spinner }), /* @__PURE__ */ l("p", { children: "Starting VS Code..." })]
|
|
124
|
-
})
|
|
125
|
-
}) : r.status === "error" ? /* @__PURE__ */ l("div", {
|
|
126
|
-
className: m.container,
|
|
127
|
-
children: /* @__PURE__ */ u("div", {
|
|
128
|
-
className: m.error,
|
|
129
|
-
children: [
|
|
130
|
-
/* @__PURE__ */ l("h3", { children: "Failed to start VS Code" }),
|
|
131
|
-
/* @__PURE__ */ l("p", { children: r.error }),
|
|
132
|
-
/* @__PURE__ */ l("button", {
|
|
133
|
-
onClick: p,
|
|
134
|
-
className: m.retryButton,
|
|
135
|
-
children: "Retry"
|
|
136
|
-
})
|
|
137
|
-
]
|
|
138
|
-
})
|
|
139
|
-
}) : /* @__PURE__ */ l("div", {
|
|
140
|
-
className: m.container,
|
|
141
|
-
children: /* @__PURE__ */ l("iframe", {
|
|
142
|
-
src: r.url || "",
|
|
143
|
-
className: m.iframe,
|
|
144
|
-
title: "VS Code",
|
|
145
|
-
allow: "clipboard-read; clipboard-write"
|
|
146
|
-
})
|
|
147
|
-
});
|
|
148
|
-
}, _ = (e) => t() ? /* @__PURE__ */ l(g, { ...e }) : /* @__PURE__ */ l(p, {});
|
|
149
|
-
//#endregion
|
|
150
|
-
export { h as t };
|