@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.
- package/build/blocks/column/column-item/constants.d.ts.map +1 -1
- package/build/blocks/column/column-item/constants.js +1 -1
- package/build/blocks/core/basic-button/edit.js +1 -1
- package/build/blocks/sections/base-section/edit.d.ts.map +1 -1
- package/build/blocks/sections/base-section/edit.js +2 -1
- package/build/blocks/signpost/signpost-group/constants.d.ts +1 -1
- package/build/blocks/signpost/signpost-group/constants.d.ts.map +1 -1
- package/build/blocks/signpost/signpost-group/constants.js +1 -1
- package/package.json +1 -1
- package/src/blocks/column/column-item/constants.ts +1 -1
- package/src/blocks/column/column-item/editor.scss +4 -0
- package/src/blocks/core/basic-button/edit.tsx +8 -8
- package/src/blocks/sections/base-section/edit.tsx +2 -1
- package/src/blocks/signpost/signpost-group/constants.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/column/column-item/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,
|
|
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 })] }))] })] }),
|
|
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,
|
|
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,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -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',
|
|
@@ -129,12 +129,12 @@ export function createBasicButtonEdit(options: BasicButtonOptions) {
|
|
|
129
129
|
</PanelBody>
|
|
130
130
|
</InspectorControls>
|
|
131
131
|
<div {...blockProps}>
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
147
|
-
|
|
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
|
})
|