@next-core/illustrations 0.4.3-alpha.0 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [0.4.3-alpha.0](https://github.com/easyops-cn/next-core/compare/@next-core/illustrations@0.4.2...@next-core/illustrations@0.4.3-alpha.0) (2021-11-03)
6
+ ## [0.4.6](https://github.com/easyops-cn/next-core/compare/@next-core/illustrations@0.4.5...@next-core/illustrations@0.4.6) (2021-12-17)
7
+
8
+ **Note:** Version bump only for package @next-core/illustrations
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.4.5](https://github.com/easyops-cn/next-core/compare/@next-core/illustrations@0.4.4...@next-core/illustrations@0.4.5) (2021-11-18)
15
+
16
+ **Note:** Version bump only for package @next-core/illustrations
17
+
18
+ ## [0.4.4](https://github.com/easyops-cn/next-core/compare/@next-core/illustrations@0.4.3...@next-core/illustrations@0.4.4) (2021-11-11)
19
+
20
+ ### Bug Fixes
21
+
22
+ - refine assets path ([8cb81cc](https://github.com/easyops-cn/next-core/commit/8cb81cc748ee14686d71bce1a86dd0fdda1037e9))
23
+
24
+ ## [0.4.3](https://github.com/easyops-cn/next-core/compare/@next-core/illustrations@0.4.2...@next-core/illustrations@0.4.3) (2021-11-09)
7
25
 
8
26
  **Note:** Version bump only for package @next-core/illustrations
9
27
 
@@ -5,45 +5,36 @@
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
7
  var illustrationsByCategory = {
8
- default: ["birthday-blue", "birthday-red", "birthday-yellow", "browser-version-low", "create-content", "no-content", "no-history", "search-empty"],
8
+ default: ["browser-version-low", "create-content", "no-content", "no-history", "search-empty"],
9
9
  exception: ["http-403", "http-404", "http-500"],
10
10
  feedback: ["exception", "fail", "info", "success"]
11
11
  };
12
12
 
13
- var DefaultBirthdayBlue = "assets/illustrations/default/birthday-blue.725e94bdb58af246.png";
13
+ var DefaultBrowserVersionLow = "default/browser-version-low.c0e16e995fe2474f.png";
14
14
 
15
- var DefaultBirthdayRed = "assets/illustrations/default/birthday-red.73eba780c31e5a22.png";
15
+ var DefaultCreateContent = "default/create-content.9f74e681aa0c3136.png";
16
16
 
17
- var DefaultBirthdayYellow = "assets/illustrations/default/birthday-yellow.994b67cde0e5e1db.png";
17
+ var DefaultNoContent = "default/no-content.b2fae2fe14b82db3.png";
18
18
 
19
- var DefaultBrowserVersionLow = "assets/illustrations/default/browser-version-low.c0e16e995fe2474f.png";
19
+ var DefaultNoHistory = "default/no-history.640c8692cc7b6873.png";
20
20
 
21
- var DefaultCreateContent = "assets/illustrations/default/create-content.9f74e681aa0c3136.png";
21
+ var DefaultSearchEmpty = "default/search-empty.4587158283ed7ce9.png";
22
22
 
23
- var DefaultNoContent = "assets/illustrations/default/no-content.b2fae2fe14b82db3.png";
23
+ var ExceptionHttp_403 = "exception/http-403.494862e54e1cd3b7.png";
24
24
 
25
- var DefaultNoHistory = "assets/illustrations/default/no-history.640c8692cc7b6873.png";
25
+ var ExceptionHttp_404 = "exception/http-404.b0415e68da2c9764.png";
26
26
 
27
- var DefaultSearchEmpty = "assets/illustrations/default/search-empty.4587158283ed7ce9.png";
27
+ var ExceptionHttp_500 = "exception/http-500.0bb6e8481269dc01.png";
28
28
 
29
- var ExceptionHttp_403 = "assets/illustrations/exception/http-403.494862e54e1cd3b7.png";
29
+ var FeedbackException = "feedback/exception.31d66abeb73a63dc.png";
30
30
 
31
- var ExceptionHttp_404 = "assets/illustrations/exception/http-404.b0415e68da2c9764.png";
31
+ var FeedbackFail = "feedback/fail.f3940ed7e7e49f5f.png";
32
32
 
33
- var ExceptionHttp_500 = "assets/illustrations/exception/http-500.0bb6e8481269dc01.png";
33
+ var FeedbackInfo = "feedback/info.60416d310f173a7c.png";
34
34
 
35
- var FeedbackException = "assets/illustrations/feedback/exception.31d66abeb73a63dc.png";
36
-
37
- var FeedbackFail = "assets/illustrations/feedback/fail.f3940ed7e7e49f5f.png";
38
-
39
- var FeedbackInfo = "assets/illustrations/feedback/info.60416d310f173a7c.png";
40
-
41
- var FeedbackSuccess = "assets/illustrations/feedback/success.1f3978e0af841d7c.png";
35
+ var FeedbackSuccess = "feedback/success.1f3978e0af841d7c.png";
42
36
 
43
37
  var defaultCategory = {
44
- "birthday-blue": DefaultBirthdayBlue,
45
- "birthday-red": DefaultBirthdayRed,
46
- "birthday-yellow": DefaultBirthdayYellow,
47
38
  "browser-version-low": DefaultBrowserVersionLow,
48
39
  "create-content": DefaultCreateContent,
49
40
  "no-content": DefaultNoContent,
@@ -68,10 +59,11 @@
68
59
  };
69
60
 
70
61
  function getIllustration(props) {
71
- var _category;
62
+ var _category, _window$CORE_ROOT;
72
63
 
73
64
  var category = (props === null || props === void 0 ? void 0 : props.category) || "default";
74
- return categories === null || categories === void 0 ? void 0 : (_category = categories[category]) === null || _category === void 0 ? void 0 : _category[props.name];
65
+ var url = categories === null || categories === void 0 ? void 0 : (_category = categories[category]) === null || _category === void 0 ? void 0 : _category[props.name];
66
+ return url && "".concat((_window$CORE_ROOT = window.CORE_ROOT) !== null && _window$CORE_ROOT !== void 0 ? _window$CORE_ROOT : "", "assets/illustrations/").concat(url);
75
67
  }
76
68
 
77
69
  exports.getIllustration = getIllustration;
@@ -1 +1 @@
1
- {"version":3,"file":"index.bundle.js","sources":["../src/illustrationsByCategory.ts","../src/images/default/birthday-blue.png","../src/images/default/birthday-red.png","../src/images/default/birthday-yellow.png","../src/images/default/browser-version-low.png","../src/images/default/create-content.png","../src/images/default/no-content.png","../src/images/default/no-history.png","../src/images/default/search-empty.png","../src/images/exception/http-403.png","../src/images/exception/http-404.png","../src/images/exception/http-500.png","../src/images/feedback/exception.png","../src/images/feedback/fail.png","../src/images/feedback/info.png","../src/images/feedback/success.png","../src/categories.ts","../src/Illustrations.ts"],"sourcesContent":["export const illustrationsByCategory = {\n default: [\n \"birthday-blue\",\n \"birthday-red\",\n \"birthday-yellow\",\n \"browser-version-low\",\n \"create-content\",\n \"no-content\",\n \"no-history\",\n \"search-empty\",\n ],\n exception: [\"http-403\", \"http-404\", \"http-500\"],\n feedback: [\"exception\", \"fail\", \"info\", \"success\"],\n};\n","export default \"assets/illustrations/default/birthday-blue.725e94bdb58af246.png\"","export default \"assets/illustrations/default/birthday-red.73eba780c31e5a22.png\"","export default \"assets/illustrations/default/birthday-yellow.994b67cde0e5e1db.png\"","export default \"assets/illustrations/default/browser-version-low.c0e16e995fe2474f.png\"","export default \"assets/illustrations/default/create-content.9f74e681aa0c3136.png\"","export default \"assets/illustrations/default/no-content.b2fae2fe14b82db3.png\"","export default \"assets/illustrations/default/no-history.640c8692cc7b6873.png\"","export default \"assets/illustrations/default/search-empty.4587158283ed7ce9.png\"","export default \"assets/illustrations/exception/http-403.494862e54e1cd3b7.png\"","export default \"assets/illustrations/exception/http-404.b0415e68da2c9764.png\"","export default \"assets/illustrations/exception/http-500.0bb6e8481269dc01.png\"","export default \"assets/illustrations/feedback/exception.31d66abeb73a63dc.png\"","export default \"assets/illustrations/feedback/fail.f3940ed7e7e49f5f.png\"","export default \"assets/illustrations/feedback/info.60416d310f173a7c.png\"","export default \"assets/illustrations/feedback/success.1f3978e0af841d7c.png\"","import DefaultBirthdayBlue from \"./images/default/birthday-blue.png\";\nimport DefaultBirthdayRed from \"./images/default/birthday-red.png\";\nimport DefaultBirthdayYellow from \"./images/default/birthday-yellow.png\";\nimport DefaultBrowserVersionLow from \"./images/default/browser-version-low.png\";\nimport DefaultCreateContent from \"./images/default/create-content.png\";\nimport DefaultNoContent from \"./images/default/no-content.png\";\nimport DefaultNoHistory from \"./images/default/no-history.png\";\nimport DefaultSearchEmpty from \"./images/default/search-empty.png\";\n\nimport ExceptionHttp_403 from \"./images/exception/http-403.png\";\nimport ExceptionHttp_404 from \"./images/exception/http-404.png\";\nimport ExceptionHttp_500 from \"./images/exception/http-500.png\";\n\nimport FeedbackException from \"./images/feedback/exception.png\";\nimport FeedbackFail from \"./images/feedback/fail.png\";\nimport FeedbackInfo from \"./images/feedback/info.png\";\nimport FeedbackSuccess from \"./images/feedback/success.png\";\n\nexport const defaultCategory = {\n \"birthday-blue\": DefaultBirthdayBlue,\n \"birthday-red\": DefaultBirthdayRed,\n \"birthday-yellow\": DefaultBirthdayYellow,\n \"browser-version-low\": DefaultBrowserVersionLow,\n \"create-content\": DefaultCreateContent,\n \"no-content\": DefaultNoContent,\n \"no-history\": DefaultNoHistory,\n \"search-empty\": DefaultSearchEmpty,\n};\n\nexport const exceptionCategory = {\n \"http-403\": ExceptionHttp_403,\n \"http-404\": ExceptionHttp_404,\n \"http-500\": ExceptionHttp_500,\n};\n\nexport const feedbackCategory = {\n exception: FeedbackException,\n fail: FeedbackFail,\n info: FeedbackInfo,\n success: FeedbackSuccess,\n};\n\nexport default {\n default: defaultCategory,\n exception: exceptionCategory,\n feedback: feedbackCategory,\n};\n","import categories from \"./categories\";\n\nexport interface IllustrationProps {\n name: string;\n category?: string;\n}\n\nexport function getIllustration(props: IllustrationProps): any {\n const category = props?.category || \"default\";\n return (categories as any)?.[category]?.[props.name];\n}\n"],"names":["illustrationsByCategory","default","exception","feedback","defaultCategory","DefaultBirthdayBlue","DefaultBirthdayRed","DefaultBirthdayYellow","DefaultBrowserVersionLow","DefaultCreateContent","DefaultNoContent","DefaultNoHistory","DefaultSearchEmpty","exceptionCategory","ExceptionHttp_403","ExceptionHttp_404","ExceptionHttp_500","feedbackCategory","FeedbackException","fail","FeedbackFail","info","FeedbackInfo","success","FeedbackSuccess","getIllustration","props","category","categories","name"],"mappings":";;;;;;MAAaA,uBAAuB,GAAG;EACrCC,EAAAA,OAAO,EAAE,CACP,eADO,EAEP,cAFO,EAGP,iBAHO,EAIP,qBAJO,EAKP,gBALO,EAMP,YANO,EAOP,YAPO,EAQP,cARO,CAD4B;EAWrCC,EAAAA,SAAS,EAAE,CAAC,UAAD,EAAa,UAAb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;;;;;"}
1
+ {"version":3,"file":"index.bundle.js","sources":["../src/illustrationsByCategory.ts","../src/images/default/browser-version-low.png","../src/images/default/create-content.png","../src/images/default/no-content.png","../src/images/default/no-history.png","../src/images/default/search-empty.png","../src/images/exception/http-403.png","../src/images/exception/http-404.png","../src/images/exception/http-500.png","../src/images/feedback/exception.png","../src/images/feedback/fail.png","../src/images/feedback/info.png","../src/images/feedback/success.png","../src/categories.ts","../src/Illustrations.ts"],"sourcesContent":["export const illustrationsByCategory = {\n default: [\n \"browser-version-low\",\n \"create-content\",\n \"no-content\",\n \"no-history\",\n \"search-empty\",\n ],\n exception: [\"http-403\", \"http-404\", \"http-500\"],\n feedback: [\"exception\", \"fail\", \"info\", \"success\"],\n};\n","export default \"default/browser-version-low.c0e16e995fe2474f.png\"","export default \"default/create-content.9f74e681aa0c3136.png\"","export default \"default/no-content.b2fae2fe14b82db3.png\"","export default \"default/no-history.640c8692cc7b6873.png\"","export default \"default/search-empty.4587158283ed7ce9.png\"","export default \"exception/http-403.494862e54e1cd3b7.png\"","export default \"exception/http-404.b0415e68da2c9764.png\"","export default \"exception/http-500.0bb6e8481269dc01.png\"","export default \"feedback/exception.31d66abeb73a63dc.png\"","export default \"feedback/fail.f3940ed7e7e49f5f.png\"","export default \"feedback/info.60416d310f173a7c.png\"","export default \"feedback/success.1f3978e0af841d7c.png\"","import DefaultBrowserVersionLow from \"./images/default/browser-version-low.png\";\nimport DefaultCreateContent from \"./images/default/create-content.png\";\nimport DefaultNoContent from \"./images/default/no-content.png\";\nimport DefaultNoHistory from \"./images/default/no-history.png\";\nimport DefaultSearchEmpty from \"./images/default/search-empty.png\";\n\nimport ExceptionHttp_403 from \"./images/exception/http-403.png\";\nimport ExceptionHttp_404 from \"./images/exception/http-404.png\";\nimport ExceptionHttp_500 from \"./images/exception/http-500.png\";\n\nimport FeedbackException from \"./images/feedback/exception.png\";\nimport FeedbackFail from \"./images/feedback/fail.png\";\nimport FeedbackInfo from \"./images/feedback/info.png\";\nimport FeedbackSuccess from \"./images/feedback/success.png\";\n\nexport const defaultCategory = {\n \"browser-version-low\": DefaultBrowserVersionLow,\n \"create-content\": DefaultCreateContent,\n \"no-content\": DefaultNoContent,\n \"no-history\": DefaultNoHistory,\n \"search-empty\": DefaultSearchEmpty,\n};\n\nexport const exceptionCategory = {\n \"http-403\": ExceptionHttp_403,\n \"http-404\": ExceptionHttp_404,\n \"http-500\": ExceptionHttp_500,\n};\n\nexport const feedbackCategory = {\n exception: FeedbackException,\n fail: FeedbackFail,\n info: FeedbackInfo,\n success: FeedbackSuccess,\n};\n\nexport default {\n default: defaultCategory,\n exception: exceptionCategory,\n feedback: feedbackCategory,\n};\n","import categories from \"./categories\";\n\nexport interface IllustrationProps {\n name: string;\n category?: string;\n}\n\nexport function getIllustration(props: IllustrationProps): any {\n const category = props?.category || \"default\";\n const url = (categories as any)?.[category]?.[props.name];\n return url && `${window.CORE_ROOT ?? \"\"}assets/illustrations/${url}`;\n}\n"],"names":["illustrationsByCategory","default","exception","feedback","defaultCategory","DefaultBrowserVersionLow","DefaultCreateContent","DefaultNoContent","DefaultNoHistory","DefaultSearchEmpty","exceptionCategory","ExceptionHttp_403","ExceptionHttp_404","ExceptionHttp_500","feedbackCategory","FeedbackException","fail","FeedbackFail","info","FeedbackInfo","success","FeedbackSuccess","getIllustration","props","category","url","categories","name","window","CORE_ROOT"],"mappings":";;;;;;MAAaA,uBAAuB,GAAG;EACrCC,EAAAA,OAAO,EAAE,CACP,qBADO,EAEP,gBAFO,EAGP,YAHO,EAIP,YAJO,EAKP,cALO,CAD4B;EAQrCC,EAAAA,SAAS,EAAE,CAAC,UAAD,EAAa,UAAb,EAAyB,UAAzB,CAR0B;EASrCC,EAAAA,QAAQ,EAAE,CAAC,WAAD,EAAc,MAAd,EAAsB,MAAtB,EAA8B,SAA9B;EAT2B;;ACAvC,iCAAe;;ACAf,6BAAe;;ACAf,yBAAe;;ACAf,yBAAe;;ACAf,2BAAe;;ACAf,0BAAe;;ACAf,0BAAe;;ACAf,0BAAe;;ACAf,0BAAe;;ACAf,qBAAe;;ACAf,qBAAe;;ACAf,wBAAe;;ECeR,IAAMC,eAAe,GAAG;EAC7B,yBAAuBC,wBADM;EAE7B,oBAAkBC,oBAFW;EAG7B,gBAAcC,gBAHe;EAI7B,gBAAcC,gBAJe;EAK7B,kBAAgBC;EALa,CAAxB;EAQA,IAAMC,iBAAiB,GAAG;EAC/B,cAAYC,iBADmB;EAE/B,cAAYC,iBAFmB;EAG/B,cAAYC;EAHmB,CAA1B;EAMA,IAAMC,gBAAgB,GAAG;EAC9BZ,EAAAA,SAAS,EAAEa,iBADmB;EAE9BC,EAAAA,IAAI,EAAEC,YAFwB;EAG9BC,EAAAA,IAAI,EAAEC,YAHwB;EAI9BC,EAAAA,OAAO,EAAEC;EAJqB,CAAzB;AAOP,mBAAe;EACbpB,EAAAA,OAAO,EAAEG,eADI;EAEbF,EAAAA,SAAS,EAAEQ,iBAFE;EAGbP,EAAAA,QAAQ,EAAEW;EAHG,CAAf;;EC7BO,SAASQ,eAAT,CAAyBC,KAAzB,EAAwD;EAAA;;EAC7D,MAAMC,QAAQ,GAAG,CAAAD,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,QAAP,KAAmB,SAApC;EACA,MAAMC,GAAG,GAAIC,UAAJ,aAAIA,UAAJ,oCAAIA,UAAD,CAAsBF,QAAtB,CAAH,8CAAG,UAAkCD,KAAK,CAACI,IAAxC,CAAZ;EACA,SAAOF,GAAG,mCAAOG,MAAM,CAACC,SAAd,iEAA2B,EAA3B,kCAAqDJ,GAArD,CAAV;EACD;;;;;;;;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,43 +1,34 @@
1
1
  var illustrationsByCategory = {
2
- default: ["birthday-blue", "birthday-red", "birthday-yellow", "browser-version-low", "create-content", "no-content", "no-history", "search-empty"],
2
+ default: ["browser-version-low", "create-content", "no-content", "no-history", "search-empty"],
3
3
  exception: ["http-403", "http-404", "http-500"],
4
4
  feedback: ["exception", "fail", "info", "success"]
5
5
  };
6
6
 
7
- var DefaultBirthdayBlue = "assets/illustrations/default/birthday-blue.725e94bdb58af246.png";
7
+ var DefaultBrowserVersionLow = "default/browser-version-low.c0e16e995fe2474f.png";
8
8
 
9
- var DefaultBirthdayRed = "assets/illustrations/default/birthday-red.73eba780c31e5a22.png";
9
+ var DefaultCreateContent = "default/create-content.9f74e681aa0c3136.png";
10
10
 
11
- var DefaultBirthdayYellow = "assets/illustrations/default/birthday-yellow.994b67cde0e5e1db.png";
11
+ var DefaultNoContent = "default/no-content.b2fae2fe14b82db3.png";
12
12
 
13
- var DefaultBrowserVersionLow = "assets/illustrations/default/browser-version-low.c0e16e995fe2474f.png";
13
+ var DefaultNoHistory = "default/no-history.640c8692cc7b6873.png";
14
14
 
15
- var DefaultCreateContent = "assets/illustrations/default/create-content.9f74e681aa0c3136.png";
15
+ var DefaultSearchEmpty = "default/search-empty.4587158283ed7ce9.png";
16
16
 
17
- var DefaultNoContent = "assets/illustrations/default/no-content.b2fae2fe14b82db3.png";
17
+ var ExceptionHttp_403 = "exception/http-403.494862e54e1cd3b7.png";
18
18
 
19
- var DefaultNoHistory = "assets/illustrations/default/no-history.640c8692cc7b6873.png";
19
+ var ExceptionHttp_404 = "exception/http-404.b0415e68da2c9764.png";
20
20
 
21
- var DefaultSearchEmpty = "assets/illustrations/default/search-empty.4587158283ed7ce9.png";
21
+ var ExceptionHttp_500 = "exception/http-500.0bb6e8481269dc01.png";
22
22
 
23
- var ExceptionHttp_403 = "assets/illustrations/exception/http-403.494862e54e1cd3b7.png";
23
+ var FeedbackException = "feedback/exception.31d66abeb73a63dc.png";
24
24
 
25
- var ExceptionHttp_404 = "assets/illustrations/exception/http-404.b0415e68da2c9764.png";
25
+ var FeedbackFail = "feedback/fail.f3940ed7e7e49f5f.png";
26
26
 
27
- var ExceptionHttp_500 = "assets/illustrations/exception/http-500.0bb6e8481269dc01.png";
27
+ var FeedbackInfo = "feedback/info.60416d310f173a7c.png";
28
28
 
29
- var FeedbackException = "assets/illustrations/feedback/exception.31d66abeb73a63dc.png";
30
-
31
- var FeedbackFail = "assets/illustrations/feedback/fail.f3940ed7e7e49f5f.png";
32
-
33
- var FeedbackInfo = "assets/illustrations/feedback/info.60416d310f173a7c.png";
34
-
35
- var FeedbackSuccess = "assets/illustrations/feedback/success.1f3978e0af841d7c.png";
29
+ var FeedbackSuccess = "feedback/success.1f3978e0af841d7c.png";
36
30
 
37
31
  var defaultCategory = {
38
- "birthday-blue": DefaultBirthdayBlue,
39
- "birthday-red": DefaultBirthdayRed,
40
- "birthday-yellow": DefaultBirthdayYellow,
41
32
  "browser-version-low": DefaultBrowserVersionLow,
42
33
  "create-content": DefaultCreateContent,
43
34
  "no-content": DefaultNoContent,
@@ -62,10 +53,11 @@ var categories = {
62
53
  };
63
54
 
64
55
  function getIllustration(props) {
65
- var _category;
56
+ var _category, _window$CORE_ROOT;
66
57
 
67
58
  var category = (props === null || props === void 0 ? void 0 : props.category) || "default";
68
- return categories === null || categories === void 0 ? void 0 : (_category = categories[category]) === null || _category === void 0 ? void 0 : _category[props.name];
59
+ var url = categories === null || categories === void 0 ? void 0 : (_category = categories[category]) === null || _category === void 0 ? void 0 : _category[props.name];
60
+ return url && "".concat((_window$CORE_ROOT = window.CORE_ROOT) !== null && _window$CORE_ROOT !== void 0 ? _window$CORE_ROOT : "", "assets/illustrations/").concat(url);
69
61
  }
70
62
 
71
63
  export { getIllustration, illustrationsByCategory };
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/illustrationsByCategory.ts","../src/images/default/birthday-blue.png","../src/images/default/birthday-red.png","../src/images/default/birthday-yellow.png","../src/images/default/browser-version-low.png","../src/images/default/create-content.png","../src/images/default/no-content.png","../src/images/default/no-history.png","../src/images/default/search-empty.png","../src/images/exception/http-403.png","../src/images/exception/http-404.png","../src/images/exception/http-500.png","../src/images/feedback/exception.png","../src/images/feedback/fail.png","../src/images/feedback/info.png","../src/images/feedback/success.png","../src/categories.ts","../src/Illustrations.ts"],"sourcesContent":["export const illustrationsByCategory = {\n default: [\n \"birthday-blue\",\n \"birthday-red\",\n \"birthday-yellow\",\n \"browser-version-low\",\n \"create-content\",\n \"no-content\",\n \"no-history\",\n \"search-empty\",\n ],\n exception: [\"http-403\", \"http-404\", \"http-500\"],\n feedback: [\"exception\", \"fail\", \"info\", \"success\"],\n};\n","export default \"assets/illustrations/default/birthday-blue.725e94bdb58af246.png\"","export default \"assets/illustrations/default/birthday-red.73eba780c31e5a22.png\"","export default \"assets/illustrations/default/birthday-yellow.994b67cde0e5e1db.png\"","export default \"assets/illustrations/default/browser-version-low.c0e16e995fe2474f.png\"","export default \"assets/illustrations/default/create-content.9f74e681aa0c3136.png\"","export default \"assets/illustrations/default/no-content.b2fae2fe14b82db3.png\"","export default \"assets/illustrations/default/no-history.640c8692cc7b6873.png\"","export default \"assets/illustrations/default/search-empty.4587158283ed7ce9.png\"","export default \"assets/illustrations/exception/http-403.494862e54e1cd3b7.png\"","export default \"assets/illustrations/exception/http-404.b0415e68da2c9764.png\"","export default \"assets/illustrations/exception/http-500.0bb6e8481269dc01.png\"","export default \"assets/illustrations/feedback/exception.31d66abeb73a63dc.png\"","export default \"assets/illustrations/feedback/fail.f3940ed7e7e49f5f.png\"","export default \"assets/illustrations/feedback/info.60416d310f173a7c.png\"","export default \"assets/illustrations/feedback/success.1f3978e0af841d7c.png\"","import DefaultBirthdayBlue from \"./images/default/birthday-blue.png\";\nimport DefaultBirthdayRed from \"./images/default/birthday-red.png\";\nimport DefaultBirthdayYellow from \"./images/default/birthday-yellow.png\";\nimport DefaultBrowserVersionLow from \"./images/default/browser-version-low.png\";\nimport DefaultCreateContent from \"./images/default/create-content.png\";\nimport DefaultNoContent from \"./images/default/no-content.png\";\nimport DefaultNoHistory from \"./images/default/no-history.png\";\nimport DefaultSearchEmpty from \"./images/default/search-empty.png\";\n\nimport ExceptionHttp_403 from \"./images/exception/http-403.png\";\nimport ExceptionHttp_404 from \"./images/exception/http-404.png\";\nimport ExceptionHttp_500 from \"./images/exception/http-500.png\";\n\nimport FeedbackException from \"./images/feedback/exception.png\";\nimport FeedbackFail from \"./images/feedback/fail.png\";\nimport FeedbackInfo from \"./images/feedback/info.png\";\nimport FeedbackSuccess from \"./images/feedback/success.png\";\n\nexport const defaultCategory = {\n \"birthday-blue\": DefaultBirthdayBlue,\n \"birthday-red\": DefaultBirthdayRed,\n \"birthday-yellow\": DefaultBirthdayYellow,\n \"browser-version-low\": DefaultBrowserVersionLow,\n \"create-content\": DefaultCreateContent,\n \"no-content\": DefaultNoContent,\n \"no-history\": DefaultNoHistory,\n \"search-empty\": DefaultSearchEmpty,\n};\n\nexport const exceptionCategory = {\n \"http-403\": ExceptionHttp_403,\n \"http-404\": ExceptionHttp_404,\n \"http-500\": ExceptionHttp_500,\n};\n\nexport const feedbackCategory = {\n exception: FeedbackException,\n fail: FeedbackFail,\n info: FeedbackInfo,\n success: FeedbackSuccess,\n};\n\nexport default {\n default: defaultCategory,\n exception: exceptionCategory,\n feedback: feedbackCategory,\n};\n","import categories from \"./categories\";\n\nexport interface IllustrationProps {\n name: string;\n category?: string;\n}\n\nexport function getIllustration(props: IllustrationProps): any {\n const category = props?.category || \"default\";\n return (categories as any)?.[category]?.[props.name];\n}\n"],"names":["illustrationsByCategory","default","exception","feedback","defaultCategory","DefaultBirthdayBlue","DefaultBirthdayRed","DefaultBirthdayYellow","DefaultBrowserVersionLow","DefaultCreateContent","DefaultNoContent","DefaultNoHistory","DefaultSearchEmpty","exceptionCategory","ExceptionHttp_403","ExceptionHttp_404","ExceptionHttp_500","feedbackCategory","FeedbackException","fail","FeedbackFail","info","FeedbackInfo","success","FeedbackSuccess","getIllustration","props","category","categories","name"],"mappings":"IAAaA,uBAAuB,GAAG;AACrCC,EAAAA,OAAO,EAAE,CACP,eADO,EAEP,cAFO,EAGP,iBAHO,EAIP,qBAJO,EAKP,gBALO,EAMP,YANO,EAOP,YAPO,EAQP,cARO,CAD4B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8CAAO,UAAkCD,KAAK,CAACG,IAAxC,CAAP;AACD;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/illustrationsByCategory.ts","../src/images/default/browser-version-low.png","../src/images/default/create-content.png","../src/images/default/no-content.png","../src/images/default/no-history.png","../src/images/default/search-empty.png","../src/images/exception/http-403.png","../src/images/exception/http-404.png","../src/images/exception/http-500.png","../src/images/feedback/exception.png","../src/images/feedback/fail.png","../src/images/feedback/info.png","../src/images/feedback/success.png","../src/categories.ts","../src/Illustrations.ts"],"sourcesContent":["export const illustrationsByCategory = {\n default: [\n \"browser-version-low\",\n \"create-content\",\n \"no-content\",\n \"no-history\",\n \"search-empty\",\n ],\n exception: [\"http-403\", \"http-404\", \"http-500\"],\n feedback: [\"exception\", \"fail\", \"info\", \"success\"],\n};\n","export default \"default/browser-version-low.c0e16e995fe2474f.png\"","export default \"default/create-content.9f74e681aa0c3136.png\"","export default \"default/no-content.b2fae2fe14b82db3.png\"","export default \"default/no-history.640c8692cc7b6873.png\"","export default \"default/search-empty.4587158283ed7ce9.png\"","export default \"exception/http-403.494862e54e1cd3b7.png\"","export default \"exception/http-404.b0415e68da2c9764.png\"","export default \"exception/http-500.0bb6e8481269dc01.png\"","export default \"feedback/exception.31d66abeb73a63dc.png\"","export default \"feedback/fail.f3940ed7e7e49f5f.png\"","export default \"feedback/info.60416d310f173a7c.png\"","export default \"feedback/success.1f3978e0af841d7c.png\"","import DefaultBrowserVersionLow from \"./images/default/browser-version-low.png\";\nimport DefaultCreateContent from \"./images/default/create-content.png\";\nimport DefaultNoContent from \"./images/default/no-content.png\";\nimport DefaultNoHistory from \"./images/default/no-history.png\";\nimport DefaultSearchEmpty from \"./images/default/search-empty.png\";\n\nimport ExceptionHttp_403 from \"./images/exception/http-403.png\";\nimport ExceptionHttp_404 from \"./images/exception/http-404.png\";\nimport ExceptionHttp_500 from \"./images/exception/http-500.png\";\n\nimport FeedbackException from \"./images/feedback/exception.png\";\nimport FeedbackFail from \"./images/feedback/fail.png\";\nimport FeedbackInfo from \"./images/feedback/info.png\";\nimport FeedbackSuccess from \"./images/feedback/success.png\";\n\nexport const defaultCategory = {\n \"browser-version-low\": DefaultBrowserVersionLow,\n \"create-content\": DefaultCreateContent,\n \"no-content\": DefaultNoContent,\n \"no-history\": DefaultNoHistory,\n \"search-empty\": DefaultSearchEmpty,\n};\n\nexport const exceptionCategory = {\n \"http-403\": ExceptionHttp_403,\n \"http-404\": ExceptionHttp_404,\n \"http-500\": ExceptionHttp_500,\n};\n\nexport const feedbackCategory = {\n exception: FeedbackException,\n fail: FeedbackFail,\n info: FeedbackInfo,\n success: FeedbackSuccess,\n};\n\nexport default {\n default: defaultCategory,\n exception: exceptionCategory,\n feedback: feedbackCategory,\n};\n","import categories from \"./categories\";\n\nexport interface IllustrationProps {\n name: string;\n category?: string;\n}\n\nexport function getIllustration(props: IllustrationProps): any {\n const category = props?.category || \"default\";\n const url = (categories as any)?.[category]?.[props.name];\n return url && `${window.CORE_ROOT ?? \"\"}assets/illustrations/${url}`;\n}\n"],"names":["illustrationsByCategory","default","exception","feedback","defaultCategory","DefaultBrowserVersionLow","DefaultCreateContent","DefaultNoContent","DefaultNoHistory","DefaultSearchEmpty","exceptionCategory","ExceptionHttp_403","ExceptionHttp_404","ExceptionHttp_500","feedbackCategory","FeedbackException","fail","FeedbackFail","info","FeedbackInfo","success","FeedbackSuccess","getIllustration","props","category","url","categories","name","window","CORE_ROOT"],"mappings":"IAAaA,uBAAuB,GAAG;AACrCC,EAAAA,OAAO,EAAE,CACP,qBADO,EAEP,gBAFO,EAGP,YAHO,EAIP,YAJO,EAKP,cALO,CAD4B;AAQrCC,EAAAA,SAAS,EAAE,CAAC,UAAD,EAAa,UAAb,EAAyB,UAAzB,CAR0B;AASrCC,EAAAA,QAAQ,EAAE,CAAC,WAAD,EAAc,MAAd,EAAsB,MAAtB,EAA8B,SAA9B;AAT2B;;ACAvC,+BAAe;;ACAf,2BAAe;;ACAf,uBAAe;;ACAf,uBAAe;;ACAf,yBAAe;;ACAf,wBAAe;;ACAf,wBAAe;;ACAf,wBAAe;;ACAf,wBAAe;;ACAf,mBAAe;;ACAf,mBAAe;;ACAf,sBAAe;;ACeR,IAAMC,eAAe,GAAG;AAC7B,yBAAuBC,wBADM;AAE7B,oBAAkBC,oBAFW;AAG7B,gBAAcC,gBAHe;AAI7B,gBAAcC,gBAJe;AAK7B,kBAAgBC;AALa,CAAxB;AAQA,IAAMC,iBAAiB,GAAG;AAC/B,cAAYC,iBADmB;AAE/B,cAAYC,iBAFmB;AAG/B,cAAYC;AAHmB,CAA1B;AAMA,IAAMC,gBAAgB,GAAG;AAC9BZ,EAAAA,SAAS,EAAEa,iBADmB;AAE9BC,EAAAA,IAAI,EAAEC,YAFwB;AAG9BC,EAAAA,IAAI,EAAEC,YAHwB;AAI9BC,EAAAA,OAAO,EAAEC;AAJqB,CAAzB;AAOP,iBAAe;AACbpB,EAAAA,OAAO,EAAEG,eADI;AAEbF,EAAAA,SAAS,EAAEQ,iBAFE;AAGbP,EAAAA,QAAQ,EAAEW;AAHG,CAAf;;AC7BO,SAASQ,eAAT,CAAyBC,KAAzB,EAAwD;AAAA;;AAC7D,MAAMC,QAAQ,GAAG,CAAAD,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,QAAP,KAAmB,SAApC;AACA,MAAMC,GAAG,GAAIC,UAAJ,aAAIA,UAAJ,oCAAIA,UAAD,CAAsBF,QAAtB,CAAH,8CAAG,UAAkCD,KAAK,CAACI,IAAxC,CAAZ;AACA,SAAOF,GAAG,mCAAOG,MAAM,CAACC,SAAd,iEAA2B,EAA3B,kCAAqDJ,GAArD,CAAV;AACD;;;;"}
@@ -1,7 +1,4 @@
1
1
  export declare const defaultCategory: {
2
- "birthday-blue": any;
3
- "birthday-red": any;
4
- "birthday-yellow": any;
5
2
  "browser-version-low": any;
6
3
  "create-content": any;
7
4
  "no-content": any;
@@ -21,9 +18,6 @@ export declare const feedbackCategory: {
21
18
  };
22
19
  declare const _default: {
23
20
  default: {
24
- "birthday-blue": any;
25
- "birthday-red": any;
26
- "birthday-yellow": any;
27
21
  "browser-version-low": any;
28
22
  "create-content": any;
29
23
  "no-content": any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/illustrations",
3
- "version": "0.4.3-alpha.0",
3
+ "version": "0.4.6",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/easyops-illustrations",
6
6
  "license": "GPL-3.0",
@@ -29,7 +29,7 @@
29
29
  "change-case": "^4.1.2",
30
30
  "fs-extra": "^10.0.0",
31
31
  "klaw-sync": "^6.0.0",
32
- "prettier": "^2.4.1"
32
+ "prettier": "^2.5.1"
33
33
  },
34
- "gitHead": "0d224d27dcd87a4b7af72d2757ab6539b1a1fe03"
34
+ "gitHead": "7cda848a0251c7b3aa54b37f73c9608454364fed"
35
35
  }