@lwc/ssr-runtime 8.3.0 → 8.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +323 -44
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +321 -45
- package/dist/index.js.map +1 -1
- package/dist/lightning-element.d.ts +6 -5
- package/dist/reflection.d.ts +3 -0
- package/dist/render.d.ts +10 -4
- package/dist/types.d.ts +2 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* Copyright (c) 2024 Salesforce, Inc.
|
3
3
|
*/
|
4
|
-
import { htmlPropertyToAttribute } from '@lwc/shared';
|
5
|
-
|
6
4
|
/*
|
7
5
|
* Copyright (c) 2024, Salesforce, Inc.
|
8
6
|
* All rights reserved.
|
@@ -114,6 +112,224 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
114
112
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
115
113
|
};
|
116
114
|
|
115
|
+
/**
|
116
|
+
* Copyright (c) 2024 Salesforce, Inc.
|
117
|
+
*/
|
118
|
+
/*
|
119
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
120
|
+
* All rights reserved.
|
121
|
+
* SPDX-License-Identifier: MIT
|
122
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
123
|
+
*/
|
124
|
+
/**
|
125
|
+
*
|
126
|
+
* @param value
|
127
|
+
* @param msg
|
128
|
+
*/
|
129
|
+
|
130
|
+
/*
|
131
|
+
* Copyright (c) 2024, Salesforce, Inc.
|
132
|
+
* All rights reserved.
|
133
|
+
* SPDX-License-Identifier: MIT
|
134
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
135
|
+
*/
|
136
|
+
const {
|
137
|
+
/** Detached {@linkcode Object.assign}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign MDN Reference}. */
|
138
|
+
assign,
|
139
|
+
/** Detached {@linkcode Object.create}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create MDN Reference}. */
|
140
|
+
create,
|
141
|
+
/** Detached {@linkcode Object.defineProperties}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties MDN Reference}. */
|
142
|
+
defineProperties,
|
143
|
+
/** Detached {@linkcode Object.defineProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty MDN Reference}. */
|
144
|
+
defineProperty,
|
145
|
+
/** Detached {@linkcode Object.entries}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries MDN Reference}. */
|
146
|
+
entries,
|
147
|
+
/** Detached {@linkcode Object.freeze}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze MDN Reference}. */
|
148
|
+
freeze,
|
149
|
+
/** Detached {@linkcode Object.getOwnPropertyDescriptor}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor MDN Reference}. */
|
150
|
+
getOwnPropertyDescriptor,
|
151
|
+
/** Detached {@linkcode Object.getOwnPropertyDescriptors}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors MDN Reference}. */
|
152
|
+
getOwnPropertyDescriptors,
|
153
|
+
/** Detached {@linkcode Object.getOwnPropertyNames}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames MDN Reference}. */
|
154
|
+
getOwnPropertyNames,
|
155
|
+
/** Detached {@linkcode Object.getOwnPropertySymbols}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols MDN Reference}. */
|
156
|
+
getOwnPropertySymbols,
|
157
|
+
/** Detached {@linkcode Object.getPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf MDN Reference}. */
|
158
|
+
getPrototypeOf,
|
159
|
+
/** Detached {@linkcode Object.hasOwnProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty MDN Reference}. */
|
160
|
+
hasOwnProperty,
|
161
|
+
/** Detached {@linkcode Object.isFrozen}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen MDN Reference}. */
|
162
|
+
isFrozen,
|
163
|
+
/** Detached {@linkcode Object.keys}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys MDN Reference}. */
|
164
|
+
keys,
|
165
|
+
/** Detached {@linkcode Object.seal}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal MDN Reference}. */
|
166
|
+
seal,
|
167
|
+
/** Detached {@linkcode Object.setPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf MDN Reference}. */
|
168
|
+
setPrototypeOf, } = Object;
|
169
|
+
const {
|
170
|
+
/** Detached {@linkcode Array.isArray}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray MDN Reference}. */
|
171
|
+
isArray,
|
172
|
+
/** Detached {@linkcode Array.from}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from MDN Reference}. */
|
173
|
+
from: ArrayFrom, } = Array;
|
174
|
+
// For some reason, JSDoc don't get picked up for multiple renamed destructured constants (even
|
175
|
+
// though it works fine for one, e.g. isArray), so comments for these are added to the export
|
176
|
+
// statement, rather than this declaration.
|
177
|
+
const { concat: ArrayConcat, copyWithin: ArrayCopyWithin, every: ArrayEvery, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, includes: ArrayIncludes, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, // Weird anomaly!
|
178
|
+
} = Array.prototype;
|
179
|
+
// No JSDocs here - see comment for Array.prototype
|
180
|
+
const { charAt: StringCharAt, charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, trim: StringTrim, } = String.prototype;
|
181
|
+
/**
|
182
|
+
* Determines whether the argument is `null`.
|
183
|
+
* @param obj Value to test
|
184
|
+
* @returns `true` if the value is `null`.
|
185
|
+
*/
|
186
|
+
function isNull(obj) {
|
187
|
+
return obj === null;
|
188
|
+
}
|
189
|
+
const OtS = {}.toString;
|
190
|
+
/**
|
191
|
+
* Converts the argument to a string, safely accounting for objects with "null" prototype.
|
192
|
+
* Note that `toString(null)` returns `"[object Null]"` rather than `"null"`.
|
193
|
+
* @param obj Value to convert to a string.
|
194
|
+
* @returns String representation of the value.
|
195
|
+
*/
|
196
|
+
function toString(obj) {
|
197
|
+
if (obj?.toString) {
|
198
|
+
// Arrays might hold objects with "null" prototype So using
|
199
|
+
// Array.prototype.toString directly will cause an error Iterate through
|
200
|
+
// all the items and handle individually.
|
201
|
+
if (isArray(obj)) {
|
202
|
+
// This behavior is slightly different from Array#toString:
|
203
|
+
// 1. Array#toString calls `this.join`, rather than Array#join
|
204
|
+
// Ex: arr = []; arr.join = () => 1; arr.toString() === 1; toString(arr) === ''
|
205
|
+
// 2. Array#toString delegates to Object#toString if `this.join` is not a function
|
206
|
+
// Ex: arr = []; arr.join = 'no'; arr.toString() === '[object Array]; toString(arr) = ''
|
207
|
+
// 3. Array#toString converts null/undefined to ''
|
208
|
+
// Ex: arr = [null, undefined]; arr.toString() === ','; toString(arr) === '[object Null],undefined'
|
209
|
+
// 4. Array#toString converts recursive references to arrays to ''
|
210
|
+
// Ex: arr = [1]; arr.push(arr, 2); arr.toString() === '1,,2'; toString(arr) throws
|
211
|
+
// Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString
|
212
|
+
return ArrayJoin.call(ArrayMap.call(obj, toString), ',');
|
213
|
+
}
|
214
|
+
return obj.toString();
|
215
|
+
}
|
216
|
+
else if (typeof obj === 'object') {
|
217
|
+
// This catches null and returns "[object Null]". Weird, but kept for backwards compatibility.
|
218
|
+
return OtS.call(obj);
|
219
|
+
}
|
220
|
+
else {
|
221
|
+
return String(obj);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
/*
|
226
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
227
|
+
* All rights reserved.
|
228
|
+
* SPDX-License-Identifier: MIT
|
229
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
230
|
+
*/
|
231
|
+
/**
|
232
|
+
* According to the following list, there are 48 aria attributes of which two (ariaDropEffect and
|
233
|
+
* ariaGrabbed) are deprecated:
|
234
|
+
* https://www.w3.org/TR/wai-aria-1.1/#x6-6-definitions-of-states-and-properties-all-aria-attributes
|
235
|
+
*
|
236
|
+
* The above list of 46 aria attributes is consistent with the following resources:
|
237
|
+
* https://github.com/w3c/aria/pull/708/files#diff-eacf331f0ffc35d4b482f1d15a887d3bR11060
|
238
|
+
* https://wicg.github.io/aom/spec/aria-reflection.html
|
239
|
+
*
|
240
|
+
* NOTE: If you update this list, please update test files that implicitly reference this list!
|
241
|
+
* Searching the codebase for `aria-flowto` and `ariaFlowTo` should be good enough to find all usages.
|
242
|
+
*/
|
243
|
+
const AriaPropertyNames = [
|
244
|
+
'ariaActiveDescendant',
|
245
|
+
'ariaAtomic',
|
246
|
+
'ariaAutoComplete',
|
247
|
+
'ariaBusy',
|
248
|
+
'ariaChecked',
|
249
|
+
'ariaColCount',
|
250
|
+
'ariaColIndex',
|
251
|
+
'ariaColIndexText',
|
252
|
+
'ariaColSpan',
|
253
|
+
'ariaControls',
|
254
|
+
'ariaCurrent',
|
255
|
+
'ariaDescribedBy',
|
256
|
+
'ariaDescription',
|
257
|
+
'ariaDetails',
|
258
|
+
'ariaDisabled',
|
259
|
+
'ariaErrorMessage',
|
260
|
+
'ariaExpanded',
|
261
|
+
'ariaFlowTo',
|
262
|
+
'ariaHasPopup',
|
263
|
+
'ariaHidden',
|
264
|
+
'ariaInvalid',
|
265
|
+
'ariaKeyShortcuts',
|
266
|
+
'ariaLabel',
|
267
|
+
'ariaLabelledBy',
|
268
|
+
'ariaLevel',
|
269
|
+
'ariaLive',
|
270
|
+
'ariaModal',
|
271
|
+
'ariaMultiLine',
|
272
|
+
'ariaMultiSelectable',
|
273
|
+
'ariaOrientation',
|
274
|
+
'ariaOwns',
|
275
|
+
'ariaPlaceholder',
|
276
|
+
'ariaPosInSet',
|
277
|
+
'ariaPressed',
|
278
|
+
'ariaReadOnly',
|
279
|
+
'ariaRelevant',
|
280
|
+
'ariaRequired',
|
281
|
+
'ariaRoleDescription',
|
282
|
+
'ariaRowCount',
|
283
|
+
'ariaRowIndex',
|
284
|
+
'ariaRowIndexText',
|
285
|
+
'ariaRowSpan',
|
286
|
+
'ariaSelected',
|
287
|
+
'ariaSetSize',
|
288
|
+
'ariaSort',
|
289
|
+
'ariaValueMax',
|
290
|
+
'ariaValueMin',
|
291
|
+
'ariaValueNow',
|
292
|
+
'ariaValueText',
|
293
|
+
'ariaBrailleLabel',
|
294
|
+
'ariaBrailleRoleDescription',
|
295
|
+
'role',
|
296
|
+
];
|
297
|
+
const { AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap } = /*@__PURE__*/ (() => {
|
298
|
+
const AriaAttrNameToPropNameMap = create(null);
|
299
|
+
const AriaPropNameToAttrNameMap = create(null);
|
300
|
+
// Synthetic creation of all AOM property descriptors for Custom Elements
|
301
|
+
forEach.call(AriaPropertyNames, (propName) => {
|
302
|
+
const attrName = StringToLowerCase.call(StringReplace.call(propName, /^aria/, () => 'aria-'));
|
303
|
+
AriaAttrNameToPropNameMap[attrName] = propName;
|
304
|
+
AriaPropNameToAttrNameMap[propName] = attrName;
|
305
|
+
});
|
306
|
+
return { AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap };
|
307
|
+
})();
|
308
|
+
|
309
|
+
/*
|
310
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
311
|
+
* All rights reserved.
|
312
|
+
* SPDX-License-Identifier: MIT
|
313
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
314
|
+
*/
|
315
|
+
const ESCAPED_CHARS = {
|
316
|
+
'"': '"',
|
317
|
+
"'": ''',
|
318
|
+
'<': '<',
|
319
|
+
'>': '>',
|
320
|
+
'&': '&',
|
321
|
+
};
|
322
|
+
/**
|
323
|
+
*
|
324
|
+
* @param str
|
325
|
+
* @param attrMode
|
326
|
+
*/
|
327
|
+
function htmlEscape(str, attrMode = false) {
|
328
|
+
const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
329
|
+
return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
|
330
|
+
}
|
331
|
+
/** version: 8.4.0 */
|
332
|
+
|
117
333
|
/*
|
118
334
|
* Copyright (c) 2024, Salesforce, Inc.
|
119
335
|
* All rights reserved.
|
@@ -155,41 +371,70 @@ class MutationTracker {
|
|
155
371
|
_MutationTracker_enabledSet = new WeakMap(), _MutationTracker_mutationMap = new WeakMap();
|
156
372
|
const mutationTracker = new MutationTracker();
|
157
373
|
|
374
|
+
/*
|
375
|
+
* Copyright (c) 2024, Salesforce, Inc.
|
376
|
+
* All rights reserved.
|
377
|
+
* SPDX-License-Identifier: MIT
|
378
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
379
|
+
*/
|
380
|
+
// Eventually include globals that also reflect
|
381
|
+
const attrsToProps = AriaAttrNameToPropNameMap;
|
382
|
+
function reflectAttrToProp(instance, attrName, attrValue) {
|
383
|
+
const reflectedPropName = attrsToProps[attrName];
|
384
|
+
// If it is a reflected property and it was not overridden by the instance
|
385
|
+
if (reflectedPropName && !hasOwnProperty.call(instance, reflectedPropName)) {
|
386
|
+
const currentValue = instance[reflectedPropName];
|
387
|
+
if (currentValue !== attrValue) {
|
388
|
+
instance[reflectedPropName] = attrValue;
|
389
|
+
}
|
390
|
+
}
|
391
|
+
}
|
392
|
+
const descriptors = create(null);
|
393
|
+
for (const [attrName, propName] of entries(attrsToProps)) {
|
394
|
+
descriptors[propName] = {
|
395
|
+
get() {
|
396
|
+
return this.getAttribute(attrName);
|
397
|
+
},
|
398
|
+
set(newValue) {
|
399
|
+
const currentValue = this.getAttribute(attrName);
|
400
|
+
if (newValue !== currentValue) {
|
401
|
+
// TODO [#3284]: According to the spec, IDL nullable type values
|
402
|
+
// (null and undefined) should remove the attribute; however, we
|
403
|
+
// only do so in the case of null for historical reasons.
|
404
|
+
// See also https://github.com/w3c/aria/issues/1858
|
405
|
+
if (isNull(newValue)) {
|
406
|
+
this.removeAttribute(attrName);
|
407
|
+
}
|
408
|
+
else {
|
409
|
+
this.setAttribute(attrName, toString(newValue));
|
410
|
+
}
|
411
|
+
}
|
412
|
+
},
|
413
|
+
configurable: true,
|
414
|
+
enumerable: true,
|
415
|
+
};
|
416
|
+
}
|
417
|
+
|
158
418
|
/*
|
159
419
|
* Copyright (c) 2024, salesforce.com, inc.
|
160
420
|
* All rights reserved.
|
161
421
|
* SPDX-License-Identifier: MIT
|
162
422
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
163
423
|
*/
|
164
|
-
var
|
424
|
+
var _LightningElement_attrs, _LightningElement_classList;
|
165
425
|
const SYMBOL__SET_INTERNALS = Symbol('set-internals');
|
166
426
|
class LightningElement {
|
167
427
|
constructor(propsAvailableAtConstruction) {
|
168
|
-
_LightningElement_instances.add(this);
|
169
428
|
this.isConnected = false;
|
170
429
|
this.className = '';
|
171
430
|
_LightningElement_attrs.set(this, void 0);
|
172
431
|
_LightningElement_classList.set(this, null);
|
173
|
-
|
432
|
+
assign(this, propsAvailableAtConstruction);
|
174
433
|
}
|
175
|
-
[(_LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(),
|
176
|
-
Object.assign(this, props);
|
434
|
+
[(_LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(), SYMBOL__SET_INTERNALS)](props, attrs) {
|
177
435
|
__classPrivateFieldSet(this, _LightningElement_attrs, attrs, "f");
|
178
|
-
|
179
|
-
|
180
|
-
for (const reflectedPropName of reflectedProps) {
|
181
|
-
Object.defineProperty(this, reflectedPropName, {
|
182
|
-
get() {
|
183
|
-
return props[reflectedPropName] ?? null;
|
184
|
-
},
|
185
|
-
set(newValue) {
|
186
|
-
props[reflectedPropName] = newValue;
|
187
|
-
mutationTracker.add(this, htmlPropertyToAttribute(reflectedPropName));
|
188
|
-
},
|
189
|
-
enumerable: true,
|
190
|
-
});
|
191
|
-
}
|
192
|
-
Object.defineProperty(this, 'className', {
|
436
|
+
assign(this, props);
|
437
|
+
defineProperty(this, 'className', {
|
193
438
|
get() {
|
194
439
|
return props.class ?? '';
|
195
440
|
},
|
@@ -207,29 +452,29 @@ class LightningElement {
|
|
207
452
|
return (__classPrivateFieldSet(this, _LightningElement_classList, new ClassList(this), "f"));
|
208
453
|
}
|
209
454
|
setAttribute(attrName, attrValue) {
|
210
|
-
|
455
|
+
const normalizedName = StringToLowerCase.call(toString(attrName));
|
456
|
+
const normalizedValue = String(attrValue);
|
457
|
+
__classPrivateFieldGet(this, _LightningElement_attrs, "f")[normalizedName] = normalizedValue;
|
458
|
+
reflectAttrToProp(this, normalizedName, normalizedValue);
|
459
|
+
mutationTracker.add(this, normalizedName);
|
211
460
|
}
|
212
461
|
getAttribute(attrName) {
|
213
|
-
|
214
|
-
|
462
|
+
const normalizedName = StringToLowerCase.call(toString(attrName));
|
463
|
+
if (hasOwnProperty.call(__classPrivateFieldGet(this, _LightningElement_attrs, "f"), normalizedName)) {
|
464
|
+
return __classPrivateFieldGet(this, _LightningElement_attrs, "f")[normalizedName];
|
215
465
|
}
|
216
466
|
return null;
|
217
467
|
}
|
218
468
|
hasAttribute(attrName) {
|
219
|
-
|
469
|
+
const normalizedName = StringToLowerCase.call(toString(attrName));
|
470
|
+
return hasOwnProperty.call(__classPrivateFieldGet(this, _LightningElement_attrs, "f"), normalizedName);
|
220
471
|
}
|
221
472
|
removeAttribute(attrName) {
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
}
|
228
|
-
else {
|
229
|
-
// This interprets the removal of a non-existing attribute as an
|
230
|
-
// attribute mutation. We may want to revisit this.
|
231
|
-
mutationTracker.add(this, attrName);
|
232
|
-
}
|
473
|
+
const normalizedName = StringToLowerCase.call(toString(attrName));
|
474
|
+
delete __classPrivateFieldGet(this, _LightningElement_attrs, "f")[normalizedName];
|
475
|
+
reflectAttrToProp(this, normalizedName, null);
|
476
|
+
// Track mutations for removal of non-existing attributes
|
477
|
+
mutationTracker.add(this, normalizedName);
|
233
478
|
}
|
234
479
|
addEventListener(_type, _listener, _options) {
|
235
480
|
// noop
|
@@ -305,10 +550,7 @@ class LightningElement {
|
|
305
550
|
throw new Error('Method "setAttributeNS" not implemented.');
|
306
551
|
}
|
307
552
|
}
|
308
|
-
|
309
|
-
__classPrivateFieldGet(this, _LightningElement_attrs, "f")[attrName] = attrValue;
|
310
|
-
mutationTracker.add(this, attrName);
|
311
|
-
};
|
553
|
+
defineProperties(LightningElement.prototype, descriptors);
|
312
554
|
|
313
555
|
/*
|
314
556
|
* Copyright (c) 2024, salesforce.com, inc.
|
@@ -332,15 +574,49 @@ function* renderAttrs(instance, attrs) {
|
|
332
574
|
}
|
333
575
|
yield mutationTracker.renderMutatedAttrs(instance);
|
334
576
|
}
|
577
|
+
function renderAttrsNoYield(emit, instance, attrs) {
|
578
|
+
if (!attrs) {
|
579
|
+
return;
|
580
|
+
}
|
581
|
+
for (const attrName of Object.getOwnPropertyNames(attrs)) {
|
582
|
+
const attrVal = attrs[attrName];
|
583
|
+
if (typeof attrVal === 'string') {
|
584
|
+
emit(attrVal === '' ? ` ${attrName}` : ` ${attrName}="${escapeAttrVal(attrVal)}"`);
|
585
|
+
}
|
586
|
+
else if (attrVal === null) {
|
587
|
+
emit('');
|
588
|
+
}
|
589
|
+
}
|
590
|
+
emit(mutationTracker.renderMutatedAttrs(instance));
|
591
|
+
}
|
335
592
|
function* fallbackTmpl(_props, _attrs, _slotted, Cmp, _instance) {
|
336
593
|
if (Cmp.renderMode !== 'light') {
|
337
594
|
yield '<template shadowrootmode="open"></template>';
|
338
595
|
}
|
339
596
|
}
|
340
|
-
|
597
|
+
function fallbackTmplNoYield(emit, _props, _attrs, _slotted, Cmp, _instance) {
|
598
|
+
if (Cmp.renderMode !== 'light') {
|
599
|
+
emit('<template shadowrootmode="open"></template>');
|
600
|
+
}
|
601
|
+
}
|
602
|
+
async function serverSideRenderComponent(tagName, compiledGenerateMarkup, props, mode = 'asyncYield') {
|
341
603
|
let markup = '';
|
342
|
-
|
604
|
+
const emit = (segment) => {
|
343
605
|
markup += segment;
|
606
|
+
};
|
607
|
+
if (mode === 'asyncYield') {
|
608
|
+
for await (const segment of compiledGenerateMarkup(tagName, props, null, null)) {
|
609
|
+
markup += segment;
|
610
|
+
}
|
611
|
+
}
|
612
|
+
else if (mode === 'async') {
|
613
|
+
await compiledGenerateMarkup(emit, tagName, props, null, null);
|
614
|
+
}
|
615
|
+
else if (mode === 'sync') {
|
616
|
+
compiledGenerateMarkup(emit, tagName, props, null, null);
|
617
|
+
}
|
618
|
+
else {
|
619
|
+
throw new Error(`Invalid mode: ${mode}`);
|
344
620
|
}
|
345
621
|
return markup;
|
346
622
|
}
|
@@ -651,6 +927,6 @@ function validateStyleTextContents(contents) {
|
|
651
927
|
}
|
652
928
|
}
|
653
929
|
|
654
|
-
export { ClassList, LightningElement, SYMBOL__SET_INTERNALS, api, createContextProvider, createElement, fallbackTmpl, freezeTemplate, getComponentDef, hot, isComponentConstructor, mutationTracker, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, renderAttrs, serverSideRenderComponent as renderComponent, renderer, sanitizeAttribute, serverSideRenderComponent, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, toIteratorDirective, track, unwrap, validateStyleTextContents, wire };
|
655
|
-
/** version: 8.
|
930
|
+
export { ClassList, LightningElement, SYMBOL__SET_INTERNALS, api, createContextProvider, createElement, fallbackTmpl, fallbackTmplNoYield, freezeTemplate, getComponentDef, hot, htmlEscape, isComponentConstructor, mutationTracker, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, renderAttrs, renderAttrsNoYield, serverSideRenderComponent as renderComponent, renderer, sanitizeAttribute, serverSideRenderComponent, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, toIteratorDirective, track, unwrap, validateStyleTextContents, wire };
|
931
|
+
/** version: 8.4.0 */
|
656
932
|
//# sourceMappingURL=index.js.map
|