llm-testrunner-components 1.0.0 → 1.0.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.
- package/README.md +139 -81
- package/dist/cjs/{index-CCrH7f-W.js → index-CY2lQip_.js} +190 -33
- package/dist/cjs/index-CY2lQip_.js.map +1 -0
- package/dist/cjs/index.cjs.js +391 -5
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/llm-test-runner.cjs.entry.js +9 -0
- package/dist/cjs/llm-test-runner.entry.cjs.js.map +1 -0
- package/dist/cjs/{llm-testrunner-components.cjs.js → llm-testrunner.cjs.js} +5 -7
- package/dist/cjs/llm-testrunner.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -4
- package/dist/collection/collection-manifest.json +3 -4
- package/dist/collection/components/error-message/error-message.js +8 -0
- package/dist/collection/components/error-message/error-message.js.map +1 -0
- package/dist/collection/components/llm-test-runner/llm-test-runner.css +671 -0
- package/dist/collection/components/llm-test-runner/llm-test-runner.js +310 -0
- package/dist/collection/components/llm-test-runner/llm-test-runner.js.map +1 -0
- package/dist/collection/index.js +4 -10
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/lib/evaluation/evaluation-engine.js +61 -0
- package/dist/collection/lib/evaluation/evaluation-engine.js.map +1 -0
- package/dist/collection/lib/evaluation/index.js +7 -0
- package/dist/collection/lib/evaluation/index.js.map +1 -0
- package/dist/collection/lib/evaluation/types.js +2 -0
- package/dist/collection/lib/evaluation/types.js.map +1 -0
- package/dist/components/index.js +1652 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/{current-time.d.ts → llm-test-runner.d.ts} +4 -4
- package/dist/components/llm-test-runner.js +9 -0
- package/dist/components/llm-test-runner.js.map +1 -0
- package/dist/esm/{index-0jlGA6MK.js → index-DBp-rMPb.js} +190 -33
- package/dist/esm/index-DBp-rMPb.js.map +1 -0
- package/dist/esm/index.js +391 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/llm-test-runner.entry.js +3 -0
- package/dist/esm/llm-test-runner.entry.js.map +1 -0
- package/dist/esm/{llm-testrunner-components.js → llm-testrunner.js} +5 -7
- package/dist/esm/llm-testrunner.js.map +1 -0
- package/dist/esm/loader.js +3 -5
- package/dist/llm-testrunner/index.esm.js +2 -0
- package/dist/llm-testrunner/index.esm.js.map +1 -0
- package/dist/llm-testrunner/llm-test-runner.entry.esm.js.map +1 -0
- package/dist/llm-testrunner/llm-testrunner.esm.js +2 -0
- package/dist/llm-testrunner/llm-testrunner.esm.js.map +1 -0
- package/dist/llm-testrunner/p-DBp-rMPb.js +3 -0
- package/dist/llm-testrunner/p-DBp-rMPb.js.map +1 -0
- package/dist/llm-testrunner/p-ed2ea423.entry.js +2 -0
- package/dist/llm-testrunner/p-ed2ea423.entry.js.map +1 -0
- package/dist/react/components.d.ts +9 -0
- package/dist/react/components.d.ts.map +1 -0
- package/dist/react/components.js +12 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +2 -0
- package/dist/types/components/error-message/error-message.d.ts +7 -0
- package/dist/types/components/llm-test-runner/llm-test-runner.d.ts +42 -0
- package/dist/types/components.d.ts +11 -46
- package/dist/types/index.d.ts +2 -10
- package/dist/types/lib/evaluation/evaluation-engine.d.ts +8 -0
- package/dist/types/lib/evaluation/index.d.ts +5 -0
- package/dist/types/lib/evaluation/types.d.ts +23 -0
- package/dist/types/stencil-public-runtime.d.ts +41 -3
- package/package.json +33 -12
- package/dist/cjs/current-time.my-component.entry.cjs.js.map +0 -1
- package/dist/cjs/current-time_2.cjs.entry.js +0 -67
- package/dist/cjs/current-time_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-CCrH7f-W.js.map +0 -1
- package/dist/cjs/llm-testrunner-components.cjs.js.map +0 -1
- package/dist/collection/components/my-component/current-time.js +0 -35
- package/dist/collection/components/my-component/current-time.js.map +0 -1
- package/dist/collection/components/my-component/my-component.css +0 -3
- package/dist/collection/components/my-component/my-component.js +0 -96
- package/dist/collection/components/my-component/my-component.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/current-time.js +0 -9
- package/dist/components/current-time.js.map +0 -1
- package/dist/components/my-component.d.ts +0 -11
- package/dist/components/my-component.js +0 -63
- package/dist/components/my-component.js.map +0 -1
- package/dist/components/p-CbvWSaCI.js +0 -53
- package/dist/components/p-CbvWSaCI.js.map +0 -1
- package/dist/components/p-DnDi6fKi.js +0 -1101
- package/dist/components/p-DnDi6fKi.js.map +0 -1
- package/dist/esm/current-time.my-component.entry.js.map +0 -1
- package/dist/esm/current-time_2.entry.js +0 -64
- package/dist/esm/current-time_2.entry.js.map +0 -1
- package/dist/esm/index-0jlGA6MK.js.map +0 -1
- package/dist/esm/llm-testrunner-components.js.map +0 -1
- package/dist/llm-testrunner-components/current-time.my-component.entry.esm.js.map +0 -1
- package/dist/llm-testrunner-components/index.esm.js +0 -2
- package/dist/llm-testrunner-components/index.esm.js.map +0 -1
- package/dist/llm-testrunner-components/llm-testrunner-components.esm.js +0 -2
- package/dist/llm-testrunner-components/llm-testrunner-components.esm.js.map +0 -1
- package/dist/llm-testrunner-components/p-0jlGA6MK.js +0 -3
- package/dist/llm-testrunner-components/p-0jlGA6MK.js.map +0 -1
- package/dist/llm-testrunner-components/p-15e5e0fe.entry.js +0 -2
- package/dist/llm-testrunner-components/p-15e5e0fe.entry.js.map +0 -1
- package/dist/types/components/my-component/current-time.d.ts +0 -7
- package/dist/types/components/my-component/my-component.d.ts +0 -16
- package/dist/types/utils/utils.d.ts +0 -1
- /package/dist/{llm-testrunner-components → llm-testrunner}/loader.esm.js.map +0 -0
- /package/dist/{llm-testrunner-components → llm-testrunner}/p-DQuL1Twl.js +0 -0
- /package/dist/{llm-testrunner-components → llm-testrunner}/p-DQuL1Twl.js.map +0 -0
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { format } from "../../utils/utils";
|
|
3
|
-
export class MyComponent {
|
|
4
|
-
/**
|
|
5
|
-
* The first name
|
|
6
|
-
*/
|
|
7
|
-
first;
|
|
8
|
-
/**
|
|
9
|
-
* The middle name
|
|
10
|
-
*/
|
|
11
|
-
middle;
|
|
12
|
-
/**
|
|
13
|
-
* The last name
|
|
14
|
-
*/
|
|
15
|
-
last;
|
|
16
|
-
getText() {
|
|
17
|
-
return format(this.first, this.middle, this.last);
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return (h("div", { key: '538552b1fa1db142ea88eb71047cd1da9fbfb224' }, "Hello, World! I'm ", this.getText(), " ", h("br", { key: 'f27acd01ea5f08223805a7f79b0763d45a2e70bf' }), "Current time: ", h("current-time", { key: '615f447c114321de1a748703672a3cf9217df591' })));
|
|
21
|
-
}
|
|
22
|
-
static get is() { return "my-component"; }
|
|
23
|
-
static get encapsulation() { return "shadow"; }
|
|
24
|
-
static get originalStyleUrls() {
|
|
25
|
-
return {
|
|
26
|
-
"$": ["my-component.css"]
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
static get styleUrls() {
|
|
30
|
-
return {
|
|
31
|
-
"$": ["my-component.css"]
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
static get properties() {
|
|
35
|
-
return {
|
|
36
|
-
"first": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"attribute": "first",
|
|
39
|
-
"mutable": false,
|
|
40
|
-
"complexType": {
|
|
41
|
-
"original": "string",
|
|
42
|
-
"resolved": "string",
|
|
43
|
-
"references": {}
|
|
44
|
-
},
|
|
45
|
-
"required": false,
|
|
46
|
-
"optional": false,
|
|
47
|
-
"docs": {
|
|
48
|
-
"tags": [],
|
|
49
|
-
"text": "The first name"
|
|
50
|
-
},
|
|
51
|
-
"getter": false,
|
|
52
|
-
"setter": false,
|
|
53
|
-
"reflect": false
|
|
54
|
-
},
|
|
55
|
-
"middle": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"attribute": "middle",
|
|
58
|
-
"mutable": false,
|
|
59
|
-
"complexType": {
|
|
60
|
-
"original": "string",
|
|
61
|
-
"resolved": "string",
|
|
62
|
-
"references": {}
|
|
63
|
-
},
|
|
64
|
-
"required": false,
|
|
65
|
-
"optional": false,
|
|
66
|
-
"docs": {
|
|
67
|
-
"tags": [],
|
|
68
|
-
"text": "The middle name"
|
|
69
|
-
},
|
|
70
|
-
"getter": false,
|
|
71
|
-
"setter": false,
|
|
72
|
-
"reflect": false
|
|
73
|
-
},
|
|
74
|
-
"last": {
|
|
75
|
-
"type": "string",
|
|
76
|
-
"attribute": "last",
|
|
77
|
-
"mutable": false,
|
|
78
|
-
"complexType": {
|
|
79
|
-
"original": "string",
|
|
80
|
-
"resolved": "string",
|
|
81
|
-
"references": {}
|
|
82
|
-
},
|
|
83
|
-
"required": false,
|
|
84
|
-
"optional": false,
|
|
85
|
-
"docs": {
|
|
86
|
-
"tags": [],
|
|
87
|
-
"text": "The last name"
|
|
88
|
-
},
|
|
89
|
-
"getter": false,
|
|
90
|
-
"setter": false,
|
|
91
|
-
"reflect": false
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=my-component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"my-component.js","sourceRoot":"","sources":["../../../src/components/my-component/my-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3C,MAAM,OAAO,WAAW;IACtB;;OAEG;IACK,KAAK,CAAS;IAEtB;;OAEG;IACK,MAAM,CAAS;IAEvB;;OAEG;IACK,IAAI,CAAS;IAEb,OAAO;QACb,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,MAAM;QACJ,OAAO,CACL;;YACqB,IAAI,CAAC,OAAO,EAAE;;YAAE,4DAAM;;YAC3B,sEAAgB,CAC1B,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { format } from '../../utils/utils';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.css',\n shadow: true,\n})\nexport class MyComponent {\n /**\n * The first name\n */\n @Prop() first: string;\n\n /**\n * The middle name\n */\n @Prop() middle: string;\n\n /**\n * The last name\n */\n @Prop() last: string;\n\n private getText(): string {\n return format(this.first, this.middle, this.last);\n }\n\n render() {\n return (\n <div>\n Hello, World! I'm {this.getText()} <br />\n Current time: <current-time />\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa;IACnE,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC","sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { C as CurrentTime$1, d as defineCustomElement$1 } from './p-CbvWSaCI.js';
|
|
2
|
-
|
|
3
|
-
const CurrentTime = CurrentTime$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { CurrentTime, defineCustomElement };
|
|
7
|
-
//# sourceMappingURL=current-time.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=current-time.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"current-time.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface MyComponent extends Components.MyComponent, HTMLElement {}
|
|
4
|
-
export const MyComponent: {
|
|
5
|
-
prototype: MyComponent;
|
|
6
|
-
new (): MyComponent;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-DnDi6fKi.js';
|
|
2
|
-
import { format } from './index.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-CbvWSaCI.js';
|
|
4
|
-
|
|
5
|
-
const myComponentCss = ":host{display:block}";
|
|
6
|
-
|
|
7
|
-
const MyComponent$1 = /*@__PURE__*/ proxyCustomElement(class MyComponent extends H {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this.__registerHost();
|
|
11
|
-
this.__attachShadow();
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* The first name
|
|
15
|
-
*/
|
|
16
|
-
first;
|
|
17
|
-
/**
|
|
18
|
-
* The middle name
|
|
19
|
-
*/
|
|
20
|
-
middle;
|
|
21
|
-
/**
|
|
22
|
-
* The last name
|
|
23
|
-
*/
|
|
24
|
-
last;
|
|
25
|
-
getText() {
|
|
26
|
-
return format(this.first, this.middle, this.last);
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return (h("div", { key: '538552b1fa1db142ea88eb71047cd1da9fbfb224' }, "Hello, World! I'm ", this.getText(), " ", h("br", { key: 'f27acd01ea5f08223805a7f79b0763d45a2e70bf' }), "Current time: ", h("current-time", { key: '615f447c114321de1a748703672a3cf9217df591' })));
|
|
30
|
-
}
|
|
31
|
-
static get style() { return myComponentCss; }
|
|
32
|
-
}, [257, "my-component", {
|
|
33
|
-
"first": [1],
|
|
34
|
-
"middle": [1],
|
|
35
|
-
"last": [1]
|
|
36
|
-
}]);
|
|
37
|
-
function defineCustomElement$1() {
|
|
38
|
-
if (typeof customElements === "undefined") {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const components = ["my-component", "current-time"];
|
|
42
|
-
components.forEach(tagName => { switch (tagName) {
|
|
43
|
-
case "my-component":
|
|
44
|
-
if (!customElements.get(tagName)) {
|
|
45
|
-
customElements.define(tagName, MyComponent$1);
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
case "current-time":
|
|
49
|
-
if (!customElements.get(tagName)) {
|
|
50
|
-
defineCustomElement$2();
|
|
51
|
-
}
|
|
52
|
-
break;
|
|
53
|
-
} });
|
|
54
|
-
}
|
|
55
|
-
defineCustomElement$1();
|
|
56
|
-
|
|
57
|
-
const MyComponent = MyComponent$1;
|
|
58
|
-
const defineCustomElement = defineCustomElement$1;
|
|
59
|
-
|
|
60
|
-
export { MyComponent, defineCustomElement };
|
|
61
|
-
//# sourceMappingURL=my-component.js.map
|
|
62
|
-
|
|
63
|
-
//# sourceMappingURL=my-component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"my-component.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,sBAAsB;;MCQhCA,aAAW,iBAAAC,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;;;;;;AACtB;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,MAAM;AAEd;;AAEG;AACK,IAAA,IAAI;IAEJ,OAAO,GAAA;AACb,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;IAGnD,MAAM,GAAA;QACJ,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,wBACqB,IAAI,CAAC,OAAO,EAAE,OAAE,CAAM,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,oBAC3B,CAAgB,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MyComponent","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/my-component/my-component.css?tag=my-component&encapsulation=shadow","src/components/my-component/my-component.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { format } from '../../utils/utils';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.css',\n shadow: true,\n})\nexport class MyComponent {\n /**\n * The first name\n */\n @Prop() first: string;\n\n /**\n * The middle name\n */\n @Prop() middle: string;\n\n /**\n * The last name\n */\n @Prop() last: string;\n\n private getText(): string {\n return format(this.first, this.middle, this.last);\n }\n\n render() {\n return (\n <div>\n Hello, World! I'm {this.getText()} <br />\n Current time: <current-time />\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-DnDi6fKi.js';
|
|
2
|
-
|
|
3
|
-
const CurrentTime = /*@__PURE__*/ proxyCustomElement(class CurrentTime extends H {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this.__registerHost();
|
|
7
|
-
}
|
|
8
|
-
// `timer` is not decorated with `@State()`, as
|
|
9
|
-
// we do not wish to trigger a rerender when its
|
|
10
|
-
// value changes
|
|
11
|
-
timer;
|
|
12
|
-
// `currentTime` is decorated with `@State()`,
|
|
13
|
-
// as we need to trigger a rerender when its
|
|
14
|
-
// value changes to show the latest time
|
|
15
|
-
currentTime = Date.now();
|
|
16
|
-
connectedCallback() {
|
|
17
|
-
// the assignment to `this.timer` will not
|
|
18
|
-
// trigger a re-render
|
|
19
|
-
this.timer = window.setInterval(() => {
|
|
20
|
-
// the assignment to `this.currentTime`
|
|
21
|
-
// will trigger a re-render
|
|
22
|
-
this.currentTime = Date.now();
|
|
23
|
-
}, 1000);
|
|
24
|
-
}
|
|
25
|
-
disconnectedCallback() {
|
|
26
|
-
window.clearInterval(this.timer);
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
const time = new Date(this.currentTime).toLocaleTimeString();
|
|
30
|
-
return (h("span", { key: '45b0df3ce3817ac64d22582b1a45c188b61656a4' }, time));
|
|
31
|
-
}
|
|
32
|
-
}, [256, "current-time", {
|
|
33
|
-
"currentTime": [32]
|
|
34
|
-
}]);
|
|
35
|
-
function defineCustomElement() {
|
|
36
|
-
if (typeof customElements === "undefined") {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const components = ["current-time"];
|
|
40
|
-
components.forEach(tagName => { switch (tagName) {
|
|
41
|
-
case "current-time":
|
|
42
|
-
if (!customElements.get(tagName)) {
|
|
43
|
-
customElements.define(tagName, CurrentTime);
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
} });
|
|
47
|
-
}
|
|
48
|
-
defineCustomElement();
|
|
49
|
-
|
|
50
|
-
export { CurrentTime as C, defineCustomElement as d };
|
|
51
|
-
//# sourceMappingURL=p-CbvWSaCI.js.map
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=p-CbvWSaCI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-CbvWSaCI.js","mappings":";;MAMa,WAAW,iBAAAA,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;;;;;;;;AAIpB,IAAA,KAAK;;;;AAKI,IAAA,WAAW,GAAW,IAAI,CAAC,GAAG,EAAE;IAEzC,iBAAiB,GAAA;;;QAGb,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAK;;;AAGjC,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE;SAChC,EAAE,IAAI,CAAC;;IAGZ,oBAAoB,GAAA;AAChB,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;;IAGpC,MAAM,GAAA;AACF,QAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,kBAAkB,EAAE;AAE5D,QAAA,QACI,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAO,IAAI,CAAQ;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/my-component/current-time.tsx"],"sourcesContent":["// First, we import State from '@stencil/core'\nimport { Component, State, h } from '@stencil/core';\n\n@Component({\n tag: 'current-time',\n})\nexport class CurrentTime {\n // `timer` is not decorated with `@State()`, as\n // we do not wish to trigger a rerender when its\n // value changes\n timer: number;\n\n // `currentTime` is decorated with `@State()`,\n // as we need to trigger a rerender when its\n // value changes to show the latest time\n @State() currentTime: number = Date.now();\n\n connectedCallback() {\n // the assignment to `this.timer` will not\n // trigger a re-render\n this.timer = window.setInterval(() => {\n // the assignment to `this.currentTime`\n // will trigger a re-render\n this.currentTime = Date.now();\n }, 1000);\n }\n\n disconnectedCallback() {\n window.clearInterval(this.timer);\n }\n\n render() {\n const time = new Date(this.currentTime).toLocaleTimeString();\n\n return (\n <span>{time}</span>\n );\n }\n}"],"version":3}
|