@lightningtv/solid 0.0.9 → 0.0.10
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/{source → src}/Text.jsx +1 -0
- package/dist/src/Text.jsx.map +1 -0
- package/dist/{source → src}/View.jsx +1 -0
- package/dist/src/View.jsx.map +1 -0
- package/dist/{types → src}/activeElement.d.ts +1 -1
- package/dist/{source → src}/activeElement.js +1 -0
- package/dist/src/activeElement.js.map +1 -0
- package/dist/{types → src}/index.d.ts +3 -4
- package/dist/{source → src}/index.js +4 -4
- package/dist/src/index.js.map +1 -0
- package/dist/src/jsx-runtime.js +2 -0
- package/dist/src/jsx-runtime.js.map +1 -0
- package/dist/{source → src}/primitives/announcer/announcer.js +1 -0
- package/dist/src/primitives/announcer/announcer.js.map +1 -0
- package/dist/{source → src}/primitives/announcer/index.js +1 -0
- package/dist/src/primitives/announcer/index.js.map +1 -0
- package/dist/{source → src}/primitives/announcer/speech.js +1 -0
- package/dist/src/primitives/announcer/speech.js.map +1 -0
- package/dist/{source → src}/primitives/createInfiniteItems.js +1 -0
- package/dist/src/primitives/createInfiniteItems.js.map +1 -0
- package/dist/{types → src}/primitives/createSpriteMap.d.ts +1 -0
- package/dist/{source → src}/primitives/createSpriteMap.js +1 -0
- package/dist/src/primitives/createSpriteMap.js.map +1 -0
- package/dist/{source → src}/primitives/index.js +1 -0
- package/dist/src/primitives/index.js.map +1 -0
- package/dist/{source → src}/primitives/portal.jsx +1 -0
- package/dist/src/primitives/portal.jsx.map +1 -0
- package/dist/{source → src}/primitives/useFocusManager.js +1 -0
- package/dist/src/primitives/useFocusManager.js.map +1 -0
- package/dist/{source → src}/primitives/useMouse.js +26 -12
- package/dist/src/primitives/useMouse.js.map +1 -0
- package/dist/{source → src}/primitives/withPadding.js +1 -0
- package/dist/src/primitives/withPadding.js.map +1 -0
- package/dist/src/render.d.ts +22 -0
- package/dist/{source → src}/render.js +1 -0
- package/dist/src/render.js.map +1 -0
- package/dist/{source → src}/solidOpts.js +1 -0
- package/dist/src/solidOpts.js.map +1 -0
- package/dist/{source → src}/utils.js +1 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +12 -8
- package/src/index.ts +6 -7
- package/src/primitives/useMouse.ts +32 -14
- package/dist/esm/index.js +0 -1013
- package/dist/esm/index.js.map +0 -1
- package/dist/source/jsx-runtime.js +0 -1
- package/dist/types/render.d.ts +0 -22
- /package/dist/{types → src}/Text.d.ts +0 -0
- /package/dist/{types → src}/View.d.ts +0 -0
- /package/dist/{types → src}/jsx-runtime.d.ts +0 -0
- /package/dist/{types → src}/primitives/announcer/announcer.d.ts +0 -0
- /package/dist/{types → src}/primitives/announcer/index.d.ts +0 -0
- /package/dist/{types → src}/primitives/announcer/speech.d.ts +0 -0
- /package/dist/{types → src}/primitives/createInfiniteItems.d.ts +0 -0
- /package/dist/{types → src}/primitives/index.d.ts +0 -0
- /package/dist/{types → src}/primitives/portal.d.ts +0 -0
- /package/dist/{types → src}/primitives/useFocusManager.d.ts +0 -0
- /package/dist/{types → src}/primitives/useMouse.d.ts +0 -0
- /package/dist/{types → src}/primitives/withPadding.d.ts +0 -0
- /package/dist/{types → src}/solidOpts.d.ts +0 -0
- /package/dist/{types → src}/utils.d.ts +0 -0
|
@@ -74,27 +74,45 @@ function getChildrenByPosition(
|
|
|
74
74
|
x: number,
|
|
75
75
|
y: number,
|
|
76
76
|
): ElementNode[] {
|
|
77
|
-
|
|
77
|
+
const result: ElementNode[] = [];
|
|
78
78
|
const precision = Config.rendererOptions?.deviceLogicalPixelRatio || 1;
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
// Queue for BFS
|
|
81
|
+
let queue: ElementNode[] = [node];
|
|
82
|
+
|
|
83
|
+
while (queue.length > 0) {
|
|
84
|
+
// Process nodes at the current level
|
|
85
|
+
const currentLevelNodes: ElementNode[] = [];
|
|
86
|
+
|
|
87
|
+
for (const currentNode of queue) {
|
|
83
88
|
if (
|
|
84
|
-
|
|
89
|
+
currentNode.alpha !== 0 &&
|
|
85
90
|
testCollision(
|
|
86
91
|
x,
|
|
87
92
|
y,
|
|
88
|
-
(
|
|
89
|
-
(
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
(currentNode.lng as MainOnlyNode).coreNode.absX * precision,
|
|
94
|
+
(currentNode.lng as MainOnlyNode).coreNode.absY * precision,
|
|
95
|
+
currentNode.width! * precision,
|
|
96
|
+
currentNode.height! * precision,
|
|
92
97
|
)
|
|
93
98
|
) {
|
|
94
|
-
|
|
95
|
-
result = [...result, ...getChildrenByPosition(child, x, y)];
|
|
99
|
+
currentLevelNodes.push(currentNode);
|
|
96
100
|
}
|
|
97
101
|
}
|
|
102
|
+
|
|
103
|
+
const size = currentLevelNodes.length;
|
|
104
|
+
if (size === 0) {
|
|
105
|
+
break;
|
|
106
|
+
} else if (size > 1) {
|
|
107
|
+
// Find the node with the highest zIndex
|
|
108
|
+
currentLevelNodes.sort((a, b) => (a.zIndex || 0) - (b.zIndex || 0));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const highestZIndexNode = currentLevelNodes[0] as ElementNode;
|
|
112
|
+
result.push(highestZIndexNode);
|
|
113
|
+
if (!highestZIndexNode.isTextNode()) {
|
|
114
|
+
queue = highestZIndexNode.children as ElementNode[];
|
|
115
|
+
}
|
|
98
116
|
}
|
|
99
117
|
|
|
100
118
|
return result;
|
|
@@ -107,9 +125,9 @@ export function useMouse(myApp: ElementNode = rootNode): void {
|
|
|
107
125
|
makeEventListener(window, 'click', handleClick);
|
|
108
126
|
createEffect(() => {
|
|
109
127
|
if (scheduled()) {
|
|
110
|
-
const result = getChildrenByPosition(myApp, pos.x, pos.y)
|
|
111
|
-
|
|
112
|
-
|
|
128
|
+
const result = getChildrenByPosition(myApp, pos.x, pos.y).filter(
|
|
129
|
+
(el) => (el.focus || el.onFocus || el.onEnter) && !el.skipFocus,
|
|
130
|
+
);
|
|
113
131
|
|
|
114
132
|
if (result.length) {
|
|
115
133
|
let activeElm = result[result.length - 1];
|