@semcore/ui 15.127.0 → 15.128.0-prerelease.2

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
@@ -1,3 +1,36 @@
1
+ ## [15.128.0] - 2025-04-04
2
+
3
+ ### @semcore/bulk-textarea
4
+
5
+ - **Added** New type for value/onChange. It could be `string` or `string[]`, depends on type of `value` property. `string` by default.
6
+ - **Fixed** Error if after processing the inserted value it will be empty array.
7
+ - **Fixed** Error with empty `utf` characters in `onChange` / `lineProcessing`.
8
+ - **Fixed** Cursor position after focusing a non-empty field.
9
+ - **Fixed** Blinking previous error after clicking on another line with error.
10
+
11
+ ### @semcore/feedback-form
12
+
13
+ - **Changed** Email in FeedbackRating error notice as a link.
14
+ - **Changed** Star icons in Slider component.
15
+ - **Changed** Close feedback form behavior - the rating value is cleared.
16
+ - **Changed** It is impossible to open a form with an empty rating.
17
+
18
+ ### @semcore/illustration
19
+
20
+ - **Added** Exports in `package.json` for correct ESM build.
21
+
22
+ ### @semcore/outside-click
23
+
24
+ - **Fixed** Closing in some rare cases.
25
+
26
+ ### @semcore/select
27
+
28
+ - **Fixed** Double call of `onChange` in InputSearch component.
29
+
30
+ ### @semcore/utils
31
+
32
+ - **Added** `setRef` and `getDisplayName` utils to the exports list.
33
+
1
34
  ## [15.127.0] - 2025-03-28
2
35
 
3
36
  ### @semcore/button
@@ -12,6 +12,14 @@ const dirname = path.resolve(filename, '..');
12
12
  const components = fs.readJSONSync(path.resolve(dirname, './components.json'));
13
13
  const JSXParser = Parser.extend(acornJSX());
14
14
 
15
+ type PackageExportItem = {
16
+ require: string;
17
+ import: string;
18
+ types?: string;
19
+ };
20
+
21
+ const packageJsonExports: Record<string, PackageExportItem> = {};
22
+
15
23
  const hasExportDefault = async (dependency: string) => {
16
24
  const require = createRequire(import.meta.url);
17
25
 
@@ -97,6 +105,12 @@ const GENERATOR = {
97
105
  for (const util of utils) {
98
106
  if (util.endsWith('.css')) {
99
107
  await fs.outputFile(`./${name}/lib/${util}`, `@import '${dependency}/lib/${util}';`);
108
+
109
+ packageJsonExports[`./${util}`] = {
110
+ require: `./lib/${util}`,
111
+ import: `./lib/${util}`,
112
+ };
113
+
100
114
  continue;
101
115
  }
102
116
  if (util.endsWith('.d.js')) {
@@ -127,6 +141,12 @@ const GENERATOR = {
127
141
  template(dependency, utilNameWithoutExtention),
128
142
  );
129
143
  }
144
+
145
+ packageJsonExports[`./${name}/${utilNameWithoutExtention}`] = {
146
+ require: `./${name}/${utilNameWithoutExtention}.cjs`,
147
+ import: `./${name}/${utilNameWithoutExtention}.mjs`,
148
+ types: `./${name}/${utilNameWithoutExtention}.d.ts`,
149
+ };
130
150
  }
131
151
  await fs.copy(`${utilsPath}/style`, `./${name}/style`);
132
152
  },
@@ -180,6 +200,12 @@ const GENERATOR = {
180
200
  // normalize because "subFile" can be just "."
181
201
  template(path.normalize(`${dependency}/${icon}/${subFile}`)),
182
202
  );
203
+
204
+ packageJsonExports[`./${name}/${icon}${path.normalize(`/${subFile}`)}`] = {
205
+ require: `./${name}/${icon}${path.normalize(`/${subFile}`)}/index.cjs`,
206
+ import: `./${name}/${icon}${path.normalize(`/${subFile}`)}/index.mjs`,
207
+ types: `./${name}/${icon}${path.normalize(`/${subFile}`)}/index.d.ts`,
208
+ };
183
209
  }
184
210
  }
185
211
  }
@@ -193,6 +219,12 @@ const GENERATOR = {
193
219
  : EXPORT_TEMPLATES[extension].NAMED;
194
220
  await fs.outputFile(`./${name}/index.${extension}`, template(dependency));
195
221
  }
222
+
223
+ packageJsonExports[`./${name}`] = {
224
+ require: `./${name}/index.cjs`,
225
+ import: `./${name}/index.mjs`,
226
+ types: `./${name}/index.d.ts`,
227
+ };
196
228
  },
197
229
  };
198
230
 
@@ -204,6 +236,12 @@ const generateFiles = async (packages: string[]) => {
204
236
  if (name === 'icon') await GENERATOR.ICONS(dep, name);
205
237
  if (name === 'illustration') await GENERATOR.ICONS(dep, name);
206
238
  await GENERATOR.OTHER(dep, name);
239
+
240
+ const packageJson = await fs.readJson(path.resolve(dirname, 'package.json'));
241
+
242
+ packageJson.exports = packageJsonExports;
243
+
244
+ await fs.writeJson(path.resolve(dirname, 'package.json'), packageJson, { spaces: 2 });
207
245
  }
208
246
  };
209
247