@rindo/core 4.23.2 → 4.26.0

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.
Files changed (43) hide show
  1. package/cli/index.cjs +2 -5
  2. package/cli/index.js +2 -5
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/rindo.js +2463 -839
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +10 -10
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/client/index.js +2389 -1873
  14. package/internal/client/package.json +1 -1
  15. package/internal/client/patch-browser.js +1 -1
  16. package/internal/client/shadow-css.js +30 -6
  17. package/internal/hydrate/index.js +2450 -1854
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.d.ts +22 -5
  20. package/internal/hydrate/runner.js +139 -45
  21. package/internal/package.json +1 -1
  22. package/internal/rindo-private.d.ts +70 -2
  23. package/internal/rindo-public-compiler.d.ts +31 -16
  24. package/internal/testing/index.js +2192 -1693
  25. package/internal/testing/package.json +1 -1
  26. package/mock-doc/index.cjs +71 -7
  27. package/mock-doc/index.d.ts +14 -1
  28. package/mock-doc/index.js +71 -7
  29. package/mock-doc/package.json +1 -1
  30. package/package.json +3 -3
  31. package/screenshot/index.js +1 -1
  32. package/screenshot/package.json +1 -1
  33. package/screenshot/pixel-match.js +1 -1
  34. package/sys/node/autoprefixer.js +2 -2
  35. package/sys/node/glob.js +1 -1
  36. package/sys/node/index.js +1 -1
  37. package/sys/node/package.json +1 -1
  38. package/sys/node/worker.js +1 -1
  39. package/testing/index.js +28 -19
  40. package/testing/jest/jest-27-and-under/matchers/html.d.ts +2 -1
  41. package/testing/jest/jest-28/matchers/html.d.ts +2 -1
  42. package/testing/jest/jest-29/matchers/html.d.ts +2 -1
  43. package/testing/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/hydrate",
3
- "version": "4.23.2",
3
+ "version": "4.26.0",
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
@@ -138,12 +138,29 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
138
138
  */
139
139
  removeHtmlComments?: boolean;
140
140
  /**
141
- * If set to `true` the component will be rendered within a Declarative Shadow DOM.
142
- * If set to `false` Rindo will ignore the contents of the shadow root and render the
143
- * element as given in provided template.
144
- * @default true
141
+ * Configure how Rindo serializes the components shadow root.
142
+ * - If set to `declarative-shadow-dom` the component will be rendered within a Declarative Shadow DOM.
143
+ * - If set to `scoped` Rindo will render the contents of the shadow root as a `scoped: true` component
144
+ * and the shadow DOM will be created during client-side hydration.
145
+ * - Alternatively you can mix and match the two by providing an object with `declarative-shadow-dom` and `scoped` keys,
146
+ * the value arrays containing the tag names of the components that should be rendered in that mode.
147
+ *
148
+ * Examples:
149
+ * - `{ 'declarative-shadow-dom': ['my-component-1', 'another-component'], default: 'scoped' }`
150
+ * Render all components as `scoped` apart from `my-component-1` and `another-component`
151
+ * - `{ 'scoped': ['an-option-component'], default: 'declarative-shadow-dom' }`
152
+ * Render all components within `declarative-shadow-dom` apart from `an-option-component`
153
+ * - `'scoped'` Render all components as `scoped`
154
+ * - `false` disables shadow root serialization
155
+ *
156
+ * *NOTE* `true` has been deprecated in favor of `declarative-shadow-dom` and `scoped`
157
+ * @default 'declarative-shadow-dom'
145
158
  */
146
- serializeShadowRoot?: boolean;
159
+ serializeShadowRoot?: "declarative-shadow-dom" | "scoped" | {
160
+ "declarative-shadow-dom"?: string[];
161
+ scoped?: string[];
162
+ default: "declarative-shadow-dom" | "scoped";
163
+ } | boolean;
147
164
  /**
148
165
  * The `fullDocument` flag determines the format of the rendered output. Set it to true to
149
166
  * generate a complete HTML document, or false to render only the component.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Runner v4.23.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Runner v4.26.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -10416,7 +10416,7 @@ function normalizeSerializationOptions(opts = {}) {
10416
10416
  removeAttributeQuotes: typeof opts.removeAttributeQuotes !== "boolean" ? false : opts.removeAttributeQuotes,
10417
10417
  removeBooleanAttributeQuotes: typeof opts.removeBooleanAttributeQuotes !== "boolean" ? false : opts.removeBooleanAttributeQuotes,
10418
10418
  removeHtmlComments: typeof opts.removeHtmlComments !== "boolean" ? false : opts.removeHtmlComments,
10419
- serializeShadowRoot: typeof opts.serializeShadowRoot !== "boolean" ? true : opts.serializeShadowRoot,
10419
+ serializeShadowRoot: typeof opts.serializeShadowRoot === "undefined" ? "declarative-shadow-dom" : opts.serializeShadowRoot,
10420
10420
  fullDocument: typeof opts.fullDocument !== "boolean" ? true : opts.fullDocument
10421
10421
  };
10422
10422
  }
@@ -10545,7 +10545,7 @@ style="${cssText}">`;
10545
10545
  }
10546
10546
  if (EMPTY_ELEMENTS.has(tagName) === false) {
10547
10547
  const shadowRoot = node.shadowRoot;
10548
- if (shadowRoot != null && opts.serializeShadowRoot) {
10548
+ if (shadowRoot != null && opts.serializeShadowRoot !== false) {
10549
10549
  output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
10550
10550
  yield* streamToHtml(shadowRoot, opts, output);
10551
10551
  output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
@@ -10969,7 +10969,7 @@ var MockNode2 = class {
10969
10969
  }
10970
10970
  remove() {
10971
10971
  if (this.parentNode != null) {
10972
- this.parentNode.removeChild(this);
10972
+ this.__parentNode ? this.__parentNode.removeChild(this) : this.parentNode.removeChild(this);
10973
10973
  }
10974
10974
  }
10975
10975
  replaceChild(newChild, oldChild) {
@@ -11923,6 +11923,10 @@ function createElement(ownerDocument, tagName) {
11923
11923
  return new MockMetaElement(ownerDocument);
11924
11924
  case "script":
11925
11925
  return new MockScriptElement(ownerDocument);
11926
+ case "slot":
11927
+ return new MockSlotElement(ownerDocument);
11928
+ case "slot-fb":
11929
+ return new MockHTMLElement(ownerDocument, tagName);
11926
11930
  case "style":
11927
11931
  return new MockStyleElement(ownerDocument);
11928
11932
  case "template":
@@ -11931,8 +11935,6 @@ function createElement(ownerDocument, tagName) {
11931
11935
  return new MockTitleElement(ownerDocument);
11932
11936
  case "ul":
11933
11937
  return new MockUListElement(ownerDocument);
11934
- case "slot-fb":
11935
- return new MockHTMLElement(ownerDocument, tagName);
11936
11938
  }
11937
11939
  if (ownerDocument != null && tagName.includes("-")) {
11938
11940
  const win2 = ownerDocument.defaultView;
@@ -12352,6 +12354,68 @@ var MockUListElement = class extends MockHTMLElement {
12352
12354
  super(ownerDocument, "ul");
12353
12355
  }
12354
12356
  };
12357
+ var MockSlotElement = class _MockSlotElement extends MockHTMLElement {
12358
+ constructor(ownerDocument) {
12359
+ super(ownerDocument, "slot");
12360
+ }
12361
+ assignedNodes(opts) {
12362
+ let nodesToReturn = [];
12363
+ const ownerHost = this.getRootNode().host;
12364
+ if (!ownerHost) return nodesToReturn;
12365
+ if (ownerHost.childNodes.length) {
12366
+ if (this.name) {
12367
+ nodesToReturn = ownerHost.childNodes.filter(
12368
+ (n) => n.nodeType === 1 /* ELEMENT_NODE */ && n.getAttribute("slot") === this.name
12369
+ );
12370
+ } else {
12371
+ nodesToReturn = ownerHost.childNodes.filter(
12372
+ (n) => n.nodeType === 1 /* ELEMENT_NODE */ && !n.getAttribute("slot") || n.nodeType !== 1 /* ELEMENT_NODE */
12373
+ );
12374
+ }
12375
+ if (nodesToReturn.length) return nodesToReturn;
12376
+ }
12377
+ if (!(opts == null ? void 0 : opts.flatten)) return this.childNodes.filter((n) => !(n instanceof _MockSlotElement));
12378
+ return this.childNodes.reduce(
12379
+ (acc, node) => {
12380
+ if (node instanceof _MockSlotElement) {
12381
+ acc.push(...node.assignedNodes(opts));
12382
+ } else {
12383
+ acc.push(node);
12384
+ }
12385
+ return acc;
12386
+ },
12387
+ []
12388
+ );
12389
+ }
12390
+ assignedElements(opts) {
12391
+ let elesToReturn = [];
12392
+ const ownerHost = this.getRootNode().host;
12393
+ if (!ownerHost) return elesToReturn;
12394
+ if (ownerHost.children.length) {
12395
+ if (this.name) {
12396
+ elesToReturn = ownerHost.children.filter((n) => n.getAttribute("slot") == this.name);
12397
+ } else {
12398
+ elesToReturn = ownerHost.children.filter((n) => !n.getAttribute("slot"));
12399
+ }
12400
+ if (elesToReturn.length) return elesToReturn;
12401
+ }
12402
+ if (!(opts == null ? void 0 : opts.flatten)) return this.children.filter((n) => !(n instanceof _MockSlotElement));
12403
+ return this.children.reduce(
12404
+ (acc, node) => {
12405
+ if (node instanceof _MockSlotElement) {
12406
+ acc.push(...node.assignedElements(opts));
12407
+ } else {
12408
+ acc.push(node);
12409
+ }
12410
+ return acc;
12411
+ },
12412
+ []
12413
+ );
12414
+ }
12415
+ };
12416
+ patchPropAttributes(MockSlotElement.prototype, {
12417
+ name: String
12418
+ });
12355
12419
  var CanvasRenderingContext = class {
12356
12420
  constructor(context, contextAttributes) {
12357
12421
  this.context = context;
@@ -13729,7 +13793,7 @@ function resetWindowDefaults(win2) {
13729
13793
  win2.__clearTimeout = nativeClearTimeout;
13730
13794
  win2.__setInterval = nativeSetInterval;
13731
13795
  win2.__setTimeout = nativeSetTimeout;
13732
- win2.__maxTimeout = 3e4;
13796
+ win2.__maxTimeout = 6e4;
13733
13797
  win2.__allowInterval = true;
13734
13798
  win2.URL = nativeURL;
13735
13799
  }
@@ -14121,15 +14185,20 @@ var Build = {
14121
14185
  };
14122
14186
 
14123
14187
  // src/client/client-host-ref.ts
14188
+ import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
14189
+
14190
+ // src/utils/es2022-rewire-class-members.ts
14124
14191
  import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
14125
- var hostRefs = BUILD2.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
14192
+
14193
+ // src/client/client-host-ref.ts
14194
+ var hostRefs = BUILD3.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
14126
14195
 
14127
14196
  // src/client/client-load-module.ts
14128
- import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
14197
+ import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
14129
14198
 
14130
14199
  // src/client/client-log.ts
14131
- import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
14132
- var RINDO_DEV_MODE = BUILD3.isTesting ? ["RINDO:"] : [
14200
+ import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
14201
+ var RINDO_DEV_MODE = BUILD4.isTesting ? ["RINDO:"] : [
14133
14202
  "%crindo",
14134
14203
  "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
14135
14204
  ];
@@ -14138,16 +14207,16 @@ var RINDO_DEV_MODE = BUILD3.isTesting ? ["RINDO:"] : [
14138
14207
  var modeResolutionChain = [];
14139
14208
 
14140
14209
  // src/client/client-task-queue.ts
14141
- import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
14210
+ import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
14142
14211
 
14143
14212
  // src/client/client-window.ts
14144
- import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
14213
+ import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
14145
14214
  var win = typeof window !== "undefined" ? window : {};
14146
14215
  var doc = win.document || { head: {} };
14147
14216
  var H = win.HTMLElement || class {
14148
14217
  };
14149
- var supportsShadow = BUILD5.shadowDom;
14150
- var supportsConstructableStylesheets = BUILD5.constructableCSS ? /* @__PURE__ */ (() => {
14218
+ var supportsShadow = BUILD6.shadowDom;
14219
+ var supportsConstructableStylesheets = BUILD6.constructableCSS ? /* @__PURE__ */ (() => {
14151
14220
  try {
14152
14221
  new CSSStyleSheet();
14153
14222
  return typeof new CSSStyleSheet().replaceSync === "function";
@@ -14157,10 +14226,10 @@ var supportsConstructableStylesheets = BUILD5.constructableCSS ? /* @__PURE__ */
14157
14226
  })() : false;
14158
14227
 
14159
14228
  // src/client/index.ts
14160
- import { BUILD as BUILD28, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
14229
+ import { BUILD as BUILD29, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
14161
14230
 
14162
14231
  // src/runtime/bootstrap-custom-element.ts
14163
- import { BUILD as BUILD25 } from "@rindo/core/internal/app-data";
14232
+ import { BUILD as BUILD26 } from "@rindo/core/internal/app-data";
14164
14233
 
14165
14234
  // src/utils/helpers.ts
14166
14235
  var isString = (v) => typeof v === "string";
@@ -14253,69 +14322,94 @@ var unwrapErr = (result) => {
14253
14322
  };
14254
14323
 
14255
14324
  // src/runtime/connected-callback.ts
14256
- import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
14325
+ import { BUILD as BUILD24 } from "@rindo/core/internal/app-data";
14257
14326
 
14258
14327
  // src/runtime/client-hydrate.ts
14259
- import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
14328
+ import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
14260
14329
 
14261
14330
  // src/runtime/dom-extras.ts
14262
- import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
14331
+ import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
14263
14332
 
14264
14333
  // src/runtime/slot-polyfill-utils.ts
14265
- import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
14266
-
14267
- // src/runtime/vdom/vdom-render.ts
14268
- import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
14269
-
14270
- // src/runtime/vdom/h.ts
14271
14334
  import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
14272
14335
 
14273
- // src/runtime/vdom/update-element.ts
14336
+ // src/runtime/profile.ts
14274
14337
  import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
14275
14338
 
14276
- // src/runtime/vdom/set-accessor.ts
14277
- import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
14278
- var CAPTURE_EVENT_SUFFIX = "Capture";
14279
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
14280
-
14281
- // src/runtime/profile.ts
14282
- import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
14339
+ // src/runtime/vdom/h.ts
14340
+ import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
14283
14341
 
14284
14342
  // src/runtime/initialize-component.ts
14285
- import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
14343
+ import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
14344
+
14345
+ // src/utils/shadow-css.ts
14346
+ /**
14347
+ * @license
14348
+ * Copyright Google Inc. All Rights Reserved.
14349
+ *
14350
+ * Use of this source code is governed by an MIT-style license that can be
14351
+ * found in the LICENSE file at https://angular.io/license
14352
+ *
14353
+ * This file is a port of shadowCSS from `webcomponents.js` to TypeScript.
14354
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
14355
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
14356
+ */
14357
+ var _polyfillHost = "-shadowcsshost";
14358
+ var _polyfillSlotted = "-shadowcssslotted";
14359
+ var _polyfillHostContext = "-shadowcsscontext";
14360
+ var _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
14361
+ var _cssColonHostRe = new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
14362
+ var _cssColonHostContextRe = new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
14363
+ var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
14364
+ var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
14365
+ var createSupportsRuleRe = (selector) => new RegExp(`((?<!(^@supports(.*)))|(?<={.*))(${selector}\\b)`, "gim");
14366
+ var _colonSlottedRe = createSupportsRuleRe("::slotted");
14367
+ var _colonHostRe = createSupportsRuleRe(":host");
14368
+ var _colonHostContextRe = createSupportsRuleRe(":host-context");
14286
14369
 
14287
14370
  // src/runtime/mode.ts
14288
14371
  var setMode = (handler) => modeResolutionChain.push(handler);
14289
14372
 
14290
14373
  // src/runtime/proxy-component.ts
14291
- import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
14374
+ import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
14292
14375
 
14293
14376
  // src/runtime/set-value.ts
14294
- import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
14377
+ import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
14295
14378
 
14296
14379
  // src/runtime/parse-property-value.ts
14297
- import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
14380
+ import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
14298
14381
 
14299
14382
  // src/runtime/update-component.ts
14300
- import { BUILD as BUILD19, NAMESPACE } from "@rindo/core/internal/app-data";
14383
+ import { BUILD as BUILD20, NAMESPACE } from "@rindo/core/internal/app-data";
14301
14384
 
14302
14385
  // src/runtime/event-emitter.ts
14303
- import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
14386
+ import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
14304
14387
 
14305
14388
  // src/runtime/element.ts
14306
- import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
14389
+ import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
14307
14390
 
14308
14391
  // src/runtime/styles.ts
14392
+ import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
14393
+
14394
+ // src/runtime/vdom/vdom-render.ts
14395
+ import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
14396
+
14397
+ // src/runtime/vdom/update-element.ts
14309
14398
  import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
14310
14399
 
14400
+ // src/runtime/vdom/set-accessor.ts
14401
+ import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
14402
+ var CAPTURE_EVENT_SUFFIX = "Capture";
14403
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
14404
+
14311
14405
  // src/runtime/disconnected-callback.ts
14312
- import { BUILD as BUILD24 } from "@rindo/core/internal/app-data";
14406
+ import { BUILD as BUILD25 } from "@rindo/core/internal/app-data";
14313
14407
 
14314
14408
  // src/runtime/bootstrap-lazy.ts
14315
- import { BUILD as BUILD26 } from "@rindo/core/internal/app-data";
14409
+ import { BUILD as BUILD27 } from "@rindo/core/internal/app-data";
14316
14410
 
14317
14411
  // src/runtime/host-listener.ts
14318
- import { BUILD as BUILD27 } from "@rindo/core/internal/app-data";
14412
+ import { BUILD as BUILD28 } from "@rindo/core/internal/app-data";
14319
14413
 
14320
14414
  // src/compiler/html/canonical-link.ts
14321
14415
  var updateCanonicalLink = (doc2, href) => {
@@ -15500,7 +15594,7 @@ function renderToString(html, options, asStream) {
15500
15594
  const opts = normalizeHydrateOptions(options);
15501
15595
  opts.serializeToHtml = true;
15502
15596
  opts.fullDocument = typeof opts.fullDocument === "boolean" ? opts.fullDocument : true;
15503
- opts.serializeShadowRoot = typeof opts.serializeShadowRoot === "boolean" ? opts.serializeShadowRoot : true;
15597
+ opts.serializeShadowRoot = typeof opts.serializeShadowRoot === "undefined" ? "declarative-shadow-dom" : opts.serializeShadowRoot;
15504
15598
  opts.constrainTimeouts = false;
15505
15599
  return hydrateDocument(html, opts, asStream);
15506
15600
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal",
3
- "version": "4.23.2",
3
+ "version": "4.26.0",
4
4
  "description": "Rindo internals only to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1215,7 +1215,7 @@ export interface RenderNode extends HostElement {
1215
1215
  */
1216
1216
  ['s-sr']?: boolean;
1217
1217
  /**
1218
- * Slot name
1218
+ * Slot name of either the slot itself or the slotted node
1219
1219
  */
1220
1220
  ['s-sn']?: string;
1221
1221
  /**
@@ -1248,7 +1248,7 @@ export interface RenderNode extends HostElement {
1248
1248
  * This is a reference for a original location node
1249
1249
  * back to the node that's been moved around.
1250
1250
  */
1251
- ['s-nr']?: RenderNode;
1251
+ ['s-nr']?: PatchedSlotNode | RenderNode;
1252
1252
  /**
1253
1253
  * Original Order:
1254
1254
  * During SSR; a number representing the order of a slotted node
@@ -1319,6 +1319,12 @@ export interface RenderNode extends HostElement {
1319
1319
  * gives access to the original `appendChild` method
1320
1320
  */
1321
1321
  __appendChild?: <T extends Node>(newChild: T) => T;
1322
+ /**
1323
+ * On a `scoped: true` component
1324
+ * with `experimentalSlotFixes` flag enabled,
1325
+ * gives access to the original `insertBefore` method
1326
+ */
1327
+ __insertBefore?: <T extends Node>(node: T, child: Node | null) => T;
1322
1328
  /**
1323
1329
  * On a `scoped: true` component
1324
1330
  * with `experimentalSlotFixes` flag enabled,
@@ -1326,6 +1332,68 @@ export interface RenderNode extends HostElement {
1326
1332
  */
1327
1333
  __removeChild?: <T extends Node>(child: T) => T;
1328
1334
  }
1335
+ export interface PatchedSlotNode extends Node {
1336
+ /**
1337
+ * Slot name
1338
+ */
1339
+ ['s-sn']?: string;
1340
+ /**
1341
+ * Original Location Reference:
1342
+ * A reference pointing to the comment
1343
+ * which represents the original location
1344
+ * before it was moved to its slot.
1345
+ */
1346
+ ['s-ol']?: RenderNode;
1347
+ /**
1348
+ * Slot host tag name:
1349
+ * This is the tag name of the element where this node
1350
+ * has been moved to during slot relocation.
1351
+ *
1352
+ * This allows us to check if the node has been moved and prevent
1353
+ * us from thinking a node _should_ be moved when it may already be in
1354
+ * its final destination.
1355
+ *
1356
+ * This value is set to `undefined` whenever the node is put back into its original location.
1357
+ */
1358
+ ['s-sh']?: string;
1359
+ /**
1360
+ * Is a `slot` node when `shadow: false` (or `scoped: true`).
1361
+ *
1362
+ * This is a node (either empty text-node or `<slot-fb>` element)
1363
+ * that represents where a `<slot>` is located in the original JSX.
1364
+ */
1365
+ ['s-sr']?: boolean;
1366
+ /**
1367
+ * On a `scoped: true` component
1368
+ * with `experimentalSlotFixes` flag enabled,
1369
+ * returns the actual `parentNode` of the component
1370
+ */
1371
+ __parentNode?: RenderNode;
1372
+ /**
1373
+ * On a `scoped: true` component
1374
+ * with `experimentalSlotFixes` flag enabled,
1375
+ * returns the actual `nextSibling` of the component
1376
+ */
1377
+ __nextSibling?: RenderNode;
1378
+ /**
1379
+ * On a `scoped: true` component
1380
+ * with `experimentalSlotFixes` flag enabled,
1381
+ * returns the actual `previousSibling` of the component
1382
+ */
1383
+ __previousSibling?: RenderNode;
1384
+ /**
1385
+ * On a `scoped: true` component
1386
+ * with `experimentalSlotFixes` flag enabled,
1387
+ * returns the actual `nextElementSibling` of the component
1388
+ */
1389
+ __nextElementSibling?: RenderNode;
1390
+ /**
1391
+ * On a `scoped: true` component
1392
+ * with `experimentalSlotFixes` flag enabled,
1393
+ * returns the actual `nextElementSibling` of the component
1394
+ */
1395
+ __previousElementSibling?: RenderNode;
1396
+ }
1329
1397
  export type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
1330
1398
  export type LazyBundleRuntimeData = [
1331
1399
  /** bundleIds */
@@ -849,12 +849,29 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
849
849
  */
850
850
  removeHtmlComments?: boolean;
851
851
  /**
852
- * If set to `true` the component will be rendered within a Declarative Shadow DOM.
853
- * If set to `false` Rindo will ignore the contents of the shadow root and render the
854
- * element as given in provided template.
855
- * @default true
852
+ * Configure how Rindo serializes the components shadow root.
853
+ * - If set to `declarative-shadow-dom` the component will be rendered within a Declarative Shadow DOM.
854
+ * - If set to `scoped` Rindo will render the contents of the shadow root as a `scoped: true` component
855
+ * and the shadow DOM will be created during client-side hydration.
856
+ * - Alternatively you can mix and match the two by providing an object with `declarative-shadow-dom` and `scoped` keys,
857
+ * the value arrays containing the tag names of the components that should be rendered in that mode.
858
+ *
859
+ * Examples:
860
+ * - `{ 'declarative-shadow-dom': ['my-component-1', 'another-component'], default: 'scoped' }`
861
+ * Render all components as `scoped` apart from `my-component-1` and `another-component`
862
+ * - `{ 'scoped': ['an-option-component'], default: 'declarative-shadow-dom' }`
863
+ * Render all components within `declarative-shadow-dom` apart from `an-option-component`
864
+ * - `'scoped'` Render all components as `scoped`
865
+ * - `false` disables shadow root serialization
866
+ *
867
+ * *NOTE* `true` has been deprecated in favor of `declarative-shadow-dom` and `scoped`
868
+ * @default 'declarative-shadow-dom'
856
869
  */
857
- serializeShadowRoot?: boolean;
870
+ serializeShadowRoot?: 'declarative-shadow-dom' | 'scoped' | {
871
+ 'declarative-shadow-dom'?: string[];
872
+ scoped?: string[];
873
+ default: 'declarative-shadow-dom' | 'scoped';
874
+ } | boolean;
858
875
  /**
859
876
  * The `fullDocument` flag determines the format of the rendered output. Set it to true to
860
877
  * generate a complete HTML document, or false to render only the component.
@@ -1834,18 +1851,16 @@ export interface TestingConfig extends JestConfig {
1834
1851
  */
1835
1852
  browserWSEndpoint?: string;
1836
1853
  /**
1837
- * Whether to run browser e2e tests in headless mode.
1838
- *
1839
- * Starting with Chrome v112, a new headless mode was introduced.
1840
- * The new headless mode unifies the "headful" and "headless" code paths in the Chrome distributable.
1841
- *
1842
- * To enable the "new" headless mode, a string value of "new" must be provided.
1843
- * To use the "old" headless mode, a boolean value of `true` must be provided.
1844
- * To use "headful" mode, a boolean value of `false` must be provided.
1845
- *
1846
- * Defaults to true.
1854
+ * The browser channel to use for e2e tests (stable, beta, dev or canary).
1855
+ * @default 'chrome'
1856
+ */
1857
+ browserChannel?: 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary';
1858
+ /**
1859
+ * Whether to run browser e2e tests in headless mode using Chrome Headless Shell
1860
+ * @ref https://developer.chrome.com/blog/chrome-headless-shell
1861
+ * @default shell
1847
1862
  */
1848
- browserHeadless?: boolean | 'new';
1863
+ browserHeadless?: boolean | 'shell';
1849
1864
  /**
1850
1865
  * Slows down e2e browser operations by the specified amount of milliseconds.
1851
1866
  * Useful so that you can see what is going on.