@saasquatch/mint-components 1.13.3-10 → 1.13.3-11
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/cjs/{sqm-qr-code-view-3f30d2cd.js → sqm-qr-code-view-06666132.js} +1 -1
- package/dist/cjs/sqm-qr-code.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
- package/dist/collection/components/sqm-qr-code/sqm-qr-code-view.js +1 -1
- package/dist/esm/{sqm-qr-code-view-7c441329.js → sqm-qr-code-view-15fe1127.js} +1 -1
- package/dist/esm/sqm-qr-code.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/{sqm-qr-code-view-7c441329.js → sqm-qr-code-view-15fe1127.js} +1 -1
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-06267664.system.js → p-29a1fdeb.system.js} +1 -1
- package/dist/mint-components/{p-b630683c.system.entry.js → p-2d76eb85.system.entry.js} +1 -1
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-e6e2b28b.js → p-68d5ffd6.js} +1 -1
- package/dist/mint-components/{p-dfcc0f0e.entry.js → p-91903cd7.entry.js} +1 -1
- package/dist/mint-components/{p-e706440c.system.entry.js → p-9d6705d5.system.entry.js} +1 -1
- package/dist/mint-components/{p-45e82465.entry.js → p-b4ff7f20.entry.js} +2 -2
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,h as o}from"./p-f708da7b.js";import{k as a,f as t,n as r}from"./p-cd651f81.js";import{d as n,H as i,J as d,F as s,w as c,$ as l,B as m,i as g}from"./p-94a876b9.js";import{c as p}from"./p-c1086930.js";import{g as h}from"./p-9ec99ced.js";import"./p-cef45012.js";import{a as u}from"./p-3f7b81b8.js";import"./p-9acb5038.js";import{Q as w}from"./p-
|
|
1
|
+
import{r as e,h as o}from"./p-f708da7b.js";import{k as a,f as t,n as r}from"./p-cd651f81.js";import{d as n,H as i,J as d,F as s,w as c,$ as l,B as m,i as g}from"./p-94a876b9.js";import{c as p}from"./p-c1086930.js";import{g as h}from"./p-9ec99ced.js";import"./p-cef45012.js";import{a as u}from"./p-3f7b81b8.js";import"./p-9acb5038.js";import{Q as w}from"./p-68d5ffd6.js";const v=n.gql`
|
|
2
2
|
query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
3
3
|
user: viewer {
|
|
4
4
|
... on User {
|
|
@@ -14,4 +14,4 @@ import{r as e,h as o}from"./p-f708da7b.js";import{k as a,f as t,n as r}from"./p-
|
|
|
14
14
|
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
15
15
|
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
16
16
|
}
|
|
17
|
-
`,R=class{constructor(o){e(this,o),this.titleText="Share your QR code",this.viewCodeText="View QR code",this.downloadCodeText="Download",this.printCodeText="Print",this.errorHeaderText="There was an error loading your QR code",this.errorDescriptionText="Please refresh this page and try again",r(this)}disconnectedCallback(){}render(){const e=h(this),r=g()?function(e){const[o,t]=a(!1);return p({dialogIsOpen:o,showDialog:()=>t(!0),hideDialog:()=>t(!1),titleText:e.titleText,viewCodeText:e.viewCodeText,downloadCodeText:e.downloadCodeText,printCodeText:e.printCodeText,qrLink:"https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",fireViewQrEvent:()=>{console.log("View QR Code clicked")},createDownloadable:async()=>{console.log("Download QR Code clicked")},createPrintable:async()=>{console.log("Print QR Code clicked")}},e.demoData||{},{arrayMerge:(e,o)=>o})}(e):function(e){var o;const r=i(),n=d(),g=m(),p=s(u),[h,w]=a(!1),[R,C]=a(null),[
|
|
17
|
+
`,R=class{constructor(o){e(this,o),this.titleText="Share your QR code",this.viewCodeText="View QR code",this.downloadCodeText="Download",this.printCodeText="Print",this.errorHeaderText="There was an error loading your QR code",this.errorDescriptionText="Please refresh this page and try again",r(this)}disconnectedCallback(){}render(){const e=h(this),r=g()?function(e){const[o,t]=a(!1);return p({dialogIsOpen:o,showDialog:()=>t(!0),hideDialog:()=>t(!1),titleText:e.titleText,viewCodeText:e.viewCodeText,downloadCodeText:e.downloadCodeText,printCodeText:e.printCodeText,qrLink:"https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",fireViewQrEvent:()=>{console.log("View QR Code clicked")},createDownloadable:async()=>{console.log("Download QR Code clicked")},createPrintable:async()=>{console.log("Print QR Code clicked")}},e.demoData||{},{arrayMerge:(e,o)=>o})}(e):function(e){var o;const r=i(),n=d(),g=m(),p=s(u),[h,w]=a(!1),[R,C]=a(null),[y,E]=a(!1),[b,q]=a(!1),{data:M,errors:I}=c(v,{programId:r,engagementMedium:g},!(null==n?void 0:n.jwt)||void 0!==(null==p?void 0:p.shareLink)),[k]=l(f),D=null===(o=null==M?void 0:M.user)||void 0===o?void 0:o.shareLink,j=`${D}?qrCode`;t((()=>{D&&(async()=>{try{const e=await fetch(`${D}?qrCode&qrCodeImageFormat=svg`),o=await e.blob(),a=URL.createObjectURL(o);C(a)}catch(e){q(!0)}})()}),[D]);const $=async()=>{k({eventMeta:{programId:r,id:null==n?void 0:n.id,accountId:null==n?void 0:n.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:g,shareMedium:"DIRECT"}}})};return{...e,qrLink:R,dialogIsOpen:h,error:y,viewError:b||!!(null==I?void 0:I.message),showDialog:()=>{E(!1),w(!0)},hideDialog:()=>{E(!1),w(!1)},createDownloadable:async()=>{try{const e=await fetch(`${j}&qrCodeSize=800&qrCodeImageFormat=png`),o=await e.blob(),a=URL.createObjectURL(o);o&&$();const t=document.createElement("a");t.href=a,t.download="qrCode.png",document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(e){console.error("Failed to fetch QR code:",e),E(!0)}},createPrintable:async()=>{try{const e=await fetch(`${j}&qrCodeSize=1000&qrCodeImageFormat=png&qrCodeErrorCorrectionLevel=H`),o=await e.blob(),a=URL.createObjectURL(o);o&&$();const t=window.open("about:blank","_new"),r=t.document.createElement("img");r.src=a,r.onload=()=>{t.print(),t.close()},t.document.body.appendChild(r)}catch(e){console.error("Failed to fetch QR code: ",e),E(!0)}}}}(e);return o(w,Object.assign({},r))}};export{R as sqm_qr_code}
|
package/docs/docs.docx
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasquatch/mint-components",
|
|
3
3
|
"title": "Mint Components",
|
|
4
|
-
"version": "1.13.3-
|
|
4
|
+
"version": "1.13.3-11",
|
|
5
5
|
"description": "A minimal design library with components for referral and loyalty experiences. Built with Shoelace components by Saasquatch.",
|
|
6
6
|
"icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Mint.svg",
|
|
7
7
|
"raisins": "docs/raisins.json",
|