@tempots/dom 5.0.0 → 5.0.2
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/README.md +1 -0
- package/clean.d.ts +2 -0
- package/clean.js +1 -0
- package/components/Attribute.d.ts +15 -0
- package/components/Attribute.js +16 -0
- package/components/BooleanAttribute.d.ts +15 -0
- package/components/BooleanAttribute.js +16 -0
- package/components/ClassName.d.ts +13 -0
- package/components/ClassName.js +14 -0
- package/components/El.d.ts +15 -0
- package/components/El.js +21 -0
- package/components/FadeIn.d.ts +18 -0
- package/components/FadeIn.js +52 -0
- package/components/FadeOut.d.ts +16 -0
- package/components/FadeOut.js +39 -0
- package/components/For.d.ts +7 -0
- package/components/For.js +15 -0
- package/components/Fragment.d.ts +12 -0
- package/components/Fragment.js +16 -0
- package/components/HiddenWhenEmpty.d.ts +7 -0
- package/components/HiddenWhenEmpty.js +12 -0
- package/components/If.d.ts +14 -0
- package/components/If.js +19 -0
- package/components/InnerHTML.d.ts +13 -0
- package/components/InnerHTML.js +23 -0
- package/components/Lifecycle.d.ts +14 -0
- package/components/Lifecycle.js +18 -0
- package/components/Match.d.ts +33 -0
- package/components/Match.js +44 -0
- package/components/NotEmpty.d.ts +10 -0
- package/components/NotEmpty.js +11 -0
- package/components/On.d.ts +15 -0
- package/components/On.js +14 -0
- package/components/OnRemove.d.ts +11 -0
- package/components/OnRemove.js +14 -0
- package/components/OneOf.d.ts +20 -0
- package/components/OneOf.js +45 -0
- package/components/Portal.d.ts +15 -0
- package/components/Portal.js +20 -0
- package/components/Property.d.ts +15 -0
- package/components/Property.js +16 -0
- package/components/Provider.d.ts +28 -0
- package/components/Provider.js +44 -0
- package/components/Repeat.d.ts +15 -0
- package/components/Repeat.js +33 -0
- package/components/Shadow.d.ts +0 -0
- package/components/Shadow.js +1 -0
- package/components/Show.d.ts +20 -0
- package/components/Show.js +22 -0
- package/components/Text.d.ts +15 -0
- package/components/Text.js +33 -0
- package/components/TextContent.d.ts +13 -0
- package/components/TextContent.js +23 -0
- package/components/Tween.d.ts +75 -0
- package/components/Tween.js +242 -0
- package/components/animatable.d.ts +53 -0
- package/components/animatable.js +156 -0
- package/dom-context.d.ts +38 -0
- package/dom-context.js +260 -0
- package/helpers/handle-anchor-click.d.ts +4 -0
- package/helpers/handle-anchor-click.js +43 -0
- package/helpers/handle-text-input.d.ts +1 -0
- package/helpers/handle-text-input.js +4 -0
- package/helpers/is-empty-element.d.ts +2 -0
- package/helpers/is-empty-element.js +8 -0
- package/index.d.ts +36 -0
- package/jsx-dev-runtime.d.ts +1 -0
- package/jsx-dev-runtime.js +1 -0
- package/jsx-runtime.d.ts +9 -0
- package/jsx-runtime.js +157 -0
- package/jsx.d.ts +806 -0
- package/jsx.js +1 -0
- package/package.json +5 -3
- package/prop.d.ts +43 -0
- package/prop.js +174 -0
- package/render.d.ts +3 -0
- package/render.js +7 -0
- package/renderable.d.ts +5 -0
- package/renderable.js +1 -0
- package/types/clean.d.ts +2 -0
- package/types/clean.js +1 -0
- package/types/idom-context.d.ts +27 -0
- package/types/idom-context.js +3 -0
- package/types/renderable.d.ts +5 -0
- package/types/renderable.js +1 -0
- package/.eslintignore +0 -10
- package/.eslintrc.cjs +0 -28
- package/coverage/clover.xml +0 -39
- package/coverage/coverage-final.json +0 -2
- package/coverage/lcov-report/OneOf.ts.html +0 -256
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/dom-context.ts.html +0 -928
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -116
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/prop.ts.html +0 -691
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/components/Attribute.ts.html +0 -154
- package/coverage/lcov-report/src/components/BooleanAttribute.ts.html +0 -154
- package/coverage/lcov-report/src/components/ClassName.ts.html +0 -151
- package/coverage/lcov-report/src/components/El.ts.html +0 -166
- package/coverage/lcov-report/src/components/FadeIn.ts.html +0 -262
- package/coverage/lcov-report/src/components/FadeOut.ts.html +0 -226
- package/coverage/lcov-report/src/components/For.ts.html +0 -151
- package/coverage/lcov-report/src/components/Fragment.ts.html +0 -142
- package/coverage/lcov-report/src/components/HiddenWhenEmpty.ts.html +0 -133
- package/coverage/lcov-report/src/components/If.ts.html +0 -217
- package/coverage/lcov-report/src/components/InnerHTML.ts.html +0 -178
- package/coverage/lcov-report/src/components/Lifecycle.ts.html +0 -157
- package/coverage/lcov-report/src/components/Match.ts.html +0 -286
- package/coverage/lcov-report/src/components/NotEmpty.tsx.html +0 -184
- package/coverage/lcov-report/src/components/On.ts.html +0 -151
- package/coverage/lcov-report/src/components/OnRemove.ts.html +0 -145
- package/coverage/lcov-report/src/components/OneOf.ts.html +0 -256
- package/coverage/lcov-report/src/components/Portal.ts.html +0 -175
- package/coverage/lcov-report/src/components/Property.ts.html +0 -154
- package/coverage/lcov-report/src/components/Provider.ts.html +0 -244
- package/coverage/lcov-report/src/components/Repeat.ts.html +0 -223
- package/coverage/lcov-report/src/components/Show.tsx.html +0 -190
- package/coverage/lcov-report/src/components/Text.ts.html +0 -229
- package/coverage/lcov-report/src/components/TextContent.ts.html +0 -178
- package/coverage/lcov-report/src/components/Tween.tsx.html +0 -943
- package/coverage/lcov-report/src/components/animatable.ts.html +0 -619
- package/coverage/lcov-report/src/components/index.html +0 -476
- package/coverage/lcov-report/src/dom-context.ts.html +0 -928
- package/coverage/lcov-report/src/helpers/handle-anchor-click.ts.html +0 -277
- package/coverage/lcov-report/src/helpers/handle-text-input.ts.html +0 -100
- package/coverage/lcov-report/src/helpers/index.html +0 -146
- package/coverage/lcov-report/src/helpers/is-empty-element.ts.html +0 -112
- package/coverage/lcov-report/src/index.html +0 -176
- package/coverage/lcov-report/src/index.ts.html +0 -412
- package/coverage/lcov-report/src/jsx-runtime.ts.html +0 -601
- package/coverage/lcov-report/src/prop.ts.html +0 -691
- package/coverage/lcov-report/src/render.ts.html +0 -112
- package/coverage/lcov-report/src/types/idom-context.ts.html +0 -184
- package/coverage/lcov-report/src/types/index.html +0 -116
- package/coverage/lcov-report/test/common.ts.html +0 -112
- package/coverage/lcov-report/test/index.html +0 -116
- package/coverage/lcov.info +0 -57
- package/jest.config.js +0 -5
- package/src/clean.ts +0 -2
- package/src/components/Attribute.ts +0 -23
- package/src/components/BooleanAttribute.ts +0 -23
- package/src/components/ClassName.ts +0 -22
- package/src/components/El.ts +0 -27
- package/src/components/FadeIn.ts +0 -59
- package/src/components/FadeOut.ts +0 -47
- package/src/components/For.ts +0 -22
- package/src/components/Fragment.ts +0 -19
- package/src/components/HiddenWhenEmpty.ts +0 -16
- package/src/components/If.ts +0 -44
- package/src/components/InnerHTML.ts +0 -31
- package/src/components/Lifecycle.ts +0 -24
- package/src/components/Match.ts +0 -67
- package/src/components/NotEmpty.tsx +0 -33
- package/src/components/On.ts +0 -22
- package/src/components/OnRemove.ts +0 -20
- package/src/components/OneOf.ts +0 -57
- package/src/components/Portal.ts +0 -30
- package/src/components/Property.ts +0 -23
- package/src/components/Provider.ts +0 -53
- package/src/components/Repeat.ts +0 -46
- package/src/components/Show.tsx +0 -35
- package/src/components/Text.ts +0 -48
- package/src/components/TextContent.ts +0 -31
- package/src/components/animatable.ts +0 -178
- package/src/dom-context.ts +0 -281
- package/src/helpers/handle-anchor-click.ts +0 -64
- package/src/helpers/handle-text-input.ts +0 -5
- package/src/helpers/is-empty-element.ts +0 -9
- package/src/index.ts +0 -109
- package/src/jsx-dev-runtime.ts +0 -8
- package/src/jsx-runtime.ts +0 -172
- package/src/jsx.ts +0 -1046
- package/src/prop.ts +0 -202
- package/src/render.ts +0 -9
- package/src/renderable.ts +0 -6
- package/test/common.ts +0 -9
- package/test/component.spec.tsx +0 -27
- package/test/domcontext.spec.ts +0 -36
- package/test/fadein.spec.tsx +0 -36
- package/test/fadeout.spec.tsx +0 -41
- package/test/if.spec.tsx +0 -30
- package/test/innerhtml.spec.tsx +0 -45
- package/test/prop.spec.ts +0 -10
- package/test/render.spec.tsx +0 -19
- package/test/textcontent.spec.tsx +0 -45
- package/test/when.spec.tsx +0 -30
- package/tsconfig.json +0 -21
- /package/{dist/index.js → index.js} +0 -0
package/jsx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/dom",
|
|
3
|
-
"version": "5.0.
|
|
4
|
-
"main": "
|
|
3
|
+
"version": "5.0.2",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"types": "index.d.ts",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"watch": "tsc --watch",
|
|
7
8
|
"build": "tsc",
|
|
8
9
|
"test": "jest",
|
|
9
10
|
"test:watch": "jest --watch",
|
|
10
11
|
"coverage": "jest --coverage",
|
|
11
|
-
"npm:
|
|
12
|
+
"npm:prep": "yarn build && cp README.md package.json dist",
|
|
13
|
+
"npm:publish": "yarn npm:prep && (cd dist && yarn publish --access public)"
|
|
12
14
|
},
|
|
13
15
|
"dependencies": {},
|
|
14
16
|
"devDependencies": {
|
package/prop.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ArgsToSignals<T extends [...unknown[]]> = T extends [] ? [] : T extends [infer U, ...infer V] ? [Signal<U>, ...ArgsToSignals<V>] : [];
|
|
2
|
+
declare const $isSignal: unique symbol;
|
|
3
|
+
declare const $isProp: unique symbol;
|
|
4
|
+
export type Value<T> = T | Signal<T>;
|
|
5
|
+
export declare class Signal<T> {
|
|
6
|
+
protected _value: T;
|
|
7
|
+
static of<T>(value: T): Signal<T>;
|
|
8
|
+
static ofValue<T>(value: Value<T> | null | undefined): Signal<T> | undefined;
|
|
9
|
+
static wrap<T>(value: T | Signal<T>): Signal<T>;
|
|
10
|
+
static isSignal<T = unknown>(x: unknown): x is Signal<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Combines many into one using a merging function
|
|
13
|
+
*/
|
|
14
|
+
static combine<Args extends [...unknown[]], Out>(others: ArgsToSignals<Args>, f: (...args: Args) => Out): Signal<Out>;
|
|
15
|
+
readonly [$isSignal] = true;
|
|
16
|
+
protected readonly _listeners: Array<(value: T) => void>;
|
|
17
|
+
constructor(_value: T);
|
|
18
|
+
readonly get: () => T;
|
|
19
|
+
readonly subscribe: (listener: (value: T) => void) => () => void;
|
|
20
|
+
readonly map: <V>(f: (value: T) => V) => Signal<V>;
|
|
21
|
+
readonly flatMap: <V>(f: (value: T) => Signal<V>) => Signal<V>;
|
|
22
|
+
readonly tap: (f: (value: T) => void) => this;
|
|
23
|
+
readonly at: <K extends keyof T>(key: K) => Signal<T[K]>;
|
|
24
|
+
readonly filter: (predicate: (value: T) => boolean) => Signal<T>;
|
|
25
|
+
readonly distinct: (equality: (a: T, b: T) => boolean) => Signal<T>;
|
|
26
|
+
readonly mapAsync: <V>(f: (value: T) => Promise<V>, alt: V) => Signal<V>;
|
|
27
|
+
readonly mapMaybe: <V>(f: (value: T) => V | null | undefined, alt: V) => Signal<V>;
|
|
28
|
+
readonly combine: <V, Z>(other: Signal<V>, f: (a: T, b: V) => Z) => Signal<Z>;
|
|
29
|
+
readonly feed: (prop: Prop<T>) => Prop<T>;
|
|
30
|
+
readonly deriveProp: () => Prop<T>;
|
|
31
|
+
readonly clean: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare class Prop<T> extends Signal<T> {
|
|
34
|
+
static isProp<T = unknown>(x: unknown): x is Prop<T>;
|
|
35
|
+
static of<T>(value: T): Prop<T>;
|
|
36
|
+
readonly [$isProp] = true;
|
|
37
|
+
readonly set: (value: T) => void;
|
|
38
|
+
readonly update: (f: (value: T) => T) => void;
|
|
39
|
+
readonly atLens: <K extends keyof T>(key: K) => Prop<T[K]>;
|
|
40
|
+
readonly reducer: <V>(f: (state: T, action: V) => T) => (action: V) => void;
|
|
41
|
+
readonly iso: <V>(map: (value: T) => V, reverse: (value: V) => T) => Prop<V>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
package/prop.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
const $isSignal = Symbol('isSignal');
|
|
2
|
+
const $isProp = Symbol('isProp');
|
|
3
|
+
export class Signal {
|
|
4
|
+
_value;
|
|
5
|
+
static of(value) {
|
|
6
|
+
return new Signal(value);
|
|
7
|
+
}
|
|
8
|
+
static ofValue(value) {
|
|
9
|
+
return value == null ? undefined : Signal.wrap(value);
|
|
10
|
+
}
|
|
11
|
+
static wrap(value) {
|
|
12
|
+
return Signal.isSignal(value) ? value : new Signal(value);
|
|
13
|
+
}
|
|
14
|
+
static isSignal(x) {
|
|
15
|
+
const s = x;
|
|
16
|
+
return s != null && typeof s.get === 'function' && typeof s.subscribe === 'function';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Combines many into one using a merging function
|
|
20
|
+
*/
|
|
21
|
+
static combine(others, f) {
|
|
22
|
+
function getValues(others) {
|
|
23
|
+
return others.map(other => other.get());
|
|
24
|
+
}
|
|
25
|
+
const prop = new Prop(f(...getValues(others)));
|
|
26
|
+
others.forEach((other) => {
|
|
27
|
+
other.subscribe(() => {
|
|
28
|
+
prop.set(f(...getValues(others)));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
return prop;
|
|
32
|
+
}
|
|
33
|
+
[$isSignal] = true;
|
|
34
|
+
_listeners = [];
|
|
35
|
+
constructor(_value) {
|
|
36
|
+
this._value = _value;
|
|
37
|
+
}
|
|
38
|
+
get = () => {
|
|
39
|
+
return this._value;
|
|
40
|
+
};
|
|
41
|
+
subscribe = (listener) => {
|
|
42
|
+
this._listeners.push(listener);
|
|
43
|
+
return () => {
|
|
44
|
+
const index = this._listeners.indexOf(listener);
|
|
45
|
+
if (index >= 0) {
|
|
46
|
+
this._listeners.splice(index, 1);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
map = (f) => {
|
|
51
|
+
const prop = new Prop(f(this._value));
|
|
52
|
+
this.subscribe(value => { prop.set(f(value)); });
|
|
53
|
+
return prop;
|
|
54
|
+
};
|
|
55
|
+
flatMap = (f) => {
|
|
56
|
+
let signal = f(this._value);
|
|
57
|
+
const prop = new Prop(signal.get());
|
|
58
|
+
this.subscribe(value => {
|
|
59
|
+
signal.clean();
|
|
60
|
+
signal = f(value);
|
|
61
|
+
signal.subscribe(value => { prop.set(value); });
|
|
62
|
+
});
|
|
63
|
+
return prop;
|
|
64
|
+
};
|
|
65
|
+
tap = (f) => {
|
|
66
|
+
f(this._value);
|
|
67
|
+
this.subscribe(f);
|
|
68
|
+
return this;
|
|
69
|
+
};
|
|
70
|
+
at = (key) => {
|
|
71
|
+
return this.map(value => value[key]);
|
|
72
|
+
};
|
|
73
|
+
filter = (predicate) => {
|
|
74
|
+
const prop = new Prop(this._value);
|
|
75
|
+
this.subscribe(value => {
|
|
76
|
+
if (predicate(value)) {
|
|
77
|
+
prop.set(value);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return prop;
|
|
81
|
+
};
|
|
82
|
+
distinct = (equality) => {
|
|
83
|
+
let lastValue = this._value;
|
|
84
|
+
return this.filter(value => {
|
|
85
|
+
const result = !equality(value, lastValue);
|
|
86
|
+
lastValue = value;
|
|
87
|
+
return result;
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
mapAsync = (f, alt) => {
|
|
91
|
+
let counter = 0;
|
|
92
|
+
const prop = new Prop(alt);
|
|
93
|
+
f(this._value)
|
|
94
|
+
.then(value => {
|
|
95
|
+
if (counter === 0)
|
|
96
|
+
prop.set(value);
|
|
97
|
+
})
|
|
98
|
+
.catch(e => {
|
|
99
|
+
throw e;
|
|
100
|
+
});
|
|
101
|
+
this.subscribe(value => {
|
|
102
|
+
const matchCounter = ++counter;
|
|
103
|
+
f(value)
|
|
104
|
+
.then(value => {
|
|
105
|
+
if (matchCounter === counter) {
|
|
106
|
+
prop.set(value);
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
.catch(e => {
|
|
110
|
+
throw e;
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
return prop;
|
|
114
|
+
};
|
|
115
|
+
mapMaybe = (f, alt) => {
|
|
116
|
+
const prop = new Prop(f(this._value) ?? alt);
|
|
117
|
+
this.subscribe(value => {
|
|
118
|
+
const newValue = f(value);
|
|
119
|
+
if (newValue != null)
|
|
120
|
+
prop.set(newValue);
|
|
121
|
+
});
|
|
122
|
+
return prop;
|
|
123
|
+
};
|
|
124
|
+
combine = (other, f) => {
|
|
125
|
+
const prop = new Prop(f(this._value, other.get()));
|
|
126
|
+
this.subscribe(value => { prop.set(f(value, other.get())); });
|
|
127
|
+
other.subscribe(value => { prop.set(f(this._value, value)); });
|
|
128
|
+
return prop;
|
|
129
|
+
};
|
|
130
|
+
feed = (prop) => {
|
|
131
|
+
this.subscribe(value => { prop.set(value); });
|
|
132
|
+
return prop;
|
|
133
|
+
};
|
|
134
|
+
deriveProp = () => {
|
|
135
|
+
return new Prop(this._value);
|
|
136
|
+
};
|
|
137
|
+
clean = () => {
|
|
138
|
+
this._listeners.length = 0;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export class Prop extends Signal {
|
|
142
|
+
static isProp(x) {
|
|
143
|
+
const p = x;
|
|
144
|
+
return Signal.isSignal(x) && typeof p.set === 'function';
|
|
145
|
+
// return x != null && (x as Prop<T>)[$isProp] === true
|
|
146
|
+
}
|
|
147
|
+
static of(value) {
|
|
148
|
+
return new Prop(value);
|
|
149
|
+
}
|
|
150
|
+
[$isProp] = true;
|
|
151
|
+
set = (value) => {
|
|
152
|
+
if (this._value === value)
|
|
153
|
+
return;
|
|
154
|
+
this._value = value;
|
|
155
|
+
this._listeners.forEach(listener => { listener(value); });
|
|
156
|
+
};
|
|
157
|
+
update = (f) => {
|
|
158
|
+
this.set(f(this._value));
|
|
159
|
+
};
|
|
160
|
+
atLens = (key) => {
|
|
161
|
+
return this.iso(value => value[key], value => ({ ...this._value, [key]: value }));
|
|
162
|
+
};
|
|
163
|
+
reducer = (f) => {
|
|
164
|
+
return (action) => {
|
|
165
|
+
this.set(f(this._value, action));
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
iso = (map, reverse) => {
|
|
169
|
+
const prop = new Prop(map(this._value));
|
|
170
|
+
this.subscribe(value => { prop.set(map(value)); });
|
|
171
|
+
prop.subscribe(value => { this.set(reverse(value)); });
|
|
172
|
+
return prop;
|
|
173
|
+
};
|
|
174
|
+
}
|
package/render.d.ts
ADDED
package/render.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DOMContext } from './dom-context';
|
|
2
|
+
import { makeRenderable } from './jsx-runtime';
|
|
3
|
+
export function render(renderable, element) {
|
|
4
|
+
const ctx = DOMContext.of(element);
|
|
5
|
+
const clear = makeRenderable(renderable).appendTo(ctx);
|
|
6
|
+
return () => { clear(true); };
|
|
7
|
+
}
|
package/renderable.d.ts
ADDED
package/renderable.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/clean.d.ts
ADDED
package/types/clean.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Clear } from './clean';
|
|
2
|
+
export type ProviderMark<T> = symbol;
|
|
3
|
+
export declare function makeProviderMark<T>(): ProviderMark<T>;
|
|
4
|
+
export interface IDOMContext {
|
|
5
|
+
makeReference: () => IDOMContext;
|
|
6
|
+
makeElement: (tagName: string) => IDOMContext;
|
|
7
|
+
getBooleanAttribute: (name: string) => boolean;
|
|
8
|
+
setBooleanAttribute: (name: string, value: boolean) => void;
|
|
9
|
+
createBooleanAttribute: (name: string, value: boolean) => [(newValue: boolean) => void, Clear];
|
|
10
|
+
getAttribute: (name: string) => string | null;
|
|
11
|
+
setAttribute: (name: string, value: string | null) => void;
|
|
12
|
+
createAttribute: (name: string, value: string) => [(newValue: string) => void, Clear];
|
|
13
|
+
getProperty: <T>(name: string) => T;
|
|
14
|
+
setProperty: <T>(name: string, value: T) => void;
|
|
15
|
+
createProperty: <T>(name: string, value: T) => [(newValue: T) => void, Clear];
|
|
16
|
+
createText: (text: string) => [(newText: string) => void, Clear];
|
|
17
|
+
createClass: (cls: string) => [(newClass: string) => void, Clear];
|
|
18
|
+
createHandler: <T>(name: string, handler: (value: T) => void) => Clear;
|
|
19
|
+
delayClear: (removeTree: boolean, f: (finalize: () => void) => void) => void;
|
|
20
|
+
requestClear: (removeTree: boolean, willClear: () => void) => void;
|
|
21
|
+
getElement: () => HTMLElement;
|
|
22
|
+
getDocument: () => Document;
|
|
23
|
+
withProvider: <T>(mark: ProviderMark<T>, provider: T) => IDOMContext;
|
|
24
|
+
getProvider: <T>(mark: ProviderMark<T>) => T;
|
|
25
|
+
setStyle: (name: string, value: string | undefined | null) => void;
|
|
26
|
+
createStyle: (name: string, value: string | undefined | null) => [(newValue: string) => void, Clear];
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/.eslintignore
DELETED
package/.eslintrc.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
node: true
|
|
6
|
-
},
|
|
7
|
-
extends: [
|
|
8
|
-
'standard-with-typescript',
|
|
9
|
-
],
|
|
10
|
-
overrides: [
|
|
11
|
-
],
|
|
12
|
-
parserOptions: {
|
|
13
|
-
project: './tsconfig.json',
|
|
14
|
-
ecmaVersion: 2020,
|
|
15
|
-
sourceType: 'module',
|
|
16
|
-
ecmaFeatures: {
|
|
17
|
-
jsx: true
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
plugins: [
|
|
21
|
-
|
|
22
|
-
],
|
|
23
|
-
rules: {
|
|
24
|
-
'@typescript-eslint/naming-convention': 'off',
|
|
25
|
-
},
|
|
26
|
-
settings: {
|
|
27
|
-
}
|
|
28
|
-
}
|
package/coverage/clover.xml
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1680826768659" clover="3.2.0">
|
|
3
|
-
<project timestamp="1680826768659" name="All files">
|
|
4
|
-
<metrics statements="30" coveredstatements="24" conditionals="2" coveredconditionals="1" methods="8" coveredmethods="4" elements="40" coveredelements="29" complexity="0" loc="30" ncloc="30" packages="1" files="1" classes="1"/>
|
|
5
|
-
<file name="OneOf.ts" path="/Users/franco/projects/tempots/dom/src/components/OneOf.ts">
|
|
6
|
-
<metrics statements="30" coveredstatements="24" conditionals="2" coveredconditionals="1" methods="8" coveredmethods="4"/>
|
|
7
|
-
<line num="1" count="8" type="stmt"/>
|
|
8
|
-
<line num="6" count="8" type="stmt"/>
|
|
9
|
-
<line num="9" count="8" type="stmt"/>
|
|
10
|
-
<line num="11" count="7" type="stmt"/>
|
|
11
|
-
<line num="12" count="7" type="stmt"/>
|
|
12
|
-
<line num="16" count="7" type="stmt"/>
|
|
13
|
-
<line num="17" count="7" type="stmt"/>
|
|
14
|
-
<line num="18" count="7" type="stmt"/>
|
|
15
|
-
<line num="19" count="7" type="stmt"/>
|
|
16
|
-
<line num="20" count="7" type="stmt"/>
|
|
17
|
-
<line num="21" count="7" type="stmt"/>
|
|
18
|
-
<line num="22" count="7" type="stmt"/>
|
|
19
|
-
<line num="23" count="7" type="stmt"/>
|
|
20
|
-
<line num="24" count="7" type="stmt"/>
|
|
21
|
-
<line num="25" count="7" type="cond" truecount="1" falsecount="1"/>
|
|
22
|
-
<line num="26" count="7" type="stmt"/>
|
|
23
|
-
<line num="27" count="7" type="stmt"/>
|
|
24
|
-
<line num="28" count="7" type="stmt"/>
|
|
25
|
-
<line num="29" count="7" type="stmt"/>
|
|
26
|
-
<line num="30" count="7" type="stmt"/>
|
|
27
|
-
<line num="31" count="7" type="stmt"/>
|
|
28
|
-
<line num="32" count="7" type="stmt"/>
|
|
29
|
-
<line num="35" count="0" type="stmt"/>
|
|
30
|
-
<line num="38" count="7" type="stmt"/>
|
|
31
|
-
<line num="39" count="0" type="stmt"/>
|
|
32
|
-
<line num="40" count="0" type="stmt"/>
|
|
33
|
-
<line num="41" count="0" type="stmt"/>
|
|
34
|
-
<line num="42" count="0" type="stmt"/>
|
|
35
|
-
<line num="55" count="8" type="stmt"/>
|
|
36
|
-
<line num="56" count="0" type="stmt"/>
|
|
37
|
-
</file>
|
|
38
|
-
</project>
|
|
39
|
-
</coverage>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
{"/Users/franco/projects/tempots/dom/src/components/OneOf.ts": {"path":"/Users/franco/projects/tempots/dom/src/components/OneOf.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":47}},"2":{"start":{"line":11,"column":21},"end":{"line":11,"column":37}},"3":{"start":{"line":12,"column":21},"end":{"line":12,"column":null}},"4":{"start":{"line":16,"column":22},"end":{"line":45,"column":3}},"5":{"start":{"line":17,"column":31},"end":{"line":17,"column":47}},"6":{"start":{"line":18,"column":14},"end":{"line":18,"column":21}},"7":{"start":{"line":19,"column":18},"end":{"line":19,"column":25}},"8":{"start":{"line":20,"column":22},"end":{"line":20,"column":41}},"9":{"start":{"line":21,"column":15},"end":{"line":21,"column":30}},"10":{"start":{"line":22,"column":17},"end":{"line":22,"column":42}},"11":{"start":{"line":23,"column":16},"end":{"line":23,"column":70}},"12":{"start":{"line":24,"column":19},"end":{"line":37,"column":6}},"13":{"start":{"line":25,"column":6},"end":{"line":36,"column":null}},"14":{"start":{"line":26,"column":8},"end":{"line":33,"column":null}},"15":{"start":{"line":27,"column":10},"end":{"line":27,"column":null}},"16":{"start":{"line":28,"column":10},"end":{"line":28,"column":null}},"17":{"start":{"line":29,"column":10},"end":{"line":29,"column":null}},"18":{"start":{"line":30,"column":10},"end":{"line":30,"column":null}},"19":{"start":{"line":31,"column":10},"end":{"line":31,"column":null}},"20":{"start":{"line":32,"column":10},"end":{"line":32,"column":null}},"21":{"start":{"line":35,"column":8},"end":{"line":35,"column":null}},"22":{"start":{"line":38,"column":4},"end":{"line":44,"column":null}},"23":{"start":{"line":39,"column":6},"end":{"line":43,"column":null}},"24":{"start":{"line":40,"column":8},"end":{"line":40,"column":null}},"25":{"start":{"line":41,"column":8},"end":{"line":41,"column":null}},"26":{"start":{"line":42,"column":8},"end":{"line":42,"column":null}},"27":{"start":{"line":9,"column":0},"end":{"line":9,"column":13}},"28":{"start":{"line":56,"column":2},"end":{"line":56,"column":null}},"29":{"start":{"line":55,"column":0},"end":{"line":55,"column":16}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":2},"end":{"line":10,"column":null}},"loc":{"start":{"line":14,"column":5},"end":{"line":14,"column":10}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":16,"column":22},"end":{"line":16,"column":23}},"loc":{"start":{"line":16,"column":49},"end":{"line":45,"column":3}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":24,"column":40},"end":{"line":24,"column":41}},"loc":{"start":{"line":24,"column":63},"end":{"line":37,"column":5}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":26,"column":34},"end":{"line":26,"column":37}},"loc":{"start":{"line":26,"column":39},"end":{"line":33,"column":9}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":38,"column":11},"end":{"line":38,"column":12}},"loc":{"start":{"line":38,"column":35},"end":{"line":44,"column":5}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":39,"column":38},"end":{"line":39,"column":41}},"loc":{"start":{"line":39,"column":43},"end":{"line":43,"column":7}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":42,"column":43},"end":{"line":42,"column":46}},"loc":{"start":{"line":42,"column":48},"end":{"line":42,"column":52}}},"7":{"name":"OneOf","decl":{"start":{"line":55,"column":16},"end":{"line":55,"column":21}},"loc":{"start":{"line":55,"column":72},"end":{"line":57,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":6},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":25,"column":6},"end":{"line":36,"column":null}},{"start":{"line":34,"column":13},"end":{"line":36,"column":null}}]}},"s":{"0":8,"1":8,"2":7,"3":7,"4":7,"5":7,"6":7,"7":7,"8":7,"9":7,"10":7,"11":7,"12":7,"13":7,"14":7,"15":7,"16":7,"17":7,"18":7,"19":7,"20":7,"21":0,"22":7,"23":0,"24":0,"25":0,"26":0,"27":8,"28":0,"29":8},"f":{"0":7,"1":7,"2":7,"3":7,"4":0,"5":0,"6":0,"7":0},"b":{"0":[7,0]}}
|
|
2
|
-
}
|