@satorijs/adapter-lark 3.11.1 → 3.11.3

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/lib/content.d.ts CHANGED
@@ -159,8 +159,7 @@ export declare namespace MessageContent {
159
159
  title: I18nTextElement;
160
160
  subtitle?: I18nTextElement;
161
161
  template?: Header.Template;
162
- icon?: CustomIconElement;
163
- ud_icon?: StandardIconElement;
162
+ icon?: IconElement;
164
163
  text_tag_list?: TextTagElement[];
165
164
  i18n_text_tag_list?: Record<string, TextTagElement[]>;
166
165
  padding?: string;
package/lib/index.cjs CHANGED
@@ -1005,6 +1005,7 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
1005
1005
  this.elements.push({
1006
1006
  tag: "button",
1007
1007
  name: attrs.name,
1008
+ width: attrs.width,
1008
1009
  text: {
1009
1010
  tag: "plain_text",
1010
1011
  content: this.textContent
@@ -1078,7 +1079,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
1078
1079
  width: attrs["lark:width"],
1079
1080
  icon: attrs["lark:icon"] && {
1080
1081
  tag: "standard_icon",
1081
- token: attrs["lark:icon"]
1082
+ token: attrs["lark:icon"],
1083
+ color: attrs["lark:icon-color"]
1082
1084
  },
1083
1085
  hover_tips: attrs["lark:hover-tips"] && {
1084
1086
  tag: "plain_text",
@@ -1102,7 +1104,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
1102
1104
  margin: attrs.margin,
1103
1105
  icon: attrs.icon && {
1104
1106
  tag: "standard_icon",
1105
- token: attrs.icon
1107
+ token: attrs.icon,
1108
+ color: attrs.iconColor
1106
1109
  }
1107
1110
  });
1108
1111
  this.textContent = "";
@@ -1138,9 +1141,10 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
1138
1141
  schema: "2.0",
1139
1142
  header: attrs.title && {
1140
1143
  template: attrs.color,
1141
- ud_icon: attrs.icon && {
1144
+ icon: attrs.icon && {
1142
1145
  tag: "standard_icon",
1143
- token: attrs.icon
1146
+ token: attrs.icon,
1147
+ color: attrs.iconColor
1144
1148
  },
1145
1149
  title: {
1146
1150
  tag: "plain_text",
@@ -1156,6 +1160,30 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
1156
1160
  }
1157
1161
  };
1158
1162
  await this.render(children, true);
1163
+ } else if (tag === "interactive-container") {
1164
+ this.flushText();
1165
+ const parent = this.elements;
1166
+ parent.push({
1167
+ tag: "interactive_container",
1168
+ width: attrs.width,
1169
+ height: attrs.height,
1170
+ margin: attrs.margin,
1171
+ padding: attrs.padding,
1172
+ background_style: attrs.backgroundStyle,
1173
+ vertical_align: attrs.verticalAlign,
1174
+ vertical_spacing: attrs.verticalSpacing,
1175
+ horizontal_align: attrs.horizontalAlign,
1176
+ horizontal_spacing: attrs.horizontalSpacing,
1177
+ direction: attrs.direction,
1178
+ has_border: attrs.hasBorder,
1179
+ border_color: attrs.borderColor,
1180
+ corner_radius: attrs.cornerRadius,
1181
+ elements: this.elements = [],
1182
+ behaviors: this.createBehaviors(attrs)
1183
+ });
1184
+ await this.render(children);
1185
+ this.flushText();
1186
+ this.elements = parent;
1159
1187
  } else if (tag === "column-set") {
1160
1188
  this.flushText();
1161
1189
  const columns = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@satorijs/adapter-lark",
3
3
  "description": "Lark (飞书) Adapter for Satorijs",
4
- "version": "3.11.1",
4
+ "version": "3.11.3",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
7
7
  "types": "lib/index.d.ts",
package/src/content.ts CHANGED
@@ -202,8 +202,7 @@ export namespace MessageContent {
202
202
  title: I18nTextElement
203
203
  subtitle?: I18nTextElement
204
204
  template?: Header.Template
205
- icon?: CustomIconElement
206
- ud_icon?: StandardIconElement
205
+ icon?: IconElement
207
206
  text_tag_list?: TextTagElement[]
208
207
  i18n_text_tag_list?: Record<string, TextTagElement[]>
209
208
  padding?: string
@@ -410,7 +409,6 @@ export namespace MessageContent {
410
409
  lines?: number
411
410
  drop_invalid_user_id?: string
412
411
  icon?: IconElement
413
- // ud_icon?: StandardIconElement
414
412
  }
415
413
 
416
414
  /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/chart */
package/src/message.ts CHANGED
@@ -269,6 +269,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
269
269
  this.elements.push({
270
270
  tag: 'button',
271
271
  name: attrs.name,
272
+ width: attrs.width,
272
273
  text: {
273
274
  tag: 'plain_text',
274
275
  content: this.textContent,
@@ -343,6 +344,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
343
344
  icon: attrs['lark:icon'] && {
344
345
  tag: 'standard_icon',
345
346
  token: attrs['lark:icon'],
347
+ color: attrs['lark:icon-color'],
346
348
  },
347
349
  hover_tips: attrs['lark:hover-tips'] && {
348
350
  tag: 'plain_text',
@@ -367,6 +369,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
367
369
  icon: attrs.icon && {
368
370
  tag: 'standard_icon',
369
371
  token: attrs.icon,
372
+ color: attrs.iconColor,
370
373
  },
371
374
  })
372
375
  this.textContent = ''
@@ -402,9 +405,10 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
402
405
  schema: '2.0',
403
406
  header: attrs.title && {
404
407
  template: attrs.color,
405
- ud_icon: attrs.icon && {
408
+ icon: attrs.icon && {
406
409
  tag: 'standard_icon',
407
410
  token: attrs.icon,
411
+ color: attrs.iconColor,
408
412
  },
409
413
  title: {
410
414
  tag: 'plain_text',
@@ -420,6 +424,30 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
420
424
  },
421
425
  }
422
426
  await this.render(children, true)
427
+ } else if (tag === 'interactive-container') {
428
+ this.flushText()
429
+ const parent = this.elements
430
+ parent.push({
431
+ tag: 'interactive_container',
432
+ width: attrs.width,
433
+ height: attrs.height,
434
+ margin: attrs.margin,
435
+ padding: attrs.padding,
436
+ background_style: attrs.backgroundStyle,
437
+ vertical_align: attrs.verticalAlign,
438
+ vertical_spacing: attrs.verticalSpacing,
439
+ horizontal_align: attrs.horizontalAlign,
440
+ horizontal_spacing: attrs.horizontalSpacing,
441
+ direction: attrs.direction,
442
+ has_border: attrs.hasBorder,
443
+ border_color: attrs.borderColor,
444
+ corner_radius: attrs.cornerRadius,
445
+ elements: this.elements = [],
446
+ behaviors: this.createBehaviors(attrs),
447
+ })
448
+ await this.render(children)
449
+ this.flushText()
450
+ this.elements = parent
423
451
  } else if (tag === 'column-set') {
424
452
  this.flushText()
425
453
  const columns: MessageContent.Card.ColumnElement[] = []