@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 1.4.0-beta.3
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/cjs/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-d8215915.js} +14 -119
- package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
- package/dist/cjs/{index-b0b676c5.js → index-6fcf07f3.js} +159 -1515
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/sankhyablocks.cjs.js +4 -116
- package/dist/cjs/snk-application.cjs.entry.js +84 -230
- package/dist/cjs/snk-crud.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
- package/dist/cjs/snk-filter-bar_5.cjs.entry.js +902 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +38 -3
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-number.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-period.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +90 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +4 -4
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/{snk-form.cjs.entry.js → snk-form_2.cjs.entry.js} +119 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-aedfeae6.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-application/snk-application.js +54 -7
- package/dist/collection/components/snk-crud/snk-crud.js +2 -4
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -27
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +36 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +32 -9
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +22 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +238 -139
- package/dist/collection/components/snk-grid/snk-grid.js +2 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
- package/dist/components/SnkMessageBuilder.js +15 -119
- package/dist/components/filter-item-type.enum.js +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -4
- package/dist/components/snk-application2.js +47 -191
- package/dist/components/snk-crud.js +16 -10
- package/dist/components/snk-data-unit.js +3 -12
- package/dist/components/snk-filter-bar2.js +342 -146
- package/dist/components/snk-filter-detail2.js +36 -1
- package/dist/components/snk-filter-item2.js +33 -10
- package/dist/components/snk-filter-list2.js +1 -1
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +58 -0
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +108 -0
- package/dist/components/snk-filter-search.js +1 -1
- package/dist/components/snk-form2.js +1 -1
- package/dist/components/snk-grid2.js +16 -10
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-taskbar2.js +1 -1
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-35a20271.js} +15 -119
- package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
- package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-81dda3cf.js} +160 -1508
- package/dist/esm/loader.js +2 -18
- package/dist/esm/sankhyablocks.js +4 -116
- package/dist/esm/snk-application.entry.js +46 -192
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-unit.entry.js +4 -12
- package/dist/esm/snk-filter-bar_5.entry.js +894 -0
- package/dist/esm/snk-filter-binary-select.entry.js +2 -2
- package/dist/esm/snk-filter-detail.entry.js +38 -3
- package/dist/esm/snk-filter-multi-select.entry.js +2 -2
- package/dist/esm/snk-filter-number.entry.js +2 -2
- package/dist/esm/snk-filter-period.entry.js +2 -2
- package/dist/esm/snk-filter-personalized.entry.js +86 -0
- package/dist/esm/snk-filter-search.entry.js +3 -3
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/{snk-form.entry.js → snk-form_2.entry.js} +117 -4
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-38eb5d51.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/index.esm.js +0 -1
- package/dist/sankhyablocks/p-0352c0e2.entry.js +1 -0
- package/dist/sankhyablocks/p-07ebda01.entry.js +1 -0
- package/dist/sankhyablocks/p-322c0df2.entry.js +1 -0
- package/dist/sankhyablocks/p-46caa101.entry.js +1 -0
- package/dist/sankhyablocks/p-473cedf9.entry.js +1 -0
- package/dist/sankhyablocks/p-586e2522.js +1 -0
- package/dist/sankhyablocks/p-86f15ffe.js +1 -0
- package/dist/sankhyablocks/p-8f3c5709.entry.js +1 -0
- package/dist/sankhyablocks/p-97009a2c.entry.js +1 -0
- package/dist/sankhyablocks/p-9be74b46.entry.js +74 -0
- package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
- package/dist/sankhyablocks/p-a8b59c61.entry.js +1 -0
- package/dist/sankhyablocks/p-aecf3e0a.entry.js +1 -0
- package/dist/sankhyablocks/p-c1c3b5d8.entry.js +1 -0
- package/dist/sankhyablocks/p-c78cb79a.entry.js +1 -0
- package/dist/sankhyablocks/p-c9eec639.entry.js +1 -0
- package/dist/sankhyablocks/p-dc482a42.entry.js +1 -0
- package/dist/sankhyablocks/p-fac2b6a9.js +2 -0
- package/dist/sankhyablocks/p-fb705f81.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
- package/dist/types/components/snk-application/snk-application.d.ts +4 -1
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
- package/dist/types/components.d.ts +56 -8
- package/package.json +3 -3
- package/react/components.d.ts +19 -0
- package/react/components.js +19 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-b8158822.js +0 -6
- package/dist/cjs/dom-36862b77.js +0 -75
- package/dist/cjs/index-02201bc9.js +0 -2397
- package/dist/cjs/shadow-css-346c0795.js +0 -389
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
- package/dist/cjs/snk-grid.cjs.entry.js +0 -79
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
- package/dist/cjs/taskbar-processor-6bd0d35c.js +0 -47
- package/dist/components/index2.js +0 -2384
- package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-b3f2ee8d.js +0 -4
- package/dist/esm/dom-665d6011.js +0 -73
- package/dist/esm/index-2b4d2d14.js +0 -3262
- package/dist/esm/index-f1d3e4da.js +0 -2384
- package/dist/esm/shadow-css-b18e99d7.js +0 -387
- package/dist/esm/snk-filter-bar.entry.js +0 -274
- package/dist/esm/snk-filter-item.entry.js +0 -150
- package/dist/esm/snk-filter-list.entry.js +0 -87
- package/dist/esm/snk-grid.entry.js +0 -75
- package/dist/esm/snk-taskbar.entry.js +0 -156
- package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
- package/dist/esm/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
- package/dist/sankhyablocks/dom-665d6011.js +0 -73
- package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
- package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
- package/dist/sankhyablocks/snk-application.entry.js +0 -8148
- package/dist/sankhyablocks/snk-crud.entry.js +0 -66
- package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
- package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
- package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
- package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
- package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
- package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
- package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
- package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
- package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
- package/dist/sankhyablocks/snk-form.entry.js +0 -129
- package/dist/sankhyablocks/snk-grid.entry.js +0 -75
- package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
- package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -51
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const NAMESPACE = 'sankhyablocks';
|
|
2
|
-
const BUILD = /* sankhyablocks */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, cssVarShim: false, devTools: false, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: true, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
|
-
const Env = /* sankhyablocks */ {};
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -13,122 +11,26 @@ const Env = /* sankhyablocks */ {};
|
|
|
13
11
|
let scopeId;
|
|
14
12
|
let contentRef;
|
|
15
13
|
let hostTagName;
|
|
16
|
-
let customError;
|
|
17
|
-
let i = 0;
|
|
18
14
|
let useNativeShadowDom = false;
|
|
19
15
|
let checkSlotFallbackVisibility = false;
|
|
20
16
|
let checkSlotRelocate = false;
|
|
21
17
|
let isSvgMode = false;
|
|
22
|
-
let renderingRef = null;
|
|
23
|
-
let queueCongestion = 0;
|
|
24
18
|
let queuePending = false;
|
|
25
|
-
const Build = {
|
|
26
|
-
isDev: BUILD.isDev ? true : false,
|
|
27
|
-
isBrowser: true,
|
|
28
|
-
isServer: false,
|
|
29
|
-
isTesting: BUILD.isTesting ? true : false,
|
|
30
|
-
};
|
|
31
|
-
const Context = {};
|
|
32
|
-
const getAssetPath = (path) => {
|
|
33
|
-
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
34
|
-
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
35
|
-
};
|
|
36
|
-
const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
|
|
37
19
|
const createTime = (fnName, tagName = '') => {
|
|
38
|
-
|
|
39
|
-
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
40
|
-
// Start
|
|
41
|
-
performance.mark(key);
|
|
42
|
-
// End
|
|
43
|
-
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
20
|
+
{
|
|
46
21
|
return () => {
|
|
47
22
|
return;
|
|
48
23
|
};
|
|
49
24
|
}
|
|
50
25
|
};
|
|
51
26
|
const uniqueTime = (key, measureText) => {
|
|
52
|
-
|
|
53
|
-
if (performance.getEntriesByName(key).length === 0) {
|
|
54
|
-
performance.mark(key);
|
|
55
|
-
}
|
|
56
|
-
return () => {
|
|
57
|
-
if (performance.getEntriesByName(measureText).length === 0) {
|
|
58
|
-
performance.measure(measureText, key);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
27
|
+
{
|
|
63
28
|
return () => {
|
|
64
29
|
return;
|
|
65
30
|
};
|
|
66
31
|
}
|
|
67
32
|
};
|
|
68
|
-
const inspect = (ref) => {
|
|
69
|
-
const hostRef = getHostRef(ref);
|
|
70
|
-
if (!hostRef) {
|
|
71
|
-
return undefined;
|
|
72
|
-
}
|
|
73
|
-
const flags = hostRef.$flags$;
|
|
74
|
-
const hostElement = hostRef.$hostElement$;
|
|
75
|
-
return {
|
|
76
|
-
renderCount: hostRef.$renderCount$,
|
|
77
|
-
flags: {
|
|
78
|
-
hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),
|
|
79
|
-
hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),
|
|
80
|
-
isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),
|
|
81
|
-
isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),
|
|
82
|
-
isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),
|
|
83
|
-
hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),
|
|
84
|
-
hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),
|
|
85
|
-
isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),
|
|
86
|
-
isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),
|
|
87
|
-
needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),
|
|
88
|
-
},
|
|
89
|
-
instanceValues: hostRef.$instanceValues$,
|
|
90
|
-
ancestorComponent: hostRef.$ancestorComponent$,
|
|
91
|
-
hostElement,
|
|
92
|
-
lazyInstance: hostRef.$lazyInstance$,
|
|
93
|
-
vnode: hostRef.$vnode$,
|
|
94
|
-
modeName: hostRef.$modeName$,
|
|
95
|
-
onReadyPromise: hostRef.$onReadyPromise$,
|
|
96
|
-
onReadyResolve: hostRef.$onReadyResolve$,
|
|
97
|
-
onInstancePromise: hostRef.$onInstancePromise$,
|
|
98
|
-
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
99
|
-
onRenderResolve: hostRef.$onRenderResolve$,
|
|
100
|
-
queuedListeners: hostRef.$queuedListeners$,
|
|
101
|
-
rmListeners: hostRef.$rmListeners$,
|
|
102
|
-
['s-id']: hostElement['s-id'],
|
|
103
|
-
['s-cr']: hostElement['s-cr'],
|
|
104
|
-
['s-lr']: hostElement['s-lr'],
|
|
105
|
-
['s-p']: hostElement['s-p'],
|
|
106
|
-
['s-rc']: hostElement['s-rc'],
|
|
107
|
-
['s-sc']: hostElement['s-sc'],
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
const installDevTools = () => {
|
|
111
|
-
if (BUILD.devTools) {
|
|
112
|
-
const stencil = (win.stencil = win.stencil || {});
|
|
113
|
-
const originalInspect = stencil.inspect;
|
|
114
|
-
stencil.inspect = (ref) => {
|
|
115
|
-
let result = inspect(ref);
|
|
116
|
-
if (!result && typeof originalInspect === 'function') {
|
|
117
|
-
result = originalInspect(ref);
|
|
118
|
-
}
|
|
119
|
-
return result;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const CONTENT_REF_ID = 'r';
|
|
124
|
-
const ORG_LOCATION_ID = 'o';
|
|
125
|
-
const SLOT_NODE_ID = 's';
|
|
126
|
-
const TEXT_NODE_ID = 't';
|
|
127
|
-
const HYDRATE_ID = 's-id';
|
|
128
|
-
const HYDRATED_STYLE_ID = 'sty-id';
|
|
129
|
-
const HYDRATE_CHILD_ID = 'c-id';
|
|
130
33
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
131
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
132
34
|
/**
|
|
133
35
|
* Default style mode id
|
|
134
36
|
*/
|
|
@@ -137,11 +39,6 @@ const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
|
137
39
|
* Don't add values to these!!
|
|
138
40
|
*/
|
|
139
41
|
const EMPTY_OBJ = {};
|
|
140
|
-
/**
|
|
141
|
-
* Namespaces
|
|
142
|
-
*/
|
|
143
|
-
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
144
|
-
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
145
42
|
const isDef = (v) => v != null;
|
|
146
43
|
const isComplexType = (o) => {
|
|
147
44
|
// https://jsperf.com/typeof-fn-object/5
|
|
@@ -176,11 +73,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
176
73
|
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
177
74
|
child = String(child);
|
|
178
75
|
}
|
|
179
|
-
else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
|
|
180
|
-
consoleDevError(`vNode passed as children has unexpected type.
|
|
181
|
-
Make sure it's using the correct h() function.
|
|
182
|
-
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
183
|
-
}
|
|
184
76
|
if (simple && lastSimple) {
|
|
185
77
|
// If the previous child was simple (string), we merge both
|
|
186
78
|
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
@@ -195,17 +87,14 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
195
87
|
};
|
|
196
88
|
walk(children);
|
|
197
89
|
if (vnodeData) {
|
|
198
|
-
if (BUILD.isDev && nodeName === 'input') {
|
|
199
|
-
validateInputProperties(vnodeData);
|
|
200
|
-
}
|
|
201
90
|
// normalize class / classname attributes
|
|
202
|
-
if (
|
|
91
|
+
if (vnodeData.key) {
|
|
203
92
|
key = vnodeData.key;
|
|
204
93
|
}
|
|
205
|
-
if (
|
|
94
|
+
if (vnodeData.name) {
|
|
206
95
|
slotName = vnodeData.name;
|
|
207
96
|
}
|
|
208
|
-
|
|
97
|
+
{
|
|
209
98
|
const classData = vnodeData.className || vnodeData.class;
|
|
210
99
|
if (classData) {
|
|
211
100
|
vnodeData.class =
|
|
@@ -217,12 +106,7 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
217
106
|
}
|
|
218
107
|
}
|
|
219
108
|
}
|
|
220
|
-
if (
|
|
221
|
-
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
222
|
-
- You are NOT using hostData() and <Host> in the same component.
|
|
223
|
-
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
224
|
-
}
|
|
225
|
-
if (BUILD.vdomFunctional && typeof nodeName === 'function') {
|
|
109
|
+
if (typeof nodeName === 'function') {
|
|
226
110
|
// nodeName is a functional component
|
|
227
111
|
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
228
112
|
}
|
|
@@ -231,10 +115,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
231
115
|
if (vNodeChildren.length > 0) {
|
|
232
116
|
vnode.$children$ = vNodeChildren;
|
|
233
117
|
}
|
|
234
|
-
|
|
118
|
+
{
|
|
235
119
|
vnode.$key$ = key;
|
|
236
120
|
}
|
|
237
|
-
|
|
121
|
+
{
|
|
238
122
|
vnode.$name$ = slotName;
|
|
239
123
|
}
|
|
240
124
|
return vnode;
|
|
@@ -247,13 +131,13 @@ const newVNode = (tag, text) => {
|
|
|
247
131
|
$elm$: null,
|
|
248
132
|
$children$: null,
|
|
249
133
|
};
|
|
250
|
-
|
|
134
|
+
{
|
|
251
135
|
vnode.$attrs$ = null;
|
|
252
136
|
}
|
|
253
|
-
|
|
137
|
+
{
|
|
254
138
|
vnode.$key$ = null;
|
|
255
139
|
}
|
|
256
|
-
|
|
140
|
+
{
|
|
257
141
|
vnode.$name$ = null;
|
|
258
142
|
}
|
|
259
143
|
return vnode;
|
|
@@ -290,234 +174,6 @@ const convertToPrivate = (node) => {
|
|
|
290
174
|
vnode.$name$ = node.vname;
|
|
291
175
|
return vnode;
|
|
292
176
|
};
|
|
293
|
-
/**
|
|
294
|
-
* Validates the ordering of attributes on an input element
|
|
295
|
-
* @param inputElm the element to validate
|
|
296
|
-
*/
|
|
297
|
-
const validateInputProperties = (inputElm) => {
|
|
298
|
-
const props = Object.keys(inputElm);
|
|
299
|
-
const value = props.indexOf('value');
|
|
300
|
-
if (value === -1) {
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const typeIndex = props.indexOf('type');
|
|
304
|
-
const minIndex = props.indexOf('min');
|
|
305
|
-
const maxIndex = props.indexOf('max');
|
|
306
|
-
const stepIndex = props.indexOf('step');
|
|
307
|
-
if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
|
|
308
|
-
consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
312
|
-
const endHydrate = createTime('hydrateClient', tagName);
|
|
313
|
-
const shadowRoot = hostElm.shadowRoot;
|
|
314
|
-
const childRenderNodes = [];
|
|
315
|
-
const slotNodes = [];
|
|
316
|
-
const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
|
|
317
|
-
const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
|
|
318
|
-
if (!plt.$orgLocNodes$) {
|
|
319
|
-
initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
|
320
|
-
}
|
|
321
|
-
hostElm[HYDRATE_ID] = hostId;
|
|
322
|
-
hostElm.removeAttribute(HYDRATE_ID);
|
|
323
|
-
clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
|
|
324
|
-
childRenderNodes.map((c) => {
|
|
325
|
-
const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
|
|
326
|
-
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
327
|
-
const node = c.$elm$;
|
|
328
|
-
if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
|
|
329
|
-
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
330
|
-
}
|
|
331
|
-
if (!shadowRoot) {
|
|
332
|
-
node['s-hn'] = tagName;
|
|
333
|
-
if (orgLocationNode) {
|
|
334
|
-
node['s-ol'] = orgLocationNode;
|
|
335
|
-
node['s-ol']['s-nr'] = node;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
339
|
-
});
|
|
340
|
-
if (BUILD.shadowDom && shadowRoot) {
|
|
341
|
-
shadowRootNodes.map((shadowRootNode) => {
|
|
342
|
-
if (shadowRootNode) {
|
|
343
|
-
shadowRoot.appendChild(shadowRootNode);
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
endHydrate();
|
|
348
|
-
};
|
|
349
|
-
const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
|
|
350
|
-
let childNodeType;
|
|
351
|
-
let childIdSplt;
|
|
352
|
-
let childVNode;
|
|
353
|
-
let i;
|
|
354
|
-
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
355
|
-
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
356
|
-
if (childNodeType) {
|
|
357
|
-
// got the node data from the element's attribute
|
|
358
|
-
// `${hostId}.${nodeId}.${depth}.${index}`
|
|
359
|
-
childIdSplt = childNodeType.split('.');
|
|
360
|
-
if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
|
|
361
|
-
childVNode = {
|
|
362
|
-
$flags$: 0,
|
|
363
|
-
$hostId$: childIdSplt[0],
|
|
364
|
-
$nodeId$: childIdSplt[1],
|
|
365
|
-
$depth$: childIdSplt[2],
|
|
366
|
-
$index$: childIdSplt[3],
|
|
367
|
-
$tag$: node.tagName.toLowerCase(),
|
|
368
|
-
$elm$: node,
|
|
369
|
-
$attrs$: null,
|
|
370
|
-
$children$: null,
|
|
371
|
-
$key$: null,
|
|
372
|
-
$name$: null,
|
|
373
|
-
$text$: null,
|
|
374
|
-
};
|
|
375
|
-
childRenderNodes.push(childVNode);
|
|
376
|
-
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
377
|
-
// this is a new child vnode
|
|
378
|
-
// so ensure its parent vnode has the vchildren array
|
|
379
|
-
if (!parentVNode.$children$) {
|
|
380
|
-
parentVNode.$children$ = [];
|
|
381
|
-
}
|
|
382
|
-
// add our child vnode to a specific index of the vnode's children
|
|
383
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
384
|
-
// this is now the new parent vnode for all the next child checks
|
|
385
|
-
parentVNode = childVNode;
|
|
386
|
-
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
387
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
// recursively drill down, end to start so we can remove nodes
|
|
392
|
-
for (i = node.childNodes.length - 1; i >= 0; i--) {
|
|
393
|
-
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
|
|
394
|
-
}
|
|
395
|
-
if (node.shadowRoot) {
|
|
396
|
-
// keep drilling down through the shadow root nodes
|
|
397
|
-
for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
|
|
398
|
-
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
403
|
-
// `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
|
|
404
|
-
childIdSplt = node.nodeValue.split('.');
|
|
405
|
-
if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
|
|
406
|
-
// comment node for either the host id or a 0 host id
|
|
407
|
-
childNodeType = childIdSplt[0];
|
|
408
|
-
childVNode = {
|
|
409
|
-
$flags$: 0,
|
|
410
|
-
$hostId$: childIdSplt[1],
|
|
411
|
-
$nodeId$: childIdSplt[2],
|
|
412
|
-
$depth$: childIdSplt[3],
|
|
413
|
-
$index$: childIdSplt[4],
|
|
414
|
-
$elm$: node,
|
|
415
|
-
$attrs$: null,
|
|
416
|
-
$children$: null,
|
|
417
|
-
$key$: null,
|
|
418
|
-
$name$: null,
|
|
419
|
-
$tag$: null,
|
|
420
|
-
$text$: null,
|
|
421
|
-
};
|
|
422
|
-
if (childNodeType === TEXT_NODE_ID) {
|
|
423
|
-
childVNode.$elm$ = node.nextSibling;
|
|
424
|
-
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
425
|
-
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
426
|
-
childRenderNodes.push(childVNode);
|
|
427
|
-
// remove the text comment since it's no longer needed
|
|
428
|
-
node.remove();
|
|
429
|
-
if (!parentVNode.$children$) {
|
|
430
|
-
parentVNode.$children$ = [];
|
|
431
|
-
}
|
|
432
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
433
|
-
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
434
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
else if (childVNode.$hostId$ === hostId) {
|
|
439
|
-
// this comment node is specifcally for this host id
|
|
440
|
-
if (childNodeType === SLOT_NODE_ID) {
|
|
441
|
-
// `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
|
|
442
|
-
childVNode.$tag$ = 'slot';
|
|
443
|
-
if (childIdSplt[5]) {
|
|
444
|
-
node['s-sn'] = childVNode.$name$ = childIdSplt[5];
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
node['s-sn'] = '';
|
|
448
|
-
}
|
|
449
|
-
node['s-sr'] = true;
|
|
450
|
-
if (BUILD.shadowDom && shadowRootNodes) {
|
|
451
|
-
// browser support shadowRoot and this is a shadow dom component
|
|
452
|
-
// create an actual slot element
|
|
453
|
-
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
454
|
-
if (childVNode.$name$) {
|
|
455
|
-
// add the slot name attribute
|
|
456
|
-
childVNode.$elm$.setAttribute('name', childVNode.$name$);
|
|
457
|
-
}
|
|
458
|
-
// insert the new slot element before the slot comment
|
|
459
|
-
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
460
|
-
// remove the slot comment since it's not needed for shadow
|
|
461
|
-
node.remove();
|
|
462
|
-
if (childVNode.$depth$ === '0') {
|
|
463
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
slotNodes.push(childVNode);
|
|
467
|
-
if (!parentVNode.$children$) {
|
|
468
|
-
parentVNode.$children$ = [];
|
|
469
|
-
}
|
|
470
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
471
|
-
}
|
|
472
|
-
else if (childNodeType === CONTENT_REF_ID) {
|
|
473
|
-
// `${CONTENT_REF_ID}.${hostId}`;
|
|
474
|
-
if (BUILD.shadowDom && shadowRootNodes) {
|
|
475
|
-
// remove the content ref comment since it's not needed for shadow
|
|
476
|
-
node.remove();
|
|
477
|
-
}
|
|
478
|
-
else if (BUILD.slotRelocation) {
|
|
479
|
-
hostElm['s-cr'] = node;
|
|
480
|
-
node['s-cn'] = true;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
else if (parentVNode && parentVNode.$tag$ === 'style') {
|
|
487
|
-
const vnode = newVNode(null, node.textContent);
|
|
488
|
-
vnode.$elm$ = node;
|
|
489
|
-
vnode.$index$ = '0';
|
|
490
|
-
parentVNode.$children$ = [vnode];
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
const initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
494
|
-
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
495
|
-
let i = 0;
|
|
496
|
-
for (; i < node.childNodes.length; i++) {
|
|
497
|
-
initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
|
|
498
|
-
}
|
|
499
|
-
if (node.shadowRoot) {
|
|
500
|
-
for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
|
|
501
|
-
initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
506
|
-
const childIdSplt = node.nodeValue.split('.');
|
|
507
|
-
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
508
|
-
orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
|
|
509
|
-
node.nodeValue = '';
|
|
510
|
-
// useful to know if the original location is
|
|
511
|
-
// the root light-dom of a shadow dom component
|
|
512
|
-
node['s-en'] = childIdSplt[3];
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
};
|
|
516
|
-
// Private
|
|
517
|
-
const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
|
|
518
|
-
// Public
|
|
519
|
-
const setMode = (handler) => modeResolutionChain.push(handler);
|
|
520
|
-
const getMode = (ref) => getHostRef(ref).$modeName$;
|
|
521
177
|
/**
|
|
522
178
|
* Parse a new property value for a given property type.
|
|
523
179
|
*
|
|
@@ -544,16 +200,16 @@ const getMode = (ref) => getHostRef(ref).$modeName$;
|
|
|
544
200
|
const parsePropertyValue = (propValue, propType) => {
|
|
545
201
|
// ensure this value is of the correct prop type
|
|
546
202
|
if (propValue != null && !isComplexType(propValue)) {
|
|
547
|
-
if (
|
|
203
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
548
204
|
// per the HTML spec, any string value means it is a boolean true value
|
|
549
205
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
550
206
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
551
207
|
}
|
|
552
|
-
if (
|
|
208
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
553
209
|
// force it to be a number
|
|
554
210
|
return parseFloat(propValue);
|
|
555
211
|
}
|
|
556
|
-
if (
|
|
212
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
557
213
|
// could have been passed as a number or boolean
|
|
558
214
|
// but we still want it as a string
|
|
559
215
|
return String(propValue);
|
|
@@ -565,14 +221,11 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
565
221
|
// so no need to change to a different type
|
|
566
222
|
return propValue;
|
|
567
223
|
};
|
|
568
|
-
const getElement = (ref) => (
|
|
224
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
569
225
|
const createEvent = (ref, name, flags) => {
|
|
570
226
|
const elm = getElement(ref);
|
|
571
227
|
return {
|
|
572
228
|
emit: (detail) => {
|
|
573
|
-
if (BUILD.isDev && !elm.isConnected) {
|
|
574
|
-
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
575
|
-
}
|
|
576
229
|
return emitEvent(elm, name, {
|
|
577
230
|
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
578
231
|
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
@@ -612,11 +265,8 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
612
265
|
styles.set(scopeId, style);
|
|
613
266
|
};
|
|
614
267
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
615
|
-
let scopeId = getScopeId(cmpMeta
|
|
268
|
+
let scopeId = getScopeId(cmpMeta);
|
|
616
269
|
const style = styles.get(scopeId);
|
|
617
|
-
if (!BUILD.attachStyles) {
|
|
618
|
-
return scopeId;
|
|
619
|
-
}
|
|
620
270
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
621
271
|
// so the fallback is to always use the document for the root node in those cases
|
|
622
272
|
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -629,31 +279,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
629
279
|
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
630
280
|
}
|
|
631
281
|
if (!appliedStyles.has(scopeId)) {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
|
635
|
-
// This is only happening on native shadow-dom, do not needs CSS var shim
|
|
636
|
-
styleElm.innerHTML = style;
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
640
|
-
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* CMP_FLAGS.needsScopedEncapsulation */));
|
|
641
|
-
const newScopeId = styleElm['s-sc'];
|
|
642
|
-
if (newScopeId) {
|
|
643
|
-
scopeId = newScopeId;
|
|
644
|
-
// we don't want to add this styleID to the appliedStyles Set
|
|
645
|
-
// since the cssVarShim might need to apply several different
|
|
646
|
-
// stylesheets for the same component
|
|
647
|
-
appliedStyles = null;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
else {
|
|
282
|
+
{
|
|
283
|
+
{
|
|
651
284
|
styleElm = doc.createElement('style');
|
|
652
285
|
styleElm.innerHTML = style;
|
|
653
286
|
}
|
|
654
|
-
if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
|
|
655
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
|
|
656
|
-
}
|
|
657
287
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
658
288
|
}
|
|
659
289
|
if (appliedStyles) {
|
|
@@ -661,7 +291,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
661
291
|
}
|
|
662
292
|
}
|
|
663
293
|
}
|
|
664
|
-
else if (
|
|
294
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
665
295
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
666
296
|
}
|
|
667
297
|
}
|
|
@@ -672,8 +302,8 @@ const attachStyles = (hostRef) => {
|
|
|
672
302
|
const elm = hostRef.$hostElement$;
|
|
673
303
|
const flags = cmpMeta.$flags$;
|
|
674
304
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
675
|
-
const scopeId = addStyle(
|
|
676
|
-
if (
|
|
305
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
306
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
677
307
|
// only required when we're NOT using native shadow dom (slot)
|
|
678
308
|
// or this browser doesn't support native shadow dom
|
|
679
309
|
// and this host element was NOT created with SSR
|
|
@@ -683,14 +313,13 @@ const attachStyles = (hostRef) => {
|
|
|
683
313
|
// DOM WRITE!!
|
|
684
314
|
elm['s-sc'] = scopeId;
|
|
685
315
|
elm.classList.add(scopeId + '-h');
|
|
686
|
-
if (
|
|
316
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
687
317
|
elm.classList.add(scopeId + '-s');
|
|
688
318
|
}
|
|
689
319
|
}
|
|
690
320
|
endAttachStyles();
|
|
691
321
|
};
|
|
692
|
-
const getScopeId = (cmp, mode) => 'sc-' + (
|
|
693
|
-
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
|
322
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
694
323
|
/**
|
|
695
324
|
* Production setAccessor() function based on Preact by
|
|
696
325
|
* Jason Miller (@developit)
|
|
@@ -703,48 +332,22 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
703
332
|
if (oldValue !== newValue) {
|
|
704
333
|
let isProp = isMemberInElement(elm, memberName);
|
|
705
334
|
let ln = memberName.toLowerCase();
|
|
706
|
-
if (
|
|
335
|
+
if (memberName === 'class') {
|
|
707
336
|
const classList = elm.classList;
|
|
708
337
|
const oldClasses = parseClassList(oldValue);
|
|
709
338
|
const newClasses = parseClassList(newValue);
|
|
710
339
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
711
340
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
712
341
|
}
|
|
713
|
-
else if (
|
|
714
|
-
// update style attribute, css properties and values
|
|
715
|
-
if (BUILD.updatable) {
|
|
716
|
-
for (const prop in oldValue) {
|
|
717
|
-
if (!newValue || newValue[prop] == null) {
|
|
718
|
-
if (!BUILD.hydrateServerSide && prop.includes('-')) {
|
|
719
|
-
elm.style.removeProperty(prop);
|
|
720
|
-
}
|
|
721
|
-
else {
|
|
722
|
-
elm.style[prop] = '';
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
for (const prop in newValue) {
|
|
728
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
729
|
-
if (!BUILD.hydrateServerSide && prop.includes('-')) {
|
|
730
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
elm.style[prop] = newValue[prop];
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
else if (BUILD.vdomKey && memberName === 'key')
|
|
342
|
+
else if (memberName === 'key')
|
|
739
343
|
;
|
|
740
|
-
else if (
|
|
344
|
+
else if (memberName === 'ref') {
|
|
741
345
|
// minifier will clean this up
|
|
742
346
|
if (newValue) {
|
|
743
347
|
newValue(elm);
|
|
744
348
|
}
|
|
745
349
|
}
|
|
746
|
-
else if (
|
|
747
|
-
(BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
|
|
350
|
+
else if ((!isProp ) &&
|
|
748
351
|
memberName[0] === 'o' &&
|
|
749
352
|
memberName[1] === 'n') {
|
|
750
353
|
// Event Handlers
|
|
@@ -783,7 +386,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
783
386
|
plt.ael(elm, memberName, newValue, false);
|
|
784
387
|
}
|
|
785
388
|
}
|
|
786
|
-
else
|
|
389
|
+
else {
|
|
787
390
|
// Set property if it exists and it's not a SVG
|
|
788
391
|
const isComplex = isComplexType(newValue);
|
|
789
392
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
@@ -804,36 +407,16 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
804
407
|
}
|
|
805
408
|
catch (e) { }
|
|
806
409
|
}
|
|
807
|
-
/**
|
|
808
|
-
* Need to manually update attribute if:
|
|
809
|
-
* - memberName is not an attribute
|
|
810
|
-
* - if we are rendering the host element in order to reflect attribute
|
|
811
|
-
* - if it's a SVG, since properties might not work in <svg>
|
|
812
|
-
* - if the newValue is null/undefined or 'false'.
|
|
813
|
-
*/
|
|
814
|
-
let xlink = false;
|
|
815
|
-
if (BUILD.vdomXlink) {
|
|
816
|
-
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
817
|
-
memberName = ln;
|
|
818
|
-
xlink = true;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
410
|
if (newValue == null || newValue === false) {
|
|
822
411
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
823
|
-
|
|
824
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
825
|
-
}
|
|
826
|
-
else {
|
|
412
|
+
{
|
|
827
413
|
elm.removeAttribute(memberName);
|
|
828
414
|
}
|
|
829
415
|
}
|
|
830
416
|
}
|
|
831
417
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
832
418
|
newValue = newValue === true ? '' : newValue;
|
|
833
|
-
|
|
834
|
-
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
835
|
-
}
|
|
836
|
-
else {
|
|
419
|
+
{
|
|
837
420
|
elm.setAttribute(memberName, newValue);
|
|
838
421
|
}
|
|
839
422
|
}
|
|
@@ -851,7 +434,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
851
434
|
: newVnode.$elm$;
|
|
852
435
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
853
436
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
854
|
-
|
|
437
|
+
{
|
|
855
438
|
// remove attributes no longer present on the vnode by setting them to undefined
|
|
856
439
|
for (memberName in oldVnodeAttrs) {
|
|
857
440
|
if (!(memberName in newVnodeAttrs)) {
|
|
@@ -881,7 +464,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
881
464
|
let elm;
|
|
882
465
|
let childNode;
|
|
883
466
|
let oldVNode;
|
|
884
|
-
if (
|
|
467
|
+
if (!useNativeShadowDom) {
|
|
885
468
|
// remember for later we need to check to relocate nodes
|
|
886
469
|
checkSlotRelocate = true;
|
|
887
470
|
if (newVNode.$tag$ === 'slot') {
|
|
@@ -896,38 +479,25 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
896
479
|
1 /* VNODE_FLAGS.isSlotReference */;
|
|
897
480
|
}
|
|
898
481
|
}
|
|
899
|
-
if (
|
|
900
|
-
consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
|
|
901
|
-
}
|
|
902
|
-
if (BUILD.vdomText && newVNode.$text$ !== null) {
|
|
482
|
+
if (newVNode.$text$ !== null) {
|
|
903
483
|
// create text node
|
|
904
484
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
905
485
|
}
|
|
906
|
-
else if (
|
|
486
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
907
487
|
// create a slot reference node
|
|
908
488
|
elm = newVNode.$elm$ =
|
|
909
|
-
|
|
489
|
+
doc.createTextNode('');
|
|
910
490
|
}
|
|
911
491
|
else {
|
|
912
|
-
if (BUILD.svg && !isSvgMode) {
|
|
913
|
-
isSvgMode = newVNode.$tag$ === 'svg';
|
|
914
|
-
}
|
|
915
492
|
// create element
|
|
916
|
-
elm = newVNode.$elm$ = (
|
|
917
|
-
? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
918
|
-
? 'slot-fb'
|
|
919
|
-
: newVNode.$tag$)
|
|
920
|
-
: doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
493
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
921
494
|
? 'slot-fb'
|
|
922
495
|
: newVNode.$tag$));
|
|
923
|
-
if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
924
|
-
isSvgMode = false;
|
|
925
|
-
}
|
|
926
496
|
// add css classes, attrs, props, listeners, etc.
|
|
927
|
-
|
|
497
|
+
{
|
|
928
498
|
updateElement(null, newVNode, isSvgMode);
|
|
929
499
|
}
|
|
930
|
-
if (
|
|
500
|
+
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
931
501
|
// if there is a scopeId and this is the initial render
|
|
932
502
|
// then let's add the scopeId as a css class
|
|
933
503
|
elm.classList.add((elm['s-si'] = scopeId));
|
|
@@ -943,18 +513,8 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
943
513
|
}
|
|
944
514
|
}
|
|
945
515
|
}
|
|
946
|
-
if (BUILD.svg) {
|
|
947
|
-
if (newVNode.$tag$ === 'svg') {
|
|
948
|
-
// Only reset the SVG context when we're exiting <svg> element
|
|
949
|
-
isSvgMode = false;
|
|
950
|
-
}
|
|
951
|
-
else if (elm.tagName === 'foreignObject') {
|
|
952
|
-
// Reenter SVG context when we're exiting <foreignObject> element
|
|
953
|
-
isSvgMode = true;
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
516
|
}
|
|
957
|
-
|
|
517
|
+
{
|
|
958
518
|
elm['s-hn'] = hostTagName;
|
|
959
519
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
960
520
|
// remember the content reference comment
|
|
@@ -999,9 +559,9 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
999
559
|
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1000
560
|
};
|
|
1001
561
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1002
|
-
let containerElm = ((
|
|
562
|
+
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
1003
563
|
let childNode;
|
|
1004
|
-
if (
|
|
564
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1005
565
|
containerElm = containerElm.shadowRoot;
|
|
1006
566
|
}
|
|
1007
567
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -1009,7 +569,7 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
1009
569
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
1010
570
|
if (childNode) {
|
|
1011
571
|
vnodes[startIdx].$elm$ = childNode;
|
|
1012
|
-
containerElm.insertBefore(childNode,
|
|
572
|
+
containerElm.insertBefore(childNode, referenceNode(before) );
|
|
1013
573
|
}
|
|
1014
574
|
}
|
|
1015
575
|
}
|
|
@@ -1019,7 +579,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
1019
579
|
if ((vnode = vnodes[startIdx])) {
|
|
1020
580
|
elm = vnode.$elm$;
|
|
1021
581
|
callNodeRefs(vnode);
|
|
1022
|
-
|
|
582
|
+
{
|
|
1023
583
|
// we're removing this element
|
|
1024
584
|
// so it's possible we need to show slot fallback content now
|
|
1025
585
|
checkSlotFallbackVisibility = true;
|
|
@@ -1165,7 +725,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
1165
725
|
//
|
|
1166
726
|
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
1167
727
|
// and move the DOM element for `oldStartVnode`.
|
|
1168
|
-
if (
|
|
728
|
+
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1169
729
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1170
730
|
}
|
|
1171
731
|
patch(oldStartVnode, newEndVnode);
|
|
@@ -1206,7 +766,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
1206
766
|
// (which will handle updating any changed attributes, reconciling their
|
|
1207
767
|
// children etc) but we also need to move the DOM node to which
|
|
1208
768
|
// `oldEndVnode` corresponds.
|
|
1209
|
-
if (
|
|
769
|
+
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1210
770
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1211
771
|
}
|
|
1212
772
|
patch(oldEndVnode, newStartVnode);
|
|
@@ -1229,7 +789,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
1229
789
|
// children which have the same key as the first node in the new
|
|
1230
790
|
// children.
|
|
1231
791
|
idxInOld = -1;
|
|
1232
|
-
|
|
792
|
+
{
|
|
1233
793
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
1234
794
|
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
1235
795
|
idxInOld = i;
|
|
@@ -1237,7 +797,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
1237
797
|
}
|
|
1238
798
|
}
|
|
1239
799
|
}
|
|
1240
|
-
if (
|
|
800
|
+
if (idxInOld >= 0) {
|
|
1241
801
|
// We found a node in the old children which matches up with the first
|
|
1242
802
|
// node in the new children! So let's deal with that
|
|
1243
803
|
elmToMove = oldCh[idxInOld];
|
|
@@ -1264,12 +824,9 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
1264
824
|
}
|
|
1265
825
|
if (node) {
|
|
1266
826
|
// if we created a new node then handle inserting it to the DOM
|
|
1267
|
-
|
|
827
|
+
{
|
|
1268
828
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
1269
829
|
}
|
|
1270
|
-
else {
|
|
1271
|
-
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
1272
|
-
}
|
|
1273
830
|
}
|
|
1274
831
|
}
|
|
1275
832
|
}
|
|
@@ -1277,7 +834,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
1277
834
|
// we have some more new nodes to add which don't match up with old nodes
|
|
1278
835
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
1279
836
|
}
|
|
1280
|
-
else if (
|
|
837
|
+
else if (newStartIdx > newEndIdx) {
|
|
1281
838
|
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
1282
839
|
// in the new array, so lets remove them (which entails cleaning up the
|
|
1283
840
|
// relevant DOM nodes)
|
|
@@ -1305,14 +862,13 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
1305
862
|
// compare if two vnode to see if they're "technically" the same
|
|
1306
863
|
// need to have the same element tag, and same key to be the same
|
|
1307
864
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1308
|
-
if (
|
|
865
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
1309
866
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1310
867
|
}
|
|
1311
868
|
// this will be set if components in the build have `key` attrs set on them
|
|
1312
|
-
|
|
869
|
+
{
|
|
1313
870
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1314
871
|
}
|
|
1315
|
-
return true;
|
|
1316
872
|
}
|
|
1317
873
|
return false;
|
|
1318
874
|
};
|
|
@@ -1339,14 +895,9 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1339
895
|
const tag = newVNode.$tag$;
|
|
1340
896
|
const text = newVNode.$text$;
|
|
1341
897
|
let defaultHolder;
|
|
1342
|
-
if (
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1346
|
-
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
1347
|
-
}
|
|
1348
|
-
if (BUILD.vdomAttribute || BUILD.reflect) {
|
|
1349
|
-
if (BUILD.slot && tag === 'slot')
|
|
898
|
+
if (text === null) {
|
|
899
|
+
{
|
|
900
|
+
if (tag === 'slot')
|
|
1350
901
|
;
|
|
1351
902
|
else {
|
|
1352
903
|
// either this is the first render of an element OR it's an update
|
|
@@ -1355,33 +906,30 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1355
906
|
updateElement(oldVNode, newVNode, isSvgMode);
|
|
1356
907
|
}
|
|
1357
908
|
}
|
|
1358
|
-
if (
|
|
909
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
1359
910
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1360
911
|
// so we need to call `updateChildren` to reconcile them
|
|
1361
912
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
1362
913
|
}
|
|
1363
914
|
else if (newChildren !== null) {
|
|
1364
915
|
// no old child vnodes, but there are new child vnodes to add
|
|
1365
|
-
if (
|
|
916
|
+
if (oldVNode.$text$ !== null) {
|
|
1366
917
|
// the old vnode was text, so be sure to clear it out
|
|
1367
918
|
elm.textContent = '';
|
|
1368
919
|
}
|
|
1369
920
|
// add the new vnode children
|
|
1370
921
|
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
1371
922
|
}
|
|
1372
|
-
else if (
|
|
923
|
+
else if (oldChildren !== null) {
|
|
1373
924
|
// no new child vnodes, but there are old child vnodes to remove
|
|
1374
925
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1375
926
|
}
|
|
1376
|
-
if (BUILD.svg && isSvgMode && tag === 'svg') {
|
|
1377
|
-
isSvgMode = false;
|
|
1378
|
-
}
|
|
1379
927
|
}
|
|
1380
|
-
else if (
|
|
928
|
+
else if ((defaultHolder = elm['s-cr'])) {
|
|
1381
929
|
// this element has slotted content
|
|
1382
930
|
defaultHolder.parentNode.textContent = text;
|
|
1383
931
|
}
|
|
1384
|
-
else if (
|
|
932
|
+
else if (oldVNode.$text$ !== text) {
|
|
1385
933
|
// update the text content for the text only vnode
|
|
1386
934
|
// and also only if the text is different than before
|
|
1387
935
|
elm.data = text;
|
|
@@ -1519,7 +1067,7 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
|
1519
1067
|
return slotNameAttr === '';
|
|
1520
1068
|
};
|
|
1521
1069
|
const callNodeRefs = (vNode) => {
|
|
1522
|
-
|
|
1070
|
+
{
|
|
1523
1071
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1524
1072
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1525
1073
|
}
|
|
@@ -1530,41 +1078,26 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1530
1078
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1531
1079
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1532
1080
|
hostTagName = hostElm.tagName;
|
|
1533
|
-
|
|
1534
|
-
if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1535
|
-
throw new Error(`The <Host> must be the single root component.
|
|
1536
|
-
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1537
|
-
|
|
1538
|
-
The render() function should look like this instead:
|
|
1539
|
-
|
|
1540
|
-
render() {
|
|
1541
|
-
// Do not return an array
|
|
1542
|
-
return (
|
|
1543
|
-
<Host>{content}</Host>
|
|
1544
|
-
);
|
|
1545
|
-
}
|
|
1546
|
-
`);
|
|
1547
|
-
}
|
|
1548
|
-
if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
1081
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1549
1082
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1550
1083
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1551
1084
|
}
|
|
1552
1085
|
rootVnode.$tag$ = null;
|
|
1553
1086
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1554
1087
|
hostRef.$vnode$ = rootVnode;
|
|
1555
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (
|
|
1556
|
-
|
|
1088
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
1089
|
+
{
|
|
1557
1090
|
scopeId = hostElm['s-sc'];
|
|
1558
1091
|
}
|
|
1559
|
-
|
|
1092
|
+
{
|
|
1560
1093
|
contentRef = hostElm['s-cr'];
|
|
1561
|
-
useNativeShadowDom =
|
|
1094
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1562
1095
|
// always reset
|
|
1563
1096
|
checkSlotFallbackVisibility = false;
|
|
1564
1097
|
}
|
|
1565
1098
|
// synchronous patch
|
|
1566
1099
|
patch(oldVNode, rootVnode);
|
|
1567
|
-
|
|
1100
|
+
{
|
|
1568
1101
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1569
1102
|
// the disconnectCallback from working
|
|
1570
1103
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
@@ -1584,9 +1117,7 @@ render() {
|
|
|
1584
1117
|
// add a reference node marking this node's original location
|
|
1585
1118
|
// keep a reference to this node for later lookups
|
|
1586
1119
|
orgLocationNode =
|
|
1587
|
-
|
|
1588
|
-
? originalLocationDebugNode(nodeToRelocate)
|
|
1589
|
-
: doc.createTextNode('');
|
|
1120
|
+
doc.createTextNode('');
|
|
1590
1121
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1591
1122
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1592
1123
|
}
|
|
@@ -1643,23 +1174,16 @@ render() {
|
|
|
1643
1174
|
relocateNodes.length = 0;
|
|
1644
1175
|
}
|
|
1645
1176
|
};
|
|
1646
|
-
// slot comment debug nodes only created with the `--debug` flag
|
|
1647
|
-
// otherwise these nodes are text nodes w/out content
|
|
1648
|
-
const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
|
|
1649
|
-
const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
|
|
1650
|
-
(nodeToRelocate.localName
|
|
1651
|
-
? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
|
|
1652
|
-
: `[${nodeToRelocate.textContent}]`));
|
|
1653
1177
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1654
|
-
if (
|
|
1178
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1655
1179
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
1656
1180
|
}
|
|
1657
1181
|
};
|
|
1658
1182
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1659
|
-
|
|
1183
|
+
{
|
|
1660
1184
|
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1661
1185
|
}
|
|
1662
|
-
if (
|
|
1186
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1663
1187
|
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1664
1188
|
return;
|
|
1665
1189
|
}
|
|
@@ -1668,34 +1192,25 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
1668
1192
|
// has already fired off its lifecycle update then
|
|
1669
1193
|
// fire off the initial update
|
|
1670
1194
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1671
|
-
return
|
|
1195
|
+
return writeTask(dispatch) ;
|
|
1672
1196
|
};
|
|
1673
1197
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1674
|
-
const elm = hostRef.$hostElement$;
|
|
1675
1198
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
1676
|
-
const instance =
|
|
1199
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1677
1200
|
let promise;
|
|
1678
1201
|
if (isInitialLoad) {
|
|
1679
|
-
|
|
1202
|
+
{
|
|
1680
1203
|
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1681
1204
|
if (hostRef.$queuedListeners$) {
|
|
1682
1205
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1683
1206
|
hostRef.$queuedListeners$ = null;
|
|
1684
1207
|
}
|
|
1685
1208
|
}
|
|
1686
|
-
|
|
1687
|
-
if (BUILD.cmpWillLoad) {
|
|
1209
|
+
{
|
|
1688
1210
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1689
1211
|
}
|
|
1690
1212
|
}
|
|
1691
|
-
|
|
1692
|
-
emitLifecycleEvent(elm, 'componentWillUpdate');
|
|
1693
|
-
if (BUILD.cmpWillUpdate) {
|
|
1694
|
-
promise = safeCall(instance, 'componentWillUpdate');
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
emitLifecycleEvent(elm, 'componentWillRender');
|
|
1698
|
-
if (BUILD.cmpWillRender) {
|
|
1213
|
+
{
|
|
1699
1214
|
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1700
1215
|
}
|
|
1701
1216
|
endSchedule();
|
|
@@ -1706,46 +1221,15 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1706
1221
|
const elm = hostRef.$hostElement$;
|
|
1707
1222
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1708
1223
|
const rc = elm['s-rc'];
|
|
1709
|
-
if (
|
|
1224
|
+
if (isInitialLoad) {
|
|
1710
1225
|
// DOM WRITE!
|
|
1711
1226
|
attachStyles(hostRef);
|
|
1712
1227
|
}
|
|
1713
1228
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1714
|
-
|
|
1715
|
-
hostRef
|
|
1229
|
+
{
|
|
1230
|
+
callRender(hostRef, instance);
|
|
1716
1231
|
}
|
|
1717
|
-
if (
|
|
1718
|
-
await callRender(hostRef, instance, elm);
|
|
1719
|
-
}
|
|
1720
|
-
else {
|
|
1721
|
-
callRender(hostRef, instance, elm);
|
|
1722
|
-
}
|
|
1723
|
-
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
1724
|
-
plt.$cssShim$.updateHost(elm);
|
|
1725
|
-
}
|
|
1726
|
-
if (BUILD.isDev) {
|
|
1727
|
-
hostRef.$renderCount$++;
|
|
1728
|
-
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1729
|
-
}
|
|
1730
|
-
if (BUILD.hydrateServerSide) {
|
|
1731
|
-
try {
|
|
1732
|
-
// manually connected child components during server-side hydrate
|
|
1733
|
-
serverSideConnected(elm);
|
|
1734
|
-
if (isInitialLoad) {
|
|
1735
|
-
// using only during server-side hydrate
|
|
1736
|
-
if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1737
|
-
elm['s-en'] = '';
|
|
1738
|
-
}
|
|
1739
|
-
else if (hostRef.$cmpMeta$.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
1740
|
-
elm['s-en'] = 'c';
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
catch (e) {
|
|
1745
|
-
consoleError(e, elm);
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
if (BUILD.asyncLoading && rc) {
|
|
1232
|
+
if (rc) {
|
|
1749
1233
|
// ok, so turns out there are some child host elements
|
|
1750
1234
|
// waiting on this parent element to load
|
|
1751
1235
|
// let's fire off all update callbacks waiting
|
|
@@ -1754,7 +1238,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1754
1238
|
}
|
|
1755
1239
|
endRender();
|
|
1756
1240
|
endUpdate();
|
|
1757
|
-
|
|
1241
|
+
{
|
|
1758
1242
|
const childrenPromises = elm['s-p'];
|
|
1759
1243
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1760
1244
|
if (childrenPromises.length === 0) {
|
|
@@ -1766,117 +1250,67 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1766
1250
|
childrenPromises.length = 0;
|
|
1767
1251
|
}
|
|
1768
1252
|
}
|
|
1769
|
-
else {
|
|
1770
|
-
postUpdateComponent(hostRef);
|
|
1771
|
-
}
|
|
1772
1253
|
};
|
|
1773
1254
|
const callRender = (hostRef, instance, elm) => {
|
|
1774
|
-
// in order for bundlers to correctly treeshake the BUILD object
|
|
1775
|
-
// we need to ensure BUILD is not deoptimized within a try/catch
|
|
1776
|
-
// https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
|
|
1777
|
-
const allRenderFn = BUILD.allRenderFn ? true : false;
|
|
1778
|
-
const lazyLoad = BUILD.lazyLoad ? true : false;
|
|
1779
|
-
const taskQueue = BUILD.taskQueue ? true : false;
|
|
1780
|
-
const updatable = BUILD.updatable ? true : false;
|
|
1781
1255
|
try {
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
if (updatable && taskQueue) {
|
|
1256
|
+
instance = instance.render() ;
|
|
1257
|
+
{
|
|
1785
1258
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1786
1259
|
}
|
|
1787
|
-
|
|
1260
|
+
{
|
|
1788
1261
|
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1789
1262
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1263
|
+
{
|
|
1264
|
+
{
|
|
1792
1265
|
// looks like we've got child nodes to render into this host element
|
|
1793
1266
|
// or we need to update the css class/attrs on the host element
|
|
1794
1267
|
// DOM WRITE!
|
|
1795
|
-
|
|
1796
|
-
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value));
|
|
1797
|
-
}
|
|
1798
|
-
else {
|
|
1268
|
+
{
|
|
1799
1269
|
renderVdom(hostRef, instance);
|
|
1800
1270
|
}
|
|
1801
1271
|
}
|
|
1802
|
-
else {
|
|
1803
|
-
elm.textContent = instance;
|
|
1804
|
-
}
|
|
1805
1272
|
}
|
|
1806
1273
|
}
|
|
1807
1274
|
catch (e) {
|
|
1808
1275
|
consoleError(e, hostRef.$hostElement$);
|
|
1809
1276
|
}
|
|
1810
|
-
renderingRef = null;
|
|
1811
1277
|
return null;
|
|
1812
1278
|
};
|
|
1813
|
-
const getRenderingRef = () => renderingRef;
|
|
1814
1279
|
const postUpdateComponent = (hostRef) => {
|
|
1815
1280
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1816
1281
|
const elm = hostRef.$hostElement$;
|
|
1817
1282
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1818
|
-
const instance =
|
|
1283
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1819
1284
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1820
|
-
|
|
1821
|
-
if (BUILD.isDev) {
|
|
1822
|
-
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
1823
|
-
}
|
|
1285
|
+
{
|
|
1824
1286
|
safeCall(instance, 'componentDidRender');
|
|
1825
|
-
if (BUILD.isDev) {
|
|
1826
|
-
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1827
|
-
}
|
|
1828
1287
|
}
|
|
1829
|
-
emitLifecycleEvent(elm, 'componentDidRender');
|
|
1830
1288
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1831
1289
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1832
|
-
|
|
1290
|
+
{
|
|
1833
1291
|
// DOM WRITE!
|
|
1834
1292
|
addHydratedFlag(elm);
|
|
1835
1293
|
}
|
|
1836
|
-
|
|
1837
|
-
if (BUILD.isDev) {
|
|
1838
|
-
hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
1839
|
-
}
|
|
1294
|
+
{
|
|
1840
1295
|
safeCall(instance, 'componentDidLoad');
|
|
1841
|
-
if (BUILD.isDev) {
|
|
1842
|
-
hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
1843
|
-
}
|
|
1844
1296
|
}
|
|
1845
|
-
emitLifecycleEvent(elm, 'componentDidLoad');
|
|
1846
1297
|
endPostUpdate();
|
|
1847
|
-
|
|
1298
|
+
{
|
|
1848
1299
|
hostRef.$onReadyResolve$(elm);
|
|
1849
1300
|
if (!ancestorComponent) {
|
|
1850
|
-
appDidLoad(
|
|
1301
|
+
appDidLoad();
|
|
1851
1302
|
}
|
|
1852
1303
|
}
|
|
1853
1304
|
}
|
|
1854
1305
|
else {
|
|
1855
|
-
if (BUILD.cmpDidUpdate) {
|
|
1856
|
-
// we've already loaded this component
|
|
1857
|
-
// fire off the user's componentDidUpdate method (if one was provided)
|
|
1858
|
-
// componentDidUpdate runs AFTER render() has been called
|
|
1859
|
-
// and all child components have finished updating
|
|
1860
|
-
if (BUILD.isDev) {
|
|
1861
|
-
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
1862
|
-
}
|
|
1863
|
-
safeCall(instance, 'componentDidUpdate');
|
|
1864
|
-
if (BUILD.isDev) {
|
|
1865
|
-
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
emitLifecycleEvent(elm, 'componentDidUpdate');
|
|
1869
1306
|
endPostUpdate();
|
|
1870
1307
|
}
|
|
1871
|
-
|
|
1872
|
-
elm['s-hmr-load'] && elm['s-hmr-load']();
|
|
1873
|
-
}
|
|
1874
|
-
if (BUILD.method && BUILD.lazyLoad) {
|
|
1308
|
+
{
|
|
1875
1309
|
hostRef.$onInstanceResolve$(elm);
|
|
1876
1310
|
}
|
|
1877
1311
|
// load events fire from bottom to top
|
|
1878
1312
|
// the deepest elements load first then bubbles up
|
|
1879
|
-
|
|
1313
|
+
{
|
|
1880
1314
|
if (hostRef.$onRenderResolve$) {
|
|
1881
1315
|
hostRef.$onRenderResolve$();
|
|
1882
1316
|
hostRef.$onRenderResolve$ = undefined;
|
|
@@ -1890,32 +1324,13 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1890
1324
|
// ( •_•)>⌐■-■
|
|
1891
1325
|
// (⌐■_■)
|
|
1892
1326
|
};
|
|
1893
|
-
const forceUpdate = (ref) => {
|
|
1894
|
-
if (BUILD.updatable) {
|
|
1895
|
-
const hostRef = getHostRef(ref);
|
|
1896
|
-
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1897
|
-
if (isConnected &&
|
|
1898
|
-
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1899
|
-
scheduleUpdate(hostRef, false);
|
|
1900
|
-
}
|
|
1901
|
-
// Returns "true" when the forced update was successfully scheduled
|
|
1902
|
-
return isConnected;
|
|
1903
|
-
}
|
|
1904
|
-
return false;
|
|
1905
|
-
};
|
|
1906
1327
|
const appDidLoad = (who) => {
|
|
1907
1328
|
// on appload
|
|
1908
1329
|
// we have finish the first big initial render
|
|
1909
|
-
|
|
1330
|
+
{
|
|
1910
1331
|
addHydratedFlag(doc.documentElement);
|
|
1911
1332
|
}
|
|
1912
|
-
if (BUILD.asyncQueue) {
|
|
1913
|
-
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
1914
|
-
}
|
|
1915
1333
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1916
|
-
if (BUILD.profile && performance.measure) {
|
|
1917
|
-
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
|
|
1918
|
-
}
|
|
1919
1334
|
};
|
|
1920
1335
|
const safeCall = (instance, method, arg) => {
|
|
1921
1336
|
if (instance && instance[method]) {
|
|
@@ -1931,61 +1346,27 @@ const safeCall = (instance, method, arg) => {
|
|
|
1931
1346
|
const then = (promise, thenFn) => {
|
|
1932
1347
|
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
1933
1348
|
};
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1936
|
-
emitEvent(elm, 'stencil_' + lifecycleName, {
|
|
1937
|
-
bubbles: true,
|
|
1938
|
-
composed: true,
|
|
1939
|
-
detail: {
|
|
1940
|
-
namespace: NAMESPACE,
|
|
1941
|
-
},
|
|
1942
|
-
});
|
|
1943
|
-
}
|
|
1944
|
-
};
|
|
1945
|
-
const addHydratedFlag = (elm) => BUILD.hydratedClass
|
|
1946
|
-
? elm.classList.add('hydrated')
|
|
1947
|
-
: BUILD.hydratedAttribute
|
|
1948
|
-
? elm.setAttribute('hydrated', '')
|
|
1949
|
-
: undefined;
|
|
1950
|
-
const serverSideConnected = (elm) => {
|
|
1951
|
-
const children = elm.children;
|
|
1952
|
-
if (children != null) {
|
|
1953
|
-
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
1954
|
-
const childElm = children[i];
|
|
1955
|
-
if (typeof childElm.connectedCallback === 'function') {
|
|
1956
|
-
childElm.connectedCallback();
|
|
1957
|
-
}
|
|
1958
|
-
serverSideConnected(childElm);
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1349
|
+
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1350
|
+
;
|
|
1962
1351
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1963
1352
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1964
1353
|
// check our new property value against our internal value
|
|
1965
1354
|
const hostRef = getHostRef(ref);
|
|
1966
|
-
const elm =
|
|
1355
|
+
const elm = hostRef.$hostElement$ ;
|
|
1967
1356
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1968
1357
|
const flags = hostRef.$flags$;
|
|
1969
|
-
const instance =
|
|
1358
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1970
1359
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1971
1360
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1972
1361
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1973
1362
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1974
|
-
if ((!
|
|
1363
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1975
1364
|
// gadzooks! the property's value has changed!!
|
|
1976
1365
|
// set our new value!
|
|
1977
1366
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1978
|
-
if (
|
|
1979
|
-
if (hostRef.$flags$ & 1024 /* HOST_FLAGS.devOnRender */) {
|
|
1980
|
-
consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
|
|
1981
|
-
}
|
|
1982
|
-
else if (hostRef.$flags$ & 2048 /* HOST_FLAGS.devOnDidLoad */) {
|
|
1983
|
-
consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
if (!BUILD.lazyLoad || instance) {
|
|
1367
|
+
if (instance) {
|
|
1987
1368
|
// get an array of method names of watch functions to call
|
|
1988
|
-
if (
|
|
1369
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1989
1370
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1990
1371
|
if (watchMethods) {
|
|
1991
1372
|
// this instance is watching for when this property changed
|
|
@@ -2000,13 +1381,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2000
1381
|
});
|
|
2001
1382
|
}
|
|
2002
1383
|
}
|
|
2003
|
-
if (
|
|
2004
|
-
(flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
2005
|
-
if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2006
|
-
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2007
|
-
return;
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
1384
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
2010
1385
|
// looks like this value actually changed, so we've got work to do!
|
|
2011
1386
|
// but only if we've already rendered, otherwise just chill out
|
|
2012
1387
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -2027,17 +1402,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2027
1402
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
2028
1403
|
*/
|
|
2029
1404
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2030
|
-
if (
|
|
2031
|
-
if (
|
|
1405
|
+
if (cmpMeta.$members$) {
|
|
1406
|
+
if (Cstr.watchers) {
|
|
2032
1407
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2033
1408
|
}
|
|
2034
1409
|
// It's better to have a const than two Object.entries()
|
|
2035
1410
|
const members = Object.entries(cmpMeta.$members$);
|
|
2036
1411
|
const prototype = Cstr.prototype;
|
|
2037
1412
|
members.map(([memberName, [memberFlags]]) => {
|
|
2038
|
-
if ((
|
|
2039
|
-
|
|
2040
|
-
((!BUILD.lazyLoad || flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1413
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1414
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
2041
1415
|
// proxyComponent - prop
|
|
2042
1416
|
Object.defineProperty(prototype, memberName, {
|
|
2043
1417
|
get() {
|
|
@@ -2045,21 +1419,6 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2045
1419
|
return getValue(this, memberName);
|
|
2046
1420
|
},
|
|
2047
1421
|
set(newValue) {
|
|
2048
|
-
// only during dev time
|
|
2049
|
-
if (BUILD.isDev) {
|
|
2050
|
-
const ref = getHostRef(this);
|
|
2051
|
-
if (
|
|
2052
|
-
// we are proxying the instance (not element)
|
|
2053
|
-
(flags & 1 /* PROXY_FLAGS.isElementConstructor */) === 0 &&
|
|
2054
|
-
// the element is not constructing
|
|
2055
|
-
(ref.$flags$ & 8 /* HOST_FLAGS.isConstructingInstance */) === 0 &&
|
|
2056
|
-
// the member is a prop
|
|
2057
|
-
(memberFlags & 31 /* MEMBER_FLAGS.Prop */) !== 0 &&
|
|
2058
|
-
// the member is not mutable
|
|
2059
|
-
(memberFlags & 1024 /* MEMBER_FLAGS.Mutable */) === 0) {
|
|
2060
|
-
consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
1422
|
// proxyComponent, set value
|
|
2064
1423
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2065
1424
|
},
|
|
@@ -2067,9 +1426,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2067
1426
|
enumerable: true,
|
|
2068
1427
|
});
|
|
2069
1428
|
}
|
|
2070
|
-
else if (
|
|
2071
|
-
BUILD.method &&
|
|
2072
|
-
flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1429
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
2073
1430
|
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
2074
1431
|
// proxyComponent - method
|
|
2075
1432
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -2080,7 +1437,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2080
1437
|
});
|
|
2081
1438
|
}
|
|
2082
1439
|
});
|
|
2083
|
-
if (
|
|
1440
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
2084
1441
|
const attrNameToPropName = new Map();
|
|
2085
1442
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
2086
1443
|
plt.jmp(() => {
|
|
@@ -2140,7 +1497,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2140
1497
|
.map(([propName, m]) => {
|
|
2141
1498
|
const attrName = m[1] || propName;
|
|
2142
1499
|
attrNameToPropName.set(attrName, propName);
|
|
2143
|
-
if (
|
|
1500
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
2144
1501
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
2145
1502
|
}
|
|
2146
1503
|
return attrName;
|
|
@@ -2151,29 +1508,25 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2151
1508
|
};
|
|
2152
1509
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
2153
1510
|
// initializeComponent
|
|
2154
|
-
if ((
|
|
2155
|
-
|
|
2156
|
-
if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
|
|
1511
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1512
|
+
{
|
|
2157
1513
|
// we haven't initialized this element yet
|
|
2158
1514
|
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
2159
1515
|
// lazy loaded components
|
|
2160
1516
|
// request the component's implementation to be
|
|
2161
1517
|
// wired up with the host element
|
|
2162
|
-
Cstr = loadModule(cmpMeta
|
|
1518
|
+
Cstr = loadModule(cmpMeta);
|
|
2163
1519
|
if (Cstr.then) {
|
|
2164
1520
|
// Await creates a micro-task avoid if possible
|
|
2165
|
-
const endLoad = uniqueTime(
|
|
1521
|
+
const endLoad = uniqueTime();
|
|
2166
1522
|
Cstr = await Cstr;
|
|
2167
1523
|
endLoad();
|
|
2168
1524
|
}
|
|
2169
|
-
if (
|
|
2170
|
-
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2171
|
-
}
|
|
2172
|
-
if (BUILD.member && !Cstr.isProxied) {
|
|
1525
|
+
if (!Cstr.isProxied) {
|
|
2173
1526
|
// we've never proxied this Constructor before
|
|
2174
1527
|
// let's add the getters/setters to its prototype before
|
|
2175
1528
|
// the first time we create an instance of the implementation
|
|
2176
|
-
|
|
1529
|
+
{
|
|
2177
1530
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2178
1531
|
}
|
|
2179
1532
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
@@ -2183,7 +1536,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2183
1536
|
// ok, time to construct the instance
|
|
2184
1537
|
// but let's keep track of when we start and stop
|
|
2185
1538
|
// so that the getters/setters don't incorrectly step on data
|
|
2186
|
-
|
|
1539
|
+
{
|
|
2187
1540
|
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
2188
1541
|
}
|
|
2189
1542
|
// construct the lazy-loaded component implementation
|
|
@@ -2196,42 +1549,21 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2196
1549
|
catch (e) {
|
|
2197
1550
|
consoleError(e);
|
|
2198
1551
|
}
|
|
2199
|
-
|
|
1552
|
+
{
|
|
2200
1553
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
2201
1554
|
}
|
|
2202
|
-
|
|
1555
|
+
{
|
|
2203
1556
|
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
2204
1557
|
}
|
|
2205
1558
|
endNewInstance();
|
|
2206
1559
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2207
1560
|
}
|
|
2208
|
-
|
|
2209
|
-
// sync constructor component
|
|
2210
|
-
Cstr = elm.constructor;
|
|
2211
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
2212
|
-
// wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
|
2213
|
-
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
|
2214
|
-
// Stencil has completed instantiating the component.
|
|
2215
|
-
customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
|
|
2216
|
-
}
|
|
2217
|
-
if (BUILD.style && Cstr.style) {
|
|
1561
|
+
if (Cstr.style) {
|
|
2218
1562
|
// this component has styles but we haven't registered them yet
|
|
2219
1563
|
let style = Cstr.style;
|
|
2220
|
-
|
|
2221
|
-
style = style[(hostRef.$modeName$ = computeMode(elm))];
|
|
2222
|
-
if (BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2223
|
-
elm.setAttribute('s-mode', hostRef.$modeName$);
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
1564
|
+
const scopeId = getScopeId(cmpMeta);
|
|
2227
1565
|
if (!styles.has(scopeId)) {
|
|
2228
1566
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
2229
|
-
if (!BUILD.hydrateServerSide &&
|
|
2230
|
-
BUILD.shadowDom &&
|
|
2231
|
-
BUILD.shadowDomShim &&
|
|
2232
|
-
cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2233
|
-
style = await import('./shadow-css-b18e99d7.js').then((m) => m.scopeCss(style, scopeId, false));
|
|
2234
|
-
}
|
|
2235
1567
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
2236
1568
|
endRegisterStyles();
|
|
2237
1569
|
}
|
|
@@ -2240,7 +1572,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2240
1572
|
// we've successfully created a lazy instance
|
|
2241
1573
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2242
1574
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2243
|
-
if (
|
|
1575
|
+
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
2244
1576
|
// this is the initial load and this component it has an ancestor component
|
|
2245
1577
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
2246
1578
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
@@ -2254,7 +1586,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2254
1586
|
}
|
|
2255
1587
|
};
|
|
2256
1588
|
const fireConnectedCallback = (instance) => {
|
|
2257
|
-
|
|
1589
|
+
{
|
|
2258
1590
|
safeCall(instance, 'connectedCallback');
|
|
2259
1591
|
}
|
|
2260
1592
|
};
|
|
@@ -2263,49 +1595,26 @@ const connectedCallback = (elm) => {
|
|
|
2263
1595
|
const hostRef = getHostRef(elm);
|
|
2264
1596
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2265
1597
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
2266
|
-
if (BUILD.hostListenerTargetParent) {
|
|
2267
|
-
// only run if we have listeners being attached to a parent
|
|
2268
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2269
|
-
}
|
|
2270
1598
|
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
2271
1599
|
// first time this component has connected
|
|
2272
1600
|
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
2273
|
-
|
|
2274
|
-
if (BUILD.hydrateClientSide) {
|
|
2275
|
-
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2276
|
-
if (hostId) {
|
|
2277
|
-
if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2278
|
-
const scopeId = BUILD.mode
|
|
2279
|
-
? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
|
|
2280
|
-
: addStyle(elm.shadowRoot, cmpMeta);
|
|
2281
|
-
elm.classList.remove(scopeId + '-h', scopeId + '-s');
|
|
2282
|
-
}
|
|
2283
|
-
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
if (BUILD.slotRelocation && !hostId) {
|
|
1601
|
+
{
|
|
2287
1602
|
// initUpdate
|
|
2288
1603
|
// if the slot polyfill is required we'll need to put some nodes
|
|
2289
1604
|
// in here to act as original content anchors as we move nodes around
|
|
2290
1605
|
// host element has been connected to the DOM
|
|
2291
|
-
if (
|
|
2292
|
-
((BUILD.slot || BUILD.shadowDom) &&
|
|
2293
|
-
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1606
|
+
if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
2294
1607
|
setContentReference(elm);
|
|
2295
1608
|
}
|
|
2296
1609
|
}
|
|
2297
|
-
|
|
1610
|
+
{
|
|
2298
1611
|
// find the first ancestor component (if there is one) and register
|
|
2299
1612
|
// this component as one of the actively loading child components for its ancestor
|
|
2300
1613
|
let ancestorComponent = elm;
|
|
2301
1614
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
2302
1615
|
// climb up the ancestors looking for the first
|
|
2303
1616
|
// component that hasn't finished its lifecycle update yet
|
|
2304
|
-
if (
|
|
2305
|
-
ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
2306
|
-
ancestorComponent.hasAttribute('s-id') &&
|
|
2307
|
-
ancestorComponent['s-p']) ||
|
|
2308
|
-
ancestorComponent['s-p']) {
|
|
1617
|
+
if (ancestorComponent['s-p']) {
|
|
2309
1618
|
// we found this components first ancestor component
|
|
2310
1619
|
// keep a reference to this component's ancestor component
|
|
2311
1620
|
attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
|
|
@@ -2315,7 +1624,7 @@ const connectedCallback = (elm) => {
|
|
|
2315
1624
|
}
|
|
2316
1625
|
// Lazy properties
|
|
2317
1626
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
2318
|
-
if (
|
|
1627
|
+
if (cmpMeta.$members$) {
|
|
2319
1628
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2320
1629
|
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2321
1630
|
const value = elm[memberName];
|
|
@@ -2324,14 +1633,7 @@ const connectedCallback = (elm) => {
|
|
|
2324
1633
|
}
|
|
2325
1634
|
});
|
|
2326
1635
|
}
|
|
2327
|
-
|
|
2328
|
-
// connectedCallback, taskQueue, initialLoad
|
|
2329
|
-
// angular sets attribute AFTER connectCallback
|
|
2330
|
-
// https://github.com/angular/angular/issues/18909
|
|
2331
|
-
// https://github.com/angular/angular/issues/19940
|
|
2332
|
-
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2333
|
-
}
|
|
2334
|
-
else {
|
|
1636
|
+
{
|
|
2335
1637
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
2336
1638
|
}
|
|
2337
1639
|
}
|
|
@@ -2339,7 +1641,7 @@ const connectedCallback = (elm) => {
|
|
|
2339
1641
|
// not the first time this has connected
|
|
2340
1642
|
// reattach any event listeners to the host
|
|
2341
1643
|
// since they would have been removed when disconnected
|
|
2342
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
1644
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
2343
1645
|
// fire off connectedCallback() on component instance
|
|
2344
1646
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2345
1647
|
}
|
|
@@ -2353,316 +1655,27 @@ const setContentReference = (elm) => {
|
|
|
2353
1655
|
// let's pick out the inner content for slot projection
|
|
2354
1656
|
// create a node to represent where the original
|
|
2355
1657
|
// content was first placed, which is useful later on
|
|
2356
|
-
const contentRefElm = (elm['s-cr'] = doc.createComment(
|
|
1658
|
+
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
2357
1659
|
contentRefElm['s-cn'] = true;
|
|
2358
1660
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
2359
1661
|
};
|
|
2360
1662
|
const disconnectedCallback = (elm) => {
|
|
2361
1663
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
2362
1664
|
const hostRef = getHostRef(elm);
|
|
2363
|
-
const instance =
|
|
2364
|
-
|
|
1665
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1666
|
+
{
|
|
2365
1667
|
if (hostRef.$rmListeners$) {
|
|
2366
1668
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2367
1669
|
hostRef.$rmListeners$ = undefined;
|
|
2368
1670
|
}
|
|
2369
1671
|
}
|
|
2370
|
-
|
|
2371
|
-
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
2372
|
-
plt.$cssShim$.removeHost(elm);
|
|
2373
|
-
}
|
|
2374
|
-
if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
|
|
1672
|
+
{
|
|
2375
1673
|
safeCall(instance, 'disconnectedCallback');
|
|
2376
1674
|
}
|
|
2377
|
-
if (BUILD.cmpDidUnload) {
|
|
2378
|
-
safeCall(instance, 'componentDidUnload');
|
|
2379
|
-
}
|
|
2380
|
-
}
|
|
2381
|
-
};
|
|
2382
|
-
const defineCustomElement = (Cstr, compactMeta) => {
|
|
2383
|
-
customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
|
|
2384
|
-
};
|
|
2385
|
-
const proxyCustomElement = (Cstr, compactMeta) => {
|
|
2386
|
-
const cmpMeta = {
|
|
2387
|
-
$flags$: compactMeta[0],
|
|
2388
|
-
$tagName$: compactMeta[1],
|
|
2389
|
-
};
|
|
2390
|
-
if (BUILD.member) {
|
|
2391
|
-
cmpMeta.$members$ = compactMeta[2];
|
|
2392
|
-
}
|
|
2393
|
-
if (BUILD.hostListener) {
|
|
2394
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
2395
|
-
}
|
|
2396
|
-
if (BUILD.watchCallback) {
|
|
2397
|
-
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2398
|
-
}
|
|
2399
|
-
if (BUILD.reflect) {
|
|
2400
|
-
cmpMeta.$attrsToReflect$ = [];
|
|
2401
|
-
}
|
|
2402
|
-
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2403
|
-
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
2404
|
-
}
|
|
2405
|
-
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
2406
|
-
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
2407
|
-
Object.assign(Cstr.prototype, {
|
|
2408
|
-
__registerHost() {
|
|
2409
|
-
registerHost(this, cmpMeta);
|
|
2410
|
-
},
|
|
2411
|
-
connectedCallback() {
|
|
2412
|
-
connectedCallback(this);
|
|
2413
|
-
if (BUILD.connectedCallback && originalConnectedCallback) {
|
|
2414
|
-
originalConnectedCallback.call(this);
|
|
2415
|
-
}
|
|
2416
|
-
},
|
|
2417
|
-
disconnectedCallback() {
|
|
2418
|
-
disconnectedCallback(this);
|
|
2419
|
-
if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
|
|
2420
|
-
originalDisconnectedCallback.call(this);
|
|
2421
|
-
}
|
|
2422
|
-
},
|
|
2423
|
-
__attachShadow() {
|
|
2424
|
-
if (supportsShadow) {
|
|
2425
|
-
if (BUILD.shadowDelegatesFocus) {
|
|
2426
|
-
this.attachShadow({
|
|
2427
|
-
mode: 'open',
|
|
2428
|
-
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
|
|
2429
|
-
});
|
|
2430
|
-
}
|
|
2431
|
-
else {
|
|
2432
|
-
this.attachShadow({ mode: 'open' });
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
else {
|
|
2436
|
-
this.shadowRoot = this;
|
|
2437
|
-
}
|
|
2438
|
-
},
|
|
2439
|
-
});
|
|
2440
|
-
Cstr.is = cmpMeta.$tagName$;
|
|
2441
|
-
return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);
|
|
2442
|
-
};
|
|
2443
|
-
const forceModeUpdate = (elm) => {
|
|
2444
|
-
if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
|
|
2445
|
-
const mode = computeMode(elm);
|
|
2446
|
-
const hostRef = getHostRef(elm);
|
|
2447
|
-
if (hostRef.$modeName$ !== mode) {
|
|
2448
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
2449
|
-
const oldScopeId = elm['s-sc'];
|
|
2450
|
-
const scopeId = getScopeId(cmpMeta, mode);
|
|
2451
|
-
const style = elm.constructor.style[mode];
|
|
2452
|
-
const flags = cmpMeta.$flags$;
|
|
2453
|
-
if (style) {
|
|
2454
|
-
if (!styles.has(scopeId)) {
|
|
2455
|
-
registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
2456
|
-
}
|
|
2457
|
-
hostRef.$modeName$ = mode;
|
|
2458
|
-
elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
|
|
2459
|
-
attachStyles(hostRef);
|
|
2460
|
-
forceUpdate(elm);
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
1675
|
}
|
|
2464
1676
|
};
|
|
2465
|
-
const patchCloneNode = (HostElementPrototype) => {
|
|
2466
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2467
|
-
HostElementPrototype.cloneNode = function (deep) {
|
|
2468
|
-
const srcNode = this;
|
|
2469
|
-
const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2470
|
-
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2471
|
-
if (BUILD.slot && !isShadowDom && deep) {
|
|
2472
|
-
let i = 0;
|
|
2473
|
-
let slotted, nonStencilNode;
|
|
2474
|
-
const stencilPrivates = [
|
|
2475
|
-
's-id',
|
|
2476
|
-
's-cr',
|
|
2477
|
-
's-lr',
|
|
2478
|
-
's-rc',
|
|
2479
|
-
's-sc',
|
|
2480
|
-
's-p',
|
|
2481
|
-
's-cn',
|
|
2482
|
-
's-sr',
|
|
2483
|
-
's-sn',
|
|
2484
|
-
's-hn',
|
|
2485
|
-
's-ol',
|
|
2486
|
-
's-nr',
|
|
2487
|
-
's-si',
|
|
2488
|
-
];
|
|
2489
|
-
for (; i < srcNode.childNodes.length; i++) {
|
|
2490
|
-
slotted = srcNode.childNodes[i]['s-nr'];
|
|
2491
|
-
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
|
|
2492
|
-
if (slotted) {
|
|
2493
|
-
if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2494
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2495
|
-
}
|
|
2496
|
-
else {
|
|
2497
|
-
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
if (nonStencilNode) {
|
|
2501
|
-
clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
}
|
|
2505
|
-
return clonedNode;
|
|
2506
|
-
};
|
|
2507
|
-
};
|
|
2508
|
-
const patchSlotAppendChild = (HostElementPrototype) => {
|
|
2509
|
-
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2510
|
-
HostElementPrototype.appendChild = function (newChild) {
|
|
2511
|
-
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
|
2512
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName);
|
|
2513
|
-
if (slotNode) {
|
|
2514
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2515
|
-
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2516
|
-
return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
|
|
2517
|
-
}
|
|
2518
|
-
return this.__appendChild(newChild);
|
|
2519
|
-
};
|
|
2520
|
-
};
|
|
2521
|
-
/**
|
|
2522
|
-
* Patches the text content of an unnamed slotted node inside a scoped component
|
|
2523
|
-
* @param hostElementPrototype the `Element` to be patched
|
|
2524
|
-
* @param cmpMeta component runtime metadata used to determine if the component should be patched or not
|
|
2525
|
-
*/
|
|
2526
|
-
const patchTextContent = (hostElementPrototype, cmpMeta) => {
|
|
2527
|
-
if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
2528
|
-
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
|
|
2529
|
-
Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
|
|
2530
|
-
Object.defineProperty(hostElementPrototype, 'textContent', {
|
|
2531
|
-
get() {
|
|
2532
|
-
var _a;
|
|
2533
|
-
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
2534
|
-
// the empty string
|
|
2535
|
-
const slotNode = getHostSlotNode(this.childNodes, '');
|
|
2536
|
-
// when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
|
|
2537
|
-
// nodes were reordered during the vdom render. first try to get the text content from the sibling.
|
|
2538
|
-
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
|
|
2539
|
-
return slotNode.nextSibling.textContent;
|
|
2540
|
-
}
|
|
2541
|
-
else if (slotNode) {
|
|
2542
|
-
return slotNode.textContent;
|
|
2543
|
-
}
|
|
2544
|
-
else {
|
|
2545
|
-
// fallback to the original implementation
|
|
2546
|
-
return this.__textContent;
|
|
2547
|
-
}
|
|
2548
|
-
},
|
|
2549
|
-
set(value) {
|
|
2550
|
-
var _a;
|
|
2551
|
-
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
2552
|
-
// the empty string
|
|
2553
|
-
const slotNode = getHostSlotNode(this.childNodes, '');
|
|
2554
|
-
// when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
|
|
2555
|
-
// depending on how nodes were reordered during the vdom render. first try to set the text content on the
|
|
2556
|
-
// sibling.
|
|
2557
|
-
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
|
|
2558
|
-
slotNode.nextSibling.textContent = value;
|
|
2559
|
-
}
|
|
2560
|
-
else if (slotNode) {
|
|
2561
|
-
slotNode.textContent = value;
|
|
2562
|
-
}
|
|
2563
|
-
else {
|
|
2564
|
-
// we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
|
|
2565
|
-
// loaded, we could have missed it. check for a content reference element on the scoped component and insert
|
|
2566
|
-
// it there
|
|
2567
|
-
this.__textContent = value;
|
|
2568
|
-
const contentRefElm = this['s-cr'];
|
|
2569
|
-
if (contentRefElm) {
|
|
2570
|
-
this.insertBefore(contentRefElm, this.firstChild);
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
},
|
|
2574
|
-
});
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
2578
|
-
class FakeNodeList extends Array {
|
|
2579
|
-
item(n) {
|
|
2580
|
-
return this[n];
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2584
|
-
const childNodesFn = elm.__lookupGetter__('childNodes');
|
|
2585
|
-
Object.defineProperty(elm, 'children', {
|
|
2586
|
-
get() {
|
|
2587
|
-
return this.childNodes.map((n) => n.nodeType === 1);
|
|
2588
|
-
},
|
|
2589
|
-
});
|
|
2590
|
-
Object.defineProperty(elm, 'childElementCount', {
|
|
2591
|
-
get() {
|
|
2592
|
-
return elm.children.length;
|
|
2593
|
-
},
|
|
2594
|
-
});
|
|
2595
|
-
Object.defineProperty(elm, 'childNodes', {
|
|
2596
|
-
get() {
|
|
2597
|
-
const childNodes = childNodesFn.call(this);
|
|
2598
|
-
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
|
|
2599
|
-
getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
|
|
2600
|
-
const result = new FakeNodeList();
|
|
2601
|
-
for (let i = 0; i < childNodes.length; i++) {
|
|
2602
|
-
const slot = childNodes[i]['s-nr'];
|
|
2603
|
-
if (slot) {
|
|
2604
|
-
result.push(slot);
|
|
2605
|
-
}
|
|
2606
|
-
}
|
|
2607
|
-
return result;
|
|
2608
|
-
}
|
|
2609
|
-
return FakeNodeList.from(childNodes);
|
|
2610
|
-
},
|
|
2611
|
-
});
|
|
2612
|
-
}
|
|
2613
|
-
};
|
|
2614
|
-
const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
|
|
2615
|
-
/**
|
|
2616
|
-
* Recursively searches a series of child nodes for a slot with the provided name.
|
|
2617
|
-
* @param childNodes the nodes to search for a slot with a specific name.
|
|
2618
|
-
* @param slotName the name of the slot to match on.
|
|
2619
|
-
* @returns a reference to the slot node that matches the provided name, `null` otherwise
|
|
2620
|
-
*/
|
|
2621
|
-
const getHostSlotNode = (childNodes, slotName) => {
|
|
2622
|
-
let i = 0;
|
|
2623
|
-
let childNode;
|
|
2624
|
-
for (; i < childNodes.length; i++) {
|
|
2625
|
-
childNode = childNodes[i];
|
|
2626
|
-
if (childNode['s-sr'] && childNode['s-sn'] === slotName) {
|
|
2627
|
-
return childNode;
|
|
2628
|
-
}
|
|
2629
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName);
|
|
2630
|
-
if (childNode) {
|
|
2631
|
-
return childNode;
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
return null;
|
|
2635
|
-
};
|
|
2636
|
-
const getHostSlotChildNodes = (n, slotName) => {
|
|
2637
|
-
const childNodes = [n];
|
|
2638
|
-
while ((n = n.nextSibling) && n['s-sn'] === slotName) {
|
|
2639
|
-
childNodes.push(n);
|
|
2640
|
-
}
|
|
2641
|
-
return childNodes;
|
|
2642
|
-
};
|
|
2643
|
-
const hmrStart = (elm, cmpMeta, hmrVersionId) => {
|
|
2644
|
-
// ¯\_(ツ)_/¯
|
|
2645
|
-
const hostRef = getHostRef(elm);
|
|
2646
|
-
// reset state flags to only have been connected
|
|
2647
|
-
hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;
|
|
2648
|
-
// TODO
|
|
2649
|
-
// detatch any event listeners that may have been added
|
|
2650
|
-
// because we're not passing an exact event name it'll
|
|
2651
|
-
// remove all of this element's event, which is good
|
|
2652
|
-
// create a callback for when this component finishes hmr
|
|
2653
|
-
elm['s-hmr-load'] = () => {
|
|
2654
|
-
// finished hmr for this element
|
|
2655
|
-
delete elm['s-hmr-load'];
|
|
2656
|
-
};
|
|
2657
|
-
// re-initialize the component
|
|
2658
|
-
initializeComponent(elm, hostRef, cmpMeta, hmrVersionId);
|
|
2659
|
-
};
|
|
2660
1677
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2661
|
-
|
|
2662
|
-
performance.mark('st:app:start');
|
|
2663
|
-
}
|
|
2664
|
-
installDevTools();
|
|
2665
|
-
const endBootstrap = createTime('bootstrapLazy');
|
|
1678
|
+
const endBootstrap = createTime();
|
|
2666
1679
|
const cmpTags = [];
|
|
2667
1680
|
const exclude = options.exclude || [];
|
|
2668
1681
|
const customElements = win.customElements;
|
|
@@ -2670,27 +1683,10 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2670
1683
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
2671
1684
|
const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
|
|
2672
1685
|
const deferredConnectedCallbacks = [];
|
|
2673
|
-
const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
2674
1686
|
let appLoadFallback;
|
|
2675
1687
|
let isBootstrapping = true;
|
|
2676
|
-
let i = 0;
|
|
2677
1688
|
Object.assign(plt, options);
|
|
2678
1689
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
2679
|
-
if (BUILD.asyncQueue) {
|
|
2680
|
-
if (options.syncQueue) {
|
|
2681
|
-
plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
|
|
2682
|
-
}
|
|
2683
|
-
}
|
|
2684
|
-
if (BUILD.hydrateClientSide) {
|
|
2685
|
-
// If the app is already hydrated there is not point to disable the
|
|
2686
|
-
// async queue. This will improve the first input delay
|
|
2687
|
-
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
2688
|
-
}
|
|
2689
|
-
if (BUILD.hydrateClientSide && BUILD.shadowDom) {
|
|
2690
|
-
for (; i < styles.length; i++) {
|
|
2691
|
-
registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
1690
|
lazyBundles.map((lazyBundle) => {
|
|
2695
1691
|
lazyBundle[1].map((compactMeta) => {
|
|
2696
1692
|
const cmpMeta = {
|
|
@@ -2699,24 +1695,19 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2699
1695
|
$members$: compactMeta[2],
|
|
2700
1696
|
$listeners$: compactMeta[3],
|
|
2701
1697
|
};
|
|
2702
|
-
|
|
1698
|
+
{
|
|
2703
1699
|
cmpMeta.$members$ = compactMeta[2];
|
|
2704
1700
|
}
|
|
2705
|
-
|
|
1701
|
+
{
|
|
2706
1702
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2707
1703
|
}
|
|
2708
|
-
|
|
1704
|
+
{
|
|
2709
1705
|
cmpMeta.$attrsToReflect$ = [];
|
|
2710
1706
|
}
|
|
2711
|
-
|
|
1707
|
+
{
|
|
2712
1708
|
cmpMeta.$watchers$ = {};
|
|
2713
1709
|
}
|
|
2714
|
-
|
|
2715
|
-
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
2716
|
-
}
|
|
2717
|
-
const tagName = BUILD.transformTagName && options.transformTagName
|
|
2718
|
-
? options.transformTagName(cmpMeta.$tagName$)
|
|
2719
|
-
: cmpMeta.$tagName$;
|
|
1710
|
+
const tagName = cmpMeta.$tagName$;
|
|
2720
1711
|
const HostElement = class extends HTMLElement {
|
|
2721
1712
|
// StencilLazyHost
|
|
2722
1713
|
constructor(self) {
|
|
@@ -2724,28 +1715,16 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2724
1715
|
super(self);
|
|
2725
1716
|
self = this;
|
|
2726
1717
|
registerHost(self, cmpMeta);
|
|
2727
|
-
if (
|
|
1718
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2728
1719
|
// this component is using shadow dom
|
|
2729
1720
|
// and this browser supports shadow dom
|
|
2730
1721
|
// add the read-only property "shadowRoot" to the host element
|
|
2731
1722
|
// adding the shadow root build conditionals to minimize runtime
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
self.attachShadow({
|
|
2735
|
-
mode: 'open',
|
|
2736
|
-
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
|
|
2737
|
-
});
|
|
2738
|
-
}
|
|
2739
|
-
else {
|
|
1723
|
+
{
|
|
1724
|
+
{
|
|
2740
1725
|
self.attachShadow({ mode: 'open' });
|
|
2741
1726
|
}
|
|
2742
1727
|
}
|
|
2743
|
-
else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
|
|
2744
|
-
self.shadowRoot = self;
|
|
2745
|
-
}
|
|
2746
|
-
}
|
|
2747
|
-
if (BUILD.slotChildNodesFix) {
|
|
2748
|
-
patchChildSlotNodes(self, cmpMeta);
|
|
2749
1728
|
}
|
|
2750
1729
|
}
|
|
2751
1730
|
connectedCallback() {
|
|
@@ -2768,20 +1747,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2768
1747
|
return getHostRef(this).$onReadyPromise$;
|
|
2769
1748
|
}
|
|
2770
1749
|
};
|
|
2771
|
-
if (BUILD.cloneNodeFix) {
|
|
2772
|
-
patchCloneNode(HostElement.prototype);
|
|
2773
|
-
}
|
|
2774
|
-
if (BUILD.appendChildSlotFix) {
|
|
2775
|
-
patchSlotAppendChild(HostElement.prototype);
|
|
2776
|
-
}
|
|
2777
|
-
if (BUILD.hotModuleReplacement) {
|
|
2778
|
-
HostElement.prototype['s-hmr'] = function (hmrVersionId) {
|
|
2779
|
-
hmrStart(this, cmpMeta, hmrVersionId);
|
|
2780
|
-
};
|
|
2781
|
-
}
|
|
2782
|
-
if (BUILD.scopedSlotTextContentFix) {
|
|
2783
|
-
patchTextContent(HostElement.prototype, cmpMeta);
|
|
2784
|
-
}
|
|
2785
1750
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
2786
1751
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
2787
1752
|
cmpTags.push(tagName);
|
|
@@ -2789,7 +1754,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2789
1754
|
}
|
|
2790
1755
|
});
|
|
2791
1756
|
});
|
|
2792
|
-
|
|
1757
|
+
{
|
|
2793
1758
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
2794
1759
|
visibilityStyle.setAttribute('data-styles', '');
|
|
2795
1760
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
@@ -2800,89 +1765,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2800
1765
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
2801
1766
|
}
|
|
2802
1767
|
else {
|
|
2803
|
-
|
|
2804
|
-
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
|
|
2805
|
-
}
|
|
2806
|
-
else {
|
|
1768
|
+
{
|
|
2807
1769
|
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
|
|
2808
1770
|
}
|
|
2809
1771
|
}
|
|
2810
1772
|
// Fallback appLoad event
|
|
2811
1773
|
endBootstrap();
|
|
2812
1774
|
};
|
|
2813
|
-
const getConnect = (_ref, tagName) => {
|
|
2814
|
-
const componentOnReady = () => {
|
|
2815
|
-
let elm = doc.querySelector(tagName);
|
|
2816
|
-
if (!elm) {
|
|
2817
|
-
elm = doc.createElement(tagName);
|
|
2818
|
-
doc.body.appendChild(elm);
|
|
2819
|
-
}
|
|
2820
|
-
return typeof elm.componentOnReady === 'function' ? elm.componentOnReady() : Promise.resolve(elm);
|
|
2821
|
-
};
|
|
2822
|
-
const create = (...args) => {
|
|
2823
|
-
return componentOnReady().then((el) => el.create(...args));
|
|
2824
|
-
};
|
|
2825
|
-
return {
|
|
2826
|
-
create,
|
|
2827
|
-
componentOnReady,
|
|
2828
|
-
};
|
|
2829
|
-
};
|
|
2830
|
-
const getContext = (_elm, context) => {
|
|
2831
|
-
if (context in Context) {
|
|
2832
|
-
return Context[context];
|
|
2833
|
-
}
|
|
2834
|
-
else if (context === 'window') {
|
|
2835
|
-
return win;
|
|
2836
|
-
}
|
|
2837
|
-
else if (context === 'document') {
|
|
2838
|
-
return doc;
|
|
2839
|
-
}
|
|
2840
|
-
else if (context === 'isServer' || context === 'isPrerender') {
|
|
2841
|
-
return BUILD.hydrateServerSide ? true : false;
|
|
2842
|
-
}
|
|
2843
|
-
else if (context === 'isClient') {
|
|
2844
|
-
return BUILD.hydrateServerSide ? false : true;
|
|
2845
|
-
}
|
|
2846
|
-
else if (context === 'resourcesUrl' || context === 'publicPath') {
|
|
2847
|
-
return getAssetPath('.');
|
|
2848
|
-
}
|
|
2849
|
-
else if (context === 'queue') {
|
|
2850
|
-
return {
|
|
2851
|
-
write: writeTask,
|
|
2852
|
-
read: readTask,
|
|
2853
|
-
tick: {
|
|
2854
|
-
then(cb) {
|
|
2855
|
-
return nextTick(cb);
|
|
2856
|
-
},
|
|
2857
|
-
},
|
|
2858
|
-
};
|
|
2859
|
-
}
|
|
2860
|
-
return undefined;
|
|
2861
|
-
};
|
|
2862
|
-
const Fragment = (_, children) => children;
|
|
2863
1775
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
2864
|
-
if (
|
|
2865
|
-
// this is called immediately within the element's constructor
|
|
2866
|
-
// initialize our event listeners on the host element
|
|
2867
|
-
// we do this now so that we can listen to events that may
|
|
2868
|
-
// have fired even before the instance is ready
|
|
2869
|
-
if (BUILD.hostListenerTargetParent) {
|
|
2870
|
-
// this component may have event listeners that should be attached to the parent
|
|
2871
|
-
if (attachParentListeners) {
|
|
2872
|
-
// this is being ran from within the connectedCallback
|
|
2873
|
-
// which is important so that we know the host element actually has a parent element
|
|
2874
|
-
// filter out the listeners to only have the ones that ARE being attached to the parent
|
|
2875
|
-
listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);
|
|
2876
|
-
}
|
|
2877
|
-
else {
|
|
2878
|
-
// this is being ran from within the component constructor
|
|
2879
|
-
// everything BUT the parent element listeners should be attached at this time
|
|
2880
|
-
// filter out the listeners that are NOT being attached to the parent
|
|
2881
|
-
listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
1776
|
+
if (listeners) {
|
|
2884
1777
|
listeners.map(([flags, name, method]) => {
|
|
2885
|
-
const target =
|
|
1778
|
+
const target = elm;
|
|
2886
1779
|
const handler = hostListenerProxy(hostRef, method);
|
|
2887
1780
|
const opts = hostListenerOpts(flags);
|
|
2888
1781
|
plt.ael(target, name, handler, opts);
|
|
@@ -2892,7 +1785,7 @@ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =
|
|
|
2892
1785
|
};
|
|
2893
1786
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
2894
1787
|
try {
|
|
2895
|
-
|
|
1788
|
+
{
|
|
2896
1789
|
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
2897
1790
|
// instance is ready, let's call it's member method for this event
|
|
2898
1791
|
hostRef.$lazyInstance$[methodName](ev);
|
|
@@ -2901,172 +1794,13 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
2901
1794
|
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
2902
1795
|
}
|
|
2903
1796
|
}
|
|
2904
|
-
else {
|
|
2905
|
-
hostRef.$hostElement$[methodName](ev);
|
|
2906
|
-
}
|
|
2907
1797
|
}
|
|
2908
1798
|
catch (e) {
|
|
2909
1799
|
consoleError(e);
|
|
2910
1800
|
}
|
|
2911
1801
|
};
|
|
2912
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
2913
|
-
if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
2914
|
-
return doc;
|
|
2915
|
-
if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
2916
|
-
return win;
|
|
2917
|
-
if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
2918
|
-
return doc.body;
|
|
2919
|
-
if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
|
|
2920
|
-
return elm.parentElement;
|
|
2921
|
-
return elm;
|
|
2922
|
-
};
|
|
2923
1802
|
// prettier-ignore
|
|
2924
|
-
const hostListenerOpts = (flags) =>
|
|
2925
|
-
? ({
|
|
2926
|
-
passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
|
|
2927
|
-
capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
|
|
2928
|
-
})
|
|
2929
|
-
: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
2930
|
-
const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
2931
|
-
const insertVdomAnnotations = (doc, staticComponents) => {
|
|
2932
|
-
if (doc != null) {
|
|
2933
|
-
const docData = {
|
|
2934
|
-
hostIds: 0,
|
|
2935
|
-
rootLevelIds: 0,
|
|
2936
|
-
staticComponents: new Set(staticComponents),
|
|
2937
|
-
};
|
|
2938
|
-
const orgLocationNodes = [];
|
|
2939
|
-
parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
|
|
2940
|
-
orgLocationNodes.forEach((orgLocationNode) => {
|
|
2941
|
-
if (orgLocationNode != null) {
|
|
2942
|
-
const nodeRef = orgLocationNode['s-nr'];
|
|
2943
|
-
let hostId = nodeRef['s-host-id'];
|
|
2944
|
-
let nodeId = nodeRef['s-node-id'];
|
|
2945
|
-
let childId = `${hostId}.${nodeId}`;
|
|
2946
|
-
if (hostId == null) {
|
|
2947
|
-
hostId = 0;
|
|
2948
|
-
docData.rootLevelIds++;
|
|
2949
|
-
nodeId = docData.rootLevelIds;
|
|
2950
|
-
childId = `${hostId}.${nodeId}`;
|
|
2951
|
-
if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
2952
|
-
nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
2953
|
-
}
|
|
2954
|
-
else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
2955
|
-
if (hostId === 0) {
|
|
2956
|
-
const textContent = nodeRef.nodeValue.trim();
|
|
2957
|
-
if (textContent === '') {
|
|
2958
|
-
// useless whitespace node at the document root
|
|
2959
|
-
orgLocationNode.remove();
|
|
2960
|
-
return;
|
|
2961
|
-
}
|
|
2962
|
-
}
|
|
2963
|
-
const commentBeforeTextNode = doc.createComment(childId);
|
|
2964
|
-
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
2965
|
-
nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
2969
|
-
const orgLocationParentNode = orgLocationNode.parentElement;
|
|
2970
|
-
if (orgLocationParentNode) {
|
|
2971
|
-
if (orgLocationParentNode['s-en'] === '') {
|
|
2972
|
-
// ending with a "." means that the parent element
|
|
2973
|
-
// of this node's original location is a SHADOW dom element
|
|
2974
|
-
// and this node is apart of the root level light dom
|
|
2975
|
-
orgLocationNodeId += `.`;
|
|
2976
|
-
}
|
|
2977
|
-
else if (orgLocationParentNode['s-en'] === 'c') {
|
|
2978
|
-
// ending with a ".c" means that the parent element
|
|
2979
|
-
// of this node's original location is a SCOPED element
|
|
2980
|
-
// and this node is apart of the root level light dom
|
|
2981
|
-
orgLocationNodeId += `.c`;
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
orgLocationNode.nodeValue = orgLocationNodeId;
|
|
2985
|
-
}
|
|
2986
|
-
});
|
|
2987
|
-
}
|
|
2988
|
-
};
|
|
2989
|
-
const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
|
|
2990
|
-
if (node == null) {
|
|
2991
|
-
return;
|
|
2992
|
-
}
|
|
2993
|
-
if (node['s-nr'] != null) {
|
|
2994
|
-
orgLocationNodes.push(node);
|
|
2995
|
-
}
|
|
2996
|
-
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
2997
|
-
node.childNodes.forEach((childNode) => {
|
|
2998
|
-
const hostRef = getHostRef(childNode);
|
|
2999
|
-
if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
|
|
3000
|
-
const cmpData = {
|
|
3001
|
-
nodeIds: 0,
|
|
3002
|
-
};
|
|
3003
|
-
insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
|
|
3004
|
-
}
|
|
3005
|
-
parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
|
|
3006
|
-
});
|
|
3007
|
-
}
|
|
3008
|
-
};
|
|
3009
|
-
const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
|
|
3010
|
-
if (vnode != null) {
|
|
3011
|
-
const hostId = ++docData.hostIds;
|
|
3012
|
-
hostElm.setAttribute(HYDRATE_ID, hostId);
|
|
3013
|
-
if (hostElm['s-cr'] != null) {
|
|
3014
|
-
hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
|
|
3015
|
-
}
|
|
3016
|
-
if (vnode.$children$ != null) {
|
|
3017
|
-
const depth = 0;
|
|
3018
|
-
vnode.$children$.forEach((vnodeChild, index) => {
|
|
3019
|
-
insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
|
|
3020
|
-
});
|
|
3021
|
-
}
|
|
3022
|
-
if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute('c-id')) {
|
|
3023
|
-
const parent = hostElm.parentElement;
|
|
3024
|
-
if (parent && parent.childNodes) {
|
|
3025
|
-
const parentChildNodes = Array.from(parent.childNodes);
|
|
3026
|
-
const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);
|
|
3027
|
-
if (comment) {
|
|
3028
|
-
const index = parentChildNodes.indexOf(hostElm) - 1;
|
|
3029
|
-
vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
}
|
|
3034
|
-
};
|
|
3035
|
-
const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
|
|
3036
|
-
const childElm = vnodeChild.$elm$;
|
|
3037
|
-
if (childElm == null) {
|
|
3038
|
-
return;
|
|
3039
|
-
}
|
|
3040
|
-
const nodeId = cmpData.nodeIds++;
|
|
3041
|
-
const childId = `${hostId}.${nodeId}.${depth}.${index}`;
|
|
3042
|
-
childElm['s-host-id'] = hostId;
|
|
3043
|
-
childElm['s-node-id'] = nodeId;
|
|
3044
|
-
if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
3045
|
-
childElm.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3046
|
-
}
|
|
3047
|
-
else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
3048
|
-
const parentNode = childElm.parentNode;
|
|
3049
|
-
const nodeName = parentNode.nodeName;
|
|
3050
|
-
if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
|
|
3051
|
-
const textNodeId = `${TEXT_NODE_ID}.${childId}`;
|
|
3052
|
-
const commentBeforeTextNode = doc.createComment(textNodeId);
|
|
3053
|
-
parentNode.insertBefore(commentBeforeTextNode, childElm);
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
3057
|
-
if (childElm['s-sr']) {
|
|
3058
|
-
const slotName = childElm['s-sn'] || '';
|
|
3059
|
-
const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
|
|
3060
|
-
childElm.nodeValue = slotNodeId;
|
|
3061
|
-
}
|
|
3062
|
-
}
|
|
3063
|
-
if (vnodeChild.$children$ != null) {
|
|
3064
|
-
const childDepth = depth + 1;
|
|
3065
|
-
vnodeChild.$children$.forEach((vnode, index) => {
|
|
3066
|
-
insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
|
|
3067
|
-
});
|
|
3068
|
-
}
|
|
3069
|
-
};
|
|
1803
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
3070
1804
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
3071
1805
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
3072
1806
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -3077,42 +1811,25 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
3077
1811
|
$cmpMeta$: cmpMeta,
|
|
3078
1812
|
$instanceValues$: new Map(),
|
|
3079
1813
|
};
|
|
3080
|
-
|
|
3081
|
-
hostRef.$renderCount$ = 0;
|
|
3082
|
-
}
|
|
3083
|
-
if (BUILD.method && BUILD.lazyLoad) {
|
|
1814
|
+
{
|
|
3084
1815
|
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
3085
1816
|
}
|
|
3086
|
-
|
|
1817
|
+
{
|
|
3087
1818
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
3088
1819
|
elm['s-p'] = [];
|
|
3089
1820
|
elm['s-rc'] = [];
|
|
3090
1821
|
}
|
|
3091
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
1822
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
3092
1823
|
return hostRefs.set(elm, hostRef);
|
|
3093
1824
|
};
|
|
3094
1825
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
3095
|
-
const consoleError = (e, el) => (
|
|
3096
|
-
const STENCIL_DEV_MODE = BUILD.isTesting
|
|
3097
|
-
? ['STENCIL:'] // E2E testing
|
|
3098
|
-
: [
|
|
3099
|
-
'%cstencil',
|
|
3100
|
-
'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
|
|
3101
|
-
];
|
|
3102
|
-
const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
|
|
3103
|
-
const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
3104
|
-
const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
|
|
3105
|
-
const setErrorHandler = (handler) => (customError = handler);
|
|
1826
|
+
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
3106
1827
|
const cmpModules = /*@__PURE__*/ new Map();
|
|
3107
1828
|
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
3108
1829
|
// loadModuleImport
|
|
3109
1830
|
const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
|
3110
1831
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
3111
|
-
|
|
3112
|
-
consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
|
|
3113
|
-
return undefined;
|
|
3114
|
-
}
|
|
3115
|
-
const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
|
|
1832
|
+
const module = cmpModules.get(bundleId) ;
|
|
3116
1833
|
if (module) {
|
|
3117
1834
|
return module[exportName];
|
|
3118
1835
|
}
|
|
@@ -3122,20 +1839,16 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
3122
1839
|
/* webpackInclude: /\.entry\.js$/ */
|
|
3123
1840
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
3124
1841
|
/* webpackMode: "lazy" */
|
|
3125
|
-
`./${bundleId}.entry.js${
|
|
3126
|
-
|
|
1842
|
+
`./${bundleId}.entry.js${''}`).then((importedModule) => {
|
|
1843
|
+
{
|
|
3127
1844
|
cmpModules.set(bundleId, importedModule);
|
|
3128
1845
|
}
|
|
3129
1846
|
return importedModule[exportName];
|
|
3130
1847
|
}, consoleError);
|
|
3131
1848
|
};
|
|
3132
1849
|
const styles = /*@__PURE__*/ new Map();
|
|
3133
|
-
const modeResolutionChain = [];
|
|
3134
1850
|
const win = typeof window !== 'undefined' ? window : {};
|
|
3135
|
-
const CSS = BUILD.cssVarShim ? win.CSS : null;
|
|
3136
1851
|
const doc = win.document || { head: {} };
|
|
3137
|
-
const H = (win.HTMLElement || class {
|
|
3138
|
-
});
|
|
3139
1852
|
const plt = {
|
|
3140
1853
|
$flags$: 0,
|
|
3141
1854
|
$resourcesUrl$: '',
|
|
@@ -3145,27 +1858,8 @@ const plt = {
|
|
|
3145
1858
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
3146
1859
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
3147
1860
|
};
|
|
3148
|
-
const setPlatformHelpers = (helpers) => {
|
|
3149
|
-
Object.assign(plt, helpers);
|
|
3150
|
-
};
|
|
3151
|
-
const supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom
|
|
3152
|
-
? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
3153
|
-
: true;
|
|
3154
|
-
const supportsListenerOptions = /*@__PURE__*/ (() => {
|
|
3155
|
-
let supportsListenerOptions = false;
|
|
3156
|
-
try {
|
|
3157
|
-
doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
|
|
3158
|
-
get() {
|
|
3159
|
-
supportsListenerOptions = true;
|
|
3160
|
-
},
|
|
3161
|
-
}));
|
|
3162
|
-
}
|
|
3163
|
-
catch (e) { }
|
|
3164
|
-
return supportsListenerOptions;
|
|
3165
|
-
})();
|
|
3166
1861
|
const promiseResolve = (v) => Promise.resolve(v);
|
|
3167
|
-
const supportsConstructableStylesheets =
|
|
3168
|
-
? /*@__PURE__*/ (() => {
|
|
1862
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
3169
1863
|
try {
|
|
3170
1864
|
new CSSStyleSheet();
|
|
3171
1865
|
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
@@ -3173,10 +1867,9 @@ const supportsConstructableStylesheets = BUILD.constructableCSS
|
|
|
3173
1867
|
catch (e) { }
|
|
3174
1868
|
return false;
|
|
3175
1869
|
})()
|
|
3176
|
-
|
|
1870
|
+
;
|
|
3177
1871
|
const queueDomReads = [];
|
|
3178
1872
|
const queueDomWrites = [];
|
|
3179
|
-
const queueDomWritesLow = [];
|
|
3180
1873
|
const queueTask = (queue, write) => (cb) => {
|
|
3181
1874
|
queue.push(cb);
|
|
3182
1875
|
if (!queuePending) {
|
|
@@ -3200,53 +1893,13 @@ const consume = (queue) => {
|
|
|
3200
1893
|
}
|
|
3201
1894
|
queue.length = 0;
|
|
3202
1895
|
};
|
|
3203
|
-
const consumeTimeout = (queue, timeout) => {
|
|
3204
|
-
let i = 0;
|
|
3205
|
-
let ts = 0;
|
|
3206
|
-
while (i < queue.length && (ts = performance.now()) < timeout) {
|
|
3207
|
-
try {
|
|
3208
|
-
queue[i++](ts);
|
|
3209
|
-
}
|
|
3210
|
-
catch (e) {
|
|
3211
|
-
consoleError(e);
|
|
3212
|
-
}
|
|
3213
|
-
}
|
|
3214
|
-
if (i === queue.length) {
|
|
3215
|
-
queue.length = 0;
|
|
3216
|
-
}
|
|
3217
|
-
else if (i !== 0) {
|
|
3218
|
-
queue.splice(0, i);
|
|
3219
|
-
}
|
|
3220
|
-
};
|
|
3221
1896
|
const flush = () => {
|
|
3222
|
-
if (BUILD.asyncQueue) {
|
|
3223
|
-
queueCongestion++;
|
|
3224
|
-
}
|
|
3225
1897
|
// always force a bunch of medium callbacks to run, but still have
|
|
3226
1898
|
// a throttle on how many can run in a certain time
|
|
3227
1899
|
// DOM READS!!!
|
|
3228
1900
|
consume(queueDomReads);
|
|
3229
1901
|
// DOM WRITES!!!
|
|
3230
|
-
|
|
3231
|
-
const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
|
|
3232
|
-
? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
|
|
3233
|
-
: Infinity;
|
|
3234
|
-
consumeTimeout(queueDomWrites, timeout);
|
|
3235
|
-
consumeTimeout(queueDomWritesLow, timeout);
|
|
3236
|
-
if (queueDomWrites.length > 0) {
|
|
3237
|
-
queueDomWritesLow.push(...queueDomWrites);
|
|
3238
|
-
queueDomWrites.length = 0;
|
|
3239
|
-
}
|
|
3240
|
-
if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
|
|
3241
|
-
// still more to do yet, but we've run out of time
|
|
3242
|
-
// let's let this thing cool off and try again in the next tick
|
|
3243
|
-
plt.raf(flush);
|
|
3244
|
-
}
|
|
3245
|
-
else {
|
|
3246
|
-
queueCongestion = 0;
|
|
3247
|
-
}
|
|
3248
|
-
}
|
|
3249
|
-
else {
|
|
1902
|
+
{
|
|
3250
1903
|
consume(queueDomWrites);
|
|
3251
1904
|
if ((queuePending = queueDomReads.length > 0)) {
|
|
3252
1905
|
// still more to do yet, but we've run out of time
|
|
@@ -3256,7 +1909,6 @@ const flush = () => {
|
|
|
3256
1909
|
}
|
|
3257
1910
|
};
|
|
3258
1911
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
3259
|
-
const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
|
|
3260
1912
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
3261
1913
|
|
|
3262
|
-
export {
|
|
1914
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|