@windrun-huaiin/third-ui 7.3.11 → 7.3.13
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/_virtual/cytoscape-cose-bilkent.js +1 -1
- package/dist/_virtual/cytoscape-cose-bilkent.mjs +1 -1
- package/dist/_virtual/cytoscape-fcose.js +1 -1
- package/dist/_virtual/cytoscape-fcose.mjs +1 -1
- package/dist/lib/clerk-intl.d.ts +3 -4566
- package/dist/main/faq.js +0 -1
- package/dist/main/faq.mjs +0 -1
- package/dist/main/gallery.js +0 -1
- package/dist/main/gallery.mjs +0 -1
- package/dist/main/money-price/money-price-button.js +36 -15
- package/dist/main/money-price/money-price-button.mjs +36 -15
- package/dist/main/money-price/money-price-interactive.js +15 -9
- package/dist/main/money-price/money-price-interactive.mjs +16 -10
- package/dist/main/money-price/money-price.js +1 -14
- package/dist/main/money-price/money-price.mjs +1 -14
- package/dist/main/price-plan.js +0 -1
- package/dist/main/price-plan.mjs +0 -1
- package/dist/node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js +1 -1
- package/dist/node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js +1 -1
- package/dist/node_modules/.pnpm/{cytoscape@3.33.0 → cytoscape@3.33.1}/node_modules/cytoscape/dist/cytoscape.esm.js +19 -2
- package/dist/node_modules/.pnpm/{cytoscape@3.33.0 → cytoscape@3.33.1}/node_modules/cytoscape/dist/cytoscape.esm.mjs +19 -2
- package/dist/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js +1 -1
- package/dist/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js +1 -1
- package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-SUXI7LT5.js +1 -1
- package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-SUXI7LT5.mjs +1 -1
- package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-6CBA2TL7.js +1 -1
- package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-6CBA2TL7.mjs +1 -1
- package/package.json +1 -1
- package/src/main/money-price/money-price-button.tsx +48 -24
- package/src/main/money-price/money-price-interactive.tsx +38 -21
- package/src/main/money-price/money-price.tsx +6 -8
- package/dist/clerk/client-page-generator.d.ts +0 -10
- package/dist/clerk/client-page-generator.js +0 -28
- package/dist/clerk/client-page-generator.mjs +0 -25
- package/dist/clerk/context/FingerprintProvider.d.ts +0 -25
- package/dist/clerk/context/FingerprintProvider.js +0 -71
- package/dist/clerk/context/FingerprintProvider.mjs +0 -65
- package/dist/clerk/fingerprint/fingerprint.d.ts +0 -55
- package/dist/clerk/fingerprint/fingerprint.js +0 -17
- package/dist/clerk/fingerprint/fingerprint.mjs +0 -15
- package/dist/clerk/fingerprint.d.ts +0 -55
- package/dist/clerk/fingerprint.js +0 -237
- package/dist/clerk/fingerprint.mjs +0 -225
- package/dist/clerk/hooks/useFingerprint.d.ts +0 -6
- package/dist/clerk/hooks/useFingerprint.js +0 -182
- package/dist/clerk/hooks/useFingerprint.mjs +0 -180
- package/dist/clerk/types.d.ts +0 -42
- package/dist/main/money-price/money-price-config.d.ts +0 -8
- package/dist/main/money-price/money-price-config.js +0 -223
- package/dist/main/money-price/money-price-config.mjs +0 -219
- /package/dist/node_modules/.pnpm/{cytoscape-cose-bilkent@4.1.0_cytoscape@3.33.0 → cytoscape-cose-bilkent@4.1.0_cytoscape@3.33.1}/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js +0 -0
- /package/dist/node_modules/.pnpm/{cytoscape-cose-bilkent@4.1.0_cytoscape@3.33.0 → cytoscape-cose-bilkent@4.1.0_cytoscape@3.33.1}/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.mjs +0 -0
- /package/dist/node_modules/.pnpm/{cytoscape-fcose@2.2.0_cytoscape@3.33.0 → cytoscape-fcose@2.2.0_cytoscape@3.33.1}/node_modules/cytoscape-fcose/cytoscape-fcose.js +0 -0
- /package/dist/node_modules/.pnpm/{cytoscape-fcose@2.2.0_cytoscape@3.33.0 → cytoscape-fcose@2.2.0_cytoscape@3.33.1}/node_modules/cytoscape-fcose/cytoscape-fcose.mjs +0 -0
package/dist/main/faq.js
CHANGED
|
@@ -15,7 +15,6 @@ require('next/navigation');
|
|
|
15
15
|
require('@clerk/nextjs');
|
|
16
16
|
require('../clerk/fingerprint/fingerprint-provider.js');
|
|
17
17
|
require('react-dom');
|
|
18
|
-
require('@windrun-huaiin/third-ui/fuma/mdx');
|
|
19
18
|
require('./money-price/money-price-types.js');
|
|
20
19
|
|
|
21
20
|
function FAQ(_a) {
|
package/dist/main/faq.mjs
CHANGED
package/dist/main/gallery.js
CHANGED
|
@@ -15,7 +15,6 @@ var galleryInteractive = require('./gallery-interactive.js');
|
|
|
15
15
|
require('@clerk/nextjs');
|
|
16
16
|
require('../clerk/fingerprint/fingerprint-provider.js');
|
|
17
17
|
require('react-dom');
|
|
18
|
-
require('@windrun-huaiin/third-ui/fuma/mdx');
|
|
19
18
|
require('./money-price/money-price-types.js');
|
|
20
19
|
|
|
21
20
|
function Gallery(_a) {
|
package/dist/main/gallery.mjs
CHANGED
|
@@ -13,7 +13,6 @@ import { GalleryInteractive } from './gallery-interactive.mjs';
|
|
|
13
13
|
import '@clerk/nextjs';
|
|
14
14
|
import '../clerk/fingerprint/fingerprint-provider.mjs';
|
|
15
15
|
import 'react-dom';
|
|
16
|
-
import '@windrun-huaiin/third-ui/fuma/mdx';
|
|
17
16
|
import './money-price/money-price-types.mjs';
|
|
18
17
|
|
|
19
18
|
function Gallery(_a) {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var tslib_es6 = require('../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2/node_modules/tslib/tslib.es6.js');
|
|
4
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
6
|
-
var server = require('@windrun-huaiin/base-ui/components/server');
|
|
6
|
+
var utils = require('@windrun-huaiin/lib/utils');
|
|
7
7
|
var moneyPriceTypes = require('./money-price-types.js');
|
|
8
|
+
var React = require('react');
|
|
8
9
|
|
|
9
10
|
function capitalize(str) {
|
|
10
11
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
11
12
|
}
|
|
12
13
|
function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrade, texts, isProcessing = false }) {
|
|
13
14
|
const { isAuthenticated, subscriptionStatus } = userContext;
|
|
15
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
14
16
|
// 决定按钮显示和行为
|
|
15
17
|
const getButtonConfig = () => {
|
|
16
18
|
// 匿名用户
|
|
@@ -20,8 +22,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
20
22
|
text: texts[textKey] || texts.getStarted,
|
|
21
23
|
onClick: onLogin,
|
|
22
24
|
disabled: false,
|
|
23
|
-
hidden: false
|
|
24
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.ArrowRight, {})
|
|
25
|
+
hidden: false
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
// 已登录用户
|
|
@@ -31,8 +32,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
31
32
|
return {
|
|
32
33
|
text: texts.currentPlan,
|
|
33
34
|
disabled: true,
|
|
34
|
-
hidden: false
|
|
35
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.GlobeLock, {})
|
|
35
|
+
hidden: false
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
const getFreeUserText = planKey === 'pro' ? texts.getPro : texts.getUltra;
|
|
@@ -40,8 +40,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
40
40
|
text: getFreeUserText,
|
|
41
41
|
onClick: () => onUpgrade(planKey, billingType),
|
|
42
42
|
disabled: false,
|
|
43
|
-
hidden: false
|
|
44
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.ArrowRight, {})
|
|
43
|
+
hidden: false
|
|
45
44
|
};
|
|
46
45
|
case moneyPriceTypes.UserState.ProUser:
|
|
47
46
|
if (planKey === 'free')
|
|
@@ -50,16 +49,14 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
50
49
|
return {
|
|
51
50
|
text: texts.currentPlan,
|
|
52
51
|
disabled: true,
|
|
53
|
-
hidden: false
|
|
54
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.GlobeLock, {})
|
|
52
|
+
hidden: false
|
|
55
53
|
};
|
|
56
54
|
}
|
|
57
55
|
return {
|
|
58
56
|
text: texts.upgrade,
|
|
59
57
|
onClick: () => onUpgrade('ultra', billingType),
|
|
60
58
|
disabled: false,
|
|
61
|
-
hidden: false
|
|
62
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.ArrowRight, {})
|
|
59
|
+
hidden: false
|
|
63
60
|
};
|
|
64
61
|
case moneyPriceTypes.UserState.UltraUser:
|
|
65
62
|
if (planKey !== 'ultra')
|
|
@@ -67,8 +64,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
67
64
|
return {
|
|
68
65
|
text: texts.currentPlan,
|
|
69
66
|
disabled: true,
|
|
70
|
-
hidden: false
|
|
71
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.GlobeLock, {})
|
|
67
|
+
hidden: false
|
|
72
68
|
};
|
|
73
69
|
default:
|
|
74
70
|
return { text: '', disabled: true, hidden: true };
|
|
@@ -77,7 +73,32 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
77
73
|
const config = getButtonConfig();
|
|
78
74
|
if (config.hidden)
|
|
79
75
|
return null;
|
|
80
|
-
|
|
76
|
+
const handleClick = (e) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
if (config.disabled || isLoading || isProcessing) {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (config.onClick) {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
setIsLoading(true);
|
|
84
|
+
try {
|
|
85
|
+
const result = config.onClick();
|
|
86
|
+
// Handle both sync and async functions
|
|
87
|
+
yield Promise.resolve(result);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error('MoneyPriceButton onClick error:', error);
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
setIsLoading(false);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const isDisabled = config.disabled || isLoading || isProcessing;
|
|
98
|
+
const displayText = isLoading ? 'Processing...' : config.text;
|
|
99
|
+
return (jsxRuntime.jsx("button", { className: utils.cn('w-full py-2 mt-auto text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full', isDisabled
|
|
100
|
+
? 'bg-gray-400 cursor-not-allowed'
|
|
101
|
+
: 'bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700'), disabled: isDisabled, onClick: handleClick, type: "button", "data-plan-button": planKey, children: displayText }));
|
|
81
102
|
}
|
|
82
103
|
|
|
83
104
|
exports.MoneyPriceButton = MoneyPriceButton;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2/node_modules/tslib/tslib.es6.mjs';
|
|
2
3
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
-
import { globalLucideIcons } from '@windrun-huaiin/base-ui/components/server';
|
|
4
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
5
|
import { UserState } from './money-price-types.mjs';
|
|
6
|
+
import { useState } from 'react';
|
|
6
7
|
|
|
7
8
|
function capitalize(str) {
|
|
8
9
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
9
10
|
}
|
|
10
11
|
function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrade, texts, isProcessing = false }) {
|
|
11
12
|
const { isAuthenticated, subscriptionStatus } = userContext;
|
|
13
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
12
14
|
// 决定按钮显示和行为
|
|
13
15
|
const getButtonConfig = () => {
|
|
14
16
|
// 匿名用户
|
|
@@ -18,8 +20,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
18
20
|
text: texts[textKey] || texts.getStarted,
|
|
19
21
|
onClick: onLogin,
|
|
20
22
|
disabled: false,
|
|
21
|
-
hidden: false
|
|
22
|
-
icon: jsx(globalLucideIcons.ArrowRight, {})
|
|
23
|
+
hidden: false
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
// 已登录用户
|
|
@@ -29,8 +30,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
29
30
|
return {
|
|
30
31
|
text: texts.currentPlan,
|
|
31
32
|
disabled: true,
|
|
32
|
-
hidden: false
|
|
33
|
-
icon: jsx(globalLucideIcons.GlobeLock, {})
|
|
33
|
+
hidden: false
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
const getFreeUserText = planKey === 'pro' ? texts.getPro : texts.getUltra;
|
|
@@ -38,8 +38,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
38
38
|
text: getFreeUserText,
|
|
39
39
|
onClick: () => onUpgrade(planKey, billingType),
|
|
40
40
|
disabled: false,
|
|
41
|
-
hidden: false
|
|
42
|
-
icon: jsx(globalLucideIcons.ArrowRight, {})
|
|
41
|
+
hidden: false
|
|
43
42
|
};
|
|
44
43
|
case UserState.ProUser:
|
|
45
44
|
if (planKey === 'free')
|
|
@@ -48,16 +47,14 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
48
47
|
return {
|
|
49
48
|
text: texts.currentPlan,
|
|
50
49
|
disabled: true,
|
|
51
|
-
hidden: false
|
|
52
|
-
icon: jsx(globalLucideIcons.GlobeLock, {})
|
|
50
|
+
hidden: false
|
|
53
51
|
};
|
|
54
52
|
}
|
|
55
53
|
return {
|
|
56
54
|
text: texts.upgrade,
|
|
57
55
|
onClick: () => onUpgrade('ultra', billingType),
|
|
58
56
|
disabled: false,
|
|
59
|
-
hidden: false
|
|
60
|
-
icon: jsx(globalLucideIcons.ArrowRight, {})
|
|
57
|
+
hidden: false
|
|
61
58
|
};
|
|
62
59
|
case UserState.UltraUser:
|
|
63
60
|
if (planKey !== 'ultra')
|
|
@@ -65,8 +62,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
65
62
|
return {
|
|
66
63
|
text: texts.currentPlan,
|
|
67
64
|
disabled: true,
|
|
68
|
-
hidden: false
|
|
69
|
-
icon: jsx(globalLucideIcons.GlobeLock, {})
|
|
65
|
+
hidden: false
|
|
70
66
|
};
|
|
71
67
|
default:
|
|
72
68
|
return { text: '', disabled: true, hidden: true };
|
|
@@ -75,7 +71,32 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
75
71
|
const config = getButtonConfig();
|
|
76
72
|
if (config.hidden)
|
|
77
73
|
return null;
|
|
78
|
-
|
|
74
|
+
const handleClick = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
if (config.disabled || isLoading || isProcessing) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (config.onClick) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
setIsLoading(true);
|
|
82
|
+
try {
|
|
83
|
+
const result = config.onClick();
|
|
84
|
+
// Handle both sync and async functions
|
|
85
|
+
yield Promise.resolve(result);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error('MoneyPriceButton onClick error:', error);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
setIsLoading(false);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const isDisabled = config.disabled || isLoading || isProcessing;
|
|
96
|
+
const displayText = isLoading ? 'Processing...' : config.text;
|
|
97
|
+
return (jsx("button", { className: cn('w-full py-2 mt-auto text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full', isDisabled
|
|
98
|
+
? 'bg-gray-400 cursor-not-allowed'
|
|
99
|
+
: 'bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700'), disabled: isDisabled, onClick: handleClick, type: "button", "data-plan-button": planKey, children: displayText }));
|
|
79
100
|
}
|
|
80
101
|
|
|
81
102
|
export { MoneyPriceButton };
|
|
@@ -173,6 +173,8 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
173
173
|
: utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full');
|
|
174
174
|
}
|
|
175
175
|
}, []);
|
|
176
|
+
// State for button portals
|
|
177
|
+
const [buttonPortals, setButtonPortals] = React.useState([]);
|
|
176
178
|
// 处理月付/年付切换和 tooltip 功能
|
|
177
179
|
React.useEffect(() => {
|
|
178
180
|
const monthlyButton = document.querySelector('[data-billing-button="monthly"]');
|
|
@@ -226,14 +228,6 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
226
228
|
}
|
|
227
229
|
});
|
|
228
230
|
});
|
|
229
|
-
// Inject buttons into placeholders using createPortal
|
|
230
|
-
data.plans.forEach((plan) => {
|
|
231
|
-
const placeholder = document.querySelector(`[data-button-placeholder="${plan.key}"]`);
|
|
232
|
-
if (placeholder) {
|
|
233
|
-
console.log('MoneyPriceButton', `[data-button-placeholder="${plan.key}"]`);
|
|
234
|
-
ReactDOM.createPortal(jsxRuntime.jsx(moneyPriceButton.MoneyPriceButton, { planKey: plan.key, userContext: userContext, billingType: billingType, onLogin: handleLogin, onUpgrade: handleUpgrade, texts: data.buttonTexts, isProcessing: isProcessing }), placeholder);
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
231
|
// Initial updates
|
|
238
232
|
updatePriceDisplay(billingType);
|
|
239
233
|
updateDiscountInfo(billingType);
|
|
@@ -252,6 +246,18 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
252
246
|
});
|
|
253
247
|
};
|
|
254
248
|
}, [data, billingType, updatePriceDisplay, updateButtonStyles, updateDiscountInfo, userContext, handleLogin, handleUpgrade, isProcessing]);
|
|
249
|
+
// Create button portals after component mounts
|
|
250
|
+
React.useEffect(() => {
|
|
251
|
+
const portals = [];
|
|
252
|
+
data.plans.forEach((plan) => {
|
|
253
|
+
const placeholder = document.querySelector(`[data-button-placeholder="${plan.key}"]`);
|
|
254
|
+
if (placeholder) {
|
|
255
|
+
console.log('Creating portal for', `[data-button-placeholder="${plan.key}"]`);
|
|
256
|
+
portals.push(ReactDOM.createPortal(jsxRuntime.jsx(moneyPriceButton.MoneyPriceButton, { planKey: plan.key, userContext: userContext, billingType: billingType, onLogin: handleLogin, onUpgrade: handleUpgrade, texts: data.buttonTexts, isProcessing: isProcessing }, plan.key), placeholder));
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
setButtonPortals(portals);
|
|
260
|
+
}, [data.plans, userContext, billingType, handleLogin, handleUpgrade, data.buttonTexts, isProcessing]);
|
|
255
261
|
// Tooltip 组件
|
|
256
262
|
const Tooltip = ({ show, content, x, y }) => {
|
|
257
263
|
if (!show)
|
|
@@ -268,7 +274,7 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
268
274
|
};
|
|
269
275
|
return (jsxRuntime.jsx("div", { style: style, className: "bg-gray-700 dark:bg-gray-200 text-gray-100 dark:text-gray-800 text-xs leading-relaxed px-3 py-2 rounded-lg shadow-lg border border-gray-300 dark:border-gray-600 backdrop-blur-sm", children: content }));
|
|
270
276
|
};
|
|
271
|
-
return jsxRuntime.jsx(Tooltip, Object.assign({}, tooltip));
|
|
277
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, Object.assign({}, tooltip)), buttonPortals] }));
|
|
272
278
|
}
|
|
273
279
|
|
|
274
280
|
exports.MoneyPriceInteractive = MoneyPriceInteractive;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2/node_modules/tslib/tslib.es6.mjs';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useClerk } from '@clerk/nextjs';
|
|
5
5
|
import { useState, useCallback, useMemo, useEffect } from 'react';
|
|
6
6
|
import { useFingerprintContextSafe } from '../../clerk/fingerprint/fingerprint-provider.mjs';
|
|
@@ -171,6 +171,8 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
171
171
|
: cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full');
|
|
172
172
|
}
|
|
173
173
|
}, []);
|
|
174
|
+
// State for button portals
|
|
175
|
+
const [buttonPortals, setButtonPortals] = useState([]);
|
|
174
176
|
// 处理月付/年付切换和 tooltip 功能
|
|
175
177
|
useEffect(() => {
|
|
176
178
|
const monthlyButton = document.querySelector('[data-billing-button="monthly"]');
|
|
@@ -224,14 +226,6 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
224
226
|
}
|
|
225
227
|
});
|
|
226
228
|
});
|
|
227
|
-
// Inject buttons into placeholders using createPortal
|
|
228
|
-
data.plans.forEach((plan) => {
|
|
229
|
-
const placeholder = document.querySelector(`[data-button-placeholder="${plan.key}"]`);
|
|
230
|
-
if (placeholder) {
|
|
231
|
-
console.log('MoneyPriceButton', `[data-button-placeholder="${plan.key}"]`);
|
|
232
|
-
createPortal(jsx(MoneyPriceButton, { planKey: plan.key, userContext: userContext, billingType: billingType, onLogin: handleLogin, onUpgrade: handleUpgrade, texts: data.buttonTexts, isProcessing: isProcessing }), placeholder);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
229
|
// Initial updates
|
|
236
230
|
updatePriceDisplay(billingType);
|
|
237
231
|
updateDiscountInfo(billingType);
|
|
@@ -250,6 +244,18 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
250
244
|
});
|
|
251
245
|
};
|
|
252
246
|
}, [data, billingType, updatePriceDisplay, updateButtonStyles, updateDiscountInfo, userContext, handleLogin, handleUpgrade, isProcessing]);
|
|
247
|
+
// Create button portals after component mounts
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
const portals = [];
|
|
250
|
+
data.plans.forEach((plan) => {
|
|
251
|
+
const placeholder = document.querySelector(`[data-button-placeholder="${plan.key}"]`);
|
|
252
|
+
if (placeholder) {
|
|
253
|
+
console.log('Creating portal for', `[data-button-placeholder="${plan.key}"]`);
|
|
254
|
+
portals.push(createPortal(jsx(MoneyPriceButton, { planKey: plan.key, userContext: userContext, billingType: billingType, onLogin: handleLogin, onUpgrade: handleUpgrade, texts: data.buttonTexts, isProcessing: isProcessing }, plan.key), placeholder));
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
setButtonPortals(portals);
|
|
258
|
+
}, [data.plans, userContext, billingType, handleLogin, handleUpgrade, data.buttonTexts, isProcessing]);
|
|
253
259
|
// Tooltip 组件
|
|
254
260
|
const Tooltip = ({ show, content, x, y }) => {
|
|
255
261
|
if (!show)
|
|
@@ -266,7 +272,7 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
266
272
|
};
|
|
267
273
|
return (jsx("div", { style: style, className: "bg-gray-700 dark:bg-gray-200 text-gray-100 dark:text-gray-800 text-xs leading-relaxed px-3 py-2 rounded-lg shadow-lg border border-gray-300 dark:border-gray-600 backdrop-blur-sm", children: content }));
|
|
268
274
|
};
|
|
269
|
-
return jsx(Tooltip, Object.assign({}, tooltip));
|
|
275
|
+
return (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({}, tooltip)), buttonPortals] }));
|
|
270
276
|
}
|
|
271
277
|
|
|
272
278
|
export { MoneyPriceInteractive };
|
|
@@ -6,18 +6,6 @@ var utils = require('@windrun-huaiin/lib/utils');
|
|
|
6
6
|
var server = require('next-intl/server');
|
|
7
7
|
var moneyPriceConfigUtil = require('./money-price-config-util.js');
|
|
8
8
|
var moneyPriceInteractive = require('./money-price-interactive.js');
|
|
9
|
-
require('@windrun-huaiin/base-ui/components/server');
|
|
10
|
-
require('next-themes');
|
|
11
|
-
require('react');
|
|
12
|
-
require('fumadocs-core/framework');
|
|
13
|
-
require('next/link');
|
|
14
|
-
var gradientButton = require('../../fuma/mdx/gradient-button.js');
|
|
15
|
-
require('next/navigation');
|
|
16
|
-
require('fumadocs-ui/utils/use-copy-button');
|
|
17
|
-
require('fumadocs-core/link');
|
|
18
|
-
require('@windrun-huaiin/base-ui/ui');
|
|
19
|
-
require('fumadocs-ui/components/ui/collapsible');
|
|
20
|
-
require('../../fuma/mdx/banner.js');
|
|
21
9
|
|
|
22
10
|
function MoneyPrice(_a) {
|
|
23
11
|
return tslib_es6.__awaiter(this, arguments, void 0, function* ({ locale, config, upgradeApiEndpoint, signInPath, sectionClassName }) {
|
|
@@ -78,8 +66,7 @@ function MoneyPrice(_a) {
|
|
|
78
66
|
if (!(opt && hasDiscount && opt.discountText))
|
|
79
67
|
return null;
|
|
80
68
|
return (jsxRuntime.jsx("span", { className: "px-2 py-1 text-xs rounded bg-yellow-100 text-yellow-800 font-semibold align-middle text-center inline-flex items-center justify-center whitespace-nowrap", children: opt.discountText.replace('{percent}', String(discountPercent)) }));
|
|
81
|
-
})() })] }), jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: data.plans.map((plan, _idx) => (jsxRuntime.jsxs("div", { "data-price-plan": plan.key, className: utils.cn('flex flex-col bg-white dark:bg-gray-800/60 rounded-2xl border border-gray-300 dark:border-[#7c3aed40] transition p-8
|
|
82
|
-
'hover:border-2 hover:border-purple-500', 'focus-within:border-2 focus-within:border-purple-500'), style: { minHeight: maxFeaturesCount * 100 }, children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [jsxRuntime.jsx("span", { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: plan.title }), plan.titleTags && plan.titleTags.map((tag, i) => (jsxRuntime.jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200 font-semibold align-middle", children: tag }, i)))] }), renderPrice(plan), jsxRuntime.jsx("ul", { className: "flex-1 mb-6 mt-4", children: getFeatureRows(plan).map((feature, i) => (jsxRuntime.jsxs("li", { className: "flex items-center gap-2 mb-2 min-h-[28px]", "data-feature-item": `${plan.key}-${i}`, children: [feature ? (jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-200 mr-1", children: feature.icon ? jsxRuntime.jsx("span", { children: feature.icon }) : jsxRuntime.jsx("span", { className: "font-bold", children: "\u2713" }) })) : (jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full mr-1", children: "\u00A0" })), feature && feature.tag && (jsxRuntime.jsx("span", { className: "px-1 py-0.5 text-[6px] rounded bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 font-semibold align-middle", children: feature.tag })), feature ? (jsxRuntime.jsxs("span", { className: "relative group cursor-pointer text-sm text-gray-800 dark:text-gray-200", children: [feature.description, feature.tooltip && (jsxRuntime.jsx("span", { className: "ml-1 align-middle inline-flex", "data-tooltip-trigger": `${plan.key}-${i}`, "data-tooltip-content": feature.tooltip, children: jsxRuntime.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }))] })) : (jsxRuntime.jsx("span", { children: "\u00A0" }))] }, i))) }), jsxRuntime.jsx("div", { className: "flex-1" }), jsxRuntime.jsx("div", { "data-button-placeholder": plan.key, children: jsxRuntime.jsx(gradientButton.GradientButton, { title: data.buttonTexts.getStarted, disabled: true, align: "center", className: "w-full" }) })] }, plan.key))) }), jsxRuntime.jsx(moneyPriceInteractive.MoneyPriceInteractive, { data: data, config: config, upgradeApiEndpoint: upgradeApiEndpoint, signInPath: signInPath })] }));
|
|
69
|
+
})() })] }), jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: data.plans.map((plan, _idx) => (jsxRuntime.jsxs("div", { "data-price-plan": plan.key, className: utils.cn('flex flex-col bg-white dark:bg-gray-800/60 rounded-2xl border border-gray-300 dark:border-[#7c3aed40] transition p-8 h-full shadow-sm dark:shadow-none', 'hover:border-2 hover:border-purple-500', 'focus-within:border-2 focus-within:border-purple-500'), style: { minHeight: maxFeaturesCount * 100 }, children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [jsxRuntime.jsx("span", { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: plan.title }), plan.titleTags && plan.titleTags.map((tag, i) => (jsxRuntime.jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200 font-semibold align-middle", children: tag }, i)))] }), renderPrice(plan), jsxRuntime.jsx("ul", { className: "flex-1 mb-6 mt-4", children: getFeatureRows(plan).map((feature, i) => (jsxRuntime.jsxs("li", { className: "flex items-center gap-2 mb-2 min-h-[28px]", "data-feature-item": `${plan.key}-${i}`, children: [feature ? (jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-200 mr-1", children: feature.icon ? jsxRuntime.jsx("span", { children: feature.icon }) : jsxRuntime.jsx("span", { className: "font-bold", children: "\u2713" }) })) : (jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full mr-1", children: "\u00A0" })), feature && feature.tag && (jsxRuntime.jsx("span", { className: "px-1 py-0.5 text-[6px] rounded bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 font-semibold align-middle", children: feature.tag })), feature ? (jsxRuntime.jsxs("span", { className: "relative group cursor-pointer text-sm text-gray-800 dark:text-gray-200", children: [feature.description, feature.tooltip && (jsxRuntime.jsx("span", { className: "ml-1 align-middle inline-flex", "data-tooltip-trigger": `${plan.key}-${i}`, "data-tooltip-content": feature.tooltip, children: jsxRuntime.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }))] })) : (jsxRuntime.jsx("span", { children: "\u00A0" }))] }, i))) }), jsxRuntime.jsx("div", { className: "flex-1" }), jsxRuntime.jsx("div", { "data-button-placeholder": plan.key })] }, plan.key))) }), jsxRuntime.jsx(moneyPriceInteractive.MoneyPriceInteractive, { data: data, config: config, upgradeApiEndpoint: upgradeApiEndpoint, signInPath: signInPath })] }));
|
|
83
70
|
});
|
|
84
71
|
}
|
|
85
72
|
|
|
@@ -4,18 +4,6 @@ import { cn } from '@windrun-huaiin/lib/utils';
|
|
|
4
4
|
import { getTranslations } from 'next-intl/server';
|
|
5
5
|
import { getActiveProviderConfig } from './money-price-config-util.mjs';
|
|
6
6
|
import { MoneyPriceInteractive } from './money-price-interactive.mjs';
|
|
7
|
-
import '@windrun-huaiin/base-ui/components/server';
|
|
8
|
-
import 'next-themes';
|
|
9
|
-
import 'react';
|
|
10
|
-
import 'fumadocs-core/framework';
|
|
11
|
-
import 'next/link';
|
|
12
|
-
import { GradientButton } from '../../fuma/mdx/gradient-button.mjs';
|
|
13
|
-
import 'next/navigation';
|
|
14
|
-
import 'fumadocs-ui/utils/use-copy-button';
|
|
15
|
-
import 'fumadocs-core/link';
|
|
16
|
-
import '@windrun-huaiin/base-ui/ui';
|
|
17
|
-
import 'fumadocs-ui/components/ui/collapsible';
|
|
18
|
-
import '../../fuma/mdx/banner.mjs';
|
|
19
7
|
|
|
20
8
|
function MoneyPrice(_a) {
|
|
21
9
|
return __awaiter(this, arguments, void 0, function* ({ locale, config, upgradeApiEndpoint, signInPath, sectionClassName }) {
|
|
@@ -76,8 +64,7 @@ function MoneyPrice(_a) {
|
|
|
76
64
|
if (!(opt && hasDiscount && opt.discountText))
|
|
77
65
|
return null;
|
|
78
66
|
return (jsx("span", { className: "px-2 py-1 text-xs rounded bg-yellow-100 text-yellow-800 font-semibold align-middle text-center inline-flex items-center justify-center whitespace-nowrap", children: opt.discountText.replace('{percent}', String(discountPercent)) }));
|
|
79
|
-
})() })] }), jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: data.plans.map((plan, _idx) => (jsxs("div", { "data-price-plan": plan.key, className: cn('flex flex-col bg-white dark:bg-gray-800/60 rounded-2xl border border-gray-300 dark:border-[#7c3aed40] transition p-8
|
|
80
|
-
'hover:border-2 hover:border-purple-500', 'focus-within:border-2 focus-within:border-purple-500'), style: { minHeight: maxFeaturesCount * 100 }, children: [jsxs("div", { className: "flex items-center gap-2 mb-2", children: [jsx("span", { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: plan.title }), plan.titleTags && plan.titleTags.map((tag, i) => (jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200 font-semibold align-middle", children: tag }, i)))] }), renderPrice(plan), jsx("ul", { className: "flex-1 mb-6 mt-4", children: getFeatureRows(plan).map((feature, i) => (jsxs("li", { className: "flex items-center gap-2 mb-2 min-h-[28px]", "data-feature-item": `${plan.key}-${i}`, children: [feature ? (jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-200 mr-1", children: feature.icon ? jsx("span", { children: feature.icon }) : jsx("span", { className: "font-bold", children: "\u2713" }) })) : (jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full mr-1", children: "\u00A0" })), feature && feature.tag && (jsx("span", { className: "px-1 py-0.5 text-[6px] rounded bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 font-semibold align-middle", children: feature.tag })), feature ? (jsxs("span", { className: "relative group cursor-pointer text-sm text-gray-800 dark:text-gray-200", children: [feature.description, feature.tooltip && (jsx("span", { className: "ml-1 align-middle inline-flex", "data-tooltip-trigger": `${plan.key}-${i}`, "data-tooltip-content": feature.tooltip, children: jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }))] })) : (jsx("span", { children: "\u00A0" }))] }, i))) }), jsx("div", { className: "flex-1" }), jsx("div", { "data-button-placeholder": plan.key, children: jsx(GradientButton, { title: data.buttonTexts.getStarted, disabled: true, align: "center", className: "w-full" }) })] }, plan.key))) }), jsx(MoneyPriceInteractive, { data: data, config: config, upgradeApiEndpoint: upgradeApiEndpoint, signInPath: signInPath })] }));
|
|
67
|
+
})() })] }), jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: data.plans.map((plan, _idx) => (jsxs("div", { "data-price-plan": plan.key, className: cn('flex flex-col bg-white dark:bg-gray-800/60 rounded-2xl border border-gray-300 dark:border-[#7c3aed40] transition p-8 h-full shadow-sm dark:shadow-none', 'hover:border-2 hover:border-purple-500', 'focus-within:border-2 focus-within:border-purple-500'), style: { minHeight: maxFeaturesCount * 100 }, children: [jsxs("div", { className: "flex items-center gap-2 mb-2", children: [jsx("span", { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: plan.title }), plan.titleTags && plan.titleTags.map((tag, i) => (jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200 font-semibold align-middle", children: tag }, i)))] }), renderPrice(plan), jsx("ul", { className: "flex-1 mb-6 mt-4", children: getFeatureRows(plan).map((feature, i) => (jsxs("li", { className: "flex items-center gap-2 mb-2 min-h-[28px]", "data-feature-item": `${plan.key}-${i}`, children: [feature ? (jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-200 mr-1", children: feature.icon ? jsx("span", { children: feature.icon }) : jsx("span", { className: "font-bold", children: "\u2713" }) })) : (jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full mr-1", children: "\u00A0" })), feature && feature.tag && (jsx("span", { className: "px-1 py-0.5 text-[6px] rounded bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 font-semibold align-middle", children: feature.tag })), feature ? (jsxs("span", { className: "relative group cursor-pointer text-sm text-gray-800 dark:text-gray-200", children: [feature.description, feature.tooltip && (jsx("span", { className: "ml-1 align-middle inline-flex", "data-tooltip-trigger": `${plan.key}-${i}`, "data-tooltip-content": feature.tooltip, children: jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }))] })) : (jsx("span", { children: "\u00A0" }))] }, i))) }), jsx("div", { className: "flex-1" }), jsx("div", { "data-button-placeholder": plan.key })] }, plan.key))) }), jsx(MoneyPriceInteractive, { data: data, config: config, upgradeApiEndpoint: upgradeApiEndpoint, signInPath: signInPath })] }));
|
|
81
68
|
});
|
|
82
69
|
}
|
|
83
70
|
|
package/dist/main/price-plan.js
CHANGED
|
@@ -15,7 +15,6 @@ require('@clerk/nextjs');
|
|
|
15
15
|
require('../clerk/fingerprint/fingerprint-provider.js');
|
|
16
16
|
require('next/navigation');
|
|
17
17
|
require('react-dom');
|
|
18
|
-
require('@windrun-huaiin/third-ui/fuma/mdx');
|
|
19
18
|
require('./money-price/money-price-types.js');
|
|
20
19
|
|
|
21
20
|
function PricePlan(_a) {
|
package/dist/main/price-plan.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var coseBase$1 = require('../../../../../_virtual/cose-
|
|
3
|
+
var coseBase$1 = require('../../../../../_virtual/cose-base.js');
|
|
4
4
|
var layoutBase = require('../../../layout-base@1.0.2/node_modules/layout-base/layout-base.js');
|
|
5
5
|
|
|
6
6
|
var coseBase = coseBase$1.__module.exports;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var coseBase$1 = require('../../../../../_virtual/cose-
|
|
3
|
+
var coseBase$1 = require('../../../../../_virtual/cose-base2.js');
|
|
4
4
|
var layoutBase = require('../../../layout-base@2.0.1/node_modules/layout-base/layout-base.js');
|
|
5
5
|
|
|
6
6
|
var coseBase = coseBase$1.__module.exports;
|
|
@@ -33374,6 +33374,13 @@ var ElementDrawingWebGL = /*#__PURE__*/function () {
|
|
|
33374
33374
|
if (!this._isVisible(ele, opts)) {
|
|
33375
33375
|
return;
|
|
33376
33376
|
}
|
|
33377
|
+
|
|
33378
|
+
// Edges with invalid points could be passed here (labels), causing errors
|
|
33379
|
+
// Ref: Random "Script Error" thrown when generating nodes and edges in newest webgl version #3365
|
|
33380
|
+
// https://github.com/cytoscape/cytoscape.js/issues/3365
|
|
33381
|
+
if (ele.isEdge() && !this._isValidEdge(ele)) {
|
|
33382
|
+
return;
|
|
33383
|
+
}
|
|
33377
33384
|
if (this.renderTarget.picking && opts.getTexPickingMode) {
|
|
33378
33385
|
var mode = opts.getTexPickingMode(ele);
|
|
33379
33386
|
if (mode === TEX_PICKING_MODE.IGNORE) {
|
|
@@ -33813,13 +33820,23 @@ var ElementDrawingWebGL = /*#__PURE__*/function () {
|
|
|
33813
33820
|
}
|
|
33814
33821
|
}
|
|
33815
33822
|
}
|
|
33823
|
+
}, {
|
|
33824
|
+
key: "_isValidEdge",
|
|
33825
|
+
value: function _isValidEdge(edge) {
|
|
33826
|
+
var rs = edge._private.rscratch;
|
|
33827
|
+
if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) {
|
|
33828
|
+
// isNaN in case edge is impossible and browser bugs (e.g. safari)
|
|
33829
|
+
return false;
|
|
33830
|
+
}
|
|
33831
|
+
return true;
|
|
33832
|
+
}
|
|
33816
33833
|
}, {
|
|
33817
33834
|
key: "_getEdgePoints",
|
|
33818
33835
|
value: function _getEdgePoints(edge) {
|
|
33819
33836
|
var rs = edge._private.rscratch;
|
|
33820
33837
|
|
|
33821
33838
|
// if bezier ctrl pts can not be calculated, then die
|
|
33822
|
-
if (
|
|
33839
|
+
if (!this._isValidEdge(edge)) {
|
|
33823
33840
|
// isNaN in case edge is impossible and browser bugs (e.g. safari)
|
|
33824
33841
|
return;
|
|
33825
33842
|
}
|
|
@@ -35524,7 +35541,7 @@ sheetfn.appendToStyle = function (style) {
|
|
|
35524
35541
|
return style;
|
|
35525
35542
|
};
|
|
35526
35543
|
|
|
35527
|
-
var version = "3.33.
|
|
35544
|
+
var version = "3.33.1";
|
|
35528
35545
|
|
|
35529
35546
|
var cytoscape = function cytoscape(options) {
|
|
35530
35547
|
// if no options specified, use default
|
|
@@ -33372,6 +33372,13 @@ var ElementDrawingWebGL = /*#__PURE__*/function () {
|
|
|
33372
33372
|
if (!this._isVisible(ele, opts)) {
|
|
33373
33373
|
return;
|
|
33374
33374
|
}
|
|
33375
|
+
|
|
33376
|
+
// Edges with invalid points could be passed here (labels), causing errors
|
|
33377
|
+
// Ref: Random "Script Error" thrown when generating nodes and edges in newest webgl version #3365
|
|
33378
|
+
// https://github.com/cytoscape/cytoscape.js/issues/3365
|
|
33379
|
+
if (ele.isEdge() && !this._isValidEdge(ele)) {
|
|
33380
|
+
return;
|
|
33381
|
+
}
|
|
33375
33382
|
if (this.renderTarget.picking && opts.getTexPickingMode) {
|
|
33376
33383
|
var mode = opts.getTexPickingMode(ele);
|
|
33377
33384
|
if (mode === TEX_PICKING_MODE.IGNORE) {
|
|
@@ -33811,13 +33818,23 @@ var ElementDrawingWebGL = /*#__PURE__*/function () {
|
|
|
33811
33818
|
}
|
|
33812
33819
|
}
|
|
33813
33820
|
}
|
|
33821
|
+
}, {
|
|
33822
|
+
key: "_isValidEdge",
|
|
33823
|
+
value: function _isValidEdge(edge) {
|
|
33824
|
+
var rs = edge._private.rscratch;
|
|
33825
|
+
if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) {
|
|
33826
|
+
// isNaN in case edge is impossible and browser bugs (e.g. safari)
|
|
33827
|
+
return false;
|
|
33828
|
+
}
|
|
33829
|
+
return true;
|
|
33830
|
+
}
|
|
33814
33831
|
}, {
|
|
33815
33832
|
key: "_getEdgePoints",
|
|
33816
33833
|
value: function _getEdgePoints(edge) {
|
|
33817
33834
|
var rs = edge._private.rscratch;
|
|
33818
33835
|
|
|
33819
33836
|
// if bezier ctrl pts can not be calculated, then die
|
|
33820
|
-
if (
|
|
33837
|
+
if (!this._isValidEdge(edge)) {
|
|
33821
33838
|
// isNaN in case edge is impossible and browser bugs (e.g. safari)
|
|
33822
33839
|
return;
|
|
33823
33840
|
}
|
|
@@ -35522,7 +35539,7 @@ sheetfn.appendToStyle = function (style) {
|
|
|
35522
35539
|
return style;
|
|
35523
35540
|
};
|
|
35524
35541
|
|
|
35525
|
-
var version = "3.33.
|
|
35542
|
+
var version = "3.33.1";
|
|
35526
35543
|
|
|
35527
35544
|
var cytoscape = function cytoscape(options) {
|
|
35528
35545
|
// if no options specified, use default
|
|
@@ -7,7 +7,7 @@ var chunk55PJQP7W = require('./chunk-55PJQP7W.js');
|
|
|
7
7
|
var chunkP3VETL53 = require('./chunk-P3VETL53.js');
|
|
8
8
|
var chunk3XYRH5AP = require('./chunk-3XYRH5AP.js');
|
|
9
9
|
var mermaidParser_core = require('../../../../../../@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js');
|
|
10
|
-
var cytoscape_esm = require('../../../../../../cytoscape@3.33.
|
|
10
|
+
var cytoscape_esm = require('../../../../../../cytoscape@3.33.1/node_modules/cytoscape/dist/cytoscape.esm.js');
|
|
11
11
|
var cytoscapeFcose = require('../../../../../../../../_virtual/cytoscape-fcose.js');
|
|
12
12
|
require('../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js');
|
|
13
13
|
require('../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js');
|
|
@@ -5,7 +5,7 @@ import { cleanAndMerge } from './chunk-55PJQP7W.mjs';
|
|
|
5
5
|
import { selectSvgElement } from './chunk-P3VETL53.mjs';
|
|
6
6
|
import { __name, getAccDescription, setAccDescription, getAccTitle, setAccTitle, getDiagramTitle, setDiagramTitle, setupGraphViewbox, getConfig, defaultConfig_default, clear, log, getConfig2 } from './chunk-3XYRH5AP.mjs';
|
|
7
7
|
import { parse } from '../../../../../../@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs';
|
|
8
|
-
import cytoscape from '../../../../../../cytoscape@3.33.
|
|
8
|
+
import cytoscape from '../../../../../../cytoscape@3.33.1/node_modules/cytoscape/dist/cytoscape.esm.mjs';
|
|
9
9
|
import fcose from '../../../../../../../../_virtual/cytoscape-fcose.mjs';
|
|
10
10
|
import '../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.mjs';
|
|
11
11
|
import '../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.mjs';
|