taggedjs 2.1.1 → 2.3.25
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/index.js +1 -1
- package/js/Clones.type.d.ts +1 -0
- package/js/Clones.type.js +2 -0
- package/js/Clones.type.js.map +1 -0
- package/js/Props.d.ts +1 -0
- package/js/Props.js +2 -0
- package/js/Props.js.map +1 -0
- package/js/Subject.d.ts +17 -0
- package/js/Subject.js +43 -0
- package/js/Subject.js.map +1 -0
- package/js/Tag.class.d.ts +69 -0
- package/js/Tag.class.js +247 -0
- package/js/Tag.class.js.map +1 -0
- package/js/Tag.utils.d.ts +12 -0
- package/js/Tag.utils.js +31 -0
- package/js/Tag.utils.js.map +1 -0
- package/js/ValueSubject.d.ts +6 -0
- package/js/ValueSubject.js +15 -0
- package/js/ValueSubject.js.map +1 -0
- package/js/bindSubjectCallback.function.d.ts +5 -0
- package/js/bindSubjectCallback.function.js +19 -0
- package/js/bindSubjectCallback.function.js.map +1 -0
- package/js/deepFunctions.d.ts +2 -0
- package/js/deepFunctions.js +76 -0
- package/js/deepFunctions.js.map +1 -0
- package/js/elementDestroyCheck.function.d.ts +3 -0
- package/js/elementDestroyCheck.function.js +17 -0
- package/js/elementDestroyCheck.function.js.map +1 -0
- package/js/elementInitCheck.d.ts +2 -0
- package/js/elementInitCheck.js +18 -0
- package/js/elementInitCheck.js.map +1 -0
- package/js/gateway/gateway.web.component.d.ts +11 -0
- package/js/gateway/gateway.web.component.js +20 -0
- package/js/gateway/gateway.web.component.js.map +1 -0
- package/js/gateway/index.d.ts +3 -0
- package/js/gateway/index.js +3 -0
- package/js/gateway/index.js.map +1 -0
- package/js/gateway/loadTagGateway.function.d.ts +2 -0
- package/js/gateway/loadTagGateway.function.js +18 -0
- package/js/gateway/loadTagGateway.function.js.map +1 -0
- package/js/gateway/tagGateway.function.d.ts +31 -0
- package/js/gateway/tagGateway.function.js +187 -0
- package/js/gateway/tagGateway.function.js.map +1 -0
- package/js/getCallback.d.ts +3 -0
- package/js/getCallback.js +50 -0
- package/js/getCallback.js.map +1 -0
- package/js/getTagSupport.d.ts +21 -0
- package/js/getTagSupport.js +109 -0
- package/js/getTagSupport.js.map +1 -0
- package/js/html.d.ts +2 -0
- package/js/html.js +5 -0
- package/js/html.js.map +1 -0
- package/js/index.d.ts +19 -0
- package/js/index.js +24 -0
- package/js/index.js.map +1 -0
- package/js/inputAttribute.d.ts +1 -0
- package/js/inputAttribute.js +19 -0
- package/js/inputAttribute.js.map +1 -0
- package/js/interpolateAttributes.d.ts +4 -0
- package/js/interpolateAttributes.js +135 -0
- package/js/interpolateAttributes.js.map +1 -0
- package/js/interpolateContentTemplates.d.ts +6 -0
- package/js/interpolateContentTemplates.js +54 -0
- package/js/interpolateContentTemplates.js.map +1 -0
- package/js/interpolateElement.d.ts +9 -0
- package/js/interpolateElement.js +39 -0
- package/js/interpolateElement.js.map +1 -0
- package/js/interpolateTemplate.d.ts +17 -0
- package/js/interpolateTemplate.js +64 -0
- package/js/interpolateTemplate.js.map +1 -0
- package/js/interpolations.d.ts +7 -0
- package/js/interpolations.js +18 -0
- package/js/interpolations.js.map +1 -0
- package/js/isInstance.d.ts +6 -0
- package/js/isInstance.js +10 -0
- package/js/isInstance.js.map +1 -0
- package/js/js/Clones.type.d.ts +1 -0
- package/js/js/Clones.type.js +2 -0
- package/js/js/Clones.type.js.map +1 -0
- package/js/js/Props.d.ts +1 -0
- package/js/js/Props.js +2 -0
- package/js/js/Props.js.map +1 -0
- package/js/js/Subject.d.ts +17 -0
- package/js/js/Subject.js +43 -0
- package/js/js/Subject.js.map +1 -0
- package/js/js/Tag.class.d.ts +67 -0
- package/js/js/Tag.class.js +241 -0
- package/js/js/Tag.class.js.map +1 -0
- package/js/js/Tag.utils.d.ts +12 -0
- package/js/js/Tag.utils.js +31 -0
- package/js/js/Tag.utils.js.map +1 -0
- package/js/js/ValueSubject.d.ts +6 -0
- package/js/js/ValueSubject.js +15 -0
- package/js/js/ValueSubject.js.map +1 -0
- package/js/js/bindSubjectCallback.function.d.ts +5 -0
- package/js/js/bindSubjectCallback.function.js +19 -0
- package/js/js/bindSubjectCallback.function.js.map +1 -0
- package/js/js/deepFunctions.d.ts +2 -0
- package/js/js/deepFunctions.js +76 -0
- package/js/js/deepFunctions.js.map +1 -0
- package/js/js/elementDestroyCheck.function.d.ts +3 -0
- package/js/js/elementDestroyCheck.function.js +17 -0
- package/js/js/elementDestroyCheck.function.js.map +1 -0
- package/js/js/elementInitCheck.d.ts +2 -0
- package/js/js/elementInitCheck.js +18 -0
- package/js/js/elementInitCheck.js.map +1 -0
- package/js/js/getCallback.d.ts +3 -0
- package/js/js/getCallback.js +50 -0
- package/js/js/getCallback.js.map +1 -0
- package/js/js/getTagSupport.d.ts +22 -0
- package/js/js/getTagSupport.js +116 -0
- package/js/js/getTagSupport.js.map +1 -0
- package/js/js/html.d.ts +2 -0
- package/js/js/html.js +5 -0
- package/js/js/html.js.map +1 -0
- package/js/js/index.d.ts +19 -0
- package/js/js/index.js +24 -0
- package/js/js/index.js.map +1 -0
- package/js/js/inputAttribute.d.ts +1 -0
- package/js/js/inputAttribute.js +19 -0
- package/js/js/inputAttribute.js.map +1 -0
- package/js/js/interpolateAttributes.d.ts +4 -0
- package/js/js/interpolateAttributes.js +127 -0
- package/js/js/interpolateAttributes.js.map +1 -0
- package/js/js/interpolateContentTemplates.d.ts +5 -0
- package/js/js/interpolateContentTemplates.js +57 -0
- package/js/js/interpolateContentTemplates.js.map +1 -0
- package/js/js/interpolateElement.d.ts +9 -0
- package/js/js/interpolateElement.js +32 -0
- package/js/js/interpolateElement.js.map +1 -0
- package/js/js/interpolateTemplate.d.ts +17 -0
- package/js/js/interpolateTemplate.js +64 -0
- package/js/js/interpolateTemplate.js.map +1 -0
- package/js/js/interpolations.d.ts +8 -0
- package/js/js/interpolations.js +17 -0
- package/js/js/interpolations.js.map +1 -0
- package/js/js/isInstance.d.ts +6 -0
- package/js/js/isInstance.js +10 -0
- package/js/js/isInstance.js.map +1 -0
- package/js/js/onDestroy.d.ts +2 -0
- package/js/js/onDestroy.js +20 -0
- package/js/js/onDestroy.js.map +1 -0
- package/js/js/onInit.d.ts +2 -0
- package/js/js/onInit.js +19 -0
- package/js/js/onInit.js.map +1 -0
- package/js/js/processSubjectComponent.function.d.ts +8 -0
- package/js/js/processSubjectComponent.function.js +53 -0
- package/js/js/processSubjectComponent.function.js.map +1 -0
- package/js/js/processSubjectValue.function.d.ts +16 -0
- package/js/js/processSubjectValue.function.js +122 -0
- package/js/js/processSubjectValue.function.js.map +1 -0
- package/js/js/processTagArray.d.ts +9 -0
- package/js/js/processTagArray.js +60 -0
- package/js/js/processTagArray.js.map +1 -0
- package/js/js/processTagResult.function.d.ts +10 -0
- package/js/js/processTagResult.function.js +42 -0
- package/js/js/processTagResult.function.js.map +1 -0
- package/js/js/providers.d.ts +17 -0
- package/js/js/providers.js +86 -0
- package/js/js/providers.js.map +1 -0
- package/js/js/redrawTag.function.d.ts +7 -0
- package/js/js/redrawTag.function.js +9 -0
- package/js/js/redrawTag.function.js.map +1 -0
- package/js/js/render.d.ts +1 -0
- package/js/js/render.js +24 -0
- package/js/js/render.js.map +1 -0
- package/js/js/renderAppToElement.d.ts +14 -0
- package/js/js/renderAppToElement.js +57 -0
- package/js/js/renderAppToElement.js.map +1 -0
- package/js/js/setUse.function.d.ts +23 -0
- package/js/js/setUse.function.js +14 -0
- package/js/js/setUse.function.js.map +1 -0
- package/js/js/state.d.ts +24 -0
- package/js/js/state.js +98 -0
- package/js/js/state.js.map +1 -0
- package/js/js/tag.d.ts +8 -0
- package/js/js/tag.js +46 -0
- package/js/js/tag.js.map +1 -0
- package/js/js/tagElement.d.ts +14 -0
- package/js/js/tagElement.js +57 -0
- package/js/js/tagElement.js.map +1 -0
- package/js/js/tagGateway.function.d.ts +5 -0
- package/js/js/tagGateway.function.js +119 -0
- package/js/js/tagGateway.function.js.map +1 -0
- package/js/js/tagRunner.d.ts +6 -0
- package/js/js/tagRunner.js +19 -0
- package/js/js/tagRunner.js.map +1 -0
- package/js/js/templater.utils.d.ts +28 -0
- package/js/js/templater.utils.js +99 -0
- package/js/js/templater.utils.js.map +1 -0
- package/js/js/updateTag.utils.d.ts +6 -0
- package/js/js/updateTag.utils.js +84 -0
- package/js/js/updateTag.utils.js.map +1 -0
- package/js/js/wait.d.ts +1 -0
- package/js/js/wait.js +8 -0
- package/js/js/wait.js.map +1 -0
- package/js/onDestroy.d.ts +2 -0
- package/js/onDestroy.js +20 -0
- package/js/onDestroy.js.map +1 -0
- package/js/onInit.d.ts +2 -0
- package/js/onInit.js +19 -0
- package/js/onInit.js.map +1 -0
- package/js/processSubjectComponent.function.d.ts +8 -0
- package/js/processSubjectComponent.function.js +53 -0
- package/js/processSubjectComponent.function.js.map +1 -0
- package/js/processSubjectValue.function.d.ts +16 -0
- package/js/processSubjectValue.function.js +122 -0
- package/js/processSubjectValue.function.js.map +1 -0
- package/js/processTagArray.d.ts +9 -0
- package/js/processTagArray.js +60 -0
- package/js/processTagArray.js.map +1 -0
- package/js/processTagResult.function.d.ts +10 -0
- package/js/processTagResult.function.js +39 -0
- package/js/processTagResult.function.js.map +1 -0
- package/js/providers.d.ts +17 -0
- package/js/providers.js +86 -0
- package/js/providers.js.map +1 -0
- package/js/redrawTag.function.d.ts +7 -0
- package/js/redrawTag.function.js +8 -0
- package/js/redrawTag.function.js.map +1 -0
- package/js/render.d.ts +1 -0
- package/js/render.js +17 -0
- package/js/render.js.map +1 -0
- package/js/renderAppToElement.d.ts +14 -0
- package/js/renderAppToElement.js +57 -0
- package/js/renderAppToElement.js.map +1 -0
- package/js/setUse.function.d.ts +23 -0
- package/js/setUse.function.js +14 -0
- package/js/setUse.function.js.map +1 -0
- package/js/state.d.ts +24 -0
- package/js/state.js +98 -0
- package/js/state.js.map +1 -0
- package/js/tag.d.ts +7 -0
- package/js/tag.js +46 -0
- package/js/tag.js.map +1 -0
- package/js/tagElement.d.ts +14 -0
- package/js/tagElement.js +57 -0
- package/js/tagElement.js.map +1 -0
- package/js/tagGateway.function.d.ts +14 -0
- package/js/tagGateway.function.js +138 -0
- package/js/tagGateway.function.js.map +1 -0
- package/js/tagRunner.d.ts +6 -0
- package/js/tagRunner.js +19 -0
- package/js/tagRunner.js.map +1 -0
- package/js/templater.utils.d.ts +27 -0
- package/js/templater.utils.js +98 -0
- package/js/templater.utils.js.map +1 -0
- package/js/updateTag.utils.d.ts +6 -0
- package/js/updateTag.utils.js +102 -0
- package/js/updateTag.utils.js.map +1 -0
- package/js/wait.d.ts +1 -0
- package/js/wait.js +8 -0
- package/js/wait.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type Provider = {
|
|
2
|
+
constructMethod: any;
|
|
3
|
+
instance: any;
|
|
4
|
+
clone: any;
|
|
5
|
+
};
|
|
6
|
+
type functionProvider = <T>() => T;
|
|
7
|
+
type classProvider = new <T>(...args: any[]) => T;
|
|
8
|
+
export declare const providers: {
|
|
9
|
+
create: <T>(constructMethod: classProvider | functionProvider) => T;
|
|
10
|
+
/**
|
|
11
|
+
* @template T
|
|
12
|
+
* @param {(new (...args: any[]) => T) | () => T} constructor
|
|
13
|
+
* @returns {T}
|
|
14
|
+
*/
|
|
15
|
+
inject: (constructor: any) => any;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
package/js/providers.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { deepClone } from "./deepFunctions.js";
|
|
2
|
+
import { setUse } from "./setUse.function.js";
|
|
3
|
+
// TODO: rename
|
|
4
|
+
setUse.memory.providerConfig = {
|
|
5
|
+
providers: [],
|
|
6
|
+
currentTagSupport: undefined,
|
|
7
|
+
ownerTag: undefined,
|
|
8
|
+
};
|
|
9
|
+
function get(constructMethod) {
|
|
10
|
+
const config = setUse.memory.providerConfig;
|
|
11
|
+
const providers = config.providers;
|
|
12
|
+
return providers.find(provider => provider.constructMethod === constructMethod);
|
|
13
|
+
}
|
|
14
|
+
export const providers = {
|
|
15
|
+
create: (constructMethod) => {
|
|
16
|
+
const existing = get(constructMethod);
|
|
17
|
+
if (existing) {
|
|
18
|
+
existing.clone = deepClone(existing.instance);
|
|
19
|
+
return existing.instance;
|
|
20
|
+
}
|
|
21
|
+
// Providers with provider requirements just need to use providers.create() and providers.inject()
|
|
22
|
+
const instance = constructMethod.constructor ? new constructMethod() : constructMethod();
|
|
23
|
+
const config = setUse.memory.providerConfig;
|
|
24
|
+
config.providers.push({
|
|
25
|
+
constructMethod,
|
|
26
|
+
instance,
|
|
27
|
+
clone: deepClone(instance)
|
|
28
|
+
});
|
|
29
|
+
return instance;
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* @template T
|
|
33
|
+
* @param {(new (...args: any[]) => T) | () => T} constructor
|
|
34
|
+
* @returns {T}
|
|
35
|
+
*/
|
|
36
|
+
inject: (constructor) => {
|
|
37
|
+
const oldValue = get(constructor);
|
|
38
|
+
if (oldValue) {
|
|
39
|
+
return oldValue.instance;
|
|
40
|
+
}
|
|
41
|
+
const config = setUse.memory.providerConfig;
|
|
42
|
+
let owner = {
|
|
43
|
+
ownerTag: config.ownerTag
|
|
44
|
+
};
|
|
45
|
+
while (owner.ownerTag) {
|
|
46
|
+
const ownerProviders = owner.ownerTag.tagSupport.memory.providers;
|
|
47
|
+
const provider = ownerProviders.find(provider => {
|
|
48
|
+
if (provider.constructMethod === constructor) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
if (provider) {
|
|
53
|
+
provider.clone = deepClone(provider.instance); // keep a copy of the latest before any change occur
|
|
54
|
+
config.providers.push(provider);
|
|
55
|
+
return provider.instance;
|
|
56
|
+
}
|
|
57
|
+
owner = owner.ownerTag; // cause reloop
|
|
58
|
+
}
|
|
59
|
+
const msg = `Could not inject provider: ${constructor.name} ${constructor}`;
|
|
60
|
+
console.warn(`${msg}. Available providers`, config.providers);
|
|
61
|
+
throw new Error(msg);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
setUse({
|
|
65
|
+
beforeRender: (tagSupport, ownerTag) => {
|
|
66
|
+
run(tagSupport, ownerTag);
|
|
67
|
+
},
|
|
68
|
+
beforeRedraw: (tagSupport, tag) => {
|
|
69
|
+
run(tagSupport, tag.ownerTag);
|
|
70
|
+
},
|
|
71
|
+
afterRender: (tagSupport) => {
|
|
72
|
+
const config = setUse.memory.providerConfig;
|
|
73
|
+
tagSupport.memory.providers = [...config.providers];
|
|
74
|
+
config.providers.length = 0;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
function run(tagSupport, ownerTag) {
|
|
78
|
+
const config = setUse.memory.providerConfig;
|
|
79
|
+
config.currentTagSuport = tagSupport;
|
|
80
|
+
config.ownerTag = ownerTag;
|
|
81
|
+
if (tagSupport.memory.providers.length) {
|
|
82
|
+
config.providers.length = 0;
|
|
83
|
+
config.providers.push(...tagSupport.memory.providers);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../ts/providers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAQ7C,eAAe;AACf,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG;IAC7B,SAAS,EAAE,EAAgB;IAE3B,iBAAiB,EAAE,SAAmC;IACtD,QAAQ,EAAE,SAA4B;CACvC,CAAA;AAED,SAAS,GAAG,CAAC,eAAyB;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAA;IAC3C,MAAM,SAAS,GAAe,MAAM,CAAC,SAAS,CAAA;IAC9C,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,eAAe,KAAK,eAAe,CAAC,CAAA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AC,cAAc,CAAA;IAC3C,MAAM,CAAC,gBAAgB,GAAG,UAAU,CAAA;IAEpC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,IAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAA;QAC3B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TemplaterResult } from "./templater.utils.js";
|
|
2
|
+
import { Tag } from "./Tag.class.js";
|
|
3
|
+
export declare function redrawTag(existingTag: Tag | undefined, templater: TemplaterResult, // latest tag function to call for rendering
|
|
4
|
+
ownerTag?: Tag): {
|
|
5
|
+
remit: boolean;
|
|
6
|
+
retag: Tag;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getTagSupport } from "./getTagSupport.js";
|
|
2
|
+
export function redrawTag(existingTag, templater, // latest tag function to call for rendering
|
|
3
|
+
ownerTag) {
|
|
4
|
+
const tagSupport = existingTag?.tagSupport || getTagSupport(templater);
|
|
5
|
+
const result = templater.renderWithSupport(tagSupport, existingTag, ownerTag);
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=redrawTag.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redrawTag.function.js","sourceRoot":"","sources":["../ts/redrawTag.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIlD,MAAM,UAAU,SAAS,CACvB,WAA4B,EAC5B,SAA0B,EAAE,4CAA4C;AACxE,QAAc;IAEd,MAAM,UAAU,GAAG,WAAW,EAAE,UAAU,IAAI,aAAa,CAAC,SAAS,CAAC,CAAA;IAEtE,MAAM,MAAM,GAAG,SAAS,CAAC,iBAAiB,CACxC,UAAU,EACV,WAAW,EACX,QAAQ,CACT,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/js/render.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildClones(temporary: Element, insertBefore: Element): ChildNode[];
|
package/js/render.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function buildClones(temporary, insertBefore) {
|
|
2
|
+
const clones = [];
|
|
3
|
+
const template = temporary.children[0];
|
|
4
|
+
let nextSibling = template.content.firstChild;
|
|
5
|
+
while (nextSibling) {
|
|
6
|
+
const nextNextSibling = nextSibling.nextSibling;
|
|
7
|
+
buildSibling(nextSibling, insertBefore);
|
|
8
|
+
clones.push(nextSibling);
|
|
9
|
+
nextSibling = nextNextSibling;
|
|
10
|
+
}
|
|
11
|
+
return clones;
|
|
12
|
+
}
|
|
13
|
+
function buildSibling(nextSibling, insertBefore) {
|
|
14
|
+
const parentNode = insertBefore.parentNode;
|
|
15
|
+
parentNode.insertBefore(nextSibling, insertBefore);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=render.js.map
|
package/js/render.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../ts/render.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CACzB,SAAkB,EAClB,YAAqB;IAErB,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAwB,CAAA;IAC7D,IAAI,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;IAE7C,OAAO,WAAW,EAAE,CAAC;QACnB,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAA;QAC/C,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;QACvC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACxB,WAAW,GAAG,eAAe,CAAA;IAC/B,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,YAAY,CACnB,WAAsB,EACtB,YAAqB;IAErB,MAAM,UAAU,GAAG,YAAY,CAAC,UAAwB,CAAA;IACxD,UAAU,CAAC,YAAY,CACrB,WAAW,EACX,YAAY,CACb,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TagSupport } from "./getTagSupport.js";
|
|
2
|
+
import { TagComponent, TemplaterResult } from "./templater.utils.js";
|
|
3
|
+
import { Tag } from "./Tag.class.js";
|
|
4
|
+
export declare function renderAppToElement(app: TagComponent, // (...args: unknown[]) => TemplaterResult,
|
|
5
|
+
element: Element, props: unknown): {
|
|
6
|
+
tag: Tag;
|
|
7
|
+
tags: TagComponent[];
|
|
8
|
+
};
|
|
9
|
+
export declare function applyTagUpdater(wrapper: TemplaterResult): {
|
|
10
|
+
tag: Tag;
|
|
11
|
+
tagSupport: TagSupport;
|
|
12
|
+
};
|
|
13
|
+
/** Overwrites arguments.tagSupport.mutatingRender */
|
|
14
|
+
export declare function addAppTagRender(tagSupport: TagSupport, tag: Tag): void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { runBeforeRender } from "./tagRunner.js";
|
|
2
|
+
const appElements = [];
|
|
3
|
+
export function renderAppToElement(app, // (...args: unknown[]) => TemplaterResult,
|
|
4
|
+
element, props) {
|
|
5
|
+
const appElmIndex = appElements.findIndex(appElm => appElm.element === element);
|
|
6
|
+
if (appElmIndex >= 0) {
|
|
7
|
+
appElements[appElmIndex].tag.destroy();
|
|
8
|
+
appElements.splice(appElmIndex, 1);
|
|
9
|
+
console.warn('Found and destroyed app element already rendered to element', { element });
|
|
10
|
+
}
|
|
11
|
+
// Create the app which returns [props, runOneTimeFunction]
|
|
12
|
+
const wrapper = app(props);
|
|
13
|
+
// have a function setup and call the tagWrapper with (props, {update, async, on})
|
|
14
|
+
const result = applyTagUpdater(wrapper);
|
|
15
|
+
const { tag, tagSupport } = result;
|
|
16
|
+
tag.appElement = element;
|
|
17
|
+
addAppTagRender(tagSupport, tag);
|
|
18
|
+
// const context = tag.updateValues(tag.values)
|
|
19
|
+
const templateElm = document.createElement('template');
|
|
20
|
+
templateElm.setAttribute('tag-detail', 'app-template-placeholder');
|
|
21
|
+
element.appendChild(templateElm);
|
|
22
|
+
tag.buildBeforeElement(templateElm);
|
|
23
|
+
element.setUse = app.original.setUse;
|
|
24
|
+
appElements.push({ element, tag });
|
|
25
|
+
return { tag, tags: app.original.tags };
|
|
26
|
+
}
|
|
27
|
+
export function applyTagUpdater(wrapper) {
|
|
28
|
+
const tagSupport = wrapper.tagSupport; // getTagSupport(0, wrapper)
|
|
29
|
+
runBeforeRender(tagSupport, undefined);
|
|
30
|
+
// Call the apps function for our tag templater
|
|
31
|
+
// const templater = tagSupport.templater as TemplaterResult
|
|
32
|
+
const tag = wrapper.wrapper(); // templater.wrapper()
|
|
33
|
+
tag.tagSupport = tagSupport;
|
|
34
|
+
tag.afterRender();
|
|
35
|
+
return { tag, tagSupport };
|
|
36
|
+
}
|
|
37
|
+
/** Overwrites arguments.tagSupport.mutatingRender */
|
|
38
|
+
export function addAppTagRender(tagSupport, tag) {
|
|
39
|
+
let lastTag;
|
|
40
|
+
tagSupport.mutatingRender = () => {
|
|
41
|
+
tag.beforeRedraw();
|
|
42
|
+
const templater = tagSupport.templater; // wrapper
|
|
43
|
+
const fromTag = lastTag = templater.wrapper();
|
|
44
|
+
// tagSupport.props = fromTag.tagSupport.props
|
|
45
|
+
tagSupport.latestProps = fromTag.tagSupport.props;
|
|
46
|
+
tagSupport.latestClonedProps = fromTag.tagSupport.clonedProps;
|
|
47
|
+
fromTag.setSupport(tagSupport);
|
|
48
|
+
tag.afterRender();
|
|
49
|
+
tag.updateByTag(fromTag);
|
|
50
|
+
if (lastTag) {
|
|
51
|
+
lastTag.destroy({ stagger: 0 });
|
|
52
|
+
}
|
|
53
|
+
tagSupport.newest = fromTag;
|
|
54
|
+
return lastTag;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=renderAppToElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderAppToElement.js","sourceRoot":"","sources":["../ts/renderAppToElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,MAAM,WAAW,GAAmC,EAAE,CAAA;AAEtD,MAAM,UAAU,kBAAkB,CAChC,GAAiB,EAAE,2CAA2C;AAC9D,OAAgB,EAChB,KAAc;IAEd,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,CAAA;IAC/E,IAAG,WAAW,IAAI,CAAC,EAAE,CAAC;QACpB,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QACtC,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QAClC,OAAO,CAAC,IAAI,CAAC,6DAA6D,EAAE,EAAC,OAAO,EAAC,CAAC,CAAA;IACxF,CAAC;IAED,2DAA2D;IAC3D,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAA+B,CAAA;IAExD,kFAAkF;IAClF,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IACvC,MAAM,EAAC,GAAG,EAAE,UAAU,EAAC,GAAG,MAAM,CAAA;IAEhC,GAAG,CAAC,UAAU,GAAG,OAAO,CAAA;IAExB,eAAe,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAEhC,+CAA+C;IAE/C,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IACtD,WAAW,CAAC,YAAY,CAAC,YAAY,EAAC,0BAA0B,CAAC,CAAA;IACjE,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,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AG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAExB,IAAG,OAAO,EAAE,CAAC;YACX,OAAO,CAAC,OAAO,CAAC,EAAC,OAAO,EAAE,CAAC,EAAC,CAAC,CAAA;QAC/B,CAAC;QAED,UAAU,CAAC,MAAM,GAAG,OAAO,CAAA;QAE3B,OAAO,OAAO,CAAA;IAChB,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tag } from "./Tag.class.js";
|
|
2
|
+
import { TagSupport } from "./getTagSupport";
|
|
3
|
+
import { Config } from "./state";
|
|
4
|
+
interface TagUse {
|
|
5
|
+
beforeRender: (tagSupport: TagSupport, ownerTag: Tag) => void;
|
|
6
|
+
beforeRedraw: (tagSupport: TagSupport, tag: Tag) => void;
|
|
7
|
+
afterRender: (tagSupport: TagSupport, tag: Tag) => void;
|
|
8
|
+
beforeDestroy: (tagSupport: TagSupport, tag: Tag) => void;
|
|
9
|
+
}
|
|
10
|
+
export type UseOptions = {
|
|
11
|
+
beforeRender?: (tagSupport: TagSupport, ownerTag: Tag) => void;
|
|
12
|
+
beforeRedraw?: (tagSupport: TagSupport, tag: Tag) => void;
|
|
13
|
+
afterRender?: (tagSupport: TagSupport, tag: Tag) => void;
|
|
14
|
+
beforeDestroy?: (tagSupport: TagSupport, tag: Tag) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function setUse(use: UseOptions): void;
|
|
17
|
+
export declare namespace setUse {
|
|
18
|
+
var tagUse: TagUse[];
|
|
19
|
+
var memory: Record<string, any> & {
|
|
20
|
+
stateConfig: Config;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const tagUse = [];
|
|
2
|
+
export function setUse(use) {
|
|
3
|
+
// must provide defaults
|
|
4
|
+
const useMe = {
|
|
5
|
+
beforeRender: use.beforeRender || (() => undefined),
|
|
6
|
+
beforeRedraw: use.beforeRedraw || (() => undefined),
|
|
7
|
+
afterRender: use.afterRender || (() => undefined),
|
|
8
|
+
beforeDestroy: use.beforeDestroy || (() => undefined),
|
|
9
|
+
};
|
|
10
|
+
setUse.tagUse.push(useMe);
|
|
11
|
+
}
|
|
12
|
+
setUse.tagUse = tagUse;
|
|
13
|
+
setUse.memory = {};
|
|
14
|
+
//# sourceMappingURL=setUse.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setUse.function.js","sourceRoot":"","sources":["../ts/setUse.function.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,GAAa,EAAE,CAAA;AAsB3B,MAAM,UAAU,MAAM,CAAC,GAAe;IACpC,wBAAwB;IACxB,MAAM,KAAK,GAAW;QACpB,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;QACnD,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;QACnD,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;QACjD,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;KACtD,CAAA;IAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,MAAM,GAAG,EAAkD,CAAA"}
|
package/js/state.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type StateConfig = ((x?: any) => [any, any]);
|
|
2
|
+
type StateConfigItem = {
|
|
3
|
+
callback?: StateConfig;
|
|
4
|
+
lastValue?: any;
|
|
5
|
+
defaultValue?: any;
|
|
6
|
+
};
|
|
7
|
+
export type StateConfigArray = StateConfigItem[];
|
|
8
|
+
export type Config = {
|
|
9
|
+
array: StateConfigArray;
|
|
10
|
+
rearray: StateConfigArray;
|
|
11
|
+
};
|
|
12
|
+
export type State = {
|
|
13
|
+
newest: StateConfigArray;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @template T
|
|
17
|
+
* @param {T} defaultValue
|
|
18
|
+
* @returns {T}
|
|
19
|
+
*/
|
|
20
|
+
export declare function state<T>(defaultValue: T | (() => T), getSetMethod?: (x: T) => [T, T]): T;
|
|
21
|
+
export declare function getStateValue(state: StateConfigItem): any;
|
|
22
|
+
export declare class StateEchoBack {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/js/state.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { setUse } from "./setUse.function.js";
|
|
2
|
+
// TODO: rename
|
|
3
|
+
setUse.memory.stateConfig = {
|
|
4
|
+
array: [], // state memory on the first render
|
|
5
|
+
rearray: [], // state memory to be used before the next render
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @template T
|
|
9
|
+
* @param {T} defaultValue
|
|
10
|
+
* @returns {T}
|
|
11
|
+
*/
|
|
12
|
+
export function state(defaultValue, getSetMethod) {
|
|
13
|
+
const config = setUse.memory.stateConfig;
|
|
14
|
+
const restate = config.rearray[config.array.length];
|
|
15
|
+
if (restate) {
|
|
16
|
+
const oldValue = getStateValue(restate);
|
|
17
|
+
config.array.push({
|
|
18
|
+
callback: getSetMethod,
|
|
19
|
+
lastValue: oldValue,
|
|
20
|
+
defaultValue: restate.defaultValue,
|
|
21
|
+
});
|
|
22
|
+
return oldValue; // return old value instead
|
|
23
|
+
}
|
|
24
|
+
const defaultFn = defaultValue instanceof Function ? defaultValue : () => defaultValue;
|
|
25
|
+
const initValue = defaultFn();
|
|
26
|
+
config.array.push({
|
|
27
|
+
callback: getSetMethod,
|
|
28
|
+
lastValue: initValue,
|
|
29
|
+
defaultValue: initValue,
|
|
30
|
+
});
|
|
31
|
+
return initValue;
|
|
32
|
+
}
|
|
33
|
+
setUse({
|
|
34
|
+
beforeRender: (tagSupport) => initState(tagSupport),
|
|
35
|
+
beforeRedraw: (tagSupport) => initState(tagSupport),
|
|
36
|
+
afterRender: (tagSupport, tag) => {
|
|
37
|
+
const state = tagSupport.memory.state;
|
|
38
|
+
const config = setUse.memory.stateConfig;
|
|
39
|
+
if (config.rearray.length) {
|
|
40
|
+
if (config.rearray.length !== config.array.length) {
|
|
41
|
+
const message = `States lengths mismatched ${config.rearray.length} !== ${config.array.length}`;
|
|
42
|
+
console.error(message, {
|
|
43
|
+
oldStates: config.array,
|
|
44
|
+
newStates: config.rearray,
|
|
45
|
+
component: tagSupport.templater?.wrapper.original
|
|
46
|
+
});
|
|
47
|
+
throw new Error(message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// config.rearray.length = 0 // clean up any previous runs
|
|
51
|
+
config.rearray = []; // clean up any previous runs
|
|
52
|
+
// state.newest.length = 0
|
|
53
|
+
// state.newest.push(...config.array) as any
|
|
54
|
+
state.newest = [...config.array];
|
|
55
|
+
// config.array.length = 0
|
|
56
|
+
config.array = [];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export function getStateValue(
|
|
60
|
+
// state: StateConfig,
|
|
61
|
+
state) {
|
|
62
|
+
const callback = state.callback;
|
|
63
|
+
if (!callback) {
|
|
64
|
+
return state.defaultValue;
|
|
65
|
+
}
|
|
66
|
+
const oldState = callback(StateEchoBack); // get value and set to undefined
|
|
67
|
+
const [oldValue] = oldState;
|
|
68
|
+
const [checkValue] = callback(oldValue); // set back to original value
|
|
69
|
+
if (checkValue !== StateEchoBack) {
|
|
70
|
+
const error = new Error('State property not used correctly.\n\n' +
|
|
71
|
+
'For "let" state use `let name = state(default, x => [name, name = x])`\n\n' +
|
|
72
|
+
'For "const" state use `const name = state(default)`\n\n' +
|
|
73
|
+
'Problem function:\n' + state + '\n');
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
return oldValue;
|
|
77
|
+
}
|
|
78
|
+
export class StateEchoBack {
|
|
79
|
+
}
|
|
80
|
+
function initState(tagSupport) {
|
|
81
|
+
const state = tagSupport.memory.state;
|
|
82
|
+
const config = setUse.memory.stateConfig;
|
|
83
|
+
if (config.rearray.length) {
|
|
84
|
+
const message = 'last array not cleared';
|
|
85
|
+
console.error(message, {
|
|
86
|
+
config,
|
|
87
|
+
component: tagSupport.templater?.wrapper.original,
|
|
88
|
+
state,
|
|
89
|
+
});
|
|
90
|
+
throw message;
|
|
91
|
+
}
|
|
92
|
+
// TODO: this maybe redundant and not needed
|
|
93
|
+
config.rearray = []; // .length = 0
|
|
94
|
+
if (state?.newest.length) {
|
|
95
|
+
config.rearray.push(...state.newest);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=state.js.map
|
package/js/state.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../ts/state.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAuB7C,eAAe;AACf,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG;IAC1B,KAAK,EAAE,EAAsB,EAAE,mCAAmC;IAClE,OAAO,EAAE,EAAsB,EAAE,iDAAiD;CACzE,CAAA;AAEX;;;;GAIG;AACH,MAAM,UAAU,KAAK,CACnB,YAA2B,EAC3B,YAA+B;IAE/B,MAAM,MAAM,GAAW,MAAM,CAAC,MAAM,CAAC,WAAW,CAAA;IAEhD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACnD,IAAG,OAAO,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;YAChB,QAAQ,EAAE,YAA2B;YACrC,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,OAAO,CAAC,YAAY;SACnC,CAAC,CAAA;QACF,OAAO,QAAQ,C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B,MAAM;YACN,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ;YACjD,KAAK;SACN,CAAC,CAAA;QACF,MAAM,OAAO,CAAA;IACf,CAAC;IAED,4CAA4C;IAC5C,MAAM,CAAC,OAAO,GAAG,EAAE,CAAA,CAAC,cAAc;IAElC,IAAG,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAE,GAAG,KAAK,CAAC,MAAM,CAAE,CAAA;IACxC,CAAC;AACH,CAAC"}
|
package/js/tag.d.ts
ADDED
package/js/tag.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { isTagInstance } from "./isInstance.js";
|
|
2
|
+
import { setUse } from "./setUse.function.js";
|
|
3
|
+
import { TemplaterResult, getNewProps } from "./templater.utils.js";
|
|
4
|
+
export const tags = [];
|
|
5
|
+
let tagCount = 0;
|
|
6
|
+
export function tag(tagComponent) {
|
|
7
|
+
const result = (function tagWrapper(props, children) {
|
|
8
|
+
const isPropTag = isTagInstance(props);
|
|
9
|
+
const templater = new TemplaterResult(props);
|
|
10
|
+
const newProps = getNewProps(props, templater);
|
|
11
|
+
let argProps = newProps;
|
|
12
|
+
if (isPropTag) {
|
|
13
|
+
children = props;
|
|
14
|
+
argProps = noPropsGiven;
|
|
15
|
+
}
|
|
16
|
+
function innerTagWrap() {
|
|
17
|
+
const originalFunction = innerTagWrap.original;
|
|
18
|
+
const props = templater.tagSupport.props; // argProps
|
|
19
|
+
const tag = originalFunction(props, children);
|
|
20
|
+
tag.setSupport(templater.tagSupport);
|
|
21
|
+
return tag;
|
|
22
|
+
}
|
|
23
|
+
innerTagWrap.original = tagComponent;
|
|
24
|
+
templater.tagged = true;
|
|
25
|
+
templater.wrapper = innerTagWrap;
|
|
26
|
+
return templater;
|
|
27
|
+
}); // we override the function provided and pretend original is what's returned
|
|
28
|
+
updateResult(result, tagComponent);
|
|
29
|
+
// group tags together and have hmr pickup
|
|
30
|
+
updateComponent(tagComponent);
|
|
31
|
+
tags.push(tagComponent);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
function updateResult(result, tagComponent) {
|
|
35
|
+
result.isTag = true;
|
|
36
|
+
result.original = tagComponent;
|
|
37
|
+
}
|
|
38
|
+
function updateComponent(tagComponent) {
|
|
39
|
+
tagComponent.tags = tags;
|
|
40
|
+
tagComponent.setUse = setUse;
|
|
41
|
+
tagComponent.tagIndex = ++tagCount;
|
|
42
|
+
}
|
|
43
|
+
class NoPropsGiven {
|
|
44
|
+
}
|
|
45
|
+
const noPropsGiven = new NoPropsGiven();
|
|
46
|
+
//# sourceMappingURL=tag.js.map
|
package/js/tag.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../ts/tag.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,OAAO,EAAgB,eAAe,EAAW,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAE1F,MAAM,CAAC,MAAM,IAAI,GAAmB,EAAE,CAAA;AAEtC,IAAI,QAAQ,GAAG,CAAC,CAAA;AAWhB,MAAM,UAAU,GAAG,CACjB,YAA8B;IAE9B,MAAM,MAAM,GAAG,CAAC,SAAS,UAAU,CACjC,KAA8B,EAC9B,QAAc;QAEd,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;QACtC,MAAM,SAAS,GAAoB,IAAI,eAAe,CAAC,KAAK,CAAC,CAAA;QAC7D,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QAE9C,IAAI,QAAQ,GAAG,QAAQ,CAAA;QACvB,IAAG,SAAS,EAAE,CAAC;YACb,QAAQ,GAAG,KAAY,CAAA;YACvB,QAAQ,GAAG,YAAY,CAAA;QACzB,CAAC;QAED,SAAS,YAAY;YACnB,MAAM,gBAAgB,GAAG,YAAY,CAAC,QAAwB,CAAA;YAC9D,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAA,CAAC,WAAW;YACpD,MAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;YAC7C,GAAG,CAAC,UAAU,CAAE,SAAS,CAAC,UAAU,CAAE,CAAA;YACtC,OAAO,GAAG,CAAA;QACZ,CAAC;QAED,YAAY,CAAC,QAAQ,GAAG,YAAY,CAAA;QAGpC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAA;QACvB,SAAS,CAAC,OAAO,GAAG,YAAuB,CAAA;QAE3C,OAAO,SAAS,CAAA;IAClB,CAAC,CAAM,CAAA,CAAC,4EAA4E;IAEpF,YAAY,CAAC,MAAM,EAAE,YAA4B,CAAC,CAAA;IAElD,0CAA0C;IAC1C,eAAe,CAAC,YAAY,CAAC,CAAA;IAC7B,IAAI,CAAC,IAAI,CAAC,YAA4B,CAAC,CAAA;IAEvC,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,YAAY,CACnB,MAAW,EACX,YAA0B;IAE1B,MAAM,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,MAAM,CAAC,QAAQ,GAAG,YAAY,CAAA;AAChC,CAAC;AAED,SAAS,eAAe,CACtB,YAAiB;IAEjB,YAAY,CAAC,IAAI,GAAG,IAAI,CAAA;IACxB,YAAY,CAAC,MAAM,GAAG,MAAM,CAAA;IAC5B,YAAY,CAAC,QAAQ,GAAG,EAAE,QAAQ,CAAA;AACpC,CAAC;AACD,MAAM,YAAY;CAAG;AACrB,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TagSupport } from "./getTagSupport.js";
|
|
2
|
+
import { TagComponent, TemplaterResult } from "./templater.utils.js";
|
|
3
|
+
import { Tag } from "./Tag.class.js";
|
|
4
|
+
export declare function tagElement(app: TagComponent, // (...args: unknown[]) => TemplaterResult,
|
|
5
|
+
element: HTMLElement | Element, props: unknown): {
|
|
6
|
+
tag: Tag;
|
|
7
|
+
tags: TagComponent[];
|
|
8
|
+
};
|
|
9
|
+
export declare function applyTagUpdater(wrapper: TemplaterResult): {
|
|
10
|
+
tag: Tag;
|
|
11
|
+
tagSupport: TagSupport;
|
|
12
|
+
};
|
|
13
|
+
/** Overwrites arguments.tagSupport.mutatingRender */
|
|
14
|
+
export declare function addAppTagRender(tagSupport: TagSupport, tag: Tag): void;
|
package/js/tagElement.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { runBeforeRender } from "./tagRunner.js";
|
|
2
|
+
const appElements = [];
|
|
3
|
+
export function tagElement(app, // (...args: unknown[]) => TemplaterResult,
|
|
4
|
+
element, props) {
|
|
5
|
+
const appElmIndex = appElements.findIndex(appElm => appElm.element === element);
|
|
6
|
+
if (appElmIndex >= 0) {
|
|
7
|
+
appElements[appElmIndex].tag.destroy();
|
|
8
|
+
appElements.splice(appElmIndex, 1);
|
|
9
|
+
console.warn('Found and destroyed app element already rendered to element', { element });
|
|
10
|
+
}
|
|
11
|
+
// Create the app which returns [props, runOneTimeFunction]
|
|
12
|
+
const wrapper = app(props);
|
|
13
|
+
// have a function setup and call the tagWrapper with (props, {update, async, on})
|
|
14
|
+
const result = applyTagUpdater(wrapper);
|
|
15
|
+
const { tag, tagSupport } = result;
|
|
16
|
+
tag.appElement = element;
|
|
17
|
+
addAppTagRender(tagSupport, tag);
|
|
18
|
+
// const context = tag.updateValues(tag.values)
|
|
19
|
+
const templateElm = document.createElement('template');
|
|
20
|
+
templateElm.setAttribute('tag-detail', 'app-template-placeholder');
|
|
21
|
+
element.appendChild(templateElm);
|
|
22
|
+
tag.buildBeforeElement(templateElm);
|
|
23
|
+
element.setUse = app.original.setUse;
|
|
24
|
+
appElements.push({ element, tag });
|
|
25
|
+
return { tag, tags: app.original.tags };
|
|
26
|
+
}
|
|
27
|
+
export function applyTagUpdater(wrapper) {
|
|
28
|
+
const tagSupport = wrapper.tagSupport; // getTagSupport(0, wrapper)
|
|
29
|
+
runBeforeRender(tagSupport, undefined);
|
|
30
|
+
// Call the apps function for our tag templater
|
|
31
|
+
// const templater = tagSupport.templater as TemplaterResult
|
|
32
|
+
const tag = wrapper.wrapper(); // templater.wrapper()
|
|
33
|
+
tag.tagSupport = tagSupport;
|
|
34
|
+
tag.afterRender();
|
|
35
|
+
return { tag, tagSupport };
|
|
36
|
+
}
|
|
37
|
+
/** Overwrites arguments.tagSupport.mutatingRender */
|
|
38
|
+
export function addAppTagRender(tagSupport, tag) {
|
|
39
|
+
let lastTag;
|
|
40
|
+
tagSupport.mutatingRender = () => {
|
|
41
|
+
tag.beforeRedraw();
|
|
42
|
+
const templater = tagSupport.templater; // wrapper
|
|
43
|
+
const fromTag = lastTag = templater.wrapper();
|
|
44
|
+
// tagSupport.props = fromTag.tagSupport.props
|
|
45
|
+
tagSupport.latestProps = fromTag.tagSupport.props;
|
|
46
|
+
tagSupport.latestClonedProps = fromTag.tagSupport.clonedProps;
|
|
47
|
+
fromTag.setSupport(tagSupport);
|
|
48
|
+
tag.afterRender();
|
|
49
|
+
tag.updateByTag(fromTag);
|
|
50
|
+
if (lastTag) {
|
|
51
|
+
lastTag.destroy({ stagger: 0 });
|
|
52
|
+
}
|
|
53
|
+
tagSupport.newest = fromTag;
|
|
54
|
+
return lastTag;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=tagElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tagElement.js","sourceRoot":"","sources":["../ts/tagElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,MAAM,WAAW,GAAmC,EAAE,CAAA;AAEtD,MAAM,UAAU,UAAU,CACxB,GAAiB,EAAE,2CAA2C;AAC9D,OAA8B,EAC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eventData: EventData) => void;
|
|
4
|
+
export type GatewayProps = Props & {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
dispatchEvent: dispatchEvent;
|
|
7
|
+
};
|
|
8
|
+
export declare function checkGateways(): void;
|
|
9
|
+
export declare const tagGateway: (component: TagComponent) => {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
export type EventData = {
|
|
13
|
+
detail: Record<string, any>;
|
|
14
|
+
};
|