react-responsive-tools 2.0.10 → 2.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-responsive-tools",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -13,8 +13,14 @@ const userConfigPath = path.resolve(__dirname, '../../../../breakpoints.config.j
13
13
 
14
14
  // Функция объединения значений по умолчанию с пользовательскими значениями
15
15
  const mergeConfigs = (defaultConfig, userConfig) => ({
16
- ...defaultConfig,
17
- ...userConfig,
16
+ HORIZONTAL_BREAKPOINTS: {
17
+ ...defaultConfig.HORIZONTAL_BREAKPOINTS,
18
+ ...userConfig.HORIZONTAL_BREAKPOINTS,
19
+ },
20
+ VERTICAL_BREAKPOINTS: {
21
+ ...defaultConfig.VERTICAL_BREAKPOINTS,
22
+ ...userConfig.VERTICAL_BREAKPOINTS,
23
+ }
18
24
  });
19
25
 
20
26
  const mergeBreakpointConfigs = async () => {
@@ -26,8 +32,14 @@ const mergeBreakpointConfigs = async () => {
26
32
  try {
27
33
  console.log(`User config file found at: ${userConfigPath}`);
28
34
  const userConfig = await import(userConfigPath);
35
+ console.log(`User horizontal breakpoints: ${JSON.stringify(userConfig.HORIZONTAL_BREAKPOINTS || {}, null, 2)}`);
36
+ console.log(`User vertical breakpoints: ${JSON.stringify(userConfig.VERTICAL_BREAKPOINTS || {}, null, 2)}`);
37
+
29
38
  horizontalBreakpoints = mergeConfigs(defaultHorizontalBreakpoints, userConfig.HORIZONTAL_BREAKPOINTS || {});
30
39
  verticalBreakpoints = mergeConfigs(defaultVerticalBreakpoints, userConfig.VERTICAL_BREAKPOINTS || {});
40
+
41
+ console.log('Merged horizontal breakpoints: ', JSON.stringify(horizontalBreakpoints, null, 2));
42
+ console.log('Merged vertical breakpoints: ', JSON.stringify(verticalBreakpoints, null, 2));
31
43
  console.log('User config loaded and merged successfully.');
32
44
  } catch (error) {
33
45
  console.error('Error loading user config:', error);
@@ -37,7 +49,7 @@ const mergeBreakpointConfigs = async () => {
37
49
  }
38
50
 
39
51
  const mergedConfigContent = `
40
- // breakpoints.config.mjs
52
+ // custom-breakpoints.config.mjs
41
53
  const HORIZONTAL_BREAKPOINTS = ${JSON.stringify(horizontalBreakpoints, null, 2)};
42
54
 
43
55
  const VERTICAL_BREAKPOINTS = ${JSON.stringify(verticalBreakpoints, null, 2)};