@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.
- package/README.md +419 -68
- package/dist/CalendarApp-CHLUCAI7.css +744 -0
- package/dist/CalendarApp-K7ZOUZ6C.js +2 -0
- package/dist/CalendarApp-OTGEERSS.cjs +8 -0
- package/dist/CodeServerApp-5KZGO7HL.css +75 -0
- package/dist/CodeServerApp-LUZFCQBI.js +3 -0
- package/dist/CodeServerApp-P3TMJPLY.cjs +9 -0
- package/dist/CreateItemApp-NAZMXOPK.cjs +14 -0
- package/dist/CreateItemApp-PQB5GTFG.css +107 -0
- package/dist/CreateItemApp-ZHCTSPQE.js +8 -0
- package/dist/DeviceInfoApp-R6YNVIGX.cjs +11 -0
- package/dist/DeviceInfoApp-YHCYAO6N.js +5 -0
- package/dist/DeviceInfoApp-ZSMRSITP.css +7 -0
- package/dist/FilesApp-AKCVRTXR.js +8 -0
- package/dist/FilesApp-E6L5W3T2.css +1817 -0
- package/dist/FilesApp-RW3Y6ILO.cjs +14 -0
- package/dist/ImageViewerApp-5UXNSW2O.js +11 -0
- package/dist/ImageViewerApp-N2Q7E7WZ.css +215 -0
- package/dist/ImageViewerApp-RRRRKSFN.cjs +17 -0
- package/dist/ImageViewerMenuBar-I3TFKQPS.cjs +14 -0
- package/dist/ImageViewerMenuBar-TV5C6TM2.js +5 -0
- package/dist/ImageViewerMenuBar-XLK4LIHW.css +56 -0
- package/dist/MenuEditApp-HUZRFEHE.js +9 -0
- package/dist/MenuEditApp-MCUHGTKQ.cjs +15 -0
- package/dist/MenuEditApp-YA6HSAMJ.css +94 -0
- package/dist/MenuEditMenuBar-7VHMZNRM.css +56 -0
- package/dist/MenuEditMenuBar-GF6L4PGZ.cjs +15 -0
- package/dist/MenuEditMenuBar-IUXFPZE5.js +6 -0
- package/dist/NotesApp-37BV33C6.js +10 -0
- package/dist/NotesApp-4EVUQEFZ.cjs +16 -0
- package/dist/NotesApp-TQ6IHDNX.css +302 -0
- package/dist/NotesMenuBar-25LKN3SE.cjs +15 -0
- package/dist/NotesMenuBar-MXLOX7OT.css +56 -0
- package/dist/NotesMenuBar-SRV3AIAL.js +6 -0
- package/dist/PdfApp-5VBDNRMC.cjs +16 -0
- package/dist/PdfApp-BUIC5U5H.css +206 -0
- package/dist/PdfApp-RH6MZZX5.js +10 -0
- package/dist/PdfMenuBar-NLZC6JHS.js +4 -0
- package/dist/PdfMenuBar-QUM72EE4.css +56 -0
- package/dist/PdfMenuBar-WBRTKMLN.cjs +13 -0
- package/dist/SettingsApp-5LDHEHYV.cjs +20 -0
- package/dist/SettingsApp-JVOSEFH3.css +283 -0
- package/dist/SettingsApp-X6764D7T.js +14 -0
- package/dist/SettingsMenuBar-5CBSSMVM.css +56 -0
- package/dist/SettingsMenuBar-VLT6TTCM.js +6 -0
- package/dist/SettingsMenuBar-Y5QEXDEO.cjs +15 -0
- package/dist/StorybookApp-NQ244BER.css +7 -0
- package/dist/StorybookApp-NZDV4X3Y.js +1 -0
- package/dist/StorybookApp-VF3KIMU3.cjs +7 -0
- package/dist/TerminalApp-CDGWRBFJ.cjs +10 -0
- package/dist/TerminalApp-EAATMIMX.css +77 -0
- package/dist/TerminalApp-GCKJCM55.js +4 -0
- package/dist/TerminalMenuBar-3J26O26Q.css +56 -0
- package/dist/TerminalMenuBar-7BH7MGNJ.cjs +14 -0
- package/dist/TerminalMenuBar-7JAEQUZ4.js +5 -0
- package/dist/UploaderApp-2WYRCUQV.js +10 -0
- package/dist/UploaderApp-6KV3TGCT.css +1817 -0
- package/dist/UploaderApp-EYFC36PM.cjs +16 -0
- package/dist/chunk-2FO445RM.cjs +449 -0
- package/dist/chunk-2PSTHGTD.cjs +42 -0
- package/dist/chunk-2RQX7QBP.cjs +148 -0
- package/dist/chunk-3IICBLEA.js +442 -0
- package/dist/chunk-43W6UDUZ.cjs +19 -0
- package/dist/chunk-4E45FBAH.js +223 -0
- package/dist/chunk-4MCFQPKY.js +444 -0
- package/dist/chunk-4OH5RPSQ.cjs +38 -0
- package/dist/chunk-4XURSNM4.js +43 -0
- package/dist/chunk-4ZCRYHL6.js +407 -0
- package/dist/chunk-54PYEQLK.js +283 -0
- package/dist/chunk-5C6IQE42.cjs +35 -0
- package/dist/chunk-5NOHYJNH.js +84 -0
- package/dist/chunk-5PYK5ASL.js +162 -0
- package/dist/chunk-5YH6AKEO.js +146 -0
- package/dist/chunk-657BJOY5.cjs +324 -0
- package/dist/chunk-6QOUYSEE.cjs +2303 -0
- package/dist/chunk-7SAFECOJ.js +215 -0
- package/dist/chunk-7Y7HB7FB.cjs +53 -0
- package/dist/chunk-ABIAPZ6S.cjs +45 -0
- package/dist/chunk-AQL372JF.cjs +219 -0
- package/dist/chunk-AXDUVZVP.cjs +88 -0
- package/dist/chunk-AYFNYHMP.js +541 -0
- package/dist/chunk-BDO6B7MZ.cjs +451 -0
- package/dist/chunk-BKXEA2BK.cjs +286 -0
- package/dist/chunk-BLV47DX2.js +47 -0
- package/dist/chunk-BQCD5RAF.cjs +48 -0
- package/dist/chunk-BQL3YXMV.js +17429 -0
- package/dist/chunk-C6BEZNAM.cjs +45 -0
- package/dist/chunk-CFWV2JMR.js +234 -0
- package/dist/chunk-CV5PUHAE.cjs +86 -0
- package/dist/chunk-D5MVFFID.js +42 -0
- package/dist/chunk-D7R55WWT.js +1601 -0
- package/dist/chunk-DMNF4CNN.cjs +49 -0
- package/dist/chunk-DWP2SYF7.js +55 -0
- package/dist/chunk-E55VXNLK.cjs +17498 -0
- package/dist/chunk-EAELL43F.js +42 -0
- package/dist/chunk-EUQLZW6P.js +48 -0
- package/dist/chunk-EX5V2ZTU.js +40 -0
- package/dist/chunk-FH4ILMKF.js +38 -0
- package/dist/chunk-FRHBM2U7.js +33 -0
- package/dist/chunk-FX2TPX3L.cjs +45 -0
- package/dist/chunk-GCYD6T52.js +32 -0
- package/dist/chunk-GRYCUBJZ.js +9 -0
- package/dist/chunk-HWHBSAUC.js +40 -0
- package/dist/chunk-ICUE6T7J.cjs +50 -0
- package/dist/chunk-IDHP3R4I.js +31 -0
- package/dist/chunk-IUOQPOEN.js +2293 -0
- package/dist/chunk-J7L2S2GT.cjs +34 -0
- package/dist/chunk-JEBKLIMU.cjs +123 -0
- package/dist/chunk-KQHICFX3.js +121 -0
- package/dist/chunk-LMJE6V4N.cjs +42 -0
- package/dist/chunk-MVDGM5Y4.js +68 -0
- package/dist/chunk-NVEGEK3N.js +31 -0
- package/dist/chunk-NWMSWRUD.js +2236 -0
- package/dist/chunk-ODXL6BR3.js +77 -0
- package/dist/chunk-OJIDKDKF.js +68 -0
- package/dist/chunk-PKPQA5NR.js +15 -0
- package/dist/chunk-PNDBLFJW.cjs +50 -0
- package/dist/chunk-PYTKNRGM.js +280 -0
- package/dist/chunk-Q3WA72BF.cjs +70 -0
- package/dist/chunk-QB72BLCJ.cjs +237 -0
- package/dist/chunk-QHBBLML3.js +86 -0
- package/dist/chunk-RDIDAZ3S.cjs +9 -0
- package/dist/chunk-RGJPRXYY.js +48 -0
- package/dist/chunk-RQ6OZRUW.cjs +41 -0
- package/dist/chunk-SBE4SZAN.cjs +226 -0
- package/dist/chunk-SYGUWGWK.cjs +2329 -0
- package/dist/chunk-TDZ43MUX.cjs +165 -0
- package/dist/chunk-TGWMOHAO.js +17 -0
- package/dist/chunk-U4RYIS6Z.cjs +548 -0
- package/dist/chunk-UIQCTAVM.cjs +59 -0
- package/dist/chunk-XVASHRCE.cjs +70 -0
- package/dist/chunk-XYSMVQQD.cjs +1608 -0
- package/dist/chunk-YAIWI4Z5.js +7 -0
- package/dist/chunk-YP2PLNOF.cjs +34 -0
- package/dist/chunk-YSOLW4FS.cjs +11 -0
- package/dist/chunk-YY6OUR2U.js +44 -0
- package/dist/chunk-YZWS7FDT.cjs +409 -0
- package/dist/chunk-Z5YGWL65.cjs +39 -0
- package/dist/chunk-ZBGWYTCU.cjs +83 -0
- package/dist/chunk-ZHB5Q2M6.js +36 -0
- package/dist/chunk-ZHNDXNL4.js +45 -0
- package/dist/chunk-ZX3EDZ5C.cjs +17 -0
- package/dist/index.cjs +4405 -5156
- package/dist/index.css +9192 -0
- package/dist/index.d.cts +1324 -762
- package/dist/index.d.ts +1324 -762
- package/dist/index.js +3648 -5038
- package/package.json +14 -6
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk4OH5RPSQ_cjs = require('./chunk-4OH5RPSQ.cjs');
|
|
4
|
+
var chunk6QOUYSEE_cjs = require('./chunk-6QOUYSEE.cjs');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
|
|
7
|
+
// src/constants/Animations.ts
|
|
8
|
+
var ANIMATION_DURATION = 0.3;
|
|
9
|
+
var createEaseIn = (duration) => ({
|
|
10
|
+
duration,
|
|
11
|
+
ease: "easeIn"
|
|
12
|
+
});
|
|
13
|
+
var createEaseOut = (duration) => ({
|
|
14
|
+
duration,
|
|
15
|
+
ease: "easeOut"
|
|
16
|
+
});
|
|
17
|
+
var createWindowVariants = (duration) => ({
|
|
18
|
+
hidden: { opacity: 0, scale: 0.92, y: 12 },
|
|
19
|
+
visible: { opacity: 1, scale: 1, y: 0, transition: createEaseOut(duration) },
|
|
20
|
+
exit: { opacity: 0, scale: 0.92, y: 12, transition: createEaseIn(duration) }
|
|
21
|
+
});
|
|
22
|
+
var createPanelVariants = (duration) => ({
|
|
23
|
+
initial: { opacity: 0, y: 8, scale: 0.96 },
|
|
24
|
+
animate: { opacity: 1, y: 0, scale: 1, transition: createEaseOut(duration) },
|
|
25
|
+
exit: { opacity: 0, y: 8, scale: 0.96, transition: createEaseIn(duration) }
|
|
26
|
+
});
|
|
27
|
+
var createMinimizeVariant = (duration) => (deltaX, deltaY) => ({
|
|
28
|
+
opacity: 0,
|
|
29
|
+
scale: 0.1,
|
|
30
|
+
x: deltaX,
|
|
31
|
+
y: deltaY,
|
|
32
|
+
transition: { duration, ease: [0.4, 0, 1, 1] }
|
|
33
|
+
});
|
|
34
|
+
var createRestoreVariant = (duration) => (deltaX, deltaY) => ({
|
|
35
|
+
opacity: [0, 1],
|
|
36
|
+
scale: [0.1, 1],
|
|
37
|
+
x: [deltaX, 0],
|
|
38
|
+
y: [deltaY, 0],
|
|
39
|
+
transition: { duration, ease: [0, 0, 0.2, 1] }
|
|
40
|
+
});
|
|
41
|
+
var createMaximizeTransition = (duration) => ({
|
|
42
|
+
duration,
|
|
43
|
+
ease: "easeOut"
|
|
44
|
+
});
|
|
45
|
+
var EASE_IN = { duration: ANIMATION_DURATION, ease: "easeIn" };
|
|
46
|
+
var EASE_OUT = { duration: ANIMATION_DURATION, ease: "easeOut" };
|
|
47
|
+
var windowVariants = createWindowVariants(ANIMATION_DURATION);
|
|
48
|
+
var panelVariants = createPanelVariants(ANIMATION_DURATION);
|
|
49
|
+
var minimizeVariant = createMinimizeVariant(0.3);
|
|
50
|
+
var restoreVariant = createRestoreVariant(0.3);
|
|
51
|
+
var openVariants = {
|
|
52
|
+
scale: {
|
|
53
|
+
hidden: { opacity: 0, scale: 0.92, y: 12 },
|
|
54
|
+
visible: { opacity: 1, scale: 1, y: 0, transition: EASE_OUT }
|
|
55
|
+
},
|
|
56
|
+
slide: {
|
|
57
|
+
hidden: { opacity: 0, y: 40 },
|
|
58
|
+
visible: { opacity: 1, y: 0, transition: EASE_OUT }
|
|
59
|
+
},
|
|
60
|
+
fade: {
|
|
61
|
+
hidden: { opacity: 0 },
|
|
62
|
+
visible: { opacity: 1, transition: EASE_OUT }
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var maximizeTransition = { duration: 0.25, ease: "easeOut" };
|
|
66
|
+
var randomWindowPosition = () => ({
|
|
67
|
+
x: 150 + Math.random() * 200,
|
|
68
|
+
y: 80 + Math.random() * 100
|
|
69
|
+
});
|
|
70
|
+
var centerWindowPosition = (viewportWidth, viewportHeight, windowWidth, windowHeight) => ({
|
|
71
|
+
x: Math.round((viewportWidth - windowWidth) / 2),
|
|
72
|
+
y: Math.round((viewportHeight - windowHeight) / 2)
|
|
73
|
+
});
|
|
74
|
+
var FilesAppLazy = react.lazy(() => import('./FilesApp-RW3Y6ILO.cjs'));
|
|
75
|
+
var NotesAppLazy = react.lazy(() => import('./NotesApp-4EVUQEFZ.cjs'));
|
|
76
|
+
var ImageViewerAppLazy = react.lazy(() => import('./ImageViewerApp-RRRRKSFN.cjs'));
|
|
77
|
+
var PdfAppLazy = react.lazy(() => import('./PdfApp-5VBDNRMC.cjs'));
|
|
78
|
+
var MenuEditAppLazy = react.lazy(() => import('./MenuEditApp-MCUHGTKQ.cjs'));
|
|
79
|
+
var UploaderAppLazy = react.lazy(() => import('./UploaderApp-EYFC36PM.cjs'));
|
|
80
|
+
var SettingsAppLazy = react.lazy(() => import('./SettingsApp-5LDHEHYV.cjs'));
|
|
81
|
+
var DeviceInfoAppLazy = react.lazy(() => import('./DeviceInfoApp-R6YNVIGX.cjs'));
|
|
82
|
+
var CalendarAppLazy = react.lazy(() => import('./CalendarApp-OTGEERSS.cjs'));
|
|
83
|
+
var CreateItemAppLazy = react.lazy(() => import('./CreateItemApp-NAZMXOPK.cjs'));
|
|
84
|
+
var NotesMenuBarLazy = react.lazy(
|
|
85
|
+
() => import('./NotesMenuBar-25LKN3SE.cjs').then((m) => ({ default: m.NotesMenuBar }))
|
|
86
|
+
);
|
|
87
|
+
var MenuEditMenuBarLazy = react.lazy(
|
|
88
|
+
() => import('./MenuEditMenuBar-GF6L4PGZ.cjs').then((m) => ({ default: m.MenuEditMenuBar }))
|
|
89
|
+
);
|
|
90
|
+
var SettingsMenuBarLazy = react.lazy(
|
|
91
|
+
() => import('./SettingsMenuBar-Y5QEXDEO.cjs').then((m) => ({ default: m.SettingsMenuBar }))
|
|
92
|
+
);
|
|
93
|
+
var PdfMenuBarLazy = react.lazy(
|
|
94
|
+
() => import('./PdfMenuBar-WBRTKMLN.cjs').then((m) => ({ default: m.PdfMenuBar }))
|
|
95
|
+
);
|
|
96
|
+
var ImageViewerMenuBarLazy = react.lazy(
|
|
97
|
+
() => import('./ImageViewerMenuBar-I3TFKQPS.cjs').then((m) => ({
|
|
98
|
+
default: m.ImageViewerMenuBar
|
|
99
|
+
}))
|
|
100
|
+
);
|
|
101
|
+
var TerminalAppLazy = react.lazy(() => import('./TerminalApp-CDGWRBFJ.cjs'));
|
|
102
|
+
var TerminalMenuBarLazy = react.lazy(
|
|
103
|
+
() => import('./TerminalMenuBar-7BH7MGNJ.cjs').then((m) => ({ default: m.TerminalMenuBar }))
|
|
104
|
+
);
|
|
105
|
+
var CodeServerAppLazy = react.lazy(() => import('./CodeServerApp-P3TMJPLY.cjs'));
|
|
106
|
+
var StorybookAppLazy = react.lazy(() => import('./StorybookApp-VF3KIMU3.cjs'));
|
|
107
|
+
|
|
108
|
+
// src/components/Window/helperRegistry.ts
|
|
109
|
+
var _registry = null;
|
|
110
|
+
var NULL_COMPONENT = (() => null);
|
|
111
|
+
function resolveEntry(entry) {
|
|
112
|
+
return {
|
|
113
|
+
...entry,
|
|
114
|
+
component: entry.component ?? (entry.loader ? react.lazy(entry.loader) : void 0),
|
|
115
|
+
MenuBarComponent: entry.MenuBarComponent ?? (entry.menuBarLoader ? react.lazy(entry.menuBarLoader) : void 0)
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function initRegistry(registry) {
|
|
119
|
+
_registry = {};
|
|
120
|
+
for (const [key, entry] of Object.entries(registry)) {
|
|
121
|
+
_registry[key] = resolveEntry(entry);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function getAppComponent(content) {
|
|
125
|
+
if (!_registry) {
|
|
126
|
+
console.warn(`[AppRegistry] Registry not initialized, requested app: ${content}`);
|
|
127
|
+
return NULL_COMPONENT;
|
|
128
|
+
}
|
|
129
|
+
const component = _registry[content]?.component;
|
|
130
|
+
if (!component) {
|
|
131
|
+
console.warn(`[AppRegistry] App not found: ${content}`);
|
|
132
|
+
return NULL_COMPONENT;
|
|
133
|
+
}
|
|
134
|
+
return component;
|
|
135
|
+
}
|
|
136
|
+
function getMenuBarBuilder(content) {
|
|
137
|
+
return _registry?.[content]?.buildMenuBar;
|
|
138
|
+
}
|
|
139
|
+
function getMenuBarComponent(content) {
|
|
140
|
+
return _registry?.[content]?.MenuBarComponent;
|
|
141
|
+
}
|
|
142
|
+
function isLazyApp(content) {
|
|
143
|
+
return _registry?.[content]?.isLazy ?? false;
|
|
144
|
+
}
|
|
145
|
+
function getAppName(content) {
|
|
146
|
+
return _registry?.[content]?.appName;
|
|
147
|
+
}
|
|
148
|
+
function getRegistryEntry(content) {
|
|
149
|
+
return _registry?.[content];
|
|
150
|
+
}
|
|
151
|
+
function registerComponents(entries) {
|
|
152
|
+
if (!_registry) _registry = {};
|
|
153
|
+
for (const [key, entry] of Object.entries(entries)) {
|
|
154
|
+
_registry[key] = resolveEntry(entry);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
var CORE_REGISTRY = {};
|
|
158
|
+
function initCoreRegistry() {
|
|
159
|
+
const entries = {
|
|
160
|
+
files: {
|
|
161
|
+
component: FilesAppLazy,
|
|
162
|
+
appName: "Files",
|
|
163
|
+
isLazy: true
|
|
164
|
+
},
|
|
165
|
+
settings: {
|
|
166
|
+
component: SettingsAppLazy,
|
|
167
|
+
MenuBarComponent: SettingsMenuBarLazy,
|
|
168
|
+
appName: "Settings",
|
|
169
|
+
isLazy: true
|
|
170
|
+
},
|
|
171
|
+
pdf: {
|
|
172
|
+
component: PdfAppLazy,
|
|
173
|
+
MenuBarComponent: PdfMenuBarLazy,
|
|
174
|
+
appName: "PDF",
|
|
175
|
+
isLazy: true
|
|
176
|
+
},
|
|
177
|
+
"image-viewer": {
|
|
178
|
+
component: ImageViewerAppLazy,
|
|
179
|
+
MenuBarComponent: ImageViewerMenuBarLazy,
|
|
180
|
+
appName: "Image Viewer",
|
|
181
|
+
isLazy: true
|
|
182
|
+
},
|
|
183
|
+
uploader: {
|
|
184
|
+
component: UploaderAppLazy,
|
|
185
|
+
appName: "Uploader",
|
|
186
|
+
isLazy: true
|
|
187
|
+
},
|
|
188
|
+
createItem: {
|
|
189
|
+
component: CreateItemAppLazy,
|
|
190
|
+
appName: "Create Item",
|
|
191
|
+
isLazy: true
|
|
192
|
+
},
|
|
193
|
+
"device-info": {
|
|
194
|
+
component: DeviceInfoAppLazy,
|
|
195
|
+
appName: "Device Info",
|
|
196
|
+
isLazy: true
|
|
197
|
+
},
|
|
198
|
+
menuedit: {
|
|
199
|
+
component: MenuEditAppLazy,
|
|
200
|
+
MenuBarComponent: MenuEditMenuBarLazy,
|
|
201
|
+
appName: "Menu Editor",
|
|
202
|
+
isLazy: true
|
|
203
|
+
},
|
|
204
|
+
notepad: {
|
|
205
|
+
component: NotesAppLazy,
|
|
206
|
+
MenuBarComponent: NotesMenuBarLazy,
|
|
207
|
+
appName: "Notepad",
|
|
208
|
+
isLazy: true
|
|
209
|
+
},
|
|
210
|
+
calendar: {
|
|
211
|
+
component: CalendarAppLazy,
|
|
212
|
+
appName: "Calendar",
|
|
213
|
+
isLazy: true
|
|
214
|
+
},
|
|
215
|
+
terminal: {
|
|
216
|
+
component: TerminalAppLazy,
|
|
217
|
+
MenuBarComponent: TerminalMenuBarLazy,
|
|
218
|
+
appName: "Terminal",
|
|
219
|
+
isLazy: true
|
|
220
|
+
},
|
|
221
|
+
"code-server": {
|
|
222
|
+
component: CodeServerAppLazy,
|
|
223
|
+
appName: "VS Code",
|
|
224
|
+
isLazy: true
|
|
225
|
+
},
|
|
226
|
+
storybook: {
|
|
227
|
+
component: StorybookAppLazy,
|
|
228
|
+
appName: "Storybook",
|
|
229
|
+
isLazy: true
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
Object.assign(CORE_REGISTRY, entries);
|
|
233
|
+
registerComponents(entries);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/hooks/useOpenApp.ts
|
|
237
|
+
var useOpenApp = () => {
|
|
238
|
+
const openWindow = chunk6QOUYSEE_cjs.useDesktopStore((state) => state.openWindow);
|
|
239
|
+
const focusWindow = chunk6QOUYSEE_cjs.useDesktopStore((state) => state.focusWindow);
|
|
240
|
+
const windows = chunk6QOUYSEE_cjs.useDesktopStore((state) => state.windows);
|
|
241
|
+
const customApps = chunk6QOUYSEE_cjs.useDesktopStore((state) => state.customApps);
|
|
242
|
+
const adaptiveDimensions = chunk4OH5RPSQ_cjs.useAdaptiveDimensions();
|
|
243
|
+
return react.useCallback(
|
|
244
|
+
(appId, { contentData, position } = {}) => {
|
|
245
|
+
const app = chunk6QOUYSEE_cjs.APPS.find((a) => a.id === appId);
|
|
246
|
+
const customApp = customApps.find((a) => a.id === appId);
|
|
247
|
+
const registryEntry = getRegistryEntry(appId);
|
|
248
|
+
const isSingleWindow = app?.singleWindow === true || customApp?.window?.singleWindow === true || registryEntry?.singleWindow === true;
|
|
249
|
+
if (isSingleWindow) {
|
|
250
|
+
const existingWindow = windows.find((w) => w.content === appId);
|
|
251
|
+
if (existingWindow) {
|
|
252
|
+
focusWindow(existingWindow.id);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const { x, y } = position ?? randomWindowPosition();
|
|
257
|
+
openWindow({
|
|
258
|
+
title: app?.name ?? registryEntry?.appName ?? customApp?.name ?? appId.charAt(0).toUpperCase() + appId.slice(1),
|
|
259
|
+
content: appId,
|
|
260
|
+
icon: app?.icon ?? registryEntry?.icon ?? customApp?.icon,
|
|
261
|
+
fcIcon: app?.fcIcon ?? registryEntry?.fcIcon,
|
|
262
|
+
iconUrl: app?.iconUrl ?? registryEntry?.iconUrl,
|
|
263
|
+
iconColor: app?.iconColor ?? registryEntry?.iconColor,
|
|
264
|
+
canMaximize: app?.canMaximize ?? registryEntry?.canMaximize ?? customApp?.window?.canMaximize,
|
|
265
|
+
x,
|
|
266
|
+
y,
|
|
267
|
+
width: app?.defaultWidth ?? registryEntry?.defaultWidth ?? customApp?.window?.defaultWidth ?? adaptiveDimensions.defaultWidth,
|
|
268
|
+
height: app?.defaultHeight ?? registryEntry?.defaultHeight ?? customApp?.window?.defaultHeight ?? adaptiveDimensions.defaultHeight,
|
|
269
|
+
minWidth: app?.minWidth === false || registryEntry?.minWidth === false || customApp?.window?.minWidth === false ? void 0 : app?.minWidth ?? registryEntry?.minWidth ?? customApp?.window?.minWidth ?? adaptiveDimensions.minWidth,
|
|
270
|
+
minHeight: app?.minHeight === false || registryEntry?.minHeight === false || customApp?.window?.minHeight === false ? void 0 : app?.minHeight ?? registryEntry?.minHeight ?? customApp?.window?.minHeight ?? adaptiveDimensions.minHeight,
|
|
271
|
+
contentData: {
|
|
272
|
+
...contentData,
|
|
273
|
+
...app?.autoLoad ? { autoLoad: app.autoLoad } : {}
|
|
274
|
+
},
|
|
275
|
+
alwaysOnTop: app?.alwaysOnTop ?? registryEntry?.alwaysOnTop
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
[openWindow, focusWindow, windows, customApps, adaptiveDimensions]
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
exports.ANIMATION_DURATION = ANIMATION_DURATION;
|
|
283
|
+
exports.CORE_REGISTRY = CORE_REGISTRY;
|
|
284
|
+
exports.CalendarAppLazy = CalendarAppLazy;
|
|
285
|
+
exports.CreateItemAppLazy = CreateItemAppLazy;
|
|
286
|
+
exports.DeviceInfoAppLazy = DeviceInfoAppLazy;
|
|
287
|
+
exports.EASE_IN = EASE_IN;
|
|
288
|
+
exports.EASE_OUT = EASE_OUT;
|
|
289
|
+
exports.FilesAppLazy = FilesAppLazy;
|
|
290
|
+
exports.ImageViewerAppLazy = ImageViewerAppLazy;
|
|
291
|
+
exports.ImageViewerMenuBarLazy = ImageViewerMenuBarLazy;
|
|
292
|
+
exports.MenuEditAppLazy = MenuEditAppLazy;
|
|
293
|
+
exports.MenuEditMenuBarLazy = MenuEditMenuBarLazy;
|
|
294
|
+
exports.NotesAppLazy = NotesAppLazy;
|
|
295
|
+
exports.NotesMenuBarLazy = NotesMenuBarLazy;
|
|
296
|
+
exports.PdfAppLazy = PdfAppLazy;
|
|
297
|
+
exports.PdfMenuBarLazy = PdfMenuBarLazy;
|
|
298
|
+
exports.SettingsAppLazy = SettingsAppLazy;
|
|
299
|
+
exports.SettingsMenuBarLazy = SettingsMenuBarLazy;
|
|
300
|
+
exports.UploaderAppLazy = UploaderAppLazy;
|
|
301
|
+
exports.centerWindowPosition = centerWindowPosition;
|
|
302
|
+
exports.createEaseIn = createEaseIn;
|
|
303
|
+
exports.createEaseOut = createEaseOut;
|
|
304
|
+
exports.createMaximizeTransition = createMaximizeTransition;
|
|
305
|
+
exports.createMinimizeVariant = createMinimizeVariant;
|
|
306
|
+
exports.createPanelVariants = createPanelVariants;
|
|
307
|
+
exports.createRestoreVariant = createRestoreVariant;
|
|
308
|
+
exports.createWindowVariants = createWindowVariants;
|
|
309
|
+
exports.getAppComponent = getAppComponent;
|
|
310
|
+
exports.getAppName = getAppName;
|
|
311
|
+
exports.getMenuBarBuilder = getMenuBarBuilder;
|
|
312
|
+
exports.getMenuBarComponent = getMenuBarComponent;
|
|
313
|
+
exports.initCoreRegistry = initCoreRegistry;
|
|
314
|
+
exports.initRegistry = initRegistry;
|
|
315
|
+
exports.isLazyApp = isLazyApp;
|
|
316
|
+
exports.maximizeTransition = maximizeTransition;
|
|
317
|
+
exports.minimizeVariant = minimizeVariant;
|
|
318
|
+
exports.openVariants = openVariants;
|
|
319
|
+
exports.panelVariants = panelVariants;
|
|
320
|
+
exports.randomWindowPosition = randomWindowPosition;
|
|
321
|
+
exports.registerComponents = registerComponents;
|
|
322
|
+
exports.restoreVariant = restoreVariant;
|
|
323
|
+
exports.useOpenApp = useOpenApp;
|
|
324
|
+
exports.windowVariants = windowVariants;
|