@jsenv/plugin-toolbar 1.5.25 → 1.5.27

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.
@@ -118,7 +118,7 @@ input:focus-visible {
118
118
  @keyframes rotateLoader {
119
119
  0% {
120
120
  opacity: 1;
121
- transform: scaleX(-1)rotate(360deg);
121
+ transform: scaleX(-1) rotate(360deg);
122
122
  }
123
123
 
124
124
  50% {
@@ -127,7 +127,7 @@ input:focus-visible {
127
127
 
128
128
  100% {
129
129
  opacity: 1;
130
- transform: scaleX(-1)rotate(0);
130
+ transform: scaleX(-1) rotate(0);
131
131
  }
132
132
  }
133
133
 
@@ -1,4 +1,4 @@
1
- import { d, E, w } from "../jsenv_plugin_toolbar_node_modules.js";
1
+ import { a, C, g } 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 = a(typeof stateFromLocalStorage.animationsEnabled === "boolean" ? stateFromLocalStorage.animationsEnabled : typeof paramsFromParentWindow.animationsEnabled === "boolean" ? paramsFromParentWindow.animationsEnabled : false);
13
13
 
14
- E(() => {
14
+ C(() => {
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 = a(false);
24
+ const executionSignal = a({
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 = a(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 = a(typeof stateFromLocalStorage.notificationsEnabled === "boolean" ? stateFromLocalStorage.notificationsEnabled : typeof paramsFromParentWindow.notificationsEnabled === "boolean" ? paramsFromParentWindow.notificationsEnabled : false);
43
+ const notificationPermissionSignal = a(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
+ C(() => {
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
+ C(() => {
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
+ C(() => {
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 = a(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 = a(false);
180
+ const reloaderStatusSignal = a("idle");
181
+ const changesSignal = a(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
+ C(() => {
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
+ C(() => {
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
+ C(() => {
349
349
  const execution = executionSignal.value;
350
350
  updateExecutionIndicator(execution);
351
351
  });
352
- E(() => {
352
+ C(() => {
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 = a(false);
419
+ const serverConnectionSignal = a("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
+ C(() => {
441
441
  const serverConnection = serverConnectionSignal.value;
442
442
  updateServerIndicator(serverConnection);
443
443
  });
444
- E(() => {
444
+ C(() => {
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 = a(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
+ C(() => {
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 = a(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
+ C(() => {
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
+ C(() => {
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
+ C(() => {
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
+ C(() => {
1009
1009
  const notificationsEnabled = notificationsEnabledSignal.value;
1010
1010
  notifCheckbox.checked = notificationsEnabled;
1011
1011
  });
1012
- E(() => {
1012
+ C(() => {
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 = a(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
+ C(() => {
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 = a(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
+ C(() => {
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
+ C(() => {
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
+ C(() => {
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 = g(() => {
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
+ C(() => {
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 = {
@@ -24,65 +24,26 @@ var t$1,
24
24
  u$1,
25
25
  i$1,
26
26
  o$1 = Object.is,
27
- f$1 = 0,
27
+ f = 0,
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;
37
+ e$1.__h && e$1.__h(r$1, n, f || t), f = 0;
38
38
  var u = r$1.__H || (r$1.__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
- return C(u.__H, r) && (u.__ = n(), u.__H = r, u.__h = n), u.__;
46
+ return C$1(u.__H, r) && (u.__ = n(), u.__H = r, u.__h = n), u.__;
86
47
  }
87
48
  function g$2() {
88
49
  for (var n; n = c$1.shift();) if (n.__P && n.__H) try {
@@ -94,9 +55,9 @@ function g$2() {
94
55
  e$1.__b = function (n) {
95
56
  r$1 = 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;
60
+ v$1 && v$1(n), t$1 = 0;
100
61
  var i = (r$1 = n.__c).__H;
101
62
  i && (u$1 === r$1 ? (i.__h = [], r$1.__h = [], i.__.forEach(function (n) {
102
63
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
@@ -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,14 +92,14 @@ 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
105
  var t = r$1,
@@ -149,190 +110,211 @@ function B(n) {
149
110
  var t = r$1;
150
111
  n.__c = n.__(), r$1 = t;
151
112
  }
152
- function C(n, t) {
113
+ function C$1(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 (e > 1) {
122
+ e--;
165
123
  return;
166
124
  }
167
125
  let i,
168
126
  t = false;
127
+ !function () {
128
+ let i = r;
129
+ r = void 0;
130
+ while (void 0 !== i) {
131
+ if (i.S.v === i.v) i.S.i = i.i;
132
+ i = i.o;
133
+ }
134
+ }();
169
135
  while (void 0 !== s) {
170
- let o = s;
136
+ let n = s;
171
137
  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) {
138
+ u++;
139
+ while (void 0 !== n) {
140
+ const o = n.u;
141
+ n.u = void 0;
142
+ n.f &= -3;
143
+ if (!(8 & n.f) && w$1(n)) try {
144
+ n.c();
145
+ } catch (n) {
180
146
  if (!t) {
181
- i = o;
147
+ i = n;
182
148
  t = true;
183
149
  }
184
150
  }
185
- o = n;
151
+ n = o;
186
152
  }
187
153
  }
188
- f = 0;
189
- r--;
154
+ u = 0;
155
+ e--;
190
156
  if (t) throw i;
191
157
  }
192
- function o(i) {
193
- if (r > 0) return i();
194
- r++;
158
+ function n(i) {
159
+ if (e > 0) return i();
160
+ v = ++c;
161
+ e++;
195
162
  try {
196
163
  return i();
197
164
  } finally {
198
165
  t();
199
166
  }
200
167
  }
201
- let n, s;
202
- function h(i) {
203
- const t = n;
204
- n = void 0;
168
+ let o, s;
169
+ function h$1(i) {
170
+ const t = o;
171
+ o = void 0;
205
172
  try {
206
173
  return i();
207
174
  } finally {
208
- n = t;
175
+ o = t;
209
176
  }
210
177
  }
211
- let r = 0,
212
- f = 0,
213
- e = 0;
214
- function u(i) {
215
- if (void 0 === n) return;
178
+ let r,
179
+ e = 0,
180
+ u = 0,
181
+ c = 0,
182
+ v = 0,
183
+ d$1 = 0;
184
+ function l(i) {
185
+ if (void 0 === o) return;
216
186
  let t = i.n;
217
- if (void 0 === t || t.t !== n) {
187
+ if (void 0 === t || t.t !== o) {
218
188
  t = {
219
189
  i: 0,
220
190
  S: i,
221
- p: n.s,
191
+ p: o.s,
222
192
  n: void 0,
223
- t: n,
193
+ t: o,
224
194
  e: void 0,
225
195
  x: void 0,
226
196
  r: t
227
197
  };
228
- if (void 0 !== n.s) n.s.n = t;
229
- n.s = t;
198
+ if (void 0 !== o.s) o.s.n = t;
199
+ o.s = t;
230
200
  i.n = t;
231
- if (32 & n.f) i.S(t);
201
+ if (32 & o.f) i.S(t);
232
202
  return t;
233
203
  } else if (-1 === t.i) {
234
204
  t.i = 0;
235
205
  if (void 0 !== t.n) {
236
206
  t.n.p = t.p;
237
207
  if (void 0 !== t.p) t.p.n = t.n;
238
- t.p = n.s;
208
+ t.p = o.s;
239
209
  t.n = void 0;
240
- n.s.n = t;
241
- n.s = t;
210
+ o.s.n = t;
211
+ o.s = t;
242
212
  }
243
213
  return t;
244
214
  }
245
215
  }
246
- function c(i, t) {
216
+ function y$1(i, t) {
247
217
  this.v = i;
248
218
  this.i = 0;
249
219
  this.n = void 0;
250
220
  this.t = void 0;
221
+ this.l = 0;
251
222
  this.W = null == t ? void 0 : t.watched;
252
223
  this.Z = null == t ? void 0 : t.unwatched;
253
224
  this.name = null == t ? void 0 : t.name;
254
225
  }
255
- c.prototype.brand = i;
256
- c.prototype.h = function () {
226
+ y$1.prototype.brand = i;
227
+ y$1.prototype.h = function () {
257
228
  return true;
258
229
  };
259
- c.prototype.S = function (i) {
230
+ y$1.prototype.S = function (i) {
260
231
  const t = this.t;
261
232
  if (t !== i && void 0 === i.e) {
262
233
  i.x = t;
263
234
  this.t = i;
264
- if (void 0 !== t) t.e = i;else h(() => {
235
+ if (void 0 !== t) t.e = i;else h$1(() => {
265
236
  var i;
266
237
  null == (i = this.W) || i.call(this);
267
238
  });
268
239
  }
269
240
  };
270
- c.prototype.U = function (i) {
241
+ y$1.prototype.U = function (i) {
271
242
  if (void 0 !== this.t) {
272
243
  const t = i.e,
273
- o = i.x;
244
+ n = i.x;
274
245
  if (void 0 !== t) {
275
- t.x = o;
246
+ t.x = n;
276
247
  i.e = void 0;
277
248
  }
278
- if (void 0 !== o) {
279
- o.e = t;
249
+ if (void 0 !== n) {
250
+ n.e = t;
280
251
  i.x = void 0;
281
252
  }
282
253
  if (i === this.t) {
283
- this.t = o;
284
- if (void 0 === o) h(() => {
254
+ this.t = n;
255
+ if (void 0 === n) h$1(() => {
285
256
  var i;
286
257
  null == (i = this.Z) || i.call(this);
287
258
  });
288
259
  }
289
260
  }
290
261
  };
291
- c.prototype.subscribe = function (i) {
292
- return E(() => {
262
+ y$1.prototype.subscribe = function (i) {
263
+ return C(() => {
293
264
  const t = this.value,
294
- o = n;
295
- n = void 0;
265
+ n = o;
266
+ o = void 0;
296
267
  try {
297
268
  i(t);
298
269
  } finally {
299
- n = o;
270
+ o = n;
300
271
  }
301
272
  }, {
302
273
  name: "sub"
303
274
  });
304
275
  };
305
- c.prototype.valueOf = function () {
276
+ y$1.prototype.valueOf = function () {
306
277
  return this.value;
307
278
  };
308
- c.prototype.toString = function () {
279
+ y$1.prototype.toString = function () {
309
280
  return this.value + "";
310
281
  };
311
- c.prototype.toJSON = function () {
282
+ y$1.prototype.toJSON = function () {
312
283
  return this.value;
313
284
  };
314
- c.prototype.peek = function () {
315
- const i = n;
316
- n = void 0;
285
+ y$1.prototype.peek = function () {
286
+ const i = o;
287
+ o = void 0;
317
288
  try {
318
289
  return this.value;
319
290
  } finally {
320
- n = i;
291
+ o = i;
321
292
  }
322
293
  };
323
- Object.defineProperty(c.prototype, "value", {
294
+ Object.defineProperty(y$1.prototype, "value", {
324
295
  get() {
325
- const i = u(this);
296
+ const i = l(this);
326
297
  if (void 0 !== i) i.i = this.i;
327
298
  return this.v;
328
299
  },
329
300
  set(i) {
330
301
  if (i !== this.v) {
331
- if (f > 100) throw new Error("Cycle detected");
302
+ if (u > 100) throw new Error("Cycle detected");
303
+ !function (i) {
304
+ if (0 !== e && 0 === u) if (i.l !== v) {
305
+ i.l = v;
306
+ r = {
307
+ S: i,
308
+ v: i.v,
309
+ i: i.i,
310
+ o: r
311
+ };
312
+ }
313
+ }(this);
332
314
  this.v = i;
333
315
  this.i++;
316
+ d$1++;
334
317
  e++;
335
- r++;
336
318
  try {
337
319
  for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
338
320
  } finally {
@@ -341,17 +323,17 @@ Object.defineProperty(c.prototype, "value", {
341
323
  }
342
324
  }
343
325
  });
344
- function d$1(i, t) {
345
- return new c(i, t);
326
+ function a(i, t) {
327
+ return new y$1(i, t);
346
328
  }
347
- function v$1(i) {
329
+ function w$1(i) {
348
330
  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
331
  return false;
350
332
  }
351
- function l(i) {
333
+ function _$1(i) {
352
334
  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;
335
+ const n = t.S.n;
336
+ if (void 0 !== n) t.r = n;
355
337
  t.S.n = t;
356
338
  t.i = -1;
357
339
  if (void 0 === t.n) {
@@ -360,49 +342,49 @@ function l(i) {
360
342
  }
361
343
  }
362
344
  }
363
- function y$1(i) {
345
+ function b$1(i) {
364
346
  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;
347
+ n = i.s;
348
+ while (void 0 !== n) {
349
+ const i = n.p;
350
+ if (-1 === n.i) {
351
+ n.S.U(n);
352
+ if (void 0 !== i) i.n = n.n;
353
+ if (void 0 !== n.n) n.n.p = i;
354
+ } else t = n;
355
+ n.S.n = n.r;
356
+ if (void 0 !== n.r) n.r = void 0;
357
+ n = i;
376
358
  }
377
359
  i.s = t;
378
360
  }
379
- function a(i, t) {
380
- c.call(this, void 0);
361
+ function p(i, t) {
362
+ y$1.call(this, void 0);
381
363
  this.x = i;
382
364
  this.s = void 0;
383
- this.g = e - 1;
365
+ this.g = d$1 - 1;
384
366
  this.f = 4;
385
367
  this.W = null == t ? void 0 : t.watched;
386
368
  this.Z = null == t ? void 0 : t.unwatched;
387
369
  this.name = null == t ? void 0 : t.name;
388
370
  }
389
- a.prototype = new c();
390
- a.prototype.h = function () {
371
+ p.prototype = new y$1();
372
+ p.prototype.h = function () {
391
373
  this.f &= -3;
392
374
  if (1 & this.f) return false;
393
375
  if (32 == (36 & this.f)) return true;
394
376
  this.f &= -5;
395
- if (this.g === e) return true;
396
- this.g = e;
377
+ if (this.g === d$1) return true;
378
+ this.g = d$1;
397
379
  this.f |= 1;
398
- if (this.i > 0 && !v$1(this)) {
380
+ if (this.i > 0 && !w$1(this)) {
399
381
  this.f &= -2;
400
382
  return true;
401
383
  }
402
- const i = n;
384
+ const i = o;
403
385
  try {
404
- l(this);
405
- n = this;
386
+ _$1(this);
387
+ o = this;
406
388
  const i = this.x();
407
389
  if (16 & this.f || this.v !== i || 0 === this.i) {
408
390
  this.v = i;
@@ -414,170 +396,174 @@ a.prototype.h = function () {
414
396
  this.f |= 16;
415
397
  this.i++;
416
398
  }
417
- n = i;
418
- y$1(this);
399
+ o = i;
400
+ b$1(this);
419
401
  this.f &= -2;
420
402
  return true;
421
403
  };
422
- a.prototype.S = function (i) {
404
+ p.prototype.S = function (i) {
423
405
  if (void 0 === this.t) {
424
406
  this.f |= 36;
425
407
  for (let i = this.s; void 0 !== i; i = i.n) i.S.S(i);
426
408
  }
427
- c.prototype.S.call(this, i);
409
+ y$1.prototype.S.call(this, i);
428
410
  };
429
- a.prototype.U = function (i) {
411
+ p.prototype.U = function (i) {
430
412
  if (void 0 !== this.t) {
431
- c.prototype.U.call(this, i);
413
+ y$1.prototype.U.call(this, i);
432
414
  if (void 0 === this.t) {
433
415
  this.f &= -33;
434
416
  for (let i = this.s; void 0 !== i; i = i.n) i.S.U(i);
435
417
  }
436
418
  }
437
419
  };
438
- a.prototype.N = function () {
420
+ p.prototype.N = function () {
439
421
  if (!(2 & this.f)) {
440
422
  this.f |= 6;
441
423
  for (let i = this.t; void 0 !== i; i = i.x) i.t.N();
442
424
  }
443
425
  };
444
- Object.defineProperty(a.prototype, "value", {
426
+ Object.defineProperty(p.prototype, "value", {
445
427
  get() {
446
428
  if (1 & this.f) throw new Error("Cycle detected");
447
- const i = u(this);
429
+ const i = l(this);
448
430
  this.h();
449
431
  if (void 0 !== i) i.i = this.i;
450
432
  if (16 & this.f) throw this.v;
451
433
  return this.v;
452
434
  }
453
435
  });
454
- function w$1(i, t) {
455
- return new a(i, t);
456
- }
457
- function _(i) {
458
- const o = i.u;
459
- i.u = void 0;
460
- if ("function" == typeof o) {
461
- r++;
462
- const s = n;
463
- n = void 0;
436
+ function g$1(i, t) {
437
+ return new p(i, t);
438
+ }
439
+ function S(i) {
440
+ const n = i.m;
441
+ i.m = void 0;
442
+ if ("function" == typeof n) {
443
+ e++;
444
+ const s = o;
445
+ o = void 0;
464
446
  try {
465
- o();
447
+ n();
466
448
  } catch (t) {
467
449
  i.f &= -2;
468
450
  i.f |= 8;
469
- b$1(i);
451
+ m$1(i);
470
452
  throw t;
471
453
  } finally {
472
- n = s;
454
+ o = s;
473
455
  t();
474
456
  }
475
457
  }
476
458
  }
477
- function b$1(i) {
459
+ function m$1(i) {
478
460
  for (let t = i.s; void 0 !== t; t = t.n) t.S.U(t);
479
461
  i.x = void 0;
480
462
  i.s = void 0;
481
- _(i);
463
+ S(i);
482
464
  }
483
- function g$1(i) {
484
- if (n !== this) throw new Error("Out-of-order effect");
485
- y$1(this);
486
- n = i;
465
+ function x$1(i) {
466
+ if (o !== this) throw new Error("Out-of-order effect");
467
+ b$1(this);
468
+ o = i;
487
469
  this.f &= -2;
488
- if (8 & this.f) b$1(this);
470
+ if (8 & this.f) m$1(this);
489
471
  t();
490
472
  }
491
- function p$1(i, t) {
473
+ function E(i, t) {
492
474
  this.x = i;
493
- this.u = void 0;
475
+ this.m = void 0;
494
476
  this.s = void 0;
495
- this.o = void 0;
477
+ this.u = void 0;
496
478
  this.f = 32;
497
479
  this.name = null == t ? void 0 : t.name;
498
480
  }
499
- p$1.prototype.c = function () {
481
+ E.prototype.c = function () {
500
482
  const i = this.S();
501
483
  try {
502
484
  if (8 & this.f) return;
503
485
  if (void 0 === this.x) return;
504
486
  const t = this.x();
505
- if ("function" == typeof t) this.u = t;
487
+ if ("function" == typeof t) this.m = t;
506
488
  } finally {
507
489
  i();
508
490
  }
509
491
  };
510
- p$1.prototype.S = function () {
492
+ E.prototype.S = function () {
511
493
  if (1 & this.f) throw new Error("Cycle detected");
512
494
  this.f |= 1;
513
495
  this.f &= -9;
514
- _(this);
515
- l(this);
516
- r++;
517
- const i = n;
518
- n = this;
519
- return g$1.bind(this, i);
496
+ S(this);
497
+ _$1(this);
498
+ e++;
499
+ const i = o;
500
+ o = this;
501
+ return x$1.bind(this, i);
520
502
  };
521
- p$1.prototype.N = function () {
503
+ E.prototype.N = function () {
522
504
  if (!(2 & this.f)) {
523
505
  this.f |= 2;
524
- this.o = s;
506
+ this.u = s;
525
507
  s = this;
526
508
  }
527
509
  };
528
- p$1.prototype.d = function () {
510
+ E.prototype.d = function () {
529
511
  this.f |= 8;
530
- if (!(1 & this.f)) b$1(this);
512
+ if (!(1 & this.f)) m$1(this);
531
513
  };
532
- p$1.prototype.dispose = function () {
514
+ E.prototype.dispose = function () {
533
515
  this.d();
534
516
  };
535
- function E(i, t) {
536
- const o = new p$1(i, t);
517
+ function C(i, t) {
518
+ const n = new E(i, t);
537
519
  try {
538
- o.c();
520
+ n.c();
539
521
  } catch (i) {
540
- o.d();
522
+ n.d();
541
523
  throw i;
542
524
  }
543
- const n = o.d.bind(o);
544
- n[Symbol.dispose] = n;
545
- return n;
525
+ const o = n.d.bind(n);
526
+ o[Symbol.dispose] = o;
527
+ return o;
546
528
  }
547
529
 
548
530
  const d = "undefined" != typeof window && !!window.__PREACT_SIGNALS_DEVTOOLS__;
549
- let p,
550
- v,
551
- g = [];
552
- E(function () {
553
- p = this.N;
531
+ let h,
532
+ m,
533
+ _ = [];
534
+ C(function () {
535
+ h = this.N;
554
536
  })();
555
- function b(t, e) {
537
+ function g(t, e) {
556
538
  n$1[t] = e.bind(null, n$1[t] || (() => {}));
557
539
  }
558
- function y(t) {
559
- if (v) v();
560
- v = t && t.S();
540
+ function b(t) {
541
+ if (m) {
542
+ const t = m;
543
+ m = void 0;
544
+ t();
545
+ }
546
+ m = t && t.S();
561
547
  }
562
- function w({
548
+ function y({
563
549
  data: t
564
550
  }) {
565
551
  const i = useSignal(t);
566
552
  i.value = t;
567
- const [n, f] = q(() => {
553
+ const [n, f] = q$1(() => {
568
554
  let t = this,
569
555
  n = this.__v;
570
556
  while (n = n.__) if (n.__c) {
571
557
  n.__c.__$f |= 4;
572
558
  break;
573
559
  }
574
- const o = w$1(() => {
560
+ const o = g$1(() => {
575
561
  let t = i.value.value;
576
562
  return 0 === t ? 0 : true === t ? "" : t || "";
577
563
  }),
578
- f = w$1(() => !Array.isArray(o.value) && !u$2(o.value)),
579
- r = E(function () {
580
- this.N = M;
564
+ f = g$1(() => !Array.isArray(o.value) && !u$2(o.value)),
565
+ r = C(function () {
566
+ this.N = F;
581
567
  if (f.value) {
582
568
  const i = o.value;
583
569
  if (t.__v && t.__v.__e && 3 === t.__v.__e.nodeType) t.__v.__e.data = i;
@@ -592,15 +578,15 @@ function w({
592
578
  }, []);
593
579
  return n.value ? f.peek() : f.value;
594
580
  }
595
- w.displayName = "ReactiveTextNode";
596
- Object.defineProperties(c.prototype, {
581
+ y.displayName = "ReactiveTextNode";
582
+ Object.defineProperties(y$1.prototype, {
597
583
  constructor: {
598
584
  configurable: true,
599
585
  value: void 0
600
586
  },
601
587
  type: {
602
588
  configurable: true,
603
- value: w
589
+ value: y
604
590
  },
605
591
  props: {
606
592
  configurable: true,
@@ -615,14 +601,14 @@ Object.defineProperties(c.prototype, {
615
601
  value: 1
616
602
  }
617
603
  });
618
- b("__b", (t, i) => {
604
+ g("__b", (t, i) => {
619
605
  if ("string" == typeof i.type) {
620
606
  let t,
621
607
  e = i.props;
622
608
  for (let n in e) {
623
609
  if ("children" === n) continue;
624
610
  let o = e[n];
625
- if (o instanceof c) {
611
+ if (o instanceof y$1) {
626
612
  if (!t) i.__np = t = {};
627
613
  t[n] = o;
628
614
  e[n] = o.peek();
@@ -631,9 +617,10 @@ b("__b", (t, i) => {
631
617
  }
632
618
  t(i);
633
619
  });
634
- b("__r", (t, i) => {
635
- if (i.type !== k$2) {
636
- y();
620
+ g("__r", (t, i) => {
621
+ t(i);
622
+ if (i.type !== k$1) {
623
+ b();
637
624
  let t,
638
625
  e = i.__c;
639
626
  if (e) {
@@ -641,7 +628,7 @@ b("__r", (t, i) => {
641
628
  t = e.__$u;
642
629
  if (void 0 === t) e.__$u = t = function (t, i) {
643
630
  let e;
644
- E(function () {
631
+ C(function () {
645
632
  e = this;
646
633
  }, {
647
634
  name: i
@@ -655,16 +642,15 @@ b("__r", (t, i) => {
655
642
  e.setState({});
656
643
  }, "function" == typeof i.type ? i.type.displayName || i.type.name : "");
657
644
  }
658
- y(t);
645
+ b(t);
659
646
  }
660
- t(i);
661
647
  });
662
- b("__e", (t, i, e, n) => {
663
- y();
648
+ g("__e", (t, i, e, n) => {
649
+ b();
664
650
  t(i, e, n);
665
651
  });
666
- b("diffed", (t, i) => {
667
- y();
652
+ g("diffed", (t, i) => {
653
+ b();
668
654
  let e;
669
655
  if ("string" == typeof i.type && (e = i.__e)) {
670
656
  let t = i.__np,
@@ -685,33 +671,35 @@ b("diffed", (t, i) => {
685
671
  let f = i[o],
686
672
  r = t[o];
687
673
  if (void 0 === f) {
688
- f = k(e, o, r, n);
674
+ f = w(e, o, r);
689
675
  i[o] = f;
690
676
  } else f.o(r, n);
691
677
  }
678
+ for (let i in t) n[i] = t[i];
692
679
  }
693
680
  }
694
681
  t(i);
695
682
  });
696
- function k(t, i, e, n) {
683
+ function w(t, i, e, n) {
697
684
  const o = i in t && void 0 === t.ownerSVGElement,
698
- f = d$1(e);
685
+ f = a(e);
686
+ let r = e.peek();
699
687
  return {
700
688
  o: (t, i) => {
701
689
  f.value = t;
702
- n = i;
690
+ r = t.peek();
703
691
  },
704
- d: E(function () {
705
- this.N = M;
692
+ d: C(function () {
693
+ this.N = F;
706
694
  const e = f.value.value;
707
- if (n[i] !== e) {
708
- n[i] = e;
695
+ if (r !== e) {
696
+ r = void 0;
709
697
  if (o) t[i] = e;else if (null != e && (false !== e || "-" === i[4])) t.setAttribute(i, e);else t.removeAttribute(i);
710
- }
698
+ } else r = void 0;
711
699
  })
712
700
  };
713
701
  }
714
- b("unmount", (t, i) => {
702
+ g("unmount", (t, i) => {
715
703
  if ("string" == typeof i.type) {
716
704
  let t = i.__e;
717
705
  if (t) {
@@ -724,6 +712,7 @@ b("unmount", (t, i) => {
724
712
  }
725
713
  }
726
714
  }
715
+ i.__np = void 0;
727
716
  } else {
728
717
  let t = i.__c;
729
718
  if (t) {
@@ -736,26 +725,26 @@ b("unmount", (t, i) => {
736
725
  }
737
726
  t(i);
738
727
  });
739
- b("__h", (t, i, e, n) => {
728
+ g("__h", (t, i, e, n) => {
740
729
  if (n < 3 || 9 === n) i.__$f |= 2;
741
730
  t(i, e, n);
742
731
  });
743
732
  function useSignal(t, i) {
744
- return h$1(() => d$1(t, i))[0];
733
+ return q$1(() => a(t, i), []);
745
734
  }
746
- const A = t => {
735
+ const q = t => {
747
736
  queueMicrotask(() => {
748
737
  queueMicrotask(t);
749
738
  });
750
739
  };
751
- function F() {
752
- o(() => {
740
+ function x() {
741
+ n(() => {
753
742
  let t;
754
- while (t = g.shift()) p.call(t);
743
+ while (t = _.shift()) h.call(t);
755
744
  });
756
745
  }
757
- function M() {
758
- if (1 === g.push(this)) (n$1.requestAnimationFrame || A)(F);
746
+ function F() {
747
+ if (1 === _.push(this)) (n$1.requestAnimationFrame || q)(x);
759
748
  }
760
749
 
761
- export { E, d$1 as d, w$1 as w };
750
+ export { C, a, g$1 as g };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-toolbar",
3
- "version": "1.5.25",
3
+ "version": "1.5.27",
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.20"
31
+ "@jsenv/ast": "6.7.21"
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
  }