403Webshell
Server IP : 66.29.153.156  /  Your IP : 216.73.217.22
Web Server : LiteSpeed
System : Linux premium322.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User : lastyfjz ( 1521)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/lastyfjz/./unicitys.com/wp-content/plugins/extendify/src/QuickEdit/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/lastyfjz/./unicitys.com/wp-content/plugins/extendify/src/QuickEdit/lib/save-bridge.js
// Lets non-React callers (hover-bar's click rule, Agent's chat submit)
// trigger the QE canvas's save. Without this, every implicit-close gesture
// — cross-block click, click-outside, Ask AI pill, agent chat submit —
// silently discards the user's in-flight edits.
//
// BlockTextEditor registers its `handleSave` on mount. The bridge stays a
// no-op when nothing is registered (no QE canvas open) so callers can
// fire-and-forget.
//
// Cross-block click passes `alsoClear: false` so handleSave skips its
// final `clearSelected()` — the new click is already calling
// `setSelected(B)` synchronously after, and we don't want the async save
// completion to overwrite B with null.

let saver = null;

export const registerSaver = (fn) => {
	saver = fn;
};

export const unregisterSaver = (fn) => {
	if (saver === fn) saver = null;
};

export const hasSaver = () => !!saver;

export const saveSelected = (options = {}) => {
	if (!saver) return Promise.resolve();
	return Promise.resolve(saver(options));
};

export const AGENT_SUBMIT_EVENT = 'extendify-quick-edit:agent-submit';

if (typeof window !== 'undefined') {
	window.addEventListener(AGENT_SUBMIT_EVENT, () => {
		if (saver) saver({ alsoClear: true });
	});
}

Youez - 2016 - github.com/yon3zu
LinuXploit