lwc 2.5.10-alpha1 → 2.7.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 +168 -134
- package/dist/engine-dom/iife/es2017/engine-dom.js +169 -135
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +154 -133
- package/dist/engine-dom/iife/es5/engine-dom.js +185 -145
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +172 -145
- package/dist/engine-dom/umd/es2017/engine-dom.js +170 -136
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +155 -134
- package/dist/engine-dom/umd/es5/engine-dom.js +186 -146
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +173 -146
- package/dist/engine-server/commonjs/es2017/engine-server.js +179 -142
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +179 -142
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -130
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +30 -131
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +30 -131
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +37 -128
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +37 -128
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +31 -132
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +31 -132
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +38 -129
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +38 -129
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +3 -3
- package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -3
- package/dist/wire-service/iife/es5/wire-service.js +12 -12
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +12 -12
- package/dist/wire-service/umd/es2017/wire-service.js +4 -4
- package/dist/wire-service/umd/es2017/wire-service_debug.js +4 -4
- package/dist/wire-service/umd/es5/wire-service.js +13 -13
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +13 -13
- package/package.json +8 -8
- package/dist/engine/esm/es2017/engine.js +0 -7981
- package/dist/engine/iife/es2017/engine.js +0 -8013
- package/dist/engine/iife/es2017/engine.min.js +0 -9
- package/dist/engine/iife/es2017/engine_debug.js +0 -6541
- package/dist/engine/iife/es5/engine.js +0 -6060
- package/dist/engine/iife/es5/engine.min.js +0 -23
- package/dist/engine/iife/es5/engine_debug.js +0 -4856
- package/dist/engine/umd/es2017/engine.js +0 -8014
- package/dist/engine/umd/es2017/engine.min.js +0 -9
- package/dist/engine/umd/es2017/engine_debug.js +0 -6542
- package/dist/engine/umd/es5/engine.js +0 -6061
- package/dist/engine/umd/es5/engine.min.js +0 -23
- package/dist/engine/umd/es5/engine_debug.js +0 -4857
|
@@ -73,7 +73,7 @@ const {
|
|
|
73
73
|
find: ArrayFind,
|
|
74
74
|
indexOf: ArrayIndexOf,
|
|
75
75
|
join: ArrayJoin,
|
|
76
|
-
map: ArrayMap
|
|
76
|
+
map: ArrayMap,
|
|
77
77
|
push: ArrayPush$1,
|
|
78
78
|
reduce: ArrayReduce,
|
|
79
79
|
reverse: ArrayReverse,
|
|
@@ -140,7 +140,7 @@ function toString$1(obj) {
|
|
|
140
140
|
// Array.prototype.toString directly will cause an error Iterate through
|
|
141
141
|
// all the items and handle individually.
|
|
142
142
|
if (isArray$1(obj)) {
|
|
143
|
-
return ArrayJoin.call(ArrayMap
|
|
143
|
+
return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
return obj.toString();
|
|
@@ -339,7 +339,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
339
339
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
340
340
|
return attributeName;
|
|
341
341
|
}
|
|
342
|
-
/** version: 2.
|
|
342
|
+
/** version: 2.7.0 */
|
|
343
343
|
|
|
344
344
|
/*
|
|
345
345
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -352,25 +352,28 @@ function htmlPropertyToAttribute(propName) {
|
|
|
352
352
|
* The following constructor might be used in either the constructor or the connectedCallback. In
|
|
353
353
|
* order to ensure that the component evaluates, we attach those mock constructors to the global
|
|
354
354
|
* object.
|
|
355
|
+
* Also note that Event is defined in Node 16+, but CustomEvent is not, so they have to be
|
|
356
|
+
* polyfilled separately.
|
|
355
357
|
*/
|
|
356
358
|
|
|
357
359
|
|
|
358
|
-
if (typeof Event !== 'function'
|
|
360
|
+
if (typeof Event !== 'function') {
|
|
359
361
|
class Event {}
|
|
360
362
|
|
|
363
|
+
defineProperty(_globalThis, 'Event', {
|
|
364
|
+
value: Event,
|
|
365
|
+
configurable: true,
|
|
366
|
+
writable: true
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (typeof CustomEvent !== 'function') {
|
|
361
371
|
class CustomEvent extends Event {}
|
|
362
372
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
writable: true
|
|
368
|
-
},
|
|
369
|
-
CustomEvent: {
|
|
370
|
-
value: CustomEvent,
|
|
371
|
-
configurable: true,
|
|
372
|
-
writable: true
|
|
373
|
-
}
|
|
373
|
+
defineProperty(_globalThis, 'CustomEvent', {
|
|
374
|
+
value: CustomEvent,
|
|
375
|
+
configurable: true,
|
|
376
|
+
writable: true
|
|
374
377
|
});
|
|
375
378
|
}
|
|
376
379
|
/**
|
|
@@ -394,7 +397,6 @@ const features = {
|
|
|
394
397
|
ENABLE_NODE_LIST_PATCH: null,
|
|
395
398
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
396
399
|
ENABLE_NODE_PATCH: null,
|
|
397
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
398
400
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
399
401
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
400
402
|
};
|
|
@@ -460,7 +462,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
460
462
|
setFeatureFlag(name, value);
|
|
461
463
|
}
|
|
462
464
|
}
|
|
463
|
-
/** version: 2.
|
|
465
|
+
/** version: 2.7.0 */
|
|
464
466
|
|
|
465
467
|
/* proxy-compat-disable */
|
|
466
468
|
|
|
@@ -1907,10 +1909,10 @@ const {
|
|
|
1907
1909
|
isArray
|
|
1908
1910
|
} = Array;
|
|
1909
1911
|
const {
|
|
1912
|
+
prototype: ObjectDotPrototype,
|
|
1910
1913
|
getPrototypeOf,
|
|
1911
1914
|
create: ObjectCreate,
|
|
1912
1915
|
defineProperty: ObjectDefineProperty,
|
|
1913
|
-
defineProperties: ObjectDefineProperties,
|
|
1914
1916
|
isExtensible,
|
|
1915
1917
|
getOwnPropertyDescriptor,
|
|
1916
1918
|
getOwnPropertyNames,
|
|
@@ -1920,8 +1922,7 @@ const {
|
|
|
1920
1922
|
} = Object;
|
|
1921
1923
|
const {
|
|
1922
1924
|
push: ArrayPush,
|
|
1923
|
-
concat: ArrayConcat
|
|
1924
|
-
map: ArrayMap
|
|
1925
|
+
concat: ArrayConcat
|
|
1925
1926
|
} = Array.prototype;
|
|
1926
1927
|
const OtS = {}.toString;
|
|
1927
1928
|
|
|
@@ -1986,7 +1987,9 @@ class BaseProxyHandler {
|
|
|
1986
1987
|
// but it will always be compatible with the previous descriptor
|
|
1987
1988
|
// to preserve the object invariants, which makes these lines safe.
|
|
1988
1989
|
|
|
1989
|
-
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
|
|
1990
|
+
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
|
|
1991
|
+
|
|
1992
|
+
/* istanbul ignore else */
|
|
1990
1993
|
|
|
1991
1994
|
if (!isUndefined(originalDescriptor)) {
|
|
1992
1995
|
const wrappedDesc = this.wrapDescriptor(originalDescriptor);
|
|
@@ -2014,11 +2017,17 @@ class BaseProxyHandler {
|
|
|
2014
2017
|
|
|
2015
2018
|
preventExtensions(shadowTarget);
|
|
2016
2019
|
} // Shared Traps
|
|
2020
|
+
// TODO: apply() is never called
|
|
2021
|
+
|
|
2022
|
+
/* istanbul ignore next */
|
|
2017
2023
|
|
|
2018
2024
|
|
|
2019
2025
|
apply(shadowTarget, thisArg, argArray) {
|
|
2020
2026
|
/* No op */
|
|
2021
|
-
}
|
|
2027
|
+
} // TODO: construct() is never called
|
|
2028
|
+
|
|
2029
|
+
/* istanbul ignore next */
|
|
2030
|
+
|
|
2022
2031
|
|
|
2023
2032
|
construct(shadowTarget, argArray, newTarget) {
|
|
2024
2033
|
/* No op */
|
|
@@ -2131,8 +2140,8 @@ class BaseProxyHandler {
|
|
|
2131
2140
|
|
|
2132
2141
|
}
|
|
2133
2142
|
|
|
2134
|
-
const getterMap = new WeakMap();
|
|
2135
|
-
const setterMap = new WeakMap();
|
|
2143
|
+
const getterMap$1 = new WeakMap();
|
|
2144
|
+
const setterMap$1 = new WeakMap();
|
|
2136
2145
|
const reverseGetterMap = new WeakMap();
|
|
2137
2146
|
const reverseSetterMap = new WeakMap();
|
|
2138
2147
|
|
|
@@ -2142,7 +2151,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2142
2151
|
}
|
|
2143
2152
|
|
|
2144
2153
|
wrapGetter(originalGet) {
|
|
2145
|
-
const wrappedGetter = getterMap.get(originalGet);
|
|
2154
|
+
const wrappedGetter = getterMap$1.get(originalGet);
|
|
2146
2155
|
|
|
2147
2156
|
if (!isUndefined(wrappedGetter)) {
|
|
2148
2157
|
return wrappedGetter;
|
|
@@ -2155,13 +2164,13 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2155
2164
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2156
2165
|
};
|
|
2157
2166
|
|
|
2158
|
-
getterMap.set(originalGet, get);
|
|
2167
|
+
getterMap$1.set(originalGet, get);
|
|
2159
2168
|
reverseGetterMap.set(get, originalGet);
|
|
2160
2169
|
return get;
|
|
2161
2170
|
}
|
|
2162
2171
|
|
|
2163
2172
|
wrapSetter(originalSet) {
|
|
2164
|
-
const wrappedSetter = setterMap.get(originalSet);
|
|
2173
|
+
const wrappedSetter = setterMap$1.get(originalSet);
|
|
2165
2174
|
|
|
2166
2175
|
if (!isUndefined(wrappedSetter)) {
|
|
2167
2176
|
return wrappedSetter;
|
|
@@ -2172,7 +2181,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2172
2181
|
originalSet.call(unwrap$1(this), unwrap$1(v));
|
|
2173
2182
|
};
|
|
2174
2183
|
|
|
2175
|
-
setterMap.set(originalSet, set);
|
|
2184
|
+
setterMap$1.set(originalSet, set);
|
|
2176
2185
|
reverseSetterMap.set(set, originalSet);
|
|
2177
2186
|
return set;
|
|
2178
2187
|
}
|
|
@@ -2213,7 +2222,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2213
2222
|
return unwrap$1(redGet.call(handler.wrapValue(this)));
|
|
2214
2223
|
};
|
|
2215
2224
|
|
|
2216
|
-
getterMap.set(get, redGet);
|
|
2225
|
+
getterMap$1.set(get, redGet);
|
|
2217
2226
|
reverseGetterMap.set(redGet, get);
|
|
2218
2227
|
return get;
|
|
2219
2228
|
}
|
|
@@ -2232,7 +2241,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2232
2241
|
redSet.call(handler.wrapValue(this), handler.wrapValue(v));
|
|
2233
2242
|
};
|
|
2234
2243
|
|
|
2235
|
-
setterMap.set(set, redSet);
|
|
2244
|
+
setterMap$1.set(set, redSet);
|
|
2236
2245
|
reverseSetterMap.set(redSet, set);
|
|
2237
2246
|
return set;
|
|
2238
2247
|
}
|
|
@@ -2273,6 +2282,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2273
2282
|
}
|
|
2274
2283
|
|
|
2275
2284
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2285
|
+
/* istanbul ignore else */
|
|
2276
2286
|
if (process.env.NODE_ENV !== 'production') {
|
|
2277
2287
|
throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
|
|
2278
2288
|
}
|
|
@@ -2286,6 +2296,11 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2286
2296
|
preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
|
|
2287
2297
|
// the preventExtension call, in which case we should not attempt to lock down
|
|
2288
2298
|
// the shadow target.
|
|
2299
|
+
// TODO: It should not actually be possible to reach this `if` statement.
|
|
2300
|
+
// If a proxy rejects extensions, then calling preventExtensions will throw an error:
|
|
2301
|
+
// https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
|
|
2302
|
+
|
|
2303
|
+
/* istanbul ignore if */
|
|
2289
2304
|
|
|
2290
2305
|
if (isExtensible(originalTarget)) {
|
|
2291
2306
|
return false;
|
|
@@ -2327,8 +2342,8 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2327
2342
|
|
|
2328
2343
|
}
|
|
2329
2344
|
|
|
2330
|
-
const getterMap
|
|
2331
|
-
const setterMap
|
|
2345
|
+
const getterMap = new WeakMap();
|
|
2346
|
+
const setterMap = new WeakMap();
|
|
2332
2347
|
|
|
2333
2348
|
class ReadOnlyHandler extends BaseProxyHandler {
|
|
2334
2349
|
wrapValue(value) {
|
|
@@ -2336,7 +2351,7 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2336
2351
|
}
|
|
2337
2352
|
|
|
2338
2353
|
wrapGetter(originalGet) {
|
|
2339
|
-
const wrappedGetter = getterMap
|
|
2354
|
+
const wrappedGetter = getterMap.get(originalGet);
|
|
2340
2355
|
|
|
2341
2356
|
if (!isUndefined(wrappedGetter)) {
|
|
2342
2357
|
return wrappedGetter;
|
|
@@ -2349,12 +2364,12 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2349
2364
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2350
2365
|
};
|
|
2351
2366
|
|
|
2352
|
-
getterMap
|
|
2367
|
+
getterMap.set(originalGet, get);
|
|
2353
2368
|
return get;
|
|
2354
2369
|
}
|
|
2355
2370
|
|
|
2356
2371
|
wrapSetter(originalSet) {
|
|
2357
|
-
const wrappedSetter = setterMap
|
|
2372
|
+
const wrappedSetter = setterMap.get(originalSet);
|
|
2358
2373
|
|
|
2359
2374
|
if (!isUndefined(wrappedSetter)) {
|
|
2360
2375
|
return wrappedSetter;
|
|
@@ -2363,6 +2378,7 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2363
2378
|
const handler = this;
|
|
2364
2379
|
|
|
2365
2380
|
const set = function (v) {
|
|
2381
|
+
/* istanbul ignore else */
|
|
2366
2382
|
if (process.env.NODE_ENV !== 'production') {
|
|
2367
2383
|
const {
|
|
2368
2384
|
originalTarget
|
|
@@ -2371,33 +2387,41 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2371
2387
|
}
|
|
2372
2388
|
};
|
|
2373
2389
|
|
|
2374
|
-
setterMap
|
|
2390
|
+
setterMap.set(originalSet, set);
|
|
2375
2391
|
return set;
|
|
2376
2392
|
}
|
|
2377
2393
|
|
|
2378
2394
|
set(shadowTarget, key, value) {
|
|
2395
|
+
/* istanbul ignore else */
|
|
2379
2396
|
if (process.env.NODE_ENV !== 'production') {
|
|
2380
2397
|
const {
|
|
2381
2398
|
originalTarget
|
|
2382
2399
|
} = this;
|
|
2383
|
-
|
|
2400
|
+
const msg = isArray(originalTarget) ? `Invalid mutation: Cannot mutate array at index ${key.toString()}. Array is read-only.` : `Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`;
|
|
2401
|
+
throw new Error(msg);
|
|
2384
2402
|
}
|
|
2403
|
+
/* istanbul ignore next */
|
|
2404
|
+
|
|
2385
2405
|
|
|
2386
2406
|
return false;
|
|
2387
2407
|
}
|
|
2388
2408
|
|
|
2389
2409
|
deleteProperty(shadowTarget, key) {
|
|
2410
|
+
/* istanbul ignore else */
|
|
2390
2411
|
if (process.env.NODE_ENV !== 'production') {
|
|
2391
2412
|
const {
|
|
2392
2413
|
originalTarget
|
|
2393
2414
|
} = this;
|
|
2394
2415
|
throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2395
2416
|
}
|
|
2417
|
+
/* istanbul ignore next */
|
|
2418
|
+
|
|
2396
2419
|
|
|
2397
2420
|
return false;
|
|
2398
2421
|
}
|
|
2399
2422
|
|
|
2400
2423
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2424
|
+
/* istanbul ignore else */
|
|
2401
2425
|
if (process.env.NODE_ENV !== 'production') {
|
|
2402
2426
|
const {
|
|
2403
2427
|
originalTarget
|
|
@@ -2407,23 +2431,29 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2407
2431
|
}
|
|
2408
2432
|
|
|
2409
2433
|
preventExtensions(shadowTarget) {
|
|
2434
|
+
/* istanbul ignore else */
|
|
2410
2435
|
if (process.env.NODE_ENV !== 'production') {
|
|
2411
2436
|
const {
|
|
2412
2437
|
originalTarget
|
|
2413
2438
|
} = this;
|
|
2414
2439
|
throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
|
|
2415
2440
|
}
|
|
2441
|
+
/* istanbul ignore next */
|
|
2442
|
+
|
|
2416
2443
|
|
|
2417
2444
|
return false;
|
|
2418
2445
|
}
|
|
2419
2446
|
|
|
2420
2447
|
defineProperty(shadowTarget, key, descriptor) {
|
|
2448
|
+
/* istanbul ignore else */
|
|
2421
2449
|
if (process.env.NODE_ENV !== 'production') {
|
|
2422
2450
|
const {
|
|
2423
2451
|
originalTarget
|
|
2424
2452
|
} = this;
|
|
2425
2453
|
throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2426
2454
|
}
|
|
2455
|
+
/* istanbul ignore next */
|
|
2456
|
+
|
|
2427
2457
|
|
|
2428
2458
|
return false;
|
|
2429
2459
|
}
|
|
@@ -2481,6 +2511,8 @@ const formatter = {
|
|
|
2481
2511
|
}; // Inspired from paulmillr/es6-shim
|
|
2482
2512
|
// https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
|
|
2483
2513
|
|
|
2514
|
+
/* istanbul ignore next */
|
|
2515
|
+
|
|
2484
2516
|
function getGlobal() {
|
|
2485
2517
|
// the only reliable means to get the global object is `Function('return this')()`
|
|
2486
2518
|
// However, this causes CSP violations in Chrome apps.
|
|
@@ -2505,6 +2537,7 @@ function getGlobal() {
|
|
|
2505
2537
|
}
|
|
2506
2538
|
|
|
2507
2539
|
function init() {
|
|
2540
|
+
/* istanbul ignore if */
|
|
2508
2541
|
if (process.env.NODE_ENV === 'production') {
|
|
2509
2542
|
// this method should never leak to prod
|
|
2510
2543
|
throw new ReferenceError();
|
|
@@ -2519,13 +2552,13 @@ function init() {
|
|
|
2519
2552
|
ArrayPush.call(devtoolsFormatters, formatter);
|
|
2520
2553
|
global.devtoolsFormatters = devtoolsFormatters;
|
|
2521
2554
|
}
|
|
2555
|
+
/* istanbul ignore else */
|
|
2556
|
+
|
|
2522
2557
|
|
|
2523
2558
|
if (process.env.NODE_ENV !== 'production') {
|
|
2524
2559
|
init();
|
|
2525
2560
|
}
|
|
2526
2561
|
|
|
2527
|
-
const ObjectDotPrototype = Object.prototype;
|
|
2528
|
-
|
|
2529
2562
|
function defaultValueIsObservable(value) {
|
|
2530
2563
|
// intentionally checking for null
|
|
2531
2564
|
if (value === null) {
|
|
@@ -2553,106 +2586,85 @@ const defaultValueMutated = (obj, key) => {
|
|
|
2553
2586
|
/* do nothing */
|
|
2554
2587
|
};
|
|
2555
2588
|
|
|
2556
|
-
const defaultValueDistortion = value => value;
|
|
2557
|
-
|
|
2558
2589
|
function createShadowTarget(value) {
|
|
2559
2590
|
return isArray(value) ? [] : {};
|
|
2560
2591
|
}
|
|
2561
2592
|
|
|
2562
|
-
class
|
|
2563
|
-
constructor(options) {
|
|
2564
|
-
this.
|
|
2565
|
-
this.
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
tagPropertyKey
|
|
2577
|
-
} = options;
|
|
2578
|
-
this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
|
|
2579
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2580
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2581
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2582
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2583
|
-
}
|
|
2593
|
+
class ObservableMembrane {
|
|
2594
|
+
constructor(options = {}) {
|
|
2595
|
+
this.readOnlyObjectGraph = new WeakMap();
|
|
2596
|
+
this.reactiveObjectGraph = new WeakMap();
|
|
2597
|
+
const {
|
|
2598
|
+
valueMutated,
|
|
2599
|
+
valueObserved,
|
|
2600
|
+
valueIsObservable,
|
|
2601
|
+
tagPropertyKey
|
|
2602
|
+
} = options;
|
|
2603
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2604
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2605
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2606
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2584
2607
|
}
|
|
2585
2608
|
|
|
2586
2609
|
getProxy(value) {
|
|
2587
2610
|
const unwrappedValue = unwrap$1(value);
|
|
2588
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2589
2611
|
|
|
2590
|
-
if (this.valueIsObservable(
|
|
2591
|
-
|
|
2592
|
-
|
|
2612
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2613
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2614
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2615
|
+
return value;
|
|
2616
|
+
}
|
|
2593
2617
|
|
|
2594
|
-
return
|
|
2618
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2595
2619
|
}
|
|
2596
2620
|
|
|
2597
|
-
return
|
|
2621
|
+
return unwrappedValue;
|
|
2598
2622
|
}
|
|
2599
2623
|
|
|
2600
2624
|
getReadOnlyProxy(value) {
|
|
2601
2625
|
value = unwrap$1(value);
|
|
2602
|
-
const distorted = this.valueDistortion(value);
|
|
2603
2626
|
|
|
2604
|
-
if (this.valueIsObservable(
|
|
2605
|
-
return this.
|
|
2627
|
+
if (this.valueIsObservable(value)) {
|
|
2628
|
+
return this.getReadOnlyHandler(value);
|
|
2606
2629
|
}
|
|
2607
2630
|
|
|
2608
|
-
return
|
|
2631
|
+
return value;
|
|
2609
2632
|
}
|
|
2610
2633
|
|
|
2611
2634
|
unwrapProxy(p) {
|
|
2612
2635
|
return unwrap$1(p);
|
|
2613
2636
|
}
|
|
2614
2637
|
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
objectGraph
|
|
2618
|
-
} = this;
|
|
2619
|
-
let reactiveState = objectGraph.get(distortedValue);
|
|
2638
|
+
getReactiveHandler(value) {
|
|
2639
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2620
2640
|
|
|
2621
|
-
if (
|
|
2622
|
-
|
|
2641
|
+
if (isUndefined(proxy)) {
|
|
2642
|
+
// caching the proxy after the first time it is accessed
|
|
2643
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2644
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2645
|
+
registerProxy(proxy, value);
|
|
2646
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2623
2647
|
}
|
|
2624
2648
|
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
get reactive() {
|
|
2628
|
-
const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
|
|
2629
|
-
|
|
2630
|
-
const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
|
|
2631
|
-
registerProxy(proxy, value);
|
|
2632
|
-
ObjectDefineProperty(this, 'reactive', {
|
|
2633
|
-
value: proxy
|
|
2634
|
-
});
|
|
2635
|
-
return proxy;
|
|
2636
|
-
},
|
|
2649
|
+
return proxy;
|
|
2650
|
+
}
|
|
2637
2651
|
|
|
2638
|
-
|
|
2639
|
-
|
|
2652
|
+
getReadOnlyHandler(value) {
|
|
2653
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2640
2654
|
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2655
|
+
if (isUndefined(proxy)) {
|
|
2656
|
+
// caching the proxy after the first time it is accessed
|
|
2657
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2658
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2659
|
+
registerProxy(proxy, value);
|
|
2660
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2661
|
+
}
|
|
2648
2662
|
|
|
2649
|
-
|
|
2650
|
-
objectGraph.set(distortedValue, reactiveState);
|
|
2651
|
-
return reactiveState;
|
|
2663
|
+
return proxy;
|
|
2652
2664
|
}
|
|
2653
2665
|
|
|
2654
2666
|
}
|
|
2655
|
-
/** version:
|
|
2667
|
+
/** version: 2.0.0 */
|
|
2656
2668
|
|
|
2657
2669
|
/*
|
|
2658
2670
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2663,15 +2675,9 @@ class ReactiveMembrane {
|
|
|
2663
2675
|
|
|
2664
2676
|
|
|
2665
2677
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2666
|
-
|
|
2667
|
-
function valueDistortion(value) {
|
|
2668
|
-
return value;
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2678
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2672
2679
|
valueObserved,
|
|
2673
2680
|
valueMutated,
|
|
2674
|
-
valueDistortion,
|
|
2675
2681
|
tagPropertyKey: lockerLivePropertyKey
|
|
2676
2682
|
});
|
|
2677
2683
|
/**
|
|
@@ -2680,16 +2686,9 @@ const reactiveMembrane = new ReactiveMembrane({
|
|
|
2680
2686
|
* change or being removed.
|
|
2681
2687
|
*/
|
|
2682
2688
|
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
if (unwrapped !== value) {
|
|
2687
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2688
|
-
return valueDistortion(unwrapped);
|
|
2689
|
-
}
|
|
2690
|
-
|
|
2691
|
-
return value;
|
|
2692
|
-
};
|
|
2689
|
+
function unwrap(value) {
|
|
2690
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2691
|
+
}
|
|
2693
2692
|
/*
|
|
2694
2693
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2695
2694
|
* All rights reserved.
|
|
@@ -4554,13 +4553,15 @@ function updateElmHook(oldVnode, vnode) {
|
|
|
4554
4553
|
|
|
4555
4554
|
function updateChildrenHook(oldVnode, vnode) {
|
|
4556
4555
|
const {
|
|
4557
|
-
|
|
4558
|
-
|
|
4556
|
+
elm,
|
|
4557
|
+
children
|
|
4559
4558
|
} = vnode;
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
}
|
|
4559
|
+
|
|
4560
|
+
if (hasDynamicChildren(children)) {
|
|
4561
|
+
updateDynamicChildren(elm, oldVnode.children, children);
|
|
4562
|
+
} else {
|
|
4563
|
+
updateStaticChildren(elm, oldVnode.children, children);
|
|
4564
|
+
}
|
|
4564
4565
|
}
|
|
4565
4566
|
|
|
4566
4567
|
function allocateChildrenHook(vnode, vm) {
|
|
@@ -5798,6 +5799,7 @@ function updateStylesheetToken(vm, template) {
|
|
|
5798
5799
|
|
|
5799
5800
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5800
5801
|
const content = [];
|
|
5802
|
+
let root;
|
|
5801
5803
|
|
|
5802
5804
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5803
5805
|
let stylesheet = stylesheets[i];
|
|
@@ -5810,23 +5812,46 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
5810
5812
|
// the component instance might be attempting to use an old version of
|
|
5811
5813
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5812
5814
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5813
|
-
}
|
|
5814
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5815
|
+
}
|
|
5815
5816
|
|
|
5817
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5818
|
+
|
|
5819
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5820
|
+
/* Synthetic */
|
|
5821
|
+
&& vm.renderMode === 1
|
|
5822
|
+
/* Shadow */
|
|
5823
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5824
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5816
5825
|
|
|
5817
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5818
5826
|
const useActualHostSelector = vm.renderMode === 0
|
|
5819
5827
|
/* Light */
|
|
5820
5828
|
? !isScopedCss : vm.shadowMode === 0
|
|
5821
5829
|
/* Native */
|
|
5822
|
-
; //
|
|
5830
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
5831
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
5823
5832
|
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5833
|
+
let useNativeDirPseudoclass;
|
|
5834
|
+
|
|
5835
|
+
if (vm.renderMode === 1
|
|
5827
5836
|
/* Shadow */
|
|
5828
|
-
|
|
5829
|
-
|
|
5837
|
+
) {
|
|
5838
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
5839
|
+
/* Native */
|
|
5840
|
+
;
|
|
5841
|
+
} else {
|
|
5842
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5843
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5844
|
+
if (isUndefined$1(root)) {
|
|
5845
|
+
// Only calculate the root once as necessary
|
|
5846
|
+
root = getNearestShadowComponent(vm);
|
|
5847
|
+
}
|
|
5848
|
+
|
|
5849
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
5850
|
+
/* Native */
|
|
5851
|
+
;
|
|
5852
|
+
}
|
|
5853
|
+
|
|
5854
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5830
5855
|
}
|
|
5831
5856
|
}
|
|
5832
5857
|
|
|
@@ -5850,14 +5875,12 @@ function getStylesheetsContent(vm, template) {
|
|
|
5850
5875
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
5851
5876
|
|
|
5852
5877
|
|
|
5853
|
-
function
|
|
5878
|
+
function getNearestShadowComponent(vm) {
|
|
5854
5879
|
let owner = vm;
|
|
5855
5880
|
|
|
5856
5881
|
while (!isNull(owner)) {
|
|
5857
5882
|
if (owner.renderMode === 1
|
|
5858
5883
|
/* Shadow */
|
|
5859
|
-
&& owner.shadowMode === 0
|
|
5860
|
-
/* Native */
|
|
5861
5884
|
) {
|
|
5862
5885
|
return owner;
|
|
5863
5886
|
}
|
|
@@ -5868,6 +5891,20 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
5868
5891
|
return owner;
|
|
5869
5892
|
}
|
|
5870
5893
|
|
|
5894
|
+
function getNearestNativeShadowComponent(vm) {
|
|
5895
|
+
const owner = getNearestShadowComponent(vm);
|
|
5896
|
+
|
|
5897
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
5898
|
+
/* Synthetic */
|
|
5899
|
+
) {
|
|
5900
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
5901
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
5902
|
+
return null;
|
|
5903
|
+
}
|
|
5904
|
+
|
|
5905
|
+
return owner;
|
|
5906
|
+
}
|
|
5907
|
+
|
|
5871
5908
|
function createStylesheet(vm, stylesheets) {
|
|
5872
5909
|
const {
|
|
5873
5910
|
renderer,
|
|
@@ -7532,7 +7569,7 @@ function setHooks(hooks) {
|
|
|
7532
7569
|
hooksAreSet = true;
|
|
7533
7570
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7534
7571
|
}
|
|
7535
|
-
/* version: 2.
|
|
7572
|
+
/* version: 2.7.0 */
|
|
7536
7573
|
|
|
7537
7574
|
/*
|
|
7538
7575
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -8028,7 +8065,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8028
8065
|
|
|
8029
8066
|
freeze(LightningElement);
|
|
8030
8067
|
seal(LightningElement.prototype);
|
|
8031
|
-
/* version: 2.
|
|
8068
|
+
/* version: 2.7.0 */
|
|
8032
8069
|
|
|
8033
8070
|
exports.LightningElement = LightningElement;
|
|
8034
8071
|
exports.api = api$1;
|