lucid-extension-sdk 0.0.421 → 0.0.423

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.
@@ -12,7 +12,16 @@ import { SerializedFieldType, SerializedLucidDictionary, isSerializedFieldType }
12
12
  export interface ExtensionCardFieldOption {
13
13
  label: string;
14
14
  value: SerializedFieldType;
15
+ /**
16
+ * URL used for displaying the icon in dropdowns and on the card.
17
+ */
15
18
  iconUrl?: string | undefined;
19
+ /**
20
+ * Optional override for iconUrl used when saving an icon's URL to a collection. Use when the URL to save differs
21
+ * from the URL to display (e.g., when using an image proxy), or to avoid processing the URL (e.g., to skip URL
22
+ * decoding).
23
+ */
24
+ iconUrlForCollection?: string | undefined;
16
25
  }
17
26
  export interface ExtensionCardFieldDefinition extends FieldDefinition {
18
27
  /** The label to display in the UI */
@@ -71,6 +80,7 @@ export type SerializedCardFieldOption = {
71
80
  'l': string;
72
81
  'v'?: SerializedFieldType;
73
82
  'i'?: string | undefined;
83
+ 'ic'?: string | undefined;
74
84
  };
75
85
  /** @ignore */
76
86
  export declare function serializeCardFieldOption(option: ExtensionCardFieldOption): SerializedCardFieldOption;
@@ -27,11 +27,7 @@ exports.isSerializedCardUserData = (0, validators_1.objectValidator)({
27
27
  exports.isSerializedCardUserDataArray = (0, validators_1.arrayValidator)(exports.isSerializedCardUserData);
28
28
  /** @ignore */
29
29
  function serializeCardFieldOption(option) {
30
- return {
31
- 'l': option.label,
32
- 'v': option.value,
33
- 'i': option.iconUrl,
34
- };
30
+ return Object.assign({ 'l': option.label, 'v': option.value, 'i': option.iconUrl }, ((0, checks_1.isDefAndNotNull)(option.iconUrlForCollection) && { 'ic': option.iconUrlForCollection }));
35
31
  }
36
32
  exports.serializeCardFieldOption = serializeCardFieldOption;
37
33
  /** @ignore */
@@ -47,11 +43,7 @@ function serializeCardFieldArrayDefinition(fields) {
47
43
  exports.serializeCardFieldArrayDefinition = serializeCardFieldArrayDefinition;
48
44
  /** @ignore */
49
45
  function deserializeFieldOption(option) {
50
- return {
51
- label: option['l'],
52
- value: option['v'],
53
- iconUrl: option['i'],
54
- };
46
+ return Object.assign({ label: option['l'], value: option['v'], iconUrl: option['i'] }, ((0, checks_1.isDefAndNotNull)(option['ic']) && { iconUrlForCollection: option['ic'] }));
55
47
  }
56
48
  exports.deserializeFieldOption = deserializeFieldOption;
57
49
  exports.isSerializedFieldOption = (0, validators_1.objectValidator)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.421",
3
+ "version": "0.0.423",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",