@reuse-sh/lightbox 0.2.2 → 0.3.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/ICONS-LICENSE.md +73 -0
- package/LICENSE +1 -1
- package/README.md +3 -2
- package/dist/base.css +37 -0
- package/dist/browser/audio.js +1 -1
- package/dist/browser/carousel-link.js +2 -2
- package/dist/browser/carousel-link.js.map +1 -1
- package/dist/browser/embed.js +1 -1
- package/dist/browser/html.js +1 -1
- package/dist/browser/iframe.js +1 -1
- package/dist/browser/lightbox.js +2 -2
- package/dist/browser/lightbox.js.map +1 -1
- package/dist/browser/video.js +1 -1
- package/dist/carousel.js +9 -1
- package/dist/icons.d.ts +42 -12
- package/dist/icons.js +42 -18
- package/dist/index.js +167 -45
- package/dist/theme.css +126 -36
- package/dist/themes/dark.css +3 -0
- package/dist/themes/page.css +11 -0
- package/dist/unlayered/base.css +37 -0
- package/dist/unlayered/theme.css +126 -36
- package/dist/unlayered/themes/dark.css +3 -0
- package/dist/unlayered/themes/page.css +11 -0
- package/package.json +5 -4
package/ICONS-LICENSE.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Icon notices
|
|
2
|
+
|
|
3
|
+
The built-in icons in src/icons.ts copy path data from two icon sets.
|
|
4
|
+
|
|
5
|
+
Close, fullscreen, fullscreen exit and download come from Hugeicons free icons:
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Hugeicons
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Previous, next, zoom in and zoom out come from Lucide (chevron-left, chevron-right, zoom-in, zoom-out). Lucide is ISC, and these four icons derive from Feather, MIT:
|
|
30
|
+
|
|
31
|
+
ISC License
|
|
32
|
+
|
|
33
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
34
|
+
|
|
35
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
36
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
37
|
+
copyright notice and this permission notice appear in all copies.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
40
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
41
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
42
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
43
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
44
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
45
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
The following Lucide icons are derived from the Feather project:
|
|
50
|
+
|
|
51
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
52
|
+
|
|
53
|
+
The MIT License (MIT) (for the icons listed above)
|
|
54
|
+
|
|
55
|
+
Copyright (c) 2013-present Cole Bemis
|
|
56
|
+
|
|
57
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
58
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
59
|
+
in the Software without restriction, including without limitation the rights
|
|
60
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
61
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
62
|
+
furnished to do so, subject to the following conditions:
|
|
63
|
+
|
|
64
|
+
The above copyright notice and this permission notice shall be included in all
|
|
65
|
+
copies or substantial portions of the Software.
|
|
66
|
+
|
|
67
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
68
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
69
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
70
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
71
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
72
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
73
|
+
SOFTWARE.
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -18,14 +18,15 @@ These are the rules the code keeps. An adaptation on any framework keeps them to
|
|
|
18
18
|
- **Behave like the platform's photo viewer.** Gestures, keys and timing match iOS Photos, macOS Photos and Google Photos unless a recorded decision says otherwise.
|
|
19
19
|
- **Dismiss like a photos app.** A vertical swipe carries the photo, fades the backdrop and the controls with it, and closes past a distance or a speed. A cancelled pointer never closes, a second finger leaves the swipe with the first, and a close ends the gesture.
|
|
20
20
|
- **Let the photo lead.** Controls fade in after the photo starts moving and leave before it. They hide while zoomed and after a still pointer, and a still pointer never hides them while one is hovered or keyboard-focused. While zoomed only close and zoom come back, focus on any other control, or on one a zoom stops rendering, moves to the photo, and the photo pans to the window's edges under the room the other controls kept.
|
|
21
|
+
- **Frame a photo that reads as a page.** A photo more than twice as tall as it is wide rests in a window the padding below the toolbar, beside the arrows and above the bottom room, ringed with --re-lightbox-media-ring, and scrolls inside it, so no control sits on it, a one-line caption stays below it, and a pale page still shows its edge on a pale room. Zoomed in, during a dismiss drag and in the close flight the window opens to the whole screen, the open flight closes it around the landing photo, and the ring shows only at the photo's resting size.
|
|
21
22
|
- **Change the caption with the photo.** Each page fades the caption out while it rises 0.4em and fades the next one in as it rises from 0.4em below, over --re-lightbox-fade-duration, the other way when paging back, and swaps its text while it is hidden, so a caption of another height, or none, never jumps into view. A page during the fade goes on from the opacity and the shift on screen with the newest caption, the shift adds to a host's own translate, and reduced motion swaps it at once. The announcement of the settled photo reads its number and its caption once, through strings.slide(index, count, caption), so a translation sets the order and the separator.
|
|
22
|
-
- **Return to what is on screen.**
|
|
23
|
+
- **Return to what is on screen.** A linked page carousel brings the current slide into view if less than half of its width is visible or if a move in progress would leave less than half visible. Close returns to the current photo's tile and fades in place when the window or a clipping container hides the tile. A close during a mouse drag or a fling ends it, puts the lightbox strip on the current photo at once and flies from where the photo was, with no neighbor in view. The page scrolls and takes clicks during the flight and stays where it was scrolled once the viewer is gone, focus moved there stays, the tile's container does not cut the photo before it nears the tile, and the landing photo never changes the size of a scroll area.
|
|
23
24
|
- **Fetch the pixels the screen shows.** Each image loads the source that fits the rendered size, a zoom asks for more, and the preview stays until the sharper file has decoded and no finger holds the photo. A photo without a size fits the screen at its tile's proportions from the start and eases to its file's size once the file decodes.
|
|
24
25
|
- **Roll the count with the page.** Every counter, the built-in one and each a slot takes from counter(), rolls a changed digit up when paging forward and down when paging back, and switches at once under reduced motion.
|
|
25
26
|
- **Zoom to real pixels.** Zoom levels follow the image's own resolution. Panning stretches past the edge and glides on release.
|
|
26
27
|
- **Never block a frame.** No layout read or framework render runs per pointer move, scroll or wheel event.
|
|
27
28
|
- **Press like a native button.** A pressed control shrinks to --re-lightbox-press-scale, but a mouse press acts on release anywhere over the size it rests at, its outer edge included, and a release off it does nothing.
|
|
28
|
-
- **Give focus back quietly.** A click or a tap opens with focus on the close button and no ring. Focus returns to the photo's tile without a ring after
|
|
29
|
+
- **Give focus back quietly.** A click or a tap opens with focus on the close button and no ring. Escape closes without changing the input mode. Focus returns to the photo's tile without a ring after pointer use, and with one after keyboard use, unless the visitor moved it during the close flight.
|
|
29
30
|
- **Show every shape readably.** A long screenshot opens at the screen's width and scrolls, a panorama zooms to the screen's height, a transparent photo sits on its own backing, and an SVG takes the size its file declares.
|
|
30
31
|
- **Hand the photo to the system.** The photo is a real image: the browser's menu saves and copies it, and Cmd or Ctrl and C copies it. protect turns these off. A mouse drag on it pages like a finger, so saving stays on Download and the context menu.
|
|
31
32
|
- **Stay light in large galleries.** A thousand photos open as fast as ten. Slides outside the preload window are empty shells, the strip's positions are arithmetic, and the next photo in the direction of travel loads first.
|
package/dist/base.css
CHANGED
|
@@ -66,6 +66,39 @@
|
|
|
66
66
|
.re-lightbox-slide[data-re-cycle]:not([data-re-cycle="0"]) {
|
|
67
67
|
translate: var(--re-carousel-shift);
|
|
68
68
|
}
|
|
69
|
+
.re-lightbox-slide[data-framed] {
|
|
70
|
+
clip-path: inset(0px);
|
|
71
|
+
transition: clip-path var(--re-lightbox-zoom-duration, 350ms)
|
|
72
|
+
var(--re-lightbox-ease, cubic-bezier(0.32, 0.72, 0, 1));
|
|
73
|
+
}
|
|
74
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
75
|
+
.re-lightbox:is([data-phase="opening"], [data-phase="returning"])
|
|
76
|
+
.re-lightbox-slide[data-framed] {
|
|
77
|
+
transition-duration: var(--re-lightbox-open-duration, 400ms);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.re-lightbox-slide[data-framed]::after {
|
|
81
|
+
content: "";
|
|
82
|
+
position: absolute;
|
|
83
|
+
inset: var(--re-lightbox-window, 0px);
|
|
84
|
+
opacity: 0;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
transition: opacity var(--re-lightbox-zoom-duration, 350ms) ease;
|
|
87
|
+
}
|
|
88
|
+
.re-lightbox:is(
|
|
89
|
+
[data-phase="opening"],
|
|
90
|
+
[data-phase="open"],
|
|
91
|
+
[data-phase="returning"]
|
|
92
|
+
):not([data-zoomed="true"])
|
|
93
|
+
.re-lightbox-slide[data-framed] {
|
|
94
|
+
clip-path: inset(var(--re-lightbox-window, 0px));
|
|
95
|
+
}
|
|
96
|
+
.re-lightbox:is([data-phase="open"], [data-phase="returning"]):not(
|
|
97
|
+
[data-zoomed="true"]
|
|
98
|
+
)
|
|
99
|
+
.re-lightbox-slide[data-framed="rest"]::after {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
69
102
|
.re-lightbox-frame {
|
|
70
103
|
position: relative;
|
|
71
104
|
flex: none;
|
|
@@ -598,5 +631,9 @@
|
|
|
598
631
|
.re-lightbox-viewport {
|
|
599
632
|
scroll-behavior: auto;
|
|
600
633
|
}
|
|
634
|
+
.re-lightbox-slide[data-framed],
|
|
635
|
+
.re-lightbox-slide[data-framed]::after {
|
|
636
|
+
transition: none;
|
|
637
|
+
}
|
|
601
638
|
}
|
|
602
639
|
}
|
package/dist/browser/audio.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @reuse-sh/lightbox 0.
|
|
1
|
+
/*! @reuse-sh/lightbox 0.3.1 | MIT License */
|
|
2
2
|
import{playerOf as e}from"./video.js";function t(){return{type:`audio`,mount(t,{item:n,signal:r,autoplay:i}){let a=t.ownerDocument.createElement(`audio`);return a.className=`re-lightbox-audio`,a.controls=!0,a.preload=`metadata`,a.src=n.src??``,n.alt&&a.setAttribute(`aria-label`,n.alt),t.append(a),e(a,i,r)}}}export{t as audio};
|
|
3
3
|
//# sourceMappingURL=audio.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @reuse-sh/lightbox 0.
|
|
2
|
-
|
|
1
|
+
/*! @reuse-sh/lightbox 0.3.1 | MIT License */
|
|
2
|
+
const e=Symbol.for(`@reuse-sh/carousel internals`);function t(t,n,{slideOf:r=e=>e}={}){let i=n[e],a=e=>n.hold(`lightbox`,e),o=({index:e})=>{let t=r(e);(i?.willKeepVisible?.(t)??n.getState().visible.includes(t))||n.goTo(t,`instant`)},s=[t.on(`open`,()=>a(!0)),t.on(`settle`,o),t.on(`beforeclose`,o),t.on(`closed`,()=>a(!1))];return t.getState().isOpen&&a(!0),()=>{for(let e of s)e();a(!1)}}export{t as connectCarousel};
|
|
3
3
|
//# sourceMappingURL=carousel-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-link.js","names":["connectCarousel","index","
|
|
1
|
+
{"version":3,"file":"carousel-link.js","names":["carouselInternals","connectCarousel","index","strip","carousel","hold","isHeld","follow","slide","slideOf","stops","lightbox","stop"],"sources":["../carousel.js"],"sourcesContent":["const carouselInternals = Symbol.for(\"@reuse-sh/carousel internals\");\nexport function connectCarousel(lightbox, carousel, { slideOf = (index) => index } = {}) {\n const strip = carousel[carouselInternals];\n const hold = (isHeld) => carousel.hold(\"lightbox\", isHeld);\n const follow = ({ index }) => {\n const slide = slideOf(index);\n const visible = strip?.willKeepVisible?.(slide) ??\n carousel.getState().visible.includes(slide);\n if (!visible)\n carousel.goTo(slide, \"instant\");\n };\n const stops = [\n lightbox.on(\"open\", () => hold(true)),\n lightbox.on(\"settle\", follow),\n lightbox.on(\"beforeclose\", follow),\n lightbox.on(\"closed\", () => hold(false)),\n ];\n if (lightbox.getState().isOpen)\n hold(true);\n return () => {\n for (const stop of stops)\n stop();\n hold(false);\n };\n}\n"],"mappings":";AAAA,MAAMA,EAAoB,OAAO,IAAI,8BAA8B,EACnE,SAAgBC,EAAgB,EAAU,EAAU,CAAE,UAAW,GAAUC,GAAU,CAAC,EAAG,CACrF,IAAMC,EAAQC,EAASJ,GACjBK,EAAQ,GAAWD,EAAS,KAAK,WAAYE,CAAM,EACnDC,GAAU,CAAE,WAAY,CAC1B,IAAMC,EAAQC,EAAQP,CAAK,GACXC,GAAO,kBAAkBK,CAAK,GAC1CJ,EAAS,SAAS,CAAC,CAAC,QAAQ,SAASI,CAAK,IAE1CJ,EAAS,KAAKI,EAAO,SAAS,CACtC,EACME,EAAQ,CACVC,EAAS,GAAG,WAAcN,EAAK,EAAI,CAAC,EACpCM,EAAS,GAAG,SAAUJ,CAAM,EAC5BI,EAAS,GAAG,cAAeJ,CAAM,EACjCI,EAAS,GAAG,aAAgBN,EAAK,EAAK,CAAC,CAC3C,EAGA,OAFIM,EAAS,SAAS,CAAC,CAAC,QACpBN,EAAK,EAAI,MACA,CACT,IAAK,IAAMO,KAAQF,EACfE,EAAK,EACTP,EAAK,EAAK,CACd,CACJ,C"}
|
package/dist/browser/embed.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @reuse-sh/lightbox 0.
|
|
1
|
+
/*! @reuse-sh/lightbox 0.3.1 | MIT License */
|
|
2
2
|
import{frameOf as e,loaded as t}from"./iframe.js";const n=e=>{try{let t=typeof e==`string`?JSON.parse(e):e;return typeof t==`object`&&t?t:void 0}catch{return}},r={greet:e=>e({event:`listening`,id:1,channel:`widget`}),command:e=>({event:`command`,func:e===`mute`?`mute`:`${e}Video`,args:[]}),state(e){let t=e.info?.playerState;return t===1?`playing`:t===3?`waiting`:t===2||t===0?`paused`:t===-1||t===5?`unstarted`:void 0}},i={greet(e){for(let t of[`play`,`pause`,`ended`])e({method:`addEventListener`,value:t})},command:e=>e===`mute`?{method:`setVolume`,value:0}:{method:e},state:e=>e.event===`play`?`playing`:e.event===`pause`||e.event===`ended`?`paused`:void 0},a=/* @__PURE__ */ new WeakMap,o=e=>`https://www.youtube-nocookie.com/embed/${e}?enablejsapi=1&playsinline=1`,s=[{name:`youtube-shorts`,pattern:/^https?:\/\/(?:www\.|m\.)?youtube\.com\/shorts\/([\w-]+)/,url:e=>o(e[1]),aspect:9/16},{name:`youtube`,pattern:/^https?:\/\/(?:(?:www\.|m\.)?youtube(?:-nocookie)?\.com\/(?:watch\?(?:.*&)?v=|embed\/|live\/)|youtu\.be\/)([\w-]+)/,url:e=>o(e[1])},{name:`vimeo`,pattern:/^https?:\/\/(?:player\.)?vimeo\.com\/(?:video\/)?(\d+)(?:\/([\da-f]+))?/,url:e=>`https://player.vimeo.com/video/${e[1]}${e[2]?`?h=${e[2]}`:``}`}];a.set(s[0],r),a.set(s[1],r),a.set(s[2],i);function c(e,t){try{let n=new URL(e);for(let[e,r]of new URL(t).searchParams)if(!(e===`v`||n.searchParams.has(e===`t`?`start`:e))){if(e!==`t`)n.searchParams.set(e,r);else{let[,e=0,t=0,i=0]=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s?)?$/.exec(r)??[],a=Number(e)*3600+Number(t)*60+Number(i);a&&n.searchParams.set(`start`,String(a))}}return n.href}catch{return e}}function l(r={}){let i=[...r.providers??[],...s];return{type:`embed`,mount(o,{item:s,signal:l,autoplay:u}){let d=s.src??``,f,p=null;for(let e of i)if(p=e.pattern.exec(d),p){f=e;break}let m=f&&p?c(f.url(p,s),d):``,h=e(o,m,s.alt??f?.name??``,r.sandbox),g=t(h,l),_={interactive:!0,aspect:f?.aspect,ready:g,unmount:()=>h.remove()},v=f&&a.get(f);if(!v)return _;let y=new URL(m).origin,b=e=>h.contentWindow?.postMessage(JSON.stringify(e),y),x=u,S=!1,C,w;return o.ownerDocument.defaultView?.addEventListener(`message`,e=>{if(e.source!==h.contentWindow||e.origin!==y)return;let t=n(e.data);C=(t&&v.state(t))??C,C===`playing`&&(x=!1,clearTimeout(w))},{signal:l}),l.addEventListener(`abort`,()=>clearTimeout(w)),g.then(()=>v.greet(b)),{..._,pause(){S=!1,clearTimeout(w),b(v.command(`pause`))},resume(){S=!0,x&&(x=!1,g.then(()=>{!l.aborted&&S&&(b(v.command(`play`)),w=setTimeout(()=>{C!==`playing`&&C!==`waiting`&&(b(v.command(`mute`)),b(v.command(`play`)))},1e3))}))}}}}}export{l as embed};
|
|
3
3
|
//# sourceMappingURL=embed.js.map
|
package/dist/browser/html.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @reuse-sh/lightbox 0.
|
|
1
|
+
/*! @reuse-sh/lightbox 0.3.1 | MIT License */
|
|
2
2
|
function e(){return{type:`html`,mount(e,{item:t}){let n=e.ownerDocument.createElement(`div`);n.className=`re-lightbox-html`;let r=t.html?.();return r&&n.append(r),e.append(n),{interactive:!0,unmount:()=>n.remove()}}}}export{e as html};
|
|
3
3
|
//# sourceMappingURL=html.js.map
|
package/dist/browser/iframe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @reuse-sh/lightbox 0.
|
|
1
|
+
/*! @reuse-sh/lightbox 0.3.1 | MIT License */
|
|
2
2
|
function e(e,t,n,r){let i=e.ownerDocument,a=i.createElement(`iframe`);if(a.className=`re-lightbox-iframe`,a.allow=`autoplay; fullscreen; picture-in-picture`,a.referrerPolicy=`strict-origin-when-cross-origin`,a.loading=`lazy`,a.title=n,a.src=`about:blank`,t.trim())try{let e=new URL(t,i.baseURI);/^https?:$/.test(e.protocol)&&(a.src=e.href),e.origin!==i.location.origin&&(r??=`allow-scripts allow-same-origin allow-forms allow-presentation allow-popups`)}catch{}return r!=null&&(a.sandbox=r),e.append(a),a}function t(e,t){return new Promise(n=>e.addEventListener(`load`,n,{once:!0,signal:t}))}function n(n={}){return{type:`iframe`,mount(r,{item:i,signal:a}){let o=e(r,i.src??``,i.alt??``,n.sandbox);return{interactive:!0,ready:t(o,a),unmount:()=>o.remove()}}}}export{e as frameOf,n as iframe,t as loaded};
|
|
3
3
|
//# sourceMappingURL=iframe.js.map
|