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.
Files changed (84) hide show
  1. package/dist/bundles/_virtual/_rolldown/runtime.js +14 -14
  2. package/dist/bundles/core/constants.d.ts +15 -15
  3. package/dist/bundles/core/constants.js +23 -23
  4. package/dist/bundles/core/elements/compat-view-element.d.ts +99 -99
  5. package/dist/bundles/core/elements/compat-view-element.js +440 -440
  6. package/dist/bundles/core/elements/control-panel-element.d.ts +44 -44
  7. package/dist/bundles/core/elements/control-panel-element.js +99 -99
  8. package/dist/bundles/core/elements/index.d.ts +12 -12
  9. package/dist/bundles/core/elements/index.js +13 -13
  10. package/dist/bundles/core/elements/inspector-element.d.ts +26 -26
  11. package/dist/bundles/core/elements/inspector-element.js +58 -58
  12. package/dist/bundles/core/elements/recent-result-item.js +46 -46
  13. package/dist/bundles/core/elements/results-history-item.js +46 -46
  14. package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -462
  15. package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -335
  16. package/dist/bundles/core/elements/templates/root-styles.template.js +40 -40
  17. package/dist/bundles/core/event-bus.d.ts +46 -46
  18. package/dist/bundles/core/event-bus.js +49 -49
  19. package/dist/bundles/core/helpers.js +47 -47
  20. package/dist/bundles/core/index.d.ts +14 -14
  21. package/dist/bundles/core/index.js +16 -16
  22. package/dist/bundles/core/state-service.d.ts +56 -56
  23. package/dist/bundles/core/state-service.js +80 -80
  24. package/dist/bundles/core/ui-component.d.ts +63 -63
  25. package/dist/bundles/core/ui-component.js +71 -71
  26. package/dist/bundles/engine/engine.d.ts +108 -108
  27. package/dist/bundles/engine/engine.js +238 -238
  28. package/dist/bundles/engine/index.js +8 -8
  29. package/dist/bundles/gen/index.js +14 -14
  30. package/dist/bundles/index.d.ts +19 -19
  31. package/dist/bundles/index.js +23 -23
  32. package/dist/bundles/pkg/shinkore.d.ts +50 -50
  33. package/dist/bundles/pkg/shinkore.js +465 -465
  34. package/dist/bundles/pkg/shinkore_bg.wasm +0 -0
  35. package/dist/bundles/shinkom.d.ts +41 -41
  36. package/dist/bundles/shinkom.js +80 -80
  37. package/dist/bundles/ui/compat-ui/compat-ui.d.ts +42 -42
  38. package/dist/bundles/ui/compat-ui/compat-ui.js +59 -59
  39. package/dist/bundles/ui/compat-ui/index.js +8 -8
  40. package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +41 -41
  41. package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -229
  42. package/dist/bundles/ui/compatibility-view/index.js +8 -8
  43. package/dist/bundles/ui/control-panel/control-panel.d.ts +52 -52
  44. package/dist/bundles/ui/control-panel/control-panel.js +320 -320
  45. package/dist/bundles/ui/control-panel/index.js +8 -8
  46. package/dist/bundles/ui/index.d.ts +11 -11
  47. package/dist/bundles/ui/index.js +16 -16
  48. package/dist/bundles/ui/inspector/index.js +8 -8
  49. package/dist/bundles/ui/inspector/inspector.d.ts +97 -97
  50. package/dist/bundles/ui/inspector/inspector.js +394 -394
  51. package/dist/modules/core/constants.cjs +17 -17
  52. package/dist/modules/core/elements/compat-view-element.cjs +434 -434
  53. package/dist/modules/core/elements/control-panel-element.cjs +93 -93
  54. package/dist/modules/core/elements/index.cjs +11 -11
  55. package/dist/modules/core/elements/inspector-element.cjs +52 -52
  56. package/dist/modules/core/elements/recent-result-item.cjs +39 -39
  57. package/dist/modules/core/elements/results-history-item.cjs +39 -39
  58. package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -458
  59. package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -332
  60. package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -33
  61. package/dist/modules/core/event-bus.cjs +43 -43
  62. package/dist/modules/core/helpers.cjs +41 -41
  63. package/dist/modules/core/index.cjs +16 -16
  64. package/dist/modules/core/state-service.cjs +74 -74
  65. package/dist/modules/core/ui-component.cjs +65 -65
  66. package/dist/modules/engine/engine.cjs +232 -232
  67. package/dist/modules/gen/browser-data.cjs +100 -100
  68. package/dist/modules/gen/browser-usage-data.cjs +675 -675
  69. package/dist/modules/gen/compat-data.cjs +31015 -31015
  70. package/dist/modules/gen/index.cjs +7 -7
  71. package/dist/modules/index.cjs +27 -27
  72. package/dist/modules/pkg/shinkore.cjs +459 -459
  73. package/dist/modules/pkg/shinkore_bg.wasm +0 -0
  74. package/dist/modules/shinkom.cjs +73 -73
  75. package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -53
  76. package/dist/modules/ui/compat-ui/index.cjs +1 -1
  77. package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -223
  78. package/dist/modules/ui/compatibility-view/index.cjs +1 -1
  79. package/dist/modules/ui/control-panel/control-panel.cjs +314 -314
  80. package/dist/modules/ui/control-panel/index.cjs +1 -1
  81. package/dist/modules/ui/index.cjs +13 -13
  82. package/dist/modules/ui/inspector/index.cjs +1 -1
  83. package/dist/modules/ui/inspector/inspector.cjs +388 -388
  84. package/package.json +1 -1
Binary file
@@ -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");