lucid-extension-sdk 1.2.0 → 1.2.1

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.
@@ -65,7 +65,7 @@ export declare const FieldDisplayType: {
65
65
  readonly CustomTextField: "CustomTextField";
66
66
  /**
67
67
  * @experimental
68
- * Renders the field value as a small 24x24 rounded-square icon aligned inline with
68
+ * Renders the field value as a small 16x16 square icon aligned inline with
69
69
  * one of the card's text rows. Use `inlineRowIndex` on the stencil config to pick which row.
70
70
  */
71
71
  readonly InlineIcon: "InlineIcon";
@@ -131,7 +131,7 @@ export declare const isFieldDisplayType: (x: unknown) => x is {} extends {
131
131
  readonly CustomTextField: "CustomTextField";
132
132
  /**
133
133
  * @experimental
134
- * Renders the field value as a small 24x24 rounded-square icon aligned inline with
134
+ * Renders the field value as a small 16x16 square icon aligned inline with
135
135
  * one of the card's text rows. Use `inlineRowIndex` on the stencil config to pick which row.
136
136
  */
137
137
  readonly InlineIcon: "InlineIcon";
@@ -73,7 +73,7 @@ exports.FieldDisplayType = {
73
73
  CustomTextField: 'CustomTextField',
74
74
  /**
75
75
  * @experimental
76
- * Renders the field value as a small 24x24 rounded-square icon aligned inline with
76
+ * Renders the field value as a small 16x16 square icon aligned inline with
77
77
  * one of the card's text rows. Use `inlineRowIndex` on the stencil config to pick which row.
78
78
  */
79
79
  InlineIcon: 'InlineIcon',
@@ -62,6 +62,11 @@ export interface ExtensionCardFieldDefinition extends FieldDefinition {
62
62
  * This is useful if changing this field invalidates the values of other fields.
63
63
  */
64
64
  unsetFieldsWhenChanged?: string[] | undefined;
65
+ /**
66
+ * When true, every field named in {@link unsetFieldsWhenChanged} renders as disabled while this
67
+ * field's value is empty.
68
+ */
69
+ disableChildrenWhenEmpty?: boolean | undefined;
65
70
  /**
66
71
  * If specified, an action that takes the search text and input so far, and
67
72
  * returns the list of options that should be displayed. This is useful when
@@ -143,6 +148,7 @@ export type SerializedExtensionCardFieldDefinition = SerializedFieldDefinition &
143
148
  'op'?: SerializedCardFieldOption[] | string | undefined;
144
149
  's'?: string | undefined;
145
150
  'u'?: string[] | undefined;
151
+ 'dcwe'?: boolean | undefined;
146
152
  't'?: string | undefined;
147
153
  };
148
154
  /** @ignore */
@@ -194,6 +200,7 @@ export declare const isSerializedExtensionCardFieldDefinition: (subject: unknown
194
200
  }>[]) | undefined;
195
201
  s: (x: unknown) => x is string | undefined;
196
202
  u: (x: unknown) => x is string[] | undefined;
203
+ dcwe: (x: unknown) => x is boolean | undefined;
197
204
  t: (x: unknown) => x is string | undefined;
198
205
  }>;
199
206
  /** @ignore */
@@ -242,6 +249,7 @@ export declare const isSerializedExtensionCardFieldsGroup: (subject: unknown) =>
242
249
  }>[]) | undefined;
243
250
  s: (x: unknown) => x is string | undefined;
244
251
  u: (x: unknown) => x is string[] | undefined;
252
+ dcwe: (x: unknown) => x is boolean | undefined;
245
253
  t: (x: unknown) => x is string | undefined;
246
254
  }>[];
247
255
  }>;
@@ -278,6 +286,7 @@ export declare const isSerializedExtensionCardFieldsGroupArray: (val: unknown) =
278
286
  }>[]) | undefined;
279
287
  s: (x: unknown) => x is string | undefined;
280
288
  u: (x: unknown) => x is string[] | undefined;
289
+ dcwe: (x: unknown) => x is boolean | undefined;
281
290
  t: (x: unknown) => x is string | undefined;
282
291
  }>[];
283
292
  }>[];
@@ -62,7 +62,7 @@ function serializeCardFieldOption(option) {
62
62
  /** @ignore */
63
63
  function serializeCardFieldDefinition(field) {
64
64
  var _a;
65
- 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, 't': field.truncatedLabel });
65
+ 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, 'dcwe': field.disableChildrenWhenEmpty, 't': field.truncatedLabel });
66
66
  }
67
67
  /** @ignore */
68
68
  function serializeCardFieldArrayDefinition(fields) {
@@ -90,12 +90,13 @@ exports.isSerializedExtensionCardFieldDefinition = (0, validators_1.objectValida
90
90
  'op': (0, validators_1.option)((0, validators_1.either)(checks_1.isString, (0, validators_1.arrayValidator)(exports.isSerializedFieldOption))),
91
91
  's': (0, validators_1.option)(checks_1.isString),
92
92
  'u': (0, validators_1.option)((0, checks_1.isTypedArray)(checks_1.isString)),
93
+ 'dcwe': (0, validators_1.option)(checks_1.isBoolean),
93
94
  't': (0, validators_1.option)(checks_1.isString),
94
95
  });
95
96
  /** @ignore */
96
97
  function deserializeCardFieldDefinition(field) {
97
98
  var _a;
98
- 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'], truncatedLabel: field['t'] });
99
+ 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'], disableChildrenWhenEmpty: field['dcwe'], truncatedLabel: field['t'] });
99
100
  }
100
101
  /** @ignore */
101
102
  function deserializeCardFieldArrayDefinition(fields) {
@@ -4,6 +4,9 @@ import { BlockProxy } from '../blockproxy';
4
4
  /**
5
5
  * A generic lucid card block.
6
6
  * This shape has all of the base functionality as a BlockProxy, as well as additional card specific properties.
7
+ *
8
+ * > 📘 A fix for the setter functions on this class was released in `lucid-extension-sdk@1.2.0`. When
9
+ * interacting with `CardBlockProxy`, use version `1.2.0` or later.
7
10
  */
8
11
  export declare class CardBlockProxy extends BlockProxy {
9
12
  static classNameRegex: RegExp;
@@ -7,6 +7,9 @@ const blockproxy_1 = require("../blockproxy");
7
7
  /**
8
8
  * A generic lucid card block.
9
9
  * This shape has all of the base functionality as a BlockProxy, as well as additional card specific properties.
10
+ *
11
+ * > 📘 A fix for the setter functions on this class was released in `lucid-extension-sdk@1.2.0`. When
12
+ * interacting with `CardBlockProxy`, use version `1.2.0` or later.
10
13
  */
11
14
  class CardBlockProxy extends blockproxy_1.BlockProxy {
12
15
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",