@vibes.diy/base 14.3.460 → 14.3.461
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/components/vibe-menu/VibeMenu.js +1 -1
- package/components/vibe-menu/cards/HomeCard.d.ts +4 -2
- package/components/vibe-menu/cards/HomeCard.js +25 -4
- package/components/vibe-menu/copy.d.ts +1 -0
- package/components/vibe-menu/copy.js +1 -0
- package/components/vibe-menu/parts/CheckRowLine.js +7 -1
- package/components/vibe-menu/parts/StatusLine.d.ts +1 -1
- package/components/vibe-menu/slices.d.ts +10 -3
- package/package.json +5 -5
|
@@ -175,7 +175,7 @@ export function VibeMenu(props) {
|
|
|
175
175
|
const nav = navFor(state);
|
|
176
176
|
switch (section) {
|
|
177
177
|
case "home":
|
|
178
|
-
return (React.createElement(HomeCard, { viewer: viewer, homeHref: props.homeHref, onHome: props.onHome, myVibesHref: props.myVibesHref, newAppHref: props.newAppHref, recommended: props.recommended, recommendedLoading: props.recommendedLoading, recommendedHeading: props.recommendedHeading, onMakeYourOwn: state.banner === "madeHere" ? props.onMadeHereAsk : undefined, madeHereStarter: state.banner === "madeHere" ? props.madeHereStarter : undefined, onGetFullApp: props.onGetFullApp, onInstallApp: props.onInstallApp, onReport: props.onReport, onAbout: props.onAbout, tabRow: props.homeTabRow === true }));
|
|
178
|
+
return (React.createElement(HomeCard, { viewer: viewer, homeHref: props.homeHref, onHome: props.onHome, myVibesHref: props.myVibesHref, newAppHref: props.newAppHref, recommended: props.recommended, recommendedLoading: props.recommendedLoading, recommendedHeading: props.recommendedHeading, onMakeYourOwn: state.banner === "madeHere" ? props.onMadeHereAsk : undefined, madeHereStarter: state.banner === "madeHere" ? props.madeHereStarter : undefined, door: props.door, onGetFullApp: props.onGetFullApp, onInstallApp: props.onInstallApp, onReport: props.onReport, onAbout: props.onAbout, tabRow: props.homeTabRow === true }));
|
|
179
179
|
case "settings":
|
|
180
180
|
return React.createElement(AccountCard, { viewer: viewer, account: account, nav: nav });
|
|
181
181
|
case "vibe":
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type CardTabItem } from "../parts/CardTabRow.js";
|
|
3
|
-
import type { VibeMenuProps, ViewerSlice } from "../slices.js";
|
|
3
|
+
import type { VibeDoorSlice, VibeMenuProps, ViewerSlice } from "../slices.js";
|
|
4
4
|
export declare const HOME_COPY: Readonly<{
|
|
5
5
|
newApp: "Make a new app";
|
|
6
6
|
makeYourOwn: "Make your own";
|
|
7
7
|
makeYourOwnLikeThis: "Make your own app like this";
|
|
8
|
+
makeOneLikeThis: "Make one like this";
|
|
8
9
|
madeOn: "was made on Vibes DIY";
|
|
9
10
|
makeSub: "Describe an app and it's yours in minutes.";
|
|
10
11
|
home: "vibes.diy home";
|
|
@@ -25,7 +26,7 @@ export declare const HOME_TAB_LABELS: Readonly<{
|
|
|
25
26
|
report: "Report";
|
|
26
27
|
}>;
|
|
27
28
|
export declare const HOME_CARD_CSS = "\n[data-vibe-menu] .vm-app-name { white-space: nowrap; }\n[data-vibe-menu] .vm-row.is-placeholder .vm-dot,\n[data-vibe-menu] .vm-row.is-placeholder .vm-bar {\n background: var(--line-hairline);\n animation: vm-placeholder-pulse 1.2s ease-in-out infinite;\n}\n[data-vibe-menu] .vm-row.is-placeholder .vm-bar {\n height: 16px;\n width: 55%;\n border-radius: var(--radius-full);\n}\n[data-vibe-menu] .vm-row.is-placeholder + .vm-row.is-placeholder .vm-dot,\n[data-vibe-menu] .vm-row.is-placeholder + .vm-row.is-placeholder .vm-bar { animation-delay: 0.15s; }\n[data-vibe-menu] .vm-row.is-placeholder + .vm-row.is-placeholder + .vm-row.is-placeholder .vm-dot,\n[data-vibe-menu] .vm-row.is-placeholder + .vm-row.is-placeholder + .vm-row.is-placeholder .vm-bar { animation-delay: 0.3s; }\n@keyframes vm-placeholder-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n}\n@media (prefers-reduced-motion: reduce) {\n [data-vibe-menu] .vm-row.is-placeholder .vm-dot,\n [data-vibe-menu] .vm-row.is-placeholder .vm-bar { animation: none; }\n}\n";
|
|
28
|
-
export declare function makeYourOwnAskCopy(props: Pick<HomeCardProps, "onMakeYourOwn" | "madeHereStarter">): {
|
|
29
|
+
export declare function makeYourOwnAskCopy(props: Pick<HomeCardProps, "onMakeYourOwn" | "madeHereStarter" | "door">): {
|
|
29
30
|
readonly label: string;
|
|
30
31
|
readonly caption: string;
|
|
31
32
|
};
|
|
@@ -40,6 +41,7 @@ export interface HomeCardProps {
|
|
|
40
41
|
readonly recommendedHeading?: VibeMenuProps["recommendedHeading"];
|
|
41
42
|
readonly onMakeYourOwn?: () => void;
|
|
42
43
|
readonly madeHereStarter?: string;
|
|
44
|
+
readonly door?: VibeDoorSlice;
|
|
43
45
|
readonly onGetFullApp?: () => void;
|
|
44
46
|
readonly onInstallApp?: () => void;
|
|
45
47
|
readonly onAbout?: () => void;
|
|
@@ -7,6 +7,7 @@ export const HOME_COPY = Object.freeze({
|
|
|
7
7
|
newApp: "Make a new app",
|
|
8
8
|
makeYourOwn: "Make your own",
|
|
9
9
|
makeYourOwnLikeThis: "Make your own app like this",
|
|
10
|
+
makeOneLikeThis: "Make one like this",
|
|
10
11
|
madeOn: "was made on Vibes DIY",
|
|
11
12
|
makeSub: "Describe an app and it's yours in minutes.",
|
|
12
13
|
home: "vibes.diy home",
|
|
@@ -58,11 +59,30 @@ const APP_COLORS = [
|
|
|
58
59
|
"var(--section-share)",
|
|
59
60
|
];
|
|
60
61
|
export function makeYourOwnAskCopy(props) {
|
|
62
|
+
if (props.door !== undefined) {
|
|
63
|
+
const sentence = props.door.sentence.trim();
|
|
64
|
+
return { label: HOME_COPY.makeOneLikeThis, caption: sentence === "" ? HOME_COPY.makeSub : sentence };
|
|
65
|
+
}
|
|
61
66
|
const starter = props.madeHereStarter?.trim() ?? "";
|
|
62
67
|
if (props.onMakeYourOwn !== undefined && starter !== "")
|
|
63
68
|
return { label: HOME_COPY.makeYourOwnLikeThis, caption: starter };
|
|
64
69
|
return { label: HOME_COPY.makeYourOwn, caption: HOME_COPY.makeSub };
|
|
65
70
|
}
|
|
71
|
+
function visitorAskPress(props) {
|
|
72
|
+
const door = props.door;
|
|
73
|
+
if (door !== undefined)
|
|
74
|
+
return { onClick: () => door.onTap() };
|
|
75
|
+
if (props.onMakeYourOwn !== undefined)
|
|
76
|
+
return { onClick: props.onMakeYourOwn };
|
|
77
|
+
return { href: props.newAppHref };
|
|
78
|
+
}
|
|
79
|
+
function useDoorShown(props) {
|
|
80
|
+
const visitor = props.viewer.identityPending !== true && props.viewer.role !== "owner";
|
|
81
|
+
const onShown = visitor ? props.door?.onShown : undefined;
|
|
82
|
+
React.useEffect(() => {
|
|
83
|
+
onShown?.();
|
|
84
|
+
}, [onShown]);
|
|
85
|
+
}
|
|
66
86
|
function initialOf(title) {
|
|
67
87
|
return title.slice(0, 1).toUpperCase();
|
|
68
88
|
}
|
|
@@ -139,9 +159,9 @@ function Recommended(props) {
|
|
|
139
159
|
function HomeTabCard(props) {
|
|
140
160
|
const pending = props.viewer.identityPending === true;
|
|
141
161
|
const owner = props.viewer.role === "owner" && pending === false;
|
|
142
|
-
const
|
|
162
|
+
const press = visitorAskPress(props);
|
|
143
163
|
const askCopy = makeYourOwnAskCopy(props);
|
|
144
|
-
const ask = pending ? null : owner ? (React.createElement(ActionPill, { label: HOME_COPY.newApp, href: props.newAppHref, solo: true })) : (React.createElement(ActionPill, { label: askCopy.label, href:
|
|
164
|
+
const ask = pending ? null : owner ? (React.createElement(ActionPill, { label: HOME_COPY.newApp, href: props.newAppHref, solo: true })) : (React.createElement(ActionPill, { label: askCopy.label, href: press.href, onClick: press.onClick, caption: askCopy.caption }));
|
|
145
165
|
return (React.createElement("div", { className: "vm-home vm-ctab vm-xtab", "data-card": "home", "data-tab-row": "" },
|
|
146
166
|
React.createElement("style", null, HOME_CARD_CSS + CARD_TAB_ROW_CSS),
|
|
147
167
|
React.createElement(Stretch, null,
|
|
@@ -154,6 +174,7 @@ function HomeTabCard(props) {
|
|
|
154
174
|
React.createElement(CardTabRow, { label: "Home", items: homeTabItems(props), active: null, onDrill: () => undefined })));
|
|
155
175
|
}
|
|
156
176
|
export function HomeCard(props) {
|
|
177
|
+
useDoorShown(props);
|
|
157
178
|
if (props.tabRow === true)
|
|
158
179
|
return React.createElement(HomeTabCard, { ...props });
|
|
159
180
|
const pending = props.viewer.identityPending === true;
|
|
@@ -162,7 +183,7 @@ export function HomeCard(props) {
|
|
|
162
183
|
const recs = props.recommended.slice(0, 3);
|
|
163
184
|
const recsPending = recs.length === 0 && props.recommendedLoading === true;
|
|
164
185
|
const heading = props.recommendedHeading === "recent" ? HOME_COPY.recent : HOME_COPY.recommended;
|
|
165
|
-
const
|
|
186
|
+
const press = visitorAskPress(props);
|
|
166
187
|
const askCopy = makeYourOwnAskCopy(props);
|
|
167
188
|
return (React.createElement("div", { className: "vm-home", "data-card": "home" },
|
|
168
189
|
React.createElement("style", null, HOME_CARD_CSS),
|
|
@@ -171,7 +192,7 @@ export function HomeCard(props) {
|
|
|
171
192
|
React.createElement("span", { className: "vm-app-name" }, props.viewer.appTitle),
|
|
172
193
|
" ",
|
|
173
194
|
HOME_COPY.madeOn),
|
|
174
|
-
React.createElement(ActionPill, { label: askCopy.label, href:
|
|
195
|
+
React.createElement(ActionPill, { label: askCopy.label, href: press.href, onClick: press.onClick, caption: askCopy.caption }))),
|
|
175
196
|
React.createElement("div", { className: "vm-group" },
|
|
176
197
|
React.createElement(HomeRow, { href: props.homeHref, onHome: props.onHome }),
|
|
177
198
|
signedIn ? React.createElement(Row, { lead: "layout-grid", label: HOME_COPY.myVibes, href: props.myVibesHref }) : null,
|
|
@@ -49,6 +49,7 @@ export declare const CHECK_ROW: Readonly<{
|
|
|
49
49
|
seeThem: "See them";
|
|
50
50
|
notRun: "not checked this time";
|
|
51
51
|
covers: "Reads this version's code, rules and backend log. To see the whole path, try the app yourself.";
|
|
52
|
+
building: "Checks itself when your change lands";
|
|
52
53
|
}>;
|
|
53
54
|
export interface CheckRowFindings {
|
|
54
55
|
readonly opens: {
|
|
@@ -51,6 +51,7 @@ export const CHECK_ROW = Object.freeze({
|
|
|
51
51
|
seeThem: "See them",
|
|
52
52
|
notRun: "not checked this time",
|
|
53
53
|
covers: "Reads this version's code, rules and backend log. To see the whole path, try the app yourself.",
|
|
54
|
+
building: "Checks itself when your change lands",
|
|
54
55
|
});
|
|
55
56
|
function plural(n, one, many) {
|
|
56
57
|
return `${n} ${n === 1 ? one : many}`;
|
|
@@ -5,7 +5,7 @@ export function CheckRowLine(props) {
|
|
|
5
5
|
const { check } = props;
|
|
6
6
|
const onShownRef = React.useRef(check.onShown);
|
|
7
7
|
onShownRef.current = check.onShown;
|
|
8
|
-
const said = `${check.status}|${check.last?.version ?? ""}|${check.last?.current ?? ""}|${check.last?.when ?? ""}`;
|
|
8
|
+
const said = `${check.status}|${check.last?.version ?? ""}|${check.last?.current ?? ""}|${check.last?.when ?? ""}|${check.building === true ? "building" : ""}`;
|
|
9
9
|
React.useEffect(() => {
|
|
10
10
|
if (props.visible)
|
|
11
11
|
onShownRef.current?.();
|
|
@@ -31,6 +31,12 @@ export function CheckRowLine(props) {
|
|
|
31
31
|
React.createElement(Glyph, { name: "refresh" }),
|
|
32
32
|
React.createElement("span", { className: "vm-check-sum" }, CHECK_ROW.running))));
|
|
33
33
|
}
|
|
34
|
+
if (check.building === true) {
|
|
35
|
+
return (React.createElement("div", { className: "vm-check", "data-check-row": "building" },
|
|
36
|
+
React.createElement("p", { className: "vm-sub vm-check-row", "aria-live": "polite" },
|
|
37
|
+
React.createElement(Glyph, { name: "refresh" }),
|
|
38
|
+
React.createElement("span", { className: "vm-check-sum" }, CHECK_ROW.building))));
|
|
39
|
+
}
|
|
34
40
|
if (last === null) {
|
|
35
41
|
const failed = check.status === "failed";
|
|
36
42
|
return (React.createElement("div", { className: "vm-check", "data-check-row": failed ? "failed" : "unchecked" },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { GlyphName } from "./Glyph.js";
|
|
3
|
-
export type StatusLineState = "problem" | "denied" | "olderVersion" | "working" | "checking" | "drafting" | "ready" | "confirm" | "opening" | "syncing" | "keep";
|
|
3
|
+
export type StatusLineState = "problem" | "denied" | "olderVersion" | "working" | "checking" | "drafting" | "ready" | "confirm" | "opening" | "syncing" | "keep" | "door" | "send";
|
|
4
4
|
export interface StatusLineSpec {
|
|
5
5
|
readonly state: StatusLineState;
|
|
6
6
|
readonly faces: boolean;
|
|
@@ -167,9 +167,9 @@ export interface ShareAppSlice {
|
|
|
167
167
|
readonly cardStatus?: AppClipCardStatus | null;
|
|
168
168
|
readonly onRequestCard?: () => void;
|
|
169
169
|
}
|
|
170
|
-
export type ShareCopySurface = "link" | "embed" | "auto-height-embed" | "script-tag" | "settings-link" | "app-link" | "reach";
|
|
171
|
-
export type ShareSendSurface = "link" | "app" | "app-image" | "text" | "email";
|
|
172
|
-
export type ShareSheetSurface = "link" | "app" | "app-image";
|
|
170
|
+
export type ShareCopySurface = "link" | "embed" | "auto-height-embed" | "script-tag" | "settings-link" | "app-link" | "reach" | "send-step";
|
|
171
|
+
export type ShareSendSurface = "link" | "app" | "app-image" | "text" | "email" | "send-step";
|
|
172
|
+
export type ShareSheetSurface = "link" | "app" | "app-image" | "send-step";
|
|
173
173
|
export type ShareSheetErrorName = "AbortError" | "NotAllowedError" | "InvalidStateError" | "DataError" | "NotSupportedError" | "OperationError" | "SecurityError" | "TypeError" | "Error" | "other";
|
|
174
174
|
export type ShareEvent = {
|
|
175
175
|
readonly kind: "copied";
|
|
@@ -341,6 +341,7 @@ export interface CheckRowSlice {
|
|
|
341
341
|
onCheck(): void;
|
|
342
342
|
onShown?(): void;
|
|
343
343
|
onDetails?(): void;
|
|
344
|
+
readonly building?: boolean;
|
|
344
345
|
}
|
|
345
346
|
export interface SaveAskSlice {
|
|
346
347
|
level: "soft" | "strong";
|
|
@@ -398,6 +399,7 @@ export interface VibeMenuProps {
|
|
|
398
399
|
newAppHref: string;
|
|
399
400
|
onMadeHereAsk?: () => void;
|
|
400
401
|
madeHereStarter?: string;
|
|
402
|
+
door?: VibeDoorSlice;
|
|
401
403
|
onGetFullApp?: () => void;
|
|
402
404
|
onInstallApp?: () => void;
|
|
403
405
|
onReport?: () => void;
|
|
@@ -440,3 +442,8 @@ export declare const APPROVE_DATA_ONLY: Readonly<{
|
|
|
440
442
|
}>;
|
|
441
443
|
export declare const REQUEST_ALREADY_ANSWERED = "That request was already decided elsewhere.";
|
|
442
444
|
export declare const REQUEST_ALREADY_IN_OTHER_ROLE = "Already in with a different access level.";
|
|
445
|
+
export interface VibeDoorSlice {
|
|
446
|
+
readonly sentence: string;
|
|
447
|
+
onTap(): void;
|
|
448
|
+
onShown?(): void;
|
|
449
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/base",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.461",
|
|
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.461",
|
|
14
|
+
"@vibes.diy/use-vibes-types": "14.3.461",
|
|
15
|
+
"@vibes.diy/vibe-runtime": "14.3.461",
|
|
16
|
+
"@vibes.diy/vibe-types": "14.3.461",
|
|
17
17
|
"arktype": "~2.2.10",
|
|
18
18
|
"officeparser": "~8.9.0",
|
|
19
19
|
"qrcode-generator": "~2.0.4",
|