lwc 2.37.2 → 2.38.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 +241 -125
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -0
- package/dist/engine-dom/iife/es2017/engine-dom.js +241 -125
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -0
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js.map +1 -0
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +178 -112
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -0
- package/dist/engine-dom/iife/es5/engine-dom.js +274 -153
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -0
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js.map +1 -0
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +208 -140
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -0
- package/dist/engine-dom/umd/es2017/engine-dom.js +241 -125
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -0
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js.map +1 -0
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +178 -112
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -0
- package/dist/engine-dom/umd/es5/engine-dom.js +274 -153
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -0
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js.map +1 -0
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +208 -140
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -0
- package/dist/engine-server/commonjs/es2017/engine-server.js +161 -122
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -0
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js.map +1 -0
- package/dist/engine-server/esm/es2017/engine-server.js +161 -122
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -0
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +12 -5
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -0
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +12 -5
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -0
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js.map +1 -0
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +12 -5
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -0
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +8 -5
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -0
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js.map +1 -0
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +8 -5
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -0
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +12 -5
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -0
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +3 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js.map +1 -0
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +12 -5
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -0
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +8 -5
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -0
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js.map +1 -0
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +8 -5
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -0
- package/dist/wire-service/esm/es2017/wire-service.js +3 -2
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -0
- package/dist/wire-service/iife/es2017/wire-service.js +3 -2
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -0
- package/dist/wire-service/iife/es2017/wire-service.min.js +1 -0
- package/dist/wire-service/iife/es2017/wire-service.min.js.map +1 -0
- package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -0
- package/dist/wire-service/iife/es5/wire-service.js +3 -2
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -0
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -0
- package/dist/wire-service/iife/es5/wire-service.min.js.map +1 -0
- package/dist/wire-service/iife/es5/wire-service_debug.js +3 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -0
- package/dist/wire-service/umd/es2017/wire-service.js +3 -2
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -0
- package/dist/wire-service/umd/es2017/wire-service.min.js +1 -0
- package/dist/wire-service/umd/es2017/wire-service.min.js.map +1 -0
- package/dist/wire-service/umd/es2017/wire-service_debug.js +3 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -0
- package/dist/wire-service/umd/es5/wire-service.js +3 -2
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -0
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -0
- package/dist/wire-service/umd/es5/wire-service.min.js.map +1 -0
- package/dist/wire-service/umd/es5/wire-service_debug.js +3 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -0
- package/package.json +7 -7
|
@@ -322,6 +322,24 @@ function htmlAttributeToProperty(attrName) {
|
|
|
322
322
|
return propertyName;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
/*
|
|
326
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
327
|
+
* All rights reserved.
|
|
328
|
+
* SPDX-License-Identifier: MIT
|
|
329
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
330
|
+
*/
|
|
331
|
+
const ESCAPED_CHARS = {
|
|
332
|
+
'"': '"',
|
|
333
|
+
"'": ''',
|
|
334
|
+
'<': '<',
|
|
335
|
+
'>': '>',
|
|
336
|
+
'&': '&',
|
|
337
|
+
};
|
|
338
|
+
function htmlEscape(str, attrMode = false) {
|
|
339
|
+
const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
|
340
|
+
return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
|
|
341
|
+
}
|
|
342
|
+
|
|
325
343
|
/*
|
|
326
344
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
327
345
|
* All rights reserved.
|
|
@@ -329,9 +347,9 @@ function htmlAttributeToProperty(attrName) {
|
|
|
329
347
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
330
348
|
*/
|
|
331
349
|
// Increment whenever the LWC template compiler changes
|
|
332
|
-
const LWC_VERSION = "2.
|
|
350
|
+
const LWC_VERSION = "2.38.0";
|
|
333
351
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
334
|
-
/** version: 2.
|
|
352
|
+
/** version: 2.38.0 */
|
|
335
353
|
|
|
336
354
|
/**
|
|
337
355
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -410,7 +428,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
410
428
|
setFeatureFlag(name, value);
|
|
411
429
|
}
|
|
412
430
|
}
|
|
413
|
-
/** version: 2.
|
|
431
|
+
/** version: 2.38.0 */
|
|
414
432
|
|
|
415
433
|
/**
|
|
416
434
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -474,7 +492,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
474
492
|
}
|
|
475
493
|
}
|
|
476
494
|
}
|
|
477
|
-
/** version: 2.
|
|
495
|
+
/** version: 2.38.0 */
|
|
478
496
|
|
|
479
497
|
/*
|
|
480
498
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2272,6 +2290,14 @@ LightningElement.prototype = {
|
|
|
2272
2290
|
}
|
|
2273
2291
|
return renderer.getLastElementChild(vm.elm);
|
|
2274
2292
|
},
|
|
2293
|
+
get ownerDocument() {
|
|
2294
|
+
const vm = getAssociatedVM(this);
|
|
2295
|
+
const renderer = vm.renderer;
|
|
2296
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2297
|
+
warnIfInvokedDuringConstruction(vm, 'ownerDocument');
|
|
2298
|
+
}
|
|
2299
|
+
return renderer.ownerDocument(vm.elm);
|
|
2300
|
+
},
|
|
2275
2301
|
render() {
|
|
2276
2302
|
const vm = getAssociatedVM(this);
|
|
2277
2303
|
return vm.def.template;
|
|
@@ -2347,31 +2373,84 @@ function createObservedFieldPropertyDescriptor(key) {
|
|
|
2347
2373
|
}
|
|
2348
2374
|
|
|
2349
2375
|
/*
|
|
2350
|
-
* Copyright (c)
|
|
2376
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
2351
2377
|
* All rights reserved.
|
|
2352
2378
|
* SPDX-License-Identifier: MIT
|
|
2353
2379
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2354
2380
|
*/
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2381
|
+
const AdapterToTokenMap = new Map();
|
|
2382
|
+
function createContextProviderWithRegister(adapter, registerContextProvider) {
|
|
2383
|
+
let adapterContextToken = AdapterToTokenMap.get(adapter);
|
|
2384
|
+
if (!isUndefined$1(adapterContextToken)) {
|
|
2385
|
+
throw new Error(`Adapter already has a context provider.`);
|
|
2386
|
+
}
|
|
2387
|
+
adapterContextToken = guid();
|
|
2388
|
+
AdapterToTokenMap.set(adapter, adapterContextToken);
|
|
2389
|
+
const providers = new WeakSet();
|
|
2390
|
+
return (elmOrComponent, options) => {
|
|
2391
|
+
if (providers.has(elmOrComponent)) {
|
|
2392
|
+
throw new Error(`Adapter was already installed on ${elmOrComponent}.`);
|
|
2393
|
+
}
|
|
2394
|
+
providers.add(elmOrComponent);
|
|
2395
|
+
const { consumerConnectedCallback, consumerDisconnectedCallback } = options;
|
|
2396
|
+
registerContextProvider(elmOrComponent, adapterContextToken, (subscriptionPayload) => {
|
|
2397
|
+
const { setNewContext, setDisconnectedCallback } = subscriptionPayload;
|
|
2398
|
+
const consumer = {
|
|
2399
|
+
provide(newContext) {
|
|
2400
|
+
setNewContext(newContext);
|
|
2401
|
+
},
|
|
2402
|
+
};
|
|
2403
|
+
const disconnectCallback = () => {
|
|
2404
|
+
if (!isUndefined$1(consumerDisconnectedCallback)) {
|
|
2405
|
+
consumerDisconnectedCallback(consumer);
|
|
2406
|
+
}
|
|
2407
|
+
};
|
|
2408
|
+
setDisconnectedCallback(disconnectCallback);
|
|
2409
|
+
consumerConnectedCallback(consumer);
|
|
2364
2410
|
});
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2413
|
+
function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
2414
|
+
const { adapter } = wireDef;
|
|
2415
|
+
const adapterContextToken = AdapterToTokenMap.get(adapter);
|
|
2416
|
+
if (isUndefined$1(adapterContextToken)) {
|
|
2417
|
+
return; // no provider found, nothing to be done
|
|
2418
|
+
}
|
|
2419
|
+
const { elm, context: { wiredConnecting, wiredDisconnecting }, renderer: { registerContextConsumer }, } = vm;
|
|
2420
|
+
// waiting for the component to be connected to formally request the context via the token
|
|
2421
|
+
ArrayPush$1.call(wiredConnecting, () => {
|
|
2422
|
+
// This will attempt to connect the current element with one of its anscestors
|
|
2423
|
+
// that can provide context for the given wire adapter. This relationship is
|
|
2424
|
+
// keyed on the secret & internal value of `adapterContextToken`, which is unique
|
|
2425
|
+
// to a given wire adapter.
|
|
2426
|
+
//
|
|
2427
|
+
// Depending on the runtime environment, this connection is made using either DOM
|
|
2428
|
+
// events (in the browser) or a custom traversal (on the server).
|
|
2429
|
+
registerContextConsumer(elm, adapterContextToken, {
|
|
2430
|
+
setNewContext(newContext) {
|
|
2431
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
2432
|
+
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
2433
|
+
callbackWhenContextIsReady(newContext);
|
|
2368
2434
|
},
|
|
2369
|
-
setDisconnectedCallback
|
|
2370
|
-
|
|
2435
|
+
setDisconnectedCallback(disconnectCallback) {
|
|
2436
|
+
// adds this callback into the disconnect bucket so it gets disconnected from parent
|
|
2437
|
+
// the the element hosting the wire is disconnected
|
|
2438
|
+
ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
|
|
2371
2439
|
},
|
|
2372
2440
|
});
|
|
2373
|
-
}
|
|
2441
|
+
});
|
|
2374
2442
|
}
|
|
2443
|
+
|
|
2444
|
+
/*
|
|
2445
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
2446
|
+
* All rights reserved.
|
|
2447
|
+
* SPDX-License-Identifier: MIT
|
|
2448
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2449
|
+
*/
|
|
2450
|
+
const DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
|
|
2451
|
+
const DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
|
|
2452
|
+
const WIRE_DEBUG_ENTRY = '@wire';
|
|
2453
|
+
const WireMetaMap = new Map();
|
|
2375
2454
|
function createFieldDataCallback(vm, name) {
|
|
2376
2455
|
return (value) => {
|
|
2377
2456
|
updateComponentValue(vm, name, value);
|
|
@@ -2415,35 +2494,6 @@ function createConfigWatcher(component, configCallback, callbackWhenConfigIsRead
|
|
|
2415
2494
|
ro,
|
|
2416
2495
|
};
|
|
2417
2496
|
}
|
|
2418
|
-
function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
2419
|
-
const { adapter } = wireDef;
|
|
2420
|
-
const adapterContextToken = getAdapterToken(adapter);
|
|
2421
|
-
if (isUndefined$1(adapterContextToken)) {
|
|
2422
|
-
return; // no provider found, nothing to be done
|
|
2423
|
-
}
|
|
2424
|
-
const { elm, context: { wiredConnecting, wiredDisconnecting }, renderer: { dispatchEvent }, } = vm;
|
|
2425
|
-
// waiting for the component to be connected to formally request the context via the token
|
|
2426
|
-
ArrayPush$1.call(wiredConnecting, () => {
|
|
2427
|
-
// This event is responsible for connecting the host element with another
|
|
2428
|
-
// element in the composed path that is providing contextual data. The provider
|
|
2429
|
-
// must be listening for a special dom event with the name corresponding to the value of
|
|
2430
|
-
// `adapterContextToken`, which will remain secret and internal to this file only to
|
|
2431
|
-
// guarantee that the linkage can be forged.
|
|
2432
|
-
const contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
|
|
2433
|
-
setNewContext(newContext) {
|
|
2434
|
-
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
2435
|
-
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
2436
|
-
callbackWhenContextIsReady(newContext);
|
|
2437
|
-
},
|
|
2438
|
-
setDisconnectedCallback(disconnectCallback) {
|
|
2439
|
-
// adds this callback into the disconnect bucket so it gets disconnected from parent
|
|
2440
|
-
// the the element hosting the wire is disconnected
|
|
2441
|
-
ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
|
|
2442
|
-
},
|
|
2443
|
-
});
|
|
2444
|
-
dispatchEvent(elm, contextRegistrationEvent);
|
|
2445
|
-
});
|
|
2446
|
-
}
|
|
2447
2497
|
function createConnector(vm, name, wireDef) {
|
|
2448
2498
|
const { method, adapter, configCallback, dynamic } = wireDef;
|
|
2449
2499
|
let debugInfo;
|
|
@@ -2518,13 +2568,6 @@ function createConnector(vm, name, wireDef) {
|
|
|
2518
2568
|
resetConfigWatcher: () => ro.reset(),
|
|
2519
2569
|
};
|
|
2520
2570
|
}
|
|
2521
|
-
const AdapterToTokenMap = new Map();
|
|
2522
|
-
function getAdapterToken(adapter) {
|
|
2523
|
-
return AdapterToTokenMap.get(adapter);
|
|
2524
|
-
}
|
|
2525
|
-
function setAdapterToken(adapter, token) {
|
|
2526
|
-
AdapterToTokenMap.set(adapter, token);
|
|
2527
|
-
}
|
|
2528
2571
|
function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
|
|
2529
2572
|
// support for callable adapters
|
|
2530
2573
|
if (adapter.adapter) {
|
|
@@ -6333,6 +6376,10 @@ function forceRehydration(vm) {
|
|
|
6333
6376
|
// Use the unpatched native getElementById/querySelectorAll rather than the synthetic one
|
|
6334
6377
|
const getElementById = _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
|
|
6335
6378
|
const querySelectorAll = _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
|
|
6379
|
+
// This is a "handoff" from synthetic-shadow to engine-core – we want to clean up after ourselves
|
|
6380
|
+
// so nobody else can misuse these global APIs.
|
|
6381
|
+
delete _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
|
|
6382
|
+
delete _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
|
|
6336
6383
|
function isSyntheticShadowRootInstance(rootNode) {
|
|
6337
6384
|
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
6338
6385
|
}
|
|
@@ -6580,67 +6627,6 @@ function enableDetection() {
|
|
|
6580
6627
|
}
|
|
6581
6628
|
}
|
|
6582
6629
|
|
|
6583
|
-
/*
|
|
6584
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
6585
|
-
* All rights reserved.
|
|
6586
|
-
* SPDX-License-Identifier: MIT
|
|
6587
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6588
|
-
*/
|
|
6589
|
-
// this is lwc internal implementation
|
|
6590
|
-
function createContextProvider(adapter) {
|
|
6591
|
-
let adapterContextToken = getAdapterToken(adapter);
|
|
6592
|
-
if (!isUndefined$1(adapterContextToken)) {
|
|
6593
|
-
throw new Error(`Adapter already has a context provider.`);
|
|
6594
|
-
}
|
|
6595
|
-
adapterContextToken = guid();
|
|
6596
|
-
setAdapterToken(adapter, adapterContextToken);
|
|
6597
|
-
const providers = new WeakSet();
|
|
6598
|
-
return (elm, options) => {
|
|
6599
|
-
if (providers.has(elm)) {
|
|
6600
|
-
throw new Error(`Adapter was already installed on ${elm}.`);
|
|
6601
|
-
}
|
|
6602
|
-
providers.add(elm);
|
|
6603
|
-
const { consumerConnectedCallback, consumerDisconnectedCallback } = options;
|
|
6604
|
-
elm.addEventListener(adapterContextToken, ((evt) => {
|
|
6605
|
-
const { setNewContext, setDisconnectedCallback } = evt;
|
|
6606
|
-
const consumer = {
|
|
6607
|
-
provide(newContext) {
|
|
6608
|
-
setNewContext(newContext);
|
|
6609
|
-
},
|
|
6610
|
-
};
|
|
6611
|
-
const disconnectCallback = () => {
|
|
6612
|
-
if (!isUndefined$1(consumerDisconnectedCallback)) {
|
|
6613
|
-
consumerDisconnectedCallback(consumer);
|
|
6614
|
-
}
|
|
6615
|
-
};
|
|
6616
|
-
setDisconnectedCallback(disconnectCallback);
|
|
6617
|
-
consumerConnectedCallback(consumer);
|
|
6618
|
-
evt.stopImmediatePropagation();
|
|
6619
|
-
}));
|
|
6620
|
-
};
|
|
6621
|
-
}
|
|
6622
|
-
|
|
6623
|
-
/*
|
|
6624
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
6625
|
-
* All rights reserved.
|
|
6626
|
-
* SPDX-License-Identifier: MIT
|
|
6627
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6628
|
-
*/
|
|
6629
|
-
/**
|
|
6630
|
-
* EXPERIMENTAL: This function allows you to create a reactive readonly
|
|
6631
|
-
* membrane around any object value. This API is subject to change or
|
|
6632
|
-
* being removed.
|
|
6633
|
-
*/
|
|
6634
|
-
function readonly(obj) {
|
|
6635
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
6636
|
-
// TODO [#1292]: Remove the readonly decorator
|
|
6637
|
-
if (arguments.length !== 1) {
|
|
6638
|
-
assert.fail('@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.');
|
|
6639
|
-
}
|
|
6640
|
-
}
|
|
6641
|
-
return getReadOnlyProxy(obj);
|
|
6642
|
-
}
|
|
6643
|
-
|
|
6644
6630
|
/*
|
|
6645
6631
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
6646
6632
|
* All rights reserved.
|
|
@@ -6694,15 +6680,44 @@ function hydrateNode(node, vnode, renderer) {
|
|
|
6694
6680
|
return renderer.nextSibling(hydratedNode);
|
|
6695
6681
|
}
|
|
6696
6682
|
const NODE_VALUE_PROP = 'nodeValue';
|
|
6683
|
+
const PARENT_NODE_PROP = 'parentNode';
|
|
6684
|
+
const TAG_NAME_PROP = 'tagName';
|
|
6685
|
+
function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
6686
|
+
const { getProperty } = renderer;
|
|
6687
|
+
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6688
|
+
if (nodeValue === vnode.text) {
|
|
6689
|
+
return true;
|
|
6690
|
+
}
|
|
6691
|
+
// Special case for empty text nodes – these are serialized differently on the server
|
|
6692
|
+
// See https://github.com/salesforce/lwc/pull/2656
|
|
6693
|
+
if (nodeValue === '\u200D' && vnode.text === '') {
|
|
6694
|
+
return true;
|
|
6695
|
+
}
|
|
6696
|
+
// Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
|
|
6697
|
+
// but not when generated by the engine client-side.
|
|
6698
|
+
const parentNode = getProperty(node, PARENT_NODE_PROP);
|
|
6699
|
+
// Should never be null, but just to be safe, we check.
|
|
6700
|
+
/* istanbul ignore else */
|
|
6701
|
+
if (!isNull(parentNode)) {
|
|
6702
|
+
const tagName = getProperty(parentNode, TAG_NAME_PROP);
|
|
6703
|
+
// If the tagName is STYLE, then the following condition should always be true.
|
|
6704
|
+
// The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
|
|
6705
|
+
// for component authors to render different `<style>` text content on the client and server.
|
|
6706
|
+
// But just to be safe, we check.
|
|
6707
|
+
/* istanbul ignore next */
|
|
6708
|
+
if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
|
|
6709
|
+
return true;
|
|
6710
|
+
}
|
|
6711
|
+
}
|
|
6712
|
+
return false;
|
|
6713
|
+
}
|
|
6697
6714
|
function hydrateText(node, vnode, renderer) {
|
|
6698
6715
|
var _a;
|
|
6699
6716
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
6700
6717
|
return handleMismatch(node, vnode, renderer);
|
|
6701
6718
|
}
|
|
6702
6719
|
if (process.env.NODE_ENV !== 'production') {
|
|
6703
|
-
|
|
6704
|
-
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6705
|
-
if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
|
|
6720
|
+
if (!textNodeContentsAreEqual(node, vnode, renderer)) {
|
|
6706
6721
|
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
6707
6722
|
}
|
|
6708
6723
|
}
|
|
@@ -6882,6 +6897,19 @@ function isMatchingElement(vnode, elm, renderer) {
|
|
|
6882
6897
|
const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
|
|
6883
6898
|
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
6884
6899
|
}
|
|
6900
|
+
function attributeValuesAreEqual(vnodeValue, value) {
|
|
6901
|
+
const vnodeValueAsString = String(vnodeValue);
|
|
6902
|
+
if (vnodeValueAsString === value) {
|
|
6903
|
+
return true;
|
|
6904
|
+
}
|
|
6905
|
+
// If the expected value is null, this means that the attribute does not exist. In that case,
|
|
6906
|
+
// we accept any nullish value (undefined or null).
|
|
6907
|
+
if (isNull(value) && (isUndefined$1(vnodeValue) || isNull(vnodeValue))) {
|
|
6908
|
+
return true;
|
|
6909
|
+
}
|
|
6910
|
+
// In all other cases, the two values are not considered equal
|
|
6911
|
+
return false;
|
|
6912
|
+
}
|
|
6885
6913
|
function validateAttrs(vnode, elm, renderer) {
|
|
6886
6914
|
const { data: { attrs = {} }, } = vnode;
|
|
6887
6915
|
let nodesAreCompatible = true;
|
|
@@ -6891,10 +6919,10 @@ function validateAttrs(vnode, elm, renderer) {
|
|
|
6891
6919
|
const { owner } = vnode;
|
|
6892
6920
|
const { getAttribute } = renderer;
|
|
6893
6921
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
6894
|
-
if (
|
|
6922
|
+
if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
|
|
6895
6923
|
if (process.env.NODE_ENV !== 'production') {
|
|
6896
6924
|
const { getProperty } = renderer;
|
|
6897
|
-
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, owner);
|
|
6925
|
+
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found ${isNull(elmAttrValue) ? 'null' : `"${elmAttrValue}"`}`, owner);
|
|
6898
6926
|
}
|
|
6899
6927
|
nodesAreCompatible = false;
|
|
6900
6928
|
}
|
|
@@ -7288,7 +7316,28 @@ function getComponentConstructor(elm) {
|
|
|
7288
7316
|
}
|
|
7289
7317
|
return ctor;
|
|
7290
7318
|
}
|
|
7291
|
-
|
|
7319
|
+
|
|
7320
|
+
/*
|
|
7321
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
7322
|
+
* All rights reserved.
|
|
7323
|
+
* SPDX-License-Identifier: MIT
|
|
7324
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7325
|
+
*/
|
|
7326
|
+
/**
|
|
7327
|
+
* EXPERIMENTAL: This function allows you to create a reactive readonly
|
|
7328
|
+
* membrane around any object value. This API is subject to change or
|
|
7329
|
+
* being removed.
|
|
7330
|
+
*/
|
|
7331
|
+
function readonly(obj) {
|
|
7332
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7333
|
+
// TODO [#1292]: Remove the readonly decorator
|
|
7334
|
+
if (arguments.length !== 1) {
|
|
7335
|
+
assert.fail('@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.');
|
|
7336
|
+
}
|
|
7337
|
+
}
|
|
7338
|
+
return getReadOnlyProxy(obj);
|
|
7339
|
+
}
|
|
7340
|
+
/* version: 2.38.0 */
|
|
7292
7341
|
|
|
7293
7342
|
/*
|
|
7294
7343
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7716,7 +7765,37 @@ function rendererFactory(baseRenderer) {
|
|
|
7716
7765
|
function isNull(obj) {
|
|
7717
7766
|
return obj === null;
|
|
7718
7767
|
}
|
|
7719
|
-
/** version: 2.
|
|
7768
|
+
/** version: 2.38.0 */
|
|
7769
|
+
|
|
7770
|
+
/*
|
|
7771
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
7772
|
+
* All rights reserved.
|
|
7773
|
+
* SPDX-License-Identifier: MIT
|
|
7774
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7775
|
+
*/
|
|
7776
|
+
class WireContextSubscriptionEvent extends CustomEvent {
|
|
7777
|
+
constructor(adapterToken, { setNewContext, setDisconnectedCallback }) {
|
|
7778
|
+
super(adapterToken, {
|
|
7779
|
+
bubbles: true,
|
|
7780
|
+
composed: true,
|
|
7781
|
+
});
|
|
7782
|
+
this.setNewContext = setNewContext;
|
|
7783
|
+
this.setDisconnectedCallback = setDisconnectedCallback;
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7786
|
+
function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
|
|
7787
|
+
dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
|
|
7788
|
+
}
|
|
7789
|
+
function registerContextProvider(elm, adapterContextToken, onContextSubscription) {
|
|
7790
|
+
addEventListener(elm, adapterContextToken, ((evt) => {
|
|
7791
|
+
evt.stopImmediatePropagation();
|
|
7792
|
+
const { setNewContext, setDisconnectedCallback } = evt;
|
|
7793
|
+
onContextSubscription({
|
|
7794
|
+
setNewContext,
|
|
7795
|
+
setDisconnectedCallback,
|
|
7796
|
+
});
|
|
7797
|
+
}));
|
|
7798
|
+
}
|
|
7720
7799
|
|
|
7721
7800
|
/*
|
|
7722
7801
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7897,6 +7976,9 @@ function rendererFactory(baseRenderer) {
|
|
|
7897
7976
|
function assertInstanceOfHTMLElement(elm, msg) {
|
|
7898
7977
|
assert.invariant(elm instanceof HTMLElement, msg);
|
|
7899
7978
|
}
|
|
7979
|
+
function ownerDocument(element) {
|
|
7980
|
+
return element.ownerDocument;
|
|
7981
|
+
}
|
|
7900
7982
|
|
|
7901
7983
|
exports.addEventListener = addEventListener;
|
|
7902
7984
|
exports.assertInstanceOfHTMLElement = assertInstanceOfHTMLElement;
|
|
@@ -7921,8 +8003,11 @@ function rendererFactory(baseRenderer) {
|
|
|
7921
8003
|
exports.insert = insert;
|
|
7922
8004
|
exports.isConnected = isConnected;
|
|
7923
8005
|
exports.nextSibling = nextSibling;
|
|
8006
|
+
exports.ownerDocument = ownerDocument;
|
|
7924
8007
|
exports.querySelector = querySelector;
|
|
7925
8008
|
exports.querySelectorAll = querySelectorAll;
|
|
8009
|
+
exports.registerContextConsumer = registerContextConsumer;
|
|
8010
|
+
exports.registerContextProvider = registerContextProvider;
|
|
7926
8011
|
exports.remove = remove;
|
|
7927
8012
|
exports.removeAttribute = removeAttribute;
|
|
7928
8013
|
exports.removeEventListener = removeEventListener;
|
|
@@ -8269,6 +8354,37 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8269
8354
|
});
|
|
8270
8355
|
freeze(LightningElement);
|
|
8271
8356
|
seal(LightningElement.prototype);
|
|
8272
|
-
|
|
8357
|
+
|
|
8358
|
+
/*
|
|
8359
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
8360
|
+
* All rights reserved.
|
|
8361
|
+
* SPDX-License-Identifier: MIT
|
|
8362
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8363
|
+
*/
|
|
8364
|
+
function addEventListener(target, type, callback, options) {
|
|
8365
|
+
target.addEventListener(type, callback, options);
|
|
8366
|
+
}
|
|
8367
|
+
|
|
8368
|
+
/*
|
|
8369
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
8370
|
+
* All rights reserved.
|
|
8371
|
+
* SPDX-License-Identifier: MIT
|
|
8372
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8373
|
+
*/
|
|
8374
|
+
function createContextProvider(adapter) {
|
|
8375
|
+
return createContextProviderWithRegister(adapter, registerContextProvider);
|
|
8376
|
+
}
|
|
8377
|
+
function registerContextProvider(elm, adapterContextToken, onContextSubscription) {
|
|
8378
|
+
addEventListener(elm, adapterContextToken, ((evt) => {
|
|
8379
|
+
evt.stopImmediatePropagation();
|
|
8380
|
+
const { setNewContext, setDisconnectedCallback } = evt;
|
|
8381
|
+
onContextSubscription({
|
|
8382
|
+
setNewContext,
|
|
8383
|
+
setDisconnectedCallback,
|
|
8384
|
+
});
|
|
8385
|
+
}));
|
|
8386
|
+
}
|
|
8387
|
+
/* version: 2.38.0 */
|
|
8273
8388
|
|
|
8274
8389
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
8390
|
+
//# sourceMappingURL=engine-dom.js.map
|