@banch0u/core-project-test-repository 1.0.30 → 1.2.1

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.
Files changed (42) hide show
  1. package/README.md +91 -0
  2. package/dist/assets/icons/index.js +66 -0
  3. package/dist/components/Button/index.js +45 -0
  4. package/dist/components/ColSort/index.js +55 -0
  5. package/dist/components/Filter/index.js +185 -0
  6. package/dist/components/Loading/index.js +20 -0
  7. package/dist/components/Pagination/Select.js +33 -0
  8. package/dist/components/Pagination/constant.js +22 -0
  9. package/dist/components/Pagination/index.js +53 -0
  10. package/dist/hooks/useNotification.js +59 -0
  11. package/dist/index.js +56 -0
  12. package/dist/utils/message.js +58 -0
  13. package/package.json +17 -8
  14. package/.babelrc +0 -9
  15. package/index.js +0 -2
  16. package/src/assets/icons/index.js +0 -72
  17. package/src/components/Button/index.jsx +0 -61
  18. package/src/components/ColSort/index.jsx +0 -51
  19. package/src/components/Filter/index.jsx +0 -220
  20. package/src/components/Loading/index.jsx +0 -16
  21. package/src/components/Pagination/Select.jsx +0 -26
  22. package/src/components/Pagination/constant.js +0 -22
  23. package/src/components/Pagination/index.jsx +0 -33
  24. package/src/hooks/useNotification.js +0 -57
  25. package/src/index.js +0 -13
  26. package/src/utils/message.js +0 -37
  27. package/webpack.config.js +0 -35
  28. /package/{src → dist}/assets/fonts/Inter/Inter-Black.ttf +0 -0
  29. /package/{src → dist}/assets/fonts/Inter/Inter-Bold.ttf +0 -0
  30. /package/{src → dist}/assets/fonts/Inter/Inter-ExtraBold.ttf +0 -0
  31. /package/{src → dist}/assets/fonts/Inter/Inter-ExtraLight.ttf +0 -0
  32. /package/{src → dist}/assets/fonts/Inter/Inter-Light.ttf +0 -0
  33. /package/{src → dist}/assets/fonts/Inter/Inter-Medium.ttf +0 -0
  34. /package/{src → dist}/assets/fonts/Inter/Inter-Regular.ttf +0 -0
  35. /package/{src → dist}/assets/fonts/Inter/Inter-SemiBold.ttf +0 -0
  36. /package/{src → dist}/assets/fonts/Inter/Inter-Thin.ttf +0 -0
  37. /package/{src → dist}/assets/fonts/fonts.css +0 -0
  38. /package/{src → dist}/components/Button/index.module.scss +0 -0
  39. /package/{src → dist}/components/ColSort/index.module.scss +0 -0
  40. /package/{src → dist}/components/Filter/index.module.scss +0 -0
  41. /package/{src → dist}/components/Loading/index.module.scss +0 -0
  42. /package/{src → dist}/components/Pagination/Pagination.module.scss +0 -0
@@ -1,57 +0,0 @@
1
- // hooks/useNotification.js
2
- import { useEffect, useState } from "react";
3
- import * as signalR from "@microsoft/signalr";
4
- import { infoMessageBottomRight } from "../utils/message";
5
-
6
- const useNotification = () => {
7
- const [notifications, setNotifications] = useState(() => {
8
- // localStorage'dan bildirimi başlat
9
- const savedNotifications = localStorage.getItem("notifications");
10
- return savedNotifications ? JSON.parse(savedNotifications) : [];
11
- });
12
-
13
- useEffect(() => {
14
- const token = localStorage.getItem("token");
15
- let baseUrl;
16
- if (window.location.hostname === "localhost") {
17
-
18
- baseUrl = process.env.REACT_APP_ROOT;
19
- } else {
20
- baseUrl = window.location.origin;
21
- }
22
- if (!token) {
23
- console.error("Token tapılmadı!");
24
- return;
25
- }
26
-
27
- const connection = new signalR.HubConnectionBuilder()
28
- .withUrl(`${baseUrl}/notify?token=${token}`, {
29
- transport:
30
- signalR.HttpTransportType.WebSockets,
31
- withCredentials: false,
32
- skipNegotiation: true,
33
- })
34
- .configureLogging(signalR.LogLevel.Information)
35
- .build();
36
-
37
- connection
38
- .start()
39
- .then(() => {
40
- console.log("SignalR bağlantısı quruldu.");
41
- connection.on("receive", (message) => {
42
- console.log("Yeni bildiriş:", message);
43
- infoMessageBottomRight(message);
44
- });
45
- })
46
- .catch((err) => console.error("SignalR bağlantısı qurula bilmədi:", err));
47
-
48
- return () => {
49
- connection.stop();
50
- console.log("SignalR bağlantısı bağlandı.");
51
- };
52
- }, []);
53
-
54
- return notifications;
55
- };
56
-
57
- export default useNotification;
package/src/index.js DELETED
@@ -1,13 +0,0 @@
1
- // Export the Button component from the components directory as a named export
2
- import "./assets/fonts/fonts.css";
3
- export { default as Button } from "./components/Button";
4
- export { default as ColSort } from "./components/ColSort";
5
- export { default as Filter } from "./components/Filter";
6
- export { default as Loading } from "./components/Loading";
7
- export { default as Pagination } from "./components/Pagination";
8
- export { default as useNotification } from "./hooks/useNotification";
9
- export { default as message } from "./utils/message";
10
-
11
-
12
-
13
-
@@ -1,37 +0,0 @@
1
- import { notification } from "antd";
2
-
3
- const playNotificationSound = async () => {
4
- const audio = new Audio("https://assets.mixkit.co/active_storage/sfx/2575/2575-preview.mp3");
5
- audio.type = "audio/mpeg"; // Audio format
6
- audio.preload = "auto";
7
-
8
- setTimeout(() => {
9
- audio.play().catch((error) => console.error("Audio play failed:", error));
10
- }, 400);
11
- };
12
-
13
-
14
- export const errorMessage = ({ value, placeMent }) => {
15
- return notification.error({
16
- message: "",
17
- description: value || "Serverdə problem baş verdi",
18
- placement: placeMent,
19
- });
20
- };
21
-
22
- export const succesMessage = (value) => {
23
- return notification.success({
24
- message: "",
25
- description: value || "Uğurla tamamlandı",
26
- placement: "topRight",
27
- });
28
- };
29
-
30
- export const infoMessageBottomRight = (value) => {
31
- playNotificationSound();
32
- return notification.info({
33
- message: "Yeni bildiriş",
34
- description: value || "Bildiriş",
35
- placement: "bottomRight",
36
- });
37
- };
package/webpack.config.js DELETED
@@ -1,35 +0,0 @@
1
- const path = require('path');
2
-
3
- module.exports = {
4
- entry: './src/index.js', // Your entry file where your components are exported
5
- output: {
6
- path: path.resolve(__dirname, 'dist'),
7
- filename: 'bundle.js', // Your output bundle
8
- library: '@banch0u/core-project-test-repository', // Exposes your components as a library
9
- libraryTarget: 'umd', // Can be used in various environments like CommonJS, AMD, etc.
10
- clean: true, // Cleans the dist folder before each build
11
- },
12
- resolve: {
13
- extensions: ['.js', '.jsx'], // Resolve .js and .jsx files
14
- },
15
- module: {
16
- rules: [
17
- {
18
- test: /\.jsx?$/, // Applies to JavaScript/JSX files
19
- exclude: /node_modules/,
20
- use: {
21
- loader: 'babel-loader',
22
- },
23
- },
24
- {
25
- test: /\.scss$/, // Handles SCSS files
26
- use: [
27
- 'style-loader', // Adds styles to DOM
28
- 'css-loader', // Translates CSS into CommonJS
29
- 'sass-loader', // Compiles SCSS to CSS
30
- ],
31
- },
32
- ],
33
- },
34
- devtool: 'source-map', // For better error tracking
35
- };
File without changes
File without changes
File without changes