@unisphere/nx 4.15.7 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/utils.d.ts +2 -2
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +1 -1
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts +3 -4
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -1
- package/dist/migrations/3-15-0/add-experience-documentation.js +4 -18
- package/dist/migrations/3-23-0/update-documentation-typedoc-plugins.d.ts +3 -6
- package/dist/migrations/3-23-0/update-documentation-typedoc-plugins.d.ts.map +1 -1
- package/dist/migrations/3-23-0/update-documentation-typedoc-plugins.js +4 -166
- package/dist/migrations/4-15-2/move-cli-to-dev-dependencies.d.ts +4 -0
- package/dist/migrations/4-15-2/move-cli-to-dev-dependencies.d.ts.map +1 -1
- package/dist/migrations/4-15-2/move-cli-to-dev-dependencies.js +70 -0
- package/dist/migrations/4-15-8/templates/_publish-artifacts.template +361 -0
- package/dist/migrations/4-15-8/update-publish-artifacts-workflow.d.ts +8 -0
- package/dist/migrations/4-15-8/update-publish-artifacts-workflow.d.ts.map +1 -0
- package/dist/migrations/4-15-8/update-publish-artifacts-workflow.js +40 -0
- package/dist/migrations/4-15-9/templates/_publish-artifacts.template +361 -0
- package/dist/migrations/4-15-9/update-publish-artifacts-workflow.d.ts +10 -0
- package/dist/migrations/4-15-9/update-publish-artifacts-workflow.d.ts.map +1 -0
- package/dist/migrations/4-15-9/update-publish-artifacts-workflow.js +42 -0
- package/dist/migrations/5-0-0/remove-documentation.d.ts +9 -0
- package/dist/migrations/5-0-0/remove-documentation.d.ts.map +1 -0
- package/dist/migrations/5-0-0/remove-documentation.js +45 -0
- package/generators.json +0 -5
- package/migrations.json +25 -0
- package/package.json +1 -1
- package/dist/generators/add-documentation/USAGE.md +0 -64
- package/dist/generators/add-documentation/add-documentation.d.ts +0 -5
- package/dist/generators/add-documentation/add-documentation.d.ts.map +0 -1
- package/dist/generators/add-documentation/add-documentation.js +0 -145
- package/dist/generators/add-documentation/discover-typedoc-plugins.d.ts +0 -23
- package/dist/generators/add-documentation/discover-typedoc-plugins.d.ts.map +0 -1
- package/dist/generators/add-documentation/discover-typedoc-plugins.js +0 -128
- package/dist/generators/add-documentation/schema.d.ts +0 -4
- package/dist/generators/add-documentation/schema.json +0 -20
- package/dist/generators/add-documentation/templates/babel.config.js +0 -3
- package/dist/generators/add-documentation/templates/docs/changelog/overview.md +0 -9
- package/dist/generators/add-documentation/templates/docs/documentations/overview.md +0 -9
- package/dist/generators/add-documentation/templates/docs/reference/overview.md +0 -9
- package/dist/generators/add-documentation/templates/docusaurus.config.ts.template +0 -134
- package/dist/generators/add-documentation/templates/package.json.template +0 -59
- package/dist/generators/add-documentation/templates/plugins/discover-typedoc-plugins.mjs +0 -156
- package/dist/generators/add-documentation/templates/plugins/typedoc-plugins.ts.template +0 -7
- package/dist/generators/add-documentation/templates/postcss.config.js +0 -6
- package/dist/generators/add-documentation/templates/sidebars.ts +0 -9
- package/dist/generators/add-documentation/templates/src/components/demo-placeholder-card.tsx +0 -33
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/genie/integrate-genie-guide.tsx +0 -149
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/notifications/notifications-react-guide.tsx +0 -211
- package/dist/generators/add-documentation/templates/src/components/homepage-features/index.tsx +0 -141
- package/dist/generators/add-documentation/templates/src/components/homepage-features/styles.module.css +0 -87
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/index.tsx +0 -76
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/styles.module.css +0 -120
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/index.tsx +0 -22
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/styles.module.css +0 -38
- package/dist/generators/add-documentation/templates/src/components/interactive-code-panel.tsx +0 -258
- package/dist/generators/add-documentation/templates/src/components/introductions/developer-toolbox-experience.tsx +0 -84
- package/dist/generators/add-documentation/templates/src/components/introductions/hello-world-experience.tsx +0 -133
- package/dist/generators/add-documentation/templates/src/components/introductions/notificaitons-experience.tsx +0 -635
- package/dist/generators/add-documentation/templates/src/components/introductions/reactions-experience.tsx +0 -117
- package/dist/generators/add-documentation/templates/src/components/ui-shared/introduction-card.tsx +0 -117
- package/dist/generators/add-documentation/templates/src/components/ui-shared/playground-card.tsx +0 -67
- package/dist/generators/add-documentation/templates/src/components/ui-shared/use-color-mode.ts +0 -20
- package/dist/generators/add-documentation/templates/src/components/ui-shared/utils.ts +0 -8
- package/dist/generators/add-documentation/templates/src/css/custom.css +0 -710
- package/dist/generators/add-documentation/templates/src/css/hero.module.css +0 -190
- package/dist/generators/add-documentation/templates/src/pages/index.module.css +0 -59
- package/dist/generators/add-documentation/templates/src/pages/index.tsx.template +0 -79
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/index.tsx +0 -103
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/styles.module.css +0 -9
- package/dist/generators/add-documentation/templates/src/theme/Navbar/MobileSidebar/Header/index.tsx +0 -45
- package/dist/generators/add-documentation/templates/static/.nojekyll +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/divider.svg +0 -5
- package/dist/generators/add-documentation/templates/static/homepage/icons/Architecture.svg +0 -4
- package/dist/generators/add-documentation/templates/static/homepage/icons/Cost.svg +0 -4
- package/dist/generators/add-documentation/templates/static/homepage/icons/ExternalLink.svg +0 -3
- package/dist/generators/add-documentation/templates/static/homepage/icons/Infra.svg +0 -8
- package/dist/generators/add-documentation/templates/static/homepage/icons/Redundancies.svg +0 -6
- package/dist/generators/add-documentation/templates/static/homepage/icons/Speed.svg +0 -6
- package/dist/generators/add-documentation/templates/static/homepage/icons/Standards.svg +0 -4
- package/dist/generators/add-documentation/templates/static/homepage/icons/Unified.svg +0 -12
- package/dist/generators/add-documentation/templates/static/homepage/services/custo.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/flame.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/keepr.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/loggi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/palleto.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/publi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/tinker.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/img/favicon.ico +0 -0
- package/dist/generators/add-documentation/templates/static/img/logo.svg +0 -6
- package/dist/generators/add-documentation/templates/static/img/logo_dark.svg +0 -6
- package/dist/generators/add-documentation/templates/static/robots.txt +0 -5
- package/dist/generators/add-documentation/templates/tailwind.config.js +0 -30
- package/dist/generators/add-documentation/templates/tsconfig.json +0 -7
package/dist/generators/add-documentation/templates/src/components/interactive-code-panel.tsx
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import React, { useState, MouseEvent } from 'react';
|
|
2
|
-
import CodeBlock from '@theme/CodeBlock';
|
|
3
|
-
|
|
4
|
-
// Simple markdown parser for basic markdown support in descriptions
|
|
5
|
-
const parseMarkdown = (text: string): string => {
|
|
6
|
-
return text
|
|
7
|
-
// Convert [text](url) to <a href="url">text</a>
|
|
8
|
-
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')
|
|
9
|
-
// Convert **text** to <strong>text</strong>
|
|
10
|
-
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
11
|
-
// Convert *text* to <em>text</em>
|
|
12
|
-
.replace(/\*([^*]+)\*/g, '<em>$1</em>')
|
|
13
|
-
// Convert `code` to <code>code</code>
|
|
14
|
-
.replace(/`([^`]+)`/g, '<code>$1</code>')
|
|
15
|
-
// Convert line breaks to <br>
|
|
16
|
-
.replace(/\n/g, '<br>');
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// Type definitions
|
|
20
|
-
export interface Tab {
|
|
21
|
-
id: string;
|
|
22
|
-
title: string;
|
|
23
|
-
icon: string;
|
|
24
|
-
language?: string;
|
|
25
|
-
content: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
custom?: React.ReactNode;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface InteractiveCodePanelProps {
|
|
31
|
-
title: string;
|
|
32
|
-
description: string;
|
|
33
|
-
tabs: Tab[];
|
|
34
|
-
defaultTab?: string;
|
|
35
|
-
defaultExpanded?: boolean;
|
|
36
|
-
showCopyButton?: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Reusable Interactive Code Demo Component
|
|
40
|
-
const InteractiveCodePanel: React.FC<InteractiveCodePanelProps> = ({
|
|
41
|
-
title,
|
|
42
|
-
description,
|
|
43
|
-
tabs,
|
|
44
|
-
defaultTab,
|
|
45
|
-
defaultExpanded = false,
|
|
46
|
-
showCopyButton = true
|
|
47
|
-
}) => {
|
|
48
|
-
const [activeTab, setActiveTab] = useState<string>(defaultTab || tabs[0]?.id || '');
|
|
49
|
-
const [isExpanded, setIsExpanded] = useState<boolean>(defaultExpanded);
|
|
50
|
-
const [copyStatus, setCopyStatus] = useState<string>('');
|
|
51
|
-
|
|
52
|
-
const getCurrentTab = (): Tab => tabs.find(tab => tab.id === activeTab) || tabs[0];
|
|
53
|
-
const currentTab = getCurrentTab();
|
|
54
|
-
|
|
55
|
-
const copyToClipboard = async (text: string): Promise<void> => {
|
|
56
|
-
try {
|
|
57
|
-
await navigator.clipboard.writeText(text);
|
|
58
|
-
setCopyStatus('✅ Copied!');
|
|
59
|
-
setTimeout(() => setCopyStatus(''), 2000);
|
|
60
|
-
} catch (err) {
|
|
61
|
-
setCopyStatus('❌ Failed to copy');
|
|
62
|
-
setTimeout(() => setCopyStatus(''), 2000);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const handleMouseEnter = (e: MouseEvent<HTMLButtonElement>, tabId: string): void => {
|
|
67
|
-
if (activeTab !== tabId) {
|
|
68
|
-
(e.target as HTMLButtonElement).style.background = 'var(--ifm-color-emphasis-100)';
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const handleMouseLeave = (e: MouseEvent<HTMLButtonElement>, tabId: string): void => {
|
|
73
|
-
if (activeTab !== tabId) {
|
|
74
|
-
(e.target as HTMLButtonElement).style.background = 'transparent';
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const handleCopyButtonMouseEnter = (e: MouseEvent<HTMLButtonElement>): void => {
|
|
79
|
-
(e.target as HTMLButtonElement).style.background = 'var(--ifm-color-primary-dark)';
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const handleCopyButtonMouseLeave = (e: MouseEvent<HTMLButtonElement>): void => {
|
|
83
|
-
(e.target as HTMLButtonElement).style.background = 'var(--ifm-color-primary)';
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<div
|
|
88
|
-
style={{
|
|
89
|
-
background: 'var(--ifm-background-surface-color)',
|
|
90
|
-
border: '1px solid var(--ifm-color-emphasis-300)',
|
|
91
|
-
borderRadius: '12px',
|
|
92
|
-
margin: '24px 0',
|
|
93
|
-
overflow: 'hidden',
|
|
94
|
-
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
{/* Header */}
|
|
98
|
-
<div
|
|
99
|
-
style={{
|
|
100
|
-
padding: '20px 24px',
|
|
101
|
-
background: 'var(--ifm-color-primary-contrast-background)',
|
|
102
|
-
borderBottom: '1px solid var(--ifm-color-emphasis-300)',
|
|
103
|
-
display: 'flex',
|
|
104
|
-
alignItems: 'center',
|
|
105
|
-
justifyContent: 'space-between',
|
|
106
|
-
}}
|
|
107
|
-
>
|
|
108
|
-
<div>
|
|
109
|
-
<h3 style={{ margin: '0 0 4px 0', fontSize: '18px', fontWeight: '600', color: 'var(--ifm-heading-color)' }}>
|
|
110
|
-
{title}
|
|
111
|
-
</h3>
|
|
112
|
-
<p style={{ margin: 0, fontSize: '14px', color: 'var(--ifm-color-content-secondary)' }}>
|
|
113
|
-
{description}
|
|
114
|
-
</p>
|
|
115
|
-
</div>
|
|
116
|
-
<button
|
|
117
|
-
onClick={() => setIsExpanded(!isExpanded)}
|
|
118
|
-
style={{
|
|
119
|
-
padding: '8px 16px',
|
|
120
|
-
background: 'var(--ifm-color-primary)',
|
|
121
|
-
color: 'white',
|
|
122
|
-
border: 'none',
|
|
123
|
-
borderRadius: '6px',
|
|
124
|
-
fontSize: '14px',
|
|
125
|
-
fontWeight: '500',
|
|
126
|
-
cursor: 'pointer',
|
|
127
|
-
display: 'flex',
|
|
128
|
-
alignItems: 'center',
|
|
129
|
-
gap: '8px',
|
|
130
|
-
}}
|
|
131
|
-
>
|
|
132
|
-
{isExpanded ? 'Hide Guide' : 'Show Guide'}
|
|
133
|
-
</button>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
{/* Content */}
|
|
137
|
-
{isExpanded && (
|
|
138
|
-
<div style={{ padding: '0' }}>
|
|
139
|
-
{/* Tab Navigation */}
|
|
140
|
-
<div
|
|
141
|
-
style={{
|
|
142
|
-
display: 'flex',
|
|
143
|
-
flexDirection: 'row',
|
|
144
|
-
borderBottom: '1px solid var(--ifm-color-emphasis-300)',
|
|
145
|
-
background: 'var(--ifm-background-color)',
|
|
146
|
-
}}
|
|
147
|
-
className="tab-navigation"
|
|
148
|
-
>
|
|
149
|
-
{tabs.map((tab) => (
|
|
150
|
-
<button
|
|
151
|
-
key={tab.id}
|
|
152
|
-
onClick={() => setActiveTab(tab.id)}
|
|
153
|
-
style={{
|
|
154
|
-
flex: 1,
|
|
155
|
-
padding: '16px 20px',
|
|
156
|
-
background: activeTab === tab.id ? 'var(--ifm-background-surface-color)' : 'transparent',
|
|
157
|
-
border: 'none',
|
|
158
|
-
borderBottom: activeTab === tab.id ? '2px solid var(--ifm-color-primary)' : '2px solid transparent',
|
|
159
|
-
color: activeTab === tab.id ? 'var(--ifm-color-primary)' : 'var(--ifm-color-content-secondary)',
|
|
160
|
-
fontSize: '14px',
|
|
161
|
-
fontWeight: activeTab === tab.id ? '600' : '500',
|
|
162
|
-
cursor: 'pointer',
|
|
163
|
-
display: 'flex',
|
|
164
|
-
alignItems: 'center',
|
|
165
|
-
justifyContent: 'center',
|
|
166
|
-
gap: '8px',
|
|
167
|
-
transition: 'all 0.2s ease',
|
|
168
|
-
}}
|
|
169
|
-
onMouseEnter={(e) => handleMouseEnter(e, tab.id)}
|
|
170
|
-
onMouseLeave={(e) => handleMouseLeave(e, tab.id)}
|
|
171
|
-
>
|
|
172
|
-
<span>{tab.icon}</span>
|
|
173
|
-
{tab.title}
|
|
174
|
-
</button>
|
|
175
|
-
))}
|
|
176
|
-
</div>
|
|
177
|
-
|
|
178
|
-
{/* Code Content */}
|
|
179
|
-
<div style={{ padding: '24px' }}>
|
|
180
|
-
|
|
181
|
-
{/* Tab Description */}
|
|
182
|
-
{currentTab.description && (
|
|
183
|
-
<div
|
|
184
|
-
style={{
|
|
185
|
-
marginBottom: '16px',
|
|
186
|
-
padding: '16px',
|
|
187
|
-
background: 'var(--ifm-color-info-contrast-background)',
|
|
188
|
-
borderRadius: '8px',
|
|
189
|
-
border: '1px solid var(--ifm-color-info-dark)',
|
|
190
|
-
}}
|
|
191
|
-
>
|
|
192
|
-
<div>
|
|
193
|
-
<h4 style={{ margin: '0 0 8px 0', fontSize: '16px', color: 'var(--ifm-heading-color)' }}>
|
|
194
|
-
{currentTab.icon} {currentTab.title}
|
|
195
|
-
</h4>
|
|
196
|
-
<div
|
|
197
|
-
style={{
|
|
198
|
-
margin: 0,
|
|
199
|
-
fontSize: '14px',
|
|
200
|
-
color: 'var(--ifm-color-content)',
|
|
201
|
-
lineHeight: '1.5'
|
|
202
|
-
}}
|
|
203
|
-
dangerouslySetInnerHTML={{ __html: parseMarkdown(currentTab.description) }}
|
|
204
|
-
/>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
)}
|
|
208
|
-
|
|
209
|
-
<div style={{ position: 'relative' }}>
|
|
210
|
-
{/* Copy Button - only show for code content */}
|
|
211
|
-
{showCopyButton && currentTab.content && !currentTab.custom && (
|
|
212
|
-
<button
|
|
213
|
-
onClick={() => copyToClipboard(currentTab.content)}
|
|
214
|
-
style={{
|
|
215
|
-
position: 'absolute',
|
|
216
|
-
top: '12px',
|
|
217
|
-
right: '12px',
|
|
218
|
-
zIndex: 10,
|
|
219
|
-
padding: '6px 12px',
|
|
220
|
-
background: 'var(--ifm-color-primary)',
|
|
221
|
-
color: 'white',
|
|
222
|
-
border: 'none',
|
|
223
|
-
borderRadius: '4px',
|
|
224
|
-
fontSize: '12px',
|
|
225
|
-
fontWeight: '500',
|
|
226
|
-
cursor: 'pointer',
|
|
227
|
-
display: 'flex',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
gap: '4px',
|
|
230
|
-
transition: 'all 0.2s ease',
|
|
231
|
-
}}
|
|
232
|
-
onMouseEnter={handleCopyButtonMouseEnter}
|
|
233
|
-
onMouseLeave={handleCopyButtonMouseLeave}
|
|
234
|
-
>
|
|
235
|
-
📋 {copyStatus || 'Copy'}
|
|
236
|
-
</button>
|
|
237
|
-
)}
|
|
238
|
-
|
|
239
|
-
{/* Custom Content or Code Block */}
|
|
240
|
-
{currentTab.custom ? (
|
|
241
|
-
<div>{currentTab.custom}</div>
|
|
242
|
-
) : (
|
|
243
|
-
currentTab.content && <CodeBlock language={currentTab.language || 'text'}>
|
|
244
|
-
{currentTab.content}
|
|
245
|
-
</CodeBlock>
|
|
246
|
-
)}
|
|
247
|
-
</div>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</div>
|
|
251
|
-
</div>
|
|
252
|
-
)}
|
|
253
|
-
</div>
|
|
254
|
-
);
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
// Export both the reusable component and the specific demo
|
|
258
|
-
export { InteractiveCodePanel };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PlaygroundCard } from '@site/src/components/ui-shared/playground-card';
|
|
3
|
-
|
|
4
|
-
export const DeveloperToolboxExperience: React.FC = () => {
|
|
5
|
-
const toolboxIcon = (
|
|
6
|
-
<svg
|
|
7
|
-
width="32"
|
|
8
|
-
height="32"
|
|
9
|
-
viewBox="0 0 24 24"
|
|
10
|
-
fill="none"
|
|
11
|
-
stroke="currentColor"
|
|
12
|
-
strokeWidth="1.5"
|
|
13
|
-
style={{
|
|
14
|
-
color: 'var(--ifm-color-content-secondary)',
|
|
15
|
-
opacity: 0.7
|
|
16
|
-
}}
|
|
17
|
-
>
|
|
18
|
-
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" />
|
|
19
|
-
</svg>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<PlaygroundCard
|
|
24
|
-
title="Playground — Developer Toolbox"
|
|
25
|
-
icon={toolboxIcon}
|
|
26
|
-
>
|
|
27
|
-
<div style={{ marginBottom: '1rem', color: 'var(--ifm-color-content-secondary)', fontSize: '0.9rem' }}>
|
|
28
|
-
Experience Unisphere's powerful developer tools in real time
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<div
|
|
32
|
-
style={{
|
|
33
|
-
display: 'inline-flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
gap: '12px',
|
|
36
|
-
padding: '12px 24px',
|
|
37
|
-
backgroundColor: 'var(--ifm-background-surface-color)',
|
|
38
|
-
borderRadius: 'var(--ifm-code-border-radius)',
|
|
39
|
-
border: '1px solid var(--uc-border-color)',
|
|
40
|
-
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
41
|
-
flexWrap: 'wrap',
|
|
42
|
-
justifyContent: 'center',
|
|
43
|
-
minHeight: '48px',
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
<span style={{ fontSize: '14px', fontWeight: '500', color: 'var(--ifm-color-content)' }}>Press</span>
|
|
47
|
-
<kbd
|
|
48
|
-
style={{
|
|
49
|
-
padding: '4px 8px',
|
|
50
|
-
backgroundColor: 'var(--ifm-background-surface-color)',
|
|
51
|
-
borderRadius: 'var(--ifm-code-border-radius)',
|
|
52
|
-
border: '1px solid var(--uc-border-color)',
|
|
53
|
-
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
54
|
-
fontSize: '12px',
|
|
55
|
-
fontFamily: 'monospace',
|
|
56
|
-
color: 'var(--ifm-color-content-secondary)',
|
|
57
|
-
fontWeight: '500'
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
CMD + K
|
|
61
|
-
</kbd>
|
|
62
|
-
<span style={{ fontSize: '14px', color: 'var(--ifm-color-content-secondary)' }}>or</span>
|
|
63
|
-
<kbd
|
|
64
|
-
style={{
|
|
65
|
-
padding: '4px 8px',
|
|
66
|
-
backgroundColor: 'var(--ifm-background-surface-color)',
|
|
67
|
-
borderRadius: 'var(--ifm-code-border-radius)',
|
|
68
|
-
border: '1px solid var(--uc-border-color)',
|
|
69
|
-
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
70
|
-
fontSize: '12px',
|
|
71
|
-
fontFamily: 'monospace',
|
|
72
|
-
color: 'var(--ifm-color-content-secondary)',
|
|
73
|
-
fontWeight: '500'
|
|
74
|
-
}}
|
|
75
|
-
>
|
|
76
|
-
Ctrl + K
|
|
77
|
-
</kbd>
|
|
78
|
-
<span style={{ fontSize: '14px', fontWeight: '500', color: 'var(--ifm-color-content)' }}>to open the Developer Toolbox</span>
|
|
79
|
-
</div>
|
|
80
|
-
</PlaygroundCard>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export default DeveloperToolboxExperience;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { getUnisphereInstance } from '@unisphere/runtime-js'
|
|
3
|
-
import { useEffect, useRef } from 'react'
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { PlaygroundCard } from '@site/src/components/ui-shared/playground-card';
|
|
6
|
-
|
|
7
|
-
export const HelloWorldExperience = ({ preload }: { preload?: boolean }) => {
|
|
8
|
-
|
|
9
|
-
const [loaded, setLoaded] = useState(false);
|
|
10
|
-
const unmountRef = useRef<(() => void) | null>(null);
|
|
11
|
-
|
|
12
|
-
const loadHelloWorldExperience = async () => {
|
|
13
|
-
try {
|
|
14
|
-
setLoaded(true);
|
|
15
|
-
const workspace = await getUnisphereInstance('')
|
|
16
|
-
const { runtime, runtimeInfo } = await workspace.loadRuntime('unisphere.widget.hello', 'hello-world', {});
|
|
17
|
-
|
|
18
|
-
if (runtime) {
|
|
19
|
-
const { unsubscribe } = runtime.mountVisual({
|
|
20
|
-
type: 'docs',
|
|
21
|
-
target: {
|
|
22
|
-
type: 'element',
|
|
23
|
-
elementId: 'hello-world-experience-container',
|
|
24
|
-
},
|
|
25
|
-
settings: {}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Store unmount function for cleanup
|
|
29
|
-
unmountRef.current = unsubscribe;
|
|
30
|
-
|
|
31
|
-
console.log('✅ Hello World loaded:', runtimeInfo);
|
|
32
|
-
}
|
|
33
|
-
} catch (e) {
|
|
34
|
-
console.error('Failed to load Hello World experience:', e)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (preload) {
|
|
40
|
-
loadHelloWorldExperience();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Cleanup on unmount
|
|
44
|
-
return () => {
|
|
45
|
-
if (unmountRef.current) {
|
|
46
|
-
unmountRef.current();
|
|
47
|
-
unmountRef.current = null;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}, [preload])
|
|
51
|
-
|
|
52
|
-
const playIcon = (
|
|
53
|
-
<svg
|
|
54
|
-
width="32"
|
|
55
|
-
height="32"
|
|
56
|
-
viewBox="0 0 24 24"
|
|
57
|
-
fill="none"
|
|
58
|
-
stroke="currentColor"
|
|
59
|
-
strokeWidth="1.5"
|
|
60
|
-
style={{
|
|
61
|
-
color: 'var(--ifm-color-content-secondary)',
|
|
62
|
-
opacity: 0.7
|
|
63
|
-
}}
|
|
64
|
-
>
|
|
65
|
-
<circle cx="12" cy="12" r="10" />
|
|
66
|
-
<polygon points="10,8 16,12 10,16 10,8" />
|
|
67
|
-
</svg>
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<PlaygroundCard
|
|
72
|
-
title="Playground - Hello World Experience"
|
|
73
|
-
icon={!loaded ? playIcon : undefined}
|
|
74
|
-
>
|
|
75
|
-
<div style={{ marginBottom: '1rem' }}>
|
|
76
|
-
{loaded ? (
|
|
77
|
-
<div style={{ color: 'var(--ifm-color-content-secondary)', fontSize: '0.9rem', marginBottom: '0.5rem' }}>
|
|
78
|
-
This hello-world experience is {preload ? 'preloaded' : 'dynamically loaded at runtime'} to verify your Unisphere integration.
|
|
79
|
-
<br />
|
|
80
|
-
<strong style={{ color: 'var(--ifm-color-content)' }}>The widget should appear below!</strong>
|
|
81
|
-
</div>
|
|
82
|
-
) : (
|
|
83
|
-
<div style={{ color: 'var(--ifm-color-content-secondary)', fontSize: '0.9rem' }}>
|
|
84
|
-
Click the button below to load the hello-world experience and verify your workspace integration
|
|
85
|
-
</div>
|
|
86
|
-
)}
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<div
|
|
90
|
-
style={{
|
|
91
|
-
display: 'flex',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
justifyContent: 'center',
|
|
94
|
-
gap: '12px',
|
|
95
|
-
padding: '12px 24px',
|
|
96
|
-
|
|
97
|
-
minHeight: '48px',
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
<div id="hello-world-experience-container"></div>
|
|
101
|
-
{!loaded && (
|
|
102
|
-
<button
|
|
103
|
-
onClick={loadHelloWorldExperience}
|
|
104
|
-
style={{
|
|
105
|
-
padding: '8px 16px',
|
|
106
|
-
background: 'var(--ifm-color-primary)',
|
|
107
|
-
color: 'white',
|
|
108
|
-
border: 'none',
|
|
109
|
-
borderRadius: 'var(--ifm-code-border-radius)',
|
|
110
|
-
fontSize: '14px',
|
|
111
|
-
fontWeight: '500',
|
|
112
|
-
cursor: 'pointer',
|
|
113
|
-
transition: 'all 0.2s ease',
|
|
114
|
-
boxShadow: 'var(--ifm-global-shadow-lw)',
|
|
115
|
-
}}
|
|
116
|
-
onMouseEnter={(e) => {
|
|
117
|
-
e.currentTarget.style.backgroundColor = 'var(--ifm-color-primary-dark)';
|
|
118
|
-
e.currentTarget.style.transform = 'translateY(-1px)';
|
|
119
|
-
e.currentTarget.style.boxShadow = 'var(--ifm-global-shadow-md)';
|
|
120
|
-
}}
|
|
121
|
-
onMouseLeave={(e) => {
|
|
122
|
-
e.currentTarget.style.backgroundColor = 'var(--ifm-color-primary)';
|
|
123
|
-
e.currentTarget.style.transform = 'translateY(0)';
|
|
124
|
-
e.currentTarget.style.boxShadow = 'var(--ifm-global-shadow-lw)';
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
Load Hello World Experience
|
|
128
|
-
</button>
|
|
129
|
-
)}
|
|
130
|
-
</div>
|
|
131
|
-
</PlaygroundCard>
|
|
132
|
-
);
|
|
133
|
-
}
|