@lssm/example.learning-journey-ui-gamified 0.0.0-canary-20251217083314 → 1.41.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/.turbo/turbo-build.log +22 -24
- package/dist/DayCalendar-Cha869Bi.mjs +178 -0
- package/dist/components/index.d.mts +2 -0
- package/dist/components/index.mjs +4 -0
- package/dist/components-kh0CpIG2.mjs +1 -0
- package/dist/index-BJlKzI7h.d.mts +44 -0
- package/dist/index-DiAD2ivN.d.mts +33 -0
- package/dist/{example.d.ts → index.d.mts} +18 -1
- package/dist/index.mjs +1698 -0
- package/dist/views/index.d.mts +2 -0
- package/dist/views/index.mjs +4 -0
- package/dist/views-B-DapxWu.mjs +467 -0
- package/package.json +14 -27
- package/tsconfig.tsbuildinfo +1 -1
- package/tsdown.config.js +10 -14
- package/.turbo/turbo-build$colon$bundle.log +0 -403
- package/CHANGELOG.md +0 -19
- package/dist/GamifiedMiniApp.d.ts +0 -16
- package/dist/GamifiedMiniApp.js +0 -64
- package/dist/components/DayCalendar.d.ts +0 -15
- package/dist/components/DayCalendar.js +0 -32
- package/dist/components/FlashCard.d.ts +0 -18
- package/dist/components/FlashCard.js +0 -79
- package/dist/components/MasteryRing.d.ts +0 -17
- package/dist/components/MasteryRing.js +0 -81
- package/dist/components/index.d.ts +0 -4
- package/dist/components/index.js +0 -5
- package/dist/docs/index.d.ts +0 -1
- package/dist/docs/index.js +0 -1
- package/dist/docs/learning-journey-ui-gamified.docblock.d.ts +0 -1
- package/dist/docs/learning-journey-ui-gamified.docblock.js +0 -20
- package/dist/example.js +0 -34
- package/dist/examples/learning-journey-ui-shared/dist/components/BadgeDisplay.js +0 -44
- package/dist/examples/learning-journey-ui-shared/dist/components/StreakCounter.js +0 -45
- package/dist/examples/learning-journey-ui-shared/dist/components/ViewTabs.js +0 -48
- package/dist/examples/learning-journey-ui-shared/dist/components/XpBar.js +0 -46
- package/dist/examples/learning-journey-ui-shared/dist/components/index.js +0 -4
- package/dist/examples/learning-journey-ui-shared/dist/docs/index.js +0 -1
- package/dist/examples/learning-journey-ui-shared/dist/docs/learning-journey-ui-shared.docblock.js +0 -20
- package/dist/examples/learning-journey-ui-shared/dist/hooks/index.js +0 -1
- package/dist/examples/learning-journey-ui-shared/dist/hooks/useLearningProgress.js +0 -73
- package/dist/examples/learning-journey-ui-shared/dist/index.js +0 -8
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/index.js +0 -28
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -79
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -56
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -356
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -36
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -15
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -19
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -47
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -78
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -83
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -44
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -66
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -39
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -68
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -46
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -61
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -154
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -19
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -100
- package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -19
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +0 -5
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/components/atoms/Button.js +0 -33
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +0 -55
- package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -13
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/progress.js +0 -23
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/utils.js +0 -10
- package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -10
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -14
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +0 -5
- package/dist/libs/design-system/dist/components/atoms/Button.js +0 -33
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +0 -55
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -13
- package/dist/libs/ui-kit-web/dist/ui/card.js +0 -36
- package/dist/libs/ui-kit-web/dist/ui/utils.js +0 -10
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -10
- package/dist/views/Overview.d.ts +0 -14
- package/dist/views/Overview.js +0 -163
- package/dist/views/Progress.d.ts +0 -10
- package/dist/views/Progress.js +0 -144
- package/dist/views/Steps.d.ts +0 -11
- package/dist/views/Steps.js +0 -55
- package/dist/views/Timeline.d.ts +0 -10
- package/dist/views/Timeline.js +0 -132
- package/dist/views/index.d.ts +0 -5
- package/dist/views/index.js +0 -6
package/dist/views/Progress.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../libs/ui-kit-web/dist/ui/card.js";
|
|
4
|
-
import { XpBar } from "../examples/learning-journey-ui-shared/dist/components/XpBar.js";
|
|
5
|
-
import { BadgeDisplay } from "../examples/learning-journey-ui-shared/dist/components/BadgeDisplay.js";
|
|
6
|
-
import "../examples/learning-journey-ui-shared/dist/index.js";
|
|
7
|
-
import { MasteryRing } from "../components/MasteryRing.js";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
//#region src/views/Progress.tsx
|
|
11
|
-
function Progress({ track, progress }) {
|
|
12
|
-
const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
|
|
13
|
-
const completedSteps = progress.completedStepIds.length;
|
|
14
|
-
const totalSteps = track.steps.length;
|
|
15
|
-
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
16
|
-
const surfaces = /* @__PURE__ */ new Map();
|
|
17
|
-
track.steps.forEach((step) => {
|
|
18
|
-
const surface = step.metadata?.surface ?? "general";
|
|
19
|
-
const current = surfaces.get(surface) ?? {
|
|
20
|
-
total: 0,
|
|
21
|
-
completed: 0
|
|
22
|
-
};
|
|
23
|
-
surfaces.set(surface, {
|
|
24
|
-
total: current.total + 1,
|
|
25
|
-
completed: current.completed + (progress.completedStepIds.includes(step.id) ? 1 : 0)
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
const surfaceColors = [
|
|
29
|
-
"green",
|
|
30
|
-
"blue",
|
|
31
|
-
"violet",
|
|
32
|
-
"orange"
|
|
33
|
-
];
|
|
34
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
35
|
-
className: "space-y-6",
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
|
|
38
|
-
className: "flex items-center gap-2",
|
|
39
|
-
children: [/* @__PURE__ */ jsx("span", { children: "⚡" }), /* @__PURE__ */ jsx("span", { children: "Experience Points" })]
|
|
40
|
-
}) }), /* @__PURE__ */ jsxs(CardContent, {
|
|
41
|
-
className: "space-y-4",
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ jsxs("div", {
|
|
44
|
-
className: "flex items-baseline gap-2",
|
|
45
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
46
|
-
className: "text-4xl font-bold text-violet-500",
|
|
47
|
-
children: progress.xpEarned.toLocaleString()
|
|
48
|
-
}), /* @__PURE__ */ jsxs("span", {
|
|
49
|
-
className: "text-muted-foreground",
|
|
50
|
-
children: [
|
|
51
|
-
"/ ",
|
|
52
|
-
totalXp.toLocaleString(),
|
|
53
|
-
" XP"
|
|
54
|
-
]
|
|
55
|
-
})]
|
|
56
|
-
}),
|
|
57
|
-
/* @__PURE__ */ jsx(XpBar, {
|
|
58
|
-
current: progress.xpEarned,
|
|
59
|
-
max: totalXp,
|
|
60
|
-
showLabel: false,
|
|
61
|
-
size: "lg"
|
|
62
|
-
}),
|
|
63
|
-
track.completionRewards?.xpBonus && percentComplete < 100 && /* @__PURE__ */ jsxs("p", {
|
|
64
|
-
className: "text-muted-foreground text-sm",
|
|
65
|
-
children: [
|
|
66
|
-
"🎁 Complete all steps for a",
|
|
67
|
-
" ",
|
|
68
|
-
/* @__PURE__ */ jsxs("span", {
|
|
69
|
-
className: "font-semibold text-green-500",
|
|
70
|
-
children: [
|
|
71
|
-
"+",
|
|
72
|
-
track.completionRewards.xpBonus,
|
|
73
|
-
" XP"
|
|
74
|
-
]
|
|
75
|
-
}),
|
|
76
|
-
" ",
|
|
77
|
-
"bonus!"
|
|
78
|
-
]
|
|
79
|
-
})
|
|
80
|
-
]
|
|
81
|
-
})] }),
|
|
82
|
-
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
|
|
83
|
-
className: "flex items-center gap-2",
|
|
84
|
-
children: [/* @__PURE__ */ jsx("span", { children: "🎯" }), /* @__PURE__ */ jsx("span", { children: "Skill Mastery" })]
|
|
85
|
-
}) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", {
|
|
86
|
-
className: "flex flex-wrap justify-center gap-6",
|
|
87
|
-
children: [Array.from(surfaces.entries()).map(([surface, data], index) => /* @__PURE__ */ jsx(MasteryRing, {
|
|
88
|
-
label: surface.charAt(0).toUpperCase() + surface.slice(1),
|
|
89
|
-
percentage: data.completed / data.total * 100,
|
|
90
|
-
color: surfaceColors[index % surfaceColors.length],
|
|
91
|
-
size: "lg"
|
|
92
|
-
}, surface)), /* @__PURE__ */ jsx(MasteryRing, {
|
|
93
|
-
label: "Overall",
|
|
94
|
-
percentage: percentComplete,
|
|
95
|
-
color: "violet",
|
|
96
|
-
size: "lg"
|
|
97
|
-
})]
|
|
98
|
-
}) })] }),
|
|
99
|
-
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
|
|
100
|
-
className: "flex items-center gap-2",
|
|
101
|
-
children: [/* @__PURE__ */ jsx("span", { children: "🏅" }), /* @__PURE__ */ jsx("span", { children: "Badges Earned" })]
|
|
102
|
-
}) }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx(BadgeDisplay, {
|
|
103
|
-
badges: progress.badges,
|
|
104
|
-
size: "lg",
|
|
105
|
-
maxVisible: 10
|
|
106
|
-
}), progress.badges.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
107
|
-
className: "text-muted-foreground text-sm",
|
|
108
|
-
children: "Complete the track to earn your first badge!"
|
|
109
|
-
})] })] }),
|
|
110
|
-
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
|
|
111
|
-
className: "flex items-center gap-2",
|
|
112
|
-
children: [/* @__PURE__ */ jsx("span", { children: "📊" }), /* @__PURE__ */ jsx("span", { children: "Step Breakdown" })]
|
|
113
|
-
}) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
|
|
114
|
-
className: "space-y-2",
|
|
115
|
-
children: track.steps.map((step) => {
|
|
116
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
117
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
118
|
-
className: "flex items-center justify-between rounded-lg border p-3",
|
|
119
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
120
|
-
className: "flex items-center gap-3",
|
|
121
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
122
|
-
className: isCompleted ? "text-green-500" : "text-muted-foreground",
|
|
123
|
-
children: isCompleted ? "✓" : "○"
|
|
124
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
125
|
-
className: isCompleted ? "text-foreground" : "text-muted-foreground",
|
|
126
|
-
children: step.title
|
|
127
|
-
})]
|
|
128
|
-
}), step.xpReward && /* @__PURE__ */ jsxs("span", {
|
|
129
|
-
className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
|
|
130
|
-
children: [
|
|
131
|
-
isCompleted ? "+" : "",
|
|
132
|
-
step.xpReward,
|
|
133
|
-
" XP"
|
|
134
|
-
]
|
|
135
|
-
})]
|
|
136
|
-
}, step.id);
|
|
137
|
-
})
|
|
138
|
-
}) })] })
|
|
139
|
-
]
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
//#endregion
|
|
144
|
-
export { Progress };
|
package/dist/views/Steps.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
|
-
import { LearningViewProps } from "@lssm/example.learning-journey-ui-shared";
|
|
3
|
-
|
|
4
|
-
//#region src/views/Steps.d.ts
|
|
5
|
-
declare function Steps({
|
|
6
|
-
track,
|
|
7
|
-
progress,
|
|
8
|
-
onStepComplete
|
|
9
|
-
}: LearningViewProps): react_jsx_runtime2.JSX.Element;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { Steps };
|
package/dist/views/Steps.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { FlashCard } from "../components/FlashCard.js";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region src/views/Steps.tsx
|
|
7
|
-
function Steps({ track, progress, onStepComplete }) {
|
|
8
|
-
const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
-
className: "space-y-6",
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ jsxs("div", {
|
|
13
|
-
className: "text-center",
|
|
14
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
15
|
-
className: "text-xl font-bold",
|
|
16
|
-
children: "Complete Your Challenges"
|
|
17
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
18
|
-
className: "text-muted-foreground",
|
|
19
|
-
children: "Tap each card to reveal the action, then mark as complete"
|
|
20
|
-
})]
|
|
21
|
-
}),
|
|
22
|
-
/* @__PURE__ */ jsx("div", {
|
|
23
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
24
|
-
children: track.steps.map((step, index) => {
|
|
25
|
-
return /* @__PURE__ */ jsx(FlashCard, {
|
|
26
|
-
step,
|
|
27
|
-
isCompleted: progress.completedStepIds.includes(step.id),
|
|
28
|
-
isCurrent: index === currentStepIndex,
|
|
29
|
-
onComplete: () => onStepComplete?.(step.id)
|
|
30
|
-
}, step.id);
|
|
31
|
-
})
|
|
32
|
-
}),
|
|
33
|
-
/* @__PURE__ */ jsxs("div", {
|
|
34
|
-
className: "text-muted-foreground text-center text-sm",
|
|
35
|
-
children: [
|
|
36
|
-
progress.completedStepIds.length,
|
|
37
|
-
" of ",
|
|
38
|
-
track.steps.length,
|
|
39
|
-
" completed",
|
|
40
|
-
track.completionRewards?.xpBonus && /* @__PURE__ */ jsxs("span", {
|
|
41
|
-
className: "ml-2 text-green-500",
|
|
42
|
-
children: [
|
|
43
|
-
"(+",
|
|
44
|
-
track.completionRewards.xpBonus,
|
|
45
|
-
" XP bonus on completion)"
|
|
46
|
-
]
|
|
47
|
-
})
|
|
48
|
-
]
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
export { Steps };
|
package/dist/views/Timeline.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
2
|
-
import { LearningViewProps } from "@lssm/example.learning-journey-ui-shared";
|
|
3
|
-
|
|
4
|
-
//#region src/views/Timeline.d.ts
|
|
5
|
-
declare function Timeline({
|
|
6
|
-
track,
|
|
7
|
-
progress
|
|
8
|
-
}: LearningViewProps): react_jsx_runtime6.JSX.Element;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { Timeline };
|
package/dist/views/Timeline.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../libs/ui-kit-web/dist/ui/card.js";
|
|
4
|
-
import { DayCalendar } from "../components/DayCalendar.js";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/views/Timeline.tsx
|
|
8
|
-
function Timeline({ track, progress }) {
|
|
9
|
-
if (track.steps.some((s) => s.availability?.unlockOnDay !== void 0)) {
|
|
10
|
-
const totalDays = Math.max(...track.steps.map((s) => s.availability?.unlockOnDay ?? 1), 7);
|
|
11
|
-
const completedDays = track.steps.filter((s) => progress.completedStepIds.includes(s.id)).map((s) => s.availability?.unlockOnDay ?? 1);
|
|
12
|
-
const currentDay = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.availability?.unlockOnDay ?? 1;
|
|
13
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
-
className: "space-y-6",
|
|
15
|
-
children: [
|
|
16
|
-
/* @__PURE__ */ jsxs("div", {
|
|
17
|
-
className: "text-center",
|
|
18
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
19
|
-
className: "text-xl font-bold",
|
|
20
|
-
children: track.name
|
|
21
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
22
|
-
className: "text-muted-foreground",
|
|
23
|
-
children: "Complete each day's challenge to progress"
|
|
24
|
-
})]
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
|
|
27
|
-
className: "flex items-center gap-2",
|
|
28
|
-
children: [/* @__PURE__ */ jsx("span", { children: "📅" }), /* @__PURE__ */ jsx("span", { children: "Your Journey" })]
|
|
29
|
-
}) }), /* @__PURE__ */ jsx(CardContent, {
|
|
30
|
-
className: "flex justify-center",
|
|
31
|
-
children: /* @__PURE__ */ jsx(DayCalendar, {
|
|
32
|
-
totalDays,
|
|
33
|
-
currentDay,
|
|
34
|
-
completedDays
|
|
35
|
-
})
|
|
36
|
-
})] }),
|
|
37
|
-
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
|
|
38
|
-
className: "flex items-center gap-2",
|
|
39
|
-
children: [/* @__PURE__ */ jsx("span", { children: "📝" }), /* @__PURE__ */ jsx("span", { children: "Daily Challenges" })]
|
|
40
|
-
}) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
|
|
41
|
-
className: "space-y-3",
|
|
42
|
-
children: track.steps.map((step) => {
|
|
43
|
-
const day = step.availability?.unlockOnDay ?? 1;
|
|
44
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
45
|
-
const isLocked = day > currentDay;
|
|
46
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
47
|
-
className: `flex items-start gap-4 rounded-lg border p-4 ${isLocked ? "opacity-50" : ""}`,
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsx("div", {
|
|
50
|
-
className: "bg-muted flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold",
|
|
51
|
-
children: isCompleted ? "✓" : isLocked ? "🔒" : day
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ jsxs("div", {
|
|
54
|
-
className: "flex-1",
|
|
55
|
-
children: [/* @__PURE__ */ jsx("h4", {
|
|
56
|
-
className: "font-semibold",
|
|
57
|
-
children: step.title
|
|
58
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
59
|
-
className: "text-muted-foreground text-sm",
|
|
60
|
-
children: step.description
|
|
61
|
-
})]
|
|
62
|
-
}),
|
|
63
|
-
step.xpReward && /* @__PURE__ */ jsxs("span", {
|
|
64
|
-
className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
|
|
65
|
-
children: [
|
|
66
|
-
"+",
|
|
67
|
-
step.xpReward,
|
|
68
|
-
" XP"
|
|
69
|
-
]
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
}, step.id);
|
|
73
|
-
})
|
|
74
|
-
}) })] })
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
79
|
-
className: "space-y-6",
|
|
80
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
81
|
-
className: "text-center",
|
|
82
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
83
|
-
className: "text-xl font-bold",
|
|
84
|
-
children: "Learning Path"
|
|
85
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
86
|
-
className: "text-muted-foreground",
|
|
87
|
-
children: "Follow the steps to master this skill"
|
|
88
|
-
})]
|
|
89
|
-
}), /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
|
|
90
|
-
className: "p-6",
|
|
91
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
92
|
-
className: "relative",
|
|
93
|
-
children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 left-5 h-full w-0.5" }), /* @__PURE__ */ jsx("div", {
|
|
94
|
-
className: "space-y-6",
|
|
95
|
-
children: track.steps.map((step, index) => {
|
|
96
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
97
|
-
const isCurrent = !isCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
|
|
98
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
99
|
-
className: "relative flex gap-4 pl-2",
|
|
100
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
101
|
-
className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-violet-500 bg-violet-500 text-white" : "border-border bg-background"}`,
|
|
102
|
-
children: isCompleted ? "✓" : index + 1
|
|
103
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
104
|
-
className: "flex-1 pb-4",
|
|
105
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
106
|
-
className: "flex items-start justify-between gap-2",
|
|
107
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
|
|
108
|
-
className: `font-semibold ${isCompleted ? "text-foreground" : isCurrent ? "text-violet-500" : "text-muted-foreground"}`,
|
|
109
|
-
children: step.title
|
|
110
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
111
|
-
className: "text-muted-foreground mt-1 text-sm",
|
|
112
|
-
children: step.description
|
|
113
|
-
})] }), step.xpReward && /* @__PURE__ */ jsxs("span", {
|
|
114
|
-
className: `shrink-0 rounded-full px-2 py-1 text-xs font-semibold ${isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"}`,
|
|
115
|
-
children: [
|
|
116
|
-
"+",
|
|
117
|
-
step.xpReward,
|
|
118
|
-
" XP"
|
|
119
|
-
]
|
|
120
|
-
})]
|
|
121
|
-
})
|
|
122
|
-
})]
|
|
123
|
-
}, step.id);
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
})
|
|
127
|
-
}) })]
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
//#endregion
|
|
132
|
-
export { Timeline };
|
package/dist/views/index.d.ts
DELETED