@websolutespa/bom-mixer-hooks 1.8.9 → 1.8.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @websolutespa/bom-mixer-hooks
2
2
 
3
+ ## 1.8.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: usePage typings
8
+ - Updated dependencies
9
+ - Updated dependencies
10
+ - @websolutespa/bom-mixer-store@1.8.11
11
+ - @websolutespa/bom-mixer-models@1.8.18
12
+
13
+ ## 1.8.10
14
+
15
+ ### Patch Changes
16
+
17
+ - 88267c3: Modified: useAutosizeTextArea
18
+
3
19
  ## 1.8.9
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { RefObject, Dispatch, SetStateAction, CSSProperties, MutableRefObject, ComponentProps, useEffect } from 'react';
3
3
  import { ApiRequestOptions } from '@websolutespa/bom-mixer-store';
4
- import { QueryParams, IEquatable, IFeatureType, ILabel, ILocalizable, ILayout, IPage } from '@websolutespa/bom-core';
4
+ import * as _websolutespa_bom_core from '@websolutespa/bom-core';
5
+ import { QueryParams, IEquatable, IFeatureType, ILabel, ILocalizable, ILayout, ILocalized, IPage } from '@websolutespa/bom-core';
5
6
  import * as zustand from 'zustand';
6
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
  import { ILazyModules } from '@websolutespa/bom-mixer-models';
@@ -410,11 +411,368 @@ declare function useMounted(): boolean;
410
411
 
411
412
  declare function useNumber(options?: Intl.NumberFormatOptions, locale?: string): (value: number) => string;
412
413
 
413
- type IPageContext = IPage;
414
- declare const usePage: () => NonNullable<IPageContext>;
414
+ type IPageContext = ILocalized<IPage>;
415
+ declare const usePage: () => {
416
+ [x: string]: unknown;
417
+ id: _websolutespa_bom_core.IEquatable;
418
+ schema: string;
419
+ title: string;
420
+ abstract?: string | undefined;
421
+ description?: string | undefined;
422
+ media?: {
423
+ [x: string]: unknown;
424
+ id?: string | undefined;
425
+ alt?: string | undefined;
426
+ filename?: string | undefined;
427
+ mimeType?: string | undefined;
428
+ filesize?: number | undefined;
429
+ focalX?: number | undefined;
430
+ focalY?: number | undefined;
431
+ createdAt?: string | Date | undefined;
432
+ updatedAt?: string | Date | undefined;
433
+ url?: string | undefined;
434
+ title?: string | undefined;
435
+ abstract?: string | undefined;
436
+ type: string;
437
+ src?: string | undefined;
438
+ media?: any | undefined;
439
+ width?: string | number | undefined;
440
+ height?: string | number | undefined;
441
+ } | undefined;
442
+ meta?: {
443
+ title?: string | undefined;
444
+ description?: string | undefined;
445
+ keywords?: string | undefined;
446
+ robots?: string | undefined;
447
+ } | undefined;
448
+ components?: _websolutespa_bom_core.IComponent[] | undefined;
449
+ category: {
450
+ readonly [x: number]: string;
451
+ [x: string]: unknown;
452
+ toString: () => string;
453
+ charAt: (pos: number) => string;
454
+ charCodeAt: (index: number) => number;
455
+ concat: (...strings: string[]) => string;
456
+ indexOf: (searchString: string, position?: number | undefined) => number;
457
+ lastIndexOf: (searchString: string, position?: number | undefined) => number;
458
+ localeCompare: {
459
+ (that: string): number;
460
+ (that: string, locales?: string | string[] | undefined, options?: Intl.CollatorOptions | undefined): number;
461
+ (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions | undefined): number;
462
+ };
463
+ match: {
464
+ (regexp: string | RegExp): RegExpMatchArray | null;
465
+ (matcher: {
466
+ [Symbol.match](string: string): RegExpMatchArray | null;
467
+ }): RegExpMatchArray | null;
468
+ };
469
+ replace: {
470
+ (searchValue: string | RegExp, replaceValue: string): string;
471
+ (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
472
+ (searchValue: {
473
+ [Symbol.replace](string: string, replaceValue: string): string;
474
+ }, replaceValue: string): string;
475
+ (searchValue: {
476
+ [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
477
+ }, replacer: (substring: string, ...args: any[]) => string): string;
478
+ };
479
+ search: {
480
+ (regexp: string | RegExp): number;
481
+ (searcher: {
482
+ [Symbol.search](string: string): number;
483
+ }): number;
484
+ };
485
+ slice: (start?: number | undefined, end?: number | undefined) => string;
486
+ split: {
487
+ (separator: string | RegExp, limit?: number | undefined): string[];
488
+ (splitter: {
489
+ [Symbol.split](string: string, limit?: number | undefined): string[];
490
+ }, limit?: number | undefined): string[];
491
+ };
492
+ substring: (start: number, end?: number | undefined) => string;
493
+ toLowerCase: () => string;
494
+ toLocaleLowerCase: {
495
+ (locales?: string | string[] | undefined): string;
496
+ (locales?: Intl.LocalesArgument): string;
497
+ };
498
+ toUpperCase: () => string;
499
+ toLocaleUpperCase: {
500
+ (locales?: string | string[] | undefined): string;
501
+ (locales?: Intl.LocalesArgument): string;
502
+ };
503
+ trim: () => string;
504
+ readonly length: number;
505
+ substr: (from: number, length?: number | undefined) => string;
506
+ valueOf: () => string;
507
+ codePointAt: (pos: number) => number | undefined;
508
+ includes: (searchString: string, position?: number | undefined) => boolean;
509
+ endsWith: (searchString: string, endPosition?: number | undefined) => boolean;
510
+ normalize: {
511
+ (form: "NFC" | "NFD" | "NFKC" | "NFKD"): string;
512
+ (form?: string | undefined): string;
513
+ };
514
+ repeat: (count: number) => string;
515
+ startsWith: (searchString: string, position?: number | undefined) => boolean;
516
+ anchor: (name: string) => string;
517
+ big: () => string;
518
+ blink: () => string;
519
+ bold: () => string;
520
+ fixed: () => string;
521
+ fontcolor: (color: string) => string;
522
+ fontsize: {
523
+ (size: number): string;
524
+ (size: string): string;
525
+ };
526
+ italics: () => string;
527
+ link: (url: string) => string;
528
+ small: () => string;
529
+ strike: () => string;
530
+ sub: () => string;
531
+ sup: () => string;
532
+ padStart: (maxLength: number, fillString?: string | undefined) => string;
533
+ padEnd: (maxLength: number, fillString?: string | undefined) => string;
534
+ trimEnd: () => string;
535
+ trimStart: () => string;
536
+ trimLeft: () => string;
537
+ trimRight: () => string;
538
+ matchAll: (regexp: RegExp) => IterableIterator<RegExpExecArray>;
539
+ replaceAll: {
540
+ (searchValue: string | RegExp, replaceValue: string): string;
541
+ (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
542
+ };
543
+ at: (index: number) => string | undefined;
544
+ [Symbol.iterator]: () => IterableIterator<string>;
545
+ id: _websolutespa_bom_core.IEquatable;
546
+ schema?: string | undefined;
547
+ category?: _websolutespa_bom_core.IEquatable | {
548
+ [x: string]: unknown;
549
+ id: _websolutespa_bom_core.IEquatable;
550
+ schema?: string | undefined;
551
+ category?: _websolutespa_bom_core.IEquatable | any | undefined;
552
+ media?: {
553
+ [x: string]: unknown;
554
+ id?: string | undefined;
555
+ alt?: string | undefined;
556
+ filename?: string | undefined;
557
+ mimeType?: string | undefined;
558
+ filesize?: number | undefined;
559
+ focalX?: number | undefined;
560
+ focalY?: number | undefined;
561
+ createdAt?: string | Date | undefined;
562
+ updatedAt?: string | Date | undefined;
563
+ url?: string | undefined;
564
+ title?: string | undefined;
565
+ abstract?: string | undefined;
566
+ type: string;
567
+ src?: string | undefined;
568
+ media?: any | undefined;
569
+ width?: string | number | undefined;
570
+ height?: string | number | undefined;
571
+ } | undefined;
572
+ order?: number | undefined;
573
+ slug: string;
574
+ title: string;
575
+ isHidden?: boolean | undefined;
576
+ } | undefined;
577
+ media?: {
578
+ [x: string]: unknown;
579
+ id?: string | undefined;
580
+ alt?: string | undefined;
581
+ filename?: string | undefined;
582
+ mimeType?: string | undefined;
583
+ filesize?: number | undefined;
584
+ focalX?: number | undefined;
585
+ focalY?: number | undefined;
586
+ createdAt?: string | Date | undefined;
587
+ updatedAt?: string | Date | undefined;
588
+ url?: string | undefined;
589
+ title?: string | undefined;
590
+ abstract?: string | undefined;
591
+ type: string;
592
+ src?: string | undefined;
593
+ media?: any | undefined;
594
+ width?: string | number | undefined;
595
+ height?: string | number | undefined;
596
+ } | undefined;
597
+ order?: number | undefined;
598
+ slug: string;
599
+ title: string;
600
+ isHidden?: boolean | undefined;
601
+ href: string;
602
+ } | {
603
+ [x: string]: unknown;
604
+ toString: (radix?: number | undefined) => string;
605
+ toFixed: (fractionDigits?: number | undefined) => string;
606
+ toExponential: (fractionDigits?: number | undefined) => string;
607
+ toPrecision: (precision?: number | undefined) => string;
608
+ valueOf: () => number;
609
+ toLocaleString: {
610
+ (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): string;
611
+ (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions | undefined): string;
612
+ };
613
+ id: _websolutespa_bom_core.IEquatable;
614
+ schema?: string | undefined;
615
+ category?: _websolutespa_bom_core.IEquatable | {
616
+ [x: string]: unknown;
617
+ id: _websolutespa_bom_core.IEquatable;
618
+ schema?: string | undefined;
619
+ category?: _websolutespa_bom_core.IEquatable | any | undefined;
620
+ media?: {
621
+ [x: string]: unknown;
622
+ id?: string | undefined;
623
+ alt?: string | undefined;
624
+ filename?: string | undefined;
625
+ mimeType?: string | undefined;
626
+ filesize?: number | undefined;
627
+ focalX?: number | undefined;
628
+ focalY?: number | undefined;
629
+ createdAt?: string | Date | undefined;
630
+ updatedAt?: string | Date | undefined;
631
+ url?: string | undefined;
632
+ title?: string | undefined;
633
+ abstract?: string | undefined;
634
+ type: string;
635
+ src?: string | undefined;
636
+ media?: any | undefined;
637
+ width?: string | number | undefined;
638
+ height?: string | number | undefined;
639
+ } | undefined;
640
+ order?: number | undefined;
641
+ slug: string;
642
+ title: string;
643
+ isHidden?: boolean | undefined;
644
+ } | undefined;
645
+ media?: {
646
+ [x: string]: unknown;
647
+ id?: string | undefined;
648
+ alt?: string | undefined;
649
+ filename?: string | undefined;
650
+ mimeType?: string | undefined;
651
+ filesize?: number | undefined;
652
+ focalX?: number | undefined;
653
+ focalY?: number | undefined;
654
+ createdAt?: string | Date | undefined;
655
+ updatedAt?: string | Date | undefined;
656
+ url?: string | undefined;
657
+ title?: string | undefined;
658
+ abstract?: string | undefined;
659
+ type: string;
660
+ src?: string | undefined;
661
+ media?: any | undefined;
662
+ width?: string | number | undefined;
663
+ height?: string | number | undefined;
664
+ } | undefined;
665
+ order?: number | undefined;
666
+ slug: string;
667
+ title: string;
668
+ isHidden?: boolean | undefined;
669
+ href: string;
670
+ } | {
671
+ [x: string]: unknown;
672
+ id: _websolutespa_bom_core.IEquatable;
673
+ schema?: string | undefined;
674
+ category?: _websolutespa_bom_core.IEquatable | {
675
+ [x: string]: unknown;
676
+ id: _websolutespa_bom_core.IEquatable;
677
+ schema?: string | undefined;
678
+ category?: _websolutespa_bom_core.IEquatable | any | undefined;
679
+ media?: {
680
+ [x: string]: unknown;
681
+ id?: string | undefined;
682
+ alt?: string | undefined;
683
+ filename?: string | undefined;
684
+ mimeType?: string | undefined;
685
+ filesize?: number | undefined;
686
+ focalX?: number | undefined;
687
+ focalY?: number | undefined;
688
+ createdAt?: string | Date | undefined;
689
+ updatedAt?: string | Date | undefined;
690
+ url?: string | undefined;
691
+ title?: string | undefined;
692
+ abstract?: string | undefined;
693
+ type: string;
694
+ src?: string | undefined;
695
+ media?: any | undefined;
696
+ width?: string | number | undefined;
697
+ height?: string | number | undefined;
698
+ } | undefined;
699
+ order?: number | undefined;
700
+ slug: string;
701
+ title: string;
702
+ isHidden?: boolean | undefined;
703
+ } | undefined;
704
+ media?: {
705
+ [x: string]: unknown;
706
+ id?: string | undefined;
707
+ alt?: string | undefined;
708
+ filename?: string | undefined;
709
+ mimeType?: string | undefined;
710
+ filesize?: number | undefined;
711
+ focalX?: number | undefined;
712
+ focalY?: number | undefined;
713
+ createdAt?: string | Date | undefined;
714
+ updatedAt?: string | Date | undefined;
715
+ url?: string | undefined;
716
+ title?: string | undefined;
717
+ abstract?: string | undefined;
718
+ type: string;
719
+ src?: string | undefined;
720
+ media?: any | undefined;
721
+ width?: string | number | undefined;
722
+ height?: string | number | undefined;
723
+ } | undefined;
724
+ order?: number | undefined;
725
+ slug: string;
726
+ title: string;
727
+ isHidden?: boolean | undefined;
728
+ href: string;
729
+ };
730
+ slug: string;
731
+ template?: string | undefined;
732
+ isDefault?: boolean | undefined;
733
+ useSplat?: boolean | undefined;
734
+ order?: number | undefined;
735
+ markets?: string[] | undefined;
736
+ createdAt?: Date | undefined;
737
+ updatedAt?: Date | undefined;
738
+ _status?: string | undefined;
739
+ alternates: _websolutespa_bom_core.IRoute[];
740
+ breadcrumb: _websolutespa_bom_core.IRouteLink[];
741
+ href: string;
742
+ locale: string;
743
+ market: string;
744
+ parentRoute?: {
745
+ category: _websolutespa_bom_core.IEquatable;
746
+ href: string;
747
+ id: _websolutespa_bom_core.IEquatable;
748
+ items?: _websolutespa_bom_core.IRouteLink[] | undefined;
749
+ media?: {
750
+ [x: string]: unknown;
751
+ id?: string | undefined;
752
+ alt?: string | undefined;
753
+ filename?: string | undefined;
754
+ mimeType?: string | undefined;
755
+ filesize?: number | undefined;
756
+ focalX?: number | undefined;
757
+ focalY?: number | undefined;
758
+ createdAt?: string | Date | undefined;
759
+ updatedAt?: string | Date | undefined;
760
+ url?: string | undefined;
761
+ title?: string | undefined;
762
+ abstract?: string | undefined;
763
+ type: string;
764
+ src?: string | undefined;
765
+ media?: any | undefined;
766
+ width?: string | number | undefined;
767
+ height?: string | number | undefined;
768
+ } | undefined;
769
+ schema: string;
770
+ title: string;
771
+ } | undefined;
772
+ };
415
773
  declare function PageProvider({ children, page }: {
416
774
  children?: react__default.ReactNode;
417
- page: IPage;
775
+ page: ILocalized<IPage>;
418
776
  }): react_jsx_runtime.JSX.Element;
419
777
 
420
778
  type IPageRouteOptions = {
package/dist/index.js CHANGED
@@ -291,8 +291,8 @@ var import_react3 = require("react");
291
291
  function useAutosizeTextArea(textAreaRef, value) {
292
292
  (0, import_react3.useEffect)(() => {
293
293
  if (textAreaRef) {
294
- textAreaRef.style.height = "0px";
295
- textAreaRef.style.height = textAreaRef.scrollHeight + 1 + "px";
294
+ textAreaRef.style.minHeight = "0px";
295
+ textAreaRef.style.minHeight = textAreaRef.scrollHeight + "px";
296
296
  }
297
297
  }, [textAreaRef, value]);
298
298
  }
package/dist/index.mjs CHANGED
@@ -144,8 +144,8 @@ import { useEffect as useEffect2 } from "react";
144
144
  function useAutosizeTextArea(textAreaRef, value) {
145
145
  useEffect2(() => {
146
146
  if (textAreaRef) {
147
- textAreaRef.style.height = "0px";
148
- textAreaRef.style.height = textAreaRef.scrollHeight + 1 + "px";
147
+ textAreaRef.style.minHeight = "0px";
148
+ textAreaRef.style.minHeight = textAreaRef.scrollHeight + "px";
149
149
  }
150
150
  }, [textAreaRef, value]);
151
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-hooks",
3
- "version": "1.8.9",
3
+ "version": "1.8.11",
4
4
  "description": "Mixer Hooks module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -6,8 +6,8 @@ export function useAutosizeTextArea(
6
6
  ) {
7
7
  useEffect(() => {
8
8
  if (textAreaRef) {
9
- textAreaRef.style.height = '0px';
10
- textAreaRef.style.height = textAreaRef.scrollHeight + 1 + 'px';
9
+ textAreaRef.style.minHeight = '0px';
10
+ textAreaRef.style.minHeight = textAreaRef.scrollHeight + 'px';
11
11
  }
12
12
  }, [textAreaRef, value]);
13
13
  }
@@ -35,103 +35,11 @@ export const LayoutDefaults: ILayout = {
35
35
  items: [],
36
36
  media: {
37
37
  type: 'image',
38
- src: 'https://bom-mixer.wslabs.it/assets/header/6366_n_tiles.jpg',
39
- },
40
- },
41
- {
42
- id: 'product_category_element',
43
- type: 'category',
44
- title: '3D Elements',
45
- category: 'product_category_element',
46
- href: '#collections/3d-elements',
47
- items: [],
48
- media: {
49
- type: 'image',
50
- src: 'https://bom-mixer.wslabs.it/assets/header/6369_n_3d_elements_menu_cover.webp',
51
- },
52
- },
53
- {
54
- id: 'product_category_paint',
55
- type: 'category',
56
- title: 'Paints',
57
- category: 'product_category_paint',
58
- href: '#collections/paints',
59
- items: [],
60
- media: {
61
- type: 'image',
62
- src: 'https://bom-mixer.wslabs.it/assets/header/6367_n_paints.jpg',
63
- },
64
- },
65
- {
66
- id: 'product_category_woodmetal',
67
- type: 'category',
68
- title: 'Wood & Metal',
69
- category: 'product_category_woodmetal',
70
- href: '#collections/wood-and-metal',
71
- items: [],
72
- media: {
73
- type: 'image',
74
- src: 'https://bom-mixer.wslabs.it/assets/header/6368_n_menu_wood_metal.webp',
75
- },
76
- },
77
- {
78
- id: 'product_category_accessory',
79
- type: 'category',
80
- title: 'Accessories',
81
- category: 'product_category_accessory',
82
- href: '#collections/accessories',
83
- items: [],
84
- media: {
85
- type: 'image',
86
- src: 'https://bom-mixer.wslabs.it/assets/header/6371_n_accessories.jpg',
87
- },
88
- },
89
- {
90
- id: 'product_category_edition',
91
- type: 'category',
92
- title: 'Editions',
93
- category: 'product_category_edition',
94
- href: '#collections/editions',
95
- items: [],
96
- media: {
97
- type: 'image',
98
- src: 'https://bom-mixer.wslabs.it/assets/header/7858_n_Menu.webp',
38
+ src: 'https://placehold.co/960x600/e4e5eb/f4f5fb.webp?text=placehold',
99
39
  },
100
40
  },
101
41
  ],
102
42
  },
103
- {
104
- id: 2,
105
- type: 'category',
106
- title: 'Magazine',
107
- category: 'magazine_index',
108
- href: '#magazine',
109
- items: [],
110
- },
111
- {
112
- id: 3,
113
- type: 'category',
114
- title: 'Stores',
115
- category: 'store_index',
116
- href: '#stores',
117
- items: [],
118
- },
119
- {
120
- id: 4,
121
- type: 'category',
122
- title: 'Contact us',
123
- category: 'contact',
124
- href: '#contact-us',
125
- items: [],
126
- },
127
- {
128
- id: 5,
129
- type: 'category',
130
- title: 'Shop',
131
- category: 'shop_index',
132
- href: '#shop',
133
- items: [],
134
- },
135
43
  ],
136
44
  },
137
45
  },
@@ -1,12 +1,12 @@
1
- import { IPage } from '@websolutespa/bom-core';
1
+ import { ILocalized, IPage } from '@websolutespa/bom-core';
2
2
  import React from 'react';
3
3
  import { createGenericContext } from '../useGenericContext/useGenericContext';
4
4
 
5
- export type IPageContext = IPage;
5
+ export type IPageContext = ILocalized<IPage>;
6
6
 
7
7
  const [usePage, PageContextProvider] = createGenericContext<IPageContext>();
8
8
 
9
- function PageProvider({ children, page }: { children?: React.ReactNode, page: IPage }) {
9
+ function PageProvider({ children, page }: { children?: React.ReactNode, page: ILocalized<IPage> }) {
10
10
  return (
11
11
  <PageContextProvider value={page}>
12
12
  {children}