@esportsplus/template 0.28.0 → 0.28.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.
|
@@ -5,7 +5,7 @@ on:
|
|
|
5
5
|
types: [published]
|
|
6
6
|
workflow_dispatch:
|
|
7
7
|
workflow_run:
|
|
8
|
-
workflows: [bump]
|
|
8
|
+
workflows: [bump version]
|
|
9
9
|
types:
|
|
10
10
|
- completed
|
|
11
11
|
|
|
@@ -13,4 +13,4 @@ jobs:
|
|
|
13
13
|
publish:
|
|
14
14
|
secrets:
|
|
15
15
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
16
|
-
uses: esportsplus/
|
|
16
|
+
uses: esportsplus/typescript/.github/workflows/publish.yml@main
|
package/build/attributes.js
CHANGED
|
@@ -52,13 +52,13 @@ function list(ctx, element, id, name, state, value) {
|
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
dynamic.add(part);
|
|
55
|
-
hot[part] =
|
|
55
|
+
hot[part] = true;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
let cold = store[id];
|
|
59
59
|
if (cold !== undefined) {
|
|
60
60
|
for (let part in cold) {
|
|
61
|
-
if (hot[part] ===
|
|
61
|
+
if (hot[part] === true) {
|
|
62
62
|
continue;
|
|
63
63
|
}
|
|
64
64
|
dynamic.delete(part);
|
package/build/slot/effect.js
CHANGED
|
@@ -20,18 +20,18 @@ class EffectSlot {
|
|
|
20
20
|
scheduled = false;
|
|
21
21
|
textnode = null;
|
|
22
22
|
constructor(anchor, fn) {
|
|
23
|
-
let dispose = fn.length ? () => this.dispose() : undefined,
|
|
23
|
+
let dispose = fn.length ? () => this.dispose() : undefined, value;
|
|
24
24
|
this.anchor = anchor;
|
|
25
|
-
this.disposer = effect(
|
|
26
|
-
|
|
27
|
-
if (!
|
|
28
|
-
|
|
25
|
+
this.disposer = effect(() => {
|
|
26
|
+
value = read(fn(dispose));
|
|
27
|
+
if (!this.disposer) {
|
|
28
|
+
this.update(value);
|
|
29
29
|
}
|
|
30
|
-
else if (!
|
|
31
|
-
|
|
30
|
+
else if (!this.scheduled) {
|
|
31
|
+
this.scheduled = true;
|
|
32
32
|
raf(() => {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
this.scheduled = false;
|
|
34
|
+
this.update(value);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "ICJR",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@esportsplus/queue": "^0.2.0",
|
|
5
|
-
"@esportsplus/reactivity": "^0.
|
|
5
|
+
"@esportsplus/reactivity": "^0.22.0",
|
|
6
6
|
"@esportsplus/utilities": "^0.25.0"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"type": "module",
|
|
19
19
|
"types": "./build/index.d.ts",
|
|
20
|
-
"version": "0.28.
|
|
20
|
+
"version": "0.28.3",
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "tsc && tsc-alias",
|
|
23
23
|
"-": "-"
|
package/src/attributes.ts
CHANGED
|
@@ -79,7 +79,7 @@ function list(
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
let hot:
|
|
82
|
+
let hot: Record<PropertyKey, true> = {};
|
|
83
83
|
|
|
84
84
|
if (value && typeof value === 'string') {
|
|
85
85
|
let part: string,
|
|
@@ -93,15 +93,15 @@ function list(
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
dynamic.add(part);
|
|
96
|
-
hot[part] =
|
|
96
|
+
hot[part] = true;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
let cold = store[id] as
|
|
100
|
+
let cold = store[id] as Record<PropertyKey, true> | undefined;
|
|
101
101
|
|
|
102
102
|
if (cold !== undefined) {
|
|
103
103
|
for (let part in cold) {
|
|
104
|
-
if (hot[part] ===
|
|
104
|
+
if (hot[part] === true) {
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
107
|
|
package/src/slot/effect.ts
CHANGED
|
@@ -30,21 +30,21 @@ class EffectSlot {
|
|
|
30
30
|
|
|
31
31
|
constructor(anchor: Element, fn: (dispose?: VoidFunction) => Renderable<any>) {
|
|
32
32
|
let dispose = fn.length ? () => this.dispose() : undefined,
|
|
33
|
-
|
|
33
|
+
value: unknown;
|
|
34
34
|
|
|
35
35
|
this.anchor = anchor;
|
|
36
|
-
this.disposer = effect(
|
|
37
|
-
|
|
36
|
+
this.disposer = effect(() => {
|
|
37
|
+
value = read( fn(dispose) );
|
|
38
38
|
|
|
39
|
-
if (!
|
|
40
|
-
|
|
39
|
+
if (!this.disposer) {
|
|
40
|
+
this.update(value);
|
|
41
41
|
}
|
|
42
|
-
else if (!
|
|
43
|
-
|
|
42
|
+
else if (!this.scheduled) {
|
|
43
|
+
this.scheduled = true;
|
|
44
44
|
|
|
45
45
|
raf(() => {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
this.scheduled = false;
|
|
47
|
+
this.update(value);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
});
|