@cntrl-site/components 1.0.110 → 1.0.111-alpha.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.
@@ -0,0 +1,57 @@
1
+ import { CommonComponentProps } from '../props';
2
+ import { PopupMenuBlockType, PopupMenuGridSettings, PopupMenuSidesSetting, PopupMenuLayout } from './popupMenuLayout';
3
+ export declare const POPUP_MENU_TRIGGER_TYPES: readonly ["burger", "plus", "image", "text"];
4
+ export type PopupMenuTriggerType = (typeof POPUP_MENU_TRIGGER_TYPES)[number];
5
+ type PopupMenuImage = {
6
+ assetId: string;
7
+ name?: string;
8
+ };
9
+ export type PopupMenuBlock = {
10
+ /** 'list' is from before lists had two styles, and reads as 'listA'. */
11
+ type?: PopupMenuBlockType | 'list';
12
+ title?: string;
13
+ text?: any[];
14
+ images?: PopupMenuImage[];
15
+ };
16
+ type PopupMenuColorKey = 'barBackgroundColor' | 'triggerColor' | 'overlayColor' | 'popupBackgroundColor' | 'titleColor' | 'textColor' | 'listAColor' | 'listBColor';
17
+ type PopupMenuSettings = PopupMenuGridSettings & {
18
+ menuLayout?: PopupMenuLayout | null;
19
+ /** None, as in a menu saved before there was a choice, is a text trigger. */
20
+ triggerType?: PopupMenuTriggerType;
21
+ triggerLabel?: string;
22
+ triggerIcon?: string | null;
23
+ triggerIconSize?: number;
24
+ triggerPosition?: 'left' | 'center' | 'right';
25
+ /** The room round the trigger's icon or text; a menu saved before it had one has none. */
26
+ triggerPadding?: PopupMenuSidesSetting;
27
+ popupHeight?: number;
28
+ popupInset?: PopupMenuSidesSetting;
29
+ popupPadding?: PopupMenuSidesSetting;
30
+ titleGap?: number;
31
+ popupRadius?: number;
32
+ imageRadius?: number;
33
+ barBackgroundColor?: string;
34
+ triggerColor?: string;
35
+ overlayColor?: string;
36
+ popupBackgroundColor?: string;
37
+ titleColor?: string;
38
+ textColor?: string;
39
+ listAColor?: string;
40
+ listBColor?: string;
41
+ /** Colours picked in a state's panel, by state, over the ones above. */
42
+ stateOverrides?: Record<string, Partial<Record<PopupMenuColorKey, string>>>;
43
+ [key: string]: unknown;
44
+ };
45
+ type PopupMenuProps = {
46
+ settings: PopupMenuSettings;
47
+ /** Given in the editor, the open popup's blocks can be dragged across its columns and down its height. */
48
+ onUpdateSettings?: (settings: PopupMenuSettings) => void;
49
+ content?: PopupMenuBlock[];
50
+ isEditor?: boolean;
51
+ isEditMode?: boolean;
52
+ isPreviewMode?: boolean;
53
+ layoutId?: string;
54
+ onOpenChange?: (isOpen: boolean) => void;
55
+ } & CommonComponentProps;
56
+ export declare function PopupMenu({ settings, content, isEditor, isEditMode, isPreviewMode, layoutId, currentState, unavailableStates, onOpenChange, onUpdateSettings, }: PopupMenuProps): import("react/jsx-runtime").JSX.Element;
57
+ export {};
@@ -0,0 +1,587 @@
1
+ import { PopupMenu } from './PopupMenu';
2
+ export declare const PopupMenuComponent: {
3
+ element: typeof PopupMenu;
4
+ id: string;
5
+ name: string;
6
+ category: string;
7
+ version: number;
8
+ layoutMode: "navigation";
9
+ defaultSize: {
10
+ d: {
11
+ width: string;
12
+ height: number;
13
+ };
14
+ t: {
15
+ width: string;
16
+ height: number;
17
+ };
18
+ m: {
19
+ width: string;
20
+ height: number;
21
+ };
22
+ };
23
+ defaultNavigationPosition: {
24
+ readonly d: "stickyTop";
25
+ readonly t: "stickyTop";
26
+ readonly m: "stickyTop";
27
+ };
28
+ schema: {
29
+ type: "object";
30
+ version: 1;
31
+ content: {
32
+ type: "array";
33
+ settings: {
34
+ addItemWithoutImage: true;
35
+ };
36
+ display: {
37
+ type: string;
38
+ };
39
+ items: {
40
+ type: "object";
41
+ properties: {
42
+ type: {
43
+ type: "string";
44
+ label: string;
45
+ enum: string[];
46
+ default: string;
47
+ display: {
48
+ type: string;
49
+ };
50
+ };
51
+ title: {
52
+ type: "string";
53
+ label: string;
54
+ placeholder: string;
55
+ display: {
56
+ type: string;
57
+ };
58
+ };
59
+ text: {
60
+ label: string;
61
+ placeholder: string;
62
+ display: {
63
+ type: string;
64
+ };
65
+ byRowType: {
66
+ [k: string]: {
67
+ placeholder: string;
68
+ display: {
69
+ type: string;
70
+ };
71
+ };
72
+ };
73
+ };
74
+ images: {
75
+ type: "object";
76
+ label: string;
77
+ display: {
78
+ type: string;
79
+ };
80
+ properties: {
81
+ assetId: {
82
+ type: "string";
83
+ };
84
+ name: {
85
+ type: "string";
86
+ };
87
+ objectFit: {
88
+ type: "string";
89
+ enum: string[];
90
+ };
91
+ };
92
+ required: string[];
93
+ };
94
+ };
95
+ };
96
+ default: ({
97
+ type: string;
98
+ title: string;
99
+ text: {
100
+ type: string;
101
+ children: {
102
+ text: string;
103
+ }[];
104
+ }[];
105
+ images: never[];
106
+ } | {
107
+ type: string;
108
+ title: string;
109
+ text: never[];
110
+ images: {
111
+ assetId: string;
112
+ name: string;
113
+ objectFit: string;
114
+ }[];
115
+ })[];
116
+ };
117
+ settings: {
118
+ sizing: string;
119
+ properties: {
120
+ menuLayout: {
121
+ type: "object";
122
+ scope: "layout";
123
+ title: string;
124
+ display: {
125
+ type: string;
126
+ };
127
+ };
128
+ gridColumns: {
129
+ type: "number";
130
+ scope: "layout";
131
+ title: string;
132
+ min: number;
133
+ max: number;
134
+ display: {
135
+ type: string;
136
+ };
137
+ };
138
+ gridColumnWidth: {
139
+ type: "number";
140
+ scope: "layout";
141
+ title: string;
142
+ min: number;
143
+ max: number;
144
+ display: {
145
+ type: string;
146
+ };
147
+ };
148
+ gridGutter: {
149
+ type: "number";
150
+ scope: "layout";
151
+ title: string;
152
+ min: number;
153
+ max: number;
154
+ display: {
155
+ type: string;
156
+ };
157
+ };
158
+ gridRowHeight: {
159
+ type: "number";
160
+ scope: "layout";
161
+ title: string;
162
+ min: number;
163
+ max: number;
164
+ display: {
165
+ type: string;
166
+ };
167
+ };
168
+ triggerType: {
169
+ type: "string";
170
+ scope: "common";
171
+ title: string;
172
+ enum: ("image" | "text" | "burger" | "plus")[];
173
+ display: {
174
+ type: string;
175
+ };
176
+ };
177
+ triggerLabel: {
178
+ type: "string";
179
+ scope: "common";
180
+ title: string;
181
+ display: {
182
+ type: string;
183
+ };
184
+ };
185
+ triggerIcon: {
186
+ type: readonly ["string", "null"];
187
+ scope: "common";
188
+ title: string;
189
+ display: {
190
+ type: string;
191
+ visible: boolean;
192
+ };
193
+ };
194
+ triggerIconSize: {
195
+ type: "number";
196
+ scope: "layout";
197
+ title: string;
198
+ min: number;
199
+ max: number;
200
+ display: {
201
+ type: string;
202
+ visible: boolean;
203
+ };
204
+ };
205
+ triggerPosition: {
206
+ type: "string";
207
+ scope: "layout";
208
+ title: string;
209
+ enum: string[];
210
+ display: {
211
+ type: string;
212
+ enum: string[];
213
+ };
214
+ };
215
+ triggerPadding: {
216
+ type: "object";
217
+ scope: "layout";
218
+ title: string;
219
+ display: {
220
+ type: string;
221
+ };
222
+ properties: {
223
+ top: {
224
+ type: "number";
225
+ };
226
+ right: {
227
+ type: "number";
228
+ };
229
+ bottom: {
230
+ type: "number";
231
+ };
232
+ left: {
233
+ type: "number";
234
+ };
235
+ };
236
+ };
237
+ popupHeight: {
238
+ type: "number";
239
+ scope: "layout";
240
+ title: string;
241
+ min: number;
242
+ max: number;
243
+ display: {
244
+ type: string;
245
+ };
246
+ };
247
+ popupInset: {
248
+ type: "object";
249
+ scope: "layout";
250
+ title: string;
251
+ display: {
252
+ type: string;
253
+ };
254
+ properties: {
255
+ top: {
256
+ type: "number";
257
+ };
258
+ right: {
259
+ type: "number";
260
+ };
261
+ bottom: {
262
+ type: "number";
263
+ };
264
+ left: {
265
+ type: "number";
266
+ };
267
+ };
268
+ };
269
+ popupPadding: {
270
+ type: "object";
271
+ scope: "layout";
272
+ title: string;
273
+ display: {
274
+ type: string;
275
+ };
276
+ properties: {
277
+ top: {
278
+ type: "number";
279
+ };
280
+ right: {
281
+ type: "number";
282
+ };
283
+ bottom: {
284
+ type: "number";
285
+ };
286
+ left: {
287
+ type: "number";
288
+ };
289
+ };
290
+ };
291
+ titleGap: {
292
+ type: "number";
293
+ scope: "layout";
294
+ title: string;
295
+ min: number;
296
+ max: number;
297
+ display: {
298
+ type: string;
299
+ };
300
+ };
301
+ popupRadius: {
302
+ type: "number";
303
+ scope: "layout";
304
+ title: string;
305
+ min: number;
306
+ max: number;
307
+ display: {
308
+ type: string;
309
+ };
310
+ };
311
+ imageRadius: {
312
+ type: "number";
313
+ scope: "layout";
314
+ title: string;
315
+ min: number;
316
+ max: number;
317
+ display: {
318
+ type: string;
319
+ };
320
+ };
321
+ stateOverrides: {
322
+ type: "object";
323
+ scope: "common";
324
+ };
325
+ barBackgroundColor: {
326
+ type: "string";
327
+ scope: "common";
328
+ title: string;
329
+ display: {
330
+ type: string;
331
+ };
332
+ };
333
+ triggerColor: {
334
+ type: "string";
335
+ scope: "common";
336
+ title: string;
337
+ display: {
338
+ type: string;
339
+ };
340
+ };
341
+ overlayColor: {
342
+ type: "string";
343
+ scope: "common";
344
+ title: string;
345
+ display: {
346
+ type: string;
347
+ };
348
+ };
349
+ popupBackgroundColor: {
350
+ type: "string";
351
+ scope: "common";
352
+ title: string;
353
+ display: {
354
+ type: string;
355
+ };
356
+ };
357
+ titleColor: {
358
+ type: "string";
359
+ scope: "common";
360
+ title: string;
361
+ display: {
362
+ type: string;
363
+ };
364
+ };
365
+ textColor: {
366
+ type: "string";
367
+ scope: "common";
368
+ title: string;
369
+ display: {
370
+ type: string;
371
+ };
372
+ };
373
+ listAColor: {
374
+ type: "string";
375
+ scope: "common";
376
+ title: string;
377
+ display: {
378
+ type: string;
379
+ };
380
+ };
381
+ listBColor: {
382
+ type: "string";
383
+ scope: "common";
384
+ title: string;
385
+ display: {
386
+ type: string;
387
+ };
388
+ };
389
+ };
390
+ displayRules: {
391
+ if: {
392
+ name: string;
393
+ value: string;
394
+ };
395
+ then: {
396
+ name: string;
397
+ value: boolean;
398
+ };
399
+ }[];
400
+ defaults: {
401
+ menuLayout: null;
402
+ triggerType: string;
403
+ triggerLabel: string;
404
+ triggerIcon: null;
405
+ triggerPosition: string;
406
+ barBackgroundColor: string;
407
+ triggerColor: string;
408
+ overlayColor: string;
409
+ popupBackgroundColor: string;
410
+ titleColor: string;
411
+ textColor: string;
412
+ listAColor: string;
413
+ listBColor: string;
414
+ triggerFontFamily: string;
415
+ triggerFontSettings: {
416
+ fontWeight: number;
417
+ fontStyle: string;
418
+ };
419
+ titleFontFamily: string;
420
+ titleFontSettings: {
421
+ fontWeight: number;
422
+ fontStyle: string;
423
+ };
424
+ textFontFamily: string;
425
+ textFontSettings: {
426
+ fontWeight: number;
427
+ fontStyle: string;
428
+ };
429
+ listAFontFamily: string;
430
+ listAFontSettings: {
431
+ fontWeight: number;
432
+ fontStyle: string;
433
+ };
434
+ listBFontFamily: string;
435
+ listBFontSettings: {
436
+ fontWeight: number;
437
+ fontStyle: string;
438
+ };
439
+ };
440
+ layoutDefaults: {
441
+ d: {
442
+ triggerPadding: {
443
+ top: number;
444
+ right: number;
445
+ bottom: number;
446
+ left: number;
447
+ };
448
+ triggerIconSize: number;
449
+ popupInset: {
450
+ top: number;
451
+ right: number;
452
+ bottom: number;
453
+ left: number;
454
+ };
455
+ popupPadding: {
456
+ top: number;
457
+ right: number;
458
+ bottom: number;
459
+ left: number;
460
+ };
461
+ popupHeight: number;
462
+ titleGap: number;
463
+ popupRadius: number;
464
+ imageRadius: number;
465
+ gridColumns: number;
466
+ gridColumnWidth: number;
467
+ gridGutter: number;
468
+ gridRowHeight: number;
469
+ };
470
+ t: {
471
+ triggerPadding: {
472
+ top: number;
473
+ right: number;
474
+ bottom: number;
475
+ left: number;
476
+ };
477
+ triggerIconSize: number;
478
+ popupInset: {
479
+ top: number;
480
+ right: number;
481
+ bottom: number;
482
+ left: number;
483
+ };
484
+ popupPadding: {
485
+ top: number;
486
+ right: number;
487
+ bottom: number;
488
+ left: number;
489
+ };
490
+ popupHeight: number;
491
+ titleGap: number;
492
+ popupRadius: number;
493
+ imageRadius: number;
494
+ gridColumns: number;
495
+ gridColumnWidth: number;
496
+ gridGutter: number;
497
+ gridRowHeight: number;
498
+ };
499
+ m: {
500
+ triggerPadding: {
501
+ top: number;
502
+ right: number;
503
+ bottom: number;
504
+ left: number;
505
+ };
506
+ triggerIconSize: number;
507
+ popupInset: {
508
+ top: number;
509
+ right: number;
510
+ bottom: number;
511
+ left: number;
512
+ };
513
+ popupPadding: {
514
+ top: number;
515
+ right: number;
516
+ bottom: number;
517
+ left: number;
518
+ };
519
+ popupHeight: number;
520
+ titleGap: number;
521
+ popupRadius: number;
522
+ imageRadius: number;
523
+ gridColumns: number;
524
+ gridColumnWidth: number;
525
+ gridGutter: number;
526
+ gridRowHeight: number;
527
+ };
528
+ };
529
+ };
530
+ panels: ({
531
+ id: string;
532
+ icon: string;
533
+ title: string;
534
+ tooltip: string;
535
+ layout: (string | {
536
+ type: "row";
537
+ items: string[];
538
+ })[];
539
+ } | {
540
+ id: string;
541
+ icon: string;
542
+ title: string;
543
+ tooltip: string;
544
+ layout: (string | {
545
+ type: "tab";
546
+ id: string;
547
+ tabs: {
548
+ [k: string]: (string | {
549
+ type: "row";
550
+ items: string[];
551
+ })[];
552
+ };
553
+ })[];
554
+ })[];
555
+ paletteBookmark: {
556
+ items: ("textColor" | "titleColor" | "overlayColor" | "triggerColor" | "barBackgroundColor" | "popupBackgroundColor" | "listAColor" | "listBColor")[];
557
+ panelIds: string[];
558
+ stateItems: {
559
+ default: string[];
560
+ open: string[];
561
+ };
562
+ };
563
+ statePanels: string[];
564
+ };
565
+ assetsPaths: {
566
+ content: {
567
+ path: string;
568
+ placeholderEnabled: boolean;
569
+ }[];
570
+ parameters: {
571
+ path: string;
572
+ }[];
573
+ };
574
+ fontSettingsPaths: {
575
+ content: never[];
576
+ parameters: {
577
+ path: string;
578
+ }[];
579
+ };
580
+ fontRelations: {
581
+ triggerFontSettings: string;
582
+ titleFontSettings: string;
583
+ textFontSettings: string;
584
+ listAFontSettings: string;
585
+ listBFontSettings: string;
586
+ };
587
+ };