shinkom 1.0.3 → 1.1.0
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/README.md +3 -2
- package/dist/bundles/_virtual/_rolldown/runtime.js +1 -1
- package/dist/bundles/core/constants.d.ts +1 -1
- package/dist/bundles/core/constants.js +5 -2
- package/dist/bundles/core/elements/compat-view-element.d.ts +100 -0
- package/dist/bundles/core/elements/compat-view-element.js +440 -0
- package/dist/bundles/core/elements/control-panel-element.d.ts +45 -0
- package/dist/bundles/core/elements/control-panel-element.js +99 -0
- package/dist/bundles/core/elements/index.d.ts +13 -0
- package/dist/bundles/core/elements/index.js +13 -0
- package/dist/bundles/core/elements/inspector-element.d.ts +27 -0
- package/dist/bundles/core/elements/inspector-element.js +58 -0
- package/dist/bundles/core/elements/recent-result-item.js +46 -0
- package/dist/bundles/core/elements/results-history-item.js +46 -0
- package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -0
- package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -0
- package/dist/bundles/core/elements/templates/root-styles.template.js +40 -0
- package/dist/bundles/core/event-bus.d.ts +19 -5
- package/dist/bundles/core/event-bus.js +21 -8
- package/dist/bundles/core/helpers.js +24 -2
- package/dist/bundles/core/index.d.ts +5 -2
- package/dist/bundles/core/index.js +6 -2
- package/dist/bundles/core/state-service.d.ts +24 -4
- package/dist/bundles/core/state-service.js +25 -5
- package/dist/bundles/core/ui-component.d.ts +25 -6
- package/dist/bundles/core/ui-component.js +31 -12
- package/dist/bundles/engine/engine.d.ts +57 -9
- package/dist/bundles/engine/engine.js +115 -31
- package/dist/bundles/engine/index.js +1 -1
- package/dist/bundles/gen/browser-data.js +96 -96
- package/dist/bundles/gen/browser-usage-data.js +671 -671
- package/dist/bundles/gen/index.js +1 -1
- package/dist/bundles/index.d.ts +6 -2
- package/dist/bundles/index.js +8 -2
- package/dist/bundles/pkg/shinkore.d.ts +1 -1
- package/dist/bundles/pkg/shinkore.js +1 -1
- package/dist/bundles/shinkom.d.ts +9 -1
- package/dist/bundles/shinkom.js +31 -6
- package/dist/bundles/types/public.d.ts +13 -29
- package/dist/bundles/types/types.d.ts +99 -0
- package/dist/bundles/ui/compat-ui/compat-ui.d.ts +12 -2
- package/dist/bundles/ui/compat-ui/compat-ui.js +12 -2
- package/dist/bundles/ui/compat-ui/index.js +8 -0
- package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +42 -0
- package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -0
- package/dist/bundles/ui/compatibility-view/index.js +8 -0
- package/dist/bundles/ui/control-panel/control-panel.d.ts +30 -16
- package/dist/bundles/ui/control-panel/control-panel.js +188 -277
- package/dist/bundles/ui/control-panel/index.js +8 -0
- package/dist/bundles/ui/index.d.ts +3 -2
- package/dist/bundles/ui/index.js +7 -2
- package/dist/bundles/ui/inspector/index.js +8 -0
- package/dist/bundles/ui/inspector/inspector.d.ts +60 -6
- package/dist/bundles/ui/inspector/inspector.js +149 -69
- package/dist/modules/core/constants.cjs +17 -1
- package/dist/modules/core/elements/compat-view-element.cjs +434 -0
- package/dist/modules/core/elements/control-panel-element.cjs +93 -0
- package/dist/modules/core/elements/index.cjs +11 -0
- package/dist/modules/core/elements/inspector-element.cjs +52 -0
- package/dist/modules/core/elements/recent-result-item.cjs +39 -0
- package/dist/modules/core/elements/results-history-item.cjs +39 -0
- package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -0
- package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -0
- package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -0
- package/dist/modules/core/event-bus.cjs +43 -1
- package/dist/modules/core/helpers.cjs +41 -1
- package/dist/modules/core/index.cjs +16 -1
- package/dist/modules/core/state-service.cjs +74 -1
- package/dist/modules/core/ui-component.cjs +65 -1
- package/dist/modules/engine/engine.cjs +232 -1
- package/dist/modules/gen/browser-data.cjs +100 -1
- package/dist/modules/gen/browser-usage-data.cjs +675 -1
- package/dist/modules/gen/compat-data.cjs +31015 -1
- package/dist/modules/gen/index.cjs +7 -1
- package/dist/modules/index.cjs +27 -1
- package/dist/modules/pkg/shinkore.cjs +459 -1
- package/dist/modules/shinkom.cjs +73 -1
- package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -1
- package/dist/modules/ui/compat-ui/index.cjs +1 -0
- package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -0
- package/dist/modules/ui/compatibility-view/index.cjs +1 -0
- package/dist/modules/ui/control-panel/control-panel.cjs +314 -182
- package/dist/modules/ui/control-panel/index.cjs +1 -0
- package/dist/modules/ui/index.cjs +13 -1
- package/dist/modules/ui/inspector/index.cjs +1 -0
- package/dist/modules/ui/inspector/inspector.cjs +388 -1
- package/package.json +13 -6
- package/dist/bundles/node_modules/@mdn/browser-compat-data/types.d.ts +0 -78
|
@@ -1,182 +1,314 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_core_ui_component = require("../../core/ui-component.cjs");
|
|
3
|
+
const require_core_elements_control_panel_element = require("../../core/elements/control-panel-element.cjs");
|
|
4
|
+
require("../../core/elements/index.cjs");
|
|
5
|
+
require("../../core/index.cjs");
|
|
6
|
+
//#region src/ui/control-panel/control-panel.js
|
|
7
|
+
/**@typedef {import('../../types/public').UISharedState} UISharedState */
|
|
8
|
+
/**@typedef {import('../../types/public').UISharedStateProps} UISharedStateProps */
|
|
9
|
+
/**
|
|
10
|
+
* CompatControlPanel manages the visibility, tabs, and input controls of
|
|
11
|
+
* the compatibility control panel overlay.
|
|
12
|
+
*
|
|
13
|
+
* It mounts the `<sk-control-panel>` custom element, binds control values
|
|
14
|
+
* to shared UI state, and dispatches user-driven commands over the Shinkom
|
|
15
|
+
* event bus.
|
|
16
|
+
*
|
|
17
|
+
* The panel supports inspector controls, compatibility view settings,
|
|
18
|
+
* tab switching, and display transitions with or without view transition
|
|
19
|
+
* support.
|
|
20
|
+
*
|
|
21
|
+
* @extends {UIComponent}
|
|
22
|
+
*/
|
|
23
|
+
var CompatControlPanel = class CompatControlPanel extends require_core_ui_component.UIComponent {
|
|
24
|
+
/**@type {UISharedState | null} */
|
|
25
|
+
#stateBind = null;
|
|
26
|
+
/**@type {AbortController | null} */
|
|
27
|
+
#panelController = null;
|
|
28
|
+
/**
|
|
29
|
+
* Initializes the compatibility control panel.
|
|
30
|
+
*
|
|
31
|
+
* It requires an instance of the `ShinkomBus` and `ShinkomState` to listen
|
|
32
|
+
* for event bus emits and state service notifications.
|
|
33
|
+
*
|
|
34
|
+
* It also registers the `<sk-control-panel>` custom element.
|
|
35
|
+
*
|
|
36
|
+
* @param {ShinkomBus} bus
|
|
37
|
+
* @param {ShinkomState} stateService
|
|
38
|
+
*/
|
|
39
|
+
constructor(bus, stateService) {
|
|
40
|
+
super(bus, stateService);
|
|
41
|
+
CompatControlPanel.register();
|
|
42
|
+
/**@type {CompatControlPanelElement | null} */
|
|
43
|
+
this.controlPanelEl = null;
|
|
44
|
+
/**@type {HTMLInputElement | null} */
|
|
45
|
+
this.depthLevelInput = null;
|
|
46
|
+
/**@type {HTMLInputElement | null} */
|
|
47
|
+
this.maxResultsHistoryInput = null;
|
|
48
|
+
/**@type {number} */
|
|
49
|
+
this.maxResultsHistory = 10;
|
|
50
|
+
/**@type {number} */
|
|
51
|
+
this.depthLevel = 0;
|
|
52
|
+
/**@type {boolean} */
|
|
53
|
+
this.multiElements = false;
|
|
54
|
+
/**@type {"inspector" | "compatView"} */
|
|
55
|
+
this.currentTab = "inspector";
|
|
56
|
+
/**@type {() => void} */
|
|
57
|
+
this.unsubState = () => {};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Register custom elements to the CustomElementRegistry.
|
|
61
|
+
*/
|
|
62
|
+
static register() {
|
|
63
|
+
if (typeof window !== "undefined" && "customElements" in globalThis && !globalThis.customElements.get("sk-control-panel")) globalThis.customElements.define("sk-control-panel", require_core_elements_control_panel_element.CompatControlPanelElement);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Subscribes to shared UI state changes from the Shinkom state service.
|
|
67
|
+
*
|
|
68
|
+
* When the state service emits updates, the control panel updates the
|
|
69
|
+
* relevant button labels and input state accordingly.
|
|
70
|
+
*/
|
|
71
|
+
#setupStateServiceListener() {
|
|
72
|
+
this.unsubState = this.stateService.subscribe((prop, val) => {
|
|
73
|
+
this.onStateChange(prop, val);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Unsubscribes from the shared UI state service.
|
|
78
|
+
*/
|
|
79
|
+
#cleanupStateServiceListener() {
|
|
80
|
+
this.unsubState();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @param {UISharedState} state
|
|
84
|
+
*/
|
|
85
|
+
bindState(state) {
|
|
86
|
+
if (!this.#stateBind) this.#stateBind = state;
|
|
87
|
+
this.#stateBind.ignorePanelEl = this.controlPanelEl;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @param {UISharedStateProps} prop
|
|
91
|
+
* @param {any} val
|
|
92
|
+
*/
|
|
93
|
+
onStateChange(prop, val) {
|
|
94
|
+
switch (prop) {
|
|
95
|
+
case "inspectorSwitching":
|
|
96
|
+
if (this.controlPanelEl) {
|
|
97
|
+
const toggleSwitchingButton = this.controlPanelEl.shadowRootRef.getElementById("sk-toggle-switching");
|
|
98
|
+
if (toggleSwitchingButton) toggleSwitchingButton.textContent = val ? "Enabled" : "Disabled";
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case "inspectorActive":
|
|
102
|
+
if (this.controlPanelEl) {
|
|
103
|
+
const toggleInspectorButton = this.controlPanelEl.shadowRootRef.getElementById("sk-toggle-inspector");
|
|
104
|
+
if (toggleInspectorButton) toggleInspectorButton.textContent = val ? "Enabled" : "Disabled";
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
default: break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
mount() {
|
|
111
|
+
if (this.controlPanelEl || document.querySelector("sk-control-panel")) return;
|
|
112
|
+
this.controlPanelEl = document.createElement("sk-control-panel");
|
|
113
|
+
document.body.appendChild(this.controlPanelEl);
|
|
114
|
+
this.#setupShadowListeners();
|
|
115
|
+
this.#setupStateServiceListener();
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Sets up event listeners within the `ShadowDOM`.
|
|
119
|
+
*/
|
|
120
|
+
#setupShadowListeners() {
|
|
121
|
+
if (!this.controlPanelEl) return;
|
|
122
|
+
this.#panelController = new AbortController();
|
|
123
|
+
const { signal } = this.#panelController;
|
|
124
|
+
const depthLevelInput = this.controlPanelEl.shadowRootRef.getElementById("sk-depth-level");
|
|
125
|
+
this.controlPanelEl.shadowHost.addEventListener("click", this.#handleToggleClick, { signal });
|
|
126
|
+
depthLevelInput?.addEventListener("change", this.#handleDepthLevelValue, { signal });
|
|
127
|
+
if (depthLevelInput) {
|
|
128
|
+
this.depthLevelInput = depthLevelInput;
|
|
129
|
+
this.depthLevelInput.disabled = !this.#stateBind?.multiElements;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
unmount() {
|
|
133
|
+
try {
|
|
134
|
+
if (!this.controlPanelEl) return;
|
|
135
|
+
this.controlPanelEl.remove();
|
|
136
|
+
this.controlPanelEl = null;
|
|
137
|
+
this.#resetInternalState();
|
|
138
|
+
this.#cleanupStateServiceListener();
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error(`Control panel destroy error: ${error}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Resets any internal state and event listeners.
|
|
145
|
+
*/
|
|
146
|
+
#resetInternalState() {
|
|
147
|
+
if (this.#panelController) this.#panelController.abort();
|
|
148
|
+
this.#panelController = null;
|
|
149
|
+
this.depthLevelInput = null;
|
|
150
|
+
this.depthLevel = 0;
|
|
151
|
+
this.multiElements = false;
|
|
152
|
+
if (this.#stateBind) {
|
|
153
|
+
this.#stateBind.depthLevel = 0;
|
|
154
|
+
this.#stateBind.multiElements = false;
|
|
155
|
+
this.#stateBind.ignorePanelEl = null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Handles click events within the control panel.
|
|
160
|
+
* @param {PointerEvent} e
|
|
161
|
+
*/
|
|
162
|
+
#handleToggleClick = (e) => {
|
|
163
|
+
switch (e.target.id) {
|
|
164
|
+
case "sk-show-panel":
|
|
165
|
+
if (!this.controlPanelEl) return;
|
|
166
|
+
if (!document.startViewTransition) this.controlPanelEl.renderDisplayTransition("show");
|
|
167
|
+
else this.#handleDisplayTransition("show");
|
|
168
|
+
break;
|
|
169
|
+
case "sk-close-panel":
|
|
170
|
+
if (!this.controlPanelEl) return;
|
|
171
|
+
if (!document.startViewTransition) this.controlPanelEl.renderDisplayTransition("hide");
|
|
172
|
+
else this.#handleDisplayTransition("hide");
|
|
173
|
+
break;
|
|
174
|
+
case "sk-inspector-tab":
|
|
175
|
+
if (!this.controlPanelEl || this.currentTab === "inspector") return;
|
|
176
|
+
if (!document.startViewTransition) {
|
|
177
|
+
this.controlPanelEl.renderTabContent("inspector");
|
|
178
|
+
this.#handleInspectorTabState();
|
|
179
|
+
this.currentTab = "inspector";
|
|
180
|
+
} else this.#handleTabChange("inspector");
|
|
181
|
+
break;
|
|
182
|
+
case "sk-compat-view-tab":
|
|
183
|
+
if (!this.controlPanelEl || this.currentTab === "compatView") return;
|
|
184
|
+
if (!document.startViewTransition) {
|
|
185
|
+
this.controlPanelEl.renderTabContent("compatView");
|
|
186
|
+
this.#handleCompatViewTabState();
|
|
187
|
+
this.currentTab = "compatView";
|
|
188
|
+
} else this.#handleTabChange("compatView");
|
|
189
|
+
break;
|
|
190
|
+
case "sk-toggle-inspector":
|
|
191
|
+
this.bus.emit("ci:toggle");
|
|
192
|
+
break;
|
|
193
|
+
case "sk-toggle-elements":
|
|
194
|
+
this.multiElements = !this.multiElements;
|
|
195
|
+
if (this.depthLevelInput) if (this.multiElements) this.depthLevelInput.disabled = false;
|
|
196
|
+
else this.depthLevelInput.disabled = true;
|
|
197
|
+
if (this.#stateBind) this.#stateBind.multiElements = this.multiElements;
|
|
198
|
+
break;
|
|
199
|
+
case "sk-toggle-switching":
|
|
200
|
+
if (this.#stateBind) this.#stateBind.inspectorSwitching = !this.#stateBind.inspectorSwitching;
|
|
201
|
+
break;
|
|
202
|
+
case "sk-create-inspector":
|
|
203
|
+
this.bus.emit("ci:create");
|
|
204
|
+
break;
|
|
205
|
+
case "sk-reset-inspector":
|
|
206
|
+
this.bus.emit("ci:reset");
|
|
207
|
+
break;
|
|
208
|
+
case "sk-destroy-inspector":
|
|
209
|
+
this.bus.emit("ci:destroy");
|
|
210
|
+
break;
|
|
211
|
+
case "sk-clear-history":
|
|
212
|
+
this.bus.emit("clear:history");
|
|
213
|
+
break;
|
|
214
|
+
default: break;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Handles the transition between tab changes.
|
|
219
|
+
* @param {"inspector" | "compatView"} tab
|
|
220
|
+
*/
|
|
221
|
+
async #handleTabChange(tab) {
|
|
222
|
+
if (!this.controlPanelEl) return;
|
|
223
|
+
if (this.controlPanelEl.shadowRootRef.getElementById("sk-control-panel-main")) {
|
|
224
|
+
const transition = document.startViewTransition(() => {
|
|
225
|
+
this.controlPanelEl?.renderTabContent(tab);
|
|
226
|
+
});
|
|
227
|
+
this.currentTab = tab;
|
|
228
|
+
await transition.finished;
|
|
229
|
+
if (this.currentTab === "inspector") this.#handleInspectorTabState();
|
|
230
|
+
else if (this.currentTab === "compatView") this.#handleCompatViewTabState();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
#handleInspectorTabState() {
|
|
234
|
+
if (!this.controlPanelEl) return;
|
|
235
|
+
const depthLevel = this.controlPanelEl.shadowRootRef.getElementById("sk-depth-level");
|
|
236
|
+
if (depthLevel) {
|
|
237
|
+
this.depthLevelInput = depthLevel;
|
|
238
|
+
this.depthLevelInput.addEventListener("change", this.#handleDepthLevelValue, { signal: this.#panelController?.signal });
|
|
239
|
+
if (this.#stateBind) {
|
|
240
|
+
if (this.#stateBind.multiElements) {
|
|
241
|
+
const checkbox = this.controlPanelEl.shadowRootRef.getElementById("sk-toggle-elements");
|
|
242
|
+
checkbox.checked = true;
|
|
243
|
+
} else this.depthLevelInput.disabled = true;
|
|
244
|
+
if (this.#stateBind.depthLevel > 0) this.depthLevelInput.value = `${this.#stateBind.depthLevel}`;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (this.#stateBind) {
|
|
248
|
+
const switchingToggle = this.controlPanelEl.shadowRootRef.getElementById("sk-toggle-switching");
|
|
249
|
+
const inspectorToggle = this.controlPanelEl.shadowRootRef.getElementById("sk-toggle-inspector");
|
|
250
|
+
if (inspectorToggle) if (this.#stateBind.inspectorActive) inspectorToggle.textContent = "Enabled";
|
|
251
|
+
else inspectorToggle.textContent = "Disabled";
|
|
252
|
+
if (switchingToggle) if (this.#stateBind.inspectorSwitching) switchingToggle.textContent = "Enabled";
|
|
253
|
+
else switchingToggle.textContent = "Disabled";
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
#handleCompatViewTabState() {
|
|
257
|
+
if (!this.controlPanelEl) return;
|
|
258
|
+
const maxHistory = this.controlPanelEl.shadowRootRef.getElementById("sk-max-history");
|
|
259
|
+
if (maxHistory && maxHistory instanceof HTMLInputElement) {
|
|
260
|
+
this.maxResultsHistoryInput = maxHistory;
|
|
261
|
+
this.maxResultsHistoryInput.addEventListener("change", this.#handleMaxHistoryValue, { signal: this.#panelController?.signal });
|
|
262
|
+
if (this.#stateBind) {
|
|
263
|
+
if (this.#stateBind.maxResultsHistory >= 0 && this.#stateBind.maxResultsHistory != 10) this.maxResultsHistoryInput.value = `${this.#stateBind.maxResultsHistory}`;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Handles the transition when toggling the display.
|
|
269
|
+
* @param {"show" | "hide"} display
|
|
270
|
+
*/
|
|
271
|
+
async #handleDisplayTransition(display) {
|
|
272
|
+
if (!this.controlPanelEl) return;
|
|
273
|
+
const controlPanel = this.controlPanelEl.shadowRootRef.getElementById("sk-control-panel");
|
|
274
|
+
if (controlPanel) {
|
|
275
|
+
controlPanel.part.value = "control-panel";
|
|
276
|
+
const transition = document.startViewTransition(() => {
|
|
277
|
+
this.controlPanelEl?.renderDisplayTransition(display);
|
|
278
|
+
});
|
|
279
|
+
try {
|
|
280
|
+
await transition.finished;
|
|
281
|
+
} finally {
|
|
282
|
+
controlPanel.removeAttribute("part");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Handles the change event for the `maxResultsHistory` input.
|
|
288
|
+
* @param {Event} e
|
|
289
|
+
*/
|
|
290
|
+
#handleMaxHistoryValue = (e) => {
|
|
291
|
+
const value = parseInt(
|
|
292
|
+
/**@type {HTMLInputElement} */
|
|
293
|
+
e.target.value,
|
|
294
|
+
10
|
|
295
|
+
);
|
|
296
|
+
this.maxResultsHistory = value;
|
|
297
|
+
if (this.#stateBind) this.#stateBind.maxResultsHistory = value;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Handles the change event for the `depth_level` input.
|
|
301
|
+
* @param {Event} e
|
|
302
|
+
*/
|
|
303
|
+
#handleDepthLevelValue = (e) => {
|
|
304
|
+
const level = parseInt(
|
|
305
|
+
/**@type {HTMLInputElement}*/
|
|
306
|
+
e.target.value,
|
|
307
|
+
10
|
|
308
|
+
);
|
|
309
|
+
this.depthLevel = level;
|
|
310
|
+
if (this.#stateBind) this.#stateBind.depthLevel = level;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
//#endregion
|
|
314
|
+
exports.CompatControlPanel = CompatControlPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./control-panel.cjs");
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_ui_inspector_inspector = require("./inspector/inspector.cjs");
|
|
3
|
+
require("./inspector/index.cjs");
|
|
4
|
+
const require_ui_control_panel_control_panel = require("./control-panel/control-panel.cjs");
|
|
5
|
+
require("./control-panel/index.cjs");
|
|
6
|
+
const require_ui_compatibility_view_compatibility_view = require("./compatibility-view/compatibility-view.cjs");
|
|
7
|
+
require("./compatibility-view/index.cjs");
|
|
8
|
+
const require_ui_compat_ui_compat_ui = require("./compat-ui/compat-ui.cjs");
|
|
9
|
+
require("./compat-ui/index.cjs");
|
|
10
|
+
exports.CompatControlPanel = require_ui_control_panel_control_panel.CompatControlPanel;
|
|
11
|
+
exports.CompatInspector = require_ui_inspector_inspector.CompatInspector;
|
|
12
|
+
exports.CompatUI = require_ui_compat_ui_compat_ui.CompatUI;
|
|
13
|
+
exports.CompatView = require_ui_compatibility_view_compatibility_view.CompatView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./inspector.cjs");
|