@uniformdev/canvas-react 19.173.1-alpha.17 → 19.173.2-alpha.210

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 CHANGED
@@ -110,64 +110,64 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
110
110
  connectedData?: {
111
111
  pointer: string;
112
112
  syntax: "jptr";
113
- failureAction?: "a" | "p" | "t" | "c" | undefined;
114
- failureLogLevel?: "i" | "e" | "w" | undefined;
115
- failureDefault?: string | undefined;
116
- } | undefined;
113
+ failureAction?: "t" | "p" | "c" | "a";
114
+ failureLogLevel?: "e" | "w" | "i";
115
+ failureDefault?: string;
116
+ };
117
117
  locales?: {
118
118
  [key: string]: unknown;
119
- } | undefined;
119
+ };
120
120
  conditions?: {
121
121
  when: {
122
- op?: "&" | "|" | undefined;
123
- clauses: (any | {
122
+ op?: "&" | "|";
123
+ clauses: ({
124
124
  rule: string;
125
- source?: string | undefined;
125
+ source?: string;
126
126
  op: string;
127
127
  value: string | string[];
128
- })[];
128
+ } | any)[];
129
129
  };
130
130
  value: unknown;
131
131
  id: number;
132
- }[] | undefined;
132
+ }[];
133
133
  localesConditions?: {
134
134
  [key: string]: {
135
135
  when: {
136
- op?: "&" | "|" | undefined;
137
- clauses: (any | {
136
+ op?: "&" | "|";
137
+ clauses: ({
138
138
  rule: string;
139
- source?: string | undefined;
139
+ source?: string;
140
140
  op: string;
141
141
  value: string | string[];
142
- })[];
142
+ } | any)[];
143
143
  };
144
144
  value: unknown;
145
145
  id: number;
146
146
  }[];
147
- } | undefined;
147
+ };
148
148
  };
149
- } | undefined;
150
- variant?: string | undefined;
149
+ };
150
+ variant?: string;
151
151
  projectMapNodes?: {
152
152
  id: string;
153
153
  path: string;
154
154
  projectMapId: string;
155
155
  data?: {
156
- isSearchHit?: boolean | undefined;
156
+ isSearchHit?: boolean;
157
157
  queryStrings?: {
158
158
  name: string;
159
- value?: string | undefined;
160
- helpText?: string | undefined;
161
- }[] | undefined;
162
- previewValue?: string | undefined;
163
- } | undefined;
159
+ value?: string;
160
+ helpText?: string;
161
+ }[];
162
+ previewValue?: string;
163
+ };
164
164
  locales?: {
165
165
  [key: string]: {
166
166
  path: string;
167
167
  inherited: boolean;
168
168
  };
169
- } | undefined;
170
- }[] | undefined;
169
+ };
170
+ }[];
171
171
  slots?: {
172
172
  [key: string]: {
173
173
  type: string;
@@ -178,72 +178,74 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
178
178
  connectedData?: {
179
179
  pointer: string;
180
180
  syntax: "jptr";
181
- failureAction?: "a" | "p" | "t" | "c" | undefined;
182
- failureLogLevel?: "i" | "e" | "w" | undefined;
183
- failureDefault?: string | undefined;
184
- } | undefined;
181
+ failureAction?: "t" | "p" | "c" | "a";
182
+ failureLogLevel?: "e" | "w" | "i";
183
+ failureDefault?: string;
184
+ };
185
185
  locales?: {
186
186
  [key: string]: unknown;
187
- } | undefined;
187
+ };
188
188
  conditions?: {
189
189
  when: {
190
- op?: "&" | "|" | undefined;
191
- clauses: (any | {
190
+ op?: "&" | "|";
191
+ clauses: ({
192
192
  rule: string;
193
- source?: string | undefined;
193
+ source?: string;
194
194
  op: string;
195
195
  value: string | string[];
196
- })[];
196
+ } | any)[];
197
197
  };
198
198
  value: unknown;
199
199
  id: number;
200
- }[] | undefined;
200
+ }[];
201
201
  localesConditions?: {
202
202
  [key: string]: {
203
203
  when: {
204
- op?: "&" | "|" | undefined;
205
- clauses: (any | {
204
+ op?: "&" | "|";
205
+ clauses: ({
206
206
  rule: string;
207
- source?: string | undefined;
207
+ source?: string;
208
208
  op: string;
209
209
  value: string | string[];
210
- })[];
210
+ } | any)[];
211
211
  };
212
212
  value: unknown;
213
213
  id: number;
214
214
  }[];
215
- } | undefined;
215
+ };
216
216
  };
217
- } | undefined;
218
- variant?: string | undefined;
217
+ };
218
+ variant?: string;
219
219
  slots?: {
220
220
  [key: string]: any[];
221
- } | undefined;
222
- _id?: string | undefined;
223
- _pattern?: string | undefined;
221
+ };
222
+ _id?: string;
223
+ _pattern?: string;
224
224
  _dataResources?: {
225
225
  [key: string]: {
226
226
  type: string;
227
- isPatternParameter?: boolean | undefined;
228
- ignorePatternParameterDefault?: boolean | undefined;
229
- optionalPatternParameter?: boolean | undefined;
227
+ isPatternParameter?: boolean;
228
+ ignorePatternParameterDefault?: boolean;
229
+ optionalPatternParameter?: boolean;
230
+ dataSourceVariant?: "unpublished";
230
231
  variables?: {
231
232
  [key: string]: string;
232
- } | undefined;
233
+ };
233
234
  };
234
- } | undefined;
235
+ };
235
236
  _patternDataResources?: {
236
237
  [key: string]: {
237
238
  type: string;
238
- isPatternParameter?: boolean | undefined;
239
- ignorePatternParameterDefault?: boolean | undefined;
240
- optionalPatternParameter?: boolean | undefined;
239
+ isPatternParameter?: boolean;
240
+ ignorePatternParameterDefault?: boolean;
241
+ optionalPatternParameter?: boolean;
242
+ dataSourceVariant?: "unpublished";
241
243
  variables?: {
242
244
  [key: string]: string;
243
- } | undefined;
245
+ };
244
246
  };
245
- } | undefined;
246
- _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
247
+ };
248
+ _patternError?: "NOTFOUND" | "CYCLIC";
247
249
  _overrides?: {
248
250
  [key: string]: {
249
251
  parameters?: {
@@ -253,90 +255,92 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
253
255
  connectedData?: {
254
256
  pointer: string;
255
257
  syntax: "jptr";
256
- failureAction?: "a" | "p" | "t" | "c" | undefined;
257
- failureLogLevel?: "i" | "e" | "w" | undefined;
258
- failureDefault?: string | undefined;
259
- } | undefined;
258
+ failureAction?: "t" | "p" | "c" | "a";
259
+ failureLogLevel?: "e" | "w" | "i";
260
+ failureDefault?: string;
261
+ };
260
262
  locales?: {
261
263
  [key: string]: unknown;
262
- } | undefined;
264
+ };
263
265
  conditions?: {
264
266
  when: {
265
- op?: "&" | "|" | undefined;
266
- clauses: (any | {
267
+ op?: "&" | "|";
268
+ clauses: ({
267
269
  rule: string;
268
- source?: string | undefined;
270
+ source?: string;
269
271
  op: string;
270
272
  value: string | string[];
271
- })[];
273
+ } | any)[];
272
274
  };
273
275
  value: unknown;
274
276
  id: number;
275
- }[] | undefined;
277
+ }[];
276
278
  localesConditions?: {
277
279
  [key: string]: {
278
280
  when: {
279
- op?: "&" | "|" | undefined;
280
- clauses: (any | {
281
+ op?: "&" | "|";
282
+ clauses: ({
281
283
  rule: string;
282
- source?: string | undefined;
284
+ source?: string;
283
285
  op: string;
284
286
  value: string | string[];
285
- })[];
287
+ } | any)[];
286
288
  };
287
289
  value: unknown;
288
290
  id: number;
289
291
  }[];
290
- } | undefined;
292
+ };
291
293
  };
292
- } | undefined;
294
+ };
293
295
  slots?: {
294
296
  [key: string]: any[];
295
- } | undefined;
296
- variant?: string | undefined;
297
+ };
298
+ variant?: string;
297
299
  };
298
- } | undefined;
300
+ };
299
301
  _overridability?: {
300
302
  parameters?: {
301
303
  [key: string]: "yes" | "no";
302
- } | undefined;
303
- variants?: boolean | undefined;
304
- hideLockedParameters?: boolean | undefined;
305
- } | undefined;
306
- _locales?: string[] | undefined;
304
+ };
305
+ variants?: boolean;
306
+ hideLockedParameters?: boolean;
307
+ };
308
+ _locales?: string[];
307
309
  }[];
308
- } | undefined;
310
+ };
309
311
  _id: string;
310
- _slug?: string | null | undefined;
312
+ _slug?: string | null;
311
313
  _name: string;
312
- _author?: string | undefined;
313
- _authorSubject?: string | undefined;
314
- _creator?: string | undefined;
315
- _creatorSubject?: string | undefined;
316
- _pattern?: string | undefined;
314
+ _author?: string;
315
+ _authorSubject?: string;
316
+ _creator?: string;
317
+ _creatorSubject?: string;
318
+ _pattern?: string;
317
319
  _patternDataResources?: {
318
320
  [key: string]: {
319
321
  type: string;
320
- isPatternParameter?: boolean | undefined;
321
- ignorePatternParameterDefault?: boolean | undefined;
322
- optionalPatternParameter?: boolean | undefined;
322
+ isPatternParameter?: boolean;
323
+ ignorePatternParameterDefault?: boolean;
324
+ optionalPatternParameter?: boolean;
325
+ dataSourceVariant?: "unpublished";
323
326
  variables?: {
324
327
  [key: string]: string;
325
- } | undefined;
328
+ };
326
329
  };
327
- } | undefined;
330
+ };
328
331
  _dataResources?: {
329
332
  [key: string]: {
330
333
  type: string;
331
- isPatternParameter?: boolean | undefined;
332
- ignorePatternParameterDefault?: boolean | undefined;
333
- optionalPatternParameter?: boolean | undefined;
334
+ isPatternParameter?: boolean;
335
+ ignorePatternParameterDefault?: boolean;
336
+ optionalPatternParameter?: boolean;
337
+ dataSourceVariant?: "unpublished";
334
338
  variables?: {
335
339
  [key: string]: string;
336
- } | undefined;
340
+ };
337
341
  };
338
- } | undefined;
339
- _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
342
+ };
343
+ _patternError?: "NOTFOUND" | "CYCLIC";
340
344
  _overrides?: {
341
345
  [key: string]: {
342
346
  parameters?: {
@@ -346,57 +350,57 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
346
350
  connectedData?: {
347
351
  pointer: string;
348
352
  syntax: "jptr";
349
- failureAction?: "a" | "p" | "t" | "c" | undefined;
350
- failureLogLevel?: "i" | "e" | "w" | undefined;
351
- failureDefault?: string | undefined;
352
- } | undefined;
353
+ failureAction?: "t" | "p" | "c" | "a";
354
+ failureLogLevel?: "e" | "w" | "i";
355
+ failureDefault?: string;
356
+ };
353
357
  locales?: {
354
358
  [key: string]: unknown;
355
- } | undefined;
359
+ };
356
360
  conditions?: {
357
361
  when: {
358
- op?: "&" | "|" | undefined;
359
- clauses: (any | {
362
+ op?: "&" | "|";
363
+ clauses: ({
360
364
  rule: string;
361
- source?: string | undefined;
365
+ source?: string;
362
366
  op: string;
363
367
  value: string | string[];
364
- })[];
368
+ } | any)[];
365
369
  };
366
370
  value: unknown;
367
371
  id: number;
368
- }[] | undefined;
372
+ }[];
369
373
  localesConditions?: {
370
374
  [key: string]: {
371
375
  when: {
372
- op?: "&" | "|" | undefined;
373
- clauses: (any | {
376
+ op?: "&" | "|";
377
+ clauses: ({
374
378
  rule: string;
375
- source?: string | undefined;
379
+ source?: string;
376
380
  op: string;
377
381
  value: string | string[];
378
- })[];
382
+ } | any)[];
379
383
  };
380
384
  value: unknown;
381
385
  id: number;
382
386
  }[];
383
- } | undefined;
387
+ };
384
388
  };
385
- } | undefined;
389
+ };
386
390
  slots?: {
387
391
  [key: string]: any[];
388
- } | undefined;
389
- variant?: string | undefined;
392
+ };
393
+ variant?: string;
390
394
  };
391
- } | undefined;
395
+ };
392
396
  _overridability?: {
393
397
  parameters?: {
394
398
  [key: string]: "yes" | "no";
395
- } | undefined;
396
- variants?: boolean | undefined;
397
- hideLockedParameters?: boolean | undefined;
398
- } | undefined;
399
- _locales?: string[] | undefined;
399
+ };
400
+ variants?: boolean;
401
+ hideLockedParameters?: boolean;
402
+ };
403
+ _locales?: string[];
400
404
  } | undefined;
401
405
  isContextualEditing: boolean;
402
406
  };
@@ -469,6 +473,14 @@ type UniformRichTextProps = {
469
473
  * for rendering a rich text node
470
474
  */
471
475
  resolveRichTextRenderer?: RenderRichTextComponentResolver;
476
+ /**
477
+ * Sets the value to show in Canvas editor when the parameter value is empty.
478
+ * Can be a static string, or a function to generate the placeholder out of parameter info.
479
+ * @default undefined
480
+ */
481
+ placeholder?: string | ((parameter: {
482
+ id: string;
483
+ }) => string | undefined);
472
484
  } & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'children'>;
473
485
  /**
474
486
  * Adds rendering support for Uniform Rich Text parameters
@@ -478,14 +490,22 @@ declare const UniformRichText: React$1.ForwardRefExoticComponent<{
478
490
  * The name of the HTML tag to render.
479
491
  * @default "div"
480
492
  */
481
- as?: React$1.ElementType<any> | undefined;
493
+ as?: React$1.ElementType;
482
494
  /** The ID of the parameter. */
483
495
  parameterId: string;
484
496
  /**
485
497
  * A function which can provide a custom react component
486
498
  * for rendering a rich text node
487
499
  */
488
- resolveRichTextRenderer?: RenderRichTextComponentResolver | undefined;
500
+ resolveRichTextRenderer?: RenderRichTextComponentResolver;
501
+ /**
502
+ * Sets the value to show in Canvas editor when the parameter value is empty.
503
+ * Can be a static string, or a function to generate the placeholder out of parameter info.
504
+ * @default undefined
505
+ */
506
+ placeholder?: string | ((parameter: {
507
+ id: string;
508
+ }) => string | undefined);
489
509
  } & Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & React$1.RefAttributes<unknown>>;
490
510
 
491
511
  type UniformRichTextNodeProps = {
@@ -593,7 +613,7 @@ declare const useUniformContextualEditingState: ({ global, }?: UseUniformContext
593
613
  declare const componentStore: ComponentStore;
594
614
  declare const registerUniformComponent: ({ type, variantId, component, }: {
595
615
  type: string;
596
- variantId?: string | undefined;
616
+ variantId?: string;
597
617
  component: React.ComponentType<ComponentProps<any>>;
598
618
  }) => void;
599
619
  declare const componentStoreResolver: RenderComponentResolver;