lwc 2.43.0 → 2.44.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/dist/engine-dom/esm/es2017/engine-dom.js +51 -208
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +51 -208
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +8 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +50 -209
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +7 -8
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +51 -208
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +8 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +50 -209
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +7 -8
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +121 -174
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +102 -174
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +89 -74
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +89 -74
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +85 -70
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +88 -71
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +84 -67
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +89 -74
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +85 -70
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +88 -71
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +84 -67
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var parse5 = require('parse5');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var parse5__namespace = /*#__PURE__*/_interopNamespaceDefault(parse5);
|
|
23
|
+
|
|
3
24
|
/* proxy-compat-disable */
|
|
25
|
+
|
|
4
26
|
/**
|
|
5
27
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
6
28
|
*/
|
|
@@ -45,7 +67,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
45
67
|
*/
|
|
46
68
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
47
69
|
const { isArray: isArray$1 } = Array;
|
|
48
|
-
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
70
|
+
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
49
71
|
const { fromCharCode: StringFromCharCode } = String;
|
|
50
72
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
51
73
|
function isUndefined$1(obj) {
|
|
@@ -444,9 +466,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
444
466
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
445
467
|
*/
|
|
446
468
|
// Increment whenever the LWC template compiler changes
|
|
447
|
-
const LWC_VERSION = "2.
|
|
469
|
+
const LWC_VERSION = "2.44.0";
|
|
448
470
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
449
|
-
/** version: 2.
|
|
471
|
+
/** version: 2.44.0 */
|
|
450
472
|
|
|
451
473
|
/**
|
|
452
474
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -524,7 +546,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
524
546
|
setFeatureFlag(name, value);
|
|
525
547
|
}
|
|
526
548
|
}
|
|
527
|
-
/** version: 2.
|
|
549
|
+
/** version: 2.44.0 */
|
|
528
550
|
|
|
529
551
|
/*
|
|
530
552
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -620,7 +642,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
620
642
|
}
|
|
621
643
|
}
|
|
622
644
|
}
|
|
623
|
-
/** version: 2.
|
|
645
|
+
/** version: 2.44.0 */
|
|
624
646
|
|
|
625
647
|
/* proxy-compat-disable */
|
|
626
648
|
/**
|
|
@@ -856,101 +878,6 @@ const defaultDefHTMLPropertyNames = [
|
|
|
856
878
|
'tabIndex',
|
|
857
879
|
'title',
|
|
858
880
|
];
|
|
859
|
-
function offsetPropertyErrorMessage(name) {
|
|
860
|
-
return `Using the \`${name}\` property is an anti-pattern because it rounds the value to an integer. Instead, use the \`getBoundingClientRect\` method to obtain fractional values for the size of an element and its position relative to the viewport.`;
|
|
861
|
-
}
|
|
862
|
-
// Global HTML Attributes & Properties
|
|
863
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
864
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
865
|
-
//
|
|
866
|
-
// If you update this list, check for test files that recapitulate the same list. Searching the codebase
|
|
867
|
-
// for e.g. "dropzone" should suffice.
|
|
868
|
-
const globalHTMLProperties = {
|
|
869
|
-
accessKey: {
|
|
870
|
-
attribute: 'accesskey',
|
|
871
|
-
},
|
|
872
|
-
accessKeyLabel: {
|
|
873
|
-
readOnly: true,
|
|
874
|
-
},
|
|
875
|
-
className: {
|
|
876
|
-
attribute: 'class',
|
|
877
|
-
error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.',
|
|
878
|
-
},
|
|
879
|
-
contentEditable: {
|
|
880
|
-
attribute: 'contenteditable',
|
|
881
|
-
},
|
|
882
|
-
dataset: {
|
|
883
|
-
readOnly: true,
|
|
884
|
-
error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead.",
|
|
885
|
-
},
|
|
886
|
-
dir: {
|
|
887
|
-
attribute: 'dir',
|
|
888
|
-
},
|
|
889
|
-
draggable: {
|
|
890
|
-
attribute: 'draggable',
|
|
891
|
-
},
|
|
892
|
-
dropzone: {
|
|
893
|
-
attribute: 'dropzone',
|
|
894
|
-
readOnly: true,
|
|
895
|
-
},
|
|
896
|
-
hidden: {
|
|
897
|
-
attribute: 'hidden',
|
|
898
|
-
},
|
|
899
|
-
id: {
|
|
900
|
-
attribute: 'id',
|
|
901
|
-
},
|
|
902
|
-
inputMode: {
|
|
903
|
-
attribute: 'inputmode',
|
|
904
|
-
},
|
|
905
|
-
lang: {
|
|
906
|
-
attribute: 'lang',
|
|
907
|
-
},
|
|
908
|
-
slot: {
|
|
909
|
-
attribute: 'slot',
|
|
910
|
-
error: 'Using the `slot` property is an anti-pattern.',
|
|
911
|
-
},
|
|
912
|
-
spellcheck: {
|
|
913
|
-
attribute: 'spellcheck',
|
|
914
|
-
},
|
|
915
|
-
style: {
|
|
916
|
-
attribute: 'style',
|
|
917
|
-
},
|
|
918
|
-
tabIndex: {
|
|
919
|
-
attribute: 'tabindex',
|
|
920
|
-
},
|
|
921
|
-
title: {
|
|
922
|
-
attribute: 'title',
|
|
923
|
-
},
|
|
924
|
-
translate: {
|
|
925
|
-
attribute: 'translate',
|
|
926
|
-
},
|
|
927
|
-
// additional "global attributes" that are not present in the link above.
|
|
928
|
-
isContentEditable: {
|
|
929
|
-
readOnly: true,
|
|
930
|
-
},
|
|
931
|
-
offsetHeight: {
|
|
932
|
-
readOnly: true,
|
|
933
|
-
error: offsetPropertyErrorMessage('offsetHeight'),
|
|
934
|
-
},
|
|
935
|
-
offsetLeft: {
|
|
936
|
-
readOnly: true,
|
|
937
|
-
error: offsetPropertyErrorMessage('offsetLeft'),
|
|
938
|
-
},
|
|
939
|
-
offsetParent: {
|
|
940
|
-
readOnly: true,
|
|
941
|
-
},
|
|
942
|
-
offsetTop: {
|
|
943
|
-
readOnly: true,
|
|
944
|
-
error: offsetPropertyErrorMessage('offsetTop'),
|
|
945
|
-
},
|
|
946
|
-
offsetWidth: {
|
|
947
|
-
readOnly: true,
|
|
948
|
-
error: offsetPropertyErrorMessage('offsetWidth'),
|
|
949
|
-
},
|
|
950
|
-
role: {
|
|
951
|
-
attribute: 'role',
|
|
952
|
-
},
|
|
953
|
-
};
|
|
954
881
|
let controlledElement = null;
|
|
955
882
|
let controlledAttributeName;
|
|
956
883
|
function isAttributeLocked(elm, attrName) {
|
|
@@ -1135,8 +1062,7 @@ function getShadowRootRestrictionsDescriptors(sr) {
|
|
|
1135
1062
|
}),
|
|
1136
1063
|
addEventListener: generateDataDescriptor({
|
|
1137
1064
|
value(type, listener, options) {
|
|
1138
|
-
// TODO [#
|
|
1139
|
-
// programmatically into its Component's shadow root
|
|
1065
|
+
// TODO [#1824]: Potentially relax this restriction
|
|
1140
1066
|
if (!isUndefined$1(options)) {
|
|
1141
1067
|
logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
|
|
1142
1068
|
}
|
|
@@ -1182,8 +1108,7 @@ function getCustomElementRestrictionsDescriptors(elm) {
|
|
|
1182
1108
|
}),
|
|
1183
1109
|
addEventListener: generateDataDescriptor({
|
|
1184
1110
|
value(type, listener, options) {
|
|
1185
|
-
// TODO [#
|
|
1186
|
-
// programmatically into a lighting element node
|
|
1111
|
+
// TODO [#1824]: Potentially relax this restriction
|
|
1187
1112
|
if (!isUndefined$1(options)) {
|
|
1188
1113
|
logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
|
|
1189
1114
|
}
|
|
@@ -1211,7 +1136,7 @@ function getComponentRestrictionsDescriptors() {
|
|
|
1211
1136
|
function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
1212
1137
|
assertNotProd(); // this method should never leak to prod
|
|
1213
1138
|
const originalDispatchEvent = proto.dispatchEvent;
|
|
1214
|
-
|
|
1139
|
+
return {
|
|
1215
1140
|
dispatchEvent: generateDataDescriptor({
|
|
1216
1141
|
value(event) {
|
|
1217
1142
|
const vm = getAssociatedVM(this);
|
|
@@ -1229,32 +1154,6 @@ function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
|
1229
1154
|
},
|
|
1230
1155
|
}),
|
|
1231
1156
|
};
|
|
1232
|
-
forEach.call(getOwnPropertyNames$1(globalHTMLProperties), (propName) => {
|
|
1233
|
-
if (propName in proto) {
|
|
1234
|
-
return; // no need to redefine something that we are already exposing
|
|
1235
|
-
}
|
|
1236
|
-
descriptors[propName] = generateAccessorDescriptor({
|
|
1237
|
-
get() {
|
|
1238
|
-
const { error, attribute } = globalHTMLProperties[propName];
|
|
1239
|
-
const msg = [];
|
|
1240
|
-
msg.push(`Accessing the global HTML property "${propName}" is disabled.`);
|
|
1241
|
-
if (error) {
|
|
1242
|
-
msg.push(error);
|
|
1243
|
-
}
|
|
1244
|
-
else if (attribute) {
|
|
1245
|
-
msg.push(`Instead access it via \`this.getAttribute("${attribute}")\`.`);
|
|
1246
|
-
}
|
|
1247
|
-
logError(msg.join('\n'), getAssociatedVM(this));
|
|
1248
|
-
},
|
|
1249
|
-
set() {
|
|
1250
|
-
const { readOnly } = globalHTMLProperties[propName];
|
|
1251
|
-
if (readOnly) {
|
|
1252
|
-
logError(`The global HTML property \`${propName}\` is read-only.`, getAssociatedVM(this));
|
|
1253
|
-
}
|
|
1254
|
-
},
|
|
1255
|
-
});
|
|
1256
|
-
});
|
|
1257
|
-
return descriptors;
|
|
1258
1157
|
}
|
|
1259
1158
|
// This routine will prevent access to certain properties on a shadow root instance to guarantee
|
|
1260
1159
|
// that all components will work fine in IE11 and other browsers without shadow dom support.
|
|
@@ -2579,12 +2478,7 @@ function createPublicPropertyDescriptor(key) {
|
|
|
2579
2478
|
}
|
|
2580
2479
|
function createPublicAccessorDescriptor(key, descriptor) {
|
|
2581
2480
|
const { get, set, enumerable, configurable } = descriptor;
|
|
2582
|
-
|
|
2583
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2584
|
-
assert.invariant(isFunction$1(get), `Invalid compiler output for public accessor ${toString$1(key)} decorated with @api`);
|
|
2585
|
-
}
|
|
2586
|
-
throw new Error();
|
|
2587
|
-
}
|
|
2481
|
+
assert.invariant(isFunction$1(get), `Invalid public accessor ${toString$1(key)} decorated with @api. The property is missing a getter.`);
|
|
2588
2482
|
return {
|
|
2589
2483
|
get() {
|
|
2590
2484
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2704,64 +2598,64 @@ function getClassDescriptorType(descriptor) {
|
|
|
2704
2598
|
}
|
|
2705
2599
|
}
|
|
2706
2600
|
function validateObservedField(Ctor, fieldName, descriptor) {
|
|
2601
|
+
assertNotProd(); // this method should never leak to prod
|
|
2707
2602
|
if (!isUndefined$1(descriptor)) {
|
|
2708
2603
|
const type = getClassDescriptorType(descriptor);
|
|
2709
2604
|
const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2710
|
-
// [
|
|
2711
|
-
|
|
2712
|
-
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2713
|
-
logError(message);
|
|
2714
|
-
}
|
|
2715
|
-
else {
|
|
2716
|
-
assert.fail(message);
|
|
2717
|
-
}
|
|
2605
|
+
// TODO [#3408]: this should throw, not log
|
|
2606
|
+
logError(message);
|
|
2718
2607
|
}
|
|
2719
2608
|
}
|
|
2720
2609
|
function validateFieldDecoratedWithTrack(Ctor, fieldName, descriptor) {
|
|
2610
|
+
assertNotProd(); // this method should never leak to prod
|
|
2721
2611
|
if (!isUndefined$1(descriptor)) {
|
|
2722
2612
|
const type = getClassDescriptorType(descriptor);
|
|
2723
|
-
|
|
2613
|
+
// TODO [#3408]: this should throw, not log
|
|
2614
|
+
logError(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
|
|
2724
2615
|
}
|
|
2725
2616
|
}
|
|
2726
2617
|
function validateFieldDecoratedWithWire(Ctor, fieldName, descriptor) {
|
|
2618
|
+
assertNotProd(); // this method should never leak to prod
|
|
2727
2619
|
if (!isUndefined$1(descriptor)) {
|
|
2728
2620
|
const type = getClassDescriptorType(descriptor);
|
|
2729
|
-
|
|
2621
|
+
// TODO [#3408]: this should throw, not log
|
|
2622
|
+
logError(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
|
|
2730
2623
|
}
|
|
2731
2624
|
}
|
|
2732
2625
|
function validateMethodDecoratedWithWire(Ctor, methodName, descriptor) {
|
|
2626
|
+
assertNotProd(); // this method should never leak to prod
|
|
2733
2627
|
if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
|
|
2734
|
-
|
|
2628
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2629
|
+
logError(`Invalid @wire ${methodName} field. The field should have a valid writable descriptor.`);
|
|
2735
2630
|
}
|
|
2736
2631
|
}
|
|
2737
2632
|
function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
2633
|
+
assertNotProd(); // this method should never leak to prod
|
|
2738
2634
|
if (!isUndefined$1(descriptor)) {
|
|
2739
2635
|
const type = getClassDescriptorType(descriptor);
|
|
2740
2636
|
const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2741
|
-
// [
|
|
2742
|
-
|
|
2743
|
-
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2744
|
-
logError(message);
|
|
2745
|
-
}
|
|
2746
|
-
else {
|
|
2747
|
-
assert.fail(message);
|
|
2748
|
-
}
|
|
2637
|
+
// TODO [#3408]: this should throw, not log
|
|
2638
|
+
logError(message);
|
|
2749
2639
|
}
|
|
2750
2640
|
}
|
|
2751
2641
|
function validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2642
|
+
assertNotProd(); // this method should never leak to prod
|
|
2643
|
+
if (isFunction$1(descriptor.set)) {
|
|
2644
|
+
if (!isFunction$1(descriptor.get)) {
|
|
2645
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2646
|
+
logError(`Missing getter for property ${fieldName} decorated with @api in ${Ctor}. You cannot have a setter without the corresponding getter.`);
|
|
2647
|
+
}
|
|
2757
2648
|
}
|
|
2758
2649
|
else if (!isFunction$1(descriptor.get)) {
|
|
2759
|
-
|
|
2650
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2651
|
+
logError(`Missing @api get ${fieldName} accessor.`);
|
|
2760
2652
|
}
|
|
2761
2653
|
}
|
|
2762
2654
|
function validateMethodDecoratedWithApi(Ctor, methodName, descriptor) {
|
|
2655
|
+
assertNotProd(); // this method should never leak to prod
|
|
2763
2656
|
if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
|
|
2764
|
-
|
|
2657
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2658
|
+
logError(`Invalid @api ${methodName} method.`);
|
|
2765
2659
|
}
|
|
2766
2660
|
}
|
|
2767
2661
|
/**
|
|
@@ -2784,13 +2678,14 @@ function registerDecorators(Ctor, meta) {
|
|
|
2784
2678
|
apiFieldsConfig[fieldName] = propConfig.config;
|
|
2785
2679
|
descriptor = getOwnPropertyDescriptor$1(proto, fieldName);
|
|
2786
2680
|
if (propConfig.config > 0) {
|
|
2681
|
+
if (isUndefined$1(descriptor)) {
|
|
2682
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2683
|
+
throw new Error();
|
|
2684
|
+
}
|
|
2787
2685
|
// accessor declaration
|
|
2788
2686
|
if (process.env.NODE_ENV !== 'production') {
|
|
2789
2687
|
validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor);
|
|
2790
2688
|
}
|
|
2791
|
-
if (isUndefined$1(descriptor)) {
|
|
2792
|
-
throw new Error();
|
|
2793
|
-
}
|
|
2794
2689
|
descriptor = createPublicAccessorDescriptor(fieldName, descriptor);
|
|
2795
2690
|
}
|
|
2796
2691
|
else {
|
|
@@ -2830,7 +2725,10 @@ function registerDecorators(Ctor, meta) {
|
|
|
2830
2725
|
descriptor = getOwnPropertyDescriptor$1(proto, fieldOrMethodName);
|
|
2831
2726
|
if (method === 1) {
|
|
2832
2727
|
if (process.env.NODE_ENV !== 'production') {
|
|
2833
|
-
|
|
2728
|
+
if (!adapter) {
|
|
2729
|
+
// TODO [#3408]: this should throw, not log
|
|
2730
|
+
logError(`@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
|
|
2731
|
+
}
|
|
2834
2732
|
validateMethodDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
|
|
2835
2733
|
}
|
|
2836
2734
|
if (isUndefined$1(descriptor)) {
|
|
@@ -2841,7 +2739,10 @@ function registerDecorators(Ctor, meta) {
|
|
|
2841
2739
|
}
|
|
2842
2740
|
else {
|
|
2843
2741
|
if (process.env.NODE_ENV !== 'production') {
|
|
2844
|
-
|
|
2742
|
+
if (!adapter) {
|
|
2743
|
+
// TODO [#3408]: this should throw, not log
|
|
2744
|
+
logError(`@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
|
|
2745
|
+
}
|
|
2845
2746
|
validateFieldDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
|
|
2846
2747
|
}
|
|
2847
2748
|
descriptor = internalWireFieldDecorator(fieldOrMethodName);
|
|
@@ -6362,12 +6263,12 @@ function readonly(obj) {
|
|
|
6362
6263
|
if (process.env.NODE_ENV !== 'production') {
|
|
6363
6264
|
// TODO [#1292]: Remove the readonly decorator
|
|
6364
6265
|
if (arguments.length !== 1) {
|
|
6365
|
-
|
|
6266
|
+
logError('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
|
|
6366
6267
|
}
|
|
6367
6268
|
}
|
|
6368
6269
|
return getReadOnlyProxy(obj);
|
|
6369
6270
|
}
|
|
6370
|
-
/* version: 2.
|
|
6271
|
+
/* version: 2.44.0 */
|
|
6371
6272
|
|
|
6372
6273
|
/*
|
|
6373
6274
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6777,6 +6678,38 @@ const renderer = {
|
|
|
6777
6678
|
registerContextConsumer,
|
|
6778
6679
|
};
|
|
6779
6680
|
|
|
6681
|
+
/*
|
|
6682
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
6683
|
+
* All rights reserved.
|
|
6684
|
+
* SPDX-License-Identifier: MIT
|
|
6685
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6686
|
+
*/
|
|
6687
|
+
function isSingleStyleNodeContainingSingleTextNode(node) {
|
|
6688
|
+
if (node.childNodes.length !== 1) {
|
|
6689
|
+
return false;
|
|
6690
|
+
}
|
|
6691
|
+
const style = node.childNodes[0];
|
|
6692
|
+
if (style.nodeName !== 'style' || style.childNodes.length !== 1) {
|
|
6693
|
+
return false;
|
|
6694
|
+
}
|
|
6695
|
+
const textNode = style.childNodes[0];
|
|
6696
|
+
return textNode.nodeName === '#text';
|
|
6697
|
+
}
|
|
6698
|
+
// The text content inside `<style>` is a special case. It is _only_ rendered by the LWC engine itself; <style> tags
|
|
6699
|
+
// are disallowed inside of templates. Also, we want to avoid over-escaping, since CSS containing strings like
|
|
6700
|
+
// `&` and `"` is not valid CSS (even when inside a `<style>` element).
|
|
6701
|
+
//
|
|
6702
|
+
// However, to avoid XSS attacks, we still need to check for things like `</style><script>alert("pwned")</script>`,
|
|
6703
|
+
// since a user could use that inside of a *.css file to break out of a <style> element.
|
|
6704
|
+
// See: https://github.com/salesforce/lwc/issues/3439
|
|
6705
|
+
function validateStyleTextContents(contents) {
|
|
6706
|
+
// If parse5 parses this as more than one `<style>` tag, then it is unsafe to be rendered as-is
|
|
6707
|
+
const fragment = parse5__namespace.parseFragment(`<style>${contents}</style>`);
|
|
6708
|
+
if (!isSingleStyleNodeContainingSingleTextNode(fragment)) {
|
|
6709
|
+
throw new Error('CSS contains unsafe characters and cannot be serialized inside a style element');
|
|
6710
|
+
}
|
|
6711
|
+
}
|
|
6712
|
+
|
|
6780
6713
|
/*
|
|
6781
6714
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
6782
6715
|
* All rights reserved.
|
|
@@ -6788,12 +6721,12 @@ function serializeAttributes(attributes) {
|
|
|
6788
6721
|
.map((attr) => attr.value.length ? `${attr.name}="${htmlEscape(attr.value, true)}"` : attr.name)
|
|
6789
6722
|
.join(' ');
|
|
6790
6723
|
}
|
|
6791
|
-
function serializeChildNodes(children) {
|
|
6724
|
+
function serializeChildNodes(children, tagName) {
|
|
6792
6725
|
return children
|
|
6793
6726
|
.map((child) => {
|
|
6794
6727
|
switch (child[HostTypeKey]) {
|
|
6795
6728
|
case HostNodeType.Text:
|
|
6796
|
-
return child[HostValueKey]
|
|
6729
|
+
return serializeTextContent(child[HostValueKey], tagName);
|
|
6797
6730
|
case HostNodeType.Comment:
|
|
6798
6731
|
return `<!--${htmlEscape(child[HostValueKey])}-->`;
|
|
6799
6732
|
case HostNodeType.Raw:
|
|
@@ -6830,12 +6763,26 @@ function serializeElement(element) {
|
|
|
6830
6763
|
if (element[HostShadowRootKey]) {
|
|
6831
6764
|
output += serializeShadowRoot(element[HostShadowRootKey]);
|
|
6832
6765
|
}
|
|
6833
|
-
output += serializeChildNodes(element[HostChildrenKey]);
|
|
6766
|
+
output += serializeChildNodes(element[HostChildrenKey], tagName);
|
|
6834
6767
|
if (!isVoidElement(tagName, namespace) || hasChildren) {
|
|
6835
6768
|
output += `</${tagName}>`;
|
|
6836
6769
|
}
|
|
6837
6770
|
return output;
|
|
6838
6771
|
}
|
|
6772
|
+
function serializeTextContent(contents, tagName) {
|
|
6773
|
+
if (contents === '') {
|
|
6774
|
+
return '\u200D'; // Special serialization for empty text nodes
|
|
6775
|
+
}
|
|
6776
|
+
if (tagName === 'style') {
|
|
6777
|
+
// Special validation for <style> tags since their content must be served unescaped, and we need to validate
|
|
6778
|
+
// that the contents are safe to serialize unescaped.
|
|
6779
|
+
// TODO [#3454]: move this validation to compilation
|
|
6780
|
+
validateStyleTextContents(contents);
|
|
6781
|
+
// If we haven't thrown an error during validation, then the content is safe to serialize unescaped
|
|
6782
|
+
return contents;
|
|
6783
|
+
}
|
|
6784
|
+
return htmlEscape(contents);
|
|
6785
|
+
}
|
|
6839
6786
|
|
|
6840
6787
|
/*
|
|
6841
6788
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6902,7 +6849,7 @@ seal(LightningElement.prototype);
|
|
|
6902
6849
|
function createElement() {
|
|
6903
6850
|
throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
|
|
6904
6851
|
}
|
|
6905
|
-
/* version: 2.
|
|
6852
|
+
/* version: 2.44.0 */
|
|
6906
6853
|
|
|
6907
6854
|
exports.LightningElement = LightningElement;
|
|
6908
6855
|
exports.api = api$1;
|