@jsenv/plugin-toolbar 1.2.13 → 1.2.15
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/jsenv_plugin_toolbar.js +5 -2
- package/package.json +2 -2
- package/src/client/core/animation_signals.js +2 -2
- package/src/client/core/notification_signals.js +2 -2
- package/src/client/core/theme_signals.js +2 -2
- package/src/client/core/toolbar_open_signals.js +2 -2
- package/src/jsenv_plugin_toolbar.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseHtml, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, stringifyHtmlAst } from "@jsenv/ast";
|
|
2
2
|
|
|
3
3
|
const jsenvPluginToolbar = ({
|
|
4
4
|
logLevel = "warn",
|
|
@@ -21,7 +21,10 @@ const jsenvPluginToolbar = ({
|
|
|
21
21
|
if (urlInfo.url.startsWith(toolbarHtmlClientFileUrl)) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
const htmlAst =
|
|
24
|
+
const htmlAst = parseHtml({
|
|
25
|
+
html: urlInfo.content,
|
|
26
|
+
url: urlInfo.url
|
|
27
|
+
});
|
|
25
28
|
const toolbarInjectorReference = urlInfo.dependencies.inject({
|
|
26
29
|
type: "js_import",
|
|
27
30
|
expectedType: "js_module",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/plugin-toolbar",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"/src/"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jsenv/ast": "
|
|
29
|
+
"@jsenv/ast": "6.0.1",
|
|
30
30
|
"@preact/signals": "1.2.1"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
@@ -7,6 +7,6 @@ export const animationsEnabledSignal = signal(
|
|
|
7
7
|
typeof stateFromLocalStorage.animationsEnabled === "boolean"
|
|
8
8
|
? stateFromLocalStorage.animationsEnabled
|
|
9
9
|
: typeof paramsFromParentWindow.animationsEnabled === "boolean"
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
? paramsFromParentWindow.animationsEnabled
|
|
11
|
+
: false,
|
|
12
12
|
);
|
|
@@ -7,7 +7,7 @@ export const notificationsEnabledSignal = signal(
|
|
|
7
7
|
typeof stateFromLocalStorage.notificationsEnabled === "boolean"
|
|
8
8
|
? stateFromLocalStorage.notificationsEnabled
|
|
9
9
|
: typeof paramsFromParentWindow.notificationsEnabled === "boolean"
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
? paramsFromParentWindow.notificationsEnabled
|
|
11
|
+
: false,
|
|
12
12
|
);
|
|
13
13
|
export const notificationPermissionSignal = signal(Notification.permission);
|
|
@@ -7,6 +7,6 @@ export const themeSignal = signal(
|
|
|
7
7
|
typeof stateFromLocalStorage.theme === "string"
|
|
8
8
|
? stateFromLocalStorage.theme
|
|
9
9
|
: typeof paramsFromParentWindow.theme === "string"
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
? paramsFromParentWindow.theme
|
|
11
|
+
: "dark",
|
|
12
12
|
);
|
|
@@ -7,6 +7,6 @@ export const openedSignal = signal(
|
|
|
7
7
|
typeof stateFromLocalStorage.opened === "boolean"
|
|
8
8
|
? stateFromLocalStorage.opened
|
|
9
9
|
: typeof paramsFromParentWindow.opened === "boolean"
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
? paramsFromParentWindow.opened
|
|
11
|
+
: false,
|
|
12
12
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
parseHtml,
|
|
3
3
|
stringifyHtmlAst,
|
|
4
4
|
injectHtmlNodeAsEarlyAsPossible,
|
|
5
5
|
createHtmlNode,
|
|
@@ -33,7 +33,7 @@ export const jsenvPluginToolbar = ({
|
|
|
33
33
|
if (urlInfo.url.startsWith(toolbarHtmlClientFileUrl)) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
|
-
const htmlAst =
|
|
36
|
+
const htmlAst = parseHtml({ html: urlInfo.content, url: urlInfo.url });
|
|
37
37
|
const toolbarInjectorReference = urlInfo.dependencies.inject({
|
|
38
38
|
type: "js_import",
|
|
39
39
|
expectedType: "js_module",
|