shinkom 1.1.0 → 1.1.2

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 (85) hide show
  1. package/README.md +0 -18
  2. package/dist/bundles/_virtual/_rolldown/runtime.js +14 -14
  3. package/dist/bundles/core/constants.d.ts +15 -15
  4. package/dist/bundles/core/constants.js +23 -23
  5. package/dist/bundles/core/elements/compat-view-element.d.ts +99 -99
  6. package/dist/bundles/core/elements/compat-view-element.js +440 -440
  7. package/dist/bundles/core/elements/control-panel-element.d.ts +44 -44
  8. package/dist/bundles/core/elements/control-panel-element.js +99 -99
  9. package/dist/bundles/core/elements/index.d.ts +12 -12
  10. package/dist/bundles/core/elements/index.js +13 -13
  11. package/dist/bundles/core/elements/inspector-element.d.ts +26 -26
  12. package/dist/bundles/core/elements/inspector-element.js +58 -58
  13. package/dist/bundles/core/elements/recent-result-item.js +46 -46
  14. package/dist/bundles/core/elements/results-history-item.js +46 -46
  15. package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -462
  16. package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -335
  17. package/dist/bundles/core/elements/templates/root-styles.template.js +40 -40
  18. package/dist/bundles/core/event-bus.d.ts +46 -46
  19. package/dist/bundles/core/event-bus.js +49 -49
  20. package/dist/bundles/core/helpers.js +47 -47
  21. package/dist/bundles/core/index.d.ts +14 -14
  22. package/dist/bundles/core/index.js +16 -16
  23. package/dist/bundles/core/state-service.d.ts +56 -56
  24. package/dist/bundles/core/state-service.js +91 -80
  25. package/dist/bundles/core/ui-component.d.ts +63 -63
  26. package/dist/bundles/core/ui-component.js +71 -71
  27. package/dist/bundles/engine/engine.d.ts +108 -108
  28. package/dist/bundles/engine/engine.js +238 -238
  29. package/dist/bundles/engine/index.js +8 -8
  30. package/dist/bundles/gen/index.js +14 -14
  31. package/dist/bundles/index.d.ts +19 -19
  32. package/dist/bundles/index.js +23 -23
  33. package/dist/bundles/pkg/shinkore.d.ts +40 -50
  34. package/dist/bundles/pkg/shinkore.js +465 -465
  35. package/dist/bundles/pkg/shinkore_bg.wasm +0 -0
  36. package/dist/bundles/shinkom.d.ts +41 -41
  37. package/dist/bundles/shinkom.js +80 -80
  38. package/dist/bundles/ui/compat-ui/compat-ui.d.ts +42 -42
  39. package/dist/bundles/ui/compat-ui/compat-ui.js +59 -59
  40. package/dist/bundles/ui/compat-ui/index.js +8 -8
  41. package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +41 -41
  42. package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -229
  43. package/dist/bundles/ui/compatibility-view/index.js +8 -8
  44. package/dist/bundles/ui/control-panel/control-panel.d.ts +52 -52
  45. package/dist/bundles/ui/control-panel/control-panel.js +320 -320
  46. package/dist/bundles/ui/control-panel/index.js +8 -8
  47. package/dist/bundles/ui/index.d.ts +11 -11
  48. package/dist/bundles/ui/index.js +16 -16
  49. package/dist/bundles/ui/inspector/index.js +8 -8
  50. package/dist/bundles/ui/inspector/inspector.d.ts +97 -97
  51. package/dist/bundles/ui/inspector/inspector.js +394 -394
  52. package/dist/modules/core/constants.cjs +17 -17
  53. package/dist/modules/core/elements/compat-view-element.cjs +434 -434
  54. package/dist/modules/core/elements/control-panel-element.cjs +93 -93
  55. package/dist/modules/core/elements/index.cjs +11 -11
  56. package/dist/modules/core/elements/inspector-element.cjs +52 -52
  57. package/dist/modules/core/elements/recent-result-item.cjs +39 -39
  58. package/dist/modules/core/elements/results-history-item.cjs +39 -39
  59. package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -458
  60. package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -332
  61. package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -33
  62. package/dist/modules/core/event-bus.cjs +43 -43
  63. package/dist/modules/core/helpers.cjs +41 -41
  64. package/dist/modules/core/index.cjs +16 -16
  65. package/dist/modules/core/state-service.cjs +85 -74
  66. package/dist/modules/core/ui-component.cjs +65 -65
  67. package/dist/modules/engine/engine.cjs +232 -232
  68. package/dist/modules/gen/browser-data.cjs +100 -100
  69. package/dist/modules/gen/browser-usage-data.cjs +675 -675
  70. package/dist/modules/gen/compat-data.cjs +31015 -31015
  71. package/dist/modules/gen/index.cjs +7 -7
  72. package/dist/modules/index.cjs +27 -27
  73. package/dist/modules/pkg/shinkore.cjs +459 -459
  74. package/dist/modules/pkg/shinkore_bg.wasm +0 -0
  75. package/dist/modules/shinkom.cjs +73 -73
  76. package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -53
  77. package/dist/modules/ui/compat-ui/index.cjs +1 -1
  78. package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -223
  79. package/dist/modules/ui/compatibility-view/index.cjs +1 -1
  80. package/dist/modules/ui/control-panel/control-panel.cjs +314 -314
  81. package/dist/modules/ui/control-panel/index.cjs +1 -1
  82. package/dist/modules/ui/index.cjs +13 -13
  83. package/dist/modules/ui/inspector/index.cjs +1 -1
  84. package/dist/modules/ui/inspector/inspector.cjs +388 -388
  85. package/package.json +100 -100
@@ -1,93 +1,93 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_helpers = require("../helpers.cjs");
3
- const require_root_styles_template = require("./templates/root-styles.template.cjs");
4
- const require_control_panel_templates = require("./templates/control-panel.templates.cjs");
5
- //#region src/core/elements/control-panel-element.js
6
- /**
7
- * @type {typeof HTMLElement}
8
- */
9
- const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
10
- /**@type {CSSStyleSheet | null} */
11
- let cachedHostStyleSheet = null;
12
- /**@type {CSSStyleSheet | null} */
13
- let cachedStyleSheet = null;
14
- /**@type {CSSStyleSheet | null} */
15
- let cachedTransitions = null;
16
- /**
17
- * A custom element for the `CompatControlPanel` UI component.
18
- *
19
- * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
20
- * This component contains methods for rendering components for the `CompatControlPanel` and providing settings for customization of different
21
- * UI components.
22
- *
23
- * Since this element is defined via the Web Components API, to use this element outside of the `CompatControlPanel`, it must be registered
24
- * as a custom element on the `window` object.
25
- * @extends {BaseElement}
26
- */
27
- var CompatControlPanelElement = class extends BaseElement {
28
- constructor() {
29
- super();
30
- /**@type {ShadowRoot} */
31
- this.shadowRootRef = this.attachShadow({ mode: "open" });
32
- this.shadowHost = document.createElement("div");
33
- this.shadowHost.id = "sk-shadow-host";
34
- cachedHostStyleSheet = require_helpers.getStyleSheet(cachedHostStyleSheet, require_root_styles_template.hostStyles);
35
- cachedStyleSheet = require_helpers.getStyleSheet(cachedStyleSheet, require_control_panel_templates.controlPanelStyles);
36
- cachedTransitions = require_helpers.getStyleSheet(cachedTransitions, require_control_panel_templates.controlPanelTransitions);
37
- }
38
- connectedCallback() {
39
- Object.assign(this.shadowHost.style, {
40
- position: "fixed",
41
- top: "2rem",
42
- left: "2rem",
43
- zIndex: "992"
44
- });
45
- if (cachedTransitions) document.adoptedStyleSheets.push(cachedTransitions);
46
- if (cachedHostStyleSheet) this.shadowRootRef.adoptedStyleSheets = [cachedHostStyleSheet];
47
- if (cachedStyleSheet) this.shadowRootRef.adoptedStyleSheets.push(cachedStyleSheet);
48
- this.shadowRootRef.appendChild(this.shadowHost);
49
- this.render();
50
- }
51
- disconnectedCallback() {
52
- document.adoptedStyleSheets = document.adoptedStyleSheets.filter((sheet) => sheet !== cachedTransitions);
53
- }
54
- /**
55
- * Renders the `ControlPanelElement` on a specific tab.
56
- *
57
- * Renders the `inspector` tab by default.
58
- * @param {"inspector" | "compatView" | undefined} tab
59
- */
60
- render(tab = void 0) {
61
- this.shadowHost.innerHTML = require_control_panel_templates.controlPanelHTML;
62
- tab ? this.renderTabContent(tab) : this.renderTabContent("inspector");
63
- }
64
- /**
65
- * Renders content for a specific tab.
66
- * @param {"inspector" | "compatView"} tab
67
- */
68
- renderTabContent(tab) {
69
- const main = this.shadowRootRef.getElementById("sk-control-panel-main");
70
- switch (tab) {
71
- case "inspector":
72
- if (main) main.innerHTML = require_control_panel_templates.controlPanelInspectorTab;
73
- break;
74
- case "compatView":
75
- if (main) main.innerHTML = require_control_panel_templates.controlPanelCompatViewTab;
76
- break;
77
- default: break;
78
- }
79
- }
80
- /**
81
- * Renders the display of the `ControlPanelElement`.
82
- * @param {"show" | "hide"} display
83
- */
84
- renderDisplayTransition(display) {
85
- const panel = this.shadowRootRef.getElementById("sk-control-panel");
86
- if (panel) {
87
- if (display === "show") panel.style.display = "flex";
88
- else if (display === "hide") panel.style.display = "none";
89
- }
90
- }
91
- };
92
- //#endregion
93
- exports.CompatControlPanelElement = CompatControlPanelElement;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_helpers = require("../helpers.cjs");
3
+ const require_root_styles_template = require("./templates/root-styles.template.cjs");
4
+ const require_control_panel_templates = require("./templates/control-panel.templates.cjs");
5
+ //#region src/core/elements/control-panel-element.js
6
+ /**
7
+ * @type {typeof HTMLElement}
8
+ */
9
+ const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
10
+ /**@type {CSSStyleSheet | null} */
11
+ let cachedHostStyleSheet = null;
12
+ /**@type {CSSStyleSheet | null} */
13
+ let cachedStyleSheet = null;
14
+ /**@type {CSSStyleSheet | null} */
15
+ let cachedTransitions = null;
16
+ /**
17
+ * A custom element for the `CompatControlPanel` UI component.
18
+ *
19
+ * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
20
+ * This component contains methods for rendering components for the `CompatControlPanel` and providing settings for customization of different
21
+ * UI components.
22
+ *
23
+ * Since this element is defined via the Web Components API, to use this element outside of the `CompatControlPanel`, it must be registered
24
+ * as a custom element on the `window` object.
25
+ * @extends {BaseElement}
26
+ */
27
+ var CompatControlPanelElement = class extends BaseElement {
28
+ constructor() {
29
+ super();
30
+ /**@type {ShadowRoot} */
31
+ this.shadowRootRef = this.attachShadow({ mode: "open" });
32
+ this.shadowHost = document.createElement("div");
33
+ this.shadowHost.id = "sk-shadow-host";
34
+ cachedHostStyleSheet = require_helpers.getStyleSheet(cachedHostStyleSheet, require_root_styles_template.hostStyles);
35
+ cachedStyleSheet = require_helpers.getStyleSheet(cachedStyleSheet, require_control_panel_templates.controlPanelStyles);
36
+ cachedTransitions = require_helpers.getStyleSheet(cachedTransitions, require_control_panel_templates.controlPanelTransitions);
37
+ }
38
+ connectedCallback() {
39
+ Object.assign(this.shadowHost.style, {
40
+ position: "fixed",
41
+ top: "2rem",
42
+ left: "2rem",
43
+ zIndex: "992"
44
+ });
45
+ if (cachedTransitions) document.adoptedStyleSheets.push(cachedTransitions);
46
+ if (cachedHostStyleSheet) this.shadowRootRef.adoptedStyleSheets = [cachedHostStyleSheet];
47
+ if (cachedStyleSheet) this.shadowRootRef.adoptedStyleSheets.push(cachedStyleSheet);
48
+ this.shadowRootRef.appendChild(this.shadowHost);
49
+ this.render();
50
+ }
51
+ disconnectedCallback() {
52
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter((sheet) => sheet !== cachedTransitions);
53
+ }
54
+ /**
55
+ * Renders the `ControlPanelElement` on a specific tab.
56
+ *
57
+ * Renders the `inspector` tab by default.
58
+ * @param {"inspector" | "compatView" | undefined} tab
59
+ */
60
+ render(tab = void 0) {
61
+ this.shadowHost.innerHTML = require_control_panel_templates.controlPanelHTML;
62
+ tab ? this.renderTabContent(tab) : this.renderTabContent("inspector");
63
+ }
64
+ /**
65
+ * Renders content for a specific tab.
66
+ * @param {"inspector" | "compatView"} tab
67
+ */
68
+ renderTabContent(tab) {
69
+ const main = this.shadowRootRef.getElementById("sk-control-panel-main");
70
+ switch (tab) {
71
+ case "inspector":
72
+ if (main) main.innerHTML = require_control_panel_templates.controlPanelInspectorTab;
73
+ break;
74
+ case "compatView":
75
+ if (main) main.innerHTML = require_control_panel_templates.controlPanelCompatViewTab;
76
+ break;
77
+ default: break;
78
+ }
79
+ }
80
+ /**
81
+ * Renders the display of the `ControlPanelElement`.
82
+ * @param {"show" | "hide"} display
83
+ */
84
+ renderDisplayTransition(display) {
85
+ const panel = this.shadowRootRef.getElementById("sk-control-panel");
86
+ if (panel) {
87
+ if (display === "show") panel.style.display = "flex";
88
+ else if (display === "hide") panel.style.display = "none";
89
+ }
90
+ }
91
+ };
92
+ //#endregion
93
+ exports.CompatControlPanelElement = CompatControlPanelElement;
@@ -1,11 +1,11 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_recent_result_item = require("./recent-result-item.cjs");
3
- const require_results_history_item = require("./results-history-item.cjs");
4
- const require_core_elements_compat_view_element = require("./compat-view-element.cjs");
5
- const require_core_elements_control_panel_element = require("./control-panel-element.cjs");
6
- const require_core_elements_inspector_element = require("./inspector-element.cjs");
7
- exports.CompatControlPanelElement = require_core_elements_control_panel_element.CompatControlPanelElement;
8
- exports.CompatInspectorElement = require_core_elements_inspector_element.CompatInspectorElement;
9
- exports.CompatViewElement = require_core_elements_compat_view_element.CompatViewElement;
10
- exports.RecentResultItem = require_recent_result_item.RecentResultItem;
11
- exports.ResultsHistoryItem = require_results_history_item.ResultsHistoryItem;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_recent_result_item = require("./recent-result-item.cjs");
3
+ const require_results_history_item = require("./results-history-item.cjs");
4
+ const require_core_elements_compat_view_element = require("./compat-view-element.cjs");
5
+ const require_core_elements_control_panel_element = require("./control-panel-element.cjs");
6
+ const require_core_elements_inspector_element = require("./inspector-element.cjs");
7
+ exports.CompatControlPanelElement = require_core_elements_control_panel_element.CompatControlPanelElement;
8
+ exports.CompatInspectorElement = require_core_elements_inspector_element.CompatInspectorElement;
9
+ exports.CompatViewElement = require_core_elements_compat_view_element.CompatViewElement;
10
+ exports.RecentResultItem = require_recent_result_item.RecentResultItem;
11
+ exports.ResultsHistoryItem = require_results_history_item.ResultsHistoryItem;
@@ -1,52 +1,52 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/core/elements/inspector-element.js
3
- /**
4
- * @type {typeof HTMLElement}
5
- */
6
- const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
7
- /**
8
- * A custom element for the `CompatInspector` UI component.
9
- *
10
- * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
11
- * This component is used for defining and initializing the styling and structure of the `CompatInspector`.
12
- *
13
- * Since this element is defined via the Web Components API, to use this element outside of the `CompatInspector`, it must be registered
14
- * as a custom element on the `window` object.
15
- * @extends {BaseElement}
16
- */
17
- var CompatInspectorElement = class extends BaseElement {
18
- constructor() {
19
- super();
20
- /**@type {ShadowRoot} */
21
- this.shadowRootRef = this.attachShadow({ mode: "open" });
22
- this.shadowHost = document.createElement("div");
23
- this.styles = document.createElement("style");
24
- this.shadowHost.id = "sk-compat-inspector";
25
- }
26
- connectedCallback() {
27
- this.styles.textContent = `
28
- #sk-compat-inspector {
29
- position: absolute;
30
- top: 0;
31
- background-color: rgba(0, 255, 0, .3);
32
- outline-width: 1px;
33
- outline-style: dashed;
34
- outline-color: rgb(0, 255, 0);
35
- outline-offset: 4px;
36
- z-index: 990;
37
- transition-property: width, height, transform;
38
- transition-duration: 300ms;
39
- transition-timing-function: ease-out;
40
- will-change: width, height, transform;
41
- pointer-events: none;
42
- }
43
- `;
44
- try {
45
- this.shadowRootRef.replaceChildren(...[this.styles, this.shadowHost]);
46
- } catch (error) {
47
- console.error(error);
48
- }
49
- }
50
- };
51
- //#endregion
52
- exports.CompatInspectorElement = CompatInspectorElement;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/core/elements/inspector-element.js
3
+ /**
4
+ * @type {typeof HTMLElement}
5
+ */
6
+ const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
7
+ /**
8
+ * A custom element for the `CompatInspector` UI component.
9
+ *
10
+ * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
11
+ * This component is used for defining and initializing the styling and structure of the `CompatInspector`.
12
+ *
13
+ * Since this element is defined via the Web Components API, to use this element outside of the `CompatInspector`, it must be registered
14
+ * as a custom element on the `window` object.
15
+ * @extends {BaseElement}
16
+ */
17
+ var CompatInspectorElement = class extends BaseElement {
18
+ constructor() {
19
+ super();
20
+ /**@type {ShadowRoot} */
21
+ this.shadowRootRef = this.attachShadow({ mode: "open" });
22
+ this.shadowHost = document.createElement("div");
23
+ this.styles = document.createElement("style");
24
+ this.shadowHost.id = "sk-compat-inspector";
25
+ }
26
+ connectedCallback() {
27
+ this.styles.textContent = `
28
+ #sk-compat-inspector {
29
+ position: absolute;
30
+ top: 0;
31
+ background-color: rgba(0, 255, 0, .3);
32
+ outline-width: 1px;
33
+ outline-style: dashed;
34
+ outline-color: rgb(0, 255, 0);
35
+ outline-offset: 4px;
36
+ z-index: 990;
37
+ transition-property: width, height, transform;
38
+ transition-duration: 300ms;
39
+ transition-timing-function: ease-out;
40
+ will-change: width, height, transform;
41
+ pointer-events: none;
42
+ }
43
+ `;
44
+ try {
45
+ this.shadowRootRef.replaceChildren(...[this.styles, this.shadowHost]);
46
+ } catch (error) {
47
+ console.error(error);
48
+ }
49
+ }
50
+ };
51
+ //#endregion
52
+ exports.CompatInspectorElement = CompatInspectorElement;
@@ -1,39 +1,39 @@
1
- //#region src/core/elements/recent-result-item.js
2
- /**@typedef {import('../../types/public').CompatSnapshot} CompatSnapshot */
3
- /**
4
- * @type {typeof HTMLElement}
5
- */
6
- const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
7
- /**
8
- * A custom element for rendering a recent compatibility result item.
9
- *
10
- * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
11
- * This component is used for creating unique items that store their assigned compatibility result for future viewing.
12
- *
13
- * Since this element is defined via the Web Components API it must be registered
14
- * as a custom element on the `window` object.
15
- * @extends {BaseElement}
16
- */
17
- var RecentResultItem = class extends BaseElement {
18
- constructor() {
19
- super();
20
- /**@type {CompatSnapshot | null} */
21
- this._result = null;
22
- /** @type {function(CompatSnapshot): void} */
23
- this.viewResult = () => {};
24
- }
25
- get result() {
26
- return this._result;
27
- }
28
- set result(val) {
29
- if (val) this._result = val;
30
- }
31
- connectedCallback() {
32
- const detailsButton = this.querySelector(".sk-view-result");
33
- if (detailsButton instanceof HTMLButtonElement) detailsButton.addEventListener("click", () => {
34
- if (this.result) this.viewResult(this.result);
35
- });
36
- }
37
- };
38
- //#endregion
39
- exports.RecentResultItem = RecentResultItem;
1
+ //#region src/core/elements/recent-result-item.js
2
+ /**@typedef {import('../../types/public').CompatSnapshot} CompatSnapshot */
3
+ /**
4
+ * @type {typeof HTMLElement}
5
+ */
6
+ const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
7
+ /**
8
+ * A custom element for rendering a recent compatibility result item.
9
+ *
10
+ * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
11
+ * This component is used for creating unique items that store their assigned compatibility result for future viewing.
12
+ *
13
+ * Since this element is defined via the Web Components API it must be registered
14
+ * as a custom element on the `window` object.
15
+ * @extends {BaseElement}
16
+ */
17
+ var RecentResultItem = class extends BaseElement {
18
+ constructor() {
19
+ super();
20
+ /**@type {CompatSnapshot | null} */
21
+ this._result = null;
22
+ /** @type {function(CompatSnapshot): void} */
23
+ this.viewResult = () => {};
24
+ }
25
+ get result() {
26
+ return this._result;
27
+ }
28
+ set result(val) {
29
+ if (val) this._result = val;
30
+ }
31
+ connectedCallback() {
32
+ const detailsButton = this.querySelector(".sk-view-result");
33
+ if (detailsButton instanceof HTMLButtonElement) detailsButton.addEventListener("click", () => {
34
+ if (this.result) this.viewResult(this.result);
35
+ });
36
+ }
37
+ };
38
+ //#endregion
39
+ exports.RecentResultItem = RecentResultItem;
@@ -1,39 +1,39 @@
1
- //#region src/core/elements/results-history-item.js
2
- /**@typedef {import("../../types/public").CompatSnapshot} CompatSnapshot */
3
- /**
4
- * @type {typeof HTMLElement}
5
- */
6
- const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
7
- /**
8
- * A custom element for rendering a compatibility result item from the results history object.
9
- *
10
- * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
11
- * This component is used for creating unique items that store their assigned compatibility result for future viewing.
12
- *
13
- * Since this element is defined via the Web Components API it must be registered
14
- * as a custom element on the `window` object.
15
- * @extends {BaseElement}
16
- */
17
- var ResultsHistoryItem = class extends BaseElement {
18
- constructor() {
19
- super();
20
- /**@type {CompatSnapshot | null} */
21
- this._result = null;
22
- /**@type {function(CompatSnapshot): void} */
23
- this.viewResult = () => {};
24
- }
25
- get result() {
26
- return this._result;
27
- }
28
- set result(val) {
29
- if (val) this._result = val;
30
- }
31
- connectedCallback() {
32
- const historyItem = this.querySelector(".sk-history-item");
33
- if (historyItem instanceof HTMLDivElement) historyItem.addEventListener("click", () => {
34
- if (this.result) this.viewResult(this.result);
35
- });
36
- }
37
- };
38
- //#endregion
39
- exports.ResultsHistoryItem = ResultsHistoryItem;
1
+ //#region src/core/elements/results-history-item.js
2
+ /**@typedef {import("../../types/public").CompatSnapshot} CompatSnapshot */
3
+ /**
4
+ * @type {typeof HTMLElement}
5
+ */
6
+ const BaseElement = typeof window !== "undefined" ? HTMLElement : class {};
7
+ /**
8
+ * A custom element for rendering a compatibility result item from the results history object.
9
+ *
10
+ * An autonomous custom element created via the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
11
+ * This component is used for creating unique items that store their assigned compatibility result for future viewing.
12
+ *
13
+ * Since this element is defined via the Web Components API it must be registered
14
+ * as a custom element on the `window` object.
15
+ * @extends {BaseElement}
16
+ */
17
+ var ResultsHistoryItem = class extends BaseElement {
18
+ constructor() {
19
+ super();
20
+ /**@type {CompatSnapshot | null} */
21
+ this._result = null;
22
+ /**@type {function(CompatSnapshot): void} */
23
+ this.viewResult = () => {};
24
+ }
25
+ get result() {
26
+ return this._result;
27
+ }
28
+ set result(val) {
29
+ if (val) this._result = val;
30
+ }
31
+ connectedCallback() {
32
+ const historyItem = this.querySelector(".sk-history-item");
33
+ if (historyItem instanceof HTMLDivElement) historyItem.addEventListener("click", () => {
34
+ if (this.result) this.viewResult(this.result);
35
+ });
36
+ }
37
+ };
38
+ //#endregion
39
+ exports.ResultsHistoryItem = ResultsHistoryItem;