lucid-extension-sdk 0.0.129 → 0.0.131

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.129",
3
+ "version": "0.0.131",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -54,6 +54,10 @@ export declare enum OnClickHandlerKeys {
54
54
  OpenBrowserWindow = "OpenBrowserWindow"
55
55
  }
56
56
  export declare const isOnClickHandlerKey: (x: unknown) => x is OnClickHandlerKeys;
57
+ export declare type ImageBadgeSettings = {
58
+ height: number;
59
+ width: number;
60
+ };
57
61
  export interface StencilConfig {
58
62
  /**
59
63
  * How should we generate the stencil/data graphic from the specified field value?
@@ -69,6 +73,21 @@ export interface StencilConfig {
69
73
  * by starting the string with "=", e.g. "=darken("#ffffff", 0.5)"
70
74
  */
71
75
  backgroundColor?: string;
76
+ /**
77
+ * For displayType values that support it, you may provide an override for the
78
+ * foreground color for this data. If this is not provided, the foreground color
79
+ * will default to grey.
80
+ *
81
+ * This may be provided as a literal color hex, e.g. "#00ff00ff" or as a formula
82
+ * by starting the string with "=", e.g. "=darken("#ffffff", 0.5)"
83
+ */
84
+ foregroundColor?: string;
85
+ /**
86
+ * For displayType values that support it, you may provide a height and a width
87
+ * for the image size. Images are 24px by 24px by default.
88
+ *
89
+ */
90
+ imageBadgeSettings?: ImageBadgeSettings;
72
91
  /**
73
92
  * If specified, the result of this formula (executed in the context of the data item
74
93
  * associated with this card) will be used instead of the raw field value when
@@ -114,6 +133,7 @@ export declare type SerializedLucidCardFieldDisplaySettings = {
114
133
  'StencilConfig'?: {
115
134
  /** Since renamed to displayType, but we can't change the serialized name */
116
135
  'getterKey': FieldDisplayType;
136
+ 'fg'?: string;
117
137
  'bg'?: string;
118
138
  'f'?: string;
119
139
  't'?: string;
@@ -121,6 +141,7 @@ export declare type SerializedLucidCardFieldDisplaySettings = {
121
141
  'h'?: HorizontalBadgePos;
122
142
  'v'?: VerticalBadgePos;
123
143
  'onClickHandlerKey'?: OnClickHandlerKeys;
144
+ 'imageBadgeSettings'?: ImageBadgeSettings;
124
145
  };
125
146
  };
126
147
  /** @ignore */
@@ -67,10 +67,12 @@ function serializeLucidCardFieldDisplaySettings(settings) {
67
67
  'f': settings.stencilConfig.valueFormula,
68
68
  't': settings.stencilConfig.tooltipFormula,
69
69
  'l': settings.stencilConfig.linkFormula,
70
+ 'fg': settings.stencilConfig.foregroundColor,
70
71
  'bg': settings.stencilConfig.backgroundColor,
71
72
  'h': settings.stencilConfig.horizontalPosition,
72
73
  'v': settings.stencilConfig.verticalPosition,
73
74
  'onClickHandlerKey': settings.stencilConfig.onClickHandlerKey,
75
+ 'imageBadgeSettings': settings.stencilConfig.imageBadgeSettings,
74
76
  },
75
77
  };
76
78
  }
@@ -83,10 +85,12 @@ function deserializeLucidCardFieldDisplaySettings(settings) {
83
85
  valueFormula: settings['StencilConfig']['f'],
84
86
  tooltipFormula: settings['StencilConfig']['t'],
85
87
  linkFormula: settings['StencilConfig']['l'],
88
+ foregroundColor: settings['StencilConfig']['fg'],
86
89
  backgroundColor: settings['StencilConfig']['bg'],
87
90
  horizontalPosition: settings['StencilConfig']['h'],
88
91
  verticalPosition: settings['StencilConfig']['v'],
89
92
  onClickHandlerKey: settings['StencilConfig']['onClickHandlerKey'],
93
+ imageBadgeSettings: settings['StencilConfig']['imageBadgeSettings'],
90
94
  },
91
95
  };
92
96
  }
@@ -27,6 +27,10 @@ export declare class LinkUnfurlBlockProxy extends BlockProxy {
27
27
  * Sets the main thumbnail on the block
28
28
  */
29
29
  setPreviewThumbnailUrl(thumbnailUrl: string): void;
30
+ /**
31
+ * Gets the main thumbnail on the block
32
+ */
33
+ getPreviewThumbnailUrl(): string;
30
34
  /**
31
35
  * Sets additional thumbnails on the block
32
36
  */
@@ -42,6 +42,12 @@ class LinkUnfurlBlockProxy extends blockproxy_1.BlockProxy {
42
42
  setPreviewThumbnailUrl(thumbnailUrl) {
43
43
  this.properties.set('LinkUnfurlThumbnailUrl', thumbnailUrl);
44
44
  }
45
+ /**
46
+ * Gets the main thumbnail on the block
47
+ */
48
+ getPreviewThumbnailUrl() {
49
+ return this.properties.get('LinkUnfurlThumbnailUrl');
50
+ }
45
51
  /**
46
52
  * Sets additional thumbnails on the block
47
53
  */