@jsenv/plugin-toolbar 1.5.24 → 1.5.26

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,4 +1,4 @@
1
- import { d, E, w } from "../jsenv_plugin_toolbar_node_modules.js";
1
+ import { v, m, b } from "../jsenv_plugin_toolbar_node_modules.js";
2
2
 
3
3
  const paramsFromParentWindow = {};
4
4
  const searchParams = new URLSearchParams(window.location.search);
@@ -9,9 +9,9 @@ const parentWindowReloader = window.parent.__reloader__;
9
9
 
10
10
  const stateFromLocalStorage = localStorage.hasOwnProperty("jsenv_toolbar") ? JSON.parse(localStorage.getItem("jsenv_toolbar")) : {};
11
11
 
12
- const animationsEnabledSignal = d(typeof stateFromLocalStorage.animationsEnabled === "boolean" ? stateFromLocalStorage.animationsEnabled : typeof paramsFromParentWindow.animationsEnabled === "boolean" ? paramsFromParentWindow.animationsEnabled : false);
12
+ const animationsEnabledSignal = v(typeof stateFromLocalStorage.animationsEnabled === "boolean" ? stateFromLocalStorage.animationsEnabled : typeof paramsFromParentWindow.animationsEnabled === "boolean" ? paramsFromParentWindow.animationsEnabled : false);
13
13
 
14
- E(() => {
14
+ m(() => {
15
15
  const animationsEnabled = animationsEnabledSignal.value;
16
16
  if (animationsEnabled) {
17
17
  document.documentElement.removeAttribute("data-animation-disabled");
@@ -20,11 +20,11 @@ E(() => {
20
20
  }
21
21
  });
22
22
 
23
- const executionTooltipOpenedSignal = d(false);
24
- const executionSignal = d({
23
+ const executionTooltipOpenedSignal = v(false);
24
+ const executionSignal = v({
25
25
  status: "running"
26
26
  });
27
- const previousExecutionSignal = d(sessionStorage.hasOwnProperty(window.location.href) ? JSON.parse(sessionStorage.getItem(window.location.href)) : null);
27
+ const previousExecutionSignal = v(sessionStorage.hasOwnProperty(window.location.href) ? JSON.parse(sessionStorage.getItem(window.location.href)) : null);
28
28
  window.parent.__supervisor__.getDocumentExecutionResult().then(({
29
29
  status,
30
30
  startTime,
@@ -39,8 +39,8 @@ window.parent.__supervisor__.getDocumentExecutionResult().then(({
39
39
 
40
40
  const notificationAPIDetected = typeof window.Notification === "function";
41
41
 
42
- const notificationsEnabledSignal = d(typeof stateFromLocalStorage.notificationsEnabled === "boolean" ? stateFromLocalStorage.notificationsEnabled : typeof paramsFromParentWindow.notificationsEnabled === "boolean" ? paramsFromParentWindow.notificationsEnabled : false);
43
- const notificationPermissionSignal = d(Notification.permission);
42
+ const notificationsEnabledSignal = v(typeof stateFromLocalStorage.notificationsEnabled === "boolean" ? stateFromLocalStorage.notificationsEnabled : typeof paramsFromParentWindow.notificationsEnabled === "boolean" ? paramsFromParentWindow.notificationsEnabled : false);
43
+ const notificationPermissionSignal = v(Notification.permission);
44
44
 
45
45
  const enableNotifications = () => {
46
46
  notificationsEnabledSignal.value = true;
@@ -146,13 +146,13 @@ const getFaviconHref = () => {
146
146
  return link ? link.href : undefined;
147
147
  };
148
148
 
149
- E(() => {
149
+ m(() => {
150
150
  const execution = executionSignal.value;
151
151
  if (execution) {
152
152
  sessionStorage.setItem(window.location.href, JSON.stringify(execution));
153
153
  }
154
154
  });
155
- E(() => {
155
+ m(() => {
156
156
  const execution = executionSignal.value;
157
157
  const previousExecution = previousExecutionSignal.value;
158
158
  if (execution) {
@@ -160,14 +160,14 @@ E(() => {
160
160
  }
161
161
  });
162
162
 
163
- E(() => {
163
+ m(() => {
164
164
  const notificationsEnabled = notificationsEnabledSignal.value;
165
165
  if (!notificationsEnabled) {
166
166
  closeAllNotifications();
167
167
  }
168
168
  });
169
169
 
170
- const changesTooltipOpenedSignal = d(false);
170
+ const changesTooltipOpenedSignal = v(false);
171
171
 
172
172
  const openChangesToolip = () => {
173
173
  changesTooltipOpenedSignal.value = true;
@@ -176,9 +176,9 @@ const closeChangesToolip = () => {
176
176
  changesTooltipOpenedSignal.value = false;
177
177
  };
178
178
 
179
- const autoreloadEnabledSignal = d(false);
180
- const reloaderStatusSignal = d("idle");
181
- const changesSignal = d(0);
179
+ const autoreloadEnabledSignal = v(false);
180
+ const reloaderStatusSignal = v("idle");
181
+ const changesSignal = v(0);
182
182
  if (parentWindowReloader) {
183
183
  autoreloadEnabledSignal.value = parentWindowReloader.autoreload.enabled;
184
184
  parentWindowReloader.autoreload.onchange = () => {
@@ -252,7 +252,7 @@ const renameAttribute = (node, name, newName) => {
252
252
 
253
253
  const changesIndicator = document.querySelector("#changes_indicator");
254
254
  const renderChangesIndicator = () => {
255
- E(() => {
255
+ m(() => {
256
256
  const autoreloadEnabled = autoreloadEnabledSignal.value;
257
257
  const changes = changesSignal.value;
258
258
  const changeCount = changes.length;
@@ -274,7 +274,7 @@ const renderChangesIndicator = () => {
274
274
  changesIndicator.querySelector(".tooltip_action").onclick = () => {
275
275
  parentWindowReloader.reload();
276
276
  };
277
- E(() => {
277
+ m(() => {
278
278
  const changesTooltipOpened = changesTooltipOpenedSignal.value;
279
279
  if (changesTooltipOpened) {
280
280
  changesIndicator.setAttribute("data-tooltip-visible", "");
@@ -345,11 +345,11 @@ const deactivateToolbarSection = element => {
345
345
  const executionIndicator = document.querySelector("#document_execution_indicator");
346
346
  const renderDocumentExecutionIndicator = async () => {
347
347
  removeForceHideElement(document.querySelector("#document_execution_indicator"));
348
- E(() => {
348
+ m(() => {
349
349
  const execution = executionSignal.value;
350
350
  updateExecutionIndicator(execution);
351
351
  });
352
- E(() => {
352
+ m(() => {
353
353
  const executionTooltipOpened = executionTooltipOpenedSignal.value;
354
354
  if (executionTooltipOpened) {
355
355
  executionIndicator.setAttribute("data-tooltip-visible", "");
@@ -415,8 +415,8 @@ const renderDocumentIndexLink = () => {
415
415
  setLinkHrefForParentWindow(document.querySelector("#document_index_link"), "/");
416
416
  };
417
417
 
418
- const serverTooltipOpenedSignal = d(false);
419
- const serverConnectionSignal = d("default");
418
+ const serverTooltipOpenedSignal = v(false);
419
+ const serverConnectionSignal = v("default");
420
420
  const serverEvents$1 = window.__server_events__;
421
421
  if (serverEvents$1) {
422
422
  serverEvents$1.readyState.onchange = () => {
@@ -437,11 +437,11 @@ const serverEvents = window.__server_events__;
437
437
  const serverIndicator = document.querySelector("#server_indicator");
438
438
  const renderServerIndicator = () => {
439
439
  removeForceHideElement(document.querySelector("#server_indicator"));
440
- E(() => {
440
+ m(() => {
441
441
  const serverConnection = serverConnectionSignal.value;
442
442
  updateServerIndicator(serverConnection);
443
443
  });
444
- E(() => {
444
+ m(() => {
445
445
  const serverTooltipOpened = serverTooltipOpenedSignal.value;
446
446
  if (serverTooltipOpened) {
447
447
  serverIndicator.setAttribute("data-tooltip-visible", "");
@@ -480,7 +480,7 @@ const updateServerIndicator = connectionState => {
480
480
  }
481
481
  };
482
482
 
483
- const openedSignal = d(typeof stateFromLocalStorage.opened === "boolean" ? stateFromLocalStorage.opened : typeof paramsFromParentWindow.opened === "boolean" ? paramsFromParentWindow.opened : false);
483
+ const openedSignal = v(typeof stateFromLocalStorage.opened === "boolean" ? stateFromLocalStorage.opened : typeof paramsFromParentWindow.opened === "boolean" ? paramsFromParentWindow.opened : false);
484
484
 
485
485
  const openToolbar = () => {
486
486
  openedSignal.value = true;
@@ -745,7 +745,7 @@ const startJavaScriptAnimation = ({
745
745
  };
746
746
 
747
747
  const initToolbarOpening = () => {
748
- E(() => {
748
+ m(() => {
749
749
  const opened = openedSignal.value;
750
750
  if (opened) {
751
751
  showToolbar();
@@ -803,7 +803,7 @@ const showToolbar = () => {
803
803
  }
804
804
  };
805
805
 
806
- const settingsOpenedSignal = d(false);
806
+ const settingsOpenedSignal = v(false);
807
807
 
808
808
  const openSettings = () => {
809
809
  settingsOpenedSignal.value = true;
@@ -818,16 +818,16 @@ const renderToolbarOverlay = () => {
818
818
  closeAllTooltips();
819
819
  closeSettings();
820
820
  };
821
- E(() => {
822
- if (!window.parent) {
823
- // can happen while parent iframe reloads
824
- return;
825
- }
821
+ m(() => {
826
822
  const opened = openedSignal.value;
827
823
  const settingsOpened = settingsOpenedSignal.value;
828
824
  const executionTooltipOpened = executionTooltipOpenedSignal.value;
829
825
  const changesTooltipOpened = changesTooltipOpenedSignal.value;
830
826
  const serverTooltipOpened = serverTooltipOpenedSignal.value;
827
+ if (!window.parent) {
828
+ // can happen while parent iframe reloads
829
+ return;
830
+ }
831
831
  if (!opened) {
832
832
  return;
833
833
  }
@@ -882,7 +882,7 @@ const disableAnimations = () => {
882
882
 
883
883
  const renderToolbarAnimationSetting = () => {
884
884
  const animCheckbox = document.querySelector("#toggle_anims");
885
- E(() => {
885
+ m(() => {
886
886
  const animationsEnabled = animationsEnabledSignal.value;
887
887
  animCheckbox.checked = animationsEnabled;
888
888
  });
@@ -945,7 +945,7 @@ const renderToolbarAutoreloadSetting = () => {
945
945
  return;
946
946
  }
947
947
  const autoreloadCheckbox = document.querySelector("#toggle_autoreload");
948
- E(() => {
948
+ m(() => {
949
949
  const autoreloadEnabled = autoreloadEnabledSignal.value;
950
950
  if (autoreloadEnabled) {
951
951
  autoreloadCheckbox.checked = true;
@@ -1005,11 +1005,11 @@ const disableAutoreloadSetting = () => {
1005
1005
 
1006
1006
  const notifCheckbox = document.querySelector("#toggle_notifs");
1007
1007
  const renderToolbarNotificationSetting = () => {
1008
- E(() => {
1008
+ m(() => {
1009
1009
  const notificationsEnabled = notificationsEnabledSignal.value;
1010
1010
  notifCheckbox.checked = notificationsEnabled;
1011
1011
  });
1012
- E(() => {
1012
+ m(() => {
1013
1013
  const notificationPermission = notificationPermissionSignal.value;
1014
1014
  if (!notificationAPIDetected) {
1015
1015
  applyNotificationNotAvailableEffects();
@@ -1071,7 +1071,7 @@ const applyNotificationNOTGrantedEffects = () => {
1071
1071
  };
1072
1072
  };
1073
1073
 
1074
- const ribbonDisplayedSignal = d(typeof stateFromLocalStorage.ribbonDisplayed === "boolean" ? stateFromLocalStorage.ribbonDisplayed : true);
1074
+ const ribbonDisplayedSignal = v(typeof stateFromLocalStorage.ribbonDisplayed === "boolean" ? stateFromLocalStorage.ribbonDisplayed : true);
1075
1075
 
1076
1076
  const ribbonBox = document.querySelector("#ribbon_box");
1077
1077
  const ribbonCheckbox = ribbonBox.querySelector("input");
@@ -1079,7 +1079,7 @@ const renderToolbarRibbonSetting = () => {
1079
1079
  const ribbonContainer = window.parent.document.querySelector("#jsenv_ribbon_container");
1080
1080
  if (ribbonContainer) {
1081
1081
  ribbonBox.style.display = "block";
1082
- E(() => {
1082
+ m(() => {
1083
1083
  const ribbonDisplayed = ribbonDisplayedSignal.value;
1084
1084
  ribbonCheckbox.checked = ribbonDisplayed;
1085
1085
  if (ribbonDisplayed) {
@@ -1098,7 +1098,7 @@ const renderToolbarRibbonSetting = () => {
1098
1098
  }
1099
1099
  };
1100
1100
 
1101
- const themeSignal = d(typeof stateFromLocalStorage.theme === "string" ? stateFromLocalStorage.theme : typeof paramsFromParentWindow.theme === "string" ? paramsFromParentWindow.theme : "dark");
1101
+ const themeSignal = v(typeof stateFromLocalStorage.theme === "string" ? stateFromLocalStorage.theme : typeof paramsFromParentWindow.theme === "string" ? paramsFromParentWindow.theme : "dark");
1102
1102
 
1103
1103
  const switchToLightTheme = () => {
1104
1104
  themeSignal.value = "light";
@@ -1128,7 +1128,7 @@ const renderToolbarSettings = () => {
1128
1128
  renderToolbarNotificationSetting();
1129
1129
  renderToolbarThemeSetting();
1130
1130
  renderToolbarRibbonSetting();
1131
- E(() => {
1131
+ m(() => {
1132
1132
  const settingsOpened = settingsOpenedSignal.value;
1133
1133
  if (settingsOpened) {
1134
1134
  activateToolbarSection(document.querySelector("#settings"));
@@ -1176,14 +1176,14 @@ addExternalCommandCallback("initToolbar", () => {
1176
1176
  });
1177
1177
  sendEventToParent("toolbar_ready");
1178
1178
 
1179
- E(() => {
1179
+ m(() => {
1180
1180
  const serverConnection = serverConnectionSignal.value;
1181
1181
  if (serverConnection === "connecting" || serverConnection === "closed") {
1182
1182
  openServerTooltip();
1183
1183
  }
1184
1184
  });
1185
1185
 
1186
- E(() => {
1186
+ m(() => {
1187
1187
  const theme = themeSignal.value;
1188
1188
  document.querySelector("html").setAttribute("data-theme", theme);
1189
1189
  });
@@ -1191,7 +1191,7 @@ E(() => {
1191
1191
  addExternalCommandCallback("openToolbar", openToolbar);
1192
1192
  addExternalCommandCallback("closeToolbar", closeToolbar);
1193
1193
 
1194
- const toolbarStateSignal = w(() => {
1194
+ const toolbarStateSignal = b(() => {
1195
1195
  const opened = openedSignal.value;
1196
1196
  const theme = themeSignal.value;
1197
1197
  const animationsEnabled = animationsEnabledSignal.value;
@@ -1206,7 +1206,7 @@ const toolbarStateSignal = w(() => {
1206
1206
  };
1207
1207
  });
1208
1208
 
1209
- E(() => {
1209
+ m(() => {
1210
1210
  const toolbarState = toolbarStateSignal.value;
1211
1211
  localStorage.setItem("jsenv_toolbar", JSON.stringify(toolbarState));
1212
1212
  sendEventToParent("toolbar_state_change", toolbarState);
@@ -1,6 +1,6 @@
1
1
  var n$1,
2
2
  u$2;
3
- function k$2(n) {
3
+ function k$1(n) {
4
4
  return n.children;
5
5
  }
6
6
  n$1 = {
@@ -20,7 +20,7 @@ n$1 = {
20
20
  };
21
21
 
22
22
  var t$1,
23
- r$1,
23
+ r,
24
24
  u$1,
25
25
  i$1,
26
26
  o$1 = Object.is,
@@ -28,59 +28,20 @@ var t$1,
28
28
  c$1 = [],
29
29
  e$1 = n$1,
30
30
  a$1 = e$1.__b,
31
- v$2 = e$1.__r,
31
+ v$1 = e$1.__r,
32
32
  l$1 = e$1.diffed,
33
- m = e$1.__c,
33
+ m$2 = e$1.__c,
34
34
  s$1 = e$1.unmount,
35
- p$2 = e$1.__;
35
+ p$1 = e$1.__;
36
36
  function d$2(n, t) {
37
- e$1.__h && e$1.__h(r$1, n, f$1 || t), f$1 = 0;
38
- var u = r$1.__H || (r$1.__H = {
37
+ e$1.__h && e$1.__h(r, n, f$1 || t), f$1 = 0;
38
+ var u = r.__H || (r.__H = {
39
39
  __: [],
40
40
  __h: []
41
41
  });
42
42
  return n >= u.__.length && u.__.push({}), u.__[n];
43
43
  }
44
- function h$1(n) {
45
- return f$1 = 1, y$2(D, n);
46
- }
47
- function y$2(n, u, i) {
48
- var f = d$2(t$1++, 2);
49
- if (f.t = n, !f.__c && (f.__ = [D(void 0, u), function (n) {
50
- var t = f.__N ? f.__N[0] : f.__[0],
51
- r = f.t(t, n);
52
- o$1(t, r) || (f.__N = [r, f.__[1]], f.__c.setState({}));
53
- }], f.__c = r$1, !r$1.__f)) {
54
- var c = function (n, t, r) {
55
- if (!f.__c.__H) return true;
56
- var u = f.__c.__H.__.filter(function (n) {
57
- return !!n.__c;
58
- });
59
- if (u.every(function (n) {
60
- return !n.__N;
61
- })) return !e || e.call(this, n, t, r);
62
- var i = f.__c.props !== n;
63
- return u.forEach(function (n) {
64
- if (n.__N) {
65
- var t = n.__[0];
66
- n.__ = n.__N, n.__N = void 0, o$1(t, n.__[0]) || (i = true);
67
- }
68
- }), e && e.call(this, n, t, r) || i;
69
- };
70
- r$1.__f = true;
71
- var e = r$1.shouldComponentUpdate,
72
- a = r$1.componentWillUpdate;
73
- r$1.componentWillUpdate = function (n, t, r) {
74
- if (4 & this.__g) {
75
- var u = e;
76
- e = void 0, c(n, t, r), e = u;
77
- }
78
- a && a.call(this, n, t, r);
79
- }, r$1.shouldComponentUpdate = c;
80
- }
81
- return f.__N || f.__;
82
- }
83
- function q(n, r) {
44
+ function q$1(n, r) {
84
45
  var u = d$2(t$1++, 7);
85
46
  return C(u.__H, r) && (u.__ = n(), u.__H = r, u.__h = n), u.__;
86
47
  }
@@ -92,21 +53,21 @@ function g$2() {
92
53
  }
93
54
  }
94
55
  e$1.__b = function (n) {
95
- r$1 = null, a$1 && a$1(n);
56
+ r = null, a$1 && a$1(n);
96
57
  }, e$1.__ = function (n, t) {
97
- n && t.__k && t.__k.__m && (n.__m = t.__k.__m), p$2 && p$2(n, t);
58
+ n && t.__k && t.__k.__m && (n.__m = t.__k.__m), p$1 && p$1(n, t);
98
59
  }, e$1.__r = function (n) {
99
- v$2 && v$2(n), t$1 = 0;
100
- var i = (r$1 = n.__c).__H;
101
- i && (u$1 === r$1 ? (i.__h = [], r$1.__h = [], i.__.forEach(function (n) {
60
+ v$1 && v$1(n), t$1 = 0;
61
+ var i = (r = n.__c).__H;
62
+ i && (u$1 === r ? (i.__h = [], r.__h = [], i.__.forEach(function (n) {
102
63
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
103
- })) : (i.__h.forEach(z), i.__h.forEach(B), i.__h = [], t$1 = 0)), u$1 = r$1;
64
+ })) : (i.__h.forEach(z), i.__h.forEach(B), i.__h = [], t$1 = 0)), u$1 = r;
104
65
  }, e$1.diffed = function (n) {
105
66
  l$1 && l$1(n);
106
67
  var t = n.__c;
107
68
  t && t.__H && (t.__H.__h.length && (1 !== c$1.push(t) && i$1 === e$1.requestAnimationFrame || ((i$1 = e$1.requestAnimationFrame) || w$2)(g$2)), t.__H.__.forEach(function (n) {
108
69
  n.u && (n.__H = n.u), n.u = void 0;
109
- })), u$1 = r$1 = null;
70
+ })), u$1 = r = null;
110
71
  }, e$1.__c = function (n, t) {
111
72
  t.some(function (n) {
112
73
  try {
@@ -118,7 +79,7 @@ e$1.__b = function (n) {
118
79
  n.__h && (n.__h = []);
119
80
  }), t = [], e$1.__e(r, n.__v);
120
81
  }
121
- }), m && m(n, t);
82
+ }), m$2 && m$2(n, t);
122
83
  }, e$1.unmount = function (n) {
123
84
  s$1 && s$1(n);
124
85
  var t,
@@ -131,119 +92,116 @@ e$1.__b = function (n) {
131
92
  }
132
93
  }), r.__H = void 0, t && e$1.__e(t, r.__v));
133
94
  };
134
- var k$1 = "function" == typeof requestAnimationFrame;
95
+ var k = "function" == typeof requestAnimationFrame;
135
96
  function w$2(n) {
136
97
  var t,
137
98
  r = function () {
138
- clearTimeout(u), k$1 && cancelAnimationFrame(t), setTimeout(n);
99
+ clearTimeout(u), k && cancelAnimationFrame(t), setTimeout(n);
139
100
  },
140
101
  u = setTimeout(r, 35);
141
- k$1 && (t = requestAnimationFrame(r));
102
+ k && (t = requestAnimationFrame(r));
142
103
  }
143
104
  function z(n) {
144
- var t = r$1,
105
+ var t = r,
145
106
  u = n.__c;
146
- "function" == typeof u && (n.__c = void 0, u()), r$1 = t;
107
+ "function" == typeof u && (n.__c = void 0, u()), r = t;
147
108
  }
148
109
  function B(n) {
149
- var t = r$1;
150
- n.__c = n.__(), r$1 = t;
110
+ var t = r;
111
+ n.__c = n.__(), r = t;
151
112
  }
152
113
  function C(n, t) {
153
114
  return !n || n.length !== t.length || t.some(function (t, r) {
154
115
  return !o$1(t, n[r]);
155
116
  });
156
117
  }
157
- function D(n, t) {
158
- return "function" == typeof t ? t(n) : t;
159
- }
160
118
 
161
119
  const i = Symbol.for("preact-signals");
162
120
  function t() {
163
- if (r > 1) {
164
- r--;
121
+ if (f > 1) {
122
+ f--;
165
123
  return;
166
124
  }
167
125
  let i,
168
126
  t = false;
169
127
  while (void 0 !== s) {
170
- let o = s;
128
+ let n = s;
171
129
  s = void 0;
172
- f++;
173
- while (void 0 !== o) {
174
- const n = o.o;
175
- o.o = void 0;
176
- o.f &= -3;
177
- if (!(8 & o.f) && v$1(o)) try {
178
- o.c();
179
- } catch (o) {
130
+ e++;
131
+ while (void 0 !== n) {
132
+ const o = n.o;
133
+ n.o = void 0;
134
+ n.f &= -3;
135
+ if (!(8 & n.f) && l(n)) try {
136
+ n.c();
137
+ } catch (n) {
180
138
  if (!t) {
181
- i = o;
139
+ i = n;
182
140
  t = true;
183
141
  }
184
142
  }
185
- o = n;
143
+ n = o;
186
144
  }
187
145
  }
188
- f = 0;
189
- r--;
146
+ e = 0;
147
+ f--;
190
148
  if (t) throw i;
191
149
  }
192
- function o(i) {
193
- if (r > 0) return i();
194
- r++;
150
+ function n(i) {
151
+ if (f > 0) return i();
152
+ f++;
195
153
  try {
196
154
  return i();
197
155
  } finally {
198
156
  t();
199
157
  }
200
158
  }
201
- let n, s;
202
- function h(i) {
203
- const t = n;
204
- n = void 0;
159
+ let o, s;
160
+ function h$1(i) {
161
+ const t = o;
162
+ o = void 0;
205
163
  try {
206
164
  return i();
207
165
  } finally {
208
- n = t;
166
+ o = t;
209
167
  }
210
168
  }
211
- let r = 0,
212
- f = 0,
213
- e = 0;
214
- function u(i) {
215
- if (void 0 === n) return;
169
+ let f = 0,
170
+ e = 0,
171
+ u = 0;
172
+ function c(i) {
173
+ if (void 0 === o) return;
216
174
  let t = i.n;
217
- if (void 0 === t || t.t !== n) {
175
+ if (void 0 === t || t.t !== o) {
218
176
  t = {
219
177
  i: 0,
220
178
  S: i,
221
- p: n.s,
179
+ p: o.s,
222
180
  n: void 0,
223
- t: n,
181
+ t: o,
224
182
  e: void 0,
225
183
  x: void 0,
226
184
  r: t
227
185
  };
228
- if (void 0 !== n.s) n.s.n = t;
229
- n.s = t;
186
+ if (void 0 !== o.s) o.s.n = t;
187
+ o.s = t;
230
188
  i.n = t;
231
- if (32 & n.f) i.S(t);
189
+ if (32 & o.f) i.S(t);
232
190
  return t;
233
191
  } else if (-1 === t.i) {
234
192
  t.i = 0;
235
193
  if (void 0 !== t.n) {
236
194
  t.n.p = t.p;
237
195
  if (void 0 !== t.p) t.p.n = t.n;
238
- t.p = n.s;
196
+ t.p = o.s;
239
197
  t.n = void 0;
240
- n.s.n = t;
241
- n.s = t;
198
+ o.s.n = t;
199
+ o.s = t;
242
200
  }
243
201
  return t;
244
202
  }
245
203
  }
246
- function c(i, t) {
204
+ function d$1(i, t) {
247
205
  this.v = i;
248
206
  this.i = 0;
249
207
  this.n = void 0;
@@ -252,87 +210,87 @@ function c(i, t) {
252
210
  this.Z = null == t ? void 0 : t.unwatched;
253
211
  this.name = null == t ? void 0 : t.name;
254
212
  }
255
- c.prototype.brand = i;
256
- c.prototype.h = function () {
213
+ d$1.prototype.brand = i;
214
+ d$1.prototype.h = function () {
257
215
  return true;
258
216
  };
259
- c.prototype.S = function (i) {
217
+ d$1.prototype.S = function (i) {
260
218
  const t = this.t;
261
219
  if (t !== i && void 0 === i.e) {
262
220
  i.x = t;
263
221
  this.t = i;
264
- if (void 0 !== t) t.e = i;else h(() => {
222
+ if (void 0 !== t) t.e = i;else h$1(() => {
265
223
  var i;
266
224
  null == (i = this.W) || i.call(this);
267
225
  });
268
226
  }
269
227
  };
270
- c.prototype.U = function (i) {
228
+ d$1.prototype.U = function (i) {
271
229
  if (void 0 !== this.t) {
272
230
  const t = i.e,
273
- o = i.x;
231
+ n = i.x;
274
232
  if (void 0 !== t) {
275
- t.x = o;
233
+ t.x = n;
276
234
  i.e = void 0;
277
235
  }
278
- if (void 0 !== o) {
279
- o.e = t;
236
+ if (void 0 !== n) {
237
+ n.e = t;
280
238
  i.x = void 0;
281
239
  }
282
240
  if (i === this.t) {
283
- this.t = o;
284
- if (void 0 === o) h(() => {
241
+ this.t = n;
242
+ if (void 0 === n) h$1(() => {
285
243
  var i;
286
244
  null == (i = this.Z) || i.call(this);
287
245
  });
288
246
  }
289
247
  }
290
248
  };
291
- c.prototype.subscribe = function (i) {
292
- return E(() => {
249
+ d$1.prototype.subscribe = function (i) {
250
+ return m$1(() => {
293
251
  const t = this.value,
294
- o = n;
295
- n = void 0;
252
+ n = o;
253
+ o = void 0;
296
254
  try {
297
255
  i(t);
298
256
  } finally {
299
- n = o;
257
+ o = n;
300
258
  }
301
259
  }, {
302
260
  name: "sub"
303
261
  });
304
262
  };
305
- c.prototype.valueOf = function () {
263
+ d$1.prototype.valueOf = function () {
306
264
  return this.value;
307
265
  };
308
- c.prototype.toString = function () {
266
+ d$1.prototype.toString = function () {
309
267
  return this.value + "";
310
268
  };
311
- c.prototype.toJSON = function () {
269
+ d$1.prototype.toJSON = function () {
312
270
  return this.value;
313
271
  };
314
- c.prototype.peek = function () {
315
- const i = n;
316
- n = void 0;
272
+ d$1.prototype.peek = function () {
273
+ const i = o;
274
+ o = void 0;
317
275
  try {
318
276
  return this.value;
319
277
  } finally {
320
- n = i;
278
+ o = i;
321
279
  }
322
280
  };
323
- Object.defineProperty(c.prototype, "value", {
281
+ Object.defineProperty(d$1.prototype, "value", {
324
282
  get() {
325
- const i = u(this);
283
+ const i = c(this);
326
284
  if (void 0 !== i) i.i = this.i;
327
285
  return this.v;
328
286
  },
329
287
  set(i) {
330
288
  if (i !== this.v) {
331
- if (f > 100) throw new Error("Cycle detected");
289
+ if (e > 100) throw new Error("Cycle detected");
332
290
  this.v = i;
333
291
  this.i++;
334
- e++;
335
- r++;
292
+ u++;
293
+ f++;
336
294
  try {
337
295
  for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
338
296
  } finally {
@@ -341,17 +299,17 @@ Object.defineProperty(c.prototype, "value", {
341
299
  }
342
300
  }
343
301
  });
344
- function d$1(i, t) {
345
- return new c(i, t);
302
+ function v(i, t) {
303
+ return new d$1(i, t);
346
304
  }
347
- function v$1(i) {
305
+ function l(i) {
348
306
  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;
349
307
  return false;
350
308
  }
351
- function l(i) {
309
+ function y$1(i) {
352
310
  for (let t = i.s; void 0 !== t; t = t.n) {
353
- const o = t.S.n;
354
- if (void 0 !== o) t.r = o;
311
+ const n = t.S.n;
312
+ if (void 0 !== n) t.r = n;
355
313
  t.S.n = t;
356
314
  t.i = -1;
357
315
  if (void 0 === t.n) {
@@ -360,49 +318,49 @@ function l(i) {
360
318
  }
361
319
  }
362
320
  }
363
- function y$1(i) {
321
+ function a(i) {
364
322
  let t,
365
- o = i.s;
366
- while (void 0 !== o) {
367
- const i = o.p;
368
- if (-1 === o.i) {
369
- o.S.U(o);
370
- if (void 0 !== i) i.n = o.n;
371
- if (void 0 !== o.n) o.n.p = i;
372
- } else t = o;
373
- o.S.n = o.r;
374
- if (void 0 !== o.r) o.r = void 0;
375
- o = i;
323
+ n = i.s;
324
+ while (void 0 !== n) {
325
+ const i = n.p;
326
+ if (-1 === n.i) {
327
+ n.S.U(n);
328
+ if (void 0 !== i) i.n = n.n;
329
+ if (void 0 !== n.n) n.n.p = i;
330
+ } else t = n;
331
+ n.S.n = n.r;
332
+ if (void 0 !== n.r) n.r = void 0;
333
+ n = i;
376
334
  }
377
335
  i.s = t;
378
336
  }
379
- function a(i, t) {
380
- c.call(this, void 0);
337
+ function w$1(i, t) {
338
+ d$1.call(this, void 0);
381
339
  this.x = i;
382
340
  this.s = void 0;
383
- this.g = e - 1;
341
+ this.g = u - 1;
384
342
  this.f = 4;
385
343
  this.W = null == t ? void 0 : t.watched;
386
344
  this.Z = null == t ? void 0 : t.unwatched;
387
345
  this.name = null == t ? void 0 : t.name;
388
346
  }
389
- a.prototype = new c();
390
- a.prototype.h = function () {
347
+ w$1.prototype = new d$1();
348
+ w$1.prototype.h = function () {
391
349
  this.f &= -3;
392
350
  if (1 & this.f) return false;
393
351
  if (32 == (36 & this.f)) return true;
394
352
  this.f &= -5;
395
- if (this.g === e) return true;
396
- this.g = e;
353
+ if (this.g === u) return true;
354
+ this.g = u;
397
355
  this.f |= 1;
398
- if (this.i > 0 && !v$1(this)) {
356
+ if (this.i > 0 && !l(this)) {
399
357
  this.f &= -2;
400
358
  return true;
401
359
  }
402
- const i = n;
360
+ const i = o;
403
361
  try {
404
- l(this);
405
- n = this;
362
+ y$1(this);
363
+ o = this;
406
364
  const i = this.x();
407
365
  if (16 & this.f || this.v !== i || 0 === this.i) {
408
366
  this.v = i;
@@ -414,81 +372,81 @@ a.prototype.h = function () {
414
372
  this.f |= 16;
415
373
  this.i++;
416
374
  }
417
- n = i;
418
- y$1(this);
375
+ o = i;
376
+ a(this);
419
377
  this.f &= -2;
420
378
  return true;
421
379
  };
422
- a.prototype.S = function (i) {
380
+ w$1.prototype.S = function (i) {
423
381
  if (void 0 === this.t) {
424
382
  this.f |= 36;
425
383
  for (let i = this.s; void 0 !== i; i = i.n) i.S.S(i);
426
384
  }
427
- c.prototype.S.call(this, i);
385
+ d$1.prototype.S.call(this, i);
428
386
  };
429
- a.prototype.U = function (i) {
387
+ w$1.prototype.U = function (i) {
430
388
  if (void 0 !== this.t) {
431
- c.prototype.U.call(this, i);
389
+ d$1.prototype.U.call(this, i);
432
390
  if (void 0 === this.t) {
433
391
  this.f &= -33;
434
392
  for (let i = this.s; void 0 !== i; i = i.n) i.S.U(i);
435
393
  }
436
394
  }
437
395
  };
438
- a.prototype.N = function () {
396
+ w$1.prototype.N = function () {
439
397
  if (!(2 & this.f)) {
440
398
  this.f |= 6;
441
399
  for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
442
400
  }
443
401
  };
444
- Object.defineProperty(a.prototype, "value", {
402
+ Object.defineProperty(w$1.prototype, "value", {
445
403
  get() {
446
404
  if (1 & this.f) throw new Error("Cycle detected");
447
- const i = u(this);
405
+ const i = c(this);
448
406
  this.h();
449
407
  if (void 0 !== i) i.i = this.i;
450
408
  if (16 & this.f) throw this.v;
451
409
  return this.v;
452
410
  }
453
411
  });
454
- function w$1(i, t) {
455
- return new a(i, t);
412
+ function b$1(i, t) {
413
+ return new w$1(i, t);
456
414
  }
457
- function _(i) {
458
- const o = i.u;
415
+ function _$1(i) {
416
+ const n = i.u;
459
417
  i.u = void 0;
460
- if ("function" == typeof o) {
461
- r++;
462
- const s = n;
463
- n = void 0;
418
+ if ("function" == typeof n) {
419
+ f++;
420
+ const s = o;
421
+ o = void 0;
464
422
  try {
465
- o();
423
+ n();
466
424
  } catch (t) {
467
425
  i.f &= -2;
468
426
  i.f |= 8;
469
- b$1(i);
427
+ p(i);
470
428
  throw t;
471
429
  } finally {
472
- n = s;
430
+ o = s;
473
431
  t();
474
432
  }
475
433
  }
476
434
  }
477
- function b$1(i) {
435
+ function p(i) {
478
436
  for (let t = i.s; void 0 !== t; t = t.n) t.S.U(t);
479
437
  i.x = void 0;
480
438
  i.s = void 0;
481
- _(i);
439
+ _$1(i);
482
440
  }
483
441
  function g$1(i) {
484
- if (n !== this) throw new Error("Out-of-order effect");
485
- y$1(this);
486
- n = i;
442
+ if (o !== this) throw new Error("Out-of-order effect");
443
+ a(this);
444
+ o = i;
487
445
  this.f &= -2;
488
- if (8 & this.f) b$1(this);
446
+ if (8 & this.f) p(this);
489
447
  t();
490
448
  }
491
- function p$1(i, t) {
449
+ function S(i, t) {
492
450
  this.x = i;
493
451
  this.u = void 0;
494
452
  this.s = void 0;
@@ -496,7 +454,7 @@ function p$1(i, t) {
496
454
  this.f = 32;
497
455
  this.name = null == t ? void 0 : t.name;
498
456
  }
499
- p$1.prototype.c = function () {
457
+ S.prototype.c = function () {
500
458
  const i = this.S();
501
459
  try {
502
460
  if (8 & this.f) return;
@@ -507,77 +465,81 @@ p$1.prototype.c = function () {
507
465
  i();
508
466
  }
509
467
  };
510
- p$1.prototype.S = function () {
468
+ S.prototype.S = function () {
511
469
  if (1 & this.f) throw new Error("Cycle detected");
512
470
  this.f |= 1;
513
471
  this.f &= -9;
514
- _(this);
515
- l(this);
516
- r++;
517
- const i = n;
518
- n = this;
472
+ _$1(this);
473
+ y$1(this);
474
+ f++;
475
+ const i = o;
476
+ o = this;
519
477
  return g$1.bind(this, i);
520
478
  };
521
- p$1.prototype.N = function () {
479
+ S.prototype.N = function () {
522
480
  if (!(2 & this.f)) {
523
481
  this.f |= 2;
524
482
  this.o = s;
525
483
  s = this;
526
484
  }
527
485
  };
528
- p$1.prototype.d = function () {
486
+ S.prototype.d = function () {
529
487
  this.f |= 8;
530
- if (!(1 & this.f)) b$1(this);
488
+ if (!(1 & this.f)) p(this);
531
489
  };
532
- p$1.prototype.dispose = function () {
490
+ S.prototype.dispose = function () {
533
491
  this.d();
534
492
  };
535
- function E(i, t) {
536
- const o = new p$1(i, t);
493
+ function m$1(i, t) {
494
+ const n = new S(i, t);
537
495
  try {
538
- o.c();
496
+ n.c();
539
497
  } catch (i) {
540
- o.d();
498
+ n.d();
541
499
  throw i;
542
500
  }
543
- const n = o.d.bind(o);
544
- n[Symbol.dispose] = n;
545
- return n;
501
+ const o = n.d.bind(n);
502
+ o[Symbol.dispose] = o;
503
+ return o;
546
504
  }
547
505
 
548
506
  const d = "undefined" != typeof window && !!window.__PREACT_SIGNALS_DEVTOOLS__;
549
- let p,
550
- v,
551
- g = [];
552
- E(function () {
553
- p = this.N;
507
+ let h,
508
+ m,
509
+ _ = [];
510
+ m$1(function () {
511
+ h = this.N;
554
512
  })();
555
- function b(t, e) {
513
+ function g(t, e) {
556
514
  n$1[t] = e.bind(null, n$1[t] || (() => {}));
557
515
  }
558
- function y(t) {
559
- if (v) v();
560
- v = t && t.S();
516
+ function b(t) {
517
+ if (m) {
518
+ const t = m;
519
+ m = void 0;
520
+ t();
521
+ }
522
+ m = t && t.S();
561
523
  }
562
- function w({
524
+ function y({
563
525
  data: t
564
526
  }) {
565
527
  const i = useSignal(t);
566
528
  i.value = t;
567
- const [n, f] = q(() => {
529
+ const [n, f] = q$1(() => {
568
530
  let t = this,
569
531
  n = this.__v;
570
532
  while (n = n.__) if (n.__c) {
571
533
  n.__c.__$f |= 4;
572
534
  break;
573
535
  }
574
- const o = w$1(() => {
536
+ const o = b$1(() => {
575
537
  let t = i.value.value;
576
538
  return 0 === t ? 0 : true === t ? "" : t || "";
577
539
  }),
578
- f = w$1(() => !Array.isArray(o.value) && !u$2(o.value)),
579
- r = E(function () {
580
- this.N = M;
540
+ f = b$1(() => !Array.isArray(o.value) && !u$2(o.value)),
541
+ r = m$1(function () {
542
+ this.N = F;
581
543
  if (f.value) {
582
544
  const i = o.value;
583
545
  if (t.__v && t.__v.__e && 3 === t.__v.__e.nodeType) t.__v.__e.data = i;
@@ -592,15 +554,15 @@ function w({
592
554
  }, []);
593
555
  return n.value ? f.peek() : f.value;
594
556
  }
595
- w.displayName = "ReactiveTextNode";
596
- Object.defineProperties(c.prototype, {
557
+ y.displayName = "ReactiveTextNode";
558
+ Object.defineProperties(d$1.prototype, {
597
559
  constructor: {
598
560
  configurable: true,
599
561
  value: void 0
600
562
  },
601
563
  type: {
602
564
  configurable: true,
603
- value: w
565
+ value: y
604
566
  },
605
567
  props: {
606
568
  configurable: true,
@@ -615,14 +577,14 @@ Object.defineProperties(c.prototype, {
615
577
  value: 1
616
578
  }
617
579
  });
618
- b("__b", (t, i) => {
580
+ g("__b", (t, i) => {
619
581
  if ("string" == typeof i.type) {
620
582
  let t,
621
583
  e = i.props;
622
584
  for (let n in e) {
623
585
  if ("children" === n) continue;
624
586
  let o = e[n];
625
- if (o instanceof c) {
587
+ if (o instanceof d$1) {
626
588
  if (!t) i.__np = t = {};
627
589
  t[n] = o;
628
590
  e[n] = o.peek();
@@ -631,9 +593,10 @@ b("__b", (t, i) => {
631
593
  }
632
594
  t(i);
633
595
  });
634
- b("__r", (t, i) => {
635
- if (i.type !== k$2) {
636
- y();
596
+ g("__r", (t, i) => {
597
+ t(i);
598
+ if (i.type !== k$1) {
599
+ b();
637
600
  let t,
638
601
  e = i.__c;
639
602
  if (e) {
@@ -641,7 +604,7 @@ b("__r", (t, i) => {
641
604
  t = e.__$u;
642
605
  if (void 0 === t) e.__$u = t = function (t, i) {
643
606
  let e;
644
- E(function () {
607
+ m$1(function () {
645
608
  e = this;
646
609
  }, {
647
610
  name: i
@@ -655,16 +618,15 @@ b("__r", (t, i) => {
655
618
  e.setState({});
656
619
  }, "function" == typeof i.type ? i.type.displayName || i.type.name : "");
657
620
  }
658
- y(t);
621
+ b(t);
659
622
  }
660
- t(i);
661
623
  });
662
- b("__e", (t, i, e, n) => {
663
- y();
624
+ g("__e", (t, i, e, n) => {
625
+ b();
664
626
  t(i, e, n);
665
627
  });
666
- b("diffed", (t, i) => {
667
- y();
628
+ g("diffed", (t, i) => {
629
+ b();
668
630
  let e;
669
631
  if ("string" == typeof i.type && (e = i.__e)) {
670
632
  let t = i.__np,
@@ -685,33 +647,35 @@ b("diffed", (t, i) => {
685
647
  let f = i[o],
686
648
  r = t[o];
687
649
  if (void 0 === f) {
688
- f = k(e, o, r, n);
650
+ f = w(e, o, r);
689
651
  i[o] = f;
690
652
  } else f.o(r, n);
691
653
  }
654
+ for (let i in t) n[i] = t[i];
692
655
  }
693
656
  }
694
657
  t(i);
695
658
  });
696
- function k(t, i, e, n) {
659
+ function w(t, i, e, n) {
697
660
  const o = i in t && void 0 === t.ownerSVGElement,
698
- f = d$1(e);
661
+ f = v(e);
662
+ let r = e.peek();
699
663
  return {
700
664
  o: (t, i) => {
701
665
  f.value = t;
702
- n = i;
666
+ r = t.peek();
703
667
  },
704
- d: E(function () {
705
- this.N = M;
668
+ d: m$1(function () {
669
+ this.N = F;
706
670
  const e = f.value.value;
707
- if (n[i] !== e) {
708
- n[i] = e;
671
+ if (r !== e) {
672
+ r = void 0;
709
673
  if (o) t[i] = e;else if (null != e && (false !== e || "-" === i[4])) t.setAttribute(i, e);else t.removeAttribute(i);
710
- }
674
+ } else r = void 0;
711
675
  })
712
676
  };
713
677
  }
714
- b("unmount", (t, i) => {
678
+ g("unmount", (t, i) => {
715
679
  if ("string" == typeof i.type) {
716
680
  let t = i.__e;
717
681
  if (t) {
@@ -724,6 +688,7 @@ b("unmount", (t, i) => {
724
688
  }
725
689
  }
726
690
  }
691
+ i.__np = void 0;
727
692
  } else {
728
693
  let t = i.__c;
729
694
  if (t) {
@@ -736,26 +701,26 @@ b("unmount", (t, i) => {
736
701
  }
737
702
  t(i);
738
703
  });
739
- b("__h", (t, i, e, n) => {
704
+ g("__h", (t, i, e, n) => {
740
705
  if (n < 3 || 9 === n) i.__$f |= 2;
741
706
  t(i, e, n);
742
707
  });
743
708
  function useSignal(t, i) {
744
- return h$1(() => d$1(t, i))[0];
709
+ return q$1(() => v(t, i), []);
745
710
  }
746
- const A = t => {
711
+ const q = t => {
747
712
  queueMicrotask(() => {
748
713
  queueMicrotask(t);
749
714
  });
750
715
  };
751
- function F() {
752
- o(() => {
716
+ function x() {
717
+ n(() => {
753
718
  let t;
754
- while (t = g.shift()) p.call(t);
719
+ while (t = _.shift()) h.call(t);
755
720
  });
756
721
  }
757
- function M() {
758
- if (1 === g.push(this)) (n$1.requestAnimationFrame || A)(F);
722
+ function F() {
723
+ if (1 === _.push(this)) (n$1.requestAnimationFrame || q)(x);
759
724
  }
760
725
 
761
- export { E, d$1 as d, w$1 as w };
726
+ export { b$1 as b, m$1 as m, v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-toolbar",
3
- "version": "1.5.24",
3
+ "version": "1.5.26",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/jsenv/core",
@@ -28,14 +28,14 @@
28
28
  "prepublishOnly": "npm run build"
29
29
  },
30
30
  "dependencies": {
31
- "@jsenv/ast": "6.7.19"
31
+ "@jsenv/ast": "6.7.20"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@jsenv/core": "../../",
35
35
  "@jsenv/filesystem": "../../tooling/filesystem",
36
36
  "@jsenv/plugin-toolbar": "./",
37
37
  "@jsenv/utils": "../../tooling/utils",
38
- "@preact/signals": "2.6.2",
38
+ "@preact/signals": "2.8.1",
39
39
  "playwright": "1.58.1"
40
40
  },
41
41
  "publishConfig": {
@@ -17,15 +17,15 @@ export const renderToolbarOverlay = () => {
17
17
  };
18
18
 
19
19
  effect(() => {
20
- if (!window.parent) {
21
- // can happen while parent iframe reloads
22
- return;
23
- }
24
20
  const opened = openedSignal.value;
25
21
  const settingsOpened = settingsOpenedSignal.value;
26
22
  const executionTooltipOpened = executionTooltipOpenedSignal.value;
27
23
  const changesTooltipOpened = changesTooltipOpenedSignal.value;
28
24
  const serverTooltipOpened = serverTooltipOpenedSignal.value;
25
+ if (!window.parent) {
26
+ // can happen while parent iframe reloads
27
+ return;
28
+ }
29
29
  if (!opened) {
30
30
  return;
31
31
  }