@fde-desktop/fde-core 0.4.11 → 0.4.19

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 (132) hide show
  1. package/dist/{AppEmptyState-Boej96TB.js → AppEmptyState-BVfKZU-h.js} +1 -1
  2. package/dist/AppEmptyState-Z8_Cviti.cjs +1 -0
  3. package/dist/AppIcon-Czrtau6A.cjs +1 -0
  4. package/dist/{AppIcon-mtEoyzOb.js → AppIcon-aFNw89J2.js} +1 -1
  5. package/dist/AppMenuBar-38QtFTPk.cjs +1 -0
  6. package/dist/AppTempMemory-DAC62jiS.cjs +1 -0
  7. package/dist/AppTempMemory-DgUW6GaF.js +23 -0
  8. package/dist/CalendarApp-BYTyu089.js +9 -0
  9. package/dist/CalendarApp-DPOK4mqg.cjs +1 -0
  10. package/dist/{ColorPicker-WCeD3Wjf.js → ColorPicker-B76rCS2H.js} +1 -1
  11. package/dist/ColorPicker-BZqsPh3X.cjs +1 -0
  12. package/dist/CreateItemApp-B0IHL16b.cjs +1 -0
  13. package/dist/CreateItemApp-UUP2HAu2.js +149 -0
  14. package/dist/DeviceInfoApp-BPQyeVSd.js +162 -0
  15. package/dist/DeviceInfoApp-D2mS2OT-.cjs +1 -0
  16. package/dist/DownloadProgress-CpJguS8g.cjs +1 -0
  17. package/dist/FilePickerApp-ClmPw6lk.cjs +1 -0
  18. package/dist/{FilePickerApp-ClHuhm6Z.js → FilePickerApp-D7fERKbp.js} +1 -1
  19. package/dist/FilesApp-DhJbO8wg.js +191 -0
  20. package/dist/FilesApp-LbwRRR1i.cjs +1 -0
  21. package/dist/IconColorPicker-7rWNAiNQ.cjs +1 -0
  22. package/dist/IconColorPicker-DUIXSb5E.js +58 -0
  23. package/dist/ImageViewerApp-9T-V8uP5.cjs +1 -0
  24. package/dist/ImageViewerApp-ihqIwJ-L.js +68 -0
  25. package/dist/ImageViewerMenuBar-DmvZoZ03.cjs +1 -0
  26. package/dist/{ImageViewerMenuBar-BIsUokxV.js → ImageViewerMenuBar-ZeIKHdA-.js} +18 -19
  27. package/dist/MenuEditApp-DRKfmSIZ.js +361 -0
  28. package/dist/MenuEditApp-U7EqB5Rl.cjs +1 -0
  29. package/dist/MenuEditMenuBar-BE_cXaoG.cjs +1 -0
  30. package/dist/MenuEditMenuBar-Df1je7F6.js +59 -0
  31. package/dist/NotesApp-DZfNQ8mN.cjs +1 -0
  32. package/dist/NotesApp-rwAeXyJy.js +344 -0
  33. package/dist/{NotesMenuBar-DILZTjnT.js → NotesMenuBar-C503t5pu.js} +12 -13
  34. package/dist/NotesMenuBar-CwgZ9dHy.cjs +1 -0
  35. package/dist/PdfApp-DNZaSXbF.cjs +1 -0
  36. package/dist/PdfApp-K1Z612o3.js +38 -0
  37. package/dist/PdfMenuBar-BPzP_JUO.cjs +1 -0
  38. package/dist/PdfMenuBar-DEUKgKTE.js +38 -0
  39. package/dist/SettingsApp-DdWqiYFE.cjs +1 -0
  40. package/dist/SettingsApp-ghc3RaMv.js +875 -0
  41. package/dist/SettingsMenuBar-C4KAPoBs.js +41 -0
  42. package/dist/SettingsMenuBar-CgmaF9_B.cjs +1 -0
  43. package/dist/{UploaderApp-CbypD538.js → UploaderApp-D9vfOR0S.js} +28 -40
  44. package/dist/UploaderApp-omSY-NSn.cjs +1 -0
  45. package/dist/VscIcon-CeELixwP.cjs +1 -0
  46. package/dist/buildBreadcrumbs-C2c2a4R3.cjs +1 -0
  47. package/dist/desktopStore-LSQweOqZ.cjs +1 -0
  48. package/dist/{desktopStore-8cSZlj7s.js → desktopStore-xnNbYaYm.js} +263 -263
  49. package/dist/formatBytes-Bv1bQPKQ.cjs +1 -0
  50. package/dist/formatBytes-CaP80WnM.js +14 -0
  51. package/dist/i18nConstants-DgbKSBIK.cjs +1 -0
  52. package/dist/i18nConstants-Nzpf2IFp.js +611 -0
  53. package/dist/imageViewerStore-CYt4R4e4.cjs +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.css +1 -1
  56. package/dist/index.d.ts +50 -29
  57. package/dist/index.js +715 -658
  58. package/dist/menuEditStore-sU6qaF2j.cjs +1 -0
  59. package/dist/notesStore-BnMXBRaV.cjs +1 -0
  60. package/dist/settingsAppStore-CQ4JHd7Q.cjs +1 -0
  61. package/dist/useAdaptiveDimensions-BDZxP4E3.cjs +1 -0
  62. package/dist/{useAdaptiveDimensions-DxNLJ7R5.js → useAdaptiveDimensions-sv9lwqF_.js} +1 -1
  63. package/dist/useCloseInterceptor-AzfjUZgz.cjs +1 -0
  64. package/dist/{useCloseInterceptor-CIxhOZx1.js → useCloseInterceptor-Bwm4I0O8.js} +1 -1
  65. package/dist/useDeviceDetection-B9jjlate.js +37 -0
  66. package/dist/useDeviceDetection-CnxnQWIq.cjs +1 -0
  67. package/dist/useDragDrop-Bdwzk6VO.cjs +1 -0
  68. package/dist/useDragDrop-D2LtOEYC.js +139 -0
  69. package/dist/useDynamicIcon-Cg3B_Aeq.cjs +1 -0
  70. package/dist/useNotifications-CR9JLjtC.js +26 -0
  71. package/dist/useNotifications-rwLmJ7fI.cjs +1 -0
  72. package/dist/useOpenApp-BBZ_B7Pr.cjs +1 -0
  73. package/dist/{useOpenApp-DkZLFFCH.js → useOpenApp-DdEbOVby.js} +3 -3
  74. package/dist/useResolvedUrl-CgqjNxzw.js +389 -0
  75. package/dist/useResolvedUrl-Dz2AhrDV.cjs +1 -0
  76. package/package.json +1 -1
  77. package/dist/AppEmptyState-CLc00OOG.cjs +0 -1
  78. package/dist/AppIcon-C8vHUVcb.cjs +0 -1
  79. package/dist/AppMenuBar-CAlkNHjj.cjs +0 -1
  80. package/dist/CalendarApp-DOmjWbpl.js +0 -10
  81. package/dist/CalendarApp-Z0bCCYsK.cjs +0 -1
  82. package/dist/ColorPicker-CQRRwY-y.cjs +0 -1
  83. package/dist/CreateItemApp-BkFFFdX1.cjs +0 -1
  84. package/dist/CreateItemApp-DR8Y4bwo.js +0 -202
  85. package/dist/DeviceInfoApp-BXQ9uOwF.cjs +0 -1
  86. package/dist/DeviceInfoApp-I63mJRWy.js +0 -195
  87. package/dist/DownloadProgress-CkTGTf0z.cjs +0 -1
  88. package/dist/FilePickerApp-By6-vbag.cjs +0 -1
  89. package/dist/FilesApp-BC4UPNuw.cjs +0 -1
  90. package/dist/FilesApp-D8MqvC5X.js +0 -210
  91. package/dist/ImageViewerApp-B1niWF75.cjs +0 -1
  92. package/dist/ImageViewerApp-iojtyFEf.js +0 -69
  93. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +0 -1
  94. package/dist/MenuEditApp-BHptoJbz.cjs +0 -1
  95. package/dist/MenuEditApp-CJUbJaqh.js +0 -492
  96. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +0 -1
  97. package/dist/MenuEditMenuBar-DnCL-kaZ.js +0 -60
  98. package/dist/NotesApp-BmQIBtJ2.cjs +0 -1
  99. package/dist/NotesApp-DJ2dGt4-.js +0 -364
  100. package/dist/NotesMenuBar-BzojwMtH.cjs +0 -1
  101. package/dist/PdfApp-IjY_GtnW.js +0 -39
  102. package/dist/PdfApp-krW8UI97.cjs +0 -1
  103. package/dist/PdfMenuBar-Bd5MTZcZ.js +0 -39
  104. package/dist/PdfMenuBar-DWD0Qa3F.cjs +0 -1
  105. package/dist/SettingsApp-BE22l5UP.cjs +0 -1
  106. package/dist/SettingsApp-BTFtTFY_.js +0 -1228
  107. package/dist/SettingsMenuBar-CZE2evG2.cjs +0 -1
  108. package/dist/SettingsMenuBar-ktC0viTd.js +0 -42
  109. package/dist/UploaderApp-D_qD3O70.cjs +0 -1
  110. package/dist/VscIcon-BYb_Soyy.cjs +0 -1
  111. package/dist/buildBreadcrumbs-Ccd8i11b.cjs +0 -1
  112. package/dist/desktopStore-C1jR6Fdb.cjs +0 -1
  113. package/dist/imageViewerStore-Dfylg59V.cjs +0 -1
  114. package/dist/menuEditStore-CYwtfD6H.cjs +0 -1
  115. package/dist/notesStore-CrWTO6oB.cjs +0 -1
  116. package/dist/rolldown-runtime-CAFD8bLK.js +0 -11
  117. package/dist/settingsAppStore-DuYZNeFf.cjs +0 -1
  118. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +0 -1
  119. package/dist/useCloseInterceptor-CdX-09Ib.cjs +0 -1
  120. package/dist/useDynamicIcon-CK6SjEv5.cjs +0 -1
  121. package/dist/useOpenApp-D-FOY88T.cjs +0 -1
  122. package/dist/useResolvedUrl-B6x4xy0x.js +0 -29
  123. package/dist/useResolvedUrl-Bb39DpVy.cjs +0 -1
  124. /package/dist/{Colors-CuABn2W4.js → Colors-BIj4g0eH.js} +0 -0
  125. /package/dist/{Colors-CNJbU7oq.cjs → Colors-PNt4eyR6.cjs} +0 -0
  126. /package/dist/{DownloadProgress-DnVASsv5.js → DownloadProgress-DBFA58C5.js} +0 -0
  127. /package/dist/{imageViewerStore-COrD02Zu.js → imageViewerStore-C6UgceP-.js} +0 -0
  128. /package/dist/{menuEditStore-CxsgLiQu.js → menuEditStore-DPqViGva.js} +0 -0
  129. /package/dist/{notesStore-Dgah46U5.js → notesStore-KZDXN6zx.js} +0 -0
  130. /package/dist/{settingsAppStore-DHZhi6Rl.js → settingsAppStore-Y7x3r6pV.js} +0 -0
  131. /package/dist/{useMenuBarUtils-DAap0ukp.cjs → useMenuBarUtils-BOnQYtKU.cjs} +0 -0
  132. /package/dist/{useMenuBarUtils-ChAfI7OA.js → useMenuBarUtils-DTPFK0IN.js} +0 -0
@@ -0,0 +1,58 @@
1
+ import { t as e } from "./VscIcon-AEENjKOE.js";
2
+ import { t } from "./ColorPicker-B76rCS2H.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { SimpleGrid as i, Tooltip as a, UnstyledButton as o } from "@mantine/core";
5
+ var s = {
6
+ root: "_root_1jzye_1",
7
+ iconGrid: "_iconGrid_1jzye_7",
8
+ iconButton: "_iconButton_1jzye_11"
9
+ }, c = [
10
+ "VscFolder",
11
+ "VscFolderOpened",
12
+ "VscHome",
13
+ "VscServer",
14
+ "VscDatabase",
15
+ "VscBook",
16
+ "VscMail",
17
+ "VscGithub",
18
+ "VscCloud",
19
+ "VscLock",
20
+ "VscSettingsGear",
21
+ "VscStarFull",
22
+ "VscHeart",
23
+ "VscMusic",
24
+ "VscDeviceCamera",
25
+ "VscArchive"
26
+ ], l = ({ selectedIcon: l, selectedColor: u, onIconChange: d, onColorChange: f, colorError: p }) => /* @__PURE__ */ r("div", {
27
+ className: s.root,
28
+ children: [/* @__PURE__ */ n(i, {
29
+ cols: 8,
30
+ spacing: 4,
31
+ className: s.iconGrid,
32
+ children: c.map((t) => {
33
+ let r = l === t;
34
+ return /* @__PURE__ */ n(a, {
35
+ label: t,
36
+ openDelay: 500,
37
+ children: /* @__PURE__ */ n(o, {
38
+ className: s.iconButton,
39
+ "data-selected": r || void 0,
40
+ onClick: () => d(t),
41
+ "aria-label": t,
42
+ "aria-pressed": r,
43
+ children: /* @__PURE__ */ n(e, {
44
+ name: t,
45
+ size: 20,
46
+ color: u
47
+ })
48
+ })
49
+ }, t);
50
+ })
51
+ }), /* @__PURE__ */ n(t, {
52
+ value: u,
53
+ onChange: f,
54
+ error: p
55
+ })]
56
+ });
57
+ //#endregion
58
+ export { c as n, l as t };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./useResolvedUrl-Dz2AhrDV.cjs`),t=require(`./desktopStore-LSQweOqZ.cjs`),n=require(`./AppEmptyState-Z8_Cviti.cjs`),r=require(`./FilePickerApp-ClmPw6lk.cjs`),i=require(`./imageViewerStore-CYt4R4e4.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`),s=require(`react-i18next`);var c={container:`_container_1btg4_1`,image:`_image_1btg4_12`,placeholder:`_placeholder_1btg4_19`},l=[...t.y,`image/*`],u=({window:t,notifyReady:u})=>{let{t:d}=(0,s.useTranslation)(`apps`),f=t,p=f?.id??``,m=f?.contentData?.src,[h,g]=(0,a.useState)(m),[_,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),x=(0,a.useRef)(null),S=i.r(e=>e.getDisplayZoom(p)),C=i.r(e=>e.getFitToWindow(p)),w=i.r(e=>e.updateCalculatedZoom),T=i.r(e=>e.reset),E=e.t(h);(0,a.useEffect)(()=>{T(p)},[p,T]),(0,a.useEffect)(()=>{if(!C||!y||!x.current)return;let e=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;w(p,y,{width:e,height:n})}});return e.observe(x.current),()=>e.disconnect()},[C,y,p,w]),(0,a.useEffect)(()=>{u?.({...f?.contentData??{},setPickerOpen:()=>v(!0)})},[f,u]);let D=(0,a.useCallback)(e=>{g(e.url??e.name),v(!1),T(p),b(null)},[p,T]),O=(0,a.useCallback)(e=>{let t=e.currentTarget;b({width:t.naturalWidth,height:t.naturalHeight})},[]),k=C?void 0:{transform:`scale(${S/100})`},A=E?(0,o.jsx)(`img`,{src:E,alt:E.split(`/`).pop()??`image`,className:c.image,style:k,onLoad:O}):(0,o.jsx)(n.t,{label:d(`imageViewer.noImage`)});return(0,o.jsxs)(`div`,{ref:x,className:c.container,"data-windowid":f?.id,children:[A,(0,o.jsx)(r.n,{opened:_,acceptedMimeTypes:l,onConfirm:D,onCancel:()=>v(!1)})]})};exports.default=u;
@@ -0,0 +1,68 @@
1
+ import { t as e } from "./useResolvedUrl-CgqjNxzw.js";
2
+ import { y as t } from "./desktopStore-xnNbYaYm.js";
3
+ import { t as n } from "./AppEmptyState-BVfKZU-h.js";
4
+ import { n as r } from "./FilePickerApp-D7fERKbp.js";
5
+ import { r as i } from "./imageViewerStore-C6UgceP-.js";
6
+ import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { useTranslation as d } from "react-i18next";
9
+ var f = {
10
+ container: "_container_1btg4_1",
11
+ image: "_image_1btg4_12",
12
+ placeholder: "_placeholder_1btg4_19"
13
+ }, p = [...t, "image/*"], m = ({ window: t, notifyReady: m }) => {
14
+ let { t: h } = d("apps"), g = t, _ = g?.id ?? "", v = g?.contentData?.src, [y, b] = c(v), [x, S] = c(!1), [C, w] = c(null), T = s(null), E = i((e) => e.getDisplayZoom(_)), D = i((e) => e.getFitToWindow(_)), O = i((e) => e.updateCalculatedZoom), k = i((e) => e.reset), A = e(y);
15
+ o(() => {
16
+ k(_);
17
+ }, [_, k]), o(() => {
18
+ if (!D || !C || !T.current) return;
19
+ let e = new ResizeObserver((e) => {
20
+ for (let t of e) {
21
+ let { width: e, height: n } = t.contentRect;
22
+ O(_, C, {
23
+ width: e,
24
+ height: n
25
+ });
26
+ }
27
+ });
28
+ return e.observe(T.current), () => e.disconnect();
29
+ }, [
30
+ D,
31
+ C,
32
+ _,
33
+ O
34
+ ]), o(() => {
35
+ m?.({
36
+ ...g?.contentData ?? {},
37
+ setPickerOpen: () => S(!0)
38
+ });
39
+ }, [g, m]);
40
+ let j = a((e) => {
41
+ b(e.url ?? e.name), S(!1), k(_), w(null);
42
+ }, [_, k]), M = a((e) => {
43
+ let t = e.currentTarget;
44
+ w({
45
+ width: t.naturalWidth,
46
+ height: t.naturalHeight
47
+ });
48
+ }, []), N = D ? void 0 : { transform: `scale(${E / 100})` }, P = A ? /* @__PURE__ */ l("img", {
49
+ src: A,
50
+ alt: A.split("/").pop() ?? "image",
51
+ className: f.image,
52
+ style: N,
53
+ onLoad: M
54
+ }) : /* @__PURE__ */ l(n, { label: h("imageViewer.noImage") });
55
+ return /* @__PURE__ */ u("div", {
56
+ ref: T,
57
+ className: f.container,
58
+ "data-windowid": g?.id,
59
+ children: [P, /* @__PURE__ */ l(r, {
60
+ opened: x,
61
+ acceptedMimeTypes: p,
62
+ onConfirm: j,
63
+ onCancel: () => S(!1)
64
+ })]
65
+ });
66
+ };
67
+ //#endregion
68
+ export { m as default };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./AppMenuBar-38QtFTPk.cjs`),t=require(`./imageViewerStore-CYt4R4e4.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`react-i18next`);var a=[{value:25,label:`25%`},{value:50,label:`50%`},{value:75,label:`75%`},{value:100,label:`100%`},{value:200,label:`200%`}],o=e=>{let{windowId:r,onOpenPicker:o,onExit:s}=e,{t:c}=(0,i.useTranslation)(`common`),{t:l}=(0,i.useTranslation)(`apps`),u=t.t(r),d=t.n(r),f=t.r(e=>e.setUserZoom),p=t.r(e=>e.setFitToWindow),m=(0,n.useCallback)(e=>p(r,e),[r,p]),h=(0,n.useCallback)(e=>f(r,e),[r,f]);return(0,n.useMemo)(()=>{let e=`${l(`imageViewer.zoom`)}: ${u}%`;return[{type:`menu`,label:c(`menu.file`),items:[{type:`item`,label:c(`actions.open`),icon:`FcOpenedFolder`,onClick:o??(()=>{})},{type:`divider`},{type:`item`,label:c(`actions.exit`),icon:`FcLeft`,onClick:s}]},{type:`switch`,label:l(`imageViewer.fitToWindow`),checked:d,onChange:m},{type:`slider`,label:e,min:10,max:200,value:u,onChange:h,marks:a,labelFormat:e=>`${e}%`}]},[c,l,o,s,u,d,m,h])},s=(0,n.memo)(({windowId:t,contentData:n,onExit:i})=>(0,r.jsx)(e.t,{elements:o({windowId:t,onOpenPicker:n?.setPickerOpen,onExit:i})}));s.displayName=`ImageViewerMenuBar`,exports.ImageViewerMenuBar=s;
@@ -1,11 +1,10 @@
1
- import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./AppMenuBar-DmSfQRXU.js";
3
- import { n, r, t as i } from "./imageViewerStore-COrD02Zu.js";
4
- import { memo as a, useCallback as o, useMemo as s } from "react";
5
- import { jsx as c } from "react/jsx-runtime";
6
- import { useTranslation as l } from "react-i18next";
1
+ import { t as e } from "./AppMenuBar-DmSfQRXU.js";
2
+ import { n as t, r as n, t as r } from "./imageViewerStore-C6UgceP-.js";
3
+ import { memo as i, useCallback as a, useMemo as o } from "react";
4
+ import { jsx as s } from "react/jsx-runtime";
5
+ import { useTranslation as c } from "react-i18next";
7
6
  //#region src/components/Apps/ImageViewerApp/useImageViewerMenuBar.ts
8
- var u = [
7
+ var l = [
9
8
  {
10
9
  value: 25,
11
10
  label: "25%"
@@ -26,9 +25,9 @@ var u = [
26
25
  value: 200,
27
26
  label: "200%"
28
27
  }
29
- ], d = (e) => {
30
- let { windowId: t, onOpenPicker: a, onExit: c } = e, { t: d } = l("common"), { t: f } = l("apps"), p = i(t), m = n(t), h = r((e) => e.setUserZoom), g = r((e) => e.setFitToWindow), _ = o((e) => g(t, e), [t, g]), v = o((e) => h(t, e), [t, h]);
31
- return s(() => {
28
+ ], u = (e) => {
29
+ let { windowId: i, onOpenPicker: s, onExit: u } = e, { t: d } = c("common"), { t: f } = c("apps"), p = r(i), m = t(i), h = n((e) => e.setUserZoom), g = n((e) => e.setFitToWindow), _ = a((e) => g(i, e), [i, g]), v = a((e) => h(i, e), [i, h]);
30
+ return o(() => {
32
31
  let e = `${f("imageViewer.zoom")}: ${p}%`;
33
32
  return [
34
33
  {
@@ -39,14 +38,14 @@ var u = [
39
38
  type: "item",
40
39
  label: d("actions.open"),
41
40
  icon: "FcOpenedFolder",
42
- onClick: a ?? (() => {})
41
+ onClick: s ?? (() => {})
43
42
  },
44
43
  { type: "divider" },
45
44
  {
46
45
  type: "item",
47
46
  label: d("actions.exit"),
48
47
  icon: "FcLeft",
49
- onClick: c
48
+ onClick: u
50
49
  }
51
50
  ]
52
51
  },
@@ -63,25 +62,25 @@ var u = [
63
62
  max: 200,
64
63
  value: p,
65
64
  onChange: v,
66
- marks: u,
65
+ marks: l,
67
66
  labelFormat: (e) => `${e}%`
68
67
  }
69
68
  ];
70
69
  }, [
71
70
  d,
72
71
  f,
73
- a,
74
- c,
72
+ s,
73
+ u,
75
74
  p,
76
75
  m,
77
76
  _,
78
77
  v
79
78
  ]);
80
- }, f = /* @__PURE__ */ e({ ImageViewerMenuBar: () => p }), p = a(({ windowId: e, contentData: n, onExit: r }) => /* @__PURE__ */ c(t, { elements: d({
81
- windowId: e,
79
+ }, d = i(({ windowId: t, contentData: n, onExit: r }) => /* @__PURE__ */ s(e, { elements: u({
80
+ windowId: t,
82
81
  onOpenPicker: n?.setPickerOpen,
83
82
  onExit: r
84
83
  }) }));
85
- p.displayName = "ImageViewerMenuBar";
84
+ d.displayName = "ImageViewerMenuBar";
86
85
  //#endregion
87
- export { f as n, p as t };
86
+ export { d as ImageViewerMenuBar };
@@ -0,0 +1,361 @@
1
+ import { G as e, ct as t, o as n } from "./desktopStore-xnNbYaYm.js";
2
+ import { a as r, i, n as a, o, r as s, s as c, t as l } from "./useDragDrop-D2LtOEYC.js";
3
+ import { t as u } from "./AppIcon-aFNw89J2.js";
4
+ import { i as d } from "./useCloseInterceptor-Bwm4I0O8.js";
5
+ import { t as f } from "./VscIcon-AEENjKOE.js";
6
+ import { n as p } from "./menuEditStore-DPqViGva.js";
7
+ import { useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
8
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
9
+ import { ActionIcon as b, Box as x, Card as S, Group as C, Text as w, TextInput as T, UnstyledButton as E } from "@mantine/core";
10
+ import { useTranslation as D } from "react-i18next";
11
+ var O = {
12
+ container: "_container_y9c6e_1",
13
+ content: "_content_y9c6e_7",
14
+ folderList: "_folderList_y9c6e_13",
15
+ folderCard: "_folderCard_y9c6e_19",
16
+ folderHeader: "_folderHeader_y9c6e_28",
17
+ appList: "_appList_y9c6e_40",
18
+ availableApps: "_availableApps_y9c6e_49",
19
+ appGrid: "_appGrid_y9c6e_58",
20
+ appItem: "_appItem_y9c6e_64"
21
+ }, k = ({ folder: e, isEditing: n, editingName: r, onEdit: a, onDelete: o, onRename: d, onSetEditingName: p, onRemoveApp: m }) => {
22
+ let { t: h } = D("menuedit"), g = c(e), { activeItem: _ } = s(), { setNodeRef: E, isOver: k } = i({ target: {
23
+ type: "launcher-folder",
24
+ id: e.id,
25
+ name: g,
26
+ accepts: l["launcher-folder"]
27
+ } });
28
+ return /* @__PURE__ */ y(S, {
29
+ ref: E,
30
+ className: O.folderCard,
31
+ shadow: "xs",
32
+ padding: "xs",
33
+ "data-is-over": k && _?.type === "app" ? "true" : void 0,
34
+ children: [/* @__PURE__ */ y(C, {
35
+ justify: "space-between",
36
+ mb: 4,
37
+ children: [n ? /* @__PURE__ */ v(T, {
38
+ value: r,
39
+ onChange: (e) => p(e.target.value),
40
+ onBlur: () => d(e.id),
41
+ onKeyDown: (t) => {
42
+ t.key === "Enter" && (t.preventDefault(), d(e.id));
43
+ },
44
+ autoFocus: !0,
45
+ size: "xs",
46
+ style: { flex: 1 }
47
+ }) : /* @__PURE__ */ y(C, {
48
+ gap: "xs",
49
+ children: [
50
+ /* @__PURE__ */ v(u, {
51
+ fcIcon: e.fcIcon,
52
+ size: 16
53
+ }),
54
+ /* @__PURE__ */ v(w, {
55
+ size: "sm",
56
+ fw: 500,
57
+ children: g
58
+ }),
59
+ e.isPredefined && /* @__PURE__ */ y(w, {
60
+ size: "xs",
61
+ c: "dimmed",
62
+ children: [
63
+ "(",
64
+ h("predefined"),
65
+ ")"
66
+ ]
67
+ })
68
+ ]
69
+ }), !e.isPredefined && !n && /* @__PURE__ */ y(C, {
70
+ gap: 4,
71
+ children: [/* @__PURE__ */ v(b, {
72
+ variant: "subtle",
73
+ size: "xs",
74
+ onClick: () => a(e.id),
75
+ "aria-label": h("rename"),
76
+ children: /* @__PURE__ */ v(f, {
77
+ name: "VscEdit",
78
+ size: 14
79
+ })
80
+ }), o && /* @__PURE__ */ v(b, {
81
+ variant: "subtle",
82
+ size: "xs",
83
+ color: "red",
84
+ onClick: () => o(e.id),
85
+ "aria-label": h("delete"),
86
+ children: /* @__PURE__ */ v(f, {
87
+ name: "VscTrash",
88
+ size: 14
89
+ })
90
+ })]
91
+ })]
92
+ }), /* @__PURE__ */ v(x, {
93
+ className: O.appList,
94
+ children: e.appIds.map((n) => {
95
+ let r = t.find((e) => e.id === n);
96
+ return r ? /* @__PURE__ */ v(A, {
97
+ app: r,
98
+ sourceId: e.id,
99
+ onContextMenu: (t) => {
100
+ t.preventDefault(), t.stopPropagation(), m(n, e.id);
101
+ }
102
+ }, n) : null;
103
+ })
104
+ })]
105
+ });
106
+ }, A = ({ app: e, sourceId: t, onContextMenu: n }) => {
107
+ let { attributes: i, listeners: a, setNodeRef: o, isDragging: s, style: c } = r({ item: {
108
+ type: "app",
109
+ id: e.id,
110
+ name: e.name,
111
+ sourceId: t,
112
+ sourceType: "launcher-folder",
113
+ metadata: {
114
+ fcIcon: e.fcIcon,
115
+ iconUrl: e.iconUrl,
116
+ icon: e.icon
117
+ }
118
+ } });
119
+ return /* @__PURE__ */ y(E, {
120
+ ref: o,
121
+ className: O.appItem,
122
+ style: {
123
+ ...c,
124
+ opacity: s ? .5 : 1
125
+ },
126
+ onContextMenu: n,
127
+ ...i,
128
+ ...a,
129
+ children: [/* @__PURE__ */ v(u, {
130
+ fcIcon: e.fcIcon,
131
+ iconUrl: e.iconUrl,
132
+ fallback: e.icon,
133
+ size: 16
134
+ }), /* @__PURE__ */ v(w, {
135
+ size: "xs",
136
+ children: e.name
137
+ })]
138
+ });
139
+ }, j = ({ customFolderId: e }) => {
140
+ let { t: r } = D("menuedit"), { activeItem: a } = s(), { setNodeRef: o, isOver: c } = i({ target: {
141
+ type: "available-apps",
142
+ id: "available-apps",
143
+ name: "Available Apps",
144
+ accepts: l["available-apps"]
145
+ } }), u = new Set(n.getState().launcherFolders.flatMap((e) => e.appIds)), d = t.filter((e) => e.id !== "settings" && e.id !== "menuedit"), f = n((e) => e.addAppToFolder);
146
+ return /* @__PURE__ */ y(x, {
147
+ ref: o,
148
+ className: O.availableApps,
149
+ "data-is-over": c && a?.type === "app" ? "true" : void 0,
150
+ children: [
151
+ /* @__PURE__ */ v(w, {
152
+ size: "xs",
153
+ c: "dimmed",
154
+ mb: 8,
155
+ children: r("availableApps")
156
+ }),
157
+ e === null && /* @__PURE__ */ v(w, {
158
+ size: "xs",
159
+ c: "orange",
160
+ mb: 4,
161
+ children: r("canCreateNewFolder")
162
+ }),
163
+ /* @__PURE__ */ v(x, {
164
+ className: O.appGrid,
165
+ children: d.filter((e) => !u.has(e.id)).map((t) => /* @__PURE__ */ v(M, {
166
+ app: t,
167
+ targetFolderId: e,
168
+ onAdd: f
169
+ }, t.id))
170
+ })
171
+ ]
172
+ });
173
+ }, M = ({ app: e, targetFolderId: t, onAdd: n }) => {
174
+ let { attributes: i, listeners: a, setNodeRef: o, isDragging: s, style: c } = r({ item: {
175
+ type: "app",
176
+ id: e.id,
177
+ name: e.name,
178
+ sourceId: "available-apps",
179
+ sourceType: "available-apps",
180
+ metadata: {
181
+ fcIcon: e.fcIcon,
182
+ iconUrl: e.iconUrl,
183
+ icon: e.icon
184
+ }
185
+ } }), l = () => {
186
+ t && n(e.id, t);
187
+ };
188
+ return /* @__PURE__ */ y(E, {
189
+ ref: o,
190
+ className: O.appItem,
191
+ style: {
192
+ ...c,
193
+ opacity: s ? 0 : 1
194
+ },
195
+ onClick: l,
196
+ disabled: !t,
197
+ ...i,
198
+ ...a,
199
+ children: [/* @__PURE__ */ v(u, {
200
+ fcIcon: e.fcIcon,
201
+ iconUrl: e.iconUrl,
202
+ fallback: e.icon,
203
+ size: 16
204
+ }), /* @__PURE__ */ v(w, {
205
+ size: "xs",
206
+ children: e.name
207
+ })]
208
+ });
209
+ }, N = ({ window: t, notifyReady: r }) => {
210
+ let { t: i } = D("menuedit"), a = t?.id, o = n((e) => e.launcherFolders), s = n((e) => e.setLauncherFolders), c = n((e) => e.createLauncherFolder), l = n((e) => e.updateLauncherFolder), u = n((e) => e.deleteLauncherFolder), S = n((e) => e.removeAppFromFolder), [T, E] = _(null), [A, M] = _(""), N = g(!1);
211
+ h(() => {
212
+ a && (N.current || (N.current = !0, p.getState().reset(a)));
213
+ }, [a]), h(() => {
214
+ if (!a) return;
215
+ let e = p.getState();
216
+ if (e.getSnapshot(a) === null) e.takeSnapshot(a, o);
217
+ else {
218
+ let t = e.getSnapshot(a);
219
+ if (t) {
220
+ let n = JSON.stringify(o) !== JSON.stringify(t);
221
+ e.setIsDirty(a, n);
222
+ }
223
+ }
224
+ }, [a, o]);
225
+ let P = m(() => {
226
+ a && p.getState().takeSnapshot(a, o);
227
+ }, [a, o]), F = m(() => {
228
+ if (!a) return;
229
+ let e = p.getState().getSnapshot(a);
230
+ e && s(e);
231
+ }, [a, s]);
232
+ d({
233
+ isDirtyGetter: m(() => {
234
+ if (!a) return !1;
235
+ let e = p.getState().getSnapshot(a);
236
+ return JSON.stringify(o) !== JSON.stringify(e ?? []);
237
+ }, [a, o]),
238
+ windowId: t?.id,
239
+ onDiscard: F,
240
+ onSave: P
241
+ });
242
+ let I = m(() => {
243
+ let e = c({
244
+ name: i("newFolder"),
245
+ fcIcon: "VscFolder",
246
+ order: o.length
247
+ });
248
+ E(e.id), M(e.name);
249
+ }, [
250
+ c,
251
+ o.length,
252
+ i
253
+ ]);
254
+ h(() => {
255
+ r?.({
256
+ createFolder: I,
257
+ save: P,
258
+ discard: F
259
+ });
260
+ }, [
261
+ I,
262
+ P,
263
+ F,
264
+ r
265
+ ]);
266
+ let L = m((e) => {
267
+ let t = o.find((t) => t.id === e);
268
+ t && (E(t.id), M(t.name));
269
+ }, [o]), R = m((e) => {
270
+ A.trim() && l(e, { name: A.trim() }), E(null);
271
+ }, [A, l]), z = e(), B = o.filter((e) => e.isPredefined), V = o.filter((e) => !e.isPredefined), H = V.length > 0 ? V[0].id : null;
272
+ return /* @__PURE__ */ v(x, {
273
+ className: O.container,
274
+ "data-windowid": t?.id,
275
+ "data-menuedit-container": !0,
276
+ children: /* @__PURE__ */ y(x, {
277
+ className: O.content,
278
+ children: [
279
+ B.length > 0 && /* @__PURE__ */ y(x, {
280
+ mb: "md",
281
+ children: [/* @__PURE__ */ v(w, {
282
+ size: "xs",
283
+ c: "dimmed",
284
+ mb: 8,
285
+ children: i("predefinedFolders")
286
+ }), /* @__PURE__ */ v(x, {
287
+ className: O.folderList,
288
+ children: B.map((e) => /* @__PURE__ */ v(k, {
289
+ folder: e,
290
+ isEditing: !1,
291
+ editingName: "",
292
+ onEdit: () => {},
293
+ onRemoveApp: S,
294
+ onRename: () => {},
295
+ onSetEditingName: () => {}
296
+ }, e.id))
297
+ })]
298
+ }),
299
+ z && V.length > 0 && /* @__PURE__ */ y(x, {
300
+ mb: "md",
301
+ children: [/* @__PURE__ */ v(w, {
302
+ size: "xs",
303
+ c: "dimmed",
304
+ mb: 8,
305
+ children: i("customFolders")
306
+ }), /* @__PURE__ */ v(x, {
307
+ className: O.folderList,
308
+ children: V.map((e) => /* @__PURE__ */ v(k, {
309
+ folder: e,
310
+ isEditing: T === e.id,
311
+ editingName: A,
312
+ onEdit: L,
313
+ onDelete: u,
314
+ onRename: R,
315
+ onSetEditingName: M,
316
+ onRemoveApp: S
317
+ }, e.id))
318
+ })]
319
+ }),
320
+ /* @__PURE__ */ y(C, {
321
+ justify: "space-between",
322
+ mb: "md",
323
+ children: [
324
+ /* @__PURE__ */ v(j, { customFolderId: H }),
325
+ /* @__PURE__ */ v(w, {
326
+ size: "xs",
327
+ c: "dimmed",
328
+ mt: "md",
329
+ children: i("instructions")
330
+ }),
331
+ z && /* @__PURE__ */ v(b, {
332
+ variant: "light",
333
+ onClick: I,
334
+ "aria-label": i("addFolder"),
335
+ children: /* @__PURE__ */ v(f, {
336
+ name: "VscAdd",
337
+ size: 16
338
+ })
339
+ })
340
+ ]
341
+ })
342
+ ]
343
+ })
344
+ });
345
+ }, P = (e) => {
346
+ let t = n((e) => e.addAppToFolder), r = n((e) => e.removeAppFromFolder);
347
+ return /* @__PURE__ */ y(o, {
348
+ onDrop: m((e, n) => {
349
+ if (e.type === "app") {
350
+ if (n.type === "available-apps") {
351
+ e.sourceType === "launcher-folder" && r(e.id, e.sourceId);
352
+ return;
353
+ }
354
+ n.type === "launcher-folder" && (e.sourceId !== n.id && e.sourceType === "launcher-folder" && r(e.id, e.sourceId), t(e.id, n.id));
355
+ }
356
+ }, [t, r]),
357
+ children: [/* @__PURE__ */ v(N, { ...e }), /* @__PURE__ */ v(a, {})]
358
+ });
359
+ };
360
+ //#endregion
361
+ export { P as default };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./desktopStore-LSQweOqZ.cjs`),t=require(`./useDragDrop-Bdwzk6VO.cjs`),n=require(`./AppIcon-Czrtau6A.cjs`),r=require(`./useCloseInterceptor-AzfjUZgz.cjs`),i=require(`./VscIcon-CeELixwP.cjs`),a=require(`./menuEditStore-sU6qaF2j.cjs`);let o=require(`react`),s=require(`react/jsx-runtime`),c=require(`@mantine/core`),l=require(`react-i18next`);var u={container:`_container_y9c6e_1`,content:`_content_y9c6e_7`,folderList:`_folderList_y9c6e_13`,folderCard:`_folderCard_y9c6e_19`,folderHeader:`_folderHeader_y9c6e_28`,appList:`_appList_y9c6e_40`,availableApps:`_availableApps_y9c6e_49`,appGrid:`_appGrid_y9c6e_58`,appItem:`_appItem_y9c6e_64`},d=({folder:r,isEditing:a,editingName:o,onEdit:d,onDelete:p,onRename:m,onSetEditingName:h,onRemoveApp:g})=>{let{t:_}=(0,l.useTranslation)(`menuedit`),v=t.s(r),{activeItem:y}=t.r(),{setNodeRef:b,isOver:x}=t.i({target:{type:`launcher-folder`,id:r.id,name:v,accepts:t.t[`launcher-folder`]}});return(0,s.jsxs)(c.Card,{ref:b,className:u.folderCard,shadow:`xs`,padding:`xs`,"data-is-over":x&&y?.type===`app`?`true`:void 0,children:[(0,s.jsxs)(c.Group,{justify:`space-between`,mb:4,children:[a?(0,s.jsx)(c.TextInput,{value:o,onChange:e=>h(e.target.value),onBlur:()=>m(r.id),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m(r.id))},autoFocus:!0,size:`xs`,style:{flex:1}}):(0,s.jsxs)(c.Group,{gap:`xs`,children:[(0,s.jsx)(n.t,{fcIcon:r.fcIcon,size:16}),(0,s.jsx)(c.Text,{size:`sm`,fw:500,children:v}),r.isPredefined&&(0,s.jsxs)(c.Text,{size:`xs`,c:`dimmed`,children:[`(`,_(`predefined`),`)`]})]}),!r.isPredefined&&!a&&(0,s.jsxs)(c.Group,{gap:4,children:[(0,s.jsx)(c.ActionIcon,{variant:`subtle`,size:`xs`,onClick:()=>d(r.id),"aria-label":_(`rename`),children:(0,s.jsx)(i.t,{name:`VscEdit`,size:14})}),p&&(0,s.jsx)(c.ActionIcon,{variant:`subtle`,size:`xs`,color:`red`,onClick:()=>p(r.id),"aria-label":_(`delete`),children:(0,s.jsx)(i.t,{name:`VscTrash`,size:14})})]})]}),(0,s.jsx)(c.Box,{className:u.appList,children:r.appIds.map(t=>{let n=e.st.find(e=>e.id===t);return n?(0,s.jsx)(f,{app:n,sourceId:r.id,onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),g(t,r.id)}},t):null})})]})},f=({app:e,sourceId:r,onContextMenu:i})=>{let{attributes:a,listeners:o,setNodeRef:l,isDragging:d,style:f}=t.a({item:{type:`app`,id:e.id,name:e.name,sourceId:r,sourceType:`launcher-folder`,metadata:{fcIcon:e.fcIcon,iconUrl:e.iconUrl,icon:e.icon}}});return(0,s.jsxs)(c.UnstyledButton,{ref:l,className:u.appItem,style:{...f,opacity:d?.5:1},onContextMenu:i,...a,...o,children:[(0,s.jsx)(n.t,{fcIcon:e.fcIcon,iconUrl:e.iconUrl,fallback:e.icon,size:16}),(0,s.jsx)(c.Text,{size:`xs`,children:e.name})]})},p=({customFolderId:n})=>{let{t:r}=(0,l.useTranslation)(`menuedit`),{activeItem:i}=t.r(),{setNodeRef:a,isOver:o}=t.i({target:{type:`available-apps`,id:`available-apps`,name:`Available Apps`,accepts:t.t[`available-apps`]}}),d=new Set(e.o.getState().launcherFolders.flatMap(e=>e.appIds)),f=e.st.filter(e=>e.id!==`settings`&&e.id!==`menuedit`),p=e.o(e=>e.addAppToFolder);return(0,s.jsxs)(c.Box,{ref:a,className:u.availableApps,"data-is-over":o&&i?.type===`app`?`true`:void 0,children:[(0,s.jsx)(c.Text,{size:`xs`,c:`dimmed`,mb:8,children:r(`availableApps`)}),n===null&&(0,s.jsx)(c.Text,{size:`xs`,c:`orange`,mb:4,children:r(`canCreateNewFolder`)}),(0,s.jsx)(c.Box,{className:u.appGrid,children:f.filter(e=>!d.has(e.id)).map(e=>(0,s.jsx)(m,{app:e,targetFolderId:n,onAdd:p},e.id))})]})},m=({app:e,targetFolderId:r,onAdd:i})=>{let{attributes:a,listeners:o,setNodeRef:l,isDragging:d,style:f}=t.a({item:{type:`app`,id:e.id,name:e.name,sourceId:`available-apps`,sourceType:`available-apps`,metadata:{fcIcon:e.fcIcon,iconUrl:e.iconUrl,icon:e.icon}}}),p=()=>{r&&i(e.id,r)};return(0,s.jsxs)(c.UnstyledButton,{ref:l,className:u.appItem,style:{...f,opacity:d?0:1},onClick:p,disabled:!r,...a,...o,children:[(0,s.jsx)(n.t,{fcIcon:e.fcIcon,iconUrl:e.iconUrl,fallback:e.icon,size:16}),(0,s.jsx)(c.Text,{size:`xs`,children:e.name})]})},h=({window:t,notifyReady:n})=>{let{t:f}=(0,l.useTranslation)(`menuedit`),m=t?.id,h=e.o(e=>e.launcherFolders),g=e.o(e=>e.setLauncherFolders),_=e.o(e=>e.createLauncherFolder),v=e.o(e=>e.updateLauncherFolder),y=e.o(e=>e.deleteLauncherFolder),b=e.o(e=>e.removeAppFromFolder),[x,S]=(0,o.useState)(null),[C,w]=(0,o.useState)(``),T=(0,o.useRef)(!1);(0,o.useEffect)(()=>{m&&(T.current||(T.current=!0,a.n.getState().reset(m)))},[m]),(0,o.useEffect)(()=>{if(!m)return;let e=a.n.getState();if(e.getSnapshot(m)===null)e.takeSnapshot(m,h);else{let t=e.getSnapshot(m);if(t){let n=JSON.stringify(h)!==JSON.stringify(t);e.setIsDirty(m,n)}}},[m,h]);let E=(0,o.useCallback)(()=>{m&&a.n.getState().takeSnapshot(m,h)},[m,h]),D=(0,o.useCallback)(()=>{if(!m)return;let e=a.n.getState().getSnapshot(m);e&&g(e)},[m,g]);r.i({isDirtyGetter:(0,o.useCallback)(()=>{if(!m)return!1;let e=a.n.getState().getSnapshot(m);return JSON.stringify(h)!==JSON.stringify(e??[])},[m,h]),windowId:t?.id,onDiscard:D,onSave:E});let O=(0,o.useCallback)(()=>{let e=_({name:f(`newFolder`),fcIcon:`VscFolder`,order:h.length});S(e.id),w(e.name)},[_,h.length,f]);(0,o.useEffect)(()=>{n?.({createFolder:O,save:E,discard:D})},[O,E,D,n]);let k=(0,o.useCallback)(e=>{let t=h.find(t=>t.id===e);t&&(S(t.id),w(t.name))},[h]),A=(0,o.useCallback)(e=>{C.trim()&&v(e,{name:C.trim()}),S(null)},[C,v]),j=e.G(),M=h.filter(e=>e.isPredefined),N=h.filter(e=>!e.isPredefined),P=N.length>0?N[0].id:null;return(0,s.jsx)(c.Box,{className:u.container,"data-windowid":t?.id,"data-menuedit-container":!0,children:(0,s.jsxs)(c.Box,{className:u.content,children:[M.length>0&&(0,s.jsxs)(c.Box,{mb:`md`,children:[(0,s.jsx)(c.Text,{size:`xs`,c:`dimmed`,mb:8,children:f(`predefinedFolders`)}),(0,s.jsx)(c.Box,{className:u.folderList,children:M.map(e=>(0,s.jsx)(d,{folder:e,isEditing:!1,editingName:``,onEdit:()=>{},onRemoveApp:b,onRename:()=>{},onSetEditingName:()=>{}},e.id))})]}),j&&N.length>0&&(0,s.jsxs)(c.Box,{mb:`md`,children:[(0,s.jsx)(c.Text,{size:`xs`,c:`dimmed`,mb:8,children:f(`customFolders`)}),(0,s.jsx)(c.Box,{className:u.folderList,children:N.map(e=>(0,s.jsx)(d,{folder:e,isEditing:x===e.id,editingName:C,onEdit:k,onDelete:y,onRename:A,onSetEditingName:w,onRemoveApp:b},e.id))})]}),(0,s.jsxs)(c.Group,{justify:`space-between`,mb:`md`,children:[(0,s.jsx)(p,{customFolderId:P}),(0,s.jsx)(c.Text,{size:`xs`,c:`dimmed`,mt:`md`,children:f(`instructions`)}),j&&(0,s.jsx)(c.ActionIcon,{variant:`light`,onClick:O,"aria-label":f(`addFolder`),children:(0,s.jsx)(i.t,{name:`VscAdd`,size:16})})]})]})})},g=n=>{let r=e.o(e=>e.addAppToFolder),i=e.o(e=>e.removeAppFromFolder);return(0,s.jsxs)(t.o,{onDrop:(0,o.useCallback)((e,t)=>{if(e.type===`app`){if(t.type===`available-apps`){e.sourceType===`launcher-folder`&&i(e.id,e.sourceId);return}t.type===`launcher-folder`&&(e.sourceId!==t.id&&e.sourceType===`launcher-folder`&&i(e.id,e.sourceId),r(e.id,t.id))}},[r,i]),children:[(0,s.jsx)(h,{...n}),(0,s.jsx)(t.n,{})]})};exports.default=g;
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./AppMenuBar-38QtFTPk.cjs`),t=require(`./useMenuBarUtils-BOnQYtKU.cjs`),n=require(`./menuEditStore-sU6qaF2j.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`react-i18next`);var o=e=>{let{windowId:i,contentData:o,onExit:s}=e,{t:c}=(0,a.useTranslation)(`menuedit`),{t:l}=(0,a.useTranslation)(`common`),u=n.t(i),d=o?.createFolder,f=o?.save,p=o?.discard;return(0,r.useMemo)(()=>t.t([{type:`menu`,label:l(`menu.file`),items:[{type:`item`,label:c(`newFolder`),icon:`FcPlus`,onClick:()=>d?.()},{type:`divider`},{type:`item`,label:l(`actions.save`),icon:`FcInspection`,onClick:()=>f?.(),disabled:!u},{type:`item`,label:l(`actions.discard`),icon:`FcCancel`,onClick:()=>p?.(),disabled:!u},{type:`divider`},{type:`item`,label:l(`actions.exit`),icon:`FcLeft`,onClick:s}]}],u),[c,l,u,d,f,p,s])},s=(0,r.memo)(({windowId:t,contentData:n,onExit:r})=>(0,i.jsx)(e.t,{elements:o({windowId:t,contentData:n,onExit:r})}));s.displayName=`MenuEditMenuBar`,exports.MenuEditMenuBar=s;
@@ -0,0 +1,59 @@
1
+ import { t as e } from "./AppMenuBar-DmSfQRXU.js";
2
+ import { t } from "./useMenuBarUtils-DTPFK0IN.js";
3
+ import { t as n } from "./menuEditStore-DPqViGva.js";
4
+ import { memo as r, useMemo as i } from "react";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { useTranslation as o } from "react-i18next";
7
+ //#region src/components/Apps/MenuEditApp/useMenuEditMenuBar.ts
8
+ var s = (e) => {
9
+ let { windowId: r, contentData: a, onExit: s } = e, { t: c } = o("menuedit"), { t: l } = o("common"), u = n(r), d = a?.createFolder, f = a?.save, p = a?.discard;
10
+ return i(() => t([{
11
+ type: "menu",
12
+ label: l("menu.file"),
13
+ items: [
14
+ {
15
+ type: "item",
16
+ label: c("newFolder"),
17
+ icon: "FcPlus",
18
+ onClick: () => d?.()
19
+ },
20
+ { type: "divider" },
21
+ {
22
+ type: "item",
23
+ label: l("actions.save"),
24
+ icon: "FcInspection",
25
+ onClick: () => f?.(),
26
+ disabled: !u
27
+ },
28
+ {
29
+ type: "item",
30
+ label: l("actions.discard"),
31
+ icon: "FcCancel",
32
+ onClick: () => p?.(),
33
+ disabled: !u
34
+ },
35
+ { type: "divider" },
36
+ {
37
+ type: "item",
38
+ label: l("actions.exit"),
39
+ icon: "FcLeft",
40
+ onClick: s
41
+ }
42
+ ]
43
+ }], u), [
44
+ c,
45
+ l,
46
+ u,
47
+ d,
48
+ f,
49
+ p,
50
+ s
51
+ ]);
52
+ }, c = r(({ windowId: t, contentData: n, onExit: r }) => /* @__PURE__ */ a(e, { elements: s({
53
+ windowId: t,
54
+ contentData: n,
55
+ onExit: r
56
+ }) }));
57
+ c.displayName = "MenuEditMenuBar";
58
+ //#endregion
59
+ export { c as MenuEditMenuBar };
@@ -0,0 +1 @@
1
+ const e=require(`./AppTempMemory-DAC62jiS.cjs`),t=require(`./desktopStore-LSQweOqZ.cjs`),n=require(`./useCloseInterceptor-AzfjUZgz.cjs`),r=require(`./VscIcon-CeELixwP.cjs`),i=require(`./FilePickerApp-ClmPw6lk.cjs`),a=require(`./notesStore-BnMXBRaV.cjs`);let o=require(`react`),s=require(`react/jsx-runtime`),c=require(`react-i18next`),l=require(`@tiptap/react`),u=require(`@tiptap/starter-kit`);u=e.n(u);let d=require(`@tiptap/markdown`),f=require(`@tiptap/core`);var p={container:`_container_3xue5_1`,toolbar:`_toolbar_3xue5_11`,toolbarBtn:`_toolbarBtn_3xue5_22`,active:`_active_3xue5_57`,separator:`_separator_3xue5_63`,editorContent:`_editorContent_3xue5_71`},m=[...t.b],h=f.Extension.create({name:`clearMarksOnEnter`,addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t,dispatch:n}=e.view,{selection:r,schema:i}=t,{$from:a,empty:o}=r;return!o||a.parent.type!==i.nodes.paragraph?!1:(n(t.tr.split(a.pos).setStoredMarks([])),!0)}}}}),g=`Desktop/NotesAppWelcome.md`,_=({window:f,notifyReady:_})=>{let{t:v}=(0,c.useTranslation)(`notes`),y=f,b=y?.id,x=b?`notesApp-${b}`:`notesApp`,S=y?.contentData,[C,w]=(0,o.useState)(S?.initialName??v(`untitled`)),[T,E]=(0,o.useState)(!1),D=(0,o.useRef)(`save`),[O,k]=(0,o.useState)(S?.fileId??null),A=(0,o.useRef)(S?.initialContent??``),[j,M]=(0,o.useState)(!1),N=a.n(e=>e.states[b??``]?.contentLoaded??!1),P=a.n(e=>e.setContentLoaded);(0,o.useEffect)(()=>{b&&a.n.getState().reset(b)},[b]),(0,o.useEffect)(()=>{b&&a.n.getState().setIsDirty(b,j)},[b,j]);let F=t.o(e=>e.createFile),I=t.o(e=>e.updateFile),L=t.o(e=>e.fsNodes),R=(0,l.useEditor)({extensions:[u.default,d.Markdown,h],content:S?.initialContent??``,contentType:`markdown`,shouldRerenderOnTransaction:!1,onCreate:()=>{let t=R?.getMarkdown()??``;A.current=t,x&&e.t.getState().setSnapshot(x,t)},onUpdate:()=>{let t=R?.getMarkdown()??``,n=t!==(A.current??``);M(n),!n&&x&&e.t.getState().setSnapshot(x,t)}});(0,o.useEffect)(()=>{if(!O||!R||N)return;let t=L.find(e=>e.id===O);if(!t||t.type!==`file`)return;let n=t;n.content&&n.content!==(A.current??``)&&(A.current=n.content,x&&e.t.getState().setSnapshot(x,n.content),R.commands.setContent(n.content,{emitUpdate:!1,contentType:`markdown`}),P(b,!0))},[O,R,x,L,N,b,P]),(0,o.useEffect)(()=>{if(!R||!b||N)return;let e=!1,n=new AbortController;return(async()=>{try{if(S?.initialContent){e||(R.commands.setContent(S.initialContent,{emitUpdate:!1,contentType:`markdown`}),P(b,!0));return}if(S?.url){let r=await t.a(S.url,n.signal);!e&&r&&(R.commands.setContent(r,{emitUpdate:!1,contentType:`markdown`}),P(b,!0));return}if(S?.fileId)return;let r=await fetch(`/${g}`,{signal:n.signal});if(!e&&r.ok){let e=await r.text();R.commands.setContent(e,{emitUpdate:!1,contentType:`markdown`}),P(b,!0)}}catch(t){!e&&t instanceof Error&&t.name!==`AbortError`&&console.warn(`Failed to load content:`,t)}})(),()=>{e=!0,n.abort()}},[R,S,b,N,P]);let z=(0,o.useCallback)(()=>R?R.getMarkdown():``,[R]),B=(0,o.useCallback)(()=>{R?.commands.setContent(``,{emitUpdate:!1,contentType:`markdown`}),k(null),w(`untitled.md`),A.current=``,M(!1),b&&P(b,!0)},[R,b,P]),V=(0,o.useCallback)(()=>{R&&(O?(I(O,z()),A.current=z(),M(!1)):(D.current=`save`,E(!0)))},[R,z,I,O]),H=(0,o.useCallback)(()=>{R&&(D.current=`saveAs`,E(!0))},[R]),U=(0,o.useCallback)(async({parentId:e,name:t})=>{if(!R)return;let n=z();if(D.current===`saveAs`||!O){let r=await F(t,n,e);k(r.id),w(r.name)}else await I(O,n);A.current=n,M(!1),E(!1)},[R,z,F,I,O]),[W,G]=(0,o.useState)(!1),K=(0,o.useCallback)(e=>{k(e.id),w(e.name),A.current=e.content??``,M(!1),G(!1);let n=e.url;n?t.a(n).then(e=>{e&&(R?.commands.setContent(e,{emitUpdate:!1,contentType:`markdown`}),b&&P(b,!0))}):e.content&&(R?.commands.setContent(e.content,{emitUpdate:!1,contentType:`markdown`}),b&&P(b,!0))},[R,b,P]),q=(0,o.useCallback)(()=>G(!0),[]);(0,o.useEffect)(()=>{let e={new:B,save:V,saveAs:H};_?.({...y?.contentData??{},actions:e,setPickerOpen:q,isDirty:j})},[B,V,H,y,_,q,j]),n.i({isDirtyGetter:(0,o.useCallback)(()=>(R?.getMarkdown()??``)!==(A.current??``),[R]),windowId:b,onDiscard:()=>{if(!R)return;let e=A.current??``;R.commands.setContent(e,{emitUpdate:!1,contentType:`markdown`}),M(!1)},onSave:V});let J=(0,l.useEditorState)({editor:R,selector:e=>({canUndo:e.editor?.can().undo()??!1,canRedo:e.editor?.can().redo()??!1,isBold:e.editor?.isActive(`bold`)??!1,isItalic:e.editor?.isActive(`italic`)??!1,isStrike:e.editor?.isActive(`strike`)??!1,isCode:e.editor?.isActive(`code`)??!1,isH1:e.editor?.isActive(`heading`,{level:1})??!1,isH2:e.editor?.isActive(`heading`,{level:2})??!1,isBulletList:e.editor?.isActive(`bulletList`)??!1,isOrderedList:e.editor?.isActive(`orderedList`)??!1,isBlockquote:e.editor?.isActive(`blockquote`)??!1,isCodeBlock:e.editor?.isActive(`codeBlock`)??!1})});return(0,s.jsxs)(`div`,{className:p.container,"data-windowid":y?.id,children:[(0,s.jsxs)(`div`,{className:p.toolbar,role:`toolbar`,"aria-label":v(`toolbar.formatting`),children:[(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isBold?p.active:``}`,onClick:()=>R?.chain().focus().toggleBold().run(),disabled:!R?.can().chain().focus().toggleBold().run(),title:v(`toolbar.bold`),"aria-label":v(`toolbar.bold`),children:(0,s.jsx)(r.t,{name:`VscBold`})}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isItalic?p.active:``}`,onClick:()=>R?.chain().focus().toggleItalic().run(),disabled:!R?.can().chain().focus().toggleItalic().run(),title:v(`toolbar.italic`),"aria-label":v(`toolbar.italic`),children:(0,s.jsx)(r.t,{name:`VscItalic`})}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isStrike?p.active:``}`,onClick:()=>R?.chain().focus().toggleStrike().run(),disabled:!R?.can().chain().focus().toggleStrike().run(),title:v(`toolbar.strikethrough`),"aria-label":v(`toolbar.strikethrough`),children:(0,s.jsx)(`s`,{children:`S`})}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isCode?p.active:``}`,onClick:()=>R?.chain().focus().toggleCode().run(),disabled:!R?.can().chain().focus().toggleCode().run(),title:v(`toolbar.inlineCode`),"aria-label":v(`toolbar.inlineCode`),children:(0,s.jsx)(r.t,{name:`VscCode`})}),(0,s.jsx)(`span`,{className:p.separator}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isH1?p.active:``}`,onClick:()=>R?.chain().focus().toggleHeading({level:1}).run(),title:v(`toolbar.heading1`),"aria-label":v(`toolbar.heading1`),children:(0,s.jsx)(`strong`,{children:`H1`})}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isH2?p.active:``}`,onClick:()=>R?.chain().focus().toggleHeading({level:2}).run(),title:v(`toolbar.heading2`),"aria-label":v(`toolbar.heading2`),children:(0,s.jsx)(`strong`,{children:`H2`})}),(0,s.jsx)(`span`,{className:p.separator}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isBulletList?p.active:``}`,onClick:()=>R?.chain().focus().toggleBulletList().run(),title:v(`toolbar.bulletList`),"aria-label":v(`toolbar.bulletList`),children:(0,s.jsx)(r.t,{name:`VscListUnordered`})}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isOrderedList?p.active:``}`,onClick:()=>R?.chain().focus().toggleOrderedList().run(),title:v(`toolbar.orderedList`),"aria-label":v(`toolbar.orderedList`),children:(0,s.jsx)(r.t,{name:`VscListOrdered`})}),(0,s.jsx)(`span`,{className:p.separator}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isBlockquote?p.active:``}`,onClick:()=>R?.chain().focus().toggleBlockquote().run(),title:v(`toolbar.blockquote`),"aria-label":v(`toolbar.blockquote`),children:(0,s.jsx)(r.t,{name:`VscQuote`})}),(0,s.jsx)(`button`,{className:`${p.toolbarBtn} ${J?.isCodeBlock?p.active:``}`,onClick:()=>R?.chain().focus().toggleCodeBlock().run(),title:v(`toolbar.codeBlock`),"aria-label":v(`toolbar.codeBlock`),children:(0,s.jsx)(r.t,{name:`VscTerminal`})}),(0,s.jsx)(`button`,{className:p.toolbarBtn,onClick:()=>R?.chain().focus().setHorizontalRule().run(),title:v(`toolbar.horizontalRule`),"aria-label":v(`toolbar.horizontalRule`),children:(0,s.jsx)(r.t,{name:`VscHorizontalRule`})}),(0,s.jsx)(`span`,{className:p.separator}),(0,s.jsx)(`button`,{className:p.toolbarBtn,onClick:()=>R?.chain().focus().undo().run(),disabled:!J?.canUndo,title:v(`common:actions.undo`),"aria-label":v(`common:actions.undo`),children:(0,s.jsx)(r.t,{name:`VscDiscard`})}),(0,s.jsx)(`button`,{className:p.toolbarBtn,onClick:()=>R?.chain().focus().redo().run(),disabled:!J?.canRedo,title:v(`common:actions.redo`),"aria-label":v(`common:actions.redo`),children:(0,s.jsx)(r.t,{name:`VscRedo`})})]}),(0,s.jsx)(l.EditorContent,{editor:R,className:p.editorContent}),(0,s.jsx)(i.n,{opened:W,acceptedMimeTypes:m,onConfirm:K,onCancel:()=>G(!1)}),(0,s.jsx)(i.r,{opened:T,initialName:C,onConfirm:U,onCancel:()=>E(!1)})]})};exports.default=_;