@vibes.diy/base 14.3.341 → 14.3.343
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.
|
@@ -25,10 +25,14 @@ export declare const KEEP_APP_LINE: Readonly<{
|
|
|
25
25
|
action: "Create account";
|
|
26
26
|
}>;
|
|
27
27
|
export declare const GUEST_BUILD_NOTE: Readonly<{
|
|
28
|
-
lead: "You’re a guest
|
|
29
|
-
body: "
|
|
28
|
+
lead: "You’re building as a guest,";
|
|
29
|
+
body: "and your first change is free too. A free account keeps it going with 1,000 credits every month.";
|
|
30
30
|
}>;
|
|
31
31
|
export declare const GUEST_SIGN_IN_BONUS = "Sign in to keep your apps and get 1,000 bonus credits, plus 1,000 every month.";
|
|
32
|
+
export declare const GUEST_TURN_WALL: Readonly<{
|
|
33
|
+
line: "Keep building with a free account. Your app and this prompt come with you, plus 1,000 bonus credits and 1,000 every month.";
|
|
34
|
+
action: "Create free account";
|
|
35
|
+
}>;
|
|
32
36
|
export declare const GUEST_OUT_OF_CREDITS_LINE = "You\u2019ve used your guest credits. Builds we lost along the way were on us. Sign in to keep your apps and get 1,000 bonus credits, plus 1,000 every month.";
|
|
33
37
|
export declare const GUEST_SHARE_ASK: Readonly<{
|
|
34
38
|
line: "Share it with your name on it, and keep it on every device — plus 1,000 bonus credits.";
|
|
@@ -24,10 +24,14 @@ export const KEEP_APP_LINE = Object.freeze({
|
|
|
24
24
|
action: "Create account",
|
|
25
25
|
});
|
|
26
26
|
export const GUEST_BUILD_NOTE = Object.freeze({
|
|
27
|
-
lead: "You’re a guest
|
|
28
|
-
body: "
|
|
27
|
+
lead: "You’re building as a guest,",
|
|
28
|
+
body: "and your first change is free too. A free account keeps it going with 1,000 credits every month.",
|
|
29
29
|
});
|
|
30
30
|
export const GUEST_SIGN_IN_BONUS = "Sign in to keep your apps and get 1,000 bonus credits, plus 1,000 every month.";
|
|
31
|
+
export const GUEST_TURN_WALL = Object.freeze({
|
|
32
|
+
line: `Keep building with a free account. Your app and this prompt come with you, plus 1,000 bonus credits and 1,000 every month.`,
|
|
33
|
+
action: "Create free account",
|
|
34
|
+
});
|
|
31
35
|
export const GUEST_OUT_OF_CREDITS_LINE = `You’ve used your guest credits. Builds we lost along the way were on us. ${GUEST_SIGN_IN_BONUS}`;
|
|
32
36
|
export const GUEST_SHARE_ASK = Object.freeze({
|
|
33
37
|
line: "Share it with your name on it, and keep it on every device — plus 1,000 bonus credits.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo, useRef, useCallback } from "react";
|
|
2
2
|
import { useFireproof, imgGen as defaultImgGen, confirmedMediaProbe as defaultConfirmedMediaProbe, useVibeContext, getRegisteredVibeApi, vibe, decorateFiles, IMG_GEN_SOURCE_UNUSABLE, } from "@vibes.diy/vibe-runtime";
|
|
3
|
-
import { IMG_GEN_CANCELLED, IMG_GEN_NEEDS_TAP, IMG_GEN_UNREACHABLE, IMG_GEN_UNREACHABLE_MESSAGE, isImgGenPaused, buildMediaPointerDoc, buildMediaVersionDoc, mediaDbName, mediaPointerDocId, mediaVersionDocId, } from "@vibes.diy/vibe-types";
|
|
3
|
+
import { IMG_GEN_CANCELLED, IMG_GEN_NEEDS_TAP, IMG_GEN_UNREACHABLE, IMG_GEN_UNREACHABLE_MESSAGE, isImgGenPaused, isImgGenMadeElsewhere, buildMediaPointerDoc, buildMediaVersionDoc, mediaDbName, mediaPointerDocId, mediaVersionDocId, } from "@vibes.diy/vibe-types";
|
|
4
4
|
import { exception2Result, Result } from "@adviser/cement";
|
|
5
5
|
import { type } from "arktype";
|
|
6
6
|
import { registeredLocalFileUrl, registeredPictureStore } from "./local-pictures.js";
|
|
@@ -255,6 +255,7 @@ export function useImgGen(opts) {
|
|
|
255
255
|
const failedGenRef = useRef(null);
|
|
256
256
|
const probeInFlightRef = useRef(null);
|
|
257
257
|
const leaseWaitRef = useRef(null);
|
|
258
|
+
const madeElsewhereKeyRef = useRef(null);
|
|
258
259
|
const ownedLeaseRef = useRef(null);
|
|
259
260
|
const commitProbeInFlightRef = useRef(null);
|
|
260
261
|
const displayReadBackRef = useRef(null);
|
|
@@ -669,6 +670,23 @@ export function useImgGen(opts) {
|
|
|
669
670
|
dropEarlyPreview();
|
|
670
671
|
const message = rFiles.Err().message;
|
|
671
672
|
const pausedErr = rFiles.Err();
|
|
673
|
+
if (isImgGenMadeElsewhere(pausedErr) && madeElsewhereKeyRef.current !== failKey) {
|
|
674
|
+
madeElsewhereKeyRef.current = failKey;
|
|
675
|
+
setLoading(false);
|
|
676
|
+
setPending(true);
|
|
677
|
+
const rRead = await exception2Result(loadMediaDocs);
|
|
678
|
+
if (unmountSignalRef.current.aborted || currentGenRef.current !== genKey)
|
|
679
|
+
return;
|
|
680
|
+
if (rRead.isErr()) {
|
|
681
|
+
setError(rRead.Err());
|
|
682
|
+
setPending(false);
|
|
683
|
+
failedGenRef.current = failKey;
|
|
684
|
+
currentGenRef.current = null;
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
releaseLease();
|
|
688
|
+
return decide(rRead.Ok(), legacyDoc, false);
|
|
689
|
+
}
|
|
672
690
|
if (isImgGenPaused(pausedErr)) {
|
|
673
691
|
setPaused({ retryAfterMs: pausedErr.retryAfterMs });
|
|
674
692
|
setLoading(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/base",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.343",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@adviser/cement": "~0.5.37",
|
|
12
12
|
"@emotion/css": "~11.13.5",
|
|
13
|
-
"@vibes.diy/api-types": "14.3.
|
|
14
|
-
"@vibes.diy/use-vibes-types": "14.3.
|
|
15
|
-
"@vibes.diy/vibe-runtime": "14.3.
|
|
16
|
-
"@vibes.diy/vibe-types": "14.3.
|
|
13
|
+
"@vibes.diy/api-types": "14.3.343",
|
|
14
|
+
"@vibes.diy/use-vibes-types": "14.3.343",
|
|
15
|
+
"@vibes.diy/vibe-runtime": "14.3.343",
|
|
16
|
+
"@vibes.diy/vibe-types": "14.3.343",
|
|
17
17
|
"arktype": "~2.2.9",
|
|
18
18
|
"officeparser": "~8.7.1",
|
|
19
19
|
"qrcode-generator": "~2.0.4",
|