PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / blocks / archive-header / src / edit.js

edit.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/blocks/archive-header/src/edit.js

57 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from "@wordpress/i18n";
2 import Inspector from "./inspector";
3 import { useBlockProps } from "@wordpress/block-editor";
4 import ArchiveIcon from "./archiveIcon";
5 import { useStyleSheets, useDuplicateBlockIdFix, usePreviewDeviceType } from "../../../hooks";
6 import cssProperties from "./cssProperties";
7
8 const BLOCK_PREFIX = "archive-header";
9 const Edit = ({ attributes, setAttributes, isSelected, clientId }) => {
10 const { blockId, titleTag } = attributes;
11 const blockProps = useBlockProps({
12 className: `eb-guten-block-main-parent-wrapper`,
13 });
14
15 const { styleTag } = useStyleSheets({
16 properties: cssProperties({ blockId }),
17 setAttributes,
18 attributes,
19 });
20
21 usePreviewDeviceType(setAttributes);
22 useDuplicateBlockIdFix(BLOCK_PREFIX, blockId, clientId, setAttributes);
23 let TitleTag = titleTag;
24 return (
25 <>
26 {isSelected && (
27 <Inspector
28 attributes={attributes}
29 setAttributes={setAttributes}
30 />
31 )}
32 <div {...blockProps}>
33 {styleTag()}
34 <div className={`${blockId} betterdocs-main-category-folder`}>
35 <div className="betterdocs-category-header">
36 <div className="betterdocs-category-header-inner">
37 <div className="betterdocs-category-icon">
38 <span className="betterdocs-folder-icon toggle-arrow arrow-down">
39 <ArchiveIcon/>
40 </span>
41 </div>
42 <TitleTag className="betterdocs-category-title">{ __('Category Name', 'betterdocs') }</TitleTag>
43 <div
44 data-count="1"
45 className="betterdocs-sub-category-items-counts"
46 >
47 <span>{`1 ${__('Doc', 'betterdocs')}`}</span>
48 </div>
49 </div>
50 </div>
51 </div>
52 </div>
53 </>
54 );
55 };
56 export default Edit;
57