@brilo/base-blocks 0.1.10 → 0.1.11

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":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,UAA6C,CAAA;AAC/D,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"}
@@ -1,6 +1,6 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import { justifyTop, justifyCenterVertical, justifyBottom } from '@wordpress/icons';
3
- export const SIZES = ['1/4', '1/3', '1/2', '2/3', '3/4', '1/1'];
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
  {
6
6
  value: 'top',
@@ -22,6 +22,6 @@ export function createBasicButtonEdit(options) {
22
22
  className: clsx((_b = options.blockClassName) !== null && _b !== void 0 ? _b : 'i-button', `--variant-${variant}`, `--size-${size}`, outline && '--outline', fullWidth !== 'false' && `--full-width-${fullWidth}`),
23
23
  });
24
24
  const iconPreviewStyle = { maxWidth: icon.size, flex: `0 0 ${icon.size}px` };
25
- return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsxs(PanelBody, { title: __('Tlačítko', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('Text tlačítka', 'brilo-blocks'), value: title, onChange: (value) => setAttributes({ title: value }), placeholder: __('Text tlačítka...', 'brilo-blocks') }), _jsx(ToggleGroupControl, { label: __('Varianta', 'brilo-blocks'), value: variant, onChange: (value) => setAttributes({ variant: value }), isBlock: true, children: VARIANTS.map((v) => (_jsx(ToggleGroupControlOption, { value: v.value, label: v.label }, v.value))) }), _jsx(ToggleControl, { label: __('Outline', 'brilo-blocks'), checked: outline, onChange: (value) => setAttributes({ outline: value }) }), _jsx(ToggleGroupControl, { label: __('Velikost', 'brilo-blocks'), value: size, onChange: (value) => setAttributes({ size: value }), isBlock: true, children: SIZES.map((s) => (_jsx(ToggleGroupControlOption, { value: s.value, label: s.label }, s.value))) }), _jsx(ToggleGroupControl, { label: __('Celá šířka', 'brilo-blocks'), value: fullWidth, onChange: (value) => setAttributes({ fullWidth: value }), isBlock: true, children: FULL_WIDTH_OPTIONS.map((o) => (_jsx(ToggleGroupControlOption, { value: o.value, label: o.label }, o.value))) })] }), _jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('URL', 'brilo-blocks'), value: url.src, onChange: (value) => setAttributes({ url: { ...url, src: value } }) }), _jsx(ToggleControl, { label: __('Otevřít v nové záložce', 'brilo-blocks'), checked: url.blank, onChange: (value) => setAttributes({ url: { ...url, blank: value } }) })] }), _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("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("div", { className: "i-button__inner", children: _jsx(RichText, { tagName: "span", className: "i-button__label", value: title, onChange: (value) => setAttributes({ title: value }), placeholder: __('Text tlačítka...', 'brilo-blocks'), allowedFormats: [] }) }), hasIcon && icon.position === 'after' && (_jsx("span", { className: "link-item__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) }))] })] }));
25
+ return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsxs(PanelBody, { title: __('Tlačítko', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('Text tlačítka', 'brilo-blocks'), value: title, onChange: (value) => setAttributes({ title: value }), placeholder: __('Text tlačítka...', 'brilo-blocks') }), _jsx(ToggleGroupControl, { label: __('Varianta', 'brilo-blocks'), value: variant, onChange: (value) => setAttributes({ variant: value }), isBlock: true, children: VARIANTS.map((v) => (_jsx(ToggleGroupControlOption, { value: v.value, label: v.label }, v.value))) }), _jsx(ToggleControl, { label: __('Outline', 'brilo-blocks'), checked: outline, onChange: (value) => setAttributes({ outline: value }) }), _jsx(ToggleGroupControl, { label: __('Velikost', 'brilo-blocks'), value: size, onChange: (value) => setAttributes({ size: value }), isBlock: true, children: SIZES.map((s) => (_jsx(ToggleGroupControlOption, { value: s.value, label: s.label }, s.value))) }), _jsx(ToggleGroupControl, { label: __('Celá šířka', 'brilo-blocks'), value: fullWidth, onChange: (value) => setAttributes({ fullWidth: value }), isBlock: true, children: FULL_WIDTH_OPTIONS.map((o) => (_jsx(ToggleGroupControlOption, { value: o.value, label: o.label }, o.value))) })] }), _jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('URL', 'brilo-blocks'), value: url.src, onChange: (value) => setAttributes({ url: { ...url, src: value } }) }), _jsx(ToggleControl, { label: __('Otevřít v nové záložce', 'brilo-blocks'), checked: url.blank, onChange: (value) => setAttributes({ url: { ...url, blank: value } }) })] }), _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("div", { ...blockProps, children: _jsxs("div", { className: "i-button__inner", children: [hasIcon && icon.position === 'before' && (_jsx("span", { className: "i-button__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) })), _jsx(RichText, { tagName: "span", className: "i-button__label", value: title, onChange: (value) => setAttributes({ title: value }), placeholder: __('Text tlačítka...', 'brilo-blocks'), allowedFormats: [] }), hasIcon && icon.position === 'after' && (_jsx("span", { className: "i-button__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setIconBase, options: options }) }))] }) })] }));
26
26
  };
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/sections/base-section/edit.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAGpE,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,IAGlH,OAAO,cAAc,CAAC,mBAAmB,GAAG,MAAM,CAAC,iCAgCzE"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/sections/base-section/edit.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAGpE,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,IAGlH,OAAO,cAAc,CAAC,mBAAmB,GAAG,MAAM,CAAC,iCAiCzE"}
@@ -7,11 +7,12 @@ export function createBaseSectionEdit(options) {
7
7
  return function Edit(props) {
8
8
  var _a;
9
9
  const { attributes, setAttributes } = props;
10
- const { background, textColor } = attributes;
10
+ const { background, textColor, gradient } = attributes;
11
11
  const blockProps = useBlockProps({
12
12
  className: options.blockClassName,
13
13
  style: {
14
14
  ...(background ? { backgroundColor: background, padding: '16px' } : {}),
15
+ ...(gradient ? { background: gradient, padding: '16px' } : {}),
15
16
  ...(textColor ? { color: textColor } : {}),
16
17
  },
17
18
  });
@@ -1,4 +1,4 @@
1
- export declare const COLUMNS: readonly [4, 3, 2];
1
+ export declare const COLUMNS: readonly [5, 4, 3, 2];
2
2
  export declare const RATIOS: readonly ["4:3", "3:2", "16:9", "1:1", "2:1", "3:4"];
3
3
  export declare const HEADING_LEVELS: readonly [2, 3, 4];
4
4
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/signpost/signpost-group/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,oBAAqB,CAAA;AACzC,eAAO,MAAM,MAAM,sDAAuD,CAAA;AAC1E,eAAO,MAAM,cAAc,oBAAqB,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/signpost/signpost-group/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,uBAAwB,CAAA;AAC5C,eAAO,MAAM,MAAM,sDAAuD,CAAA;AAC1E,eAAO,MAAM,cAAc,oBAAqB,CAAA"}
@@ -1,3 +1,3 @@
1
- export const COLUMNS = [4, 3, 2];
1
+ export const COLUMNS = [5, 4, 3, 2];
2
2
  export const RATIOS = ['4:3', '3:2', '16:9', '1:1', '2:1', '3:4'];
3
3
  export const HEADING_LEVELS = [2, 3, 4];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brilo/base-blocks",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "author": "Brilo",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import {__} from '@wordpress/i18n'
2
2
  import {justifyTop, justifyCenterVertical, justifyBottom} from '@wordpress/icons'
3
3
 
4
- export const SIZES = ['1/4', '1/3', '1/2', '2/3', '3/4', '1/1']
4
+ export const SIZES = ['1/6', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1']
5
5
  export const ALIGN = [
6
6
  {
7
7
  value: 'top',
@@ -7,6 +7,10 @@
7
7
  min-height: 64px;
8
8
  margin: 0 !important;
9
9
 
10
+ &.--size-1\/6 {
11
+ grid-column: span 2;
12
+ }
13
+
10
14
  &.--size-1\/4 {
11
15
  grid-column: span 3;
12
16
  }
@@ -129,12 +129,12 @@ export function createBasicButtonEdit(options: BasicButtonOptions) {
129
129
  </PanelBody>
130
130
  </InspectorControls>
131
131
  <div {...blockProps}>
132
- {hasIcon && icon.position === 'before' && (
133
- <span className="link-item__icon" style={iconPreviewStyle}>
132
+ <div className="i-button__inner">
133
+ {hasIcon && icon.position === 'before' && (
134
+ <span className="i-button__icon" style={iconPreviewStyle}>
134
135
  <ItemIconPreview icon={icon as unknown as import('~/types').Icon} setAttributes={setIconBase} options={options} />
135
136
  </span>
136
- )}
137
- <div className="i-button__inner">
137
+ )}
138
138
  <RichText
139
139
  tagName="span"
140
140
  className="i-button__label"
@@ -143,12 +143,12 @@ export function createBasicButtonEdit(options: BasicButtonOptions) {
143
143
  placeholder={__('Text tlačítka...', 'brilo-blocks')}
144
144
  allowedFormats={[]}
145
145
  />
146
- </div>
147
- {hasIcon && icon.position === 'after' && (
148
- <span className="link-item__icon" style={iconPreviewStyle}>
146
+ {hasIcon && icon.position === 'after' && (
147
+ <span className="i-button__icon" style={iconPreviewStyle}>
149
148
  <ItemIconPreview icon={icon as unknown as import('~/types').Icon} setAttributes={setIconBase} options={options} />
150
149
  </span>
151
- )}
150
+ )}
151
+ </div>
152
152
  </div>
153
153
  </>
154
154
  )
@@ -8,11 +8,12 @@ export function createBaseSectionEdit<TExtra extends Record<string, unknown> = R
8
8
 
9
9
  return function Edit(props: BlockEditProps<BaseBlockAttributes & TExtra>) {
10
10
  const {attributes, setAttributes} = props
11
- const {background, textColor} = attributes as BaseBlockAttributes
11
+ const {background, textColor, gradient} = attributes as BaseBlockAttributes & {gradient?: string}
12
12
  const blockProps = useBlockProps({
13
13
  className: options.blockClassName,
14
14
  style: {
15
15
  ...(background ? {backgroundColor: background, padding: '16px'} : {}),
16
+ ...(gradient ? {background: gradient, padding: '16px'} : {}),
16
17
  ...(textColor ? {color: textColor} : {}),
17
18
  },
18
19
  })
@@ -1,3 +1,3 @@
1
- export const COLUMNS = [4, 3, 2] as const
1
+ export const COLUMNS = [5, 4, 3, 2] as const
2
2
  export const RATIOS = ['4:3', '3:2', '16:9', '1:1', '2:1', '3:4'] as const
3
3
  export const HEADING_LEVELS = [2, 3, 4] as const