lwc 2.5.8 → 2.6.1
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 +161 -129
- package/dist/engine-dom/iife/es2017/engine-dom.js +161 -129
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +144 -125
- package/dist/engine-dom/iife/es5/engine-dom.js +174 -138
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +159 -136
- package/dist/engine-dom/umd/es2017/engine-dom.js +161 -129
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +144 -125
- package/dist/engine-dom/umd/es5/engine-dom.js +174 -138
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +159 -136
- package/dist/engine-server/commonjs/es2017/engine-server.js +161 -129
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +161 -129
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +23 -130
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +23 -130
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +23 -130
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +23 -124
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +23 -124
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +23 -130
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +23 -130
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +23 -124
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +23 -124
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +8 -8
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
find: ArrayFind,
|
|
76
76
|
indexOf: ArrayIndexOf,
|
|
77
77
|
join: ArrayJoin,
|
|
78
|
-
map: ArrayMap
|
|
78
|
+
map: ArrayMap,
|
|
79
79
|
push: ArrayPush$1,
|
|
80
80
|
reduce: ArrayReduce,
|
|
81
81
|
reverse: ArrayReverse,
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
// Array.prototype.toString directly will cause an error Iterate through
|
|
143
143
|
// all the items and handle individually.
|
|
144
144
|
if (isArray$1(obj)) {
|
|
145
|
-
return ArrayJoin.call(ArrayMap
|
|
145
|
+
return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
return obj.toString();
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
306
306
|
return attributeName;
|
|
307
307
|
}
|
|
308
|
-
/** version: 2.
|
|
308
|
+
/** version: 2.6.1 */
|
|
309
309
|
|
|
310
310
|
/*
|
|
311
311
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -419,7 +419,6 @@
|
|
|
419
419
|
ENABLE_NODE_LIST_PATCH: null,
|
|
420
420
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
421
421
|
ENABLE_NODE_PATCH: null,
|
|
422
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
423
422
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
424
423
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
425
424
|
};
|
|
@@ -485,7 +484,7 @@
|
|
|
485
484
|
setFeatureFlag(name, value);
|
|
486
485
|
}
|
|
487
486
|
}
|
|
488
|
-
/** version: 2.
|
|
487
|
+
/** version: 2.6.1 */
|
|
489
488
|
|
|
490
489
|
/* proxy-compat-disable */
|
|
491
490
|
|
|
@@ -1932,10 +1931,10 @@
|
|
|
1932
1931
|
isArray
|
|
1933
1932
|
} = Array;
|
|
1934
1933
|
const {
|
|
1934
|
+
prototype: ObjectDotPrototype,
|
|
1935
1935
|
getPrototypeOf,
|
|
1936
1936
|
create: ObjectCreate,
|
|
1937
1937
|
defineProperty: ObjectDefineProperty,
|
|
1938
|
-
defineProperties: ObjectDefineProperties,
|
|
1939
1938
|
isExtensible,
|
|
1940
1939
|
getOwnPropertyDescriptor,
|
|
1941
1940
|
getOwnPropertyNames,
|
|
@@ -1945,8 +1944,7 @@
|
|
|
1945
1944
|
} = Object;
|
|
1946
1945
|
const {
|
|
1947
1946
|
push: ArrayPush,
|
|
1948
|
-
concat: ArrayConcat
|
|
1949
|
-
map: ArrayMap
|
|
1947
|
+
concat: ArrayConcat
|
|
1950
1948
|
} = Array.prototype;
|
|
1951
1949
|
const OtS = {}.toString;
|
|
1952
1950
|
|
|
@@ -2011,7 +2009,9 @@
|
|
|
2011
2009
|
// but it will always be compatible with the previous descriptor
|
|
2012
2010
|
// to preserve the object invariants, which makes these lines safe.
|
|
2013
2011
|
|
|
2014
|
-
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
|
|
2012
|
+
const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
|
|
2013
|
+
|
|
2014
|
+
/* istanbul ignore else */
|
|
2015
2015
|
|
|
2016
2016
|
if (!isUndefined(originalDescriptor)) {
|
|
2017
2017
|
const wrappedDesc = this.wrapDescriptor(originalDescriptor);
|
|
@@ -2039,11 +2039,17 @@
|
|
|
2039
2039
|
|
|
2040
2040
|
preventExtensions(shadowTarget);
|
|
2041
2041
|
} // Shared Traps
|
|
2042
|
+
// TODO: apply() is never called
|
|
2043
|
+
|
|
2044
|
+
/* istanbul ignore next */
|
|
2042
2045
|
|
|
2043
2046
|
|
|
2044
2047
|
apply(shadowTarget, thisArg, argArray) {
|
|
2045
2048
|
/* No op */
|
|
2046
|
-
}
|
|
2049
|
+
} // TODO: construct() is never called
|
|
2050
|
+
|
|
2051
|
+
/* istanbul ignore next */
|
|
2052
|
+
|
|
2047
2053
|
|
|
2048
2054
|
construct(shadowTarget, argArray, newTarget) {
|
|
2049
2055
|
/* No op */
|
|
@@ -2156,8 +2162,8 @@
|
|
|
2156
2162
|
|
|
2157
2163
|
}
|
|
2158
2164
|
|
|
2159
|
-
const getterMap = new WeakMap();
|
|
2160
|
-
const setterMap = new WeakMap();
|
|
2165
|
+
const getterMap$1 = new WeakMap();
|
|
2166
|
+
const setterMap$1 = new WeakMap();
|
|
2161
2167
|
const reverseGetterMap = new WeakMap();
|
|
2162
2168
|
const reverseSetterMap = new WeakMap();
|
|
2163
2169
|
|
|
@@ -2167,7 +2173,7 @@
|
|
|
2167
2173
|
}
|
|
2168
2174
|
|
|
2169
2175
|
wrapGetter(originalGet) {
|
|
2170
|
-
const wrappedGetter = getterMap.get(originalGet);
|
|
2176
|
+
const wrappedGetter = getterMap$1.get(originalGet);
|
|
2171
2177
|
|
|
2172
2178
|
if (!isUndefined(wrappedGetter)) {
|
|
2173
2179
|
return wrappedGetter;
|
|
@@ -2180,13 +2186,13 @@
|
|
|
2180
2186
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2181
2187
|
};
|
|
2182
2188
|
|
|
2183
|
-
getterMap.set(originalGet, get);
|
|
2189
|
+
getterMap$1.set(originalGet, get);
|
|
2184
2190
|
reverseGetterMap.set(get, originalGet);
|
|
2185
2191
|
return get;
|
|
2186
2192
|
}
|
|
2187
2193
|
|
|
2188
2194
|
wrapSetter(originalSet) {
|
|
2189
|
-
const wrappedSetter = setterMap.get(originalSet);
|
|
2195
|
+
const wrappedSetter = setterMap$1.get(originalSet);
|
|
2190
2196
|
|
|
2191
2197
|
if (!isUndefined(wrappedSetter)) {
|
|
2192
2198
|
return wrappedSetter;
|
|
@@ -2197,7 +2203,7 @@
|
|
|
2197
2203
|
originalSet.call(unwrap$1(this), unwrap$1(v));
|
|
2198
2204
|
};
|
|
2199
2205
|
|
|
2200
|
-
setterMap.set(originalSet, set);
|
|
2206
|
+
setterMap$1.set(originalSet, set);
|
|
2201
2207
|
reverseSetterMap.set(set, originalSet);
|
|
2202
2208
|
return set;
|
|
2203
2209
|
}
|
|
@@ -2238,7 +2244,7 @@
|
|
|
2238
2244
|
return unwrap$1(redGet.call(handler.wrapValue(this)));
|
|
2239
2245
|
};
|
|
2240
2246
|
|
|
2241
|
-
getterMap.set(get, redGet);
|
|
2247
|
+
getterMap$1.set(get, redGet);
|
|
2242
2248
|
reverseGetterMap.set(redGet, get);
|
|
2243
2249
|
return get;
|
|
2244
2250
|
}
|
|
@@ -2257,7 +2263,7 @@
|
|
|
2257
2263
|
redSet.call(handler.wrapValue(this), handler.wrapValue(v));
|
|
2258
2264
|
};
|
|
2259
2265
|
|
|
2260
|
-
setterMap.set(set, redSet);
|
|
2266
|
+
setterMap$1.set(set, redSet);
|
|
2261
2267
|
reverseSetterMap.set(redSet, set);
|
|
2262
2268
|
return set;
|
|
2263
2269
|
}
|
|
@@ -2298,6 +2304,7 @@
|
|
|
2298
2304
|
}
|
|
2299
2305
|
|
|
2300
2306
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2307
|
+
/* istanbul ignore else */
|
|
2301
2308
|
if (process.env.NODE_ENV !== 'production') {
|
|
2302
2309
|
throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
|
|
2303
2310
|
}
|
|
@@ -2311,6 +2318,11 @@
|
|
|
2311
2318
|
preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
|
|
2312
2319
|
// the preventExtension call, in which case we should not attempt to lock down
|
|
2313
2320
|
// the shadow target.
|
|
2321
|
+
// TODO: It should not actually be possible to reach this `if` statement.
|
|
2322
|
+
// If a proxy rejects extensions, then calling preventExtensions will throw an error:
|
|
2323
|
+
// https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
|
|
2324
|
+
|
|
2325
|
+
/* istanbul ignore if */
|
|
2314
2326
|
|
|
2315
2327
|
if (isExtensible(originalTarget)) {
|
|
2316
2328
|
return false;
|
|
@@ -2352,8 +2364,8 @@
|
|
|
2352
2364
|
|
|
2353
2365
|
}
|
|
2354
2366
|
|
|
2355
|
-
const getterMap
|
|
2356
|
-
const setterMap
|
|
2367
|
+
const getterMap = new WeakMap();
|
|
2368
|
+
const setterMap = new WeakMap();
|
|
2357
2369
|
|
|
2358
2370
|
class ReadOnlyHandler extends BaseProxyHandler {
|
|
2359
2371
|
wrapValue(value) {
|
|
@@ -2361,7 +2373,7 @@
|
|
|
2361
2373
|
}
|
|
2362
2374
|
|
|
2363
2375
|
wrapGetter(originalGet) {
|
|
2364
|
-
const wrappedGetter = getterMap
|
|
2376
|
+
const wrappedGetter = getterMap.get(originalGet);
|
|
2365
2377
|
|
|
2366
2378
|
if (!isUndefined(wrappedGetter)) {
|
|
2367
2379
|
return wrappedGetter;
|
|
@@ -2374,12 +2386,12 @@
|
|
|
2374
2386
|
return handler.wrapValue(originalGet.call(unwrap$1(this)));
|
|
2375
2387
|
};
|
|
2376
2388
|
|
|
2377
|
-
getterMap
|
|
2389
|
+
getterMap.set(originalGet, get);
|
|
2378
2390
|
return get;
|
|
2379
2391
|
}
|
|
2380
2392
|
|
|
2381
2393
|
wrapSetter(originalSet) {
|
|
2382
|
-
const wrappedSetter = setterMap
|
|
2394
|
+
const wrappedSetter = setterMap.get(originalSet);
|
|
2383
2395
|
|
|
2384
2396
|
if (!isUndefined(wrappedSetter)) {
|
|
2385
2397
|
return wrappedSetter;
|
|
@@ -2388,6 +2400,7 @@
|
|
|
2388
2400
|
const handler = this;
|
|
2389
2401
|
|
|
2390
2402
|
const set = function (v) {
|
|
2403
|
+
/* istanbul ignore else */
|
|
2391
2404
|
if (process.env.NODE_ENV !== 'production') {
|
|
2392
2405
|
const {
|
|
2393
2406
|
originalTarget
|
|
@@ -2396,33 +2409,41 @@
|
|
|
2396
2409
|
}
|
|
2397
2410
|
};
|
|
2398
2411
|
|
|
2399
|
-
setterMap
|
|
2412
|
+
setterMap.set(originalSet, set);
|
|
2400
2413
|
return set;
|
|
2401
2414
|
}
|
|
2402
2415
|
|
|
2403
2416
|
set(shadowTarget, key, value) {
|
|
2417
|
+
/* istanbul ignore else */
|
|
2404
2418
|
if (process.env.NODE_ENV !== 'production') {
|
|
2405
2419
|
const {
|
|
2406
2420
|
originalTarget
|
|
2407
2421
|
} = this;
|
|
2408
|
-
|
|
2422
|
+
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.`;
|
|
2423
|
+
throw new Error(msg);
|
|
2409
2424
|
}
|
|
2425
|
+
/* istanbul ignore next */
|
|
2426
|
+
|
|
2410
2427
|
|
|
2411
2428
|
return false;
|
|
2412
2429
|
}
|
|
2413
2430
|
|
|
2414
2431
|
deleteProperty(shadowTarget, key) {
|
|
2432
|
+
/* istanbul ignore else */
|
|
2415
2433
|
if (process.env.NODE_ENV !== 'production') {
|
|
2416
2434
|
const {
|
|
2417
2435
|
originalTarget
|
|
2418
2436
|
} = this;
|
|
2419
2437
|
throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2420
2438
|
}
|
|
2439
|
+
/* istanbul ignore next */
|
|
2440
|
+
|
|
2421
2441
|
|
|
2422
2442
|
return false;
|
|
2423
2443
|
}
|
|
2424
2444
|
|
|
2425
2445
|
setPrototypeOf(shadowTarget, prototype) {
|
|
2446
|
+
/* istanbul ignore else */
|
|
2426
2447
|
if (process.env.NODE_ENV !== 'production') {
|
|
2427
2448
|
const {
|
|
2428
2449
|
originalTarget
|
|
@@ -2432,23 +2453,29 @@
|
|
|
2432
2453
|
}
|
|
2433
2454
|
|
|
2434
2455
|
preventExtensions(shadowTarget) {
|
|
2456
|
+
/* istanbul ignore else */
|
|
2435
2457
|
if (process.env.NODE_ENV !== 'production') {
|
|
2436
2458
|
const {
|
|
2437
2459
|
originalTarget
|
|
2438
2460
|
} = this;
|
|
2439
2461
|
throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
|
|
2440
2462
|
}
|
|
2463
|
+
/* istanbul ignore next */
|
|
2464
|
+
|
|
2441
2465
|
|
|
2442
2466
|
return false;
|
|
2443
2467
|
}
|
|
2444
2468
|
|
|
2445
2469
|
defineProperty(shadowTarget, key, descriptor) {
|
|
2470
|
+
/* istanbul ignore else */
|
|
2446
2471
|
if (process.env.NODE_ENV !== 'production') {
|
|
2447
2472
|
const {
|
|
2448
2473
|
originalTarget
|
|
2449
2474
|
} = this;
|
|
2450
2475
|
throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
2451
2476
|
}
|
|
2477
|
+
/* istanbul ignore next */
|
|
2478
|
+
|
|
2452
2479
|
|
|
2453
2480
|
return false;
|
|
2454
2481
|
}
|
|
@@ -2506,6 +2533,8 @@
|
|
|
2506
2533
|
}; // Inspired from paulmillr/es6-shim
|
|
2507
2534
|
// https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
|
|
2508
2535
|
|
|
2536
|
+
/* istanbul ignore next */
|
|
2537
|
+
|
|
2509
2538
|
function getGlobal() {
|
|
2510
2539
|
// the only reliable means to get the global object is `Function('return this')()`
|
|
2511
2540
|
// However, this causes CSP violations in Chrome apps.
|
|
@@ -2530,6 +2559,7 @@
|
|
|
2530
2559
|
}
|
|
2531
2560
|
|
|
2532
2561
|
function init() {
|
|
2562
|
+
/* istanbul ignore if */
|
|
2533
2563
|
if (process.env.NODE_ENV === 'production') {
|
|
2534
2564
|
// this method should never leak to prod
|
|
2535
2565
|
throw new ReferenceError();
|
|
@@ -2544,13 +2574,13 @@
|
|
|
2544
2574
|
ArrayPush.call(devtoolsFormatters, formatter);
|
|
2545
2575
|
global.devtoolsFormatters = devtoolsFormatters;
|
|
2546
2576
|
}
|
|
2577
|
+
/* istanbul ignore else */
|
|
2578
|
+
|
|
2547
2579
|
|
|
2548
2580
|
if (process.env.NODE_ENV !== 'production') {
|
|
2549
2581
|
init();
|
|
2550
2582
|
}
|
|
2551
2583
|
|
|
2552
|
-
const ObjectDotPrototype = Object.prototype;
|
|
2553
|
-
|
|
2554
2584
|
function defaultValueIsObservable(value) {
|
|
2555
2585
|
// intentionally checking for null
|
|
2556
2586
|
if (value === null) {
|
|
@@ -2578,106 +2608,85 @@
|
|
|
2578
2608
|
/* do nothing */
|
|
2579
2609
|
};
|
|
2580
2610
|
|
|
2581
|
-
const defaultValueDistortion = value => value;
|
|
2582
|
-
|
|
2583
2611
|
function createShadowTarget(value) {
|
|
2584
2612
|
return isArray(value) ? [] : {};
|
|
2585
2613
|
}
|
|
2586
2614
|
|
|
2587
|
-
class
|
|
2588
|
-
constructor(options) {
|
|
2589
|
-
this.
|
|
2590
|
-
this.
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
tagPropertyKey
|
|
2602
|
-
} = options;
|
|
2603
|
-
this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
|
|
2604
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2605
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2606
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2607
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2608
|
-
}
|
|
2615
|
+
class ObservableMembrane {
|
|
2616
|
+
constructor(options = {}) {
|
|
2617
|
+
this.readOnlyObjectGraph = new WeakMap();
|
|
2618
|
+
this.reactiveObjectGraph = new WeakMap();
|
|
2619
|
+
const {
|
|
2620
|
+
valueMutated,
|
|
2621
|
+
valueObserved,
|
|
2622
|
+
valueIsObservable,
|
|
2623
|
+
tagPropertyKey
|
|
2624
|
+
} = options;
|
|
2625
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2626
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2627
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2628
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2609
2629
|
}
|
|
2610
2630
|
|
|
2611
2631
|
getProxy(value) {
|
|
2612
2632
|
const unwrappedValue = unwrap$1(value);
|
|
2613
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2614
2633
|
|
|
2615
|
-
if (this.valueIsObservable(
|
|
2616
|
-
|
|
2617
|
-
|
|
2634
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2635
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2636
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2637
|
+
return value;
|
|
2638
|
+
}
|
|
2618
2639
|
|
|
2619
|
-
return
|
|
2640
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2620
2641
|
}
|
|
2621
2642
|
|
|
2622
|
-
return
|
|
2643
|
+
return unwrappedValue;
|
|
2623
2644
|
}
|
|
2624
2645
|
|
|
2625
2646
|
getReadOnlyProxy(value) {
|
|
2626
2647
|
value = unwrap$1(value);
|
|
2627
|
-
const distorted = this.valueDistortion(value);
|
|
2628
2648
|
|
|
2629
|
-
if (this.valueIsObservable(
|
|
2630
|
-
return this.
|
|
2649
|
+
if (this.valueIsObservable(value)) {
|
|
2650
|
+
return this.getReadOnlyHandler(value);
|
|
2631
2651
|
}
|
|
2632
2652
|
|
|
2633
|
-
return
|
|
2653
|
+
return value;
|
|
2634
2654
|
}
|
|
2635
2655
|
|
|
2636
2656
|
unwrapProxy(p) {
|
|
2637
2657
|
return unwrap$1(p);
|
|
2638
2658
|
}
|
|
2639
2659
|
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
objectGraph
|
|
2643
|
-
} = this;
|
|
2644
|
-
let reactiveState = objectGraph.get(distortedValue);
|
|
2660
|
+
getReactiveHandler(value) {
|
|
2661
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2645
2662
|
|
|
2646
|
-
if (
|
|
2647
|
-
|
|
2663
|
+
if (isUndefined(proxy)) {
|
|
2664
|
+
// caching the proxy after the first time it is accessed
|
|
2665
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2666
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2667
|
+
registerProxy(proxy, value);
|
|
2668
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2648
2669
|
}
|
|
2649
2670
|
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
get reactive() {
|
|
2653
|
-
const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
|
|
2654
|
-
|
|
2655
|
-
const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
|
|
2656
|
-
registerProxy(proxy, value);
|
|
2657
|
-
ObjectDefineProperty(this, 'reactive', {
|
|
2658
|
-
value: proxy
|
|
2659
|
-
});
|
|
2660
|
-
return proxy;
|
|
2661
|
-
},
|
|
2671
|
+
return proxy;
|
|
2672
|
+
}
|
|
2662
2673
|
|
|
2663
|
-
|
|
2664
|
-
|
|
2674
|
+
getReadOnlyHandler(value) {
|
|
2675
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2665
2676
|
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2677
|
+
if (isUndefined(proxy)) {
|
|
2678
|
+
// caching the proxy after the first time it is accessed
|
|
2679
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2680
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2681
|
+
registerProxy(proxy, value);
|
|
2682
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2683
|
+
}
|
|
2673
2684
|
|
|
2674
|
-
|
|
2675
|
-
objectGraph.set(distortedValue, reactiveState);
|
|
2676
|
-
return reactiveState;
|
|
2685
|
+
return proxy;
|
|
2677
2686
|
}
|
|
2678
2687
|
|
|
2679
2688
|
}
|
|
2680
|
-
/** version:
|
|
2689
|
+
/** version: 2.0.0 */
|
|
2681
2690
|
|
|
2682
2691
|
/*
|
|
2683
2692
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2688,15 +2697,9 @@
|
|
|
2688
2697
|
|
|
2689
2698
|
|
|
2690
2699
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2691
|
-
|
|
2692
|
-
function valueDistortion(value) {
|
|
2693
|
-
return value;
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2700
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2697
2701
|
valueObserved,
|
|
2698
2702
|
valueMutated,
|
|
2699
|
-
valueDistortion,
|
|
2700
2703
|
tagPropertyKey: lockerLivePropertyKey
|
|
2701
2704
|
});
|
|
2702
2705
|
/**
|
|
@@ -2705,16 +2708,9 @@
|
|
|
2705
2708
|
* change or being removed.
|
|
2706
2709
|
*/
|
|
2707
2710
|
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
if (unwrapped !== value) {
|
|
2712
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2713
|
-
return valueDistortion(unwrapped);
|
|
2714
|
-
}
|
|
2715
|
-
|
|
2716
|
-
return value;
|
|
2717
|
-
};
|
|
2711
|
+
function unwrap(value) {
|
|
2712
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2713
|
+
}
|
|
2718
2714
|
/*
|
|
2719
2715
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2720
2716
|
* All rights reserved.
|
|
@@ -4829,7 +4825,7 @@
|
|
|
4829
4825
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4830
4826
|
const elmAttrValue = renderer.getAttribute(elm, attrName);
|
|
4831
4827
|
|
|
4832
|
-
if (attrValue !== elmAttrValue) {
|
|
4828
|
+
if (String(attrValue) !== elmAttrValue) {
|
|
4833
4829
|
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
4834
4830
|
nodesAreCompatible = false;
|
|
4835
4831
|
}
|
|
@@ -4851,7 +4847,7 @@
|
|
|
4851
4847
|
let nodesAreCompatible = true;
|
|
4852
4848
|
let vnodeClassName;
|
|
4853
4849
|
|
|
4854
|
-
if (!isUndefined$1(className) && className !== elm.className) {
|
|
4850
|
+
if (!isUndefined$1(className) && String(className) !== elm.className) {
|
|
4855
4851
|
// className is used when class is bound to an expr.
|
|
4856
4852
|
nodesAreCompatible = false;
|
|
4857
4853
|
vnodeClassName = className;
|
|
@@ -5652,7 +5648,7 @@
|
|
|
5652
5648
|
|
|
5653
5649
|
|
|
5654
5650
|
function d(value) {
|
|
5655
|
-
return value == null ? '' : value;
|
|
5651
|
+
return value == null ? '' : String(value);
|
|
5656
5652
|
} // [b]ind function
|
|
5657
5653
|
|
|
5658
5654
|
|
|
@@ -5943,6 +5939,7 @@
|
|
|
5943
5939
|
|
|
5944
5940
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5945
5941
|
const content = [];
|
|
5942
|
+
let root;
|
|
5946
5943
|
|
|
5947
5944
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5948
5945
|
let stylesheet = stylesheets[i];
|
|
@@ -5955,23 +5952,46 @@
|
|
|
5955
5952
|
// the component instance might be attempting to use an old version of
|
|
5956
5953
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5957
5954
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5958
|
-
}
|
|
5959
|
-
|
|
5955
|
+
}
|
|
5956
|
+
|
|
5957
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5960
5958
|
|
|
5959
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5960
|
+
/* Synthetic */
|
|
5961
|
+
&& vm.renderMode === 1
|
|
5962
|
+
/* Shadow */
|
|
5963
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5964
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5961
5965
|
|
|
5962
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5963
5966
|
const useActualHostSelector = vm.renderMode === 0
|
|
5964
5967
|
/* Light */
|
|
5965
5968
|
? !isScopedCss : vm.shadowMode === 0
|
|
5966
5969
|
/* Native */
|
|
5967
|
-
; //
|
|
5970
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
5971
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
5968
5972
|
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5973
|
+
let useNativeDirPseudoclass;
|
|
5974
|
+
|
|
5975
|
+
if (vm.renderMode === 1
|
|
5972
5976
|
/* Shadow */
|
|
5973
|
-
|
|
5974
|
-
|
|
5977
|
+
) {
|
|
5978
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
5979
|
+
/* Native */
|
|
5980
|
+
;
|
|
5981
|
+
} else {
|
|
5982
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5983
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5984
|
+
if (isUndefined$1(root)) {
|
|
5985
|
+
// Only calculate the root once as necessary
|
|
5986
|
+
root = getNearestShadowComponent(vm);
|
|
5987
|
+
}
|
|
5988
|
+
|
|
5989
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
5990
|
+
/* Native */
|
|
5991
|
+
;
|
|
5992
|
+
}
|
|
5993
|
+
|
|
5994
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5975
5995
|
}
|
|
5976
5996
|
}
|
|
5977
5997
|
|
|
@@ -5995,14 +6015,12 @@
|
|
|
5995
6015
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
5996
6016
|
|
|
5997
6017
|
|
|
5998
|
-
function
|
|
6018
|
+
function getNearestShadowComponent(vm) {
|
|
5999
6019
|
let owner = vm;
|
|
6000
6020
|
|
|
6001
6021
|
while (!isNull(owner)) {
|
|
6002
6022
|
if (owner.renderMode === 1
|
|
6003
6023
|
/* Shadow */
|
|
6004
|
-
&& owner.shadowMode === 0
|
|
6005
|
-
/* Native */
|
|
6006
6024
|
) {
|
|
6007
6025
|
return owner;
|
|
6008
6026
|
}
|
|
@@ -6013,6 +6031,20 @@
|
|
|
6013
6031
|
return owner;
|
|
6014
6032
|
}
|
|
6015
6033
|
|
|
6034
|
+
function getNearestNativeShadowComponent(vm) {
|
|
6035
|
+
const owner = getNearestShadowComponent(vm);
|
|
6036
|
+
|
|
6037
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
6038
|
+
/* Synthetic */
|
|
6039
|
+
) {
|
|
6040
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
6041
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
6042
|
+
return null;
|
|
6043
|
+
}
|
|
6044
|
+
|
|
6045
|
+
return owner;
|
|
6046
|
+
}
|
|
6047
|
+
|
|
6016
6048
|
function createStylesheet(vm, stylesheets) {
|
|
6017
6049
|
const {
|
|
6018
6050
|
renderer,
|
|
@@ -6028,7 +6060,7 @@
|
|
|
6028
6060
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
6029
6061
|
renderer.insertGlobalStylesheet(stylesheets[i]);
|
|
6030
6062
|
}
|
|
6031
|
-
} else if (renderer.ssr || renderer.isHydrating) {
|
|
6063
|
+
} else if (renderer.ssr || renderer.isHydrating()) {
|
|
6032
6064
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
6033
6065
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
6034
6066
|
// the first time the VM renders.
|
|
@@ -7753,7 +7785,7 @@
|
|
|
7753
7785
|
hooksAreSet = true;
|
|
7754
7786
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7755
7787
|
}
|
|
7756
|
-
/* version: 2.
|
|
7788
|
+
/* version: 2.6.1 */
|
|
7757
7789
|
|
|
7758
7790
|
/*
|
|
7759
7791
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7906,7 +7938,7 @@
|
|
|
7906
7938
|
const renderer = {
|
|
7907
7939
|
ssr: false,
|
|
7908
7940
|
|
|
7909
|
-
|
|
7941
|
+
isHydrating() {
|
|
7910
7942
|
return isHydrating;
|
|
7911
7943
|
},
|
|
7912
7944
|
|
|
@@ -8409,7 +8441,7 @@
|
|
|
8409
8441
|
});
|
|
8410
8442
|
freeze(LightningElement);
|
|
8411
8443
|
seal(LightningElement.prototype);
|
|
8412
|
-
/* version: 2.
|
|
8444
|
+
/* version: 2.6.1 */
|
|
8413
8445
|
|
|
8414
8446
|
exports.LightningElement = LightningElement;
|
|
8415
8447
|
exports.__unstable__ProfilerControl = profilerControl;
|