@stacksjs/desktop 0.2.572 → 0.2.574

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/dist/alerts.d.ts CHANGED
@@ -59,106 +59,4 @@ export declare function getActiveAlertCount(): number;
59
59
  /**
60
60
  * CSS styles for web-based toasts
61
61
  */
62
- export declare const TOAST_STYLES: `
63
- .stx-toast-container {
64
- position: fixed;
65
- z-index: 10001;
66
- display: flex;
67
- flex-direction: column;
68
- gap: 8px;
69
- max-width: 400px;
70
- pointer-events: none;
71
- }
72
-
73
- .stx-toast-container.top-left { top: 16px; left: 16px; }
74
- .stx-toast-container.top-center { top: 16px; left: 50%; transform: translateX(-50%); }
75
- .stx-toast-container.top-right { top: 16px; right: 16px; }
76
- .stx-toast-container.bottom-left { bottom: 16px; left: 16px; }
77
- .stx-toast-container.bottom-center { bottom: 16px; left: 50%; transform: translateX(-50%); }
78
- .stx-toast-container.bottom-right { bottom: 16px; right: 16px; }
79
-
80
- .stx-toast {
81
- display: flex;
82
- align-items: flex-start;
83
- gap: 12px;
84
- padding: 12px 16px;
85
- background: #fff;
86
- border-radius: 8px;
87
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
88
- pointer-events: auto;
89
- cursor: pointer;
90
- opacity: 0;
91
- transform: translateY(-10px);
92
- transition: opacity 0.2s, transform 0.2s;
93
- }
94
-
95
- .stx-toast.visible {
96
- opacity: 1;
97
- transform: translateY(0);
98
- }
99
-
100
- .stx-toast.dismissing {
101
- opacity: 0;
102
- transform: translateX(100%);
103
- }
104
-
105
- @media (prefers-color-scheme: dark) {
106
- .stx-toast {
107
- background: #2d2d2d;
108
- color: #fff;
109
- }
110
- }
111
-
112
- .stx-toast-icon {
113
- font-size: 20px;
114
- flex-shrink: 0;
115
- margin-top: 2px;
116
- }
117
-
118
- .stx-toast.info .stx-toast-icon { color: #3498db; }
119
- .stx-toast.success .stx-toast-icon { color: #27ae60; }
120
- .stx-toast.warning .stx-toast-icon { color: #f39c12; }
121
- .stx-toast.error .stx-toast-icon { color: #e74c3c; }
122
-
123
- .stx-toast-content {
124
- flex: 1;
125
- min-width: 0;
126
- }
127
-
128
- .stx-toast-title {
129
- font-weight: 600;
130
- margin-bottom: 4px;
131
- }
132
-
133
- .stx-toast-message {
134
- color: #666;
135
- font-size: 14px;
136
- line-height: 1.4;
137
- }
138
-
139
- @media (prefers-color-scheme: dark) {
140
- .stx-toast-message { color: #aaa; }
141
- }
142
-
143
- .stx-toast-close {
144
- background: none;
145
- border: none;
146
- font-size: 20px;
147
- cursor: pointer;
148
- opacity: 0.5;
149
- padding: 0;
150
- line-height: 1;
151
- color: inherit;
152
- transition: opacity 0.15s;
153
- }
154
-
155
- .stx-toast-close:hover {
156
- opacity: 1;
157
- }
158
-
159
- /* Border accent for different types */
160
- .stx-toast.info { border-left: 4px solid #3498db; }
161
- .stx-toast.success { border-left: 4px solid #27ae60; }
162
- .stx-toast.warning { border-left: 4px solid #f39c12; }
163
- .stx-toast.error { border-left: 4px solid #e74c3c; }
164
- `;
62
+ export declare const TOAST_STYLES: string;
@@ -1,3 +1,4 @@
1
+ declare const DEFAULT_INFO: AppInfo;
1
2
  export declare const app: AppAPI;
2
3
  export declare interface AppInfo {
3
4
  name: string
package/dist/audio.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare let webAudio: HTMLAudioElement | null;
1
2
  export declare const audio: AudioAPI;
2
3
  export declare interface AudioPlayOptions {
3
4
  volume?: number
package/dist/battery.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare function getWebBatteryManager(): Promise<any | null>;
1
2
  export declare const battery: BatteryAPI;
2
3
  export declare interface BatteryAPI {
3
4
  isCharging: () => Promise<boolean>
@@ -1,3 +1,4 @@
1
+ declare function assertHex(label: string, hex: string): void;
1
2
  export declare const bluetooth: BluetoothAPI;
2
3
  export declare interface BluetoothDevice {
3
4
  id: string
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Tiny HTML→text reducer for the writeHTML web fallback's plain alt.
3
+ *
4
+ * Drops `<script>`/`<style>` content entirely (common XSS vector when
5
+ * naively stripped — `<script>alert(1)</script>` would otherwise leave
6
+ * the literal `alert(1)` in the plaintext clipboard, looking innocuous
7
+ * but still potentially dangerous if pasted into a code editor that
8
+ * runs it). Replaces `<br>`/`</p>` with newlines so the plaintext
9
+ * mirrors the HTML's visible structure.
10
+ */
11
+ declare function stripHtml(html: string): string;
1
12
  export declare const clipboard: Clipboard;
2
13
  export declare interface Clipboard {
3
14
  writeText: (text: string) => Promise<void>
@@ -142,364 +142,7 @@ export declare const AVAILABLE_COMPONENTS: readonly [unknown, 'TextInput', 'Chec
142
142
  /**
143
143
  * CSS styles for all components
144
144
  */
145
- export declare const COMPONENT_STYLES: `
146
- /* Button */
147
- .stx-button {
148
- display: inline-flex;
149
- align-items: center;
150
- justify-content: center;
151
- gap: 8px;
152
- padding: 8px 16px;
153
- border: none;
154
- border-radius: 6px;
155
- font-size: 14px;
156
- font-weight: 500;
157
- cursor: pointer;
158
- transition: all 0.15s;
159
- }
160
- .stx-button--primary { background: #3498db; color: #fff; }
161
- .stx-button--primary:hover { background: #2980b9; }
162
- .stx-button--secondary { background: #6c757d; color: #fff; }
163
- .stx-button--outline { background: transparent; border: 1px solid #3498db; color: #3498db; }
164
- .stx-button--ghost { background: transparent; color: #3498db; }
165
- .stx-button--destructive { background: #e74c3c; color: #fff; }
166
- .stx-button--small { padding: 4px 8px; font-size: 12px; }
167
- .stx-button--large { padding: 12px 24px; font-size: 16px; }
168
- .stx-button--disabled { opacity: 0.5; cursor: not-allowed; }
169
- .stx-button--loading { pointer-events: none; }
170
- .stx-button-spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }
171
- @keyframes spin { to { transform: rotate(360deg); } }
172
-
173
- /* Input */
174
- .stx-input-wrapper { display: flex; flex-direction: column; gap: 4px; }
175
- .stx-input-label { font-size: 14px; font-weight: 500; color: #333; }
176
- .stx-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.15s; }
177
- .stx-input:focus { outline: none; border-color: #3498db; }
178
- .stx-input--error { border-color: #e74c3c; }
179
- .stx-input-error { font-size: 12px; color: #e74c3c; }
180
- .stx-input-hint { font-size: 12px; color: #666; }
181
-
182
- /* Checkbox */
183
- .stx-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
184
- .stx-checkbox input { display: none; }
185
- .stx-checkbox-box { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 4px; transition: all 0.15s; }
186
- .stx-checkbox input:checked + .stx-checkbox-box { background: #3498db; border-color: #3498db; }
187
- .stx-checkbox--disabled { opacity: 0.5; cursor: not-allowed; }
188
-
189
- /* Progress */
190
- .stx-progress { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; position: relative; }
191
- .stx-progress-bar { height: 100%; background: #3498db; transition: width 0.3s; }
192
- .stx-progress--success .stx-progress-bar { background: #27ae60; }
193
- .stx-progress--warning .stx-progress-bar { background: #f39c12; }
194
- .stx-progress--error .stx-progress-bar { background: #e74c3c; }
195
- .stx-progress--indeterminate .stx-progress-bar { animation: progress-indeterminate 1.5s infinite; }
196
- @keyframes progress-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
197
-
198
- /* Badge */
199
- .stx-badge { display: inline-flex; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
200
- .stx-badge--default { background: #e0e0e0; color: #333; }
201
- .stx-badge--primary { background: #3498db; color: #fff; }
202
- .stx-badge--success { background: #27ae60; color: #fff; }
203
- .stx-badge--warning { background: #f39c12; color: #fff; }
204
- .stx-badge--error { background: #e74c3c; color: #fff; }
205
-
206
- /* Avatar */
207
- .stx-avatar { display: inline-flex; align-items: center; justify-content: center; background: #3498db; color: #fff; overflow: hidden; }
208
- .stx-avatar--circle { border-radius: 50%; }
209
- .stx-avatar--square { border-radius: 0; }
210
- .stx-avatar--rounded { border-radius: 8px; }
211
- .stx-avatar--small { width: 32px; height: 32px; font-size: 12px; }
212
- .stx-avatar--medium { width: 40px; height: 40px; font-size: 14px; }
213
- .stx-avatar--large { width: 56px; height: 56px; font-size: 18px; }
214
- .stx-avatar-img { width: 100%; height: 100%; object-fit: cover; }
215
-
216
- /* Card */
217
- .stx-card { background: #fff; border-radius: 8px; overflow: hidden; }
218
- .stx-card--outlined { border: 1px solid #e0e0e0; }
219
- .stx-card--elevated { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
220
- .stx-card-image img { width: 100%; display: block; }
221
- .stx-card-body { padding: 16px; }
222
- .stx-card-title { margin: 0 0 4px; font-size: 18px; }
223
- .stx-card-subtitle { margin: 0 0 8px; color: #666; font-size: 14px; }
224
- .stx-card-footer { padding: 12px 16px; border-top: 1px solid #e0e0e0; }
225
-
226
- /* Tabs */
227
- .stx-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e0e0e0; }
228
- .stx-tab { padding: 8px 16px; border: none; background: none; cursor: pointer; color: #666; border-bottom: 2px solid transparent; transition: all 0.15s; }
229
- .stx-tab:hover { color: #333; }
230
- .stx-tab--active { color: #3498db; border-bottom-color: #3498db; }
231
- .stx-tab--disabled { opacity: 0.5; cursor: not-allowed; }
232
- .stx-tabs--pills { border-bottom: none; }
233
- .stx-tabs--pills .stx-tab { border-radius: 20px; border-bottom: none; }
234
- .stx-tabs--pills .stx-tab--active { background: #3498db; color: #fff; }
235
-
236
- /* Dropdown */
237
- .stx-dropdown { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; cursor: pointer; min-width: 150px; }
238
- .stx-dropdown:focus { outline: none; border-color: #3498db; }
239
- .stx-dropdown--disabled { opacity: 0.5; cursor: not-allowed; }
240
-
241
- /* Rating */
242
- .stx-rating { display: inline-flex; gap: 4px; }
243
- .stx-star { color: #ddd; cursor: pointer; transition: color 0.15s; }
244
- .stx-star--filled { color: #f1c40f; }
245
- .stx-star--half { background: linear-gradient(90deg, #f1c40f 50%, #ddd 50%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
246
- .stx-rating--readonly .stx-star { cursor: default; }
247
- .stx-rating--small .stx-star { font-size: 16px; }
248
- .stx-rating--medium .stx-star { font-size: 24px; }
249
- .stx-rating--large .stx-star { font-size: 32px; }
250
-
251
- /* Slider */
252
- .stx-slider { display: flex; align-items: center; gap: 12px; }
253
- .stx-slider-track { flex: 1; }
254
- .stx-slider input[type="range"] { width: 100%; }
255
- .stx-slider-value { min-width: 40px; text-align: right; font-size: 14px; }
256
-
257
- /* Radio Button */
258
- .stx-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
259
- .stx-radio input { display: none; }
260
- .stx-radio-circle { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 50%; position: relative; transition: all 0.15s; }
261
- .stx-radio input:checked + .stx-radio-circle { border-color: #3498db; }
262
- .stx-radio input:checked + .stx-radio-circle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; background: #3498db; border-radius: 50%; }
263
- .stx-radio--disabled { opacity: 0.5; cursor: not-allowed; }
264
-
265
- /* Color Picker */
266
- .stx-color-picker { display: flex; flex-direction: column; gap: 8px; }
267
- .stx-color-picker-input { display: flex; align-items: center; gap: 8px; }
268
- .stx-color-picker-input input[type="color"] { width: 40px; height: 40px; border: none; cursor: pointer; }
269
- .stx-color-picker-value { font-family: monospace; }
270
- .stx-color-picker-presets { display: flex; gap: 4px; flex-wrap: wrap; }
271
- .stx-color-preset { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
272
- .stx-color-preset:hover { border-color: #333; }
273
-
274
- /* Date/Time Picker */
275
- .stx-date-picker, .stx-time-picker { display: flex; flex-direction: column; gap: 4px; }
276
- .stx-date-picker-input, .stx-time-picker-input { display: flex; align-items: center; gap: 4px; }
277
- .stx-date-picker-input input, .stx-time-picker-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
278
- .stx-date-picker-clear { background: none; border: none; cursor: pointer; font-size: 16px; }
279
-
280
- /* Autocomplete */
281
- .stx-autocomplete { position: relative; }
282
- .stx-autocomplete-input-wrapper { position: relative; }
283
- .stx-autocomplete-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
284
- .stx-autocomplete-spinner { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: #3498db; border-radius: 50%; animation: spin 0.6s linear infinite; }
285
- .stx-autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; max-height: 200px; overflow-y: auto; display: none; z-index: 10; }
286
- .stx-autocomplete:focus-within .stx-autocomplete-list { display: block; }
287
- .stx-autocomplete-item { padding: 8px 12px; cursor: pointer; }
288
- .stx-autocomplete-item:hover { background: #f5f5f5; }
289
- .stx-autocomplete-item--selected { background: #e8f4fc; }
290
-
291
- /* Label */
292
- .stx-label { display: inline-block; font-weight: 500; }
293
- .stx-label--small { font-size: 12px; }
294
- .stx-label--medium { font-size: 14px; }
295
- .stx-label--large { font-size: 16px; }
296
- .stx-label-required { color: #e74c3c; margin-left: 2px; }
297
-
298
- /* Image */
299
- .stx-image { display: block; max-width: 100%; }
300
-
301
- /* Chip */
302
- .stx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; font-size: 13px; }
303
- .stx-chip--default { background: #e0e0e0; color: #333; }
304
- .stx-chip--primary { background: #e8f4fc; color: #3498db; }
305
- .stx-chip--success { background: #e8f8f0; color: #27ae60; }
306
- .stx-chip--warning { background: #fef5e7; color: #f39c12; }
307
- .stx-chip--error { background: #fdebeb; color: #e74c3c; }
308
- .stx-chip--small { padding: 2px 8px; font-size: 11px; }
309
- .stx-chip--large { padding: 6px 16px; font-size: 15px; }
310
- .stx-chip-remove { background: none; border: none; cursor: pointer; opacity: 0.6; padding: 0 2px; }
311
- .stx-chip-remove:hover { opacity: 1; }
312
-
313
- /* Tooltip */
314
- .stx-tooltip-wrapper { position: relative; display: inline-block; }
315
- .stx-tooltip { position: absolute; background: #333; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; z-index: 1000; }
316
- .stx-tooltip-wrapper:hover .stx-tooltip { opacity: 1; visibility: visible; }
317
- .stx-tooltip--top { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; }
318
- .stx-tooltip--bottom { top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; }
319
- .stx-tooltip--left { right: 100%; top: 50%; transform: translateY(-50%); margin-right: 8px; }
320
- .stx-tooltip--right { left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; }
321
-
322
- /* Scroll View */
323
- .stx-scroll-view { overflow: auto; }
324
- .stx-scroll-view--vertical { overflow-x: hidden; overflow-y: auto; }
325
- .stx-scroll-view--horizontal { overflow-x: auto; overflow-y: hidden; }
326
- .stx-scroll-view--hide-scrollbar::-webkit-scrollbar { display: none; }
327
- .stx-scroll-view--hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
328
- .stx-scroll-view--smooth { scroll-behavior: smooth; }
329
-
330
- /* Split View */
331
- .stx-split-view { display: flex; }
332
- .stx-split-view--horizontal { flex-direction: row; }
333
- .stx-split-view--vertical { flex-direction: column; }
334
- .stx-split-pane { overflow: auto; }
335
- .stx-split-divider { background: #e0e0e0; flex-shrink: 0; }
336
- .stx-split-view--horizontal .stx-split-divider { width: 4px; cursor: col-resize; }
337
- .stx-split-view--vertical .stx-split-divider { height: 4px; cursor: row-resize; }
338
- .stx-split-divider:hover { background: #3498db; }
339
-
340
- /* Accordion */
341
- .stx-accordion { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
342
- .stx-accordion-item { border-bottom: 1px solid #e0e0e0; }
343
- .stx-accordion-item:last-child { border-bottom: none; }
344
- .stx-accordion-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: none; border: none; cursor: pointer; font-size: 14px; }
345
- .stx-accordion-header:hover { background: #f5f5f5; }
346
- .stx-accordion-icon { transition: transform 0.2s; }
347
- .stx-accordion-item--open .stx-accordion-icon { transform: rotate(180deg); }
348
- .stx-accordion-content { padding: 0 16px 16px; }
349
- .stx-accordion-item--disabled { opacity: 0.5; }
350
- .stx-accordion-item--disabled .stx-accordion-header { cursor: not-allowed; }
351
-
352
- /* Stepper */
353
- .stx-stepper { display: flex; }
354
- .stx-stepper--horizontal { flex-direction: row; align-items: flex-start; }
355
- .stx-stepper--vertical { flex-direction: column; }
356
- .stx-step { display: flex; align-items: center; }
357
- .stx-stepper--vertical .stx-step { flex-direction: row; }
358
- .stx-step-indicator { width: 32px; height: 32px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; flex-shrink: 0; }
359
- .stx-step--completed .stx-step-indicator { background: #27ae60; color: #fff; }
360
- .stx-step--active .stx-step-indicator { background: #3498db; color: #fff; }
361
- .stx-step-content { margin-left: 12px; }
362
- .stx-step-label { font-size: 14px; font-weight: 500; }
363
- .stx-step-description { font-size: 12px; color: #666; }
364
- .stx-step-connector { flex: 1; height: 2px; background: #e0e0e0; margin: 0 8px; min-width: 20px; }
365
- .stx-stepper--vertical .stx-step-connector { width: 2px; height: 20px; margin: 8px 0 8px 15px; }
366
-
367
- /* Modal Component */
368
- .stx-modal-component--hidden { display: none; }
369
- .stx-modal-component-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
370
- .stx-modal-component-dialog { background: #fff; border-radius: 12px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
371
- .stx-modal-component--small .stx-modal-component-dialog { width: 300px; }
372
- .stx-modal-component--medium .stx-modal-component-dialog { width: 500px; }
373
- .stx-modal-component--large .stx-modal-component-dialog { width: 800px; }
374
- .stx-modal-component--fullscreen .stx-modal-component-dialog { width: 100%; height: 100%; border-radius: 0; }
375
- .stx-modal-component-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #e0e0e0; }
376
- .stx-modal-component-title { margin: 0; font-size: 18px; }
377
- .stx-modal-component-close { background: none; border: none; font-size: 24px; cursor: pointer; opacity: 0.6; }
378
- .stx-modal-component-close:hover { opacity: 1; }
379
- .stx-modal-component-body { padding: 16px; overflow-y: auto; flex: 1; }
380
- .stx-modal-component-footer { padding: 16px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 8px; }
381
-
382
- /* List View */
383
- .stx-list-view { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
384
- .stx-list-view-items { list-style: none; margin: 0; padding: 0; }
385
- .stx-list-view-item { padding: 12px 16px; border-bottom: 1px solid #e0e0e0; }
386
- .stx-list-view-item:last-child { border-bottom: none; }
387
- .stx-list-view--selectable .stx-list-view-item { cursor: pointer; }
388
- .stx-list-view--selectable .stx-list-view-item:hover { background: #f5f5f5; }
389
- .stx-list-view-item--selected { background: #e8f4fc; }
390
- .stx-list-view-empty { padding: 24px; text-align: center; color: #666; }
391
-
392
- /* Table */
393
- .stx-table { overflow-x: auto; }
394
- .stx-table table { width: 100%; border-collapse: collapse; }
395
- .stx-table th, .stx-table td { padding: 12px; text-align: left; }
396
- .stx-table th { font-weight: 600; background: #f5f5f5; }
397
- .stx-table--bordered th, .stx-table--bordered td { border: 1px solid #e0e0e0; }
398
- .stx-table--striped tbody tr:nth-child(even) { background: #f9f9f9; }
399
- .stx-table--hoverable tbody tr:hover { background: #f5f5f5; }
400
- .stx-table th[data-sortable] { cursor: pointer; }
401
- .stx-table-sort-icon::after { content: '⇅'; margin-left: 4px; opacity: 0.3; }
402
- .stx-table-sorted .stx-table-sort-icon::after { opacity: 1; }
403
- .stx-table-sorted--asc .stx-table-sort-icon::after { content: '↑'; }
404
- .stx-table-sorted--desc .stx-table-sort-icon::after { content: '↓'; }
405
-
406
- /* Tree View */
407
- .stx-tree-view { font-size: 14px; }
408
- .stx-tree-node { padding-left: 20px; }
409
- .stx-tree-node-content { display: flex; align-items: center; gap: 4px; padding: 4px; cursor: pointer; border-radius: 4px; }
410
- .stx-tree-node-content:hover { background: #f5f5f5; }
411
- .stx-tree-node--selected > .stx-tree-node-content { background: #e8f4fc; }
412
- .stx-tree-node--disabled { opacity: 0.5; }
413
- .stx-tree-toggle { width: 16px; cursor: pointer; transition: transform 0.2s; }
414
- .stx-tree-toggle--expanded { transform: rotate(90deg); }
415
- .stx-tree-toggle-placeholder { width: 16px; }
416
- .stx-tree-children { padding-left: 8px; }
417
-
418
- /* Data Grid */
419
- .stx-data-grid { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
420
- .stx-data-grid-table-wrapper { overflow-x: auto; }
421
- .stx-data-grid-table { width: 100%; border-collapse: collapse; }
422
- .stx-data-grid-table th, .stx-data-grid-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }
423
- .stx-data-grid-table th { background: #f5f5f5; }
424
- .stx-data-grid-header-cell { display: flex; align-items: center; gap: 8px; }
425
- .stx-data-grid-sort, .stx-data-grid-filter { background: none; border: none; cursor: pointer; opacity: 0.5; }
426
- .stx-data-grid-sort:hover, .stx-data-grid-filter:hover { opacity: 1; }
427
- .stx-data-grid-pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid #e0e0e0; }
428
- .stx-data-grid-page-buttons { display: flex; gap: 4px; }
429
- .stx-data-grid-page-btn { padding: 4px 8px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; border-radius: 4px; }
430
- .stx-data-grid-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
431
-
432
- /* Chart */
433
- .stx-chart { background: #f9f9f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
434
- .stx-chart-placeholder { text-align: center; padding: 20px; }
435
- .stx-chart-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
436
- .stx-chart-type { font-size: 14px; color: #666; }
437
- .stx-chart-info { font-size: 12px; color: #999; margin-top: 4px; }
438
-
439
- /* Code Editor */
440
- .stx-code-editor { display: flex; font-family: 'Monaco', 'Menlo', monospace; font-size: 13px; line-height: 1.5; overflow: hidden; border-radius: 8px; }
441
- .stx-code-editor--dark { background: #1e1e1e; color: #d4d4d4; }
442
- .stx-code-editor--light { background: #fff; color: #333; border: 1px solid #e0e0e0; }
443
- .stx-code-editor-gutter { padding: 12px 8px; background: rgba(0,0,0,0.1); text-align: right; user-select: none; }
444
- .stx-code-editor-line-number { color: #858585; }
445
- .stx-code-editor-content { flex: 1; padding: 12px; overflow: auto; }
446
- .stx-code-editor-content pre { margin: 0; }
447
- .stx-code-editor--wrap .stx-code-editor-content { white-space: pre-wrap; word-wrap: break-word; }
448
-
449
- /* Media Player */
450
- .stx-media-player video, .stx-media-player audio { width: 100%; display: block; }
451
- .stx-media-player--video { background: #000; }
452
-
453
- /* File Explorer */
454
- .stx-file-explorer { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
455
- .stx-file-explorer-list { width: 100%; border-collapse: collapse; }
456
- .stx-file-explorer-list th { text-align: left; padding: 8px 12px; background: #f5f5f5; font-weight: 500; }
457
- .stx-file-explorer-list td { padding: 8px 12px; border-top: 1px solid #e0e0e0; }
458
- .stx-file-explorer-item--selectable { cursor: pointer; }
459
- .stx-file-explorer-item--selectable:hover { background: #f5f5f5; }
460
- .stx-file-explorer-icon { margin-right: 8px; }
461
- .stx-file-explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px; padding: 16px; }
462
- .stx-file-explorer--grid .stx-file-explorer-item { text-align: center; padding: 12px; border-radius: 8px; }
463
- .stx-file-explorer--grid .stx-file-explorer-icon { font-size: 32px; display: block; margin-bottom: 8px; }
464
- .stx-file-explorer--grid .stx-file-explorer-name { font-size: 12px; word-break: break-all; }
465
-
466
- /* WebView */
467
- .stx-webview { border: none; display: block; }
468
-
469
- /* Dark mode support */
470
- @media (prefers-color-scheme: dark) {
471
- .stx-input-label { color: #eee; }
472
- .stx-input { background: #333; border-color: #555; color: #fff; }
473
- .stx-card { background: #2d2d2d; color: #fff; }
474
- .stx-card-subtitle { color: #aaa; }
475
- .stx-progress { background: #444; }
476
- .stx-dropdown { background: #333; border-color: #555; color: #fff; }
477
- .stx-accordion { border-color: #444; }
478
- .stx-accordion-item { border-color: #444; }
479
- .stx-accordion-header:hover { background: #333; }
480
- .stx-list-view { border-color: #444; }
481
- .stx-list-view-item { border-color: #444; }
482
- .stx-list-view--selectable .stx-list-view-item:hover { background: #333; }
483
- .stx-table th { background: #333; }
484
- .stx-table--bordered th, .stx-table--bordered td { border-color: #444; }
485
- .stx-tree-node-content:hover { background: #333; }
486
- .stx-data-grid { border-color: #444; }
487
- .stx-data-grid-table th, .stx-data-grid-table td { border-color: #444; }
488
- .stx-data-grid-table th { background: #333; }
489
- .stx-modal-component-dialog { background: #2d2d2d; color: #fff; }
490
- .stx-modal-component-header, .stx-modal-component-footer { border-color: #444; }
491
- .stx-file-explorer { border-color: #444; }
492
- .stx-file-explorer-list th { background: #333; }
493
- .stx-file-explorer-list td { border-color: #444; }
494
- .stx-autocomplete-list { background: #333; border-color: #444; }
495
- .stx-autocomplete-item:hover { background: #444; }
496
- .stx-chip--default { background: #444; color: #eee; }
497
- .stx-chip--primary { background: #1a3a52; }
498
- .stx-chip--success { background: #1a3a2a; }
499
- .stx-chip--warning { background: #3a2a1a; }
500
- .stx-chip--error { background: #3a1a1a; }
501
- }
502
- `;
145
+ export declare const COMPONENT_STYLES: string;
503
146
  /**
504
147
  * Button component properties
505
148
  */
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Open the menu and wait for it to close. Null without a bridge. A runtime
3
+ * older than Craft 0.0.109 resolves nothing, which reads as a dismissal.
4
+ */
5
+ declare function open(options: ContextMenuOptions): Promise<ContextMenuResult | null>;
1
6
  export declare const contextMenu: ContextMenuAPI;
2
7
  export declare interface ContextMenuItem {
3
8
  id?: string
@@ -19,6 +24,11 @@ export declare interface ContextMenuActionEvent {
19
24
  id: string
20
25
  targetId: string
21
26
  }
27
+ /** What Craft answers when a context menu closes; `id` is null if dismissed. */
28
+ declare interface ContextMenuResult {
29
+ id: string | null
30
+ targetId?: string
31
+ }
22
32
  export declare interface ContextMenuAPI {
23
33
  show: (options: ContextMenuOptions) => Promise<boolean>
24
34
  pick: (options: ContextMenuOptions) => Promise<string | null>
@@ -2,6 +2,13 @@
2
2
  export declare function redactPII(entry: StoredCrashEntry): StoredCrashEntry;
3
3
  /** Sign `body` with HMAC-SHA256 + `secret`. Returns lowercase hex. */
4
4
  export declare function signPayload(secret: string, body: string): Promise<string>;
5
+ declare function startForwarder(options: CrashForwarderOptions): CrashForwarderHandle;
6
+ // JS-side fallback queue when native isn't available.
7
+ declare const jsQueue: StoredCrashEntry[];
8
+ /** @defaultValue true */
9
+ declare let jsEnabled: boolean;
10
+ declare let jsUserId: string | undefined;
11
+ declare let jsAppVersion: string | undefined;
5
12
  export declare const crashReporter: CrashReporterAPI;
6
13
  export declare interface CrashReport {
7
14
  severity?: CrashSeverity
package/dist/focus.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare function unavailable(): FocusResult;
1
2
  /**
2
3
  * Whether every shortcut the app depends on is installed.
3
4
  *
@@ -11,6 +12,7 @@ export declare function hasFocusShortcuts(...names: string[]): Promise<boolean>;
11
12
  * check". Prefer this anywhere the answer drives a setup prompt.
12
13
  */
13
14
  export declare function focusShortcutsReady(...names: string[]): Promise<boolean | 'unknown'>;
15
+ declare const UNSUPPORTED: FocusStatus;
14
16
  export declare const focus: FocusAPI;
15
17
  export declare interface FocusStatus {
16
18
  supported: boolean
package/dist/fs.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ declare function bytesToBase64(bytes: Uint8Array): string;
2
+ declare function base64ToBytes(b64: string): Uint8Array;
3
+ declare function normalizeStat(raw: any): FileStat;
1
4
  // Each method is `async` so that the synchronous `requireBridge` throw
2
5
  // surfaces as a rejected promise — matching the rest of the surface and
3
6
  // keeping call sites uniformly awaitable.
@@ -1,3 +1,5 @@
1
+ /** Only ever called behind `hasBridge('shortcuts')`. */
2
+ declare function shortcutsBridge(): ShortcutsBridge;
1
3
  export declare const globalShortcuts: GlobalShortcuts;
2
4
  export declare interface GlobalShortcutOptions {
3
5
  repeats?: boolean
@@ -17,3 +19,25 @@ export declare interface GlobalShortcuts {
17
19
  list: () => Promise<Array<{ id: string, accelerator: string, enabled: boolean }>>
18
20
  on: (cb: (e: ShortcutFireEvent) => void) => () => void
19
21
  }
22
+ /**
23
+ * The shortcuts bridge as craft-bridge.js actually ships it.
24
+ *
25
+ * craft-native declares `craft.shortcuts` optional and its `register` as
26
+ * two-argument, so every call here is a TS2532 and the `opts` pass-through a
27
+ * TS2554. Cast rather than augment, for the reason focus.ts records: index.d.ts
28
+ * re-exports a fixed list of type names, so `declare module 'craft-native'`
29
+ * silently declares a SECOND interface instead of merging, and the calls still
30
+ * fail. Worth an upstream issue alongside the CraftFocusAPI gap.
31
+ *
32
+ * Every call is already guarded by `hasBridge('shortcuts')`, which is what
33
+ * makes the non-null assertion safe at runtime.
34
+ */
35
+ declare interface ShortcutsBridge {
36
+ register: (id: string, accelerator: string, opts?: GlobalShortcutOptions) => Promise<void>
37
+ unregister: (id: string) => Promise<void>
38
+ unregisterAll: () => Promise<void>
39
+ enable: (id: string) => Promise<void>
40
+ disable: (id: string) => Promise<void>
41
+ isRegistered: (id: string) => Promise<boolean>
42
+ list: () => Promise<Array<{ id: string, accelerator: string, enabled: boolean }>>
43
+ }
package/dist/menu.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Strip `onClick` from the payload and return the handlers by id.
3
+ *
4
+ * The native side is given plain data; the closures stay on this side, keyed by
5
+ * the id it will report back.
6
+ */
7
+ declare function extractHandlers(appMenu: ApplicationMenu): {
8
+ payload: ApplicationMenu
9
+ handlers: Map<string, () => void>
10
+ };
1
11
  /**
2
12
  * The menus every Mac app is expected to have, built correctly.
3
13
  *
@@ -7,6 +17,15 @@
7
17
  * responder chain and macOS augments the menus with its own additions —
8
18
  * Writing Tools and Emoji & Symbols in Edit, Quit and Keep Windows in the app
9
19
  * menu — which it only does for menus it recognises.
20
+ * @defaultValue
21
+ * ```ts
22
+ * {
23
+ * app: (appName: string, options?: StandardMenuOptions) => Menu,
24
+ * edit: () => Menu,
25
+ * window: () => Menu,
26
+ * leading: (appName: string, options?: StandardMenuOptions) => Menu[]
27
+ * }
28
+ * ```
10
29
  */
11
30
  export declare const standardMenus: {
12
31
  /**
@@ -27,6 +46,8 @@ export declare const standardMenus: {
27
46
  */
28
47
  leading: (appName: string, options?: StandardMenuOptions) => Menu[]
29
48
  };
49
+ /** Removes the listener installed by the previous `set`, so repeats do not stack. */
50
+ declare let disposeHandlers: (() => void) | null;
30
51
  export declare const menu: MenuAPI;
31
52
  export declare interface MenuItem {
32
53
  id?: string
package/dist/modals.d.ts CHANGED
@@ -66,136 +66,4 @@ export declare function closeAllModals(): void;
66
66
  /**
67
67
  * CSS styles for web-based modals
68
68
  */
69
- export declare const MODAL_STYLES: `
70
- .stx-modal-overlay {
71
- position: fixed;
72
- inset: 0;
73
- background: rgba(0, 0, 0, 0.5);
74
- display: flex;
75
- align-items: center;
76
- justify-content: center;
77
- z-index: 10000;
78
- animation: stx-modal-fade-in 0.15s ease-out;
79
- }
80
-
81
- @keyframes stx-modal-fade-in {
82
- from { opacity: 0; }
83
- to { opacity: 1; }
84
- }
85
-
86
- .stx-modal {
87
- background: #fff;
88
- border-radius: 12px;
89
- padding: 24px;
90
- max-width: 400px;
91
- width: 90%;
92
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
93
- animation: stx-modal-slide-up 0.2s ease-out;
94
- }
95
-
96
- @keyframes stx-modal-slide-up {
97
- from { transform: translateY(20px); opacity: 0; }
98
- to { transform: translateY(0); opacity: 1; }
99
- }
100
-
101
- @media (prefers-color-scheme: dark) {
102
- .stx-modal {
103
- background: #2d2d2d;
104
- color: #fff;
105
- }
106
- }
107
-
108
- .stx-modal-icon {
109
- font-size: 48px;
110
- text-align: center;
111
- margin-bottom: 16px;
112
- }
113
-
114
- .stx-modal.info .stx-modal-icon { color: #3498db; }
115
- .stx-modal.warning .stx-modal-icon { color: #f39c12; }
116
- .stx-modal.error .stx-modal-icon { color: #e74c3c; }
117
- .stx-modal.success .stx-modal-icon { color: #27ae60; }
118
- .stx-modal.question .stx-modal-icon { color: #9b59b6; }
119
-
120
- .stx-modal-content {
121
- text-align: center;
122
- margin-bottom: 24px;
123
- }
124
-
125
- .stx-modal-title {
126
- margin: 0 0 8px;
127
- font-size: 20px;
128
- font-weight: 600;
129
- }
130
-
131
- .stx-modal-message {
132
- margin: 0;
133
- color: #666;
134
- line-height: 1.5;
135
- }
136
-
137
- @media (prefers-color-scheme: dark) {
138
- .stx-modal-message { color: #aaa; }
139
- }
140
-
141
- .stx-modal-buttons {
142
- display: flex;
143
- gap: 8px;
144
- justify-content: center;
145
- }
146
-
147
- .stx-modal-btn {
148
- padding: 10px 24px;
149
- border-radius: 6px;
150
- font-size: 14px;
151
- font-weight: 500;
152
- cursor: pointer;
153
- border: none;
154
- transition: background 0.15s, transform 0.1s;
155
- }
156
-
157
- .stx-modal-btn:hover {
158
- transform: translateY(-1px);
159
- }
160
-
161
- .stx-modal-btn:active {
162
- transform: translateY(0);
163
- }
164
-
165
- .stx-modal-btn.default {
166
- background: #e0e0e0;
167
- color: #333;
168
- }
169
-
170
- .stx-modal-btn.default:hover {
171
- background: #d0d0d0;
172
- }
173
-
174
- .stx-modal-btn.primary {
175
- background: #3498db;
176
- color: #fff;
177
- }
178
-
179
- .stx-modal-btn.primary:hover {
180
- background: #2980b9;
181
- }
182
-
183
- .stx-modal-btn.destructive {
184
- background: #e74c3c;
185
- color: #fff;
186
- }
187
-
188
- .stx-modal-btn.destructive:hover {
189
- background: #c0392b;
190
- }
191
-
192
- @media (prefers-color-scheme: dark) {
193
- .stx-modal-btn.default {
194
- background: #444;
195
- color: #fff;
196
- }
197
- .stx-modal-btn.default:hover {
198
- background: #555;
199
- }
200
- }
201
- `;
69
+ export declare const MODAL_STYLES: string;
@@ -1,3 +1,12 @@
1
+ declare function api(): CraftWindowNamespace | null;
2
+ /**
3
+ * Call a window action, and let a host that does not have it be a no-op.
4
+ *
5
+ * Optional chaining on every method rather than a version check: these arrive
6
+ * one at a time across Craft releases, and an app that is only *mostly* able
7
+ * to control its window should keep working rather than throw on load.
8
+ */
9
+ declare function call(action: (ns: CraftWindowNamespace) => Promise<unknown> | undefined): Promise<void>;
1
10
  export declare const nativeWindow: NativeWindow;
2
11
  /**
3
12
  * A second window, described the way Craft's CLI describes the first.
@@ -31,6 +40,18 @@ export declare interface NativeWindowOptions {
31
40
  persistentStorage?: boolean
32
41
  devTools?: boolean
33
42
  }
43
+ declare interface CraftWindowNamespace {
44
+ open?: (options: NativeWindowOptions) => Promise<{ name?: string }>
45
+ close?: () => Promise<void>
46
+ focus?: () => Promise<void>
47
+ minimize?: () => Promise<void>
48
+ maximize?: () => Promise<void>
49
+ center?: () => Promise<void>
50
+ startDrag?: () => Promise<void>
51
+ setTitle?: (title: string) => Promise<void>
52
+ setSize?: (width: number, height: number) => Promise<void>
53
+ setAppearance?: (appearance: WindowAppearance) => Promise<void>
54
+ }
34
55
  export declare interface NativeWindow {
35
56
  readonly available: boolean
36
57
  open: (options: NativeWindowOptions) => Promise<{ name: string }>
package/dist/network.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare function webConnectionType(): ConnectionType;
1
2
  export declare const network: NetworkAPI;
2
3
  export declare interface NetworkInterface {
3
4
  name: string
@@ -1,3 +1,4 @@
1
+ declare function toEpochMs(t: string | number | Date | undefined): number;
1
2
  export declare const notifications: SystemNotifications;
2
3
  export declare interface NotificationAttachment {
3
4
  id?: string
@@ -1,3 +1,5 @@
1
+ declare function webCheck(name: PermissionName): Promise<PermissionStatus>;
2
+ declare function webRequest(name: PermissionName): Promise<PermissionStatus>;
1
3
  export declare const permissions: PermissionsAPI;
2
4
  export declare interface PermissionsAPI {
3
5
  check: (name: PermissionName) => Promise<PermissionStatus>
@@ -1,3 +1,4 @@
1
+ declare function idleState(): ScreenSharingState;
1
2
  /**
2
3
  * Subscribe and start polling in one call, returning a single teardown.
3
4
  *
package/dist/screen.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare function webDisplays(): Display[];
1
2
  export declare const screen: ScreenAPI;
2
3
  export declare interface Display {
3
4
  id: number
package/dist/shell.d.ts CHANGED
@@ -1,3 +1,22 @@
1
+ /**
2
+ * Set of currently-active spawn ids. Tracked in JS so we can fail
3
+ * fast on duplicate ids before the call hits native — the native side
4
+ * silently overwrites a previous spawn under the same id, which
5
+ * leaks processes and orphans their event streams.
6
+ *
7
+ * Auto-clean: an exit event from the native side removes the id; the
8
+ * `kill()` wrapper does the same on demand. If the native fires an
9
+ * exit without our wrapper (rare race), the id stays in the set —
10
+ * worst case is a misleading "already in use" error on a subsequent
11
+ * spawn, which is recoverable.
12
+ */
13
+ declare const activeSpawnIds: Set<string>;
14
+ // Schemes blocked outright in `openExternal`. `javascript:` is the
15
+ // classic XSS vector; `data:` is also dangerous because attacker-
16
+ // controlled HTML can be loaded by the system handler. `file:` is a
17
+ // less obvious one — opening a local file via the OS handler can
18
+ // execute scripts from disk.
19
+ declare const BLOCKED_SCHEMES: Set<any>;
1
20
  export declare const shell: Shell;
2
21
  export declare interface SpawnOptions {
3
22
  cwd?: string
package/dist/sidebar.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ declare function badgeText(badge: SidebarItem['badge']): string;
2
+ declare function toNative(sections: SidebarSection[]): NativeSidebarSection[];
3
+ /** Everything but the badges: when this is unchanged, badges can be patched in place. */
4
+ declare function shape(sections: SidebarSection[]): string;
5
+ declare function badges(sections: SidebarSection[]): Map<string, string>;
1
6
  export declare const sidebar: SidebarAPI;
2
7
  export declare interface SidebarItem {
3
8
  id: string
@@ -27,3 +32,26 @@ export declare interface SidebarAPI {
27
32
  available: () => boolean
28
33
  create: (options: SidebarOptions) => SidebarHandle | null
29
34
  }
35
+ declare interface NativeHandle {
36
+ id: string
37
+ setSections: (sections: unknown[]) => unknown
38
+ updateItem: (itemId: string, changes: Record<string, unknown>) => unknown
39
+ setSelectedItem: (itemId: string) => unknown
40
+ onSelect: (callback: (itemId: string) => void) => unknown
41
+ destroy: () => void
42
+ }
43
+ /**
44
+ * The payload shape `createSidebar` takes.
45
+ *
46
+ * Named structurally rather than imported: craft-native's entry re-exports a
47
+ * fixed list of type names and `CraftSidebarSection` is not one of them, so
48
+ * there is nothing to import and `declare module` would declare a second
49
+ * interface rather than merge. Assignment is structural either way, and a
50
+ * named shape keeps a typo in the payload an error, which
51
+ * `Record<string, unknown>` did not.
52
+ */
53
+ declare interface NativeSidebarSection {
54
+ id: string
55
+ header?: string
56
+ items: Array<{ id: string, label: string, icon?: string, badge?: string }>
57
+ }
@@ -52,70 +52,4 @@ export declare const createMenubar: typeof createSystemTray;
52
52
  /**
53
53
  * CSS styles for the simulated tray menu
54
54
  */
55
- export declare const TRAY_MENU_STYLES: `
56
- .stx-tray-menu {
57
- background: #2d2d2d;
58
- border-radius: 8px;
59
- padding: 4px 0;
60
- min-width: 200px;
61
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
62
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
63
- font-size: 13px;
64
- color: #fff;
65
- }
66
-
67
- .stx-tray-item {
68
- padding: 6px 12px;
69
- display: flex;
70
- align-items: center;
71
- justify-content: space-between;
72
- cursor: pointer;
73
- position: relative;
74
- }
75
-
76
- .stx-tray-item:hover {
77
- background: #3d3d3d;
78
- }
79
-
80
- .stx-tray-item.disabled {
81
- opacity: 0.5;
82
- cursor: not-allowed;
83
- }
84
-
85
- .stx-tray-item .label {
86
- flex: 1;
87
- }
88
-
89
- .stx-tray-item .accelerator {
90
- margin-left: 20px;
91
- opacity: 0.6;
92
- font-size: 12px;
93
- }
94
-
95
- .stx-tray-item .arrow {
96
- margin-left: 8px;
97
- font-size: 10px;
98
- }
99
-
100
- .stx-tray-separator {
101
- margin: 4px 0;
102
- border: none;
103
- border-top: 1px solid #444;
104
- }
105
-
106
- .stx-tray-submenu {
107
- position: absolute;
108
- left: 100%;
109
- top: 0;
110
- background: #2d2d2d;
111
- border-radius: 8px;
112
- padding: 4px 0;
113
- min-width: 150px;
114
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
115
- display: none;
116
- }
117
-
118
- .stx-tray-item:hover > .stx-tray-submenu {
119
- display: block;
120
- }
121
- `;
55
+ export declare const TRAY_MENU_STYLES: string;
package/dist/system.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ declare function bridgeOr<T>(ns: string, method: string, fallback: () => T | Promise<T>): Promise<T>;
2
+ declare function mediaMatches(query: string): boolean;
1
3
  export declare const system: SystemInfo;
2
4
  export declare interface SystemInfo {
3
5
  accentColor: () => Promise<string>
package/dist/theme.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare function detectWebAppearance(): Appearance;
1
2
  export declare const theme: SystemTheme;
2
3
  export declare interface ThemeInfo {
3
4
  appearance: Appearance
package/dist/updater.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Coerce arbitrary `BufferSource`-ish input into a `Uint8Array` whose
3
+ * underlying storage is a plain `ArrayBuffer`. The Web Crypto types
4
+ * insist on `ArrayBufferView<ArrayBuffer>`, which excludes the looser
5
+ * `ArrayBufferLike` (covers `SharedArrayBuffer`) you get back from
6
+ * `Response.arrayBuffer()` under TS strict mode.
7
+ */
8
+ declare function toArrayBufferBytes(input: Uint8Array | ArrayBuffer): Uint8Array<ArrayBuffer>;
1
9
  export declare const updater: Updater;
2
10
  export declare interface UpdateInfo {
3
11
  version: string
@@ -1,3 +1,4 @@
1
+ declare function webEvent(name: string, cb: () => void): () => void;
1
2
  export declare const windowEvents: WindowEvents;
2
3
  export declare interface WindowSize {
3
4
  id?: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/desktop",
3
3
  "type": "module",
4
- "version": "0.2.572",
4
+ "version": "0.2.574",
5
5
  "description": "Native desktop application framework for stx (powered by Craft)",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",