@appdirect/sfb-toolkit 5.0.9 → 6.0.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/.eslintrc +35 -35
- package/CHANGELOG.md +45 -0
- package/Dockerfile +2 -1
- package/agent/.cursor/rules/sfb-storefront.mdc +18 -0
- package/agent/.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md +130 -0
- package/agent/.cursor/skills/sfb-custom-components/SKILL.md +44 -0
- package/agent/.cursor/skills/sfb-localization-settings/SKILL.md +99 -0
- package/agent/.cursor/skills/sfb-theme-customize/SKILL.md +25 -0
- package/agent/.cursor/skills/sfb-toolkit-commands/SKILL.md +35 -0
- package/agent/AGENTS.md +222 -0
- package/agent/CLAUDE.md +20 -0
- package/bin/index.js +82 -100
- package/coverage/clover.xml +1937 -333
- package/coverage/coverage-final.json +41 -20
- package/coverage/lcov-report/{controllers/controllers-utils → config}/index.html +19 -19
- package/coverage/lcov-report/config/index.js.html +124 -0
- package/coverage/lcov-report/index.html +108 -78
- package/coverage/lcov-report/{constants → src/constants}/customUserAttributesMock.js.html +12 -12
- package/coverage/lcov-report/{constants → src/constants}/index.html +10 -10
- package/coverage/lcov-report/{constants → src/constants}/pageUrls.js.html +14 -14
- package/coverage/lcov-report/{constants → src/constants}/userMock.js.html +13 -13
- package/coverage/lcov-report/{controllers → src/controllers}/controllers-utils/assetsUtils.js.html +20 -20
- package/coverage/lcov-report/src/controllers/controllers-utils/index.html +131 -0
- package/coverage/lcov-report/src/controllers/controllers-utils/locale.js.html +115 -0
- package/coverage/lcov-report/{controllers → src/controllers}/data-filters/bootstrap-data-filter.js.html +15 -15
- package/coverage/lcov-report/{controllers → src/controllers}/data-filters/call-to-actions-filter.js.html +22 -22
- package/coverage/lcov-report/{controllers → src/controllers}/data-filters/index.html +37 -22
- package/coverage/lcov-report/src/controllers/data-filters/media-url-filter.js.html +394 -0
- package/coverage/lcov-report/{controllers → src/controllers}/index.html +27 -27
- package/coverage/lcov-report/{controllers → src/controllers}/index.js.html +159 -126
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/ResultItem.js.html +43 -43
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/SearchBar.js.html +22 -22
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/index.html +28 -28
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/item.js.html +28 -28
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/container.js.html +31 -31
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/data-view.js.html +29 -29
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/header-view.js.html +35 -38
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/index.html +45 -45
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/search.js.html +54 -54
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/index.html +22 -22
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/pageUrl.js.html +17 -17
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/roleType.js.html +14 -14
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/searchType.js.html +17 -17
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/utils/debounce.js.html +15 -15
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/utils/index.html +20 -20
- package/coverage/lcov-report/{middlewares → src/middlewares}/config.js.html +11 -11
- package/coverage/lcov-report/{middlewares → src/middlewares}/index.html +10 -10
- package/coverage/lcov-report/{tools → src/routes}/index.html +30 -30
- package/coverage/lcov-report/src/routes/media-proxy.js.html +613 -0
- package/coverage/lcov-report/src/tools/compile-styles.js.html +1018 -0
- package/coverage/lcov-report/src/tools/custom-components-export-compat-loader.js.html +745 -0
- package/coverage/lcov-report/src/tools/index.html +371 -0
- package/coverage/lcov-report/src/tools/prompt-questions.js.html +1117 -0
- package/coverage/lcov-report/{tools → src/tools}/proxy-fetch.js.html +15 -15
- package/coverage/lcov-report/src/tools/resolve-components-react.js.html +457 -0
- package/coverage/lcov-report/src/tools/sass-legacy-compat.js.html +1192 -0
- package/coverage/lcov-report/src/tools/toolkit-cli-argv.js.html +226 -0
- package/coverage/lcov-report/src/tools/toolkit-common-fun.js.html +1402 -0
- package/coverage/lcov-report/src/tools/toolkit-common-vars-namespace.js.html +403 -0
- package/coverage/lcov-report/src/tools/toolkit-common-vars.js.html +283 -0
- package/coverage/lcov-report/src/tools/toolkit-components-fun.js.html +1237 -0
- package/coverage/lcov-report/src/tools/toolkit-components-vars.js.html +232 -0
- package/coverage/lcov-report/src/tools/toolkit-install-agent-guidance.js.html +439 -0
- package/coverage/lcov-report/src/tools/toolkit-live-reload.js.html +688 -0
- package/coverage/lcov-report/src/tools/toolkit-path.js.html +184 -0
- package/coverage/lcov-report/src/tools/toolkit-spawn.js.html +199 -0
- package/coverage/lcov-report/src/tools/toolkit-v6-theme-risk.js.html +1039 -0
- package/coverage/lcov-report/src/tools/toolkit-zip-utils.js.html +190 -0
- package/coverage/lcov.info +3387 -727
- package/index.js +40 -20
- package/npm-shrinkwrap.json +5026 -15490
- package/package.json +49 -40
- package/readme.md +20 -1
- package/rspack-components.config.cjs +81 -0
- package/rspack-components.config.prod.cjs +71 -0
- package/rspack.config.cjs +25 -0
- package/rspack.shared.cjs +164 -0
- package/src/controllers/controllers-utils/locale.js +10 -0
- package/src/controllers/data-filters/media-url-filter.js +103 -0
- package/src/controllers/index.js +15 -4
- package/src/front-end-utils/dist/toolbar.bundle.js +1 -2
- package/src/front-end-utils/src/components/header-view.js +0 -1
- package/src/routes/index.js +2 -0
- package/src/routes/media-proxy.js +176 -0
- package/src/tools/compile-styles.js +311 -0
- package/src/tools/compiler-components-prod.js +32 -21
- package/src/tools/compiler-css.js +7 -7
- package/src/tools/custom-components-export-compat-loader.js +220 -0
- package/src/tools/resolve-components-react.js +124 -0
- package/src/tools/sass-legacy-compat.js +369 -0
- package/src/tools/toolkit-checkout.js +3 -6
- package/src/tools/toolkit-cli-argv.js +47 -0
- package/src/tools/toolkit-common-fun.js +149 -31
- package/src/tools/toolkit-common-utils.js +5 -3
- package/src/tools/toolkit-common-vars.js +4 -3
- package/src/tools/toolkit-components-copy.js +6 -4
- package/src/tools/toolkit-components-fun.js +6 -4
- package/src/tools/toolkit-config-setup.js +2 -1
- package/src/tools/toolkit-create.js +5 -7
- package/src/tools/toolkit-import.js +5 -6
- package/src/tools/toolkit-install-agent-guidance-cli.js +24 -0
- package/src/tools/toolkit-install-agent-guidance.js +118 -0
- package/src/tools/toolkit-install.js +8 -8
- package/src/tools/toolkit-live-reload.js +201 -0
- package/src/tools/toolkit-package.js +25 -7
- package/src/tools/toolkit-path.js +33 -0
- package/src/tools/toolkit-setup-e2e.js +2 -1
- package/src/tools/toolkit-setup.js +5 -1
- package/src/tools/toolkit-spawn.js +38 -0
- package/src/tools/toolkit-start.js +98 -54
- package/src/tools/toolkit-storybook.js +38 -19
- package/src/tools/toolkit-update.js +5 -3
- package/src/tools/toolkit-v6-theme-risk.js +318 -0
- package/themes-param.json +1 -0
- package/src/front-end-utils/dist/toolbar.bundle.js.LICENSE.txt +0 -52
- package/src/tools/gulp-tasks.js +0 -80
- package/webpack-components.config.cjs +0 -123
- package/webpack-components.config.prod.cjs +0 -113
- package/webpack.config.cjs +0 -25
package/.eslintrc
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"env": {
|
|
14
|
-
"es6": true,
|
|
15
|
-
"browser": true
|
|
16
|
-
},
|
|
17
|
-
"plugins": [
|
|
18
|
-
"prettier"
|
|
19
|
-
],
|
|
20
|
-
"parser": "babel-eslint",
|
|
21
|
-
"rules": {
|
|
22
|
-
"prettier/prettier": 2,
|
|
23
|
-
"strict": [
|
|
24
|
-
2,
|
|
25
|
-
"global"
|
|
26
|
-
],
|
|
27
|
-
"max-len": 0,
|
|
28
|
-
"no-nested-ternary": 0,
|
|
29
|
-
"no-underscore-dangle": 0,
|
|
30
|
-
"global-require": 0,
|
|
31
|
-
"react/prefer-stateless-function": 0,
|
|
32
|
-
"react/jsx-filename-extension": 0,
|
|
33
|
-
"no-invalid-regexp": 0,
|
|
34
|
-
"no-console": 0,
|
|
35
|
-
"import/no-unresolved": 0
|
|
2
|
+
"extends": [
|
|
3
|
+
"airbnb",
|
|
4
|
+
"prettier"
|
|
5
|
+
],
|
|
6
|
+
"parserOptions": {
|
|
7
|
+
"ecmaVersion": "latest",
|
|
8
|
+
"sourceType": "module",
|
|
9
|
+
"ecmaFeatures": {
|
|
10
|
+
"jsx": true
|
|
36
11
|
}
|
|
12
|
+
},
|
|
13
|
+
"env": {
|
|
14
|
+
"es6": true,
|
|
15
|
+
"browser": true,
|
|
16
|
+
"jest": true,
|
|
17
|
+
"node": true
|
|
18
|
+
},
|
|
19
|
+
"plugins": [
|
|
20
|
+
"prettier"
|
|
21
|
+
],
|
|
22
|
+
"rules": {
|
|
23
|
+
"prettier/prettier": 2,
|
|
24
|
+
"strict": [
|
|
25
|
+
2,
|
|
26
|
+
"global"
|
|
27
|
+
],
|
|
28
|
+
"max-len": 0,
|
|
29
|
+
"no-nested-ternary": 0,
|
|
30
|
+
"no-underscore-dangle": 0,
|
|
31
|
+
"global-require": 0,
|
|
32
|
+
"react/prefer-stateless-function": 0,
|
|
33
|
+
"react/jsx-filename-extension": 0,
|
|
34
|
+
"no-invalid-regexp": 0,
|
|
35
|
+
"no-console": 0,
|
|
36
|
+
"import/no-unresolved": 0
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 6.0.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- Custom-components metadata no longer prepends free-floating `data-custom-components-*` attributes into `base.html` when `<ad-theme>` / `data-sfb-theme-components-version` is missing; inserts or repairs a full `<ad-theme>` block instead (and strips corrupt leading attrs from older toolkit bugs)
|
|
8
|
+
|
|
9
|
+
### AI agent guidance
|
|
10
|
+
|
|
11
|
+
- Hard rule: **all user-facing text must be localized** (never hardcode copy only in JSX, Nunjucks, or bare `settings.json` values)
|
|
12
|
+
- Check the **current preview locale** first (URL `/en-US/…` → usually `translations/en-us.yml`)
|
|
13
|
+
- Documented outside-`settings.json` localization from storefront docs: Nunjucks `{{ t(i18n.custom…) }}` / `formatMessage`, and `i18n.overrides` for page-api labels / CTA `actionType`s
|
|
14
|
+
- Refresh in existing workspaces with `sfb-toolkit install-agent-guidance`
|
|
15
|
+
|
|
16
|
+
## 6.0.0
|
|
17
|
+
|
|
18
|
+
### Upgrade notice
|
|
19
|
+
|
|
20
|
+
Version 6 replaces the **entire** local tooling stack used to build themes (bundler + Sass compiler), not just dependencies. Requires Node >=22.12.0.
|
|
21
|
+
|
|
22
|
+
### AI agent guidance
|
|
23
|
+
|
|
24
|
+
`sfb-toolkit setup` installs self-contained workspace `AGENTS.md` / `CLAUDE.md` plus Cursor (`.cursor/`) and Claude Code (`.claude/skills/`) playbooks covering toolkit commands, theme DOM/CSS limits, custom-components setup (`sfb-toolkit components` first), localization layers, and `settings.json` / `window.__ADComponents.schema()` contracts. Existing workspaces: `sfb-toolkit install-agent-guidance` (backs up existing `AGENTS.md` / `CLAUDE.md` before overwrite).
|
|
25
|
+
|
|
26
|
+
We thoroughly tested this upgrade and added compatibility for common legacy theme patterns, but every customized theme can differ. Themes built or last verified on toolkit 5.x or earlier **must be thoroughly checked** (pages, custom CSS/Sass, custom components, package zip) before you publish with version 6. New themes on current Plaza + current `@appdirect/sfb-theme-components` do not need this extra review for the toolchain change itself. To stay on or revert to toolkit 5.x: `npm install -g @appdirect/sfb-toolkit@5`.
|
|
27
|
+
|
|
28
|
+
Modernized the toolkit build toolchain so everyday theme work feels faster — especially custom-components compiles and theme HMR.
|
|
29
|
+
|
|
30
|
+
- Replaced the legacy Webpack / gulp Sass stack with a newer bundler and Sass compiler
|
|
31
|
+
- Custom components production compile much faster (local Plaza compare ~12.7s → ~1.4s, about **9×**)
|
|
32
|
+
- Quicker theme CSS rebuilds and custom-components HMR while `sfb-toolkit start` is running
|
|
33
|
+
- End-to-end packaging / CLI flows also faster (about **3×** in local comparison)
|
|
34
|
+
- Requires Node >=22.12.0 (6.x.x)
|
|
35
|
+
- Sass compat for published themes that still rely on libsass/gulp-sass quirks (entry load paths, non-CSS `@import`, top-level `&`, compound `@extend`)
|
|
36
|
+
- Custom-components barrels with conflicting `export *` (theme overrides + library) compile under Rspack the way they did under Webpack; bare side-effect imports from those barrels (e.g. Bootstrap CSS) are preserved when the star export is expanded
|
|
37
|
+
- Component Sass resolves cwd-relative `@import 'themes/<name>/…'` and SCSS-in-`.css` like the old stack
|
|
38
|
+
- Missing ESM exports (e.g. hoisted `react-tooltip`) warn instead of hard-failing with a Rspack overlay, matching Webpack 5
|
|
39
|
+
- Provide `_` (lodash) in the custom-components bundle for themes that call `_.debounce` etc. without importing it
|
|
40
|
+
- Install AI agent guidance (`AGENTS.md`, `CLAUDE.md`, Cursor skills) on `sfb-toolkit setup`, or via `sfb-toolkit install-agent-guidance`
|
|
41
|
+
- Opt-in preview live-reload for app-builder iframes: `sfb-toolkit start --live-reload` or `SFB_TOOLKIT_LIVE_RELOAD=1` (off by default; SSE `/__sfb_live_reload`)
|
|
42
|
+
|
|
43
|
+
## 5.0.x
|
|
44
|
+
|
|
45
|
+
See git tags `v5.0.0`–`v5.0.9` for prior patch releases.
|
package/Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM node:
|
|
1
|
+
FROM node:24
|
|
2
2
|
|
|
3
3
|
ENV NO_UPDATE_NOTIFIER=true
|
|
4
4
|
ENV SFB_TOOLKIT=/app/bin/index.js
|
|
@@ -22,5 +22,6 @@ WORKDIR /app/Plaza
|
|
|
22
22
|
|
|
23
23
|
RUN $SFB_TOOLKIT use-local-sfb-components
|
|
24
24
|
|
|
25
|
+
ENV HOST=0.0.0.0
|
|
25
26
|
EXPOSE 3555
|
|
26
27
|
ENTRYPOINT ["sh", "/app/commands.sh"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Storefront Builder theme workspace constraints for AI agents
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SFB theme workspace
|
|
7
|
+
|
|
8
|
+
- Follow root `AGENTS.md` (self-contained). Do not depend on external doc URLs for core workflows.
|
|
9
|
+
- Plaza UI is React (`sfb-theme-components` / `customComponents`), not static HTML in page Nunjucks. Inspect the live DOM after `sfb-toolkit start` before writing CSS selectors (or ask the human for a snapshot).
|
|
10
|
+
- Edit theme **SCSS / Sass**. Do not edit generated `.css` files (toolkit overwrites them).
|
|
11
|
+
- Preserve element structure and ABEM classnames; prefer additive styles.
|
|
12
|
+
- If `themes/<active>/customComponents/` is missing, run `sfb-toolkit components` before `components-add` or `components-copy`.
|
|
13
|
+
- For `components-copy`, use `.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md`, then confirm on the theme. Prefer CSS/settings/`components-add`; ask if no catalog match. No interactive no-args copy.
|
|
14
|
+
- Before editing `settings.json`, call `window.__ADComponents.<Name>.schema()` in the browser (or ask the human for the output). Never invent setting keys/types.
|
|
15
|
+
- **All user-facing text must be localized** (React/JSX, Nunjucks, schema/`settings.json` inputs, CTA/label overrides). Put strings in theme localization YAML for the **current preview locale** (URL `/en-US/…` → usually `translations/en-us.yml`). Settings → `isLocalized: true`; templates → `{{ t(i18n.custom…) }}` / `formatMessage`; page-api labels/CTAs → `i18n.overrides`. Never hardcode display copy only in source or settings.
|
|
16
|
+
- Prefer `sfb-toolkit package -a` after translation/settings changes.
|
|
17
|
+
- Keep `Component.schema().name`, exports, `<component name>`, and `window.__ADComponents` keys aligned.
|
|
18
|
+
- Localized settings store **keys** (`isLocalized: true`); strings live in `translations/*.yml`.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# `@appdirect/sfb-theme-components` catalog
|
|
2
|
+
|
|
3
|
+
Use **Export** as the `sfb-toolkit components-copy` argument and as `<component name="…">` / `window.__ADComponents` key (unless noted).
|
|
4
|
+
|
|
5
|
+
Prefer theme **SCSS** or **settings.json** (via `schema()`) before forking. Fork only when you must change React structure/behavior.
|
|
6
|
+
|
|
7
|
+
**Not copyable via toolkit:** `PageOrderableContainer` (blacklisted).
|
|
8
|
+
|
|
9
|
+
**Listing copy group:** selecting any of `ProductListing`, `ProductListingControls`, `CategorySidebar` also copies the other two (toolkit behavior).
|
|
10
|
+
|
|
11
|
+
**Header atoms:** high risk — tightly coupled; prefer CSS on Header unless the human names a bar.
|
|
12
|
+
|
|
13
|
+
Editor titles below match Theme Editor labels (`storefront-ipa-uieditor`).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Shell / layout (every page)
|
|
18
|
+
|
|
19
|
+
| Export | Editor title | What it does | Typical placement |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| `Header` | Header | Top chrome; composes announcement / home / nav / aux bars | layout / global |
|
|
22
|
+
| `Footer` | Footer | Site footer (links, newsletter, legal) | layout / global |
|
|
23
|
+
| `GlobalAlerts` | Global alerts | Marketplace-wide alert banners | layout |
|
|
24
|
+
| `SecondaryNav` | Secondary navigation | Secondary menu | secondary nav regions |
|
|
25
|
+
| `PageOrderableContainer` | — | Hosts orderable sections from Theme Editor | home (and similar); **do not copy** |
|
|
26
|
+
| `StickyButtonPageScroll` | Page Scroll Button | Floating scroll / CTA button | often home |
|
|
27
|
+
|
|
28
|
+
### Header atoms (fork only if explicitly required)
|
|
29
|
+
|
|
30
|
+
| Export | Editor title | What it does |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `HeaderAnnouncementBar` | Announcement Bar | Promo / message strip above header |
|
|
33
|
+
| `HeaderHomeBar` | Home Bar | Logo, search slot, account / cart actions |
|
|
34
|
+
| `HeaderNavigationBar` | Navigation Bar | Primary nav / hamburger |
|
|
35
|
+
| `HeaderAuxiliaryBar` | Auxiliary Bar | Extra utility row |
|
|
36
|
+
| `HeaderSearchBar` | Search | Search field (used inside header) |
|
|
37
|
+
| `HeaderCategoriesMenu` | Categories | Category mega-menu |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Home / marketing (often orderable on home)
|
|
42
|
+
|
|
43
|
+
| Export | Editor title | What it does | Notes |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `HeroBanner` | Hero Banner | Large hero with title, CTA, media | orderable: home |
|
|
46
|
+
| `Carousel` | Carousel | Multi-slide hero/carousel | orderable: home |
|
|
47
|
+
| `Slider` | Slider | Product / content slider | orderable: home |
|
|
48
|
+
| `FeaturedProduct` | Featured Product | Spotlight a single product | orderable: home |
|
|
49
|
+
| `ProductGroups` | Product Groups | Tabbed / grouped product collections | orderable: home |
|
|
50
|
+
| `AtomsShowcase` | Atoms showcase | Demo / showcase of UI atoms | rarely customized in production |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Browse / listing
|
|
55
|
+
|
|
56
|
+
| Export | Editor title | What it does | Notes |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| `ProductListing` | Product listing | Product grid/list results | listing page; **copy group** |
|
|
59
|
+
| `ProductListingControls` | Title and sorting | Listing title + sort/filter controls | listing; **copy group** |
|
|
60
|
+
| `CategorySidebar` | Category sidebar | Category tree / filters | listing; **copy group** |
|
|
61
|
+
| `ComparableProducts` | Comparable products | Compare-products UI | compare page |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Product profile
|
|
66
|
+
|
|
67
|
+
| Export | Editor title | What it does | Notes |
|
|
68
|
+
|---|---|---|---|
|
|
69
|
+
| `ProductBanner` | Product banner | Product hero (name, icon, CTA, rating) | profile shell |
|
|
70
|
+
| `ProductTabMenu` | Product page tabs | Section tabs on product pages | orderable: profile |
|
|
71
|
+
| `ProductDescription` | Product description | Overview / rich description + media | orderable: profile |
|
|
72
|
+
| `ProductImageViewer` | Image viewer | Gallery / screenshots | profile |
|
|
73
|
+
| `ProductTopFeatures` | Product top features | Highlighted feature list | orderable: profile |
|
|
74
|
+
| `FeatureDetails` | Product feature details | Detailed features section | profile features |
|
|
75
|
+
| `FeaturedCustomers` | Product featured customers | Customer logos / quotes | orderable: profile |
|
|
76
|
+
| `ProductAdditionalInfo` | Product additional info | Extra info blocks | orderable: profile |
|
|
77
|
+
| `ProductResources` | Product resources | Downloads / docs links | orderable: profile |
|
|
78
|
+
| `ProductPricing` | Product pricing | Editions / pricing table | profile editions |
|
|
79
|
+
| `ProductPlan` | Product plan | Plan selection UI | profile |
|
|
80
|
+
| `ProductConfigurator` | Product configurator | Configure options (v1) | profile configure |
|
|
81
|
+
| `ProductConfiguratorV2` | Product configurator | Configure options (v2) | prefer over v1 when present |
|
|
82
|
+
| `ProductVariants` | Product variants | Variant picker | profile variants |
|
|
83
|
+
| `ProductQuestions` | Product question | Q&A list | orderable: profile |
|
|
84
|
+
| `ProductQuestionForm` | Product question form | Ask a question form | add-question page |
|
|
85
|
+
| `ProductReviews` | Product reviews | Reviews list/adapter | profile reviews |
|
|
86
|
+
| `ProductReviewDetail` | Product review detail | Single review detail | reviews |
|
|
87
|
+
| `ProductReviewForm` | Product review form | Write a review | add-review page |
|
|
88
|
+
| `ProductLeadForm` | Product lead form | Lead / contact form | add-lead page |
|
|
89
|
+
| `ProductSimilarApps` | Product similar apps | Similar products rail | profile footer area |
|
|
90
|
+
| `ProductBundles` | Product bundle viewer | Bundles that include this product | profile / bundle contexts |
|
|
91
|
+
| `VolumeDiscountCard` | — | Volume discount presentation | editions (with pricing) |
|
|
92
|
+
| `GraphQLAdapter` | — | Data adapter helper for GraphQL-backed UI | infrastructure; avoid forking |
|
|
93
|
+
| `DomainApp` | Domain App | Standalone domains purchase UI | domains product section |
|
|
94
|
+
| `ProductAssociatedDomain` | — | Associated domain management | cross-sell / domains |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Bundle page
|
|
99
|
+
|
|
100
|
+
| Export | Editor title | What it does |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `BundleBanner` | Bundle banner | Bundle hero (like ProductBanner for bundles) |
|
|
103
|
+
| `BundleTabsMenu` | Bundle Page Tabs | Tabs on bundle page (`schema().name` may be `BundleTabMenu`) |
|
|
104
|
+
| `ProductBundleViewer` | Product description | Bundle overview / included products narrative |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Help / FAQ
|
|
109
|
+
|
|
110
|
+
| Export | Editor title | What it does | Notes |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| `Faq` | FAQs | FAQ accordion | help page; `schema().name` is `FAQ` — keep export/`<component name>` as `Faq` |
|
|
113
|
+
| `LinkSection` | Link section | Related links block | often with FAQ |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Checkout / confirmation
|
|
118
|
+
|
|
119
|
+
| Export | Editor title | What it does |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `OrderConfirmation` | Order confirmation | Post-purchase confirmation content |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## How to pick a copy target
|
|
126
|
+
|
|
127
|
+
1. Match the UI the human described to a row above (title + “what it does”).
|
|
128
|
+
2. Confirm it appears on the theme page (`content/pages/**` `<component name>`), in `settings.json`, or in `Object.keys(window.__ADComponents)`.
|
|
129
|
+
3. Run `sfb-toolkit components-copy <Export> -r` (or `-c` / `-s`). For listing, one of the three is enough to pull the group.
|
|
130
|
+
4. If nothing matches → **ask the human**; do not invent an export name.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-custom-components
|
|
3
|
+
description: Enable and build storefront custom React components with sfb-toolkit (setup first if customComponents is missing).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Custom components
|
|
7
|
+
|
|
8
|
+
## If `customComponents/` does not exist
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
sfb-toolkit components
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Pins `@appdirect/sfb-theme-components`, creates `customComponents/`, sets `settings-schema.json` `{ "useComponents": true }`, switches `base.html` off CDN bundles.
|
|
15
|
+
|
|
16
|
+
Without this, add/copy/local custom HMR do not apply.
|
|
17
|
+
|
|
18
|
+
## Then
|
|
19
|
+
|
|
20
|
+
| Goal | Command |
|
|
21
|
+
|---|---|
|
|
22
|
+
| New component | `sfb-toolkit components-add` (`-p`, `-o`; else prompts) |
|
|
23
|
+
| Fork library component | `sfb-toolkit components-copy <ExactExportName…> -r\|-c\|-s` |
|
|
24
|
+
| Audit overrides | `sfb-toolkit components-info` |
|
|
25
|
+
| Remove forks | `sfb-toolkit components-delete` |
|
|
26
|
+
|
|
27
|
+
### Which component to copy?
|
|
28
|
+
|
|
29
|
+
Use **[COMPONENT-CATALOG.md](COMPONENT-CATALOG.md)** — every copyable library **Export**, editor title, what it does, and typical page.
|
|
30
|
+
|
|
31
|
+
1. Match the task to a catalog row (title / description / page).
|
|
32
|
+
2. Confirm it exists on this theme (`<component name>`, `settings.json`, or `Object.keys(window.__ADComponents)`).
|
|
33
|
+
3. `sfb-toolkit components-copy <Export> -r|-c|-s` (listing trio copies together; never no-args interactive).
|
|
34
|
+
4. No match → ask the human. Prefer SCSS / settings / `components-add` when a fork is not required.
|
|
35
|
+
|
|
36
|
+
Edit under `themes/<name>/customComponents/`. Verify with `start`.
|
|
37
|
+
|
|
38
|
+
## Contracts
|
|
39
|
+
|
|
40
|
+
- `schema().name` === index export === `<component name>` === `window.__ADComponents` key
|
|
41
|
+
- **Before editing `settings.json`:** `window.__ADComponents.<Name>.schema()` in DevTools — use `form` for field names/types; never invent keys
|
|
42
|
+
- **All user-facing text must be localized** (including schema / settings titles, labels, buttons, and any JSX/Nunjucks copy) → `translations/<locale>.yml` for the **current preview locale** (usually `en-US` → `en-us.yml`); settings use `isLocalized: true`. See `sfb-localization-settings`.
|
|
43
|
+
- Orderable ids: `Name:orderable:<uuid>` in `settings.json`
|
|
44
|
+
- Overriding atoms/library comps is high risk — retest thoroughly
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-localization-settings
|
|
3
|
+
description: Wire storefront theme translations for settings.json, Nunjucks i18n.custom, and i18n.overrides. All user-facing text must be localized (usually en-us.yml for /en-US previews).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Localization + settings.json
|
|
7
|
+
|
|
8
|
+
## Hard rule: all user-facing text is localized
|
|
9
|
+
|
|
10
|
+
**Always localize.** Headings, labels, buttons, helper text, menus, empty states, errors, Nunjucks copy, and custom-component UI must live in theme localization YAML (or the correct i18n layer below) — never hardcoded only in React/JSX, Nunjucks, or bare `settings.json` strings.
|
|
11
|
+
|
|
12
|
+
That includes:
|
|
13
|
+
|
|
14
|
+
- Component editor inputs (`Component.schema().form` → `settings.json`)
|
|
15
|
+
- Theme templates / macros / includes (Nunjucks)
|
|
16
|
+
- CTA and page-api label overrides
|
|
17
|
+
|
|
18
|
+
Do **not** change only the string in `settings.json` or JSX and stop.
|
|
19
|
+
|
|
20
|
+
### Check the current locale first
|
|
21
|
+
|
|
22
|
+
1. Look at the preview URL: `http://localhost:<port>/<locale>/…` (e.g. `/en-US/home`).
|
|
23
|
+
2. Map to a file under `themes/<active>/translations/`: locale lowercased → `en-us.yml`, `fr-ca.yml`, …
|
|
24
|
+
3. **Usually the locale is `en-US`** → edit **`en-us.yml`**.
|
|
25
|
+
4. Add or update the translation key there; wire settings/templates to that key.
|
|
26
|
+
|
|
27
|
+
File rules: `themes/<themeName>/translations/<lang>-<country>.yml` (ISO 639-1 + ISO 3166-1). Per-theme only. YAML alone does **not** enable marketplace languages.
|
|
28
|
+
|
|
29
|
+
## 1) Schema / settings.json text
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
"title": {
|
|
33
|
+
"value": "uieditor.home.HeroBanner:orderable:<uuid>.title",
|
|
34
|
+
"isLocalized": true,
|
|
35
|
+
"type": "TEXT"
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
uieditor.home.HeroBanner:orderable:<uuid>.title: Find the tools your team already loves
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Reuse neighboring key shapes in the same YAML file.
|
|
44
|
+
|
|
45
|
+
## 2) Outside settings — Nunjucks (`i18n.custom`)
|
|
46
|
+
|
|
47
|
+
Theme-authored template strings use nested YAML and `i18n.custom.*`:
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
home:
|
|
51
|
+
welcome: Welcome my friend
|
|
52
|
+
startingat: The product {productName} costs {startingPrice}.
|
|
53
|
+
comments: Posted {num, plural, one{# comment} other{# comments}}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
{{ t(i18n.custom.home.welcome) }}
|
|
58
|
+
{{ formatMessage(t(i18n.custom.home.startingat), { productName: name, startingPrice: price }) }}
|
|
59
|
+
{{ formatMessage(t(i18n.custom.home.comments), { num: 2 }) }}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- All theme-sourced strings are under `i18n.custom…`
|
|
63
|
+
- Use `formatMessage` + ICU for variables and plurals (FormatJS)
|
|
64
|
+
|
|
65
|
+
## 3) Outside settings — label / CTA overrides (`i18n.overrides`)
|
|
66
|
+
|
|
67
|
+
Relabel page-api / Data Viewer i18n objects (Plaza) or CTA buttons (Plaza + Classic) via `i18n.overrides` in the locale YAML. Discover paths with the developer toolbar Data Viewer.
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
i18n.overrides:
|
|
71
|
+
application.overview.i18n.featuresAndBenefits: Top features
|
|
72
|
+
application.overview.callToActions.view.label: See More
|
|
73
|
+
application.callToActions.items.BUY: Purchase
|
|
74
|
+
application.editions.items.callToAction.BUY: Buy this edition
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For CTA lists keyed by `actionType`, drop the numeric index and use the uppercase type (`BUY`, `CONFIGURE`, …) instead of `.label`.
|
|
78
|
+
|
|
79
|
+
## Three i18n layers (do not mix)
|
|
80
|
+
|
|
81
|
+
1. **Theme YAML** — `translations/<lang>-<COUNTRY>.yml`: `uieditor…` / menus (settings), nested `i18n.custom` (Nunjucks), `i18n.overrides` (labels/CTAs).
|
|
82
|
+
2. **Schema / defaultValue keys** — `uieditor.sfbComponent.*` may appear as settings values pointing at UI-editor defaults. Customize with a theme YAML key + `isLocalized: true`.
|
|
83
|
+
3. **Nunjucks / page-api wiring** — `t` / `formatMessage`; page-api `i18n.*` overridable via `i18n.overrides`.
|
|
84
|
+
|
|
85
|
+
## settings.json contract
|
|
86
|
+
|
|
87
|
+
**Required first:**
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
window.__ADComponents.<Name>.schema()
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Use `form` field names + `type` / defaults from that object. Do not invent keys.
|
|
94
|
+
|
|
95
|
+
- Live values: `{ value, type }` under `pages.<page>.components`
|
|
96
|
+
- Text-like form fields → locale YAML + `isLocalized: true`
|
|
97
|
+
- Map keys must match the HTML `id` / `Name:orderable:<uuid>`
|
|
98
|
+
- `editor-properties.json` = style schema; `design-properties.json` = header/footer defaults
|
|
99
|
+
- Ship with `sfb-toolkit package -a` after edits
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-theme-customize
|
|
3
|
+
description: Apply a CSS/Sass coat of paint to a Plaza storefront theme using browser DOM inspection; avoid inventing HTML or classnames.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Theme CSS customization
|
|
7
|
+
|
|
8
|
+
## Reality
|
|
9
|
+
|
|
10
|
+
- Plaza pages place `<component>` / `PageOrderableContainer`; product UI HTML is **not** in those files.
|
|
11
|
+
- Markup is React on `window.__ADComponents`. Classnames are ABEM-generated.
|
|
12
|
+
- **Open the browser** after `sfb-toolkit start` and copy selectors from DevTools. If you cannot browse, ask the human for a DOM snapshot.
|
|
13
|
+
|
|
14
|
+
## Do
|
|
15
|
+
|
|
16
|
+
1. `sfb-toolkit start` → `http://localhost:<port>/en-US/<page>`
|
|
17
|
+
2. Inspect DOM / classes
|
|
18
|
+
3. Edit theme **SCSS** only (never generated `.css`)
|
|
19
|
+
4. Additive rules; keep structure/classnames
|
|
20
|
+
5. Confirm in browser → `sfb-toolkit package -a` when shipping
|
|
21
|
+
|
|
22
|
+
## Limits
|
|
23
|
+
|
|
24
|
+
- Header/footer platform tags and cart preview: CSS only after DOM inspection
|
|
25
|
+
- New behavior → custom-components skill, not CSS alone
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-toolkit-commands
|
|
3
|
+
description: Pick the correct sfb-toolkit CLI command for workspace, preview, package, and custom-components workflows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# sfb-toolkit commands
|
|
7
|
+
|
|
8
|
+
Run from the workspace root (`.sfbconfig` + `themes/`). Full table lives in root `AGENTS.md`.
|
|
9
|
+
|
|
10
|
+
## Project
|
|
11
|
+
|
|
12
|
+
- New workspace: `sfb-toolkit setup [name]` (also installs AI guidance)
|
|
13
|
+
- New theme: `sfb-toolkit create [name]`
|
|
14
|
+
- Import zip: `sfb-toolkit import [zip] [marketplaceUrl] [themeName]`
|
|
15
|
+
- Switch theme: `sfb-toolkit checkout [name]`
|
|
16
|
+
- List / config: `about`, `status`, `update`, `version`
|
|
17
|
+
|
|
18
|
+
## Dev / publish
|
|
19
|
+
|
|
20
|
+
- Preview: `sfb-toolkit start` → `http://localhost:<port>/en-US/home` (`-v` verbose)
|
|
21
|
+
- Zip: `sfb-toolkit package -a` when translations or `settings.json` changed (avoids interactive omit prompts)
|
|
22
|
+
|
|
23
|
+
## Dependencies / agent docs
|
|
24
|
+
|
|
25
|
+
- Theme npm: `sfb-toolkit install [module]`
|
|
26
|
+
- Refresh AI guidance: `sfb-toolkit install-agent-guidance`
|
|
27
|
+
|
|
28
|
+
## Custom components (order matters)
|
|
29
|
+
|
|
30
|
+
1. **Enable once** if no `customComponents/`: `sfb-toolkit components` (may prompt)
|
|
31
|
+
2. New: `sfb-toolkit components-add` (prompts unless name/`-p`/`-o` given)
|
|
32
|
+
3. Fork library: pick **Export** from `sfb-custom-components/COMPONENT-CATALOG.md`, then `sfb-toolkit components-copy <Export…> -r|-c|-s` (no interactive no-args mode)
|
|
33
|
+
4. Audit: `components-info` · Remove forks: `components-delete`
|
|
34
|
+
|
|
35
|
+
`storybook` is deprecated. Prefer non-interactive flags when automating.
|