solid-js 1.4.7 → 1.4.8
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/dist/dev.cjs +15 -13
- package/dist/dev.js +15 -13
- package/dist/server.cjs +10 -3
- package/dist/server.js +10 -3
- package/dist/solid.cjs +15 -13
- package/dist/solid.js +15 -13
- package/html/dist/html.cjs +34 -59
- package/html/dist/html.js +34 -59
- package/package.json +2 -2
- package/types/reactive/observable.d.ts +7 -2
- package/universal/dist/dev.cjs +0 -0
- package/universal/dist/dev.js +0 -0
- package/universal/dist/universal.cjs +0 -0
- package/universal/dist/universal.js +0 -0
- package/universal/types/index.d.ts +0 -0
- package/universal/types/universal.d.ts +3 -3
package/dist/dev.cjs
CHANGED
|
@@ -1020,31 +1020,33 @@ function serializeChildren(root) {
|
|
|
1020
1020
|
return result;
|
|
1021
1021
|
}
|
|
1022
1022
|
|
|
1023
|
-
function getSymbol() {
|
|
1024
|
-
const SymbolCopy = Symbol;
|
|
1025
|
-
return SymbolCopy.observable || "@@observable";
|
|
1026
|
-
}
|
|
1027
1023
|
function observable(input) {
|
|
1028
|
-
const $$observable = getSymbol();
|
|
1029
1024
|
return {
|
|
1030
1025
|
subscribe(observer) {
|
|
1031
1026
|
if (!(observer instanceof Object) || observer == null) {
|
|
1032
1027
|
throw new TypeError("Expected the observer to be an object.");
|
|
1033
1028
|
}
|
|
1034
|
-
const handler =
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1029
|
+
const handler = typeof observer === 'function' ? observer : observer.next && observer.next.bind(observer);
|
|
1030
|
+
if (!handler) {
|
|
1031
|
+
return {
|
|
1032
|
+
unsubscribe() {}
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
const dispose = createRoot(disposer => {
|
|
1036
|
+
createComputed(() => {
|
|
1037
|
+
const v = input();
|
|
1038
|
+
untrack(() => handler(v));
|
|
1039
|
+
});
|
|
1040
|
+
return disposer;
|
|
1040
1041
|
});
|
|
1042
|
+
if (getOwner()) onCleanup(dispose);
|
|
1041
1043
|
return {
|
|
1042
1044
|
unsubscribe() {
|
|
1043
|
-
|
|
1045
|
+
dispose();
|
|
1044
1046
|
}
|
|
1045
1047
|
};
|
|
1046
1048
|
},
|
|
1047
|
-
[
|
|
1049
|
+
[Symbol.observable || "@@observable"]() {
|
|
1048
1050
|
return this;
|
|
1049
1051
|
}
|
|
1050
1052
|
};
|
package/dist/dev.js
CHANGED
|
@@ -1016,31 +1016,33 @@ function serializeChildren(root) {
|
|
|
1016
1016
|
return result;
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
|
-
function getSymbol() {
|
|
1020
|
-
const SymbolCopy = Symbol;
|
|
1021
|
-
return SymbolCopy.observable || "@@observable";
|
|
1022
|
-
}
|
|
1023
1019
|
function observable(input) {
|
|
1024
|
-
const $$observable = getSymbol();
|
|
1025
1020
|
return {
|
|
1026
1021
|
subscribe(observer) {
|
|
1027
1022
|
if (!(observer instanceof Object) || observer == null) {
|
|
1028
1023
|
throw new TypeError("Expected the observer to be an object.");
|
|
1029
1024
|
}
|
|
1030
|
-
const handler =
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1025
|
+
const handler = typeof observer === 'function' ? observer : observer.next && observer.next.bind(observer);
|
|
1026
|
+
if (!handler) {
|
|
1027
|
+
return {
|
|
1028
|
+
unsubscribe() {}
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
const dispose = createRoot(disposer => {
|
|
1032
|
+
createComputed(() => {
|
|
1033
|
+
const v = input();
|
|
1034
|
+
untrack(() => handler(v));
|
|
1035
|
+
});
|
|
1036
|
+
return disposer;
|
|
1036
1037
|
});
|
|
1038
|
+
if (getOwner()) onCleanup(dispose);
|
|
1037
1039
|
return {
|
|
1038
1040
|
unsubscribe() {
|
|
1039
|
-
|
|
1041
|
+
dispose();
|
|
1040
1042
|
}
|
|
1041
1043
|
};
|
|
1042
1044
|
},
|
|
1043
|
-
[
|
|
1045
|
+
[Symbol.observable || "@@observable"]() {
|
|
1044
1046
|
return this;
|
|
1045
1047
|
}
|
|
1046
1048
|
};
|
package/dist/server.cjs
CHANGED
|
@@ -430,10 +430,17 @@ function createResource(source, fetcher, options = {}) {
|
|
|
430
430
|
}
|
|
431
431
|
function lazy(fn) {
|
|
432
432
|
let resolved;
|
|
433
|
-
|
|
433
|
+
let p;
|
|
434
|
+
let load = () => {
|
|
435
|
+
if (!p) {
|
|
436
|
+
p = fn();
|
|
437
|
+
p.then(mod => resolved = mod.default);
|
|
438
|
+
}
|
|
439
|
+
return p;
|
|
440
|
+
};
|
|
434
441
|
const contexts = new Set();
|
|
435
|
-
p.then(mod => resolved = mod.default);
|
|
436
442
|
const wrap = props => {
|
|
443
|
+
load();
|
|
437
444
|
const id = sharedConfig.context.id.slice(0, -1);
|
|
438
445
|
if (resolved) return resolved(props);
|
|
439
446
|
const ctx = useContext(SuspenseContext);
|
|
@@ -451,7 +458,7 @@ function lazy(fn) {
|
|
|
451
458
|
});
|
|
452
459
|
return "";
|
|
453
460
|
};
|
|
454
|
-
wrap.preload =
|
|
461
|
+
wrap.preload = load;
|
|
455
462
|
return wrap;
|
|
456
463
|
}
|
|
457
464
|
function suspenseComplete(c) {
|
package/dist/server.js
CHANGED
|
@@ -426,10 +426,17 @@ function createResource(source, fetcher, options = {}) {
|
|
|
426
426
|
}
|
|
427
427
|
function lazy(fn) {
|
|
428
428
|
let resolved;
|
|
429
|
-
|
|
429
|
+
let p;
|
|
430
|
+
let load = () => {
|
|
431
|
+
if (!p) {
|
|
432
|
+
p = fn();
|
|
433
|
+
p.then(mod => resolved = mod.default);
|
|
434
|
+
}
|
|
435
|
+
return p;
|
|
436
|
+
};
|
|
430
437
|
const contexts = new Set();
|
|
431
|
-
p.then(mod => resolved = mod.default);
|
|
432
438
|
const wrap = props => {
|
|
439
|
+
load();
|
|
433
440
|
const id = sharedConfig.context.id.slice(0, -1);
|
|
434
441
|
if (resolved) return resolved(props);
|
|
435
442
|
const ctx = useContext(SuspenseContext);
|
|
@@ -447,7 +454,7 @@ function lazy(fn) {
|
|
|
447
454
|
});
|
|
448
455
|
return "";
|
|
449
456
|
};
|
|
450
|
-
wrap.preload =
|
|
457
|
+
wrap.preload = load;
|
|
451
458
|
return wrap;
|
|
452
459
|
}
|
|
453
460
|
function suspenseComplete(c) {
|
package/dist/solid.cjs
CHANGED
|
@@ -933,31 +933,33 @@ function createProvider(id) {
|
|
|
933
933
|
};
|
|
934
934
|
}
|
|
935
935
|
|
|
936
|
-
function getSymbol() {
|
|
937
|
-
const SymbolCopy = Symbol;
|
|
938
|
-
return SymbolCopy.observable || "@@observable";
|
|
939
|
-
}
|
|
940
936
|
function observable(input) {
|
|
941
|
-
const $$observable = getSymbol();
|
|
942
937
|
return {
|
|
943
938
|
subscribe(observer) {
|
|
944
939
|
if (!(observer instanceof Object) || observer == null) {
|
|
945
940
|
throw new TypeError("Expected the observer to be an object.");
|
|
946
941
|
}
|
|
947
|
-
const handler =
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
942
|
+
const handler = typeof observer === 'function' ? observer : observer.next && observer.next.bind(observer);
|
|
943
|
+
if (!handler) {
|
|
944
|
+
return {
|
|
945
|
+
unsubscribe() {}
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
const dispose = createRoot(disposer => {
|
|
949
|
+
createComputed(() => {
|
|
950
|
+
const v = input();
|
|
951
|
+
untrack(() => handler(v));
|
|
952
|
+
});
|
|
953
|
+
return disposer;
|
|
953
954
|
});
|
|
955
|
+
if (getOwner()) onCleanup(dispose);
|
|
954
956
|
return {
|
|
955
957
|
unsubscribe() {
|
|
956
|
-
|
|
958
|
+
dispose();
|
|
957
959
|
}
|
|
958
960
|
};
|
|
959
961
|
},
|
|
960
|
-
[
|
|
962
|
+
[Symbol.observable || "@@observable"]() {
|
|
961
963
|
return this;
|
|
962
964
|
}
|
|
963
965
|
};
|
package/dist/solid.js
CHANGED
|
@@ -929,31 +929,33 @@ function createProvider(id) {
|
|
|
929
929
|
};
|
|
930
930
|
}
|
|
931
931
|
|
|
932
|
-
function getSymbol() {
|
|
933
|
-
const SymbolCopy = Symbol;
|
|
934
|
-
return SymbolCopy.observable || "@@observable";
|
|
935
|
-
}
|
|
936
932
|
function observable(input) {
|
|
937
|
-
const $$observable = getSymbol();
|
|
938
933
|
return {
|
|
939
934
|
subscribe(observer) {
|
|
940
935
|
if (!(observer instanceof Object) || observer == null) {
|
|
941
936
|
throw new TypeError("Expected the observer to be an object.");
|
|
942
937
|
}
|
|
943
|
-
const handler =
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
938
|
+
const handler = typeof observer === 'function' ? observer : observer.next && observer.next.bind(observer);
|
|
939
|
+
if (!handler) {
|
|
940
|
+
return {
|
|
941
|
+
unsubscribe() {}
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
const dispose = createRoot(disposer => {
|
|
945
|
+
createComputed(() => {
|
|
946
|
+
const v = input();
|
|
947
|
+
untrack(() => handler(v));
|
|
948
|
+
});
|
|
949
|
+
return disposer;
|
|
949
950
|
});
|
|
951
|
+
if (getOwner()) onCleanup(dispose);
|
|
950
952
|
return {
|
|
951
953
|
unsubscribe() {
|
|
952
|
-
|
|
954
|
+
dispose();
|
|
953
955
|
}
|
|
954
956
|
};
|
|
955
957
|
},
|
|
956
|
-
[
|
|
958
|
+
[Symbol.observable || "@@observable"]() {
|
|
957
959
|
return this;
|
|
958
960
|
}
|
|
959
961
|
};
|
package/html/dist/html.cjs
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var web = require('solid-js/web');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
lookup = {
|
|
5
|
+
const tagRE = /(?:<!--[\S\s]*?-->|<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)/g;
|
|
6
|
+
const attrRE = /(?:\s(?<boolean>[^/\s><=]+?)(?=[\s/>]))|(?:(?<name>\S+?)(?:\s*=\s*(?:(['"])(?<quotedValue>[\s\S]*?)\3|(?<unquotedValue>[^\s>]+))))/g;
|
|
7
|
+
const lookup = {
|
|
9
8
|
area: true,
|
|
10
9
|
base: true,
|
|
11
10
|
br: true,
|
|
@@ -23,9 +22,9 @@ lookup = {
|
|
|
23
22
|
track: true,
|
|
24
23
|
wbr: true
|
|
25
24
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
res = {
|
|
25
|
+
function parseTag(
|
|
26
|
+
tag) {
|
|
27
|
+
const res = {
|
|
29
28
|
type: 'tag',
|
|
30
29
|
name: '',
|
|
31
30
|
voidElement: false,
|
|
@@ -47,64 +46,42 @@ parseTag = function (tag) {
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
const reg = new RegExp(attrRE);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
result = reg.exec(tag);
|
|
53
|
-
if (result === null) {
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
if (!result[0].trim()) {
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
if (result[1]) {
|
|
60
|
-
const attr = result[1].trim();
|
|
61
|
-
let arr = [attr, ''];
|
|
62
|
-
if (attr.indexOf('=') > -1) {
|
|
63
|
-
arr = attr.split('=');
|
|
64
|
-
}
|
|
65
|
-
res.attrs[arr[0]] = arr[1];
|
|
66
|
-
reg.lastIndex--;
|
|
67
|
-
} else if (result[2]) {
|
|
68
|
-
res.attrs[result[2]] = result[3].trim().substring(1, result[3].length - 1);
|
|
69
|
-
}
|
|
49
|
+
for (const match of tag.matchAll(reg)) {
|
|
50
|
+
res.attrs[match[1] || match[2]] = match[4] || match[5] || '';
|
|
70
51
|
}
|
|
71
52
|
return res;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
content = html.slice(start, end === -1 ? void 0 : end);
|
|
53
|
+
}
|
|
54
|
+
function pushTextNode(list, html, start) {
|
|
55
|
+
const end = html.indexOf('<', start);
|
|
56
|
+
const content = html.slice(start, end === -1 ? void 0 : end);
|
|
77
57
|
if (!/^\s*$/.test(content)) {
|
|
78
58
|
list.push({
|
|
79
59
|
type: 'text',
|
|
80
60
|
content: content
|
|
81
61
|
});
|
|
82
62
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
content = tag.replace('<!--', '').replace('-->', '');
|
|
63
|
+
}
|
|
64
|
+
function pushCommentNode(list, tag) {
|
|
65
|
+
const content = tag.replace('<!--', '').replace('-->', '');
|
|
87
66
|
if (!/^\s*$/.test(content)) {
|
|
88
67
|
list.push({
|
|
89
68
|
type: 'comment',
|
|
90
69
|
content: content
|
|
91
70
|
});
|
|
92
71
|
}
|
|
93
|
-
}
|
|
72
|
+
}
|
|
94
73
|
function parse(html) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
nextChar = html.charAt(start);
|
|
107
|
-
parent = void 0;
|
|
74
|
+
const result = [];
|
|
75
|
+
let current = void 0;
|
|
76
|
+
let level = -1;
|
|
77
|
+
const arr = [];
|
|
78
|
+
const byTag = {};
|
|
79
|
+
html.replace(tagRE, (tag, index) => {
|
|
80
|
+
const isOpen = tag.charAt(1) !== '/';
|
|
81
|
+
const isComment = tag.slice(0, 4) === '<!--';
|
|
82
|
+
const start = index + tag.length;
|
|
83
|
+
const nextChar = html.charAt(start);
|
|
84
|
+
let parent = void 0;
|
|
108
85
|
if (isOpen && !isComment) {
|
|
109
86
|
level++;
|
|
110
87
|
current = parseTag(tag);
|
|
@@ -140,19 +117,17 @@ function parse(html) {
|
|
|
140
117
|
});
|
|
141
118
|
return result;
|
|
142
119
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
for (key in attrs) {
|
|
148
|
-
buff.push(key + '="' + attrs[key] + '"');
|
|
120
|
+
function attrString(attrs) {
|
|
121
|
+
const buff = [];
|
|
122
|
+
for (const key in attrs) {
|
|
123
|
+
buff.push(key + '="' + attrs[key].replace(/"/g, '"') + '"');
|
|
149
124
|
}
|
|
150
125
|
if (!buff.length) {
|
|
151
126
|
return '';
|
|
152
127
|
}
|
|
153
128
|
return ' ' + buff.join(' ');
|
|
154
|
-
}
|
|
155
|
-
|
|
129
|
+
}
|
|
130
|
+
function stringifier(buff, doc) {
|
|
156
131
|
switch (doc.type) {
|
|
157
132
|
case 'text':
|
|
158
133
|
return buff + doc.content;
|
|
@@ -165,7 +140,7 @@ stringifier = function (buff, doc) {
|
|
|
165
140
|
case 'comment':
|
|
166
141
|
return buff += '<!--' + doc.content + '-->';
|
|
167
142
|
}
|
|
168
|
-
}
|
|
143
|
+
}
|
|
169
144
|
function stringify(doc) {
|
|
170
145
|
return doc.reduce(function (token, rootEl) {
|
|
171
146
|
return token + stringifier('', rootEl);
|
package/html/dist/html.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { effect, style, insert, spread, createComponent, delegateEvents, classList, mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, PropAliases, Properties, ChildProperties, DelegatedEvents, SVGElements, SVGNamespace } from 'solid-js/web';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
lookup = {
|
|
3
|
+
const tagRE = /(?:<!--[\S\s]*?-->|<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)/g;
|
|
4
|
+
const attrRE = /(?:\s(?<boolean>[^/\s><=]+?)(?=[\s/>]))|(?:(?<name>\S+?)(?:\s*=\s*(?:(['"])(?<quotedValue>[\s\S]*?)\3|(?<unquotedValue>[^\s>]+))))/g;
|
|
5
|
+
const lookup = {
|
|
7
6
|
area: true,
|
|
8
7
|
base: true,
|
|
9
8
|
br: true,
|
|
@@ -21,9 +20,9 @@ lookup = {
|
|
|
21
20
|
track: true,
|
|
22
21
|
wbr: true
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
res = {
|
|
23
|
+
function parseTag(
|
|
24
|
+
tag) {
|
|
25
|
+
const res = {
|
|
27
26
|
type: 'tag',
|
|
28
27
|
name: '',
|
|
29
28
|
voidElement: false,
|
|
@@ -45,64 +44,42 @@ parseTag = function (tag) {
|
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
const reg = new RegExp(attrRE);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
result = reg.exec(tag);
|
|
51
|
-
if (result === null) {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
if (!result[0].trim()) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (result[1]) {
|
|
58
|
-
const attr = result[1].trim();
|
|
59
|
-
let arr = [attr, ''];
|
|
60
|
-
if (attr.indexOf('=') > -1) {
|
|
61
|
-
arr = attr.split('=');
|
|
62
|
-
}
|
|
63
|
-
res.attrs[arr[0]] = arr[1];
|
|
64
|
-
reg.lastIndex--;
|
|
65
|
-
} else if (result[2]) {
|
|
66
|
-
res.attrs[result[2]] = result[3].trim().substring(1, result[3].length - 1);
|
|
67
|
-
}
|
|
47
|
+
for (const match of tag.matchAll(reg)) {
|
|
48
|
+
res.attrs[match[1] || match[2]] = match[4] || match[5] || '';
|
|
68
49
|
}
|
|
69
50
|
return res;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
content = html.slice(start, end === -1 ? void 0 : end);
|
|
51
|
+
}
|
|
52
|
+
function pushTextNode(list, html, start) {
|
|
53
|
+
const end = html.indexOf('<', start);
|
|
54
|
+
const content = html.slice(start, end === -1 ? void 0 : end);
|
|
75
55
|
if (!/^\s*$/.test(content)) {
|
|
76
56
|
list.push({
|
|
77
57
|
type: 'text',
|
|
78
58
|
content: content
|
|
79
59
|
});
|
|
80
60
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
content = tag.replace('<!--', '').replace('-->', '');
|
|
61
|
+
}
|
|
62
|
+
function pushCommentNode(list, tag) {
|
|
63
|
+
const content = tag.replace('<!--', '').replace('-->', '');
|
|
85
64
|
if (!/^\s*$/.test(content)) {
|
|
86
65
|
list.push({
|
|
87
66
|
type: 'comment',
|
|
88
67
|
content: content
|
|
89
68
|
});
|
|
90
69
|
}
|
|
91
|
-
}
|
|
70
|
+
}
|
|
92
71
|
function parse(html) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
nextChar = html.charAt(start);
|
|
105
|
-
parent = void 0;
|
|
72
|
+
const result = [];
|
|
73
|
+
let current = void 0;
|
|
74
|
+
let level = -1;
|
|
75
|
+
const arr = [];
|
|
76
|
+
const byTag = {};
|
|
77
|
+
html.replace(tagRE, (tag, index) => {
|
|
78
|
+
const isOpen = tag.charAt(1) !== '/';
|
|
79
|
+
const isComment = tag.slice(0, 4) === '<!--';
|
|
80
|
+
const start = index + tag.length;
|
|
81
|
+
const nextChar = html.charAt(start);
|
|
82
|
+
let parent = void 0;
|
|
106
83
|
if (isOpen && !isComment) {
|
|
107
84
|
level++;
|
|
108
85
|
current = parseTag(tag);
|
|
@@ -138,19 +115,17 @@ function parse(html) {
|
|
|
138
115
|
});
|
|
139
116
|
return result;
|
|
140
117
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
for (key in attrs) {
|
|
146
|
-
buff.push(key + '="' + attrs[key] + '"');
|
|
118
|
+
function attrString(attrs) {
|
|
119
|
+
const buff = [];
|
|
120
|
+
for (const key in attrs) {
|
|
121
|
+
buff.push(key + '="' + attrs[key].replace(/"/g, '"') + '"');
|
|
147
122
|
}
|
|
148
123
|
if (!buff.length) {
|
|
149
124
|
return '';
|
|
150
125
|
}
|
|
151
126
|
return ' ' + buff.join(' ');
|
|
152
|
-
}
|
|
153
|
-
|
|
127
|
+
}
|
|
128
|
+
function stringifier(buff, doc) {
|
|
154
129
|
switch (doc.type) {
|
|
155
130
|
case 'text':
|
|
156
131
|
return buff + doc.content;
|
|
@@ -163,7 +138,7 @@ stringifier = function (buff, doc) {
|
|
|
163
138
|
case 'comment':
|
|
164
139
|
return buff += '<!--' + doc.content + '-->';
|
|
165
140
|
}
|
|
166
|
-
}
|
|
141
|
+
}
|
|
167
142
|
function stringify(doc) {
|
|
168
143
|
return doc.reduce(function (token, rootEl) {
|
|
169
144
|
return token + stringifier('', rootEl);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-js",
|
|
3
3
|
"description": "A declarative JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.8",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -151,5 +151,5 @@
|
|
|
151
151
|
"compiler",
|
|
152
152
|
"performance"
|
|
153
153
|
],
|
|
154
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "e7f60ab9ac33e0666d966b4ba50371f2a683a574"
|
|
155
155
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Accessor, Setter } from "./signal";
|
|
2
|
+
declare global {
|
|
3
|
+
interface SymbolConstructor {
|
|
4
|
+
readonly observable: symbol;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
2
7
|
export declare type ObservableObserver<T> = ((v: T) => void) | {
|
|
3
|
-
next
|
|
8
|
+
next?: (v: T) => void;
|
|
4
9
|
error?: (v: any) => void;
|
|
5
10
|
complete?: (v: boolean) => void;
|
|
6
11
|
};
|
|
@@ -15,10 +20,10 @@ export declare type ObservableObserver<T> = ((v: T) => void) | {
|
|
|
15
20
|
* description https://www.solidjs.com/docs/latest/api#observable
|
|
16
21
|
*/
|
|
17
22
|
export declare function observable<T>(input: Accessor<T>): {
|
|
18
|
-
[x: number]: () => any;
|
|
19
23
|
subscribe(observer: ObservableObserver<T>): {
|
|
20
24
|
unsubscribe(): void;
|
|
21
25
|
};
|
|
26
|
+
[Symbol.observable](): any;
|
|
22
27
|
};
|
|
23
28
|
export declare function from<T>(producer: ((setter: Setter<T>) => () => void) | {
|
|
24
29
|
subscribe: (fn: (v: T) => void) => (() => void) | {
|
package/universal/dist/dev.cjs
CHANGED
|
File without changes
|
package/universal/dist/dev.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,9 +6,9 @@ export interface RendererOptions<NodeType> {
|
|
|
6
6
|
setProperty<T>(node: NodeType, name: string, value: T, prev?: T): void;
|
|
7
7
|
insertNode(parent: NodeType, node: NodeType, anchor?: NodeType): void;
|
|
8
8
|
removeNode(parent: NodeType, node: NodeType): void;
|
|
9
|
-
getParentNode(node: NodeType): NodeType;
|
|
10
|
-
getFirstChild(node: NodeType): NodeType;
|
|
11
|
-
getNextSibling(node: NodeType): NodeType;
|
|
9
|
+
getParentNode(node: NodeType): NodeType | undefined;
|
|
10
|
+
getFirstChild(node: NodeType): NodeType | undefined;
|
|
11
|
+
getNextSibling(node: NodeType): NodeType | undefined;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface Renderer<NodeType> {
|