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 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_compat_data = require("./compat-data.cjs");
|
|
2
|
+
require("./browser-data.cjs");
|
|
3
|
+
require("./browser-usage-data.cjs");
|
|
4
|
+
//#region gen/index.js
|
|
5
|
+
var gen_default = require_compat_data.default;
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.default = gen_default;
|
package/dist/modules/index.cjs
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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
|
+
const require_core_ui_component = require("./core/ui-component.cjs");
|
|
5
|
+
const require_core_elements_compat_view_element = require("./core/elements/compat-view-element.cjs");
|
|
6
|
+
const require_core_elements_control_panel_element = require("./core/elements/control-panel-element.cjs");
|
|
7
|
+
const require_core_elements_inspector_element = require("./core/elements/inspector-element.cjs");
|
|
8
|
+
require("./core/index.cjs");
|
|
9
|
+
const require_ui_inspector_inspector = require("./ui/inspector/inspector.cjs");
|
|
10
|
+
const require_ui_control_panel_control_panel = require("./ui/control-panel/control-panel.cjs");
|
|
11
|
+
const require_ui_compatibility_view_compatibility_view = require("./ui/compatibility-view/compatibility-view.cjs");
|
|
12
|
+
const require_ui_compat_ui_compat_ui = require("./ui/compat-ui/compat-ui.cjs");
|
|
13
|
+
require("./ui/index.cjs");
|
|
14
|
+
const require_engine_engine = require("./engine/engine.cjs");
|
|
15
|
+
const require_shinkom = require("./shinkom.cjs");
|
|
16
|
+
exports.CompatControlPanel = require_ui_control_panel_control_panel.CompatControlPanel;
|
|
17
|
+
exports.CompatControlPanelElement = require_core_elements_control_panel_element.CompatControlPanelElement;
|
|
18
|
+
exports.CompatInspector = require_ui_inspector_inspector.CompatInspector;
|
|
19
|
+
exports.CompatInspectorElement = require_core_elements_inspector_element.CompatInspectorElement;
|
|
20
|
+
exports.CompatUI = require_ui_compat_ui_compat_ui.CompatUI;
|
|
21
|
+
exports.CompatView = require_ui_compatibility_view_compatibility_view.CompatView;
|
|
22
|
+
exports.CompatViewElement = require_core_elements_compat_view_element.CompatViewElement;
|
|
23
|
+
exports.SKEngine = require_engine_engine.SKEngine;
|
|
24
|
+
exports.Shinkom = require_shinkom.Shinkom;
|
|
25
|
+
exports.ShinkomBus = require_core_event_bus.ShinkomBus;
|
|
26
|
+
exports.ShinkomState = require_core_state_service.ShinkomState;
|
|
27
|
+
exports.UIComponent = require_core_ui_component.UIComponent;
|
|
@@ -1 +1,459 @@
|
|
|
1
|
-
|
|
1
|
+
//#region pkg/shinkore.js
|
|
2
|
+
/**
|
|
3
|
+
* The [`CompatEngine`] struct stores the compatibility data
|
|
4
|
+
* and acts as an entry-point for the Rust/WASM engine.
|
|
5
|
+
*/
|
|
6
|
+
var CompatEngine = class {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
CompatEngineFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_compatengine_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Used for checking the compatibility of a single element and its attributes.
|
|
19
|
+
* @param {string} html
|
|
20
|
+
* @returns {any}
|
|
21
|
+
*/
|
|
22
|
+
check_element(html) {
|
|
23
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
24
|
+
const len0 = WASM_VECTOR_LEN;
|
|
25
|
+
const ret = wasm.compatengine_check_element(this.__wbg_ptr, ptr0, len0);
|
|
26
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
27
|
+
return takeFromExternrefTable0(ret[0]);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Used for checking the compatibility of multiple elements and their attributes
|
|
31
|
+
*
|
|
32
|
+
* `depth_level` is used to control how far down in a nested HTML structure to go before
|
|
33
|
+
* returning element tags.
|
|
34
|
+
*
|
|
35
|
+
* See [`preprocess::pre_process_html`] to learn more about how `depth_level` works.
|
|
36
|
+
* @param {string} html
|
|
37
|
+
* @param {number} depth_level
|
|
38
|
+
* @returns {any}
|
|
39
|
+
*/
|
|
40
|
+
check_elements(html, depth_level) {
|
|
41
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
42
|
+
const len0 = WASM_VECTOR_LEN;
|
|
43
|
+
const ret = wasm.compatengine_check_elements(this.__wbg_ptr, ptr0, len0, depth_level);
|
|
44
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
45
|
+
return takeFromExternrefTable0(ret[0]);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Used for performing a full page compatibility check.
|
|
49
|
+
* @param {string} html
|
|
50
|
+
* @returns {any}
|
|
51
|
+
*/
|
|
52
|
+
full_inspect(html) {
|
|
53
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
54
|
+
const len0 = WASM_VECTOR_LEN;
|
|
55
|
+
const ret = wasm.compatengine_full_inspect(this.__wbg_ptr, ptr0, len0);
|
|
56
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
57
|
+
return takeFromExternrefTable0(ret[0]);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Constructs an new engine instance
|
|
61
|
+
* @param {any} bcd_html_data
|
|
62
|
+
* @param {any} bcd_svg_data
|
|
63
|
+
* @param {any} bcd_browser_data
|
|
64
|
+
* @param {any} ciu_usage_data
|
|
65
|
+
*/
|
|
66
|
+
constructor(bcd_html_data, bcd_svg_data, bcd_browser_data, ciu_usage_data) {
|
|
67
|
+
this.__wbg_ptr = wasm.compatengine_new(bcd_html_data, bcd_svg_data, bcd_browser_data, ciu_usage_data) >>> 0;
|
|
68
|
+
CompatEngineFinalization.register(this, this.__wbg_ptr, this);
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
if (Symbol.dispose) CompatEngine.prototype[Symbol.dispose] = CompatEngine.prototype.free;
|
|
73
|
+
function __wbg_get_imports() {
|
|
74
|
+
const import0 = {
|
|
75
|
+
__proto__: null,
|
|
76
|
+
__wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
|
|
77
|
+
return Error(getStringFromWasm0(arg0, arg1));
|
|
78
|
+
},
|
|
79
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
80
|
+
const ptr1 = passStringToWasm0(String(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
81
|
+
const len1 = WASM_VECTOR_LEN;
|
|
82
|
+
getDataViewMemory0().setInt32(arg0 + 4, len1, true);
|
|
83
|
+
getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
|
|
84
|
+
},
|
|
85
|
+
__wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
|
|
86
|
+
const v = arg1;
|
|
87
|
+
const ret = typeof v === "bigint" ? v : void 0;
|
|
88
|
+
getDataViewMemory0().setBigInt64(arg0 + 8, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
89
|
+
getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
|
|
90
|
+
},
|
|
91
|
+
__wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
|
|
92
|
+
const v = arg0;
|
|
93
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
94
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
95
|
+
},
|
|
96
|
+
__wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
|
|
97
|
+
const ptr1 = passStringToWasm0(debugString(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
98
|
+
const len1 = WASM_VECTOR_LEN;
|
|
99
|
+
getDataViewMemory0().setInt32(arg0 + 4, len1, true);
|
|
100
|
+
getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
|
|
101
|
+
},
|
|
102
|
+
__wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
|
|
103
|
+
return arg0 in arg1;
|
|
104
|
+
},
|
|
105
|
+
__wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
|
|
106
|
+
return typeof arg0 === "bigint";
|
|
107
|
+
},
|
|
108
|
+
__wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
|
|
109
|
+
return typeof arg0 === "function";
|
|
110
|
+
},
|
|
111
|
+
__wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
|
|
112
|
+
const val = arg0;
|
|
113
|
+
return typeof val === "object" && val !== null;
|
|
114
|
+
},
|
|
115
|
+
__wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
|
|
116
|
+
return typeof arg0 === "string";
|
|
117
|
+
},
|
|
118
|
+
__wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
|
|
119
|
+
return arg0 === void 0;
|
|
120
|
+
},
|
|
121
|
+
__wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
|
|
122
|
+
return arg0 === arg1;
|
|
123
|
+
},
|
|
124
|
+
__wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
|
|
125
|
+
return arg0 == arg1;
|
|
126
|
+
},
|
|
127
|
+
__wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
|
|
128
|
+
const obj = arg1;
|
|
129
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
130
|
+
getDataViewMemory0().setFloat64(arg0 + 8, isLikeNone(ret) ? 0 : ret, true);
|
|
131
|
+
getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
|
|
132
|
+
},
|
|
133
|
+
__wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
|
|
134
|
+
const obj = arg1;
|
|
135
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
136
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
+
var len1 = WASM_VECTOR_LEN;
|
|
138
|
+
getDataViewMemory0().setInt32(arg0 + 4, len1, true);
|
|
139
|
+
getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
|
|
140
|
+
},
|
|
141
|
+
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
142
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
143
|
+
},
|
|
144
|
+
__wbg_call_14b169f759b26747: function() {
|
|
145
|
+
return handleError(function(arg0, arg1) {
|
|
146
|
+
return arg0.call(arg1);
|
|
147
|
+
}, arguments);
|
|
148
|
+
},
|
|
149
|
+
__wbg_done_9158f7cc8751ba32: function(arg0) {
|
|
150
|
+
return arg0.done;
|
|
151
|
+
},
|
|
152
|
+
__wbg_entries_e0b73aa8571ddb56: function(arg0) {
|
|
153
|
+
return Object.entries(arg0);
|
|
154
|
+
},
|
|
155
|
+
__wbg_error_2001591ad2463697: function(arg0) {
|
|
156
|
+
console.error(arg0);
|
|
157
|
+
},
|
|
158
|
+
__wbg_get_1affdbdd5573b16a: function() {
|
|
159
|
+
return handleError(function(arg0, arg1) {
|
|
160
|
+
return Reflect.get(arg0, arg1);
|
|
161
|
+
}, arguments);
|
|
162
|
+
},
|
|
163
|
+
__wbg_get_8360291721e2339f: function(arg0, arg1) {
|
|
164
|
+
return arg0[arg1 >>> 0];
|
|
165
|
+
},
|
|
166
|
+
__wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
|
|
167
|
+
return arg0[arg1 >>> 0];
|
|
168
|
+
},
|
|
169
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
170
|
+
return arg0[arg1];
|
|
171
|
+
},
|
|
172
|
+
__wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
|
|
173
|
+
let result;
|
|
174
|
+
try {
|
|
175
|
+
result = arg0 instanceof ArrayBuffer;
|
|
176
|
+
} catch (_) {
|
|
177
|
+
result = false;
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
},
|
|
181
|
+
__wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
|
|
182
|
+
let result;
|
|
183
|
+
try {
|
|
184
|
+
result = arg0 instanceof Map;
|
|
185
|
+
} catch (_) {
|
|
186
|
+
result = false;
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
},
|
|
190
|
+
__wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
|
|
191
|
+
let result;
|
|
192
|
+
try {
|
|
193
|
+
result = arg0 instanceof Uint8Array;
|
|
194
|
+
} catch (_) {
|
|
195
|
+
result = false;
|
|
196
|
+
}
|
|
197
|
+
return result;
|
|
198
|
+
},
|
|
199
|
+
__wbg_isArray_c3109d14ffc06469: function(arg0) {
|
|
200
|
+
return Array.isArray(arg0);
|
|
201
|
+
},
|
|
202
|
+
__wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
|
|
203
|
+
return Number.isSafeInteger(arg0);
|
|
204
|
+
},
|
|
205
|
+
__wbg_iterator_013bc09ec998c2a7: function() {
|
|
206
|
+
return Symbol.iterator;
|
|
207
|
+
},
|
|
208
|
+
__wbg_length_3d4ecd04bd8d22f1: function(arg0) {
|
|
209
|
+
return arg0.length;
|
|
210
|
+
},
|
|
211
|
+
__wbg_length_9f1775224cf1d815: function(arg0) {
|
|
212
|
+
return arg0.length;
|
|
213
|
+
},
|
|
214
|
+
__wbg_new_0c7403db6e782f19: function(arg0) {
|
|
215
|
+
return new Uint8Array(arg0);
|
|
216
|
+
},
|
|
217
|
+
__wbg_new_34d45cc8e36aaead: function() {
|
|
218
|
+
return /* @__PURE__ */ new Map();
|
|
219
|
+
},
|
|
220
|
+
__wbg_new_682678e2f47e32bc: function() {
|
|
221
|
+
return new Array();
|
|
222
|
+
},
|
|
223
|
+
__wbg_new_aa8d0fa9762c29bd: function() {
|
|
224
|
+
return /* @__PURE__ */ new Object();
|
|
225
|
+
},
|
|
226
|
+
__wbg_next_0340c4ae324393c3: function() {
|
|
227
|
+
return handleError(function(arg0) {
|
|
228
|
+
return arg0.next();
|
|
229
|
+
}, arguments);
|
|
230
|
+
},
|
|
231
|
+
__wbg_next_7646edaa39458ef7: function(arg0) {
|
|
232
|
+
return arg0.next;
|
|
233
|
+
},
|
|
234
|
+
__wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
|
|
235
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
236
|
+
},
|
|
237
|
+
__wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
|
|
238
|
+
arg0[arg1 >>> 0] = arg2;
|
|
239
|
+
},
|
|
240
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
241
|
+
arg0[arg1] = arg2;
|
|
242
|
+
},
|
|
243
|
+
__wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
|
|
244
|
+
return arg0.set(arg1, arg2);
|
|
245
|
+
},
|
|
246
|
+
__wbg_value_ee3a06f4579184fa: function(arg0) {
|
|
247
|
+
return arg0.value;
|
|
248
|
+
},
|
|
249
|
+
__wbg_warn_3cc416af27dbdc02: function(arg0) {
|
|
250
|
+
console.warn(arg0);
|
|
251
|
+
},
|
|
252
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
253
|
+
return arg0;
|
|
254
|
+
},
|
|
255
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
256
|
+
return arg0;
|
|
257
|
+
},
|
|
258
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
259
|
+
return getStringFromWasm0(arg0, arg1);
|
|
260
|
+
},
|
|
261
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
262
|
+
return BigInt.asUintN(64, arg0);
|
|
263
|
+
},
|
|
264
|
+
__wbindgen_init_externref_table: function() {
|
|
265
|
+
const table = wasm.__wbindgen_externrefs;
|
|
266
|
+
const offset = table.grow(4);
|
|
267
|
+
table.set(0, void 0);
|
|
268
|
+
table.set(offset + 0, void 0);
|
|
269
|
+
table.set(offset + 1, null);
|
|
270
|
+
table.set(offset + 2, true);
|
|
271
|
+
table.set(offset + 3, false);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
return {
|
|
275
|
+
__proto__: null,
|
|
276
|
+
"./shinkore_bg.js": import0
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
const CompatEngineFinalization = typeof FinalizationRegistry === "undefined" ? {
|
|
280
|
+
register: () => {},
|
|
281
|
+
unregister: () => {}
|
|
282
|
+
} : new FinalizationRegistry((ptr) => wasm.__wbg_compatengine_free(ptr >>> 0, 1));
|
|
283
|
+
function addToExternrefTable0(obj) {
|
|
284
|
+
const idx = wasm.__externref_table_alloc();
|
|
285
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
286
|
+
return idx;
|
|
287
|
+
}
|
|
288
|
+
function debugString(val) {
|
|
289
|
+
const type = typeof val;
|
|
290
|
+
if (type == "number" || type == "boolean" || val == null) return `${val}`;
|
|
291
|
+
if (type == "string") return `"${val}"`;
|
|
292
|
+
if (type == "symbol") {
|
|
293
|
+
const description = val.description;
|
|
294
|
+
if (description == null) return "Symbol";
|
|
295
|
+
else return `Symbol(${description})`;
|
|
296
|
+
}
|
|
297
|
+
if (type == "function") {
|
|
298
|
+
const name = val.name;
|
|
299
|
+
if (typeof name == "string" && name.length > 0) return `Function(${name})`;
|
|
300
|
+
else return "Function";
|
|
301
|
+
}
|
|
302
|
+
if (Array.isArray(val)) {
|
|
303
|
+
const length = val.length;
|
|
304
|
+
let debug = "[";
|
|
305
|
+
if (length > 0) debug += debugString(val[0]);
|
|
306
|
+
for (let i = 1; i < length; i++) debug += ", " + debugString(val[i]);
|
|
307
|
+
debug += "]";
|
|
308
|
+
return debug;
|
|
309
|
+
}
|
|
310
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
311
|
+
let className;
|
|
312
|
+
if (builtInMatches && builtInMatches.length > 1) className = builtInMatches[1];
|
|
313
|
+
else return toString.call(val);
|
|
314
|
+
if (className == "Object") try {
|
|
315
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
316
|
+
} catch (_) {
|
|
317
|
+
return "Object";
|
|
318
|
+
}
|
|
319
|
+
if (val instanceof Error) return `${val.name}: ${val.message}\n${val.stack}`;
|
|
320
|
+
return className;
|
|
321
|
+
}
|
|
322
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
323
|
+
ptr = ptr >>> 0;
|
|
324
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
325
|
+
}
|
|
326
|
+
let cachedDataViewMemory0 = null;
|
|
327
|
+
function getDataViewMemory0() {
|
|
328
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
329
|
+
return cachedDataViewMemory0;
|
|
330
|
+
}
|
|
331
|
+
function getStringFromWasm0(ptr, len) {
|
|
332
|
+
ptr = ptr >>> 0;
|
|
333
|
+
return decodeText(ptr, len);
|
|
334
|
+
}
|
|
335
|
+
let cachedUint8ArrayMemory0 = null;
|
|
336
|
+
function getUint8ArrayMemory0() {
|
|
337
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
338
|
+
return cachedUint8ArrayMemory0;
|
|
339
|
+
}
|
|
340
|
+
function handleError(f, args) {
|
|
341
|
+
try {
|
|
342
|
+
return f.apply(this, args);
|
|
343
|
+
} catch (e) {
|
|
344
|
+
const idx = addToExternrefTable0(e);
|
|
345
|
+
wasm.__wbindgen_exn_store(idx);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function isLikeNone(x) {
|
|
349
|
+
return x === void 0 || x === null;
|
|
350
|
+
}
|
|
351
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
352
|
+
if (realloc === void 0) {
|
|
353
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
354
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
355
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
356
|
+
WASM_VECTOR_LEN = buf.length;
|
|
357
|
+
return ptr;
|
|
358
|
+
}
|
|
359
|
+
let len = arg.length;
|
|
360
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
361
|
+
const mem = getUint8ArrayMemory0();
|
|
362
|
+
let offset = 0;
|
|
363
|
+
for (; offset < len; offset++) {
|
|
364
|
+
const code = arg.charCodeAt(offset);
|
|
365
|
+
if (code > 127) break;
|
|
366
|
+
mem[ptr + offset] = code;
|
|
367
|
+
}
|
|
368
|
+
if (offset !== len) {
|
|
369
|
+
if (offset !== 0) arg = arg.slice(offset);
|
|
370
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
371
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
372
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
373
|
+
offset += ret.written;
|
|
374
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
375
|
+
}
|
|
376
|
+
WASM_VECTOR_LEN = offset;
|
|
377
|
+
return ptr;
|
|
378
|
+
}
|
|
379
|
+
function takeFromExternrefTable0(idx) {
|
|
380
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
381
|
+
wasm.__externref_table_dealloc(idx);
|
|
382
|
+
return value;
|
|
383
|
+
}
|
|
384
|
+
let cachedTextDecoder = new TextDecoder("utf-8", {
|
|
385
|
+
ignoreBOM: true,
|
|
386
|
+
fatal: true
|
|
387
|
+
});
|
|
388
|
+
cachedTextDecoder.decode();
|
|
389
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
390
|
+
let numBytesDecoded = 0;
|
|
391
|
+
function decodeText(ptr, len) {
|
|
392
|
+
numBytesDecoded += len;
|
|
393
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
394
|
+
cachedTextDecoder = new TextDecoder("utf-8", {
|
|
395
|
+
ignoreBOM: true,
|
|
396
|
+
fatal: true
|
|
397
|
+
});
|
|
398
|
+
cachedTextDecoder.decode();
|
|
399
|
+
numBytesDecoded = len;
|
|
400
|
+
}
|
|
401
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
402
|
+
}
|
|
403
|
+
const cachedTextEncoder = new TextEncoder();
|
|
404
|
+
if (!("encodeInto" in cachedTextEncoder)) cachedTextEncoder.encodeInto = function(arg, view) {
|
|
405
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
406
|
+
view.set(buf);
|
|
407
|
+
return {
|
|
408
|
+
read: arg.length,
|
|
409
|
+
written: buf.length
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
let WASM_VECTOR_LEN = 0, wasm;
|
|
413
|
+
function __wbg_finalize_init(instance, module) {
|
|
414
|
+
wasm = instance.exports;
|
|
415
|
+
cachedDataViewMemory0 = null;
|
|
416
|
+
cachedUint8ArrayMemory0 = null;
|
|
417
|
+
wasm.__wbindgen_start();
|
|
418
|
+
return wasm;
|
|
419
|
+
}
|
|
420
|
+
async function __wbg_load(module, imports) {
|
|
421
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
422
|
+
if (typeof WebAssembly.instantiateStreaming === "function") try {
|
|
423
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
424
|
+
} catch (e) {
|
|
425
|
+
if (module.ok && expectedResponseType(module.type) && module.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
426
|
+
else throw e;
|
|
427
|
+
}
|
|
428
|
+
const bytes = await module.arrayBuffer();
|
|
429
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
430
|
+
} else {
|
|
431
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
432
|
+
if (instance instanceof WebAssembly.Instance) return {
|
|
433
|
+
instance,
|
|
434
|
+
module
|
|
435
|
+
};
|
|
436
|
+
else return instance;
|
|
437
|
+
}
|
|
438
|
+
function expectedResponseType(type) {
|
|
439
|
+
switch (type) {
|
|
440
|
+
case "basic":
|
|
441
|
+
case "cors":
|
|
442
|
+
case "default": return true;
|
|
443
|
+
}
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
async function __wbg_init(module_or_path) {
|
|
448
|
+
if (wasm !== void 0) return wasm;
|
|
449
|
+
if (module_or_path !== void 0) if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
|
|
450
|
+
else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
451
|
+
if (module_or_path === void 0) module_or_path = new URL("shinkore_bg.wasm", {}.url);
|
|
452
|
+
const imports = __wbg_get_imports();
|
|
453
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
|
|
454
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
455
|
+
return __wbg_finalize_init(instance, module);
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
exports.CompatEngine = CompatEngine;
|
|
459
|
+
exports.__wbg_init = __wbg_init;
|
package/dist/modules/shinkom.cjs
CHANGED
|
@@ -1 +1,73 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
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 +1,53 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./compat-ui.cjs");
|