@brilo/base-blocks 0.1.57 → 0.1.60
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/build/.tsbuildinfo +1 -1
- package/build/blocks/column/column-item/factory.d.ts.map +1 -1
- package/build/blocks/column/column-item/factory.js +2 -1
- package/build/blocks/column/column-item/icon.d.ts +2 -0
- package/build/blocks/column/column-item/icon.d.ts.map +1 -0
- package/build/blocks/column/column-item/icon.js +2 -0
- package/build/blocks/column/column-item/index.d.ts.map +1 -1
- package/build/blocks/column/column-item/index.js +2 -0
- package/build/blocks/food-menu/food-menu-group/FoodMenuPreview.d.ts +6 -0
- package/build/blocks/food-menu/food-menu-group/FoodMenuPreview.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/FoodMenuPreview.js +167 -0
- package/build/blocks/food-menu/food-menu-group/FoodMenuSelectModal.d.ts +7 -0
- package/build/blocks/food-menu/food-menu-group/FoodMenuSelectModal.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/FoodMenuSelectModal.js +56 -0
- package/build/blocks/food-menu/food-menu-group/constants.d.ts +8 -0
- package/build/blocks/food-menu/food-menu-group/constants.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/constants.js +7 -0
- package/build/blocks/food-menu/food-menu-group/edit.d.ts +7 -0
- package/build/blocks/food-menu/food-menu-group/edit.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/edit.js +36 -0
- package/build/blocks/food-menu/food-menu-group/factory.d.ts +4 -0
- package/build/blocks/food-menu/food-menu-group/factory.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/factory.js +57 -0
- package/build/blocks/food-menu/food-menu-group/icon.d.ts +2 -0
- package/build/blocks/food-menu/food-menu-group/icon.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/icon.js +2 -0
- package/build/blocks/food-menu/food-menu-group/index.d.ts +6 -0
- package/build/blocks/food-menu/food-menu-group/index.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/index.js +7 -0
- package/build/blocks/food-menu/food-menu-group/types.d.ts +19 -0
- package/build/blocks/food-menu/food-menu-group/types.d.ts.map +1 -0
- package/build/blocks/food-menu/food-menu-group/types.js +1 -0
- package/build/blocks/form/form-group/index.js +1 -1
- package/build/blocks/gallery/gallery-group/constants.d.ts +1 -19
- package/build/blocks/gallery/gallery-group/constants.d.ts.map +1 -1
- package/build/blocks/gallery/gallery-group/constants.js +1 -8
- package/build/blocks/gallery/gallery-group/edit.d.ts.map +1 -1
- package/build/blocks/gallery/gallery-group/edit.js +3 -19
- package/build/blocks/gallery/gallery-group/index.js +1 -1
- package/build/blocks/gallery/gallery-item/index.js +1 -1
- package/build/blocks/gallery/gallery-strip-group/constants.d.ts +34 -0
- package/build/blocks/gallery/gallery-strip-group/constants.d.ts.map +1 -0
- package/build/blocks/gallery/gallery-strip-group/constants.js +17 -0
- package/build/blocks/gallery/gallery-strip-group/edit.d.ts +7 -0
- package/build/blocks/gallery/gallery-strip-group/edit.d.ts.map +1 -0
- package/build/blocks/gallery/gallery-strip-group/edit.js +34 -0
- package/build/blocks/gallery/gallery-strip-group/factory.d.ts +5 -0
- package/build/blocks/gallery/gallery-strip-group/factory.d.ts.map +1 -0
- package/build/blocks/gallery/gallery-strip-group/factory.js +28 -0
- package/build/blocks/gallery/gallery-strip-group/index.d.ts +5 -0
- package/build/blocks/gallery/gallery-strip-group/index.d.ts.map +1 -0
- package/build/blocks/gallery/gallery-strip-group/index.js +7 -0
- package/build/blocks/gallery/gallery-strip-group/types.d.ts +18 -0
- package/build/blocks/gallery/gallery-strip-group/types.d.ts.map +1 -0
- package/build/blocks/gallery/gallery-strip-group/types.js +1 -0
- package/build/blocks/groups/text-and-media-group/index.d.ts.map +1 -1
- package/build/blocks/groups/text-and-media-group/index.js +2 -0
- package/build/blocks/hero/hero-item/index.js +1 -1
- package/build/blocks/review/review-summary-item/constants.d.ts +3 -0
- package/build/blocks/review/review-summary-item/constants.d.ts.map +1 -0
- package/build/blocks/review/review-summary-item/constants.js +2 -0
- package/build/blocks/review/review-summary-item/edit.d.ts +6 -0
- package/build/blocks/review/review-summary-item/edit.d.ts.map +1 -0
- package/build/blocks/review/review-summary-item/edit.js +17 -0
- package/build/blocks/review/review-summary-item/factory.d.ts +5 -0
- package/build/blocks/review/review-summary-item/factory.d.ts.map +1 -0
- package/build/blocks/review/review-summary-item/factory.js +23 -0
- package/build/blocks/review/review-summary-item/index.d.ts +5 -0
- package/build/blocks/review/review-summary-item/index.d.ts.map +1 -0
- package/build/blocks/review/review-summary-item/index.js +5 -0
- package/build/blocks/review/review-summary-item/types.d.ts +11 -0
- package/build/blocks/review/review-summary-item/types.d.ts.map +1 -0
- package/build/blocks/review/review-summary-item/types.js +1 -0
- package/build/blocks/urgency/urgency-item/constants.d.ts +56 -0
- package/build/blocks/urgency/urgency-item/constants.d.ts.map +1 -0
- package/build/blocks/urgency/urgency-item/constants.js +32 -0
- package/build/blocks/urgency/urgency-item/edit.d.ts +7 -0
- package/build/blocks/urgency/urgency-item/edit.d.ts.map +1 -0
- package/build/blocks/urgency/urgency-item/edit.js +83 -0
- package/build/blocks/urgency/urgency-item/factory.d.ts +5 -0
- package/build/blocks/urgency/urgency-item/factory.d.ts.map +1 -0
- package/build/blocks/urgency/urgency-item/factory.js +31 -0
- package/build/blocks/urgency/urgency-item/index.d.ts +5 -0
- package/build/blocks/urgency/urgency-item/index.d.ts.map +1 -0
- package/build/blocks/urgency/urgency-item/index.js +5 -0
- package/build/blocks/urgency/urgency-item/types.d.ts +22 -0
- package/build/blocks/urgency/urgency-item/types.d.ts.map +1 -0
- package/build/blocks/urgency/urgency-item/types.js +1 -0
- package/build/components/EntitySelectModal/EntitySelectModal.d.ts +6 -0
- package/build/components/EntitySelectModal/EntitySelectModal.d.ts.map +1 -1
- package/build/components/EntitySelectModal/EntitySelectModal.js +3 -2
- package/build/components/GalleryImagesAppender/index.d.ts +5 -0
- package/build/components/GalleryImagesAppender/index.d.ts.map +1 -0
- package/build/components/GalleryImagesAppender/index.js +12 -0
- package/build/constants.d.ts +19 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +8 -0
- package/build/index.d.ts +8 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -0
- package/build/utils/plural.d.ts +3 -0
- package/build/utils/plural.d.ts.map +1 -0
- package/build/utils/plural.js +7 -0
- package/package.json +1 -1
- package/src/blocks/column/column-item/factory.tsx +2 -1
- package/src/blocks/column/column-item/icon.tsx +10 -0
- package/src/blocks/column/column-item/index.ts +2 -0
- package/src/blocks/food-menu/food-menu-group/FoodMenuPreview.tsx +380 -0
- package/src/blocks/food-menu/food-menu-group/FoodMenuSelectModal.tsx +69 -0
- package/src/blocks/food-menu/food-menu-group/constants.ts +9 -0
- package/src/blocks/food-menu/food-menu-group/edit.tsx +153 -0
- package/src/blocks/food-menu/food-menu-group/editor.scss +269 -0
- package/src/blocks/food-menu/food-menu-group/factory.tsx +66 -0
- package/src/blocks/food-menu/food-menu-group/icon.tsx +8 -0
- package/src/blocks/food-menu/food-menu-group/index.ts +17 -0
- package/src/blocks/food-menu/food-menu-group/types.ts +21 -0
- package/src/blocks/form/form-group/index.ts +1 -1
- package/src/blocks/gallery/gallery-group/constants.ts +1 -8
- package/src/blocks/gallery/gallery-group/edit.tsx +3 -39
- package/src/blocks/gallery/gallery-group/editor.scss +0 -12
- package/src/blocks/gallery/gallery-group/index.ts +1 -1
- package/src/blocks/gallery/gallery-item/index.ts +1 -1
- package/src/blocks/gallery/gallery-strip-group/constants.ts +22 -0
- package/src/blocks/gallery/gallery-strip-group/edit.tsx +112 -0
- package/src/blocks/gallery/gallery-strip-group/editor.scss +36 -0
- package/src/blocks/gallery/gallery-strip-group/factory.tsx +32 -0
- package/src/blocks/gallery/gallery-strip-group/index.ts +11 -0
- package/src/blocks/gallery/gallery-strip-group/types.ts +20 -0
- package/src/blocks/groups/text-and-media-group/index.ts +2 -0
- package/src/blocks/hero/hero-item/index.ts +1 -1
- package/src/blocks/review/review-summary-item/constants.ts +2 -0
- package/src/blocks/review/review-summary-item/edit.tsx +86 -0
- package/src/blocks/review/review-summary-item/editor.scss +44 -0
- package/src/blocks/review/review-summary-item/factory.tsx +27 -0
- package/src/blocks/review/review-summary-item/index.ts +9 -0
- package/src/blocks/review/review-summary-item/types.ts +11 -0
- package/src/blocks/urgency/urgency-item/constants.ts +39 -0
- package/src/blocks/urgency/urgency-item/edit.tsx +319 -0
- package/src/blocks/urgency/urgency-item/editor.scss +99 -0
- package/src/blocks/urgency/urgency-item/factory.tsx +36 -0
- package/src/blocks/urgency/urgency-item/index.ts +9 -0
- package/src/blocks/urgency/urgency-item/types.ts +23 -0
- package/src/components/EntitySelectModal/EntitySelectModal.tsx +19 -7
- package/src/components/GalleryImagesAppender/editor.scss +15 -0
- package/src/components/GalleryImagesAppender/index.tsx +29 -0
- package/src/constants.ts +9 -0
- package/src/editor.scss +5 -0
- package/src/index.ts +13 -0
- package/src/utils/plural.ts +13 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.i-urgency {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
|
|
6
|
+
.components-notice {
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.i-urgency__card {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 12px;
|
|
16
|
+
padding: 20px 16px;
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
background: var(--urgency-background, #f3f4f6);
|
|
19
|
+
text-align: center;
|
|
20
|
+
|
|
21
|
+
&.--text-sm {
|
|
22
|
+
.i-urgency__label {
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.i-urgency__unit-label {
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.--text-lg {
|
|
32
|
+
.i-urgency__label {
|
|
33
|
+
font-size: 18px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.i-urgency__unit-label {
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.i-urgency__label {
|
|
43
|
+
font-size: 16px;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.i-urgency__countdown {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.i-urgency__unit {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 4px;
|
|
59
|
+
min-width: 64px;
|
|
60
|
+
padding: 10px 8px;
|
|
61
|
+
border-radius: 6px;
|
|
62
|
+
background: var(--urgency-number-background, #fff);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.i-urgency__number,
|
|
66
|
+
.i-urgency__value {
|
|
67
|
+
font-size: var(--urgency-number-size, 28px);
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
line-height: 1;
|
|
70
|
+
font-variant-numeric: tabular-nums;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.i-urgency__unit-label {
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
color: var(--urgency-text-color, #50575e);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.i-urgency__progress {
|
|
79
|
+
display: block;
|
|
80
|
+
width: 240px;
|
|
81
|
+
max-width: 100%;
|
|
82
|
+
height: 8px;
|
|
83
|
+
border-radius: 4px;
|
|
84
|
+
background: #fff;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.i-urgency__progress-fill {
|
|
89
|
+
display: block;
|
|
90
|
+
height: 100%;
|
|
91
|
+
background: #1e2d45;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.i-urgency__number-presets {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-wrap: wrap;
|
|
97
|
+
gap: 4px;
|
|
98
|
+
margin-bottom: 8px;
|
|
99
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import {DEADLINE_DISPLAYS, TEXTS, TEXT_SIZES, TYPES} from './constants'
|
|
4
|
+
import {createUrgencyItemEdit} from './edit'
|
|
5
|
+
import type {UrgencyItemAttributes, UrgencyItemOptions} from './types'
|
|
6
|
+
|
|
7
|
+
export type {UrgencyItemAttributes, UrgencyItemOptions}
|
|
8
|
+
|
|
9
|
+
export function createUrgencyItemBlock(options: UrgencyItemOptions): BlockConfiguration<UrgencyItemAttributes> {
|
|
10
|
+
return {
|
|
11
|
+
name: options.name,
|
|
12
|
+
title: options.title ?? __('Naléhavost', 'brilo-blocks'),
|
|
13
|
+
description:
|
|
14
|
+
options.description ?? __('Skutečný termín, počet volných míst nebo sezóna. Po vypršení termínu se na webu skryje.', 'brilo-blocks'),
|
|
15
|
+
category: options.category ?? 'layout',
|
|
16
|
+
...(options.parent && {parent: options.parent}),
|
|
17
|
+
icon: options.icon ?? 'clock',
|
|
18
|
+
supports: {html: false, customClassName: false},
|
|
19
|
+
attributes: {
|
|
20
|
+
type: {type: 'string', default: TYPES[0].value, enum: TYPES.map((t) => t.value)},
|
|
21
|
+
text: {type: 'string', default: TEXTS.countdown},
|
|
22
|
+
deadline: {type: 'string', default: ''},
|
|
23
|
+
display: {type: 'string', default: DEADLINE_DISPLAYS[0].value, enum: DEADLINE_DISPLAYS.map((d) => d.value)},
|
|
24
|
+
remaining: {type: 'number'},
|
|
25
|
+
total: {type: 'number'},
|
|
26
|
+
endDate: {type: 'string', default: ''},
|
|
27
|
+
textSize: {type: 'string', default: TEXT_SIZES[1].value, enum: TEXT_SIZES.map((s) => s.value)},
|
|
28
|
+
numberSize: {type: 'number'},
|
|
29
|
+
backgroundColor: {type: 'string', default: ''},
|
|
30
|
+
numberBackgroundColor: {type: 'string', default: ''},
|
|
31
|
+
textColor: {type: 'string', default: ''},
|
|
32
|
+
},
|
|
33
|
+
edit: createUrgencyItemEdit(options),
|
|
34
|
+
save: () => null,
|
|
35
|
+
} as unknown as BlockConfiguration<UrgencyItemAttributes>
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type {UrgencyItemAttributes, UrgencyItemOptions} from './types'
|
|
2
|
+
export {createUrgencyItemBlock} from './factory'
|
|
3
|
+
|
|
4
|
+
import type {UrgencyItemOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export const urgencyItemDefaults: UrgencyItemOptions = {
|
|
7
|
+
name: 'brilo/urgency-item',
|
|
8
|
+
parent: ['brilo/base-section', 'brilo/text-and-media-group', 'brilo/text-and-form-text-column', 'brilo/column-item'],
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type {BriloBlockType} from '~/types'
|
|
2
|
+
import type {DEADLINE_DISPLAYS, TEXT_SIZES, TYPES} from './constants'
|
|
3
|
+
|
|
4
|
+
export type UrgencyType = (typeof TYPES)[number]['value']
|
|
5
|
+
export type UrgencyDeadlineDisplay = (typeof DEADLINE_DISPLAYS)[number]['value']
|
|
6
|
+
export type UrgencyTextSize = (typeof TEXT_SIZES)[number]['value']
|
|
7
|
+
|
|
8
|
+
export interface UrgencyItemAttributes extends Record<string, unknown> {
|
|
9
|
+
type: UrgencyType
|
|
10
|
+
text: string
|
|
11
|
+
deadline: string
|
|
12
|
+
display: UrgencyDeadlineDisplay
|
|
13
|
+
remaining?: number
|
|
14
|
+
total?: number
|
|
15
|
+
endDate: string
|
|
16
|
+
textSize: UrgencyTextSize
|
|
17
|
+
numberSize?: number
|
|
18
|
+
backgroundColor: string
|
|
19
|
+
numberBackgroundColor: string
|
|
20
|
+
textColor: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface UrgencyItemOptions extends BriloBlockType {}
|
|
@@ -45,6 +45,12 @@ export type EntitySelectModalConfig<T extends EntityRecord> = {
|
|
|
45
45
|
modalTitle: string
|
|
46
46
|
emptyLabel: string
|
|
47
47
|
className?: string
|
|
48
|
+
/**
|
|
49
|
+
* Keep the reorderable selection inside the modal instead of under the
|
|
50
|
+
* button — for blocks whose canvas already previews the picked items in
|
|
51
|
+
* order, where a second list would only repeat them.
|
|
52
|
+
*/
|
|
53
|
+
listInModal?: boolean
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
function useEntities<T extends EntityRecord>(endpoint: string) {
|
|
@@ -191,19 +197,23 @@ export function createEntitySelectModal<T extends EntityRecord>(config: EntitySe
|
|
|
191
197
|
onChange(selectedItems.includes(id) ? selectedItems.filter((itemId) => itemId !== id) : [...selectedItems, id])
|
|
192
198
|
}
|
|
193
199
|
|
|
200
|
+
const selectedList = (
|
|
201
|
+
<SelectedOrderList
|
|
202
|
+
items={selectedEntities}
|
|
203
|
+
getItemLabel={config.getItemLabel}
|
|
204
|
+
emptyLabel={config.emptyLabel}
|
|
205
|
+
onChange={onChange}
|
|
206
|
+
onRemove={(id) => onChange(selectedItems.filter((itemId) => itemId !== id))}
|
|
207
|
+
/>
|
|
208
|
+
)
|
|
209
|
+
|
|
194
210
|
return (
|
|
195
211
|
<VStack spacing={3} className={config.className ?? 'i-event-select-modal'}>
|
|
196
212
|
<Button variant="secondary" icon={plusCircle} onClick={() => setIsOpen(true)}>
|
|
197
213
|
{config.buttonLabel}
|
|
198
214
|
</Button>
|
|
199
215
|
|
|
200
|
-
|
|
201
|
-
items={selectedEntities}
|
|
202
|
-
getItemLabel={config.getItemLabel}
|
|
203
|
-
emptyLabel={config.emptyLabel}
|
|
204
|
-
onChange={onChange}
|
|
205
|
-
onRemove={(id) => onChange(selectedItems.filter((itemId) => itemId !== id))}
|
|
206
|
-
/>
|
|
216
|
+
{!config.listInModal && selectedList}
|
|
207
217
|
|
|
208
218
|
{isOpen && (
|
|
209
219
|
<Modal title={config.modalTitle} onRequestClose={() => setIsOpen(false)} size="fill">
|
|
@@ -236,6 +246,8 @@ export function createEntitySelectModal<T extends EntityRecord>(config: EntitySe
|
|
|
236
246
|
/>
|
|
237
247
|
</div>
|
|
238
248
|
|
|
249
|
+
{config.listInModal && selectedList}
|
|
250
|
+
|
|
239
251
|
<HStack justify="flex-end">
|
|
240
252
|
<Button variant="primary" onClick={() => setIsOpen(false)}>
|
|
241
253
|
{__('Hotovo', 'brilo-blocks')}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.g-gallery__appender {
|
|
2
|
+
padding: 16px;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
border: 2px dashed lightblue;
|
|
7
|
+
height: 100%;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
min-height: 256px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
background: none;
|
|
13
|
+
font: inherit;
|
|
14
|
+
color: inherit;
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {MediaUpload} from '@wordpress/block-editor'
|
|
2
|
+
import {createBlock} from '@wordpress/blocks'
|
|
3
|
+
import {useDispatch} from '@wordpress/data'
|
|
4
|
+
import {__} from '@wordpress/i18n'
|
|
5
|
+
|
|
6
|
+
export function GalleryImagesAppender({clientId, itemBlock}: {clientId: string; itemBlock: string}) {
|
|
7
|
+
const {insertBlocks} = useDispatch('core/block-editor')
|
|
8
|
+
|
|
9
|
+
const onSelectImages = (media: {id: number}[]) => {
|
|
10
|
+
insertBlocks(
|
|
11
|
+
media.map((item) => createBlock(itemBlock, {img: {id: item.id}})),
|
|
12
|
+
undefined,
|
|
13
|
+
clientId,
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<MediaUpload
|
|
19
|
+
onSelect={onSelectImages}
|
|
20
|
+
multiple="add"
|
|
21
|
+
allowedTypes={['image']}
|
|
22
|
+
render={({open}) => (
|
|
23
|
+
<button type="button" onClick={open} className="g-gallery__appender">
|
|
24
|
+
{__('Přidat obrázky', 'brilo-blocks')}
|
|
25
|
+
</button>
|
|
26
|
+
)}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
package/src/constants.ts
CHANGED
|
@@ -18,3 +18,12 @@ export const CONTENT_SIZES = [
|
|
|
18
18
|
{value: 'default', label: __('Výchozí', 'brilo-blocks')},
|
|
19
19
|
{value: 'lg', label: __('Velká', 'brilo-blocks')},
|
|
20
20
|
] as const
|
|
21
|
+
|
|
22
|
+
export const GALLERY_RATIOS = [
|
|
23
|
+
{value: '4:3', label: '4:3'},
|
|
24
|
+
{value: '16:9', label: '16:9'},
|
|
25
|
+
{value: '3:2', label: '3:2'},
|
|
26
|
+
{value: '1:1', label: '1:1'},
|
|
27
|
+
{value: '2:1', label: '2:1'},
|
|
28
|
+
{value: '3:4', label: '3:4'},
|
|
29
|
+
] as const
|
package/src/editor.scss
CHANGED
|
@@ -41,11 +41,13 @@
|
|
|
41
41
|
@forward "./blocks/person/person-item/editor";
|
|
42
42
|
@forward "./blocks/event/event-calendar-group/editor";
|
|
43
43
|
@forward "./blocks/event/event-list-group/editor";
|
|
44
|
+
@forward "./blocks/food-menu/food-menu-group/editor";
|
|
44
45
|
@forward "./blocks/responsive-grid/responsive-grid-item/editor";
|
|
45
46
|
@forward "./blocks/layout/layout-aside/editor";
|
|
46
47
|
@forward "./blocks/layout/layout-content/editor";
|
|
47
48
|
@forward "./blocks/layout/layout-content-w-aside/editor";
|
|
48
49
|
@forward "./components/IconControl/editor";
|
|
50
|
+
@forward "./components/GalleryImagesAppender/editor";
|
|
49
51
|
@forward "./components/ImagePicker/editor";
|
|
50
52
|
@forward "./components/ItemIconControl/editor";
|
|
51
53
|
@forward "./blocks/priceplan/priceplan-group/editor";
|
|
@@ -54,3 +56,6 @@
|
|
|
54
56
|
@forward "./blocks/video/video-group/editor";
|
|
55
57
|
@forward "./blocks/review/review-group/editor";
|
|
56
58
|
@forward "./blocks/review/review-item/editor";
|
|
59
|
+
@forward "./blocks/review/review-summary-item/editor";
|
|
60
|
+
@forward "./blocks/gallery/gallery-strip-group/editor";
|
|
61
|
+
@forward "./blocks/urgency/urgency-item/editor";
|
package/src/index.ts
CHANGED
|
@@ -189,6 +189,13 @@ export {
|
|
|
189
189
|
DocumentsSelectModal,
|
|
190
190
|
DocumentTermSelectModal,
|
|
191
191
|
} from './blocks/document/documents-grid'
|
|
192
|
+
export type {
|
|
193
|
+
FoodMenuGroupAttributes,
|
|
194
|
+
FoodMenuGroupLayout,
|
|
195
|
+
FoodMenuGroupMode,
|
|
196
|
+
FoodMenuGroupOptions,
|
|
197
|
+
} from './blocks/food-menu/food-menu-group'
|
|
198
|
+
export {createFoodMenuGroupBlock, foodMenuGroupDefaults, FoodMenuSelectModal} from './blocks/food-menu/food-menu-group'
|
|
192
199
|
export type {LinkItemAttributes, LinkItemIcon, LinkItemOptions} from './blocks/link/link-item'
|
|
193
200
|
export {createLinkItemBlock, linkItemDefaults} from './blocks/link/link-item'
|
|
194
201
|
export type {ContentWithAsideAttributes, ContentWithAsideOptions} from './blocks/layout/layout-content-w-aside'
|
|
@@ -263,3 +270,9 @@ export type {ReviewGroupAttributes, ReviewGroupOptions} from './blocks/review/re
|
|
|
263
270
|
export {createReviewGroupBlock, reviewGroupDefaults} from './blocks/review/review-group'
|
|
264
271
|
export type {ReviewAuthor, ReviewItemAttributes, ReviewItemOptions, ReviewRating} from './blocks/review/review-item'
|
|
265
272
|
export {createReviewItemBlock, reviewItemDefaults} from './blocks/review/review-item'
|
|
273
|
+
export type {ReviewSummaryItemAttributes, ReviewSummaryItemOptions} from './blocks/review/review-summary-item'
|
|
274
|
+
export {createReviewSummaryItemBlock, reviewSummaryItemDefaults} from './blocks/review/review-summary-item'
|
|
275
|
+
export type {GalleryStripGroupAttributes, GalleryStripGroupOptions} from './blocks/gallery/gallery-strip-group'
|
|
276
|
+
export {createGalleryStripGroupBlock, galleryStripGroupDefaults} from './blocks/gallery/gallery-strip-group'
|
|
277
|
+
export type {UrgencyItemAttributes, UrgencyItemOptions} from './blocks/urgency/urgency-item'
|
|
278
|
+
export {createUrgencyItemBlock, urgencyItemDefaults} from './blocks/urgency/urgency-item'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Picks the Czech plural form: 1, 2–4, 0 and 5+. `_n` only knows two. */
|
|
2
|
+
export function plural<One extends string, Few extends string, Many extends string>(
|
|
3
|
+
count: number,
|
|
4
|
+
one: One,
|
|
5
|
+
few: Few,
|
|
6
|
+
many: Many,
|
|
7
|
+
): One | Few | Many {
|
|
8
|
+
if (count === 1) {
|
|
9
|
+
return one
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return count >= 2 && count <= 4 ? few : many
|
|
13
|
+
}
|