@brilo/base-blocks 0.1.15 → 0.1.16

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.
@@ -1,3 +1,20 @@
1
1
  export declare const CONTACT_COLUMNS: readonly [2, 3];
2
2
  export declare const CONTACT_COLUMNS_CONTEXT = "brilo/contact-columns";
3
+ export declare const DEFAULT_SHADOWS: readonly [{
4
+ readonly value: 'none';
5
+ readonly label: import("@wordpress/i18n").TransformedText<"Žádný">;
6
+ }, {
7
+ readonly value: 'sm';
8
+ readonly label: import("@wordpress/i18n").TransformedText<"Malý">;
9
+ }, {
10
+ readonly value: 'md';
11
+ readonly label: import("@wordpress/i18n").TransformedText<"Střední">;
12
+ }];
13
+ export declare const TEXT_ALIGNS: readonly [{
14
+ readonly value: 'left';
15
+ readonly label: import("@wordpress/i18n").TransformedText<"Vlevo">;
16
+ }, {
17
+ readonly value: 'center';
18
+ readonly label: import("@wordpress/i18n").TransformedText<"Na střed">;
19
+ }];
3
20
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,YAAI,CAAC,EAAE,CAAC,CAAU,CAAA;AAE9C,eAAO,MAAM,uBAAuB,0BAA0B,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,YAAI,CAAC,EAAE,CAAC,CAAU,CAAA;AAE9C,eAAO,MAAM,uBAAuB,0BAA0B,CAAA;AAE9D,eAAO,MAAM,eAAe;aACzB,KAAK,EAAE,MAAM;aAAE,KAAK;;aACpB,KAAK,EAAE,IAAI;aAAE,KAAK;;aAClB,KAAK,EAAE,IAAI;aAAE,KAAK;EACX,CAAA;AAEV,eAAO,MAAM,WAAW;aACrB,KAAK,EAAE,MAAM;aAAE,KAAK;;aACpB,KAAK,EAAE,QAAQ;aAAE,KAAK;EACf,CAAA"}
@@ -1,2 +1,12 @@
1
+ import { __ } from '@wordpress/i18n';
1
2
  export const CONTACT_COLUMNS = [2, 3];
2
3
  export const CONTACT_COLUMNS_CONTEXT = 'brilo/contact-columns';
4
+ export const DEFAULT_SHADOWS = [
5
+ { value: 'none', label: __('Žádný', 'brilo-blocks') },
6
+ { value: 'sm', label: __('Malý', 'brilo-blocks') },
7
+ { value: 'md', label: __('Střední', 'brilo-blocks') },
8
+ ];
9
+ export const TEXT_ALIGNS = [
10
+ { value: 'left', label: __('Vlevo', 'brilo-blocks') },
11
+ { value: 'center', label: __('Na střed', 'brilo-blocks') },
12
+ ];
@@ -1 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/edit.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAiB,sBAAsB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAExF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,oCAM9D;IACD,UAAU,EAAE,sBAAsB,CAAA;IAClC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAA;CAC5D,iCAmCF"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/edit.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAiB,sBAAsB,EAAE,mBAAmB,EAAkC,MAAM,SAAS,CAAA;AAEzH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,oCAM9D;IACD,UAAU,EAAE,sBAAsB,CAAA;IAClC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAA;CAC5D,iCAmFF"}
@@ -1,16 +1,18 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { InspectorControls } from '@wordpress/block-editor';
3
- import { PanelBody, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from '@wordpress/components';
3
+ import { BaseControl, ColorPalette, PanelBody, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from '@wordpress/components';
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import clsx from 'clsx';
6
6
  import { useGroupBlock } from '../../../hooks/useGroupBlock';
7
- import { CONTACT_COLUMNS } from './constants';
7
+ import { useTenantColorPalette } from '../../../hooks/useTenantColorPalette';
8
+ import { CONTACT_COLUMNS, DEFAULT_SHADOWS, TEXT_ALIGNS } from './constants';
8
9
  export function createContactGroupEdit(options) {
9
10
  var _a;
10
11
  const COLUMNS = (_a = options.columns) !== null && _a !== void 0 ? _a : CONTACT_COLUMNS;
11
12
  return function Edit({ attributes, setAttributes, }) {
12
13
  var _a, _b;
13
- const { columns } = attributes;
14
+ const { columns, style } = attributes;
15
+ const { paletteColors } = useTenantColorPalette();
14
16
  const { blockProps, innerBlocksProps } = useGroupBlock({
15
17
  blockClassName: clsx((_a = options.blockClassName) !== null && _a !== void 0 ? _a : 'g-contact wp-block-section'),
16
18
  containerClassName: [(_b = options.containerClassName) !== null && _b !== void 0 ? _b : 'g-contact__items', `--cols-${columns}`],
@@ -20,6 +22,6 @@ export function createContactGroupEdit(options) {
20
22
  template: options.template,
21
23
  layout: { type: 'default' },
22
24
  });
23
- return (_jsxs(_Fragment, { children: [_jsx(InspectorControls, { children: _jsx(PanelBody, { title: __('Rozložení', 'brilo-blocks'), children: _jsx(ToggleGroupControl, { isBlock: true, label: __('Počet sloupců', 'brilo-blocks'), value: String(columns), onChange: (v) => setAttributes({ columns: Number(v) }), children: COLUMNS.map((c) => (_jsx(ToggleGroupControlOption, { value: String(c), label: String(c) }, c))) }) }) }), _jsx("div", { ...blockProps, children: _jsx("div", { ...innerBlocksProps }) })] }));
25
+ return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsx(PanelBody, { title: __('Rozložení', 'brilo-blocks'), children: _jsx(ToggleGroupControl, { isBlock: true, label: __('Počet sloupců', 'brilo-blocks'), value: String(columns), onChange: (v) => setAttributes({ columns: Number(v) }), children: COLUMNS.map((c) => (_jsx(ToggleGroupControlOption, { value: String(c), label: String(c) }, c))) }) }), _jsxs(PanelBody, { title: __('Styl', 'brilo-blocks'), children: [_jsx(ToggleGroupControl, { isBlock: true, label: __('Stín', 'brilo-blocks'), value: style.shadow, onChange: (v) => setAttributes({ style: { ...style, shadow: v } }), children: DEFAULT_SHADOWS.map((s) => (_jsx(ToggleGroupControlOption, { value: s.value, label: s.label }, s.value))) }), _jsx(BaseControl, { label: __('Barva okraje', 'brilo-blocks'), help: __('Bez vybrané barvy se okraj nevykreslí.', 'brilo-blocks'), id: "contact-group-border-color", children: _jsx(ColorPalette, { colors: paletteColors, value: style.borderColor || undefined, onChange: (value) => setAttributes({ style: { ...style, borderColor: value !== null && value !== void 0 ? value : '' } }) }) }), _jsx(BaseControl, { label: __('Barva pozadí', 'brilo-blocks'), id: "contact-group-background-color", children: _jsx(ColorPalette, { colors: paletteColors, value: style.backgroundColor || undefined, onChange: (value) => setAttributes({ style: { ...style, backgroundColor: value !== null && value !== void 0 ? value : '' } }) }) }), _jsx(BaseControl, { label: __('Barva textu', 'brilo-blocks'), id: "contact-group-text-color", children: _jsx(ColorPalette, { colors: paletteColors, value: style.textColor || undefined, onChange: (value) => setAttributes({ style: { ...style, textColor: value !== null && value !== void 0 ? value : '' } }) }) }), _jsx(ToggleGroupControl, { isBlock: true, label: __('Zarovnání textu', 'brilo-blocks'), value: style.textAlign, onChange: (v) => setAttributes({ style: { ...style, textAlign: v } }), children: TEXT_ALIGNS.map((a) => (_jsx(ToggleGroupControlOption, { value: a.value, label: a.label }, a.value))) })] })] }), _jsx("div", { ...blockProps, children: _jsx("div", { ...innerBlocksProps }) })] }));
24
26
  };
25
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/factory.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AACxC,OAAO,EAAC,eAAe,EAA0B,MAAM,aAAa,CAAA;AAEpE,OAAO,KAAK,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAExE,YAAY,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,CAAA;AAEzD,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,WAAW,GAAG,OAAO,eAAe,EAC3F,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GACrC,kBAAkB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAsB9D"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/factory.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AACxC,OAAO,EAAC,eAAe,EAA2C,MAAM,aAAa,CAAA;AAErF,OAAO,KAAK,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAExE,YAAY,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,CAAA;AAEzD,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,WAAW,GAAG,OAAO,eAAe,EAC3F,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GACrC,kBAAkB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CA0B9D"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { InnerBlocks } from '@wordpress/block-editor';
3
3
  import { __ } from '@wordpress/i18n';
4
- import { CONTACT_COLUMNS, CONTACT_COLUMNS_CONTEXT } from './constants';
4
+ import { CONTACT_COLUMNS, CONTACT_COLUMNS_CONTEXT, DEFAULT_SHADOWS } from './constants';
5
5
  import { createContactGroupEdit } from './edit';
6
6
  export function createContactGroupBlock(options) {
7
7
  var _a, _b, _c, _d, _e;
@@ -21,6 +21,10 @@ export function createContactGroupBlock(options) {
21
21
  default: (_e = columns[1]) !== null && _e !== void 0 ? _e : columns[0],
22
22
  enum: [...columns],
23
23
  },
24
+ style: {
25
+ type: 'object',
26
+ default: { shadow: DEFAULT_SHADOWS[0].value, borderColor: '', backgroundColor: '', textColor: '', textAlign: 'left' },
27
+ },
24
28
  },
25
29
  edit: createContactGroupEdit(options),
26
30
  save: () => _jsx(InnerBlocks.Content, {}),
@@ -1,8 +1,17 @@
1
1
  import type { BriloBlockType, NumberArray } from '../../../types';
2
- import type { CONTACT_COLUMNS } from './constants';
2
+ import type { CONTACT_COLUMNS, DEFAULT_SHADOWS, TEXT_ALIGNS } from './constants';
3
3
  export type ContactColumns = (typeof CONTACT_COLUMNS)[number];
4
+ export type ContactShadow = (typeof DEFAULT_SHADOWS)[number]['value'];
5
+ export type ContactTextAlign = (typeof TEXT_ALIGNS)[number]['value'];
4
6
  export interface ContactGroupAttributes<TColumns extends number = ContactColumns> extends Record<string, unknown> {
5
7
  columns: TColumns;
8
+ style: {
9
+ shadow: ContactShadow;
10
+ borderColor: string;
11
+ backgroundColor: string;
12
+ textColor: string;
13
+ textAlign: ContactTextAlign;
14
+ };
6
15
  }
7
16
  export interface ContactGroupOptions<TColumns extends NumberArray = typeof CONTACT_COLUMNS> extends BriloBlockType {
8
17
  columns?: TColumns;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA;AACxD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,aAAa,CAAA;AAEhD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7D,MAAM,WAAW,sBAAsB,CAAC,QAAQ,SAAS,MAAM,GAAG,cAAc,CAAE,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/G,OAAO,EAAE,QAAQ,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,WAAW,GAAG,OAAO,eAAe,CAAE,SAAQ,cAAc;IAChH,OAAO,CAAC,EAAE,QAAQ,CAAA;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/contact/contact-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA;AACxD,OAAO,KAAK,EAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAC,MAAM,aAAa,CAAA;AAE9E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA;AAErE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA;AAEpE,MAAM,WAAW,sBAAsB,CAAC,QAAQ,SAAS,MAAM,GAAG,cAAc,CAAE,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/G,OAAO,EAAE,QAAQ,CAAA;IACjB,KAAK,EAAE;QACL,MAAM,EAAE,aAAa,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;QACnB,eAAe,EAAE,MAAM,CAAA;QACvB,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,gBAAgB,CAAA;KAC5B,CAAA;CACF;AAED,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,WAAW,GAAG,OAAO,eAAe,CAAE,SAAQ,cAAc;IAChH,OAAO,CAAC,EAAE,QAAQ,CAAA;CACnB"}
@@ -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,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
+ {"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,kBAkBjC,CAAA"}
@@ -13,6 +13,7 @@ export const contactItemDefaults = {
13
13
  'brilo/column-group',
14
14
  'brilo/responsive-grid-group',
15
15
  'brilo/link-item',
16
+ 'core/group',
16
17
  ],
17
18
  template: [
18
19
  ['core/heading', { level: 3 }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brilo/base-blocks",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "author": "Brilo",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,3 +1,16 @@
1
+ import {__} from '@wordpress/i18n'
2
+
1
3
  export const CONTACT_COLUMNS = [2, 3] as const
2
4
 
3
5
  export const CONTACT_COLUMNS_CONTEXT = 'brilo/contact-columns'
6
+
7
+ export const DEFAULT_SHADOWS = [
8
+ {value: 'none', label: __('Žádný', 'brilo-blocks')},
9
+ {value: 'sm', label: __('Malý', 'brilo-blocks')},
10
+ {value: 'md', label: __('Střední', 'brilo-blocks')},
11
+ ] as const
12
+
13
+ export const TEXT_ALIGNS = [
14
+ {value: 'left', label: __('Vlevo', 'brilo-blocks')},
15
+ {value: 'center', label: __('Na střed', 'brilo-blocks')},
16
+ ] as const
@@ -1,5 +1,7 @@
1
1
  import {InspectorControls} from '@wordpress/block-editor'
2
2
  import {
3
+ BaseControl,
4
+ ColorPalette,
3
5
  PanelBody,
4
6
  __experimentalToggleGroupControl as ToggleGroupControl,
5
7
  __experimentalToggleGroupControlOption as ToggleGroupControlOption,
@@ -7,8 +9,9 @@ import {
7
9
  import {__} from '@wordpress/i18n'
8
10
  import clsx from 'clsx'
9
11
  import {useGroupBlock} from '~/hooks/useGroupBlock'
10
- import {CONTACT_COLUMNS} from './constants'
11
- import type {ContactColumns, ContactGroupAttributes, ContactGroupOptions} from './types'
12
+ import {useTenantColorPalette} from '~/hooks/useTenantColorPalette'
13
+ import {CONTACT_COLUMNS, DEFAULT_SHADOWS, TEXT_ALIGNS} from './constants'
14
+ import type {ContactColumns, ContactGroupAttributes, ContactGroupOptions, ContactShadow, ContactTextAlign} from './types'
12
15
 
13
16
  export function createContactGroupEdit(options: ContactGroupOptions) {
14
17
  const COLUMNS = options.columns ?? CONTACT_COLUMNS
@@ -20,7 +23,8 @@ export function createContactGroupEdit(options: ContactGroupOptions) {
20
23
  attributes: ContactGroupAttributes
21
24
  setAttributes: (a: Partial<ContactGroupAttributes>) => void
22
25
  }) {
23
- const {columns} = attributes
26
+ const {columns, style} = attributes
27
+ const {paletteColors} = useTenantColorPalette()
24
28
 
25
29
  const {blockProps, innerBlocksProps} = useGroupBlock({
26
30
  blockClassName: clsx(options.blockClassName ?? 'g-contact wp-block-section'),
@@ -47,6 +51,53 @@ export function createContactGroupEdit(options: ContactGroupOptions) {
47
51
  ))}
48
52
  </ToggleGroupControl>
49
53
  </PanelBody>
54
+ <PanelBody title={__('Styl', 'brilo-blocks')}>
55
+ <ToggleGroupControl
56
+ isBlock
57
+ label={__('Stín', 'brilo-blocks')}
58
+ value={style.shadow}
59
+ onChange={(v) => setAttributes({style: {...style, shadow: v as ContactShadow}})}
60
+ >
61
+ {DEFAULT_SHADOWS.map((s) => (
62
+ <ToggleGroupControlOption key={s.value} value={s.value} label={s.label} />
63
+ ))}
64
+ </ToggleGroupControl>
65
+ <BaseControl
66
+ label={__('Barva okraje', 'brilo-blocks')}
67
+ help={__('Bez vybrané barvy se okraj nevykreslí.', 'brilo-blocks')}
68
+ id="contact-group-border-color"
69
+ >
70
+ <ColorPalette
71
+ colors={paletteColors}
72
+ value={style.borderColor || undefined}
73
+ onChange={(value) => setAttributes({style: {...style, borderColor: value ?? ''}})}
74
+ />
75
+ </BaseControl>
76
+ <BaseControl label={__('Barva pozadí', 'brilo-blocks')} id="contact-group-background-color">
77
+ <ColorPalette
78
+ colors={paletteColors}
79
+ value={style.backgroundColor || undefined}
80
+ onChange={(value) => setAttributes({style: {...style, backgroundColor: value ?? ''}})}
81
+ />
82
+ </BaseControl>
83
+ <BaseControl label={__('Barva textu', 'brilo-blocks')} id="contact-group-text-color">
84
+ <ColorPalette
85
+ colors={paletteColors}
86
+ value={style.textColor || undefined}
87
+ onChange={(value) => setAttributes({style: {...style, textColor: value ?? ''}})}
88
+ />
89
+ </BaseControl>
90
+ <ToggleGroupControl
91
+ isBlock
92
+ label={__('Zarovnání textu', 'brilo-blocks')}
93
+ value={style.textAlign}
94
+ onChange={(v) => setAttributes({style: {...style, textAlign: v as ContactTextAlign}})}
95
+ >
96
+ {TEXT_ALIGNS.map((a) => (
97
+ <ToggleGroupControlOption key={a.value} value={a.value} label={a.label} />
98
+ ))}
99
+ </ToggleGroupControl>
100
+ </PanelBody>
50
101
  </InspectorControls>
51
102
  <div {...blockProps}>
52
103
  <div {...innerBlocksProps} />
@@ -2,7 +2,7 @@ import {InnerBlocks} from '@wordpress/block-editor'
2
2
  import type {BlockConfiguration} from '@wordpress/blocks'
3
3
  import {__} from '@wordpress/i18n'
4
4
  import type {NumberArray} from '~/types'
5
- import {CONTACT_COLUMNS, CONTACT_COLUMNS_CONTEXT} from './constants'
5
+ import {CONTACT_COLUMNS, CONTACT_COLUMNS_CONTEXT, DEFAULT_SHADOWS} from './constants'
6
6
  import {createContactGroupEdit} from './edit'
7
7
  import type {ContactGroupAttributes, ContactGroupOptions} from './types'
8
8
 
@@ -28,6 +28,10 @@ export function createContactGroupBlock<TColumns extends NumberArray = typeof CO
28
28
  default: columns[1] ?? columns[0],
29
29
  enum: [...columns],
30
30
  },
31
+ style: {
32
+ type: 'object',
33
+ default: {shadow: DEFAULT_SHADOWS[0].value, borderColor: '', backgroundColor: '', textColor: '', textAlign: 'left'},
34
+ },
31
35
  },
32
36
  edit: createContactGroupEdit(options as unknown as ContactGroupOptions),
33
37
  save: () => <InnerBlocks.Content />,
@@ -1,10 +1,21 @@
1
1
  import type {BriloBlockType, NumberArray} from '~/types'
2
- import type {CONTACT_COLUMNS} from './constants'
2
+ import type {CONTACT_COLUMNS, DEFAULT_SHADOWS, TEXT_ALIGNS} from './constants'
3
3
 
4
4
  export type ContactColumns = (typeof CONTACT_COLUMNS)[number]
5
5
 
6
+ export type ContactShadow = (typeof DEFAULT_SHADOWS)[number]['value']
7
+
8
+ export type ContactTextAlign = (typeof TEXT_ALIGNS)[number]['value']
9
+
6
10
  export interface ContactGroupAttributes<TColumns extends number = ContactColumns> extends Record<string, unknown> {
7
11
  columns: TColumns
12
+ style: {
13
+ shadow: ContactShadow
14
+ borderColor: string
15
+ backgroundColor: string
16
+ textColor: string
17
+ textAlign: ContactTextAlign
18
+ }
8
19
  }
9
20
 
10
21
  export interface ContactGroupOptions<TColumns extends NumberArray = typeof CONTACT_COLUMNS> extends BriloBlockType {
@@ -17,6 +17,7 @@ export const contactItemDefaults: ContactItemOptions = {
17
17
  'brilo/column-group',
18
18
  'brilo/responsive-grid-group',
19
19
  'brilo/link-item',
20
+ 'core/group',
20
21
  ],
21
22
  template: [
22
23
  ['core/heading', {level: 3}],