@owdproject/core 3.1.2 → 3.1.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.
package/README.md CHANGED
@@ -55,7 +55,7 @@ You can discover new apps by searching for the [owd-apps](https://github.com/top
55
55
  For example, to install the To-do app:
56
56
 
57
57
  ```bash
58
- nx run desktop:install-app --name=@owdproject/app-todo
58
+ owd install-app @owdproject/app-todo
59
59
  ```
60
60
 
61
61
  This will install the package and automatically register it in your desktop configuration.
@@ -67,7 +67,7 @@ You can discover new modules by searching for the [owd-modules](https://github.c
67
67
  For example, to install the session persistence module:
68
68
 
69
69
  ```bash
70
- nx run desktop:install-module --name=@owdproject/module-pinia-localforage
70
+ owd install-module @owdproject/module-pinia-localforage
71
71
  ```
72
72
 
73
73
  ### 🖥️ Themes
@@ -78,7 +78,7 @@ Each theme provides a unique look and feel while maintaining consistent function
78
78
  You can discover new themes by searching for the [owd-themes](https://github.com/topics/owd-themes) tag on GitHub.
79
79
 
80
80
  ```bash
81
- nx run desktop:install-theme --name=@owdproject/theme-gnome
81
+ owd install-theme @owdproject/theme-gnome
82
82
  ```
83
83
 
84
84
  ## Sponsors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owdproject/core",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "keywords": [
5
5
  "web",
6
6
  "desktop",
@@ -1,8 +1,8 @@
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
8
  public readonly application: IApplicationController
@@ -70,7 +70,7 @@ export class WindowController implements IWindowController {
70
70
  // component
71
71
  if (config.component) {
72
72
  this.config.component = markRaw(
73
- defineAsyncComponent(config.component)
73
+ defineAsyncComponent(config.component),
74
74
  )
75
75
  }
76
76
 
@@ -87,10 +87,14 @@ export class WindowController implements IWindowController {
87
87
  // sizes
88
88
  if (config.size?.width) this.config.size.width = config.size.width
89
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
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
94
98
 
95
99
  // minimize
96
100
  if (typeof config.minimizable !== 'undefined') {
@@ -137,7 +141,7 @@ export class WindowController implements IWindowController {
137
141
 
138
142
  this.config.overridable = {
139
143
  ...DEFAULT_OVERRIDABLE,
140
- ...(config.overridable || {})
144
+ ...(config.overridable || {}),
141
145
  }
142
146
  }
143
147
 
@@ -173,24 +177,24 @@ export class WindowController implements IWindowController {
173
177
 
174
178
  // position
175
179
 
176
- private setPosition(data: { x: number, y: number}) {
180
+ public setPosition(data: { x: number; y: number }) {
177
181
  if (!this.state.position) {
178
- this.state.position = { x: 0, y: 0}
182
+ this.state.position = { x: 0, y: 0 }
179
183
  }
180
184
 
181
185
  this.state.position.x = data.x
182
186
  this.state.position.y = data.y
183
187
  }
184
188
 
185
- private setActive(value: boolean) {
189
+ public setActive(value: boolean) {
186
190
  this.state.active = value
187
191
  }
188
192
 
189
- private setFocus(value: boolean) {
193
+ public setFocus(value: boolean) {
190
194
  this.state.focused = value
191
195
  }
192
196
 
193
- private bringToFront() {
197
+ public focus() {
194
198
  const applicationManager = useApplicationManager()
195
199
  const desktopWindowStore = useDesktopWindowStore()
196
200
 
@@ -256,16 +260,34 @@ export class WindowController implements IWindowController {
256
260
  const configSize = this.config.size || {}
257
261
 
258
262
  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),
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),
265
287
  }
266
288
  }
267
289
 
268
- private setSize(data: { width: number, height: number}) {
290
+ public setSize(data: { width: number; height: number }) {
269
291
  if (!this.state.size) {
270
292
  this.state.size = { width: undefined, height: undefined }
271
293
  }
@@ -284,7 +306,7 @@ export class WindowController implements IWindowController {
284
306
  return !!this.config.minimizable
285
307
  }
286
308
 
287
- private minimize() {
309
+ public minimize() {
288
310
  if (!this.isMinimizable) {
289
311
  return false
290
312
  }
@@ -293,9 +315,14 @@ export class WindowController implements IWindowController {
293
315
  return true
294
316
  }
295
317
 
296
- private toggleMinimize() {
318
+ public unminimize() {
319
+ this.state.active = true
320
+ return true
321
+ }
322
+
323
+ public toggleMinimize() {
297
324
  this.state.active = !this.state.active
298
- this.bringToFront()
325
+ this.focus()
299
326
  }
300
327
 
301
328
  // maximize
@@ -316,7 +343,7 @@ export class WindowController implements IWindowController {
316
343
  return !!this.config.maximized
317
344
  }
318
345
 
319
- private toggleMaximize() {
346
+ public toggleMaximize() {
320
347
  if (!this.isMaximizable) {
321
348
  return false
322
349
  }
@@ -325,7 +352,7 @@ export class WindowController implements IWindowController {
325
352
  return true
326
353
  }
327
354
 
328
- private maximize() {
355
+ public maximize() {
329
356
  if (!this.isMaximizable) {
330
357
  return false
331
358
  }
@@ -334,7 +361,7 @@ export class WindowController implements IWindowController {
334
361
  return true
335
362
  }
336
363
 
337
- private unmaximize() {
364
+ public unmaximize() {
338
365
  if (!this.isMaximizable) {
339
366
  return false
340
367
  }
@@ -353,7 +380,7 @@ export class WindowController implements IWindowController {
353
380
  return !!this.config.destroyable
354
381
  }
355
382
 
356
- private destroy() {
383
+ public destroy() {
357
384
  if (!this.isDestroyable) {
358
385
  return false
359
386
  }
@@ -382,26 +409,28 @@ export class WindowController implements IWindowController {
382
409
  }
383
410
 
384
411
  // workspace
385
- private setWorkspace(workspaceId: string) {
412
+ public setWorkspace(workspaceId: string) {
386
413
  this.state.workspace = workspaceId
387
414
  }
388
415
 
389
416
  // override
390
417
 
391
- setTitleOverride(value: undefined|string) {
418
+ public setTitleOverride(value: undefined | string) {
392
419
  this.override.title = value
393
420
  }
394
421
 
395
- resetTitleOverride() {
422
+ public resetTitleOverride() {
396
423
  this.override.title = undefined
397
424
  }
398
425
 
426
+ // deprecated ?
399
427
  get actions() {
400
428
  return {
401
429
  // position
402
430
  setActive: this.setActive.bind(this),
403
431
  setFocus: this.setFocus.bind(this),
404
- bringToFront: this.bringToFront.bind(this),
432
+ bringToFront: this.focus.bind(this),
433
+ focus: this.focus.bind(this),
405
434
  setPosition: this.setPosition.bind(this),
406
435
 
407
436
  // size
package/.editorconfig DELETED
@@ -1,12 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_size = 2
5
- indent_style = space
6
- end_of_line = lf
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false