| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor Kit & Settings module (spec 031-elementor-kit-settings). |
| 4 |
* |
| 5 |
* PHP-only utility module, no REST routes, no JS — matches the |
| 6 |
* modules/ai-content-merger/ shape. Two static utilities, each with genuinely |
| 7 |
* independent, multi-spec consumers (the exact reason this warrants its own |
| 8 |
* module rather than staying embedded in full-site-import or settings): |
| 9 |
* |
| 10 |
* - ElementorSettingsMerger: resolves `__globals__` references in element |
| 11 |
* settings to concrete kit values. Relocated from |
| 12 |
* modules/full-site-import/Utils/ElementorSettingsMerger.php — behavior |
| 13 |
* byte-identical. Consumed by modules/full-site-import/ (FSI pipeline) AND |
| 14 |
* includes/Core/Platform/Elementor.php (single-template import, not yet |
| 15 |
* extracted — future spec 032's territory). |
| 16 |
* - KitApplier: writes customizer-output color/font assignments into the |
| 17 |
* active Elementor kit. Surgically extracted from |
| 18 |
* modules/settings/REST/Settings.php::update_elementor_settings() — |
| 19 |
* behavior byte-identical; the REST route/param-parsing stays in |
| 20 |
* modules/settings/, only the "write into the kit" logic moved. |
| 21 |
* |
| 22 |
* SCOPE NOTE: the kit-import runner logic (backup-active-kit-id, |
| 23 |
* create-new-kit-and-activate, apply theme_style) lives inline inside |
| 24 |
* modules/full-site-import/Runners/ElementorContent.php's import() method, |
| 25 |
* interleaved with that runner's OTHER job (Elementor page/post content |
| 26 |
* import — same class, same pipeline slot as GutenbergContent). It was NOT |
| 27 |
* extracted: the FSI Loop trait derives per-item resume keys from the |
| 28 |
* runner's `Class::method` call identity (see |
| 29 |
* modules/full-site-import/Runners/CLAUDE.md), so relocating the runner |
| 30 |
* class itself would change that identity and could strand an in-flight |
| 31 |
* import's resume position across a plugin update. The 3 private kit-manager |
| 32 |
* fallback/compat helper methods on that class |
| 33 |
* (get_kit_with_fallback/create_new_kit_with_fallback/ |
| 34 |
* create_default_kit_with_fallback) have no consumer outside that one file, |
| 35 |
* so extracting them into this module would add indirection without a |
| 36 |
* reuse benefit. Manual kit-revert-on-failure lives in |
| 37 |
* modules/import-revert/RevertController.php as one line within a |
| 38 |
* GENERIC options-restore loop covering the whole FSI revert surface (not |
| 39 |
* kit-specific code) — also stays put. |
| 40 |
* |
| 41 |
* @package Templately |
| 42 |
*/ |
| 43 |
|
| 44 |
namespace Templately\Modules\ElementorKitSettings; |
| 45 |
|
| 46 |
use Templately\Core\Module_Base; |
| 47 |
|
| 48 |
class Module extends Module_Base { |
| 49 |
|
| 50 |
public function get_name(): string { |
| 51 |
return 'elementor-kit-settings'; |
| 52 |
} |
| 53 |
} |
| 54 |
|