@jsenv/plugin-toolbar 0.1.1 → 0.1.2

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 (66) hide show
  1. package/dist/css/document_execution_indicator.css +87 -0
  2. package/dist/css/globals.css +75 -0
  3. package/dist/css/server_indicator.css +83 -0
  4. package/dist/css/theme_light.css +110 -0
  5. package/dist/css/toolbar.css +7 -683
  6. package/dist/css/toolbar_menu_overflow.css +59 -0
  7. package/dist/css/toolbar_settings.css +202 -0
  8. package/dist/css/tooltips.css +67 -0
  9. package/dist/js/animation.js +282 -0
  10. package/dist/js/animation_actions.js +7 -0
  11. package/dist/js/animation_effects.js +10 -0
  12. package/dist/js/animation_signals.js +4 -0
  13. package/dist/js/changes_actions.js +7 -0
  14. package/dist/js/changes_indicator.js +57 -0
  15. package/dist/js/changes_signals.js +2 -0
  16. package/dist/js/document_execution_indicator.js +62 -0
  17. package/dist/js/document_index_link.js +4 -0
  18. package/dist/js/dom.js +48 -0
  19. package/dist/js/execution_actions.js +46 -0
  20. package/dist/js/execution_effects.js +16 -0
  21. package/dist/js/execution_signals.js +17 -0
  22. package/dist/js/hooks.mjs +185 -0
  23. package/dist/js/iframe_to_parent_href.js +10 -0
  24. package/dist/js/notification_actions.js +60 -0
  25. package/dist/js/notification_context.js +1 -0
  26. package/dist/js/notification_effects.js +9 -0
  27. package/dist/js/notification_signals.js +5 -0
  28. package/dist/js/parent_window_actions.js +39 -0
  29. package/dist/js/parent_window_context.js +6 -0
  30. package/dist/js/parent_window_effects.js +15 -0
  31. package/dist/js/parent_window_signals.js +25 -0
  32. package/dist/js/preact.mjs +316 -0
  33. package/dist/js/responsive.js +104 -0
  34. package/dist/js/server_actions.js +7 -0
  35. package/dist/js/server_effects.js +9 -0
  36. package/dist/js/server_indicator.js +52 -0
  37. package/dist/js/server_signals.js +10 -0
  38. package/dist/js/settings_actions.js +7 -0
  39. package/dist/js/settings_signals.js +2 -0
  40. package/dist/js/signals-core.mjs +339 -0
  41. package/dist/js/signals.mjs +202 -0
  42. package/dist/js/theme_actions.js +7 -0
  43. package/dist/js/theme_effects.js +6 -0
  44. package/dist/js/theme_signals.js +4 -0
  45. package/dist/js/toolbar_animation_setting.js +21 -0
  46. package/dist/js/toolbar_autoreload_setting.js +67 -0
  47. package/dist/js/toolbar_close_button.js +14 -0
  48. package/dist/js/toolbar_core.js +8 -1792
  49. package/dist/js/toolbar_injector.js +2 -4
  50. package/dist/js/toolbar_menu_overflow.js +81 -0
  51. package/dist/js/toolbar_notification_setting.js +72 -0
  52. package/dist/js/toolbar_open_actions.js +7 -0
  53. package/dist/js/toolbar_open_effects.js +4 -0
  54. package/dist/js/toolbar_open_signals.js +4 -0
  55. package/dist/js/toolbar_opening.js +65 -0
  56. package/dist/js/toolbar_overlay.js +69 -0
  57. package/dist/js/toolbar_settings.js +44 -0
  58. package/dist/js/toolbar_state_context.js +1 -0
  59. package/dist/js/toolbar_state_effects.js +8 -0
  60. package/dist/js/toolbar_state_signals.js +17 -0
  61. package/dist/js/toolbar_theme_setting.js +13 -0
  62. package/dist/js/toolbar_ui.js +20 -0
  63. package/dist/js/tooltip_actions.js +6 -0
  64. package/dist/js/variant.js +53 -0
  65. package/dist/jsenv_plugin_toolbar.js +3 -6
  66. package/package.json +2 -2
@@ -0,0 +1,339 @@
1
+ function i() {
2
+ throw new Error("Cycle detected");
3
+ }
4
+ function t() {
5
+ if (h > 1) {
6
+ h--;
7
+ return;
8
+ }
9
+ let i,
10
+ t = !1;
11
+ while (void 0 !== o) {
12
+ let s = o;
13
+ o = void 0;
14
+ f++;
15
+ while (void 0 !== s) {
16
+ const n = s.o;
17
+ s.o = void 0;
18
+ s.f &= -3;
19
+ if (!(8 & s.f) && v(s)) try {
20
+ s.c();
21
+ } catch (s) {
22
+ if (!t) {
23
+ i = s;
24
+ t = !0;
25
+ }
26
+ }
27
+ s = n;
28
+ }
29
+ }
30
+ f = 0;
31
+ h--;
32
+ if (t) throw i;
33
+ }
34
+ function s(i) {
35
+ if (h > 0) return i();
36
+ h++;
37
+ try {
38
+ return i();
39
+ } finally {
40
+ t();
41
+ }
42
+ }
43
+ let n,
44
+ o,
45
+ h = 0,
46
+ f = 0,
47
+ r = 0;
48
+ function e(i) {
49
+ if (void 0 === n) return;
50
+ let t = i.n;
51
+ if (void 0 === t || t.t !== n) {
52
+ t = {
53
+ i: 0,
54
+ S: i,
55
+ p: void 0,
56
+ n: n.s,
57
+ t: n,
58
+ e: void 0,
59
+ x: void 0,
60
+ r: t
61
+ };
62
+ n.s = t;
63
+ i.n = t;
64
+ if (32 & n.f) i.S(t);
65
+ return t;
66
+ } else if (-1 === t.i) {
67
+ t.i = 0;
68
+ if (void 0 !== t.p) {
69
+ t.p.n = t.n;
70
+ if (void 0 !== t.n) t.n.p = t.p;
71
+ t.p = void 0;
72
+ t.n = n.s;
73
+ n.s.p = t;
74
+ n.s = t;
75
+ }
76
+ return t;
77
+ }
78
+ }
79
+ function u(i) {
80
+ this.v = i;
81
+ this.i = 0;
82
+ this.n = void 0;
83
+ this.t = void 0;
84
+ }
85
+ u.prototype.h = function () {
86
+ return !0;
87
+ };
88
+ u.prototype.S = function (i) {
89
+ if (this.t !== i && void 0 === i.e) {
90
+ i.x = this.t;
91
+ if (void 0 !== this.t) this.t.e = i;
92
+ this.t = i;
93
+ }
94
+ };
95
+ u.prototype.U = function (i) {
96
+ const t = i.e,
97
+ s = i.x;
98
+ if (void 0 !== t) {
99
+ t.x = s;
100
+ i.e = void 0;
101
+ }
102
+ if (void 0 !== s) {
103
+ s.e = t;
104
+ i.x = void 0;
105
+ }
106
+ if (i === this.t) this.t = s;
107
+ };
108
+ u.prototype.subscribe = function (i) {
109
+ const t = this;
110
+ return b(function () {
111
+ const s = t.value,
112
+ n = 32 & this.f;
113
+ this.f &= -33;
114
+ try {
115
+ i(s);
116
+ } finally {
117
+ this.f |= n;
118
+ }
119
+ });
120
+ };
121
+ u.prototype.valueOf = function () {
122
+ return this.value;
123
+ };
124
+ u.prototype.toString = function () {
125
+ return this.value + "";
126
+ };
127
+ u.prototype.peek = function () {
128
+ return this.v;
129
+ };
130
+ Object.defineProperty(u.prototype, "value", {
131
+ get() {
132
+ const i = e(this);
133
+ if (void 0 !== i) i.i = this.i;
134
+ return this.v;
135
+ },
136
+ set(s) {
137
+ if (s !== this.v) {
138
+ if (f > 100) i();
139
+ this.v = s;
140
+ this.i++;
141
+ r++;
142
+ h++;
143
+ try {
144
+ for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
145
+ } finally {
146
+ t();
147
+ }
148
+ }
149
+ }
150
+ });
151
+ function c(i) {
152
+ return new u(i);
153
+ }
154
+ function v(i) {
155
+ 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;
156
+ return !1;
157
+ }
158
+ function d(i) {
159
+ for (let t = i.s; void 0 !== t; t = t.n) {
160
+ const i = t.S.n;
161
+ if (void 0 !== i) t.r = i;
162
+ t.S.n = t;
163
+ t.i = -1;
164
+ }
165
+ }
166
+ function l(i) {
167
+ let t,
168
+ s = i.s;
169
+ while (void 0 !== s) {
170
+ const i = s.n;
171
+ if (-1 === s.i) {
172
+ s.S.U(s);
173
+ s.n = void 0;
174
+ } else {
175
+ if (void 0 !== t) t.p = s;
176
+ s.p = void 0;
177
+ s.n = t;
178
+ t = s;
179
+ }
180
+ s.S.n = s.r;
181
+ if (void 0 !== s.r) s.r = void 0;
182
+ s = i;
183
+ }
184
+ i.s = t;
185
+ }
186
+ function w(i) {
187
+ u.call(this, void 0);
188
+ this.x = i;
189
+ this.s = void 0;
190
+ this.g = r - 1;
191
+ this.f = 4;
192
+ }
193
+ (w.prototype = new u()).h = function () {
194
+ this.f &= -3;
195
+ if (1 & this.f) return !1;
196
+ if (32 == (36 & this.f)) return !0;
197
+ this.f &= -5;
198
+ if (this.g === r) return !0;
199
+ this.g = r;
200
+ this.f |= 1;
201
+ if (this.i > 0 && !v(this)) {
202
+ this.f &= -2;
203
+ return !0;
204
+ }
205
+ const i = n;
206
+ try {
207
+ d(this);
208
+ n = this;
209
+ const i = this.x();
210
+ if (16 & this.f || this.v !== i || 0 === this.i) {
211
+ this.v = i;
212
+ this.f &= -17;
213
+ this.i++;
214
+ }
215
+ } catch (i) {
216
+ this.v = i;
217
+ this.f |= 16;
218
+ this.i++;
219
+ }
220
+ n = i;
221
+ l(this);
222
+ this.f &= -2;
223
+ return !0;
224
+ };
225
+ w.prototype.S = function (i) {
226
+ if (void 0 === this.t) {
227
+ this.f |= 36;
228
+ for (let i = this.s; void 0 !== i; i = i.n) i.S.S(i);
229
+ }
230
+ u.prototype.S.call(this, i);
231
+ };
232
+ w.prototype.U = function (i) {
233
+ u.prototype.U.call(this, i);
234
+ if (void 0 === this.t) {
235
+ this.f &= -33;
236
+ for (let i = this.s; void 0 !== i; i = i.n) i.S.U(i);
237
+ }
238
+ };
239
+ w.prototype.N = function () {
240
+ if (!(2 & this.f)) {
241
+ this.f |= 6;
242
+ for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
243
+ }
244
+ };
245
+ w.prototype.peek = function () {
246
+ if (!this.h()) i();
247
+ if (16 & this.f) throw this.v;
248
+ return this.v;
249
+ };
250
+ Object.defineProperty(w.prototype, "value", {
251
+ get() {
252
+ if (1 & this.f) i();
253
+ const t = e(this);
254
+ this.h();
255
+ if (void 0 !== t) t.i = this.i;
256
+ if (16 & this.f) throw this.v;
257
+ return this.v;
258
+ }
259
+ });
260
+ function a(i) {
261
+ return new w(i);
262
+ }
263
+ function y(i) {
264
+ const s = i.u;
265
+ i.u = void 0;
266
+ if ("function" == typeof s) {
267
+ h++;
268
+ const o = n;
269
+ n = void 0;
270
+ try {
271
+ s();
272
+ } catch (t) {
273
+ i.f &= -2;
274
+ i.f |= 8;
275
+ _(i);
276
+ throw t;
277
+ } finally {
278
+ n = o;
279
+ t();
280
+ }
281
+ }
282
+ }
283
+ function _(i) {
284
+ for (let t = i.s; void 0 !== t; t = t.n) t.S.U(t);
285
+ i.x = void 0;
286
+ i.s = void 0;
287
+ y(i);
288
+ }
289
+ function g(i) {
290
+ if (n !== this) throw new Error("Out-of-order effect");
291
+ l(this);
292
+ n = i;
293
+ this.f &= -2;
294
+ if (8 & this.f) _(this);
295
+ t();
296
+ }
297
+ function p(i) {
298
+ this.x = i;
299
+ this.u = void 0;
300
+ this.s = void 0;
301
+ this.o = void 0;
302
+ this.f = 32;
303
+ }
304
+ p.prototype.c = function () {
305
+ const i = this.S();
306
+ try {
307
+ if (!(8 & this.f) && void 0 !== this.x) this.u = this.x();
308
+ } finally {
309
+ i();
310
+ }
311
+ };
312
+ p.prototype.S = function () {
313
+ if (1 & this.f) i();
314
+ this.f |= 1;
315
+ this.f &= -9;
316
+ y(this);
317
+ d(this);
318
+ h++;
319
+ const t = n;
320
+ n = this;
321
+ return g.bind(this, t);
322
+ };
323
+ p.prototype.N = function () {
324
+ if (!(2 & this.f)) {
325
+ this.f |= 2;
326
+ this.o = o;
327
+ o = this;
328
+ }
329
+ };
330
+ p.prototype.d = function () {
331
+ this.f |= 8;
332
+ if (!(1 & this.f)) _(this);
333
+ };
334
+ function b(i) {
335
+ const t = new p(i);
336
+ t.c();
337
+ return t.d.bind(t);
338
+ }
339
+ export { u as Signal, s as batch, a as computed, b as effect, c as signal };
@@ -0,0 +1,202 @@
1
+ import { Component as t, options as i } from "./preact.mjs";
2
+ import { useMemo as e, useRef as n, useEffect as o } from "./hooks.mjs";
3
+ import { Signal as r, computed as f, signal as l, effect as s } from "./signals-core.mjs";
4
+ export { Signal, batch, computed, effect, signal } from "./signals-core.mjs";
5
+ function c(t, e) {
6
+ i[t] = e.bind(null, i[t] || (() => {}));
7
+ }
8
+ let u, a;
9
+ function d(t) {
10
+ if (a) a();
11
+ a = t && t.S();
12
+ }
13
+ function p({
14
+ data: t
15
+ }) {
16
+ const i = useSignal(t);
17
+ i.value = t;
18
+ const n = e(() => {
19
+ let t = this.__v;
20
+ while (t = t.__) if (t.__c) {
21
+ t.__c.__$f |= 4;
22
+ break;
23
+ }
24
+ this.__$u.c = () => {
25
+ this.base.data = n.peek();
26
+ };
27
+ return f(() => {
28
+ let t = i.value.value;
29
+ return 0 === t ? 0 : !0 === t ? "" : t || "";
30
+ });
31
+ }, []);
32
+ return n.value;
33
+ }
34
+ p.displayName = "_st";
35
+ Object.defineProperties(r.prototype, {
36
+ constructor: {
37
+ configurable: !0
38
+ },
39
+ type: {
40
+ configurable: !0,
41
+ value: p
42
+ },
43
+ props: {
44
+ configurable: !0,
45
+ get() {
46
+ return {
47
+ data: this
48
+ };
49
+ }
50
+ },
51
+ __b: {
52
+ configurable: !0,
53
+ value: 1
54
+ }
55
+ });
56
+ c("__b", (t, i) => {
57
+ if ("string" == typeof i.type) {
58
+ let t,
59
+ e = i.props;
60
+ for (let n in e) {
61
+ if ("children" === n) continue;
62
+ let o = e[n];
63
+ if (o instanceof r) {
64
+ if (!t) i.__np = t = {};
65
+ t[n] = o;
66
+ e[n] = o.peek();
67
+ }
68
+ }
69
+ }
70
+ t(i);
71
+ });
72
+ c("__r", (t, i) => {
73
+ d();
74
+ let e,
75
+ n = i.__c;
76
+ if (n) {
77
+ n.__$f &= -2;
78
+ e = n.__$u;
79
+ if (void 0 === e) n.__$u = e = function (t) {
80
+ let i;
81
+ s(function () {
82
+ i = this;
83
+ });
84
+ i.c = () => {
85
+ n.__$f |= 1;
86
+ n.setState({});
87
+ };
88
+ return i;
89
+ }();
90
+ }
91
+ u = n;
92
+ d(e);
93
+ t(i);
94
+ });
95
+ c("__e", (t, i, e, n) => {
96
+ d();
97
+ u = void 0;
98
+ t(i, e, n);
99
+ });
100
+ c("diffed", (t, i) => {
101
+ d();
102
+ u = void 0;
103
+ let e;
104
+ if ("string" == typeof i.type && (e = i.__e)) {
105
+ let t = i.__np,
106
+ n = i.props;
107
+ if (t) {
108
+ let i = e.U;
109
+ if (i) for (let e in i) {
110
+ let n = i[e];
111
+ if (void 0 !== n && !(e in t)) {
112
+ n.d();
113
+ i[e] = void 0;
114
+ }
115
+ } else {
116
+ i = {};
117
+ e.U = i;
118
+ }
119
+ for (let o in t) {
120
+ let r = i[o],
121
+ f = t[o];
122
+ if (void 0 === r) {
123
+ r = h(e, o, f, n);
124
+ i[o] = r;
125
+ } else r.o(f, n);
126
+ }
127
+ }
128
+ }
129
+ t(i);
130
+ });
131
+ function h(t, i, e, n) {
132
+ const o = i in t && void 0 === t.ownerSVGElement,
133
+ r = l(e);
134
+ return {
135
+ o: (t, i) => {
136
+ r.value = t;
137
+ n = i;
138
+ },
139
+ d: s(() => {
140
+ const e = r.value.value;
141
+ if (n[i] !== e) {
142
+ n[i] = e;
143
+ if (o) t[i] = e;else if (e) t.setAttribute(i, e);else t.removeAttribute(i);
144
+ }
145
+ })
146
+ };
147
+ }
148
+ c("unmount", (t, i) => {
149
+ if ("string" == typeof i.type) {
150
+ let t = i.__e;
151
+ if (t) {
152
+ const i = t.U;
153
+ if (i) {
154
+ t.U = void 0;
155
+ for (let t in i) {
156
+ let e = i[t];
157
+ if (e) e.d();
158
+ }
159
+ }
160
+ }
161
+ } else {
162
+ let t = i.__c;
163
+ if (t) {
164
+ const i = t.__$u;
165
+ if (i) {
166
+ t.__$u = void 0;
167
+ i.d();
168
+ }
169
+ }
170
+ }
171
+ t(i);
172
+ });
173
+ c("__h", (t, i, e, n) => {
174
+ if (n < 3) i.__$f |= 2;
175
+ t(i, e, n);
176
+ });
177
+ t.prototype.shouldComponentUpdate = function (t, i) {
178
+ const e = this.__$u;
179
+ if (!(e && void 0 !== e.s || 4 & this.__$f)) return !0;
180
+ if (3 & this.__$f) return !0;
181
+ for (let t in i) return !0;
182
+ for (let i in t) if ("__source" !== i && t[i] !== this.props[i]) return !0;
183
+ for (let i in this.props) if (!(i in t)) return !0;
184
+ return !1;
185
+ };
186
+ function useSignal(t) {
187
+ return e(() => l(t), []);
188
+ }
189
+ function useComputed(t) {
190
+ const i = n(t);
191
+ i.current = t;
192
+ u.__$f |= 4;
193
+ return e(() => f(() => i.current()), []);
194
+ }
195
+ function useSignalEffect(t) {
196
+ const i = n(t);
197
+ i.current = t;
198
+ o(() => s(() => {
199
+ i.current();
200
+ }), []);
201
+ }
202
+ export { useComputed, useSignal, useSignalEffect };
@@ -0,0 +1,7 @@
1
+ import { themeSignal } from "./theme_signals.js";
2
+ export const switchToLightTheme = () => {
3
+ themeSignal.value = "light";
4
+ };
5
+ export const switchToDefaultTheme = () => {
6
+ themeSignal.value = "dark";
7
+ };
@@ -0,0 +1,6 @@
1
+ import { effect } from "./signals.mjs";
2
+ import { themeSignal } from "./theme_signals.js";
3
+ effect(() => {
4
+ const theme = themeSignal.value;
5
+ document.querySelector("html").setAttribute("data-theme", theme);
6
+ });
@@ -0,0 +1,4 @@
1
+ import { signal } from "./signals.mjs";
2
+ import { paramsFromParentWindow } from "./parent_window_context.js";
3
+ import { stateFromLocalStorage } from "./toolbar_state_context.js";
4
+ export const themeSignal = signal(typeof stateFromLocalStorage.theme === "string" ? stateFromLocalStorage.theme : typeof paramsFromParentWindow.theme === "string" ? paramsFromParentWindow.theme : "dark");
@@ -0,0 +1,21 @@
1
+ import { effect } from "./signals.mjs";
2
+ import { animationsEnabledSignal } from "./animation_signals.js";
3
+ import { enableAnimations, disableAnimations } from "./animation_actions.js";
4
+ export const renderToolbarAnimationSetting = () => {
5
+ const animCheckbox = document.querySelector("#toggle_anims");
6
+ effect(() => {
7
+ const animationsEnabled = animationsEnabledSignal.value;
8
+ animCheckbox.checked = animationsEnabled;
9
+ });
10
+ animCheckbox.onchange = () => {
11
+ if (animCheckbox.checked) {
12
+ enableAnimations();
13
+ } else {
14
+ disableAnimations();
15
+ }
16
+ };
17
+ // enable toolbar transition only after first render
18
+ setTimeout(() => {
19
+ document.querySelector("#toolbar").setAttribute("data-animate", "");
20
+ });
21
+ };
@@ -0,0 +1,67 @@
1
+ import { effect } from "./signals.mjs";
2
+ import { autoreloadEnabledSignal } from "./parent_window_signals.js";
3
+ import { disableAutoreload, enableAutoreload } from "./parent_window_actions.js";
4
+ export const renderToolbarAutoreloadSetting = () => {
5
+ const parentWindowReloader = window.parent.__reloader__;
6
+ if (!parentWindowReloader) {
7
+ disableAutoreloadSetting();
8
+ return;
9
+ }
10
+ const autoreloadCheckbox = document.querySelector("#toggle_autoreload");
11
+ effect(() => {
12
+ const autoreloadEnabled = autoreloadEnabledSignal.value;
13
+ if (autoreloadEnabled) {
14
+ autoreloadCheckbox.checked = true;
15
+ } else {
16
+ autoreloadCheckbox.checked = false;
17
+ }
18
+ });
19
+ autoreloadCheckbox.onchange = () => {
20
+ if (autoreloadCheckbox.checked) {
21
+ enableAutoreload();
22
+ } else {
23
+ disableAutoreload();
24
+ }
25
+ };
26
+ };
27
+ const disableAutoreloadSetting = () => {
28
+ document.querySelector(".settings_autoreload").setAttribute("data-disabled", "true");
29
+ document.querySelector(".settings_autoreload").setAttribute("title", `Autoreload not enabled on server`);
30
+ document.querySelector("#toggle_autoreload").disabled = true;
31
+ };
32
+
33
+ // const changeLink = variantNode.querySelector(".eventsource-changes-link")
34
+ // changeLink.innerHTML = reloadMessageCount
35
+ // changeLink.onclick = () => {
36
+ // console.log(reloadMessages)
37
+ // // eslint-disable-next-line no-alert
38
+ // window.parent.alert(JSON.stringify(reloadMessages, null, " "))
39
+ // }
40
+
41
+ // const someFailed = reloadMessages.some((m) => m.status === "failed")
42
+ // const somePending = reloadMessages.some((m) => m.status === "pending")
43
+ // const applyLink = variantNode.querySelector(".eventsource-reload-link")
44
+ // applyLink.innerHTML = someFailed
45
+ // ? "failed"
46
+ // : somePending
47
+ // ? "applying..."
48
+ // : "apply changes"
49
+ // applyLink.onclick = someFailed
50
+ // ? () => {
51
+ // parentEventSourceClient.applyReloadMessageEffects()
52
+ // }
53
+ // : somePending
54
+ // ? () => {}
55
+ // : () => {
56
+ // parentEventSourceClient.applyReloadMessageEffects()
57
+ // }
58
+
59
+ // parentEventSourceClient.reloadMessagesSignal.onchange = () => {
60
+ // updateEventSourceIndicator()
61
+ // }
62
+ // const autoreloadCheckbox = document.querySelector("#toggle-autoreload")
63
+ // autoreloadCheckbox.checked = parentEventSourceClient.isAutoreloadEnabled()
64
+ // autoreloadCheckbox.onchange = () => {
65
+ // parentEventSourceClient.setAutoreloadPreference(autoreloadCheckbox.checked)
66
+ // updateEventSourceIndicator()
67
+ // }
@@ -0,0 +1,14 @@
1
+ import { openedSignal } from "./toolbar_open_signals.js";
2
+ import { openToolbar, closeToolbar } from "./toolbar_open_actions.js";
3
+ export const renderToolbarCloseButton = () => {
4
+ // if user click enter or space quickly while closing toolbar
5
+ // it will cancel the closing
6
+ // that's why I used toggleToolbar and not hideToolbar
7
+ document.querySelector("#toolbar_close_button").onclick = () => {
8
+ if (openedSignal.value) {
9
+ closeToolbar();
10
+ } else {
11
+ openToolbar();
12
+ }
13
+ };
14
+ };