@howone/sdk 0.2.13 → 0.2.15
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/index.js +64 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -56,9 +56,9 @@ function getGlobalEnvironment() {
|
|
|
56
56
|
try {
|
|
57
57
|
const g = globalThis.__HOWONE_ENV__;
|
|
58
58
|
if (g === "local" || g === "dev" || g === "prod") return g;
|
|
59
|
-
return
|
|
59
|
+
return "prod";
|
|
60
60
|
} catch {
|
|
61
|
-
return
|
|
61
|
+
return "prod";
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
var DEFAULT_PROJECT_ID, env, localEnv, devEnv, prodEnv, envs;
|
|
@@ -5127,6 +5127,7 @@ var ClayxButton = ({
|
|
|
5127
5127
|
};
|
|
5128
5128
|
|
|
5129
5129
|
// src/components/ui/LimitUpgradeToast.tsx
|
|
5130
|
+
import React8 from "react";
|
|
5130
5131
|
import { Icon as Icon5 } from "@iconify/react";
|
|
5131
5132
|
|
|
5132
5133
|
// src/components/ui/Toast/ClayxToast.tsx
|
|
@@ -5329,8 +5330,20 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
5329
5330
|
return actualTheme === "dark" ? iconConfig.dark : iconConfig.light;
|
|
5330
5331
|
};
|
|
5331
5332
|
const themeConfig = getThemeConfig();
|
|
5333
|
+
const lightBaseBackgroundByType = {
|
|
5334
|
+
success: "#f0fdf4",
|
|
5335
|
+
// green-50
|
|
5336
|
+
error: "#fef2f2",
|
|
5337
|
+
// red-50
|
|
5338
|
+
warning: "#fffbeb",
|
|
5339
|
+
// amber-50
|
|
5340
|
+
info: "#eff6ff",
|
|
5341
|
+
// blue-50
|
|
5342
|
+
default: "#f9fafb"
|
|
5343
|
+
// gray-50
|
|
5344
|
+
};
|
|
5332
5345
|
if (component) {
|
|
5333
|
-
return /* @__PURE__ */ jsxs9("div", { className: `flex items-start gap-3 !min-h-[90px] w-full backdrop-blur-md p-4 shadow-2xl
|
|
5346
|
+
return /* @__PURE__ */ jsxs9("div", { className: `flex items-start gap-3 !min-h-[90px] w-full backdrop-blur-md p-4 shadow-2xl overflow-hidden ${themeConfig.bgGradient}`, children: [
|
|
5334
5347
|
/* @__PURE__ */ jsx12("div", { className: "flex-1 relative z-10", children: component }),
|
|
5335
5348
|
/* @__PURE__ */ jsx12("div", { className: "relative z-10", children: /* @__PURE__ */ jsx12(CloseButton, { closeToast: handleClose }) })
|
|
5336
5349
|
] });
|
|
@@ -5341,7 +5354,7 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
5341
5354
|
{
|
|
5342
5355
|
className: "absolute left-0 top-0 w-full h-full rounded-xl",
|
|
5343
5356
|
style: {
|
|
5344
|
-
background: theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "#0f1419" :
|
|
5357
|
+
background: theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "#0f1419" : lightBaseBackgroundByType[type],
|
|
5345
5358
|
zIndex: -2
|
|
5346
5359
|
}
|
|
5347
5360
|
}
|
|
@@ -5351,7 +5364,7 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
5351
5364
|
{
|
|
5352
5365
|
className: "absolute left-0 top-0 w-full h-full pointer-events-none rounded-xl",
|
|
5353
5366
|
style: {
|
|
5354
|
-
background: theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? `linear-gradient(135deg, ${themeConfig.gradientColor}30 0%, ${themeConfig.gradientColor}20 15%, #14181df2 30%)` : `linear-gradient(135deg, ${themeConfig.gradientColor}
|
|
5367
|
+
background: theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? `linear-gradient(135deg, ${themeConfig.gradientColor}30 0%, ${themeConfig.gradientColor}20 15%, #14181df2 30%)` : `linear-gradient(135deg, ${themeConfig.gradientColor}20 0%, ${themeConfig.gradientColor}12 15%, #ffffff 30%)`,
|
|
5355
5368
|
zIndex: -1
|
|
5356
5369
|
}
|
|
5357
5370
|
}
|
|
@@ -5362,13 +5375,12 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
5362
5375
|
className: "absolute left-0 top-0 w-full h-full pointer-events-none rounded-xl",
|
|
5363
5376
|
style: {
|
|
5364
5377
|
border: "2px solid transparent",
|
|
5365
|
-
backgroundImage: theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? `linear-gradient(135deg, ${themeConfig.borderGradientColor}60 0%, ${themeConfig.borderGradientColor}40 5%, transparent 22%)` : `linear-gradient(135deg, ${themeConfig.borderGradientColor}
|
|
5378
|
+
backgroundImage: theme === "dark" || theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches ? `linear-gradient(135deg, ${themeConfig.borderGradientColor}60 0%, ${themeConfig.borderGradientColor}40 5%, transparent 22%)` : `linear-gradient(135deg, ${themeConfig.borderGradientColor}99 0%, ${themeConfig.borderGradientColor}66 5%, transparent 22%)`,
|
|
5366
5379
|
backgroundOrigin: "border-box",
|
|
5367
5380
|
backgroundClip: "border-box",
|
|
5368
|
-
WebkitMask: "linear-gradient(#
|
|
5381
|
+
WebkitMask: "linear-gradient(#ffffff 0 0) padding-box, linear-gradient(#ffffff 0 0)",
|
|
5369
5382
|
WebkitMaskComposite: "xor",
|
|
5370
|
-
|
|
5371
|
-
maskComposite: "exclude"
|
|
5383
|
+
zIndex: 0
|
|
5372
5384
|
}
|
|
5373
5385
|
}
|
|
5374
5386
|
),
|
|
@@ -5419,9 +5431,17 @@ var defaultToastOptions = {
|
|
|
5419
5431
|
pauseOnHover: true,
|
|
5420
5432
|
draggable: true,
|
|
5421
5433
|
pauseOnFocusLoss: false,
|
|
5422
|
-
theme: "dark",
|
|
5423
5434
|
transition: Bounce
|
|
5424
5435
|
};
|
|
5436
|
+
var getToastifyTheme = () => {
|
|
5437
|
+
if (typeof window !== "undefined") {
|
|
5438
|
+
const root = document.documentElement;
|
|
5439
|
+
if (root.classList.contains("dark")) return "dark";
|
|
5440
|
+
if (root.classList.contains("light")) return "light";
|
|
5441
|
+
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
5442
|
+
}
|
|
5443
|
+
return "light";
|
|
5444
|
+
};
|
|
5425
5445
|
var createToast = (type) => {
|
|
5426
5446
|
return (params) => {
|
|
5427
5447
|
const { title, message, component, options } = params;
|
|
@@ -5442,6 +5462,7 @@ var createToast = (type) => {
|
|
|
5442
5462
|
{
|
|
5443
5463
|
...defaultToastOptions,
|
|
5444
5464
|
...options,
|
|
5465
|
+
theme: getToastifyTheme(),
|
|
5445
5466
|
// 确保圆角样式不被覆盖,添加 rounded-xl 类
|
|
5446
5467
|
className: "!p-0 !shadow-none !rounded-xl",
|
|
5447
5468
|
style: { padding: 0, borderRadius: "0.75rem" }
|
|
@@ -5460,6 +5481,8 @@ var ClayxToast = {
|
|
|
5460
5481
|
// src/components/ui/LimitUpgradeToast.tsx
|
|
5461
5482
|
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5462
5483
|
var LimitToastContainer = ({ message, onUpgrade, closeToast }) => {
|
|
5484
|
+
const [hover, setHover] = React8.useState(false);
|
|
5485
|
+
const [closeHover, setCloseHover] = React8.useState(false);
|
|
5463
5486
|
return /* @__PURE__ */ jsxs10("div", { className: "relative w-full max-w-[420px] overflow-hidden rounded-md bg-gradient-to-br from-[#1A1A1A] via-[#151515] to-[#1A1A1A] shadow-[0_20px_60px_rgba(168,85,247,0.2)] backdrop-blur-sm", children: [
|
|
5464
5487
|
/* @__PURE__ */ jsx13(
|
|
5465
5488
|
"div",
|
|
@@ -5511,7 +5534,17 @@ var LimitToastContainer = ({ message, onUpgrade, closeToast }) => {
|
|
|
5511
5534
|
onClick: closeToast,
|
|
5512
5535
|
isIconOnly: true,
|
|
5513
5536
|
size: "sm",
|
|
5514
|
-
|
|
5537
|
+
onMouseEnter: () => setCloseHover(true),
|
|
5538
|
+
onMouseLeave: () => setCloseHover(false),
|
|
5539
|
+
style: {
|
|
5540
|
+
height: "1.5rem",
|
|
5541
|
+
width: "1.5rem",
|
|
5542
|
+
minWidth: "1.5rem",
|
|
5543
|
+
borderRadius: "9999px",
|
|
5544
|
+
backgroundColor: closeHover ? "rgba(255,255,255,0.1)" : "rgba(255,255,255,0.05)",
|
|
5545
|
+
transition: "background-color 150ms ease",
|
|
5546
|
+
cursor: "pointer"
|
|
5547
|
+
},
|
|
5515
5548
|
children: /* @__PURE__ */ jsx13(Icon5, { icon: "iconamoon:close", className: "w-4 h-4 text-gray-400" })
|
|
5516
5549
|
}
|
|
5517
5550
|
)
|
|
@@ -5524,8 +5557,17 @@ var LimitToastContainer = ({ message, onUpgrade, closeToast }) => {
|
|
|
5524
5557
|
onUpgrade();
|
|
5525
5558
|
closeToast?.();
|
|
5526
5559
|
},
|
|
5527
|
-
|
|
5528
|
-
|
|
5560
|
+
onMouseEnter: () => setHover(true),
|
|
5561
|
+
onMouseLeave: () => setHover(false),
|
|
5562
|
+
style: {
|
|
5563
|
+
flex: 1,
|
|
5564
|
+
color: "#ffffff",
|
|
5565
|
+
fontWeight: 600,
|
|
5566
|
+
cursor: "pointer",
|
|
5567
|
+
transition: "all 300ms ease-in-out",
|
|
5568
|
+
backgroundImage: hover ? "linear-gradient(to right, #9333ea, #db2777)" : "linear-gradient(to right, #a855f7, #ec4899)",
|
|
5569
|
+
boxShadow: hover ? "0 10px 15px -3px rgba(168,85,247,0.3), 0 4px 6px -2px rgba(168,85,247,0.3)" : "none"
|
|
5570
|
+
},
|
|
5529
5571
|
children: /* @__PURE__ */ jsxs10("span", { className: "flex items-center gap-2", children: [
|
|
5530
5572
|
/* @__PURE__ */ jsx13(Icon5, { icon: "solar:rocket-2-bold", className: "w-4 h-4" }),
|
|
5531
5573
|
"Upgrade Now"
|
|
@@ -6046,11 +6088,11 @@ function createClient(opts) {
|
|
|
6046
6088
|
}
|
|
6047
6089
|
|
|
6048
6090
|
// src/hooks/use-mobile.ts
|
|
6049
|
-
import * as
|
|
6091
|
+
import * as React9 from "react";
|
|
6050
6092
|
var MOBILE_BREAKPOINT = 768;
|
|
6051
6093
|
function useIsMobile() {
|
|
6052
|
-
const [isMobile, setIsMobile] =
|
|
6053
|
-
|
|
6094
|
+
const [isMobile, setIsMobile] = React9.useState(void 0);
|
|
6095
|
+
React9.useEffect(() => {
|
|
6054
6096
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
6055
6097
|
const onChange = () => {
|
|
6056
6098
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|