Changeset 0.21.3 (#89)
This commit is contained in:
@@ -242,6 +242,22 @@ const Extensions = {
|
||||
return Promise.resolve(window.confirm(msg));
|
||||
},
|
||||
|
||||
/**
|
||||
* Replace a surface region's content with a new element.
|
||||
* Current children are preserved in memory (not destroyed)
|
||||
* and can be restored later. Critical for CM6 state preservation.
|
||||
*/
|
||||
replace(regionId, element) {
|
||||
if (typeof Surfaces !== 'undefined') Surfaces.replace(regionId, element);
|
||||
},
|
||||
|
||||
/**
|
||||
* Restore a surface region's previously saved content.
|
||||
*/
|
||||
restore(regionId) {
|
||||
if (typeof Surfaces !== 'undefined') Surfaces.restore(regionId);
|
||||
},
|
||||
|
||||
/** Inject an element into a named UI region (stub for future use). */
|
||||
inject(region, el) {
|
||||
console.warn(`[Extensions] ui.inject() not yet implemented (${extId}:${region})`);
|
||||
@@ -254,6 +270,23 @@ const Extensions = {
|
||||
},
|
||||
},
|
||||
|
||||
// Surface registration (v0.21.3)
|
||||
surfaces: {
|
||||
register: (id, opts) => {
|
||||
if (typeof Surfaces !== 'undefined') Surfaces.register(id, opts);
|
||||
},
|
||||
unregister: (id) => {
|
||||
if (typeof Surfaces !== 'undefined') Surfaces.unregister(id);
|
||||
},
|
||||
activate: (id) => {
|
||||
if (typeof Surfaces !== 'undefined') Surfaces.activate(id);
|
||||
},
|
||||
getCurrent: () => {
|
||||
if (typeof Surfaces !== 'undefined') return Surfaces.getCurrent();
|
||||
return 'chat';
|
||||
},
|
||||
},
|
||||
|
||||
// Model info (resolved at call time)
|
||||
get model() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user