lucid-extension-sdk 0.0.452 → 0.0.454

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
@@ -1222,6 +1222,13 @@ export type CreateBlockQuery = {
1222
1222
  'c': string;
1223
1223
  /** If specified, the stencil for a custom shape. Only valid if the class name is 'CustomBlock' */
1224
1224
  's'?: UnsafeJsonSerializableOrUndefined | undefined;
1225
+ /** If specified, the initial bounding box for the block, set during creation*/
1226
+ 'b'?: {
1227
+ x: number;
1228
+ y: number;
1229
+ w: number;
1230
+ h: number;
1231
+ } | undefined;
1225
1232
  };
1226
1233
  export type CreateBlockResult = string;
1227
1234
  export type CreateCardsQuery = {
package/core/checks.d.ts CHANGED
@@ -154,8 +154,8 @@ export declare function isEmptyOrNullishObject(val: unknown): val is {};
154
154
  /**
155
155
  * @deprecated Prefer isUnknown
156
156
  */
157
- export declare function isAny(val: unknown): val is any;
158
- export declare function isUnknown(val: unknown): val is unknown;
157
+ export declare function isAny(_val: unknown): _val is any;
158
+ export declare function isUnknown(_val: unknown): _val is unknown;
159
159
  export declare function isPromise(val: unknown): val is Promise<unknown>;
160
160
  export declare function isLiteral<T extends string | number | symbol | boolean>(t: T): (x: unknown) => x is T;
161
161
  type AbstractConstructor<T> = Function & {
package/core/checks.js CHANGED
@@ -237,10 +237,10 @@ function isEmptyOrNullishObject(val) {
237
237
  /**
238
238
  * @deprecated Prefer isUnknown
239
239
  */
240
- function isAny(val) {
240
+ function isAny(_val) {
241
241
  return true;
242
242
  }
243
- function isUnknown(val) {
243
+ function isUnknown(_val) {
244
244
  return true;
245
245
  }
246
246
  function isPromise(val) {
@@ -98,7 +98,7 @@ function makePrimaryCollectionSchema(rawSchemaFields, data, schemaFromData) {
98
98
  }
99
99
  function getPrimaryKeysForData(oldToNewFields, data, schemaFromData) {
100
100
  if (!schemaFromData || schemaFromData.primaryKey.length === 0) {
101
- return data.map((row, index) => `${index + 1}`);
101
+ return data.map((_row, index) => `${index + 1}`);
102
102
  }
103
103
  const primaryKey = schemaFromData.primaryKey;
104
104
  const primaryKeyInNewFields = primaryKey.map((oldField) => { var _a; return (_a = oldToNewFields.get(oldField)) !== null && _a !== void 0 ? _a : oldField; });
@@ -12,6 +12,7 @@ export interface SerializedReferenceKey {
12
12
  'pd': TypedSerializedFlattenedReference;
13
13
  'md'?: SerializedFields | undefined;
14
14
  'e'?: string | undefined;
15
+ 'pm'?: boolean | undefined;
15
16
  } | undefined;
16
17
  }
17
18
  export type TypedSerializedFlattenedReference = {
@@ -37,7 +37,7 @@ export declare const NumberLikeFormat: Format<number | `${number}`, number>;
37
37
  * A format that coerces numbers to be valid for the expected scala type in toJson
38
38
  */
39
39
  declare class StrictNumberFormat extends Format<number, number> {
40
- constructor(requireInteger: boolean, max: number, min: number, scalaType: string);
40
+ constructor(requireInteger: boolean, max: number, min: number, _scalaType: string);
41
41
  }
42
42
  export declare const ByteFormat: StrictNumberFormat;
43
43
  export declare const CharFormat: StrictNumberFormat;
@@ -56,7 +56,7 @@ exports.NumberLikeFormat = new format_1.Format(Number, identity_1.identity, (val
56
56
  * A format that coerces numbers to be valid for the expected scala type in toJson
57
57
  */
58
58
  class StrictNumberFormat extends format_1.Format {
59
- constructor(requireInteger, max, min, scalaType) {
59
+ constructor(requireInteger, max, min, _scalaType) {
60
60
  const round = requireInteger ? Math.round : (x) => x;
61
61
  super((x) => x, (x) => {
62
62
  // coerce the number to the expected type
@@ -8,4 +8,4 @@
8
8
  * @return The first argument passed in, or undefined if nothing was passed.
9
9
  * @template T
10
10
  */
11
- export declare const identity: <T>(opt_returnValue?: T, ...var_args: any[]) => T;
11
+ export declare const identity: <T>(opt_returnValue?: T, ..._var_args: any[]) => T;
package/core/identity.js CHANGED
@@ -11,7 +11,7 @@ exports.identity = void 0;
11
11
  * @return The first argument passed in, or undefined if nothing was passed.
12
12
  * @template T
13
13
  */
14
- const identity = function (opt_returnValue, ...var_args) {
14
+ const identity = function (opt_returnValue, ..._var_args) {
15
15
  // This non-null assertion is needed to maintain the behavior inherited from the closure library implementation
16
16
  // (specifically, the fact that library has a JS implementation which means we don't quite have the same types to
17
17
  // line up).
@@ -55,7 +55,7 @@ function objectOfPruner(subPruner) {
55
55
  return data;
56
56
  }
57
57
  const dataToBePruned = Object.assign({}, data);
58
- Object.entries(dataToBePruned).forEach(([key, value]) => {
58
+ Object.keys(dataToBePruned).forEach((key) => {
59
59
  dataToBePruned[key] = subPruner(dataToBePruned[key], invalidFields, level + 1, key);
60
60
  });
61
61
  return dataToBePruned;
@@ -129,7 +129,7 @@ function getArrayValidatorAndPruner(arrayElementConfig) {
129
129
  * @param keyConfig Validator (and optional pruner) for each object's key.
130
130
  * @returns A ValidatorWithPruner for a Record<K, T>.
131
131
  */
132
- function getObjectOfValidatorAndPruner(valueConfig, keyValidator = (key) => true) {
132
+ function getObjectOfValidatorAndPruner(valueConfig, keyValidator = (_key) => true) {
133
133
  const valueValidator = getValidatorFromConfig(valueConfig);
134
134
  const valuePruner = getPrunerFromConfig(valueConfig);
135
135
  const objectOfValidator = (subject) => {
@@ -172,7 +172,7 @@ function someValidator(...validators) {
172
172
  */
173
173
  function mapValidator(subValidator) {
174
174
  return (x) => {
175
- return (0, checks_1.isObject)(x) && !(0, checks_1.isArray)(x) && Object.entries(x).every(([key, value]) => subValidator(value));
175
+ return (0, checks_1.isObject)(x) && !(0, checks_1.isArray)(x) && Object.values(x).every((value) => subValidator(value));
176
176
  };
177
177
  }
178
178
  /**
@@ -269,7 +269,7 @@ function recordValidator(keyList, valueValidator) {
269
269
  return ((0, checks_1.isObject)(x) &&
270
270
  !(0, checks_1.isArray)(x) &&
271
271
  keyList.every((k) => k in x) &&
272
- Object.entries(x).every(([key, val]) => {
272
+ Object.values(x).every((val) => {
273
273
  return valueValidator(val);
274
274
  }));
275
275
  };
@@ -287,7 +287,7 @@ function typedRecordValidator(keyValidator, valueValidator) {
287
287
  * @param valueValidator The validator to be used on the object fields
288
288
  * @param keyValidator Optional validator to be used on the object keys. If not provided, all key types are validated.
289
289
  */
290
- function objectOfValidator(valueValidator, keyValidator = (key) => true) {
290
+ function objectOfValidator(valueValidator, keyValidator = (_key) => true) {
291
291
  return (x) => {
292
292
  if ((0, checks_1.isArray)(x) || !(0, checks_1.isObject)(x)) {
293
293
  return false;
@@ -303,7 +303,7 @@ function objectOfValidator(valueValidator, keyValidator = (key) => true) {
303
303
  * @param valueValidator The validator to be used on the object fields
304
304
  * @param keyValidator Optional validator to be used on the object keys. If not provided, keys are not validated and asserted to be strings.
305
305
  */
306
- function objectOfValidatorWithInvalidFieldTracking(valueValidator, keyValidator = (key) => true) {
306
+ function objectOfValidatorWithInvalidFieldTracking(valueValidator, keyValidator = (_key) => true) {
307
307
  return (subject, invalidFields, level = 0) => {
308
308
  var _a;
309
309
  if ((0, checks_1.isArray)(subject) || !(0, checks_1.isObjectUnsafe)(subject)) {
@@ -424,7 +424,7 @@ function propertyValidator(subValidator, preSaveActions) {
424
424
  * @return A validator for the map
425
425
  */
426
426
  function isSet(x) {
427
- return (0, checks_1.isObject)(x) && !(0, checks_1.isArray)(x) && Object.entries(x).every(([key, value]) => (0, checks_1.isBoolean)(value) && !!value);
427
+ return (0, checks_1.isObject)(x) && !(0, checks_1.isArray)(x) && Object.values(x).every((value) => (0, checks_1.isBoolean)(value) && !!value);
428
428
  }
429
429
  /**
430
430
  * This validator validates that value is either number or empty string
@@ -40,7 +40,7 @@ class PatchCollectionProxy {
40
40
  //patch collection, but at this time we're not sure we want to expose metadata collections
41
41
  //to the extension API, so this somewhat less-performance-optimal solution seems like the
42
42
  //best overall answer.
43
- return this.patchCollection.items.filter((item, primaryKey) => !this.originalCollection.items.get(primaryKey).exists());
43
+ return this.patchCollection.items.filter((_item, primaryKey) => !this.originalCollection.items.get(primaryKey).exists());
44
44
  }
45
45
  /**
46
46
  * @returns all data items that were deleted from this collection locally, but that
@@ -48,7 +48,7 @@ class PatchCollectionProxy {
48
48
  */
49
49
  getDeletedItems() {
50
50
  //See comment in getAddedItems
51
- return this.originalCollection.items.filter((item, primaryKey) => !this.branchedCollection.items.get(primaryKey).exists());
51
+ return this.originalCollection.items.filter((_item, primaryKey) => !this.branchedCollection.items.get(primaryKey).exists());
52
52
  }
53
53
  /**
54
54
  * @returns all data items that have been changed locally, but that have not
@@ -48,8 +48,7 @@ export declare class MockDataConnectorClient extends DataConnectorClient {
48
48
  /** set properties on this to modify how data source updates are mocked */
49
49
  readonly dataSourceClient: MockDataSourceClient;
50
50
  constructor();
51
- /** @ignore */
52
- getDataSourceClient(updateToken: string): DataSourceClient;
51
+ getDataSourceClient(): DataSourceClient;
53
52
  /** Mocked version just always returns successful */
54
53
  getSignatureValidator(): Promise<SignatureValidator>;
55
54
  /** Mocked version returns an empty string */
@@ -97,8 +97,7 @@ class MockDataConnectorClient extends DataConnectorClient {
97
97
  /** set properties on this to modify how data source updates are mocked */
98
98
  this.dataSourceClient = new datasourceclient_1.MockDataSourceClient();
99
99
  }
100
- /** @ignore */
101
- getDataSourceClient(updateToken) {
100
+ getDataSourceClient() {
102
101
  return this.dataSourceClient;
103
102
  }
104
103
  /** Mocked version just always returns successful */
@@ -178,7 +178,7 @@ function schemaOKStatus() {
178
178
  },
179
179
  ];
180
180
  }
181
- const assertIsJustRenamed = () => undefined;
181
+ const assertIsJustRenamed = (_var1) => undefined;
182
182
  assertIsJustRenamed();
183
183
  assertIsJustRenamed();
184
184
  assertIsJustRenamed();
@@ -63,7 +63,7 @@ class SwimLaneBlockProxy extends blockproxy_1.BlockProxy {
63
63
  this.updateTextAreaNames();
64
64
  }
65
65
  getPrimaryLanes() {
66
- return this.getPrimaryLaneSizes().map((size, index) => new SwimLanePrimaryLaneProxy(this, index));
66
+ return this.getPrimaryLaneSizes().map((_size, index) => new SwimLanePrimaryLaneProxy(this, index));
67
67
  }
68
68
  getPrimaryLanesVertical() {
69
69
  return this.properties.get('IsPrimaryLaneVertical');
@@ -17,6 +17,7 @@ export declare const DocumentElementType: {
17
17
  readonly DataReference: "DataReference";
18
18
  readonly OutputField: "OutputField";
19
19
  readonly ShapeStylePreset: "ShapeStylePreset";
20
+ readonly LineStylePreset: "LineStylePreset";
20
21
  readonly ShapeSpecificDefaultProperties: "ShapeSpecificDefaultProperties";
21
22
  readonly TrackedFormulaLocation: "TrackedFormulaLocation";
22
23
  readonly ElementAlias: "ElementAlias";
@@ -28,6 +28,7 @@ exports.DocumentElementType = {
28
28
  DataReference: 'DataReference',
29
29
  OutputField: 'OutputField',
30
30
  ShapeStylePreset: 'ShapeStylePreset',
31
+ LineStylePreset: 'LineStylePreset',
31
32
  ShapeSpecificDefaultProperties: 'ShapeSpecificDefaultProperties',
32
33
  TrackedFormulaLocation: 'TrackedFormulaLocation',
33
34
  ElementAlias: 'ElementAlias',
@@ -121,7 +121,7 @@ class RuleProxy extends documentelementproxy_1.DocumentElementProxy {
121
121
  /** @ignore */
122
122
  static getRuleProperties(definition) {
123
123
  const properties = {
124
- 'EffectOrder': definition.effects.map((effect, index) => index + 1),
124
+ 'EffectOrder': definition.effects.map((_effect, index) => index + 1),
125
125
  'SourceType': 0, //User
126
126
  'Name': definition.name,
127
127
  };
@@ -136,9 +136,9 @@ class PageProxy extends elementproxy_1.ElementProxy {
136
136
  'p': this.id,
137
137
  'c': def.className,
138
138
  's': def.stencil,
139
+ 'b': def.boundingBox,
139
140
  });
140
141
  const block = this.client.getBlockProxy(id);
141
- block.setBoundingBox(def.boundingBox);
142
142
  if (def.properties) {
143
143
  for (const key in def.properties) {
144
144
  block.properties.set(key, def.properties[key]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.452",
3
+ "version": "0.0.454",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/ui/iframeui.d.ts CHANGED
@@ -57,9 +57,9 @@ export declare abstract class IframeUI {
57
57
  sendMessage(data: UnsafeJsonSerializableOrUndefined): Promise<void>;
58
58
  /**
59
59
  * Receives messages sent from the iframe via parent.postMessage(<data>, '*')
60
- * @param message data sent from the iframe
60
+ * @param _message data sent from the iframe
61
61
  */
62
- protected messageFromFrame(message: any): void;
62
+ protected messageFromFrame(_message: any): void;
63
63
  /**
64
64
  * Called when the iframe has been constructed, its srcdoc set, and the window loaded event has fired
65
65
  */
package/ui/iframeui.js CHANGED
@@ -77,9 +77,9 @@ class IframeUI {
77
77
  }
78
78
  /**
79
79
  * Receives messages sent from the iframe via parent.postMessage(<data>, '*')
80
- * @param message data sent from the iframe
80
+ * @param _message data sent from the iframe
81
81
  */
82
- messageFromFrame(message) { }
82
+ messageFromFrame(_message) { }
83
83
  /**
84
84
  * Called when the iframe has been constructed, its srcdoc set, and the window loaded event has fired
85
85
  */
package/ui/menu.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const MenuType: {
8
8
  readonly Main: 1;
9
9
  /** The context menu that appears when the user right-clicks the canvas. */
10
10
  readonly Context: 2;
11
- /** The side dock in Lucidspark and Teamspaces */
11
+ /** The side dock in Lucidspark */
12
12
  readonly ContentDock: 3;
13
13
  };
14
14
  export type MenuType = (typeof MenuType)[keyof typeof MenuType];
@@ -60,7 +60,7 @@ export interface CustomDropdownMenu extends CustomMenuConfig {
60
60
  location?: MenuLocation;
61
61
  }
62
62
  /**
63
- * Data to create a content dock icon in Spark + Teamspaces
63
+ * Data to create a content dock icon in Spark
64
64
  */
65
65
  export interface CustomContentDockMenu extends CustomMenuConfig {
66
66
  /** The icon to display on the menu item.
@@ -148,7 +148,7 @@ export declare class Menu {
148
148
  */
149
149
  addContextMenuItem(item: CustomMenuConfig): void;
150
150
  /**
151
- * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark and Teamspaces (not in Lucidchart).
151
+ * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark (not in Lucidchart).
152
152
  *
153
153
  * The action must be registered with
154
154
  * [EditorClient.registerAction](/extension-sdk/#classes_editorclient-EditorClient_registeraction)
package/ui/menu.js CHANGED
@@ -11,7 +11,7 @@ exports.MenuType = {
11
11
  Main: 1,
12
12
  /** The context menu that appears when the user right-clicks the canvas. */
13
13
  Context: 2,
14
- /** The side dock in Lucidspark and Teamspaces */
14
+ /** The side dock in Lucidspark */
15
15
  ContentDock: 3,
16
16
  };
17
17
  /**
@@ -117,7 +117,7 @@ class Menu {
117
117
  });
118
118
  }
119
119
  /**
120
- * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark and Teamspaces (not in Lucidchart).
120
+ * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark (not in Lucidchart).
121
121
  *
122
122
  * The action must be registered with
123
123
  * [EditorClient.registerAction](/extension-sdk/#classes_editorclient-EditorClient_registeraction)