Changeset 0.21.5 (#91)
This commit is contained in:
@@ -167,6 +167,28 @@ const Surfaces = {
|
||||
return this._registry.size > 1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get a saved DocumentFragment for a specific surface + region.
|
||||
* Used by surfaces like editor-mode that want to embed chat DOM
|
||||
* inside their own layout.
|
||||
* @param {string} surfaceId — the surface that owns the saved DOM
|
||||
* @param {string} regionId — the region name
|
||||
* @returns {DocumentFragment|null}
|
||||
*/
|
||||
getSavedFragment(surfaceId, regionId) {
|
||||
const key = `${surfaceId}::${regionId}`;
|
||||
return this._saved.get(key) || null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Put a DocumentFragment back into the saved store.
|
||||
* Used during deactivation to return borrowed DOM.
|
||||
*/
|
||||
putSavedFragment(surfaceId, regionId, frag) {
|
||||
const key = `${surfaceId}::${regionId}`;
|
||||
this._saved.set(key, frag);
|
||||
},
|
||||
|
||||
// ── Region Management ────────────────────
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user