@jsenv/plugin-toolbar 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/toolbar_core.js +146 -135
- package/package.json +3 -3
package/dist/js/toolbar_core.js
CHANGED
|
@@ -115,12 +115,12 @@ function t() {
|
|
|
115
115
|
}
|
|
116
116
|
let i,
|
|
117
117
|
t = !1;
|
|
118
|
-
while (void 0 !==
|
|
119
|
-
let s =
|
|
120
|
-
|
|
118
|
+
while (void 0 !== n) {
|
|
119
|
+
let s = n;
|
|
120
|
+
n = void 0;
|
|
121
121
|
f++;
|
|
122
122
|
while (void 0 !== s) {
|
|
123
|
-
const
|
|
123
|
+
const o = s.o;
|
|
124
124
|
s.o = void 0;
|
|
125
125
|
s.f &= -3;
|
|
126
126
|
if (!(8 & s.f) && v(s)) try {
|
|
@@ -131,101 +131,104 @@ function t() {
|
|
|
131
131
|
t = !0;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
s =
|
|
134
|
+
s = o;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
f = 0;
|
|
138
138
|
h$1--;
|
|
139
139
|
if (t) throw i;
|
|
140
140
|
}
|
|
141
|
-
let
|
|
142
|
-
|
|
141
|
+
let o,
|
|
142
|
+
n,
|
|
143
143
|
h$1 = 0,
|
|
144
144
|
f = 0,
|
|
145
145
|
r = 0;
|
|
146
146
|
function e(i) {
|
|
147
|
-
if (void 0 ===
|
|
147
|
+
if (void 0 === o) return;
|
|
148
148
|
let t = i.n;
|
|
149
|
-
if (void 0 === t || t.t !==
|
|
149
|
+
if (void 0 === t || t.t !== o) {
|
|
150
150
|
t = {
|
|
151
151
|
i: 0,
|
|
152
152
|
S: i,
|
|
153
|
-
p:
|
|
154
|
-
n:
|
|
155
|
-
t:
|
|
153
|
+
p: o.s,
|
|
154
|
+
n: void 0,
|
|
155
|
+
t: o,
|
|
156
156
|
e: void 0,
|
|
157
157
|
x: void 0,
|
|
158
158
|
r: t
|
|
159
159
|
};
|
|
160
|
-
|
|
160
|
+
if (void 0 !== o.s) o.s.n = t;
|
|
161
|
+
o.s = t;
|
|
161
162
|
i.n = t;
|
|
162
|
-
if (32 &
|
|
163
|
+
if (32 & o.f) i.S(t);
|
|
163
164
|
return t;
|
|
164
165
|
} else if (-1 === t.i) {
|
|
165
166
|
t.i = 0;
|
|
166
|
-
if (void 0 !== t.
|
|
167
|
-
t.p
|
|
168
|
-
if (void 0 !== t.
|
|
169
|
-
t.p =
|
|
170
|
-
t.n =
|
|
171
|
-
|
|
172
|
-
|
|
167
|
+
if (void 0 !== t.n) {
|
|
168
|
+
t.n.p = t.p;
|
|
169
|
+
if (void 0 !== t.p) t.p.n = t.n;
|
|
170
|
+
t.p = o.s;
|
|
171
|
+
t.n = void 0;
|
|
172
|
+
o.s.n = t;
|
|
173
|
+
o.s = t;
|
|
173
174
|
}
|
|
174
175
|
return t;
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
|
-
function
|
|
178
|
+
function c$1(i) {
|
|
178
179
|
this.v = i;
|
|
179
180
|
this.i = 0;
|
|
180
181
|
this.n = void 0;
|
|
181
182
|
this.t = void 0;
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
c$1.prototype.h = function () {
|
|
184
185
|
return !0;
|
|
185
186
|
};
|
|
186
|
-
|
|
187
|
+
c$1.prototype.S = function (i) {
|
|
187
188
|
if (this.t !== i && void 0 === i.e) {
|
|
188
189
|
i.x = this.t;
|
|
189
190
|
if (void 0 !== this.t) this.t.e = i;
|
|
190
191
|
this.t = i;
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
t
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
s
|
|
202
|
-
|
|
194
|
+
c$1.prototype.U = function (i) {
|
|
195
|
+
if (void 0 !== this.t) {
|
|
196
|
+
const t = i.e,
|
|
197
|
+
s = i.x;
|
|
198
|
+
if (void 0 !== t) {
|
|
199
|
+
t.x = s;
|
|
200
|
+
i.e = void 0;
|
|
201
|
+
}
|
|
202
|
+
if (void 0 !== s) {
|
|
203
|
+
s.e = t;
|
|
204
|
+
i.x = void 0;
|
|
205
|
+
}
|
|
206
|
+
if (i === this.t) this.t = s;
|
|
203
207
|
}
|
|
204
|
-
if (i === this.t) this.t = s;
|
|
205
208
|
};
|
|
206
|
-
|
|
209
|
+
c$1.prototype.subscribe = function (i) {
|
|
207
210
|
const t = this;
|
|
208
|
-
return
|
|
211
|
+
return p$1(function () {
|
|
209
212
|
const s = t.value,
|
|
210
|
-
|
|
213
|
+
o = 32 & this.f;
|
|
211
214
|
this.f &= -33;
|
|
212
215
|
try {
|
|
213
216
|
i(s);
|
|
214
217
|
} finally {
|
|
215
|
-
this.f |=
|
|
218
|
+
this.f |= o;
|
|
216
219
|
}
|
|
217
220
|
});
|
|
218
221
|
};
|
|
219
|
-
|
|
222
|
+
c$1.prototype.valueOf = function () {
|
|
220
223
|
return this.value;
|
|
221
224
|
};
|
|
222
|
-
|
|
225
|
+
c$1.prototype.toString = function () {
|
|
223
226
|
return this.value + "";
|
|
224
227
|
};
|
|
225
|
-
|
|
228
|
+
c$1.prototype.peek = function () {
|
|
226
229
|
return this.v;
|
|
227
230
|
};
|
|
228
|
-
Object.defineProperty(
|
|
231
|
+
Object.defineProperty(c$1.prototype, "value", {
|
|
229
232
|
get() {
|
|
230
233
|
const i = e(this);
|
|
231
234
|
if (void 0 !== i) i.i = this.i;
|
|
@@ -246,8 +249,8 @@ Object.defineProperty(u.prototype, "value", {
|
|
|
246
249
|
}
|
|
247
250
|
}
|
|
248
251
|
});
|
|
249
|
-
function
|
|
250
|
-
return new
|
|
252
|
+
function u(i) {
|
|
253
|
+
return new c$1(i);
|
|
251
254
|
}
|
|
252
255
|
function v(i) {
|
|
253
256
|
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 !0;
|
|
@@ -255,40 +258,40 @@ function v(i) {
|
|
|
255
258
|
}
|
|
256
259
|
function d$1(i) {
|
|
257
260
|
for (let t = i.s; void 0 !== t; t = t.n) {
|
|
258
|
-
const
|
|
259
|
-
if (void 0 !==
|
|
261
|
+
const s = t.S.n;
|
|
262
|
+
if (void 0 !== s) t.r = s;
|
|
260
263
|
t.S.n = t;
|
|
261
264
|
t.i = -1;
|
|
265
|
+
if (void 0 === t.n) {
|
|
266
|
+
i.s = t;
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
262
269
|
}
|
|
263
270
|
}
|
|
264
271
|
function l(i) {
|
|
265
272
|
let t,
|
|
266
273
|
s = i.s;
|
|
267
274
|
while (void 0 !== s) {
|
|
268
|
-
const i = s.
|
|
275
|
+
const i = s.p;
|
|
269
276
|
if (-1 === s.i) {
|
|
270
277
|
s.S.U(s);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
s.p = void 0;
|
|
275
|
-
s.n = t;
|
|
276
|
-
t = s;
|
|
277
|
-
}
|
|
278
|
+
if (void 0 !== i) i.n = s.n;
|
|
279
|
+
if (void 0 !== s.n) s.n.p = i;
|
|
280
|
+
} else t = s;
|
|
278
281
|
s.S.n = s.r;
|
|
279
282
|
if (void 0 !== s.r) s.r = void 0;
|
|
280
283
|
s = i;
|
|
281
284
|
}
|
|
282
285
|
i.s = t;
|
|
283
286
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
287
|
+
function a$1(i) {
|
|
288
|
+
c$1.call(this, void 0);
|
|
286
289
|
this.x = i;
|
|
287
290
|
this.s = void 0;
|
|
288
291
|
this.g = r - 1;
|
|
289
292
|
this.f = 4;
|
|
290
293
|
}
|
|
291
|
-
(
|
|
294
|
+
(a$1.prototype = new c$1()).h = function () {
|
|
292
295
|
this.f &= -3;
|
|
293
296
|
if (1 & this.f) return !1;
|
|
294
297
|
if (32 == (36 & this.f)) return !0;
|
|
@@ -300,10 +303,10 @@ function w(i) {
|
|
|
300
303
|
this.f &= -2;
|
|
301
304
|
return !0;
|
|
302
305
|
}
|
|
303
|
-
const i =
|
|
306
|
+
const i = o;
|
|
304
307
|
try {
|
|
305
308
|
d$1(this);
|
|
306
|
-
|
|
309
|
+
o = this;
|
|
307
310
|
const i = this.x();
|
|
308
311
|
if (16 & this.f || this.v !== i || 0 === this.i) {
|
|
309
312
|
this.v = i;
|
|
@@ -315,37 +318,39 @@ function w(i) {
|
|
|
315
318
|
this.f |= 16;
|
|
316
319
|
this.i++;
|
|
317
320
|
}
|
|
318
|
-
|
|
321
|
+
o = i;
|
|
319
322
|
l(this);
|
|
320
323
|
this.f &= -2;
|
|
321
324
|
return !0;
|
|
322
325
|
};
|
|
323
|
-
|
|
326
|
+
a$1.prototype.S = function (i) {
|
|
324
327
|
if (void 0 === this.t) {
|
|
325
328
|
this.f |= 36;
|
|
326
329
|
for (let i = this.s; void 0 !== i; i = i.n) i.S.S(i);
|
|
327
330
|
}
|
|
328
|
-
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
this.
|
|
334
|
-
|
|
331
|
+
c$1.prototype.S.call(this, i);
|
|
332
|
+
};
|
|
333
|
+
a$1.prototype.U = function (i) {
|
|
334
|
+
if (void 0 !== this.t) {
|
|
335
|
+
c$1.prototype.U.call(this, i);
|
|
336
|
+
if (void 0 === this.t) {
|
|
337
|
+
this.f &= -33;
|
|
338
|
+
for (let i = this.s; void 0 !== i; i = i.n) i.S.U(i);
|
|
339
|
+
}
|
|
335
340
|
}
|
|
336
341
|
};
|
|
337
|
-
|
|
342
|
+
a$1.prototype.N = function () {
|
|
338
343
|
if (!(2 & this.f)) {
|
|
339
344
|
this.f |= 6;
|
|
340
345
|
for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
|
|
341
346
|
}
|
|
342
347
|
};
|
|
343
|
-
|
|
348
|
+
a$1.prototype.peek = function () {
|
|
344
349
|
if (!this.h()) i();
|
|
345
350
|
if (16 & this.f) throw this.v;
|
|
346
351
|
return this.v;
|
|
347
352
|
};
|
|
348
|
-
Object.defineProperty(
|
|
353
|
+
Object.defineProperty(a$1.prototype, "value", {
|
|
349
354
|
get() {
|
|
350
355
|
if (1 & this.f) i();
|
|
351
356
|
const t = e(this);
|
|
@@ -355,16 +360,16 @@ Object.defineProperty(w.prototype, "value", {
|
|
|
355
360
|
return this.v;
|
|
356
361
|
}
|
|
357
362
|
});
|
|
358
|
-
function
|
|
359
|
-
return new
|
|
363
|
+
function w(i) {
|
|
364
|
+
return new a$1(i);
|
|
360
365
|
}
|
|
361
366
|
function y(i) {
|
|
362
367
|
const s = i.u;
|
|
363
368
|
i.u = void 0;
|
|
364
369
|
if ("function" == typeof s) {
|
|
365
370
|
h$1++;
|
|
366
|
-
const
|
|
367
|
-
|
|
371
|
+
const n = o;
|
|
372
|
+
o = void 0;
|
|
368
373
|
try {
|
|
369
374
|
s();
|
|
370
375
|
} catch (t) {
|
|
@@ -373,7 +378,7 @@ function y(i) {
|
|
|
373
378
|
_(i);
|
|
374
379
|
throw t;
|
|
375
380
|
} finally {
|
|
376
|
-
|
|
381
|
+
o = n;
|
|
377
382
|
t();
|
|
378
383
|
}
|
|
379
384
|
}
|
|
@@ -385,21 +390,21 @@ function _(i) {
|
|
|
385
390
|
y(i);
|
|
386
391
|
}
|
|
387
392
|
function g(i) {
|
|
388
|
-
if (
|
|
393
|
+
if (o !== this) throw new Error("Out-of-order effect");
|
|
389
394
|
l(this);
|
|
390
|
-
|
|
395
|
+
o = i;
|
|
391
396
|
this.f &= -2;
|
|
392
397
|
if (8 & this.f) _(this);
|
|
393
398
|
t();
|
|
394
399
|
}
|
|
395
|
-
function
|
|
400
|
+
function b(i) {
|
|
396
401
|
this.x = i;
|
|
397
402
|
this.u = void 0;
|
|
398
403
|
this.s = void 0;
|
|
399
404
|
this.o = void 0;
|
|
400
405
|
this.f = 32;
|
|
401
406
|
}
|
|
402
|
-
|
|
407
|
+
b.prototype.c = function () {
|
|
403
408
|
const i = this.S();
|
|
404
409
|
try {
|
|
405
410
|
if (!(8 & this.f) && void 0 !== this.x) this.u = this.x();
|
|
@@ -407,31 +412,36 @@ p$1.prototype.c = function () {
|
|
|
407
412
|
i();
|
|
408
413
|
}
|
|
409
414
|
};
|
|
410
|
-
|
|
415
|
+
b.prototype.S = function () {
|
|
411
416
|
if (1 & this.f) i();
|
|
412
417
|
this.f |= 1;
|
|
413
418
|
this.f &= -9;
|
|
414
419
|
y(this);
|
|
415
420
|
d$1(this);
|
|
416
421
|
h$1++;
|
|
417
|
-
const t =
|
|
418
|
-
|
|
422
|
+
const t = o;
|
|
423
|
+
o = this;
|
|
419
424
|
return g.bind(this, t);
|
|
420
425
|
};
|
|
421
|
-
|
|
426
|
+
b.prototype.N = function () {
|
|
422
427
|
if (!(2 & this.f)) {
|
|
423
428
|
this.f |= 2;
|
|
424
|
-
this.o =
|
|
425
|
-
|
|
429
|
+
this.o = n;
|
|
430
|
+
n = this;
|
|
426
431
|
}
|
|
427
432
|
};
|
|
428
|
-
|
|
433
|
+
b.prototype.d = function () {
|
|
429
434
|
this.f |= 8;
|
|
430
435
|
if (!(1 & this.f)) _(this);
|
|
431
436
|
};
|
|
432
|
-
function
|
|
433
|
-
const t = new
|
|
434
|
-
|
|
437
|
+
function p$1(i) {
|
|
438
|
+
const t = new b(i);
|
|
439
|
+
try {
|
|
440
|
+
t.c();
|
|
441
|
+
} catch (i) {
|
|
442
|
+
t.d();
|
|
443
|
+
throw i;
|
|
444
|
+
}
|
|
435
445
|
return t.d.bind(t);
|
|
436
446
|
}
|
|
437
447
|
|
|
@@ -457,7 +467,7 @@ function p({
|
|
|
457
467
|
this.__$u.c = () => {
|
|
458
468
|
this.base.data = n.peek();
|
|
459
469
|
};
|
|
460
|
-
return
|
|
470
|
+
return w(() => {
|
|
461
471
|
let t = i.value.value;
|
|
462
472
|
return 0 === t ? 0 : !0 === t ? "" : t || "";
|
|
463
473
|
});
|
|
@@ -465,9 +475,10 @@ function p({
|
|
|
465
475
|
return n.value;
|
|
466
476
|
}
|
|
467
477
|
p.displayName = "_st";
|
|
468
|
-
Object.defineProperties(
|
|
478
|
+
Object.defineProperties(c$1.prototype, {
|
|
469
479
|
constructor: {
|
|
470
|
-
configurable: !0
|
|
480
|
+
configurable: !0,
|
|
481
|
+
value: void 0
|
|
471
482
|
},
|
|
472
483
|
type: {
|
|
473
484
|
configurable: !0,
|
|
@@ -493,7 +504,7 @@ c("__b", (t, i) => {
|
|
|
493
504
|
for (let n in e) {
|
|
494
505
|
if ("children" === n) continue;
|
|
495
506
|
let o = e[n];
|
|
496
|
-
if (o instanceof
|
|
507
|
+
if (o instanceof c$1) {
|
|
497
508
|
if (!t) i.__np = t = {};
|
|
498
509
|
t[n] = o;
|
|
499
510
|
e[n] = o.peek();
|
|
@@ -511,7 +522,7 @@ c("__r", (t, i) => {
|
|
|
511
522
|
e = n.__$u;
|
|
512
523
|
if (void 0 === e) n.__$u = e = function (t) {
|
|
513
524
|
let i;
|
|
514
|
-
|
|
525
|
+
p$1(function () {
|
|
515
526
|
i = this;
|
|
516
527
|
});
|
|
517
528
|
i.c = () => {
|
|
@@ -560,13 +571,13 @@ c("diffed", (t, i) => {
|
|
|
560
571
|
});
|
|
561
572
|
function h(t, i, e, n) {
|
|
562
573
|
const o = i in t && void 0 === t.ownerSVGElement,
|
|
563
|
-
r =
|
|
574
|
+
r = u(e);
|
|
564
575
|
return {
|
|
565
576
|
o: (t, i) => {
|
|
566
577
|
r.value = t;
|
|
567
578
|
n = i;
|
|
568
579
|
},
|
|
569
|
-
d:
|
|
580
|
+
d: p$1(() => {
|
|
570
581
|
const e = r.value.value;
|
|
571
582
|
if (n[i] !== e) {
|
|
572
583
|
n[i] = e;
|
|
@@ -605,7 +616,7 @@ c("__h", (t, i, e, n) => {
|
|
|
605
616
|
t(i, e, n);
|
|
606
617
|
});
|
|
607
618
|
function useSignal(t) {
|
|
608
|
-
return F(() =>
|
|
619
|
+
return F(() => u(t), []);
|
|
609
620
|
}
|
|
610
621
|
|
|
611
622
|
const paramsFromParentWindow = {};
|
|
@@ -617,9 +628,9 @@ const parentWindowReloader = window.parent.__reloader__;
|
|
|
617
628
|
|
|
618
629
|
const stateFromLocalStorage = localStorage.hasOwnProperty("jsenv_toolbar") ? JSON.parse(localStorage.getItem("jsenv_toolbar")) : {};
|
|
619
630
|
|
|
620
|
-
const animationsEnabledSignal =
|
|
631
|
+
const animationsEnabledSignal = u(typeof stateFromLocalStorage.animationsEnabled === "boolean" ? stateFromLocalStorage.animationsEnabled : typeof paramsFromParentWindow.animationsEnabled === "boolean" ? paramsFromParentWindow.animationsEnabled : false);
|
|
621
632
|
|
|
622
|
-
|
|
633
|
+
p$1(() => {
|
|
623
634
|
const animationsEnabled = animationsEnabledSignal.value;
|
|
624
635
|
if (animationsEnabled) {
|
|
625
636
|
document.documentElement.removeAttribute("data-animation-disabled");
|
|
@@ -628,11 +639,11 @@ b(() => {
|
|
|
628
639
|
}
|
|
629
640
|
});
|
|
630
641
|
|
|
631
|
-
const executionTooltipOpenedSignal =
|
|
632
|
-
const executionSignal =
|
|
642
|
+
const executionTooltipOpenedSignal = u(false);
|
|
643
|
+
const executionSignal = u({
|
|
633
644
|
status: "running"
|
|
634
645
|
});
|
|
635
|
-
const previousExecutionSignal =
|
|
646
|
+
const previousExecutionSignal = u(sessionStorage.hasOwnProperty(window.location.href) ? JSON.parse(sessionStorage.getItem(window.location.href)) : null);
|
|
636
647
|
window.parent.__supervisor__.getDocumentExecutionResult().then(({
|
|
637
648
|
status,
|
|
638
649
|
startTime,
|
|
@@ -647,8 +658,8 @@ window.parent.__supervisor__.getDocumentExecutionResult().then(({
|
|
|
647
658
|
|
|
648
659
|
const notificationAPIDetected = typeof window.Notification === "function";
|
|
649
660
|
|
|
650
|
-
const notificationsEnabledSignal =
|
|
651
|
-
const notificationPermissionSignal =
|
|
661
|
+
const notificationsEnabledSignal = u(typeof stateFromLocalStorage.notificationsEnabled === "boolean" ? stateFromLocalStorage.notificationsEnabled : typeof paramsFromParentWindow.notificationsEnabled === "boolean" ? paramsFromParentWindow.notificationsEnabled : false);
|
|
662
|
+
const notificationPermissionSignal = u(Notification.permission);
|
|
652
663
|
|
|
653
664
|
const enableNotifications = () => {
|
|
654
665
|
notificationsEnabledSignal.value = true;
|
|
@@ -754,13 +765,13 @@ const getFaviconHref = () => {
|
|
|
754
765
|
return link ? link.href : undefined;
|
|
755
766
|
};
|
|
756
767
|
|
|
757
|
-
|
|
768
|
+
p$1(() => {
|
|
758
769
|
const execution = executionSignal.value;
|
|
759
770
|
if (execution) {
|
|
760
771
|
sessionStorage.setItem(window.location.href, JSON.stringify(execution));
|
|
761
772
|
}
|
|
762
773
|
});
|
|
763
|
-
|
|
774
|
+
p$1(() => {
|
|
764
775
|
const execution = executionSignal.value;
|
|
765
776
|
const previousExecution = previousExecutionSignal.value;
|
|
766
777
|
if (execution) {
|
|
@@ -768,7 +779,7 @@ b(() => {
|
|
|
768
779
|
}
|
|
769
780
|
});
|
|
770
781
|
|
|
771
|
-
|
|
782
|
+
p$1(() => {
|
|
772
783
|
const notificationsEnabled = notificationsEnabledSignal.value;
|
|
773
784
|
if (!notificationsEnabled) {
|
|
774
785
|
closeAllNotifications();
|
|
@@ -814,8 +825,8 @@ const disableAutoreload = () => {
|
|
|
814
825
|
parentWindowReloader.autoreload.disable();
|
|
815
826
|
};
|
|
816
827
|
|
|
817
|
-
const serverTooltipOpenedSignal =
|
|
818
|
-
const serverConnectionSignal =
|
|
828
|
+
const serverTooltipOpenedSignal = u(false);
|
|
829
|
+
const serverConnectionSignal = u("default");
|
|
819
830
|
const serverEvents$1 = window.__server_events__;
|
|
820
831
|
if (serverEvents$1) {
|
|
821
832
|
serverEvents$1.readyState.onchange = () => {
|
|
@@ -836,7 +847,7 @@ const closeAllTooltips = () => {
|
|
|
836
847
|
closeServerTooltip();
|
|
837
848
|
};
|
|
838
849
|
|
|
839
|
-
const openedSignal =
|
|
850
|
+
const openedSignal = u(typeof stateFromLocalStorage.opened === "boolean" ? stateFromLocalStorage.opened : typeof paramsFromParentWindow.opened === "boolean" ? paramsFromParentWindow.opened : false);
|
|
840
851
|
|
|
841
852
|
const getToolbarIframe = () => {
|
|
842
853
|
const iframes = Array.from(window.parent.document.querySelectorAll("iframe"));
|
|
@@ -928,7 +939,7 @@ const startJavaScriptAnimation = ({
|
|
|
928
939
|
};
|
|
929
940
|
|
|
930
941
|
const initToolbarOpening = () => {
|
|
931
|
-
|
|
942
|
+
p$1(() => {
|
|
932
943
|
const opened = openedSignal.value;
|
|
933
944
|
if (opened) {
|
|
934
945
|
showToolbar();
|
|
@@ -1171,7 +1182,7 @@ const closeOverflowMenu = () => {
|
|
|
1171
1182
|
document.querySelector("#menu_overflow").removeAttribute("data-animate");
|
|
1172
1183
|
};
|
|
1173
1184
|
|
|
1174
|
-
const settingsOpenedSignal =
|
|
1185
|
+
const settingsOpenedSignal = u(false);
|
|
1175
1186
|
|
|
1176
1187
|
const openSettings = () => {
|
|
1177
1188
|
settingsOpenedSignal.value = true;
|
|
@@ -1180,7 +1191,7 @@ const closeSettings = () => {
|
|
|
1180
1191
|
settingsOpenedSignal.value = false;
|
|
1181
1192
|
};
|
|
1182
1193
|
|
|
1183
|
-
const changesTooltipOpenedSignal =
|
|
1194
|
+
const changesTooltipOpenedSignal = u(false);
|
|
1184
1195
|
|
|
1185
1196
|
const renderToolbarOverlay = () => {
|
|
1186
1197
|
const toolbarOverlay = document.querySelector("#toolbar_overlay");
|
|
@@ -1188,7 +1199,7 @@ const renderToolbarOverlay = () => {
|
|
|
1188
1199
|
closeAllTooltips();
|
|
1189
1200
|
closeSettings();
|
|
1190
1201
|
};
|
|
1191
|
-
|
|
1202
|
+
p$1(() => {
|
|
1192
1203
|
if (!window.parent) {
|
|
1193
1204
|
// can happen while parent iframe reloads
|
|
1194
1205
|
return;
|
|
@@ -1315,11 +1326,11 @@ const renameAttribute = (node, name, newName) => {
|
|
|
1315
1326
|
const executionIndicator = document.querySelector("#document_execution_indicator");
|
|
1316
1327
|
const renderDocumentExecutionIndicator = async () => {
|
|
1317
1328
|
removeForceHideElement(document.querySelector("#document_execution_indicator"));
|
|
1318
|
-
|
|
1329
|
+
p$1(() => {
|
|
1319
1330
|
const execution = executionSignal.value;
|
|
1320
1331
|
updateExecutionIndicator(execution);
|
|
1321
1332
|
});
|
|
1322
|
-
|
|
1333
|
+
p$1(() => {
|
|
1323
1334
|
const executionTooltipOpened = executionTooltipOpenedSignal.value;
|
|
1324
1335
|
if (executionTooltipOpened) {
|
|
1325
1336
|
executionIndicator.setAttribute("data-tooltip-visible", "");
|
|
@@ -1370,9 +1381,9 @@ const computeText = ({
|
|
|
1370
1381
|
return "";
|
|
1371
1382
|
};
|
|
1372
1383
|
|
|
1373
|
-
const autoreloadEnabledSignal =
|
|
1374
|
-
const reloaderStatusSignal =
|
|
1375
|
-
const changesSignal =
|
|
1384
|
+
const autoreloadEnabledSignal = u(false);
|
|
1385
|
+
const reloaderStatusSignal = u("idle");
|
|
1386
|
+
const changesSignal = u(0);
|
|
1376
1387
|
if (parentWindowReloader) {
|
|
1377
1388
|
if (!parentWindowReloader.autoreload.enabled && paramsFromParentWindow.autoreload) {
|
|
1378
1389
|
autoreloadEnabledSignal.value = true;
|
|
@@ -1403,7 +1414,7 @@ const closeChangesToolip = () => {
|
|
|
1403
1414
|
|
|
1404
1415
|
const changesIndicator = document.querySelector("#changes_indicator");
|
|
1405
1416
|
const renderChangesIndicator = () => {
|
|
1406
|
-
|
|
1417
|
+
p$1(() => {
|
|
1407
1418
|
const autoreloadEnabled = autoreloadEnabledSignal.value;
|
|
1408
1419
|
const changes = changesSignal.value;
|
|
1409
1420
|
const changeCount = changes.length;
|
|
@@ -1425,7 +1436,7 @@ const renderChangesIndicator = () => {
|
|
|
1425
1436
|
changesIndicator.querySelector(".tooltip_action").onclick = () => {
|
|
1426
1437
|
parentWindowReloader.reload();
|
|
1427
1438
|
};
|
|
1428
|
-
|
|
1439
|
+
p$1(() => {
|
|
1429
1440
|
const changesTooltipOpened = changesTooltipOpenedSignal.value;
|
|
1430
1441
|
if (changesTooltipOpened) {
|
|
1431
1442
|
changesIndicator.setAttribute("data-tooltip-visible", "");
|
|
@@ -1458,11 +1469,11 @@ const serverEvents = window.__server_events__;
|
|
|
1458
1469
|
const serverIndicator = document.querySelector("#server_indicator");
|
|
1459
1470
|
const renderServerIndicator = () => {
|
|
1460
1471
|
removeForceHideElement(document.querySelector("#server_indicator"));
|
|
1461
|
-
|
|
1472
|
+
p$1(() => {
|
|
1462
1473
|
const serverConnection = serverConnectionSignal.value;
|
|
1463
1474
|
updateServerIndicator(serverConnection);
|
|
1464
1475
|
});
|
|
1465
|
-
|
|
1476
|
+
p$1(() => {
|
|
1466
1477
|
const serverTooltipOpened = serverTooltipOpenedSignal.value;
|
|
1467
1478
|
if (serverTooltipOpened) {
|
|
1468
1479
|
serverIndicator.setAttribute("data-tooltip-visible", "");
|
|
@@ -1508,7 +1519,7 @@ const renderToolbarAutoreloadSetting = () => {
|
|
|
1508
1519
|
return;
|
|
1509
1520
|
}
|
|
1510
1521
|
const autoreloadCheckbox = document.querySelector("#toggle_autoreload");
|
|
1511
|
-
|
|
1522
|
+
p$1(() => {
|
|
1512
1523
|
const autoreloadEnabled = autoreloadEnabledSignal.value;
|
|
1513
1524
|
if (autoreloadEnabled) {
|
|
1514
1525
|
autoreloadCheckbox.checked = true;
|
|
@@ -1575,7 +1586,7 @@ const disableAnimations = () => {
|
|
|
1575
1586
|
|
|
1576
1587
|
const renderToolbarAnimationSetting = () => {
|
|
1577
1588
|
const animCheckbox = document.querySelector("#toggle_anims");
|
|
1578
|
-
|
|
1589
|
+
p$1(() => {
|
|
1579
1590
|
const animationsEnabled = animationsEnabledSignal.value;
|
|
1580
1591
|
animCheckbox.checked = animationsEnabled;
|
|
1581
1592
|
});
|
|
@@ -1594,11 +1605,11 @@ const renderToolbarAnimationSetting = () => {
|
|
|
1594
1605
|
|
|
1595
1606
|
const notifCheckbox = document.querySelector("#toggle_notifs");
|
|
1596
1607
|
const renderToolbarNotificationSetting = () => {
|
|
1597
|
-
|
|
1608
|
+
p$1(() => {
|
|
1598
1609
|
const notificationsEnabled = notificationsEnabledSignal.value;
|
|
1599
1610
|
notifCheckbox.checked = notificationsEnabled;
|
|
1600
1611
|
});
|
|
1601
|
-
|
|
1612
|
+
p$1(() => {
|
|
1602
1613
|
const notificationPermission = notificationPermissionSignal.value;
|
|
1603
1614
|
if (!notificationAPIDetected) {
|
|
1604
1615
|
applyNotificationNotAvailableEffects();
|
|
@@ -1660,7 +1671,7 @@ const applyNotificationNOTGrantedEffects = () => {
|
|
|
1660
1671
|
};
|
|
1661
1672
|
};
|
|
1662
1673
|
|
|
1663
|
-
const themeSignal =
|
|
1674
|
+
const themeSignal = u(typeof stateFromLocalStorage.theme === "string" ? stateFromLocalStorage.theme : typeof paramsFromParentWindow.theme === "string" ? paramsFromParentWindow.theme : "dark");
|
|
1664
1675
|
|
|
1665
1676
|
const switchToLightTheme = () => {
|
|
1666
1677
|
themeSignal.value = "light";
|
|
@@ -1689,7 +1700,7 @@ const renderToolbarSettings = () => {
|
|
|
1689
1700
|
renderToolbarAnimationSetting();
|
|
1690
1701
|
renderToolbarNotificationSetting();
|
|
1691
1702
|
renderToolbarThemeSetting();
|
|
1692
|
-
|
|
1703
|
+
p$1(() => {
|
|
1693
1704
|
const settingsOpened = settingsOpenedSignal.value;
|
|
1694
1705
|
if (settingsOpened) {
|
|
1695
1706
|
activateToolbarSection(document.querySelector("#settings"));
|
|
@@ -1757,14 +1768,14 @@ addExternalCommandCallback("initToolbar", () => {
|
|
|
1757
1768
|
});
|
|
1758
1769
|
sendEventToParent("toolbar_ready");
|
|
1759
1770
|
|
|
1760
|
-
|
|
1771
|
+
p$1(() => {
|
|
1761
1772
|
const serverConnection = serverConnectionSignal.value;
|
|
1762
1773
|
if (serverConnection === "connecting" || serverConnection === "closed") {
|
|
1763
1774
|
openServerTooltip();
|
|
1764
1775
|
}
|
|
1765
1776
|
});
|
|
1766
1777
|
|
|
1767
|
-
|
|
1778
|
+
p$1(() => {
|
|
1768
1779
|
const theme = themeSignal.value;
|
|
1769
1780
|
document.querySelector("html").setAttribute("data-theme", theme);
|
|
1770
1781
|
});
|
|
@@ -1772,7 +1783,7 @@ b(() => {
|
|
|
1772
1783
|
addExternalCommandCallback("openToolbar", openToolbar);
|
|
1773
1784
|
addExternalCommandCallback("closeToolbar", closeToolbar);
|
|
1774
1785
|
|
|
1775
|
-
const toolbarStateSignal =
|
|
1786
|
+
const toolbarStateSignal = w(() => {
|
|
1776
1787
|
const opened = openedSignal.value;
|
|
1777
1788
|
const theme = themeSignal.value;
|
|
1778
1789
|
const animationsEnabled = animationsEnabledSignal.value;
|
|
@@ -1785,7 +1796,7 @@ const toolbarStateSignal = a$1(() => {
|
|
|
1785
1796
|
};
|
|
1786
1797
|
});
|
|
1787
1798
|
|
|
1788
|
-
|
|
1799
|
+
p$1(() => {
|
|
1789
1800
|
const toolbarState = toolbarStateSignal.value;
|
|
1790
1801
|
localStorage.setItem("jsenv_toolbar", JSON.stringify(toolbarState));
|
|
1791
1802
|
sendEventToParent("toolbar_state_change", toolbarState);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/plugin-toolbar",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/src/"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jsenv/ast": "1.4.
|
|
30
|
-
"@preact/signals": "1.1.
|
|
29
|
+
"@jsenv/ast": "1.4.10",
|
|
30
|
+
"@preact/signals": "1.1.3"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
|