@openinspection/visa
v0.0.1
Published
Headless, adapter-based file preview primitives.
Readme
Visa
Headless, adapter-based file preview primitives for folders of documents.
0.0.1 public API
Visa 0.0.1 supports PDF, image, and CSV previews for internal OpenInspection apps.
Public import paths:
import { createVisaViewer, type DocumentDescriptor, type Folder } from "@openinspection/visa";
import { VisaViewerProvider, useVisaViewerState } from "@openinspection/visa/react";
import { VisaDocumentPages, visaThemeCss } from "@openinspection/visa/react-ui";
import { pdfAdapter } from "@openinspection/visa/pdf";
import { pdfPageRenderer, visaPdfCss } from "@openinspection/visa/pdf/react";
import { imageAdapter } from "@openinspection/visa/image";
import { imagePageRenderer, visaImageCss } from "@openinspection/visa/image/react";
import { csvAdapter } from "@openinspection/visa/csv";
import { tabularPageRenderer, visaTabularCss } from "@openinspection/visa/csv/react";Visa does not inject styles automatically. Host apps opt into the CSS strings so style ordering stays app-owned:
const style = document.createElement("style");
style.textContent = [visaThemeCss, visaPdfCss, visaImageCss, visaTabularCss].join("\n");
document.head.append(style);The supported public story is: create a viewer from a folder and official adapters, provide it to React, and render pages with the official renderer objects.
