lucid-extension-sdk 0.0.140 → 0.0.141

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/commandtypes.d.ts CHANGED
@@ -89,6 +89,7 @@ export declare const enum CommandName {
89
89
  LogForTestCase = "log",
90
90
  OffsetItems = "oi",
91
91
  PatchDataItems = "pdi",
92
+ Prompt = "p",
92
93
  RegisterPanel = "rp",
93
94
  RegisterUnfurl = "ru",
94
95
  ReloadExtension = "r",
@@ -400,6 +401,10 @@ export declare type CommandArgs = {
400
401
  query: PatchDataItemsQuery;
401
402
  result: PatchDataItemsResult;
402
403
  };
404
+ [CommandName.Prompt]: {
405
+ query: PromptQuery;
406
+ result: PromptResult;
407
+ };
403
408
  [CommandName.RegisterPanel]: {
404
409
  query: RegisterPanelQuery;
405
410
  result: RegisterPanelResult;
@@ -1005,6 +1010,13 @@ export declare type PatchDataItemsQuery = {
1005
1010
  };
1006
1011
  /** Primary keys inserted, if any */
1007
1012
  export declare type PatchDataItemsResult = string[];
1013
+ export declare type PromptQuery = {
1014
+ /** Title; defaults to extension title */
1015
+ 't'?: string | undefined;
1016
+ /** Body text */
1017
+ 'b': string;
1018
+ };
1019
+ export declare type PromptResult = Promise<string | undefined>;
1008
1020
  export declare type RegisterPanelQuery = {
1009
1021
  /** Name of the panel's action for receiving events; generated automatically by Panel base class */
1010
1022
  'n': string;
package/commandtypes.js CHANGED
@@ -71,6 +71,7 @@ exports.commandTitles = new Map([
71
71
  ["log" /* CommandName.LogForTestCase */, 'LogForTestCase'],
72
72
  ["oi" /* CommandName.OffsetItems */, 'OffsetItems'],
73
73
  ["pdi" /* CommandName.PatchDataItems */, 'PatchDataItems'],
74
+ ["p" /* CommandName.Prompt */, 'Prompt'],
74
75
  ["rp" /* CommandName.RegisterPanel */, 'RegisterPanel'],
75
76
  ["ru" /* CommandName.RegisterUnfurl */, 'RegisterUnfurl'],
76
77
  ["r" /* CommandName.ReloadExtension */, 'ReloadExtension'],
package/editorclient.d.ts CHANGED
@@ -308,5 +308,12 @@ export declare class EditorClient {
308
308
  * @returns a Promise that resolves true if the user clicks OK, false if they click Cancel or otherwise dismiss the modal
309
309
  */
310
310
  confirm(text: string, title?: string, okText?: string, cancelText?: string): import("./commandtypes").ConfirmResult;
311
+ /**
312
+ * Display a prompt modal to the user
313
+ * @param text Body text to display in the alert modal
314
+ * @param title Title of the alert modal; defaults to the extension title specified in manifest.json
315
+ * @returns a Promise that resolves to a string if a user enters one, or undefined if they cancel
316
+ */
317
+ prompt(text: string, title?: string): import("./commandtypes").PromptResult;
311
318
  constructor();
312
319
  }
package/editorclient.js CHANGED
@@ -520,5 +520,14 @@ class EditorClient {
520
520
  confirm(text, title, okText, cancelText) {
521
521
  return this.sendCommand("c" /* CommandName.Confirm */, { 't': title, 'b': text, 'o': okText, 'c': cancelText });
522
522
  }
523
+ /**
524
+ * Display a prompt modal to the user
525
+ * @param text Body text to display in the alert modal
526
+ * @param title Title of the alert modal; defaults to the extension title specified in manifest.json
527
+ * @returns a Promise that resolves to a string if a user enters one, or undefined if they cancel
528
+ */
529
+ prompt(text, title) {
530
+ return this.sendCommand("p" /* CommandName.Prompt */, { 't': title, 'b': text });
531
+ }
523
532
  }
524
533
  exports.EditorClient = EditorClient;
package/math.d.ts CHANGED
@@ -8,5 +8,6 @@ export declare type Box = {
8
8
  w: number;
9
9
  h: number;
10
10
  };
11
+ export declare function combinedBoundingBox(boxes: [Box, ...Box[]]): Box;
11
12
  export declare function combinedBoundingBox(boxes: Box[]): Box | undefined;
12
13
  export declare function padBox(box: Box, padding: number): Box;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.140",
3
+ "version": "0.0.141",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",