1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = ArchivesEdit;
|
7 |
|
8 | var _element = require("@wordpress/element");
|
9 |
|
10 | var _components = require("@wordpress/components");
|
11 |
|
12 | var _i18n = require("@wordpress/i18n");
|
13 |
|
14 | var _blockEditor = require("@wordpress/block-editor");
|
15 |
|
16 | var _editor = require("@wordpress/editor");
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | function ArchivesEdit(_ref) {
|
22 | var attributes = _ref.attributes,
|
23 | setAttributes = _ref.setAttributes;
|
24 | var align = attributes.align,
|
25 | showPostCounts = attributes.showPostCounts,
|
26 | displayAsDropdown = attributes.displayAsDropdown;
|
27 | return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
|
28 | title: (0, _i18n.__)('Archives Settings')
|
29 | }, (0, _element.createElement)(_components.ToggleControl, {
|
30 | label: (0, _i18n.__)('Display as Dropdown'),
|
31 | checked: displayAsDropdown,
|
32 | onChange: function onChange() {
|
33 | return setAttributes({
|
34 | displayAsDropdown: !displayAsDropdown
|
35 | });
|
36 | }
|
37 | }), (0, _element.createElement)(_components.ToggleControl, {
|
38 | label: (0, _i18n.__)('Show Post Counts'),
|
39 | checked: showPostCounts,
|
40 | onChange: function onChange() {
|
41 | return setAttributes({
|
42 | showPostCounts: !showPostCounts
|
43 | });
|
44 | }
|
45 | }))), (0, _element.createElement)(_blockEditor.BlockControls, null, (0, _element.createElement)(_blockEditor.BlockAlignmentToolbar, {
|
46 | value: align,
|
47 | onChange: function onChange(nextAlign) {
|
48 | setAttributes({
|
49 | align: nextAlign
|
50 | });
|
51 | },
|
52 | controls: ['left', 'center', 'right']
|
53 | })), (0, _element.createElement)(_components.Disabled, null, (0, _element.createElement)(_editor.ServerSideRender, {
|
54 | block: "core/archives",
|
55 | attributes: attributes
|
56 | })));
|
57 | }
|
58 |
|
\ | No newline at end of file |