@owdproject/core 3.1.3 → 3.1.4-beta.0

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 (49) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +6 -7
  3. package/bin/owd.js +14 -14
  4. package/index.ts +5 -2
  5. package/module.ts +64 -55
  6. package/package.json +19 -17
  7. package/project.json +4 -0
  8. package/runtime/components/Core/Application/CoreApplicationRender.vue +6 -5
  9. package/runtime/components/Core/Application/CoreApplicationWindowsRender.vue +8 -8
  10. package/runtime/components/Core/Background/CoreBackground.vue +1 -1
  11. package/runtime/components/Core/Desktop/CoreDesktop.vue +23 -20
  12. package/runtime/components/Core/Explorer/CoreExplorerFile.vue +47 -38
  13. package/runtime/components/Core/Explorer/CoreExplorerFolder.vue +0 -1
  14. package/runtime/components/Core/Time/CoreTime.vue +10 -7
  15. package/runtime/components/Core/Window/CoreWindow.vue +46 -34
  16. package/runtime/components/Core/Window/CoreWindowContent.vue +3 -5
  17. package/runtime/components/Core/Window/CoreWindowNav.vue +12 -7
  18. package/runtime/composables/useApplicationEntries.ts +51 -0
  19. package/runtime/composables/useApplicationManager.ts +3 -3
  20. package/runtime/composables/useClipboardFs.ts +11 -11
  21. package/runtime/composables/useDesktopManager.ts +2 -2
  22. package/runtime/composables/useTerminalManager.ts +3 -3
  23. package/runtime/core/controllers/ApplicationController.ts +211 -200
  24. package/runtime/core/controllers/WindowController.ts +342 -334
  25. package/runtime/core/managers/ApplicationManager.ts +240 -196
  26. package/runtime/core/managers/DesktopManager.ts +35 -25
  27. package/runtime/core/managers/TerminalManager.ts +36 -32
  28. package/runtime/plugins/resize.client.ts +4 -4
  29. package/runtime/stores/storeApplication.ts +235 -0
  30. package/runtime/stores/storeApplicationMeta.ts +12 -8
  31. package/runtime/stores/storeApplicationWindows.ts +16 -12
  32. package/runtime/stores/storeDesktop.ts +33 -29
  33. package/runtime/stores/storeDesktopVolume.ts +12 -12
  34. package/runtime/stores/storeDesktopWindow.ts +13 -13
  35. package/runtime/stores/storeDesktopWorkspace.ts +35 -31
  36. package/runtime/utils/utilApp.ts +27 -22
  37. package/runtime/utils/utilCommon.ts +43 -43
  38. package/runtime/utils/utilDebug.ts +17 -17
  39. package/runtime/utils/utilDesktop.ts +4 -4
  40. package/runtime/utils/utilTerminal.ts +6 -5
  41. package/runtime/utils/utilWindow.ts +11 -11
  42. package/test/fixtures/basic/app.vue +1 -2
  43. package/test/fixtures/basic/nuxt.config.ts +1 -3
  44. package/tsconfig.app.json +1 -1
  45. package/tsconfig.json +1 -1
  46. package/types/index.d.ts +235 -207
  47. package/vitest.config.ts +3 -3
  48. package/eslint.config.mjs +0 -30
  49. package/runtime/composables/useAppEntries.ts +0 -36
@@ -5,455 +5,463 @@ import { markRaw } from '@vue/reactivity'
5
5
  import { defineAsyncComponent } from 'vue'
6
6
 
7
7
  export class WindowController implements IWindowController {
8
- public readonly application: IApplicationController
8
+ public readonly application: IApplicationController
9
9
 
10
- public readonly instanced: boolean = true
11
- public readonly model: string
10
+ public readonly instanced: boolean = true
11
+ public readonly model: string
12
12
 
13
- public config: WindowConfig = {
14
- title: '',
15
- category: '',
13
+ public config: WindowConfig = {
14
+ title: '',
15
+ category: '',
16
16
 
17
- component: undefined,
17
+ component: undefined,
18
18
 
19
- // position
20
- position: {
21
- x: 0,
22
- y: 0,
23
- z: 0,
24
- },
19
+ // position
20
+ position: {
21
+ x: 0,
22
+ y: 0,
23
+ z: 0,
24
+ },
25
25
 
26
- // sizes
27
- size: {
28
- width: undefined,
29
- height: undefined,
30
- },
26
+ // sizes
27
+ size: {
28
+ width: undefined,
29
+ height: undefined,
30
+ },
31
31
 
32
- // minimize
33
- minimizable: true,
32
+ // minimize
33
+ minimizable: true,
34
34
 
35
- // maximize
36
- maximized: false,
37
- maximizable: false,
35
+ // maximize
36
+ maximized: false,
37
+ maximizable: false,
38
38
 
39
- // destroy
40
- destroyable: true,
39
+ // destroy
40
+ destroyable: true,
41
41
 
42
- // draggable
43
- draggable: true,
42
+ // draggable
43
+ draggable: true,
44
44
 
45
- // resizable
46
- resizable: true,
47
- }
45
+ // resizable
46
+ resizable: true,
47
+ }
48
+
49
+ public override: WindowOverride = {}
48
50
 
49
- public override: WindowOverride = {}
51
+ private storedState: WindowStoredState
50
52
 
51
- private storedState: WindowStoredState
53
+ constructor(
54
+ application: IApplicationController,
55
+ model: string,
56
+ windowConfig: WindowConfig,
57
+ windowStoredState: WindowStoredState,
58
+ ) {
59
+ this.application = application
60
+ this.model = model
52
61
 
53
- constructor(
54
- application: IApplicationController,
55
- model: string,
56
- windowConfig: WindowConfig,
57
- windowStoredState: WindowStoredState,
58
- ) {
59
- this.application = application
60
- this.model = model
62
+ this.storedState = windowStoredState
61
63
 
62
- this.storedState = windowStoredState
64
+ this.setConfig(windowConfig)
63
65
 
64
- this.setConfig(windowConfig)
66
+ this.restoreState()
67
+ }
65
68
 
66
- this.restoreState()
69
+ private setConfig(config: WindowConfig) {
70
+ // component
71
+ if (config.component) {
72
+ this.config.component = markRaw(defineAsyncComponent(config.component))
67
73
  }
68
74
 
69
- private setConfig(config: WindowConfig) {
70
- // component
71
- if (config.component) {
72
- this.config.component = markRaw(
73
- defineAsyncComponent(config.component),
74
- )
75
- }
75
+ // title
76
+ if (config.title) this.config.title = config.title
77
+ if (config.icon) this.config.icon = config.icon
76
78
 
77
- // title
78
- if (config.title) this.config.title = config.title
79
- if (config.icon) this.config.icon = config.icon
80
-
81
- // position
82
- if (!this.config.position) this.config.position = { x: 0, y: 0, z: 0 }
83
- if (config.position?.x) this.config.position.x = config.position.x
84
- if (config.position?.y) this.config.position.y = config.position.y
85
- if (config.position?.z) this.config.position.z = config.position.z
86
-
87
- // sizes
88
- if (config.size?.width) this.config.size.width = config.size.width
89
- if (config.size?.height) this.config.size.height = config.size.height
90
- if (config.size?.minWidth)
91
- this.config.size.minWidth = config.size.minWidth
92
- if (config.size?.minHeight)
93
- this.config.size.minHeight = config.size.minHeight
94
- if (config.size?.maxWidth)
95
- this.config.size.maxWidth = config.size.maxWidth
96
- if (config.size?.maxHeight)
97
- this.config.size.maxHeight = config.size.maxHeight
98
-
99
- // minimize
100
- if (typeof config.minimizable !== 'undefined') {
101
- this.config.minimizable = config.minimizable
102
- }
103
- if (typeof config.maximizable !== 'undefined') {
104
- this.config.maximizable = config.maximizable
105
- }
79
+ // position
80
+ if (!this.config.position) this.config.position = { x: 0, y: 0, z: 0 }
81
+ if (config.position?.x) this.config.position.x = config.position.x
82
+ if (config.position?.y) this.config.position.y = config.position.y
83
+ if (config.position?.z) this.config.position.z = config.position.z
106
84
 
107
- // maximize
108
- if (typeof config.maximized !== 'undefined') {
109
- this.config.maximized = config.maximized
110
- }
85
+ // sizes
86
+ if (config.size?.width) this.config.size.width = config.size.width
87
+ if (config.size?.height) this.config.size.height = config.size.height
88
+ if (config.size?.minWidth) this.config.size.minWidth = config.size.minWidth
89
+ if (config.size?.minHeight)
90
+ this.config.size.minHeight = config.size.minHeight
91
+ if (config.size?.maxWidth) this.config.size.maxWidth = config.size.maxWidth
92
+ if (config.size?.maxHeight)
93
+ this.config.size.maxHeight = config.size.maxHeight
111
94
 
112
- // draggable
113
- if (typeof config.draggable !== 'undefined') {
114
- this.config.draggable = config.draggable
115
- }
95
+ // minimize
96
+ if (typeof config.minimizable !== 'undefined') {
97
+ this.config.minimizable = config.minimizable
98
+ }
99
+ if (typeof config.maximizable !== 'undefined') {
100
+ this.config.maximizable = config.maximizable
101
+ }
116
102
 
117
- // resizable
118
- if (typeof config.resizable !== 'undefined') {
119
- this.config.resizable = config.resizable
120
- }
103
+ // maximize
104
+ if (typeof config.maximized !== 'undefined') {
105
+ this.config.maximized = config.maximized
106
+ }
121
107
 
122
- // destroy
123
- if (typeof config.destroyable !== 'undefined') {
124
- this.config.destroyable = config.destroyable
125
- }
108
+ // draggable
109
+ if (typeof config.draggable !== 'undefined') {
110
+ this.config.draggable = config.draggable
111
+ }
126
112
 
127
- const DEFAULT_OVERRIDABLE = {
128
- draggable: true,
129
- resizable: false,
130
- position: false,
131
- size: false,
132
- maximized: false,
133
- destroyable: false,
134
- minimizable: false,
135
- maximizable: false,
136
- }
113
+ // resizable
114
+ if (typeof config.resizable !== 'undefined') {
115
+ this.config.resizable = config.resizable
116
+ }
137
117
 
138
- DEFAULT_OVERRIDABLE.position = DEFAULT_OVERRIDABLE.draggable
139
- DEFAULT_OVERRIDABLE.size = DEFAULT_OVERRIDABLE.resizable
140
- DEFAULT_OVERRIDABLE.maximized = DEFAULT_OVERRIDABLE.maximizable
118
+ // destroy
119
+ if (typeof config.destroyable !== 'undefined') {
120
+ this.config.destroyable = config.destroyable
121
+ }
141
122
 
142
- this.config.overridable = {
143
- ...DEFAULT_OVERRIDABLE,
144
- ...(config.overridable || {}),
145
- }
123
+ const DEFAULT_OVERRIDABLE = {
124
+ draggable: true,
125
+ resizable: false,
126
+ position: false,
127
+ size: false,
128
+ maximized: false,
129
+ destroyable: false,
130
+ minimizable: false,
131
+ maximizable: false,
146
132
  }
147
133
 
148
- // state
134
+ DEFAULT_OVERRIDABLE.position = DEFAULT_OVERRIDABLE.draggable
135
+ DEFAULT_OVERRIDABLE.size = DEFAULT_OVERRIDABLE.resizable
136
+ DEFAULT_OVERRIDABLE.maximized = DEFAULT_OVERRIDABLE.maximizable
149
137
 
150
- get state() {
151
- return this.storedState.state
138
+ this.config.overridable = {
139
+ ...DEFAULT_OVERRIDABLE,
140
+ ...(config.overridable || {}),
152
141
  }
142
+ }
153
143
 
154
- private restoreState() {
155
- const overridable = this.config.overridable || {}
144
+ // state
156
145
 
157
- for (const key in overridable) {
158
- if (overridable[key as keyof typeof overridable]) {
159
- const stateKey = key as keyof WindowState
146
+ get state() {
147
+ return this.storedState.state
148
+ }
160
149
 
161
- if (typeof this.state[stateKey] === 'undefined') {
162
- if (typeof this.config[stateKey] === 'object') {
163
- this.state[stateKey] = deepClone(this.config[stateKey])
164
- } else {
165
- this.state[stateKey] = !!this.config[stateKey]
166
- }
167
- }
168
- }
169
- }
170
- }
150
+ private restoreState() {
151
+ const overridable = this.config.overridable || {}
171
152
 
172
- // meta
153
+ for (const key in overridable) {
154
+ if (overridable[key as keyof typeof overridable]) {
155
+ const stateKey = key as keyof WindowState
173
156
 
174
- get meta() {
175
- return this.storedState.meta
157
+ if (typeof this.state[stateKey] === 'undefined') {
158
+ if (typeof this.config[stateKey] === 'object') {
159
+ this.state[stateKey] = deepClone(this.config[stateKey])
160
+ } else {
161
+ this.state[stateKey] = !!this.config[stateKey]
162
+ }
163
+ }
164
+ }
176
165
  }
166
+ }
177
167
 
178
- // position
168
+ private setState(state: WindowState) {
169
+ this.storedState.state = state
170
+ }
179
171
 
180
- public setPosition(data: { x: number; y: number }) {
181
- if (!this.state.position) {
182
- this.state.position = { x: 0, y: 0 }
183
- }
172
+ // meta
184
173
 
185
- this.state.position.x = data.x
186
- this.state.position.y = data.y
187
- }
174
+ get meta() {
175
+ return this.storedState.meta
176
+ }
188
177
 
189
- public setActive(value: boolean) {
190
- this.state.active = value
191
- }
178
+ // position
192
179
 
193
- public setFocus(value: boolean) {
194
- this.state.focused = value
180
+ public setPosition(data: { x: number; y: number }) {
181
+ if (!this.state.position) {
182
+ this.state.position = { x: 0, y: 0 }
195
183
  }
196
184
 
197
- public focus() {
198
- const applicationManager = useApplicationManager()
199
- const desktopWindowStore = useDesktopWindowStore()
185
+ this.state.position.x = data.x
186
+ this.state.position.y = data.y
187
+ }
200
188
 
201
- if (!this.state.position) {
202
- this.state.position = { x: 0, y: 0, z: 0 }
203
- }
189
+ public setActive(value: boolean) {
190
+ this.state.active = value
191
+ }
204
192
 
205
- // already focused
206
- if (this.state.focused) {
207
- return
208
- }
193
+ public setFocus(value: boolean) {
194
+ this.state.focused = value
195
+ }
209
196
 
210
- // set focus false on all other windows
211
- for (const [windowId, window] of applicationManager.windowsOpened) {
212
- window.actions.setFocus(false)
213
- }
197
+ public focus() {
198
+ const applicationManager = useApplicationManager()
199
+ const desktopWindowStore = useDesktopWindowStore()
214
200
 
215
- this.setFocus(true)
201
+ if (!this.state.position) {
202
+ this.state.position = { x: 0, y: 0, z: 0 }
203
+ }
216
204
 
217
- this.state.position.z = desktopWindowStore.incrementPositionZ()
205
+ // already focused
206
+ if (this.state.focused) {
207
+ return
218
208
  }
219
209
 
220
- // common
210
+ // set focus false on all other windows
211
+ for (const [windowId, window] of applicationManager.windowsOpened) {
212
+ window.actions.setFocus(false)
213
+ }
221
214
 
222
- get title(): string {
223
- if (typeof this.override.title !== 'undefined') {
224
- return this.override.title
225
- }
215
+ this.setFocus(true)
226
216
 
227
- if (this.config.title) {
228
- return this.config.title
229
- }
217
+ this.state.position.z = desktopWindowStore.incrementPositionZ()
218
+ }
219
+
220
+ // common
230
221
 
231
- return this.application.config.title
222
+ get title(): string {
223
+ if (typeof this.override.title !== 'undefined') {
224
+ return this.override.title
232
225
  }
233
226
 
234
- get icon() {
235
- if (typeof this.override.icon !== 'undefined') {
236
- return this.override.icon
237
- }
227
+ if (this.config.title) {
228
+ return this.config.title
229
+ }
238
230
 
239
- if (this.config.icon) {
240
- return this.config.icon
241
- }
231
+ return this.application.config.title
232
+ }
242
233
 
243
- return this.application.config.icon
234
+ get icon() {
235
+ if (typeof this.override.icon !== 'undefined') {
236
+ return this.override.icon
244
237
  }
245
238
 
246
- // position
239
+ if (this.config.icon) {
240
+ return this.config.icon
241
+ }
247
242
 
248
- get position() {
249
- if (typeof this.state.position === 'undefined') {
250
- return this.config.position
251
- }
243
+ return this.application.config.icon
244
+ }
245
+
246
+ // position
252
247
 
253
- return this.state.position
248
+ get position() {
249
+ if (typeof this.state.position === 'undefined') {
250
+ return this.config.position
254
251
  }
255
252
 
256
- // sizes
253
+ return this.state.position
254
+ }
257
255
 
258
- get size() {
259
- const stateSize = this.state.size || {}
260
- const configSize = this.config.size || {}
261
-
262
- return {
263
- width:
264
- typeof stateSize.width !== 'undefined'
265
- ? stateSize.width
266
- : configSize.width,
267
- height:
268
- typeof stateSize.height !== 'undefined'
269
- ? stateSize.height
270
- : configSize.height,
271
- minWidth:
272
- typeof stateSize.minWidth !== 'undefined'
273
- ? stateSize.minWidth
274
- : configSize.minWidth,
275
- maxWidth:
276
- typeof stateSize.maxWidth !== 'undefined'
277
- ? stateSize.maxWidth
278
- : configSize.maxWidth,
279
- minHeight:
280
- typeof stateSize.minHeight !== 'undefined'
281
- ? stateSize.minHeight
282
- : configSize.minHeight,
283
- maxHeight:
284
- typeof stateSize.maxHeight !== 'undefined'
285
- ? stateSize.maxHeight
286
- : (configSize.maxHeight ?? 600),
287
- }
288
- }
256
+ // sizes
289
257
 
290
- public setSize(data: { width: number; height: number }) {
291
- if (!this.state.size) {
292
- this.state.size = { width: undefined, height: undefined }
293
- }
258
+ get size() {
259
+ const stateSize = this.state.size || {}
260
+ const configSize = this.config.size || {}
294
261
 
295
- this.state.size.width = data.width
296
- this.state.size.height = data.height
262
+ return {
263
+ width:
264
+ typeof stateSize.width !== 'undefined'
265
+ ? stateSize.width
266
+ : configSize.width,
267
+ height:
268
+ typeof stateSize.height !== 'undefined'
269
+ ? stateSize.height
270
+ : configSize.height,
271
+ minWidth:
272
+ typeof stateSize.minWidth !== 'undefined'
273
+ ? stateSize.minWidth
274
+ : configSize.minWidth,
275
+ maxWidth:
276
+ typeof stateSize.maxWidth !== 'undefined'
277
+ ? stateSize.maxWidth
278
+ : configSize.maxWidth,
279
+ minHeight:
280
+ typeof stateSize.minHeight !== 'undefined'
281
+ ? stateSize.minHeight
282
+ : configSize.minHeight,
283
+ maxHeight:
284
+ typeof stateSize.maxHeight !== 'undefined'
285
+ ? stateSize.maxHeight
286
+ : (configSize.maxHeight ?? 600),
297
287
  }
288
+ }
298
289
 
299
- // minimize
290
+ public setSize(data: { width: number; height: number }) {
291
+ if (!this.state.size) {
292
+ this.state.size = { width: undefined, height: undefined }
293
+ }
300
294
 
301
- get isMinimizable() {
302
- if (this.config.overridable?.minimizable) {
303
- return !!this.state.minimizable
304
- }
295
+ this.state.size.width = data.width
296
+ this.state.size.height = data.height
297
+ }
298
+
299
+ // minimize
305
300
 
306
- return !!this.config.minimizable
301
+ get isMinimizable() {
302
+ if (this.config.overridable?.minimizable) {
303
+ return !!this.state.minimizable
307
304
  }
308
305
 
309
- public minimize() {
310
- if (!this.isMinimizable) {
311
- return false
312
- }
306
+ return !!this.config.minimizable
307
+ }
313
308
 
314
- this.state.active = false
315
- return true
309
+ public minimize() {
310
+ if (!this.isMinimizable) {
311
+ return false
316
312
  }
317
313
 
318
- public unminimize() {
319
- this.state.active = true
320
- return true
321
- }
314
+ this.state.active = false
315
+ return true
316
+ }
322
317
 
323
- public toggleMinimize() {
324
- this.state.active = !this.state.active
325
- this.focus()
326
- }
318
+ public unminimize() {
319
+ this.state.active = true
320
+ return true
321
+ }
327
322
 
328
- // maximize
323
+ public toggleMinimize() {
324
+ this.state.active = !this.state.active
325
+ this.focus()
326
+ }
329
327
 
330
- get isMaximizable() {
331
- if (typeof this.state.maximizable === 'undefined') {
332
- return !!this.config.maximizable
333
- }
328
+ // maximize
334
329
 
335
- return this.state.maximizable
330
+ get isMaximizable() {
331
+ if (typeof this.state.maximizable === 'undefined') {
332
+ return !!this.config.maximizable
336
333
  }
337
334
 
338
- get isMaximized() {
339
- if (this.config.overridable?.maximized) {
340
- return !!this.state.maximized
341
- }
335
+ return this.state.maximizable
336
+ }
342
337
 
343
- return !!this.config.maximized
338
+ get isMaximized() {
339
+ if (this.config.overridable?.maximized) {
340
+ return !!this.state.maximized
344
341
  }
345
342
 
346
- public toggleMaximize() {
347
- if (!this.isMaximizable) {
348
- return false
349
- }
343
+ return !!this.config.maximized
344
+ }
350
345
 
351
- this.state.maximized = !this.state.maximized
352
- return true
346
+ public toggleMaximize() {
347
+ if (!this.isMaximizable) {
348
+ return false
353
349
  }
354
350
 
355
- public maximize() {
356
- if (!this.isMaximizable) {
357
- return false
358
- }
351
+ this.state.maximized = !this.state.maximized
352
+ return true
353
+ }
359
354
 
360
- this.state.maximized = true
361
- return true
355
+ public maximize() {
356
+ if (!this.isMaximizable) {
357
+ return false
362
358
  }
363
359
 
364
- public unmaximize() {
365
- if (!this.isMaximizable) {
366
- return false
367
- }
360
+ this.state.maximized = true
361
+ return true
362
+ }
368
363
 
369
- this.state.maximized = false
370
- return true
364
+ public unmaximize() {
365
+ if (!this.isMaximizable) {
366
+ return false
371
367
  }
372
368
 
373
- // destroy
369
+ this.state.maximized = false
370
+ return true
371
+ }
374
372
 
375
- get isDestroyable() {
376
- if (this.config.overridable?.destroyable) {
377
- return !!this.state.destroyable
378
- }
373
+ // destroy
379
374
 
380
- return !!this.config.destroyable
375
+ get isDestroyable() {
376
+ if (this.config.overridable?.destroyable) {
377
+ return !!this.state.destroyable
381
378
  }
382
379
 
383
- public destroy() {
384
- if (!this.isDestroyable) {
385
- return false
386
- }
387
-
388
- this.application.closeWindow(this.state.id)
380
+ return !!this.config.destroyable
381
+ }
389
382
 
390
- return true
383
+ public destroy() {
384
+ if (!this.isDestroyable) {
385
+ return false
391
386
  }
392
387
 
393
- // draggable
394
- get isDraggable() {
395
- if (this.config.overridable?.draggable) {
396
- return !!this.state.draggable
397
- }
388
+ this.application.closeWindow(this.state.id)
389
+
390
+ return true
391
+ }
398
392
 
399
- return !!this.config.draggable
393
+ // draggable
394
+ get isDraggable() {
395
+ if (this.config.overridable?.draggable) {
396
+ return !!this.state.draggable
400
397
  }
401
398
 
402
- // resizable
403
- get isResizable() {
404
- if (this.config.overridable?.resizable) {
405
- return !!this.state.resizable
406
- }
399
+ return !!this.config.draggable
400
+ }
407
401
 
408
- return !!this.config.resizable
402
+ // resizable
403
+ get isResizable() {
404
+ if (this.config.overridable?.resizable) {
405
+ return !!this.state.resizable
409
406
  }
410
407
 
411
- // workspace
412
- public setWorkspace(workspaceId: string) {
413
- this.state.workspace = workspaceId
414
- }
408
+ return !!this.config.resizable
409
+ }
415
410
 
416
- // override
411
+ // workspace
412
+ public setWorkspace(workspaceId: string) {
413
+ this.state.workspace = workspaceId
414
+ }
417
415
 
418
- public setTitleOverride(value: undefined | string) {
419
- this.override.title = value
420
- }
416
+ // override
421
417
 
422
- public resetTitleOverride() {
423
- this.override.title = undefined
424
- }
418
+ public setTitleOverride(value: undefined | string) {
419
+ this.override.title = value
420
+ }
425
421
 
426
- // deprecated ?
427
- get actions() {
428
- return {
429
- // position
430
- setActive: this.setActive.bind(this),
431
- setFocus: this.setFocus.bind(this),
432
- bringToFront: this.focus.bind(this),
433
- focus: this.focus.bind(this),
434
- setPosition: this.setPosition.bind(this),
422
+ public resetTitleOverride() {
423
+ this.override.title = undefined
424
+ }
435
425
 
436
- // size
437
- setSize: this.setSize.bind(this),
426
+ // menu
438
427
 
439
- // minimize
440
- minimize: this.minimize.bind(this),
441
- toggleMinimize: this.toggleMinimize.bind(this),
428
+ public menu: any[] = []
442
429
 
443
- // maximize
444
- toggleMaximize: this.toggleMaximize.bind(this),
445
- maximize: this.maximize.bind(this),
446
- unmaximize: this.unmaximize.bind(this),
430
+ public setMenu(menu: any[]) {
431
+ this.menu = menu
432
+ }
447
433
 
448
- // destroy
449
- destroy: this.destroy.bind(this),
434
+ // deprecated ?
435
+ get actions() {
436
+ return {
437
+ // position
438
+ setActive: this.setActive.bind(this),
439
+ setFocus: this.setFocus.bind(this),
440
+ bringToFront: this.focus.bind(this),
441
+ focus: this.focus.bind(this),
442
+ setPosition: this.setPosition.bind(this),
450
443
 
451
- // workspace
452
- setWorkspace: this.setWorkspace.bind(this),
444
+ // size
445
+ setSize: this.setSize.bind(this),
453
446
 
454
- // override
455
- setTitleOverride: this.setTitleOverride.bind(this),
456
- resetTitleOverride: this.resetTitleOverride.bind(this),
457
- }
447
+ // minimize
448
+ minimize: this.minimize.bind(this),
449
+ toggleMinimize: this.toggleMinimize.bind(this),
450
+
451
+ // maximize
452
+ toggleMaximize: this.toggleMaximize.bind(this),
453
+ maximize: this.maximize.bind(this),
454
+ unmaximize: this.unmaximize.bind(this),
455
+
456
+ // destroy
457
+ destroy: this.destroy.bind(this),
458
+
459
+ // workspace
460
+ setWorkspace: this.setWorkspace.bind(this),
461
+
462
+ // override
463
+ setTitleOverride: this.setTitleOverride.bind(this),
464
+ resetTitleOverride: this.resetTitleOverride.bind(this),
458
465
  }
466
+ }
459
467
  }