taggedjs 2.5.7 → 2.5.9
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 +8 -4
- package/bundle.js.map +1 -1
- package/js/index.d.ts +1 -0
- package/js/subject.types.d.ts +1 -2
- package/js/tag/html.d.ts +2 -1
- package/js/tag/html.js.map +1 -1
- package/js/tag/tag.js.map +1 -1
- package/js/tag/tagElement.d.ts +7 -0
- package/js/tag/tagElement.js +8 -4
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
- package/package.json +1 -1
- package/js/Clones.type.d.ts +0 -3
- package/js/Clones.type.js +0 -2
- package/js/Clones.type.js.map +0 -1
- package/js/ElementTargetEvent.interface.d.ts +0 -6
- package/js/ElementTargetEvent.interface.js +0 -2
- package/js/ElementTargetEvent.interface.js.map +0 -1
- package/js/Tag.class.d.ts +0 -37
- package/js/Tag.class.js +0 -21
- package/js/Tag.class.js.map +0 -1
- package/js/Tag.utils.d.ts +0 -17
- package/js/Tag.utils.js +0 -6
- package/js/Tag.utils.js.map +0 -1
- package/js/TagSupport.class.d.ts +0 -58
- package/js/TagSupport.class.js +0 -309
- package/js/TagSupport.class.js.map +0 -1
- package/js/afterInterpolateElement.function.d.ts +0 -4
- package/js/afterInterpolateElement.function.js +0 -14
- package/js/afterInterpolateElement.function.js.map +0 -1
- package/js/bindSubjectCallback.function.d.ts +0 -7
- package/js/bindSubjectCallback.function.js +0 -41
- package/js/bindSubjectCallback.function.js.map +0 -1
- package/js/checkDestroyPrevious.function.d.ts +0 -8
- package/js/checkDestroyPrevious.function.js +0 -83
- package/js/checkDestroyPrevious.function.js.map +0 -1
- package/js/cloneValueArray.function.d.ts +0 -2
- package/js/cloneValueArray.function.js +0 -19
- package/js/cloneValueArray.function.js.map +0 -1
- package/js/destroy.support.d.ts +0 -6
- package/js/destroy.support.js +0 -10
- package/js/destroy.support.js.map +0 -1
- package/js/destroyTag.function.d.ts +0 -4
- package/js/destroyTag.function.js +0 -12
- package/js/destroyTag.function.js.map +0 -1
- package/js/elementDestroyCheck.function.d.ts +0 -3
- package/js/elementDestroyCheck.function.js +0 -17
- package/js/elementDestroyCheck.function.js.map +0 -1
- package/js/elementInitCheck.d.ts +0 -2
- package/js/elementInitCheck.js +0 -18
- package/js/elementInitCheck.js.map +0 -1
- package/js/getCallback.d.ts +0 -3
- package/js/getCallback.js +0 -51
- package/js/getCallback.js.map +0 -1
- package/js/hasTagSupportChanged.function.d.ts +0 -7
- package/js/hasTagSupportChanged.function.js +0 -70
- package/js/hasTagSupportChanged.function.js.map +0 -1
- package/js/html.d.ts +0 -2
- package/js/html.js +0 -5
- package/js/html.js.map +0 -1
- package/js/inputAttribute.d.ts +0 -1
- package/js/inputAttribute.js +0 -19
- package/js/inputAttribute.js.map +0 -1
- package/js/interpolateAttributes.d.ts +0 -3
- package/js/interpolateAttributes.js +0 -20
- package/js/interpolateAttributes.js.map +0 -1
- package/js/interpolateContentTemplates.d.ts +0 -9
- package/js/interpolateContentTemplates.js +0 -42
- package/js/interpolateContentTemplates.js.map +0 -1
- package/js/interpolateElement.d.ts +0 -13
- package/js/interpolateElement.js +0 -36
- package/js/interpolateElement.js.map +0 -1
- package/js/interpolateTemplate.d.ts +0 -31
- package/js/interpolateTemplate.js +0 -89
- package/js/interpolateTemplate.js.map +0 -1
- package/js/interpolations.d.ts +0 -7
- package/js/interpolations.js +0 -18
- package/js/interpolations.js.map +0 -1
- package/js/isLikeTags.function.d.ts +0 -5
- package/js/isLikeTags.function.js +0 -42
- package/js/isLikeTags.function.js.map +0 -1
- package/js/onDestroy.d.ts +0 -2
- package/js/onDestroy.js +0 -17
- package/js/onDestroy.js.map +0 -1
- package/js/onInit.d.ts +0 -2
- package/js/onInit.js +0 -17
- package/js/onInit.js.map +0 -1
- package/js/processAttribute.function.d.ts +0 -4
- package/js/processAttribute.function.js +0 -122
- package/js/processAttribute.function.js.map +0 -1
- package/js/processNewValue.function.d.ts +0 -3
- package/js/processNewValue.function.js +0 -43
- package/js/processNewValue.function.js.map +0 -1
- package/js/processRegularValue.function.d.ts +0 -5
- package/js/processRegularValue.function.js +0 -15
- package/js/processRegularValue.function.js.map +0 -1
- package/js/processSubjectComponent.function.d.ts +0 -9
- package/js/processSubjectComponent.function.js +0 -35
- package/js/processSubjectComponent.function.js.map +0 -1
- package/js/processSubjectValue.function.d.ts +0 -25
- package/js/processSubjectValue.function.js +0 -55
- package/js/processSubjectValue.function.js.map +0 -1
- package/js/processTag.function.d.ts +0 -11
- package/js/processTag.function.js +0 -43
- package/js/processTag.function.js.map +0 -1
- package/js/processTagArray.d.ts +0 -23
- package/js/processTagArray.js +0 -120
- package/js/processTagArray.js.map +0 -1
- package/js/processTagResult.function.d.ts +0 -11
- package/js/processTagResult.function.js +0 -30
- package/js/processTagResult.function.js.map +0 -1
- package/js/propState.function.d.ts +0 -2
- package/js/propState.function.js +0 -3
- package/js/propState.function.js.map +0 -1
- package/js/provider.utils.d.ts +0 -2
- package/js/provider.utils.js +0 -45
- package/js/provider.utils.js.map +0 -1
- package/js/providers.d.ts +0 -18
- package/js/providers.js +0 -86
- package/js/providers.js.map +0 -1
- package/js/renderExistingTag.function.d.ts +0 -7
- package/js/renderExistingTag.function.js +0 -32
- package/js/renderExistingTag.function.js.map +0 -1
- package/js/renderSubjectComponent.function.d.ts +0 -3
- package/js/renderSubjectComponent.function.js +0 -14
- package/js/renderSubjectComponent.function.js.map +0 -1
- package/js/renderTagOnly.function.d.ts +0 -4
- package/js/renderTagOnly.function.js +0 -39
- package/js/renderTagOnly.function.js.map +0 -1
- package/js/renderTagSupport.function.d.ts +0 -4
- package/js/renderTagSupport.function.js +0 -37
- package/js/renderTagSupport.function.js.map +0 -1
- package/js/renderWithSupport.function.d.ts +0 -5
- package/js/renderWithSupport.function.js +0 -31
- package/js/renderWithSupport.function.js.map +0 -1
- package/js/scanTextAreaValue.function.d.ts +0 -2
- package/js/scanTextAreaValue.function.js +0 -16
- package/js/scanTextAreaValue.function.js.map +0 -1
- package/js/set.function.d.ts +0 -24
- package/js/set.function.js +0 -116
- package/js/set.function.js.map +0 -1
- package/js/setLet.function.d.ts +0 -3
- package/js/setLet.function.js +0 -42
- package/js/setLet.function.js.map +0 -1
- package/js/setProp.function.d.ts +0 -3
- package/js/setProp.function.js +0 -37
- package/js/setProp.function.js.map +0 -1
- package/js/setTagPlaceholder.function.d.ts +0 -2
- package/js/setTagPlaceholder.function.js +0 -8
- package/js/setTagPlaceholder.function.js.map +0 -1
- package/js/setUse.function.d.ts +0 -23
- package/js/setUse.function.js +0 -14
- package/js/setUse.function.js.map +0 -1
- package/js/state/getCallback.d.ts +0 -3
- package/js/state/getCallback.js +0 -51
- package/js/state/getCallback.js.map +0 -1
- package/js/state/setProp.function.d.ts +0 -3
- package/js/state/setProp.function.js +0 -37
- package/js/state/setProp.function.js.map +0 -1
- package/js/tag/updates/processNewValue.function.d.ts +0 -3
- package/js/tag/updates/processNewValue.function.js +0 -43
- package/js/tag/updates/processNewValue.function.js.map +0 -1
- package/js/tag.d.ts +0 -21
- package/js/tag.js +0 -121
- package/js/tag.js.map +0 -1
- package/js/tagElement.d.ts +0 -9
- package/js/tagElement.js +0 -55
- package/js/tagElement.js.map +0 -1
- package/js/tagRunner.d.ts +0 -6
- package/js/tagRunner.js +0 -30
- package/js/tagRunner.js.map +0 -1
- package/js/updateContextItem.function.d.ts +0 -3
- package/js/updateContextItem.function.js +0 -42
- package/js/updateContextItem.function.js.map +0 -1
- package/js/updateExistingTagComponent.function.d.ts +0 -5
- package/js/updateExistingTagComponent.function.js +0 -108
- package/js/updateExistingTagComponent.function.js.map +0 -1
- package/js/updateExistingValue.function.d.ts +0 -4
- package/js/updateExistingValue.function.js +0 -135
- package/js/updateExistingValue.function.js.map +0 -1
- package/js/watch.function.d.ts +0 -3
- package/js/watch.function.js +0 -20
- package/js/watch.function.js.map +0 -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/js/subject/{Subject.utils.d.ts → subject.utils.d.ts} +0 -0
- /package/js/subject/{Subject.utils.js → subject.utils.js} +0 -0
- /package/js/subject/{Subject.utils.js.map → subject.utils.js.map} +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { processSubjectComponent } from './tag/update/processSubjectComponent.function';
|
|
2
|
-
import { isTagArray, isTagClass, isTagComponent, isTagTemplater } from './isInstance';
|
|
3
|
-
import { processTagArray } from './processTagArray';
|
|
4
|
-
import { processRegularValue } from './tag/update/processRegularValue.function';
|
|
5
|
-
import { processTag, tagFakeTemplater } from './processTag.function';
|
|
6
|
-
var ValueTypes;
|
|
7
|
-
(function (ValueTypes) {
|
|
8
|
-
ValueTypes["tag"] = "tag";
|
|
9
|
-
ValueTypes["templater"] = "templater";
|
|
10
|
-
ValueTypes["tagArray"] = "tag-array";
|
|
11
|
-
ValueTypes["tagComponent"] = "tag-component";
|
|
12
|
-
ValueTypes["value"] = "value";
|
|
13
|
-
})(ValueTypes || (ValueTypes = {}));
|
|
14
|
-
function getValueType(value) {
|
|
15
|
-
if (isTagComponent(value)) {
|
|
16
|
-
return ValueTypes.tagComponent;
|
|
17
|
-
}
|
|
18
|
-
if (isTagTemplater(value)) {
|
|
19
|
-
return ValueTypes.templater;
|
|
20
|
-
}
|
|
21
|
-
if (isTagClass(value)) {
|
|
22
|
-
return ValueTypes.tag;
|
|
23
|
-
}
|
|
24
|
-
if (isTagArray(value)) {
|
|
25
|
-
return ValueTypes.tagArray;
|
|
26
|
-
}
|
|
27
|
-
return ValueTypes.value;
|
|
28
|
-
}
|
|
29
|
-
// export type ExistingValue = TemplaterResult | Tag[] | TagSupport | Function | Subject<unknown> | RegularValue | Tag
|
|
30
|
-
export function processSubjectValue(value, subject, // could be tag via result.tag
|
|
31
|
-
insertBefore, // <template end interpolate /> (will be removed)
|
|
32
|
-
ownerSupport, // owner
|
|
33
|
-
options) {
|
|
34
|
-
const valueType = getValueType(value);
|
|
35
|
-
switch (valueType) {
|
|
36
|
-
case ValueTypes.templater:
|
|
37
|
-
processTag(value, insertBefore, ownerSupport, subject);
|
|
38
|
-
return;
|
|
39
|
-
case ValueTypes.tag:
|
|
40
|
-
const tag = value;
|
|
41
|
-
let templater = tag.templater;
|
|
42
|
-
if (!templater) {
|
|
43
|
-
templater = tagFakeTemplater(tag);
|
|
44
|
-
}
|
|
45
|
-
processTag(templater, insertBefore, ownerSupport, subject);
|
|
46
|
-
return;
|
|
47
|
-
case ValueTypes.tagArray:
|
|
48
|
-
return processTagArray(subject, value, insertBefore, ownerSupport, options);
|
|
49
|
-
case ValueTypes.tagComponent:
|
|
50
|
-
processSubjectComponent(value, subject, insertBefore, ownerSupport, options);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
processRegularValue(value, subject, insertBefore);
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=processSubjectValue.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processSubjectValue.function.js","sourceRoot":"","sources":["../ts/processSubjectValue.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACrF,OAAO,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAMpE,OAAO,EAAgB,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE7F,OAAO,EAAoB,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAKtF,IAAK,UAMJ;AAND,WAAK,UAAU;IACb,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,oCAAsB,CAAA;IACtB,4CAA8B,CAAA;IAC9B,6BAAe,CAAA;AACjB,CAAC,EANI,UAAU,KAAV,UAAU,QAMd;AAED,SAAS,YAAY,CAAC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AAC,YAAY;YAC1B,uBAAuB,CACrB,KAAwB,EACxB,OAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,OAAO,CACR,CAAA;YACD,OAAM;IACV,CAAC;IAED,mBAAmB,CACjB,KAAqB,EACrB,OAAyB,EACzB,YAAY,CACb,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InsertBefore } from './Clones.type';
|
|
2
|
-
import { Tag } from './Tag.class';
|
|
3
|
-
import { TagSubject } from './subject.types';
|
|
4
|
-
import { TagSupport } from './tag/TagSupport.class';
|
|
5
|
-
import { TemplaterResult } from './TemplaterResult.class';
|
|
6
|
-
/** Could be a regular tag or a component. Both are Tag.class */
|
|
7
|
-
export declare function processTag(templater: TemplaterResult, insertBefore: InsertBefore, ownerSupport: TagSupport, // owner
|
|
8
|
-
subject: TagSubject): void;
|
|
9
|
-
export declare function setupNewTemplater(tagSupport: TagSupport, ownerSupport: TagSupport, subject: TagSubject): void;
|
|
10
|
-
export declare function tagFakeTemplater(tag: Tag): TemplaterResult;
|
|
11
|
-
export declare function getFakeTemplater(): TemplaterResult;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { TagSupport } from './tag/TagSupport.class';
|
|
2
|
-
import { ValueSubject } from './subject';
|
|
3
|
-
/** Could be a regular tag or a component. Both are Tag.class */
|
|
4
|
-
export function processTag(templater, insertBefore, ownerSupport, // owner
|
|
5
|
-
subject) {
|
|
6
|
-
let tagSupport = subject.tagSupport;
|
|
7
|
-
// first time seeing this tag?
|
|
8
|
-
if (!tagSupport) {
|
|
9
|
-
tagSupport = new TagSupport(templater, ownerSupport, subject);
|
|
10
|
-
setupNewTemplater(tagSupport, ownerSupport, subject);
|
|
11
|
-
ownerSupport.childTags.push(tagSupport);
|
|
12
|
-
}
|
|
13
|
-
subject.tagSupport = tagSupport;
|
|
14
|
-
tagSupport.ownerTagSupport = ownerSupport;
|
|
15
|
-
tagSupport.buildBeforeElement(insertBefore, {
|
|
16
|
-
counts: { added: 0, removed: 0 },
|
|
17
|
-
forceElement: true,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export function setupNewTemplater(tagSupport, ownerSupport, subject) {
|
|
21
|
-
tagSupport.global.oldest = tagSupport;
|
|
22
|
-
tagSupport.global.newest = tagSupport;
|
|
23
|
-
// asking me to render will cause my parent to render
|
|
24
|
-
tagSupport.ownerTagSupport = ownerSupport;
|
|
25
|
-
subject.tagSupport = tagSupport;
|
|
26
|
-
}
|
|
27
|
-
export function tagFakeTemplater(tag) {
|
|
28
|
-
const templater = getFakeTemplater();
|
|
29
|
-
templater.tag = tag;
|
|
30
|
-
tag.templater = templater;
|
|
31
|
-
return templater;
|
|
32
|
-
}
|
|
33
|
-
export function getFakeTemplater() {
|
|
34
|
-
return {
|
|
35
|
-
children: new ValueSubject([]), // no children
|
|
36
|
-
props: {},
|
|
37
|
-
isTag: true,
|
|
38
|
-
isTemplater: false,
|
|
39
|
-
tagged: false,
|
|
40
|
-
// wrapper: (() => undefined) as unknown as Wrapper,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=processTag.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processTag.function.js","sourceRoot":"","sources":["../ts/processTag.function.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAGxC,gEAAgE;AAChE,MAAM,UAAU,UAAU,CACxB,SAA0B,EAC1B,YAA0B,EAC1B,YAAwB,EAAE,QAAQ;AAClC,OAAmB;IAEnB,IAAI,UAAU,GAAe,OAAO,CAAC,UAAU,CAAA;IAE/C,8BAA8B;IAC9B,IAAG,CAAC,UAAU,EAAE,CAAC;QACf,UAAU,GAAG,IAAI,UAAU,CACzB,SAAS,EACT,YAAY,EACZ,OAAO,CACR,CAAA;QAED,iBAAiB,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAA;QAEpD,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,CAAC,UAAU,GAAG,UAAU,CAAA;IAC/B,UAAU,CAAC,eAAe,GAAG,YAAY,CAAA;IACzC,UAAU,CAAC,kBAAkB,CAC3B,YAAY,EAAE;QACZ,MAAM,EAAE,EAAC,KAAK,EAAC,CAAC,EAAE,OAAO,EAAC,CAAC,EAAC;QAC5B,YAAY,EAAE,IAAI;KACnB,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,UAAsB,EACtB,YAAwB,EACxB,OAAmB;IAEnB,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,UAAU,CAAA;IACrC,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,UAAU,CAAA;IAErC,qDAAqD;IACrD,UAAU,CAAC,eAAe,GAAG,YAAY,CAAA;IACzC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,GAAQ;IAER,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAA;IACpC,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;IACnB,GAAG,CAAC,SAAS,GAAG,SAAS,CAAA;IAEzB,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAQ;QACN,QAAQ,EAAE,IAAI,YAAY,CAAQ,EAAE,CAAC,EAAE,cAAc;QACrD,KAAK,EAAE,EAAW;QAElB,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,KAAK;QACb,oDAAoD;KAClC,CAAA;AACtB,CAAC"}
|
package/js/processTagArray.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Clones, InsertBefore } from './Clones.type';
|
|
2
|
-
import { Tag } from './Tag.class';
|
|
3
|
-
import { ValueSubject } from './subject/ValueSubject';
|
|
4
|
-
import { Counts } from './interpolations/interpolateTemplate';
|
|
5
|
-
import { TagSupport } from './tag/TagSupport.class';
|
|
6
|
-
import { TemplaterResult } from './TemplaterResult.class';
|
|
7
|
-
export type LastArrayItem = {
|
|
8
|
-
tagSupport: TagSupport;
|
|
9
|
-
index: number;
|
|
10
|
-
deleted?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type TagArraySubject = ValueSubject<Tag[]> & {
|
|
13
|
-
insertBefore: InsertBefore;
|
|
14
|
-
placeholder?: Text;
|
|
15
|
-
lastArray?: LastArrayItem[];
|
|
16
|
-
isChildSubject?: boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare function processTagArray(subject: TagArraySubject, value: (TemplaterResult | Tag)[], // arry of Tag classes
|
|
19
|
-
insertBefore: InsertBefore, // <template end interpolate />
|
|
20
|
-
ownerSupport: TagSupport, options: {
|
|
21
|
-
counts: Counts;
|
|
22
|
-
forceElement?: boolean;
|
|
23
|
-
}): Clones;
|
package/js/processTagArray.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { ValueSubject } from './subject/ValueSubject';
|
|
2
|
-
import { ArrayNoKeyError } from './errors';
|
|
3
|
-
import { destroyArrayTag } from './checkDestroyPrevious.function';
|
|
4
|
-
import { setupNewTemplater, tagFakeTemplater } from './tag/update/processTag.function';
|
|
5
|
-
import { TagSupport } from './tag/TagSupport.class';
|
|
6
|
-
import { isTagClass } from './isInstance';
|
|
7
|
-
export function processTagArray(subject, value, // arry of Tag classes
|
|
8
|
-
insertBefore, // <template end interpolate />
|
|
9
|
-
ownerSupport, options) {
|
|
10
|
-
const clones = ownerSupport.clones; // []
|
|
11
|
-
let lastArray = subject.lastArray = subject.lastArray || [];
|
|
12
|
-
if (!subject.placeholder) {
|
|
13
|
-
setPlaceholderElm(insertBefore, subject);
|
|
14
|
-
}
|
|
15
|
-
const runtimeInsertBefore = subject.placeholder; // || insertBefore
|
|
16
|
-
let removed = 0;
|
|
17
|
-
/** 🗑️ remove previous items first */
|
|
18
|
-
lastArray = subject.lastArray = subject.lastArray.filter((item, index) => {
|
|
19
|
-
const newLength = value.length - 1;
|
|
20
|
-
const at = index - removed;
|
|
21
|
-
const lessLength = newLength < at;
|
|
22
|
-
const subValue = value[index - removed];
|
|
23
|
-
const subTag = subValue;
|
|
24
|
-
// const tag = subTag?.templater.tag as Tag
|
|
25
|
-
const lastTag = item.tagSupport.templater.tag;
|
|
26
|
-
const newArrayValue = subTag?.memory.arrayValue;
|
|
27
|
-
const lastArrayValue = lastTag.memory.arrayValue;
|
|
28
|
-
const destroyItem = lessLength || !areLikeValues(newArrayValue, lastArrayValue);
|
|
29
|
-
if (destroyItem) {
|
|
30
|
-
const last = lastArray[index];
|
|
31
|
-
const tagSupport = last.tagSupport;
|
|
32
|
-
destroyArrayTag(tagSupport, options.counts);
|
|
33
|
-
last.deleted = true;
|
|
34
|
-
++removed;
|
|
35
|
-
++options.counts.removed;
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
});
|
|
40
|
-
value.forEach((item, index) => {
|
|
41
|
-
const previous = lastArray[index];
|
|
42
|
-
const previousSupport = previous?.tagSupport;
|
|
43
|
-
const subTag = item;
|
|
44
|
-
if (isTagClass(subTag) && !subTag.templater) {
|
|
45
|
-
tagFakeTemplater(subTag);
|
|
46
|
-
}
|
|
47
|
-
const tagSupport = new TagSupport(subTag.templater, ownerSupport, new ValueSubject(undefined));
|
|
48
|
-
// tagSupport.templater = subTag.templater
|
|
49
|
-
if (previousSupport) {
|
|
50
|
-
setupNewTemplater(tagSupport, ownerSupport, previousSupport.subject);
|
|
51
|
-
const global = previousSupport.global;
|
|
52
|
-
tagSupport.global = global;
|
|
53
|
-
global.newest = tagSupport;
|
|
54
|
-
}
|
|
55
|
-
// check for html``.key()
|
|
56
|
-
const keySet = 'arrayValue' in subTag.memory;
|
|
57
|
-
if (!keySet) {
|
|
58
|
-
const details = {
|
|
59
|
-
template: tagSupport.getTemplate().string,
|
|
60
|
-
array: value,
|
|
61
|
-
ownerTagContent: ownerSupport.lastTemplateString,
|
|
62
|
-
};
|
|
63
|
-
const message = 'Use html`...`.key(item) instead of html`...` to template an Array';
|
|
64
|
-
console.error(message, details);
|
|
65
|
-
const err = new ArrayNoKeyError(message, details);
|
|
66
|
-
throw err;
|
|
67
|
-
}
|
|
68
|
-
const couldBeSame = lastArray.length > index;
|
|
69
|
-
if (couldBeSame) {
|
|
70
|
-
const prevSupport = previous.tagSupport;
|
|
71
|
-
const prevGlobal = prevSupport.global;
|
|
72
|
-
// subTag.tagSupport = subTag.tagSupport || prevSupport
|
|
73
|
-
const oldest = prevGlobal.oldest;
|
|
74
|
-
oldest.updateBy(tagSupport);
|
|
75
|
-
return [];
|
|
76
|
-
}
|
|
77
|
-
processAddTagArrayItem(runtimeInsertBefore, tagSupport, index, options, lastArray);
|
|
78
|
-
ownerSupport.childTags.push(tagSupport);
|
|
79
|
-
});
|
|
80
|
-
return clones;
|
|
81
|
-
}
|
|
82
|
-
function setPlaceholderElm(insertBefore, subject) {
|
|
83
|
-
if (insertBefore.nodeName !== 'TEMPLATE') {
|
|
84
|
-
subject.placeholder = insertBefore;
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const placeholder = subject.placeholder = document.createTextNode('');
|
|
88
|
-
const parentNode = insertBefore.parentNode;
|
|
89
|
-
parentNode.insertBefore(placeholder, insertBefore);
|
|
90
|
-
parentNode.removeChild(insertBefore);
|
|
91
|
-
}
|
|
92
|
-
function processAddTagArrayItem(before, tagSupport, index, options, lastArray) {
|
|
93
|
-
const lastValue = {
|
|
94
|
-
tagSupport, index
|
|
95
|
-
};
|
|
96
|
-
// Added to previous array
|
|
97
|
-
lastArray.push(lastValue);
|
|
98
|
-
const counts = {
|
|
99
|
-
added: options.counts.added + index,
|
|
100
|
-
removed: options.counts.removed,
|
|
101
|
-
};
|
|
102
|
-
const newTempElm = document.createElement('template');
|
|
103
|
-
const parent = before.parentNode;
|
|
104
|
-
parent.insertBefore(newTempElm, before);
|
|
105
|
-
tagSupport.buildBeforeElement(newTempElm, // before,
|
|
106
|
-
{ counts, forceElement: options.forceElement });
|
|
107
|
-
}
|
|
108
|
-
/** compare two values. If both values are arrays then the items will be compared */
|
|
109
|
-
function areLikeValues(valueA, valueB) {
|
|
110
|
-
if (valueA === valueB) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
const bothArrays = valueA instanceof Array && valueB instanceof Array;
|
|
114
|
-
const matchLengths = bothArrays && valueA.length == valueB.length;
|
|
115
|
-
if (matchLengths) {
|
|
116
|
-
return valueA.every((item, index) => item == valueB[index]);
|
|
117
|
-
}
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=processTagArray.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processTagArray.js","sourceRoot":"","sources":["../ts/processTagArray.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAgBzC,MAAM,UAAU,eAAe,CAC7B,OAAwB,EACxB,KAAgC,EAAE,sBAAsB;AACxD,YAA0B,EAAE,+BAA+B;AAC3D,YAAwB,EACxB,OAGC;IAED,MAAM,MAAM,GAAW,YAAY,CAAC,MAAM,CAAA,CAAC,KAAK;IAChD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAA;IAE3D,IAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;Q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KAAK;QACnC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;KAChC,CAAA;IAED,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,UAAwB,CAAA;IAC9C,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAEvC,UAAU,CAAC,kBAAkB,CAC3B,UAAU,EAAE,UAAU;IACtB,EAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAC,CAC7C,CAAA;AACH,CAAC;AAED,oFAAoF;AACpF,SAAS,aAAa,CAAC,MAAe,EAAE,MAAe;IACrD,IAAG,MAAM,KAAK,MAAM,EAAE,CAAC;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,YAAY,KAAK,IAAI,MAAM,YAAY,KAAK,CAAA;IACrE,MAAM,YAAY,GAAG,UAAU,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAA;IACjE,IAAG,YAAY,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7D,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Counts } from './interpolations/interpolateTemplate';
|
|
2
|
-
import { TagArraySubject } from './tag/update/processTagArray';
|
|
3
|
-
import { TagSubject } from './subject.types';
|
|
4
|
-
import { InsertBefore } from './Clones.type';
|
|
5
|
-
import { TagSupport } from './tag/TagSupport.class';
|
|
6
|
-
export declare function processTagResult(tagSupport: TagSupport, subject: TagArraySubject | TagSubject | Function, // used for recording past and current value
|
|
7
|
-
insertBefore: InsertBefore, // <template end interpolate />
|
|
8
|
-
{ counts, forceElement, }: {
|
|
9
|
-
counts: Counts;
|
|
10
|
-
forceElement?: boolean;
|
|
11
|
-
}): void;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export function processTagResult(tagSupport, subject, // used for recording past and current value
|
|
2
|
-
insertBefore, // <template end interpolate />
|
|
3
|
-
{ counts, forceElement, }) {
|
|
4
|
-
// *if appears we already have seen
|
|
5
|
-
const subjectTag = subject;
|
|
6
|
-
const lastSupport = subjectTag.tagSupport;
|
|
7
|
-
const prevSupport = lastSupport?.global.oldest || undefined; // || tag.tagSupport.oldest // subjectTag.tag
|
|
8
|
-
const justUpdate = prevSupport; // && !forceElement
|
|
9
|
-
if (prevSupport && justUpdate) {
|
|
10
|
-
return processTagResultUpdate(tagSupport, subjectTag, prevSupport);
|
|
11
|
-
}
|
|
12
|
-
tagSupport.buildBeforeElement(insertBefore, {
|
|
13
|
-
counts,
|
|
14
|
-
forceElement,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function processTagResultUpdate(tagSupport, subject, // used for recording past and current value
|
|
18
|
-
prevSupport) {
|
|
19
|
-
// components
|
|
20
|
-
if (subject instanceof Function) {
|
|
21
|
-
const newSupport = subject(prevSupport);
|
|
22
|
-
prevSupport.updateBy(newSupport);
|
|
23
|
-
subject.tagSupport = newSupport;
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
prevSupport.updateBy(tagSupport);
|
|
27
|
-
subject.tagSupport = tagSupport;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=processTagResult.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processTagResult.function.js","sourceRoot":"","sources":["../ts/processTagResult.function.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,gBAAgB,CAC9B,UAAsB,EACtB,OAAgD,EAAE,4CAA4C;AAC9F,YAA0B,EAAE,+BAA+B;AAC3D,EACE,MAAM,EAAE,YAAY,GAIrB;IAED,mCAAmC;IACnC,MAAM,UAAU,GAAG,OAAqB,CAAA;IACxC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAA;IACzC,MAAM,WAAW,GAAG,WAAW,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS,CAAA,CAAC,6CAA6C;IACzG,MAAM,UAAU,GAAG,WAAW,CAAA,CAAC,mBAAmB;IAElD,IAAG,WAAW,IAAI,UAAU,EAAE,CAAC;QAC7B,OAAO,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;IACpE,CAAC;IAED,UAAU,CAAC,kBAAkB,CAAC,YAAY,EAAE;QAC1C,MAAM;QACN,YAAY;KACb,CAAC,CAAA;AACJ,CAAC;AAGD,SAAS,sBAAsB,CAC7B,UAAsB,EACtB,OAAqD,EAAE,4CAA4C;AACnG,WAAuB;IAEvB,aAAa;IACb,IAAG,OAAO,YAAY,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;QACvC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAE/B;QAAC,OAAiC,CAAC,UAAU,GAAG,UAAU,CAAA;QAC3D,OAAM;IACR,CAAC;IAED,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAChC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAA;IAE/B,OAAM;AACR,CAAC"}
|
package/js/propState.function.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propState.function.js","sourceRoot":"","sources":["../ts/propState.function.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CACvB,cAAiB,EACjB,MAAiB;AAGnB,CAAC"}
|
package/js/provider.utils.d.ts
DELETED
package/js/provider.utils.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { deepClone, deepEqual } from './deepFunctions';
|
|
2
|
-
import { renderTagSupport } from './renderTagSupport.function';
|
|
3
|
-
export function providersChangeCheck(tag) {
|
|
4
|
-
const global = tag.tagSupport.templater.global;
|
|
5
|
-
const providersWithChanges = global.providers.filter(provider => !deepEqual(provider.instance, provider.clone));
|
|
6
|
-
// reset clones
|
|
7
|
-
providersWithChanges.forEach(provider => {
|
|
8
|
-
const appElement = tag.getAppElement();
|
|
9
|
-
handleProviderChanges(appElement, provider);
|
|
10
|
-
provider.clone = deepClone(provider.instance);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function handleProviderChanges(appElement, provider) {
|
|
14
|
-
const tagsWithProvider = getTagsWithProvider(appElement, provider);
|
|
15
|
-
tagsWithProvider.forEach(({ tag, renderCount, provider }) => {
|
|
16
|
-
if (tag.tagSupport.templater.global.deleted) {
|
|
17
|
-
return; // i was deleted after another tag processed
|
|
18
|
-
}
|
|
19
|
-
const notRendered = renderCount === tag.tagSupport.templater.global.renderCount;
|
|
20
|
-
if (notRendered) {
|
|
21
|
-
provider.clone = deepClone(provider.instance);
|
|
22
|
-
renderTagSupport(tag.tagSupport, false);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function getTagsWithProvider(tag, provider, memory = []) {
|
|
27
|
-
const global = tag.tagSupport.templater.global;
|
|
28
|
-
const compare = global.providers;
|
|
29
|
-
const hasProvider = compare.find(xProvider => xProvider.constructMethod === provider.constructMethod);
|
|
30
|
-
if (hasProvider) {
|
|
31
|
-
memory.push({
|
|
32
|
-
tag,
|
|
33
|
-
renderCount: global.renderCount,
|
|
34
|
-
provider: hasProvider,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
tag.childTags.forEach(child => getTagsWithProvider(child, provider, memory));
|
|
38
|
-
memory.forEach(({ tag }) => {
|
|
39
|
-
if (tag.tagSupport.templater.global.deleted) {
|
|
40
|
-
throw new Error('do not get here - 0');
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return memory;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=provider.utils.js.map
|
package/js/provider.utils.js.map
DELETED
|
@@ -1 +0,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,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;YAC7C,gBAAgB,CACd,GAAG,CAAC,UAAU,EACd,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,GAAQ,EACR,QAAkB,EAClB,SAA4B,EAAE;IAE9B,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAA;IAChC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAC9B,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,KAAK,QAAQ,CAAC,eAAe,CACpE,CAAA;IAED,IAAG,WAAW,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC;YACV,GAAG;YACH,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,QAAQ,EAAE,WAAW;SACtB,CAAC,CAAA;IACJ,CAAC;IAED,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAChD,KAAK,EACL,QAAQ,EACR,MAAM,CACP,CAAC,CAAA;IAEF,MAAM,CAAC,OAAO,CAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAE;QACvB,IAAG,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;QACxC,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/js/providers.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type Provider = {
|
|
2
|
-
constructMethod: any;
|
|
3
|
-
instance: any;
|
|
4
|
-
clone: any;
|
|
5
|
-
};
|
|
6
|
-
type ProviderConstructor<T> = (new (...args: any[]) => T) | (() => T);
|
|
7
|
-
type functionProvider = <T>() => T;
|
|
8
|
-
type classProvider = new <T>(...args: any[]) => T;
|
|
9
|
-
export declare const providers: {
|
|
10
|
-
create: <T>(constructMethod: classProvider | functionProvider) => T;
|
|
11
|
-
/**
|
|
12
|
-
* @template T
|
|
13
|
-
* @param {(new (...args: any[]) => T) | () => T} constructor
|
|
14
|
-
* @returns {T}
|
|
15
|
-
*/
|
|
16
|
-
inject: <T_1>(constructor: ProviderConstructor<T_1>) => T_1;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
package/js/providers.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { deepClone } from './deepFunctions';
|
|
2
|
-
import { setUse } from './setUse.function';
|
|
3
|
-
// TODO: rename
|
|
4
|
-
setUse.memory.providerConfig = {
|
|
5
|
-
providers: [],
|
|
6
|
-
//currentTagSupport: undefined as TagSupport | undefined,
|
|
7
|
-
ownerTag: undefined,
|
|
8
|
-
};
|
|
9
|
-
function get(constructMethod) {
|
|
10
|
-
const config = setUse.memory.providerConfig;
|
|
11
|
-
const providers = config.providers;
|
|
12
|
-
return providers.find(provider => provider.constructMethod === constructMethod);
|
|
13
|
-
}
|
|
14
|
-
export const providers = {
|
|
15
|
-
create: (constructMethod) => {
|
|
16
|
-
const existing = get(constructMethod);
|
|
17
|
-
if (existing) {
|
|
18
|
-
existing.clone = deepClone(existing.instance);
|
|
19
|
-
return existing.instance;
|
|
20
|
-
}
|
|
21
|
-
// Providers with provider requirements just need to use providers.create() and providers.inject()
|
|
22
|
-
const instance = constructMethod.constructor ? new constructMethod() : constructMethod();
|
|
23
|
-
const config = setUse.memory.providerConfig;
|
|
24
|
-
config.providers.push({
|
|
25
|
-
constructMethod,
|
|
26
|
-
instance,
|
|
27
|
-
clone: deepClone(instance)
|
|
28
|
-
});
|
|
29
|
-
return instance;
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* @template T
|
|
33
|
-
* @param {(new (...args: any[]) => T) | () => T} constructor
|
|
34
|
-
* @returns {T}
|
|
35
|
-
*/
|
|
36
|
-
inject: (constructor) => {
|
|
37
|
-
const oldValue = get(constructor);
|
|
38
|
-
if (oldValue) {
|
|
39
|
-
return oldValue.instance;
|
|
40
|
-
}
|
|
41
|
-
const config = setUse.memory.providerConfig;
|
|
42
|
-
let owner = {
|
|
43
|
-
ownerTag: config.ownerTag
|
|
44
|
-
};
|
|
45
|
-
while (owner.ownerTag) {
|
|
46
|
-
const ownerProviders = owner.ownerTag.tagSupport.templater.global.providers;
|
|
47
|
-
const provider = ownerProviders.find(provider => {
|
|
48
|
-
if (provider.constructMethod === constructor) {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
if (provider) {
|
|
53
|
-
provider.clone = deepClone(provider.instance); // keep a copy of the latest before any change occur
|
|
54
|
-
config.providers.push(provider);
|
|
55
|
-
return provider.instance;
|
|
56
|
-
}
|
|
57
|
-
owner = owner.ownerTag; // cause reloop
|
|
58
|
-
}
|
|
59
|
-
const msg = `Could not inject provider: ${constructor.name} ${constructor}`;
|
|
60
|
-
console.warn(`${msg}. Available providers`, config.providers);
|
|
61
|
-
throw new Error(msg);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
setUse({
|
|
65
|
-
beforeRender: (tagSupport, ownerTag) => {
|
|
66
|
-
run(tagSupport, ownerTag);
|
|
67
|
-
},
|
|
68
|
-
beforeRedraw: (tagSupport, tag) => {
|
|
69
|
-
run(tagSupport, tag.ownerTag);
|
|
70
|
-
},
|
|
71
|
-
afterRender: (tagSupport) => {
|
|
72
|
-
const config = setUse.memory.providerConfig;
|
|
73
|
-
tagSupport.templater.global.providers = [...config.providers];
|
|
74
|
-
config.providers.length = 0;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
function run(tagSupport, ownerTag) {
|
|
78
|
-
const config = setUse.memory.providerConfig;
|
|
79
|
-
// config.currentTagSupport = tagSupport
|
|
80
|
-
config.ownerTag = ownerTag;
|
|
81
|
-
if (tagSupport.templater.global.providers.length) {
|
|
82
|
-
config.providers.length = 0;
|
|
83
|
-
config.providers.push(...tagSupport.templater.global.providers);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=providers.js.map
|
package/js/providers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../ts/providers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAU1C,eAAe;AACf,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG;IAC7B,SAAS,EAAE,EAAgB;IAE3B,yDAAyD;IACzD,QAAQ,EAAE,SAA4B;CACvC,CAAA;AAED,SAAS,GAAG,CAAC,eAAyB;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAA;IAC3C,MAAM,SAAS,GAAe,MAAM,CAAC,SAAS,CAAA;IAC9C,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,eAAe,KAAK,eAAe,CAAC,CAAA;AACjF,CAAC;AAKD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,CACN,eAAiD,EAC9C,EAAE;QACL,MAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,CAAC,CAAA;QACrC,IAAG,QAAQ,EAAE,CAAC;YACZ,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;YAC7C,OAAO,QAAQ,CAAC,QAAQ,CAAA;QAC1B,CAAC;QAED,kGAAkG;QAClG,MAAM,QAAQ,GAAM,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,IAAK,eAAiC,EAAE,CAAC,CAAC,CAAE,eAAoC,EAAE,CAAA;QAEpI,MAAM,MAAM,GAAG,MAAM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.types';
|
|
3
|
-
/** Returns true when rendering owner is not needed. Returns false when rendering owner should occur */
|
|
4
|
-
export declare function renderExistingTag(oldestSupport: TagSupport, // oldest with elements on html
|
|
5
|
-
newSupport: TagSupport, // new to be rendered
|
|
6
|
-
ownerSupport: BaseTagSupport, // ownerSupport
|
|
7
|
-
subject: TagSubject): TagSupport;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { providersChangeCheck } from './state/provider.utils';
|
|
2
|
-
import { isLikeTags } from './tag/isLikeTags.function';
|
|
3
|
-
import { renderWithSupport } from './renderWithSupport.function';
|
|
4
|
-
/** Returns true when rendering owner is not needed. Returns false when rendering owner should occur */
|
|
5
|
-
export function renderExistingTag(oldestSupport, // oldest with elements on html
|
|
6
|
-
newSupport, // new to be rendered
|
|
7
|
-
ownerSupport, // ownerSupport
|
|
8
|
-
subject) {
|
|
9
|
-
const lastSupport = subject.tagSupport;
|
|
10
|
-
const global = lastSupport.global;
|
|
11
|
-
// share point between renders
|
|
12
|
-
newSupport.global = global;
|
|
13
|
-
const preRenderCount = global.renderCount;
|
|
14
|
-
providersChangeCheck(oldestSupport);
|
|
15
|
-
// When the providers were checked, a render to myself occurred and I do not need to re-render again
|
|
16
|
-
const prevSupport = global.newest;
|
|
17
|
-
if (preRenderCount !== global.renderCount) {
|
|
18
|
-
oldestSupport.updateBy(prevSupport);
|
|
19
|
-
return prevSupport; // already rendered during triggered events
|
|
20
|
-
}
|
|
21
|
-
const toRedrawTag = prevSupport || lastSupport || global.oldest;
|
|
22
|
-
const reSupport = renderWithSupport(newSupport, toRedrawTag, subject, ownerSupport);
|
|
23
|
-
const oldest = global.oldest || oldestSupport;
|
|
24
|
-
reSupport.global.oldest = oldest;
|
|
25
|
-
// TODO: renderWithSupport already does an isLikeTags compare
|
|
26
|
-
if (isLikeTags(prevSupport, reSupport)) {
|
|
27
|
-
subject.tagSupport = reSupport;
|
|
28
|
-
oldest.updateBy(reSupport);
|
|
29
|
-
}
|
|
30
|
-
return reSupport;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=renderExistingTag.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderExistingTag.function.js","sourceRoot":"","sources":["../ts/renderExistingTag.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,uGAAuG;AACvG,MAAM,UAAU,iBAAiB,CAC/B,aAAyB,EAAE,+BAA+B;AAC1D,UAAsB,EAAE,qBAAqB;AAC7C,YAA4B,EAAE,eAAe;AAC7C,OAAmB;IAEnB,MAAM,WAAW,GAAG,OAAO,CAAC,UAAwB,CAAA;IACpD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;IAEjC,8BAA8B;IAC9B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAA;IAE1B,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAA;IACzC,oBAAoB,CAAC,aAAa,CAAC,CAAA;IAEnC,oGAAoG;IACpG,MAAM,WAAW,GAAG,MAAM,CAAC,MAAoB,CAAA;IAC/C,IAAG,cAAc,KAAK,MAAM,CAAC,WAAW,EAAE,CAAC;QACzC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QACnC,OAAO,WAAW,CAAA,CAAC,2CAA2C;IAChE,CAAC;IAED,MAAM,WAAW,GAAG,WAAW,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAA;IAE/D,MAAM,SAAS,GAAG,iBAAiB,CACjC,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAA0B,CAC3B,CAAA;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,aAAa,CAAA;IAC7C,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;IAEhC,6DAA6D;IAC7D,IAAG,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,UAAU,GAAG,SAAS,CAAA;QAC9B,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { renderWithSupport } from './tag/render/renderWithSupport.function';
|
|
2
|
-
export function renderSubjectComponent(subject, reSupport, ownerSupport) {
|
|
3
|
-
const preClones = ownerSupport.clones.map(clone => clone);
|
|
4
|
-
reSupport = renderWithSupport(reSupport, subject.tagSupport, // existing tag
|
|
5
|
-
subject, ownerSupport);
|
|
6
|
-
reSupport.global.newest = reSupport;
|
|
7
|
-
if (ownerSupport.clones.length > preClones.length) {
|
|
8
|
-
const myClones = ownerSupport.clones.filter(fClone => !preClones.find(clone => clone === fClone));
|
|
9
|
-
reSupport.clones.push(...myClones);
|
|
10
|
-
}
|
|
11
|
-
ownerSupport.childTags.push(reSupport);
|
|
12
|
-
return reSupport;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=renderSubjectComponent.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderSubjectComponent.function.js","sourceRoot":"","sources":["../ts/renderSubjectComponent.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAI3E,MAAM,UAAU,sBAAsB,CACpC,OAAmB,EACnB,SAAqB,EACrB,YAAwB;IAExB,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IAEzD,SAAS,GAAG,iBAAiB,CAC3B,SAAS,EACT,OAAO,CAAC,UAAU,EAAE,eAAe;IACnC,OAAO,EACP,YAAY,CACb,CAAA;IAED,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAA;IAEnC,IAAG,YAAY,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAA;QACjG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA;IACpC,CAAC;IAED,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAEtC,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { runBeforeRedraw, runBeforeRender } from './tag/tagRunner';
|
|
2
|
-
import { setUse } from './state';
|
|
3
|
-
import { runAfterRender } from './tag/tagRunner';
|
|
4
|
-
export function renderTagOnly(tagSupport, // new
|
|
5
|
-
lastSupport, subject, ownerSupport) {
|
|
6
|
-
const oldRenderCount = tagSupport.global.renderCount;
|
|
7
|
-
beforeWithRender(tagSupport, ownerSupport, lastSupport);
|
|
8
|
-
const templater = tagSupport.templater;
|
|
9
|
-
// NEW TAG CREATED HERE
|
|
10
|
-
const wrapper = templater.wrapper;
|
|
11
|
-
const reSupport = wrapper(tagSupport, subject);
|
|
12
|
-
/* AFTER */
|
|
13
|
-
runAfterRender(tagSupport, reSupport);
|
|
14
|
-
// When we rendered, only 1 render should have taken place OTHERWISE rendering caused another render and that is the latest instead
|
|
15
|
-
if (reSupport.global.renderCount > oldRenderCount + 1) {
|
|
16
|
-
return tagSupport.global.newest;
|
|
17
|
-
}
|
|
18
|
-
tagSupport.global.newest = reSupport;
|
|
19
|
-
return reSupport;
|
|
20
|
-
}
|
|
21
|
-
function beforeWithRender(tagSupport, ownerSupport, lastSupport) {
|
|
22
|
-
const lastOwnerSupport = lastSupport?.ownerTagSupport;
|
|
23
|
-
const runtimeOwnerSupport = lastOwnerSupport || ownerSupport;
|
|
24
|
-
if (lastSupport) {
|
|
25
|
-
const lastState = lastSupport.memory.state;
|
|
26
|
-
const memory = tagSupport.memory;
|
|
27
|
-
memory.state = [...lastState];
|
|
28
|
-
tagSupport.global = lastSupport.global;
|
|
29
|
-
runBeforeRedraw(tagSupport, lastSupport);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// first time render
|
|
33
|
-
runBeforeRender(tagSupport, runtimeOwnerSupport);
|
|
34
|
-
// TODO: Logic below most likely could live within providers.ts inside the runBeforeRender function
|
|
35
|
-
const providers = setUse.memory.providerConfig;
|
|
36
|
-
providers.ownerSupport = runtimeOwnerSupport;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=renderTagOnly.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderTagOnly.function.js","sourceRoot":"","sources":["../ts/renderTagOnly.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIhD,MAAM,UAAU,aAAa,CAC3B,UAAsB,EAAE,MAAM;AAC9B,WAAmC,EACnC,OAAmB,EACnB,YAAyB;IAEzB,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,WAAW,CAAA;IAEpD,gBAAgB,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;IAEvD,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;IAEtC,uBAAuB;IACvB,MAAM,OAAO,GAAG,SAAS,CAAC,OAAkB,CAAA;IAC5C,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IAC9C,WAAW;IAEX,cAAc,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;IAErC,mIAAmI;IACnI,IAAG,SAAS,CAAC,MAAM,CAAC,WAAW,GAAG,cAAc,GAAG,CAAC,EAAE,CAAC;QACrD,OAAO,UAAU,CAAC,MAAM,CAAC,MAAoB,CAAA;IAC/C,CAAC;IAED,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAA;IAEpC,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,gBAAgB,CACvB,UAA0B,EAC1B,YAAyB,EACzB,WAAwB;IAExB,MAAM,gBAAgB,GAAG,WAAW,EAAE,eAAe,CAAA;IACrD,MAAM,mBAAmB,GAA2B,gBAAgB,IAAI,YAAY,CAAA;IAEpF,IAAG,WAAW,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAA;QAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;QAChC,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC,CAAA;QAC7B,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;QAEtC,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,oBAAoB;QACpB,eAAe,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA;QAEhD,mGAAmG;QACnG,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAA;QAC9C,SAAS,CAAC,YAAY,GAAG,mBAAmB,CAAA;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { TagSupport } from './tag/TagSupport.class';
|
|
2
|
-
/** Main function used by all other callers to render/update display of a tag component */
|
|
3
|
-
export declare function renderTagSupport(tagSupport: TagSupport, // must be latest/newest state render
|
|
4
|
-
renderUp: boolean): TagSupport;
|