@semcore/illustration 16.0.0-prerelease.15 → 16.0.0-prerelease.16

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
@@ -8,6 +8,12 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
8
8
 
9
9
  - Major version.
10
10
 
11
+ ## [2.44.0] - 2025-04-03
12
+
13
+ ### Added
14
+
15
+ - Exports in `package.json` for correct ESM build.
16
+
11
17
  ## [2.43.1] - 2025-03-20
12
18
 
13
19
  ### Changed
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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/illustration",
3
3
  "description": "Semrush Illustration Component",
4
- "version": "16.0.0-prerelease.15",
4
+ "version": "16.0.0-prerelease.16",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "colorjs.io": "0.4.3"
14
14
  },
15
15
  "peerDependencies": {
16
- "@semcore/base-components": "^16.0.0-prerelease.15"
16
+ "@semcore/base-components": "^16.0.0-prerelease.16"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
@@ -23,9 +23,278 @@
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/es6/index.js",
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
300
  "build": "pnpm clear && pnpm semcore-builder --source=js && pnpm run transform",
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);