@rindo/core 3.2.3 → 3.2.4
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/cli/index.cjs +11 -16
- package/cli/index.js +11 -16
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +2765 -2560
- package/compiler/rindo.min.js +2 -2
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/dev-server/ws.js +1 -1
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +89 -38
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +34 -28
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/shadow-css.js +1 -2
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +14 -3
- package/internal/rindo-public-compiler.d.ts +11 -0
- package/internal/rindo-public-runtime.d.ts +1 -0
- package/internal/testing/index.js +19 -13
- package/internal/testing/package.json +1 -1
- package/internal/testing/shadow-css.js +1 -2
- package/mock-doc/index.cjs +2 -2
- package/mock-doc/index.js +2 -2
- package/mock-doc/package.json +1 -1
- package/package.json +7 -7
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/glob.js +1 -1
- package/sys/node/graceful-fs.js +1 -1
- package/sys/node/index.js +290 -283
- package/sys/node/node-fetch.js +1 -4
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +46 -24
- package/testing/jest/jest-setup-test-framework.d.ts +8 -0
- package/testing/package.json +1 -1
- package/testing/reset-build-conditionals.d.ts +10 -0
- package/testing/spec-page.d.ts +5 -0
- package/sys/node/713.node-fetch.js +0 -452
|
@@ -11,8 +11,8 @@ function forceUpdate() {}
|
|
|
11
11
|
|
|
12
12
|
function hydrateApp(e, t, o, n, s) {
|
|
13
13
|
function l() {
|
|
14
|
-
if (global.clearTimeout(p), i.clear(), r.clear(), !
|
|
15
|
-
|
|
14
|
+
if (global.clearTimeout(p), i.clear(), r.clear(), !u) {
|
|
15
|
+
u = !0;
|
|
16
16
|
try {
|
|
17
17
|
t.clientHydrateAnnotations && insertVdomAnnotations(e.document, t.staticComponents),
|
|
18
18
|
e.dispatchEvent(new e.Event("DOMContentLoaded")), e.document.createElement = c,
|
|
@@ -27,9 +27,9 @@ function hydrateApp(e, t, o, n, s) {
|
|
|
27
27
|
renderCatchError(t, o, e), l();
|
|
28
28
|
}
|
|
29
29
|
const r = new Set, i = new Set, d = new Set, c = e.document.createElement, $ = e.document.createElementNS, m = Promise.resolve();
|
|
30
|
-
let p,
|
|
30
|
+
let p, u = !1;
|
|
31
31
|
try {
|
|
32
|
-
function
|
|
32
|
+
function h() {
|
|
33
33
|
return g(this);
|
|
34
34
|
}
|
|
35
35
|
function f(e) {
|
|
@@ -38,7 +38,7 @@ function hydrateApp(e, t, o, n, s) {
|
|
|
38
38
|
$tagName$: e.nodeName.toLowerCase(),
|
|
39
39
|
$flags$: null
|
|
40
40
|
}, null);
|
|
41
|
-
null != t && null != t.cmpMeta && (i.add(e), e.connectedCallback =
|
|
41
|
+
null != t && null != t.cmpMeta && (i.add(e), e.connectedCallback = h, registerHost(e, t.cmpMeta),
|
|
42
42
|
function o(e, t) {
|
|
43
43
|
if ("function" != typeof e.componentOnReady && (e.componentOnReady = componentOnReady),
|
|
44
44
|
"function" != typeof e.forceUpdate && (e.forceUpdate = forceUpdate), 1 & t.$flags$ && (e.shadowRoot = e),
|
|
@@ -411,26 +411,32 @@ const createElm = (e, t, o, n) => {
|
|
|
411
411
|
let a, r = BUILD.slotRelocation && e["s-cr"] && e["s-cr"].parentNode || e;
|
|
412
412
|
for (BUILD.shadowDom && r.shadowRoot && r.tagName === hostTagName && (r = r.shadowRoot); s <= l; ++s) n[s] && (a = createElm(null, o, s, e),
|
|
413
413
|
a && (n[s].$elm$ = a, r.insertBefore(a, BUILD.slotRelocation ? referenceNode(t) : t)));
|
|
414
|
-
}, removeVnodes = (e, t, o
|
|
415
|
-
for (
|
|
416
|
-
|
|
414
|
+
}, removeVnodes = (e, t, o) => {
|
|
415
|
+
for (let n = t; n <= o; ++n) {
|
|
416
|
+
const t = e[n];
|
|
417
|
+
if (t) {
|
|
418
|
+
const e = t.$elm$;
|
|
419
|
+
nullifyVNodeRefs(t), e && (BUILD.slotRelocation && (checkSlotFallbackVisibility = !0,
|
|
420
|
+
e["s-ol"] ? e["s-ol"].remove() : putBackInOriginalLocation(e, !0)), e.remove());
|
|
421
|
+
}
|
|
422
|
+
}
|
|
417
423
|
}, isSameVnode = (e, t) => e.$tag$ === t.$tag$ && (BUILD.slotRelocation && "slot" === e.$tag$ ? e.$name$ === t.$name$ : !BUILD.vdomKey || e.$key$ === t.$key$), referenceNode = e => e && e["s-ol"] || e, parentReferenceNode = e => (e["s-ol"] ? e["s-ol"] : e).parentNode, patch = (e, t) => {
|
|
418
424
|
const o = t.$elm$ = e.$elm$, n = e.$children$, s = t.$children$, l = t.$tag$, a = t.$text$;
|
|
419
425
|
let r;
|
|
420
426
|
BUILD.vdomText && null !== a ? BUILD.vdomText && BUILD.slotRelocation && (r = o["s-cr"]) ? r.parentNode.textContent = a : BUILD.vdomText && e.$text$ !== a && (o.data = a) : (BUILD.svg && (isSvgMode = "svg" === l || "foreignObject" !== l && isSvgMode),
|
|
421
427
|
(BUILD.vdomAttribute || BUILD.reflect) && (BUILD.slot && "slot" === l || updateElement(e, t, isSvgMode)),
|
|
422
428
|
BUILD.updatable && null !== n && null !== s ? ((e, t, o, n) => {
|
|
423
|
-
let s, l, a = 0, r = 0, i = 0, d = 0, c = t.length - 1, $ = t[0], m = t[c], p = n.length - 1,
|
|
424
|
-
for (;a <= c && r <= p; ) if (null == $) $ = t[++a]; else if (null == m) m = t[--c]; else if (null ==
|
|
425
|
-
$ = t[++a],
|
|
426
|
-
patch($,
|
|
427
|
-
patch(m,
|
|
428
|
-
if (i = -1, BUILD.vdomKey) for (d = a; d <= c; ++d) if (t[d] && null !== t[d].$key$ && t[d].$key$ ===
|
|
429
|
+
let s, l, a = 0, r = 0, i = 0, d = 0, c = t.length - 1, $ = t[0], m = t[c], p = n.length - 1, u = n[0], h = n[p];
|
|
430
|
+
for (;a <= c && r <= p; ) if (null == $) $ = t[++a]; else if (null == m) m = t[--c]; else if (null == u) u = n[++r]; else if (null == h) h = n[--p]; else if (isSameVnode($, u)) patch($, u),
|
|
431
|
+
$ = t[++a], u = n[++r]; else if (isSameVnode(m, h)) patch(m, h), m = t[--c], h = n[--p]; else if (isSameVnode($, h)) !BUILD.slotRelocation || "slot" !== $.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation($.$elm$.parentNode, !1),
|
|
432
|
+
patch($, h), e.insertBefore($.$elm$, m.$elm$.nextSibling), $ = t[++a], h = n[--p]; else if (isSameVnode(m, u)) !BUILD.slotRelocation || "slot" !== $.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation(m.$elm$.parentNode, !1),
|
|
433
|
+
patch(m, u), e.insertBefore(m.$elm$, $.$elm$), m = t[--c], u = n[++r]; else {
|
|
434
|
+
if (i = -1, BUILD.vdomKey) for (d = a; d <= c; ++d) if (t[d] && null !== t[d].$key$ && t[d].$key$ === u.$key$) {
|
|
429
435
|
i = d;
|
|
430
436
|
break;
|
|
431
437
|
}
|
|
432
|
-
BUILD.vdomKey && i >= 0 ? (l = t[i], l.$tag$ !==
|
|
433
|
-
t[i] = void 0, s = l.$elm$),
|
|
438
|
+
BUILD.vdomKey && i >= 0 ? (l = t[i], l.$tag$ !== u.$tag$ ? s = createElm(t && t[r], o, i, e) : (patch(l, u),
|
|
439
|
+
t[i] = void 0, s = l.$elm$), u = n[++r]) : (s = createElm(t && t[r], o, r, e), u = n[++r]),
|
|
434
440
|
s && (BUILD.slotRelocation ? parentReferenceNode($.$elm$).insertBefore(s, referenceNode($.$elm$)) : $.$elm$.parentNode.insertBefore(s, $.$elm$));
|
|
435
441
|
}
|
|
436
442
|
a > c ? addVnodes(e, null == n[p + 1] ? null : n[p + 1].$elm$, o, n, r, p) : BUILD.updatable && r > p && removeVnodes(t, a, c);
|
|
@@ -470,8 +476,8 @@ const createElm = (e, t, o, n) => {
|
|
|
470
476
|
}));
|
|
471
477
|
1 === t.nodeType && relocateSlotContent(t);
|
|
472
478
|
}
|
|
473
|
-
}, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t,
|
|
474
|
-
BUILD.vdomRef && (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(
|
|
479
|
+
}, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t, nullifyVNodeRefs = e => {
|
|
480
|
+
BUILD.vdomRef && (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(nullifyVNodeRefs));
|
|
475
481
|
}, renderVdom = (e, t) => {
|
|
476
482
|
const o = e.$hostElement$, n = e.$cmpMeta$, s = e.$vnode$ || newVNode(null, null), l = isHost(t) ? t : h(null, null, t);
|
|
477
483
|
if (hostTagName = o.tagName, BUILD.isDev && Array.isArray(t) && t.some(isHost)) throw new Error(`The <Host> must be the single root component.\nLooks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);
|
|
@@ -514,9 +520,9 @@ const createElm = (e, t, o, n) => {
|
|
|
514
520
|
return t ? (BUILD.lazyLoad && BUILD.hostListener && (e.$flags$ |= 256, e.$queuedListeners$ && (e.$queuedListeners$.map((([e, t]) => safeCall(s, e, t))),
|
|
515
521
|
e.$queuedListeners$ = null)), emitLifecycleEvent(o, "componentWillLoad"), BUILD.cmpWillLoad && (l = safeCall(s, "componentWillLoad"))) : (emitLifecycleEvent(o, "componentWillUpdate"),
|
|
516
522
|
BUILD.cmpWillUpdate && (l = safeCall(s, "componentWillUpdate"))), emitLifecycleEvent(o, "componentWillRender"),
|
|
517
|
-
BUILD.cmpWillRender && (l =
|
|
518
|
-
n(),
|
|
519
|
-
}, updateComponent = async (e, t, o) => {
|
|
523
|
+
BUILD.cmpWillRender && (l = enqueue(l, (() => safeCall(s, "componentWillRender")))),
|
|
524
|
+
n(), enqueue(l, (() => updateComponent(e, s, t)));
|
|
525
|
+
}, enqueue = (e, t) => e instanceof Promise ? e.then(t) : t(), updateComponent = async (e, t, o) => {
|
|
520
526
|
const n = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), l = n["s-rc"];
|
|
521
527
|
BUILD.style && o && attachStyles(e);
|
|
522
528
|
const a = createTime("render", e.$cmpMeta$.$tagName$);
|
|
@@ -580,7 +586,7 @@ const callRender = (e, t, o) => {
|
|
|
580
586
|
} catch (e) {
|
|
581
587
|
consoleError(e);
|
|
582
588
|
}
|
|
583
|
-
},
|
|
589
|
+
}, emitLifecycleEvent = (e, t) => {
|
|
584
590
|
BUILD.lifecycleDOMEvents && emitEvent(e, "rindo_" + t, {
|
|
585
591
|
bubbles: !0,
|
|
586
592
|
composed: !0,
|
|
@@ -656,9 +662,9 @@ const callRender = (e, t, o) => {
|
|
|
656
662
|
}
|
|
657
663
|
return e;
|
|
658
664
|
}, initializeComponent = async (e, t, o, n, s) => {
|
|
659
|
-
if (
|
|
660
|
-
if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
|
|
661
|
-
if (
|
|
665
|
+
if (0 == (32 & t.$flags$)) {
|
|
666
|
+
if (t.$flags$ |= 32, BUILD.lazyLoad || BUILD.hydrateClientSide) {
|
|
667
|
+
if ((s = loadModule(o)).then) {
|
|
662
668
|
const e = (l = `st:load:${o.$tagName$}:${t.$modeName$}`, a = `[Rindo] Load module for <${o.$tagName$}>`,
|
|
663
669
|
BUILD.profile && performance.mark ? (0 === performance.getEntriesByName(l, "mark").length && performance.mark(l),
|
|
664
670
|
() => {
|
|
@@ -678,7 +684,7 @@ const callRender = (e, t, o) => {
|
|
|
678
684
|
}
|
|
679
685
|
BUILD.member && (t.$flags$ &= -9), BUILD.watchCallback && (t.$flags$ |= 128), e(),
|
|
680
686
|
fireConnectedCallback(t.$lazyInstance$);
|
|
681
|
-
} else s = e.constructor,
|
|
687
|
+
} else s = e.constructor, customElements.whenDefined(o.$tagName$).then((() => t.$flags$ |= 128));
|
|
682
688
|
if (BUILD.style && s.style) {
|
|
683
689
|
let n = s.style;
|
|
684
690
|
BUILD.mode && "string" != typeof n && (n = n[t.$modeName$ = computeMode(e)], BUILD.hydrateServerSide && t.$modeName$ && e.setAttribute("s-mode", t.$modeName$));
|
|
@@ -911,10 +917,10 @@ const callRender = (e, t, o) => {
|
|
|
911
917
|
}
|
|
912
918
|
})();
|
|
913
919
|
const n = createTime("bootstrapLazy"), s = [], l = t.exclude || [], a = win.customElements, r = doc.head, i = r.querySelector("meta[charset]"), d = doc.createElement("style"), c = [], $ = doc.querySelectorAll("[sty-id]");
|
|
914
|
-
let m, p = !0,
|
|
920
|
+
let m, p = !0, u = 0;
|
|
915
921
|
if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
|
|
916
922
|
BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), BUILD.hydrateClientSide && (plt.$flags$ |= 2),
|
|
917
|
-
BUILD.hydrateClientSide && BUILD.shadowDom) for (;
|
|
923
|
+
BUILD.hydrateClientSide && BUILD.shadowDom) for (;u < $.length; u++) registerStyle($[u].getAttribute("sty-id"), $[u].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
|
|
918
924
|
if (e.map((e => {
|
|
919
925
|
e[1].map((o => {
|
|
920
926
|
const n = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rindo/core/internal/hydrate",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Rindo internal hydrate platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
|
@@ -4,8 +4,7 @@ const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColo
|
|
|
4
4
|
return o.escapedString.replace(_ruleRe, ((...e) => {
|
|
5
5
|
const c = e[2];
|
|
6
6
|
let r = "", n = e[4], l = "";
|
|
7
|
-
n && n.startsWith("{%BLOCK%") && (r = o.blocks[s++], n = n.substring("
|
|
8
|
-
l = "{");
|
|
7
|
+
n && n.startsWith("{%BLOCK%") && (r = o.blocks[s++], n = n.substring(8), l = "{");
|
|
9
8
|
const a = t({
|
|
10
9
|
selector: c,
|
|
11
10
|
content: r
|
package/internal/package.json
CHANGED
|
@@ -2044,7 +2044,7 @@ export interface SpecPage {
|
|
|
2044
2044
|
*/
|
|
2045
2045
|
rootInstance?: any;
|
|
2046
2046
|
/**
|
|
2047
|
-
* Convenience function to set `document.body.innerHTML` and `waitForChanges()`. Function argument should be
|
|
2047
|
+
* Convenience function to set `document.body.innerHTML` and `waitForChanges()`. Function argument should be a HTML string.
|
|
2048
2048
|
*/
|
|
2049
2049
|
setContent: (html: string) => Promise<any>;
|
|
2050
2050
|
/**
|
|
@@ -2060,6 +2060,9 @@ export interface SpecPage {
|
|
|
2060
2060
|
flushQueue: () => Promise<any>;
|
|
2061
2061
|
styles: Map<string, string>;
|
|
2062
2062
|
}
|
|
2063
|
+
/**
|
|
2064
|
+
* Options pertaining to the creation and functionality of a {@link SpecPage}
|
|
2065
|
+
*/
|
|
2063
2066
|
export interface NewSpecPageOptions {
|
|
2064
2067
|
/**
|
|
2065
2068
|
* An array of components to test. Component classes can be imported into the spec file, then their reference should be added to the `component` array in order to be used throughout the test.
|
|
@@ -2073,6 +2076,9 @@ export interface NewSpecPageOptions {
|
|
|
2073
2076
|
* Sets the mocked `dir` attribute on `<html>`.
|
|
2074
2077
|
*/
|
|
2075
2078
|
direction?: string;
|
|
2079
|
+
/**
|
|
2080
|
+
* If `false`, do not flush the render queue on initial test setup.
|
|
2081
|
+
*/
|
|
2076
2082
|
flushQueue?: boolean;
|
|
2077
2083
|
/**
|
|
2078
2084
|
* The initial HTML used to generate the test. This can be useful to construct a collection of components working together, and assign HTML attributes. This value sets the mocked `document.body.innerHTML`.
|
|
@@ -2105,7 +2111,7 @@ export interface NewSpecPageOptions {
|
|
|
2105
2111
|
*/
|
|
2106
2112
|
supportsShadowDom?: boolean;
|
|
2107
2113
|
/**
|
|
2108
|
-
* When a component is
|
|
2114
|
+
* When a component is pre-rendered it includes HTML annotations, such as `s-id` attributes and `<!-t.0->` comments. This information is used by clientside hydrating. Default is `false`.
|
|
2109
2115
|
*/
|
|
2110
2116
|
includeAnnotations?: boolean;
|
|
2111
2117
|
/**
|
|
@@ -2125,9 +2131,14 @@ export interface NewSpecPageOptions {
|
|
|
2125
2131
|
* Setting this option to `true` will include the component's styles in the serializable output.
|
|
2126
2132
|
*/
|
|
2127
2133
|
attachStyles?: boolean;
|
|
2134
|
+
/**
|
|
2135
|
+
* Set {@link BuildConditionals} for testing based off the metadata of the component under test.
|
|
2136
|
+
* When `true` all `BuildConditionals` will be assigned to the global testing `BUILD` object, regardless of their
|
|
2137
|
+
* value. When `false`, only `BuildConditionals` with a value of `true` will be assigned to the `BUILD` object.
|
|
2138
|
+
*/
|
|
2128
2139
|
strictBuild?: boolean;
|
|
2129
2140
|
/**
|
|
2130
|
-
* Default values to be set on the platform runtime object
|
|
2141
|
+
* Default values to be set on the platform runtime object {@see PlatformRuntime} when creating
|
|
2131
2142
|
* the spec page.
|
|
2132
2143
|
*/
|
|
2133
2144
|
platform?: Partial<PlatformRuntime>;
|
|
@@ -2054,6 +2054,17 @@ export interface OutputTargetWww extends OutputTargetBase {
|
|
|
2054
2054
|
appDir?: string;
|
|
2055
2055
|
}
|
|
2056
2056
|
export type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
|
|
2057
|
+
/**
|
|
2058
|
+
* Our custom configuration interface for generated caching Service Workers
|
|
2059
|
+
* using the Workbox library (see https://developer.chrome.com/docs/workbox/).
|
|
2060
|
+
*
|
|
2061
|
+
* Although we are using Workbox we are unfortunately unable to depend on the
|
|
2062
|
+
* published types for the library because they must be compiled using the
|
|
2063
|
+
* `webworker` lib for TypeScript, which cannot be used at the same time as
|
|
2064
|
+
* the `dom` lib. So as a workaround we maintain our own interface here. See
|
|
2065
|
+
* here to refer to the published version:
|
|
2066
|
+
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c7b4dadae5b320ad1311a8f82242b8f2f41b7b8c/types/workbox-build/generate-sw.d.ts#L3
|
|
2067
|
+
*/
|
|
2057
2068
|
export interface ServiceWorkerConfig {
|
|
2058
2069
|
unregister?: boolean;
|
|
2059
2070
|
swDest?: string;
|
|
@@ -314,9 +314,15 @@ const createElm = (e, t, a, o) => {
|
|
|
314
314
|
let l, r = appData.BUILD.slotRelocation && e["s-cr"] && e["s-cr"].parentNode || e;
|
|
315
315
|
for (appData.BUILD.shadowDom && r.shadowRoot && r.tagName === hostTagName && (r = r.shadowRoot); s <= n; ++s) o[s] && (l = createElm(null, a, s, e),
|
|
316
316
|
l && (o[s].$elm$ = l, r.insertBefore(l, appData.BUILD.slotRelocation ? referenceNode(t) : t)));
|
|
317
|
-
}, removeVnodes = (e, t, a
|
|
318
|
-
for (
|
|
319
|
-
|
|
317
|
+
}, removeVnodes = (e, t, a) => {
|
|
318
|
+
for (let o = t; o <= a; ++o) {
|
|
319
|
+
const t = e[o];
|
|
320
|
+
if (t) {
|
|
321
|
+
const e = t.$elm$;
|
|
322
|
+
nullifyVNodeRefs(t), e && (appData.BUILD.slotRelocation && (checkSlotFallbackVisibility = !0,
|
|
323
|
+
e["s-ol"] ? e["s-ol"].remove() : putBackInOriginalLocation(e, !0)), e.remove());
|
|
324
|
+
}
|
|
325
|
+
}
|
|
320
326
|
}, isSameVnode = (e, t) => e.$tag$ === t.$tag$ && (appData.BUILD.slotRelocation && "slot" === e.$tag$ ? e.$name$ === t.$name$ : !appData.BUILD.vdomKey || e.$key$ === t.$key$), referenceNode = e => e && e["s-ol"] || e, parentReferenceNode = e => (e["s-ol"] ? e["s-ol"] : e).parentNode, patch = (e, t) => {
|
|
321
327
|
const a = t.$elm$ = e.$elm$, o = e.$children$, s = t.$children$, n = t.$tag$, l = t.$text$;
|
|
322
328
|
let r;
|
|
@@ -373,8 +379,8 @@ const createElm = (e, t, a, o) => {
|
|
|
373
379
|
}));
|
|
374
380
|
1 === t.nodeType && relocateSlotContent(t);
|
|
375
381
|
}
|
|
376
|
-
}, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t,
|
|
377
|
-
appData.BUILD.vdomRef && (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(
|
|
382
|
+
}, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t, nullifyVNodeRefs = e => {
|
|
383
|
+
appData.BUILD.vdomRef && (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(nullifyVNodeRefs));
|
|
378
384
|
}, renderVdom = (e, t) => {
|
|
379
385
|
const a = e.$hostElement$, o = e.$cmpMeta$, s = e.$vnode$ || newVNode(null, null), n = isHost(t) ? t : h(null, null, t);
|
|
380
386
|
if (hostTagName = a.tagName, appData.BUILD.isDev && Array.isArray(t) && t.some(isHost)) throw new Error(`The <Host> must be the single root component.\nLooks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);
|
|
@@ -419,9 +425,9 @@ const createElm = (e, t, a, o) => {
|
|
|
419
425
|
e.$queuedListeners$ && (e.$queuedListeners$.map((([e, t]) => safeCall(s, e, t))),
|
|
420
426
|
e.$queuedListeners$ = null)), emitLifecycleEvent(a, "componentWillLoad"), appData.BUILD.cmpWillLoad && (n = safeCall(s, "componentWillLoad"))) : (emitLifecycleEvent(a, "componentWillUpdate"),
|
|
421
427
|
appData.BUILD.cmpWillUpdate && (n = safeCall(s, "componentWillUpdate"))), emitLifecycleEvent(a, "componentWillRender"),
|
|
422
|
-
appData.BUILD.cmpWillRender && (n =
|
|
423
|
-
o(),
|
|
424
|
-
}, updateComponent = async (e, t, a) => {
|
|
428
|
+
appData.BUILD.cmpWillRender && (n = enqueue(n, (() => safeCall(s, "componentWillRender")))),
|
|
429
|
+
o(), enqueue(n, (() => updateComponent(e, s, t)));
|
|
430
|
+
}, enqueue = (e, t) => e instanceof Promise ? e.then(t) : t(), updateComponent = async (e, t, a) => {
|
|
425
431
|
const o = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), n = o["s-rc"];
|
|
426
432
|
appData.BUILD.style && a && attachStyles(e);
|
|
427
433
|
const l = createTime("render", e.$cmpMeta$.$tagName$);
|
|
@@ -485,7 +491,7 @@ const callRender = (e, t, a) => {
|
|
|
485
491
|
} catch (e) {
|
|
486
492
|
consoleError(e);
|
|
487
493
|
}
|
|
488
|
-
},
|
|
494
|
+
}, emitLifecycleEvent = (e, t) => {
|
|
489
495
|
appData.BUILD.lifecycleDOMEvents && emitEvent(e, "rindo_" + t, {
|
|
490
496
|
bubbles: !0,
|
|
491
497
|
composed: !0,
|
|
@@ -562,9 +568,9 @@ const callRender = (e, t, a) => {
|
|
|
562
568
|
}
|
|
563
569
|
return e;
|
|
564
570
|
}, initializeComponent = async (e, t, a, o, s) => {
|
|
565
|
-
if (
|
|
566
|
-
if (appData.BUILD.lazyLoad || appData.BUILD.hydrateClientSide) {
|
|
567
|
-
if (
|
|
571
|
+
if (0 == (32 & t.$flags$)) {
|
|
572
|
+
if (t.$flags$ |= 32, appData.BUILD.lazyLoad || appData.BUILD.hydrateClientSide) {
|
|
573
|
+
if ((s = loadModule(a)).then) {
|
|
568
574
|
const e = (n = `st:load:${a.$tagName$}:${t.$modeName$}`, l = `[Rindo] Load module for <${a.$tagName$}>`,
|
|
569
575
|
appData.BUILD.profile && performance.mark ? (0 === performance.getEntriesByName(n, "mark").length && performance.mark(n),
|
|
570
576
|
() => {
|
|
@@ -584,7 +590,7 @@ const callRender = (e, t, a) => {
|
|
|
584
590
|
}
|
|
585
591
|
appData.BUILD.member && (t.$flags$ &= -9), appData.BUILD.watchCallback && (t.$flags$ |= 128),
|
|
586
592
|
e(), fireConnectedCallback(t.$lazyInstance$);
|
|
587
|
-
} else s = e.constructor,
|
|
593
|
+
} else s = e.constructor, customElements.whenDefined(a.$tagName$).then((() => t.$flags$ |= 128));
|
|
588
594
|
if (appData.BUILD.style && s.style) {
|
|
589
595
|
let o = s.style;
|
|
590
596
|
appData.BUILD.mode && "string" != typeof o && (o = o[t.$modeName$ = computeMode(e)],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rindo/core/internal/testing",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Rindo internal testing platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
|
@@ -4,8 +4,7 @@ const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColo
|
|
|
4
4
|
return o.escapedString.replace(_ruleRe, ((...e) => {
|
|
5
5
|
const c = e[2];
|
|
6
6
|
let r = "", n = e[4], l = "";
|
|
7
|
-
n && n.startsWith("{%BLOCK%") && (r = o.blocks[s++], n = n.substring("
|
|
8
|
-
l = "{");
|
|
7
|
+
n && n.startsWith("{%BLOCK%") && (r = o.blocks[s++], n = n.substring(8), l = "{");
|
|
9
8
|
const a = t({
|
|
10
9
|
selector: c,
|
|
11
10
|
content: r
|