vviinn-widgets 2.18.21 → 2.19.1
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/cjs/{index-cb410762.js → Campaign-a94a827a.js} +17 -1
- package/dist/cjs/cropper-handler_29.cjs.entry.js +1418 -0
- package/dist/cjs/{imageSearch.store-98824653.js → index-48c94264.js} +16016 -11171
- package/dist/cjs/{index-7f1325a7.js → index-a4becaff.js} +683 -303
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +150 -270
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +14 -8
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +12 -14
- package/dist/cjs/vviinn-widgets.cjs.js +10 -3
- package/dist/collection/Image/sizing.spec.js +66 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +2 -16
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +11 -7
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +0 -1
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +40 -37
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +73 -67
- package/dist/collection/components/image-search/search-filters/search-filters.css +4 -23
- package/dist/collection/components/image-search/search-filters/search-filters.js +97 -91
- package/dist/collection/components/vviinn-button/vviinn-button.js +34 -31
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +1 -2
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +161 -156
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +12 -14
- package/dist/collection/components/vviinn-error/vviinn-error.js +12 -12
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +35 -30
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +35 -30
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -121
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +75 -75
- package/dist/collection/components/vviinn-icons/index.js +10 -27
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +120 -67
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +81 -69
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +0 -1
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +27 -28
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +7 -36
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +115 -93
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +12 -14
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +12 -14
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +12 -14
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +12 -17
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +1 -12
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +12 -9
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +107 -78
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +1 -11
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +11 -7
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +0 -1
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +12 -16
- package/dist/collection/components/vviinn-product-card/render-helpers.js +6 -14
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -415
- package/dist/collection/components/vviinn-slider/arrow.js +1 -2
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +12 -9
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +0 -1
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +87 -82
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +12 -18
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +12 -64
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +371 -360
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +448 -444
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +545 -542
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +2 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +368 -332
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +0 -5
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.e2e.js +26 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +502 -425
- package/dist/collection/geometry/Clip.spec.js +16 -0
- package/dist/collection/geometry/Rectangle.spec.js +66 -0
- package/dist/collection/geometry/Sized.spec.js +16 -0
- package/dist/collection/interfaces/generated.js +0 -4
- package/dist/collection/network/ion/Form.spec.js +43 -0
- package/dist/esm/{index-b31d86ce.js → Campaign-4aa53f29.js} +15 -2
- package/dist/esm/cropper-handler_29.entry.js +1386 -0
- package/dist/esm/{index-590cb67e.js → index-48ef9564.js} +683 -304
- package/dist/esm/{imageSearch.store-9dde5360.js → index-976acf7e.js} +16124 -11292
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +106 -225
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +13 -7
- package/dist/esm/vviinn-vpr-button.entry.js +11 -13
- package/dist/esm/vviinn-widgets.js +7 -3
- package/dist/loader/index.d.ts +9 -0
- package/dist/loader/package.json +1 -0
- package/dist/types/Image/sizing.d.ts +4 -4
- package/dist/types/campaign/Campaign.d.ts +5 -5
- package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +2 -2
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +4 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +2 -0
- package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -3
- package/dist/types/components/vviinn-slider/arrow.d.ts +2 -2
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -2
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +9 -4
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +8 -0
- package/dist/types/components.d.ts +154 -54
- package/dist/types/error.d.ts +1 -1
- package/dist/types/geometry/Point.d.ts +1 -1
- package/dist/types/geometry/Rectangle.d.ts +1 -1
- package/dist/types/geometry/Sized.d.ts +1 -1
- package/dist/types/interfaces/generated.d.ts +192 -371
- package/dist/types/network/ion/File.d.ts +2 -2
- package/dist/types/network/ion/Form.d.ts +5 -5
- package/dist/types/network/ion/Link.d.ts +1 -1
- package/dist/types/network/ion/ValueObject.d.ts +4 -4
- package/dist/types/network/utils.d.ts +3 -3
- package/dist/types/recommendation/events.d.ts +5 -5
- package/dist/types/recommendation/recommendation.d.ts +1 -1
- package/dist/types/searchSession/searchSession.d.ts +7 -7
- package/dist/types/slider/GridMode.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +98 -23
- package/dist/types/store/imageSearch.store.d.ts +1 -1
- package/dist/types/tracking/models.d.ts +2 -2
- package/dist/types/utils/event/Events.d.ts +1 -1
- package/dist/vviinn-widgets/p-312b0eb7.entry.js +1 -0
- package/dist/vviinn-widgets/p-414b2291.js +1 -0
- package/dist/vviinn-widgets/p-5b50c7e5.entry.js +1 -0
- package/dist/vviinn-widgets/p-8deaa5da.entry.js +1 -0
- package/dist/vviinn-widgets/p-c6209bc1.entry.js +1 -0
- package/{www/build/p-2f9ee951.js → dist/vviinn-widgets/p-d08ce429.js} +1 -1
- package/dist/vviinn-widgets/p-fa17e81f.js +2 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +12 -12
- package/www/build/p-312b0eb7.entry.js +1 -0
- package/www/build/p-414b2291.js +1 -0
- package/www/build/p-5b50c7e5.entry.js +1 -0
- package/www/build/p-8deaa5da.entry.js +1 -0
- package/www/build/p-c6209bc1.entry.js +1 -0
- package/{dist/vviinn-widgets/p-2f9ee951.js → www/build/p-d08ce429.js} +1 -1
- package/www/build/p-d39b7d70.js +161 -0
- package/www/build/p-fa17e81f.js +2 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +2 -2
- package/dist/cjs/Campaign-13258569.js +0 -18
- package/dist/cjs/Handler-176539c8.js +0 -331
- package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
- package/dist/cjs/customized-slots-6e56c354.js +0 -54
- package/dist/cjs/highlight-box_22.cjs.entry.js +0 -770
- package/dist/cjs/index-a99edb90.js +0 -3235
- package/dist/cjs/vviinn-button.cjs.entry.js +0 -21
- package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
- package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +0 -65
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -251
- package/dist/esm/Campaign-90ba7e06.js +0 -14
- package/dist/esm/Handler-f9b8735c.js +0 -309
- package/dist/esm/cropper-handler.entry.js +0 -23
- package/dist/esm/customized-slots-00afe247.js +0 -51
- package/dist/esm/highlight-box_22.entry.js +0 -745
- package/dist/esm/index-4d5b52ba.js +0 -3224
- package/dist/esm/vviinn-button.entry.js +0 -17
- package/dist/esm/vviinn-error.entry.js +0 -15
- package/dist/esm/vviinn-preloader.entry.js +0 -22
- package/dist/esm/vviinn-vps-button.entry.js +0 -61
- package/dist/esm/vviinn-vps-widget.entry.js +0 -247
- package/dist/vviinn-widgets/p-11f61564.js +0 -1
- package/dist/vviinn-widgets/p-12851e97.entry.js +0 -1
- package/dist/vviinn-widgets/p-18fd769b.js +0 -1
- package/dist/vviinn-widgets/p-339c6838.js +0 -1
- package/dist/vviinn-widgets/p-3b2c91c0.entry.js +0 -1
- package/dist/vviinn-widgets/p-45df9f28.entry.js +0 -1
- package/dist/vviinn-widgets/p-57ed5303.entry.js +0 -1
- package/dist/vviinn-widgets/p-69850e5b.js +0 -1
- package/dist/vviinn-widgets/p-7c2f762a.entry.js +0 -1
- package/dist/vviinn-widgets/p-7c3b7388.entry.js +0 -1
- package/dist/vviinn-widgets/p-85006f41.entry.js +0 -1
- package/dist/vviinn-widgets/p-8a3dd76d.entry.js +0 -1
- package/dist/vviinn-widgets/p-99e58be7.entry.js +0 -1
- package/dist/vviinn-widgets/p-a2b450b6.entry.js +0 -1
- package/dist/vviinn-widgets/p-bcc1ccf0.js +0 -1
- package/dist/vviinn-widgets/p-e6fee8d2.js +0 -1
- package/www/build/p-11f61564.js +0 -1
- package/www/build/p-12851e97.entry.js +0 -1
- package/www/build/p-18fd769b.js +0 -1
- package/www/build/p-339c6838.js +0 -1
- package/www/build/p-3b2c91c0.entry.js +0 -1
- package/www/build/p-45df9f28.entry.js +0 -1
- package/www/build/p-57ed5303.entry.js +0 -1
- package/www/build/p-69850e5b.js +0 -1
- package/www/build/p-7c2f762a.entry.js +0 -1
- package/www/build/p-7c3b7388.entry.js +0 -1
- package/www/build/p-85006f41.entry.js +0 -1
- package/www/build/p-8a3dd76d.entry.js +0 -1
- package/www/build/p-99e58be7.entry.js +0 -1
- package/www/build/p-9e2c131a.js +0 -125
- package/www/build/p-a2b450b6.entry.js +0 -1
- package/www/build/p-bcc1ccf0.js +0 -1
- package/www/build/p-e6fee8d2.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Valueable } from "./ValueObject";
|
|
2
|
-
|
|
2
|
+
type IonFileData = {
|
|
3
3
|
name: string;
|
|
4
4
|
mediaType: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type IonFile = Valueable<string> & IonFileData;
|
|
7
7
|
export declare const fileToB64: (f: File) => Promise<string>;
|
|
8
8
|
export declare const fromFile: (f: File) => Promise<IonFile>;
|
|
9
9
|
export {};
|
|
@@ -4,7 +4,7 @@ import { Valueable } from "./ValueObject";
|
|
|
4
4
|
import { Link } from "./Link";
|
|
5
5
|
import { ValueObject } from "./ValueObject";
|
|
6
6
|
import { BasicError } from "../../error";
|
|
7
|
-
|
|
7
|
+
type FormRelation = "form" | "edit-form" | "create-form" | "query-form";
|
|
8
8
|
declare enum FormMemberName {
|
|
9
9
|
desc = "desc",
|
|
10
10
|
eform = "eform",
|
|
@@ -29,15 +29,15 @@ declare enum FormMemberName {
|
|
|
29
29
|
value = "value",
|
|
30
30
|
visible = "visible"
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
type FormMemberObject = {
|
|
33
33
|
[key in FormMemberName]: unknown;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
type FormField = Partial<FormMemberObject>;
|
|
36
36
|
export declare const checkFormFields: (f: FormField[], data: Object) => E.Either<string, Object>;
|
|
37
|
-
export
|
|
37
|
+
export type FormType = {
|
|
38
38
|
rel: FormRelation[];
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type Form = Valueable<FormField[]> & Link & FormType;
|
|
41
41
|
export declare const requestFromForm: (form: Form, data: Object) => E.Either<string, [string, RequestInit]>;
|
|
42
42
|
export declare const formRequest: <T>(form: Form, data?: Object) => (payload: RequestInit) => TE.TaskEither<BasicError<Response> | BasicError<string>, ValueObject<T>>;
|
|
43
43
|
export {};
|
|
@@ -11,17 +11,17 @@ declare enum ObjectMemberName {
|
|
|
11
11
|
type = "type",
|
|
12
12
|
value = "value"
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type MemberObject = {
|
|
15
15
|
[key in ObjectMemberName]: unknown;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type Valueable<T> = {
|
|
18
18
|
readonly value: T;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type Linked = {
|
|
21
21
|
readonly links: {
|
|
22
22
|
[link: string]: Link;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type ValueObject<T> = Valueable<T> & Partial<MemberObject> & Partial<Linked>;
|
|
26
26
|
export declare const foldValueObject: <T>(i: ValueObject<T>) => T;
|
|
27
27
|
export {};
|
|
@@ -16,10 +16,10 @@ export declare const mergeInitRequests: S.Semigroup<{
|
|
|
16
16
|
readonly referrer?: string;
|
|
17
17
|
readonly referrerPolicy?: ReferrerPolicy;
|
|
18
18
|
readonly signal?: AbortSignal;
|
|
19
|
-
readonly window?:
|
|
19
|
+
readonly window?: null;
|
|
20
20
|
}>;
|
|
21
|
-
export
|
|
22
|
-
export
|
|
21
|
+
export type RequestWithPath = [string, RequestInit];
|
|
22
|
+
export type RequestMethod = "GET" | "POST" | "DELETE";
|
|
23
23
|
export declare const createBasicRequest: (method: RequestMethod) => RequestInit;
|
|
24
24
|
export declare const createRequestFromMethod: (method: RequestMethod) => E.Either<any, RequestInit>;
|
|
25
25
|
export declare const createInitGetRequest: E.Either<any, RequestInit>;
|
|
@@ -2,22 +2,22 @@ import { FilterAction } from "vviinn-tracking-client-ts";
|
|
|
2
2
|
import { CampaignTypeTitle, CampaignTypeId, WidgetType } from "../campaign/Campaign";
|
|
3
3
|
import { ValueObject } from "../network/ion/ValueObject";
|
|
4
4
|
import { DetectedObject } from "../searchSession/searchSession";
|
|
5
|
-
export
|
|
5
|
+
export type BasicEventData = {
|
|
6
6
|
widgetType: WidgetType;
|
|
7
7
|
campaignTypeId: CampaignTypeId;
|
|
8
8
|
campaignTypeName: CampaignTypeTitle;
|
|
9
9
|
widgetId?: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type SelectObjectEventData = BasicEventData & {
|
|
12
12
|
detectedObject: ValueObject<DetectedObject>;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type SelectFilterEventData = BasicEventData & {
|
|
15
15
|
action: FilterAction;
|
|
16
16
|
filterName?: string;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type ProductCardEventData = BasicEventData & {
|
|
19
19
|
productId: string;
|
|
20
20
|
productRank: number;
|
|
21
21
|
productName: string;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type ProductCardEvent = CustomEvent<ProductCardEventData>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from "../interfaces/generated";
|
|
2
|
-
export
|
|
2
|
+
export type Recommendation = components["schemas"]["visual-product-search-object"];
|
|
@@ -16,26 +16,26 @@ export interface SearchSessionFilter {
|
|
|
16
16
|
filters: Link[];
|
|
17
17
|
}
|
|
18
18
|
export declare const readFilters: (filters: SearchSessionFilters) => SearchSessionFilter[];
|
|
19
|
-
|
|
19
|
+
type HasFilters = {
|
|
20
20
|
readonly filters: ValueObject<SearchSessionFilters>;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type DetectedObject = {
|
|
23
23
|
class: string;
|
|
24
24
|
score: number;
|
|
25
25
|
rectangle: RectangleAlt;
|
|
26
26
|
};
|
|
27
27
|
export declare const detectedObjectEq: Eq<DetectedObject>;
|
|
28
|
-
|
|
28
|
+
type ContainsDetectedObjects = {
|
|
29
29
|
readonly detectedObjects: ValueObject<DetectedObject>[];
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
type ContainsRectangleSearch = {
|
|
32
32
|
readonly searchArea: Form;
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
type ContainsHiresImageUpload = {
|
|
35
35
|
readonly uploadHighResolutionImage: Form;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type SearchSession = ValueObject<Recommendation[]> & HasFilters & Partial<ContainsDetectedObjects> & ContainsRectangleSearch & ContainsHiresImageUpload;
|
|
38
38
|
export declare const searchSessionClient: (initialData: RequestInit, campaignId?: O.Option<string>) => TE.TaskEither<BasicError<Response | string>, SearchSession>;
|
|
39
|
-
export
|
|
39
|
+
export type ObjectsDetectedEvent = CustomEvent<ValueObject<DetectedObject>[]>;
|
|
40
40
|
export declare const makeRequestFromFile: (token: string, file: File) => E.Either<BasicError<string>, RequestInit>;
|
|
41
41
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type GridMode = "auto" | "grid" | "manual";
|
|
@@ -133,7 +133,7 @@ export interface ListenOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
passive?: boolean;
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type ListenTargetOptions = 'body' | 'document' | 'window';
|
|
137
137
|
export interface StateDecorator {
|
|
138
138
|
(): PropertyDecorator;
|
|
139
139
|
}
|
|
@@ -214,14 +214,16 @@ export declare const State: StateDecorator;
|
|
|
214
214
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
215
215
|
*/
|
|
216
216
|
export declare const Watch: WatchDecorator;
|
|
217
|
-
export
|
|
218
|
-
export
|
|
217
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
218
|
+
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
219
219
|
/**
|
|
220
220
|
* `setMode()` is used for libraries which provide multiple "modes" for styles.
|
|
221
221
|
*/
|
|
222
222
|
export declare const setMode: (handler: ResolutionHandler) => void;
|
|
223
223
|
/**
|
|
224
|
-
* getMode
|
|
224
|
+
* `getMode()` is used for libraries which provide multiple "modes" for styles.
|
|
225
|
+
* @param ref a reference to the node to get styles for
|
|
226
|
+
* @returns the current mode or undefined, if not found
|
|
225
227
|
*/
|
|
226
228
|
export declare function getMode<T = string | undefined>(ref: any): T;
|
|
227
229
|
export declare function setPlatformHelpers(helpers: {
|
|
@@ -234,6 +236,9 @@ export declare function setPlatformHelpers(helpers: {
|
|
|
234
236
|
/**
|
|
235
237
|
* Get the base path to where the assets can be found. Use `setAssetPath(path)`
|
|
236
238
|
* if the path needs to be customized.
|
|
239
|
+
* @param path the path to use in calculating the asset path. this value will be
|
|
240
|
+
* used in conjunction with the base asset path
|
|
241
|
+
* @returns the base path
|
|
237
242
|
*/
|
|
238
243
|
export declare function getAssetPath(path: string): string;
|
|
239
244
|
/**
|
|
@@ -246,22 +251,38 @@ export declare function getAssetPath(path: string): string;
|
|
|
246
251
|
* `setAssetPath(document.currentScript.src)`, or using a bundler's replace plugin to
|
|
247
252
|
* dynamically set the path at build time, such as `setAssetPath(process.env.ASSET_PATH)`.
|
|
248
253
|
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
249
|
-
*
|
|
254
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
250
255
|
* will have to ensure the static assets are copied to its build directory.
|
|
256
|
+
* @param path the asset path to set
|
|
257
|
+
* @returns the set path
|
|
251
258
|
*/
|
|
252
259
|
export declare function setAssetPath(path: string): string;
|
|
253
260
|
/**
|
|
254
|
-
*
|
|
261
|
+
* Used to specify a nonce value that corresponds with an application's
|
|
262
|
+
* [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
|
|
263
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
264
|
+
* Alternatively, the nonce value can be set on a `meta` tag in the DOM head
|
|
265
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
|
|
266
|
+
* @param nonce The value to be used for the nonce attribute.
|
|
267
|
+
*/
|
|
268
|
+
export declare function setNonce(nonce: string): void;
|
|
269
|
+
/**
|
|
270
|
+
* Retrieve a Stencil element for a given reference
|
|
271
|
+
* @param ref the ref to get the Stencil element for
|
|
272
|
+
* @returns a reference to the element
|
|
255
273
|
*/
|
|
256
274
|
export declare function getElement(ref: any): HTMLStencilElement;
|
|
257
275
|
/**
|
|
258
276
|
* Schedules a new render of the given instance or element even if no state changed.
|
|
259
277
|
*
|
|
260
|
-
* Notice `forceUpdate()` is not
|
|
278
|
+
* Notice `forceUpdate()` is not synchronous and might perform the DOM render in the next frame.
|
|
279
|
+
*
|
|
280
|
+
* @param ref the node/element to force the re-render of
|
|
261
281
|
*/
|
|
262
282
|
export declare function forceUpdate(ref: any): void;
|
|
263
283
|
/**
|
|
264
284
|
* getRenderingRef
|
|
285
|
+
* @returns the rendering ref
|
|
265
286
|
*/
|
|
266
287
|
export declare function getRenderingRef(): any;
|
|
267
288
|
export interface HTMLStencilElement extends HTMLElement {
|
|
@@ -272,6 +293,8 @@ export interface HTMLStencilElement extends HTMLElement {
|
|
|
272
293
|
* in the best moment to perform DOM mutation without causing layout thrashing.
|
|
273
294
|
*
|
|
274
295
|
* For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
|
|
296
|
+
*
|
|
297
|
+
* @param task the DOM-write to schedule
|
|
275
298
|
*/
|
|
276
299
|
export declare function writeTask(task: RafCallback): void;
|
|
277
300
|
/**
|
|
@@ -279,6 +302,8 @@ export declare function writeTask(task: RafCallback): void;
|
|
|
279
302
|
* in the best moment to perform DOM reads without causing layout thrashing.
|
|
280
303
|
*
|
|
281
304
|
* For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
|
|
305
|
+
*
|
|
306
|
+
* @param task the DOM-read to schedule
|
|
282
307
|
*/
|
|
283
308
|
export declare function readTask(task: RafCallback): void;
|
|
284
309
|
/**
|
|
@@ -417,13 +442,57 @@ interface HostAttributes {
|
|
|
417
442
|
ref?: (el: HTMLElement | null) => void;
|
|
418
443
|
[prop: string]: any;
|
|
419
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* Utilities for working with functional Stencil components. An object
|
|
447
|
+
* conforming to this interface is passed by the Stencil runtime as the third
|
|
448
|
+
* argument to a functional component, allowing component authors to work with
|
|
449
|
+
* features like children.
|
|
450
|
+
*
|
|
451
|
+
* The children of a functional component will be passed as the second
|
|
452
|
+
* argument, so a functional component which uses these utils to transform its
|
|
453
|
+
* children might look like the following:
|
|
454
|
+
*
|
|
455
|
+
* ```ts
|
|
456
|
+
* export const AddClass: FunctionalComponent = (_, children, utils) => (
|
|
457
|
+
* utils.map(children, child => ({
|
|
458
|
+
* ...child,
|
|
459
|
+
* vattrs: {
|
|
460
|
+
* ...child.vattrs,
|
|
461
|
+
* class: `${child.vattrs.class} add-class`
|
|
462
|
+
* }
|
|
463
|
+
* }))
|
|
464
|
+
* );
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* For more see the Stencil documentation, here:
|
|
468
|
+
* https://stenciljs.com/docs/functional-components
|
|
469
|
+
*/
|
|
420
470
|
export interface FunctionalUtilities {
|
|
471
|
+
/**
|
|
472
|
+
* Utility for reading the children of a functional component at runtime.
|
|
473
|
+
* Since the Stencil runtime uses a different interface for children it is
|
|
474
|
+
* not recommendeded to read the children directly, and is preferable to use
|
|
475
|
+
* this utility to, for instance, perform a side effect for each child.
|
|
476
|
+
*/
|
|
421
477
|
forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
|
|
478
|
+
/**
|
|
479
|
+
* Utility for transforming the children of a functional component. Given an
|
|
480
|
+
* array of children and a callback this will return a list of the results of
|
|
481
|
+
* passing each child to the supplied callback.
|
|
482
|
+
*/
|
|
422
483
|
map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
|
|
423
484
|
}
|
|
424
485
|
export interface FunctionalComponent<T = {}> {
|
|
425
486
|
(props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
|
|
426
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* A Child VDOM node
|
|
490
|
+
*
|
|
491
|
+
* This has most of the same properties as {@link VNode} but friendlier names
|
|
492
|
+
* (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
|
|
493
|
+
* order to provide a friendlier public interface for users of the
|
|
494
|
+
* {@link FunctionalUtilities}).
|
|
495
|
+
*/
|
|
427
496
|
export interface ChildNode {
|
|
428
497
|
vtag?: string | number | Function;
|
|
429
498
|
vkey?: string | number;
|
|
@@ -470,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
|
|
|
470
539
|
export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
|
|
471
540
|
export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
|
|
472
541
|
export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
|
|
542
|
+
/**
|
|
543
|
+
* A virtual DOM node
|
|
544
|
+
*/
|
|
473
545
|
export interface VNode {
|
|
474
546
|
$flags$: number;
|
|
475
547
|
$tag$: string | number | Function;
|
|
@@ -666,7 +738,7 @@ export declare namespace JSXBase {
|
|
|
666
738
|
use: JSXBase.SVGAttributes;
|
|
667
739
|
view: JSXBase.SVGAttributes;
|
|
668
740
|
}
|
|
669
|
-
interface SlotAttributes {
|
|
741
|
+
interface SlotAttributes extends JSXAttributes {
|
|
670
742
|
name?: string;
|
|
671
743
|
slot?: string;
|
|
672
744
|
onSlotchange?: (event: Event) => void;
|
|
@@ -740,6 +812,7 @@ export declare namespace JSXBase {
|
|
|
740
812
|
datetime?: string;
|
|
741
813
|
}
|
|
742
814
|
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
815
|
+
onCancel?: (event: Event) => void;
|
|
743
816
|
onClose?: (event: Event) => void;
|
|
744
817
|
open?: boolean;
|
|
745
818
|
returnValue?: string;
|
|
@@ -820,8 +893,8 @@ export declare namespace JSXBase {
|
|
|
820
893
|
accept?: string;
|
|
821
894
|
allowdirs?: boolean;
|
|
822
895
|
alt?: string;
|
|
823
|
-
autoCapitalize?:
|
|
824
|
-
autocapitalize?:
|
|
896
|
+
autoCapitalize?: string;
|
|
897
|
+
autocapitalize?: string;
|
|
825
898
|
autoComplete?: string;
|
|
826
899
|
autocomplete?: string;
|
|
827
900
|
autoFocus?: boolean;
|
|
@@ -1145,8 +1218,8 @@ export declare namespace JSXBase {
|
|
|
1145
1218
|
resource?: string;
|
|
1146
1219
|
typeof?: string;
|
|
1147
1220
|
vocab?: string;
|
|
1148
|
-
autoCapitalize?:
|
|
1149
|
-
autocapitalize?:
|
|
1221
|
+
autoCapitalize?: string;
|
|
1222
|
+
autocapitalize?: string;
|
|
1150
1223
|
autoCorrect?: string;
|
|
1151
1224
|
autocorrect?: string;
|
|
1152
1225
|
autoSave?: string;
|
|
@@ -1427,9 +1500,7 @@ export declare namespace JSXBase {
|
|
|
1427
1500
|
z?: number | string;
|
|
1428
1501
|
zoomAndPan?: string;
|
|
1429
1502
|
}
|
|
1430
|
-
interface DOMAttributes<T
|
|
1431
|
-
key?: string | number;
|
|
1432
|
-
ref?: (elm?: T) => void;
|
|
1503
|
+
interface DOMAttributes<T> extends JSXAttributes<T> {
|
|
1433
1504
|
slot?: string;
|
|
1434
1505
|
part?: string;
|
|
1435
1506
|
exportparts?: string;
|
|
@@ -1439,12 +1510,12 @@ export declare namespace JSXBase {
|
|
|
1439
1510
|
onCutCapture?: (event: ClipboardEvent) => void;
|
|
1440
1511
|
onPaste?: (event: ClipboardEvent) => void;
|
|
1441
1512
|
onPasteCapture?: (event: ClipboardEvent) => void;
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1513
|
+
onCompositionend?: (event: CompositionEvent) => void;
|
|
1514
|
+
onCompositionendCapture?: (event: CompositionEvent) => void;
|
|
1515
|
+
onCompositionstart?: (event: CompositionEvent) => void;
|
|
1516
|
+
onCompositionstartCapture?: (event: CompositionEvent) => void;
|
|
1517
|
+
onCompositionupdate?: (event: CompositionEvent) => void;
|
|
1518
|
+
onCompositionupdateCapture?: (event: CompositionEvent) => void;
|
|
1448
1519
|
onFocus?: (event: FocusEvent) => void;
|
|
1449
1520
|
onFocusCapture?: (event: FocusEvent) => void;
|
|
1450
1521
|
onFocusin?: (event: FocusEvent) => void;
|
|
@@ -1455,8 +1526,8 @@ export declare namespace JSXBase {
|
|
|
1455
1526
|
onBlurCapture?: (event: FocusEvent) => void;
|
|
1456
1527
|
onChange?: (event: Event) => void;
|
|
1457
1528
|
onChangeCapture?: (event: Event) => void;
|
|
1458
|
-
onInput?: (event:
|
|
1459
|
-
onInputCapture?: (event:
|
|
1529
|
+
onInput?: (event: InputEvent) => void;
|
|
1530
|
+
onInputCapture?: (event: InputEvent) => void;
|
|
1460
1531
|
onReset?: (event: Event) => void;
|
|
1461
1532
|
onResetCapture?: (event: Event) => void;
|
|
1462
1533
|
onSubmit?: (event: Event) => void;
|
|
@@ -1550,6 +1621,10 @@ export declare namespace JSXBase {
|
|
|
1550
1621
|
onTransitionEndCapture?: (event: TransitionEvent) => void;
|
|
1551
1622
|
}
|
|
1552
1623
|
}
|
|
1624
|
+
export interface JSXAttributes<T = Element> {
|
|
1625
|
+
key?: string | number;
|
|
1626
|
+
ref?: (elm?: T) => void;
|
|
1627
|
+
}
|
|
1553
1628
|
export interface CustomElementsDefineOptions {
|
|
1554
1629
|
exclude?: string[];
|
|
1555
1630
|
resourcesUrl?: string;
|
|
@@ -9,7 +9,7 @@ import { Rectangle } from "../geometry/Rectangle";
|
|
|
9
9
|
import { Form } from "../network/ion/Form";
|
|
10
10
|
import { Handler } from "../cropper/Handler";
|
|
11
11
|
import { BasicError } from "../error";
|
|
12
|
-
|
|
12
|
+
type ImageSearchStore = {
|
|
13
13
|
token?: string;
|
|
14
14
|
campaignId: O.Option<string>;
|
|
15
15
|
results: Recommendation[];
|
|
@@ -5,8 +5,8 @@ declare const FILTER_EVENT_EVENT_TYPE = "filter_event";
|
|
|
5
5
|
declare const SEARCH_EVENT_EVENT_TYPE = "search_event";
|
|
6
6
|
declare const WIDGET_EVENT_EVENT_TYPE = "widget_event";
|
|
7
7
|
export { PRODUCT_CLICK_EVENT_TYPE, PRODUCT_VIEW_EVENT_TYPE, FILTER_EVENT_EVENT_TYPE, SEARCH_EVENT_EVENT_TYPE, WIDGET_EVENT_EVENT_TYPE, };
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type WidgetEvents = "product_click_event" | "product_view_event" | "filter_event" | "search_event" | "widget_event";
|
|
9
|
+
export type WidgetEventType = {
|
|
10
10
|
widget: Widget;
|
|
11
11
|
typ: WidgetEvents;
|
|
12
12
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as s,H as h,g as n}from"./p-fa17e81f.js";import{V as o,c as e}from"./p-d08ce429.js";const d=class{constructor(s){i(this,s),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.campaignType="VPR",this.color=void 0,this.addStyle=!0,this.mode="continuity",this.imageWidth=300,this.currencySign="€",this.noResultText=void 0,this.noResultShow=!0,this.gridArrowsDynamic=!1,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick(),this.vviinnWidgetOpen.emit({widgetType:"VPR",campaignTypeId:this.campaignType,campaignTypeName:e[this.campaignType],widgetId:this.el.id})},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(o,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&(this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.removeChild(this.sidebar))}get el(){return n(this)}};d.style=":host{display:block}";export{d as vviinn_vpr_button}
|