@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "4.22.3",
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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc (CommonJS) v4.22.3 | MIT Licensed | https://rindojs.web.app
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.childNodes);
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
- if (opts.newLines && (node.childNodes.length === 0 || node.childNodes.length === 1 && node.childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = node.childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
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.childNodes;
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
- console.error(
6875
- `NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
6876
- Testing components with ElementInternals is fully supported in e2e tests.`
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.22.3 | MIT Licensed | https://rindojs.web.app
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.childNodes);
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
- if (opts.newLines && (node.childNodes.length === 0 || node.childNodes.length === 1 && node.childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = node.childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
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.childNodes;
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
- console.error(
6822
- `NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
6823
- Testing components with ElementInternals is fully supported in e2e tests.`
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;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/mock-doc",
3
- "version": "4.22.3",
3
+ "version": "4.23.1",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core",
3
- "version": "4.22.3",
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.0",
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",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Screenshot v4.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Screenshot v4.23.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "4.22.3",
3
+ "version": "4.23.1",
4
4
  "description": "Rindo Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Screenshot Pixel Match v4.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Screenshot Pixel Match v4.23.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;