lucid-extension-sdk 0.0.83 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -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;
@@ -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,7 @@
1
+ /**
2
+ * Lucid products supporting the extension API
3
+ */
4
+ export declare enum LucidProduct {
5
+ Chart = "chart",
6
+ Spark = "spark"
7
+ }
@@ -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 = {}));
@@ -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
  */
@@ -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);