@jsenv/plugin-toolbar 1.4.34 → 1.5.1

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.
@@ -1,5 +1,5 @@
1
1
  const jsenvLogoSvgUrl = new URL("../other/jsenv_logo.svg", import.meta.url);
2
- const injectToolbar = async ({
2
+ export const injectToolbar = async ({
3
3
  toolbarUrl,
4
4
  logLevel,
5
5
  theme,
@@ -262,6 +262,4 @@ const iframeToLoadedPromise = iframe => {
262
262
  };
263
263
  iframe.addEventListener("load", onload, true);
264
264
  });
265
- };
266
-
267
- export { injectToolbar };
265
+ };
@@ -0,0 +1,671 @@
1
+ var l$2,
2
+ u$2;
3
+ l$2 = {
4
+ __e: function (n, l, t, u) {
5
+ for (var i, r, o; l = l.__;) if ((i = l.__c) && !i.__) try {
6
+ if ((r = i.constructor) && null != r.getDerivedStateFromError && (i.setState(r.getDerivedStateFromError(n)), o = i.__d), null != i.componentDidCatch && (i.componentDidCatch(n, u || {}), o = i.__d), o) return i.__E = i;
7
+ } catch (l) {
8
+ n = l;
9
+ }
10
+ throw n;
11
+ }
12
+ }, u$2 = function (n) {
13
+ return null != n && null == n.constructor;
14
+ }, "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout;
15
+
16
+ var t$1,
17
+ r$1,
18
+ u$1,
19
+ i$1,
20
+ o$1 = 0,
21
+ f$1 = [],
22
+ c$1 = l$2,
23
+ e$1 = c$1.__b,
24
+ a$2 = c$1.__r,
25
+ v$2 = c$1.diffed,
26
+ l$1 = c$1.__c,
27
+ m$1 = c$1.unmount,
28
+ s$1 = c$1.__;
29
+ function p$1(n, t) {
30
+ c$1.__h && c$1.__h(r$1, n, o$1 || t), o$1 = 0;
31
+ var u = r$1.__H || (r$1.__H = {
32
+ __: [],
33
+ __h: []
34
+ });
35
+ return n >= u.__.length && u.__.push({}), u.__[n];
36
+ }
37
+ function T(n, r) {
38
+ var u = p$1(t$1++, 7);
39
+ return C(u.__H, r) && (u.__ = n(), u.__H = r, u.__h = n), u.__;
40
+ }
41
+ function j() {
42
+ for (var n; n = f$1.shift();) if (n.__P && n.__H) try {
43
+ n.__H.__h.forEach(z), n.__H.__h.forEach(B), n.__H.__h = [];
44
+ } catch (t) {
45
+ n.__H.__h = [], c$1.__e(t, n.__v);
46
+ }
47
+ }
48
+ c$1.__b = function (n) {
49
+ r$1 = null, e$1 && e$1(n);
50
+ }, c$1.__ = function (n, t) {
51
+ n && t.__k && t.__k.__m && (n.__m = t.__k.__m), s$1 && s$1(n, t);
52
+ }, c$1.__r = function (n) {
53
+ a$2 && a$2(n), t$1 = 0;
54
+ var i = (r$1 = n.__c).__H;
55
+ i && (u$1 === r$1 ? (i.__h = [], r$1.__h = [], i.__.forEach(function (n) {
56
+ n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
57
+ })) : (i.__h.forEach(z), i.__h.forEach(B), i.__h = [], t$1 = 0)), u$1 = r$1;
58
+ }, c$1.diffed = function (n) {
59
+ v$2 && v$2(n);
60
+ var t = n.__c;
61
+ t && t.__H && (t.__H.__h.length && (1 !== f$1.push(t) && i$1 === c$1.requestAnimationFrame || ((i$1 = c$1.requestAnimationFrame) || w$1)(j)), t.__H.__.forEach(function (n) {
62
+ n.u && (n.__H = n.u), n.u = void 0;
63
+ })), u$1 = r$1 = null;
64
+ }, c$1.__c = function (n, t) {
65
+ t.some(function (n) {
66
+ try {
67
+ n.__h.forEach(z), n.__h = n.__h.filter(function (n) {
68
+ return !n.__ || B(n);
69
+ });
70
+ } catch (r) {
71
+ t.some(function (n) {
72
+ n.__h && (n.__h = []);
73
+ }), t = [], c$1.__e(r, n.__v);
74
+ }
75
+ }), l$1 && l$1(n, t);
76
+ }, c$1.unmount = function (n) {
77
+ m$1 && m$1(n);
78
+ var t,
79
+ r = n.__c;
80
+ r && r.__H && (r.__H.__.forEach(function (n) {
81
+ try {
82
+ z(n);
83
+ } catch (n) {
84
+ t = n;
85
+ }
86
+ }), r.__H = void 0, t && c$1.__e(t, r.__v));
87
+ };
88
+ var k$1 = "function" == typeof requestAnimationFrame;
89
+ function w$1(n) {
90
+ var t,
91
+ r = function () {
92
+ clearTimeout(u), k$1 && cancelAnimationFrame(t), setTimeout(n);
93
+ },
94
+ u = setTimeout(r, 100);
95
+ k$1 && (t = requestAnimationFrame(r));
96
+ }
97
+ function z(n) {
98
+ var t = r$1,
99
+ u = n.__c;
100
+ "function" == typeof u && (n.__c = void 0, u()), r$1 = t;
101
+ }
102
+ function B(n) {
103
+ var t = r$1;
104
+ n.__c = n.__(), r$1 = t;
105
+ }
106
+ function C(n, t) {
107
+ return !n || n.length !== t.length || t.some(function (t, r) {
108
+ return t !== n[r];
109
+ });
110
+ }
111
+
112
+ const i = Symbol.for("preact-signals");
113
+ function t() {
114
+ if (r > 1) {
115
+ r--;
116
+ return;
117
+ }
118
+ let i,
119
+ t = false;
120
+ while (void 0 !== s) {
121
+ let o = s;
122
+ s = void 0;
123
+ f++;
124
+ while (void 0 !== o) {
125
+ const n = o.o;
126
+ o.o = void 0;
127
+ o.f &= -3;
128
+ if (!(8 & o.f) && v$1(o)) try {
129
+ o.c();
130
+ } catch (o) {
131
+ if (!t) {
132
+ i = o;
133
+ t = true;
134
+ }
135
+ }
136
+ o = n;
137
+ }
138
+ }
139
+ f = 0;
140
+ r--;
141
+ if (t) throw i;
142
+ }
143
+ function o(i) {
144
+ if (r > 0) return i();
145
+ r++;
146
+ try {
147
+ return i();
148
+ } finally {
149
+ t();
150
+ }
151
+ }
152
+ let n, s;
153
+ let r = 0,
154
+ f = 0,
155
+ e = 0;
156
+ function c(i) {
157
+ if (void 0 === n) return;
158
+ let t = i.n;
159
+ if (void 0 === t || t.t !== n) {
160
+ t = {
161
+ i: 0,
162
+ S: i,
163
+ p: n.s,
164
+ n: void 0,
165
+ t: n,
166
+ e: void 0,
167
+ x: void 0,
168
+ r: t
169
+ };
170
+ if (void 0 !== n.s) n.s.n = t;
171
+ n.s = t;
172
+ i.n = t;
173
+ if (32 & n.f) i.S(t);
174
+ return t;
175
+ } else if (-1 === t.i) {
176
+ t.i = 0;
177
+ if (void 0 !== t.n) {
178
+ t.n.p = t.p;
179
+ if (void 0 !== t.p) t.p.n = t.n;
180
+ t.p = n.s;
181
+ t.n = void 0;
182
+ n.s.n = t;
183
+ n.s = t;
184
+ }
185
+ return t;
186
+ }
187
+ }
188
+ function u(i) {
189
+ this.v = i;
190
+ this.i = 0;
191
+ this.n = void 0;
192
+ this.t = void 0;
193
+ }
194
+ u.prototype.brand = i;
195
+ u.prototype.h = function () {
196
+ return true;
197
+ };
198
+ u.prototype.S = function (i) {
199
+ if (this.t !== i && void 0 === i.e) {
200
+ i.x = this.t;
201
+ if (void 0 !== this.t) this.t.e = i;
202
+ this.t = i;
203
+ }
204
+ };
205
+ u.prototype.U = function (i) {
206
+ if (void 0 !== this.t) {
207
+ const t = i.e,
208
+ o = i.x;
209
+ if (void 0 !== t) {
210
+ t.x = o;
211
+ i.e = void 0;
212
+ }
213
+ if (void 0 !== o) {
214
+ o.e = t;
215
+ i.x = void 0;
216
+ }
217
+ if (i === this.t) this.t = o;
218
+ }
219
+ };
220
+ u.prototype.subscribe = function (i) {
221
+ return E(() => {
222
+ const t = this.value,
223
+ o = n;
224
+ n = void 0;
225
+ try {
226
+ i(t);
227
+ } finally {
228
+ n = o;
229
+ }
230
+ });
231
+ };
232
+ u.prototype.valueOf = function () {
233
+ return this.value;
234
+ };
235
+ u.prototype.toString = function () {
236
+ return this.value + "";
237
+ };
238
+ u.prototype.toJSON = function () {
239
+ return this.value;
240
+ };
241
+ u.prototype.peek = function () {
242
+ const i = n;
243
+ n = void 0;
244
+ try {
245
+ return this.value;
246
+ } finally {
247
+ n = i;
248
+ }
249
+ };
250
+ Object.defineProperty(u.prototype, "value", {
251
+ get() {
252
+ const i = c(this);
253
+ if (void 0 !== i) i.i = this.i;
254
+ return this.v;
255
+ },
256
+ set(i) {
257
+ if (i !== this.v) {
258
+ if (f > 100) throw new Error("Cycle detected");
259
+ this.v = i;
260
+ this.i++;
261
+ e++;
262
+ r++;
263
+ try {
264
+ for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
265
+ } finally {
266
+ t();
267
+ }
268
+ }
269
+ }
270
+ });
271
+ function d$1(i) {
272
+ return new u(i);
273
+ }
274
+ function v$1(i) {
275
+ for (let t = i.s; void 0 !== t; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return true;
276
+ return false;
277
+ }
278
+ function l(i) {
279
+ for (let t = i.s; void 0 !== t; t = t.n) {
280
+ const o = t.S.n;
281
+ if (void 0 !== o) t.r = o;
282
+ t.S.n = t;
283
+ t.i = -1;
284
+ if (void 0 === t.n) {
285
+ i.s = t;
286
+ break;
287
+ }
288
+ }
289
+ }
290
+ function y(i) {
291
+ let t,
292
+ o = i.s;
293
+ while (void 0 !== o) {
294
+ const i = o.p;
295
+ if (-1 === o.i) {
296
+ o.S.U(o);
297
+ if (void 0 !== i) i.n = o.n;
298
+ if (void 0 !== o.n) o.n.p = i;
299
+ } else t = o;
300
+ o.S.n = o.r;
301
+ if (void 0 !== o.r) o.r = void 0;
302
+ o = i;
303
+ }
304
+ i.s = t;
305
+ }
306
+ function a$1(i) {
307
+ u.call(this, void 0);
308
+ this.x = i;
309
+ this.s = void 0;
310
+ this.g = e - 1;
311
+ this.f = 4;
312
+ }
313
+ (a$1.prototype = new u()).h = function () {
314
+ this.f &= -3;
315
+ if (1 & this.f) return false;
316
+ if (32 == (36 & this.f)) return true;
317
+ this.f &= -5;
318
+ if (this.g === e) return true;
319
+ this.g = e;
320
+ this.f |= 1;
321
+ if (this.i > 0 && !v$1(this)) {
322
+ this.f &= -2;
323
+ return true;
324
+ }
325
+ const i = n;
326
+ try {
327
+ l(this);
328
+ n = this;
329
+ const i = this.x();
330
+ if (16 & this.f || this.v !== i || 0 === this.i) {
331
+ this.v = i;
332
+ this.f &= -17;
333
+ this.i++;
334
+ }
335
+ } catch (i) {
336
+ this.v = i;
337
+ this.f |= 16;
338
+ this.i++;
339
+ }
340
+ n = i;
341
+ y(this);
342
+ this.f &= -2;
343
+ return true;
344
+ };
345
+ a$1.prototype.S = function (i) {
346
+ if (void 0 === this.t) {
347
+ this.f |= 36;
348
+ for (let i = this.s; void 0 !== i; i = i.n) i.S.S(i);
349
+ }
350
+ u.prototype.S.call(this, i);
351
+ };
352
+ a$1.prototype.U = function (i) {
353
+ if (void 0 !== this.t) {
354
+ u.prototype.U.call(this, i);
355
+ if (void 0 === this.t) {
356
+ this.f &= -33;
357
+ for (let i = this.s; void 0 !== i; i = i.n) i.S.U(i);
358
+ }
359
+ }
360
+ };
361
+ a$1.prototype.N = function () {
362
+ if (!(2 & this.f)) {
363
+ this.f |= 6;
364
+ for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
365
+ }
366
+ };
367
+ Object.defineProperty(a$1.prototype, "value", {
368
+ get() {
369
+ if (1 & this.f) throw new Error("Cycle detected");
370
+ const i = c(this);
371
+ this.h();
372
+ if (void 0 !== i) i.i = this.i;
373
+ if (16 & this.f) throw this.v;
374
+ return this.v;
375
+ }
376
+ });
377
+ function w(i) {
378
+ return new a$1(i);
379
+ }
380
+ function _$1(i) {
381
+ const o = i.u;
382
+ i.u = void 0;
383
+ if ("function" == typeof o) {
384
+ r++;
385
+ const s = n;
386
+ n = void 0;
387
+ try {
388
+ o();
389
+ } catch (t) {
390
+ i.f &= -2;
391
+ i.f |= 8;
392
+ g$1(i);
393
+ throw t;
394
+ } finally {
395
+ n = s;
396
+ t();
397
+ }
398
+ }
399
+ }
400
+ function g$1(i) {
401
+ for (let t = i.s; void 0 !== t; t = t.n) t.S.U(t);
402
+ i.x = void 0;
403
+ i.s = void 0;
404
+ _$1(i);
405
+ }
406
+ function p(i) {
407
+ if (n !== this) throw new Error("Out-of-order effect");
408
+ y(this);
409
+ n = i;
410
+ this.f &= -2;
411
+ if (8 & this.f) g$1(this);
412
+ t();
413
+ }
414
+ function b$1(i) {
415
+ this.x = i;
416
+ this.u = void 0;
417
+ this.s = void 0;
418
+ this.o = void 0;
419
+ this.f = 32;
420
+ }
421
+ b$1.prototype.c = function () {
422
+ const i = this.S();
423
+ try {
424
+ if (8 & this.f) return;
425
+ if (void 0 === this.x) return;
426
+ const t = this.x();
427
+ if ("function" == typeof t) this.u = t;
428
+ } finally {
429
+ i();
430
+ }
431
+ };
432
+ b$1.prototype.S = function () {
433
+ if (1 & this.f) throw new Error("Cycle detected");
434
+ this.f |= 1;
435
+ this.f &= -9;
436
+ _$1(this);
437
+ l(this);
438
+ r++;
439
+ const i = n;
440
+ n = this;
441
+ return p.bind(this, i);
442
+ };
443
+ b$1.prototype.N = function () {
444
+ if (!(2 & this.f)) {
445
+ this.f |= 2;
446
+ this.o = s;
447
+ s = this;
448
+ }
449
+ };
450
+ b$1.prototype.d = function () {
451
+ this.f |= 8;
452
+ if (!(1 & this.f)) g$1(this);
453
+ };
454
+ function E(i) {
455
+ const t = new b$1(i);
456
+ try {
457
+ t.c();
458
+ } catch (i) {
459
+ t.d();
460
+ throw i;
461
+ }
462
+ return t.d.bind(t);
463
+ }
464
+
465
+ let a,
466
+ d,
467
+ _ = [];
468
+ E(function () {
469
+ a = this.N;
470
+ })();
471
+ function m(t, e) {
472
+ l$2[t] = e.bind(null, l$2[t] || (() => {}));
473
+ }
474
+ function v(t) {
475
+ if (d) d();
476
+ d = t && t.S();
477
+ }
478
+ function g({
479
+ data: t
480
+ }) {
481
+ const i = useSignal(t);
482
+ i.value = t;
483
+ const [o, f] = T(() => {
484
+ let t = this,
485
+ n = this.__v;
486
+ while (n = n.__) if (n.__c) {
487
+ n.__c.__$f |= 4;
488
+ break;
489
+ }
490
+ const o = w(() => {
491
+ let t = i.value.value;
492
+ return 0 === t ? 0 : true === t ? "" : t || "";
493
+ }),
494
+ f = w(() => !u$2(o.value)),
495
+ s = E(function () {
496
+ this.N = A;
497
+ if (f.value) {
498
+ const i = o.value;
499
+ if (t.base && 3 === t.base.nodeType) t.base.data = i;
500
+ }
501
+ }),
502
+ c = this.__$u.d;
503
+ this.__$u.d = function () {
504
+ s();
505
+ c.call(this);
506
+ };
507
+ return [f, o];
508
+ }, []);
509
+ return o.value ? f.peek() : f.value;
510
+ }
511
+ g.displayName = "_st";
512
+ Object.defineProperties(u.prototype, {
513
+ constructor: {
514
+ configurable: true,
515
+ value: void 0
516
+ },
517
+ type: {
518
+ configurable: true,
519
+ value: g
520
+ },
521
+ props: {
522
+ configurable: true,
523
+ get() {
524
+ return {
525
+ data: this
526
+ };
527
+ }
528
+ },
529
+ __b: {
530
+ configurable: true,
531
+ value: 1
532
+ }
533
+ });
534
+ m("__b", (t, i) => {
535
+ if ("string" == typeof i.type) {
536
+ let t,
537
+ e = i.props;
538
+ for (let n in e) {
539
+ if ("children" === n) continue;
540
+ let o = e[n];
541
+ if (o instanceof u) {
542
+ if (!t) i.__np = t = {};
543
+ t[n] = o;
544
+ e[n] = o.peek();
545
+ }
546
+ }
547
+ }
548
+ t(i);
549
+ });
550
+ m("__r", (t, i) => {
551
+ v();
552
+ let e,
553
+ n = i.__c;
554
+ if (n) {
555
+ n.__$f &= -2;
556
+ e = n.__$u;
557
+ if (void 0 === e) n.__$u = e = function (t) {
558
+ let i;
559
+ E(function () {
560
+ i = this;
561
+ });
562
+ i.c = () => {
563
+ n.__$f |= 1;
564
+ n.setState({});
565
+ };
566
+ return i;
567
+ }();
568
+ }
569
+ v(e);
570
+ t(i);
571
+ });
572
+ m("__e", (t, i, e, n) => {
573
+ v();
574
+ t(i, e, n);
575
+ });
576
+ m("diffed", (t, i) => {
577
+ v();
578
+ let e;
579
+ if ("string" == typeof i.type && (e = i.__e)) {
580
+ let t = i.__np,
581
+ n = i.props;
582
+ if (t) {
583
+ let i = e.U;
584
+ if (i) for (let e in i) {
585
+ let n = i[e];
586
+ if (void 0 !== n && !(e in t)) {
587
+ n.d();
588
+ i[e] = void 0;
589
+ }
590
+ } else {
591
+ i = {};
592
+ e.U = i;
593
+ }
594
+ for (let o in t) {
595
+ let f = i[o],
596
+ r = t[o];
597
+ if (void 0 === f) {
598
+ f = b(e, o, r, n);
599
+ i[o] = f;
600
+ } else f.o(r, n);
601
+ }
602
+ }
603
+ }
604
+ t(i);
605
+ });
606
+ function b(t, i, e, n) {
607
+ const o = i in t && void 0 === t.ownerSVGElement,
608
+ f = d$1(e);
609
+ return {
610
+ o: (t, i) => {
611
+ f.value = t;
612
+ n = i;
613
+ },
614
+ d: E(function () {
615
+ this.N = A;
616
+ const e = f.value.value;
617
+ if (n[i] !== e) {
618
+ n[i] = e;
619
+ if (o) t[i] = e;else if (e) t.setAttribute(i, e);else t.removeAttribute(i);
620
+ }
621
+ })
622
+ };
623
+ }
624
+ m("unmount", (t, i) => {
625
+ if ("string" == typeof i.type) {
626
+ let t = i.__e;
627
+ if (t) {
628
+ const i = t.U;
629
+ if (i) {
630
+ t.U = void 0;
631
+ for (let t in i) {
632
+ let e = i[t];
633
+ if (e) e.d();
634
+ }
635
+ }
636
+ }
637
+ } else {
638
+ let t = i.__c;
639
+ if (t) {
640
+ const i = t.__$u;
641
+ if (i) {
642
+ t.__$u = void 0;
643
+ i.d();
644
+ }
645
+ }
646
+ }
647
+ t(i);
648
+ });
649
+ m("__h", (t, i, e, n) => {
650
+ if (n < 3 || 9 === n) i.__$f |= 2;
651
+ t(i, e, n);
652
+ });
653
+ function useSignal(t) {
654
+ return T(() => d$1(t), []);
655
+ }
656
+ const k = t => {
657
+ queueMicrotask(() => {
658
+ queueMicrotask(t);
659
+ });
660
+ };
661
+ function x() {
662
+ o(() => {
663
+ let t;
664
+ while (t = _.shift()) a.call(t);
665
+ });
666
+ }
667
+ function A() {
668
+ if (1 === _.push(this)) (l$2.requestAnimationFrame || k)(x);
669
+ }
670
+
671
+ export { E, d$1 as d, w };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-toolbar",
3
- "version": "1.4.34",
3
+ "version": "1.5.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "/src/"
27
27
  ],
28
28
  "dependencies": {
29
- "@jsenv/ast": "6.5.2"
29
+ "@jsenv/ast": "6.6.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@preact/signals": "2.0.1"
@@ -8,15 +8,10 @@ export const jsenvPluginToolbar = ({
8
8
  animationsEnabled = true,
9
9
  notificationsEnabled = true,
10
10
  } = {}) => {
11
- const toolbarInjectorClientFileUrl = new URL(
11
+ const toolbarInjectorClientFileUrl = import.meta.resolve(
12
12
  "./client/toolbar_injector.js",
13
- import.meta.url,
14
- ).href;
15
- const toolbarHtmlClientFileUrl = new URL(
16
- "./client/toolbar.html",
17
- import.meta.url,
18
- ).href;
19
-
13
+ );
14
+ const toolbarHtmlClientFileUrl = import.meta.resolve("./client/toolbar.html");
20
15
  return {
21
16
  name: "jsenv:toolbar",
22
17
  appliesDuring: "dev",