@xyd-js/components 0.0.0-build-83b15db-20251213220910 → 0.0.0-build-43c02e0-20251224011947
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/CHANGELOG.md +2 -2
- package/dist/{Button-CZG8WHpu.js → Button-DgMQDvfH.js} +2 -2
- package/dist/{Button-CZG8WHpu.js.map → Button-DgMQDvfH.js.map} +1 -1
- package/dist/{CodeSample-B9h9UIh0.js → CodeSample-D260IZS0.js} +2 -2
- package/dist/{CodeSample-B9h9UIh0.js.map → CodeSample-D260IZS0.js.map} +1 -1
- package/dist/{Icon-BqVl679K.js → Icon-CGYAcXsi.js} +1 -1
- package/dist/{Icon-BqVl679K.js.map → Icon-CGYAcXsi.js.map} +1 -1
- package/dist/{PageFirstSlide-BrMv7J4F.js → PageFirstSlide-CTd-3uGs.js} +2 -2
- package/dist/{PageFirstSlide-BrMv7J4F.js.map → PageFirstSlide-CTd-3uGs.js.map} +1 -1
- package/dist/{TabsAnalytics-DDUoyBIt.js → TabsAnalytics-DPnJGce8.js} +1 -1
- package/dist/{TabsAnalytics-DDUoyBIt.js.map → TabsAnalytics-DPnJGce8.js.map} +1 -1
- package/dist/{Update-_QSiAyTq.js → Update-B2r4fEw4.js} +2 -2
- package/dist/{Update-_QSiAyTq.js.map → Update-B2r4fEw4.js.map} +1 -1
- package/dist/{VideoGuide-CgDxxfWR.js → VideoGuide-CN2sFTjr.js} +2 -2
- package/dist/{VideoGuide-CgDxxfWR.js.map → VideoGuide-CN2sFTjr.js.map} +1 -1
- package/dist/coder.js +1 -1
- package/dist/content.js +1 -1
- package/dist/index.css +41 -41
- package/dist/pages.js +1 -1
- package/dist/system.js +1 -1
- package/dist/{useUXClick-Dfsi32W_.js → useUXClick-WPLnES0o.js} +1 -1
- package/dist/{useUXClick-Dfsi32W_.js.map → useUXClick-WPLnES0o.js.map} +1 -1
- package/dist/{useUXEvents-DZ5ct4dw.js → useUXEvents-CS2mMGeO.js} +1 -1
- package/dist/{useUXEvents-DZ5ct4dw.js.map → useUXEvents-CS2mMGeO.js.map} +1 -1
- package/dist/{useUXScrollDepth-BQZKqJkm.js → useUXScrollDepth-BO-lAcVy.js} +1 -1
- package/dist/{useUXScrollDepth-BQZKqJkm.js.map → useUXScrollDepth-BO-lAcVy.js.map} +1 -1
- package/dist/uxsdk.js +1 -1
- package/dist/writer.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUXScrollDepth-
|
|
1
|
+
{"version":3,"file":"useUXScrollDepth-BO-lAcVy.js","sources":["../src/uxsdk/useUXScrollDepth.ts"],"sourcesContent":["import React, {useEffect, useRef} from \"react\";\n\nexport interface ScrollDepthOptions {\n thresholds?: number[]; // Default: [25, 50, 75, 100]\n onDepthReached?: (depth: number) => void;\n}\n\nexport function useUXScrollDepth(\n ref: React.RefObject<HTMLElement | null>, \n options: ScrollDepthOptions = {}\n) {\n const { thresholds = [25, 50, 75, 100], onDepthReached } = options;\n const reachedDepthsRef = useRef<Set<number>>(new Set());\n\n useEffect(() => {\n if (!ref.current) {\n return\n }\n\n function handleScroll() {\n const element = ref.current;\n if (!element) return;\n\n const { scrollTop, scrollHeight, clientHeight } = element;\n \n // Calculate current scroll percentage\n const scrollableHeight = scrollHeight - clientHeight;\n if (scrollableHeight <= 0) return;\n \n const scrollPercentage = Math.round((scrollTop / scrollableHeight) * 100);\n \n // Check which thresholds have been reached\n thresholds.forEach(threshold => {\n if (scrollPercentage >= threshold && !reachedDepthsRef.current.has(threshold)) {\n reachedDepthsRef.current.add(threshold);\n onDepthReached?.(threshold);\n }\n });\n }\n\n const element = ref.current;\n element.addEventListener('scroll', handleScroll);\n\n return () => {\n element.removeEventListener('scroll', handleScroll);\n };\n }, [ref.current, thresholds, onDepthReached]);\n}\n\n"],"names":["useUXScrollDepth","ref","options","thresholds","onDepthReached","reachedDepthsRef","useRef","Set","useEffect","current","handleScroll","element","scrollTop","scrollHeight","clientHeight","scrollableHeight","scrollPercentage","Math","round","forEach","threshold","has","add","addEventListener","removeEventListener"],"mappings":"8CAOO,SAASA,EACZC,EACAC,EAA8B,IAE9B,MAAMC,WAAEA,EAAa,CAAC,GAAI,GAAI,GAAI,KAAIC,eAAEA,GAAmBF,EACrDG,EAAmBC,EAAoB,IAAIC,KAEjDC,EAAU,KACN,IAAKP,EAAIQ,QACL,OAGJ,SAASC,IACL,MAAMC,EAAUV,EAAIQ,QACpB,IAAKE,EAAS,OAEd,MAAMC,UAAEA,EAASC,aAAEA,EAAYC,aAAEA,GAAiBH,EAG5CI,EAAmBF,EAAeC,EACxC,GAAIC,GAAoB,EAAG,OAE3B,MAAMC,EAAmBC,KAAKC,MAAON,EAAYG,EAAoB,KAGrEZ,EAAWgB,QAAQC,IACXJ,GAAoBI,IAAcf,EAAiBI,QAAQY,IAAID,KAC/Df,EAAiBI,QAAQa,IAAIF,GAC7BhB,IAAiBgB,KAG7B,CAEA,MAAMT,EAAUV,EAAIQ,QAGpB,OAFAE,EAAQY,iBAAiB,SAAUb,GAE5B,KACHC,EAAQa,oBAAoB,SAAUd,KAE3C,CAACT,EAAIQ,QAASN,EAAYC,GACjC"}
|
package/dist/uxsdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{E as EVENT_COMPONENT_TAB_CHANGE,u as useUXEvents}from"./useUXEvents-
|
|
1
|
+
export{E as EVENT_COMPONENT_TAB_CHANGE,u as useUXEvents}from"./useUXEvents-CS2mMGeO.js";export{u as useUXClick}from"./useUXClick-WPLnES0o.js";export{u as useUXScrollDepth}from"./useUXScrollDepth-BO-lAcVy.js";import{useRef as e,useCallback as r,useEffect as t}from"react";import"openux-js";function n(n,u,c){const o=e(!1),s=e(!1),i=e(null),l=e(0),m=r(()=>{const e=Date.now();e-l.current>1e3&&(o.current=!0,l.current=e,u())},[u]),a=r(()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{o.current=!1,i.current=null},50)},[]);t(()=>{if(n.current)return n.current.addEventListener("mouseenter",m),n.current.addEventListener("mouseleave",a),()=>{n.current&&(n.current.removeEventListener("mouseenter",m),n.current.removeEventListener("mouseleave",a)),i.current&&clearTimeout(i.current)}},[n.current,m,a]);const v=r(()=>{i.current&&(clearTimeout(i.current),i.current=null),s.current=!1,o.current&&(o.current=!1,s.current=!0,c())},[c]);t(()=>(document.addEventListener("visibilitychange",v),()=>{document.removeEventListener("visibilitychange",v),i.current&&clearTimeout(i.current)}),[v])}export{n as useUXUnreachableElementTracker};
|
|
2
2
|
//# sourceMappingURL=uxsdk.js.map
|
package/dist/writer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{A as Anchor,B as Badge,c as Banner,G as GuideCard,H as Heading,I as IconSocial,L as List,a as ListOl,N as NavLinks,S as Steps,T as Table,b as Tabs,V as VideoGuide}from"./VideoGuide-
|
|
1
|
+
export{A as Anchor,B as Badge,c as Banner,G as GuideCard,H as Heading,I as IconSocial,L as List,a as ListOl,N as NavLinks,S as Steps,T as Table,b as Tabs,V as VideoGuide}from"./VideoGuide-CN2sFTjr.js";export{B as Blockquote,c as Breadcrumbs,a as Callout,d as Card,b as Code,C as ColorSchemeButton,D as Details,H as Hr,I as Image,U as Update,u as useColorScheme}from"./Update-B2r4fEw4.js";export{B as Button}from"./Button-DgMQDvfH.js";import{I as e}from"./Icon-CGYAcXsi.js";export{a as IconProvider}from"./Icon-CGYAcXsi.js";import r from"react";export{T as Text}from"./TabsAnalytics-DPnJGce8.js";import"./useUXEvents-CS2mMGeO.js";import"radix-ui";import"lucide-react";import"./useUXClick-WPLnES0o.js";import"openux-js";function t(e){return e}function s({children:e,className:a}){return r.createElement("pre",{className:`p1vb39qj ${a||""}`},e)}function o(e){return e}var n="TocCard-module_TocCardHost__pT0XJ";function i({title:a,description:t,href:s,className:o,icon:i,as:c}){const m=c||l;return r.createElement("xyd-toccard",{className:`${n} ${o||""}`},r.createElement("div",{part:"container"},r.createElement(m,{part:"link",href:s,target:"_blank",rel:"noreferrer"},r.createElement("div",{part:"title-container"},r.createElement("div",{part:"title"},a),i&&r.createElement(e,{name:i,size:16})),r.createElement("div",{part:"description"},t))))}function l({children:e,href:a,...t}){return r.createElement("a",{href:a,...t},e)}export{t as DetailsPropsProps,e as Icon,s as Pre,o as TabsProps,i as TocCard};
|
|
2
2
|
//# sourceMappingURL=writer.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyd-js/components",
|
|
3
|
-
"version": "0.0.0-build-
|
|
3
|
+
"version": "0.0.0-build-43c02e0-20251224011947",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@code-hike/lighter": "^1.0.3",
|
|
50
50
|
"openux-js": "0.0.0-pre.1",
|
|
51
51
|
"react": "^19.1.0",
|
|
52
|
-
"@xyd-js/core": "0.0.0-build-
|
|
52
|
+
"@xyd-js/core": "0.0.0-build-43c02e0-20251224011947"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@linaria/core": "^6.2.0",
|