@douyinfe/semi-foundation 2.72.2 → 2.73.0-beta.0

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 (60) hide show
  1. package/audioPlayer/audioPlayer.scss +217 -0
  2. package/audioPlayer/constants.ts +7 -0
  3. package/audioPlayer/foundation.ts +103 -0
  4. package/audioPlayer/variables.scss +55 -0
  5. package/button/iconButton.scss +8 -0
  6. package/cropper/constants.ts +26 -0
  7. package/cropper/cropper.scss +116 -0
  8. package/cropper/foundation.ts +821 -0
  9. package/cropper/utils.ts +12 -0
  10. package/cropper/variables.scss +6 -0
  11. package/dragMove/foundation.ts +12 -0
  12. package/jsonViewer/foundation.ts +6 -0
  13. package/jsonViewer/jsonViewer.scss +8 -3
  14. package/lib/cjs/audioPlayer/audioPlayer.css +188 -0
  15. package/lib/cjs/audioPlayer/audioPlayer.scss +217 -0
  16. package/lib/cjs/audioPlayer/constants.d.ts +4 -0
  17. package/lib/cjs/audioPlayer/constants.js +10 -0
  18. package/lib/cjs/audioPlayer/foundation.d.ts +41 -0
  19. package/lib/cjs/audioPlayer/foundation.js +79 -0
  20. package/lib/cjs/audioPlayer/variables.scss +55 -0
  21. package/lib/cjs/button/iconButton.css +8 -0
  22. package/lib/cjs/button/iconButton.scss +8 -0
  23. package/lib/cjs/cropper/constants.d.ts +17 -0
  24. package/lib/cjs/cropper/constants.js +24 -0
  25. package/lib/cjs/cropper/cropper.css +97 -0
  26. package/lib/cjs/cropper/cropper.scss +116 -0
  27. package/lib/cjs/cropper/foundation.d.ts +101 -0
  28. package/lib/cjs/cropper/foundation.js +786 -0
  29. package/lib/cjs/cropper/utils.d.ts +2 -0
  30. package/lib/cjs/cropper/utils.js +19 -0
  31. package/lib/cjs/cropper/variables.scss +6 -0
  32. package/lib/cjs/dragMove/foundation.d.ts +2 -0
  33. package/lib/cjs/dragMove/foundation.js +10 -0
  34. package/lib/cjs/jsonViewer/foundation.js +6 -0
  35. package/lib/cjs/jsonViewer/jsonViewer.css +8 -2
  36. package/lib/cjs/jsonViewer/jsonViewer.scss +8 -3
  37. package/lib/es/audioPlayer/audioPlayer.css +188 -0
  38. package/lib/es/audioPlayer/audioPlayer.scss +217 -0
  39. package/lib/es/audioPlayer/constants.d.ts +4 -0
  40. package/lib/es/audioPlayer/constants.js +5 -0
  41. package/lib/es/audioPlayer/foundation.d.ts +41 -0
  42. package/lib/es/audioPlayer/foundation.js +72 -0
  43. package/lib/es/audioPlayer/variables.scss +55 -0
  44. package/lib/es/button/iconButton.css +8 -0
  45. package/lib/es/button/iconButton.scss +8 -0
  46. package/lib/es/cropper/constants.d.ts +17 -0
  47. package/lib/es/cropper/constants.js +19 -0
  48. package/lib/es/cropper/cropper.css +97 -0
  49. package/lib/es/cropper/cropper.scss +116 -0
  50. package/lib/es/cropper/foundation.d.ts +101 -0
  51. package/lib/es/cropper/foundation.js +778 -0
  52. package/lib/es/cropper/utils.d.ts +2 -0
  53. package/lib/es/cropper/utils.js +12 -0
  54. package/lib/es/cropper/variables.scss +6 -0
  55. package/lib/es/dragMove/foundation.d.ts +2 -0
  56. package/lib/es/dragMove/foundation.js +10 -0
  57. package/lib/es/jsonViewer/foundation.js +6 -0
  58. package/lib/es/jsonViewer/jsonViewer.css +8 -2
  59. package/lib/es/jsonViewer/jsonViewer.scss +8 -3
  60. package/package.json +4 -4
@@ -0,0 +1,2 @@
1
+ export declare function getMiddle(value: number, [min, max]: [any, any]): number;
2
+ export declare function getAspectHW(width: number, height: number, aspect: number): number[];
@@ -0,0 +1,12 @@
1
+ export function getMiddle(value, _ref) {
2
+ let [min, max] = _ref;
3
+ return Math.min(Math.max(value, min), max);
4
+ }
5
+ export function getAspectHW(width, height, aspect) {
6
+ if (width / height > aspect) {
7
+ width = height * aspect;
8
+ } else {
9
+ height = width / aspect;
10
+ }
11
+ return [width, height];
12
+ }
@@ -0,0 +1,6 @@
1
+ $color-cropper_mask-bg: var(--semi-color-overlay-bg); // 裁切框遮罩背景颜色
2
+ $color-cropper_box-outline: var(--semi-color-primary); // 裁切框边框颜色
3
+ $color-cropper_box_corner-bg: var(--semi-color-primary); // 裁切框调整块背景色
4
+
5
+ $width-cropper_box-outline: 1px; // 裁切框边框宽度
6
+ $width-cropper_box_corner: 10px; // 裁切框调整块宽高
@@ -24,6 +24,8 @@ export default class DragMoveFoundation<P = Record<string, any>, S = Record<stri
24
24
  get handler(): HTMLElement;
25
25
  constructor(adapter: DragMoveAdapter<P, S>);
26
26
  init(): void;
27
+ _registerStartEvent: () => void;
28
+ _unRegisterStartEvent: () => void;
27
29
  destroy(): void;
28
30
  _registerDocMouseEvent: () => void;
29
31
  _unRegisterDocMouseEvent: () => void;
@@ -11,6 +11,14 @@ export default class DragMoveFoundation extends BaseFoundation {
11
11
  }
12
12
  constructor(adapter) {
13
13
  super(Object.assign({}, adapter));
14
+ this._registerStartEvent = () => {
15
+ this.handler.addEventListener('mousedown', this.onMouseDown);
16
+ this.handler.addEventListener('touchstart', this.onTouchStart);
17
+ };
18
+ this._unRegisterStartEvent = () => {
19
+ this.handler.removeEventListener('mousedown', this.onMouseDown);
20
+ this.handler.removeEventListener('touchstart', this.onTouchStart);
21
+ };
14
22
  this._registerDocMouseEvent = () => {
15
23
  document.addEventListener('mousemove', this._onMouseMove);
16
24
  document.addEventListener('mouseup', this._onMouseUp);
@@ -108,8 +116,10 @@ export default class DragMoveFoundation extends BaseFoundation {
108
116
  this.element = element;
109
117
  this.element.style.position = 'absolute';
110
118
  this.handler.style.cursor = 'move';
119
+ this._registerStartEvent();
111
120
  }
112
121
  destroy() {
122
+ this._unRegisterStartEvent();
113
123
  this._unRegisterEvent();
114
124
  }
115
125
  _unRegisterEvent() {
@@ -46,10 +46,16 @@ class JsonViewerFoundation extends BaseFoundation {
46
46
  }
47
47
  replace(replaceText) {
48
48
  var _a;
49
+ if (this.getProps().options.readOnly) {
50
+ return;
51
+ }
49
52
  (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().replace(replaceText);
50
53
  }
51
54
  replaceAll(replaceText) {
52
55
  var _a;
56
+ if (this.getProps().options.readOnly) {
57
+ return;
58
+ }
53
59
  (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().replaceAll(replaceText);
54
60
  }
55
61
  setSearchOptions(key) {
@@ -56,8 +56,8 @@
56
56
  font-variation-settings: normal;
57
57
  letter-spacing: 0px;
58
58
  color: #237893;
59
- word-wrap: break-word;
60
- white-space: pre-wrap;
59
+ word-break: break-all !important;
60
+ white-space: pre-wrap !important;
61
61
  }
62
62
  .semi-json-viewer-line-number {
63
63
  font-family: Menlo, Firecode, Monaco, "Courier New", monospace;
@@ -69,6 +69,7 @@
69
69
  color: rgba(var(--semi-grey-5), 1);
70
70
  text-align: center;
71
71
  width: 50px;
72
+ user-select: none;
72
73
  }
73
74
  .semi-json-viewer-content-container {
74
75
  scrollbar-width: none; /* 隐藏滚动条(Firefox) */
@@ -165,4 +166,9 @@
165
166
  padding: 8px 16px;
166
167
  color: var(--semi-color-text-0);
167
168
  cursor: pointer;
169
+ }
170
+ .semi-json-viewer-error {
171
+ text-decoration: underline wavy var(--semi-color-danger);
172
+ text-decoration-thickness: 1px;
173
+ text-underline-position: under;
168
174
  }
@@ -68,8 +68,8 @@ $module: #{$prefix}-json-viewer;
68
68
  font-variation-settings: normal;
69
69
  letter-spacing: 0px;
70
70
  color: #237893;
71
- word-wrap: break-word;
72
- white-space: pre-wrap;
71
+ word-break: break-all !important;
72
+ white-space: pre-wrap !important;
73
73
  }
74
74
 
75
75
  &-line-number {
@@ -82,6 +82,7 @@ $module: #{$prefix}-json-viewer;
82
82
  color: $color-json-viewer-line-number;
83
83
  text-align: center;
84
84
  width: 50px;
85
+ user-select: none;
85
86
  }
86
87
 
87
88
  &-content-container {
@@ -196,5 +197,9 @@ $module: #{$prefix}-json-viewer;
196
197
  cursor: pointer;
197
198
  }
198
199
 
199
-
200
+ &-error {
201
+ text-decoration: underline wavy var(--semi-color-danger);
202
+ text-decoration-thickness: 1px;
203
+ text-underline-position: under;
204
+ }
200
205
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.72.2",
3
+ "version": "2.73.0-beta.0",
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.72.2",
11
- "@douyinfe/semi-json-viewer-core": "2.72.2",
10
+ "@douyinfe/semi-animation": "2.73.0-beta.0",
11
+ "@douyinfe/semi-json-viewer-core": "2.73.0-beta.0",
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": "6c791d10fdde80e422a0d569248857aea99756dc",
32
+ "gitHead": "abcf4f705109146faf4803e9547c92a4a0f2a4f5",
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-runtime": "^7.15.8",
35
35
  "@babel/preset-env": "^7.15.8",