lwc 2.5.3 → 2.5.7
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-dom/esm/es2017/engine-dom.js +151 -101
- package/dist/engine-dom/iife/es2017/engine-dom.js +151 -100
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +139 -80
- package/dist/engine-dom/iife/es5/engine-dom.js +181 -109
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +167 -87
- package/dist/engine-dom/umd/es2017/engine-dom.js +151 -100
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +139 -80
- package/dist/engine-dom/umd/es5/engine-dom.js +181 -109
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +167 -87
- package/dist/engine-server/commonjs/es2017/engine-server.js +151 -107
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +151 -108
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +46 -40
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +46 -40
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +45 -39
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +46 -40
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +45 -39
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +46 -40
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +45 -39
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +46 -40
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +45 -39
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +8 -8
|
@@ -299,7 +299,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
299
299
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
300
300
|
return attributeName;
|
|
301
301
|
}
|
|
302
|
-
/** version: 2.5.
|
|
302
|
+
/** version: 2.5.7 */
|
|
303
303
|
|
|
304
304
|
/*
|
|
305
305
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -479,7 +479,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
479
479
|
setFeatureFlag(name, value);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
/** version: 2.5.
|
|
482
|
+
/** version: 2.5.7 */
|
|
483
483
|
|
|
484
484
|
/* proxy-compat-disable */
|
|
485
485
|
|
|
@@ -2851,9 +2851,9 @@ function attachShadow(vm) {
|
|
|
2851
2851
|
}
|
|
2852
2852
|
}
|
|
2853
2853
|
|
|
2854
|
-
function warnIfInvokedDuringConstruction(vm,
|
|
2854
|
+
function warnIfInvokedDuringConstruction(vm, methodOrPropName) {
|
|
2855
2855
|
if (isBeingConstructed(vm)) {
|
|
2856
|
-
logError(`this.${
|
|
2856
|
+
logError(`this.${methodOrPropName} should not be called during the construction of the custom element for ${getComponentTag(vm)} because the element is not yet in the DOM or has no children yet.`);
|
|
2857
2857
|
}
|
|
2858
2858
|
} // @ts-ignore
|
|
2859
2859
|
|
|
@@ -3013,76 +3013,12 @@ LightningElement.prototype = {
|
|
|
3013
3013
|
} = vm;
|
|
3014
3014
|
|
|
3015
3015
|
if (process.env.NODE_ENV !== 'production') {
|
|
3016
|
-
warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect');
|
|
3016
|
+
warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
|
|
3017
3017
|
}
|
|
3018
3018
|
|
|
3019
3019
|
return getBoundingClientRect(elm);
|
|
3020
3020
|
},
|
|
3021
3021
|
|
|
3022
|
-
querySelector(selectors) {
|
|
3023
|
-
const vm = getAssociatedVM(this);
|
|
3024
|
-
const {
|
|
3025
|
-
elm,
|
|
3026
|
-
renderer: {
|
|
3027
|
-
querySelector
|
|
3028
|
-
}
|
|
3029
|
-
} = vm;
|
|
3030
|
-
|
|
3031
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3032
|
-
warnIfInvokedDuringConstruction(vm, 'querySelector');
|
|
3033
|
-
}
|
|
3034
|
-
|
|
3035
|
-
return querySelector(elm, selectors);
|
|
3036
|
-
},
|
|
3037
|
-
|
|
3038
|
-
querySelectorAll(selectors) {
|
|
3039
|
-
const vm = getAssociatedVM(this);
|
|
3040
|
-
const {
|
|
3041
|
-
elm,
|
|
3042
|
-
renderer: {
|
|
3043
|
-
querySelectorAll
|
|
3044
|
-
}
|
|
3045
|
-
} = vm;
|
|
3046
|
-
|
|
3047
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3048
|
-
warnIfInvokedDuringConstruction(vm, 'querySelectorAll');
|
|
3049
|
-
}
|
|
3050
|
-
|
|
3051
|
-
return querySelectorAll(elm, selectors);
|
|
3052
|
-
},
|
|
3053
|
-
|
|
3054
|
-
getElementsByTagName(tagNameOrWildCard) {
|
|
3055
|
-
const vm = getAssociatedVM(this);
|
|
3056
|
-
const {
|
|
3057
|
-
elm,
|
|
3058
|
-
renderer: {
|
|
3059
|
-
getElementsByTagName
|
|
3060
|
-
}
|
|
3061
|
-
} = vm;
|
|
3062
|
-
|
|
3063
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3064
|
-
warnIfInvokedDuringConstruction(vm, 'getElementsByTagName');
|
|
3065
|
-
}
|
|
3066
|
-
|
|
3067
|
-
return getElementsByTagName(elm, tagNameOrWildCard);
|
|
3068
|
-
},
|
|
3069
|
-
|
|
3070
|
-
getElementsByClassName(names) {
|
|
3071
|
-
const vm = getAssociatedVM(this);
|
|
3072
|
-
const {
|
|
3073
|
-
elm,
|
|
3074
|
-
renderer: {
|
|
3075
|
-
getElementsByClassName
|
|
3076
|
-
}
|
|
3077
|
-
} = vm;
|
|
3078
|
-
|
|
3079
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3080
|
-
warnIfInvokedDuringConstruction(vm, 'getElementsByClassName');
|
|
3081
|
-
}
|
|
3082
|
-
|
|
3083
|
-
return getElementsByClassName(elm, names);
|
|
3084
|
-
},
|
|
3085
|
-
|
|
3086
3022
|
get isConnected() {
|
|
3087
3023
|
const {
|
|
3088
3024
|
elm,
|
|
@@ -3142,6 +3078,55 @@ LightningElement.prototype = {
|
|
|
3142
3078
|
}
|
|
3143
3079
|
|
|
3144
3080
|
};
|
|
3081
|
+
const queryAndChildGetterDescriptors = create(null);
|
|
3082
|
+
const childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
3083
|
+
|
|
3084
|
+
for (const [elementProp, rendererMethod] of childGetters) {
|
|
3085
|
+
queryAndChildGetterDescriptors[elementProp] = {
|
|
3086
|
+
get() {
|
|
3087
|
+
const vm = getAssociatedVM(this);
|
|
3088
|
+
const {
|
|
3089
|
+
elm,
|
|
3090
|
+
renderer
|
|
3091
|
+
} = vm;
|
|
3092
|
+
|
|
3093
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3094
|
+
warnIfInvokedDuringConstruction(vm, elementProp);
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
return renderer[rendererMethod](elm);
|
|
3098
|
+
},
|
|
3099
|
+
|
|
3100
|
+
configurable: true,
|
|
3101
|
+
enumerable: true
|
|
3102
|
+
};
|
|
3103
|
+
}
|
|
3104
|
+
|
|
3105
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
3106
|
+
|
|
3107
|
+
for (const queryMethod of queryMethods) {
|
|
3108
|
+
queryAndChildGetterDescriptors[queryMethod] = {
|
|
3109
|
+
value(arg) {
|
|
3110
|
+
const vm = getAssociatedVM(this);
|
|
3111
|
+
const {
|
|
3112
|
+
elm,
|
|
3113
|
+
renderer
|
|
3114
|
+
} = vm;
|
|
3115
|
+
|
|
3116
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3117
|
+
warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
return renderer[queryMethod](elm, arg);
|
|
3121
|
+
},
|
|
3122
|
+
|
|
3123
|
+
configurable: true,
|
|
3124
|
+
enumerable: true,
|
|
3125
|
+
writable: true
|
|
3126
|
+
};
|
|
3127
|
+
}
|
|
3128
|
+
|
|
3129
|
+
defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
|
|
3145
3130
|
const lightningBasedDescriptors = create(null);
|
|
3146
3131
|
|
|
3147
3132
|
for (const propName in HTMLElementOriginalDescriptors) {
|
|
@@ -3732,15 +3717,14 @@ function registerTemplate(tpl) {
|
|
|
3732
3717
|
return tpl;
|
|
3733
3718
|
}
|
|
3734
3719
|
/**
|
|
3735
|
-
* EXPERIMENTAL: This function acts like a hook for Lightning Locker
|
|
3736
|
-
*
|
|
3737
|
-
* This API is subject to change or being removed.
|
|
3720
|
+
* EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
|
|
3721
|
+
* libraries to sanitize vulnerable attributes.
|
|
3738
3722
|
*/
|
|
3739
3723
|
|
|
3740
3724
|
|
|
3741
3725
|
function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
|
|
3742
|
-
// locker-service patches this function during runtime to sanitize vulnerable attributes.
|
|
3743
|
-
//
|
|
3726
|
+
// locker-service patches this function during runtime to sanitize vulnerable attributes. When
|
|
3727
|
+
// ran off-core this function becomes a noop and returns the user authored value.
|
|
3744
3728
|
return attrValue;
|
|
3745
3729
|
}
|
|
3746
3730
|
/*
|
|
@@ -4296,7 +4280,7 @@ function createComponentDef(Ctor) {
|
|
|
4296
4280
|
if (!isUndefined$1(ctorShadowSupportMode)) {
|
|
4297
4281
|
assert.invariant(ctorShadowSupportMode === "any"
|
|
4298
4282
|
/* Any */
|
|
4299
|
-
|| ctorShadowSupportMode === "
|
|
4283
|
+
|| ctorShadowSupportMode === "reset"
|
|
4300
4284
|
/* Default */
|
|
4301
4285
|
, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
4302
4286
|
}
|
|
@@ -4458,7 +4442,7 @@ const lightingElementDef = {
|
|
|
4458
4442
|
renderMode: 1
|
|
4459
4443
|
/* Shadow */
|
|
4460
4444
|
,
|
|
4461
|
-
shadowSupportMode: "
|
|
4445
|
+
shadowSupportMode: "reset"
|
|
4462
4446
|
/* Default */
|
|
4463
4447
|
,
|
|
4464
4448
|
wire: EmptyObject,
|
|
@@ -5236,7 +5220,7 @@ function i(iterable, factory) {
|
|
|
5236
5220
|
next = iterator.next();
|
|
5237
5221
|
last = next.done; // template factory logic based on the previous collected value
|
|
5238
5222
|
|
|
5239
|
-
const vnode = factory(value, j, j === 0, last);
|
|
5223
|
+
const vnode = factory(value, j, j === 0, last === true);
|
|
5240
5224
|
|
|
5241
5225
|
if (isArray$1(vnode)) {
|
|
5242
5226
|
ArrayPush$1.apply(list, vnode);
|
|
@@ -5503,24 +5487,48 @@ function sc(vnodes) {
|
|
|
5503
5487
|
markAsDynamicChildren(vnodes);
|
|
5504
5488
|
return vnodes;
|
|
5505
5489
|
}
|
|
5490
|
+
/**
|
|
5491
|
+
* EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
|
|
5492
|
+
* libraries to sanitize HTML content. This hook process the content passed via the template to
|
|
5493
|
+
* lwc:inner-html directive.
|
|
5494
|
+
* It is meant to be overridden with setSanitizeHtmlContentHook, it throws an error by default.
|
|
5495
|
+
*/
|
|
5506
5496
|
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5497
|
+
|
|
5498
|
+
let sanitizeHtmlContentHook = () => {
|
|
5499
|
+
// locker-service patches this function during runtime to sanitize HTML content.
|
|
5500
|
+
throw new Error('sanitizeHtmlContent hook must be implemented.');
|
|
5501
|
+
};
|
|
5502
|
+
/**
|
|
5503
|
+
* Sets the sanitizeHtmlContentHook.
|
|
5504
|
+
*/
|
|
5505
|
+
|
|
5506
|
+
|
|
5507
|
+
function setSanitizeHtmlContentHook(newHookImpl) {
|
|
5508
|
+
sanitizeHtmlContentHook = newHookImpl;
|
|
5509
|
+
} // [s]anitize [h]tml [c]ontent
|
|
5510
|
+
|
|
5511
|
+
|
|
5512
|
+
function shc(content) {
|
|
5513
|
+
return sanitizeHtmlContentHook(content);
|
|
5514
|
+
}
|
|
5515
|
+
|
|
5516
|
+
const api = freeze({
|
|
5517
|
+
s,
|
|
5518
|
+
h,
|
|
5519
|
+
c,
|
|
5520
|
+
i,
|
|
5521
|
+
f,
|
|
5522
|
+
t,
|
|
5523
|
+
d,
|
|
5524
|
+
b,
|
|
5525
|
+
k,
|
|
5526
|
+
co,
|
|
5527
|
+
dc,
|
|
5528
|
+
ti,
|
|
5529
|
+
gid,
|
|
5530
|
+
fid,
|
|
5531
|
+
shc
|
|
5524
5532
|
});
|
|
5525
5533
|
/*
|
|
5526
5534
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5534,12 +5542,12 @@ function makeHostToken(token) {
|
|
|
5534
5542
|
}
|
|
5535
5543
|
|
|
5536
5544
|
function createInlineStyleVNode(content) {
|
|
5537
|
-
return h('style', {
|
|
5545
|
+
return api.h('style', {
|
|
5538
5546
|
key: 'style',
|
|
5539
5547
|
attrs: {
|
|
5540
5548
|
type: 'text/css'
|
|
5541
5549
|
}
|
|
5542
|
-
}, [t(content)]);
|
|
5550
|
+
}, [api.t(content)]);
|
|
5543
5551
|
}
|
|
5544
5552
|
|
|
5545
5553
|
function updateStylesheetToken(vm, template) {
|
|
@@ -7373,7 +7381,22 @@ function readonly(obj) {
|
|
|
7373
7381
|
|
|
7374
7382
|
return reactiveMembrane.getReadOnlyProxy(obj);
|
|
7375
7383
|
}
|
|
7376
|
-
/*
|
|
7384
|
+
/*
|
|
7385
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
7386
|
+
* All rights reserved.
|
|
7387
|
+
* SPDX-License-Identifier: MIT
|
|
7388
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7389
|
+
*/
|
|
7390
|
+
|
|
7391
|
+
|
|
7392
|
+
let hooksAreSet = false;
|
|
7393
|
+
|
|
7394
|
+
function setHooks(hooks) {
|
|
7395
|
+
assert.isFalse(hooksAreSet, 'Hooks are already overridden, only one definition is allowed.');
|
|
7396
|
+
hooksAreSet = true;
|
|
7397
|
+
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7398
|
+
}
|
|
7399
|
+
/* version: 2.5.7 */
|
|
7377
7400
|
|
|
7378
7401
|
/*
|
|
7379
7402
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7394,8 +7417,11 @@ if (process.env.NODE_ENV === 'development') {
|
|
|
7394
7417
|
};
|
|
7395
7418
|
}
|
|
7396
7419
|
|
|
7397
|
-
const globalStylesheetsParentElement = document.head || document.body || document;
|
|
7398
|
-
|
|
7420
|
+
const globalStylesheetsParentElement = document.head || document.body || document; // This check for constructable stylesheets is similar to Fast's:
|
|
7421
|
+
// https://github.com/microsoft/fast/blob/d49d1ec/packages/web-components/fast-element/src/dom.ts#L51-L53
|
|
7422
|
+
// See also: https://github.com/whatwg/webidl/issues/1027#issuecomment-934510070
|
|
7423
|
+
|
|
7424
|
+
const supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
|
|
7399
7425
|
const styleElements = create(null);
|
|
7400
7426
|
const styleSheets = create(null);
|
|
7401
7427
|
const nodesToStyleSheets = new WeakMap();
|
|
@@ -7624,6 +7650,30 @@ const renderer = {
|
|
|
7624
7650
|
return element.getElementsByClassName(names);
|
|
7625
7651
|
},
|
|
7626
7652
|
|
|
7653
|
+
getChildren(element) {
|
|
7654
|
+
return element.children;
|
|
7655
|
+
},
|
|
7656
|
+
|
|
7657
|
+
getChildNodes(element) {
|
|
7658
|
+
return element.childNodes;
|
|
7659
|
+
},
|
|
7660
|
+
|
|
7661
|
+
getFirstChild(element) {
|
|
7662
|
+
return element.firstChild;
|
|
7663
|
+
},
|
|
7664
|
+
|
|
7665
|
+
getFirstElementChild(element) {
|
|
7666
|
+
return element.firstElementChild;
|
|
7667
|
+
},
|
|
7668
|
+
|
|
7669
|
+
getLastChild(element) {
|
|
7670
|
+
return element.lastChild;
|
|
7671
|
+
},
|
|
7672
|
+
|
|
7673
|
+
getLastElementChild(element) {
|
|
7674
|
+
return element.lastElementChild;
|
|
7675
|
+
},
|
|
7676
|
+
|
|
7627
7677
|
isConnected(node) {
|
|
7628
7678
|
return node.isConnected;
|
|
7629
7679
|
},
|
|
@@ -7931,6 +7981,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
7931
7981
|
});
|
|
7932
7982
|
freeze(LightningElement);
|
|
7933
7983
|
seal(LightningElement.prototype);
|
|
7934
|
-
/* version: 2.5.
|
|
7984
|
+
/* version: 2.5.7 */
|
|
7935
7985
|
|
|
7936
|
-
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, getComponentConstructor, getComponentDef, isComponentConstructor, isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
7986
|
+
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, getComponentConstructor, getComponentDef, isComponentConstructor, isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|