@alemonjs/bubble 2.1.0-alpha.6 → 2.1.0-alpha.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.
Files changed (2) hide show
  1. package/lib/send.js +12 -8
  2. package/package.json +1 -1
package/lib/send.js CHANGED
@@ -102,7 +102,7 @@ const sendToRoom = async (client, param, val) => {
102
102
  contentMd += line.value;
103
103
  }
104
104
  else if (line.type === 'MD.blockquote') {
105
- contentMd += `> ${line.value}\n`;
105
+ contentMd += `\n> ${line.value}\n`;
106
106
  }
107
107
  else if (line.type === 'MD.bold') {
108
108
  contentMd += `**${line.value}**`;
@@ -111,10 +111,10 @@ const sendToRoom = async (client, param, val) => {
111
111
  contentMd += `*${line.value}*`;
112
112
  }
113
113
  else if (line.type === 'MD.divider') {
114
- contentMd += '---\n';
114
+ contentMd += '\n---\n';
115
115
  }
116
116
  else if (line.type === 'MD.image') {
117
- contentMd += `![${line.value}](${line.value})`;
117
+ contentMd += `\n![${line.value}](${line.value})\n`;
118
118
  }
119
119
  else if (line.type === 'MD.link') {
120
120
  contentMd += `[${line.value}](${line.value})`;
@@ -133,7 +133,7 @@ const sendToRoom = async (client, param, val) => {
133
133
  }
134
134
  else if (line.type === 'MD.code') {
135
135
  const language = line?.options?.language || '';
136
- contentMd += `\`\`\`${language}\n${line.value}\n\`\`\`\n`;
136
+ contentMd += `\n\`\`\`${language}\n${line.value}\n\`\`\`\n`;
137
137
  }
138
138
  else {
139
139
  const value = line['value'] || '';
@@ -142,20 +142,24 @@ const sendToRoom = async (client, param, val) => {
142
142
  });
143
143
  }
144
144
  else if (item.type === 'BT.group' && item.value.length > 0) {
145
- contentMd += `<box>${item.value?.map(row => {
145
+ contentMd += `<box classWind="mt-2" variant="borderless" >${item.value
146
+ ?.map(row => {
146
147
  const val = row.value;
147
148
  if (val.length === 0) {
148
149
  return '';
149
150
  }
150
- return `<flex>${val.map(button => {
151
+ return `<flex>${val
152
+ .map(button => {
151
153
  const value = button.value;
152
154
  const options = button.options;
153
155
  const autoEnter = options?.autoEnter ?? false;
154
156
  const label = typeof value === 'object' ? value.title : value;
155
157
  const command = options?.data || label;
156
158
  return `<btn command="${command}" enter="${String(autoEnter)}" >${label}</btn>`;
157
- }).join('')}</flex>`;
158
- }).join('')}</box>`;
159
+ })
160
+ .join('')}</flex>`;
161
+ })
162
+ .join('')}</box>`;
159
163
  }
160
164
  });
161
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/bubble",
3
- "version": "2.1.0-alpha.6",
3
+ "version": "2.1.0-alpha.8",
4
4
  "description": "bubble platform",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",