@sydsoft/base 1.10.0 → 1.11.0

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.
@@ -11,11 +11,17 @@ var defaultIconStyle = {
11
11
  flexShrink: 0
12
12
  };
13
13
  var customIcons = {};
14
+ // Sadece server-side’da root klasörden oku
14
15
  if (typeof window === "undefined") {
15
16
  try {
16
- customIcons = require("../../../../../../customIcons.json");
17
+ var fs = require("fs");
18
+ var path = require("path");
19
+ var filePath = path.join(process.cwd(), "customIcons.json");
20
+ if (fs.existsSync(filePath)) {
21
+ customIcons = JSON.parse(fs.readFileSync(filePath, "utf-8"));
22
+ }
17
23
  }
18
- catch (err) {
24
+ catch (_a) {
19
25
  customIcons = {};
20
26
  }
21
27
  }
@@ -23,5 +29,7 @@ export var iconMap = __assign(__assign({}, defaultIcons), customIcons);
23
29
  export var Icon = function (_a) {
24
30
  var name = _a.name, customIcon = _a.customIcon, fontSize = _a.fontSize, color = _a.color, className = _a.className, style = _a.style, other = __rest(_a, ["name", "customIcon", "fontSize", "color", "className", "style"]);
25
31
  var iconComponent = name ? iconMap[name] : customIcon;
26
- return (_jsx("span", __assign({ className: className, style: __assign(__assign(__assign({}, defaultIconStyle), style), { fontSize: fontSize || "1.5rem", color: color || "inherit" }) }, other, { children: (iconComponent && (_jsx("svg", { viewBox: iconComponent.viewBox, fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { dangerouslySetInnerHTML: { __html: iconComponent.content } }) }))) || _jsx("span", { children: "\u26A0\uFE0F" }) })));
32
+ if (!iconComponent)
33
+ return _jsx("span", { children: "\u26A0\uFE0F" });
34
+ return (_jsx("span", __assign({ className: className, style: __assign(__assign(__assign({}, defaultIconStyle), style), { fontSize: fontSize || "1.5rem", color: color || "inherit" }) }, other, { children: _jsx("svg", { viewBox: iconComponent.viewBox, fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { dangerouslySetInnerHTML: { __html: iconComponent.content } }) }) })));
27
35
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sydsoft/base",
3
3
  "private": false,
4
- "version": "1.10.0",
4
+ "version": "1.11.0",
5
5
  "description": "",
6
6
  "main": "./dist/cjs/index.js",
7
7
  "module": "./dist/esm/index.js",