@vllnt/ui 0.2.1-canary.0aaaad2 → 0.2.1-canary.26ff803
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/CHANGELOG.md +3 -0
- package/dist/components/activity-heatmap/activity-heatmap.js +2 -1
- package/dist/components/ai-artifact/ai-artifact.js +8 -8
- package/dist/components/ai-sidebar/ai-sidebar.js +4 -4
- package/dist/components/animated-text/animated-text.js +6 -3
- package/dist/components/auto-reload/auto-reload.js +1 -1
- package/dist/components/blog-card/blog-card.js +3 -1
- package/dist/components/bottom-activity-strip/bottom-activity-strip.js +2 -2
- package/dist/components/candlestick-chart/candlestick-chart.js +2 -1
- package/dist/components/carousel/carousel.js +14 -6
- package/dist/components/checklist/checklist.js +35 -7
- package/dist/components/checklist/index.js +8 -2
- package/dist/components/chronological-timeline/chronological-timeline.js +2 -2
- package/dist/components/code-playground/code-playground.js +2 -1
- package/dist/components/combobox/combobox.js +0 -5
- package/dist/components/comment-pin/comment-pin.js +2 -2
- package/dist/components/comparison/comparison.js +2 -1
- package/dist/components/completion-dialog/completion-dialog.js +18 -10
- package/dist/components/content-intro/content-intro.js +17 -14
- package/dist/components/conversation-thread/conversation-thread.js +3 -3
- package/dist/components/date-picker/date-picker.js +0 -5
- package/dist/components/exercise/exercise.js +10 -2
- package/dist/components/faq/faq.js +6 -2
- package/dist/components/file-upload/file-upload.js +0 -5
- package/dist/components/filter-bar/filter-bar.js +6 -6
- package/dist/components/floating-toolbar/floating-toolbar.js +2 -2
- package/dist/components/gantt-chart/gantt-chart.js +8 -7
- package/dist/components/globe-3d/globe-3d.js +16 -4
- package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +2 -1
- package/dist/components/interactive-timeline/interactive-timeline.js +8 -5
- package/dist/components/jarvis-dock/jarvis-dock.js +2 -2
- package/dist/components/key-concept/key-concept.js +2 -1
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +2 -1
- package/dist/components/knowledge-check/knowledge-check.js +2 -2
- package/dist/components/lang-provider/lang-provider.js +3 -3
- package/dist/components/learning-objectives/learning-objectives.js +2 -1
- package/dist/components/live-feed/live-feed.js +1 -1
- package/dist/components/map-2d/map-2d.js +1 -1
- package/dist/components/map-timeline/map-timeline.js +5 -5
- package/dist/components/market-treemap/market-treemap.js +2 -2
- package/dist/components/mdx-content/mdx-content.js +17 -8
- package/dist/components/navbar-saas/navbar-saas.js +4 -4
- package/dist/components/number-ticker/number-ticker.js +1 -1
- package/dist/components/order-book/order-book.js +2 -2
- package/dist/components/policy-delivery-panel/policy-delivery-panel.js +2 -2
- package/dist/components/profile-section/profile-section.js +2 -1
- package/dist/components/progress-tracker/progress-tracker.js +16 -8
- package/dist/components/prompt-templates/prompt-templates.js +2 -2
- package/dist/components/quiz/quiz.js +3 -2
- package/dist/components/relationship-inspector/relationship-inspector.js +2 -2
- package/dist/components/routing-assignment-panel/routing-assignment-panel.js +2 -2
- package/dist/components/run-timeline/run-timeline.js +2 -2
- package/dist/components/search-dialog/search-dialog.js +483 -50
- package/dist/components/share-dialog/share-dialog.js +2 -2
- package/dist/components/share-section/share-section.js +2 -1
- package/dist/components/sidebar/sidebar.js +29 -24
- package/dist/components/slideshow/slideshow.js +2 -1
- package/dist/components/social-fab/social-fab.js +10 -10
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/spinner/unicode-spinner.js +4 -2
- package/dist/components/stat-card/stat-card.js +1 -1
- package/dist/components/status-board/status-board.js +12 -5
- package/dist/components/step-by-step/step-by-step.js +2 -1
- package/dist/components/table-of-contents/table-of-contents.js +5 -2
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +3 -1
- package/dist/components/tabs/tabs.js +26 -8
- package/dist/components/tags-input/tags-input.js +11 -3
- package/dist/components/terminal/terminal.js +10 -2
- package/dist/components/theme-toggle/theme-toggle.js +2 -2
- package/dist/components/thinking-block/thinking-block.js +2 -2
- package/dist/components/timeline-scrubber/timeline-scrubber.js +2 -2
- package/dist/components/tldr-section/tldr-section.js +9 -7
- package/dist/components/transaction-list/transaction-list.js +2 -2
- package/dist/components/tutorial-complete/tutorial-complete.js +7 -5
- package/dist/components/tutorial-filters/tutorial-filters.js +1 -1
- package/dist/components/tutorial-intro-content/tutorial-intro-content.js +5 -5
- package/dist/components/tutorial-mdx/tutorial-mdx.js +5 -5
- package/dist/components/viewport-bookmarks/viewport-bookmarks.js +2 -2
- package/dist/components/watchlist/watchlist.js +2 -1
- package/dist/components/world-breadcrumbs/world-breadcrumbs.js +2 -2
- package/dist/components/world-clock-bar/world-clock-bar.js +4 -3
- package/dist/index.d.ts +113 -29
- package/package.json +3 -3
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
CardHeader,
|
|
11
11
|
CardTitle
|
|
12
12
|
} from "../card";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
CHECKLIST_PROGRESS_EVENT,
|
|
15
|
+
parseChecklistStorageValue
|
|
16
|
+
} from "../checklist";
|
|
14
17
|
import { ProgressBar } from "../progress-bar";
|
|
15
18
|
const ProgressTrackerContext = React.createContext(null);
|
|
16
19
|
function clampPercentage(value) {
|
|
@@ -41,15 +44,13 @@ function readPersistedChecklistItems(persistKey) {
|
|
|
41
44
|
try {
|
|
42
45
|
const saved = localStorage.getItem(`checklist:${persistKey}`);
|
|
43
46
|
if (!saved) return [];
|
|
44
|
-
|
|
45
|
-
return Array.isArray(parsed) ? parsed.filter((item) => typeof item === "string") : [];
|
|
47
|
+
return parseChecklistStorageValue(saved);
|
|
46
48
|
} catch {
|
|
47
49
|
return [];
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
function areStringArraysEqual(left, right) {
|
|
51
|
-
|
|
52
|
-
return left.every((value, index) => value === right[index]);
|
|
53
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
53
54
|
}
|
|
54
55
|
function getChecklistPersistKey(event) {
|
|
55
56
|
if (!(event instanceof CustomEvent)) return null;
|
|
@@ -79,14 +80,16 @@ function useChecklistProgress(checklistItems = [], persistKey) {
|
|
|
79
80
|
const [persistedIds, setPersistedIds] = React.useState(
|
|
80
81
|
() => readPersistedChecklistItems(persistKey)
|
|
81
82
|
);
|
|
83
|
+
const [trackedPersistKey, setTrackedPersistKey] = React.useState(persistKey);
|
|
82
84
|
const setPersistedIdsIfChanged = React.useCallback((nextIds) => {
|
|
83
85
|
setPersistedIds(
|
|
84
86
|
(currentIds) => areStringArraysEqual(currentIds, nextIds) ? currentIds : nextIds
|
|
85
87
|
);
|
|
86
88
|
}, []);
|
|
87
|
-
|
|
89
|
+
if (trackedPersistKey !== persistKey) {
|
|
90
|
+
setTrackedPersistKey(persistKey);
|
|
88
91
|
setPersistedIdsIfChanged(readPersistedChecklistItems(persistKey));
|
|
89
|
-
}
|
|
92
|
+
}
|
|
90
93
|
React.useEffect(() => {
|
|
91
94
|
if (!persistKey || typeof window === "undefined") return;
|
|
92
95
|
const sync = (event) => {
|
|
@@ -162,7 +165,12 @@ function ProgressTrackerOverview({
|
|
|
162
165
|
}) {
|
|
163
166
|
const { modules, overallProgress, streak, title } = useProgressTrackerContext();
|
|
164
167
|
const trackedPersistKeys = React.useMemo(
|
|
165
|
-
() => modules.
|
|
168
|
+
() => modules.reduce((keys, module) => {
|
|
169
|
+
if (module.persistKey) {
|
|
170
|
+
keys.push(module.persistKey);
|
|
171
|
+
}
|
|
172
|
+
return keys;
|
|
173
|
+
}, []),
|
|
166
174
|
[modules]
|
|
167
175
|
);
|
|
168
176
|
const [, forceChecklistRefresh] = React.useState(0);
|
|
@@ -243,7 +243,7 @@ function VariableField({
|
|
|
243
243
|
onValueChange,
|
|
244
244
|
value
|
|
245
245
|
}) {
|
|
246
|
-
const
|
|
246
|
+
const handleVariableValueChange = useCallback(
|
|
247
247
|
(event) => {
|
|
248
248
|
onValueChange(name, event.target.value);
|
|
249
249
|
},
|
|
@@ -255,7 +255,7 @@ function VariableField({
|
|
|
255
255
|
Input,
|
|
256
256
|
{
|
|
257
257
|
id: fieldId,
|
|
258
|
-
onChange:
|
|
258
|
+
onChange: handleVariableValueChange,
|
|
259
259
|
placeholder: `Value for ${name}`,
|
|
260
260
|
value
|
|
261
261
|
}
|
|
@@ -118,6 +118,7 @@ function QuizResult({
|
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
function Quiz({
|
|
121
|
+
as: Heading = "h4",
|
|
121
122
|
className,
|
|
122
123
|
explanation,
|
|
123
124
|
hint,
|
|
@@ -159,7 +160,7 @@ function Quiz({
|
|
|
159
160
|
)
|
|
160
161
|
}
|
|
161
162
|
),
|
|
162
|
-
/* @__PURE__ */ jsx(
|
|
163
|
+
/* @__PURE__ */ jsx(Heading, { className: "font-semibold text-foreground", children: question })
|
|
163
164
|
] }),
|
|
164
165
|
/* @__PURE__ */ jsx("div", { className: "space-y-2 mb-4", children: options.map((opt, index) => /* @__PURE__ */ jsx(
|
|
165
166
|
QuizOptionButton,
|
|
@@ -172,7 +173,7 @@ function Quiz({
|
|
|
172
173
|
selectedIndex,
|
|
173
174
|
submitted
|
|
174
175
|
},
|
|
175
|
-
|
|
176
|
+
`quiz-option-${index}-${opt.label}`
|
|
176
177
|
)) }),
|
|
177
178
|
hint && !submitted ? /* @__PURE__ */ jsx(
|
|
178
179
|
QuizHint,
|
|
@@ -28,7 +28,7 @@ const RowBody = (props) => {
|
|
|
28
28
|
const Row = (props) => {
|
|
29
29
|
const { edge } = props;
|
|
30
30
|
if (edge.onActivate) {
|
|
31
|
-
const
|
|
31
|
+
const handleActivateRelationship = () => {
|
|
32
32
|
edge.onActivate?.();
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ jsx(
|
|
@@ -37,7 +37,7 @@ const Row = (props) => {
|
|
|
37
37
|
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
38
38
|
"data-relationship-direction": edge.direction,
|
|
39
39
|
"data-relationship-row": true,
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: handleActivateRelationship,
|
|
41
41
|
type: "button",
|
|
42
42
|
children: /* @__PURE__ */ jsx(RowBody, { edge })
|
|
43
43
|
}
|
|
@@ -63,7 +63,7 @@ const RowBody = (props) => {
|
|
|
63
63
|
const Row = (props) => {
|
|
64
64
|
const { assignment } = props;
|
|
65
65
|
if (assignment.onActivate) {
|
|
66
|
-
const
|
|
66
|
+
const handleActivateAssignment = () => {
|
|
67
67
|
assignment.onActivate?.();
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsx(
|
|
@@ -72,7 +72,7 @@ const Row = (props) => {
|
|
|
72
72
|
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
73
73
|
"data-routing-assignment": assignment.id,
|
|
74
74
|
"data-routing-role": assignment.role,
|
|
75
|
-
onClick:
|
|
75
|
+
onClick: handleActivateAssignment,
|
|
76
76
|
type: "button",
|
|
77
77
|
children: /* @__PURE__ */ jsx(RowBody, { assignment })
|
|
78
78
|
}
|
|
@@ -63,7 +63,7 @@ const PhaseBar = (props) => {
|
|
|
63
63
|
};
|
|
64
64
|
const ariaLabel = `${STATE_LABEL[state]} ${phase.start} \u2192 ${phase.end}`;
|
|
65
65
|
if (phase.onActivate) {
|
|
66
|
-
const
|
|
66
|
+
const handleActivatePhase = () => {
|
|
67
67
|
phase.onActivate?.();
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsx(
|
|
@@ -76,7 +76,7 @@ const PhaseBar = (props) => {
|
|
|
76
76
|
),
|
|
77
77
|
"data-run-phase": phase.id,
|
|
78
78
|
"data-run-phase-state": state,
|
|
79
|
-
onClick:
|
|
79
|
+
onClick: handleActivatePhase,
|
|
80
80
|
style: sharedStyle,
|
|
81
81
|
type: "button",
|
|
82
82
|
children: phase.label
|