lucid-extension-sdk 0.0.81 → 0.0.84
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 +8 -0
- package/sdk/commandtypes.js +1 -0
- package/sdk/core/lucidproduct.d.ts +7 -0
- package/sdk/core/lucidproduct.js +11 -0
- package/sdk/editorclient.d.ts +4 -0
- package/sdk/editorclient.js +6 -0
- package/sdk/index.d.ts +1 -0
- package/sdk/index.js +1 -0
- package/sdk/ui/panel.d.ts +5 -1
- package/sdk/ui/panel.js +3 -0
package/package.json
CHANGED
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { SerializedFieldTypeDefinition } from './core/data/fieldtypedefinition/f
|
|
|
2
2
|
import { SerializedReferenceKeyType } from './core/data/referencekeys/serializedreferencekey';
|
|
3
3
|
import { SerializedFieldType } from './core/data/serializedfield/serializedfields';
|
|
4
4
|
import { JsonObject, JsonSerializable } from './core/jsonserializable';
|
|
5
|
+
import { LucidProduct } from './core/lucidproduct';
|
|
5
6
|
import { LinearOffsetType } from './core/offsettype';
|
|
6
7
|
import { SerializedDataError } from './core/serializeddataerror';
|
|
7
8
|
import { ShapeDataInheritance } from './core/shapedatainheritance';
|
|
@@ -50,6 +51,7 @@ export declare const enum CommandName {
|
|
|
50
51
|
GetDataItemField = "gdif",
|
|
51
52
|
GetElementType = "get",
|
|
52
53
|
GetItemPageId = "gip",
|
|
54
|
+
GetProduct = "gpr",
|
|
53
55
|
GetProperty = "gp",
|
|
54
56
|
GetReferenceKey = "grk",
|
|
55
57
|
GetRelativeLinePosition = "grlp",
|
|
@@ -237,6 +239,10 @@ export declare type CommandArgs = {
|
|
|
237
239
|
query: GetItemPageIdQuery;
|
|
238
240
|
result: GetItemPageIdResult;
|
|
239
241
|
};
|
|
242
|
+
[CommandName.GetProduct]: {
|
|
243
|
+
query: GetProductQuery;
|
|
244
|
+
result: GetProductResult;
|
|
245
|
+
};
|
|
240
246
|
[CommandName.GetProperty]: {
|
|
241
247
|
query: GetPropertyQuery;
|
|
242
248
|
result: GetPropertyResult;
|
|
@@ -756,6 +762,8 @@ export declare type GetReferenceKeyQuery = {
|
|
|
756
762
|
'k': number | string;
|
|
757
763
|
};
|
|
758
764
|
export declare type GetReferenceKeyResult = SerializedReferenceKeyType;
|
|
765
|
+
export declare type GetProductQuery = undefined;
|
|
766
|
+
export declare type GetProductResult = LucidProduct;
|
|
759
767
|
export declare type GetPropertyQuery = {
|
|
760
768
|
/** ID of the LucidElement to read a property from, or undefined to read from the LucidDocument */
|
|
761
769
|
'id'?: string | undefined;
|
package/sdk/commandtypes.js
CHANGED
|
@@ -34,6 +34,7 @@ exports.commandTitles = new Map([
|
|
|
34
34
|
["gdif" /* CommandName.GetDataItemField */, 'GetDataItemField'],
|
|
35
35
|
["get" /* CommandName.GetElementType */, 'GetElementType'],
|
|
36
36
|
["gip" /* CommandName.GetItemPageId */, 'GetItemPageId'],
|
|
37
|
+
["gpr" /* CommandName.GetProduct */, 'GetProduct'],
|
|
37
38
|
["gp" /* CommandName.GetProperty */, 'GetProperty'],
|
|
38
39
|
["grk" /* CommandName.GetReferenceKey */, 'GetReferenceKey'],
|
|
39
40
|
["grlp" /* CommandName.GetRelativeLinePosition */, 'GetRelativeLinePosition'],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LucidProduct = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Lucid products supporting the extension API
|
|
6
|
+
*/
|
|
7
|
+
var LucidProduct;
|
|
8
|
+
(function (LucidProduct) {
|
|
9
|
+
LucidProduct["Chart"] = "chart";
|
|
10
|
+
LucidProduct["Spark"] = "spark";
|
|
11
|
+
})(LucidProduct = exports.LucidProduct || (exports.LucidProduct = {}));
|
package/sdk/editorclient.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export declare class EditorClient {
|
|
|
24
24
|
private nextId;
|
|
25
25
|
private readonly callbacks;
|
|
26
26
|
private getUniqueActionName;
|
|
27
|
+
/**
|
|
28
|
+
* Get which Lucid product this editor extension has been loaded in.
|
|
29
|
+
*/
|
|
30
|
+
getProduct(): import(".").LucidProduct;
|
|
27
31
|
/**
|
|
28
32
|
* Unload this extension immediately, removing any custom menu items etc., until the user refreshes the browser tab.
|
|
29
33
|
*/
|
package/sdk/editorclient.js
CHANGED
|
@@ -41,6 +41,12 @@ class EditorClient {
|
|
|
41
41
|
}
|
|
42
42
|
return 'a' + this.nextId;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Get which Lucid product this editor extension has been loaded in.
|
|
46
|
+
*/
|
|
47
|
+
getProduct() {
|
|
48
|
+
return this.sendCommand("gpr" /* CommandName.GetProduct */, undefined);
|
|
49
|
+
}
|
|
44
50
|
/**
|
|
45
51
|
* Unload this extension immediately, removing any custom menu items etc., until the user refreshes the browser tab.
|
|
46
52
|
*/
|
package/sdk/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './core/dataerrortype';
|
|
|
23
23
|
export * from './core/guards';
|
|
24
24
|
export * from './core/iframe/iframeutils';
|
|
25
25
|
export * from './core/jsonserializable';
|
|
26
|
+
export * from './core/lucidproduct';
|
|
26
27
|
export * from './core/object';
|
|
27
28
|
export * from './core/offsettype';
|
|
28
29
|
export * from './core/optionalkey';
|
package/sdk/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __exportStar(require("./core/dataerrortype"), exports);
|
|
|
39
39
|
__exportStar(require("./core/guards"), exports);
|
|
40
40
|
__exportStar(require("./core/iframe/iframeutils"), exports);
|
|
41
41
|
__exportStar(require("./core/jsonserializable"), exports);
|
|
42
|
+
__exportStar(require("./core/lucidproduct"), exports);
|
|
42
43
|
__exportStar(require("./core/object"), exports);
|
|
43
44
|
__exportStar(require("./core/offsettype"), exports);
|
|
44
45
|
__exportStar(require("./core/optionalkey"), exports);
|
package/sdk/ui/panel.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ export declare enum PanelLocation {
|
|
|
7
7
|
/** In Lucidchart, create a sibling to the Contextual Panel */
|
|
8
8
|
RightDock = 1,
|
|
9
9
|
/** In Lucidchart, create a sibling to the shape toolbox */
|
|
10
|
-
ContentDock = 2
|
|
10
|
+
ContentDock = 2,
|
|
11
|
+
/** In Lucidspark, add a new tab to the image search callout component */
|
|
12
|
+
ImageSearchTab = 3
|
|
11
13
|
}
|
|
12
14
|
export interface PanelConfig {
|
|
13
15
|
/** Title to display at the top of the panel */
|
|
@@ -20,6 +22,8 @@ export interface PanelConfig {
|
|
|
20
22
|
visibleAction?: string;
|
|
21
23
|
/** The URL for an icon to represent the panel, preferably base64-encoded. Will be displayed at 24x24 CSS pixels in size. */
|
|
22
24
|
iconUrl: string;
|
|
25
|
+
/** A tool tip to be displayed when hovering over the activation icon. */
|
|
26
|
+
toolTip?: string;
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
29
|
* Extend this class to show a custom panel to the user, whose contents are displayed in a sandboxed
|
package/sdk/ui/panel.js
CHANGED
|
@@ -11,6 +11,8 @@ 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 */
|
|
15
|
+
PanelLocation[PanelLocation["ImageSearchTab"] = 3] = "ImageSearchTab";
|
|
14
16
|
})(PanelLocation = exports.PanelLocation || (exports.PanelLocation = {}));
|
|
15
17
|
/**
|
|
16
18
|
* Extend this class to show a custom panel to the user, whose contents are displayed in a sandboxed
|
|
@@ -34,6 +36,7 @@ class Panel extends iframeui_1.IframeUI {
|
|
|
34
36
|
'c': this.config.content,
|
|
35
37
|
'v': this.config.visibleAction,
|
|
36
38
|
'i': this.config.iconUrl,
|
|
39
|
+
'to': this.config.toolTip,
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
42
|
/**
|