@seelen-ui/lib 2.5.3 → 2.5.8-next.2604111036

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 (237) hide show
  1. package/esm/gen/types/ClipboardData.d.ts +15 -0
  2. package/esm/gen/types/ClipboardData.d.ts.map +1 -0
  3. package/esm/gen/types/ClipboardEntry.d.ts +24 -0
  4. package/esm/gen/types/ClipboardEntry.d.ts.map +1 -0
  5. package/esm/gen/types/ClipboardEntryContent.d.ts +16 -0
  6. package/esm/gen/types/ClipboardEntryContent.d.ts.map +1 -0
  7. package/esm/gen/types/FancyToolbarSettings.d.ts +10 -2
  8. package/esm/gen/types/FancyToolbarSettings.d.ts.map +1 -1
  9. package/esm/gen/types/{PinnedWegItemData.d.ts → OldWegItemData.d.ts} +5 -10
  10. package/esm/gen/types/OldWegItemData.d.ts.map +1 -0
  11. package/esm/gen/types/{WegItemSubtype.d.ts → OldWegItemSubtype.d.ts} +2 -2
  12. package/esm/gen/types/OldWegItemSubtype.d.ts.map +1 -0
  13. package/esm/gen/types/OldWegItemSubtype.js +8 -0
  14. package/esm/gen/types/Relaunch.d.ts +20 -0
  15. package/esm/gen/types/Relaunch.d.ts.map +1 -0
  16. package/esm/gen/types/Relaunch.js +1 -0
  17. package/esm/gen/types/Resource.d.ts +12 -5
  18. package/esm/gen/types/Resource.d.ts.map +1 -1
  19. package/esm/gen/types/ResourceId.d.ts +6 -2
  20. package/esm/gen/types/ResourceId.d.ts.map +1 -1
  21. package/esm/gen/types/ResourceMetadata.d.ts +4 -0
  22. package/esm/gen/types/ResourceMetadata.d.ts.map +1 -1
  23. package/esm/gen/types/ResourcePendingUpdate.d.ts +20 -0
  24. package/esm/gen/types/ResourcePendingUpdate.d.ts.map +1 -0
  25. package/esm/gen/types/ResourcePendingUpdate.js +1 -0
  26. package/esm/gen/types/SeelenCommandArgument.d.ts +26 -2
  27. package/esm/gen/types/SeelenCommandArgument.d.ts.map +1 -1
  28. package/esm/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts +4 -0
  29. package/esm/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts.map +1 -0
  30. package/esm/gen/types/SeelenCommandClipboardDeleteEntryArgs.js +2 -0
  31. package/esm/gen/types/SeelenCommandClipboardPasteArgs.d.ts +4 -0
  32. package/esm/gen/types/SeelenCommandClipboardPasteArgs.d.ts.map +1 -0
  33. package/esm/gen/types/SeelenCommandClipboardPasteArgs.js +2 -0
  34. package/esm/gen/types/SeelenCommandClipboardSetContentArgs.d.ts +4 -0
  35. package/esm/gen/types/SeelenCommandClipboardSetContentArgs.d.ts.map +1 -0
  36. package/esm/gen/types/SeelenCommandClipboardSetContentArgs.js +2 -0
  37. package/esm/gen/types/SeelenCommandReturn.d.ts +25 -0
  38. package/esm/gen/types/SeelenCommandReturn.d.ts.map +1 -1
  39. package/esm/gen/types/SeelenEventPayload.d.ts +13 -3
  40. package/esm/gen/types/SeelenEventPayload.d.ts.map +1 -1
  41. package/esm/gen/types/SeelenSession.d.ts +15 -0
  42. package/esm/gen/types/SeelenSession.d.ts.map +1 -0
  43. package/esm/gen/types/SeelenSession.js +2 -0
  44. package/esm/gen/types/SeelenWegSettings.d.ts +4 -0
  45. package/esm/gen/types/SeelenWegSettings.d.ts.map +1 -1
  46. package/esm/gen/types/Settings.d.ts +9 -0
  47. package/esm/gen/types/Settings.d.ts.map +1 -1
  48. package/esm/gen/types/SluHotkeyAction.d.ts +2 -0
  49. package/esm/gen/types/SluHotkeyAction.d.ts.map +1 -1
  50. package/esm/gen/types/Slug.d.ts +9 -0
  51. package/esm/gen/types/Slug.d.ts.map +1 -0
  52. package/esm/gen/types/Slug.js +2 -0
  53. package/esm/gen/types/TrashBinInfo.d.ts +11 -0
  54. package/esm/gen/types/TrashBinInfo.d.ts.map +1 -0
  55. package/esm/gen/types/TrashBinInfo.js +2 -0
  56. package/esm/gen/types/UserAppWindow.d.ts +9 -0
  57. package/esm/gen/types/UserAppWindow.d.ts.map +1 -1
  58. package/esm/gen/types/WegItem.d.ts +9 -5
  59. package/esm/gen/types/WegItem.d.ts.map +1 -1
  60. package/esm/gen/types/WegItemData.d.ts +32 -0
  61. package/esm/gen/types/WegItemData.d.ts.map +1 -0
  62. package/esm/gen/types/WegItemData.js +1 -0
  63. package/esm/gen/types/WegItemType.d.ts +3 -3
  64. package/esm/gen/types/WegItemType.d.ts.map +1 -1
  65. package/esm/gen/types/WegItemType.js +2 -2
  66. package/esm/gen/types/mod.d.ts +252 -242
  67. package/esm/gen/types/mod.d.ts.map +1 -1
  68. package/esm/gen/types/mod.js +252 -242
  69. package/esm/src/handlers/commands.d.ts +12 -1
  70. package/esm/src/handlers/commands.d.ts.map +1 -1
  71. package/esm/src/handlers/commands.js +11 -0
  72. package/esm/src/handlers/events.d.ts +6 -3
  73. package/esm/src/handlers/events.d.ts.map +1 -1
  74. package/esm/src/handlers/events.js +5 -2
  75. package/esm/src/state/icon_pack.d.ts.map +1 -1
  76. package/esm/src/state/icon_pack.js +11 -2
  77. package/esm/src/state/mod.d.ts +0 -2
  78. package/esm/src/state/mod.d.ts.map +1 -1
  79. package/esm/src/state/mod.js +0 -2
  80. package/esm/src/state/theme/theming.d.ts +1 -0
  81. package/esm/src/state/theme/theming.d.ts.map +1 -1
  82. package/esm/src/state/theme/theming.js +21 -1
  83. package/esm/src/state/widget/interfaces.d.ts +17 -0
  84. package/esm/src/state/widget/interfaces.d.ts.map +1 -1
  85. package/esm/src/state/widget/mod.d.ts +15 -9
  86. package/esm/src/state/widget/mod.d.ts.map +1 -1
  87. package/esm/src/state/widget/mod.js +87 -94
  88. package/esm/src/state/widget/performance.d.ts +2 -0
  89. package/esm/src/state/widget/performance.d.ts.map +1 -0
  90. package/esm/src/state/widget/performance.js +18 -0
  91. package/esm/src/state/widget/sizing.d.ts +14 -3
  92. package/esm/src/state/widget/sizing.d.ts.map +1 -1
  93. package/esm/src/state/widget/sizing.js +61 -18
  94. package/esm/src/system_state/ui_colors.d.ts +0 -2
  95. package/esm/src/system_state/ui_colors.d.ts.map +1 -1
  96. package/esm/src/system_state/ui_colors.js +0 -8
  97. package/esm/src/utils/async.d.ts +12 -0
  98. package/esm/src/utils/async.d.ts.map +1 -1
  99. package/esm/src/utils/async.js +46 -0
  100. package/esm/src/utils/mod.d.ts +1 -0
  101. package/esm/src/utils/mod.d.ts.map +1 -1
  102. package/esm/src/utils/mod.js +4 -0
  103. package/package.json +1 -1
  104. package/script/gen/types/ClipboardData.d.ts +15 -0
  105. package/script/gen/types/ClipboardData.d.ts.map +1 -0
  106. package/script/gen/types/ClipboardEntry.d.ts +24 -0
  107. package/script/gen/types/ClipboardEntry.d.ts.map +1 -0
  108. package/script/gen/types/ClipboardEntryContent.d.ts +16 -0
  109. package/script/gen/types/ClipboardEntryContent.d.ts.map +1 -0
  110. package/script/gen/types/FancyToolbarSettings.d.ts +10 -2
  111. package/script/gen/types/FancyToolbarSettings.d.ts.map +1 -1
  112. package/script/gen/types/{PinnedWegItemData.d.ts → OldWegItemData.d.ts} +5 -10
  113. package/script/gen/types/OldWegItemData.d.ts.map +1 -0
  114. package/script/gen/types/{WegItemSubtype.d.ts → OldWegItemSubtype.d.ts} +2 -2
  115. package/script/gen/types/OldWegItemSubtype.d.ts.map +1 -0
  116. package/script/gen/types/OldWegItemSubtype.js +11 -0
  117. package/script/gen/types/Relaunch.d.ts +20 -0
  118. package/script/gen/types/Relaunch.d.ts.map +1 -0
  119. package/script/gen/types/Relaunch.js +2 -0
  120. package/script/gen/types/Resource.d.ts +12 -5
  121. package/script/gen/types/Resource.d.ts.map +1 -1
  122. package/script/gen/types/ResourceId.d.ts +6 -2
  123. package/script/gen/types/ResourceId.d.ts.map +1 -1
  124. package/script/gen/types/ResourceMetadata.d.ts +4 -0
  125. package/script/gen/types/ResourceMetadata.d.ts.map +1 -1
  126. package/script/gen/types/ResourcePendingUpdate.d.ts +20 -0
  127. package/script/gen/types/ResourcePendingUpdate.d.ts.map +1 -0
  128. package/script/gen/types/ResourcePendingUpdate.js +2 -0
  129. package/script/gen/types/SeelenCommandArgument.d.ts +26 -2
  130. package/script/gen/types/SeelenCommandArgument.d.ts.map +1 -1
  131. package/script/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts +4 -0
  132. package/script/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts.map +1 -0
  133. package/script/gen/types/SeelenCommandClipboardDeleteEntryArgs.js +3 -0
  134. package/script/gen/types/SeelenCommandClipboardPasteArgs.d.ts +4 -0
  135. package/script/gen/types/SeelenCommandClipboardPasteArgs.d.ts.map +1 -0
  136. package/script/gen/types/SeelenCommandClipboardPasteArgs.js +3 -0
  137. package/script/gen/types/SeelenCommandClipboardSetContentArgs.d.ts +4 -0
  138. package/script/gen/types/SeelenCommandClipboardSetContentArgs.d.ts.map +1 -0
  139. package/script/gen/types/SeelenCommandClipboardSetContentArgs.js +3 -0
  140. package/script/gen/types/SeelenCommandReturn.d.ts +25 -0
  141. package/script/gen/types/SeelenCommandReturn.d.ts.map +1 -1
  142. package/script/gen/types/SeelenEventPayload.d.ts +13 -3
  143. package/script/gen/types/SeelenEventPayload.d.ts.map +1 -1
  144. package/script/gen/types/SeelenSession.d.ts +15 -0
  145. package/script/gen/types/SeelenSession.d.ts.map +1 -0
  146. package/script/gen/types/SeelenSession.js +3 -0
  147. package/script/gen/types/SeelenWegSettings.d.ts +4 -0
  148. package/script/gen/types/SeelenWegSettings.d.ts.map +1 -1
  149. package/script/gen/types/Settings.d.ts +9 -0
  150. package/script/gen/types/Settings.d.ts.map +1 -1
  151. package/script/gen/types/SluHotkeyAction.d.ts +2 -0
  152. package/script/gen/types/SluHotkeyAction.d.ts.map +1 -1
  153. package/script/gen/types/Slug.d.ts +9 -0
  154. package/script/gen/types/Slug.d.ts.map +1 -0
  155. package/script/gen/types/Slug.js +3 -0
  156. package/script/gen/types/TrashBinInfo.d.ts +11 -0
  157. package/script/gen/types/TrashBinInfo.d.ts.map +1 -0
  158. package/script/gen/types/TrashBinInfo.js +3 -0
  159. package/script/gen/types/UserAppWindow.d.ts +9 -0
  160. package/script/gen/types/UserAppWindow.d.ts.map +1 -1
  161. package/script/gen/types/WegItem.d.ts +9 -5
  162. package/script/gen/types/WegItem.d.ts.map +1 -1
  163. package/script/gen/types/WegItemData.d.ts +32 -0
  164. package/script/gen/types/WegItemData.d.ts.map +1 -0
  165. package/script/gen/types/WegItemData.js +2 -0
  166. package/script/gen/types/WegItemType.d.ts +3 -3
  167. package/script/gen/types/WegItemType.d.ts.map +1 -1
  168. package/script/gen/types/WegItemType.js +2 -2
  169. package/script/gen/types/mod.d.ts +252 -242
  170. package/script/gen/types/mod.d.ts.map +1 -1
  171. package/script/gen/types/mod.js +252 -242
  172. package/script/src/handlers/commands.d.ts +12 -1
  173. package/script/src/handlers/commands.d.ts.map +1 -1
  174. package/script/src/handlers/commands.js +11 -0
  175. package/script/src/handlers/events.d.ts +6 -3
  176. package/script/src/handlers/events.d.ts.map +1 -1
  177. package/script/src/handlers/events.js +5 -2
  178. package/script/src/state/icon_pack.d.ts.map +1 -1
  179. package/script/src/state/icon_pack.js +11 -2
  180. package/script/src/state/mod.d.ts +0 -2
  181. package/script/src/state/mod.d.ts.map +1 -1
  182. package/script/src/state/mod.js +0 -2
  183. package/script/src/state/theme/theming.d.ts +1 -0
  184. package/script/src/state/theme/theming.d.ts.map +1 -1
  185. package/script/src/state/theme/theming.js +22 -1
  186. package/script/src/state/widget/interfaces.d.ts +17 -0
  187. package/script/src/state/widget/interfaces.d.ts.map +1 -1
  188. package/script/src/state/widget/mod.d.ts +15 -9
  189. package/script/src/state/widget/mod.d.ts.map +1 -1
  190. package/script/src/state/widget/mod.js +86 -93
  191. package/script/src/state/widget/performance.d.ts +2 -0
  192. package/script/src/state/widget/performance.d.ts.map +1 -0
  193. package/script/src/state/widget/performance.js +21 -0
  194. package/script/src/state/widget/sizing.d.ts +14 -3
  195. package/script/src/state/widget/sizing.d.ts.map +1 -1
  196. package/script/src/state/widget/sizing.js +62 -19
  197. package/script/src/system_state/ui_colors.d.ts +0 -2
  198. package/script/src/system_state/ui_colors.d.ts.map +1 -1
  199. package/script/src/system_state/ui_colors.js +0 -8
  200. package/script/src/utils/async.d.ts +12 -0
  201. package/script/src/utils/async.d.ts.map +1 -1
  202. package/script/src/utils/async.js +49 -0
  203. package/script/src/utils/mod.d.ts +1 -0
  204. package/script/src/utils/mod.d.ts.map +1 -1
  205. package/script/src/utils/mod.js +5 -0
  206. package/esm/gen/types/PinnedWegItemData.d.ts.map +0 -1
  207. package/esm/gen/types/SeelenCommandStateGetWegItemsArgs.d.ts +0 -5
  208. package/esm/gen/types/SeelenCommandStateGetWegItemsArgs.d.ts.map +0 -1
  209. package/esm/gen/types/WegAppGroupItem.d.ts +0 -12
  210. package/esm/gen/types/WegAppGroupItem.d.ts.map +0 -1
  211. package/esm/gen/types/WegItemSubtype.d.ts.map +0 -1
  212. package/esm/gen/types/WegItemSubtype.js +0 -8
  213. package/esm/src/state/weg_items.d.ts +0 -14
  214. package/esm/src/state/weg_items.d.ts.map +0 -1
  215. package/esm/src/state/weg_items.js +0 -23
  216. package/esm/src/state/wm_layout.d.ts +0 -2
  217. package/esm/src/state/wm_layout.d.ts.map +0 -1
  218. package/script/gen/types/PinnedWegItemData.d.ts.map +0 -1
  219. package/script/gen/types/SeelenCommandStateGetWegItemsArgs.d.ts +0 -5
  220. package/script/gen/types/SeelenCommandStateGetWegItemsArgs.d.ts.map +0 -1
  221. package/script/gen/types/WegAppGroupItem.d.ts +0 -12
  222. package/script/gen/types/WegAppGroupItem.d.ts.map +0 -1
  223. package/script/gen/types/WegItemSubtype.d.ts.map +0 -1
  224. package/script/gen/types/WegItemSubtype.js +0 -11
  225. package/script/src/state/weg_items.d.ts +0 -14
  226. package/script/src/state/weg_items.d.ts.map +0 -1
  227. package/script/src/state/weg_items.js +0 -27
  228. package/script/src/state/wm_layout.d.ts +0 -2
  229. package/script/src/state/wm_layout.d.ts.map +0 -1
  230. /package/esm/gen/types/{PinnedWegItemData.js → ClipboardData.js} +0 -0
  231. /package/esm/gen/types/{SeelenCommandStateGetWegItemsArgs.js → ClipboardEntry.js} +0 -0
  232. /package/esm/gen/types/{WegAppGroupItem.js → ClipboardEntryContent.js} +0 -0
  233. /package/esm/{src/state/wm_layout.js → gen/types/OldWegItemData.js} +0 -0
  234. /package/script/gen/types/{PinnedWegItemData.js → ClipboardData.js} +0 -0
  235. /package/script/gen/types/{SeelenCommandStateGetWegItemsArgs.js → ClipboardEntry.js} +0 -0
  236. /package/script/gen/types/{WegAppGroupItem.js → ClipboardEntryContent.js} +0 -0
  237. /package/script/{src/state/wm_layout.js → gen/types/OldWegItemData.js} +0 -0
@@ -33,9 +33,8 @@ var SeelenEvent;
33
33
  SeelenEvent["WMTreeChanged"] = "wm::tree-changed";
34
34
  SeelenEvent["PopupContentChanged"] = "popup-content-changed";
35
35
  SeelenEvent["StateSettingsChanged"] = "settings-changed";
36
- SeelenEvent["StateWegItemsChanged"] = "weg-items";
37
- SeelenEvent["StateThemesChanged"] = "themes";
38
36
  SeelenEvent["StateSettingsByAppChanged"] = "settings-by-app";
37
+ SeelenEvent["StateThemesChanged"] = "themes";
39
38
  SeelenEvent["StateIconPacksChanged"] = "icon-packs";
40
39
  SeelenEvent["StatePluginsChanged"] = "plugins-changed";
41
40
  SeelenEvent["StateWidgetsChanged"] = "widgets-changed";
@@ -50,4 +49,8 @@ var SeelenEvent;
50
49
  SeelenEvent["SystemCoresChanged"] = "system::cores-changed";
51
50
  SeelenEvent["BluetoothDevicesChanged"] = "bluetooth-devices-changed";
52
51
  SeelenEvent["StartMenuItemsChanged"] = "start-menu::items-changed";
52
+ SeelenEvent["WegAddItem"] = "weg::add-item";
53
+ SeelenEvent["TrashBinChanged"] = "trash-bin::changed";
54
+ SeelenEvent["SeelenSessionChanged"] = "session::changed";
55
+ SeelenEvent["ClipboardDataChanged"] = "clipboard::data-changed";
53
56
  })(SeelenEvent || (exports.SeelenEvent = SeelenEvent = {}));
@@ -1 +1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AI,CAAC;IAIhB;;;OAGG;WACW,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhD"}
@@ -165,7 +165,15 @@ class IconPackManager {
165
165
  return null;
166
166
  }
167
167
  const lowerPath = path?.toLowerCase();
168
- const extension = lowerPath?.split(".").pop();
168
+ // Extract extension only when there's an actual dot after the last path separator,
169
+ // to avoid treating directory names without dots as extensions.
170
+ const lastDot = lowerPath?.lastIndexOf(".");
171
+ const lastSlash = lowerPath?.lastIndexOf("\\") ?? -1;
172
+ const extension = (lastDot !== undefined && lastDot > lastSlash) ? lowerPath.slice(lastDot + 1) : undefined;
173
+ // Add the starting path to __seen so that direct A→B→A cycles are caught in 2 hops.
174
+ if (lowerPath) {
175
+ __seen.add(lowerPath);
176
+ }
169
177
  for (const pack of this.activeIconPacks) {
170
178
  let entry;
171
179
  if (umid) {
@@ -182,7 +190,8 @@ class IconPackManager {
182
190
  // only search for filename in case of executable files
183
191
  if (extension === "exe") {
184
192
  const filename = lowerPath.split("\\").pop();
185
- if (filename && e.path.endsWith(filename)) {
193
+ // Use separator-aware check to avoid partial name matches (e.g. "mysteam.exe" != "steam.exe")
194
+ if (filename && (e.path === filename || e.path.endsWith("\\" + filename))) {
186
195
  return true;
187
196
  }
188
197
  }
@@ -1,7 +1,5 @@
1
1
  export * from "./theme/mod.js";
2
2
  export * from "./settings/mod.js";
3
- export * from "./weg_items.js";
4
- export * from "./wm_layout.js";
5
3
  export * from "./icon_pack.js";
6
4
  export * from "./plugin/mod.js";
7
5
  export * from "./widget/mod.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/state/mod.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/state/mod.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
@@ -16,8 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./theme/mod.js"), exports);
18
18
  __exportStar(require("./settings/mod.js"), exports);
19
- __exportStar(require("./weg_items.js"), exports);
20
- __exportStar(require("./wm_layout.js"), exports);
21
19
  __exportStar(require("./icon_pack.js"), exports);
22
20
  __exportStar(require("./plugin/mod.js"), exports);
23
21
  __exportStar(require("./widget/mod.js"), exports);
@@ -3,5 +3,6 @@
3
3
  * when the themes or settings change. Also will add the systehm ui colors to the document.
4
4
  */
5
5
  export declare function startThemingTool(): Promise<void>;
6
+ export declare function setPerformanceStyles(): void;
6
7
  export declare function startDateCssVariables(): void;
7
8
  //# sourceMappingURL=theming.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../src/src/state/theme/theming.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAoBtD;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C"}
1
+ {"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../src/src/state/theme/theming.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAqBtD;AAiBD,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.startThemingTool = startThemingTool;
4
+ exports.setPerformanceStyles = setPerformanceStyles;
4
5
  exports.startDateCssVariables = startDateCssVariables;
5
6
  const ui_colors_js_1 = require("../../system_state/ui_colors.js");
6
7
  const DOM_js_1 = require("../../utils/DOM.js");
@@ -21,11 +22,31 @@ async function startThemingTool() {
21
22
  settings = newSettings;
22
23
  themes.applyToDocument(settings.activeThemes, settings.byTheme);
23
24
  });
25
+ setPerformanceStyles();
26
+ startDateCssVariables();
24
27
  (await ui_colors_js_1.UIColors.getAsync()).setAsCssVariables();
25
28
  await ui_colors_js_1.UIColors.onChange((colors) => colors.setAsCssVariables());
26
- startDateCssVariables();
27
29
  themes.applyToDocument(settings.activeThemes, settings.byTheme);
28
30
  }
31
+ // Used by performance mode to reduce cpu/gpu usage
32
+ const PERF_CSS = `
33
+ html[data-animations-off] *,
34
+ html[data-animations-off] *::before,
35
+ html[data-animations-off] *::after {
36
+ animation-duration: 0.001ms !important;
37
+ animation-iteration-count: 1 !important;
38
+ animation-delay: 0s !important;
39
+
40
+ transition-duration: 0.001ms !important;
41
+ transition-delay: 0s !important;
42
+
43
+ scroll-behavior: auto !important;
44
+ }`;
45
+ function setPerformanceStyles() {
46
+ const styleSheet = new DOM_js_1.RuntimeStyleSheet("@static/performance");
47
+ styleSheet.addStyle(PERF_CSS);
48
+ styleSheet.applyToDocument();
49
+ }
29
50
  function startDateCssVariables() {
30
51
  // Set initial values immediately
31
52
  updateDateCssVariables();
@@ -19,6 +19,17 @@ export interface InitWidgetOptions {
19
19
  * @default undefined
20
20
  */
21
21
  autoSizeByContent?: HTMLElement | null;
22
+ /**
23
+ * If autoSizeByContent is set, and this is true, will auto size the widget and
24
+ * adjusts the position to fit on screen
25
+ * @default true
26
+ */
27
+ autoSizeFitOnScreen?: boolean;
28
+ /**
29
+ * Will normalize the device pixel ratio to 1:1
30
+ * @default false
31
+ */
32
+ normalizeDevicePixelRatio?: boolean;
22
33
  /**
23
34
  * Will save the position and size of the widget on change.
24
35
  * This is intedeed to be used when the size and position of the widget is
@@ -27,6 +38,12 @@ export interface InitWidgetOptions {
27
38
  * @default widget.preset === "Desktop"
28
39
  */
29
40
  saveAndRestoreLastRect?: boolean;
41
+ /**
42
+ * Will disable the css animations on the widget when performace mode is set to Extreme
43
+ *
44
+ * @default true
45
+ */
46
+ disableCssAnimations?: boolean;
30
47
  }
31
48
  export interface ReadyWidgetOptions {
32
49
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,MAAM,EAAE;QAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;KAAE,CAAC;CAC/C;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,MAAM,EAAE;QAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;KAAE,CAAC;CAC/C;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
@@ -1,6 +1,7 @@
1
- import { type Frame, type Rect, type ThirdPartyWidgetSettings, type Widget as IWidget, type WidgetId, type WidgetTriggerPayload } from "../../../gen/types/mod.js";
2
- import { type WebviewWindow } from "@tauri-apps/api/webviewWindow";
1
+ import { type Alignment, type Frame, type Rect, type ThirdPartyWidgetSettings, type Widget as IWidget, type WidgetId, type WidgetTriggerPayload } from "../../../gen/types/mod.js";
3
2
  import type { InitWidgetOptions, ReadyWidgetOptions, WidgetInformation } from "./interfaces.js";
3
+ import { type Webview } from "@tauri-apps/api/webview";
4
+ import { type Window } from "@tauri-apps/api/window";
4
5
  /**
5
6
  * Represents the widget instance running in the current webview
6
7
  */
@@ -18,18 +19,17 @@ export declare class Widget {
18
19
  readonly def: IWidget;
19
20
  /** decoded widget instance information */
20
21
  readonly decoded: WidgetInformation;
21
- /** current webview window */
22
- readonly webview: WebviewWindow;
22
+ /** current webview where the widget is running */
23
+ readonly webview: Webview;
24
+ /** current window where the widget is running */
25
+ readonly window: Window;
23
26
  private autoSizer?;
24
27
  private runtimeState;
25
28
  private constructor();
26
29
  /** Returns the current window id of the widget */
27
30
  get windowId(): number;
28
- /** Returns the current position and size of the widget */
29
- get frame(): Frame;
30
31
  /** Returns the default config of the widget, declared on the widget definition */
31
32
  getDefaultConfig(): ThirdPartyWidgetSettings;
32
- private applyInvisiblePreset;
33
33
  /** Will apply the recommended settings for a desktop widget */
34
34
  private applyDesktopPreset;
35
35
  /** Will apply the recommended settings for an overlay widget */
@@ -40,7 +40,8 @@ export declare class Widget {
40
40
  * Will restore the saved position and size of the widget on start,
41
41
  * after that will store the position and size of the widget on change.
42
42
  */
43
- persistPositionAndSize(): Promise<void>;
43
+ private persistPositionAndSize;
44
+ private normalizeDevicePixelRatio;
44
45
  /**
45
46
  * Will initialize the widget based on the preset and mark it as `pending`, this function won't show the widget.
46
47
  * This should be called before any other action on the widget. After this you should call
@@ -55,7 +56,12 @@ export declare class Widget {
55
56
  */
56
57
  ready(options?: ReadyWidgetOptions): Promise<void>;
57
58
  onTrigger(cb: (args: WidgetTriggerPayload) => void): void;
58
- /** If animations are enabled this will animate the movement of the widget */
59
+ __unsafe_setPosition(rect: Rect, ref: Frame): Promise<void>;
60
+ /**
61
+ * This will adjust the position of the widget based on the current placement and alignX/alignY arguments.
62
+ * This makes the widget fit into the monitor where it was placed, avoiding monitor overflow.
63
+ */
64
+ adjustAndSetPosition(x: number, y: number, alignX?: Alignment | null, alignY?: Alignment | null): Promise<void>;
59
65
  setPosition(rect: Rect): Promise<void>;
60
66
  show(): Promise<void>;
61
67
  /** Will force foreground the widget */
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/mod.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,wBAAwB,EAC7B,KAAK,MAAM,IAAI,OAAO,EAEtB,KAAK,QAAQ,EAIb,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAM5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EA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,iBAAiB,EAAE,QAAoC,CAAC;AACrE,eAAO,MAAM,qBAAqB,EAAE,QAA8C,CAAC;AACnF,eAAO,MAAM,2BAA2B,EAAE,QAA+C,CAAC;AAC1F,eAAO,MAAM,kBAAkB,EAAE,QAAkD,CAAC"}
@@ -37,13 +37,14 @@ exports.SeelenWallWidgetId = exports.SeelenWindowManagerWidgetId = exports.Seele
37
37
  const dntShim = __importStar(require("../../../_dnt.shims.js"));
38
38
  const mod_js_1 = require("../../../gen/types/mod.js");
39
39
  const mod_js_2 = require("../../handlers/mod.js");
40
- const webviewWindow_1 = require("@tauri-apps/api/webviewWindow");
41
40
  const mod_js_3 = require("../../../deps/jsr.io/@std/encoding/1.0.10/mod.js");
42
41
  const async_js_1 = require("../../utils/async.js");
43
42
  const sizing_js_1 = require("./sizing.js");
44
43
  const positioning_js_1 = require("./positioning.js");
45
44
  const theming_js_1 = require("../theme/theming.js");
45
+ const performance_js_1 = require("./performance.js");
46
46
  const webview_1 = require("@tauri-apps/api/webview");
47
+ const window_1 = require("@tauri-apps/api/window");
47
48
  /**
48
49
  * Represents the widget instance running in the current webview
49
50
  */
@@ -69,26 +70,21 @@ class Widget {
69
70
  def;
70
71
  /** decoded widget instance information */
71
72
  decoded;
72
- /** current webview window */
73
+ /** current webview where the widget is running */
73
74
  webview;
75
+ /** current window where the widget is running */
76
+ window;
74
77
  autoSizer;
75
78
  runtimeState = {
76
79
  hwnd: 0,
77
80
  initialized: false,
78
81
  ready: false,
79
- position: {
80
- x: 0,
81
- y: 0,
82
- },
83
- size: {
84
- width: 0,
85
- height: 0,
86
- },
87
82
  firstFocus: true,
88
83
  };
89
84
  constructor(widget) {
90
85
  this.def = widget;
91
- this.webview = (0, webviewWindow_1.getCurrentWebviewWindow)();
86
+ this.webview = (0, webview_1.getCurrentWebview)();
87
+ this.window = (0, window_1.getCurrentWindow)();
92
88
  const [id, query] = getDecodedWebviewLabel();
93
89
  const params = new URLSearchParams(query);
94
90
  const paramsObj = Object.freeze(Object.fromEntries(params));
@@ -104,15 +100,6 @@ class Widget {
104
100
  get windowId() {
105
101
  return this.runtimeState.hwnd;
106
102
  }
107
- /** Returns the current position and size of the widget */
108
- get frame() {
109
- return {
110
- x: this.runtimeState.position.x,
111
- y: this.runtimeState.position.y,
112
- width: this.runtimeState.size.width,
113
- height: this.runtimeState.size.height,
114
- };
115
- }
116
103
  /** Returns the default config of the widget, declared on the widget definition */
117
104
  getDefaultConfig() {
118
105
  const config = { enabled: true };
@@ -121,64 +108,28 @@ class Widget {
121
108
  }
122
109
  return config;
123
110
  }
124
- applyInvisiblePreset() {
125
- return [
126
- this.webview.setDecorations(false), // no title bar
127
- this.webview.setShadow(false), // no shadows
128
- // hide from native shell
129
- this.webview.setSkipTaskbar(true),
130
- // as a (desktop/overlay) widget we don't wanna allow nothing of these
131
- this.webview.setMinimizable(false),
132
- this.webview.setMaximizable(false),
133
- this.webview.setClosable(false),
134
- ];
135
- }
136
111
  /** Will apply the recommended settings for a desktop widget */
137
- async applyDesktopPreset() {
138
- await Promise.all([...this.applyInvisiblePreset(), this.webview.setAlwaysOnBottom(true)]);
139
- }
112
+ applyDesktopPreset() { }
140
113
  /** Will apply the recommended settings for an overlay widget */
141
- async applyOverlayPreset() {
142
- await Promise.all([...this.applyInvisiblePreset(), this.webview.setAlwaysOnTop(true)]);
143
- }
114
+ applyOverlayPreset() { }
144
115
  /** Will apply the recommended settings for a popup widget */
145
- async applyPopupPreset() {
146
- await Promise.all([...this.applyInvisiblePreset(), this.webview.setAlwaysOnTop(true)]);
147
- const hideWebview = (0, async_js_1.debounce)(() => {
116
+ applyPopupPreset() {
117
+ const hideWidget = (0, async_js_1.debounce)(() => {
148
118
  this.hide(true);
149
119
  }, 100);
150
- this.webview.onFocusChanged(({ payload: focused }) => {
120
+ this.window.onFocusChanged(({ payload: focused }) => {
151
121
  if (focused) {
152
- hideWebview.cancel();
122
+ hideWidget.cancel();
153
123
  }
154
124
  else {
155
- hideWebview();
125
+ hideWidget();
156
126
  }
157
127
  });
158
128
  this.onTrigger(async ({ desiredPosition, alignX, alignY }) => {
159
129
  // avoid flickering when clicking a button that triggers the widget
160
- hideWebview.cancel();
161
- if (this.autoSizer && alignX && alignY) {
162
- this.autoSizer.originX = alignX;
163
- this.autoSizer.originY = alignY;
164
- }
130
+ hideWidget.cancel();
165
131
  if (desiredPosition) {
166
- const adjusted = (0, positioning_js_1.adjustPositionByPlacement)({
167
- frame: {
168
- x: desiredPosition.x,
169
- y: desiredPosition.y,
170
- width: this.runtimeState.size.width,
171
- height: this.runtimeState.size.height,
172
- },
173
- originX: alignX,
174
- originY: alignY,
175
- });
176
- await this.setPosition({
177
- left: adjusted.x,
178
- top: adjusted.y,
179
- right: adjusted.x + adjusted.width,
180
- bottom: adjusted.y + adjusted.height,
181
- });
132
+ await this.adjustAndSetPosition(desiredPosition.x, desiredPosition.y, alignX, alignY);
182
133
  }
183
134
  await this.show();
184
135
  await this.focus();
@@ -206,19 +157,31 @@ class Widget {
206
157
  bottom: safeFrame.y + safeFrame.height,
207
158
  });
208
159
  }
209
- this.webview.onMoved((0, async_js_1.debounce)((e) => {
160
+ this.window.onMoved((0, async_js_1.debounce)((e) => {
210
161
  const { x, y } = e.payload;
211
162
  storage.setItem(`x`, x.toString());
212
163
  storage.setItem(`y`, y.toString());
213
164
  console.info(`Widget position saved: ${x} ${y}`);
214
165
  }, 500));
215
- this.webview.onResized((0, async_js_1.debounce)((e) => {
166
+ this.window.onResized((0, async_js_1.debounce)((e) => {
216
167
  const { width, height } = e.payload;
217
168
  storage.setItem(`width`, width.toString());
218
169
  storage.setItem(`height`, height.toString());
219
170
  console.info(`Widget size saved: ${width} ${height}`);
220
171
  }, 500));
221
172
  }
173
+ async normalizeDevicePixelRatio() {
174
+ // play with zoom level to reset device pixel ratio to 1:1
175
+ let oldDPR = globalThis.devicePixelRatio;
176
+ await this.webview.setZoom(1 / oldDPR);
177
+ this.window.onScaleChanged(() => {
178
+ if (globalThis.devicePixelRatio !== oldDPR) {
179
+ // when zoom was set dpr changed, so in case of change this is accomulative unit
180
+ oldDPR = oldDPR * globalThis.devicePixelRatio;
181
+ this.webview.setZoom(1 / (oldDPR * globalThis.devicePixelRatio));
182
+ }
183
+ });
184
+ }
222
185
  /**
223
186
  * Will initialize the widget based on the preset and mark it as `pending`, this function won't show the widget.
224
187
  * This should be called before any other action on the widget. After this you should call
@@ -231,8 +194,11 @@ class Widget {
231
194
  }
232
195
  this.runtimeState.hwnd = await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.GetSelfWindowId);
233
196
  this.runtimeState.initialized = true;
197
+ if (options.normalizeDevicePixelRatio) {
198
+ await this.normalizeDevicePixelRatio();
199
+ }
234
200
  if (options.autoSizeByContent) {
235
- this.autoSizer = new sizing_js_1.WidgetAutoSizer(this, options.autoSizeByContent);
201
+ this.autoSizer = new sizing_js_1.WidgetAutoSizer(this, options.autoSizeByContent, options.autoSizeFitOnScreen ?? true);
236
202
  }
237
203
  else if (options.saveAndRestoreLastRect ?? this.def.preset === mod_js_1.WidgetPreset.Desktop) {
238
204
  await this.persistPositionAndSize();
@@ -241,27 +207,25 @@ class Widget {
241
207
  case mod_js_1.WidgetPreset.None:
242
208
  break;
243
209
  case mod_js_1.WidgetPreset.Desktop:
244
- await this.applyDesktopPreset();
210
+ this.applyDesktopPreset();
245
211
  break;
246
212
  case mod_js_1.WidgetPreset.Overlay:
247
- await this.applyOverlayPreset();
213
+ this.applyOverlayPreset();
248
214
  break;
249
215
  case mod_js_1.WidgetPreset.Popup:
250
- await this.applyPopupPreset();
216
+ this.applyPopupPreset();
251
217
  break;
252
218
  }
253
219
  await (0, theming_js_1.startThemingTool)();
254
220
  await (0, positioning_js_1.initMonitorsState)();
255
- // state initialization
256
- this.runtimeState.size = await this.webview.outerSize();
257
- this.runtimeState.position = await this.webview.outerPosition();
258
- this.webview.onResized((e) => {
259
- this.runtimeState.size.width = e.payload.width;
260
- this.runtimeState.size.height = e.payload.height;
261
- });
262
- this.webview.onMoved((e) => {
263
- this.runtimeState.position.x = e.payload.x;
264
- this.runtimeState.position.y = e.payload.y;
221
+ if (options.disableCssAnimations ?? true) {
222
+ await (0, performance_js_1.disableAnimationsOnPerformanceMode)();
223
+ }
224
+ else {
225
+ console.trace("Animations won't be disabled because widget configuration");
226
+ }
227
+ await sizing_js_1.OPTIMISTIC_FRAME.runExclusive(async (state) => {
228
+ await state.init(this);
265
229
  });
266
230
  }
267
231
  /**
@@ -281,7 +245,7 @@ class Widget {
281
245
  }
282
246
  this.runtimeState.ready = true;
283
247
  await this.autoSizer?.execute();
284
- if (show && !(await this.webview.isVisible())) {
248
+ if (show && !(await this.window.isVisible())) {
285
249
  await this.show();
286
250
  await this.focus();
287
251
  }
@@ -293,13 +257,8 @@ class Widget {
293
257
  cb(payload);
294
258
  });
295
259
  }
296
- /** If animations are enabled this will animate the movement of the widget */
297
- setPosition(rect) {
298
- this.runtimeState.position.x = rect.left;
299
- this.runtimeState.position.y = rect.top;
300
- this.runtimeState.size.width = rect.right - rect.left;
301
- this.runtimeState.size.height = rect.bottom - rect.top;
302
- return (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.SetSelfPosition, {
260
+ async __unsafe_setPosition(rect, ref) {
261
+ await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.SetSelfPosition, {
303
262
  rect: {
304
263
  left: Math.round(rect.left),
305
264
  top: Math.round(rect.top),
@@ -307,10 +266,44 @@ class Widget {
307
266
  bottom: Math.round(rect.bottom),
308
267
  },
309
268
  });
269
+ // optimistically update state, as arrived event after change is async
270
+ ref.x = rect.left;
271
+ ref.y = rect.top;
272
+ ref.width = rect.right - rect.left;
273
+ ref.height = rect.bottom - rect.top;
274
+ }
275
+ /**
276
+ * This will adjust the position of the widget based on the current placement and alignX/alignY arguments.
277
+ * This makes the widget fit into the monitor where it was placed, avoiding monitor overflow.
278
+ */
279
+ async adjustAndSetPosition(x, y, alignX, alignY) {
280
+ await sizing_js_1.OPTIMISTIC_FRAME.runExclusive(async (ref) => {
281
+ const adjusted = (0, positioning_js_1.adjustPositionByPlacement)({
282
+ frame: {
283
+ x,
284
+ y,
285
+ width: ref.width,
286
+ height: ref.height,
287
+ },
288
+ originX: alignX,
289
+ originY: alignY,
290
+ });
291
+ await Widget.self.__unsafe_setPosition({
292
+ left: adjusted.x,
293
+ top: adjusted.y,
294
+ right: adjusted.x + adjusted.width,
295
+ bottom: adjusted.y + adjusted.height,
296
+ }, ref);
297
+ });
298
+ }
299
+ async setPosition(rect) {
300
+ await sizing_js_1.OPTIMISTIC_FRAME.runExclusive(async (frame) => {
301
+ await this.__unsafe_setPosition(rect, frame);
302
+ });
310
303
  }
311
304
  async show() {
312
305
  debouncedClose.cancel();
313
- await this.webview.show();
306
+ await this.window.show();
314
307
  }
315
308
  /** Will force foreground the widget */
316
309
  async focus() {
@@ -323,7 +316,7 @@ class Widget {
323
316
  });
324
317
  }
325
318
  hide(closeAfterInactivity) {
326
- Widget.self.webview.hide();
319
+ this.window.hide();
327
320
  if (closeAfterInactivity) {
328
321
  debouncedClose();
329
322
  }
@@ -331,7 +324,7 @@ class Widget {
331
324
  }
332
325
  exports.Widget = Widget;
333
326
  const debouncedClose = (0, async_js_1.debounce)(() => {
334
- Widget.self.webview.close();
327
+ Widget.self.window.close();
335
328
  }, 30_000);
336
329
  exports.SeelenSettingsWidgetId = "@seelen/settings";
337
330
  exports.SeelenPopupWidgetId = "@seelen/popup";
@@ -340,7 +333,7 @@ exports.SeelenToolbarWidgetId = "@seelen/fancy-toolbar";
340
333
  exports.SeelenWindowManagerWidgetId = "@seelen/window-manager";
341
334
  exports.SeelenWallWidgetId = "@seelen/wallpaper-manager";
342
335
  function getDecodedWebviewLabel() {
343
- const encondedLabel = (0, webviewWindow_1.getCurrentWebviewWindow)().label;
336
+ const encondedLabel = (0, webview_1.getCurrentWebview)().label;
344
337
  const decodedLabel = new TextDecoder().decode((0, mod_js_3.decodeBase64Url)(encondedLabel));
345
338
  const [id, query] = decodedLabel.split("?");
346
339
  if (!id) {
@@ -0,0 +1,2 @@
1
+ export declare function disableAnimationsOnPerformanceMode(): Promise<void>;
2
+ //# sourceMappingURL=performance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/performance.ts"],"names":[],"mappings":"AAGA,wBAAsB,kCAAkC,IAAI,OAAO,CAAC,IAAI,CAAC,CAMxE"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.disableAnimationsOnPerformanceMode = disableAnimationsOnPerformanceMode;
4
+ const mod_js_1 = require("../../../gen/types/mod.js");
5
+ const mod_js_2 = require("../../handlers/mod.js");
6
+ async function disableAnimationsOnPerformanceMode() {
7
+ const initial = await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.StateGetPerformanceMode);
8
+ setDisableAnimations(initial);
9
+ (0, mod_js_2.subscribe)(mod_js_2.SeelenEvent.StatePerformanceModeChanged, (e) => {
10
+ setDisableAnimations(e.payload);
11
+ });
12
+ }
13
+ function setDisableAnimations(mode) {
14
+ const root = document.documentElement;
15
+ if (mode === mod_js_1.PerformanceMode.Extreme) {
16
+ root.setAttribute("data-animations-off", "");
17
+ }
18
+ else {
19
+ root.removeAttribute("data-animations-off");
20
+ }
21
+ }
@@ -1,14 +1,25 @@
1
1
  import type { Widget } from "./mod.js";
2
2
  import { Alignment } from "../../../gen/types/mod.js";
3
+ import { Mutex } from "../../utils/async.js";
4
+ declare class OptimisiticFrame {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ init(widget: Widget): Promise<void>;
10
+ }
11
+ export declare const OPTIMISTIC_FRAME: Mutex<OptimisiticFrame>;
3
12
  export declare class WidgetAutoSizer {
4
13
  private widget;
5
14
  private element;
15
+ private fitOnScreen;
6
16
  /** From which side the widget will grow */
7
- originX: Alignment;
17
+ originX?: Alignment | null;
8
18
  /** From which side the widget will grow */
9
- originY: Alignment;
10
- constructor(widget: Widget, element: HTMLElement);
19
+ originY?: Alignment | null;
20
+ constructor(widget: Widget, element: HTMLElement, fitOnScreen: boolean);
11
21
  private setup;
12
22
  execute(): Promise<void>;
13
23
  }
24
+ export {};
14
25
  //# sourceMappingURL=sizing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/sizing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,qBAAa,eAAe;IAOxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IAPjB,2CAA2C;IAC3C,OAAO,EAAE,SAAS,CAAmB;IACrC,2CAA2C;IAC3C,OAAO,EAAE,SAAS,CAAmB;gBAG3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW;IAM9B,OAAO,CAAC,KAAK;IAcP,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CA6C/B"}
1
+ {"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,cAAM,gBAAgB;IACpB,CAAC,EAAE,MAAM,CAAK;IACd,CAAC,EAAE,MAAM,CAAK;IACd,KAAK,EAAE,MAAM,CAAK;IAClB,MAAM,EAAE,MAAM,CAAK;IAEb,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB1C;AAED,eAAO,MAAM,gBAAgB,yBAAoC,CAAC;AAElE,qBAAa,eAAe;IAOxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,WAAW;I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