lucid-extension-sdk
Advanced tools
Comparing version 0.0.226 to 0.0.227
@@ -1020,2 +1020,8 @@ import { SerializedFieldTypeDefinition } from './core/data/fieldtypedefinition/fieldtypedefinition'; | ||
export type FindAvailableSpaceQuery = { | ||
/** If specified, the page to find space on. Otherwise use the visible page. */ | ||
'p'?: string | undefined; | ||
/** If specified, the location to search near. Otherwise use the viewport. */ | ||
'x'?: number | undefined; | ||
/** If specified, the location to search near. Otherwise use the viewport. */ | ||
'y'?: number | undefined; | ||
/** Width */ | ||
@@ -1022,0 +1028,0 @@ 'w': number; |
@@ -37,2 +37,16 @@ import { GetItemsAtSearchType, GetLLMContextType } from '../commandtypes'; | ||
/** | ||
* Find available space on this page for adding new content. | ||
* @param searchX Place to start the search | ||
* @param searchY Place to start the search | ||
* @param width | ||
* @param height | ||
* @returns a reference to the page and origin (upper-left point) of the space you can add new | ||
* content of the given size to. | ||
*/ | ||
findAvailableSpace(searchX: number, searchY: number, width: number, height: number): { | ||
page: PageProxy; | ||
x: number; | ||
y: number; | ||
}; | ||
/** | ||
* The blocks contained directly on this page, not including ones inside groups | ||
@@ -62,2 +76,6 @@ */ | ||
/** | ||
* All blocks, lines, and groups on the page, including ones inside groups | ||
*/ | ||
readonly allItems: MapProxy<string, BlockProxy | LineProxy | GroupProxy>; | ||
/** | ||
* Add a new block to this page. | ||
@@ -64,0 +82,0 @@ * |
@@ -46,2 +46,6 @@ "use strict"; | ||
this.allGroups = new mapproxy_1.MapProxy(() => this.client.sendCommand("lg" /* CommandName.ListGroups */, { id: this.id, d: true }), (id) => new groupproxy_1.GroupProxy(id, this.client)); | ||
/** | ||
* All blocks, lines, and groups on the page, including ones inside groups | ||
*/ | ||
this.allItems = new mapproxy_1.MapProxy(() => [...this.allBlocks.keys(), ...this.allLines.keys(), ...this.allGroups.keys()], (id) => this.client.getItemProxy(id)); | ||
} | ||
@@ -75,2 +79,25 @@ /** | ||
/** | ||
* Find available space on this page for adding new content. | ||
* @param searchX Place to start the search | ||
* @param searchY Place to start the search | ||
* @param width | ||
* @param height | ||
* @returns a reference to the page and origin (upper-left point) of the space you can add new | ||
* content of the given size to. | ||
*/ | ||
findAvailableSpace(searchX, searchY, width, height) { | ||
const result = this.client.sendCommand("fas" /* CommandName.FindAvailableSpace */, { | ||
'p': this.id, | ||
'x': searchX, | ||
'y': searchY, | ||
'w': width, | ||
'h': height, | ||
}); | ||
return { | ||
page: this, | ||
x: result['x'], | ||
y: result['y'], | ||
}; | ||
} | ||
/** | ||
* Add a new block to this page. | ||
@@ -77,0 +104,0 @@ * |
{ | ||
"name": "lucid-extension-sdk", | ||
"version": "0.0.226", | ||
"version": "0.0.227", | ||
"description": "Utility classes for writing Lucid Software editor extensions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
713136
16588