@rindo/core 4.25.3 → 4.27.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.
- package/cli/index.cjs +4 -4
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +1545 -1475
- 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 +4 -4
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +4 -4
- package/internal/app-data/index.cjs +3 -14
- package/internal/app-data/index.js +0 -11
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +639 -228
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/shadow-css.js +30 -6
- package/internal/hydrate/index.js +674 -233
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +22 -5
- package/internal/hydrate/runner.js +34 -9
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +6 -13
- package/internal/rindo-public-compiler.d.ts +23 -6
- package/internal/testing/index.js +637 -242
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +233 -233
- package/mock-doc/index.d.ts +5 -1
- package/mock-doc/index.js +230 -230
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +4 -4
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +3 -3
- package/sys/node/index.js +9 -9
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +9 -16
- package/testing/jest/jest-27-and-under/matchers/html.d.ts +2 -1
- package/testing/jest/jest-28/matchers/html.d.ts +2 -1
- package/testing/jest/jest-29/matchers/html.d.ts +2 -1
- package/testing/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rindo/core/internal/hydrate",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.27.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
|
-
*
|
|
142
|
-
* If set to `
|
|
143
|
-
*
|
|
144
|
-
*
|
|
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?:
|
|
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.
|
|
2
|
+
Rindo Hydrate Runner v4.27.0 | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -1447,6 +1447,7 @@ var EntityDecoder = class {
|
|
|
1447
1447
|
case EntityDecoderState.NamedEntity: {
|
|
1448
1448
|
return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
1449
1449
|
}
|
|
1450
|
+
// Otherwise, emit a numeric entity if we have one.
|
|
1450
1451
|
case EntityDecoderState.NumericDecimal: {
|
|
1451
1452
|
return this.emitNumericEntity(0, 2);
|
|
1452
1453
|
}
|
|
@@ -8494,6 +8495,7 @@ function endTagInSelectInTable(p, token) {
|
|
|
8494
8495
|
}
|
|
8495
8496
|
function startTagInTemplate(p, token) {
|
|
8496
8497
|
switch (token.tagID) {
|
|
8498
|
+
// First, handle tags that can start without a mode change
|
|
8497
8499
|
case TAG_ID.BASE:
|
|
8498
8500
|
case TAG_ID.BASEFONT:
|
|
8499
8501
|
case TAG_ID.BGSOUND:
|
|
@@ -8507,6 +8509,7 @@ function startTagInTemplate(p, token) {
|
|
|
8507
8509
|
startTagInHead(p, token);
|
|
8508
8510
|
break;
|
|
8509
8511
|
}
|
|
8512
|
+
// Re-process the token in the appropriate mode
|
|
8510
8513
|
case TAG_ID.CAPTION:
|
|
8511
8514
|
case TAG_ID.COLGROUP:
|
|
8512
8515
|
case TAG_ID.TBODY:
|
|
@@ -8989,14 +8992,14 @@ var jquery_default = (
|
|
|
8989
8992
|
*
|
|
8990
8993
|
* Date: 2023-12-11T17:55Z
|
|
8991
8994
|
*/
|
|
8992
|
-
function(global2, factory) {
|
|
8995
|
+
(function(global2, factory) {
|
|
8993
8996
|
"use strict";
|
|
8994
8997
|
if (true) {
|
|
8995
8998
|
return factory(global2, true);
|
|
8996
8999
|
} else {
|
|
8997
9000
|
factory(global2);
|
|
8998
9001
|
}
|
|
8999
|
-
}({
|
|
9002
|
+
})({
|
|
9000
9003
|
document: {
|
|
9001
9004
|
createElement() {
|
|
9002
9005
|
return {};
|
|
@@ -10416,7 +10419,7 @@ function normalizeSerializationOptions(opts = {}) {
|
|
|
10416
10419
|
removeAttributeQuotes: typeof opts.removeAttributeQuotes !== "boolean" ? false : opts.removeAttributeQuotes,
|
|
10417
10420
|
removeBooleanAttributeQuotes: typeof opts.removeBooleanAttributeQuotes !== "boolean" ? false : opts.removeBooleanAttributeQuotes,
|
|
10418
10421
|
removeHtmlComments: typeof opts.removeHtmlComments !== "boolean" ? false : opts.removeHtmlComments,
|
|
10419
|
-
serializeShadowRoot: typeof opts.serializeShadowRoot
|
|
10422
|
+
serializeShadowRoot: typeof opts.serializeShadowRoot === "undefined" ? "declarative-shadow-dom" : opts.serializeShadowRoot,
|
|
10420
10423
|
fullDocument: typeof opts.fullDocument !== "boolean" ? true : opts.fullDocument
|
|
10421
10424
|
};
|
|
10422
10425
|
}
|
|
@@ -10545,7 +10548,7 @@ style="${cssText}">`;
|
|
|
10545
10548
|
}
|
|
10546
10549
|
if (EMPTY_ELEMENTS.has(tagName) === false) {
|
|
10547
10550
|
const shadowRoot = node.shadowRoot;
|
|
10548
|
-
if (shadowRoot != null && opts.serializeShadowRoot) {
|
|
10551
|
+
if (shadowRoot != null && opts.serializeShadowRoot !== false) {
|
|
10549
10552
|
output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
|
|
10550
10553
|
yield* streamToHtml(shadowRoot, opts, output);
|
|
10551
10554
|
output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
|
|
@@ -14190,9 +14193,6 @@ import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
|
|
|
14190
14193
|
// src/utils/es2022-rewire-class-members.ts
|
|
14191
14194
|
import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
|
|
14192
14195
|
|
|
14193
|
-
// src/client/client-host-ref.ts
|
|
14194
|
-
var hostRefs = BUILD3.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
|
|
14195
|
-
|
|
14196
14196
|
// src/client/client-load-module.ts
|
|
14197
14197
|
import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
|
|
14198
14198
|
|
|
@@ -14342,6 +14342,31 @@ import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
|
|
|
14342
14342
|
// src/runtime/initialize-component.ts
|
|
14343
14343
|
import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
|
|
14344
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");
|
|
14369
|
+
|
|
14345
14370
|
// src/runtime/mode.ts
|
|
14346
14371
|
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
14347
14372
|
|
|
@@ -15569,7 +15594,7 @@ function renderToString(html, options, asStream) {
|
|
|
15569
15594
|
const opts = normalizeHydrateOptions(options);
|
|
15570
15595
|
opts.serializeToHtml = true;
|
|
15571
15596
|
opts.fullDocument = typeof opts.fullDocument === "boolean" ? opts.fullDocument : true;
|
|
15572
|
-
opts.serializeShadowRoot = typeof opts.serializeShadowRoot === "
|
|
15597
|
+
opts.serializeShadowRoot = typeof opts.serializeShadowRoot === "undefined" ? "declarative-shadow-dom" : opts.serializeShadowRoot;
|
|
15573
15598
|
opts.constrainTimeouts = false;
|
|
15574
15599
|
return hydrateDocument(html, opts, asStream);
|
|
15575
15600
|
}
|
package/internal/package.json
CHANGED
|
@@ -100,16 +100,6 @@ export interface BuildFeatures {
|
|
|
100
100
|
propString: boolean;
|
|
101
101
|
modernPropertyDecls: boolean;
|
|
102
102
|
lifecycle: boolean;
|
|
103
|
-
cmpDidLoad: boolean;
|
|
104
|
-
cmpShouldUpdate: boolean;
|
|
105
|
-
cmpWillLoad: boolean;
|
|
106
|
-
cmpDidUpdate: boolean;
|
|
107
|
-
cmpWillUpdate: boolean;
|
|
108
|
-
cmpWillRender: boolean;
|
|
109
|
-
cmpDidRender: boolean;
|
|
110
|
-
cmpDidUnload: boolean;
|
|
111
|
-
connectedCallback: boolean;
|
|
112
|
-
disconnectedCallback: boolean;
|
|
113
103
|
asyncLoading: boolean;
|
|
114
104
|
observeAttribute: boolean;
|
|
115
105
|
reflect: boolean;
|
|
@@ -447,7 +437,6 @@ export interface ComponentCompilerFeatures {
|
|
|
447
437
|
hasComponentDidUpdateFn: boolean;
|
|
448
438
|
hasComponentWillRenderFn: boolean;
|
|
449
439
|
hasComponentDidRenderFn: boolean;
|
|
450
|
-
hasComponentDidUnloadFn: boolean;
|
|
451
440
|
hasConnectedCallbackFn: boolean;
|
|
452
441
|
hasDisconnectedCallbackFn: boolean;
|
|
453
442
|
hasElement: boolean;
|
|
@@ -941,6 +930,7 @@ export interface HostElement extends HTMLElement {
|
|
|
941
930
|
disconnectedCallback?: () => void;
|
|
942
931
|
host?: Element;
|
|
943
932
|
forceUpdate?: () => void;
|
|
933
|
+
__rindo__getHostRef?: () => HostRef;
|
|
944
934
|
/**
|
|
945
935
|
* Unique rindo id for this element
|
|
946
936
|
*/
|
|
@@ -1245,7 +1235,7 @@ export interface RenderNode extends HostElement {
|
|
|
1245
1235
|
['s-ol']?: RenderNode;
|
|
1246
1236
|
/**
|
|
1247
1237
|
* Node reference:
|
|
1248
|
-
* This is a reference
|
|
1238
|
+
* This is a reference from an original location node
|
|
1249
1239
|
* back to the node that's been moved around.
|
|
1250
1240
|
*/
|
|
1251
1241
|
['s-nr']?: PatchedSlotNode | RenderNode;
|
|
@@ -1496,7 +1486,9 @@ export type ComponentRuntimeReflectingAttr = [string, string | undefined];
|
|
|
1496
1486
|
* keys in a `WeakMap` which maps {@link HostElement} instances to their
|
|
1497
1487
|
* associated {@link HostRef} instance.
|
|
1498
1488
|
*/
|
|
1499
|
-
export type RuntimeRef = HostElement | {
|
|
1489
|
+
export type RuntimeRef = HostElement | {
|
|
1490
|
+
__rindo__getHostRef?: () => HostRef;
|
|
1491
|
+
};
|
|
1500
1492
|
/**
|
|
1501
1493
|
* Interface used to track an Element, it's virtual Node (`VNode`), and other data
|
|
1502
1494
|
*/
|
|
@@ -2267,6 +2259,7 @@ export interface TypesModule {
|
|
|
2267
2259
|
export type TypeInfo = {
|
|
2268
2260
|
name: string;
|
|
2269
2261
|
type: string;
|
|
2262
|
+
attributeName?: string;
|
|
2270
2263
|
optional: boolean;
|
|
2271
2264
|
required: boolean;
|
|
2272
2265
|
internal: boolean;
|
|
@@ -849,12 +849,29 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
|
|
|
849
849
|
*/
|
|
850
850
|
removeHtmlComments?: boolean;
|
|
851
851
|
/**
|
|
852
|
-
*
|
|
853
|
-
* If set to `
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
|
|
857
|
-
|
|
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'
|
|
869
|
+
*/
|
|
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.
|