taggedjs 2.4.12 → 2.4.14
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/bundle.js +862 -424
- package/bundle.js.map +1 -1
- package/js/Clones.type.d.ts +4 -1
- package/js/Clones.type.js +1 -1
- package/js/Clones.type.js.map +1 -1
- package/js/Tag.class.d.ts +7 -10
- package/js/Tag.class.js +120 -63
- package/js/Tag.class.js.map +1 -1
- package/js/Tag.utils.d.ts +5 -5
- package/js/Tag.utils.js +1 -1
- package/js/Tag.utils.js.map +1 -1
- package/js/TemplaterResult.class.d.ts +5 -1
- package/js/TemplaterResult.class.js +19 -12
- package/js/TemplaterResult.class.js.map +1 -1
- package/js/alterProps.function.d.ts +2 -0
- package/js/alterProps.function.js +18 -12
- package/js/alterProps.function.js.map +1 -1
- package/js/checkDestroyPrevious.function.d.ts +3 -1
- package/js/checkDestroyPrevious.function.js +33 -11
- package/js/checkDestroyPrevious.function.js.map +1 -1
- package/js/destroyTag.function.js +4 -4
- package/js/destroyTag.function.js.map +1 -1
- package/js/hasTagSupportChanged.function.js +0 -3
- package/js/hasTagSupportChanged.function.js.map +1 -1
- package/js/index.d.ts +1 -2
- package/js/index.js +1 -2
- package/js/index.js.map +1 -1
- package/js/insertAfter.function.d.ts +2 -0
- package/js/insertAfter.function.js +6 -0
- package/js/insertAfter.function.js.map +1 -0
- package/js/interpolateElement.d.ts +3 -2
- package/js/interpolateElement.js +3 -2
- package/js/interpolateElement.js.map +1 -1
- package/js/interpolateTemplate.d.ts +2 -3
- package/js/interpolateTemplate.js +6 -24
- package/js/interpolateTemplate.js.map +1 -1
- package/js/interpolations.js +2 -1
- package/js/interpolations.js.map +1 -1
- package/js/isInstance.d.ts +2 -2
- package/js/isInstance.js.map +1 -1
- package/js/processAttribute.function.d.ts +1 -0
- package/js/processAttribute.function.js +3 -3
- package/js/processAttribute.function.js.map +1 -1
- package/js/processNewValue.function.js +1 -1
- package/js/processNewValue.function.js.map +1 -1
- package/js/processRegularValue.function.d.ts +2 -2
- package/js/processRegularValue.function.js +7 -6
- package/js/processRegularValue.function.js.map +1 -1
- package/js/processSubjectComponent.function.d.ts +4 -3
- package/js/processSubjectComponent.function.js +26 -18
- package/js/processSubjectComponent.function.js.map +1 -1
- package/js/processSubjectValue.function.d.ts +4 -9
- package/js/processSubjectValue.function.js +6 -54
- package/js/processSubjectValue.function.js.map +1 -1
- package/js/processTag.function.d.ts +7 -0
- package/js/processTag.function.js +59 -0
- package/js/processTag.function.js.map +1 -0
- package/js/processTagArray.d.ts +7 -5
- package/js/processTagArray.js +55 -18
- package/js/processTagArray.js.map +1 -1
- package/js/processTagResult.function.d.ts +1 -1
- package/js/processTagResult.function.js +26 -32
- package/js/processTagResult.function.js.map +1 -1
- package/js/render.d.ts +2 -1
- package/js/render.js.map +1 -1
- package/js/renderExistingTag.function.js +4 -3
- package/js/renderExistingTag.function.js.map +1 -1
- package/js/subject/Subject.class.d.ts +24 -0
- package/js/subject/Subject.class.js +103 -0
- package/js/subject/Subject.class.js.map +1 -0
- package/js/subject/Subject.utils.d.ts +27 -0
- package/js/subject/Subject.utils.js +4 -0
- package/js/subject/Subject.utils.js.map +1 -0
- package/js/subject/ValueSubject.d.ts +9 -0
- package/js/subject/ValueSubject.js +15 -0
- package/js/subject/ValueSubject.js.map +1 -0
- package/js/subject/combineLatest.function.d.ts +2 -0
- package/js/subject/combineLatest.function.js +24 -0
- package/js/subject/combineLatest.function.js.map +1 -0
- package/js/subject/index.d.ts +4 -0
- package/js/subject/index.js +5 -0
- package/js/subject/index.js.map +1 -0
- package/js/subject/will.functions.d.ts +8 -0
- package/js/subject/will.functions.js +32 -0
- package/js/subject/will.functions.js.map +1 -0
- package/js/tag.d.ts +1 -1
- package/js/tag.js +2 -2
- package/js/tag.js.map +1 -1
- package/js/tagElement.js +1 -1
- package/js/tagElement.js.map +1 -1
- package/js/updateBeforeTemplate.function.d.ts +3 -0
- package/js/updateBeforeTemplate.function.js +16 -0
- package/js/updateBeforeTemplate.function.js.map +1 -0
- package/js/updateExistingTagComponent.function.d.ts +2 -1
- package/js/updateExistingTagComponent.function.js +55 -24
- package/js/updateExistingTagComponent.function.js.map +1 -1
- package/js/updateExistingValue.function.d.ts +3 -2
- package/js/updateExistingValue.function.js +35 -11
- package/js/updateExistingValue.function.js.map +1 -1
- package/package.json +1 -1
- /package/js/{errors.d.ts → Errors.d.ts} +0 -0
- /package/js/{errors.js → Errors.js} +0 -0
- /package/js/{errors.js.map → Errors.js.map} +0 -0
package/bundle.js
CHANGED
|
@@ -1,73 +1,28 @@
|
|
|
1
1
|
/******/ var __webpack_modules__ = ({
|
|
2
2
|
|
|
3
|
-
/***/ "./ts/
|
|
4
|
-
|
|
5
|
-
!*** ./ts/
|
|
6
|
-
|
|
3
|
+
/***/ "./ts/Clones.type.ts":
|
|
4
|
+
/*!***************************!*\
|
|
5
|
+
!*** ./ts/Clones.type.ts ***!
|
|
6
|
+
\***************************/
|
|
7
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8
8
|
|
|
9
9
|
__webpack_require__.r(__webpack_exports__);
|
|
10
|
-
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ isRemoveTemplates: () => (/* binding */ isRemoveTemplates)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
const isRemoveTemplates = true;
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
/***/ }),
|
|
14
17
|
|
|
15
|
-
/***/ "./ts/
|
|
16
|
-
|
|
17
|
-
!*** ./ts/
|
|
18
|
-
|
|
18
|
+
/***/ "./ts/ElementTargetEvent.interface.ts":
|
|
19
|
+
/*!********************************************!*\
|
|
20
|
+
!*** ./ts/ElementTargetEvent.interface.ts ***!
|
|
21
|
+
\********************************************/
|
|
19
22
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20
23
|
|
|
21
24
|
__webpack_require__.r(__webpack_exports__);
|
|
22
|
-
|
|
23
|
-
/* harmony export */ Subject: () => (/* binding */ Subject)
|
|
24
|
-
/* harmony export */ });
|
|
25
|
-
class Subject {
|
|
26
|
-
value;
|
|
27
|
-
isSubject = true;
|
|
28
|
-
subscribers = [];
|
|
29
|
-
// unsubcount = 0 // 🔬 testing
|
|
30
|
-
constructor(value) {
|
|
31
|
-
this.value = value;
|
|
32
|
-
}
|
|
33
|
-
subscribe(callback) {
|
|
34
|
-
this.subscribers.push(callback);
|
|
35
|
-
SubjectClass.globalSubs.push(callback); // 🔬 testing
|
|
36
|
-
const countSubject = SubjectClass.globalSubCount$;
|
|
37
|
-
SubjectClass.globalSubCount$.set(countSubject.value + 1);
|
|
38
|
-
const unsubscribe = () => {
|
|
39
|
-
unsubscribe.unsubscribe();
|
|
40
|
-
};
|
|
41
|
-
// Return a function to unsubscribe from the BehaviorSubject
|
|
42
|
-
unsubscribe.unsubscribe = () => {
|
|
43
|
-
removeSubFromArray(this.subscribers, callback);
|
|
44
|
-
removeSubFromArray(SubjectClass.globalSubs, callback); // 🔬 testing
|
|
45
|
-
SubjectClass.globalSubCount$.set(countSubject.value - 1);
|
|
46
|
-
// any double unsubscribes will be ignored
|
|
47
|
-
unsubscribe.unsubscribe = () => undefined;
|
|
48
|
-
};
|
|
49
|
-
return unsubscribe;
|
|
50
|
-
}
|
|
51
|
-
set(value) {
|
|
52
|
-
this.value = value;
|
|
53
|
-
// Notify all subscribers with the new value
|
|
54
|
-
this.subscribers.forEach((callback) => {
|
|
55
|
-
callback.value = value;
|
|
56
|
-
callback(value);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
next = this.set;
|
|
60
|
-
}
|
|
61
|
-
function removeSubFromArray(subscribers, callback) {
|
|
62
|
-
const index = subscribers.indexOf(callback);
|
|
63
|
-
if (index !== -1) {
|
|
64
|
-
subscribers.splice(index, 1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const SubjectClass = Subject;
|
|
68
|
-
SubjectClass.globalSubs = []; // 🔬 for testing
|
|
69
|
-
SubjectClass.globalSubCount$ = new Subject(); // for ease of debugging
|
|
70
|
-
SubjectClass.globalSubCount$.set(0);
|
|
25
|
+
|
|
71
26
|
|
|
72
27
|
|
|
73
28
|
/***/ }),
|
|
@@ -80,7 +35,6 @@ SubjectClass.globalSubCount$.set(0);
|
|
|
80
35
|
|
|
81
36
|
__webpack_require__.r(__webpack_exports__);
|
|
82
37
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
83
|
-
/* harmony export */ ArrayValueNeverSet: () => (/* binding */ ArrayValueNeverSet),
|
|
84
38
|
/* harmony export */ Tag: () => (/* binding */ Tag),
|
|
85
39
|
/* harmony export */ escapeSearch: () => (/* binding */ escapeSearch),
|
|
86
40
|
/* harmony export */ escapeVariable: () => (/* binding */ escapeVariable),
|
|
@@ -94,6 +48,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
94
48
|
/* harmony import */ var _processNewValue_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./processNewValue.function */ "./ts/processNewValue.function.ts");
|
|
95
49
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
96
50
|
/* harmony import */ var _isLikeTags_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isLikeTags.function */ "./ts/isLikeTags.function.ts");
|
|
51
|
+
/* harmony import */ var _Clones_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Clones.type */ "./ts/Clones.type.ts");
|
|
52
|
+
/* harmony import */ var _checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./checkDestroyPrevious.function */ "./ts/checkDestroyPrevious.function.ts");
|
|
53
|
+
/* harmony import */ var _insertAfter_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./insertAfter.function */ "./ts/insertAfter.function.ts");
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
97
57
|
|
|
98
58
|
|
|
99
59
|
|
|
@@ -106,9 +66,6 @@ const variablePrefix = '__tagvar';
|
|
|
106
66
|
const escapeVariable = '--' + variablePrefix + '--';
|
|
107
67
|
const prefixSearch = new RegExp(variablePrefix, 'g');
|
|
108
68
|
const escapeSearch = new RegExp(escapeVariable, 'g');
|
|
109
|
-
class ArrayValueNeverSet {
|
|
110
|
-
isArrayValueNeverSet = true;
|
|
111
|
-
}
|
|
112
69
|
class Tag {
|
|
113
70
|
strings;
|
|
114
71
|
values;
|
|
@@ -116,7 +73,6 @@ class Tag {
|
|
|
116
73
|
isTag = true;
|
|
117
74
|
hasLiveElements = false;
|
|
118
75
|
clones = []; // elements on document. Needed at destroy process to know what to destroy
|
|
119
|
-
cloneSubs = []; // subscriptions created by clones
|
|
120
76
|
childTags = []; // tags on me
|
|
121
77
|
tagSupport;
|
|
122
78
|
lastTemplateString = undefined; // used to compare templates for updates
|
|
@@ -124,15 +80,15 @@ class Tag {
|
|
|
124
80
|
ownerTag;
|
|
125
81
|
// insertBefore?: Element
|
|
126
82
|
appElement; // only seen on this.getAppElement().appElement
|
|
127
|
-
// present only when an array. Populated by
|
|
128
|
-
|
|
83
|
+
// present only when an array. Populated by Tag.key()
|
|
84
|
+
memory = {};
|
|
129
85
|
constructor(strings, values) {
|
|
130
86
|
this.strings = strings;
|
|
131
87
|
this.values = values;
|
|
132
88
|
}
|
|
133
89
|
/** Used for array, such as array.map(), calls aka array.map(x => html``.key(x)) */
|
|
134
90
|
key(arrayValue) {
|
|
135
|
-
this.arrayValue = arrayValue;
|
|
91
|
+
this.memory.arrayValue = arrayValue;
|
|
136
92
|
return this;
|
|
137
93
|
}
|
|
138
94
|
destroy(options = {
|
|
@@ -146,6 +102,18 @@ class Tag {
|
|
|
146
102
|
const global = tagSupport.templater.global;
|
|
147
103
|
// removing is considered rendering. Prevents after event processing of this tag even tho possibly deleted
|
|
148
104
|
// ++this.tagSupport.templater.global.renderCount
|
|
105
|
+
const subject = tagSupport.subject;
|
|
106
|
+
// put back down the template tag
|
|
107
|
+
const insertBefore = global.insertBefore;
|
|
108
|
+
if (_Clones_type__WEBPACK_IMPORTED_MODULE_8__.isRemoveTemplates) {
|
|
109
|
+
const placeholder = global.placeholderElm;
|
|
110
|
+
if (placeholder && !('arrayValue' in this.memory)) {
|
|
111
|
+
if (!options.byParent) {
|
|
112
|
+
(0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_9__.restoreTagMarker)(this, insertBefore);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
delete global.placeholderElm;
|
|
149
117
|
// the isComponent check maybe able to be removed
|
|
150
118
|
const isComponent = tagSupport ? true : false;
|
|
151
119
|
if (isComponent) {
|
|
@@ -153,7 +121,6 @@ class Tag {
|
|
|
153
121
|
}
|
|
154
122
|
const childTags = options.byParent ? [] : getChildTagsToDestroy(this.childTags);
|
|
155
123
|
// signify that no further event rendering should take place by making logic think a render occurred during event
|
|
156
|
-
// childTags.forEach(child => ++child.tagSupport.templater.global.renderCount)
|
|
157
124
|
// signify immediately child has been deleted (looked for during event processing)
|
|
158
125
|
childTags.forEach(child => {
|
|
159
126
|
const subGlobal = child.tagSupport.templater.global;
|
|
@@ -164,7 +131,7 @@ class Tag {
|
|
|
164
131
|
delete global.newest;
|
|
165
132
|
global.deleted = true;
|
|
166
133
|
this.hasLiveElements = false;
|
|
167
|
-
delete
|
|
134
|
+
delete subject.tag;
|
|
168
135
|
this.destroySubscriptions();
|
|
169
136
|
let mainPromise;
|
|
170
137
|
if (this.ownerTag) {
|
|
@@ -192,8 +159,9 @@ class Tag {
|
|
|
192
159
|
return mainPromise.then(() => options.stagger);
|
|
193
160
|
}
|
|
194
161
|
destroySubscriptions() {
|
|
195
|
-
this.
|
|
196
|
-
|
|
162
|
+
const global = this.tagSupport.templater.global;
|
|
163
|
+
global.subscriptions.forEach(cloneSub => cloneSub.unsubscribe());
|
|
164
|
+
global.subscriptions.length = 0;
|
|
197
165
|
}
|
|
198
166
|
destroyClones({ stagger } = {
|
|
199
167
|
stagger: 0,
|
|
@@ -206,6 +174,7 @@ class Tag {
|
|
|
206
174
|
}
|
|
207
175
|
return { stagger };
|
|
208
176
|
}
|
|
177
|
+
/** Reviews elements for the presences of ondestroy */
|
|
209
178
|
checkCloneRemoval(clone, stagger) {
|
|
210
179
|
let promise;
|
|
211
180
|
const customElm = clone;
|
|
@@ -249,31 +218,6 @@ class Tag {
|
|
|
249
218
|
}
|
|
250
219
|
isLikeTag(tag) {
|
|
251
220
|
return (0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_7__.isLikeTags)(this, tag);
|
|
252
|
-
const { string } = tag.getTemplate();
|
|
253
|
-
// TODO: most likely remove?
|
|
254
|
-
if (!this.lastTemplateString) {
|
|
255
|
-
throw new Error('no template here');
|
|
256
|
-
}
|
|
257
|
-
const stringMatched = string === this.lastTemplateString;
|
|
258
|
-
if (!stringMatched || tag.values.length !== this.values.length) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
const allVarsMatch = tag.values.every((value, index) => {
|
|
262
|
-
const compareTo = this.values[index];
|
|
263
|
-
const isFunctions = value instanceof Function && compareTo instanceof Function;
|
|
264
|
-
if (isFunctions) {
|
|
265
|
-
const stringMatch = value.toString() === compareTo.toString();
|
|
266
|
-
if (stringMatch) {
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
return false;
|
|
270
|
-
}
|
|
271
|
-
return true;
|
|
272
|
-
});
|
|
273
|
-
if (allVarsMatch) {
|
|
274
|
-
return true;
|
|
275
|
-
}
|
|
276
|
-
return false;
|
|
277
221
|
}
|
|
278
222
|
updateByTag(tag) {
|
|
279
223
|
if (!this.tagSupport.templater.global.oldest) {
|
|
@@ -335,31 +279,40 @@ class Tag {
|
|
|
335
279
|
}
|
|
336
280
|
this.buildBeforeElement(insertBefore, {
|
|
337
281
|
forceElement: true,
|
|
338
|
-
counts: { added: 0, removed: 0 },
|
|
282
|
+
counts: { added: 0, removed: 0 },
|
|
339
283
|
});
|
|
340
284
|
}
|
|
341
285
|
buildBeforeElement(insertBefore, options = {
|
|
342
286
|
forceElement: false,
|
|
343
287
|
counts: { added: 0, removed: 0 },
|
|
344
|
-
test: false
|
|
345
288
|
}) {
|
|
346
|
-
|
|
347
|
-
|
|
289
|
+
const subject = this.tagSupport.subject;
|
|
290
|
+
const thisTemplater = this.tagSupport.templater;
|
|
291
|
+
const global = thisTemplater.global;
|
|
292
|
+
if (_Clones_type__WEBPACK_IMPORTED_MODULE_8__.isRemoveTemplates) {
|
|
293
|
+
const placeholderElm = global.placeholderElm;
|
|
294
|
+
if (placeholderElm) {
|
|
295
|
+
const parentNode = placeholderElm.parentNode;
|
|
296
|
+
parentNode.insertBefore(insertBefore, placeholderElm);
|
|
297
|
+
// ??? - removed as we don't steal clones anymore
|
|
298
|
+
// this.clones.push( placeholderElm ) // put back on chopping block
|
|
299
|
+
delete global.placeholderElm;
|
|
300
|
+
}
|
|
348
301
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
302
|
+
const trueInsertBefore = insertBefore;
|
|
303
|
+
global.oldest = this;
|
|
304
|
+
global.newest = this;
|
|
305
|
+
subject.tag = this;
|
|
352
306
|
this.hasLiveElements = true;
|
|
353
307
|
// remove old clones
|
|
354
308
|
if (this.clones.length) {
|
|
355
309
|
this.clones.forEach(clone => this.checkCloneRemoval(clone, 0));
|
|
356
310
|
}
|
|
357
|
-
|
|
358
|
-
this.tagSupport.templater.global.insertBefore = insertBefore;
|
|
311
|
+
global.insertBefore = insertBefore;
|
|
359
312
|
// const context = this.tagSupport.memory.context // this.update()
|
|
360
313
|
const context = this.update();
|
|
361
314
|
const template = this.getTemplate();
|
|
362
|
-
if (!
|
|
315
|
+
if (!trueInsertBefore.parentNode) {
|
|
363
316
|
throw new Error('no parent before building tag');
|
|
364
317
|
}
|
|
365
318
|
const elementContainer = document.createElement('div');
|
|
@@ -371,38 +324,99 @@ class Tag {
|
|
|
371
324
|
{
|
|
372
325
|
forceElement: options.forceElement,
|
|
373
326
|
counts: options.counts
|
|
374
|
-
}
|
|
375
|
-
if (!
|
|
327
|
+
});
|
|
328
|
+
if (!trueInsertBefore.parentNode) {
|
|
376
329
|
throw new Error('no parent building tag');
|
|
377
330
|
}
|
|
378
|
-
afterInterpolateElement(elementContainer,
|
|
331
|
+
afterInterpolateElement(elementContainer, trueInsertBefore, // insertBefore (will be removed)
|
|
332
|
+
this, // ownerTag
|
|
379
333
|
context, options);
|
|
380
|
-
// this.clones.push(...clones)
|
|
381
334
|
// Any tag components that were found should be processed AFTER the owner processes its elements. Avoid double processing of elements attributes like (oninit)=${}
|
|
382
335
|
let isForceElement = options.forceElement;
|
|
383
336
|
tagComponents.forEach(tagComponent => {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
if (!insertBefore.parentNode) {
|
|
337
|
+
const tagSupport = tagComponent.ownerTag.tagSupport;
|
|
338
|
+
const tagGlobal = tagSupport.templater.global;
|
|
339
|
+
const placeholderElm = tagGlobal.placeholderElm; // global.placeholderElm
|
|
340
|
+
if (!placeholderElm && !insertBefore.parentNode) {
|
|
388
341
|
throw new Error('no parent building tag components');
|
|
389
342
|
}
|
|
390
|
-
|
|
391
|
-
//
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
343
|
+
const before = tagComponent.insertBefore; // insertBefore (will be removed)
|
|
344
|
+
(0,_interpolateTemplate__WEBPACK_IMPORTED_MODULE_3__.subscribeToTemplate)(before, // tagComponent.insertBefore,
|
|
345
|
+
tagComponent.subject, tagComponent.ownerTag, options.counts, { isForceElement });
|
|
346
|
+
const clones = afterInterpolateElement(elementContainer, before, // (will be removed)
|
|
347
|
+
tagComponent.ownerTag, // this, // ownerTag
|
|
348
|
+
context, options);
|
|
349
|
+
if (placeholderElm && !placeholderElm?.parentNode) {
|
|
350
|
+
const clone = clones[this.clones.length - 1];
|
|
351
|
+
if (clone) {
|
|
352
|
+
(0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_9__.restoreTagMarker)(tagComponent.ownerTag, clone);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (placeholderElm) {
|
|
356
|
+
if (placeholderElm.parentNode) {
|
|
357
|
+
if (!global.placeholderElm) {
|
|
358
|
+
global.placeholderElm = placeholderElm;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (this.clones.length) {
|
|
362
|
+
if (insertBefore.parentNode) {
|
|
363
|
+
global.placeholderElm = insertBefore.previousSibling;
|
|
364
|
+
const parentNode = insertBefore.parentNode;
|
|
365
|
+
parentNode.removeChild(insertBefore);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
395
368
|
}
|
|
396
|
-
*/
|
|
397
369
|
});
|
|
370
|
+
if (!global.placeholderElm) {
|
|
371
|
+
// const clone = getLastCloneFromTags(this)
|
|
372
|
+
// const clone = (insertBefore as Element).previousElementSibling as Element
|
|
373
|
+
const clone = insertBefore.previousSibling;
|
|
374
|
+
if (clone) {
|
|
375
|
+
const parentNode = insertBefore.parentNode;
|
|
376
|
+
global.placeholderElm = clone;
|
|
377
|
+
parentNode.removeChild(insertBefore);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
398
380
|
}
|
|
399
381
|
}
|
|
400
|
-
function afterInterpolateElement(container, insertBefore,
|
|
382
|
+
function afterInterpolateElement(container, insertBefore, tag,
|
|
401
383
|
// preClones: Clones,
|
|
402
384
|
context, options) {
|
|
403
385
|
const clones = (0,_render__WEBPACK_IMPORTED_MODULE_1__.buildClones)(container, insertBefore);
|
|
404
|
-
|
|
405
|
-
|
|
386
|
+
if (!clones.length) {
|
|
387
|
+
return clones;
|
|
388
|
+
}
|
|
389
|
+
const ownerSupport = tag.tagSupport;
|
|
390
|
+
const ownerGlobal = ownerSupport.templater.global;
|
|
391
|
+
const hadBefore = _Clones_type__WEBPACK_IMPORTED_MODULE_8__.isRemoveTemplates && ownerGlobal.placeholderElm;
|
|
392
|
+
const parentNode = hadBefore ? ownerGlobal.placeholderElm?.parentNode : insertBefore.parentNode;
|
|
393
|
+
// we could now be processing same tag but more after components being rendered
|
|
394
|
+
if (hadBefore) {
|
|
395
|
+
// 0 put the template back down
|
|
396
|
+
(0,_insertAfter_function__WEBPACK_IMPORTED_MODULE_10__.insertAfter)(insertBefore, hadBefore);
|
|
397
|
+
// ??? - removed as need for arrays
|
|
398
|
+
delete ownerGlobal.placeholderElm;
|
|
399
|
+
}
|
|
400
|
+
clones.forEach(clone => (0,_interpolateTemplate__WEBPACK_IMPORTED_MODULE_3__.afterElmBuild)(clone, options, context, tag));
|
|
401
|
+
let hasPopClone;
|
|
402
|
+
if (_Clones_type__WEBPACK_IMPORTED_MODULE_8__.isRemoveTemplates) {
|
|
403
|
+
const clone = insertBefore.previousSibling; // clones[clones.length - 1]
|
|
404
|
+
if (clone) {
|
|
405
|
+
const isTemplate = clone.tagName === 'TEMPLATE' && clone.hasAttribute('interpolate');
|
|
406
|
+
if (!isTemplate) {
|
|
407
|
+
hasPopClone = ownerGlobal.placeholderElm = clone; // insertBefore
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if (clones.find(x => x === insertBefore)) {
|
|
412
|
+
throw new Error('adding marker to owner in tag class');
|
|
413
|
+
}
|
|
414
|
+
tag.clones.push(...clones);
|
|
415
|
+
if (_Clones_type__WEBPACK_IMPORTED_MODULE_8__.isRemoveTemplates) {
|
|
416
|
+
if (hasPopClone) { // || hadBefore
|
|
417
|
+
parentNode.removeChild(insertBefore); // belongs to another tag
|
|
418
|
+
}
|
|
419
|
+
}
|
|
406
420
|
return clones;
|
|
407
421
|
}
|
|
408
422
|
function getChildTagsToDestroy(childTags, allTags = []) {
|
|
@@ -557,7 +571,8 @@ class TemplaterResult {
|
|
|
557
571
|
providers: [],
|
|
558
572
|
/** Indicator of re-rending. Saves from double rending something already rendered */
|
|
559
573
|
renderCount: 0,
|
|
560
|
-
deleted: false
|
|
574
|
+
deleted: false,
|
|
575
|
+
subscriptions: []
|
|
561
576
|
};
|
|
562
577
|
tagSupport;
|
|
563
578
|
constructor(props, children) {
|
|
@@ -592,55 +607,32 @@ function renderWithSupport(tagSupport, existingTag, subject, ownerTag) {
|
|
|
592
607
|
}
|
|
593
608
|
/* END: BEFORE RENDER */
|
|
594
609
|
const templater = wrapTagSupport.templater;
|
|
610
|
+
// NEW TAG CREATED HERE
|
|
595
611
|
const retag = templater.wrapper(wrapTagSupport, subject);
|
|
596
612
|
/* AFTER */
|
|
597
613
|
(0,_tagRunner__WEBPACK_IMPORTED_MODULE_0__.runAfterRender)(wrapTagSupport, retag);
|
|
598
614
|
const isLikeTag = !existingTag || (0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_2__.isLikeTags)(existingTag, retag);
|
|
599
615
|
if (!isLikeTag) {
|
|
600
|
-
(
|
|
601
|
-
delete templater.global.oldest;
|
|
602
|
-
delete templater.global.newest;
|
|
603
|
-
delete subject.tag;
|
|
604
|
-
templater.global.insertBefore = existingTag.tagSupport.templater.global.insertBefore;
|
|
616
|
+
destroyUnlikeTags(existingTag, templater, subject);
|
|
605
617
|
}
|
|
606
618
|
retag.ownerTag = runtimeOwnerTag;
|
|
607
619
|
wrapTagSupport.templater.global.newest = retag;
|
|
608
|
-
if (wrapTagSupport.templater.global.oldest && !wrapTagSupport.templater.global.oldest.hasLiveElements) {
|
|
609
|
-
throw new Error('56513540');
|
|
610
|
-
}
|
|
611
|
-
if (wrapTagSupport.templater.global.oldest && !wrapTagSupport.templater.global.oldest.hasLiveElements) {
|
|
612
|
-
throw new Error('5555 - 10');
|
|
613
|
-
}
|
|
614
620
|
return retag;
|
|
615
621
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "./ts/Subject.ts");
|
|
631
|
-
|
|
632
|
-
class ValueSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject {
|
|
633
|
-
value;
|
|
634
|
-
constructor(value) {
|
|
635
|
-
super(value);
|
|
636
|
-
this.value = value;
|
|
637
|
-
}
|
|
638
|
-
subscribe(callback) {
|
|
639
|
-
const unsubscribe = super.subscribe(callback);
|
|
640
|
-
// Call the callback immediately with the current value
|
|
641
|
-
callback(this.value);
|
|
642
|
-
return unsubscribe;
|
|
643
|
-
}
|
|
622
|
+
function destroyUnlikeTags(existingTag, // old
|
|
623
|
+
templater, // new
|
|
624
|
+
subject) {
|
|
625
|
+
const oldGlobal = existingTag.tagSupport.templater.global;
|
|
626
|
+
const insertBefore = oldGlobal.insertBefore;
|
|
627
|
+
(0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_3__.destroyTagMemory)(existingTag, subject);
|
|
628
|
+
// ??? - new so that when a tag is destroy the unlike does not carry the destroy signifier
|
|
629
|
+
templater.global = { ...templater.global }; // break memory references
|
|
630
|
+
const global = templater.global;
|
|
631
|
+
global.insertBefore = insertBefore;
|
|
632
|
+
global.deleted = false;
|
|
633
|
+
delete global.oldest;
|
|
634
|
+
delete global.newest;
|
|
635
|
+
delete subject.tag;
|
|
644
636
|
}
|
|
645
637
|
|
|
646
638
|
|
|
@@ -654,7 +646,8 @@ class ValueSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject {
|
|
|
654
646
|
|
|
655
647
|
__webpack_require__.r(__webpack_exports__);
|
|
656
648
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
657
|
-
/* harmony export */ alterProps: () => (/* binding */ alterProps)
|
|
649
|
+
/* harmony export */ alterProps: () => (/* binding */ alterProps),
|
|
650
|
+
/* harmony export */ callbackPropOwner: () => (/* binding */ callbackPropOwner)
|
|
658
651
|
/* harmony export */ });
|
|
659
652
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
660
653
|
/* harmony import */ var _renderTagSupport_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./renderTagSupport.function */ "./ts/renderTagSupport.function.ts");
|
|
@@ -663,17 +656,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
663
656
|
/* Used to rewrite props that are functions. When they are called it should cause parent rendering */
|
|
664
657
|
function alterProps(props, templater, ownerSupport) {
|
|
665
658
|
function callback(toCall, callWith) {
|
|
666
|
-
|
|
667
|
-
const callbackResult = toCall(...callWith);
|
|
668
|
-
if (templater.global.renderCount > renderCount) {
|
|
669
|
-
throw new Error('already rendered');
|
|
670
|
-
}
|
|
671
|
-
const lastestOwner = ownerSupport.templater.global.newest;
|
|
672
|
-
const newOwner = (0,_renderTagSupport_function__WEBPACK_IMPORTED_MODULE_1__.renderTagSupport)(lastestOwner.tagSupport, true);
|
|
673
|
-
if (newOwner.tagSupport.templater.global.newest != newOwner) {
|
|
674
|
-
throw new Error('newest assignment issue?');
|
|
675
|
-
}
|
|
676
|
-
return callbackResult;
|
|
659
|
+
return callbackPropOwner(toCall, callWith, templater, ownerSupport);
|
|
677
660
|
}
|
|
678
661
|
const isPropTag = (0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagInstance)(props);
|
|
679
662
|
const watchProps = isPropTag ? 0 : props;
|
|
@@ -694,14 +677,30 @@ function resetFunctionProps(props, callback) {
|
|
|
694
677
|
return; // already previously converted
|
|
695
678
|
}
|
|
696
679
|
newProps[name] = (...args) => {
|
|
697
|
-
return
|
|
680
|
+
return newProps[name].toCall(...args); // what gets called can switch over parent state changes
|
|
698
681
|
};
|
|
682
|
+
// Currently, call self but over parent state changes, I may need to call a newer parent tag owner
|
|
683
|
+
newProps[name].toCall = (...args) => callback(value, args);
|
|
699
684
|
newProps[name].original = value;
|
|
700
685
|
return;
|
|
701
686
|
}
|
|
702
687
|
});
|
|
703
688
|
return newProps;
|
|
704
689
|
}
|
|
690
|
+
function callbackPropOwner(toCall, callWith, templater, // only used to prevent rendering double
|
|
691
|
+
ownerSupport) {
|
|
692
|
+
const renderCount = templater.global.renderCount;
|
|
693
|
+
const callbackResult = toCall(...callWith);
|
|
694
|
+
if (templater.global.renderCount > renderCount) {
|
|
695
|
+
throw new Error('already rendered');
|
|
696
|
+
}
|
|
697
|
+
const lastestOwner = ownerSupport.templater.global.newest;
|
|
698
|
+
const newOwner = (0,_renderTagSupport_function__WEBPACK_IMPORTED_MODULE_1__.renderTagSupport)(lastestOwner.tagSupport, true);
|
|
699
|
+
if (newOwner.tagSupport.templater.global.newest != newOwner) {
|
|
700
|
+
throw new Error('newest assignment issue?');
|
|
701
|
+
}
|
|
702
|
+
return callbackResult;
|
|
703
|
+
}
|
|
705
704
|
|
|
706
705
|
|
|
707
706
|
/***/ }),
|
|
@@ -774,23 +773,31 @@ function runTagCallback(value, tag, bindTo, args) {
|
|
|
774
773
|
__webpack_require__.r(__webpack_exports__);
|
|
775
774
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
776
775
|
/* harmony export */ checkDestroyPrevious: () => (/* binding */ checkDestroyPrevious),
|
|
777
|
-
/* harmony export */ destroyArrayTag: () => (/* binding */ destroyArrayTag)
|
|
776
|
+
/* harmony export */ destroyArrayTag: () => (/* binding */ destroyArrayTag),
|
|
777
|
+
/* harmony export */ restoreTagMarker: () => (/* binding */ restoreTagMarker)
|
|
778
778
|
/* harmony export */ });
|
|
779
779
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
780
780
|
/* harmony import */ var _isLikeTags_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLikeTags.function */ "./ts/isLikeTags.function.ts");
|
|
781
781
|
/* harmony import */ var _destroyTag_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./destroyTag.function */ "./ts/destroyTag.function.ts");
|
|
782
|
+
/* harmony import */ var _Clones_type__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Clones.type */ "./ts/Clones.type.ts");
|
|
783
|
+
/* harmony import */ var _insertAfter_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./insertAfter.function */ "./ts/insertAfter.function.ts");
|
|
784
|
+
|
|
785
|
+
|
|
782
786
|
|
|
783
787
|
|
|
784
788
|
|
|
785
789
|
function checkDestroyPrevious(subject, // existing.value is the old value
|
|
786
|
-
newValue) {
|
|
787
|
-
const
|
|
788
|
-
const wasArray =
|
|
790
|
+
newValue, insertBefore) {
|
|
791
|
+
const arraySubject = subject;
|
|
792
|
+
const wasArray = arraySubject.lastArray;
|
|
789
793
|
// no longer an array
|
|
790
794
|
if (wasArray && !(0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagArray)(newValue)) {
|
|
795
|
+
const placeholderElm = arraySubject.placeholderElm;
|
|
796
|
+
delete arraySubject.lastArray;
|
|
797
|
+
delete arraySubject.placeholderElm;
|
|
798
|
+
(0,_insertAfter_function__WEBPACK_IMPORTED_MODULE_4__.insertAfter)(insertBefore, placeholderElm);
|
|
791
799
|
wasArray.forEach(({ tag }) => destroyArrayTag(tag, { added: 0, removed: 0 }));
|
|
792
|
-
|
|
793
|
-
return 1;
|
|
800
|
+
return 'array';
|
|
794
801
|
}
|
|
795
802
|
const tagSubject = subject;
|
|
796
803
|
const existingTag = tagSubject.tag;
|
|
@@ -800,7 +807,12 @@ newValue) {
|
|
|
800
807
|
const isSubjectTag = (0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagInstance)(subject.value);
|
|
801
808
|
if (isSubjectTag && isValueTag) {
|
|
802
809
|
const newTag = newValue;
|
|
810
|
+
// its a different tag now
|
|
803
811
|
if (!(0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_1__.isLikeTags)(newTag, existingTag)) {
|
|
812
|
+
// put template back down
|
|
813
|
+
if (_Clones_type__WEBPACK_IMPORTED_MODULE_3__.isRemoveTemplates) {
|
|
814
|
+
restoreTagMarker(existingTag, insertBefore);
|
|
815
|
+
}
|
|
804
816
|
(0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_2__.destroyTagMemory)(existingTag, tagSubject);
|
|
805
817
|
return 2;
|
|
806
818
|
}
|
|
@@ -810,16 +822,20 @@ newValue) {
|
|
|
810
822
|
if (isValueTagComponent) {
|
|
811
823
|
return false; // its still a tag component
|
|
812
824
|
}
|
|
825
|
+
// put template back down
|
|
826
|
+
if (_Clones_type__WEBPACK_IMPORTED_MODULE_3__.isRemoveTemplates) {
|
|
827
|
+
restoreTagMarker(existingTag, insertBefore);
|
|
828
|
+
}
|
|
813
829
|
// destroy old component, value is not a component
|
|
814
830
|
(0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_2__.destroyTagMemory)(existingTag, tagSubject);
|
|
815
|
-
return
|
|
831
|
+
return 'different-tag';
|
|
816
832
|
}
|
|
817
833
|
const displaySubject = subject;
|
|
818
834
|
const hasLastValue = 'lastValue' in displaySubject;
|
|
819
835
|
const lastValue = displaySubject.lastValue; // TODO: we maybe able to use displaySubject.value and remove concept of lastValue
|
|
820
836
|
// was simple value but now something bigger
|
|
821
837
|
if (hasLastValue && lastValue !== newValue) {
|
|
822
|
-
destroySimpleValue(
|
|
838
|
+
destroySimpleValue(insertBefore, displaySubject);
|
|
823
839
|
return 4;
|
|
824
840
|
}
|
|
825
841
|
return false;
|
|
@@ -830,15 +846,23 @@ function destroyArrayTag(tag, counts) {
|
|
|
830
846
|
stagger: counts.removed++,
|
|
831
847
|
});
|
|
832
848
|
}
|
|
833
|
-
function destroySimpleValue(
|
|
849
|
+
function destroySimpleValue(insertBefore, // always a template tag
|
|
850
|
+
subject) {
|
|
834
851
|
const clone = subject.clone;
|
|
835
852
|
const parent = clone.parentNode;
|
|
836
|
-
// put the template back down
|
|
837
|
-
parent.insertBefore(
|
|
853
|
+
// 1 put the template back down
|
|
854
|
+
parent.insertBefore(insertBefore, clone);
|
|
838
855
|
parent.removeChild(clone);
|
|
839
856
|
delete subject.clone;
|
|
840
857
|
delete subject.lastValue;
|
|
841
|
-
|
|
858
|
+
}
|
|
859
|
+
function restoreTagMarker(existingTag, insertBefore) {
|
|
860
|
+
const global = existingTag.tagSupport.templater.global;
|
|
861
|
+
const placeholderElm = global.placeholderElm;
|
|
862
|
+
if (placeholderElm) {
|
|
863
|
+
(0,_insertAfter_function__WEBPACK_IMPORTED_MODULE_4__.insertAfter)(insertBefore, placeholderElm);
|
|
864
|
+
// delete global.placeholderElm
|
|
865
|
+
}
|
|
842
866
|
}
|
|
843
867
|
|
|
844
868
|
|
|
@@ -966,16 +990,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
966
990
|
/* harmony export */ });
|
|
967
991
|
function destroyTagMemory(tag, subject) {
|
|
968
992
|
const oldTagSupport = tag.tagSupport;
|
|
969
|
-
if (subject !=
|
|
993
|
+
if (subject != oldTagSupport.subject) {
|
|
970
994
|
throw new Error('fff - subjects do not match');
|
|
971
995
|
}
|
|
972
996
|
delete subject.tag;
|
|
973
|
-
delete
|
|
997
|
+
delete oldTagSupport.subject.tag; // TODO: this line maybe not needed
|
|
974
998
|
// must destroy oldest which is tag with elements on stage
|
|
975
|
-
const oldest =
|
|
999
|
+
const oldest = oldTagSupport.templater.global.oldest;
|
|
976
1000
|
oldest.destroy();
|
|
977
1001
|
destroyTagSupportPast(oldTagSupport);
|
|
978
|
-
|
|
1002
|
+
oldTagSupport.templater.global.context = {};
|
|
979
1003
|
}
|
|
980
1004
|
function destroyTagSupportPast(oldTagSupport) {
|
|
981
1005
|
delete oldTagSupport.templater.global.oldest;
|
|
@@ -1205,9 +1229,6 @@ pastCloneProps) {
|
|
|
1205
1229
|
castedProps = { ...props };
|
|
1206
1230
|
castedPastProps = { ...(pastCloneProps || {}) };
|
|
1207
1231
|
const allFunctionsMatch = Object.entries(castedProps).every(([key, value]) => {
|
|
1208
|
-
/*if(!(key in (castedPastProps as any))) {
|
|
1209
|
-
return false
|
|
1210
|
-
}*/
|
|
1211
1232
|
let compare = castedPastProps[key];
|
|
1212
1233
|
if (!(value instanceof Function)) {
|
|
1213
1234
|
return 4; // this will be checked in deepEqual
|
|
@@ -1299,6 +1320,25 @@ function inputAttribute(name, value, element) {
|
|
|
1299
1320
|
}
|
|
1300
1321
|
|
|
1301
1322
|
|
|
1323
|
+
/***/ }),
|
|
1324
|
+
|
|
1325
|
+
/***/ "./ts/insertAfter.function.ts":
|
|
1326
|
+
/*!************************************!*\
|
|
1327
|
+
!*** ./ts/insertAfter.function.ts ***!
|
|
1328
|
+
\************************************/
|
|
1329
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1330
|
+
|
|
1331
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1332
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1333
|
+
/* harmony export */ insertAfter: () => (/* binding */ insertAfter)
|
|
1334
|
+
/* harmony export */ });
|
|
1335
|
+
// Function to insert element after reference element
|
|
1336
|
+
function insertAfter(newNode, referenceNode) {
|
|
1337
|
+
const parentNode = referenceNode.parentNode;
|
|
1338
|
+
parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
|
|
1302
1342
|
/***/ }),
|
|
1303
1343
|
|
|
1304
1344
|
/***/ "./ts/interpolateAttributes.ts":
|
|
@@ -1411,8 +1451,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1411
1451
|
|
|
1412
1452
|
|
|
1413
1453
|
/** Review elements within an element */
|
|
1414
|
-
function interpolateElement(container,
|
|
1415
|
-
|
|
1454
|
+
function interpolateElement(container, // element containing innerHTML to review interpolations
|
|
1455
|
+
context, // variables used to evaluate
|
|
1456
|
+
interpolatedTemplates, tagOwner, options) {
|
|
1416
1457
|
const clones = [];
|
|
1417
1458
|
const tagComponents = [];
|
|
1418
1459
|
const result = interpolatedTemplates.interpolation;
|
|
@@ -1454,8 +1495,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1454
1495
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1455
1496
|
/* harmony export */ afterElmBuild: () => (/* binding */ afterElmBuild),
|
|
1456
1497
|
/* harmony export */ interpolateTemplate: () => (/* binding */ interpolateTemplate),
|
|
1457
|
-
/* harmony export */ subscribeToTemplate: () => (/* binding */ subscribeToTemplate)
|
|
1458
|
-
/* harmony export */ updateBetweenTemplates: () => (/* binding */ updateBetweenTemplates)
|
|
1498
|
+
/* harmony export */ subscribeToTemplate: () => (/* binding */ subscribeToTemplate)
|
|
1459
1499
|
/* harmony export */ });
|
|
1460
1500
|
/* harmony import */ var _Tag_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Tag.class */ "./ts/Tag.class.ts");
|
|
1461
1501
|
/* harmony import */ var _elementInitCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elementInitCheck */ "./ts/elementInitCheck.ts");
|
|
@@ -1506,10 +1546,12 @@ function subscribeToTemplate(insertBefore, subject, ownerTag, counts, // used fo
|
|
|
1506
1546
|
let called = false;
|
|
1507
1547
|
const callback = (value) => {
|
|
1508
1548
|
// const orgInsert = insertBefore
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1549
|
+
/*
|
|
1550
|
+
const clone = (subject as DisplaySubject).clone
|
|
1551
|
+
if(clone && clone.parentNode) {
|
|
1552
|
+
insertBefore = clone
|
|
1512
1553
|
}
|
|
1554
|
+
*/
|
|
1513
1555
|
if (called) {
|
|
1514
1556
|
(0,_updateExistingValue_function__WEBPACK_IMPORTED_MODULE_5__.updateExistingValue)(subject, value, ownerTag, insertBefore);
|
|
1515
1557
|
return;
|
|
@@ -1527,21 +1569,7 @@ function subscribeToTemplate(insertBefore, subject, ownerTag, counts, // used fo
|
|
|
1527
1569
|
called = true;
|
|
1528
1570
|
};
|
|
1529
1571
|
const sub = subject.subscribe(callback);
|
|
1530
|
-
ownerTag.
|
|
1531
|
-
}
|
|
1532
|
-
// Function to update the value of x
|
|
1533
|
-
function updateBetweenTemplates(value, lastFirstChild) {
|
|
1534
|
-
const parent = lastFirstChild.parentNode;
|
|
1535
|
-
// mimic React skipping to display EXCEPT for true does display on page
|
|
1536
|
-
if (value === undefined || value === false || value === null) { // || value === true
|
|
1537
|
-
value = '';
|
|
1538
|
-
}
|
|
1539
|
-
// Insert the new value (never use innerHTML here)
|
|
1540
|
-
const textNode = document.createTextNode(value); // never innerHTML
|
|
1541
|
-
parent.insertBefore(textNode, lastFirstChild);
|
|
1542
|
-
/* remove existing nodes */
|
|
1543
|
-
parent.removeChild(lastFirstChild);
|
|
1544
|
-
return textNode;
|
|
1572
|
+
ownerTag.tagSupport.templater.global.subscriptions.push(sub);
|
|
1545
1573
|
}
|
|
1546
1574
|
function afterElmBuild(elm, options, context, ownerTag) {
|
|
1547
1575
|
if (!elm.getAttribute) {
|
|
@@ -1554,12 +1582,6 @@ function afterElmBuild(elm, options, context, ownerTag) {
|
|
|
1554
1582
|
let diff = options.counts.added;
|
|
1555
1583
|
diff = (0,_elementInitCheck__WEBPACK_IMPORTED_MODULE_1__.elementInitCheck)(elm, options.counts) - diff;
|
|
1556
1584
|
if (elm.children) {
|
|
1557
|
-
/*
|
|
1558
|
-
const subCounts = {
|
|
1559
|
-
added: options.counts.added, // - diff,
|
|
1560
|
-
removed: options.counts.removed,
|
|
1561
|
-
}
|
|
1562
|
-
*/
|
|
1563
1585
|
new Array(...elm.children).forEach((child, index) => {
|
|
1564
1586
|
const subOptions = {
|
|
1565
1587
|
...options,
|
|
@@ -1596,8 +1618,9 @@ function interpolateToTemplates(template) {
|
|
|
1596
1618
|
}
|
|
1597
1619
|
const noBraces = expression.substring(1, expression.length - 1);
|
|
1598
1620
|
const id = noBraces;
|
|
1621
|
+
const name = 'template-' + template.length;
|
|
1599
1622
|
keys.push(id);
|
|
1600
|
-
return `<template interpolate end id="${id}"></template>`;
|
|
1623
|
+
return `<template interpolate end id="${id}" name="${name}"></template>`;
|
|
1601
1624
|
});
|
|
1602
1625
|
return { string, keys };
|
|
1603
1626
|
}
|
|
@@ -1772,7 +1795,7 @@ function processAttribute(attrName, value, child, scope, ownerTag, howToSet) {
|
|
|
1772
1795
|
processNameOnlyAttr(value, lastValue, child, ownerTag, howToSet);
|
|
1773
1796
|
lastValue = value;
|
|
1774
1797
|
});
|
|
1775
|
-
ownerTag.
|
|
1798
|
+
ownerTag.tagSupport.templater.global.subscriptions.push(sub); // this is where unsubscribe is picked up
|
|
1776
1799
|
child.removeAttribute(attrName);
|
|
1777
1800
|
return;
|
|
1778
1801
|
}
|
|
@@ -1836,7 +1859,7 @@ function processNameValueAttr(attrName, result, child, ownerTag, howToSet) {
|
|
|
1836
1859
|
// 🗞️ Subscribe. Above callback called immediately since its a ValueSubject()
|
|
1837
1860
|
const sub = result.subscribe(callback);
|
|
1838
1861
|
// Record subscription for later unsubscribe when element destroyed
|
|
1839
|
-
ownerTag.
|
|
1862
|
+
ownerTag.tagSupport.templater.global.subscriptions.push(sub);
|
|
1840
1863
|
return;
|
|
1841
1864
|
}
|
|
1842
1865
|
howToSet(child, attrName, result);
|
|
@@ -1861,7 +1884,7 @@ function processAttributeSubjectValue(newAttrValue, child, attrName, isSpecial,
|
|
|
1861
1884
|
howToSet(child, attrName, newAttrValue);
|
|
1862
1885
|
return;
|
|
1863
1886
|
}
|
|
1864
|
-
const isDeadValue =
|
|
1887
|
+
const isDeadValue = [undefined, false, null].includes(newAttrValue);
|
|
1865
1888
|
if (isDeadValue) {
|
|
1866
1889
|
child.removeAttribute(attrName);
|
|
1867
1890
|
return;
|
|
@@ -1887,18 +1910,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1887
1910
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1888
1911
|
/* harmony export */ processNewValue: () => (/* binding */ processNewValue)
|
|
1889
1912
|
/* harmony export */ });
|
|
1890
|
-
/* harmony import */ var
|
|
1913
|
+
/* harmony import */ var _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subject/ValueSubject */ "./ts/subject/ValueSubject.ts");
|
|
1891
1914
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
1892
1915
|
|
|
1893
1916
|
|
|
1894
1917
|
function processNewValue(hasValue, value, ownerTag) {
|
|
1895
1918
|
if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagComponent)(value)) {
|
|
1896
|
-
const tagSubject = new
|
|
1919
|
+
const tagSubject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
|
|
1897
1920
|
return tagSubject;
|
|
1898
1921
|
}
|
|
1899
1922
|
if (value instanceof Function) {
|
|
1900
1923
|
// return getSubjectFunction(value, ownerTag)
|
|
1901
|
-
return new
|
|
1924
|
+
return new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
|
|
1902
1925
|
}
|
|
1903
1926
|
if (!hasValue) {
|
|
1904
1927
|
return; // more strings than values, stop here
|
|
@@ -1908,12 +1931,12 @@ function processNewValue(hasValue, value, ownerTag) {
|
|
|
1908
1931
|
if (ownerTag.childTags.find(x => x === value)) {
|
|
1909
1932
|
throw new Error('about to reattach tag already present - 2');
|
|
1910
1933
|
}
|
|
1911
|
-
return new
|
|
1934
|
+
return new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
|
|
1912
1935
|
}
|
|
1913
1936
|
if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isSubjectInstance)(value)) {
|
|
1914
1937
|
return value; // its already a value subject
|
|
1915
1938
|
}
|
|
1916
|
-
return new
|
|
1939
|
+
return new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
|
|
1917
1940
|
}
|
|
1918
1941
|
|
|
1919
1942
|
|
|
@@ -1929,18 +1952,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1929
1952
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1930
1953
|
/* harmony export */ processRegularValue: () => (/* binding */ processRegularValue)
|
|
1931
1954
|
/* harmony export */ });
|
|
1932
|
-
/* harmony import */ var
|
|
1955
|
+
/* harmony import */ var _updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./updateBeforeTemplate.function */ "./ts/updateBeforeTemplate.function.ts");
|
|
1933
1956
|
|
|
1934
1957
|
function processRegularValue(value, subject, // could be tag via subject.tag
|
|
1935
|
-
|
|
1936
|
-
subject.
|
|
1937
|
-
const before = subject.clone ||
|
|
1938
|
-
|
|
1958
|
+
insertBefore) {
|
|
1959
|
+
subject.insertBefore = insertBefore;
|
|
1960
|
+
const before = subject.clone || insertBefore; // Either the template is on the doc OR its the first element we last put on doc
|
|
1961
|
+
// matches but also was defined at some point
|
|
1962
|
+
if (subject.lastValue === value && 'lastValue' in subject) {
|
|
1939
1963
|
return; // no need to update display, its the same
|
|
1940
1964
|
}
|
|
1941
1965
|
subject.lastValue = value;
|
|
1942
1966
|
// Processing of regular values
|
|
1943
|
-
const clone = (0,
|
|
1967
|
+
const clone = (0,_updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__.updateBeforeTemplate)(value, before);
|
|
1944
1968
|
subject.clone = clone; // remember single element put down, for future updates
|
|
1945
1969
|
}
|
|
1946
1970
|
|
|
@@ -1965,7 +1989,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1965
1989
|
|
|
1966
1990
|
|
|
1967
1991
|
|
|
1968
|
-
function processSubjectComponent(templater, subject,
|
|
1992
|
+
function processSubjectComponent(templater, subject, insertBefore, ownerTag, options) {
|
|
1969
1993
|
// Check if function component is wrapped in a tag() call
|
|
1970
1994
|
// TODO: This below check not needed in production mode
|
|
1971
1995
|
if (templater.tagged !== true) {
|
|
@@ -1980,31 +2004,39 @@ function processSubjectComponent(templater, subject, template, ownerTag, options
|
|
|
1980
2004
|
}
|
|
1981
2005
|
templater.tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_3__.TagSupport(ownerTag.tagSupport, templater, subject);
|
|
1982
2006
|
// templater.oldest = subject.tag?.tagSupport.oldest || templater.oldest
|
|
1983
|
-
templater.global.insertBefore =
|
|
2007
|
+
templater.global.insertBefore = insertBefore;
|
|
1984
2008
|
let retag = subject.tag;
|
|
1985
2009
|
const providers = _setUse_function__WEBPACK_IMPORTED_MODULE_1__.setUse.memory.providerConfig;
|
|
1986
2010
|
providers.ownerTag = ownerTag;
|
|
1987
2011
|
const isRedraw = !retag || options.forceElement;
|
|
1988
2012
|
if (isRedraw) {
|
|
1989
|
-
|
|
1990
|
-
retag = (0,_TemplaterResult_class__WEBPACK_IMPORTED_MODULE_0__.renderWithSupport)(templater.tagSupport, subject.tag, // existing tag
|
|
1991
|
-
subject, ownerTag);
|
|
1992
|
-
if (retag.tagSupport.templater.global.newest != retag) {
|
|
1993
|
-
throw new Error('mismatch result newest');
|
|
1994
|
-
}
|
|
1995
|
-
templater.global.newest = retag;
|
|
1996
|
-
if (ownerTag.clones.length > preClones.length) {
|
|
1997
|
-
const myClones = ownerTag.clones.filter(fClone => !preClones.find(clone => clone === fClone));
|
|
1998
|
-
retag.clones.push(...myClones);
|
|
1999
|
-
}
|
|
2000
|
-
if (ownerTag.childTags.find(x => x === retag)) {
|
|
2001
|
-
throw new Error('about to reattach tag already present');
|
|
2002
|
-
}
|
|
2003
|
-
ownerTag.childTags.push(retag);
|
|
2013
|
+
retag = redrawSubjectComponent(templater, subject, retag, ownerTag, insertBefore);
|
|
2004
2014
|
}
|
|
2005
2015
|
(0,_processTagResult_function__WEBPACK_IMPORTED_MODULE_2__.processTagResult)(retag, subject, // The element set here will be removed from document. Also result.tag will be added in here
|
|
2006
|
-
|
|
2016
|
+
insertBefore, // <template end interpolate /> (will be removed)
|
|
2007
2017
|
options);
|
|
2018
|
+
return retag;
|
|
2019
|
+
}
|
|
2020
|
+
function redrawSubjectComponent(templater, subject, retag, ownerTag, insertBefore) {
|
|
2021
|
+
const preClones = ownerTag.clones.map(clone => clone);
|
|
2022
|
+
retag = (0,_TemplaterResult_class__WEBPACK_IMPORTED_MODULE_0__.renderWithSupport)(templater.tagSupport, subject.tag, // existing tag
|
|
2023
|
+
subject, ownerTag);
|
|
2024
|
+
if (retag.tagSupport.templater.global.newest != retag) {
|
|
2025
|
+
throw new Error('mismatch result newest');
|
|
2026
|
+
}
|
|
2027
|
+
templater.global.newest = retag;
|
|
2028
|
+
if (ownerTag.clones.length > preClones.length) {
|
|
2029
|
+
const myClones = ownerTag.clones.filter(fClone => !preClones.find(clone => clone === fClone));
|
|
2030
|
+
retag.clones.push(...myClones);
|
|
2031
|
+
if (myClones.find(x => x === insertBefore)) {
|
|
2032
|
+
throw new Error('way back here we add marker');
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
if (ownerTag.childTags.find(x => x === retag)) {
|
|
2036
|
+
throw new Error('about to reattach tag already present');
|
|
2037
|
+
}
|
|
2038
|
+
ownerTag.childTags.push(retag);
|
|
2039
|
+
return retag;
|
|
2008
2040
|
}
|
|
2009
2041
|
|
|
2010
2042
|
|
|
@@ -2018,17 +2050,13 @@ function processSubjectComponent(templater, subject, template, ownerTag, options
|
|
|
2018
2050
|
|
|
2019
2051
|
__webpack_require__.r(__webpack_exports__);
|
|
2020
2052
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2021
|
-
/* harmony export */
|
|
2022
|
-
/* harmony export */ processSubjectValue: () => (/* binding */ processSubjectValue),
|
|
2023
|
-
/* harmony export */ processTag: () => (/* binding */ processTag)
|
|
2053
|
+
/* harmony export */ processSubjectValue: () => (/* binding */ processSubjectValue)
|
|
2024
2054
|
/* harmony export */ });
|
|
2025
2055
|
/* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/processSubjectComponent.function.ts");
|
|
2026
2056
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
2027
2057
|
/* harmony import */ var _processTagArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./processTagArray */ "./ts/processTagArray.ts");
|
|
2028
|
-
/* harmony import */ var
|
|
2029
|
-
/* harmony import */ var
|
|
2030
|
-
/* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/processRegularValue.function.ts");
|
|
2031
|
-
|
|
2058
|
+
/* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/processRegularValue.function.ts");
|
|
2059
|
+
/* harmony import */ var _processTag_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processTag.function */ "./ts/processTag.function.ts");
|
|
2032
2060
|
|
|
2033
2061
|
|
|
2034
2062
|
|
|
@@ -2054,29 +2082,49 @@ function getValueType(value) {
|
|
|
2054
2082
|
return ValueTypes.value;
|
|
2055
2083
|
}
|
|
2056
2084
|
function processSubjectValue(value, subject, // could be tag via result.tag
|
|
2057
|
-
|
|
2085
|
+
insertBefore, // <template end interpolate /> (will be removed)
|
|
2058
2086
|
ownerTag, // owner
|
|
2059
2087
|
options) {
|
|
2060
2088
|
const valueType = getValueType(value);
|
|
2061
2089
|
switch (valueType) {
|
|
2062
2090
|
case ValueTypes.tag:
|
|
2063
|
-
processTag(value, subject,
|
|
2091
|
+
(0,_processTag_function__WEBPACK_IMPORTED_MODULE_4__.processTag)(value, subject, insertBefore, ownerTag);
|
|
2064
2092
|
return;
|
|
2065
2093
|
case ValueTypes.tagArray:
|
|
2066
|
-
return (0,_processTagArray__WEBPACK_IMPORTED_MODULE_2__.processTagArray)(subject, value,
|
|
2094
|
+
return (0,_processTagArray__WEBPACK_IMPORTED_MODULE_2__.processTagArray)(subject, value, insertBefore, ownerTag, options);
|
|
2067
2095
|
case ValueTypes.tagComponent:
|
|
2068
|
-
(0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__.processSubjectComponent)(value, subject,
|
|
2096
|
+
(0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__.processSubjectComponent)(value, subject, insertBefore, ownerTag, options);
|
|
2069
2097
|
return;
|
|
2070
2098
|
}
|
|
2071
|
-
(0,
|
|
2099
|
+
(0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_3__.processRegularValue)(value, subject, insertBefore);
|
|
2072
2100
|
}
|
|
2101
|
+
|
|
2102
|
+
|
|
2103
|
+
/***/ }),
|
|
2104
|
+
|
|
2105
|
+
/***/ "./ts/processTag.function.ts":
|
|
2106
|
+
/*!***********************************!*\
|
|
2107
|
+
!*** ./ts/processTag.function.ts ***!
|
|
2108
|
+
\***********************************/
|
|
2109
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2110
|
+
|
|
2111
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2112
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2113
|
+
/* harmony export */ applyFakeTemplater: () => (/* binding */ applyFakeTemplater),
|
|
2114
|
+
/* harmony export */ processTag: () => (/* binding */ processTag)
|
|
2115
|
+
/* harmony export */ });
|
|
2116
|
+
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
2117
|
+
/* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TagSupport.class */ "./ts/TagSupport.class.ts");
|
|
2118
|
+
/* harmony import */ var _subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subject */ "./ts/subject/index.ts");
|
|
2119
|
+
|
|
2120
|
+
|
|
2121
|
+
|
|
2073
2122
|
/** Could be a regular tag or a component. Both are Tag.class */
|
|
2074
2123
|
function processTag(tag, subject, // could be tag via result.tag
|
|
2075
|
-
insertBefore,
|
|
2076
|
-
ownerTag) {
|
|
2124
|
+
insertBefore, ownerTag) {
|
|
2077
2125
|
// first time seeing this tag?
|
|
2078
2126
|
if (!tag.tagSupport) {
|
|
2079
|
-
if (!(0,
|
|
2127
|
+
if (!(0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagInstance)(tag)) {
|
|
2080
2128
|
throw new Error('issue non-tag here');
|
|
2081
2129
|
}
|
|
2082
2130
|
applyFakeTemplater(tag, ownerTag, subject);
|
|
@@ -2086,10 +2134,12 @@ ownerTag) {
|
|
|
2086
2134
|
ownerTag.childTags.push(tag);
|
|
2087
2135
|
}
|
|
2088
2136
|
tag.ownerTag = ownerTag;
|
|
2089
|
-
|
|
2137
|
+
if (insertBefore.tagName !== 'TEMPLATE') {
|
|
2138
|
+
throw new Error(`;;;; - ${insertBefore.nodeName}`);
|
|
2139
|
+
}
|
|
2090
2140
|
tag.buildBeforeElement(insertBefore, {
|
|
2091
2141
|
counts: { added: 0, removed: 0 },
|
|
2092
|
-
forceElement: true,
|
|
2142
|
+
forceElement: true,
|
|
2093
2143
|
});
|
|
2094
2144
|
}
|
|
2095
2145
|
function applyFakeTemplater(tag, ownerTag, subject) {
|
|
@@ -2097,7 +2147,7 @@ function applyFakeTemplater(tag, ownerTag, subject) {
|
|
|
2097
2147
|
throw new Error('no owner error');
|
|
2098
2148
|
}
|
|
2099
2149
|
const fakeTemplater = getFakeTemplater();
|
|
2100
|
-
tag.tagSupport = new
|
|
2150
|
+
tag.tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_1__.TagSupport(ownerTag.tagSupport, fakeTemplater, // the template is provided via html`` call
|
|
2101
2151
|
subject);
|
|
2102
2152
|
fakeTemplater.global.oldest = tag;
|
|
2103
2153
|
fakeTemplater.global.newest = tag;
|
|
@@ -2111,10 +2161,17 @@ function getFakeTemplater() {
|
|
|
2111
2161
|
renderCount: 0,
|
|
2112
2162
|
providers: [],
|
|
2113
2163
|
context: {},
|
|
2164
|
+
subscriptions: [],
|
|
2165
|
+
deleted: false,
|
|
2166
|
+
newestTemplater: {},
|
|
2114
2167
|
},
|
|
2115
|
-
children: new
|
|
2168
|
+
children: new _subject__WEBPACK_IMPORTED_MODULE_2__.ValueSubject([]), // no children
|
|
2116
2169
|
props: {},
|
|
2117
2170
|
isTag: true,
|
|
2171
|
+
isTemplater: false,
|
|
2172
|
+
tagged: false,
|
|
2173
|
+
wrapper: (() => undefined),
|
|
2174
|
+
tagSupport: {},
|
|
2118
2175
|
};
|
|
2119
2176
|
}
|
|
2120
2177
|
|
|
@@ -2131,20 +2188,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2131
2188
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2132
2189
|
/* harmony export */ processTagArray: () => (/* binding */ processTagArray)
|
|
2133
2190
|
/* harmony export */ });
|
|
2134
|
-
/* harmony import */ var
|
|
2191
|
+
/* harmony import */ var _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subject/ValueSubject */ "./ts/subject/ValueSubject.ts");
|
|
2135
2192
|
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors */ "./ts/errors.ts");
|
|
2136
2193
|
/* harmony import */ var _checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./checkDestroyPrevious.function */ "./ts/checkDestroyPrevious.function.ts");
|
|
2137
|
-
/* harmony import */ var
|
|
2194
|
+
/* harmony import */ var _processTag_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processTag.function */ "./ts/processTag.function.ts");
|
|
2195
|
+
/* harmony import */ var _insertAfter_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./insertAfter.function */ "./ts/insertAfter.function.ts");
|
|
2196
|
+
|
|
2138
2197
|
|
|
2139
2198
|
|
|
2140
2199
|
|
|
2141
2200
|
|
|
2142
2201
|
function processTagArray(subject, value, // arry of Tag classes
|
|
2143
|
-
|
|
2202
|
+
insertBefore, // <template end interpolate />
|
|
2144
2203
|
ownerTag, options) {
|
|
2145
2204
|
const clones = ownerTag.clones; // []
|
|
2146
2205
|
let lastArray = subject.lastArray = subject.lastArray || [];
|
|
2147
|
-
subject.
|
|
2206
|
+
if (subject.placeholderElm) {
|
|
2207
|
+
const parentPlaceholder = subject.parentAsPlaceholder;
|
|
2208
|
+
if (parentPlaceholder) {
|
|
2209
|
+
parentPlaceholder.appendChild(insertBefore);
|
|
2210
|
+
delete subject.placeholderElm;
|
|
2211
|
+
}
|
|
2212
|
+
else {
|
|
2213
|
+
(0,_insertAfter_function__WEBPACK_IMPORTED_MODULE_4__.insertAfter)(insertBefore, subject.placeholderElm);
|
|
2214
|
+
}
|
|
2215
|
+
delete subject.placeholderElm;
|
|
2216
|
+
}
|
|
2148
2217
|
let removed = 0;
|
|
2149
2218
|
/** 🗑️ remove previous items first */
|
|
2150
2219
|
lastArray = subject.lastArray = subject.lastArray.filter((item, index) => {
|
|
@@ -2152,8 +2221,9 @@ ownerTag, options) {
|
|
|
2152
2221
|
const at = index - removed;
|
|
2153
2222
|
const lessLength = newLength < at;
|
|
2154
2223
|
const subTag = value[index - removed];
|
|
2155
|
-
const subArrayValue = subTag?.arrayValue;
|
|
2156
|
-
const
|
|
2224
|
+
const subArrayValue = subTag?.memory.arrayValue;
|
|
2225
|
+
const tag = item.tag;
|
|
2226
|
+
const destroyItem = lessLength || !areLikeValues(subArrayValue, tag.memory.arrayValue);
|
|
2157
2227
|
if (destroyItem) {
|
|
2158
2228
|
const last = lastArray[index];
|
|
2159
2229
|
const tag = last.tag;
|
|
@@ -2166,19 +2236,19 @@ ownerTag, options) {
|
|
|
2166
2236
|
return true;
|
|
2167
2237
|
});
|
|
2168
2238
|
// const masterBefore = template || (template as any).clone
|
|
2169
|
-
const before =
|
|
2239
|
+
const before = insertBefore; // || (subject.value as any).insertBefore || (insertBefore as any).clone
|
|
2170
2240
|
value.forEach((subTag, index) => {
|
|
2171
2241
|
const previous = lastArray[index];
|
|
2172
2242
|
const previousSupport = previous?.tag.tagSupport;
|
|
2173
|
-
const fakeSubject = new
|
|
2174
|
-
(0,
|
|
2243
|
+
const fakeSubject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject({});
|
|
2244
|
+
(0,_processTag_function__WEBPACK_IMPORTED_MODULE_3__.applyFakeTemplater)(subTag, ownerTag, fakeSubject);
|
|
2175
2245
|
if (previousSupport) {
|
|
2176
2246
|
subTag.tagSupport.templater.global = previousSupport.templater.global;
|
|
2177
2247
|
previousSupport.templater.global.newest = subTag;
|
|
2178
2248
|
}
|
|
2179
2249
|
// check for html``.key()
|
|
2180
|
-
const
|
|
2181
|
-
if (
|
|
2250
|
+
const keySet = 'arrayValue' in subTag.memory;
|
|
2251
|
+
if (!keySet) {
|
|
2182
2252
|
const details = {
|
|
2183
2253
|
template: subTag.getTemplate().string,
|
|
2184
2254
|
array: value,
|
|
@@ -2191,23 +2261,46 @@ ownerTag, options) {
|
|
|
2191
2261
|
}
|
|
2192
2262
|
const couldBeSame = lastArray.length > index;
|
|
2193
2263
|
if (couldBeSame) {
|
|
2194
|
-
const
|
|
2264
|
+
const prevSupport = previous.tag.tagSupport;
|
|
2265
|
+
const prevGlobal = prevSupport.templater.global;
|
|
2266
|
+
const isSame = areLikeValues(previous.tag.memory.arrayValue, subTag.memory.arrayValue);
|
|
2195
2267
|
if (isSame) {
|
|
2196
|
-
subTag.tagSupport = subTag.tagSupport ||
|
|
2197
|
-
const oldest =
|
|
2268
|
+
subTag.tagSupport = subTag.tagSupport || prevSupport;
|
|
2269
|
+
const oldest = prevGlobal.oldest;
|
|
2198
2270
|
oldest.updateByTag(subTag);
|
|
2199
2271
|
return [];
|
|
2200
2272
|
}
|
|
2201
|
-
|
|
2273
|
+
// TODO: should not get here?
|
|
2274
|
+
processAddTagArrayItem(before, subTag, index, options, lastArray);
|
|
2202
2275
|
throw new Error('item should be back');
|
|
2203
2276
|
// return [] // removed: item should have been previously deleted and will be added back
|
|
2204
2277
|
}
|
|
2205
|
-
processAddTagArrayItem(before, subTag, index, options, lastArray
|
|
2278
|
+
processAddTagArrayItem(before, subTag, index, options, lastArray);
|
|
2206
2279
|
ownerTag.childTags.push(subTag);
|
|
2207
2280
|
});
|
|
2281
|
+
if (value.length) {
|
|
2282
|
+
const lastClone = insertBefore.previousSibling;
|
|
2283
|
+
setPlaceholderElm(lastClone, insertBefore, subject);
|
|
2284
|
+
}
|
|
2285
|
+
else {
|
|
2286
|
+
const placeholderElm = insertBefore.previousSibling;
|
|
2287
|
+
if (placeholderElm) {
|
|
2288
|
+
setPlaceholderElm(placeholderElm, insertBefore, subject);
|
|
2289
|
+
}
|
|
2290
|
+
else {
|
|
2291
|
+
const parentNode = insertBefore.parentNode;
|
|
2292
|
+
setPlaceholderElm(parentNode, insertBefore, subject);
|
|
2293
|
+
subject.parentAsPlaceholder = parentNode;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2208
2296
|
return clones;
|
|
2209
2297
|
}
|
|
2210
|
-
function
|
|
2298
|
+
function setPlaceholderElm(lastClone, insertBefore, subject) {
|
|
2299
|
+
subject.placeholderElm = lastClone;
|
|
2300
|
+
const parentNode = insertBefore.parentNode;
|
|
2301
|
+
parentNode.removeChild(insertBefore);
|
|
2302
|
+
}
|
|
2303
|
+
function processAddTagArrayItem(before, subTag, index, options, lastArray) {
|
|
2211
2304
|
const lastValue = {
|
|
2212
2305
|
tag: subTag, index
|
|
2213
2306
|
};
|
|
@@ -2217,11 +2310,13 @@ function processAddTagArrayItem(before, subTag, index, options, lastArray, test)
|
|
|
2217
2310
|
added: options.counts.added + index,
|
|
2218
2311
|
removed: options.counts.removed,
|
|
2219
2312
|
};
|
|
2220
|
-
|
|
2221
|
-
if (!lastFirstChild.parentNode) {
|
|
2313
|
+
if (!before.parentNode) {
|
|
2222
2314
|
throw new Error('issue adding array item');
|
|
2223
2315
|
}
|
|
2224
|
-
|
|
2316
|
+
const newTempElm = document.createElement('template');
|
|
2317
|
+
before.parentNode.insertBefore(newTempElm, before);
|
|
2318
|
+
subTag.buildBeforeElement(newTempElm, // before,
|
|
2319
|
+
{ counts, forceElement: options.forceElement });
|
|
2225
2320
|
}
|
|
2226
2321
|
/** compare two values. If both values are arrays then the items will be compared */
|
|
2227
2322
|
function areLikeValues(valueA, valueB) {
|
|
@@ -2249,8 +2344,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2249
2344
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2250
2345
|
/* harmony export */ processTagResult: () => (/* binding */ processTagResult)
|
|
2251
2346
|
/* harmony export */ });
|
|
2252
|
-
/* harmony import */ var _destroyTag_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./destroyTag.function */ "./ts/destroyTag.function.ts");
|
|
2253
|
-
|
|
2254
2347
|
function processTagResult(tag, subject, // used for recording past and current value
|
|
2255
2348
|
insertBefore, // <template end interpolate />
|
|
2256
2349
|
{ counts, forceElement, }) {
|
|
@@ -2262,43 +2355,38 @@ insertBefore, // <template end interpolate />
|
|
|
2262
2355
|
const existingTag = subjectTag.tag;
|
|
2263
2356
|
const previousTag = existingTag?.tagSupport.templater.global.oldest || undefined; // || tag.tagSupport.oldest // subjectTag.tag
|
|
2264
2357
|
const justUpdate = previousTag; // && !forceElement
|
|
2265
|
-
if (previousTag) {
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
const newTag = subject(previousTag.tagSupport);
|
|
2273
|
-
previousTag.updateByTag(newTag);
|
|
2274
|
-
if (!newTag.tagSupport.templater.global.oldest) {
|
|
2275
|
-
throw new Error('maybe 0');
|
|
2276
|
-
}
|
|
2277
|
-
subjectTag.tag = newTag;
|
|
2278
|
-
if (!newTag.hasLiveElements) {
|
|
2279
|
-
throw new Error('44444 - 2');
|
|
2280
|
-
}
|
|
2281
|
-
return;
|
|
2282
|
-
}
|
|
2283
|
-
previousTag.updateByTag(tag);
|
|
2284
|
-
if (!tag.tagSupport.templater.global.oldest) {
|
|
2285
|
-
throw new Error('maybe 1');
|
|
2286
|
-
}
|
|
2287
|
-
subjectTag.tag = tag;
|
|
2288
|
-
if (!tag.hasLiveElements) {
|
|
2289
|
-
throw new Error('44444 - 3');
|
|
2290
|
-
}
|
|
2291
|
-
return;
|
|
2292
|
-
}
|
|
2293
|
-
(0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_0__.destroyTagMemory)(previousTag, subject);
|
|
2294
|
-
throw new Error('585 - think we never get here');
|
|
2358
|
+
if (previousTag && justUpdate) {
|
|
2359
|
+
/*
|
|
2360
|
+
const areLike = previousTag.isLikeTag(tag)
|
|
2361
|
+
|
|
2362
|
+
// are we just updating an if we already had?
|
|
2363
|
+
if(areLike) {
|
|
2364
|
+
return processTagResultUpdate(tag, subjectTag, previousTag)
|
|
2295
2365
|
}
|
|
2366
|
+
*/
|
|
2367
|
+
return processTagResultUpdate(tag, subjectTag, previousTag);
|
|
2368
|
+
}
|
|
2369
|
+
if (insertBefore.nodeName !== 'TEMPLATE') {
|
|
2370
|
+
throw new Error(';;;;');
|
|
2296
2371
|
}
|
|
2297
2372
|
tag.buildBeforeElement(insertBefore, {
|
|
2298
2373
|
counts,
|
|
2299
|
-
forceElement,
|
|
2374
|
+
forceElement,
|
|
2300
2375
|
});
|
|
2301
2376
|
}
|
|
2377
|
+
function processTagResultUpdate(tag, subject, // used for recording past and current value
|
|
2378
|
+
previousTag) {
|
|
2379
|
+
// components
|
|
2380
|
+
if (subject instanceof Function) {
|
|
2381
|
+
const newTag = subject(previousTag.tagSupport);
|
|
2382
|
+
previousTag.updateByTag(newTag);
|
|
2383
|
+
subject.tag = newTag;
|
|
2384
|
+
return;
|
|
2385
|
+
}
|
|
2386
|
+
previousTag.updateByTag(tag);
|
|
2387
|
+
subject.tag = tag;
|
|
2388
|
+
return;
|
|
2389
|
+
}
|
|
2302
2390
|
|
|
2303
2391
|
|
|
2304
2392
|
/***/ }),
|
|
@@ -2513,7 +2601,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2513
2601
|
/** Returns true when rendering owner is not needed. Returns false when rendering owner should occur */
|
|
2514
2602
|
function renderExistingTag(oldestTag, // existing tag already there
|
|
2515
2603
|
newTemplater, tagSupport, subject) {
|
|
2516
|
-
|
|
2604
|
+
const tag = subject.tag;
|
|
2605
|
+
newTemplater.global = tag.tagSupport.templater.global;
|
|
2517
2606
|
if (!oldestTag.hasLiveElements) {
|
|
2518
2607
|
throw new Error('1080 - should have live elements');
|
|
2519
2608
|
}
|
|
@@ -2526,8 +2615,8 @@ newTemplater, tagSupport, subject) {
|
|
|
2526
2615
|
return latestTag;
|
|
2527
2616
|
}
|
|
2528
2617
|
const oldTemplater = tagSupport.templater || newTemplater;
|
|
2529
|
-
const
|
|
2530
|
-
subject, oldestTag.ownerTag);
|
|
2618
|
+
const toRedrawTag = subject.tag || oldTemplater.global.newest || oldTemplater.global.oldest; // hmmmmmm, why not newest?
|
|
2619
|
+
const redraw = (0,_TemplaterResult_class__WEBPACK_IMPORTED_MODULE_1__.renderWithSupport)(newTemplater.tagSupport, toRedrawTag, subject, oldestTag.ownerTag);
|
|
2531
2620
|
const oldest = tagSupport.templater.global.oldest || oldestTag;
|
|
2532
2621
|
redraw.tagSupport.templater.global.oldest = oldest;
|
|
2533
2622
|
if ((0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_2__.isLikeTags)(latestTag, redraw)) {
|
|
@@ -2895,6 +2984,263 @@ setUse.tagUse = tagUse;
|
|
|
2895
2984
|
setUse.memory = {};
|
|
2896
2985
|
|
|
2897
2986
|
|
|
2987
|
+
/***/ }),
|
|
2988
|
+
|
|
2989
|
+
/***/ "./ts/subject/Subject.class.ts":
|
|
2990
|
+
/*!*************************************!*\
|
|
2991
|
+
!*** ./ts/subject/Subject.class.ts ***!
|
|
2992
|
+
\*************************************/
|
|
2993
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2994
|
+
|
|
2995
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2996
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2997
|
+
/* harmony export */ Subject: () => (/* binding */ Subject)
|
|
2998
|
+
/* harmony export */ });
|
|
2999
|
+
class Subject {
|
|
3000
|
+
value;
|
|
3001
|
+
methods = [];
|
|
3002
|
+
isSubject = true;
|
|
3003
|
+
subscribers = [];
|
|
3004
|
+
subscribeWith;
|
|
3005
|
+
// unsubcount = 0 // 🔬 testing
|
|
3006
|
+
constructor(value) {
|
|
3007
|
+
this.value = value;
|
|
3008
|
+
}
|
|
3009
|
+
subscribe(callback) {
|
|
3010
|
+
// are we within a pipe?
|
|
3011
|
+
const subscribeWith = this.subscribeWith;
|
|
3012
|
+
if (subscribeWith) {
|
|
3013
|
+
// are we in a pipe?
|
|
3014
|
+
if (this.methods.length) {
|
|
3015
|
+
const orgCallback = callback;
|
|
3016
|
+
callback = (value, subscription) => {
|
|
3017
|
+
runPipedMethods(value, subscription, this.methods, lastValue => orgCallback(lastValue, subscription));
|
|
3018
|
+
};
|
|
3019
|
+
}
|
|
3020
|
+
return subscribeWith(callback);
|
|
3021
|
+
}
|
|
3022
|
+
this.subscribers.push(callback);
|
|
3023
|
+
SubjectClass.globalSubs.push(callback); // 🔬 testing
|
|
3024
|
+
const subscription = getSubscription(this, callback);
|
|
3025
|
+
return subscription;
|
|
3026
|
+
}
|
|
3027
|
+
set(value) {
|
|
3028
|
+
this.value = value;
|
|
3029
|
+
// Notify all subscribers with the new value
|
|
3030
|
+
this.subscribers.forEach((callback) => {
|
|
3031
|
+
callback.value = value;
|
|
3032
|
+
callback(value);
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3035
|
+
next = this.set;
|
|
3036
|
+
toPromise() {
|
|
3037
|
+
return new Promise((res, rej) => {
|
|
3038
|
+
const subscription = this.subscribe(x => {
|
|
3039
|
+
subscription.unsubscribe();
|
|
3040
|
+
res(x);
|
|
3041
|
+
});
|
|
3042
|
+
});
|
|
3043
|
+
}
|
|
3044
|
+
pipe(...operations) {
|
|
3045
|
+
const subject = new Subject();
|
|
3046
|
+
subject.methods = operations;
|
|
3047
|
+
subject.subscribeWith = (x) => this.subscribe(x);
|
|
3048
|
+
return subject;
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
function removeSubFromArray(subscribers, callback) {
|
|
3052
|
+
const index = subscribers.indexOf(callback);
|
|
3053
|
+
if (index !== -1) {
|
|
3054
|
+
subscribers.splice(index, 1);
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
const SubjectClass = Subject;
|
|
3058
|
+
SubjectClass.globalSubs = []; // 🔬 for testing
|
|
3059
|
+
SubjectClass.globalSubCount$ = new Subject(); // for ease of debugging
|
|
3060
|
+
SubjectClass.globalSubCount$.set(0);
|
|
3061
|
+
function getSubscription(subject, callback) {
|
|
3062
|
+
const countSubject = SubjectClass.globalSubCount$;
|
|
3063
|
+
SubjectClass.globalSubCount$.set(countSubject.value + 1);
|
|
3064
|
+
const subscription = () => {
|
|
3065
|
+
subscription.unsubscribe();
|
|
3066
|
+
};
|
|
3067
|
+
subscription.subscriptions = [];
|
|
3068
|
+
// Return a function to unsubscribe from the BehaviorSubject
|
|
3069
|
+
subscription.unsubscribe = () => {
|
|
3070
|
+
removeSubFromArray(subject.subscribers, callback); // each will be called when update comes in
|
|
3071
|
+
removeSubFromArray(SubjectClass.globalSubs, callback); // 🔬 testing
|
|
3072
|
+
SubjectClass.globalSubCount$.set(countSubject.value - 1);
|
|
3073
|
+
// any double unsubscribes will be ignored
|
|
3074
|
+
subscription.unsubscribe = () => subscription;
|
|
3075
|
+
// unsubscribe from any combined subjects
|
|
3076
|
+
subscription.subscriptions.forEach(subscription => subscription.unsubscribe());
|
|
3077
|
+
return subscription;
|
|
3078
|
+
};
|
|
3079
|
+
subscription.add = (sub) => {
|
|
3080
|
+
subscription.subscriptions.push(sub);
|
|
3081
|
+
return subscription;
|
|
3082
|
+
};
|
|
3083
|
+
return subscription;
|
|
3084
|
+
}
|
|
3085
|
+
function runPipedMethods(value, subscription, methods, onComplete) {
|
|
3086
|
+
const cloneMethods = [...methods];
|
|
3087
|
+
const firstMethod = cloneMethods.shift();
|
|
3088
|
+
const next = (newValue) => {
|
|
3089
|
+
if (cloneMethods.length) {
|
|
3090
|
+
return runPipedMethods(newValue, subscription, cloneMethods, onComplete);
|
|
3091
|
+
}
|
|
3092
|
+
onComplete(newValue);
|
|
3093
|
+
// return newValue = next
|
|
3094
|
+
};
|
|
3095
|
+
let handler = next;
|
|
3096
|
+
const setHandler = (x) => handler = x;
|
|
3097
|
+
const pipeUtils = { setHandler, next };
|
|
3098
|
+
const methodResponse = firstMethod(value, pipeUtils);
|
|
3099
|
+
handler(methodResponse);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
|
|
3103
|
+
/***/ }),
|
|
3104
|
+
|
|
3105
|
+
/***/ "./ts/subject/ValueSubject.ts":
|
|
3106
|
+
/*!************************************!*\
|
|
3107
|
+
!*** ./ts/subject/ValueSubject.ts ***!
|
|
3108
|
+
\************************************/
|
|
3109
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3110
|
+
|
|
3111
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3112
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3113
|
+
/* harmony export */ ValueSubject: () => (/* binding */ ValueSubject)
|
|
3114
|
+
/* harmony export */ });
|
|
3115
|
+
/* harmony import */ var _Subject_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject.class */ "./ts/subject/Subject.class.ts");
|
|
3116
|
+
|
|
3117
|
+
class ValueSubject extends _Subject_class__WEBPACK_IMPORTED_MODULE_0__.Subject {
|
|
3118
|
+
value;
|
|
3119
|
+
constructor(value) {
|
|
3120
|
+
super(value);
|
|
3121
|
+
this.value = value;
|
|
3122
|
+
}
|
|
3123
|
+
subscribe(callback) {
|
|
3124
|
+
const subscription = super.subscribe(callback);
|
|
3125
|
+
// Call the callback immediately with the current value
|
|
3126
|
+
callback(this.value, subscription);
|
|
3127
|
+
return subscription;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
|
|
3132
|
+
/***/ }),
|
|
3133
|
+
|
|
3134
|
+
/***/ "./ts/subject/combineLatest.function.ts":
|
|
3135
|
+
/*!**********************************************!*\
|
|
3136
|
+
!*** ./ts/subject/combineLatest.function.ts ***!
|
|
3137
|
+
\**********************************************/
|
|
3138
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3139
|
+
|
|
3140
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3141
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3142
|
+
/* harmony export */ combineLatest: () => (/* binding */ combineLatest)
|
|
3143
|
+
/* harmony export */ });
|
|
3144
|
+
/* harmony import */ var _Subject_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject.class */ "./ts/subject/Subject.class.ts");
|
|
3145
|
+
|
|
3146
|
+
function combineLatest(subjects) {
|
|
3147
|
+
const output = new _Subject_class__WEBPACK_IMPORTED_MODULE_0__.Subject();
|
|
3148
|
+
const subscribe = (callback) => {
|
|
3149
|
+
const valuesSeen = [];
|
|
3150
|
+
const values = [];
|
|
3151
|
+
const setValue = (x, index) => {
|
|
3152
|
+
valuesSeen[index] = true;
|
|
3153
|
+
values[index] = x;
|
|
3154
|
+
if (valuesSeen.length === subjects.length && valuesSeen.every(x => x)) {
|
|
3155
|
+
callback(values, subscription);
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
const clones = [...subjects];
|
|
3159
|
+
const firstSub = clones.shift();
|
|
3160
|
+
const subscription = firstSub.subscribe(x => setValue(x, 0));
|
|
3161
|
+
const subscriptions = clones.map((subject, index) => subject.subscribe(x => setValue(x, index + 1)));
|
|
3162
|
+
subscription.subscriptions = subscriptions;
|
|
3163
|
+
return subscription;
|
|
3164
|
+
};
|
|
3165
|
+
output.subscribeWith = subscribe;
|
|
3166
|
+
return output;
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
|
|
3170
|
+
/***/ }),
|
|
3171
|
+
|
|
3172
|
+
/***/ "./ts/subject/index.ts":
|
|
3173
|
+
/*!*****************************!*\
|
|
3174
|
+
!*** ./ts/subject/index.ts ***!
|
|
3175
|
+
\*****************************/
|
|
3176
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3177
|
+
|
|
3178
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3179
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3180
|
+
/* harmony export */ Subject: () => (/* reexport safe */ _Subject_class__WEBPACK_IMPORTED_MODULE_0__.Subject),
|
|
3181
|
+
/* harmony export */ ValueSubject: () => (/* reexport safe */ _ValueSubject__WEBPACK_IMPORTED_MODULE_1__.ValueSubject),
|
|
3182
|
+
/* harmony export */ combineLatest: () => (/* reexport safe */ _combineLatest_function__WEBPACK_IMPORTED_MODULE_2__.combineLatest),
|
|
3183
|
+
/* harmony export */ willCallback: () => (/* reexport safe */ _will_functions__WEBPACK_IMPORTED_MODULE_3__.willCallback),
|
|
3184
|
+
/* harmony export */ willPromise: () => (/* reexport safe */ _will_functions__WEBPACK_IMPORTED_MODULE_3__.willPromise),
|
|
3185
|
+
/* harmony export */ willSubscribe: () => (/* reexport safe */ _will_functions__WEBPACK_IMPORTED_MODULE_3__.willSubscribe)
|
|
3186
|
+
/* harmony export */ });
|
|
3187
|
+
/* harmony import */ var _Subject_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject.class */ "./ts/subject/Subject.class.ts");
|
|
3188
|
+
/* harmony import */ var _ValueSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ValueSubject */ "./ts/subject/ValueSubject.ts");
|
|
3189
|
+
/* harmony import */ var _combineLatest_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./combineLatest.function */ "./ts/subject/combineLatest.function.ts");
|
|
3190
|
+
/* harmony import */ var _will_functions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./will.functions */ "./ts/subject/will.functions.ts");
|
|
3191
|
+
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
|
|
3195
|
+
|
|
3196
|
+
|
|
3197
|
+
/***/ }),
|
|
3198
|
+
|
|
3199
|
+
/***/ "./ts/subject/will.functions.ts":
|
|
3200
|
+
/*!**************************************!*\
|
|
3201
|
+
!*** ./ts/subject/will.functions.ts ***!
|
|
3202
|
+
\**************************************/
|
|
3203
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3204
|
+
|
|
3205
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3206
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3207
|
+
/* harmony export */ willCallback: () => (/* binding */ willCallback),
|
|
3208
|
+
/* harmony export */ willPromise: () => (/* binding */ willPromise),
|
|
3209
|
+
/* harmony export */ willSubscribe: () => (/* binding */ willSubscribe)
|
|
3210
|
+
/* harmony export */ });
|
|
3211
|
+
function willCallback(callback) {
|
|
3212
|
+
return ((lastValue, utils) => {
|
|
3213
|
+
utils.setHandler(() => {
|
|
3214
|
+
return undefined;
|
|
3215
|
+
});
|
|
3216
|
+
callback(lastValue, utils.next);
|
|
3217
|
+
});
|
|
3218
|
+
}
|
|
3219
|
+
/** .pipe( promise((x) => Promise.resolve(44)) ) */
|
|
3220
|
+
function willPromise(callback) {
|
|
3221
|
+
return ((lastValue, utils) => {
|
|
3222
|
+
utils.setHandler(() => {
|
|
3223
|
+
return undefined;
|
|
3224
|
+
}); // do nothing on initial return
|
|
3225
|
+
const result = callback(lastValue);
|
|
3226
|
+
result.then(x => utils.next(x));
|
|
3227
|
+
});
|
|
3228
|
+
}
|
|
3229
|
+
/** .pipe( willSubscribe((x) => new ValueSubject(44)) ) */
|
|
3230
|
+
const willSubscribe = (callback) => {
|
|
3231
|
+
return ((lastValue, utils) => {
|
|
3232
|
+
utils.setHandler(() => {
|
|
3233
|
+
return undefined;
|
|
3234
|
+
}); // do nothing on initial return
|
|
3235
|
+
const result = callback(lastValue);
|
|
3236
|
+
const subscription = result.subscribe(x => {
|
|
3237
|
+
subscription.unsubscribe();
|
|
3238
|
+
utils.next(x);
|
|
3239
|
+
});
|
|
3240
|
+
});
|
|
3241
|
+
};
|
|
3242
|
+
|
|
3243
|
+
|
|
2898
3244
|
/***/ }),
|
|
2899
3245
|
|
|
2900
3246
|
/***/ "./ts/tag.ts":
|
|
@@ -2911,11 +3257,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2911
3257
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
2912
3258
|
/* harmony import */ var _setUse_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setUse.function */ "./ts/setUse.function.ts");
|
|
2913
3259
|
/* harmony import */ var _TemplaterResult_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TemplaterResult.class */ "./ts/TemplaterResult.class.ts");
|
|
2914
|
-
/* harmony import */ var
|
|
2915
|
-
/* harmony import */ var
|
|
2916
|
-
/* harmony import */ var
|
|
2917
|
-
/* harmony import */ var
|
|
2918
|
-
/* harmony import */ var
|
|
3260
|
+
/* harmony import */ var _bindSubjectCallback_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bindSubjectCallback.function */ "./ts/bindSubjectCallback.function.ts");
|
|
3261
|
+
/* harmony import */ var _deepFunctions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./deepFunctions */ "./ts/deepFunctions.ts");
|
|
3262
|
+
/* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TagSupport.class */ "./ts/TagSupport.class.ts");
|
|
3263
|
+
/* harmony import */ var _alterProps_function__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./alterProps.function */ "./ts/alterProps.function.ts");
|
|
3264
|
+
/* harmony import */ var _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./subject/ValueSubject */ "./ts/subject/ValueSubject.ts");
|
|
2919
3265
|
|
|
2920
3266
|
|
|
2921
3267
|
|
|
@@ -2956,15 +3302,15 @@ function kidsToTagArraySubject(children) {
|
|
|
2956
3302
|
}
|
|
2957
3303
|
const kidArray = children;
|
|
2958
3304
|
if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagArray)(kidArray)) {
|
|
2959
|
-
return { childSubject: new
|
|
3305
|
+
return { childSubject: new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_7__.ValueSubject(children), madeSubject: true };
|
|
2960
3306
|
}
|
|
2961
3307
|
const kid = children;
|
|
2962
3308
|
if (kid) {
|
|
2963
|
-
kid.arrayValue = 0;
|
|
2964
|
-
return { childSubject: new
|
|
3309
|
+
kid.memory.arrayValue = 0;
|
|
3310
|
+
return { childSubject: new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_7__.ValueSubject([kid]), madeSubject: true };
|
|
2965
3311
|
}
|
|
2966
3312
|
return {
|
|
2967
|
-
childSubject: new
|
|
3313
|
+
childSubject: new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_7__.ValueSubject([]),
|
|
2968
3314
|
madeSubject: true
|
|
2969
3315
|
};
|
|
2970
3316
|
}
|
|
@@ -3003,12 +3349,12 @@ function getTagWrap(templater, madeSubject) {
|
|
|
3003
3349
|
if (oldLatest && !newestOwnerTemplater) {
|
|
3004
3350
|
throw new Error('what to do here?');
|
|
3005
3351
|
}
|
|
3006
|
-
let castedProps = (0,
|
|
3007
|
-
const clonedProps = (0,
|
|
3352
|
+
let castedProps = (0,_alterProps_function__WEBPACK_IMPORTED_MODULE_6__.alterProps)(props, newestOwnerTemplater, oldTagSetup.ownerTagSupport);
|
|
3353
|
+
const clonedProps = (0,_deepFunctions__WEBPACK_IMPORTED_MODULE_4__.deepClone)(props); // castedProps
|
|
3008
3354
|
// CALL ORIGINAL COMPONENT FUNCTION
|
|
3009
3355
|
const tag = originalFunction(castedProps, childSubject);
|
|
3010
3356
|
tag.version = global.renderCount;
|
|
3011
|
-
tag.tagSupport = new
|
|
3357
|
+
tag.tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_5__.TagSupport(oldTagSetup.ownerTagSupport, templater, subject);
|
|
3012
3358
|
tag.tagSupport.propsConfig = {
|
|
3013
3359
|
latest: props, // castedProps
|
|
3014
3360
|
latestCloned: clonedProps,
|
|
@@ -3029,7 +3375,7 @@ function getTagWrap(templater, madeSubject) {
|
|
|
3029
3375
|
// all functions need to report to me
|
|
3030
3376
|
kid.values[index] = function (...args) {
|
|
3031
3377
|
const ownerTag = tag.ownerTag;
|
|
3032
|
-
(0,
|
|
3378
|
+
(0,_bindSubjectCallback_function__WEBPACK_IMPORTED_MODULE_3__.runTagCallback)(value, // callback
|
|
3033
3379
|
ownerTag, this, // bindTo
|
|
3034
3380
|
args);
|
|
3035
3381
|
};
|
|
@@ -3058,7 +3404,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3058
3404
|
/* harmony export */ });
|
|
3059
3405
|
/* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TagSupport.class */ "./ts/TagSupport.class.ts");
|
|
3060
3406
|
/* harmony import */ var _tagRunner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tagRunner */ "./ts/tagRunner.ts");
|
|
3061
|
-
/* harmony import */ var
|
|
3407
|
+
/* harmony import */ var _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subject/ValueSubject */ "./ts/subject/ValueSubject.ts");
|
|
3062
3408
|
|
|
3063
3409
|
|
|
3064
3410
|
|
|
@@ -3096,7 +3442,7 @@ element, props) {
|
|
|
3096
3442
|
return { tag, tags: app.original.tags };
|
|
3097
3443
|
}
|
|
3098
3444
|
function applyTagUpdater(wrapper) {
|
|
3099
|
-
const subject = new
|
|
3445
|
+
const subject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_2__.ValueSubject({});
|
|
3100
3446
|
const tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_0__.BaseTagSupport(wrapper, subject);
|
|
3101
3447
|
wrapper.tagSupport = tagSupport;
|
|
3102
3448
|
(0,_tagRunner__WEBPACK_IMPORTED_MODULE_1__.runBeforeRender)(tagSupport, undefined);
|
|
@@ -3145,6 +3491,35 @@ function runBeforeDestroy(tagSupport, tag) {
|
|
|
3145
3491
|
}
|
|
3146
3492
|
|
|
3147
3493
|
|
|
3494
|
+
/***/ }),
|
|
3495
|
+
|
|
3496
|
+
/***/ "./ts/updateBeforeTemplate.function.ts":
|
|
3497
|
+
/*!*********************************************!*\
|
|
3498
|
+
!*** ./ts/updateBeforeTemplate.function.ts ***!
|
|
3499
|
+
\*********************************************/
|
|
3500
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3501
|
+
|
|
3502
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3503
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3504
|
+
/* harmony export */ updateBeforeTemplate: () => (/* binding */ updateBeforeTemplate)
|
|
3505
|
+
/* harmony export */ });
|
|
3506
|
+
// Function to update the value of x
|
|
3507
|
+
function updateBeforeTemplate(value, lastFirstChild) {
|
|
3508
|
+
const parent = lastFirstChild.parentNode;
|
|
3509
|
+
let castedValue = value;
|
|
3510
|
+
// mimic React skipping to display EXCEPT for true does display on page
|
|
3511
|
+
if ([undefined, false, null].includes(value)) { // || value === true
|
|
3512
|
+
castedValue = '';
|
|
3513
|
+
}
|
|
3514
|
+
// Insert the new value (never use innerHTML here)
|
|
3515
|
+
const textNode = document.createTextNode(castedValue); // never innerHTML
|
|
3516
|
+
parent.insertBefore(textNode, lastFirstChild);
|
|
3517
|
+
/* remove existing nodes */
|
|
3518
|
+
parent.removeChild(lastFirstChild);
|
|
3519
|
+
return textNode;
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
|
|
3148
3523
|
/***/ }),
|
|
3149
3524
|
|
|
3150
3525
|
/***/ "./ts/updateExistingTagComponent.function.ts":
|
|
@@ -3161,23 +3536,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3161
3536
|
/* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/processSubjectComponent.function.ts");
|
|
3162
3537
|
/* harmony import */ var _destroyTag_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./destroyTag.function */ "./ts/destroyTag.function.ts");
|
|
3163
3538
|
/* harmony import */ var _renderTagSupport_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./renderTagSupport.function */ "./ts/renderTagSupport.function.ts");
|
|
3539
|
+
/* harmony import */ var _alterProps_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./alterProps.function */ "./ts/alterProps.function.ts");
|
|
3540
|
+
|
|
3164
3541
|
|
|
3165
3542
|
|
|
3166
3543
|
|
|
3167
3544
|
|
|
3168
3545
|
function updateExistingTagComponent(ownerTag, templater, subject, insertBefore) {
|
|
3169
3546
|
let existingTag = subject.tag;
|
|
3170
|
-
/*
|
|
3171
|
-
if(existingTag && !existingTag.hasLiveElements) {
|
|
3172
|
-
throw new Error('issue already began')
|
|
3173
|
-
}
|
|
3174
|
-
*/
|
|
3175
3547
|
const oldWrapper = existingTag.tagSupport.templater.wrapper;
|
|
3176
3548
|
const newWrapper = templater.wrapper;
|
|
3177
3549
|
let isSameTag = false;
|
|
3178
|
-
if (templater.global.oldest && !templater.global.oldest.hasLiveElements) {
|
|
3179
|
-
throw new Error('88893434');
|
|
3180
|
-
}
|
|
3181
3550
|
if (oldWrapper && newWrapper) {
|
|
3182
3551
|
const oldFunction = oldWrapper.original;
|
|
3183
3552
|
const newFunction = newWrapper.original;
|
|
@@ -3187,22 +3556,38 @@ function updateExistingTagComponent(ownerTag, templater, subject, insertBefore)
|
|
|
3187
3556
|
const oldGlobal = oldTagSupport.templater.global;
|
|
3188
3557
|
const globalInsert = oldGlobal.insertBefore;
|
|
3189
3558
|
const oldInsertBefore = globalInsert?.parentNode ? globalInsert : insertBefore;
|
|
3190
|
-
|
|
3191
|
-
|
|
3559
|
+
// const placeholderElm = ownerTag.tagSupport.templater.global.placeholderElm
|
|
3560
|
+
const placeholderElm = oldGlobal.placeholderElm;
|
|
3561
|
+
if (placeholderElm) {
|
|
3562
|
+
if (!placeholderElm.parentNode) {
|
|
3563
|
+
throw new Error('stop here no subject parent node update existing tag');
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
else if (!oldInsertBefore.parentNode) {
|
|
3567
|
+
//throw new Error('stop here no parent node update existing tag')
|
|
3192
3568
|
}
|
|
3193
3569
|
if (!isSameTag) {
|
|
3194
3570
|
(0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_2__.destroyTagMemory)(oldTagSupport.templater.global.oldest, subject);
|
|
3195
|
-
(0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_1__.processSubjectComponent)(templater, subject,
|
|
3571
|
+
return (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_1__.processSubjectComponent)(templater, subject,
|
|
3572
|
+
// ??? - newly changed
|
|
3573
|
+
insertBefore, // oldInsertBefore,
|
|
3574
|
+
ownerTag, {
|
|
3196
3575
|
forceElement: false,
|
|
3197
3576
|
counts: { added: 0, removed: 0 },
|
|
3198
3577
|
});
|
|
3199
|
-
return;
|
|
3200
3578
|
}
|
|
3201
3579
|
else {
|
|
3202
3580
|
const newTagSupport = templater.tagSupport;
|
|
3203
3581
|
const hasChanged = (0,_hasTagSupportChanged_function__WEBPACK_IMPORTED_MODULE_0__.hasTagSupportChanged)(oldTagSupport, newTagSupport, templater);
|
|
3204
3582
|
if (!hasChanged) {
|
|
3205
|
-
|
|
3583
|
+
// if the new props are an object then implicitly since no change, the old props are an object
|
|
3584
|
+
const newProps = templater.props;
|
|
3585
|
+
if (newProps && typeof (newProps) === 'object') {
|
|
3586
|
+
// const newestTag = oldTagSupport.templater.global.newest
|
|
3587
|
+
// const oldProps = existingTag.tagSupport.propsConfig.latestCloned as Record<string,any> // newestTag.props as Record<string, any>
|
|
3588
|
+
syncFunctionProps(templater, existingTag, ownerTag, newProps);
|
|
3589
|
+
}
|
|
3590
|
+
return existingTag; // its the same tag component
|
|
3206
3591
|
}
|
|
3207
3592
|
}
|
|
3208
3593
|
const oldestTag = templater.global.oldest; // oldTagSupport.oldest as Tag // existingTag
|
|
@@ -3215,7 +3600,10 @@ function updateExistingTagComponent(ownerTag, templater, subject, insertBefore)
|
|
|
3215
3600
|
const newOldest = newTag.tagSupport.templater.global.oldest;
|
|
3216
3601
|
const hasOldest = newOldest ? true : false;
|
|
3217
3602
|
if (!hasOldest) {
|
|
3218
|
-
return buildNewTag(newTag,
|
|
3603
|
+
return buildNewTag(newTag,
|
|
3604
|
+
// ??? newly changed
|
|
3605
|
+
insertBefore, // oldInsertBefore,
|
|
3606
|
+
oldTagSupport, subject);
|
|
3219
3607
|
}
|
|
3220
3608
|
if (newOldest && templater.children.value.length) {
|
|
3221
3609
|
const oldKidsSub = newOldest.tagSupport.templater.children;
|
|
@@ -3237,7 +3625,7 @@ function updateExistingTagComponent(ownerTag, templater, subject, insertBefore)
|
|
|
3237
3625
|
}
|
|
3238
3626
|
subject.tag = newTag;
|
|
3239
3627
|
oldestTag.updateByTag(newTag); // the oldest tag has element references
|
|
3240
|
-
return;
|
|
3628
|
+
return newTag;
|
|
3241
3629
|
}
|
|
3242
3630
|
else {
|
|
3243
3631
|
// Although function looked the same it returned a different html result
|
|
@@ -3251,7 +3639,7 @@ function updateExistingTagComponent(ownerTag, templater, subject, insertBefore)
|
|
|
3251
3639
|
buildNewTag(newTag, oldTagSupport.templater.global.insertBefore, oldTagSupport, subject);
|
|
3252
3640
|
}
|
|
3253
3641
|
oldTagSupport.templater.global.newest = newTag;
|
|
3254
|
-
return;
|
|
3642
|
+
return newTag;
|
|
3255
3643
|
}
|
|
3256
3644
|
function checkStateChanged(state) {
|
|
3257
3645
|
return !state.newest.every(state => {
|
|
@@ -3267,20 +3655,39 @@ function checkStateChanged(state) {
|
|
|
3267
3655
|
function buildNewTag(newTag, oldInsertBefore, oldTagSupport, subject) {
|
|
3268
3656
|
newTag.buildBeforeElement(oldInsertBefore, {
|
|
3269
3657
|
forceElement: true,
|
|
3270
|
-
counts: { added: 0, removed: 0 },
|
|
3658
|
+
counts: { added: 0, removed: 0 },
|
|
3271
3659
|
});
|
|
3272
3660
|
newTag.tagSupport.templater.global.oldest = newTag;
|
|
3273
3661
|
newTag.tagSupport.templater.global.newest = newTag;
|
|
3274
3662
|
oldTagSupport.templater.global.oldest = newTag;
|
|
3275
3663
|
oldTagSupport.templater.global.newest = newTag;
|
|
3276
|
-
if (!newTag.tagSupport.templater.global.oldest) {
|
|
3277
|
-
throw new Error('maybe 5');
|
|
3278
|
-
}
|
|
3279
3664
|
subject.tag = newTag;
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3665
|
+
return newTag;
|
|
3666
|
+
}
|
|
3667
|
+
function syncFunctionProps(templater, existingTag, ownerTag, newProps) {
|
|
3668
|
+
existingTag = existingTag.tagSupport.templater.global.newest;
|
|
3669
|
+
// const templater = existingTag.tagSupport.templater
|
|
3670
|
+
const priorProps = existingTag.tagSupport.propsConfig.latestCloned;
|
|
3671
|
+
const oldLatest = ownerTag.tagSupport.templater.global.newest;
|
|
3672
|
+
const ownerSupport = oldLatest.tagSupport;
|
|
3673
|
+
Object.entries(priorProps).forEach(([name, value]) => {
|
|
3674
|
+
if (!(value instanceof Function)) {
|
|
3675
|
+
return;
|
|
3676
|
+
}
|
|
3677
|
+
const newOriginal = value.original;
|
|
3678
|
+
// TODO: The code below maybe irrelevant
|
|
3679
|
+
const newCallback = newProps[name];
|
|
3680
|
+
const original = newCallback.original;
|
|
3681
|
+
if (original) {
|
|
3682
|
+
return; // already previously converted
|
|
3683
|
+
}
|
|
3684
|
+
// Currently, call self but over parent state changes, I may need to call a newer parent tag owner
|
|
3685
|
+
priorProps[name].toCall = (...args) => {
|
|
3686
|
+
return (0,_alterProps_function__WEBPACK_IMPORTED_MODULE_4__.callbackPropOwner)(newCallback, // value, // newOriginal,
|
|
3687
|
+
args, templater, ownerSupport);
|
|
3688
|
+
};
|
|
3689
|
+
return;
|
|
3690
|
+
});
|
|
3284
3691
|
}
|
|
3285
3692
|
|
|
3286
3693
|
|
|
@@ -3298,14 +3705,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3298
3705
|
/* harmony export */ });
|
|
3299
3706
|
/* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TagSupport.class */ "./ts/TagSupport.class.ts");
|
|
3300
3707
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
3301
|
-
/* harmony import */ var
|
|
3302
|
-
/* harmony import */ var
|
|
3303
|
-
/* harmony import */ var
|
|
3304
|
-
/* harmony import */ var
|
|
3305
|
-
/* harmony import */ var
|
|
3306
|
-
/* harmony import */ var
|
|
3307
|
-
/* harmony import */ var
|
|
3308
|
-
/* harmony import */ var
|
|
3708
|
+
/* harmony import */ var _processTagArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./processTagArray */ "./ts/processTagArray.ts");
|
|
3709
|
+
/* harmony import */ var _updateExistingTagComponent_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./updateExistingTagComponent.function */ "./ts/updateExistingTagComponent.function.ts");
|
|
3710
|
+
/* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/processRegularValue.function.ts");
|
|
3711
|
+
/* harmony import */ var _checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkDestroyPrevious.function */ "./ts/checkDestroyPrevious.function.ts");
|
|
3712
|
+
/* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/processSubjectComponent.function.ts");
|
|
3713
|
+
/* harmony import */ var _isLikeTags_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isLikeTags.function */ "./ts/isLikeTags.function.ts");
|
|
3714
|
+
/* harmony import */ var _bindSubjectCallback_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./bindSubjectCallback.function */ "./ts/bindSubjectCallback.function.ts");
|
|
3715
|
+
/* harmony import */ var _processTag_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./processTag.function */ "./ts/processTag.function.ts");
|
|
3716
|
+
/* harmony import */ var _insertAfter_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./insertAfter.function */ "./ts/insertAfter.function.ts");
|
|
3717
|
+
|
|
3309
3718
|
|
|
3310
3719
|
|
|
3311
3720
|
|
|
@@ -3319,24 +3728,37 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3319
3728
|
function updateExistingValue(subject, value, ownerTag, insertBefore) {
|
|
3320
3729
|
const subjectTag = subject;
|
|
3321
3730
|
const isComponent = (0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagComponent)(value);
|
|
3322
|
-
const
|
|
3323
|
-
(
|
|
3731
|
+
// const global = subjectTag.tag?.tagSupport.templater.global
|
|
3732
|
+
// const placeholderElm = global?.placeholderElm || global?.insertBefore || (subject as DisplaySubject).insertBefore
|
|
3733
|
+
// const oldInsertBefore = placeholderElm || (subject as DisplaySubject).clone
|
|
3734
|
+
const destroyType = (0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_5__.checkDestroyPrevious)(subject, value, insertBefore);
|
|
3324
3735
|
// handle already seen tag components
|
|
3325
3736
|
if (isComponent) {
|
|
3326
3737
|
const templater = value;
|
|
3327
3738
|
// When was something before component
|
|
3328
3739
|
if (!subjectTag.tag) {
|
|
3329
|
-
(0,
|
|
3740
|
+
const tag = (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_6__.processSubjectComponent)(templater, subjectTag, insertBefore, // oldInsertBefore as InsertBefore,
|
|
3741
|
+
ownerTag, {
|
|
3330
3742
|
forceElement: true,
|
|
3331
3743
|
counts: { added: 0, removed: 0 },
|
|
3332
3744
|
});
|
|
3333
3745
|
return subjectTag;
|
|
3334
3746
|
}
|
|
3747
|
+
// ??? - new put back down template tag before redraw
|
|
3748
|
+
const placeholderElm = subjectTag.tag.tagSupport.templater.global.placeholderElm;
|
|
3749
|
+
if (placeholderElm) {
|
|
3750
|
+
(0,_insertAfter_function__WEBPACK_IMPORTED_MODULE_10__.insertAfter)(insertBefore, placeholderElm);
|
|
3751
|
+
delete subjectTag.tag.tagSupport.templater.global.placeholderElm;
|
|
3752
|
+
}
|
|
3335
3753
|
templater.tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_0__.TagSupport(
|
|
3336
3754
|
// subjectTag.tag.tagSupport.ownerTagSupport,
|
|
3337
3755
|
ownerTag.tagSupport, templater, subjectTag);
|
|
3338
|
-
(0,
|
|
3756
|
+
const tag = (0,_updateExistingTagComponent_function__WEBPACK_IMPORTED_MODULE_3__.updateExistingTagComponent)(ownerTag, templater, // latest value
|
|
3339
3757
|
subjectTag, insertBefore);
|
|
3758
|
+
if (insertBefore.parentNode) {
|
|
3759
|
+
tag.tagSupport.templater.global.placeholderElm = insertBefore.previousSibling;
|
|
3760
|
+
insertBefore.parentNode.removeChild(insertBefore);
|
|
3761
|
+
}
|
|
3340
3762
|
return subjectTag;
|
|
3341
3763
|
}
|
|
3342
3764
|
// was component but no longer
|
|
@@ -3347,7 +3769,8 @@ function updateExistingValue(subject, value, ownerTag, insertBefore) {
|
|
|
3347
3769
|
}
|
|
3348
3770
|
// its another tag array
|
|
3349
3771
|
if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagArray)(value)) {
|
|
3350
|
-
(0,
|
|
3772
|
+
(0,_processTagArray__WEBPACK_IMPORTED_MODULE_2__.processTagArray)(subject, value, insertBefore, // oldInsertBefore as InsertBefore,
|
|
3773
|
+
ownerTag, { counts: {
|
|
3351
3774
|
added: 0,
|
|
3352
3775
|
removed: 0,
|
|
3353
3776
|
} });
|
|
@@ -3356,13 +3779,15 @@ function updateExistingValue(subject, value, ownerTag, insertBefore) {
|
|
|
3356
3779
|
// now its a function
|
|
3357
3780
|
if (value instanceof Function) {
|
|
3358
3781
|
// const newSubject = getSubjectFunction(value, ownerTag)
|
|
3359
|
-
const bound = (0,
|
|
3782
|
+
const bound = (0,_bindSubjectCallback_function__WEBPACK_IMPORTED_MODULE_8__.bindSubjectCallback)(value, ownerTag);
|
|
3360
3783
|
subject.set(bound);
|
|
3361
3784
|
return subject;
|
|
3362
3785
|
}
|
|
3363
3786
|
if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagInstance)(value)) {
|
|
3364
|
-
|
|
3365
|
-
|
|
3787
|
+
if (insertBefore.tagName !== 'TEMPLATE') {
|
|
3788
|
+
throw new Error(`expected template - ${insertBefore.nodeName}`);
|
|
3789
|
+
}
|
|
3790
|
+
(0,_processTag_function__WEBPACK_IMPORTED_MODULE_9__.processTag)(value, subjectTag, insertBefore, ownerTag);
|
|
3366
3791
|
return subjectTag;
|
|
3367
3792
|
}
|
|
3368
3793
|
// we have been given a subject
|
|
@@ -3370,25 +3795,32 @@ function updateExistingValue(subject, value, ownerTag, insertBefore) {
|
|
|
3370
3795
|
return value;
|
|
3371
3796
|
}
|
|
3372
3797
|
// This will cause all other values to render
|
|
3373
|
-
(0,
|
|
3798
|
+
(0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_4__.processRegularValue)(value, subject,
|
|
3799
|
+
// ??? - changed to insertBefore for tag switching with template removal
|
|
3800
|
+
insertBefore // oldInsertBefore as InsertBefore,
|
|
3801
|
+
);
|
|
3374
3802
|
return subjectTag;
|
|
3375
3803
|
}
|
|
3376
3804
|
function handleStillTag(existingTag, subject, value, ownerTag) {
|
|
3377
3805
|
// TODO: We shouldn't need both of these
|
|
3378
|
-
const isSameTag = value && (0,
|
|
3806
|
+
const isSameTag = value && (0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_7__.isLikeTags)(existingTag, value);
|
|
3379
3807
|
const isSameTag2 = value && value.getTemplate && existingTag.isLikeTag(value);
|
|
3380
3808
|
const tag = value;
|
|
3381
3809
|
if (!tag.tagSupport) {
|
|
3382
|
-
(0,
|
|
3810
|
+
(0,_processTag_function__WEBPACK_IMPORTED_MODULE_9__.applyFakeTemplater)(tag, ownerTag, subject);
|
|
3383
3811
|
}
|
|
3384
3812
|
if (isSameTag) {
|
|
3385
3813
|
existingTag.updateByTag(tag);
|
|
3386
3814
|
return;
|
|
3387
3815
|
}
|
|
3388
3816
|
if (isSameTag || isSameTag2) {
|
|
3389
|
-
|
|
3817
|
+
const subjectTag = subject;
|
|
3818
|
+
const global = existingTag.tagSupport.templater.global;
|
|
3819
|
+
delete global.placeholderElm;
|
|
3820
|
+
const insertBefore = global.insertBefore;
|
|
3821
|
+
return (0,_processTag_function__WEBPACK_IMPORTED_MODULE_9__.processTag)(value, subjectTag, insertBefore, ownerTag);
|
|
3390
3822
|
}
|
|
3391
|
-
return (0,
|
|
3823
|
+
return (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_4__.processRegularValue)(value, subject, subject.insertBefore);
|
|
3392
3824
|
}
|
|
3393
3825
|
|
|
3394
3826
|
|
|
@@ -3493,56 +3925,59 @@ var __webpack_exports__ = {};
|
|
|
3493
3925
|
__webpack_require__.r(__webpack_exports__);
|
|
3494
3926
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3495
3927
|
/* harmony export */ ArrayNoKeyError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_4__.ArrayNoKeyError),
|
|
3496
|
-
/* harmony export */ BaseTagSupport: () => (/* reexport safe */
|
|
3928
|
+
/* harmony export */ BaseTagSupport: () => (/* reexport safe */ _TagSupport_class__WEBPACK_IMPORTED_MODULE_8__.BaseTagSupport),
|
|
3497
3929
|
/* harmony export */ StateMismatchError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_4__.StateMismatchError),
|
|
3498
|
-
/* harmony export */ Subject: () => (/* reexport safe */
|
|
3499
|
-
/* harmony export */ Tag: () => (/* reexport safe */
|
|
3930
|
+
/* harmony export */ Subject: () => (/* reexport safe */ _subject_index__WEBPACK_IMPORTED_MODULE_5__.Subject),
|
|
3931
|
+
/* harmony export */ Tag: () => (/* reexport safe */ _Tag_class__WEBPACK_IMPORTED_MODULE_10__.Tag),
|
|
3500
3932
|
/* harmony export */ TagError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_4__.TagError),
|
|
3501
|
-
/* harmony export */ TagSupport: () => (/* reexport safe */
|
|
3502
|
-
/* harmony export */ ValueSubject: () => (/* reexport safe */
|
|
3503
|
-
/* harmony export */
|
|
3933
|
+
/* harmony export */ TagSupport: () => (/* reexport safe */ _TagSupport_class__WEBPACK_IMPORTED_MODULE_8__.TagSupport),
|
|
3934
|
+
/* harmony export */ ValueSubject: () => (/* reexport safe */ _subject_index__WEBPACK_IMPORTED_MODULE_5__.ValueSubject),
|
|
3935
|
+
/* harmony export */ combineLatest: () => (/* reexport safe */ _subject_index__WEBPACK_IMPORTED_MODULE_5__.combineLatest),
|
|
3936
|
+
/* harmony export */ getCallback: () => (/* reexport safe */ _getCallback__WEBPACK_IMPORTED_MODULE_19__.getCallback),
|
|
3504
3937
|
/* harmony export */ hmr: () => (/* binding */ hmr),
|
|
3505
3938
|
/* harmony export */ html: () => (/* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_3__.html),
|
|
3506
|
-
/* harmony export */ interpolateElement: () => (/* reexport safe */
|
|
3507
|
-
/* harmony export */ interpolateString: () => (/* reexport safe */
|
|
3939
|
+
/* harmony export */ interpolateElement: () => (/* reexport safe */ _interpolateElement__WEBPACK_IMPORTED_MODULE_9__.interpolateElement),
|
|
3940
|
+
/* harmony export */ interpolateString: () => (/* reexport safe */ _interpolateElement__WEBPACK_IMPORTED_MODULE_9__.interpolateString),
|
|
3508
3941
|
/* harmony export */ isSubjectInstance: () => (/* reexport safe */ _isInstance__WEBPACK_IMPORTED_MODULE_6__.isSubjectInstance),
|
|
3509
3942
|
/* harmony export */ isTagArray: () => (/* reexport safe */ _isInstance__WEBPACK_IMPORTED_MODULE_6__.isTagArray),
|
|
3510
3943
|
/* harmony export */ isTagComponent: () => (/* reexport safe */ _isInstance__WEBPACK_IMPORTED_MODULE_6__.isTagComponent),
|
|
3511
3944
|
/* harmony export */ isTagInstance: () => (/* reexport safe */ _isInstance__WEBPACK_IMPORTED_MODULE_6__.isTagInstance),
|
|
3512
|
-
/* harmony export */ onDestroy: () => (/* reexport safe */
|
|
3513
|
-
/* harmony export */ onInit: () => (/* reexport safe */
|
|
3514
|
-
/* harmony export */ providers: () => (/* reexport safe */
|
|
3515
|
-
/* harmony export */ runBeforeRender: () => (/* reexport safe */
|
|
3516
|
-
/* harmony export */ set: () => (/* reexport safe */
|
|
3517
|
-
/* harmony export */ setLet: () => (/* reexport safe */
|
|
3518
|
-
/* harmony export */ setProp: () => (/* reexport safe */
|
|
3519
|
-
/* harmony export */ setUse: () => (/* reexport safe */
|
|
3945
|
+
/* harmony export */ onDestroy: () => (/* reexport safe */ _onDestroy__WEBPACK_IMPORTED_MODULE_18__.onDestroy),
|
|
3946
|
+
/* harmony export */ onInit: () => (/* reexport safe */ _onInit__WEBPACK_IMPORTED_MODULE_17__.onInit),
|
|
3947
|
+
/* harmony export */ providers: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_13__.providers),
|
|
3948
|
+
/* harmony export */ runBeforeRender: () => (/* reexport safe */ _tagRunner__WEBPACK_IMPORTED_MODULE_11__.runBeforeRender),
|
|
3949
|
+
/* harmony export */ set: () => (/* reexport safe */ _set_function__WEBPACK_IMPORTED_MODULE_14__.set),
|
|
3950
|
+
/* harmony export */ setLet: () => (/* reexport safe */ _setLet_function__WEBPACK_IMPORTED_MODULE_15__.setLet),
|
|
3951
|
+
/* harmony export */ setProp: () => (/* reexport safe */ _setProp_function__WEBPACK_IMPORTED_MODULE_16__.setProp),
|
|
3952
|
+
/* harmony export */ setUse: () => (/* reexport safe */ _setUse_function__WEBPACK_IMPORTED_MODULE_12__.setUse),
|
|
3520
3953
|
/* harmony export */ tag: () => (/* reexport safe */ _tag__WEBPACK_IMPORTED_MODULE_2__.tag),
|
|
3521
3954
|
/* harmony export */ tagElement: () => (/* reexport safe */ _tagElement__WEBPACK_IMPORTED_MODULE_0__.tagElement),
|
|
3522
3955
|
/* harmony export */ tags: () => (/* reexport safe */ _tag__WEBPACK_IMPORTED_MODULE_2__.tags),
|
|
3523
|
-
/* harmony export */ watch: () => (/* reexport safe */
|
|
3956
|
+
/* harmony export */ watch: () => (/* reexport safe */ _watch_function__WEBPACK_IMPORTED_MODULE_7__.watch),
|
|
3957
|
+
/* harmony export */ willCallback: () => (/* reexport safe */ _subject_index__WEBPACK_IMPORTED_MODULE_5__.willCallback),
|
|
3958
|
+
/* harmony export */ willPromise: () => (/* reexport safe */ _subject_index__WEBPACK_IMPORTED_MODULE_5__.willPromise),
|
|
3959
|
+
/* harmony export */ willSubscribe: () => (/* reexport safe */ _subject_index__WEBPACK_IMPORTED_MODULE_5__.willSubscribe)
|
|
3524
3960
|
/* harmony export */ });
|
|
3525
3961
|
/* harmony import */ var _tagElement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tagElement */ "./ts/tagElement.ts");
|
|
3526
3962
|
/* harmony import */ var _ElementTargetEvent_interface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ElementTargetEvent.interface */ "./ts/ElementTargetEvent.interface.ts");
|
|
3527
3963
|
/* harmony import */ var _tag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tag */ "./ts/tag.ts");
|
|
3528
3964
|
/* harmony import */ var _html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./html */ "./ts/html.ts");
|
|
3529
3965
|
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./errors */ "./ts/errors.ts");
|
|
3530
|
-
/* harmony import */ var
|
|
3966
|
+
/* harmony import */ var _subject_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./subject/index */ "./ts/subject/index.ts");
|
|
3531
3967
|
/* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isInstance */ "./ts/isInstance.ts");
|
|
3532
|
-
/* harmony import */ var
|
|
3533
|
-
/* harmony import */ var
|
|
3534
|
-
/* harmony import */ var
|
|
3535
|
-
/* harmony import */ var
|
|
3536
|
-
/* harmony import */ var
|
|
3537
|
-
/* harmony import */ var
|
|
3538
|
-
/* harmony import */ var
|
|
3539
|
-
/* harmony import */ var
|
|
3540
|
-
/* harmony import */ var
|
|
3541
|
-
/* harmony import */ var
|
|
3542
|
-
/* harmony import */ var
|
|
3543
|
-
/* harmony import */ var
|
|
3544
|
-
/* harmony import */ var
|
|
3545
|
-
/* harmony import */ var _getCallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./getCallback */ "./ts/getCallback.ts");
|
|
3968
|
+
/* harmony import */ var _watch_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./watch.function */ "./ts/watch.function.ts");
|
|
3969
|
+
/* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TagSupport.class */ "./ts/TagSupport.class.ts");
|
|
3970
|
+
/* harmony import */ var _interpolateElement__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./interpolateElement */ "./ts/interpolateElement.ts");
|
|
3971
|
+
/* harmony import */ var _Tag_class__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Tag.class */ "./ts/Tag.class.ts");
|
|
3972
|
+
/* harmony import */ var _tagRunner__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./tagRunner */ "./ts/tagRunner.ts");
|
|
3973
|
+
/* harmony import */ var _setUse_function__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./setUse.function */ "./ts/setUse.function.ts");
|
|
3974
|
+
/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./providers */ "./ts/providers.ts");
|
|
3975
|
+
/* harmony import */ var _set_function__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./set.function */ "./ts/set.function.ts");
|
|
3976
|
+
/* harmony import */ var _setLet_function__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./setLet.function */ "./ts/setLet.function.ts");
|
|
3977
|
+
/* harmony import */ var _setProp_function__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./setProp.function */ "./ts/setProp.function.ts");
|
|
3978
|
+
/* harmony import */ var _onInit__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./onInit */ "./ts/onInit.ts");
|
|
3979
|
+
/* harmony import */ var _onDestroy__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./onDestroy */ "./ts/onDestroy.ts");
|
|
3980
|
+
/* harmony import */ var _getCallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./getCallback */ "./ts/getCallback.ts");
|
|
3546
3981
|
// import { redrawTag } from "./redrawTag.function"
|
|
3547
3982
|
|
|
3548
3983
|
|
|
@@ -3553,7 +3988,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3553
3988
|
|
|
3554
3989
|
|
|
3555
3990
|
|
|
3556
|
-
|
|
3557
3991
|
// export * from "./redrawTag.function"
|
|
3558
3992
|
|
|
3559
3993
|
// TODO: export *
|
|
@@ -3586,6 +4020,7 @@ var __webpack_exports__Tag = __webpack_exports__.Tag;
|
|
|
3586
4020
|
var __webpack_exports__TagError = __webpack_exports__.TagError;
|
|
3587
4021
|
var __webpack_exports__TagSupport = __webpack_exports__.TagSupport;
|
|
3588
4022
|
var __webpack_exports__ValueSubject = __webpack_exports__.ValueSubject;
|
|
4023
|
+
var __webpack_exports__combineLatest = __webpack_exports__.combineLatest;
|
|
3589
4024
|
var __webpack_exports__getCallback = __webpack_exports__.getCallback;
|
|
3590
4025
|
var __webpack_exports__hmr = __webpack_exports__.hmr;
|
|
3591
4026
|
var __webpack_exports__html = __webpack_exports__.html;
|
|
@@ -3607,6 +4042,9 @@ var __webpack_exports__tag = __webpack_exports__.tag;
|
|
|
3607
4042
|
var __webpack_exports__tagElement = __webpack_exports__.tagElement;
|
|
3608
4043
|
var __webpack_exports__tags = __webpack_exports__.tags;
|
|
3609
4044
|
var __webpack_exports__watch = __webpack_exports__.watch;
|
|
3610
|
-
|
|
4045
|
+
var __webpack_exports__willCallback = __webpack_exports__.willCallback;
|
|
4046
|
+
var __webpack_exports__willPromise = __webpack_exports__.willPromise;
|
|
4047
|
+
var __webpack_exports__willSubscribe = __webpack_exports__.willSubscribe;
|
|
4048
|
+
export { __webpack_exports__ArrayNoKeyError as ArrayNoKeyError, __webpack_exports__BaseTagSupport as BaseTagSupport, __webpack_exports__StateMismatchError as StateMismatchError, __webpack_exports__Subject as Subject, __webpack_exports__Tag as Tag, __webpack_exports__TagError as TagError, __webpack_exports__TagSupport as TagSupport, __webpack_exports__ValueSubject as ValueSubject, __webpack_exports__combineLatest as combineLatest, __webpack_exports__getCallback as getCallback, __webpack_exports__hmr as hmr, __webpack_exports__html as html, __webpack_exports__interpolateElement as interpolateElement, __webpack_exports__interpolateString as interpolateString, __webpack_exports__isSubjectInstance as isSubjectInstance, __webpack_exports__isTagArray as isTagArray, __webpack_exports__isTagComponent as isTagComponent, __webpack_exports__isTagInstance as isTagInstance, __webpack_exports__onDestroy as onDestroy, __webpack_exports__onInit as onInit, __webpack_exports__providers as providers, __webpack_exports__runBeforeRender as runBeforeRender, __webpack_exports__set as set, __webpack_exports__setLet as setLet, __webpack_exports__setProp as setProp, __webpack_exports__setUse as setUse, __webpack_exports__tag as tag, __webpack_exports__tagElement as tagElement, __webpack_exports__tags as tags, __webpack_exports__watch as watch, __webpack_exports__willCallback as willCallback, __webpack_exports__willPromise as willPromise, __webpack_exports__willSubscribe as willSubscribe };
|
|
3611
4049
|
|
|
3612
4050
|
//# sourceMappingURL=bundle.js.map
|