@owdproject/core 3.1.2 → 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 (50) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +9 -10
  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 +349 -312
  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/.editorconfig +0 -12
  49. package/eslint.config.mjs +0 -30
  50. package/runtime/composables/useAppEntries.ts +0 -36
@@ -1,430 +1,467 @@
1
- import {useApplicationManager} from '../../composables/useApplicationManager'
2
- import {useDesktopWindowStore} from '../../stores/storeDesktopWindow'
3
- import {deepClone} from '../../utils/utilCommon'
4
- import {markRaw} from '@vue/reactivity'
5
- import {defineAsyncComponent} from "vue"
1
+ import { useApplicationManager } from '../../composables/useApplicationManager'
2
+ import { useDesktopWindowStore } from '../../stores/storeDesktopWindow'
3
+ import { deepClone } from '../../utils/utilCommon'
4
+ import { markRaw } from '@vue/reactivity'
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) this.config.size.minWidth = config.size.minWidth
91
- if (config.size?.minHeight) this.config.size.minHeight = config.size.minHeight
92
- if (config.size?.maxWidth) this.config.size.maxWidth = config.size.maxWidth
93
- if (config.size?.maxHeight) this.config.size.maxHeight = config.size.maxHeight
94
-
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
- }
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
102
84
 
103
- // maximize
104
- if (typeof config.maximized !== 'undefined') {
105
- this.config.maximized = config.maximized
106
- }
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
107
94
 
108
- // draggable
109
- if (typeof config.draggable !== 'undefined') {
110
- this.config.draggable = config.draggable
111
- }
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
+ }
112
102
 
113
- // resizable
114
- if (typeof config.resizable !== 'undefined') {
115
- this.config.resizable = config.resizable
116
- }
103
+ // maximize
104
+ if (typeof config.maximized !== 'undefined') {
105
+ this.config.maximized = config.maximized
106
+ }
117
107
 
118
- // destroy
119
- if (typeof config.destroyable !== 'undefined') {
120
- this.config.destroyable = config.destroyable
121
- }
108
+ // draggable
109
+ if (typeof config.draggable !== 'undefined') {
110
+ this.config.draggable = config.draggable
111
+ }
122
112
 
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,
132
- }
113
+ // resizable
114
+ if (typeof config.resizable !== 'undefined') {
115
+ this.config.resizable = config.resizable
116
+ }
133
117
 
134
- DEFAULT_OVERRIDABLE.position = DEFAULT_OVERRIDABLE.draggable
135
- DEFAULT_OVERRIDABLE.size = DEFAULT_OVERRIDABLE.resizable
136
- DEFAULT_OVERRIDABLE.maximized = DEFAULT_OVERRIDABLE.maximizable
118
+ // destroy
119
+ if (typeof config.destroyable !== 'undefined') {
120
+ this.config.destroyable = config.destroyable
121
+ }
137
122
 
138
- this.config.overridable = {
139
- ...DEFAULT_OVERRIDABLE,
140
- ...(config.overridable || {})
141
- }
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,
142
132
  }
143
133
 
144
- // state
134
+ DEFAULT_OVERRIDABLE.position = DEFAULT_OVERRIDABLE.draggable
135
+ DEFAULT_OVERRIDABLE.size = DEFAULT_OVERRIDABLE.resizable
136
+ DEFAULT_OVERRIDABLE.maximized = DEFAULT_OVERRIDABLE.maximizable
145
137
 
146
- get state() {
147
- return this.storedState.state
138
+ this.config.overridable = {
139
+ ...DEFAULT_OVERRIDABLE,
140
+ ...(config.overridable || {}),
148
141
  }
142
+ }
149
143
 
150
- private restoreState() {
151
- const overridable = this.config.overridable || {}
144
+ // state
152
145
 
153
- for (const key in overridable) {
154
- if (overridable[key as keyof typeof overridable]) {
155
- const stateKey = key as keyof WindowState
146
+ get state() {
147
+ return this.storedState.state
148
+ }
156
149
 
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
- }
165
- }
166
- }
150
+ private restoreState() {
151
+ const overridable = this.config.overridable || {}
167
152
 
168
- // meta
153
+ for (const key in overridable) {
154
+ if (overridable[key as keyof typeof overridable]) {
155
+ const stateKey = key as keyof WindowState
169
156
 
170
- get meta() {
171
- 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
+ }
172
165
  }
166
+ }
173
167
 
174
- // position
168
+ private setState(state: WindowState) {
169
+ this.storedState.state = state
170
+ }
175
171
 
176
- private setPosition(data: { x: number, y: number}) {
177
- if (!this.state.position) {
178
- this.state.position = { x: 0, y: 0}
179
- }
172
+ // meta
180
173
 
181
- this.state.position.x = data.x
182
- this.state.position.y = data.y
183
- }
174
+ get meta() {
175
+ return this.storedState.meta
176
+ }
184
177
 
185
- private setActive(value: boolean) {
186
- this.state.active = value
187
- }
178
+ // position
188
179
 
189
- private setFocus(value: boolean) {
190
- 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 }
191
183
  }
192
184
 
193
- private bringToFront() {
194
- const applicationManager = useApplicationManager()
195
- const desktopWindowStore = useDesktopWindowStore()
185
+ this.state.position.x = data.x
186
+ this.state.position.y = data.y
187
+ }
196
188
 
197
- if (!this.state.position) {
198
- this.state.position = { x: 0, y: 0, z: 0 }
199
- }
189
+ public setActive(value: boolean) {
190
+ this.state.active = value
191
+ }
200
192
 
201
- // already focused
202
- if (this.state.focused) {
203
- return
204
- }
193
+ public setFocus(value: boolean) {
194
+ this.state.focused = value
195
+ }
205
196
 
206
- // set focus false on all other windows
207
- for (const [windowId, window] of applicationManager.windowsOpened) {
208
- window.actions.setFocus(false)
209
- }
197
+ public focus() {
198
+ const applicationManager = useApplicationManager()
199
+ const desktopWindowStore = useDesktopWindowStore()
210
200
 
211
- this.setFocus(true)
212
-
213
- this.state.position.z = desktopWindowStore.incrementPositionZ()
201
+ if (!this.state.position) {
202
+ this.state.position = { x: 0, y: 0, z: 0 }
214
203
  }
215
204
 
216
- // common
205
+ // already focused
206
+ if (this.state.focused) {
207
+ return
208
+ }
217
209
 
218
- get title(): string {
219
- if (typeof this.override.title !== 'undefined') {
220
- return this.override.title
221
- }
210
+ // set focus false on all other windows
211
+ for (const [windowId, window] of applicationManager.windowsOpened) {
212
+ window.actions.setFocus(false)
213
+ }
222
214
 
223
- if (this.config.title) {
224
- return this.config.title
225
- }
215
+ this.setFocus(true)
226
216
 
227
- return this.application.config.title
228
- }
217
+ this.state.position.z = desktopWindowStore.incrementPositionZ()
218
+ }
229
219
 
230
- get icon() {
231
- if (typeof this.override.icon !== 'undefined') {
232
- return this.override.icon
233
- }
220
+ // common
234
221
 
235
- if (this.config.icon) {
236
- return this.config.icon
237
- }
222
+ get title(): string {
223
+ if (typeof this.override.title !== 'undefined') {
224
+ return this.override.title
225
+ }
238
226
 
239
- return this.application.config.icon
227
+ if (this.config.title) {
228
+ return this.config.title
240
229
  }
241
230
 
242
- // position
231
+ return this.application.config.title
232
+ }
243
233
 
244
- get position() {
245
- if (typeof this.state.position === 'undefined') {
246
- return this.config.position
247
- }
234
+ get icon() {
235
+ if (typeof this.override.icon !== 'undefined') {
236
+ return this.override.icon
237
+ }
248
238
 
249
- return this.state.position
239
+ if (this.config.icon) {
240
+ return this.config.icon
250
241
  }
251
242
 
252
- // sizes
243
+ return this.application.config.icon
244
+ }
253
245
 
254
- get size() {
255
- const stateSize = this.state.size || {}
256
- const configSize = this.config.size || {}
257
-
258
- return {
259
- width: typeof stateSize.width !== 'undefined' ? stateSize.width : configSize.width,
260
- height: typeof stateSize.height !== 'undefined' ? stateSize.height : configSize.height,
261
- minWidth: typeof stateSize.minWidth !== 'undefined' ? stateSize.minWidth : configSize.minWidth,
262
- maxWidth: typeof stateSize.maxWidth !== 'undefined' ? stateSize.maxWidth : configSize.maxWidth,
263
- minHeight: typeof stateSize.minHeight !== 'undefined' ? stateSize.minHeight : configSize.minHeight,
264
- maxHeight: typeof stateSize.maxHeight !== 'undefined' ? stateSize.maxHeight : (configSize.maxHeight ?? 600),
265
- }
246
+ // position
247
+
248
+ get position() {
249
+ if (typeof this.state.position === 'undefined') {
250
+ return this.config.position
266
251
  }
267
252
 
268
- private setSize(data: { width: number, height: number}) {
269
- if (!this.state.size) {
270
- this.state.size = { width: undefined, height: undefined }
271
- }
253
+ return this.state.position
254
+ }
255
+
256
+ // sizes
257
+
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
+ }
272
289
 
273
- this.state.size.width = data.width
274
- this.state.size.height = data.height
290
+ public setSize(data: { width: number; height: number }) {
291
+ if (!this.state.size) {
292
+ this.state.size = { width: undefined, height: undefined }
275
293
  }
276
294
 
277
- // minimize
295
+ this.state.size.width = data.width
296
+ this.state.size.height = data.height
297
+ }
278
298
 
279
- get isMinimizable() {
280
- if (this.config.overridable?.minimizable) {
281
- return !!this.state.minimizable
282
- }
299
+ // minimize
283
300
 
284
- return !!this.config.minimizable
301
+ get isMinimizable() {
302
+ if (this.config.overridable?.minimizable) {
303
+ return !!this.state.minimizable
285
304
  }
286
305
 
287
- private minimize() {
288
- if (!this.isMinimizable) {
289
- return false
290
- }
306
+ return !!this.config.minimizable
307
+ }
291
308
 
292
- this.state.active = false
293
- return true
309
+ public minimize() {
310
+ if (!this.isMinimizable) {
311
+ return false
294
312
  }
295
313
 
296
- private toggleMinimize() {
297
- this.state.active = !this.state.active
298
- this.bringToFront()
299
- }
314
+ this.state.active = false
315
+ return true
316
+ }
300
317
 
301
- // maximize
318
+ public unminimize() {
319
+ this.state.active = true
320
+ return true
321
+ }
302
322
 
303
- get isMaximizable() {
304
- if (typeof this.state.maximizable === 'undefined') {
305
- return !!this.config.maximizable
306
- }
323
+ public toggleMinimize() {
324
+ this.state.active = !this.state.active
325
+ this.focus()
326
+ }
327
+
328
+ // maximize
307
329
 
308
- return this.state.maximizable
330
+ get isMaximizable() {
331
+ if (typeof this.state.maximizable === 'undefined') {
332
+ return !!this.config.maximizable
309
333
  }
310
334
 
311
- get isMaximized() {
312
- if (this.config.overridable?.maximized) {
313
- return !!this.state.maximized
314
- }
335
+ return this.state.maximizable
336
+ }
315
337
 
316
- return !!this.config.maximized
338
+ get isMaximized() {
339
+ if (this.config.overridable?.maximized) {
340
+ return !!this.state.maximized
317
341
  }
318
342
 
319
- private toggleMaximize() {
320
- if (!this.isMaximizable) {
321
- return false
322
- }
343
+ return !!this.config.maximized
344
+ }
323
345
 
324
- this.state.maximized = !this.state.maximized
325
- return true
346
+ public toggleMaximize() {
347
+ if (!this.isMaximizable) {
348
+ return false
326
349
  }
327
350
 
328
- private maximize() {
329
- if (!this.isMaximizable) {
330
- return false
331
- }
351
+ this.state.maximized = !this.state.maximized
352
+ return true
353
+ }
332
354
 
333
- this.state.maximized = true
334
- return true
355
+ public maximize() {
356
+ if (!this.isMaximizable) {
357
+ return false
335
358
  }
336
359
 
337
- private unmaximize() {
338
- if (!this.isMaximizable) {
339
- return false
340
- }
360
+ this.state.maximized = true
361
+ return true
362
+ }
341
363
 
342
- this.state.maximized = false
343
- return true
364
+ public unmaximize() {
365
+ if (!this.isMaximizable) {
366
+ return false
344
367
  }
345
368
 
346
- // destroy
369
+ this.state.maximized = false
370
+ return true
371
+ }
347
372
 
348
- get isDestroyable() {
349
- if (this.config.overridable?.destroyable) {
350
- return !!this.state.destroyable
351
- }
373
+ // destroy
352
374
 
353
- return !!this.config.destroyable
375
+ get isDestroyable() {
376
+ if (this.config.overridable?.destroyable) {
377
+ return !!this.state.destroyable
354
378
  }
355
379
 
356
- private destroy() {
357
- if (!this.isDestroyable) {
358
- return false
359
- }
360
-
361
- this.application.closeWindow(this.state.id)
380
+ return !!this.config.destroyable
381
+ }
362
382
 
363
- return true
383
+ public destroy() {
384
+ if (!this.isDestroyable) {
385
+ return false
364
386
  }
365
387
 
366
- // draggable
367
- get isDraggable() {
368
- if (this.config.overridable?.draggable) {
369
- return !!this.state.draggable
370
- }
388
+ this.application.closeWindow(this.state.id)
389
+
390
+ return true
391
+ }
371
392
 
372
- return !!this.config.draggable
393
+ // draggable
394
+ get isDraggable() {
395
+ if (this.config.overridable?.draggable) {
396
+ return !!this.state.draggable
373
397
  }
374
398
 
375
- // resizable
376
- get isResizable() {
377
- if (this.config.overridable?.resizable) {
378
- return !!this.state.resizable
379
- }
399
+ return !!this.config.draggable
400
+ }
380
401
 
381
- return !!this.config.resizable
402
+ // resizable
403
+ get isResizable() {
404
+ if (this.config.overridable?.resizable) {
405
+ return !!this.state.resizable
382
406
  }
383
407
 
384
- // workspace
385
- private setWorkspace(workspaceId: string) {
386
- this.state.workspace = workspaceId
387
- }
408
+ return !!this.config.resizable
409
+ }
388
410
 
389
- // override
411
+ // workspace
412
+ public setWorkspace(workspaceId: string) {
413
+ this.state.workspace = workspaceId
414
+ }
390
415
 
391
- setTitleOverride(value: undefined|string) {
392
- this.override.title = value
393
- }
416
+ // override
394
417
 
395
- resetTitleOverride() {
396
- this.override.title = undefined
397
- }
418
+ public setTitleOverride(value: undefined | string) {
419
+ this.override.title = value
420
+ }
398
421
 
399
- get actions() {
400
- return {
401
- // position
402
- setActive: this.setActive.bind(this),
403
- setFocus: this.setFocus.bind(this),
404
- bringToFront: this.bringToFront.bind(this),
405
- setPosition: this.setPosition.bind(this),
422
+ public resetTitleOverride() {
423
+ this.override.title = undefined
424
+ }
406
425
 
407
- // size
408
- setSize: this.setSize.bind(this),
426
+ // menu
409
427
 
410
- // minimize
411
- minimize: this.minimize.bind(this),
412
- toggleMinimize: this.toggleMinimize.bind(this),
428
+ public menu: any[] = []
413
429
 
414
- // maximize
415
- toggleMaximize: this.toggleMaximize.bind(this),
416
- maximize: this.maximize.bind(this),
417
- unmaximize: this.unmaximize.bind(this),
430
+ public setMenu(menu: any[]) {
431
+ this.menu = menu
432
+ }
418
433
 
419
- // destroy
420
- 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),
421
443
 
422
- // workspace
423
- setWorkspace: this.setWorkspace.bind(this),
444
+ // size
445
+ setSize: this.setSize.bind(this),
424
446
 
425
- // override
426
- setTitleOverride: this.setTitleOverride.bind(this),
427
- resetTitleOverride: this.resetTitleOverride.bind(this),
428
- }
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),
429
465
  }
466
+ }
430
467
  }