@satorijs/adapter-lark 3.11.2 → 3.11.4
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 +33 -3
- package/package.json +1 -1
- package/src/message.ts +30 -0
package/lib/index.cjs
CHANGED
|
@@ -993,6 +993,7 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
993
993
|
tag: "checker",
|
|
994
994
|
name: (attrs.argument ? "@@" : attrs.option ? `@${attrs.option}=` : "") + attrs.name,
|
|
995
995
|
checked: attrs.value,
|
|
996
|
+
disabled: attrs.disabled,
|
|
996
997
|
text: {
|
|
997
998
|
tag: "plain_text",
|
|
998
999
|
content: this.textContent
|
|
@@ -1005,6 +1006,7 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1005
1006
|
this.elements.push({
|
|
1006
1007
|
tag: "button",
|
|
1007
1008
|
name: attrs.name,
|
|
1009
|
+
width: attrs.width,
|
|
1008
1010
|
text: {
|
|
1009
1011
|
tag: "plain_text",
|
|
1010
1012
|
content: this.textContent
|
|
@@ -1078,7 +1080,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1078
1080
|
width: attrs["lark:width"],
|
|
1079
1081
|
icon: attrs["lark:icon"] && {
|
|
1080
1082
|
tag: "standard_icon",
|
|
1081
|
-
token: attrs["lark:icon"]
|
|
1083
|
+
token: attrs["lark:icon"],
|
|
1084
|
+
color: attrs["lark:icon-color"]
|
|
1082
1085
|
},
|
|
1083
1086
|
hover_tips: attrs["lark:hover-tips"] && {
|
|
1084
1087
|
tag: "plain_text",
|
|
@@ -1102,7 +1105,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1102
1105
|
margin: attrs.margin,
|
|
1103
1106
|
icon: attrs.icon && {
|
|
1104
1107
|
tag: "standard_icon",
|
|
1105
|
-
token: attrs.icon
|
|
1108
|
+
token: attrs.icon,
|
|
1109
|
+
color: attrs.iconColor
|
|
1106
1110
|
}
|
|
1107
1111
|
});
|
|
1108
1112
|
this.textContent = "";
|
|
@@ -1140,7 +1144,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1140
1144
|
template: attrs.color,
|
|
1141
1145
|
icon: attrs.icon && {
|
|
1142
1146
|
tag: "standard_icon",
|
|
1143
|
-
token: attrs.icon
|
|
1147
|
+
token: attrs.icon,
|
|
1148
|
+
color: attrs.iconColor
|
|
1144
1149
|
},
|
|
1145
1150
|
title: {
|
|
1146
1151
|
tag: "plain_text",
|
|
@@ -1156,6 +1161,31 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1156
1161
|
}
|
|
1157
1162
|
};
|
|
1158
1163
|
await this.render(children, true);
|
|
1164
|
+
} else if (tag === "interactive-container") {
|
|
1165
|
+
this.flushText();
|
|
1166
|
+
const parent = this.elements;
|
|
1167
|
+
parent.push({
|
|
1168
|
+
tag: "interactive_container",
|
|
1169
|
+
disabled: attrs.disabled,
|
|
1170
|
+
width: attrs.width,
|
|
1171
|
+
height: attrs.height,
|
|
1172
|
+
margin: attrs.margin,
|
|
1173
|
+
padding: attrs.padding,
|
|
1174
|
+
background_style: attrs.backgroundStyle,
|
|
1175
|
+
vertical_align: attrs.verticalAlign,
|
|
1176
|
+
vertical_spacing: attrs.verticalSpacing,
|
|
1177
|
+
horizontal_align: attrs.horizontalAlign,
|
|
1178
|
+
horizontal_spacing: attrs.horizontalSpacing,
|
|
1179
|
+
direction: attrs.direction,
|
|
1180
|
+
has_border: attrs.hasBorder,
|
|
1181
|
+
border_color: attrs.borderColor,
|
|
1182
|
+
corner_radius: attrs.cornerRadius,
|
|
1183
|
+
elements: this.elements = [],
|
|
1184
|
+
behaviors: this.createBehaviors(attrs)
|
|
1185
|
+
});
|
|
1186
|
+
await this.render(children);
|
|
1187
|
+
this.flushText();
|
|
1188
|
+
this.elements = parent;
|
|
1159
1189
|
} else if (tag === "column-set") {
|
|
1160
1190
|
this.flushText();
|
|
1161
1191
|
const columns = [];
|
package/package.json
CHANGED
package/src/message.ts
CHANGED
|
@@ -257,6 +257,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
257
257
|
tag: 'checker',
|
|
258
258
|
name: (attrs.argument ? '@@' : attrs.option ? `@${attrs.option}=` : '') + attrs.name,
|
|
259
259
|
checked: attrs.value,
|
|
260
|
+
disabled: attrs.disabled,
|
|
260
261
|
text: {
|
|
261
262
|
tag: 'plain_text',
|
|
262
263
|
content: this.textContent,
|
|
@@ -269,6 +270,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
269
270
|
this.elements.push({
|
|
270
271
|
tag: 'button',
|
|
271
272
|
name: attrs.name,
|
|
273
|
+
width: attrs.width,
|
|
272
274
|
text: {
|
|
273
275
|
tag: 'plain_text',
|
|
274
276
|
content: this.textContent,
|
|
@@ -343,6 +345,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
343
345
|
icon: attrs['lark:icon'] && {
|
|
344
346
|
tag: 'standard_icon',
|
|
345
347
|
token: attrs['lark:icon'],
|
|
348
|
+
color: attrs['lark:icon-color'],
|
|
346
349
|
},
|
|
347
350
|
hover_tips: attrs['lark:hover-tips'] && {
|
|
348
351
|
tag: 'plain_text',
|
|
@@ -367,6 +370,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
367
370
|
icon: attrs.icon && {
|
|
368
371
|
tag: 'standard_icon',
|
|
369
372
|
token: attrs.icon,
|
|
373
|
+
color: attrs.iconColor,
|
|
370
374
|
},
|
|
371
375
|
})
|
|
372
376
|
this.textContent = ''
|
|
@@ -405,6 +409,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
405
409
|
icon: attrs.icon && {
|
|
406
410
|
tag: 'standard_icon',
|
|
407
411
|
token: attrs.icon,
|
|
412
|
+
color: attrs.iconColor,
|
|
408
413
|
},
|
|
409
414
|
title: {
|
|
410
415
|
tag: 'plain_text',
|
|
@@ -420,6 +425,31 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
420
425
|
},
|
|
421
426
|
}
|
|
422
427
|
await this.render(children, true)
|
|
428
|
+
} else if (tag === 'interactive-container') {
|
|
429
|
+
this.flushText()
|
|
430
|
+
const parent = this.elements
|
|
431
|
+
parent.push({
|
|
432
|
+
tag: 'interactive_container',
|
|
433
|
+
disabled: attrs.disabled,
|
|
434
|
+
width: attrs.width,
|
|
435
|
+
height: attrs.height,
|
|
436
|
+
margin: attrs.margin,
|
|
437
|
+
padding: attrs.padding,
|
|
438
|
+
background_style: attrs.backgroundStyle,
|
|
439
|
+
vertical_align: attrs.verticalAlign,
|
|
440
|
+
vertical_spacing: attrs.verticalSpacing,
|
|
441
|
+
horizontal_align: attrs.horizontalAlign,
|
|
442
|
+
horizontal_spacing: attrs.horizontalSpacing,
|
|
443
|
+
direction: attrs.direction,
|
|
444
|
+
has_border: attrs.hasBorder,
|
|
445
|
+
border_color: attrs.borderColor,
|
|
446
|
+
corner_radius: attrs.cornerRadius,
|
|
447
|
+
elements: this.elements = [],
|
|
448
|
+
behaviors: this.createBehaviors(attrs),
|
|
449
|
+
})
|
|
450
|
+
await this.render(children)
|
|
451
|
+
this.flushText()
|
|
452
|
+
this.elements = parent
|
|
423
453
|
} else if (tag === 'column-set') {
|
|
424
454
|
this.flushText()
|
|
425
455
|
const columns: MessageContent.Card.ColumnElement[] = []
|