vviinn-widgets 2.18.3 → 2.18.7
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/Campaign-13258569.js +18 -0
- package/dist/cjs/Handler-176539c8.js +331 -0
- package/dist/cjs/cropper-handler.cjs.entry.js +27 -0
- package/dist/cjs/highlight-box_22.cjs.entry.js +770 -0
- package/dist/cjs/{index-8e47383c.js → imageSearch.store-8bbadb9d.js} +11238 -14778
- package/dist/cjs/index-1b894f1d.js +3235 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{vviinn-carousel_2.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +272 -51
- package/dist/cjs/vviinn-error.cjs.entry.js +19 -0
- package/dist/cjs/vviinn-preloader.cjs.entry.js +26 -0
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +10 -4
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +25 -3
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +21 -1
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +251 -0
- package/dist/cjs/vviinn-widgets.cjs.js +1 -1
- package/dist/collection/campaign/Campaign.js +5 -0
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +31 -6
- package/dist/collection/components/image-search/search-filters/search-filters.js +29 -9
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +40 -1
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +1 -17
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +19 -14
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +19 -14
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +41 -11
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +47 -34
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +44 -12
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +32 -7
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +25 -3
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +50 -23
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +36 -16
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +89 -35
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +1 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +77 -7
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +2 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +170 -4
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +3 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +185 -32
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +4 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +182 -3
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +237 -30
- package/dist/esm/Campaign-90ba7e06.js +14 -0
- package/dist/esm/Handler-f9b8735c.js +309 -0
- package/dist/esm/cropper-handler.entry.js +23 -0
- package/dist/esm/{cropper-handler_27.entry.js → highlight-box_22.entry.js} +51 -484
- package/dist/esm/{index-8de7d584.js → imageSearch.store-d8a17e0c.js} +11569 -15097
- package/dist/esm/{index-dfe874ac.js → index-34b385a3.js} +1 -1
- package/dist/esm/index-4756a22d.js +3224 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/vviinn-button.entry.js +1 -1
- package/dist/esm/{vviinn-carousel_2.entry.js → vviinn-carousel_3.entry.js} +252 -32
- package/dist/esm/vviinn-error.entry.js +15 -0
- package/dist/esm/vviinn-preloader.entry.js +22 -0
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +11 -5
- package/dist/esm/vviinn-vpr-button.entry.js +27 -5
- package/dist/esm/vviinn-vps-button.entry.js +22 -2
- package/dist/esm/vviinn-vps-widget.entry.js +247 -0
- package/dist/esm/vviinn-widgets.js +1 -1
- package/dist/types/campaign/Campaign.d.ts +4 -0
- package/dist/types/components/image-search/image-view/image-cropper/image-cropper.d.ts +3 -1
- package/dist/types/components/image-search/search-filters/search-filters.d.ts +3 -2
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +3 -0
- package/dist/types/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.d.ts +0 -2
- package/dist/types/components/vviinn-error/vviinn-server-error/vviinn-server-error.d.ts +1 -2
- package/dist/types/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.d.ts +1 -2
- package/dist/types/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.d.ts +4 -2
- package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +4 -4
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +4 -2
- package/dist/types/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.d.ts +3 -1
- package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +2 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +5 -3
- package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +4 -2
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +10 -5
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +7 -1
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +15 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +18 -7
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +13 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +22 -7
- package/dist/types/components.d.ts +110 -31
- package/dist/types/interfaces/generated.d.ts +114 -0
- package/dist/types/recommendation/events.d.ts +21 -3
- package/dist/vviinn-widgets/p-11f61564.js +1 -0
- package/dist/vviinn-widgets/p-18fd769b.js +1 -0
- package/dist/vviinn-widgets/{p-81c220eb.entry.js → p-394ab2b0.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-24be993d.js → p-4a08e066.js} +1 -1
- package/dist/vviinn-widgets/p-4f9a0ef8.js +1 -0
- package/dist/vviinn-widgets/p-7d7f2f6d.entry.js +1 -0
- package/dist/vviinn-widgets/p-931f139c.entry.js +1 -0
- package/dist/vviinn-widgets/p-9632e751.entry.js +1 -0
- package/dist/vviinn-widgets/p-a26b9b62.entry.js +1 -0
- package/dist/vviinn-widgets/p-ac90148f.entry.js +1 -0
- package/dist/vviinn-widgets/p-c0b7bb0d.entry.js +1 -0
- package/dist/vviinn-widgets/p-e277a86e.entry.js +1 -0
- package/dist/vviinn-widgets/p-ec088ca3.entry.js +1 -0
- package/dist/vviinn-widgets/p-f1cefbf0.entry.js +1 -0
- package/dist/vviinn-widgets/p-ffea16fe.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-11f61564.js +1 -0
- package/www/build/p-18fd769b.js +1 -0
- package/www/build/p-2cccb434.js +1 -0
- package/www/build/{p-81c220eb.entry.js → p-394ab2b0.entry.js} +1 -1
- package/www/build/{p-24be993d.js → p-4a08e066.js} +1 -1
- package/www/build/p-4f9a0ef8.js +1 -0
- package/www/build/p-7d7f2f6d.entry.js +1 -0
- package/www/build/p-931f139c.entry.js +1 -0
- package/www/build/p-9632e751.entry.js +1 -0
- package/www/build/p-a26b9b62.entry.js +1 -0
- package/www/build/p-a67898be.css +1 -0
- package/www/build/p-ac90148f.entry.js +1 -0
- package/www/build/p-c0b7bb0d.entry.js +1 -0
- package/www/build/p-e277a86e.entry.js +1 -0
- package/www/build/p-ec088ca3.entry.js +1 -0
- package/www/build/p-f1cefbf0.entry.js +1 -0
- package/www/build/p-ffea16fe.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +6 -2
- package/dist/cjs/cropper-handler_27.cjs.entry.js +0 -1208
- package/dist/vviinn-widgets/p-2ebfde1e.entry.js +0 -1
- package/dist/vviinn-widgets/p-7e9f9325.entry.js +0 -1
- package/dist/vviinn-widgets/p-97243fdc.entry.js +0 -1
- package/dist/vviinn-widgets/p-ad1b0872.entry.js +0 -1
- package/dist/vviinn-widgets/p-c5b1ff23.entry.js +0 -1
- package/dist/vviinn-widgets/p-fa5b5f3e.js +0 -1
- package/www/build/p-2ebfde1e.entry.js +0 -1
- package/www/build/p-7ddda4b2.js +0 -125
- package/www/build/p-7e9f9325.entry.js +0 -1
- package/www/build/p-97243fdc.entry.js +0 -1
- package/www/build/p-ad1b0872.entry.js +0 -1
- package/www/build/p-c5b1ff23.entry.js +0 -1
- package/www/build/p-e0153ae2.css +0 -6
- package/www/build/p-fa5b5f3e.js +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const campaignTypeNames = {
|
|
4
|
+
VPR: "Similar Products",
|
|
5
|
+
VPS: "Visual Search",
|
|
6
|
+
VCS: "Products Cross-Selling",
|
|
7
|
+
};
|
|
8
|
+
const isVPR = (c) => c._tag === "VPR";
|
|
9
|
+
function fold(onVPR, onVCS) {
|
|
10
|
+
return (c) => (isVPR(c) ? onVPR() : onVCS());
|
|
11
|
+
}
|
|
12
|
+
function fromString(s) {
|
|
13
|
+
return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.campaignTypeNames = campaignTypeNames;
|
|
17
|
+
exports.fold = fold;
|
|
18
|
+
exports.fromString = fromString;
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// -------------------------------------------------------------------------------------
|
|
4
|
+
/**
|
|
5
|
+
* @since 2.0.0
|
|
6
|
+
*/
|
|
7
|
+
function identity(a) {
|
|
8
|
+
return a;
|
|
9
|
+
}
|
|
10
|
+
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
11
|
+
switch (arguments.length) {
|
|
12
|
+
case 1:
|
|
13
|
+
return ab;
|
|
14
|
+
case 2:
|
|
15
|
+
return function () {
|
|
16
|
+
return bc(ab.apply(this, arguments));
|
|
17
|
+
};
|
|
18
|
+
case 3:
|
|
19
|
+
return function () {
|
|
20
|
+
return cd(bc(ab.apply(this, arguments)));
|
|
21
|
+
};
|
|
22
|
+
case 4:
|
|
23
|
+
return function () {
|
|
24
|
+
return de(cd(bc(ab.apply(this, arguments))));
|
|
25
|
+
};
|
|
26
|
+
case 5:
|
|
27
|
+
return function () {
|
|
28
|
+
return ef(de(cd(bc(ab.apply(this, arguments)))));
|
|
29
|
+
};
|
|
30
|
+
case 6:
|
|
31
|
+
return function () {
|
|
32
|
+
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
|
|
33
|
+
};
|
|
34
|
+
case 7:
|
|
35
|
+
return function () {
|
|
36
|
+
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
|
|
37
|
+
};
|
|
38
|
+
case 8:
|
|
39
|
+
return function () {
|
|
40
|
+
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
|
|
41
|
+
};
|
|
42
|
+
case 9:
|
|
43
|
+
return function () {
|
|
44
|
+
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @since 2.0.0
|
|
51
|
+
*/
|
|
52
|
+
function tuple() {
|
|
53
|
+
var t = [];
|
|
54
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
55
|
+
t[_i] = arguments[_i];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
59
|
+
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
60
|
+
switch (arguments.length) {
|
|
61
|
+
case 1:
|
|
62
|
+
return a;
|
|
63
|
+
case 2:
|
|
64
|
+
return ab(a);
|
|
65
|
+
case 3:
|
|
66
|
+
return bc(ab(a));
|
|
67
|
+
case 4:
|
|
68
|
+
return cd(bc(ab(a)));
|
|
69
|
+
case 5:
|
|
70
|
+
return de(cd(bc(ab(a))));
|
|
71
|
+
case 6:
|
|
72
|
+
return ef(de(cd(bc(ab(a)))));
|
|
73
|
+
case 7:
|
|
74
|
+
return fg(ef(de(cd(bc(ab(a))))));
|
|
75
|
+
case 8:
|
|
76
|
+
return gh(fg(ef(de(cd(bc(ab(a)))))));
|
|
77
|
+
case 9:
|
|
78
|
+
return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
|
|
79
|
+
default: {
|
|
80
|
+
var ret = arguments[0];
|
|
81
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
82
|
+
ret = arguments[i](ret);
|
|
83
|
+
}
|
|
84
|
+
return ret;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// -------------------------------------------------------------------------------------
|
|
90
|
+
// Option
|
|
91
|
+
// -------------------------------------------------------------------------------------
|
|
92
|
+
/** @internal */
|
|
93
|
+
var isNone = function (fa) { return fa._tag === 'None'; };
|
|
94
|
+
/** @internal */
|
|
95
|
+
var isSome = function (fa) { return fa._tag === 'Some'; };
|
|
96
|
+
/** @internal */
|
|
97
|
+
var none = { _tag: 'None' };
|
|
98
|
+
/** @internal */
|
|
99
|
+
var some = function (a) { return ({ _tag: 'Some', value: a }); };
|
|
100
|
+
// -------------------------------------------------------------------------------------
|
|
101
|
+
// Either
|
|
102
|
+
// -------------------------------------------------------------------------------------
|
|
103
|
+
/** @internal */
|
|
104
|
+
var isLeft = function (ma) { return ma._tag === 'Left'; };
|
|
105
|
+
/** @internal */
|
|
106
|
+
var left = function (e) { return ({ _tag: 'Left', left: e }); };
|
|
107
|
+
/** @internal */
|
|
108
|
+
var right = function (a) { return ({ _tag: 'Right', right: a }); };
|
|
109
|
+
// -------------------------------------------------------------------------------------
|
|
110
|
+
// Record
|
|
111
|
+
// -------------------------------------------------------------------------------------
|
|
112
|
+
/** @internal */
|
|
113
|
+
var has = Object.prototype.hasOwnProperty;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* If a type `A` can form a `Semigroup` it has an **associative** binary operation.
|
|
117
|
+
*
|
|
118
|
+
* ```ts
|
|
119
|
+
* interface Semigroup<A> {
|
|
120
|
+
* readonly concat: (x: A, y: A) => A
|
|
121
|
+
* }
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* Associativity means the following equality must hold for any choice of `x`, `y`, and `z`.
|
|
125
|
+
*
|
|
126
|
+
* ```ts
|
|
127
|
+
* concat(x, concat(y, z)) = concat(concat(x, y), z)
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* A common example of a semigroup is the type `string` with the operation `+`.
|
|
131
|
+
*
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { Semigroup } from 'fp-ts/Semigroup'
|
|
134
|
+
*
|
|
135
|
+
* const semigroupString: Semigroup<string> = {
|
|
136
|
+
* concat: (x, y) => x + y
|
|
137
|
+
* }
|
|
138
|
+
*
|
|
139
|
+
* const x = 'x'
|
|
140
|
+
* const y = 'y'
|
|
141
|
+
* const z = 'z'
|
|
142
|
+
*
|
|
143
|
+
* semigroupString.concat(x, y) // 'xy'
|
|
144
|
+
*
|
|
145
|
+
* semigroupString.concat(x, semigroupString.concat(y, z)) // 'xyz'
|
|
146
|
+
*
|
|
147
|
+
* semigroupString.concat(semigroupString.concat(x, y), z) // 'xyz'
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* *Adapted from https://typelevel.org/cats*
|
|
151
|
+
*
|
|
152
|
+
* @since 2.0.0
|
|
153
|
+
*/
|
|
154
|
+
/**
|
|
155
|
+
* Given a struct of semigroups returns a semigroup for the struct.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* import { struct } from 'fp-ts/Semigroup'
|
|
159
|
+
* import * as N from 'fp-ts/number'
|
|
160
|
+
*
|
|
161
|
+
* interface Point {
|
|
162
|
+
* readonly x: number
|
|
163
|
+
* readonly y: number
|
|
164
|
+
* }
|
|
165
|
+
*
|
|
166
|
+
* const S = struct<Point>({
|
|
167
|
+
* x: N.SemigroupSum,
|
|
168
|
+
* y: N.SemigroupSum
|
|
169
|
+
* })
|
|
170
|
+
*
|
|
171
|
+
* assert.deepStrictEqual(S.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })
|
|
172
|
+
*
|
|
173
|
+
* @category combinators
|
|
174
|
+
* @since 2.10.0
|
|
175
|
+
*/
|
|
176
|
+
var struct = function (semigroups) { return ({
|
|
177
|
+
concat: function (first, second) {
|
|
178
|
+
var r = {};
|
|
179
|
+
for (var k in semigroups) {
|
|
180
|
+
if (has.call(semigroups, k)) {
|
|
181
|
+
r[k] = semigroups[k].concat(first[k], second[k]);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return r;
|
|
185
|
+
}
|
|
186
|
+
}); };
|
|
187
|
+
// -------------------------------------------------------------------------------------
|
|
188
|
+
// instances
|
|
189
|
+
// -------------------------------------------------------------------------------------
|
|
190
|
+
/**
|
|
191
|
+
* Always return the first argument.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* import * as S from 'fp-ts/Semigroup'
|
|
195
|
+
*
|
|
196
|
+
* assert.deepStrictEqual(S.first<number>().concat(1, 2), 1)
|
|
197
|
+
*
|
|
198
|
+
* @category instances
|
|
199
|
+
* @since 2.10.0
|
|
200
|
+
*/
|
|
201
|
+
var first = function () { return ({ concat: identity }); };
|
|
202
|
+
/**
|
|
203
|
+
* Always return the last argument.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* import * as S from 'fp-ts/Semigroup'
|
|
207
|
+
*
|
|
208
|
+
* assert.deepStrictEqual(S.last<number>().concat(1, 2), 2)
|
|
209
|
+
*
|
|
210
|
+
* @category instances
|
|
211
|
+
* @since 2.10.0
|
|
212
|
+
*/
|
|
213
|
+
var last = function () { return ({ concat: function (_, y) { return y; } }); };
|
|
214
|
+
/**
|
|
215
|
+
* Use [`SemigroupSum`](./number.ts.html#SemigroupSum) instead.
|
|
216
|
+
*
|
|
217
|
+
* @category instances
|
|
218
|
+
* @since 2.0.0
|
|
219
|
+
* @deprecated
|
|
220
|
+
*/
|
|
221
|
+
var semigroupSum = {
|
|
222
|
+
concat: function (x, y) { return x + y; }
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const semigroupDiff = {
|
|
226
|
+
concat: (x, y) => x - y,
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const fromRectangle$1 = ({ x, y }) => {
|
|
230
|
+
return {
|
|
231
|
+
x,
|
|
232
|
+
y,
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
const fromMouseEvent = ({ clientX, clientY }) => {
|
|
236
|
+
return {
|
|
237
|
+
x: clientX,
|
|
238
|
+
y: clientY,
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
const pointDiffSemigroup = struct({
|
|
242
|
+
x: semigroupDiff,
|
|
243
|
+
y: semigroupDiff,
|
|
244
|
+
});
|
|
245
|
+
const pointSumSemigroup = struct({
|
|
246
|
+
x: semigroupSum,
|
|
247
|
+
y: semigroupSum,
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
exports.HandlerDirection = void 0;
|
|
251
|
+
(function (HandlerDirection) {
|
|
252
|
+
HandlerDirection[HandlerDirection["East"] = 0] = "East";
|
|
253
|
+
HandlerDirection[HandlerDirection["North"] = 1] = "North";
|
|
254
|
+
HandlerDirection[HandlerDirection["NorthEast"] = 2] = "NorthEast";
|
|
255
|
+
HandlerDirection[HandlerDirection["NorthWest"] = 3] = "NorthWest";
|
|
256
|
+
HandlerDirection[HandlerDirection["South"] = 4] = "South";
|
|
257
|
+
HandlerDirection[HandlerDirection["SouthEast"] = 5] = "SouthEast";
|
|
258
|
+
HandlerDirection[HandlerDirection["SouthWest"] = 6] = "SouthWest";
|
|
259
|
+
HandlerDirection[HandlerDirection["West"] = 7] = "West";
|
|
260
|
+
})(exports.HandlerDirection || (exports.HandlerDirection = {}));
|
|
261
|
+
const getCursorValue = (direction) => {
|
|
262
|
+
switch (direction) {
|
|
263
|
+
case exports.HandlerDirection.East:
|
|
264
|
+
return "e-resize";
|
|
265
|
+
case exports.HandlerDirection.North:
|
|
266
|
+
return "n-resize";
|
|
267
|
+
case exports.HandlerDirection.NorthEast:
|
|
268
|
+
return "ne-resize";
|
|
269
|
+
case exports.HandlerDirection.NorthWest:
|
|
270
|
+
return "nw-resize";
|
|
271
|
+
case exports.HandlerDirection.South:
|
|
272
|
+
return "s-resize";
|
|
273
|
+
case exports.HandlerDirection.SouthEast:
|
|
274
|
+
return "se-resize";
|
|
275
|
+
case exports.HandlerDirection.SouthWest:
|
|
276
|
+
return "sw-resize";
|
|
277
|
+
case exports.HandlerDirection.West:
|
|
278
|
+
return "w-resize";
|
|
279
|
+
default:
|
|
280
|
+
return "pointer";
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
const fromRectangle = (r) => [
|
|
284
|
+
{
|
|
285
|
+
position: fromRectangle$1(r),
|
|
286
|
+
direction: exports.HandlerDirection.NorthWest,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
position: pointSumSemigroup.concat(fromRectangle$1(r), {
|
|
290
|
+
x: r.width,
|
|
291
|
+
y: 0,
|
|
292
|
+
}),
|
|
293
|
+
direction: exports.HandlerDirection.NorthEast,
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
position: pointSumSemigroup.concat(fromRectangle$1(r), {
|
|
297
|
+
x: 0,
|
|
298
|
+
y: r.height,
|
|
299
|
+
}),
|
|
300
|
+
direction: exports.HandlerDirection.SouthWest,
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
position: pointSumSemigroup.concat(fromRectangle$1(r), {
|
|
304
|
+
x: r.width,
|
|
305
|
+
y: r.height,
|
|
306
|
+
}),
|
|
307
|
+
direction: exports.HandlerDirection.SouthEast,
|
|
308
|
+
},
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
exports.first = first;
|
|
312
|
+
exports.flow = flow;
|
|
313
|
+
exports.fromMouseEvent = fromMouseEvent;
|
|
314
|
+
exports.fromRectangle = fromRectangle$1;
|
|
315
|
+
exports.fromRectangle$1 = fromRectangle;
|
|
316
|
+
exports.getCursorValue = getCursorValue;
|
|
317
|
+
exports.has = has;
|
|
318
|
+
exports.identity = identity;
|
|
319
|
+
exports.isLeft = isLeft;
|
|
320
|
+
exports.isNone = isNone;
|
|
321
|
+
exports.isSome = isSome;
|
|
322
|
+
exports.last = last;
|
|
323
|
+
exports.left = left;
|
|
324
|
+
exports.none = none;
|
|
325
|
+
exports.pipe = pipe;
|
|
326
|
+
exports.pointDiffSemigroup = pointDiffSemigroup;
|
|
327
|
+
exports.pointSumSemigroup = pointSumSemigroup;
|
|
328
|
+
exports.right = right;
|
|
329
|
+
exports.some = some;
|
|
330
|
+
exports.struct = struct;
|
|
331
|
+
exports.tuple = tuple;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-0bda22ec.js');
|
|
6
|
+
const Handler = require('./Handler-176539c8.js');
|
|
7
|
+
|
|
8
|
+
const cropperHandlerCss = ":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";
|
|
9
|
+
|
|
10
|
+
let CropperHandler = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return (index.h(index.Host, { part: `handle ${Handler.getCursorValue(this.handler.direction)}`, class: {
|
|
17
|
+
disabled: this.disabled,
|
|
18
|
+
[Handler.getCursorValue(this.handler.direction)]: true,
|
|
19
|
+
}, style: {
|
|
20
|
+
"--size": "20px",
|
|
21
|
+
cursor: Handler.getCursorValue(this.handler.direction),
|
|
22
|
+
}, draggable: false }));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
CropperHandler.style = cropperHandlerCss;
|
|
26
|
+
|
|
27
|
+
exports.cropper_handler = CropperHandler;
|