diff --git a/config/current.ver b/config/current.ver index a77d7d9..5975b14 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.7 \ No newline at end of file +1.2.8 \ No newline at end of file diff --git a/public/assets/js/ui-editor.js b/public/assets/js/ui-editor.js index aae3440..4731608 100644 --- a/public/assets/js/ui-editor.js +++ b/public/assets/js/ui-editor.js @@ -163,7 +163,7 @@ export function initEditor() { selectionTimer = setTimeout(() => { selectionJustChanged = false; selectionTimer = null; - }, 120); + }, 800); }; const onUpdate = () => { if (selectionJustChanged) return; @@ -174,7 +174,9 @@ export function initEditor() { ? model.changedAttributes() : (model && model.changed) ? model.changed : null; const keys = changed ? Object.keys(changed) : []; - if (keys.length === 1 && keys[0] === 'status') return; + if (!keys.length && selectionJustChanged) return; + const safeKeys = new Set(['status', 'toolbar', 'selected', 'hovered', 'highlighted', 'hoverable', 'selectable', 'editable', 'draggable', 'droppable', 'copyable', 'removable', 'locked']); + if (keys.length && keys.every(k => safeKeys.has(k))) return; if (selectionJustChanged && keys.length === 0) return; markDirty(); }; diff --git a/src/ApiKernel.php b/src/ApiKernel.php index 6e18be4..e2743ba 100644 --- a/src/ApiKernel.php +++ b/src/ApiKernel.php @@ -2242,28 +2242,14 @@ class ApiKernel if ($hasHtmlAttrs) return true; if (preg_match($jsonTypePattern, $html) && preg_match($jsonIdPattern, $html)) return true; - $kindPattern = '/data-lib-(?:kind|section)\s*=\s*(["\"])([^"\']+)\1/i'; $libIdPattern = '/data-lib-id\s*=\s*(["\"])' . $id . '\1/i'; if (preg_match($libIdPattern, $html)) { - if (!$libKinds) return true; - if (preg_match($kindPattern, $html, $m)) { - $kind = strtolower(trim((string)($m[2] ?? ''))); - if ($kind === '' || in_array($kind, $libKinds, true)) return true; - } else { - return true; - } + return true; } $jsonLibIdPattern = '/"data-lib-id"\s*:\s*("?)(?:' . $id . ')\1/i'; - $jsonLibKindPattern = '/"data-lib-(?:kind|section)"\s*:\s*"([^"]+)"/i'; if (preg_match($jsonLibIdPattern, $html)) { - if (!$libKinds) return true; - if (preg_match($jsonLibKindPattern, $html, $m)) { - $kind = strtolower(trim((string)($m[1] ?? ''))); - if ($kind === '' || in_array($kind, $libKinds, true)) return true; - } else { - return true; - } + return true; } return false;