winui-svelte 0.0.2 → 0.0.4

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 (108) hide show
  1. package/API.md +120 -6
  2. package/README.md +70 -90
  3. package/dist/bindings/.dynwinrt-managed +1 -1
  4. package/dist/components/convert.d.ts +3 -3
  5. package/dist/components/convert.d.ts.map +1 -1
  6. package/dist/components/fluent-glyph.d.ts +4 -0
  7. package/dist/components/fluent-glyph.d.ts.map +1 -1
  8. package/dist/components/generated/controls/FontIcon.svelte.d.ts +1 -1
  9. package/dist/components/generated/controls/FontIconSource.svelte.d.ts +1 -1
  10. package/dist/components/generated/controls/UIElement.svelte.d.ts +1 -1
  11. package/dist/components/index.d.ts +4 -2
  12. package/dist/components/index.d.ts.map +1 -1
  13. package/dist/components/index.js.map +1 -1
  14. package/dist/css/runtime/resources.d.ts +1 -1
  15. package/dist/dev/dev-window.d.ts +23 -0
  16. package/dist/dev/dev-window.d.ts.map +1 -0
  17. package/dist/dev/dev-window.js +42 -0
  18. package/dist/dev/dev-window.js.map +1 -0
  19. package/dist/dev/index.d.ts +3 -0
  20. package/dist/dev/index.d.ts.map +1 -0
  21. package/dist/dev/index.js +2 -0
  22. package/dist/dev/index.js.map +1 -0
  23. package/dist/dev/start-dev.d.ts +47 -0
  24. package/dist/dev/start-dev.d.ts.map +1 -0
  25. package/dist/dev/start-dev.js +81 -0
  26. package/dist/dev/start-dev.js.map +1 -0
  27. package/dist/enums.d.ts +2 -0
  28. package/dist/enums.d.ts.map +1 -1
  29. package/dist/enums.js +2 -0
  30. package/dist/enums.js.map +1 -1
  31. package/dist/media/media-player.d.ts +8 -0
  32. package/dist/media/media-player.d.ts.map +1 -1
  33. package/dist/media/media-player.js +15 -0
  34. package/dist/media/media-player.js.map +1 -1
  35. package/dist/web-apis/window-geometry.d.ts +39 -0
  36. package/dist/web-apis/window-geometry.d.ts.map +1 -0
  37. package/dist/web-apis/window-geometry.js +95 -0
  38. package/dist/web-apis/window-geometry.js.map +1 -0
  39. package/dist/win2d/Canvas.svelte +1 -0
  40. package/dist/window/anchor.d.ts +92 -0
  41. package/dist/window/anchor.d.ts.map +1 -0
  42. package/dist/window/anchor.js +100 -0
  43. package/dist/window/anchor.js.map +1 -0
  44. package/dist/window/backdrop.d.ts +4 -1
  45. package/dist/window/backdrop.d.ts.map +1 -1
  46. package/dist/window/backdrop.js +10 -2
  47. package/dist/window/backdrop.js.map +1 -1
  48. package/dist/window/create-window.d.ts +1 -1
  49. package/dist/window/create-window.d.ts.map +1 -1
  50. package/dist/window/create-window.js +3 -1
  51. package/dist/window/create-window.js.map +1 -1
  52. package/dist/window/css-pixels.d.ts +14 -0
  53. package/dist/window/css-pixels.d.ts.map +1 -0
  54. package/dist/window/css-pixels.js +12 -0
  55. package/dist/window/css-pixels.js.map +1 -0
  56. package/dist/window/dock.d.ts +51 -0
  57. package/dist/window/dock.d.ts.map +1 -0
  58. package/dist/window/dock.js +69 -0
  59. package/dist/window/dock.js.map +1 -0
  60. package/dist/window/index.d.ts +4 -0
  61. package/dist/window/index.d.ts.map +1 -1
  62. package/dist/window/index.js +2 -0
  63. package/dist/window/index.js.map +1 -1
  64. package/dist/window/native.d.ts +2 -0
  65. package/dist/window/native.d.ts.map +1 -1
  66. package/dist/window/native.js +10 -0
  67. package/dist/window/native.js.map +1 -1
  68. package/dist/window/transparent-backdrop.d.ts +11 -0
  69. package/dist/window/transparent-backdrop.d.ts.map +1 -0
  70. package/dist/window/transparent-backdrop.js +35 -0
  71. package/dist/window/transparent-backdrop.js.map +1 -0
  72. package/dist/window/window-handle.d.ts +17 -0
  73. package/dist/window/window-handle.d.ts.map +1 -1
  74. package/dist/window/window-handle.js +23 -0
  75. package/dist/window/window-handle.js.map +1 -1
  76. package/dist/window/window-host.svelte.d.ts +17 -12
  77. package/dist/window/window-host.svelte.d.ts.map +1 -1
  78. package/dist/window/window-host.svelte.js +208 -23
  79. package/dist/window/window-host.svelte.js.map +1 -1
  80. package/dist/winui.d.ts +5 -0
  81. package/dist/winui.d.ts.map +1 -1
  82. package/dist/winui.js +5 -0
  83. package/dist/winui.js.map +1 -1
  84. package/package.json +25 -7
  85. package/src/components/convert.ts +3 -3
  86. package/src/components/fluent-glyph.ts +6 -0
  87. package/src/components/generated/controls/FontIcon.svelte.ts +1 -1
  88. package/src/components/generated/controls/FontIconSource.svelte.ts +1 -1
  89. package/src/components/generated/controls/UIElement.svelte.ts +1 -1
  90. package/src/components/index.ts +13 -2
  91. package/src/dev/dev-window.ts +63 -0
  92. package/src/dev/index.ts +2 -0
  93. package/src/dev/start-dev.ts +120 -0
  94. package/src/enums.ts +2 -0
  95. package/src/media/media-player.ts +17 -0
  96. package/src/web-apis/window-geometry.ts +106 -0
  97. package/src/window/anchor.ts +156 -0
  98. package/src/window/backdrop.ts +11 -2
  99. package/src/window/create-window.ts +5 -1
  100. package/src/window/css-pixels.ts +18 -0
  101. package/src/window/dock.ts +99 -0
  102. package/src/window/index.ts +4 -0
  103. package/src/window/native.ts +12 -0
  104. package/src/window/transparent-backdrop.ts +38 -0
  105. package/src/window/window-handle.ts +26 -0
  106. package/src/window/window-host.svelte.ts +256 -36
  107. package/src/winui.ts +5 -0
  108. package/web-types.json +3203 -1507
package/dist/winui.d.ts CHANGED
@@ -2,6 +2,9 @@ export { Application } from "#winui/microsoft/ui/xaml/Application";
2
2
  export { ColumnDefinition } from "#winui/microsoft/ui/xaml/controls/ColumnDefinition";
3
3
  export { Grid } from "#winui/microsoft/ui/xaml/controls/Grid";
4
4
  export { RowDefinition } from "#winui/microsoft/ui/xaml/controls/RowDefinition";
5
+ export { ScrollBarVisibility } from "#winui/microsoft/ui/xaml/controls/ScrollBarVisibility";
6
+ export { ScrollMode } from "#winui/microsoft/ui/xaml/controls/ScrollMode";
7
+ export { ScrollViewer } from "#winui/microsoft/ui/xaml/controls/ScrollViewer";
5
8
  export { Run } from "#winui/microsoft/ui/xaml/documents/Run";
6
9
  export { DispatcherQueue } from "#winui/microsoft/ui/dispatching/DispatcherQueue";
7
10
  export { DesktopAcrylicBackdrop } from "#winui/microsoft/ui/xaml/media/DesktopAcrylicBackdrop";
@@ -12,6 +15,8 @@ export { DesktopAcrylicKind } from "#winui/microsoft/ui/composition/system-backd
12
15
  export { SystemBackdropConfiguration } from "#winui/microsoft/ui/composition/system-backdrops/SystemBackdropConfiguration";
13
16
  export { SystemBackdropTheme } from "#winui/microsoft/ui/composition/system-backdrops/SystemBackdropTheme";
14
17
  export { ICompositionSupportsSystemBackdrop } from "#winui/microsoft/ui/composition/ICompositionSupportsSystemBackdrop";
18
+ export { Compositor as SystemCompositor } from "#winui/windows/ui/composition/Compositor";
19
+ export { CompositionColorBrush as SystemCompositionColorBrush } from "#winui/windows/ui/composition/CompositionColorBrush";
15
20
  export { MicaKind } from "#winui/microsoft/ui/composition/system-backdrops/MicaKind";
16
21
  export { AppWindow } from "#winui/microsoft/ui/windowing/AppWindow";
17
22
  export { AppWindowPresenterKind } from "#winui/microsoft/ui/windowing/AppWindowPresenterKind";
@@ -1 +1 @@
1
- {"version":3,"file":"winui.d.ts","sourceRoot":"","sources":["../src/winui.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,MAAM,wCAAwC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,2EAA2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Application } from "#winui/microsoft/ui/xaml/Application";
7
7
  export { ColumnDefinition } from "#winui/microsoft/ui/xaml/controls/ColumnDefinition";
8
8
  export { Grid } from "#winui/microsoft/ui/xaml/controls/Grid";
9
9
  export { RowDefinition } from "#winui/microsoft/ui/xaml/controls/RowDefinition";
10
+ export { ScrollBarVisibility } from "#winui/microsoft/ui/xaml/controls/ScrollBarVisibility";
11
+ export { ScrollMode } from "#winui/microsoft/ui/xaml/controls/ScrollMode";
12
+ export { ScrollViewer } from "#winui/microsoft/ui/xaml/controls/ScrollViewer";
10
13
  export { Run } from "#winui/microsoft/ui/xaml/documents/Run";
11
14
  export { DispatcherQueue } from "#winui/microsoft/ui/dispatching/DispatcherQueue";
12
15
  export { DesktopAcrylicBackdrop } from "#winui/microsoft/ui/xaml/media/DesktopAcrylicBackdrop";
@@ -17,6 +20,8 @@ export { DesktopAcrylicKind } from "#winui/microsoft/ui/composition/system-backd
17
20
  export { SystemBackdropConfiguration } from "#winui/microsoft/ui/composition/system-backdrops/SystemBackdropConfiguration";
18
21
  export { SystemBackdropTheme } from "#winui/microsoft/ui/composition/system-backdrops/SystemBackdropTheme";
19
22
  export { ICompositionSupportsSystemBackdrop } from "#winui/microsoft/ui/composition/ICompositionSupportsSystemBackdrop";
23
+ export { Compositor as SystemCompositor } from "#winui/windows/ui/composition/Compositor";
24
+ export { CompositionColorBrush as SystemCompositionColorBrush } from "#winui/windows/ui/composition/CompositionColorBrush";
20
25
  export { MicaKind } from "#winui/microsoft/ui/composition/system-backdrops/MicaKind";
21
26
  export { AppWindow } from "#winui/microsoft/ui/windowing/AppWindow";
22
27
  export { AppWindowPresenterKind } from "#winui/microsoft/ui/windowing/AppWindowPresenterKind";
package/dist/winui.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"winui.js","sourceRoot":"","sources":["../src/winui.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,2EAA2E;AAC3E,+EAA+E;AAC/E,2EAA2E;AAC3E,yDAAyD;A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uD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAC;AACjH,OAAO,EAAE,0BAA0B,EAAE,MAAM,+EAA+E,CAAC;AAC3H,OAAO,EAAE,uBAAuB,EAAE,MAAM,4EAA4E,CAAC;AACrH,OAAO,EAAE,0BAA0B,EAAE,MAAM,+EAA+E,CAAC;AAC3H,OAAO,EAAE,uBAAuB,EAAE,MAAM,4EAA4E,CAAC;AACrH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8EAA8E,CAAC;AACzH,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,0EAA0E,CAAC;AACzH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mEAAmE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winui-svelte",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "web-types": "./web-types.json",
5
5
  "description": "WinUI 3 controls as Svelte components: native Windows apps in Svelte, for Tauri, Electron or Node",
6
6
  "keywords": [
@@ -216,6 +216,10 @@
216
216
  "default": "./dist/css/validate/stylelint.js"
217
217
  },
218
218
  "./vscode-css-data.json": "./dist/css/validate/vscode-css-data.json",
219
+ "./dev": {
220
+ "types": "./dist/dev/index.d.ts",
221
+ "default": "./dist/dev/index.js"
222
+ },
219
223
  "./vite": {
220
224
  "types": "./dist/vite/index.d.ts",
221
225
  "default": "./dist/vite/index.js"
@@ -494,8 +498,9 @@
494
498
  "@microsoft/winappcli": "0.7.1",
495
499
  "@stylistic/eslint-plugin": "^5.10.0",
496
500
  "@types/node": "^24.10.0",
501
+ "@types/vscode": "1.105.0",
497
502
  "esbuild": "~0.25.12",
498
- "eslint": "^10.12.0",
503
+ "eslint": "^10.14.0",
499
504
  "eslint-plugin-import-newlines": "^2.0.0",
500
505
  "eslint-plugin-jsdoc": "^65.4.2",
501
506
  "eslint-plugin-perfectionist": "^5.12.1",
@@ -504,9 +509,9 @@
504
509
  "fallow": "2.103.0",
505
510
  "globals": "^17.13.0",
506
511
  "lint-staged": "^17.6.0",
507
- "oxlint": "1.88.0",
512
+ "oxlint": "1.90.0",
508
513
  "oxlint-tsgolint": "^7.0.2004",
509
- "postcss": "^8.5.31",
514
+ "postcss": "^8.5.32",
510
515
  "postcss-html": "^1.8.1",
511
516
  "publint": "^0.3.25",
512
517
  "simple-git-hooks": "^2.14.0",
@@ -517,7 +522,7 @@
517
522
  "svelte-eslint-parser": "^1.10.0",
518
523
  "svelte-language-server": "0.18.5",
519
524
  "typescript": "^6.0.3",
520
- "typescript-eslint": "^8.71.2",
525
+ "typescript-eslint": "^8.72.1",
521
526
  "vite": "8.3.4"
522
527
  },
523
528
  "winapp": {
@@ -1074,6 +1079,13 @@
1074
1079
  "Launcher"
1075
1080
  ]
1076
1081
  },
1082
+ {
1083
+ "namespace": "Windows.UI.Composition",
1084
+ "classes": [
1085
+ "CompositionColorBrush",
1086
+ "Compositor"
1087
+ ]
1088
+ },
1077
1089
  {
1078
1090
  "namespace": "Windows.UI.ViewManagement",
1079
1091
  "classes": [
@@ -1104,6 +1116,11 @@
1104
1116
  "check": "tsc --noEmit && svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
1105
1117
  "check:editor": "node --disable-warning=ExperimentalWarning scripts/editor/check-editor.ts",
1106
1118
  "check:webstorm": "node --disable-warning=ExperimentalWarning scripts/editor/check-webstorm.ts",
1119
+ "build:vscode-extension": "node --disable-warning=ExperimentalWarning scripts/editor/build-vscode-extension.ts",
1120
+ "install:vscode-extension": "node --disable-warning=ExperimentalWarning scripts/editor/install-vscode-extension.ts",
1121
+ "install:webstorm-plugin": "node --disable-warning=ExperimentalWarning scripts/editor/install-webstorm-plugin.ts",
1122
+ "check:webstorm-plugin-compat": "node --disable-warning=ExperimentalWarning scripts/editor/check-webstorm-plugin.ts --verify",
1123
+ "check:webstorm-plugin": "node --disable-warning=ExperimentalWarning scripts/editor/check-webstorm-plugin.ts",
1107
1124
  "check:svelte-matrix": "node --disable-warning=ExperimentalWarning scripts/svelte-matrix/check.ts",
1108
1125
  "check:package": "node --disable-warning=ExperimentalWarning scripts/pack/check-package.ts",
1109
1126
  "fallow": "fallow",
@@ -1115,13 +1132,14 @@
1115
1132
  "gen:css-data:check": "node --disable-warning=ExperimentalWarning scripts/css/export-vscode-css-data.ts --check",
1116
1133
  "gen:components:check": "node --disable-warning=ExperimentalWarning scripts/codegen/generate.ts --check",
1117
1134
  "lint": "node --disable-warning=ExperimentalWarning scripts/lint/lint.ts",
1118
- "lint:fix": "oxlint --type-aware --fix -c .oxlintrc.fix.json && eslint --concurrency auto --fix --no-warn-ignored && oxlint --type-aware",
1135
+ "lint:fix": "eslint --concurrency auto --fix --no-warn-ignored && oxlint --type-aware --fix && pnpm lint:kotlin:fix",
1136
+ "lint:kotlin:fix": "node --disable-warning=ExperimentalWarning scripts/editor/check-webstorm-plugin.ts --fix-kotlin",
1119
1137
  "lint:oxlint": "oxlint --type-aware",
1120
1138
  "lint:eslint": "eslint --concurrency auto --cache --cache-location .verify/eslint-cache .",
1121
1139
  "lint:eslint:full": "eslint --concurrency auto .",
1122
1140
  "lint:stylelint": "stylelint \"**/*.svelte\" --ignore-pattern src/components/generated",
1123
1141
  "lint:summary": "node --disable-warning=ExperimentalWarning scripts/lint/summary.ts",
1124
- "test": "pnpm build && node --disable-warning=ExperimentalWarning --test --test-timeout=120000 \"src/**/*.test.ts\" \"scripts/**/*.test.ts\" test/mount-all.test.ts",
1142
+ "test": "pnpm build && node --disable-warning=ExperimentalWarning --test --test-timeout=120000 \"src/**/*.test.ts\" \"scripts/**/*.test.ts\" \"ide/vscode/**/*.test.ts\" test/mount-all.test.ts",
1125
1143
  "verify:electron": "node --disable-warning=ExperimentalWarning scripts/verify/electron-smoke.ts",
1126
1144
  "test:windows": "pnpm build && node --disable-warning=ExperimentalWarning scripts/test-windows.ts"
1127
1145
  }
@@ -1,4 +1,4 @@
1
- import type { FluentGlyphName } from "./fluent-glyph.ts";
1
+ import type { FluentGlyphCode, FluentGlyphValue } from "./fluent-glyph.ts";
2
2
  import type { FontFamilyName } from "./font-family-name.ts";
3
3
  import {
4
4
  Application,
@@ -203,8 +203,8 @@ export type GeometryInput = string | Geometry;
203
203
  /** A font family name or a font family. */
204
204
  export type FontFamilyInput = FontFamilyName | (string & Record<never, never>) | FontFamily;
205
205
 
206
- /** An icon glyph: a name of Segoe Fluent Icons ("Save"), a code point (`0xE74E`), code points to compose, or text. */
207
- export type GlyphInput = FluentGlyphName | (string & Record<never, never>) | number | readonly number[];
206
+ /** An icon glyph: a Fluent name ("Save"), its code point (`FluentGlyph.Save`), code points to compose, or text. */
207
+ export type GlyphInput = FluentGlyphValue | (string & Record<never, never>) | readonly FluentGlyphCode[];
208
208
 
209
209
  /** A URI string or a URI. */
210
210
  export type UriInput = string | Uri;
@@ -1545,3 +1545,9 @@ export const FluentGlyph = {
1545
1545
 
1546
1546
  /** The name of an icon of Segoe Fluent Icons. */
1547
1547
  export type FluentGlyphName = keyof typeof FluentGlyph;
1548
+
1549
+ /** The code point of an icon of Segoe Fluent Icons: the only numbers a `glyph` takes. */
1550
+ export type FluentGlyphCode = (typeof FluentGlyph)[FluentGlyphName];
1551
+
1552
+ /** An icon of Segoe Fluent Icons by its name or its code point. */
1553
+ export type FluentGlyphValue = FluentGlyphName | FluentGlyphCode;
@@ -59,7 +59,7 @@ export interface FontIconProps extends IconElementProps {
59
59
  /**
60
60
  * Gets or sets the character code that identifies the icon glyph. The hexadecimal character code for the icon glyph.
61
61
  *
62
- * Accepts an icon glyph: a name of Segoe Fluent Icons ("Save"), a code point (`0xE74E`), code points to compose, or text.
62
+ * Accepts an icon glyph: a Fluent name ("Save"), its code point (`FluentGlyph.Save`), code points to compose, or text.
63
63
  *
64
64
  * @see https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.fonticon.glyph
65
65
  */
@@ -59,7 +59,7 @@ export interface FontIconSourceProps extends IconSourceProps {
59
59
  /**
60
60
  * Gets or sets the character code that identifies the icon glyph. The hexadecimal character code for the icon glyph.
61
61
  *
62
- * Accepts an icon glyph: a name of Segoe Fluent Icons ("Save"), a code point (`0xE74E`), code points to compose, or text.
62
+ * Accepts an icon glyph: a Fluent name ("Save"), its code point (`FluentGlyph.Save`), code points to compose, or text.
63
63
  *
64
64
  * @see https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.fonticonsource.glyph
65
65
  */
@@ -761,7 +761,7 @@ export interface UIElementProps {
761
761
  /**
762
762
  * Gets or sets the visibility of a UIElement. A UIElement that is not visible is not rendered and does not communicate its desired size to layout. A value of the enumeration. The default value is Visible.
763
763
  *
764
- * Also settable in CSS as `visibility`
764
+ * Also settable in CSS as `display`
765
765
  *
766
766
  * @see https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.visibility
767
767
  */
@@ -22,16 +22,27 @@ export type {
22
22
  export { NavigationCacheMode, NavigationMode } from "./hand-written/navigation/navigation-stack.ts";
23
23
  export { MoveDirection } from "./hand-written/items/reorder.ts";
24
24
  export { FluentGlyph } from "./fluent-glyph.ts";
25
- export type { FluentGlyphName } from "./fluent-glyph.ts";
25
+ export type { FluentGlyphCode, FluentGlyphName, FluentGlyphValue } from "./fluent-glyph.ts";
26
26
  export type { FontFamilyName } from "./font-family-name.ts";
27
27
  export { isColorText, ticksDate, ticksMilliseconds } from "./values.ts";
28
28
  export type { ColorInput, ColorKeyword, ColorText, GridLengthText, HexColor } from "./values.ts";
29
- export type { AppBrushes, BrushInput, EnumInput, FlagsInput, GlyphInput, GridLengthInput } from "./convert.ts";
29
+ export type {
30
+ AppBrushes,
31
+ BrushInput,
32
+ EnumInput,
33
+ FlagsInput,
34
+ FontFamilyInput,
35
+ GeometryInput,
36
+ GlyphInput,
37
+ GridLengthInput
38
+ } from "./convert.ts";
30
39
  export type { ResourceRecordInput, ResourceValueInput } from "./resource-record.ts";
31
40
  export { installMedia } from "./media.ts";
32
41
  export { goToState, installXaml, resourceDictionaryOf, xamlOf } from "./xaml.ts";
33
42
  export type { XamlSource } from "./xaml-source.ts";
34
43
  export { XamlKind } from "./xaml-source.ts";
35
44
  export type { CaptionButtonColors, TitleBarHeight, WindowPresentation, WindowRegion, WindowTheme } from "#src/window/chrome.js";
45
+ export type { DockDisplay, DockOptions } from "#src/window/dock.js";
46
+ export type { SizeToContent, WindowAnchor } from "#src/window/anchor.js";
36
47
  export type { WindowHandle } from "#src/window/window-handle.js";
37
48
  export type { WindowBounds, WindowPlacement } from "#src/window/window-host.svelte.js";
@@ -0,0 +1,63 @@
1
+ import type { Json } from "#src/messaging/json.js";
2
+ import type * as StateModule from "#src/state/index.js";
3
+ import { createWindowModuleRunner } from "#src/vite/runner.js";
4
+ import type { WindowOptions } from "#src/window/create-window.js";
5
+ import type * as WindowModule from "#src/window/index.js";
6
+ import { runOnUiThread } from "#src/window/thread.js";
7
+ import type { MessagePort } from "node:worker_threads";
8
+
9
+ /** The window's chrome `startDev` takes: what `createWindow` takes besides the content and the owner. */
10
+ export type DevWindowChrome = Omit<Extract<WindowOptions<object>, { component: unknown }>, "component" | "owner" | "props">;
11
+
12
+ /** What the dev window's thread is started with. */
13
+ export interface DevWindowData {
14
+ modules: MessagePort;
15
+ /** The host's end of the link, when the app has one: the component then gets a `channel` prop. */
16
+ link: MessagePort | null;
17
+ component: string;
18
+ props: Record<string, Json>;
19
+ window: DevWindowChrome;
20
+ }
21
+
22
+ /**
23
+ * The window's side of `startDev`: enters the apartment, loads the component
24
+ * through the module server (so a saved file updates the open window) and
25
+ * opens it in a window.
26
+ */
27
+ export async function runDevWindow(data: DevWindowData) {
28
+ await runOnUiThread(async () => {
29
+ const { runner } = createWindowModuleRunner(data.modules);
30
+ const { createWindow, exitWhenHostEnds, runWindow } = await runner.import<typeof WindowModule>("winui-svelte/window");
31
+ const { default: component } = await runner.import(data.component);
32
+ const { createHostChannel, createMessagePortTransport } = await runner.import<typeof StateModule>(
33
+ "winui-svelte/state"
34
+ );
35
+ const { link } = data;
36
+ await runWindow({
37
+ onStart() {
38
+ const hasLink = link !== null;
39
+ if (!hasLink) {
40
+ createWindow({
41
+ ...data.window,
42
+ component,
43
+ props: data.props
44
+ });
45
+ return;
46
+ }
47
+
48
+ const channel = createHostChannel({
49
+ transport: createMessagePortTransport({ port: link })
50
+ });
51
+ exitWhenHostEnds({ link: channel });
52
+ createWindow({
53
+ ...data.window,
54
+ component,
55
+ props: {
56
+ ...data.props,
57
+ channel
58
+ }
59
+ });
60
+ }
61
+ });
62
+ });
63
+ }
@@ -0,0 +1,2 @@
1
+ export type { DevOptions } from "./start-dev.ts";
2
+ export { startDev } from "./start-dev.ts";
@@ -0,0 +1,120 @@
1
+ import type { DevWindowChrome, DevWindowData } from "./dev-window.ts";
2
+ import type { Json } from "#src/messaging/json.js";
3
+ import type { Transport } from "#src/state/host.js";
4
+ import { createStdioTransport, reserveStdout } from "#src/state/host.js";
5
+ import { startModuleServer } from "#src/vite/server.js";
6
+ import { initWindowsAppSdk } from "#src/window/bootstrap.js";
7
+ import path from "node:path";
8
+ import { pathToFileURL } from "node:url";
9
+ import { MessageChannel, Worker } from "node:worker_threads";
10
+
11
+ /** What `startDev` opens and where its modules come from. */
12
+ export interface DevOptions {
13
+ /** The folder of the app's sources, which the dev server serves and watches. */
14
+ root: string;
15
+
16
+ /** The window's root component, as a path under `root` that starts with a slash (`"/App.svelte"`). */
17
+ component: string;
18
+
19
+ /** The component's props: JSON, since they cross to the window's thread. */
20
+ props?: Record<string, Json>;
21
+
22
+ /** The window's title, size, backdrop and the other chrome `createWindow` takes, besides its content and owner. */
23
+ window?: DevWindowChrome;
24
+
25
+ /**
26
+ * The app's link to the framework that starts it (a Tauri core, an Electron
27
+ * main process, a script): `"stdio"` when it started this process as a
28
+ * sidecar and speaks JSON lines on its pipes, or a transport of its own
29
+ * (`utilityProcess`'s parent port, say). The component then gets a
30
+ * `channel` prop (`hostState`, `channel.send`), and the window closes when
31
+ * the link ends.
32
+ */
33
+ host?: "stdio" | Transport;
34
+
35
+ /** The app's Vite config, whose plugins should include `winuiSvelte()`; the plugin's defaults serve without one. */
36
+ configFile?: string;
37
+
38
+ /** Modules Node loads itself rather than Vite: an app's own native modules. */
39
+ isNative?: (file: string) => boolean;
40
+ }
41
+
42
+ // The window's thread is a worker that loads this package's dev-window module,
43
+ // from source (.ts) or from the published package (.js).
44
+ const WINDOW_MODULE = path.join(import.meta.dirname, `dev-window${path.extname(import.meta.filename)}`);
45
+ const WORKER_SOURCE = `const { workerData } = require("node:worker_threads");
46
+ import(workerData.moduleUrl).then(module => module.runDevWindow(workerData.data));`;
47
+
48
+ // The host's transport and the window's end of a MessageChannel, joined: what
49
+ // the host sends reaches the window, what the window sends reaches the host.
50
+ function linkTo(host: "stdio" | Transport) {
51
+ const isStdio = host === "stdio";
52
+ if (isStdio) {
53
+ reserveStdout();
54
+ }
55
+
56
+ const transport = isStdio ? createStdioTransport() : host;
57
+ const link = new MessageChannel();
58
+ transport.listen({
59
+ message: frame => link.port1.postMessage(frame),
60
+ malformed: reason => process.stderr.write(
61
+ `host: malformed message: ${reason}
62
+ `
63
+ ),
64
+ closed: () => link.port1.close()
65
+ });
66
+ link.port1.on("message", frame => transport.send(frame));
67
+ return link;
68
+ }
69
+
70
+ /**
71
+ * Opens the app in a window and keeps it live: a saved `.svelte` or `.ts`
72
+ * file updates the open window without a restart. It starts the Windows App
73
+ * SDK, a Vite dev server for the app's modules and the window's thread, so the
74
+ * host is one call:
75
+ *
76
+ * ```ts
77
+ * import { startDev } from "winui-svelte/dev";
78
+ *
79
+ * process.exitCode = await startDev({
80
+ * root: import.meta.dirname,
81
+ * component: "/App.svelte",
82
+ * window: { title: "My app" }
83
+ * });
84
+ * ```
85
+ *
86
+ * @returns The exit code, once the window has closed and the dev server has stopped.
87
+ */
88
+ export async function startDev({ component, props = {}, window = {}, host, ...serverOptions }: DevOptions) {
89
+ const link = host === undefined ? null : linkTo(host);
90
+ initWindowsAppSdk();
91
+ const modules = new MessageChannel();
92
+ const server = await startModuleServer({
93
+ ...serverOptions,
94
+ port: modules.port1
95
+ });
96
+ const data: DevWindowData = {
97
+ modules: modules.port2,
98
+ link: link?.port2 ?? null,
99
+ component,
100
+ props,
101
+ window
102
+ };
103
+ const worker = new Worker(WORKER_SOURCE, {
104
+ eval: true,
105
+ workerData: {
106
+ moduleUrl: pathToFileURL(WINDOW_MODULE).href,
107
+ data
108
+ },
109
+ transferList: link === null ? [modules.port2] : [modules.port2, link.port2]
110
+ });
111
+ worker.on("error", error => {
112
+ process.stderr.write(`${error.stack ?? String(error)}\n`);
113
+ process.exitCode = 1;
114
+ });
115
+ const code = await new Promise<number>(resolve => {
116
+ worker.on("exit", resolve);
117
+ });
118
+ await server.close();
119
+ return process.exitCode ?? code;
120
+ }
package/src/enums.ts CHANGED
@@ -12,6 +12,8 @@ export { XamlKind } from "./components/xaml-source.ts";
12
12
  export { FocusKind } from "./renderer/host/focus-element.ts";
13
13
  export { TrayGesture } from "./tray/click-detector.ts";
14
14
  export { TrayBalloonIcon } from "./tray/tray-core.ts";
15
+ export { SizeToContent, WindowAnchor } from "./window/anchor.ts";
15
16
  export { Backdrop } from "./window/backdrop.ts";
16
17
  export { TitleBarHeight, WindowPresentation, WindowTheme } from "./window/chrome.ts";
18
+ export { DockDisplay } from "./window/dock.ts";
17
19
  export { PickerLocation } from "./window/pickers.ts";
@@ -5,6 +5,7 @@ import type { MediaPlaybackSourceInput } from "#src/components/convert.js";
5
5
  import { call, read } from "#src/renderer/host/reflect.js";
6
6
  import { flush } from "#src/scheduling.js";
7
7
  import { startTimer } from "#src/window/timers.js";
8
+ import type { MediaPlayerElement } from "#winui/microsoft/ui/xaml/controls/MediaPlayerElement";
8
9
  import { MediaSource } from "#winui/windows/media/core/MediaSource";
9
10
  import { IMediaPlaybackSource } from "#winui/windows/media/playback/IMediaPlaybackSource";
10
11
  import { MediaPlayer } from "#winui/windows/media/playback/MediaPlayer";
@@ -62,6 +63,11 @@ const PLAIN_KEYS = ["autoPlay", "isLoopingEnabled", "isMuted", "volume", "playba
62
63
  * not deliver an event raised there: the handlers in `options` run only
63
64
  * where WinUI raises on the UI thread, so rely on `state` and not on them.
64
65
  * Call it on the UI thread, and `dispose` when the player is no longer wanted.
66
+ * Show it in a MediaPlayerElement with `attachTo(element)`, not with the
67
+ * element's own `setMediaPlayer`: `dispose` then lets the element go first. A
68
+ * closed player still held by an element in a window makes WinUI abort
69
+ * `Window.Close` (E_ABORT), which ends the host when a hot update re-creates
70
+ * the window.
65
71
  */
66
72
  export function createMediaPlayer(options: MediaPlayerOptions = {}) {
67
73
  const player = new MediaPlayer();
@@ -98,14 +104,25 @@ export function createMediaPlayer(options: MediaPlayerOptions = {}) {
98
104
  player.source = mediaPlaybackSourceOf(source);
99
105
  }
100
106
 
107
+ const elements = new Set<MediaPlayerElement>();
101
108
  return {
102
109
  player,
103
110
  state,
111
+ /** Shows the player in `element`, until `dispose`. */
112
+ attachTo(element: MediaPlayerElement) {
113
+ element.setMediaPlayer(player);
114
+ elements.add(element);
115
+ },
104
116
  dispose() {
105
117
  for (const unsubscribe of unsubscriptions) {
106
118
  unsubscribe();
107
119
  }
108
120
 
121
+ for (const element of elements) {
122
+ call(element, "setMediaPlayer", null);
123
+ }
124
+
125
+ elements.clear();
109
126
  player.close();
110
127
  }
111
128
  };
@@ -0,0 +1,106 @@
1
+ import { toCssPixels, toDevicePixels } from "#src/window/css-pixels.js";
2
+ import type { AppWindow } from "#src/winui.js";
3
+
4
+ /**
5
+ * One window's size and place as the web's `window` has them (`outerWidth`,
6
+ * `outerHeight`, `screenX`, `screenY`, `devicePixelRatio`, `resizeTo`,
7
+ * `resizeBy`, `moveTo`, `moveBy`), in CSS pixels, over its `AppWindow`. A
8
+ * process holds many windows, so there is no `window` global for it; a
9
+ * `WindowHandle` gives each window its own (`handle.geometry`).
10
+ *
11
+ * CSS pixels are WinUI's device-independent pixels, at the window's scale.
12
+ */
13
+ export class WindowGeometry {
14
+ private readonly appWindow: AppWindow;
15
+ private readonly readScale: () => number;
16
+
17
+ /** Made by `WindowHandle`. */
18
+ constructor(appWindow: AppWindow, readScale: () => number) {
19
+ this.appWindow = appWindow;
20
+ this.readScale = readScale;
21
+ }
22
+
23
+ /** Device pixels per CSS pixel. */
24
+ // fallow-ignore-next-line unused-class-member
25
+ get devicePixelRatio() {
26
+ return this.readScale();
27
+ }
28
+
29
+ /** The window's width with its frame, in CSS pixels. */
30
+ get outerWidth() {
31
+ return toCssPixels({
32
+ value: this.appWindow.size.width,
33
+ scale: this.readScale()
34
+ });
35
+ }
36
+
37
+ /** The window's height with its frame, in CSS pixels. */
38
+ get outerHeight() {
39
+ return toCssPixels({
40
+ value: this.appWindow.size.height,
41
+ scale: this.readScale()
42
+ });
43
+ }
44
+
45
+ /** The window's left edge on the desktop, in CSS pixels at this window's scale. */
46
+ get screenX() {
47
+ return toCssPixels({
48
+ value: this.appWindow.position.x,
49
+ scale: this.readScale()
50
+ });
51
+ }
52
+
53
+ /** The window's top edge on the desktop, in CSS pixels at this window's scale. */
54
+ get screenY() {
55
+ return toCssPixels({
56
+ value: this.appWindow.position.y,
57
+ scale: this.readScale()
58
+ });
59
+ }
60
+
61
+ /**
62
+ * Resizes the window (frame included) to `width` by `height` CSS pixels,
63
+ * keeping its top-left corner: `AppWindow.Resize`. A side that
64
+ * `sizeToContent` sets is set again by the content.
65
+ */
66
+ resizeTo(width: number, height: number) {
67
+ const scale = this.readScale();
68
+ this.appWindow.resize({
69
+ width: toDevicePixels({
70
+ value: width,
71
+ scale
72
+ }),
73
+ height: toDevicePixels({
74
+ value: height,
75
+ scale
76
+ })
77
+ });
78
+ }
79
+
80
+ /** Grows (or shrinks) the window by `width` and `height` CSS pixels. */
81
+ // fallow-ignore-next-line unused-class-member
82
+ resizeBy(width: number, height: number) {
83
+ this.resizeTo(this.outerWidth + width, this.outerHeight + height);
84
+ }
85
+
86
+ /** Puts the window's top-left corner at `x`, `y` CSS pixels on the desktop: `AppWindow.Move`. */
87
+ moveTo(x: number, y: number) {
88
+ const scale = this.readScale();
89
+ this.appWindow.move({
90
+ x: toDevicePixels({
91
+ value: x,
92
+ scale
93
+ }),
94
+ y: toDevicePixels({
95
+ value: y,
96
+ scale
97
+ })
98
+ });
99
+ }
100
+
101
+ /** Moves the window by `x` and `y` CSS pixels. */
102
+ // fallow-ignore-next-line unused-class-member
103
+ moveBy(x: number, y: number) {
104
+ this.moveTo(this.screenX + x, this.screenY + y);
105
+ }
106
+ }