@brilo/base-blocks 0.1.22 → 0.1.24

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.
Files changed (162) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/blocks/anchor/anchor-group/constants.d.ts +24 -0
  3. package/build/blocks/anchor/anchor-group/constants.d.ts.map +1 -0
  4. package/build/blocks/anchor/anchor-group/constants.js +12 -0
  5. package/build/blocks/anchor/anchor-group/edit.d.ts +6 -0
  6. package/build/blocks/anchor/anchor-group/edit.d.ts.map +1 -0
  7. package/build/blocks/anchor/anchor-group/edit.js +28 -0
  8. package/build/blocks/anchor/anchor-group/factory.d.ts +7 -0
  9. package/build/blocks/anchor/anchor-group/factory.d.ts.map +1 -0
  10. package/build/blocks/anchor/anchor-group/factory.js +33 -0
  11. package/build/blocks/anchor/anchor-group/index.d.ts +6 -0
  12. package/build/blocks/anchor/anchor-group/index.d.ts.map +1 -0
  13. package/build/blocks/anchor/anchor-group/index.js +7 -0
  14. package/build/blocks/anchor/anchor-group/types.d.ts +13 -0
  15. package/build/blocks/anchor/anchor-group/types.d.ts.map +1 -0
  16. package/build/blocks/anchor/anchor-group/types.js +1 -0
  17. package/build/blocks/anchor/anchor-item/constants.d.ts +13 -0
  18. package/build/blocks/anchor/anchor-item/constants.d.ts.map +1 -0
  19. package/build/blocks/anchor/anchor-item/constants.js +7 -0
  20. package/build/blocks/anchor/anchor-item/edit.d.ts +6 -0
  21. package/build/blocks/anchor/anchor-item/edit.d.ts.map +1 -0
  22. package/build/blocks/anchor/anchor-item/edit.js +24 -0
  23. package/build/blocks/anchor/anchor-item/factory.d.ts +5 -0
  24. package/build/blocks/anchor/anchor-item/factory.d.ts.map +1 -0
  25. package/build/blocks/anchor/anchor-item/factory.js +25 -0
  26. package/build/blocks/anchor/anchor-item/index.d.ts +7 -0
  27. package/build/blocks/anchor/anchor-item/index.d.ts.map +1 -0
  28. package/build/blocks/anchor/anchor-item/index.js +9 -0
  29. package/build/blocks/anchor/anchor-item/types.d.ts +18 -0
  30. package/build/blocks/anchor/anchor-item/types.d.ts.map +1 -0
  31. package/build/blocks/anchor/anchor-item/types.js +1 -0
  32. package/build/blocks/layout/layout-aside/constants.d.ts +2 -0
  33. package/build/blocks/layout/layout-aside/constants.d.ts.map +1 -0
  34. package/build/blocks/layout/layout-aside/constants.js +1 -0
  35. package/build/blocks/layout/layout-aside/edit.d.ts +4 -0
  36. package/build/blocks/layout/layout-aside/edit.d.ts.map +1 -0
  37. package/build/blocks/layout/layout-aside/edit.js +13 -0
  38. package/build/blocks/layout/layout-aside/factory.d.ts +4 -0
  39. package/build/blocks/layout/layout-aside/factory.d.ts.map +1 -0
  40. package/build/blocks/layout/layout-aside/factory.js +20 -0
  41. package/build/blocks/layout/layout-aside/icon.d.ts +3 -0
  42. package/build/blocks/layout/layout-aside/icon.d.ts.map +1 -0
  43. package/build/blocks/layout/layout-aside/icon.js +2 -0
  44. package/build/blocks/layout/layout-aside/index.d.ts +5 -0
  45. package/build/blocks/layout/layout-aside/index.d.ts.map +1 -0
  46. package/build/blocks/layout/layout-aside/index.js +5 -0
  47. package/build/blocks/layout/layout-aside/types.d.ts +6 -0
  48. package/build/blocks/layout/layout-aside/types.d.ts.map +1 -0
  49. package/build/blocks/layout/layout-aside/types.js +1 -0
  50. package/build/blocks/layout/layout-content/constants.d.ts +2 -0
  51. package/build/blocks/layout/layout-content/constants.d.ts.map +1 -0
  52. package/build/blocks/layout/layout-content/constants.js +1 -0
  53. package/build/blocks/layout/layout-content/edit.d.ts +4 -0
  54. package/build/blocks/layout/layout-content/edit.d.ts.map +1 -0
  55. package/build/blocks/layout/layout-content/edit.js +13 -0
  56. package/build/blocks/layout/layout-content/factory.d.ts +4 -0
  57. package/build/blocks/layout/layout-content/factory.d.ts.map +1 -0
  58. package/build/blocks/layout/layout-content/factory.js +20 -0
  59. package/build/blocks/layout/layout-content/icon.d.ts +3 -0
  60. package/build/blocks/layout/layout-content/icon.d.ts.map +1 -0
  61. package/build/blocks/layout/layout-content/icon.js +2 -0
  62. package/build/blocks/layout/layout-content/index.d.ts +5 -0
  63. package/build/blocks/layout/layout-content/index.d.ts.map +1 -0
  64. package/build/blocks/layout/layout-content/index.js +5 -0
  65. package/build/blocks/layout/layout-content/types.d.ts +6 -0
  66. package/build/blocks/layout/layout-content/types.d.ts.map +1 -0
  67. package/build/blocks/layout/layout-content/types.js +1 -0
  68. package/build/blocks/layout/layout-content-w-aside/constants.d.ts +11 -0
  69. package/build/blocks/layout/layout-content-w-aside/constants.d.ts.map +1 -0
  70. package/build/blocks/layout/layout-content-w-aside/constants.js +6 -0
  71. package/build/blocks/layout/layout-content-w-aside/edit.d.ts +7 -0
  72. package/build/blocks/layout/layout-content-w-aside/edit.d.ts.map +1 -0
  73. package/build/blocks/layout/layout-content-w-aside/edit.js +22 -0
  74. package/build/blocks/layout/layout-content-w-aside/factory.d.ts +6 -0
  75. package/build/blocks/layout/layout-content-w-aside/factory.d.ts.map +1 -0
  76. package/build/blocks/layout/layout-content-w-aside/factory.js +26 -0
  77. package/build/blocks/layout/layout-content-w-aside/icon.d.ts +3 -0
  78. package/build/blocks/layout/layout-content-w-aside/icon.d.ts.map +1 -0
  79. package/build/blocks/layout/layout-content-w-aside/icon.js +2 -0
  80. package/build/blocks/layout/layout-content-w-aside/index.d.ts +5 -0
  81. package/build/blocks/layout/layout-content-w-aside/index.d.ts.map +1 -0
  82. package/build/blocks/layout/layout-content-w-aside/index.js +9 -0
  83. package/build/blocks/layout/layout-content-w-aside/types.d.ts +10 -0
  84. package/build/blocks/layout/layout-content-w-aside/types.d.ts.map +1 -0
  85. package/build/blocks/layout/layout-content-w-aside/types.js +1 -0
  86. package/build/blocks/post/posts-grid/constants.d.ts +4 -0
  87. package/build/blocks/post/posts-grid/constants.d.ts.map +1 -0
  88. package/build/blocks/post/posts-grid/constants.js +3 -0
  89. package/build/blocks/post/posts-grid/edit.d.ts +6 -0
  90. package/build/blocks/post/posts-grid/edit.d.ts.map +1 -0
  91. package/build/blocks/post/posts-grid/edit.js +21 -0
  92. package/build/blocks/post/posts-grid/factory.d.ts +5 -0
  93. package/build/blocks/post/posts-grid/factory.d.ts.map +1 -0
  94. package/build/blocks/post/posts-grid/factory.js +59 -0
  95. package/build/blocks/post/posts-grid/icon.d.ts +2 -0
  96. package/build/blocks/post/posts-grid/icon.d.ts.map +1 -0
  97. package/build/blocks/post/posts-grid/icon.js +2 -0
  98. package/build/blocks/post/posts-grid/index.d.ts +5 -0
  99. package/build/blocks/post/posts-grid/index.d.ts.map +1 -0
  100. package/build/blocks/post/posts-grid/index.js +5 -0
  101. package/build/blocks/post/posts-grid/types.d.ts +22 -0
  102. package/build/blocks/post/posts-grid/types.d.ts.map +1 -0
  103. package/build/blocks/post/posts-grid/types.js +1 -0
  104. package/build/blocks/sections/base-section/attributes.d.ts +4 -0
  105. package/build/blocks/sections/base-section/attributes.d.ts.map +1 -1
  106. package/build/blocks/sections/base-section/attributes.js +4 -0
  107. package/build/blocks/sections/base-section/constants.d.ts +7 -0
  108. package/build/blocks/sections/base-section/constants.d.ts.map +1 -1
  109. package/build/blocks/sections/base-section/constants.js +7 -0
  110. package/build/blocks/sections/base-section/controls.d.ts.map +1 -1
  111. package/build/blocks/sections/base-section/controls.js +23 -5
  112. package/build/blocks/sections/base-section/types.d.ts +18 -1
  113. package/build/blocks/sections/base-section/types.d.ts.map +1 -1
  114. package/build/index.d.ts +12 -0
  115. package/build/index.d.ts.map +1 -1
  116. package/build/index.js +6 -0
  117. package/package.json +1 -1
  118. package/src/blocks/anchor/anchor-group/constants.ts +14 -0
  119. package/src/blocks/anchor/anchor-group/edit.tsx +70 -0
  120. package/src/blocks/anchor/anchor-group/editor.scss +52 -0
  121. package/src/blocks/anchor/anchor-group/factory.tsx +43 -0
  122. package/src/blocks/anchor/anchor-group/index.ts +11 -0
  123. package/src/blocks/anchor/anchor-group/types.ts +19 -0
  124. package/src/blocks/anchor/anchor-item/constants.ts +10 -0
  125. package/src/blocks/anchor/anchor-item/edit.tsx +96 -0
  126. package/src/blocks/anchor/anchor-item/editor.scss +22 -0
  127. package/src/blocks/anchor/anchor-item/factory.tsx +29 -0
  128. package/src/blocks/anchor/anchor-item/index.ts +13 -0
  129. package/src/blocks/anchor/anchor-item/types.ts +16 -0
  130. package/src/blocks/layout/layout-aside/constants.ts +1 -0
  131. package/src/blocks/layout/layout-aside/edit.tsx +20 -0
  132. package/src/blocks/layout/layout-aside/editor.scss +9 -0
  133. package/src/blocks/layout/layout-aside/factory.tsx +24 -0
  134. package/src/blocks/layout/layout-aside/icon.tsx +12 -0
  135. package/src/blocks/layout/layout-aside/index.ts +9 -0
  136. package/src/blocks/layout/layout-aside/types.ts +5 -0
  137. package/src/blocks/layout/layout-content/constants.ts +1 -0
  138. package/src/blocks/layout/layout-content/edit.tsx +20 -0
  139. package/src/blocks/layout/layout-content/editor.scss +9 -0
  140. package/src/blocks/layout/layout-content/factory.tsx +24 -0
  141. package/src/blocks/layout/layout-content/icon.tsx +12 -0
  142. package/src/blocks/layout/layout-content/index.ts +9 -0
  143. package/src/blocks/layout/layout-content/types.ts +5 -0
  144. package/src/blocks/layout/layout-content-w-aside/constants.ts +7 -0
  145. package/src/blocks/layout/layout-content-w-aside/edit.tsx +52 -0
  146. package/src/blocks/layout/layout-content-w-aside/editor.scss +35 -0
  147. package/src/blocks/layout/layout-content-w-aside/factory.tsx +34 -0
  148. package/src/blocks/layout/layout-content-w-aside/icon.tsx +12 -0
  149. package/src/blocks/layout/layout-content-w-aside/index.ts +13 -0
  150. package/src/blocks/layout/layout-content-w-aside/types.ts +12 -0
  151. package/src/blocks/post/posts-grid/constants.ts +3 -0
  152. package/src/blocks/post/posts-grid/edit.tsx +105 -0
  153. package/src/blocks/post/posts-grid/factory.tsx +63 -0
  154. package/src/blocks/post/posts-grid/icon.tsx +8 -0
  155. package/src/blocks/post/posts-grid/index.ts +9 -0
  156. package/src/blocks/post/posts-grid/types.ts +25 -0
  157. package/src/blocks/sections/base-section/attributes.ts +4 -0
  158. package/src/blocks/sections/base-section/constants.ts +10 -0
  159. package/src/blocks/sections/base-section/controls.tsx +83 -4
  160. package/src/blocks/sections/base-section/types.ts +20 -1
  161. package/src/editor.scss +5 -0
  162. package/src/index.ts +19 -0
@@ -0,0 +1,24 @@
1
+ export declare const ANCHOR_COLUMNS: readonly [{
2
+ readonly value: '2';
3
+ readonly label: '2';
4
+ }, {
5
+ readonly value: '3';
6
+ readonly label: '3';
7
+ }, {
8
+ readonly value: '4';
9
+ readonly label: '4';
10
+ }, {
11
+ readonly value: '6';
12
+ readonly label: '6';
13
+ }, {
14
+ readonly value: 'auto';
15
+ readonly label: import("@wordpress/i18n").TransformedText<"Auto">;
16
+ }];
17
+ export declare const ANCHOR_ALIGNMENTS: readonly [{
18
+ readonly value: 'left';
19
+ readonly label: import("@wordpress/i18n").TransformedText<"Vlevo">;
20
+ }, {
21
+ readonly value: 'center';
22
+ readonly label: import("@wordpress/i18n").TransformedText<"Na střed">;
23
+ }];
24
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-group/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;aACxB,KAAK,EAAE,GAAG;aAAE,KAAK,EAAE,GAAG;;aACtB,KAAK,EAAE,GAAG;aAAE,KAAK,EAAE,GAAG;;aACtB,KAAK,EAAE,GAAG;aAAE,KAAK,EAAE,GAAG;;aACtB,KAAK,EAAE,GAAG;aAAE,KAAK,EAAE,GAAG;;aACtB,KAAK,EAAE,MAAM;aAAE,KAAK;EACb,CAAA;AAEV,eAAO,MAAM,iBAAiB;aAC3B,KAAK,EAAE,MAAM;aAAE,KAAK;;aACpB,KAAK,EAAE,QAAQ;aAAE,KAAK;EACf,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { __ } from '@wordpress/i18n';
2
+ export const ANCHOR_COLUMNS = [
3
+ { value: '2', label: '2' },
4
+ { value: '3', label: '3' },
5
+ { value: '4', label: '4' },
6
+ { value: '6', label: '6' },
7
+ { value: 'auto', label: __('Auto', 'brilo-blocks') },
8
+ ];
9
+ export const ANCHOR_ALIGNMENTS = [
10
+ { value: 'left', label: __('Vlevo', 'brilo-blocks') },
11
+ { value: 'center', label: __('Na střed', 'brilo-blocks') },
12
+ ];
@@ -0,0 +1,6 @@
1
+ import type { AnchorGroupAttributes, AnchorGroupOptions } from './types';
2
+ export declare function createAnchorGroupEdit(options: AnchorGroupOptions): ({ attributes, setAttributes, }: {
3
+ attributes: AnchorGroupAttributes;
4
+ setAttributes: (a: Partial<AnchorGroupAttributes>) => void;
5
+ }) => import("react").JSX.Element;
6
+ //# sourceMappingURL=edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-group/edit.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAiC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAEtG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,oCAO5D;IACD,UAAU,EAAE,qBAAqB,CAAA;IACjC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAA;CAC3D,iCA+CF"}
@@ -0,0 +1,28 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { InspectorControls } from '@wordpress/block-editor';
3
+ import { PanelBody, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from '@wordpress/components';
4
+ import { __ } from '@wordpress/i18n';
5
+ import clsx from 'clsx';
6
+ import { useGroupBlock } from '../../../hooks/useGroupBlock';
7
+ import { ANCHOR_ALIGNMENTS, ANCHOR_COLUMNS } from './constants';
8
+ export function createAnchorGroupEdit(options) {
9
+ var _a, _b;
10
+ const columnsOptions = (_a = options.columnsOptions) !== null && _a !== void 0 ? _a : ANCHOR_COLUMNS;
11
+ const alignments = (_b = options.alignments) !== null && _b !== void 0 ? _b : ANCHOR_ALIGNMENTS;
12
+ return function Edit({ attributes, setAttributes, }) {
13
+ var _a, _b;
14
+ const { columns, align } = attributes;
15
+ const { blockProps, innerBlocksProps } = useGroupBlock({
16
+ blockClassName: clsx((_a = options.blockClassName) !== null && _a !== void 0 ? _a : 'g-anchors'),
17
+ containerClassName: [
18
+ (_b = options.containerClassName) !== null && _b !== void 0 ? _b : 'g-anchors__inner',
19
+ columns === 'auto' ? '--auto' : `u-grid-responsive --cols-${columns}`,
20
+ align === 'center' && 'justify-content-center',
21
+ ],
22
+ allowedBlocks: options.allowedBlocks,
23
+ template: options.template,
24
+ layout: { type: 'default' },
25
+ });
26
+ return (_jsxs(_Fragment, { children: [_jsx(InspectorControls, { children: _jsxs(PanelBody, { title: __('Kotvy', 'brilo-blocks'), children: [_jsx(ToggleGroupControl, { isBlock: true, label: __('Počet sloupců', 'brilo-blocks'), value: columns, onChange: (v) => setAttributes({ columns: v }), children: columnsOptions.map((c) => (_jsx(ToggleGroupControlOption, { value: c.value, label: c.label }, c.value))) }), _jsx(ToggleGroupControl, { isBlock: true, label: __('Zarovnání', 'brilo-blocks'), value: align, onChange: (v) => setAttributes({ align: v }), children: alignments.map((a) => (_jsx(ToggleGroupControlOption, { value: a.value, label: a.label }, a.value))) })] }) }), _jsx("div", { ...blockProps, children: _jsx("div", { ...innerBlocksProps }) })] }));
27
+ };
28
+ }
@@ -0,0 +1,7 @@
1
+ import type { BlockConfiguration } from '@wordpress/blocks';
2
+ import type { OptionArray } from '../../../types';
3
+ import { ANCHOR_ALIGNMENTS, ANCHOR_COLUMNS } from './constants';
4
+ import type { AnchorGroupAttributes, AnchorGroupOptions } from './types';
5
+ export type { AnchorGroupAttributes, AnchorGroupOptions };
6
+ export declare function createAnchorGroupBlock<TColumnsOptions extends OptionArray = typeof ANCHOR_COLUMNS, TAlignments extends OptionArray = typeof ANCHOR_ALIGNMENTS>(options: AnchorGroupOptions<TColumnsOptions, TAlignments>): BlockConfiguration<AnchorGroupAttributes<TColumnsOptions[number]['value'], TAlignments[number]['value']>>;
7
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-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,iBAAiB,EAAE,cAAc,EAAC,MAAM,aAAa,CAAA;AAE7D,OAAO,KAAK,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAEtE,YAAY,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,CAAA;AAEvD,wBAAgB,sBAAsB,CACpC,eAAe,SAAS,WAAW,GAAG,OAAO,cAAc,EAC3D,WAAW,SAAS,WAAW,GAAG,OAAO,iBAAiB,EAE1D,OAAO,EAAE,kBAAkB,CAAC,eAAe,EAAE,WAAW,CAAC,GACxD,kBAAkB,CAAC,qBAAqB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CA2B3G"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { InnerBlocks } from '@wordpress/block-editor';
3
+ import { __ } from '@wordpress/i18n';
4
+ import { ANCHOR_ALIGNMENTS, ANCHOR_COLUMNS } from './constants';
5
+ import { createAnchorGroupEdit } from './edit';
6
+ export function createAnchorGroupBlock(options) {
7
+ var _a, _b, _c, _d, _e;
8
+ const columnsOptions = (_a = options.columnsOptions) !== null && _a !== void 0 ? _a : ANCHOR_COLUMNS;
9
+ const alignments = (_b = options.alignments) !== null && _b !== void 0 ? _b : ANCHOR_ALIGNMENTS;
10
+ return {
11
+ name: options.name,
12
+ title: (_c = options.title) !== null && _c !== void 0 ? _c : __('Kotvy', 'brilo-blocks'),
13
+ description: options.description,
14
+ category: (_d = options.category) !== null && _d !== void 0 ? _d : 'layout',
15
+ ...(options.parent && { parent: options.parent }),
16
+ icon: (_e = options.icon) !== null && _e !== void 0 ? _e : 'anchor',
17
+ supports: { html: false, customClassName: false },
18
+ attributes: {
19
+ columns: {
20
+ type: 'string',
21
+ default: columnsOptions[columnsOptions.length - 1].value,
22
+ enum: columnsOptions.map((c) => c.value),
23
+ },
24
+ align: {
25
+ type: 'string',
26
+ default: alignments[0].value,
27
+ enum: alignments.map((a) => a.value),
28
+ },
29
+ },
30
+ edit: createAnchorGroupEdit(options),
31
+ save: () => _jsx(InnerBlocks.Content, {}),
32
+ };
33
+ }
@@ -0,0 +1,6 @@
1
+ export type { AnchorAlignment, AnchorColumns, AnchorGroupAttributes, AnchorGroupOptions } from './types';
2
+ export { createAnchorGroupBlock } from './factory';
3
+ export { ANCHOR_ALIGNMENTS, ANCHOR_COLUMNS } from './constants';
4
+ import type { AnchorGroupOptions } from './types';
5
+ export declare const anchorGroupDefaults: AnchorGroupOptions;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-group/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAA;AACtG,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AAChD,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,aAAa,CAAA;AAE7D,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,mBAAmB,EAAE,kBAIjC,CAAA"}
@@ -0,0 +1,7 @@
1
+ export { createAnchorGroupBlock } from './factory';
2
+ export { ANCHOR_ALIGNMENTS, ANCHOR_COLUMNS } from './constants';
3
+ export const anchorGroupDefaults = {
4
+ name: 'brilo/anchor-group',
5
+ allowedBlocks: ['brilo/anchor-item'],
6
+ template: [['brilo/anchor-item', {}]],
7
+ };
@@ -0,0 +1,13 @@
1
+ import type { BriloBlockType, OptionArray } from '../../../types';
2
+ import type { ANCHOR_ALIGNMENTS, ANCHOR_COLUMNS } from './constants';
3
+ export type AnchorColumns = (typeof ANCHOR_COLUMNS)[number]['value'];
4
+ export type AnchorAlignment = (typeof ANCHOR_ALIGNMENTS)[number]['value'];
5
+ export interface AnchorGroupAttributes<TColumns extends string = AnchorColumns, TAlignment extends string = AnchorAlignment> extends Record<string, unknown> {
6
+ columns: TColumns;
7
+ align: TAlignment;
8
+ }
9
+ export interface AnchorGroupOptions<TColumnsOptions extends OptionArray = typeof ANCHOR_COLUMNS, TAlignments extends OptionArray = typeof ANCHOR_ALIGNMENTS> extends BriloBlockType {
10
+ columnsOptions?: TColumnsOptions;
11
+ alignments?: TAlignments;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA;AACxD,OAAO,KAAK,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,aAAa,CAAA;AAElE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA;AAEzE,MAAM,WAAW,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,aAAa,EAAE,UAAU,SAAS,MAAM,GAAG,eAAe,CACzH,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,QAAQ,CAAA;IACjB,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,MAAM,WAAW,kBAAkB,CACjC,eAAe,SAAS,WAAW,GAAG,OAAO,cAAc,EAC3D,WAAW,SAAS,WAAW,GAAG,OAAO,iBAAiB,CAC1D,SAAQ,cAAc;IACtB,cAAc,CAAC,EAAE,eAAe,CAAA;IAChC,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare const ANCHOR_ICON_TYPES: readonly [{
2
+ readonly value: 'preselected';
3
+ readonly label: import("@wordpress/i18n").TransformedText<"Předdefinovaná">;
4
+ }, {
5
+ readonly value: 'media';
6
+ readonly label: import("@wordpress/i18n").TransformedText<"Médium">;
7
+ }];
8
+ export declare const ANCHOR_ICON_SIZE_RANGE: {
9
+ readonly min: 8;
10
+ readonly max: 100;
11
+ };
12
+ export declare const ANCHOR_ICON_SIZE_DEFAULT = 32;
13
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-item/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;aAC3B,KAAK,EAAE,aAAa;aAAE,KAAK;;aAC3B,KAAK,EAAE,OAAO;aAAE,KAAK;EACd,CAAA;AAEV,eAAO,MAAM,sBAAsB;aAAI,GAAG,EAAE,CAAC;aAAE,GAAG,EAAE,GAAG;CAAU,CAAA;AAEjE,eAAO,MAAM,wBAAwB,KAAK,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { __ } from '@wordpress/i18n';
2
+ export const ANCHOR_ICON_TYPES = [
3
+ { value: 'preselected', label: __('Předdefinovaná', 'brilo-blocks') },
4
+ { value: 'media', label: __('Médium', 'brilo-blocks') },
5
+ ];
6
+ export const ANCHOR_ICON_SIZE_RANGE = { min: 8, max: 100 };
7
+ export const ANCHOR_ICON_SIZE_DEFAULT = 32;
@@ -0,0 +1,6 @@
1
+ import type { AnchorItemAttributes, AnchorItemOptions } from './types';
2
+ export declare function createAnchorItemEdit(options: AnchorItemOptions): ({ attributes, setAttributes, }: {
3
+ attributes: AnchorItemAttributes;
4
+ setAttributes: (a: Partial<AnchorItemAttributes>) => void;
5
+ }) => import("react").JSX.Element;
6
+ //# sourceMappingURL=edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-item/edit.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAEpE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,oCAI1D;IACD,UAAU,EAAE,oBAAoB,CAAA;IAChC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAA;CAC1D,iCAsEF"}
@@ -0,0 +1,24 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ColorPalette, InspectorControls, RichText, useBlockProps } from '@wordpress/block-editor';
3
+ import { BaseControl, PanelBody, RangeControl, TextControl, ToggleControl, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from '@wordpress/components';
4
+ import { __ } from '@wordpress/i18n';
5
+ import clsx from 'clsx';
6
+ import { ItemIconControl, ItemIconPreview } from '../../../components/ItemIconControl';
7
+ import { useTenantColorPalette } from '../../../hooks/useTenantColorPalette';
8
+ import { ANCHOR_ICON_SIZE_RANGE, ANCHOR_ICON_TYPES } from './constants';
9
+ export function createAnchorItemEdit(options) {
10
+ return function Edit({ attributes, setAttributes, }) {
11
+ var _a;
12
+ var _b;
13
+ const { title, url, icon, iconSize, iconColor, iconPosition } = attributes;
14
+ const { paletteColors } = useTenantColorPalette();
15
+ const hasIcon = icon.src || ((_a = icon.media) === null || _a === void 0 ? void 0 : _a.id);
16
+ const blockProps = useBlockProps({ className: clsx((_b = options.blockClassName) !== null && _b !== void 0 ? _b : 'i-anchor') });
17
+ const iconPreviewStyle = {
18
+ maxWidth: iconSize,
19
+ flex: `0 0 ${iconSize}px`,
20
+ '--icon-color': iconColor || undefined,
21
+ };
22
+ return (_jsxs(_Fragment, { children: [_jsxs(InspectorControls, { children: [_jsxs(PanelBody, { title: __('Odkaz', 'brilo-blocks'), children: [_jsx(TextControl, { label: __('Titulek', 'brilo-blocks'), value: title, onChange: (v) => setAttributes({ title: v }) }), _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'), children: [_jsx(ItemIconControl, { icon: icon, setAttributes: setAttributes, iconTypes: ANCHOR_ICON_TYPES, options: options }), _jsx(RangeControl, { label: __('Velikost ikony (px)', 'brilo-blocks'), value: iconSize, onChange: (v) => setAttributes({ iconSize: v !== null && v !== void 0 ? v : ANCHOR_ICON_SIZE_RANGE.min }), min: ANCHOR_ICON_SIZE_RANGE.min, max: ANCHOR_ICON_SIZE_RANGE.max }), _jsx(BaseControl, { label: __('Barva ikony', 'brilo-blocks'), id: "anchor-item-icon-color", children: _jsx(ColorPalette, { colors: paletteColors, value: iconColor || undefined, onChange: (v) => setAttributes({ iconColor: v !== null && v !== void 0 ? v : '' }) }) }), _jsxs(ToggleGroupControl, { isBlock: true, label: __('Pozice ikony', 'brilo-blocks'), value: iconPosition, onChange: (v) => setAttributes({ iconPosition: v }), children: [_jsx(ToggleGroupControlOption, { value: "before", label: __('Před textem', 'brilo-blocks') }), _jsx(ToggleGroupControlOption, { value: "after", label: __('Za textem', 'brilo-blocks') })] })] })] }), _jsxs("div", { ...blockProps, children: [hasIcon && iconPosition === 'before' && (_jsx("span", { className: "i-anchor__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setAttributes, options: options }) })), _jsx(RichText, { tagName: "span", className: "i-anchor__title", value: title, onChange: (v) => setAttributes({ title: v }), placeholder: __('Titulek kotvy...', 'brilo-blocks'), allowedFormats: [] }), hasIcon && iconPosition === 'after' && (_jsx("span", { className: "i-anchor__icon", style: iconPreviewStyle, children: _jsx(ItemIconPreview, { icon: icon, setAttributes: setAttributes, options: options }) }))] })] }));
23
+ };
24
+ }
@@ -0,0 +1,5 @@
1
+ import type { BlockConfiguration } from '@wordpress/blocks';
2
+ import type { AnchorItemAttributes, AnchorItemOptions } from './types';
3
+ export type { AnchorItemAttributes, AnchorItemOptions };
4
+ export declare function createAnchorItemBlock(options: AnchorItemOptions): BlockConfiguration<AnchorItemAttributes>;
5
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-item/factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAIzD,OAAO,KAAK,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAEpE,YAAY,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,CAAA;AAErD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,CAoB1G"}
@@ -0,0 +1,25 @@
1
+ import { __ } from '@wordpress/i18n';
2
+ import { ANCHOR_ICON_SIZE_DEFAULT } from './constants';
3
+ import { createAnchorItemEdit } from './edit';
4
+ export function createAnchorItemBlock(options) {
5
+ var _a, _b, _c;
6
+ return {
7
+ name: options.name,
8
+ title: (_a = options.title) !== null && _a !== void 0 ? _a : __('Kotva', 'brilo-blocks'),
9
+ description: options.description,
10
+ category: (_b = options.category) !== null && _b !== void 0 ? _b : 'text',
11
+ ...(options.parent && { parent: options.parent }),
12
+ icon: (_c = options.icon) !== null && _c !== void 0 ? _c : 'admin-links',
13
+ supports: { html: false, customClassName: false },
14
+ attributes: {
15
+ title: { type: 'string', default: '' },
16
+ url: { type: 'object', default: { src: '', blank: false } },
17
+ icon: { type: 'object', default: { type: 'preselected', src: '', media: {} } },
18
+ iconSize: { type: 'number', default: ANCHOR_ICON_SIZE_DEFAULT },
19
+ iconColor: { type: 'string', default: '' },
20
+ iconPosition: { type: 'string', default: 'before', enum: ['before', 'after'] },
21
+ },
22
+ edit: createAnchorItemEdit(options),
23
+ save: () => null,
24
+ };
25
+ }
@@ -0,0 +1,7 @@
1
+ export type { AnchorItemAttributes, AnchorItemOptions } from './types';
2
+ export { createAnchorItemBlock } from './factory';
3
+ export { createAnchorItemEdit } from './edit';
4
+ export { ANCHOR_ICON_SIZE_DEFAULT, ANCHOR_ICON_SIZE_RANGE, ANCHOR_ICON_TYPES } from './constants';
5
+ import type { AnchorItemOptions } from './types';
6
+ export declare const anchorItemDefaults: AnchorItemOptions;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-item/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAC,oBAAoB,EAAC,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAC,wBAAwB,EAAE,sBAAsB,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAA;AAE/F,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,kBAAkB,EAAE,iBAKhC,CAAA"}
@@ -0,0 +1,9 @@
1
+ export { createAnchorItemBlock } from './factory';
2
+ export { createAnchorItemEdit } from './edit';
3
+ export { ANCHOR_ICON_SIZE_DEFAULT, ANCHOR_ICON_SIZE_RANGE, ANCHOR_ICON_TYPES } from './constants';
4
+ export const anchorItemDefaults = {
5
+ name: 'brilo/anchor-item',
6
+ parent: ['brilo/anchor-group'],
7
+ icons: [],
8
+ iconsSrc: '',
9
+ };
@@ -0,0 +1,18 @@
1
+ import type { BriloBlockType, Icon } from '../../../types';
2
+ import type { IconType } from '../../../components/IconControl';
3
+ export interface AnchorItemAttributes extends Record<string, unknown> {
4
+ title: string;
5
+ url: {
6
+ src: string;
7
+ blank: boolean;
8
+ };
9
+ icon: Icon;
10
+ iconSize: number;
11
+ iconColor: string;
12
+ iconPosition: 'before' | 'after';
13
+ }
14
+ export interface AnchorItemOptions extends BriloBlockType {
15
+ icons: IconType[];
16
+ iconsSrc: string;
17
+ }
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/anchor/anchor-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAE,IAAI,EAAC,MAAM,SAAS,CAAA;AACjD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAEtD,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAC,CAAA;IAClC,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAA;CACjC;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const ASIDE_DEFAULTS: {};
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-aside/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,IAAK,CAAA"}
@@ -0,0 +1 @@
1
+ export const ASIDE_DEFAULTS = {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { AsideOptions } from './types';
3
+ export declare function createAsideEdit(options: AsideOptions): () => React.JSX.Element;
4
+ //# sourceMappingURL=edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-aside/edit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAkB,YAAY,EAAC,MAAM,SAAS,CAAA;AAE1D,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,2BAepD"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useGroupBlock } from '../../../hooks/useGroupBlock';
3
+ export function createAsideEdit(options) {
4
+ return function Edit() {
5
+ const { blockProps, innerBlocksProps } = useGroupBlock({
6
+ blockClassName: 'l-content-w-aside__aside',
7
+ containerClassName: 'l-content-w-aside__aside-container',
8
+ layout: { type: 'default' },
9
+ orientation: 'vertical',
10
+ });
11
+ return (_jsx("aside", { ...blockProps, children: _jsx("div", { ...innerBlocksProps }) }));
12
+ };
13
+ }
@@ -0,0 +1,4 @@
1
+ import type { BlockConfiguration } from '@wordpress/blocks';
2
+ import type { AsideAttributes, AsideOptions } from './types';
3
+ export declare function createAsideBlock(options: AsideOptions): BlockConfiguration<AsideAttributes>;
4
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-aside/factory.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAKzD,OAAO,KAAK,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,SAAS,CAAA;AAE1D,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,GACpB,kBAAkB,CAAC,eAAe,CAAC,CAarC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { InnerBlocks } from '@wordpress/block-editor';
3
+ import { __ } from '@wordpress/i18n';
4
+ import { createAsideEdit } from './edit';
5
+ import { icon as defaultIcon } from './icon';
6
+ export function createAsideBlock(options) {
7
+ var _a, _b, _c;
8
+ return {
9
+ name: options.name,
10
+ title: (_a = options.title) !== null && _a !== void 0 ? _a : __('Postranní panel', 'brilo-blocks'),
11
+ description: options.description,
12
+ category: (_b = options.category) !== null && _b !== void 0 ? _b : 'layout',
13
+ parent: options.parent,
14
+ icon: (_c = options.icon) !== null && _c !== void 0 ? _c : { src: defaultIcon },
15
+ supports: { html: false, customClassName: false },
16
+ attributes: {},
17
+ edit: createAsideEdit(options),
18
+ save: () => _jsx(InnerBlocks.Content, {}),
19
+ };
20
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const icon: React.JSX.Element;
3
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-aside/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,IAAI,mBAShB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const icon = (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 4H20V20H8V4ZM10 6H18V18H10V6Z", fill: "currentColor" }) }));
@@ -0,0 +1,5 @@
1
+ export type { AsideAttributes, AsideOptions } from './types';
2
+ export { createAsideBlock } from './factory';
3
+ import type { AsideOptions } from './types';
4
+ export declare const asideDefaults: AsideOptions;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-aside/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,SAAS,CAAA;AAC1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAA;AAE1C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,aAAa,EAAE,YAG3B,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { createAsideBlock } from './factory';
2
+ export const asideDefaults = {
3
+ name: 'brilo/layout-aside',
4
+ parent: ['brilo/layout-content-w-aside'],
5
+ };
@@ -0,0 +1,6 @@
1
+ import type { BriloBlockType } from '../../../types';
2
+ export interface AsideAttributes extends Record<string, unknown> {
3
+ }
4
+ export interface AsideOptions extends BriloBlockType {
5
+ }
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-aside/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAAG;AAEnE,MAAM,WAAW,YAAa,SAAQ,cAAc;CAAG"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const CONTENT_DEFAULTS: {};
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,IAAK,CAAA"}
@@ -0,0 +1 @@
1
+ export const CONTENT_DEFAULTS = {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { ContentOptions } from './types';
3
+ export declare function createContentEdit(options: ContentOptions): () => React.JSX.Element;
4
+ //# sourceMappingURL=edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content/edit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAoB,cAAc,EAAC,MAAM,SAAS,CAAA;AAE9D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,2BAexD"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useGroupBlock } from '../../../hooks/useGroupBlock';
3
+ export function createContentEdit(options) {
4
+ return function Edit() {
5
+ const { blockProps, innerBlocksProps } = useGroupBlock({
6
+ blockClassName: 'l-content-w-aside__content',
7
+ containerClassName: 'l-content-w-aside__content-container',
8
+ layout: { type: 'default' },
9
+ orientation: 'vertical',
10
+ });
11
+ return (_jsx("div", { ...blockProps, children: _jsx("div", { ...innerBlocksProps }) }));
12
+ };
13
+ }
@@ -0,0 +1,4 @@
1
+ import type { BlockConfiguration } from '@wordpress/blocks';
2
+ import type { ContentAttributes, ContentOptions } from './types';
3
+ export declare function createContentBlock(options: ContentOptions): BlockConfiguration<ContentAttributes>;
4
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content/factory.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAKzD,OAAO,KAAK,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,SAAS,CAAA;AAE9D,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,GACtB,kBAAkB,CAAC,iBAAiB,CAAC,CAavC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { InnerBlocks } from '@wordpress/block-editor';
3
+ import { __ } from '@wordpress/i18n';
4
+ import { createContentEdit } from './edit';
5
+ import { icon as defaultIcon } from './icon';
6
+ export function createContentBlock(options) {
7
+ var _a, _b, _c;
8
+ return {
9
+ name: options.name,
10
+ title: (_a = options.title) !== null && _a !== void 0 ? _a : __('Obsah', 'brilo-blocks'),
11
+ description: options.description,
12
+ category: (_b = options.category) !== null && _b !== void 0 ? _b : 'layout',
13
+ parent: options.parent,
14
+ icon: (_c = options.icon) !== null && _c !== void 0 ? _c : { src: defaultIcon },
15
+ supports: { html: false, customClassName: false },
16
+ attributes: {},
17
+ edit: createContentEdit(options),
18
+ save: () => _jsx(InnerBlocks.Content, {}),
19
+ };
20
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const icon: React.JSX.Element;
3
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,IAAI,mBAShB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const icon = (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 4H16V20H4V4ZM6 6H14V18H6V6Z", fill: "currentColor" }) }));
@@ -0,0 +1,5 @@
1
+ export type { ContentAttributes, ContentOptions } from './types';
2
+ export { createContentBlock } from './factory';
3
+ import type { ContentOptions } from './types';
4
+ export declare const contentDefaults: ContentOptions;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAC,kBAAkB,EAAC,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,eAAe,EAAE,cAG7B,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { createContentBlock } from './factory';
2
+ export const contentDefaults = {
3
+ name: 'brilo/layout-content',
4
+ parent: ['brilo/layout-content-w-aside'],
5
+ };
@@ -0,0 +1,6 @@
1
+ import type { BriloBlockType } from '../../../types';
2
+ export interface ContentAttributes extends Record<string, unknown> {
3
+ }
4
+ export interface ContentOptions extends BriloBlockType {
5
+ }
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAAG;AAErE,MAAM,WAAW,cAAe,SAAQ,cAAc;CAAG"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare const ASIDE_SIZES: readonly [{
2
+ readonly value: 'sm';
3
+ readonly label: import("@wordpress/i18n").TransformedText<"Malá">;
4
+ }, {
5
+ readonly value: 'md';
6
+ readonly label: import("@wordpress/i18n").TransformedText<"Střední">;
7
+ }, {
8
+ readonly value: 'lg';
9
+ readonly label: import("@wordpress/i18n").TransformedText<"Velká">;
10
+ }];
11
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/layout/layout-content-w-aside/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;aACrB,KAAK,EAAE,IAAI;aAAE,KAAK;;aAClB,KAAK,EAAE,IAAI;aAAE,KAAK;;aAClB,KAAK,EAAE,IAAI;aAAE,KAAK;EACX,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { __ } from '@wordpress/i18n';
2
+ export const ASIDE_SIZES = [
3
+ { value: 'sm', label: __('Malá', 'brilo-blocks') },
4
+ { value: 'md', label: __('Střední', 'brilo-blocks') },
5
+ { value: 'lg', label: __('Velká', 'brilo-blocks') },
6
+ ];
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ContentWithAsideAttributes, ContentWithAsideOptions } from './types';
3
+ export declare function createContentWithAsideEdit(options: ContentWithAsideOptions): ({ attributes, setAttributes, }: {
4
+ attributes: ContentWithAsideAttributes;
5
+ setAttributes: (a: Partial<ContentWithAsideAttributes>) => void;
6
+ }) => React.JSX.Element;
7
+ //# sourceMappingURL=edit.d.ts.map