@safe-ugc-ui/react 0.6.0 → 1.0.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/index.d.ts +43 -5
- package/dist/index.js +623 -41
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -84,8 +84,15 @@ interface ColumnProps {
|
|
|
84
84
|
}
|
|
85
85
|
declare function Column({ style, hoverStyle, children }: ColumnProps): react_jsx_runtime.JSX.Element;
|
|
86
86
|
|
|
87
|
+
interface TextSpan {
|
|
88
|
+
text: string;
|
|
89
|
+
style?: CSSProperties;
|
|
90
|
+
}
|
|
87
91
|
interface TextComponentProps {
|
|
88
|
-
content
|
|
92
|
+
content?: string;
|
|
93
|
+
spans?: TextSpan[];
|
|
94
|
+
maxLines?: number;
|
|
95
|
+
truncate?: 'ellipsis' | 'clip';
|
|
89
96
|
style?: CSSProperties;
|
|
90
97
|
hoverStyle?: CSSProperties;
|
|
91
98
|
}
|
|
@@ -93,7 +100,7 @@ interface TextComponentProps {
|
|
|
93
100
|
* Renders text content safely. NEVER uses dangerouslySetInnerHTML.
|
|
94
101
|
* All content is rendered as text nodes via React's built-in escaping.
|
|
95
102
|
*/
|
|
96
|
-
declare function Text({ content, style, hoverStyle }: TextComponentProps): react_jsx_runtime.JSX.Element;
|
|
103
|
+
declare function Text({ content, spans, maxLines, truncate, style, hoverStyle, }: TextComponentProps): react_jsx_runtime.JSX.Element;
|
|
97
104
|
|
|
98
105
|
interface ImageComponentProps {
|
|
99
106
|
src: string;
|
|
@@ -209,11 +216,40 @@ interface ToggleProps {
|
|
|
209
216
|
}
|
|
210
217
|
declare function Toggle({ value, onToggle, onAction, disabled, style, hoverStyle }: ToggleProps): react_jsx_runtime.JSX.Element;
|
|
211
218
|
|
|
219
|
+
interface AccordionItem {
|
|
220
|
+
id: string;
|
|
221
|
+
label: string;
|
|
222
|
+
content?: ReactNode;
|
|
223
|
+
disabled?: boolean;
|
|
224
|
+
}
|
|
225
|
+
interface AccordionProps {
|
|
226
|
+
items: AccordionItem[];
|
|
227
|
+
allowMultiple?: boolean;
|
|
228
|
+
defaultExpanded?: string[];
|
|
229
|
+
style?: CSSProperties;
|
|
230
|
+
hoverStyle?: CSSProperties;
|
|
231
|
+
}
|
|
232
|
+
declare function Accordion({ items, allowMultiple, defaultExpanded, style, hoverStyle, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
|
|
234
|
+
interface TabsItem {
|
|
235
|
+
id: string;
|
|
236
|
+
label: string;
|
|
237
|
+
content?: ReactNode;
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
}
|
|
240
|
+
interface TabsProps {
|
|
241
|
+
tabs: TabsItem[];
|
|
242
|
+
defaultTab?: string;
|
|
243
|
+
style?: CSSProperties;
|
|
244
|
+
hoverStyle?: CSSProperties;
|
|
245
|
+
}
|
|
246
|
+
declare function Tabs({ tabs, defaultTab, style, hoverStyle, }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
247
|
+
|
|
212
248
|
/**
|
|
213
249
|
* @safe-ugc-ui/react --- Node Renderer
|
|
214
250
|
*
|
|
215
251
|
* Recursive renderer that maps UGC node types to React components.
|
|
216
|
-
* Supports all
|
|
252
|
+
* Supports all currently implemented component types, for-loop rendering, style reference merge,
|
|
217
253
|
* and runtime limits pre-check.
|
|
218
254
|
*
|
|
219
255
|
* For each node:
|
|
@@ -241,6 +277,8 @@ interface RenderContext {
|
|
|
241
277
|
assets: AssetMap;
|
|
242
278
|
locals?: Record<string, unknown>;
|
|
243
279
|
cardStyles?: Record<string, Record<string, unknown>>;
|
|
280
|
+
fragments?: Record<string, unknown>;
|
|
281
|
+
fragmentStack?: string[];
|
|
244
282
|
iconResolver?: (name: string) => ReactNode;
|
|
245
283
|
onAction?: (type: string, actionId: string, payload?: unknown) => void;
|
|
246
284
|
onError?: (errors: Array<{
|
|
@@ -278,7 +316,7 @@ declare function renderTree(rootNode: unknown, state: Record<string, unknown>, a
|
|
|
278
316
|
path: string;
|
|
279
317
|
}>) => void, responsive?: {
|
|
280
318
|
compact: boolean;
|
|
281
|
-
}): ReactNode;
|
|
319
|
+
}, fragments?: Record<string, unknown>): ReactNode;
|
|
282
320
|
|
|
283
321
|
/**
|
|
284
322
|
* @safe-ugc-ui/react — State Resolver
|
|
@@ -331,4 +369,4 @@ declare function resolveValue(value: unknown, state: Record<string, unknown>, lo
|
|
|
331
369
|
*/
|
|
332
370
|
declare function mapStyle(style: Record<string, unknown> | undefined, state: Record<string, unknown>, locals?: Record<string, unknown>): CSSProperties;
|
|
333
371
|
|
|
334
|
-
export { type AssetMap, Avatar, Badge, Box, Button, Chip, Column, Divider, Grid, Icon, Image, ProgressBar, type RenderContext, Row, type RuntimeLimits, Spacer, Stack, Text, Toggle, UGCContainer, UGCRenderer, type UGCRendererProps, mapStyle, renderNode, renderTree, resolveAsset, resolveRef, resolveValue };
|
|
372
|
+
export { Accordion, type AssetMap, Avatar, Badge, Box, Button, Chip, Column, Divider, Grid, Icon, Image, ProgressBar, type RenderContext, Row, type RuntimeLimits, Spacer, Stack, Tabs, Text, Toggle, UGCContainer, UGCRenderer, type UGCRendererProps, mapStyle, renderNode, renderTree, resolveAsset, resolveRef, resolveValue };
|