@wix/agent-skills 1.16.0 → 1.16.1
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/package.json +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +18 -3
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +12 -7
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +60 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +6 -6
- package/skills/wix-app/references/editor-react-component/SITE-CONTEXT-HOOKS.md +187 -0
- package/skills/wix-app/scripts/scan-a11y-code.cjs +777 -0
- package/skills/wix-app/scripts/scan-a11y-eslint.cjs +201 -0
- package/skills/wix-headless/references/CAPABILITIES.md +16 -3
- package/skills/wix-headless/references/SDK_HANDOFF.md +1 -1
- package/skills/wix-headless/references/SEED.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +560 -102
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +210 -143
- package/skills/wix-manage/SKILL.md +8 -1
- package/skills/wix-manage/references/accessibility/scan-site-accessibility.md +98 -0
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +1 -2
- package/skills/wix-manage/references/sites/site-import.md +67 -15
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +1 -1
- package/skills/wix-vibe-headless/SKILL.md +2 -1
- package/skills/wix-vibe-headless/install/deploy.cjs +64 -3
- package/skills/wix-vibe-headless/platforms/base44.md +12 -37
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +1 -2
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +7 -12
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +1 -1
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +5 -3
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +44 -5
|
@@ -33,11 +33,11 @@ so you don't need to open them:**
|
|
|
33
33
|
| `components/CollectionCard.jsx`, `CollectionGrid.jsx` | collections listing UI (grid + card, with empty state) |
|
|
34
34
|
| `components/ProjectCard.jsx`, `ProjectGrid.jsx` | projects listing UI (grid + card, with empty state) |
|
|
35
35
|
| `components/ProjectMedia.jsx` | one gallery item — branches on `item.type` (IMAGE / VIDEO) |
|
|
36
|
-
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP
|
|
36
|
+
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP 3) |
|
|
37
37
|
| `pages/Portfolio.jsx` | collections gallery route (`/portfolio`) |
|
|
38
38
|
| `pages/CollectionPage.jsx` | collection page route (`/collection/:slug`) |
|
|
39
39
|
| `pages/ProjectDetail.jsx` | project detail route (`/project/:slug`) |
|
|
40
|
-
| `rest/wix-config.js` |
|
|
40
|
+
| `rest/wix-config.js` | the two ids, written by the install step |
|
|
41
41
|
| `rest/wix-client.js` + `rest/wix-portfolio.js` | REST transport + portfolio read helpers |
|
|
42
42
|
|
|
43
43
|
They're already in place — go **straight to theming + wiring**, nothing to verify first. **Don't
|
|
@@ -47,11 +47,8 @@ a real fallback — a runtime error, or a field the snippets don't cover (see "F
|
|
|
47
47
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
48
48
|
`references/portfolio/app/` → `src/`.)
|
|
49
49
|
|
|
50
|
-
## STEP 2 — Credentials
|
|
51
|
-
Write `src/rest/wix-config.js` with your `WIX_CLIENT_ID` and `WIX_METASITE_ID` from the prompt — the
|
|
52
|
-
one place both ids live.
|
|
53
50
|
|
|
54
|
-
## STEP
|
|
51
|
+
## STEP 2 — Theme (nothing to style on the shipped components)
|
|
55
52
|
The shipped components carry **no palette of their own** — they render from base44's design tokens in
|
|
56
53
|
`src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `--primary`, `--muted`,
|
|
57
54
|
`--border`, `--radius`, `--font-*`) via shadcn Tailwind classes (`bg-card`, `text-foreground`,
|
|
@@ -59,10 +56,10 @@ The shipped components carry **no palette of their own** — they render from ba
|
|
|
59
56
|
are **already set to the brand by the design phase**, so the shipped pages are themed with zero work
|
|
60
57
|
here. To adjust the palette, edit `index.css` (`:root` **and** `.dark`) — the base44 way; **never add
|
|
61
58
|
a parallel theme file (e.g. a `theme.css`) or restyle the shipped JSX.** Build the Home/Header you add
|
|
62
|
-
(STEP
|
|
59
|
+
(STEP 3) from the **same** base44 tokens/classes so it matches automatically. A dark brand is just
|
|
63
60
|
base44's dark palette in `index.css` — no per-component work.
|
|
64
61
|
|
|
65
|
-
## STEP
|
|
62
|
+
## STEP 3 — Wire routes (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
66
63
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
67
64
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
68
65
|
replace it. Portfolio is read-only with no cross-page state, so there's **no provider to wrap** (no
|
|
@@ -122,7 +119,7 @@ function Layout() {
|
|
|
122
119
|
|
|
123
120
|
## What you build (not shipped)
|
|
124
121
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the `Layout`
|
|
125
|
-
(STEP
|
|
122
|
+
(STEP 3) so they wrap every route — plus the overall brand story, styled with the same base44
|
|
126
123
|
tokens/classes. **Compose the shipped pieces** — a featured strip is just `queryCollections` (or
|
|
127
124
|
`queryProjects`) + the shipped `CollectionGrid` / `ProjectGrid`; the nav is a link to `/portfolio`:
|
|
128
125
|
|
|
@@ -204,9 +201,8 @@ links its own reference page inline; the whole area is here:
|
|
|
204
201
|
- Portfolio (collections, projects, project items): https://dev.wix.com/docs/api-reference/business-solutions/portfolio.md
|
|
205
202
|
|
|
206
203
|
## Hard rules
|
|
207
|
-
- Set `WIX_CLIENT_ID` (STEP 2) — not the placeholder.
|
|
208
204
|
- Style via base44 design tokens (`index.css` / shadcn Tailwind classes), never by rewriting the shipped components or adding a parallel theme file.
|
|
209
|
-
- Header/footer live in a `Layout` around `<Outlet/>` (STEP
|
|
205
|
+
- Header/footer live in a `Layout` around `<Outlet/>` (STEP 3) — never edit the shipped
|
|
210
206
|
`Portfolio`/`CollectionPage`/`ProjectDetail` to add chrome.
|
|
211
207
|
- The Layout's fixed top region owns positioning: `<WixManageBanner/>` above `<Header/>`; your
|
|
212
208
|
`Header` is plain in-flow markup (not `position:fixed`).
|
|
@@ -36,11 +36,11 @@ map, so you don't need to open them:**
|
|
|
36
36
|
| `components/PlanCard.jsx` | plan card — name, description, price, perks, Subscribe (when `buyable`) |
|
|
37
37
|
| `components/PlanGrid.jsx` | responsive plans grid + empty state |
|
|
38
38
|
| `components/OrderCard.jsx` | one member order row for the "my plans" list |
|
|
39
|
-
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP
|
|
39
|
+
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP 3) |
|
|
40
40
|
| `pages/Plans.jsx` | the plans-table route (`/plans`) — grid + paging + checkout |
|
|
41
41
|
| `pages/PlanDetail.jsx` | the plan-detail route (`/plans/:slug`) — perks, terms, checkout |
|
|
42
42
|
| `pages/MyPlans.jsx` | the member's memberships + post-checkout confirmation (`/my-plans`) |
|
|
43
|
-
| `rest/wix-config.js` |
|
|
43
|
+
| `rest/wix-config.js` | the two ids, written by the install step |
|
|
44
44
|
| `rest/wix-client.js` + `rest/wix-pricing-plans.js` | REST transport + plans/orders/checkout helpers |
|
|
45
45
|
|
|
46
46
|
They're already in place — go **straight to theming + wiring**, nothing to verify first. **Don't
|
|
@@ -50,11 +50,8 @@ a real fallback — a runtime error, or a field the snippets don't cover (see "F
|
|
|
50
50
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
51
51
|
`references/pricing-plans/app/` → `src/`.)
|
|
52
52
|
|
|
53
|
-
## STEP 2 — Credentials
|
|
54
|
-
Write `src/rest/wix-config.js` with your `WIX_CLIENT_ID` and `WIX_METASITE_ID` from the prompt — the
|
|
55
|
-
one place both ids live.
|
|
56
53
|
|
|
57
|
-
## STEP
|
|
54
|
+
## STEP 2 — Theme (nothing to style on the shipped components)
|
|
58
55
|
The shipped components carry **no palette of their own** — they render from base44's design tokens
|
|
59
56
|
in `src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `--primary`,
|
|
60
57
|
`--muted`, `--border`, `--radius`, `--font-*`) via shadcn Tailwind classes (`bg-card`,
|
|
@@ -62,10 +59,10 @@ in `src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `
|
|
|
62
59
|
`font-display`). Those tokens are **already set to the brand by the design phase**, so the shipped
|
|
63
60
|
pages are themed with zero work here. To adjust the palette, edit `index.css` (`:root` **and**
|
|
64
61
|
`.dark`) — the base44 way; **never add a parallel theme file (e.g. a `theme.css`) or restyle the
|
|
65
|
-
shipped JSX.** Build the Home/Header you add (STEP
|
|
62
|
+
shipped JSX.** Build the Home/Header you add (STEP 3) from the **same** base44 tokens/classes so it
|
|
66
63
|
matches automatically. A dark brand is just base44's dark palette in `index.css` — no per-component work.
|
|
67
64
|
|
|
68
|
-
## STEP
|
|
65
|
+
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
69
66
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
70
67
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
71
68
|
replace it. Pricing Plans needs **no** cross-page provider (checkout is a redirect, not client
|
|
@@ -125,7 +122,7 @@ function Layout() {
|
|
|
125
122
|
|
|
126
123
|
## What you build (not shipped)
|
|
127
124
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the
|
|
128
|
-
`Layout` (STEP
|
|
125
|
+
`Layout` (STEP 3) so they wrap every route — plus the overall brand story, styled with the same
|
|
129
126
|
base44 tokens/classes. **Compose the shipped pieces** — a "featured plans" strip is just `queryPlans` +
|
|
130
127
|
the shipped `PlanGrid`; the nav is links to `/plans` and `/my-plans`:
|
|
131
128
|
|
|
@@ -214,9 +211,8 @@ Fallback only — when you hit an error or need something not shown here: read t
|
|
|
214
211
|
file under `src/`, or look it up via the **`wix-docs`** skill.
|
|
215
212
|
|
|
216
213
|
## Hard rules
|
|
217
|
-
- Set `WIX_CLIENT_ID` (STEP 2) — not the placeholder.
|
|
218
214
|
- Style via base44 design tokens (`index.css` / shadcn Tailwind classes), never by rewriting the shipped components or adding a parallel theme file.
|
|
219
|
-
- Header/footer live in a `Layout` around `<Outlet/>` (STEP
|
|
215
|
+
- Header/footer live in a `Layout` around `<Outlet/>` (STEP 3) — never edit the shipped
|
|
220
216
|
`Plans`/`PlanDetail`/`MyPlans` to add chrome.
|
|
221
217
|
- The Layout's fixed top region owns positioning: `<WixManageBanner/>` above `<Header/>`; your
|
|
222
218
|
`Header` is plain in-flow markup (not `position:fixed`).
|
|
@@ -35,9 +35,9 @@ so you don't need to open them:**
|
|
|
35
35
|
| `components/ItemDialog.jsx` | dish detail modal — description, price/variants, modifier groups (display), quantity, add-to-order |
|
|
36
36
|
| `components/OrderCartButton.jsx` | header order **icon** button with a live-count badge |
|
|
37
37
|
| `components/OrderCartDrawer.jsx` | slide-over order cart (mount once; opens from `useOrderCart`) |
|
|
38
|
-
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP
|
|
38
|
+
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP 3) |
|
|
39
39
|
| `pages/Menu.jsx`, `pages/Reservations.jsx` | the two shipped routes (`/menu`, `/reservations`) |
|
|
40
|
-
| `rest/wix-config.js` |
|
|
40
|
+
| `rest/wix-config.js` | the two ids, written by the install step |
|
|
41
41
|
| `rest/wix-client.js` | REST transport + visitor-token mint/refresh (the refresh token IS the cart identity) |
|
|
42
42
|
| `rest/wix-restaurants-menu.js` | menu read helpers — `getFullMenu` (the assembled tree; start here) + raw `list*` |
|
|
43
43
|
| `rest/wix-restaurants-ordering.js` | ordering — operations, add/update/remove, `checkout` |
|
|
@@ -50,11 +50,8 @@ real fallback — a runtime error, or a field the snippets don't cover (see "Fal
|
|
|
50
50
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
51
51
|
`references/restaurants/app/` → `src/`.)
|
|
52
52
|
|
|
53
|
-
## STEP 2 — Credentials
|
|
54
|
-
Write `src/rest/wix-config.js` with your `WIX_CLIENT_ID` and `WIX_METASITE_ID` from the prompt — the
|
|
55
|
-
one place both ids live.
|
|
56
53
|
|
|
57
|
-
## STEP
|
|
54
|
+
## STEP 2 — Theme (nothing to style on the shipped components)
|
|
58
55
|
The shipped components (menu, item dialog, order cart, reservations) carry **no palette of their
|
|
59
56
|
own** — they render from base44's design tokens in `src/index.css` (`:root`/`.dark`: `--background`,
|
|
60
57
|
`--foreground`, `--card`, `--primary`, `--muted`, `--border`, `--radius`, `--font-*`) via shadcn
|
|
@@ -62,11 +59,11 @@ Tailwind classes (`bg-card`, `text-foreground`, `bg-primary`, `text-muted-foregr
|
|
|
62
59
|
`border-border`, `rounded-lg`, `font-display`). Those tokens are **already set to the brand by the
|
|
63
60
|
design phase**, so the shipped pages are themed with zero work here. To adjust the palette, edit
|
|
64
61
|
`index.css` (`:root` **and** `.dark`) — the base44 way; **never add a parallel theme file (e.g. a
|
|
65
|
-
`theme.css`) or restyle the shipped JSX.** Build the Home/Header you add (STEP
|
|
62
|
+
`theme.css`) or restyle the shipped JSX.** Build the Home/Header you add (STEP 3) from the **same**
|
|
66
63
|
base44 tokens/classes so it matches automatically. A dark brand is just base44's dark palette in
|
|
67
64
|
`index.css` — no per-component work.
|
|
68
65
|
|
|
69
|
-
## STEP
|
|
66
|
+
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
70
67
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
71
68
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
72
69
|
replace it.
|
|
@@ -129,7 +126,7 @@ function Layout() {
|
|
|
129
126
|
|
|
130
127
|
## What you build (not shipped)
|
|
131
128
|
The **home / landing page**, the **`Header`** (mount `<OrderCartButton/>` in it) and a **`Footer`** —
|
|
132
|
-
the two you drop into the `Layout` (STEP
|
|
129
|
+
the two you drop into the `Layout` (STEP 3) so they wrap every route — plus the overall brand story,
|
|
133
130
|
styled with the same base44 tokens/classes. The nav is an `<OrderCartButton/>` (a clean order-**icon**
|
|
134
131
|
button with a live-count badge — render it as-is, don't wrap it in your own text button) + links to
|
|
135
132
|
`/menu` and `/reservations`:
|
|
@@ -229,9 +226,8 @@ Fallback only — when you hit an error or need something not shown here: read t
|
|
|
229
226
|
file under `src/`, or look it up via the **`wix-docs`** skill.
|
|
230
227
|
|
|
231
228
|
## Hard rules
|
|
232
|
-
- Set `WIX_CLIENT_ID` (STEP 2) — not the placeholder.
|
|
233
229
|
- Style via base44 design tokens (`index.css` / shadcn Tailwind classes), never by rewriting the shipped components or adding a parallel theme file.
|
|
234
|
-
- Header/footer live in a `Layout` around `<Outlet/>` (STEP
|
|
230
|
+
- Header/footer live in a `Layout` around `<Outlet/>` (STEP 3) — never edit the shipped `Menu`/`Reservations` to add chrome.
|
|
235
231
|
- The Layout's fixed top region owns positioning: `<WixManageBanner/>` above `<Header/>`; your `Header` is plain in-flow markup (not `position:fixed`).
|
|
236
232
|
- Order through the shipped cart: `addItem()` → `checkout()` (redirect-session) — never a hand-built `/checkout`, ordering, or reservation URL.
|
|
237
233
|
- Reservations: offer only `AVAILABLE` slots; pass the hold's `revision` into reserve; `firstName` + `phone` (E.164) are mandatory.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Preview-only banner linking the running app to its Wix Business Manager (the back office).
|
|
2
2
|
// Renders while the app is previewed or run locally, never on the published site, and is
|
|
3
3
|
// dismissible (persisted per site).
|
|
4
|
-
// Mount it at the top of your Layout's fixed region, ABOVE <Header/> (see INSTRUCTIONS STEP
|
|
4
|
+
// Mount it at the top of your Layout's fixed region, ABOVE <Header/> (see INSTRUCTIONS STEP 3) —
|
|
5
5
|
// banner + header ride together as one fixed block, so nothing drifts or gaps on scroll.
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { WIX_METASITE_ID } from "@/rest/wix-config";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
// Wix credentials
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// Wix credentials. The install step writes this file: deploy.cjs --client-id … --metasite-id …
|
|
2
|
+
// If you're seeing the placeholders below, re-run that command with the ids from the prompt rather
|
|
3
|
+
// than typing them in here.
|
|
4
|
+
// Safe to commit: WIX_CLIENT_ID is a public, buyer-facing id (it only mints anonymous visitor
|
|
5
|
+
// tokens); WIX_METASITE_ID just identifies the site.
|
|
4
6
|
// wix-client.js and wix-manage-banner.js read their ids from here.
|
|
5
7
|
export const WIX_CLIENT_ID = "<YOUR-CLIENT-ID>";
|
|
6
8
|
export const WIX_METASITE_ID = "<YOUR-METASITE-ID>";
|
|
@@ -30,9 +30,9 @@ so you don't need to open them:**
|
|
|
30
30
|
| `components/CartButton.jsx` | header cart **icon** button with a live-count badge |
|
|
31
31
|
| `components/CartDrawer.jsx` | slide-over cart (mount once; opens from `useCart`) |
|
|
32
32
|
| `components/VariantPicker.jsx` | option/variant selector used on the PDP — colour options render as real swatches, and picking one moves the gallery to that colour's photo |
|
|
33
|
-
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP
|
|
33
|
+
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP 3) |
|
|
34
34
|
| `pages/Shop.jsx`, `pages/ProductDetail.jsx` | the two shipped routes (`/shop`, `/product/:slug`) |
|
|
35
|
-
| `rest/wix-config.js` |
|
|
35
|
+
| `rest/wix-config.js` | the two ids, written by the install step |
|
|
36
36
|
| `rest/wix-client.js` + `rest/wix-store-*.js` | REST transport + catalog/cart helpers |
|
|
37
37
|
|
|
38
38
|
They're already in place — go **straight to theming + wiring**, nothing to verify first. **Don't
|
|
@@ -42,11 +42,8 @@ real fallback — a runtime error, or a field the snippets don't cover (see "Fal
|
|
|
42
42
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
43
43
|
`references/storefront/app/` → `src/`.)
|
|
44
44
|
|
|
45
|
-
## STEP 2 — Credentials
|
|
46
|
-
Write `src/rest/wix-config.js` with your `WIX_CLIENT_ID` and `WIX_METASITE_ID` from the prompt — the
|
|
47
|
-
one place both ids live.
|
|
48
45
|
|
|
49
|
-
## STEP
|
|
46
|
+
## STEP 2 — Theme (nothing to style on the shipped components)
|
|
50
47
|
The shipped components carry **no palette of their own** — they render from base44's design tokens
|
|
51
48
|
in `src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `--primary`,
|
|
52
49
|
`--muted`, `--border`, `--radius`, `--font-*`) via shadcn Tailwind classes (`bg-card`,
|
|
@@ -54,10 +51,10 @@ in `src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `
|
|
|
54
51
|
`font-display`). Those tokens are **already set to the brand by the design phase**, so the shipped
|
|
55
52
|
pages are themed with zero work here. To adjust the palette, edit `index.css` (`:root` **and**
|
|
56
53
|
`.dark`) — the base44 way; **never add a parallel theme file (e.g. a `theme.css`) or restyle the
|
|
57
|
-
shipped JSX.** Build the Home/Header you add (STEP
|
|
54
|
+
shipped JSX.** Build the Home/Header you add (STEP 3) from the **same** base44 tokens/classes so it
|
|
58
55
|
matches automatically. A dark brand is just base44's dark palette in `index.css` — no per-component work.
|
|
59
56
|
|
|
60
|
-
## STEP
|
|
57
|
+
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
61
58
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
62
59
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
63
60
|
replace it.
|
|
@@ -120,7 +117,7 @@ function Layout() {
|
|
|
120
117
|
|
|
121
118
|
## What you build (not shipped)
|
|
122
119
|
The **home / landing page**, the **`Header`** (mount `<CartButton/>` in it) and a **`Footer`** — the
|
|
123
|
-
two you drop into the `Layout` (STEP
|
|
120
|
+
two you drop into the `Layout` (STEP 3) so they wrap every route — plus the overall brand story,
|
|
124
121
|
styled from the same base44 tokens/classes. **Compose the shipped pieces** — a
|
|
125
122
|
featured strip is just `queryProducts` + the shipped `ProductGrid`; the nav is a `<CartButton/>`
|
|
126
123
|
(a clean cart-**icon** button with a live-count badge — render it as-is, don't wrap it in your own
|
|
@@ -243,9 +240,8 @@ reference page inline; these are the areas they sit in:
|
|
|
243
240
|
- Headless redirect session (hosted checkout): https://dev.wix.com/docs/api-reference/business-management/headless/redirects.md
|
|
244
241
|
|
|
245
242
|
## Hard rules
|
|
246
|
-
- Set `WIX_CLIENT_ID` (STEP 2) — not the placeholder.
|
|
247
243
|
- Style via base44 design tokens (`index.css` / shadcn Tailwind classes), never by rewriting the shipped components or adding a parallel theme file.
|
|
248
|
-
- Header/footer live in a `Layout` around `<Outlet/>` (STEP
|
|
244
|
+
- Header/footer live in a `Layout` around `<Outlet/>` (STEP 3) — never edit the shipped `Shop`/`ProductDetail` to add chrome.
|
|
249
245
|
- The Layout's fixed top region owns positioning: `<WixManageBanner/>` above `<Header/>`; your `Header` is plain in-flow markup (not `position:fixed`).
|
|
250
246
|
- Checkout goes through the shipped cart (redirect-session) — never a hand-built `/checkout` URL.
|
|
251
247
|
- Render live Wix data or the shipped empty state — never mock products.
|
|
@@ -82,14 +82,51 @@ async function waitForCatalogV3(ctx, { attempts = 40, delayMs = 2000 } = {}) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
//
|
|
85
|
+
// description string -> Wix rich-text node tree.
|
|
86
|
+
//
|
|
87
|
+
// Descriptions arrive as HTML as often as not: asked to describe a product, a model writes
|
|
88
|
+
// <p>…</p><strong>Care:</strong><br/>. The writable field is `description` (Ricos nodes) — the HTML
|
|
89
|
+
// `plainDescription` the storefront renders is read-only, derived from them. So markup dropped into
|
|
90
|
+
// a single TEXT node is stored as literal text, comes back escaped, and the PDP shows the tags to
|
|
91
|
+
// the buyer. Convert the tags a model actually emits; a string with no tags stays one paragraph.
|
|
92
|
+
const HTML_ENTITIES = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'", " ": " " };
|
|
93
|
+
|
|
94
|
+
function decodeEntities(s) {
|
|
95
|
+
return s.replace(/&(?:amp|lt|gt|quot|#39|nbsp);/g, (m) => HTML_ENTITIES[m] ?? m);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// One paragraph's inner HTML -> TEXT nodes, carrying bold/italic as Ricos decorations.
|
|
99
|
+
function mkTextNodes(html) {
|
|
100
|
+
const nodes = [];
|
|
101
|
+
let bold = 0, italic = 0, last = 0, m;
|
|
102
|
+
const tag = /<(\/?)(strong|b|em|i)\s*\/?>/gi;
|
|
103
|
+
const push = (raw) => {
|
|
104
|
+
const text = decodeEntities(raw.replace(/<[^>]*>/g, ""));
|
|
105
|
+
if (!text) return;
|
|
106
|
+
const decorations = [];
|
|
107
|
+
if (bold > 0) decorations.push({ type: "BOLD" });
|
|
108
|
+
if (italic > 0) decorations.push({ type: "ITALIC" });
|
|
109
|
+
nodes.push({ type: "TEXT", textData: { text, decorations } });
|
|
110
|
+
};
|
|
111
|
+
while ((m = tag.exec(html)) !== null) {
|
|
112
|
+
push(html.slice(last, m.index));
|
|
113
|
+
const step = m[1] ? -1 : 1;
|
|
114
|
+
if (/^(strong|b)$/i.test(m[2])) bold = Math.max(0, bold + step);
|
|
115
|
+
else italic = Math.max(0, italic + step);
|
|
116
|
+
last = tag.lastIndex;
|
|
117
|
+
}
|
|
118
|
+
push(html.slice(last));
|
|
119
|
+
return nodes.length ? nodes : [{ type: "TEXT", textData: { text: "", decorations: [] } }];
|
|
120
|
+
}
|
|
121
|
+
|
|
86
122
|
function mkDesc(text, i) {
|
|
123
|
+
const blocks = String(text ?? "").split(/<\/p\s*>|<br\s*\/?>/i).map((b) => b.trim()).filter(Boolean);
|
|
87
124
|
return {
|
|
88
|
-
nodes: [{
|
|
89
|
-
type: "PARAGRAPH", id: `desc-${i}`,
|
|
90
|
-
nodes:
|
|
125
|
+
nodes: (blocks.length ? blocks : [""]).map((block, n) => ({
|
|
126
|
+
type: "PARAGRAPH", id: `desc-${i}-${n}`,
|
|
127
|
+
nodes: mkTextNodes(block),
|
|
91
128
|
paragraphData: { textStyle: { textAlignment: "AUTO" } },
|
|
92
|
-
}
|
|
129
|
+
})),
|
|
93
130
|
metadata: { version: 1, id: `desc-meta-${i}` },
|
|
94
131
|
};
|
|
95
132
|
}
|
|
@@ -157,6 +194,8 @@ async function listProducts(ctx) {
|
|
|
157
194
|
* Bulk-create products.
|
|
158
195
|
* @param products [{ name, description, price, compareAtPrice?, quantity,
|
|
159
196
|
* options?: [{ name, type?:"text"|"color", choices:["8","9"] | [{name,colorCode}] }] }]
|
|
197
|
+
* description: plain text, or simple HTML (`<p>`, `<br/>`, `<strong>`, `<em>`) — converted to
|
|
198
|
+
* Wix rich text here, so the storefront renders paragraphs and bold rather than tag text.
|
|
160
199
|
* options = ONLY things the buyer selects-and-buys (Size, Color) -> become variants.
|
|
161
200
|
* Display-only attributes go in name/category/description, NOT options. Default: no options.
|
|
162
201
|
* visible/physicalProperties/variant-expansion handled here. `quantity` is the stock created.
|