包详细信息

@nosto/web-components

Nosto4.1k9.3.1

This repository contains a collection of custom elements designed to integrate Nosto's personalization and e-commerce solutions into various web platforms.

自述文件

Nosto Web Components

This repository contains a collection of custom elements designed to integrate Nosto's personalization and e-commerce solutions into various web platforms.

Usage

Usage options for this library are documented here

Components

This package provides the following custom elements:

Store level templating

Component Tag Name Description Notes
Campaign nosto-campaign Campaign rendering and product recommendation display
Control nosto-control Conditional content rendering based on user segments
Popup nosto-popup Popup content with dialog and ribbon slots
SectionCampaign nosto-section-campaign Campaign rendering using the Section Rendering API Shopify only

Campaign level templating

Component Tag Name Description Notes
DynamicCard nosto-dynamic-card Dynamic product card templating Shopify only
Image nosto-image Progressive image enhancement with optimization
Product nosto-product Product interaction and cart management
SimpleCard nosto-simple-card Simple product card templating Shopify only
SkuOptions nosto-sku-options Product variant and SKU selection interface
VariantSelector nosto-variant-selector Product variant options as clickable pills Shopify only

Documentation

Read our Techdocs for more information on how to use these components.

Library TypeDoc page includes detailed library documentation.

Interactive Storybook provides live examples and documentation for each component.

更新日志

9.3.1 (2025-10-14)

Bug Fixes

9.3.0 (2025-10-10)

Features

  • VariantSelector: implement single-value option auto-selection and hiding (15e069e)

9.2.1 (2025-10-10)

Bug Fixes

  • add unavailable flags to option values (f4b683a)

9.2.0 (2025-10-08)

Features

  • add add-to-cart support to SimpleCard (2a99814)

9.1.0 (2025-10-08)

Bug Fixes

  • VariantSelector: change preselect default to false and simplify logic per feedback (9002b66)

Features

  • VariantSelector: add preselect boolean attribute for optional variant preselection (e298ae2)

9.0.0 (2025-10-08)

Bug Fixes

  • remove empty lines as requested in code review (e31be65)

Documentation

  • document ProductCard removal as breaking change (9c0ae0a)

BREAKING CHANGES

  • The ProductCard component and nosto-product-card custom element have been completely removed. Use Campaign component (nosto-campaign) instead for product templating capabilities.

8.36.1 (2025-10-07)

Bug Fixes

  • adjust variant image handling (4e32418)

8.36.0 (2025-10-07)

Features

  • SimpleCard,VariantSelector: align CSS styles according to requirements (26fdf2d)

8.35.0 (2025-10-07)

Bug Fixes

  • add cache clearing and fix failing tests (80405d5)
  • make currentProduct public and remove product from VariantChangeDetail (2155778)
  • move VariantChangeDetail to types, use escapeHtml for data attributes (69c4594)
  • Popup: fix test unhandled errors and format issues (030cabe)

Features

  • add WithVariantSelector Storybook story for SimpleCard (9c91cd4)
  • complete VariantSelector implementation with Storybook integration (4225966)
  • implement VariantSelector component with basic functionality (9c1ea83)
  • Popup: add new custom element with dialog and ribbon slots (d077525)
  • Popup: add ribbon mode, shadow DOM parts, and global test setup (1324963)

Performance Improvements

  • optimize SimpleCard updates with querySelector-based DOM updates (7cd30db)

8.34.0 (2025-10-06)

Bug Fixes

  • restore the removed test for both primary and alternate images (73cff99)
  • use proper HTML escaping for sizes attribute and remove duplicate test (c16649b)

Features

  • SimpleCard: add sizes attribute support for responsive images (d9a512f)

8.33.0 (2025-10-06)

Bug Fixes

  • Image: simplify implementation - remove comments and attribute removal logic (7f843cd)
  • restore all original vue tests and remove backup file (6e1e5a0)

Features

  • Image: reuse existing img child instead of always recreating (eee1705)
  • jsdoc: add @category annotations to all custom elements (9722a22)

8.32.0 (2025-10-06)

Features

  • bump GitHub Actions Node.js version from 22 to 24 (fdcd5da)

8.31.2 (2025-10-03)

Bug Fixes

  • components: ensure loading state cleared in finally blocks across custom elements (9ee5eef)
  • SimpleCard: add try/finally blocks for loading state management (89f4e11)

8.31.1 (2025-10-03)

Bug Fixes

Performance Improvements

  • SimpleCard: cache constructible stylesheet for better performance (adf59e6)

8.31.0 (2025-10-02)

Features

  • utils: add optional in-memory caching to getText/getJSON (01f842c)

8.30.0 (2025-10-02)

Bug Fixes

  • remove comment and add npm caching to copilot-setup-steps.yml (6d274b4)

Features

  • add minimal copilot-setup-steps.yml file (784351d)

8.29.0 (2025-10-01)

Features

  • Campaign: implement cart-synced attribute with @nosto/nosto-js bump (94ca04d)

8.28.0 (2025-10-01)

Bug Fixes

  • SimpleCard: return TemplateExpression objects instead of .html strings (3431065)

Features

  • SimpleCard: refactor to use html templating from src/templating/html.ts (14f4364)

8.27.0 (2025-09-29)

Bug Fixes

  • use built-in Array constructor for all array types instead of custom ArrayType (a47f9b5)

Features

  • add Array.isArray validation in arrayAttribute getter to ensure type safety (6d41883)
  • add breakpoints validation to ensure all elements are positive finite numbers (cfe2dfc)
  • improve breakpoints validation logic and add attribute test case (ae839a8)

8.26.0 (2025-09-29)

Features

  • extract path-specific conventions from copilot instructions (71f4e85)

8.25.0 (2025-09-26)

Features

  • Image: allow rendering with only src + width or src + height (541642f)

8.24.0 (2025-09-25)

Features

  • Image: Add support for alt and sizes attributes and pass to unpic transform (6a13f61)
  • implement lit-html like templating engine with html function (bb29ec2)

8.23.1 (2025-09-22)

Bug Fixes

  • Image: filter out null/undefined attributes from inner img element (7b7f3b4)

8.23.0 (2025-09-22)

Bug Fixes

  • Campaign: remove template wrappers from lazy loaded and manual initialization stories (d3b349e)
  • resolve Prettier formatting issues in all story files (804c992)
  • resolve remaining lint errors in Campaign stories and ProductCard test (28bffa7)

Features

  • apply decorator pattern to remaining story files for consistency (8277fa0)
  • convert story helpers to Storybook decorators and remove template wrapper (28ed4a7)
  • create Storybook files for Campaign, Control, and ProductCard components (c3a37d2)
  • simplify Control stories templates and styles, remove createDemoSection from Image stories (8ad7375)

8.22.0 (2025-09-04)

Bug Fixes

  • resolve Prettier formatting issues in CHANGELOG.md, README.md, and tsconfig.types.json (2cdfd29)
  • revert CHANGELOG.md changes and make event name a constant (02264d0)

Features

  • DynamicCard: emit DynamicCard/loaded event when content loads (4c07877)
  • DynamicCard: rename event to "@nosto/DynamicCard/loaded" (59607bb)

8.21.0 (2025-09-04)

Features

  • add typedoc-json script for JSON output (516c736)

8.20.0 (2025-09-03)

Features

  • make Shopify URL creation more precise with dynamic root (9312673)

8.19.1 (2025-09-03)

Bug Fixes

  • align field types with mandatory/optional semantics (51492ec)
  • Campaign: make placement mandatory as requested (3a3ad46)
  • Campaign: make productId optional to align with type semantics (d58acd0)
  • make template and selectedSkuId optional to align with component semantics (66db5b9)

8.19.0 (2025-09-03)

Bug Fixes

  • package.json: add dist/ folder path to main, module, and types fields (945b8b9)

Features

  • add TypeScript type exports for entire module (102272f)

8.18.0 (2025-09-01)

Features

  • drop Nosto prefix from custom element class names (5ecbc94)
  • drop Nosto prefix from folder names and module names (44c8f92)
  • drop Nosto prefix from test file names (3fb6544)

8.17.0 (2025-09-01)

Features

  • introduce simple fetch facade module with getText and getJSON (b071d0c)

8.16.0 (2025-08-29)

Features

  • rename NostoCampaignSection to NostoSectionCampaign (d363167)

8.15.0 (2025-08-29)

Features

  • add typecheck script and update copilot instructions (cbef496)

8.14.0 (2025-08-27)

Bug Fixes

  • lint: fix Prettier formatting issues in story CSS files and docs (cda25fa)

Features

  • cleanup: remove dev folder and dependencies after Storybook migration (4037c1e)
  • cleanup: remove liquidjs TypeScript shim declaration (0c6e3f2)
  • stories: extract NostoImage story styles to external CSS file (32af433)
  • storybook: extract NostoProduct story styles to external CSS file (d1b1e59)
  • storybook: extract NostoSkuOptions stories CSS to external file (b58ae30)
  • storybook: register all custom elements globally in preview.ts (2ded449)

8.13.0 (2025-08-25)

Bug Fixes

  • resolve merge conflicts after updating branch with main (c3c1328)

Features

  • convert NostoCampaignSection test to use TSX syntax (866b4f1)
  • rename NostoSection to NostoCampaignSection with updated docs (0eb393f)

8.12.0 (2025-08-25)

Features

  • remove unpic and thumb functionality from templating context (0422889)

8.11.0 (2025-08-25)

Bug Fixes

  • tests: remove unused JSX import from NostoCampaign.spec.tsx (448d876)

Features

  • jsx: add custom element type definitions and remove type assertions (282e43b)
  • jsx: update IntrinsicElements to use Partial class types and simplify createElement (b60bd9b)
  • jsx: use Partial<NostoCampaign> for attribute type definitions (4ef959a)
  • tests: add explicit custom element registration using beforeAll (e48e0dd)
  • tests: add type assertions back to JSX elements in test files (bad7e7e)
  • tests: convert NostoDynamicCard.spec.ts to .tsx with JSX patterns (56268d7)
  • tests: convert to actual TSX syntax with JSX createElement (ff7fcc7)
  • tests: convert to actual TSX syntax without explicit createElement import (b9abd05)
  • tests: implement JSX-like syntax for component creation in NostoDynamicCard tests (f06a575)

8.10.0 (2025-08-22)

Features

  • drop single placement signature from mockNostoRecs (80f23e8)

8.9.0 (2025-08-22)

Features

  • test: replace global.fetch mocking with MSW usage (0293e7e)
  • test: return 404 response when handler response is falsy (428de30)

8.8.0 (2025-08-22)

Features

  • add NostoSection custom element (db2c051)

8.7.0 (2025-08-13)

Features

  • add Dependabot workflow for monthly GitHub Actions SHA updates (ad84dab)
  • update GitHub Actions to latest commit SHAs for enhanced security (e4d172c)

8.6.0 (2025-08-12)

Bug Fixes

  • correct Node.js version reference and remove build artifacts line (e23bc84)
  • remove development server section from Quick Start as requested (1580f12)
  • remove Node.js installation guidance and version warnings as requested (1250330)
  • remove Validation Scenarios and Development Server Details sections (9dab44e)

Features

  • expand GitHub Copilot instructions with comprehensive build and development guidance (0df88fd)

8.5.0 (2025-08-11)

Bug Fixes

  • test: replace any casts with proper Mock type from vitest (2d3dc8e)

Features

  • NostoCampaign: add lazy loading with IntersectionObserver (a068536), closes #222

Reverts

  • remove non-conventional commits to start fresh (69e2dcc)

8.4.2 (2025-08-07)

Bug Fixes

  • handle template elements correctly (7779bf3)

8.4.1 (2025-08-06)

Bug Fixes

8.4.0 (2025-08-05)

Features

8.3.0 (2025-08-04)

Features

  • support for template rerendering (6f54202)

8.2.0 (2025-07-18)

Features

  • create NostoControl for conditional rendering (6ef28f0)

8.1.0 (2025-07-18)

Features

  • support sections in addition to custom templates (2126753)

8.0.1 (2025-07-14)

Bug Fixes

  • use id as alias for placement (fb48c39)

8.0.0 (2025-07-14)

Features

  • normalize context to camelCase (74a4ca3)

BREAKING CHANGES

  • snake case to camel case context treatment

7.12.1 (2025-07-14)

Bug Fixes

  • hide attributes from typedoc (2e45f99)

7.12.0 (2025-07-09)

Features

  • extend template context (3cf8e9c)

7.11.0 (2025-07-09)

Features

  • add attribute change listeners (5a22b18)

7.10.0 (2025-07-08)

Features

7.9.0 (2025-07-08)

Features

  • add support for template children (68b3b69)

7.8.1 (2025-07-08)

Bug Fixes

  • move components to folders (b213f11)

7.8.0 (2025-07-07)

Features

  • replace liquid and handlebars with vue templating (baa63c4)

7.7.1 (2025-07-04)

Bug Fixes

  • extend from NostoElement (438025d)

7.7.0 (2025-07-04)

Bug Fixes

  • address comment and fix checkRequired (7d05a37)
  • address lint ond improvements (aed18b7)
  • exclude main.ts from test coverage (f10cfd8)
  • import types (5ad440a)
  • use attribute binding instead of property binding (615d5d7)

Features

  • introduce NostoImage component for rendering responsive images (745a354)

7.6.1 (2025-07-02)

Bug Fixes

  • move logFirstUsage to superclass (49d242b)

7.6.0 (2025-07-02)

Bug Fixes

Features

  • add logging (d7d9078)
  • log the first instantiation of any component (d64c298)
  • persist logged status in localStorage (16c63ab)

7.5.0 (2025-06-12)

Bug Fixes

Features

  • support init false to defer campaign loading (aea1c1d)
  • update injection logic (0b4a0d8)

7.4.3 (2025-06-12)

Bug Fixes

7.4.2 (2025-06-11)

Bug Fixes

7.4.1 (2025-06-11)

Bug Fixes

7.4.0 (2025-06-11)

Bug Fixes

Features

  • fetch JSON results and use templating (dde82c5)

7.3.0 (2025-06-10)

Bug Fixes

Features

  • add NostoCampaign component (9383663)

7.2.0 (2025-06-10)

Features

  • add support for placeholder content (9780cce)

7.1.0 (2025-06-09)

Features

  • add lazy loading support (debdf24)

7.0.0 (2025-06-02)

  • feat!: remove NostoSwiper (b1112b1)

BREAKING CHANGES

  • NostoSwiper removal

6.0.0 (2025-05-12)

Features

BREAKING CHANGES

  • dropping wrap and recoId property handling

5.0.0 (2025-05-07)

Features

BREAKING CHANGES

  • NostoShopify support dropped

4.1.0 (2025-04-29)

Features

  • add extended SKU data support (9ad386f)

4.0.0 (2025-04-22)

  • fix!: adjust attribute prefixes (4ffb1b3)

Features

BREAKING CHANGES

  • ns- prefix changed to n-

3.4.2 (2025-04-22)

Bug Fixes

  • use regex for template language match (7c23982)

3.4.1 (2025-04-16)

Bug Fixes

  • use official template script types (bec9dc6)

3.4.0 (2025-04-16)

Features

3.3.0 (2025-04-15)

Features

  • support ATC on SKU option (b77779b)

3.2.0 (2025-04-14)

Features

  • support for nested swiper usage (daa82ff)