@anker-in/headless-ui 1.0.9-temp-10 → 1.0.9-temp-12
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/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +2 -2
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +2 -2
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var I=Object.create;var c=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var _=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of j(e))!F.call(t,n)&&n!==r&&c(t,n,{get:()=>e[n],enumerable:!(s=U(e,n))||s.enumerable});return t};var q=(t,e,r)=>(r=t!=null?I(C(t)):{},y(e||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t)),A=t=>y(c({},"__esModule",{value:!0}),t);var K={};_(K,{default:()=>J});module.exports=A(K);var i=require("react/jsx-runtime"),o=q(require("react")),m=require("gsap"),d=require("gsap/dist/SplitText"),g=require("gsap/dist/ScrollTrigger"),h=require("../../helpers/utils.js"),b=require("../../components/index.js"),v=require("../../shared/Styles.js"),R=require("../../shared/trackUrlRef.js"),H=require("react-intersection-observer");const B="link",G="title",k=o.default.forwardRef(({data:t,className:e})=>{const{title:r,theme:s,extension:n}=t,l=(0,o.useRef)(null),a=(0,o.useRef)(null),p=(0,o.useRef)(null),{ref:L,inView:w}=(0,H.useInView)();return(0,o.useEffect)(()=>{m.gsap.registerPlugin(d.SplitText,g.ScrollTrigger);function N(){if(!l.current)return;const E=l.current?.clientHeight||80;a.current=new d.SplitText(l.current,{type:"words",wordsClass:"word"});const u=a.current.words;m.gsap.set(u,{opacity:0}),p.current=g.ScrollTrigger.create({trigger:l.current,start:"bottom bottom-=4%",end:`bottom+=${E*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:M=>{const S=M.progress,T=u.length,D=1/T,x=.5;u.forEach((P,V)=>{const $=V/T*(1-x),z=D*(1+x);let f=(S-$)/z;f=Math.max(0,Math.min(f,1)),m.gsap.set(P,{opacity:f})})}})}return w&&N(),()=>{a.current&&a.current.revert(),p.current&&p.current.kill()}},[w]),r&&(0,i.jsxs)("div",{className:"mb-6 flex items-end justify-between",children:[(0,i.jsx)("div",{
|
|
1
|
+
"use strict";"use client";var I=Object.create;var c=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var _=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of j(e))!F.call(t,n)&&n!==r&&c(t,n,{get:()=>e[n],enumerable:!(s=U(e,n))||s.enumerable});return t};var q=(t,e,r)=>(r=t!=null?I(C(t)):{},y(e||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t)),A=t=>y(c({},"__esModule",{value:!0}),t);var K={};_(K,{default:()=>J});module.exports=A(K);var i=require("react/jsx-runtime"),o=q(require("react")),m=require("gsap"),d=require("gsap/dist/SplitText"),g=require("gsap/dist/ScrollTrigger"),h=require("../../helpers/utils.js"),b=require("../../components/index.js"),v=require("../../shared/Styles.js"),R=require("../../shared/trackUrlRef.js"),H=require("react-intersection-observer");const B="link",G="title",k=o.default.forwardRef(({data:t,className:e})=>{const{title:r,theme:s,extension:n}=t,l=(0,o.useRef)(null),a=(0,o.useRef)(null),p=(0,o.useRef)(null),{ref:L,inView:w}=(0,H.useInView)();return(0,o.useEffect)(()=>{m.gsap.registerPlugin(d.SplitText,g.ScrollTrigger);function N(){if(!l.current)return;const E=l.current?.clientHeight||80;a.current=new d.SplitText(l.current,{type:"words",wordsClass:"word"});const u=a.current.words;m.gsap.set(u,{opacity:0}),p.current=g.ScrollTrigger.create({trigger:l.current,start:"bottom bottom-=4%",end:`bottom+=${E*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:M=>{const S=M.progress,T=u.length,D=1/T,x=.5;u.forEach((P,V)=>{const $=V/T*(1-x),z=D*(1+x);let f=(S-$)/z;f=Math.max(0,Math.min(f,1)),m.gsap.set(P,{opacity:f})})}})}return w&&N(),()=>{a.current&&a.current.revert(),p.current&&p.current.kill()}},[w]),r&&(0,i.jsxs)("div",{className:"mb-6 flex items-end justify-between",ref:L,children:[(0,i.jsx)("div",{className:(0,h.cn)("space-y-4",e,{"aiui-dark":s==="dark"}),children:(0,i.jsx)(b.Heading,{ref:l,as:"h2",size:4,html:r})}),n?.textLink&&(0,i.jsx)("a",{className:(0,h.cn)({"aiui-dark":s==="dark"},"text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:(0,R.trackUrlRef)(n?.link,`${B}_${G}`),children:n?.textLink})]})});k.displayName="Title";var J=(0,v.withLayout)(k);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/Title/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useEffect, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme, extension } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n title && (\n <div className=\"mb-6 flex items-end justify-between\"
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAoEM,IAAAI,EAAA,6BAnENC,EAAyC,oBACzCC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAE3BC,EAA4B,uCAC5BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAQ,EAAAC,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,MACE,QAAC,OAAI,UAAU,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useEffect, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme, extension } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n title && (\n <div className=\"mb-6 flex items-end justify-between\" ref={inViewRef}>\n <div className={cn('space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n {extension?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extension?.link, `${componentType}_${componentName}`)}\n >\n {extension?.textLink}\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAoEM,IAAAI,EAAA,6BAnENC,EAAyC,oBACzCC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAE3BC,EAA4B,uCAC5BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,UAAAC,CAAU,EAAIJ,EAC9BK,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EACjDC,KAAmB,UAA6B,IAAI,EAEpD,CAAE,IAAKC,EAAW,OAAAC,CAAO,KAAI,aAAU,EAE7C,sBAAU,IAAM,CACd,OAAK,eAAe,YAAW,eAAa,EAC5C,SAASC,GAAa,CACpB,GAAI,CAACL,EAAS,QAAS,OACvB,MAAMM,EAASN,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAI,YAAUD,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMO,EAAQN,EAAkB,QAAQ,MACxC,OAAK,IAAIM,EAAO,CAAE,QAAS,CAAE,CAAC,EAC9BL,EAAiB,QAAU,gBAAc,OAAO,CAC9C,QAASF,EAAS,QAClB,MAAO,oBACP,IAAK,WAAWM,EAAS,IAAM,EAAE,gBACjC,MAAO,GACP,SAAWE,GAAc,CACvB,MAAMC,EAAWD,EAAK,SAChBE,EAAQH,EAAM,OACdI,EAAW,EAAID,EACfE,EAAU,GAChBL,EAAM,QAAQ,CAACM,EAAWC,IAAc,CACtC,MAAMC,EAASD,EAAIJ,GAAU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1C,OAAK,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXJ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9DC,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACE,CAAM,CAAC,EAGTP,MACE,QAAC,OAAI,UAAU,sCAAsC,IAAKM,EACxD,oBAAC,OAAI,aAAW,MAAG,YAAaP,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EAC1E,mBAAC,WAAQ,IAAKE,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMH,EAAO,EACxD,EACCE,GAAW,aACV,OAAC,KACC,aAAW,MACT,CAAE,YAAaD,IAAU,MAAO,EAChC,oGACF,EACA,QAAM,eAAYC,GAAW,KAAM,GAAGR,CAAa,IAAIC,CAAa,EAAE,EAErE,SAAAO,GAAW,SACd,GAEJ,CAGN,CAAC,EAEDN,EAAM,YAAc,QAEpB,IAAOd,KAAQ,cAAWc,CAAK",
|
|
6
6
|
"names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "Title", "React", "data", "className", "title", "theme", "extension", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity"]
|
|
7
7
|
}
|