decky-frontend-lib
Advanced tools
Comparing version 3.24.0 to 3.24.1
@@ -10,2 +10,3 @@ import * as React from 'react'; | ||
export declare function wrapReactClass(node: any, prop?: any): any; | ||
export declare function getReactRoot(o: HTMLElement | Element | Node): any; | ||
export declare function getReactInstance(o: HTMLElement | Element | Node): any; | ||
@@ -12,0 +13,0 @@ export interface findInTreeOpts { |
@@ -51,4 +51,9 @@ export function fakeRenderComponent(fun, customHooks = {}) { | ||
} | ||
export function getReactRoot(o) { | ||
return (o[Object.keys(o).find((k) => k.startsWith('__reactContainer$'))] || | ||
o['_reactRootContainer']?._internalRoot?.current); | ||
} | ||
export function getReactInstance(o) { | ||
return o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance'))]; | ||
return (o[Object.keys(o).find((k) => k.startsWith('__reactFiber'))] || | ||
o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance'))]); | ||
} | ||
@@ -55,0 +60,0 @@ export const findInTree = (parent, filter, opts) => { |
{ | ||
"name": "decky-frontend-lib", | ||
"version": "3.24.0", | ||
"version": "3.24.1", | ||
"description": "A library for building decky plugins", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -61,3 +61,5 @@ import * as React from 'react'; | ||
const cls = node[prop]; | ||
const wrappedCls = class extends cls { static __DECKY_WRAPPED = true; }; | ||
const wrappedCls = class extends cls { | ||
static __DECKY_WRAPPED = true; | ||
}; | ||
return (node[prop] = wrappedCls); | ||
@@ -67,4 +69,14 @@ } | ||
export function getReactRoot(o: HTMLElement | Element | Node) { | ||
return ( | ||
o[Object.keys(o).find((k) => k.startsWith('__reactContainer$')) as string] || | ||
o['_reactRootContainer']?._internalRoot?.current | ||
); | ||
} | ||
export function getReactInstance(o: HTMLElement | Element | Node) { | ||
return o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string]; | ||
return ( | ||
o[Object.keys(o).find((k) => k.startsWith('__reactFiber')) as string] || | ||
o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string] | ||
); | ||
} | ||
@@ -71,0 +83,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234187
5634