@douyinfe/semi-foundation 2.87.0-alpha.0 → 2.88.0-alpha.1-exact

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.
@@ -96,8 +96,8 @@ $color-button_disabled_outline-border-default: var(--semi-color-border); // 边
96
96
 
97
97
  // light
98
98
  $color-button_light-bg-default: var(--semi-color-fill-0); // 浅色按钮背景颜色
99
- $color-button_light-bg-hover: var(--semi-color-fill-1); // 浅色按钮背景颜色 - 悬浮
100
- $color-button_light-bg-active: var(--semi-color-fill-2); // 浅色按钮背景颜色 - 按下
99
+ $color-button_light-bg-hover: var(--semi-color-fill-1); // 禁用按钮背景颜色 - 悬浮
100
+ $color-button_light-bg-active: var(--semi-color-fill-2); // 禁用按钮背景颜色 - 按下
101
101
  $color-button_light-border-default: transparent; // 浅色按钮描边颜色
102
102
  $color-button_light-border-hover: $color-button_light-border-default; // 浅色按钮描边颜色 - 悬浮
103
103
  $color-button_light-border-active: $color-button_light-border-hover; // 浅色按钮描边颜色 - 按下
@@ -145,10 +145,6 @@ export default class ChatFoundation <P = Record<string, any>, S = Record<string,
145
145
  return scroll;
146
146
  }, 100)
147
147
 
148
- handleScrollContainerResize = () => {
149
- this.getScroll(this._adapter.getContainerRef());
150
- }
151
-
152
148
  clearContext = (e: any) => {
153
149
  const { chats } = this.getStates();
154
150
  if (chats[chats.length - 1].role === ROLE.DIVIDER) {
@@ -10,7 +10,9 @@ export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, a
10
10
  notifyHover: (value: string, el: HTMLElement) => HTMLElement | undefined;
11
11
  setSearchOptions: (key: string) => void;
12
12
  showSearchBar: () => void;
13
- notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void
13
+ notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void;
14
+ notifyFocus: (e: Event) => void;
15
+ notifyBlur: (e: Event) => void
14
16
  }
15
17
 
16
18
  class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
@@ -37,7 +39,12 @@ class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
37
39
  this.search(this._adapter.getSearchRef().value);
38
40
  }
39
41
  });
40
-
42
+ this.jsonViewer.emitter.on('focus', (e) => {
43
+ this._adapter.notifyFocus(e);
44
+ });
45
+ this.jsonViewer.emitter.on('blur', (e) => {
46
+ this._adapter.notifyBlur(e);
47
+ });
41
48
  }
42
49
 
43
50
  search(searchText: string, caseSensitive?: boolean, wholeWord?: boolean, regex?: boolean) {
@@ -96,8 +96,8 @@ $color-button_disabled_outline-border-default: var(--semi-color-border); // 边
96
96
 
97
97
  // light
98
98
  $color-button_light-bg-default: var(--semi-color-fill-0); // 浅色按钮背景颜色
99
- $color-button_light-bg-hover: var(--semi-color-fill-1); // 浅色按钮背景颜色 - 悬浮
100
- $color-button_light-bg-active: var(--semi-color-fill-2); // 浅色按钮背景颜色 - 按下
99
+ $color-button_light-bg-hover: var(--semi-color-fill-1); // 禁用按钮背景颜色 - 悬浮
100
+ $color-button_light-bg-active: var(--semi-color-fill-2); // 禁用按钮背景颜色 - 按下
101
101
  $color-button_light-border-default: transparent; // 浅色按钮描边颜色
102
102
  $color-button_light-border-hover: $color-button_light-border-default; // 浅色按钮描边颜色 - 悬浮
103
103
  $color-button_light-border-active: $color-button_light-border-hover; // 浅色按钮描边颜色 - 按下
@@ -64,7 +64,6 @@ export default class ChatFoundation<P = Record<string, any>, S = Record<string,
64
64
  scrollToBottomWithAnimation: () => void;
65
65
  containerScroll: (e: any) => void;
66
66
  getScroll: import("lodash").DebouncedFunc<(target: any) => typeof scroll>;
67
- handleScrollContainerResize: () => void;
68
67
  clearContext: (e: any) => void;
69
68
  onMessageSend: (input: string, attachment: any[]) => void;
70
69
  onHintClick: (hint: string) => void;
@@ -90,9 +90,6 @@ class ChatFoundation extends _foundation.default {
90
90
  }
91
91
  return scroll;
92
92
  }, 100);
93
- this.handleScrollContainerResize = () => {
94
- this.getScroll(this._adapter.getContainerRef());
95
- };
96
93
  this.clearContext = e => {
97
94
  const {
98
95
  chats
@@ -9,6 +9,8 @@ export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, a
9
9
  setSearchOptions: (key: string) => void;
10
10
  showSearchBar: () => void;
11
11
  notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void;
12
+ notifyFocus: (e: Event) => void;
13
+ notifyBlur: (e: Event) => void;
12
14
  }
13
15
  declare class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
14
16
  constructor(adapter: JsonViewerAdapter);
@@ -30,6 +30,12 @@ class JsonViewerFoundation extends _foundation.default {
30
30
  this.search(this._adapter.getSearchRef().value);
31
31
  }
32
32
  });
33
+ this.jsonViewer.emitter.on('focus', e => {
34
+ this._adapter.notifyFocus(e);
35
+ });
36
+ this.jsonViewer.emitter.on('blur', e => {
37
+ this._adapter.notifyBlur(e);
38
+ });
33
39
  }
34
40
  search(searchText, caseSensitive, wholeWord, regex) {
35
41
  var _a;
@@ -96,8 +96,8 @@ $color-button_disabled_outline-border-default: var(--semi-color-border); // 边
96
96
 
97
97
  // light
98
98
  $color-button_light-bg-default: var(--semi-color-fill-0); // 浅色按钮背景颜色
99
- $color-button_light-bg-hover: var(--semi-color-fill-1); // 浅色按钮背景颜色 - 悬浮
100
- $color-button_light-bg-active: var(--semi-color-fill-2); // 浅色按钮背景颜色 - 按下
99
+ $color-button_light-bg-hover: var(--semi-color-fill-1); // 禁用按钮背景颜色 - 悬浮
100
+ $color-button_light-bg-active: var(--semi-color-fill-2); // 禁用按钮背景颜色 - 按下
101
101
  $color-button_light-border-default: transparent; // 浅色按钮描边颜色
102
102
  $color-button_light-border-hover: $color-button_light-border-default; // 浅色按钮描边颜色 - 悬浮
103
103
  $color-button_light-border-active: $color-button_light-border-hover; // 浅色按钮描边颜色 - 按下
@@ -64,7 +64,6 @@ export default class ChatFoundation<P = Record<string, any>, S = Record<string,
64
64
  scrollToBottomWithAnimation: () => void;
65
65
  containerScroll: (e: any) => void;
66
66
  getScroll: import("lodash").DebouncedFunc<(target: any) => typeof scroll>;
67
- handleScrollContainerResize: () => void;
68
67
  clearContext: (e: any) => void;
69
68
  onMessageSend: (input: string, attachment: any[]) => void;
70
69
  onHintClick: (hint: string) => void;
@@ -83,9 +83,6 @@ export default class ChatFoundation extends BaseFoundation {
83
83
  }
84
84
  return scroll;
85
85
  }, 100);
86
- this.handleScrollContainerResize = () => {
87
- this.getScroll(this._adapter.getContainerRef());
88
- };
89
86
  this.clearContext = e => {
90
87
  const {
91
88
  chats
@@ -9,6 +9,8 @@ export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, a
9
9
  setSearchOptions: (key: string) => void;
10
10
  showSearchBar: () => void;
11
11
  notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void;
12
+ notifyFocus: (e: Event) => void;
13
+ notifyBlur: (e: Event) => void;
12
14
  }
13
15
  declare class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
14
16
  constructor(adapter: JsonViewerAdapter);
@@ -23,6 +23,12 @@ class JsonViewerFoundation extends BaseFoundation {
23
23
  this.search(this._adapter.getSearchRef().value);
24
24
  }
25
25
  });
26
+ this.jsonViewer.emitter.on('focus', e => {
27
+ this._adapter.notifyFocus(e);
28
+ });
29
+ this.jsonViewer.emitter.on('blur', e => {
30
+ this._adapter.notifyBlur(e);
31
+ });
26
32
  }
27
33
  search(searchText, caseSensitive, wholeWord, regex) {
28
34
  var _a;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.87.0-alpha.0",
3
+ "version": "2.88.0-alpha.1-exact",
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.87.0-alpha.0",
11
- "@douyinfe/semi-json-viewer-core": "2.87.0-alpha.0",
10
+ "@douyinfe/semi-animation": "^2.88.0-alpha.1-exact",
11
+ "@douyinfe/semi-json-viewer-core": "^2.88.0-alpha.1-exact",
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": "9e089cce3cd8aff4b4c73e2ea0346fde3b19e8b6",
32
+ "gitHead": "0f89092207f340633c04b8dc9ed4e08cb5fed4f4",
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-runtime": "^7.15.8",
35
35
  "@babel/preset-env": "^7.15.8",