nextemos 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.
@@ -1 +1,2 @@
1
1
  export { default as fetchRequest } from './fetchRequest';
2
+ export { default as toIntArray } from './toIntArray';
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fetchRequest = void 0;
6
+ exports.toIntArray = exports.fetchRequest = void 0;
7
7
  /// helpers
8
8
  var fetchRequest_1 = require("./fetchRequest");
9
9
  Object.defineProperty(exports, "fetchRequest", { enumerable: true, get: function () { return __importDefault(fetchRequest_1).default; } });
10
+ var toIntArray_1 = require("./toIntArray");
11
+ Object.defineProperty(exports, "toIntArray", { enumerable: true, get: function () { return __importDefault(toIntArray_1).default; } });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * toIntArray Function
3
+ *
4
+ * @description
5
+ * A function that converts a string of numbers separated by a specified separator into an array of integers.
6
+ *
7
+ * @param {string} str - The input string containing numbers separated by the specified separator.
8
+ * @param {string} [separator=','] - The separator used to split the input string. Default is ','.
9
+ * @returns {Array} An array of integers extracted from the input string.
10
+ */
11
+ declare function toIntArray(str: string, separator?: string): number[];
12
+ export default toIntArray;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * toIntArray Function
5
+ *
6
+ * @description
7
+ * A function that converts a string of numbers separated by a specified separator into an array of integers.
8
+ *
9
+ * @param {string} str - The input string containing numbers separated by the specified separator.
10
+ * @param {string} [separator=','] - The separator used to split the input string. Default is ','.
11
+ * @returns {Array} An array of integers extracted from the input string.
12
+ */
13
+ function toIntArray(str, separator = ',') {
14
+ // Split the input string using the specified separator
15
+ const numbers = str.split(separator);
16
+ // Convert the array of strings to an array of integers
17
+ const intArray = numbers.map((num) => parseInt(num, 10));
18
+ return intArray;
19
+ }
20
+ exports.default = toIntArray;
@@ -1,2 +1,3 @@
1
1
  export { default as useFetch } from './useFetch';
2
2
  export { default as useLocalStorage } from './useLocalStorage';
3
+ export { default as useWindowSize } from './useWindowSize';
@@ -3,9 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useLocalStorage = exports.useFetch = void 0;
6
+ exports.useWindowSize = exports.useLocalStorage = exports.useFetch = void 0;
7
7
  /// hooks
8
8
  var useFetch_1 = require("./useFetch");
9
9
  Object.defineProperty(exports, "useFetch", { enumerable: true, get: function () { return __importDefault(useFetch_1).default; } });
10
10
  var useLocalStorage_1 = require("./useLocalStorage");
11
11
  Object.defineProperty(exports, "useLocalStorage", { enumerable: true, get: function () { return __importDefault(useLocalStorage_1).default; } });
12
+ var useWindowSize_1 = require("./useWindowSize");
13
+ Object.defineProperty(exports, "useWindowSize", { enumerable: true, get: function () { return __importDefault(useWindowSize_1).default; } });
@@ -0,0 +1,14 @@
1
+ interface IWindowSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ /**
6
+ * useWindowSize Hook
7
+ *
8
+ * @description
9
+ * A custom React hook that listens for the window size and returns it.
10
+ *
11
+ * @returns {Object} An object containing the width and height of the window window.
12
+ */
13
+ declare const useWindowSize: () => IWindowSize;
14
+ export default useWindowSize;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_1 = require("react");
4
+ /**
5
+ * useWindowSize Hook
6
+ *
7
+ * @description
8
+ * A custom React hook that listens for the window size and returns it.
9
+ *
10
+ * @returns {Object} An object containing the width and height of the window window.
11
+ */
12
+ const useWindowSize = () => {
13
+ const [windowSize, setWindowSize] = (0, react_1.useState)({
14
+ width: window.innerWidth,
15
+ height: window.innerHeight,
16
+ });
17
+ /**
18
+ * handleResize
19
+ *
20
+ * @description
21
+ * A function to update the window size state when the window is resized.
22
+ */
23
+ const handleResize = () => {
24
+ setWindowSize({
25
+ width: window.innerWidth,
26
+ height: window.innerHeight,
27
+ });
28
+ };
29
+ /**
30
+ * useEffect Hook
31
+ *
32
+ * @description
33
+ * A React hook that is used for side-effects in functional components.
34
+ *
35
+ * @params {Function} () => {} A callback function that contains the side-effect logic.
36
+ * @params {Array} [] An array of dependencies. When empty, it means the useEffect runs once after the initial render.
37
+ */
38
+ (0, react_1.useEffect)(() => {
39
+ window.addEventListener('resize', handleResize);
40
+ return () => {
41
+ window.removeEventListener('resize', handleResize);
42
+ };
43
+ }, []);
44
+ return windowSize;
45
+ };
46
+ exports.default = useWindowSize;
@@ -32,7 +32,7 @@ export interface IBannerContainersResponse extends IResponsePaging {
32
32
  /**
33
33
  * Bir banner nesnesinin yapısını temsil eden arayüz.
34
34
  */
35
- interface Banner {
35
+ export interface Banner {
36
36
  /**
37
37
  * Banner için benzersiz tanımlayıcı.
38
38
  */
@@ -131,4 +131,3 @@ export interface BannerContainer {
131
131
  */
132
132
  externalId: number;
133
133
  }
134
- export {};
@@ -2,7 +2,7 @@ import { IResponse, IResponsePaging } from './response';
2
2
  /**
3
3
  * Blog gönderisini temsil eden arayüz
4
4
  */
5
- interface IBlogPost {
5
+ export interface IBlogPost {
6
6
  id: number;
7
7
  templateId: number;
8
8
  order: number;
@@ -25,7 +25,7 @@ interface IBlogPost {
25
25
  /**
26
26
  * Blog kategorisini temsil eden arayüz
27
27
  */
28
- interface IBlogCategory {
28
+ export interface IBlogCategory {
29
29
  id: number;
30
30
  templateId: number;
31
31
  parentId: number;
@@ -45,7 +45,7 @@ interface IBlogCategory {
45
45
  /**
46
46
  * Blog etiketini temsil eden arayüz
47
47
  */
48
- interface IBlogTag {
48
+ export interface IBlogTag {
49
49
  id: number;
50
50
  name: string;
51
51
  culture: string;
@@ -60,7 +60,7 @@ interface IBlogTag {
60
60
  /**
61
61
  * Facet (yüzey) verisini temsil eden arayüz
62
62
  */
63
- interface IFacet {
63
+ export interface IFacet {
64
64
  name: string;
65
65
  count: number;
66
66
  externalData: Object;
@@ -69,7 +69,7 @@ interface IFacet {
69
69
  /**
70
70
  * Constraint (kısıtlama) verisini temsil eden arayüz
71
71
  */
72
- interface IConstraint {
72
+ export interface IConstraint {
73
73
  key: string;
74
74
  count: number;
75
75
  keyAsString: string;
@@ -110,12 +110,12 @@ export interface IChildCategory {
110
110
  description: string;
111
111
  hierarchyField: string;
112
112
  path: string;
113
- childCategories: IChildCategory[];
113
+ childCategories?: IChildCategory[];
114
114
  }
115
115
  /**
116
116
  * Kategori ağacındaki öğeyi temsil eden arayüz
117
117
  */
118
- interface ICategoryTreeItem {
118
+ export interface ICategoryTreeItem {
119
119
  id: number;
120
120
  templateId: number;
121
121
  parentId: number;
@@ -131,22 +131,7 @@ interface ICategoryTreeItem {
131
131
  hierarchy: number[];
132
132
  blogPostBlogCategoryMappings: BlogPostBlogCategoryMapping[];
133
133
  extensionData: object;
134
- childCategories: IChildCategory[];
135
- }
136
- /**
137
- * Blog etiketini temsil eden arayüz (duplikasyon kaldırıldı)
138
- */
139
- interface IBlogTag {
140
- id: number;
141
- name: string;
142
- culture: string;
143
- isApproved: boolean;
144
- tenantId: string;
145
- updatedAtUtc: string;
146
- updatedBy: number;
147
- createdAtUtc: string;
148
- createdBy: number;
149
- blogPostBlogTagMappings: BlogPostBlogTagMapping[];
134
+ childCategories?: IChildCategory[];
150
135
  }
151
136
  /**
152
137
  * Blog gönderileri yanıtını temsil eden arayüz
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",