@weaverse/hydrogen 5.9.1 → 5.9.2

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/dist/index.d.mts CHANGED
@@ -309,15 +309,15 @@ interface RouteLoaderArgs extends LoaderFunctionArgs {
309
309
  }
310
310
  type ComponentDataValue = string | number | boolean | undefined | null;
311
311
  interface HydrogenComponentData extends ElementData {
312
- id: string;
313
- type: string;
314
- data?: Record<string, ComponentDataValue | Record<string, unknown>>;
315
312
  children?: {
316
313
  id: string;
317
314
  }[];
318
315
  createdAt?: string;
319
- updatedAt?: string;
316
+ data?: Record<string, ComponentDataValue | Record<string, unknown>>;
320
317
  deletedAt?: string;
318
+ id: string;
319
+ type: string;
320
+ updatedAt?: string;
321
321
  }
322
322
  /**
323
323
  * Optimized: Use Zod-inferred SchemaType directly instead of extending
@@ -325,9 +325,9 @@ interface HydrogenComponentData extends ElementData {
325
325
  */
326
326
  type HydrogenComponentSchema = SchemaType;
327
327
  interface HydrogenComponentProps<L = any> extends WeaverseElement {
328
+ children?: React$1.JSX.Element[];
328
329
  className?: string;
329
330
  loaderData?: L;
330
- children?: React$1.JSX.Element[];
331
331
  }
332
332
  type WeaverseLoaderRequestInfo = {
333
333
  search: string;
@@ -366,19 +366,19 @@ type HydrogenElement = {
366
366
  };
367
367
  interface WeaverseHydrogenParams extends Omit<WeaverseCoreParams, 'ItemConstructor'> {
368
368
  data: HydrogenPageData;
369
- pageId: string;
369
+ dataContext?: Record<string, unknown> | null;
370
370
  internal: Partial<WeaverseInternal>;
371
- requestInfo: WeaverseLoaderRequestInfo;
372
- projectId: string;
373
- weaverseHost: string;
374
- weaverseApiBase: string;
375
- weaverseApiKey: string;
376
- weaverseVersion?: string;
377
371
  isDesignMode?: boolean;
378
372
  isPreviewMode?: boolean;
379
373
  isRevisionPreview?: boolean;
374
+ pageId: string;
375
+ projectId: string;
376
+ requestInfo: WeaverseLoaderRequestInfo;
380
377
  sectionType?: string;
381
- dataContext?: Record<string, unknown> | null;
378
+ weaverseApiBase: string;
379
+ weaverseApiKey: string;
380
+ weaverseHost: string;
381
+ weaverseVersion?: string;
382
382
  }
383
383
  type HydrogenComponent<T extends HydrogenComponentProps = any> = {
384
384
  default: ForwardRefExoticComponent<T> | ((props: T) => React$1.JSX.Element);
@@ -431,10 +431,10 @@ type WeaverseLoaderData = {
431
431
  pageAssignment?: HydrogenPageAssignment;
432
432
  };
433
433
  interface HydrogenPageData extends WeaverseProjectDataType {
434
+ __cacheId?: string;
434
435
  id: string;
435
- name: string;
436
436
  items: HydrogenComponentData[];
437
- __cacheId?: string;
437
+ name: string;
438
438
  [key: string]: any;
439
439
  }
440
440
  type WeaverseI18n = I18nBase & {
@@ -711,20 +711,20 @@ declare module '@shopify/remix-oxygen' {
711
711
  }
712
712
  declare module '@shopify/hydrogen' {
713
713
  interface HydrogenEnv {
714
- WEAVERSE_PROJECT_ID: string;
715
- WEAVERSE_HOST?: string;
716
- WEAVERSE_API_BASE?: string;
717
- WEAVERSE_API_KEY: string;
718
- PUBLIC_STORE_DOMAIN: string;
719
- PUBLIC_STOREFRONT_API_TOKEN: string;
720
- PUBLIC_GOOGLE_GTM_ID: string;
721
- JUDGEME_PRIVATE_API_TOKEN: string;
722
714
  CUSTOM_COLLECTION_BANNER_METAFIELD: string;
723
- METAOBJECT_COLORS_TYPE: string;
715
+ JUDGEME_PRIVATE_API_TOKEN: string;
716
+ KLAVIYO_PRIVATE_API_TOKEN: string;
724
717
  METAOBJECT_COLOR_NAME_KEY: string;
725
718
  METAOBJECT_COLOR_VALUE_KEY: string;
726
- KLAVIYO_PRIVATE_API_TOKEN: string;
719
+ METAOBJECT_COLORS_TYPE: string;
720
+ PUBLIC_GOOGLE_GTM_ID: string;
727
721
  PUBLIC_SHOPIFY_INBOX_SHOP_ID: string;
722
+ PUBLIC_STORE_DOMAIN: string;
723
+ PUBLIC_STOREFRONT_API_TOKEN: string;
724
+ WEAVERSE_API_BASE?: string;
725
+ WEAVERSE_API_KEY: string;
726
+ WEAVERSE_HOST?: string;
727
+ WEAVERSE_PROJECT_ID: string;
728
728
  }
729
729
  }
730
730
  /**
package/dist/index.d.ts CHANGED
@@ -309,15 +309,15 @@ interface RouteLoaderArgs extends LoaderFunctionArgs {
309
309
  }
310
310
  type ComponentDataValue = string | number | boolean | undefined | null;
311
311
  interface HydrogenComponentData extends ElementData {
312
- id: string;
313
- type: string;
314
- data?: Record<string, ComponentDataValue | Record<string, unknown>>;
315
312
  children?: {
316
313
  id: string;
317
314
  }[];
318
315
  createdAt?: string;
319
- updatedAt?: string;
316
+ data?: Record<string, ComponentDataValue | Record<string, unknown>>;
320
317
  deletedAt?: string;
318
+ id: string;
319
+ type: string;
320
+ updatedAt?: string;
321
321
  }
322
322
  /**
323
323
  * Optimized: Use Zod-inferred SchemaType directly instead of extending
@@ -325,9 +325,9 @@ interface HydrogenComponentData extends ElementData {
325
325
  */
326
326
  type HydrogenComponentSchema = SchemaType;
327
327
  interface HydrogenComponentProps<L = any> extends WeaverseElement {
328
+ children?: React$1.JSX.Element[];
328
329
  className?: string;
329
330
  loaderData?: L;
330
- children?: React$1.JSX.Element[];
331
331
  }
332
332
  type WeaverseLoaderRequestInfo = {
333
333
  search: string;
@@ -366,19 +366,19 @@ type HydrogenElement = {
366
366
  };
367
367
  interface WeaverseHydrogenParams extends Omit<WeaverseCoreParams, 'ItemConstructor'> {
368
368
  data: HydrogenPageData;
369
- pageId: string;
369
+ dataContext?: Record<string, unknown> | null;
370
370
  internal: Partial<WeaverseInternal>;
371
- requestInfo: WeaverseLoaderRequestInfo;
372
- projectId: string;
373
- weaverseHost: string;
374
- weaverseApiBase: string;
375
- weaverseApiKey: string;
376
- weaverseVersion?: string;
377
371
  isDesignMode?: boolean;
378
372
  isPreviewMode?: boolean;
379
373
  isRevisionPreview?: boolean;
374
+ pageId: string;
375
+ projectId: string;
376
+ requestInfo: WeaverseLoaderRequestInfo;
380
377
  sectionType?: string;
381
- dataContext?: Record<string, unknown> | null;
378
+ weaverseApiBase: string;
379
+ weaverseApiKey: string;
380
+ weaverseHost: string;
381
+ weaverseVersion?: string;
382
382
  }
383
383
  type HydrogenComponent<T extends HydrogenComponentProps = any> = {
384
384
  default: ForwardRefExoticComponent<T> | ((props: T) => React$1.JSX.Element);
@@ -431,10 +431,10 @@ type WeaverseLoaderData = {
431
431
  pageAssignment?: HydrogenPageAssignment;
432
432
  };
433
433
  interface HydrogenPageData extends WeaverseProjectDataType {
434
+ __cacheId?: string;
434
435
  id: string;
435
- name: string;
436
436
  items: HydrogenComponentData[];
437
- __cacheId?: string;
437
+ name: string;
438
438
  [key: string]: any;
439
439
  }
440
440
  type WeaverseI18n = I18nBase & {
@@ -711,20 +711,20 @@ declare module '@shopify/remix-oxygen' {
711
711
  }
712
712
  declare module '@shopify/hydrogen' {
713
713
  interface HydrogenEnv {
714
- WEAVERSE_PROJECT_ID: string;
715
- WEAVERSE_HOST?: string;
716
- WEAVERSE_API_BASE?: string;
717
- WEAVERSE_API_KEY: string;
718
- PUBLIC_STORE_DOMAIN: string;
719
- PUBLIC_STOREFRONT_API_TOKEN: string;
720
- PUBLIC_GOOGLE_GTM_ID: string;
721
- JUDGEME_PRIVATE_API_TOKEN: string;
722
714
  CUSTOM_COLLECTION_BANNER_METAFIELD: string;
723
- METAOBJECT_COLORS_TYPE: string;
715
+ JUDGEME_PRIVATE_API_TOKEN: string;
716
+ KLAVIYO_PRIVATE_API_TOKEN: string;
724
717
  METAOBJECT_COLOR_NAME_KEY: string;
725
718
  METAOBJECT_COLOR_VALUE_KEY: string;
726
- KLAVIYO_PRIVATE_API_TOKEN: string;
719
+ METAOBJECT_COLORS_TYPE: string;
720
+ PUBLIC_GOOGLE_GTM_ID: string;
727
721
  PUBLIC_SHOPIFY_INBOX_SHOP_ID: string;
722
+ PUBLIC_STORE_DOMAIN: string;
723
+ PUBLIC_STOREFRONT_API_TOKEN: string;
724
+ WEAVERSE_API_BASE?: string;
725
+ WEAVERSE_API_KEY: string;
726
+ WEAVERSE_HOST?: string;
727
+ WEAVERSE_PROJECT_ID: string;
728
728
  }
729
729
  }
730
730
  /**
package/dist/index.js CHANGED
@@ -340,7 +340,9 @@ var ThemeSettingsStore = class {
340
340
  };
341
341
  };
342
342
  emit = () => {
343
- if (this.isDestroyed) return;
343
+ if (this.isDestroyed) {
344
+ return;
345
+ }
344
346
  const currentListeners = Array.from(this.listeners);
345
347
  for (const listener of currentListeners) {
346
348
  try {
@@ -352,7 +354,9 @@ var ThemeSettingsStore = class {
352
354
  };
353
355
  // Method to properly clean up the store
354
356
  destroy = () => {
355
- if (this.isDestroyed) return;
357
+ if (this.isDestroyed) {
358
+ return;
359
+ }
356
360
  this.listeners.clear();
357
361
  this.isDestroyed = true;
358
362
  if (react.isBrowser && window.__weaverseThemeSettingsStore === this) {