alemonjs 2.1.95 → 2.1.96

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.
@@ -2,6 +2,8 @@ import { DataMention, DataText, DataImageURL, DataImageFile, DataButtonRow, Data
2
2
  export declare class FormatButtonGroup {
3
3
  #private;
4
4
  get value(): DataButtonGroup;
5
+ smallButton(): this;
6
+ setOptions(options?: DataButtonGroup['options']): this;
5
7
  absorb(group: FormatButtonGroup): this;
6
8
  addRow(): this;
7
9
  addButton(title: string, data: DataButton['options']['data'], options?: Omit<DataButton['options'], 'data'>): this;
@@ -1,13 +1,26 @@
1
1
  class FormatButtonGroup {
2
2
  #rows = [];
3
3
  #currentRow = null;
4
+ #options;
4
5
  get value() {
5
6
  this.#flush();
6
7
  return {
7
8
  type: 'BT.group',
8
- value: this.#rows
9
+ value: this.#rows,
10
+ ...(this.#options ? { options: this.#options } : {})
9
11
  };
10
12
  }
13
+ smallButton() {
14
+ this.#options = {
15
+ ...this.#options,
16
+ smallButton: true
17
+ };
18
+ return this;
19
+ }
20
+ setOptions(options) {
21
+ this.#options = options;
22
+ return this;
23
+ }
11
24
  #flush() {
12
25
  if (this.#currentRow && this.#currentRow.length > 0) {
13
26
  this.#rows.push({
@@ -17,6 +17,14 @@ export type DataButton = {
17
17
  rawData: {
18
18
  [key: string]: any;
19
19
  };
20
+ modal?: {
21
+ content?: string;
22
+ confirmText?: string;
23
+ cancelText?: string;
24
+ };
25
+ anchor?: number;
26
+ clickLimit?: number;
27
+ atBotShowChannelList?: boolean;
20
28
  };
21
29
  };
22
30
  export type DataButtonRow = {
@@ -26,4 +34,8 @@ export type DataButtonRow = {
26
34
  export type DataButtonGroup = {
27
35
  type: 'ButtonGroup' | 'BT.group';
28
36
  value: DataButtonRow[];
37
+ options?: {
38
+ smallButton?: boolean;
39
+ rawData?: Record<string, any>;
40
+ };
29
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs",
3
- "version": "2.1.95",
3
+ "version": "2.1.96",
4
4
  "description": "bot script",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -87,5 +87,5 @@
87
87
  "type": "git",
88
88
  "url": "https://github.com/lemonade-lab/alemonjs.git"
89
89
  },
90
- "gitHead": "ebea3f64e13a92c671a0ecd8af856c17ca44846d"
90
+ "gitHead": "6c93b0455b8db78ffa1a83becc1c2de19ba544db"
91
91
  }