react-responsive-tools 2.3.5 → 2.3.7
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/dist/breakpoints.config.js +20 -18
- package/dist/default.config.d.ts +3 -0
- package/dist/default.config.js +23 -0
- package/dist/default.config.js.map +1 -0
- package/dist/interfaces/TBreakpoint.d.ts +20 -2
- package/dist/scripts/createConfig.mjs +1 -1
- package/dist/scripts/generateCustomBreakpointsSCSS.mjs +1 -1
- package/dist/scripts/generateSCSS.mjs +1 -1
- package/dist/scripts/generateTBreakpoint.mjs +1 -1
- package/dist/scss/_horizontal-breakpoints.scss +0 -1
- package/index.scss +4 -0
- package/package.json +3 -2
- package/reinit.sh +56 -47
- package/dist/scripts/copyDefaultConfig.js +0 -1
@@ -1,23 +1,25 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
// breakpoints.config.mjs
|
2
3
|
const HORIZONTAL_BREAKPOINTS = {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
"xs": "320px",
|
5
|
+
"sm": "576px",
|
6
|
+
"md": "768px",
|
7
|
+
"lg": "992px",
|
8
|
+
"lt": "1024px",
|
9
|
+
"ltm": "1200px",
|
10
|
+
"ltl": "1440px",
|
11
|
+
"xl": "1920px",
|
12
|
+
"xxl": "2560px",
|
13
|
+
"qxl": "3840px"
|
13
14
|
};
|
15
|
+
|
14
16
|
const VERTICAL_BREAKPOINTS = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
"xs": "600px",
|
18
|
+
"sm": "800px",
|
19
|
+
"md": "1000px",
|
20
|
+
"lg": "1200px",
|
21
|
+
"xl": "1600px",
|
22
|
+
"xxl": "1601px"
|
21
23
|
};
|
24
|
+
|
22
25
|
export { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };
|
23
|
-
//# sourceMappingURL=breakpoints.config.js.map
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// breakpointConfig.js
|
2
|
+
const HORIZONTAL_BREAKPOINTS = {
|
3
|
+
xs: '320px',
|
4
|
+
sm: '576px',
|
5
|
+
md: '768px',
|
6
|
+
lg: '992px',
|
7
|
+
lt: '1024px',
|
8
|
+
ltm: '1200px',
|
9
|
+
ltl: '1440px',
|
10
|
+
xl: '1920px',
|
11
|
+
xxl: '2560px',
|
12
|
+
qxl: '3840px',
|
13
|
+
};
|
14
|
+
const VERTICAL_BREAKPOINTS = {
|
15
|
+
xs: '600px',
|
16
|
+
sm: '800px',
|
17
|
+
md: '1000px',
|
18
|
+
lg: '1200px',
|
19
|
+
xl: '1600px',
|
20
|
+
xxl: '1601px',
|
21
|
+
};
|
22
|
+
export { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };
|
23
|
+
//# sourceMappingURL=default.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"default.config.js","sourceRoot":"","sources":["../src/default.config.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,MAAM,sBAAsB,GAA4B;IACtD,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;IACZ,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,EAAE,EAAE,QAAQ;IACZ,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,MAAM,oBAAoB,GAA4B;IACpD,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,CAAC"}
|
@@ -1,2 +1,20 @@
|
|
1
|
-
export type TBreakpoint =
|
2
|
-
|
1
|
+
export type TBreakpoint =
|
2
|
+
| 'xs'
|
3
|
+
| 'sm'
|
4
|
+
| 'md'
|
5
|
+
| 'lg'
|
6
|
+
| 'lt'
|
7
|
+
| 'ltm'
|
8
|
+
| 'ltl'
|
9
|
+
| 'xl'
|
10
|
+
| 'xxl'
|
11
|
+
| 'qxl'
|
12
|
+
|
13
|
+
|
14
|
+
export type TVerticalBreakpoint =
|
15
|
+
| 'xs'
|
16
|
+
| 'sm'
|
17
|
+
| 'md'
|
18
|
+
| 'lg'
|
19
|
+
| 'xl'
|
20
|
+
| 'xxl'
|
@@ -1 +1 @@
|
|
1
|
-
import o from"fs";import n from"path";import{fileURLToPath as e}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as i}from"../default.config.
|
1
|
+
import o from"fs";import n from"path";import{fileURLToPath as e}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as i}from"../default.config.js";const s=e(import.meta.url),l=n.dirname(s),t=n.resolve(l,"../../../../breakpoints.config.js");(async()=>{let e=r,s=i;if(o.existsSync(t))try{console.log(`User config file found at: ${t}`);const o=await import(t);console.log(`Loaded user config: ${JSON.stringify(o,null,2)}`),o.HORIZONTAL_BREAKPOINTS?(e=o.HORIZONTAL_BREAKPOINTS,console.log("Using user provided horizontal breakpoints.")):console.log("Using default horizontal breakpoints."),o.VERTICAL_BREAKPOINTS?(s=o.VERTICAL_BREAKPOINTS,console.log("Using user provided vertical breakpoints.")):console.log("Using default vertical breakpoints.")}catch(o){console.error("Error loading user config:",o)}else console.log(`User config file not found at: ${t}. Using default breakpoints.`);const c=`\n// breakpoints.config.mjs\nconst HORIZONTAL_BREAKPOINTS = ${JSON.stringify(e,null,2)};\n\nconst VERTICAL_BREAKPOINTS = ${JSON.stringify(s,null,2)};\n\nexport { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };\n`;try{o.writeFileSync(n.resolve(l,"../breakpoints.config.js"),c),console.log("Config file has been generated successfully.")}catch(o){console.error("Error writing merged config file:",o)}})();
|
@@ -1 +1 @@
|
|
1
|
-
import o from"fs";import e from"path";import{fileURLToPath as r}from"url";import{HORIZONTAL_BREAKPOINTS as s,VERTICAL_BREAKPOINTS as
|
1
|
+
import o from"fs";import e from"path";import{fileURLToPath as r}from"url";import{HORIZONTAL_BREAKPOINTS as s,VERTICAL_BREAKPOINTS as n}from"../breakpoints.config.js";const t=r(import.meta.url),i=e.dirname(t),m=(o,e)=>`$${e}-breakpoints: (\n${Object.entries(o).map((([o,e])=>` ${o}: ${e}`)).join(",\n")}\n);`,a=`\n${m(s,"horizontal")}\n${m(n,"vertical")}\n`;o.writeFileSync(e.resolve(i,"../scss/_custom-breakpoints.scss"),a),console.log("SCSS file with breakpoints maps has been generated successfully.");
|
@@ -1 +1 @@
|
|
1
|
-
import n from"fs";import e from"path";import{fileURLToPath as i}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as o}from"../breakpoints.config.
|
1
|
+
import n from"fs";import e from"path";import{fileURLToPath as i}from"url";import{HORIZONTAL_BREAKPOINTS as r,VERTICAL_BREAKPOINTS as o}from"../breakpoints.config.js";const s=i(import.meta.url),t=e.dirname(s),l=(c=r,`\n@import "horizontal";\n\n${Object.keys(c).map((n=>`\n/**\n * @mixin for-${n}\n * @description Mixin for applying styles for screens greater than or equal to ${c[n]}px.\n * @example\n * @include for-${n} {\n * // your styles here\n * }\n */\n@mixin for-${n}() {\n @include mob-first(${n}) {\n @content;\n }\n}`)).join("\n")}\n\n${Object.keys(c).map((n=>`\n/**\n * @mixin before-${n}\n * @description Mixin for applying styles for screens less than ${c[n]}px.\n * @example\n * @include before-${n} {\n * // your styles here\n * }\n */\n@mixin before-${n}() {\n @include desk-first(${n}) {\n @content;\n }\n}`)).join("\n")}\n`);var c;const p=(n=>`\n@import "vertical";\n\n${Object.keys(n).map((e=>`\n/**\n * @mixin v-for-${e}\n * @description Mixin for applying styles for screens with height greater than or equal to ${n[e]}px.\n * @example\n * @include v-for-${e} {\n * // your styles here\n * }\n */\n@mixin v-for-${e}() {\n @include v-mob-first(${e}) {\n @content;\n }\n}`)).join("\n")}\n\n${Object.keys(n).map((e=>`\n/**\n * @mixin v-before-${e}\n * @description Mixin for applying styles for screens with height less than ${n[e]}px.\n * @example\n * @include v-before-${e} {\n * // your styles here\n * }\n */\n@mixin v-before-${e}() {\n @include v-desk-first(${e}) {\n @content;\n }\n}`)).join("\n")}\n`)(o);n.writeFileSync(e.resolve(t,"../scss/_horizontal-breakpoints.scss"),l),n.writeFileSync(e.resolve(t,"../scss/_vertical-breakpoints.scss"),p),console.log("SCSS files have been generated successfully.");
|
@@ -1 +1 @@
|
|
1
|
-
import e from"fs";import r from"path";import{fileURLToPath as t}from"url";import{HORIZONTAL_BREAKPOINTS as o,VERTICAL_BREAKPOINTS as n}from"../breakpoints.config.
|
1
|
+
import e from"fs";import r from"path";import{fileURLToPath as t}from"url";import{HORIZONTAL_BREAKPOINTS as o,VERTICAL_BREAKPOINTS as n}from"../breakpoints.config.js";const i=t(import.meta.url),p=r.dirname(i),s=(e,r)=>`export type ${r} =\n${Object.keys(e).map((e=>` | '${e}'`)).join("\n")}\n`,a=`\n${s(o,"TBreakpoint")}\n\n${s(n,"TVerticalBreakpoint")}\n`;e.writeFileSync(r.resolve(p,"../interfaces/TBreakpoint.d.ts"),a.trim()),console.log("TBreakpoint.ts file has been generated successfully.");
|
package/index.scss
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-responsive-tools",
|
3
|
-
"version": "2.3.
|
3
|
+
"version": "2.3.7",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/index.js",
|
@@ -20,7 +20,8 @@
|
|
20
20
|
},
|
21
21
|
"files": [
|
22
22
|
"dist",
|
23
|
-
"reinit.sh"
|
23
|
+
"reinit.sh",
|
24
|
+
"index.scss"
|
24
25
|
],
|
25
26
|
"keywords": [
|
26
27
|
"react",
|
package/reinit.sh
CHANGED
@@ -1,49 +1,58 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
# Путь до каталога dist
|
4
|
-
DIST_DIR="./dist"
|
5
|
-
SCRIPT_DIR="$DIST_DIR/scripts"
|
6
|
-
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
echo "
|
15
|
-
|
16
|
-
|
17
|
-
if [
|
18
|
-
|
19
|
-
|
20
|
-
fi
|
21
|
-
|
22
|
-
# Запуск
|
23
|
-
echo "Running
|
24
|
-
node "$SCRIPT_DIR/
|
25
|
-
|
26
|
-
if [ $? -ne 0 ]; then
|
27
|
-
|
28
|
-
|
29
|
-
fi
|
30
|
-
|
31
|
-
# Запуск
|
32
|
-
echo "Running
|
33
|
-
node "$SCRIPT_DIR/
|
34
|
-
|
35
|
-
if [ $? -ne 0 ]; then
|
36
|
-
|
37
|
-
|
38
|
-
fi
|
39
|
-
|
40
|
-
# Запуск
|
41
|
-
echo "Running
|
42
|
-
node "$SCRIPT_DIR/
|
43
|
-
|
44
|
-
if [ $? -ne 0 ]; then
|
45
|
-
|
46
|
-
|
47
|
-
fi
|
48
|
-
|
49
|
-
|
3
|
+
# Путь до каталога dist
|
4
|
+
DIST_DIR="./dist"
|
5
|
+
SCRIPT_DIR="$DIST_DIR/scripts"
|
6
|
+
|
7
|
+
# Диагностическая информация
|
8
|
+
echo "DIST_DIR: $DIST_DIR"
|
9
|
+
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
10
|
+
|
11
|
+
# Проверка наличия каталога dist и scripts
|
12
|
+
echo "Listing contents of current directory:"
|
13
|
+
ls -la
|
14
|
+
echo "Listing contents of DIST_DIR:"
|
15
|
+
ls -la "$DIST_DIR"
|
16
|
+
|
17
|
+
if [ ! -d "$SCRIPT_DIR" ]; then
|
18
|
+
echo "Scripts directory $SCRIPT_DIR does not exist. Exiting"
|
19
|
+
exit 1
|
20
|
+
fi
|
21
|
+
|
22
|
+
# Запуск createConfig.mjs из dist/scripts
|
23
|
+
echo "Running createConfig.mjs from package..."
|
24
|
+
node "$SCRIPT_DIR/createConfig.mjs"
|
25
|
+
|
26
|
+
if [ $? -ne 0 ]; then
|
27
|
+
echo "Error occurred while running createConfig.mjs"
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Запуск generateCustomBreakpointsSCSS.mjs из dist/scripts
|
32
|
+
echo "Running generateCustomBreakpointsSCSS.mjs from package..."
|
33
|
+
node "$SCRIPT_DIR/generateCustomBreakpointsSCSS.mjs"
|
34
|
+
|
35
|
+
if [ $? -ne 0 ]; then
|
36
|
+
echo "Error occurred while running generateCustomBreakpointsSCSS.mjs"
|
37
|
+
exit 1
|
38
|
+
fi
|
39
|
+
|
40
|
+
# Запуск generateSCSS.mjs из dist/scripts
|
41
|
+
echo "Running generateSCSS.mjs from package..."
|
42
|
+
node "$SCRIPT_DIR/generateSCSS.mjs"
|
43
|
+
|
44
|
+
if [ $? -ne 0 ]; then
|
45
|
+
echo "Error occurred while running generateSCSS.mjs"
|
46
|
+
exit 1
|
47
|
+
fi
|
48
|
+
|
49
|
+
# Запуск generateTBreakpoint.mjs из dist/scripts
|
50
|
+
echo "Running generateTBreakpoint.mjs from package..."
|
51
|
+
node "$SCRIPT_DIR/generateTBreakpoint.mjs"
|
52
|
+
|
53
|
+
if [ $? -ne 0 ]; then
|
54
|
+
echo "Error occurred while running generateTBreakpoint.mjs"
|
55
|
+
exit 1
|
56
|
+
fi
|
57
|
+
|
58
|
+
echo "All scripts have been executed successfully."
|
@@ -1 +0,0 @@
|
|
1
|
-
import fs from"fs";import path from"path";import{fileURLToPath}from"url";const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),defaultConfigPath=path.resolve(__dirname,"../default.config.mjs"),userConfigPath=path.resolve(__dirname,"../../../../breakpoints.config.js");fs.existsSync(userConfigPath)?console.log("User configuration file already exists."):(fs.copyFileSync(defaultConfigPath,userConfigPath),console.log("Default configuration file has been copied to the root of the project as breakpoints.config.js"));
|