lucid-extension-sdk 0.0.403 → 0.0.404

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.
@@ -16,8 +16,19 @@ export declare class PatchChange {
16
16
  creationPermission?: "DataSource" | "Collection" | "Item" | "None" | undefined;
17
17
  private errors;
18
18
  constructor(patchId: string, syncId: string, collections: PatchChangeCollection[], creationPermission?: "DataSource" | "Collection" | "Item" | "None" | undefined);
19
- setError(primaryKey: string, fieldName: string, error: string): void;
19
+ /**
20
+ * @deprecated - use setFieldErrorOrDefaultToTooltip() instead.
21
+ **/
20
22
  setTooltipError(primaryKey: string, error: string, fieldName?: string | undefined): void;
23
+ /**
24
+ * @deprecated - use setFieldErrorOrDefaultToTooltip() instead.
25
+ **/
26
+ setError(primaryKey: string, fieldName: string, error: string): void;
27
+ /**
28
+ * Set the error message for a specific field on a specific item. If fieldName is provided, will have field-specific
29
+ * error resolution. Otherwise, will default to PatchErrorTooltipField.
30
+ **/
31
+ setFieldErrorOrDefaultToTooltip(primaryKey: string, error: string, fieldName?: string | undefined): void;
21
32
  getErrors(): Record<string, Record<string, string>>;
22
33
  }
23
34
  /** Placeholder field name for tool tip errors */
@@ -14,14 +14,27 @@ class PatchChange {
14
14
  this.creationPermission = creationPermission;
15
15
  this.errors = {};
16
16
  }
17
+ /**
18
+ * @deprecated - use setFieldErrorOrDefaultToTooltip() instead.
19
+ **/
20
+ setTooltipError(primaryKey, error, fieldName) {
21
+ this.setFieldErrorOrDefaultToTooltip(primaryKey, error, fieldName);
22
+ }
23
+ /**
24
+ * @deprecated - use setFieldErrorOrDefaultToTooltip() instead.
25
+ **/
17
26
  setError(primaryKey, fieldName, error) {
27
+ this.setFieldErrorOrDefaultToTooltip(primaryKey, error, fieldName);
28
+ }
29
+ /**
30
+ * Set the error message for a specific field on a specific item. If fieldName is provided, will have field-specific
31
+ * error resolution. Otherwise, will default to PatchErrorTooltipField.
32
+ **/
33
+ setFieldErrorOrDefaultToTooltip(primaryKey, error, fieldName) {
18
34
  if (!(primaryKey in this.errors)) {
19
35
  this.errors[primaryKey] = {};
20
36
  }
21
- this.errors[primaryKey][fieldName] = error;
22
- }
23
- setTooltipError(primaryKey, error, fieldName) {
24
- this.setError(primaryKey, fieldName !== null && fieldName !== void 0 ? fieldName : exports.PatchErrorTooltipField, error);
37
+ this.errors[primaryKey][fieldName !== null && fieldName !== void 0 ? fieldName : exports.PatchErrorTooltipField] = error;
25
38
  }
26
39
  getErrors() {
27
40
  return this.errors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.403",
3
+ "version": "0.0.404",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",