@satorijs/adapter-lark 3.11.6 → 3.11.7
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 +3 -3
- package/lib/index.cjs +39 -4
- package/package.json +1 -1
- package/src/content.ts +3 -3
- package/src/message.ts +39 -4
package/lib/content.d.ts
CHANGED
|
@@ -124,11 +124,11 @@ export declare namespace MessageContent {
|
|
|
124
124
|
interface Config {
|
|
125
125
|
streaming_mode?: boolean;
|
|
126
126
|
streaming_config?: StreamingConfig;
|
|
127
|
-
summary
|
|
127
|
+
summary?: {
|
|
128
128
|
content: string;
|
|
129
129
|
i18n_content?: Record<string, string>;
|
|
130
130
|
};
|
|
131
|
-
locales
|
|
131
|
+
locales?: string[];
|
|
132
132
|
enable_forward?: boolean;
|
|
133
133
|
update_multi?: boolean;
|
|
134
134
|
width_mode?: 'compact' | 'fill';
|
|
@@ -542,7 +542,7 @@ export declare namespace MessageContent {
|
|
|
542
542
|
confirm?: ConfirmElement;
|
|
543
543
|
behaviors?: ActionBehavior[];
|
|
544
544
|
hover_tips?: TextElement;
|
|
545
|
-
|
|
545
|
+
disabled_tips?: TextElement;
|
|
546
546
|
}
|
|
547
547
|
namespace CheckerElement {
|
|
548
548
|
interface Text extends Card.TextElement<'plain_text' | 'lark_md'> {
|
package/lib/index.cjs
CHANGED
|
@@ -1009,6 +1009,14 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1009
1009
|
text: {
|
|
1010
1010
|
tag: "lark_md",
|
|
1011
1011
|
content: this.textContent
|
|
1012
|
+
},
|
|
1013
|
+
hover_tips: attrs.hoverTips && {
|
|
1014
|
+
tag: "plain_text",
|
|
1015
|
+
content: attrs.hoverTips
|
|
1016
|
+
},
|
|
1017
|
+
disabled_tips: attrs.disabledTips && {
|
|
1018
|
+
tag: "plain_text",
|
|
1019
|
+
content: attrs.disabledTips
|
|
1012
1020
|
}
|
|
1013
1021
|
});
|
|
1014
1022
|
this.textContent = "";
|
|
@@ -1041,6 +1049,10 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1041
1049
|
tag: "plain_text",
|
|
1042
1050
|
content: attrs.placeholder
|
|
1043
1051
|
},
|
|
1052
|
+
disabled_tips: attrs.disabledTips && {
|
|
1053
|
+
tag: "plain_text",
|
|
1054
|
+
content: attrs.disabledTips
|
|
1055
|
+
},
|
|
1044
1056
|
default_value: attrs.value,
|
|
1045
1057
|
disabled: attrs.disabled,
|
|
1046
1058
|
required: attrs.required,
|
|
@@ -1095,13 +1107,13 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1095
1107
|
token: attrs["lark:icon"],
|
|
1096
1108
|
color: attrs["lark:icon-color"]
|
|
1097
1109
|
},
|
|
1098
|
-
hover_tips: attrs
|
|
1110
|
+
hover_tips: attrs.hoverTips && {
|
|
1099
1111
|
tag: "plain_text",
|
|
1100
|
-
content: attrs
|
|
1112
|
+
content: attrs.hoverTips
|
|
1101
1113
|
},
|
|
1102
|
-
disabled_tips: attrs
|
|
1114
|
+
disabled_tips: attrs.disabledTips && {
|
|
1103
1115
|
tag: "plain_text",
|
|
1104
|
-
content: attrs
|
|
1116
|
+
content: attrs.disabledTips
|
|
1105
1117
|
},
|
|
1106
1118
|
behaviors: this.createBehaviors(attrs)
|
|
1107
1119
|
});
|
|
@@ -1154,6 +1166,15 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1154
1166
|
await this.flush();
|
|
1155
1167
|
this.card = {
|
|
1156
1168
|
schema: "2.0",
|
|
1169
|
+
config: {
|
|
1170
|
+
summary: attrs.summary && {
|
|
1171
|
+
content: attrs.summary
|
|
1172
|
+
},
|
|
1173
|
+
enable_forward: attrs.enableForward,
|
|
1174
|
+
update_multi: attrs.updateMulti,
|
|
1175
|
+
enable_forward_interaction: attrs.enableForwardInteraction,
|
|
1176
|
+
style: typeof attrs.style === "string" ? JSON.parse(attrs.style) : attrs.style
|
|
1177
|
+
},
|
|
1157
1178
|
header: attrs.title && {
|
|
1158
1179
|
template: attrs.color,
|
|
1159
1180
|
icon: attrs.icon && {
|
|
@@ -1171,6 +1192,12 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1171
1192
|
}
|
|
1172
1193
|
},
|
|
1173
1194
|
body: {
|
|
1195
|
+
direction: attrs.direction,
|
|
1196
|
+
padding: attrs.padding,
|
|
1197
|
+
horizontal_spacing: attrs.horizontalSpacing,
|
|
1198
|
+
horizontal_align: attrs.horizontalAlign,
|
|
1199
|
+
vertical_spacing: attrs.verticalSpacing,
|
|
1200
|
+
vertical_align: attrs.verticalAlign,
|
|
1174
1201
|
elements: this.elements = []
|
|
1175
1202
|
}
|
|
1176
1203
|
};
|
|
@@ -1195,6 +1222,14 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1195
1222
|
border_color: attrs.borderColor,
|
|
1196
1223
|
corner_radius: attrs.cornerRadius,
|
|
1197
1224
|
elements: this.elements = [],
|
|
1225
|
+
hover_tips: attrs.hoverTips && {
|
|
1226
|
+
tag: "plain_text",
|
|
1227
|
+
content: attrs.hoverTips
|
|
1228
|
+
},
|
|
1229
|
+
disabled_tips: attrs.disabledTips && {
|
|
1230
|
+
tag: "plain_text",
|
|
1231
|
+
content: attrs.disabledTips
|
|
1232
|
+
},
|
|
1198
1233
|
behaviors: this.createBehaviors(attrs)
|
|
1199
1234
|
});
|
|
1200
1235
|
await this.render(children);
|
package/package.json
CHANGED
package/src/content.ts
CHANGED
|
@@ -164,11 +164,11 @@ export namespace MessageContent {
|
|
|
164
164
|
export interface Config {
|
|
165
165
|
streaming_mode?: boolean
|
|
166
166
|
streaming_config?: StreamingConfig
|
|
167
|
-
summary
|
|
167
|
+
summary?: {
|
|
168
168
|
content: string
|
|
169
169
|
i18n_content?: Record<string, string>
|
|
170
170
|
}
|
|
171
|
-
locales
|
|
171
|
+
locales?: string[]
|
|
172
172
|
enable_forward?: boolean
|
|
173
173
|
update_multi?: boolean
|
|
174
174
|
width_mode?: 'compact' | 'fill'
|
|
@@ -633,7 +633,7 @@ export namespace MessageContent {
|
|
|
633
633
|
confirm?: ConfirmElement
|
|
634
634
|
behaviors?: ActionBehavior[]
|
|
635
635
|
hover_tips?: TextElement
|
|
636
|
-
|
|
636
|
+
disabled_tips?: TextElement
|
|
637
637
|
}
|
|
638
638
|
|
|
639
639
|
export namespace CheckerElement {
|
package/src/message.ts
CHANGED
|
@@ -274,6 +274,14 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
274
274
|
tag: 'lark_md',
|
|
275
275
|
content: this.textContent,
|
|
276
276
|
},
|
|
277
|
+
hover_tips: attrs.hoverTips && {
|
|
278
|
+
tag: 'plain_text',
|
|
279
|
+
content: attrs.hoverTips,
|
|
280
|
+
},
|
|
281
|
+
disabled_tips: attrs.disabledTips && {
|
|
282
|
+
tag: 'plain_text',
|
|
283
|
+
content: attrs.disabledTips,
|
|
284
|
+
},
|
|
277
285
|
})
|
|
278
286
|
this.textContent = ''
|
|
279
287
|
} else if (attrs.type === 'submit') {
|
|
@@ -305,6 +313,10 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
305
313
|
tag: 'plain_text',
|
|
306
314
|
content: attrs.placeholder,
|
|
307
315
|
},
|
|
316
|
+
disabled_tips: attrs.disabledTips && {
|
|
317
|
+
tag: 'plain_text',
|
|
318
|
+
content: attrs.disabledTips,
|
|
319
|
+
},
|
|
308
320
|
default_value: attrs.value,
|
|
309
321
|
disabled: attrs.disabled,
|
|
310
322
|
required: attrs.required,
|
|
@@ -359,13 +371,13 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
359
371
|
token: attrs['lark:icon'],
|
|
360
372
|
color: attrs['lark:icon-color'],
|
|
361
373
|
},
|
|
362
|
-
hover_tips: attrs
|
|
374
|
+
hover_tips: attrs.hoverTips && {
|
|
363
375
|
tag: 'plain_text',
|
|
364
|
-
content: attrs
|
|
376
|
+
content: attrs.hoverTips,
|
|
365
377
|
},
|
|
366
|
-
disabled_tips: attrs
|
|
378
|
+
disabled_tips: attrs.disabledTips && {
|
|
367
379
|
tag: 'plain_text',
|
|
368
|
-
content: attrs
|
|
380
|
+
content: attrs.disabledTips,
|
|
369
381
|
},
|
|
370
382
|
behaviors: this.createBehaviors(attrs),
|
|
371
383
|
})
|
|
@@ -418,6 +430,15 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
418
430
|
await this.flush()
|
|
419
431
|
this.card = {
|
|
420
432
|
schema: '2.0',
|
|
433
|
+
config: {
|
|
434
|
+
summary: attrs.summary && {
|
|
435
|
+
content: attrs.summary,
|
|
436
|
+
},
|
|
437
|
+
enable_forward: attrs.enableForward,
|
|
438
|
+
update_multi: attrs.updateMulti,
|
|
439
|
+
enable_forward_interaction: attrs.enableForwardInteraction,
|
|
440
|
+
style: typeof attrs.style === 'string' ? JSON.parse(attrs.style) : attrs.style,
|
|
441
|
+
},
|
|
421
442
|
header: attrs.title && {
|
|
422
443
|
template: attrs.color,
|
|
423
444
|
icon: attrs.icon && {
|
|
@@ -435,6 +456,12 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
435
456
|
},
|
|
436
457
|
},
|
|
437
458
|
body: {
|
|
459
|
+
direction: attrs.direction,
|
|
460
|
+
padding: attrs.padding,
|
|
461
|
+
horizontal_spacing: attrs.horizontalSpacing,
|
|
462
|
+
horizontal_align: attrs.horizontalAlign,
|
|
463
|
+
vertical_spacing: attrs.verticalSpacing,
|
|
464
|
+
vertical_align: attrs.verticalAlign,
|
|
438
465
|
elements: this.elements = [],
|
|
439
466
|
},
|
|
440
467
|
}
|
|
@@ -459,6 +486,14 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
459
486
|
border_color: attrs.borderColor,
|
|
460
487
|
corner_radius: attrs.cornerRadius,
|
|
461
488
|
elements: this.elements = [],
|
|
489
|
+
hover_tips: attrs.hoverTips && {
|
|
490
|
+
tag: 'plain_text',
|
|
491
|
+
content: attrs.hoverTips,
|
|
492
|
+
},
|
|
493
|
+
disabled_tips: attrs.disabledTips && {
|
|
494
|
+
tag: 'plain_text',
|
|
495
|
+
content: attrs.disabledTips,
|
|
496
|
+
},
|
|
462
497
|
behaviors: this.createBehaviors(attrs),
|
|
463
498
|
})
|
|
464
499
|
await this.render(children)
|