@uniformdev/canvas-react 19.35.2 → 19.36.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.mts +394 -0
- package/dist/index.d.ts +3 -5
- package/package.json +6 -6
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import React$1, { Key, ReactNode, PropsWithChildren } from 'react';
|
|
2
|
+
import * as _uniformdev_canvas from '@uniformdev/canvas';
|
|
3
|
+
import { ComponentInstance, RootComponentInstance, UpdateCompositionMessage, getParameterAttributes as getParameterAttributes$1, SubscribeToCompositionOptions } from '@uniformdev/canvas';
|
|
4
|
+
export { GetParameterAttributesProps, createUniformApiEnhancer } from '@uniformdev/canvas';
|
|
5
|
+
import { RichTextNode } from '@uniformdev/richtext';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props passed to a Canvas component implementation.
|
|
9
|
+
* TProps is the Canvas component's parameters object after
|
|
10
|
+
* all enhancers have been applied.
|
|
11
|
+
*/
|
|
12
|
+
type ComponentProps<TProps = unknown> = TProps & {
|
|
13
|
+
component: ComponentInstance;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Function that maps a Canvas component instance to its React component to render it.
|
|
17
|
+
* The resolver would commonly inspect the `type` and possibly `variant` of the component to decide.
|
|
18
|
+
*/
|
|
19
|
+
type RenderComponentResolver = (component: ComponentInstance) => React.ComponentType<ComponentProps<any>> | null;
|
|
20
|
+
/** Function that renders Canvas system internals */
|
|
21
|
+
type SystemRenderFunction = (component: ComponentInstance, key: Key, renderChild: (component: ComponentInstance, key: Key) => JSX.Element | null) => JSX.Element | null;
|
|
22
|
+
/** Configures rendering of system components (tests, pz) */
|
|
23
|
+
type SystemRenderConfig = {
|
|
24
|
+
test: SystemRenderFunction;
|
|
25
|
+
personalization: SystemRenderFunction;
|
|
26
|
+
};
|
|
27
|
+
type ComponentStore = {
|
|
28
|
+
register: (options: {
|
|
29
|
+
type: string;
|
|
30
|
+
variantId?: string;
|
|
31
|
+
component: React.ComponentType<ComponentProps<any>>;
|
|
32
|
+
}) => void;
|
|
33
|
+
get: (type: string, variantId?: string) => React.ComponentType<ComponentProps<any>> | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A default implementation of a component-not-implemented component.
|
|
38
|
+
* Useful for model-first workflows where frontend dev comes later.
|
|
39
|
+
* To make this work, it needs to be the default returned from the
|
|
40
|
+
* resolveRenderer() function when the component is unknown.
|
|
41
|
+
**/
|
|
42
|
+
declare function DefaultNotImplementedComponent(props: ComponentProps): React$1.JSX.Element | null;
|
|
43
|
+
|
|
44
|
+
type ParameterTextValue = string | undefined;
|
|
45
|
+
type UniformTextProps = {
|
|
46
|
+
/**
|
|
47
|
+
* The name of the HTML tag to render.
|
|
48
|
+
* @default "span"
|
|
49
|
+
*/
|
|
50
|
+
as?: React$1.ElementType;
|
|
51
|
+
/** The ID of the parameter. */
|
|
52
|
+
parameterId: string;
|
|
53
|
+
/**
|
|
54
|
+
* When set to true, it adds `whiteSpace: 'pre-wrap'` to the styles of the root element to allow the rendering of line breaks.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
isMultiline?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
60
|
+
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
61
|
+
* @default undefined
|
|
62
|
+
*/
|
|
63
|
+
placeholder?: string | ((parameter: {
|
|
64
|
+
id: string;
|
|
65
|
+
}) => string | undefined);
|
|
66
|
+
/**
|
|
67
|
+
* A function to customize the rendering of the parameter value. Useful to format the value before rendering it.
|
|
68
|
+
* @default "(value) => value"
|
|
69
|
+
*/
|
|
70
|
+
render?: (value: ParameterTextValue) => React$1.ReactNode;
|
|
71
|
+
} & Omit<React$1.HTMLAttributes<HTMLSpanElement>, 'children' | 'placeholder'>;
|
|
72
|
+
/**
|
|
73
|
+
* Renders text parameters. Offers inline editing capability out of the box.
|
|
74
|
+
*/
|
|
75
|
+
declare const UniformText: ({ as: Tag, parameterId, isMultiline, placeholder, render, ...props }: UniformTextProps) => React$1.JSX.Element | null;
|
|
76
|
+
|
|
77
|
+
type UniformComponentProps<TRenderProps = unknown> = {
|
|
78
|
+
/** The data of the component instance */
|
|
79
|
+
data?: ComponentInstance | RootComponentInstance;
|
|
80
|
+
/** Resolves a React component to render a Canvas component, generally by inspecting type/variant */
|
|
81
|
+
resolveRenderer?: RenderComponentResolver;
|
|
82
|
+
/** Children to render. Can also be a function that takes ComponentProps as argument */
|
|
83
|
+
children?: ReactNode | ((props: ComponentProps<TRenderProps>) => JSX.Element);
|
|
84
|
+
/**
|
|
85
|
+
* When to track behavior from enrichment tags on the current composition
|
|
86
|
+
* onView: adds enrichment score when the visitor views the tagged component in the browser viewport.
|
|
87
|
+
* onLoad: adds enrichment score as soon as the component mounts, regardless of viewport.
|
|
88
|
+
*
|
|
89
|
+
* NOTE: onView renders a `<div>` tag around components that have enrichment tags, to support IntersectionObserver.
|
|
90
|
+
* onLoad does not need to do this, and renders no wrapping tag.
|
|
91
|
+
*
|
|
92
|
+
* Default: onView
|
|
93
|
+
*/
|
|
94
|
+
behaviorTracking?: 'onLoad' | 'onView';
|
|
95
|
+
/**
|
|
96
|
+
* The default placeholder to pass to the parameter component that support inline editing (such as UniformText).
|
|
97
|
+
*/
|
|
98
|
+
contextualEditingDefaultPlaceholder?: UniformTextProps['placeholder'];
|
|
99
|
+
};
|
|
100
|
+
type UniformComponentContextValue = {
|
|
101
|
+
data?: UniformComponentProps['data'];
|
|
102
|
+
resolveRenderer?: UniformComponentProps['resolveRenderer'];
|
|
103
|
+
behaviorTracking?: UniformComponentProps['behaviorTracking'];
|
|
104
|
+
contextualEditingDefaultPlaceholder?: UniformComponentProps['contextualEditingDefaultPlaceholder'];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Gets the data of the closest `<UniformComponent />` ancestor.
|
|
108
|
+
*/
|
|
109
|
+
declare function useUniformCurrentComponent(): UniformComponentContextValue;
|
|
110
|
+
/**
|
|
111
|
+
* Allows the rendering of a Canvas component instance (root or not), and its children if it has any.
|
|
112
|
+
* Note that the actual rendering happens inside `<UniformSlot />`, this component only provides the services needed to achieve that.
|
|
113
|
+
* This component is used internally by `<UniformComposition />`, which you should use in most cases.
|
|
114
|
+
*/
|
|
115
|
+
declare function UniformComponent<TRenderProps = unknown>({ data, resolveRenderer, children, behaviorTracking, contextualEditingDefaultPlaceholder, }: UniformComponentProps<TRenderProps>): React$1.JSX.Element | null;
|
|
116
|
+
|
|
117
|
+
type UseUniformContextualEditingProps = {
|
|
118
|
+
initialCompositionValue?: RootComponentInstance;
|
|
119
|
+
/**
|
|
120
|
+
* A function to enhance the composition after receiving it from Canvas editor.
|
|
121
|
+
* WARNING: This enhancer will run on the client side. Make sure you're not exposing any secrets. You can use `createApiEnhancer` to create an enhancer based on an API route.
|
|
122
|
+
*/
|
|
123
|
+
enhance?: ({ composition, hash, }: Pick<UpdateCompositionMessage, 'composition' | 'hash'>) => RootComponentInstance | Promise<RootComponentInstance>;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Adds contextual editing capability to a Uniform app.
|
|
127
|
+
* This hook is already integrated in `<UniformComposition />`, you won't need to use it directly, unless you have a custom setup.
|
|
128
|
+
*/
|
|
129
|
+
declare const useUniformContextualEditing: ({ initialCompositionValue, enhance, }: UseUniformContextualEditingProps) => {
|
|
130
|
+
composition: {
|
|
131
|
+
type: string;
|
|
132
|
+
parameters?: {
|
|
133
|
+
[key: string]: {
|
|
134
|
+
value: unknown;
|
|
135
|
+
type: string;
|
|
136
|
+
connectedData?: {
|
|
137
|
+
pointer: string;
|
|
138
|
+
syntax: "jptr";
|
|
139
|
+
} | undefined;
|
|
140
|
+
};
|
|
141
|
+
} | undefined;
|
|
142
|
+
variant?: string | undefined;
|
|
143
|
+
projectMapNodes?: {
|
|
144
|
+
id: string;
|
|
145
|
+
path: string;
|
|
146
|
+
projectMapId: string;
|
|
147
|
+
}[] | undefined;
|
|
148
|
+
slots?: {
|
|
149
|
+
[key: string]: {
|
|
150
|
+
type: string;
|
|
151
|
+
parameters?: {
|
|
152
|
+
[key: string]: {
|
|
153
|
+
value: unknown;
|
|
154
|
+
type: string;
|
|
155
|
+
connectedData?: {
|
|
156
|
+
pointer: string;
|
|
157
|
+
syntax: "jptr";
|
|
158
|
+
} | undefined;
|
|
159
|
+
};
|
|
160
|
+
} | undefined;
|
|
161
|
+
variant?: string | undefined;
|
|
162
|
+
slots?: {
|
|
163
|
+
[key: string]: any[];
|
|
164
|
+
} | undefined;
|
|
165
|
+
_id?: string | undefined;
|
|
166
|
+
_pattern?: string | undefined;
|
|
167
|
+
_dataResources?: {
|
|
168
|
+
[key: string]: {
|
|
169
|
+
type: string;
|
|
170
|
+
isPatternParameter?: boolean | undefined;
|
|
171
|
+
ignorePatternParameterDefault?: boolean | undefined;
|
|
172
|
+
variables?: {
|
|
173
|
+
[key: string]: string;
|
|
174
|
+
} | undefined;
|
|
175
|
+
};
|
|
176
|
+
} | undefined;
|
|
177
|
+
_patternDataResources?: {
|
|
178
|
+
[key: string]: {
|
|
179
|
+
type: string;
|
|
180
|
+
isPatternParameter?: boolean | undefined;
|
|
181
|
+
ignorePatternParameterDefault?: boolean | undefined;
|
|
182
|
+
variables?: {
|
|
183
|
+
[key: string]: string;
|
|
184
|
+
} | undefined;
|
|
185
|
+
};
|
|
186
|
+
} | undefined;
|
|
187
|
+
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
188
|
+
_overrides?: {
|
|
189
|
+
[key: string]: {
|
|
190
|
+
parameters?: {
|
|
191
|
+
[key: string]: {
|
|
192
|
+
value: unknown;
|
|
193
|
+
type: string;
|
|
194
|
+
connectedData?: {
|
|
195
|
+
pointer: string;
|
|
196
|
+
syntax: "jptr";
|
|
197
|
+
} | undefined;
|
|
198
|
+
};
|
|
199
|
+
} | undefined;
|
|
200
|
+
variant?: string | undefined;
|
|
201
|
+
};
|
|
202
|
+
} | undefined;
|
|
203
|
+
_overridability?: {
|
|
204
|
+
parameters?: {
|
|
205
|
+
[key: string]: "yes" | "no";
|
|
206
|
+
} | undefined;
|
|
207
|
+
variants?: boolean | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
}[];
|
|
210
|
+
} | undefined;
|
|
211
|
+
_id: string;
|
|
212
|
+
_slug?: string | null | undefined;
|
|
213
|
+
_name: string;
|
|
214
|
+
_dataResources?: {
|
|
215
|
+
[key: string]: {
|
|
216
|
+
type: string;
|
|
217
|
+
isPatternParameter?: boolean | undefined;
|
|
218
|
+
ignorePatternParameterDefault?: boolean | undefined;
|
|
219
|
+
variables?: {
|
|
220
|
+
[key: string]: string;
|
|
221
|
+
} | undefined;
|
|
222
|
+
};
|
|
223
|
+
} | undefined;
|
|
224
|
+
_overrides?: {
|
|
225
|
+
[key: string]: {
|
|
226
|
+
parameters?: {
|
|
227
|
+
[key: string]: {
|
|
228
|
+
value: unknown;
|
|
229
|
+
type: string;
|
|
230
|
+
connectedData?: {
|
|
231
|
+
pointer: string;
|
|
232
|
+
syntax: "jptr";
|
|
233
|
+
} | undefined;
|
|
234
|
+
};
|
|
235
|
+
} | undefined;
|
|
236
|
+
variant?: string | undefined;
|
|
237
|
+
};
|
|
238
|
+
} | undefined;
|
|
239
|
+
_overridability?: {
|
|
240
|
+
parameters?: {
|
|
241
|
+
[key: string]: "yes" | "no";
|
|
242
|
+
} | undefined;
|
|
243
|
+
variants?: boolean | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
} | undefined;
|
|
246
|
+
isContextualEditing: boolean;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
type UniformCompositionProps<TRenderProps = unknown> = UniformComponentProps<TRenderProps> & {
|
|
250
|
+
/** The composition data */
|
|
251
|
+
data?: RootComponentInstance;
|
|
252
|
+
contextualEditingEnhancer?: UseUniformContextualEditingProps['enhance'];
|
|
253
|
+
};
|
|
254
|
+
type UniformCompositionContextValue = {
|
|
255
|
+
data: UniformCompositionProps['data'] | undefined;
|
|
256
|
+
resolveRenderer?: UniformCompositionProps['resolveRenderer'];
|
|
257
|
+
behaviorTracking?: UniformCompositionProps['behaviorTracking'];
|
|
258
|
+
isContextualEditing: boolean;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Gets the data of the closest `<UniformComposition />` ancestor.
|
|
262
|
+
*/
|
|
263
|
+
declare function useUniformCurrentComposition(): UniformCompositionContextValue;
|
|
264
|
+
/**
|
|
265
|
+
* The main component to render a Canvas composition.
|
|
266
|
+
* It renders the full tree of components, and provides some services to the children, such as `useUniformCurrentComposition`.
|
|
267
|
+
* It also takes care of enabling [Contextual Editing](https://docs.uniform.app/capabilities/composition/contextual-editing).
|
|
268
|
+
*/
|
|
269
|
+
declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
|
|
270
|
+
|
|
271
|
+
type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
|
|
272
|
+
node: TNode;
|
|
273
|
+
};
|
|
274
|
+
type RichTextRendererComponent<TNode extends RichTextNode = RichTextNode> = React$1.ComponentType<PropsWithChildren<RichTextComponentProps<TNode>>>;
|
|
275
|
+
/**
|
|
276
|
+
* Function that maps a Rich Text node instance to its React component to render it.
|
|
277
|
+
* The resolver would commonly inspect the `type` of the component to decide.
|
|
278
|
+
*/
|
|
279
|
+
type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererComponent | null | undefined;
|
|
280
|
+
|
|
281
|
+
type UniformRichTextProps = {
|
|
282
|
+
/**
|
|
283
|
+
* The name of the HTML tag to render.
|
|
284
|
+
* @default "div"
|
|
285
|
+
*/
|
|
286
|
+
as?: React$1.ElementType;
|
|
287
|
+
/** The ID of the parameter. */
|
|
288
|
+
parameterId: string;
|
|
289
|
+
/**
|
|
290
|
+
* A function which can provide a custom react component
|
|
291
|
+
* for rendering a rich text node
|
|
292
|
+
*/
|
|
293
|
+
resolveRichTextRenderer?: RenderRichTextComponentResolver;
|
|
294
|
+
} & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
295
|
+
/**
|
|
296
|
+
* Adds rendering support for Uniform Rich Text parameters
|
|
297
|
+
*/
|
|
298
|
+
declare const UniformRichText: React$1.ForwardRefExoticComponent<{
|
|
299
|
+
/**
|
|
300
|
+
* The name of the HTML tag to render.
|
|
301
|
+
* @default "div"
|
|
302
|
+
*/
|
|
303
|
+
as?: React$1.ElementType<any> | undefined;
|
|
304
|
+
/** The ID of the parameter. */
|
|
305
|
+
parameterId: string;
|
|
306
|
+
/**
|
|
307
|
+
* A function which can provide a custom react component
|
|
308
|
+
* for rendering a rich text node
|
|
309
|
+
*/
|
|
310
|
+
resolveRichTextRenderer?: RenderRichTextComponentResolver | undefined;
|
|
311
|
+
} & Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & React$1.RefAttributes<unknown>>;
|
|
312
|
+
|
|
313
|
+
type UniformRichTextNodeProps = {
|
|
314
|
+
node: RichTextNode;
|
|
315
|
+
resolveRichTextRenderer?: RenderRichTextComponentResolver;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Render a single RichText node
|
|
319
|
+
*/
|
|
320
|
+
declare function UniformRichTextNode({ node, ...props }: UniformRichTextNodeProps): React$1.JSX.Element | null;
|
|
321
|
+
|
|
322
|
+
type CustomSlotChildRenderFunc = (options: {
|
|
323
|
+
child: ReactNode;
|
|
324
|
+
component: ComponentInstance;
|
|
325
|
+
key: Key;
|
|
326
|
+
}) => JSX.Element;
|
|
327
|
+
type UniformSlotProps<TSlotNames extends string> = {
|
|
328
|
+
/** Name of the slot to render */
|
|
329
|
+
name: TSlotNames;
|
|
330
|
+
/**
|
|
331
|
+
* Function to resolve the React component to render for a given Canvas component type.
|
|
332
|
+
* If not specified, the resolveRenderer function on the nearest Layout will be used, if any.
|
|
333
|
+
*/
|
|
334
|
+
resolveRenderer?: RenderComponentResolver;
|
|
335
|
+
/** Optional render props enables wrapping all child components in the slot with some markup */
|
|
336
|
+
children?: CustomSlotChildRenderFunc;
|
|
337
|
+
/**
|
|
338
|
+
* Optional ReactNode to use as a placeholder in Canvas editor when the slot is empty.
|
|
339
|
+
* The node is used to render a placeholder with realistic dimensions and it's never shown to users.
|
|
340
|
+
* Pass `null` to disable the placeholder.
|
|
341
|
+
*/
|
|
342
|
+
emptyPlaceholder?: React$1.ReactNode;
|
|
343
|
+
};
|
|
344
|
+
/** Renders a named Slot within a Composition. */
|
|
345
|
+
declare function UniformSlot<TSlotNames extends string = string>({ name, resolveRenderer, children, emptyPlaceholder, }: UniformSlotProps<TSlotNames>): JSX.Element | null;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Returns the attributes needed to annotate a Uniform parameter for inline editing.
|
|
349
|
+
* Supports only text parameters at the moment.
|
|
350
|
+
*/
|
|
351
|
+
declare const getParameterAttributes: typeof getParameterAttributes$1;
|
|
352
|
+
|
|
353
|
+
type UseCompositionEventEffectOptions = Omit<Partial<SubscribeToCompositionOptions>, 'callback'> & {
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
effect: () => void;
|
|
356
|
+
};
|
|
357
|
+
/** Hook to manage a subscription to a realtime event on a composition */
|
|
358
|
+
declare function useCompositionEventEffect({ enabled, projectId, compositionId, effect, }: UseCompositionEventEffectOptions): void;
|
|
359
|
+
|
|
360
|
+
type UseUniformContextualEditingStateProps = {
|
|
361
|
+
/**
|
|
362
|
+
* When set to true, the hook will return the global contextual state no matter where its used.
|
|
363
|
+
* When set to false, it will return only the state relevant to the current component (determined using `useUniformCurrentComponent`).
|
|
364
|
+
* @default false
|
|
365
|
+
**/
|
|
366
|
+
global?: boolean;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Returns the state of contextual editing, when the app is open inside Canvas Editor.
|
|
370
|
+
* This hook can be used to improve the editing experience of your team.
|
|
371
|
+
* For example: You can use `selectedComponentReference` to control which element to show inside a carousel or an accordion.
|
|
372
|
+
*/
|
|
373
|
+
declare const useUniformContextualEditingState: ({ global, }?: UseUniformContextualEditingStateProps) => {
|
|
374
|
+
isContextualEditing: boolean;
|
|
375
|
+
selectedComponentReference: Omit<_uniformdev_canvas.ContextualEditingComponentReference, "elements"> | undefined;
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
declare const componentStore: ComponentStore;
|
|
379
|
+
declare const registerUniformComponent: ({ type, variantId, component, }: {
|
|
380
|
+
type: string;
|
|
381
|
+
variantId?: string | undefined;
|
|
382
|
+
component: React.ComponentType<ComponentProps<any>>;
|
|
383
|
+
}) => void;
|
|
384
|
+
declare const componentStoreResolver: RenderComponentResolver;
|
|
385
|
+
|
|
386
|
+
/** Can be used to override default component Not Implemented fallback */
|
|
387
|
+
declare const NOT_IMPLEMENTED_COMPONENT = "__not_implemented__";
|
|
388
|
+
declare const createComponentStore: () => ComponentStore;
|
|
389
|
+
declare const createComponentStoreResolver: (options: {
|
|
390
|
+
store: ComponentStore;
|
|
391
|
+
defaultComponent?: React$1.ComponentType<ComponentProps<any>>;
|
|
392
|
+
}) => RenderComponentResolver;
|
|
393
|
+
|
|
394
|
+
export { ComponentProps, ComponentStore, DefaultNotImplementedComponent, NOT_IMPLEMENTED_COMPONENT, RenderComponentResolver, RenderRichTextComponentResolver, RichTextComponentProps, RichTextRendererComponent, SystemRenderConfig, SystemRenderFunction, UniformComponent, UniformComponentContextValue, UniformComponentProps, UniformComposition, UniformCompositionProps, UniformRichText, UniformRichTextNode, UniformRichTextNodeProps, UniformRichTextProps, UniformSlot, UniformSlotProps, UniformText, UniformTextProps, UseCompositionEventEffectOptions, UseUniformContextualEditingProps, UseUniformContextualEditingStateProps, componentStore, componentStoreResolver, createComponentStore, createComponentStoreResolver, getParameterAttributes, registerUniformComponent, useCompositionEventEffect, useUniformContextualEditing, useUniformContextualEditingState, useUniformCurrentComponent, useUniformCurrentComposition };
|
package/dist/index.d.ts
CHANGED
|
@@ -70,9 +70,8 @@ type UniformTextProps = {
|
|
|
70
70
|
render?: (value: ParameterTextValue) => React$1.ReactNode;
|
|
71
71
|
} & Omit<React$1.HTMLAttributes<HTMLSpanElement>, 'children' | 'placeholder'>;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
**/
|
|
73
|
+
* Renders text parameters. Offers inline editing capability out of the box.
|
|
74
|
+
*/
|
|
76
75
|
declare const UniformText: ({ as: Tag, parameterId, isMultiline, placeholder, render, ...props }: UniformTextProps) => React$1.JSX.Element | null;
|
|
77
76
|
|
|
78
77
|
type UniformComponentProps<TRenderProps = unknown> = {
|
|
@@ -348,8 +347,7 @@ declare function UniformSlot<TSlotNames extends string = string>({ name, resolve
|
|
|
348
347
|
/**
|
|
349
348
|
* Returns the attributes needed to annotate a Uniform parameter for inline editing.
|
|
350
349
|
* Supports only text parameters at the moment.
|
|
351
|
-
|
|
352
|
-
**/
|
|
350
|
+
*/
|
|
353
351
|
declare const getParameterAttributes: typeof getParameterAttributes$1;
|
|
354
352
|
|
|
355
353
|
type UseCompositionEventEffectOptions = Omit<Partial<SubscribeToCompositionOptions>, 'callback'> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.36.0",
|
|
4
4
|
"description": "React SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"document": "api-extractor run --local"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@uniformdev/canvas": "19.
|
|
28
|
-
"@uniformdev/context": "19.
|
|
29
|
-
"@uniformdev/context-react": "19.
|
|
30
|
-
"@uniformdev/richtext": "19.
|
|
27
|
+
"@uniformdev/canvas": "19.36.0",
|
|
28
|
+
"@uniformdev/context": "19.36.0",
|
|
29
|
+
"@uniformdev/context-react": "19.36.0",
|
|
30
|
+
"@uniformdev/richtext": "19.36.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">= 16 || 17 || 18",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3ae246a7f0f39adeaf04ecba4c7e48c478c019ad"
|
|
48
48
|
}
|