@standhigher/besttrack-page-extension 0.5.16 → 0.5.18
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 +1 -0
- package/dist/index.js +9 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ namespaced v1 block IDs, default block order, theme tokens, and exported
|
|
|
6
6
|
`TemplatePolicy` metadata. All default blocks are singleton. Protected
|
|
7
7
|
query/structure blocks now use the core `BlockDefinition.policy` contract
|
|
8
8
|
(`required`, `singleton`, and `allowDelete: false`), which the editor enforces.
|
|
9
|
+
Recommendation blocks stay singleton and can be deleted.
|
|
9
10
|
|
|
10
11
|
## Query provider
|
|
11
12
|
|
package/dist/index.js
CHANGED
|
@@ -2106,16 +2106,16 @@ var readyToGoBlocks = withTemplatePolicy([
|
|
|
2106
2106
|
variants: [{ id: "default", label: "Default" }, { id: "grid", label: "Grid", theme: { "color.surface": "#ffffff" } }],
|
|
2107
2107
|
fields: {
|
|
2108
2108
|
heading: text2("Heading", { validation: { maxLength: 100 } }),
|
|
2109
|
-
products: { field: "besttrack.ready-to-go.products", label: "\u63A8\u8350\u5546\u54C1 (
|
|
2109
|
+
products: { field: "besttrack.ready-to-go.products", label: "\u63A8\u8350\u5546\u54C1 (Store)", control: "products", group: "Content" }
|
|
2110
2110
|
},
|
|
2111
2111
|
render: { web: ReadyToGoRecommendationsBlock, editor: ReadyToGoRecommendationsEditor }
|
|
2112
2112
|
}
|
|
2113
|
-
], ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"
|
|
2113
|
+
], ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"]);
|
|
2114
2114
|
var readyToGoTemplatePolicy = defineTemplatePolicy(
|
|
2115
2115
|
"besttrack.ready-to-go",
|
|
2116
2116
|
"Ready-to-go",
|
|
2117
2117
|
readyToGoBlocks.map((block) => block.type),
|
|
2118
|
-
["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"
|
|
2118
|
+
["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"]
|
|
2119
2119
|
);
|
|
2120
2120
|
function createReadyToGoTemplate() {
|
|
2121
2121
|
return {
|
|
@@ -2743,16 +2743,16 @@ var brandedBlocks = withTemplatePolicy2([
|
|
|
2743
2743
|
{ type: "besttrack.branded.order-items", version: 1, label: "Order items", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "What's Inside" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "minimal", label: "Minimal" }], fields: { heading: text4("Heading") }, render: { web: BrandedOrderItemsBlock, editor: BrandedOrderItemsEditor } },
|
|
2744
2744
|
// products 接入与 Ready-to-go 相同的商家选品优先规则;hideWhenEmpty 仅保留旧文档兼容,
|
|
2745
2745
|
// 不再提供编辑开关,因为三套模板都在没有可用推荐时隐藏内容。
|
|
2746
|
-
{ type: "besttrack.branded.recommendations", version: 1, label: "Recommended products", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "You might also like", hideWhenEmpty: "false", products: [] }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "editorial", label: "Editorial", theme: { "color.surface": "#fffdf0" } }], fields: { heading: text4("Heading"), products: { field: "besttrack.branded.products", label: "\u63A8\u8350\u5546\u54C1 (
|
|
2746
|
+
{ type: "besttrack.branded.recommendations", version: 1, label: "Recommended products", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "You might also like", hideWhenEmpty: "false", products: [] }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "editorial", label: "Editorial", theme: { "color.surface": "#fffdf0" } }], fields: { heading: text4("Heading"), products: { field: "besttrack.branded.products", label: "\u63A8\u8350\u5546\u54C1 (Store)", control: "products", group: "Content" } }, render: { web: BrandedRecommendationsBlock, editor: BrandedRecommendationsEditor } },
|
|
2747
2747
|
{ type: "besttrack.branded.quick-links", version: 1, label: "Quick links", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Need help?", primaryLabel: "Shipping help", primaryHref: "https://example.com/pages/shipping", secondaryLabel: "Contact us", secondaryHref: "https://example.com/pages/contact" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }], fields: { heading: text4("Heading"), primaryLabel: text4("Primary link label"), primaryHref: httpsUrl("Primary link URL"), secondaryLabel: text4("Secondary link label"), secondaryHref: httpsUrl("Secondary link URL") }, render: { web: BrandedQuickLinksBlock, editor: BrandedQuickLinksEditor } },
|
|
2748
2748
|
{ type: "besttrack.branded.blog", version: 1, label: "Blog", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "From our journal", articleTitle: "Delivery tips for every season", excerpt: "Simple ways to make every delivery feel considered.", articleHref: "https://example.com/blogs/news", linkLabel: "Read the story" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }], fields: { heading: text4("Heading"), articleTitle: text4("Article title"), excerpt: text4("Excerpt", { control: "textarea" }), articleHref: httpsUrl("Article URL"), linkLabel: text4("Link label") }, render: { web: BrandedBlogBlock, editor: BrandedBlogEditor } }
|
|
2749
|
-
], ["besttrack.branded.announcement", "besttrack.branded.tracking-experience"
|
|
2749
|
+
], ["besttrack.branded.announcement", "besttrack.branded.tracking-experience"]);
|
|
2750
2750
|
var brandedDefaultBlockTypes = brandedBlocks.filter((block) => !["besttrack.branded.query", "besttrack.branded.order-items"].includes(block.type)).map((block) => block.type);
|
|
2751
2751
|
var brandedTemplatePolicy = defineTemplatePolicy(
|
|
2752
2752
|
"besttrack.branded",
|
|
2753
2753
|
"Branded",
|
|
2754
2754
|
brandedDefaultBlockTypes,
|
|
2755
|
-
["besttrack.branded.announcement", "besttrack.branded.tracking-experience"
|
|
2755
|
+
["besttrack.branded.announcement", "besttrack.branded.tracking-experience"]
|
|
2756
2756
|
);
|
|
2757
2757
|
function createBrandedTemplate() {
|
|
2758
2758
|
const templateBlocks = brandedBlocks.filter((block) => brandedDefaultBlockTypes.includes(block.type));
|
|
@@ -3195,13 +3195,13 @@ var salesBlocks = withTemplatePolicy3([
|
|
|
3195
3195
|
{ type: "besttrack.sales.product-categories", version: 3, label: "Product categories", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Shop by category", collection: { id: "gid://shopify/Collection/1", kind: "collection", title: "Featured collection", handle: "featured" } }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), collection: { field: "besttrack.shopify.collection", label: "Collection", group: "Resource", description: "Browse through an authorized host integration. Only a stable ID and minimal display copy are saved." } }, validate: validateCategories, render: { web: SalesProductCategoriesBlock, editor: SalesProductCategoriesEditor } },
|
|
3196
3196
|
{ type: "besttrack.sales.featured-product", version: 1, label: "Featured product", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Featured product", product: { id: "gid://shopify/Product/1", kind: "product", title: "Featured product", handle: "featured-product" } }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }], fields: { heading: shortText("Heading"), product: { field: "besttrack.shopify.product", label: "Product", group: "Resource", description: "Browse through an authorized host integration. Current availability is resolved only at runtime." } }, validate: validateFeaturedProduct, render: { web: SalesFeaturedProductBlock, editor: SalesFeaturedProductEditor } },
|
|
3197
3197
|
// 与另外两套模板一样保存商家选品配置;空数组表示交给独立推荐来源,不能改读查单推荐。
|
|
3198
|
-
{ type: "besttrack.sales.recommendations", version: 1, label: "Recommended products", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Complete your order", products: [] }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Product grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), products: { field: "besttrack.sales.products", label: "\u63A8\u8350\u5546\u54C1 (
|
|
3199
|
-
], ["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking"
|
|
3198
|
+
{ type: "besttrack.sales.recommendations", version: 1, label: "Recommended products", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Complete your order", products: [] }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Product grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), products: { field: "besttrack.sales.products", label: "\u63A8\u8350\u5546\u54C1 (Store)", control: "products", group: "Content" } }, validate: textProps([["heading", 120]]), render: { web: SalesRecommendationsBlock, editor: SalesRecommendationsEditor } }
|
|
3199
|
+
], ["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking"]);
|
|
3200
3200
|
var salesTemplatePolicy = defineTemplatePolicy(
|
|
3201
3201
|
"besttrack.sales",
|
|
3202
3202
|
"Sales",
|
|
3203
3203
|
salesBlocks.map((block) => block.type),
|
|
3204
|
-
["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking"
|
|
3204
|
+
["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking"]
|
|
3205
3205
|
);
|
|
3206
3206
|
function createSalesTemplate() {
|
|
3207
3207
|
return { id: "besttrack.sales", version: 3, name: "Sales", target: "web", source: "built-in", requiredBlocks: salesBlocks.map((block) => block.type), theme: { "color.primary": "#000000", "color.background": "#f7f5f0", "color.surface": "#ffffff", "color.text": "#0a0a0a", "color.muted": "#6b6b6b", "color.border": "#dfddd7", "font.family": "Arial, Helvetica, sans-serif", radius: "10px", spacing: "24px" }, create: () => createPageDocument3({ pageId: "besttrack-sales", target: "web", templateId: "besttrack.sales", templateVersion: 3, settings: { locale: "en", seoTitle: "Shop and track your order" }, blocks: salesBlocks.map((block, index) => ({ id: "sales-" + (index + 1), type: block.type, version: block.version, props: block.defaultProps, variant: block.defaultVariant, style: {} })) }) };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standhigher/besttrack-page-extension",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.18",
|
|
4
4
|
"description": "BestTrack business extension entry point for @standhigher/puck-page-builder.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"embla-carousel-autoplay": "^8.6.0",
|
|
24
24
|
"embla-carousel-react": "^8.6.0",
|
|
25
|
-
"@standhigher/puck-page-builder": "0.12.
|
|
25
|
+
"@standhigher/puck-page-builder": "0.12.17"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"tsup": "^8.5.1",
|