@fde-desktop/fde-core 0.3.8 → 0.4.2

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.
Files changed (148) hide show
  1. package/README.md +419 -68
  2. package/dist/CalendarApp-CHLUCAI7.css +744 -0
  3. package/dist/CalendarApp-K7ZOUZ6C.js +2 -0
  4. package/dist/CalendarApp-OTGEERSS.cjs +8 -0
  5. package/dist/CodeServerApp-5KZGO7HL.css +75 -0
  6. package/dist/CodeServerApp-LUZFCQBI.js +3 -0
  7. package/dist/CodeServerApp-P3TMJPLY.cjs +9 -0
  8. package/dist/CreateItemApp-NAZMXOPK.cjs +14 -0
  9. package/dist/CreateItemApp-PQB5GTFG.css +107 -0
  10. package/dist/CreateItemApp-ZHCTSPQE.js +8 -0
  11. package/dist/DeviceInfoApp-R6YNVIGX.cjs +11 -0
  12. package/dist/DeviceInfoApp-YHCYAO6N.js +5 -0
  13. package/dist/DeviceInfoApp-ZSMRSITP.css +7 -0
  14. package/dist/FilesApp-AKCVRTXR.js +8 -0
  15. package/dist/FilesApp-E6L5W3T2.css +1817 -0
  16. package/dist/FilesApp-RW3Y6ILO.cjs +14 -0
  17. package/dist/ImageViewerApp-5UXNSW2O.js +11 -0
  18. package/dist/ImageViewerApp-N2Q7E7WZ.css +215 -0
  19. package/dist/ImageViewerApp-RRRRKSFN.cjs +17 -0
  20. package/dist/ImageViewerMenuBar-I3TFKQPS.cjs +14 -0
  21. package/dist/ImageViewerMenuBar-TV5C6TM2.js +5 -0
  22. package/dist/ImageViewerMenuBar-XLK4LIHW.css +56 -0
  23. package/dist/MenuEditApp-HUZRFEHE.js +9 -0
  24. package/dist/MenuEditApp-MCUHGTKQ.cjs +15 -0
  25. package/dist/MenuEditApp-YA6HSAMJ.css +94 -0
  26. package/dist/MenuEditMenuBar-7VHMZNRM.css +56 -0
  27. package/dist/MenuEditMenuBar-GF6L4PGZ.cjs +15 -0
  28. package/dist/MenuEditMenuBar-IUXFPZE5.js +6 -0
  29. package/dist/NotesApp-37BV33C6.js +10 -0
  30. package/dist/NotesApp-4EVUQEFZ.cjs +16 -0
  31. package/dist/NotesApp-TQ6IHDNX.css +302 -0
  32. package/dist/NotesMenuBar-25LKN3SE.cjs +15 -0
  33. package/dist/NotesMenuBar-MXLOX7OT.css +56 -0
  34. package/dist/NotesMenuBar-SRV3AIAL.js +6 -0
  35. package/dist/PdfApp-5VBDNRMC.cjs +16 -0
  36. package/dist/PdfApp-BUIC5U5H.css +206 -0
  37. package/dist/PdfApp-RH6MZZX5.js +10 -0
  38. package/dist/PdfMenuBar-NLZC6JHS.js +4 -0
  39. package/dist/PdfMenuBar-QUM72EE4.css +56 -0
  40. package/dist/PdfMenuBar-WBRTKMLN.cjs +13 -0
  41. package/dist/SettingsApp-5LDHEHYV.cjs +20 -0
  42. package/dist/SettingsApp-JVOSEFH3.css +283 -0
  43. package/dist/SettingsApp-X6764D7T.js +14 -0
  44. package/dist/SettingsMenuBar-5CBSSMVM.css +56 -0
  45. package/dist/SettingsMenuBar-VLT6TTCM.js +6 -0
  46. package/dist/SettingsMenuBar-Y5QEXDEO.cjs +15 -0
  47. package/dist/StorybookApp-NQ244BER.css +7 -0
  48. package/dist/StorybookApp-NZDV4X3Y.js +1 -0
  49. package/dist/StorybookApp-VF3KIMU3.cjs +7 -0
  50. package/dist/TerminalApp-CDGWRBFJ.cjs +10 -0
  51. package/dist/TerminalApp-EAATMIMX.css +77 -0
  52. package/dist/TerminalApp-GCKJCM55.js +4 -0
  53. package/dist/TerminalMenuBar-3J26O26Q.css +56 -0
  54. package/dist/TerminalMenuBar-7BH7MGNJ.cjs +14 -0
  55. package/dist/TerminalMenuBar-7JAEQUZ4.js +5 -0
  56. package/dist/UploaderApp-2WYRCUQV.js +10 -0
  57. package/dist/UploaderApp-6KV3TGCT.css +1817 -0
  58. package/dist/UploaderApp-EYFC36PM.cjs +16 -0
  59. package/dist/chunk-2FO445RM.cjs +449 -0
  60. package/dist/chunk-2PSTHGTD.cjs +42 -0
  61. package/dist/chunk-2RQX7QBP.cjs +148 -0
  62. package/dist/chunk-3IICBLEA.js +442 -0
  63. package/dist/chunk-43W6UDUZ.cjs +19 -0
  64. package/dist/chunk-4E45FBAH.js +223 -0
  65. package/dist/chunk-4MCFQPKY.js +444 -0
  66. package/dist/chunk-4OH5RPSQ.cjs +38 -0
  67. package/dist/chunk-4XURSNM4.js +43 -0
  68. package/dist/chunk-4ZCRYHL6.js +407 -0
  69. package/dist/chunk-54PYEQLK.js +283 -0
  70. package/dist/chunk-5C6IQE42.cjs +35 -0
  71. package/dist/chunk-5NOHYJNH.js +84 -0
  72. package/dist/chunk-5PYK5ASL.js +162 -0
  73. package/dist/chunk-5YH6AKEO.js +146 -0
  74. package/dist/chunk-657BJOY5.cjs +324 -0
  75. package/dist/chunk-6QOUYSEE.cjs +2303 -0
  76. package/dist/chunk-7SAFECOJ.js +215 -0
  77. package/dist/chunk-7Y7HB7FB.cjs +53 -0
  78. package/dist/chunk-ABIAPZ6S.cjs +45 -0
  79. package/dist/chunk-AQL372JF.cjs +219 -0
  80. package/dist/chunk-AXDUVZVP.cjs +88 -0
  81. package/dist/chunk-AYFNYHMP.js +541 -0
  82. package/dist/chunk-BDO6B7MZ.cjs +451 -0
  83. package/dist/chunk-BKXEA2BK.cjs +286 -0
  84. package/dist/chunk-BLV47DX2.js +47 -0
  85. package/dist/chunk-BQCD5RAF.cjs +48 -0
  86. package/dist/chunk-BQL3YXMV.js +17429 -0
  87. package/dist/chunk-C6BEZNAM.cjs +45 -0
  88. package/dist/chunk-CFWV2JMR.js +234 -0
  89. package/dist/chunk-CV5PUHAE.cjs +86 -0
  90. package/dist/chunk-D5MVFFID.js +42 -0
  91. package/dist/chunk-D7R55WWT.js +1601 -0
  92. package/dist/chunk-DMNF4CNN.cjs +49 -0
  93. package/dist/chunk-DWP2SYF7.js +55 -0
  94. package/dist/chunk-E55VXNLK.cjs +17498 -0
  95. package/dist/chunk-EAELL43F.js +42 -0
  96. package/dist/chunk-EUQLZW6P.js +48 -0
  97. package/dist/chunk-EX5V2ZTU.js +40 -0
  98. package/dist/chunk-FH4ILMKF.js +38 -0
  99. package/dist/chunk-FRHBM2U7.js +33 -0
  100. package/dist/chunk-FX2TPX3L.cjs +45 -0
  101. package/dist/chunk-GCYD6T52.js +32 -0
  102. package/dist/chunk-GRYCUBJZ.js +9 -0
  103. package/dist/chunk-HWHBSAUC.js +40 -0
  104. package/dist/chunk-ICUE6T7J.cjs +50 -0
  105. package/dist/chunk-IDHP3R4I.js +31 -0
  106. package/dist/chunk-IUOQPOEN.js +2293 -0
  107. package/dist/chunk-J7L2S2GT.cjs +34 -0
  108. package/dist/chunk-JEBKLIMU.cjs +123 -0
  109. package/dist/chunk-KQHICFX3.js +121 -0
  110. package/dist/chunk-LMJE6V4N.cjs +42 -0
  111. package/dist/chunk-MVDGM5Y4.js +68 -0
  112. package/dist/chunk-NVEGEK3N.js +31 -0
  113. package/dist/chunk-NWMSWRUD.js +2236 -0
  114. package/dist/chunk-ODXL6BR3.js +77 -0
  115. package/dist/chunk-OJIDKDKF.js +68 -0
  116. package/dist/chunk-PKPQA5NR.js +15 -0
  117. package/dist/chunk-PNDBLFJW.cjs +50 -0
  118. package/dist/chunk-PYTKNRGM.js +280 -0
  119. package/dist/chunk-Q3WA72BF.cjs +70 -0
  120. package/dist/chunk-QB72BLCJ.cjs +237 -0
  121. package/dist/chunk-QHBBLML3.js +86 -0
  122. package/dist/chunk-RDIDAZ3S.cjs +9 -0
  123. package/dist/chunk-RGJPRXYY.js +48 -0
  124. package/dist/chunk-RQ6OZRUW.cjs +41 -0
  125. package/dist/chunk-SBE4SZAN.cjs +226 -0
  126. package/dist/chunk-SYGUWGWK.cjs +2329 -0
  127. package/dist/chunk-TDZ43MUX.cjs +165 -0
  128. package/dist/chunk-TGWMOHAO.js +17 -0
  129. package/dist/chunk-U4RYIS6Z.cjs +548 -0
  130. package/dist/chunk-UIQCTAVM.cjs +59 -0
  131. package/dist/chunk-XVASHRCE.cjs +70 -0
  132. package/dist/chunk-XYSMVQQD.cjs +1608 -0
  133. package/dist/chunk-YAIWI4Z5.js +7 -0
  134. package/dist/chunk-YP2PLNOF.cjs +34 -0
  135. package/dist/chunk-YSOLW4FS.cjs +11 -0
  136. package/dist/chunk-YY6OUR2U.js +44 -0
  137. package/dist/chunk-YZWS7FDT.cjs +409 -0
  138. package/dist/chunk-Z5YGWL65.cjs +39 -0
  139. package/dist/chunk-ZBGWYTCU.cjs +83 -0
  140. package/dist/chunk-ZHB5Q2M6.js +36 -0
  141. package/dist/chunk-ZHNDXNL4.js +45 -0
  142. package/dist/chunk-ZX3EDZ5C.cjs +17 -0
  143. package/dist/index.cjs +4405 -5156
  144. package/dist/index.css +9192 -0
  145. package/dist/index.d.cts +1324 -762
  146. package/dist/index.d.ts +1324 -762
  147. package/dist/index.js +3648 -5038
  148. package/package.json +14 -6
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var chunk6QOUYSEE_cjs = require('./chunk-6QOUYSEE.cjs');
4
+ var chunk7Y7HB7FB_cjs = require('./chunk-7Y7HB7FB.cjs');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ var AppIcon = ({ fcIcon, fallback, iconUrl, size = 20, color }) => {
8
+ const isFiIcon = fcIcon?.startsWith("Fi");
9
+ const isVscIcon = fcIcon?.startsWith("Vsc");
10
+ const fcElement = chunk7Y7HB7FB_cjs.useFcIconElement(!isFiIcon && !isVscIcon ? fcIcon ?? "" : "", { size });
11
+ const fiElement = chunk7Y7HB7FB_cjs.useFiIconElement(isFiIcon ? fcIcon ?? "" : "", { size, color });
12
+ const vscElement = chunk7Y7HB7FB_cjs.useVscIconElement(isVscIcon ? fcIcon ?? "" : "", { size });
13
+ if (iconUrl) {
14
+ const resolvedIconUrl = chunk6QOUYSEE_cjs.resolveUrl(iconUrl);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(
16
+ "img",
17
+ {
18
+ src: resolvedIconUrl,
19
+ alt: "",
20
+ width: size,
21
+ height: size,
22
+ style: { objectFit: "contain" }
23
+ }
24
+ );
25
+ }
26
+ if (isFiIcon && fiElement) return fiElement;
27
+ if (isVscIcon && vscElement) return vscElement;
28
+ if (fcElement) return fcElement;
29
+ if (fallback) return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: fallback });
30
+ return null;
31
+ };
32
+ var AppIcon_default = AppIcon;
33
+
34
+ exports.AppIcon_default = AppIcon_default;
@@ -0,0 +1,123 @@
1
+ 'use strict';
2
+
3
+ var chunkZ5YGWL65_cjs = require('./chunk-Z5YGWL65.cjs');
4
+ var chunkE55VXNLK_cjs = require('./chunk-E55VXNLK.cjs');
5
+ var react = require('react');
6
+ var fc = require('react-icons/fc');
7
+ var reactI18next = require('react-i18next');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ var CodeServerNotSupported = () => {
11
+ const { t } = reactI18next.useTranslation("apps");
12
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Center, { "data-testid": "code-server-not-supported", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkE55VXNLK_cjs.Stack, { align: "center", gap: "lg", p: "xl", maw: 400, children: [
13
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "3rem", children: /* @__PURE__ */ jsxRuntime.jsx(fc.FcInfo, {}) }),
14
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "lg", fw: 700, ta: "center", children: t("codeServer.notAvailable") }),
15
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.notAvailableMessage") }),
16
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.dockerRequired") })
17
+ ] }) });
18
+ };
19
+
20
+ // src/components/Apps/CodeServerApp/CodeServerApp.module.css
21
+ var CodeServerApp_default = {};
22
+ var CodeServerAppInner = ({ window, notifyReady }) => {
23
+ const win = window;
24
+ const [state, setState] = react.useState({
25
+ status: "idle",
26
+ url: null,
27
+ error: null
28
+ });
29
+ const hasNotifiedRef = react.useRef(false);
30
+ const startingRef = react.useRef(false);
31
+ const startCodeServer = react.useCallback(async () => {
32
+ if (startingRef.current) return;
33
+ startingRef.current = true;
34
+ setState((prev) => ({ ...prev, status: "starting", error: null }));
35
+ try {
36
+ const response = await fetch("/api/code-server/start", { method: "POST" });
37
+ const data = await response.json();
38
+ if (data.success && data.url) {
39
+ setState({
40
+ status: "running",
41
+ url: data.url,
42
+ error: null
43
+ });
44
+ } else {
45
+ setState({
46
+ status: "error",
47
+ url: null,
48
+ error: data.error || "Failed to start code-server"
49
+ });
50
+ }
51
+ } catch (err) {
52
+ setState({
53
+ status: "error",
54
+ url: null,
55
+ error: err instanceof Error ? err.message : "Failed to start code-server"
56
+ });
57
+ } finally {
58
+ startingRef.current = false;
59
+ }
60
+ }, []);
61
+ const stopCodeServer = react.useCallback(async () => {
62
+ try {
63
+ await fetch("/api/code-server/stop", { method: "POST" });
64
+ } catch (err) {
65
+ console.error("[CodeServerApp] Error stopping code-server:", err);
66
+ }
67
+ }, []);
68
+ react.useEffect(() => {
69
+ startCodeServer();
70
+ return () => {
71
+ stopCodeServer();
72
+ };
73
+ }, [startCodeServer, stopCodeServer]);
74
+ react.useEffect(() => {
75
+ if (!hasNotifiedRef.current && notifyReady) {
76
+ hasNotifiedRef.current = true;
77
+ notifyReady({
78
+ ...win?.contentData ?? {},
79
+ status: state.status,
80
+ restart: startCodeServer
81
+ });
82
+ }
83
+ }, [notifyReady, state.status, startCodeServer, win?.contentData]);
84
+ react.useEffect(() => {
85
+ if (hasNotifiedRef.current && notifyReady) {
86
+ notifyReady({
87
+ ...win?.contentData ?? {},
88
+ status: state.status
89
+ });
90
+ }
91
+ }, [state.status, notifyReady, win?.contentData]);
92
+ if (state.status === "idle" || state.status === "starting") {
93
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: CodeServerApp_default.loading, children: [
94
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.spinner }),
95
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Starting VS Code..." })
96
+ ] }) });
97
+ }
98
+ if (state.status === "error") {
99
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: CodeServerApp_default.error, children: [
100
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Failed to start VS Code" }),
101
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: state.error }),
102
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: startCodeServer, className: CodeServerApp_default.retryButton, children: "Retry" })
103
+ ] }) });
104
+ }
105
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxRuntime.jsx(
106
+ "iframe",
107
+ {
108
+ src: state.url || "",
109
+ className: CodeServerApp_default.iframe,
110
+ title: "VS Code",
111
+ allow: "clipboard-read; clipboard-write"
112
+ }
113
+ ) });
114
+ };
115
+ var CodeServerApp = (props) => {
116
+ if (!chunkZ5YGWL65_cjs.isDocker()) {
117
+ return /* @__PURE__ */ jsxRuntime.jsx(CodeServerNotSupported, {});
118
+ }
119
+ return /* @__PURE__ */ jsxRuntime.jsx(CodeServerAppInner, { ...props });
120
+ };
121
+ var CodeServerApp_default2 = CodeServerApp;
122
+
123
+ exports.CodeServerApp_default = CodeServerApp_default2;
@@ -0,0 +1,121 @@
1
+ import { isDocker } from './chunk-FRHBM2U7.js';
2
+ import { Center, Stack, Text } from './chunk-BQL3YXMV.js';
3
+ import { useState, useRef, useCallback, useEffect } from 'react';
4
+ import { FcInfo } from 'react-icons/fc';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ var CodeServerNotSupported = () => {
9
+ const { t } = useTranslation("apps");
10
+ return /* @__PURE__ */ jsx(Center, { "data-testid": "code-server-not-supported", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "lg", p: "xl", maw: 400, children: [
11
+ /* @__PURE__ */ jsx(Text, { size: "3rem", children: /* @__PURE__ */ jsx(FcInfo, {}) }),
12
+ /* @__PURE__ */ jsx(Text, { size: "lg", fw: 700, ta: "center", children: t("codeServer.notAvailable") }),
13
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.notAvailableMessage") }),
14
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.dockerRequired") })
15
+ ] }) });
16
+ };
17
+
18
+ // src/components/Apps/CodeServerApp/CodeServerApp.module.css
19
+ var CodeServerApp_default = {};
20
+ var CodeServerAppInner = ({ window, notifyReady }) => {
21
+ const win = window;
22
+ const [state, setState] = useState({
23
+ status: "idle",
24
+ url: null,
25
+ error: null
26
+ });
27
+ const hasNotifiedRef = useRef(false);
28
+ const startingRef = useRef(false);
29
+ const startCodeServer = useCallback(async () => {
30
+ if (startingRef.current) return;
31
+ startingRef.current = true;
32
+ setState((prev) => ({ ...prev, status: "starting", error: null }));
33
+ try {
34
+ const response = await fetch("/api/code-server/start", { method: "POST" });
35
+ const data = await response.json();
36
+ if (data.success && data.url) {
37
+ setState({
38
+ status: "running",
39
+ url: data.url,
40
+ error: null
41
+ });
42
+ } else {
43
+ setState({
44
+ status: "error",
45
+ url: null,
46
+ error: data.error || "Failed to start code-server"
47
+ });
48
+ }
49
+ } catch (err) {
50
+ setState({
51
+ status: "error",
52
+ url: null,
53
+ error: err instanceof Error ? err.message : "Failed to start code-server"
54
+ });
55
+ } finally {
56
+ startingRef.current = false;
57
+ }
58
+ }, []);
59
+ const stopCodeServer = useCallback(async () => {
60
+ try {
61
+ await fetch("/api/code-server/stop", { method: "POST" });
62
+ } catch (err) {
63
+ console.error("[CodeServerApp] Error stopping code-server:", err);
64
+ }
65
+ }, []);
66
+ useEffect(() => {
67
+ startCodeServer();
68
+ return () => {
69
+ stopCodeServer();
70
+ };
71
+ }, [startCodeServer, stopCodeServer]);
72
+ useEffect(() => {
73
+ if (!hasNotifiedRef.current && notifyReady) {
74
+ hasNotifiedRef.current = true;
75
+ notifyReady({
76
+ ...win?.contentData ?? {},
77
+ status: state.status,
78
+ restart: startCodeServer
79
+ });
80
+ }
81
+ }, [notifyReady, state.status, startCodeServer, win?.contentData]);
82
+ useEffect(() => {
83
+ if (hasNotifiedRef.current && notifyReady) {
84
+ notifyReady({
85
+ ...win?.contentData ?? {},
86
+ status: state.status
87
+ });
88
+ }
89
+ }, [state.status, notifyReady, win?.contentData]);
90
+ if (state.status === "idle" || state.status === "starting") {
91
+ return /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxs("div", { className: CodeServerApp_default.loading, children: [
92
+ /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.spinner }),
93
+ /* @__PURE__ */ jsx("p", { children: "Starting VS Code..." })
94
+ ] }) });
95
+ }
96
+ if (state.status === "error") {
97
+ return /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxs("div", { className: CodeServerApp_default.error, children: [
98
+ /* @__PURE__ */ jsx("h3", { children: "Failed to start VS Code" }),
99
+ /* @__PURE__ */ jsx("p", { children: state.error }),
100
+ /* @__PURE__ */ jsx("button", { onClick: startCodeServer, className: CodeServerApp_default.retryButton, children: "Retry" })
101
+ ] }) });
102
+ }
103
+ return /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsx(
104
+ "iframe",
105
+ {
106
+ src: state.url || "",
107
+ className: CodeServerApp_default.iframe,
108
+ title: "VS Code",
109
+ allow: "clipboard-read; clipboard-write"
110
+ }
111
+ ) });
112
+ };
113
+ var CodeServerApp = (props) => {
114
+ if (!isDocker()) {
115
+ return /* @__PURE__ */ jsx(CodeServerNotSupported, {});
116
+ }
117
+ return /* @__PURE__ */ jsx(CodeServerAppInner, { ...props });
118
+ };
119
+ var CodeServerApp_default2 = CodeServerApp;
120
+
121
+ export { CodeServerApp_default2 as CodeServerApp_default };
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var chunkZX3EDZ5C_cjs = require('./chunk-ZX3EDZ5C.cjs');
4
+ var chunkE55VXNLK_cjs = require('./chunk-E55VXNLK.cjs');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // src/components/Shared/ColorPicker/ColorPicker.module.css
8
+ var ColorPicker_default = {};
9
+ var ColorPicker = ({ value, onChange, error, disabled = false }) => {
10
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ColorPicker_default.root, children: [
11
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ColorPicker_default.colorRow, children: chunkZX3EDZ5C_cjs.PRESET_COLORS.map((color) => /* @__PURE__ */ jsxRuntime.jsx(
12
+ chunkE55VXNLK_cjs.UnstyledButton,
13
+ {
14
+ className: ColorPicker_default.colorSwatch,
15
+ "data-selected": value === color || void 0,
16
+ "data-disabled": disabled || void 0,
17
+ style: { background: color },
18
+ onClick: () => !disabled && onChange(color),
19
+ "aria-label": `Color ${color}`,
20
+ "aria-pressed": value === color,
21
+ disabled
22
+ },
23
+ color
24
+ )) }),
25
+ /* @__PURE__ */ jsxRuntime.jsx(
26
+ chunkE55VXNLK_cjs.ColorInput,
27
+ {
28
+ value,
29
+ onChange,
30
+ placeholder: "Custom color",
31
+ size: "xs",
32
+ className: ColorPicker_default.colorInput,
33
+ "aria-label": "Custom color picker",
34
+ error,
35
+ disabled
36
+ }
37
+ )
38
+ ] });
39
+ };
40
+ var ColorPicker_default2 = ColorPicker;
41
+
42
+ exports.ColorPicker_default = ColorPicker_default2;
@@ -0,0 +1,68 @@
1
+ import { appendDirtyIndicator } from './chunk-YAIWI4Z5.js';
2
+ import { AppMenuBar_default } from './chunk-4E45FBAH.js';
3
+ import { useIsDirty } from './chunk-D5MVFFID.js';
4
+ import { memo, useMemo } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var useMenuEditMenuBarElements = (options) => {
9
+ const { windowId, contentData, onExit } = options;
10
+ const { t } = useTranslation("menuedit");
11
+ const { t: tCommon } = useTranslation("common");
12
+ const isDirty = useIsDirty(windowId);
13
+ const createFolder = contentData?.createFolder;
14
+ const save = contentData?.save;
15
+ const discard = contentData?.discard;
16
+ return useMemo(() => {
17
+ const items = [
18
+ {
19
+ type: "menu",
20
+ label: tCommon("menu.file"),
21
+ items: [
22
+ {
23
+ type: "item",
24
+ label: t("newFolder"),
25
+ icon: "FcPlus",
26
+ onClick: () => createFolder?.()
27
+ },
28
+ { type: "divider" },
29
+ {
30
+ type: "item",
31
+ label: tCommon("actions.save"),
32
+ icon: "FcInspection",
33
+ onClick: () => save?.(),
34
+ disabled: !isDirty
35
+ },
36
+ {
37
+ type: "item",
38
+ label: tCommon("actions.discard"),
39
+ icon: "FcCancel",
40
+ onClick: () => discard?.(),
41
+ disabled: !isDirty
42
+ },
43
+ { type: "divider" },
44
+ {
45
+ type: "item",
46
+ label: tCommon("actions.exit"),
47
+ icon: "FcLeft",
48
+ onClick: onExit
49
+ }
50
+ ]
51
+ }
52
+ ];
53
+ return appendDirtyIndicator(items, isDirty);
54
+ }, [t, tCommon, isDirty, createFolder, save, discard, onExit]);
55
+ };
56
+ var MenuEditMenuBar = memo(
57
+ ({ windowId, contentData, onExit }) => {
58
+ const elements = useMenuEditMenuBarElements({
59
+ windowId,
60
+ contentData,
61
+ onExit
62
+ });
63
+ return /* @__PURE__ */ jsx(AppMenuBar_default, { elements });
64
+ }
65
+ );
66
+ MenuEditMenuBar.displayName = "MenuEditMenuBar";
67
+
68
+ export { MenuEditMenuBar };
@@ -0,0 +1,31 @@
1
+ import { create } from 'zustand';
2
+
3
+ // src/components/Apps/TerminalApp/terminalStore.ts
4
+ var DEFAULT_STATE = {
5
+ scrollback: 5e3,
6
+ shell: "/bin/zsh"
7
+ };
8
+ var useTerminalStore = create((set, get) => ({
9
+ states: {},
10
+ getScrollback: (id) => get().states[id]?.scrollback ?? DEFAULT_STATE.scrollback,
11
+ getShell: (id) => get().states[id]?.shell ?? DEFAULT_STATE.shell,
12
+ setScrollback: (id, scrollback) => set((s) => ({
13
+ states: {
14
+ ...s.states,
15
+ [id]: { ...s.states[id] ?? DEFAULT_STATE, scrollback }
16
+ }
17
+ })),
18
+ setShell: (id, shell) => set((s) => ({
19
+ states: {
20
+ ...s.states,
21
+ [id]: { ...s.states[id] ?? DEFAULT_STATE, shell }
22
+ }
23
+ })),
24
+ reset: (id) => set((s) => ({
25
+ states: { ...s.states, [id]: { ...DEFAULT_STATE } }
26
+ }))
27
+ }));
28
+ var useScrollback = (windowId) => useTerminalStore((s) => s.states[windowId]?.scrollback ?? DEFAULT_STATE.scrollback);
29
+ var useShell = (windowId) => useTerminalStore((s) => s.states[windowId]?.shell ?? DEFAULT_STATE.shell);
30
+
31
+ export { useScrollback, useShell, useTerminalStore };