@brilo/base-blocks 0.1.24 → 0.1.25

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 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/link/link-item/edit.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAEhE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,oCAItD;IACD,UAAU,EAAE,kBAAkB,CAAA;IAC9B,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAA;CACxD,iCAoGF"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/link/link-item/edit.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAEhE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,oCAItD;IACD,UAAU,EAAE,kBAAkB,CAAA;IAC9B,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAA;CACxD,iCA0GF"}
@@ -20,6 +20,6 @@ export function createLinkItemEdit(options) {
20
20
  style: color ? { color } : undefined,
21
21
  });
22
22
  const iconPreviewStyle = { maxWidth: icon.size, flex: `0 0 ${icon.size}px` };
23
- return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('URL', 'brilo-blocks'), value: url.src, onChange: (v) => setAttributes({ url: { ...url, src: v } }) }), _jsx(ToggleControl, { label: __('Otevřít v nové záložce', 'brilo-blocks'), checked: url.blank, onChange: (v) => setAttributes({ url: { ...url, blank: v } }) })] }), _jsxs(PanelBody, { title: __('Ikona', 'brilo-blocks'), initialOpen: false, children: [_jsx(ItemIconControl, { icon: icon, setAttributes: setIconBase, iconTypes: ICON_TYPES, options: options }), hasIcon && (_jsxs(_Fragment, { children: [_jsxs(ToggleGroupControl, { isBlock: true, label: __('Pozice', 'brilo-blocks'), value: icon.position, onChange: (v) => setAttributes({ icon: { ...icon, position: String(v) } }), children: [_jsx(ToggleGroupControlOption, { value: "before", label: __('Před', 'brilo-blocks') }), _jsx(ToggleGroupControlOption, { value: "after", label: __('Za', 'brilo-blocks') })] }), _jsx(RangeControl, { label: __('Velikost (px)', 'brilo-blocks'), value: icon.size, onChange: (v) => setAttributes({ icon: { ...icon, size: v !== null && v !== void 0 ? v : 24 } }), min: 8, max: 80, step: 1 })] }))] }), _jsxs(PanelBody, { title: __('Styl', 'brilo-blocks'), initialOpen: false, children: [_jsx("p", { children: __('Barva', 'brilo-blocks') }), _jsx(ColorPalette, { colors: paletteColors, value: color || undefined, onChange: (v) => setAttributes({ color: v !== null && v !== void 0 ? v : '' }) }), _jsx(ToggleControl, { label: __('Podtržení výchozí', 'brilo-blocks'), checked: underline_initial, onChange: (v) => setAttributes({ underline_initial: v }) }), _jsx(RangeControl, { label: __('Velikost textu (px)', 'brilo-blocks'), value: size, onChange: (v) => setAttributes({ size: v !== null && v !== void 0 ? v : 16 }), min: 8, max: 80, step: 1 })] })] }), _jsxs("div", { ...blockProps, children: [hasIcon && icon.position === 'before' && (_jsx("span", { className: "link-item__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) })), _jsx(RichText, { tagName: "span", className: "link-item__title", value: title, onChange: (v) => setAttributes({ title: v }), placeholder: __('Text odkazu...', 'brilo-blocks'), allowedFormats: ['core/bold', 'core/italic'] }), hasIcon && icon.position === 'after' && (_jsx("span", { className: "link-item__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) }))] })] }));
23
+ return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('URL', 'brilo-blocks'), value: url.src, onChange: (v) => setAttributes({ url: { ...url, src: v } }) }), _jsx(ToggleControl, { label: __('Otevřít v nové záložce', 'brilo-blocks'), checked: url.blank, onChange: (v) => setAttributes({ url: { ...url, blank: v } }) })] }), _jsxs(PanelBody, { title: __('Ikona', 'brilo-blocks'), initialOpen: false, children: [_jsx(ItemIconControl, { icon: icon, setAttributes: setIconBase, iconTypes: ICON_TYPES, options: options }), hasIcon && (_jsxs(_Fragment, { children: [_jsxs(ToggleGroupControl, { isBlock: true, label: __('Pozice', 'brilo-blocks'), value: icon.position, onChange: (v) => setAttributes({ icon: { ...icon, position: String(v) } }), children: [_jsx(ToggleGroupControlOption, { value: "before", label: __('Před', 'brilo-blocks') }), _jsx(ToggleGroupControlOption, { value: "after", label: __('Za', 'brilo-blocks') })] }), _jsx(RangeControl, { label: __('Velikost (px)', 'brilo-blocks'), value: icon.size, onChange: (v) => setAttributes({ icon: { ...icon, size: v !== null && v !== void 0 ? v : 24 } }), min: 8, max: 80, step: 1 }), _jsx("p", { children: __('Barva ikony', 'brilo-blocks') }), _jsx(ColorPalette, { colors: paletteColors, value: icon.color || undefined, onChange: (v) => setAttributes({ icon: { ...icon, color: v !== null && v !== void 0 ? v : '' } }) })] }))] }), _jsxs(PanelBody, { title: __('Styl', 'brilo-blocks'), initialOpen: false, children: [_jsx("p", { children: __('Barva', 'brilo-blocks') }), _jsx(ColorPalette, { colors: paletteColors, value: color || undefined, onChange: (v) => setAttributes({ color: v !== null && v !== void 0 ? v : '' }) }), _jsx(ToggleControl, { label: __('Podtržení výchozí', 'brilo-blocks'), checked: underline_initial, onChange: (v) => setAttributes({ underline_initial: v }) }), _jsx(RangeControl, { label: __('Velikost textu (px)', 'brilo-blocks'), value: size, onChange: (v) => setAttributes({ size: v !== null && v !== void 0 ? v : 16 }), min: 8, max: 80, step: 1 })] })] }), _jsxs("div", { ...blockProps, children: [hasIcon && icon.position === 'before' && (_jsx("span", { className: "link-item__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) })), _jsx(RichText, { tagName: "span", className: "link-item__title", value: title, onChange: (v) => setAttributes({ title: v }), placeholder: __('Text odkazu...', 'brilo-blocks'), allowedFormats: ['core/bold', 'core/italic'] }), hasIcon && icon.position === 'after' && (_jsx("span", { className: "link-item__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) }))] })] }));
24
24
  };
25
25
  }
@@ -16,7 +16,7 @@ export function createLinkItemBlock(options) {
16
16
  url: { type: 'object', default: { src: '', blank: false } },
17
17
  icon: {
18
18
  type: 'object',
19
- default: { type: 'none', src: '', media: {}, position: 'after', size: 24 },
19
+ default: { type: 'none', src: '', media: {}, position: 'after', size: 24, color: '' },
20
20
  },
21
21
  color: { type: 'string', default: '' },
22
22
  size: { type: 'number', default: 16 },
@@ -7,6 +7,7 @@ export interface LinkItemIcon {
7
7
  media: Media;
8
8
  position: 'before' | 'after';
9
9
  size: number;
10
+ color: string;
10
11
  }
11
12
  export interface LinkItemAttributes extends Record<string, unknown> {
12
13
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/link/link-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAEtD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,GAAG,OAAO,GAAG,MAAM,CAAA;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC5B,IAAI,EAAE,MA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B,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brilo/base-blocks",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "author": "Brilo",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -75,6 +75,12 @@ export function createLinkItemEdit(options: LinkItemOptions) {
75
75
  max={80}
76
76
  step={1}
77
77
  />
78
+ <p>{__('Barva ikony', 'brilo-blocks')}</p>
79
+ <ColorPalette
80
+ colors={paletteColors}
81
+ value={icon.color || undefined}
82
+ onChange={(v) => setAttributes({icon: {...icon, color: v ?? ''}})}
83
+ />
78
84
  </>
79
85
  )}
80
86
  </PanelBody>
@@ -18,7 +18,7 @@ export function createLinkItemBlock(options: LinkItemOptions): BlockConfiguratio
18
18
  url: {type: 'object', default: {src: '', blank: false}},
19
19
  icon: {
20
20
  type: 'object',
21
- default: {type: 'none', src: '', media: {}, position: 'after', size: 24},
21
+ default: {type: 'none', src: '', media: {}, position: 'after', size: 24, color: ''},
22
22
  },
23
23
  color: {type: 'string', default: ''},
24
24
  size: {type: 'number', default: 16},
@@ -8,6 +8,7 @@ export interface LinkItemIcon {
8
8
  media: Media
9
9
  position: 'before' | 'after'
10
10
  size: number
11
+ color: string
11
12
  }
12
13
 
13
14
  export interface LinkItemAttributes extends Record<string, unknown> {