lucid-extension-sdk 0.0.178 → 0.0.181

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
@@ -6,6 +6,7 @@ import { LucidProduct } from './core/lucidproduct';
6
6
  import { LinearOffsetType } from './core/offsettype';
7
7
  import { SerializedDataError } from './core/serializeddataerror';
8
8
  import { ShapeDataInheritance } from './core/shapedatainheritance';
9
+ import { DocumentAccessPermission } from './document/documentaccesspermission';
9
10
  import { DocumentElementType } from './document/documentelement/documentelementtype';
10
11
  import { SerializedLineTextAreaPositioning } from './document/linetextareapositioning';
11
12
  import { TextStyle } from './document/text/textstyle';
@@ -57,6 +58,7 @@ export declare const enum CommandName {
57
58
  GetCurrentPage = "gcp",
58
59
  GetCustomShape = "gcs",
59
60
  GetDataItemField = "gdif",
61
+ GetDocumentAccessPermission = "gdap",
60
62
  GetDocumentId = "gdid",
61
63
  GetElementType = "get",
62
64
  GetItemPageId = "gip",
@@ -288,6 +290,10 @@ export type CommandArgs = {
288
290
  query: GetDataItemFieldQuery;
289
291
  result: GetDataItemFieldResult;
290
292
  };
293
+ [CommandName.GetDocumentAccessPermission]: {
294
+ query: GetDocumentAccessPermissionQuery;
295
+ result: GetDocumentAccessPermissionResult;
296
+ };
291
297
  [CommandName.GetDocumentId]: {
292
298
  query: GetDocumentIdQuery;
293
299
  result: GetDocumentIdResult;
@@ -962,6 +968,8 @@ export type GetDataItemFieldQuery = {
962
968
  'f': string;
963
969
  };
964
970
  export type GetDataItemFieldResult = SerializedFieldType;
971
+ export type GetDocumentAccessPermissionQuery = void;
972
+ export type GetDocumentAccessPermissionResult = DocumentAccessPermission;
965
973
  export type GetDocumentIdQuery = void;
966
974
  export type GetDocumentIdResult = string;
967
975
  export type GetItemPageIdQuery = string;
@@ -1191,6 +1199,10 @@ export type RegisterPanelQuery = {
1191
1199
  'to'?: string;
1192
1200
  /** If true, we will persist the panel's iframe */
1193
1201
  'p'?: boolean;
1202
+ /** Desired panel width */
1203
+ 'w'?: number | undefined;
1204
+ /** Desired panel height */
1205
+ 'h'?: number | undefined;
1194
1206
  };
1195
1207
  export type RegisterPanelResult = undefined;
1196
1208
  export type RegisterUnfurlQuery = {
package/commandtypes.js CHANGED
@@ -38,6 +38,7 @@ exports.commandTitles = new Map([
38
38
  ["gcp" /* CommandName.GetCurrentPage */, 'GetCurrentPage'],
39
39
  ["gcs" /* CommandName.GetCustomShape */, 'GetCustomShape'],
40
40
  ["gdif" /* CommandName.GetDataItemField */, 'GetDataItemField'],
41
+ ["gdap" /* CommandName.GetDocumentAccessPermission */, 'GetDocumentAccessPermission'],
41
42
  ["gdid" /* CommandName.GetDocumentId */, 'GetDocumentId'],
42
43
  ["get" /* CommandName.GetElementType */, 'GetElementType'],
43
44
  ["gip" /* CommandName.GetItemPageId */, 'GetItemPageId'],
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This enumeration represents the access permission a user can have on a document.
3
+ * Note: Additional values may be added to this enumeration.
4
+ */
5
+ export declare enum DocumentAccessPermission {
6
+ /**
7
+ * Can edit, share, and change access permissions.
8
+ */
9
+ EditAndShare = "editAndShare",
10
+ /**
11
+ * Can edit but can't share, or change access permissions.
12
+ */
13
+ Edit = "edit",
14
+ /**
15
+ * Can comment but can't share, edit, or change access permissions.
16
+ */
17
+ Comment = "comment",
18
+ /**
19
+ * Can view but can't share, edit, comment, or change access permissions.
20
+ */
21
+ View = "view"
22
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentAccessPermission = void 0;
4
+ /**
5
+ * This enumeration represents the access permission a user can have on a document.
6
+ * Note: Additional values may be added to this enumeration.
7
+ */
8
+ var DocumentAccessPermission;
9
+ (function (DocumentAccessPermission) {
10
+ /**
11
+ * Can edit, share, and change access permissions.
12
+ */
13
+ DocumentAccessPermission["EditAndShare"] = "editAndShare";
14
+ /**
15
+ * Can edit but can't share, or change access permissions.
16
+ */
17
+ DocumentAccessPermission["Edit"] = "edit";
18
+ /**
19
+ * Can comment but can't share, edit, or change access permissions.
20
+ */
21
+ DocumentAccessPermission["Comment"] = "comment";
22
+ /**
23
+ * Can view but can't share, edit, comment, or change access permissions.
24
+ */
25
+ DocumentAccessPermission["View"] = "view";
26
+ })(DocumentAccessPermission = exports.DocumentAccessPermission || (exports.DocumentAccessPermission = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.178",
3
+ "version": "0.0.181",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/ui/panel.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare enum PanelLocation {
8
8
  RightDock = 1,
9
9
  /** In Lucidchart, create a sibling to the shape toolbox */
10
10
  ContentDock = 2,
11
- /** In Lucidspark, add a new tab to the image search callout component */
11
+ /** In Lucidchart & Lucidspark, add to the image dock */
12
12
  ImageSearchTab = 3
13
13
  }
14
14
  export type PanelConfig = {
@@ -24,6 +24,10 @@ export type PanelConfig = {
24
24
  toolTip?: string;
25
25
  /** If set true, we will persist the panel's iframe in the background if it's not currently active*/
26
26
  persist?: boolean;
27
+ /** Requested width of the panel, in pixels. Depending on window size & panel location, this may not be honored exactly. */
28
+ width?: number;
29
+ /** Requested height of the panel, in pixels. Depending on window size & panel location, this may not be honored exactly. */
30
+ height?: number;
27
31
  } & ({
28
32
  /** Content to display in the panel's iframe. This is set as the srcdoc on a sandboxed iframe. */
29
33
  content: string;
package/ui/panel.js CHANGED
@@ -11,7 +11,7 @@ var PanelLocation;
11
11
  PanelLocation[PanelLocation["RightDock"] = 1] = "RightDock";
12
12
  /** In Lucidchart, create a sibling to the shape toolbox */
13
13
  PanelLocation[PanelLocation["ContentDock"] = 2] = "ContentDock";
14
- /** In Lucidspark, add a new tab to the image search callout component */
14
+ /** In Lucidchart & Lucidspark, add to the image dock */
15
15
  PanelLocation[PanelLocation["ImageSearchTab"] = 3] = "ImageSearchTab";
16
16
  })(PanelLocation = exports.PanelLocation || (exports.PanelLocation = {}));
17
17
  /**
@@ -39,6 +39,8 @@ class Panel extends iframeui_1.IframeUI {
39
39
  'i': this.config.iconUrl,
40
40
  'to': this.config.toolTip,
41
41
  'p': this.config.persist,
42
+ 'w': this.config.width,
43
+ 'h': this.config.height,
42
44
  });
43
45
  }
44
46
  /**
@@ -1,3 +1,4 @@
1
+ import { DocumentAccessPermission } from '../document/documentaccesspermission';
1
2
  import { EditorClient } from '../editorclient';
2
3
  /**
3
4
  * The UserProxy class gives access to the current user on the current Lucid document.
@@ -6,4 +7,8 @@ export declare class UserProxy {
6
7
  private readonly client;
7
8
  readonly id: string;
8
9
  constructor(client: EditorClient);
10
+ /**
11
+ * @returns the permission the user has on the current document.
12
+ */
13
+ getAccessPermssionOnDocument(): DocumentAccessPermission;
9
14
  }
package/user/userproxy.js CHANGED
@@ -9,5 +9,11 @@ class UserProxy {
9
9
  this.client = client;
10
10
  this.id = this.client.sendCommand("guid" /* CommandName.GetUserId */, undefined);
11
11
  }
12
+ /**
13
+ * @returns the permission the user has on the current document.
14
+ */
15
+ getAccessPermssionOnDocument() {
16
+ return this.client.sendCommand("gdap" /* CommandName.GetDocumentAccessPermission */, undefined);
17
+ }
12
18
  }
13
19
  exports.UserProxy = UserProxy;