@opentui/solid 0.1.91 → 0.1.92
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 +33 -7
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -984,31 +984,57 @@ function Slot(props) {
|
|
|
984
984
|
const registry = () => local.registry;
|
|
985
985
|
const pluginFailurePlaceholder = () => local.pluginFailurePlaceholder;
|
|
986
986
|
const [version, setVersion] = createSignal2(0);
|
|
987
|
+
let queued = false;
|
|
988
|
+
let disposed = false;
|
|
987
989
|
const unsubscribe = registry().subscribe(() => {
|
|
990
|
+
if (queued)
|
|
991
|
+
return;
|
|
992
|
+
queued = true;
|
|
988
993
|
setVersion((current) => current + 1);
|
|
994
|
+
queueMicrotask(() => {
|
|
995
|
+
queued = false;
|
|
996
|
+
if (disposed)
|
|
997
|
+
return;
|
|
998
|
+
});
|
|
999
|
+
});
|
|
1000
|
+
onCleanup3(() => {
|
|
1001
|
+
disposed = true;
|
|
1002
|
+
unsubscribe();
|
|
989
1003
|
});
|
|
990
|
-
onCleanup3(unsubscribe);
|
|
991
1004
|
const entries = createMemo3((previousEntries = []) => {
|
|
992
1005
|
version();
|
|
993
1006
|
const resolvedEntries = registry().resolveEntries(local.name);
|
|
1007
|
+
if (resolvedEntries.length === 0) {
|
|
1008
|
+
if (previousEntries.length === 0)
|
|
1009
|
+
return previousEntries;
|
|
1010
|
+
return [];
|
|
1011
|
+
}
|
|
994
1012
|
const previousById = new Map(previousEntries.map((entry) => [entry.id, entry]));
|
|
995
|
-
|
|
1013
|
+
const nextEntries = resolvedEntries.map((entry) => {
|
|
996
1014
|
const previousEntry = previousById.get(entry.id);
|
|
997
1015
|
if (previousEntry && previousEntry.renderer === entry.renderer) {
|
|
998
1016
|
return previousEntry;
|
|
999
1017
|
}
|
|
1000
1018
|
return entry;
|
|
1001
1019
|
});
|
|
1020
|
+
const unchanged = nextEntries.length === previousEntries.length && nextEntries.every((entry, index) => entry === previousEntries[index]);
|
|
1021
|
+
if (unchanged)
|
|
1022
|
+
return previousEntries;
|
|
1023
|
+
return nextEntries;
|
|
1002
1024
|
});
|
|
1003
1025
|
const entryIds = createMemo3(() => entries().map((entry) => entry.id));
|
|
1004
1026
|
const entriesById = createMemo3(() => new Map(entries().map((entry) => [entry.id, entry])));
|
|
1005
1027
|
const slotName = () => String(local.name);
|
|
1006
|
-
|
|
1007
|
-
const resolvedFallbackChildren = children(() => local.children);
|
|
1008
|
-
return memo2(resolvedFallbackChildren);
|
|
1009
|
-
};
|
|
1028
|
+
let fallbackView;
|
|
1010
1029
|
const renderFallback = () => {
|
|
1011
|
-
|
|
1030
|
+
if (fallbackView)
|
|
1031
|
+
return fallbackView();
|
|
1032
|
+
const resolvedFallbackChildren = children(() => local.children);
|
|
1033
|
+
fallbackView = () => {
|
|
1034
|
+
const value = resolvedFallbackChildren();
|
|
1035
|
+
return value ?? null;
|
|
1036
|
+
};
|
|
1037
|
+
return fallbackView();
|
|
1012
1038
|
};
|
|
1013
1039
|
const resolveFallback = (fallbackValue) => fallbackValue?.() ?? null;
|
|
1014
1040
|
const renderPluginFailurePlaceholder = (failure, fallbackValue) => {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.92",
|
|
8
8
|
"description": "SolidJS renderer for OpenTUI",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/core": "7.28.0",
|
|
37
37
|
"@babel/preset-typescript": "7.27.1",
|
|
38
|
-
"@opentui/core": "0.1.
|
|
38
|
+
"@opentui/core": "0.1.92",
|
|
39
39
|
"babel-plugin-module-resolver": "5.0.2",
|
|
40
40
|
"babel-preset-solid": "1.9.10",
|
|
41
41
|
"entities": "7.0.1",
|