@vibes.diy/prompts 14.3.208 → 14.3.210
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/llms/callai.md +1 -1
- package/llms/image-gen.md +2 -2
- package/llms/maps.js +1 -1
- package/llms/maps.js.map +1 -1
- package/llms/maps.md +111 -115
- package/llms/stripe-subscriptions.md +4 -0
- package/llms/stripe.js +11 -1
- package/llms/stripe.js.map +1 -1
- package/llms/stripe.md +98 -7
- package/package.json +5 -5
- package/system-prompt-initial-oneshot.md +44 -37
- package/system-prompt-initial.md +44 -37
- package/system-prompt.md +129 -133
- package/themes/looks/pouf/brief.md +3 -3
- package/themes/palette-gen.d.ts +1 -0
- package/themes/palette-gen.js +17 -1
- package/themes/palette-gen.js.map +1 -1
package/llms/callai.md
CHANGED
|
@@ -10,7 +10,7 @@ Name what the app does in the app's own words. The function name `callAI` stays
|
|
|
10
10
|
|
|
11
11
|
## Text to records
|
|
12
12
|
|
|
13
|
-
When the person's own words describe input in the shape they already have it — typing entries in their own words, pasting a chat, replies or a list, a photo, adding things however they like — the sentence composer is the front door they asked for. When a specified request names its fields or features and describes no such input, the front door is a plain Add form for those fields; adding by sentence is the first of the closing `▸` options, phrased for this app, such as "Add plants by typing a sentence like 'basil and two tomatoes, bed 3'",
|
|
13
|
+
When the person's own words describe input in the shape they already have it — typing entries in their own words, pasting a chat, replies or a list, a photo, adding things however they like — the sentence composer is the front door they asked for. When a specified request names its fields or features and describes no such input, the front door is a plain Add form for those fields; adding by sentence is the first of the closing `▸` options, phrased for this app, such as "Add plants by typing a sentence like 'basil and two tomatoes, bed 3'"; Ask sits beside the records from the first build, part of every app's baseline. An open-ended request opens with the composer among its alive defaults. Keep quantity steppers, claim buttons, and toggles on existing records as direct controls; they complement sentence creation. A name-only list, a simple message, and a timer stay direct because their input already is the whole record or an explicit setting.
|
|
14
14
|
|
|
15
15
|
When the composer is on screen, wire these visible actions in the same build, using the app's own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
|
|
16
16
|
|
package/llms/image-gen.md
CHANGED
|
@@ -170,7 +170,7 @@ export default function App() {
|
|
|
170
170
|
|
|
171
171
|
## Illustrations That Are Part of an Item's Identity
|
|
172
172
|
|
|
173
|
-
When an item's picture is
|
|
173
|
+
When the ask names the pictures and an item's picture is what it is — a deck of illustrated cards, a bestiary, a character cast with portraits, a catalog shown as photos — render `<ImgGen>` **by default** for every such item that lacks an image, so the illustration appears as soon as the item does. Because ImgGen auto-generates when the target doc has a `prompt` but no `_files` yet, mounting it directly on the item is all it takes:
|
|
174
174
|
|
|
175
175
|
```jsx
|
|
176
176
|
<ImgGen
|
|
@@ -180,7 +180,7 @@ When an item's picture is intrinsic to what it is — a card in a deck, a creatu
|
|
|
180
180
|
/>
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
A picture the person asked for by name — the hero of an illustrated journal, the portrait a character maker exists for — arrives with the item itself, so that card opens already illustrated. Every other picture a record would be better with waits for a press: the card carries a quiet `IconButton` with the `photo` icon, labelled in the app's words ("Paint the cover", "Picture this dish"), inside the empty frame where the picture will land, and the press mounts `<ImgGen>` on that record's `_id` with the record's own prompt and saves the picture on it, so every later visitor sees it with no step. Once a picture exists, buttons and `showControls` are for *regenerating* it. Pictures that are extras rather than identity — an avatar upload, a one-off hero graphic, and the text-first snippets below — come from the same kind of explicit action.
|
|
184
184
|
|
|
185
185
|
## Pictures on Request for Text-First Snippets
|
|
186
186
|
|
package/llms/maps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const mapsConfig = {
|
|
2
2
|
name: "maps",
|
|
3
3
|
label: "maps",
|
|
4
|
-
description: "maps of every kind. World overviews (countries, travel journals, places visited, best places to live, territory games, choropleths) use bundled country outlines and SVG markers that render immediately. Street maps of places near the person (restaurants, coffee, parks, \"near me\", a city or zip, directions)
|
|
4
|
+
description: "maps of every kind. World overviews (countries, travel journals, places visited, best places to live, territory games, choropleths) use bundled country outlines and SVG markers that render immediately. Street maps of places near the person (restaurants, coffee, parks, \"near me\", a city or zip, directions) are written with Google's own Maps JavaScript loader (`@googlemaps/js-api-loader`: Map, AdvancedMarkerElement, InfoWindow, Place.searchNearby), which the platform draws and answers with real places, opening already full, with friends' ratings and directions links on top",
|
|
5
5
|
cues: [
|
|
6
6
|
"world map",
|
|
7
7
|
"countries",
|
package/llms/maps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.js","sourceRoot":"","sources":["../../jsr/llms/maps.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAc;IACnC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,MAAM;IACb,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"maps.js","sourceRoot":"","sources":["../../jsr/llms/maps.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAc;IACnC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,MAAM;IACb,WAAW,EACT,qkBAAqkB;IACvkB,IAAI,EAAE;QACJ,WAAW;QACX,WAAW;QACX,gBAAgB;QAChB,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,SAAS;QACT,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,oBAAoB;KACrB;CACF,CAAC"}
|
package/llms/maps.md
CHANGED
|
@@ -89,8 +89,11 @@ numbered pins and a feed of real places beside it, with no form to fill first.
|
|
|
89
89
|
The area comes from, in order: the area the person picked last time (kept in
|
|
90
90
|
`localStorage`), a city-level guess from their connection
|
|
91
91
|
(`https://get.geojs.io/v1/ip/geo.json`: `city`, `region`, `latitude`,
|
|
92
|
-
`longitude`; no permission prompt), and a well-known city when neither
|
|
93
|
-
|
|
92
|
+
`longitude`; no permission prompt), and a well-known city only when neither
|
|
93
|
+
answers. Write all three steps in the app. A fixed starting city ("downtown San
|
|
94
|
+
Francisco") is the last rung of that ladder, never the opening view, so the
|
|
95
|
+
map opens wherever the person is.
|
|
96
|
+
One line beside the results says what it shows and how the area was chosen: "18
|
|
94
97
|
spots within 5 mi of Portland, Oregon (a guess from your connection)".
|
|
95
98
|
|
|
96
99
|
That opening is for places the public world holds. When the ask is the person's
|
|
@@ -101,9 +104,8 @@ A public list never stands in for their own.
|
|
|
101
104
|
**The first paint reads well with no network.** Above the map, the area line,
|
|
102
105
|
the city or zip box and the location button render from code alone. The feed
|
|
103
106
|
holds framed placeholders until the places arrive, and the map box shows a quiet
|
|
104
|
-
background color until its tiles arrive.
|
|
105
|
-
|
|
106
|
-
visit opens instantly and a busy place search still shows real places.
|
|
107
|
+
background color until its tiles arrive. The platform keeps a shared answer for
|
|
108
|
+
each area, so a return visit's search comes back quickly.
|
|
107
109
|
|
|
108
110
|
**The location prompt runs only inside the handler of a button the person taps.**
|
|
109
111
|
A "Use my location" button calls `navigator.geolocation.getCurrentPosition`
|
|
@@ -115,26 +117,33 @@ beside it, looked up on submit with Photon
|
|
|
115
117
|
toward the current area so "97214" finds Portland, not a village abroad).
|
|
116
118
|
Reverse lookups for a friendly label use `https://photon.komoot.io/reverse?lat=…&lon=…`.
|
|
117
119
|
|
|
118
|
-
**Draw the map with
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
**Draw the map with Google's own loader, `@googlemaps/js-api-loader`.** Write
|
|
121
|
+
the Maps JavaScript API exactly as Google documents it: `setOptions`, then
|
|
122
|
+
`importLibrary("maps")`, `importLibrary("marker")` and `importLibrary("places")`.
|
|
123
|
+
The platform supplies the key and chooses how the map is drawn, so leave `key`
|
|
124
|
+
out of `setOptions` (and `apiKey` out of a `Loader`) and keep the code the same
|
|
125
|
+
everywhere. Give the map a container with a real
|
|
126
|
+
height and theme the pins with the app's own classes:
|
|
122
127
|
|
|
123
128
|
```jsx
|
|
124
129
|
import React, { useEffect, useRef, useState } from "react";
|
|
130
|
+
import { setOptions, importLibrary } from "@googlemaps/js-api-loader";
|
|
125
131
|
|
|
126
|
-
|
|
127
|
-
const loadMapLibre = () => (lib ??= (() => {
|
|
128
|
-
const css = document.createElement("link");
|
|
129
|
-
css.rel = "stylesheet";
|
|
130
|
-
css.href = "https://unpkg.com/maplibre-gl@5.6.0/dist/maplibre-gl.css";
|
|
131
|
-
document.head.appendChild(css);
|
|
132
|
-
return import("https://esm.sh/maplibre-gl@5.6.0").then((m) => m.default ?? m);
|
|
133
|
-
})());
|
|
132
|
+
setOptions({ v: "weekly" }); // the platform supplies the key
|
|
134
133
|
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
const FIELDS = ["id", "displayName", "location", "formattedAddress", "websiteURI", "regularOpeningHours", "primaryType"];
|
|
135
|
+
|
|
136
|
+
// One search. Google place types name what the person asked for.
|
|
137
|
+
export async function findPlaces({ center, radius, types }) {
|
|
138
|
+
const { Place } = await importLibrary("places");
|
|
139
|
+
const { places } = await Place.searchNearby({
|
|
140
|
+
fields: FIELDS,
|
|
141
|
+
locationRestriction: { center, radius },
|
|
142
|
+
includedPrimaryTypes: types,
|
|
143
|
+
maxResultCount: 20,
|
|
144
|
+
});
|
|
145
|
+
return places; // Place objects: place.displayName, place.location.lat(), place.location.toJSON()
|
|
146
|
+
}
|
|
138
147
|
|
|
139
148
|
export function PlaceMap({ places, center, selectedId, onPick }) {
|
|
140
149
|
const box = useRef(null);
|
|
@@ -143,129 +152,116 @@ export function PlaceMap({ places, center, selectedId, onPick }) {
|
|
|
143
152
|
const [ready, setReady] = useState(false);
|
|
144
153
|
useEffect(() => {
|
|
145
154
|
let alive = true;
|
|
146
|
-
|
|
155
|
+
importLibrary("maps").then(({ Map }) => {
|
|
147
156
|
if (!alive) return;
|
|
148
|
-
map.current = new
|
|
149
|
-
|
|
150
|
-
map.current.addControl(new ml.NavigationControl({ showCompass: false }), "top-right");
|
|
151
|
-
map.current.on("load", () => alive && setReady(true));
|
|
157
|
+
map.current = new Map(box.current, { center, zoom: 13, mapId: "places", gestureHandling: "cooperative" });
|
|
158
|
+
setReady(true);
|
|
152
159
|
});
|
|
153
|
-
return () => { alive = false;
|
|
160
|
+
return () => { alive = false; };
|
|
154
161
|
}, []);
|
|
155
162
|
// Places arrive after the map: redraw whenever the list changes, once the map is ready.
|
|
156
163
|
const ids = places.map((p) => p.id).join("|");
|
|
157
164
|
useEffect(() => {
|
|
158
165
|
if (!ready) return;
|
|
159
|
-
|
|
160
|
-
|
|
166
|
+
let alive = true;
|
|
167
|
+
Promise.all([importLibrary("marker"), importLibrary("core")]).then(([{ AdvancedMarkerElement }, { LatLngBounds }]) => {
|
|
168
|
+
if (!alive) return;
|
|
169
|
+
pins.current.forEach((pin) => { pin.map = null; });
|
|
161
170
|
pins.current = new Map();
|
|
171
|
+
const bounds = new LatLngBounds();
|
|
162
172
|
places.forEach((place, i) => {
|
|
163
173
|
const el = document.createElement("button");
|
|
164
174
|
el.className = "grid size-8 place-items-center rounded-full border-2 border-background bg-primary text-xs font-bold text-primary-foreground shadow";
|
|
165
175
|
el.textContent = String(i + 1); // the same number the feed shows
|
|
166
|
-
el.setAttribute("aria-label", `${i + 1}. ${place.
|
|
167
|
-
|
|
168
|
-
|
|
176
|
+
el.setAttribute("aria-label", `${i + 1}. ${place.displayName}`);
|
|
177
|
+
const pin = new AdvancedMarkerElement({ map: map.current, position: place.location, content: el, title: place.displayName });
|
|
178
|
+
pin.addListener("click", () => onPick(place.id));
|
|
179
|
+
pins.current.set(place.id, pin);
|
|
180
|
+
bounds.extend(place.location);
|
|
169
181
|
});
|
|
170
|
-
if (places.length > 1)
|
|
171
|
-
const b = new ml.LngLatBounds();
|
|
172
|
-
places.forEach((p) => b.extend([p.lng, p.lat]));
|
|
173
|
-
map.current.fitBounds(b, { padding: 48, maxZoom: 14 });
|
|
174
|
-
}
|
|
182
|
+
if (places.length > 1) map.current.fitBounds(bounds, 48);
|
|
175
183
|
});
|
|
184
|
+
return () => { alive = false; };
|
|
176
185
|
}, [ready, ids]);
|
|
177
186
|
useEffect(() => {
|
|
178
187
|
const pin = pins.current.get(selectedId);
|
|
179
|
-
if (pin)
|
|
188
|
+
if (!pin) return;
|
|
189
|
+
map.current.panTo(pin.position);
|
|
190
|
+
if (map.current.getZoom() < 15) map.current.setZoom(15);
|
|
180
191
|
}, [selectedId]);
|
|
181
|
-
return <div className="
|
|
192
|
+
return <div className="h-80 overflow-hidden rounded-lg border border-border lg:h-screen">
|
|
182
193
|
<div ref={box} className="h-full w-full" role="region" aria-label="Map of places" />
|
|
183
|
-
<span className="absolute bottom-1 left-2 text-xs text-muted-foreground">© OpenFreeMap · © OpenStreetMap contributors</span>
|
|
184
194
|
</div>;
|
|
185
195
|
}
|
|
186
196
|
```
|
|
187
197
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
198
|
+
Google's `Map` has no destroy, so the effect's cleanup only stops a late
|
|
199
|
+
callback: when the map's box leaves the page, the map lets go of itself.
|
|
200
|
+
The map draws its own credit line, so the app adds none. Size the element you
|
|
201
|
+
hand to `new Map` with `h-full w-full` inside a sized wrapper; an
|
|
202
|
+
`absolute inset-0` map box collapses to zero height. Once the person drags the
|
|
203
|
+
map, offer a "Search this area" button that searches `map.getCenter()` with a
|
|
204
|
+
radius taken from `map.getBounds()`.
|
|
193
205
|
|
|
194
|
-
**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
`
|
|
199
|
-
|
|
206
|
+
**Stay within the supported subset of Google Maps:** `Map` (`center`, `zoom`,
|
|
207
|
+
`mapId`, `fitBounds`, `panTo`, `setCenter`, `setZoom`, `getZoom`, `getCenter`,
|
|
208
|
+
`getBounds`, `addListener`), `LatLng`, `LatLngBounds` (`extend`, `getCenter`),
|
|
209
|
+
`marker.AdvancedMarkerElement` (`map`, `position`, `content`, `title`,
|
|
210
|
+
`addListener("click")`), `marker.PinElement`, `InfoWindow` (`setContent`,
|
|
211
|
+
`open({ map, anchor })`, `close`), `event.addListener` / `removeListener`, and
|
|
212
|
+
`places.Place.searchNearby` / `Place.searchByText`. Directions, geocoding,
|
|
213
|
+
drawing, heat maps, Street View, `Polyline`/`Polygon`/`Circle` and place
|
|
214
|
+
autocomplete are outside it: the Photon box is the area search, and directions
|
|
215
|
+
open the phone's maps app (below).
|
|
200
216
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
// datasource.raw carries the OSM tags, so the page reads one shape either way.
|
|
218
|
-
const TYPES = { n: "node", w: "way", r: "relation" };
|
|
219
|
-
return json({ ok: true, elements: d.features.map(({ properties: p }) => {
|
|
220
|
-
const raw = p.datasource?.raw ?? {};
|
|
221
|
-
// Keep the OSM identity (osm-way-12 stays osm-way-12); a result with none gets its own namespace.
|
|
222
|
-
const osm = TYPES[raw.osm_type] && raw.osm_id;
|
|
223
|
-
return { type: osm ? TYPES[raw.osm_type] : "geoapify", id: osm ? raw.osm_id : p.place_id,
|
|
224
|
-
lat: p.lat, lon: p.lon, tags: { name: p.name, ...raw } };
|
|
225
|
-
}) });
|
|
226
|
-
}
|
|
227
|
-
const q = `[out:json][timeout:20];nwr["amenity"~"^(restaurant|cafe|fast_food)$"]["diet:vegan"~"^(only|yes)$"](around:${r},${lat},${lng});out center tags 300;`;
|
|
228
|
-
const elements = await Promise.any(MIRRORS.map(async (base) => {
|
|
229
|
-
const res = await ctx.fetch(`${base}?data=${encodeURIComponent(q)}`);
|
|
230
|
-
if (!res.ok) throw new Error(String(res.status));
|
|
231
|
-
return (await res.json()).elements;
|
|
232
|
-
}));
|
|
233
|
-
return json({ ok: true, elements });
|
|
234
|
-
} catch {
|
|
235
|
-
return json({ ok: false, reason: "The place list is taking its time." }, 502);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
```
|
|
217
|
+
**Places come from `Place.searchNearby`, answered by the platform.** Name what
|
|
218
|
+
the person asked about with Google place types: `vegan_restaurant`,
|
|
219
|
+
`vegetarian_restaurant`, `restaurant`, `fast_food_restaurant`, `cafe`,
|
|
220
|
+
`coffee_shop`, `bakery`, `ice_cream_shop`, `bar`, `park`, `dog_park`,
|
|
221
|
+
`playground`, `museum`, `tourist_attraction`, `library`, `book_store`,
|
|
222
|
+
`supermarket`, `grocery_store`, `pharmacy`, `gym`. `Place.searchByText`
|
|
223
|
+
(`textQuery` plus `locationBias: { center, radius }`) finds a place by name. Ask
|
|
224
|
+
for every field the card shows in `fields`, since those are the ones that come
|
|
225
|
+
back. A field a listing lacks reads `null`, so the card shows what is there:
|
|
226
|
+
`displayName`, `formattedAddress`, `websiteURI`, and
|
|
227
|
+
`regularOpeningHours.weekdayDescriptions` as the hours lines. Public star
|
|
228
|
+
ratings, review counts and photos come from Google mode only; the free map's
|
|
229
|
+
places carry `rating: null`. So the app's stars are the friends' own ratings,
|
|
230
|
+
and a listing's `rating` shows only when it is a number. A search answers
|
|
231
|
+
at most 20 places; start with a circle of about 8000 meters and widen it when
|
|
232
|
+
fewer than 10 come back.
|
|
239
233
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
`id: "osm-" + type + "-" + id`, name, coordinates (`lat`/`lon`, or `center` for a
|
|
247
|
-
building), `addr:*` for the address, `website`, `opening_hours`, `cuisine`.
|
|
248
|
-
Round the search point to two decimals so nearby visitors share a cached answer.
|
|
249
|
-
|
|
250
|
-
Overpass is run by volunteers and is often slow or busy. Give the search about
|
|
251
|
-
20 seconds, then show a "Try again" button and a link that opens the same area
|
|
252
|
-
on a directory that covers it (HappyCow for vegan food, the phone's maps app for
|
|
253
|
-
anything else). Real places only: an empty area says so and suggests the
|
|
254
|
-
nearest city or widening the circle. The person's own pins and notes are how a
|
|
255
|
-
missing spot gets in, never invented names.
|
|
234
|
+
While a search runs, the feed keeps its framed placeholders. A search that
|
|
235
|
+
rejects carries a sentence: show "Try again" beside it, and a link that opens
|
|
236
|
+
the same area on a directory that covers it (HappyCow for vegan food, the
|
|
237
|
+
phone's maps app for anything else). Real places only: an empty area says so
|
|
238
|
+
and suggests the nearest city or widening the circle. The person's own pins and
|
|
239
|
+
notes are how a missing spot gets in, never invented names.
|
|
256
240
|
|
|
257
241
|
"Top" and "best" name their ranking in that one line: "fully vegan first, then
|
|
258
|
-
friends' favorites, then the closest".
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
complete the listing is (website, hours, cuisine, address), and distance.
|
|
242
|
+
friends' favorites, then the closest". Rank on what the answer holds: the place
|
|
243
|
+
type that matches the ask most closely, the friends' own ratings, how complete
|
|
244
|
+
the listing is (website, hours, address), and distance.
|
|
262
245
|
|
|
263
246
|
**The person's layer sits on top of the places.** Ratings, comments, saves and
|
|
264
|
-
"been there" checks are the app's own records
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
247
|
+
"been there" checks are the app's own records. Each one carries the spot's
|
|
248
|
+
`lat`/`lng` and a snapshot of its name and address, plus the place `id` as a
|
|
249
|
+
hint, so a note still reads well if the listing changes. A place card shows the
|
|
250
|
+
notes within about 50 meters of the listing, and a note with no listing nearby
|
|
251
|
+
shows as its own pin with its snapshot name:
|
|
252
|
+
|
|
253
|
+
```js
|
|
254
|
+
// Meters between two { lat, lng } points; close enough for "about 50 m".
|
|
255
|
+
const metersApart = (a, b) => {
|
|
256
|
+
const dLat = (a.lat - b.lat) * 111320;
|
|
257
|
+
const dLng = (a.lng - b.lng) * 111320 * Math.cos((a.lat * Math.PI) / 180);
|
|
258
|
+
return Math.hypot(dLat, dLng);
|
|
259
|
+
};
|
|
260
|
+
const notesFor = (place, notes) => notes.filter((n) => metersApart(n, place.location.toJSON()) <= 50);
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Every signed-in friend writes as themselves; pins the owner adds by hand join
|
|
264
|
+
the feed with their own note.
|
|
269
265
|
|
|
270
266
|
**Directions open the phone's maps app**:
|
|
271
267
|
`https://www.google.com/maps/dir/?api=1&destination=<lat>,<lng>&travelmode=driving`,
|
|
@@ -275,5 +271,5 @@ fragment. A friend opening it lands on that area with the place open.
|
|
|
275
271
|
|
|
276
272
|
Verify the first preview at phone width. The map paints, the numbered pins match
|
|
277
273
|
the feed, and tapping a pin brings its card into view. The location prompt
|
|
278
|
-
appears only after "Use my location". A typed zip moves the map, and the
|
|
279
|
-
|
|
274
|
+
appears only after "Use my location". A typed zip moves the map, and the map
|
|
275
|
+
shows its credit line.
|
|
@@ -181,6 +181,7 @@ Every membership records the mode it was made in, and every ctx.stripe.fetch cal
|
|
|
181
181
|
`line_items[0][price_data][recurring][interval]=month` (or `year`),
|
|
182
182
|
`unit_amount` in the smallest unit, a product name. The owner never creates
|
|
183
183
|
products in the dashboard first.
|
|
184
|
+
- `branding_settings[display_name]` is the app's own name, the one its header shows, so Checkout opens with "Pay <app name>" rather than the name on the owner's Stripe account, which serves every app they connect.
|
|
184
185
|
- `client_reference_id` carries the record's `_id` and `metadata[attempt]`
|
|
185
186
|
its attempt number.
|
|
186
187
|
- `success_url` and `cancel_url` are the app's public address with a fragment,
|
|
@@ -349,6 +350,7 @@ export const config = {
|
|
|
349
350
|
};
|
|
350
351
|
|
|
351
352
|
const DB = "club";
|
|
353
|
+
const CLUB_NAME = "Paragraph Club"; // the app's own name, as its header shows it
|
|
352
354
|
const SESSION_TTL_MS = 24 * 60 * 60 * 1000;
|
|
353
355
|
// The one knob: how long a past_due member stays in while Stripe retries the card. Zero locks
|
|
354
356
|
// the moment a renewal fails.
|
|
@@ -616,6 +618,8 @@ export async function fetch(request, ctx) {
|
|
|
616
618
|
"line_items[0][price_data][product_data][name]": membership.plan,
|
|
617
619
|
client_reference_id: id,
|
|
618
620
|
"metadata[attempt]": String(attempt),
|
|
621
|
+
// Checkout opens with "Pay <this app>", not the name on the owner's Stripe account.
|
|
622
|
+
"branding_settings[display_name]": CLUB_NAME,
|
|
619
623
|
success_url: appUrl(ctx, "#subscribed"),
|
|
620
624
|
cancel_url: appUrl(ctx, "#cancelled"),
|
|
621
625
|
});
|
package/llms/stripe.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const stripeConfig = {
|
|
2
2
|
name: "stripe",
|
|
3
3
|
label: "Stripe payments",
|
|
4
|
-
description: "Taking real money through Stripe Checkout: load it whenever the person asks for money to move — pay the bill, split the check, a restaurant check, pay at the table or at the counter, a tip or a tip jar, donate or a donation page, sell tickets, sell products buyers pay for, buy now or purchase online, a charge, a deposit, dues, a checkout, pay with Stripe, or the word Stripe — one-time charges into the owner's own Stripe account through ctx.stripe, connected once with Connect Stripe (a monthly or yearly subscription is the stripe-subscriptions skill): what is for sale and its price is the owner's product catalog, product records in the app's database that only the owner writes (access.js) from the app's own Products screen, starting empty with the owner's first product, and backend.js charges the price it reads from the product the buyer names, never an amount from the browser or a constant in backend.js; guest checkout by default for paying a venue (a check, a tip, a donation — no sign-in, the payment keyed to the thing paid and its session, written by backend.js for the guest) and a signed-in order where the record is the buyer's to keep (dues on a roster, my orders), one payer paying the whole check by default with splitting as a second choice and the balance reserved with a revision-checked write before any session opens, the Connect Stripe setup item read from ctx.stripe.status(), test mode first with the order's mode passed on every call and live once the owner takes this app live, every Stripe call in backend.js with no Stripe.js in the page, one pending order then one Checkout Session opened in a new tab, an order marked paid only after the backend reads the session back from Stripe and matches it to the order, integer amounts in cents, and a scheduled sweep that settles orders whose buyer never came back. A storefront, plans page
|
|
4
|
+
description: "Taking real money through Stripe Checkout: load it whenever the person asks for money to move — pay the bill, split the check, a restaurant check, pay at the table or at the counter, a tip or a tip jar, donate or a donation page, sell tickets, sell products buyers pay for, buy now or purchase online, a charge, a deposit, dues, a checkout, a client paying an invoice online (pay an invoice, bill a client), pay with Stripe, or the word Stripe — one-time charges into the owner's own Stripe account through ctx.stripe, connected once with Connect Stripe (a monthly or yearly subscription is the stripe-subscriptions skill): what is for sale and its price is the owner's product catalog, product records in the app's database that only the owner writes (access.js) from the app's own Products screen, starting empty with the owner's first product, and backend.js charges the price it reads from the product the buyer names, never an amount from the browser or a constant in backend.js; guest checkout by default for paying a venue (a check, a tip, a donation, an invoice paid by link with a pay-by date and an overdue state — no sign-in, the payment keyed to the thing paid and its session, written by backend.js for the guest) and a signed-in order where the record is the buyer's to keep (dues on a roster, my orders), one payer paying the whole check by default with splitting as a second choice and the balance reserved with a revision-checked write before any session opens, the Connect Stripe setup item read from ctx.stripe.status(), test mode first with the order's mode passed on every call and live once the owner takes this app live, every Stripe call in backend.js with no Stripe.js in the page, one pending order then one Checkout Session opened in a new tab, an order marked paid only after the backend reads the session back from Stripe and matches it to the order, integer amounts in cents, and a scheduled sweep that settles orders whose buyer never came back. A storefront, plans page, booking page or invoice maker that only records orders or marks invoices paid by hand takes no payment and does not need this; offer it as the [pay] option instead",
|
|
5
5
|
cues: [
|
|
6
6
|
"stripe",
|
|
7
7
|
"take payments",
|
|
@@ -30,6 +30,16 @@ export const stripeConfig = {
|
|
|
30
30
|
"donation",
|
|
31
31
|
"donations",
|
|
32
32
|
"pay with stripe",
|
|
33
|
+
"pay an invoice",
|
|
34
|
+
"pay the invoice",
|
|
35
|
+
"pay invoices",
|
|
36
|
+
"pay their invoice",
|
|
37
|
+
"pay my invoice",
|
|
38
|
+
"invoice payment",
|
|
39
|
+
"invoice payments",
|
|
40
|
+
"bill a client",
|
|
41
|
+
"bill clients",
|
|
42
|
+
"bill my clients",
|
|
33
43
|
],
|
|
34
44
|
routeCues: [
|
|
35
45
|
"with stripe",
|
package/llms/stripe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../jsr/llms/stripe.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,YAAY,GAAc;IACrC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../jsr/llms/stripe.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,YAAY,GAAc;IACrC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,wnEAAwnE;IAC1nE,IAAI,EAAE;QACJ,QAAQ;QACR,eAAe;QACf,cAAc;QACd,iBAAiB;QACjB,eAAe;QACf,cAAc;QACd,aAAa;QACb,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;QACd,SAAS;QACT,YAAY;QACZ,iBAAiB;QACjB,iBAAiB;QACjB,QAAQ;QACR,SAAS;QACT,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,kBAAkB;QAClB,oBAAoB;QACpB,SAAS;QACT,QAAQ;QACR,UAAU;QACV,WAAW;QACX,iBAAiB;QAGjB,gBAAgB;QAChB,iBAAiB;QACjB,cAAc;QACd,mBAAmB;QACnB,gBAAgB;QAChB,iBAAiB;QACjB,kBAAkB;QAClB,eAAe;QACf,cAAc;QACd,iBAAiB;KAClB;IAKD,SAAS,EAAE;QACT,aAAa;QACb,gBAAgB;QAChB,YAAY;QACZ,cAAc;QACd,iBAAiB;QACjB,gBAAgB;QAChB,aAAa;QACb,cAAc;QACd,eAAe;QACf,cAAc;QACd,eAAe;QACf,eAAe;QACf,iBAAiB;KAClB;IAGD,aAAa,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC;CACjG,CAAC"}
|