taggedjs 2.5.24 → 2.6.1
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/RegularValue.type.d.ts +1 -0
- package/js/RegularValue.type.js +2 -0
- package/js/RegularValue.type.js.map +1 -0
- package/js/alterProp.function.d.ts +7 -7
- package/js/alterProp.function.js +71 -73
- package/js/alterProp.function.js.map +1 -1
- package/js/deepFunctions.d.ts +2 -2
- package/js/deepFunctions.js +25 -33
- package/js/deepFunctions.js.map +1 -1
- package/js/index.d.ts +6 -9
- package/js/index.js +6 -10
- package/js/index.js.map +1 -1
- package/js/interpolations/attributes/ElementTargetEvent.interface.d.ts +6 -0
- package/js/interpolations/attributes/ElementTargetEvent.interface.js +2 -0
- package/js/interpolations/attributes/ElementTargetEvent.interface.js.map +1 -0
- package/js/interpolations/attributes/addSupportEventListener.function.d.ts +3 -0
- package/js/interpolations/attributes/addSupportEventListener.function.js +42 -0
- package/js/interpolations/attributes/addSupportEventListener.function.js.map +1 -0
- package/js/interpolations/attributes/bindSubjectCallback.function.d.ts +13 -0
- package/js/interpolations/attributes/bindSubjectCallback.function.js +74 -0
- package/js/interpolations/attributes/bindSubjectCallback.function.js.map +1 -0
- package/js/interpolations/attributes/elementInitCheck.d.ts +2 -0
- package/js/interpolations/attributes/elementInitCheck.js +18 -0
- package/js/interpolations/attributes/elementInitCheck.js.map +1 -0
- package/js/interpolations/attributes/getUpTags.function.d.ts +2 -0
- package/js/interpolations/attributes/getUpTags.function.js +35 -0
- package/js/interpolations/attributes/getUpTags.function.js.map +1 -0
- package/js/interpolations/attributes/howToSetInputValue.function.d.ts +2 -0
- package/js/interpolations/attributes/howToSetInputValue.function.js +11 -0
- package/js/interpolations/attributes/howToSetInputValue.function.js.map +1 -0
- package/js/interpolations/attributes/isSpecialAttribute.function.d.ts +3 -0
- package/js/interpolations/attributes/isSpecialAttribute.function.js +26 -0
- package/js/interpolations/attributes/isSpecialAttribute.function.js.map +1 -0
- package/js/interpolations/attributes/processAttribute.function.d.ts +19 -0
- package/js/interpolations/attributes/processAttribute.function.js +175 -0
- package/js/interpolations/attributes/processAttribute.function.js.map +1 -0
- package/js/interpolations/attributes/processAttributeCallback.function.d.ts +3 -0
- package/js/interpolations/attributes/processAttributeCallback.function.js +12 -0
- package/js/interpolations/attributes/processAttributeCallback.function.js.map +1 -0
- package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +7 -0
- package/js/interpolations/attributes/processNameValueAttribute.function.js +24 -0
- package/js/interpolations/attributes/processNameValueAttribute.function.js.map +1 -0
- package/js/interpolations/attributes/renderTagArray.function.d.ts +2 -0
- package/js/interpolations/attributes/renderTagArray.function.js +17 -0
- package/js/interpolations/attributes/renderTagArray.function.js.map +1 -0
- package/js/interpolations/attributes/specialAttribute.d.ts +2 -0
- package/js/interpolations/attributes/specialAttribute.js +44 -0
- package/js/interpolations/attributes/specialAttribute.js.map +1 -0
- package/js/interpolations/bindSubjectCallback.function.d.ts +8 -7
- package/js/interpolations/bindSubjectCallback.function.js +13 -46
- package/js/interpolations/bindSubjectCallback.function.js.map +1 -1
- package/js/interpolations/index.d.ts +1 -0
- package/js/interpolations/index.js +2 -0
- package/js/interpolations/index.js.map +1 -0
- package/js/interpolations/interpolateAttributes.d.ts +0 -3
- package/js/interpolations/interpolateAttributes.js +2 -14
- package/js/interpolations/interpolateAttributes.js.map +1 -1
- package/js/interpolations/interpolateTemplate.d.ts +1 -4
- package/js/interpolations/interpolateTemplate.js +1 -29
- package/js/interpolations/interpolateTemplate.js.map +1 -1
- package/js/interpolations/optimizers/LikeObjectElement.type.d.ts +15 -0
- package/js/interpolations/optimizers/LikeObjectElement.type.js +2 -0
- package/js/interpolations/optimizers/LikeObjectElement.type.js.map +1 -0
- package/js/interpolations/optimizers/ObjectNode.types.d.ts +21 -14
- package/js/interpolations/optimizers/attachDomElements.function.d.ts +13 -0
- package/js/interpolations/optimizers/attachDomElements.function.js +107 -0
- package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -0
- package/js/interpolations/optimizers/exchangeParsedForValues.function.d.ts +15 -0
- package/js/interpolations/optimizers/exchangeParsedForValues.function.js +2 -0
- package/js/interpolations/optimizers/exchangeParsedForValues.function.js.map +1 -0
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.d.ts +10 -2
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js +121 -56
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js.map +1 -1
- package/js/interpolations/optimizers/metaAttachDomElements.function.d.ts +9 -3
- package/js/interpolations/optimizers/metaAttachDomElements.function.js +82 -36
- package/js/interpolations/optimizers/metaAttachDomElements.function.js.map +1 -1
- package/js/interpolations/optimizers/replacePlaceholders.function.d.ts +3 -2
- package/js/interpolations/optimizers/replacePlaceholders.function.js +38 -59
- package/js/interpolations/optimizers/replacePlaceholders.function.js.map +1 -1
- package/js/interpolations/optimizers/restorePlaceholders.function.d.ts +1 -1
- package/js/interpolations/optimizers/restorePlaceholders.function.js +14 -13
- package/js/interpolations/optimizers/restorePlaceholders.function.js.map +1 -1
- package/js/interpolations/optimizers/test.function.d.ts +10 -0
- package/js/interpolations/optimizers/test.function.js +19 -0
- package/js/interpolations/optimizers/test.function.js.map +1 -0
- package/js/interpolations/processAttribute.function.d.ts +10 -5
- package/js/interpolations/processAttribute.function.js +111 -67
- package/js/interpolations/processAttribute.function.js.map +1 -1
- package/js/interpolations/processSubscriptionUpdate.function.d.ts +4 -0
- package/js/interpolations/processSubscriptionUpdate.function.js +14 -0
- package/js/interpolations/processSubscriptionUpdate.function.js.map +1 -0
- package/js/interpolations/specialAttribute.js +18 -9
- package/js/interpolations/specialAttribute.js.map +1 -1
- package/js/interpolations/subscribeToTemplate.function.d.ts +10 -2
- package/js/interpolations/subscribeToTemplate.function.js +19 -20
- package/js/interpolations/subscribeToTemplate.function.js.map +1 -1
- package/js/isInstance.d.ts +10 -6
- package/js/isInstance.js +33 -25
- package/js/isInstance.js.map +1 -1
- package/js/state/callbackMaker.function.d.ts +1 -1
- package/js/state/callbackMaker.function.js +21 -30
- package/js/state/callbackMaker.function.js.map +1 -1
- package/js/state/callbackStateUpdate.function.d.ts +1 -1
- package/js/state/callbackStateUpdate.function.js +6 -5
- package/js/state/callbackStateUpdate.function.js.map +1 -1
- package/js/state/getCallbackValue.function.d.ts +4 -0
- package/js/state/getCallbackValue.function.js +10 -0
- package/js/state/getCallbackValue.function.js.map +1 -0
- package/js/state/getStateValue.function.d.ts +2 -0
- package/js/state/getStateValue.function.js +24 -0
- package/js/state/getStateValue.function.js.map +1 -0
- package/js/state/handleProviderChanges.function.d.ts +7 -1
- package/js/state/handleProviderChanges.function.js +7 -21
- package/js/state/handleProviderChanges.function.js.map +1 -1
- package/js/state/index.d.ts +2 -3
- package/js/state/index.js +2 -2
- package/js/state/index.js.map +1 -1
- package/js/state/letState.function.d.ts +2 -0
- package/js/state/letState.function.js +28 -28
- package/js/state/letState.function.js.map +1 -1
- package/js/state/onDestroy.js +3 -2
- package/js/state/onDestroy.js.map +1 -1
- package/js/state/providers.d.ts +0 -1
- package/js/state/providers.js +20 -15
- package/js/state/providers.js.map +1 -1
- package/js/state/providersChangeCheck.function.d.ts +2 -2
- package/js/state/providersChangeCheck.function.js +9 -10
- package/js/state/providersChangeCheck.function.js.map +1 -1
- package/js/state/setUse.function.d.ts +1 -11
- package/js/state/setUse.function.js +12 -13
- package/js/state/setUse.function.js.map +1 -1
- package/js/state/state.function.js +2 -47
- package/js/state/state.function.js.map +1 -1
- package/js/state/state.types.d.ts +8 -0
- package/js/state/state.types.js +2 -0
- package/js/state/state.types.js.map +1 -0
- package/js/state/state.utils.d.ts +11 -10
- package/js/state/state.utils.js +35 -65
- package/js/state/state.utils.js.map +1 -1
- package/js/state/stateHandlers.d.ts +2 -0
- package/js/state/stateHandlers.js +36 -0
- package/js/state/stateHandlers.js.map +1 -0
- package/js/state/subject.function.js +10 -6
- package/js/state/subject.function.js.map +1 -1
- package/js/state/syncStates.function.d.ts +1 -1
- package/js/state/syncStates.function.js +8 -5
- package/js/state/syncStates.function.js.map +1 -1
- package/js/state/watch.function.js +6 -6
- package/js/state/watch.function.js.map +1 -1
- package/js/subject/Subject.class.d.ts +9 -2
- package/js/subject/Subject.class.js +36 -11
- package/js/subject/Subject.class.js.map +1 -1
- package/js/subject/ValueSubject.d.ts +6 -1
- package/js/subject/ValueSubject.js +15 -1
- package/js/subject/ValueSubject.js.map +1 -1
- package/js/subject/combineLatest.function.js +2 -2
- package/js/subject/combineLatest.function.js.map +1 -1
- package/js/subject/subject.utils.js +5 -4
- package/js/subject/subject.utils.js.map +1 -1
- package/js/subject.types.d.ts +2 -10
- package/js/tag/Context.types.d.ts +21 -0
- package/js/tag/Context.types.js +2 -0
- package/js/tag/Context.types.js.map +1 -0
- package/js/tag/Support.class.d.ts +31 -66
- package/js/tag/Support.class.js +36 -285
- package/js/tag/Support.class.js.map +1 -1
- package/js/tag/Tag.class.d.ts +29 -28
- package/js/tag/Tag.class.js +34 -46
- package/js/tag/Tag.class.js.map +1 -1
- package/js/tag/TemplaterResult.class.d.ts +32 -38
- package/js/tag/TemplaterResult.class.js +11 -34
- package/js/tag/TemplaterResult.class.js.map +1 -1
- package/js/tag/ValueTypes.enum.d.ts +23 -13
- package/js/tag/ValueTypes.enum.js +28 -19
- package/js/tag/ValueTypes.enum.js.map +1 -1
- package/js/tag/buildBeforeElement.function.d.ts +10 -0
- package/js/tag/buildBeforeElement.function.js +47 -0
- package/js/tag/buildBeforeElement.function.js.map +1 -0
- package/js/tag/buildSupportContext.function.d.ts +3 -0
- package/js/tag/buildSupportContext.function.js +15 -0
- package/js/tag/buildSupportContext.function.js.map +1 -0
- package/js/tag/checkDestroyPrevious.function.d.ts +5 -8
- package/js/tag/checkDestroyPrevious.function.js +53 -71
- package/js/tag/checkDestroyPrevious.function.js.map +1 -1
- package/js/tag/clonePropsBy.function.d.ts +6 -0
- package/js/tag/clonePropsBy.function.js +27 -0
- package/js/tag/clonePropsBy.function.js.map +1 -0
- package/js/tag/cloneValueArray.function.d.ts +4 -3
- package/js/tag/cloneValueArray.function.js +17 -13
- package/js/tag/cloneValueArray.function.js.map +1 -1
- package/js/tag/destroy.support.d.ts +7 -5
- package/js/tag/destroy.support.js +44 -6
- package/js/tag/destroy.support.js.map +1 -1
- package/js/tag/destroySupport.function.d.ts +2 -0
- package/js/tag/destroySupport.function.js +21 -0
- package/js/tag/destroySupport.function.js.map +1 -0
- package/js/tag/destroyTag.function.js +4 -4
- package/js/tag/destroyTag.function.js.map +1 -1
- package/js/tag/domMetaCollector.d.ts +2 -2
- package/js/tag/domMetaCollector.js +11 -7
- package/js/tag/domMetaCollector.js.map +1 -1
- package/js/tag/elementDestroyCheck.function.js +4 -7
- package/js/tag/elementDestroyCheck.function.js.map +1 -1
- package/js/tag/executeWrap.function.d.ts +5 -0
- package/js/tag/executeWrap.function.js +23 -0
- package/js/tag/executeWrap.function.js.map +1 -0
- package/js/tag/getChildTagsToDestroy.function.d.ts +8 -0
- package/js/tag/getChildTagsToDestroy.function.js +47 -0
- package/js/tag/getChildTagsToDestroy.function.js.map +1 -0
- package/js/tag/getStringsId.function.d.ts +1 -1
- package/js/tag/getStringsId.function.js +1 -2
- package/js/tag/getStringsId.function.js.map +1 -1
- package/js/tag/getSupportInCycle.function.js +2 -2
- package/js/tag/getSupportInCycle.function.js.map +1 -1
- package/js/tag/getTagWrap.function.d.ts +2 -0
- package/js/tag/getTagWrap.function.js +24 -68
- package/js/tag/getTagWrap.function.js.map +1 -1
- package/js/tag/getValueType.function.d.ts +3 -2
- package/js/tag/getValueType.function.js +17 -30
- package/js/tag/getValueType.function.js.map +1 -1
- package/js/tag/hasPropChanges.function.js +4 -10
- package/js/tag/hasPropChanges.function.js.map +1 -1
- package/js/tag/hasSupportChanged.function.d.ts +6 -2
- package/js/tag/hasSupportChanged.function.js +143 -24
- package/js/tag/hasSupportChanged.function.js.map +1 -1
- package/js/tag/html.d.ts +5 -6
- package/js/tag/html.js +9 -3
- package/js/tag/html.js.map +1 -1
- package/js/tag/index.d.ts +11 -1
- package/js/tag/index.js +11 -1
- package/js/tag/index.js.map +1 -1
- package/js/tag/isLikeTags.function.d.ts +4 -3
- package/js/tag/isLikeTags.function.js +18 -31
- package/js/tag/isLikeTags.function.js.map +1 -1
- package/js/tag/key.d.ts +6 -0
- package/js/tag/key.js +9 -0
- package/js/tag/key.js.map +1 -0
- package/js/tag/kidsToTagArraySubject.function.d.ts +2 -2
- package/js/tag/kidsToTagArraySubject.function.js +2 -1
- package/js/tag/kidsToTagArraySubject.function.js.map +1 -1
- package/js/tag/paint.function.d.ts +15 -0
- package/js/tag/paint.function.js +42 -0
- package/js/tag/paint.function.js.map +1 -0
- package/js/tag/processUpdateAttrContext.function.d.ts +3 -0
- package/js/tag/processUpdateAttrContext.function.js +14 -0
- package/js/tag/processUpdateAttrContext.function.js.map +1 -0
- package/js/tag/processUpdateContext.function.d.ts +5 -0
- package/js/tag/processUpdateContext.function.js +35 -0
- package/js/tag/processUpdateContext.function.js.map +1 -0
- package/js/tag/render/destroyUnlikeTags.function.d.ts +3 -5
- package/js/tag/render/destroyUnlikeTags.function.js +1 -3
- package/js/tag/render/destroyUnlikeTags.function.js.map +1 -1
- package/js/tag/render/renderExistingTag.function.d.ts +4 -6
- package/js/tag/render/renderExistingTag.function.js +11 -27
- package/js/tag/render/renderExistingTag.function.js.map +1 -1
- package/js/tag/render/renderSubjectComponent.function.js +14 -5
- package/js/tag/render/renderSubjectComponent.function.js.map +1 -1
- package/js/tag/render/renderSupport.function.d.ts +8 -3
- package/js/tag/render/renderSupport.function.js +68 -32
- package/js/tag/render/renderSupport.function.js.map +1 -1
- package/js/tag/render/renderTagOnly.function.d.ts +4 -3
- package/js/tag/render/renderTagOnly.function.js +33 -24
- package/js/tag/render/renderTagOnly.function.js.map +1 -1
- package/js/tag/render/renderWithSupport.function.d.ts +8 -4
- package/js/tag/render/renderWithSupport.function.js +12 -10
- package/js/tag/render/renderWithSupport.function.js.map +1 -1
- package/js/tag/render/softDestroySupport.function.d.ts +1 -2
- package/js/tag/render/softDestroySupport.function.js +22 -18
- package/js/tag/render/softDestroySupport.function.js.map +1 -1
- package/js/tag/smartRemoveKids.function.d.ts +3 -0
- package/js/tag/smartRemoveKids.function.js +80 -0
- package/js/tag/smartRemoveKids.function.js.map +1 -0
- package/js/tag/tag.d.ts +16 -3
- package/js/tag/tag.js +48 -16
- package/js/tag/tag.js.map +1 -1
- package/js/tag/tag.types.d.ts +6 -4
- package/js/tag/tag.utils.d.ts +15 -12
- package/js/tag/tag.utils.js.map +1 -1
- package/js/tag/tagElement.d.ts +11 -5
- package/js/tag/tagElement.js +114 -41
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/tagRunner.d.ts +2 -4
- package/js/tag/tagRunner.js +17 -39
- package/js/tag/tagRunner.js.map +1 -1
- package/js/tag/textNode.js +1 -1
- package/js/tag/textNode.js.map +1 -1
- package/js/tag/update/TagJsSubject.class.d.ts +0 -6
- package/js/tag/update/TagJsSubject.class.js +1 -8
- package/js/tag/update/TagJsSubject.class.js.map +1 -1
- package/js/tag/update/afterChildrenBuilt.function.d.ts +6 -0
- package/js/tag/update/afterChildrenBuilt.function.js +25 -0
- package/js/tag/update/afterChildrenBuilt.function.js.map +1 -0
- package/js/tag/update/getNewGlobal.function.d.ts +2 -0
- package/js/tag/update/getNewGlobal.function.js +7 -0
- package/js/tag/update/getNewGlobal.function.js.map +1 -0
- package/js/tag/update/oneRenderToSupport.function.d.ts +2 -2
- package/js/tag/update/oneRenderToSupport.function.js +7 -7
- package/js/tag/update/oneRenderToSupport.function.js.map +1 -1
- package/js/tag/update/processFirstSubject.utils.d.ts +4 -11
- package/js/tag/update/processFirstSubjectComponent.function.d.ts +6 -0
- package/js/tag/update/processFirstSubjectComponent.function.js +36 -0
- package/js/tag/update/processFirstSubjectComponent.function.js.map +1 -0
- package/js/tag/update/processFirstSubjectValue.function.d.ts +8 -8
- package/js/tag/update/processFirstSubjectValue.function.js +75 -39
- package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
- package/js/tag/update/processNewValue.function.d.ts +4 -3
- package/js/tag/update/processNewValue.function.js +27 -27
- package/js/tag/update/processNewValue.function.js.map +1 -1
- package/js/tag/update/processRegularValue.function.d.ts +4 -6
- package/js/tag/update/processRegularValue.function.js +10 -23
- package/js/tag/update/processRegularValue.function.js.map +1 -1
- package/js/tag/update/processSubjectComponent.function.d.ts +3 -5
- package/js/tag/update/processSubjectComponent.function.js +18 -22
- package/js/tag/update/processSubjectComponent.function.js.map +1 -1
- package/js/tag/update/processTag.function.d.ts +13 -10
- package/js/tag/update/processTag.function.js +51 -37
- package/js/tag/update/processTag.function.js.map +1 -1
- package/js/tag/update/processTagArray.d.ts +7 -26
- package/js/tag/update/processTagArray.js +118 -141
- package/js/tag/update/processTagArray.js.map +1 -1
- package/js/tag/update/processTagResult.function.d.ts +4 -8
- package/js/tag/update/processTagResult.function.js +31 -30
- package/js/tag/update/processTagResult.function.js.map +1 -1
- package/js/tag/update/updateContextItem.function.d.ts +6 -2
- package/js/tag/update/updateContextItem.function.js +11 -9
- package/js/tag/update/updateContextItem.function.js.map +1 -1
- package/js/tag/update/updateExistingTagComponent.function.d.ts +7 -8
- package/js/tag/update/updateExistingTagComponent.function.js +76 -98
- package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
- package/js/tag/update/updateExistingValue.function.d.ts +4 -4
- package/js/tag/update/updateExistingValue.function.js +81 -101
- package/js/tag/update/updateExistingValue.function.js.map +1 -1
- package/js/tag/update/validateTemplater.function.d.ts +2 -0
- package/js/tag/update/validateTemplater.function.js +17 -0
- package/js/tag/update/validateTemplater.function.js.map +1 -0
- package/js/tag/updateSupportBy.function.d.ts +3 -0
- package/js/tag/updateSupportBy.function.js +18 -0
- package/js/tag/updateSupportBy.function.js.map +1 -0
- package/js/updateBeforeTemplate.function.d.ts +2 -3
- package/js/updateBeforeTemplate.function.js +10 -8
- package/js/updateBeforeTemplate.function.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RegularValue = string | number | boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RegularValue.type.js","sourceRoot":"","sources":["../ts/RegularValue.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BaseSupport, Support } from './tag/Support.class.js';
|
|
2
|
-
import { State } from './state/index.js';
|
|
1
|
+
import { AnySupport, BaseSupport, Support } from './tag/Support.class.js';
|
|
3
2
|
import { Props } from './Props.js';
|
|
4
|
-
export declare function castProps(props: Props, newSupport: BaseSupport | Support,
|
|
5
|
-
export declare function alterProp(prop: unknown, ownerSupport: BaseSupport | Support,
|
|
6
|
-
export declare function checkProp(value: any, ownerSupport: BaseSupport | Support,
|
|
7
|
-
export declare function getPropWrap(value: any, ownerSupport: BaseSupport | Support
|
|
3
|
+
export declare function castProps(props: Props, newSupport: BaseSupport | Support, depth: number): any[];
|
|
4
|
+
export declare function alterProp(prop: unknown, ownerSupport: BaseSupport | Support, newSupport: BaseSupport | Support, depth: number): any;
|
|
5
|
+
export declare function checkProp(value: any, ownerSupport: BaseSupport | Support, newSupport: BaseSupport | Support, depth: number): any;
|
|
6
|
+
export declare function getPropWrap(value: any, ownerSupport: BaseSupport | Support): any;
|
|
8
7
|
/** Function shared by alterProps() and updateExistingTagComponent... TODO: May want to have to functions to reduce cycle checking? */
|
|
9
8
|
export declare function callbackPropOwner(toCall: Function, callWith: any, ownerSupport: BaseSupport | Support): any;
|
|
10
|
-
export declare function isSkipPropValue(value: unknown):
|
|
9
|
+
export declare function isSkipPropValue(value: unknown): true | import("./tag/ValueTypes.enum.js").ValueType | undefined;
|
|
10
|
+
export declare function safeRenderSupport(newest: AnySupport, ownerSupport: AnySupport): AnySupport | undefined;
|
package/js/alterProp.function.js
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { renderSupport } from './tag/render/renderSupport.function.js';
|
|
4
|
-
import { setUse } from './state/index.js';
|
|
1
|
+
import { isInlineHtml, renderInlineHtml } from './tag/render/renderSupport.function.js';
|
|
2
|
+
import { renderExistingReadyTag } from './tag/render/renderExistingTag.function.js';
|
|
5
3
|
import { getSupportInCycle } from './tag/getSupportInCycle.function.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { deepCompareDepth } from './tag/hasSupportChanged.function.js';
|
|
5
|
+
import { isArray, isStaticTag } from './isInstance.js';
|
|
6
|
+
import { BasicTypes } from './tag/ValueTypes.enum.js';
|
|
7
|
+
import { setUseMemory } from './state/index.js';
|
|
8
|
+
export function castProps(props, newSupport, depth) {
|
|
9
|
+
return props.map(prop => alterProp(prop, newSupport.ownerSupport, newSupport, depth));
|
|
10
10
|
}
|
|
11
11
|
/* Used to rewrite props that are functions. When they are called it should cause parent rendering */
|
|
12
|
-
export function alterProp(prop, ownerSupport,
|
|
12
|
+
export function alterProp(prop, ownerSupport, newSupport, depth) {
|
|
13
13
|
if (isStaticTag(prop) || !prop) {
|
|
14
14
|
return prop;
|
|
15
15
|
}
|
|
16
16
|
if (!ownerSupport) {
|
|
17
17
|
return prop; // no one above me
|
|
18
18
|
}
|
|
19
|
-
return checkProp(prop, ownerSupport,
|
|
19
|
+
return checkProp(prop, ownerSupport, newSupport, depth);
|
|
20
20
|
}
|
|
21
|
-
export function checkProp(value, ownerSupport,
|
|
22
|
-
if (value
|
|
23
|
-
return
|
|
21
|
+
export function checkProp(value, ownerSupport, newSupport, depth) {
|
|
22
|
+
if (!value) {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
if (value.tagJsType) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
if (typeof (value) === BasicTypes.function) {
|
|
29
|
+
return getPropWrap(value, ownerSupport);
|
|
24
30
|
}
|
|
25
|
-
|
|
26
|
-
if (depth === 15) {
|
|
31
|
+
if (depth === deepCompareDepth) {
|
|
27
32
|
return value;
|
|
28
33
|
}
|
|
29
|
-
// seen.push(value)
|
|
30
34
|
const skip = isSkipPropValue(value);
|
|
31
35
|
if (skip) {
|
|
32
36
|
return value; // no children to crawl through
|
|
33
37
|
}
|
|
34
|
-
if (value
|
|
38
|
+
if (isArray(value)) {
|
|
35
39
|
for (let index = value.length - 1; index >= 0; --index) {
|
|
36
40
|
const subValue = value[index];
|
|
37
|
-
value[index] = checkProp(subValue, ownerSupport,
|
|
38
|
-
if (subValue
|
|
39
|
-
if (subValue.
|
|
41
|
+
value[index] = checkProp(subValue, ownerSupport, newSupport, depth + 1);
|
|
42
|
+
if (typeof (subValue) === BasicTypes.function) {
|
|
43
|
+
if (subValue.mem) {
|
|
40
44
|
continue;
|
|
41
45
|
}
|
|
42
46
|
afterCheckProp(depth + 1, index, subValue, value, newSupport);
|
|
@@ -44,14 +48,12 @@ export function checkProp(value, ownerSupport, stateArray, newSupport, depth, in
|
|
|
44
48
|
}
|
|
45
49
|
return value;
|
|
46
50
|
}
|
|
47
|
-
// for(const name in value){
|
|
48
|
-
// ??? new we want below
|
|
49
51
|
const keys = Object.keys(value);
|
|
50
52
|
for (const name of keys) {
|
|
51
53
|
const subValue = value[name];
|
|
52
|
-
const result = checkProp(subValue, ownerSupport,
|
|
54
|
+
const result = checkProp(subValue, ownerSupport, newSupport, depth + 1);
|
|
53
55
|
if (value[name] === result) {
|
|
54
|
-
continue;
|
|
56
|
+
continue;
|
|
55
57
|
}
|
|
56
58
|
const getset = Object.getOwnPropertyDescriptor(value, name);
|
|
57
59
|
const hasSetter = getset?.get || getset?.set;
|
|
@@ -59,8 +61,8 @@ export function checkProp(value, ownerSupport, stateArray, newSupport, depth, in
|
|
|
59
61
|
continue;
|
|
60
62
|
}
|
|
61
63
|
value[name] = result;
|
|
62
|
-
if (result
|
|
63
|
-
if (subValue.
|
|
64
|
+
if (typeof (result) === BasicTypes.function) {
|
|
65
|
+
if (subValue.mem) {
|
|
64
66
|
continue;
|
|
65
67
|
}
|
|
66
68
|
afterCheckProp(depth + 1, name, subValue, value, newSupport);
|
|
@@ -69,34 +71,29 @@ export function checkProp(value, ownerSupport, stateArray, newSupport, depth, in
|
|
|
69
71
|
return value;
|
|
70
72
|
}
|
|
71
73
|
function afterCheckProp(depth, index, originalValue, newProp, newSupport) {
|
|
72
|
-
if (originalValue?.toCall) {
|
|
73
|
-
throw new Error('meg');
|
|
74
|
-
return; // already been done
|
|
75
|
-
}
|
|
76
74
|
// restore object to have original function on destroy
|
|
77
75
|
if (depth > 0) {
|
|
78
76
|
const global = newSupport.subject.global;
|
|
79
|
-
newProp[index].subscription = global.destroy$.toCallback(()
|
|
77
|
+
newProp[index].subscription = global.destroy$.toCallback(function alterCheckProcessor() {
|
|
80
78
|
newProp[index] = originalValue;
|
|
81
79
|
});
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
|
-
export function getPropWrap(value, ownerSupport
|
|
85
|
-
const
|
|
82
|
+
export function getPropWrap(value, ownerSupport) {
|
|
83
|
+
const already = value.mem;
|
|
86
84
|
// already previously converted by a parent?
|
|
87
|
-
if (
|
|
85
|
+
if (already) {
|
|
88
86
|
return value;
|
|
89
87
|
}
|
|
90
|
-
const wrap =
|
|
88
|
+
const wrap = function wrapRunner(...args) {
|
|
89
|
+
return wrap.toCall(...args);
|
|
90
|
+
}; // what gets called can switch over parent state changes
|
|
91
91
|
// Currently, call self but over parent state changes, I may need to call a newer parent tag owner
|
|
92
|
-
wrap.toCall = (...args)
|
|
93
|
-
return callbackPropOwner(wrap.mem
|
|
92
|
+
wrap.toCall = function toCallRunner(...args) {
|
|
93
|
+
return callbackPropOwner(wrap.mem, args, ownerSupport);
|
|
94
94
|
};
|
|
95
95
|
wrap.original = value;
|
|
96
|
-
wrap.mem =
|
|
97
|
-
prop: value,
|
|
98
|
-
// stateArray: stateArray
|
|
99
|
-
};
|
|
96
|
+
wrap.mem = value;
|
|
100
97
|
// copy data properties that maybe on source function
|
|
101
98
|
Object.assign(wrap, value);
|
|
102
99
|
return wrap;
|
|
@@ -104,54 +101,55 @@ export function getPropWrap(value, ownerSupport, stateArray) {
|
|
|
104
101
|
/** Function shared by alterProps() and updateExistingTagComponent... TODO: May want to have to functions to reduce cycle checking? */
|
|
105
102
|
export function callbackPropOwner(toCall, callWith, ownerSupport) {
|
|
106
103
|
const global = ownerSupport.subject.global;
|
|
107
|
-
const newest = global
|
|
104
|
+
const newest = global?.newest || ownerSupport;
|
|
108
105
|
const supportInCycle = getSupportInCycle();
|
|
109
106
|
const noCycle = supportInCycle === undefined;
|
|
110
|
-
if (supportInCycle) {
|
|
111
|
-
supportInCycle.subject.global.locked = true;
|
|
112
|
-
}
|
|
113
107
|
const callbackResult = toCall(...callWith);
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
if (supportInCycle && blocked?.length) {
|
|
117
|
-
setUse.memory.tagClosed$.toCallback(() => {
|
|
118
|
-
let lastResult = supportInCycle;
|
|
119
|
-
// throw new Error('cycles ready')
|
|
120
|
-
// syncStates(supportInCycle.state, (supportInCycle.subject.global.newest as Support).state)
|
|
121
|
-
delete supportInCycle.subject.global.locked;
|
|
122
|
-
lastResult = runBlocked(supportInCycle, supportInCycle.state, supportInCycle);
|
|
123
|
-
// syncStates((supportInCycle.subject.global.newest as Support).state, supportInCycle.state)
|
|
124
|
-
// delete supportInCycle.subject.global.locked
|
|
125
|
-
renderSupport(lastResult, false);
|
|
126
|
-
});
|
|
127
|
-
return callbackResult;
|
|
128
|
-
}
|
|
129
|
-
delete supportInCycle.subject.global.locked;
|
|
130
|
-
}
|
|
131
|
-
const run = () => {
|
|
108
|
+
const run = function propCallbackProcessor() {
|
|
109
|
+
const global = newest.subject.global;
|
|
132
110
|
// are we in a rendering cycle? then its being called by alterProps
|
|
133
111
|
if (noCycle === false) {
|
|
134
|
-
|
|
135
|
-
const allMatched = newest.state.every(state => {
|
|
136
|
-
const lastValue = state.lastValue;
|
|
137
|
-
const get = state.get();
|
|
138
|
-
const equal = deepEqual(cloneTagJsValue(lastValue), get);
|
|
139
|
-
return equal;
|
|
140
|
-
});
|
|
112
|
+
const allMatched = global.locked === true;
|
|
141
113
|
if (allMatched) {
|
|
142
114
|
return callbackResult; // owner did not change
|
|
143
115
|
}
|
|
144
116
|
}
|
|
145
|
-
|
|
117
|
+
/*
|
|
118
|
+
const oldest = global.oldest
|
|
119
|
+
const wasInstant = oldest === newest && global.renderCount === 0
|
|
120
|
+
if(wasInstant) {
|
|
121
|
+
return // prop was called immediately
|
|
122
|
+
}
|
|
123
|
+
*/
|
|
124
|
+
safeRenderSupport(newest, ownerSupport);
|
|
146
125
|
return callbackResult;
|
|
147
126
|
};
|
|
148
127
|
if (noCycle) {
|
|
149
128
|
return run();
|
|
150
129
|
}
|
|
151
|
-
|
|
130
|
+
setUseMemory.tagClosed$.toCallback(run);
|
|
152
131
|
return callbackResult;
|
|
153
132
|
}
|
|
154
133
|
export function isSkipPropValue(value) {
|
|
155
|
-
return typeof (value) !==
|
|
134
|
+
return typeof (value) !== BasicTypes.object || !value || value.tagJsType;
|
|
135
|
+
}
|
|
136
|
+
export function safeRenderSupport(newest, ownerSupport) {
|
|
137
|
+
const subject = newest.subject;
|
|
138
|
+
const isInline = isInlineHtml(newest.templater);
|
|
139
|
+
if (isInline) {
|
|
140
|
+
const result = renderInlineHtml(ownerSupport, newest);
|
|
141
|
+
// TODO: below maybe never true
|
|
142
|
+
/*
|
|
143
|
+
const global = subject.global as TagGlobal
|
|
144
|
+
if(global) {
|
|
145
|
+
delete global.locked
|
|
146
|
+
}
|
|
147
|
+
*/
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
const global = subject.global;
|
|
151
|
+
global.locked = true;
|
|
152
|
+
renderExistingReadyTag(global.newest, newest, ownerSupport, subject);
|
|
153
|
+
delete global.locked;
|
|
156
154
|
}
|
|
157
155
|
//# sourceMappingURL=alterProp.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alterProp.function.js","sourceRoot":"","sources":["../ts/alterProp.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alterProp.function.js","sourceRoot":"","sources":["../ts/alterProp.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAiB,MAAM,wCAAwC,CAAA;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AAEnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAEtE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAI/C,MAAM,UAAU,SAAS,CACvB,KAAY,EACZ,UAAiC,EACjC,KAAa;IAEb,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAChC,IAAI,EACH,UAAsB,CAAC,YAAY,EACpC,UAAU,EACV,KAAK,CACN,CAAC,CAAA;AACJ,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,SAAS,CACvB,IAAa,EACb,YAAmC,EACnC,UAAiC,EACjC,KAAa;IAEb,IAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAG,CAAC,YAAY,EAAE,CAAC;QACjB,OAAO,IAAI,CAAA,CAAC,kBAAkB;IAChC,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AACzD,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,KAAU,EACV,YAAmC,EACnC,UAAiC,EACjC,KAAa;IAEb,IAAG,CAAC,KAAK,E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,UAAU,EAAE,CAAC;gBACd,OAAO,cAAc,CAAA,CAAC,uBAAuB;YAC/C,CAAC;QACH,CAAC;QAED;;;;;;UAME;QAEF,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;QAEvC,OAAO,cAAc,CAAA;IACvB,CAAC,CAAA;IAED,IAAG,OAAO,EAAE,CAAC;QACX,OAAO,GAAG,EAAE,CAAA;IACd,CAAC;IAED,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAEvC,OAAO,cAAc,CAAA;AACvB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAM,CAAC,KAAK,CAAC,KAAI,UAAU,CAAC,MAAM,IAAI,CAAC,KAAK,IAAK,KAAa,CAAC,SAAS,CAAA;AACjF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,MAAkB,EAClB,YAAwB;IAExB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;IAC9B,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC/C,IAAI,QAAQ,EAAG,CAAC;QACd,MAAM,MAAM,GAAG,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;QACrD,+BAA+B;QAC/B;;;;;UAKE;QACF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAA0B,CAAA;IAEjD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAA;IAEpB,sBAAsB,CACpB,MAAM,CAAC,MAAiB,EACxB,MAAM,EACN,YAAY,EACZ,OAAO,CACR,CAAA;IAED,OAAO,MAAM,CAAC,MAAM,CAAA;AACtB,CAAC"}
|
package/js/deepFunctions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function deepClone(obj:
|
|
2
|
-
export declare function deepEqual(obj1: any, obj2: any): boolean;
|
|
1
|
+
export declare function deepClone<T>(obj: T, maxDepth: number): T;
|
|
2
|
+
export declare function deepEqual(obj1: any, obj2: any, maxDepth: number): boolean;
|
package/js/deepFunctions.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { isArray, isFunction } from './isInstance.js';
|
|
2
|
+
import { BasicTypes } from './tag/ValueTypes.enum.js';
|
|
3
|
+
export function deepClone(obj, maxDepth) {
|
|
3
4
|
// return makeDeepClone(obj, new WeakMap())
|
|
4
|
-
return makeDeepClone(obj,
|
|
5
|
+
return makeDeepClone(obj, maxDepth);
|
|
5
6
|
}
|
|
6
7
|
function makeDeepClone(obj,
|
|
7
8
|
// visited: WeakMap<any, any>
|
|
8
|
-
|
|
9
|
+
maxDepth) {
|
|
9
10
|
// If obj is a primitive type or null, return it directly
|
|
10
|
-
if (obj === null || typeof obj !==
|
|
11
|
+
if (obj === null || typeof obj !== BasicTypes.object) {
|
|
11
12
|
return obj;
|
|
12
13
|
}
|
|
13
14
|
// If obj is already visited, return the cloned reference
|
|
@@ -16,7 +17,7 @@ depth) {
|
|
|
16
17
|
return visited.get(obj)
|
|
17
18
|
}
|
|
18
19
|
*/
|
|
19
|
-
if (
|
|
20
|
+
if (maxDepth < 0) {
|
|
20
21
|
return obj;
|
|
21
22
|
}
|
|
22
23
|
// Handle special cases like Date and RegExp
|
|
@@ -27,43 +28,38 @@ depth) {
|
|
|
27
28
|
return new RegExp(obj);
|
|
28
29
|
}
|
|
29
30
|
// Create an empty object or array with the same prototype
|
|
30
|
-
const clone =
|
|
31
|
-
// Register the cloned object to avoid cyclic references
|
|
32
|
-
// visited.set(obj, clone)
|
|
31
|
+
const clone = isArray(obj) ? [] : Object.create(Object.getPrototypeOf(obj));
|
|
33
32
|
// Clone each property or element of the object or array
|
|
34
|
-
if (
|
|
33
|
+
if (isArray(obj)) {
|
|
35
34
|
for (let i = 0; i < obj.length; i++) {
|
|
36
|
-
|
|
37
|
-
clone[i] = makeDeepClone(obj[i], depth + 1);
|
|
35
|
+
clone[i] = makeDeepClone(obj[i], maxDepth - 1);
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
else {
|
|
41
39
|
for (const key in obj) {
|
|
42
40
|
if (obj.hasOwnProperty(key)) {
|
|
43
|
-
|
|
44
|
-
clone[key] = makeDeepClone(obj[key], depth + 1);
|
|
41
|
+
clone[key] = makeDeepClone(obj[key], maxDepth - 1);
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
return clone;
|
|
49
46
|
}
|
|
50
|
-
export function deepEqual(obj1, obj2) {
|
|
51
|
-
|
|
52
|
-
return isDeepEqual(obj1, obj2, 0);
|
|
47
|
+
export function deepEqual(obj1, obj2, maxDepth) {
|
|
48
|
+
return isDeepEqual(obj1, obj2, maxDepth);
|
|
53
49
|
}
|
|
54
50
|
function isDeepEqual(obj1, obj2,
|
|
55
51
|
// visited: WeakMap<any, any>,
|
|
56
|
-
|
|
52
|
+
maxDepth) {
|
|
57
53
|
const directEqual = obj1 === obj2;
|
|
58
54
|
if (directEqual || isSameFunctions(obj1, obj2)) {
|
|
59
55
|
return true;
|
|
60
56
|
}
|
|
61
57
|
// If obj is already visited, return the cloned reference
|
|
62
58
|
// if (visited.has(obj1)) {
|
|
63
|
-
if (
|
|
59
|
+
if (maxDepth < 0) {
|
|
64
60
|
return true;
|
|
65
61
|
}
|
|
66
|
-
if (typeof obj1 ===
|
|
62
|
+
if (typeof obj1 === BasicTypes.object && typeof obj2 === BasicTypes.object) {
|
|
67
63
|
// both are dates and were already determined not the same
|
|
68
64
|
if (obj1 instanceof Date && obj2 instanceof Date) {
|
|
69
65
|
return obj1.getTime() === obj2.getTime();
|
|
@@ -71,22 +67,21 @@ depth) {
|
|
|
71
67
|
// Register the cloned object to avoid cyclic references
|
|
72
68
|
// visited.set(obj1, 0)
|
|
73
69
|
// Check if obj1 and obj2 are both arrays
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
return isArrayDeepEqual(obj1, obj2, depth + 1);
|
|
70
|
+
if (isArray(obj1) && isArray(obj2)) {
|
|
71
|
+
return isArrayDeepEqual(obj1, obj2, maxDepth - 1);
|
|
77
72
|
}
|
|
78
|
-
else if (
|
|
73
|
+
else if (isArray(obj1) || isArray(obj2)) {
|
|
79
74
|
// One is an array, and the other is not
|
|
80
75
|
return false;
|
|
81
76
|
}
|
|
82
77
|
// return isObjectDeepEqual(obj1, obj2, visited)
|
|
83
|
-
return isObjectDeepEqual(obj1, obj2,
|
|
78
|
+
return isObjectDeepEqual(obj1, obj2, maxDepth - 1);
|
|
84
79
|
}
|
|
85
80
|
return false;
|
|
86
81
|
}
|
|
87
82
|
function isObjectDeepEqual(obj1, obj2,
|
|
88
83
|
// visited: WeakMap<any, any>,
|
|
89
|
-
|
|
84
|
+
maxDepth) {
|
|
90
85
|
const keys1 = Object.keys(obj1);
|
|
91
86
|
const keys2 = Object.keys(obj2);
|
|
92
87
|
if (keys1.length === 0 && keys2.length === 0) {
|
|
@@ -97,28 +92,25 @@ depth) {
|
|
|
97
92
|
}
|
|
98
93
|
for (const key of keys1) {
|
|
99
94
|
const keyFound = keys2.includes(key);
|
|
100
|
-
if (!keyFound || !isDeepEqual(obj1[key], obj2[key],
|
|
95
|
+
if (!keyFound || !isDeepEqual(obj1[key], obj2[key], maxDepth - 1)) {
|
|
101
96
|
return false;
|
|
102
97
|
}
|
|
103
98
|
}
|
|
104
99
|
return true;
|
|
105
100
|
}
|
|
106
|
-
function isArrayDeepEqual(obj1, obj2,
|
|
107
|
-
// visited: WeakMap<any, any>,
|
|
108
|
-
depth) {
|
|
101
|
+
function isArrayDeepEqual(obj1, obj2, maxDepth) {
|
|
109
102
|
if (obj1.length !== obj2.length) {
|
|
110
103
|
return false;
|
|
111
104
|
}
|
|
112
105
|
for (let i = 0; i < obj1.length; i++) {
|
|
113
|
-
|
|
114
|
-
if (!isDeepEqual(obj1[i], obj2[i], depth + 1)) {
|
|
106
|
+
if (!isDeepEqual(obj1[i], obj2[i], maxDepth - 1)) {
|
|
115
107
|
return false;
|
|
116
108
|
}
|
|
117
109
|
}
|
|
118
110
|
return true;
|
|
119
111
|
}
|
|
120
112
|
function isSameFunctions(fn0, fn1) {
|
|
121
|
-
const bothFunction = fn0
|
|
113
|
+
const bothFunction = isFunction(fn0) && isFunction(fn1);
|
|
122
114
|
return bothFunction && fn0.toString() === fn1.toString();
|
|
123
115
|
}
|
|
124
116
|
//# sourceMappingURL=deepFunctions.js.map
|
package/js/deepFunctions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepFunctions.js","sourceRoot":"","sources":["../ts/deepFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"deepFunctions.js","sourceRoot":"","sources":["../ts/deepFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAc,MAAM,0BAA0B,CAAC;AAElE,MAAM,UAAU,SAAS,CACvB,GAAM,EACN,QAAgB;IAEhB,2CAA2C;IAC3C,OAAO,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;AACrC,CAAC;AAED,SAAS,aAAa,CACpB,GAAQ;AACR,6BAA6B;AAC7B,QAAgB;IAEhB,yDAAyD;IACzD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;QACrD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,yDAAyD;IACzD;;;;MAIE;IACH,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,OAAO,GAAG,CAAA;IACZ,CAAC;IAEA,4CAA4C;IAC5C,IAAI,GAAG,YAAY,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;IAED,IAAI,GAAG,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,MAAM,EAAE,CAAC;QAClC,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QACpC,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC;YAClE,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAGD,SAAS,gBAAgB,CACvB,IAAW,EACX,IAAW,EACX,QAAgB;IAEhB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC;YACjD,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,eAAe,CACtB,GAAa,EACb,GAAa;IAEb,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;IACvD,OAAO,YAAY,IAAI,GAAG,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,QAAQ,EAAE,CAAA;AAC1D,CAAC"}
|
package/js/index.d.ts
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
export * from './tag/index.js';
|
|
2
2
|
export * from './errors.js';
|
|
3
|
-
export * from './subject.types.js';
|
|
4
3
|
export * from './isInstance.js';
|
|
5
4
|
export * from './state/index.js';
|
|
6
5
|
export * from './subject/index.js';
|
|
6
|
+
export * from './interpolations/index.js';
|
|
7
7
|
export * from './tag/Support.class.js';
|
|
8
|
-
export * from './interpolations/
|
|
9
|
-
export * from './interpolations/
|
|
10
|
-
export { tagElement } from './tag/tagElement.js';
|
|
11
|
-
export { Tag, variablePrefix } from './tag/Tag.class.js';
|
|
12
|
-
export { runBeforeRender } from './tag/tagRunner.js';
|
|
13
|
-
export { renderSupport } from './tag/render/renderSupport.function.js';
|
|
14
|
-
export { renderWithSupport } from './tag/render/renderWithSupport.function.js';
|
|
15
|
-
export { isLikeValueSets } from './tag/isLikeTags.function.js';
|
|
8
|
+
export * from './interpolations/attributes/howToSetInputValue.function.js';
|
|
9
|
+
export * from './interpolations/attributes/ElementTargetEvent.interface.js';
|
|
16
10
|
import { renderTagOnly } from './tag/render/renderTagOnly.function.js';
|
|
17
11
|
import { renderSupport } from './tag/render/renderSupport.function.js';
|
|
18
12
|
import { renderWithSupport } from './tag/render/renderWithSupport.function.js';
|
|
13
|
+
export { key } from './tag/key.js';
|
|
19
14
|
import { tagElement } from './tag/tagElement.js';
|
|
15
|
+
import { paint } from './tag/paint.function.js';
|
|
20
16
|
export declare const hmr: {
|
|
21
17
|
tagElement: typeof tagElement;
|
|
22
18
|
renderWithSupport: typeof renderWithSupport;
|
|
23
19
|
renderSupport: typeof renderSupport;
|
|
24
20
|
renderTagOnly: typeof renderTagOnly;
|
|
21
|
+
paint: typeof paint;
|
|
25
22
|
};
|
|
26
23
|
export { type Wrapper } from './tag/TemplaterResult.class.js';
|
package/js/index.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
export * from './tag/index.js';
|
|
2
2
|
export * from './errors.js';
|
|
3
|
-
export * from './subject.types.js';
|
|
4
3
|
export * from './isInstance.js';
|
|
5
4
|
export * from './state/index.js';
|
|
6
5
|
export * from './subject/index.js';
|
|
6
|
+
export * from './interpolations/index.js';
|
|
7
7
|
export * from './tag/Support.class.js';
|
|
8
|
-
export * from './interpolations/
|
|
9
|
-
export * from './interpolations/
|
|
10
|
-
export { tagElement } from './tag/tagElement.js';
|
|
11
|
-
export { Tag, variablePrefix } from './tag/Tag.class.js';
|
|
12
|
-
export { runBeforeRender } from './tag/tagRunner.js';
|
|
13
|
-
export { renderSupport } from './tag/render/renderSupport.function.js';
|
|
14
|
-
export { renderWithSupport } from './tag/render/renderWithSupport.function.js';
|
|
15
|
-
export { isLikeValueSets } from './tag/isLikeTags.function.js';
|
|
8
|
+
export * from './interpolations/attributes/howToSetInputValue.function.js';
|
|
9
|
+
export * from './interpolations/attributes/ElementTargetEvent.interface.js';
|
|
16
10
|
import { renderTagOnly } from './tag/render/renderTagOnly.function.js';
|
|
17
11
|
import { renderSupport } from './tag/render/renderSupport.function.js';
|
|
18
12
|
import { renderWithSupport } from './tag/render/renderWithSupport.function.js';
|
|
13
|
+
export { key } from './tag/key.js';
|
|
19
14
|
import { tagElement } from './tag/tagElement.js';
|
|
15
|
+
import { paint } from './tag/paint.function.js';
|
|
20
16
|
export const hmr = {
|
|
21
17
|
tagElement, renderWithSupport, renderSupport,
|
|
22
|
-
renderTagOnly,
|
|
18
|
+
renderTagOnly, paint,
|
|
23
19
|
};
|
|
24
20
|
//# sourceMappingURL=index.js.map
|
package/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4DAA4D,CAAA;AAC1E,cAAc,6DAA6D,CAAA;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAA;AAC9E,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,UAAU,EAAE,iBAAiB,EAAE,aAAa;IAC5C,aAAa,EAAE,KAAK;CACrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementTargetEvent.interface.js","sourceRoot":"","sources":["../../../ts/interpolations/attributes/ElementTargetEvent.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export function addSupportEventListener(support, eventName, element, callback) {
|
|
2
|
+
const elm = support.appElement;
|
|
3
|
+
// cast events that do not bubble up into ones that do
|
|
4
|
+
if (eventName === 'blur') {
|
|
5
|
+
eventName = 'focusout';
|
|
6
|
+
}
|
|
7
|
+
const replaceEventName = '_' + eventName;
|
|
8
|
+
// const replaceEventName = eventName
|
|
9
|
+
const global = support.subject.global;
|
|
10
|
+
const eventReg = global.events;
|
|
11
|
+
if (!eventReg[eventName]) {
|
|
12
|
+
const listener = function eventCallback(event) {
|
|
13
|
+
event.originalStopPropagation = event.stopPropagation;
|
|
14
|
+
bubbleEvent(event, replaceEventName, event.target);
|
|
15
|
+
};
|
|
16
|
+
eventReg[eventName] = listener;
|
|
17
|
+
elm.addEventListener(eventName, listener);
|
|
18
|
+
}
|
|
19
|
+
// attach to element but not as "_click" and "_keyup"
|
|
20
|
+
;
|
|
21
|
+
element[replaceEventName] = callback;
|
|
22
|
+
element[eventName] = callback;
|
|
23
|
+
}
|
|
24
|
+
function bubbleEvent(event, replaceEventName, target) {
|
|
25
|
+
const callback = target[replaceEventName];
|
|
26
|
+
if (callback) {
|
|
27
|
+
let stopped = false;
|
|
28
|
+
event.stopPropagation = function () {
|
|
29
|
+
stopped = true;
|
|
30
|
+
event.originalStopPropagation.call(event);
|
|
31
|
+
};
|
|
32
|
+
callback(event);
|
|
33
|
+
if (event.defaultPrevented || stopped) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const parentNode = target.parentNode;
|
|
38
|
+
if (parentNode) {
|
|
39
|
+
bubbleEvent(event, replaceEventName, parentNode);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=addSupportEventListener.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addSupportEventListener.function.js","sourceRoot":"","sources":["../../../ts/interpolations/attributes/addSupportEventListener.function.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,uBAAuB,CACrC,OAAmB,EACnB,SAAiB,EACjB,OAAgB,EAChB,QAAuB;IAEvB,MAAM,GAAG,GAAG,OAAO,CAAC,UAAqB,CAAA;IAEzC,sDAAsD;IACtD,IAAG,SAAS,KAAK,MAAM,EAAE,CAAC;QACxB,SAAS,GAAG,UAAU,CAAA;IACxB,CAAC;IAED,MAAM,gBAAgB,GAAG,GAAG,GAAG,SAAS,CAAA;IACxC,qCAAqC;IAErC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAmB,CAAA;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAgB,CAAA;IAExC,IAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,SAAS,aAAa,CAAC,KAAY;YACjD,KAAa,CAAC,uBAAuB,GAAG,KAAK,CAAC,eAAe,CAAC;YAC/D,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,CAAC,MAAiB,CAAC,CAAA;QAC/D,CAAC,CAAA;QACD,QAAQ,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAA;QAC9B,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC;IAED,qDAAqD;IACrD,CAAC;IAAC,OAAe,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAE7C;IAAC,OAAe,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAA;AACzC,CAAC;AAED,SAAS,WAAW,CAClB,KAAY,EACZ,gBAAwB,EACxB,MAAe;IAEf,MAAM,QAAQ,GAAI,MAAc,CAAC,gBAAgB,CAAC,CAAA;IAElD,IAAG,QAAQ,EAAE,CAAC;QACZ,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,KAAK,CAAC,eAAe,GAAG;YACtB,OAAO,GAAG,IAAI,CACb;YAAC,KAAa,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACrD,CAAC,CAAA;QAED,QAAQ,CAAC,KAAK,CAAC,CAAA;QAEf,IAAG,KAAK,CAAC,gBAAgB,IAAI,OAAO,EAAE,CAAC;YACrC,OAAM;QACR,CAAC;IACH,CAAC;IAGD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;IACpC,IAAG,UAAU,EAAE,CAAC;QACd,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAqB,CAAC,CAAA;IAC7D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** File largely responsible for reacting to element events, such as onclick */
|
|
2
|
+
import { AnySupport, BaseSupport, Support } from '../../tag/Support.class.js';
|
|
3
|
+
import { TagGlobal } from '../../tag/TemplaterResult.class.js';
|
|
4
|
+
export type Callback = (...args: any[]) => any;
|
|
5
|
+
export declare function bindSubjectCallback(value: Callback, support: AnySupport): {
|
|
6
|
+
(element: Element, args: any[]): any;
|
|
7
|
+
tagFunction: Callback;
|
|
8
|
+
support: AnySupport;
|
|
9
|
+
};
|
|
10
|
+
export declare function runTagCallback(value: Callback, support: BaseSupport | Support, bindTo: unknown, args: any[]): any;
|
|
11
|
+
export declare function afterTagCallback(callbackResult: any, eventHandlerSupport: AnySupport): any;
|
|
12
|
+
export declare function checkAfterCallbackPromise(callbackResult: any, last: BaseSupport | Support, global: TagGlobal): any;
|
|
13
|
+
export declare function runBlocked(tag: BaseSupport | Support): BaseSupport | Support;
|