@jsenv/plugin-toolbar 0.1.2 → 0.1.4
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/css/toolbar.css +683 -7
- package/dist/js/toolbar_core.js +1803 -8
- package/dist/js/toolbar_injector.js +4 -2
- package/dist/jsenv_plugin_toolbar.js +6 -3
- package/package.json +3 -3
- package/dist/css/document_execution_indicator.css +0 -87
- package/dist/css/globals.css +0 -75
- package/dist/css/server_indicator.css +0 -83
- package/dist/css/theme_light.css +0 -110
- package/dist/css/toolbar_menu_overflow.css +0 -59
- package/dist/css/toolbar_settings.css +0 -202
- package/dist/css/tooltips.css +0 -67
- package/dist/js/animation.js +0 -282
- package/dist/js/animation_actions.js +0 -7
- package/dist/js/animation_effects.js +0 -10
- package/dist/js/animation_signals.js +0 -4
- package/dist/js/changes_actions.js +0 -7
- package/dist/js/changes_indicator.js +0 -57
- package/dist/js/changes_signals.js +0 -2
- package/dist/js/document_execution_indicator.js +0 -62
- package/dist/js/document_index_link.js +0 -4
- package/dist/js/dom.js +0 -48
- package/dist/js/execution_actions.js +0 -46
- package/dist/js/execution_effects.js +0 -16
- package/dist/js/execution_signals.js +0 -17
- package/dist/js/hooks.mjs +0 -185
- package/dist/js/iframe_to_parent_href.js +0 -10
- package/dist/js/notification_actions.js +0 -60
- package/dist/js/notification_context.js +0 -1
- package/dist/js/notification_effects.js +0 -9
- package/dist/js/notification_signals.js +0 -5
- package/dist/js/parent_window_actions.js +0 -39
- package/dist/js/parent_window_context.js +0 -6
- package/dist/js/parent_window_effects.js +0 -15
- package/dist/js/parent_window_signals.js +0 -25
- package/dist/js/preact.mjs +0 -316
- package/dist/js/responsive.js +0 -104
- package/dist/js/server_actions.js +0 -7
- package/dist/js/server_effects.js +0 -9
- package/dist/js/server_indicator.js +0 -52
- package/dist/js/server_signals.js +0 -10
- package/dist/js/settings_actions.js +0 -7
- package/dist/js/settings_signals.js +0 -2
- package/dist/js/signals-core.mjs +0 -339
- package/dist/js/signals.mjs +0 -202
- package/dist/js/theme_actions.js +0 -7
- package/dist/js/theme_effects.js +0 -6
- package/dist/js/theme_signals.js +0 -4
- package/dist/js/toolbar_animation_setting.js +0 -21
- package/dist/js/toolbar_autoreload_setting.js +0 -67
- package/dist/js/toolbar_close_button.js +0 -14
- package/dist/js/toolbar_menu_overflow.js +0 -81
- package/dist/js/toolbar_notification_setting.js +0 -72
- package/dist/js/toolbar_open_actions.js +0 -7
- package/dist/js/toolbar_open_effects.js +0 -4
- package/dist/js/toolbar_open_signals.js +0 -4
- package/dist/js/toolbar_opening.js +0 -65
- package/dist/js/toolbar_overlay.js +0 -69
- package/dist/js/toolbar_settings.js +0 -44
- package/dist/js/toolbar_state_context.js +0 -1
- package/dist/js/toolbar_state_effects.js +0 -8
- package/dist/js/toolbar_state_signals.js +0 -17
- package/dist/js/toolbar_theme_setting.js +0 -13
- package/dist/js/toolbar_ui.js +0 -20
- package/dist/js/tooltip_actions.js +0 -6
- package/dist/js/variant.js +0 -53
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { effect } from "./signals.mjs";
|
|
2
|
-
import { toolbarStateSignal } from "./toolbar_state_signals.js";
|
|
3
|
-
import { sendEventToParent } from "./parent_window_actions.js";
|
|
4
|
-
effect(() => {
|
|
5
|
-
const toolbarState = toolbarStateSignal.value;
|
|
6
|
-
localStorage.setItem("jsenv_toolbar", JSON.stringify(toolbarState));
|
|
7
|
-
sendEventToParent("toolbar_state_change", toolbarState);
|
|
8
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { computed } from "./signals.mjs";
|
|
2
|
-
import { openedSignal } from "./toolbar_open_signals.js";
|
|
3
|
-
import { themeSignal } from "./theme_signals.js";
|
|
4
|
-
import { animationsEnabledSignal } from "./animation_signals.js";
|
|
5
|
-
import { notificationsEnabledSignal } from "./notification_signals.js";
|
|
6
|
-
export const toolbarStateSignal = computed(() => {
|
|
7
|
-
const opened = openedSignal.value;
|
|
8
|
-
const theme = themeSignal.value;
|
|
9
|
-
const animationsEnabled = animationsEnabledSignal.value;
|
|
10
|
-
const notificationsEnabled = notificationsEnabledSignal.value;
|
|
11
|
-
return {
|
|
12
|
-
opened,
|
|
13
|
-
theme,
|
|
14
|
-
animationsEnabled,
|
|
15
|
-
notificationsEnabled
|
|
16
|
-
};
|
|
17
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { themeSignal } from "./theme_signals.js";
|
|
2
|
-
import { switchToDefaultTheme, switchToLightTheme } from "./theme_actions.js";
|
|
3
|
-
export const renderToolbarThemeSetting = () => {
|
|
4
|
-
const checkbox = document.querySelector("#checkbox_dark_theme");
|
|
5
|
-
checkbox.checked = themeSignal.value === "dark";
|
|
6
|
-
checkbox.onchange = () => {
|
|
7
|
-
if (checkbox.checked) {
|
|
8
|
-
switchToDefaultTheme();
|
|
9
|
-
} else {
|
|
10
|
-
switchToLightTheme();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
};
|
package/dist/js/toolbar_ui.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { initToolbarOpening } from "./toolbar_opening.js";
|
|
2
|
-
import { initToolbarMenuOverflow } from "./toolbar_menu_overflow.js";
|
|
3
|
-
import { renderToolbarOverlay } from "./toolbar_overlay.js";
|
|
4
|
-
import { renderDocumentIndexLink } from "./document_index_link.js";
|
|
5
|
-
import { renderDocumentExecutionIndicator } from "./document_execution_indicator.js";
|
|
6
|
-
import { renderChangesIndicator } from "./changes_indicator.js";
|
|
7
|
-
import { renderServerIndicator } from "./server_indicator.js";
|
|
8
|
-
import { renderToolbarSettings } from "./toolbar_settings.js";
|
|
9
|
-
import { renderToolbarCloseButton } from "./toolbar_close_button.js";
|
|
10
|
-
export const initToolbarUI = () => {
|
|
11
|
-
initToolbarOpening();
|
|
12
|
-
initToolbarMenuOverflow();
|
|
13
|
-
renderToolbarOverlay();
|
|
14
|
-
renderDocumentIndexLink();
|
|
15
|
-
renderDocumentExecutionIndicator();
|
|
16
|
-
renderChangesIndicator();
|
|
17
|
-
renderServerIndicator();
|
|
18
|
-
renderToolbarSettings();
|
|
19
|
-
renderToolbarCloseButton();
|
|
20
|
-
};
|
package/dist/js/variant.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export const enableVariant = (rootNode, variables) => {
|
|
2
|
-
const nodesNotMatching = Array.from(rootNode.querySelectorAll(`[${attributeIndicatingACondition}]`));
|
|
3
|
-
nodesNotMatching.forEach(nodeNotMatching => {
|
|
4
|
-
const conditionAttributeValue = nodeNotMatching.getAttribute(attributeIndicatingACondition);
|
|
5
|
-
const matches = testCondition(conditionAttributeValue, variables);
|
|
6
|
-
if (matches) {
|
|
7
|
-
renameAttribute(nodeNotMatching, attributeIndicatingACondition, attributeIndicatingAMatch);
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
const nodesMatching = Array.from(rootNode.querySelectorAll(`[${attributeIndicatingAMatch}]`));
|
|
11
|
-
nodesMatching.forEach(nodeMatching => {
|
|
12
|
-
const conditionAttributeValue = nodeMatching.getAttribute(attributeIndicatingAMatch);
|
|
13
|
-
const matches = testCondition(conditionAttributeValue, variables);
|
|
14
|
-
if (!matches) {
|
|
15
|
-
renameAttribute(nodeMatching, attributeIndicatingAMatch, attributeIndicatingACondition);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const testCondition = (conditionAttributeValue, variables) => {
|
|
20
|
-
const condition = parseCondition(conditionAttributeValue);
|
|
21
|
-
return Object.keys(variables).some(key => {
|
|
22
|
-
if (condition.key !== key) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
// the condition do not specify a value, any value is ok
|
|
26
|
-
if (condition.value === undefined) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
if (condition.value === variables[key]) {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const parseCondition = conditionAttributeValue => {
|
|
36
|
-
const colonIndex = conditionAttributeValue.indexOf(":");
|
|
37
|
-
if (colonIndex === -1) {
|
|
38
|
-
return {
|
|
39
|
-
key: conditionAttributeValue,
|
|
40
|
-
value: undefined
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
key: conditionAttributeValue.slice(0, colonIndex),
|
|
45
|
-
value: conditionAttributeValue.slice(colonIndex + 1)
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const attributeIndicatingACondition = `data-when`;
|
|
49
|
-
const attributeIndicatingAMatch = `data-when-active`;
|
|
50
|
-
const renameAttribute = (node, name, newName) => {
|
|
51
|
-
node.setAttribute(newName, node.getAttribute(name));
|
|
52
|
-
node.removeAttribute(name);
|
|
53
|
-
};
|