lucid-extension-sdk 0.0.329 → 0.0.330

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.
@@ -22,6 +22,13 @@ export interface ExtensionCardFieldDefinition extends FieldDefinition {
22
22
  * or as a Promise).
23
23
  */
24
24
  options?: ExtensionCardFieldOption[] | string | undefined;
25
+ /**
26
+ * If set, when this field is changed, selections for any of the fields in
27
+ * this list will be unset.
28
+ *
29
+ * This is useful if changing this field invalidates the values of other fields.
30
+ */
31
+ unsetFieldsWhenChanged?: string[] | undefined;
25
32
  /**
26
33
  * If specified, an action that takes the search text and input so far, and
27
34
  * returns the list of options that should be displayed. This is useful when
@@ -69,6 +76,7 @@ export type SerializedExtensionCardFieldDefinition = SerializedFieldDefinition &
69
76
  'd'?: string | undefined;
70
77
  'op'?: SerializedCardFieldOption[] | string | undefined;
71
78
  's'?: string | undefined;
79
+ 'u'?: string[] | undefined;
72
80
  };
73
81
  /** @ignore */
74
82
  export declare function serializeCardFieldDefinition(field: ExtensionCardFieldDefinition): SerializedExtensionCardFieldDefinition;
@@ -103,6 +111,7 @@ export declare const isSerializedExtensionCardFieldDefinition: (subject: unknown
103
111
  i: (x: unknown) => x is string | undefined;
104
112
  }>[] | undefined;
105
113
  s: (x: unknown) => x is string | undefined;
114
+ u: (x: unknown) => x is string[] | undefined;
106
115
  }>;
107
116
  /** @ignore */
108
117
  export declare function deserializeCardFieldDefinition(field: SerializedExtensionCardFieldDefinition): ExtensionCardFieldDefinition;
@@ -36,7 +36,7 @@ exports.serializeCardFieldOption = serializeCardFieldOption;
36
36
  /** @ignore */
37
37
  function serializeCardFieldDefinition(field) {
38
38
  var _a;
39
- return Object.assign(Object.assign({}, (0, schemadefinition_1.serializeFieldDefinition)(field)), { 'l': field.label, 'def': field.default, 'd': field.description, 'op': (0, checks_1.isString)(field.options) ? field.options : (_a = field.options) === null || _a === void 0 ? void 0 : _a.map(serializeCardFieldOption), 's': field.search });
39
+ return Object.assign(Object.assign({}, (0, schemadefinition_1.serializeFieldDefinition)(field)), { 'l': field.label, 'def': field.default, 'd': field.description, 'op': (0, checks_1.isString)(field.options) ? field.options : (_a = field.options) === null || _a === void 0 ? void 0 : _a.map(serializeCardFieldOption), 's': field.search, 'u': field.unsetFieldsWhenChanged });
40
40
  }
41
41
  exports.serializeCardFieldDefinition = serializeCardFieldDefinition;
42
42
  /** @ignore */
@@ -69,11 +69,12 @@ exports.isSerializedExtensionCardFieldDefinition = (0, validators_1.objectValida
69
69
  'def': (0, validators_1.option)(serializedfields_1.isSerializedFieldType),
70
70
  'op': (0, validators_1.option)((0, validators_1.either)(checks_1.isString, (0, validators_1.arrayValidator)(exports.isSerializedFieldOption))),
71
71
  's': (0, validators_1.option)(checks_1.isString),
72
+ 'u': (0, validators_1.option)((0, checks_1.isTypedArray)(checks_1.isString)),
72
73
  });
73
74
  /** @ignore */
74
75
  function deserializeCardFieldDefinition(field) {
75
76
  var _a;
76
- return Object.assign(Object.assign({}, (0, schemadefinition_1.parseFieldDefinition)(field)), { label: field['l'], description: field['d'], default: field['def'], options: (0, checks_1.isString)(field['op']) ? field['op'] : (_a = field['op']) === null || _a === void 0 ? void 0 : _a.map(deserializeFieldOption), search: field['s'] });
77
+ return Object.assign(Object.assign({}, (0, schemadefinition_1.parseFieldDefinition)(field)), { label: field['l'], description: field['d'], default: field['def'], options: (0, checks_1.isString)(field['op']) ? field['op'] : (_a = field['op']) === null || _a === void 0 ? void 0 : _a.map(deserializeFieldOption), search: field['s'], unsetFieldsWhenChanged: field['u'] });
77
78
  }
78
79
  exports.deserializeCardFieldDefinition = deserializeCardFieldDefinition;
79
80
  /** @ignore */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.329",
3
+ "version": "0.0.330",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",