@lwc/ssr-runtime 8.12.6-alpha.0 → 8.12.7-alpha.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/class-list.d.ts +1 -2
- package/dist/get-read-only-proxy.d.ts +0 -1
- package/dist/index.cjs.js +248 -252
- package/dist/index.d.ts +3 -2
- package/dist/index.js +246 -251
- package/dist/lightning-element.d.ts +2 -4
- package/dist/mutation-tracker.d.ts +0 -1
- package/dist/reflection.d.ts +7 -1
- package/dist/render-text-content.d.ts +2 -10
- package/dist/render.d.ts +5 -6
- package/dist/stubs.d.ts +0 -1
- package/dist/styles.d.ts +0 -1
- package/dist/to-iterator-directive.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/validate-style-text-contents.d.ts +0 -1
- package/dist/wire.d.ts +0 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -627,7 +627,7 @@ function setHooks(hooks) {
|
|
627
627
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
628
628
|
*/
|
629
629
|
const DEFAULT_SSR_MODE = 'sync';
|
630
|
-
/** version: 8.12.
|
630
|
+
/** version: 8.12.2 */
|
631
631
|
|
632
632
|
/*
|
633
633
|
* Copyright (c) 2024, Salesforce, Inc.
|
@@ -705,205 +705,6 @@ class ClassList {
|
|
705
705
|
}
|
706
706
|
}
|
707
707
|
|
708
|
-
/******************************************************************************
|
709
|
-
Copyright (c) Microsoft Corporation.
|
710
|
-
|
711
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
712
|
-
purpose with or without fee is hereby granted.
|
713
|
-
|
714
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
715
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
716
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
717
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
718
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
719
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
720
|
-
PERFORMANCE OF THIS SOFTWARE.
|
721
|
-
***************************************************************************** */
|
722
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
723
|
-
|
724
|
-
|
725
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
726
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
727
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
728
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
729
|
-
}
|
730
|
-
|
731
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
732
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
733
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
734
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
735
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
736
|
-
}
|
737
|
-
|
738
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
739
|
-
var e = new Error(message);
|
740
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
741
|
-
};
|
742
|
-
|
743
|
-
/*
|
744
|
-
* Copyright (c) 2024, Salesforce, Inc.
|
745
|
-
* All rights reserved.
|
746
|
-
* SPDX-License-Identifier: MIT
|
747
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
748
|
-
*/
|
749
|
-
var _MutationTracker_enabledSet, _MutationTracker_mutationMap;
|
750
|
-
class MutationTracker {
|
751
|
-
constructor() {
|
752
|
-
_MutationTracker_enabledSet.set(this, new WeakSet());
|
753
|
-
_MutationTracker_mutationMap.set(this, new WeakMap());
|
754
|
-
}
|
755
|
-
add(instance, attrName) {
|
756
|
-
if (__classPrivateFieldGet(this, _MutationTracker_enabledSet, "f").has(instance)) {
|
757
|
-
let mutatedAttrs = __classPrivateFieldGet(this, _MutationTracker_mutationMap, "f").get(instance);
|
758
|
-
if (!mutatedAttrs) {
|
759
|
-
mutatedAttrs = new Set();
|
760
|
-
__classPrivateFieldGet(this, _MutationTracker_mutationMap, "f").set(instance, mutatedAttrs);
|
761
|
-
}
|
762
|
-
mutatedAttrs.add(attrName.toLowerCase());
|
763
|
-
}
|
764
|
-
}
|
765
|
-
enable(instance) {
|
766
|
-
__classPrivateFieldGet(this, _MutationTracker_enabledSet, "f").add(instance);
|
767
|
-
}
|
768
|
-
disable(instance) {
|
769
|
-
__classPrivateFieldGet(this, _MutationTracker_enabledSet, "f").delete(instance);
|
770
|
-
}
|
771
|
-
renderMutatedAttrs(instance) {
|
772
|
-
const mutatedAttrs = __classPrivateFieldGet(this, _MutationTracker_mutationMap, "f").get(instance);
|
773
|
-
if (mutatedAttrs) {
|
774
|
-
return ` data-lwc-host-mutated="${[...mutatedAttrs].sort().join(' ')}"`;
|
775
|
-
}
|
776
|
-
else {
|
777
|
-
return '';
|
778
|
-
}
|
779
|
-
}
|
780
|
-
}
|
781
|
-
_MutationTracker_enabledSet = new WeakMap(), _MutationTracker_mutationMap = new WeakMap();
|
782
|
-
const mutationTracker = new MutationTracker();
|
783
|
-
|
784
|
-
/*
|
785
|
-
* Copyright (c) 2024, Salesforce, Inc.
|
786
|
-
* All rights reserved.
|
787
|
-
* SPDX-License-Identifier: MIT
|
788
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
789
|
-
*/
|
790
|
-
/**
|
791
|
-
* Descriptor for IDL attribute reflections that merely reflect the string, e.g. `title`.
|
792
|
-
*/
|
793
|
-
const stringDescriptor = (attrName) => ({
|
794
|
-
configurable: true,
|
795
|
-
enumerable: true,
|
796
|
-
get() {
|
797
|
-
return this.getAttribute(attrName);
|
798
|
-
},
|
799
|
-
set(newValue) {
|
800
|
-
const currentValue = this.getAttribute(attrName);
|
801
|
-
const normalizedValue = String(newValue);
|
802
|
-
if (normalizedValue !== currentValue) {
|
803
|
-
this.setAttribute(attrName, normalizedValue);
|
804
|
-
}
|
805
|
-
},
|
806
|
-
});
|
807
|
-
/** Descriptor for a boolean that checks for `attr="true"` or `attr="false"`, e.g. `spellcheck` and `draggable`. */
|
808
|
-
const explicitBooleanDescriptor = (attrName, defaultValue) => ({
|
809
|
-
configurable: true,
|
810
|
-
enumerable: true,
|
811
|
-
get() {
|
812
|
-
const value = this.getAttribute(attrName);
|
813
|
-
if (value === null)
|
814
|
-
return defaultValue;
|
815
|
-
// spellcheck=false => false, everything else => true
|
816
|
-
// draggable=true => true, everything else => false
|
817
|
-
return value.toLowerCase() === String(defaultValue) ? defaultValue : !defaultValue;
|
818
|
-
},
|
819
|
-
set(newValue) {
|
820
|
-
const currentValue = this.getAttribute(attrName);
|
821
|
-
const normalizedValue = String(Boolean(newValue));
|
822
|
-
if (normalizedValue !== currentValue) {
|
823
|
-
this.setAttribute(attrName, normalizedValue);
|
824
|
-
}
|
825
|
-
},
|
826
|
-
});
|
827
|
-
/**
|
828
|
-
* Descriptor for a "true" boolean attribute that checks solely for presence, e.g. `hidden`.
|
829
|
-
*/
|
830
|
-
const booleanAttributeDescriptor = (attrName) => ({
|
831
|
-
configurable: true,
|
832
|
-
enumerable: true,
|
833
|
-
get() {
|
834
|
-
return this.hasAttribute(attrName);
|
835
|
-
},
|
836
|
-
set(newValue) {
|
837
|
-
const hasAttribute = this.hasAttribute(attrName);
|
838
|
-
if (newValue) {
|
839
|
-
if (!hasAttribute) {
|
840
|
-
this.setAttribute(attrName, '');
|
841
|
-
}
|
842
|
-
}
|
843
|
-
else {
|
844
|
-
if (hasAttribute) {
|
845
|
-
this.removeAttribute(attrName);
|
846
|
-
}
|
847
|
-
}
|
848
|
-
},
|
849
|
-
});
|
850
|
-
/**
|
851
|
-
* Descriptor for ARIA reflections, e.g. `ariaLabel` and `role`.
|
852
|
-
*/
|
853
|
-
const ariaDescriptor = (attrName) => ({
|
854
|
-
configurable: true,
|
855
|
-
enumerable: true,
|
856
|
-
get() {
|
857
|
-
return this.getAttribute(attrName);
|
858
|
-
},
|
859
|
-
set(newValue) {
|
860
|
-
const currentValue = this.getAttribute(attrName);
|
861
|
-
if (newValue !== currentValue) {
|
862
|
-
// TODO [#3284]: According to the spec, IDL nullable type values
|
863
|
-
// (null and undefined) should remove the attribute; however, we
|
864
|
-
// only do so in the case of null for historical reasons.
|
865
|
-
if (isNull(newValue)) {
|
866
|
-
this.removeAttribute(attrName);
|
867
|
-
}
|
868
|
-
else {
|
869
|
-
this.setAttribute(attrName, toString(newValue));
|
870
|
-
}
|
871
|
-
}
|
872
|
-
},
|
873
|
-
});
|
874
|
-
const tabIndexDescriptor = () => ({
|
875
|
-
configurable: true,
|
876
|
-
enumerable: true,
|
877
|
-
get() {
|
878
|
-
const str = this.getAttribute('tabindex');
|
879
|
-
const num = Number(str);
|
880
|
-
return isFinite(num) ? Math.trunc(num) : -1;
|
881
|
-
},
|
882
|
-
set(newValue) {
|
883
|
-
const currentValue = this.getAttribute('tabindex');
|
884
|
-
const num = Number(newValue);
|
885
|
-
const normalizedValue = isFinite(num) ? String(Math.trunc(num)) : '0';
|
886
|
-
if (normalizedValue !== currentValue) {
|
887
|
-
this.setAttribute('tabindex', toString(newValue));
|
888
|
-
}
|
889
|
-
},
|
890
|
-
});
|
891
|
-
const descriptors = {
|
892
|
-
accessKey: stringDescriptor('accesskey'),
|
893
|
-
dir: stringDescriptor('dir'),
|
894
|
-
draggable: explicitBooleanDescriptor('draggable', true),
|
895
|
-
hidden: booleanAttributeDescriptor('hidden'),
|
896
|
-
id: stringDescriptor('id'),
|
897
|
-
lang: stringDescriptor('lang'),
|
898
|
-
spellcheck: explicitBooleanDescriptor('spellcheck', false),
|
899
|
-
tabIndex: tabIndexDescriptor(),
|
900
|
-
title: stringDescriptor('title'),
|
901
|
-
};
|
902
|
-
// Add descriptors for ARIA attributes
|
903
|
-
for (const [attrName, propName] of entries(AriaAttrNameToPropNameMap)) {
|
904
|
-
descriptors[propName] = ariaDescriptor(attrName);
|
905
|
-
}
|
906
|
-
|
907
708
|
/**
|
908
709
|
* Copyright (C) 2017 salesforce.com, inc.
|
909
710
|
*/
|
@@ -1331,49 +1132,256 @@ function getReadOnlyProxy(value) {
|
|
1331
1132
|
return reactiveMembrane.getReadOnlyProxy(value);
|
1332
1133
|
}
|
1333
1134
|
|
1135
|
+
/******************************************************************************
|
1136
|
+
Copyright (c) Microsoft Corporation.
|
1137
|
+
|
1138
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
1139
|
+
purpose with or without fee is hereby granted.
|
1140
|
+
|
1141
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
1142
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
1143
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
1144
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
1145
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
1146
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
1147
|
+
PERFORMANCE OF THIS SOFTWARE.
|
1148
|
+
***************************************************************************** */
|
1149
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
1150
|
+
|
1151
|
+
|
1152
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
1153
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
1154
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
1155
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
1156
|
+
}
|
1157
|
+
|
1158
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
1159
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
1160
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
1161
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
1162
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
1166
|
+
var e = new Error(message);
|
1167
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
1168
|
+
};
|
1169
|
+
|
1170
|
+
/*
|
1171
|
+
* Copyright (c) 2024, Salesforce, Inc.
|
1172
|
+
* All rights reserved.
|
1173
|
+
* SPDX-License-Identifier: MIT
|
1174
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
1175
|
+
*/
|
1176
|
+
var _MutationTracker_enabledSet, _MutationTracker_mutationMap;
|
1177
|
+
class MutationTracker {
|
1178
|
+
constructor() {
|
1179
|
+
_MutationTracker_enabledSet.set(this, new WeakSet());
|
1180
|
+
_MutationTracker_mutationMap.set(this, new WeakMap());
|
1181
|
+
}
|
1182
|
+
add(instance, attrName) {
|
1183
|
+
if (__classPrivateFieldGet(this, _MutationTracker_enabledSet, "f").has(instance)) {
|
1184
|
+
let mutatedAttrs = __classPrivateFieldGet(this, _MutationTracker_mutationMap, "f").get(instance);
|
1185
|
+
if (!mutatedAttrs) {
|
1186
|
+
mutatedAttrs = new Set();
|
1187
|
+
__classPrivateFieldGet(this, _MutationTracker_mutationMap, "f").set(instance, mutatedAttrs);
|
1188
|
+
}
|
1189
|
+
mutatedAttrs.add(attrName.toLowerCase());
|
1190
|
+
}
|
1191
|
+
}
|
1192
|
+
enable(instance) {
|
1193
|
+
__classPrivateFieldGet(this, _MutationTracker_enabledSet, "f").add(instance);
|
1194
|
+
}
|
1195
|
+
disable(instance) {
|
1196
|
+
__classPrivateFieldGet(this, _MutationTracker_enabledSet, "f").delete(instance);
|
1197
|
+
}
|
1198
|
+
renderMutatedAttrs(instance) {
|
1199
|
+
const mutatedAttrs = __classPrivateFieldGet(this, _MutationTracker_mutationMap, "f").get(instance);
|
1200
|
+
if (mutatedAttrs) {
|
1201
|
+
return ` data-lwc-host-mutated="${[...mutatedAttrs].sort().join(' ')}"`;
|
1202
|
+
}
|
1203
|
+
else {
|
1204
|
+
return '';
|
1205
|
+
}
|
1206
|
+
}
|
1207
|
+
}
|
1208
|
+
_MutationTracker_enabledSet = new WeakMap(), _MutationTracker_mutationMap = new WeakMap();
|
1209
|
+
const mutationTracker = new MutationTracker();
|
1210
|
+
|
1211
|
+
/*
|
1212
|
+
* Copyright (c) 2024, Salesforce, Inc.
|
1213
|
+
* All rights reserved.
|
1214
|
+
* SPDX-License-Identifier: MIT
|
1215
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
1216
|
+
*/
|
1217
|
+
/**
|
1218
|
+
* Filters out the following types of properties that should not be set.
|
1219
|
+
* - Properties that are not public.
|
1220
|
+
* - Properties that are not global.
|
1221
|
+
* - Properties that are global but are internally overridden.
|
1222
|
+
*/
|
1223
|
+
function filterProperties(props, publicFields, privateFields) {
|
1224
|
+
const propsToAssign = create(null);
|
1225
|
+
const publicFieldSet = new Set(publicFields);
|
1226
|
+
const privateFieldSet = new Set(privateFields);
|
1227
|
+
keys(props).forEach((propName) => {
|
1228
|
+
const attrName = htmlPropertyToAttribute(propName);
|
1229
|
+
if (publicFieldSet.has(propName) ||
|
1230
|
+
((REFLECTIVE_GLOBAL_PROPERTY_SET.has(propName) || isAriaAttribute(attrName)) &&
|
1231
|
+
!privateFieldSet.has(propName))) {
|
1232
|
+
propsToAssign[propName] = props[propName];
|
1233
|
+
}
|
1234
|
+
});
|
1235
|
+
return propsToAssign;
|
1236
|
+
}
|
1237
|
+
/**
|
1238
|
+
* Descriptor for IDL attribute reflections that merely reflect the string, e.g. `title`.
|
1239
|
+
*/
|
1240
|
+
const stringDescriptor = (attrName) => ({
|
1241
|
+
configurable: true,
|
1242
|
+
enumerable: true,
|
1243
|
+
get() {
|
1244
|
+
return this.getAttribute(attrName);
|
1245
|
+
},
|
1246
|
+
set(newValue) {
|
1247
|
+
const currentValue = this.getAttribute(attrName);
|
1248
|
+
const normalizedValue = String(newValue);
|
1249
|
+
if (normalizedValue !== currentValue) {
|
1250
|
+
this.setAttribute(attrName, normalizedValue);
|
1251
|
+
}
|
1252
|
+
},
|
1253
|
+
});
|
1254
|
+
/** Descriptor for a boolean that checks for `attr="true"` or `attr="false"`, e.g. `spellcheck` and `draggable`. */
|
1255
|
+
const explicitBooleanDescriptor = (attrName, defaultValue) => ({
|
1256
|
+
configurable: true,
|
1257
|
+
enumerable: true,
|
1258
|
+
get() {
|
1259
|
+
const value = this.getAttribute(attrName);
|
1260
|
+
if (value === null)
|
1261
|
+
return defaultValue;
|
1262
|
+
// spellcheck=false => false, everything else => true
|
1263
|
+
// draggable=true => true, everything else => false
|
1264
|
+
return value.toLowerCase() === String(defaultValue) ? defaultValue : !defaultValue;
|
1265
|
+
},
|
1266
|
+
set(newValue) {
|
1267
|
+
const currentValue = this.getAttribute(attrName);
|
1268
|
+
const normalizedValue = String(Boolean(newValue));
|
1269
|
+
if (normalizedValue !== currentValue) {
|
1270
|
+
this.setAttribute(attrName, normalizedValue);
|
1271
|
+
}
|
1272
|
+
},
|
1273
|
+
});
|
1274
|
+
/**
|
1275
|
+
* Descriptor for a "true" boolean attribute that checks solely for presence, e.g. `hidden`.
|
1276
|
+
*/
|
1277
|
+
const booleanAttributeDescriptor = (attrName) => ({
|
1278
|
+
configurable: true,
|
1279
|
+
enumerable: true,
|
1280
|
+
get() {
|
1281
|
+
return this.hasAttribute(attrName);
|
1282
|
+
},
|
1283
|
+
set(newValue) {
|
1284
|
+
const hasAttribute = this.hasAttribute(attrName);
|
1285
|
+
if (newValue) {
|
1286
|
+
if (!hasAttribute) {
|
1287
|
+
this.setAttribute(attrName, '');
|
1288
|
+
}
|
1289
|
+
}
|
1290
|
+
else {
|
1291
|
+
if (hasAttribute) {
|
1292
|
+
this.removeAttribute(attrName);
|
1293
|
+
}
|
1294
|
+
}
|
1295
|
+
},
|
1296
|
+
});
|
1297
|
+
/**
|
1298
|
+
* Descriptor for ARIA reflections, e.g. `ariaLabel` and `role`.
|
1299
|
+
*/
|
1300
|
+
const ariaDescriptor = (attrName) => ({
|
1301
|
+
configurable: true,
|
1302
|
+
enumerable: true,
|
1303
|
+
get() {
|
1304
|
+
return this.getAttribute(attrName);
|
1305
|
+
},
|
1306
|
+
set(newValue) {
|
1307
|
+
const currentValue = this.getAttribute(attrName);
|
1308
|
+
if (newValue !== currentValue) {
|
1309
|
+
// TODO [#3284]: According to the spec, IDL nullable type values
|
1310
|
+
// (null and undefined) should remove the attribute; however, we
|
1311
|
+
// only do so in the case of null for historical reasons.
|
1312
|
+
if (isNull(newValue)) {
|
1313
|
+
this.removeAttribute(attrName);
|
1314
|
+
}
|
1315
|
+
else {
|
1316
|
+
this.setAttribute(attrName, toString(newValue));
|
1317
|
+
}
|
1318
|
+
}
|
1319
|
+
},
|
1320
|
+
});
|
1321
|
+
const tabIndexDescriptor = () => ({
|
1322
|
+
configurable: true,
|
1323
|
+
enumerable: true,
|
1324
|
+
get() {
|
1325
|
+
const str = this.getAttribute('tabindex');
|
1326
|
+
const num = Number(str);
|
1327
|
+
return isFinite(num) ? Math.trunc(num) : -1;
|
1328
|
+
},
|
1329
|
+
set(newValue) {
|
1330
|
+
const currentValue = this.getAttribute('tabindex');
|
1331
|
+
const num = Number(newValue);
|
1332
|
+
const normalizedValue = isFinite(num) ? String(Math.trunc(num)) : '0';
|
1333
|
+
if (normalizedValue !== currentValue) {
|
1334
|
+
this.setAttribute('tabindex', toString(newValue));
|
1335
|
+
}
|
1336
|
+
},
|
1337
|
+
});
|
1338
|
+
const descriptors = {
|
1339
|
+
accessKey: stringDescriptor('accesskey'),
|
1340
|
+
dir: stringDescriptor('dir'),
|
1341
|
+
draggable: explicitBooleanDescriptor('draggable', true),
|
1342
|
+
hidden: booleanAttributeDescriptor('hidden'),
|
1343
|
+
id: stringDescriptor('id'),
|
1344
|
+
lang: stringDescriptor('lang'),
|
1345
|
+
spellcheck: explicitBooleanDescriptor('spellcheck', false),
|
1346
|
+
tabIndex: tabIndexDescriptor(),
|
1347
|
+
title: stringDescriptor('title'),
|
1348
|
+
};
|
1349
|
+
// Add descriptors for ARIA attributes
|
1350
|
+
for (const [attrName, propName] of entries(AriaAttrNameToPropNameMap)) {
|
1351
|
+
descriptors[propName] = ariaDescriptor(attrName);
|
1352
|
+
}
|
1353
|
+
|
1334
1354
|
/*
|
1335
1355
|
* Copyright (c) 2024, salesforce.com, inc.
|
1336
1356
|
* All rights reserved.
|
1337
1357
|
* SPDX-License-Identifier: MIT
|
1338
1358
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
1339
1359
|
*/
|
1340
|
-
var
|
1360
|
+
var _LightningElement_attrs, _LightningElement_classList;
|
1341
1361
|
const SYMBOL__SET_INTERNALS = Symbol('set-internals');
|
1342
1362
|
const SYMBOL__GENERATE_MARKUP = Symbol('generate-markup');
|
1343
1363
|
const SYMBOL__DEFAULT_TEMPLATE = Symbol('default-template');
|
1344
1364
|
class LightningElement {
|
1345
1365
|
constructor(propsAvailableAtConstruction) {
|
1346
1366
|
this.isConnected = false;
|
1347
|
-
|
1348
|
-
_LightningElement_attrs.set(this,
|
1367
|
+
this.className = '';
|
1368
|
+
_LightningElement_attrs.set(this, void 0);
|
1349
1369
|
_LightningElement_classList.set(this, null);
|
1350
1370
|
assign(this, propsAvailableAtConstruction);
|
1351
1371
|
}
|
1352
|
-
[(
|
1353
|
-
__classPrivateFieldSet(this, _LightningElement_props, props, "f");
|
1372
|
+
[(_LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(), SYMBOL__SET_INTERNALS)](props, attrs) {
|
1354
1373
|
__classPrivateFieldSet(this, _LightningElement_attrs, attrs, "f");
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
this[propName] = getReadOnlyProxy(props[propName]);
|
1367
|
-
}
|
1368
|
-
}
|
1369
|
-
}
|
1370
|
-
get className() {
|
1371
|
-
return __classPrivateFieldGet(this, _LightningElement_props, "f").class ?? '';
|
1372
|
-
}
|
1373
|
-
set className(newVal) {
|
1374
|
-
__classPrivateFieldGet(this, _LightningElement_props, "f").class = newVal;
|
1375
|
-
__classPrivateFieldGet(this, _LightningElement_attrs, "f").class = newVal;
|
1376
|
-
mutationTracker.add(this, 'class');
|
1374
|
+
assign(this, props);
|
1375
|
+
defineProperty(this, 'className', {
|
1376
|
+
get() {
|
1377
|
+
return props.class ?? '';
|
1378
|
+
},
|
1379
|
+
set(newVal) {
|
1380
|
+
props.class = newVal;
|
1381
|
+
attrs.class = newVal;
|
1382
|
+
mutationTracker.add(this, 'class');
|
1383
|
+
},
|
1384
|
+
});
|
1377
1385
|
}
|
1378
1386
|
get classList() {
|
1379
1387
|
if (__classPrivateFieldGet(this, _LightningElement_classList, "f")) {
|
@@ -1486,6 +1494,7 @@ defineProperties(LightningElement.prototype, descriptors);
|
|
1486
1494
|
* SPDX-License-Identifier: MIT
|
1487
1495
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
1488
1496
|
*/
|
1497
|
+
const escapeAttrVal = (attrValue) => attrValue.replaceAll('&', '&').replaceAll('"', '"');
|
1489
1498
|
function renderAttrsPrivate(instance, attrs, hostScopeToken, scopeToken) {
|
1490
1499
|
// The scopeToken is e.g. `lwc-xyz123` which is the token our parent gives us.
|
1491
1500
|
// The hostScopeToken is e.g. `lwc-abc456-host` which is the token for our own component.
|
@@ -1519,8 +1528,7 @@ function renderAttrsPrivate(instance, attrs, hostScopeToken, scopeToken) {
|
|
1519
1528
|
hasClassAttribute = true;
|
1520
1529
|
}
|
1521
1530
|
}
|
1522
|
-
result +=
|
1523
|
-
attrValue === '' ? ` ${attrName}` : ` ${attrName}="${htmlEscape(attrValue, true)}"`;
|
1531
|
+
result += attrValue === '' ? ` ${attrName}` : ` ${attrName}="${escapeAttrVal(attrValue)}"`;
|
1524
1532
|
}
|
1525
1533
|
// If we didn't render any `class` attribute, render one for the scope token(s)
|
1526
1534
|
if (!hasClassAttribute && combinedScopeToken) {
|
@@ -1539,12 +1547,12 @@ function* renderAttrs(instance, attrs, hostScopeToken, scopeToken) {
|
|
1539
1547
|
function renderAttrsNoYield(emit, instance, attrs, hostScopeToken, scopeToken) {
|
1540
1548
|
emit(renderAttrsPrivate(instance, attrs, hostScopeToken, scopeToken));
|
1541
1549
|
}
|
1542
|
-
function* fallbackTmpl(_shadowSlottedContent, _lightSlottedContent,
|
1550
|
+
function* fallbackTmpl(_props, _attrs, _shadowSlottedContent, _lightSlottedContent, Cmp, _instance) {
|
1543
1551
|
if (Cmp.renderMode !== 'light') {
|
1544
1552
|
yield '<template shadowrootmode="open"></template>';
|
1545
1553
|
}
|
1546
1554
|
}
|
1547
|
-
function fallbackTmplNoYield(emit, _shadowSlottedContent, _lightSlottedContent,
|
1555
|
+
function fallbackTmplNoYield(emit, _props, _attrs, _shadowSlottedContent, _lightSlottedContent, Cmp, _instance) {
|
1548
1556
|
if (Cmp.renderMode !== 'light') {
|
1549
1557
|
emit('<template shadowrootmode="open"></template>');
|
1550
1558
|
}
|
@@ -1559,15 +1567,15 @@ async function serverSideRenderComponent(tagName, Component, props = {}, mode =
|
|
1559
1567
|
markup += segment;
|
1560
1568
|
};
|
1561
1569
|
if (mode === 'asyncYield') {
|
1562
|
-
for await (const segment of generateMarkup(tagName, props, null, null, null, null, null, null
|
1570
|
+
for await (const segment of generateMarkup(tagName, props, null, null, null, null, null, null)) {
|
1563
1571
|
markup += segment;
|
1564
1572
|
}
|
1565
1573
|
}
|
1566
1574
|
else if (mode === 'async') {
|
1567
|
-
await generateMarkup(emit, tagName, props, null, null, null, null, null, null
|
1575
|
+
await generateMarkup(emit, tagName, props, null, null, null, null, null, null);
|
1568
1576
|
}
|
1569
1577
|
else if (mode === 'sync') {
|
1570
|
-
generateMarkup(emit, tagName, props, null, null, null, null, null, null
|
1578
|
+
generateMarkup(emit, tagName, props, null, null, null, null, null, null);
|
1571
1579
|
}
|
1572
1580
|
else {
|
1573
1581
|
throw new Error(`Invalid mode: ${mode}`);
|
@@ -1582,27 +1590,14 @@ async function serverSideRenderComponent(tagName, Component, props = {}, mode =
|
|
1582
1590
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
1583
1591
|
*/
|
1584
1592
|
/**
|
1585
|
-
* Given an object, render it for use as a text content node.
|
1586
|
-
* not the concatenated result of multiple adjacent text nodes.
|
1593
|
+
* Given an object, render it for use as a text content node.
|
1587
1594
|
* @param value
|
1588
1595
|
*/
|
1589
|
-
function
|
1596
|
+
function massageTextContent(value) {
|
1590
1597
|
// Using non strict equality to align with original implementation (ex. undefined == null)
|
1591
1598
|
// See: https://github.com/salesforce/lwc/blob/348130f/packages/%40lwc/engine-core/src/framework/api.ts#L548
|
1592
1599
|
return value == null ? '' : String(value);
|
1593
1600
|
}
|
1594
|
-
/**
|
1595
|
-
* Given a string, render it for use as text content in HTML. Notably this escapes HTML and renders as
|
1596
|
-
* a ZWJ is empty. Intended to be used on the result of concatenating multiple adjacent text nodes together.
|
1597
|
-
* @param value
|
1598
|
-
*/
|
1599
|
-
function renderTextContent(value) {
|
1600
|
-
// We are at the end of a series of text nodes - flush to a concatenated string
|
1601
|
-
// We only render the ZWJ if there were actually any dynamic text nodes rendered
|
1602
|
-
// The ZWJ is just so hydration can compare the SSR'd dynamic text content against
|
1603
|
-
// the CSR'd text content.
|
1604
|
-
return value === '' ? '\u200D' : htmlEscape(value);
|
1605
|
-
}
|
1606
1601
|
|
1607
1602
|
/*
|
1608
1603
|
* Copyright (c) 2024, Salesforce, Inc.
|
@@ -1790,6 +1785,6 @@ function createContextProvider(adapter) {
|
|
1790
1785
|
};
|
1791
1786
|
}
|
1792
1787
|
|
1793
|
-
export { ClassList, LightningElement, SYMBOL__DEFAULT_TEMPLATE, SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS, api, connectContext, createContextProvider, createElement, establishContextfulRelationship, fallbackTmpl, fallbackTmplNoYield, freezeTemplate, getComponentDef, hasScopedStaticStylesheets, hot, htmlEscape, isComponentConstructor, mutationTracker, normalizeClass,
|
1794
|
-
/** version: 8.12.
|
1788
|
+
export { ClassList, LightningElement, SYMBOL__DEFAULT_TEMPLATE, SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS, api, connectContext, createContextProvider, createElement, establishContextfulRelationship, fallbackTmpl, fallbackTmplNoYield, filterProperties, freezeTemplate, getComponentDef, getReadOnlyProxy, hasScopedStaticStylesheets, hot, htmlEscape, isComponentConstructor, massageTextContent, mutationTracker, normalizeClass, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, renderAttrs, renderAttrsNoYield, serverSideRenderComponent as renderComponent, renderStylesheets, renderer, sanitizeAttribute, sanitizeHtmlContent, serverSideRenderComponent, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, toIteratorDirective, track, unwrap$1 as unwrap, validateStyleTextContents, wire };
|
1789
|
+
/** version: 8.12.2 */
|
1795
1790
|
//# sourceMappingURL=index.js.map
|
@@ -27,11 +27,10 @@ export declare class LightningElement implements PropsAvailableAtConstruction {
|
|
27
27
|
tabIndex: number;
|
28
28
|
title: string;
|
29
29
|
isConnected: boolean;
|
30
|
+
className: string;
|
30
31
|
tagName: string;
|
31
32
|
constructor(propsAvailableAtConstruction: PropsAvailableAtConstruction & Properties);
|
32
|
-
[SYMBOL__SET_INTERNALS](props: Properties, attrs: Attributes
|
33
|
-
get className(): any;
|
34
|
-
set className(newVal: any);
|
33
|
+
[SYMBOL__SET_INTERNALS](props: Properties, attrs: Attributes): void;
|
35
34
|
get classList(): ClassList;
|
36
35
|
setAttribute(attrName: string, attrValue: string): void;
|
37
36
|
getAttribute(attrName: string): string | null;
|
@@ -114,4 +113,3 @@ export declare class LightningElement implements PropsAvailableAtConstruction {
|
|
114
113
|
role: string | null;
|
115
114
|
}
|
116
115
|
export {};
|
117
|
-
//# sourceMappingURL=lightning-element.d.ts.map
|
package/dist/reflection.d.ts
CHANGED
@@ -1,2 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* Filters out the following types of properties that should not be set.
|
3
|
+
* - Properties that are not public.
|
4
|
+
* - Properties that are not global.
|
5
|
+
* - Properties that are global but are internally overridden.
|
6
|
+
*/
|
7
|
+
export declare function filterProperties(props: Record<string, unknown>, publicFields: Array<string>, privateFields: Array<string>): Record<string, unknown>;
|
1
8
|
export declare const descriptors: Record<string, PropertyDescriptor>;
|
2
|
-
//# sourceMappingURL=reflection.d.ts.map
|
@@ -1,13 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Given an object, render it for use as a text content node.
|
3
|
-
* not the concatenated result of multiple adjacent text nodes.
|
2
|
+
* Given an object, render it for use as a text content node.
|
4
3
|
* @param value
|
5
4
|
*/
|
6
|
-
export declare function
|
7
|
-
/**
|
8
|
-
* Given a string, render it for use as text content in HTML. Notably this escapes HTML and renders as
|
9
|
-
* a ZWJ is empty. Intended to be used on the result of concatenating multiple adjacent text nodes together.
|
10
|
-
* @param value
|
11
|
-
*/
|
12
|
-
export declare function renderTextContent(value: string): string;
|
13
|
-
//# sourceMappingURL=render-text-content.d.ts.map
|
5
|
+
export declare function massageTextContent(value: unknown): string;
|
package/dist/render.d.ts
CHANGED
@@ -3,15 +3,14 @@ import type { LightningElement, LightningElementConstructor } from './lightning-
|
|
3
3
|
import type { Attributes, Properties } from './types';
|
4
4
|
export declare function renderAttrs(instance: LightningElement, attrs: Attributes, hostScopeToken: string | undefined, scopeToken: string | undefined): Generator<string, void, unknown>;
|
5
5
|
export declare function renderAttrsNoYield(emit: (segment: string) => void, instance: LightningElement, attrs: Attributes, hostScopeToken: string | undefined, scopeToken: string | undefined): void;
|
6
|
-
export declare function fallbackTmpl(
|
7
|
-
export declare function fallbackTmplNoYield(emit: (segment: string) => void,
|
8
|
-
export type GenerateMarkupFn = (tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null,
|
9
|
-
export type GenerateMarkupFnAsyncNoGen = (emit: (segment: string) => void, tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null,
|
10
|
-
export type GenerateMarkupFnSyncNoGen = (emit: (segment: string) => void, tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null,
|
6
|
+
export declare function fallbackTmpl(_props: unknown, _attrs: unknown, _shadowSlottedContent: unknown, _lightSlottedContent: unknown, Cmp: LightningElementConstructor, _instance: unknown): Generator<string, void, unknown>;
|
7
|
+
export declare function fallbackTmplNoYield(emit: (segment: string) => void, _props: unknown, _attrs: unknown, _shadowSlottedContent: unknown, _lightSlottedContent: unknown, Cmp: LightningElementConstructor, _instance: unknown): void;
|
8
|
+
export type GenerateMarkupFn = (tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null, parent: LightningElement | null, scopeToken: string | null, contextfulParent: LightningElement | null) => AsyncGenerator<string>;
|
9
|
+
export type GenerateMarkupFnAsyncNoGen = (emit: (segment: string) => void, tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null, parent: LightningElement | null, scopeToken: string | null, contextfulParent: LightningElement | null) => Promise<void>;
|
10
|
+
export type GenerateMarkupFnSyncNoGen = (emit: (segment: string) => void, tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null, parent: LightningElement | null, scopeToken: string | null, contextfulParent: LightningElement | null) => void;
|
11
11
|
type GenerateMarkupFnVariants = GenerateMarkupFn | GenerateMarkupFnAsyncNoGen | GenerateMarkupFnSyncNoGen;
|
12
12
|
interface ComponentWithGenerateMarkup {
|
13
13
|
[SYMBOL__GENERATE_MARKUP]: GenerateMarkupFnVariants;
|
14
14
|
}
|
15
15
|
export declare function serverSideRenderComponent(tagName: string, Component: ComponentWithGenerateMarkup, props?: Properties, mode?: 'asyncYield' | 'async' | 'sync'): Promise<string>;
|
16
16
|
export {};
|
17
|
-
//# sourceMappingURL=render.d.ts.map
|
package/dist/stubs.d.ts
CHANGED