@blocklet/launcher-ux 2.1.108 → 2.2.1

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.
@@ -0,0 +1,31 @@
1
+ import PropTypes from 'prop-types';
2
+ import Button from '@arcblock/ux/lib/Button';
3
+ import CircularProgress from '@mui/material/CircularProgress';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ export default function WrappedButton({
7
+ children,
8
+ loading,
9
+ ...props
10
+ }) {
11
+ return /*#__PURE__*/_jsxs(Button, {
12
+ disabled: loading,
13
+ variant: "contained",
14
+ color: "primary",
15
+ ...props,
16
+ children: [loading && /*#__PURE__*/_jsx(CircularProgress, {
17
+ style: {
18
+ marginRight: '5px'
19
+ },
20
+ size: 16
21
+ }), children]
22
+ });
23
+ }
24
+ WrappedButton.propTypes = {
25
+ children: PropTypes.any,
26
+ loading: PropTypes.bool
27
+ };
28
+ WrappedButton.defaultProps = {
29
+ children: '',
30
+ loading: false
31
+ };
@@ -0,0 +1,100 @@
1
+ import PropTypes from 'prop-types';
2
+ import styled from '@emotion/styled';
3
+ import CheckIcon from '@mui/icons-material/Check';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ export default function CheckBox({
7
+ children,
8
+ checked,
9
+ checkIconSize,
10
+ className,
11
+ ...rest
12
+ }) {
13
+ return /*#__PURE__*/_jsxs(Content, {
14
+ className: `${checked ? 'checked' : ''} ${className}`,
15
+ checkIconSize: checkIconSize,
16
+ ...rest,
17
+ children: [children, /*#__PURE__*/_jsx("div", {
18
+ className: "check-container",
19
+ children: /*#__PURE__*/_jsx(CheckIcon, {
20
+ className: "check-icon"
21
+ })
22
+ })]
23
+ });
24
+ }
25
+ CheckBox.propTypes = {
26
+ children: PropTypes.any.isRequired,
27
+ checkIconSize: PropTypes.number,
28
+ checked: PropTypes.bool,
29
+ className: PropTypes.string
30
+ };
31
+ CheckBox.defaultProps = {
32
+ checked: false,
33
+ checkIconSize: 30,
34
+ className: ''
35
+ };
36
+ const Content = styled.div`
37
+ position: relative;
38
+ padding: 10px;
39
+ border: 0 solid ${props => props.theme.palette.grey['100']};
40
+ border-radius: 8px;
41
+ transition: all ease 0.2s;
42
+ cursor: pointer;
43
+
44
+ .check-container {
45
+ position: absolute;
46
+ right: 0;
47
+ bottom: 0;
48
+ display: flex;
49
+ justify-content: flex-end;
50
+ align-items: flex-end;
51
+ width: ${props => props.checkIconSize}px;
52
+ height: ${props => props.checkIconSize}px;
53
+ border-radius: 0 0 7px 0;
54
+ color: ${props => props.theme.palette.common.white};
55
+ overflow: hidden;
56
+ transition: all ease 0.3s;
57
+ &:after {
58
+ position: absolute;
59
+ z-index: 0;
60
+ left: ${props => props.checkIconSize}px;
61
+ top: ${props => props.checkIconSize}px;
62
+ display: block;
63
+ width: 0;
64
+ height: 0;
65
+ border-top: transparent solid ${props => props.checkIconSize / 2}px;
66
+ border-left: transparent solid ${props => props.checkIconSize / 2}px;
67
+ border-bottom: ${props => props.theme.palette.primary.main} solid ${props => props.checkIconSize / 2}px;
68
+ border-right: ${props => props.theme.palette.primary.main} solid ${props => props.checkIconSize / 2}px;
69
+ transition: all ease 0.1s;
70
+ content: '';
71
+ }
72
+
73
+ .check-icon {
74
+ width: 60%;
75
+ height: 60%;
76
+ position: relative;
77
+ z-index: 2;
78
+ margin: 0 1px 1px 0;
79
+ font-size: 16px;
80
+ transform: scale(0);
81
+ transition: all ease 0.2s;
82
+ }
83
+ }
84
+
85
+ &.checked {
86
+ background-color: #ecfbfd;
87
+ border-color: #ecfbfd;
88
+
89
+ .check-container {
90
+ &:after {
91
+ left: 0;
92
+ top: 0;
93
+ }
94
+
95
+ .check-icon {
96
+ transform: scale(1);
97
+ }
98
+ }
99
+ }
100
+ `;
@@ -0,0 +1,39 @@
1
+ import { useEffect } from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ /**
5
+ * This component should be used only once in each page,
6
+ * otherwise all registered events will be triggered when the user presses the Meta(Ctrl)+Enter key combination,
7
+ * which may not be consistent with the actual business logic.
8
+ */
9
+ export default function SubmitHotKey({
10
+ disabled,
11
+ children,
12
+ onConfirm
13
+ }) {
14
+ useEffect(() => {
15
+ if (disabled) {
16
+ return () => {};
17
+ }
18
+ const listener = event => {
19
+ if (event.code === 'Enter' && (event.metaKey === true || event.ctrlKey === true)) {
20
+ event.preventDefault();
21
+ event.stopPropagation();
22
+ onConfirm();
23
+ }
24
+ };
25
+ document.addEventListener('keydown', listener);
26
+ return () => {
27
+ document.removeEventListener('keydown', listener);
28
+ };
29
+ }, [disabled, onConfirm]);
30
+ return children;
31
+ }
32
+ SubmitHotKey.propTypes = {
33
+ disabled: PropTypes.bool,
34
+ children: PropTypes.any.isRequired,
35
+ onConfirm: PropTypes.func.isRequired
36
+ };
37
+ SubmitHotKey.defaultProps = {
38
+ disabled: false
39
+ };
@@ -0,0 +1,120 @@
1
+ import PropTypes from 'prop-types';
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import styled from '@emotion/styled';
4
+ import SmallCircleProgress from '../small-circle-progress';
5
+
6
+ // autoGrowth 逐渐增长到相应步骤所需的时间
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ export default function ProgressMessage({
10
+ steps,
11
+ stepIndex,
12
+ autoGrowth,
13
+ ...rest
14
+ }) {
15
+ const [value, setVal] = useState(0);
16
+ const items = useRef([]);
17
+ const [textWidth, setTextWidth] = useState(0);
18
+ const getClass = index => {
19
+ if (index < stepIndex) {
20
+ return 'message-before';
21
+ }
22
+ if (index > stepIndex) {
23
+ return 'message-after';
24
+ }
25
+ return '';
26
+ };
27
+ useEffect(() => {
28
+ const targetItem = items.current[stepIndex];
29
+ setTextWidth(targetItem.clientWidth);
30
+ const currentVal = (stepIndex + 1) / steps.length * 100;
31
+ let timer;
32
+ if (autoGrowth) {
33
+ const startTime = Date.now();
34
+ timer = setInterval(() => {
35
+ const diffTime = Date.now() - startTime;
36
+ let percentage = diffTime / autoGrowth;
37
+ if (percentage > 1) {
38
+ percentage = 1;
39
+ }
40
+ setVal((stepIndex + percentage) / steps.length * 100);
41
+ }, 500);
42
+ } else {
43
+ setVal(currentVal);
44
+ }
45
+ return () => {
46
+ if (timer) {
47
+ clearInterval(timer);
48
+ }
49
+ };
50
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51
+ }, [stepIndex, autoGrowth]);
52
+ return /*#__PURE__*/_jsxs(Container, {
53
+ ...rest,
54
+ children: [/*#__PURE__*/_jsx(SmallCircleProgress, {
55
+ value: value,
56
+ size: 14
57
+ }), /*#__PURE__*/_jsx("div", {
58
+ className: "progress-message",
59
+ style: {
60
+ width: textWidth
61
+ },
62
+ children: steps.map((text, index) => {
63
+ return /*#__PURE__*/_jsx("div", {
64
+ className: `progress-message-item ${getClass(index)}`
65
+ // eslint-disable-next-line react/no-array-index-key
66
+ ,
67
+
68
+ ref: el => {
69
+ items.current[index] = el;
70
+ },
71
+ children: text
72
+ }, `key_${index}`);
73
+ })
74
+ })]
75
+ });
76
+ }
77
+ ProgressMessage.propTypes = {
78
+ steps: PropTypes.array.isRequired,
79
+ stepIndex: PropTypes.number.isRequired,
80
+ autoGrowth: PropTypes.number
81
+ };
82
+ ProgressMessage.defaultProps = {
83
+ autoGrowth: 0
84
+ };
85
+ const Container = styled.div`
86
+ display: flex;
87
+ width: 100%;
88
+ align-items: center;
89
+ justify-content: center;
90
+ .progress-message {
91
+ position: relative;
92
+ color: ${props => props.theme.palette.primary.main};
93
+ margin-left: 8px;
94
+ font-size: 18px;
95
+ min-height: 26px;
96
+ line-height: 26px;
97
+ font-weight: 700;
98
+ transition: all ease 0.3s;
99
+ }
100
+ .progress-message-item {
101
+ position: absolute;
102
+ left: 0;
103
+ top: 0;
104
+ white-space: nowrap;
105
+ transition: all ease 0.3s;
106
+ z-index: 2;
107
+ &.message-before {
108
+ transform: translate(-10px, 0);
109
+ opacity: 0;
110
+ z-index: 0;
111
+ pointer-events: none;
112
+ }
113
+ &.message-after {
114
+ transform: translate(10px, 0);
115
+ opacity: 0;
116
+ z-index: 0;
117
+ pointer-events: none;
118
+ }
119
+ }
120
+ `;
@@ -0,0 +1,58 @@
1
+ import PropTypes from 'prop-types';
2
+ import styled from '@emotion/styled';
3
+ import CircularProgress from '@mui/material/CircularProgress';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ export default function SmallCircleProgress({
7
+ value,
8
+ size,
9
+ style,
10
+ ...rest
11
+ }) {
12
+ return /*#__PURE__*/_jsxs(Content, {
13
+ style: {
14
+ width: size,
15
+ height: size,
16
+ ...style
17
+ },
18
+ ...rest,
19
+ children: [/*#__PURE__*/_jsx(CircularProgress, {
20
+ variant: "determinate",
21
+ role: "progressbar",
22
+ value: 100,
23
+ size: size,
24
+ "aria-label": "decorative progress bar",
25
+ thickness: 10,
26
+ style: {
27
+ color: '#dddddd'
28
+ }
29
+ }), /*#__PURE__*/_jsx(CircularProgress, {
30
+ variant: "determinate",
31
+ value: value,
32
+ role: "progressbar",
33
+ size: size,
34
+ thickness: 10,
35
+ "aria-label": "main progress bar"
36
+ })]
37
+ });
38
+ }
39
+ SmallCircleProgress.propTypes = {
40
+ value: PropTypes.number.isRequired,
41
+ size: PropTypes.number,
42
+ style: PropTypes.object
43
+ };
44
+ SmallCircleProgress.defaultProps = {
45
+ size: 10,
46
+ style: {}
47
+ };
48
+ const Content = styled.span`
49
+ display: inline-block;
50
+ position: relative;
51
+ > * {
52
+ position: absolute;
53
+ left: 0;
54
+ top: 0;
55
+ width: 100%;
56
+ height: 100%;
57
+ }
58
+ `;
@@ -0,0 +1,11 @@
1
+ import { useTheme } from '@mui/material/styles';
2
+ import useMediaQuery from '@mui/material/useMediaQuery';
3
+ const MOBILE_POINT = 'md';
4
+ function useMobile() {
5
+ const theme = useTheme();
6
+ return {
7
+ isMobile: useMediaQuery(theme.breakpoints.down(MOBILE_POINT)),
8
+ mobileSize: `${theme.breakpoints.values[MOBILE_POINT]}px`
9
+ };
10
+ }
11
+ export default useMobile;
package/es/util.js ADDED
@@ -0,0 +1,15 @@
1
+ const getFromQuery = name => {
2
+ try {
3
+ const {
4
+ search
5
+ } = window.location;
6
+ const params = new URLSearchParams(search);
7
+ return params.get(name);
8
+ } catch (error) {
9
+ console.error(error);
10
+ return '';
11
+ }
12
+ };
13
+
14
+ // eslint-disable-next-line import/prefer-default-export
15
+ export { getFromQuery };
@@ -10,8 +10,8 @@ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularPr
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  const _excluded = ["children", "loading"];
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
15
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
16
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
17
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
@@ -12,8 +12,8 @@ var _templateObject;
12
12
  const _excluded = ["children", "checked", "checkIconSize", "className"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
17
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
18
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
19
19
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
@@ -13,8 +13,8 @@ var _templateObject;
13
13
  const _excluded = ["steps", "stepIndex", "autoGrowth"]; // autoGrowth 逐渐增长到相应步骤所需的时间
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
20
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
@@ -12,8 +12,8 @@ var _templateObject;
12
12
  const _excluded = ["value", "size", "style"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
17
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
18
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
19
19
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-ux",
3
- "version": "2.1.108",
3
+ "version": "2.2.1",
4
4
  "description": "Launcher UX lib",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,6 +14,7 @@
14
14
  "license": "ISC",
15
15
  "main": "lib/index.js",
16
16
  "files": [
17
+ "es",
17
18
  "lib",
18
19
  "LICENSE",
19
20
  "package.json",
@@ -26,8 +27,13 @@
26
27
  "scripts": {
27
28
  "lint": "eslint src",
28
29
  "lint:fix": "npm run lint -- --fix",
29
- "build": "rm -rf lib && babel src --out-dir lib --copy-files",
30
- "watch": "babel src --out-dir lib -w --copy-files",
30
+ "build": "npm run build:lib && npm run build:es && npm run autoexports",
31
+ "build:lib": "babel src --out-dir lib --copy-files --no-copy-ignored",
32
+ "build:es": "babel --config-file ./babel.config.es.js src --out-dir es --copy-files --no-copy-ignored",
33
+ "autoexports": "node tools/auto-exports.js",
34
+ "watch": "npm run watch:lib && npm run watch:es && npm run autoexports",
35
+ "watch:lib": "babel src --out-dir lib -w --copy-files",
36
+ "watch:es": "babel --config-file ./babel.config.es.js src --out-dir lib -w --copy-files",
31
37
  "prepublish": "npm run build"
32
38
  },
33
39
  "bugs": {
@@ -43,7 +49,8 @@
43
49
  "@babel/preset-env": "^7.22.10",
44
50
  "@babel/preset-react": "^7.22.5",
45
51
  "@storybook/react": "^6.5.16",
46
- "babel-plugin-inline-react-svg": "^2.0.2"
52
+ "babel-plugin-inline-react-svg": "^2.0.2",
53
+ "glob": "^10.3.3"
47
54
  },
48
55
  "dependencies": {
49
56
  "@arcblock/ux": "^2.7.12",
@@ -51,5 +58,35 @@
51
58
  "@mui/icons-material": "^5.14.3",
52
59
  "@mui/material": "^5.14.5"
53
60
  },
54
- "gitHead": "a2a519e3d28fed2860a83c2d108133d29f63ee53"
61
+ "exports": {
62
+ ".": {
63
+ "import": "./es/index.js",
64
+ "require": "./lib/index.js"
65
+ },
66
+ "./lib/": {
67
+ "import": "./es/",
68
+ "require": "./lib/"
69
+ },
70
+ "./lib/button": {
71
+ "import": "./es/button/index.js",
72
+ "require": "./lib/button/index.js"
73
+ },
74
+ "./lib/check-box": {
75
+ "import": "./es/check-box/index.js",
76
+ "require": "./lib/check-box/index.js"
77
+ },
78
+ "./lib/progress-message": {
79
+ "import": "./es/progress-message/index.js",
80
+ "require": "./lib/progress-message/index.js"
81
+ },
82
+ "./lib/small-circle-progress": {
83
+ "import": "./es/small-circle-progress/index.js",
84
+ "require": "./lib/small-circle-progress/index.js"
85
+ },
86
+ "./lib/use-mobile": {
87
+ "import": "./es/use-mobile/index.js",
88
+ "require": "./lib/use-mobile/index.js"
89
+ }
90
+ },
91
+ "gitHead": "e32f5ee5a9163b6051e65140afd39d7eb6eb8a9b"
55
92
  }