@emkodev/emroute 1.10.0 → 1.12.0-beta.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/README.md +1 -1
- package/core/component/widget.component.ts +3 -8
- package/core/util/html.util.ts +1 -1
- package/core/util/js.util.ts +8 -0
- package/core/util/widget-resolve.util.ts +4 -2
- package/dist/core/component/widget.component.js +3 -7
- package/dist/core/component/widget.component.js.map +1 -1
- package/dist/core/util/html.util.js +1 -1
- package/dist/core/util/html.util.js.map +1 -1
- package/dist/core/util/js.util.d.ts +5 -0
- package/dist/core/util/js.util.js +8 -0
- package/dist/core/util/js.util.js.map +1 -0
- package/dist/core/util/widget-resolve.util.js +4 -2
- package/dist/core/util/widget-resolve.util.js.map +1 -1
- package/dist/emroute.js +110 -27
- package/dist/emroute.js.map +10 -9
- package/dist/runtime/abstract.runtime.d.ts +13 -1
- package/dist/runtime/abstract.runtime.js +34 -22
- package/dist/runtime/abstract.runtime.js.map +1 -1
- package/dist/runtime/bun/fs/bun-fs.runtime.d.ts +4 -0
- package/dist/runtime/bun/fs/bun-fs.runtime.js +29 -2
- package/dist/runtime/bun/fs/bun-fs.runtime.js.map +1 -1
- package/dist/server/build.util.d.ts +5 -9
- package/dist/server/build.util.js +17 -54
- package/dist/server/build.util.js.map +1 -1
- package/dist/server/dev.server.d.ts +25 -0
- package/dist/server/dev.server.js +81 -0
- package/dist/server/dev.server.js.map +1 -0
- package/dist/src/element/component.element.d.ts +12 -0
- package/dist/src/element/component.element.js +55 -3
- package/dist/src/element/component.element.js.map +1 -1
- package/dist/src/util/html.util.d.ts +5 -0
- package/dist/src/util/html.util.js +38 -1
- package/dist/src/util/html.util.js.map +1 -1
- package/package.json +2 -2
- package/runtime/abstract.runtime.ts +38 -23
- package/runtime/bun/fs/bun-fs.runtime.ts +31 -2
- package/server/build.util.ts +17 -55
- package/src/element/component.element.ts +63 -3
- package/src/util/html.util.ts +46 -1
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ export default new ProjectPage();
|
|
|
114
114
|
- **Configurable base paths** — `/html/` and `/md/` prefixes are configurable via `BasePath`
|
|
115
115
|
- **SPA modes** — `'root'` (default), `'leaf'`, `'none'`, or `'only'` to control how the server handles non-file requests and SSR endpoints
|
|
116
116
|
- **Sitemap generation** — opt-in `sitemap.xml` from the routes manifest with support for dynamic route enumerators
|
|
117
|
-
- **
|
|
117
|
+
- **On-the-fly transpilation** — `BunFsRuntime` serves `.ts` files as transpiled JavaScript with companion files inlined. No build step required for development. `buildClientBundles()` is an optional production optimization
|
|
118
118
|
|
|
119
119
|
## Runtimes
|
|
120
120
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { Component } from './abstract.component.ts';
|
|
14
14
|
import type { ComponentContext } from '../type/component.type.ts';
|
|
15
|
-
import { escapeHtml
|
|
15
|
+
import { escapeHtml } from '../util/html.util.ts';
|
|
16
16
|
|
|
17
17
|
export abstract class WidgetComponent<
|
|
18
18
|
TParams = unknown,
|
|
@@ -23,18 +23,13 @@ export abstract class WidgetComponent<
|
|
|
23
23
|
args: this['RenderArgs'],
|
|
24
24
|
): string {
|
|
25
25
|
const files = args.context.files;
|
|
26
|
-
const style = files?.css ? `<style>${scopeWidgetCss(files.css, this.name)}</style>\n` : '';
|
|
27
26
|
|
|
28
27
|
if (files?.html) {
|
|
29
|
-
return
|
|
28
|
+
return files.html;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
if (files?.md) {
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (style) {
|
|
37
|
-
return style + super.renderHTML(args);
|
|
32
|
+
return `<mark-down>${escapeHtml(files.md)}</mark-down>`;
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
return super.renderHTML(args);
|
package/core/util/html.util.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function unescapeHtml(text: string): string {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export function scopeWidgetCss(css: string, widgetName: string): string {
|
|
44
|
-
return `@scope (widget-${widgetName}) {\n${css}\n}`;
|
|
44
|
+
return `@layer emroute {\n@scope (widget-${widgetName}) {\n${css}\n}\n}`;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/** Status code to message mapping. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JavaScript codegen utilities.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** Escape backticks and ${} for safe embedding in a JS template literal. */
|
|
6
|
+
export function escapeTemplateLiteral(s: string): string {
|
|
7
|
+
return s.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$\{/g, '\\${');
|
|
8
|
+
}
|
|
@@ -9,7 +9,7 @@ import type { Component } from '../component/abstract.component.ts';
|
|
|
9
9
|
import type { ComponentContext, ContextProvider, FileContents } from '../type/component.type.ts';
|
|
10
10
|
import { type Logger, defaultLogger } from '../type/logger.type.ts';
|
|
11
11
|
import type { RouteInfo } from '../type/route.type.ts';
|
|
12
|
-
import { RESERVED_ATTRS, SSR_ATTR } from './html.util.ts';
|
|
12
|
+
import { RESERVED_ATTRS, SSR_ATTR, scopeWidgetCss } from './html.util.ts';
|
|
13
13
|
|
|
14
14
|
/** Maximum nesting depth for widgets to prevent infinite loops */
|
|
15
15
|
export const MAX_WIDGET_DEPTH = 10;
|
|
@@ -92,7 +92,9 @@ export function resolveWidgetTags(
|
|
|
92
92
|
const context: ComponentContext = contextProvider ? contextProvider(baseContext) : baseContext;
|
|
93
93
|
|
|
94
94
|
const data = await widget.getData({ params, context });
|
|
95
|
-
const
|
|
95
|
+
const hostStyle = '<style>:host { container-type: inline-size; content-visibility: auto; }</style>';
|
|
96
|
+
const cssStyle = files?.css ? `<style>${scopeWidgetCss(files.css, widgetName)}</style>` : '';
|
|
97
|
+
const rendered = hostStyle + cssStyle + widget.renderHTML({ data, params, context });
|
|
96
98
|
|
|
97
99
|
wrappers.set(match, {
|
|
98
100
|
tagName: `widget-${widgetName}`,
|
|
@@ -10,19 +10,15 @@
|
|
|
10
10
|
* - renderMarkdown: md file → ''
|
|
11
11
|
*/
|
|
12
12
|
import { Component } from "./abstract.component.js";
|
|
13
|
-
import { escapeHtml
|
|
13
|
+
import { escapeHtml } from "../util/html.util.js";
|
|
14
14
|
export class WidgetComponent extends Component {
|
|
15
15
|
renderHTML(args) {
|
|
16
16
|
const files = args.context.files;
|
|
17
|
-
const style = files?.css ? `<style>${scopeWidgetCss(files.css, this.name)}</style>\n` : '';
|
|
18
17
|
if (files?.html) {
|
|
19
|
-
return
|
|
18
|
+
return files.html;
|
|
20
19
|
}
|
|
21
20
|
if (files?.md) {
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
if (style) {
|
|
25
|
-
return style + super.renderHTML(args);
|
|
21
|
+
return `<mark-down>${escapeHtml(files.md)}</mark-down>`;
|
|
26
22
|
}
|
|
27
23
|
return super.renderHTML(args);
|
|
28
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.component.js","sourceRoot":"","sources":["../../../core/component/widget.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"widget.component.js","sourceRoot":"","sources":["../../../core/component/widget.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,OAAgB,eAIpB,SAAQ,SAAmC;IAClC,UAAU,CACjB,IAAwB;QAExB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAEjC,IAAI,KAAK,EAAE,IAAI,EAAE,CAAC;YAChB,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC;QAED,IAAI,KAAK,EAAE,EAAE,EAAE,CAAC;YACd,OAAO,cAAc,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;QAC1D,CAAC;QAED,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEQ,cAAc,CACrB,IAAwB;QAExB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAEjC,IAAI,KAAK,EAAE,EAAE,EAAE,CAAC;YACd,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
|
@@ -33,7 +33,7 @@ export function unescapeHtml(text) {
|
|
|
33
33
|
.replaceAll('&', '&');
|
|
34
34
|
}
|
|
35
35
|
export function scopeWidgetCss(css, widgetName) {
|
|
36
|
-
return `@scope (widget-${widgetName}) {\n${css}\n}`;
|
|
36
|
+
return `@layer emroute {\n@scope (widget-${widgetName}) {\n${css}\n}\n}`;
|
|
37
37
|
}
|
|
38
38
|
/** Status code to message mapping. */
|
|
39
39
|
export const STATUS_MESSAGES = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.util.js","sourceRoot":"","sources":["../../../core/util/html.util.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC;AAE9B,oDAAoD;AACpD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEhC,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAErG,MAAM,iBAAiB,GAAG,+BAA+B,CAAC;AAE1D,yDAAyD;AACzD,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAA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0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JavaScript codegen utilities.
|
|
3
|
+
*/
|
|
4
|
+
/** Escape backticks and ${} for safe embedding in a JS template literal. */
|
|
5
|
+
export function escapeTemplateLiteral(s) {
|
|
6
|
+
return s.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$\{/g, '\\${');
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=js.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js.util.js","sourceRoot":"","sources":["../../../core/util/js.util.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4EAA4E;AAC5E,MAAM,UAAU,qBAAqB,CAAC,CAAS;IAC7C,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Calls getData() + renderHTML() on widgets and injects SSR hydration data.
|
|
6
6
|
*/
|
|
7
7
|
import { defaultLogger } from "../type/logger.type.js";
|
|
8
|
-
import { RESERVED_ATTRS, SSR_ATTR } from "./html.util.js";
|
|
8
|
+
import { RESERVED_ATTRS, SSR_ATTR, scopeWidgetCss } from "./html.util.js";
|
|
9
9
|
/** Maximum nesting depth for widgets to prevent infinite loops */
|
|
10
10
|
export const MAX_WIDGET_DEPTH = 10;
|
|
11
11
|
/**
|
|
@@ -59,7 +59,9 @@ export function resolveWidgetTags(html, getWidget, routeInfo, contextProvider, l
|
|
|
59
59
|
};
|
|
60
60
|
const context = contextProvider ? contextProvider(baseContext) : baseContext;
|
|
61
61
|
const data = await widget.getData({ params, context });
|
|
62
|
-
const
|
|
62
|
+
const hostStyle = '<style>:host { container-type: inline-size; content-visibility: auto; }</style>';
|
|
63
|
+
const cssStyle = files?.css ? `<style>${scopeWidgetCss(files.css, widgetName)}</style>` : '';
|
|
64
|
+
const rendered = hostStyle + cssStyle + widget.renderHTML({ data, params, context });
|
|
63
65
|
wrappers.set(match, {
|
|
64
66
|
tagName: `widget-${widgetName}`,
|
|
65
67
|
attrs: attrsString ? ` ${attrsString}` : '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-resolve.util.js","sourceRoot":"","sources":["../../../core/util/widget-resolve.util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAe,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"widget-resolve.util.js","sourceRoot":"","sources":["../../../core/util/widget-resolve.util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAe,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE1E,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,KAA+B,EAC/B,OAAuC,EACvC,OAAkE,EAClE,KAAK,GAAG,CAAC,EACT,SAAiB,aAAa;IAE9B,IAAI,KAAK,IAAI,gBAAgB,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CACT,uCAAuC,gBAAgB,KAAK;YAC1D,oDAAoD,CACvD,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IAEzC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAa,CAAC;IAC1C,MAAM,OAAO,CAAC,GAAG,CACf,OAA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AAC,OAAO,EAAE,GAAG,CAAC,CAAC,UAAU,CAC/E,QAAQ,EACR,GAAG,CACJ,CAAC;QACF,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
|
package/dist/emroute.js
CHANGED
|
@@ -15,8 +15,10 @@ function unescapeHtml(text) {
|
|
|
15
15
|
return text.replaceAll("`", "`").replaceAll("'", "'").replaceAll(""", '"').replaceAll(">", ">").replaceAll("<", "<").replaceAll("&", "&");
|
|
16
16
|
}
|
|
17
17
|
function scopeWidgetCss(css, widgetName) {
|
|
18
|
-
return `@
|
|
18
|
+
return `@layer emroute {
|
|
19
|
+
@scope (widget-${widgetName}) {
|
|
19
20
|
${css}
|
|
21
|
+
}
|
|
20
22
|
}`;
|
|
21
23
|
}
|
|
22
24
|
var STATUS_MESSAGES = {
|
|
@@ -27,14 +29,34 @@ var STATUS_MESSAGES = {
|
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
// dist/src/util/html.util.js
|
|
32
|
+
class SsrCSSStyleSheet {
|
|
33
|
+
cssText = "";
|
|
34
|
+
replaceSync(css) {
|
|
35
|
+
this.cssText = css;
|
|
36
|
+
}
|
|
37
|
+
replace(css) {
|
|
38
|
+
this.cssText = css;
|
|
39
|
+
return Promise.resolve(this);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
var CSSStyleSheetBase = globalThis.CSSStyleSheet ?? SsrCSSStyleSheet;
|
|
43
|
+
|
|
30
44
|
class SsrShadowRoot {
|
|
31
45
|
host;
|
|
32
46
|
_innerHTML = "";
|
|
47
|
+
_adoptedStyleSheets = [];
|
|
33
48
|
constructor(host) {
|
|
34
49
|
this.host = host;
|
|
35
50
|
}
|
|
51
|
+
get adoptedStyleSheets() {
|
|
52
|
+
return this._adoptedStyleSheets;
|
|
53
|
+
}
|
|
54
|
+
set adoptedStyleSheets(sheets) {
|
|
55
|
+
this._adoptedStyleSheets = sheets;
|
|
56
|
+
}
|
|
36
57
|
get innerHTML() {
|
|
37
|
-
|
|
58
|
+
const adopted = this._adoptedStyleSheets.filter((s) => s.cssText).map((s) => `<style>${s.cssText}</style>`).join("");
|
|
59
|
+
return adopted + this._innerHTML;
|
|
38
60
|
}
|
|
39
61
|
set innerHTML(value) {
|
|
40
62
|
this._innerHTML = value;
|
|
@@ -57,6 +79,10 @@ class SsrShadowRoot {
|
|
|
57
79
|
}
|
|
58
80
|
}
|
|
59
81
|
|
|
82
|
+
class SsrElementInternals {
|
|
83
|
+
states = new Set;
|
|
84
|
+
}
|
|
85
|
+
|
|
60
86
|
class SsrHTMLElement {
|
|
61
87
|
_innerHTML = "";
|
|
62
88
|
_shadowRoot = null;
|
|
@@ -97,6 +123,9 @@ class SsrHTMLElement {
|
|
|
97
123
|
this._shadowRoot = new SsrShadowRoot(this);
|
|
98
124
|
return this._shadowRoot;
|
|
99
125
|
}
|
|
126
|
+
attachInternals() {
|
|
127
|
+
return new SsrElementInternals;
|
|
128
|
+
}
|
|
100
129
|
getAttribute(name) {
|
|
101
130
|
return this._attributes.get(name) ?? null;
|
|
102
131
|
}
|
|
@@ -212,10 +241,12 @@ function filterUndefined(obj) {
|
|
|
212
241
|
|
|
213
242
|
class ComponentElement extends HTMLElementBase {
|
|
214
243
|
static lazyLoaders = new Map;
|
|
244
|
+
static sheetCache = new Map;
|
|
215
245
|
static extendContext;
|
|
216
246
|
static setContextProvider(provider) {
|
|
217
247
|
ComponentElement.extendContext = provider;
|
|
218
248
|
}
|
|
249
|
+
static CUSTOM_STATES = ["lazy", "loading", "hydrating", "ready", "error"];
|
|
219
250
|
component;
|
|
220
251
|
effectiveFiles;
|
|
221
252
|
params = null;
|
|
@@ -226,15 +257,23 @@ class ComponentElement extends HTMLElementBase {
|
|
|
226
257
|
deferred = null;
|
|
227
258
|
abortController = null;
|
|
228
259
|
intersectionObserver = null;
|
|
260
|
+
internals;
|
|
229
261
|
dataPromise = null;
|
|
230
262
|
constructor(component, files) {
|
|
231
263
|
super();
|
|
232
264
|
this.component = component;
|
|
233
265
|
this.effectiveFiles = files;
|
|
266
|
+
this.internals = this.attachInternals();
|
|
234
267
|
if (!this.shadowRoot) {
|
|
235
268
|
this.attachShadow({ mode: "open" });
|
|
236
269
|
}
|
|
237
270
|
}
|
|
271
|
+
setCustomState(next) {
|
|
272
|
+
for (const s of ComponentElement.CUSTOM_STATES) {
|
|
273
|
+
this.internals.states.delete(s);
|
|
274
|
+
}
|
|
275
|
+
this.internals.states.add(next);
|
|
276
|
+
}
|
|
238
277
|
static register(component, files) {
|
|
239
278
|
const tagName = `widget-${component.name}`;
|
|
240
279
|
if (!globalThis.customElements || customElements.get(tagName)) {
|
|
@@ -316,7 +355,6 @@ class ComponentElement extends HTMLElementBase {
|
|
|
316
355
|
}
|
|
317
356
|
}
|
|
318
357
|
this.component.element = this;
|
|
319
|
-
this.style.contentVisibility = "auto";
|
|
320
358
|
this.abortController = new AbortController;
|
|
321
359
|
const signal = this.abortController.signal;
|
|
322
360
|
const params = {};
|
|
@@ -351,8 +389,10 @@ class ComponentElement extends HTMLElementBase {
|
|
|
351
389
|
...filteredFiles ? { files: filteredFiles } : {}
|
|
352
390
|
};
|
|
353
391
|
this.context = ComponentElement.extendContext ? ComponentElement.extendContext(base) : base;
|
|
392
|
+
this.adoptCss();
|
|
354
393
|
if (this.hasAttribute(SSR_ATTR)) {
|
|
355
394
|
this.removeAttribute(SSR_ATTR);
|
|
395
|
+
this.setCustomState("hydrating");
|
|
356
396
|
const lightText = this.textContent?.trim();
|
|
357
397
|
if (lightText) {
|
|
358
398
|
try {
|
|
@@ -365,12 +405,16 @@ class ComponentElement extends HTMLElementBase {
|
|
|
365
405
|
const args = { data: this.data, params: this.params, context: this.context };
|
|
366
406
|
queueMicrotask(() => {
|
|
367
407
|
this.component.hydrate(args);
|
|
408
|
+
this.setCustomState("ready");
|
|
368
409
|
});
|
|
410
|
+
} else {
|
|
411
|
+
this.setCustomState("ready");
|
|
369
412
|
}
|
|
370
413
|
this.signalReady();
|
|
371
414
|
return;
|
|
372
415
|
}
|
|
373
416
|
if (this.hasAttribute(LAZY_ATTR)) {
|
|
417
|
+
this.setCustomState("lazy");
|
|
374
418
|
this.intersectionObserver = new IntersectionObserver((entries) => {
|
|
375
419
|
const entry = entries[0];
|
|
376
420
|
if (entry.isIntersecting) {
|
|
@@ -392,6 +436,9 @@ class ComponentElement extends HTMLElementBase {
|
|
|
392
436
|
this.abortController?.abort();
|
|
393
437
|
this.abortController = null;
|
|
394
438
|
this.state = "idle";
|
|
439
|
+
for (const s of ComponentElement.CUSTOM_STATES) {
|
|
440
|
+
this.internals.states.delete(s);
|
|
441
|
+
}
|
|
395
442
|
this.data = null;
|
|
396
443
|
this.context = undefined;
|
|
397
444
|
this.dataPromise = null;
|
|
@@ -409,11 +456,36 @@ class ComponentElement extends HTMLElementBase {
|
|
|
409
456
|
async loadFiles() {
|
|
410
457
|
return this.effectiveFiles ?? {};
|
|
411
458
|
}
|
|
459
|
+
static baseSheet = null;
|
|
460
|
+
static getBaseSheet() {
|
|
461
|
+
if (!ComponentElement.baseSheet) {
|
|
462
|
+
ComponentElement.baseSheet = new CSSStyleSheetBase;
|
|
463
|
+
ComponentElement.baseSheet.replaceSync(":host { container-type: inline-size; content-visibility: auto; }");
|
|
464
|
+
}
|
|
465
|
+
return ComponentElement.baseSheet;
|
|
466
|
+
}
|
|
467
|
+
adoptCss() {
|
|
468
|
+
const css = this.effectiveFiles?.css;
|
|
469
|
+
const base = ComponentElement.getBaseSheet();
|
|
470
|
+
if (!css) {
|
|
471
|
+
this.shadowRoot.adoptedStyleSheets = [base];
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
const name = this.component.name;
|
|
475
|
+
let sheet = ComponentElement.sheetCache.get(name);
|
|
476
|
+
if (!sheet) {
|
|
477
|
+
sheet = new CSSStyleSheetBase;
|
|
478
|
+
sheet.replaceSync(scopeWidgetCss(css, name));
|
|
479
|
+
ComponentElement.sheetCache.set(name, sheet);
|
|
480
|
+
}
|
|
481
|
+
this.shadowRoot.adoptedStyleSheets = [base, sheet];
|
|
482
|
+
}
|
|
412
483
|
async loadData() {
|
|
413
484
|
if (this.params === null)
|
|
414
485
|
return;
|
|
415
486
|
const signal = this.abortController?.signal;
|
|
416
487
|
this.state = "loading";
|
|
488
|
+
this.setCustomState("loading");
|
|
417
489
|
this.render();
|
|
418
490
|
try {
|
|
419
491
|
const promise = this.component.getData({
|
|
@@ -426,6 +498,7 @@ class ComponentElement extends HTMLElementBase {
|
|
|
426
498
|
if (signal?.aborted)
|
|
427
499
|
return;
|
|
428
500
|
this.state = "ready";
|
|
501
|
+
this.setCustomState("ready");
|
|
429
502
|
} catch (e) {
|
|
430
503
|
if (e instanceof DOMException && e.name === "AbortError")
|
|
431
504
|
return;
|
|
@@ -439,6 +512,7 @@ class ComponentElement extends HTMLElementBase {
|
|
|
439
512
|
}
|
|
440
513
|
setError(message) {
|
|
441
514
|
this.state = "error";
|
|
515
|
+
this.setCustomState("error");
|
|
442
516
|
this.errorMessage = message;
|
|
443
517
|
this.render();
|
|
444
518
|
this.signalReady();
|
|
@@ -847,7 +921,9 @@ function resolveWidgetTags(html, getWidget, routeInfo, contextProvider, logger =
|
|
|
847
921
|
};
|
|
848
922
|
const context = contextProvider ? contextProvider(baseContext) : baseContext;
|
|
849
923
|
const data = await widget.getData({ params, context });
|
|
850
|
-
const
|
|
924
|
+
const hostStyle = "<style>:host { container-type: inline-size; content-visibility: auto; }</style>";
|
|
925
|
+
const cssStyle = files?.css ? `<style>${scopeWidgetCss(files.css, widgetName)}</style>` : "";
|
|
926
|
+
const rendered = hostStyle + cssStyle + widget.renderHTML({ data, params, context });
|
|
851
927
|
wrappers.set(match, {
|
|
852
928
|
tagName: `widget-${widgetName}`,
|
|
853
929
|
attrs: attrsString ? ` ${attrsString}` : "",
|
|
@@ -1605,6 +1681,11 @@ function resolveTargetNode(node, name, isRoot) {
|
|
|
1605
1681
|
return node.children[name];
|
|
1606
1682
|
}
|
|
1607
1683
|
|
|
1684
|
+
// dist/core/util/js.util.js
|
|
1685
|
+
function escapeTemplateLiteral(s) {
|
|
1686
|
+
return s.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1608
1689
|
// dist/runtime/abstract.runtime.js
|
|
1609
1690
|
var CONTENT_TYPES = new Map([
|
|
1610
1691
|
[".html", "text/html; charset=utf-8"],
|
|
@@ -1912,26 +1993,12 @@ class Runtime {
|
|
|
1912
1993
|
} catch {
|
|
1913
1994
|
return;
|
|
1914
1995
|
}
|
|
1915
|
-
const companionExts = kind === "element" ? [] : ["html", "md", "css"];
|
|
1916
|
-
const files = {};
|
|
1917
|
-
for (const ext of companionExts) {
|
|
1918
|
-
const companionPath = tsPath.replace(/\.ts$/, `.${ext}`);
|
|
1919
|
-
try {
|
|
1920
|
-
files[ext] = await this.query(companionPath, { as: "text" });
|
|
1921
|
-
} catch {}
|
|
1922
|
-
}
|
|
1923
1996
|
let jsCode;
|
|
1924
1997
|
try {
|
|
1925
|
-
jsCode = await this.
|
|
1998
|
+
jsCode = await this.transpileModule(tsPath, tsSource);
|
|
1926
1999
|
} catch {
|
|
1927
2000
|
return;
|
|
1928
2001
|
}
|
|
1929
|
-
if (Object.keys(files).length > 0) {
|
|
1930
|
-
const entries = Object.entries(files).map(([k, v]) => `${k}: \`${v.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$")}\``).join(", ");
|
|
1931
|
-
jsCode += `
|
|
1932
|
-
export const __files = { ${entries} };
|
|
1933
|
-
`;
|
|
1934
|
-
}
|
|
1935
2002
|
await this.handle(jsPath, { method: "PUT", body: jsCode });
|
|
1936
2003
|
}
|
|
1937
2004
|
loadModule(_path) {
|
|
@@ -1940,6 +2007,27 @@ export const __files = { ${entries} };
|
|
|
1940
2007
|
transpile(_source) {
|
|
1941
2008
|
throw new Error(`transpile not implemented for ${this.constructor.name}`);
|
|
1942
2009
|
}
|
|
2010
|
+
async transpileModule(path, source) {
|
|
2011
|
+
let js = await this.transpile(source);
|
|
2012
|
+
const basePath = path.replace(/\.ts$/, "");
|
|
2013
|
+
const companions = ["html", "md", "css"];
|
|
2014
|
+
const entries = [];
|
|
2015
|
+
for (const ext of companions) {
|
|
2016
|
+
try {
|
|
2017
|
+
const content = await this.query(basePath + "." + ext, { as: "text" });
|
|
2018
|
+
entries.push(` ${ext}: \`${escapeTemplateLiteral(content)}\``);
|
|
2019
|
+
} catch {}
|
|
2020
|
+
}
|
|
2021
|
+
if (entries.length > 0) {
|
|
2022
|
+
js += `
|
|
2023
|
+
export const __files = {
|
|
2024
|
+
${entries.join(`,
|
|
2025
|
+
`)}
|
|
2026
|
+
};
|
|
2027
|
+
`;
|
|
2028
|
+
}
|
|
2029
|
+
return js;
|
|
2030
|
+
}
|
|
1943
2031
|
async mergeWidgetIntoManifest(filePath, widgetsDir) {
|
|
1944
2032
|
const relativePath = filePath.slice(widgetsDir.length + 1);
|
|
1945
2033
|
const parts = relativePath.split("/");
|
|
@@ -2448,16 +2536,11 @@ function buildLazyLoaders(tree, widgetEntries, elementEntries, runtime) {
|
|
|
2448
2536
|
class WidgetComponent extends Component {
|
|
2449
2537
|
renderHTML(args) {
|
|
2450
2538
|
const files = args.context.files;
|
|
2451
|
-
const style = files?.css ? `<style>${scopeWidgetCss(files.css, this.name)}</style>
|
|
2452
|
-
` : "";
|
|
2453
2539
|
if (files?.html) {
|
|
2454
|
-
return
|
|
2540
|
+
return files.html;
|
|
2455
2541
|
}
|
|
2456
2542
|
if (files?.md) {
|
|
2457
|
-
return
|
|
2458
|
-
}
|
|
2459
|
-
if (style) {
|
|
2460
|
-
return style + super.renderHTML(args);
|
|
2543
|
+
return `<mark-down>${escapeHtml(files.md)}</mark-down>`;
|
|
2461
2544
|
}
|
|
2462
2545
|
return super.renderHTML(args);
|
|
2463
2546
|
}
|
|
@@ -3467,5 +3550,5 @@ export {
|
|
|
3467
3550
|
BreadcrumbWidget
|
|
3468
3551
|
};
|
|
3469
3552
|
|
|
3470
|
-
//# debugId=
|
|
3553
|
+
//# debugId=E46DD94A9938B68B64756E2164756E21
|
|
3471
3554
|
//# sourceMappingURL=emroute.js.map
|