lwc 2.5.9 → 2.5.10-alpha1
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/esm/es2017/engine.js +7981 -0
- package/dist/engine/iife/es2017/engine.js +8013 -0
- package/dist/engine/iife/es2017/engine.min.js +9 -0
- package/dist/engine/iife/es2017/engine_debug.js +6541 -0
- package/dist/engine/iife/es5/engine.js +6060 -0
- package/dist/engine/iife/es5/engine.min.js +23 -0
- package/dist/engine/iife/es5/engine_debug.js +4856 -0
- package/dist/engine/umd/es2017/engine.js +8014 -0
- package/dist/engine/umd/es2017/engine.min.js +9 -0
- package/dist/engine/umd/es2017/engine_debug.js +6542 -0
- package/dist/engine/umd/es5/engine.js +6061 -0
- package/dist/engine/umd/es5/engine.min.js +23 -0
- package/dist/engine/umd/es5/engine_debug.js +4857 -0
- package/dist/engine-dom/esm/es2017/engine-dom.js +75 -136
- package/dist/engine-dom/iife/es2017/engine-dom.js +76 -137
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +74 -122
- package/dist/engine-dom/iife/es5/engine-dom.js +75 -142
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +73 -127
- package/dist/engine-dom/umd/es2017/engine-dom.js +77 -138
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +75 -123
- package/dist/engine-dom/umd/es5/engine-dom.js +76 -143
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +74 -128
- package/dist/engine-server/commonjs/es2017/engine-server.js +75 -136
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +75 -136
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +5 -5
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +5 -5
- 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 +3 -3
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
- 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 +4 -4
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +4 -4
- package/package.json +8 -8
|
@@ -73,7 +73,7 @@ const {
|
|
|
73
73
|
find: ArrayFind,
|
|
74
74
|
indexOf: ArrayIndexOf,
|
|
75
75
|
join: ArrayJoin,
|
|
76
|
-
map: ArrayMap,
|
|
76
|
+
map: ArrayMap$1,
|
|
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.call(obj, toString$1), ',');
|
|
143
|
+
return ArrayJoin.call(ArrayMap$1.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.5.
|
|
342
|
+
/** version: 2.5.10-alpha1 */
|
|
343
343
|
|
|
344
344
|
/*
|
|
345
345
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -460,7 +460,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
460
460
|
setFeatureFlag(name, value);
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
/** version: 2.5.
|
|
463
|
+
/** version: 2.5.10-alpha1 */
|
|
464
464
|
|
|
465
465
|
/* proxy-compat-disable */
|
|
466
466
|
|
|
@@ -1910,6 +1910,7 @@ const {
|
|
|
1910
1910
|
getPrototypeOf,
|
|
1911
1911
|
create: ObjectCreate,
|
|
1912
1912
|
defineProperty: ObjectDefineProperty,
|
|
1913
|
+
defineProperties: ObjectDefineProperties,
|
|
1913
1914
|
isExtensible,
|
|
1914
1915
|
getOwnPropertyDescriptor,
|
|
1915
1916
|
getOwnPropertyNames,
|
|
@@ -1919,7 +1920,8 @@ const {
|
|
|
1919
1920
|
} = Object;
|
|
1920
1921
|
const {
|
|
1921
1922
|
push: ArrayPush,
|
|
1922
|
-
concat: ArrayConcat
|
|
1923
|
+
concat: ArrayConcat,
|
|
1924
|
+
map: ArrayMap
|
|
1923
1925
|
} = Array.prototype;
|
|
1924
1926
|
const OtS = {}.toString;
|
|
1925
1927
|
|
|
@@ -1984,9 +1986,7 @@ class BaseProxyHandler {
|
|
|
1984
1986
|
// but it will always be compatible with the previous descriptor
|
|
1985
1987
|
// to preserve the object invariants, which makes these lines safe.
|
|
1986
1988
|
|
|
1987
|
-
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
|
|
1988
|
-
|
|
1989
|
-
/* istanbul ignore else */
|
|
1989
|
+
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
|
|
1990
1990
|
|
|
1991
1991
|
if (!isUndefined(originalDescriptor)) {
|
|
1992
1992
|
const wrappedDesc = this.wrapDescriptor(originalDescriptor);
|
|
@@ -2014,17 +2014,11 @@ class BaseProxyHandler {
|
|
|
2014
2014
|
|
|
2015
2015
|
preventExtensions(shadowTarget);
|
|
2016
2016
|
} // Shared Traps
|
|
2017
|
-
// TODO: apply() is never called
|
|
2018
|
-
|
|
2019
|
-
/* istanbul ignore next */
|
|
2020
2017
|
|
|
2021
2018
|
|
|
2022
2019
|
apply(shadowTarget, thisArg, argArray) {
|
|
2023
2020
|
/* No op */
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
/* istanbul ignore next */
|
|
2027
|
-
|
|
2021
|
+
}
|
|
2028
2022
|
|
|
2029
2023
|
construct(shadowTarget, argArray, newTarget) {
|
|
2030
2024
|
/* No op */
|
|
@@ -2137,8 +2131,8 @@ class BaseProxyHandler {
|
|
|
2137
2131
|
|
|
2138
2132
|
}
|
|
2139
2133
|
|
|
2140
|
-
const getterMap
|
|
2141
|
-
const setterMap
|
|
2134
|
+
const getterMap = new WeakMap();
|
|
2135
|
+
const setterMap = new WeakMap();
|
|
2142
2136
|
const reverseGetterMap = new WeakMap();
|
|
2143
2137
|
const reverseSetterMap = new WeakMap();
|
|
2144
2138
|
|
|
@@ -2148,7 +2142,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2148
2142
|
}
|
|
2149
2143
|
|
|
2150
2144
|
wrapGetter(originalGet) {
|
|
2151
|
-
const wrappedGetter = getterMap
|
|
2145
|
+
const wrappedGetter = getterMap.get(originalGet);
|
|
2152
2146
|
|
|
2153
2147
|
if (!isUndefined(wrappedGetter)) {
|
|
2154
2148
|
return wrappedGetter;
|
|
@@ -2161,13 +2155,13 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2161
2155
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2162
2156
|
};
|
|
2163
2157
|
|
|
2164
|
-
getterMap
|
|
2158
|
+
getterMap.set(originalGet, get);
|
|
2165
2159
|
reverseGetterMap.set(get, originalGet);
|
|
2166
2160
|
return get;
|
|
2167
2161
|
}
|
|
2168
2162
|
|
|
2169
2163
|
wrapSetter(originalSet) {
|
|
2170
|
-
const wrappedSetter = setterMap
|
|
2164
|
+
const wrappedSetter = setterMap.get(originalSet);
|
|
2171
2165
|
|
|
2172
2166
|
if (!isUndefined(wrappedSetter)) {
|
|
2173
2167
|
return wrappedSetter;
|
|
@@ -2178,7 +2172,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2178
2172
|
originalSet.call(unwrap$1(this), unwrap$1(v));
|
|
2179
2173
|
};
|
|
2180
2174
|
|
|
2181
|
-
setterMap
|
|
2175
|
+
setterMap.set(originalSet, set);
|
|
2182
2176
|
reverseSetterMap.set(set, originalSet);
|
|
2183
2177
|
return set;
|
|
2184
2178
|
}
|
|
@@ -2219,7 +2213,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2219
2213
|
return unwrap$1(redGet.call(handler.wrapValue(this)));
|
|
2220
2214
|
};
|
|
2221
2215
|
|
|
2222
|
-
getterMap
|
|
2216
|
+
getterMap.set(get, redGet);
|
|
2223
2217
|
reverseGetterMap.set(redGet, get);
|
|
2224
2218
|
return get;
|
|
2225
2219
|
}
|
|
@@ -2238,7 +2232,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2238
2232
|
redSet.call(handler.wrapValue(this), handler.wrapValue(v));
|
|
2239
2233
|
};
|
|
2240
2234
|
|
|
2241
|
-
setterMap
|
|
2235
|
+
setterMap.set(set, redSet);
|
|
2242
2236
|
reverseSetterMap.set(redSet, set);
|
|
2243
2237
|
return set;
|
|
2244
2238
|
}
|
|
@@ -2279,7 +2273,6 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2279
2273
|
}
|
|
2280
2274
|
|
|
2281
2275
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2282
|
-
/* istanbul ignore else */
|
|
2283
2276
|
if (process.env.NODE_ENV !== 'production') {
|
|
2284
2277
|
throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
|
|
2285
2278
|
}
|
|
@@ -2293,11 +2286,6 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2293
2286
|
preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
|
|
2294
2287
|
// the preventExtension call, in which case we should not attempt to lock down
|
|
2295
2288
|
// the shadow target.
|
|
2296
|
-
// TODO: It should not actually be possible to reach this `if` statement.
|
|
2297
|
-
// If a proxy rejects extensions, then calling preventExtensions will throw an error:
|
|
2298
|
-
// https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
|
|
2299
|
-
|
|
2300
|
-
/* istanbul ignore if */
|
|
2301
2289
|
|
|
2302
2290
|
if (isExtensible(originalTarget)) {
|
|
2303
2291
|
return false;
|
|
@@ -2339,8 +2327,8 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2339
2327
|
|
|
2340
2328
|
}
|
|
2341
2329
|
|
|
2342
|
-
const getterMap = new WeakMap();
|
|
2343
|
-
const setterMap = new WeakMap();
|
|
2330
|
+
const getterMap$1 = new WeakMap();
|
|
2331
|
+
const setterMap$1 = new WeakMap();
|
|
2344
2332
|
|
|
2345
2333
|
class ReadOnlyHandler extends BaseProxyHandler {
|
|
2346
2334
|
wrapValue(value) {
|
|
@@ -2348,7 +2336,7 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2348
2336
|
}
|
|
2349
2337
|
|
|
2350
2338
|
wrapGetter(originalGet) {
|
|
2351
|
-
const wrappedGetter = getterMap.get(originalGet);
|
|
2339
|
+
const wrappedGetter = getterMap$1.get(originalGet);
|
|
2352
2340
|
|
|
2353
2341
|
if (!isUndefined(wrappedGetter)) {
|
|
2354
2342
|
return wrappedGetter;
|
|
@@ -2361,12 +2349,12 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2361
2349
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2362
2350
|
};
|
|
2363
2351
|
|
|
2364
|
-
getterMap.set(originalGet, get);
|
|
2352
|
+
getterMap$1.set(originalGet, get);
|
|
2365
2353
|
return get;
|
|
2366
2354
|
}
|
|
2367
2355
|
|
|
2368
2356
|
wrapSetter(originalSet) {
|
|
2369
|
-
const wrappedSetter = setterMap.get(originalSet);
|
|
2357
|
+
const wrappedSetter = setterMap$1.get(originalSet);
|
|
2370
2358
|
|
|
2371
2359
|
if (!isUndefined(wrappedSetter)) {
|
|
2372
2360
|
return wrappedSetter;
|
|
@@ -2375,7 +2363,6 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2375
2363
|
const handler = this;
|
|
2376
2364
|
|
|
2377
2365
|
const set = function (v) {
|
|
2378
|
-
/* istanbul ignore else */
|
|
2379
2366
|
if (process.env.NODE_ENV !== 'production') {
|
|
2380
2367
|
const {
|
|
2381
2368
|
originalTarget
|
|
@@ -2384,41 +2371,33 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2384
2371
|
}
|
|
2385
2372
|
};
|
|
2386
2373
|
|
|
2387
|
-
setterMap.set(originalSet, set);
|
|
2374
|
+
setterMap$1.set(originalSet, set);
|
|
2388
2375
|
return set;
|
|
2389
2376
|
}
|
|
2390
2377
|
|
|
2391
2378
|
set(shadowTarget, key, value) {
|
|
2392
|
-
/* istanbul ignore else */
|
|
2393
2379
|
if (process.env.NODE_ENV !== 'production') {
|
|
2394
2380
|
const {
|
|
2395
2381
|
originalTarget
|
|
2396
2382
|
} = this;
|
|
2397
|
-
|
|
2398
|
-
throw new Error(msg);
|
|
2383
|
+
throw new Error(`Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2399
2384
|
}
|
|
2400
|
-
/* istanbul ignore next */
|
|
2401
|
-
|
|
2402
2385
|
|
|
2403
2386
|
return false;
|
|
2404
2387
|
}
|
|
2405
2388
|
|
|
2406
2389
|
deleteProperty(shadowTarget, key) {
|
|
2407
|
-
/* istanbul ignore else */
|
|
2408
2390
|
if (process.env.NODE_ENV !== 'production') {
|
|
2409
2391
|
const {
|
|
2410
2392
|
originalTarget
|
|
2411
2393
|
} = this;
|
|
2412
2394
|
throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2413
2395
|
}
|
|
2414
|
-
/* istanbul ignore next */
|
|
2415
|
-
|
|
2416
2396
|
|
|
2417
2397
|
return false;
|
|
2418
2398
|
}
|
|
2419
2399
|
|
|
2420
2400
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2421
|
-
/* istanbul ignore else */
|
|
2422
2401
|
if (process.env.NODE_ENV !== 'production') {
|
|
2423
2402
|
const {
|
|
2424
2403
|
originalTarget
|
|
@@ -2428,29 +2407,23 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2428
2407
|
}
|
|
2429
2408
|
|
|
2430
2409
|
preventExtensions(shadowTarget) {
|
|
2431
|
-
/* istanbul ignore else */
|
|
2432
2410
|
if (process.env.NODE_ENV !== 'production') {
|
|
2433
2411
|
const {
|
|
2434
2412
|
originalTarget
|
|
2435
2413
|
} = this;
|
|
2436
2414
|
throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
|
|
2437
2415
|
}
|
|
2438
|
-
/* istanbul ignore next */
|
|
2439
|
-
|
|
2440
2416
|
|
|
2441
2417
|
return false;
|
|
2442
2418
|
}
|
|
2443
2419
|
|
|
2444
2420
|
defineProperty(shadowTarget, key, descriptor) {
|
|
2445
|
-
/* istanbul ignore else */
|
|
2446
2421
|
if (process.env.NODE_ENV !== 'production') {
|
|
2447
2422
|
const {
|
|
2448
2423
|
originalTarget
|
|
2449
2424
|
} = this;
|
|
2450
2425
|
throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2451
2426
|
}
|
|
2452
|
-
/* istanbul ignore next */
|
|
2453
|
-
|
|
2454
2427
|
|
|
2455
2428
|
return false;
|
|
2456
2429
|
}
|
|
@@ -2508,8 +2481,6 @@ const formatter = {
|
|
|
2508
2481
|
}; // Inspired from paulmillr/es6-shim
|
|
2509
2482
|
// https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
|
|
2510
2483
|
|
|
2511
|
-
/* istanbul ignore next */
|
|
2512
|
-
|
|
2513
2484
|
function getGlobal() {
|
|
2514
2485
|
// the only reliable means to get the global object is `Function('return this')()`
|
|
2515
2486
|
// However, this causes CSP violations in Chrome apps.
|
|
@@ -2534,7 +2505,6 @@ function getGlobal() {
|
|
|
2534
2505
|
}
|
|
2535
2506
|
|
|
2536
2507
|
function init() {
|
|
2537
|
-
/* istanbul ignore if */
|
|
2538
2508
|
if (process.env.NODE_ENV === 'production') {
|
|
2539
2509
|
// this method should never leak to prod
|
|
2540
2510
|
throw new ReferenceError();
|
|
@@ -2549,8 +2519,6 @@ function init() {
|
|
|
2549
2519
|
ArrayPush.call(devtoolsFormatters, formatter);
|
|
2550
2520
|
global.devtoolsFormatters = devtoolsFormatters;
|
|
2551
2521
|
}
|
|
2552
|
-
/* istanbul ignore else */
|
|
2553
|
-
|
|
2554
2522
|
|
|
2555
2523
|
if (process.env.NODE_ENV !== 'production') {
|
|
2556
2524
|
init();
|
|
@@ -2597,8 +2565,7 @@ class ReactiveMembrane {
|
|
|
2597
2565
|
this.valueMutated = defaultValueMutated;
|
|
2598
2566
|
this.valueObserved = defaultValueObserved;
|
|
2599
2567
|
this.valueIsObservable = defaultValueIsObservable;
|
|
2600
|
-
this.
|
|
2601
|
-
this.reactiveObjectGraph = new WeakMap();
|
|
2568
|
+
this.objectGraph = new WeakMap();
|
|
2602
2569
|
|
|
2603
2570
|
if (!isUndefined(options)) {
|
|
2604
2571
|
const {
|
|
@@ -2621,13 +2588,10 @@ class ReactiveMembrane {
|
|
|
2621
2588
|
const distorted = this.valueDistortion(unwrappedValue);
|
|
2622
2589
|
|
|
2623
2590
|
if (this.valueIsObservable(distorted)) {
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
// we return the readonly.
|
|
2627
|
-
return value;
|
|
2628
|
-
}
|
|
2591
|
+
const o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
|
|
2592
|
+
// we return the readonly.
|
|
2629
2593
|
|
|
2630
|
-
return
|
|
2594
|
+
return o.readOnly === value ? value : o.reactive;
|
|
2631
2595
|
}
|
|
2632
2596
|
|
|
2633
2597
|
return distorted;
|
|
@@ -2638,7 +2602,7 @@ class ReactiveMembrane {
|
|
|
2638
2602
|
const distorted = this.valueDistortion(value);
|
|
2639
2603
|
|
|
2640
2604
|
if (this.valueIsObservable(distorted)) {
|
|
2641
|
-
return this.
|
|
2605
|
+
return this.getReactiveState(value, distorted).readOnly;
|
|
2642
2606
|
}
|
|
2643
2607
|
|
|
2644
2608
|
return distorted;
|
|
@@ -2648,36 +2612,47 @@ class ReactiveMembrane {
|
|
|
2648
2612
|
return unwrap$1(p);
|
|
2649
2613
|
}
|
|
2650
2614
|
|
|
2651
|
-
|
|
2652
|
-
|
|
2615
|
+
getReactiveState(value, distortedValue) {
|
|
2616
|
+
const {
|
|
2617
|
+
objectGraph
|
|
2618
|
+
} = this;
|
|
2619
|
+
let reactiveState = objectGraph.get(distortedValue);
|
|
2653
2620
|
|
|
2654
|
-
if (
|
|
2655
|
-
|
|
2656
|
-
const handler = new ReactiveProxyHandler(this, distortedValue);
|
|
2657
|
-
proxy = new Proxy(createShadowTarget(distortedValue), handler);
|
|
2658
|
-
registerProxy(proxy, value);
|
|
2659
|
-
this.reactiveObjectGraph.set(distortedValue, proxy);
|
|
2621
|
+
if (reactiveState) {
|
|
2622
|
+
return reactiveState;
|
|
2660
2623
|
}
|
|
2661
2624
|
|
|
2662
|
-
|
|
2663
|
-
|
|
2625
|
+
const membrane = this;
|
|
2626
|
+
reactiveState = {
|
|
2627
|
+
get reactive() {
|
|
2628
|
+
const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
|
|
2664
2629
|
|
|
2665
|
-
|
|
2666
|
-
|
|
2630
|
+
const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
|
|
2631
|
+
registerProxy(proxy, value);
|
|
2632
|
+
ObjectDefineProperty(this, 'reactive', {
|
|
2633
|
+
value: proxy
|
|
2634
|
+
});
|
|
2635
|
+
return proxy;
|
|
2636
|
+
},
|
|
2667
2637
|
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2638
|
+
get readOnly() {
|
|
2639
|
+
const readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
|
|
2640
|
+
|
|
2641
|
+
const proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
|
|
2642
|
+
registerProxy(proxy, value);
|
|
2643
|
+
ObjectDefineProperty(this, 'readOnly', {
|
|
2644
|
+
value: proxy
|
|
2645
|
+
});
|
|
2646
|
+
return proxy;
|
|
2647
|
+
}
|
|
2675
2648
|
|
|
2676
|
-
|
|
2649
|
+
};
|
|
2650
|
+
objectGraph.set(distortedValue, reactiveState);
|
|
2651
|
+
return reactiveState;
|
|
2677
2652
|
}
|
|
2678
2653
|
|
|
2679
2654
|
}
|
|
2680
|
-
/** version: 1.
|
|
2655
|
+
/** version: 1.0.0 */
|
|
2681
2656
|
|
|
2682
2657
|
/*
|
|
2683
2658
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5823,7 +5798,6 @@ function updateStylesheetToken(vm, template) {
|
|
|
5823
5798
|
|
|
5824
5799
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5825
5800
|
const content = [];
|
|
5826
|
-
let root;
|
|
5827
5801
|
|
|
5828
5802
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5829
5803
|
let stylesheet = stylesheets[i];
|
|
@@ -5836,46 +5810,23 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
5836
5810
|
// the component instance might be attempting to use an old version of
|
|
5837
5811
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5838
5812
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5839
|
-
}
|
|
5840
|
-
|
|
5841
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5842
|
-
|
|
5843
|
-
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5844
|
-
/* Synthetic */
|
|
5845
|
-
&& vm.renderMode === 1
|
|
5846
|
-
/* Shadow */
|
|
5847
|
-
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5813
|
+
} // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5848
5814
|
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5849
5815
|
|
|
5816
|
+
|
|
5817
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5850
5818
|
const useActualHostSelector = vm.renderMode === 0
|
|
5851
5819
|
/* Light */
|
|
5852
5820
|
? !isScopedCss : vm.shadowMode === 0
|
|
5853
5821
|
/* Native */
|
|
5854
|
-
; //
|
|
5855
|
-
// we use an attribute selector on the host to simulate :dir().
|
|
5856
|
-
|
|
5857
|
-
let useNativeDirPseudoclass;
|
|
5822
|
+
; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5858
5823
|
|
|
5859
|
-
|
|
5824
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5825
|
+
/* Synthetic */
|
|
5826
|
+
&& vm.renderMode === 1
|
|
5860
5827
|
/* Shadow */
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
/* Native */
|
|
5864
|
-
;
|
|
5865
|
-
} else {
|
|
5866
|
-
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5867
|
-
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5868
|
-
if (isUndefined$1(root)) {
|
|
5869
|
-
// Only calculate the root once as necessary
|
|
5870
|
-
root = getNearestShadowComponent(vm);
|
|
5871
|
-
}
|
|
5872
|
-
|
|
5873
|
-
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
5874
|
-
/* Native */
|
|
5875
|
-
;
|
|
5876
|
-
}
|
|
5877
|
-
|
|
5878
|
-
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5828
|
+
? stylesheetToken : undefined;
|
|
5829
|
+
ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
|
|
5879
5830
|
}
|
|
5880
5831
|
}
|
|
5881
5832
|
|
|
@@ -5899,12 +5850,14 @@ function getStylesheetsContent(vm, template) {
|
|
|
5899
5850
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
5900
5851
|
|
|
5901
5852
|
|
|
5902
|
-
function
|
|
5853
|
+
function getNearestNativeShadowComponent(vm) {
|
|
5903
5854
|
let owner = vm;
|
|
5904
5855
|
|
|
5905
5856
|
while (!isNull(owner)) {
|
|
5906
5857
|
if (owner.renderMode === 1
|
|
5907
5858
|
/* Shadow */
|
|
5859
|
+
&& owner.shadowMode === 0
|
|
5860
|
+
/* Native */
|
|
5908
5861
|
) {
|
|
5909
5862
|
return owner;
|
|
5910
5863
|
}
|
|
@@ -5915,20 +5868,6 @@ function getNearestShadowComponent(vm) {
|
|
|
5915
5868
|
return owner;
|
|
5916
5869
|
}
|
|
5917
5870
|
|
|
5918
|
-
function getNearestNativeShadowComponent(vm) {
|
|
5919
|
-
const owner = getNearestShadowComponent(vm);
|
|
5920
|
-
|
|
5921
|
-
if (!isNull(owner) && owner.shadowMode === 1
|
|
5922
|
-
/* Synthetic */
|
|
5923
|
-
) {
|
|
5924
|
-
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
5925
|
-
// synthetic, we know we won't find a native component if we go any further.
|
|
5926
|
-
return null;
|
|
5927
|
-
}
|
|
5928
|
-
|
|
5929
|
-
return owner;
|
|
5930
|
-
}
|
|
5931
|
-
|
|
5932
5871
|
function createStylesheet(vm, stylesheets) {
|
|
5933
5872
|
const {
|
|
5934
5873
|
renderer,
|
|
@@ -7593,7 +7532,7 @@ function setHooks(hooks) {
|
|
|
7593
7532
|
hooksAreSet = true;
|
|
7594
7533
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7595
7534
|
}
|
|
7596
|
-
/* version: 2.5.
|
|
7535
|
+
/* version: 2.5.10-alpha1 */
|
|
7597
7536
|
|
|
7598
7537
|
/*
|
|
7599
7538
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -8089,7 +8028,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8089
8028
|
|
|
8090
8029
|
freeze(LightningElement);
|
|
8091
8030
|
seal(LightningElement.prototype);
|
|
8092
|
-
/* version: 2.5.
|
|
8031
|
+
/* version: 2.5.10-alpha1 */
|
|
8093
8032
|
|
|
8094
8033
|
exports.LightningElement = LightningElement;
|
|
8095
8034
|
exports.api = api$1;
|