@owdproject/core 3.3.1 → 4.0.0-alpha.3

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 (93) hide show
  1. package/README.md +91 -59
  2. package/dist/dom/index.d.mts +65 -0
  3. package/dist/dom/index.d.ts +65 -0
  4. package/dist/dom/index.mjs +224 -0
  5. package/dist/events/index.d.mts +70 -0
  6. package/dist/events/index.d.ts +70 -0
  7. package/dist/events/index.mjs +3 -0
  8. package/dist/index.d.mts +73 -0
  9. package/dist/index.d.ts +73 -0
  10. package/dist/index.mjs +115 -0
  11. package/dist/layout/index.d.mts +41 -0
  12. package/dist/layout/index.d.ts +41 -0
  13. package/dist/layout/index.mjs +64 -0
  14. package/dist/machines/index.d.mts +31 -0
  15. package/dist/machines/index.d.ts +31 -0
  16. package/dist/machines/index.mjs +2 -0
  17. package/dist/managers/index.d.mts +117 -0
  18. package/dist/managers/index.d.ts +117 -0
  19. package/dist/managers/index.mjs +6 -0
  20. package/dist/session/index.d.mts +57 -0
  21. package/dist/session/index.d.ts +57 -0
  22. package/dist/session/index.mjs +65 -0
  23. package/dist/shared/core.B0B0KfVK.mjs +865 -0
  24. package/dist/shared/core.B1XxB289.mjs +239 -0
  25. package/dist/shared/core.B3mp7ztE.mjs +237 -0
  26. package/dist/shared/core.BOvFdEVQ.d.ts +114 -0
  27. package/dist/shared/core.CsDFgGnX.mjs +40 -0
  28. package/dist/shared/core.Di1eFcr_.d.mts +114 -0
  29. package/dist/shared/core.Pd_Ogt4g.mjs +101 -0
  30. package/dist/shared/core.b3Xldzyu.mjs +29 -0
  31. package/dist/types/index.d.mts +266 -0
  32. package/dist/types/index.d.ts +266 -0
  33. package/dist/types/index.mjs +1 -0
  34. package/package.json +60 -87
  35. package/bin/cli.js +0 -395
  36. package/bin/desktop.js +0 -5
  37. package/bin/lib/catalog.js +0 -293
  38. package/bin/lib/config.js +0 -109
  39. package/bin/lib/desktopConfig.js +0 -56
  40. package/bin/lib/generateTemplate.js +0 -389
  41. package/bin/lib/install.js +0 -408
  42. package/bin/lib/migrateModulePlayground.config.mjs +0 -164
  43. package/bin/lib/migrateModulePlayground.mjs +0 -313
  44. package/bin/lib/npmVersions.js +0 -124
  45. package/bin/lib/playgroundContext.js +0 -188
  46. package/bin/lib/scaffold.js +0 -197
  47. package/bin/lib/status.js +0 -289
  48. package/bin/lib/validateModule.js +0 -697
  49. package/bin/lib/workspace.js +0 -182
  50. package/bin/owd.js +0 -5
  51. package/bin/tui.js +0 -1379
  52. package/dist/module.d.mts +0 -13
  53. package/dist/module.json +0 -9
  54. package/dist/module.mjs +0 -268
  55. package/dist/types.d.mts +0 -7
  56. package/index.ts +0 -5
  57. package/module.ts +0 -223
  58. package/runtime/components/Desktop/Application/DesktopApplicationRender.vue +0 -20
  59. package/runtime/components/Desktop/Application/DesktopApplicationWindowsRender.vue +0 -38
  60. package/runtime/components/Desktop/Background/DesktopBackground.vue +0 -16
  61. package/runtime/components/Desktop/Core/DesktopCore.vue +0 -90
  62. package/runtime/components/Desktop/Time/DesktopTime.vue +0 -56
  63. package/runtime/components/Desktop/Window/DesktopWindow.vue +0 -204
  64. package/runtime/components/Desktop/Window/DesktopWindowContent.vue +0 -28
  65. package/runtime/components/Desktop/Window/DesktopWindowNav.vue +0 -66
  66. package/runtime/composables/useApplicationEntries.ts +0 -51
  67. package/runtime/composables/useApplicationManager.ts +0 -285
  68. package/runtime/composables/useDesktopManager.ts +0 -49
  69. package/runtime/composables/useTerminalManager.ts +0 -66
  70. package/runtime/composables/useWorkspaceManager.ts +0 -41
  71. package/runtime/internal/controllers/ApplicationController.ts +0 -345
  72. package/runtime/internal/controllers/WindowController.ts +0 -462
  73. package/runtime/plugins/02.desktop-register-desktop-apps.client.ts +0 -17
  74. package/runtime/plugins/resize.client.ts +0 -6
  75. package/runtime/stores/storeApplicationMeta.ts +0 -59
  76. package/runtime/stores/storeApplicationWindows.ts +0 -20
  77. package/runtime/stores/storeDesktop.ts +0 -111
  78. package/runtime/stores/storeDesktopDefaultApps.ts +0 -53
  79. package/runtime/stores/storeDesktopVolume.ts +0 -18
  80. package/runtime/stores/storeDesktopWindow.ts +0 -20
  81. package/runtime/stores/storeDesktopWorkspace.ts +0 -75
  82. package/runtime/utils/captureElementToCanvas.ts +0 -21
  83. package/runtime/utils/explorerEntryPath.ts +0 -10
  84. package/runtime/utils/resolveDesktopConfigPath.ts +0 -52
  85. package/runtime/utils/splitDesktopUserConfig.ts +0 -85
  86. package/runtime/utils/utilApp.ts +0 -37
  87. package/runtime/utils/utilCommon.ts +0 -26
  88. package/runtime/utils/utilDebug.ts +0 -30
  89. package/runtime/utils/utilDesktop.ts +0 -35
  90. package/runtime/utils/utilTerminal.ts +0 -6
  91. package/runtime/utils/utilWindow.ts +0 -15
  92. package/runtime/utils/validateDesktopUserConfig.ts +0 -44
  93. package/types/index.d.ts +0 -420
package/types/index.d.ts DELETED
@@ -1,420 +0,0 @@
1
- import type { Nuxt } from '@nuxt/schema'
2
- import type { ShallowRef } from 'vue'
3
- import { useApplicationManager } from '../runtime/composables/useApplicationManager'
4
-
5
- declare module 'nuxt/schema' {
6
- interface PublicRuntimeConfig {
7
- owd: {
8
- tailwindPaths: []
9
- }
10
- }
11
- }
12
-
13
- interface IApplicationManager {
14
- apps: Map<string, IApplicationController>
15
-
16
- get appsEntries(): Reactive<ApplicationEntry[]>
17
-
18
- get appsRunning(): Reactive<IApplicationController[]>
19
-
20
- get windowsOpened(): Reactive<Map<string, IWindowController>>
21
-
22
- get appCategories(): string[]
23
-
24
- get appsByCategory(): { [category: string]: IApplicationController[] }
25
-
26
- defineApp(
27
- id: string,
28
- config: ApplicationConfig,
29
- ): Promise<IApplicationController>
30
-
31
- closeApp(id: string): void
32
-
33
- launchAppEntry(
34
- id: string,
35
- entry: string,
36
- ): Promise<IApplicationController | undefined | void>
37
- execAppCommand(
38
- id: string,
39
- command: string,
40
- meta: undefined | any,
41
- ): Promise<CommandOutput | void>
42
-
43
- isAppDefined(id: string): boolean
44
-
45
- isAppRunning(id: string): boolean
46
- }
47
-
48
- type ApplicationCommand = (app: IApplicationController, args: any) => void
49
-
50
- interface ApplicationConfig {
51
- id: string
52
- title: string
53
- icon?: string
54
- category?: string
55
- version?: string
56
- description?: string
57
- provides?: ApplicationConfigProvide
58
- singleton?: boolean
59
- meta?: IApplicationMeta
60
- permissions?: ApplicationPermission[]
61
- windows?: { [key: string]: WindowConfig }
62
- entries: { [key: string]: ApplicationEntry }
63
- commands?: { [key: string]: ApplicationCommand }
64
-
65
- onReady?(app: IApplicationController): void | Promise<void>
66
-
67
- onLaunch?(app: IApplicationController): void | Promise<void>
68
-
69
- onRestore?(app: IApplicationController): void | Promise<void>
70
-
71
- onClose?(app: IApplicationController): void | Promise<void>
72
- }
73
-
74
- interface ApplicationConfigProvide {
75
- name: string
76
- command: string
77
- }
78
-
79
- type IApplicationMeta = { [key: string]: any }
80
-
81
- interface IApplicationController {
82
- id: string
83
- config: ApplicationConfig
84
-
85
- get meta(): { [key: string]: any }
86
-
87
- store: Pinia
88
- windows: Map<string, IWindowController>
89
- openWindowCount: ShallowRef<number>
90
-
91
- isRunning: boolean
92
-
93
- setRunning(value: boolean): void
94
-
95
- initApplication(): Promise<void>
96
-
97
- restoreApplication(): Promise<boolean>
98
-
99
- getWindowsByModel(model: string): IWindowController[]
100
-
101
- getFirstWindowByModel(model: string): IWindowController | undefined
102
-
103
- openWindow(
104
- model: string,
105
- windowStoredState?: WindowStoredState,
106
- options?: {
107
- isRestoring?: boolean
108
- },
109
- )
110
-
111
- closeWindow(windowId: string): void
112
-
113
- closeAllWindows(): void
114
-
115
- execCommand(command: string): Promise<CommandOutput | void>
116
-
117
- // deprecated
118
- get windowsOpened(): Reactive<Map<string, IWindowController>>
119
- }
120
-
121
- export interface IWindowController {
122
- application: IApplicationController
123
- instanced: boolean
124
- model: string
125
-
126
- config: WindowConfig
127
- override: WindowOverride
128
-
129
- get state(): WindowState
130
-
131
- // common
132
- get title(): string
133
-
134
- get icon(): string | undefined
135
-
136
- // sizes
137
- get size(): WindowSize
138
-
139
- get position(): WindowPosition | undefined
140
-
141
- // minimize
142
- get isMinimizable(): boolean
143
-
144
- // maximize
145
- get isMaximizable(): boolean
146
-
147
- get isMaximized(): boolean
148
-
149
- // destroy
150
- get isDestroyable(): boolean
151
-
152
- // draggable
153
- get isDraggable(): boolean
154
-
155
- // resizable
156
- get isResizable(): boolean
157
-
158
- get actions(): {
159
- // position
160
- setActive(value: boolean)
161
- setFocus(value: boolean)
162
- bringToFront()
163
- setPosition(data: WindowPosition)
164
-
165
- // size
166
- setSize(data: WindowSize)
167
-
168
- // minimize
169
- minimize(): boolean
170
-
171
- // maximize
172
- toggleMaximize(): boolean
173
- maximize(): boolean
174
- unmaximize(): boolean
175
-
176
- // destroy
177
- destroy(): boolean
178
-
179
- // workspace
180
- setWorkspace(workspaceId: string)
181
-
182
- // override
183
- setTitleOverride(title: string | undefined): void
184
- resetTitleOverride(): void
185
- }
186
-
187
- /** Payload restored with window state (e.g. explorer cwd in `path`). */
188
- get meta(): { path?: string } & Record<string, unknown>
189
-
190
- /** Chrome menu model (e.g. PrimeVue Menubar). */
191
- menu: unknown[]
192
-
193
- setMenu(menu: unknown[]): void
194
-
195
- destroy(): boolean
196
-
197
- /** Set by module-fs when an explorer surface mounts on this window. */
198
- fsExplorer?: any
199
- }
200
-
201
- export interface WindowContent {
202
- padded?: boolean
203
- centered?: boolean
204
- }
205
-
206
- export interface WindowConfig {
207
- title?: string
208
- category?: string
209
- icon?: string
210
-
211
- component?: Raw<Component>
212
-
213
- // position
214
- position?: WindowPosition
215
-
216
- // sizes
217
- size: WindowSize
218
-
219
- // minimize
220
- minimizable?: boolean
221
-
222
- // maximize
223
- maximized?: boolean
224
- maximizable?: boolean
225
-
226
- // destroy
227
- destroyable?: boolean
228
-
229
- // draggable
230
- draggable?: boolean
231
-
232
- // draggable
233
- resizable?: boolean
234
-
235
- overridable?: Partial<
236
- Record<
237
- | 'position'
238
- | 'size'
239
- | 'maximized'
240
- | 'draggable'
241
- | 'resizable'
242
- | 'destroyable'
243
- | 'minimizable',
244
- boolean
245
- >
246
- >
247
- }
248
-
249
- interface WindowStoredState {
250
- model: string
251
- state: WindowState
252
- meta: any
253
- }
254
-
255
- interface WindowOverride {
256
- title?: undefined | string
257
- icon?: undefined | string
258
- }
259
-
260
- interface WindowState {
261
- id: string
262
- createdAt: number
263
-
264
- category?: string
265
- workspace: string
266
-
267
- // position
268
- position?: WindowPosition
269
-
270
- // sizes
271
- size?: WindowSize
272
-
273
- // focused
274
- focused: boolean
275
-
276
- // minimize
277
- active?: boolean
278
- minimizable?: boolean
279
-
280
- // maximize
281
- maximized?: boolean
282
- maximizable?: boolean
283
-
284
- // destroy
285
- destroyable?: boolean
286
-
287
- // draggable
288
- draggable?: boolean
289
-
290
- // draggable
291
- resizable?: boolean
292
- }
293
-
294
- interface WindowSize {
295
- width?: WindowSizeValue
296
- height?: WindowSizeValue
297
- minWidth?: WindowSizeValue
298
- minHeight?: WindowSizeValue
299
- maxWidth?: WindowSizeValue
300
- maxHeight?: WindowSizeValue
301
- }
302
-
303
- interface WindowPosition {
304
- x?: number
305
- y?: number
306
- z?: number
307
- }
308
-
309
- type WindowSizeValue = number | string | undefined
310
-
311
- interface ApplicationEntry {
312
- title?: string
313
- icon?: string
314
- category?: string
315
- visibility?: ApplicationEntryVisibility
316
- command: string | any
317
- }
318
-
319
- interface ApplicationEntryWithInherited extends ApplicationEntry {
320
- application: IApplicationController
321
- visibility: ApplicationEntryVisibility
322
- }
323
-
324
- type ApplicationEntryVisibility = 'primary' | 'secondary' | 'hidden'
325
-
326
- // DESKTOP
327
-
328
- interface IDesktopManager {
329
- defaultApps: import('vue').ComputedRef<Record<string, DefaultAppConfig>>
330
-
331
- getDefaultApp(feature: string): DefaultAppConfig | undefined
332
-
333
- setDefaultApp(
334
- feature: string,
335
- application: IApplicationController,
336
- entry: string,
337
- ): void
338
- }
339
-
340
- interface DocsModuleUserSourceConfig {
341
- cwd: string
342
- prefix?: string
343
- include?: string
344
- exclude?: string[]
345
- }
346
-
347
- interface DocsModuleConfig {
348
- basePath?: string
349
- title?: string
350
- sources?: DocsModuleUserSourceConfig[]
351
- }
352
-
353
- interface DesktopConfig {
354
- theme?: string
355
- modules?: string[]
356
- apps?: string[]
357
-
358
- docs?: DocsModuleConfig
359
-
360
- name?: string
361
- defaultApps?: DefaultAppsConfig
362
- features?: string[]
363
-
364
- systemBar?: DesktopSystemBarConfig
365
- dockBar?: DesktopDockBarConfig
366
- workspaces?: DesktopWorkspacesConfig
367
- }
368
-
369
- interface DesktopWindowsConfig {
370
- position: 'relative' | 'absolute' | 'fixed'
371
- }
372
-
373
- interface DesktopDockBarConfig {
374
- enabled?: boolean
375
- position?: 'top' | 'bottom'
376
- }
377
-
378
- interface DesktopSystemBarConfig {
379
- enabled?: boolean
380
- position?: 'top' | 'bottom'
381
- startButton?: boolean
382
- }
383
-
384
- interface DesktopWorkspacesConfig {
385
- enabled?: boolean
386
- }
387
-
388
- // TERMINAL
389
-
390
- type TerminalCommand = {
391
- name: string
392
- applicationId: string
393
- }
394
-
395
- interface CommandOutput {
396
- text: string
397
- isError?: boolean
398
- }
399
-
400
- // DEFAULT APP
401
-
402
- interface DefaultAppsConfig {
403
- terminal?: DefaultAppConfig
404
- browser?: DefaultAppConfig
405
- editor?: DefaultAppConfig
406
-
407
- [key: string]: DefaultAppConfig
408
- }
409
-
410
- /** Stored default for a feature: which app and which entry key to use. */
411
- interface DefaultAppConfig {
412
- applicationId: string
413
- entry: string
414
- }
415
-
416
- export function defineDesktopApp(config: ApplicationConfig)
417
- export function defineDesktopConfig(config: DesktopConfig)
418
- export function registerTailwindPath(nuxt: Nuxt, path: string): void
419
-
420
- export {}