@domino-sdk/relay 1.0.0-next.3 → 1.0.0-next.4
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/authoring.d.ts +2 -2
- package/dist/authoring.js +2 -8
- package/dist/browser.d.ts +186 -186
- package/dist/index.d.ts +400 -400
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +12 -4
- package/dist/{submission-input-jVvTh4Ed.d.ts → submission-input-CZDukyb3.d.ts} +7 -1
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as zod from 'zod';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { ProfileUpdate, ProfileCompletionQuery, QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft, ProfileCompletion, ProfileSummary, PointLedgerReference } from '../index.js';
|
|
6
6
|
export { avatarSrc, defaultAvatar, walletAvatarSeed } from '../index.js';
|
|
7
|
-
import { M as referralAcceptSchema, N as LeaderboardQuery, P as WalletAddressInput, Q as walletSignatureSchema, L as LinkedWallet, R as WalletSigner, V as walletChallengeInputSchema, Y as walletProofSchema, Z as AuthProvider, _ as WalletSignature, $ as engagementPageQuerySchema, a0 as contentQualificationQuerySchema, a1 as contentAdmissionQuerySchema, a2 as contentEnrollmentInputSchema, a3 as contentReleaseInputSchema, a4 as AccountConnection, a5 as WalletSignInNetwork, a6 as referralSummarySchema, a7 as LeaderboardPage } from '../submission-input-
|
|
7
|
+
import { M as referralAcceptSchema, N as LeaderboardQuery, P as WalletAddressInput, Q as walletSignatureSchema, L as LinkedWallet, R as WalletSigner, V as walletChallengeInputSchema, Y as walletProofSchema, Z as AuthProvider, _ as WalletSignature, $ as engagementPageQuerySchema, a0 as contentQualificationQuerySchema, a1 as contentAdmissionQuerySchema, a2 as contentEnrollmentInputSchema, a3 as contentReleaseInputSchema, a4 as AccountConnection, a5 as WalletSignInNetwork, a6 as referralSummarySchema, a7 as LeaderboardPage } from '../submission-input-CZDukyb3.js';
|
|
8
8
|
import { SubmitInput, ReleaseInput, beginHandoverSchema, contentPerformanceQuerySchema, TieredRewardReference } from '../schema.js';
|
|
9
9
|
import { createBrowserRelayClient, SignInMethods, CosmosChains, SignInOption, SignInUnavailable, SignInWallet, DiscoveredWallet } from '../browser.js';
|
|
10
10
|
export { EmailSignInOption, OAuthSignInOption, SignInIcon, WalletSignInOption } from '../browser.js';
|
package/dist/react/index.js
CHANGED
|
@@ -165,13 +165,16 @@ function questStatus(view) {
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
const availability = view.availability;
|
|
168
|
-
|
|
168
|
+
const ownSubmission = view.trigger.kind === "manual" && view.trigger.actor !== "staff";
|
|
169
|
+
const submissionFirst = ownSubmission && (availability.kind === "checking" || availability.kind === "needs-review" || availability.kind === "retryable");
|
|
170
|
+
if (view.streak && availability.kind !== "locked" && !submissionFirst) {
|
|
169
171
|
const streak = view.streak;
|
|
172
|
+
const rejection = ownSubmission && view.attempt?.status === "rejected" ? sentence(view.attempt.reason ?? "That submission wasn't accepted.") : null;
|
|
170
173
|
if (streak.milestone.status === "budget-exhausted") {
|
|
171
174
|
return {
|
|
172
175
|
tone: "attention",
|
|
173
176
|
label: "Milestone reached",
|
|
174
|
-
detail: "Your qualifying days are saved. This milestone's reward budget was exhausted."
|
|
177
|
+
detail: rejection ?? "Your qualifying days are saved. This milestone's reward budget was exhausted."
|
|
175
178
|
};
|
|
176
179
|
}
|
|
177
180
|
const deadline = new Intl.DateTimeFormat("en", {
|
|
@@ -182,10 +185,11 @@ function questStatus(view) {
|
|
|
182
185
|
minute: "2-digit",
|
|
183
186
|
timeZoneName: "short"
|
|
184
187
|
}).format(streak.nextBoundary);
|
|
188
|
+
const progress = streak.todayQualified ? `Today counts. Your next community day starts ${deadline}. Best streak: ${streak.best} days.` : `Complete today's activity before ${deadline} ${streak.current ? "to keep your streak" : "to start your streak"}. Best streak: ${streak.best} days.`;
|
|
185
189
|
return {
|
|
186
|
-
tone: streak.todayQualified ? "waiting" : "open",
|
|
190
|
+
tone: rejection ? "attention" : streak.todayQualified ? "waiting" : "open",
|
|
187
191
|
label: `${streak.current} / ${streak.goal} days`,
|
|
188
|
-
detail:
|
|
192
|
+
detail: rejection ? `${rejection} ${progress}` : progress
|
|
189
193
|
};
|
|
190
194
|
}
|
|
191
195
|
if (runsSilently(view) && availability.kind !== "locked") {
|
|
@@ -264,6 +268,10 @@ function progressOf(quests) {
|
|
|
264
268
|
done: counted.filter(isFinished).length
|
|
265
269
|
};
|
|
266
270
|
}
|
|
271
|
+
function sentence(text) {
|
|
272
|
+
const trimmed = text.trim();
|
|
273
|
+
return /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
274
|
+
}
|
|
267
275
|
function list(items) {
|
|
268
276
|
return new Intl.ListFormat("en", { type: "conjunction" }).format(
|
|
269
277
|
items.map((item) => `\u201C${item}\u201D`)
|
|
@@ -2133,7 +2133,13 @@ declare const streakPolicySchema: z.ZodObject<{
|
|
|
2133
2133
|
timeZone: z.ZodString;
|
|
2134
2134
|
}, z.core.$strict>;
|
|
2135
2135
|
type StreakPolicy = z.infer<typeof streakPolicySchema>;
|
|
2136
|
-
/**
|
|
2136
|
+
/**
|
|
2137
|
+
* One milestone per quest, after `days` consecutive community days with an accepted attempt.
|
|
2138
|
+
* Multiple accepted attempts occupy one day. The day comes from the attempt's trusted occurrence
|
|
2139
|
+
* time: a tracker record's (or observation's) `occurredAt` for `automatic({ tracker })`, and the
|
|
2140
|
+
* submission's admission time for `manual()`, so a manual streak counts the days a member
|
|
2141
|
+
* submitted. Not available on content quests or prerequisite-only `automatic()`.
|
|
2142
|
+
*/
|
|
2137
2143
|
declare const streak: (options: Omit<StreakPolicy, "kind">) => StreakPolicy;
|
|
2138
2144
|
declare const streakProgressSchema: z.ZodObject<{
|
|
2139
2145
|
goal: z.ZodNumber;
|