@lucrex/storefront-blocks 0.1.0 → 0.2.0
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/README.md +17 -3
- package/dist/index.cjs +1370 -40
- package/dist/index.mjs +1370 -40
- package/dist/server.cjs +1370 -40
- package/dist/server.mjs +1370 -40
- package/dist/types/block.d.ts +1 -1
- package/dist/types/blocks/store.d.ts +75 -0
- package/dist/types/context.d.ts +5 -1
- package/dist/types/data.d.ts +71 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/money.d.ts +2 -0
- package/dist/types/templates/online-stores.d.ts +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,10 +36,24 @@ A page is JSON:
|
|
|
36
36
|
- `@lucrex/storefront-blocks`: browser safe. Blocks, `PageContent`, page CSS, validation, JSON Schema and templates.
|
|
37
37
|
- `@lucrex/storefront-blocks/server`: everything above plus `renderPage(document, data)`, which returns `{ html, css, fontStylesheets, preloadImages }` with the CSS checked, scoped and lowered for older browsers.
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Templates
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
- `funnelTemplate(templateId, { formPosition })`: the page of a funnel.
|
|
42
|
+
- `onlineStorePages(templateId)`: the 13 pages of an online store: `header`, `footer`, `home`, `all-products`, `category`, `product`, `thank-you`, `contact`, `about`, `privacy-policy`, `refund-policy`, `terms-of-service` and `not-found`. Only `home` differs between templates. Each store template also has its own CSS in the backend.
|
|
43
|
+
|
|
44
|
+
## Page data
|
|
45
|
+
|
|
46
|
+
`renderPage(document, data)` takes the page data the blocks read:
|
|
47
|
+
|
|
48
|
+
- Funnel pages and store product pages pass the product and checkout data (`funnel`, `product`, `offers`, `deliveryPrices`, `geo`, `api`). Store product pages set `lazyCities`, so the SDK loads the cities.
|
|
49
|
+
- Store pages pass `store`: the labels in the store language, the money format, the store settings, categories and home products, plus `listing`, `productPage` or `article` for those pages.
|
|
50
|
+
|
|
51
|
+
Store blocks take their text from the store settings and labels. A block `text`, `title` or `label` prop replaces it.
|
|
52
|
+
|
|
53
|
+
## Checkout and store hooks
|
|
54
|
+
|
|
55
|
+
Product and checkout blocks output the `data-funnel`, `data-field`, `data-offer-*`, `data-total` and `.cs-submit` hooks that the storefront SDK binds to. Store blocks output the `data-store`, `data-track`, `data-product-card`, `data-filter-category`, `data-contact-*` and `data-order` hooks. Keep them when changing a block.
|
|
42
56
|
|
|
43
57
|
## Releasing
|
|
44
58
|
|
|
45
|
-
Bump `version`, then push a `storefront-blocks-v<version>` tag. CI tests, builds and publishes to npm.
|
|
59
|
+
Bump `version`, then push a `storefront-blocks-v<version>` tag. CI tests, builds and publishes to npm. The release then waits in npm's Staged Packages until a maintainer approves it.
|