lucid-extension-sdk 0.0.329 → 0.0.331
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 */
|
|
@@ -39,6 +39,10 @@ export declare class LinkUnfurlBlockProxy extends BlockProxy {
|
|
|
39
39
|
* Sets the URL to be loaded in an iframe when the user clicks the "Expand" action on the block.
|
|
40
40
|
*/
|
|
41
41
|
setIframe(unfurlIframe: UnfurlIframe): void;
|
|
42
|
+
/**
|
|
43
|
+
* Clears the iframe set on the block. The "Expand" action will default to the block's thumbnail image.
|
|
44
|
+
*/
|
|
45
|
+
clearIframe(): void;
|
|
42
46
|
/**
|
|
43
47
|
* Returns true if there is an iframe URL already set for this unfurl block
|
|
44
48
|
*/
|
|
@@ -60,6 +60,14 @@ class LinkUnfurlBlockProxy extends blockproxy_1.BlockProxy {
|
|
|
60
60
|
this.properties.set('LinkUnfurlIframeHeight', iframeAttributes.height);
|
|
61
61
|
this.properties.set('LinkUnfurlIframeWidth', iframeAttributes.width);
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Clears the iframe set on the block. The "Expand" action will default to the block's thumbnail image.
|
|
65
|
+
*/
|
|
66
|
+
clearIframe() {
|
|
67
|
+
this.properties.set('LinkUnfurlIframeHtml', undefined);
|
|
68
|
+
this.properties.set('LinkUnfurlIframeHeight', undefined);
|
|
69
|
+
this.properties.set('LinkUnfurlIframeWidth', undefined);
|
|
70
|
+
}
|
|
63
71
|
/**
|
|
64
72
|
* Returns true if there is an iframe URL already set for this unfurl block
|
|
65
73
|
*/
|