@appstrata/dev 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +164 -0
  2. package/dist/completion-notification.d.ts +22 -0
  3. package/dist/completion-notification.d.ts.map +1 -0
  4. package/dist/completion-notification.js +184 -0
  5. package/dist/completion-notification.js.map +1 -0
  6. package/dist/dev-overlay.css +450 -0
  7. package/dist/dev-overlay.d.ts +56 -0
  8. package/dist/dev-overlay.d.ts.map +1 -0
  9. package/dist/dev-overlay.js +371 -0
  10. package/dist/dev-overlay.js.map +1 -0
  11. package/dist/index.d.ts +16 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +22 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/intercepting-transport.d.ts +11 -0
  16. package/dist/intercepting-transport.d.ts.map +1 -0
  17. package/dist/intercepting-transport.js +31 -0
  18. package/dist/intercepting-transport.js.map +1 -0
  19. package/dist/load-config.d.ts +42 -0
  20. package/dist/load-config.d.ts.map +1 -0
  21. package/dist/load-config.js +87 -0
  22. package/dist/load-config.js.map +1 -0
  23. package/dist/logging-hmr.d.ts +20 -0
  24. package/dist/logging-hmr.d.ts.map +1 -0
  25. package/dist/logging-hmr.js +28 -0
  26. package/dist/logging-hmr.js.map +1 -0
  27. package/dist/mock-init.d.ts +9 -0
  28. package/dist/mock-init.d.ts.map +1 -0
  29. package/dist/mock-init.js +171 -0
  30. package/dist/mock-init.js.map +1 -0
  31. package/dist/mock-player.d.ts +117 -0
  32. package/dist/mock-player.d.ts.map +1 -0
  33. package/dist/mock-player.js +132 -0
  34. package/dist/mock-player.js.map +1 -0
  35. package/dist/mock-services.d.ts +32 -0
  36. package/dist/mock-services.d.ts.map +1 -0
  37. package/dist/mock-services.js +141 -0
  38. package/dist/mock-services.js.map +1 -0
  39. package/dist/player/index.html +22 -0
  40. package/dist/player/main.d.ts +10 -0
  41. package/dist/player/main.d.ts.map +1 -0
  42. package/dist/player/main.js +352 -0
  43. package/dist/player/main.js.map +1 -0
  44. package/dist/player/styles.css +80 -0
  45. package/dist/plugin.d.ts +103 -0
  46. package/dist/plugin.d.ts.map +1 -0
  47. package/dist/plugin.js +292 -0
  48. package/dist/plugin.js.map +1 -0
  49. package/dist/types.d.ts +376 -0
  50. package/dist/types.d.ts.map +1 -0
  51. package/dist/types.js +75 -0
  52. package/dist/types.js.map +1 -0
  53. package/package.json +50 -0
@@ -0,0 +1,450 @@
1
+ /* ── Dev Overlay ── shared between standalone and embedded players ──── */
2
+
3
+ #__appstrata-dev-root {
4
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
5
+ }
6
+
7
+ /* ── Overlay header (hidden by default, reveals on hover) ──────────── */
8
+
9
+ #__appstrata-dev-root .player-overlay {
10
+ position: absolute;
11
+ top: 0;
12
+ left: 0;
13
+ right: 0;
14
+ z-index: 100000;
15
+ transform: translateY(-100%);
16
+ transition: transform 200ms ease;
17
+ border-bottom: 1px solid rgba(0, 212, 255, 0.15);
18
+ }
19
+
20
+ /* Invisible hover bridge — closes the gap between the overlay and the handle
21
+ so the mouse doesn't leave the hover target when crossing between them. */
22
+ #__appstrata-dev-root .player-overlay::before {
23
+ content: '';
24
+ position: absolute;
25
+ bottom: -26px;
26
+ left: 0;
27
+ right: 0;
28
+ height: 26px;
29
+ cursor: pointer;
30
+ }
31
+
32
+ #__appstrata-dev-root .player-overlay::after {
33
+ content: '';
34
+ position: absolute;
35
+ left: 50%;
36
+ bottom: -17px;
37
+ transform: translateX(-50%);
38
+ width: 100px;
39
+ height: 4px;
40
+ background: rgba(128, 128, 128, 0.4);
41
+ border-radius: 2px;
42
+ cursor: pointer;
43
+ backdrop-filter: blur(4px);
44
+ }
45
+
46
+ #__appstrata-dev-root .player-overlay:hover {
47
+ transform: translateY(0);
48
+ }
49
+
50
+ #__appstrata-dev-root .player-header {
51
+ background: #16213e;
52
+ padding: 10px 14px;
53
+ color: #00d4ff;
54
+ font-size: 14px;
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ align-items: center;
58
+ gap: 6px 10px;
59
+ }
60
+
61
+ #__appstrata-dev-root .status-indicator {
62
+ width: 8px;
63
+ height: 8px;
64
+ background: #00ff88;
65
+ border-radius: 50%;
66
+ animation: __as-dev-pulse 2s infinite;
67
+ }
68
+
69
+ #__appstrata-dev-root .status-indicator.completed {
70
+ background: #6c757d;
71
+ animation: __as-dev-completed-pulse 2s infinite;
72
+ }
73
+
74
+ @keyframes __as-dev-pulse {
75
+ 0%, 100% {
76
+ opacity: 1;
77
+ transform: scale(1);
78
+ }
79
+ 50% {
80
+ opacity: 0.6;
81
+ transform: scale(0.9);
82
+ }
83
+ }
84
+
85
+ @keyframes __as-dev-completed-pulse {
86
+ 0%, 100% {
87
+ opacity: 1;
88
+ transform: scale(1);
89
+ }
90
+ 50% {
91
+ opacity: 0.7;
92
+ transform: scale(1.1);
93
+ }
94
+ }
95
+
96
+ #__appstrata-dev-root .player-title {
97
+ font-weight: 600;
98
+ white-space: nowrap;
99
+ }
100
+
101
+ #__appstrata-dev-root .player-mode {
102
+ margin-left: auto;
103
+ opacity: 0.6;
104
+ font-size: 12px;
105
+ min-width: 0;
106
+ }
107
+
108
+ #__appstrata-dev-root .header-auto-zoom {
109
+ font-size: 12px;
110
+ color: #8890a4;
111
+ white-space: nowrap;
112
+ border-left: 1px solid rgba(0, 212, 255, 0.15);
113
+ padding-left: 10px;
114
+ }
115
+
116
+ #__appstrata-dev-root .header-auto-zoom .res-value {
117
+ color: #00d4ff;
118
+ font-weight: 600;
119
+ }
120
+
121
+ #__appstrata-dev-root .header-resolution {
122
+ font-size: 12px;
123
+ color: #8890a4;
124
+ border-left: 1px solid rgba(0, 212, 255, 0.15);
125
+ padding-left: 10px;
126
+ }
127
+
128
+ #__appstrata-dev-root .header-resolution .res-value {
129
+ color: #00d4ff;
130
+ font-family: 'Courier New', monospace;
131
+ font-weight: 600;
132
+ }
133
+
134
+ #__appstrata-dev-root .header-resolution .res-separator {
135
+ margin: 0 8px;
136
+ opacity: 0.3;
137
+ }
138
+
139
+ /* ── Message stats bar ──────────────────────────────────────────────── */
140
+
141
+ #__appstrata-dev-root .message-stats {
142
+ background: #1a1f3a;
143
+ padding: 8px 20px;
144
+ display: flex;
145
+ gap: 24px;
146
+ font-size: 12px;
147
+ color: #8890a4;
148
+ }
149
+
150
+ #__appstrata-dev-root .message-stat {
151
+ display: flex;
152
+ align-items: center;
153
+ gap: 6px;
154
+ }
155
+
156
+ #__appstrata-dev-root .message-stat.clickable {
157
+ cursor: pointer;
158
+ padding: 4px 10px;
159
+ margin: -4px 0;
160
+ border-radius: 6px;
161
+ transition: background 0.15s;
162
+ }
163
+
164
+ #__appstrata-dev-root .message-stat.clickable:hover {
165
+ background: rgba(0, 212, 255, 0.08);
166
+ }
167
+
168
+ #__appstrata-dev-root .message-stat-label {
169
+ font-weight: 500;
170
+ }
171
+
172
+ #__appstrata-dev-root .message-stat-value {
173
+ font-family: 'Courier New', monospace;
174
+ color: #00d4ff;
175
+ font-weight: 600;
176
+ }
177
+
178
+ #__appstrata-dev-root .message-status-dot {
179
+ width: 6px;
180
+ height: 6px;
181
+ border-radius: 50%;
182
+ background: #00ff88;
183
+ animation: __as-dev-pulse 2s infinite;
184
+ }
185
+
186
+ /* ── Message popup overlay ──────────────────────────────────────────── */
187
+
188
+ #__appstrata-dev-root .msg-popup-overlay {
189
+ position: fixed;
190
+ inset: 0;
191
+ background: rgba(0, 0, 0, 0.6);
192
+ z-index: 100000;
193
+ display: flex;
194
+ align-items: center;
195
+ justify-content: center;
196
+ }
197
+
198
+ #__appstrata-dev-root .msg-popup {
199
+ background: #12132a;
200
+ border: 1px solid rgba(0, 212, 255, 0.15);
201
+ border-radius: 10px;
202
+ width: min(680px, 90vw);
203
+ max-height: 80vh;
204
+ display: flex;
205
+ flex-direction: column;
206
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
207
+ }
208
+
209
+ #__appstrata-dev-root .msg-popup-header {
210
+ display: flex;
211
+ align-items: center;
212
+ gap: 10px;
213
+ padding: 14px 20px;
214
+ border-bottom: 1px solid rgba(0, 212, 255, 0.1);
215
+ }
216
+
217
+ #__appstrata-dev-root .msg-popup-title {
218
+ font-size: 14px;
219
+ font-weight: 600;
220
+ color: #00d4ff;
221
+ }
222
+
223
+ #__appstrata-dev-root .msg-popup-copy-all {
224
+ background: none;
225
+ border: 1px solid rgba(0, 212, 255, 0.2);
226
+ color: #8890a4;
227
+ font-size: 11px;
228
+ cursor: pointer;
229
+ padding: 4px 10px;
230
+ border-radius: 6px;
231
+ transition: color 0.15s, border-color 0.15s;
232
+ }
233
+
234
+ #__appstrata-dev-root .msg-popup-copy-all:hover {
235
+ color: #00d4ff;
236
+ border-color: rgba(0, 212, 255, 0.5);
237
+ }
238
+
239
+ #__appstrata-dev-root .msg-popup-close {
240
+ background: none;
241
+ border: none;
242
+ color: #8890a4;
243
+ font-size: 22px;
244
+ cursor: pointer;
245
+ padding: 0 4px;
246
+ line-height: 1;
247
+ transition: color 0.15s;
248
+ margin-left: auto;
249
+ }
250
+
251
+ #__appstrata-dev-root .msg-popup-close:hover {
252
+ color: #fff;
253
+ }
254
+
255
+ #__appstrata-dev-root .msg-popup-body {
256
+ flex: 1;
257
+ overflow-y: auto;
258
+ padding: 16px 20px;
259
+ display: flex;
260
+ flex-direction: column;
261
+ gap: 10px;
262
+ }
263
+
264
+ #__appstrata-dev-root .msg-popup-empty {
265
+ color: #8890a4;
266
+ text-align: center;
267
+ padding: 40px 0;
268
+ font-size: 13px;
269
+ }
270
+
271
+ /* ── Messenger-style message bubbles ─────────────────────────────────── */
272
+
273
+ #__appstrata-dev-root .msg-row {
274
+ display: flex;
275
+ }
276
+
277
+ #__appstrata-dev-root .msg-row.host-to-app {
278
+ justify-content: flex-start;
279
+ }
280
+
281
+ #__appstrata-dev-root .msg-row.app-to-host {
282
+ justify-content: flex-end;
283
+ }
284
+
285
+ #__appstrata-dev-root .msg-bubble {
286
+ max-width: 85%;
287
+ border-radius: 10px;
288
+ padding: 10px 14px;
289
+ font-size: 12px;
290
+ position: relative;
291
+ }
292
+
293
+ #__appstrata-dev-root .msg-row.host-to-app .msg-bubble {
294
+ background: #1a2744;
295
+ border: 1px solid rgba(0, 212, 255, 0.12);
296
+ border-bottom-left-radius: 3px;
297
+ }
298
+
299
+ #__appstrata-dev-root .msg-row.app-to-host .msg-bubble {
300
+ background: #2a1a44;
301
+ border: 1px solid rgba(160, 100, 255, 0.15);
302
+ border-bottom-right-radius: 3px;
303
+ }
304
+
305
+ #__appstrata-dev-root .msg-meta {
306
+ display: flex;
307
+ align-items: center;
308
+ gap: 8px;
309
+ margin-bottom: 6px;
310
+ }
311
+
312
+ #__appstrata-dev-root .msg-direction {
313
+ font-size: 10px;
314
+ font-weight: 600;
315
+ text-transform: uppercase;
316
+ letter-spacing: 0.5px;
317
+ }
318
+
319
+ #__appstrata-dev-root .msg-row.host-to-app .msg-direction {
320
+ color: #00d4ff;
321
+ }
322
+
323
+ #__appstrata-dev-root .msg-row.app-to-host .msg-direction {
324
+ color: #a064ff;
325
+ }
326
+
327
+ #__appstrata-dev-root .msg-type {
328
+ font-weight: 700;
329
+ font-size: 12px;
330
+ color: #e0e0e0;
331
+ }
332
+
333
+ #__appstrata-dev-root .msg-time {
334
+ font-size: 10px;
335
+ color: #5a6178;
336
+ margin-left: auto;
337
+ }
338
+
339
+ /* ── Collapsible JSON tree ───────────────────────────────────────────── */
340
+
341
+ #__appstrata-dev-root .msg-json {
342
+ margin-top: 6px;
343
+ font-family: 'Courier New', monospace;
344
+ font-size: 11px;
345
+ line-height: 1.5;
346
+ }
347
+
348
+ #__appstrata-dev-root .json-toggle {
349
+ display: inline-block;
350
+ width: 14px;
351
+ cursor: pointer;
352
+ user-select: none;
353
+ color: #5a6178;
354
+ text-align: center;
355
+ flex-shrink: 0;
356
+ }
357
+
358
+ #__appstrata-dev-root .json-toggle:hover {
359
+ color: #00d4ff;
360
+ }
361
+
362
+ #__appstrata-dev-root .json-line {
363
+ display: flex;
364
+ align-items: flex-start;
365
+ }
366
+
367
+ #__appstrata-dev-root .json-indent {
368
+ display: inline-block;
369
+ width: 16px;
370
+ flex-shrink: 0;
371
+ }
372
+
373
+ #__appstrata-dev-root .json-children {
374
+ display: block;
375
+ }
376
+
377
+ #__appstrata-dev-root .json-collapsed > .json-children {
378
+ display: none;
379
+ }
380
+
381
+ #__appstrata-dev-root .json-collapsed > .json-line > .json-toggle::after {
382
+ content: '';
383
+ }
384
+
385
+ #__appstrata-dev-root .json-key {
386
+ color: #c792ea;
387
+ }
388
+
389
+ #__appstrata-dev-root .json-string {
390
+ color: #c3e88d;
391
+ }
392
+
393
+ #__appstrata-dev-root .json-number {
394
+ color: #f78c6c;
395
+ }
396
+
397
+ #__appstrata-dev-root .json-boolean {
398
+ color: #89ddff;
399
+ }
400
+
401
+ #__appstrata-dev-root .json-null {
402
+ color: #5a6178;
403
+ font-style: italic;
404
+ }
405
+
406
+ #__appstrata-dev-root .json-bracket {
407
+ color: #8890a4;
408
+ }
409
+
410
+ #__appstrata-dev-root .json-summary {
411
+ color: #5a6178;
412
+ font-style: italic;
413
+ cursor: pointer;
414
+ }
415
+
416
+ /* ── Resize resolution toast ────────────────────────────────────────── */
417
+
418
+ #__appstrata-dev-root .resize-info {
419
+ position: absolute;
420
+ top: 24px;
421
+ left: 50%;
422
+ transform: translateX(-50%);
423
+ z-index: 99;
424
+ background: rgba(0, 0, 0, 0.7);
425
+ border: 1px solid rgba(255, 255, 255, 0.15);
426
+ border-radius: 8px;
427
+ padding: 6px 16px;
428
+ font-size: 12px;
429
+ color: rgba(255, 255, 255, 0.85);
430
+ white-space: nowrap;
431
+ pointer-events: none;
432
+ opacity: 0;
433
+ transition: opacity 300ms ease;
434
+ backdrop-filter: blur(6px);
435
+ }
436
+
437
+ #__appstrata-dev-root .resize-info.visible {
438
+ opacity: 0.3;
439
+ }
440
+
441
+ #__appstrata-dev-root .resize-info .res-value {
442
+ color: #fff;
443
+ font-family: 'Courier New', monospace;
444
+ font-weight: 600;
445
+ }
446
+
447
+ #__appstrata-dev-root .resize-info .res-separator {
448
+ margin: 0 8px;
449
+ opacity: 0.3;
450
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Shared dev overlay UI.
3
+ *
4
+ * Creates a hover-reveal drawer (status, title, mode, auto-zoom, resolution,
5
+ * message stats) and a messenger-style message popup. Used by both the
6
+ * standalone iframe player and the embedded Vite-plugin player.
7
+ */
8
+ import type { AutoZoomMode } from './types.js';
9
+ export type MessageDirection = "app-to-host" | "host-to-app";
10
+ /** Subset of the dev-server context that the overlay needs. */
11
+ export interface DevOverlayContext {
12
+ mode?: string;
13
+ environment?: string;
14
+ viewportWidth?: number;
15
+ viewportHeight?: number;
16
+ autoZoom?: AutoZoomMode;
17
+ }
18
+ export interface DevOverlayOptions {
19
+ container: HTMLElement;
20
+ /** Element whose clientWidth/clientHeight report the "effective" resolution. */
21
+ measureElement: HTMLElement;
22
+ context: DevOverlayContext;
23
+ /**
24
+ * When true (default), injects the overlay CSS as a <style> tag.
25
+ * Set to false when the CSS is already loaded via a <link> tag.
26
+ */
27
+ injectStyles?: boolean;
28
+ /** When set, shows a "Relay Active" indicator and a "Dropped" counter. */
29
+ relay?: {
30
+ playerUrl: string;
31
+ };
32
+ /**
33
+ * When true, protocol messages with op `log` are silently dropped from the
34
+ * message log and stats counters. Defaults to false.
35
+ * @internal Not yet exposed through higher-level configuration.
36
+ */
37
+ dropLogMessages?: boolean;
38
+ }
39
+ export interface DevOverlay {
40
+ updateResolution(): void;
41
+ /** Update mode text, target resolution, and auto-zoom label from a new context. */
42
+ updateContext(context: DevOverlayContext): void;
43
+ setCompleted(): void;
44
+ flashResizeToast(): void;
45
+ /** Record an intercepted protocol message and update the stats counters. */
46
+ logMessage(direction: MessageDirection, message: unknown): void;
47
+ /** Update the relay "Dropped" counter (only visible when relay option was set). */
48
+ setDroppedCount(count: number): void;
49
+ /** Update whether protocol messages with op `log` are dropped from the panel. */
50
+ setDropLogMessages(value: boolean): void;
51
+ /** The overlay drawer element — append extra sections here. */
52
+ overlayContentEl: HTMLElement;
53
+ destroy(): void;
54
+ }
55
+ export declare function createDevOverlay(options: DevOverlayOptions): DevOverlay;
56
+ //# sourceMappingURL=dev-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-overlay.d.ts","sourceRoot":"","sources":["../src/dev-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAAC;AAE7D,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAWD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,gFAAgF;IAChF,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0EAA0E;IAC1E,KAAK,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,gBAAgB,IAAI,IAAI,CAAC;IACzB,mFAAmF;IACnF,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAChD,YAAY,IAAI,IAAI,CAAC;IACrB,gBAAgB,IAAI,IAAI,CAAC;IACzB,4EAA4E;IAC5E,UAAU,CAAC,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAChE,mFAAmF;IACnF,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,iFAAiF;IACjF,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,+DAA+D;IAC/D,gBAAgB,EAAE,WAAW,CAAC;IAC9B,OAAO,IAAI,IAAI,CAAC;CACjB;AAkHD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAkTvE"}