taggedjs 2.8.1 → 2.8.3

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.
Files changed (122) hide show
  1. package/bundle.js +1 -1
  2. package/bundle.js.map +1 -1
  3. package/js/alterProp.function.d.ts +3 -3
  4. package/js/index.d.ts +2 -2
  5. package/js/index.js +1 -1
  6. package/js/index.js.map +1 -1
  7. package/js/interpolations/attributes/addSupportEventListener.function.d.ts +1 -1
  8. package/js/interpolations/attributes/bindSubjectCallback.function.d.ts +2 -2
  9. package/js/interpolations/attributes/getUpTags.function.d.ts +1 -1
  10. package/js/interpolations/attributes/processAttribute.function.d.ts +1 -1
  11. package/js/interpolations/attributes/processAttribute.function.js +28 -10
  12. package/js/interpolations/attributes/processAttribute.function.js.map +1 -1
  13. package/js/interpolations/attributes/processAttributeCallback.function.d.ts +1 -1
  14. package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +2 -2
  15. package/js/interpolations/attributes/renderTagArray.function.d.ts +1 -1
  16. package/js/interpolations/attributes/specialAttribute.d.ts +2 -1
  17. package/js/interpolations/attributes/specialAttribute.js +1 -2
  18. package/js/interpolations/attributes/specialAttribute.js.map +1 -1
  19. package/js/interpolations/interpolateTemplate.d.ts +1 -1
  20. package/js/interpolations/optimizers/attachDomElements.function.d.ts +2 -1
  21. package/js/interpolations/optimizers/attachDomElements.function.js +5 -0
  22. package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -1
  23. package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js +1 -1
  24. package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js.map +1 -1
  25. package/js/interpolations/optimizers/replacePlaceholders.function.js +1 -1
  26. package/js/interpolations/optimizers/replacePlaceholders.function.js.map +1 -1
  27. package/js/interpolations/optimizers/restorePlaceholders.function.js +1 -1
  28. package/js/interpolations/optimizers/restorePlaceholders.function.js.map +1 -1
  29. package/js/interpolations/processSubscriptionUpdate.function.d.ts +1 -1
  30. package/js/interpolations/subscribeToTemplate.function.d.ts +1 -1
  31. package/js/interpolations/subscribeToTemplate.function.js +1 -0
  32. package/js/interpolations/subscribeToTemplate.function.js.map +1 -1
  33. package/js/isInstance.d.ts +3 -3
  34. package/js/isInstance.js +5 -1
  35. package/js/isInstance.js.map +1 -1
  36. package/js/state/StateMemory.type.d.ts +1 -1
  37. package/js/state/callback.function.d.ts +1 -1
  38. package/js/state/callbackStateUpdate.function.d.ts +1 -1
  39. package/js/state/handleProviderChanges.function.d.ts +1 -1
  40. package/js/state/providers.d.ts +1 -1
  41. package/js/state/providersChangeCheck.function.d.ts +1 -1
  42. package/js/state/setUse.function.d.ts +1 -1
  43. package/js/state/state.utils.d.ts +1 -1
  44. package/js/state/subject.function.js +0 -24
  45. package/js/state/subject.function.js.map +1 -1
  46. package/js/tag/BaseSupport.type.d.ts +1 -1
  47. package/js/tag/Context.types.d.ts +5 -3
  48. package/js/tag/TagMaker.type.d.ts +1 -1
  49. package/js/tag/ValueTypes.enum.d.ts +10 -10
  50. package/js/tag/ValueTypes.enum.js +9 -9
  51. package/js/tag/ValueTypes.enum.js.map +1 -1
  52. package/js/tag/afterRender.function.d.ts +1 -1
  53. package/js/tag/buildBeforeElement.function.d.ts +1 -1
  54. package/js/tag/checkDestroyPrevious.function.d.ts +1 -1
  55. package/js/tag/checkStateMismatch.function.d.ts +1 -1
  56. package/js/tag/clonePropsBy.function.d.ts +1 -1
  57. package/js/tag/cloneValueArray.function.d.ts +1 -1
  58. package/js/tag/destroySupport.function.d.ts +1 -1
  59. package/js/tag/executeWrap.function.d.ts +2 -2
  60. package/js/tag/getChildTagsToDestroy.function.d.ts +1 -1
  61. package/js/tag/getDomTag.function.d.ts +49 -0
  62. package/js/tag/getDomTag.function.js +43 -0
  63. package/js/tag/getDomTag.function.js.map +1 -0
  64. package/js/tag/getSupport.function.d.ts +35 -2
  65. package/js/tag/getSupport.function.js +40 -1
  66. package/js/tag/getSupport.function.js.map +1 -1
  67. package/js/tag/getSupportInCycle.function.d.ts +1 -1
  68. package/js/tag/getTagWrap.function.d.ts +2 -2
  69. package/js/tag/getTemplaterResult.function.d.ts +50 -0
  70. package/js/tag/getTemplaterResult.function.js +14 -0
  71. package/js/tag/getTemplaterResult.function.js.map +1 -0
  72. package/js/tag/hasSupportChanged.function.d.ts +1 -1
  73. package/js/tag/html.d.ts +1 -1
  74. package/js/tag/html.js +2 -2
  75. package/js/tag/html.js.map +1 -1
  76. package/js/tag/index.d.ts +3 -3
  77. package/js/tag/index.js +3 -3
  78. package/js/tag/index.js.map +1 -1
  79. package/js/tag/isLastRunMatched.function.d.ts +1 -1
  80. package/js/tag/isLikeTags.function.d.ts +2 -2
  81. package/js/tag/processUpdateAttrContext.function.d.ts +1 -1
  82. package/js/tag/processUpdateContext.function.d.ts +3 -2
  83. package/js/tag/processUpdateContext.function.js +7 -16
  84. package/js/tag/processUpdateContext.function.js.map +1 -1
  85. package/js/tag/render/renderExistingTag.function.d.ts +1 -1
  86. package/js/tag/render/renderSupport.function.d.ts +2 -2
  87. package/js/tag/render/renderTagOnly.function.d.ts +1 -1
  88. package/js/tag/render/renderWithSupport.function.d.ts +1 -1
  89. package/js/tag/render/softDestroySupport.function.d.ts +1 -1
  90. package/js/tag/smartRemoveKids.function.d.ts +1 -1
  91. package/js/tag/tag.d.ts +1 -1
  92. package/js/tag/tag.js +1 -1
  93. package/js/tag/tag.js.map +1 -1
  94. package/js/tag/tag.types.d.ts +1 -1
  95. package/js/tag/tag.utils.d.ts +2 -2
  96. package/js/tag/tagElement.d.ts +2 -2
  97. package/js/tag/tagElement.js +1 -1
  98. package/js/tag/tagElement.js.map +1 -1
  99. package/js/tag/tagRunner.d.ts +1 -1
  100. package/js/tag/update/getNewGlobal.function.d.ts +1 -1
  101. package/js/tag/update/oneRenderToSupport.function.d.ts +2 -2
  102. package/js/tag/update/oneRenderToSupport.function.js +1 -1
  103. package/js/tag/update/oneRenderToSupport.function.js.map +1 -1
  104. package/js/tag/update/processFirstSubject.utils.d.ts +2 -2
  105. package/js/tag/update/processFirstSubjectComponent.function.d.ts +2 -2
  106. package/js/tag/update/processFirstSubjectValue.function.d.ts +3 -3
  107. package/js/tag/update/processFirstSubjectValue.function.js +25 -25
  108. package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
  109. package/js/tag/update/processNewSubjectTag.function.d.ts +2 -2
  110. package/js/tag/update/processNewValue.function.d.ts +1 -1
  111. package/js/tag/update/processNewValue.function.js +1 -1
  112. package/js/tag/update/processNewValue.function.js.map +1 -1
  113. package/js/tag/update/processTag.function.d.ts +3 -3
  114. package/js/tag/update/processTag.function.js +1 -1
  115. package/js/tag/update/processTag.function.js.map +1 -1
  116. package/js/tag/update/processTagArray.d.ts +3 -3
  117. package/js/tag/update/processTagResult.function.d.ts +1 -1
  118. package/js/tag/update/updateExistingTagComponent.function.d.ts +1 -1
  119. package/js/tag/update/updateExistingValue.function.d.ts +1 -1
  120. package/js/tag/update/validateTemplater.function.d.ts +1 -1
  121. package/js/tag/updateSupportBy.function.d.ts +1 -1
  122. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"subject.function.js","sourceRoot":"","sources":["../../ts/state/subject.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,+GAA+G;AAC/G,MAAM,UAAU,OAAO,CACrB,YAAgB,EAChB,cAAkC;IAElC,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAA;IAEnC,IAAG,OAAO,EAAE,CAAC;QACT,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,CA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CAAC,MAAM,EACjB,WAAW,CAAC,MAAM,CACnB,CAAA;YACD,OAAO,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAQD,SAAS,GAAG,CAAC,IAAW;IACtB,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAC/B,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,UAAU;QAC/C,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,MAAM;KACxC,CAAC,CAAC,CAAA;IACH,MAAM,UAAU,GAAG,iBAAiB,EAAgB,CAAA;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,IAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QACvC,UAAU,CACR,UAAU,CAAC,KAAK,EAChB,WAAW,CAAC,UAAU,EACtB,UAAU,CAAC,MAAM,EACjB,WAAW,CAAC,MAAM,CACnB,CAAA;QACD,OAAO,CAAC,CAAA;IACV,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA"}
@@ -1,4 +1,4 @@
1
- import { HtmlSupport, SupportContextItem } from './Support.class.js';
1
+ import { HtmlSupport, SupportContextItem } from './getSupport.function.js';
2
2
  export type BaseSupport = HtmlSupport & {
3
3
  subject: SupportContextItem;
4
4
  };
@@ -1,11 +1,13 @@
1
1
  import { SpecialDefinition } from '../interpolations/attributes/processAttribute.function.js';
2
2
  import { HowToSet } from '../interpolations/attributes/howToSetInputValue.function.js';
3
3
  import { InterpolateSubject } from './update/processFirstSubject.utils.js';
4
- import { Clone, TagGlobal } from './TemplaterResult.class.js';
5
- import { SupportContextItem } from './Support.class.js';
4
+ import { Clone, TagGlobal } from './getTemplaterResult.function.js';
5
+ import { AnySupport, SupportContextItem } from './getSupport.function.js';
6
+ export type ContextHandler = (value: unknown, values: unknown[], newSupport: AnySupport, contextItem: ContextItem) => void;
6
7
  export type ContextItem = {
7
- isAttr?: true;
8
8
  element?: Element;
9
+ handler?: ContextHandler;
10
+ isAttr?: true;
9
11
  howToSet?: HowToSet;
10
12
  isNameOnly?: boolean;
11
13
  attrName?: string;
@@ -1,2 +1,2 @@
1
- import { DomTag, StringTag } from './Tag.class.js';
1
+ import { DomTag, StringTag } from './getDomTag.function.js';
2
2
  export type TagMaker<Args extends any[] = any[]> = ((...args: Args) => StringTag | DomTag | TagMaker) | ((...args: Args) => (...args: Args) => StringTag | DomTag | TagMaker);
@@ -11,17 +11,17 @@ export declare enum BasicTypes {
11
11
  unknown = "unknown",
12
12
  object = "object"
13
13
  }
14
- export type ValueType = [string];
14
+ export type ValueType = string;
15
15
  type ValueTypeObject = {
16
- tag: ValueType;
17
- dom: ValueType;
18
- templater: ValueType;
19
- tagComponent: ValueType;
20
- tagArray: ValueType;
21
- subject: ValueType;
22
- tagJsSubject: ValueType;
23
- renderOnce: ValueType;
24
- stateRender: ValueType;
16
+ tag: string;
17
+ dom: string;
18
+ templater: string;
19
+ tagComponent: string;
20
+ tagArray: string;
21
+ subject: string;
22
+ tagJsSubject: string;
23
+ renderOnce: string;
24
+ stateRender: string;
25
25
  version: number;
26
26
  };
27
27
  /** Used as direct memory comparisons, the strings are never compared, just the array */
@@ -16,15 +16,15 @@ export var BasicTypes;
16
16
  const version = Date.now();
17
17
  /** Used as direct memory comparisons, the strings are never compared, just the array */
18
18
  export const ValueTypes = {
19
- tag: ['html'], // html'' aka StringTag | DomTag
20
- dom: ['dom'], // compiled version of html''
21
- templater: ['templater'],
22
- tagComponent: ['tagComponent'],
23
- tagArray: ['tagArray'],
24
- subject: ['subject'],
25
- tagJsSubject: ['tagJsSubject'],
26
- renderOnce: ['renderOnce'],
27
- stateRender: ['stateRender'],
19
+ tag: 'html', // html'' aka StringTag | DomTag
20
+ dom: 'dom', // compiled version of html''
21
+ templater: 'templater',
22
+ tagComponent: 'tagComponent',
23
+ tagArray: 'tagArray',
24
+ subject: 'subject',
25
+ tagJsSubject: 'tagJsSubject',
26
+ renderOnce: 'renderOnce',
27
+ stateRender: 'stateRender',
28
28
  version,
29
29
  };
30
30
  //# sourceMappingURL=ValueTypes.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ValueTypes.enum.js","sourceRoot":"","sources":["../../ts/tag/ValueTypes.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAA;AAEvB,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;AACzB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAkBD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAE1B,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,gCAAgC;IAC/C,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,6BAA6B;IAE3C,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,YAAY,EAAE,CAAC,cAAc,CAAC;IAC9B,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,YAAY,EAAE,CAAC,cAAc,CAAC;IAE9B,UAAU,EAAE,CAAC,YAAY,CAAC;IAC1B,WAAW,EAAE,CAAC,aAAa,CAAC;IAE5B,OAAO;CACR,CAAA"}
1
+ {"version":3,"file":"ValueTypes.enum.js","sourceRoot":"","sources":["../../ts/tag/ValueTypes.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAA;AAEvB,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;AACzB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAkBD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAE1B,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,GAAG,EAAE,MAAM,EAAE,gCAAgC;IAC7C,GAAG,EAAE,KAAK,EAAE,6BAA6B;IAEzC,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;IAE5B,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAE1B,OAAO;CACR,CAAA"}
@@ -1,4 +1,4 @@
1
- import { AnySupport } from './Support.class.js';
1
+ import { AnySupport } from './getSupport.function.js';
2
2
  /** Compares states of previous renders
3
3
  * @property support - The workflow that supports a single tag
4
4
  * @property ownerSupport - undefined when "support" is the app element
@@ -1,5 +1,5 @@
1
1
  import { Counts } from '../interpolations/interpolateTemplate.js';
2
- import { AnySupport } from './Support.class.js';
2
+ import { AnySupport } from './getSupport.function.js';
3
3
  import { ContextItem, Context } from './Context.types.js';
4
4
  /** Function that kicks off actually putting tags down as HTML elements */
5
5
  export declare function buildBeforeElement(support: AnySupport, counts: Counts, element?: Element, insertBefore?: Text): {
@@ -1,4 +1,4 @@
1
- import { SupportContextItem } from './Support.class.js';
1
+ import { SupportContextItem } from './getSupport.function.js';
2
2
  import { ContextItem } from './Context.types.js';
3
3
  export declare function checkArrayValueChange(newValue: unknown, subject: ContextItem): false | 9;
4
4
  export declare function destroyArray(subject: ContextItem, lastArray: any[]): void;
@@ -1,3 +1,3 @@
1
- import { AnySupport } from './Support.class.js';
1
+ import { AnySupport } from './getSupport.function.js';
2
2
  import { StateMemory } from '../state/StateMemory.type.js';
3
3
  export declare function checkStateMismatch(config: StateMemory, support: AnySupport): void;
@@ -1,5 +1,5 @@
1
1
  import { Props } from '../Props.js';
2
- import { AnySupport } from './Support.class.js';
2
+ import { AnySupport } from './getSupport.function.js';
3
3
  export declare function clonePropsBy(support: AnySupport, props: Props, castProps?: Props): {
4
4
  latest: Props;
5
5
  castProps: Props | undefined;
@@ -1,4 +1,4 @@
1
- import { StringTag } from './Tag.class.js';
1
+ import { StringTag } from './getDomTag.function.js';
2
2
  export declare function cloneValueArray<T>(values: (T | StringTag | StringTag[])[]): T[];
3
3
  /** clones only what is needed to compare differences later */
4
4
  export declare function cloneTagJsValue<T>(value: T, maxDepth: number): T;
@@ -1,2 +1,2 @@
1
- import { AnySupport } from './Support.class.js';
1
+ import { AnySupport } from './getSupport.function.js';
2
2
  export declare function destroySupport(support: AnySupport): Promise<void>[];
@@ -1,5 +1,5 @@
1
- import { TemplaterResult } from './TemplaterResult.class.js';
1
+ import { TemplaterResult } from './getTemplaterResult.function.js';
2
2
  import { TagWrapper } from './tag.utils.js';
3
- import { AnySupport } from './Support.class.js';
3
+ import { AnySupport } from './getSupport.function.js';
4
4
  import { Props } from '../Props.js';
5
5
  export declare function executeWrap(templater: TemplaterResult, result: TagWrapper<unknown>, useSupport: AnySupport, castedProps?: Props): AnySupport;
@@ -1,5 +1,5 @@
1
1
  import { Subscription } from '../subject/subject.utils.js';
2
- import { AnySupport } from './Support.class.js';
2
+ import { AnySupport } from './getSupport.function.js';
3
3
  import { Context } from './Context.types.js';
4
4
  export declare function getChildTagsToDestroy(childTags: Context): void;
5
5
  export declare function getChildTagsToSoftDestroy(childTags: Context, tags?: AnySupport[], subs?: Subscription<any>[]): {
@@ -0,0 +1,49 @@
1
+ import { State } from '../state/index.js';
2
+ import { InterpolatedTemplates } from '../interpolations/interpolations.js';
3
+ import { TemplaterResult } from './getTemplaterResult.function.js';
4
+ import { TagValues } from './html.js';
5
+ import { ValueTypes } from './ValueTypes.enum.js';
6
+ import { DomMetaMap, LikeObjectChildren } from '../interpolations/optimizers/LikeObjectElement.type.js';
7
+ import { AnySupport } from './getSupport.function.js';
8
+ import { StringTag } from './StringTag.type.js';
9
+ export { StringTag };
10
+ export declare const variablePrefix = ":tagvar";
11
+ export declare const variableSuffix = ":";
12
+ export type EventCallback = (event: Event) => any;
13
+ export type EventMem = {
14
+ elm: Element;
15
+ callback: EventCallback;
16
+ };
17
+ export type TagMemory = {
18
+ state: State;
19
+ };
20
+ export interface TagTemplate {
21
+ interpolation: InterpolatedTemplates;
22
+ string: string;
23
+ strings: string[];
24
+ values: unknown[];
25
+ domMetaMap?: DomMetaMap;
26
+ }
27
+ export type Tag = {
28
+ values: unknown[];
29
+ tagJsType?: typeof ValueTypes.tag | typeof ValueTypes.dom;
30
+ templater?: TemplaterResult;
31
+ ownerSupport?: AnySupport;
32
+ arrayValue?: any;
33
+ };
34
+ export type KeyFunction = (arrayValue: unknown) => StringTag;
35
+ export declare function getStringTag(strings: string[], values: unknown[]): StringTag;
36
+ export type DomTag = Tag & {
37
+ children?: {
38
+ dom: LikeObjectChildren;
39
+ values: TagValues;
40
+ };
41
+ dom: LikeObjectChildren;
42
+ values: unknown[];
43
+ key: (arrayValue: unknown) => DomTag;
44
+ html: {
45
+ dom: (dom: LikeObjectChildren, // ObjectChildren
46
+ values: TagValues) => DomTag;
47
+ };
48
+ };
49
+ export declare function getDomTag(dom: LikeObjectChildren, values: unknown[]): DomTag;
@@ -0,0 +1,43 @@
1
+ // taggedjs-no-compile
2
+ import { ValueTypes } from './ValueTypes.enum.js';
3
+ import { getSupportInCycle } from './getSupportInCycle.function.js';
4
+ export const variablePrefix = ':tagvar';
5
+ export const variableSuffix = ':';
6
+ export function getStringTag(strings, values) {
7
+ const tag = {
8
+ values,
9
+ ownerSupport: getSupportInCycle(),
10
+ tagJsType: ValueTypes.tag,
11
+ strings,
12
+ key(arrayValue) {
13
+ tag.arrayValue = arrayValue;
14
+ return tag;
15
+ },
16
+ html: function html(strings, values) {
17
+ tag.children = { strings, values };
18
+ return tag;
19
+ }
20
+ };
21
+ return tag;
22
+ }
23
+ export function getDomTag(dom, values) {
24
+ const tag = {
25
+ values,
26
+ ownerSupport: getSupportInCycle(),
27
+ dom,
28
+ tagJsType: ValueTypes.dom,
29
+ key: function keyFun(arrayValue) {
30
+ tag.arrayValue = arrayValue;
31
+ return tag;
32
+ },
33
+ html: {
34
+ dom: function dom(dom, // ObjectChildren
35
+ values) {
36
+ tag.children = { dom: dom, values };
37
+ return tag;
38
+ }
39
+ }
40
+ };
41
+ return tag;
42
+ }
43
+ //# sourceMappingURL=getDomTag.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDomTag.function.js","sourceRoot":"","sources":["../../ts/tag/getDomTag.function.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAOtB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAInE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAA;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AA4BjC,MAAM,UAAU,YAAY,CAC1B,OAAiB,EACjB,MAAiB;IAEjB,MAAM,GAAG,GAAc;QACrB,MAAM;QACN,YAAY,EAAE,iBAAiB,EAAE;QAEjC,SAAS,EAAE,UAAU,CAAC,GAAG;QACzB,OAAO;QACP,GAAG,CAAC,UAAmB;YACrB,GAAG,CAAC,UAAU,GAAG,UAAU,CAAA;YAC3B,OAAO,GAAG,CAAA;QACZ,CAAC;QACD,IAAI,EAAE,SAAS,IAAI,CACjB,OAAwC,EACxC,MAAiB;YAEjB,GAAG,CAAC,QAAQ,GAAG,EAAC,OAAO,EAAE,MAAM,EAAC,CAAA;YAChC,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAmBD,MAAM,UAAU,SAAS,CACvB,GAAuB,EACvB,MAAiB;IAEjB,MAAM,GAAG,GAAW;QAClB,MAAM;QACN,YAAY,EAAE,iBAAiB,EAAE;QACjC,GAAG;QACH,SAAS,EAAE,UAAU,CAAC,GAAG;QACzB,GAAG,EAAE,SAAS,MAAM,CAAC,UAAmB;YACtC,GAAG,CAAC,UAAU,GAAG,UAAU,CAAA;YAC3B,OAAO,GAAG,CAAA;QACZ,CAAC;QACD,IAAI,EAAE;YACJ,GAAG,EAAE,SAAS,GAAG,CACf,GAAuB,EAAE,iBAAiB;YAC1C,MAAiB;gBAEjB,GAAG,CAAC,QAAQ,GAAG,EAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAC,CAAA;gBACjC,OAAO,GAAG,CAAA;YACZ,CAAC;SACF;KACF,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1,6 +1,39 @@
1
- import { TemplaterResult } from './TemplaterResult.class.js';
1
+ import { SupportTagGlobal, TemplaterResult } from './getTemplaterResult.function.js';
2
2
  import { ContextItem } from './Context.types.js';
3
3
  import { Props } from '../Props.js';
4
- import { AnySupport } from './Support.class.js';
4
+ import { BaseSupport } from './BaseSupport.type.js';
5
+ import { State } from '../state/index.js';
6
+ import { StatesSetter } from '../state/states.utils.js';
7
+ export type AnySupport = (BaseSupport & {
8
+ state: State;
9
+ states: StatesSetter[];
10
+ });
11
+ export type PropsConfig = {
12
+ latest: Props;
13
+ castProps?: Props;
14
+ };
15
+ export type HtmlSupport = {
16
+ appSupport: AnySupport;
17
+ ownerSupport?: AnySupport;
18
+ appElement?: Element;
19
+ propsConfig?: PropsConfig;
20
+ templater: TemplaterResult;
21
+ subject: ContextItem;
22
+ };
23
+ export type SupportContextItem = ContextItem & {
24
+ global: SupportTagGlobal;
25
+ /** Indicator of re-rending. Saves from double rending something already rendered */
26
+ renderCount: number;
27
+ };
28
+ /** used only for apps, otherwise use Support */
29
+ export declare function getBaseSupport(templater: TemplaterResult, subject: SupportContextItem, castedProps?: Props): BaseSupport;
30
+ export type Support = AnySupport & {
31
+ ownerSupport: AnySupport;
32
+ appSupport: BaseSupport;
33
+ };
34
+ export declare function upgradeBaseToSupport(templater: TemplaterResult, // at runtime rendering of a tag, it needs to be married to a new Support()
35
+ support: BaseSupport, appSupport: AnySupport, castedProps?: Props): AnySupport;
36
+ export declare function getHtmlSupport(templater: TemplaterResult, // at runtime rendering of a tag, it needs to be married to a new Support()
37
+ ownerSupport: AnySupport, appSupport: AnySupport, subject: ContextItem, castedProps?: Props): AnySupport;
5
38
  export declare function getSupport(templater: TemplaterResult, // at runtime rendering of a tag, it needs to be married to a new Support()
6
39
  ownerSupport: AnySupport, appSupport: AnySupport, subject: ContextItem, castedProps?: Props): AnySupport;
@@ -1,4 +1,43 @@
1
- import { getBaseSupport, upgradeBaseToSupport } from './Support.class.js';
1
+ import { clonePropsBy } from './clonePropsBy.function.js';
2
+ import { Subject } from '../subject/Subject.class.js';
3
+ /** used only for apps, otherwise use Support */
4
+ export function getBaseSupport(templater, subject, castedProps) {
5
+ const baseSupport = {
6
+ templater,
7
+ subject,
8
+ castedProps,
9
+ appSupport: undefined,
10
+ };
11
+ // baseSupport.appSupport = baseSupport
12
+ const global = subject.global;
13
+ global.blocked = [];
14
+ global.destroy$ = new Subject();
15
+ return baseSupport;
16
+ }
17
+ export function upgradeBaseToSupport(templater, // at runtime rendering of a tag, it needs to be married to a new Support()
18
+ support, appSupport, castedProps) {
19
+ ;
20
+ support.state = [];
21
+ support.states = [];
22
+ support.appSupport = appSupport;
23
+ const props = templater.props; // natural props
24
+ if (props) {
25
+ support.propsConfig = clonePropsBy(support, props, castedProps);
26
+ }
27
+ return support;
28
+ }
29
+ export function getHtmlSupport(templater, // at runtime rendering of a tag, it needs to be married to a new Support()
30
+ ownerSupport, appSupport, subject, castedProps) {
31
+ const support = {
32
+ templater,
33
+ subject,
34
+ castedProps,
35
+ appSupport: undefined,
36
+ };
37
+ support.ownerSupport = ownerSupport;
38
+ support.appSupport = appSupport;
39
+ return support;
40
+ }
2
41
  export function getSupport(templater, // at runtime rendering of a tag, it needs to be married to a new Support()
3
42
  ownerSupport, appSupport, subject, castedProps) {
4
43
  const support = getBaseSupport(templater, subject, castedProps);
@@ -1 +1 @@
1
- {"version":3,"file":"getSupport.function.js","sourceRoot":"","sources":["../../ts/tag/getSupport.function.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,cAAc,EAAsB,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzG,MAAM,UAAU,UAAU,CACxB,SAA0B,EAAE,2EAA2E;AACvG,YAAwB,EACxB,UAAsB,EACtB,OAAoB,EACpB,WAAmB;IAEnB,MAAM,OAAO,GAAG,cAAc,CAC5B,SAAS,EACT,OAA6B,EAC7B,WAAW,CACE,CAAA;IAEf,OAAO,CAAC,YAAY,GAAG,YAAY,CAAA;IAEnC,OAAO,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;AAC1E,CAAC"}
1
+ {"version":3,"file":"getSupport.function.js","sourceRoot":"","sources":["../../ts/tag/getSupport.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAmCrD,gDAAgD;AAChD,MAAM,UAAU,cAAc,CAC5B,SAA0B,EAC1B,OAA0B,EAC1B,WAAmB;IAEnB,MAAM,WAAW,GAAG;QAClB,SAAS;QACT,OAAO;QACP,WAAW;QAEX,UAAU,EAAE,SAAkC;KAChC,CAAA;IAEhB,uCAAuC;IAEvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,MAAM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AAC"}
@@ -1 +1 @@
1
- export declare function getSupportInCycle(): import("./Support.class.js").AnySupport | undefined;
1
+ export declare function getSupportInCycle(): import("./getSupport.function.js").AnySupport | undefined;
@@ -1,6 +1,6 @@
1
- import { TemplaterResult, Wrapper } from './TemplaterResult.class.js';
1
+ import { TemplaterResult, Wrapper } from './getTemplaterResult.function.js';
2
2
  import { TagWrapper } from './tag.utils.js';
3
- import { AnySupport } from './Support.class.js';
3
+ import { AnySupport } from './getSupport.function.js';
4
4
  import { Props } from '../Props.js';
5
5
  /** creates/returns a function that when called then calls the original component function
6
6
  * Gets used as templater.wrapper()
@@ -0,0 +1,50 @@
1
+ import { StringTag, DomTag, EventCallback } from './getDomTag.function.js';
2
+ import { ContextItem } from './Context.types.js';
3
+ import { AnySupport, SupportContextItem } from './getSupport.function.js';
4
+ import { Props } from '../Props.js';
5
+ import { TagWrapper } from './tag.utils.js';
6
+ import { Provider } from '../state/providers.js';
7
+ import { OnDestroyCallback } from '../state/onDestroy.js';
8
+ import { Subscription } from '../subject/subject.utils.js';
9
+ import { Subject } from '../subject/index.js';
10
+ import { ValueTypes } from './ValueTypes.enum.js';
11
+ import { DomObjectChildren } from '../interpolations/optimizers/ObjectNode.types.js';
12
+ import { PropWatches } from './tag.js';
13
+ export type Wrapper = ((newSupport: AnySupport, subject: ContextItem, prevSupport?: AnySupport) => AnySupport) & TagWrapper<unknown> & {
14
+ tagJsType: typeof ValueTypes.tagComponent | typeof ValueTypes.renderOnce | typeof ValueTypes.templater;
15
+ };
16
+ export type TagGlobal = {
17
+ htmlDomMeta?: DomObjectChildren;
18
+ deleted?: true;
19
+ isApp?: boolean;
20
+ subscriptions?: Subscription<unknown>[];
21
+ destroyCallback?: OnDestroyCallback;
22
+ locked?: true;
23
+ callbackMaker?: true;
24
+ destroys?: (() => any)[];
25
+ };
26
+ export type SupportTagGlobal = TagGlobal & {
27
+ destroy$: Subject<void>;
28
+ blocked: AnySupport[];
29
+ oldest: AnySupport;
30
+ newest: AnySupport;
31
+ context: SupportContextItem[];
32
+ providers?: Provider[];
33
+ };
34
+ export type BaseTagGlobal = SupportTagGlobal & {
35
+ events?: Events;
36
+ };
37
+ export type Events = {
38
+ [name: string]: EventCallback;
39
+ };
40
+ export type Clone = (Element | Text | ChildNode);
41
+ export type TemplaterResult = {
42
+ propWatch: PropWatches;
43
+ tagJsType: string;
44
+ wrapper?: Wrapper;
45
+ tag?: StringTag | DomTag;
46
+ props?: Props;
47
+ arrayValue?: unknown;
48
+ key: (arrayValue: unknown) => TemplaterResult;
49
+ };
50
+ export declare function getTemplaterResult(propWatch: PropWatches, props?: Props): TemplaterResult;
@@ -0,0 +1,14 @@
1
+ import { ValueTypes } from './ValueTypes.enum.js';
2
+ export function getTemplaterResult(propWatch, props) {
3
+ const templater = {
4
+ propWatch,
5
+ props,
6
+ tagJsType: ValueTypes.templater,
7
+ key: function keyTemplate(arrayValue) {
8
+ templater.arrayValue = arrayValue;
9
+ return templater;
10
+ }
11
+ };
12
+ return templater;
13
+ }
14
+ //# sourceMappingURL=getTemplaterResult.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTemplaterResult.function.js","sourceRoot":"","sources":["../../ts/tag/getTemplaterResult.function.ts"],"names":[],"mappings":"AASA,OAAO,EAAa,UAAU,EAAE,MAAM,sBAAsB,CAAA;AA8D5D,MAAM,UAAU,kBAAkB,CAChC,SAAsB,EACtB,KAAa;IAEb,MAAM,SAAS,GAAoB;QACjC,SAAS;QACT,KAAK;QACL,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,GAAG,EAAE,SAAS,WAAW,CAAC,UAAmB;YAC3C,SAAS,CAAC,UAAU,GAAG,UAAU,CAAA;YACjC,OAAO,SAAS,CAAA;QAClB,CAAC;KACF,CAAA;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { Props } from '../Props.js';
2
2
  import { BaseSupport } from './BaseSupport.type.js';
3
- import { TemplaterResult } from './TemplaterResult.class.js';
3
+ import { TemplaterResult } from './getTemplaterResult.function.js';
4
4
  export declare function hasSupportChanged(lastSupport: BaseSupport, newTemplater: TemplaterResult): number | string | false;
5
5
  export declare function immutablePropMatch(props: Props, pastCloneProps: Props): false | 2;
6
6
  export declare function shallowPropMatch(props: Props, pastCloneProps: Props): false | 3 | 3.1 | 3.3;
package/js/tag/html.d.ts CHANGED
@@ -4,5 +4,5 @@ import { RegularValue } from './update/processRegularValue.function.js';
4
4
  export type TagValues = (((e: InputElementTargetEvent) => any) | RegularValue | null | undefined | object)[];
5
5
  export declare function html(strings: string[] | TemplateStringsArray, ...values: TagValues): import("./StringTag.type.js").StringTag;
6
6
  export declare namespace html {
7
- var dom: (dom: LikeObjectChildren, ...values: TagValues) => import("./Tag.class.js").DomTag;
7
+ var dom: (dom: LikeObjectChildren, ...values: TagValues) => import("./getDomTag.function.js").DomTag;
8
8
  }
package/js/tag/html.js CHANGED
@@ -1,6 +1,6 @@
1
- import { getStringTag, getDomTag } from './Tag.class.js';
1
+ import { getStringTag, getDomTag } from './getDomTag.function.js';
2
2
  import { PropWatches } from './tag.js';
3
- import { getTemplaterResult } from './TemplaterResult.class.js';
3
+ import { getTemplaterResult } from './getTemplaterResult.function.js';
4
4
  export function html(strings, ...values) {
5
5
  const stringTag = getStringTag(strings, values);
6
6
  const templater = getTemplaterResult(PropWatches.NONE);
@@ -1 +1 @@
1
- {"version":3,"file":"html.js","sourceRoot":"","sources":["../../ts/tag/html.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAK/D,MAAM,UAAU,IAAI,CAClB,OAAwC,EACxC,GAAG,MAAiB;IAEpB,MAAM,SAAS,GAAG,YAAY,CAAC,OAAmB,EAAE,MAAM,CAAC,CAAA;IAC3D,MAAM,SAAS,GAAG,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACtD,SAAS,CAAC,GAAG,GAAG,SAAS,CAAA;IACzB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;IAC/B,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,IAAI,CAAC,GAAG,GAAG,UACT,GAAuB,EACvB,GAAG,MAAiB;IAEpB,OAAO,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AAC/B,CAAC,CAAA"}
1
+ {"version":3,"file":"html.js","sourceRoot":"","sources":["../../ts/tag/html.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAKrE,MAAM,UAAU,IAAI,CAClB,OAAwC,EACxC,GAAG,MAAiB;IAEpB,MAAM,SAAS,GAAG,YAAY,CAAC,OAAmB,EAAE,MAAM,CAAC,CAAA;IAC3D,MAAM,SAAS,GAAG,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACtD,SAAS,CAAC,GAAG,GAAG,SAAS,CAAA;IACzB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;IAC/B,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,IAAI,CAAC,GAAG,GAAG,UACT,GAAuB,EACvB,GAAG,MAAiB;IAEpB,OAAO,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AAC/B,CAAC,CAAA"}
package/js/tag/index.d.ts CHANGED
@@ -3,18 +3,18 @@ export * from './tag.types.js';
3
3
  export { getDomMeta } from './domMetaCollector.js';
4
4
  export * from './buildBeforeElement.function.js';
5
5
  export * from './tag.js';
6
- export * from './Tag.class.js';
6
+ export * from './getDomTag.function.js';
7
7
  export * from './tag.utils.js';
8
8
  export * from './html.js';
9
9
  export * from './ValueTypes.enum.js';
10
10
  export * from './render/renderTagOnly.function.js';
11
11
  export * from './update/oneRenderToSupport.function.js';
12
- export * from './TemplaterResult.class.js';
12
+ export * from './getTemplaterResult.function.js';
13
13
  export * from './destroySupport.function.js';
14
14
  export * from './checkDestroyPrevious.function.js';
15
15
  export * from './Context.types.js';
16
16
  export * from './tagElement.js';
17
- export { Tag, DomTag, variablePrefix } from './Tag.class.js';
17
+ export { Tag, DomTag, variablePrefix } from './getDomTag.function.js';
18
18
  export { StringTag } from './StringTag.type.js';
19
19
  export { renderSupport } from './render/renderSupport.function.js';
20
20
  export { renderWithSupport } from './render/renderWithSupport.function.js';
package/js/tag/index.js CHANGED
@@ -3,18 +3,18 @@ export * from './tag.types.js';
3
3
  export { getDomMeta } from './domMetaCollector.js';
4
4
  export * from './buildBeforeElement.function.js';
5
5
  export * from './tag.js';
6
- export * from './Tag.class.js';
6
+ export * from './getDomTag.function.js';
7
7
  export * from './tag.utils.js';
8
8
  export * from './html.js';
9
9
  export * from './ValueTypes.enum.js';
10
10
  export * from './render/renderTagOnly.function.js';
11
11
  export * from './update/oneRenderToSupport.function.js';
12
- export * from './TemplaterResult.class.js';
12
+ export * from './getTemplaterResult.function.js';
13
13
  export * from './destroySupport.function.js';
14
14
  export * from './checkDestroyPrevious.function.js';
15
15
  export * from './Context.types.js';
16
16
  export * from './tagElement.js';
17
- export { variablePrefix } from './Tag.class.js';
17
+ export { variablePrefix } from './getDomTag.function.js';
18
18
  export { renderSupport } from './render/renderSupport.function.js';
19
19
  export { renderWithSupport } from './render/renderWithSupport.function.js';
20
20
  export { paint } from './paint.function.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/tag/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,cAAc,kCAAkC,CAAA;AA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EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAA"}
@@ -1,2 +1,2 @@
1
- import { TagTemplate } from './Tag.class.js';
1
+ import { TagTemplate } from './getDomTag.function.js';
2
2
  export declare function isLastRunMatched(strings: string[], values: unknown[], lastRun?: TagTemplate): boolean;
@@ -1,5 +1,5 @@
1
- import { StringTag, DomTag } from './Tag.class.js';
2
- import { AnySupport } from './Support.class.js';
1
+ import { StringTag, DomTag } from './getDomTag.function.js';
2
+ import { AnySupport } from './getSupport.function.js';
3
3
  export declare function isLikeTags(support0: AnySupport | StringTag, // new
4
4
  support1: AnySupport): boolean;
5
5
  export declare function isLikeDomTags(tag0: DomTag, tag1: DomTag): boolean;
@@ -1,3 +1,3 @@
1
- import { AnySupport } from './Support.class.js';
1
+ import { AnySupport } from './getSupport.function.js';
2
2
  import { ContextItem } from './Context.types.js';
3
3
  export declare function processUpdateAttrContext(values: unknown[], value: unknown, contextItem: ContextItem, ownerSupport: AnySupport): void;
@@ -1,5 +1,6 @@
1
- import { AnySupport } from './Support.class.js';
1
+ import { AnySupport } from './getSupport.function.js';
2
2
  import { Context } from './Context.types.js';
3
3
  export declare function processUpdateContext(support: AnySupport, context: Context): Context;
4
4
  /** returns boolean of did render */
5
- export declare function processUpdateOneContext(values: unknown[], index: number, context: Context, ownerSupport: AnySupport): void;
5
+ export declare function processUpdateOneContext(values: unknown[], // the interpolated values
6
+ index: number, context: Context, ownerSupport: AnySupport): void;
@@ -1,6 +1,3 @@
1
- import { processUpdateAttrContext } from './processUpdateAttrContext.function.js';
2
- import { updateExistingValue } from './update/updateExistingValue.function.js';
3
- import { isSubjectInstance } from '../isInstance.js';
4
1
  export function processUpdateContext(support, context) {
5
2
  const thisTag = support.templater.tag;
6
3
  const values = thisTag.values;
@@ -13,23 +10,17 @@ export function processUpdateContext(support, context) {
13
10
  return context;
14
11
  }
15
12
  /** returns boolean of did render */
16
- export function processUpdateOneContext(values, index, context, ownerSupport) {
13
+ export function processUpdateOneContext(values, // the interpolated values
14
+ index, context, ownerSupport) {
17
15
  const value = values[index];
18
16
  // is something already there?
19
17
  const contextItem = context[index];
20
- if (isSubjectInstance(value)) {
21
- return; // emits on its own
18
+ // Do not continue if the value is just the same
19
+ if (value === contextItem.value) {
20
+ return;
22
21
  }
23
- if (contextItem.isAttr) {
24
- // Do not continue if the value is just the same
25
- if (value === contextItem.value) {
26
- return;
27
- }
28
- processUpdateAttrContext(values, value, contextItem, ownerSupport);
29
- contextItem.value = value;
30
- }
31
- // listeners will evaluate updated values to possibly update display(s)
32
- updateExistingValue(contextItem, value, ownerSupport);
22
+ const handler = contextItem.handler;
23
+ handler(value, values, ownerSupport, contextItem);
33
24
  contextItem.value = value;
34
25
  }
35
26
  //# sourceMappingURL=processUpdateContext.function.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"processUpdateContext.function.js","sourceRoot":"","sources":["../../ts/tag/processUpdateContext.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAKpD,MAAM,UAAU,oBAAoB,CAClC,OAAmB,EACnB,OAAgB;IAEhB,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,GAAyB,CAAA;IAC3D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAE7B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAA;IACzB,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,uBAAuB,CACrB,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,CACR,CAAA;QAED,EAAE,KAAK,CAAA;IACT,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,KAAa,EACb,OAAgB,EAChB,YAAwB;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAQ,CAAA;IAElC,8BAA8B;IAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;IAElC,IAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAM,CAAC,mBAAmB;IAC5B,CAAC;IAED,IAAG,WAAW,CAAC,MAAM,EAAE,CAAC;QACtB,gDAAgD;QAChD,IAAG,KAAK,KAAK,WAAW,CAAC,KAAK,EAAE,CAAC;YAC/B,OAAM;QACR,CAAC;QAED,wBAAwB,CACtB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,CACzC,CAAA;QAED,WAAW,CAAC,KAAK,GAAG,KAAK,CAAA;IAC3B,CAAC;IAED,uEAAuE;IACvE,mBAAmB,CACjB,WAAW,EACX,KAAK,EACL,YAAY,CACb,CAAA;IAED,WAAW,CAAC,KAAK,GAAG,KAAK,CAAA;AAC3B,CAAC"}
1
+ {"version":3,"file":"processUpdateContext.function.js","sourceRoot":"","sources":["../../ts/tag/processUpdateContext.function.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,oBAAoB,CAClC,OAAmB,EACnB,OAAgB;IAEhB,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,GAAyB,CAAA;IAC3D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAE7B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAA;IACzB,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,uBAAuB,CACrB,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,CACR,CAAA;QAED,EAAE,KAAK,CAAA;IACT,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EAAE,0BAA0B;AAC7C,KAAa,EACb,OAAgB,EAChB,YAAwB;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAQ,CAAA;IAElC,8BAA8B;IAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;IAElC,gDAAgD;IAChD,IAAG,KAAK,KAAK,WAAW,CAAC,KAAK,EAAE,CAAC;QAC/B,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,CAAC,OAAyB,CAAA;IAErD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;IACjD,WAAW,CAAC,KAAK,GAAG,KAAK,CAAA;AAC3B,CAAC"}