lucid-extension-sdk 0.0.320 → 0.0.321

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.
@@ -17,5 +17,10 @@ export declare class CustomBlockProxy extends BlockProxy {
17
17
  */
18
18
  static getCustomBlockClass(client: EditorClient, id: string): CustomBlockProxyConstructor | typeof CustomBlockProxy;
19
19
  isFromStencil(library: string, shape: string): boolean;
20
+ getCustomShapeType(): {
21
+ packageId: import("../..").JsonSerializable;
22
+ library: import("../..").JsonSerializable;
23
+ shape: import("../..").JsonSerializable;
24
+ };
20
25
  getStencilTextAreaName(stencilTextAreaName: string): string | undefined;
21
26
  }
@@ -49,6 +49,20 @@ class CustomBlockProxy extends blockproxy_1.BlockProxy {
49
49
  }
50
50
  return false;
51
51
  }
52
+ getCustomShapeType() {
53
+ const stencil = this.properties.get('Stencil');
54
+ if ((0, checks_1.isObjectUnsafe)(stencil)) {
55
+ const sourceStencil = this.client.sendCommand("gp" /* CommandName.GetProperty */, { 'p': 'Stencil-' + stencil['id'] });
56
+ if ((0, checks_1.isObjectUnsafe)(sourceStencil) && (0, checks_1.isObjectUnsafe)(sourceStencil['sourcePackage'])) {
57
+ return {
58
+ packageId: sourceStencil['sourcePackage']['packageId'],
59
+ library: sourceStencil['sourcePackage']['library'],
60
+ shape: sourceStencil['sourcePackage']['shape'],
61
+ };
62
+ }
63
+ }
64
+ throw new Error('Custom shape has no source');
65
+ }
52
66
  getStencilTextAreaName(stencilTextAreaName) {
53
67
  return this.textAreas.keys().find((name) => name.endsWith('_' + stencilTextAreaName));
54
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.320",
3
+ "version": "0.0.321",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",