@semcore/illustration 16.0.0-prerelease.9 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/AccessDenied/index.esm.js +0 -0
  2. package/AccessLogIn/index.esm.js +0 -0
  3. package/AreaChart/index.esm.js +0 -0
  4. package/Blocked/index.esm.js +0 -0
  5. package/CHANGELOG.md +19 -1
  6. package/ChoroplethMapChart/index.esm.js +0 -0
  7. package/Coffee/index.esm.js +0 -0
  8. package/Collection/index.esm.js +0 -0
  9. package/CombinedChart/index.esm.js +0 -0
  10. package/Configuration/index.esm.js +0 -0
  11. package/Confirmation/index.esm.js +0 -0
  12. package/Congrats/index.esm.js +0 -0
  13. package/ConnectionLost/index.esm.js +0 -0
  14. package/DeletedAccount/index.esm.js +0 -0
  15. package/DeletedPage/index.esm.js +0 -0
  16. package/Dns/index.esm.js +0 -0
  17. package/DonutChart/index.esm.js +0 -0
  18. package/Duplicates/index.esm.js +0 -0
  19. package/Feedback/index.esm.js +0 -0
  20. package/FunnelChart/index.esm.js +0 -0
  21. package/Good/index.esm.js +0 -0
  22. package/HeatMapChart/index.esm.js +0 -0
  23. package/HorizontalBarChart/index.esm.js +0 -0
  24. package/KagiChart/index.esm.js +0 -0
  25. package/LineChart/index.esm.js +0 -0
  26. package/LollipopChart/index.esm.js +0 -0
  27. package/MailSent/index.esm.js +0 -0
  28. package/Maintenance/index.esm.js +0 -0
  29. package/Nexttime/index.esm.js +0 -0
  30. package/NoPayment/index.esm.js +0 -0
  31. package/NothingFound/index.esm.js +0 -0
  32. package/OtherData/index.esm.js +0 -0
  33. package/PageError/index.esm.js +0 -0
  34. package/PageNotFound/index.esm.js +0 -0
  35. package/PieChart/index.esm.js +0 -0
  36. package/Processing/index.esm.js +0 -0
  37. package/ProjectNotFound/index.esm.js +0 -0
  38. package/RadarChart/index.esm.js +0 -0
  39. package/RadialTreeChart/index.esm.js +0 -0
  40. package/SankeyChart/index.esm.js +0 -0
  41. package/ScatterPlotChart/index.esm.js +0 -0
  42. package/StackedAreaChart/index.esm.js +0 -0
  43. package/Suggestion/index.esm.js +0 -0
  44. package/Suggestions/index.esm.js +0 -0
  45. package/Table/index.esm.js +0 -0
  46. package/TagCloud/index.esm.js +0 -0
  47. package/TextLinksEtc/index.esm.js +0 -0
  48. package/Timeout/index.esm.js +0 -0
  49. package/UnderConstruction/index.esm.js +0 -0
  50. package/VennChart/index.esm.js +0 -0
  51. package/VerticalBarChart/index.esm.js +0 -0
  52. package/Waiting/index.esm.js +0 -0
  53. package/Warning/index.esm.js +0 -0
  54. package/lib/cjs/index.js +1 -1
  55. package/lib/cjs/index.js.map +1 -1
  56. package/lib/es6/index.js +1 -1
  57. package/lib/es6/index.js.map +1 -1
  58. package/lib/esm/index.mjs +13 -0
  59. package/package.json +275 -6
  60. package/transform.ts +35 -2
  61. package/vite.config.ts +24 -0
File without changes
File without changes
File without changes
File without changes
package/CHANGELOG.md CHANGED
@@ -2,12 +2,30 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [16.0.0] - 2025-03-26
5
+ ## [16.0.0] - 2025-05-19
6
6
 
7
7
  ### Added
8
8
 
9
9
  - Major version.
10
10
 
11
+ ## [2.44.2] - 2025-05-13
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/flex-box` [5.41.3 ~> 5.41.4], `@semcore/core` [2.39.3 ~> 2.39.4]).
16
+
17
+ ## [2.44.1] - 2025-05-09
18
+
19
+ ### Changed
20
+
21
+ - Version patch update due to children dependencies update (`@semcore/flex-box` [5.41.2 ~> 5.41.3], `@semcore/core` [2.39.2 ~> 2.39.3]).
22
+
23
+ ## [2.44.0] - 2025-04-03
24
+
25
+ ### Added
26
+
27
+ - Exports in `package.json` for correct ESM build.
28
+
11
29
  ## [2.43.1] - 2025-03-20
12
30
 
13
31
  ### Changed
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/cjs/index.js CHANGED
@@ -16,7 +16,7 @@ var formatName = function formatName(name) {
16
16
  };
17
17
  var getIllustrationPath = function getIllustrationPath(name) {
18
18
  var formattedName = formatName(name);
19
- return "https://static.semrush.com/ui-kit/illustration/".concat(version, "/").concat(formattedName, ".svg");
19
+ return "https://static.semrush.com/intergalactic/illustrations/".concat(version, "/").concat(formattedName, ".svg");
20
20
  };
21
21
  exports.getIllustrationPath = getIllustrationPath;
22
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["version","formatName","name","split","map","el","toUpperCase","slice","join","getIllustrationPath","formattedName","concat","exports"],"sources":["../../src/index.ts"],"sourcesContent":["declare const preval: any;\n\nconst version = preval`module.exports = require('../package.json').version`;\n\n/**\n * Formats string from `access_denied` or `access-denied` to `AccessDenied`\n */\nconst formatName = (name: string) => {\n return name\n .split(/_|-/)\n .map((el) => el[0].toUpperCase() + el.slice(1))\n .join('');\n};\n\nexport const getIllustrationPath = (name: string) => {\n const formattedName = formatName(name);\n\n return `https://static.semrush.com/ui-kit/illustration/${version}/${formattedName}.svg`;\n};\n"],"mappings":";;;;;;AAEA,IAAMA,OAAO,WAA8D;;AAE3E;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY,EAAK;EACnC,OAAOA,IAAI,CACRC,KAAK,CAAC,KAAK,CAAC,CACZC,GAAG,CAAC,UAACC,EAAE;IAAA,OAAKA,EAAE,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGD,EAAE,CAACE,KAAK,CAAC,CAAC,CAAC;EAAA,EAAC,CAC9CC,IAAI,CAAC,EAAE,CAAC;AACb,CAAC;AAEM,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIP,IAAY,EAAK;EACnD,IAAMQ,aAAa,GAAGT,UAAU,CAACC,IAAI,CAAC;EAEtC,yDAAAS,MAAA,CAAyDX,OAAO,OAAAW,MAAA,CAAID,aAAa;AACnF,CAAC;AAACE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"file":"index.js","names":["version","formatName","name","split","map","el","toUpperCase","slice","join","getIllustrationPath","formattedName","concat","exports"],"sources":["../../src/index.ts"],"sourcesContent":["declare const preval: any;\n\nconst version = preval`module.exports = require('../package.json').version`;\n\n/**\n * Formats string from `access_denied` or `access-denied` to `AccessDenied`\n */\nconst formatName = (name: string) => {\n return name\n .split(/_|-/)\n .map((el) => el[0].toUpperCase() + el.slice(1))\n .join('');\n};\n\nexport const getIllustrationPath = (name: string) => {\n const formattedName = formatName(name);\n\n return `https://static.semrush.com/intergalactic/illustrations/${version}/${formattedName}.svg`;\n};\n"],"mappings":";;;;;;AAEA,IAAMA,OAAO,WAA8D;;AAE3E;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY,EAAK;EACnC,OAAOA,IAAI,CACRC,KAAK,CAAC,KAAK,CAAC,CACZC,GAAG,CAAC,UAACC,EAAE;IAAA,OAAKA,EAAE,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGD,EAAE,CAACE,KAAK,CAAC,CAAC,CAAC;EAAA,EAAC,CAC9CC,IAAI,CAAC,EAAE,CAAC;AACb,CAAC;AAEM,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIP,IAAY,EAAK;EACnD,IAAMQ,aAAa,GAAGT,UAAU,CAACC,IAAI,CAAC;EAEtC,iEAAAS,MAAA,CAAiEX,OAAO,OAAAW,MAAA,CAAID,aAAa;AAC3F,CAAC;AAACE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA"}
package/lib/es6/index.js CHANGED
@@ -10,6 +10,6 @@ var formatName = function formatName(name) {
10
10
  };
11
11
  export var getIllustrationPath = function getIllustrationPath(name) {
12
12
  var formattedName = formatName(name);
13
- return "https://static.semrush.com/ui-kit/illustration/".concat(version, "/").concat(formattedName, ".svg");
13
+ return "https://static.semrush.com/intergalactic/illustrations/".concat(version, "/").concat(formattedName, ".svg");
14
14
  };
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["version","formatName","name","split","map","el","toUpperCase","slice","join","getIllustrationPath","formattedName","concat"],"sources":["../../src/index.ts"],"sourcesContent":["declare const preval: any;\n\nconst version = preval`module.exports = require('../package.json').version`;\n\n/**\n * Formats string from `access_denied` or `access-denied` to `AccessDenied`\n */\nconst formatName = (name: string) => {\n return name\n .split(/_|-/)\n .map((el) => el[0].toUpperCase() + el.slice(1))\n .join('');\n};\n\nexport const getIllustrationPath = (name: string) => {\n const formattedName = formatName(name);\n\n return `https://static.semrush.com/ui-kit/illustration/${version}/${formattedName}.svg`;\n};\n"],"mappings":"AAEA,IAAMA,OAAO,WAA8D;;AAE3E;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY,EAAK;EACnC,OAAOA,IAAI,CACRC,KAAK,CAAC,KAAK,CAAC,CACZC,GAAG,CAAC,UAACC,EAAE;IAAA,OAAKA,EAAE,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGD,EAAE,CAACE,KAAK,CAAC,CAAC,CAAC;EAAA,EAAC,CAC9CC,IAAI,CAAC,EAAE,CAAC;AACb,CAAC;AAED,OAAO,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIP,IAAY,EAAK;EACnD,IAAMQ,aAAa,GAAGT,UAAU,CAACC,IAAI,CAAC;EAEtC,yDAAAS,MAAA,CAAyDX,OAAO,OAAAW,MAAA,CAAID,aAAa;AACnF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["version","formatName","name","split","map","el","toUpperCase","slice","join","getIllustrationPath","formattedName","concat"],"sources":["../../src/index.ts"],"sourcesContent":["declare const preval: any;\n\nconst version = preval`module.exports = require('../package.json').version`;\n\n/**\n * Formats string from `access_denied` or `access-denied` to `AccessDenied`\n */\nconst formatName = (name: string) => {\n return name\n .split(/_|-/)\n .map((el) => el[0].toUpperCase() + el.slice(1))\n .join('');\n};\n\nexport const getIllustrationPath = (name: string) => {\n const formattedName = formatName(name);\n\n return `https://static.semrush.com/intergalactic/illustrations/${version}/${formattedName}.svg`;\n};\n"],"mappings":"AAEA,IAAMA,OAAO,WAA8D;;AAE3E;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY,EAAK;EACnC,OAAOA,IAAI,CACRC,KAAK,CAAC,KAAK,CAAC,CACZC,GAAG,CAAC,UAACC,EAAE;IAAA,OAAKA,EAAE,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGD,EAAE,CAACE,KAAK,CAAC,CAAC,CAAC;EAAA,EAAC,CAC9CC,IAAI,CAAC,EAAE,CAAC;AACb,CAAC;AAED,OAAO,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIP,IAAY,EAAK;EACnD,IAAMQ,aAAa,GAAGT,UAAU,CAACC,IAAI,CAAC;EAEtC,iEAAAS,MAAA,CAAiEX,OAAO,OAAAW,MAAA,CAAID,aAAa;AAC3F,CAAC"}
@@ -0,0 +1,13 @@
1
+ var version = "16.0.0";
2
+ var formatName = function formatName2(name) {
3
+ return name.split(/_|-/).map(function(el) {
4
+ return el[0].toUpperCase() + el.slice(1);
5
+ }).join("");
6
+ };
7
+ var getIllustrationPath = function getIllustrationPath2(name) {
8
+ var formattedName = formatName(name);
9
+ return "https://static.semrush.com/intergalactic/illustrations/".concat(version, "/").concat(formattedName, ".svg");
10
+ };
11
+ export {
12
+ getIllustrationPath
13
+ };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@semcore/illustration",
3
3
  "description": "Semrush Illustration Component",
4
- "version": "16.0.0-prerelease.9",
4
+ "version": "16.0.0",
5
5
  "main": "lib/cjs/index.js",
6
- "module": "lib/es6/index.js",
6
+ "module": "lib/esm/index.mjs",
7
7
  "typings": "lib/types/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
@@ -13,7 +13,7 @@
13
13
  "colorjs.io": "0.4.3"
14
14
  },
15
15
  "peerDependencies": {
16
- "@semcore/base-components": "^16.0.0-prerelease.9"
16
+ "@semcore/base-components": "^16.0.0"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
@@ -23,12 +23,281 @@
23
23
  "devDependencies": {
24
24
  "esbuild": "0.14.29",
25
25
  "happy-dom": "9.20.3",
26
- "svg-to-jsx": "^1.0.4",
26
+ "fs-extra": "8.1.0",
27
+ "svg-to-jsx": "1.0.4",
28
+ "@semcore/testing-utils": "1.0.0",
27
29
  "@types/react": "18.0.21",
28
- "@semcore/testing-utils": "1.0.0"
30
+ "@types/fs-extra": "8.1.0"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "require": "./lib/cjs/index.js",
35
+ "import": "./lib/esm/index.mjs",
36
+ "types": "./lib/types/index.d.ts"
37
+ },
38
+ "./AccessDenied": {
39
+ "require": "./AccessDenied/index.js",
40
+ "import": "./AccessDenied/index.mjs",
41
+ "types": "./AccessDenied/index.d.ts"
42
+ },
43
+ "./AccessLogIn": {
44
+ "require": "./AccessLogIn/index.js",
45
+ "import": "./AccessLogIn/index.mjs",
46
+ "types": "./AccessLogIn/index.d.ts"
47
+ },
48
+ "./AreaChart": {
49
+ "require": "./AreaChart/index.js",
50
+ "import": "./AreaChart/index.mjs",
51
+ "types": "./AreaChart/index.d.ts"
52
+ },
53
+ "./Blocked": {
54
+ "require": "./Blocked/index.js",
55
+ "import": "./Blocked/index.mjs",
56
+ "types": "./Blocked/index.d.ts"
57
+ },
58
+ "./ChoroplethMapChart": {
59
+ "require": "./ChoroplethMapChart/index.js",
60
+ "import": "./ChoroplethMapChart/index.mjs",
61
+ "types": "./ChoroplethMapChart/index.d.ts"
62
+ },
63
+ "./Coffee": {
64
+ "require": "./Coffee/index.js",
65
+ "import": "./Coffee/index.mjs",
66
+ "types": "./Coffee/index.d.ts"
67
+ },
68
+ "./Collection": {
69
+ "require": "./Collection/index.js",
70
+ "import": "./Collection/index.mjs",
71
+ "types": "./Collection/index.d.ts"
72
+ },
73
+ "./CombinedChart": {
74
+ "require": "./CombinedChart/index.js",
75
+ "import": "./CombinedChart/index.mjs",
76
+ "types": "./CombinedChart/index.d.ts"
77
+ },
78
+ "./Configuration": {
79
+ "require": "./Configuration/index.js",
80
+ "import": "./Configuration/index.mjs",
81
+ "types": "./Configuration/index.d.ts"
82
+ },
83
+ "./Confirmation": {
84
+ "require": "./Confirmation/index.js",
85
+ "import": "./Confirmation/index.mjs",
86
+ "types": "./Confirmation/index.d.ts"
87
+ },
88
+ "./Congrats": {
89
+ "require": "./Congrats/index.js",
90
+ "import": "./Congrats/index.mjs",
91
+ "types": "./Congrats/index.d.ts"
92
+ },
93
+ "./ConnectionLost": {
94
+ "require": "./ConnectionLost/index.js",
95
+ "import": "./ConnectionLost/index.mjs",
96
+ "types": "./ConnectionLost/index.d.ts"
97
+ },
98
+ "./DeletedAccount": {
99
+ "require": "./DeletedAccount/index.js",
100
+ "import": "./DeletedAccount/index.mjs",
101
+ "types": "./DeletedAccount/index.d.ts"
102
+ },
103
+ "./DeletedPage": {
104
+ "require": "./DeletedPage/index.js",
105
+ "import": "./DeletedPage/index.mjs",
106
+ "types": "./DeletedPage/index.d.ts"
107
+ },
108
+ "./Dns": {
109
+ "require": "./Dns/index.js",
110
+ "import": "./Dns/index.mjs",
111
+ "types": "./Dns/index.d.ts"
112
+ },
113
+ "./DonutChart": {
114
+ "require": "./DonutChart/index.js",
115
+ "import": "./DonutChart/index.mjs",
116
+ "types": "./DonutChart/index.d.ts"
117
+ },
118
+ "./Duplicates": {
119
+ "require": "./Duplicates/index.js",
120
+ "import": "./Duplicates/index.mjs",
121
+ "types": "./Duplicates/index.d.ts"
122
+ },
123
+ "./Feedback": {
124
+ "require": "./Feedback/index.js",
125
+ "import": "./Feedback/index.mjs",
126
+ "types": "./Feedback/index.d.ts"
127
+ },
128
+ "./FunnelChart": {
129
+ "require": "./FunnelChart/index.js",
130
+ "import": "./FunnelChart/index.mjs",
131
+ "types": "./FunnelChart/index.d.ts"
132
+ },
133
+ "./Good": {
134
+ "require": "./Good/index.js",
135
+ "import": "./Good/index.mjs",
136
+ "types": "./Good/index.d.ts"
137
+ },
138
+ "./HeatMapChart": {
139
+ "require": "./HeatMapChart/index.js",
140
+ "import": "./HeatMapChart/index.mjs",
141
+ "types": "./HeatMapChart/index.d.ts"
142
+ },
143
+ "./HorizontalBarChart": {
144
+ "require": "./HorizontalBarChart/index.js",
145
+ "import": "./HorizontalBarChart/index.mjs",
146
+ "types": "./HorizontalBarChart/index.d.ts"
147
+ },
148
+ "./KagiChart": {
149
+ "require": "./KagiChart/index.js",
150
+ "import": "./KagiChart/index.mjs",
151
+ "types": "./KagiChart/index.d.ts"
152
+ },
153
+ "./LineChart": {
154
+ "require": "./LineChart/index.js",
155
+ "import": "./LineChart/index.mjs",
156
+ "types": "./LineChart/index.d.ts"
157
+ },
158
+ "./LollipopChart": {
159
+ "require": "./LollipopChart/index.js",
160
+ "import": "./LollipopChart/index.mjs",
161
+ "types": "./LollipopChart/index.d.ts"
162
+ },
163
+ "./MailSent": {
164
+ "require": "./MailSent/index.js",
165
+ "import": "./MailSent/index.mjs",
166
+ "types": "./MailSent/index.d.ts"
167
+ },
168
+ "./Maintenance": {
169
+ "require": "./Maintenance/index.js",
170
+ "import": "./Maintenance/index.mjs",
171
+ "types": "./Maintenance/index.d.ts"
172
+ },
173
+ "./Nexttime": {
174
+ "require": "./Nexttime/index.js",
175
+ "import": "./Nexttime/index.mjs",
176
+ "types": "./Nexttime/index.d.ts"
177
+ },
178
+ "./NoPayment": {
179
+ "require": "./NoPayment/index.js",
180
+ "import": "./NoPayment/index.mjs",
181
+ "types": "./NoPayment/index.d.ts"
182
+ },
183
+ "./NothingFound": {
184
+ "require": "./NothingFound/index.js",
185
+ "import": "./NothingFound/index.mjs",
186
+ "types": "./NothingFound/index.d.ts"
187
+ },
188
+ "./OtherData": {
189
+ "require": "./OtherData/index.js",
190
+ "import": "./OtherData/index.mjs",
191
+ "types": "./OtherData/index.d.ts"
192
+ },
193
+ "./PageError": {
194
+ "require": "./PageError/index.js",
195
+ "import": "./PageError/index.mjs",
196
+ "types": "./PageError/index.d.ts"
197
+ },
198
+ "./PageNotFound": {
199
+ "require": "./PageNotFound/index.js",
200
+ "import": "./PageNotFound/index.mjs",
201
+ "types": "./PageNotFound/index.d.ts"
202
+ },
203
+ "./PieChart": {
204
+ "require": "./PieChart/index.js",
205
+ "import": "./PieChart/index.mjs",
206
+ "types": "./PieChart/index.d.ts"
207
+ },
208
+ "./Processing": {
209
+ "require": "./Processing/index.js",
210
+ "import": "./Processing/index.mjs",
211
+ "types": "./Processing/index.d.ts"
212
+ },
213
+ "./ProjectNotFound": {
214
+ "require": "./ProjectNotFound/index.js",
215
+ "import": "./ProjectNotFound/index.mjs",
216
+ "types": "./ProjectNotFound/index.d.ts"
217
+ },
218
+ "./RadarChart": {
219
+ "require": "./RadarChart/index.js",
220
+ "import": "./RadarChart/index.mjs",
221
+ "types": "./RadarChart/index.d.ts"
222
+ },
223
+ "./RadialTreeChart": {
224
+ "require": "./RadialTreeChart/index.js",
225
+ "import": "./RadialTreeChart/index.mjs",
226
+ "types": "./RadialTreeChart/index.d.ts"
227
+ },
228
+ "./SankeyChart": {
229
+ "require": "./SankeyChart/index.js",
230
+ "import": "./SankeyChart/index.mjs",
231
+ "types": "./SankeyChart/index.d.ts"
232
+ },
233
+ "./ScatterPlotChart": {
234
+ "require": "./ScatterPlotChart/index.js",
235
+ "import": "./ScatterPlotChart/index.mjs",
236
+ "types": "./ScatterPlotChart/index.d.ts"
237
+ },
238
+ "./StackedAreaChart": {
239
+ "require": "./StackedAreaChart/index.js",
240
+ "import": "./StackedAreaChart/index.mjs",
241
+ "types": "./StackedAreaChart/index.d.ts"
242
+ },
243
+ "./Suggestion": {
244
+ "require": "./Suggestion/index.js",
245
+ "import": "./Suggestion/index.mjs",
246
+ "types": "./Suggestion/index.d.ts"
247
+ },
248
+ "./Suggestions": {
249
+ "require": "./Suggestions/index.js",
250
+ "import": "./Suggestions/index.mjs",
251
+ "types": "./Suggestions/index.d.ts"
252
+ },
253
+ "./Table": {
254
+ "require": "./Table/index.js",
255
+ "import": "./Table/index.mjs",
256
+ "types": "./Table/index.d.ts"
257
+ },
258
+ "./TagCloud": {
259
+ "require": "./TagCloud/index.js",
260
+ "import": "./TagCloud/index.mjs",
261
+ "types": "./TagCloud/index.d.ts"
262
+ },
263
+ "./TextLinksEtc": {
264
+ "require": "./TextLinksEtc/index.js",
265
+ "import": "./TextLinksEtc/index.mjs",
266
+ "types": "./TextLinksEtc/index.d.ts"
267
+ },
268
+ "./Timeout": {
269
+ "require": "./Timeout/index.js",
270
+ "import": "./Timeout/index.mjs",
271
+ "types": "./Timeout/index.d.ts"
272
+ },
273
+ "./UnderConstruction": {
274
+ "require": "./UnderConstruction/index.js",
275
+ "import": "./UnderConstruction/index.mjs",
276
+ "types": "./UnderConstruction/index.d.ts"
277
+ },
278
+ "./VennChart": {
279
+ "require": "./VennChart/index.js",
280
+ "import": "./VennChart/index.mjs",
281
+ "types": "./VennChart/index.d.ts"
282
+ },
283
+ "./VerticalBarChart": {
284
+ "require": "./VerticalBarChart/index.js",
285
+ "import": "./VerticalBarChart/index.mjs",
286
+ "types": "./VerticalBarChart/index.d.ts"
287
+ },
288
+ "./Waiting": {
289
+ "require": "./Waiting/index.js",
290
+ "import": "./Waiting/index.mjs",
291
+ "types": "./Waiting/index.d.ts"
292
+ },
293
+ "./Warning": {
294
+ "require": "./Warning/index.js",
295
+ "import": "./Warning/index.mjs",
296
+ "types": "./Warning/index.d.ts"
297
+ }
29
298
  },
30
299
  "scripts": {
31
- "build": "pnpm clear && pnpm semcore-builder --source=js && pnpm run transform",
300
+ "build": "pnpm clear && pnpm semcore-builder --source=js && pnpm run transform && pnpm vite build",
32
301
  "transform": "tsm --require=../../.ci/tsm-filter-warnings.js transform.ts",
33
302
  "clear": "tsm --require=../../.ci/tsm-filter-warnings.js clear.ts",
34
303
  "upload-static": "gcs-upload svg/*.svg"
package/transform.ts CHANGED
@@ -1,5 +1,5 @@
1
- import fs from 'fs/promises';
2
- import { resolve as resolvePath } from 'path';
1
+ import fs from 'fs-extra';
2
+ import path, { resolve as resolvePath } from 'path';
3
3
  import svgToJsx from 'svg-to-jsx';
4
4
  import { Window } from 'happy-dom';
5
5
  import esbuild from 'esbuild';
@@ -181,3 +181,36 @@ export default Illustration;
181
181
  await fs.writeFile(resolvePath(illustration, 'index.d.ts'), typesDeclaration);
182
182
  }),
183
183
  );
184
+
185
+ async function patchExports(illustrations: string[]) {
186
+ const rootDir = process.cwd();
187
+ const packageJsonPath = path.resolve(rootDir, 'package.json');
188
+ const packageJson = await fs.readJson(packageJsonPath);
189
+
190
+ const exports: Record<string, any> = {
191
+ '.': {
192
+ require: './lib/cjs/index.js',
193
+ import: './lib/es6/index.js',
194
+ types: './lib/types/index.d.ts',
195
+ },
196
+ };
197
+
198
+ illustrations.forEach((item) => {
199
+ const name = item.replace('.svg', '');
200
+
201
+ exports[`./${name}`] = {
202
+ require: `./${name}/index.js`,
203
+ import: `./${name}/index.mjs`,
204
+ types: `./${name}/index.d.ts`,
205
+ };
206
+ });
207
+
208
+ packageJson.exports = exports;
209
+
210
+ await fs.writeJSON(packageJsonPath, packageJson, { spaces: 2 });
211
+
212
+ // biome-ignore lint/suspicious/noConsoleLog:
213
+ console.log('Patched exports in package.json.');
214
+ }
215
+
216
+ await patchExports(illustrations);
package/vite.config.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { defineConfig, mergeConfig } from 'vite';
2
+
3
+ import viteConfig from '../../commonVite.config';
4
+
5
+ export default mergeConfig(
6
+ viteConfig,
7
+ defineConfig({
8
+ build: {
9
+ lib: {
10
+ entry: './src/index.ts',
11
+ },
12
+ rollupOptions: {
13
+ external: [
14
+ 'react',
15
+ 'react-dom',
16
+ 'react/jsx-runtime',
17
+ /@babel\/runtime\/*/,
18
+ /@semcore\/*/,
19
+ 'colorjs.io',
20
+ ],
21
+ },
22
+ },
23
+ }),
24
+ );