@brilo/base-blocks 0.1.12 → 0.1.14
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/blocks/column/column-item/constants.d.ts +17 -0
- package/build/blocks/column/column-item/constants.d.ts.map +1 -1
- package/build/blocks/column/column-item/constants.js +23 -1
- package/build/blocks/column/column-item/edit.d.ts.map +1 -1
- package/build/blocks/column/column-item/edit.js +3 -3
- package/build/blocks/column/column-item/factory.d.ts.map +1 -1
- package/build/blocks/column/column-item/factory.js +4 -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/column/column-item/types.d.ts +1 -0
- package/build/blocks/column/column-item/types.d.ts.map +1 -1
- package/build/blocks/contact/contact-item/index.d.ts +1 -0
- package/build/blocks/contact/contact-item/index.d.ts.map +1 -1
- package/build/blocks/contact/contact-item/index.js +2 -0
- package/build/blocks/form/form-field/constants.d.ts +20 -0
- package/build/blocks/form/form-field/constants.d.ts.map +1 -1
- package/build/blocks/form/form-field/constants.js +9 -0
- package/build/blocks/form/form-field/edit.d.ts +1 -1
- package/build/blocks/form/form-field/edit.d.ts.map +1 -1
- package/build/blocks/form/form-field/edit.js +2 -2
- package/build/blocks/form/form-field/factory.d.ts.map +1 -1
- package/build/blocks/form/form-field/factory.js +1 -0
- package/build/blocks/form/form-field/types.d.ts +3 -1
- package/build/blocks/form/form-field/types.d.ts.map +1 -1
- package/build/blocks/groups/banner-group/icon.d.ts.map +1 -1
- package/build/blocks/groups/banner-group/icon.js +1 -1
- package/build/blocks/groups/button-group/index.d.ts.map +1 -1
- package/build/blocks/groups/button-group/index.js +0 -1
- package/build/blocks/hero/hero-group/icon.d.ts.map +1 -1
- package/build/blocks/hero/hero-group/icon.js +1 -1
- package/build/blocks/person/person-group/icon.d.ts.map +1 -1
- package/build/blocks/person/person-group/icon.js +1 -1
- package/build/components/ImagePicker/ImagePicker.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/column/column-item/constants.ts +24 -1
- package/src/blocks/column/column-item/edit.tsx +14 -3
- package/src/blocks/column/column-item/factory.tsx +4 -0
- package/src/blocks/column/column-item/index.ts +2 -0
- package/src/blocks/column/column-item/types.ts +1 -0
- package/src/blocks/contact/contact-item/index.ts +2 -0
- package/src/blocks/form/form-field/constants.ts +10 -0
- package/src/blocks/form/form-field/edit.tsx +13 -2
- package/src/blocks/form/form-field/factory.tsx +1 -0
- package/src/blocks/form/form-field/types.ts +3 -1
- package/src/blocks/groups/banner-group/icon.tsx +3 -3
- package/src/blocks/groups/button-group/index.ts +0 -1
- package/src/blocks/hero/hero-group/icon.tsx +3 -3
- package/src/blocks/person/person-group/icon.tsx +3 -3
- package/src/components/ImagePicker/ImagePicker.tsx +1 -1
- package/src/index.ts +1 -0
|
@@ -12,4 +12,21 @@ export declare const ALIGN: ({
|
|
|
12
12
|
label: import("@wordpress/i18n").TransformedText<"Dolu">;
|
|
13
13
|
icon: import("react").JSX.Element;
|
|
14
14
|
})[];
|
|
15
|
+
export declare const JUSTIFY: ({
|
|
16
|
+
value: string;
|
|
17
|
+
label: import("@wordpress/i18n").TransformedText<"Roztáhnout">;
|
|
18
|
+
icon: import("react").JSX.Element;
|
|
19
|
+
} | {
|
|
20
|
+
value: string;
|
|
21
|
+
label: import("@wordpress/i18n").TransformedText<"Vlevo">;
|
|
22
|
+
icon: import("react").JSX.Element;
|
|
23
|
+
} | {
|
|
24
|
+
value: string;
|
|
25
|
+
label: import("@wordpress/i18n").TransformedText<"Uprostřed">;
|
|
26
|
+
icon: import("react").JSX.Element;
|
|
27
|
+
} | {
|
|
28
|
+
value: string;
|
|
29
|
+
label: import("@wordpress/i18n").TransformedText<"Vpravo">;
|
|
30
|
+
icon: import("react").JSX.Element;
|
|
31
|
+
})[];
|
|
15
32
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,UAAoD,CAAA;AACtE,eAAO,MAAM,KAAK;;;;;;;;;;;;IAgBjB,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,UAAoD,CAAA;AACtE,eAAO,MAAM,KAAK;;;;;;;;;;;;IAgBjB,CAAA;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;IAqBnB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import { justifyTop, justifyCenterVertical, justifyBottom } from '@wordpress/icons';
|
|
2
|
+
import { justifyTop, justifyCenterVertical, justifyBottom, justifyStretch, justifyLeft, justifyRight, justifyCenter } from '@wordpress/icons';
|
|
3
3
|
export const SIZES = ['1/6', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1'];
|
|
4
4
|
export const ALIGN = [
|
|
5
5
|
{
|
|
@@ -18,3 +18,25 @@ export const ALIGN = [
|
|
|
18
18
|
icon: justifyBottom,
|
|
19
19
|
},
|
|
20
20
|
];
|
|
21
|
+
export const JUSTIFY = [
|
|
22
|
+
{
|
|
23
|
+
value: 'stretch',
|
|
24
|
+
label: __('Roztáhnout', 'brilo-blocks'),
|
|
25
|
+
icon: justifyStretch,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: 'start',
|
|
29
|
+
label: __('Vlevo', 'brilo-blocks'),
|
|
30
|
+
icon: justifyLeft,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: 'center',
|
|
34
|
+
label: __('Uprostřed', 'brilo-blocks'),
|
|
35
|
+
icon: justifyCenter,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 'end',
|
|
39
|
+
label: __('Vpravo', 'brilo-blocks'),
|
|
40
|
+
icon: justifyRight,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/edit.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAIpE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,IACxC,gCAGlB;IACD,UAAU,EAAE,oBAAoB,CAAA;IAChC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAA;CAC1D,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/edit.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAIpE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,IACxC,gCAGlB;IACD,UAAU,EAAE,oBAAoB,CAAA;IAChC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAA;CAC1D,iCAqDF"}
|
|
@@ -4,11 +4,11 @@ import { PanelBody, RangeControl, __experimentalToggleGroupControl as ToggleGrou
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useGroupBlock } from '../../../hooks/useGroupBlock';
|
|
7
|
-
import { ALIGN, SIZES } from './constants';
|
|
7
|
+
import { ALIGN, JUSTIFY, SIZES } from './constants';
|
|
8
8
|
export function createColumnItemEdit(options) {
|
|
9
9
|
return function Edit({ attributes, setAttributes, }) {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
const { size, align } = attributes;
|
|
11
|
+
const { size, align, justify } = attributes;
|
|
12
12
|
const { blockProps, innerBlocksProps } = useGroupBlock({
|
|
13
13
|
blockClassName: clsx((_a = options.blockClassName) !== null && _a !== void 0 ? _a : 'i-column', `--size-${size}`, align && `--align-${align}`),
|
|
14
14
|
containerClassName: (_b = options.containerClassName) !== null && _b !== void 0 ? _b : 'i-column__inner',
|
|
@@ -16,6 +16,6 @@ export function createColumnItemEdit(options) {
|
|
|
16
16
|
template: options.template,
|
|
17
17
|
});
|
|
18
18
|
const sizeIndex = SIZES.indexOf(size);
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx(InspectorControls, { children: _jsxs(PanelBody, { title: __('Nastavení položky sloupce', 'brilo-blocks'), children: [_jsx(RangeControl, { label: __('Šířka sloupce', 'brilo-blocks'), value: sizeIndex, onChange: (v) => setAttributes({ size: SIZES[v] }), min: 0, max: SIZES.length - 1, withInputField: false, marks: SIZES.map((s, i) => ({ label: s, value: i })) }), _jsx(ToggleGroupControl, { label: __('
|
|
19
|
+
return (_jsxs(_Fragment, { children: [_jsx(InspectorControls, { children: _jsxs(PanelBody, { title: __('Nastavení položky sloupce', 'brilo-blocks'), children: [_jsx(RangeControl, { label: __('Šířka sloupce', 'brilo-blocks'), value: sizeIndex, onChange: (v) => setAttributes({ size: SIZES[v] }), min: 0, max: SIZES.length - 1, withInputField: false, marks: SIZES.map((s, i) => ({ label: s, value: i })) }), _jsx(ToggleGroupControl, { label: __('Vertikální zarovnání', 'brilo-blocks'), value: align, onChange: (v) => setAttributes({ align: v }), isBlock: true, children: ALIGN.map((item) => (_jsx(ToggleGroupControlOptionIcon, { value: item.value, label: item.label, icon: item.icon }, item.value))) }), _jsx(ToggleGroupControl, { label: __('Horizontální zarovnání', 'brilo-blocks'), value: justify, onChange: (v) => setAttributes({ justify: v }), isBlock: true, children: JUSTIFY.map((item) => (_jsx(ToggleGroupControlOptionIcon, { value: item.value, label: item.label, icon: item.icon }, item.value))) })] }) }), _jsx("div", { ...blockProps, children: _jsx("div", { ...innerBlocksProps }) })] }));
|
|
20
20
|
};
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/factory.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAGzD,OAAO,KAAK,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAGpE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/factory.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAGzD,OAAO,KAAK,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAGpE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,CA0B1G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAE/C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAE/C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,kBAAkB,EAAE,iBAgBhC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc;CAAG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { ContactIconSize, ContactIconSizeVariant, ContactItemAttributes, ContactItemOptions } from './types';
|
|
2
2
|
export { createContactItemBlock } from './factory';
|
|
3
|
+
export { createContactItemEdit } from './edit';
|
|
3
4
|
export { CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES } from './constants';
|
|
4
5
|
import type { ContactItemOptions } from './types';
|
|
5
6
|
export declare const contactItemDefaults: ContactItemOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-item/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,eAAe,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAC/G,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AAChD,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAA;AAE3F,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-item/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,eAAe,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAC/G,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AAChD,OAAO,EAAC,qBAAqB,EAAC,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAA;AAE3F,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,mBAAmB,EAAE,kBAiBjC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createContactItemBlock } from './factory';
|
|
2
|
+
export { createContactItemEdit } from './edit';
|
|
2
3
|
export { CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES } from './constants';
|
|
3
4
|
export const contactItemDefaults = {
|
|
4
5
|
name: 'brilo/contact-item',
|
|
@@ -11,6 +12,7 @@ export const contactItemDefaults = {
|
|
|
11
12
|
'core/table',
|
|
12
13
|
'brilo/column-group',
|
|
13
14
|
'brilo/responsive-grid-group',
|
|
15
|
+
'brilo/link-item',
|
|
14
16
|
],
|
|
15
17
|
template: [
|
|
16
18
|
['core/heading', { level: 3 }],
|
|
@@ -12,6 +12,26 @@ export declare const FIELD_TYPES: readonly [{
|
|
|
12
12
|
readonly value: "hidden";
|
|
13
13
|
readonly label: import("@wordpress/i18n").TransformedText<"Hidden">;
|
|
14
14
|
}];
|
|
15
|
+
export declare const FIELD_TEXT_TYPE_VALUES: readonly ["text", "tel", "email", "number", "date", "time"];
|
|
16
|
+
export declare const FIELD_TEXT_TYPES: ({
|
|
17
|
+
value: "text";
|
|
18
|
+
label: import("@wordpress/i18n").TransformedText<"Text">;
|
|
19
|
+
} | {
|
|
20
|
+
value: "tel";
|
|
21
|
+
label: import("@wordpress/i18n").TransformedText<"Telefon">;
|
|
22
|
+
} | {
|
|
23
|
+
value: "email";
|
|
24
|
+
label: import("@wordpress/i18n").TransformedText<"Email">;
|
|
25
|
+
} | {
|
|
26
|
+
value: "number";
|
|
27
|
+
label: import("@wordpress/i18n").TransformedText<"Číslo">;
|
|
28
|
+
} | {
|
|
29
|
+
value: "date";
|
|
30
|
+
label: import("@wordpress/i18n").TransformedText<"Datum">;
|
|
31
|
+
} | {
|
|
32
|
+
value: "time";
|
|
33
|
+
label: import("@wordpress/i18n").TransformedText<"Čas">;
|
|
34
|
+
})[];
|
|
15
35
|
export declare const FIELD_COLUMNS_RANGE: {
|
|
16
36
|
readonly min: 1;
|
|
17
37
|
readonly max: 12;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,mDAAoD,CAAA;AAElF,eAAO,MAAM,WAAW;;;;;;;;;;;;EAKd,CAAA;AAEV,eAAO,MAAM,mBAAmB;;;CAA6B,CAAA;AAE7D,eAAO,MAAM,qBAAqB,IAAI,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,mDAAoD,CAAA;AAElF,eAAO,MAAM,WAAW;;;;;;;;;;;;EAKd,CAAA;AAEV,eAAO,MAAM,sBAAsB,6DAA8D,CAAA;AACjG,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;IAO5B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;CAA6B,CAAA;AAE7D,eAAO,MAAM,qBAAqB,IAAI,CAAA"}
|
|
@@ -6,5 +6,14 @@ export const FIELD_TYPES = [
|
|
|
6
6
|
{ value: FIELD_TYPE_VALUES[2], label: __('Select', 'brilo-blocks') },
|
|
7
7
|
{ value: FIELD_TYPE_VALUES[3], label: __('Hidden', 'brilo-blocks') },
|
|
8
8
|
];
|
|
9
|
+
export const FIELD_TEXT_TYPE_VALUES = ['text', 'tel', 'email', 'number', 'date', 'time'];
|
|
10
|
+
export const FIELD_TEXT_TYPES = [
|
|
11
|
+
{ value: FIELD_TEXT_TYPE_VALUES[0], label: __('Text', 'brilo-blocks') },
|
|
12
|
+
{ value: FIELD_TEXT_TYPE_VALUES[1], label: __('Telefon', 'brilo-blocks') },
|
|
13
|
+
{ value: FIELD_TEXT_TYPE_VALUES[2], label: __('Email', 'brilo-blocks') },
|
|
14
|
+
{ value: FIELD_TEXT_TYPE_VALUES[3], label: __('Číslo', 'brilo-blocks') },
|
|
15
|
+
{ value: FIELD_TEXT_TYPE_VALUES[4], label: __('Datum', 'brilo-blocks') },
|
|
16
|
+
{ value: FIELD_TEXT_TYPE_VALUES[5], label: __('Čas', 'brilo-blocks') },
|
|
17
|
+
];
|
|
9
18
|
export const FIELD_COLUMNS_RANGE = { min: 1, max: 12 };
|
|
10
19
|
export const FIELD_COLUMNS_DEFAULT = 6;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FormFieldAttributes, FormFieldOptions } from './types';
|
|
2
2
|
export declare function createFormFieldEdit(_options: FormFieldOptions): ({ attributes, setAttributes, }: {
|
|
3
3
|
attributes: FormFieldAttributes;
|
|
4
4
|
setAttributes: (a: Partial<FormFieldAttributes>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/edit.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/edit.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,mBAAmB,EAAE,gBAAgB,EAAmC,MAAM,SAAS,CAAA;AAe/F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,IACvC,gCAGlB;IACD,UAAU,EAAE,mBAAmB,CAAA;IAC/B,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAA;CACzD,iCAiKF"}
|
|
@@ -3,7 +3,7 @@ import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
|
3
3
|
import { Button, FormTokenField, PanelBody, RangeControl, SelectControl, TextControl, ToggleControl } from '@wordpress/components';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { FIELD_COLUMNS_DEFAULT, FIELD_COLUMNS_RANGE, FIELD_TYPES } from './constants';
|
|
6
|
+
import { FIELD_COLUMNS_DEFAULT, FIELD_COLUMNS_RANGE, FIELD_TEXT_TYPES, FIELD_TYPES } from './constants';
|
|
7
7
|
const { min: MIN_COLUMNS, max: MAX_COLUMNS } = FIELD_COLUMNS_RANGE;
|
|
8
8
|
function sanitizeHtmlName(raw) {
|
|
9
9
|
return (raw !== null && raw !== void 0 ? raw : '')
|
|
@@ -24,7 +24,7 @@ export function createFormFieldEdit(_options) {
|
|
|
24
24
|
});
|
|
25
25
|
const options = Array.isArray(attributes.options) ? attributes.options.filter((opt) => typeof opt === 'string') : [];
|
|
26
26
|
const selectOptions = [{ label: __('Žádná', 'brilo-blocks'), value: '' }, ...options.map((opt) => ({ label: opt, value: opt }))];
|
|
27
|
-
return (_jsxs(_Fragment, { children: [_jsx(InspectorControls, { children: _jsxs(PanelBody, { title: __('Pole formuláře', 'brilo-blocks'), children: [_jsx(SelectControl, { label: __('Typ inputu', 'brilo-blocks'), value: attributes.type, options: FIELD_TYPES.map((t) => ({ label: t.label, value: t.value })), onChange: (type) => setAttributes({ type: type }) }), attributes.type !== 'hidden' && (_jsxs(_Fragment, { children: [_jsx(TextControl, { label: __('Popisek', 'brilo-blocks'), value: attributes.label, onChange: (label) => setAttributes({ label }) }), _jsx(ToggleControl, { label: __('Povinné', 'brilo-blocks'), checked: attributes.required, onChange: (required) => setAttributes({ required }) }), _jsx(TextControl, { label: __('Název html atributu', 'brilo-blocks'), value: attributes.name, help: __('Použijte pouze bezpečné znaky: a-z, 0-9, pomlčka a podtržítko. Např. city-born-to. Mezery a diakritika se automaticky odstraní.', 'brilo-blocks'), onChange: (name) => setAttributes({ name: sanitizeHtmlName(name) }) }), _jsx(TextControl, { label: __('Placeholder', 'brilo-blocks'), value: attributes.placeholder, onChange: (placeholder) => setAttributes({ placeholder }) })] })), attributes.type === 'select' && (_jsxs(_Fragment, { children: [_jsx(FormTokenField, { label: __('Možnosti', 'brilo-blocks'), value: options, onChange: (nextOptions) => setAttributes({
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsx(InspectorControls, { children: _jsxs(PanelBody, { title: __('Pole formuláře', 'brilo-blocks'), children: [_jsx(SelectControl, { label: __('Typ inputu', 'brilo-blocks'), value: attributes.type, options: FIELD_TYPES.map((t) => ({ label: t.label, value: t.value })), onChange: (type) => setAttributes({ type: type }) }), attributes.type === 'text' && (_jsx(_Fragment, { children: _jsx(SelectControl, { label: __('Typ textovho inputu', 'brilo-blocks'), value: attributes.textType, options: FIELD_TEXT_TYPES.map((t) => ({ label: t.label, value: t.value })), onChange: (fieldType) => setAttributes({ textType: fieldType }) }) })), attributes.type !== 'hidden' && (_jsxs(_Fragment, { children: [_jsx(TextControl, { label: __('Popisek', 'brilo-blocks'), value: attributes.label, onChange: (label) => setAttributes({ label }) }), _jsx(ToggleControl, { label: __('Povinné', 'brilo-blocks'), checked: attributes.required, onChange: (required) => setAttributes({ required }) }), _jsx(TextControl, { label: __('Název html atributu', 'brilo-blocks'), value: attributes.name, help: __('Použijte pouze bezpečné znaky: a-z, 0-9, pomlčka a podtržítko. Např. city-born-to. Mezery a diakritika se automaticky odstraní.', 'brilo-blocks'), onChange: (name) => setAttributes({ name: sanitizeHtmlName(name) }) }), _jsx(TextControl, { label: __('Placeholder', 'brilo-blocks'), value: attributes.placeholder, onChange: (placeholder) => setAttributes({ placeholder }) })] })), attributes.type === 'select' && (_jsxs(_Fragment, { children: [_jsx(FormTokenField, { label: __('Možnosti', 'brilo-blocks'), value: options, onChange: (nextOptions) => setAttributes({
|
|
28
28
|
options: (nextOptions !== null && nextOptions !== void 0 ? nextOptions : [])
|
|
29
29
|
.map((opt) => (typeof opt === 'string' ? opt : opt.value))
|
|
30
30
|
.filter((opt) => typeof opt === 'string' && opt.length > 0),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAIzD,OAAO,KAAK,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAA;AAElE,YAAY,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,CAAA;AAEnD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAIzD,OAAO,KAAK,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAA;AAElE,YAAY,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,CAAA;AAEnD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAwBvG"}
|
|
@@ -13,6 +13,7 @@ export function createFormFieldBlock(options) {
|
|
|
13
13
|
supports: { html: false, customClassName: false, reusable: false },
|
|
14
14
|
attributes: {
|
|
15
15
|
type: { type: 'string', default: 'text' },
|
|
16
|
+
textType: { type: 'string', default: 'text' },
|
|
16
17
|
columns: { type: 'number', default: FIELD_COLUMNS_DEFAULT },
|
|
17
18
|
label: { type: 'string', default: '' },
|
|
18
19
|
name: { type: 'string', default: '' },
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { FIELD_TYPE_VALUES } from './constants';
|
|
1
|
+
import { FIELD_TEXT_TYPE_VALUES, FIELD_TYPE_VALUES } from './constants';
|
|
2
2
|
import type { BriloBlockType } from '../../../types';
|
|
3
3
|
export type FormFieldType = (typeof FIELD_TYPE_VALUES)[number];
|
|
4
|
+
export type FormFieldTextType = (typeof FIELD_TEXT_TYPE_VALUES)[number];
|
|
4
5
|
export interface FormFieldAttributes extends Record<string, unknown> {
|
|
5
6
|
type: FormFieldType;
|
|
7
|
+
textType: FormFieldTextType;
|
|
6
8
|
columns: number;
|
|
7
9
|
label: string;
|
|
8
10
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/form/form-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,sBAAsB,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAA;AACvF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC9D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvE,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAClE,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/groups/banner-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAYhB,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/groups/banner-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAYhB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const icon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { x: "0.5", y: "5.5", width: "19", height: "8", stroke: "black", fill: "none" }), _jsx("path", { d: "M2 8H8V9H2V8Z", fill: "black" }), _jsx("path", { d: "M2 10H9V11H2V10Z", fill: "black" }), _jsx("path", {
|
|
2
|
+
export const icon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { x: "0.5", y: "5.5", width: "19", height: "8", stroke: "black", fill: "none" }), _jsx("path", { d: "M2 8H8V9H2V8Z", fill: "black" }), _jsx("path", { d: "M2 10H9V11H2V10Z", fill: "black" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.5 8C10.6716 8 10 8.67157 10 9.5C10 10.3284 10.6716 11 11.5 11H16.5C17.3284 11 18 10.3284 18 9.5C18 8.67157 17.3284 8 16.5 8H11.5ZM16 9H12V10H16V9Z", fill: "#357AB5" })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/groups/button-group/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AAEhD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/groups/button-group/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AAEhD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,mBAAmB,EAAE,kBAIjC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/hero/hero-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BA2BhB,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/hero/hero-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BA2BhB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const icon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M4 4H8V5H4V4Z", fill: "black" }), _jsx("path", { d: "M7 19H9V20H7V19Z", fill: "black" }), _jsx("path", { d: "M10 19H11V20H10V19Z", fill: "black" }), _jsx("path", { d: "M12 19H13V20H12V19Z", fill: "black" }), _jsx("path", { d: "M9 4H16V5H9V4Z", fill: "black" }), _jsx("path", { d: "M12 2C12 1.44772 12.4477 1 13 1H14C14.5523 1 15 1.44772 15 2C15 2.55228 14.5523 3 14 3H13C12.4477 3 12 2.55228 12 2Z", fill: "black" }), _jsx("path", { d: "M5 2C5 1.44772 5.44772 1 6 1H10C10.5523 1 11 1.44772 11 2C11 2.55228 10.5523 3 10 3H6C5.44772 3 5 2.55228 5 2Z", fill: "black" }), _jsx("path", {
|
|
2
|
+
export const icon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M4 4H8V5H4V4Z", fill: "black" }), _jsx("path", { d: "M7 19H9V20H7V19Z", fill: "black" }), _jsx("path", { d: "M10 19H11V20H10V19Z", fill: "black" }), _jsx("path", { d: "M12 19H13V20H12V19Z", fill: "black" }), _jsx("path", { d: "M9 4H16V5H9V4Z", fill: "black" }), _jsx("path", { d: "M12 2C12 1.44772 12.4477 1 13 1H14C14.5523 1 15 1.44772 15 2C15 2.55228 14.5523 3 14 3H13C12.4477 3 12 2.55228 12 2Z", fill: "black" }), _jsx("path", { d: "M5 2C5 1.44772 5.44772 1 6 1H10C10.5523 1 11 1.44772 11 2C11 2.55228 10.5523 3 10 3H6C5.44772 3 5 2.55228 5 2Z", fill: "black" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5 11L6 15L13 15L9.5 11Z", fill: "black" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 10L1 7H19V10H18V8H2V10H1ZM19 15V18H1L1 15H2V17H18V15H19Z", fill: "black" }), _jsx("path", { d: "M14 11C14 11.5523 13.5523 12 13 12C12.4477 12 12 11.5523 12 11C12 10.4477 12.4477 10 13 10C13.5523 10 14 10.4477 14 11Z", fill: "black" }), _jsx("path", { d: "M0 12.5C0 11.6716 0.671573 11 1.5 11C2.32843 11 3 11.6716 3 12.5C3 13.3284 2.32843 14 1.5 14C0.671573 14 0 13.3284 0 12.5Z", fill: "#357AB5" }), _jsx("path", { d: "M17 12.5C17 11.6716 17.6716 11 18.5 11C19.3284 11 20 11.6716 20 12.5C20 13.3284 19.3284 14 18.5 14C17.6716 14 17 13.3284 17 12.5Z", fill: "#357AB5" })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/person/person-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAahB,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/person/person-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAahB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const icon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { x: "2.5", y: "1.5", width: "15", height: "17", stroke: "black", fill: "none" }), _jsx("path", { d: "M7 13H13V14H7V13Z", fill: "black" }), _jsx("path", { d: "M6 15H14V16H6V15Z", fill: "black" }), _jsx("path", { d: "M8 6C8 4.89543 8.89543 4 10 4C11.1046 4 12 4.89543 12 6C12 7.10457 11.1046 8 10 8C8.89543 8 8 7.10457 8 6Z", fill: "#357AB5" }), _jsx("path", {
|
|
2
|
+
export const icon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { x: "2.5", y: "1.5", width: "15", height: "17", stroke: "black", fill: "none" }), _jsx("path", { d: "M7 13H13V14H7V13Z", fill: "black" }), _jsx("path", { d: "M6 15H14V16H6V15Z", fill: "black" }), _jsx("path", { d: "M8 6C8 4.89543 8.89543 4 10 4C11.1046 4 12 4.89543 12 6C12 7.10457 11.1046 8 10 8C8.89543 8 8 7.10457 8 6Z", fill: "#357AB5" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.99664 11H13.0009C12.9997 9.34295 11.6561 8 9.99875 8C8.34144 8 6.99778 9.34295 6.99664 11Z", fill: "#357AB5" })] }));
|
|
@@ -8,7 +8,7 @@ export function useMediaData(id) {
|
|
|
8
8
|
if (!id)
|
|
9
9
|
return {};
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
const media = select('core').
|
|
11
|
+
const media = select('core').getEntityRecord('postType', 'attachment', id);
|
|
12
12
|
return {
|
|
13
13
|
url: media === null || media === void 0 ? void 0 : media.source_url,
|
|
14
14
|
mimeType: media === null || media === void 0 ? void 0 : media.mime_type,
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { ContactColumns, ContactGroupAttributes, ContactGroupOptions, } from './blocks/contact/contact-group';
|
|
2
2
|
export { CONTACT_COLUMNS, CONTACT_COLUMNS_CONTEXT, contactGroupDefaults, createContactGroupBlock, } from './blocks/contact/contact-group';
|
|
3
3
|
export type { ContactIconSize, ContactIconSizeVariant, ContactItemAttributes, ContactItemOptions, } from './blocks/contact/contact-item';
|
|
4
|
-
export { CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES, contactItemDefaults, createContactItemBlock, } from './blocks/contact/contact-item';
|
|
4
|
+
export { CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES, contactItemDefaults, createContactItemBlock, createContactItemEdit, } from './blocks/contact/contact-item';
|
|
5
5
|
export type { FaqItemAttributes, FaqItemOptions } from './blocks/faq/faq-item';
|
|
6
6
|
export { createFaqItemBlock, faqItemDefaults } from './blocks/faq/faq-item';
|
|
7
7
|
export type { FaqGroupAttributes, FaqGroupOptions } from './blocks/faq/faq-group';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,+BAA+B,CAAA;AACtC,YAAY,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAA;AAC5E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gBAAgB,EAAC,MAAM,yBAAyB,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CONTACT_COLUMNS, CONTACT_COLUMNS_CONTEXT, contactGroupDefaults, createContactGroupBlock, } from './blocks/contact/contact-group';
|
|
2
|
-
export { CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES, contactItemDefaults, createContactItemBlock, } from './blocks/contact/contact-item';
|
|
2
|
+
export { CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES, contactItemDefaults, createContactItemBlock, createContactItemEdit, } from './blocks/contact/contact-item';
|
|
3
3
|
export { createFaqItemBlock, faqItemDefaults } from './blocks/faq/faq-item';
|
|
4
4
|
export { createFaqGroupBlock, faqGroupDefaults } from './blocks/faq/faq-group';
|
|
5
5
|
export { basicButtonDefaults, createBasicButtonBlock } from './blocks/core/basic-button';
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {__} from '@wordpress/i18n'
|
|
2
|
-
import {justifyTop, justifyCenterVertical, justifyBottom} from '@wordpress/icons'
|
|
2
|
+
import {justifyTop, justifyCenterVertical, justifyBottom, justifyStretch, justifyLeft, justifyRight, justifyCenter} from '@wordpress/icons'
|
|
3
3
|
|
|
4
4
|
export const SIZES = ['1/6', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1']
|
|
5
5
|
export const ALIGN = [
|
|
@@ -19,3 +19,26 @@ export const ALIGN = [
|
|
|
19
19
|
icon: justifyBottom,
|
|
20
20
|
},
|
|
21
21
|
]
|
|
22
|
+
|
|
23
|
+
export const JUSTIFY = [
|
|
24
|
+
{
|
|
25
|
+
value: 'stretch',
|
|
26
|
+
label: __('Roztáhnout', 'brilo-blocks'),
|
|
27
|
+
icon: justifyStretch,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'start',
|
|
31
|
+
label: __('Vlevo', 'brilo-blocks'),
|
|
32
|
+
icon: justifyLeft,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: 'center',
|
|
36
|
+
label: __('Uprostřed', 'brilo-blocks'),
|
|
37
|
+
icon: justifyCenter,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'end',
|
|
41
|
+
label: __('Vpravo', 'brilo-blocks'),
|
|
42
|
+
icon: justifyRight,
|
|
43
|
+
},
|
|
44
|
+
]
|
|
@@ -9,7 +9,7 @@ import {__} from '@wordpress/i18n'
|
|
|
9
9
|
import clsx from 'clsx'
|
|
10
10
|
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
11
11
|
import type {ColumnItemAttributes, ColumnItemOptions} from './types'
|
|
12
|
-
import {ALIGN, SIZES} from './constants'
|
|
12
|
+
import {ALIGN, JUSTIFY, SIZES} from './constants'
|
|
13
13
|
import {Icon} from '@wordpress/icons'
|
|
14
14
|
|
|
15
15
|
export function createColumnItemEdit(options: ColumnItemOptions) {
|
|
@@ -20,7 +20,7 @@ export function createColumnItemEdit(options: ColumnItemOptions) {
|
|
|
20
20
|
attributes: ColumnItemAttributes
|
|
21
21
|
setAttributes: (a: Partial<ColumnItemAttributes>) => void
|
|
22
22
|
}) {
|
|
23
|
-
const {size, align} = attributes
|
|
23
|
+
const {size, align, justify} = attributes
|
|
24
24
|
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
25
25
|
blockClassName: clsx(options.blockClassName ?? 'i-column', `--size-${size}`, align && `--align-${align}`),
|
|
26
26
|
containerClassName: options.containerClassName ?? 'i-column__inner',
|
|
@@ -44,7 +44,7 @@ export function createColumnItemEdit(options: ColumnItemOptions) {
|
|
|
44
44
|
marks={SIZES.map((s, i) => ({label: s, value: i}))}
|
|
45
45
|
/>
|
|
46
46
|
<ToggleGroupControl
|
|
47
|
-
label={__('
|
|
47
|
+
label={__('Vertikální zarovnání', 'brilo-blocks')}
|
|
48
48
|
value={align}
|
|
49
49
|
onChange={(v) => setAttributes({align: v as string})}
|
|
50
50
|
isBlock
|
|
@@ -53,6 +53,17 @@ export function createColumnItemEdit(options: ColumnItemOptions) {
|
|
|
53
53
|
<ToggleGroupControlOptionIcon key={item.value} value={item.value} label={item.label} icon={item.icon} />
|
|
54
54
|
))}
|
|
55
55
|
</ToggleGroupControl>
|
|
56
|
+
|
|
57
|
+
<ToggleGroupControl
|
|
58
|
+
label={__('Horizontální zarovnání', 'brilo-blocks')}
|
|
59
|
+
value={justify}
|
|
60
|
+
onChange={(v) => setAttributes({justify: v as string})}
|
|
61
|
+
isBlock
|
|
62
|
+
>
|
|
63
|
+
{JUSTIFY.map((item) => (
|
|
64
|
+
<ToggleGroupControlOptionIcon key={item.value} value={item.value} label={item.label} icon={item.icon} />
|
|
65
|
+
))}
|
|
66
|
+
</ToggleGroupControl>
|
|
56
67
|
</PanelBody>
|
|
57
68
|
</InspectorControls>
|
|
58
69
|
<div {...blockProps}>
|
|
@@ -23,6 +23,10 @@ export function createColumnItemBlock(options: ColumnItemOptions): BlockConfigur
|
|
|
23
23
|
type: 'string',
|
|
24
24
|
default: ALIGN[0],
|
|
25
25
|
},
|
|
26
|
+
justify: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
default: 'stretch',
|
|
29
|
+
}
|
|
26
30
|
},
|
|
27
31
|
edit: createColumnItemEdit(options),
|
|
28
32
|
save: () => <InnerBlocks.Content />,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type {ContactIconSize, ContactIconSizeVariant, ContactItemAttributes, ContactItemOptions} from './types'
|
|
2
2
|
export {createContactItemBlock} from './factory'
|
|
3
|
+
export {createContactItemEdit} from './edit'
|
|
3
4
|
export {CONTACT_ICON_SIZE_RANGE, CONTACT_ICON_SIZES, CONTACT_ICON_TYPES} from './constants'
|
|
4
5
|
|
|
5
6
|
import type {ContactItemOptions} from './types'
|
|
@@ -15,6 +16,7 @@ export const contactItemDefaults: ContactItemOptions = {
|
|
|
15
16
|
'core/table',
|
|
16
17
|
'brilo/column-group',
|
|
17
18
|
'brilo/responsive-grid-group',
|
|
19
|
+
'brilo/link-item',
|
|
18
20
|
],
|
|
19
21
|
template: [
|
|
20
22
|
['core/heading', {level: 3}],
|
|
@@ -9,6 +9,16 @@ export const FIELD_TYPES = [
|
|
|
9
9
|
{value: FIELD_TYPE_VALUES[3], label: __('Hidden', 'brilo-blocks')},
|
|
10
10
|
] as const
|
|
11
11
|
|
|
12
|
+
export const FIELD_TEXT_TYPE_VALUES = ['text', 'tel', 'email', 'number', 'date', 'time'] as const
|
|
13
|
+
export const FIELD_TEXT_TYPES = [
|
|
14
|
+
{value: FIELD_TEXT_TYPE_VALUES[0], label: __('Text', 'brilo-blocks')},
|
|
15
|
+
{value: FIELD_TEXT_TYPE_VALUES[1], label: __('Telefon', 'brilo-blocks')},
|
|
16
|
+
{value: FIELD_TEXT_TYPE_VALUES[2], label: __('Email', 'brilo-blocks')},
|
|
17
|
+
{value: FIELD_TEXT_TYPE_VALUES[3], label: __('Číslo', 'brilo-blocks')},
|
|
18
|
+
{value: FIELD_TEXT_TYPE_VALUES[4], label: __('Datum', 'brilo-blocks')},
|
|
19
|
+
{value: FIELD_TEXT_TYPE_VALUES[5], label: __('Čas', 'brilo-blocks')},
|
|
20
|
+
]
|
|
21
|
+
|
|
12
22
|
export const FIELD_COLUMNS_RANGE = {min: 1, max: 12} as const
|
|
13
23
|
|
|
14
24
|
export const FIELD_COLUMNS_DEFAULT = 6
|
|
@@ -2,8 +2,8 @@ import {InspectorControls, useBlockProps} from '@wordpress/block-editor'
|
|
|
2
2
|
import {Button, FormTokenField, PanelBody, RangeControl, SelectControl, TextControl, ToggleControl} from '@wordpress/components'
|
|
3
3
|
import {__} from '@wordpress/i18n'
|
|
4
4
|
import clsx from 'clsx'
|
|
5
|
-
import {FIELD_COLUMNS_DEFAULT, FIELD_COLUMNS_RANGE, FIELD_TYPES} from './constants'
|
|
6
|
-
import
|
|
5
|
+
import {FIELD_COLUMNS_DEFAULT, FIELD_COLUMNS_RANGE, FIELD_TEXT_TYPES, FIELD_TYPES} from './constants'
|
|
6
|
+
import {FormFieldAttributes, FormFieldOptions, FormFieldTextType, FormFieldType} from './types'
|
|
7
7
|
|
|
8
8
|
const {min: MIN_COLUMNS, max: MAX_COLUMNS} = FIELD_COLUMNS_RANGE
|
|
9
9
|
|
|
@@ -47,6 +47,17 @@ export function createFormFieldEdit(_options: FormFieldOptions) {
|
|
|
47
47
|
onChange={(type) => setAttributes({type: type as FormFieldType})}
|
|
48
48
|
/>
|
|
49
49
|
|
|
50
|
+
{attributes.type === 'text' && (
|
|
51
|
+
<>
|
|
52
|
+
<SelectControl
|
|
53
|
+
label={__('Typ textovho inputu', 'brilo-blocks')}
|
|
54
|
+
value={attributes.textType}
|
|
55
|
+
options={FIELD_TEXT_TYPES.map((t) => ({label: t.label, value: t.value}))}
|
|
56
|
+
onChange={(fieldType) => setAttributes({textType: fieldType as FormFieldTextType})}
|
|
57
|
+
/>
|
|
58
|
+
</>
|
|
59
|
+
)}
|
|
60
|
+
|
|
50
61
|
{attributes.type !== 'hidden' && (
|
|
51
62
|
<>
|
|
52
63
|
<TextControl label={__('Popisek', 'brilo-blocks')} value={attributes.label} onChange={(label) => setAttributes({label})} />
|
|
@@ -17,6 +17,7 @@ export function createFormFieldBlock(options: FormFieldOptions): BlockConfigurat
|
|
|
17
17
|
supports: {html: false, customClassName: false, reusable: false},
|
|
18
18
|
attributes: {
|
|
19
19
|
type: {type: 'string', default: 'text'},
|
|
20
|
+
textType: {type: 'string', default: 'text'},
|
|
20
21
|
columns: {type: 'number', default: FIELD_COLUMNS_DEFAULT},
|
|
21
22
|
label: {type: 'string', default: ''},
|
|
22
23
|
name: {type: 'string', default: ''},
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {FIELD_TYPE_VALUES} from './constants'
|
|
1
|
+
import {FIELD_TEXT_TYPES, FIELD_TEXT_TYPE_VALUES, FIELD_TYPE_VALUES} from './constants'
|
|
2
2
|
import type {BriloBlockType} from '~/types'
|
|
3
3
|
|
|
4
4
|
export type FormFieldType = (typeof FIELD_TYPE_VALUES)[number]
|
|
5
|
+
export type FormFieldTextType = (typeof FIELD_TEXT_TYPE_VALUES)[number]
|
|
5
6
|
|
|
6
7
|
export interface FormFieldAttributes extends Record<string, unknown> {
|
|
7
8
|
type: FormFieldType
|
|
9
|
+
textType: FormFieldTextType
|
|
8
10
|
columns: number
|
|
9
11
|
label: string
|
|
10
12
|
name: string
|
|
@@ -4,10 +4,10 @@ export const icon = (
|
|
|
4
4
|
<path d="M2 8H8V9H2V8Z" fill="black" />
|
|
5
5
|
<path d="M2 10H9V11H2V10Z" fill="black" />
|
|
6
6
|
<path
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
9
|
d="M11.5 8C10.6716 8 10 8.67157 10 9.5C10 10.3284 10.6716 11 11.5 11H16.5C17.3284 11 18 10.3284 18 9.5C18 8.67157 17.3284 8 16.5 8H11.5ZM16 9H12V10H16V9Z"
|
|
10
10
|
fill="#357AB5"
|
|
11
11
|
/>
|
|
12
12
|
</svg>
|
|
13
|
-
)
|
|
13
|
+
);
|
|
@@ -10,8 +10,8 @@ export const icon = (
|
|
|
10
10
|
fill="black"
|
|
11
11
|
/>
|
|
12
12
|
<path d="M5 2C5 1.44772 5.44772 1 6 1H10C10.5523 1 11 1.44772 11 2C11 2.55228 10.5523 3 10 3H6C5.44772 3 5 2.55228 5 2Z" fill="black" />
|
|
13
|
-
<path
|
|
14
|
-
<path
|
|
13
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M9.5 11L6 15L13 15L9.5 11Z" fill="black" />
|
|
14
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M1 10L1 7H19V10H18V8H2V10H1ZM19 15V18H1L1 15H2V17H18V15H19Z" fill="black" />
|
|
15
15
|
<path
|
|
16
16
|
d="M14 11C14 11.5523 13.5523 12 13 12C12.4477 12 12 11.5523 12 11C12 10.4477 12.4477 10 13 10C13.5523 10 14 10.4477 14 11Z"
|
|
17
17
|
fill="black"
|
|
@@ -25,4 +25,4 @@ export const icon = (
|
|
|
25
25
|
fill="#357AB5"
|
|
26
26
|
/>
|
|
27
27
|
</svg>
|
|
28
|
-
)
|
|
28
|
+
);
|
|
@@ -5,10 +5,10 @@ export const icon = (
|
|
|
5
5
|
<path d="M6 15H14V16H6V15Z" fill="black" />
|
|
6
6
|
<path d="M8 6C8 4.89543 8.89543 4 10 4C11.1046 4 12 4.89543 12 6C12 7.10457 11.1046 8 10 8C8.89543 8 8 7.10457 8 6Z" fill="#357AB5" />
|
|
7
7
|
<path
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
fillRule="evenodd"
|
|
9
|
+
clipRule="evenodd"
|
|
10
10
|
d="M6.99664 11H13.0009C12.9997 9.34295 11.6561 8 9.99875 8C8.34144 8 6.99778 9.34295 6.99664 11Z"
|
|
11
11
|
fill="#357AB5"
|
|
12
12
|
/>
|
|
13
13
|
</svg>
|
|
14
|
-
)
|
|
14
|
+
);
|
|
@@ -30,7 +30,7 @@ export function useMediaData(id: number): {url?: string; mimeType?: string} {
|
|
|
30
30
|
(select) => {
|
|
31
31
|
if (!id) return {}
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
-
const media = (select('core') as any).
|
|
33
|
+
const media = (select('core') as any).getEntityRecord('postType', 'attachment', id)
|
|
34
34
|
return {
|
|
35
35
|
url: media?.source_url as string | undefined,
|
|
36
36
|
mimeType: media?.mime_type as string | undefined,
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export {
|
|
|
21
21
|
CONTACT_ICON_TYPES,
|
|
22
22
|
contactItemDefaults,
|
|
23
23
|
createContactItemBlock,
|
|
24
|
+
createContactItemEdit,
|
|
24
25
|
} from './blocks/contact/contact-item'
|
|
25
26
|
export type {FaqItemAttributes, FaqItemOptions} from './blocks/faq/faq-item'
|
|
26
27
|
export {createFaqItemBlock, faqItemDefaults} from './blocks/faq/faq-item'
|