@pisell/common 0.0.8 → 0.0.9

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 (43) hide show
  1. package/es/components/EditorPreview/index.d.ts +5 -0
  2. package/es/components/EditorPreview/index.js +14 -0
  3. package/es/components/EditorPreview/index.less +81 -0
  4. package/es/components/agreement/Detail/index.d.ts +3 -0
  5. package/es/components/agreement/Detail/index.js +77 -0
  6. package/es/components/agreement/Detail/serve.d.ts +1 -0
  7. package/es/components/agreement/Detail/serve.js +6 -0
  8. package/es/components/agreement/index.d.ts +11 -0
  9. package/es/components/agreement/index.js +45 -0
  10. package/es/components/agreement/index.less +20 -0
  11. package/es/components/configProvider/index.d.ts +5 -1
  12. package/es/components/configProvider/index.js +4 -1
  13. package/es/components/datePicker/index.d.ts +10 -0
  14. package/es/components/datePicker/index.js +17 -0
  15. package/es/components/index.d.ts +8 -0
  16. package/es/components/index.js +4 -0
  17. package/es/components/select/index.d.ts +5 -0
  18. package/es/components/select/index.js +12 -0
  19. package/es/config/index.d.ts +14 -2
  20. package/es/config/request.d.ts +7 -0
  21. package/es/config/request.js +67 -0
  22. package/lib/components/EditorPreview/index.d.ts +5 -0
  23. package/lib/components/EditorPreview/index.js +37 -0
  24. package/lib/components/EditorPreview/index.less +81 -0
  25. package/lib/components/agreement/Detail/index.d.ts +3 -0
  26. package/lib/components/agreement/Detail/index.js +86 -0
  27. package/lib/components/agreement/Detail/serve.d.ts +1 -0
  28. package/lib/components/agreement/Detail/serve.js +30 -0
  29. package/lib/components/agreement/index.d.ts +11 -0
  30. package/lib/components/agreement/index.js +82 -0
  31. package/lib/components/agreement/index.less +20 -0
  32. package/lib/components/configProvider/index.d.ts +5 -1
  33. package/lib/components/configProvider/index.js +21 -2
  34. package/lib/components/datePicker/index.d.ts +10 -0
  35. package/lib/components/datePicker/index.js +31 -0
  36. package/lib/components/index.d.ts +8 -0
  37. package/lib/components/index.js +12 -0
  38. package/lib/components/select/index.d.ts +5 -0
  39. package/lib/components/select/index.js +31 -0
  40. package/lib/config/index.d.ts +14 -2
  41. package/lib/config/request.d.ts +7 -0
  42. package/lib/config/request.js +76 -0
  43. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare type EditorPreivewProps = React.HTMLAttributes<any>;
4
+ declare const EditorPreivew: React.FC<EditorPreivewProps>;
5
+ export default EditorPreivew;
@@ -0,0 +1,14 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ import "./index.less";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ var EditorPreivew = function EditorPreivew(props) {
10
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, props), {}, {
11
+ className: "pisell-editor-tiny-css ".concat(props.className)
12
+ }));
13
+ };
14
+ export default EditorPreivew;
@@ -0,0 +1,81 @@
1
+ .pisell-editor-tiny-css {
2
+ // white-space: pre-wrap;
3
+ word-break: break-word;
4
+
5
+ img {
6
+ vertical-align: baseline;
7
+ object-fit: contain;
8
+ max-width: 100%;
9
+ height: auto;
10
+ }
11
+
12
+ div {
13
+ white-space: normal;
14
+ }
15
+
16
+ p {
17
+ color: #000;
18
+ font-size: 16px;
19
+ margin-bottom: 1em;
20
+ }
21
+
22
+ table {
23
+ border-collapse: collapse;
24
+ }
25
+
26
+ table:not([cellpadding]) td,
27
+ table:not([cellpadding]) th {
28
+ padding: 0.4rem;
29
+ }
30
+
31
+ table[border]:not([border='0']):not([style*='border-width']) td,
32
+ table[border]:not([border='0']):not([style*='border-width']) th {
33
+ border-width: 1px;
34
+ }
35
+
36
+ table[border]:not([border='0']):not([style*='border-style']) td,
37
+ table[border]:not([border='0']):not([style*='border-style']) th {
38
+ border-style: solid;
39
+ }
40
+
41
+ table[border]:not([border='0']):not([style*='border-color']) td,
42
+ table[border]:not([border='0']):not([style*='border-color']) th {
43
+ border-color: #ccc;
44
+ }
45
+
46
+ figure {
47
+ display: table;
48
+ margin: 1rem auto;
49
+ }
50
+
51
+ figure figcaption {
52
+ color: #999;
53
+ display: block;
54
+ margin-top: 0.25rem;
55
+ text-align: center;
56
+ }
57
+
58
+ hr {
59
+ border-color: #ccc;
60
+ border-style: solid;
61
+ border-width: 1px 0 0;
62
+ }
63
+
64
+ code {
65
+ background-color: #e8e8e8;
66
+ border-radius: 3px;
67
+ padding: 0.1rem 0.2rem;
68
+ }
69
+
70
+ blockquote {
71
+ border-left: 2px solid #ccc;
72
+ margin-left: 1.5rem;
73
+ padding-left: 1rem;
74
+ }
75
+
76
+ // blockquote {
77
+ // border-right: 2px solid #ccc;
78
+ // margin-right: 1.5rem;
79
+ // padding-right: 1rem
80
+ // }
81
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
3
+ export default _default;
@@ -0,0 +1,77 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
14
+ import { useRequest } from 'ahooks';
15
+ import { Spin } from 'antd5';
16
+ import { forwardRef, useImperativeHandle, useMemo, useState } from 'react';
17
+ import { useModal } from "../../../business-hooks";
18
+ import EditorPreview from "../../EditorPreview";
19
+ import { getPolicyDetail } from "./serve";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ var AgreementDetail = function AgreementDetail(_ref, ref) {
22
+ _objectDestructuringEmpty(_ref);
23
+ var _useState = useState({}),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ data = _useState2[0],
26
+ setData = _useState2[1];
27
+ var _useState3 = useState(null),
28
+ _useState4 = _slicedToArray(_useState3, 2),
29
+ current = _useState4[0],
30
+ setCurrent = _useState4[1];
31
+ var _getPolicyDetail = useRequest(getPolicyDetail, {
32
+ manual: true,
33
+ formatResult: function formatResult(res) {
34
+ return res.data;
35
+ },
36
+ onSuccess: function onSuccess(res) {
37
+ setData(_objectSpread(_objectSpread({}, data), {}, _defineProperty({}, res.id, res)));
38
+ }
39
+ });
40
+ var detail = useMemo(function () {
41
+ if (current) {
42
+ return data[current] || {};
43
+ }
44
+ return {};
45
+ }, [data, current]);
46
+ var _useModal = useModal({
47
+ title: detail.title,
48
+ children: /*#__PURE__*/_jsx(Spin, {
49
+ spinning: _getPolicyDetail.loading,
50
+ children: /*#__PURE__*/_jsx("div", {
51
+ style: {
52
+ minHeight: 400
53
+ },
54
+ children: /*#__PURE__*/_jsx(EditorPreview, {
55
+ dangerouslySetInnerHTML: {
56
+ __html: detail.content
57
+ }
58
+ })
59
+ })
60
+ })
61
+ }),
62
+ showModal = _useModal.showModal,
63
+ content = _useModal.content;
64
+ useImperativeHandle(ref, function () {
65
+ return {
66
+ open: function open(item) {
67
+ setCurrent(item.id);
68
+ if (!data[item.id]) {
69
+ _getPolicyDetail.run(item.id);
70
+ }
71
+ showModal();
72
+ }
73
+ };
74
+ });
75
+ return content;
76
+ };
77
+ export default /*#__PURE__*/forwardRef(AgreementDetail);
@@ -0,0 +1 @@
1
+ export declare const getPolicyDetail: (id: string) => Promise<any>;
@@ -0,0 +1,6 @@
1
+ import { get } from "../../../config/request";
2
+
3
+ // 协议详情
4
+ export var getPolicyDetail = function getPolicyDetail(id) {
5
+ return get("/shop/policy/" + id);
6
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface AgreementProps {
4
+ value?: 1 | 0;
5
+ onChange?: (data: 1 | 0) => void;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ agreements?: any[];
9
+ }
10
+ declare const Agreement: React.FC<AgreementProps>;
11
+ export default Agreement;
@@ -0,0 +1,45 @@
1
+ import { Checkbox } from 'antd5';
2
+ import classNames from 'classnames';
3
+ import React, { useMemo, useRef } from 'react';
4
+ import AgreementDetail from "./Detail";
5
+ import "./index.less";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ var Agreement = function Agreement(_ref) {
9
+ var className = _ref.className,
10
+ style = _ref.style,
11
+ value = _ref.value,
12
+ _onChange = _ref.onChange,
13
+ agreements = _ref.agreements;
14
+ var detailRef = useRef();
15
+ var onRead = function onRead(item) {
16
+ detailRef.current.open(item);
17
+ };
18
+ var _agreements = useMemo(function () {
19
+ return agreements === null || agreements === void 0 ? void 0 : agreements.map(function (item) {
20
+ return /*#__PURE__*/_jsx("a", {
21
+ className: "pisell-agreement",
22
+ onClick: function onClick(e) {
23
+ e.preventDefault();
24
+ e.stopPropagation();
25
+ onRead(item);
26
+ },
27
+ children: item.title
28
+ }, item.id);
29
+ });
30
+ }, [agreements]);
31
+ return /*#__PURE__*/_jsxs("div", {
32
+ className: classNames('pisell-agreements', className),
33
+ style: style,
34
+ children: [/*#__PURE__*/_jsxs(Checkbox, {
35
+ value: value,
36
+ onChange: function onChange(e) {
37
+ _onChange && _onChange(e.target.value);
38
+ },
39
+ children: ["\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F ", _agreements]
40
+ }), /*#__PURE__*/_jsx(AgreementDetail, {
41
+ ref: detailRef
42
+ })]
43
+ });
44
+ };
45
+ export default Agreement;
@@ -0,0 +1,20 @@
1
+ //.pisell-agreements {
2
+ //}
3
+
4
+ .pisell-agreement {
5
+ margin-right: 8px;
6
+
7
+ &::after {
8
+ content: ',';
9
+ color: #000;
10
+ }
11
+
12
+ &:last-child {
13
+ margin-right: 0;
14
+
15
+ &::after {
16
+ content: '.';
17
+ color: #000;
18
+ }
19
+ }
20
+ }
@@ -1,4 +1,7 @@
1
1
  import { ConfigProvider } from 'antd5';
2
+ import enUS from 'antd5/locale/en_US';
3
+ import zhCN from 'antd5/locale/zh_CN';
4
+ import zhTW from 'antd5/locale/zh_TW';
2
5
  declare const cssVariableMap: {
3
6
  /** 白色 - White */
4
7
  '--color-white': string;
@@ -106,4 +109,5 @@ declare const defaultTheme: {
106
109
  colorTextBase: string;
107
110
  };
108
111
  };
109
- export { ConfigProvider, defaultTheme, cssVariableMap };
112
+ export type { Locale } from 'antd/es/locale';
113
+ export { ConfigProvider, defaultTheme, cssVariableMap, enUS, zhCN, zhTW };
@@ -1,4 +1,7 @@
1
1
  import { ConfigProvider } from 'antd5';
2
+ import enUS from 'antd5/locale/en_US';
3
+ import zhCN from 'antd5/locale/zh_CN';
4
+ import zhTW from 'antd5/locale/zh_TW';
2
5
 
3
6
  // css变量
4
7
  var cssVariableMap = {
@@ -108,4 +111,4 @@ var defaultTheme = {
108
111
  colorTextBase: '#1b1b1b'
109
112
  }
110
113
  };
111
- export { ConfigProvider, defaultTheme, cssVariableMap };
114
+ export { ConfigProvider, defaultTheme, cssVariableMap, enUS, zhCN, zhTW };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { DatePickerProps as AntDatePickerProps } from 'antd5';
3
+ export declare type DatePickerProps = AntDatePickerProps;
4
+ /**
5
+ * 日期选择框
6
+ * @param props
7
+ * @constructor
8
+ */
9
+ declare const DatePicker: (props: DatePickerProps) => JSX.Element;
10
+ export default DatePicker;
@@ -0,0 +1,17 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ import { DatePicker as AntDatePicker } from 'antd5';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ /**
10
+ * 日期选择框
11
+ * @param props
12
+ * @constructor
13
+ */
14
+ var DatePicker = function DatePicker(props) {
15
+ return /*#__PURE__*/_jsx(AntDatePicker, _objectSpread({}, props));
16
+ };
17
+ export default DatePicker;
@@ -1,3 +1,5 @@
1
+ export { default as Agreement } from './agreement';
2
+ export type { AgreementProps } from './agreement';
1
3
  export { default as Avatar } from './avatar';
2
4
  export type { AvatarProps } from './avatar';
3
5
  export { default as Button } from './button';
@@ -9,14 +11,20 @@ export type { CheckboxGroupProps, CheckboxProps } from './checkbox';
9
11
  export { default as ColorPicker } from './ColorPicker';
10
12
  export type { ColorPickerProps } from './ColorPicker';
11
13
  export * from './configProvider';
14
+ export { default as DatePicker } from './datePicker';
15
+ export type { DatePickerProps } from './datePicker';
12
16
  export { default as DragSort } from './DragSort';
13
17
  export { default as IconFont } from './Iconfont';
14
18
  export type { IconFontProps } from './Iconfont';
15
19
  export { default as Input } from './input';
16
20
  export type { GroupProps, InputProps, PasswordProps, SearchProps, TextAreaProps, } from './input';
21
+ export { default as InputNumber } from './inputNumber';
22
+ export type { InputNumberProps } from './inputNumber';
17
23
  export { default as Pagination } from './pagination';
18
24
  export type { PaginationProps } from './pagination';
19
25
  export { default as Radio } from './radio';
20
26
  export type { RadioGroupProps, RadioProps } from './radio';
27
+ export { default as Select } from './select';
28
+ export type { SelectProps } from './select';
21
29
  export { default as Switch } from './switch';
22
30
  export type { SwitchProps } from './switch';
@@ -1,12 +1,16 @@
1
+ export { default as Agreement } from "./agreement";
1
2
  export { default as Avatar } from "./avatar";
2
3
  export { default as Button } from "./button";
3
4
  export { default as Card } from "./card";
4
5
  export { default as Checkbox } from "./checkbox";
5
6
  export { default as ColorPicker } from "./ColorPicker";
6
7
  export * from "./configProvider";
8
+ export { default as DatePicker } from "./datePicker";
7
9
  export { default as DragSort } from "./DragSort";
8
10
  export { default as IconFont } from "./Iconfont";
9
11
  export { default as Input } from "./input";
12
+ export { default as InputNumber } from "./inputNumber";
10
13
  export { default as Pagination } from "./pagination";
11
14
  export { default as Radio } from "./radio";
15
+ export { default as Select } from "./select";
12
16
  export { default as Switch } from "./switch";
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { SelectProps as AntSelectProps } from 'antd5';
3
+ export declare type SelectProps = AntSelectProps;
4
+ declare const Select: (props: SelectProps) => JSX.Element;
5
+ export default Select;
@@ -0,0 +1,12 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ import { Select as AntSelect } from 'antd5';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ var Select = function Select(props) {
10
+ return /*#__PURE__*/_jsx(AntSelect, _objectSpread({}, props));
11
+ };
12
+ export default Select;
@@ -1,4 +1,4 @@
1
- declare type PisellConfigType = {
1
+ export declare type PisellConfigType = {
2
2
  ENV: {
3
3
  host: string;
4
4
  socket: string;
@@ -10,7 +10,19 @@ declare type PisellConfigType = {
10
10
  appCenter: string;
11
11
  static: string;
12
12
  };
13
+ /** 当前主项目类型 */
14
+ platform: 'shop' | string;
15
+ /** 包内请求 由主项目注入 */
16
+ request: {
17
+ get: RequestMethod;
18
+ post: RequestMethod;
19
+ put: RequestMethod;
20
+ remove: RequestMethod;
21
+ request: RequestMethod;
22
+ };
13
23
  };
24
+ export interface RequestMethod {
25
+ <T = any>(url: string, data?: Record<string, any>, config?: any): Promise<T>;
26
+ }
14
27
  export declare const initConfig: (options: PisellConfigType) => void;
15
28
  export declare const getConfig: () => PisellConfigType;
16
- export {};
@@ -0,0 +1,7 @@
1
+ import { RequestMethod } from './index';
2
+ declare const get: RequestMethod;
3
+ declare const post: RequestMethod;
4
+ declare const put: RequestMethod;
5
+ declare const remove: RequestMethod;
6
+ declare const request: RequestMethod;
7
+ export { get, post, put, remove, request };
@@ -0,0 +1,67 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import { getConfig } from "./index";
6
+ var importRequest = function () {
7
+ var request = null;
8
+ return function () {
9
+ if (request) {
10
+ return request;
11
+ }
12
+ var _getConfig = getConfig();
13
+ request = _getConfig.request;
14
+ return request;
15
+ };
16
+ }();
17
+ var defaultFunction = /*#__PURE__*/function () {
18
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
19
+ var _console;
20
+ var _len,
21
+ arg,
22
+ _key,
23
+ _args = arguments;
24
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
25
+ while (1) switch (_context.prev = _context.next) {
26
+ case 0:
27
+ for (_len = _args.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
28
+ arg[_key] = _args[_key];
29
+ }
30
+ (_console = console).log.apply(_console, ['请先初始化request配置'].concat(arg));
31
+ return _context.abrupt("return", '');
32
+ case 3:
33
+ case "end":
34
+ return _context.stop();
35
+ }
36
+ }, _callee);
37
+ }));
38
+ return function defaultFunction() {
39
+ return _ref.apply(this, arguments);
40
+ };
41
+ }();
42
+ var get = function get() {
43
+ var _importRequest;
44
+ var func = ((_importRequest = importRequest()) === null || _importRequest === void 0 ? void 0 : _importRequest.get) || defaultFunction;
45
+ return func.apply(void 0, arguments);
46
+ };
47
+ var post = function post() {
48
+ var _importRequest2;
49
+ var func = ((_importRequest2 = importRequest()) === null || _importRequest2 === void 0 ? void 0 : _importRequest2.post) || defaultFunction;
50
+ return func.apply(void 0, arguments);
51
+ };
52
+ var put = function put() {
53
+ var _importRequest3;
54
+ var func = ((_importRequest3 = importRequest()) === null || _importRequest3 === void 0 ? void 0 : _importRequest3.put) || defaultFunction;
55
+ return func.apply(void 0, arguments);
56
+ };
57
+ var remove = function remove() {
58
+ var _importRequest4;
59
+ var func = ((_importRequest4 = importRequest()) === null || _importRequest4 === void 0 ? void 0 : _importRequest4.remove) || defaultFunction;
60
+ return func.apply(void 0, arguments);
61
+ };
62
+ var request = function request() {
63
+ var _importRequest5;
64
+ var func = ((_importRequest5 = importRequest()) === null || _importRequest5 === void 0 ? void 0 : _importRequest5.request) || defaultFunction;
65
+ return func.apply(void 0, arguments);
66
+ };
67
+ export { get, post, put, remove, request };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare type EditorPreivewProps = React.HTMLAttributes<any>;
4
+ declare const EditorPreivew: React.FC<EditorPreivewProps>;
5
+ export default EditorPreivew;
@@ -0,0 +1,37 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/EditorPreview/index.tsx
20
+ var EditorPreview_exports = {};
21
+ __export(EditorPreview_exports, {
22
+ default: () => EditorPreview_default
23
+ });
24
+ module.exports = __toCommonJS(EditorPreview_exports);
25
+ var import_index = require("./index.less");
26
+ var EditorPreivew = (props) => {
27
+ return /* @__PURE__ */ React.createElement(
28
+ "div",
29
+ {
30
+ ...props,
31
+ className: `pisell-editor-tiny-css ${props.className}`
32
+ }
33
+ );
34
+ };
35
+ var EditorPreview_default = EditorPreivew;
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {});