@frontiers-labs/argon 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/runtime.d.ts +0 -13
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -49
- package/dist/runtime.js.map +0 -1
package/package.json
CHANGED
package/dist/runtime.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Argon runtime — used when running components directly in a browser without
|
|
3
|
-
* compiling. Provides the @component decorator and html/css template tags.
|
|
4
|
-
*
|
|
5
|
-
* In production, the compiler outputs a standard CustomElement class and this
|
|
6
|
-
* file is not shipped.
|
|
7
|
-
*/
|
|
8
|
-
export declare function html(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
9
|
-
export declare const css: typeof html;
|
|
10
|
-
type AnyConstructor = new (...args: unknown[]) => object;
|
|
11
|
-
export declare function component(tagName: string): <T extends AnyConstructor>(Target: T, _ctx?: ClassDecoratorContext) => T;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,IAAI,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAOhF;AAED,eAAO,MAAM,GAAG,aAAO,CAAC;AAExB,KAAK,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC;AAEzD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,IACtB,CAAC,SAAS,cAAc,EAAE,QAAQ,CAAC,EAAE,OAAO,qBAAqB,KAAG,CAAC,CAiCvF"}
|
package/dist/runtime.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Argon runtime — used when running components directly in a browser without
|
|
3
|
-
* compiling. Provides the @component decorator and html/css template tags.
|
|
4
|
-
*
|
|
5
|
-
* In production, the compiler outputs a standard CustomElement class and this
|
|
6
|
-
* file is not shipped.
|
|
7
|
-
*/
|
|
8
|
-
export function html(strings, ...values) {
|
|
9
|
-
let result = '';
|
|
10
|
-
for (let i = 0; i < strings.length; i++) {
|
|
11
|
-
result += strings[i];
|
|
12
|
-
if (i < values.length)
|
|
13
|
-
result += String(values[i] ?? '');
|
|
14
|
-
}
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
export const css = html;
|
|
18
|
-
export function component(tagName) {
|
|
19
|
-
return function (Target, _ctx) {
|
|
20
|
-
customElements.define(tagName, class extends HTMLElement {
|
|
21
|
-
connectedCallback() {
|
|
22
|
-
const impl = new Target();
|
|
23
|
-
// Initialise props from data-* attributes
|
|
24
|
-
for (const key of Object.keys(impl)) {
|
|
25
|
-
const val = this.dataset[key];
|
|
26
|
-
if (val !== undefined)
|
|
27
|
-
impl[key] = val;
|
|
28
|
-
}
|
|
29
|
-
// Bridge HTMLElement methods that hydrate() may call on `this`
|
|
30
|
-
impl['setAttribute'] = this.setAttribute.bind(this);
|
|
31
|
-
impl['getAttribute'] = this.getAttribute.bind(this);
|
|
32
|
-
impl['removeAttribute'] = this.removeAttribute.bind(this);
|
|
33
|
-
// Render into shadow DOM if not already populated by DSD
|
|
34
|
-
if (!this.shadowRoot) {
|
|
35
|
-
this.attachShadow({ mode: 'open' });
|
|
36
|
-
}
|
|
37
|
-
if (this.shadowRoot.innerHTML.trim() === '') {
|
|
38
|
-
const render = impl['render'];
|
|
39
|
-
this.shadowRoot.innerHTML = render?.call(impl) ?? '';
|
|
40
|
-
}
|
|
41
|
-
// Hydrate
|
|
42
|
-
const hydrate = impl['hydrate'];
|
|
43
|
-
hydrate?.call(impl, this.shadowRoot);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
return Target;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=runtime.js.map
|
package/dist/runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,IAAI,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACtE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM;YAAE,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC;AAIxB,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,UAAoC,MAAS,EAAE,IAA4B;QAChF,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,KAAM,SAAQ,WAAW;YACtD,iBAAiB;gBACf,MAAM,IAAI,GAAG,IAAI,MAAM,EAA6B,CAAC;gBAErD,0CAA0C;gBAC1C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpC,MAAM,GAAG,GAAI,IAA8C,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBACzE,IAAI,GAAG,KAAK,SAAS;wBAAE,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;gBACzC,CAAC;gBAED,+DAA+D;gBAC/D,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CA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