1 | import { createElement } from "@wordpress/element";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import { __ } from '@wordpress/i18n';
|
7 | import { createBlock } from '@wordpress/blocks';
|
8 | import { SVG, Path } from '@wordpress/components';
|
9 | export var name = 'core/separator';
|
10 | export var settings = {
|
11 | title: __('Separator'),
|
12 | description: __('Create a break between ideas or sections with a horizontal separator.'),
|
13 | icon: createElement(SVG, {
|
14 | viewBox: "0 0 24 24",
|
15 | xmlns: "http://www.w3.org/2000/svg"
|
16 | }, createElement(Path, {
|
17 | fill: "none",
|
18 | d: "M0 0h24v24H0V0z"
|
19 | }), createElement(Path, {
|
20 | d: "M19 13H5v-2h14v2z"
|
21 | })),
|
22 | category: 'layout',
|
23 | keywords: [__('horizontal-line'), 'hr', __('divider')],
|
24 | styles: [{
|
25 | name: 'default',
|
26 | label: __('Default'),
|
27 | isDefault: true
|
28 | }, {
|
29 | name: 'wide',
|
30 | label: __('Wide Line')
|
31 | }, {
|
32 | name: 'dots',
|
33 | label: __('Dots')
|
34 | }],
|
35 | transforms: {
|
36 | from: [{
|
37 | type: 'enter',
|
38 | regExp: /^-{3,}$/,
|
39 | transform: function transform() {
|
40 | return createBlock('core/separator');
|
41 | }
|
42 | }, {
|
43 | type: 'raw',
|
44 | selector: 'hr',
|
45 | schema: {
|
46 | hr: {}
|
47 | }
|
48 | }]
|
49 | },
|
50 | edit: function edit(_ref) {
|
51 | var className = _ref.className;
|
52 | return createElement("hr", {
|
53 | className: className
|
54 | });
|
55 | },
|
56 | save: function save() {
|
57 | return createElement("hr", null);
|
58 | }
|
59 | };
|
60 |
|
\ | No newline at end of file |