shinkom 1.1.0 → 1.1.1
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/bundles/_virtual/_rolldown/runtime.js +14 -14
- package/dist/bundles/core/constants.d.ts +15 -15
- package/dist/bundles/core/constants.js +23 -23
- package/dist/bundles/core/elements/compat-view-element.d.ts +99 -99
- package/dist/bundles/core/elements/compat-view-element.js +440 -440
- package/dist/bundles/core/elements/control-panel-element.d.ts +44 -44
- package/dist/bundles/core/elements/control-panel-element.js +99 -99
- package/dist/bundles/core/elements/index.d.ts +12 -12
- package/dist/bundles/core/elements/index.js +13 -13
- package/dist/bundles/core/elements/inspector-element.d.ts +26 -26
- package/dist/bundles/core/elements/inspector-element.js +58 -58
- package/dist/bundles/core/elements/recent-result-item.js +46 -46
- package/dist/bundles/core/elements/results-history-item.js +46 -46
- package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -462
- package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -335
- package/dist/bundles/core/elements/templates/root-styles.template.js +40 -40
- package/dist/bundles/core/event-bus.d.ts +46 -46
- package/dist/bundles/core/event-bus.js +49 -49
- package/dist/bundles/core/helpers.js +47 -47
- package/dist/bundles/core/index.d.ts +14 -14
- package/dist/bundles/core/index.js +16 -16
- package/dist/bundles/core/state-service.d.ts +56 -56
- package/dist/bundles/core/state-service.js +80 -80
- package/dist/bundles/core/ui-component.d.ts +63 -63
- package/dist/bundles/core/ui-component.js +71 -71
- package/dist/bundles/engine/engine.d.ts +108 -108
- package/dist/bundles/engine/engine.js +238 -238
- package/dist/bundles/engine/index.js +8 -8
- package/dist/bundles/gen/index.js +14 -14
- package/dist/bundles/index.d.ts +19 -19
- package/dist/bundles/index.js +23 -23
- package/dist/bundles/pkg/shinkore.d.ts +50 -50
- package/dist/bundles/pkg/shinkore.js +465 -465
- package/dist/bundles/pkg/shinkore_bg.wasm +0 -0
- package/dist/bundles/shinkom.d.ts +41 -41
- package/dist/bundles/shinkom.js +80 -80
- package/dist/bundles/ui/compat-ui/compat-ui.d.ts +42 -42
- package/dist/bundles/ui/compat-ui/compat-ui.js +59 -59
- package/dist/bundles/ui/compat-ui/index.js +8 -8
- package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +41 -41
- package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -229
- package/dist/bundles/ui/compatibility-view/index.js +8 -8
- package/dist/bundles/ui/control-panel/control-panel.d.ts +52 -52
- package/dist/bundles/ui/control-panel/control-panel.js +320 -320
- package/dist/bundles/ui/control-panel/index.js +8 -8
- package/dist/bundles/ui/index.d.ts +11 -11
- package/dist/bundles/ui/index.js +16 -16
- package/dist/bundles/ui/inspector/index.js +8 -8
- package/dist/bundles/ui/inspector/inspector.d.ts +97 -97
- package/dist/bundles/ui/inspector/inspector.js +394 -394
- package/dist/modules/core/constants.cjs +17 -17
- package/dist/modules/core/elements/compat-view-element.cjs +434 -434
- package/dist/modules/core/elements/control-panel-element.cjs +93 -93
- package/dist/modules/core/elements/index.cjs +11 -11
- package/dist/modules/core/elements/inspector-element.cjs +52 -52
- package/dist/modules/core/elements/recent-result-item.cjs +39 -39
- package/dist/modules/core/elements/results-history-item.cjs +39 -39
- package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -458
- package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -332
- package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -33
- package/dist/modules/core/event-bus.cjs +43 -43
- package/dist/modules/core/helpers.cjs +41 -41
- package/dist/modules/core/index.cjs +16 -16
- package/dist/modules/core/state-service.cjs +74 -74
- package/dist/modules/core/ui-component.cjs +65 -65
- package/dist/modules/engine/engine.cjs +232 -232
- package/dist/modules/gen/browser-data.cjs +100 -100
- package/dist/modules/gen/browser-usage-data.cjs +675 -675
- package/dist/modules/gen/compat-data.cjs +31015 -31015
- package/dist/modules/gen/index.cjs +7 -7
- package/dist/modules/index.cjs +27 -27
- package/dist/modules/pkg/shinkore.cjs +459 -459
- package/dist/modules/pkg/shinkore_bg.wasm +0 -0
- package/dist/modules/shinkom.cjs +73 -73
- package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -53
- package/dist/modules/ui/compat-ui/index.cjs +1 -1
- package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -223
- package/dist/modules/ui/compatibility-view/index.cjs +1 -1
- package/dist/modules/ui/control-panel/control-panel.cjs +314 -314
- package/dist/modules/ui/control-panel/index.cjs +1 -1
- package/dist/modules/ui/index.cjs +13 -13
- package/dist/modules/ui/inspector/index.cjs +1 -1
- package/dist/modules/ui/inspector/inspector.cjs +388 -388
- package/package.json +1 -1
|
Binary file
|
package/dist/modules/shinkom.cjs
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_event_bus = require("./core/event-bus.cjs");
|
|
3
|
-
const require_core_state_service = require("./core/state-service.cjs");
|
|
4
|
-
require("./core/index.cjs");
|
|
5
|
-
const require_ui_inspector_inspector = require("./ui/inspector/inspector.cjs");
|
|
6
|
-
const require_ui_control_panel_control_panel = require("./ui/control-panel/control-panel.cjs");
|
|
7
|
-
const require_ui_compatibility_view_compatibility_view = require("./ui/compatibility-view/compatibility-view.cjs");
|
|
8
|
-
const require_ui_compat_ui_compat_ui = require("./ui/compat-ui/compat-ui.cjs");
|
|
9
|
-
require("./ui/index.cjs");
|
|
10
|
-
const require_engine_engine = require("./engine/engine.cjs");
|
|
11
|
-
//#region src/shinkom.js
|
|
12
|
-
/**@typedef {import("./types/public").ShinkomConfig} ShinkomConfig */
|
|
13
|
-
/**@type {Shinkom | null} */
|
|
14
|
-
let instance = null;
|
|
15
|
-
var Shinkom = class {
|
|
16
|
-
#config;
|
|
17
|
-
/**
|
|
18
|
-
* Initializes UI and engine components
|
|
19
|
-
*
|
|
20
|
-
* It creates instances for the event bus and state service and shares them
|
|
21
|
-
* between the components. It also has an optional configuration object
|
|
22
|
-
* used for configuring the inspector and initializing the engine with a
|
|
23
|
-
* URL to the WASM file.
|
|
24
|
-
*
|
|
25
|
-
* @param {ShinkomConfig | undefined} config
|
|
26
|
-
*/
|
|
27
|
-
constructor(config = void 0) {
|
|
28
|
-
if (instance) return instance;
|
|
29
|
-
this.initialized = false;
|
|
30
|
-
this.#config = config;
|
|
31
|
-
const bus = new require_core_event_bus.ShinkomBus();
|
|
32
|
-
const state = new require_core_state_service.ShinkomState();
|
|
33
|
-
/**@type {SKEngine} */
|
|
34
|
-
this.skEngine = new require_engine_engine.SKEngine(bus);
|
|
35
|
-
/**@type {CompatUI} */
|
|
36
|
-
this.compatUI = new require_ui_compat_ui_compat_ui.CompatUI(bus, state, [
|
|
37
|
-
new require_ui_inspector_inspector.CompatInspector(bus, state, this.#config?.inspector),
|
|
38
|
-
new require_ui_control_panel_control_panel.CompatControlPanel(bus, state),
|
|
39
|
-
new require_ui_compatibility_view_compatibility_view.CompatView(bus, state)
|
|
40
|
-
]);
|
|
41
|
-
instance = this;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Initialize Shinkom.
|
|
45
|
-
*/
|
|
46
|
-
async init() {
|
|
47
|
-
try {
|
|
48
|
-
if (this.initialized) {
|
|
49
|
-
console.warn("Shinkom is already initialized.");
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
await this.skEngine.initEngine(this.#config?.engine?.wasmURL);
|
|
53
|
-
this.compatUI.init();
|
|
54
|
-
this.initialized = true;
|
|
55
|
-
} catch (error) {
|
|
56
|
-
console.error(`Shinkom initialization error: ${error}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Destroy UI components and engine instance.
|
|
61
|
-
*/
|
|
62
|
-
destroy() {
|
|
63
|
-
if (!this.initialized) {
|
|
64
|
-
console.warn("Shinkom has not been initialized.");
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.skEngine.destroy();
|
|
68
|
-
this.compatUI.destroy();
|
|
69
|
-
this.initialized = false;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
exports.Shinkom = Shinkom;
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_core_event_bus = require("./core/event-bus.cjs");
|
|
3
|
+
const require_core_state_service = require("./core/state-service.cjs");
|
|
4
|
+
require("./core/index.cjs");
|
|
5
|
+
const require_ui_inspector_inspector = require("./ui/inspector/inspector.cjs");
|
|
6
|
+
const require_ui_control_panel_control_panel = require("./ui/control-panel/control-panel.cjs");
|
|
7
|
+
const require_ui_compatibility_view_compatibility_view = require("./ui/compatibility-view/compatibility-view.cjs");
|
|
8
|
+
const require_ui_compat_ui_compat_ui = require("./ui/compat-ui/compat-ui.cjs");
|
|
9
|
+
require("./ui/index.cjs");
|
|
10
|
+
const require_engine_engine = require("./engine/engine.cjs");
|
|
11
|
+
//#region src/shinkom.js
|
|
12
|
+
/**@typedef {import("./types/public").ShinkomConfig} ShinkomConfig */
|
|
13
|
+
/**@type {Shinkom | null} */
|
|
14
|
+
let instance = null;
|
|
15
|
+
var Shinkom = class {
|
|
16
|
+
#config;
|
|
17
|
+
/**
|
|
18
|
+
* Initializes UI and engine components
|
|
19
|
+
*
|
|
20
|
+
* It creates instances for the event bus and state service and shares them
|
|
21
|
+
* between the components. It also has an optional configuration object
|
|
22
|
+
* used for configuring the inspector and initializing the engine with a
|
|
23
|
+
* URL to the WASM file.
|
|
24
|
+
*
|
|
25
|
+
* @param {ShinkomConfig | undefined} config
|
|
26
|
+
*/
|
|
27
|
+
constructor(config = void 0) {
|
|
28
|
+
if (instance) return instance;
|
|
29
|
+
this.initialized = false;
|
|
30
|
+
this.#config = config;
|
|
31
|
+
const bus = new require_core_event_bus.ShinkomBus();
|
|
32
|
+
const state = new require_core_state_service.ShinkomState();
|
|
33
|
+
/**@type {SKEngine} */
|
|
34
|
+
this.skEngine = new require_engine_engine.SKEngine(bus);
|
|
35
|
+
/**@type {CompatUI} */
|
|
36
|
+
this.compatUI = new require_ui_compat_ui_compat_ui.CompatUI(bus, state, [
|
|
37
|
+
new require_ui_inspector_inspector.CompatInspector(bus, state, this.#config?.inspector),
|
|
38
|
+
new require_ui_control_panel_control_panel.CompatControlPanel(bus, state),
|
|
39
|
+
new require_ui_compatibility_view_compatibility_view.CompatView(bus, state)
|
|
40
|
+
]);
|
|
41
|
+
instance = this;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Initialize Shinkom.
|
|
45
|
+
*/
|
|
46
|
+
async init() {
|
|
47
|
+
try {
|
|
48
|
+
if (this.initialized) {
|
|
49
|
+
console.warn("Shinkom is already initialized.");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await this.skEngine.initEngine(this.#config?.engine?.wasmURL);
|
|
53
|
+
this.compatUI.init();
|
|
54
|
+
this.initialized = true;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error(`Shinkom initialization error: ${error}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Destroy UI components and engine instance.
|
|
61
|
+
*/
|
|
62
|
+
destroy() {
|
|
63
|
+
if (!this.initialized) {
|
|
64
|
+
console.warn("Shinkom has not been initialized.");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.skEngine.destroy();
|
|
68
|
+
this.compatUI.destroy();
|
|
69
|
+
this.initialized = false;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.Shinkom = Shinkom;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../core/index.cjs");
|
|
3
|
-
//#region src/ui/compat-ui/compat-ui.js
|
|
4
|
-
/**@type {WeakMap<WeakKey, UISharedState>} */
|
|
5
|
-
const internalState = /* @__PURE__ */ new WeakMap();
|
|
6
|
-
var CompatUI = class {
|
|
7
|
-
/**
|
|
8
|
-
* Initializes the provided UI components.
|
|
9
|
-
*
|
|
10
|
-
* It requires an instance of the `ShinkomBus` and `ShinkomState` and the UI
|
|
11
|
-
* components to be mounted.
|
|
12
|
-
*
|
|
13
|
-
* It sets a `WeakMap` with the Proxy state from the state service for binding
|
|
14
|
-
* state to the components after being mounted.
|
|
15
|
-
*
|
|
16
|
-
* @param {ShinkomBus} _bus
|
|
17
|
-
* @param {ShinkomState} stateService
|
|
18
|
-
* @param {UIComponent[]} components
|
|
19
|
-
*/
|
|
20
|
-
constructor(_bus, stateService, components = []) {
|
|
21
|
-
/**@type {UIComponent[]} */
|
|
22
|
-
this.components = components;
|
|
23
|
-
internalState.set(this, stateService.getState());
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Bind state proxy to UI components.
|
|
27
|
-
*/
|
|
28
|
-
#bindState() {
|
|
29
|
-
const state = internalState.get(this);
|
|
30
|
-
if (state) this.components.forEach((comp) => comp.bindState(state));
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Initializes CompatUI components.
|
|
34
|
-
*/
|
|
35
|
-
init() {
|
|
36
|
-
try {
|
|
37
|
-
this.components.forEach((comp) => comp.mount());
|
|
38
|
-
this.#bindState();
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error(`Compat UI initialization error: ${error}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Destroys CompatUI component instances.
|
|
45
|
-
*/
|
|
46
|
-
destroy() {
|
|
47
|
-
this.components.forEach((comp) => {
|
|
48
|
-
comp.unmount();
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
exports.CompatUI = CompatUI;
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../core/index.cjs");
|
|
3
|
+
//#region src/ui/compat-ui/compat-ui.js
|
|
4
|
+
/**@type {WeakMap<WeakKey, UISharedState>} */
|
|
5
|
+
const internalState = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
var CompatUI = class {
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the provided UI components.
|
|
9
|
+
*
|
|
10
|
+
* It requires an instance of the `ShinkomBus` and `ShinkomState` and the UI
|
|
11
|
+
* components to be mounted.
|
|
12
|
+
*
|
|
13
|
+
* It sets a `WeakMap` with the Proxy state from the state service for binding
|
|
14
|
+
* state to the components after being mounted.
|
|
15
|
+
*
|
|
16
|
+
* @param {ShinkomBus} _bus
|
|
17
|
+
* @param {ShinkomState} stateService
|
|
18
|
+
* @param {UIComponent[]} components
|
|
19
|
+
*/
|
|
20
|
+
constructor(_bus, stateService, components = []) {
|
|
21
|
+
/**@type {UIComponent[]} */
|
|
22
|
+
this.components = components;
|
|
23
|
+
internalState.set(this, stateService.getState());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Bind state proxy to UI components.
|
|
27
|
+
*/
|
|
28
|
+
#bindState() {
|
|
29
|
+
const state = internalState.get(this);
|
|
30
|
+
if (state) this.components.forEach((comp) => comp.bindState(state));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Initializes CompatUI components.
|
|
34
|
+
*/
|
|
35
|
+
init() {
|
|
36
|
+
try {
|
|
37
|
+
this.components.forEach((comp) => comp.mount());
|
|
38
|
+
this.#bindState();
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(`Compat UI initialization error: ${error}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Destroys CompatUI component instances.
|
|
45
|
+
*/
|
|
46
|
+
destroy() {
|
|
47
|
+
this.components.forEach((comp) => {
|
|
48
|
+
comp.unmount();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.CompatUI = CompatUI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("./compat-ui.cjs");
|
|
1
|
+
require("./compat-ui.cjs");
|