@sisense/sdk-ui-preact 2.20.0 → 2.21.0
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/ai.cjs +78 -78
- package/dist/ai.js +720 -695
- package/dist/index.cjs +392 -377
- package/dist/index.js +18012 -17682
- package/dist/packages/sdk-ui-preact/src/component-adapter/external-component-adapter-element.d.ts +59 -0
- package/dist/packages/sdk-ui-preact/src/component-adapter/index.d.ts +1 -0
- package/dist/{use-common-filters-B2wOzse2-ac483ac1.cjs → use-common-filters-DBqRT0et-63f16b5f.cjs} +210 -160
- package/dist/{use-common-filters-B2wOzse2-c0813e6b.js → use-common-filters-DBqRT0et-a901f88c.js} +13836 -13764
- package/package.json +11 -5
package/dist/packages/sdk-ui-preact/src/component-adapter/external-component-adapter-element.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for an adapter that manages an external component's lifecycle.
|
|
3
|
+
* This is used to bridge components from external frameworks (e.g., Angular, Vue)
|
|
4
|
+
* into the Preact rendering context.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface ExternalComponentAdapter<Props> {
|
|
9
|
+
/**
|
|
10
|
+
* Mounts the external component into the container element.
|
|
11
|
+
* Called once when the wrapper component mounts.
|
|
12
|
+
*/
|
|
13
|
+
mount(container: HTMLElement, props: Props): void;
|
|
14
|
+
/**
|
|
15
|
+
* Updates props on the existing external component.
|
|
16
|
+
* Called whenever props change after initial mount.
|
|
17
|
+
*/
|
|
18
|
+
update(props: Props): void;
|
|
19
|
+
/**
|
|
20
|
+
* Destroys the external component and cleans up resources.
|
|
21
|
+
* Called when the wrapper component unmounts.
|
|
22
|
+
*/
|
|
23
|
+
destroy(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Returns whether the adapter has an active component instance.
|
|
26
|
+
*/
|
|
27
|
+
isActive(): boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Factory function type that creates an adapter instance.
|
|
31
|
+
* The factory is called once per component mount.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export type AdapterFactory<Props> = () => ExternalComponentAdapter<Props>;
|
|
36
|
+
/**
|
|
37
|
+
* Props for the ExternalComponentAdapterElement component.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export interface ExternalComponentAdapterElementProps<Props> {
|
|
42
|
+
/** Factory function to create the adapter */
|
|
43
|
+
adapterFactory: AdapterFactory<Props>;
|
|
44
|
+
/** Props to pass to the wrapped component */
|
|
45
|
+
componentProps: Props;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A Preact component that wraps an external framework component using an adapter pattern.
|
|
49
|
+
* This component:
|
|
50
|
+
* - Creates the adapter once on mount using the factory
|
|
51
|
+
* - Calls update() on the adapter when props change
|
|
52
|
+
* - Calls destroy() when unmounting
|
|
53
|
+
*
|
|
54
|
+
* This allows external framework components to be efficiently updated in-place
|
|
55
|
+
* rather than being destroyed and recreated on every prop change.
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export declare const ExternalComponentAdapterElement: <Props>({ adapterFactory, componentProps, }: ExternalComponentAdapterElementProps<Props>) => import("preact").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './component-adapter';
|
|
2
2
|
export * from './context-connector';
|
|
3
3
|
export * from './custom-element';
|
|
4
|
+
export * from './external-component-adapter-element';
|
|
4
5
|
export * from './hook-adapter';
|
|
5
6
|
export type { AnyComponentFunction } from './types';
|
|
6
7
|
export { createHookApiFacade, DataObserver } from './utils';
|