musae 0.3.3 → 0.3.5
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.
- package/dist/components/button/button.cjs +11 -10
- package/dist/components/button/button.mjs +7 -6
- package/dist/components/calendar/contribution.cjs +251 -0
- package/dist/components/calendar/contribution.d.ts +13 -0
- package/dist/components/calendar/contribution.mjs +249 -0
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/config/provider.cjs +2 -2
- package/dist/components/config/provider.mjs +2 -2
- package/dist/components/drawer/popup.cjs +51 -17
- package/dist/components/drawer/popup.d.ts +1 -1
- package/dist/components/drawer/popup.mjs +51 -17
- package/dist/components/fab/floatable.d.ts +1 -1
- package/dist/components/icon/icons/action/delete.cjs +20 -0
- package/dist/components/icon/icons/action/delete.d.ts +3 -0
- package/dist/components/icon/icons/action/delete.mjs +18 -0
- package/dist/components/icon/icons/action/index.cjs +7 -1
- package/dist/components/icon/icons/action/index.d.ts +5 -1
- package/dist/components/icon/icons/action/index.mjs +6 -2
- package/dist/components/icon/icons/action/three-d-rotation.cjs +28 -0
- package/dist/components/icon/icons/action/three-d-rotation.d.ts +3 -0
- package/dist/components/icon/icons/action/three-d-rotation.mjs +26 -0
- package/dist/components/icon/icons/editor/attch-file.cjs +20 -0
- package/dist/components/icon/icons/editor/attch-file.d.ts +3 -0
- package/dist/components/icon/icons/editor/attch-file.mjs +18 -0
- package/dist/components/icon/icons/editor/index.cjs +4 -1
- package/dist/components/icon/icons/editor/index.d.ts +3 -1
- package/dist/components/icon/icons/editor/index.mjs +4 -2
- package/dist/components/icon/icons/index.cjs +6 -0
- package/dist/components/icon/icons/index.mjs +3 -0
- package/dist/components/menu/hooks.d.ts +1 -2
- package/dist/components/menu/item.d.ts +2 -3
- package/dist/components/pagination/pagination.cjs +1 -1
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/popover/popover.cjs +1 -1
- package/dist/components/popover/popover.mjs +1 -1
- package/dist/components/popper/dropdown.cjs +44 -19
- package/dist/components/popper/dropdown.mjs +46 -21
- package/dist/components/popper/hooks.cjs +88 -89
- package/dist/components/popper/hooks.d.ts +7 -13
- package/dist/components/popper/hooks.mjs +91 -91
- package/dist/components/rich-text-editor/plugins/controlled-state/index.cjs +1 -2
- package/dist/components/rich-text-editor/plugins/controlled-state/index.mjs +1 -2
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.cjs +5 -4
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.d.ts +3 -3
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.mjs +3 -4
- package/dist/components/rich-text-editor/rich-text-editor.cjs +5 -5
- package/dist/components/rich-text-editor/rich-text-editor.mjs +3 -3
- package/dist/components/select/utils.cjs +1 -3
- package/dist/components/select/utils.d.ts +1 -1
- package/dist/components/select/utils.mjs +2 -4
- package/dist/components/skeleton/skeleton.cjs +5 -48
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/skeleton/skeleton.mjs +5 -48
- package/dist/components/steps/context.d.ts +1 -1
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/switch/switch.cjs +7 -6
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.mjs +8 -7
- package/dist/components/table/body.cjs +3 -1
- package/dist/components/table/body.mjs +3 -1
- package/dist/components/tabs/context.d.ts +1 -1
- package/dist/components/tabs/hooks.d.ts +2 -2
- package/dist/components/tabs/navigation.d.ts +1 -1
- package/dist/components/tabs/panels.d.ts +1 -1
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/theme/hooks.cjs +6 -6
- package/dist/components/theme/hooks.d.ts +1 -1
- package/dist/components/theme/hooks.mjs +6 -6
- package/dist/components/theme/theme-provider.cjs +12 -6
- package/dist/components/theme/theme-provider.d.ts +2 -2
- package/dist/components/theme/theme-provider.mjs +12 -6
- package/dist/components/time-picker/hooks.d.ts +1 -1
- package/dist/components/time-picker/panel.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/context.d.ts +1 -1
- package/dist/components/timeline/item.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/transfer/context.d.ts +1 -1
- package/dist/components/transfer/hooks.d.ts +1 -1
- package/dist/components/transfer/item.d.ts +1 -1
- package/dist/components/transfer/list.d.ts +1 -1
- package/dist/components/transfer/transfer.d.ts +1 -1
- package/dist/components/upload/upload.cjs +31 -6
- package/dist/components/upload/upload.d.ts +2 -2
- package/dist/components/upload/upload.mjs +31 -6
- package/dist/components/upload/uploadeds.cjs +119 -55
- package/dist/components/upload/uploadeds.d.ts +1 -1
- package/dist/components/upload/uploadeds.mjs +121 -57
- package/dist/components/upload/utils.cjs +9 -0
- package/dist/components/upload/utils.d.ts +6 -0
- package/dist/components/upload/utils.mjs +9 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +1 -1
- package/dist/components/waterfall/sequential.d.ts +1 -1
- package/dist/components/waterfall/waterfall.d.ts +1 -1
- package/dist/components/watermark/hooks.d.ts +1 -1
- package/dist/components/watermark/watermark.d.ts +1 -1
- package/dist/hooks/use-class-names.d.ts +1 -0
- package/dist/hooks/use-closable.cjs +0 -8
- package/dist/hooks/use-closable.mjs +0 -8
- package/dist/hooks/use-container.d.ts +1 -1
- package/dist/hooks/use-lazy-boolean.cjs +2 -2
- package/dist/hooks/use-lazy-boolean.mjs +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -0
- package/dist/locale/locales/en_US.cjs +5 -1
- package/dist/locale/locales/en_US.mjs +5 -1
- package/dist/locale/locales/zh_CN.cjs +5 -1
- package/dist/locale/locales/zh_CN.mjs +5 -1
- package/dist/styles.css +16 -7
- package/dist/types/drawer.d.ts +5 -0
- package/dist/types/element.d.ts +1 -56
- package/dist/types/form.d.ts +39 -1
- package/dist/types/locale.d.ts +6 -0
- package/dist/types/menu.d.ts +8 -3
- package/dist/types/popper.d.ts +1 -1
- package/dist/types/skeleton.d.ts +0 -7
- package/dist/{components/theme/types.d.ts → types/theme.d.ts} +1 -1
- package/dist/types/tree.d.ts +7 -2
- package/dist/{components/upload/types.d.ts → types/upload.d.ts} +59 -22
- package/dist/{components/waterfall/types.d.ts → types/waterfall.d.ts} +3 -3
- package/dist/utils/class-name.cjs +1 -1
- package/dist/utils/class-name.d.ts +3 -1
- package/dist/utils/class-name.mjs +1 -1
- package/dist/utils/colors.cjs +0 -10
- package/dist/utils/colors.d.ts +1 -4
- package/dist/utils/colors.mjs +1 -10
- package/dist/utils/component-token.cjs +1 -0
- package/dist/utils/component-token.d.ts +2 -1
- package/dist/utils/component-token.mjs +1 -0
- package/dist/utils/date.cjs +13 -0
- package/dist/utils/date.d.ts +6 -0
- package/dist/utils/date.mjs +13 -0
- package/package.json +25 -25
- package/dist/components/icon/icons/three-dimension-rotation.d.ts +0 -3
- /package/dist/{components/steps/types.d.ts → types/steps.d.ts} +0 -0
- /package/dist/{components/switch/types.d.ts → types/switch.d.ts} +0 -0
- /package/dist/{components/tabs/types.d.ts → types/tabs.d.ts} +0 -0
- /package/dist/{components/tag/types.d.ts → types/tag.d.ts} +0 -0
- /package/dist/{components/time-picker/types.d.ts → types/time-picker.d.ts} +0 -0
- /package/dist/{components/timeline/types.d.ts → types/timeline.d.ts} +0 -0
- /package/dist/{components/tooltip/types.d.ts → types/tooltip.d.ts} +0 -0
- /package/dist/{components/transfer/types.d.ts → types/transfer.d.ts} +0 -0
- /package/dist/{components/visually-hidden/types.d.ts → types/visually-hidden.d.ts} +0 -0
- /package/dist/{components/watermark/types.d.ts → types/watermark.d.ts} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
|
|
2
2
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import {
|
|
4
|
+
import { useRef, useEffect, useMemo } from 'react';
|
|
5
5
|
import { useAnimate } from 'framer-motion';
|
|
6
6
|
import { useEvent } from '@aiszlab/relax';
|
|
7
7
|
import { useContainer } from '../../hooks/use-container.mjs';
|
|
8
|
-
import { autoUpdate, computePosition, flip, offset, arrow
|
|
8
|
+
import { autoUpdate, computePosition, flip, shift, offset, arrow } from '@floating-ui/dom';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @description
|
|
@@ -28,132 +28,125 @@ var useOffsets = function useOffsets(_ref) {
|
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* @description
|
|
31
|
-
*
|
|
31
|
+
* floating position
|
|
32
32
|
*/
|
|
33
|
-
var
|
|
33
|
+
var useFloating = function useFloating(_ref2) {
|
|
34
34
|
var open = _ref2.open,
|
|
35
|
-
|
|
35
|
+
_trigger = _ref2.trigger,
|
|
36
|
+
placement = _ref2.placement,
|
|
37
|
+
arrowable = _ref2.arrowable,
|
|
38
|
+
_offset = _ref2.offset,
|
|
36
39
|
onEntered = _ref2.onEntered,
|
|
37
40
|
onExit = _ref2.onExit,
|
|
38
|
-
onExited = _ref2.onExited
|
|
41
|
+
onExited = _ref2.onExited,
|
|
42
|
+
disappearable = _ref2.disappearable;
|
|
39
43
|
var _useAnimate = useAnimate(),
|
|
40
44
|
_useAnimate2 = _slicedToArray(_useAnimate, 2),
|
|
41
|
-
|
|
45
|
+
floatableRef = _useAnimate2[0],
|
|
42
46
|
animate = _useAnimate2[1];
|
|
47
|
+
var arrowRef = useRef(null);
|
|
48
|
+
var _useContainer = useContainer({
|
|
49
|
+
container: _trigger,
|
|
50
|
+
useBody: false
|
|
51
|
+
}, [open]),
|
|
52
|
+
trigger = _useContainer.container;
|
|
53
|
+
var _isOpen = useRef(false);
|
|
54
|
+
// appear animation
|
|
55
|
+
// prevent open again when opened
|
|
56
|
+
// first remove `display: none` style
|
|
57
|
+
// then animate
|
|
43
58
|
var appear = useEvent(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
44
59
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
45
60
|
while (1) switch (_context.prev = _context.next) {
|
|
46
61
|
case 0:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
if (!_isOpen.current) {
|
|
63
|
+
_context.next = 2;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
return _context.abrupt("return");
|
|
67
|
+
case 2:
|
|
68
|
+
_isOpen.current = true;
|
|
69
|
+
floatableRef.current.style.display = "unset";
|
|
70
|
+
_context.next = 6;
|
|
71
|
+
return animate(floatableRef.current, {
|
|
72
|
+
opacity: 1
|
|
52
73
|
}, {
|
|
53
74
|
duration: 0.2
|
|
54
75
|
});
|
|
55
|
-
case
|
|
56
|
-
_context.next =
|
|
76
|
+
case 6:
|
|
77
|
+
_context.next = 8;
|
|
57
78
|
return onEntered === null || onEntered === void 0 ? void 0 : onEntered();
|
|
58
|
-
case
|
|
79
|
+
case 8:
|
|
59
80
|
case "end":
|
|
60
81
|
return _context.stop();
|
|
61
82
|
}
|
|
62
83
|
}, _callee);
|
|
63
84
|
})));
|
|
85
|
+
// disappear animation
|
|
86
|
+
// prevent disappear again when disappeared
|
|
87
|
+
// when using force disappear, it will be forced to disappear
|
|
64
88
|
var disappear = useEvent(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
89
|
+
var force,
|
|
90
|
+
_args2 = arguments;
|
|
65
91
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
66
92
|
while (1) switch (_context2.prev = _context2.next) {
|
|
67
93
|
case 0:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
force = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
|
|
95
|
+
if (_isOpen.current) {
|
|
96
|
+
_context2.next = 3;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
return _context2.abrupt("return");
|
|
100
|
+
case 3:
|
|
101
|
+
if (!(!force && !disappearable)) {
|
|
102
|
+
_context2.next = 5;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
return _context2.abrupt("return");
|
|
106
|
+
case 5:
|
|
107
|
+
_isOpen.current = false;
|
|
108
|
+
_context2.next = 8;
|
|
109
|
+
return Promise.all([onExit === null || onExit === void 0 ? void 0 : onExit(), animate(floatableRef.current, {
|
|
110
|
+
opacity: 0
|
|
72
111
|
}, {
|
|
73
112
|
duration: 0.2
|
|
74
113
|
}).then(function () {
|
|
75
|
-
|
|
76
|
-
animatableRef.current.style.display = "none";
|
|
114
|
+
floatableRef.current.style.display = "none";
|
|
77
115
|
})]);
|
|
78
|
-
case
|
|
79
|
-
_context2.next =
|
|
116
|
+
case 8:
|
|
117
|
+
_context2.next = 10;
|
|
80
118
|
return onExited === null || onExited === void 0 ? void 0 : onExited();
|
|
81
|
-
case
|
|
119
|
+
case 10:
|
|
82
120
|
case "end":
|
|
83
121
|
return _context2.stop();
|
|
84
122
|
}
|
|
85
123
|
}, _callee2);
|
|
86
124
|
})));
|
|
87
|
-
var _disappear = useCallback(function () {
|
|
88
|
-
if (!disappearable) return;
|
|
89
|
-
disappear();
|
|
90
|
-
}, [disappear, disappearable]);
|
|
91
|
-
useLayoutEffect(function () {
|
|
92
|
-
if (open) {
|
|
93
|
-
appear();
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
_disappear();
|
|
97
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
|
-
}, [open]);
|
|
99
|
-
return {
|
|
100
|
-
animatableRef: animatableRef,
|
|
101
|
-
disappear: disappear
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* @description
|
|
106
|
-
* floating position
|
|
107
|
-
*/
|
|
108
|
-
var useFloating = function useFloating(_ref5) {
|
|
109
|
-
var open = _ref5.open,
|
|
110
|
-
_trigger = _ref5.trigger,
|
|
111
|
-
placement = _ref5.placement,
|
|
112
|
-
arrowable = _ref5.arrowable,
|
|
113
|
-
_offset = _ref5.offset;
|
|
114
|
-
var floatableRef = useRef(null);
|
|
115
|
-
var _useContainer = useContainer({
|
|
116
|
-
container: _trigger,
|
|
117
|
-
useBody: false
|
|
118
|
-
}, [open]),
|
|
119
|
-
trigger = _useContainer.container;
|
|
120
|
-
var arrowRef = useRef(null);
|
|
121
125
|
// memorized offsets
|
|
122
126
|
var offsets = useOffsets({
|
|
123
127
|
offset: _offset,
|
|
124
128
|
arrowable: arrowable
|
|
125
129
|
});
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
useLayoutEffect(function () {
|
|
129
|
-
var floatable = floatableRef.current;
|
|
130
|
+
// position listener
|
|
131
|
+
var position = useEvent(function () {
|
|
130
132
|
if (!trigger) return;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
computePosition(trigger, floatable, {
|
|
133
|
+
var cleanup = autoUpdate(trigger, floatableRef.current, function () {
|
|
134
|
+
computePosition(trigger, floatableRef.current, {
|
|
134
135
|
placement: placement,
|
|
135
|
-
middleware: [flip(), offset(offsets), arrowable && !!arrowRef.current && arrow({
|
|
136
|
+
middleware: [flip(), shift(), offset(offsets), arrowable && !!arrowRef.current && arrow({
|
|
136
137
|
element: arrowRef.current,
|
|
137
138
|
padding: 16
|
|
138
|
-
}), size({
|
|
139
|
-
apply: function apply(_ref6) {
|
|
140
|
-
var availableWidth = _ref6.availableWidth,
|
|
141
|
-
availableHeight = _ref6.availableHeight,
|
|
142
|
-
floating = _ref6.elements.floating;
|
|
143
|
-
floating.style.maxWidth = "".concat(availableWidth, "px");
|
|
144
|
-
floating.style.maxHeight = "".concat(availableHeight, "px");
|
|
145
|
-
}
|
|
146
139
|
})]
|
|
147
|
-
}).then(function (
|
|
148
|
-
var x =
|
|
149
|
-
y =
|
|
150
|
-
middlewareData =
|
|
151
|
-
_placement =
|
|
140
|
+
}).then(function (_ref5) {
|
|
141
|
+
var x = _ref5.x,
|
|
142
|
+
y = _ref5.y,
|
|
143
|
+
middlewareData = _ref5.middlewareData,
|
|
144
|
+
_placement = _ref5.placement;
|
|
152
145
|
var _placement$split = _placement.split("-"),
|
|
153
146
|
_placement$split2 = _slicedToArray(_placement$split, 1),
|
|
154
147
|
side = _placement$split2[0];
|
|
155
148
|
// set float element styles
|
|
156
|
-
|
|
149
|
+
floatableRef.current.style.translate = "".concat(x, "px ").concat(y, "px");
|
|
157
150
|
// set arrow styles
|
|
158
151
|
if (middlewareData.arrow && !!arrowRef.current) {
|
|
159
152
|
var _middlewareData$arrow, _middlewareData$arrow2;
|
|
@@ -163,23 +156,30 @@ var useFloating = function useFloating(_ref5) {
|
|
|
163
156
|
side === "top" && (arrowRef.current.style.insetBlockEnd = offsetY);
|
|
164
157
|
side === "bottom" && (arrowRef.current.style.insetBlockStart = offsetY);
|
|
165
158
|
}
|
|
159
|
+
// use appear animation
|
|
160
|
+
appear();
|
|
166
161
|
})["catch"](function () {
|
|
167
162
|
return null;
|
|
168
|
-
}).then(function () {
|
|
169
|
-
requestAnimationFrame(function () {
|
|
170
|
-
floatable.style.transitionProperty = "translate";
|
|
171
|
-
floatable.style.transitionDuration = "0.1s";
|
|
172
|
-
});
|
|
173
163
|
});
|
|
174
164
|
});
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
165
|
+
return cleanup;
|
|
166
|
+
});
|
|
167
|
+
// auto update: calc trigger dom to get position
|
|
168
|
+
// if trigger changed, re-relate
|
|
169
|
+
useEffect(function () {
|
|
170
|
+
if (open) {
|
|
171
|
+
var cleanup = position();
|
|
172
|
+
return function () {
|
|
173
|
+
cleanup === null || cleanup === void 0 || cleanup();
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
disappear();
|
|
177
|
+
}, [disappear, open, position]);
|
|
179
178
|
return {
|
|
180
179
|
floatableRef: floatableRef,
|
|
181
|
-
arrowRef: arrowRef
|
|
180
|
+
arrowRef: arrowRef,
|
|
181
|
+
disappear: disappear
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
-
export {
|
|
185
|
+
export { useFloating, useOffsets };
|
|
@@ -6,7 +6,6 @@ var relax = require('@aiszlab/relax');
|
|
|
6
6
|
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
|
|
7
7
|
var LexicalOnChangePlugin = require('@lexical/react/LexicalOnChangePlugin');
|
|
8
8
|
var markdown = require('@lexical/markdown');
|
|
9
|
-
var index = require('../markdown-shortcut/index.cjs');
|
|
10
9
|
|
|
11
10
|
var ControlledStatePlugin = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12
11
|
var value = _ref.value,
|
|
@@ -36,7 +35,7 @@ var ControlledStatePlugin = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
36
35
|
onChange === null || onChange === void 0 || onChange(_value);
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
|
-
var markdown$1 = markdown.$convertToMarkdownString(
|
|
38
|
+
var markdown$1 = markdown.$convertToMarkdownString(markdown.TRANSFORMERS, state._nodeMap.get("root"));
|
|
40
39
|
onChange === null || onChange === void 0 || onChange(markdown$1);
|
|
41
40
|
});
|
|
42
41
|
});
|
|
@@ -3,8 +3,7 @@ import React, { forwardRef, useCallback, useImperativeHandle } from 'react';
|
|
|
3
3
|
import { useUpdateEffect, isUndefined, useEvent } from '@aiszlab/relax';
|
|
4
4
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
5
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
6
|
-
import { $convertToMarkdownString } from '@lexical/markdown';
|
|
7
|
-
import { TRANSFORMERS } from '../markdown-shortcut/index.mjs';
|
|
6
|
+
import { $convertToMarkdownString, TRANSFORMERS } from '@lexical/markdown';
|
|
8
7
|
|
|
9
8
|
var ControlledStatePlugin = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
9
|
var value = _ref.value,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
4
3
|
var LexicalMarkdownShortcutPlugin = require('@lexical/react/LexicalMarkdownShortcutPlugin');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var markdown = require('@lexical/markdown');
|
|
7
6
|
|
|
8
|
-
var TRANSFORMERS = [].concat(_toConsumableArray(markdown.ELEMENT_TRANSFORMERS), _toConsumableArray(markdown.TEXT_FORMAT_TRANSFORMERS), _toConsumableArray(markdown.TEXT_MATCH_TRANSFORMERS));
|
|
9
7
|
var MarkdownShortcutPlugin = function MarkdownShortcutPlugin() {
|
|
10
8
|
return /*#__PURE__*/React.createElement(LexicalMarkdownShortcutPlugin.MarkdownShortcutPlugin, {
|
|
11
|
-
transformers: TRANSFORMERS
|
|
9
|
+
transformers: markdown.TRANSFORMERS
|
|
12
10
|
});
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "TRANSFORMERS", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return markdown.TRANSFORMERS; }
|
|
16
|
+
});
|
|
16
17
|
exports.default = MarkdownShortcutPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const TRANSFORMERS: Transformer[];
|
|
1
|
+
import { TRANSFORMERS } from "@lexical/markdown";
|
|
3
2
|
declare const MarkdownShortcutPlugin: () => import("react").FunctionComponentElement<Readonly<{
|
|
4
|
-
transformers?: Array<Transformer>;
|
|
3
|
+
transformers?: Array<import("@lexical/markdown").Transformer>;
|
|
5
4
|
}>>;
|
|
6
5
|
export default MarkdownShortcutPlugin;
|
|
6
|
+
export { TRANSFORMERS };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
1
|
import { MarkdownShortcutPlugin as MarkdownShortcutPlugin$1 } from '@lexical/react/LexicalMarkdownShortcutPlugin';
|
|
3
2
|
import { createElement } from 'react';
|
|
4
|
-
import {
|
|
3
|
+
import { TRANSFORMERS } from '@lexical/markdown';
|
|
4
|
+
export { TRANSFORMERS } from '@lexical/markdown';
|
|
5
5
|
|
|
6
|
-
var TRANSFORMERS = [].concat(_toConsumableArray(ELEMENT_TRANSFORMERS), _toConsumableArray(TEXT_FORMAT_TRANSFORMERS), _toConsumableArray(TEXT_MATCH_TRANSFORMERS));
|
|
7
6
|
var MarkdownShortcutPlugin = function MarkdownShortcutPlugin() {
|
|
8
7
|
return /*#__PURE__*/createElement(MarkdownShortcutPlugin$1, {
|
|
9
8
|
transformers: TRANSFORMERS
|
|
10
9
|
});
|
|
11
10
|
};
|
|
12
11
|
|
|
13
|
-
export {
|
|
12
|
+
export { MarkdownShortcutPlugin as default };
|
|
@@ -25,8 +25,8 @@ var list = require('@lexical/list');
|
|
|
25
25
|
var LexicalHorizontalRuleNode = require('@lexical/react/LexicalHorizontalRuleNode');
|
|
26
26
|
var code = require('@lexical/code');
|
|
27
27
|
var checkableListItem = require('./nodes/checkable-list-item.cjs');
|
|
28
|
-
var index
|
|
29
|
-
var index = require('./plugins/markdown-shortcut/index.cjs');
|
|
28
|
+
var index = require('./plugins/toolbar/index.cjs');
|
|
29
|
+
var index$1 = require('./plugins/markdown-shortcut/index.cjs');
|
|
30
30
|
var theme = require('../theme/theme.cjs');
|
|
31
31
|
require('../checkbox/index.cjs');
|
|
32
32
|
var markdown = require('@lexical/markdown');
|
|
@@ -178,7 +178,7 @@ var RichTextEditor = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
178
178
|
// different value usage, use different serialization
|
|
179
179
|
switch (_use) {
|
|
180
180
|
case "markdown":
|
|
181
|
-
markdown.$convertFromMarkdownString(defaultValue,
|
|
181
|
+
markdown.$convertFromMarkdownString(defaultValue, markdown.TRANSFORMERS, void 0, true);
|
|
182
182
|
break;
|
|
183
183
|
default:
|
|
184
184
|
editor.setEditorState(editor.parseEditorState(defaultValue));
|
|
@@ -200,7 +200,7 @@ var RichTextEditor = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
200
200
|
}, /*#__PURE__*/React.createElement("div", {
|
|
201
201
|
className: relax.clsx(className, styled.shell.className),
|
|
202
202
|
style: _objectSpread(_objectSpread({}, styled.shell.style), style)
|
|
203
|
-
}, !disabled && /*#__PURE__*/React.createElement(index
|
|
203
|
+
}, !disabled && /*#__PURE__*/React.createElement(index.default, null), /*#__PURE__*/React.createElement(LexicalRichTextPlugin.RichTextPlugin, {
|
|
204
204
|
contentEditable: /*#__PURE__*/React.createElement(LexicalContentEditable.ContentEditable, {
|
|
205
205
|
className: styled.editor.className,
|
|
206
206
|
style: styled.editor.style,
|
|
@@ -210,7 +210,7 @@ var RichTextEditor = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
210
210
|
"aria-placeholder": (_props$ariaPlacehold = props["aria-placeholder"]) !== null && _props$ariaPlacehold !== void 0 ? _props$ariaPlacehold : ""
|
|
211
211
|
}),
|
|
212
212
|
ErrorBoundary: LexicalErrorBoundary.LexicalErrorBoundary
|
|
213
|
-
}), /*#__PURE__*/React.createElement(LexicalHistoryPlugin.HistoryPlugin, null), /*#__PURE__*/React.createElement(index.default, null), /*#__PURE__*/React.createElement(LexicalLinkPlugin.LinkPlugin, null), /*#__PURE__*/React.createElement(LexicalClickableLinkPlugin.ClickableLinkPlugin, {
|
|
213
|
+
}), /*#__PURE__*/React.createElement(LexicalHistoryPlugin.HistoryPlugin, null), /*#__PURE__*/React.createElement(index$1.default, null), /*#__PURE__*/React.createElement(LexicalLinkPlugin.LinkPlugin, null), /*#__PURE__*/React.createElement(LexicalClickableLinkPlugin.ClickableLinkPlugin, {
|
|
214
214
|
disabled: !disabled,
|
|
215
215
|
newTab: true
|
|
216
216
|
}), /*#__PURE__*/React.createElement(LexicalListPlugin.ListPlugin, null), /*#__PURE__*/React.createElement(index$2.default, null), /*#__PURE__*/React.createElement(index$3.default, {
|
|
@@ -24,10 +24,10 @@ import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
|
|
24
24
|
import { CodeNode } from '@lexical/code';
|
|
25
25
|
import { CheckableListItemNode, replacement } from './nodes/checkable-list-item.mjs';
|
|
26
26
|
import ToolbarPlugin from './plugins/toolbar/index.mjs';
|
|
27
|
-
import MarkdownShortcutPlugin
|
|
27
|
+
import MarkdownShortcutPlugin from './plugins/markdown-shortcut/index.mjs';
|
|
28
28
|
import { typography } from '../theme/theme.mjs';
|
|
29
29
|
import '../checkbox/index.mjs';
|
|
30
|
-
import { $convertFromMarkdownString } from '@lexical/markdown';
|
|
30
|
+
import { $convertFromMarkdownString, TRANSFORMERS } from '@lexical/markdown';
|
|
31
31
|
import styles$1 from '../checkbox/styles.mjs';
|
|
32
32
|
|
|
33
33
|
var _excluded = ["placeholder", "disabled", "defaultValue", "onChange", "value", "className", "style"];
|
|
@@ -176,7 +176,7 @@ var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
176
176
|
// different value usage, use different serialization
|
|
177
177
|
switch (_use) {
|
|
178
178
|
case "markdown":
|
|
179
|
-
$convertFromMarkdownString(defaultValue, TRANSFORMERS);
|
|
179
|
+
$convertFromMarkdownString(defaultValue, TRANSFORMERS, void 0, true);
|
|
180
180
|
break;
|
|
181
181
|
default:
|
|
182
182
|
editor.setEditorState(editor.parseEditorState(defaultValue));
|
|
@@ -11,10 +11,8 @@ var relax = require('@aiszlab/relax');
|
|
|
11
11
|
var toValues = function toValues(valueOrValues) {
|
|
12
12
|
// empty
|
|
13
13
|
if (relax.isVoid(valueOrValues)) return [];
|
|
14
|
-
// already array
|
|
15
|
-
if (relax.isArray(valueOrValues)) return valueOrValues;
|
|
16
14
|
// convert to array
|
|
17
|
-
return
|
|
15
|
+
return relax.toArray(valueOrValues);
|
|
18
16
|
};
|
|
19
17
|
/**
|
|
20
18
|
* @description
|
|
@@ -5,7 +5,7 @@ import type { MenuItem } from "musae/types/menu";
|
|
|
5
5
|
* @description
|
|
6
6
|
* convert to value array
|
|
7
7
|
*/
|
|
8
|
-
export declare const toValues: (valueOrValues?: ValueOrValues) =>
|
|
8
|
+
export declare const toValues: (valueOrValues?: ValueOrValues) => (string | number | bigint | Pick<Option, "value" | "label">)[];
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
11
11
|
* convert to key
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
5
|
-
import { isVoid,
|
|
5
|
+
import { isVoid, toArray } from '@aiszlab/relax';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
@@ -11,10 +11,8 @@ import { isVoid, isArray } from '@aiszlab/relax';
|
|
|
11
11
|
var toValues = function toValues(valueOrValues) {
|
|
12
12
|
// empty
|
|
13
13
|
if (isVoid(valueOrValues)) return [];
|
|
14
|
-
// already array
|
|
15
|
-
if (isArray(valueOrValues)) return valueOrValues;
|
|
16
14
|
// convert to array
|
|
17
|
-
return
|
|
15
|
+
return toArray(valueOrValues);
|
|
18
16
|
};
|
|
19
17
|
/**
|
|
20
18
|
* @description
|
|
@@ -9,7 +9,7 @@ var relax = require('@aiszlab/relax');
|
|
|
9
9
|
var tokens_stylex = require('../theme/tokens.stylex.cjs');
|
|
10
10
|
var componentToken = require('../../utils/component-token.cjs');
|
|
11
11
|
var hooks = require('../theme/hooks.cjs');
|
|
12
|
-
var
|
|
12
|
+
var color = require('@aiszlab/fuzzy/color');
|
|
13
13
|
|
|
14
14
|
var styles = {
|
|
15
15
|
variables: function variables(props) {
|
|
@@ -22,48 +22,6 @@ var styles = {
|
|
|
22
22
|
"----lighter-shadow": props.lighterShadow != null ? props.lighterShadow : "initial"
|
|
23
23
|
}];
|
|
24
24
|
},
|
|
25
|
-
title: {
|
|
26
|
-
width: "musaex-1fvqbsf",
|
|
27
|
-
height: "musaex-1bti5vo",
|
|
28
|
-
borderRadius: "musaex-ok3b7d",
|
|
29
|
-
borderStartStartRadius: null,
|
|
30
|
-
borderStartEndRadius: null,
|
|
31
|
-
borderEndStartRadius: null,
|
|
32
|
-
borderEndEndRadius: null,
|
|
33
|
-
borderTopLeftRadius: null,
|
|
34
|
-
borderTopRightRadius: null,
|
|
35
|
-
borderBottomLeftRadius: null,
|
|
36
|
-
borderBottomRightRadius: null,
|
|
37
|
-
$$css: true
|
|
38
|
-
},
|
|
39
|
-
button: {
|
|
40
|
-
width: "musaex-1lwsb27",
|
|
41
|
-
height: "musaex-1bti5vo",
|
|
42
|
-
borderRadius: "musaex-z7qqyb",
|
|
43
|
-
borderStartStartRadius: null,
|
|
44
|
-
borderStartEndRadius: null,
|
|
45
|
-
borderEndStartRadius: null,
|
|
46
|
-
borderEndEndRadius: null,
|
|
47
|
-
borderTopLeftRadius: null,
|
|
48
|
-
borderTopRightRadius: null,
|
|
49
|
-
borderBottomLeftRadius: null,
|
|
50
|
-
borderBottomRightRadius: null,
|
|
51
|
-
$$css: true
|
|
52
|
-
},
|
|
53
|
-
avatar: {
|
|
54
|
-
width: "musaex-rdd3y",
|
|
55
|
-
height: "musaex-1bti5vo",
|
|
56
|
-
borderRadius: "musaex-z7qqyb",
|
|
57
|
-
borderStartStartRadius: null,
|
|
58
|
-
borderStartEndRadius: null,
|
|
59
|
-
borderEndStartRadius: null,
|
|
60
|
-
borderEndEndRadius: null,
|
|
61
|
-
borderTopLeftRadius: null,
|
|
62
|
-
borderTopRightRadius: null,
|
|
63
|
-
borderBottomLeftRadius: null,
|
|
64
|
-
borderBottomRightRadius: null,
|
|
65
|
-
$$css: true
|
|
66
|
-
},
|
|
67
25
|
skeleton: {
|
|
68
26
|
background: "musaex-uwpeme",
|
|
69
27
|
backgroundAttachment: null,
|
|
@@ -99,16 +57,15 @@ var styles = {
|
|
|
99
57
|
};
|
|
100
58
|
var Skeleton = function Skeleton(_ref) {
|
|
101
59
|
var _ref$animation = _ref.animation,
|
|
102
|
-
animation = _ref$animation === void 0 ?
|
|
103
|
-
variant = _ref.variant,
|
|
60
|
+
animation = _ref$animation === void 0 ? true : _ref$animation,
|
|
104
61
|
className$1 = _ref.className,
|
|
105
62
|
style = _ref.style;
|
|
106
63
|
var classNames = useClassNames.useClassNames(componentToken.ComponentToken.Skeleton);
|
|
107
64
|
var theme = hooks.useTheme();
|
|
108
65
|
var styled = stylex.default.props(styles.variables({
|
|
109
|
-
shadow:
|
|
110
|
-
lighterShadow:
|
|
111
|
-
}),
|
|
66
|
+
shadow: color.hexToRgba(theme.colors.shadow, tokens_stylex.OPACITY.thin),
|
|
67
|
+
lighterShadow: color.hexToRgba(theme.colors.shadow, tokens_stylex.OPACITY.thick)
|
|
68
|
+
}), styles.skeleton, animation && styles.animation);
|
|
112
69
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
70
|
className: relax.clsx(classNames[className.SkeletonClassToken.Skeleton], className$1, styled.className),
|
|
114
71
|
style: _objectSpread(_objectSpread({}, styled.style), style)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SkeletonProps } from "musae/types/skeleton";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare const Skeleton: ({ animation,
|
|
3
|
+
declare const Skeleton: ({ animation, className, style }: SkeletonProps) => React.JSX.Element;
|
|
4
4
|
export default Skeleton;
|
|
@@ -7,7 +7,7 @@ import { clsx } from '@aiszlab/relax';
|
|
|
7
7
|
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
8
8
|
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
9
9
|
import { useTheme } from '../theme/hooks.mjs';
|
|
10
|
-
import {
|
|
10
|
+
import { hexToRgba } from '@aiszlab/fuzzy/color';
|
|
11
11
|
|
|
12
12
|
var styles = {
|
|
13
13
|
variables: function variables(props) {
|
|
@@ -20,48 +20,6 @@ var styles = {
|
|
|
20
20
|
"----lighter-shadow": props.lighterShadow != null ? props.lighterShadow : "initial"
|
|
21
21
|
}];
|
|
22
22
|
},
|
|
23
|
-
title: {
|
|
24
|
-
width: "musaex-1fvqbsf",
|
|
25
|
-
height: "musaex-1bti5vo",
|
|
26
|
-
borderRadius: "musaex-ok3b7d",
|
|
27
|
-
borderStartStartRadius: null,
|
|
28
|
-
borderStartEndRadius: null,
|
|
29
|
-
borderEndStartRadius: null,
|
|
30
|
-
borderEndEndRadius: null,
|
|
31
|
-
borderTopLeftRadius: null,
|
|
32
|
-
borderTopRightRadius: null,
|
|
33
|
-
borderBottomLeftRadius: null,
|
|
34
|
-
borderBottomRightRadius: null,
|
|
35
|
-
$$css: true
|
|
36
|
-
},
|
|
37
|
-
button: {
|
|
38
|
-
width: "musaex-1lwsb27",
|
|
39
|
-
height: "musaex-1bti5vo",
|
|
40
|
-
borderRadius: "musaex-z7qqyb",
|
|
41
|
-
borderStartStartRadius: null,
|
|
42
|
-
borderStartEndRadius: null,
|
|
43
|
-
borderEndStartRadius: null,
|
|
44
|
-
borderEndEndRadius: null,
|
|
45
|
-
borderTopLeftRadius: null,
|
|
46
|
-
borderTopRightRadius: null,
|
|
47
|
-
borderBottomLeftRadius: null,
|
|
48
|
-
borderBottomRightRadius: null,
|
|
49
|
-
$$css: true
|
|
50
|
-
},
|
|
51
|
-
avatar: {
|
|
52
|
-
width: "musaex-rdd3y",
|
|
53
|
-
height: "musaex-1bti5vo",
|
|
54
|
-
borderRadius: "musaex-z7qqyb",
|
|
55
|
-
borderStartStartRadius: null,
|
|
56
|
-
borderStartEndRadius: null,
|
|
57
|
-
borderEndStartRadius: null,
|
|
58
|
-
borderEndEndRadius: null,
|
|
59
|
-
borderTopLeftRadius: null,
|
|
60
|
-
borderTopRightRadius: null,
|
|
61
|
-
borderBottomLeftRadius: null,
|
|
62
|
-
borderBottomRightRadius: null,
|
|
63
|
-
$$css: true
|
|
64
|
-
},
|
|
65
23
|
skeleton: {
|
|
66
24
|
background: "musaex-uwpeme",
|
|
67
25
|
backgroundAttachment: null,
|
|
@@ -97,16 +55,15 @@ var styles = {
|
|
|
97
55
|
};
|
|
98
56
|
var Skeleton = function Skeleton(_ref) {
|
|
99
57
|
var _ref$animation = _ref.animation,
|
|
100
|
-
animation = _ref$animation === void 0 ?
|
|
101
|
-
variant = _ref.variant,
|
|
58
|
+
animation = _ref$animation === void 0 ? true : _ref$animation,
|
|
102
59
|
className = _ref.className,
|
|
103
60
|
style = _ref.style;
|
|
104
61
|
var classNames = useClassNames(ComponentToken.Skeleton);
|
|
105
62
|
var theme = useTheme();
|
|
106
63
|
var styled = _stylex.props(styles.variables({
|
|
107
|
-
shadow:
|
|
108
|
-
lighterShadow:
|
|
109
|
-
}),
|
|
64
|
+
shadow: hexToRgba(theme.colors.shadow, OPACITY.thin),
|
|
65
|
+
lighterShadow: hexToRgba(theme.colors.shadow, OPACITY.thick)
|
|
66
|
+
}), styles.skeleton, animation && styles.animation);
|
|
110
67
|
return /*#__PURE__*/React.createElement("div", {
|
|
111
68
|
className: clsx(classNames[SkeletonClassToken.Skeleton], className, styled.className),
|
|
112
69
|
style: _objectSpread(_objectSpread({}, styled.style), style)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ContextValue } from "
|
|
1
|
+
import type { ContextValue } from "musae/types/steps";
|
|
2
2
|
export declare const Context: import("react").Context<ContextValue>;
|