@brilo/base-blocks 0.1.3 → 0.1.5

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.
@@ -17,6 +17,6 @@ export function createSignpostItemEdit(options) {
17
17
  template: options.template,
18
18
  layout: { type: 'default' },
19
19
  });
20
- return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsx(PanelBody, { title: __('Obrázek', 'brilo-blocks'), children: _jsx(ImagePickerControl, { value: img, onChange: (val) => setAttributes({ img: val }) }) }), _jsx(PanelBody, { title: __('Tlačítko', 'brilo-blocks'), children: _jsx(TextControl, { label: __('Text tlačítka', 'brilo-blocks'), value: button.text, onChange: (v) => setAttributes({ button: { ...button, text: v } }) }) }), _jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), initialOpen: false, 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 } }) })] })] }), _jsx("div", { ...blockProps, children: _jsxs("div", { className: "i-signpost__inner", children: [_jsx("div", { className: "i-signpost__image-wrapper", children: img.id ? (_jsx(ImagePickerControl, { value: img, onChange: (val) => setAttributes({ img: val }), size: [128, 128] })) : (_jsx("div", { className: "i-signpost__image-placeholder", children: _jsx(ImagePickerControl, { value: img, onChange: (val) => setAttributes({ img: val }) }) })) }), _jsxs("div", { className: "i-signpost__body", children: [_jsx(RichText, { tagName: "h3", className: "i-signpost__title u-text-editable", value: title, onChange: (v) => setAttributes({ title: v }), placeholder: __('Nadpis...', 'brilo-blocks'), allowedFormats: ['core/bold', 'core/italic'] }), _jsx("div", { ...innerBlocksProps }), _jsx(Button, { variant: 'primary', className: "i-signpost__button", children: _jsx(RichText, { tagName: "span", className: "i-signpost__button-text", value: button.text, onChange: (v) => setAttributes({ button: { ...button, text: v } }), placeholder: __('Text tlačítka...', 'brilo-blocks') }) })] })] }) })] }));
20
+ return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsx(PanelBody, { title: __('Obrázek', 'brilo-blocks'), children: _jsx(ImagePickerControl, { value: img, onChange: (val) => setAttributes({ img: val }) }) }), _jsx(PanelBody, { title: __('Tlačítko', 'brilo-blocks'), children: _jsx(TextControl, { label: __('Text tlačítka', 'brilo-blocks'), value: button.title, onChange: (v) => setAttributes({ button: { ...button, title: v } }) }) }), _jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), initialOpen: false, 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 } }) })] })] }), _jsx("div", { ...blockProps, children: _jsxs("div", { className: "i-signpost__inner", children: [_jsx("div", { className: "i-signpost__image-wrapper", children: img.id ? (_jsx(ImagePickerControl, { value: img, onChange: (val) => setAttributes({ img: val }), size: [128, 128] })) : (_jsx("div", { className: "i-signpost__image-placeholder", children: _jsx(ImagePickerControl, { value: img, onChange: (val) => setAttributes({ img: val }) }) })) }), _jsxs("div", { className: "i-signpost__body", children: [_jsx(RichText, { tagName: "h3", className: "i-signpost__title u-text-editable", value: title, onChange: (v) => setAttributes({ title: v }), placeholder: __('Nadpis...', 'brilo-blocks'), allowedFormats: ['core/bold', 'core/italic'] }), _jsx("div", { ...innerBlocksProps }), _jsx(Button, { variant: 'primary', className: "i-signpost__button", children: _jsx(RichText, { tagName: "span", className: "i-signpost__button-text", value: button.title, onChange: (v) => setAttributes({ button: { ...button, title: v } }), placeholder: __('Text tlačítka...', 'brilo-blocks') }) })] })] }) })] }));
21
21
  };
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/signpost/signpost-item/factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAIzD,OAAO,KAAK,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAGxE,YAAY,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,CAAA;AAEzD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAmBhH"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/signpost/signpost-item/factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAIzD,OAAO,KAAK,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAGxE,YAAY,EAAC,sBAAsB,EAAE,mBAAmB,EAAC,CAAA;AAEzD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAkBhH"}
@@ -16,9 +16,8 @@ export function createSignpostItemBlock(options) {
16
16
  attributes: {
17
17
  title: { type: 'string', default: '' },
18
18
  img: { type: 'object', default: { id: 0, alt: '' } },
19
- button: { type: 'object', default: { text: '' } },
20
- url: { type: 'string', default: '' },
21
- blank: { type: 'boolean', default: false },
19
+ button: { type: 'object', default: { title: '' } },
20
+ url: { type: 'object', default: { src: '', blank: false } },
22
21
  },
23
22
  edit: createSignpostItemEdit(options),
24
23
  save: () => _jsx(InnerBlocks.Content, {}),
@@ -4,13 +4,12 @@ export interface SignpostItemAttributes extends Record<string, unknown> {
4
4
  title: string;
5
5
  img: ImageValue;
6
6
  button: {
7
- text: string;
7
+ title: string;
8
8
  };
9
9
  url: {
10
10
  src: string;
11
11
  blank: boolean;
12
12
  };
13
- blank: boolean;
14
13
  }
15
14
  export interface SignpostItemOptions extends BriloBlockType {
16
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/signpost/signpost-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,sCAAsC,CAAA;AAE/D,MAAM,WAAW,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,UAAU,CAAA;IACf,MAAM,EAAE;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAA;IACtB,GAAG,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAC,CAAA;IAClC,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;CAAG"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/signpost/signpost-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,sCAAsC,CAAA;AAE/D,MAAM,WAAW,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,UAAU,CAAA;IACf,MAAM,EAAE;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAA;IACvB,GAAG,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAC,CAAA;CACnC;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;CAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brilo/base-blocks",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "author": "Brilo",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -34,8 +34,8 @@ export function createSignpostItemEdit(options: SignpostItemOptions) {
34
34
  <PanelBody title={__('Tlačítko', 'brilo-blocks')}>
35
35
  <TextControl
36
36
  label={__('Text tlačítka', 'brilo-blocks')}
37
- value={button.text}
38
- onChange={(v) => setAttributes({button: {...button, text: v}})}
37
+ value={button.title}
38
+ onChange={(v) => setAttributes({button: {...button, title: v}})}
39
39
  />
40
40
  </PanelBody>
41
41
  <PanelBody title={__('Odkaz', 'brilo-blocks')} initialOpen={false}>
@@ -76,8 +76,8 @@ export function createSignpostItemEdit(options: SignpostItemOptions) {
76
76
  <RichText
77
77
  tagName="span"
78
78
  className="i-signpost__button-text"
79
- value={button.text}
80
- onChange={(v) => setAttributes({button: {...button, text: v}})}
79
+ value={button.title}
80
+ onChange={(v) => setAttributes({button: {...button, title: v}})}
81
81
  placeholder={__('Text tlačítka...', 'brilo-blocks')}
82
82
  />
83
83
  </Button>
@@ -19,9 +19,8 @@ export function createSignpostItemBlock(options: SignpostItemOptions): BlockConf
19
19
  attributes: {
20
20
  title: {type: 'string', default: ''},
21
21
  img: {type: 'object', default: {id: 0, alt: ''}},
22
- button: {type: 'object', default: {text: ''}},
23
- url: {type: 'string', default: ''},
24
- blank: {type: 'boolean', default: false},
22
+ button: {type: 'object', default: {title: ''}},
23
+ url: {type: 'object', default: {src: '', blank: false}},
25
24
  },
26
25
  edit: createSignpostItemEdit(options),
27
26
  save: () => <InnerBlocks.Content />,
@@ -4,9 +4,8 @@ import {ImageValue} from '~/components/ImagePicker/ImagePicker'
4
4
  export interface SignpostItemAttributes extends Record<string, unknown> {
5
5
  title: string
6
6
  img: ImageValue
7
- button: {text: string}
7
+ button: {title: string}
8
8
  url: {src: string; blank: boolean}
9
- blank: boolean
10
9
  }
11
10
 
12
11
  export interface SignpostItemOptions extends BriloBlockType {}