From 09fbab9ba9085c65b6ce0ebb46388bd0592882ae Mon Sep 17 00:00:00 2001
From: dbwcooper
Date: Tue, 7 Sep 2021 19:55:52 +0800
Subject: [PATCH] feat: add lib config
---
.github/workflows/main.yml | 4 +-
.npmignore | 9 +
lib/esm/index.js | 233 +++++
lib/esm/index.js.map | 7 +
lib/iife/index.js | 244 +++++
lib/iife/index.js.map | 7 +
lib/index.d.ts | 39 +
lib/index.js | 257 ++++++
lib/index.js.map | 7 +
package.json | 35 +-
src/components/MatchContext.tsx | 3 +-
src/components/{Types.ts => Types.d.ts} | 0
src/components/{index.tsx => index.ts} | 0
src/pages/Home.tsx | 4 +-
src/pages/Search.tsx | 2 +-
tsconfig.json | 4 +-
tsup.config.ts | 12 +
vite.config.ts | 35 +-
yarn.lock | 1127 ++++++++++++++++++++++-
19 files changed, 2010 insertions(+), 19 deletions(-)
create mode 100644 .npmignore
create mode 100644 lib/esm/index.js
create mode 100644 lib/esm/index.js.map
create mode 100644 lib/iife/index.js
create mode 100644 lib/iife/index.js.map
create mode 100644 lib/index.d.ts
create mode 100644 lib/index.js
create mode 100644 lib/index.js.map
rename src/components/{Types.ts => Types.d.ts} (100%)
rename src/components/{index.tsx => index.ts} (100%)
create mode 100644 tsup.config.ts
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6a2b91b..be3adc8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -6,9 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
- branches: [ master ]
+ branches: [ main ]
pull_request:
- branches: [ master ]
+ branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..cf47655
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,9 @@
+node_modules
+.DS_Store
+dist
+dist-ssr
+*.local
+.vscode
+.github
+index.html
+vite.config.ts
\ No newline at end of file
diff --git a/lib/esm/index.js b/lib/esm/index.js
new file mode 100644
index 0000000..ec0c1af
--- /dev/null
+++ b/lib/esm/index.js
@@ -0,0 +1,233 @@
+var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+var __getOwnPropSymbols = Object.getOwnPropertySymbols;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __propIsEnum = Object.prototype.propertyIsEnumerable;
+var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __spreadValues = (a, b) => {
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+};
+var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+
+// src/components/MatchContext.tsx
+import React, {
+ useReducer,
+ useCallback,
+ createContext,
+ useEffect,
+ useMemo
+} from "react";
+
+// src/components/Types.d.ts
+var IActionTypes;
+(function(IActionTypes2) {
+ IActionTypes2["setSearchValue"] = "setSearchValue";
+ IActionTypes2["setActiveMatch"] = "setActiveMatch";
+ IActionTypes2["setMatchList"] = "setMatchList";
+})(IActionTypes || (IActionTypes = {}));
+
+// src/components/MatchContext.tsx
+var scrollToView = (id, fixHeaderHeight = 0) => {
+ const dom = document.getElementById(id);
+ if (dom) {
+ const topOfElement = dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;
+ window.scroll({
+ top: topOfElement,
+ behavior: "smooth"
+ });
+ }
+};
+var defaultStore = {
+ searchValue: "",
+ totalCount: 0,
+ activeCount: 0,
+ activeId: "",
+ matchedList: []
+};
+var searchEventStore = {
+ onSearchChange: (event) => {
+ },
+ onPrev: () => {
+ },
+ onNext: () => {
+ },
+ onUpdateMatchList: (initialList) => {
+ }
+};
+var SearchContext = createContext(defaultStore);
+var SearchEventContext = createContext(searchEventStore);
+var reducer = (state, action) => {
+ if (action.type === IActionTypes.setSearchValue) {
+ return __spreadProps(__spreadValues({}, state), {
+ searchValue: action.payload.searchValue
+ });
+ }
+ if (action.type === IActionTypes.setActiveMatch) {
+ return __spreadProps(__spreadValues({}, state), {
+ activeId: action.payload.activeId,
+ activeCount: action.payload.activeCount
+ });
+ }
+ if (action.type === IActionTypes.setMatchList) {
+ return __spreadProps(__spreadValues({}, state), {
+ matchedList: action.payload
+ });
+ }
+ return state;
+};
+var SearchProvider = (props) => {
+ var _a;
+ const [store, dispatch] = useReducer(reducer, defaultStore);
+ const activeCount = store.activeCount;
+ const totalCount = (_a = store.matchedList) == null ? void 0 : _a.length;
+ const onSearchChange = useCallback((e) => {
+ const searchValue = e.target.value;
+ dispatch({ type: IActionTypes.setSearchValue, payload: { searchValue } });
+ }, []);
+ const onPrev = useCallback((fixedHeight) => {
+ if (activeCount > 0) {
+ let prevActiveCount = activeCount - 1 < 1 ? store.matchedList.length : activeCount - 1;
+ let matchIndex = prevActiveCount - 1;
+ let prevActiveId = store.matchedList[matchIndex].id;
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: { activeId: prevActiveId, activeCount: prevActiveCount }
+ });
+ scrollToView(prevActiveId, fixedHeight);
+ }
+ }, [activeCount, totalCount]);
+ const onNext = useCallback((fixedHeight) => {
+ if (activeCount > 0) {
+ let nextActiveCount = activeCount + 1 > store.matchedList.length ? 1 : activeCount + 1;
+ let matchIndex = nextActiveCount - 1;
+ let nextActiveId = store.matchedList[matchIndex].id;
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: { activeId: nextActiveId, activeCount: nextActiveCount }
+ });
+ scrollToView(nextActiveId, fixedHeight);
+ }
+ }, [activeCount, totalCount]);
+ const onUpdateMatchList = useMemo((initialList = []) => (matchList = []) => {
+ initialList = initialList.concat(matchList);
+ dispatch({ type: IActionTypes.setMatchList, payload: initialList });
+ }, [store.searchValue]);
+ useEffect(() => {
+ if (store.matchedList.length > 0) {
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: {
+ activeId: store.matchedList[0].id,
+ activeCount: 1
+ }
+ });
+ }
+ }, [store.matchedList]);
+ return /* @__PURE__ */ React.createElement(SearchContext.Provider, {
+ value: __spreadProps(__spreadValues({}, store), {
+ totalCount
+ })
+ }, /* @__PURE__ */ React.createElement(SearchEventContext.Provider, {
+ value: {
+ onSearchChange,
+ onUpdateMatchList,
+ onPrev,
+ onNext
+ }
+ }, props.children));
+};
+
+// src/components/MatchText.tsx
+import React2, { useContext, useMemo as useMemo2, useLayoutEffect } from "react";
+var MARK = "__$CTRL_F$__";
+function escapeStr(str) {
+ return `${str}`.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
+}
+function getMatchId(prefixId, index) {
+ return `${prefixId}_${index}`;
+}
+function getMatchText(keyword, text) {
+ let keywordStr = keyword;
+ let textStr = text;
+ if (typeof keyword === "number") {
+ keywordStr = `${keyword}`;
+ }
+ if (typeof text === "number") {
+ textStr = `${text}`;
+ }
+ if (typeof keywordStr !== "string" || !keywordStr.trim() || typeof textStr !== "string" || !textStr.trim() || !textStr.toLowerCase().includes(keywordStr.toLowerCase())) {
+ return text;
+ }
+ const regexp = new RegExp(escapeStr(keywordStr), "gi");
+ const matches = [];
+ const textWithMark = textStr.replace(regexp, (match) => {
+ matches.push(match);
+ return MARK;
+ });
+ const slices = textWithMark.split(MARK);
+ const data = {
+ slices,
+ matches
+ };
+ return data;
+}
+var MatchText = (data) => {
+ let textStr = data.text;
+ const id = data.id;
+ if (typeof data.children === "string") {
+ textStr = data.children;
+ }
+ if (!textStr) {
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, textStr);
+ }
+ const { searchValue, activeId } = useContext(SearchContext);
+ const { onUpdateMatchList } = useContext(SearchEventContext);
+ const matchData = useMemo2(() => getMatchText(searchValue, textStr), [searchValue]);
+ useLayoutEffect(() => {
+ if (typeof matchData === "object") {
+ const matchIds = matchData.matches.map((_, index) => ({
+ id: getMatchId(id, index),
+ idCount: index
+ }));
+ onUpdateMatchList(matchIds);
+ }
+ }, [matchData]);
+ if (typeof matchData === "string") {
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, matchData);
+ }
+ const slicesLen = matchData.slices.length - 1;
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, matchData.slices.map((slice, index) => {
+ if (index === slicesLen) {
+ return slice;
+ }
+ const matchId = getMatchId(id, index);
+ const color = matchId === activeId ? "#ff9632" : "#ffff00";
+ const matchStr = matchData.matches[index];
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, {
+ key: index
+ }, slice, /* @__PURE__ */ React2.createElement("span", {
+ id: matchId,
+ style: {
+ backgroundColor: color,
+ display: "inline-block",
+ whiteSpace: "pre-wrap"
+ }
+ }, matchStr));
+ }));
+};
+export {
+ MatchText,
+ SearchContext,
+ SearchEventContext,
+ SearchProvider
+};
+//# sourceMappingURL=index.js.map
diff --git a/lib/esm/index.js.map b/lib/esm/index.js.map
new file mode 100644
index 0000000..ae3eeeb
--- /dev/null
+++ b/lib/esm/index.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../src/components/MatchContext.tsx", "../../src/components/Types.d.ts", "../../src/components/MatchText.tsx"],
+ "sourcesContent": ["import React, {\n useReducer,\n useCallback,\n createContext,\n useEffect,\n useMemo,\n} from 'react';\n\nimport {\n EventContextProps,\n MatchObjectProps,\n IState,\n IActions,\n IActionTypes,\n} from './Types.d';\n\nexport const scrollToView = (id: string, fixHeaderHeight: number = 0) => {\n const dom = document.getElementById(id);\n if (dom) {\n const topOfElement =\n dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;\n window.scroll({\n top: topOfElement,\n behavior: 'smooth',\n });\n }\n};\n\nconst defaultStore: IState = {\n searchValue: '',\n totalCount: 0,\n\n activeCount: 0, // \u5F53\u524D\u9009\u4E2D count, \u5C0F\u4E8E\u7B49\u4E8E totalCount\n activeId: '', // \u5F53\u524D\u9009\u4E2D\u7684 \u6587\u672C \u5BF9\u5E94\u7684 id\n matchedList: [],\n};\n\nconst searchEventStore: EventContextProps = {\n onSearchChange: (\n event: React.ChangeEvent\n ) => {},\n onPrev: () => {},\n onNext: () => {},\n onUpdateMatchList: (initialList: MatchObjectProps[]) => {},\n};\n\nexport const SearchContext = createContext(defaultStore);\nexport const SearchEventContext = createContext(searchEventStore);\n\nconst reducer = (state: IState, action: IActions): IState => {\n if (action.type === IActionTypes.setSearchValue) {\n return {\n ...state,\n searchValue: action.payload.searchValue,\n };\n }\n\n if (action.type === IActionTypes.setActiveMatch) {\n return {\n ...state,\n activeId: action.payload.activeId,\n activeCount: action.payload.activeCount,\n };\n }\n if (action.type === IActionTypes.setMatchList) {\n return {\n ...state,\n matchedList: action.payload,\n };\n }\n return state;\n};\n\nexport const SearchProvider = (props: { children: React.ReactNode }) => {\n const [store, dispatch] = useReducer(reducer, defaultStore);\n\n const activeCount = store.activeCount;\n const totalCount = store.matchedList?.length;\n const onSearchChange = useCallback((e) => {\n const searchValue = e.target.value;\n dispatch({ type: IActionTypes.setSearchValue, payload: { searchValue } });\n }, []);\n\n // \u8BA1\u7B97\u524D\u4E00\u4E2A match\n const onPrev = useCallback(\n (fixedHeight) => {\n // prevCount \u4E3A 0 \u5219\u8BF4\u660E totalCount \u4E5F\u662F 0, \u8FD9\u79CD\u60C5\u51B5\u4E0D\u5904\u7406\u3002\n if (activeCount > 0) {\n let prevActiveCount =\n activeCount - 1 < 1 ? store.matchedList.length : activeCount - 1;\n let matchIndex = prevActiveCount - 1;\n let prevActiveId = store.matchedList[matchIndex].id;\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: { activeId: prevActiveId, activeCount: prevActiveCount },\n });\n scrollToView(prevActiveId, fixedHeight);\n }\n },\n [activeCount, totalCount]\n );\n\n // \u8BA1\u7B97\u540E\u4E00\u4E2A match\n const onNext = useCallback(\n (fixedHeight) => {\n if (activeCount > 0) {\n let nextActiveCount =\n activeCount + 1 > store.matchedList.length ? 1 : activeCount + 1;\n let matchIndex = nextActiveCount - 1;\n let nextActiveId = store.matchedList[matchIndex].id;\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: { activeId: nextActiveId, activeCount: nextActiveCount },\n });\n scrollToView(nextActiveId, fixedHeight);\n }\n },\n [activeCount, totalCount]\n );\n\n const onUpdateMatchList = useMemo(\n (initialList: MatchObjectProps[] = []) =>\n (matchList: MatchObjectProps[] = []) => {\n // \u7F13\u5B58 initialList\n initialList = initialList.concat(matchList);\n dispatch({ type: IActionTypes.setMatchList, payload: initialList });\n },\n [store.searchValue]\n );\n\n useEffect(() => {\n // \u8BA1\u7B97\u5B8C\u6240\u6709 Match Component \u4E4B\u540E\uFF0C\u8BA1\u7B97 totalCount \u548C activeCount\n if (store.matchedList.length > 0) {\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: {\n activeId: store.matchedList[0].id,\n activeCount: 1,\n },\n });\n }\n }, [store.matchedList]);\n return (\n \n \n {props.children}\n \n \n );\n};\n", "import React from 'react';\n\nexport enum IActionTypes {\n setSearchValue = 'setSearchValue',\n setActiveMatch = 'setActiveMatch',\n setMatchList = 'setMatchList',\n}\n\nexport interface MatchObjectProps {\n id: string;\n idCount: number;\n}\n\nexport interface IState {\n searchValue: string;\n totalCount: number;\n activeCount: number; // \u5F53\u524D\u9009\u4E2D count, \u5C0F\u4E8E\u7B49\u4E8E totalCount\n activeId: string; // \u5F53\u524D\u9009\u4E2D\u7684 \u6587\u672C \u5BF9\u5E94\u7684 id\n matchedList: MatchObjectProps[];\n}\n\nexport interface EventContextProps {\n onSearchChange: (\n event: React.ChangeEvent\n ) => void;\n onNext: (fixHeaderHeight: number) => void;\n onPrev: (fixHeaderHeight: number) => void;\n onUpdateMatchList: (matchedList: MatchObjectProps[]) => void;\n}\n\nexport interface IAction1 {\n type: IActionTypes.setSearchValue;\n payload: {\n searchValue: string;\n };\n}\n\nexport interface IAction2 {\n type: IActionTypes.setActiveMatch;\n payload: {\n activeId: string;\n activeCount: number;\n };\n}\n\nexport interface IAction3 {\n type: IActionTypes.setMatchList;\n payload: MatchObjectProps[];\n}\nexport type IActions = IAction1 | IAction2 | IAction3;\n\nexport interface MatchTextProps {\n id: string;\n text?: string;\n children?: React.ReactChild;\n}\n", "import React, { useContext, useMemo, useLayoutEffect } from 'react';\n\nimport { SearchContext, SearchEventContext } from './MatchContext';\nimport { MatchTextProps } from './Types';\n\nconst MARK = '__$CTRL_F$__';\n\nfunction escapeStr(str: string) {\n return `${str}`.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n}\n\nfunction getMatchId(prefixId: string, index: number) {\n return `${prefixId}_${index}`;\n}\n\nfunction getMatchText(keyword: string, text: string) {\n let keywordStr = keyword;\n let textStr = text;\n if (typeof keyword === 'number') {\n keywordStr = `${keyword}`;\n }\n if (typeof text === 'number') {\n textStr = `${text}`;\n }\n if (\n typeof keywordStr !== 'string' ||\n !keywordStr.trim() ||\n typeof textStr !== 'string' ||\n !textStr.trim() ||\n !textStr.toLowerCase().includes(keywordStr.toLowerCase()) // case insensitive\n ) {\n return text;\n }\n const regexp = new RegExp(escapeStr(keywordStr), 'gi');\n const matches: string[] = []; // save matched string, we will use this to overwrite keywordStr in the result string\n const textWithMark = textStr.replace(regexp, (match) => {\n matches.push(match);\n return MARK;\n });\n const slices = textWithMark.split(MARK);\n const data = {\n slices,\n matches,\n };\n return data;\n}\n\nexport const MatchText = (data: MatchTextProps): React.ReactElement => {\n let textStr = data.text!;\n const id = data.id;\n if (typeof data.children === 'string') {\n textStr = data.children;\n }\n if (!textStr) {\n return <>{textStr}>;\n }\n\n const { searchValue, activeId } = useContext(SearchContext);\n const { onUpdateMatchList } = useContext(SearchEventContext);\n const matchData = useMemo(\n () => getMatchText(searchValue, textStr),\n [searchValue]\n );\n useLayoutEffect(() => {\n if (typeof matchData === 'object') {\n const matchIds = matchData.matches.map((_, index) => ({\n id: getMatchId(id, index),\n idCount: index,\n }));\n onUpdateMatchList(matchIds);\n }\n }, [matchData]);\n\n if (typeof matchData === 'string') {\n return <>{matchData}>;\n }\n const slicesLen = matchData.slices.length - 1;\n return (\n \n {matchData.slices.map((slice, index) => {\n if (index === slicesLen) {\n return slice;\n }\n const matchId = getMatchId(id, index);\n const color = matchId === activeId ? '#ff9632' : '#ffff00';\n const matchStr = matchData.matches[index];\n return (\n \n {slice}\n \n {matchStr}\n \n \n );\n })}\n \n );\n};\n\nexport default MatchText;\n"],
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAK;AAAL,UAAK,eAAL;AACL,oCAAiB;AACjB,oCAAiB;AACjB,kCAAe;AAAA,GAHL;;;ADcL,IAAM,eAAe,CAAC,IAAY,kBAA0B,MAAM;AACvE,QAAM,MAAM,SAAS,eAAe;AACpC,MAAI,KAAK;AACP,UAAM,eACJ,IAAI,wBAAwB,SAAS,OAAO,cAAc;AAC5D,WAAO,OAAO;AAAA,MACZ,KAAK;AAAA,MACL,UAAU;AAAA;AAAA;AAAA;AAKhB,IAAM,eAAuB;AAAA,EAC3B,aAAa;AAAA,EACb,YAAY;AAAA,EAEZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA;AAGf,IAAM,mBAAsC;AAAA,EAC1C,gBAAgB,CACd,UACG;AAAA;AAAA,EACL,QAAQ,MAAM;AAAA;AAAA,EACd,QAAQ,MAAM;AAAA;AAAA,EACd,mBAAmB,CAAC,gBAAoC;AAAA;AAAA;AAGnD,IAAM,gBAAgB,cAAc;AACpC,IAAM,qBAAqB,cAAc;AAEhD,IAAM,UAAU,CAAC,OAAe,WAA6B;AAC3D,MAAI,OAAO,SAAS,aAAa,gBAAgB;AAC/C,WAAO,iCACF,QADE;AAAA,MAEL,aAAa,OAAO,QAAQ;AAAA;AAAA;AAIhC,MAAI,OAAO,SAAS,aAAa,gBAAgB;AAC/C,WAAO,iCACF,QADE;AAAA,MAEL,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,OAAO,KAAK,aAAa,UAAU;AACrC,cAAU,KAAK;AAAA;AAEjB,MAAI,CAAC,SAAS;AACZ,WAAO,4DAAG;AAAA;AAGZ,QAAM,EAAE,aAAa,aAAa,WAAW;AAC7C,QAAM,EAAE,sBAAsB,WAAW;AACzC,QAAM,YAAY,SAChB,MAAM,aAAa,aAAa,UAChC,CAAC;AAEH,kBAAgB,MAAM;AACpB,QAAI,OAAO,cAAc,UAAU;AACjC,YAAM,WAAW,UAAU,QAAQ,IAAI,CAAC,GAAG,UAAW;AAAA,QACpD,IAAI,WAAW,IAAI;AAAA,QACnB,SAAS;AAAA;AAEX,wBAAkB;AAAA;AAAA,KAEnB,CAAC;AAEJ,MAAI,OAAO,cAAc,UAAU;AACjC,WAAO,4DAAG;AAAA;AAEZ,QAAM,YAAY,UAAU,OAAO,SAAS;AAC5C,SACE,qCAAC,OAAM,UAAP,MACG,UAAU,OAAO,IAAI,CAAC,OAAO,UAAU;AACtC,QAAI,UAAU,WAAW;AACvB,aAAO;AAAA;AAET,UAAM,UAAU,WAAW,IAAI;AAC/B,UAAM,QAAQ,YAAY,WAAW,YAAY;AACjD,UAAM,WAAW,UAAU,QAAQ;AACnC,WACE,qCAAC,OAAM,UAAP;AAAA,MAAgB,KAAK;AAAA,OAClB,OACD,qCAAC,QAAD;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,QACL,iBAAiB;AAAA,QACjB,SAAS;AAAA,QACT,YAAY;AAAA;AAAA,OAGb;AAAA;AAAA;",
+ "names": []
+}
diff --git a/lib/iife/index.js b/lib/iife/index.js
new file mode 100644
index 0000000..4a54e50
--- /dev/null
+++ b/lib/iife/index.js
@@ -0,0 +1,244 @@
+(() => {
+ var __create = Object.create;
+ var __defProp = Object.defineProperty;
+ var __defProps = Object.defineProperties;
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+ var __getOwnPropNames = Object.getOwnPropertyNames;
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
+ var __getProtoOf = Object.getPrototypeOf;
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+ var __spreadValues = (a, b) => {
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+ };
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
+ var __require = (x) => {
+ if (typeof require !== "undefined")
+ return require(x);
+ throw new Error('Dynamic require of "' + x + '" is not supported');
+ };
+ var __reExport = (target, module, desc) => {
+ if (module && typeof module === "object" || typeof module === "function") {
+ for (let key of __getOwnPropNames(module))
+ if (!__hasOwnProp.call(target, key) && key !== "default")
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
+ }
+ return target;
+ };
+ var __toModule = (module) => {
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
+ };
+
+ // src/components/MatchContext.tsx
+ var import_react = __toModule(__require("react"));
+
+ // src/components/Types.d.ts
+ var IActionTypes;
+ (function(IActionTypes2) {
+ IActionTypes2["setSearchValue"] = "setSearchValue";
+ IActionTypes2["setActiveMatch"] = "setActiveMatch";
+ IActionTypes2["setMatchList"] = "setMatchList";
+ })(IActionTypes || (IActionTypes = {}));
+
+ // src/components/MatchContext.tsx
+ var scrollToView = (id, fixHeaderHeight = 0) => {
+ const dom = document.getElementById(id);
+ if (dom) {
+ const topOfElement = dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;
+ window.scroll({
+ top: topOfElement,
+ behavior: "smooth"
+ });
+ }
+ };
+ var defaultStore = {
+ searchValue: "",
+ totalCount: 0,
+ activeCount: 0,
+ activeId: "",
+ matchedList: []
+ };
+ var searchEventStore = {
+ onSearchChange: (event) => {
+ },
+ onPrev: () => {
+ },
+ onNext: () => {
+ },
+ onUpdateMatchList: (initialList) => {
+ }
+ };
+ var SearchContext = (0, import_react.createContext)(defaultStore);
+ var SearchEventContext = (0, import_react.createContext)(searchEventStore);
+ var reducer = (state, action) => {
+ if (action.type === IActionTypes.setSearchValue) {
+ return __spreadProps(__spreadValues({}, state), {
+ searchValue: action.payload.searchValue
+ });
+ }
+ if (action.type === IActionTypes.setActiveMatch) {
+ return __spreadProps(__spreadValues({}, state), {
+ activeId: action.payload.activeId,
+ activeCount: action.payload.activeCount
+ });
+ }
+ if (action.type === IActionTypes.setMatchList) {
+ return __spreadProps(__spreadValues({}, state), {
+ matchedList: action.payload
+ });
+ }
+ return state;
+ };
+ var SearchProvider = (props) => {
+ var _a;
+ const [store, dispatch] = (0, import_react.useReducer)(reducer, defaultStore);
+ const activeCount = store.activeCount;
+ const totalCount = (_a = store.matchedList) == null ? void 0 : _a.length;
+ const onSearchChange = (0, import_react.useCallback)((e) => {
+ const searchValue = e.target.value;
+ dispatch({ type: IActionTypes.setSearchValue, payload: { searchValue } });
+ }, []);
+ const onPrev = (0, import_react.useCallback)((fixedHeight) => {
+ if (activeCount > 0) {
+ let prevActiveCount = activeCount - 1 < 1 ? store.matchedList.length : activeCount - 1;
+ let matchIndex = prevActiveCount - 1;
+ let prevActiveId = store.matchedList[matchIndex].id;
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: { activeId: prevActiveId, activeCount: prevActiveCount }
+ });
+ scrollToView(prevActiveId, fixedHeight);
+ }
+ }, [activeCount, totalCount]);
+ const onNext = (0, import_react.useCallback)((fixedHeight) => {
+ if (activeCount > 0) {
+ let nextActiveCount = activeCount + 1 > store.matchedList.length ? 1 : activeCount + 1;
+ let matchIndex = nextActiveCount - 1;
+ let nextActiveId = store.matchedList[matchIndex].id;
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: { activeId: nextActiveId, activeCount: nextActiveCount }
+ });
+ scrollToView(nextActiveId, fixedHeight);
+ }
+ }, [activeCount, totalCount]);
+ const onUpdateMatchList = (0, import_react.useMemo)((initialList = []) => (matchList = []) => {
+ initialList = initialList.concat(matchList);
+ dispatch({ type: IActionTypes.setMatchList, payload: initialList });
+ }, [store.searchValue]);
+ (0, import_react.useEffect)(() => {
+ if (store.matchedList.length > 0) {
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: {
+ activeId: store.matchedList[0].id,
+ activeCount: 1
+ }
+ });
+ }
+ }, [store.matchedList]);
+ return /* @__PURE__ */ import_react.default.createElement(SearchContext.Provider, {
+ value: __spreadProps(__spreadValues({}, store), {
+ totalCount
+ })
+ }, /* @__PURE__ */ import_react.default.createElement(SearchEventContext.Provider, {
+ value: {
+ onSearchChange,
+ onUpdateMatchList,
+ onPrev,
+ onNext
+ }
+ }, props.children));
+ };
+
+ // src/components/MatchText.tsx
+ var import_react2 = __toModule(__require("react"));
+ var MARK = "__$CTRL_F$__";
+ function escapeStr(str) {
+ return `${str}`.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
+ }
+ function getMatchId(prefixId, index) {
+ return `${prefixId}_${index}`;
+ }
+ function getMatchText(keyword, text) {
+ let keywordStr = keyword;
+ let textStr = text;
+ if (typeof keyword === "number") {
+ keywordStr = `${keyword}`;
+ }
+ if (typeof text === "number") {
+ textStr = `${text}`;
+ }
+ if (typeof keywordStr !== "string" || !keywordStr.trim() || typeof textStr !== "string" || !textStr.trim() || !textStr.toLowerCase().includes(keywordStr.toLowerCase())) {
+ return text;
+ }
+ const regexp = new RegExp(escapeStr(keywordStr), "gi");
+ const matches = [];
+ const textWithMark = textStr.replace(regexp, (match) => {
+ matches.push(match);
+ return MARK;
+ });
+ const slices = textWithMark.split(MARK);
+ const data = {
+ slices,
+ matches
+ };
+ return data;
+ }
+ var MatchText = (data) => {
+ let textStr = data.text;
+ const id = data.id;
+ if (typeof data.children === "string") {
+ textStr = data.children;
+ }
+ if (!textStr) {
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, textStr);
+ }
+ const { searchValue, activeId } = (0, import_react2.useContext)(SearchContext);
+ const { onUpdateMatchList } = (0, import_react2.useContext)(SearchEventContext);
+ const matchData = (0, import_react2.useMemo)(() => getMatchText(searchValue, textStr), [searchValue]);
+ (0, import_react2.useLayoutEffect)(() => {
+ if (typeof matchData === "object") {
+ const matchIds = matchData.matches.map((_, index) => ({
+ id: getMatchId(id, index),
+ idCount: index
+ }));
+ onUpdateMatchList(matchIds);
+ }
+ }, [matchData]);
+ if (typeof matchData === "string") {
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, matchData);
+ }
+ const slicesLen = matchData.slices.length - 1;
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, matchData.slices.map((slice, index) => {
+ if (index === slicesLen) {
+ return slice;
+ }
+ const matchId = getMatchId(id, index);
+ const color = matchId === activeId ? "#ff9632" : "#ffff00";
+ const matchStr = matchData.matches[index];
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, {
+ key: index
+ }, slice, /* @__PURE__ */ import_react2.default.createElement("span", {
+ id: matchId,
+ style: {
+ backgroundColor: color,
+ display: "inline-block",
+ whiteSpace: "pre-wrap"
+ }
+ }, matchStr));
+ }));
+ };
+})();
+//# sourceMappingURL=index.js.map
diff --git a/lib/iife/index.js.map b/lib/iife/index.js.map
new file mode 100644
index 0000000..2570593
--- /dev/null
+++ b/lib/iife/index.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../src/components/MatchContext.tsx", "../../src/components/Types.d.ts", "../../src/components/MatchText.tsx"],
+ "sourcesContent": ["import React, {\n useReducer,\n useCallback,\n createContext,\n useEffect,\n useMemo,\n} from 'react';\n\nimport {\n EventContextProps,\n MatchObjectProps,\n IState,\n IActions,\n IActionTypes,\n} from './Types.d';\n\nexport const scrollToView = (id: string, fixHeaderHeight: number = 0) => {\n const dom = document.getElementById(id);\n if (dom) {\n const topOfElement =\n dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;\n window.scroll({\n top: topOfElement,\n behavior: 'smooth',\n });\n }\n};\n\nconst defaultStore: IState = {\n searchValue: '',\n totalCount: 0,\n\n activeCount: 0, // \u5F53\u524D\u9009\u4E2D count, \u5C0F\u4E8E\u7B49\u4E8E totalCount\n activeId: '', // \u5F53\u524D\u9009\u4E2D\u7684 \u6587\u672C \u5BF9\u5E94\u7684 id\n matchedList: [],\n};\n\nconst searchEventStore: EventContextProps = {\n onSearchChange: (\n event: React.ChangeEvent\n ) => {},\n onPrev: () => {},\n onNext: () => {},\n onUpdateMatchList: (initialList: MatchObjectProps[]) => {},\n};\n\nexport const SearchContext = createContext(defaultStore);\nexport const SearchEventContext = createContext(searchEventStore);\n\nconst reducer = (state: IState, action: IActions): IState => {\n if (action.type === IActionTypes.setSearchValue) {\n return {\n ...state,\n searchValue: action.payload.searchValue,\n };\n }\n\n if (action.type === IActionTypes.setActiveMatch) {\n return {\n ...state,\n activeId: action.payload.activeId,\n activeCount: action.payload.activeCount,\n };\n }\n if (action.type === IActionTypes.setMatchList) {\n return {\n ...state,\n matchedList: action.payload,\n };\n }\n return state;\n};\n\nexport const SearchProvider = (props: { children: React.ReactNode }) => {\n const [store, dispatch] = useReducer(reducer, defaultStore);\n\n const activeCount = store.activeCount;\n const totalCount = store.matchedList?.length;\n const onSearchChange = useCallback((e) => {\n const searchValue = e.target.value;\n dispatch({ type: IActionTypes.setSearchValue, payload: { searchValue } });\n }, []);\n\n // \u8BA1\u7B97\u524D\u4E00\u4E2A match\n const onPrev = useCallback(\n (fixedHeight) => {\n // prevCount \u4E3A 0 \u5219\u8BF4\u660E totalCount \u4E5F\u662F 0, \u8FD9\u79CD\u60C5\u51B5\u4E0D\u5904\u7406\u3002\n if (activeCount > 0) {\n let prevActiveCount =\n activeCount - 1 < 1 ? store.matchedList.length : activeCount - 1;\n let matchIndex = prevActiveCount - 1;\n let prevActiveId = store.matchedList[matchIndex].id;\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: { activeId: prevActiveId, activeCount: prevActiveCount },\n });\n scrollToView(prevActiveId, fixedHeight);\n }\n },\n [activeCount, totalCount]\n );\n\n // \u8BA1\u7B97\u540E\u4E00\u4E2A match\n const onNext = useCallback(\n (fixedHeight) => {\n if (activeCount > 0) {\n let nextActiveCount =\n activeCount + 1 > store.matchedList.length ? 1 : activeCount + 1;\n let matchIndex = nextActiveCount - 1;\n let nextActiveId = store.matchedList[matchIndex].id;\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: { activeId: nextActiveId, activeCount: nextActiveCount },\n });\n scrollToView(nextActiveId, fixedHeight);\n }\n },\n [activeCount, totalCount]\n );\n\n const onUpdateMatchList = useMemo(\n (initialList: MatchObjectProps[] = []) =>\n (matchList: MatchObjectProps[] = []) => {\n // \u7F13\u5B58 initialList\n initialList = initialList.concat(matchList);\n dispatch({ type: IActionTypes.setMatchList, payload: initialList });\n },\n [store.searchValue]\n );\n\n useEffect(() => {\n // \u8BA1\u7B97\u5B8C\u6240\u6709 Match Component \u4E4B\u540E\uFF0C\u8BA1\u7B97 totalCount \u548C activeCount\n if (store.matchedList.length > 0) {\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: {\n activeId: store.matchedList[0].id,\n activeCount: 1,\n },\n });\n }\n }, [store.matchedList]);\n return (\n \n \n {props.children}\n \n \n );\n};\n", "import React from 'react';\n\nexport enum IActionTypes {\n setSearchValue = 'setSearchValue',\n setActiveMatch = 'setActiveMatch',\n setMatchList = 'setMatchList',\n}\n\nexport interface MatchObjectProps {\n id: string;\n idCount: number;\n}\n\nexport interface IState {\n searchValue: string;\n totalCount: number;\n activeCount: number; // \u5F53\u524D\u9009\u4E2D count, \u5C0F\u4E8E\u7B49\u4E8E totalCount\n activeId: string; // \u5F53\u524D\u9009\u4E2D\u7684 \u6587\u672C \u5BF9\u5E94\u7684 id\n matchedList: MatchObjectProps[];\n}\n\nexport interface EventContextProps {\n onSearchChange: (\n event: React.ChangeEvent\n ) => void;\n onNext: (fixHeaderHeight: number) => void;\n onPrev: (fixHeaderHeight: number) => void;\n onUpdateMatchList: (matchedList: MatchObjectProps[]) => void;\n}\n\nexport interface IAction1 {\n type: IActionTypes.setSearchValue;\n payload: {\n searchValue: string;\n };\n}\n\nexport interface IAction2 {\n type: IActionTypes.setActiveMatch;\n payload: {\n activeId: string;\n activeCount: number;\n };\n}\n\nexport interface IAction3 {\n type: IActionTypes.setMatchList;\n payload: MatchObjectProps[];\n}\nexport type IActions = IAction1 | IAction2 | IAction3;\n\nexport interface MatchTextProps {\n id: string;\n text?: string;\n children?: React.ReactChild;\n}\n", "import React, { useContext, useMemo, useLayoutEffect } from 'react';\n\nimport { SearchContext, SearchEventContext } from './MatchContext';\nimport { MatchTextProps } from './Types';\n\nconst MARK = '__$CTRL_F$__';\n\nfunction escapeStr(str: string) {\n return `${str}`.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n}\n\nfunction getMatchId(prefixId: string, index: number) {\n return `${prefixId}_${index}`;\n}\n\nfunction getMatchText(keyword: string, text: string) {\n let keywordStr = keyword;\n let textStr = text;\n if (typeof keyword === 'number') {\n keywordStr = `${keyword}`;\n }\n if (typeof text === 'number') {\n textStr = `${text}`;\n }\n if (\n typeof keywordStr !== 'string' ||\n !keywordStr.trim() ||\n typeof textStr !== 'string' ||\n !textStr.trim() ||\n !textStr.toLowerCase().includes(keywordStr.toLowerCase()) // case insensitive\n ) {\n return text;\n }\n const regexp = new RegExp(escapeStr(keywordStr), 'gi');\n const matches: string[] = []; // save matched string, we will use this to overwrite keywordStr in the result string\n const textWithMark = textStr.replace(regexp, (match) => {\n matches.push(match);\n return MARK;\n });\n const slices = textWithMark.split(MARK);\n const data = {\n slices,\n matches,\n };\n return data;\n}\n\nexport const MatchText = (data: MatchTextProps): React.ReactElement => {\n let textStr = data.text!;\n const id = data.id;\n if (typeof data.children === 'string') {\n textStr = data.children;\n }\n if (!textStr) {\n return <>{textStr}>;\n }\n\n const { searchValue, activeId } = useContext(SearchContext);\n const { onUpdateMatchList } = useContext(SearchEventContext);\n const matchData = useMemo(\n () => getMatchText(searchValue, textStr),\n [searchValue]\n );\n useLayoutEffect(() => {\n if (typeof matchData === 'object') {\n const matchIds = matchData.matches.map((_, index) => ({\n id: getMatchId(id, index),\n idCount: index,\n }));\n onUpdateMatchList(matchIds);\n }\n }, [matchData]);\n\n if (typeof matchData === 'string') {\n return <>{matchData}>;\n }\n const slicesLen = matchData.slices.length - 1;\n return (\n \n {matchData.slices.map((slice, index) => {\n if (index === slicesLen) {\n return slice;\n }\n const matchId = getMatchId(id, index);\n const color = matchId === activeId ? '#ff9632' : '#ffff00';\n const matchStr = matchData.matches[index];\n return (\n \n {slice}\n \n {matchStr}\n \n \n );\n })}\n \n );\n};\n\nexport default MatchText;\n"],
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAMO;;;ACJA,MAAK;AAAL,YAAK,eAAL;AACL,sCAAiB;AACjB,sCAAiB;AACjB,oCAAe;AAAA,KAHL;;;ADcL,MAAM,eAAe,CAAC,IAAY,kBAA0B,MAAM;AACvE,UAAM,MAAM,SAAS,eAAe;AACpC,QAAI,KAAK;AACP,YAAM,eACJ,IAAI,wBAAwB,SAAS,OAAO,cAAc;AAC5D,aAAO,OAAO;AAAA,QACZ,KAAK;AAAA,QACL,UAAU;AAAA;AAAA;AAAA;AAKhB,MAAM,eAAuB;AAAA,IAC3B,aAAa;AAAA,IACb,YAAY;AAAA,IAEZ,aAAa;AAAA,IACb,UAAU;AAAA,IACV,aAAa;AAAA;AAGf,MAA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gB,KAAK;AAAA,SAClB,OACD,oDAAC,QAAD;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,UACL,iBAAiB;AAAA,UACjB,SAAS;AAAA,UACT,YAAY;AAAA;AAAA,SAGb;AAAA;AAAA;",
+ "names": []
+}
diff --git a/lib/index.d.ts b/lib/index.d.ts
new file mode 100644
index 0000000..fbcf791
--- /dev/null
+++ b/lib/index.d.ts
@@ -0,0 +1,39 @@
+import React from 'react';
+
+interface MatchObjectProps {
+ id: string;
+ idCount: number;
+}
+
+interface IState {
+ searchValue: string;
+ totalCount: number;
+ activeCount: number; // 当前选中 count, 小于等于 totalCount
+ activeId: string; // 当前选中的 文本 对应的 id
+ matchedList: MatchObjectProps[];
+}
+
+interface EventContextProps {
+ onSearchChange: (
+ event: React.ChangeEvent
+ ) => void;
+ onNext: (fixHeaderHeight: number) => void;
+ onPrev: (fixHeaderHeight: number) => void;
+ onUpdateMatchList: (matchedList: MatchObjectProps[]) => void;
+}
+
+interface MatchTextProps {
+ id: string;
+ text?: string;
+ children?: React.ReactChild;
+}
+
+declare const SearchContext: React.Context;
+declare const SearchEventContext: React.Context;
+declare const SearchProvider: (props: {
+ children: React.ReactNode;
+}) => JSX.Element;
+
+declare const MatchText: (data: MatchTextProps) => React.ReactElement;
+
+export { MatchText, SearchContext, SearchEventContext, SearchProvider };
diff --git a/lib/index.js b/lib/index.js
new file mode 100644
index 0000000..d03c4ed
--- /dev/null
+++ b/lib/index.js
@@ -0,0 +1,257 @@
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getOwnPropSymbols = Object.getOwnPropertySymbols;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __propIsEnum = Object.prototype.propertyIsEnumerable;
+var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __spreadValues = (a, b) => {
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+};
+var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
+var __export = (target, all) => {
+ __markAsModule(target);
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __reExport = (target, module2, desc) => {
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
+ for (let key of __getOwnPropNames(module2))
+ if (!__hasOwnProp.call(target, key) && key !== "default")
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
+ }
+ return target;
+};
+var __toModule = (module2) => {
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
+};
+
+// src/components/index.ts
+__export(exports, {
+ MatchText: () => MatchText,
+ SearchContext: () => SearchContext,
+ SearchEventContext: () => SearchEventContext,
+ SearchProvider: () => SearchProvider
+});
+
+// src/components/MatchContext.tsx
+var import_react = __toModule(require("react"));
+
+// src/components/Types.d.ts
+var IActionTypes;
+(function(IActionTypes2) {
+ IActionTypes2["setSearchValue"] = "setSearchValue";
+ IActionTypes2["setActiveMatch"] = "setActiveMatch";
+ IActionTypes2["setMatchList"] = "setMatchList";
+})(IActionTypes || (IActionTypes = {}));
+
+// src/components/MatchContext.tsx
+var scrollToView = (id, fixHeaderHeight = 0) => {
+ const dom = document.getElementById(id);
+ if (dom) {
+ const topOfElement = dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;
+ window.scroll({
+ top: topOfElement,
+ behavior: "smooth"
+ });
+ }
+};
+var defaultStore = {
+ searchValue: "",
+ totalCount: 0,
+ activeCount: 0,
+ activeId: "",
+ matchedList: []
+};
+var searchEventStore = {
+ onSearchChange: (event) => {
+ },
+ onPrev: () => {
+ },
+ onNext: () => {
+ },
+ onUpdateMatchList: (initialList) => {
+ }
+};
+var SearchContext = (0, import_react.createContext)(defaultStore);
+var SearchEventContext = (0, import_react.createContext)(searchEventStore);
+var reducer = (state, action) => {
+ if (action.type === IActionTypes.setSearchValue) {
+ return __spreadProps(__spreadValues({}, state), {
+ searchValue: action.payload.searchValue
+ });
+ }
+ if (action.type === IActionTypes.setActiveMatch) {
+ return __spreadProps(__spreadValues({}, state), {
+ activeId: action.payload.activeId,
+ activeCount: action.payload.activeCount
+ });
+ }
+ if (action.type === IActionTypes.setMatchList) {
+ return __spreadProps(__spreadValues({}, state), {
+ matchedList: action.payload
+ });
+ }
+ return state;
+};
+var SearchProvider = (props) => {
+ var _a;
+ const [store, dispatch] = (0, import_react.useReducer)(reducer, defaultStore);
+ const activeCount = store.activeCount;
+ const totalCount = (_a = store.matchedList) == null ? void 0 : _a.length;
+ const onSearchChange = (0, import_react.useCallback)((e) => {
+ const searchValue = e.target.value;
+ dispatch({ type: IActionTypes.setSearchValue, payload: { searchValue } });
+ }, []);
+ const onPrev = (0, import_react.useCallback)((fixedHeight) => {
+ if (activeCount > 0) {
+ let prevActiveCount = activeCount - 1 < 1 ? store.matchedList.length : activeCount - 1;
+ let matchIndex = prevActiveCount - 1;
+ let prevActiveId = store.matchedList[matchIndex].id;
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: { activeId: prevActiveId, activeCount: prevActiveCount }
+ });
+ scrollToView(prevActiveId, fixedHeight);
+ }
+ }, [activeCount, totalCount]);
+ const onNext = (0, import_react.useCallback)((fixedHeight) => {
+ if (activeCount > 0) {
+ let nextActiveCount = activeCount + 1 > store.matchedList.length ? 1 : activeCount + 1;
+ let matchIndex = nextActiveCount - 1;
+ let nextActiveId = store.matchedList[matchIndex].id;
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: { activeId: nextActiveId, activeCount: nextActiveCount }
+ });
+ scrollToView(nextActiveId, fixedHeight);
+ }
+ }, [activeCount, totalCount]);
+ const onUpdateMatchList = (0, import_react.useMemo)((initialList = []) => (matchList = []) => {
+ initialList = initialList.concat(matchList);
+ dispatch({ type: IActionTypes.setMatchList, payload: initialList });
+ }, [store.searchValue]);
+ (0, import_react.useEffect)(() => {
+ if (store.matchedList.length > 0) {
+ dispatch({
+ type: IActionTypes.setActiveMatch,
+ payload: {
+ activeId: store.matchedList[0].id,
+ activeCount: 1
+ }
+ });
+ }
+ }, [store.matchedList]);
+ return /* @__PURE__ */ import_react.default.createElement(SearchContext.Provider, {
+ value: __spreadProps(__spreadValues({}, store), {
+ totalCount
+ })
+ }, /* @__PURE__ */ import_react.default.createElement(SearchEventContext.Provider, {
+ value: {
+ onSearchChange,
+ onUpdateMatchList,
+ onPrev,
+ onNext
+ }
+ }, props.children));
+};
+
+// src/components/MatchText.tsx
+var import_react2 = __toModule(require("react"));
+var MARK = "__$CTRL_F$__";
+function escapeStr(str) {
+ return `${str}`.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
+}
+function getMatchId(prefixId, index) {
+ return `${prefixId}_${index}`;
+}
+function getMatchText(keyword, text) {
+ let keywordStr = keyword;
+ let textStr = text;
+ if (typeof keyword === "number") {
+ keywordStr = `${keyword}`;
+ }
+ if (typeof text === "number") {
+ textStr = `${text}`;
+ }
+ if (typeof keywordStr !== "string" || !keywordStr.trim() || typeof textStr !== "string" || !textStr.trim() || !textStr.toLowerCase().includes(keywordStr.toLowerCase())) {
+ return text;
+ }
+ const regexp = new RegExp(escapeStr(keywordStr), "gi");
+ const matches = [];
+ const textWithMark = textStr.replace(regexp, (match) => {
+ matches.push(match);
+ return MARK;
+ });
+ const slices = textWithMark.split(MARK);
+ const data = {
+ slices,
+ matches
+ };
+ return data;
+}
+var MatchText = (data) => {
+ let textStr = data.text;
+ const id = data.id;
+ if (typeof data.children === "string") {
+ textStr = data.children;
+ }
+ if (!textStr) {
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, textStr);
+ }
+ const { searchValue, activeId } = (0, import_react2.useContext)(SearchContext);
+ const { onUpdateMatchList } = (0, import_react2.useContext)(SearchEventContext);
+ const matchData = (0, import_react2.useMemo)(() => getMatchText(searchValue, textStr), [searchValue]);
+ (0, import_react2.useLayoutEffect)(() => {
+ if (typeof matchData === "object") {
+ const matchIds = matchData.matches.map((_, index) => ({
+ id: getMatchId(id, index),
+ idCount: index
+ }));
+ onUpdateMatchList(matchIds);
+ }
+ }, [matchData]);
+ if (typeof matchData === "string") {
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, matchData);
+ }
+ const slicesLen = matchData.slices.length - 1;
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, matchData.slices.map((slice, index) => {
+ if (index === slicesLen) {
+ return slice;
+ }
+ const matchId = getMatchId(id, index);
+ const color = matchId === activeId ? "#ff9632" : "#ffff00";
+ const matchStr = matchData.matches[index];
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, {
+ key: index
+ }, slice, /* @__PURE__ */ import_react2.default.createElement("span", {
+ id: matchId,
+ style: {
+ backgroundColor: color,
+ display: "inline-block",
+ whiteSpace: "pre-wrap"
+ }
+ }, matchStr));
+ }));
+};
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ MatchText,
+ SearchContext,
+ SearchEventContext,
+ SearchProvider
+});
+//# sourceMappingURL=index.js.map
diff --git a/lib/index.js.map b/lib/index.js.map
new file mode 100644
index 0000000..1f5e304
--- /dev/null
+++ b/lib/index.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../src/components/index.ts", "../src/components/MatchContext.tsx", "../src/components/Types.d.ts", "../src/components/MatchText.tsx"],
+ "sourcesContent": ["export {\n SearchContext,\n SearchEventContext,\n SearchProvider,\n} from './MatchContext';\n\nexport { MatchText } from './MatchText';\n", "import React, {\n useReducer,\n useCallback,\n createContext,\n useEffect,\n useMemo,\n} from 'react';\n\nimport {\n EventContextProps,\n MatchObjectProps,\n IState,\n IActions,\n IActionTypes,\n} from './Types.d';\n\nexport const scrollToView = (id: string, fixHeaderHeight: number = 0) => {\n const dom = document.getElementById(id);\n if (dom) {\n const topOfElement =\n dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;\n window.scroll({\n top: topOfElement,\n behavior: 'smooth',\n });\n }\n};\n\nconst defaultStore: IState = {\n searchValue: '',\n totalCount: 0,\n\n activeCount: 0, // \u5F53\u524D\u9009\u4E2D count, \u5C0F\u4E8E\u7B49\u4E8E totalCount\n activeId: '', // \u5F53\u524D\u9009\u4E2D\u7684 \u6587\u672C \u5BF9\u5E94\u7684 id\n matchedList: [],\n};\n\nconst searchEventStore: EventContextProps = {\n onSearchChange: (\n event: React.ChangeEvent\n ) => {},\n onPrev: () => {},\n onNext: () => {},\n onUpdateMatchList: (initialList: MatchObjectProps[]) => {},\n};\n\nexport const SearchContext = createContext(defaultStore);\nexport const SearchEventContext = createContext(searchEventStore);\n\nconst reducer = (state: IState, action: IActions): IState => {\n if (action.type === IActionTypes.setSearchValue) {\n return {\n ...state,\n searchValue: action.payload.searchValue,\n };\n }\n\n if (action.type === IActionTypes.setActiveMatch) {\n return {\n ...state,\n activeId: action.payload.activeId,\n activeCount: action.payload.activeCount,\n };\n }\n if (action.type === IActionTypes.setMatchList) {\n return {\n ...state,\n matchedList: action.payload,\n };\n }\n return state;\n};\n\nexport const SearchProvider = (props: { children: React.ReactNode }) => {\n const [store, dispatch] = useReducer(reducer, defaultStore);\n\n const activeCount = store.activeCount;\n const totalCount = store.matchedList?.length;\n const onSearchChange = useCallback((e) => {\n const searchValue = e.target.value;\n dispatch({ type: IActionTypes.setSearchValue, payload: { searchValue } });\n }, []);\n\n // \u8BA1\u7B97\u524D\u4E00\u4E2A match\n const onPrev = useCallback(\n (fixedHeight) => {\n // prevCount \u4E3A 0 \u5219\u8BF4\u660E totalCount \u4E5F\u662F 0, \u8FD9\u79CD\u60C5\u51B5\u4E0D\u5904\u7406\u3002\n if (activeCount > 0) {\n let prevActiveCount =\n activeCount - 1 < 1 ? store.matchedList.length : activeCount - 1;\n let matchIndex = prevActiveCount - 1;\n let prevActiveId = store.matchedList[matchIndex].id;\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: { activeId: prevActiveId, activeCount: prevActiveCount },\n });\n scrollToView(prevActiveId, fixedHeight);\n }\n },\n [activeCount, totalCount]\n );\n\n // \u8BA1\u7B97\u540E\u4E00\u4E2A match\n const onNext = useCallback(\n (fixedHeight) => {\n if (activeCount > 0) {\n let nextActiveCount =\n activeCount + 1 > store.matchedList.length ? 1 : activeCount + 1;\n let matchIndex = nextActiveCount - 1;\n let nextActiveId = store.matchedList[matchIndex].id;\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: { activeId: nextActiveId, activeCount: nextActiveCount },\n });\n scrollToView(nextActiveId, fixedHeight);\n }\n },\n [activeCount, totalCount]\n );\n\n const onUpdateMatchList = useMemo(\n (initialList: MatchObjectProps[] = []) =>\n (matchList: MatchObjectProps[] = []) => {\n // \u7F13\u5B58 initialList\n initialList = initialList.concat(matchList);\n dispatch({ type: IActionTypes.setMatchList, payload: initialList });\n },\n [store.searchValue]\n );\n\n useEffect(() => {\n // \u8BA1\u7B97\u5B8C\u6240\u6709 Match Component \u4E4B\u540E\uFF0C\u8BA1\u7B97 totalCount \u548C activeCount\n if (store.matchedList.length > 0) {\n dispatch({\n type: IActionTypes.setActiveMatch,\n payload: {\n activeId: store.matchedList[0].id,\n activeCount: 1,\n },\n });\n }\n }, [store.matchedList]);\n return (\n \n \n {props.children}\n \n \n );\n};\n", "import React from 'react';\n\nexport enum IActionTypes {\n setSearchValue = 'setSearchValue',\n setActiveMatch = 'setActiveMatch',\n setMatchList = 'setMatchList',\n}\n\nexport interface MatchObjectProps {\n id: string;\n idCount: number;\n}\n\nexport interface IState {\n searchValue: string;\n totalCount: number;\n activeCount: number; // \u5F53\u524D\u9009\u4E2D count, \u5C0F\u4E8E\u7B49\u4E8E totalCount\n activeId: string; // \u5F53\u524D\u9009\u4E2D\u7684 \u6587\u672C \u5BF9\u5E94\u7684 id\n matchedList: MatchObjectProps[];\n}\n\nexport interface EventContextProps {\n onSearchChange: (\n event: React.ChangeEvent\n ) => void;\n onNext: (fixHeaderHeight: number) => void;\n onPrev: (fixHeaderHeight: number) => void;\n onUpdateMatchList: (matchedList: MatchObjectProps[]) => void;\n}\n\nexport interface IAction1 {\n type: IActionTypes.setSearchValue;\n payload: {\n searchValue: string;\n };\n}\n\nexport interface IAction2 {\n type: IActionTypes.setActiveMatch;\n payload: {\n activeId: string;\n activeCount: number;\n };\n}\n\nexport interface IAction3 {\n type: IActionTypes.setMatchList;\n payload: MatchObjectProps[];\n}\nexport type IActions = IAction1 | IAction2 | IAction3;\n\nexport interface MatchTextProps {\n id: string;\n text?: string;\n children?: React.ReactChild;\n}\n", "import React, { useContext, useMemo, useLayoutEffect } from 'react';\n\nimport { SearchContext, SearchEventContext } from './MatchContext';\nimport { MatchTextProps } from './Types';\n\nconst MARK = '__$CTRL_F$__';\n\nfunction escapeStr(str: string) {\n return `${str}`.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n}\n\nfunction getMatchId(prefixId: string, index: number) {\n return `${prefixId}_${index}`;\n}\n\nfunction getMatchText(keyword: string, text: string) {\n let keywordStr = keyword;\n let textStr = text;\n if (typeof keyword === 'number') {\n keywordStr = `${keyword}`;\n }\n if (typeof text === 'number') {\n textStr = `${text}`;\n }\n if (\n typeof keywordStr !== 'string' ||\n !keywordStr.trim() ||\n typeof textStr !== 'string' ||\n !textStr.trim() ||\n !textStr.toLowerCase().includes(keywordStr.toLowerCase()) // case insensitive\n ) {\n return text;\n }\n const regexp = new RegExp(escapeStr(keywordStr), 'gi');\n const matches: string[] = []; // save matched string, we will use this to overwrite keywordStr in the result string\n const textWithMark = textStr.replace(regexp, (match) => {\n matches.push(match);\n return MARK;\n });\n const slices = textWithMark.split(MARK);\n const data = {\n slices,\n matches,\n };\n return data;\n}\n\nexport const MatchText = (data: MatchTextProps): React.ReactElement => {\n let textStr = data.text!;\n const id = data.id;\n if (typeof data.children === 'string') {\n textStr = data.children;\n }\n if (!textStr) {\n return <>{textStr}>;\n }\n\n const { searchValue, activeId } = useContext(SearchContext);\n const { onUpdateMatchList } = useContext(SearchEventContext);\n const matchData = useMemo(\n () => getMatchText(searchValue, textStr),\n [searchValue]\n );\n useLayoutEffect(() => {\n if (typeof matchData === 'object') {\n const matchIds = matchData.matches.map((_, index) => ({\n id: getMatchId(id, index),\n idCount: index,\n }));\n onUpdateMatchList(matchIds);\n }\n }, [matchData]);\n\n if (typeof matchData === 'string') {\n return <>{matchData}>;\n }\n const slicesLen = matchData.slices.length - 1;\n return (\n \n {matchData.slices.map((slice, index) => {\n if (index === slicesLen) {\n return slice;\n }\n const matchId = getMatchId(id, index);\n const color = matchId === activeId ? '#ff9632' : '#ffff00';\n const matchStr = matchData.matches[index];\n return (\n \n {slice}\n \n {matchStr}\n \n \n );\n })}\n \n );\n};\n\nexport default MatchText;\n"],
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAMO;;;ACJA,IAAK;AAAL,UAAK,eAAL;AACL,oCAAiB;AACjB,oCAAiB;AACjB,kCAAe;AAAA,GAHL;;;ADcL,IAAM,eAAe,CAAC,IAAY,kBAA0B,MAAM;AACvE,QAAM,MAAM,SAAS,eAAe;AACpC,MAAI,KAAK;AACP,UAAM,eACJ,IAAI,wBAAwB,SAAS,OAAO,cAAc;AAC5D,WAAO,OAAO;AAAA,MACZ,KAAK;AAAA,MACL,U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A;AAET,UAAM,UAAU,WAAW,IAAI;AAC/B,UAAM,QAAQ,YAAY,WAAW,YAAY;AACjD,UAAM,WAAW,UAAU,QAAQ;AACnC,WACE,oDAAC,sBAAM,UAAP;AAAA,MAAgB,KAAK;AAAA,OAClB,OACD,oDAAC,QAAD;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,QACL,iBAAiB;AAAA,QACjB,SAAS;AAAA,QACT,YAAY;AAAA;AAAA,OAGb;AAAA;AAAA;",
+ "names": []
+}
diff --git a/package.json b/package.json
index 617d9b3..b73c05a 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,37 @@
{
"name": "react-ctrl-f",
- "version": "0.0.0",
+ "version": "0.0.1",
+ "description": "Ctrl + f function realized by react",
+ "license": "MIT",
+ "title": "React Ctrl F",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/dbwcooper/react-ctrl-f.gitß"
+ },
+ "author": {
+ "name": "dbwcooper",
+ "email": "dbwencookie@gmail.com",
+ "url": "https://github.com/dbwcooper"
+ },
+ "files": [
+ "lib"
+ ],
+ "homepage": "https://react-ctrl-f.vercel.app",
+ "main": "lib/index.js",
+ "module": "lib/esm/index.js",
+ "keywords": [
+ "React",
+ "ctrl f",
+ "web",
+ "search",
+ "match text",
+ "scrollToView"
+ ],
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
- "serve": "vite preview"
+ "serve": "vite preview",
+ "build:tsup": "tsup src/components/index.ts "
},
"dependencies": {
"react": "^17.0.0",
@@ -14,7 +41,11 @@
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@vitejs/plugin-react-refresh": "^1.1.0",
+ "tsup": "^4.14.0",
"typescript": "^4.1.2",
"vite": "^2.0.0"
+ },
+ "publishConfig": {
+ "registry": "https://registry.npmjs.org/"
}
}
diff --git a/src/components/MatchContext.tsx b/src/components/MatchContext.tsx
index 5210ab3..a93f76e 100644
--- a/src/components/MatchContext.tsx
+++ b/src/components/MatchContext.tsx
@@ -12,14 +12,13 @@ import {
IState,
IActions,
IActionTypes,
-} from './Types';
+} from './Types.d';
export const scrollToView = (id: string, fixHeaderHeight: number = 0) => {
const dom = document.getElementById(id);
if (dom) {
const topOfElement =
dom.getBoundingClientRect().bottom + window.pageYOffset - fixHeaderHeight;
- console.log('topOfElement', topOfElement)
window.scroll({
top: topOfElement,
behavior: 'smooth',
diff --git a/src/components/Types.ts b/src/components/Types.d.ts
similarity index 100%
rename from src/components/Types.ts
rename to src/components/Types.d.ts
diff --git a/src/components/index.tsx b/src/components/index.ts
similarity index 100%
rename from src/components/index.tsx
rename to src/components/index.ts
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index 0876e73..2e901fb 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -1,6 +1,5 @@
import React from 'react';
-
-import { MatchText, SearchProvider } from '../components';
+import { MatchText, SearchProvider } from '../../lib';
import Search from './Search';
export default function App() {
@@ -38,6 +37,7 @@ export default function App() {
React.
+ {/* */}
{
const { searchValue, activeCount, totalCount } = useContext(SearchContext);
diff --git a/tsconfig.json b/tsconfig.json
index 51efd41..0a8d5d4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -14,7 +14,9 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
- "jsx": "react"
+ "jsx": "react",
+ "declaration": true,
+ "declarationDir": "types",
},
"include": ["./src"]
}
diff --git a/tsup.config.ts b/tsup.config.ts
new file mode 100644
index 0000000..2fac3c3
--- /dev/null
+++ b/tsup.config.ts
@@ -0,0 +1,12 @@
+// tsup.config.ts
+import type { Options } from 'tsup';
+export const tsup: Options = {
+ splitting: false,
+ sourcemap: true,
+ clean: true,
+ entryPoints: ['src/components/index.ts'],
+ dts: true, // use tsc to check types
+ outDir: 'lib',
+ format: ['iife', 'esm', 'cjs'],
+ legacyOutput: true,
+};
diff --git a/vite.config.ts b/vite.config.ts
index 5e7342c..342797e 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,7 +1,30 @@
-import { defineConfig } from 'vite'
-import reactRefresh from '@vitejs/plugin-react-refresh'
+// import path from 'path';
+import { defineConfig } from 'vite';
+import reactRefresh from '@vitejs/plugin-react-refresh';
-// https://vitejs.dev/config/
-export default defineConfig({
- plugins: [reactRefresh()]
-})
+// const outDir = path.resolve(__dirname, 'lib');
+
+module.exports = defineConfig({
+ root: '.',
+ plugins: [reactRefresh()],
+ // build: {
+ // outDir: outDir,
+ // lib: {
+ // name: 'react-ctrl-f',
+ // entry: path.resolve(__dirname, 'src/components/index.ts'),
+ // formats: ['es'],
+ // },
+ // rollupOptions: {
+ // // 确保外部化处理那些你不想打包进库的依赖
+ // external: ['react'],
+ // output: {
+ // sourcemapExcludeSources: true,
+ // },
+ // },
+ // sourcemap: true,
+ // // Reduce bloat from legacy polyfills.
+ // // target: 'esnext',
+ // // Leave minification up to applications.
+ // minify: false,
+ // },
+});
diff --git a/yarn.lock b/yarn.lock
index e092fdd..2ce2417 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,40 @@
# yarn lockfile v1
+"@ant-design/colors@^6.0.0":
+ version "6.0.0"
+ resolved "https://r.cnpmjs.org/@ant-design/colors/download/@ant-design/colors-6.0.0.tgz#9b9366257cffcc47db42b9d0203bb592c13c0298"
+ integrity sha1-m5NmJXz/zEfbQrnQIDu1ksE8Apg=
+ dependencies:
+ "@ctrl/tinycolor" "^3.4.0"
+
+"@ant-design/icons-svg@^4.0.0":
+ version "4.1.0"
+ resolved "https://r.cnpmjs.org/@ant-design/icons-svg/download/@ant-design/icons-svg-4.1.0.tgz#480b025f4b20ef7fe8f47d4a4846e4fee84ea06c"
+ integrity sha1-SAsCX0sg73/o9H1KSEbk/uhOoGw=
+
+"@ant-design/icons@^4.6.3":
+ version "4.6.4"
+ resolved "https://r.cnpmjs.org/@ant-design/icons/download/@ant-design/icons-4.6.4.tgz#21b037dbb90ee1bb7c632cca057006e57d992fd9"
+ integrity sha1-IbA327kO4bt8YyzKBXAG5X2ZL9k=
+ dependencies:
+ "@ant-design/colors" "^6.0.0"
+ "@ant-design/icons-svg" "^4.0.0"
+ "@babel/runtime" "^7.11.2"
+ classnames "^2.2.6"
+ rc-util "^5.9.4"
+
+"@ant-design/react-slick@~0.28.1":
+ version "0.28.4"
+ resolved "https://r.cnpmjs.org/@ant-design/react-slick/download/@ant-design/react-slick-0.28.4.tgz#8b296b87ad7c7ae877f2a527b81b7eebd9dd29a9"
+ integrity sha1-iylrh618euh38qUnuBt+69ndKak=
+ dependencies:
+ "@babel/runtime" "^7.10.4"
+ classnames "^2.2.5"
+ json2mq "^0.2.0"
+ lodash "^4.17.21"
+ resize-observer-polyfill "^1.5.0"
+
"@babel/code-frame@^7.12.13":
version "7.12.13"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658"
@@ -162,6 +196,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.12.13"
+"@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.8.4":
+ version "7.15.4"
+ resolved "https://r.cnpmjs.org/@babel/runtime/download/@babel/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
+ integrity sha1-/RfRa/34eObdAtGXU6OfqKjZyEo=
+ dependencies:
+ regenerator-runtime "^0.13.4"
+
"@babel/template@^7.12.13":
version "7.12.13"
resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327"
@@ -195,6 +236,37 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"
+"@ctrl/tinycolor@^3.4.0":
+ version "3.4.0"
+ resolved "https://r.cnpmjs.org/@ctrl/tinycolor/download/@ctrl/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f"
+ integrity sha1-w8WuVDyJfKqcKmhjC+01W+X5mQ8=
+
+"@nodelib/fs.scandir@2.1.5":
+ version "2.1.5"
+ resolved "https://r.cnpmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
+ integrity sha1-dhnC6yGyVIP20WdUi0z9WnSIw9U=
+ dependencies:
+ "@nodelib/fs.stat" "2.0.5"
+ run-parallel "^1.1.9"
+
+"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2":
+ version "2.0.5"
+ resolved "https://r.cnpmjs.org/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b"
+ integrity sha1-W9Jir5Tp0lvR5xsF3u1Eh2oiLos=
+
+"@nodelib/fs.walk@^1.2.3":
+ version "1.2.8"
+ resolved "https://r.cnpmjs.org/@nodelib/fs.walk/download/@nodelib/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a"
+ integrity sha1-6Vc36LtnRt3t9pxVaVNJTxlv5po=
+ dependencies:
+ "@nodelib/fs.scandir" "2.1.5"
+ fastq "^1.6.0"
+
+"@types/node@^16.7.12":
+ version "16.7.12"
+ resolved "https://r.cnpmjs.org/@types/node/download/@types/node-16.7.12.tgz#4e30f80bfa9983fbc3b55875c0522da0303f4e95"
+ integrity sha1-TjD4C/qZg/vDtVh1wFItoDA/TpU=
+
"@types/prop-types@*":
version "15.7.3"
resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
@@ -232,6 +304,118 @@ ansi-styles@^3.2.1:
dependencies:
color-convert "^1.9.0"
+ansi-styles@^4.1.0:
+ version "4.3.0"
+ resolved "https://r.cnpmjs.org/ansi-styles/download/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
+ integrity sha1-7dgDYornHATIWuegkG7a00tkiTc=
+ dependencies:
+ color-convert "^2.0.1"
+
+antd@^4.16.13:
+ version "4.16.13"
+ resolved "https://r.cnpmjs.org/antd/download/antd-4.16.13.tgz#e9b9b4a590db28747aae1cab98981649a35880af"
+ integrity sha1-6bm0pZDbKHR6rhyrmJgWSaNYgK8=
+ dependencies:
+ "@ant-design/colors" "^6.0.0"
+ "@ant-design/icons" "^4.6.3"
+ "@ant-design/react-slick" "~0.28.1"
+ "@babel/runtime" "^7.12.5"
+ array-tree-filter "^2.1.0"
+ classnames "^2.2.6"
+ copy-to-clipboard "^3.2.0"
+ lodash "^4.17.21"
+ moment "^2.25.3"
+ rc-cascader "~1.4.0"
+ rc-checkbox "~2.3.0"
+ rc-collapse "~3.1.0"
+ rc-dialog "~8.6.0"
+ rc-drawer "~4.3.0"
+ rc-dropdown "~3.2.0"
+ rc-field-form "~1.20.0"
+ rc-image "~5.2.5"
+ rc-input-number "~7.1.0"
+ rc-mentions "~1.6.1"
+ rc-menu "~9.0.12"
+ rc-motion "^2.4.0"
+ rc-notification "~4.5.7"
+ rc-pagination "~3.1.9"
+ rc-picker "~2.5.10"
+ rc-progress "~3.1.0"
+ rc-rate "~2.9.0"
+ rc-resize-observer "^1.0.0"
+ rc-select "~12.1.6"
+ rc-slider "~9.7.1"
+ rc-steps "~4.1.0"
+ rc-switch "~3.2.0"
+ rc-table "~7.15.1"
+ rc-tabs "~11.10.0"
+ rc-textarea "~0.3.0"
+ rc-tooltip "~5.1.1"
+ rc-tree "~4.2.1"
+ rc-tree-select "~4.3.0"
+ rc-trigger "^5.2.10"
+ rc-upload "~4.3.0"
+ rc-util "^5.13.1"
+ scroll-into-view-if-needed "^2.2.25"
+
+any-promise@^1.0.0:
+ version "1.3.0"
+ resolved "https://r.cnpmjs.org/any-promise/download/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
+ integrity sha1-q8av7tzqUugJzcA3au0845Y10X8=
+
+anymatch@~3.1.2:
+ version "3.1.2"
+ resolved "https://r.cnpmjs.org/anymatch/download/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
+ integrity sha1-wFV8CWrzLxBhmPT04qODU343hxY=
+ dependencies:
+ normalize-path "^3.0.0"
+ picomatch "^2.0.4"
+
+array-tree-filter@^2.1.0:
+ version "2.1.0"
+ resolved "https://r.cnpmjs.org/array-tree-filter/download/array-tree-filter-2.1.0.tgz#873ac00fec83749f255ac8dd083814b4f6329190"
+ integrity sha1-hzrAD+yDdJ8lWsjdCDgUtPYykZA=
+
+array-union@^2.1.0:
+ version "2.1.0"
+ resolved "https://r.cnpmjs.org/array-union/download/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
+ integrity sha1-t5hCCtvrHego2ErNii4j0+/oXo0=
+
+async-validator@^3.0.3:
+ version "3.5.2"
+ resolved "https://r.cnpmjs.org/async-validator/download/async-validator-3.5.2.tgz#68e866a96824e8b2694ff7a831c1a25c44d5e500"
+ integrity sha1-aOhmqWgk6LJpT/eoMcGiXETV5QA=
+
+balanced-match@^1.0.0:
+ version "1.0.2"
+ resolved "https://r.cnpmjs.org/balanced-match/download/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
+ integrity sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=
+
+binary-extensions@^2.0.0:
+ version "2.2.0"
+ resolved "https://r.cnpmjs.org/binary-extensions/download/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
+ integrity sha1-dfUC7q+f/eQvyYgpZFvk6na9ni0=
+
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://r.cnpmjs.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+braces@^3.0.1, braces@~3.0.2:
+ version "3.0.2"
+ resolved "https://r.cnpmjs.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
+ integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
+ dependencies:
+ fill-range "^7.0.1"
+
+cac@^6.7.2:
+ version "6.7.3"
+ resolved "https://r.cnpmjs.org/cac/download/cac-6.7.3.tgz#10410b8611677990cc2e3c8b576d471c1d71b768"
+ integrity sha1-EEELhhFneZDMLjyLV21HHB1xt2g=
+
chalk@^2.0.0:
version "2.4.2"
resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
@@ -241,6 +425,34 @@ chalk@^2.0.0:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
+chalk@^4.1.0:
+ version "4.1.2"
+ resolved "https://r.cnpmjs.org/chalk/download/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
+ integrity sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=
+ dependencies:
+ ansi-styles "^4.1.0"
+ supports-color "^7.1.0"
+
+chokidar@^3.5.1:
+ version "3.5.2"
+ resolved "https://r.cnpmjs.org/chokidar/download/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
+ integrity sha1-26OXb8rbAW9m/TZQIdkWANAcHnU=
+ dependencies:
+ anymatch "~3.1.2"
+ braces "~3.0.2"
+ glob-parent "~5.1.2"
+ is-binary-path "~2.1.0"
+ is-glob "~4.0.1"
+ normalize-path "~3.0.0"
+ readdirp "~3.6.0"
+ optionalDependencies:
+ fsevents "~2.3.2"
+
+classnames@2.x, classnames@^2.2.1, classnames@^2.2.3, classnames@^2.2.5, classnames@^2.2.6:
+ version "2.3.1"
+ resolved "https://r.cnpmjs.org/classnames/download/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
+ integrity sha1-38+jiR4wbsHa0QXQ6I9EF7hTXo4=
+
color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
@@ -248,16 +460,43 @@ color-convert@^1.9.0:
dependencies:
color-name "1.1.3"
+color-convert@^2.0.1:
+ version "2.0.1"
+ resolved "https://r.cnpmjs.org/color-convert/download/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
+ integrity sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=
+ dependencies:
+ color-name "~1.1.4"
+
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
+color-name@~1.1.4:
+ version "1.1.4"
+ resolved "https://r.cnpmjs.org/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
+ integrity sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=
+
colorette@^1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
+commander@^4.0.0:
+ version "4.1.1"
+ resolved "https://r.cnpmjs.org/commander/download/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
+ integrity sha1-n9YCvZNilOnp70aj9NaWQESxgGg=
+
+compute-scroll-into-view@^1.0.17:
+ version "1.0.17"
+ resolved "https://r.cnpmjs.org/compute-scroll-into-view/download/compute-scroll-into-view-1.0.17.tgz#6a88f18acd9d42e9cf4baa6bec7e0522607ab7ab"
+ integrity sha1-aojxis2dQunPS6pr7H4FImB6t6s=
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://r.cnpmjs.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
convert-source-map@^1.7.0:
version "1.7.0"
resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
@@ -265,11 +504,37 @@ convert-source-map@^1.7.0:
dependencies:
safe-buffer "~5.1.1"
+copy-to-clipboard@^3.2.0:
+ version "3.3.1"
+ resolved "https://r.cnpmjs.org/copy-to-clipboard/download/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae"
+ integrity sha1-EVqhqZmP+rYZb5MHatbaO5E2Yq4=
+ dependencies:
+ toggle-selection "^1.0.6"
+
+cross-spawn@^7.0.3:
+ version "7.0.3"
+ resolved "https://r.cnpmjs.org/cross-spawn/download/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
+ integrity sha1-9zqFudXUHQRVUcF34ogtSshXKKY=
+ dependencies:
+ path-key "^3.1.0"
+ shebang-command "^2.0.0"
+ which "^2.0.1"
+
csstype@^3.0.2:
version "3.0.6"
resolved "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz#865d0b5833d7d8d40f4e5b8a6d76aea3de4725ef"
integrity sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==
+date-fns@2.x:
+ version "2.23.0"
+ resolved "https://r.cnpmjs.org/date-fns/download/date-fns-2.23.0.tgz#4e886c941659af0cf7b30fafdd1eaa37e88788a9"
+ integrity sha1-TohslBZZrwz3sw+v3R6qN+iHiKk=
+
+dayjs@1.x:
+ version "1.10.6"
+ resolved "https://r.cnpmjs.org/dayjs/download/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63"
+ integrity sha1-KIsqqC8thBimydTfWJjAc3rQKmM=
+
debug@^4.1.0:
version "4.3.1"
resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
@@ -277,6 +542,30 @@ debug@^4.1.0:
dependencies:
ms "2.1.2"
+debug@^4.3.1:
+ version "4.3.2"
+ resolved "https://r.cnpmjs.org/debug/download/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
+ integrity sha1-8KScGKyHeeMdSgxgKd+3aHPHQos=
+ dependencies:
+ ms "2.1.2"
+
+dir-glob@^3.0.1:
+ version "3.0.1"
+ resolved "https://r.cnpmjs.org/dir-glob/download/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
+ integrity sha1-Vtv3PZkqSpO6FYT0U0Bj/S5BcX8=
+ dependencies:
+ path-type "^4.0.0"
+
+dom-align@^1.7.0:
+ version "1.12.2"
+ resolved "https://r.cnpmjs.org/dom-align/download/dom-align-1.12.2.tgz#0f8164ebd0c9c21b0c790310493cd855892acd4b"
+ integrity sha1-D4Fk69DJwhsMeQMQSTzYVYkqzUs=
+
+esbuild@^0.12.9:
+ version "0.12.25"
+ resolved "https://r.cnpmjs.org/esbuild/download/esbuild-0.12.25.tgz#c2131cef022cf9fe94aaa5e00110b27fc976221a"
+ integrity sha1-whMc7wIs+f6UqqXgARCyf8l2Iho=
+
esbuild@^0.8.34:
version "0.8.48"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.48.tgz#a57e4dde84ec56da1c6ecaefee97e9da6c5b00b5"
@@ -287,7 +576,52 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
-fsevents@~2.3.1:
+execa@^5.0.0:
+ version "5.1.1"
+ resolved "https://r.cnpmjs.org/execa/download/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
+ integrity sha1-+ArZy/Qpj3vR1MlVXCHpN0HEEd0=
+ dependencies:
+ cross-spawn "^7.0.3"
+ get-stream "^6.0.0"
+ human-signals "^2.1.0"
+ is-stream "^2.0.0"
+ merge-stream "^2.0.0"
+ npm-run-path "^4.0.1"
+ onetime "^5.1.2"
+ signal-exit "^3.0.3"
+ strip-final-newline "^2.0.0"
+
+fast-glob@^3.1.1:
+ version "3.2.7"
+ resolved "https://r.cnpmjs.org/fast-glob/download/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
+ integrity sha1-/Wy3otfpqnp4RhEehaGW1rL3ZqE=
+ dependencies:
+ "@nodelib/fs.stat" "^2.0.2"
+ "@nodelib/fs.walk" "^1.2.3"
+ glob-parent "^5.1.2"
+ merge2 "^1.3.0"
+ micromatch "^4.0.4"
+
+fastq@^1.6.0:
+ version "1.12.0"
+ resolved "https://r.cnpmjs.org/fastq/download/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794"
+ integrity sha1-7XtqtdYjk/ssxZHIU2UqXDGL95Q=
+ dependencies:
+ reusify "^1.0.4"
+
+fill-range@^7.0.1:
+ version "7.0.1"
+ resolved "https://r.cnpmjs.org/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
+ integrity sha1-GRmmp8df44ssfHflGYU12prN2kA=
+ dependencies:
+ to-regex-range "^5.0.1"
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://r.cnpmjs.org/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
+
+fsevents@~2.3.1, fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
@@ -302,16 +636,57 @@ gensync@^1.0.0-beta.1:
resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
+get-stream@^6.0.0:
+ version "6.0.1"
+ resolved "https://r.cnpmjs.org/get-stream/download/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
+ integrity sha1-omLY7vZ6ztV8KFKtYWdSakPL97c=
+
+glob-parent@^5.1.2, glob-parent@~5.1.2:
+ version "5.1.2"
+ resolved "https://r.cnpmjs.org/glob-parent/download/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
+ integrity sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=
+ dependencies:
+ is-glob "^4.0.1"
+
+glob@7.1.6:
+ version "7.1.6"
+ resolved "https://r.cnpmjs.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
+ integrity sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
globals@^11.1.0:
version "11.12.0"
resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
+globby@^11.0.3:
+ version "11.0.4"
+ resolved "https://r.cnpmjs.org/globby/download/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
+ integrity sha1-LLr/d8Lypi5x6bKBOme5ejowAaU=
+ dependencies:
+ array-union "^2.1.0"
+ dir-glob "^3.0.1"
+ fast-glob "^3.1.1"
+ ignore "^5.1.4"
+ merge2 "^1.3.0"
+ slash "^3.0.0"
+
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
+has-flag@^4.0.0:
+ version "4.0.0"
+ resolved "https://r.cnpmjs.org/has-flag/download/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
+ integrity sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=
+
has@^1.0.3:
version "1.0.3"
resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
@@ -319,6 +694,50 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
+human-signals@^2.1.0:
+ version "2.1.0"
+ resolved "https://r.cnpmjs.org/human-signals/download/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
+ integrity sha1-3JH8ukLk0G5Kuu0zs+ejwC9RTqA=
+
+ignore@^5.1.4:
+ version "5.1.8"
+ resolved "https://r.cnpmjs.org/ignore/download/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
+ integrity sha1-8VCotQo0KJsz4i9YiavU2AFvDlc=
+
+import-cwd@^3.0.0:
+ version "3.0.0"
+ resolved "https://r.cnpmjs.org/import-cwd/download/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92"
+ integrity sha1-IIRVR3GAFRJuqbNna3WS+4vUz5I=
+ dependencies:
+ import-from "^3.0.0"
+
+import-from@^3.0.0:
+ version "3.0.0"
+ resolved "https://r.cnpmjs.org/import-from/download/import-from-3.0.0.tgz#055cfec38cd5a27d8057ca51376d7d3bf0891966"
+ integrity sha1-BVz+w4zVon2AV8pRN219O/CJGWY=
+ dependencies:
+ resolve-from "^5.0.0"
+
+inflight@^1.0.4:
+ version "1.0.6"
+ resolved "https://r.cnpmjs.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
+ integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
+ dependencies:
+ once "^1.3.0"
+ wrappy "1"
+
+inherits@2:
+ version "2.0.4"
+ resolved "https://r.cnpmjs.org/inherits/download/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
+ integrity sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=
+
+is-binary-path@~2.1.0:
+ version "2.1.0"
+ resolved "https://r.cnpmjs.org/is-binary-path/download/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
+ integrity sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=
+ dependencies:
+ binary-extensions "^2.0.0"
+
is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
@@ -326,6 +745,38 @@ is-core-module@^2.2.0:
dependencies:
has "^1.0.3"
+is-extglob@^2.1.1:
+ version "2.1.1"
+ resolved "https://r.cnpmjs.org/is-extglob/download/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
+ integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
+
+is-glob@^4.0.1, is-glob@~4.0.1:
+ version "4.0.1"
+ resolved "https://r.cnpmjs.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
+ integrity sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=
+ dependencies:
+ is-extglob "^2.1.1"
+
+is-number@^7.0.0:
+ version "7.0.0"
+ resolved "https://r.cnpmjs.org/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
+ integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=
+
+is-stream@^2.0.0:
+ version "2.0.1"
+ resolved "https://r.cnpmjs.org/is-stream/download/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"
+ integrity sha1-+sHj1TuXrVqdCunO8jifWBClwHc=
+
+isexe@^2.0.0:
+ version "2.0.0"
+ resolved "https://r.cnpmjs.org/isexe/download/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
+ integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
+
+joycon@^3.0.1:
+ version "3.0.1"
+ resolved "https://r.cnpmjs.org/joycon/download/joycon-3.0.1.tgz#9074c9b08ccf37a6726ff74a18485f85efcaddaf"
+ integrity sha1-kHTJsIzPN6Zyb/dKGEhfhe/K3a8=
+
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -336,6 +787,13 @@ jsesc@^2.5.1:
resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
+json2mq@^0.2.0:
+ version "0.2.0"
+ resolved "https://r.cnpmjs.org/json2mq/download/json2mq-0.2.0.tgz#b637bd3ba9eabe122c83e9720483aeb10d2c904a"
+ integrity sha1-tje9O6nqvhIsg+lyBIOusQ0skEo=
+ dependencies:
+ string-convert "^0.2.0"
+
json5@^2.1.2:
version "2.2.0"
resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
@@ -343,43 +801,169 @@ json5@^2.1.2:
dependencies:
minimist "^1.2.5"
+lilconfig@^2.0.3:
+ version "2.0.3"
+ resolved "https://r.cnpmjs.org/lilconfig/download/lilconfig-2.0.3.tgz#68f3005e921dafbd2a2afb48379986aa6d2579fd"
+ integrity sha1-aPMAXpIdr70qKvtIN5mGqm0lef0=
+
+lines-and-columns@^1.1.6:
+ version "1.1.6"
+ resolved "https://r.cnpmjs.org/lines-and-columns/download/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
+ integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=
+
lodash@^4.17.19:
version "4.17.20"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
-loose-envify@^1.1.0:
+lodash@^4.17.21:
+ version "4.17.21"
+ resolved "https://r.cnpmjs.org/lodash/download/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
+ integrity sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw=
+
+loose-envify@^1.0.0, loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
+merge-stream@^2.0.0:
+ version "2.0.0"
+ resolved "https://r.cnpmjs.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
+ integrity sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=
+
+merge2@^1.3.0:
+ version "1.4.1"
+ resolved "https://r.cnpmjs.org/merge2/download/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
+ integrity sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=
+
+micromatch@^4.0.4:
+ version "4.0.4"
+ resolved "https://r.cnpmjs.org/micromatch/download/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
+ integrity sha1-iW1Rnf6dsl/OlM63pQCRm/iB6/k=
+ dependencies:
+ braces "^3.0.1"
+ picomatch "^2.2.3"
+
+mimic-fn@^2.1.0:
+ version "2.1.0"
+ resolved "https://r.cnpmjs.org/mimic-fn/download/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
+ integrity sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=
+
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://r.cnpmjs.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=
+ dependencies:
+ brace-expansion "^1.1.7"
+
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
+moment@^2.24.0, moment@^2.25.3:
+ version "2.29.1"
+ resolved "https://r.cnpmjs.org/moment/download/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+ integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=
+
ms@2.1.2:
version "2.1.2"
resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+mz@^2.7.0:
+ version "2.7.0"
+ resolved "https://r.cnpmjs.org/mz/download/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
+ integrity sha1-lQCAV6Vsr63CvGPd5/n/aVWUjjI=
+ dependencies:
+ any-promise "^1.0.0"
+ object-assign "^4.0.1"
+ thenify-all "^1.0.0"
+
nanoid@^3.1.20:
version "3.1.20"
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788"
integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==
-object-assign@^4.1.1:
+node-modules-regexp@^1.0.0:
+ version "1.0.0"
+ resolved "https://r.cnpmjs.org/node-modules-regexp/download/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40"
+ integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=
+
+normalize-path@^3.0.0, normalize-path@~3.0.0:
+ version "3.0.0"
+ resolved "https://r.cnpmjs.org/normalize-path/download/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
+ integrity sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=
+
+npm-run-path@^4.0.1:
+ version "4.0.1"
+ resolved "https://r.cnpmjs.org/npm-run-path/download/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea"
+ integrity sha1-t+zR5e1T2o43pV4cImnguX7XSOo=
+ dependencies:
+ path-key "^3.0.0"
+
+object-assign@^4.0.1, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
+once@^1.3.0:
+ version "1.4.0"
+ resolved "https://r.cnpmjs.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
+ dependencies:
+ wrappy "1"
+
+onetime@^5.1.2:
+ version "5.1.2"
+ resolved "https://r.cnpmjs.org/onetime/download/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"
+ integrity sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=
+ dependencies:
+ mimic-fn "^2.1.0"
+
+path-is-absolute@^1.0.0:
+ version "1.0.1"
+ resolved "https://r.cnpmjs.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+ integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
+
+path-key@^3.0.0, path-key@^3.1.0:
+ version "3.1.1"
+ resolved "https://r.cnpmjs.org/path-key/download/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
+ integrity sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=
+
path-parse@^1.0.6:
version "1.0.6"
resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
+path-type@^4.0.0:
+ version "4.0.0"
+ resolved "https://r.cnpmjs.org/path-type/download/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
+ integrity sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=
+
+picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
+ version "2.3.0"
+ resolved "https://r.cnpmjs.org/picomatch/download/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
+ integrity sha1-8fBh3o9qS/AiiS4tEoI0+5gwKXI=
+
+pirates@^4.0.1:
+ version "4.0.1"
+ resolved "https://r.cnpmjs.org/pirates/download/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"
+ integrity sha1-ZDqSyviUVm+RsrmG0sZpUKji+4c=
+ dependencies:
+ node-modules-regexp "^1.0.0"
+
+postcss-load-config@^3.0.1:
+ version "3.1.0"
+ resolved "https://r.cnpmjs.org/postcss-load-config/download/postcss-load-config-3.1.0.tgz#d39c47091c4aec37f50272373a6a648ef5e97829"
+ integrity sha1-05xHCRxK7Df1AnI3OmpkjvXpeCk=
+ dependencies:
+ import-cwd "^3.0.0"
+ lilconfig "^2.0.3"
+ yaml "^1.10.2"
+
postcss@^8.2.1:
version "8.2.6"
resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.6.tgz#5d69a974543b45f87e464bc4c3e392a97d6be9fe"
@@ -389,6 +973,355 @@ postcss@^8.2.1:
nanoid "^3.1.20"
source-map "^0.6.1"
+queue-microtask@^1.2.2:
+ version "1.2.3"
+ resolved "https://r.cnpmjs.org/queue-microtask/download/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
+ integrity sha1-SSkii7xyTfrEPg77BYyve2z7YkM=
+
+rc-align@^4.0.0:
+ version "4.0.11"
+ resolved "https://r.cnpmjs.org/rc-align/download/rc-align-4.0.11.tgz#8198c62db266bc1b8ef05e56c13275bf72628a5e"
+ integrity sha1-gZjGLbJmvBuO8F5WwTJ1v3Jiil4=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ dom-align "^1.7.0"
+ lodash "^4.17.21"
+ rc-util "^5.3.0"
+ resize-observer-polyfill "^1.5.1"
+
+rc-cascader@~1.4.0:
+ version "1.4.3"
+ resolved "https://r.cnpmjs.org/rc-cascader/download/rc-cascader-1.4.3.tgz#d91b0dcf8157b60ebe9ec3e58b4db054d5299464"
+ integrity sha1-2RsNz4FXtg6+nsPli02wVNUplGQ=
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+ array-tree-filter "^2.1.0"
+ rc-trigger "^5.0.4"
+ rc-util "^5.0.1"
+ warning "^4.0.1"
+
+rc-checkbox@~2.3.0:
+ version "2.3.2"
+ resolved "https://r.cnpmjs.org/rc-checkbox/download/rc-checkbox-2.3.2.tgz#f91b3678c7edb2baa8121c9483c664fa6f0aefc1"
+ integrity sha1-+Rs2eMftsrqoEhyUg8Zk+m8K78E=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+
+rc-collapse@~3.1.0:
+ version "3.1.2"
+ resolved "https://r.cnpmjs.org/rc-collapse/download/rc-collapse-3.1.2.tgz#76028a811b845d03d9460ccc409c7ea8ad09db14"
+ integrity sha1-dgKKgRuEXQPZRgzMQJx+qK0J2xQ=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ rc-motion "^2.3.4"
+ rc-util "^5.2.1"
+ shallowequal "^1.1.0"
+
+rc-dialog@~8.6.0:
+ version "8.6.0"
+ resolved "https://r.cnpmjs.org/rc-dialog/download/rc-dialog-8.6.0.tgz#3b228dac085de5eed8c6237f31162104687442e7"
+ integrity sha1-OyKNrAhd5e7YxiN/MRYhBGh0Quc=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.6"
+ rc-motion "^2.3.0"
+ rc-util "^5.6.1"
+
+rc-drawer@~4.3.0:
+ version "4.3.1"
+ resolved "https://r.cnpmjs.org/rc-drawer/download/rc-drawer-4.3.1.tgz#356333a7af01b777abd685c96c2ce62efb44f3f3"
+ integrity sha1-NWMzp68Bt3er1oXJbCzmLvtE8/M=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.6"
+ rc-util "^5.7.0"
+
+rc-dropdown@^3.2.0, rc-dropdown@~3.2.0:
+ version "3.2.0"
+ resolved "https://r.cnpmjs.org/rc-dropdown/download/rc-dropdown-3.2.0.tgz#da6c2ada403842baee3a9e909a0b1a91ba3e1090"
+ integrity sha1-2mwq2kA4QrruOp6Qmgsakbo+EJA=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.6"
+ rc-trigger "^5.0.4"
+
+rc-field-form@~1.20.0:
+ version "1.20.1"
+ resolved "https://r.cnpmjs.org/rc-field-form/download/rc-field-form-1.20.1.tgz#d1c51888107cf075b42704b7b575bef84c359291"
+ integrity sha1-0cUYiBB88HW0JwS3tXW++Ew1kpE=
+ dependencies:
+ "@babel/runtime" "^7.8.4"
+ async-validator "^3.0.3"
+ rc-util "^5.8.0"
+
+rc-image@~5.2.5:
+ version "5.2.5"
+ resolved "https://r.cnpmjs.org/rc-image/download/rc-image-5.2.5.tgz#44e6ffc842626827960e7ab72e1c0d6f3a8ce440"
+ integrity sha1-ROb/yEJiaCeWDnq3LhwNbzqM5EA=
+ dependencies:
+ "@babel/runtime" "^7.11.2"
+ classnames "^2.2.6"
+ rc-dialog "~8.6.0"
+ rc-util "^5.0.6"
+
+rc-input-number@~7.1.0:
+ version "7.1.4"
+ resolved "https://r.cnpmjs.org/rc-input-number/download/rc-input-number-7.1.4.tgz#9d7410c91ff8dc6384d0233c20df278982989f9a"
+ integrity sha1-nXQQyR/43GOE0CM8IN8niYKYn5o=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.5"
+ rc-util "^5.9.8"
+
+rc-mentions@~1.6.1:
+ version "1.6.1"
+ resolved "https://r.cnpmjs.org/rc-mentions/download/rc-mentions-1.6.1.tgz#46035027d64aa33ef840ba0fbd411871e34617ae"
+ integrity sha1-RgNQJ9ZKoz74QLoPvUEYceNGF64=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.6"
+ rc-menu "^9.0.0"
+ rc-textarea "^0.3.0"
+ rc-trigger "^5.0.4"
+ rc-util "^5.0.1"
+
+rc-menu@^9.0.0, rc-menu@~9.0.12:
+ version "9.0.12"
+ resolved "https://r.cnpmjs.org/rc-menu/download/rc-menu-9.0.12.tgz#492c4bb07a596e2ce07587c669b27ee28c3810c5"
+ integrity sha1-SSxLsHpZbizgdYfGabJ+4ow4EMU=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ rc-motion "^2.4.3"
+ rc-overflow "^1.2.0"
+ rc-trigger "^5.1.2"
+ rc-util "^5.12.0"
+ shallowequal "^1.1.0"
+
+rc-motion@^2.0.0, rc-motion@^2.0.1, rc-motion@^2.2.0, rc-motion@^2.3.0, rc-motion@^2.3.4, rc-motion@^2.4.0, rc-motion@^2.4.3:
+ version "2.4.4"
+ resolved "https://r.cnpmjs.org/rc-motion/download/rc-motion-2.4.4.tgz#e995d5fa24fc93065c24f714857cf2677d655bb0"
+ integrity sha1-6ZXV+iT8kwZcJPcUhXzyZ31lW7A=
+ dependencies:
+ "@babel/runtime" "^7.11.1"
+ classnames "^2.2.1"
+ rc-util "^5.2.1"
+
+rc-notification@~4.5.7:
+ version "4.5.7"
+ resolved "https://r.cnpmjs.org/rc-notification/download/rc-notification-4.5.7.tgz#265e6e6a0c1a0fac63d6abd4d832eb8ff31522f1"
+ integrity sha1-Jl5uagwaD6xj1qvU2DLrj/MVIvE=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ rc-motion "^2.2.0"
+ rc-util "^5.0.1"
+
+rc-overflow@^1.0.0, rc-overflow@^1.2.0:
+ version "1.2.2"
+ resolved "https://r.cnpmjs.org/rc-overflow/download/rc-overflow-1.2.2.tgz#95b0222016c0cdbdc0db85f569c262e7706a5f22"
+ integrity sha1-lbAiIBbAzb3A24X1acJi53BqXyI=
+ dependencies:
+ "@babel/runtime" "^7.11.1"
+ classnames "^2.2.1"
+ rc-resize-observer "^1.0.0"
+ rc-util "^5.5.1"
+
+rc-pagination@~3.1.9:
+ version "3.1.9"
+ resolved "https://r.cnpmjs.org/rc-pagination/download/rc-pagination-3.1.9.tgz#797ad75d85b1ef7a82801207ead410110337fdd6"
+ integrity sha1-eXrXXYWx73qCgBIH6tQQEQM3/dY=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+
+rc-picker@~2.5.10:
+ version "2.5.17"
+ resolved "https://r.cnpmjs.org/rc-picker/download/rc-picker-2.5.17.tgz#323cae3a192d429b540edaa66974947d3ec8703c"
+ integrity sha1-MjyuOhktQptUDtqmaXSUfT7IcDw=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+ date-fns "2.x"
+ dayjs "1.x"
+ moment "^2.24.0"
+ rc-trigger "^5.0.4"
+ rc-util "^5.4.0"
+ shallowequal "^1.1.0"
+
+rc-progress@~3.1.0:
+ version "3.1.4"
+ resolved "https://r.cnpmjs.org/rc-progress/download/rc-progress-3.1.4.tgz#66040d0fae7d8ced2b38588378eccb2864bad615"
+ integrity sha1-ZgQND659jO0rOFiDeOzLKGS61hU=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.6"
+
+rc-rate@~2.9.0:
+ version "2.9.1"
+ resolved "https://r.cnpmjs.org/rc-rate/download/rc-rate-2.9.1.tgz#e43cb95c4eb90a2c1e0b16ec6614d8c43530a731"
+ integrity sha1-5Dy5XE65CiweCxbsZhTYxDUwpzE=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.5"
+ rc-util "^5.0.1"
+
+rc-resize-observer@^1.0.0:
+ version "1.0.1"
+ resolved "https://r.cnpmjs.org/rc-resize-observer/download/rc-resize-observer-1.0.1.tgz#ccd0986543ff1bf49f8a581e8ac4bb714ed24dcd"
+ integrity sha1-zNCYZUP/G/SfilgeisS7cU7STc0=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+ rc-util "^5.0.0"
+ resize-observer-polyfill "^1.5.1"
+
+rc-select@^12.0.0, rc-select@~12.1.6:
+ version "12.1.13"
+ resolved "https://r.cnpmjs.org/rc-select/download/rc-select-12.1.13.tgz#c33560ccb9339d30695b52458f55efc35af35273"
+ integrity sha1-wzVgzLkznTBpW1JFj1Xvw1rzUnM=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ rc-motion "^2.0.1"
+ rc-overflow "^1.0.0"
+ rc-trigger "^5.0.4"
+ rc-util "^5.9.8"
+ rc-virtual-list "^3.2.0"
+
+rc-slider@~9.7.1:
+ version "9.7.2"
+ resolved "https://r.cnpmjs.org/rc-slider/download/rc-slider-9.7.2.tgz#282f571f7582752ebaa33964e441184f4e79ad74"
+ integrity sha1-KC9XH3WCdS66ozlk5EEYT055rXQ=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.5"
+ rc-tooltip "^5.0.1"
+ rc-util "^5.0.0"
+ shallowequal "^1.1.0"
+
+rc-steps@~4.1.0:
+ version "4.1.3"
+ resolved "https://r.cnpmjs.org/rc-steps/download/rc-steps-4.1.3.tgz#208580e22db619e3830ddb7fa41bc886c65d9803"
+ integrity sha1-IIWA4i22GeODDdt/pBvIhsZdmAM=
+ dependencies:
+ "@babel/runtime" "^7.10.2"
+ classnames "^2.2.3"
+ rc-util "^5.0.1"
+
+rc-switch@~3.2.0:
+ version "3.2.2"
+ resolved "https://r.cnpmjs.org/rc-switch/download/rc-switch-3.2.2.tgz#d001f77f12664d52595b4f6fb425dd9e66fba8e8"
+ integrity sha1-0AH3fxJmTVJZW09vtCXdnmb7qOg=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+ rc-util "^5.0.1"
+
+rc-table@~7.15.1:
+ version "7.15.2"
+ resolved "https://r.cnpmjs.org/rc-table/download/rc-table-7.15.2.tgz#f6ab73b2cfb1c76f3cf9682c855561423c6b5b22"
+ integrity sha1-9qtzss+xx288+WgshVVhQjxrWyI=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.5"
+ rc-resize-observer "^1.0.0"
+ rc-util "^5.13.0"
+ shallowequal "^1.1.0"
+
+rc-tabs@~11.10.0:
+ version "11.10.1"
+ resolved "https://r.cnpmjs.org/rc-tabs/download/rc-tabs-11.10.1.tgz#7b112f78bac998480c777ae160adc425e3fdb7cb"
+ integrity sha1-exEveLrJmEgMd3rhYK3EJeP9t8s=
+ dependencies:
+ "@babel/runtime" "^7.11.2"
+ classnames "2.x"
+ rc-dropdown "^3.2.0"
+ rc-menu "^9.0.0"
+ rc-resize-observer "^1.0.0"
+ rc-util "^5.5.0"
+
+rc-textarea@^0.3.0, rc-textarea@~0.3.0:
+ version "0.3.5"
+ resolved "https://r.cnpmjs.org/rc-textarea/download/rc-textarea-0.3.5.tgz#07ed445dddb94e5ae6764676923a49bddad9b2ec"
+ integrity sha1-B+1EXd25TlrmdkZ2kjpJvdrZsuw=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+ rc-resize-observer "^1.0.0"
+ rc-util "^5.7.0"
+
+rc-tooltip@^5.0.1, rc-tooltip@~5.1.1:
+ version "5.1.1"
+ resolved "https://r.cnpmjs.org/rc-tooltip/download/rc-tooltip-5.1.1.tgz#94178ed162d0252bc4993b725f5dc2ac0fccf154"
+ integrity sha1-lBeO0WLQJSvEmTtyX13CrA/M8VQ=
+ dependencies:
+ "@babel/runtime" "^7.11.2"
+ rc-trigger "^5.0.0"
+
+rc-tree-select@~4.3.0:
+ version "4.3.3"
+ resolved "https://r.cnpmjs.org/rc-tree-select/download/rc-tree-select-4.3.3.tgz#28eba4d8a8dc8c0f9b61d83ce465842a6915eca4"
+ integrity sha1-KOuk2KjcjA+bYdg85GWEKmkV7KQ=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ rc-select "^12.0.0"
+ rc-tree "^4.0.0"
+ rc-util "^5.0.5"
+
+rc-tree@^4.0.0, rc-tree@~4.2.1:
+ version "4.2.2"
+ resolved "https://r.cnpmjs.org/rc-tree/download/rc-tree-4.2.2.tgz#4429187cbbfbecbe989714a607e3de8b3ab7763f"
+ integrity sha1-RCkYfLv77L6YlxSmB+Peizq3dj8=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "2.x"
+ rc-motion "^2.0.1"
+ rc-util "^5.0.0"
+ rc-virtual-list "^3.0.1"
+
+rc-trigger@^5.0.0, rc-trigger@^5.0.4, rc-trigger@^5.1.2, rc-trigger@^5.2.10:
+ version "5.2.10"
+ resolved "https://r.cnpmjs.org/rc-trigger/download/rc-trigger-5.2.10.tgz#8a0057a940b1b9027eaa33beec8a6ecd85cce2b1"
+ integrity sha1-igBXqUCxuQJ+qjO+7IpuzYXM4rE=
+ dependencies:
+ "@babel/runtime" "^7.11.2"
+ classnames "^2.2.6"
+ rc-align "^4.0.0"
+ rc-motion "^2.0.0"
+ rc-util "^5.5.0"
+
+rc-upload@~4.3.0:
+ version "4.3.1"
+ resolved "https://r.cnpmjs.org/rc-upload/download/rc-upload-4.3.1.tgz#d6ee66b8bd1e1dd2f78526c486538423f7e7ed84"
+ integrity sha1-1u5muL0eHdL3hSbEhlOEI/fn7YQ=
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.5"
+ rc-util "^5.2.0"
+
+rc-util@^5.0.0, rc-util@^5.0.1, rc-util@^5.0.5, rc-util@^5.0.6, rc-util@^5.0.7, rc-util@^5.12.0, rc-util@^5.13.0, rc-util@^5.13.1, rc-util@^5.2.0, rc-util@^5.2.1, rc-util@^5.3.0, rc-util@^5.4.0, rc-util@^5.5.0, rc-util@^5.5.1, rc-util@^5.6.1, rc-util@^5.7.0, rc-util@^5.8.0, rc-util@^5.9.4, rc-util@^5.9.8:
+ version "5.13.2"
+ resolved "https://r.cnpmjs.org/rc-util/download/rc-util-5.13.2.tgz#a8a0bb77743351841ba8bed6393e03b8d2f685c8"
+ integrity sha1-qKC7d3QzUYQbqL7WOT4DuNL2hcg=
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+ react-is "^16.12.0"
+ shallowequal "^1.1.0"
+
+rc-virtual-list@^3.0.1, rc-virtual-list@^3.2.0:
+ version "3.4.1"
+ resolved "https://r.cnpmjs.org/rc-virtual-list/download/rc-virtual-list-3.4.1.tgz#1f3b41391acf033a6c7e84c2f4e8a4ee0dc72807"
+ integrity sha1-HztBORrPAzpsfoTC9Oik7g3HKAc=
+ dependencies:
+ classnames "^2.2.6"
+ rc-resize-observer "^1.0.0"
+ rc-util "^5.0.7"
+
react-dom@^17.0.0:
version "17.0.1"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6"
@@ -398,6 +1331,11 @@ react-dom@^17.0.0:
object-assign "^4.1.1"
scheduler "^0.20.1"
+react-is@^16.12.0:
+ version "16.13.1"
+ resolved "https://r.cnpmjs.org/react-is/download/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
+ integrity sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=
+
react-refresh@^0.9.0:
version "0.9.0"
resolved "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz#71863337adc3e5c2f8a6bfddd12ae3bfe32aafbf"
@@ -411,6 +1349,28 @@ react@^17.0.0:
loose-envify "^1.1.0"
object-assign "^4.1.1"
+readdirp@~3.6.0:
+ version "3.6.0"
+ resolved "https://r.cnpmjs.org/readdirp/download/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
+ integrity sha1-dKNwvYVxFuJFspzJc0DNQxoCpsc=
+ dependencies:
+ picomatch "^2.2.1"
+
+regenerator-runtime@^0.13.4:
+ version "0.13.9"
+ resolved "https://r.cnpmjs.org/regenerator-runtime/download/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
+ integrity sha1-iSV0Kpj/2QgUmI11Zq0wyjsmO1I=
+
+resize-observer-polyfill@^1.5.0, resize-observer-polyfill@^1.5.1:
+ version "1.5.1"
+ resolved "https://r.cnpmjs.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
+ integrity sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ=
+
+resolve-from@^5.0.0:
+ version "5.0.0"
+ resolved "https://r.cnpmjs.org/resolve-from/download/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
+ integrity sha1-w1IlhD3493bfIcV1V7wIfp39/Gk=
+
resolve@^1.19.0:
version "1.20.0"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
@@ -419,6 +1379,11 @@ resolve@^1.19.0:
is-core-module "^2.2.0"
path-parse "^1.0.6"
+reusify@^1.0.4:
+ version "1.0.4"
+ resolved "https://r.cnpmjs.org/reusify/download/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
+ integrity sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=
+
rollup@^2.38.5:
version "2.39.0"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.39.0.tgz#be4f98c9e421793a8fec82c854fb567c35e22ab6"
@@ -426,6 +1391,20 @@ rollup@^2.38.5:
optionalDependencies:
fsevents "~2.3.1"
+rollup@^2.56.1:
+ version "2.56.3"
+ resolved "https://r.cnpmjs.org/rollup/download/rollup-2.56.3.tgz#b63edadd9851b0d618a6d0e6af8201955a77aeff"
+ integrity sha1-tj7a3ZhRsNYYptDmr4IBlVp3rv8=
+ optionalDependencies:
+ fsevents "~2.3.2"
+
+run-parallel@^1.1.9:
+ version "1.2.0"
+ resolved "https://r.cnpmjs.org/run-parallel/download/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
+ integrity sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=
+ dependencies:
+ queue-microtask "^1.2.2"
+
safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@@ -439,11 +1418,45 @@ scheduler@^0.20.1:
loose-envify "^1.1.0"
object-assign "^4.1.1"
+scroll-into-view-if-needed@^2.2.25:
+ version "2.2.28"
+ resolved "https://r.cnpmjs.org/scroll-into-view-if-needed/download/scroll-into-view-if-needed-2.2.28.tgz#5a15b2f58a52642c88c8eca584644e01703d645a"
+ integrity sha1-WhWy9YpSZCyIyOylhGROAXA9ZFo=
+ dependencies:
+ compute-scroll-into-view "^1.0.17"
+
semver@^5.4.1:
version "5.7.1"
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
+shallowequal@^1.1.0:
+ version "1.1.0"
+ resolved "https://r.cnpmjs.org/shallowequal/download/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
+ integrity sha1-GI1SHelbkIdAT9TctosT3wrk5/g=
+
+shebang-command@^2.0.0:
+ version "2.0.0"
+ resolved "https://r.cnpmjs.org/shebang-command/download/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
+ integrity sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=
+ dependencies:
+ shebang-regex "^3.0.0"
+
+shebang-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://r.cnpmjs.org/shebang-regex/download/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
+ integrity sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=
+
+signal-exit@^3.0.3:
+ version "3.0.3"
+ resolved "https://r.cnpmjs.org/signal-exit/download/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
+ integrity sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=
+
+slash@^3.0.0:
+ version "3.0.0"
+ resolved "https://r.cnpmjs.org/slash/download/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
+ integrity sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=
+
source-map@^0.5.0:
version "0.5.7"
resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
@@ -454,6 +1467,28 @@ source-map@^0.6.1:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
+string-convert@^0.2.0:
+ version "0.2.1"
+ resolved "https://r.cnpmjs.org/string-convert/download/string-convert-0.2.1.tgz#6982cc3049fbb4cd85f8b24568b9d9bf39eeff97"
+ integrity sha1-aYLMMEn7tM2F+LJFaLnZvznu/5c=
+
+strip-final-newline@^2.0.0:
+ version "2.0.0"
+ resolved "https://r.cnpmjs.org/strip-final-newline/download/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
+ integrity sha1-ibhS+y/L6Tb29LMYevsKEsGrWK0=
+
+sucrase@^3.18.1:
+ version "3.20.1"
+ resolved "https://r.cnpmjs.org/sucrase/download/sucrase-3.20.1.tgz#1c055e97d0fab2f9857f02461364075b3a4ab226"
+ integrity sha1-HAVel9D6svmFfwJGE2QHWzpKsiY=
+ dependencies:
+ commander "^4.0.0"
+ glob "7.1.6"
+ lines-and-columns "^1.1.6"
+ mz "^2.7.0"
+ pirates "^4.0.1"
+ ts-interface-checker "^0.1.9"
+
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
@@ -461,11 +1496,73 @@ supports-color@^5.3.0:
dependencies:
has-flag "^3.0.0"
+supports-color@^7.1.0:
+ version "7.2.0"
+ resolved "https://r.cnpmjs.org/supports-color/download/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+ integrity sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=
+ dependencies:
+ has-flag "^4.0.0"
+
+thenify-all@^1.0.0:
+ version "1.6.0"
+ resolved "https://r.cnpmjs.org/thenify-all/download/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
+ integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=
+ dependencies:
+ thenify ">= 3.1.0 < 4"
+
+"thenify@>= 3.1.0 < 4":
+ version "3.3.1"
+ resolved "https://r.cnpmjs.org/thenify/download/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f"
+ integrity sha1-iTLmhqQGYDigFt2eLKRq3Zg4qV8=
+ dependencies:
+ any-promise "^1.0.0"
+
to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
+to-regex-range@^5.0.1:
+ version "5.0.1"
+ resolved "https://r.cnpmjs.org/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
+ integrity sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=
+ dependencies:
+ is-number "^7.0.0"
+
+toggle-selection@^1.0.6:
+ version "1.0.6"
+ resolved "https://r.cnpmjs.org/toggle-selection/download/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32"
+ integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI=
+
+tree-kill@^1.2.2:
+ version "1.2.2"
+ resolved "https://r.cnpmjs.org/tree-kill/download/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
+ integrity sha1-TKCakJLIi3OnzcXooBtQeweQoMw=
+
+ts-interface-checker@^0.1.9:
+ version "0.1.13"
+ resolved "https://r.cnpmjs.org/ts-interface-checker/download/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699"
+ integrity sha1-eE/T1nlyK8EDsbS4AwvN212yppk=
+
+tsup@^4.14.0:
+ version "4.14.0"
+ resolved "https://r.cnpmjs.org/tsup/download/tsup-4.14.0.tgz#3e2f602d8446041b48fcb557904a709c0fcec981"
+ integrity sha1-Pi9gLYRGBBtI/LVXkEpwnA/OyYE=
+ dependencies:
+ cac "^6.7.2"
+ chalk "^4.1.0"
+ chokidar "^3.5.1"
+ debug "^4.3.1"
+ esbuild "^0.12.9"
+ execa "^5.0.0"
+ globby "^11.0.3"
+ joycon "^3.0.1"
+ postcss-load-config "^3.0.1"
+ resolve-from "^5.0.0"
+ rollup "^2.56.1"
+ sucrase "^3.18.1"
+ tree-kill "^1.2.2"
+
typescript@^4.1.2:
version "4.1.5"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72"
@@ -482,3 +1579,27 @@ vite@^2.0.0:
rollup "^2.38.5"
optionalDependencies:
fsevents "~2.3.1"
+
+warning@^4.0.1:
+ version "4.0.3"
+ resolved "https://r.cnpmjs.org/warning/download/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
+ integrity sha1-Fungd+uKhtavfWSqHgX9hbRnjKM=
+ dependencies:
+ loose-envify "^1.0.0"
+
+which@^2.0.1:
+ version "2.0.2"
+ resolved "https://r.cnpmjs.org/which/download/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
+ integrity sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=
+ dependencies:
+ isexe "^2.0.0"
+
+wrappy@1:
+ version "1.0.2"
+ resolved "https://r.cnpmjs.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+
+yaml@^1.10.2:
+ version "1.10.2"
+ resolved "https://r.cnpmjs.org/yaml/download/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
+ integrity sha1-IwHF/78StGfejaIzOkWeKeeSDks=