@satorijs/adapter-lark 3.11.7 → 3.11.8
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 +16 -6
- package/package.json +1 -1
- package/src/message.ts +11 -1
package/lib/index.cjs
CHANGED
|
@@ -986,7 +986,10 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
986
986
|
} else if (type === "hr") {
|
|
987
987
|
this.flushText();
|
|
988
988
|
this.richContent.push([{ tag: "hr" }]);
|
|
989
|
-
this.elements.push({
|
|
989
|
+
this.elements.push({
|
|
990
|
+
tag: "hr",
|
|
991
|
+
margin: attrs.margin
|
|
992
|
+
});
|
|
990
993
|
} else if (type === "form") {
|
|
991
994
|
this.flushText();
|
|
992
995
|
const parent = this.elements;
|
|
@@ -1017,7 +1020,9 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1017
1020
|
disabled_tips: attrs.disabledTips && {
|
|
1018
1021
|
tag: "plain_text",
|
|
1019
1022
|
content: attrs.disabledTips
|
|
1020
|
-
}
|
|
1023
|
+
},
|
|
1024
|
+
behaviors: this.createBehaviors(attrs),
|
|
1025
|
+
margin: attrs.margin
|
|
1021
1026
|
});
|
|
1022
1027
|
this.textContent = "";
|
|
1023
1028
|
} else if (attrs.type === "submit") {
|
|
@@ -1032,7 +1037,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1032
1037
|
content: this.textContent
|
|
1033
1038
|
},
|
|
1034
1039
|
form_action_type: "submit",
|
|
1035
|
-
behaviors: this.createBehaviors(attrs)
|
|
1040
|
+
behaviors: this.createBehaviors(attrs),
|
|
1041
|
+
margin: attrs.margin
|
|
1036
1042
|
});
|
|
1037
1043
|
this.textContent = "";
|
|
1038
1044
|
} else {
|
|
@@ -1056,7 +1062,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1056
1062
|
default_value: attrs.value,
|
|
1057
1063
|
disabled: attrs.disabled,
|
|
1058
1064
|
required: attrs.required,
|
|
1059
|
-
behaviors: this.createBehaviors(attrs)
|
|
1065
|
+
behaviors: this.createBehaviors(attrs),
|
|
1066
|
+
margin: attrs.margin
|
|
1060
1067
|
};
|
|
1061
1068
|
this.elements.push(input);
|
|
1062
1069
|
}
|
|
@@ -1074,7 +1081,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1074
1081
|
content: attrs.placeholder
|
|
1075
1082
|
},
|
|
1076
1083
|
options: [],
|
|
1077
|
-
behaviors: this.createBehaviors(attrs)
|
|
1084
|
+
behaviors: this.createBehaviors(attrs),
|
|
1085
|
+
margin: attrs.margin
|
|
1078
1086
|
};
|
|
1079
1087
|
for (const child of children) {
|
|
1080
1088
|
if (child.type !== "option") continue;
|
|
@@ -1115,7 +1123,8 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1115
1123
|
tag: "plain_text",
|
|
1116
1124
|
content: attrs.disabledTips
|
|
1117
1125
|
},
|
|
1118
|
-
behaviors: this.createBehaviors(attrs)
|
|
1126
|
+
behaviors: this.createBehaviors(attrs),
|
|
1127
|
+
margin: attrs.margin
|
|
1119
1128
|
});
|
|
1120
1129
|
this.textContent = "";
|
|
1121
1130
|
} else if (type === "div") {
|
|
@@ -1259,6 +1268,7 @@ var LarkMessageEncoder = class extends import_core3.MessageEncoder {
|
|
|
1259
1268
|
tag: "column",
|
|
1260
1269
|
width: child.attrs.width,
|
|
1261
1270
|
weight: child.attrs.weight,
|
|
1271
|
+
margin: child.attrs.margin,
|
|
1262
1272
|
padding: child.attrs.padding,
|
|
1263
1273
|
vertical_align: child.attrs.verticalAlign ?? "center",
|
|
1264
1274
|
vertical_spacing: child.attrs.verticalSpacing ?? "0px",
|
package/package.json
CHANGED
package/src/message.ts
CHANGED
|
@@ -250,7 +250,10 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
250
250
|
} else if (type === 'hr') {
|
|
251
251
|
this.flushText()
|
|
252
252
|
this.richContent.push([{ tag: 'hr' }])
|
|
253
|
-
this.elements.push({
|
|
253
|
+
this.elements.push({
|
|
254
|
+
tag: 'hr',
|
|
255
|
+
margin: attrs.margin,
|
|
256
|
+
})
|
|
254
257
|
} else if (type === 'form') {
|
|
255
258
|
this.flushText()
|
|
256
259
|
const parent = this.elements
|
|
@@ -282,6 +285,8 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
282
285
|
tag: 'plain_text',
|
|
283
286
|
content: attrs.disabledTips,
|
|
284
287
|
},
|
|
288
|
+
behaviors: this.createBehaviors(attrs),
|
|
289
|
+
margin: attrs.margin,
|
|
285
290
|
})
|
|
286
291
|
this.textContent = ''
|
|
287
292
|
} else if (attrs.type === 'submit') {
|
|
@@ -297,6 +302,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
297
302
|
},
|
|
298
303
|
form_action_type: 'submit',
|
|
299
304
|
behaviors: this.createBehaviors(attrs),
|
|
305
|
+
margin: attrs.margin,
|
|
300
306
|
})
|
|
301
307
|
this.textContent = ''
|
|
302
308
|
} else {
|
|
@@ -321,6 +327,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
321
327
|
disabled: attrs.disabled,
|
|
322
328
|
required: attrs.required,
|
|
323
329
|
behaviors: this.createBehaviors(attrs),
|
|
330
|
+
margin: attrs.margin,
|
|
324
331
|
}
|
|
325
332
|
this.elements.push(input)
|
|
326
333
|
}
|
|
@@ -339,6 +346,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
339
346
|
},
|
|
340
347
|
options: [],
|
|
341
348
|
behaviors: this.createBehaviors(attrs),
|
|
349
|
+
margin: attrs.margin,
|
|
342
350
|
}
|
|
343
351
|
for (const child of children) {
|
|
344
352
|
if (child.type !== 'option') continue
|
|
@@ -380,6 +388,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
380
388
|
content: attrs.disabledTips,
|
|
381
389
|
},
|
|
382
390
|
behaviors: this.createBehaviors(attrs),
|
|
391
|
+
margin: attrs.margin,
|
|
383
392
|
})
|
|
384
393
|
this.textContent = ''
|
|
385
394
|
} else if (type === 'div') {
|
|
@@ -524,6 +533,7 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
|
|
|
524
533
|
tag: 'column',
|
|
525
534
|
width: child.attrs.width,
|
|
526
535
|
weight: child.attrs.weight,
|
|
536
|
+
margin: child.attrs.margin,
|
|
527
537
|
padding: child.attrs.padding,
|
|
528
538
|
vertical_align: child.attrs.verticalAlign ?? 'center',
|
|
529
539
|
vertical_spacing: child.attrs.verticalSpacing ?? '0px',
|