lucid-extension-sdk 0.0.453 → 0.0.455

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/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 */
@@ -76,7 +76,7 @@ export declare class ItemsPatchInexhaustive {
76
76
  itemsDeleted?: string[] | undefined;
77
77
  errors?: Map<string, SerializedLucidDictionary> | undefined;
78
78
  fieldConstraintsPerItem?: Map<string, Map<string, FieldConstraintDefinition[]>> | undefined;
79
- private readonly _brand;
79
+ readonly _brand: typeof ItemsPatchInexhaustive;
80
80
  constructor(
81
81
  /**
82
82
  * Items to be added or changed in the collection. Mapping from item serialized primary key to
@@ -93,7 +93,7 @@ export declare class ItemsPatchExhaustive {
93
93
  fieldNamesChanged?: Map<string, string | null> | undefined;
94
94
  errors?: Map<string, SerializedLucidDictionary> | undefined;
95
95
  fieldConstraintsPerItem?: Map<string, Map<string, FieldConstraintDefinition[]>> | undefined;
96
- private readonly _brand;
96
+ readonly _brand: typeof ItemsPatchExhaustive;
97
97
  constructor(items: Map<string, SerializedFields>, rekeyingMap?: Map<string, string | null> | undefined, fieldNamesChanged?: Map<string, string | null> | undefined, errors?: Map<string, SerializedLucidDictionary> | undefined, fieldConstraintsPerItem?: Map<string, Map<string, FieldConstraintDefinition[]>> | undefined);
98
98
  }
99
99
  /** The anonymous type is kept for backward compatibility; use ItemsPatchInexhaustive instead. */
@@ -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',
@@ -5,10 +5,9 @@ import { type ConditionDefinition, type EffectDefinition, type RuleDefinition }
5
5
  import { DocumentElementProxy } from './documentelementproxy';
6
6
  export declare class RuleCondition {
7
7
  readonly rule: RuleProxy;
8
- private readonly client;
9
8
  readonly key: string;
10
9
  private definition;
11
- constructor(rule: RuleProxy, client: EditorClient, key: string);
10
+ constructor(rule: RuleProxy, key: string);
12
11
  /** What kind of condition is this? e.g. a formula evaluation, checking for non-empty text, etc. */
13
12
  readonly type: import("../..").ConditionType;
14
13
  /**
@@ -39,10 +38,9 @@ export declare class RuleCondition {
39
38
  }
40
39
  export declare class RuleEffect {
41
40
  readonly rule: RuleProxy;
42
- private readonly client;
43
41
  readonly key: string;
44
42
  private definition;
45
- constructor(rule: RuleProxy, client: EditorClient, key: string);
43
+ constructor(rule: RuleProxy, key: string);
46
44
  readonly conditions: MapProxy<string, RuleCondition>;
47
45
  /** How multiple conditions are combined (AND vs OR) */
48
46
  readonly combination: import("../..").ConditionCombination;
@@ -7,9 +7,8 @@ const mapproxy_1 = require("../mapproxy");
7
7
  const ruledefinition_1 = require("../ruledefinition");
8
8
  const documentelementproxy_1 = require("./documentelementproxy");
9
9
  class RuleCondition {
10
- constructor(rule, client, key) {
10
+ constructor(rule, key) {
11
11
  this.rule = rule;
12
- this.client = client;
13
12
  this.key = key;
14
13
  this.definition = this.rule.properties.get(this.key);
15
14
  /** What kind of condition is this? e.g. a formula evaluation, checking for non-empty text, etc. */
@@ -46,12 +45,11 @@ class RuleCondition {
46
45
  }
47
46
  exports.RuleCondition = RuleCondition;
48
47
  class RuleEffect {
49
- constructor(rule, client, key) {
48
+ constructor(rule, key) {
50
49
  this.rule = rule;
51
- this.client = client;
52
50
  this.key = key;
53
51
  this.definition = this.rule.properties.get(this.key);
54
- this.conditions = new mapproxy_1.MapProxy(() => this.definition['ConditionOrder'].map((order) => 'Condition_' + order), (key) => new RuleCondition(this.rule, this.client, key));
52
+ this.conditions = new mapproxy_1.MapProxy(() => this.definition['ConditionOrder'].map((order) => 'Condition_' + order), (key) => new RuleCondition(this.rule, key));
55
53
  /** How multiple conditions are combined (AND vs OR) */
56
54
  this.combination = this.definition['Combination'];
57
55
  /** What kind of effect is displayed? Formatting vs. icons vs. dynamic stencil, etc. */
@@ -101,7 +99,7 @@ class RuleProxy extends documentelementproxy_1.DocumentElementProxy {
101
99
  constructor(id, client) {
102
100
  super(id, client);
103
101
  this.id = id;
104
- this.effects = new mapproxy_1.MapProxy(() => this.properties.get('EffectOrder').map((order) => 'Effect_' + order), (key) => new RuleEffect(this, this.client, key));
102
+ this.effects = new mapproxy_1.MapProxy(() => this.properties.get('EffectOrder').map((order) => 'Effect_' + order), (key) => new RuleEffect(this, key));
105
103
  }
106
104
  getName() {
107
105
  return this.properties.get('Name');
@@ -121,7 +119,7 @@ class RuleProxy extends documentelementproxy_1.DocumentElementProxy {
121
119
  /** @ignore */
122
120
  static getRuleProperties(definition) {
123
121
  const properties = {
124
- 'EffectOrder': definition.effects.map((effect, index) => index + 1),
122
+ 'EffectOrder': definition.effects.map((_effect, index) => index + 1),
125
123
  'SourceType': 0, //User
126
124
  'Name': definition.name,
127
125
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.453",
3
+ "version": "0.0.455",
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
  */