@lwc/engine-core 2.7.1 → 2.7.2
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-core.cjs.js +321 -206
- package/dist/engine-core.js +282 -207
- package/package.json +4 -4
- package/types/framework/html-element.d.ts +2 -0
- package/types/framework/main.d.ts +1 -1
- package/types/framework/upgradable-element.d.ts +1 -2
- package/types/framework/vm.d.ts +1 -3
- package/types/renderer.d.ts +122 -0
- package/types/framework/renderer.d.ts +0 -46
package/dist/engine-core.js
CHANGED
|
@@ -70,6 +70,170 @@ function parseStyleText(cssText) {
|
|
|
70
70
|
return styleMap;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
//
|
|
74
|
+
// Primitives
|
|
75
|
+
//
|
|
76
|
+
let ssr;
|
|
77
|
+
function setSsr(ssrImpl) {
|
|
78
|
+
ssr = ssrImpl;
|
|
79
|
+
}
|
|
80
|
+
let isNativeShadowDefined;
|
|
81
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
82
|
+
isNativeShadowDefined = isNativeShadowDefinedImpl;
|
|
83
|
+
}
|
|
84
|
+
let isSyntheticShadowDefined;
|
|
85
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
86
|
+
isSyntheticShadowDefined = isSyntheticShadowDefinedImpl;
|
|
87
|
+
}
|
|
88
|
+
let HTMLElementExported;
|
|
89
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
90
|
+
HTMLElementExported = HTMLElementImpl;
|
|
91
|
+
}
|
|
92
|
+
let isHydrating;
|
|
93
|
+
function setIsHydrating(isHydratingImpl) {
|
|
94
|
+
isHydrating = isHydratingImpl;
|
|
95
|
+
}
|
|
96
|
+
let insert;
|
|
97
|
+
function setInsert(insertImpl) {
|
|
98
|
+
insert = insertImpl;
|
|
99
|
+
}
|
|
100
|
+
let remove;
|
|
101
|
+
function setRemove(removeImpl) {
|
|
102
|
+
remove = removeImpl;
|
|
103
|
+
}
|
|
104
|
+
let createElement;
|
|
105
|
+
function setCreateElement(createElementImpl) {
|
|
106
|
+
createElement = createElementImpl;
|
|
107
|
+
}
|
|
108
|
+
let createText;
|
|
109
|
+
function setCreateText(createTextImpl) {
|
|
110
|
+
createText = createTextImpl;
|
|
111
|
+
}
|
|
112
|
+
let createComment;
|
|
113
|
+
function setCreateComment(createCommentImpl) {
|
|
114
|
+
createComment = createCommentImpl;
|
|
115
|
+
}
|
|
116
|
+
let nextSibling;
|
|
117
|
+
function setNextSibling(nextSiblingImpl) {
|
|
118
|
+
nextSibling = nextSiblingImpl;
|
|
119
|
+
}
|
|
120
|
+
let attachShadow;
|
|
121
|
+
function setAttachShadow(attachShadowImpl) {
|
|
122
|
+
attachShadow = attachShadowImpl;
|
|
123
|
+
}
|
|
124
|
+
let getProperty;
|
|
125
|
+
function setGetProperty(getPropertyImpl) {
|
|
126
|
+
getProperty = getPropertyImpl;
|
|
127
|
+
}
|
|
128
|
+
let setProperty;
|
|
129
|
+
function setSetProperty(setPropertyImpl) {
|
|
130
|
+
setProperty = setPropertyImpl;
|
|
131
|
+
}
|
|
132
|
+
let setText;
|
|
133
|
+
function setSetText(setTextImpl) {
|
|
134
|
+
setText = setTextImpl;
|
|
135
|
+
}
|
|
136
|
+
let getAttribute;
|
|
137
|
+
function setGetAttribute(getAttributeImpl) {
|
|
138
|
+
getAttribute = getAttributeImpl;
|
|
139
|
+
}
|
|
140
|
+
let setAttribute;
|
|
141
|
+
function setSetAttribute(setAttributeImpl) {
|
|
142
|
+
setAttribute = setAttributeImpl;
|
|
143
|
+
}
|
|
144
|
+
let removeAttribute;
|
|
145
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
146
|
+
removeAttribute = removeAttributeImpl;
|
|
147
|
+
}
|
|
148
|
+
let addEventListener;
|
|
149
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
150
|
+
addEventListener = addEventListenerImpl;
|
|
151
|
+
}
|
|
152
|
+
let removeEventListener;
|
|
153
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
154
|
+
removeEventListener = removeEventListenerImpl;
|
|
155
|
+
}
|
|
156
|
+
let dispatchEvent;
|
|
157
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
158
|
+
dispatchEvent = dispatchEventImpl;
|
|
159
|
+
}
|
|
160
|
+
let getClassList;
|
|
161
|
+
function setGetClassList(getClassListImpl) {
|
|
162
|
+
getClassList = getClassListImpl;
|
|
163
|
+
}
|
|
164
|
+
let setCSSStyleProperty;
|
|
165
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
166
|
+
setCSSStyleProperty = setCSSStylePropertyImpl;
|
|
167
|
+
}
|
|
168
|
+
let getBoundingClientRect;
|
|
169
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
170
|
+
getBoundingClientRect = getBoundingClientRectImpl;
|
|
171
|
+
}
|
|
172
|
+
let querySelector;
|
|
173
|
+
function setQuerySelector(querySelectorImpl) {
|
|
174
|
+
querySelector = querySelectorImpl;
|
|
175
|
+
}
|
|
176
|
+
let querySelectorAll;
|
|
177
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
178
|
+
querySelectorAll = querySelectorAllImpl;
|
|
179
|
+
}
|
|
180
|
+
let getElementsByTagName;
|
|
181
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
182
|
+
getElementsByTagName = getElementsByTagNameImpl;
|
|
183
|
+
}
|
|
184
|
+
let getElementsByClassName;
|
|
185
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
186
|
+
getElementsByClassName = getElementsByClassNameImpl;
|
|
187
|
+
}
|
|
188
|
+
let getChildren;
|
|
189
|
+
function setGetChildren(getChildrenImpl) {
|
|
190
|
+
getChildren = getChildrenImpl;
|
|
191
|
+
}
|
|
192
|
+
let getChildNodes;
|
|
193
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
194
|
+
getChildNodes = getChildNodesImpl;
|
|
195
|
+
}
|
|
196
|
+
let getFirstChild;
|
|
197
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
198
|
+
getFirstChild = getFirstChildImpl;
|
|
199
|
+
}
|
|
200
|
+
let getFirstElementChild;
|
|
201
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
202
|
+
getFirstElementChild = getFirstElementChildImpl;
|
|
203
|
+
}
|
|
204
|
+
let getLastChild;
|
|
205
|
+
function setGetLastChild(getLastChildImpl) {
|
|
206
|
+
getLastChild = getLastChildImpl;
|
|
207
|
+
}
|
|
208
|
+
let getLastElementChild;
|
|
209
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
210
|
+
getLastElementChild = getLastElementChildImpl;
|
|
211
|
+
}
|
|
212
|
+
let isConnected;
|
|
213
|
+
function setIsConnected(isConnectedImpl) {
|
|
214
|
+
isConnected = isConnectedImpl;
|
|
215
|
+
}
|
|
216
|
+
let insertGlobalStylesheet;
|
|
217
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
218
|
+
insertGlobalStylesheet = insertGlobalStylesheetImpl;
|
|
219
|
+
}
|
|
220
|
+
let insertStylesheet;
|
|
221
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
222
|
+
insertStylesheet = insertStylesheetImpl;
|
|
223
|
+
}
|
|
224
|
+
let assertInstanceOfHTMLElement;
|
|
225
|
+
function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
|
|
226
|
+
assertInstanceOfHTMLElement = assertInstanceOfHTMLElementImpl;
|
|
227
|
+
}
|
|
228
|
+
let defineCustomElement;
|
|
229
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
230
|
+
defineCustomElement = defineCustomElementImpl;
|
|
231
|
+
}
|
|
232
|
+
let getCustomElement;
|
|
233
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
234
|
+
getCustomElement = getCustomElementImpl;
|
|
235
|
+
}
|
|
236
|
+
|
|
73
237
|
/*
|
|
74
238
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
75
239
|
* All rights reserved.
|
|
@@ -311,9 +475,6 @@ function createAllEventListeners(vnode) {
|
|
|
311
475
|
elm,
|
|
312
476
|
data: {
|
|
313
477
|
on
|
|
314
|
-
},
|
|
315
|
-
owner: {
|
|
316
|
-
renderer
|
|
317
478
|
}
|
|
318
479
|
} = vnode;
|
|
319
480
|
|
|
@@ -326,7 +487,7 @@ function createAllEventListeners(vnode) {
|
|
|
326
487
|
let name;
|
|
327
488
|
|
|
328
489
|
for (name in on) {
|
|
329
|
-
|
|
490
|
+
addEventListener(elm, name, listener);
|
|
330
491
|
}
|
|
331
492
|
}
|
|
332
493
|
|
|
@@ -465,9 +626,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
465
626
|
const {
|
|
466
627
|
data: {
|
|
467
628
|
attrs
|
|
468
|
-
},
|
|
469
|
-
owner: {
|
|
470
|
-
renderer
|
|
471
629
|
}
|
|
472
630
|
} = vnode;
|
|
473
631
|
|
|
@@ -490,10 +648,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
490
648
|
}
|
|
491
649
|
|
|
492
650
|
const elm = vnode.elm;
|
|
493
|
-
const {
|
|
494
|
-
setAttribute,
|
|
495
|
-
removeAttribute
|
|
496
|
-
} = renderer;
|
|
497
651
|
let key;
|
|
498
652
|
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
499
653
|
// this routine is only useful for data-* attributes in all kind of elements
|
|
@@ -512,7 +666,7 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
512
666
|
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
513
667
|
// Assume xlink namespace
|
|
514
668
|
setAttribute(elm, key, cur, xlinkNS);
|
|
515
|
-
} else if (isNull(cur)) {
|
|
669
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
516
670
|
removeAttribute(elm, key);
|
|
517
671
|
} else {
|
|
518
672
|
setAttribute(elm, key, cur);
|
|
@@ -564,17 +718,14 @@ function update(oldVnode, vnode) {
|
|
|
564
718
|
const isFirstPatch = isUndefined$1(oldProps);
|
|
565
719
|
const {
|
|
566
720
|
elm,
|
|
567
|
-
sel
|
|
568
|
-
owner: {
|
|
569
|
-
renderer
|
|
570
|
-
}
|
|
721
|
+
sel
|
|
571
722
|
} = vnode;
|
|
572
723
|
|
|
573
724
|
for (const key in props) {
|
|
574
725
|
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
575
726
|
|
|
576
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ?
|
|
577
|
-
|
|
727
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
728
|
+
setProperty(elm, key, cur);
|
|
578
729
|
}
|
|
579
730
|
}
|
|
580
731
|
}
|
|
@@ -643,9 +794,6 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
643
794
|
elm,
|
|
644
795
|
data: {
|
|
645
796
|
className: newClass
|
|
646
|
-
},
|
|
647
|
-
owner: {
|
|
648
|
-
renderer
|
|
649
797
|
}
|
|
650
798
|
} = vnode;
|
|
651
799
|
const {
|
|
@@ -658,7 +806,7 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
658
806
|
return;
|
|
659
807
|
}
|
|
660
808
|
|
|
661
|
-
const classList =
|
|
809
|
+
const classList = getClassList(elm);
|
|
662
810
|
const newClassMap = getMapFromClassName(newClass);
|
|
663
811
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
664
812
|
let name;
|
|
@@ -697,15 +845,8 @@ function updateStyleAttribute(oldVnode, vnode) {
|
|
|
697
845
|
elm,
|
|
698
846
|
data: {
|
|
699
847
|
style: newStyle
|
|
700
|
-
},
|
|
701
|
-
owner: {
|
|
702
|
-
renderer
|
|
703
848
|
}
|
|
704
849
|
} = vnode;
|
|
705
|
-
const {
|
|
706
|
-
setAttribute,
|
|
707
|
-
removeAttribute
|
|
708
|
-
} = renderer;
|
|
709
850
|
|
|
710
851
|
if (oldVnode.data.style === newStyle) {
|
|
711
852
|
return;
|
|
@@ -740,9 +881,6 @@ function createClassAttribute(vnode) {
|
|
|
740
881
|
elm,
|
|
741
882
|
data: {
|
|
742
883
|
classMap
|
|
743
|
-
},
|
|
744
|
-
owner: {
|
|
745
|
-
renderer
|
|
746
884
|
}
|
|
747
885
|
} = vnode;
|
|
748
886
|
|
|
@@ -750,7 +888,7 @@ function createClassAttribute(vnode) {
|
|
|
750
888
|
return;
|
|
751
889
|
}
|
|
752
890
|
|
|
753
|
-
const classList =
|
|
891
|
+
const classList = getClassList(elm);
|
|
754
892
|
|
|
755
893
|
for (const name in classMap) {
|
|
756
894
|
classList.add(name);
|
|
@@ -775,9 +913,6 @@ function createStyleAttribute(vnode) {
|
|
|
775
913
|
elm,
|
|
776
914
|
data: {
|
|
777
915
|
styleDecls
|
|
778
|
-
},
|
|
779
|
-
owner: {
|
|
780
|
-
renderer
|
|
781
916
|
}
|
|
782
917
|
} = vnode;
|
|
783
918
|
|
|
@@ -787,7 +922,7 @@ function createStyleAttribute(vnode) {
|
|
|
787
922
|
|
|
788
923
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
789
924
|
const [prop, value, important] = styleDecls[i];
|
|
790
|
-
|
|
925
|
+
setCSSStyleProperty(elm, prop, value, important);
|
|
791
926
|
}
|
|
792
927
|
}
|
|
793
928
|
|
|
@@ -802,14 +937,6 @@ var modStaticStyle = {
|
|
|
802
937
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
803
938
|
*/
|
|
804
939
|
|
|
805
|
-
/**
|
|
806
|
-
@license
|
|
807
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
808
|
-
This code may only be used under the MIT License found at
|
|
809
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
810
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
811
|
-
https://github.com/snabbdom/snabbdom/
|
|
812
|
-
*/
|
|
813
940
|
function isUndef(s) {
|
|
814
941
|
return s === undefined;
|
|
815
942
|
}
|
|
@@ -897,7 +1024,7 @@ function updateDynamicChildren(parentElm, oldCh, newCh) {
|
|
|
897
1024
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
898
1025
|
// Vnode moved right
|
|
899
1026
|
patchVnode(oldStartVnode, newEndVnode);
|
|
900
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1027
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling(oldEndVnode.elm));
|
|
901
1028
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
902
1029
|
newEndVnode = newCh[--newEndIdx];
|
|
903
1030
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1374,7 +1501,7 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
|
1374
1501
|
}
|
|
1375
1502
|
|
|
1376
1503
|
/*
|
|
1377
|
-
* Copyright (c)
|
|
1504
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1378
1505
|
* All rights reserved.
|
|
1379
1506
|
* SPDX-License-Identifier: MIT
|
|
1380
1507
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -2289,9 +2416,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
2289
2416
|
|
|
2290
2417
|
|
|
2291
2418
|
const LightningElement = function () {
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2419
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2295
2420
|
if (isNull(vmBeingConstructed)) {
|
|
2296
2421
|
throw new ReferenceError('Illegal constructor');
|
|
2297
2422
|
}
|
|
@@ -2299,15 +2424,14 @@ const LightningElement = function () {
|
|
|
2299
2424
|
const vm = vmBeingConstructed;
|
|
2300
2425
|
const {
|
|
2301
2426
|
def,
|
|
2302
|
-
elm
|
|
2303
|
-
renderer
|
|
2427
|
+
elm
|
|
2304
2428
|
} = vm;
|
|
2305
2429
|
const {
|
|
2306
2430
|
bridge
|
|
2307
2431
|
} = def;
|
|
2308
2432
|
|
|
2309
2433
|
if (process.env.NODE_ENV !== 'production') {
|
|
2310
|
-
|
|
2434
|
+
assertInstanceOfHTMLElement(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
|
|
2311
2435
|
}
|
|
2312
2436
|
|
|
2313
2437
|
const component = this;
|
|
@@ -2337,7 +2461,7 @@ const LightningElement = function () {
|
|
|
2337
2461
|
if (vm.renderMode === 1
|
|
2338
2462
|
/* Shadow */
|
|
2339
2463
|
) {
|
|
2340
|
-
|
|
2464
|
+
doAttachShadow(vm);
|
|
2341
2465
|
} // Adding extra guard rails in DEV mode.
|
|
2342
2466
|
|
|
2343
2467
|
|
|
@@ -2349,17 +2473,16 @@ const LightningElement = function () {
|
|
|
2349
2473
|
return this;
|
|
2350
2474
|
};
|
|
2351
2475
|
|
|
2352
|
-
function
|
|
2476
|
+
function doAttachShadow(vm) {
|
|
2353
2477
|
const {
|
|
2354
2478
|
elm,
|
|
2355
2479
|
mode,
|
|
2356
|
-
renderer,
|
|
2357
2480
|
shadowMode,
|
|
2358
2481
|
def: {
|
|
2359
2482
|
ctor
|
|
2360
2483
|
}
|
|
2361
2484
|
} = vm;
|
|
2362
|
-
const cmpRoot =
|
|
2485
|
+
const cmpRoot = attachShadow(elm, {
|
|
2363
2486
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2364
2487
|
/* Synthetic */
|
|
2365
2488
|
,
|
|
@@ -2386,10 +2509,7 @@ LightningElement.prototype = {
|
|
|
2386
2509
|
|
|
2387
2510
|
dispatchEvent(event) {
|
|
2388
2511
|
const {
|
|
2389
|
-
elm
|
|
2390
|
-
renderer: {
|
|
2391
|
-
dispatchEvent
|
|
2392
|
-
}
|
|
2512
|
+
elm
|
|
2393
2513
|
} = getAssociatedVM(this);
|
|
2394
2514
|
return dispatchEvent(elm, event);
|
|
2395
2515
|
},
|
|
@@ -2397,10 +2517,7 @@ LightningElement.prototype = {
|
|
|
2397
2517
|
addEventListener(type, listener, options) {
|
|
2398
2518
|
const vm = getAssociatedVM(this);
|
|
2399
2519
|
const {
|
|
2400
|
-
elm
|
|
2401
|
-
renderer: {
|
|
2402
|
-
addEventListener
|
|
2403
|
-
}
|
|
2520
|
+
elm
|
|
2404
2521
|
} = vm;
|
|
2405
2522
|
|
|
2406
2523
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2417,10 +2534,7 @@ LightningElement.prototype = {
|
|
|
2417
2534
|
removeEventListener(type, listener, options) {
|
|
2418
2535
|
const vm = getAssociatedVM(this);
|
|
2419
2536
|
const {
|
|
2420
|
-
elm
|
|
2421
|
-
renderer: {
|
|
2422
|
-
removeEventListener
|
|
2423
|
-
}
|
|
2537
|
+
elm
|
|
2424
2538
|
} = vm;
|
|
2425
2539
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2426
2540
|
removeEventListener(elm, type, wrappedListener, options);
|
|
@@ -2428,30 +2542,21 @@ LightningElement.prototype = {
|
|
|
2428
2542
|
|
|
2429
2543
|
hasAttribute(name) {
|
|
2430
2544
|
const {
|
|
2431
|
-
elm
|
|
2432
|
-
renderer: {
|
|
2433
|
-
getAttribute
|
|
2434
|
-
}
|
|
2545
|
+
elm
|
|
2435
2546
|
} = getAssociatedVM(this);
|
|
2436
2547
|
return !isNull(getAttribute(elm, name));
|
|
2437
2548
|
},
|
|
2438
2549
|
|
|
2439
2550
|
hasAttributeNS(namespace, name) {
|
|
2440
2551
|
const {
|
|
2441
|
-
elm
|
|
2442
|
-
renderer: {
|
|
2443
|
-
getAttribute
|
|
2444
|
-
}
|
|
2552
|
+
elm
|
|
2445
2553
|
} = getAssociatedVM(this);
|
|
2446
2554
|
return !isNull(getAttribute(elm, name, namespace));
|
|
2447
2555
|
},
|
|
2448
2556
|
|
|
2449
2557
|
removeAttribute(name) {
|
|
2450
2558
|
const {
|
|
2451
|
-
elm
|
|
2452
|
-
renderer: {
|
|
2453
|
-
removeAttribute
|
|
2454
|
-
}
|
|
2559
|
+
elm
|
|
2455
2560
|
} = getAssociatedVM(this);
|
|
2456
2561
|
unlockAttribute(elm, name);
|
|
2457
2562
|
removeAttribute(elm, name);
|
|
@@ -2460,10 +2565,7 @@ LightningElement.prototype = {
|
|
|
2460
2565
|
|
|
2461
2566
|
removeAttributeNS(namespace, name) {
|
|
2462
2567
|
const {
|
|
2463
|
-
elm
|
|
2464
|
-
renderer: {
|
|
2465
|
-
removeAttribute
|
|
2466
|
-
}
|
|
2568
|
+
elm
|
|
2467
2569
|
} = getAssociatedVM(this);
|
|
2468
2570
|
unlockAttribute(elm, name);
|
|
2469
2571
|
removeAttribute(elm, name, namespace);
|
|
@@ -2472,20 +2574,14 @@ LightningElement.prototype = {
|
|
|
2472
2574
|
|
|
2473
2575
|
getAttribute(name) {
|
|
2474
2576
|
const {
|
|
2475
|
-
elm
|
|
2476
|
-
renderer: {
|
|
2477
|
-
getAttribute
|
|
2478
|
-
}
|
|
2577
|
+
elm
|
|
2479
2578
|
} = getAssociatedVM(this);
|
|
2480
2579
|
return getAttribute(elm, name);
|
|
2481
2580
|
},
|
|
2482
2581
|
|
|
2483
2582
|
getAttributeNS(namespace, name) {
|
|
2484
2583
|
const {
|
|
2485
|
-
elm
|
|
2486
|
-
renderer: {
|
|
2487
|
-
getAttribute
|
|
2488
|
-
}
|
|
2584
|
+
elm
|
|
2489
2585
|
} = getAssociatedVM(this);
|
|
2490
2586
|
return getAttribute(elm, name, namespace);
|
|
2491
2587
|
},
|
|
@@ -2493,10 +2589,7 @@ LightningElement.prototype = {
|
|
|
2493
2589
|
setAttribute(name, value) {
|
|
2494
2590
|
const vm = getAssociatedVM(this);
|
|
2495
2591
|
const {
|
|
2496
|
-
elm
|
|
2497
|
-
renderer: {
|
|
2498
|
-
setAttribute
|
|
2499
|
-
}
|
|
2592
|
+
elm
|
|
2500
2593
|
} = vm;
|
|
2501
2594
|
|
|
2502
2595
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2511,10 +2604,7 @@ LightningElement.prototype = {
|
|
|
2511
2604
|
setAttributeNS(namespace, name, value) {
|
|
2512
2605
|
const vm = getAssociatedVM(this);
|
|
2513
2606
|
const {
|
|
2514
|
-
elm
|
|
2515
|
-
renderer: {
|
|
2516
|
-
setAttribute
|
|
2517
|
-
}
|
|
2607
|
+
elm
|
|
2518
2608
|
} = vm;
|
|
2519
2609
|
|
|
2520
2610
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2529,10 +2619,7 @@ LightningElement.prototype = {
|
|
|
2529
2619
|
getBoundingClientRect() {
|
|
2530
2620
|
const vm = getAssociatedVM(this);
|
|
2531
2621
|
const {
|
|
2532
|
-
elm
|
|
2533
|
-
renderer: {
|
|
2534
|
-
getBoundingClientRect
|
|
2535
|
-
}
|
|
2622
|
+
elm
|
|
2536
2623
|
} = vm;
|
|
2537
2624
|
|
|
2538
2625
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2544,10 +2631,7 @@ LightningElement.prototype = {
|
|
|
2544
2631
|
|
|
2545
2632
|
get isConnected() {
|
|
2546
2633
|
const {
|
|
2547
|
-
elm
|
|
2548
|
-
renderer: {
|
|
2549
|
-
isConnected
|
|
2550
|
-
}
|
|
2634
|
+
elm
|
|
2551
2635
|
} = getAssociatedVM(this);
|
|
2552
2636
|
return isConnected(elm);
|
|
2553
2637
|
},
|
|
@@ -2555,10 +2639,7 @@ LightningElement.prototype = {
|
|
|
2555
2639
|
get classList() {
|
|
2556
2640
|
const vm = getAssociatedVM(this);
|
|
2557
2641
|
const {
|
|
2558
|
-
elm
|
|
2559
|
-
renderer: {
|
|
2560
|
-
getClassList
|
|
2561
|
-
}
|
|
2642
|
+
elm
|
|
2562
2643
|
} = vm;
|
|
2563
2644
|
|
|
2564
2645
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2601,23 +2682,48 @@ LightningElement.prototype = {
|
|
|
2601
2682
|
}
|
|
2602
2683
|
|
|
2603
2684
|
};
|
|
2604
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
2605
|
-
|
|
2685
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
2686
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
2687
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
2688
|
+
|
|
2689
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
2690
|
+
|
|
2691
|
+
function getChildGetter(methodName) {
|
|
2692
|
+
switch (methodName) {
|
|
2693
|
+
case 'children':
|
|
2694
|
+
return getChildren;
|
|
2695
|
+
|
|
2696
|
+
case 'childNodes':
|
|
2697
|
+
return getChildNodes;
|
|
2698
|
+
|
|
2699
|
+
case 'firstChild':
|
|
2700
|
+
return getFirstChild;
|
|
2606
2701
|
|
|
2607
|
-
|
|
2608
|
-
|
|
2702
|
+
case 'firstElementChild':
|
|
2703
|
+
return getFirstElementChild;
|
|
2704
|
+
|
|
2705
|
+
case 'lastChild':
|
|
2706
|
+
return getLastChild;
|
|
2707
|
+
|
|
2708
|
+
case 'lastElementChild':
|
|
2709
|
+
return getLastElementChild;
|
|
2710
|
+
}
|
|
2711
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
2712
|
+
|
|
2713
|
+
|
|
2714
|
+
for (const childGetter of childGetters) {
|
|
2715
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
2609
2716
|
get() {
|
|
2610
2717
|
const vm = getAssociatedVM(this);
|
|
2611
2718
|
const {
|
|
2612
|
-
elm
|
|
2613
|
-
renderer
|
|
2719
|
+
elm
|
|
2614
2720
|
} = vm;
|
|
2615
2721
|
|
|
2616
2722
|
if (process.env.NODE_ENV !== 'production') {
|
|
2617
|
-
warnIfInvokedDuringConstruction(vm,
|
|
2723
|
+
warnIfInvokedDuringConstruction(vm, childGetter);
|
|
2618
2724
|
}
|
|
2619
2725
|
|
|
2620
|
-
return
|
|
2726
|
+
return getChildGetter(childGetter)(elm);
|
|
2621
2727
|
},
|
|
2622
2728
|
|
|
2623
2729
|
configurable: true,
|
|
@@ -2625,22 +2731,38 @@ for (const [elementProp, rendererMethod] of childGetters) {
|
|
|
2625
2731
|
};
|
|
2626
2732
|
}
|
|
2627
2733
|
|
|
2628
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2734
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2735
|
+
|
|
2736
|
+
function getQueryMethod(methodName) {
|
|
2737
|
+
switch (methodName) {
|
|
2738
|
+
case 'getElementsByClassName':
|
|
2739
|
+
return getElementsByClassName;
|
|
2740
|
+
|
|
2741
|
+
case 'getElementsByTagName':
|
|
2742
|
+
return getElementsByTagName;
|
|
2743
|
+
|
|
2744
|
+
case 'querySelector':
|
|
2745
|
+
return querySelector;
|
|
2746
|
+
|
|
2747
|
+
case 'querySelectorAll':
|
|
2748
|
+
return querySelectorAll;
|
|
2749
|
+
}
|
|
2750
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
2751
|
+
|
|
2629
2752
|
|
|
2630
2753
|
for (const queryMethod of queryMethods) {
|
|
2631
2754
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
2632
2755
|
value(arg) {
|
|
2633
2756
|
const vm = getAssociatedVM(this);
|
|
2634
2757
|
const {
|
|
2635
|
-
elm
|
|
2636
|
-
renderer
|
|
2758
|
+
elm
|
|
2637
2759
|
} = vm;
|
|
2638
2760
|
|
|
2639
2761
|
if (process.env.NODE_ENV !== 'production') {
|
|
2640
2762
|
warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
|
|
2641
2763
|
}
|
|
2642
2764
|
|
|
2643
|
-
return
|
|
2765
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
2644
2766
|
},
|
|
2645
2767
|
|
|
2646
2768
|
configurable: true,
|
|
@@ -4011,17 +4133,14 @@ function setScopeTokenClassIfNecessary(elm, owner) {
|
|
|
4011
4133
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
4012
4134
|
|
|
4013
4135
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
4014
|
-
|
|
4136
|
+
getClassList(elm).add(token);
|
|
4015
4137
|
}
|
|
4016
4138
|
}
|
|
4017
4139
|
|
|
4018
4140
|
function updateNodeHook(oldVnode, vnode) {
|
|
4019
4141
|
const {
|
|
4020
4142
|
elm,
|
|
4021
|
-
text
|
|
4022
|
-
owner: {
|
|
4023
|
-
renderer
|
|
4024
|
-
}
|
|
4143
|
+
text
|
|
4025
4144
|
} = vnode;
|
|
4026
4145
|
|
|
4027
4146
|
if (oldVnode.text !== text) {
|
|
@@ -4029,7 +4148,7 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4029
4148
|
unlockDomMutation();
|
|
4030
4149
|
}
|
|
4031
4150
|
|
|
4032
|
-
|
|
4151
|
+
setText(elm, text);
|
|
4033
4152
|
|
|
4034
4153
|
if (process.env.NODE_ENV !== 'production') {
|
|
4035
4154
|
lockDomMutation();
|
|
@@ -4037,30 +4156,22 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4037
4156
|
}
|
|
4038
4157
|
}
|
|
4039
4158
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
4040
|
-
const {
|
|
4041
|
-
renderer
|
|
4042
|
-
} = vnode.owner;
|
|
4043
|
-
|
|
4044
4159
|
if (process.env.NODE_ENV !== 'production') {
|
|
4045
4160
|
unlockDomMutation();
|
|
4046
4161
|
}
|
|
4047
4162
|
|
|
4048
|
-
|
|
4163
|
+
insert(vnode.elm, parentNode, referenceNode);
|
|
4049
4164
|
|
|
4050
4165
|
if (process.env.NODE_ENV !== 'production') {
|
|
4051
4166
|
lockDomMutation();
|
|
4052
4167
|
}
|
|
4053
4168
|
}
|
|
4054
4169
|
function removeNodeHook(vnode, parentNode) {
|
|
4055
|
-
const {
|
|
4056
|
-
renderer
|
|
4057
|
-
} = vnode.owner;
|
|
4058
|
-
|
|
4059
4170
|
if (process.env.NODE_ENV !== 'production') {
|
|
4060
4171
|
unlockDomMutation();
|
|
4061
4172
|
}
|
|
4062
4173
|
|
|
4063
|
-
|
|
4174
|
+
remove(vnode.elm, parentNode);
|
|
4064
4175
|
|
|
4065
4176
|
if (process.env.NODE_ENV !== 'production') {
|
|
4066
4177
|
lockDomMutation();
|
|
@@ -4219,8 +4330,7 @@ function createViewModelHook(elm, vnode) {
|
|
|
4219
4330
|
createVM(elm, def, {
|
|
4220
4331
|
mode,
|
|
4221
4332
|
owner,
|
|
4222
|
-
tagName: sel
|
|
4223
|
-
renderer: owner.renderer
|
|
4333
|
+
tagName: sel
|
|
4224
4334
|
});
|
|
4225
4335
|
|
|
4226
4336
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4264,16 +4374,13 @@ function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
|
|
|
4264
4374
|
const {
|
|
4265
4375
|
data: {
|
|
4266
4376
|
attrs = {}
|
|
4267
|
-
},
|
|
4268
|
-
owner: {
|
|
4269
|
-
renderer
|
|
4270
4377
|
}
|
|
4271
4378
|
} = vnode;
|
|
4272
4379
|
let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
4273
4380
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
4274
4381
|
|
|
4275
4382
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4276
|
-
const elmAttrValue =
|
|
4383
|
+
const elmAttrValue = getAttribute(elm, attrName);
|
|
4277
4384
|
|
|
4278
4385
|
if (String(attrValue) !== elmAttrValue) {
|
|
4279
4386
|
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
@@ -4289,9 +4396,6 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4289
4396
|
data: {
|
|
4290
4397
|
className,
|
|
4291
4398
|
classMap
|
|
4292
|
-
},
|
|
4293
|
-
owner: {
|
|
4294
|
-
renderer
|
|
4295
4399
|
}
|
|
4296
4400
|
} = vnode;
|
|
4297
4401
|
let nodesAreCompatible = true;
|
|
@@ -4303,7 +4407,7 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4303
4407
|
vnodeClassName = className;
|
|
4304
4408
|
} else if (!isUndefined$1(classMap)) {
|
|
4305
4409
|
// classMap is used when class is set to static value.
|
|
4306
|
-
const classList =
|
|
4410
|
+
const classList = getClassList(elm);
|
|
4307
4411
|
let computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
4308
4412
|
|
|
4309
4413
|
for (const name in classMap) {
|
|
@@ -4333,12 +4437,9 @@ function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
|
|
|
4333
4437
|
data: {
|
|
4334
4438
|
style,
|
|
4335
4439
|
styleDecls
|
|
4336
|
-
},
|
|
4337
|
-
owner: {
|
|
4338
|
-
renderer
|
|
4339
4440
|
}
|
|
4340
4441
|
} = vnode;
|
|
4341
|
-
const elmStyle =
|
|
4442
|
+
const elmStyle = getAttribute(elm, 'style') || '';
|
|
4342
4443
|
let vnodeStyle;
|
|
4343
4444
|
let nodesAreCompatible = true;
|
|
4344
4445
|
|
|
@@ -4470,12 +4571,12 @@ function hasDynamicChildren(children) {
|
|
|
4470
4571
|
* SPDX-License-Identifier: MIT
|
|
4471
4572
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
4472
4573
|
*/
|
|
4473
|
-
function getUpgradableConstructor(tagName
|
|
4574
|
+
function getUpgradableConstructor(tagName) {
|
|
4474
4575
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
4475
4576
|
// produce only tags with lowercase letters
|
|
4476
4577
|
// But, for backwards compatibility, we will lower case the tagName
|
|
4477
4578
|
tagName = tagName.toLowerCase();
|
|
4478
|
-
let CE =
|
|
4579
|
+
let CE = getCustomElement(tagName);
|
|
4479
4580
|
|
|
4480
4581
|
if (!isUndefined$1(CE)) {
|
|
4481
4582
|
return CE;
|
|
@@ -4486,7 +4587,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
4486
4587
|
*/
|
|
4487
4588
|
|
|
4488
4589
|
|
|
4489
|
-
CE = class LWCUpgradableElement extends
|
|
4590
|
+
CE = class LWCUpgradableElement extends HTMLElementExported {
|
|
4490
4591
|
constructor(upgradeCallback) {
|
|
4491
4592
|
super();
|
|
4492
4593
|
|
|
@@ -4496,7 +4597,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
4496
4597
|
}
|
|
4497
4598
|
|
|
4498
4599
|
};
|
|
4499
|
-
|
|
4600
|
+
defineCustomElement(tagName, CE);
|
|
4500
4601
|
return CE;
|
|
4501
4602
|
}
|
|
4502
4603
|
|
|
@@ -4513,10 +4614,7 @@ const TextHook = {
|
|
|
4513
4614
|
const {
|
|
4514
4615
|
owner
|
|
4515
4616
|
} = vnode;
|
|
4516
|
-
const
|
|
4517
|
-
renderer
|
|
4518
|
-
} = owner;
|
|
4519
|
-
const elm = renderer.createText(vnode.text);
|
|
4617
|
+
const elm = createText(vnode.text);
|
|
4520
4618
|
linkNodeToShadow(elm, owner);
|
|
4521
4619
|
vnode.elm = elm;
|
|
4522
4620
|
},
|
|
@@ -4550,10 +4648,7 @@ const CommentHook = {
|
|
|
4550
4648
|
owner,
|
|
4551
4649
|
text
|
|
4552
4650
|
} = vnode;
|
|
4553
|
-
const
|
|
4554
|
-
renderer
|
|
4555
|
-
} = owner;
|
|
4556
|
-
const elm = renderer.createComment(text);
|
|
4651
|
+
const elm = createComment(text);
|
|
4557
4652
|
linkNodeToShadow(elm, owner);
|
|
4558
4653
|
vnode.elm = elm;
|
|
4559
4654
|
},
|
|
@@ -4595,11 +4690,8 @@ const ElementHook = {
|
|
|
4595
4690
|
svg
|
|
4596
4691
|
}
|
|
4597
4692
|
} = vnode;
|
|
4598
|
-
const {
|
|
4599
|
-
renderer
|
|
4600
|
-
} = owner;
|
|
4601
4693
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
4602
|
-
const elm =
|
|
4694
|
+
const elm = createElement(sel, namespace);
|
|
4603
4695
|
linkNodeToShadow(elm, owner);
|
|
4604
4696
|
fallbackElmHook(elm, vnode);
|
|
4605
4697
|
vnode.elm = elm;
|
|
@@ -4659,10 +4751,7 @@ const CustomElementHook = {
|
|
|
4659
4751
|
sel,
|
|
4660
4752
|
owner
|
|
4661
4753
|
} = vnode;
|
|
4662
|
-
const
|
|
4663
|
-
renderer
|
|
4664
|
-
} = owner;
|
|
4665
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
4754
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
4666
4755
|
/**
|
|
4667
4756
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
4668
4757
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -4755,8 +4844,7 @@ const CustomElementHook = {
|
|
|
4755
4844
|
createVM(elm, def, {
|
|
4756
4845
|
mode,
|
|
4757
4846
|
owner,
|
|
4758
|
-
tagName: sel
|
|
4759
|
-
renderer: owner.renderer
|
|
4847
|
+
tagName: sel
|
|
4760
4848
|
});
|
|
4761
4849
|
vnode.elm = elm;
|
|
4762
4850
|
const vm = getAssociatedVM(elm);
|
|
@@ -4785,12 +4873,11 @@ const CustomElementHook = {
|
|
|
4785
4873
|
|
|
4786
4874
|
function linkNodeToShadow(elm, owner) {
|
|
4787
4875
|
const {
|
|
4788
|
-
renderer,
|
|
4789
4876
|
renderMode,
|
|
4790
4877
|
shadowMode
|
|
4791
4878
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
4792
4879
|
|
|
4793
|
-
if (
|
|
4880
|
+
if (isSyntheticShadowDefined) {
|
|
4794
4881
|
if (shadowMode === 1
|
|
4795
4882
|
/* Synthetic */
|
|
4796
4883
|
|| renderMode === 0
|
|
@@ -5322,7 +5409,6 @@ function updateStylesheetToken(vm, template) {
|
|
|
5322
5409
|
const {
|
|
5323
5410
|
elm,
|
|
5324
5411
|
context,
|
|
5325
|
-
renderer,
|
|
5326
5412
|
renderMode,
|
|
5327
5413
|
shadowMode
|
|
5328
5414
|
} = vm;
|
|
@@ -5349,11 +5435,11 @@ function updateStylesheetToken(vm, template) {
|
|
|
5349
5435
|
} = context;
|
|
5350
5436
|
|
|
5351
5437
|
if (oldHasTokenInClass) {
|
|
5352
|
-
|
|
5438
|
+
getClassList(elm).remove(makeHostToken(oldToken));
|
|
5353
5439
|
}
|
|
5354
5440
|
|
|
5355
5441
|
if (oldHasTokenInAttribute) {
|
|
5356
|
-
|
|
5442
|
+
removeAttribute(elm, makeHostToken(oldToken));
|
|
5357
5443
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
5358
5444
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
5359
5445
|
|
|
@@ -5365,12 +5451,12 @@ function updateStylesheetToken(vm, template) {
|
|
|
5365
5451
|
|
|
5366
5452
|
if (!isUndefined$1(newToken)) {
|
|
5367
5453
|
if (hasScopedStyles) {
|
|
5368
|
-
|
|
5454
|
+
getClassList(elm).add(makeHostToken(newToken));
|
|
5369
5455
|
newHasTokenInClass = true;
|
|
5370
5456
|
}
|
|
5371
5457
|
|
|
5372
5458
|
if (isSyntheticShadow) {
|
|
5373
|
-
|
|
5459
|
+
setAttribute(elm, makeHostToken(newToken), '');
|
|
5374
5460
|
newHasTokenInAttribute = true;
|
|
5375
5461
|
}
|
|
5376
5462
|
} // Update the styling tokens present on the context object.
|
|
@@ -5490,7 +5576,6 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
5490
5576
|
|
|
5491
5577
|
function createStylesheet(vm, stylesheets) {
|
|
5492
5578
|
const {
|
|
5493
|
-
renderer,
|
|
5494
5579
|
renderMode,
|
|
5495
5580
|
shadowMode
|
|
5496
5581
|
} = vm;
|
|
@@ -5501,9 +5586,9 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5501
5586
|
/* Synthetic */
|
|
5502
5587
|
) {
|
|
5503
5588
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5504
|
-
|
|
5589
|
+
insertGlobalStylesheet(stylesheets[i]);
|
|
5505
5590
|
}
|
|
5506
|
-
} else if (
|
|
5591
|
+
} else if (ssr || isHydrating()) {
|
|
5507
5592
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
5508
5593
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
5509
5594
|
// the first time the VM renders.
|
|
@@ -5517,10 +5602,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5517
5602
|
|
|
5518
5603
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5519
5604
|
if (isGlobal) {
|
|
5520
|
-
|
|
5605
|
+
insertGlobalStylesheet(stylesheets[i]);
|
|
5521
5606
|
} else {
|
|
5522
5607
|
// local level
|
|
5523
|
-
|
|
5608
|
+
insertStylesheet(stylesheets[i], root.cmpRoot);
|
|
5524
5609
|
}
|
|
5525
5610
|
}
|
|
5526
5611
|
}
|
|
@@ -6181,7 +6266,6 @@ function createVM(elm, def, options) {
|
|
|
6181
6266
|
const {
|
|
6182
6267
|
mode,
|
|
6183
6268
|
owner,
|
|
6184
|
-
renderer,
|
|
6185
6269
|
tagName
|
|
6186
6270
|
} = options;
|
|
6187
6271
|
const vm = {
|
|
@@ -6196,7 +6280,6 @@ function createVM(elm, def, options) {
|
|
|
6196
6280
|
tagName,
|
|
6197
6281
|
mode,
|
|
6198
6282
|
owner,
|
|
6199
|
-
renderer,
|
|
6200
6283
|
children: EmptyArray,
|
|
6201
6284
|
aChildren: EmptyArray,
|
|
6202
6285
|
velements: EmptyArray,
|
|
@@ -6251,13 +6334,8 @@ function createVM(elm, def, options) {
|
|
|
6251
6334
|
|
|
6252
6335
|
function computeShadowMode(vm) {
|
|
6253
6336
|
const {
|
|
6254
|
-
def
|
|
6255
|
-
renderer
|
|
6337
|
+
def
|
|
6256
6338
|
} = vm;
|
|
6257
|
-
const {
|
|
6258
|
-
isNativeShadowDefined,
|
|
6259
|
-
isSyntheticShadowDefined
|
|
6260
|
-
} = renderer;
|
|
6261
6339
|
let shadowMode;
|
|
6262
6340
|
|
|
6263
6341
|
if (isSyntheticShadowDefined) {
|
|
@@ -6407,13 +6485,12 @@ function patchShadowRoot(vm, newCh) {
|
|
|
6407
6485
|
|
|
6408
6486
|
function runRenderedCallback(vm) {
|
|
6409
6487
|
const {
|
|
6410
|
-
renderer,
|
|
6411
6488
|
def: {
|
|
6412
6489
|
renderedCallback
|
|
6413
6490
|
}
|
|
6414
6491
|
} = vm;
|
|
6415
6492
|
|
|
6416
|
-
if (isTrue(
|
|
6493
|
+
if (isTrue(ssr)) {
|
|
6417
6494
|
return;
|
|
6418
6495
|
}
|
|
6419
6496
|
|
|
@@ -6639,8 +6716,7 @@ function recursivelyDisconnectChildren(vnodes) {
|
|
|
6639
6716
|
|
|
6640
6717
|
function resetComponentRoot(vm) {
|
|
6641
6718
|
const {
|
|
6642
|
-
children
|
|
6643
|
-
renderer
|
|
6719
|
+
children
|
|
6644
6720
|
} = vm;
|
|
6645
6721
|
const rootNode = getRenderRoot(vm);
|
|
6646
6722
|
|
|
@@ -6648,7 +6724,7 @@ function resetComponentRoot(vm) {
|
|
|
6648
6724
|
const child = children[i];
|
|
6649
6725
|
|
|
6650
6726
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
6651
|
-
|
|
6727
|
+
remove(child.elm, rootNode);
|
|
6652
6728
|
}
|
|
6653
6729
|
}
|
|
6654
6730
|
|
|
@@ -6657,7 +6733,7 @@ function resetComponentRoot(vm) {
|
|
|
6657
6733
|
vm.velements = EmptyArray;
|
|
6658
6734
|
}
|
|
6659
6735
|
function scheduleRehydration(vm) {
|
|
6660
|
-
if (isTrue(
|
|
6736
|
+
if (isTrue(ssr) || isTrue(vm.isScheduled)) {
|
|
6661
6737
|
return;
|
|
6662
6738
|
}
|
|
6663
6739
|
|
|
@@ -6897,7 +6973,6 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
6897
6973
|
|
|
6898
6974
|
const {
|
|
6899
6975
|
elm,
|
|
6900
|
-
renderer,
|
|
6901
6976
|
context: {
|
|
6902
6977
|
wiredConnecting,
|
|
6903
6978
|
wiredDisconnecting
|
|
@@ -6924,7 +6999,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
6924
6999
|
}
|
|
6925
7000
|
|
|
6926
7001
|
});
|
|
6927
|
-
|
|
7002
|
+
dispatchEvent(elm, contextRegistrationEvent);
|
|
6928
7003
|
});
|
|
6929
7004
|
}
|
|
6930
7005
|
|
|
@@ -7180,5 +7255,5 @@ function setHooks(hooks) {
|
|
|
7180
7255
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7181
7256
|
}
|
|
7182
7257
|
|
|
7183
|
-
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, connectRootElement, createContextProvider, createVM, disconnectRootElement, getAssociatedVMIfPresent, getComponentDef, getComponentInternalDef, getUpgradableConstructor, hydrateRootElement, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
7184
|
-
/* version: 2.7.
|
|
7258
|
+
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, connectRootElement, createContextProvider, createVM, disconnectRootElement, getAssociatedVMIfPresent, getComponentDef, getComponentInternalDef, getUpgradableConstructor, hydrateRootElement, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setAddEventListener, setAssertInstanceOfHTMLElement, setAttachShadow, setCreateComment, setCreateElement, setCreateText, setDefineCustomElement, setDispatchEvent, setGetAttribute, setGetBoundingClientRect, setGetChildNodes, setGetChildren, setGetClassList, setGetCustomElement, setGetElementsByClassName, setGetElementsByTagName, setGetFirstChild, setGetFirstElementChild, setGetLastChild, setGetLastElementChild, setGetProperty, setHTMLElement, setHooks, setInsert, setInsertGlobalStylesheet, setInsertStylesheet, setIsConnected, setIsHydrating, setIsNativeShadowDefined, setIsSyntheticShadowDefined, setNextSibling, setQuerySelector, setQuerySelectorAll, setRemove, setRemoveAttribute, setRemoveEventListener, setSetAttribute, setSetCSSStyleProperty, setSetProperty, setSetText, setSsr, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
7259
|
+
/* version: 2.7.2 */
|