SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > extendify > > src > Draft > components


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/extendify//src/Draft/components

NameTypeSizeLast ModifiedActions
image-generation Directory - -
stock-images Directory - -
Completion.jsx File 613 bytes July 16 2024 23:59:12.
ConsentSidebar.jsx File 798 bytes October 08 2024 14:19:28.
DraftMenu.jsx File 1248 bytes March 04 2024 10:54:28.
DynamicTextarea.jsx File 2188 bytes July 16 2024 23:59:12.
EditMenu.jsx File 2416 bytes December 03 2024 01:47:48.
GenerateImageButtons.jsx File 5219 bytes March 26 2025 18:03:22.
Input.jsx File 2585 bytes December 03 2024 01:47:48.
InsertMenu.jsx File 7333 bytes June 09 2025 17:02:32.
SelectedText.jsx File 1725 bytes December 03 2024 01:47:48.
ToolbarMenu.jsx File 5120 bytes December 03 2024 01:47:48.
TranslationDropdown.jsx File 6275 bytes January 02 2025 21:15:44.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/extendify//src/Draft/components/EditMenu.jsx

import { MenuGroup, MenuItem } from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import {
	customPostType,
	termDescription,
	paragraph,
	postContent,
	Icon,
} from '@wordpress/icons';
import { useContentHighlight } from '@draft/hooks/useContentHighlight';
import { useSelectedText } from '@draft/hooks/useSelectedText';
import { twoLines } from '@draft/svg';

export const EditMenu = ({ disabled, setPrompt }) => {
	const { toggleHighlight } = useContentHighlight();
	const { selectedText } = useSelectedText();

	const selectedBlockClientIds = useSelect(
		(select) => select('core/block-editor').getSelectedBlockClientIds(),
		[],
	);

	useEffect(() => {
		return () => {
			toggleHighlight(selectedBlockClientIds, { isHighlighted: false });
		};
	}, [selectedBlockClientIds, toggleHighlight]);

	const handleClick = (promptType) => {
		setPrompt({
			text: selectedText,
			promptType,
			systemMessageKey: 'edit',
		});
	};

	const actionsList = [
		{
			label: __('Improve writing', 'extendify-local'),
			promptType: 'improve-writing',
			systemMessageKey: 'edit',
			icon: <Icon icon={customPostType} />,
		},
		{
			label: __('Fix spelling & grammar', 'extendify-local'),
			promptType: 'fix-spelling-grammar',
			icon: <Icon icon={termDescription} />,
		},
		{
			label: __('Simplify language', 'extendify-local'),
			promptType: 'simplify-language',
			icon: <Icon icon={paragraph} />,
		},
		{
			label: __('Make shorter', 'extendify-local'),
			promptType: 'make-shorter',
			icon: <Icon icon={twoLines} />,
		},
		{
			label: __('Make longer', 'extendify-local'),
			promptType: 'make-longer',
			icon: <Icon icon={postContent} />,
		},
	];

	return (
		<MenuGroup>
			{actionsList.map(({ label, promptType, icon }) => (
				<MenuItem
					key={`${promptType}-${promptType}-edit`}
					onClick={() => handleClick(promptType)}
					onMouseEnter={() =>
						toggleHighlight(selectedBlockClientIds, {
							isHighlighted: true,
						})
					}
					onMouseLeave={() =>
						toggleHighlight(selectedBlockClientIds, {
							isHighlighted: false,
						})
					}
					icon={icon}
					iconPosition="left"
					disabled={disabled}
					className="group">
					<span className="whitespace-normal text-left rtl:text-right">
						{label}
					</span>
				</MenuItem>
			))}
		</MenuGroup>
	);
};

SILENT KILLER Tool