lucid-extension-sdk 0.0.180 → 0.0.182

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
@@ -1199,6 +1199,10 @@ export type RegisterPanelQuery = {
1199
1199
  'to'?: string;
1200
1200
  /** If true, we will persist the panel's iframe */
1201
1201
  'p'?: boolean;
1202
+ /** Desired panel width */
1203
+ 'w'?: number | undefined;
1204
+ /** Desired panel height */
1205
+ 'h'?: number | undefined;
1202
1206
  };
1203
1207
  export type RegisterPanelResult = undefined;
1204
1208
  export type RegisterUnfurlQuery = {
@@ -103,8 +103,9 @@ export declare class Patch {
103
103
  **/
104
104
  export declare class DataConnectorPatchAction extends DataConnectorAction {
105
105
  /** changes applied by Lucid */ patches: Patch[];
106
+ client: DataSourceClient;
106
107
  constructor(context: DataConnectorActionContext,
107
- /** changes applied by Lucid */ patches: Patch[], name?: string);
108
+ /** changes applied by Lucid */ patches: Patch[], client: DataSourceClient, name?: string);
108
109
  }
109
110
  /**
110
111
  * A description of an existing webhook that Lucid is keeping track of.
@@ -95,9 +95,10 @@ exports.Patch = Patch;
95
95
  **/
96
96
  class DataConnectorPatchAction extends DataConnectorAction {
97
97
  constructor(context,
98
- /** changes applied by Lucid */ patches, name = dataconnectoractionkeys_1.DataConnectorActionKeys.Patch) {
98
+ /** changes applied by Lucid */ patches, client, name = dataconnectoractionkeys_1.DataConnectorActionKeys.Patch) {
99
99
  super(name, context);
100
100
  this.patches = patches;
101
+ this.client = client;
101
102
  }
102
103
  }
103
104
  exports.DataConnectorPatchAction = DataConnectorPatchAction;
@@ -20,7 +20,6 @@ const serializedActionsBaseValidator = (0, validators_1.objectValidator)({
20
20
  });
21
21
  const serializedPatchDataValidator = (0, validators_1.objectValidator)({
22
22
  'packageVersion': checks_1.isString,
23
- 'userCredential': checks_1.isString,
24
23
  'patches': (0, validators_1.arrayValidator)((0, validators_1.objectValidator)({
25
24
  'patch': (0, validators_1.objectValidator)({
26
25
  'itemsAdded': (0, validators_1.objectOfValidator)(checks_1.isObject),
@@ -33,6 +32,8 @@ const serializedPatchDataValidator = (0, validators_1.objectValidator)({
33
32
  }),
34
33
  'id': checks_1.isString,
35
34
  })),
35
+ 'userCredential': checks_1.isString,
36
+ 'documentUpdateToken': checks_1.isString,
36
37
  });
37
38
  const parseSerializedPatches = (patches) => {
38
39
  return patches.map((patch) => {
@@ -61,7 +62,7 @@ function deserializeActions(client, actions) {
61
62
  return data.map((item) => {
62
63
  const context = new action_1.DataConnectorActionContext(actions['packageId'], item['packageVersion'], item['userCredential'], actions['dataConnectorName'], actions['dataConnectorName'], actions['documentCollections'], actions['updateFilterType']);
63
64
  const patches = parseSerializedPatches(item['patches']);
64
- return new action_1.DataConnectorPatchAction(context, patches);
65
+ return new action_1.DataConnectorPatchAction(context, patches, client.getDataSourceClient(item['documentUpdateToken']));
65
66
  });
66
67
  }
67
68
  if (!actions['packageVersion'] || !actions['userCredential']) {
@@ -73,7 +74,7 @@ function deserializeActions(client, actions) {
73
74
  }
74
75
  const context = new action_1.DataConnectorActionContext(actions['packageId'], actions['packageVersion'], actions['userCredential'], actions['dataConnectorName'], actions['dataConnectorName'], actions['documentCollections'], actions['updateFilterType']);
75
76
  return [
76
- new action_1.DataConnectorPatchAction(context, parseSerializedPatches(data['patches']), dataconnectoractionkeys_1.DataConnectorActionKeys.UnbatchedPatch),
77
+ new action_1.DataConnectorPatchAction(context, parseSerializedPatches(data['patches']), client.getDataSourceClient(data['documentUpdateToken']), dataconnectoractionkeys_1.DataConnectorActionKeys.UnbatchedPatch),
77
78
  ];
78
79
  }
79
80
  const context = new action_1.DataConnectorActionContext(actions['packageId'], actions['packageVersion'], actions['userCredential'], actions['dataConnectorName'], actions['dataConnectorName'], actions['documentCollections'], actions['updateFilterType']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.180",
3
+ "version": "0.0.182",
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
  /**