taggedjs 2.8.30 → 2.8.32
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/index.d.ts +1 -0
- package/js/index.js +1 -0
- package/js/index.js.map +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +4 -4
- package/js/interpolations/attributes/processNameValueAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/specialAttribute.d.ts +2 -2
- package/js/interpolations/attributes/specialAttribute.js.map +1 -1
- package/js/interpolations/attributes/updateAttribute.function.d.ts +3 -3
- package/js/interpolations/attributes/updateAttribute.function.js.map +1 -1
- package/js/interpolations/interpolateTemplate.d.ts +0 -4
- package/js/interpolations/optimizers/attachDynamicDom.function.d.ts +3 -3
- package/js/interpolations/optimizers/attachDynamicDom.function.js.map +1 -1
- package/js/interpolations/optimizers/domProcessContextItem.function.d.ts +3 -3
- package/js/interpolations/optimizers/domProcessContextItem.function.js.map +1 -1
- package/js/render/attributes/processAttribute.function.d.ts +7 -6
- package/js/render/attributes/processAttribute.function.js +55 -38
- package/js/render/attributes/processAttribute.function.js.map +1 -1
- package/js/render/attributes/processUpdateAttrContext.function.d.ts +1 -1
- package/js/render/attributes/processUpdateAttrContext.function.js.map +1 -1
- package/js/render/buildBeforeElement.function.d.ts +3 -3
- package/js/render/buildBeforeElement.function.js +1 -5
- package/js/render/buildBeforeElement.function.js.map +1 -1
- package/js/render/dom/attachDomElements.function.d.ts +3 -3
- package/js/render/dom/attachDomElements.function.js +3 -3
- package/js/render/dom/attachDomElements.function.js.map +1 -1
- package/js/render/paint.function.d.ts +4 -0
- package/js/render/paint.function.js +21 -3
- package/js/render/paint.function.js.map +1 -1
- package/js/render/renderExistingTag.function.d.ts +1 -1
- package/js/render/renderExistingTag.function.js.map +1 -1
- package/js/render/renderTagElement.function.d.ts +1 -1
- package/js/render/renderTagElement.function.js +2 -2
- package/js/render/renderTagElement.function.js.map +1 -1
- package/js/render/renderTagOnly.function.d.ts +1 -1
- package/js/render/renderWithSupport.function.d.ts +1 -1
- package/js/render/update/processRenderOnceInit.function.d.ts +4 -4
- package/js/render/update/processRenderOnceInit.function.js +0 -2
- package/js/render/update/processRenderOnceInit.function.js.map +1 -1
- package/js/render/update/processTag.function.d.ts +4 -4
- package/js/render/update/processTag.function.js +1 -1
- package/js/render/update/processTag.function.js.map +1 -1
- package/js/render/update/updateExistingTagComponent.function.d.ts +1 -1
- package/js/render/update/updateExistingTagComponent.function.js +1 -1
- package/js/render/update/updateExistingTagComponent.function.js.map +1 -1
- package/js/state/index.d.ts +1 -1
- package/js/state/index.js +1 -1
- package/js/state/index.js.map +1 -1
- package/js/state/subscribe.function.d.ts +1 -1
- package/js/state/subscribeWith.function.d.ts +1 -1
- package/js/state/subscribeWith.function.js +6 -0
- package/js/state/subscribeWith.function.js.map +1 -1
- package/js/subject/signal.function.d.ts +1 -1
- package/js/tag/AdvancedContextItem.type.d.ts +5 -0
- package/js/tag/AdvancedContextItem.type.js +2 -0
- package/js/tag/AdvancedContextItem.type.js.map +1 -0
- package/js/tag/BaseSupport.type.d.ts +2 -1
- package/js/tag/Context.types.d.ts +3 -32
- package/js/tag/ContextItem.type.d.ts +26 -0
- package/js/tag/ContextItem.type.js +2 -0
- package/js/tag/ContextItem.type.js.map +1 -0
- package/js/tag/ProcessInit.type.d.ts +6 -0
- package/js/tag/ProcessInit.type.js +2 -0
- package/js/tag/ProcessInit.type.js.map +1 -0
- package/js/tag/StringTag.type.d.ts +3 -2
- package/js/tag/SupportContextItem.type.d.ts +7 -0
- package/js/tag/SupportContextItem.type.js +2 -0
- package/js/tag/SupportContextItem.type.js.map +1 -0
- package/js/tag/Tag.type.d.ts +9 -5
- package/js/tag/TagCounts.type.d.ts +4 -0
- package/js/tag/TagCounts.type.js +2 -0
- package/js/tag/TagCounts.type.js.map +1 -0
- package/js/tag/TemplateValue.type.d.ts +7 -0
- package/js/tag/TemplateValue.type.js +2 -0
- package/js/tag/TemplateValue.type.js.map +1 -0
- package/js/tag/checkDestroyPrevious.function.d.ts +2 -1
- package/js/tag/checkDestroyPrevious.function.js +5 -3
- package/js/tag/checkDestroyPrevious.function.js.map +1 -1
- package/js/tag/checkSimpleValueChange.function.d.ts +1 -1
- package/js/tag/checkTagValueChange.function.d.ts +4 -4
- package/js/tag/checkTagValueChange.function.js +2 -2
- package/js/tag/createHtmlSupport.function.d.ts +2 -7
- package/js/tag/createHtmlSupport.function.js.map +1 -1
- package/js/tag/createSupport.function.d.ts +1 -1
- package/js/tag/createSupport.function.js.map +1 -1
- package/js/tag/destroyContext.function.d.ts +1 -1
- package/js/tag/destroyContext.function.js +3 -2
- package/js/tag/destroyContext.function.js.map +1 -1
- package/js/tag/gaurenteeInserBefore.function.d.ts +4 -0
- package/js/tag/gaurenteeInserBefore.function.js +18 -0
- package/js/tag/gaurenteeInserBefore.function.js.map +1 -0
- package/js/tag/getDomTag.function.d.ts +3 -1
- package/js/tag/getDomTag.function.js +72 -17
- package/js/tag/getDomTag.function.js.map +1 -1
- package/js/tag/getTagWrap.function.js +1 -1
- package/js/tag/getTagWrap.function.js.map +1 -1
- package/js/tag/getTemplaterResult.function.d.ts +9 -5
- package/js/tag/getTemplaterResult.function.js +3 -0
- package/js/tag/getTemplaterResult.function.js.map +1 -1
- package/js/tag/guaranteeInsertBefore.function.d.ts +4 -0
- package/js/tag/guaranteeInsertBefore.function.js +18 -0
- package/js/tag/guaranteeInsertBefore.function.js.map +1 -0
- package/js/tag/hasPropChanges.function.d.ts +1 -1
- package/js/tag/hasPropChanges.function.js +1 -1
- package/js/tag/hasPropChanges.function.js.map +1 -1
- package/js/tag/html.js +1 -1
- package/js/tag/html.js.map +1 -1
- package/js/tag/index.d.ts +10 -3
- package/js/tag/index.js +4 -3
- package/js/tag/index.js.map +1 -1
- package/js/tag/loadNewBaseSupport.function.d.ts +1 -1
- package/js/tag/loadNewBaseSupport.function.js.map +1 -1
- package/js/tag/processUpdateContext.function.d.ts +1 -1
- package/js/tag/processUpdateContext.function.js +2 -0
- package/js/tag/processUpdateContext.function.js.map +1 -1
- package/js/tag/props/alterProp.function.d.ts +3 -4
- package/js/tag/props/alterProp.function.js +6 -7
- package/js/tag/props/alterProp.function.js.map +1 -1
- package/js/tag/props/clonePropsBy.function.js +1 -1
- package/js/tag/props/clonePropsBy.function.js.map +1 -1
- package/js/tag/tag.function.js +1 -1
- package/js/tag/tag.function.js.map +1 -1
- package/js/tag/tagElement.js +10 -3
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/update/SubContext.type.d.ts +16 -0
- package/js/tag/update/SubContext.type.js +2 -0
- package/js/tag/update/SubContext.type.js.map +1 -0
- package/js/tag/update/checkSubContext.function.d.ts +3 -0
- package/js/tag/update/checkSubContext.function.js +18 -0
- package/js/tag/update/checkSubContext.function.js.map +1 -0
- package/js/tag/update/compareArrayItems.function.d.ts +6 -5
- package/js/tag/update/compareArrayItems.function.js.map +1 -1
- package/js/tag/update/createAndProcessContextItem.function.d.ts +4 -4
- package/js/tag/update/createAndProcessContextItem.function.js +2 -3
- package/js/tag/update/createAndProcessContextItem.function.js.map +1 -1
- package/js/tag/update/deleteSubContext.function.d.ts +3 -0
- package/js/tag/update/deleteSubContext.function.js +25 -0
- package/js/tag/update/deleteSubContext.function.js.map +1 -0
- package/js/tag/update/forceUpdateExistingValue.function.d.ts +3 -3
- package/js/tag/update/forceUpdateExistingValue.function.js +2 -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/handleStillTag.function.d.ts +2 -2
- package/js/tag/update/handleStillTag.function.js.map +1 -1
- package/js/tag/update/index.d.ts +5 -0
- package/js/tag/update/index.js +5 -0
- package/js/tag/update/index.js.map +1 -0
- package/js/tag/update/onFirstSubContext.function.d.ts +7 -0
- package/js/tag/update/onFirstSubContext.function.js +8 -0
- package/js/tag/update/onFirstSubContext.function.js.map +1 -0
- package/js/tag/update/oneRenderToSupport.function.d.ts +1 -1
- package/js/tag/update/oneRenderToSupport.function.js +1 -1
- package/js/tag/update/oneRenderToSupport.function.js.map +1 -1
- package/js/tag/update/processDomTagInit.function.d.ts +7 -6
- package/js/tag/update/processDomTagInit.function.js +2 -4
- package/js/tag/update/processDomTagInit.function.js.map +1 -1
- package/js/tag/update/processFirstSubject.utils.d.ts +1 -6
- package/js/tag/update/processFirstSubjectComponent.function.d.ts +4 -4
- package/js/tag/update/processFirstSubjectComponent.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectValue.function.d.ts +6 -6
- package/js/tag/update/processFirstSubjectValue.function.js +4 -30
- package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
- package/js/tag/update/processNewSubjectTag.function.d.ts +3 -3
- package/js/tag/update/processNewSubjectTag.function.js +0 -2
- package/js/tag/update/processNewSubjectTag.function.js.map +1 -1
- package/js/tag/update/processRegularValue.function.d.ts +2 -2
- package/js/tag/update/processRegularValue.function.js +8 -9
- package/js/tag/update/processRegularValue.function.js.map +1 -1
- package/js/tag/update/processSubscribe.function.d.ts +8 -8
- package/js/tag/update/processSubscribe.function.js +1 -1
- package/js/tag/update/processSubscribe.function.js.map +1 -1
- package/js/tag/update/processTagArray.d.ts +5 -5
- package/js/tag/update/processTagArray.js.map +1 -1
- package/js/tag/update/processTagComponentInit.function.d.ts +5 -4
- package/js/tag/update/processTagComponentInit.function.js +0 -2
- package/js/tag/update/processTagComponentInit.function.js.map +1 -1
- package/js/tag/update/processTagInit.function.d.ts +4 -3
- package/js/tag/update/processTagInit.function.js +0 -2
- package/js/tag/update/processTagInit.function.js.map +1 -1
- package/js/tag/update/processTagResult.function.d.ts +4 -4
- package/js/tag/update/processTagResult.function.js +0 -2
- package/js/tag/update/processTagResult.function.js.map +1 -1
- package/js/tag/update/setupSubscribe.function.d.ts +9 -21
- package/js/tag/update/setupSubscribe.function.js +28 -80
- package/js/tag/update/setupSubscribe.function.js.map +1 -1
- package/js/tag/update/tagValueUpdateHandler.function.d.ts +3 -3
- package/js/tag/update/tagValueUpdateHandler.function.js.map +1 -1
- package/js/tag/update/tryUpdateToTag.function.d.ts +2 -2
- package/js/tag/update/tryUpdateToTag.function.js.map +1 -1
- package/js/tag/update/updateToDiffValue.function.d.ts +3 -3
- package/js/tag/update/updateToDiffValue.function.js +2 -0
- package/js/tag/update/updateToDiffValue.function.js.map +1 -1
- package/js/tag/update/valueToTagJsVar.function.d.ts +5 -0
- package/js/tag/update/valueToTagJsVar.function.js +55 -0
- package/js/tag/update/valueToTagJsVar.function.js.map +1 -0
- package/js/tagJsTypes/getInnerHTML.function.d.ts +13 -0
- package/js/tagJsTypes/getInnerHTML.function.js +35 -0
- package/js/tagJsTypes/getInnerHTML.function.js.map +1 -0
- package/js/tagJsTypes/index.d.ts +3 -0
- package/js/tagJsTypes/index.js +4 -0
- package/js/tagJsTypes/index.js.map +1 -0
- package/js/tagJsTypes/subscribe.function.d.ts +20 -0
- package/js/tagJsTypes/subscribe.function.js +15 -0
- package/js/tagJsTypes/subscribe.function.js.map +1 -0
- package/js/tagJsTypes/tag.function.d.ts +46 -0
- package/js/tagJsTypes/tag.function.js +110 -0
- package/js/tagJsTypes/tag.function.js.map +1 -0
- package/js/tagJsTypes/tagJsType.type.d.ts +7 -0
- package/js/tagJsTypes/tagJsType.type.js +2 -0
- package/js/tagJsTypes/tagJsType.type.js.map +1 -0
- package/js/tagJsVars/getArrayTagJsVar.function.d.ts +2 -0
- package/js/tagJsVars/getArrayTagJsVar.function.js +18 -0
- package/js/tagJsVars/getArrayTagJsVar.function.js.map +1 -0
- package/js/tagJsVars/getInnerHTML.function.d.ts +2 -0
- package/js/tagJsVars/getInnerHTML.function.js +35 -0
- package/js/tagJsVars/getInnerHTML.function.js.map +1 -0
- package/js/tagJsVars/getSimpleTagVar.function.d.ts +14 -0
- package/js/tagJsVars/getSimpleTagVar.function.js +49 -0
- package/js/tagJsVars/getSimpleTagVar.function.js.map +1 -0
- package/js/tagJsVars/index.d.ts +4 -0
- package/js/tagJsVars/index.js +5 -0
- package/js/tagJsVars/index.js.map +1 -0
- package/js/tagJsVars/subscribe.function.d.ts +21 -0
- package/js/tagJsVars/subscribe.function.js +21 -0
- package/js/tagJsVars/subscribe.function.js.map +1 -0
- package/js/tagJsVars/tag.function.d.ts +47 -0
- package/js/tagJsVars/tag.function.js +95 -0
- package/js/tagJsVars/tag.function.js.map +1 -0
- package/js/tagJsVars/tagJsVar.type.d.ts +12 -0
- package/js/tagJsVars/tagJsVar.type.js +2 -0
- package/js/tagJsVars/tagJsVar.type.js.map +1 -0
- package/js/tagJsVars/valueToTagJsVar.function.d.ts +4 -0
- package/js/tagJsVars/valueToTagJsVar.function.js +17 -0
- package/js/tagJsVars/valueToTagJsVar.function.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextItem } from '../
|
|
1
|
+
import type { TagCounts } from '../../tag/TagCounts.type.js';
|
|
2
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
3
3
|
import { AnySupport } from '../AnySupport.type.js';
|
|
4
|
-
|
|
4
|
+
import { TagJsVar } from '../../tagJsVars/tagJsVar.type.js';
|
|
5
|
+
export declare function processTagComponentInit(value: TagJsVar, contextItem: ContextItem, // could be tag via result.tag
|
|
5
6
|
ownerSupport: AnySupport, // owningSupport
|
|
6
|
-
counts:
|
|
7
|
+
counts: TagCounts, // {added:0, removed:0}
|
|
7
8
|
appendTo?: Element): AnySupport | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { checkTagValueChange } from '../checkTagValueChange.function.js';
|
|
2
1
|
import { processFirstSubjectComponent, processReplacementComponent } from './processFirstSubjectComponent.function.js';
|
|
3
2
|
import { getNewGlobal } from './getNewGlobal.function.js';
|
|
4
3
|
export function processTagComponentInit(value, contextItem, // could be tag via result.tag
|
|
@@ -6,7 +5,6 @@ ownerSupport, // owningSupport
|
|
|
6
5
|
counts, // {added:0, removed:0}
|
|
7
6
|
appendTo) {
|
|
8
7
|
getNewGlobal(contextItem);
|
|
9
|
-
contextItem.checkValueChange = checkTagValueChange;
|
|
10
8
|
if (appendTo) {
|
|
11
9
|
const processResult = processFirstSubjectComponent(value, contextItem, ownerSupport, counts, appendTo);
|
|
12
10
|
return processResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTagComponentInit.function.js","sourceRoot":"","sources":["../../../ts/tag/update/processTagComponentInit.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"processTagComponentInit.function.js","sourceRoot":"","sources":["../../../ts/tag/update/processTagComponentInit.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAA;AAItH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAKzD,MAAM,UAAU,uBAAuB,CACrC,KAAe,EACf,WAAwB,EAAE,8BAA8B;AACxD,YAAwB,EAAE,gBAAgB;AAC1C,MAAiB,EAAE,uBAAuB;AAC1C,QAAkB;IAElB,YAAY,CAAC,WAAW,CAAqB,CAAA;IAE7C,IAAG,QAAQ,EAAE,CAAC;QACZ,MAAM,aAAa,GAAG,4BAA4B,CAChD,KAAwB,EACxB,WAAiC,EACjC,YAAY,EACZ,MAAM,EACN,QAAmB,CACpB,CAAA;QAED,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,MAAM,aAAa,GAAG,2BAA2B,CAC/C,KAAwB,EACxB,WAAiC,EACjC,YAAY,EACZ,MAAM,CACP,CAAA;IAED,OAAO,aAAa,CAAA;AACtB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextItem } from '../
|
|
1
|
+
import type { TagCounts } from '../../tag/TagCounts.type.js';
|
|
2
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
3
3
|
import { AnySupport } from '../AnySupport.type.js';
|
|
4
|
-
|
|
4
|
+
import { TagJsVar } from '../../tagJsVars/tagJsVar.type.js';
|
|
5
|
+
export declare function processTagInit(value: TagJsVar, contextItem: ContextItem, ownerSupport: AnySupport, counts: TagCounts, appendTo?: Element | undefined, insertBefore?: Text): AnySupport;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { checkTagValueChange } from '../checkTagValueChange.function.js';
|
|
2
1
|
import { processTag } from '../../render/update/processTag.function.js';
|
|
3
2
|
import { processNewSubjectTag } from './processNewSubjectTag.function.js';
|
|
4
3
|
export function processTagInit(value, contextItem, ownerSupport, counts, appendTo, insertBefore) {
|
|
5
|
-
contextItem.checkValueChange = checkTagValueChange;
|
|
6
4
|
if (appendTo) {
|
|
7
5
|
return processNewSubjectTag(value, contextItem, ownerSupport, counts, appendTo, insertBefore);
|
|
8
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTagInit.function.js","sourceRoot":"","sources":["../../../ts/tag/update/processTagInit.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"processTagInit.function.js","sourceRoot":"","sources":["../../../ts/tag/update/processTagInit.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAA;AAKvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAIzE,MAAM,UAAU,cAAc,CAC5B,KAAe,EACf,WAAwB,EACxB,YAAwB,EACxB,MAAiB,EACjB,QAA8B,EAC9B,YAAmB;IAEnB,IAAG,QAAQ,EAAE,CAAC;QACZ,OAAO,oBAAoB,CACzB,KAAwB,EACxB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,YAAY,CACb,CAAA;IACH,CAAC;IAED,OAAO,UAAU,CACf,YAAY,EACZ,WAAiC,EACjC,MAAM,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextItem } from '../
|
|
1
|
+
import { TagCounts } from '../TagCounts.type.js';
|
|
2
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
3
3
|
import { AnySupport } from '../AnySupport.type.js';
|
|
4
|
-
export declare function processReplaceTagResult(support: AnySupport, counts:
|
|
5
|
-
export declare function processFirstTagResult(support: AnySupport, counts:
|
|
4
|
+
export declare function processReplaceTagResult(support: AnySupport, counts: TagCounts, contextItem: ContextItem): AnySupport;
|
|
5
|
+
export declare function processFirstTagResult(support: AnySupport, counts: TagCounts, appendTo: Element): AnySupport;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { buildBeforeElement } from '../../render/buildBeforeElement.function.js';
|
|
2
2
|
import { paintAppend, paintAppends } from '../../render/paint.function.js';
|
|
3
|
-
import { checkTagValueChange } from '../index.js';
|
|
4
3
|
export function processReplaceTagResult(support, counts, contextItem) {
|
|
5
|
-
contextItem.checkValueChange = checkTagValueChange;
|
|
6
4
|
const ph = contextItem.placeholder;
|
|
7
5
|
buildBeforeElement(support, counts, undefined, // element for append child
|
|
8
6
|
ph);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTagResult.function.js","sourceRoot":"","sources":["../../../ts/tag/update/processTagResult.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAEhF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"processTagResult.function.js","sourceRoot":"","sources":["../../../ts/tag/update/processTagResult.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAEhF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAI1E,MAAM,UAAU,uBAAuB,CACrC,OAAmB,EACnB,MAAiB,EACjB,WAAwB;IAExB,MAAM,EAAE,GAAG,WAAW,CAAC,WAAmB,CAAA;IAE1C,kBAAkB,CAChB,OAAO,EACP,MAAM,EACN,SAAS,EAAE,2BAA2B;IACtC,EAAE,CACH,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,OAAmB,EACnB,MAAiB,EACjB,QAAiB;IAEjB,IAAI,WAAW,GAAG,YAAY,CAAC,MAAM,CAAA;IAErC,MAAM,MAAM,GAAG,kBAAkB,CAC/B,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,CACV,CAAA;IAED,KAAI,MAAM,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;QAC5B,IAAG,GAAG,CAAC,UAAU,EAAE,CAAC;YAClB,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE;gBACpC,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC;gBAChC,SAAS,EAAE,WAAW;aACvB,CAAC,CAAA;QACJ,CAAC;QACD,IAAG,GAAG,CAAC,MAAM,EAAE,CAAC;YACd,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE;gBACpC,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC;gBAC5B,SAAS,EAAE,WAAW;aACvB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LikeObservable, SubscribeCallback } from '../../state/subscribe.function.js';
|
|
5
|
-
import { Subscription } from '../../state/subscribe.function.js';
|
|
6
|
-
import { StatesSetter } from '../../state/states.utils.js';
|
|
1
|
+
import type { TagCounts } from '../TagCounts.type.js';
|
|
2
|
+
import { AdvancedContextItem } from '../AdvancedContextItem.type.js';
|
|
3
|
+
import { LikeObservable, SubscribeCallback } from '../../tagJsVars/subscribe.function.js';
|
|
7
4
|
import { AnySupport } from '../AnySupport.type.js';
|
|
8
|
-
|
|
5
|
+
import { SubContext } from './SubContext.type.js';
|
|
6
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
7
|
+
export declare function setupSubscribe(observable: LikeObservable<any>, contextItem: AdvancedContextItem, ownerSupport: AnySupport, counts: TagCounts, callback?: SubscribeCallback<any>, appendTo?: Element, insertBeforeOriginal?: Text): SubContext;
|
|
9
8
|
export declare function setupSubscribeCallbackProcessor(observable: LikeObservable<any>, ownerSupport: AnySupport, // ownerSupport ?
|
|
10
|
-
counts:
|
|
11
|
-
callback?: SubscribeCallback<any
|
|
12
|
-
export
|
|
13
|
-
hasEmitted: boolean;
|
|
14
|
-
deleted: boolean;
|
|
15
|
-
states: StatesSetter[];
|
|
16
|
-
/** Handles emissions from subject and figures out what to display */
|
|
17
|
-
handler: (value: TemplateValue) => void;
|
|
18
|
-
lastValue: any;
|
|
19
|
-
callback?: SubscribeCallback<any>;
|
|
20
|
-
subscription: Subscription;
|
|
21
|
-
appendMarker?: Text;
|
|
22
|
-
contextItem: AdvancedContextItem;
|
|
23
|
-
};
|
|
9
|
+
counts: TagCounts, // used for animation stagger computing
|
|
10
|
+
insertBefore: Text, callback?: SubscribeCallback<any>): SubContext;
|
|
11
|
+
export declare function deleteAndUnsubscribe(contextItem: ContextItem, ownerSupport: AnySupport): 77 | undefined;
|
|
@@ -1,109 +1,57 @@
|
|
|
1
|
-
import { paint
|
|
1
|
+
import { paint } from '../../render/paint.function.js';
|
|
2
2
|
import { setUseMemory } from '../../state/setUseMemory.object.js';
|
|
3
3
|
import { syncSupports } from '../../state/syncStates.function.js';
|
|
4
4
|
import { forceUpdateExistingValue } from './forceUpdateExistingValue.function.js';
|
|
5
5
|
import { getSupportWithState } from '../../interpolations/attributes/getSupportWithState.function.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
export function setupSubscribe(observable, contextItem, ownerSupport, counts, callback, appendTo,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
args: [appendTo, insertBefore]
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
const subscription = setupSubscribeCallbackProcessor(observable, ownerSupport, counts, callback, insertBefore);
|
|
21
|
-
subscription.appendMarker = appendMarker;
|
|
22
|
-
contextItem.subscription = subscription;
|
|
23
|
-
contextItem.delete = deleteSubscribe;
|
|
24
|
-
contextItem.handler = checkSubscribeFrom;
|
|
25
|
-
return subscription;
|
|
6
|
+
import { deleteSubContext } from './deleteSubContext.function.js';
|
|
7
|
+
import { checkSubContext } from './checkSubContext.function.js';
|
|
8
|
+
import { onFirstSubContext } from './onFirstSubContext.function.js';
|
|
9
|
+
import { guaranteeInsertBefore } from '../guaranteeInsertBefore.function.js';
|
|
10
|
+
export function setupSubscribe(observable, contextItem, ownerSupport, counts, callback, appendTo, insertBeforeOriginal) {
|
|
11
|
+
const { appendMarker, insertBefore } = guaranteeInsertBefore(appendTo, insertBeforeOriginal);
|
|
12
|
+
const subContext = setupSubscribeCallbackProcessor(observable, ownerSupport, counts, insertBefore, callback);
|
|
13
|
+
subContext.appendMarker = appendMarker;
|
|
14
|
+
contextItem.subContext = subContext;
|
|
15
|
+
contextItem.handler = checkSubContext;
|
|
16
|
+
return subContext;
|
|
26
17
|
}
|
|
27
18
|
export function setupSubscribeCallbackProcessor(observable, ownerSupport, // ownerSupport ?
|
|
28
19
|
counts, // used for animation stagger computing
|
|
29
|
-
|
|
20
|
+
insertBefore, callback) {
|
|
30
21
|
const component = getSupportWithState(ownerSupport);
|
|
31
22
|
let onValue = function onSubValue(value) {
|
|
32
|
-
|
|
33
|
-
subscription.contextItem = createAndProcessContextItem(value, ownerSupport, counts, insertBefore);
|
|
34
|
-
/*
|
|
35
|
-
if(!syncRun && !setUseMemory.stateConfig.support) {
|
|
36
|
-
paint()
|
|
37
|
-
}
|
|
38
|
-
*/
|
|
23
|
+
onFirstSubContext(value, subContext, ownerSupport, counts, insertBefore);
|
|
39
24
|
// from now on just run update
|
|
40
25
|
onValue = function subscriptionUpdate(value) {
|
|
41
|
-
forceUpdateExistingValue(
|
|
26
|
+
forceUpdateExistingValue(subContext.contextItem, value, ownerSupport);
|
|
42
27
|
if (!syncRun && !setUseMemory.stateConfig.support) {
|
|
43
28
|
paint();
|
|
44
29
|
}
|
|
45
30
|
};
|
|
46
31
|
};
|
|
47
32
|
// onValue mutates so function below calls original and mutation
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
function valueHandler(value) {
|
|
34
|
+
subContext.lastValue = value;
|
|
50
35
|
const newComponent = component.subject.global.newest;
|
|
51
36
|
syncSupports(newComponent, component);
|
|
52
|
-
if (
|
|
53
|
-
value =
|
|
37
|
+
if (subContext.callback) {
|
|
38
|
+
value = subContext.callback(value);
|
|
54
39
|
}
|
|
55
40
|
onValue(value);
|
|
56
|
-
}
|
|
41
|
+
}
|
|
57
42
|
let syncRun = true;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
hasEmitted: false,
|
|
61
|
-
handler: valueChangeHandler,
|
|
43
|
+
const subContext = {
|
|
44
|
+
valueHandler,
|
|
62
45
|
callback,
|
|
63
|
-
states: component.states,
|
|
64
|
-
lastValue: undefined,
|
|
65
|
-
subscription: undefined, // must be populated AFTER "subscription" variable defined incase called on subscribe
|
|
66
46
|
};
|
|
67
|
-
|
|
47
|
+
// HINT: Must subscribe AFTER initial variable created above incase subscribing causes immediate run
|
|
48
|
+
subContext.subscription = observable.subscribe(valueHandler);
|
|
68
49
|
syncRun = false;
|
|
69
|
-
return
|
|
50
|
+
return subContext;
|
|
70
51
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
contextItem.delete(contextItem, ownerSupport);
|
|
74
|
-
updateToDiffValue(newValue, contextItem, ownerSupport, 99);
|
|
75
|
-
return 99;
|
|
76
|
-
}
|
|
77
|
-
const subscription = contextItem.subscription;
|
|
78
|
-
if (!subscription.hasEmitted) {
|
|
79
|
-
return -1;
|
|
80
|
-
}
|
|
81
|
-
subscription.callback = newValue.callback;
|
|
82
|
-
subscription.handler(subscription.lastValue);
|
|
83
|
-
const newComponent = getSupportWithState(ownerSupport);
|
|
84
|
-
subscription.states = newComponent.states;
|
|
85
|
-
return -1;
|
|
86
|
-
}
|
|
87
|
-
function deleteSubscribe(contextItem, ownerSupport) {
|
|
88
|
-
const subscription = contextItem.subscription;
|
|
89
|
-
subscription.deleted = true;
|
|
90
|
-
delete contextItem.subscription;
|
|
52
|
+
export function deleteAndUnsubscribe(contextItem, ownerSupport) {
|
|
53
|
+
const subscription = contextItem.subContext;
|
|
91
54
|
subscription.subscription.unsubscribe();
|
|
92
|
-
|
|
93
|
-
if (appendMarker) {
|
|
94
|
-
paintCommands.push({
|
|
95
|
-
processor: paintRemover,
|
|
96
|
-
args: [appendMarker],
|
|
97
|
-
});
|
|
98
|
-
delete subscription.appendMarker;
|
|
99
|
-
}
|
|
100
|
-
delete contextItem.delete;
|
|
101
|
-
// delete contextItem.handler
|
|
102
|
-
contextItem.handler = tagValueUpdateHandler;
|
|
103
|
-
if (!subscription.hasEmitted) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
subscription.contextItem.delete(subscription.contextItem, ownerSupport);
|
|
107
|
-
return 77;
|
|
55
|
+
return deleteSubContext(contextItem, ownerSupport);
|
|
108
56
|
}
|
|
109
57
|
//# sourceMappingURL=setupSubscribe.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupSubscribe.function.js","sourceRoot":"","sources":["../../../ts/tag/update/setupSubscribe.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupSubscribe.function.js","sourceRoot":"","sources":["../../../ts/tag/update/setupSubscribe.function.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC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B;YACxD,wBAAwB,CACtB,UAAU,CAAC,WAAkC,EAC7C,KAAK,EACL,YAAY,CACb,CAAA;YAED,IAAG,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBACjD,KAAK,EAAE,CAAA;YACT,CAAC;QACH,CAAC,CAAA;IACH,CAAC,CAAA;IAED,gEAAgE;IAChE,SAAS,YAAY,CAAC,KAAoB;QACxC,UAAU,CAAC,SAAS,GAAG,KAAK,CAAA;QAE5B,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAA;QACpD,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;QAErC,IAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;YACvB,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACpC,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,CAAA;IAChB,CAAC;IAED,IAAI,OAAO,GAAG,IAAI,CAAA;IAElB,MAAM,UAAU,GAAG;QACjB,YAAY;QACZ,QAAQ;KACc,CAAA;IAExB,oGAAoG;IACpG,UAAU,CAAC,YAAY,GAAG,UAAU,CAAC,SAAS,CAAE,YAAY,CAAE,CAAA;IAE9D,OAAO,GAAG,KAAK,CAAA;IAEf,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,WAAwB,EACxB,YAAwB;IAExB,MAAM,YAAY,GAAG,WAAW,CAAC,UAAiC,CAAA;IAElE,YAAY,CAAC,YAAY,CAAC,WAAW,EAAE,CAAA;IAEvC,OAAO,gBAAgB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SupportContextItem } from '../
|
|
1
|
+
import { SupportContextItem } from '../SupportContextItem.type.js';
|
|
2
2
|
import { TemplaterResult } from '../getTemplaterResult.function.js';
|
|
3
|
-
import { TemplateValue } from './processFirstSubject.utils.js';
|
|
4
|
-
import { ContextItem } from '../Context.types.js';
|
|
5
3
|
import { AnySupport } from '../AnySupport.type.js';
|
|
4
|
+
import { TemplateValue } from '../TemplateValue.type.js';
|
|
5
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
6
6
|
/** Checks if value has changed before updating. Used for all tag value updates. Determines if value changed since last render */
|
|
7
7
|
export declare function tagValueUpdateHandler(newValue: TemplateValue, // newValue
|
|
8
8
|
ownerSupport: AnySupport, contextItem: ContextItem | SupportContextItem): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagValueUpdateHandler.function.js","sourceRoot":"","sources":["../../../ts/tag/update/tagValueUpdateHandler.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAA;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAA;
|
|
1
|
+
{"version":3,"file":"tagValueUpdateHandler.function.js","sourceRoot":"","sources":["../../../ts/tag/update/tagValueUpdateHandler.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAA;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAA;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAK5D,iIAAiI;AACjI,MAAM,UAAU,qBAAqB,CACnC,QAAuB,EAAE,WAAW;AACpC,YAAwB,EACxB,WAA6C;IAE7C,gDAAgD;IAChD,IAAG,QAAQ,KAAK,WAAW,CAAC,KAAK,EAAE,CAAC;QAClC,OAAM;IACR,CAAC;IAED,wBAAwB,CAAC,WAAkC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;AACtF,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,SAA0B,EAC1B,WAA8B,EAC9B,YAAwB;IAExB,MAAM,MAAM,GAAG,WAAW,CAAC,MAA0B,CAAA;IACrD,sCAAsC;IACtC,IAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,2BAA2B,CACzB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,EAAC,KAAK,EAAC,CAAC,EAAE,OAAO,EAAC,CAAC,EAAC,CACrB,CAAA;QACD,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,aAAa,CAC3B,SAAS,EACT,YAAY,EACZ,YAAY,CAAC,UAAU,EACvB,WAAW,CACZ,CAAA;IAED,0BAA0B,CACxB,YAAY,EACZ,OAAO,EAAE,eAAe;IACxB,WAAW,CACZ,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnySupport } from '../AnySupport.type.js';
|
|
2
|
-
import { SupportContextItem } from '../
|
|
2
|
+
import { SupportContextItem } from '../SupportContextItem.type.js';
|
|
3
3
|
import { TemplaterResult } from '../getTemplaterResult.function.js';
|
|
4
|
-
import { ContextItem } from '../
|
|
4
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
5
5
|
/** result is an indication to ignore further processing but that does not seem in use anymore */
|
|
6
6
|
export declare function tryUpdateToTag(contextItem: ContextItem | SupportContextItem, newValue: TemplaterResult, // newValue
|
|
7
7
|
ownerSupport: AnySupport): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tryUpdateToTag.function.js","sourceRoot":"","sources":["../../../ts/tag/update/tryUpdateToTag.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAA;AAIhH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,8B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WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAqB,CAAA;IAC3G,SAAS,CAAC,MAAM,GAAG,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;IAE9E,UAAU,CACR,YAAY,EACZ,WAAiC,EACjC,SAAS,CACV,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SupportContextItem } from '../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { SupportContextItem } from '../SupportContextItem.type.js';
|
|
2
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
3
|
+
import { TemplateValue } from '../index.js';
|
|
4
4
|
import { AnySupport } from '../AnySupport.type.js';
|
|
5
5
|
export declare function updateToDiffValue(newValue: TemplateValue, contextItem: ContextItem | SupportContextItem, ownerSupport: AnySupport, ignoreOrDestroyed: number | boolean): void;
|
|
@@ -3,6 +3,7 @@ import { tryUpdateToTag } from './tryUpdateToTag.function.js';
|
|
|
3
3
|
import { isArray } from '../../isInstance.js';
|
|
4
4
|
import { processTagArray } from './processTagArray.js';
|
|
5
5
|
import { processNowRegularValue } from './processRegularValue.function.js';
|
|
6
|
+
import { getArrayTagVar } from '../../tagJsVars/getArrayTagJsVar.function.js';
|
|
6
7
|
export function updateToDiffValue(newValue, contextItem, ownerSupport, ignoreOrDestroyed) {
|
|
7
8
|
// is new value a tag?
|
|
8
9
|
const tagJsType = newValue && newValue.tagJsType;
|
|
@@ -15,6 +16,7 @@ export function updateToDiffValue(newValue, contextItem, ownerSupport, ignoreOrD
|
|
|
15
16
|
}
|
|
16
17
|
if (isArray(newValue)) {
|
|
17
18
|
processTagArray(contextItem, newValue, ownerSupport, { added: 0, removed: 0 });
|
|
19
|
+
contextItem.tagJsVar = getArrayTagVar(newValue);
|
|
18
20
|
return;
|
|
19
21
|
}
|
|
20
22
|
if (typeof (newValue) === BasicTypes.function) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateToDiffValue.function.js","sourceRoot":"","sources":["../../../ts/tag/update/updateToDiffValue.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateToDiffValue.function.js","sourceRoot":"","sources":["../../../ts/tag/update/updateToDiffValue.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAA6C,UAAU,EAAE,MAAM,aAAa,CAAA;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAgB,MAAM,mCAAmC,CAAA;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAA;AAE7E,MAAM,UAAU,iBAAiB,CAC/B,QAAuB,EACvB,WAA6C,EAC7C,YAAwB,EACxB,iBAAmC;IAEnC,sBAAsB;IACtB,MAAM,SAAS,GAAG,QAAQ,IAAK,QAA4B,CAAC,SAAsB,CAAA;IAClF,IAAG,SAAS,EAAE,CAAC;QACb,IAAG,SAAS,KAAK,UAAU,CAAC,UAAU,EAAE,CAAC;YACvC,OAAM;QACR,CAAC;QAED,cAAc,CACZ,WAAW,EACX,QAA2B,EAC3B,YAAY,CACb,CAAA;QAED,OAAM;IACR,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAG,CAAC;QACvB,eAAe,CACb,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,EAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAC,CACvB,CAAA;QACD,WAAW,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;QAE/C,OAAM;IACR,CAAC;IAED,IAAG,OAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5C,WAAW,CAAC,KAAK,GAAG,QAAQ,CAAA,CAAC,gFAAgF;QAC7G,OAAM;IACR,CAAC;IAED,IAAG,iBAAiB,EAAE,CAAC;QACrB,sBAAsB,CACpB,QAAwB,EACxB,WAAW,CACZ,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ContextItem } from '../ContextItem.type.js';
|
|
2
|
+
import { TemplateValue } from '../TemplateValue.type.js';
|
|
3
|
+
import { TagJsVar } from '../../tagJsVars/tagJsVar.type.js';
|
|
4
|
+
import { Tag } from '../Tag.type.js';
|
|
5
|
+
export declare function valueToTagJsVar(value: TemplateValue | Tag | TagJsVar, contextItem: ContextItem): TagJsVar;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { checkArrayValueChange } from '../checkDestroyPrevious.function.js';
|
|
2
|
+
import { checkSimpleValueChange, deleteSimpleValue } from '../checkSimpleValueChange.function.js';
|
|
3
|
+
import { castTextValue } from '../../castTextValue.function.js';
|
|
4
|
+
import { isArray } from '../../isInstance.js';
|
|
5
|
+
import { processTagArray } from './processTagArray.js';
|
|
6
|
+
import { paintBeforeText, paintCommands } from '../../render/paint.function.js';
|
|
7
|
+
export function valueToTagJsVar(value, contextItem) {
|
|
8
|
+
const tagJsType = value?.tagJsType;
|
|
9
|
+
if (tagJsType) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
return getSimpleTagVar(value, contextItem);
|
|
13
|
+
}
|
|
14
|
+
function getSimpleTagVar(value, contextItem) {
|
|
15
|
+
if (isArray(value)) {
|
|
16
|
+
contextItem.checkValueChange = checkArrayValueChange;
|
|
17
|
+
return {
|
|
18
|
+
tagJsType: 'array',
|
|
19
|
+
value,
|
|
20
|
+
processInit: processArrayInit,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
contextItem.checkValueChange = checkSimpleValueChange;
|
|
24
|
+
contextItem.delete = deleteSimpleValue;
|
|
25
|
+
return {
|
|
26
|
+
tagJsType: 'simple',
|
|
27
|
+
value,
|
|
28
|
+
processInit: processSimpleValueInit
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function processSimpleValueInit(value, // TemplateValue | StringTag | SubscribeValue | SignalObject,
|
|
32
|
+
contextItem, ownerSupport, counts, // {added:0, removed:0}
|
|
33
|
+
appendTo, insertBefore) {
|
|
34
|
+
// value = value.value
|
|
35
|
+
const castedValue = castTextValue(value);
|
|
36
|
+
insertBefore = contextItem.placeholder;
|
|
37
|
+
// always insertBefore for content
|
|
38
|
+
const paint = contextItem.paint = {
|
|
39
|
+
processor: paintBeforeText,
|
|
40
|
+
args: [insertBefore, castedValue, (x) => {
|
|
41
|
+
contextItem.simpleValueElm = x;
|
|
42
|
+
delete contextItem.paint;
|
|
43
|
+
}],
|
|
44
|
+
};
|
|
45
|
+
paintCommands.push(paint);
|
|
46
|
+
contextItem.checkValueChange = checkSimpleValueChange;
|
|
47
|
+
contextItem.delete = deleteSimpleValue;
|
|
48
|
+
}
|
|
49
|
+
function processArrayInit(value, // TemplateValue | StringTag | SubscribeValue | SignalObject,
|
|
50
|
+
contextItem, ownerSupport, counts, // {added:0, removed:0}
|
|
51
|
+
appendTo, insertBefore) {
|
|
52
|
+
const subValue = value;
|
|
53
|
+
processTagArray(contextItem, subValue, ownerSupport, counts, appendTo);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=valueToTagJsVar.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueToTagJsVar.function.js","sourceRoot":"","sources":["../../../ts/tag/update/valueToTagJsVar.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAG/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBA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AC9B,OAAO,WAAW,CAAC,KAAK,CAAA;YAC1B,CAAC,CAAC;KACH,CAAA;IACD,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAEzB,WAAW,CAAC,gBAAgB,GAAG,sBAAsB,CAAA;IACrD,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAA;AACxC,CAAC;AAED,SAAS,gBAAgB,CACvB,KAAe,EAAE,6DAA6D;AAC9E,WAAwB,EACxB,YAAwB,EACxB,MAAiB,EAAE,uBAAuB;AAC1C,QAAkB,EAClB,YAAmB;IAEnB,MAAM,QAAQ,GAAG,KAAY,CAAA;IAE7B,eAAe,CACb,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,QAAQ,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnySupport, ContextItem, TagCounts } from "../index.js";
|
|
2
|
+
import { ProcessInit } from "../tag/ProcessInit.type.js";
|
|
3
|
+
type InnerHTMLValue = {
|
|
4
|
+
tagJsType: 'innerHTML';
|
|
5
|
+
processInit: ProcessInit;
|
|
6
|
+
};
|
|
7
|
+
declare function processInnerHTML(value: InnerHTMLValue, contextItem: ContextItem, ownerSupport: AnySupport, counts: TagCounts, // {added:0, removed:0}
|
|
8
|
+
appendTo?: Element, insertBefore?: Text): void;
|
|
9
|
+
export declare function getInnerHTML(): {
|
|
10
|
+
tagJsType: string;
|
|
11
|
+
processInit: typeof processInnerHTML;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { deleteSubContext, guaranteeInsertBefore, onFirstSubContext } from "../index.js";
|
|
2
|
+
import { forceUpdateExistingValue } from "../tag/update/index.js";
|
|
3
|
+
function handleInnerHTML(value, newSupport, contextItem, values) {
|
|
4
|
+
const owner = value.owner;
|
|
5
|
+
const realValue = owner._innerHTML;
|
|
6
|
+
realValue.processInit = realValue.oldProcessInit;
|
|
7
|
+
const context = contextItem.subContext?.contextItem;
|
|
8
|
+
forceUpdateExistingValue(context, realValue, newSupport);
|
|
9
|
+
}
|
|
10
|
+
function processInnerHTML(value, contextItem, ownerSupport, counts, // {added:0, removed:0}
|
|
11
|
+
appendTo, insertBefore) {
|
|
12
|
+
contextItem.subContext = {};
|
|
13
|
+
contextItem.delete = deleteSubContext;
|
|
14
|
+
// contextItem.checkValueChange = checkInnerHTML
|
|
15
|
+
contextItem.handler = handleInnerHTML;
|
|
16
|
+
checkInnerHTML(value, ownerSupport, contextItem, counts, insertBefore, appendTo);
|
|
17
|
+
}
|
|
18
|
+
function checkInnerHTML(value, ownerSupport, contextItem, counts, // {added:0, removed:0}
|
|
19
|
+
insertBeforeOriginal, appendTo) {
|
|
20
|
+
const { appendMarker, insertBefore } = guaranteeInsertBefore(appendTo, insertBeforeOriginal);
|
|
21
|
+
const subContext = contextItem.subContext;
|
|
22
|
+
subContext.appendMarker = appendMarker;
|
|
23
|
+
const owner = value.owner;
|
|
24
|
+
const realValue = owner._innerHTML;
|
|
25
|
+
realValue.processInit = realValue.oldProcessInit;
|
|
26
|
+
/** Render the content that will CONTAIN the innerHTML */
|
|
27
|
+
onFirstSubContext(realValue, subContext, ownerSupport, counts, insertBefore);
|
|
28
|
+
}
|
|
29
|
+
export function getInnerHTML() {
|
|
30
|
+
return {
|
|
31
|
+
tagJsType: 'innerHTML',
|
|
32
|
+
processInit: processInnerHTML,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=getInnerHTML.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInnerHTML.function.js","sourceRoot":"","sources":["../../ts/tagJsTypes/getInnerHTML.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAA;AAG7J,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAOjE,SAAS,eAAe,CACpB,KAA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CACb,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,gBAAgB;KAC9B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/tagJsTypes/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ProcessInit } from "../tag/ProcessInit.type.js";
|
|
2
|
+
import { ValueTypes } from "../tag/index.js";
|
|
3
|
+
import { StatesSetter } from "../state/states.utils.js";
|
|
4
|
+
export type LikeSubscription = {
|
|
5
|
+
unsubscribe: () => any;
|
|
6
|
+
};
|
|
7
|
+
export type LikeObservable<T> = {
|
|
8
|
+
subscribe: (callback: (arg: T) => any) => (LikeSubscription);
|
|
9
|
+
};
|
|
10
|
+
export type SubscribeCallback<T> = (data: T) => any;
|
|
11
|
+
/** Have an html tagged value as value of subscribe emissions. Automatically unsubscribes for you */
|
|
12
|
+
export declare function subscribe<T>(Observable: LikeObservable<T>, callback?: SubscribeCallback<T>): SubscribeValue;
|
|
13
|
+
export type SubscribeValue = {
|
|
14
|
+
tagJsType: typeof ValueTypes.subscribe;
|
|
15
|
+
processInit: ProcessInit;
|
|
16
|
+
states: StatesSetter[];
|
|
17
|
+
Observable: LikeObservable<any>;
|
|
18
|
+
withDefault?: any;
|
|
19
|
+
callback?: SubscribeCallback<any>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { processSubscribe } from "../tag/update/processSubscribe.function.js";
|
|
5
|
+
/** Have an html tagged value as value of subscribe emissions. Automatically unsubscribes for you */
|
|
6
|
+
export function subscribe(Observable, callback) {
|
|
7
|
+
return {
|
|
8
|
+
tagJsType: ValueTypes.subscribe,
|
|
9
|
+
processInit: processSubscribe,
|
|
10
|
+
Observable,
|
|
11
|
+
callback,
|
|
12
|
+
states: getSupportWithState(getSupportInCycle()).states,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=subscribe.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.function.js","sourceRoot":"","sources":["../../ts/tagJsTypes/subscribe.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAGlG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAA;AAa7E,oGAAoG;AACpG,MAAM,UAAU,SAAS,CACvB,UAA6B,EAC7B,QAA+B;IAE/B,OAAO;QACL,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,gBAAgB;QAE7B,UAAU;QACV,QAAQ;QACR,MAAM,EAAE,mBAAmB,CAAE,iBAAiB,EAAgB,CAAC,CAAC,MAAM;KACvE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { KeyFunction } from '../tag/getDomTag.function.js';
|
|
2
|
+
import { Original } from '../tag/tag.utils.js';
|
|
3
|
+
import { RouteProps, RouteTag, StateToTag, ToTag } from '../tag/tag.types.js';
|
|
4
|
+
import { UnknownFunction } from '../tag/update/oneRenderToSupport.function.js';
|
|
5
|
+
import { AnyTag } from '../tag/AnyTag.type.js';
|
|
6
|
+
/** TODO: This might be a duplicate typing of Wrapper */
|
|
7
|
+
export type TaggedFunction<T extends ToTag> = ((...x: Parameters<T>) => ReturnType<T> & {
|
|
8
|
+
key: KeyFunction;
|
|
9
|
+
original?: Original;
|
|
10
|
+
compareTo?: string;
|
|
11
|
+
}) & {
|
|
12
|
+
original: UnknownFunction;
|
|
13
|
+
};
|
|
14
|
+
/** How to handle checking for prop changes aka argument changes */
|
|
15
|
+
export declare enum PropWatches {
|
|
16
|
+
DEEP = "deep",
|
|
17
|
+
/** checks all values up to 2 levels deep */
|
|
18
|
+
SHALLOW = "shallow",
|
|
19
|
+
NONE = "none",
|
|
20
|
+
IMMUTABLE = "immutable"
|
|
21
|
+
}
|
|
22
|
+
/** Wraps a function tag in a state manager and calls wrapped function on event cycles
|
|
23
|
+
* For single rendering, no event cycles, use: tag.renderOnce = (props) => html``
|
|
24
|
+
*/
|
|
25
|
+
export declare function tag<T extends ToTag>(tagComponent: T, propWatch?: PropWatches): TaggedFunction<T>;
|
|
26
|
+
export declare namespace tag {
|
|
27
|
+
/** @deprecated use "use" instead */
|
|
28
|
+
let state: typeof tagUseFn;
|
|
29
|
+
/** Used to declare a function has state in the form of a function, that when called, returns content for rendering
|
|
30
|
+
* Example () => tag.use = (counter = 0)
|
|
31
|
+
*/
|
|
32
|
+
let use: typeof tagUseFn;
|
|
33
|
+
/** Used to create a tag component that renders once and has no addition rendering cycles */
|
|
34
|
+
let renderOnce: typeof renderOnceFn;
|
|
35
|
+
let route: typeof routeFn;
|
|
36
|
+
let app: (_routeTag: RouteTag) => StateToTag;
|
|
37
|
+
let deepPropWatch: typeof tag;
|
|
38
|
+
let immutableProps: <T extends ToTag>(tagComponent: T) => TaggedFunction<T>;
|
|
39
|
+
let watchProps: <T extends ToTag>(tagComponent: T) => TaggedFunction<T>;
|
|
40
|
+
}
|
|
41
|
+
type ReturnTag = AnyTag | StateToTag | null | undefined;
|
|
42
|
+
declare function renderOnceFn(): ReturnTag;
|
|
43
|
+
/** Used to create variable scoping when calling a function that lives within a prop container function */
|
|
44
|
+
declare function tagUseFn(): ReturnTag;
|
|
45
|
+
declare function routeFn(_routeProps: RouteProps): StateToTag;
|
|
46
|
+
export {};
|