@marimo-team/islands 0.23.15-dev24 → 0.23.15-dev26
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/{ImageComparisonComponent-CHrI72em.js → ImageComparisonComponent-1i5IBhon.js} +173 -129
- package/dist/{code-visibility-CXaWvbIw.js → code-visibility-lZd-lNkj.js} +1 -1
- package/dist/main.js +3 -3
- package/dist/{reveal-component-D_Go0-2D.js → reveal-component-B0JS8HUE.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +53 -2
- package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +71 -0
|
@@ -5,100 +5,100 @@ import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
|
5
5
|
var require_dist$1 = /* @__PURE__ */ __commonJSMin((() => {
|
|
6
6
|
(() => {
|
|
7
7
|
var e = {
|
|
8
|
-
792: (e2,
|
|
9
|
-
|
|
10
|
-
var
|
|
8
|
+
792: (e2, i2, a2) => {
|
|
9
|
+
a2.d(i2, { Z: () => c });
|
|
10
|
+
var o = a2(609), s = a2.n(o)()((function(e3) {
|
|
11
11
|
return e3[1];
|
|
12
12
|
}));
|
|
13
|
-
|
|
13
|
+
s.push([
|
|
14
14
|
e2.id,
|
|
15
15
|
':host{--divider-width: 1px;--divider-color: #fff;--divider-shadow: none;--default-handle-width: 50px;--default-handle-color: #fff;--default-handle-opacity: 1;--default-handle-shadow: none;--handle-position-start: 50%;position:relative;display:inline-block;overflow:hidden;line-height:0;direction:ltr}@media screen and (-webkit-min-device-pixel-ratio: 0)and (min-resolution: 0.001dpcm){:host{outline-offset:1px}}:host(:focus){outline:2px solid -webkit-focus-ring-color}::slotted(*){-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.first{position:absolute;left:0;top:0;right:0;line-height:normal;font-size:100%;max-height:100%;height:100%;width:100%;--exposure: 50%;--keyboard-transition-time: 0ms;--default-transition-time: 0ms;--transition-time: var(--default-transition-time)}.first .first-overlay-container{position:relative;clip-path:inset(0 var(--exposure) 0 0);transition:clip-path var(--transition-time);height:100%}.first .first-overlay{overflow:hidden;height:100%}.first.focused{will-change:clip-path}.first.focused .first-overlay-container{will-change:clip-path}.second{position:relative}.handle-container{transform:translateX(50%);position:absolute;top:0;right:var(--exposure);height:100%;transition:right var(--transition-time),bottom var(--transition-time)}.focused .handle-container{will-change:right}.divider{position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.divider:after{content:" ";display:block;height:100%;border-left-width:var(--divider-width);border-left-style:solid;border-left-color:var(--divider-color);box-shadow:var(--divider-shadow)}.handle{position:absolute;top:var(--handle-position-start);pointer-events:none;box-sizing:border-box;margin-left:1px;transform:translate(calc(-50% - 0.5px), -50%);line-height:0}.default-handle{width:var(--default-handle-width);opacity:var(--default-handle-opacity);transition:all 1s;filter:drop-shadow(var(--default-handle-shadow))}.default-handle path{stroke:var(--default-handle-color)}.vertical .first-overlay-container{clip-path:inset(0 0 var(--exposure) 0)}.vertical .handle-container{transform:translateY(50%);height:auto;top:unset;bottom:var(--exposure);width:100%;left:0;flex-direction:row}.vertical .divider:after{height:1px;width:100%;border-top-width:var(--divider-width);border-top-style:solid;border-top-color:var(--divider-color);border-left:0}.vertical .handle{top:auto;left:var(--handle-position-start);transform:translate(calc(-50% - 0.5px), -50%) rotate(90deg)}',
|
|
16
16
|
""
|
|
17
17
|
]);
|
|
18
|
-
let
|
|
18
|
+
let c = s;
|
|
19
19
|
},
|
|
20
20
|
609: (e2) => {
|
|
21
21
|
e2.exports = function(e3) {
|
|
22
|
-
var
|
|
23
|
-
return
|
|
24
|
-
return this.map((function(
|
|
25
|
-
var
|
|
26
|
-
return
|
|
22
|
+
var i2 = [];
|
|
23
|
+
return i2.toString = function() {
|
|
24
|
+
return this.map((function(i3) {
|
|
25
|
+
var a2 = e3(i3);
|
|
26
|
+
return i3[2] ? `@media ${i3[2]} {${a2}}` : a2;
|
|
27
27
|
})).join("");
|
|
28
|
-
},
|
|
28
|
+
}, i2.i = function(e4, a2, o) {
|
|
29
29
|
typeof e4 == "string" && (e4 = [[
|
|
30
30
|
null,
|
|
31
31
|
e4,
|
|
32
32
|
""
|
|
33
33
|
]]);
|
|
34
|
-
var
|
|
35
|
-
if (
|
|
36
|
-
var
|
|
37
|
-
|
|
34
|
+
var s = {};
|
|
35
|
+
if (o) for (var c = 0; c < this.length; c++) {
|
|
36
|
+
var l = this[c][0];
|
|
37
|
+
l != null && (s[l] = true);
|
|
38
38
|
}
|
|
39
|
-
for (var
|
|
40
|
-
var
|
|
41
|
-
|
|
39
|
+
for (var u = 0; u < e4.length; u++) {
|
|
40
|
+
var d = [].concat(e4[u]);
|
|
41
|
+
o && s[d[0]] || (a2 && (d[2] ? d[2] = `${a2} and ${d[2]}` : d[2] = a2), i2.push(d));
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, i2;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
},
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
if (
|
|
50
|
-
var
|
|
51
|
-
id:
|
|
46
|
+
}, i = {};
|
|
47
|
+
function a(o) {
|
|
48
|
+
var s = i[o];
|
|
49
|
+
if (s !== void 0) return s.exports;
|
|
50
|
+
var c = i[o] = {
|
|
51
|
+
id: o,
|
|
52
52
|
exports: {}
|
|
53
53
|
};
|
|
54
|
-
return e[
|
|
54
|
+
return e[o](c, c.exports, a), c.exports;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
return
|
|
59
|
-
},
|
|
60
|
-
for (var
|
|
56
|
+
a.n = (e2) => {
|
|
57
|
+
var i2 = e2 && e2.__esModule ? () => e2.default : () => e2;
|
|
58
|
+
return a.d(i2, { a: i2 }), i2;
|
|
59
|
+
}, a.d = (e2, i2) => {
|
|
60
|
+
for (var o in i2) a.o(i2, o) && !a.o(e2, o) && Object.defineProperty(e2, o, {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get:
|
|
62
|
+
get: i2[o]
|
|
63
63
|
});
|
|
64
|
-
},
|
|
65
|
-
var e2 =
|
|
66
|
-
let
|
|
67
|
-
let
|
|
68
|
-
return
|
|
69
|
-
},
|
|
64
|
+
}, a.o = (e2, i2) => Object.prototype.hasOwnProperty.call(e2, i2), (() => {
|
|
65
|
+
var e2 = a(792);
|
|
66
|
+
let i2 = "rendered", o = (e3, i3) => {
|
|
67
|
+
let a2 = e3.getBoundingClientRect(), o2, s2;
|
|
68
|
+
return i3.type === "mousedown" ? (o2 = i3.clientX, s2 = i3.clientY) : (o2 = i3.touches[0].clientX, s2 = i3.touches[0].clientY), o2 >= a2.x && o2 <= a2.x + a2.width && s2 >= a2.y && s2 <= a2.y + a2.height;
|
|
69
|
+
}, s, c = {
|
|
70
70
|
ArrowLeft: -1,
|
|
71
71
|
ArrowRight: 1
|
|
72
|
-
},
|
|
72
|
+
}, l = ["horizontal", "vertical"], u = (e3) => ({
|
|
73
73
|
x: e3.touches[0].pageX,
|
|
74
74
|
y: e3.touches[0].pageY
|
|
75
|
-
}),
|
|
75
|
+
}), d = (e3) => ({
|
|
76
76
|
x: e3.pageX,
|
|
77
77
|
y: e3.pageY
|
|
78
|
-
}),
|
|
79
|
-
typeof window < "u" && (window.document && (
|
|
78
|
+
}), f = typeof window < "u" && (window == null ? void 0 : window.HTMLElement);
|
|
79
|
+
typeof window < "u" && (window.document && (s = document.createElement("template"), s.innerHTML = '<div class="second" id="second"> <slot name="second"><slot name="before"></slot></slot> </div> <div class="first" id="first"> <div class="first-overlay"> <div class="first-overlay-container" id="firstImageContainer"> <slot name="first"><slot name="after"></slot></slot> </div> </div> <div class="handle-container"> <div class="divider"></div> <div class="handle" id="handle"> <slot name="handle"> <svg xmlns="http://www.w3.org/2000/svg" class="default-handle" viewBox="-8 -3 16 6"> <path d="M -5 -2 L -7 0 L -5 2 M 5 -2 L 7 0 L 5 2" fill="none" vector-effect="non-scaling-stroke"/> </svg> </slot> </div> </div> </div> '), window.customElements.define("img-comparison-slider", class extends f {
|
|
80
80
|
constructor() {
|
|
81
81
|
super(), this.exposure = this.hasAttribute("value") ? parseFloat(this.getAttribute("value")) : 50, this.slideOnHover = false, this.slideDirection = "horizontal", this.keyboard = "enabled", this.isMouseDown = false, this.animationDirection = 0, this.isFocused = false, this.dragByHandle = false, this.onMouseMove = (e3) => {
|
|
82
82
|
if (this.isMouseDown || this.slideOnHover) {
|
|
83
|
-
let
|
|
84
|
-
this.slideToPage(
|
|
83
|
+
let i4 = d(e3);
|
|
84
|
+
this.slideToPage(i4);
|
|
85
85
|
}
|
|
86
86
|
}, this.bodyUserSelectStyle = "", this.bodyWebkitUserSelectStyle = "", this.onMouseDown = (e3) => {
|
|
87
|
-
if (this.slideOnHover || this.handle && !
|
|
87
|
+
if (this.slideOnHover || this.handle && !o(this.handleElement, e3)) return;
|
|
88
88
|
e3.preventDefault(), window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("mouseup", this.onWindowMouseUp), this.isMouseDown = true, this.enableTransition();
|
|
89
|
-
let
|
|
90
|
-
this.slideToPage(
|
|
89
|
+
let i4 = d(e3);
|
|
90
|
+
this.slideToPage(i4), this.focus(), this.bodyUserSelectStyle = window.document.body.style.userSelect, this.bodyWebkitUserSelectStyle = window.document.body.style.webkitUserSelect, window.document.body.style.userSelect = "none", window.document.body.style.webkitUserSelect = "none";
|
|
91
91
|
}, this.onWindowMouseUp = () => {
|
|
92
92
|
this.isMouseDown = false, window.document.body.style.userSelect = this.bodyUserSelectStyle, window.document.body.style.webkitUserSelect = this.bodyWebkitUserSelectStyle, window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
93
93
|
}, this.touchStartPoint = null, this.isTouchComparing = false, this.hasTouchMoved = false, this.onTouchStart = (e3) => {
|
|
94
|
-
this.dragByHandle && !
|
|
94
|
+
this.dragByHandle && !o(this.handleElement, e3) || (this.touchStartPoint = u(e3), this.isFocused && (this.enableTransition(), this.slideToPage(this.touchStartPoint)));
|
|
95
95
|
}, this.onTouchMove = (e3) => {
|
|
96
96
|
if (this.touchStartPoint === null) return;
|
|
97
|
-
let
|
|
98
|
-
if (this.isTouchComparing) return this.slideToPage(
|
|
97
|
+
let i4 = u(e3);
|
|
98
|
+
if (this.isTouchComparing) return this.slideToPage(i4), e3.preventDefault(), false;
|
|
99
99
|
if (!this.hasTouchMoved) {
|
|
100
|
-
let
|
|
101
|
-
if (this.slideDirection === "horizontal" &&
|
|
100
|
+
let a3 = Math.abs(i4.y - this.touchStartPoint.y), o2 = Math.abs(i4.x - this.touchStartPoint.x);
|
|
101
|
+
if (this.slideDirection === "horizontal" && a3 < o2 || this.slideDirection === "vertical" && a3 > o2) return this.isTouchComparing = true, this.focus(), this.slideToPage(i4), e3.preventDefault(), false;
|
|
102
102
|
this.hasTouchMoved = true;
|
|
103
103
|
}
|
|
104
104
|
}, this.onTouchEnd = () => {
|
|
@@ -109,17 +109,17 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
109
109
|
this.isFocused = true, this.firstElement.classList.add("focused");
|
|
110
110
|
}, this.onKeyDown = (e3) => {
|
|
111
111
|
if (this.keyboard === "disabled") return;
|
|
112
|
-
let
|
|
113
|
-
this.animationDirection !==
|
|
112
|
+
let i4 = c[e3.key];
|
|
113
|
+
this.animationDirection !== i4 && i4 !== void 0 && (this.animationDirection = i4, this.startSlideAnimation());
|
|
114
114
|
}, this.onKeyUp = (e3) => {
|
|
115
115
|
if (this.keyboard === "disabled") return;
|
|
116
|
-
let
|
|
117
|
-
|
|
116
|
+
let i4 = c[e3.key];
|
|
117
|
+
i4 !== void 0 && this.animationDirection === i4 && this.stopSlideAnimation();
|
|
118
118
|
}, this.resetDimensions = () => {
|
|
119
119
|
this.imageWidth = this.offsetWidth, this.imageHeight = this.offsetHeight;
|
|
120
120
|
};
|
|
121
|
-
let
|
|
122
|
-
|
|
121
|
+
let i3 = this.attachShadow({ mode: "open" }), a2 = document.createElement("style");
|
|
122
|
+
a2.innerHTML = e2.Z, this.getAttribute("nonce") && a2.setAttribute("nonce", this.getAttribute("nonce")), i3.appendChild(a2), i3.appendChild(s.content.cloneNode(true)), this.firstElement = i3.getElementById("first"), this.handleElement = i3.getElementById("handle");
|
|
123
123
|
}
|
|
124
124
|
set handle(e3) {
|
|
125
125
|
this.dragByHandle = e3.toString().toLowerCase() !== "false";
|
|
@@ -131,8 +131,8 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
131
131
|
return this.exposure;
|
|
132
132
|
}
|
|
133
133
|
set value(e3) {
|
|
134
|
-
let
|
|
135
|
-
|
|
134
|
+
let i3 = parseFloat(e3);
|
|
135
|
+
i3 !== this.exposure && (this.exposure = i3, this.enableTransition(), this.setExposure());
|
|
136
136
|
}
|
|
137
137
|
get hover() {
|
|
138
138
|
return this.slideOnHover;
|
|
@@ -144,28 +144,28 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
144
144
|
return this.slideDirection;
|
|
145
145
|
}
|
|
146
146
|
set direction(e3) {
|
|
147
|
-
this.slideDirection = e3.toString().toLowerCase(), this.slide(0), this.firstElement.classList.remove(...
|
|
147
|
+
this.slideDirection = e3.toString().toLowerCase(), this.slide(0), this.firstElement.classList.remove(...l), l.includes(this.slideDirection) && this.firstElement.classList.add(this.slideDirection);
|
|
148
148
|
}
|
|
149
149
|
static get observedAttributes() {
|
|
150
150
|
return ["hover", "direction"];
|
|
151
151
|
}
|
|
152
152
|
connectedCallback() {
|
|
153
|
-
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.addEventListener("dragstart", ((e3) => (e3.preventDefault(), false))), new ResizeObserver(this.resetDimensions).observe(this), this.setExposure(0), this.keyboard = this.hasAttribute("keyboard") && this.getAttribute("keyboard") === "disabled" ? "disabled" : "enabled", this.addEventListener("keydown", this.onKeyDown), this.addEventListener("keyup", this.onKeyUp), this.addEventListener("focus", this.onFocus), this.addEventListener("blur", this.onBlur), this.addEventListener("touchstart", this.onTouchStart, { passive: true }), this.addEventListener("touchmove", this.onTouchMove, { passive: false }), this.addEventListener("touchend", this.onTouchEnd), this.addEventListener("mousedown", this.onMouseDown), this.handle = this.hasAttribute("handle") ? this.getAttribute("handle") : this.dragByHandle, this.hover = this.hasAttribute("hover") ? this.getAttribute("hover") : this.slideOnHover, this.direction = this.hasAttribute("direction") ? this.getAttribute("direction") : this.slideDirection, this.resetDimensions(), this.classList.contains(
|
|
153
|
+
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.addEventListener("dragstart", ((e3) => (e3.preventDefault(), false))), new ResizeObserver(this.resetDimensions).observe(this), this.setExposure(0), this.keyboard = this.hasAttribute("keyboard") && this.getAttribute("keyboard") === "disabled" ? "disabled" : "enabled", this.addEventListener("keydown", this.onKeyDown), this.addEventListener("keyup", this.onKeyUp), this.addEventListener("focus", this.onFocus), this.addEventListener("blur", this.onBlur), this.addEventListener("touchstart", this.onTouchStart, { passive: true }), this.addEventListener("touchmove", this.onTouchMove, { passive: false }), this.addEventListener("touchend", this.onTouchEnd), this.addEventListener("mousedown", this.onMouseDown), this.handle = this.hasAttribute("handle") ? this.getAttribute("handle") : this.dragByHandle, this.hover = this.hasAttribute("hover") ? this.getAttribute("hover") : this.slideOnHover, this.direction = this.hasAttribute("direction") ? this.getAttribute("direction") : this.slideDirection, this.resetDimensions(), this.classList.contains(i2) || this.classList.add(i2);
|
|
154
154
|
}
|
|
155
155
|
disconnectedCallback() {
|
|
156
156
|
this.transitionTimer && window.clearTimeout(this.transitionTimer);
|
|
157
157
|
}
|
|
158
|
-
attributeChangedCallback(e3,
|
|
159
|
-
e3 === "hover" && (this.hover =
|
|
158
|
+
attributeChangedCallback(e3, i3, a2) {
|
|
159
|
+
e3 === "hover" && (this.hover = a2), e3 === "direction" && (this.direction = a2), e3 === "keyboard" && (this.keyboard = a2 === "disabled" ? "disabled" : "enabled");
|
|
160
160
|
}
|
|
161
161
|
setExposure(e3 = 0) {
|
|
162
|
-
var
|
|
163
|
-
this.exposure = (
|
|
162
|
+
var i3;
|
|
163
|
+
this.exposure = (i3 = this.exposure + e3) < 0 ? 0 : i3 > 100 ? 100 : i3, this.firstElement.style.setProperty("--exposure", 100 - this.exposure + "%");
|
|
164
164
|
}
|
|
165
165
|
slide(e3 = 0) {
|
|
166
166
|
this.setExposure(e3);
|
|
167
|
-
let
|
|
168
|
-
this.dispatchEvent(
|
|
167
|
+
let i3 = new Event("slide");
|
|
168
|
+
this.dispatchEvent(i3);
|
|
169
169
|
}
|
|
170
170
|
slideToPage(e3) {
|
|
171
171
|
this.slideDirection === "horizontal" && this.slideToPageX(e3.x), this.slideDirection === "vertical" && this.slideToPageY(e3.y);
|
|
@@ -182,15 +182,15 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
182
182
|
}), 100);
|
|
183
183
|
}
|
|
184
184
|
startSlideAnimation() {
|
|
185
|
-
let e3 = null,
|
|
185
|
+
let e3 = null, i3 = this.animationDirection;
|
|
186
186
|
this.firstElement.style.setProperty("--transition-time", "var(--keyboard-transition-time)");
|
|
187
|
-
let
|
|
188
|
-
if (this.animationDirection === 0 ||
|
|
189
|
-
e3 === null && (e3 =
|
|
190
|
-
let
|
|
191
|
-
this.slide(
|
|
187
|
+
let a2 = (o2) => {
|
|
188
|
+
if (this.animationDirection === 0 || i3 !== this.animationDirection) return;
|
|
189
|
+
e3 === null && (e3 = o2);
|
|
190
|
+
let s2 = (o2 - e3) / 16.666666666666668 * this.animationDirection;
|
|
191
|
+
this.slide(s2), setTimeout((() => window.requestAnimationFrame(a2)), 0), e3 = o2;
|
|
192
192
|
};
|
|
193
|
-
window.requestAnimationFrame(
|
|
193
|
+
window.requestAnimationFrame(a2);
|
|
194
194
|
}
|
|
195
195
|
stopSlideAnimation() {
|
|
196
196
|
this.animationDirection = 0, this.firstElement.style.setProperty("--transition-time", "var(--default-transition-time)");
|
|
@@ -199,77 +199,121 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
199
199
|
})();
|
|
200
200
|
})();
|
|
201
201
|
})), require_dist = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
202
|
-
var
|
|
203
|
-
|
|
202
|
+
var i = e && e.__createBinding || (Object.create ? (function(e2, i2, a, o2) {
|
|
203
|
+
o2 === void 0 && (o2 = a), Object.defineProperty(e2, o2, {
|
|
204
204
|
enumerable: true,
|
|
205
205
|
get: function() {
|
|
206
|
-
return
|
|
206
|
+
return i2[a];
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
-
}) : (function(e2,
|
|
210
|
-
|
|
211
|
-
})),
|
|
209
|
+
}) : (function(e2, i2, a, o2) {
|
|
210
|
+
o2 === void 0 && (o2 = a), e2[o2] = i2[a];
|
|
211
|
+
})), o = e && e.__setModuleDefault || (Object.create ? (function(e2, i2) {
|
|
212
212
|
Object.defineProperty(e2, "default", {
|
|
213
213
|
enumerable: true,
|
|
214
|
-
value:
|
|
214
|
+
value: i2
|
|
215
215
|
});
|
|
216
|
-
}) : function(e2,
|
|
217
|
-
e2.default =
|
|
218
|
-
}),
|
|
216
|
+
}) : function(e2, i2) {
|
|
217
|
+
e2.default = i2;
|
|
218
|
+
}), s = e && e.__importStar || function(e2) {
|
|
219
219
|
if (e2 && e2.__esModule) return e2;
|
|
220
|
-
var
|
|
221
|
-
if (e2 != null) for (var
|
|
222
|
-
return
|
|
220
|
+
var a = {};
|
|
221
|
+
if (e2 != null) for (var s2 in e2) s2 !== "default" && Object.prototype.hasOwnProperty.call(e2, s2) && i(a, e2, s2);
|
|
222
|
+
return o(a, e2), a;
|
|
223
223
|
};
|
|
224
224
|
Object.defineProperty(e, "__esModule", { value: true }), e.ImgComparisonSlider = void 0;
|
|
225
|
-
var
|
|
226
|
-
typeof document < "u" && Promise.resolve().then(() =>
|
|
227
|
-
let
|
|
228
|
-
return (0,
|
|
229
|
-
|
|
230
|
-
}, [
|
|
231
|
-
|
|
232
|
-
}, []), (0,
|
|
233
|
-
class:
|
|
225
|
+
var l = require_react();
|
|
226
|
+
typeof document < "u" && Promise.resolve().then(() => s(require_dist$1())), e.ImgComparisonSlider = (0, l.forwardRef)(({ children: e2, onSlide: i2, value: a, className: o2, ...s2 }, c) => {
|
|
227
|
+
let u = (0, l.useRef)();
|
|
228
|
+
return (0, l.useEffect)(() => {
|
|
229
|
+
a !== void 0 && (u.current.value = parseFloat(a.toString()));
|
|
230
|
+
}, [a, u]), (0, l.useEffect)(() => {
|
|
231
|
+
i2 && u.current.addEventListener("slide", i2);
|
|
232
|
+
}, []), (0, l.useImperativeHandle)(c, () => u.current, [u]), (0, l.createElement)("img-comparison-slider", Object.assign({
|
|
233
|
+
class: o2 ? `${o2} rendered` : "rendered",
|
|
234
234
|
tabIndex: 0,
|
|
235
|
-
ref:
|
|
236
|
-
},
|
|
235
|
+
ref: u
|
|
236
|
+
}, s2), e2);
|
|
237
237
|
});
|
|
238
|
-
})), import_compiler_runtime = require_compiler_runtime(), import_dist = require_dist();
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
let
|
|
248
|
-
|
|
238
|
+
})), import_compiler_runtime = require_compiler_runtime(), import_dist = require_dist(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
|
|
239
|
+
function truncateSrc(e) {
|
|
240
|
+
return e.length > 100 ? `${e.slice(0, 100)}\u2026` : e;
|
|
241
|
+
}
|
|
242
|
+
var ImageComparisonComponent_default = (e) => {
|
|
243
|
+
let i = (0, import_compiler_runtime.c)(34), { beforeSrc: a, afterSrc: o, value: s, direction: c, width: l, height: p } = e, [m, h] = import_react.useState(_temp), g;
|
|
244
|
+
i[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => {
|
|
245
|
+
h(/* @__PURE__ */ new Set());
|
|
246
|
+
}, i[0] = g) : g = i[0];
|
|
247
|
+
let _;
|
|
248
|
+
i[1] !== o || i[2] !== a ? (_ = [a, o], i[1] = o, i[2] = a, i[3] = _) : _ = i[3], import_react.useEffect(g, _);
|
|
249
|
+
let v;
|
|
250
|
+
i[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = (e2) => {
|
|
251
|
+
h((i2) => new Set(i2).add(e2));
|
|
252
|
+
}, i[4] = v) : v = i[4];
|
|
253
|
+
let y = v, b = l || "100%", x = p || (c === "vertical" ? "400px" : "auto"), S;
|
|
254
|
+
i[5] !== b || i[6] !== x ? (S = {
|
|
255
|
+
width: b,
|
|
256
|
+
height: x,
|
|
257
|
+
maxWidth: "100%",
|
|
258
|
+
minHeight: "2rem"
|
|
259
|
+
}, i[5] = b, i[6] = x, i[7] = S) : S = i[7];
|
|
260
|
+
let C = S;
|
|
261
|
+
if (m.size > 0) {
|
|
262
|
+
let e2 = m.size > 1 ? "images" : "image", a2;
|
|
263
|
+
i[8] === m ? a2 = i[9] : (a2 = [...m].map(_temp2), i[8] = m, i[9] = a2);
|
|
264
|
+
let o2 = a2.join(", "), s2;
|
|
265
|
+
i[10] !== e2 || i[11] !== o2 ? (s2 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
266
|
+
"Failed to load ",
|
|
267
|
+
e2,
|
|
268
|
+
":",
|
|
269
|
+
" ",
|
|
270
|
+
o2
|
|
271
|
+
] }), i[10] = e2, i[11] = o2, i[12] = s2) : s2 = i[12];
|
|
272
|
+
let c2;
|
|
273
|
+
return i[13] !== C || i[14] !== s2 ? (c2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
274
|
+
style: C,
|
|
275
|
+
className: "flex items-center justify-center rounded border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",
|
|
276
|
+
children: s2
|
|
277
|
+
}), i[13] = C, i[14] = s2, i[15] = c2) : c2 = i[15], c2;
|
|
278
|
+
}
|
|
279
|
+
let w;
|
|
280
|
+
i[16] === a ? w = i[17] : (w = () => y(a), i[16] = a, i[17] = w);
|
|
281
|
+
let T;
|
|
282
|
+
i[18] !== a || i[19] !== w ? (T = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
249
283
|
slot: "first",
|
|
250
|
-
src:
|
|
284
|
+
src: a,
|
|
251
285
|
alt: "Before",
|
|
252
|
-
width: "100%"
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
286
|
+
width: "100%",
|
|
287
|
+
onError: w
|
|
288
|
+
}), i[18] = a, i[19] = w, i[20] = T) : T = i[20];
|
|
289
|
+
let E;
|
|
290
|
+
i[21] === o ? E = i[22] : (E = () => y(o), i[21] = o, i[22] = E);
|
|
291
|
+
let D;
|
|
292
|
+
i[23] !== o || i[24] !== E ? (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
256
293
|
slot: "second",
|
|
257
|
-
src:
|
|
294
|
+
src: o,
|
|
258
295
|
alt: "After",
|
|
259
|
-
width: "100%"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
296
|
+
width: "100%",
|
|
297
|
+
onError: E
|
|
298
|
+
}), i[23] = o, i[24] = E, i[25] = D) : D = i[25];
|
|
299
|
+
let O;
|
|
300
|
+
i[26] !== c || i[27] !== D || i[28] !== T || i[29] !== s ? (O = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dist.ImgComparisonSlider, {
|
|
301
|
+
value: s,
|
|
302
|
+
direction: c,
|
|
303
|
+
children: [T, D]
|
|
304
|
+
}), i[26] = c, i[27] = D, i[28] = T, i[29] = s, i[30] = O) : O = i[30];
|
|
305
|
+
let k;
|
|
306
|
+
return i[31] !== C || i[32] !== O ? (k = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
307
|
+
style: C,
|
|
308
|
+
children: O
|
|
309
|
+
}), i[31] = C, i[32] = O, i[33] = k) : k = i[33], k;
|
|
272
310
|
};
|
|
311
|
+
function _temp() {
|
|
312
|
+
return /* @__PURE__ */ new Set();
|
|
313
|
+
}
|
|
314
|
+
function _temp2(e) {
|
|
315
|
+
return `"${truncateSrc(e)}"`;
|
|
316
|
+
}
|
|
273
317
|
export {
|
|
274
318
|
ImageComparisonComponent_default as default
|
|
275
319
|
};
|
|
@@ -36291,7 +36291,7 @@ ${d}`,
|
|
|
36291
36291
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
36292
36292
|
}
|
|
36293
36293
|
}
|
|
36294
|
-
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.15-
|
|
36294
|
+
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.15-dev26");
|
|
36295
36295
|
showCodeInRunModeAtom = atom(true);
|
|
36296
36296
|
atom(null);
|
|
36297
36297
|
var import_compiler_runtime = require_compiler_runtime();
|
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ import { $ as reducer, $t as isUninstantiated, A as ChevronDownIcon, An as Item$
|
|
|
26
26
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BbqSm5gU.js";
|
|
27
27
|
import { o as useSize, s as Root$1, u as createLucideIcon } from "./dist--2Bqjvs0.js";
|
|
28
28
|
import { A as SquareFunction, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, O as TIME_UNIT_DESCRIPTIONS, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as ChartColumn, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-Cz-Bj1JI.js";
|
|
29
|
-
import { $ as ContextAwarePanelItem, $t as EmotionCacheProvider, A as prettifyRowColumnCount, At as loadTableData, B as useSelectList, Bt as dateToLocalISOTime, C as Filenames, Ct as ColumnChartContext, D as EmptyState, Dt as usePrevious$1, E as ColumnPreviewContainer, Et as useIntersectionObserver, F as ContextMenuContent, Ft as getMimeValues, G as ComboboxItem, Gt as ChartErrorState, H as DatePicker, Ht as TabsContent, I as ContextMenuItem, It as isNullishFilter, J as CommandInput, Jt as LazyVegaEmbed, K as Command, Kt as ChartInfoState, L as ContextMenuSeparator, Lt as Maps, M as getColumnCountForDisplay, Mt as SELECT_COLUMN_ID, N as getUserColumnVisibilityCounts, Nt as TOO_MANY_ROWS, O as ErrorState, Ot as getPageIndexForRow, P as ContextMenu, Pt as toFieldTypes, Q as smartMatch, Qt as HtmlOutput, R as ContextMenuTrigger, Rt as dateToLocalISODate, S as Progress, St as renderCellValue, T as ColumnName, Tt as DelayMount, U as DateRangePicker, Ut as TabsList, V as CompactChipRow, Vt as Tabs, W as Combobox, Wt as TabsTrigger, X as CommandList, Xt as RenderTextWithLinks, Y as CommandItem, Yt as useOverflowDetection, Z as CommandSeparator, Zt as Kbd, _ as InstallPackageButton, _n as ArrowDownWideNarrow, _t as TableHeader, an as GripHorizontal, at as SlotNames, b as downloadByURL, bt as generateColumns, d as RadioGroup, dn as Code, dt as Fill, en as hasFunctionProperty, et as PANEL_TYPES, f as RadioGroupItem, fn as ChevronsUpDown, ft as Provider$1, g as DataTable, gn as ChevronLeft, gt as TableHead, h as OutputRenderer, hn as ChevronsDownUp, ht as TableCell, in as TextWrap, it as isCellAwareAtom, j as prettifyRowCount, jt as INDEX_COLUMN_NAME, k as LoadingState, kt as loadTableAndRawData, l as Slide, ln as Ellipsis, m as OutputArea, mn as ChevronsLeft, mt as TableBody, n as marimoVersionAtom, nn as $fae977aafc393c5c$export$588937bcd60ade55, nt as contextAwarePanelOwner, on as Funnel, ot as slotsController, p as JsonOutput, pn as ChevronsRight, pt as Table, q as CommandEmpty, qt as ChartLoadingState, r as showCodeInRunModeAtom, rn as $fae977aafc393c5c$export$6b862160d295c8e, rt as contextAwarePanelType, s as SLIDE_TYPE_OPTIONS_BY_VALUE, sn as EyeOff, st as Toggle, t as useNotebookCodeAvailable, tn as isRecord, tt as contextAwarePanelOpen, u as Switch, un as Download, v as ADD_PRINTING_CLASS, vt as TableRow, w as downloadSizeLimitAtom, wt as ColumnChartSpecModel, x as downloadHTMLAsImage, xt as inferFieldTypes, y as downloadBlob, yt as NAMELESS_COLUMN_PREFIX, z as useInternalStateWithSync, zt as dateToLocalISODateTime, __tla as __tla_2 } from "./code-visibility-
|
|
29
|
+
import { $ as ContextAwarePanelItem, $t as EmotionCacheProvider, A as prettifyRowColumnCount, At as loadTableData, B as useSelectList, Bt as dateToLocalISOTime, C as Filenames, Ct as ColumnChartContext, D as EmptyState, Dt as usePrevious$1, E as ColumnPreviewContainer, Et as useIntersectionObserver, F as ContextMenuContent, Ft as getMimeValues, G as ComboboxItem, Gt as ChartErrorState, H as DatePicker, Ht as TabsContent, I as ContextMenuItem, It as isNullishFilter, J as CommandInput, Jt as LazyVegaEmbed, K as Command, Kt as ChartInfoState, L as ContextMenuSeparator, Lt as Maps, M as getColumnCountForDisplay, Mt as SELECT_COLUMN_ID, N as getUserColumnVisibilityCounts, Nt as TOO_MANY_ROWS, O as ErrorState, Ot as getPageIndexForRow, P as ContextMenu, Pt as toFieldTypes, Q as smartMatch, Qt as HtmlOutput, R as ContextMenuTrigger, Rt as dateToLocalISODate, S as Progress, St as renderCellValue, T as ColumnName, Tt as DelayMount, U as DateRangePicker, Ut as TabsList, V as CompactChipRow, Vt as Tabs, W as Combobox, Wt as TabsTrigger, X as CommandList, Xt as RenderTextWithLinks, Y as CommandItem, Yt as useOverflowDetection, Z as CommandSeparator, Zt as Kbd, _ as InstallPackageButton, _n as ArrowDownWideNarrow, _t as TableHeader, an as GripHorizontal, at as SlotNames, b as downloadByURL, bt as generateColumns, d as RadioGroup, dn as Code, dt as Fill, en as hasFunctionProperty, et as PANEL_TYPES, f as RadioGroupItem, fn as ChevronsUpDown, ft as Provider$1, g as DataTable, gn as ChevronLeft, gt as TableHead, h as OutputRenderer, hn as ChevronsDownUp, ht as TableCell, in as TextWrap, it as isCellAwareAtom, j as prettifyRowCount, jt as INDEX_COLUMN_NAME, k as LoadingState, kt as loadTableAndRawData, l as Slide, ln as Ellipsis, m as OutputArea, mn as ChevronsLeft, mt as TableBody, n as marimoVersionAtom, nn as $fae977aafc393c5c$export$588937bcd60ade55, nt as contextAwarePanelOwner, on as Funnel, ot as slotsController, p as JsonOutput, pn as ChevronsRight, pt as Table, q as CommandEmpty, qt as ChartLoadingState, r as showCodeInRunModeAtom, rn as $fae977aafc393c5c$export$6b862160d295c8e, rt as contextAwarePanelType, s as SLIDE_TYPE_OPTIONS_BY_VALUE, sn as EyeOff, st as Toggle, t as useNotebookCodeAvailable, tn as isRecord, tt as contextAwarePanelOpen, u as Switch, un as Download, v as ADD_PRINTING_CLASS, vt as TableRow, w as downloadSizeLimitAtom, wt as ColumnChartSpecModel, x as downloadHTMLAsImage, xt as inferFieldTypes, y as downloadBlob, yt as NAMELESS_COLUMN_PREFIX, z as useInternalStateWithSync, zt as dateToLocalISODateTime, __tla as __tla_2 } from "./code-visibility-lZd-lNkj.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-DegSo0lV.js";
|
|
31
31
|
import { t as Check } from "./check-C9OoNtR4.js";
|
|
32
32
|
import { A as Icon, C as logNever, D as $18f2051aff69b9bf$export$a54013f0d02a8f82, E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, F as createCollection, I as X, M as clamp$2, N as usePrevious$2, P as useDirection, R as ChevronDown, S as assertNever, a as SelectGroup, c as SelectSeparator, d as NativeSelect, i as SelectContent, j as Trigger$1, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, w as $a916eb452884faea$export$b7a616150fdb9f44 } from "./strings-Dq_j3Rxw.js";
|
|
@@ -28447,7 +28447,7 @@ ${c}
|
|
|
28447
28447
|
m
|
|
28448
28448
|
]
|
|
28449
28449
|
});
|
|
28450
|
-
}, LazyImageComparisonComponent = import_react.lazy(() => import("./ImageComparisonComponent-
|
|
28450
|
+
}, LazyImageComparisonComponent = import_react.lazy(() => import("./ImageComparisonComponent-1i5IBhon.js")), ImageComparisonPlugin = class {
|
|
28451
28451
|
constructor() {
|
|
28452
28452
|
__publicField(this, "tagName", "marimo-image-comparison");
|
|
28453
28453
|
__publicField(this, "validator", object({
|
|
@@ -38024,7 +38024,7 @@ ${c}
|
|
|
38024
38024
|
function _temp2$2(e) {
|
|
38025
38025
|
e.target === e.currentTarget && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), e.currentTarget.click());
|
|
38026
38026
|
}
|
|
38027
|
-
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-
|
|
38027
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-B0JS8HUE.js"));
|
|
38028
38028
|
const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
|
|
38029
38029
|
var _a5;
|
|
38030
38030
|
let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { slideCells: h, skippedIds: g, noOutputIds: _, slideTypes: v, startCellIndex: y } = (0, import_react.useMemo)(() => computeSlideCellsInfo(c, e), [
|
|
@@ -9,7 +9,7 @@ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
|
9
9
|
import { lt as kioskModeAtom, pt as outputIsStale } from "./html-to-image-JXL8cvmt.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BbqSm5gU.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
|
|
12
|
-
import { a as DEFAULT_DECK_VERTICAL_ALIGN, c as SlideSidebar, cn as Expand, ct as Panel, dn as Code, i as DEFAULT_DECK_TRANSITION, l as Slide, lt as PanelGroup, o as DEFAULT_SLIDE_TYPE, sn as EyeOff, t as useNotebookCodeAvailable, ut as PanelResizeHandle } from "./code-visibility-
|
|
12
|
+
import { a as DEFAULT_DECK_VERTICAL_ALIGN, c as SlideSidebar, cn as Expand, ct as Panel, dn as Code, i as DEFAULT_DECK_TRANSITION, l as Slide, lt as PanelGroup, o as DEFAULT_SLIDE_TYPE, sn as EyeOff, t as useNotebookCodeAvailable, ut as PanelResizeHandle } from "./code-visibility-lZd-lNkj.js";
|
|
13
13
|
import { X as useDebouncedCallback } from "./input-DtsN7xm-.js";
|
|
14
14
|
import "./toDate-CWNNlFEX.js";
|
|
15
15
|
import "./react-dom-BTJzcVJ9.js";
|