@windrun-huaiin/third-ui 7.3.10 → 7.3.12
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 -7
- package/dist/main/faq.mjs +0 -7
- package/dist/main/gallery.js +0 -7
- package/dist/main/gallery.mjs +0 -7
- package/dist/main/money-price/money-price-button.js +36 -27
- package/dist/main/money-price/money-price-button.mjs +36 -27
- package/dist/main/money-price/money-price-interactive.js +15 -8
- package/dist/main/money-price/money-price-interactive.mjs +16 -9
- package/dist/main/money-price/money-price.js +1 -1
- package/dist/main/money-price/money-price.mjs +1 -1
- package/dist/main/price-plan.js +0 -7
- package/dist/main/price-plan.mjs +0 -7
- 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.mjs +1 -1
- package/dist/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.mjs +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 -20
- package/src/main/money-price/money-price.tsx +2 -2
- 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,13 +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('next-themes');
|
|
19
|
-
require('fumadocs-core/framework');
|
|
20
|
-
require('next/link');
|
|
21
|
-
require('fumadocs-ui/utils/use-copy-button');
|
|
22
|
-
require('fumadocs-core/link');
|
|
23
|
-
require('fumadocs-ui/components/ui/collapsible');
|
|
24
|
-
require('../fuma/mdx/banner.js');
|
|
25
18
|
require('./money-price/money-price-types.js');
|
|
26
19
|
|
|
27
20
|
function FAQ(_a) {
|
package/dist/main/faq.mjs
CHANGED
|
@@ -13,13 +13,6 @@ import 'next/navigation';
|
|
|
13
13
|
import '@clerk/nextjs';
|
|
14
14
|
import '../clerk/fingerprint/fingerprint-provider.mjs';
|
|
15
15
|
import 'react-dom';
|
|
16
|
-
import 'next-themes';
|
|
17
|
-
import 'fumadocs-core/framework';
|
|
18
|
-
import 'next/link';
|
|
19
|
-
import 'fumadocs-ui/utils/use-copy-button';
|
|
20
|
-
import 'fumadocs-core/link';
|
|
21
|
-
import 'fumadocs-ui/components/ui/collapsible';
|
|
22
|
-
import '../fuma/mdx/banner.mjs';
|
|
23
16
|
import './money-price/money-price-types.mjs';
|
|
24
17
|
|
|
25
18
|
function FAQ(_a) {
|
package/dist/main/gallery.js
CHANGED
|
@@ -15,13 +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('next-themes');
|
|
19
|
-
require('fumadocs-core/framework');
|
|
20
|
-
require('next/link');
|
|
21
|
-
require('fumadocs-ui/utils/use-copy-button');
|
|
22
|
-
require('fumadocs-core/link');
|
|
23
|
-
require('fumadocs-ui/components/ui/collapsible');
|
|
24
|
-
require('../fuma/mdx/banner.js');
|
|
25
18
|
require('./money-price/money-price-types.js');
|
|
26
19
|
|
|
27
20
|
function Gallery(_a) {
|
package/dist/main/gallery.mjs
CHANGED
|
@@ -13,13 +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 'next-themes';
|
|
17
|
-
import 'fumadocs-core/framework';
|
|
18
|
-
import 'next/link';
|
|
19
|
-
import 'fumadocs-ui/utils/use-copy-button';
|
|
20
|
-
import 'fumadocs-core/link';
|
|
21
|
-
import 'fumadocs-ui/components/ui/collapsible';
|
|
22
|
-
import '../fuma/mdx/banner.mjs';
|
|
23
16
|
import './money-price/money-price-types.mjs';
|
|
24
17
|
|
|
25
18
|
function Gallery(_a) {
|
|
@@ -1,28 +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
|
-
require('
|
|
6
|
-
var server = require('@windrun-huaiin/base-ui/components/server');
|
|
7
|
-
require('next-themes');
|
|
8
|
-
require('react');
|
|
9
|
-
require('fumadocs-core/framework');
|
|
10
|
-
require('@windrun-huaiin/lib/utils');
|
|
11
|
-
require('next/link');
|
|
12
|
-
var gradientButton = require('../../fuma/mdx/gradient-button.js');
|
|
13
|
-
require('next/navigation');
|
|
14
|
-
require('fumadocs-ui/utils/use-copy-button');
|
|
15
|
-
require('fumadocs-core/link');
|
|
16
|
-
require('@windrun-huaiin/base-ui/ui');
|
|
17
|
-
require('fumadocs-ui/components/ui/collapsible');
|
|
18
|
-
require('../../fuma/mdx/banner.js');
|
|
6
|
+
var utils = require('@windrun-huaiin/lib/utils');
|
|
19
7
|
var moneyPriceTypes = require('./money-price-types.js');
|
|
8
|
+
var React = require('react');
|
|
20
9
|
|
|
21
10
|
function capitalize(str) {
|
|
22
11
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
23
12
|
}
|
|
24
13
|
function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrade, texts, isProcessing = false }) {
|
|
25
14
|
const { isAuthenticated, subscriptionStatus } = userContext;
|
|
15
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
26
16
|
// 决定按钮显示和行为
|
|
27
17
|
const getButtonConfig = () => {
|
|
28
18
|
// 匿名用户
|
|
@@ -32,8 +22,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
32
22
|
text: texts[textKey] || texts.getStarted,
|
|
33
23
|
onClick: onLogin,
|
|
34
24
|
disabled: false,
|
|
35
|
-
hidden: false
|
|
36
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.ArrowRight, {})
|
|
25
|
+
hidden: false
|
|
37
26
|
};
|
|
38
27
|
}
|
|
39
28
|
// 已登录用户
|
|
@@ -43,8 +32,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
43
32
|
return {
|
|
44
33
|
text: texts.currentPlan,
|
|
45
34
|
disabled: true,
|
|
46
|
-
hidden: false
|
|
47
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.GlobeLock, {})
|
|
35
|
+
hidden: false
|
|
48
36
|
};
|
|
49
37
|
}
|
|
50
38
|
const getFreeUserText = planKey === 'pro' ? texts.getPro : texts.getUltra;
|
|
@@ -52,8 +40,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
52
40
|
text: getFreeUserText,
|
|
53
41
|
onClick: () => onUpgrade(planKey, billingType),
|
|
54
42
|
disabled: false,
|
|
55
|
-
hidden: false
|
|
56
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.ArrowRight, {})
|
|
43
|
+
hidden: false
|
|
57
44
|
};
|
|
58
45
|
case moneyPriceTypes.UserState.ProUser:
|
|
59
46
|
if (planKey === 'free')
|
|
@@ -62,16 +49,14 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
62
49
|
return {
|
|
63
50
|
text: texts.currentPlan,
|
|
64
51
|
disabled: true,
|
|
65
|
-
hidden: false
|
|
66
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.GlobeLock, {})
|
|
52
|
+
hidden: false
|
|
67
53
|
};
|
|
68
54
|
}
|
|
69
55
|
return {
|
|
70
56
|
text: texts.upgrade,
|
|
71
57
|
onClick: () => onUpgrade('ultra', billingType),
|
|
72
58
|
disabled: false,
|
|
73
|
-
hidden: false
|
|
74
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.ArrowRight, {})
|
|
59
|
+
hidden: false
|
|
75
60
|
};
|
|
76
61
|
case moneyPriceTypes.UserState.UltraUser:
|
|
77
62
|
if (planKey !== 'ultra')
|
|
@@ -79,8 +64,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
79
64
|
return {
|
|
80
65
|
text: texts.currentPlan,
|
|
81
66
|
disabled: true,
|
|
82
|
-
hidden: false
|
|
83
|
-
icon: jsxRuntime.jsx(server.globalLucideIcons.GlobeLock, {})
|
|
67
|
+
hidden: false
|
|
84
68
|
};
|
|
85
69
|
default:
|
|
86
70
|
return { text: '', disabled: true, hidden: true };
|
|
@@ -89,7 +73,32 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
89
73
|
const config = getButtonConfig();
|
|
90
74
|
if (config.hidden)
|
|
91
75
|
return null;
|
|
92
|
-
|
|
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 }));
|
|
93
102
|
}
|
|
94
103
|
|
|
95
104
|
exports.MoneyPriceButton = MoneyPriceButton;
|
|
@@ -1,26 +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';
|
|
5
|
-
import 'next-themes';
|
|
6
|
-
import 'react';
|
|
7
|
-
import 'fumadocs-core/framework';
|
|
8
|
-
import '@windrun-huaiin/lib/utils';
|
|
9
|
-
import 'next/link';
|
|
10
|
-
import { GradientButton } from '../../fuma/mdx/gradient-button.mjs';
|
|
11
|
-
import 'next/navigation';
|
|
12
|
-
import 'fumadocs-ui/utils/use-copy-button';
|
|
13
|
-
import 'fumadocs-core/link';
|
|
14
|
-
import '@windrun-huaiin/base-ui/ui';
|
|
15
|
-
import 'fumadocs-ui/components/ui/collapsible';
|
|
16
|
-
import '../../fuma/mdx/banner.mjs';
|
|
4
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
17
5
|
import { UserState } from './money-price-types.mjs';
|
|
6
|
+
import { useState } from 'react';
|
|
18
7
|
|
|
19
8
|
function capitalize(str) {
|
|
20
9
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
21
10
|
}
|
|
22
11
|
function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrade, texts, isProcessing = false }) {
|
|
23
12
|
const { isAuthenticated, subscriptionStatus } = userContext;
|
|
13
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
24
14
|
// 决定按钮显示和行为
|
|
25
15
|
const getButtonConfig = () => {
|
|
26
16
|
// 匿名用户
|
|
@@ -30,8 +20,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
30
20
|
text: texts[textKey] || texts.getStarted,
|
|
31
21
|
onClick: onLogin,
|
|
32
22
|
disabled: false,
|
|
33
|
-
hidden: false
|
|
34
|
-
icon: jsx(globalLucideIcons.ArrowRight, {})
|
|
23
|
+
hidden: false
|
|
35
24
|
};
|
|
36
25
|
}
|
|
37
26
|
// 已登录用户
|
|
@@ -41,8 +30,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
41
30
|
return {
|
|
42
31
|
text: texts.currentPlan,
|
|
43
32
|
disabled: true,
|
|
44
|
-
hidden: false
|
|
45
|
-
icon: jsx(globalLucideIcons.GlobeLock, {})
|
|
33
|
+
hidden: false
|
|
46
34
|
};
|
|
47
35
|
}
|
|
48
36
|
const getFreeUserText = planKey === 'pro' ? texts.getPro : texts.getUltra;
|
|
@@ -50,8 +38,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
50
38
|
text: getFreeUserText,
|
|
51
39
|
onClick: () => onUpgrade(planKey, billingType),
|
|
52
40
|
disabled: false,
|
|
53
|
-
hidden: false
|
|
54
|
-
icon: jsx(globalLucideIcons.ArrowRight, {})
|
|
41
|
+
hidden: false
|
|
55
42
|
};
|
|
56
43
|
case UserState.ProUser:
|
|
57
44
|
if (planKey === 'free')
|
|
@@ -60,16 +47,14 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
60
47
|
return {
|
|
61
48
|
text: texts.currentPlan,
|
|
62
49
|
disabled: true,
|
|
63
|
-
hidden: false
|
|
64
|
-
icon: jsx(globalLucideIcons.GlobeLock, {})
|
|
50
|
+
hidden: false
|
|
65
51
|
};
|
|
66
52
|
}
|
|
67
53
|
return {
|
|
68
54
|
text: texts.upgrade,
|
|
69
55
|
onClick: () => onUpgrade('ultra', billingType),
|
|
70
56
|
disabled: false,
|
|
71
|
-
hidden: false
|
|
72
|
-
icon: jsx(globalLucideIcons.ArrowRight, {})
|
|
57
|
+
hidden: false
|
|
73
58
|
};
|
|
74
59
|
case UserState.UltraUser:
|
|
75
60
|
if (planKey !== 'ultra')
|
|
@@ -77,8 +62,7 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
77
62
|
return {
|
|
78
63
|
text: texts.currentPlan,
|
|
79
64
|
disabled: true,
|
|
80
|
-
hidden: false
|
|
81
|
-
icon: jsx(globalLucideIcons.GlobeLock, {})
|
|
65
|
+
hidden: false
|
|
82
66
|
};
|
|
83
67
|
default:
|
|
84
68
|
return { text: '', disabled: true, hidden: true };
|
|
@@ -87,7 +71,32 @@ function MoneyPriceButton({ planKey, userContext, billingType, onLogin, onUpgrad
|
|
|
87
71
|
const config = getButtonConfig();
|
|
88
72
|
if (config.hidden)
|
|
89
73
|
return null;
|
|
90
|
-
|
|
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 }));
|
|
91
100
|
}
|
|
92
101
|
|
|
93
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,13 +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
|
-
ReactDOM.createPortal(jsxRuntime.jsx(moneyPriceButton.MoneyPriceButton, { planKey: plan.key, userContext: userContext, billingType: billingType, onLogin: handleLogin, onUpgrade: handleUpgrade, texts: data.buttonTexts, isProcessing: isProcessing }), placeholder);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
231
|
// Initial updates
|
|
237
232
|
updatePriceDisplay(billingType);
|
|
238
233
|
updateDiscountInfo(billingType);
|
|
@@ -251,6 +246,18 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
251
246
|
});
|
|
252
247
|
};
|
|
253
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]);
|
|
254
261
|
// Tooltip 组件
|
|
255
262
|
const Tooltip = ({ show, content, x, y }) => {
|
|
256
263
|
if (!show)
|
|
@@ -267,7 +274,7 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
267
274
|
};
|
|
268
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 }));
|
|
269
276
|
};
|
|
270
|
-
return jsxRuntime.jsx(Tooltip, Object.assign({}, tooltip));
|
|
277
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, Object.assign({}, tooltip)), buttonPortals] }));
|
|
271
278
|
}
|
|
272
279
|
|
|
273
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,13 +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
|
-
createPortal(jsx(MoneyPriceButton, { planKey: plan.key, userContext: userContext, billingType: billingType, onLogin: handleLogin, onUpgrade: handleUpgrade, texts: data.buttonTexts, isProcessing: isProcessing }), placeholder);
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
229
|
// Initial updates
|
|
235
230
|
updatePriceDisplay(billingType);
|
|
236
231
|
updateDiscountInfo(billingType);
|
|
@@ -249,6 +244,18 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
249
244
|
});
|
|
250
245
|
};
|
|
251
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]);
|
|
252
259
|
// Tooltip 组件
|
|
253
260
|
const Tooltip = ({ show, content, x, y }) => {
|
|
254
261
|
if (!show)
|
|
@@ -265,7 +272,7 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
265
272
|
};
|
|
266
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 }));
|
|
267
274
|
};
|
|
268
|
-
return jsx(Tooltip, Object.assign({}, tooltip));
|
|
275
|
+
return (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({}, tooltip)), buttonPortals] }));
|
|
269
276
|
}
|
|
270
277
|
|
|
271
278
|
export { MoneyPriceInteractive };
|
|
@@ -67,7 +67,7 @@ function MoneyPrice(_a) {
|
|
|
67
67
|
return null;
|
|
68
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)) }));
|
|
69
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 w-full h-full shadow-sm dark:shadow-none', // 添加 w-full
|
|
70
|
-
'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
|
|
70
|
+
'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 })] }));
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -65,7 +65,7 @@ function MoneyPrice(_a) {
|
|
|
65
65
|
return null;
|
|
66
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)) }));
|
|
67
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 w-full h-full shadow-sm dark:shadow-none', // 添加 w-full
|
|
68
|
-
'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
|
|
68
|
+
'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 })] }));
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
|
package/dist/main/price-plan.js
CHANGED
|
@@ -15,13 +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('next-themes');
|
|
19
|
-
require('fumadocs-core/framework');
|
|
20
|
-
require('next/link');
|
|
21
|
-
require('fumadocs-ui/utils/use-copy-button');
|
|
22
|
-
require('fumadocs-core/link');
|
|
23
|
-
require('fumadocs-ui/components/ui/collapsible');
|
|
24
|
-
require('../fuma/mdx/banner.js');
|
|
25
18
|
require('./money-price/money-price-types.js');
|
|
26
19
|
|
|
27
20
|
function PricePlan(_a) {
|
package/dist/main/price-plan.mjs
CHANGED
|
@@ -13,13 +13,6 @@ import '@clerk/nextjs';
|
|
|
13
13
|
import '../clerk/fingerprint/fingerprint-provider.mjs';
|
|
14
14
|
import 'next/navigation';
|
|
15
15
|
import 'react-dom';
|
|
16
|
-
import 'next-themes';
|
|
17
|
-
import 'fumadocs-core/framework';
|
|
18
|
-
import 'next/link';
|
|
19
|
-
import 'fumadocs-ui/utils/use-copy-button';
|
|
20
|
-
import 'fumadocs-core/link';
|
|
21
|
-
import 'fumadocs-ui/components/ui/collapsible';
|
|
22
|
-
import '../fuma/mdx/banner.mjs';
|
|
23
16
|
import './money-price/money-price-types.mjs';
|
|
24
17
|
|
|
25
18
|
function PricePlan(_a) {
|
|
@@ -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';
|
|
@@ -4,7 +4,7 @@ var chunkQESNASVV = require('./chunk-QESNASVV.js');
|
|
|
4
4
|
var chunk55PJQP7W = require('./chunk-55PJQP7W.js');
|
|
5
5
|
var chunkP3VETL53 = require('./chunk-P3VETL53.js');
|
|
6
6
|
var chunk3XYRH5AP = require('./chunk-3XYRH5AP.js');
|
|
7
|
-
var cytoscape_esm = require('../../../../../../cytoscape@3.33.
|
|
7
|
+
var cytoscape_esm = require('../../../../../../cytoscape@3.33.1/node_modules/cytoscape/dist/cytoscape.esm.js');
|
|
8
8
|
var cytoscapeCoseBilkent = require('../../../../../../../../_virtual/cytoscape-cose-bilkent.js');
|
|
9
9
|
require('../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js');
|
|
10
10
|
require('../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js');
|