@standhigher/besttrack-page-extension 0.5.15 → 0.5.17

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 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
@@ -1403,7 +1403,7 @@ function ProductImage({ src, alt, size = 60 }) {
1403
1403
  flex: "0 0 auto",
1404
1404
  borderRadius: "var(--pb-radius, 8px)",
1405
1405
  objectFit: "contain",
1406
- background: "#f1f5f9"
1406
+ background: "#fff"
1407
1407
  };
1408
1408
  if (!safeSrc || failed) {
1409
1409
  return /* @__PURE__ */ jsx2("span", { "aria-label": alt + " image unavailable", style: { ...box, display: "grid", placeItems: "center", color: "#94a3b8", fontSize: 12 }, children: alt.slice(0, 1).toUpperCase() });
@@ -1537,7 +1537,7 @@ function RecommendationCards({ items }) {
1537
1537
  const href = safeHref(item.href);
1538
1538
  const displayPrice = formatRecommendationPrice(item.price);
1539
1539
  const card = /* @__PURE__ */ jsxs(Fragment, { children: [
1540
- /* @__PURE__ */ jsx2("div", { style: { width: 262, height: 262, maxWidth: "100%", borderRadius: 8, border: "1px solid #E3E3E3", overflow: "hidden", background: "#f1f5f9" }, children: /* @__PURE__ */ jsx2(ProductImage, { src: item.imageUrl, alt: item.title, size: 262 }) }),
1540
+ /* @__PURE__ */ jsx2("div", { style: { width: 262, height: 262, maxWidth: "100%", borderRadius: 8, border: "1px solid #E3E3E3", overflow: "hidden", background: "#fff" }, children: /* @__PURE__ */ jsx2(ProductImage, { src: item.imageUrl, alt: item.title, size: 262 }) }),
1541
1541
  /* @__PURE__ */ jsxs("div", { style: { padding: "12px 8px", textAlign: "center", fontSize: 14 }, children: [
1542
1542
  /* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#334155" }, children: item.title }),
1543
1543
  displayPrice ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontWeight: 600, color: "#0f172a" }, children: displayPrice }) : null,
@@ -2110,12 +2110,12 @@ var readyToGoBlocks = withTemplatePolicy([
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", "besttrack.ready-to-go.recommendations"]);
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", "besttrack.ready-to-go.recommendations"]
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 {
@@ -2746,13 +2746,13 @@ var brandedBlocks = withTemplatePolicy2([
2746
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 (Shopify)", 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", "besttrack.branded.recommendations"]);
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", "besttrack.branded.recommendations"]
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));
@@ -3196,12 +3196,12 @@ var salesBlocks = withTemplatePolicy3([
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
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 (Shopify)", 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", "besttrack.sales.recommendations"]);
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", "besttrack.sales.recommendations"]
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.15",
3
+ "version": "0.5.17",
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.15"
25
+ "@standhigher/puck-page-builder": "0.12.16"
26
26
  },
27
27
  "devDependencies": {
28
28
  "tsup": "^8.5.1",