js-cloudimage-360-view 4.8.0 → 4.9.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.
- package/README.md +69 -3
- package/dist/js-cloudimage-360-view.min.js +7 -7
- package/dist/react/ci360-B2r9u7br.js +65 -0
- package/dist/react/ci360-B2r9u7br.js.map +1 -0
- package/dist/react/{ci360-BJ_JCEiA.mjs → ci360-BFobl9uu.mjs} +1076 -859
- package/dist/react/ci360-BFobl9uu.mjs.map +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +10 -0
- package/dist/react/index.js +182 -165
- package/dist/react/index.js.map +1 -1
- package/dist/react/style.css +1 -1
- package/package.json +2 -1
- package/src/react/types.d.ts +10 -0
- package/dist/react/ci360-BJ_JCEiA.mjs.map +0 -1
- package/dist/react/ci360-DdSVW_xW.js +0 -65
- package/dist/react/ci360-DdSVW_xW.js.map +0 -1
package/dist/react/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("react/jsx-runtime"),n=require("react");let R=null;function I(f,t){const[v,y]=n.useState(!1),a=n.useRef(null),l=n.useRef(null),m=n.useId();n.useEffect(()=>{if(typeof window>"u"||!f.current||t.autoInit===!1)return;let u=!0;const s=f.current;return(async()=>{try{if(R||(R=(await Promise.resolve().then(()=>require("./ci360-B2r9u7br.js"))).default),!s||!u)return;s.id||(s.id=`ci360-${m.replace(/:/g,"")}`);const i={...t,onReady:c=>{var p;u&&(y(!0),(p=t.onReady)==null||p.call(t,c))}};l.current=new R,a.current=l.current.init(s,i)}catch(i){console.error("Failed to initialize CI360 viewer:",i)}})(),()=>{if(u=!1,a.current){try{a.current.destroy()}catch{}a.current=null}l.current=null,y(!1)}},[t.folder,t.filenameX,t.filenameY,t.filenameGrid,t.imageListX,t.imageListY,t.imageListGrid,t.amountX,t.amountY,t.hotspots,t.theme,t.aspectRatio,t.cropAspectRatio,t.cropGravity,m]);const C=n.useCallback(()=>a.current,[]);return{viewer:a.current,isReady:v,getViewer:C}}const Xe=(f,t)=>{const{id:v,className:y,style:a,folder:l,apiVersion:m,filenameX:C,filenameY:u,filenameGrid:s,imageListX:w,imageListY:i,imageListGrid:c,indexZeroBase:p,amountX:z,amountY:g,draggable:S,swipeable:V,keys:L,keysReverse:T,autoplay:O,autoplayBehavior:P,playOnce:Z,speed:b,autoplayReverse:A,dragSpeed:k,dragReverse:X,stopAtEdges:Y,stopAtEdgesX:E,stopAtEdgesY:F,inertia:G,fullscreen:q,magnifier:x,pointerZoom:B,pinchZoom:D,zoomMax:H,zoomStep:M,zoomControls:j,zoomControlsPosition:N,scrollHint:$,bottomCircle:J,bottomCircleOffset:K,initialIconShown:Q,hide360Logo:U,logoSrc:W,imageInfo:_,hints:ee,theme:oe,markerTheme:te,brandColor:re,ciToken:ne,ciFilters:ae,ciTransformation:se,cropAspectRatio:ie,cropGravity:le,lazyload:ue,hotspots:me,hotspotTrigger:ce,hotspotTimelineOnClick:pe,aspectRatio:de,onReady:fe,onLoad:ye,onSpin:Ce,onAutoplayStart:ve,onAutoplayStop:we,onFullscreenOpen:Re,onFullscreenClose:Ie,onZoomIn:he,onZoomOut:ze,onDragStart:ge,onDragEnd:Se,onHotspotOpen:Ve,onHotspotClose:Le,onProductClick:Te,onNavigate:Oe,onError:Pe,...be}=f,Ze=n.useRef(null),Ae=n.useMemo(()=>({folder:l,apiVersion:m,filenameX:C,filenameY:u,filenameGrid:s,imageListX:w,imageListY:i,imageListGrid:c,indexZeroBase:p,amountX:z,amountY:g,draggable:S,swipeable:V,keys:L,keysReverse:T,autoplay:O,autoplayBehavior:P,playOnce:Z,speed:b,autoplayReverse:A,dragSpeed:k,dragReverse:X,stopAtEdges:Y,stopAtEdgesX:E,stopAtEdgesY:F,inertia:G,fullscreen:q,magnifier:x,pointerZoom:B,pinchZoom:D,zoomMax:H,zoomStep:M,zoomControls:j,zoomControlsPosition:N,scrollHint:$,bottomCircle:J,bottomCircleOffset:K,initialIconShown:Q,hide360Logo:U,logoSrc:W,imageInfo:_,hints:ee,theme:oe,markerTheme:te,brandColor:re,ciToken:ne,ciFilters:ae,ciTransformation:se,cropAspectRatio:ie,cropGravity:le,lazyload:ue,hotspots:me,hotspotTrigger:ce,hotspotTimelineOnClick:pe,aspectRatio:de,onReady:fe,onLoad:ye,onSpin:Ce,onAutoplayStart:ve,onAutoplayStop:we,onFullscreenOpen:Re,onFullscreenClose:Ie,onZoomIn:he,onZoomOut:ze,onDragStart:ge,onDragEnd:Se,onHotspotOpen:Ve,onHotspotClose:Le,onProductClick:Te,onNavigate:Oe,onError:Pe}),[l,m,C,u,s,w,i,c,p,z,g,S,V,L,T,O,P,Z,b,A,k,X,Y,E,F,G,q,x,B,D,H,M,j,N,$,J,K,Q,U,W,_,ee,oe,te,re,ne,ae,se,ie,le,ue,me,ce,pe,de,fe,ye,Ce,ve,we,Re,Ie,he,ze,ge,Se,Ve,Le,Te,Oe,Pe]),{getViewer:r}=I(Ze,Ae);return n.useImperativeHandle(t,()=>({moveLeft:(e=1)=>{var o;return(o=r())==null?void 0:o.moveLeft(!1,e)},moveRight:(e=1)=>{var o;return(o=r())==null?void 0:o.moveRight(!1,e)},moveTop:(e=1)=>{var o;return(o=r())==null?void 0:o.moveTop(!1,e)},moveBottom:(e=1)=>{var o;return(o=r())==null?void 0:o.moveBottom(!1,e)},play:()=>{var e;return(e=r())==null?void 0:e.play()},stop:()=>{var e;return(e=r())==null?void 0:e.stopAutoplay()},zoomIn:()=>{var e,o;return(o=(e=r())==null?void 0:e.zoomPan)==null?void 0:o.zoomIn()},zoomOut:()=>{var e,o;return(o=(e=r())==null?void 0:e.zoomPan)==null?void 0:o.zoomOut()},resetZoom:()=>{var e,o;return(o=(e=r())==null?void 0:e.zoomPan)==null?void 0:o.resetZoom()},setZoom:e=>{var o,d;return(d=(o=r())==null?void 0:o.zoomPan)==null?void 0:d.setZoom(e)},goToFrame:(e,o)=>{var d;return(d=r())==null?void 0:d.animateToFrame(e,o)},getViewer:()=>r()}),[r]),ke.jsx("div",{ref:Ze,id:v,className:y,style:a,...be})},h=n.forwardRef(Xe);h.displayName="CI360Viewer";exports.CI360Viewer=h;exports.CI360ViewerDefault=h;exports.useCI360=I;exports.useCI360Default=I;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/react/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/react/useCI360.ts","../../src/react/CI360Viewer.tsx"],"sourcesContent":["import { useEffect, useRef, useState, useId, useCallback, type RefObject } from 'react';\nimport type {\n CI360Config,\n CI360ViewerInstance,\n UseCI360Return,\n UseCI360Options,\n} from './types';\n\n// Import CI360 class dynamically to avoid SSR issues\nlet CI360Class: any = null;\n\n/**\n * Custom hook for integrating CI360 viewer with React\n *\n * @param containerRef - React ref to the container element\n * @param config - CI360 configuration options\n * @returns Object containing viewer instance and ready state\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const containerRef = useRef<HTMLDivElement>(null);\n * const { viewer, isReady } = useCI360(containerRef, {\n * folder: 'https://example.com/images/',\n * filenameX: 'image-{index}.jpg',\n * amountX: 36,\n * });\n *\n * return <div ref={containerRef} />;\n * }\n * ```\n */\nexport function useCI360(\n containerRef: RefObject<HTMLDivElement | null>,\n config: UseCI360Options\n): UseCI360Return {\n const [isReady, setIsReady] = useState(false);\n const viewerRef = useRef<CI360ViewerInstance | null>(null);\n const ci360Ref = useRef<any>(null);\n const uniqueId = useId();\n\n // Initialize viewer\n useEffect(() => {\n // SSR guard\n if (typeof window === 'undefined') return;\n if (!containerRef.current) return;\n if (config.autoInit === false) return;\n\n let isMounted = true;\n const container = containerRef.current;\n\n const initViewer = async () => {\n try {\n // Dynamically import CI360 to avoid SSR issues\n if (!CI360Class) {\n const module = await import('../ci360');\n CI360Class = module.default;\n }\n\n if (!container || !isMounted) return;\n\n // Set a unique ID on the container if not present\n if (!container.id) {\n container.id = `ci360-${uniqueId.replace(/:/g, '')}`;\n }\n\n // Wrap user callbacks to update React state\n const wrappedConfig: CI360Config = {\n ...config,\n onReady: (data) => {\n if (isMounted) {\n setIsReady(true);\n config.onReady?.(data);\n }\n },\n };\n\n // Create CI360 instance and initialize viewer\n ci360Ref.current = new CI360Class();\n viewerRef.current = ci360Ref.current.init(container, wrappedConfig);\n } catch (error) {\n console.error('Failed to initialize CI360 viewer:', error);\n }\n };\n\n initViewer();\n\n // Cleanup on unmount or when dependencies change\n return () => {\n isMounted = false;\n if (viewerRef.current) {\n try {\n viewerRef.current.destroy();\n } catch (e) {\n // Ignore errors during cleanup - element may already be detached\n }\n viewerRef.current = null;\n }\n ci360Ref.current = null;\n setIsReady(false);\n };\n }, [\n config.folder,\n config.filenameX,\n config.filenameY,\n config.imageListX,\n config.imageListY,\n config.amountX,\n config.amountY,\n config.hotspots,\n config.theme,\n config.aspectRatio,\n config.cropAspectRatio,\n config.cropGravity,\n uniqueId,\n ]);\n\n // Stable getter to always return current viewer (avoids stale closures)\n const getViewer = useCallback(() => viewerRef.current, []);\n\n return {\n viewer: viewerRef.current,\n isReady,\n getViewer,\n };\n}\n\nexport default useCI360;\n","import {\n useRef,\n useImperativeHandle,\n forwardRef,\n useMemo,\n type ForwardRefRenderFunction,\n} from 'react';\nimport { useCI360 } from './useCI360';\nimport type {\n CI360ViewerProps,\n CI360ViewerRef,\n CI360Config,\n} from './types';\n\n/**\n * CI360Viewer React Component\n *\n * A declarative React wrapper for the CI360 360-degree image viewer.\n *\n * @example\n * ```tsx\n * import { CI360Viewer } from 'js-cloudimage-360-view/react';\n * import 'js-cloudimage-360-view/css';\n *\n * function ProductView() {\n * return (\n * <CI360Viewer\n * folder=\"https://example.com/images/\"\n * filenameX=\"product-{index}.jpg\"\n * amountX={36}\n * autoplay\n * fullscreen\n * />\n * );\n * }\n * ```\n *\n * @example With ref for imperative control\n * ```tsx\n * import { useRef } from 'react';\n * import { CI360Viewer, CI360ViewerRef } from 'js-cloudimage-360-view/react';\n *\n * function ProductView() {\n * const viewerRef = useRef<CI360ViewerRef>(null);\n *\n * return (\n * <>\n * <CI360Viewer\n * ref={viewerRef}\n * folder=\"https://example.com/images/\"\n * filenameX=\"{index}.jpg\"\n * amountX={36}\n * onSpin={(e) => console.log(`Frame: ${e.activeImageX}`)}\n * />\n * <button onClick={() => viewerRef.current?.play()}>Play</button>\n * <button onClick={() => viewerRef.current?.stop()}>Stop</button>\n * </>\n * );\n * }\n * ```\n */\nconst CI360ViewerComponent: ForwardRefRenderFunction<\n CI360ViewerRef,\n CI360ViewerProps\n> = (props, ref) => {\n const {\n // Container props\n id,\n className,\n style,\n\n // Image source\n folder,\n apiVersion,\n filenameX,\n filenameY,\n imageListX,\n imageListY,\n indexZeroBase,\n amountX,\n amountY,\n\n // Behavior\n draggable,\n swipeable,\n keys,\n keysReverse,\n autoplay,\n autoplayBehavior,\n playOnce,\n speed,\n autoplayReverse,\n dragSpeed,\n dragReverse,\n stopAtEdges,\n inertia,\n\n // UI Features\n fullscreen,\n magnifier,\n pointerZoom,\n pinchZoom,\n zoomMax,\n zoomStep,\n zoomControls,\n zoomControlsPosition,\n scrollHint,\n bottomCircle,\n bottomCircleOffset,\n initialIconShown,\n hide360Logo,\n logoSrc,\n imageInfo,\n hints,\n theme,\n markerTheme,\n brandColor,\n\n // Cloudimage CDN\n ciToken,\n ciFilters,\n ciTransformation,\n cropAspectRatio,\n cropGravity,\n\n // Loading\n lazyload,\n\n // Hotspots\n hotspots,\n hotspotTrigger,\n hotspotTimelineOnClick,\n\n // Container\n aspectRatio,\n\n // Event callbacks\n onReady,\n onLoad,\n onSpin,\n onAutoplayStart,\n onAutoplayStop,\n onFullscreenOpen,\n onFullscreenClose,\n onZoomIn,\n onZoomOut,\n onDragStart,\n onDragEnd,\n onHotspotOpen,\n onHotspotClose,\n onProductClick,\n onError,\n\n ...restProps\n } = props;\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Memoize config to prevent unnecessary re-initializations\n const config = useMemo<CI360Config>(\n () => ({\n // Image source\n folder,\n apiVersion,\n filenameX,\n filenameY,\n imageListX,\n imageListY,\n indexZeroBase,\n amountX,\n amountY,\n\n // Behavior\n draggable,\n swipeable,\n keys,\n keysReverse,\n autoplay,\n autoplayBehavior,\n playOnce,\n speed,\n autoplayReverse,\n dragSpeed,\n dragReverse,\n stopAtEdges,\n inertia,\n\n // UI Features\n fullscreen,\n magnifier,\n pointerZoom,\n pinchZoom,\n zoomMax,\n zoomStep,\n zoomControls,\n zoomControlsPosition,\n scrollHint,\n bottomCircle,\n bottomCircleOffset,\n initialIconShown,\n hide360Logo,\n logoSrc,\n imageInfo,\n hints,\n theme,\n markerTheme,\n brandColor,\n\n // Cloudimage CDN\n ciToken,\n ciFilters,\n ciTransformation,\n cropAspectRatio,\n cropGravity,\n\n // Loading\n lazyload,\n\n // Hotspots\n hotspots,\n hotspotTrigger,\n hotspotTimelineOnClick,\n\n // Container\n aspectRatio,\n\n // Event callbacks\n onReady,\n onLoad,\n onSpin,\n onAutoplayStart,\n onAutoplayStop,\n onFullscreenOpen,\n onFullscreenClose,\n onZoomIn,\n onZoomOut,\n onDragStart,\n onDragEnd,\n onHotspotOpen,\n onHotspotClose,\n onProductClick,\n onError,\n }),\n [\n // Image source\n folder,\n apiVersion,\n filenameX,\n filenameY,\n imageListX,\n imageListY,\n indexZeroBase,\n amountX,\n amountY,\n\n // Behavior\n draggable,\n swipeable,\n keys,\n keysReverse,\n autoplay,\n autoplayBehavior,\n playOnce,\n speed,\n autoplayReverse,\n dragSpeed,\n dragReverse,\n stopAtEdges,\n inertia,\n\n // UI Features\n fullscreen,\n magnifier,\n pointerZoom,\n pinchZoom,\n zoomMax,\n zoomStep,\n zoomControls,\n zoomControlsPosition,\n scrollHint,\n bottomCircle,\n bottomCircleOffset,\n initialIconShown,\n hide360Logo,\n logoSrc,\n imageInfo,\n hints,\n theme,\n markerTheme,\n brandColor,\n\n // Cloudimage CDN\n ciToken,\n ciFilters,\n ciTransformation,\n cropAspectRatio,\n cropGravity,\n\n // Loading\n lazyload,\n\n // Hotspots\n hotspots,\n hotspotTrigger,\n hotspotTimelineOnClick,\n\n // Container\n aspectRatio,\n\n // Event callbacks\n onReady,\n onLoad,\n onSpin,\n onAutoplayStart,\n onAutoplayStop,\n onFullscreenOpen,\n onFullscreenClose,\n onZoomIn,\n onZoomOut,\n onDragStart,\n onDragEnd,\n onHotspotOpen,\n onHotspotClose,\n onProductClick,\n onError,\n ]\n );\n\n const { getViewer } = useCI360(containerRef, config);\n\n // Expose imperative methods via ref\n // Use getViewer() inside methods to always get the current viewer instance,\n // avoiding stale closure issues when the viewer initializes after first render\n useImperativeHandle(\n ref,\n () => ({\n moveLeft: (steps = 1) => getViewer()?.moveLeft(false, steps),\n moveRight: (steps = 1) => getViewer()?.moveRight(false, steps),\n moveTop: (steps = 1) => getViewer()?.moveTop(false, steps),\n moveBottom: (steps = 1) => getViewer()?.moveBottom(false, steps),\n play: () => getViewer()?.play(),\n stop: () => getViewer()?.stopAutoplay(),\n zoomIn: () => getViewer()?.zoomPan?.zoomIn(),\n zoomOut: () => getViewer()?.zoomPan?.zoomOut(),\n resetZoom: () => getViewer()?.zoomPan?.resetZoom(),\n setZoom: (level: number) => getViewer()?.zoomPan?.setZoom(level),\n goToFrame: (frame: number, hotspotId?: string) =>\n getViewer()?.animateToFrame(frame, hotspotId),\n getViewer: () => getViewer(),\n }),\n [getViewer]\n );\n\n return (\n <div\n ref={containerRef}\n id={id}\n className={className}\n style={style}\n {...restProps}\n />\n );\n};\n\nexport const CI360Viewer = forwardRef(CI360ViewerComponent);\nCI360Viewer.displayName = 'CI360Viewer';\n\nexport default CI360Viewer;\n"],"names":["CI360Class","useCI360","containerRef","config","isReady","setIsReady","useState","viewerRef","useRef","ci360Ref","uniqueId","useId","useEffect","isMounted","container","wrappedConfig","data","_a","error","getViewer","useCallback","CI360ViewerComponent","props","ref","id","className","style","folder","apiVersion","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY","draggable","swipeable","keys","keysReverse","autoplay","autoplayBehavior","playOnce","speed","autoplayReverse","dragSpeed","dragReverse","stopAtEdges","inertia","fullscreen","magnifier","pointerZoom","pinchZoom","zoomMax","zoomStep","zoomControls","zoomControlsPosition","scrollHint","bottomCircle","bottomCircleOffset","initialIconShown","hide360Logo","logoSrc","imageInfo","hints","theme","markerTheme","brandColor","ciToken","ciFilters","ciTransformation","cropAspectRatio","cropGravity","lazyload","hotspots","hotspotTrigger","hotspotTimelineOnClick","aspectRatio","onReady","onLoad","onSpin","onAutoplayStart","onAutoplayStop","onFullscreenOpen","onFullscreenClose","onZoomIn","onZoomOut","onDragStart","onDragEnd","onHotspotOpen","onHotspotClose","onProductClick","onError","restProps","useMemo","useImperativeHandle","steps","_b","level","frame","hotspotId","jsx","CI360Viewer","forwardRef"],"mappings":"yIASA,IAAIA,EAAkB,KAuBf,SAASC,EACdC,EACAC,EACgB,CAChB,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EACtCC,EAAYC,EAAAA,OAAmC,IAAI,EACnDC,EAAWD,EAAAA,OAAY,IAAI,EAC3BE,EAAWC,EAAAA,MAAA,EAGjBC,EAAAA,UAAU,IAAM,CAId,GAFI,OAAO,OAAW,KAClB,CAACV,EAAa,SACdC,EAAO,WAAa,GAAO,OAE/B,IAAIU,EAAY,GAChB,MAAMC,EAAYZ,EAAa,QAoC/B,OAlCmB,SAAY,CAC7B,GAAI,CAOF,GALKF,IAEHA,GADe,MAAM,QAAA,QAAA,EAAA,KAAA,IAAA,QAAO,qBAAU,CAAA,GAClB,SAGlB,CAACc,GAAa,CAACD,EAAW,OAGzBC,EAAU,KACbA,EAAU,GAAK,SAASJ,EAAS,QAAQ,KAAM,EAAE,CAAC,IAIpD,MAAMK,EAA6B,CACjC,GAAGZ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F,EAAAE,MAAA,YAAAF,EAAa,UAAb,YAAAgF,EAAsB,WACrC,UAAW,IAAA,SAAM,OAAAA,GAAAhF,EAAAE,MAAA,YAAAF,EAAa,UAAb,YAAAgF,EAAsB,aACvC,QAAUC,GAAA,SAAkB,OAAAD,GAAAhF,EAAAE,MAAA,YAAAF,EAAa,UAAb,YAAAgF,EAAsB,QAAQC,IAC1D,UAAW,CAACC,EAAeC,IAAA,OACzB,OAAAnF,EAAAE,MAAA,YAAAF,EAAa,eAAekF,EAAOC,IACrC,UAAW,IAAMjF,EAAA,CAAU,GAE7B,CAACA,CAAS,CAAA,EAIVkF,GAAAA,IAAC,MAAA,CACC,IAAKnG,GACL,GAAAsB,EACA,UAAAC,EACA,MAAAC,EACC,GAAGmE,EAAA,CAAA,CAGV,EAEaS,EAAcC,EAAAA,WAAWlF,EAAoB,EAC1DiF,EAAY,YAAc"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/react/useCI360.ts","../../src/react/CI360Viewer.tsx"],"sourcesContent":["import { useEffect, useRef, useState, useId, useCallback, type RefObject } from 'react';\nimport type {\n CI360Config,\n CI360ViewerInstance,\n UseCI360Return,\n UseCI360Options,\n} from './types';\n\n// Import CI360 class dynamically to avoid SSR issues\nlet CI360Class: any = null;\n\n/**\n * Custom hook for integrating CI360 viewer with React\n *\n * @param containerRef - React ref to the container element\n * @param config - CI360 configuration options\n * @returns Object containing viewer instance and ready state\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const containerRef = useRef<HTMLDivElement>(null);\n * const { viewer, isReady } = useCI360(containerRef, {\n * folder: 'https://example.com/images/',\n * filenameX: 'image-{index}.jpg',\n * amountX: 36,\n * });\n *\n * return <div ref={containerRef} />;\n * }\n * ```\n */\nexport function useCI360(\n containerRef: RefObject<HTMLDivElement | null>,\n config: UseCI360Options\n): UseCI360Return {\n const [isReady, setIsReady] = useState(false);\n const viewerRef = useRef<CI360ViewerInstance | null>(null);\n const ci360Ref = useRef<any>(null);\n const uniqueId = useId();\n\n // Initialize viewer\n useEffect(() => {\n // SSR guard\n if (typeof window === 'undefined') return;\n if (!containerRef.current) return;\n if (config.autoInit === false) return;\n\n let isMounted = true;\n const container = containerRef.current;\n\n const initViewer = async () => {\n try {\n // Dynamically import CI360 to avoid SSR issues\n if (!CI360Class) {\n const module = await import('../ci360');\n CI360Class = module.default;\n }\n\n if (!container || !isMounted) return;\n\n // Set a unique ID on the container if not present\n if (!container.id) {\n container.id = `ci360-${uniqueId.replace(/:/g, '')}`;\n }\n\n // Wrap user callbacks to update React state\n const wrappedConfig: CI360Config = {\n ...config,\n onReady: (data) => {\n if (isMounted) {\n setIsReady(true);\n config.onReady?.(data);\n }\n },\n };\n\n // Create CI360 instance and initialize viewer\n ci360Ref.current = new CI360Class();\n viewerRef.current = ci360Ref.current.init(container, wrappedConfig);\n } catch (error) {\n console.error('Failed to initialize CI360 viewer:', error);\n }\n };\n\n initViewer();\n\n // Cleanup on unmount or when dependencies change\n return () => {\n isMounted = false;\n if (viewerRef.current) {\n try {\n viewerRef.current.destroy();\n } catch (e) {\n // Ignore errors during cleanup - element may already be detached\n }\n viewerRef.current = null;\n }\n ci360Ref.current = null;\n setIsReady(false);\n };\n }, [\n config.folder,\n config.filenameX,\n config.filenameY,\n config.filenameGrid,\n config.imageListX,\n config.imageListY,\n config.imageListGrid,\n config.amountX,\n config.amountY,\n config.hotspots,\n config.theme,\n config.aspectRatio,\n config.cropAspectRatio,\n config.cropGravity,\n uniqueId,\n ]);\n\n // Stable getter to always return current viewer (avoids stale closures)\n const getViewer = useCallback(() => viewerRef.current, []);\n\n return {\n viewer: viewerRef.current,\n isReady,\n getViewer,\n };\n}\n\nexport default useCI360;\n","import {\n useRef,\n useImperativeHandle,\n forwardRef,\n useMemo,\n type ForwardRefRenderFunction,\n} from 'react';\nimport { useCI360 } from './useCI360';\nimport type {\n CI360ViewerProps,\n CI360ViewerRef,\n CI360Config,\n} from './types';\n\n/**\n * CI360Viewer React Component\n *\n * A declarative React wrapper for the CI360 360-degree image viewer.\n *\n * @example\n * ```tsx\n * import { CI360Viewer } from 'js-cloudimage-360-view/react';\n * import 'js-cloudimage-360-view/css';\n *\n * function ProductView() {\n * return (\n * <CI360Viewer\n * folder=\"https://example.com/images/\"\n * filenameX=\"product-{index}.jpg\"\n * amountX={36}\n * autoplay\n * fullscreen\n * />\n * );\n * }\n * ```\n *\n * @example With ref for imperative control\n * ```tsx\n * import { useRef } from 'react';\n * import { CI360Viewer, CI360ViewerRef } from 'js-cloudimage-360-view/react';\n *\n * function ProductView() {\n * const viewerRef = useRef<CI360ViewerRef>(null);\n *\n * return (\n * <>\n * <CI360Viewer\n * ref={viewerRef}\n * folder=\"https://example.com/images/\"\n * filenameX=\"{index}.jpg\"\n * amountX={36}\n * onSpin={(e) => console.log(`Frame: ${e.activeImageX}`)}\n * />\n * <button onClick={() => viewerRef.current?.play()}>Play</button>\n * <button onClick={() => viewerRef.current?.stop()}>Stop</button>\n * </>\n * );\n * }\n * ```\n */\nconst CI360ViewerComponent: ForwardRefRenderFunction<\n CI360ViewerRef,\n CI360ViewerProps\n> = (props, ref) => {\n const {\n // Container props\n id,\n className,\n style,\n\n // Image source\n folder,\n apiVersion,\n filenameX,\n filenameY,\n filenameGrid,\n imageListX,\n imageListY,\n imageListGrid,\n indexZeroBase,\n amountX,\n amountY,\n\n // Behavior\n draggable,\n swipeable,\n keys,\n keysReverse,\n autoplay,\n autoplayBehavior,\n playOnce,\n speed,\n autoplayReverse,\n dragSpeed,\n dragReverse,\n stopAtEdges,\n stopAtEdgesX,\n stopAtEdgesY,\n inertia,\n\n // UI Features\n fullscreen,\n magnifier,\n pointerZoom,\n pinchZoom,\n zoomMax,\n zoomStep,\n zoomControls,\n zoomControlsPosition,\n scrollHint,\n bottomCircle,\n bottomCircleOffset,\n initialIconShown,\n hide360Logo,\n logoSrc,\n imageInfo,\n hints,\n theme,\n markerTheme,\n brandColor,\n\n // Cloudimage CDN\n ciToken,\n ciFilters,\n ciTransformation,\n cropAspectRatio,\n cropGravity,\n\n // Loading\n lazyload,\n\n // Hotspots\n hotspots,\n hotspotTrigger,\n hotspotTimelineOnClick,\n\n // Container\n aspectRatio,\n\n // Event callbacks\n onReady,\n onLoad,\n onSpin,\n onAutoplayStart,\n onAutoplayStop,\n onFullscreenOpen,\n onFullscreenClose,\n onZoomIn,\n onZoomOut,\n onDragStart,\n onDragEnd,\n onHotspotOpen,\n onHotspotClose,\n onProductClick,\n onNavigate,\n onError,\n\n ...restProps\n } = props;\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Memoize config to prevent unnecessary re-initializations\n const config = useMemo<CI360Config>(\n () => ({\n // Image source\n folder,\n apiVersion,\n filenameX,\n filenameY,\n filenameGrid,\n imageListX,\n imageListY,\n imageListGrid,\n indexZeroBase,\n amountX,\n amountY,\n\n // Behavior\n draggable,\n swipeable,\n keys,\n keysReverse,\n autoplay,\n autoplayBehavior,\n playOnce,\n speed,\n autoplayReverse,\n dragSpeed,\n dragReverse,\n stopAtEdges,\n stopAtEdgesX,\n stopAtEdgesY,\n inertia,\n\n // UI Features\n fullscreen,\n magnifier,\n pointerZoom,\n pinchZoom,\n zoomMax,\n zoomStep,\n zoomControls,\n zoomControlsPosition,\n scrollHint,\n bottomCircle,\n bottomCircleOffset,\n initialIconShown,\n hide360Logo,\n logoSrc,\n imageInfo,\n hints,\n theme,\n markerTheme,\n brandColor,\n\n // Cloudimage CDN\n ciToken,\n ciFilters,\n ciTransformation,\n cropAspectRatio,\n cropGravity,\n\n // Loading\n lazyload,\n\n // Hotspots\n hotspots,\n hotspotTrigger,\n hotspotTimelineOnClick,\n\n // Container\n aspectRatio,\n\n // Event callbacks\n onReady,\n onLoad,\n onSpin,\n onAutoplayStart,\n onAutoplayStop,\n onFullscreenOpen,\n onFullscreenClose,\n onZoomIn,\n onZoomOut,\n onDragStart,\n onDragEnd,\n onHotspotOpen,\n onHotspotClose,\n onProductClick,\n onNavigate,\n onError,\n }),\n [\n // Image source\n folder,\n apiVersion,\n filenameX,\n filenameY,\n filenameGrid,\n imageListX,\n imageListY,\n imageListGrid,\n indexZeroBase,\n amountX,\n amountY,\n\n // Behavior\n draggable,\n swipeable,\n keys,\n keysReverse,\n autoplay,\n autoplayBehavior,\n playOnce,\n speed,\n autoplayReverse,\n dragSpeed,\n dragReverse,\n stopAtEdges,\n stopAtEdgesX,\n stopAtEdgesY,\n inertia,\n\n // UI Features\n fullscreen,\n magnifier,\n pointerZoom,\n pinchZoom,\n zoomMax,\n zoomStep,\n zoomControls,\n zoomControlsPosition,\n scrollHint,\n bottomCircle,\n bottomCircleOffset,\n initialIconShown,\n hide360Logo,\n logoSrc,\n imageInfo,\n hints,\n theme,\n markerTheme,\n brandColor,\n\n // Cloudimage CDN\n ciToken,\n ciFilters,\n ciTransformation,\n cropAspectRatio,\n cropGravity,\n\n // Loading\n lazyload,\n\n // Hotspots\n hotspots,\n hotspotTrigger,\n hotspotTimelineOnClick,\n\n // Container\n aspectRatio,\n\n // Event callbacks\n onReady,\n onLoad,\n onSpin,\n onAutoplayStart,\n onAutoplayStop,\n onFullscreenOpen,\n onFullscreenClose,\n onZoomIn,\n onZoomOut,\n onDragStart,\n onDragEnd,\n onHotspotOpen,\n onHotspotClose,\n onProductClick,\n onNavigate,\n onError,\n ]\n );\n\n const { getViewer } = useCI360(containerRef, config);\n\n // Expose imperative methods via ref\n // Use getViewer() inside methods to always get the current viewer instance,\n // avoiding stale closure issues when the viewer initializes after first render\n useImperativeHandle(\n ref,\n () => ({\n moveLeft: (steps = 1) => getViewer()?.moveLeft(false, steps),\n moveRight: (steps = 1) => getViewer()?.moveRight(false, steps),\n moveTop: (steps = 1) => getViewer()?.moveTop(false, steps),\n moveBottom: (steps = 1) => getViewer()?.moveBottom(false, steps),\n play: () => getViewer()?.play(),\n stop: () => getViewer()?.stopAutoplay(),\n zoomIn: () => getViewer()?.zoomPan?.zoomIn(),\n zoomOut: () => getViewer()?.zoomPan?.zoomOut(),\n resetZoom: () => getViewer()?.zoomPan?.resetZoom(),\n setZoom: (level: number) => getViewer()?.zoomPan?.setZoom(level),\n goToFrame: (frame: number, hotspotId?: string) =>\n getViewer()?.animateToFrame(frame, hotspotId),\n getViewer: () => getViewer(),\n }),\n [getViewer]\n );\n\n return (\n <div\n ref={containerRef}\n id={id}\n className={className}\n style={style}\n {...restProps}\n />\n );\n};\n\nexport const CI360Viewer = forwardRef(CI360ViewerComponent);\nCI360Viewer.displayName = 'CI360Viewer';\n\nexport default CI360Viewer;\n"],"names":["CI360Class","useCI360","containerRef","config","isReady","setIsReady","useState","viewerRef","useRef","ci360Ref","uniqueId","useId","useEffect","isMounted","container","wrappedConfig","data","_a","error","getViewer","useCallback","CI360ViewerComponent","props","ref","id","className","style","folder","apiVersion","filenameX","filenameY","filenameGrid","imageListX","imageListY","imageListGrid","indexZeroBase","amountX","amountY","draggable","swipeable","keys","keysReverse","autoplay","autoplayBehavior","playOnce","speed","autoplayReverse","dragSpeed","dragReverse","stopAtEdges","stopAtEdgesX","stopAtEdgesY","inertia","fullscreen","magnifier","pointerZoom","pinchZoom","zoomMax","zoomStep","zoomControls","zoomControlsPosition","scrollHint","bottomCircle","bottomCircleOffset","initialIconShown","hide360Logo","logoSrc","imageInfo","hints","theme","markerTheme","brandColor","ciToken","ciFilters","ciTransformation","cropAspectRatio","cropGravity","lazyload","hotspots","hotspotTrigger","hotspotTimelineOnClick","aspectRatio","onReady","onLoad","onSpin","onAutoplayStart","onAutoplayStop","onFullscreenOpen","onFullscreenClose","onZoomIn","onZoomOut","onDragStart","onDragEnd","onHotspotOpen","onHotspotClose","onProductClick","onNavigate","onError","restProps","useMemo","useImperativeHandle","steps","_b","level","frame","hotspotId","jsx","CI360Viewer","forwardRef"],"mappings":"yIASA,IAAIA,EAAkB,KAuBf,SAASC,EACdC,EACAC,EACgB,CAChB,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EACtCC,EAAYC,EAAAA,OAAmC,IAAI,EACnDC,EAAWD,EAA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AC,EACA,iBAAAC,EACA,SAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,UAAAC,EACA,YAAAC,EACA,YAAAC,EACF,aAAAC,EACA,aAAAC,EACE,QAAAC,EAGA,WAAAC,EACA,UAAAC,EACA,YAAAC,EACA,UAAAC,EACA,QAAAC,EACA,SAAAC,EACA,aAAAC,EACA,qBAAAC,EACA,WAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,GACA,MAAAC,GACA,YAAAC,GACA,WAAAC,GAGA,QAAAC,GACA,UAAAC,GACA,iBAAAC,GACA,gBAAAC,GACA,YAAAC,GAGA,SAAAC,GAGA,SAAAC,GACA,eAAAC,GACA,uBAAAC,GAGA,YAAAC,GAGA,QAAAC,GACA,OAAAC,GACA,OAAAC,GACA,gBAAAC,GACA,eAAAC,GACA,iBAAAC,GACA,kBAAAC,GACA,SAAAC,GACA,UAAAC,GACA,YAAAC,GACA,UAAAC,GACA,cAAAC,GACA,eAAAC,GACA,eAAAC,GACA,WAAAC,GACA,QAAAC,EAAA,GAEF,CAEEtE,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACFC,EACAC,EACEC,EAGAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GACAC,GACAC,GACAC,GAGAC,GACAC,GACAC,GACAC,GACAC,GAGAC,GAGAC,GACAC,GACAC,GAGAC,GAGAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EAAA,CACF,EAGI,CAAE,UAAA9E,CAAA,EAAclB,EAASC,GAAcC,EAAM,EAKnDiG,OAAAA,EAAAA,oBACE7E,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
|
content?: string;
|
|
77
77
|
data?: PopoverData;
|
|
78
78
|
className?: string;
|
|
79
|
+
/** Scene ID to navigate to when this hotspot is clicked. */
|
|
80
|
+
navigateTo?: string;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
/**
|
|
@@ -93,6 +95,7 @@ export interface SpinEventData {
|
|
|
93
95
|
activeImageY: number;
|
|
94
96
|
amountX: number;
|
|
95
97
|
amountY: number;
|
|
98
|
+
isGridMode: boolean;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
/**
|
|
@@ -102,6 +105,7 @@ export interface LoadEventData {
|
|
|
102
105
|
viewerId: string;
|
|
103
106
|
imagesX: number;
|
|
104
107
|
imagesY: number;
|
|
108
|
+
imagesGrid?: number;
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
/**
|
|
@@ -140,6 +144,8 @@ export interface CI360Config {
|
|
|
140
144
|
filenameY?: string | null;
|
|
141
145
|
imageListX?: string | string[] | null;
|
|
142
146
|
imageListY?: string | string[] | null;
|
|
147
|
+
filenameGrid?: string | null;
|
|
148
|
+
imageListGrid?: string | string[] | string[][] | null;
|
|
143
149
|
indexZeroBase?: number;
|
|
144
150
|
amountX?: number;
|
|
145
151
|
amountY?: number;
|
|
@@ -155,6 +161,8 @@ export interface CI360Config {
|
|
|
155
161
|
dragSpeed?: number;
|
|
156
162
|
dragReverse?: boolean;
|
|
157
163
|
stopAtEdges?: boolean;
|
|
164
|
+
stopAtEdgesX?: boolean | null;
|
|
165
|
+
stopAtEdgesY?: boolean | null;
|
|
158
166
|
inertia?: boolean;
|
|
159
167
|
fullscreen?: boolean;
|
|
160
168
|
/** @deprecated Use zoomMax instead. Will be ignored. */
|
|
@@ -201,6 +209,7 @@ export interface CI360Config {
|
|
|
201
209
|
onHotspotOpen?: (hotspotId: string) => void;
|
|
202
210
|
onHotspotClose?: (hotspotId: string) => void;
|
|
203
211
|
onProductClick?: (productId: string, hotspotId: string) => void;
|
|
212
|
+
onNavigate?: (targetSceneId: string) => void;
|
|
204
213
|
onError?: (data: ErrorEventData) => void;
|
|
205
214
|
}
|
|
206
215
|
|
|
@@ -234,6 +243,7 @@ export interface CI360ViewerInstance {
|
|
|
234
243
|
amountX: number;
|
|
235
244
|
amountY: number;
|
|
236
245
|
isZoomed: boolean;
|
|
246
|
+
isGridMode: boolean;
|
|
237
247
|
viewerConfig: CI360Config;
|
|
238
248
|
}
|
|
239
249
|
|
package/dist/react/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
let
|
|
4
|
-
function
|
|
5
|
-
const [C, f] =
|
|
6
|
-
|
|
1
|
+
import { jsx as ke } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Pe, useRef as I, useId as Xe, useEffect as Ye, useCallback as be, forwardRef as Ee, useMemo as Fe, useImperativeHandle as Ge } from "react";
|
|
3
|
+
let w = null;
|
|
4
|
+
function xe(d, t) {
|
|
5
|
+
const [C, f] = Pe(!1), a = I(null), i = I(null), m = Xe();
|
|
6
|
+
Ye(() => {
|
|
7
7
|
if (typeof window > "u" || !d.current || t.autoInit === !1) return;
|
|
8
8
|
let l = !0;
|
|
9
|
-
const
|
|
9
|
+
const n = d.current;
|
|
10
10
|
return (async () => {
|
|
11
11
|
try {
|
|
12
|
-
if (
|
|
13
|
-
|
|
12
|
+
if (w || (w = (await import("./ci360-BFobl9uu.mjs")).default), !n || !l) return;
|
|
13
|
+
n.id || (n.id = `ci360-${m.replace(/:/g, "")}`);
|
|
14
14
|
const s = {
|
|
15
15
|
...t,
|
|
16
16
|
onReady: (u) => {
|
|
@@ -18,17 +18,17 @@ function Fe(d, t) {
|
|
|
18
18
|
l && (f(!0), (p = t.onReady) == null || p.call(t, u));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
i.current = new
|
|
21
|
+
i.current = new w(), a.current = i.current.init(n, s);
|
|
22
22
|
} catch (s) {
|
|
23
23
|
console.error("Failed to initialize CI360 viewer:", s);
|
|
24
24
|
}
|
|
25
25
|
})(), () => {
|
|
26
|
-
if (l = !1,
|
|
26
|
+
if (l = !1, a.current) {
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
a.current.destroy();
|
|
29
29
|
} catch {
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
a.current = null;
|
|
32
32
|
}
|
|
33
33
|
i.current = null, f(!1);
|
|
34
34
|
};
|
|
@@ -36,8 +36,10 @@ function Fe(d, t) {
|
|
|
36
36
|
t.folder,
|
|
37
37
|
t.filenameX,
|
|
38
38
|
t.filenameY,
|
|
39
|
+
t.filenameGrid,
|
|
39
40
|
t.imageListX,
|
|
40
41
|
t.imageListY,
|
|
42
|
+
t.imageListGrid,
|
|
41
43
|
t.amountX,
|
|
42
44
|
t.amountY,
|
|
43
45
|
t.hotspots,
|
|
@@ -47,170 +49,180 @@ function Fe(d, t) {
|
|
|
47
49
|
t.cropGravity,
|
|
48
50
|
m
|
|
49
51
|
]);
|
|
50
|
-
const y =
|
|
52
|
+
const y = be(() => a.current, []);
|
|
51
53
|
return {
|
|
52
|
-
viewer:
|
|
54
|
+
viewer: a.current,
|
|
53
55
|
isReady: C,
|
|
54
56
|
getViewer: y
|
|
55
57
|
};
|
|
56
58
|
}
|
|
57
|
-
const
|
|
59
|
+
const Be = (d, t) => {
|
|
58
60
|
const {
|
|
59
61
|
// Container props
|
|
60
62
|
id: C,
|
|
61
63
|
className: f,
|
|
62
|
-
style:
|
|
64
|
+
style: a,
|
|
63
65
|
// Image source
|
|
64
66
|
folder: i,
|
|
65
67
|
apiVersion: m,
|
|
66
68
|
filenameX: y,
|
|
67
69
|
filenameY: l,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
filenameGrid: n,
|
|
71
|
+
imageListX: v,
|
|
72
|
+
imageListY: s,
|
|
73
|
+
imageListGrid: u,
|
|
74
|
+
indexZeroBase: p,
|
|
75
|
+
amountX: R,
|
|
76
|
+
amountY: h,
|
|
73
77
|
// Behavior
|
|
74
|
-
draggable:
|
|
75
|
-
swipeable:
|
|
76
|
-
keys:
|
|
78
|
+
draggable: z,
|
|
79
|
+
swipeable: g,
|
|
80
|
+
keys: L,
|
|
77
81
|
keysReverse: V,
|
|
78
82
|
autoplay: S,
|
|
79
83
|
autoplayBehavior: T,
|
|
80
84
|
playOnce: Z,
|
|
81
|
-
speed:
|
|
82
|
-
autoplayReverse:
|
|
83
|
-
dragSpeed:
|
|
84
|
-
dragReverse:
|
|
85
|
-
stopAtEdges:
|
|
86
|
-
|
|
85
|
+
speed: A,
|
|
86
|
+
autoplayReverse: O,
|
|
87
|
+
dragSpeed: k,
|
|
88
|
+
dragReverse: P,
|
|
89
|
+
stopAtEdges: X,
|
|
90
|
+
stopAtEdgesX: Y,
|
|
91
|
+
stopAtEdgesY: b,
|
|
92
|
+
inertia: E,
|
|
87
93
|
// UI Features
|
|
88
|
-
fullscreen:
|
|
89
|
-
magnifier:
|
|
90
|
-
pointerZoom:
|
|
91
|
-
pinchZoom:
|
|
92
|
-
zoomMax:
|
|
93
|
-
zoomStep:
|
|
94
|
-
zoomControls:
|
|
95
|
-
zoomControlsPosition:
|
|
96
|
-
scrollHint:
|
|
97
|
-
bottomCircle:
|
|
98
|
-
bottomCircleOffset:
|
|
99
|
-
initialIconShown:
|
|
100
|
-
hide360Logo:
|
|
101
|
-
logoSrc:
|
|
102
|
-
imageInfo:
|
|
103
|
-
hints:
|
|
104
|
-
theme:
|
|
105
|
-
markerTheme:
|
|
106
|
-
brandColor:
|
|
94
|
+
fullscreen: F,
|
|
95
|
+
magnifier: G,
|
|
96
|
+
pointerZoom: x,
|
|
97
|
+
pinchZoom: B,
|
|
98
|
+
zoomMax: D,
|
|
99
|
+
zoomStep: H,
|
|
100
|
+
zoomControls: M,
|
|
101
|
+
zoomControlsPosition: N,
|
|
102
|
+
scrollHint: j,
|
|
103
|
+
bottomCircle: q,
|
|
104
|
+
bottomCircleOffset: $,
|
|
105
|
+
initialIconShown: J,
|
|
106
|
+
hide360Logo: K,
|
|
107
|
+
logoSrc: Q,
|
|
108
|
+
imageInfo: U,
|
|
109
|
+
hints: W,
|
|
110
|
+
theme: _,
|
|
111
|
+
markerTheme: ee,
|
|
112
|
+
brandColor: oe,
|
|
107
113
|
// Cloudimage CDN
|
|
108
|
-
ciToken:
|
|
109
|
-
ciFilters:
|
|
110
|
-
ciTransformation:
|
|
111
|
-
cropAspectRatio:
|
|
112
|
-
cropGravity:
|
|
114
|
+
ciToken: te,
|
|
115
|
+
ciFilters: re,
|
|
116
|
+
ciTransformation: ae,
|
|
117
|
+
cropAspectRatio: ne,
|
|
118
|
+
cropGravity: se,
|
|
113
119
|
// Loading
|
|
114
|
-
lazyload:
|
|
120
|
+
lazyload: ie,
|
|
115
121
|
// Hotspots
|
|
116
|
-
hotspots:
|
|
117
|
-
hotspotTrigger:
|
|
118
|
-
hotspotTimelineOnClick:
|
|
122
|
+
hotspots: le,
|
|
123
|
+
hotspotTrigger: me,
|
|
124
|
+
hotspotTimelineOnClick: ue,
|
|
119
125
|
// Container
|
|
120
|
-
aspectRatio:
|
|
126
|
+
aspectRatio: pe,
|
|
121
127
|
// Event callbacks
|
|
122
|
-
onReady:
|
|
123
|
-
onLoad:
|
|
124
|
-
onSpin:
|
|
125
|
-
onAutoplayStart:
|
|
126
|
-
onAutoplayStop:
|
|
127
|
-
onFullscreenOpen:
|
|
128
|
-
onFullscreenClose:
|
|
129
|
-
onZoomIn:
|
|
130
|
-
onZoomOut:
|
|
131
|
-
onDragStart:
|
|
132
|
-
onDragEnd:
|
|
133
|
-
onHotspotOpen:
|
|
134
|
-
onHotspotClose:
|
|
135
|
-
onProductClick:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
128
|
+
onReady: ce,
|
|
129
|
+
onLoad: de,
|
|
130
|
+
onSpin: fe,
|
|
131
|
+
onAutoplayStart: ye,
|
|
132
|
+
onAutoplayStop: Ce,
|
|
133
|
+
onFullscreenOpen: ve,
|
|
134
|
+
onFullscreenClose: we,
|
|
135
|
+
onZoomIn: Ie,
|
|
136
|
+
onZoomOut: Re,
|
|
137
|
+
onDragStart: he,
|
|
138
|
+
onDragEnd: ze,
|
|
139
|
+
onHotspotOpen: ge,
|
|
140
|
+
onHotspotClose: Le,
|
|
141
|
+
onProductClick: Ve,
|
|
142
|
+
onNavigate: Se,
|
|
143
|
+
onError: Te,
|
|
144
|
+
...Ae
|
|
145
|
+
} = d, Ze = I(null), Oe = Fe(
|
|
139
146
|
() => ({
|
|
140
147
|
// Image source
|
|
141
148
|
folder: i,
|
|
142
149
|
apiVersion: m,
|
|
143
150
|
filenameX: y,
|
|
144
151
|
filenameY: l,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
filenameGrid: n,
|
|
153
|
+
imageListX: v,
|
|
154
|
+
imageListY: s,
|
|
155
|
+
imageListGrid: u,
|
|
156
|
+
indexZeroBase: p,
|
|
157
|
+
amountX: R,
|
|
158
|
+
amountY: h,
|
|
150
159
|
// Behavior
|
|
151
|
-
draggable:
|
|
152
|
-
swipeable:
|
|
153
|
-
keys:
|
|
160
|
+
draggable: z,
|
|
161
|
+
swipeable: g,
|
|
162
|
+
keys: L,
|
|
154
163
|
keysReverse: V,
|
|
155
164
|
autoplay: S,
|
|
156
165
|
autoplayBehavior: T,
|
|
157
166
|
playOnce: Z,
|
|
158
|
-
speed:
|
|
159
|
-
autoplayReverse:
|
|
160
|
-
dragSpeed:
|
|
161
|
-
dragReverse:
|
|
162
|
-
stopAtEdges:
|
|
163
|
-
|
|
167
|
+
speed: A,
|
|
168
|
+
autoplayReverse: O,
|
|
169
|
+
dragSpeed: k,
|
|
170
|
+
dragReverse: P,
|
|
171
|
+
stopAtEdges: X,
|
|
172
|
+
stopAtEdgesX: Y,
|
|
173
|
+
stopAtEdgesY: b,
|
|
174
|
+
inertia: E,
|
|
164
175
|
// UI Features
|
|
165
|
-
fullscreen:
|
|
166
|
-
magnifier:
|
|
167
|
-
pointerZoom:
|
|
168
|
-
pinchZoom:
|
|
169
|
-
zoomMax:
|
|
170
|
-
zoomStep:
|
|
171
|
-
zoomControls:
|
|
172
|
-
zoomControlsPosition:
|
|
173
|
-
scrollHint:
|
|
174
|
-
bottomCircle:
|
|
175
|
-
bottomCircleOffset:
|
|
176
|
-
initialIconShown:
|
|
177
|
-
hide360Logo:
|
|
178
|
-
logoSrc:
|
|
179
|
-
imageInfo:
|
|
180
|
-
hints:
|
|
181
|
-
theme:
|
|
182
|
-
markerTheme:
|
|
183
|
-
brandColor:
|
|
176
|
+
fullscreen: F,
|
|
177
|
+
magnifier: G,
|
|
178
|
+
pointerZoom: x,
|
|
179
|
+
pinchZoom: B,
|
|
180
|
+
zoomMax: D,
|
|
181
|
+
zoomStep: H,
|
|
182
|
+
zoomControls: M,
|
|
183
|
+
zoomControlsPosition: N,
|
|
184
|
+
scrollHint: j,
|
|
185
|
+
bottomCircle: q,
|
|
186
|
+
bottomCircleOffset: $,
|
|
187
|
+
initialIconShown: J,
|
|
188
|
+
hide360Logo: K,
|
|
189
|
+
logoSrc: Q,
|
|
190
|
+
imageInfo: U,
|
|
191
|
+
hints: W,
|
|
192
|
+
theme: _,
|
|
193
|
+
markerTheme: ee,
|
|
194
|
+
brandColor: oe,
|
|
184
195
|
// Cloudimage CDN
|
|
185
|
-
ciToken:
|
|
186
|
-
ciFilters:
|
|
187
|
-
ciTransformation:
|
|
188
|
-
cropAspectRatio:
|
|
189
|
-
cropGravity:
|
|
196
|
+
ciToken: te,
|
|
197
|
+
ciFilters: re,
|
|
198
|
+
ciTransformation: ae,
|
|
199
|
+
cropAspectRatio: ne,
|
|
200
|
+
cropGravity: se,
|
|
190
201
|
// Loading
|
|
191
|
-
lazyload:
|
|
202
|
+
lazyload: ie,
|
|
192
203
|
// Hotspots
|
|
193
|
-
hotspots:
|
|
194
|
-
hotspotTrigger:
|
|
195
|
-
hotspotTimelineOnClick:
|
|
204
|
+
hotspots: le,
|
|
205
|
+
hotspotTrigger: me,
|
|
206
|
+
hotspotTimelineOnClick: ue,
|
|
196
207
|
// Container
|
|
197
|
-
aspectRatio:
|
|
208
|
+
aspectRatio: pe,
|
|
198
209
|
// Event callbacks
|
|
199
|
-
onReady:
|
|
200
|
-
onLoad:
|
|
201
|
-
onSpin:
|
|
202
|
-
onAutoplayStart:
|
|
203
|
-
onAutoplayStop:
|
|
204
|
-
onFullscreenOpen:
|
|
205
|
-
onFullscreenClose:
|
|
206
|
-
onZoomIn:
|
|
207
|
-
onZoomOut:
|
|
208
|
-
onDragStart:
|
|
209
|
-
onDragEnd:
|
|
210
|
-
onHotspotOpen:
|
|
211
|
-
onHotspotClose:
|
|
212
|
-
onProductClick:
|
|
213
|
-
|
|
210
|
+
onReady: ce,
|
|
211
|
+
onLoad: de,
|
|
212
|
+
onSpin: fe,
|
|
213
|
+
onAutoplayStart: ye,
|
|
214
|
+
onAutoplayStop: Ce,
|
|
215
|
+
onFullscreenOpen: ve,
|
|
216
|
+
onFullscreenClose: we,
|
|
217
|
+
onZoomIn: Ie,
|
|
218
|
+
onZoomOut: Re,
|
|
219
|
+
onDragStart: he,
|
|
220
|
+
onDragEnd: ze,
|
|
221
|
+
onHotspotOpen: ge,
|
|
222
|
+
onHotspotClose: Le,
|
|
223
|
+
onProductClick: Ve,
|
|
224
|
+
onNavigate: Se,
|
|
225
|
+
onError: Te
|
|
214
226
|
}),
|
|
215
227
|
[
|
|
216
228
|
// Image source
|
|
@@ -218,37 +230,37 @@ const Xe = (d, t) => {
|
|
|
218
230
|
m,
|
|
219
231
|
y,
|
|
220
232
|
l,
|
|
221
|
-
|
|
222
|
-
|
|
233
|
+
n,
|
|
234
|
+
v,
|
|
223
235
|
s,
|
|
224
236
|
u,
|
|
225
237
|
p,
|
|
226
|
-
// Behavior
|
|
227
238
|
R,
|
|
228
239
|
h,
|
|
240
|
+
// Behavior
|
|
229
241
|
z,
|
|
242
|
+
g,
|
|
243
|
+
L,
|
|
230
244
|
V,
|
|
231
245
|
S,
|
|
232
246
|
T,
|
|
233
247
|
Z,
|
|
234
|
-
|
|
235
|
-
L,
|
|
248
|
+
A,
|
|
236
249
|
O,
|
|
237
250
|
k,
|
|
238
251
|
P,
|
|
252
|
+
X,
|
|
253
|
+
Y,
|
|
239
254
|
b,
|
|
255
|
+
E,
|
|
240
256
|
// UI Features
|
|
241
|
-
A,
|
|
242
257
|
F,
|
|
243
|
-
|
|
244
|
-
Y,
|
|
258
|
+
G,
|
|
245
259
|
x,
|
|
246
260
|
B,
|
|
247
261
|
D,
|
|
248
|
-
E,
|
|
249
262
|
H,
|
|
250
263
|
M,
|
|
251
|
-
G,
|
|
252
264
|
N,
|
|
253
265
|
j,
|
|
254
266
|
q,
|
|
@@ -257,39 +269,44 @@ const Xe = (d, t) => {
|
|
|
257
269
|
K,
|
|
258
270
|
Q,
|
|
259
271
|
U,
|
|
260
|
-
// Cloudimage CDN
|
|
261
272
|
W,
|
|
262
273
|
_,
|
|
263
274
|
ee,
|
|
264
275
|
oe,
|
|
276
|
+
// Cloudimage CDN
|
|
265
277
|
te,
|
|
266
|
-
// Loading
|
|
267
278
|
re,
|
|
268
|
-
// Hotspots
|
|
269
|
-
ne,
|
|
270
279
|
ae,
|
|
280
|
+
ne,
|
|
271
281
|
se,
|
|
272
|
-
//
|
|
282
|
+
// Loading
|
|
273
283
|
ie,
|
|
274
|
-
//
|
|
284
|
+
// Hotspots
|
|
275
285
|
le,
|
|
276
286
|
me,
|
|
277
287
|
ue,
|
|
288
|
+
// Container
|
|
278
289
|
pe,
|
|
290
|
+
// Event callbacks
|
|
279
291
|
ce,
|
|
280
292
|
de,
|
|
281
293
|
fe,
|
|
282
294
|
ye,
|
|
283
295
|
Ce,
|
|
284
|
-
we,
|
|
285
296
|
ve,
|
|
297
|
+
we,
|
|
286
298
|
Ie,
|
|
287
299
|
Re,
|
|
288
300
|
he,
|
|
289
|
-
ze
|
|
301
|
+
ze,
|
|
302
|
+
ge,
|
|
303
|
+
Le,
|
|
304
|
+
Ve,
|
|
305
|
+
Se,
|
|
306
|
+
Te
|
|
290
307
|
]
|
|
291
|
-
), { getViewer: r } =
|
|
292
|
-
return
|
|
308
|
+
), { getViewer: r } = xe(Ze, Oe);
|
|
309
|
+
return Ge(
|
|
293
310
|
t,
|
|
294
311
|
() => ({
|
|
295
312
|
moveLeft: (e = 1) => {
|
|
@@ -339,22 +356,22 @@ const Xe = (d, t) => {
|
|
|
339
356
|
getViewer: () => r()
|
|
340
357
|
}),
|
|
341
358
|
[r]
|
|
342
|
-
), /* @__PURE__ */
|
|
359
|
+
), /* @__PURE__ */ ke(
|
|
343
360
|
"div",
|
|
344
361
|
{
|
|
345
|
-
ref:
|
|
362
|
+
ref: Ze,
|
|
346
363
|
id: C,
|
|
347
364
|
className: f,
|
|
348
|
-
style:
|
|
349
|
-
...
|
|
365
|
+
style: a,
|
|
366
|
+
...Ae
|
|
350
367
|
}
|
|
351
368
|
);
|
|
352
|
-
},
|
|
353
|
-
|
|
369
|
+
}, De = Ee(Be);
|
|
370
|
+
De.displayName = "CI360Viewer";
|
|
354
371
|
export {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
372
|
+
De as CI360Viewer,
|
|
373
|
+
De as CI360ViewerDefault,
|
|
374
|
+
xe as useCI360,
|
|
375
|
+
xe as useCI360Default
|
|
359
376
|
};
|
|
360
377
|
//# sourceMappingURL=index.js.map
|