@nuxt/scripts 0.6.3 → 0.6.5
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/README.md +73 -73
- package/dist/client/200.html +9 -9
- package/dist/client/404.html +9 -9
- package/dist/client/_nuxt/BA8oXX6l.js +31 -0
- package/dist/client/_nuxt/{zTM8DS5E.js → D3k5CjNA.js} +1 -1
- package/dist/client/_nuxt/{Cg8NGlPg.js → D6UD5WyS.js} +1 -1
- package/dist/client/_nuxt/{DZ6siU6J.js → D9Ze639F.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/a5c6ec68-62ae-43af-96d0-bdd9f64f38b1.json +1 -0
- package/dist/client/_nuxt/entry.Cts5wDvr.css +1 -0
- package/dist/client/_nuxt/error-404.-RjlvToe.css +1 -0
- package/dist/client/_nuxt/error-500.Bz7LXgZy.css +1 -0
- package/dist/client/index.html +9 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +84 -279
- package/dist/registry.mjs +33 -0
- package/dist/runtime/components/ScriptCarbonAds.vue +71 -71
- package/dist/runtime/components/ScriptCrisp.vue +84 -84
- package/dist/runtime/components/ScriptGoogleAdsense.vue +69 -69
- package/dist/runtime/components/ScriptGoogleMaps.vue +265 -265
- package/dist/runtime/components/ScriptIntercom.vue +93 -93
- package/dist/runtime/components/ScriptLemonSqueezy.vue +45 -45
- package/dist/runtime/components/ScriptLoadingIndicator.vue +22 -22
- package/dist/runtime/components/ScriptStripePricingTable.vue +68 -68
- package/dist/runtime/components/ScriptVimeoPlayer.vue +256 -256
- package/dist/runtime/components/ScriptYouTubePlayer.vue +171 -170
- package/dist/runtime/composables/useScript.js +3 -3
- package/dist/runtime/composables/useScriptEventPage.d.ts +1 -1
- package/dist/runtime/registry/crisp.d.ts +1 -1
- package/dist/runtime/registry/fathom-analytics.d.ts +1 -1
- package/dist/runtime/registry/google-adsense.d.ts +1 -1
- package/dist/runtime/registry/google-analytics.d.ts +19 -0
- package/dist/runtime/registry/google-analytics.js +40 -0
- package/dist/runtime/registry/google-tag-manager.d.ts +23 -0
- package/dist/runtime/registry/google-tag-manager.js +33 -0
- package/dist/runtime/registry/hotjar.d.ts +1 -1
- package/dist/runtime/registry/intercom.d.ts +1 -1
- package/dist/runtime/registry/matomo-analytics.d.ts +1 -1
- package/dist/runtime/registry/meta-pixel.d.ts +1 -1
- package/dist/runtime/registry/npm.d.ts +1 -1
- package/dist/runtime/registry/x-pixel.d.ts +1 -1
- package/dist/runtime/types.d.ts +41 -9
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.js +20 -4
- package/package.json +12 -11
- package/dist/client/_nuxt/BeuDC-PU.js +0 -31
- package/dist/client/_nuxt/builds/meta/9996546f-d612-4447-9ee7-fc387b136ee4.json +0 -1
- package/dist/client/_nuxt/entry.DvGwvmL9.css +0 -1
- package/dist/client/_nuxt/error-404.DXyehy0d.css +0 -1
- package/dist/client/_nuxt/error-500.a_92Fvyl.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,o as s,c as i,a as e,t as o,b as u,w as c,d,e as l,p,f as h}from"./
|
|
1
|
+
import{_ as a,o as s,c as i,a as e,t as o,b as u,w as c,d,e as l,p,f as h}from"./BA8oXX6l.js";import{u as b}from"./D9Ze639F.js";const f=t=>(p("data-v-b7913e95"),t=t(),h(),t),g={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},x=f(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),m={class:"max-w-520px text-center z-20"},y=["textContent"],_=["textContent"],k={class:"w-full flex items-center justify-center"},w={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const n=t;return b({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(z,S)=>{const r=l;return s(),i("div",g,[x,e("div",m,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:o(t.statusCode)},null,8,y),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:o(t.description)},null,8,_),e("div",k,[u(r,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[d(o(t.backHome),1)]),_:1})])])])}}},N=a(w,[["__scopeId","data-v-b7913e95"]]);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./
|
|
1
|
+
import{u as o}from"./D9Ze639F.js";import{_ as a,o as s,c as i,a as e,t as r,p as u,f as c}from"./BA8oXX6l.js";const l=t=>(u("data-v-4ec72d76"),t=t(),c(),t),d={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},p=l(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},g=["textContent"],b=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const n=t;return o({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(m,x)=>(s(),i("div",d,[p,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:r(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:r(t.description)},null,8,b)])]))}},w=a(f,[["__scopeId","data-v-4ec72d76"]]);export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as o,r as u,g as f,h as d,j as v,k as l,l as i,m as h,n as m}from"./
|
|
1
|
+
import{i as o,r as u,g as f,h as d,j as v,k as l,l as i,m as h,n as m}from"./BA8oXX6l.js";function U(t,a={}){const e=a.head||o();if(e)return e.ssr?e.push(t,a):p(e,t,a)}function p(t,a,e={}){const s=u(!1),n=u({});f(()=>{n.value=s.value?{}:h(a)});const r=t.push(n.value,e);return d(n,c=>{r.patch(c)}),m()&&(v(()=>{r.dispose()}),l(()=>{s.value=!0}),i(()=>{s.value=!1})),r}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"a5c6ec68-62ae-43af-96d0-bdd9f64f38b1","timestamp":1722344420780}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"a5c6ec68-62ae-43af-96d0-bdd9f64f38b1","timestamp":1722344420780,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--nui-c-context:125,125,125}html{background-color:#fff}html.dark{background-color:#151515;color:#fff;color-scheme:dark}::-moz-selection{background:#8884}::selection{background:#8884}.shiki .line{display:inline-block;position:relative;width:100%}.shiki.diff .line>span{filter:saturate(.75);opacity:.75}.shiki.diff .line-added,.shiki.diff .line-removed{scroll-margin:5em}.shiki.diff .line-added>span,.shiki.diff .line-removed>span{opacity:1!important;position:inherit;scroll-margin:20px;z-index:100}.shiki.diff .line-added>span{color:#218c3b!important}.shiki.diff .line-removed>span{color:#d15547!important}.shiki .line-added:after{background-color:#43885420}.shiki .line-added:after,.shiki .line-removed:after{bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.shiki .line-removed:after{background-color:#8f4c3926}::view-transition-new(root),::view-transition-old(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:2147483646}.dark::view-transition-old(root){z-index:2147483646}.dark::view-transition-new(root){z-index:1}*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-display:swap;font-family:DM Mono;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthSQBLyM.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:DM Mono;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthqQBA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:DM Sans;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232VGM.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:DM Sans;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.carbon-chevron-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z'/%3E%3C/svg%3E")}.carbon-chevron-down,.carbon\:book{background-color:currentColor;color:inherit;display:inline-block;height:1.2em;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;vertical-align:middle;width:1.2em}.carbon\:book{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 10h7v2h-7zm0 5h7v2h-7zm0 5h7v2h-7zM6 10h7v2H6zm0 5h7v2H6zm0 5h7v2H6z'/%3E%3Cpath fill='currentColor' d='M28 5H4a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M4 7h11v18H4Zm13 18V7h11v18Z'/%3E%3C/svg%3E")}.carbon\:debug{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m29.83 20l.34-2l-5.17-.85v-4.38l5.06-1.36l-.51-1.93l-4.83 1.29A9 9 0 0 0 20 5V2h-2v2.23a8.8 8.8 0 0 0-4 0V2h-2v3a9 9 0 0 0-4.71 5.82L2.46 9.48L2 11.41l5 1.36v4.38L1.84 18l.32 2L7 19.18a8.9 8.9 0 0 0 .82 3.57l-4.53 4.54l1.42 1.42l4.19-4.2a9 9 0 0 0 14.2 0l4.19 4.2l1.42-1.42l-4.54-4.54a8.9 8.9 0 0 0 .83-3.57ZM15 25.92A7 7 0 0 1 9 19v-6h6ZM9.29 11a7 7 0 0 1 13.42 0ZM23 19a7 7 0 0 1-6 6.92V13h6Z'/%3E%3C/svg%3E")}.carbon\:debug,.carbon\:script{background-color:currentColor;color:inherit;display:inline-block;height:1.2em;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;vertical-align:middle;width:1.2em}.carbon\:script{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m18.83 26l2.58-2.58L20 22l-4 4l4 4l1.42-1.41zm8.34 0l-2.58 2.58L26 30l4-4l-4-4l-1.42 1.41z'/%3E%3Cpath fill='currentColor' d='M14 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v6h2v-8a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h6Zm4-23.6l5.6 5.6H18Z'/%3E%3C/svg%3E")}.i-carbon\:arrow-up-right,[i-carbon\:arrow-up-right=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6z'/%3E%3C/svg%3E");background-color:currentColor;color:inherit;display:inline-block;height:1.2em;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;vertical-align:middle;width:1.2em}.logos\:github-icon{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 256 250' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='%23161614' d='M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0m-80.06 182.34c-.282.636-1.283.827-2.194.39c-.929-.417-1.45-1.284-1.15-1.922c.276-.655 1.279-.838 2.205-.399c.93.418 1.46 1.293 1.139 1.931m6.296 5.618c-.61.566-1.804.303-2.614-.591c-.837-.892-.994-2.086-.375-2.66c.63-.566 1.787-.301 2.626.591c.838.903 1 2.088.363 2.66m4.32 7.188c-.785.545-2.067.034-2.86-1.104c-.784-1.138-.784-2.503.017-3.05c.795-.547 2.058-.055 2.861 1.075c.782 1.157.782 2.522-.019 3.08m7.304 8.325c-.701.774-2.196.566-3.29-.49c-1.119-1.032-1.43-2.496-.726-3.27c.71-.776 2.213-.558 3.315.49c1.11 1.03 1.45 2.505.701 3.27m9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033c-1.448-.439-2.395-1.613-2.103-2.626c.301-1.01 1.747-1.484 3.207-1.028c1.446.436 2.396 1.602 2.095 2.622m10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95c-1.53.034-2.769-.82-2.786-1.86c0-1.065 1.202-1.932 2.733-1.958c1.522-.03 2.768.818 2.768 1.868m10.555-.405c.182 1.03-.875 2.088-2.387 2.37c-1.485.271-2.861-.365-3.05-1.386c-.184-1.056.893-2.114 2.376-2.387c1.514-.263 2.868.356 3.061 1.403'/%3E%3C/svg%3E") no-repeat;background-color:transparent;background-size:100% 100%;display:inline-block;height:1.2em;vertical-align:middle;width:1.2em}.n-badge{background-color:rgba(var(--nui-c-context),.1);border-radius:.25rem;font-size:.75rem;line-height:1rem;margin-left:.125rem;margin-right:.125rem;padding:.125rem .375rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;--un-text-opacity:1;color:rgba(var(--nui-c-context),var(--un-text-opacity))}.n-button-icon{font-size:1.1em;margin-left:-.2em;margin-right:.2em}.n-icon-button{align-items:center;aspect-ratio:1/1;border-radius:.25rem;display:flex;height:1.6em;justify-content:center;opacity:.5;width:1.6em}.n-button-base{align-items:center;border-color:#9ca3af33;border-radius:.25rem;border-width:1px;display:inline-flex;gap:.25rem;opacity:.8;padding:.25em 1em;touch-action:manipulation;--un-shadow:var(--un-shadow-inset) 0 1px 2px 0 var(--un-shadow-color,rgba(0,0,0,.05));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);outline:2px solid transparent!important;outline-offset:2px!important}.n-icon{flex:none}.n-border-base{border-color:#9ca3af33}.hover\:n-button-hover:hover{--un-border-opacity:1!important;border-color:rgba(var(--nui-c-context),var(--un-border-opacity))!important;--un-text-opacity:1;color:rgba(var(--nui-c-context),var(--un-text-opacity));opacity:1}.n-bg-active{background-color:#9ca3af0d}.dark .n-bg-base{--un-bg-opacity:1;background-color:rgb(21 21 21/var(--un-bg-opacity))}.n-bg-base,.n-code-block{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .n-code-block{--un-bg-opacity:1;background-color:rgb(18 18 18/var(--un-bg-opacity))}.hover\:n-bg-active:hover,.n-icon-button:hover{background-color:#9ca3af0d}.n-icon-button:hover{opacity:1}.active\:n-button-active:active{background-color:rgba(var(--nui-c-context),.05);--un-ring-width:3px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-color:rgba(var(--nui-c-context),.1)}.hover\:n-link-hover:hover{--un-text-opacity:1;color:rgba(var(--nui-c-context),var(--un-text-opacity));-webkit-text-decoration-color:rgba(var(--nui-c-context),var(--un-line-opacity))!important;--un-line-opacity:1!important;opacity:1!important;text-decoration-color:rgba(var(--nui-c-context),var(--un-line-opacity))!important;text-decoration-style:dotted}.n-link-base{text-decoration-color:#0003;text-decoration-line:underline;text-underline-offset:2px}.dark .n-link-base{text-decoration-color:#fff6}.focus-visible\:n-focus-base:focus-visible{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-color:rgba(var(--nui-c-context),.5)}.n-transition{transition-duration:.15s;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-1\/2{bottom:-50%}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-2{z-index:2}.z-20{z-index:20}.grid{display:grid}.mx-auto{margin-left:auto;margin-right:auto}.mb-16{margin-bottom:4rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb2,[mb2=""]{margin-bottom:.5rem}.ml--1px{margin-left:-1px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-\[2px\]{margin-right:2px}.mt1{margin-top:.25rem}.hidden{display:none}.h-1\/2{height:50%}.h-4{height:1rem}.h-6{height:1.5rem}.h-auto{height:auto}.h-full{height:100%}.h1{height:.25rem}.h2{height:.5rem}.max-h-full{max-height:100%}.max-w-520px{max-width:520px}.max-w-6{max-width:1.5rem}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-full{width:100%}.flex,[flex=""],[flex~="~"]{display:flex}.flex-inline{display:inline-flex}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.translate-y--1,[translate-y--1=""]{--un-translate-y:-.25rem}.transform,.translate-y--1,[translate-y--1=""]{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer,[cursor-pointer=""]{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.place-content-center{place-content:center}.place-self-start,[place-self-start=""]{place-self:start}.items-start{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.flex-items-center,.items-center,[items-center=""]{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.flex-gap2,.gap-2,[gap-2=""]{gap:.5rem}.gap-1{gap:.25rem}.gap-1\.5,[gap-1\.5=""]{gap:.375rem}.gap-3,[flex~=gap-3]{gap:.75rem}.gap-7{gap:1.75rem}.space-x-3>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--un-space-x-reverse)));margin-right:calc(.75rem*var(--un-space-x-reverse))}.space-x-5>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(1.25rem*(1 - var(--un-space-x-reverse)));margin-right:calc(1.25rem*var(--un-space-x-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-bottom:calc(.5rem*var(--un-space-y-reverse));margin-top:calc(.5rem*(1 - var(--un-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-bottom:calc(.75rem*var(--un-space-y-reverse));margin-top:calc(.75rem*(1 - var(--un-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.border,[border=""]{border-width:1px}.border-l{border-left-width:1px}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.border-none{border-style:none}.bg-black\/5{background-color:#0000000d}.bg-gray-100{--un-bg-opacity:1;background-color:rgb(243 244 246/var(--un-bg-opacity))}.bg-green-50{--un-bg-opacity:1;background-color:rgb(240 253 244/var(--un-bg-opacity))}.bg-light-200{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.bg-red-100{--un-bg-opacity:1;background-color:rgb(254 226 226/var(--un-bg-opacity))}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.bg-yellow-100{--un-bg-opacity:1;background-color:rgb(254 249 195/var(--un-bg-opacity))}.dark .dark\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark .dark\:bg-dark-700{--un-bg-opacity:1;background-color:rgb(27 27 27/var(--un-bg-opacity))}.dark .dark\:bg-white\/10{background-color:#ffffff1a}.hover\:bg-gray-800\/50:hover{background-color:#1f293780}.p-8{padding:2rem}.p4{padding:1rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4,.px4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-\[2px\]{padding-bottom:2px;padding-top:2px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb6{padding-bottom:1.5rem}.pt-14{padding-top:3.5rem}.pt-4{padding-top:1rem}.pt2{padding-top:.5rem}.text-center{text-align:center}.text-6xl{font-size:3.75rem;line-height:1}.text-8xl{font-size:6rem;line-height:1}.text-base,[text-base=""]{font-size:1rem;line-height:1.5rem}.text-lg,[text-lg=""]{font-size:1.125rem;line-height:1.75rem}.text-sm,[text-sm=""]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.text-xs,[text-xs=""]{font-size:.75rem;line-height:1rem}.dark .dark\:text-white,.dark [dark\:text-white=""]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}.text-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.text-blue-300{--un-text-opacity:1;color:rgb(147 197 253/var(--un-text-opacity))}.text-gray-500{--un-text-opacity:1;color:rgb(107 114 128/var(--un-text-opacity))}.text-gray-700{--un-text-opacity:1;color:rgb(55 65 81/var(--un-text-opacity))}.text-green-700{--un-text-opacity:1;color:rgb(21 128 61/var(--un-text-opacity))}.text-red-700{--un-text-opacity:1;color:rgb(185 28 28/var(--un-text-opacity))}.text-yellow-700{--un-text-opacity:1;color:rgb(161 98 7/var(--un-text-opacity))}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold,[font-semibold=""]{font-weight:600}.leading-tight{line-height:1.25}.font-sans{font-family:DM Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.underline,[underline=""]{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tab{-moz-tab-size:4;-o-tab-size:4;tab-size:4}.op-0\.1{opacity:.001}.op100{opacity:1}.op35{opacity:.35}.op50,.opacity-50,[op50=""]{opacity:.5}.op60{opacity:.6}.op75,[op75=""]{opacity:.75}.opacity-40{opacity:.4}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.hover\:opacity-70:hover{opacity:.7}.transition,[transition=""]{transition-duration:.15s;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500,[duration-500=""]{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.n-disabled\:n-disabled[disabled],[disabled] .n-disabled\:n-disabled{filter:saturate(0);opacity:.6;pointer-events:none}@media (min-width:640px){.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-8xl{font-size:6rem;line-height:1}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:1024px){.lg\:flex{display:flex}}.n-code-block-lines .shiki code .line:before{display:none}details[data-v-7ebc02fd],summary[data-v-7ebc02fd]{border-style:none}summary[data-v-7ebc02fd]{list-style:none}details[open] summary[data-v-7ebc02fd]{border-style:none}details summary[data-v-7ebc02fd]::-webkit-details-marker{display:none}details[open] .chevron[data-v-7ebc02fd]{opacity:.75;transform:rotate(180deg)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.spotlight[data-v-b7913e95]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);bottom:-30vh;filter:blur(20vh);height:40vh}.gradient-border[data-v-b7913e95]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:.5rem;position:relative}@media (prefers-color-scheme:light){.gradient-border[data-v-b7913e95]{background-color:#ffffff4d}.gradient-border[data-v-b7913e95]:before{background:linear-gradient(90deg,#e2e2e2,#e2e2e2 25%,#00dc82,#36e4da 75%,#0047e1)}}@media (prefers-color-scheme:dark){.gradient-border[data-v-b7913e95]{background-color:#1414144d}.gradient-border[data-v-b7913e95]:before{background:linear-gradient(90deg,#303030,#303030 25%,#00dc82,#36e4da 75%,#0047e1)}}.gradient-border[data-v-b7913e95]:before{background-size:400% auto;border-radius:.5rem;bottom:0;content:"";left:0;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5;padding:2px;position:absolute;right:0;top:0;transition:background-position .3s ease-in-out,opacity .2s ease-in-out;width:100%}.gradient-border[data-v-b7913e95]:hover:before{background-position:-50% 0;opacity:1}.fixed[data-v-b7913e95]{position:fixed}.left-0[data-v-b7913e95]{left:0}.right-0[data-v-b7913e95]{right:0}.z-10[data-v-b7913e95]{z-index:10}.z-20[data-v-b7913e95]{z-index:20}.grid[data-v-b7913e95]{display:grid}.mb-16[data-v-b7913e95]{margin-bottom:4rem}.mb-8[data-v-b7913e95]{margin-bottom:2rem}.max-w-520px[data-v-b7913e95]{max-width:520px}.min-h-screen[data-v-b7913e95]{min-height:100vh}.w-full[data-v-b7913e95]{width:100%}.flex[data-v-b7913e95]{display:flex}.cursor-pointer[data-v-b7913e95]{cursor:pointer}.place-content-center[data-v-b7913e95]{place-content:center}.items-center[data-v-b7913e95]{align-items:center}.justify-center[data-v-b7913e95]{justify-content:center}.overflow-hidden[data-v-b7913e95]{overflow:hidden}.bg-white[data-v-b7913e95]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-4[data-v-b7913e95]{padding-left:1rem;padding-right:1rem}.px-8[data-v-b7913e95]{padding-left:2rem;padding-right:2rem}.py-2[data-v-b7913e95]{padding-bottom:.5rem;padding-top:.5rem}.text-center[data-v-b7913e95]{text-align:center}.text-8xl[data-v-b7913e95]{font-size:6rem;line-height:1}.text-xl[data-v-b7913e95]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-b7913e95]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-b7913e95]{font-weight:300}.font-medium[data-v-b7913e95]{font-weight:500}.leading-tight[data-v-b7913e95]{line-height:1.25}.font-sans[data-v-b7913e95]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-b7913e95]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-b7913e95]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-b7913e95]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-b7913e95]{padding-left:0;padding-right:0}.sm\:px-6[data-v-b7913e95]{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3[data-v-b7913e95]{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-4xl[data-v-b7913e95]{font-size:2.25rem;line-height:2.5rem}.sm\:text-xl[data-v-b7913e95]{font-size:1.25rem;line-height:1.75rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.spotlight[data-v-4ec72d76]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}.fixed[data-v-4ec72d76]{position:fixed}.-bottom-1\/2[data-v-4ec72d76]{bottom:-50%}.left-0[data-v-4ec72d76]{left:0}.right-0[data-v-4ec72d76]{right:0}.grid[data-v-4ec72d76]{display:grid}.mb-16[data-v-4ec72d76]{margin-bottom:4rem}.mb-8[data-v-4ec72d76]{margin-bottom:2rem}.h-1\/2[data-v-4ec72d76]{height:50%}.max-w-520px[data-v-4ec72d76]{max-width:520px}.min-h-screen[data-v-4ec72d76]{min-height:100vh}.place-content-center[data-v-4ec72d76]{place-content:center}.overflow-hidden[data-v-4ec72d76]{overflow:hidden}.bg-white[data-v-4ec72d76]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-8[data-v-4ec72d76]{padding-left:2rem;padding-right:2rem}.text-center[data-v-4ec72d76]{text-align:center}.text-8xl[data-v-4ec72d76]{font-size:6rem;line-height:1}.text-xl[data-v-4ec72d76]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-4ec72d76]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-4ec72d76]{font-weight:300}.font-medium[data-v-4ec72d76]{font-weight:500}.leading-tight[data-v-4ec72d76]{line-height:1.25}.font-sans[data-v-4ec72d76]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-4ec72d76]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-4ec72d76]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-4ec72d76]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-4ec72d76]{padding-left:0;padding-right:0}.sm\:text-4xl[data-v-4ec72d76]{font-size:2.25rem;line-height:2.5rem}}
|
package/dist/client/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
3
|
+
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.Cts5wDvr.css">
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BA8oXX6l.js">
|
|
5
5
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXFkqnOI.js">
|
|
6
6
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BigF1UXR.js">
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CowR2XfX.js">
|
|
@@ -257,10 +257,10 @@
|
|
|
257
257
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B3g-KkBK.js">
|
|
258
258
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Bxkoe-BC.js">
|
|
259
259
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Br6ll-O0.js">
|
|
260
|
-
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.
|
|
261
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
262
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
263
|
-
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.
|
|
264
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
265
|
-
<script type="module" src="/__nuxt-scripts/_nuxt/
|
|
266
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"
|
|
260
|
+
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.-RjlvToe.css">
|
|
261
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D3k5CjNA.js">
|
|
262
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D9Ze639F.js">
|
|
263
|
+
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.Bz7LXgZy.css">
|
|
264
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D6UD5WyS.js">
|
|
265
|
+
<script type="module" src="/__nuxt-scripts/_nuxt/BA8oXX6l.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
266
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"a5c6ec68-62ae-43af-96d0-bdd9f64f38b1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useNuxt, useLogger, addDevServerHandler, createResolver, addTemplate, tryUseNuxt, logger as logger$1,
|
|
1
|
+
import { useNuxt, useLogger, addDevServerHandler, createResolver, addTemplate, tryUseNuxt, logger as logger$1, defineNuxtModule, addImportsDir, addComponentsDir, addImports, addPluginTemplate, addBuildPlugin, hasNuxtModule } from '@nuxt/kit';
|
|
2
2
|
import { resolvePackageJSON, readPackageJSON } from 'pkg-types';
|
|
3
3
|
import { lt } from 'semver';
|
|
4
4
|
import { resolvePath } from 'mlly';
|
|
5
|
-
import { join, relative
|
|
5
|
+
import { join, relative } from 'pathe';
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
8
7
|
import { createUnplugin } from 'unplugin';
|
|
9
|
-
import { parseURL, parseQuery, joinURL, hasProtocol } from 'ufo';
|
|
10
8
|
import MagicString from 'magic-string';
|
|
11
9
|
import { walk } from 'estree-walker';
|
|
10
|
+
import { pathToFileURL } from 'node:url';
|
|
11
|
+
import { parseURL, parseQuery, joinURL, hasProtocol } from 'ufo';
|
|
12
12
|
import fsp from 'node:fs/promises';
|
|
13
13
|
import { lazyEventHandler, eventHandler, createError } from 'h3';
|
|
14
14
|
import { fetch } from 'ofetch';
|
|
@@ -19,10 +19,7 @@ import { createStorage } from 'unstorage';
|
|
|
19
19
|
import fsDriver from 'unstorage/drivers/fs-lite';
|
|
20
20
|
import { isCI, provider } from 'std-env';
|
|
21
21
|
import { registry } from './registry.mjs';
|
|
22
|
-
import
|
|
23
|
-
import { genTypeImport, genImport } from 'knitwork';
|
|
24
|
-
import { parse } from 'acorn';
|
|
25
|
-
import { transform } from 'esbuild';
|
|
22
|
+
import 'third-party-capital';
|
|
26
23
|
|
|
27
24
|
const DEVTOOLS_UI_ROUTE = "/__nuxt-scripts";
|
|
28
25
|
const DEVTOOLS_UI_LOCAL_PORT = 3300;
|
|
@@ -67,20 +64,39 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
66
|
|
|
67
|
+
function isVue(id, opts = {}) {
|
|
68
|
+
const { search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
69
|
+
if (id.endsWith(".vue") && !search) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (!search) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const query = parseQuery(search);
|
|
76
|
+
if (query.nuxt_component) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
if (query.macro && (search === "?macro=true" || !opts.type || opts.type.includes("script"))) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
const type = "setup" in query ? "script" : query.type;
|
|
83
|
+
if (!("vue" in query) || opts.type && !opts.type.includes(type)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
const JS_RE = /\.(?:[cm]?j|t)sx?$/;
|
|
89
|
+
function isJS(id) {
|
|
90
|
+
const { pathname } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
91
|
+
return JS_RE.test(pathname);
|
|
92
|
+
}
|
|
93
|
+
|
|
70
94
|
function NuxtScriptBundleTransformer(options) {
|
|
71
95
|
return createUnplugin(() => {
|
|
72
96
|
return {
|
|
73
97
|
name: "nuxt:scripts:bundler-transformer",
|
|
74
98
|
transformInclude(id) {
|
|
75
|
-
|
|
76
|
-
const { type } = parseQuery(search);
|
|
77
|
-
if (pathname.includes("node_modules/@unhead") || pathname.includes("node_modules/vueuse"))
|
|
78
|
-
return false;
|
|
79
|
-
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
80
|
-
return true;
|
|
81
|
-
if (pathname.match(/\.((c|m)?j|t)sx?$/g))
|
|
82
|
-
return true;
|
|
83
|
-
return false;
|
|
99
|
+
return isVue(id, { type: ["template", "script"] }) || isJS(id);
|
|
84
100
|
},
|
|
85
101
|
async transform(code, id) {
|
|
86
102
|
if (!code.includes("useScript"))
|
|
@@ -362,269 +378,58 @@ function installNuxtModule(name, options) {
|
|
|
362
378
|
}, { rootDir: nuxt.options.rootDir, searchPaths: nuxt.options.modulesDir, ...options });
|
|
363
379
|
}
|
|
364
380
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
const mainScriptOptions = getScriptInputOption(mainScript);
|
|
375
|
-
const imports = /* @__PURE__ */ new Set([
|
|
376
|
-
"import { withQuery } from 'ufo'",
|
|
377
|
-
"import { useRegistryScript } from '#nuxt-scripts-utils'",
|
|
378
|
-
"import type { RegistryScriptInput } from '#nuxt-scripts'",
|
|
379
|
-
"import type { VueScriptInstance } from '@unhead/vue'"
|
|
380
|
-
]);
|
|
381
|
-
const chunks = [];
|
|
382
|
-
const functionBody = [];
|
|
383
|
-
const hasParams = mainScript.params?.length;
|
|
384
|
-
if (input.tpcTypeImport) {
|
|
385
|
-
imports.add(genTypeImport(await resolvePath("third-party-capital", {
|
|
386
|
-
url: import.meta.url
|
|
387
|
-
}), [input.tpcTypeImport]));
|
|
388
|
-
}
|
|
389
|
-
if (hasParams) {
|
|
390
|
-
imports.add(genImport("#nuxt-scripts-validator", ["object", "any"]));
|
|
391
|
-
chunks.push(`const OptionSchema = object({${mainScript.params?.map((p) => `${p}: any()`)}})`);
|
|
392
|
-
}
|
|
393
|
-
chunks.push(`
|
|
394
|
-
declare global {
|
|
395
|
-
interface Window extends ${input.tpcTypeImport} {}
|
|
396
|
-
}`);
|
|
397
|
-
const clientInitCode = [];
|
|
398
|
-
if (input.data.stylesheets) {
|
|
399
|
-
if (!functionBody.includes(INJECTHEAD_CODE)) {
|
|
400
|
-
functionBody.unshift(INJECTHEAD_CODE);
|
|
401
|
-
}
|
|
402
|
-
functionBody.push(`${HEAD_VAR}.push({link: ${JSON.stringify(input.data.stylesheets.map((s) => ({ ref: "stylesheet", href: s })))}})`);
|
|
403
|
-
}
|
|
404
|
-
for (const script of input.data.scripts) {
|
|
405
|
-
if ("code" in script)
|
|
406
|
-
clientInitCode.push(replaceTokenToRuntime(script.code));
|
|
407
|
-
if (script === mainScript)
|
|
408
|
-
continue;
|
|
409
|
-
if ("url" in script) {
|
|
410
|
-
functionBody.push(`${HEAD_VAR}.push({scripts:{ async: true, src: ${script.url} }},${JSON.stringify(getScriptInputOption(script))})`);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
chunks.push(`export type Input = RegistryScriptInput${hasParams ? "<typeof OptionSchema>" : ""}`);
|
|
414
|
-
chunks.push(`
|
|
415
|
-
export function ${input.scriptFunctionName}<T extends ${input.tpcTypeImport}>(_options?: Input): T & {
|
|
416
|
-
$script: Promise<T> & VueScriptInstance<T>;
|
|
417
|
-
} {
|
|
418
|
-
${functionBody.join("\n")}
|
|
419
|
-
return useRegistryScript${hasParams ? "<T, typeof OptionSchema>" : ""}('${input.tpcKey}', options => ({
|
|
420
|
-
scriptInput: {
|
|
421
|
-
src: withQuery('${mainScript.url}', {${mainScript.params?.map((p) => `${p}: options?.${p}`)}})
|
|
422
|
-
},
|
|
423
|
-
${nuxt.options.dev ? "schema: OptionSchema," : ""}
|
|
424
|
-
scriptOptions: {
|
|
425
|
-
use: ${input.use.toString()},
|
|
426
|
-
stub: import.meta.client ? undefined : ${input.stub.toString()},
|
|
427
|
-
${mainScriptOptions ? `...(${JSON.stringify(mainScriptOptions)})` : ""}
|
|
428
|
-
},
|
|
429
|
-
${clientInitCode.length ? `clientInit: import.meta.server ? undefined : () => {${clientInitCode.join("\n")}},` : ""}
|
|
430
|
-
}), _options)
|
|
431
|
-
}`);
|
|
432
|
-
chunks.unshift(...Array.from(imports));
|
|
433
|
-
return chunks.join("\n");
|
|
434
|
-
}
|
|
435
|
-
function replaceTokenToRuntime(code) {
|
|
436
|
-
return code.split(";").map((c) => c.replaceAll(/'?\{\{(.*?)\}\}'?/g, "options.$1")).join(";");
|
|
437
|
-
}
|
|
438
|
-
function getScriptInputOption(script) {
|
|
439
|
-
if (script.location === "body") {
|
|
440
|
-
if (script.action === "append") {
|
|
441
|
-
return { tagPosition: "bodyClose" };
|
|
442
|
-
}
|
|
443
|
-
return { tagPosition: "bodyOpen" };
|
|
444
|
-
}
|
|
445
|
-
if (script.action === "append") {
|
|
446
|
-
return { tagPriority: 1 };
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
function googleAnalitycsRegistry(scripts) {
|
|
451
|
-
const { dst } = addTemplate({
|
|
452
|
-
getContents() {
|
|
453
|
-
return getTpcScriptContent({
|
|
454
|
-
data: GooglaAnalyticsData,
|
|
455
|
-
scriptFunctionName: "useScriptGoogleAnalytics",
|
|
456
|
-
use: () => {
|
|
457
|
-
return { dataLayer: window.dataLayer, gtag: window.gtag };
|
|
458
|
-
},
|
|
459
|
-
// allow dataLayer to be accessed on the server
|
|
460
|
-
stub: ({ fn }) => {
|
|
461
|
-
return fn === "dataLayer" ? [] : void 0;
|
|
462
|
-
},
|
|
463
|
-
tpcKey: "gtag",
|
|
464
|
-
tpcTypeImport: "GoogleAnalyticsApi"
|
|
465
|
-
});
|
|
466
|
-
},
|
|
467
|
-
filename: "nuxt-scripts/tpc/google-analytics.ts",
|
|
468
|
-
write: true
|
|
469
|
-
});
|
|
470
|
-
addImports({
|
|
471
|
-
from: dst,
|
|
472
|
-
name: "useScriptGoogleAnalytics"
|
|
473
|
-
});
|
|
474
|
-
const registry = {
|
|
475
|
-
label: "Google Tag Manager",
|
|
476
|
-
category: "tracking",
|
|
477
|
-
logo: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path fill="#8AB4F8" d="m150.262 245.516l-44.437-43.331l95.433-97.454l46.007 45.091z"/><path fill="#4285F4" d="M150.45 53.938L106.176 8.731L9.36 104.629c-12.48 12.48-12.48 32.713 0 45.207l95.36 95.986l45.09-42.182l-72.654-76.407z"/><path fill="#8AB4F8" d="m246.625 105.37l-96-96c-12.494-12.494-32.756-12.494-45.25 0c-12.495 12.495-12.495 32.757 0 45.252l96 96c12.494 12.494 32.756 12.494 45.25 0c12.495-12.495 12.495-32.757 0-45.251"/><circle cx="127.265" cy="224.731" r="31.273" fill="#246FDB"/></svg>`,
|
|
478
|
-
import: {
|
|
479
|
-
name: "useScriptGoogleAnalytics",
|
|
480
|
-
from: dst
|
|
481
|
-
},
|
|
482
|
-
scriptBundling(options) {
|
|
483
|
-
const data = GoogleAnalytics(options);
|
|
484
|
-
const mainScript = data.scripts?.find(({ key }) => key === "gtag");
|
|
485
|
-
if (mainScript && "url" in mainScript && mainScript.url)
|
|
486
|
-
return mainScript.url;
|
|
487
|
-
return false;
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
scripts.push(registry);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
function googleTagManagerRegistry(scripts) {
|
|
494
|
-
const { dst } = addTemplate({
|
|
495
|
-
getContents() {
|
|
496
|
-
return getTpcScriptContent({
|
|
497
|
-
data: GoogleTagManagerData,
|
|
498
|
-
scriptFunctionName: "useScriptGoogleTagManager",
|
|
499
|
-
use: () => {
|
|
500
|
-
return { dataLayer: window.dataLayer, google_tag_manager: window.google_tag_manager };
|
|
501
|
-
},
|
|
502
|
-
stub: ({ fn }) => {
|
|
503
|
-
return fn === "dataLayer" ? [] : void 0;
|
|
504
|
-
},
|
|
505
|
-
tpcKey: "gtm",
|
|
506
|
-
tpcTypeImport: "GoogleTagManagerApi"
|
|
507
|
-
});
|
|
508
|
-
},
|
|
509
|
-
filename: "nuxt-scripts/tpc/google-tag-manager.ts",
|
|
510
|
-
write: true
|
|
511
|
-
});
|
|
512
|
-
addImports({
|
|
513
|
-
from: dst,
|
|
514
|
-
name: "useScriptGoogleTagManager"
|
|
515
|
-
});
|
|
516
|
-
const registry = {
|
|
517
|
-
label: "Google Tag Manager",
|
|
518
|
-
category: "tracking",
|
|
519
|
-
logo: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path fill="#8AB4F8" d="m150.262 245.516l-44.437-43.331l95.433-97.454l46.007 45.091z"/><path fill="#4285F4" d="M150.45 53.938L106.176 8.731L9.36 104.629c-12.48 12.48-12.48 32.713 0 45.207l95.36 95.986l45.09-42.182l-72.654-76.407z"/><path fill="#8AB4F8" d="m246.625 105.37l-96-96c-12.494-12.494-32.756-12.494-45.25 0c-12.495 12.495-12.495 32.757 0 45.252l96 96c12.494 12.494 32.756 12.494 45.25 0c12.495-12.495 12.495-32.757 0-45.251"/><circle cx="127.265" cy="224.731" r="31.273" fill="#246FDB"/></svg>`,
|
|
520
|
-
import: {
|
|
521
|
-
name: "useScriptGoogleTagManager",
|
|
522
|
-
from: dst
|
|
523
|
-
},
|
|
524
|
-
scriptBundling(options) {
|
|
525
|
-
const data = GoogleTagManager(options);
|
|
526
|
-
const mainScript = data.scripts?.find(({ key }) => key === "gtm");
|
|
527
|
-
if (mainScript && "url" in mainScript && mainScript.url)
|
|
528
|
-
return mainScript.url;
|
|
529
|
-
return false;
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
scripts.push(registry);
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const SCRIPT_RE = /<script[^>]*>([\s\S]*)<\/script>/;
|
|
536
|
-
const checkScripts = () => createUnplugin(() => {
|
|
537
|
-
return {
|
|
538
|
-
name: "nuxt-scripts:check-scripts",
|
|
539
|
-
enforce: "pre",
|
|
540
|
-
async transform(code, id) {
|
|
541
|
-
if (!code.includes("useScript"))
|
|
542
|
-
return;
|
|
543
|
-
const extName = extname(id);
|
|
544
|
-
if (extName === ".vue") {
|
|
545
|
-
const scriptAst = await extractScriptContentAst(code);
|
|
546
|
-
if (scriptAst) {
|
|
547
|
-
analyzeNodes(id, scriptAst);
|
|
548
|
-
}
|
|
549
|
-
} else if (extName === ".ts" || extName === ".js") {
|
|
550
|
-
if (!code.includes("defineComponent"))
|
|
381
|
+
function NuxtScriptsCheckScripts() {
|
|
382
|
+
return createUnplugin(() => {
|
|
383
|
+
return {
|
|
384
|
+
name: "nuxt-scripts:check-scripts",
|
|
385
|
+
transformInclude(id) {
|
|
386
|
+
return isVue(id, { type: ["script"] });
|
|
387
|
+
},
|
|
388
|
+
async transform(code) {
|
|
389
|
+
if (!code.includes("useScript"))
|
|
551
390
|
return;
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
function isAwaitingLoad(name, node) {
|
|
591
|
-
if (node.type === "ExpressionStatement" && node.expression.type === "AwaitExpression") {
|
|
592
|
-
const arg = node.expression.argument;
|
|
593
|
-
if (arg.type === "CallExpression") {
|
|
594
|
-
const callee = arg.callee;
|
|
595
|
-
if (callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === name) {
|
|
596
|
-
if (callee.property.type === "Identifier" && callee.property.name === "load") {
|
|
597
|
-
return true;
|
|
391
|
+
const ast = this.parse(code);
|
|
392
|
+
let nameNode;
|
|
393
|
+
let errorNode;
|
|
394
|
+
walk(ast, {
|
|
395
|
+
enter(_node) {
|
|
396
|
+
if (_node.type === "VariableDeclaration" && _node.declarations?.[0]?.id?.type === "ObjectPattern") {
|
|
397
|
+
const objPattern = _node.declarations[0]?.id;
|
|
398
|
+
for (const property of objPattern.properties) {
|
|
399
|
+
if (property.type === "Property" && property.key.type === "Identifier" && property.key.name === "$script" && property.value.type === "Identifier") {
|
|
400
|
+
nameNode = _node;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
if (nameNode) {
|
|
405
|
+
let sequence = _node.type === "SequenceExpression" ? _node : null;
|
|
406
|
+
let assignmentExpression;
|
|
407
|
+
if (_node.type === "VariableDeclaration") {
|
|
408
|
+
if (_node.declarations[0]?.init?.type === "SequenceExpression") {
|
|
409
|
+
sequence = _node.declarations[0]?.init;
|
|
410
|
+
assignmentExpression = _node.declarations[0]?.init?.expressions?.[0];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (sequence && !assignmentExpression) {
|
|
414
|
+
assignmentExpression = sequence.expressions[0]?.type === "AssignmentExpression" ? sequence.expressions[0] : null;
|
|
415
|
+
}
|
|
416
|
+
if (assignmentExpression) {
|
|
417
|
+
const right = assignmentExpression?.right;
|
|
418
|
+
if (right.callee?.name === "_withAsyncContext") {
|
|
419
|
+
if (right.arguments[0]?.body?.name === "$script" || right.arguments[0]?.body?.callee?.object?.name === "$script") {
|
|
420
|
+
errorNode = nameNode;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
if (errorNode) {
|
|
428
|
+
return this.error(new Error("You can't use a top-level await on $script as it will never resolve."));
|
|
598
429
|
}
|
|
599
430
|
}
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
async function extractScriptContentAst(code) {
|
|
604
|
-
const scriptCode = code.match(SCRIPT_RE);
|
|
605
|
-
return scriptCode ? parse((await transform(scriptCode[1], { loader: "ts" })).code, {
|
|
606
|
-
ecmaVersion: "latest",
|
|
607
|
-
sourceType: "module"
|
|
608
|
-
}).body : void 0;
|
|
609
|
-
}
|
|
610
|
-
function extractSetupFunction(code) {
|
|
611
|
-
const ast = parse(code, {
|
|
612
|
-
ecmaVersion: "latest",
|
|
613
|
-
sourceType: "module"
|
|
431
|
+
};
|
|
614
432
|
});
|
|
615
|
-
const defaultExport = ast.body.find((node) => node.type === "ExportDefaultDeclaration");
|
|
616
|
-
if (defaultExport && defaultExport.declaration.type === "CallExpression" && defaultExport.declaration.callee.type === "Identifier" && defaultExport.declaration.callee.name === "defineComponent") {
|
|
617
|
-
const arg = defaultExport.declaration.arguments[0];
|
|
618
|
-
if (arg && arg.type === "ObjectExpression") {
|
|
619
|
-
const setupProperty = arg.properties.find((prop) => prop.type === "Property" && prop.key.type === "Identifier" && prop.key.name === "setup");
|
|
620
|
-
if (setupProperty) {
|
|
621
|
-
const setupValue = setupProperty.value;
|
|
622
|
-
if (setupValue.type === "FunctionExpression") {
|
|
623
|
-
return setupValue.body.body;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
433
|
}
|
|
629
434
|
|
|
630
435
|
function templatePlugin(config, registry) {
|
|
@@ -699,7 +504,6 @@ const module = defineNuxtModule({
|
|
|
699
504
|
return;
|
|
700
505
|
}
|
|
701
506
|
}
|
|
702
|
-
addBuildPlugin(checkScripts());
|
|
703
507
|
nuxt.options.alias["#nuxt-scripts-validator"] = resolve(`./runtime/validation/${nuxt.options.dev || nuxt.options._prepare ? "valibot" : "mock"}`);
|
|
704
508
|
nuxt.options.alias["#nuxt-scripts"] = resolve("./runtime/types");
|
|
705
509
|
nuxt.options.alias["#nuxt-scripts-utils"] = resolve("./runtime/utils");
|
|
@@ -719,8 +523,6 @@ const module = defineNuxtModule({
|
|
|
719
523
|
path: resolve("./runtime/components")
|
|
720
524
|
});
|
|
721
525
|
const scripts = registry(resolve);
|
|
722
|
-
googleAnalitycsRegistry(scripts);
|
|
723
|
-
googleTagManagerRegistry(scripts);
|
|
724
526
|
nuxt.hooks.hook("modules:done", async () => {
|
|
725
527
|
const registryScripts = [...scripts];
|
|
726
528
|
await nuxt.hooks.callHook("scripts:registry", registryScripts);
|
|
@@ -771,6 +573,9 @@ ${newScripts.map((i) => {
|
|
|
771
573
|
const scriptMap = /* @__PURE__ */ new Map();
|
|
772
574
|
const { normalizeScriptData } = setupPublicAssetStrategy(config.assets);
|
|
773
575
|
const moduleInstallPromises = /* @__PURE__ */ new Map();
|
|
576
|
+
addBuildPlugin(NuxtScriptsCheckScripts(), {
|
|
577
|
+
dev: true
|
|
578
|
+
});
|
|
774
579
|
addBuildPlugin(NuxtScriptBundleTransformer({
|
|
775
580
|
scripts: registryScriptsWithImport,
|
|
776
581
|
defaultBundle: config.defaultScriptOptions?.bundle,
|
package/dist/registry.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { joinURL, withQuery, withBase } from 'ufo';
|
|
2
|
+
import { GoogleTagManager, GoogleAnalytics } from 'third-party-capital';
|
|
2
3
|
|
|
3
4
|
const registry = (resolve) => {
|
|
4
5
|
resolve = resolve || ((s) => s);
|
|
@@ -219,6 +220,38 @@ const registry = (resolve) => {
|
|
|
219
220
|
// key is based on package name
|
|
220
221
|
from: resolve("./runtime/registry/npm")
|
|
221
222
|
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: "Google Tag Manager",
|
|
226
|
+
category: "tracking",
|
|
227
|
+
import: {
|
|
228
|
+
name: "useScriptGoogleTagManager",
|
|
229
|
+
from: resolve("./runtime/registry/google-tag-manager")
|
|
230
|
+
},
|
|
231
|
+
logo: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path fill="#8AB4F8" d="m150.262 245.516l-44.437-43.331l95.433-97.454l46.007 45.091z"/><path fill="#4285F4" d="M150.45 53.938L106.176 8.731L9.36 104.629c-12.48 12.48-12.48 32.713 0 45.207l95.36 95.986l45.09-42.182l-72.654-76.407z"/><path fill="#8AB4F8" d="m246.625 105.37l-96-96c-12.494-12.494-32.756-12.494-45.25 0c-12.495 12.495-12.495 32.757 0 45.252l96 96c12.494 12.494 32.756 12.494 45.25 0c12.495-12.495 12.495-32.757 0-45.251"/><circle cx="127.265" cy="224.731" r="31.273" fill="#246FDB"/></svg>`,
|
|
232
|
+
scriptBundling(options) {
|
|
233
|
+
const data = GoogleTagManager(options);
|
|
234
|
+
const mainScript = data.scripts?.find(({ key }) => key === "gtag");
|
|
235
|
+
if (mainScript && "url" in mainScript && mainScript.url)
|
|
236
|
+
return mainScript.url;
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
label: "Google Analytics",
|
|
242
|
+
category: "analytics",
|
|
243
|
+
import: {
|
|
244
|
+
name: "useScriptGoogleAnalytics",
|
|
245
|
+
from: resolve("./runtime/registry/google-analytics")
|
|
246
|
+
},
|
|
247
|
+
logo: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="192px" height="192px" viewBox="0 0 192 192" enable-background="new 0 0 192 192" xml:space="preserve"><rect x="0" y="0" fill="none" width="192" height="192"/><g><g><path fill="#F9AB00" d="M130,29v132c0,14.77,10.19,23,21,23c10,0,21-7,21-23V30c0-13.54-10-22-21-22S130,17.33,130,29z"/></g><g><path fill="#E37400" d="M75,96v65c0,14.77,10.19,23,21,23c10,0,21-7,21-23V97c0-13.54-10-22-21-22S75,84.33,75,96z"/></g><g><circle fill="#E37400" cx="41" cy="163" r="21"/></g></g></svg>`,
|
|
248
|
+
scriptBundling(options) {
|
|
249
|
+
const data = GoogleAnalytics(options);
|
|
250
|
+
const mainScript = data.scripts?.find(({ key }) => key === "gtag");
|
|
251
|
+
if (mainScript && "url" in mainScript && mainScript.url)
|
|
252
|
+
return mainScript.url;
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
222
255
|
}
|
|
223
256
|
];
|
|
224
257
|
};
|