@kosdev-code/kos-ui-plugin 2.1.21 → 2.1.23
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.cjs +65 -62
- package/index.cjs.map +1 -1
- package/index.js +483 -475
- package/index.js.map +1 -1
- package/lib/components/dynamic-component/dynamic-component.d.ts +25 -0
- package/lib/components/dynamic-component/dynamic-component.d.ts.map +1 -1
- package/lib/hooks/use-dynamic-component.d.ts +2 -1
- package/lib/hooks/use-dynamic-component.d.ts.map +1 -1
- package/lib/hooks/use-extension-component.d.ts +12 -0
- package/lib/hooks/use-extension-component.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -32,6 +32,19 @@ interface Props {
|
|
|
32
32
|
* Default: false
|
|
33
33
|
*/
|
|
34
34
|
autoSwitchOnDisabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to wait for component to load before rendering anything
|
|
37
|
+
* Useful for modals or containers that size based on content
|
|
38
|
+
* When true, returns null during loading instead of skeleton
|
|
39
|
+
* Default: false
|
|
40
|
+
*/
|
|
41
|
+
waitForLoad?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Callback when loading state changes
|
|
44
|
+
* Useful for parent components that need to know when content is ready
|
|
45
|
+
* Example: Modal that shouldn't show until content is loaded
|
|
46
|
+
*/
|
|
47
|
+
onLoadingChange?: (isLoading: boolean) => void;
|
|
35
48
|
}
|
|
36
49
|
/**
|
|
37
50
|
* DynamicComponent - Dynamically loads and renders plugin components
|
|
@@ -41,6 +54,7 @@ interface Props {
|
|
|
41
54
|
* - Automatic filtering of disabled contributions
|
|
42
55
|
* - Fallback rendering when modules become disabled
|
|
43
56
|
* - Auto-switching to best alternative when current module disabled
|
|
57
|
+
* - Wait-for-load mode to prevent reflow in modals
|
|
44
58
|
* - Backward compatibility with existing usage
|
|
45
59
|
*
|
|
46
60
|
* @example
|
|
@@ -74,6 +88,17 @@ interface Props {
|
|
|
74
88
|
* autoSwitchOnDisabled={true}
|
|
75
89
|
* />
|
|
76
90
|
* ```
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* // Wait for load - useful for modals to prevent reflow
|
|
95
|
+
* <Modal open={isOpen}>
|
|
96
|
+
* <DynamicComponent
|
|
97
|
+
* extension="ddk.modal.content"
|
|
98
|
+
* waitForLoad={true}
|
|
99
|
+
* />
|
|
100
|
+
* </Modal>
|
|
101
|
+
* ```
|
|
77
102
|
*/
|
|
78
103
|
export declare const DynamicComponent: React.FunctionComponent<Props>;
|
|
79
104
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-component.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-plugin/src/lib/components/dynamic-component/dynamic-component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC;;GAEG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamic-component.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-plugin/src/lib/components/dynamic-component/dynamic-component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC;;GAEG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAmE3D,CAAC"}
|
|
@@ -26,7 +26,8 @@ interface Props {
|
|
|
26
26
|
}
|
|
27
27
|
type DynamicComponentResult = [
|
|
28
28
|
React.FunctionComponent | null,
|
|
29
|
-
BasePluginExtension | null
|
|
29
|
+
BasePluginExtension | null,
|
|
30
|
+
boolean
|
|
30
31
|
];
|
|
31
32
|
/**
|
|
32
33
|
* React hook to resolve and lazily load a plugin component for a given extension point.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dynamic-component.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/hooks/use-dynamic-component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,qBAAqB,CAAC;AAI7B,UAAU,KAAK;IACb;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,iBAAiB,GAAG,IAAI;IAC9B,mBAAmB,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"use-dynamic-component.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/hooks/use-dynamic-component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,qBAAqB,CAAC;AAI7B,UAAU,KAAK;IACb;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,iBAAiB,GAAG,IAAI;IAC9B,mBAAmB,GAAG,IAAI;IAC1B,OAAO;CACR,CAAC;AASF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,qEAK7B,KAAK,2BAyEP,CAAC"}
|
|
@@ -18,6 +18,18 @@ export interface ExtensionComponentProps {
|
|
|
18
18
|
* Default: false
|
|
19
19
|
*/
|
|
20
20
|
autoSwitchOnDisabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to wait for component to load before rendering anything
|
|
23
|
+
* Useful for modals or containers that size based on content
|
|
24
|
+
* When true, returns null during loading instead of skeleton
|
|
25
|
+
* Default: false
|
|
26
|
+
*/
|
|
27
|
+
waitForLoad?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback when loading state changes
|
|
30
|
+
* Useful for parent components that need to know when content is ready
|
|
31
|
+
*/
|
|
32
|
+
onLoadingChange?: (isLoading: boolean) => void;
|
|
21
33
|
}
|
|
22
34
|
/**
|
|
23
35
|
* Hook that creates a strongly typed React component for an extension point
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-extension-component.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/hooks/use-extension-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-extension-component.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/hooks/use-extension-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,GAAG,GAAG,EACX,UAAU,GAAG,KAAK,EAClB,MAAM,GAAG,GAAG,EAEZ,UAAU,EAAE,wBAAwB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,GAC9D,KAAK,CAAC,aAAa,CAAC,uBAAuB,GAAG,MAAM,CAAC,GAAG,IAAI,CAqC9D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,GAAG,GAAG,EACX,UAAU,GAAG,KAAK,EAClB,MAAM,GAAG,GAAG,EAEZ,UAAU,EAAE,wBAAwB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,GAC9D,KAAK,CAAC,aAAa,CAAC,uBAAuB,GAAG,MAAM,CAAC,GAAG,IAAI,CAmC9D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,GAAG,GAAG,EACpD,gBAAgB,EAAE,MAAM,GACvB,KAAK,CAAC,aAAa,CAAC,uBAAuB,GAAG,MAAM,CAAC,GAAG,IAAI,CA6C9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-plugin",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"kos": {
|
|
23
23
|
"build": {
|
|
24
|
-
"gitHash": "
|
|
24
|
+
"gitHash": "64690ba2c6b001f5fc83da2097ce82acd489f618"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|