@lwc/engine-core 2.21.0 → 2.21.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/dist/engine-core.cjs.js +37 -57
- package/dist/engine-core.js +37 -57
- package/package.json +3 -3
package/dist/engine-core.cjs.js
CHANGED
|
@@ -3419,10 +3419,11 @@ function mountElement(vnode, parent, anchor, renderer) {
|
|
|
3419
3419
|
const { sel, owner, data: { svg }, } = vnode;
|
|
3420
3420
|
const { createElement } = renderer;
|
|
3421
3421
|
const namespace = shared.isTrue(svg) ? shared.SVG_NAMESPACE : undefined;
|
|
3422
|
-
const elm = createElement(sel, namespace);
|
|
3422
|
+
const elm = (vnode.elm = createElement(sel, namespace));
|
|
3423
3423
|
linkNodeToShadow(elm, owner, renderer);
|
|
3424
|
-
|
|
3425
|
-
|
|
3424
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3425
|
+
applyDomManual(elm, vnode);
|
|
3426
|
+
applyElementRestrictions(elm, vnode);
|
|
3426
3427
|
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
3427
3428
|
insertNode(elm, parent, anchor, renderer);
|
|
3428
3429
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3437,6 +3438,7 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3437
3438
|
const { cloneNode, isSyntheticShadowDefined } = renderer;
|
|
3438
3439
|
const elm = (vnode.elm = cloneNode(vnode.fragment, true));
|
|
3439
3440
|
linkNodeToShadow(elm, owner, renderer);
|
|
3441
|
+
applyElementRestrictions(elm, vnode);
|
|
3440
3442
|
// Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
|
|
3441
3443
|
const { renderMode, shadowMode } = owner;
|
|
3442
3444
|
if (isSyntheticShadowDefined) {
|
|
@@ -3444,10 +3446,6 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3444
3446
|
elm[shared.KEY__SHADOW_STATIC] = true;
|
|
3445
3447
|
}
|
|
3446
3448
|
}
|
|
3447
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3448
|
-
const isLight = renderMode === 0 /* RenderMode.Light */;
|
|
3449
|
-
patchElementWithRestrictions(elm, { isPortal: false, isLight });
|
|
3450
|
-
}
|
|
3451
3449
|
insertNode(elm, parent, anchor, renderer);
|
|
3452
3450
|
}
|
|
3453
3451
|
function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
@@ -3464,9 +3462,10 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
3464
3462
|
// the custom element from the registry is expecting an upgrade callback
|
|
3465
3463
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
3466
3464
|
});
|
|
3467
|
-
linkNodeToShadow(elm, owner, renderer);
|
|
3468
3465
|
vnode.elm = elm;
|
|
3469
3466
|
vnode.vm = vm;
|
|
3467
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
3468
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3470
3469
|
if (vm) {
|
|
3471
3470
|
allocateChildren(vnode, vm);
|
|
3472
3471
|
}
|
|
@@ -3550,22 +3549,6 @@ function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, en
|
|
|
3550
3549
|
function isVNode(vnode) {
|
|
3551
3550
|
return vnode != null;
|
|
3552
3551
|
}
|
|
3553
|
-
function observeElementChildNodes(elm) {
|
|
3554
|
-
elm.$domManual$ = true;
|
|
3555
|
-
}
|
|
3556
|
-
function setElementShadowToken(elm, token) {
|
|
3557
|
-
elm.$shadowToken$ = token;
|
|
3558
|
-
}
|
|
3559
|
-
// Set the scope token class for *.scoped.css styles
|
|
3560
|
-
function setScopeTokenClassIfNecessary(elm, owner, renderer) {
|
|
3561
|
-
const token = getScopeTokenClass(owner);
|
|
3562
|
-
if (!shared.isNull(token)) {
|
|
3563
|
-
const { getClassList } = renderer;
|
|
3564
|
-
// TODO [#2762]: this dot notation with add is probably problematic
|
|
3565
|
-
// probably we should have a renderer api for just the add operation
|
|
3566
|
-
getClassList(elm).add(token);
|
|
3567
|
-
}
|
|
3568
|
-
}
|
|
3569
3552
|
function linkNodeToShadow(elm, owner, renderer) {
|
|
3570
3553
|
const { renderRoot, renderMode, shadowMode } = owner;
|
|
3571
3554
|
const { isSyntheticShadowDefined } = renderer;
|
|
@@ -3618,31 +3601,37 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
|
3618
3601
|
patchAttributes(oldVnode, vnode, renderer);
|
|
3619
3602
|
patchProps(oldVnode, vnode, renderer);
|
|
3620
3603
|
}
|
|
3621
|
-
function
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
if (
|
|
3625
|
-
const {
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
|
|
3630
|
-
// this element will now accept any manual content inserted into it
|
|
3631
|
-
observeElementChildNodes(elm);
|
|
3632
|
-
}
|
|
3633
|
-
if (!shared.isUndefined(stylesheetToken)) {
|
|
3634
|
-
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
3635
|
-
// into each element from the template, so they can be styled accordingly.
|
|
3636
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
3637
|
-
}
|
|
3604
|
+
function applyStyleScoping(elm, owner, renderer) {
|
|
3605
|
+
// Set the class name for `*.scoped.css` style scoping.
|
|
3606
|
+
const scopeToken = getScopeTokenClass(owner);
|
|
3607
|
+
if (!shared.isNull(scopeToken)) {
|
|
3608
|
+
const { getClassList } = renderer;
|
|
3609
|
+
// TODO [#2762]: this dot notation with add is probably problematic
|
|
3610
|
+
// probably we should have a renderer api for just the add operation
|
|
3611
|
+
getClassList(elm).add(scopeToken);
|
|
3638
3612
|
}
|
|
3613
|
+
// Set property element for synthetic shadow DOM style scoping.
|
|
3614
|
+
const { stylesheetToken: syntheticToken } = owner.context;
|
|
3615
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && !shared.isUndefined(syntheticToken)) {
|
|
3616
|
+
elm.$shadowToken$ = syntheticToken;
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
function applyDomManual(elm, vnode) {
|
|
3620
|
+
var _a;
|
|
3621
|
+
const { owner, data: { context }, } = vnode;
|
|
3622
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual" /* LwcDomMode.Manual */) {
|
|
3623
|
+
elm.$domManual$ = true;
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
function applyElementRestrictions(elm, vnode) {
|
|
3627
|
+
var _a, _b;
|
|
3639
3628
|
if (process.env.NODE_ENV !== 'production') {
|
|
3640
|
-
const
|
|
3641
|
-
const
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3629
|
+
const isPortal = vnode.type === 2 /* VNodeType.Element */ && ((_b = (_a = vnode.data.context) === null || _a === void 0 ? void 0 : _a.lwc) === null || _b === void 0 ? void 0 : _b.dom) === "manual" /* LwcDomMode.Manual */;
|
|
3630
|
+
const isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
|
|
3631
|
+
patchElementWithRestrictions(elm, {
|
|
3632
|
+
isPortal,
|
|
3633
|
+
isLight,
|
|
3634
|
+
});
|
|
3646
3635
|
}
|
|
3647
3636
|
}
|
|
3648
3637
|
function allocateChildren(vnode, vm) {
|
|
@@ -3677,15 +3666,6 @@ function createViewModelHook(elm, vnode, renderer) {
|
|
|
3677
3666
|
return vm;
|
|
3678
3667
|
}
|
|
3679
3668
|
const { sel, mode, ctor, owner } = vnode;
|
|
3680
|
-
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3681
|
-
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3682
|
-
const { stylesheetToken } = owner.context;
|
|
3683
|
-
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
3684
|
-
// into each element from the template, so they can be styled accordingly.
|
|
3685
|
-
if (!shared.isUndefined(stylesheetToken)) {
|
|
3686
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
3687
|
-
}
|
|
3688
|
-
}
|
|
3689
3669
|
vm = createVM(elm, ctor, renderer, {
|
|
3690
3670
|
mode,
|
|
3691
3671
|
owner,
|
|
@@ -6396,4 +6376,4 @@ exports.swapTemplate = swapTemplate;
|
|
|
6396
6376
|
exports.track = track;
|
|
6397
6377
|
exports.unwrap = unwrap;
|
|
6398
6378
|
exports.wire = wire;
|
|
6399
|
-
/* version: 2.21.
|
|
6379
|
+
/* version: 2.21.1 */
|
package/dist/engine-core.js
CHANGED
|
@@ -3416,10 +3416,11 @@ function mountElement(vnode, parent, anchor, renderer) {
|
|
|
3416
3416
|
const { sel, owner, data: { svg }, } = vnode;
|
|
3417
3417
|
const { createElement } = renderer;
|
|
3418
3418
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
3419
|
-
const elm = createElement(sel, namespace);
|
|
3419
|
+
const elm = (vnode.elm = createElement(sel, namespace));
|
|
3420
3420
|
linkNodeToShadow(elm, owner, renderer);
|
|
3421
|
-
|
|
3422
|
-
|
|
3421
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3422
|
+
applyDomManual(elm, vnode);
|
|
3423
|
+
applyElementRestrictions(elm, vnode);
|
|
3423
3424
|
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
3424
3425
|
insertNode(elm, parent, anchor, renderer);
|
|
3425
3426
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3434,6 +3435,7 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3434
3435
|
const { cloneNode, isSyntheticShadowDefined } = renderer;
|
|
3435
3436
|
const elm = (vnode.elm = cloneNode(vnode.fragment, true));
|
|
3436
3437
|
linkNodeToShadow(elm, owner, renderer);
|
|
3438
|
+
applyElementRestrictions(elm, vnode);
|
|
3437
3439
|
// Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
|
|
3438
3440
|
const { renderMode, shadowMode } = owner;
|
|
3439
3441
|
if (isSyntheticShadowDefined) {
|
|
@@ -3441,10 +3443,6 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3441
3443
|
elm[KEY__SHADOW_STATIC] = true;
|
|
3442
3444
|
}
|
|
3443
3445
|
}
|
|
3444
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3445
|
-
const isLight = renderMode === 0 /* RenderMode.Light */;
|
|
3446
|
-
patchElementWithRestrictions(elm, { isPortal: false, isLight });
|
|
3447
|
-
}
|
|
3448
3446
|
insertNode(elm, parent, anchor, renderer);
|
|
3449
3447
|
}
|
|
3450
3448
|
function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
@@ -3461,9 +3459,10 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
3461
3459
|
// the custom element from the registry is expecting an upgrade callback
|
|
3462
3460
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
3463
3461
|
});
|
|
3464
|
-
linkNodeToShadow(elm, owner, renderer);
|
|
3465
3462
|
vnode.elm = elm;
|
|
3466
3463
|
vnode.vm = vm;
|
|
3464
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
3465
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3467
3466
|
if (vm) {
|
|
3468
3467
|
allocateChildren(vnode, vm);
|
|
3469
3468
|
}
|
|
@@ -3547,22 +3546,6 @@ function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, en
|
|
|
3547
3546
|
function isVNode(vnode) {
|
|
3548
3547
|
return vnode != null;
|
|
3549
3548
|
}
|
|
3550
|
-
function observeElementChildNodes(elm) {
|
|
3551
|
-
elm.$domManual$ = true;
|
|
3552
|
-
}
|
|
3553
|
-
function setElementShadowToken(elm, token) {
|
|
3554
|
-
elm.$shadowToken$ = token;
|
|
3555
|
-
}
|
|
3556
|
-
// Set the scope token class for *.scoped.css styles
|
|
3557
|
-
function setScopeTokenClassIfNecessary(elm, owner, renderer) {
|
|
3558
|
-
const token = getScopeTokenClass(owner);
|
|
3559
|
-
if (!isNull(token)) {
|
|
3560
|
-
const { getClassList } = renderer;
|
|
3561
|
-
// TODO [#2762]: this dot notation with add is probably problematic
|
|
3562
|
-
// probably we should have a renderer api for just the add operation
|
|
3563
|
-
getClassList(elm).add(token);
|
|
3564
|
-
}
|
|
3565
|
-
}
|
|
3566
3549
|
function linkNodeToShadow(elm, owner, renderer) {
|
|
3567
3550
|
const { renderRoot, renderMode, shadowMode } = owner;
|
|
3568
3551
|
const { isSyntheticShadowDefined } = renderer;
|
|
@@ -3615,31 +3598,37 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
|
3615
3598
|
patchAttributes(oldVnode, vnode, renderer);
|
|
3616
3599
|
patchProps(oldVnode, vnode, renderer);
|
|
3617
3600
|
}
|
|
3618
|
-
function
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
if (
|
|
3622
|
-
const {
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
|
|
3627
|
-
// this element will now accept any manual content inserted into it
|
|
3628
|
-
observeElementChildNodes(elm);
|
|
3629
|
-
}
|
|
3630
|
-
if (!isUndefined$1(stylesheetToken)) {
|
|
3631
|
-
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
3632
|
-
// into each element from the template, so they can be styled accordingly.
|
|
3633
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
3634
|
-
}
|
|
3601
|
+
function applyStyleScoping(elm, owner, renderer) {
|
|
3602
|
+
// Set the class name for `*.scoped.css` style scoping.
|
|
3603
|
+
const scopeToken = getScopeTokenClass(owner);
|
|
3604
|
+
if (!isNull(scopeToken)) {
|
|
3605
|
+
const { getClassList } = renderer;
|
|
3606
|
+
// TODO [#2762]: this dot notation with add is probably problematic
|
|
3607
|
+
// probably we should have a renderer api for just the add operation
|
|
3608
|
+
getClassList(elm).add(scopeToken);
|
|
3635
3609
|
}
|
|
3610
|
+
// Set property element for synthetic shadow DOM style scoping.
|
|
3611
|
+
const { stylesheetToken: syntheticToken } = owner.context;
|
|
3612
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && !isUndefined$1(syntheticToken)) {
|
|
3613
|
+
elm.$shadowToken$ = syntheticToken;
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
function applyDomManual(elm, vnode) {
|
|
3617
|
+
var _a;
|
|
3618
|
+
const { owner, data: { context }, } = vnode;
|
|
3619
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual" /* LwcDomMode.Manual */) {
|
|
3620
|
+
elm.$domManual$ = true;
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
function applyElementRestrictions(elm, vnode) {
|
|
3624
|
+
var _a, _b;
|
|
3636
3625
|
if (process.env.NODE_ENV !== 'production') {
|
|
3637
|
-
const
|
|
3638
|
-
const
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3626
|
+
const isPortal = vnode.type === 2 /* VNodeType.Element */ && ((_b = (_a = vnode.data.context) === null || _a === void 0 ? void 0 : _a.lwc) === null || _b === void 0 ? void 0 : _b.dom) === "manual" /* LwcDomMode.Manual */;
|
|
3627
|
+
const isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
|
|
3628
|
+
patchElementWithRestrictions(elm, {
|
|
3629
|
+
isPortal,
|
|
3630
|
+
isLight,
|
|
3631
|
+
});
|
|
3643
3632
|
}
|
|
3644
3633
|
}
|
|
3645
3634
|
function allocateChildren(vnode, vm) {
|
|
@@ -3674,15 +3663,6 @@ function createViewModelHook(elm, vnode, renderer) {
|
|
|
3674
3663
|
return vm;
|
|
3675
3664
|
}
|
|
3676
3665
|
const { sel, mode, ctor, owner } = vnode;
|
|
3677
|
-
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3678
|
-
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3679
|
-
const { stylesheetToken } = owner.context;
|
|
3680
|
-
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
3681
|
-
// into each element from the template, so they can be styled accordingly.
|
|
3682
|
-
if (!isUndefined$1(stylesheetToken)) {
|
|
3683
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
3684
|
-
}
|
|
3685
|
-
}
|
|
3686
3666
|
vm = createVM(elm, ctor, renderer, {
|
|
3687
3667
|
mode,
|
|
3688
3668
|
owner,
|
|
@@ -6356,4 +6336,4 @@ function getComponentConstructor(elm) {
|
|
|
6356
6336
|
}
|
|
6357
6337
|
|
|
6358
6338
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, connectRootElement, createContextProvider, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, getUpgradableConstructor, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
6359
|
-
/* version: 2.21.
|
|
6339
|
+
/* version: 2.21.1 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lwc/engine-core",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.1",
|
|
4
4
|
"description": "Core LWC engine APIs.",
|
|
5
5
|
"homepage": "https://lwc.dev/",
|
|
6
6
|
"repository": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"types/"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@lwc/features": "2.21.
|
|
29
|
-
"@lwc/shared": "2.21.
|
|
28
|
+
"@lwc/features": "2.21.1",
|
|
29
|
+
"@lwc/shared": "2.21.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"observable-membrane": "2.0.0"
|