photosuite 0.1.0 → 0.1.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/{dom-DMZsb49p.cjs → dom-CJtH5lQe.cjs} +1 -1
- package/dist/{dom-CDvVCbvk.js → dom-CLdyQVUy.js} +5 -3
- package/dist/{exif-Dr_aoh2F.js → exif-Bvph_6jm.js} +1 -1
- package/dist/exif-CBo-Frgp.cjs +1 -0
- package/dist/{glightbox-Cnkb5Vpt.js → glightbox-3dU8JRqr.js} +1 -1
- package/dist/glightbox-lE-btsco.cjs +1 -0
- package/dist/imageAlts-Bt8VtEfG.cjs +1 -0
- package/dist/{imageAlts-BAYP9b5j.js → imageAlts-PnRBw8zl.js} +1 -1
- package/dist/photosuite.cjs.js +1 -1
- package/dist/photosuite.css +1 -1
- package/dist/photosuite.es.js +2 -2
- package/dist/photosuite.integration.cjs +1 -1
- package/dist/photosuite.integration.js +1 -1
- package/package.json +76 -76
- package/dist/exif-DYpA7_Ip.cjs +0 -1
- package/dist/glightbox-D14wFv8j.cjs +0 -1
- package/dist/imageAlts-CAX8Uksx.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let t=e.parentElement;if(!t)return e;let n=e;e.tagName.toLowerCase()===`img`&&t&&t.tagName.toLowerCase()===`a`&&t.classList.contains(`glightbox`)&&(n=t);let r=n.parentElement;if(r&&r.classList.contains(`photosuite-item`))return r;let i=document.createElement(`div`);i.className=`photosuite-item`;let a=n.parentElement;return a?(a.replaceChild(i,n),i.appendChild(n),i):i}function t(t,n,r){let i=new Set,a=t=>{let n=e(t);i.has(n)||n.querySelector(`img`)&&(r(n),i.add(n))};document.querySelectorAll(t).forEach(e=>{e.querySelectorAll(n).forEach(a),e.querySelectorAll(`img`).forEach(a)})}function n(e){if(e.querySelector(`.photosuite-caption`))return;let t=e.querySelector(`img`);if(!t)return;let n=String(t.getAttribute(`alt`)||``).trim();if(!n)return;let r=document.createElement(`div`);r.className=`photosuite-caption`,r.textContent=n,e.appendChild(r)}function r(e){
|
|
1
|
+
function e(e){let t=e.parentElement;if(!t)return e;let n=e;e.tagName.toLowerCase()===`img`&&t&&t.tagName.toLowerCase()===`a`&&t.classList.contains(`glightbox`)&&(n=t);let r=n.parentElement;if(r&&r.classList.contains(`photosuite-item`))return r;let i=document.createElement(`div`);i.className=`photosuite-item`;let a=n.parentElement;return a?(a.replaceChild(i,n),i.appendChild(n),i):i}function t(t,n,r){let i=new Set,a=t=>{let n=e(t);i.has(n)||n.querySelector(`img`)&&(r(n),i.add(n))};document.querySelectorAll(t).forEach(e=>{e.querySelectorAll(n).forEach(a),e.querySelectorAll(`img`).forEach(a)})}function n(e){if(e.querySelector(`.photosuite-caption`))return;let t=e.querySelector(`img`);if(!t)return;let n=String(t.getAttribute(`alt`)||``).trim();if(!n)return;let r=document.createElement(`div`);r.className=`photosuite-caption`,r.textContent=n,e.appendChild(r)}function r(e){let t=e.querySelector(`.photosuite-exif`);if(t){t.textContent?.trim()||t.remove();return}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -29,8 +29,10 @@ function ensureCaption(e) {
|
|
|
29
29
|
r.className = "photosuite-caption", r.textContent = n, e.appendChild(r);
|
|
30
30
|
}
|
|
31
31
|
function ensureExif(e) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let t = e.querySelector(".photosuite-exif");
|
|
33
|
+
if (t) {
|
|
34
|
+
t.textContent?.trim() || t.remove();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
export { ensureExif as n, processMedia as r, ensureCaption as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./dom-CJtH5lQe.cjs`);async function t(t,n){await Promise.resolve().then(()=>require(`./exif-DwHkZ3YD.cjs`)),e.r(t,n,t=>{e.n(t)})}exports.enableExif=t;
|
|
@@ -9,7 +9,7 @@ function sync(e, t) {
|
|
|
9
9
|
if (!n) return;
|
|
10
10
|
let r = n.currentSrc || n.src;
|
|
11
11
|
r && e.getAttribute("href") !== r && e.setAttribute("href", r);
|
|
12
|
-
let i = n.getAttribute("alt");
|
|
12
|
+
let i = String(n.getAttribute("alt") || "").trim();
|
|
13
13
|
i && !e.dataset.title && (e.dataset.title = i), e.dataset.gallery || (e.dataset.gallery = t);
|
|
14
14
|
}
|
|
15
15
|
function loadCss(e) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){let n=e.currentSrc||e.src||``;if(!n)return;let r=String(e.getAttribute(`alt`)||``).trim(),i=document.createElement(`a`);i.href=n,i.className=`glightbox`,i.dataset.gallery=t,r&&(i.dataset.title=r),e.parentElement.replaceChild(i,e),i.appendChild(e)}function t(e,t){let n=e.querySelector(`img`);if(!n)return;let r=n.currentSrc||n.src;r&&e.getAttribute(`href`)!==r&&e.setAttribute(`href`,r);let i=String(n.getAttribute(`alt`)||``).trim();i&&!e.dataset.title&&(e.dataset.title=i),e.dataset.gallery||(e.dataset.gallery=t)}function n(e){if(!e||document.querySelector(`link[href="${e}"]`))return;let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)}function r(e){return new Promise(t=>{if(!e||typeof window.GLightbox==`function`)return t();let n=document.createElement(`script`);n.src=e,n.onload=()=>t(),document.head.appendChild(n)})}async function i(i){let a=i.selector,o=i.scope,s=i.gallery,c=i.cssUrl||`https://cos.lhasa.icu/dist/glightbox/glightbox.min.css`,l=i.jsUrl||`https://cos.lhasa.icu/dist/glightbox/glightbox.min.js`,u=new Set,d=new Set;document.querySelectorAll(o).forEach(e=>{e.querySelectorAll(`img`).forEach(e=>u.add(e)),e.querySelectorAll(a).forEach(e=>d.add(e))}),u.forEach(t=>{let n=t.parentElement,r=n&&n.tagName.toLowerCase()===`a`,i=r&&n.classList.contains(`glightbox`);(!r||!i)&&e(t,s)}),d.forEach(e=>t(e,s)),n(c),await r(l),(()=>{let e=window.GLightbox;if(typeof e==`function`){let t=window.__glightboxInstance;t&&t.destroy&&t.destroy();let n=Object.assign({},i.options||{},{selector:a});window.__glightboxInstance=e(n)}})()}exports.initGlightboxModule=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./dom-CJtH5lQe.cjs`);async function t(t,n){await Promise.resolve().then(()=>require(`./image-alts-D2zawu5U.cjs`)),e.r(t,n,t=>{e.t(t)})}exports.enableImageAlts=t;
|
package/dist/photosuite.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let t=e.scope;if(!t){console.warn(`Photosuite: 'scope' option is required.`);return}let n=e.selector??`a.glightbox`,r=e.gallery??`markdown`,i=e.glightbox??!0,a=e.imageAlts??!0,o=e.exif??!0,s=async()=>{if(!document.querySelector(t))return;let s=[];i&&s.push(Promise.resolve().then(()=>require(`./glightbox-
|
|
1
|
+
function e(e){let t=e.scope;if(!t){console.warn(`Photosuite: 'scope' option is required.`);return}let n=e.selector??`a.glightbox`,r=e.gallery??`markdown`,i=e.glightbox??!0,a=e.imageAlts??!0,o=e.exif??!0,s=async()=>{if(!document.querySelector(t))return;let s=[];i&&s.push(Promise.resolve().then(()=>require(`./glightbox-lE-btsco.cjs`)).then(i=>i.initGlightboxModule({selector:n,scope:t,gallery:r,options:e.glightboxOptions,cssUrl:e.glightboxCssUrl,jsUrl:e.glightboxJsUrl}))),a&&s.push(Promise.resolve().then(()=>require(`./imageAlts-Bt8VtEfG.cjs`)).then(e=>e.enableImageAlts(t,n))),o&&s.push(Promise.resolve().then(()=>require(`./exif-CBo-Frgp.cjs`)).then(e=>e.enableExif(t,n))),s.length&&Promise.all(s).catch(()=>{})};document.readyState===`complete`||document.readyState===`interactive`?s():document.addEventListener(`DOMContentLoaded`,s)}exports.photosuite=e;
|
package/dist/photosuite.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--photosuite-caption-size:12px;--photosuite-caption-color:#fff;--photosuite-exif-size:12px;--photosuite-exif-color:#fff;--photosuite-exif-bg:linear-gradient(to bottom,#0009,transparent);--photosuite-caption-bg:linear-gradient(to right,#000c,transparent)}:where(.photosuite-item img){display:block;box-shadow:none!important;border:none!important;border-radius:0!important;outline:none!important;margin:0!important;padding:0!important}.photosuite-item{line-height:0;display:inline-block;position:relative;overflow:hidden}.photosuite-item>a{display:block}.photosuite-caption{box-sizing:border-box;z-index:1;background:var(--photosuite-caption-bg);justify-content:flex-start;align-items:center;height:30px;padding:0 10px;font-style:normal;font-weight:400;line-height:1;display:flex;position:absolute;bottom:0;left:0;right:0;font-size:var(--photosuite-caption-size)!important;color:var(--photosuite-caption-color)!important}.photosuite-exif{box-sizing:border-box;z-index:1;background:var(--photosuite-exif-bg);opacity:0;pointer-events:none;justify-content:center;align-items:center;height:30px;padding:0 10px;font-style:normal;font-weight:400;line-height:1;transition:opacity .2s ease-in-out;display:flex;position:absolute;top:0;left:0;right:0;font-size:var(--photosuite-exif-size)!important;color:var(--photosuite-exif-color)!important}.photosuite-item:hover .photosuite-exif{opacity:1}
|
|
1
|
+
:root{--photosuite-caption-size:12px;--photosuite-caption-color:#fff;--photosuite-exif-size:12px;--photosuite-exif-color:#fff;--photosuite-exif-bg:linear-gradient(to bottom,#0009,transparent);--photosuite-caption-bg:linear-gradient(to right,#000c,transparent)}:where(.photosuite-item img){display:block;box-shadow:none!important;border:none!important;border-radius:0!important;outline:none!important;margin:0!important;padding:0!important}.photosuite-item{line-height:0;display:inline-block;position:relative;overflow:hidden}.photosuite-item>a{display:block}.photosuite-caption{box-sizing:border-box;z-index:1;background:var(--photosuite-caption-bg);justify-content:flex-start;align-items:center;height:30px;padding:0 10px;font-style:normal;font-weight:400;line-height:1;display:flex;position:absolute;bottom:0;left:0;right:0;font-size:var(--photosuite-caption-size)!important;color:var(--photosuite-caption-color)!important}.photosuite-exif{box-sizing:border-box;z-index:1;background:var(--photosuite-exif-bg);opacity:0;pointer-events:none;justify-content:center;align-items:center;height:30px;padding:0 10px;font-style:normal;font-weight:400;line-height:1;transition:opacity .2s ease-in-out;display:flex;position:absolute;top:0;left:0;right:0;font-size:var(--photosuite-exif-size)!important;color:var(--photosuite-exif-color)!important}.photosuite-exif:empty{display:none!important}.photosuite-item:hover .photosuite-exif{opacity:1}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/photosuite.es.js
CHANGED
|
@@ -7,14 +7,14 @@ function photosuite(e) {
|
|
|
7
7
|
let n = e.selector ?? "a.glightbox", r = e.gallery ?? "markdown", i = e.glightbox ?? !0, a = e.imageAlts ?? !0, o = e.exif ?? !0, s = async () => {
|
|
8
8
|
if (!document.querySelector(t)) return;
|
|
9
9
|
let s = [];
|
|
10
|
-
i && s.push(import("./glightbox-
|
|
10
|
+
i && s.push(import("./glightbox-3dU8JRqr.js").then((i) => i.initGlightboxModule({
|
|
11
11
|
selector: n,
|
|
12
12
|
scope: t,
|
|
13
13
|
gallery: r,
|
|
14
14
|
options: e.glightboxOptions,
|
|
15
15
|
cssUrl: e.glightboxCssUrl,
|
|
16
16
|
jsUrl: e.glightboxJsUrl
|
|
17
|
-
}))), a && s.push(import("./imageAlts-
|
|
17
|
+
}))), a && s.push(import("./imageAlts-PnRBw8zl.js").then((e) => e.enableImageAlts(t, n))), o && s.push(import("./exif-Bvph_6jm.js").then((e) => e.enableExif(t, n))), s.length && Promise.all(s).catch(() => {});
|
|
18
18
|
};
|
|
19
19
|
document.readyState === "complete" || document.readyState === "interactive" ? s() : document.addEventListener("DOMContentLoaded", s);
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`exiftool-vendored`),l=require(`node:fs`);l=s(l);let u=require(`node:fs/promises`);u=s(u);let d=require(`node:path`);d=s(d);let f=require(`node:http`);f=s(f);let p=require(`node:https`);p=s(p);let m=require(`node:os`);m=s(m);let h=require(`node:url`);var g=(...e)=>{let t=e.filter(e=>typeof e==`string`&&e!==``);if(t.length===0)return``;if(t.length===1)return t[0];let n=t[0],r=t[1],i=`${n.endsWith(`/`)?n.slice(0,-1):n}/${r.startsWith(`/`)?r.slice(1):r}`;return t.length>2?g(i,...t.slice(2)):i},_=e=>!(!e||/^https?:\/\//i.test(e)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`));function v(e={}){let{imageBase:t,imageDir:n=`imageDir`,fileDir:r=!1}=e;return(e,i)=>{let a=(i?.data?.astro?.frontmatter||i?.data?.frontmatter||{})[n]||``,o=(i?.path||i?.history?.[0]||``).split(/[\\/]/).pop()?.split(`.`).shift()||``,s=r?o:a,c=e=>{if(e){if(e.type===`image`){let n=e.url||``;(t||s)&&_(n)&&(e.url=g(t,s,n))}e.children&&e.children.length&&e.children.forEach(c)}};c(e)}}function y(e){try{let t=new h.URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}async function b(e){let t=m.tmpdir(),n=d.extname(e)||`.bin`,r=d.join(t,`exif-${Date.now()}-${Math.random().toString(36).slice(2)}${n}`),i=l.createWriteStream(r),a=e.startsWith(`https:`)?p:f;return await new Promise((t,n)=>{a.get(e,e=>{if(e.statusCode&&e.statusCode>=300&&e.statusCode<400&&e.headers.location,e.statusCode!==200){n(Error(`HTTP `+e.statusCode));return}e.pipe(i),i.on(`finish`,t),i.on(`error`,n)}).on(`error`,n)}),{path:r,cleanup:async()=>{try{await u.unlink(r)}catch{}}}}async function x(e){let t=await c.exiftool.read(e);return{SourceFile:t.SourceFile,ExifToolVersion:t.ExifToolVersion,MIMEType:t.MIMEType,FileType:t.FileType,Make:t.Make,Model:t.Model,LensModel:t.LensModel,DateTimeOriginal:t.DateTimeOriginal,CreateDate:t.CreateDate,ModifyDate:t.ModifyDate,ImageWidth:t.ImageWidth,ImageHeight:t.ImageHeight,GPSLatitude:t.GPSLatitude,GPSLongitude:t.GPSLongitude,FNumber:t.FNumber,ExposureTime:t.ExposureTime,ISO:t.ISO,FocalLength:t.FocalLength,warnings:t.warnings||[],errors:t.errors||[]}}function S(e,t){if(t==null)return``;switch(e){case`FNumber`:return`ƒ/${Number(t).toFixed(1)}`;case`ExposureTime`:return typeof t==`number`?t>=1?`${t}s`:`1/${Math.round(1/t)}s`:t.toString();case`ISO`:return`ISO ${t}`;case`FocalLength`:let e=t.toString();return e.endsWith(`mm`)?e:`${e}mm`;case`DateTimeOriginal`:return typeof t==`object`&&t.year?`${t.year}/${t.month}/${t.day}`:t.toString();default:return t.toString()}}async function C(e,t,n){let r=e.properties?.src;if(!r)return;let i=``,a;try{if(y(r)){let e=await b(r);i=e.path,a=e.cleanup}else if(d.isAbsolute(r))i=r;else{let e=d.dirname(t.path);i=d.resolve(e,r)}if(i&&(l.existsSync(i)||y(r))&&(l.existsSync(i)||(i=decodeURIComponent(i)),l.existsSync(i))){let t=await x(i);if(!(t.FNumber
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`exiftool-vendored`),l=require(`node:fs`);l=s(l);let u=require(`node:fs/promises`);u=s(u);let d=require(`node:path`);d=s(d);let f=require(`node:http`);f=s(f);let p=require(`node:https`);p=s(p);let m=require(`node:os`);m=s(m);let h=require(`node:url`);var g=(...e)=>{let t=e.filter(e=>typeof e==`string`&&e!==``);if(t.length===0)return``;if(t.length===1)return t[0];let n=t[0],r=t[1],i=`${n.endsWith(`/`)?n.slice(0,-1):n}/${r.startsWith(`/`)?r.slice(1):r}`;return t.length>2?g(i,...t.slice(2)):i},_=e=>!(!e||/^https?:\/\//i.test(e)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`));function v(e={}){let{imageBase:t,imageDir:n=`imageDir`,fileDir:r=!1}=e;return(e,i)=>{let a=(i?.data?.astro?.frontmatter||i?.data?.frontmatter||{})[n]||``,o=(i?.path||i?.history?.[0]||``).split(/[\\/]/).pop()?.split(`.`).shift()||``,s=r?o:a,c=e=>{if(e){if(e.type===`image`){let n=e.url||``;(t||s)&&_(n)&&(e.url=g(t,s,n))}e.children&&e.children.length&&e.children.forEach(c)}};c(e)}}function y(e){try{let t=new h.URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}async function b(e){let t=m.tmpdir(),n=d.extname(e)||`.bin`,r=d.join(t,`exif-${Date.now()}-${Math.random().toString(36).slice(2)}${n}`),i=l.createWriteStream(r),a=e.startsWith(`https:`)?p:f;return await new Promise((t,n)=>{a.get(e,e=>{if(e.statusCode&&e.statusCode>=300&&e.statusCode<400&&e.headers.location,e.statusCode!==200){n(Error(`HTTP `+e.statusCode));return}e.pipe(i),i.on(`finish`,t),i.on(`error`,n)}).on(`error`,n)}),{path:r,cleanup:async()=>{try{await u.unlink(r)}catch{}}}}async function x(e){let t=await c.exiftool.read(e);return{SourceFile:t.SourceFile,ExifToolVersion:t.ExifToolVersion,MIMEType:t.MIMEType,FileType:t.FileType,Make:t.Make,Model:t.Model,LensModel:t.LensModel,DateTimeOriginal:t.DateTimeOriginal,CreateDate:t.CreateDate,ModifyDate:t.ModifyDate,ImageWidth:t.ImageWidth,ImageHeight:t.ImageHeight,GPSLatitude:t.GPSLatitude,GPSLongitude:t.GPSLongitude,FNumber:t.FNumber,ExposureTime:t.ExposureTime,ISO:t.ISO,FocalLength:t.FocalLength,warnings:t.warnings||[],errors:t.errors||[]}}function S(e,t){if(t==null)return``;switch(e){case`FNumber`:return`ƒ/${Number(t).toFixed(1)}`;case`ExposureTime`:return typeof t==`number`?t>=1?`${t}s`:`1/${Math.round(1/t)}s`:t.toString();case`ISO`:return`ISO ${t}`;case`FocalLength`:let e=t.toString();return e.endsWith(`mm`)?e:`${e}mm`;case`DateTimeOriginal`:return typeof t==`object`&&t.year?`${t.year}/${t.month}/${t.day}`:t.toString();default:return t.toString()}}async function C(e,t,n){let r=e.properties?.src;if(!r)return;let i=``,a;try{if(y(r)){let e=await b(r);i=e.path,a=e.cleanup}else if(d.isAbsolute(r))i=r;else{let e=d.dirname(t.path);i=d.resolve(e,r)}if(i&&(l.existsSync(i)||y(r))&&(l.existsSync(i)||(i=decodeURIComponent(i)),l.existsSync(i))){let t=await x(i);if(!(t.FNumber&&t.ExposureTime&&t.ISO))return;let r=typeof n.exif==`object`?n.exif:{},a=r.fields||[`Model`,`LensModel`,`FocalLength`,`FNumber`,`ExposureTime`,`ISO`,`DateTimeOriginal`],o=r.separator||` · `,s=a.map(e=>{let n=t[e];return n?S(e,n):null}).filter(Boolean);if(s.length===0)return;let c=s.join(o),l={...e.properties};e.tagName=`div`,e.properties={className:[`photosuite-item`]},e.children=[{type:`element`,tagName:`img`,properties:l,children:[]},{type:`element`,tagName:`div`,properties:{className:[`photosuite-exif`]},children:[{type:`text`,value:c}]}]}}catch(e){console.warn(`[photosuite] Failed to get EXIF for ${r}:`,e)}finally{a&&await a()}}function w(e={}){return async(t,n)=>{let r=[],i=t=>{t.type===`element`&&t.tagName===`img`&&r.push(C(t,n,e)),t.children&&t.children.forEach(i)};i(t),r.length>0&&await Promise.all(r)}}function T(e){return{name:`photosuite`,hooks:{"astro:config:setup":({injectScript:t,updateConfig:n})=>{t(`page`,`
|
|
2
2
|
import { photosuite } from 'photosuite';
|
|
3
3
|
const __opts = ${JSON.stringify(e)};
|
|
4
4
|
const __run = () => photosuite(__opts);
|
|
@@ -108,7 +108,7 @@ async function processNode(e, c, u) {
|
|
|
108
108
|
}
|
|
109
109
|
if (f && (fs.existsSync(f) || isHttpUrl(d)) && (fs.existsSync(f) || (f = decodeURIComponent(f)), fs.existsSync(f))) {
|
|
110
110
|
let s = await handleExif(f);
|
|
111
|
-
if (!(s.FNumber
|
|
111
|
+
if (!(s.FNumber && s.ExposureTime && s.ISO)) return;
|
|
112
112
|
let c = typeof u.exif == "object" ? u.exif : {}, l = c.fields || [
|
|
113
113
|
"Model",
|
|
114
114
|
"LensModel",
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "photosuite",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "A zero-config Astro integration for better images (Lightbox, EXIF, Path resolution).",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"astro-integration",
|
|
7
|
-
"lightbox",
|
|
8
|
-
"exif",
|
|
9
|
-
"gallery",
|
|
10
|
-
"markdown-images",
|
|
11
|
-
"photography",
|
|
12
|
-
"zero-config"
|
|
13
|
-
],
|
|
14
|
-
"author": "achuanya",
|
|
15
|
-
"license": "GPL-3.0",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/achuanya/photosuite"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "https://photosuite.lhasa.icu",
|
|
21
|
-
"bugs": "https://github.com/achuanya/photosuite/issues",
|
|
22
|
-
"type": "module",
|
|
23
|
-
"main": "./dist/photosuite.integration.js",
|
|
24
|
-
"module": "./dist/photosuite.es.js",
|
|
25
|
-
"types": "./dist/integration.d.ts",
|
|
26
|
-
"exports": {
|
|
27
|
-
".": {
|
|
28
|
-
"node": {
|
|
29
|
-
"types": "./dist/integration.d.ts",
|
|
30
|
-
"import": "./dist/photosuite.integration.js",
|
|
31
|
-
"require": "./dist/photosuite.integration.cjs"
|
|
32
|
-
},
|
|
33
|
-
"types": "./dist/index.d.ts",
|
|
34
|
-
"import": "./dist/photosuite.es.js",
|
|
35
|
-
"require": "./dist/photosuite.cjs.js",
|
|
36
|
-
"default": "./dist/photosuite.es.js"
|
|
37
|
-
},
|
|
38
|
-
"./client": {
|
|
39
|
-
"types": "./dist/index.d.ts",
|
|
40
|
-
"import": "./dist/photosuite.es.js",
|
|
41
|
-
"require": "./dist/photosuite.cjs.js"
|
|
42
|
-
},
|
|
43
|
-
"./dist/photosuite.css": "./dist/photosuite.css"
|
|
44
|
-
},
|
|
45
|
-
"files": [
|
|
46
|
-
"dist",
|
|
47
|
-
"LICENSE",
|
|
48
|
-
"README.md",
|
|
49
|
-
"README.zh-CN.md"
|
|
50
|
-
],
|
|
51
|
-
"scripts": {
|
|
52
|
-
"dev": "vite",
|
|
53
|
-
"build": "tsc && vite build",
|
|
54
|
-
"preview": "vite preview"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"astro": "^4.0.0 || ^5.0.0"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"exiftool-vendored": "^34.1.0"
|
|
61
|
-
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@tailwindcss/postcss": "^4.1.17",
|
|
64
|
-
"@types/node": "^25.0.3",
|
|
65
|
-
"autoprefixer": "^10.4.22",
|
|
66
|
-
"postcss": "^8.5.6",
|
|
67
|
-
"sass": "^1.94.2",
|
|
68
|
-
"tailwindcss": "^4.1.17",
|
|
69
|
-
"typescript": "~5.9.3",
|
|
70
|
-
"vite": "npm:rolldown-vite@7.2.5",
|
|
71
|
-
"vite-plugin-dts": "^4.5.4"
|
|
72
|
-
},
|
|
73
|
-
"overrides": {
|
|
74
|
-
"vite": "npm:rolldown-vite@7.2.5"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "photosuite",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A zero-config Astro integration for better images (Lightbox, EXIF, Path resolution).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"astro-integration",
|
|
7
|
+
"lightbox",
|
|
8
|
+
"exif",
|
|
9
|
+
"gallery",
|
|
10
|
+
"markdown-images",
|
|
11
|
+
"photography",
|
|
12
|
+
"zero-config"
|
|
13
|
+
],
|
|
14
|
+
"author": "achuanya",
|
|
15
|
+
"license": "GPL-3.0",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/achuanya/photosuite"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://photosuite.lhasa.icu",
|
|
21
|
+
"bugs": "https://github.com/achuanya/photosuite/issues",
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/photosuite.integration.js",
|
|
24
|
+
"module": "./dist/photosuite.es.js",
|
|
25
|
+
"types": "./dist/integration.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"node": {
|
|
29
|
+
"types": "./dist/integration.d.ts",
|
|
30
|
+
"import": "./dist/photosuite.integration.js",
|
|
31
|
+
"require": "./dist/photosuite.integration.cjs"
|
|
32
|
+
},
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/photosuite.es.js",
|
|
35
|
+
"require": "./dist/photosuite.cjs.js",
|
|
36
|
+
"default": "./dist/photosuite.es.js"
|
|
37
|
+
},
|
|
38
|
+
"./client": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/photosuite.es.js",
|
|
41
|
+
"require": "./dist/photosuite.cjs.js"
|
|
42
|
+
},
|
|
43
|
+
"./dist/photosuite.css": "./dist/photosuite.css"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"LICENSE",
|
|
48
|
+
"README.md",
|
|
49
|
+
"README.zh-CN.md"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"dev": "vite",
|
|
53
|
+
"build": "tsc && vite build",
|
|
54
|
+
"preview": "vite preview"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"astro": "^4.0.0 || ^5.0.0"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"exiftool-vendored": "^34.1.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
64
|
+
"@types/node": "^25.0.3",
|
|
65
|
+
"autoprefixer": "^10.4.22",
|
|
66
|
+
"postcss": "^8.5.6",
|
|
67
|
+
"sass": "^1.94.2",
|
|
68
|
+
"tailwindcss": "^4.1.17",
|
|
69
|
+
"typescript": "~5.9.3",
|
|
70
|
+
"vite": "npm:rolldown-vite@7.2.5",
|
|
71
|
+
"vite-plugin-dts": "^4.5.4"
|
|
72
|
+
},
|
|
73
|
+
"overrides": {
|
|
74
|
+
"vite": "npm:rolldown-vite@7.2.5"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/dist/exif-DYpA7_Ip.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./dom-DMZsb49p.cjs`);async function t(t,n){await Promise.resolve().then(()=>require(`./exif-DwHkZ3YD.cjs`)),e.r(t,n,t=>{e.n(t)})}exports.enableExif=t;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){let n=e.currentSrc||e.src||``;if(!n)return;let r=String(e.getAttribute(`alt`)||``).trim(),i=document.createElement(`a`);i.href=n,i.className=`glightbox`,i.dataset.gallery=t,r&&(i.dataset.title=r),e.parentElement.replaceChild(i,e),i.appendChild(e)}function t(e,t){let n=e.querySelector(`img`);if(!n)return;let r=n.currentSrc||n.src;r&&e.getAttribute(`href`)!==r&&e.setAttribute(`href`,r);let i=n.getAttribute(`alt`);i&&!e.dataset.title&&(e.dataset.title=i),e.dataset.gallery||(e.dataset.gallery=t)}function n(e){if(!e||document.querySelector(`link[href="${e}"]`))return;let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)}function r(e){return new Promise(t=>{if(!e||typeof window.GLightbox==`function`)return t();let n=document.createElement(`script`);n.src=e,n.onload=()=>t(),document.head.appendChild(n)})}async function i(i){let a=i.selector,o=i.scope,s=i.gallery,c=i.cssUrl||`https://cos.lhasa.icu/dist/glightbox/glightbox.min.css`,l=i.jsUrl||`https://cos.lhasa.icu/dist/glightbox/glightbox.min.js`,u=new Set,d=new Set;document.querySelectorAll(o).forEach(e=>{e.querySelectorAll(`img`).forEach(e=>u.add(e)),e.querySelectorAll(a).forEach(e=>d.add(e))}),u.forEach(t=>{let n=t.parentElement,r=n&&n.tagName.toLowerCase()===`a`,i=r&&n.classList.contains(`glightbox`);(!r||!i)&&e(t,s)}),d.forEach(e=>t(e,s)),n(c),await r(l),(()=>{let e=window.GLightbox;if(typeof e==`function`){let t=window.__glightboxInstance;t&&t.destroy&&t.destroy();let n=Object.assign({},i.options||{},{selector:a});window.__glightboxInstance=e(n)}})()}exports.initGlightboxModule=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./dom-DMZsb49p.cjs`);async function t(t,n){await Promise.resolve().then(()=>require(`./image-alts-D2zawu5U.cjs`)),e.r(t,n,t=>{e.t(t)})}exports.enableImageAlts=t;
|