@crystaldesign/widget-library 25.3.0-beta.4 → 25.3.0-beta.43

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.
Files changed (76) hide show
  1. package/build/esm/index.js +925 -0
  2. package/build/types/widget-library/src/components/Gallery/ArActionIcon/index.d.ts +11 -0
  3. package/build/types/widget-library/src/components/Gallery/ArActionIcon/index.d.ts.map +1 -0
  4. package/build/types/widget-library/src/components/Gallery/MediaItem/ArItem/index.d.ts +18 -0
  5. package/build/types/widget-library/src/components/Gallery/MediaItem/ArItem/index.d.ts.map +1 -0
  6. package/build/types/widget-library/src/components/Gallery/MediaItem/SirvItem/index.d.ts +10 -0
  7. package/build/types/widget-library/src/components/Gallery/MediaItem/SirvItem/index.d.ts.map +1 -0
  8. package/build/types/widget-library/src/components/Gallery/MediaItem/index.d.ts +12 -0
  9. package/build/types/widget-library/src/components/Gallery/MediaItem/index.d.ts.map +1 -0
  10. package/build/types/widget-library/src/components/Gallery/PageNumber/index.d.ts +8 -0
  11. package/build/types/widget-library/src/components/Gallery/PageNumber/index.d.ts.map +1 -0
  12. package/build/types/widget-library/src/components/Gallery/Thumb/index.d.ts +9 -0
  13. package/build/types/widget-library/src/components/Gallery/Thumb/index.d.ts.map +1 -0
  14. package/build/types/widget-library/src/components/Gallery/index.d.ts +5 -0
  15. package/build/types/widget-library/src/components/Gallery/index.d.ts.map +1 -0
  16. package/build/types/widget-library/src/components/Gallery/types.d.ts +38 -0
  17. package/build/types/widget-library/src/components/Gallery/types.d.ts.map +1 -0
  18. package/build/types/widget-library/src/components/Gallery/useGallery.d.ts +15 -0
  19. package/build/types/widget-library/src/components/Gallery/useGallery.d.ts.map +1 -0
  20. package/build/types/widget-library/src/components/actions/Action/index.d.ts +4 -0
  21. package/build/types/widget-library/src/components/actions/Action/index.d.ts.map +1 -0
  22. package/build/types/widget-library/src/components/actions/ActionGroup/index.d.ts +4 -0
  23. package/build/types/widget-library/src/components/actions/ActionGroup/index.d.ts.map +1 -0
  24. package/build/types/widget-library/src/components/actions/index.d.ts +4 -0
  25. package/build/types/widget-library/src/components/actions/index.d.ts.map +1 -0
  26. package/build/types/widget-library/src/components/actions/types.d.ts +27 -0
  27. package/build/types/widget-library/src/components/actions/types.d.ts.map +1 -0
  28. package/build/types/widget-library/src/components/index.d.ts +4 -0
  29. package/build/types/widget-library/src/components/index.d.ts.map +1 -0
  30. package/build/types/widget-library/src/components/texts/Text/index.d.ts +5 -0
  31. package/build/types/widget-library/src/components/texts/Text/index.d.ts.map +1 -0
  32. package/build/types/widget-library/src/components/texts/TextBlock/index.d.ts +4 -0
  33. package/build/types/widget-library/src/components/texts/TextBlock/index.d.ts.map +1 -0
  34. package/build/types/widget-library/src/components/texts/index.d.ts +4 -0
  35. package/build/types/widget-library/src/components/texts/index.d.ts.map +1 -0
  36. package/build/types/widget-library/src/components/texts/types.d.ts +14 -0
  37. package/build/types/widget-library/src/components/texts/types.d.ts.map +1 -0
  38. package/build/types/widget-library/src/hooks/index.d.ts +4 -0
  39. package/build/types/widget-library/src/hooks/index.d.ts.map +1 -0
  40. package/build/types/widget-library/src/hooks/useConfiguration.d.ts +2 -0
  41. package/build/types/widget-library/src/hooks/useConfiguration.d.ts.map +1 -0
  42. package/build/types/widget-library/src/hooks/useCss.d.ts +3 -0
  43. package/build/types/widget-library/src/hooks/useCss.d.ts.map +1 -0
  44. package/build/types/widget-library/src/hooks/useMedia.d.ts +9 -0
  45. package/build/types/widget-library/src/hooks/useMedia.d.ts.map +1 -0
  46. package/build/types/widget-library/src/hooks/useProductData.d.ts +12 -0
  47. package/build/types/widget-library/src/hooks/useProductData.d.ts.map +1 -0
  48. package/build/types/widget-library/src/hooks/useSirv.d.ts +7 -0
  49. package/build/types/widget-library/src/hooks/useSirv.d.ts.map +1 -0
  50. package/build/types/widget-library/src/index.d.ts +4 -0
  51. package/build/types/widget-library/src/index.d.ts.map +1 -1
  52. package/build/types/widget-library/src/tests/components/actions/Action.test.d.ts +2 -0
  53. package/build/types/widget-library/src/tests/components/actions/Action.test.d.ts.map +1 -0
  54. package/build/types/widget-library/src/tests/components/actions/ActionGroup.test.d.ts +2 -0
  55. package/build/types/widget-library/src/tests/components/actions/ActionGroup.test.d.ts.map +1 -0
  56. package/build/types/widget-library/src/tests/components/texts/Text.test.d.ts +2 -0
  57. package/build/types/widget-library/src/tests/components/texts/Text.test.d.ts.map +1 -0
  58. package/build/types/widget-library/src/tests/components/texts/TextBlock.test.d.ts +2 -0
  59. package/build/types/widget-library/src/tests/components/texts/TextBlock.test.d.ts.map +1 -0
  60. package/build/types/widget-library/src/tests/utils/replaceActions.test.d.ts +2 -0
  61. package/build/types/widget-library/src/tests/utils/replaceActions.test.d.ts.map +1 -0
  62. package/build/types/widget-library/src/tests/utils/replaceTemplateString.test.d.ts +2 -0
  63. package/build/types/widget-library/src/tests/utils/replaceTemplateString.test.d.ts.map +1 -0
  64. package/build/types/widget-library/src/tests/utils/updateCssInDom.test.d.ts +2 -0
  65. package/build/types/widget-library/src/tests/utils/updateCssInDom.test.d.ts.map +1 -0
  66. package/build/types/widget-library/src/types/index.d.ts +10 -0
  67. package/build/types/widget-library/src/types/index.d.ts.map +1 -0
  68. package/build/types/widget-library/src/utils/index.d.ts +3 -0
  69. package/build/types/widget-library/src/utils/index.d.ts.map +1 -0
  70. package/build/types/widget-library/src/utils/replaceActions.d.ts +16 -0
  71. package/build/types/widget-library/src/utils/replaceActions.d.ts.map +1 -0
  72. package/build/types/widget-library/src/utils/replaceTemplateStrings.d.ts +14 -0
  73. package/build/types/widget-library/src/utils/replaceTemplateStrings.d.ts.map +1 -0
  74. package/build/types/widget-library/src/utils/updateCssInDom.d.ts +8 -0
  75. package/build/types/widget-library/src/utils/updateCssInDom.d.ts.map +1 -0
  76. package/package.json +6 -2
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { HTMLArViewerElement } from '../MediaItem/ArItem';
3
+ import { ArActionIconConfig } from '../types';
4
+ export interface ArActionIconProps {
5
+ config?: ArActionIconConfig;
6
+ htmlArElement: HTMLArViewerElement;
7
+ url: string;
8
+ }
9
+ declare const ArActionIcon: ({ config, url, htmlArElement }: ArActionIconProps) => React.JSX.Element;
10
+ export default ArActionIcon;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Gallery/ArActionIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,aAAa,EAAE,mBAAmB,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,YAAY,mCAAoC,iBAAiB,sBAmDtE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Media } from '@crystaldesign/diva-core';
3
+ export interface HTMLArViewerElement extends HTMLElement {
4
+ activateAR: () => void;
5
+ }
6
+ declare global {
7
+ namespace JSX {
8
+ interface IntrinsicElements {
9
+ 'model-viewer': any;
10
+ }
11
+ }
12
+ }
13
+ export interface ArProps {
14
+ media: Media;
15
+ }
16
+ declare const ArViewer: React.ForwardRefExoticComponent<ArProps & React.RefAttributes<HTMLArViewerElement>>;
17
+ export default ArViewer;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/Gallery/MediaItem/ArItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAe,MAAM,0BAA0B,CAAC;AAM9D,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,cAAc,EAAE,GAAG,CAAC;SACrB;KACF;CACF;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,QAAA,MAAM,QAAQ,qFA6BZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Media } from '@crystaldesign/diva-core';
3
+ import { GalleryConfig } from '../../types';
4
+ type Props = {
5
+ media: Media;
6
+ config: GalleryConfig;
7
+ };
8
+ declare const SirvMediaItem: ({ media: { url, functionType }, config: { sirvProps, specificSirvProps, sirvWrapperProps } }: Props) => React.JSX.Element;
9
+ export default SirvMediaItem;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/Gallery/MediaItem/SirvItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAErD,QAAA,MAAM,aAAa,iGAAkG,KAAK,sBAWzH,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Media } from '@crystaldesign/diva-core';
2
+ import { GalleryConfig } from '../types';
3
+ import React from 'react';
4
+ import { HTMLArViewerElement } from './ArItem';
5
+ type Props = {
6
+ media: Media;
7
+ config: GalleryConfig;
8
+ isCurrentlyVisible: boolean;
9
+ };
10
+ declare const MediaItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLArViewerElement>>;
11
+ export default MediaItem;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Gallery/MediaItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,SAAS,mFAeb,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ length: number;
4
+ index: number;
5
+ };
6
+ declare const PageNumber: ({ index, length }: Props) => React.JSX.Element;
7
+ export default PageNumber;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Gallery/PageNumber/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,UAAU,sBAAuB,KAAK,sBAE3C,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Media } from '@crystaldesign/diva-core';
2
+ import React from 'react';
3
+ type Props = {
4
+ media: Media;
5
+ medias: Media[];
6
+ };
7
+ declare const Thumb: ({ media, medias }: Props) => React.JSX.Element;
8
+ export default Thumb;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Gallery/Thumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CAAC;AAE/C,QAAA,MAAM,KAAK,sBAAuB,KAAK,sBA8BtC,CAAC;AACF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { GalleryProps } from './types';
3
+ export * from './types';
4
+ export declare const Gallery: (props: GalleryProps) => React.JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Gallery/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AASvC,cAAc,SAAS,CAAC;AAKxB,eAAO,MAAM,OAAO,UAAW,YAAY,sBA8C1C,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Media, ProductData } from '@crystaldesign/diva-core';
2
+ import { SwiperProps } from 'swiper/react';
3
+ import { BaseElementConfig } from '../../types';
4
+ export interface GalleryConfig extends BaseElementConfig {
5
+ sirvWrapperProps?: {
6
+ [data: string]: string;
7
+ };
8
+ sirvProps?: {
9
+ [data: string]: string;
10
+ };
11
+ disableSirv?: boolean;
12
+ specificSirvProps?: {
13
+ [functionType: string]: {
14
+ [data: string]: string;
15
+ };
16
+ };
17
+ functionTypes: string[];
18
+ add2DImage?: boolean;
19
+ add3DImageAsFallback?: boolean;
20
+ showPageNumber?: boolean;
21
+ sliderProp?: SwiperProps;
22
+ thumbSliderProp?: SwiperProps;
23
+ arIconProps?: ArActionIconConfig;
24
+ }
25
+ export interface ArActionIconConfig extends BaseElementConfig {
26
+ text?: string | boolean;
27
+ hidden?: boolean;
28
+ }
29
+ export interface GalleryProps {
30
+ config: GalleryConfig;
31
+ products: ProductData[];
32
+ currentProductIndex?: number;
33
+ setCurrentProductIndex?: (index: number) => void;
34
+ }
35
+ export interface MediaWithProductIndex extends Media {
36
+ productIndex: number;
37
+ }
38
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Gallery/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,gBAAgB,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC9C,SAAS,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE;QAAE,CAAC,YAAY,EAAE,MAAM,GAAG;YAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAC3E,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,qBAAsB,SAAQ,KAAK;IAClD,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,15 @@
1
+ import { GalleryProps, MediaWithProductIndex } from './types';
2
+ import { SwiperClass } from 'swiper/react';
3
+ export default function useGallery({ products, config: { functionTypes, add2DImage, add3DImageAsFallback }, currentProductIndex, setCurrentProductIndex, }: GalleryProps): {
4
+ medias: MediaWithProductIndex[];
5
+ sirvLoaded: boolean;
6
+ thumbsSwiper: SwiperClass | null;
7
+ swiper: SwiperClass | null;
8
+ currentIndex: number;
9
+ currentProductIndex: number;
10
+ setCurrentProductIndex: ((index: number) => void) | undefined;
11
+ setThumbsSwiper: import("react").Dispatch<import("react").SetStateAction<SwiperClass | null>>;
12
+ setSwiper: import("react").Dispatch<import("react").SetStateAction<SwiperClass | null>>;
13
+ onSlideChange: (swiper: SwiperClass) => void;
14
+ };
15
+ //# sourceMappingURL=useGallery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGallery.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Gallery/useGallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,QAAQ,EACR,MAAM,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAC3D,mBAAmB,EACnB,sBAAsB,GACvB,EAAE,YAAY;;;;;;;;;;4BA+BkB,WAAW;EA6B3C"}
@@ -0,0 +1,4 @@
1
+ import { ActionProps } from '../types';
2
+ import React from 'react';
3
+ export declare const Action: ({ config: { icon, iconClass, textClass, onClick, onDoubleClick, text, className } }: ActionProps) => React.JSX.Element;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/actions/Action/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,MAAM,wFAAyF,WAAW,sBAYtH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ActionGroupProps } from '../types';
3
+ export declare const ActionGroup: ({ config }: ActionGroupProps) => React.JSX.Element;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/actions/ActionGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,WAAW,eAAgB,gBAAgB,sBAIvD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './Action';
2
+ export * from './ActionGroup';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Action } from '@crystaldesign/diva-core';
2
+ import { BaseElementConfig } from '../../types';
3
+ export interface ActionProps {
4
+ config: ActionConfig;
5
+ }
6
+ export interface ActionGroupProps {
7
+ config: ActionGroupConfig;
8
+ }
9
+ export interface ActionConfig extends BaseElementConfig {
10
+ openComponent?: Action;
11
+ onEvent?: string;
12
+ link?: string;
13
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>, productId?: string) => void;
14
+ text?: string | {
15
+ de?: string;
16
+ it?: string;
17
+ en?: string;
18
+ };
19
+ textClass?: string;
20
+ icon?: string;
21
+ iconClass?: string;
22
+ onDoubleClick?: boolean;
23
+ }
24
+ export interface ActionGroupConfig extends BaseElementConfig {
25
+ actions: ActionConfig[];
26
+ }
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/actions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/E,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB"}
@@ -0,0 +1,4 @@
1
+ export * from './Gallery';
2
+ export * from './actions';
3
+ export * from './texts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { TextProps } from '../types';
3
+ export * from '../types';
4
+ export declare const Text: ({ config }: TextProps) => React.JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/texts/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,IAAI,eAAgB,SAAS,sBAEzC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TextBlockProps } from '../types';
3
+ export declare function TextBlock({ config }: TextBlockProps): React.JSX.Element;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/texts/TextBlock/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,qBAQnD"}
@@ -0,0 +1,4 @@
1
+ export * from './Text';
2
+ export * from './TextBlock';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/texts/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { BaseElementConfig } from '../../types';
2
+ export interface TextConfig extends BaseElementConfig {
3
+ text: string;
4
+ }
5
+ export interface TextBlockConfig extends BaseElementConfig {
6
+ texts: TextConfig[];
7
+ }
8
+ export interface TextProps {
9
+ config: TextConfig;
10
+ }
11
+ export interface TextBlockProps {
12
+ config: TextBlockConfig;
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/texts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAC;CACzB"}
@@ -0,0 +1,4 @@
1
+ export * from './useCss';
2
+ export * from './useConfiguration';
3
+ export * from './useProductData';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function useConfiguration<T extends object>(type: string, componentSettings?: T): T;
2
+ //# sourceMappingURL=useConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConfiguration.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useConfiguration.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,CAAC,GAAG,CAAC,CAYzF"}
@@ -0,0 +1,3 @@
1
+ import { CssConfiguration } from '../types';
2
+ export declare function useCss(settings: CssConfiguration): void;
3
+ //# sourceMappingURL=useCss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCss.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useCss.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,wBAAgB,MAAM,CAAC,QAAQ,EAAE,gBAAgB,QAIhD"}
@@ -0,0 +1,9 @@
1
+ import { ProductData } from '@crystaldesign/diva-core';
2
+ import { MediaWithProductIndex } from '../components/Gallery/types';
3
+ export declare function useMedia({ products, functionTypes, add2DImage, add3DImageAsFallback, }: {
4
+ products: ProductData[];
5
+ functionTypes: string[];
6
+ add2DImage?: boolean;
7
+ add3DImageAsFallback?: boolean;
8
+ }): MediaWithProductIndex[];
9
+ //# sourceMappingURL=useMedia.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useMedia.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,oBAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,2BAiCA"}
@@ -0,0 +1,12 @@
1
+ import { ProductData } from '@crystaldesign/diva-core';
2
+ export interface UseProductDataProps {
3
+ productIds?: string[];
4
+ variants?: ProductData[];
5
+ onProductLoaded?: (variants: ProductData[]) => void;
6
+ }
7
+ export declare function useProductData({ productIds, variants, onProductLoaded }: UseProductDataProps): {
8
+ productVariants: ProductData[];
9
+ error: boolean;
10
+ loading: boolean;
11
+ };
12
+ //# sourceMappingURL=useProductData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProductData.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useProductData.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAI1F,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,mBAAmB;;;;EAyD5F"}
@@ -0,0 +1,7 @@
1
+ export declare function useSirv({ hasSirvMedia, baseSirvUrls }: {
2
+ hasSirvMedia: boolean;
3
+ baseSirvUrls?: string[];
4
+ }): {
5
+ sirvLoaded: boolean;
6
+ };
7
+ //# sourceMappingURL=useSirv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSirv.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useSirv.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE;;EA+BzG"}
@@ -1,4 +1,8 @@
1
1
 
2
2
 
3
+ export * from './types';
4
+ export * from './hooks';
5
+ export * from './components';
6
+ export * from './utils';
3
7
  //# sourceMappingURL=index.d.ts.map
4
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=Action.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Action.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tests/components/actions/Action.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=ActionGroup.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionGroup.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tests/components/actions/ActionGroup.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=Text.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tests/components/texts/Text.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=TextBlock.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextBlock.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tests/components/texts/TextBlock.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=replaceActions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceActions.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tests/utils/replaceActions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=replaceTemplateString.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceTemplateString.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tests/utils/replaceTemplateString.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=updateCssInDom.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCssInDom.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tests/utils/updateCssInDom.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export interface BaseConfiguration extends CssConfiguration {
2
+ }
3
+ export interface CssConfiguration {
4
+ cssUrl?: string;
5
+ css?: string | string[];
6
+ }
7
+ export interface BaseElementConfig {
8
+ className?: string;
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;CAAG;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ export * from './replaceTemplateStrings';
2
+ export * from './replaceActions';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Action, ProductData, Event } from '@crystaldesign/diva-core';
2
+ /**
3
+ * Replace the configurated actions with an onClick function
4
+ *
5
+ * Needs to be called after the references are resolved, but before the templates are replaced.
6
+ * The onClick function accepts a product id, which can differ from the current product, so the translation has to be done in the function
7
+ *
8
+ * @param content the content to replace the actions in
9
+ * @param productVariants the current product variants, needed for the side menu renderer
10
+ * @param product the current product, needed for the side menu renderer and the is also passed with the event
11
+ * @param language the language to use, needed to translated the action
12
+ * @param openComponentFunction the function to open a component, called when an action with openComponent config is clicked
13
+ * @param onEventFunction the function to handle an event, called when an action with onEvent config is clicked, the current product is passed with the event
14
+ */
15
+ export declare function replaceActions<T extends Record<string, any>>(content: T, productVariants: ProductData[], product: ProductData, language: string, openComponentFunction: (action: Action) => void, onEventFunction: (event: Event) => void): T;
16
+ //# sourceMappingURL=replaceActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceActions.d.ts","sourceRoot":"","sources":["../../../../../src/utils/replaceActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAKhF;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1D,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,WAAW,EAAE,EAC9B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAC/C,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GACtC,CAAC,CAGH"}
@@ -0,0 +1,14 @@
1
+ import { ProductData } from '@crystaldesign/diva-core';
2
+ /**
3
+ * Replaces the template strings in the content with the actual product data
4
+ *
5
+ * @param content the content to parse
6
+ * @param product the product data to use
7
+ * @param language the language to use
8
+ */
9
+ export declare function replaceTemplatesInObject(content: {
10
+ [key: string]: any;
11
+ }, product: ProductData, language: string): {
12
+ [key: string]: any;
13
+ };
14
+ //# sourceMappingURL=replaceTemplateStrings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceTemplateStrings.d.ts","sourceRoot":"","sources":["../../../../../src/utils/replaceTemplateStrings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAIxI"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Make sure that the CSS is in the dome and that it has the current content
3
+ *
4
+ * @param url an url to a css file
5
+ * @param css the css content as text
6
+ */
7
+ export default function (url?: string, css?: string | string[]): void;
8
+ //# sourceMappingURL=updateCssInDom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCssInDom.d.ts","sourceRoot":"","sources":["../../../../../src/utils/updateCssInDom.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,QA0B7D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/widget-library",
3
- "version": "25.3.0-beta.4",
3
+ "version": "25.3.0-beta.43",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "storybook": "storybook dev -p 6006",
@@ -32,5 +32,9 @@
32
32
  },
33
33
  "module": "build/esm/index.js",
34
34
  "types": "./build/types/widget-library/src/index.d.ts",
35
- "gitHead": "0e0612b0cbd4b582f58a977b9bca3e7c9685cf21"
35
+ "jest-junit": {
36
+ "suiteName": "widget-library",
37
+ "outputDirectory": "./test-reports"
38
+ },
39
+ "gitHead": "a0e3020868fd0e4afb0f968212499876a458162f"
36
40
  }