@ecomiq/storefront 0.1.0 → 0.1.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/package.json CHANGED
@@ -21,6 +21,10 @@
21
21
  "README.md"
22
22
  ],
23
23
  "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ },
24
28
  "./core": {
25
29
  "types": "./dist/core.d.ts",
26
30
  "import": "./dist/core.js"
@@ -50,7 +54,7 @@
50
54
  "optional": true
51
55
  }
52
56
  },
53
- "version": "0.1.0",
57
+ "version": "0.1.2",
54
58
  "dependencies": {
55
59
  "@opennextjs/cloudflare": "^1.3.1",
56
60
  "@hookform/resolvers": "5.0.1",
@@ -1,119 +0,0 @@
1
- import * as zustand from 'zustand';
2
- import { S as StorefrontSettings, a as StorefrontProduct, b as StorefrontProductDetail, c as StorefrontCollection } from './store-CYBCpY6v.js';
3
- import * as react from 'react';
4
- import { ReactNode, ComponentType, JSX } from 'react';
5
- import { StorefrontProductDetail as StorefrontProductDetail$1, StorefrontVariant, StoreTheme, StorefrontSettings as StorefrontSettings$1, StorefrontPageDetail } from '@ecomiq/storefront/react';
6
-
7
- type Drawers = {
8
- cart: boolean;
9
- search: boolean;
10
- menu: boolean;
11
- filter: boolean;
12
- [key: string]: boolean;
13
- };
14
- type Modals = {
15
- login: boolean;
16
- signup: boolean;
17
- [key: string]: boolean;
18
- };
19
- type StoreState = {
20
- data: StorefrontSettings | null;
21
- drawers: Drawers;
22
- modals: Modals;
23
- openDrawer: (drawer: keyof Drawers) => void;
24
- closeDrawer: (drawer: keyof Drawers) => void;
25
- toggleDrawer: (drawer: keyof Drawers) => void;
26
- closeAllDrawers: () => void;
27
- openModal: (modal: keyof Modals) => void;
28
- closeModal: (modal: keyof Modals) => void;
29
- toggleModal: (modal: keyof Modals) => void;
30
- closeAllModals: () => void;
31
- };
32
- declare const useStore: zustand.UseBoundStore<zustand.StoreApi<StoreState>>;
33
-
34
- type CmsRenderSettings = Record<string, unknown>;
35
- type CmsRenderBlock = {
36
- id?: string;
37
- type: string;
38
- order: number;
39
- settings?: CmsRenderSettings;
40
- };
41
- type CmsRenderSection = {
42
- id?: string;
43
- type: string;
44
- order: number;
45
- settings?: CmsRenderSettings;
46
- blocks?: CmsRenderBlock[];
47
- };
48
- type CmsProduct = StorefrontProduct | StorefrontProductDetail;
49
- type CmsSectionData = {
50
- products?: CmsProduct[];
51
- collections?: StorefrontCollection[];
52
- };
53
- type CmsLinkProps = {
54
- href: string;
55
- className?: string;
56
- children: ReactNode;
57
- };
58
- type CmsSectionsRendererProps = {
59
- sections: CmsRenderSection[];
60
- sectionData?: Record<string, CmsSectionData>;
61
- linkComponent?: ComponentType<CmsLinkProps>;
62
- currency?: string;
63
- preview?: boolean;
64
- wrap?: boolean;
65
- };
66
-
67
- declare function getCmsSectionKey(section: CmsRenderSection, index: number): string;
68
- declare function canonicalSectionType(type: string): string;
69
- declare function storefrontHref(value: string): string;
70
- declare function productSortValue(value: string): string;
71
- declare function sanitizeHtml(html: string): string;
72
- declare const DEFAULT_CMS_IMAGE_URL: string;
73
-
74
- /** Option group derived from variants (e.g. Color: [Black, White], Size: [6x8, 8x11]) */
75
- type OptionGroup = {
76
- key: string;
77
- name: string;
78
- values: string[];
79
- };
80
- /** Selected options per group (e.g. { Color: "Black", Size: "8 x 11 inch" }) */
81
- type SelectedOptions = Record<string, string>;
82
- type ProductVariantSelectorRenderProps = {
83
- product: StorefrontProductDetail$1;
84
- selectedVariant: StorefrontVariant | null;
85
- displayPrice: number;
86
- compareAtPrice: number | null | undefined;
87
- isAvailable: boolean;
88
- selectedOptions: SelectedOptions;
89
- };
90
-
91
- type ProductVariantSelectorProps = {
92
- product: StorefrontProductDetail$1;
93
- currency?: string;
94
- features?: string[];
95
- onVariantChange?: (variant: StorefrontVariant | null, price: number) => void;
96
- children?: (props: {
97
- product: StorefrontProductDetail$1;
98
- selectedVariant: StorefrontVariant | null;
99
- displayPrice: number;
100
- compareAtPrice: number | null | undefined;
101
- isAvailable: boolean;
102
- selectedOptions: SelectedOptions;
103
- }) => React.ReactNode;
104
- };
105
- declare function ProductVariantSelector({ product, currency, features, onVariantChange, children, }: ProductVariantSelectorProps): react.JSX.Element;
106
-
107
- interface ThemeInjectorProps {
108
- theme: StoreTheme;
109
- className?: string;
110
- }
111
- declare function SafeThemeInjector({ theme, className }: ThemeInjectorProps): JSX.Element | null;
112
-
113
- /**
114
- * Busca una página CMS en `settings.cms.pages` (payload de `getPublicStore` / settings)
115
- * y la valida como `StorefrontPageDetail` para `DynamicPage`.
116
- */
117
- declare function findStorefrontCmsPageBySlug(settings: StorefrontSettings$1 | null | undefined, slug: string): StorefrontPageDetail | null;
118
-
119
- export { type CmsSectionsRendererProps as C, DEFAULT_CMS_IMAGE_URL as D, type OptionGroup as O, ProductVariantSelector as P, SafeThemeInjector as S, storefrontHref as a, type CmsLinkProps as b, canonicalSectionType as c, type CmsProduct as d, type CmsRenderBlock as e, findStorefrontCmsPageBySlug as f, getCmsSectionKey as g, type CmsRenderSection as h, type CmsRenderSettings as i, type CmsSectionData as j, type ProductVariantSelectorProps as k, type SelectedOptions as l, type ProductVariantSelectorRenderProps as m, productSortValue as p, sanitizeHtml as s, useStore as u };