@semcore/core 17.0.0-prerelease.27 → 17.0.0-prerelease.30

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [17.0.0] - 2026-02-23
5
+ ## [17.0.0] - 2026-03-09
6
6
 
7
7
  ### BREAK
8
8
 
@@ -0,0 +1,3 @@
1
+ export declare function removeUndefinedKeys<T extends {}>(obj: T): any;
2
+ export declare function getSize(size: string | number | undefined): string | undefined;
3
+ export declare function getAutoOrScaleIndent(indent: number | string | undefined, scaleIndent: number): string | number | undefined;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getAutoOrScaleIndent = getAutoOrScaleIndent;
7
+ exports.getSize = getSize;
8
+ exports.removeUndefinedKeys = removeUndefinedKeys;
9
+ function removeUndefinedKeys(obj) {
10
+ return Object.entries(obj).reduce((acc, [key, value]) => {
11
+ if (value !== undefined) {
12
+ acc[key] = value;
13
+ }
14
+ return acc;
15
+ }, {});
16
+ }
17
+ function getSize(size) {
18
+ if (typeof size !== 'number') {
19
+ return size;
20
+ }
21
+ if (size < 1) {
22
+ return `${100 * size}%`;
23
+ }
24
+ if (size >= 1) {
25
+ return `${size}px`;
26
+ }
27
+ }
28
+ function getAutoOrScaleIndent(indent, scaleIndent) {
29
+ if (typeof indent === 'string') {
30
+ return indent;
31
+ }
32
+ if (typeof indent === 'number' && indent > -1 && indent < 1) {
33
+ return `${100 * indent}%`;
34
+ }
35
+ if (typeof indent === 'number' && (indent >= 1 || indent <= -1)) {
36
+ return `${indent * scaleIndent}px`;
37
+ }
38
+ return indent;
39
+ }
40
+ //# sourceMappingURL=indentStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indentStyles.js","names":["removeUndefinedKeys","obj","Object","entries","reduce","acc","key","value","undefined","getSize","size","getAutoOrScaleIndent","indent","scaleIndent"],"sources":["../../src/utils/indentStyles.tsx"],"sourcesContent":["export function removeUndefinedKeys<T extends {}>(obj: T) {\n return Object.entries(obj).reduce((acc: any, [key, value]) => {\n if (value !== undefined) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\nexport function getSize(size: string | number | undefined): string | undefined {\n if (typeof size !== 'number') {\n return size;\n }\n if (size < 1) {\n return `${100 * size}%`;\n }\n if (size >= 1) {\n return `${size}px`;\n }\n}\n\nexport function getAutoOrScaleIndent(indent: number | string | undefined, scaleIndent: number) {\n if (typeof indent === 'string') {\n return indent;\n }\n if (typeof indent === 'number' && indent > -1 && indent < 1) {\n return `${100 * indent}%`;\n }\n if (typeof indent === 'number' && (indent >= 1 || indent <= -1)) {\n return `${indent * scaleIndent}px`;\n }\n return indent;\n}\n"],"mappings":";;;;;;;;AAAO,SAASA,mBAAmBA,CAAeC,GAAM,EAAE;EACxD,OAAOC,MAAM,CAACC,OAAO,CAACF,GAAG,CAAC,CAACG,MAAM,CAAC,CAACC,GAAQ,EAAE,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IAC5D,IAAIA,KAAK,KAAKC,SAAS,EAAE;MACvBH,GAAG,CAACC,GAAG,CAAC,GAAGC,KAAK;IAClB;IACA,OAAOF,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AACR;AAEO,SAASI,OAAOA,CAACC,IAAiC,EAAsB;EAC7E,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAOA,IAAI;EACb;EACA,IAAIA,IAAI,GAAG,CAAC,EAAE;IACZ,OAAO,GAAG,GAAG,GAAGA,IAAI,GAAG;EACzB;EACA,IAAIA,IAAI,IAAI,CAAC,EAAE;IACb,OAAO,GAAGA,IAAI,IAAI;EACpB;AACF;AAEO,SAASC,oBAAoBA,CAACC,MAAmC,EAAEC,WAAmB,EAAE;EAC7F,IAAI,OAAOD,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,GAAG,CAAC,CAAC,IAAIA,MAAM,GAAG,CAAC,EAAE;IAC3D,OAAO,GAAG,GAAG,GAAGA,MAAM,GAAG;EAC3B;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,KAAKA,MAAM,IAAI,CAAC,IAAIA,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;IAC/D,OAAO,GAAGA,MAAM,GAAGC,WAAW,IAAI;EACpC;EACA,OAAOD,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ export function removeUndefinedKeys(obj) {
2
+ return Object.entries(obj).reduce((acc, [key, value]) => {
3
+ if (value !== undefined) {
4
+ acc[key] = value;
5
+ }
6
+ return acc;
7
+ }, {});
8
+ }
9
+ export function getSize(size) {
10
+ if (typeof size !== 'number') {
11
+ return size;
12
+ }
13
+ if (size < 1) {
14
+ return `${100 * size}%`;
15
+ }
16
+ if (size >= 1) {
17
+ return `${size}px`;
18
+ }
19
+ }
20
+ export function getAutoOrScaleIndent(indent, scaleIndent) {
21
+ if (typeof indent === 'string') {
22
+ return indent;
23
+ }
24
+ if (typeof indent === 'number' && indent > -1 && indent < 1) {
25
+ return `${100 * indent}%`;
26
+ }
27
+ if (typeof indent === 'number' && (indent >= 1 || indent <= -1)) {
28
+ return `${indent * scaleIndent}px`;
29
+ }
30
+ return indent;
31
+ }
32
+ //# sourceMappingURL=indentStyles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indentStyles.mjs","names":["removeUndefinedKeys","obj","Object","entries","reduce","acc","key","value","undefined","getSize","size","getAutoOrScaleIndent","indent","scaleIndent"],"sources":["../../src/utils/indentStyles.tsx"],"sourcesContent":["export function removeUndefinedKeys<T extends {}>(obj: T) {\n return Object.entries(obj).reduce((acc: any, [key, value]) => {\n if (value !== undefined) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\nexport function getSize(size: string | number | undefined): string | undefined {\n if (typeof size !== 'number') {\n return size;\n }\n if (size < 1) {\n return `${100 * size}%`;\n }\n if (size >= 1) {\n return `${size}px`;\n }\n}\n\nexport function getAutoOrScaleIndent(indent: number | string | undefined, scaleIndent: number) {\n if (typeof indent === 'string') {\n return indent;\n }\n if (typeof indent === 'number' && indent > -1 && indent < 1) {\n return `${100 * indent}%`;\n }\n if (typeof indent === 'number' && (indent >= 1 || indent <= -1)) {\n return `${indent * scaleIndent}px`;\n }\n return indent;\n}\n"],"mappings":"AAAA,OAAO,SAASA,mBAAmBA,CAAeC,GAAM,EAAE;EACxD,OAAOC,MAAM,CAACC,OAAO,CAACF,GAAG,CAAC,CAACG,MAAM,CAAC,CAACC,GAAQ,EAAE,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IAC5D,IAAIA,KAAK,KAAKC,SAAS,EAAE;MACvBH,GAAG,CAACC,GAAG,CAAC,GAAGC,KAAK;IAClB;IACA,OAAOF,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AACR;AAEA,OAAO,SAASI,OAAOA,CAACC,IAAiC,EAAsB;EAC7E,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAOA,IAAI;EACb;EACA,IAAIA,IAAI,GAAG,CAAC,EAAE;IACZ,OAAO,GAAG,GAAG,GAAGA,IAAI,GAAG;EACzB;EACA,IAAIA,IAAI,IAAI,CAAC,EAAE;IACb,OAAO,GAAGA,IAAI,IAAI;EACpB;AACF;AAEA,OAAO,SAASC,oBAAoBA,CAACC,MAAmC,EAAEC,WAAmB,EAAE;EAC7F,IAAI,OAAOD,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,GAAG,CAAC,CAAC,IAAIA,MAAM,GAAG,CAAC,EAAE;IAC3D,OAAO,GAAG,GAAG,GAAGA,MAAM,GAAG;EAC3B;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,KAAKA,MAAM,IAAI,CAAC,IAAIA,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;IAC/D,OAAO,GAAGA,MAAM,GAAGC,WAAW,IAAI;EACpC;EACA,OAAOD,MAAM;AACf","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/core",
3
3
  "description": "Semrush Core Component",
4
- "version": "17.0.0-prerelease.27",
4
+ "version": "17.0.0-prerelease.30",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",
@@ -198,6 +198,11 @@
198
198
  "import": "./lib/utils/hasParent.mjs",
199
199
  "require": "./lib/utils/hasParent.js"
200
200
  },
201
+ "./lib/utils/indentStyles": {
202
+ "types": "./lib/utils/indentStyles.d.ts",
203
+ "import": "./lib/utils/indentStyles.mjs",
204
+ "require": "./lib/utils/indentStyles.js"
205
+ },
201
206
  "./lib/utils/inputProps": {
202
207
  "types": "./lib/utils/inputProps.d.ts",
203
208
  "import": "./lib/utils/inputProps.mjs",