lucid-extension-sdk 0.0.134 → 0.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sdk/commandtypes.d.ts +7 -0
- package/sdk/commandtypes.js +1 -0
- package/sdk/ui/viewport.d.ts +4 -0
- package/sdk/ui/viewport.js +6 -0
package/package.json
CHANGED
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare const enum CommandName {
|
|
|
63
63
|
GetSelection = "gs",
|
|
64
64
|
GetShapeData = "gsd",
|
|
65
65
|
GetTextStyle = "gts",
|
|
66
|
+
GetVisibleRect = "gvr",
|
|
66
67
|
HideModal = "hm",
|
|
67
68
|
HidePanel = "hp",
|
|
68
69
|
HookCreateItems = "hci",
|
|
@@ -295,6 +296,10 @@ export declare type CommandArgs = {
|
|
|
295
296
|
query: GetTextStyleQuery;
|
|
296
297
|
result: GetTextStyleResult;
|
|
297
298
|
};
|
|
299
|
+
[CommandName.GetVisibleRect]: {
|
|
300
|
+
query: GetVisibleRectQuery;
|
|
301
|
+
result: GetVisibleRectResult;
|
|
302
|
+
};
|
|
298
303
|
[CommandName.HideModal]: {
|
|
299
304
|
query: HideModalQuery;
|
|
300
305
|
result: HideModalResult;
|
|
@@ -889,6 +894,8 @@ export declare type GetTextStyleQuery = {
|
|
|
889
894
|
'n': string;
|
|
890
895
|
};
|
|
891
896
|
export declare type GetTextStyleResult = TextStyle;
|
|
897
|
+
export declare type GetVisibleRectQuery = void;
|
|
898
|
+
export declare type GetVisibleRectResult = Box;
|
|
892
899
|
export declare type HideModalQuery = {
|
|
893
900
|
/** Name of the modal's action for receiving events, i.e. ShowModalQuery['n'] */
|
|
894
901
|
'n': string;
|
package/sdk/commandtypes.js
CHANGED
|
@@ -45,6 +45,7 @@ exports.commandTitles = new Map([
|
|
|
45
45
|
["gs" /* CommandName.GetSelection */, 'GetSelection'],
|
|
46
46
|
["gsd" /* CommandName.GetShapeData */, 'GetShapeData'],
|
|
47
47
|
["gts" /* CommandName.GetTextStyle */, 'GetTextStyle'],
|
|
48
|
+
["gvr" /* CommandName.GetVisibleRect */, 'GetVisibleRect'],
|
|
48
49
|
["hm" /* CommandName.HideModal */, 'HideModal'],
|
|
49
50
|
["hp" /* CommandName.HidePanel */, 'HidePanel'],
|
|
50
51
|
["hci" /* CommandName.HookCreateItems */, 'HookCreateItems'],
|
package/sdk/ui/viewport.d.ts
CHANGED
|
@@ -30,6 +30,10 @@ export declare class Viewport {
|
|
|
30
30
|
* @param page The page to view
|
|
31
31
|
*/
|
|
32
32
|
setCurrentPage(page: PageProxy): void;
|
|
33
|
+
/**
|
|
34
|
+
* @returns the box for the current viewport location
|
|
35
|
+
*/
|
|
36
|
+
getVisibleRect(): import("../math").Box;
|
|
33
37
|
/**
|
|
34
38
|
* Switch to the page containing these items, if necessary, and then animate the viewport
|
|
35
39
|
* to zoom in and focus on these items.
|
package/sdk/ui/viewport.js
CHANGED
|
@@ -37,6 +37,12 @@ class Viewport {
|
|
|
37
37
|
setCurrentPage(page) {
|
|
38
38
|
this.client.sendCommand("scp" /* CommandName.SetCurrentPage */, page.id);
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @returns the box for the current viewport location
|
|
42
|
+
*/
|
|
43
|
+
getVisibleRect() {
|
|
44
|
+
return this.client.sendCommand("gvr" /* CommandName.GetVisibleRect */, undefined);
|
|
45
|
+
}
|
|
40
46
|
/**
|
|
41
47
|
* Switch to the page containing these items, if necessary, and then animate the viewport
|
|
42
48
|
* to zoom in and focus on these items.
|