@playbasis-ai/qwikcard-sdk 2.3.19 → 2.3.20
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 +2 -1
- package/dist/QwikCardApp.d.ts.map +1 -1
- package/dist/QwikCardApp.js +26 -24
- package/dist/web/widgetTypes.d.ts +11 -9
- package/dist/web/widgetTypes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/QwikCardApp.tsx +27 -26
- package/src/web/widgetTypes.ts +11 -9
package/CHANGELOG.md
CHANGED
|
@@ -92,12 +92,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
92
92
|
|
|
93
93
|
- Accept top-level leaderboard entries in API responses.
|
|
94
94
|
|
|
95
|
-
## [2.3.
|
|
95
|
+
## [2.3.20] - 2026-01-31
|
|
96
96
|
|
|
97
97
|
### Fixed
|
|
98
98
|
|
|
99
99
|
- Normalize leaderboard entries across `entries/items/leaderboard` response shapes.
|
|
100
100
|
- Restore badge detail modal header styling in the embedded widget.
|
|
101
|
+
- Map quest catalog into widget quests so onboarding is never empty.
|
|
101
102
|
|
|
102
103
|
## [2.3.11] - 2026-01-29
|
|
103
104
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QwikCardApp.d.ts","sourceRoot":"","sources":["../src/QwikCardApp.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"QwikCardApp.d.ts","sourceRoot":"","sources":["../src/QwikCardApp.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAsSD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAMlD"}
|
package/dist/QwikCardApp.js
CHANGED
|
@@ -73,32 +73,34 @@ function AppContent({ leaderboardId }) {
|
|
|
73
73
|
earnedDelta: 0,
|
|
74
74
|
qwikCoins,
|
|
75
75
|
},
|
|
76
|
-
|
|
76
|
+
quests: (() => {
|
|
77
77
|
const quests = playerQuests.length > 0 ? playerQuests : questCatalog;
|
|
78
78
|
const nowIso = new Date().toISOString().slice(0, 10);
|
|
79
|
-
return quests.map((q) =>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
target
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
return quests.map((q) => {
|
|
80
|
+
const target = q.target ?? 1;
|
|
81
|
+
const current = q.progress ?? 0;
|
|
82
|
+
const progressPct = target > 0 ? Math.round((current / target) * 100) : 0;
|
|
83
|
+
const status = q.status === 'completed' ? 'completed' : 'available';
|
|
84
|
+
return {
|
|
85
|
+
questId: q.id,
|
|
86
|
+
title: q.name,
|
|
87
|
+
description: q.description,
|
|
88
|
+
type: 'mission',
|
|
89
|
+
target,
|
|
90
|
+
current,
|
|
91
|
+
progressPct,
|
|
92
|
+
startDate: nowIso,
|
|
93
|
+
endDate: q.expiresAt,
|
|
94
|
+
status,
|
|
95
|
+
rewards: {
|
|
96
|
+
xp: q.rewards?.find((r) => r.type === 'points')?.amount || 100,
|
|
97
|
+
badges: (q.rewards
|
|
98
|
+
?.filter((r) => r.type === 'badge')
|
|
99
|
+
.map((r) => r.badgeId)
|
|
100
|
+
.filter(Boolean) || []),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
});
|
|
102
104
|
})(),
|
|
103
105
|
badges: allBadges.map((b) => ({
|
|
104
106
|
id: b.id,
|
|
@@ -56,17 +56,19 @@ export interface WidgetNotification {
|
|
|
56
56
|
timestamp?: number;
|
|
57
57
|
read?: boolean;
|
|
58
58
|
}
|
|
59
|
-
export type
|
|
60
|
-
export type
|
|
61
|
-
export interface
|
|
62
|
-
|
|
63
|
-
type:
|
|
59
|
+
export type WidgetQuestType = 'financial' | 'habit' | 'performance' | 'mission';
|
|
60
|
+
export type WidgetQuestStatus = 'active' | 'completed' | 'available' | 'joined';
|
|
61
|
+
export interface WidgetQuest {
|
|
62
|
+
questId: string;
|
|
63
|
+
type: WidgetQuestType;
|
|
64
|
+
title: string;
|
|
65
|
+
description?: string;
|
|
64
66
|
target: number;
|
|
65
67
|
current: number;
|
|
66
68
|
progressPct: number;
|
|
67
|
-
startDate
|
|
68
|
-
endDate
|
|
69
|
-
status:
|
|
69
|
+
startDate?: string;
|
|
70
|
+
endDate?: string;
|
|
71
|
+
status: WidgetQuestStatus;
|
|
70
72
|
rewards?: {
|
|
71
73
|
xp?: number;
|
|
72
74
|
badges?: string[];
|
|
@@ -115,7 +117,7 @@ export interface WidgetBootstrapData {
|
|
|
115
117
|
tenantId: string;
|
|
116
118
|
user: WidgetUserState;
|
|
117
119
|
wallet: WidgetWallet | null;
|
|
118
|
-
|
|
120
|
+
quests: WidgetQuest[];
|
|
119
121
|
activities: WidgetActivityDay[];
|
|
120
122
|
transactions?: WidgetTransaction[];
|
|
121
123
|
collections?: WidgetCollectionItem[];
|
|
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EpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACrC,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,kBAAkB,EAAE,6BAA6B,EAAE,CAAC;IACpD,WAAW,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACtC"}
|
package/package.json
CHANGED
package/src/QwikCardApp.tsx
CHANGED
|
@@ -94,34 +94,35 @@ function AppContent({ leaderboardId }: { leaderboardId?: string }) {
|
|
|
94
94
|
earnedDelta: 0,
|
|
95
95
|
qwikCoins,
|
|
96
96
|
},
|
|
97
|
-
|
|
97
|
+
quests: (() => {
|
|
98
98
|
const quests = playerQuests.length > 0 ? playerQuests : questCatalog;
|
|
99
99
|
const nowIso = new Date().toISOString().slice(0, 10);
|
|
100
|
-
return quests.map((q) =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
target
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
100
|
+
return quests.map((q) => {
|
|
101
|
+
const target = q.target ?? 1;
|
|
102
|
+
const current = q.progress ?? 0;
|
|
103
|
+
const progressPct = target > 0 ? Math.round((current / target) * 100) : 0;
|
|
104
|
+
const status = q.status === 'completed' ? 'completed' : 'available';
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
questId: q.id,
|
|
108
|
+
title: q.name,
|
|
109
|
+
description: q.description,
|
|
110
|
+
type: 'mission',
|
|
111
|
+
target,
|
|
112
|
+
current,
|
|
113
|
+
progressPct,
|
|
114
|
+
startDate: nowIso,
|
|
115
|
+
endDate: q.expiresAt,
|
|
116
|
+
status,
|
|
117
|
+
rewards: {
|
|
118
|
+
xp: q.rewards?.find((r) => r.type === 'points')?.amount || 100,
|
|
119
|
+
badges: (q.rewards
|
|
120
|
+
?.filter((r) => r.type === 'badge')
|
|
121
|
+
.map((r) => r.badgeId)
|
|
122
|
+
.filter(Boolean) || []) as string[],
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
});
|
|
125
126
|
})(),
|
|
126
127
|
badges: allBadges.map((b) => ({
|
|
127
128
|
id: b.id,
|
package/src/web/widgetTypes.ts
CHANGED
|
@@ -68,18 +68,20 @@ export interface WidgetNotification {
|
|
|
68
68
|
read?: boolean;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
export type
|
|
72
|
-
export type
|
|
71
|
+
export type WidgetQuestType = 'financial' | 'habit' | 'performance' | 'mission';
|
|
72
|
+
export type WidgetQuestStatus = 'active' | 'completed' | 'available' | 'joined';
|
|
73
73
|
|
|
74
|
-
export interface
|
|
75
|
-
|
|
76
|
-
type:
|
|
74
|
+
export interface WidgetQuest {
|
|
75
|
+
questId: string;
|
|
76
|
+
type: WidgetQuestType;
|
|
77
|
+
title: string;
|
|
78
|
+
description?: string;
|
|
77
79
|
target: number;
|
|
78
80
|
current: number;
|
|
79
81
|
progressPct: number;
|
|
80
|
-
startDate
|
|
81
|
-
endDate
|
|
82
|
-
status:
|
|
82
|
+
startDate?: string;
|
|
83
|
+
endDate?: string;
|
|
84
|
+
status: WidgetQuestStatus;
|
|
83
85
|
rewards?: { xp?: number; badges?: string[] };
|
|
84
86
|
}
|
|
85
87
|
|
|
@@ -134,7 +136,7 @@ export interface WidgetBootstrapData {
|
|
|
134
136
|
tenantId: string;
|
|
135
137
|
user: WidgetUserState;
|
|
136
138
|
wallet: WidgetWallet | null;
|
|
137
|
-
|
|
139
|
+
quests: WidgetQuest[];
|
|
138
140
|
activities: WidgetActivityDay[];
|
|
139
141
|
transactions?: WidgetTransaction[];
|
|
140
142
|
collections?: WidgetCollectionItem[];
|