@douyinfe/semi-foundation 2.88.2 → 2.88.3

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.
@@ -9,7 +9,8 @@ const strings = {
9
9
  TOPS_SLOT_POSITION_DEFAULT: "top",
10
10
  ZERO_WIDTH_CHAR: '\uFEFF',
11
11
  PIC_PREFIX: 'image/',
12
- PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
12
+ PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
13
+ DELETABLE: 'skipCustomTransactionPlugin'
13
14
  };
14
15
 
15
16
  const numbers = {
@@ -93,8 +93,9 @@ export default class AIChatInputFoundation extends BaseFoundation<AIChatInputAda
93
93
  handleUploadFileDelete = (attachment: Attachment) => {
94
94
  const { attachments } = this.getStates();
95
95
  const newAttachments = attachments.filter(item => item.uid !== attachment.uid);
96
- this.setState({
97
- attachments: newAttachments
96
+ this.onUploadChange({
97
+ currentFile: attachment,
98
+ fileList: newAttachments
98
99
  });
99
100
  }
100
101
 
@@ -145,7 +145,7 @@ export function getCustomSlotAttribute() {
145
145
 
146
146
  export function findSkillSlotInString(content: string) {
147
147
  const reg = /<skill-slot\s+([^>]*)><\/skill-slot>/i;
148
- const attrReg = /([\w-]+)=["']?([^"'\s>]+)["']?/g;
148
+ const attrReg = /([\w-]+)=["']([^"']*)["']/g;
149
149
  const match = reg.exec(content);
150
150
  if (match) {
151
151
  const attrsStr = match[1];
@@ -175,8 +175,8 @@ function omitUndefinedFromObj(obj: { [key: string]: any }) {
175
175
 
176
176
  export function getSkillSlotString(skill: BaseSkill) {
177
177
  let skillParams = '';
178
- skill.label && (skillParams += ` data-label=${skill.label}`);
179
- skill.value && (skillParams += ` data-value=${skill.value}`);
178
+ skill.label && (skillParams += ` data-label="${skill.label}"`);
179
+ skill.value && (skillParams += ` data-value="${skill.value}"`);
180
180
  (typeof skill.hasTemplate === 'boolean') && (skillParams += ` data-template=${skill.hasTemplate}`);
181
- return `<skill-slot ${skillParams}"></skill-slot>`;
181
+ return `<skill-slot ${skillParams}></skill-slot>`;
182
182
  }
@@ -440,11 +440,11 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
440
440
  if (step < 0) {
441
441
  // Js accuracy problem
442
442
  if (Math.abs(numberMinus(min, curNum)) >= stepAbs) {
443
- curNum = (curNum * scale + step * scale) / scale;
443
+ curNum = (Math.round(curNum * scale + step * scale)) / scale;
444
444
  }
445
445
  } else if (step > 0) {
446
446
  if (Math.abs(numberMinus(max, curNum)) >= stepAbs) {
447
- curNum = (curNum * scale + step * scale) / scale;
447
+ curNum = (Math.round(curNum * scale + step * scale)) / scale;
448
448
  }
449
449
  }
450
450
  if (typeof min === 'number' && min > curNum) {
@@ -6,6 +6,7 @@ declare const strings: {
6
6
  ZERO_WIDTH_CHAR: string;
7
7
  PIC_PREFIX: string;
8
8
  PIC_SUFFIX_ARRAY: string[];
9
+ DELETABLE: string;
9
10
  };
10
11
  declare const numbers: {
11
12
  SCROLL_AMOUNT: number;
@@ -12,7 +12,8 @@ const strings = exports.strings = {
12
12
  TOPS_SLOT_POSITION_DEFAULT: "top",
13
13
  ZERO_WIDTH_CHAR: '\uFEFF',
14
14
  PIC_PREFIX: 'image/',
15
- PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
15
+ PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
16
+ DELETABLE: 'skipCustomTransactionPlugin'
16
17
  };
17
18
  const numbers = exports.numbers = {
18
19
  SCROLL_AMOUNT: 300,
@@ -47,8 +47,9 @@ class AIChatInputFoundation extends _foundation.default {
47
47
  attachments
48
48
  } = this.getStates();
49
49
  const newAttachments = attachments.filter(item => item.uid !== attachment.uid);
50
- this.setState({
51
- attachments: newAttachments
50
+ this.onUploadChange({
51
+ currentFile: attachment,
52
+ fileList: newAttachments
52
53
  });
53
54
  };
54
55
  this.handleReferenceDelete = reference => {
@@ -177,7 +177,7 @@ function getCustomSlotAttribute() {
177
177
  }
178
178
  function findSkillSlotInString(content) {
179
179
  const reg = /<skill-slot\s+([^>]*)><\/skill-slot>/i;
180
- const attrReg = /([\w-]+)=["']?([^"'\s>]+)["']?/g;
180
+ const attrReg = /([\w-]+)=["']([^"']*)["']/g;
181
181
  const match = reg.exec(content);
182
182
  if (match) {
183
183
  const attrsStr = match[1];
@@ -205,8 +205,8 @@ function omitUndefinedFromObj(obj) {
205
205
  }
206
206
  function getSkillSlotString(skill) {
207
207
  let skillParams = '';
208
- skill.label && (skillParams += ` data-label=${skill.label}`);
209
- skill.value && (skillParams += ` data-value=${skill.value}`);
208
+ skill.label && (skillParams += ` data-label="${skill.label}"`);
209
+ skill.value && (skillParams += ` data-value="${skill.value}"`);
210
210
  typeof skill.hasTemplate === 'boolean' && (skillParams += ` data-template=${skill.hasTemplate}`);
211
- return `<skill-slot ${skillParams}"></skill-slot>`;
211
+ return `<skill-slot ${skillParams}></skill-slot>`;
212
212
  }
@@ -375,11 +375,11 @@ class InputNumberFoundation extends _foundation.default {
375
375
  if (step < 0) {
376
376
  // Js accuracy problem
377
377
  if (Math.abs((0, _number.minus)(min, curNum)) >= stepAbs) {
378
- curNum = (curNum * scale + step * scale) / scale;
378
+ curNum = Math.round(curNum * scale + step * scale) / scale;
379
379
  }
380
380
  } else if (step > 0) {
381
381
  if (Math.abs((0, _number.minus)(max, curNum)) >= stepAbs) {
382
- curNum = (curNum * scale + step * scale) / scale;
382
+ curNum = Math.round(curNum * scale + step * scale) / scale;
383
383
  }
384
384
  }
385
385
  if (typeof min === 'number' && min > curNum) {
@@ -6,6 +6,7 @@ declare const strings: {
6
6
  ZERO_WIDTH_CHAR: string;
7
7
  PIC_PREFIX: string;
8
8
  PIC_SUFFIX_ARRAY: string[];
9
+ DELETABLE: string;
9
10
  };
10
11
  declare const numbers: {
11
12
  SCROLL_AMOUNT: number;
@@ -6,7 +6,8 @@ const strings = {
6
6
  TOPS_SLOT_POSITION_DEFAULT: "top",
7
7
  ZERO_WIDTH_CHAR: '\uFEFF',
8
8
  PIC_PREFIX: 'image/',
9
- PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
9
+ PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
10
+ DELETABLE: 'skipCustomTransactionPlugin'
10
11
  };
11
12
  const numbers = {
12
13
  SCROLL_AMOUNT: 300,
@@ -40,8 +40,9 @@ export default class AIChatInputFoundation extends BaseFoundation {
40
40
  attachments
41
41
  } = this.getStates();
42
42
  const newAttachments = attachments.filter(item => item.uid !== attachment.uid);
43
- this.setState({
44
- attachments: newAttachments
43
+ this.onUploadChange({
44
+ currentFile: attachment,
45
+ fileList: newAttachments
45
46
  });
46
47
  };
47
48
  this.handleReferenceDelete = reference => {
@@ -160,7 +160,7 @@ export function getCustomSlotAttribute() {
160
160
  }
161
161
  export function findSkillSlotInString(content) {
162
162
  const reg = /<skill-slot\s+([^>]*)><\/skill-slot>/i;
163
- const attrReg = /([\w-]+)=["']?([^"'\s>]+)["']?/g;
163
+ const attrReg = /([\w-]+)=["']([^"']*)["']/g;
164
164
  const match = reg.exec(content);
165
165
  if (match) {
166
166
  const attrsStr = match[1];
@@ -188,8 +188,8 @@ function omitUndefinedFromObj(obj) {
188
188
  }
189
189
  export function getSkillSlotString(skill) {
190
190
  let skillParams = '';
191
- skill.label && (skillParams += ` data-label=${skill.label}`);
192
- skill.value && (skillParams += ` data-value=${skill.value}`);
191
+ skill.label && (skillParams += ` data-label="${skill.label}"`);
192
+ skill.value && (skillParams += ` data-value="${skill.value}"`);
193
193
  typeof skill.hasTemplate === 'boolean' && (skillParams += ` data-template=${skill.hasTemplate}`);
194
- return `<skill-slot ${skillParams}"></skill-slot>`;
194
+ return `<skill-slot ${skillParams}></skill-slot>`;
195
195
  }
@@ -368,11 +368,11 @@ class InputNumberFoundation extends BaseFoundation {
368
368
  if (step < 0) {
369
369
  // Js accuracy problem
370
370
  if (Math.abs(numberMinus(min, curNum)) >= stepAbs) {
371
- curNum = (curNum * scale + step * scale) / scale;
371
+ curNum = Math.round(curNum * scale + step * scale) / scale;
372
372
  }
373
373
  } else if (step > 0) {
374
374
  if (Math.abs(numberMinus(max, curNum)) >= stepAbs) {
375
- curNum = (curNum * scale + step * scale) / scale;
375
+ curNum = Math.round(curNum * scale + step * scale) / scale;
376
376
  }
377
377
  }
378
378
  if (typeof min === 'number' && min > curNum) {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.88.2",
3
+ "version": "2.88.3",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.88.2",
11
- "@douyinfe/semi-json-viewer-core": "2.88.2",
10
+ "@douyinfe/semi-animation": "2.88.3",
11
+ "@douyinfe/semi-json-viewer-core": "2.88.3",
12
12
  "@mdx-js/mdx": "^3.0.1",
13
13
  "async-validator": "^3.5.0",
14
14
  "classnames": "^2.2.6",
@@ -29,7 +29,7 @@
29
29
  "*.scss",
30
30
  "*.css"
31
31
  ],
32
- "gitHead": "c4ddfa944bb1685377a053c381aa9f4b3a3b5e26",
32
+ "gitHead": "5f79a271fdeb8e6980a3a833785105dd68030a8c",
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-runtime": "^7.15.8",
35
35
  "@babel/preset-env": "^7.15.8",