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
|
@@ -203,6 +203,8 @@ const KEY__SHADOW_RESOLVER = '$shadowResolver$';
|
|
|
203
203
|
const KEY__SHADOW_STATIC = '$shadowStaticNode$';
|
|
204
204
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
205
205
|
const KEY__SCOPED_CSS = '$scoped$';
|
|
206
|
+
const KEY__NATIVE_GET_ELEMENT_BY_ID = '$nativeGetElementById$';
|
|
207
|
+
const KEY__NATIVE_QUERY_SELECTOR_ALL = '$nativeQuerySelectorAll$';
|
|
206
208
|
|
|
207
209
|
/*
|
|
208
210
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
@@ -442,9 +444,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
442
444
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
443
445
|
*/
|
|
444
446
|
// Increment whenever the LWC template compiler changes
|
|
445
|
-
const LWC_VERSION = "2.
|
|
447
|
+
const LWC_VERSION = "2.38.0";
|
|
446
448
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
447
|
-
/** version: 2.
|
|
449
|
+
/** version: 2.38.0 */
|
|
448
450
|
|
|
449
451
|
/**
|
|
450
452
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -523,7 +525,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
523
525
|
setFeatureFlag(name, value);
|
|
524
526
|
}
|
|
525
527
|
}
|
|
526
|
-
/** version: 2.
|
|
528
|
+
/** version: 2.38.0 */
|
|
527
529
|
|
|
528
530
|
/*
|
|
529
531
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -619,7 +621,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
619
621
|
}
|
|
620
622
|
}
|
|
621
623
|
}
|
|
622
|
-
/** version: 2.
|
|
624
|
+
/** version: 2.38.0 */
|
|
623
625
|
|
|
624
626
|
/* proxy-compat-disable */
|
|
625
627
|
|
|
@@ -2193,6 +2195,14 @@ LightningElement.prototype = {
|
|
|
2193
2195
|
}
|
|
2194
2196
|
return renderer.getLastElementChild(vm.elm);
|
|
2195
2197
|
},
|
|
2198
|
+
get ownerDocument() {
|
|
2199
|
+
const vm = getAssociatedVM(this);
|
|
2200
|
+
const renderer = vm.renderer;
|
|
2201
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2202
|
+
warnIfInvokedDuringConstruction(vm, 'ownerDocument');
|
|
2203
|
+
}
|
|
2204
|
+
return renderer.ownerDocument(vm.elm);
|
|
2205
|
+
},
|
|
2196
2206
|
render() {
|
|
2197
2207
|
const vm = getAssociatedVM(this);
|
|
2198
2208
|
return vm.def.template;
|
|
@@ -2267,31 +2277,84 @@ function createObservedFieldPropertyDescriptor(key) {
|
|
|
2267
2277
|
}
|
|
2268
2278
|
|
|
2269
2279
|
/*
|
|
2270
|
-
* Copyright (c)
|
|
2280
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
2271
2281
|
* All rights reserved.
|
|
2272
2282
|
* SPDX-License-Identifier: MIT
|
|
2273
2283
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2274
2284
|
*/
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2285
|
+
const AdapterToTokenMap = new Map();
|
|
2286
|
+
function createContextProviderWithRegister(adapter, registerContextProvider) {
|
|
2287
|
+
let adapterContextToken = AdapterToTokenMap.get(adapter);
|
|
2288
|
+
if (!isUndefined$1(adapterContextToken)) {
|
|
2289
|
+
throw new Error(`Adapter already has a context provider.`);
|
|
2290
|
+
}
|
|
2291
|
+
adapterContextToken = guid();
|
|
2292
|
+
AdapterToTokenMap.set(adapter, adapterContextToken);
|
|
2293
|
+
const providers = new WeakSet();
|
|
2294
|
+
return (elmOrComponent, options) => {
|
|
2295
|
+
if (providers.has(elmOrComponent)) {
|
|
2296
|
+
throw new Error(`Adapter was already installed on ${elmOrComponent}.`);
|
|
2297
|
+
}
|
|
2298
|
+
providers.add(elmOrComponent);
|
|
2299
|
+
const { consumerConnectedCallback, consumerDisconnectedCallback } = options;
|
|
2300
|
+
registerContextProvider(elmOrComponent, adapterContextToken, (subscriptionPayload) => {
|
|
2301
|
+
const { setNewContext, setDisconnectedCallback } = subscriptionPayload;
|
|
2302
|
+
const consumer = {
|
|
2303
|
+
provide(newContext) {
|
|
2304
|
+
setNewContext(newContext);
|
|
2305
|
+
},
|
|
2306
|
+
};
|
|
2307
|
+
const disconnectCallback = () => {
|
|
2308
|
+
if (!isUndefined$1(consumerDisconnectedCallback)) {
|
|
2309
|
+
consumerDisconnectedCallback(consumer);
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
setDisconnectedCallback(disconnectCallback);
|
|
2313
|
+
consumerConnectedCallback(consumer);
|
|
2284
2314
|
});
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
2318
|
+
const { adapter } = wireDef;
|
|
2319
|
+
const adapterContextToken = AdapterToTokenMap.get(adapter);
|
|
2320
|
+
if (isUndefined$1(adapterContextToken)) {
|
|
2321
|
+
return; // no provider found, nothing to be done
|
|
2322
|
+
}
|
|
2323
|
+
const { elm, context: { wiredConnecting, wiredDisconnecting }, renderer: { registerContextConsumer }, } = vm;
|
|
2324
|
+
// waiting for the component to be connected to formally request the context via the token
|
|
2325
|
+
ArrayPush$1.call(wiredConnecting, () => {
|
|
2326
|
+
// This will attempt to connect the current element with one of its anscestors
|
|
2327
|
+
// that can provide context for the given wire adapter. This relationship is
|
|
2328
|
+
// keyed on the secret & internal value of `adapterContextToken`, which is unique
|
|
2329
|
+
// to a given wire adapter.
|
|
2330
|
+
//
|
|
2331
|
+
// Depending on the runtime environment, this connection is made using either DOM
|
|
2332
|
+
// events (in the browser) or a custom traversal (on the server).
|
|
2333
|
+
registerContextConsumer(elm, adapterContextToken, {
|
|
2334
|
+
setNewContext(newContext) {
|
|
2335
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
2336
|
+
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
2337
|
+
callbackWhenContextIsReady(newContext);
|
|
2288
2338
|
},
|
|
2289
|
-
setDisconnectedCallback
|
|
2290
|
-
|
|
2339
|
+
setDisconnectedCallback(disconnectCallback) {
|
|
2340
|
+
// adds this callback into the disconnect bucket so it gets disconnected from parent
|
|
2341
|
+
// the the element hosting the wire is disconnected
|
|
2342
|
+
ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
|
|
2291
2343
|
},
|
|
2292
2344
|
});
|
|
2293
|
-
}
|
|
2345
|
+
});
|
|
2294
2346
|
}
|
|
2347
|
+
|
|
2348
|
+
/*
|
|
2349
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
2350
|
+
* All rights reserved.
|
|
2351
|
+
* SPDX-License-Identifier: MIT
|
|
2352
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2353
|
+
*/
|
|
2354
|
+
const DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
|
|
2355
|
+
const DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
|
|
2356
|
+
const WIRE_DEBUG_ENTRY = '@wire';
|
|
2357
|
+
const WireMetaMap = new Map();
|
|
2295
2358
|
function createFieldDataCallback(vm, name) {
|
|
2296
2359
|
return (value) => {
|
|
2297
2360
|
updateComponentValue(vm, name, value);
|
|
@@ -2322,35 +2385,6 @@ function createConfigWatcher(component, configCallback, callbackWhenConfigIsRead
|
|
|
2322
2385
|
ro,
|
|
2323
2386
|
};
|
|
2324
2387
|
}
|
|
2325
|
-
function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
2326
|
-
const { adapter } = wireDef;
|
|
2327
|
-
const adapterContextToken = getAdapterToken(adapter);
|
|
2328
|
-
if (isUndefined$1(adapterContextToken)) {
|
|
2329
|
-
return; // no provider found, nothing to be done
|
|
2330
|
-
}
|
|
2331
|
-
const { elm, context: { wiredConnecting, wiredDisconnecting }, renderer: { dispatchEvent }, } = vm;
|
|
2332
|
-
// waiting for the component to be connected to formally request the context via the token
|
|
2333
|
-
ArrayPush$1.call(wiredConnecting, () => {
|
|
2334
|
-
// This event is responsible for connecting the host element with another
|
|
2335
|
-
// element in the composed path that is providing contextual data. The provider
|
|
2336
|
-
// must be listening for a special dom event with the name corresponding to the value of
|
|
2337
|
-
// `adapterContextToken`, which will remain secret and internal to this file only to
|
|
2338
|
-
// guarantee that the linkage can be forged.
|
|
2339
|
-
const contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
|
|
2340
|
-
setNewContext(newContext) {
|
|
2341
|
-
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
2342
|
-
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
2343
|
-
callbackWhenContextIsReady(newContext);
|
|
2344
|
-
},
|
|
2345
|
-
setDisconnectedCallback(disconnectCallback) {
|
|
2346
|
-
// adds this callback into the disconnect bucket so it gets disconnected from parent
|
|
2347
|
-
// the the element hosting the wire is disconnected
|
|
2348
|
-
ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
|
|
2349
|
-
},
|
|
2350
|
-
});
|
|
2351
|
-
dispatchEvent(elm, contextRegistrationEvent);
|
|
2352
|
-
});
|
|
2353
|
-
}
|
|
2354
2388
|
function createConnector(vm, name, wireDef) {
|
|
2355
2389
|
const { method, adapter, configCallback, dynamic } = wireDef;
|
|
2356
2390
|
let debugInfo;
|
|
@@ -2425,13 +2459,6 @@ function createConnector(vm, name, wireDef) {
|
|
|
2425
2459
|
resetConfigWatcher: () => ro.reset(),
|
|
2426
2460
|
};
|
|
2427
2461
|
}
|
|
2428
|
-
const AdapterToTokenMap = new Map();
|
|
2429
|
-
function getAdapterToken(adapter) {
|
|
2430
|
-
return AdapterToTokenMap.get(adapter);
|
|
2431
|
-
}
|
|
2432
|
-
function setAdapterToken(adapter, token) {
|
|
2433
|
-
AdapterToTokenMap.set(adapter, token);
|
|
2434
|
-
}
|
|
2435
2462
|
function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
|
|
2436
2463
|
// support for callable adapters
|
|
2437
2464
|
if (adapter.adapter) {
|
|
@@ -5938,67 +5965,10 @@ function runWithBoundaryProtection(vm, owner, pre, job, post) {
|
|
|
5938
5965
|
}
|
|
5939
5966
|
}
|
|
5940
5967
|
}
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
* SPDX-License-Identifier: MIT
|
|
5946
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5947
|
-
*/
|
|
5948
|
-
// this is lwc internal implementation
|
|
5949
|
-
function createContextProvider(adapter) {
|
|
5950
|
-
let adapterContextToken = getAdapterToken(adapter);
|
|
5951
|
-
if (!isUndefined$1(adapterContextToken)) {
|
|
5952
|
-
throw new Error(`Adapter already has a context provider.`);
|
|
5953
|
-
}
|
|
5954
|
-
adapterContextToken = guid();
|
|
5955
|
-
setAdapterToken(adapter, adapterContextToken);
|
|
5956
|
-
const providers = new WeakSet();
|
|
5957
|
-
return (elm, options) => {
|
|
5958
|
-
if (providers.has(elm)) {
|
|
5959
|
-
throw new Error(`Adapter was already installed on ${elm}.`);
|
|
5960
|
-
}
|
|
5961
|
-
providers.add(elm);
|
|
5962
|
-
const { consumerConnectedCallback, consumerDisconnectedCallback } = options;
|
|
5963
|
-
elm.addEventListener(adapterContextToken, ((evt) => {
|
|
5964
|
-
const { setNewContext, setDisconnectedCallback } = evt;
|
|
5965
|
-
const consumer = {
|
|
5966
|
-
provide(newContext) {
|
|
5967
|
-
setNewContext(newContext);
|
|
5968
|
-
},
|
|
5969
|
-
};
|
|
5970
|
-
const disconnectCallback = () => {
|
|
5971
|
-
if (!isUndefined$1(consumerDisconnectedCallback)) {
|
|
5972
|
-
consumerDisconnectedCallback(consumer);
|
|
5973
|
-
}
|
|
5974
|
-
};
|
|
5975
|
-
setDisconnectedCallback(disconnectCallback);
|
|
5976
|
-
consumerConnectedCallback(consumer);
|
|
5977
|
-
evt.stopImmediatePropagation();
|
|
5978
|
-
}));
|
|
5979
|
-
};
|
|
5980
|
-
}
|
|
5981
|
-
|
|
5982
|
-
/*
|
|
5983
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
5984
|
-
* All rights reserved.
|
|
5985
|
-
* SPDX-License-Identifier: MIT
|
|
5986
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5987
|
-
*/
|
|
5988
|
-
/**
|
|
5989
|
-
* EXPERIMENTAL: This function allows you to create a reactive readonly
|
|
5990
|
-
* membrane around any object value. This API is subject to change or
|
|
5991
|
-
* being removed.
|
|
5992
|
-
*/
|
|
5993
|
-
function readonly(obj) {
|
|
5994
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5995
|
-
// TODO [#1292]: Remove the readonly decorator
|
|
5996
|
-
if (arguments.length !== 1) {
|
|
5997
|
-
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.');
|
|
5998
|
-
}
|
|
5999
|
-
}
|
|
6000
|
-
return getReadOnlyProxy(obj);
|
|
6001
|
-
}
|
|
5968
|
+
// This is a "handoff" from synthetic-shadow to engine-core – we want to clean up after ourselves
|
|
5969
|
+
// so nobody else can misuse these global APIs.
|
|
5970
|
+
delete _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
|
|
5971
|
+
delete _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
|
|
6002
5972
|
|
|
6003
5973
|
/*
|
|
6004
5974
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6215,7 +6185,28 @@ function freezeTemplate(tmpl) {
|
|
|
6215
6185
|
}
|
|
6216
6186
|
}
|
|
6217
6187
|
}
|
|
6218
|
-
|
|
6188
|
+
|
|
6189
|
+
/*
|
|
6190
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
6191
|
+
* All rights reserved.
|
|
6192
|
+
* SPDX-License-Identifier: MIT
|
|
6193
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6194
|
+
*/
|
|
6195
|
+
/**
|
|
6196
|
+
* EXPERIMENTAL: This function allows you to create a reactive readonly
|
|
6197
|
+
* membrane around any object value. This API is subject to change or
|
|
6198
|
+
* being removed.
|
|
6199
|
+
*/
|
|
6200
|
+
function readonly(obj) {
|
|
6201
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6202
|
+
// TODO [#1292]: Remove the readonly decorator
|
|
6203
|
+
if (arguments.length !== 1) {
|
|
6204
|
+
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.');
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
return getReadOnlyProxy(obj);
|
|
6208
|
+
}
|
|
6209
|
+
/* version: 2.38.0 */
|
|
6219
6210
|
|
|
6220
6211
|
/*
|
|
6221
6212
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6231,8 +6222,9 @@ const HostParentKey = Symbol('parent');
|
|
|
6231
6222
|
const HostShadowRootKey = Symbol('shadow-root');
|
|
6232
6223
|
const HostChildrenKey = Symbol('children');
|
|
6233
6224
|
const HostAttributesKey = Symbol('attributes');
|
|
6234
|
-
const HostEventListenersKey = Symbol('event-listeners');
|
|
6235
6225
|
const HostValueKey = Symbol('value');
|
|
6226
|
+
const HostHostKey = Symbol('host');
|
|
6227
|
+
const HostContextProvidersKey = Symbol('context-providers');
|
|
6236
6228
|
var HostNodeType;
|
|
6237
6229
|
(function (HostNodeType) {
|
|
6238
6230
|
HostNodeType["Text"] = "text";
|
|
@@ -6256,6 +6248,48 @@ function tokenListToClassName(values) {
|
|
|
6256
6248
|
return Array.from(values).join(' ');
|
|
6257
6249
|
}
|
|
6258
6250
|
|
|
6251
|
+
/*
|
|
6252
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
6253
|
+
* All rights reserved.
|
|
6254
|
+
* SPDX-License-Identifier: MIT
|
|
6255
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6256
|
+
*/
|
|
6257
|
+
function createContextProvider(adapter) {
|
|
6258
|
+
return createContextProviderWithRegister(adapter, registerContextProvider);
|
|
6259
|
+
}
|
|
6260
|
+
function registerContextProvider(elm, adapterContextToken, onContextSubscription) {
|
|
6261
|
+
const vm = getAssociatedVMIfPresent(elm);
|
|
6262
|
+
if (!isUndefined$1(vm)) {
|
|
6263
|
+
elm = vm.elm;
|
|
6264
|
+
}
|
|
6265
|
+
const contextProviders = elm[HostContextProvidersKey];
|
|
6266
|
+
if (isUndefined$1(contextProviders)) {
|
|
6267
|
+
throw new Error('Unable to register context provider on provided `elm`.');
|
|
6268
|
+
}
|
|
6269
|
+
contextProviders.set(adapterContextToken, onContextSubscription);
|
|
6270
|
+
}
|
|
6271
|
+
function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
|
|
6272
|
+
// Traverse element ancestors, looking for an element that can provide context
|
|
6273
|
+
// for the adapter identified by `adapterContextToken`. If found, register
|
|
6274
|
+
// to receive context updates from that provider.
|
|
6275
|
+
let currentNode = elm;
|
|
6276
|
+
do {
|
|
6277
|
+
if (currentNode[HostTypeKey] === HostNodeType.Element) {
|
|
6278
|
+
const subscribeToProvider = currentNode[HostContextProvidersKey].get(adapterContextToken);
|
|
6279
|
+
if (!isUndefined$1(subscribeToProvider)) {
|
|
6280
|
+
subscribeToProvider(subscriptionPayload);
|
|
6281
|
+
// If we find a provider, we shouldn't continue traversing
|
|
6282
|
+
// looking for another provider.
|
|
6283
|
+
break;
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
currentNode =
|
|
6287
|
+
currentNode[HostTypeKey] === HostNodeType.Element
|
|
6288
|
+
? currentNode[HostParentKey]
|
|
6289
|
+
: currentNode[HostHostKey];
|
|
6290
|
+
} while (!isNull(currentNode));
|
|
6291
|
+
}
|
|
6292
|
+
|
|
6259
6293
|
/*
|
|
6260
6294
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
6261
6295
|
* All rights reserved.
|
|
@@ -6276,7 +6310,7 @@ function createElement$1(tagName, namespace) {
|
|
|
6276
6310
|
[HostShadowRootKey]: null,
|
|
6277
6311
|
[HostChildrenKey]: [],
|
|
6278
6312
|
[HostAttributesKey]: [],
|
|
6279
|
-
[
|
|
6313
|
+
[HostContextProvidersKey]: new Map(),
|
|
6280
6314
|
};
|
|
6281
6315
|
}
|
|
6282
6316
|
const isNativeShadowDefined = false;
|
|
@@ -6342,6 +6376,7 @@ function attachShadow(element, config) {
|
|
|
6342
6376
|
element[HostShadowRootKey] = {
|
|
6343
6377
|
[HostTypeKey]: HostNodeType.ShadowRoot,
|
|
6344
6378
|
[HostChildrenKey]: [],
|
|
6379
|
+
[HostHostKey]: element,
|
|
6345
6380
|
mode: config.mode,
|
|
6346
6381
|
delegatesFocus: !!config.delegatesFocus,
|
|
6347
6382
|
};
|
|
@@ -6538,6 +6573,7 @@ function createCustomElement(tagName, upgradeCallback) {
|
|
|
6538
6573
|
const UpgradableConstructor = getUpgradableElement(tagName);
|
|
6539
6574
|
return new UpgradableConstructor(upgradeCallback);
|
|
6540
6575
|
}
|
|
6576
|
+
const ownerDocument = unsupportedMethod('ownerDocument');
|
|
6541
6577
|
const renderer = {
|
|
6542
6578
|
isNativeShadowDefined,
|
|
6543
6579
|
isSyntheticShadowDefined,
|
|
@@ -6576,6 +6612,8 @@ const renderer = {
|
|
|
6576
6612
|
isConnected,
|
|
6577
6613
|
insertStylesheet,
|
|
6578
6614
|
assertInstanceOfHTMLElement,
|
|
6615
|
+
ownerDocument,
|
|
6616
|
+
registerContextConsumer,
|
|
6579
6617
|
};
|
|
6580
6618
|
|
|
6581
6619
|
/*
|
|
@@ -6652,7 +6690,7 @@ const FakeRootElement = {
|
|
|
6652
6690
|
[HostShadowRootKey]: null,
|
|
6653
6691
|
[HostChildrenKey]: [],
|
|
6654
6692
|
[HostAttributesKey]: [],
|
|
6655
|
-
[
|
|
6693
|
+
[HostContextProvidersKey]: new Map(),
|
|
6656
6694
|
};
|
|
6657
6695
|
function renderComponent(tagName, Ctor, props = {}) {
|
|
6658
6696
|
if (!isString(tagName)) {
|
|
@@ -6703,7 +6741,7 @@ seal(LightningElement.prototype);
|
|
|
6703
6741
|
function createElement() {
|
|
6704
6742
|
throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
|
|
6705
6743
|
}
|
|
6706
|
-
/* version: 2.
|
|
6744
|
+
/* version: 2.38.0 */
|
|
6707
6745
|
|
|
6708
6746
|
exports.LightningElement = LightningElement;
|
|
6709
6747
|
exports.api = api$1;
|
|
@@ -6728,3 +6766,4 @@ exports.setHooks = setHooks;
|
|
|
6728
6766
|
exports.track = track;
|
|
6729
6767
|
exports.unwrap = unwrap;
|
|
6730
6768
|
exports.wire = wire;
|
|
6769
|
+
//# sourceMappingURL=engine-server.js.map
|