maquinaweb-ui 2.77.0 → 2.77.2
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.
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { Loader2 } from "lucide-react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/server-infinite-scroll/server-infinite-scroll-observer.tsx
|
|
8
|
-
function ServerInfiniteScrollObserver({ direction, loadPage, containerId, loadingState, rootMargin = "
|
|
8
|
+
function ServerInfiniteScrollObserver({ direction, loadPage, containerId, loadingState, rootMargin = "120px 0px", threshold = .1 }) {
|
|
9
9
|
const observerRef = useRef(null);
|
|
10
10
|
const isLoadingRef = useRef(false);
|
|
11
11
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-infinite-scroll-observer.js","names":[],"sources":["../../src/components/server-infinite-scroll/server-infinite-scroll-observer.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { Loader2 } from 'lucide-react';\n\nimport type { ServerInfiniteScrollDirection } from './types';\n\ntype ServerInfiniteScrollObserverProps = {\n direction: ServerInfiniteScrollDirection;\n loadPage: () => Promise<void>;\n containerId?: string;\n loadingState?: React.ReactNode;\n rootMargin?: string;\n threshold?: number;\n};\n\nfunction ServerInfiniteScrollObserver({\n direction,\n loadPage,\n containerId,\n loadingState,\n rootMargin = '
|
|
1
|
+
{"version":3,"file":"server-infinite-scroll-observer.js","names":[],"sources":["../../src/components/server-infinite-scroll/server-infinite-scroll-observer.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { Loader2 } from 'lucide-react';\n\nimport type { ServerInfiniteScrollDirection } from './types';\n\ntype ServerInfiniteScrollObserverProps = {\n direction: ServerInfiniteScrollDirection;\n loadPage: () => Promise<void>;\n containerId?: string;\n loadingState?: React.ReactNode;\n rootMargin?: string;\n threshold?: number;\n};\n\nfunction ServerInfiniteScrollObserver({\n direction,\n loadPage,\n containerId,\n loadingState,\n rootMargin = '120px 0px',\n threshold = 0.1,\n}: ServerInfiniteScrollObserverProps) {\n const observerRef = useRef<HTMLDivElement>(null);\n const isLoadingRef = useRef(false);\n const [isLoading, setIsLoading] = useState(false);\n\n useEffect(() => {\n const element = observerRef.current;\n if (!element) return;\n\n const observer = new IntersectionObserver(\n async ([entry]) => {\n if (!entry?.isIntersecting || isLoadingRef.current) return;\n\n isLoadingRef.current = true;\n setIsLoading(true);\n\n try {\n await loadPage();\n } catch (error) {\n console.error('ServerInfiniteScroll: error loading page', error);\n } finally {\n isLoadingRef.current = false;\n setIsLoading(false);\n }\n },\n {\n root: containerId ? document.getElementById(containerId) : null,\n rootMargin,\n threshold,\n }\n );\n\n observer.observe(element);\n\n return () => {\n observer.disconnect();\n };\n }, [containerId, loadPage, rootMargin, threshold]);\n\n return (\n <div\n className=\"flex min-h-10 w-full items-center justify-center py-4\"\n data-direction={direction}\n data-server-infinite-scroll-observer\n ref={observerRef}\n >\n {isLoading &&\n (loadingState ?? (\n <Loader2 className=\"size-4 animate-spin text-muted-foreground\" />\n ))}\n </div>\n );\n}\n\nexport { ServerInfiniteScrollObserver };\n"],"mappings":";;;;;;;AAiBA,SAAS,6BAA6B,EACpC,WACA,UACA,aACA,cACA,aAAa,aACb,YAAY,MACwB;CACpC,MAAM,cAAc,OAAuB,KAAK;CAChD,MAAM,eAAe,OAAO,MAAM;CAClC,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;AAEjD,iBAAgB;EACd,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;EAEd,MAAM,WAAW,IAAI,qBACnB,OAAO,CAAC,WAAW;AACjB,OAAI,CAAC,OAAO,kBAAkB,aAAa,QAAS;AAEpD,gBAAa,UAAU;AACvB,gBAAa,KAAK;AAElB,OAAI;AACF,UAAM,UAAU;YACT,OAAO;AACd,YAAQ,MAAM,4CAA4C,MAAM;aACxD;AACR,iBAAa,UAAU;AACvB,iBAAa,MAAM;;KAGvB;GACE,MAAM,cAAc,SAAS,eAAe,YAAY,GAAG;GAC3D;GACA;GACD,CACF;AAED,WAAS,QAAQ,QAAQ;AAEzB,eAAa;AACX,YAAS,YAAY;;IAEtB;EAAC;EAAa;EAAU;EAAY;EAAU,CAAC;AAElD,QACE,oBAAC,OAAD;EACE,WAAU;EACV,kBAAgB;EAChB;EACA,KAAK;YAEJ,cACE,gBACC,oBAAC,SAAD,EAAS,WAAU,6CAA8C;EAEjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maquinaweb-ui",
|
|
3
|
-
"version": "2.77.
|
|
3
|
+
"version": "2.77.2",
|
|
4
4
|
"description": "A minimal React component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"dev": "concurrently \"cosmos --expose-imports\" \"next dev --port 3421\"",
|
|
72
72
|
"build": "tsdown && bun run postbuild",
|
|
73
73
|
"postbuild": "bun scripts/update-exports.ts",
|
|
74
|
-
"build:vercel": "
|
|
74
|
+
"build:vercel": "cosmos-export --config cosmos.config.vercel.json --expose-imports && rm -rf ./public/cosmos-ui && tsgo --noEmit && mkdir -p ./public/cosmos-ui && cp -R ./cosmos-export/. ./public/cosmos-ui && next build",
|
|
75
75
|
"prepublishOnly": "bun run build",
|
|
76
76
|
"prepare": "husky",
|
|
77
77
|
"clean-exports": "bun scripts/clean-exports.ts",
|