@prose-reader/enhancer-gallery 1.372.0 → 1.373.0
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/index.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/utils/redrawCanvas.ts","../src/utils/snapshotBlobAssets.ts","../src/utils/deepCloneElement.ts","../src/Snapshot.ts","../src/style.css?inline","../src/index.ts"],"sourcesContent":["export const redrawCanvas = (\n originalCanvas: HTMLCanvasElement,\n clonedCanvas: HTMLCanvasElement,\n) => {\n try {\n // Copy canvas dimensions\n clonedCanvas.width = originalCanvas.width\n clonedCanvas.height = originalCanvas.height\n\n // Copy canvas content\n const context = clonedCanvas.getContext(\"2d\")\n if (context) {\n context.drawImage(originalCanvas, 0, 0)\n }\n } catch (e) {\n console.warn(\n \"Could not copy canvas content - possible tainted canvas or cross-origin issue\",\n e,\n )\n }\n}\n","type SnapshotObjectUrlStore = {\n add: (url: string) => void\n revokeAll: () => void\n}\n\nconst RESOURCE_SELECTOR = [\n `img`,\n `video`,\n `audio`,\n `source`,\n `link`,\n `script`,\n].join(`,`)\n\nexport const createSnapshotObjectUrlStore = (): SnapshotObjectUrlStore => {\n const objectUrls = new Set<string>()\n\n return {\n add: (url) => {\n objectUrls.add(url)\n },\n revokeAll: () => {\n objectUrls.forEach((url) => {\n URL.revokeObjectURL(url)\n })\n objectUrls.clear()\n },\n }\n}\n\nconst getElementAssetUrl = (element: Element) =>\n element.getAttribute(`src`) || element.getAttribute(`href`)\n\nconst setElementAssetUrl = (element: Element, url: string) => {\n if (element.hasAttribute(`src`)) {\n element.setAttribute(`src`, url)\n } else if (element.hasAttribute(`href`)) {\n element.setAttribute(`href`, url)\n }\n}\n\nconst copyBlobUrl = async (\n url: string,\n document: Document,\n objectUrlStore: SnapshotObjectUrlStore,\n) => {\n const response = await fetch(url)\n const blob = await response.blob()\n const objectUrl = document.defaultView?.URL.createObjectURL(blob)\n\n if (!objectUrl) return\n\n objectUrlStore.add(objectUrl)\n\n return objectUrl\n}\n\nexport const copyBlobAssetReferences = async (\n root: ParentNode,\n document: Document,\n objectUrlStore: SnapshotObjectUrlStore,\n) => {\n const elementsWithAssets = Array.from(\n root.querySelectorAll(RESOURCE_SELECTOR),\n )\n\n await Promise.all(\n elementsWithAssets.map(async (element) => {\n const url = getElementAssetUrl(element)\n\n if (!url?.startsWith(`blob:`)) return\n\n let objectUrl: string | undefined\n\n try {\n objectUrl = await copyBlobUrl(url, document, objectUrlStore)\n } catch (error) {\n console.error(`Error copying snapshot blob asset:`, error)\n return\n }\n\n if (objectUrl) {\n setElementAssetUrl(element, objectUrl)\n }\n }),\n )\n}\n","import { waitForFrameLoad } from \"@prose-reader/core\"\nimport { combineLatest, defaultIfEmpty, from, of, switchMap } from \"rxjs\"\nimport { redrawCanvas } from \"./redrawCanvas\"\nimport {\n copyBlobAssetReferences,\n createSnapshotObjectUrlStore,\n} from \"./snapshotBlobAssets\"\n\nconst copyIframeContents = (\n originalIframes: NodeListOf<HTMLIFrameElement>,\n clonedIframes: NodeListOf<HTMLIFrameElement>,\n objectUrlStore: ReturnType<typeof createSnapshotObjectUrlStore>,\n) => {\n const iframeCopies = Array.from(originalIframes).map(\n (originalIframe, index) => {\n const clonedIframe = clonedIframes[index]\n\n if (!clonedIframe) return of(true)\n\n return waitForFrameLoad(of(clonedIframe)).pipe(\n switchMap(async () => {\n try {\n // Since we know they're same-origin EPUBs, we can directly copy content\n if (\n originalIframe.contentDocument &&\n clonedIframe.contentDocument\n ) {\n // Clone the entire body content\n const clonedBody =\n originalIframe.contentDocument.body.cloneNode(true)\n\n // Replace the body in the cloned iframe\n clonedIframe.contentDocument.body.replaceWith(clonedBody)\n\n // Also copy any head styles that might be important for rendering\n const originalHead = originalIframe.contentDocument.head\n const clonedHead = clonedIframe.contentDocument.head\n\n // Copy all style and link elements from head\n Array.from(\n originalHead.querySelectorAll('style, link[rel=\"stylesheet\"]'),\n ).forEach((node) => {\n clonedHead.appendChild(node.cloneNode(true))\n })\n\n await copyBlobAssetReferences(\n clonedIframe.contentDocument,\n clonedIframe.contentDocument,\n objectUrlStore,\n )\n }\n return true\n } catch (e) {\n console.error(\"Error copying iframe content:\", e)\n return false\n }\n }),\n )\n },\n )\n\n if (iframeCopies.length === 0) return of(true)\n\n return combineLatest(iframeCopies)\n}\n\nconst redrawCanvases = (sourceElement: HTMLElement, clone: HTMLElement) => {\n const originalCanvases = sourceElement.querySelectorAll(\"canvas\")\n const clonedCanvases = clone.querySelectorAll(\"canvas\")\n\n originalCanvases.forEach((originalCanvas, index) => {\n if (index < clonedCanvases.length) {\n const clonedCanvas = clonedCanvases[index] as HTMLCanvasElement\n\n redrawCanvas(originalCanvas, clonedCanvas)\n }\n })\n}\n\nexport function deepCloneElement(sourceElement: HTMLElement) {\n const objectUrlStore = createSnapshotObjectUrlStore()\n // Create a deep clone of the source element\n const clone = sourceElement.cloneNode(true) as HTMLElement\n\n // Find all iframes in the original element\n const originalIframes = sourceElement.querySelectorAll(\"iframe\")\n // Find all iframes in the cloned element\n const clonedIframes = clone.querySelectorAll(\"iframe\")\n\n // Handle canvases in the main document\n redrawCanvases(sourceElement, clone)\n\n const copyContents$ = combineLatest([\n from(\n copyBlobAssetReferences(\n clone,\n sourceElement.ownerDocument,\n objectUrlStore,\n ),\n ),\n copyIframeContents(originalIframes, clonedIframes, objectUrlStore),\n ])\n\n return {\n clone,\n ready$: copyContents$.pipe(defaultIfEmpty(true)),\n release: objectUrlStore.revokeAll,\n }\n}\n","import {\n DocumentRenderer,\n type Reader,\n type SpineItem,\n} from \"@prose-reader/core\"\nimport { filter, first, Observable, switchMap } from \"rxjs\"\nimport { deepCloneElement } from \"./utils/deepCloneElement\"\n\nconst SNAPSHOT_CLASS = \"prose-reader-enhancer-gallery-snapshot\"\nconst SNAPSHOT_MASK_CLASS = \"prose-reader-enhancer-gallery-snapshot-mask\"\nconst SNAPSHOT_PREVIEW_CLASS = \"prose-reader-enhancer-gallery-snapshot-preview\"\nconst SNAPSHOT_FRAME_CLASS = \"prose-reader-enhancer-gallery-snapshot-frame\"\n\nconst createSnapshotItem = (doc: Document) => {\n const spineItemContainerElement = doc.createElement(\"div\")\n spineItemContainerElement.classList.add(SNAPSHOT_CLASS)\n spineItemContainerElement.tabIndex = -1\n spineItemContainerElement.setAttribute(\"aria-hidden\", \"true\")\n spineItemContainerElement.setAttribute(\"inert\", \"\")\n\n const contentMask = doc.createElement(\"div\")\n\n contentMask.classList.add(SNAPSHOT_MASK_CLASS)\n\n spineItemContainerElement.appendChild(contentMask)\n\n return spineItemContainerElement\n}\n\nconst makeSnapshotPreviewInert = (element: HTMLElement) => {\n element.classList.add(SNAPSHOT_PREVIEW_CLASS)\n element.tabIndex = -1\n element.setAttribute(\"aria-hidden\", \"true\")\n element.setAttribute(\"inert\", \"\")\n\n element.querySelectorAll(\"iframe\").forEach((iframe) => {\n iframe.classList.add(SNAPSHOT_FRAME_CLASS)\n iframe.tabIndex = -1\n iframe.setAttribute(\"aria-hidden\", \"true\")\n iframe.setAttribute(\"inert\", \"\")\n })\n}\n\nexport class Snapshot extends Observable<HTMLElement> {\n constructor(\n reader: Reader,\n item: SpineItem,\n parent: Element,\n options: {\n height: number\n width: number\n },\n ) {\n super((subscriber) => {\n const parentDocument = parent.ownerDocument\n const unlockSpineItem = reader.spine.spineItemsLoader.forceOpen([item])\n let hasUnlockedSpineItem = false\n let releaseSnapshotAssets = () => {}\n let snapshotItem: HTMLElement | undefined\n\n const unlock = () => {\n if (hasUnlockedSpineItem) return\n\n hasUnlockedSpineItem = true\n unlockSpineItem()\n }\n\n const subscription = item.isReady$\n .pipe(\n filter((isReady) => isReady),\n first(),\n switchMap(() => {\n snapshotItem = createSnapshotItem(parentDocument)\n\n const pageSize = reader.viewport.value.pageSize\n const itemElement = snapshotItem\n const contentMask = itemElement?.children[0] as\n | HTMLElement\n | undefined\n\n if (!itemElement || !contentMask)\n throw new Error(\"No item element or content mask\")\n\n contentMask.style.top = \"0\"\n contentMask.style.left = \"0\"\n\n const measure = options\n const { height, width } = item.layoutInfo\n const numberOfPages = item.numberOfPages\n const widthScaleFullFrame = (measure.width / width) * numberOfPages\n const heightScale = measure.height / height\n\n // Use the minimum scale to ensure the element fits within both dimensions\n const scale = Math.min(widthScaleFullFrame, heightScale)\n\n const {\n clone: clonedElement,\n ready$: cloneReady$,\n release,\n } = deepCloneElement(item.element)\n releaseSnapshotAssets = release\n\n // cleanup unwanted elements from the spine\n Array.from(clonedElement.children).forEach((child) => {\n if (\n !child.classList.contains(\n DocumentRenderer.DOCUMENT_CONTAINER_CLASS_NAME,\n )\n ) {\n child.remove()\n }\n })\n\n clonedElement.style.left = \"0\"\n clonedElement.style.top = \"0\"\n clonedElement.style.position = \"relative\"\n makeSnapshotPreviewInert(clonedElement)\n\n /**\n * Now we adjust the mask to make it fit in the center and cover\n * only the required part of the spine item (hidding) the overflowing\n * pages for example.\n */\n const pageWidthAfterScale = pageSize.width * scale\n const pageHeightAfterScale = pageSize.height * scale\n\n contentMask.style.width = `${pageSize.width}px`\n contentMask.style.height = `${pageSize.height}px`\n contentMask.style.transformOrigin = \"0 0\"\n contentMask.style.transform = `scale(${scale})`\n\n if (pageWidthAfterScale < measure.width) {\n const gap = (measure.width - pageWidthAfterScale) / 2\n\n contentMask.style.left = `${gap}px`\n }\n\n if (pageHeightAfterScale < measure.height) {\n const gap = (measure.height - pageHeightAfterScale) / 2\n\n contentMask.style.top = `${gap}px`\n }\n\n parent.appendChild(itemElement)\n contentMask.appendChild(clonedElement)\n\n subscriber.next(itemElement)\n\n return cloneReady$\n }),\n )\n .subscribe({\n error: (error) => {\n unlock()\n subscriber.error(error)\n },\n complete: () => {\n unlock()\n // Keep the observable open after cloning so the thumbnail owns its\n // copied object URLs until React unsubscribes from this snapshot.\n },\n })\n\n return () => {\n subscription.unsubscribe()\n unlock()\n releaseSnapshotAssets()\n snapshotItem?.remove()\n }\n })\n }\n}\n",".prose-reader-enhancer-gallery-snapshot {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.prose-reader-enhancer-gallery-snapshot-mask {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n}\n\n.prose-reader-enhancer-gallery-snapshot-preview {\n position: relative;\n top: 0;\n left: 0;\n}\n\n.prose-reader-enhancer-gallery-snapshot,\n.prose-reader-enhancer-gallery-snapshot-mask,\n.prose-reader-enhancer-gallery-snapshot-preview,\n.prose-reader-enhancer-gallery-snapshot-frame,\n.prose-reader-enhancer-gallery-snapshot iframe {\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n}\n","import { injectCSS, type Reader } from \"@prose-reader/core\"\nimport { Snapshot } from \"./Snapshot\"\nimport styles from \"./style.css?inline\"\nimport type { GalleryEnhancerAPI } from \"./types\"\n\nexport type { GalleryEnhancerAPI }\n\nconst STYLE_ID = \"prose-reader-enhancer-gallery-snapshot-styles\"\n\nexport const galleryEnhancer =\n <InheritOptions, InheritOutput extends Reader>(\n next: (options: InheritOptions) => InheritOutput,\n ) =>\n (options: InheritOptions): InheritOutput & GalleryEnhancerAPI => {\n const reader = next(options)\n\n if (typeof document !== \"undefined\" && !document.getElementById(STYLE_ID)) {\n injectCSS(document, STYLE_ID, styles)\n }\n\n return {\n ...reader,\n __PROSE_READER_ENHANCER_GALLERY: true,\n gallery: {\n snapshot: (spineItem, parent, options) =>\n new Snapshot(reader, spineItem, parent, options),\n },\n }\n }\n"],"mappings":"yHAAA,IAAa,GACX,EACA,IACG,CACH,GAAI,CAEF,EAAa,MAAQ,EAAe,MACpC,EAAa,OAAS,EAAe,OAGrC,IAAM,EAAU,EAAa,WAAW,IAAI,EACxC,GACF,EAAQ,UAAU,EAAgB,EAAG,CAAC,CAE1C,OAAS,EAAG,CACV,QAAQ,KACN,gFACA,CACF,CACF,CACF,ECfM,EAAoB,CACxB,MACA,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,MAAM,CAAK,CACxB,EACA,aAAgB,CACd,EAAO,CAGT,CACF,CAAC,EAEH,UAAa,CACX,EAAa,YAAY,EACzB,EAAO,EACP,EAAsB,EACtB,GAAc,OAAO,CACvB,CACF,CAAC,CACH,CACF,0kBEpKM,EAAW,gDAEJ,EAET,GAED,GAAgE,CAC/D,IAAM,EAAS,EAAK,CAAO,EAM3B,OAJI,OAAO,SAAa,KAAe,CAAC,SAAS,eAAe,CAAQ,IACtE,EAAA,EAAA,UAAA,CAAU,SAAU,EAAU,CAAM,EAG/B,CACL,GAAG,EACH,gCAAiC,GACjC,QAAS,CACP,UAAW,EAAW,EAAQ,IAC5B,IAAI,EAAS,EAAQ,EAAW,EAAQ,CAAO,CACnD,CACF,CACF"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/utils/redrawCanvas.ts","../src/utils/snapshotBlobAssets.ts","../src/utils/deepCloneElement.ts","../src/Snapshot.ts","../src/style.css?inline","../src/index.ts"],"sourcesContent":["export const redrawCanvas = (\n originalCanvas: HTMLCanvasElement,\n clonedCanvas: HTMLCanvasElement,\n) => {\n try {\n // Copy canvas dimensions\n clonedCanvas.width = originalCanvas.width\n clonedCanvas.height = originalCanvas.height\n\n // Copy canvas content\n const context = clonedCanvas.getContext(\"2d\")\n if (context) {\n context.drawImage(originalCanvas, 0, 0)\n }\n } catch (e) {\n console.warn(\n \"Could not copy canvas content - possible tainted canvas or cross-origin issue\",\n e,\n )\n }\n}\n","type SnapshotObjectUrlStore = {\n add: (url: string) => void\n revokeAll: () => void\n}\n\nconst RESOURCE_SELECTOR = [\n `img`,\n `video`,\n `audio`,\n `source`,\n `link`,\n `script`,\n].join(`,`)\n\nexport const createSnapshotObjectUrlStore = (): SnapshotObjectUrlStore => {\n const objectUrls = new Set<string>()\n\n return {\n add: (url) => {\n objectUrls.add(url)\n },\n revokeAll: () => {\n objectUrls.forEach((url) => {\n URL.revokeObjectURL(url)\n })\n objectUrls.clear()\n },\n }\n}\n\nconst getElementAssetUrl = (element: Element) =>\n element.getAttribute(`src`) || element.getAttribute(`href`)\n\nconst setElementAssetUrl = (element: Element, url: string) => {\n if (element.hasAttribute(`src`)) {\n element.setAttribute(`src`, url)\n } else if (element.hasAttribute(`href`)) {\n element.setAttribute(`href`, url)\n }\n}\n\nconst copyBlobUrl = async (\n url: string,\n document: Document,\n objectUrlStore: SnapshotObjectUrlStore,\n) => {\n const response = await fetch(url)\n const blob = await response.blob()\n const objectUrl = document.defaultView?.URL.createObjectURL(blob)\n\n if (!objectUrl) return\n\n objectUrlStore.add(objectUrl)\n\n return objectUrl\n}\n\nexport const copyBlobAssetReferences = async (\n root: ParentNode,\n document: Document,\n objectUrlStore: SnapshotObjectUrlStore,\n) => {\n const elementsWithAssets = Array.from(\n root.querySelectorAll(RESOURCE_SELECTOR),\n )\n\n await Promise.all(\n elementsWithAssets.map(async (element) => {\n const url = getElementAssetUrl(element)\n\n if (!url?.startsWith(`blob:`)) return\n\n let objectUrl: string | undefined\n\n try {\n objectUrl = await copyBlobUrl(url, document, objectUrlStore)\n } catch (error) {\n console.error(`Error copying snapshot blob asset:`, error)\n return\n }\n\n if (objectUrl) {\n setElementAssetUrl(element, objectUrl)\n }\n }),\n )\n}\n","import { waitForFrameLoad } from \"@prose-reader/core\"\nimport { combineLatest, defaultIfEmpty, from, of, switchMap } from \"rxjs\"\nimport { redrawCanvas } from \"./redrawCanvas\"\nimport {\n copyBlobAssetReferences,\n createSnapshotObjectUrlStore,\n} from \"./snapshotBlobAssets\"\n\nconst copyIframeContents = (\n originalIframes: NodeListOf<HTMLIFrameElement>,\n clonedIframes: NodeListOf<HTMLIFrameElement>,\n objectUrlStore: ReturnType<typeof createSnapshotObjectUrlStore>,\n) => {\n const iframeCopies = Array.from(originalIframes).map(\n (originalIframe, index) => {\n const clonedIframe = clonedIframes[index]\n\n if (!clonedIframe) return of(true)\n\n return waitForFrameLoad(of(clonedIframe)).pipe(\n switchMap(async () => {\n try {\n // Since we know they're same-origin EPUBs, we can directly copy content\n if (\n originalIframe.contentDocument &&\n clonedIframe.contentDocument\n ) {\n // Clone the entire body content\n const clonedBody =\n originalIframe.contentDocument.body.cloneNode(true)\n\n // Replace the body in the cloned iframe\n clonedIframe.contentDocument.body.replaceWith(clonedBody)\n\n // Also copy any head styles that might be important for rendering\n const originalHead = originalIframe.contentDocument.head\n const clonedHead = clonedIframe.contentDocument.head\n\n // Copy all style and link elements from head\n Array.from(\n originalHead.querySelectorAll('style, link[rel=\"stylesheet\"]'),\n ).forEach((node) => {\n clonedHead.appendChild(node.cloneNode(true))\n })\n\n await copyBlobAssetReferences(\n clonedIframe.contentDocument,\n clonedIframe.contentDocument,\n objectUrlStore,\n )\n }\n return true\n } catch (e) {\n console.error(\"Error copying iframe content:\", e)\n return false\n }\n }),\n )\n },\n )\n\n if (iframeCopies.length === 0) return of(true)\n\n return combineLatest(iframeCopies)\n}\n\nconst redrawCanvases = (sourceElement: HTMLElement, clone: HTMLElement) => {\n const originalCanvases = sourceElement.querySelectorAll(\"canvas\")\n const clonedCanvases = clone.querySelectorAll(\"canvas\")\n\n originalCanvases.forEach((originalCanvas, index) => {\n if (index < clonedCanvases.length) {\n const clonedCanvas = clonedCanvases[index] as HTMLCanvasElement\n\n redrawCanvas(originalCanvas, clonedCanvas)\n }\n })\n}\n\nexport function deepCloneElement(sourceElement: HTMLElement) {\n const objectUrlStore = createSnapshotObjectUrlStore()\n // Create a deep clone of the source element\n const clone = sourceElement.cloneNode(true) as HTMLElement\n\n // Find all iframes in the original element\n const originalIframes = sourceElement.querySelectorAll(\"iframe\")\n // Find all iframes in the cloned element\n const clonedIframes = clone.querySelectorAll(\"iframe\")\n\n // Handle canvases in the main document\n redrawCanvases(sourceElement, clone)\n\n const copyContents$ = combineLatest([\n from(\n copyBlobAssetReferences(\n clone,\n sourceElement.ownerDocument,\n objectUrlStore,\n ),\n ),\n copyIframeContents(originalIframes, clonedIframes, objectUrlStore),\n ])\n\n return {\n clone,\n ready$: copyContents$.pipe(defaultIfEmpty(true)),\n release: objectUrlStore.revokeAll,\n }\n}\n","import {\n DocumentRenderer,\n type Reader,\n type SpineItem,\n} from \"@prose-reader/core\"\nimport { filter, first, Observable, switchMap } from \"rxjs\"\nimport { deepCloneElement } from \"./utils/deepCloneElement\"\n\nconst SNAPSHOT_CLASS = \"prose-reader-enhancer-gallery-snapshot\"\nconst SNAPSHOT_MASK_CLASS = \"prose-reader-enhancer-gallery-snapshot-mask\"\nconst SNAPSHOT_PREVIEW_CLASS = \"prose-reader-enhancer-gallery-snapshot-preview\"\nconst SNAPSHOT_FRAME_CLASS = \"prose-reader-enhancer-gallery-snapshot-frame\"\n\nconst createSnapshotItem = (doc: Document) => {\n const spineItemContainerElement = doc.createElement(\"div\")\n spineItemContainerElement.classList.add(SNAPSHOT_CLASS)\n spineItemContainerElement.tabIndex = -1\n spineItemContainerElement.setAttribute(\"aria-hidden\", \"true\")\n spineItemContainerElement.setAttribute(\"inert\", \"\")\n\n const contentMask = doc.createElement(\"div\")\n\n contentMask.classList.add(SNAPSHOT_MASK_CLASS)\n\n spineItemContainerElement.appendChild(contentMask)\n\n return spineItemContainerElement\n}\n\nconst makeSnapshotPreviewInert = (element: HTMLElement) => {\n element.classList.add(SNAPSHOT_PREVIEW_CLASS)\n element.tabIndex = -1\n element.setAttribute(\"aria-hidden\", \"true\")\n element.setAttribute(\"inert\", \"\")\n\n element.querySelectorAll(\"iframe\").forEach((iframe) => {\n iframe.classList.add(SNAPSHOT_FRAME_CLASS)\n iframe.tabIndex = -1\n iframe.setAttribute(\"aria-hidden\", \"true\")\n iframe.setAttribute(\"inert\", \"\")\n })\n}\n\nexport class Snapshot extends Observable<HTMLElement> {\n constructor(\n reader: Reader,\n item: SpineItem,\n parent: Element,\n options: {\n height: number\n width: number\n },\n ) {\n super((subscriber) => {\n const parentDocument = parent.ownerDocument\n const unlockSpineItem = reader.spine.spineItemsLoader.forceOpen([item])\n let hasUnlockedSpineItem = false\n let releaseSnapshotAssets = () => {}\n let snapshotItem: HTMLElement | undefined\n\n const unlock = () => {\n if (hasUnlockedSpineItem) return\n\n hasUnlockedSpineItem = true\n unlockSpineItem()\n }\n\n const subscription = item.isReady$\n .pipe(\n filter((isReady) => isReady),\n first(),\n switchMap(() => {\n snapshotItem = createSnapshotItem(parentDocument)\n\n const pageSize = reader.viewport.value.pageSize\n const itemElement = snapshotItem\n const contentMask = itemElement?.children[0] as\n | HTMLElement\n | undefined\n\n if (!itemElement || !contentMask)\n throw new Error(\"No item element or content mask\")\n\n contentMask.style.top = \"0\"\n contentMask.style.left = \"0\"\n\n const measure = options\n const { height, width } = item.layoutInfo\n const numberOfPages = item.numberOfPages\n const widthScaleFullFrame = (measure.width / width) * numberOfPages\n const heightScale = measure.height / height\n\n // Use the minimum scale to ensure the element fits within both dimensions\n const scale = Math.min(widthScaleFullFrame, heightScale)\n\n const {\n clone: clonedElement,\n ready$: cloneReady$,\n release,\n } = deepCloneElement(item.element)\n releaseSnapshotAssets = release\n\n // cleanup unwanted elements from the spine\n Array.from(clonedElement.children).forEach((child) => {\n if (\n !child.classList.contains(\n DocumentRenderer.DOCUMENT_CONTAINER_CLASS_NAME,\n )\n ) {\n child.remove()\n }\n })\n\n clonedElement.style.left = \"0\"\n clonedElement.style.top = \"0\"\n clonedElement.style.position = \"relative\"\n makeSnapshotPreviewInert(clonedElement)\n\n /**\n * Now we adjust the mask to make it fit in the center and cover\n * only the required part of the spine item (hidding) the overflowing\n * pages for example.\n */\n const pageWidthAfterScale = pageSize.width * scale\n const pageHeightAfterScale = pageSize.height * scale\n\n contentMask.style.width = `${pageSize.width}px`\n contentMask.style.height = `${pageSize.height}px`\n contentMask.style.transformOrigin = \"0 0\"\n contentMask.style.transform = `scale(${scale})`\n\n if (pageWidthAfterScale < measure.width) {\n const gap = (measure.width - pageWidthAfterScale) / 2\n\n contentMask.style.left = `${gap}px`\n }\n\n if (pageHeightAfterScale < measure.height) {\n const gap = (measure.height - pageHeightAfterScale) / 2\n\n contentMask.style.top = `${gap}px`\n }\n\n parent.appendChild(itemElement)\n contentMask.appendChild(clonedElement)\n\n subscriber.next(itemElement)\n\n return cloneReady$\n }),\n )\n .subscribe({\n error: (error) => {\n unlock()\n subscriber.error(error)\n },\n complete: () => {\n unlock()\n // Keep the observable open after cloning so the thumbnail owns its\n // copied object URLs until React unsubscribes from this snapshot.\n },\n })\n\n return () => {\n subscription.unsubscribe()\n unlock()\n releaseSnapshotAssets()\n snapshotItem?.remove()\n }\n })\n }\n}\n",".prose-reader-enhancer-gallery-snapshot {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.prose-reader-enhancer-gallery-snapshot-mask {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n}\n\n.prose-reader-enhancer-gallery-snapshot-preview {\n position: relative;\n top: 0;\n left: 0;\n}\n\n.prose-reader-enhancer-gallery-snapshot,\n.prose-reader-enhancer-gallery-snapshot-mask,\n.prose-reader-enhancer-gallery-snapshot-preview,\n.prose-reader-enhancer-gallery-snapshot-frame,\n.prose-reader-enhancer-gallery-snapshot iframe {\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n}\n","import { injectCSS, type Reader } from \"@prose-reader/core\"\nimport { Snapshot } from \"./Snapshot\"\nimport styles from \"./style.css?inline\"\nimport type { GalleryEnhancerAPI } from \"./types\"\n\nexport type { GalleryEnhancerAPI }\n\nconst STYLE_ID = \"prose-reader-enhancer-gallery-snapshot-styles\"\n\nexport const galleryEnhancer =\n <InheritOptions, InheritOutput extends Reader>(\n next: (options: InheritOptions) => InheritOutput,\n ) =>\n (options: InheritOptions): InheritOutput & GalleryEnhancerAPI => {\n const reader = next(options)\n\n if (typeof document !== \"undefined\" && !document.getElementById(STYLE_ID)) {\n injectCSS(document, STYLE_ID, styles)\n }\n\n return {\n ...reader,\n __PROSE_READER_ENHANCER_GALLERY: true,\n gallery: {\n snapshot: (spineItem, parent, options) =>\n new Snapshot(reader, spineItem, parent, options),\n },\n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,EAAuB,EAAQ,OAAQ,CACzC,IAAM,GAAO,EAAQ,OAAS,GAAwB,EAEtD,EAAY,MAAM,IAAM,GAAG,EAAI,GACjC,CAOA,OALA,EAAO,YAAY,CAAW,EAC9B,EAAY,YAAY,CAAa,EAErC,EAAW,KAAK,CAAW,EAEpB,CACT,CAAC,CACH,CAAC,CACA,UAAU,CACT,MAAQ,GAAU,CAChB,EAAO,EACP,EAAW,MAAM,CAAK,CACxB,EACA,aAAgB,CACd,EAAO,CAGT,CACF,CAAC,EAEH,UAAa,CACX,EAAa,YAAY,EACzB,EAAO,EACP,EAAsB,EACtB,GAAc,OAAO,CACvB,CACF,CAAC,CACH,CACF,0kBEpKM,EAAW,gDAEJ,EAET,GAED,GAAgE,CAC/D,IAAM,EAAS,EAAK,CAAO,EAM3B,OAJI,OAAO,SAAa,KAAe,CAAC,SAAS,eAAe,CAAQ,IACtE,EAAA,EAAA,UAAA,CAAU,SAAU,EAAU,CAAM,EAG/B,CACL,GAAG,EACH,gCAAiC,GACjC,QAAS,CACP,UAAW,EAAW,EAAQ,IAC5B,IAAI,EAAS,EAAQ,EAAW,EAAQ,CAAO,CACnD,CACF,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prose-reader/enhancer-gallery",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.373.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test": "vitest run --coverage"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@prose-reader/core": "^1.
|
|
27
|
+
"@prose-reader/core": "^1.373.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"rxjs": "*"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rxjs": "*"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "a58b61c522a90addce2baaab1b268d2e9b8fed73"
|
|
36
36
|
}
|