quirk-ui 0.1.42 → 0.1.43

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function d(t,e,o="medium"){var n;if(!(t!=null&&t.imageUrls))return;const{imageUrls:r}=t;return e==="dark"?((n=r.dark)==null?void 0:n[o])??r.default[o]:r.default[o]}function c(t,e){var o;if(t!=null&&t.imageUrls)return e==="dark"?((o=t.imageUrls.dark)==null?void 0:o.small)??t.imageUrls.default.small:t.imageUrls.default.small}function a(t,e,o="Image"){var n,u,l,i;if(!t)return o;const r=e==="dark"?"darkImage":"defaultImage";return((u=(n=t[r])==null?void 0:n.asset)==null?void 0:u.altText)??((i=(l=t[r])==null?void 0:l.asset)==null?void 0:i.description)??o}function f(t,e){if(!t)return{};if(t.layout==="cover")return{objectFit:"cover",...t.position&&{objectPosition:e?"top":t.position}};if(t.layout==="contain"){const o=t.sizing==="half"?e?"100%":"50%":t.sizing==="inset"?e?"100%":"75%":"100%",r=t.aspectRatio?t.aspectRatio.replace(":","/"):void 0;return{objectFit:"contain",width:o,...t.sizing==="inset"&&{maxWidth:t.maxWidth??"unset"},...r&&{aspectRatio:r}}}return{objectFit:"none"}}function s(t){const e=t.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);return(e==null?void 0:e[1])??""}function v(t){return t?t.includes("vimeo.com")?"vimeo":t.includes("youtube.com")||t.includes("youtu.be")?"youtube":"native":null}function b(t,e){if(e==="vimeo")return`${t}?autoplay=1&muted=1&loop=1&background=1`;const o=s(t);return`${t}?autoplay=1&mute=1&loop=1&playlist=${o}`}exports.buildEmbedSrc=b;exports.detectVideoProvider=v;exports.getYouTubeVideoId=s;exports.resolveAltText=a;exports.resolveImageStyle=f;exports.resolveImageUrl=d;exports.resolveSmallImageUrl=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function d(t,e,o="medium"){var n;if(!(t!=null&&t.imageUrls))return;const{imageUrls:r}=t;return e==="dark"?((n=r.dark)==null?void 0:n[o])??r.default[o]:r.default[o]}function c(t,e){var o;if(t!=null&&t.imageUrls)return e==="dark"?((o=t.imageUrls.dark)==null?void 0:o.small)??t.imageUrls.default.small:t.imageUrls.default.small}function a(t,e,o="Image"){var n,u,l,i;if(!t)return o;const r=e==="dark"?"darkImage":"defaultImage";return((u=(n=t[r])==null?void 0:n.asset)==null?void 0:u.altText)??((i=(l=t[r])==null?void 0:l.asset)==null?void 0:i.description)??o}function f(t,e){if(!t)return{};if(t.layout==="cover")return{objectFit:"cover",...t.position&&{objectPosition:e?"top":t.position}};if(t.layout==="contain"){const o=t.sizing==="half"?e?"100%":"50%":t.sizing==="inset"?e?"100%":"75%":"100%",r=t.aspectRatio?t.aspectRatio.replace(":","/"):void 0;return{width:o,...t.sizing==="inset"&&{maxWidth:t.maxWidth??"unset"},...r&&{aspectRatio:r},objectFit:r?"cover":"contain"}}return{objectFit:"none"}}function s(t){const e=t.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);return(e==null?void 0:e[1])??""}function v(t){return t?t.includes("vimeo.com")?"vimeo":t.includes("youtube.com")||t.includes("youtu.be")?"youtube":"native":null}function b(t,e){if(e==="vimeo")return`${t}?autoplay=1&muted=1&loop=1&background=1`;const o=s(t);return`${t}?autoplay=1&mute=1&loop=1&playlist=${o}`}exports.buildEmbedSrc=b;exports.detectVideoProvider=v;exports.getYouTubeVideoId=s;exports.resolveAltText=a;exports.resolveImageStyle=f;exports.resolveImageUrl=d;exports.resolveSmallImageUrl=c;
@@ -27,10 +27,12 @@ function f(t, o) {
27
27
  if (t.layout === "contain") {
28
28
  const e = t.sizing === "half" ? o ? "100%" : "50%" : t.sizing === "inset" ? o ? "100%" : "75%" : "100%", n = t.aspectRatio ? t.aspectRatio.replace(":", "/") : void 0;
29
29
  return {
30
- objectFit: "contain",
31
30
  width: e,
32
31
  ...t.sizing === "inset" && { maxWidth: t.maxWidth ?? "unset" },
33
- ...n && { aspectRatio: n }
32
+ ...n && {
33
+ aspectRatio: n
34
+ },
35
+ objectFit: n ? "cover" : "contain"
34
36
  };
35
37
  }
36
38
  return { objectFit: "none" };
@@ -39,18 +41,18 @@ function s(t) {
39
41
  const o = t.match(/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/);
40
42
  return (o == null ? void 0 : o[1]) ?? "";
41
43
  }
42
- function p(t) {
44
+ function v(t) {
43
45
  return t ? t.includes("vimeo.com") ? "vimeo" : t.includes("youtube.com") || t.includes("youtu.be") ? "youtube" : "native" : null;
44
46
  }
45
- function v(t, o) {
47
+ function p(t, o) {
46
48
  if (o === "vimeo")
47
49
  return `${t}?autoplay=1&muted=1&loop=1&background=1`;
48
50
  const e = s(t);
49
51
  return `${t}?autoplay=1&mute=1&loop=1&playlist=${e}`;
50
52
  }
51
53
  export {
52
- v as buildEmbedSrc,
53
- p as detectVideoProvider,
54
+ p as buildEmbedSrc,
55
+ v as detectVideoProvider,
54
56
  s as getYouTubeVideoId,
55
57
  a as resolveAltText,
56
58
  f as resolveImageStyle,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.1.42",
4
+ "version": "0.1.43",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {