@rindo/core 4.22.3 → 4.23.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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +1730 -158
- 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/internal/app-data/package.json +1 -1
- package/internal/client/index.js +1506 -1161
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +1468 -1156
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +53 -39
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +72 -3
- package/internal/rindo-public-docs.d.ts +8 -0
- package/internal/testing/index.js +1478 -1166
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +20 -9
- package/mock-doc/index.js +20 -9
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +13 -13
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +12 -3
- package/testing/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rindo/core/internal/testing",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.23.1",
|
|
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
|
package/mock-doc/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo Mock Doc (CommonJS) v4.
|
|
2
|
+
Rindo Mock Doc (CommonJS) v4.23.1 | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -6301,7 +6301,7 @@ function serializeNodeToHtml(elm, serializationOptions = {}) {
|
|
|
6301
6301
|
text: []
|
|
6302
6302
|
};
|
|
6303
6303
|
let renderedNode = "";
|
|
6304
|
-
const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(elm
|
|
6304
|
+
const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(getChildNodes(elm));
|
|
6305
6305
|
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
6306
6306
|
const child = children[i];
|
|
6307
6307
|
const chunks = Array.from(streamToHtml(child, opts, output));
|
|
@@ -6334,7 +6334,10 @@ function* streamToHtml(node, opts, output) {
|
|
|
6334
6334
|
const tag = tagName === shadowRootTag ? "template" : tagName;
|
|
6335
6335
|
yield "<" + tag;
|
|
6336
6336
|
output.currentLineWidth += tag.length + 1;
|
|
6337
|
-
if (tag === "template")
|
|
6337
|
+
if (tag === "template" && (!node.getAttribute || !node.getAttribute("shadowrootmode")) && /**
|
|
6338
|
+
* If the node is a shadow root, we want to add the `shadowrootmode` attribute
|
|
6339
|
+
*/
|
|
6340
|
+
("host" in node || node.nodeName.toLocaleLowerCase() === shadowRootTag)) {
|
|
6338
6341
|
const mode = ` shadowrootmode="open"`;
|
|
6339
6342
|
yield mode;
|
|
6340
6343
|
output.currentLineWidth += mode.length;
|
|
@@ -6418,7 +6421,8 @@ style="${cssText}">`;
|
|
|
6418
6421
|
output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
|
|
6419
6422
|
yield* streamToHtml(shadowRoot, opts, output);
|
|
6420
6423
|
output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
|
|
6421
|
-
|
|
6424
|
+
const childNodes = getChildNodes(node);
|
|
6425
|
+
if (opts.newLines && (childNodes.length === 0 || childNodes.length === 1 && childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
|
|
6422
6426
|
yield "\n";
|
|
6423
6427
|
output.currentLineWidth = 0;
|
|
6424
6428
|
for (let i = 0; i < output.indent; i++) {
|
|
@@ -6429,7 +6433,7 @@ style="${cssText}">`;
|
|
|
6429
6433
|
}
|
|
6430
6434
|
if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
|
|
6431
6435
|
const tag = tagName === shadowRootTag ? "template" : tagName;
|
|
6432
|
-
const childNodes = tagName === "template" ? node.content.childNodes : node
|
|
6436
|
+
const childNodes = tagName === "template" ? node.content.childNodes : getChildNodes(node);
|
|
6433
6437
|
const childNodeLength = childNodes.length;
|
|
6434
6438
|
if (childNodeLength > 0) {
|
|
6435
6439
|
if (childNodeLength === 1 && childNodes[0].nodeType === 3 /* TEXT_NODE */ && (typeof childNodes[0].nodeValue !== "string" || childNodes[0].nodeValue.trim() === "")) {
|
|
@@ -6602,6 +6606,9 @@ function isWithinWhitespaceSensitive(node) {
|
|
|
6602
6606
|
}
|
|
6603
6607
|
return false;
|
|
6604
6608
|
}
|
|
6609
|
+
function getChildNodes(node) {
|
|
6610
|
+
return node.__childNodes || node.childNodes;
|
|
6611
|
+
}
|
|
6605
6612
|
var NON_ESCAPABLE_CONTENT = /* @__PURE__ */ new Set([
|
|
6606
6613
|
"STYLE",
|
|
6607
6614
|
"SCRIPT",
|
|
@@ -6871,10 +6878,12 @@ var MockElement = class extends MockNode2 {
|
|
|
6871
6878
|
attachInternals() {
|
|
6872
6879
|
return new Proxy({}, {
|
|
6873
6880
|
get: function(_target, prop, _receiver) {
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6881
|
+
if ("process" in globalThis && globalThis.process.env.__RINDO_SPEC_TESTS__) {
|
|
6882
|
+
console.error(
|
|
6883
|
+
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
|
|
6884
|
+
Testing components with ElementInternals is fully supported in e2e tests.`
|
|
6885
|
+
);
|
|
6886
|
+
}
|
|
6878
6887
|
}
|
|
6879
6888
|
});
|
|
6880
6889
|
}
|
|
@@ -7794,6 +7803,8 @@ function createElement(ownerDocument, tagName) {
|
|
|
7794
7803
|
return new MockTitleElement(ownerDocument);
|
|
7795
7804
|
case "ul":
|
|
7796
7805
|
return new MockUListElement(ownerDocument);
|
|
7806
|
+
case "slot-fb":
|
|
7807
|
+
return new MockHTMLElement(ownerDocument, tagName);
|
|
7797
7808
|
}
|
|
7798
7809
|
if (ownerDocument != null && tagName.includes("-")) {
|
|
7799
7810
|
const win = ownerDocument.defaultView;
|
package/mock-doc/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo Mock Doc v4.
|
|
2
|
+
Rindo Mock Doc v4.23.1 | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// src/runtime/runtime-constants.ts
|
|
@@ -6248,7 +6248,7 @@ function serializeNodeToHtml(elm, serializationOptions = {}) {
|
|
|
6248
6248
|
text: []
|
|
6249
6249
|
};
|
|
6250
6250
|
let renderedNode = "";
|
|
6251
|
-
const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(elm
|
|
6251
|
+
const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(getChildNodes(elm));
|
|
6252
6252
|
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
6253
6253
|
const child = children[i];
|
|
6254
6254
|
const chunks = Array.from(streamToHtml(child, opts, output));
|
|
@@ -6281,7 +6281,10 @@ function* streamToHtml(node, opts, output) {
|
|
|
6281
6281
|
const tag = tagName === shadowRootTag ? "template" : tagName;
|
|
6282
6282
|
yield "<" + tag;
|
|
6283
6283
|
output.currentLineWidth += tag.length + 1;
|
|
6284
|
-
if (tag === "template")
|
|
6284
|
+
if (tag === "template" && (!node.getAttribute || !node.getAttribute("shadowrootmode")) && /**
|
|
6285
|
+
* If the node is a shadow root, we want to add the `shadowrootmode` attribute
|
|
6286
|
+
*/
|
|
6287
|
+
("host" in node || node.nodeName.toLocaleLowerCase() === shadowRootTag)) {
|
|
6285
6288
|
const mode = ` shadowrootmode="open"`;
|
|
6286
6289
|
yield mode;
|
|
6287
6290
|
output.currentLineWidth += mode.length;
|
|
@@ -6365,7 +6368,8 @@ style="${cssText}">`;
|
|
|
6365
6368
|
output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
|
|
6366
6369
|
yield* streamToHtml(shadowRoot, opts, output);
|
|
6367
6370
|
output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
|
|
6368
|
-
|
|
6371
|
+
const childNodes = getChildNodes(node);
|
|
6372
|
+
if (opts.newLines && (childNodes.length === 0 || childNodes.length === 1 && childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
|
|
6369
6373
|
yield "\n";
|
|
6370
6374
|
output.currentLineWidth = 0;
|
|
6371
6375
|
for (let i = 0; i < output.indent; i++) {
|
|
@@ -6376,7 +6380,7 @@ style="${cssText}">`;
|
|
|
6376
6380
|
}
|
|
6377
6381
|
if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
|
|
6378
6382
|
const tag = tagName === shadowRootTag ? "template" : tagName;
|
|
6379
|
-
const childNodes = tagName === "template" ? node.content.childNodes : node
|
|
6383
|
+
const childNodes = tagName === "template" ? node.content.childNodes : getChildNodes(node);
|
|
6380
6384
|
const childNodeLength = childNodes.length;
|
|
6381
6385
|
if (childNodeLength > 0) {
|
|
6382
6386
|
if (childNodeLength === 1 && childNodes[0].nodeType === 3 /* TEXT_NODE */ && (typeof childNodes[0].nodeValue !== "string" || childNodes[0].nodeValue.trim() === "")) {
|
|
@@ -6549,6 +6553,9 @@ function isWithinWhitespaceSensitive(node) {
|
|
|
6549
6553
|
}
|
|
6550
6554
|
return false;
|
|
6551
6555
|
}
|
|
6556
|
+
function getChildNodes(node) {
|
|
6557
|
+
return node.__childNodes || node.childNodes;
|
|
6558
|
+
}
|
|
6552
6559
|
var NON_ESCAPABLE_CONTENT = /* @__PURE__ */ new Set([
|
|
6553
6560
|
"STYLE",
|
|
6554
6561
|
"SCRIPT",
|
|
@@ -6818,10 +6825,12 @@ var MockElement = class extends MockNode2 {
|
|
|
6818
6825
|
attachInternals() {
|
|
6819
6826
|
return new Proxy({}, {
|
|
6820
6827
|
get: function(_target, prop, _receiver) {
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6828
|
+
if ("process" in globalThis && globalThis.process.env.__RINDO_SPEC_TESTS__) {
|
|
6829
|
+
console.error(
|
|
6830
|
+
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
|
|
6831
|
+
Testing components with ElementInternals is fully supported in e2e tests.`
|
|
6832
|
+
);
|
|
6833
|
+
}
|
|
6825
6834
|
}
|
|
6826
6835
|
});
|
|
6827
6836
|
}
|
|
@@ -7741,6 +7750,8 @@ function createElement(ownerDocument, tagName) {
|
|
|
7741
7750
|
return new MockTitleElement(ownerDocument);
|
|
7742
7751
|
case "ul":
|
|
7743
7752
|
return new MockUListElement(ownerDocument);
|
|
7753
|
+
case "slot-fb":
|
|
7754
|
+
return new MockHTMLElement(ownerDocument, tagName);
|
|
7744
7755
|
}
|
|
7745
7756
|
if (ownerDocument != null && tagName.includes("-")) {
|
|
7746
7757
|
const win = ownerDocument.defaultView;
|
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rindo/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.23.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./internal/rindo-core/index.cjs",
|
|
6
6
|
"module": "./internal/rindo-core/index.js",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"@rollup/plugin-json": "6.1.0",
|
|
128
128
|
"@rollup/plugin-node-resolve": "9.0.0",
|
|
129
129
|
"@rollup/plugin-replace": "5.0.7",
|
|
130
|
-
"@rollup/pluginutils": "5.1.
|
|
130
|
+
"@rollup/pluginutils": "5.1.3",
|
|
131
131
|
"@types/eslint": "^8.4.6",
|
|
132
132
|
"@types/exit": "^0.1.31",
|
|
133
133
|
"@types/fs-extra": "^11.0.0",
|
package/screenshot/index.js
CHANGED
package/screenshot/package.json
CHANGED