llm-testrunner-components 1.0.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/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/current-time.my-component.entry.cjs.js.map +1 -0
- package/dist/cjs/current-time_2.cjs.entry.js +67 -0
- package/dist/cjs/current-time_2.cjs.entry.js.map +1 -0
- package/dist/cjs/index-CCrH7f-W.js +1293 -0
- package/dist/cjs/index-CCrH7f-W.js.map +1 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/llm-testrunner-components.cjs.js +28 -0
- package/dist/cjs/llm-testrunner-components.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +13 -0
- package/dist/collection/components/my-component/current-time.js +35 -0
- package/dist/collection/components/my-component/current-time.js.map +1 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +96 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/current-time.d.ts +11 -0
- package/dist/components/current-time.js +9 -0
- package/dist/components/current-time.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +63 -0
- package/dist/components/my-component.js.map +1 -0
- package/dist/components/p-CbvWSaCI.js +53 -0
- package/dist/components/p-CbvWSaCI.js.map +1 -0
- package/dist/components/p-DnDi6fKi.js +1101 -0
- package/dist/components/p-DnDi6fKi.js.map +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/current-time.my-component.entry.js.map +1 -0
- package/dist/esm/current-time_2.entry.js +64 -0
- package/dist/esm/current-time_2.entry.js.map +1 -0
- package/dist/esm/index-0jlGA6MK.js +1287 -0
- package/dist/esm/index-0jlGA6MK.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/llm-testrunner-components.js +24 -0
- package/dist/esm/llm-testrunner-components.js.map +1 -0
- package/dist/esm/loader.js +14 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/llm-testrunner-components/current-time.my-component.entry.esm.js.map +1 -0
- package/dist/llm-testrunner-components/index.esm.js +2 -0
- package/dist/llm-testrunner-components/index.esm.js.map +1 -0
- package/dist/llm-testrunner-components/llm-testrunner-components.esm.js +2 -0
- package/dist/llm-testrunner-components/llm-testrunner-components.esm.js.map +1 -0
- package/dist/llm-testrunner-components/loader.esm.js.map +1 -0
- package/dist/llm-testrunner-components/p-0jlGA6MK.js +3 -0
- package/dist/llm-testrunner-components/p-0jlGA6MK.js.map +1 -0
- package/dist/llm-testrunner-components/p-15e5e0fe.entry.js +2 -0
- package/dist/llm-testrunner-components/p-15e5e0fe.entry.js.map +1 -0
- package/dist/llm-testrunner-components/p-DQuL1Twl.js +2 -0
- package/dist/llm-testrunner-components/p-DQuL1Twl.js.map +1 -0
- package/dist/types/components/my-component/current-time.d.ts +7 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components.d.ts +74 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1709 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +56 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CCrH7f-W.js');
|
|
4
|
+
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
|
+
|
|
6
|
+
const defineCustomElements = async (win, options) => {
|
|
7
|
+
if (typeof window === 'undefined') return undefined;
|
|
8
|
+
await appGlobals.globalScripts();
|
|
9
|
+
return index.bootstrapLazy([["current-time_2.cjs",[[257,"my-component",{"first":[1],"middle":[1],"last":[1]}],[256,"current-time",{"currentTime":[32]}]]]], options);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.setNonce = index.setNonce;
|
|
13
|
+
exports.defineCustomElements = defineCustomElements;
|
|
14
|
+
//# sourceMappingURL=loader.cjs.js.map
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=loader.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.cjs.js","sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = async (win, options) => {\n if (typeof window === 'undefined') return undefined;\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"names":["globalScripts","bootstrapLazy"],"mappings":";;;;;AAGY,MAAC,oBAAoB,GAAG,OAAO,GAAG,EAAE,OAAO,KAAK;AAC5D,EAAE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,OAAO,SAAS;AACrD,EAAE,MAAMA,wBAAa,EAAE;AACvB,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"components/my-component/current-time.js",
|
|
4
|
+
"components/my-component/my-component.js"
|
|
5
|
+
],
|
|
6
|
+
"compiler": {
|
|
7
|
+
"name": "@stencil/core",
|
|
8
|
+
"version": "4.36.1",
|
|
9
|
+
"typescriptVersion": "5.5.4"
|
|
10
|
+
},
|
|
11
|
+
"collections": [],
|
|
12
|
+
"bundles": []
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// First, we import State from '@stencil/core'
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
export class CurrentTime {
|
|
4
|
+
// `timer` is not decorated with `@State()`, as
|
|
5
|
+
// we do not wish to trigger a rerender when its
|
|
6
|
+
// value changes
|
|
7
|
+
timer;
|
|
8
|
+
// `currentTime` is decorated with `@State()`,
|
|
9
|
+
// as we need to trigger a rerender when its
|
|
10
|
+
// value changes to show the latest time
|
|
11
|
+
currentTime = Date.now();
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
// the assignment to `this.timer` will not
|
|
14
|
+
// trigger a re-render
|
|
15
|
+
this.timer = window.setInterval(() => {
|
|
16
|
+
// the assignment to `this.currentTime`
|
|
17
|
+
// will trigger a re-render
|
|
18
|
+
this.currentTime = Date.now();
|
|
19
|
+
}, 1000);
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
window.clearInterval(this.timer);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
const time = new Date(this.currentTime).toLocaleTimeString();
|
|
26
|
+
return (h("span", { key: '45b0df3ce3817ac64d22582b1a45c188b61656a4' }, time));
|
|
27
|
+
}
|
|
28
|
+
static get is() { return "current-time"; }
|
|
29
|
+
static get states() {
|
|
30
|
+
return {
|
|
31
|
+
"currentTime": {}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=current-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current-time.js","sourceRoot":"","sources":["../../../src/components/my-component/current-time.tsx"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKpD,MAAM,OAAO,WAAW;IACpB,+CAA+C;IAC/C,gDAAgD;IAChD,gBAAgB;IAChB,KAAK,CAAS;IAEd,8CAA8C;IAC9C,4CAA4C;IAC5C,wCAAwC;IAC/B,WAAW,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;IAE1C,iBAAiB;QACb,0CAA0C;QAC1C,sBAAsB;QACtB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE;YACjC,uCAAuC;YACvC,2BAA2B;YAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAClC,CAAC,EAAE,IAAI,CAAC,CAAC;IACb,CAAC;IAED,oBAAoB;QAChB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,MAAM;QACF,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAE7D,OAAO,CACH,+DAAO,IAAI,CAAQ,CACtB,CAAC;IACN,CAAC;;;;;CACJ","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}"]}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview entry point for your component library
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
5
|
+
* constants or data structure that accompany your components.
|
|
6
|
+
*
|
|
7
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
8
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
9
|
+
*/
|
|
10
|
+
export { format } from './utils/utils';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\n\nexport { format } from './utils/utils';\nexport type * from './components.d.ts';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CurrentTime extends Components.CurrentTime, HTMLElement {}
|
|
4
|
+
export const CurrentTime: {
|
|
5
|
+
prototype: CurrentTime;
|
|
6
|
+
new (): CurrentTime;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"current-time.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to manually set the base path where assets can be found.
|
|
9
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
10
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
11
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
12
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
13
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
14
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
15
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAssetPath: (path: string) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
21
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
22
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
23
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
24
|
+
* will result in the same behavior.
|
|
25
|
+
*/
|
|
26
|
+
export declare const setNonce: (nonce: string) => void
|
|
27
|
+
|
|
28
|
+
export interface SetPlatformOptions {
|
|
29
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
30
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
31
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-DnDi6fKi.js';
|
|
2
|
+
|
|
3
|
+
function format(first, middle, last) {
|
|
4
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { format };
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index.js","mappings":";;SAAgB,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa,EAAA;AACnE,IAAA,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,CAAI,CAAA,EAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AAChF;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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}
|