vviinn-widgets 0.6.7 → 0.7.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/{Rectangle-3098312c.js → Rectangle-75cfbeb8.js} +24 -24
- package/dist/cjs/{app-globals-85991bd7.js → app-globals-16a92f55.js} +1 -1
- package/dist/cjs/cropper-handler_3.cjs.entry.js +195 -0
- package/dist/cjs/image-view.cjs.entry.js +1 -1
- package/dist/cjs/{imageSearch.store-ee4dbcdc.js → imageSearch.store-184be02f.js} +1590 -1594
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{products.worker-90bc4c31.js → products.worker-f9e9409a.js} +4 -2
- package/dist/cjs/search-filters_17.cjs.entry.js +3013 -0
- package/dist/cjs/{vpr-slider-106e880d.js → vpr-slider.vviinn-product-card.vviinn-vpr-widget-f9e6df79.js} +307 -2
- package/dist/cjs/vpr-slider_3.cjs.entry.js +14 -0
- package/dist/cjs/vviinn-error.cjs.entry.js +19 -0
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +35 -0
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +98 -0
- package/dist/cjs/vviinn-widgets.cjs.js +2 -2
- package/dist/collection/components/image-search/search-filters/search-filters.js +1 -1
- package/dist/collection/components/vpr-slider/vpr-slider.js +1 -1
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +5 -1
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +3 -0
- package/dist/collection/components/vviinn-error/vviinn-error.css +5 -0
- package/dist/collection/components/vviinn-error/vviinn-error.js +1 -0
- package/dist/collection/components/vviinn-product-card/render-helpers.js +1 -1
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +6 -6
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +17 -2
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +19 -1
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +8 -2
- package/dist/collection/global.js +1 -1
- package/dist/esm/{Rectangle-d1903b92.js → Rectangle-6fb2f1cf.js} +25 -25
- package/dist/esm/{app-globals-4276f59f.js → app-globals-3e46563a.js} +1 -1
- package/dist/esm/cropper-handler_3.entry.js +189 -0
- package/dist/esm/image-view.entry.js +2 -2
- package/dist/esm/{imageSearch.store-1b33f4e2.js → imageSearch.store-c5764141.js} +1590 -1590
- package/dist/esm/{index-3b5bf177.js → index-0069f293.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{products.worker-907f7cec.js → products.worker-7fedd873.js} +4 -2
- package/dist/esm/search-filters_17.entry.js +2993 -0
- package/dist/esm/{vpr-slider-acd997b5.js → vpr-slider.vviinn-product-card.vviinn-vpr-widget-139af5d0.js} +307 -4
- package/dist/esm/vpr-slider_3.entry.js +4 -0
- package/dist/esm/vviinn-error.entry.js +15 -0
- package/dist/esm/vviinn-vps-button.entry.js +31 -0
- package/dist/esm/vviinn-vps-widget.entry.js +94 -0
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +3 -1
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +1 -0
- package/dist/vviinn-widgets/p-12ad64c2.entry.js +1 -0
- package/dist/vviinn-widgets/p-39796b8f.js +1 -0
- package/{www/build/p-e4e421b8.js → dist/vviinn-widgets/p-584ca31b.js} +1 -1
- package/dist/vviinn-widgets/p-6685b278.entry.js +1 -0
- package/dist/vviinn-widgets/{p-98af099b.js → p-738684bc.js} +1 -1
- package/dist/vviinn-widgets/p-7abf4232.entry.js +1 -0
- package/dist/vviinn-widgets/p-80784bb3.js +1 -0
- package/dist/vviinn-widgets/p-8ea2f047.entry.js +1 -0
- package/dist/vviinn-widgets/p-a46bfd26.entry.js +1 -0
- package/dist/vviinn-widgets/p-c0cc5f5b.js +1 -0
- package/dist/vviinn-widgets/p-c397bea2.entry.js +1 -0
- package/dist/vviinn-widgets/p-d1090812.js +1 -0
- package/dist/vviinn-widgets/p-f7fb2190.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-12ad64c2.entry.js +1 -0
- package/www/build/{p-950f2e3d.js → p-1ae47263.js} +1 -1
- package/www/build/p-39796b8f.js +1 -0
- package/{dist/vviinn-widgets/p-e4e421b8.js → www/build/p-584ca31b.js} +1 -1
- package/www/build/p-6685b278.entry.js +1 -0
- package/www/build/{p-98af099b.js → p-738684bc.js} +1 -1
- package/www/build/p-7abf4232.entry.js +1 -0
- package/www/build/p-80784bb3.js +1 -0
- package/www/build/p-8ea2f047.entry.js +1 -0
- package/www/build/p-a46bfd26.entry.js +1 -0
- package/www/build/p-c0cc5f5b.js +1 -0
- package/www/build/p-c397bea2.entry.js +1 -0
- package/www/build/p-d1090812.js +1 -0
- package/www/build/p-f7fb2190.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +6 -2
- package/dist/cjs/cropper-handler_24.cjs.entry.js +0 -7801
- package/dist/cjs/vpr-slider.cjs.entry.js +0 -10
- package/dist/cjs/vviinn-vpr-widget.cjs.entry.js +0 -105
- package/dist/esm/cropper-handler_24.entry.js +0 -7774
- package/dist/esm/vpr-slider.entry.js +0 -2
- package/dist/esm/vviinn-vpr-widget.entry.js +0 -101
- package/dist/vviinn-widgets/p-08dd3e64.js +0 -1
- package/dist/vviinn-widgets/p-13fe9e32.entry.js +0 -1
- package/dist/vviinn-widgets/p-2987891f.js +0 -1
- package/dist/vviinn-widgets/p-37fe0fb6.js +0 -1
- package/dist/vviinn-widgets/p-49c06bf3.js +0 -1
- package/dist/vviinn-widgets/p-552782fa.entry.js +0 -1
- package/dist/vviinn-widgets/p-e1073bd6.entry.js +0 -1
- package/dist/vviinn-widgets/p-e65cbbaa.entry.js +0 -1
- package/www/build/p-08dd3e64.js +0 -1
- package/www/build/p-13fe9e32.entry.js +0 -1
- package/www/build/p-2987891f.js +0 -1
- package/www/build/p-37fe0fb6.js +0 -1
- package/www/build/p-49c06bf3.js +0 -1
- package/www/build/p-552782fa.entry.js +0 -1
- package/www/build/p-e1073bd6.entry.js +0 -1
- package/www/build/p-e65cbbaa.entry.js +0 -1
|
@@ -251,6 +251,30 @@ var semigroupSum = {
|
|
|
251
251
|
concat: function (x, y) { return x + y; }
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
+
var ObjectMemberName;
|
|
255
|
+
(function (ObjectMemberName) {
|
|
256
|
+
ObjectMemberName["eform"] = "eform";
|
|
257
|
+
ObjectMemberName["etype"] = "etype";
|
|
258
|
+
ObjectMemberName["form"] = "form";
|
|
259
|
+
ObjectMemberName["href"] = "href";
|
|
260
|
+
ObjectMemberName["method"] = "method";
|
|
261
|
+
ObjectMemberName["accepts"] = "accepts";
|
|
262
|
+
ObjectMemberName["produces"] = "produces";
|
|
263
|
+
ObjectMemberName["rel"] = "rel";
|
|
264
|
+
ObjectMemberName["type"] = "type";
|
|
265
|
+
ObjectMemberName["value"] = "value";
|
|
266
|
+
})(ObjectMemberName || (ObjectMemberName = {}));
|
|
267
|
+
const foldValueObject = (i) => {
|
|
268
|
+
switch (i.type) {
|
|
269
|
+
case "array": {
|
|
270
|
+
return i.value.map(foldValueObject);
|
|
271
|
+
}
|
|
272
|
+
default: {
|
|
273
|
+
return i.value;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
254
278
|
const semigroupDiff = {
|
|
255
279
|
concat: (x, y) => x - y,
|
|
256
280
|
};
|
|
@@ -365,30 +389,6 @@ const fromRectangle = (r) => [
|
|
|
365
389
|
},
|
|
366
390
|
];
|
|
367
391
|
|
|
368
|
-
var ObjectMemberName;
|
|
369
|
-
(function (ObjectMemberName) {
|
|
370
|
-
ObjectMemberName["eform"] = "eform";
|
|
371
|
-
ObjectMemberName["etype"] = "etype";
|
|
372
|
-
ObjectMemberName["form"] = "form";
|
|
373
|
-
ObjectMemberName["href"] = "href";
|
|
374
|
-
ObjectMemberName["method"] = "method";
|
|
375
|
-
ObjectMemberName["accepts"] = "accepts";
|
|
376
|
-
ObjectMemberName["produces"] = "produces";
|
|
377
|
-
ObjectMemberName["rel"] = "rel";
|
|
378
|
-
ObjectMemberName["type"] = "type";
|
|
379
|
-
ObjectMemberName["value"] = "value";
|
|
380
|
-
})(ObjectMemberName || (ObjectMemberName = {}));
|
|
381
|
-
const foldValueObject = (i) => {
|
|
382
|
-
switch (i.type) {
|
|
383
|
-
case "array": {
|
|
384
|
-
return i.value.map(foldValueObject);
|
|
385
|
-
}
|
|
386
|
-
default: {
|
|
387
|
-
return i.value;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
|
|
392
392
|
const move = (origin, position) => {
|
|
393
393
|
const originPosition = fromRectangle$1(origin);
|
|
394
394
|
const newPosition = pointSumSemigroup.concat(originPosition, position);
|
|
@@ -9204,7 +9204,7 @@ addExtensionMethods();
|
|
|
9204
9204
|
|
|
9205
9205
|
const setupSentry = () => {
|
|
9206
9206
|
init({
|
|
9207
|
-
dsn: "https://
|
|
9207
|
+
dsn: "https://70bcf561598b44148bd3cabc7c142a6c@o1015876.ingest.sentry.io/5983034",
|
|
9208
9208
|
integrations: [new Integrations.BrowserTracing()],
|
|
9209
9209
|
tracesSampleRate: 1.0,
|
|
9210
9210
|
maxBreadcrumbs: 4,
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-7ef269de.js');
|
|
6
|
+
const Rectangle = require('./Rectangle-75cfbeb8.js');
|
|
7
|
+
const imageSearch_store = require('./imageSearch.store-184be02f.js');
|
|
8
|
+
|
|
9
|
+
const cropperHandlerCss = ":host{--x:0;--y:0;--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);position:absolute;touch-action:none;transition-duration:0.25s;transition-property:border-color, opacity;transition-timing-function:ease-in-out;width:var(--size);z-index:4}:host(.disabled){opacity:0.25}:host(.nw-resize){transform:translate(calc(var(--x) - 4px), calc(var(--y) - 4px));border-bottom:none;border-right:none}:host(.n-resize){transform:translate(calc(var(--x) - calc(var(--size) / 2)), var(--y));border:none}:host(.w-resize){transform:translate(var(--x), calc(var(--y) - calc(var(--size) / 2)));border:none}:host(.ne-resize){transform:translate(calc(var(--x) - var(--size)), calc(var(--y) - 4px));border-left:none;border-bottom:none}:host(.e-resize){transform:translate(calc(var(--x) - var(--size)), calc(var(--y) - calc(var(--size) / 2)));border:none}:host(.sw-resize){transform:translate(calc(var(--x) - 4px), calc(var(--y) - var(--size)));border-right:none;border-top:none}:host(.s-resize){transform:translate(calc(var(--x) - calc(var(--size) / 2)), calc(var(--y) - var(--size)));border:none}:host(.se-resize){transform:translate(calc(var(--x) - var(--size)), calc(var(--y) - var(--size)));border-left:none;border-top:none}";
|
|
10
|
+
|
|
11
|
+
const CropperHandler = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.handlerMoved = index.createEvent(this, "handlerMoved", 7);
|
|
15
|
+
this.searchAreaChangeStart = index.createEvent(this, "searchAreaChangeStart", 7);
|
|
16
|
+
this.handlerReleased = index.createEvent(this, "handlerReleased", 7);
|
|
17
|
+
this.handleMove = false;
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
}
|
|
20
|
+
handlePointerStart(event) {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
this.id = event.pointerId;
|
|
24
|
+
this.handleMove = true;
|
|
25
|
+
this.startPoint = Rectangle.fromMouseEvent(event);
|
|
26
|
+
this.searchAreaChangeStart.emit(true);
|
|
27
|
+
}
|
|
28
|
+
handlePointerEnd(event) {
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
const { pointerId } = event;
|
|
31
|
+
if (pointerId !== this.id) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.searchAreaChangeStart.emit(false);
|
|
35
|
+
this.handlerReleased.emit();
|
|
36
|
+
this.handleMove = false;
|
|
37
|
+
this.startPoint = undefined;
|
|
38
|
+
}
|
|
39
|
+
handlePointerMove(event) {
|
|
40
|
+
if (!this.handleMove)
|
|
41
|
+
return;
|
|
42
|
+
requestAnimationFrame(() => {
|
|
43
|
+
const destination = Rectangle.fromMouseEvent(event);
|
|
44
|
+
if (this.startPoint !== undefined) {
|
|
45
|
+
const distance = Rectangle.pointDiffSemigroup.concat(destination, this.startPoint);
|
|
46
|
+
this.handlerMoved.emit({
|
|
47
|
+
position: distance,
|
|
48
|
+
direction: this.handler.direction,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
this.startPoint = destination;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
return (index.h(index.Host, { part: `handle ${Rectangle.getCursorValue(this.handler.direction)}`, class: {
|
|
56
|
+
active: this.handleMove,
|
|
57
|
+
disabled: this.disabled,
|
|
58
|
+
[Rectangle.getCursorValue(this.handler.direction)]: true,
|
|
59
|
+
}, style: {
|
|
60
|
+
"--x": `${this.handler.position.x}px`,
|
|
61
|
+
"--y": `${this.handler.position.y}px`,
|
|
62
|
+
"--size": "20px",
|
|
63
|
+
cursor: Rectangle.getCursorValue(this.handler.direction),
|
|
64
|
+
} }));
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
CropperHandler.style = cropperHandlerCss;
|
|
68
|
+
|
|
69
|
+
const fromRectangle = (shape, target) => {
|
|
70
|
+
const top = `${shape.y}px`;
|
|
71
|
+
const left = `${shape.x}px`;
|
|
72
|
+
const right = `${target.width - (shape.x + shape.width)}px`;
|
|
73
|
+
const bottom = `${target.height - (shape.y + shape.height)}px`;
|
|
74
|
+
return {
|
|
75
|
+
top,
|
|
76
|
+
right,
|
|
77
|
+
bottom,
|
|
78
|
+
left,
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
|
|
82
|
+
const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
|
|
83
|
+
|
|
84
|
+
const highlightBoxCss = ":host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;--size:10px;--x-position:0;--y-position:0}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:\"\";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}";
|
|
85
|
+
|
|
86
|
+
const HighlightBox = class {
|
|
87
|
+
constructor(hostRef) {
|
|
88
|
+
index.registerInstance(this, hostRef);
|
|
89
|
+
}
|
|
90
|
+
getInsetValue() {
|
|
91
|
+
return Rectangle.pipe(imageSearch_store.sequenceToOption(imageSearch_store.imageSearchState.searchArea, imageSearch_store.imageSearchState.imageBounds), imageSearch_store.Option.map(([selection, image]) => getClipValue(selection, image)), imageSearch_store.Option.getOrElse(() => ""));
|
|
92
|
+
}
|
|
93
|
+
renderImage() {
|
|
94
|
+
return Rectangle.pipe(imageSearch_store.sequenceToOption(imageSearch_store.imageSearchState.imageUrl, imageSearch_store.imageSearchState.imageBounds), imageSearch_store.Option.map(([url, bounds]) => (index.h("img", { src: url, width: bounds.width, height: bounds.height, style: { "clip-path": `${this.getInsetValue()}` } }))), imageSearch_store.Option.getOrElse(() => ""));
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
return index.h(index.Host, null, this.renderImage());
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
HighlightBox.style = highlightBoxCss;
|
|
101
|
+
|
|
102
|
+
const imageCropperCss = ":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.wrapper{height:100%;position:relative;width:100%}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";
|
|
103
|
+
|
|
104
|
+
const ImageCropper = class {
|
|
105
|
+
constructor(hostRef) {
|
|
106
|
+
index.registerInstance(this, hostRef);
|
|
107
|
+
this.mouseRelease = index.createEvent(this, "mouseRelease", 7);
|
|
108
|
+
this.cropperMoved = index.createEvent(this, "cropperMoved", 7);
|
|
109
|
+
this.searchAreaChangeStart = index.createEvent(this, "searchAreaChangeStart", 7);
|
|
110
|
+
this.disabled = false;
|
|
111
|
+
this.handleMove = false;
|
|
112
|
+
this.mouseStartPoint = undefined;
|
|
113
|
+
}
|
|
114
|
+
handleObjectSelection({ detail }) {
|
|
115
|
+
const scale = Rectangle.scaleWithSized(this.bounds);
|
|
116
|
+
const rect = Rectangle.fromAlt(Rectangle.foldValueObject(detail).rectangle);
|
|
117
|
+
imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(scale(rect));
|
|
118
|
+
}
|
|
119
|
+
handleHandlerMove(event) {
|
|
120
|
+
imageSearch_store._function.pipe(imageSearch_store.imageSearchState.searchArea, imageSearch_store.Option.map((area) => {
|
|
121
|
+
const newSearchArea = Rectangle.transform(area, event.detail);
|
|
122
|
+
if (!this.checkBounds(newSearchArea)) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
requestAnimationFrame(() => {
|
|
126
|
+
imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(newSearchArea);
|
|
127
|
+
});
|
|
128
|
+
imageSearch_store.imageSearchState.detectedObject = undefined;
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
handleMouseMove(ev) {
|
|
132
|
+
if (!this.handleMove)
|
|
133
|
+
return;
|
|
134
|
+
const destination = Rectangle.fromMouseEvent(ev);
|
|
135
|
+
const distance = Rectangle.pointDiffSemigroup.concat(destination, this.mouseStartPoint);
|
|
136
|
+
imageSearch_store._function.pipe(imageSearch_store.imageSearchState.searchArea, imageSearch_store.Option.map((searchArea) => {
|
|
137
|
+
const newSearchArea = Rectangle.move(searchArea, distance);
|
|
138
|
+
if (!this.checkBounds(newSearchArea)) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(newSearchArea);
|
|
142
|
+
imageSearch_store.imageSearchState.detectedObject = undefined;
|
|
143
|
+
this.mouseStartPoint = destination;
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
handlePointerDown(event) {
|
|
147
|
+
this.handleMove = true;
|
|
148
|
+
this.mouseStartPoint = Rectangle.fromMouseEvent(event);
|
|
149
|
+
}
|
|
150
|
+
checkBounds(rectangle) {
|
|
151
|
+
const bounds = this.el.getBoundingClientRect();
|
|
152
|
+
const inTopBound = rectangle.y >= 0;
|
|
153
|
+
const inLeftBound = rectangle.x >= 0;
|
|
154
|
+
const inRightBound = rectangle.x + rectangle.width <= bounds.width;
|
|
155
|
+
const inBottomBound = rectangle.y + rectangle.height <= bounds.height;
|
|
156
|
+
const minWidth = rectangle.width > 20;
|
|
157
|
+
const minHeight = rectangle.height > 20;
|
|
158
|
+
return (inTopBound &&
|
|
159
|
+
inLeftBound &&
|
|
160
|
+
inRightBound &&
|
|
161
|
+
inBottomBound &&
|
|
162
|
+
minHeight &&
|
|
163
|
+
minWidth);
|
|
164
|
+
}
|
|
165
|
+
handleSearchAreaRelease() {
|
|
166
|
+
this.handleMove = false;
|
|
167
|
+
this.mouseStartPoint = undefined;
|
|
168
|
+
imageSearch_store.makeRectangularSearchRequest();
|
|
169
|
+
}
|
|
170
|
+
getStyleMap() {
|
|
171
|
+
return imageSearch_store._function.pipe(imageSearch_store.imageSearchState.searchArea, imageSearch_store.Option.map((rectangle) => {
|
|
172
|
+
return {
|
|
173
|
+
width: `${rectangle.width}px`,
|
|
174
|
+
height: `${rectangle.height}px`,
|
|
175
|
+
transform: `translate(${rectangle.x}px, ${rectangle.y}px)`,
|
|
176
|
+
cursor: this.handleMove ? "move" : "default",
|
|
177
|
+
};
|
|
178
|
+
}), imageSearch_store.Option.getOrElse(() => {
|
|
179
|
+
return {};
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
return (index.h(index.Host, { exportparts: "handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize" }, index.h("div", { class: {
|
|
184
|
+
"crop-area": true,
|
|
185
|
+
active: this.handleMove,
|
|
186
|
+
disabled: this.disabled,
|
|
187
|
+
}, style: this.getStyleMap(), onPointerDown: (ev) => this.handlePointerDown(ev), onPointerUp: (ev) => { ev.stopPropagation(); this.handleSearchAreaRelease(); } }), index.h("div", { class: "wrapper" }, imageSearch_store.imageSearchState.cropperHandlers.map((handler) => (index.h("cropper-handler", { disabled: this.disabled, handler: handler, bounds: this.bounds, onHandlerMoved: (e) => this.handleHandlerMove(e), onHandlerReleased: () => this.handleSearchAreaRelease() }))))));
|
|
188
|
+
}
|
|
189
|
+
get el() { return index.getElement(this); }
|
|
190
|
+
};
|
|
191
|
+
ImageCropper.style = imageCropperCss;
|
|
192
|
+
|
|
193
|
+
exports.cropper_handler = CropperHandler;
|
|
194
|
+
exports.highlight_box = HighlightBox;
|
|
195
|
+
exports.image_cropper = ImageCropper;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-7ef269de.js');
|
|
6
|
-
const Rectangle = require('./Rectangle-
|
|
6
|
+
const Rectangle = require('./Rectangle-75cfbeb8.js');
|
|
7
7
|
|
|
8
8
|
const imageViewCss = ":host{display:grid;position:relative}:host(.hidden){display:none}:host(.dimmed) img{filter:brightness(60%);position:relative;z-index:-1}.detected-object{position:absolute}img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}@-webkit-keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}.loader{-webkit-animation:1.5s cubic-bezier(.68, -0.55, .27, 1.55) 0s infinite spin;animation:1.5s cubic-bezier(.68, -0.55, .27, 1.55) 0s infinite spin;display:grid;filter:box-shadow(1px 1px 2px black);height:1rem;margin-left:-0.5rem;margin-top:-0.5rem;position:absolute;width:1rem;z-index:10}";
|
|
9
9
|
|