@atoms-studio/components
Advanced tools
Comparing version
import type { PropType, Ref } from 'vue'; | ||
import type { FocalPointObject } from '@atoms-studio/composables/dist/usePicture'; | ||
interface ImageUrlObject { | ||
@@ -85,2 +86,14 @@ url: string; | ||
}; | ||
datoFocalPoint: { | ||
type: PropType<FocalPointObject>; | ||
required: false; | ||
default: () => { | ||
x: number; | ||
y: number; | ||
}; | ||
}; | ||
datoAutoFormat: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
}, { | ||
@@ -167,2 +180,14 @@ imgLoaded: Ref<boolean>; | ||
}; | ||
datoFocalPoint: { | ||
type: PropType<FocalPointObject>; | ||
required: false; | ||
default: () => { | ||
x: number; | ||
y: number; | ||
}; | ||
}; | ||
datoAutoFormat: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
}>>, { | ||
@@ -182,3 +207,5 @@ image: ImageUrlObject | ImageFileObject; | ||
legacyFormat: string; | ||
datoFocalPoint: FocalPointObject; | ||
datoAutoFormat: boolean; | ||
}>; | ||
export default _default; |
@@ -1,17 +0,1 @@ | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
import { defineComponent, toRefs, inject, h, resolveComponent, ref, resolveDirective, openBlock, createElementBlock, createElementVNode, normalizeClass, createCommentVNode, withDirectives, normalizeStyle } from "vue"; | ||
@@ -57,7 +41,8 @@ import { useURL, usePicture, useFocalPoint } from "@atoms-studio/composables"; | ||
rel: "noopener noreferrer" | ||
}, slots.default && slots.default()) : h(resolveComponent(props.linkComponent), __spreadValues({ | ||
}, slots.default && slots.default()) : h(resolveComponent(props.linkComponent), { | ||
class: "app-link", | ||
to: props.to, | ||
custom: props.custom | ||
}, props.disabled ? { onClickCapture: (e) => e.preventDefault() } : {}), () => slots.default && slots.default()); | ||
custom: props.custom, | ||
...props.disabled ? { onClickCapture: (e) => e.preventDefault() } : {} | ||
}, () => slots.default && slots.default()); | ||
}; | ||
@@ -143,2 +128,11 @@ } | ||
default: "" | ||
}, | ||
datoFocalPoint: { | ||
type: Object, | ||
required: false, | ||
default: () => ({ x: 0.5, y: 0.5 }) | ||
}, | ||
datoAutoFormat: { | ||
type: Boolean, | ||
default: false | ||
} | ||
@@ -168,4 +162,4 @@ }, | ||
nSources | ||
} = usePicture(props.image, props.format, props.legacyFormat, props.mode, props.quality, props.sizes, props.screens); | ||
if (props.activateFocalPoint && safeDimensions.value && props.focalPoint) { | ||
} = usePicture(props.image, props.format, props.legacyFormat, props.mode, props.quality, props.sizes, props.screens, props.datoFocalPoint, props.datoAutoFormat); | ||
if (props.activateFocalPoint && safeDimensions.value && props.focalPoint && !props.datoFocalPoint) { | ||
const { focalPoint } = useFocalPoint(props.focalPoint.x, props.focalPoint.y, safeDimensions.value.width, safeDimensions.value.height); | ||
@@ -172,0 +166,0 @@ setFocalPoint.value = focalPoint.value; |
@@ -1,1 +0,1 @@ | ||
(function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@atoms-studio/composables")):typeof define=="function"&&define.amd?define(["exports","vue","@atoms-studio/composables"],t):(n=typeof globalThis!="undefined"?globalThis:n||self,t(n.components={},n.Vue,n.composables))})(this,function(n,t,a){"use strict";var D=Object.defineProperty;var g=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var h=(n,t,a)=>t in n?D(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,y=(n,t)=>{for(var a in t||(t={}))N.call(t,a)&&h(n,a,t[a]);if(g)for(var a of g(t))j.call(t,a)&&h(n,a,t[a]);return n};const u="componentsConfig",S={baseUrl:""};var f=t.defineComponent({name:"AppLink",props:{to:{type:[String,Object],required:!0},disabled:{type:Boolean,default:!1},forceSelf:{type:Boolean,default:!1},linkComponent:{type:String,default:"RouterLink"},custom:{type:Boolean,default:!1}},setup(e,{slots:o}){const l=t.toRefs(e),i=t.inject(u,S),{isExternal:s}=a.useURL(l.to,i.baseUrl);return()=>s.value&&!e.custom?t.h("a",{class:"app-link",href:e.disabled?void 0:e.to,target:e.forceSelf?"_self":"_blank",rel:"noopener noreferrer"},o.default&&o.default()):t.h(t.resolveComponent(e.linkComponent),y({class:"app-link",to:e.to,custom:e.custom},e.disabled?{onClickCapture:d=>d.preventDefault()}:{}),()=>o.default&&o.default())}}),O="",k=(e,o)=>{const l=e.__vccOpts||e;for(const[i,s]of o)l[i]=s;return l};const C=t.defineComponent({props:{image:{type:Object,default:()=>({})},mode:{type:String,required:!1,default:"fill"},loadingColor:{type:String,required:!1,default:"transparent"},altText:{type:String,required:!1,default:""},base64:{type:String,required:!1,default:""},activateFocalPoint:{type:Boolean,default:!0},focalPoint:{type:Object,required:!1,default:()=>({})},quality:{type:Number,required:!1,default:78},preload:{type:Boolean,default:!1},screens:{type:Object,default:()=>({xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536,"2xl":1536})},sizes:{type:String,default:"xs:320px sm:640px md:768px lg:1024px xl:1280px xxl:1536px 2xl:1536px"},format:{type:String,default:"webp"},legacyFormat:{type:String,default:""}},directives:{completed:{mounted(e){e&&e.complete&&e.dispatchEvent(new CustomEvent("completed"))}}},setup(e){const o=t.ref(!1);let l=t.ref("");const{imageUrl:i,imageWidth:s,imageHeight:d,originalFormat:p,isTransparent:r,nFormat:q,nLegacyFormat:F,safeDimensions:c,nSources:_}=a.usePicture(e.image,e.format,e.legacyFormat,e.mode,e.quality,e.sizes,e.screens);if(e.activateFocalPoint&&c.value&&e.focalPoint){const{focalPoint:A}=a.useFocalPoint(e.focalPoint.x,e.focalPoint.y,c.value.width,c.value.height);l.value=A.value}return{imgLoaded:o,imageUrl:i,imageWidth:s,imageHeight:d,safeDimensions:c,setFocalPoint:l,originalFormat:p,isTransparent:r,nFormat:q,nLegacyFormat:F,nSources:_,handleLoaded:()=>{o.value=!0},handleCompleted:()=>{o.value=!0}}}}),b={class:"app-picture"},P={class:"app-picture-wrapper"},w=["type","srcset","sizes"],L=["src","srcset","sizes","alt","width","height"],v=["width","height"],z=["src"];function B(e,o,l,i,s,d){const p=t.resolveDirective("completed");return t.openBlock(),t.createElementBlock("div",b,[t.createElementVNode("div",P,[(t.openBlock(),t.createElementBlock("picture",{class:t.normalizeClass([{loaded:e.imgLoaded},"app-picture-wrapper-element"]),key:e.nSources[0].src},[e.nSources[1]?(t.openBlock(),t.createElementBlock("source",{key:0,type:e.nSources[1].type,srcset:e.nSources[1].srcset,sizes:e.nSources[1].sizes},null,8,w)):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("img",{src:e.nSources[0].src,srcset:e.nSources[0].srcset,sizes:e.nSources[0].sizes,alt:e.altText,width:e.safeDimensions.width,height:e.safeDimensions.height,class:"app-picture-wrapper-element-img",style:t.normalizeStyle(e.setFocalPoint),loading:"lazy",onLoad:o[0]||(o[0]=(...r)=>e.handleLoaded&&e.handleLoaded(...r)),onCompleted:o[1]||(o[1]=(...r)=>e.handleCompleted&&e.handleCompleted(...r))},null,44,L),[[p]])],2)),t.createElementVNode("div",{class:t.normalizeClass([{loaded:e.imgLoaded},"app-picture-wrapper-placeholder"])},[(t.openBlock(),t.createElementBlock("svg",{class:"app-picture-wrapper-placeholder-svg",width:e.safeDimensions.width,height:e.safeDimensions.height,style:t.normalizeStyle({background:e.loadingColor})},null,12,v)),t.createElementVNode("img",{src:e.base64,class:"app-picture-wrapper-placeholder-base64"},null,8,z)],2)])])}var m=k(C,[["render",B]]),E={install:(e,o)=>{e.provide(u,o),e.component("AppLink",f),e.component("AppPicture",m)}};n.AppLink=f,n.AppPicture=m,n.default=E,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(o,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@atoms-studio/composables")):typeof define=="function"&&define.amd?define(["exports","vue","@atoms-studio/composables"],t):(o=typeof globalThis!="undefined"?globalThis:o||self,t(o.components={},o.Vue,o.composables))})(this,function(o,t,c){"use strict";const p="componentsConfig",g={baseUrl:""};var f=t.defineComponent({name:"AppLink",props:{to:{type:[String,Object],required:!0},disabled:{type:Boolean,default:!1},forceSelf:{type:Boolean,default:!1},linkComponent:{type:String,default:"RouterLink"},custom:{type:Boolean,default:!1}},setup(e,{slots:a}){const n=t.toRefs(e),l=t.inject(p,g),{isExternal:i}=c.useURL(n.to,l.baseUrl);return()=>i.value&&!e.custom?t.h("a",{class:"app-link",href:e.disabled?void 0:e.to,target:e.forceSelf?"_self":"_blank",rel:"noopener noreferrer"},a.default&&a.default()):t.h(t.resolveComponent(e.linkComponent),{class:"app-link",to:e.to,custom:e.custom,...e.disabled?{onClickCapture:r=>r.preventDefault()}:{}},()=>a.default&&a.default())}}),q="",h=(e,a)=>{const n=e.__vccOpts||e;for(const[l,i]of a)n[l]=i;return n};const y=t.defineComponent({props:{image:{type:Object,default:()=>({})},mode:{type:String,required:!1,default:"fill"},loadingColor:{type:String,required:!1,default:"transparent"},altText:{type:String,required:!1,default:""},base64:{type:String,required:!1,default:""},activateFocalPoint:{type:Boolean,default:!0},focalPoint:{type:Object,required:!1,default:()=>({})},quality:{type:Number,required:!1,default:78},preload:{type:Boolean,default:!1},screens:{type:Object,default:()=>({xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536,"2xl":1536})},sizes:{type:String,default:"xs:320px sm:640px md:768px lg:1024px xl:1280px xxl:1536px 2xl:1536px"},format:{type:String,default:"webp"},legacyFormat:{type:String,default:""},datoFocalPoint:{type:Object,required:!1,default:()=>({x:.5,y:.5})},datoAutoFormat:{type:Boolean,default:!1}},directives:{completed:{mounted(e){e&&e.complete&&e.dispatchEvent(new CustomEvent("completed"))}}},setup(e){const a=t.ref(!1);let n=t.ref("");const{imageUrl:l,imageWidth:i,imageHeight:r,originalFormat:u,isTransparent:s,nFormat:B,nLegacyFormat:v,safeDimensions:d,nSources:z}=c.usePicture(e.image,e.format,e.legacyFormat,e.mode,e.quality,e.sizes,e.screens,e.datoFocalPoint,e.datoAutoFormat);if(e.activateFocalPoint&&d.value&&e.focalPoint&&!e.datoFocalPoint){const{focalPoint:E}=c.useFocalPoint(e.focalPoint.x,e.focalPoint.y,d.value.width,d.value.height);n.value=E.value}return{imgLoaded:a,imageUrl:l,imageWidth:i,imageHeight:r,safeDimensions:d,setFocalPoint:n,originalFormat:u,isTransparent:s,nFormat:B,nLegacyFormat:v,nSources:z,handleLoaded:()=>{a.value=!0},handleCompleted:()=>{a.value=!0}}}}),S={class:"app-picture"},k={class:"app-picture-wrapper"},C=["type","srcset","sizes"],P=["src","srcset","sizes","alt","width","height"],b=["width","height"],w=["src"];function F(e,a,n,l,i,r){const u=t.resolveDirective("completed");return t.openBlock(),t.createElementBlock("div",S,[t.createElementVNode("div",k,[(t.openBlock(),t.createElementBlock("picture",{class:t.normalizeClass([{loaded:e.imgLoaded},"app-picture-wrapper-element"]),key:e.nSources[0].src},[e.nSources[1]?(t.openBlock(),t.createElementBlock("source",{key:0,type:e.nSources[1].type,srcset:e.nSources[1].srcset,sizes:e.nSources[1].sizes},null,8,C)):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("img",{src:e.nSources[0].src,srcset:e.nSources[0].srcset,sizes:e.nSources[0].sizes,alt:e.altText,width:e.safeDimensions.width,height:e.safeDimensions.height,class:"app-picture-wrapper-element-img",style:t.normalizeStyle(e.setFocalPoint),loading:"lazy",onLoad:a[0]||(a[0]=(...s)=>e.handleLoaded&&e.handleLoaded(...s)),onCompleted:a[1]||(a[1]=(...s)=>e.handleCompleted&&e.handleCompleted(...s))},null,44,P),[[u]])],2)),t.createElementVNode("div",{class:t.normalizeClass([{loaded:e.imgLoaded},"app-picture-wrapper-placeholder"])},[(t.openBlock(),t.createElementBlock("svg",{class:"app-picture-wrapper-placeholder-svg",width:e.safeDimensions.width,height:e.safeDimensions.height,style:t.normalizeStyle({background:e.loadingColor})},null,12,b)),t.createElementVNode("img",{src:e.base64,class:"app-picture-wrapper-placeholder-base64"},null,8,w)],2)])])}var m=h(y,[["render",F]]),L={install:(e,a)=>{e.provide(p,a),e.component("AppLink",f),e.component("AppPicture",m)}};o.AppLink=f,o.AppPicture=m,o.default=L,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.0.0-0f07a89", | ||
"version": "0.0.0-10dc0a8", | ||
"license": "MIT", | ||
@@ -50,5 +50,5 @@ "files": [ | ||
"dependencies": { | ||
"@atoms-studio/composables": "0.0.0-0f07a89", | ||
"@atoms-studio/nuxt-components": "0.0.0-0f07a89" | ||
"@atoms-studio/composables": "0.0.0-10dc0a8", | ||
"@atoms-studio/nuxt-components": "0.0.0-10dc0a8" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22628
0.28%548
3.79%0
-100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed