taggedjs 2.8.36 → 2.8.37
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 +1 -1
- package/bundle.js.map +1 -1
- package/js/interpolations/attributes/addSupportEventListener.function.js +1 -1
- package/js/interpolations/attributes/bindSubjectCallback.function.d.ts +1 -6
- package/js/interpolations/attributes/bindSubjectCallback.function.js +22 -43
- package/js/interpolations/attributes/bindSubjectCallback.function.js.map +1 -1
- package/js/interpolations/attributes/checkToResolvePromise.function.d.ts +8 -0
- package/js/interpolations/attributes/checkToResolvePromise.function.js +34 -0
- package/js/interpolations/attributes/checkToResolvePromise.function.js.map +1 -0
- package/js/interpolations/attributes/getSupportWithState.function.js +1 -1
- package/js/interpolations/attributes/getUpTags.function.js +4 -3
- package/js/interpolations/attributes/getUpTags.function.js.map +1 -1
- package/js/interpolations/attributes/isSpecialAttribute.function.d.ts +2 -2
- package/js/interpolations/attributes/isSpecialAttribute.function.js +2 -2
- package/js/interpolations/attributes/isSpecialAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.js +0 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/renderTagArray.function.js +1 -1
- package/js/interpolations/attributes/specialAttribute.js +1 -1
- package/js/interpolations/optimizers/domProcessContextItem.function.js +4 -6
- package/js/interpolations/optimizers/domProcessContextItem.function.js.map +1 -1
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js +0 -11
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js.map +1 -1
- package/js/jsTagVar/array.function.d.ts +2 -0
- package/js/jsTagVar/array.function.js +10 -0
- package/js/jsTagVar/array.function.js.map +1 -0
- package/js/jsTagVar/signal.function.d.ts +15 -0
- package/js/jsTagVar/signal.function.js +47 -0
- package/js/jsTagVar/signal.function.js.map +1 -0
- package/js/render/afterRender.function.js +1 -1
- package/js/render/attributes/createDynamicAttribute.function.js +8 -2
- package/js/render/attributes/createDynamicAttribute.function.js.map +1 -1
- package/js/render/attributes/getTagJsVar.function.js.map +1 -1
- package/js/render/attributes/processAttribute.function.d.ts +3 -1
- package/js/render/attributes/processAttribute.function.js +17 -2
- package/js/render/attributes/processAttribute.function.js.map +1 -1
- package/js/render/attributes/processUpdateAttrContext.function.d.ts +2 -1
- package/js/render/attributes/processUpdateAttrContext.function.js.map +1 -1
- package/js/render/buildBeforeElement.function.js +7 -5
- package/js/render/buildBeforeElement.function.js.map +1 -1
- package/js/render/destroySupport.function.js +2 -2
- package/js/render/destroySupport.function.js.map +1 -1
- package/js/render/dom/attachDomElements.function.js +8 -5
- package/js/render/dom/attachDomElements.function.js.map +1 -1
- package/js/render/executeWrap.function.js +2 -1
- package/js/render/executeWrap.function.js.map +1 -1
- package/js/render/paint.function.d.ts +1 -1
- package/js/render/paint.function.js +17 -14
- package/js/render/paint.function.js.map +1 -1
- package/js/render/registerNewTagElement.function.js +1 -1
- package/js/render/registerNewTagElement.function.js.map +1 -1
- package/js/render/renderExistingTag.function.d.ts +1 -2
- package/js/render/renderExistingTag.function.js +6 -10
- package/js/render/renderExistingTag.function.js.map +1 -1
- package/js/render/renderSupport.function.d.ts +3 -2
- package/js/render/renderSupport.function.js +17 -25
- package/js/render/renderSupport.function.js.map +1 -1
- package/js/render/renderTagElement.function.d.ts +1 -0
- package/js/render/renderTagElement.function.js +1 -2
- package/js/render/renderTagElement.function.js.map +1 -1
- package/js/render/renderTagOnly.function.js +3 -4
- package/js/render/renderTagOnly.function.js.map +1 -1
- package/js/render/renderWithSupport.function.d.ts +1 -2
- package/js/render/renderWithSupport.function.js +6 -8
- package/js/render/renderWithSupport.function.js.map +1 -1
- package/js/render/softDestroySupport.function.js +3 -3
- package/js/render/softDestroySupport.function.js.map +1 -1
- package/js/render/update/processRenderOnceInit.function.js +2 -3
- package/js/render/update/processRenderOnceInit.function.js.map +1 -1
- package/js/render/update/processTag.function.d.ts +1 -1
- package/js/render/update/processTag.function.js +4 -4
- package/js/render/update/processTag.function.js.map +1 -1
- package/js/render/update/updateExistingTagComponent.function.d.ts +3 -3
- package/js/render/update/updateExistingTagComponent.function.js +29 -23
- package/js/render/update/updateExistingTagComponent.function.js.map +1 -1
- package/js/render/update/updateSupportBy.function.js +2 -2
- package/js/render/update/updateSupportBy.function.js.map +1 -1
- package/js/state/array.function.d.ts +4 -0
- package/js/state/array.function.js +59 -0
- package/js/state/array.function.js.map +1 -0
- package/js/state/awaits.d.ts +5 -0
- package/js/state/awaits.js +19 -0
- package/js/state/awaits.js.map +1 -0
- package/js/state/callback.function.js +1 -1
- package/js/state/callbackStateUpdate.function.js +1 -1
- package/js/state/handleProviderChanges.function.js +2 -2
- package/js/state/index.d.ts +1 -2
- package/js/state/index.js +1 -2
- package/js/state/index.js.map +1 -1
- package/js/state/letProp.function.js +1 -1
- package/js/state/letProp.function.js.map +1 -1
- package/js/state/onDestroy.js +1 -1
- package/js/state/onInit.js +13 -1
- package/js/state/onInit.js.map +1 -1
- package/js/state/pipe.function.d.ts +3 -0
- package/js/state/pipe.function.js +20 -0
- package/js/state/pipe.function.js.map +1 -0
- package/js/state/providers.js +3 -3
- package/js/state/providersChangeCheck.function.js +1 -1
- package/js/state/signal.function.d.ts +15 -0
- package/js/state/signal.function.js +51 -0
- package/js/state/signal.function.js.map +1 -0
- package/js/state/state.utils.d.ts +2 -3
- package/js/state/state.utils.js +8 -3
- package/js/state/state.utils.js.map +1 -1
- package/js/state/subscribeWith.function.js +2 -4
- package/js/state/subscribeWith.function.js.map +1 -1
- package/js/state/useAwaits.d.ts +5 -0
- package/js/state/useAwaits.js +17 -0
- package/js/state/useAwaits.js.map +1 -0
- package/js/state/watch.function.js +1 -1
- package/js/subject/index.d.ts +1 -1
- package/js/subject/index.js +1 -1
- package/js/subject/index.js.map +1 -1
- package/js/subject/signal.function.d.ts +5 -4
- package/js/subject/signal.function.js.map +1 -1
- package/js/tag/AdvancedContextItem.type.d.ts +0 -2
- package/js/tag/BaseSupport.type.d.ts +1 -1
- package/js/tag/Context.types.d.ts +1 -1
- package/js/tag/ContextItem.type.d.ts +4 -4
- package/js/tag/ProcessUpdate.type.d.ts +5 -0
- package/js/tag/ProcessUpdate.type.js +2 -0
- package/js/tag/ProcessUpdate.type.js.map +1 -0
- package/js/tag/Tag.type.d.ts +2 -2
- package/js/tag/ValueTypes.enum.d.ts +1 -0
- package/js/tag/ValueTypes.enum.js +1 -2
- package/js/tag/ValueTypes.enum.js.map +1 -1
- package/js/tag/checkTagValueChange.function.d.ts +1 -1
- package/js/tag/checkTagValueChange.function.js +3 -4
- package/js/tag/checkTagValueChange.function.js.map +1 -1
- package/js/tag/createHtmlSupport.function.d.ts +3 -3
- package/js/tag/createHtmlSupport.function.js +5 -5
- package/js/tag/destroyContext.function.js +2 -2
- package/js/tag/destroyContext.function.js.map +1 -1
- package/js/tag/getDomTag.function.d.ts +1 -4
- package/js/tag/getDomTag.function.js +3 -64
- package/js/tag/getDomTag.function.js.map +1 -1
- package/js/tag/getSupportInCycle.function.d.ts +3 -1
- package/js/tag/getSupportInCycle.function.js +3 -0
- package/js/tag/getSupportInCycle.function.js.map +1 -1
- package/js/tag/getTemplaterResult.function.d.ts +5 -4
- package/js/tag/getTemplaterResult.function.js +2 -0
- package/js/tag/getTemplaterResult.function.js.map +1 -1
- package/js/tag/hasSupportChanged.function.d.ts +1 -1
- package/js/tag/hasSupportChanged.function.js +3 -3
- package/js/tag/hasSupportChanged.function.js.map +1 -1
- package/js/tag/html.js +2 -1
- package/js/tag/html.js.map +1 -1
- package/js/tag/index.d.ts +1 -0
- package/js/tag/index.js +1 -0
- package/js/tag/index.js.map +1 -1
- package/js/tag/isLikeTags.function.d.ts +3 -3
- package/js/tag/isLikeTags.function.js +32 -21
- package/js/tag/isLikeTags.function.js.map +1 -1
- package/js/tag/output.function.d.ts +3 -1
- package/js/tag/output.function.js +16 -13
- package/js/tag/output.function.js.map +1 -1
- package/js/tag/processOuterDomTagInit.function.d.ts +9 -0
- package/js/tag/processOuterDomTagInit.function.js +72 -0
- package/js/tag/processOuterDomTagInit.function.js.map +1 -0
- package/js/tag/processUpdateContext.function.d.ts +1 -1
- package/js/tag/processUpdateContext.function.js +9 -11
- package/js/tag/processUpdateContext.function.js.map +1 -1
- package/js/tag/props/alterProp.function.d.ts +0 -1
- package/js/tag/props/alterProp.function.js +7 -19
- package/js/tag/props/alterProp.function.js.map +1 -1
- package/js/tag/props/safeRenderSupport.function.d.ts +2 -0
- package/js/tag/props/safeRenderSupport.function.js +11 -0
- package/js/tag/props/safeRenderSupport.function.js.map +1 -0
- package/js/tag/smartRemoveKids.function.js +19 -9
- package/js/tag/smartRemoveKids.function.js.map +1 -1
- package/js/tag/tagElement.js +21 -11
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/tagRunner.js +2 -2
- package/js/tag/update/SubContext.type.d.ts +6 -4
- package/js/tag/update/checkSubContext.function.d.ts +2 -1
- package/js/tag/update/checkSubContext.function.js +13 -7
- package/js/tag/update/checkSubContext.function.js.map +1 -1
- package/js/tag/update/compareArrayItems.function.js +1 -1
- package/js/tag/update/compareArrayItems.function.js.map +1 -1
- package/js/tag/update/createAndProcessContextItem.function.js +2 -0
- package/js/tag/update/createAndProcessContextItem.function.js.map +1 -1
- package/js/tag/update/deleteSubContext.function.d.ts +1 -1
- package/js/tag/update/deleteSubContext.function.js +7 -6
- package/js/tag/update/deleteSubContext.function.js.map +1 -1
- package/js/tag/update/forceUpdateExistingValue.function.js +1 -1
- package/js/tag/update/forceUpdateExistingValue.function.js.map +1 -1
- package/js/tag/update/getNewGlobal.function.d.ts +1 -1
- package/js/tag/update/getNewGlobal.function.js +3 -4
- package/js/tag/update/getNewGlobal.function.js.map +1 -1
- package/js/tag/update/handleStillTag.function.d.ts +2 -2
- package/js/tag/update/handleStillTag.function.js +12 -3
- package/js/tag/update/handleStillTag.function.js.map +1 -1
- package/js/tag/update/onFirstSubContext.function.d.ts +1 -1
- package/js/tag/update/onFirstSubContext.function.js +1 -1
- package/js/tag/update/onFirstSubContext.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectComponent.function.js +10 -13
- package/js/tag/update/processFirstSubjectComponent.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectValue.function.js +3 -3
- package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
- package/js/tag/update/processRegularValue.function.js +3 -3
- package/js/tag/update/processRegularValue.function.js.map +1 -1
- package/js/tag/update/processSubscribe.function.d.ts +2 -2
- package/js/tag/update/processSubscribe.function.js +6 -5
- package/js/tag/update/processSubscribe.function.js.map +1 -1
- package/js/tag/update/processTagResult.function.d.ts +0 -2
- package/js/tag/update/processTagResult.function.js +2 -9
- package/js/tag/update/processTagResult.function.js.map +1 -1
- package/js/tag/update/setupSubscribe.function.d.ts +3 -3
- package/js/tag/update/setupSubscribe.function.js +36 -19
- package/js/tag/update/setupSubscribe.function.js.map +1 -1
- package/js/tag/update/tagValueUpdateHandler.function.d.ts +0 -2
- package/js/tag/update/tagValueUpdateHandler.function.js +0 -15
- package/js/tag/update/tagValueUpdateHandler.function.js.map +1 -1
- package/js/tag/update/tryUpdateToTag.function.js +16 -1
- package/js/tag/update/tryUpdateToTag.function.js.map +1 -1
- package/js/tagJsVars/array.function.d.ts +3 -0
- package/js/tagJsVars/array.function.js +28 -0
- package/js/tagJsVars/array.function.js.map +1 -0
- package/js/tagJsVars/checkSimpleValueChange.function.d.ts +2 -0
- package/js/tagJsVars/checkSimpleValueChange.function.js +13 -0
- package/js/tagJsVars/checkSimpleValueChange.function.js.map +1 -0
- package/js/tagJsVars/getArrayTagJsVar.function.d.ts +2 -2
- package/js/tagJsVars/getArrayTagJsVar.function.js +2 -0
- package/js/tagJsVars/getArrayTagJsVar.function.js.map +1 -1
- package/js/tagJsVars/getInnerHTML.function.js +3 -2
- package/js/tagJsVars/getInnerHTML.function.js.map +1 -1
- package/js/tagJsVars/getSimpleTagVar.function.d.ts +3 -11
- package/js/tagJsVars/getSimpleTagVar.function.js +7 -11
- package/js/tagJsVars/getSimpleTagVar.function.js.map +1 -1
- package/js/tagJsVars/host.function.d.ts +18 -0
- package/js/tagJsVars/host.function.js +47 -0
- package/js/tagJsVars/host.function.js.map +1 -0
- package/js/tagJsVars/index.d.ts +5 -0
- package/js/tagJsVars/index.js +5 -0
- package/js/tagJsVars/index.js.map +1 -1
- package/js/tagJsVars/pipe.function.d.ts +3 -0
- package/js/tagJsVars/pipe.function.js +22 -0
- package/js/tagJsVars/pipe.function.js.map +1 -0
- package/js/tagJsVars/subscribe.function.d.ts +4 -4
- package/js/tagJsVars/subscribe.function.js +9 -7
- package/js/tagJsVars/subscribe.function.js.map +1 -1
- package/js/tagJsVars/subscribeWith.function.d.ts +3 -0
- package/js/tagJsVars/subscribeWith.function.js +21 -0
- package/js/tagJsVars/subscribeWith.function.js.map +1 -0
- package/js/tagJsVars/tag.function.js +3 -0
- package/js/tagJsVars/tag.function.js.map +1 -1
- package/js/tagJsVars/tagJsVar.type.d.ts +8 -0
- package/js/tagJsVars/valueToTagJsVar.function.d.ts +1 -1
- package/js/tagJsVars/valueToTagJsVar.function.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,7 @@ import { AnySupport } from '../tag/AnySupport.type.js';
|
|
|
2
2
|
import { SupportContextItem } from '../tag/SupportContextItem.type.js';
|
|
3
3
|
/** TODO: This seems to support both new and updates and should be separated? */
|
|
4
4
|
export declare function renderWithSupport(newSupport: AnySupport, lastSupport: AnySupport | undefined, // previous (global.newest)
|
|
5
|
-
subject: SupportContextItem
|
|
6
|
-
ownerSupport?: AnySupport): {
|
|
5
|
+
subject: SupportContextItem): {
|
|
7
6
|
support: AnySupport;
|
|
8
7
|
wasLikeTags: boolean;
|
|
9
8
|
};
|
|
@@ -5,27 +5,25 @@ import { isLikeTags } from '../tag/isLikeTags.function.js';
|
|
|
5
5
|
import { ValueTypes } from '../tag/ValueTypes.enum.js';
|
|
6
6
|
/** TODO: This seems to support both new and updates and should be separated? */
|
|
7
7
|
export function renderWithSupport(newSupport, lastSupport, // previous (global.newest)
|
|
8
|
-
subject
|
|
9
|
-
|
|
10
|
-
const lastTemplater = lastSupport?.templater;
|
|
11
|
-
const lastTag = lastTemplater?.tag;
|
|
12
|
-
const reSupport = renderTagOnly(newSupport, lastSupport, subject, ownerSupport);
|
|
8
|
+
subject) {
|
|
9
|
+
const reSupport = renderTagOnly(newSupport, lastSupport, subject);
|
|
13
10
|
const isLikeTag = !lastSupport || isLikeTags(lastSupport, reSupport);
|
|
14
11
|
if (!isLikeTag) {
|
|
15
12
|
moveProviders(lastSupport, reSupport);
|
|
16
13
|
softDestroySupport(lastSupport);
|
|
17
|
-
const global = reSupport.
|
|
14
|
+
const global = reSupport.context.global;
|
|
18
15
|
global.oldest = reSupport;
|
|
19
16
|
global.newest = reSupport;
|
|
20
17
|
}
|
|
21
18
|
else if (lastSupport) {
|
|
22
19
|
const tag = lastSupport.templater.tag;
|
|
23
20
|
if (tag && subject.renderCount > 0) {
|
|
21
|
+
const lastTemplater = lastSupport?.templater;
|
|
22
|
+
const lastTag = lastTemplater?.tag;
|
|
24
23
|
checkTagSoftDestroy(tag, lastSupport, lastTag);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
reSupport.ownerSupport = (ownerSupport || lastOwnerSupport);
|
|
26
|
+
reSupport.ownerSupport = newSupport.ownerSupport; // || lastOwnerSupport) as AnySupport
|
|
29
27
|
return { support: reSupport, wasLikeTags: isLikeTag };
|
|
30
28
|
}
|
|
31
29
|
function checkTagSoftDestroy(tag, lastSupport, lastTag) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderWithSupport.function.js","sourceRoot":"","sources":["../../ts/render/renderWithSupport.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAK,6BAA6B,C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,GAAG,CAAC,EAAE,CAAC;YAClC,MAAM,aAAa,GAAG,WAAW,EAAE,SAAS,CAAA;YAC5C,MAAM,OAAO,GAAG,aAAa,EAAE,GAAG,CAAA;YAElC,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IAED,SAAS,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAA,CAAA,qCAAqC;IAErF,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC,CAAA;AACrD,CAAC;AAED,SAAS,mBAAmB,CAC1B,GAAQ,EACR,WAAuB,EACvB,OAAa;IAEb,IAAG,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,OAAO,GAAI,OAAkB,EAAE,GAAG,CAAA;QACxC,MAAM,MAAM,GAAI,GAAc,CAAC,GAAG,CAAA;QAClC,IAAG,OAAO,KAAK,MAAM,EAAE,CAAC;YACtB,kBAAkB,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;QAED,OAAM;IACR,CAAC;IAED,IAAG,OAAO,EAAE,CAAC;QACX,MAAM,WAAW,GAAI,OAAqB,CAAC,OAAO,CAAA;QAClD,IAAG,WAAW,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,WAAW,EAAE,MAAM,CAAA;YACrC,MAAM,SAAS,GAAI,GAAiB,CAAC,OAAO,CAAC,MAAM,CAAA;YACnD,IAAG,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC3B,kBAAkB,CAAC,WAAW,CAAC,CAAA;YACjC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -3,12 +3,12 @@ import { getNewGlobal } from '../tag/update/getNewGlobal.function.js';
|
|
|
3
3
|
import { smartRemoveKids } from '../tag/smartRemoveKids.function.js';
|
|
4
4
|
/** used when a tag swaps content returned */
|
|
5
5
|
export function softDestroySupport(lastSupport) {
|
|
6
|
-
const subject = lastSupport.
|
|
6
|
+
const subject = lastSupport.context;
|
|
7
7
|
const global = subject.global;
|
|
8
|
-
const { subs, tags } = getChildTagsToSoftDestroy(global.
|
|
8
|
+
const { subs, tags } = getChildTagsToSoftDestroy(global.contexts);
|
|
9
9
|
softDestroyOne(global);
|
|
10
10
|
for (const child of tags) {
|
|
11
|
-
const cGlobal = child.
|
|
11
|
+
const cGlobal = child.context.global;
|
|
12
12
|
if (cGlobal.deleted === true) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softDestroySupport.function.js","sourceRoot":"","sources":["../../ts/render/softDestroySupport.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAG9F,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGpE,6CAA6C;AAC7C,MAAM,UAAU,kBAAkB,CAChC,WAAuB;IAEvB,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAA;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,MAA0B,CAAA;IACjD,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,yBAAyB,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"softDestroySupport.function.js","sourceRoot":"","sources":["../../ts/render/softDestroySupport.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAG9F,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGpE,6CAA6C;AAC7C,MAAM,UAAU,kBAAkB,CAChC,WAAuB;IAEvB,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAA;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,MAA0B,CAAA;IACjD,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,yBAAyB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAE/D,cAAc,CAAC,MAAM,CAAC,CAAA;IACtB,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAA;QACpC,IAAG,OAAO,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAC5B,OAAM;QACR,CAAC;QACD,cAAc,CAAE,OAAO,CAAE,CAAA;IAC3B,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAA;IACnC,IAAG,MAAM,EAAE,CAAC;QACV,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IAC/B,CAAC;IAED,YAAY,CAAC,OAAO,CAAC,CAAA;AACvB,CAAC;AAED,SAAS,cAAc,CACrB,MAAwB;IAExB,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA,CAAC,wEAAwE;IAC9F,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAC7B,CAAC"}
|
|
@@ -7,8 +7,7 @@ ownerSupport, // owningSupport
|
|
|
7
7
|
counts, appendTo, insertBefore) {
|
|
8
8
|
getNewGlobal(contextItem);
|
|
9
9
|
const support = oneRenderToSupport(value, contextItem, ownerSupport);
|
|
10
|
-
renderTagOnly(support, undefined, contextItem
|
|
11
|
-
|
|
12
|
-
return result;
|
|
10
|
+
renderTagOnly(support, undefined, contextItem);
|
|
11
|
+
return processNewSubjectTag(support.templater, contextItem, ownerSupport, counts, appendTo, insertBefore);
|
|
13
12
|
}
|
|
14
13
|
//# sourceMappingURL=processRenderOnceInit.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processRenderOnceInit.function.js","sourceRoot":"","sources":["../../../ts/render/update/processRenderOnceInit.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAA;AAIxF,MAAM,UAAU,qBAAqB,CACnC,KAAoB,EACpB,WAAwB,EAAE,8BAA8B;AACxD,YAAwB,EAAE,gBAAgB;AAC1C,MAAiB,EACjB,QAAkB,EAClB,YAAmB;IAEnB,YAAY,CAAC,WAAW,CAAC,CAAA;IAEzB,MAAM,OAAO,GAAG,kBAAkB,CAChC,KAAgB,EAChB,WAA0B,EAC1B,YAAY,CACb,CAAA;IAED,aAAa,CACX,OAAO,EACP,SAAS,EACT,WAAiC,
|
|
1
|
+
{"version":3,"file":"processRenderOnceInit.function.js","sourceRoot":"","sources":["../../../ts/render/update/processRenderOnceInit.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAA;AAIxF,MAAM,UAAU,qBAAqB,CACnC,KAAoB,EACpB,WAAwB,EAAE,8BAA8B;AACxD,YAAwB,EAAE,gBAAgB;AAC1C,MAAiB,EACjB,QAAkB,EAClB,YAAmB;IAEnB,YAAY,CAAC,WAAW,CAAC,CAAA;IAEzB,MAAM,OAAO,GAAG,kBAAkB,CAChC,KAAgB,EAChB,WAA0B,EAC1B,YAAY,CACb,CAAA;IAED,aAAa,CACX,OAAO,EACP,SAAS,EACT,WAAiC,CAElC,CAAA;IAED,OAAO,oBAAoB,CACzB,OAAO,CAAC,SAAS,EACjB,WAA0B,EAC1B,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,YAAY,CACb,CAAA;AACH,CAAC"}
|
|
@@ -10,7 +10,7 @@ import { SupportContextItem } from '../../tag/SupportContextItem.type.js';
|
|
|
10
10
|
* Intended use only for updates
|
|
11
11
|
*/
|
|
12
12
|
export declare function processTag(ownerSupport: AnySupport, // owner
|
|
13
|
-
|
|
13
|
+
contextItem: SupportContextItem, // could be tag via result.tag
|
|
14
14
|
counts: TagCounts): AnySupport;
|
|
15
15
|
export declare function tagFakeTemplater(tag: StringTag | DomTag): TemplaterResult;
|
|
16
16
|
export declare function getFakeTemplater(): TemplaterResult;
|
|
@@ -8,12 +8,12 @@ import { processTagInit } from '../../tag/update/processTagInit.function.js';
|
|
|
8
8
|
* Intended use only for updates
|
|
9
9
|
*/
|
|
10
10
|
export function processTag(ownerSupport, // owner
|
|
11
|
-
|
|
11
|
+
contextItem, // could be tag via result.tag
|
|
12
12
|
counts) {
|
|
13
|
-
const global =
|
|
13
|
+
const global = contextItem.global;
|
|
14
14
|
const support = global.newest;
|
|
15
|
+
const ph = contextItem.placeholder;
|
|
15
16
|
support.ownerSupport = ownerSupport;
|
|
16
|
-
const ph = subject.placeholder;
|
|
17
17
|
buildBeforeElement(support, counts, undefined, ph);
|
|
18
18
|
return support;
|
|
19
19
|
}
|
|
@@ -35,7 +35,7 @@ export function getFakeTemplater() {
|
|
|
35
35
|
export function newSupportByTemplater(templater, ownerSupport, subject) {
|
|
36
36
|
const support = createHtmlSupport(templater, ownerSupport, ownerSupport.appSupport, subject);
|
|
37
37
|
const global = subject.global;
|
|
38
|
-
global.
|
|
38
|
+
global.contexts = [];
|
|
39
39
|
return support;
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=processTag.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTag.function.js","sourceRoot":"","sources":["../../../ts/render/update/processTag.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2C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IAC9B,MAAM,IAAI,GAAG;QACX,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,cAAc;QAC3B,gBAAgB,EAAE,mBAAmB;KACnB,CAAA;IAEpB,OAAO,IAAI,CAAA;AACb,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,qBAAqB,CACnC,SAA0B,EAC1B,YAAwB,EACxB,OAAoB;IAEpB,MAAM,OAAO,GAAG,iBAAiB,CAC/B,SAAS,EACT,YAAY,EACZ,YAAY,CAAC,UAAU,EACvB,OAAO,CACR,CAAA;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAA0B,CAAA;IACjD,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAA;IAEpB,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Props } from '../../Props.js';
|
|
2
2
|
import { AnySupport } from '../../tag/AnySupport.type.js';
|
|
3
3
|
import { SupportContextItem } from '../../tag/SupportContextItem.type.js';
|
|
4
|
-
export declare function updateExistingTagComponent(ownerSupport: AnySupport,
|
|
4
|
+
export declare function updateExistingTagComponent(ownerSupport: AnySupport, newSupport: AnySupport, // lastest
|
|
5
5
|
subject: SupportContextItem): void;
|
|
6
|
-
export declare function syncFunctionProps(newSupport: AnySupport,
|
|
6
|
+
export declare function syncFunctionProps(newSupport: AnySupport, oldSupport: AnySupport, ownerSupport: AnySupport, newPropsArray: unknown[], // templater.props
|
|
7
7
|
maxDepth: number, depth?: number): Props;
|
|
8
|
-
export declare function moveProviders(
|
|
8
|
+
export declare function moveProviders(oldSupport: AnySupport, newSupport: AnySupport): void;
|
|
@@ -7,47 +7,53 @@ import { getNewGlobal } from '../../tag/update/getNewGlobal.function.js';
|
|
|
7
7
|
import { isLikeTags } from '../../tag/isLikeTags.function.js';
|
|
8
8
|
import { PropWatches } from '../../tagJsVars/tag.function.js';
|
|
9
9
|
import { syncPriorPropFunction } from '../../tag/update/syncPriorPropFunction.function.js';
|
|
10
|
-
export function updateExistingTagComponent(ownerSupport,
|
|
10
|
+
export function updateExistingTagComponent(ownerSupport, newSupport, // lastest
|
|
11
11
|
subject) {
|
|
12
12
|
const global = subject.global;
|
|
13
|
-
const
|
|
14
|
-
const oldWrapper =
|
|
15
|
-
|
|
13
|
+
const oldSupport = global.newest;
|
|
14
|
+
const oldWrapper = oldSupport.templater.wrapper;
|
|
15
|
+
let newWrapper = newSupport.templater.wrapper;
|
|
16
16
|
let isSameTag = false;
|
|
17
|
-
const tagJsType =
|
|
17
|
+
const tagJsType = newSupport.templater.tagJsType;
|
|
18
18
|
const skipComparing = ValueTypes.stateRender === tagJsType || ValueTypes.renderOnce === tagJsType;
|
|
19
19
|
if (skipComparing) {
|
|
20
|
-
isSameTag =
|
|
20
|
+
isSameTag = newSupport.templater.tagJsType === ValueTypes.renderOnce || isLikeTags(oldSupport, newSupport);
|
|
21
21
|
}
|
|
22
22
|
else if (oldWrapper && newWrapper) {
|
|
23
|
+
// is this perhaps an outerHTML compare?
|
|
24
|
+
const innerHTML = oldSupport.templater.tag?._innerHTML;
|
|
25
|
+
if (innerHTML) {
|
|
26
|
+
// newWrapper = innerHTML.outerHTML as any as Wrapper
|
|
27
|
+
newWrapper = newSupport.outerHTML;
|
|
28
|
+
}
|
|
23
29
|
const oldFunction = oldWrapper.original;
|
|
24
30
|
const newFunction = newWrapper.original;
|
|
25
31
|
// string compare both functions
|
|
26
32
|
isSameTag = oldFunction === newFunction;
|
|
27
33
|
}
|
|
28
|
-
const templater =
|
|
34
|
+
const templater = newSupport.templater;
|
|
29
35
|
if (!isSameTag) {
|
|
30
36
|
swapTags(subject, templater, ownerSupport);
|
|
31
37
|
return;
|
|
32
38
|
}
|
|
33
|
-
const hasChanged = skipComparing || hasSupportChanged(
|
|
39
|
+
const hasChanged = skipComparing || hasSupportChanged(oldSupport, templater);
|
|
34
40
|
// everyhing has matched, no display needs updating.
|
|
35
41
|
if (!hasChanged) {
|
|
36
42
|
const maxDepth = templater.propWatch === PropWatches.DEEP ? deepCompareDepth : shallowCompareDepth;
|
|
37
|
-
syncSupports(templater,
|
|
43
|
+
syncSupports(templater, newSupport, oldSupport, ownerSupport, maxDepth);
|
|
38
44
|
return;
|
|
39
45
|
}
|
|
40
|
-
if (
|
|
41
|
-
global.blocked.push(
|
|
46
|
+
if (subject.locked) {
|
|
47
|
+
global.blocked.push(newSupport);
|
|
42
48
|
return;
|
|
43
49
|
}
|
|
44
|
-
renderSupport(
|
|
50
|
+
renderSupport(newSupport);
|
|
45
51
|
++subject.renderCount;
|
|
46
52
|
return;
|
|
47
53
|
}
|
|
48
|
-
export function syncFunctionProps(newSupport,
|
|
54
|
+
export function syncFunctionProps(newSupport, oldSupport, ownerSupport, newPropsArray, // templater.props
|
|
49
55
|
maxDepth, depth = -1) {
|
|
50
|
-
const subject =
|
|
56
|
+
const subject = oldSupport.context;
|
|
51
57
|
const global = subject.global;
|
|
52
58
|
const newest = global.newest;
|
|
53
59
|
if (!newest) {
|
|
@@ -57,8 +63,8 @@ maxDepth, depth = -1) {
|
|
|
57
63
|
propsConfig.castProps = castedProps;
|
|
58
64
|
return newPropsArray;
|
|
59
65
|
}
|
|
60
|
-
|
|
61
|
-
const priorPropConfig =
|
|
66
|
+
oldSupport = newest || oldSupport;
|
|
67
|
+
const priorPropConfig = oldSupport.propsConfig;
|
|
62
68
|
const priorPropsArray = priorPropConfig.castProps;
|
|
63
69
|
const newArray = [];
|
|
64
70
|
for (let index = 0; index < newPropsArray.length; ++index) {
|
|
@@ -71,8 +77,8 @@ maxDepth, depth = -1) {
|
|
|
71
77
|
newPropsConfig.castProps = newArray;
|
|
72
78
|
return newArray;
|
|
73
79
|
}
|
|
74
|
-
export function moveProviders(
|
|
75
|
-
const global =
|
|
80
|
+
export function moveProviders(oldSupport, newSupport) {
|
|
81
|
+
const global = oldSupport.context.global;
|
|
76
82
|
let pIndex = -1;
|
|
77
83
|
const providers = global.providers = global.providers || [];
|
|
78
84
|
const pLen = providers.length - 1;
|
|
@@ -82,7 +88,7 @@ export function moveProviders(lastSupport, newSupport) {
|
|
|
82
88
|
const pcLen = provider.children.length - 1;
|
|
83
89
|
while (index++ < pcLen) {
|
|
84
90
|
const child = provider.children[index];
|
|
85
|
-
const wasSameGlobals = global === child.
|
|
91
|
+
const wasSameGlobals = global === child.context.global;
|
|
86
92
|
if (wasSameGlobals) {
|
|
87
93
|
provider.children.splice(index, 1);
|
|
88
94
|
provider.children.push(newSupport);
|
|
@@ -92,17 +98,17 @@ export function moveProviders(lastSupport, newSupport) {
|
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
/** Exchanges entire propsConfigs */
|
|
95
|
-
function syncSupports(templater, support,
|
|
101
|
+
function syncSupports(templater, support, oldSupport, ownerSupport, maxDepth) {
|
|
96
102
|
// update function refs to use latest references
|
|
97
103
|
const newProps = templater.props;
|
|
98
|
-
const castedProps = syncFunctionProps(support,
|
|
104
|
+
const castedProps = syncFunctionProps(support, oldSupport, ownerSupport, newProps, maxDepth);
|
|
99
105
|
const propsConfig = support.propsConfig;
|
|
100
106
|
// When new support actually makes call to real function, use these pre casted props
|
|
101
107
|
propsConfig.castProps = castedProps;
|
|
102
|
-
const lastPropsConfig =
|
|
108
|
+
const lastPropsConfig = oldSupport.propsConfig;
|
|
103
109
|
// update support to think it has different cloned props
|
|
104
110
|
lastPropsConfig.latest = propsConfig.latest;
|
|
105
|
-
return
|
|
111
|
+
return oldSupport; // its the same tag component
|
|
106
112
|
}
|
|
107
113
|
/** Was tag, will be tag */
|
|
108
114
|
function swapTags(contextItem, templater, // new tag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateExistingTagComponent.function.js","sourceRoot":"","sources":["../../../ts/render/update/updateExistingTagComponent.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAK,yCAAyC,CAAA;AAGjH,OAAO,EAAE,SAAS,EAAc,MAAK,uCAAuC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAK,8BAA8B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAK,kCAAkC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAA;AAK1F,MAAM,UAAU,0BAA0B,CACxC,YAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"updateExistingTagComponent.function.js","sourceRoot":"","sources":["../../../ts/render/update/updateExistingTagComponent.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAK,yCAAyC,CAAA;AAGjH,OAAO,EAAE,SAAS,EAAc,MAAK,uCAAuC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAK,8BAA8B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAK,kCAAkC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAA;AAK1F,MAAM,UAAU,0BAA0B,CACxC,YAAwB,EACxB,UAAsB,EAAE,UAAU;AAClC,OAA0B;IAE1B,MAAM,MAAM,GAAG,OAAO,CAAC,MAA0B,CAAA;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAA;IAEhC,MAAM,UAAU,GAAG,UAAU,CAAC,SAA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C,QAAQ,CAAC,IAAI,CAAC,UAAwB,CAAC,CAAA;gBAChD,OAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,oCAAoC;AACpC,SAAS,YAAY,CACnB,SAA0B,EAC1B,OAAmB,EACnB,UAAa,EACb,YAAwB,EACxB,QAAgB;IAEhB,gDAAgD;IAChD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAc,CAAA;IACzC,MAAM,WAAW,GAAG,iBAAiB,CACnC,OAAO,EACP,UAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,QAAQ,CACT,CAAA;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,WAA0B,CAAA;IAEtD,oFAAoF;IACpF,WAAW,CAAC,SAAS,GAAG,WAAW,CAAA;IAEnC,MAAM,eAAe,GAAG,UAAU,CAAC,WAA0B,CAAA;IAC7D,wDAAwD;IACxD,eAAe,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;IAE3C,OAAO,UAAU,CAAA,CAAC,+BAA+B;AACnD,CAAC;AAED,2BAA2B;AAC3B,SAAS,QAAQ,CACf,WAA+B,EAC/B,SAA0B,EAAE,UAAU;AACtC,YAAwB;IAExB,MAAM,MAAM,GAAG,WAAW,CAAC,MAA0B,CAAA;IACrD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAoB,CAAA;IACjD,cAAc,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IAErC,YAAY,CAAC,WAAW,CAAC,CAExB;IAAC,SAAsB,CAAC,WAAW,CAClC,SAAS,EACT,WAAW,EACX,YAAY,EACZ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EACxB,SAAS,EAAE,YAAY;IACvB,WAAW,CAAC,WAAW,CACxB,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { paint, painting } from '../paint.function.js';
|
|
2
2
|
import { processUpdateContext } from '../../tag/processUpdateContext.function.js';
|
|
3
3
|
export function updateSupportBy(olderSupport, newerSupport) {
|
|
4
|
-
const global = olderSupport.
|
|
5
|
-
const context = global.
|
|
4
|
+
const global = olderSupport.context.global;
|
|
5
|
+
const context = global.contexts;
|
|
6
6
|
updateSupportValuesBy(olderSupport, newerSupport);
|
|
7
7
|
++painting.locks;
|
|
8
8
|
processUpdateContext(olderSupport, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateSupportBy.function.js","sourceRoot":"","sources":["../../../ts/render/update/updateSupportBy.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAOjF,MAAM,UAAU,eAAe,CAC7B,YAAwB,EACxB,YAAwB;IAExB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,MAA0B,CAAA;IAC9D,MAAM,OAAO,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"updateSupportBy.function.js","sourceRoot":"","sources":["../../../ts/render/update/updateSupportBy.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAOjF,MAAM,UAAU,eAAe,CAC7B,YAAwB,EACxB,YAAwB;IAExB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,MAA0B,CAAA;IAC9D,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAA;IAE/B,qBAAqB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;IAEjD,EAAE,QAAQ,CAAC,KAAK,CAAA;IAChB,oBAAoB,CAAC,YAAY,EAAE,OAAmC,CAAC,CAAA;IACvE,EAAE,QAAQ,CAAC,KAAK,CAAA;IAEhB,KAAK,EAAE,CAAA;AACT,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,YAAwB,EACxB,YAAwB;IAExB,MAAM,WAAW,GAAG,YAAY,CAAC,SAA2B,CAAA;IAC5D,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,GAAU,CAAA;IACjD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAA;IACnD,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,GAAa,CAAA;IAChD,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SignalObject } from './signal.function.js';
|
|
2
|
+
export type SignalArray<T> = SignalObject<Array<T>> & Array<T>;
|
|
3
|
+
/** returns a signal that contains an array and mocks acting like an array to support root array functionality */
|
|
4
|
+
export declare function array<T>(initialValue?: T[]): SignalArray<T>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { state } from '../index.js';
|
|
2
|
+
import { getSupportInCycle } from '../tag/getSupportInCycle.function.js';
|
|
3
|
+
import { Signal } from './signal.function.js';
|
|
4
|
+
/** returns a signal that contains an array and mocks acting like an array to support root array functionality */
|
|
5
|
+
export function array(initialValue = []) {
|
|
6
|
+
const support = getSupportInCycle();
|
|
7
|
+
if (support) {
|
|
8
|
+
return state(() => firstSignal(Signal(initialValue)));
|
|
9
|
+
}
|
|
10
|
+
return firstSignal(Signal(initialValue));
|
|
11
|
+
}
|
|
12
|
+
function firstSignal(sig) {
|
|
13
|
+
const editors = ['push', 'pop', 'splice', 'shift', 'unshift'];
|
|
14
|
+
const readers = ['map', 'reduce', 'forEach', 'every'];
|
|
15
|
+
const overwriteEmitter = (action) => {
|
|
16
|
+
return resignal[action] = (...args) => {
|
|
17
|
+
const result = sig.value[action](...args);
|
|
18
|
+
sig.emit(sig.value);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const resignal = new Proxy(sig, {
|
|
23
|
+
get(target, prop) {
|
|
24
|
+
// If accessing numeric index like '0', '1', etc.
|
|
25
|
+
if (!isNaN(prop)) {
|
|
26
|
+
return sig.value[prop];
|
|
27
|
+
}
|
|
28
|
+
if (prop === 'length') {
|
|
29
|
+
return sig.value.length;
|
|
30
|
+
}
|
|
31
|
+
if (editors.includes(prop)) {
|
|
32
|
+
return overwriteEmitter(prop);
|
|
33
|
+
// return sig.value[prop]
|
|
34
|
+
}
|
|
35
|
+
if (readers.includes(prop)) {
|
|
36
|
+
return sig.value[prop].bind(sig.value);
|
|
37
|
+
}
|
|
38
|
+
return sig[prop];
|
|
39
|
+
},
|
|
40
|
+
set(target, prop, value) {
|
|
41
|
+
if (!isNaN(prop)) {
|
|
42
|
+
sig.value[prop] = value;
|
|
43
|
+
sig.emit(sig.value);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
if (prop === 'length') {
|
|
47
|
+
sig.value.length = value;
|
|
48
|
+
sig.emit(sig.value);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
// Applies to the signal and not the signal.value array
|
|
52
|
+
;
|
|
53
|
+
sig[prop] = value;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return resignal;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=array.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.function.js","sourceRoot":"","sources":["../../ts/state/array.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAA;AAI3D,iHAAiH;AACjH,MAAM,UAAU,KAAK,CACnB,eAAoB,EAAE;IAEtB,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAA;IAEnC,IAAG,OAAO,EAAE,CAAC;QACT,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC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K,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACxC,CAAC;YAED,OAAQ,GAAW,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC;QACD,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK;YACrB,IAAI,CAAC,KAAK,CAAC,IAAW,CAAC,EAAE,CAAC;gBACxB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;gBACvB,GAAG,CAAC,IAAI,CAAE,GAAG,CAAC,KAAK,CAAE,CAAA;gBACrB,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAG,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrB,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAA;gBACxB,GAAG,CAAC,IAAI,CAAE,GAAG,CAAC,KAAK,CAAE,CAAA;gBACrB,OAAO,IAAI,CAAA;YACb,CAAC;YAED,uDAAuD;YACvD,CAAC;YAAC,GAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;YAE3B,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,QAAe,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { thenResolveBy } from '../interpolations/attributes/checkToResolvePromise.function.js';
|
|
2
|
+
import { getSupportInCycle } from '../tag/getSupportInCycle.function.js';
|
|
3
|
+
/** runs a callback function one time and never again. Same as calling state(() => ...) */
|
|
4
|
+
export function useAwaits() {
|
|
5
|
+
const nowSupport = getSupportInCycle();
|
|
6
|
+
const controller = {
|
|
7
|
+
add: Promise.resolve()
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(controller, 'add', {
|
|
10
|
+
set(x) {
|
|
11
|
+
x.then(thenResolveBy(nowSupport, resolvePromise));
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
return controller;
|
|
15
|
+
}
|
|
16
|
+
function resolvePromise(x) {
|
|
17
|
+
return x;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=awaits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awaits.js","sourceRoot":"","sources":["../../ts/state/awaits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAA;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAIxE,0FAA0F;AAC1F,MAAM,UAAU,SAAS;IACvB,MAAM,UAAU,GAAG,iBAAiB,EAAgB,CAAA;IACpD,MAAM,UAAU,GAAG;QACjB,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE;KACvB,CAAA;IAED,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE;QACvC,GAAG,CAAC,CAAe;YACjB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAA;QACnD,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -15,7 +15,7 @@ export function createTrigger(support, oldState, toCallback) {
|
|
|
15
15
|
// const oldStates = [...oldState.states]
|
|
16
16
|
const oldStates = oldState.states;
|
|
17
17
|
return function trigger(...args) {
|
|
18
|
-
const callbackMaker = support.
|
|
18
|
+
const callbackMaker = support.context.renderCount > 0;
|
|
19
19
|
if (callbackMaker) {
|
|
20
20
|
return callbackStateUpdate(support, oldStates, toCallback, ...args);
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { renderSupport } from '../render/renderSupport.function.js';
|
|
2
2
|
import { isPromise } from '../isInstance.js';
|
|
3
3
|
export default function callbackStateUpdate(support, oldStates, callback, ...args) {
|
|
4
|
-
const global = support.
|
|
4
|
+
const global = support.context.global;
|
|
5
5
|
const newestSupport = global.newest;
|
|
6
6
|
// NEWEST UPDATE OLDEST: ensure that the oldest has the latest values first
|
|
7
7
|
//syncStatesArray(newestSupport.states, oldStates)
|
|
@@ -4,7 +4,7 @@ export function handleProviderChanges(appSupport, provider) {
|
|
|
4
4
|
}
|
|
5
5
|
/** Updates and returns memory of tag providers */
|
|
6
6
|
function getTagsWithProvider(support, provider, memory = []) {
|
|
7
|
-
const subject = support.
|
|
7
|
+
const subject = support.context;
|
|
8
8
|
memory.push({
|
|
9
9
|
support,
|
|
10
10
|
renderCount: subject.renderCount,
|
|
@@ -13,7 +13,7 @@ function getTagsWithProvider(support, provider, memory = []) {
|
|
|
13
13
|
const childTags = provider.children;
|
|
14
14
|
for (let index = childTags.length - 1; index >= 0; --index) {
|
|
15
15
|
const child = childTags[index];
|
|
16
|
-
const cSubject = child.
|
|
16
|
+
const cSubject = child.context;
|
|
17
17
|
memory.push({
|
|
18
18
|
support: child,
|
|
19
19
|
renderCount: cSubject.renderCount,
|
package/js/state/index.d.ts
CHANGED
|
@@ -11,5 +11,4 @@ export * from './onInit.js';
|
|
|
11
11
|
export * from './onDestroy.js';
|
|
12
12
|
export * from './state.function.js';
|
|
13
13
|
export * from './states.function.js';
|
|
14
|
-
export
|
|
15
|
-
export { subscribeWith } from './subscribeWith.function.js';
|
|
14
|
+
export * from './array.function.js';
|
package/js/state/index.js
CHANGED
|
@@ -11,6 +11,5 @@ export * from './onInit.js';
|
|
|
11
11
|
export * from './onDestroy.js';
|
|
12
12
|
export * from './state.function.js';
|
|
13
13
|
export * from './states.function.js';
|
|
14
|
-
export
|
|
15
|
-
export { subscribeWith } from './subscribeWith.function.js';
|
|
14
|
+
export * from './array.function.js';
|
|
16
15
|
//# sourceMappingURL=index.js.map
|
package/js/state/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAE9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAE9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"letProp.function.js","sourceRoot":"","sources":["../../ts/state/letProp.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"letProp.function.js","sourceRoot":"","sources":["../../ts/state/letProp.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAK,qBAAqB,CAAA;AAE1C;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CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,MAAM,CAAA;IAER,OAAO,WAAW,CAAC,KAAK,CAAA;AAC1B,CAAC"}
|
package/js/state/onDestroy.js
CHANGED
|
@@ -3,7 +3,7 @@ import { state } from "./state.function.js";
|
|
|
3
3
|
export function onDestroy(callback) {
|
|
4
4
|
state(function stateDestroy() {
|
|
5
5
|
const support = getSupportInCycle();
|
|
6
|
-
const global = support.
|
|
6
|
+
const global = support.context.global;
|
|
7
7
|
global.destroy$.toCallback(callback);
|
|
8
8
|
});
|
|
9
9
|
}
|
package/js/state/onInit.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import { checkToResolvePromise } from '../interpolations/attributes/checkToResolvePromise.function.js';
|
|
2
|
+
import { getSupportInCycle } from '../tag/getSupportInCycle.function.js';
|
|
1
3
|
import { state } from './state.function.js';
|
|
2
4
|
/** runs a callback function one time and never again. Same as calling state(() => ...) */
|
|
3
5
|
export function onInit(callback) {
|
|
4
|
-
state(
|
|
6
|
+
state(() => {
|
|
7
|
+
const result = callback();
|
|
8
|
+
const nowSupport = getSupportInCycle();
|
|
9
|
+
return checkToResolvePromise(result, nowSupport, nowSupport.context.global, 'onInit', { resolvePromise, resolveValue });
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function resolvePromise(x) {
|
|
13
|
+
return x;
|
|
14
|
+
}
|
|
15
|
+
function resolveValue(x) {
|
|
16
|
+
return x;
|
|
5
17
|
}
|
|
6
18
|
//# sourceMappingURL=onInit.js.map
|
package/js/state/onInit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onInit.js","sourceRoot":"","sources":["../../ts/state/onInit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"onInit.js","sourceRoot":"","sources":["../../ts/state/onInit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAA;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAI3C,0FAA0F;AAC1F,MAAM,UAAU,MAAM,CACpB,QAAwB;IAExB,KAAK,CAAC,GAAG,EAAE;QACT,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAA;QACzB,MAAM,UAAU,GAAG,iBAAiB,EAAgB,CAAA;QACpD,OAAO,qBAAqB,CAC1B,MAAM,EACN,UAAU,EACV,UAAU,CAAC,OAAO,CAAC,MAAM,EACzB,QAAQ,EACR,EAAE,cAAc,EAAE,YAAY,EAAE,CACjC,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,CAAC,CAAA;AACV,CAAC;AAED,SAAS,YAAY,CAAC,CAAM;IAC1B,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LikeObservable, SubscribeCallback, SubscribeValue } from "../tagJsVars/subscribe.function.js";
|
|
2
|
+
/** Have an html tagged value as value of subscribe emissions, with initial default value emission. Automatically unsubscribes for you */
|
|
3
|
+
export declare function pipe<SubValue, DEFAULT>(Observables: LikeObservable<SubValue>[], callback?: SubscribeCallback<SubValue | DEFAULT>): SubscribeValue;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getSupportWithState } from "../interpolations/attributes/getSupportWithState.function.js";
|
|
2
|
+
import { getSupportInCycle } from "../tag/getSupportInCycle.function.js";
|
|
3
|
+
import { ValueTypes } from "../tag/index.js";
|
|
4
|
+
import { deleteAndUnsubscribe, setupSubscribe } from "../tag/update/setupSubscribe.function.js";
|
|
5
|
+
/** Have an html tagged value as value of subscribe emissions, with initial default value emission. Automatically unsubscribes for you */
|
|
6
|
+
export function pipe(Observables, callback) {
|
|
7
|
+
return {
|
|
8
|
+
tagJsType: ValueTypes.subscribe,
|
|
9
|
+
processInit: processPipe,
|
|
10
|
+
delete: deleteAndUnsubscribe,
|
|
11
|
+
callback,
|
|
12
|
+
states: getSupportWithState(getSupportInCycle()).states,
|
|
13
|
+
// Observable: Observables[0],
|
|
14
|
+
Observables,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function processPipe(values, contextItem, ownerSupport, counts, appendTo, insertBefore) {
|
|
18
|
+
return setupSubscribe(values, contextItem, ownerSupport, counts, undefined, appendTo);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=pipe.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.function.js","sourceRoot":"","sources":["../../ts/state/pipe.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAElG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAA+C,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AAG/F,yIAAyI;AACzI,MAAM,UAAU,IAAI,CAClB,WAAuC,EACvC,QAAgD;IAEhD,OAAO;QACL,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,WAAW;QACxB,MAAM,EAAE,oBAAoB;QAE5B,QAAQ;QACR,MAAM,EAAE,mBAAmB,CAAE,iBAAiB,EAAgB,CAAC,CAAC,MAAM;QAEtE,8BAA8B;QAC9B,WAAW;KACZ,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAClB,MAA6B,EAC7B,WAAwB,EACxB,YAAwB,EACxB,MAAiB,EACjB,QAAkB,EAClB,YAAmB;IAEnB,OAAO,cAAc,CACnB,MAAM,EACN,WAAkC,EAClC,YAAY,EACZ,MAAM,EACN,SAAS,EACT,QAAQ,CACT,CAAA;AACH,CAAC"}
|
package/js/state/providers.js
CHANGED
|
@@ -31,7 +31,7 @@ export const providers = {
|
|
|
31
31
|
children: [],
|
|
32
32
|
};
|
|
33
33
|
stateDiffMemory.provider = provider;
|
|
34
|
-
const global = support.
|
|
34
|
+
const global = support.context.global;
|
|
35
35
|
const providers = global.providers = global.providers || [];
|
|
36
36
|
providers.push(provider);
|
|
37
37
|
stateDiffMemory.stateDiff = stateDiff;
|
|
@@ -61,7 +61,7 @@ function providerInject(constructor) {
|
|
|
61
61
|
ownerSupport: support.ownerSupport
|
|
62
62
|
};
|
|
63
63
|
while (owner.ownerSupport) {
|
|
64
|
-
const ownGlobal = owner.ownerSupport.
|
|
64
|
+
const ownGlobal = owner.ownerSupport.context.global;
|
|
65
65
|
const ownerProviders = ownGlobal.providers;
|
|
66
66
|
if (!ownerProviders) {
|
|
67
67
|
owner = owner.ownerSupport; // cause reloop checking next parent
|
|
@@ -75,7 +75,7 @@ function providerInject(constructor) {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
if (provider) {
|
|
78
|
-
const global = support.
|
|
78
|
+
const global = support.context.global;
|
|
79
79
|
const providers = global.providers = global.providers || [];
|
|
80
80
|
providers.push(provider);
|
|
81
81
|
provider.children.push(support);
|