@formless63/viewer-media 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 formless63
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
- # Temporary Holding Version
1
+ # @formless63/viewer-media
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `ImageViewer`, `TextViewer`, `HtmlViewer`.
4
+
5
+ HTML renders in an empty sandbox with remote content off.
6
+
7
+ [Formats and limits](https://github.com/formless63/netlibs/blob/main/docs/viewers/formats.md) ·
8
+ [Integration](https://github.com/formless63/netlibs/blob/main/docs/viewers/integration.md)
@@ -0,0 +1 @@
1
+ {"version":"7.0.2","root":[[81,85]],"packageJsons":["../../../node_modules/.bun/@types+react@19.3.0/node_modules/@types/react/package.json","../../../node_modules/.bun/csstype@3.2.4/node_modules/csstype/package.json","../../../node_modules/.bun/react@19.3.1/node_modules/react/package.json","../../viewer-core/package.json","../package.json"],"missingPackageJsons":["../../../node_modules/@types/react/jsx-runtime/package.json","../../../node_modules/react/jsx-runtime/package.json","../node_modules/react/jsx-runtime/package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../../node_modules/.bun/@types+react@19.3.0/node_modules/@types/react/global.d.ts","../../../node_modules/.bun/csstype@3.2.4/node_modules/csstype/index.d.ts","../../../node_modules/.bun/@types+react@19.3.0/node_modules/@types/react/index.d.ts","../../viewer-core/dist/errors.d.ts","../../viewer-core/dist/types.d.ts","../../viewer-core/dist/registry.d.ts","../../viewer-core/dist/context.d.ts","../../viewer-core/dist/file-viewer.d.ts","../../viewer-core/dist/format.d.ts","../../viewer-core/dist/source.d.ts","../../viewer-core/dist/hooks.d.ts","../../viewer-core/dist/pan-zoom.d.ts","../../viewer-core/dist/theme-color.d.ts","../../viewer-core/dist/ui.d.ts","../../viewer-core/dist/use-latest.d.ts","../../viewer-core/dist/index.d.ts","../../../node_modules/.bun/@types+react@19.3.0/node_modules/@types/react/jsx-runtime.d.ts","../src/image-viewer.tsx","../src/text-viewer.tsx","../src/html-viewer.tsx","../src/definitions.ts","../src/index.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995",{"version":"aae8996e8b5684814785a42cbbefcd79","affectsGlobalScope":true,"impliedNodeFormat":1},"abad6dd56cc8caf095c165df8124d237",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"086b8ccc1aa2a8df8144951e6a412a39","affectsGlobalScope":true,"impliedNodeFormat":1},"3e1e1a1d3937bc4cc0bcb851fd51fa05","7e6f57dc732c3847d23e3a339c57333b","23619eeeea49a3138548fa0174e3f786","6091c5059ca0bbf64b62b4a71e7f40e6","8e3641c3cfb23347799bfd1e0eee4f75","531047a4e91bff5b24497c1259215c59","2c517af43f65b735cd688c8a325b19a3","9a2d12f06ef2b234001642e530f9e902","e8e31f6bc0a914b6e6ea177edc93a4ef","d16878d0ea574140dde01f57a4ba9007","2400f4a75dcc1ba536c32ea2f1eedadc","9aa48af104856ff657df62a0ac39faf2","74e1509b1fa3ca714f649caffc3f6d0c","1f028beb3a889a9dde2417a1bc33b353","f889597c93be9bd322f87c619588438b","c8b6a8a818c9ae9670eac052d143a588",{"version":"8df16cec41f53b60de3ed8494a60093b","signature":"67fadf8b2c3253f682f63e09ed6e7195","impliedNodeFormat":1},{"version":"433ecbd37353b18a7616775b9704e4bb","signature":"b2a1aab18d9117b9521b33982775f165","impliedNodeFormat":1},{"version":"3f12bba36cc8677ce6ec8fa1e072436e","signature":"5bbac3257074e156c9f1a20960f1ad3d","impliedNodeFormat":1},{"version":"7fb6e98c1e52f8fcac229ea03cd4ea06","signature":"3db705f607ccb6a04ed19c840be38687","impliedNodeFormat":1},"f389f92b171c3d2fed90bea323ec25d0"],"fileIdsList":[[64,65],[66],[66,68,69],[66,68],[67,68,73],[67,68,69,70,71,72,73,74,75,76,77,78],[68],[66,67],[66,67,68,73],[79,81,82,83],[79,81],[79],[81,82,83,84],[66,79]],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"declarationMap":true,"erasableSyntaxOnly":false,"exactOptionalPropertyTypes":false,"jsx":4,"module":99,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"../src","skipLibCheck":true,"strict":true,"sourceMap":true,"target":10,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[66,1],[80,2],[70,3],[71,4],[74,5],[79,6],[75,2],[69,4],[73,7],[68,8],[77,9],[78,2],[84,10],[83,11],[81,12],[85,13],[82,14]],"latestChangedDtsFile":"./index.d.ts"}
@@ -0,0 +1,5 @@
1
+ import type { ViewerDefinition } from '@formless63/viewer-core';
2
+ export declare const imageDefinition: ViewerDefinition;
3
+ export declare const textDefinition: ViewerDefinition;
4
+ export declare const htmlDefinition: ViewerDefinition;
5
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,eAAO,MAAM,eAAe,EAAE,gBAuB7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAM5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAO5B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { headText } from '@formless63/viewer-core';
2
+ export const imageDefinition = {
3
+ key: 'image',
4
+ label: 'Image',
5
+ extensions: ['png', 'jpg', 'jpeg', 'gif', 'webp', 'avif', 'bmp', 'svg'],
6
+ contentTypes: [
7
+ 'image/png',
8
+ 'image/jpeg',
9
+ 'image/gif',
10
+ 'image/webp',
11
+ 'image/avif',
12
+ 'image/bmp',
13
+ 'image/svg+xml',
14
+ ],
15
+ sniff: (head) => {
16
+ const text = headText(head, 16);
17
+ return (text.startsWith('\u0089PNG') ||
18
+ text.startsWith('ÿØÿ') ||
19
+ text.startsWith('GIF8') ||
20
+ (text.startsWith('RIFF') && text.slice(8, 12) === 'WEBP'));
21
+ },
22
+ load: () => import('./image-viewer.js'),
23
+ };
24
+ export const textDefinition = {
25
+ key: 'text',
26
+ label: 'Text',
27
+ extensions: ['txt', 'log', 'json', 'xml', 'yaml', 'yml', 'toml', 'ini', 'csv', 'tsv'],
28
+ contentTypes: ['text/plain', 'application/json', 'application/xml', 'text/xml', 'text/csv'],
29
+ load: () => import('./text-viewer.js'),
30
+ };
31
+ export const htmlDefinition = {
32
+ key: 'html',
33
+ label: 'HTML document',
34
+ extensions: ['html', 'htm'],
35
+ contentTypes: ['text/html'],
36
+ aspectRatio: '8.5 / 11',
37
+ load: () => import('./html-viewer.js'),
38
+ };
39
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;IACvE,YAAY,EAAE;QACZ,W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+ import { type ViewerInput, type ViewerProps } from '@formless63/viewer-core';
2
+ export interface HtmlViewerProps extends ViewerProps {
3
+ /** Image shown when the HTML cannot be loaded, e.g. a page screenshot. */
4
+ fallbackImage?: ViewerInput | undefined;
5
+ /**
6
+ * Let the document request remote images, styles and fonts. Off by default:
7
+ * stored emails carry tracking pixels, and captured pages are usually inlined.
8
+ */
9
+ remoteContent?: boolean | undefined;
10
+ }
11
+ /** Add a CSP after any doctype: content before it would force quirks mode. */
12
+ export declare function withLocalOnlyPolicy(html: string): string;
13
+ /**
14
+ * Untrusted HTML (captured pages, stored email bodies) in a sandboxed frame.
15
+ *
16
+ * SECURITY (load-bearing): `sandbox=""` is EMPTY. Without `allow-scripts` and
17
+ * `allow-same-origin` the browser forces an opaque origin with scripting off,
18
+ * so the document cannot run code or reach the host's DOM, cookies or storage.
19
+ * Do not add tokens.
20
+ */
21
+ export default function HtmlViewer({ fallbackImage, remoteContent, ...props }: HtmlViewerProps): import("react").JSX.Element;
22
+ //# sourceMappingURL=html-viewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-viewer.d.ts","sourceRoot":"","sources":["../src/html-viewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,0EAA0E;IAC1E,aAAa,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACrC;AAKD,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,aAAa,EACb,aAAqB,EACrB,GAAG,KAAK,EACT,EAAE,eAAe,+BAkCjB"}
@@ -0,0 +1,31 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { loadViewerText, useResolvedSource, useViewerLoad, ViewerFailure, ViewerLoading, ViewerRoot, } from '@formless63/viewer-core';
4
+ import ImageViewer from './image-viewer.js';
5
+ const LOCAL_ONLY_CSP = "default-src 'none'; img-src data: blob:; media-src data: blob:; font-src data:; style-src 'unsafe-inline' data:";
6
+ /** Add a CSP after any doctype: content before it would force quirks mode. */
7
+ export function withLocalOnlyPolicy(html) {
8
+ const meta = `<meta http-equiv="Content-Security-Policy" content="${LOCAL_ONLY_CSP}">`;
9
+ const lead = /^(?:\uFEFF|\s|<!--[\s\S]*?-->)*<!doctype[^>]*>/i.exec(html)?.[0] ?? '';
10
+ return lead + meta + html.slice(lead.length);
11
+ }
12
+ /**
13
+ * Untrusted HTML (captured pages, stored email bodies) in a sandboxed frame.
14
+ *
15
+ * SECURITY (load-bearing): `sandbox=""` is EMPTY. Without `allow-scripts` and
16
+ * `allow-same-origin` the browser forces an opaque origin with scripting off,
17
+ * so the document cannot run code or reach the host's DOM, cookies or storage.
18
+ * Do not add tokens.
19
+ */
20
+ export default function HtmlViewer({ fallbackImage, remoteContent = false, ...props }) {
21
+ const source = useResolvedSource(props);
22
+ const { state, retry } = useViewerLoad(source, loadViewerText, {
23
+ onStatusChange: props.onStatusChange,
24
+ });
25
+ const name = source.file.name;
26
+ if (state.status === 'error' && fallbackImage !== undefined) {
27
+ return _jsx(ImageViewer, { ...props, contentType: undefined, source: fallbackImage });
28
+ }
29
+ return (_jsx(ViewerRoot, { className: props.className, label: name ? `HTML: ${name}` : 'HTML document', status: state.status, style: props.style, viewer: 'html', children: state.status === 'error' ? (_jsx(ViewerFailure, { error: state.error, onRetry: retry, source: source })) : state.status === 'loading' ? (_jsx(ViewerLoading, {})) : (_jsx("iframe", { className: 'fv-fill', referrerPolicy: 'no-referrer', sandbox: '', srcDoc: remoteContent ? state.value : withLocalOnlyPolicy(state.value), style: { background: '#fff' }, title: name ?? 'HTML document' })) }));
30
+ }
31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,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,eAAe,EAC/C,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAC,MAAM,YAEZ,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAC1B,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI,CACtE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAC/B,KAAC,aAAa,KAAG,CAClB,CAAC,CAAC,CAAC,CACF,iBACE,SAAS,EAAC,SAAS,EACnB,cAAc,EAAC,aAAa,EAC5B,OAAO,EAAC,EAAE,EACV,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,EACtE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAC7B,KAAK,EAAE,IAAI,IAAI,eAAe,GAC9B,CACH,GACU,CACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type ViewerProps } from '@formless63/viewer-core';
2
+ /**
3
+ * Raster and SVG images, fit to the frame with pan/zoom. SVGs go through
4
+ * `<img>`, which never executes their scripts or loads external resources.
5
+ */
6
+ export default function ImageViewer(props: ViewerProps): import("react").JSX.Element;
7
+ //# sourceMappingURL=image-viewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-viewer.d.ts","sourceRoot":"","sources":["../src/image-viewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,WAAW,+BA2CrD"}
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { disposeViewerUrl, loadViewerUrl, PanZoom, useResolvedSource, useViewerLoad, ViewerError, ViewerFailure, ViewerLoading, ViewerRoot, } from '@formless63/viewer-core';
4
+ /**
5
+ * Raster and SVG images, fit to the frame with pan/zoom. SVGs go through
6
+ * `<img>`, which never executes their scripts or loads external resources.
7
+ */
8
+ export default function ImageViewer(props) {
9
+ const { controls, className, style, onStatusChange, onIntrinsicAspectRatio } = props;
10
+ const source = useResolvedSource(props);
11
+ const { state, retry, fail } = useViewerLoad(source, loadViewerUrl, {
12
+ dispose: disposeViewerUrl,
13
+ onStatusChange,
14
+ deferReady: true,
15
+ });
16
+ const name = source.file.name;
17
+ return (_jsx(ViewerRoot, { className: className, label: name ? `Image: ${name}` : 'Image', status: state.status, style: style, viewer: 'image', children: state.status === 'error' ? (_jsx(ViewerFailure, { error: state.error, onRetry: retry, source: source })) : state.status === 'loading' ? (_jsx(ViewerLoading, {})) : (_jsx(PanZoom, { controls: controls, label: 'Image view', children: _jsx("img", { alt: name ?? 'Image preview', className: 'fv-fill', draggable: false, onError: () => fail(new ViewerError('parse-failed', 'The image could not be decoded')), onLoad: (event) => {
18
+ const { naturalWidth, naturalHeight } = event.currentTarget;
19
+ if (naturalWidth > 0 && naturalHeight > 0) {
20
+ onIntrinsicAspectRatio?.(naturalWidth / naturalHeight);
21
+ }
22
+ onStatusChange?.('ready');
23
+ }, src: state.value.url, style: { objectFit: 'contain' } }) })) }));
24
+ }
25
+ //# sourceMappingURL=image-viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../src/image-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,aAAa,EACb,WAAW,E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WAAW,CAAC,cAAc,EAAE,gCAAgC,CAAC,CAAC,EACtF,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;oBAChB,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC;oBAC5D,IAAI,YAAY,GAAG,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;wBAC1C,sBAAsB,EAAE,CAAC,YAAY,GAAG,aAAa,CAAC,CAAC;oBACzD,CAAC;oBACD,cAAc,EAAE,CAAC,OAAO,CAAC,CAAC;gBAC5B,CAAC,EACD,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EACpB,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,GAC/B,GACM,CACX,GACU,CACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './definitions.ts';
2
+ export { default as ImageViewer } from './image-viewer.tsx';
3
+ export { default as TextViewer, type TextViewerProps } from './text-viewer.tsx';
4
+ export { default as HtmlViewer, type HtmlViewerProps } from './html-viewer.tsx';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './definitions.js';
2
+ export { default as ImageViewer } from './image-viewer.js';
3
+ export { default as TextViewer } from './text-viewer.js';
4
+ export { default as HtmlViewer } from './html-viewer.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAwB,MAAM,kBAAmB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAwB,MAAM,kBAAmB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type ViewerProps } from '@formless63/viewer-core';
2
+ export interface TextViewerProps extends ViewerProps {
3
+ /** Characters rendered before "Show all". Huge text nodes stall layout. */
4
+ maxCharacters?: number | undefined;
5
+ /** Wrap long lines. Defaults to true. */
6
+ wrap?: boolean | undefined;
7
+ }
8
+ /** Plain text, shown verbatim. No highlighting and no interpretation. */
9
+ export default function TextViewer({ maxCharacters, wrap, ...props }: TextViewerProps): import("react").JSX.Element;
10
+ //# sourceMappingURL=text-viewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-viewer.d.ts","sourceRoot":"","sources":["../src/text-viewer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,yCAAyC;IACzC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B;AAED,yEAAyE;AACzE,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,aAAuB,EACvB,IAAW,EACX,GAAG,KAAK,EACT,EAAE,eAAe,+BA+CjB"}
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ import { loadViewerText, useResolvedSource, useViewerLoad, ViewerFailure, ViewerLoading, ViewerRoot, } from '@formless63/viewer-core';
5
+ /** Plain text, shown verbatim. No highlighting and no interpretation. */
6
+ export default function TextViewer({ maxCharacters = 200_000, wrap = true, ...props }) {
7
+ const source = useResolvedSource(props);
8
+ const { state, retry } = useViewerLoad(source, loadViewerText, {
9
+ onStatusChange: props.onStatusChange,
10
+ });
11
+ const [expanded, setExpanded] = useState(null);
12
+ const name = source.file.name;
13
+ return (_jsx(ViewerRoot, { className: props.className, label: name ? `Text: ${name}` : 'Text', status: state.status, style: props.style, viewer: 'text', children: state.status === 'error' ? (_jsx(ViewerFailure, { error: state.error, onRetry: retry, source: source })) : state.status === 'loading' ? (_jsx(ViewerLoading, {})) : (_jsxs("div", { style: { height: '100%', overflow: 'auto' }, tabIndex: 0, children: [_jsx("pre", { style: {
14
+ margin: 0,
15
+ padding: '0.75rem',
16
+ font: '0.75rem/1.5 ui-monospace, monospace',
17
+ whiteSpace: wrap ? 'pre-wrap' : 'pre',
18
+ overflowWrap: wrap ? 'anywhere' : 'normal',
19
+ }, children: expanded === state.value ? state.value : state.value.slice(0, maxCharacters) }), state.value.length > maxCharacters && expanded !== state.value ? (_jsxs("button", { className: 'fv-text-button', onClick: () => setExpanded(state.value), style: { padding: '0.75rem' }, type: 'button', children: ["Show all ", state.value.length.toLocaleString(), " characters"] })) : null] })) }));
20
+ }
21
+ //# sourceMappingURL=text-viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-viewer.js","sourceRoot":"","sources":["../src/text-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,GAEX,MAAM,yBAAyB,CAAC;AASjC,yEAAyE;AACzE,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,aAAa,GAAG,OAAO,EACvB,IAAI,GAAG,IAAI,EACX,GAAG,KAAK,EACQ;IAChB,MAAM,MAAM,G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KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,GACzE,EACL,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,aAAa,IAAI,QAAQ,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAChE,kBACE,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,EACvC,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAC7B,IAAI,EAAC,QAAQ,0BAEH,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,mBACtC,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,GACU,CACd,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@formless63/viewer-media",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Image, text and sandboxed-HTML viewers.",
5
+ "keywords": [
6
+ "react",
7
+ "image",
8
+ "viewer"
9
+ ],
10
+ "license": "MIT",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/formless63/netlibs.git",
14
+ "directory": "packages/viewer-media"
15
+ },
16
+ "homepage": "https://github.com/formless63/netlibs/tree/main/packages/viewer-media#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/formless63/netlibs/issues"
19
+ },
20
+ "type": "module",
21
+ "sideEffects": [
22
+ "**/*.css"
23
+ ],
24
+ "engines": {
25
+ "node": ">=22"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "LICENSE"
31
+ ],
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js"
36
+ },
37
+ "./definitions": {
38
+ "types": "./dist/definitions.d.ts",
39
+ "import": "./dist/definitions.js"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "dependencies": {
44
+ "@formless63/viewer-core": "0.1.0"
45
+ },
46
+ "peerDependencies": {
47
+ "react": "^19.0.0"
48
+ },
49
+ "publishConfig": {
50
+ "access": "public"
51
+ }
52
+ }