@crystaldesign/widget-library 25.10.0-rc.2 → 25.10.0-rc.4

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.
@@ -266,7 +266,8 @@ function useProductData(_ref) {
266
266
  var productIds = _ref.productIds,
267
267
  variants = _ref.variants,
268
268
  widgetType = _ref.widgetType,
269
- noGlobalCache = _ref.noGlobalCache;
269
+ noGlobalCache = _ref.noGlobalCache,
270
+ standaloneWidget = _ref.standaloneWidget;
270
271
  // Generate stable widget ID that persists for the lifetime of this hook instance
271
272
  // Function to handle selectedProduct changes
272
273
 
@@ -418,6 +419,10 @@ function useProductData(_ref) {
418
419
 
419
420
  // Main effect for loading products when productIds or variants change
420
421
  useEffect(function () {
422
+ if (standaloneWidget) {
423
+ LOG.debug("[".concat(widgetType, ":").concat(widgetId, "] Standalone widget, skipping main effect"));
424
+ return;
425
+ }
421
426
  LOG.debug("[".concat(widgetType, ":").concat(widgetId, "] Main effect triggered with normalizedProductIds: ").concat(normalizedProductIds.join(', ')));
422
427
  if (!normalizedProductIds.length) {
423
428
  LOG.error(new DivaError("[".concat(widgetType, ":").concat(widgetId, "] ProductIds array is required and cannot be empty")));
@@ -11,8 +11,9 @@ export interface UseProductDataProps {
11
11
  * This is used in the product list, where we always want to fetch the latest data
12
12
  */
13
13
  noGlobalCache?: boolean;
14
+ standaloneWidget?: boolean;
14
15
  }
15
- export declare function useProductData({ productIds, variants, widgetType, noGlobalCache }: UseProductDataProps): {
16
+ export declare function useProductData({ productIds, variants, widgetType, noGlobalCache, standaloneWidget }: UseProductDataProps): {
16
17
  productVariants: ProductData[];
17
18
  error: boolean;
18
19
  loading: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useProductData.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useProductData.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAQ1F,MAAM,WAAW,mBAAmB;IAClC,UAAU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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/widget-library",
3
- "version": "25.10.0-rc.2",
3
+ "version": "25.10.0-rc.4",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "storybook": "storybook dev -p 6006",
@@ -36,5 +36,5 @@
36
36
  "suiteName": "widget-library",
37
37
  "outputDirectory": "./test-reports"
38
38
  },
39
- "gitHead": "6dcb8c69d7b9916ad9bebd5490a1e5d220ac2bba"
39
+ "gitHead": "822e58cf75fc9dc3d6a094b751d4fc5d30e363b7"
40
40
  }