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
|
@@ -69,7 +69,7 @@ const {
|
|
|
69
69
|
find: ArrayFind,
|
|
70
70
|
indexOf: ArrayIndexOf,
|
|
71
71
|
join: ArrayJoin,
|
|
72
|
-
map: ArrayMap,
|
|
72
|
+
map: ArrayMap$1,
|
|
73
73
|
push: ArrayPush$1,
|
|
74
74
|
reduce: ArrayReduce,
|
|
75
75
|
reverse: ArrayReverse,
|
|
@@ -136,7 +136,7 @@ function toString$1(obj) {
|
|
|
136
136
|
// Array.prototype.toString directly will cause an error Iterate through
|
|
137
137
|
// all the items and handle individually.
|
|
138
138
|
if (isArray$1(obj)) {
|
|
139
|
-
return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
|
|
139
|
+
return ArrayJoin.call(ArrayMap$1.call(obj, toString$1), ',');
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
return obj.toString();
|
|
@@ -299,7 +299,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
299
299
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
300
300
|
return attributeName;
|
|
301
301
|
}
|
|
302
|
-
/** version: 2.5.
|
|
302
|
+
/** version: 2.5.10-alpha1 */
|
|
303
303
|
|
|
304
304
|
/*
|
|
305
305
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -479,7 +479,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
479
479
|
setFeatureFlag(name, value);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
/** version: 2.5.
|
|
482
|
+
/** version: 2.5.10-alpha1 */
|
|
483
483
|
|
|
484
484
|
/* proxy-compat-disable */
|
|
485
485
|
|
|
@@ -1929,6 +1929,7 @@ const {
|
|
|
1929
1929
|
getPrototypeOf,
|
|
1930
1930
|
create: ObjectCreate,
|
|
1931
1931
|
defineProperty: ObjectDefineProperty,
|
|
1932
|
+
defineProperties: ObjectDefineProperties,
|
|
1932
1933
|
isExtensible,
|
|
1933
1934
|
getOwnPropertyDescriptor,
|
|
1934
1935
|
getOwnPropertyNames,
|
|
@@ -1938,7 +1939,8 @@ const {
|
|
|
1938
1939
|
} = Object;
|
|
1939
1940
|
const {
|
|
1940
1941
|
push: ArrayPush,
|
|
1941
|
-
concat: ArrayConcat
|
|
1942
|
+
concat: ArrayConcat,
|
|
1943
|
+
map: ArrayMap
|
|
1942
1944
|
} = Array.prototype;
|
|
1943
1945
|
const OtS = {}.toString;
|
|
1944
1946
|
|
|
@@ -2003,9 +2005,7 @@ class BaseProxyHandler {
|
|
|
2003
2005
|
// but it will always be compatible with the previous descriptor
|
|
2004
2006
|
// to preserve the object invariants, which makes these lines safe.
|
|
2005
2007
|
|
|
2006
|
-
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
|
|
2007
|
-
|
|
2008
|
-
/* istanbul ignore else */
|
|
2008
|
+
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
|
|
2009
2009
|
|
|
2010
2010
|
if (!isUndefined(originalDescriptor)) {
|
|
2011
2011
|
const wrappedDesc = this.wrapDescriptor(originalDescriptor);
|
|
@@ -2033,17 +2033,11 @@ class BaseProxyHandler {
|
|
|
2033
2033
|
|
|
2034
2034
|
preventExtensions(shadowTarget);
|
|
2035
2035
|
} // Shared Traps
|
|
2036
|
-
// TODO: apply() is never called
|
|
2037
|
-
|
|
2038
|
-
/* istanbul ignore next */
|
|
2039
2036
|
|
|
2040
2037
|
|
|
2041
2038
|
apply(shadowTarget, thisArg, argArray) {
|
|
2042
2039
|
/* No op */
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
/* istanbul ignore next */
|
|
2046
|
-
|
|
2040
|
+
}
|
|
2047
2041
|
|
|
2048
2042
|
construct(shadowTarget, argArray, newTarget) {
|
|
2049
2043
|
/* No op */
|
|
@@ -2156,8 +2150,8 @@ class BaseProxyHandler {
|
|
|
2156
2150
|
|
|
2157
2151
|
}
|
|
2158
2152
|
|
|
2159
|
-
const getterMap
|
|
2160
|
-
const setterMap
|
|
2153
|
+
const getterMap = new WeakMap();
|
|
2154
|
+
const setterMap = new WeakMap();
|
|
2161
2155
|
const reverseGetterMap = new WeakMap();
|
|
2162
2156
|
const reverseSetterMap = new WeakMap();
|
|
2163
2157
|
|
|
@@ -2167,7 +2161,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2167
2161
|
}
|
|
2168
2162
|
|
|
2169
2163
|
wrapGetter(originalGet) {
|
|
2170
|
-
const wrappedGetter = getterMap
|
|
2164
|
+
const wrappedGetter = getterMap.get(originalGet);
|
|
2171
2165
|
|
|
2172
2166
|
if (!isUndefined(wrappedGetter)) {
|
|
2173
2167
|
return wrappedGetter;
|
|
@@ -2180,13 +2174,13 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2180
2174
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2181
2175
|
};
|
|
2182
2176
|
|
|
2183
|
-
getterMap
|
|
2177
|
+
getterMap.set(originalGet, get);
|
|
2184
2178
|
reverseGetterMap.set(get, originalGet);
|
|
2185
2179
|
return get;
|
|
2186
2180
|
}
|
|
2187
2181
|
|
|
2188
2182
|
wrapSetter(originalSet) {
|
|
2189
|
-
const wrappedSetter = setterMap
|
|
2183
|
+
const wrappedSetter = setterMap.get(originalSet);
|
|
2190
2184
|
|
|
2191
2185
|
if (!isUndefined(wrappedSetter)) {
|
|
2192
2186
|
return wrappedSetter;
|
|
@@ -2197,7 +2191,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2197
2191
|
originalSet.call(unwrap$1(this), unwrap$1(v));
|
|
2198
2192
|
};
|
|
2199
2193
|
|
|
2200
|
-
setterMap
|
|
2194
|
+
setterMap.set(originalSet, set);
|
|
2201
2195
|
reverseSetterMap.set(set, originalSet);
|
|
2202
2196
|
return set;
|
|
2203
2197
|
}
|
|
@@ -2238,7 +2232,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2238
2232
|
return unwrap$1(redGet.call(handler.wrapValue(this)));
|
|
2239
2233
|
};
|
|
2240
2234
|
|
|
2241
|
-
getterMap
|
|
2235
|
+
getterMap.set(get, redGet);
|
|
2242
2236
|
reverseGetterMap.set(redGet, get);
|
|
2243
2237
|
return get;
|
|
2244
2238
|
}
|
|
@@ -2257,7 +2251,7 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2257
2251
|
redSet.call(handler.wrapValue(this), handler.wrapValue(v));
|
|
2258
2252
|
};
|
|
2259
2253
|
|
|
2260
|
-
setterMap
|
|
2254
|
+
setterMap.set(set, redSet);
|
|
2261
2255
|
reverseSetterMap.set(redSet, set);
|
|
2262
2256
|
return set;
|
|
2263
2257
|
}
|
|
@@ -2298,7 +2292,6 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2298
2292
|
}
|
|
2299
2293
|
|
|
2300
2294
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2301
|
-
/* istanbul ignore else */
|
|
2302
2295
|
if (process.env.NODE_ENV !== 'production') {
|
|
2303
2296
|
throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
|
|
2304
2297
|
}
|
|
@@ -2312,11 +2305,6 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2312
2305
|
preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
|
|
2313
2306
|
// the preventExtension call, in which case we should not attempt to lock down
|
|
2314
2307
|
// the shadow target.
|
|
2315
|
-
// TODO: It should not actually be possible to reach this `if` statement.
|
|
2316
|
-
// If a proxy rejects extensions, then calling preventExtensions will throw an error:
|
|
2317
|
-
// https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
|
|
2318
|
-
|
|
2319
|
-
/* istanbul ignore if */
|
|
2320
2308
|
|
|
2321
2309
|
if (isExtensible(originalTarget)) {
|
|
2322
2310
|
return false;
|
|
@@ -2358,8 +2346,8 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
2358
2346
|
|
|
2359
2347
|
}
|
|
2360
2348
|
|
|
2361
|
-
const getterMap = new WeakMap();
|
|
2362
|
-
const setterMap = new WeakMap();
|
|
2349
|
+
const getterMap$1 = new WeakMap();
|
|
2350
|
+
const setterMap$1 = new WeakMap();
|
|
2363
2351
|
|
|
2364
2352
|
class ReadOnlyHandler extends BaseProxyHandler {
|
|
2365
2353
|
wrapValue(value) {
|
|
@@ -2367,7 +2355,7 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2367
2355
|
}
|
|
2368
2356
|
|
|
2369
2357
|
wrapGetter(originalGet) {
|
|
2370
|
-
const wrappedGetter = getterMap.get(originalGet);
|
|
2358
|
+
const wrappedGetter = getterMap$1.get(originalGet);
|
|
2371
2359
|
|
|
2372
2360
|
if (!isUndefined(wrappedGetter)) {
|
|
2373
2361
|
return wrappedGetter;
|
|
@@ -2380,12 +2368,12 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2380
2368
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2381
2369
|
};
|
|
2382
2370
|
|
|
2383
|
-
getterMap.set(originalGet, get);
|
|
2371
|
+
getterMap$1.set(originalGet, get);
|
|
2384
2372
|
return get;
|
|
2385
2373
|
}
|
|
2386
2374
|
|
|
2387
2375
|
wrapSetter(originalSet) {
|
|
2388
|
-
const wrappedSetter = setterMap.get(originalSet);
|
|
2376
|
+
const wrappedSetter = setterMap$1.get(originalSet);
|
|
2389
2377
|
|
|
2390
2378
|
if (!isUndefined(wrappedSetter)) {
|
|
2391
2379
|
return wrappedSetter;
|
|
@@ -2394,7 +2382,6 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2394
2382
|
const handler = this;
|
|
2395
2383
|
|
|
2396
2384
|
const set = function (v) {
|
|
2397
|
-
/* istanbul ignore else */
|
|
2398
2385
|
if (process.env.NODE_ENV !== 'production') {
|
|
2399
2386
|
const {
|
|
2400
2387
|
originalTarget
|
|
@@ -2403,41 +2390,33 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2403
2390
|
}
|
|
2404
2391
|
};
|
|
2405
2392
|
|
|
2406
|
-
setterMap.set(originalSet, set);
|
|
2393
|
+
setterMap$1.set(originalSet, set);
|
|
2407
2394
|
return set;
|
|
2408
2395
|
}
|
|
2409
2396
|
|
|
2410
2397
|
set(shadowTarget, key, value) {
|
|
2411
|
-
/* istanbul ignore else */
|
|
2412
2398
|
if (process.env.NODE_ENV !== 'production') {
|
|
2413
2399
|
const {
|
|
2414
2400
|
originalTarget
|
|
2415
2401
|
} = this;
|
|
2416
|
-
|
|
2417
|
-
throw new Error(msg);
|
|
2402
|
+
throw new Error(`Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2418
2403
|
}
|
|
2419
|
-
/* istanbul ignore next */
|
|
2420
|
-
|
|
2421
2404
|
|
|
2422
2405
|
return false;
|
|
2423
2406
|
}
|
|
2424
2407
|
|
|
2425
2408
|
deleteProperty(shadowTarget, key) {
|
|
2426
|
-
/* istanbul ignore else */
|
|
2427
2409
|
if (process.env.NODE_ENV !== 'production') {
|
|
2428
2410
|
const {
|
|
2429
2411
|
originalTarget
|
|
2430
2412
|
} = this;
|
|
2431
2413
|
throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2432
2414
|
}
|
|
2433
|
-
/* istanbul ignore next */
|
|
2434
|
-
|
|
2435
2415
|
|
|
2436
2416
|
return false;
|
|
2437
2417
|
}
|
|
2438
2418
|
|
|
2439
2419
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2440
|
-
/* istanbul ignore else */
|
|
2441
2420
|
if (process.env.NODE_ENV !== 'production') {
|
|
2442
2421
|
const {
|
|
2443
2422
|
originalTarget
|
|
@@ -2447,29 +2426,23 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
2447
2426
|
}
|
|
2448
2427
|
|
|
2449
2428
|
preventExtensions(shadowTarget) {
|
|
2450
|
-
/* istanbul ignore else */
|
|
2451
2429
|
if (process.env.NODE_ENV !== 'production') {
|
|
2452
2430
|
const {
|
|
2453
2431
|
originalTarget
|
|
2454
2432
|
} = this;
|
|
2455
2433
|
throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
|
|
2456
2434
|
}
|
|
2457
|
-
/* istanbul ignore next */
|
|
2458
|
-
|
|
2459
2435
|
|
|
2460
2436
|
return false;
|
|
2461
2437
|
}
|
|
2462
2438
|
|
|
2463
2439
|
defineProperty(shadowTarget, key, descriptor) {
|
|
2464
|
-
/* istanbul ignore else */
|
|
2465
2440
|
if (process.env.NODE_ENV !== 'production') {
|
|
2466
2441
|
const {
|
|
2467
2442
|
originalTarget
|
|
2468
2443
|
} = this;
|
|
2469
2444
|
throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2470
2445
|
}
|
|
2471
|
-
/* istanbul ignore next */
|
|
2472
|
-
|
|
2473
2446
|
|
|
2474
2447
|
return false;
|
|
2475
2448
|
}
|
|
@@ -2527,8 +2500,6 @@ const formatter = {
|
|
|
2527
2500
|
}; // Inspired from paulmillr/es6-shim
|
|
2528
2501
|
// https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
|
|
2529
2502
|
|
|
2530
|
-
/* istanbul ignore next */
|
|
2531
|
-
|
|
2532
2503
|
function getGlobal() {
|
|
2533
2504
|
// the only reliable means to get the global object is `Function('return this')()`
|
|
2534
2505
|
// However, this causes CSP violations in Chrome apps.
|
|
@@ -2553,7 +2524,6 @@ function getGlobal() {
|
|
|
2553
2524
|
}
|
|
2554
2525
|
|
|
2555
2526
|
function init() {
|
|
2556
|
-
/* istanbul ignore if */
|
|
2557
2527
|
if (process.env.NODE_ENV === 'production') {
|
|
2558
2528
|
// this method should never leak to prod
|
|
2559
2529
|
throw new ReferenceError();
|
|
@@ -2568,8 +2538,6 @@ function init() {
|
|
|
2568
2538
|
ArrayPush.call(devtoolsFormatters, formatter);
|
|
2569
2539
|
global.devtoolsFormatters = devtoolsFormatters;
|
|
2570
2540
|
}
|
|
2571
|
-
/* istanbul ignore else */
|
|
2572
|
-
|
|
2573
2541
|
|
|
2574
2542
|
if (process.env.NODE_ENV !== 'production') {
|
|
2575
2543
|
init();
|
|
@@ -2616,8 +2584,7 @@ class ReactiveMembrane {
|
|
|
2616
2584
|
this.valueMutated = defaultValueMutated;
|
|
2617
2585
|
this.valueObserved = defaultValueObserved;
|
|
2618
2586
|
this.valueIsObservable = defaultValueIsObservable;
|
|
2619
|
-
this.
|
|
2620
|
-
this.reactiveObjectGraph = new WeakMap();
|
|
2587
|
+
this.objectGraph = new WeakMap();
|
|
2621
2588
|
|
|
2622
2589
|
if (!isUndefined(options)) {
|
|
2623
2590
|
const {
|
|
@@ -2640,13 +2607,10 @@ class ReactiveMembrane {
|
|
|
2640
2607
|
const distorted = this.valueDistortion(unwrappedValue);
|
|
2641
2608
|
|
|
2642
2609
|
if (this.valueIsObservable(distorted)) {
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
// we return the readonly.
|
|
2646
|
-
return value;
|
|
2647
|
-
}
|
|
2610
|
+
const o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
|
|
2611
|
+
// we return the readonly.
|
|
2648
2612
|
|
|
2649
|
-
return
|
|
2613
|
+
return o.readOnly === value ? value : o.reactive;
|
|
2650
2614
|
}
|
|
2651
2615
|
|
|
2652
2616
|
return distorted;
|
|
@@ -2657,7 +2621,7 @@ class ReactiveMembrane {
|
|
|
2657
2621
|
const distorted = this.valueDistortion(value);
|
|
2658
2622
|
|
|
2659
2623
|
if (this.valueIsObservable(distorted)) {
|
|
2660
|
-
return this.
|
|
2624
|
+
return this.getReactiveState(value, distorted).readOnly;
|
|
2661
2625
|
}
|
|
2662
2626
|
|
|
2663
2627
|
return distorted;
|
|
@@ -2667,36 +2631,47 @@ class ReactiveMembrane {
|
|
|
2667
2631
|
return unwrap$1(p);
|
|
2668
2632
|
}
|
|
2669
2633
|
|
|
2670
|
-
|
|
2671
|
-
|
|
2634
|
+
getReactiveState(value, distortedValue) {
|
|
2635
|
+
const {
|
|
2636
|
+
objectGraph
|
|
2637
|
+
} = this;
|
|
2638
|
+
let reactiveState = objectGraph.get(distortedValue);
|
|
2672
2639
|
|
|
2673
|
-
if (
|
|
2674
|
-
|
|
2675
|
-
const handler = new ReactiveProxyHandler(this, distortedValue);
|
|
2676
|
-
proxy = new Proxy(createShadowTarget(distortedValue), handler);
|
|
2677
|
-
registerProxy(proxy, value);
|
|
2678
|
-
this.reactiveObjectGraph.set(distortedValue, proxy);
|
|
2640
|
+
if (reactiveState) {
|
|
2641
|
+
return reactiveState;
|
|
2679
2642
|
}
|
|
2680
2643
|
|
|
2681
|
-
|
|
2682
|
-
|
|
2644
|
+
const membrane = this;
|
|
2645
|
+
reactiveState = {
|
|
2646
|
+
get reactive() {
|
|
2647
|
+
const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
|
|
2683
2648
|
|
|
2684
|
-
|
|
2685
|
-
|
|
2649
|
+
const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
|
|
2650
|
+
registerProxy(proxy, value);
|
|
2651
|
+
ObjectDefineProperty(this, 'reactive', {
|
|
2652
|
+
value: proxy
|
|
2653
|
+
});
|
|
2654
|
+
return proxy;
|
|
2655
|
+
},
|
|
2686
2656
|
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2657
|
+
get readOnly() {
|
|
2658
|
+
const readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
|
|
2659
|
+
|
|
2660
|
+
const proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
|
|
2661
|
+
registerProxy(proxy, value);
|
|
2662
|
+
ObjectDefineProperty(this, 'readOnly', {
|
|
2663
|
+
value: proxy
|
|
2664
|
+
});
|
|
2665
|
+
return proxy;
|
|
2666
|
+
}
|
|
2694
2667
|
|
|
2695
|
-
|
|
2668
|
+
};
|
|
2669
|
+
objectGraph.set(distortedValue, reactiveState);
|
|
2670
|
+
return reactiveState;
|
|
2696
2671
|
}
|
|
2697
2672
|
|
|
2698
2673
|
}
|
|
2699
|
-
/** version: 1.
|
|
2674
|
+
/** version: 1.0.0 */
|
|
2700
2675
|
|
|
2701
2676
|
/*
|
|
2702
2677
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5962,7 +5937,6 @@ function updateStylesheetToken(vm, template) {
|
|
|
5962
5937
|
|
|
5963
5938
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5964
5939
|
const content = [];
|
|
5965
|
-
let root;
|
|
5966
5940
|
|
|
5967
5941
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5968
5942
|
let stylesheet = stylesheets[i];
|
|
@@ -5975,46 +5949,23 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
5975
5949
|
// the component instance might be attempting to use an old version of
|
|
5976
5950
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5977
5951
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5978
|
-
}
|
|
5979
|
-
|
|
5980
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5981
|
-
|
|
5982
|
-
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5983
|
-
/* Synthetic */
|
|
5984
|
-
&& vm.renderMode === 1
|
|
5985
|
-
/* Shadow */
|
|
5986
|
-
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5952
|
+
} // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5987
5953
|
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5988
5954
|
|
|
5955
|
+
|
|
5956
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5989
5957
|
const useActualHostSelector = vm.renderMode === 0
|
|
5990
5958
|
/* Light */
|
|
5991
5959
|
? !isScopedCss : vm.shadowMode === 0
|
|
5992
5960
|
/* Native */
|
|
5993
|
-
; //
|
|
5994
|
-
// we use an attribute selector on the host to simulate :dir().
|
|
5995
|
-
|
|
5996
|
-
let useNativeDirPseudoclass;
|
|
5961
|
+
; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5997
5962
|
|
|
5998
|
-
|
|
5963
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5964
|
+
/* Synthetic */
|
|
5965
|
+
&& vm.renderMode === 1
|
|
5999
5966
|
/* Shadow */
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
/* Native */
|
|
6003
|
-
;
|
|
6004
|
-
} else {
|
|
6005
|
-
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
6006
|
-
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
6007
|
-
if (isUndefined$1(root)) {
|
|
6008
|
-
// Only calculate the root once as necessary
|
|
6009
|
-
root = getNearestShadowComponent(vm);
|
|
6010
|
-
}
|
|
6011
|
-
|
|
6012
|
-
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
6013
|
-
/* Native */
|
|
6014
|
-
;
|
|
6015
|
-
}
|
|
6016
|
-
|
|
6017
|
-
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5967
|
+
? stylesheetToken : undefined;
|
|
5968
|
+
ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
|
|
6018
5969
|
}
|
|
6019
5970
|
}
|
|
6020
5971
|
|
|
@@ -6038,12 +5989,14 @@ function getStylesheetsContent(vm, template) {
|
|
|
6038
5989
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
6039
5990
|
|
|
6040
5991
|
|
|
6041
|
-
function
|
|
5992
|
+
function getNearestNativeShadowComponent(vm) {
|
|
6042
5993
|
let owner = vm;
|
|
6043
5994
|
|
|
6044
5995
|
while (!isNull(owner)) {
|
|
6045
5996
|
if (owner.renderMode === 1
|
|
6046
5997
|
/* Shadow */
|
|
5998
|
+
&& owner.shadowMode === 0
|
|
5999
|
+
/* Native */
|
|
6047
6000
|
) {
|
|
6048
6001
|
return owner;
|
|
6049
6002
|
}
|
|
@@ -6054,20 +6007,6 @@ function getNearestShadowComponent(vm) {
|
|
|
6054
6007
|
return owner;
|
|
6055
6008
|
}
|
|
6056
6009
|
|
|
6057
|
-
function getNearestNativeShadowComponent(vm) {
|
|
6058
|
-
const owner = getNearestShadowComponent(vm);
|
|
6059
|
-
|
|
6060
|
-
if (!isNull(owner) && owner.shadowMode === 1
|
|
6061
|
-
/* Synthetic */
|
|
6062
|
-
) {
|
|
6063
|
-
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
6064
|
-
// synthetic, we know we won't find a native component if we go any further.
|
|
6065
|
-
return null;
|
|
6066
|
-
}
|
|
6067
|
-
|
|
6068
|
-
return owner;
|
|
6069
|
-
}
|
|
6070
|
-
|
|
6071
6010
|
function createStylesheet(vm, stylesheets) {
|
|
6072
6011
|
const {
|
|
6073
6012
|
renderer,
|
|
@@ -7808,7 +7747,7 @@ function setHooks(hooks) {
|
|
|
7808
7747
|
hooksAreSet = true;
|
|
7809
7748
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7810
7749
|
}
|
|
7811
|
-
/* version: 2.5.
|
|
7750
|
+
/* version: 2.5.10-alpha1 */
|
|
7812
7751
|
|
|
7813
7752
|
/*
|
|
7814
7753
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8464,6 +8403,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8464
8403
|
});
|
|
8465
8404
|
freeze(LightningElement);
|
|
8466
8405
|
seal(LightningElement.prototype);
|
|
8467
|
-
/* version: 2.5.
|
|
8406
|
+
/* version: 2.5.10-alpha1 */
|
|
8468
8407
|
|
|
8469
8408
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|