@jsenv/plugin-toolbar 1.5.11 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/toolbar_core.js
CHANGED
|
@@ -313,24 +313,26 @@ const removeForceHideElement = element => {
|
|
|
313
313
|
element.removeAttribute("data-force-hide");
|
|
314
314
|
};
|
|
315
315
|
const setStyles = (element, styles) => {
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
});
|
|
316
|
+
const restoreCallbackSet = new Set();
|
|
317
|
+
for (const key of Object.keys(styles)) {
|
|
318
|
+
const inlineValue = element.style[key];
|
|
319
|
+
restoreCallbackSet.add(() => {
|
|
320
|
+
if (inlineValue === "") {
|
|
321
|
+
element.style.removeProperty(key);
|
|
322
|
+
} else {
|
|
323
|
+
element.style[key] = inlineValue;
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
for (const key of Object.keys(styles)) {
|
|
328
|
+
const value = styles[key];
|
|
329
|
+
element.style[key] = value;
|
|
330
|
+
}
|
|
332
331
|
return () => {
|
|
333
|
-
|
|
332
|
+
for (const restoreCallback of restoreCallbackSet) {
|
|
333
|
+
restoreCallback();
|
|
334
|
+
}
|
|
335
|
+
restoreCallbackSet.clear();
|
|
334
336
|
};
|
|
335
337
|
};
|
|
336
338
|
const activateToolbarSection = element => {
|
|
@@ -185,8 +185,8 @@ const appendIntoRespectingLineBreaksAndIndentation = (node, parentNode, {
|
|
|
185
185
|
parentNode.appendChild(document.createTextNode("\n".concat(indentMinusOne)));
|
|
186
186
|
};
|
|
187
187
|
const createToolbarTriggerNode = () => {
|
|
188
|
-
const css = /* css */"\n #jsenv_toolbar_trigger {\n display: block;\n overflow: hidden;\n position: fixed;\n z-index: 1000;\n bottom: -32px;\n right: 20px;\n height: 40px;\n width: 40px;\n padding: 0;\n margin: 0;\n border-radius: 5px 5px 0 0;\n border: 1px solid rgba(0, 0, 0, 0.33);\n border-bottom: none;\n box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.46);\n background: transparent;\n text-align: center;\n transition: 600ms;\n }\n\n #jsenv_toolbar_trigger:hover {\n cursor: pointer;\n }\n\n #jsenv_toolbar_trigger[data-expanded] {\n bottom: 0;\n }\n\n #jsenv_toolbar_trigger_icon {\n width: 35px;\n height: 35px;\n opacity: 0;\n transition: 600ms;\n }\n\n #jsenv_toolbar_trigger[data-expanded] #jsenv_toolbar_trigger_icon {\n opacity: 1;\n }";
|
|
189
|
-
const html = /* html */" <div
|
|
188
|
+
const css = /* css */"\n #jsenv_toolbar_trigger {\n display: block;\n overflow: hidden;\n position: fixed;\n z-index: 1000;\n bottom: -32px;\n right: 20px;\n height: 40px;\n width: 40px;\n padding: 0;\n margin: 0;\n border-radius: 5px 5px 0 0;\n border: 1px solid rgba(0, 0, 0, 0.33);\n border-bottom: none;\n box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.46);\n background: transparent;\n text-align: center;\n transition: 600ms;\n }\n\n #jsenv_toolbar_trigger:hover {\n cursor: pointer;\n }\n\n #jsenv_toolbar_trigger[data-expanded] {\n bottom: 0;\n }\n\n #jsenv_toolbar_trigger_icon {\n width: 35px;\n height: 35px;\n opacity: 0;\n transition: 600ms;\n }\n\n #jsenv_toolbar_trigger[data-expanded] #jsenv_toolbar_trigger_icon {\n opacity: 1;\n }\n ";
|
|
189
|
+
const html = /* html */" <div\n id=\"jsenv_toolbar_trigger\"\n style=\"display:none\"\n >\n <style>\n ".concat(css, "\n </style>\n <svg id=\"jsenv_toolbar_trigger_icon\">\n <use xlink:href=\"").concat(jsenvLogoSvgUrl, "#jsenv_logo\"></use>\n </svg>\n </div>");
|
|
190
190
|
class JsenvToolbarTriggerHtmlElement extends HTMLElement {
|
|
191
191
|
constructor() {
|
|
192
192
|
super();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/plugin-toolbar",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"prepublishOnly": "npm run build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@jsenv/ast": "6.7.
|
|
34
|
+
"@jsenv/ast": "6.7.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@preact/signals": "2.0.
|
|
37
|
+
"@preact/signals": "2.0.4",
|
|
38
38
|
"@jsenv/core": "../../",
|
|
39
39
|
"@jsenv/utils": "../../tooling/utils",
|
|
40
40
|
"@jsenv/filesystem": "../../tooling/filesystem",
|
|
41
41
|
"@jsenv/plugin-toolbar": "./",
|
|
42
|
-
"playwright": "1.
|
|
42
|
+
"playwright": "1.52.0"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -243,13 +243,19 @@ const createToolbarTriggerNode = () => {
|
|
|
243
243
|
|
|
244
244
|
#jsenv_toolbar_trigger[data-expanded] #jsenv_toolbar_trigger_icon {
|
|
245
245
|
opacity: 1;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
246
|
+
}
|
|
247
|
+
`;
|
|
248
|
+
const html = /* html */ ` <div
|
|
249
|
+
id="jsenv_toolbar_trigger"
|
|
250
|
+
style="display:none"
|
|
251
|
+
>
|
|
252
|
+
<style>
|
|
253
|
+
${css}
|
|
254
|
+
</style>
|
|
255
|
+
<svg id="jsenv_toolbar_trigger_icon">
|
|
256
|
+
<use xlink:href="${jsenvLogoSvgUrl}#jsenv_logo"></use>
|
|
257
|
+
</svg>
|
|
258
|
+
</div>`;
|
|
253
259
|
|
|
254
260
|
class JsenvToolbarTriggerHtmlElement extends HTMLElement {
|
|
255
261
|
constructor() {
|
|
@@ -12,26 +12,27 @@ export const removeForceHideElement = (element) => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const setStyles = (element, styles) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return restore;
|
|
32
|
-
});
|
|
15
|
+
const restoreCallbackSet = new Set();
|
|
16
|
+
|
|
17
|
+
for (const key of Object.keys(styles)) {
|
|
18
|
+
const inlineValue = element.style[key];
|
|
19
|
+
restoreCallbackSet.add(() => {
|
|
20
|
+
if (inlineValue === "") {
|
|
21
|
+
element.style.removeProperty(key);
|
|
22
|
+
} else {
|
|
23
|
+
element.style[key] = inlineValue;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
for (const key of Object.keys(styles)) {
|
|
28
|
+
const value = styles[key];
|
|
29
|
+
element.style[key] = value;
|
|
30
|
+
}
|
|
33
31
|
return () => {
|
|
34
|
-
|
|
32
|
+
for (const restoreCallback of restoreCallbackSet) {
|
|
33
|
+
restoreCallback();
|
|
34
|
+
}
|
|
35
|
+
restoreCallbackSet.clear();
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
38
|
|