@satorijs/adapter-lark 3.11.2 → 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/index.cjs +31 -3
- package/package.json +1 -1
- package/src/message.ts +28 -0
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 = "";
|
|
@@ -1140,7 +1143,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1140
1143
|
template: attrs.color,
|
|
1141
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
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 = ''
|
|
@@ -405,6 +408,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
405
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[] = []
|