@servlyadmin/runtime-react 0.1.33 → 0.1.34
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/index.cjs +5 -0
- package/dist/index.js +7 -1
- package/package.json +3 -3
- package/dist/index.d.cts +0 -54
- package/dist/index.d.ts +0 -54
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,11 @@ var import_react = require("react");
|
|
|
41
41
|
var import_react_dom = require("react-dom");
|
|
42
42
|
var import_runtime_core = require("@servlyadmin/runtime-core");
|
|
43
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
if (typeof document !== "undefined") {
|
|
45
|
+
(0, import_runtime_core.injectTailwind)({ usePlayCdn: true }).catch((err) => {
|
|
46
|
+
console.warn("[ServlyComponent React] Failed to inject Tailwind:", err);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
44
49
|
var LoadingSkeleton = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
50
|
"div",
|
|
46
51
|
{
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,15 @@ import {
|
|
|
5
5
|
render,
|
|
6
6
|
fetchComponent,
|
|
7
7
|
waitForTailwind,
|
|
8
|
-
markElementReady
|
|
8
|
+
markElementReady,
|
|
9
|
+
injectTailwind
|
|
9
10
|
} from "@servlyadmin/runtime-core";
|
|
10
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
if (typeof document !== "undefined") {
|
|
13
|
+
injectTailwind({ usePlayCdn: true }).catch((err) => {
|
|
14
|
+
console.warn("[ServlyComponent React] Failed to inject Tailwind:", err);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
11
17
|
var LoadingSkeleton = ({ className }) => /* @__PURE__ */ jsx(
|
|
12
18
|
"div",
|
|
13
19
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servlyadmin/runtime-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"description": "React wrapper for Servly runtime renderer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-dom": ">=17.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@servlyadmin/runtime-core": "^0.1.
|
|
39
|
+
"@servlyadmin/runtime-core": "^0.1.44"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/react": "^18.2.0",
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"tsup": "^8.0.0",
|
|
47
47
|
"typescript": "^5.3.0"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
package/dist/index.d.cts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CacheStrategy, RetryConfig } from '@servlyadmin/runtime-core';
|
|
3
|
-
export { BindingContext, CacheStrategy, ComponentData, FetchOptions, LayoutElement, PropDefinition, RetryConfig, clearAllCaches, compareVersions, fetchComponent, getRegistryUrl, invalidateCache, isComponentAvailable, parseVersion, prefetchComponents, resolveVersion, satisfiesVersion, setRegistryUrl } from '@servlyadmin/runtime-core';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* ServlyComponent
|
|
7
|
-
* React wrapper for Servly runtime renderer with slot support
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Slot content type - React nodes keyed by slot name
|
|
12
|
-
*/
|
|
13
|
-
type SlotContent = Record<string, React.ReactNode>;
|
|
14
|
-
/**
|
|
15
|
-
* Props for ServlyComponent
|
|
16
|
-
*/
|
|
17
|
-
interface ServlyComponentProps<P = Record<string, any>> {
|
|
18
|
-
/** Component ID from the registry */
|
|
19
|
-
id: string;
|
|
20
|
-
/** Version specifier (exact, range, or "latest") */
|
|
21
|
-
version?: string;
|
|
22
|
-
/** Props to pass to the component */
|
|
23
|
-
props?: P;
|
|
24
|
-
/** Slot content - React nodes to portal into named slots */
|
|
25
|
-
slots?: SlotContent;
|
|
26
|
-
/** Fallback UI while loading or on error */
|
|
27
|
-
fallback?: React.ReactNode;
|
|
28
|
-
/** Error callback */
|
|
29
|
-
onError?: (error: Error) => void;
|
|
30
|
-
/** Load complete callback */
|
|
31
|
-
onLoad?: () => void;
|
|
32
|
-
/** Custom className for wrapper */
|
|
33
|
-
className?: string;
|
|
34
|
-
/** Custom styles for wrapper */
|
|
35
|
-
style?: React.CSSProperties;
|
|
36
|
-
/** Show loading skeleton */
|
|
37
|
-
showSkeleton?: boolean;
|
|
38
|
-
/** Cache strategy */
|
|
39
|
-
cacheStrategy?: CacheStrategy;
|
|
40
|
-
/** Retry configuration */
|
|
41
|
-
retryConfig?: Partial<RetryConfig>;
|
|
42
|
-
/** Event handlers keyed by element ID then event name */
|
|
43
|
-
eventHandlers?: Record<string, Record<string, (e: Event) => void>>;
|
|
44
|
-
/** Children - rendered into default slot if no slots prop */
|
|
45
|
-
children?: React.ReactNode;
|
|
46
|
-
/** Wait for Tailwind CSS to load before showing component (prevents FOUC) */
|
|
47
|
-
waitForStyles?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* ServlyComponent - React wrapper for Servly runtime with slot support
|
|
51
|
-
*/
|
|
52
|
-
declare function ServlyComponent<P = Record<string, any>>({ id, version, props, slots, fallback, onError, onLoad, className, style, showSkeleton, cacheStrategy, retryConfig, eventHandlers, children, waitForStyles, }: ServlyComponentProps<P>): React.ReactElement | null;
|
|
53
|
-
|
|
54
|
-
export { ServlyComponent, type ServlyComponentProps, ServlyComponent as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CacheStrategy, RetryConfig } from '@servlyadmin/runtime-core';
|
|
3
|
-
export { BindingContext, CacheStrategy, ComponentData, FetchOptions, LayoutElement, PropDefinition, RetryConfig, clearAllCaches, compareVersions, fetchComponent, getRegistryUrl, invalidateCache, isComponentAvailable, parseVersion, prefetchComponents, resolveVersion, satisfiesVersion, setRegistryUrl } from '@servlyadmin/runtime-core';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* ServlyComponent
|
|
7
|
-
* React wrapper for Servly runtime renderer with slot support
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Slot content type - React nodes keyed by slot name
|
|
12
|
-
*/
|
|
13
|
-
type SlotContent = Record<string, React.ReactNode>;
|
|
14
|
-
/**
|
|
15
|
-
* Props for ServlyComponent
|
|
16
|
-
*/
|
|
17
|
-
interface ServlyComponentProps<P = Record<string, any>> {
|
|
18
|
-
/** Component ID from the registry */
|
|
19
|
-
id: string;
|
|
20
|
-
/** Version specifier (exact, range, or "latest") */
|
|
21
|
-
version?: string;
|
|
22
|
-
/** Props to pass to the component */
|
|
23
|
-
props?: P;
|
|
24
|
-
/** Slot content - React nodes to portal into named slots */
|
|
25
|
-
slots?: SlotContent;
|
|
26
|
-
/** Fallback UI while loading or on error */
|
|
27
|
-
fallback?: React.ReactNode;
|
|
28
|
-
/** Error callback */
|
|
29
|
-
onError?: (error: Error) => void;
|
|
30
|
-
/** Load complete callback */
|
|
31
|
-
onLoad?: () => void;
|
|
32
|
-
/** Custom className for wrapper */
|
|
33
|
-
className?: string;
|
|
34
|
-
/** Custom styles for wrapper */
|
|
35
|
-
style?: React.CSSProperties;
|
|
36
|
-
/** Show loading skeleton */
|
|
37
|
-
showSkeleton?: boolean;
|
|
38
|
-
/** Cache strategy */
|
|
39
|
-
cacheStrategy?: CacheStrategy;
|
|
40
|
-
/** Retry configuration */
|
|
41
|
-
retryConfig?: Partial<RetryConfig>;
|
|
42
|
-
/** Event handlers keyed by element ID then event name */
|
|
43
|
-
eventHandlers?: Record<string, Record<string, (e: Event) => void>>;
|
|
44
|
-
/** Children - rendered into default slot if no slots prop */
|
|
45
|
-
children?: React.ReactNode;
|
|
46
|
-
/** Wait for Tailwind CSS to load before showing component (prevents FOUC) */
|
|
47
|
-
waitForStyles?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* ServlyComponent - React wrapper for Servly runtime with slot support
|
|
51
|
-
*/
|
|
52
|
-
declare function ServlyComponent<P = Record<string, any>>({ id, version, props, slots, fallback, onError, onLoad, className, style, showSkeleton, cacheStrategy, retryConfig, eventHandlers, children, waitForStyles, }: ServlyComponentProps<P>): React.ReactElement | null;
|
|
53
|
-
|
|
54
|
-
export { ServlyComponent, type ServlyComponentProps, ServlyComponent as default };
|