@storepecker/editor-bridge 1.1.0 → 1.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/dist/index.d.mts CHANGED
@@ -31,6 +31,10 @@ interface LandingPageConfig {
31
31
  privacy_policy?: string;
32
32
  terms_and_condition?: string;
33
33
  refund_policy?: string;
34
+ url: string;
35
+ store_phone: string;
36
+ store_email: string;
37
+ store_address: string;
34
38
  }
35
39
  interface ThemeInfo {
36
40
  id: number;
@@ -44,29 +48,31 @@ interface NavbarConfig {
44
48
  wishlist: boolean;
45
49
  headerbg: string;
46
50
  textColor: string;
47
- logoPosition: string;
51
+ logoPosition: "left" | "center";
48
52
  ribbonbar: RibbonBarConfig;
49
53
  navElements: NavElement[];
50
54
  }
55
+ interface RibbonMessage {
56
+ id: string;
57
+ message: string;
58
+ link: string;
59
+ }
51
60
  interface RibbonBarConfig {
61
+ type: "ribbon-bar";
62
+ messages: RibbonMessage[];
63
+ textColor: string;
52
64
  id: string;
53
- type: string;
54
- messages: Array<{
55
- link: string;
56
- message: string;
57
- }>;
58
- position: string;
65
+ position: "top" | "bottom";
59
66
  animation: string;
60
- textColor: string;
61
67
  switchInterval: number;
62
68
  }
63
69
  interface NavElement {
64
70
  key: string;
65
- link?: string;
66
71
  title: string;
67
- enabled: boolean;
68
- description?: string;
69
72
  is_dropdown: boolean;
73
+ link?: string;
74
+ enabled?: boolean;
75
+ description: string;
70
76
  }
71
77
  interface ColorSchemeConfig {
72
78
  primary: string;
@@ -141,8 +147,8 @@ interface FontConfig {
141
147
  label?: string;
142
148
  value?: string;
143
149
  }
144
- type FilterType = 'category' | 'badge' | 'title';
145
- type FilterOption = 'select' | 'equals' | 'contain' | 'startWith' | 'endWith';
150
+ type FilterType = "category" | "badge" | "title";
151
+ type FilterOption = "select" | "equals" | "contain" | "startWith" | "endWith";
146
152
  interface SectionFilters {
147
153
  id: string;
148
154
  type: FilterType;
@@ -151,7 +157,7 @@ interface SectionFilters {
151
157
  value: string | string[];
152
158
  }
153
159
  interface ProductCollection {
154
- type: 'product-collection';
160
+ type: "product-collection";
155
161
  title?: string;
156
162
  filters?: SectionFilters[];
157
163
  id: string;
@@ -159,7 +165,7 @@ interface ProductCollection {
159
165
  enabled?: boolean;
160
166
  }
161
167
  interface CategorySection {
162
- type: 'categories';
168
+ type: "categories";
163
169
  title?: string;
164
170
  id?: string;
165
171
  categories?: any[];
@@ -167,7 +173,7 @@ interface CategorySection {
167
173
  enabled?: boolean;
168
174
  }
169
175
  interface Banner {
170
- type: 'banner';
176
+ type: "banner";
171
177
  title: string;
172
178
  description?: string;
173
179
  bannerImage: string;
@@ -180,7 +186,7 @@ interface Banner {
180
186
  enabled?: boolean;
181
187
  }
182
188
  interface SubCategorySection {
183
- type: 'sub-categories';
189
+ type: "sub-categories";
184
190
  id: number;
185
191
  title: string;
186
192
  category?: any;
@@ -193,20 +199,20 @@ interface PreFooterContent {
193
199
  description: string;
194
200
  }
195
201
  interface PreFooter {
196
- type: 'pre-footer';
202
+ type: "pre-footer";
197
203
  id: string;
198
204
  contents: PreFooterContent[];
199
205
  enabled?: boolean;
200
206
  }
201
207
  interface CategoryHighlights {
202
- type: 'category-highlights';
208
+ type: "category-highlights";
203
209
  title?: string;
204
210
  id?: string;
205
211
  categories: any[];
206
212
  enabled?: boolean;
207
213
  }
208
214
  interface StoreReview {
209
- type: 'store-review';
215
+ type: "store-review";
210
216
  id: string;
211
217
  title: string;
212
218
  filter: string;
@@ -216,14 +222,14 @@ interface StoreReview {
216
222
  enabled?: boolean;
217
223
  }
218
224
  interface ProductHighlight {
219
- type: 'product-highlight';
225
+ type: "product-highlight";
220
226
  id: string;
221
227
  title: string;
222
228
  productSlug: string;
223
229
  enabled?: boolean;
224
230
  }
225
231
  interface ImageWithText {
226
- type: 'image-with-text';
232
+ type: "image-with-text";
227
233
  id: string;
228
234
  title: string;
229
235
  content: string;
@@ -234,14 +240,14 @@ interface ImageWithText {
234
240
  enabled?: boolean;
235
241
  }
236
242
  interface Collections {
237
- type: 'collections';
243
+ type: "collections";
238
244
  id: string;
239
245
  title: string;
240
246
  slug: string;
241
247
  items: string[];
242
248
  enabled?: boolean;
243
249
  }
244
- type SectionType = 'product-collection' | 'categories' | 'banner' | 'sub-categories' | 'pre-footer' | 'category-highlights' | 'store-review' | 'product-highlight' | 'image-with-text' | 'collections';
250
+ type SectionType = "product-collection" | "categories" | "banner" | "sub-categories" | "pre-footer" | "category-highlights" | "store-review" | "product-highlight" | "image-with-text" | "collections";
245
251
  type Section = ProductCollection | CategorySection | Banner | PreFooter | StoreReview | CategoryHighlights | SubCategorySection | ProductHighlight | ImageWithText | Collections;
246
252
  /** @deprecated Use `Section` instead */
247
253
  type SectionItem = Section;
@@ -257,6 +263,9 @@ interface EditorProviderProps {
257
263
  * Default: "*" (accepts all — set NEXT_PUBLIC_EDITOR_ORIGIN in production!)
258
264
  */
259
265
  editorOrigin?: string;
266
+ callBacks?: {
267
+ onChanges?: (config: LandingPageConfig) => void;
268
+ };
260
269
  /**
261
270
  * Optional: custom CSS variable mapping. Override if your theme uses
262
271
  * different CSS property names than the default Starter Theme.
@@ -285,7 +294,7 @@ interface EditorProviderProps {
285
294
  * @param props.cssVarOverrides - Optional map to override default CSS variable name mappings.
286
295
  * @param props.children - Child components that consume editor context via hooks.
287
296
  */
288
- declare function EditorProvider({ initialConfig, editorOrigin, cssVarOverrides, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
297
+ declare function EditorProvider({ initialConfig, editorOrigin, cssVarOverrides, children, callBacks, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
289
298
 
290
299
  /**
291
300
  * Shape of the value provided by EditorContext.
@@ -445,145 +454,13 @@ interface MetaData {
445
454
  }
446
455
 
447
456
  type EditorMessage = {
448
- type: 'editor:init';
449
- payload: {
450
- config: LandingPageConfig;
451
- };
452
- } | {
453
457
  type: 'editor:full-replace';
454
458
  payload: {
455
459
  config: LandingPageConfig;
456
460
  };
457
461
  } | {
458
- type: 'editor:update';
459
- payload: {
460
- path: string;
461
- value: any;
462
- };
463
- } | {
464
- type: 'editor:hero-update';
465
- payload: Partial<HeroConfig>;
466
- } | {
467
- type: 'editor:hero-slide-add';
468
- payload: {
469
- slide: SliderSlide;
470
- position: number;
471
- };
472
- } | {
473
- type: 'editor:hero-slide-remove';
474
- payload: {
475
- slideId: string;
476
- };
477
- } | {
478
- type: 'editor:hero-slides-reorder';
479
- payload: {
480
- slideIds: string[];
481
- };
482
- } | {
483
- type: 'editor:hero-slide-update';
484
- payload: {
485
- slideId: string;
486
- data: Partial<SliderSlide>;
487
- };
488
- } | {
489
- type: 'editor:sections-reorder';
490
- payload: {
491
- sectionIds: string[];
492
- };
493
- } | {
494
- type: 'editor:section-add';
495
- payload: {
496
- section: Section;
497
- position: number;
498
- };
499
- } | {
500
- type: 'editor:section-remove';
501
- payload: {
502
- sectionId: string;
503
- };
504
- } | {
505
- type: 'editor:section-toggle';
506
- payload: {
507
- sectionId: string;
508
- enabled: boolean;
509
- };
510
- } | {
511
- type: 'editor:section-update';
512
- payload: {
513
- sectionId: string;
514
- data: Partial<Section>;
515
- };
516
- } | {
517
- type: 'editor:navbar-update';
518
- payload: Partial<LandingPageConfig['navbar']>;
519
- } | {
520
- type: 'editor:navbar-ribbon-update';
521
- payload: Partial<RibbonBarConfig>;
522
- } | {
523
- type: 'editor:navbar-ribbon-message-add';
524
- payload: {
525
- message: {
526
- link: string;
527
- message: string;
528
- };
529
- position: number;
530
- };
531
- } | {
532
- type: 'editor:navbar-ribbon-message-remove';
533
- payload: {
534
- index: number;
535
- };
536
- } | {
537
- type: 'editor:navbar-ribbon-messages-reorder';
538
- payload: {
539
- messages: Array<{
540
- link: string;
541
- message: string;
542
- }>;
543
- };
544
- } | {
545
- type: 'editor:navbar-element-update';
546
- payload: {
547
- key: string;
548
- data: Partial<NavElement>;
549
- };
550
- } | {
551
- type: 'editor:navbar-element-add';
552
- payload: {
553
- element: NavElement;
554
- position: number;
555
- };
556
- } | {
557
- type: 'editor:navbar-element-remove';
558
- payload: {
559
- key: string;
560
- };
561
- } | {
562
- type: 'editor:navbar-elements-reorder';
563
- payload: {
564
- elements: NavElement[];
565
- };
566
- } | {
567
- type: 'editor:footer-update';
568
- payload: Partial<FooterConfig>;
569
- } | {
570
- type: 'editor:color-scheme-update';
571
- payload: Partial<ColorSchemeConfig>;
572
- } | {
573
- type: 'editor:font-styles-update';
574
- payload: {
575
- body?: Partial<FontConfig>;
576
- heading?: Partial<FontConfig>;
577
- };
578
- } | {
579
- type: 'editor:social-links-update';
580
- payload: Partial<SocialLinksConfig>;
581
- } | {
582
- type: 'editor:branding-update';
583
- payload: Partial<Pick<LandingPageConfig, 'logo' | 'secondary_logo' | 'favicon' | 'store_name' | 'store_description'>>;
584
- } | {
585
- type: 'editor:advanced-update';
586
- payload: Partial<Pick<LandingPageConfig, 'custom_css' | 'custom_js' | 'start_head_tag' | 'end_head_tag' | 'start_body_tag' | 'end_body_tag' | 'google_tag_manager_id' | 'facebook_pixel_id'>>;
462
+ type: 'editor:update-settings';
463
+ payload: Partial<LandingPageConfig>;
587
464
  } | {
588
465
  type: 'editor:highlight-section';
589
466
  payload: {
package/dist/index.d.ts CHANGED
@@ -31,6 +31,10 @@ interface LandingPageConfig {
31
31
  privacy_policy?: string;
32
32
  terms_and_condition?: string;
33
33
  refund_policy?: string;
34
+ url: string;
35
+ store_phone: string;
36
+ store_email: string;
37
+ store_address: string;
34
38
  }
35
39
  interface ThemeInfo {
36
40
  id: number;
@@ -44,29 +48,31 @@ interface NavbarConfig {
44
48
  wishlist: boolean;
45
49
  headerbg: string;
46
50
  textColor: string;
47
- logoPosition: string;
51
+ logoPosition: "left" | "center";
48
52
  ribbonbar: RibbonBarConfig;
49
53
  navElements: NavElement[];
50
54
  }
55
+ interface RibbonMessage {
56
+ id: string;
57
+ message: string;
58
+ link: string;
59
+ }
51
60
  interface RibbonBarConfig {
61
+ type: "ribbon-bar";
62
+ messages: RibbonMessage[];
63
+ textColor: string;
52
64
  id: string;
53
- type: string;
54
- messages: Array<{
55
- link: string;
56
- message: string;
57
- }>;
58
- position: string;
65
+ position: "top" | "bottom";
59
66
  animation: string;
60
- textColor: string;
61
67
  switchInterval: number;
62
68
  }
63
69
  interface NavElement {
64
70
  key: string;
65
- link?: string;
66
71
  title: string;
67
- enabled: boolean;
68
- description?: string;
69
72
  is_dropdown: boolean;
73
+ link?: string;
74
+ enabled?: boolean;
75
+ description: string;
70
76
  }
71
77
  interface ColorSchemeConfig {
72
78
  primary: string;
@@ -141,8 +147,8 @@ interface FontConfig {
141
147
  label?: string;
142
148
  value?: string;
143
149
  }
144
- type FilterType = 'category' | 'badge' | 'title';
145
- type FilterOption = 'select' | 'equals' | 'contain' | 'startWith' | 'endWith';
150
+ type FilterType = "category" | "badge" | "title";
151
+ type FilterOption = "select" | "equals" | "contain" | "startWith" | "endWith";
146
152
  interface SectionFilters {
147
153
  id: string;
148
154
  type: FilterType;
@@ -151,7 +157,7 @@ interface SectionFilters {
151
157
  value: string | string[];
152
158
  }
153
159
  interface ProductCollection {
154
- type: 'product-collection';
160
+ type: "product-collection";
155
161
  title?: string;
156
162
  filters?: SectionFilters[];
157
163
  id: string;
@@ -159,7 +165,7 @@ interface ProductCollection {
159
165
  enabled?: boolean;
160
166
  }
161
167
  interface CategorySection {
162
- type: 'categories';
168
+ type: "categories";
163
169
  title?: string;
164
170
  id?: string;
165
171
  categories?: any[];
@@ -167,7 +173,7 @@ interface CategorySection {
167
173
  enabled?: boolean;
168
174
  }
169
175
  interface Banner {
170
- type: 'banner';
176
+ type: "banner";
171
177
  title: string;
172
178
  description?: string;
173
179
  bannerImage: string;
@@ -180,7 +186,7 @@ interface Banner {
180
186
  enabled?: boolean;
181
187
  }
182
188
  interface SubCategorySection {
183
- type: 'sub-categories';
189
+ type: "sub-categories";
184
190
  id: number;
185
191
  title: string;
186
192
  category?: any;
@@ -193,20 +199,20 @@ interface PreFooterContent {
193
199
  description: string;
194
200
  }
195
201
  interface PreFooter {
196
- type: 'pre-footer';
202
+ type: "pre-footer";
197
203
  id: string;
198
204
  contents: PreFooterContent[];
199
205
  enabled?: boolean;
200
206
  }
201
207
  interface CategoryHighlights {
202
- type: 'category-highlights';
208
+ type: "category-highlights";
203
209
  title?: string;
204
210
  id?: string;
205
211
  categories: any[];
206
212
  enabled?: boolean;
207
213
  }
208
214
  interface StoreReview {
209
- type: 'store-review';
215
+ type: "store-review";
210
216
  id: string;
211
217
  title: string;
212
218
  filter: string;
@@ -216,14 +222,14 @@ interface StoreReview {
216
222
  enabled?: boolean;
217
223
  }
218
224
  interface ProductHighlight {
219
- type: 'product-highlight';
225
+ type: "product-highlight";
220
226
  id: string;
221
227
  title: string;
222
228
  productSlug: string;
223
229
  enabled?: boolean;
224
230
  }
225
231
  interface ImageWithText {
226
- type: 'image-with-text';
232
+ type: "image-with-text";
227
233
  id: string;
228
234
  title: string;
229
235
  content: string;
@@ -234,14 +240,14 @@ interface ImageWithText {
234
240
  enabled?: boolean;
235
241
  }
236
242
  interface Collections {
237
- type: 'collections';
243
+ type: "collections";
238
244
  id: string;
239
245
  title: string;
240
246
  slug: string;
241
247
  items: string[];
242
248
  enabled?: boolean;
243
249
  }
244
- type SectionType = 'product-collection' | 'categories' | 'banner' | 'sub-categories' | 'pre-footer' | 'category-highlights' | 'store-review' | 'product-highlight' | 'image-with-text' | 'collections';
250
+ type SectionType = "product-collection" | "categories" | "banner" | "sub-categories" | "pre-footer" | "category-highlights" | "store-review" | "product-highlight" | "image-with-text" | "collections";
245
251
  type Section = ProductCollection | CategorySection | Banner | PreFooter | StoreReview | CategoryHighlights | SubCategorySection | ProductHighlight | ImageWithText | Collections;
246
252
  /** @deprecated Use `Section` instead */
247
253
  type SectionItem = Section;
@@ -257,6 +263,9 @@ interface EditorProviderProps {
257
263
  * Default: "*" (accepts all — set NEXT_PUBLIC_EDITOR_ORIGIN in production!)
258
264
  */
259
265
  editorOrigin?: string;
266
+ callBacks?: {
267
+ onChanges?: (config: LandingPageConfig) => void;
268
+ };
260
269
  /**
261
270
  * Optional: custom CSS variable mapping. Override if your theme uses
262
271
  * different CSS property names than the default Starter Theme.
@@ -285,7 +294,7 @@ interface EditorProviderProps {
285
294
  * @param props.cssVarOverrides - Optional map to override default CSS variable name mappings.
286
295
  * @param props.children - Child components that consume editor context via hooks.
287
296
  */
288
- declare function EditorProvider({ initialConfig, editorOrigin, cssVarOverrides, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
297
+ declare function EditorProvider({ initialConfig, editorOrigin, cssVarOverrides, children, callBacks, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
289
298
 
290
299
  /**
291
300
  * Shape of the value provided by EditorContext.
@@ -445,145 +454,13 @@ interface MetaData {
445
454
  }
446
455
 
447
456
  type EditorMessage = {
448
- type: 'editor:init';
449
- payload: {
450
- config: LandingPageConfig;
451
- };
452
- } | {
453
457
  type: 'editor:full-replace';
454
458
  payload: {
455
459
  config: LandingPageConfig;
456
460
  };
457
461
  } | {
458
- type: 'editor:update';
459
- payload: {
460
- path: string;
461
- value: any;
462
- };
463
- } | {
464
- type: 'editor:hero-update';
465
- payload: Partial<HeroConfig>;
466
- } | {
467
- type: 'editor:hero-slide-add';
468
- payload: {
469
- slide: SliderSlide;
470
- position: number;
471
- };
472
- } | {
473
- type: 'editor:hero-slide-remove';
474
- payload: {
475
- slideId: string;
476
- };
477
- } | {
478
- type: 'editor:hero-slides-reorder';
479
- payload: {
480
- slideIds: string[];
481
- };
482
- } | {
483
- type: 'editor:hero-slide-update';
484
- payload: {
485
- slideId: string;
486
- data: Partial<SliderSlide>;
487
- };
488
- } | {
489
- type: 'editor:sections-reorder';
490
- payload: {
491
- sectionIds: string[];
492
- };
493
- } | {
494
- type: 'editor:section-add';
495
- payload: {
496
- section: Section;
497
- position: number;
498
- };
499
- } | {
500
- type: 'editor:section-remove';
501
- payload: {
502
- sectionId: string;
503
- };
504
- } | {
505
- type: 'editor:section-toggle';
506
- payload: {
507
- sectionId: string;
508
- enabled: boolean;
509
- };
510
- } | {
511
- type: 'editor:section-update';
512
- payload: {
513
- sectionId: string;
514
- data: Partial<Section>;
515
- };
516
- } | {
517
- type: 'editor:navbar-update';
518
- payload: Partial<LandingPageConfig['navbar']>;
519
- } | {
520
- type: 'editor:navbar-ribbon-update';
521
- payload: Partial<RibbonBarConfig>;
522
- } | {
523
- type: 'editor:navbar-ribbon-message-add';
524
- payload: {
525
- message: {
526
- link: string;
527
- message: string;
528
- };
529
- position: number;
530
- };
531
- } | {
532
- type: 'editor:navbar-ribbon-message-remove';
533
- payload: {
534
- index: number;
535
- };
536
- } | {
537
- type: 'editor:navbar-ribbon-messages-reorder';
538
- payload: {
539
- messages: Array<{
540
- link: string;
541
- message: string;
542
- }>;
543
- };
544
- } | {
545
- type: 'editor:navbar-element-update';
546
- payload: {
547
- key: string;
548
- data: Partial<NavElement>;
549
- };
550
- } | {
551
- type: 'editor:navbar-element-add';
552
- payload: {
553
- element: NavElement;
554
- position: number;
555
- };
556
- } | {
557
- type: 'editor:navbar-element-remove';
558
- payload: {
559
- key: string;
560
- };
561
- } | {
562
- type: 'editor:navbar-elements-reorder';
563
- payload: {
564
- elements: NavElement[];
565
- };
566
- } | {
567
- type: 'editor:footer-update';
568
- payload: Partial<FooterConfig>;
569
- } | {
570
- type: 'editor:color-scheme-update';
571
- payload: Partial<ColorSchemeConfig>;
572
- } | {
573
- type: 'editor:font-styles-update';
574
- payload: {
575
- body?: Partial<FontConfig>;
576
- heading?: Partial<FontConfig>;
577
- };
578
- } | {
579
- type: 'editor:social-links-update';
580
- payload: Partial<SocialLinksConfig>;
581
- } | {
582
- type: 'editor:branding-update';
583
- payload: Partial<Pick<LandingPageConfig, 'logo' | 'secondary_logo' | 'favicon' | 'store_name' | 'store_description'>>;
584
- } | {
585
- type: 'editor:advanced-update';
586
- payload: Partial<Pick<LandingPageConfig, 'custom_css' | 'custom_js' | 'start_head_tag' | 'end_head_tag' | 'start_body_tag' | 'end_body_tag' | 'google_tag_manager_id' | 'facebook_pixel_id'>>;
462
+ type: 'editor:update-settings';
463
+ payload: Partial<LandingPageConfig>;
587
464
  } | {
588
465
  type: 'editor:highlight-section';
589
466
  payload: {