@floegence/floe-webapp-core 0.64.0 → 0.65.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/PDFJS-LICENSE +177 -0
- package/dist/images/altText_add.svg +3 -0
- package/dist/images/altText_disclaimer.svg +3 -0
- package/dist/images/altText_done.svg +3 -0
- package/dist/images/altText_spinner.svg +30 -0
- package/dist/images/altText_warning.svg +3 -0
- package/dist/images/annotation-check.svg +11 -0
- package/dist/images/annotation-comment.svg +16 -0
- package/dist/images/annotation-help.svg +26 -0
- package/dist/images/annotation-insert.svg +10 -0
- package/dist/images/annotation-key.svg +11 -0
- package/dist/images/annotation-newparagraph.svg +11 -0
- package/dist/images/annotation-noicon.svg +7 -0
- package/dist/images/annotation-note.svg +42 -0
- package/dist/images/annotation-paperclip.svg +6 -0
- package/dist/images/annotation-paragraph.svg +16 -0
- package/dist/images/annotation-pushpin.svg +7 -0
- package/dist/images/checkmark.svg +5 -0
- package/dist/images/comment-actionsButton.svg +3 -0
- package/dist/images/comment-closeButton.svg +3 -0
- package/dist/images/comment-editButton.svg +8 -0
- package/dist/images/comment-popup-editButton.svg +5 -0
- package/dist/images/cursor-editorFreeHighlight.svg +6 -0
- package/dist/images/cursor-editorFreeText.svg +3 -0
- package/dist/images/cursor-editorInk.svg +4 -0
- package/dist/images/cursor-editorTextHighlight.svg +8 -0
- package/dist/images/editor-toolbar-delete.svg +5 -0
- package/dist/images/editor-toolbar-edit.svg +3 -0
- package/dist/images/findbarButton-next.svg +3 -0
- package/dist/images/findbarButton-previous.svg +3 -0
- package/dist/images/gv-toolbarButton-download.svg +3 -0
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/loading.svg +1 -0
- package/dist/images/messageBar_closingButton.svg +3 -0
- package/dist/images/messageBar_info.svg +3 -0
- package/dist/images/messageBar_warning.svg +3 -0
- package/dist/images/pages_closeButton.svg +3 -0
- package/dist/images/pages_selected.svg +7 -0
- package/dist/images/pages_viewArrow.svg +3 -0
- package/dist/images/pages_viewButton.svg +3 -0
- package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
- package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
- package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
- package/dist/images/signature-properties-row-check.svg +4 -0
- package/dist/images/toolbarButton-bookmark.svg +3 -0
- package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
- package/dist/images/toolbarButton-download.svg +4 -0
- package/dist/images/toolbarButton-editorFreeText.svg +5 -0
- package/dist/images/toolbarButton-editorHighlight.svg +6 -0
- package/dist/images/toolbarButton-editorInk.svg +4 -0
- package/dist/images/toolbarButton-editorSignature.svg +6 -0
- package/dist/images/toolbarButton-editorStamp.svg +8 -0
- package/dist/images/toolbarButton-menuArrow.svg +3 -0
- package/dist/images/toolbarButton-menuArrowNova.svg +3 -0
- package/dist/images/toolbarButton-openFile.svg +3 -0
- package/dist/images/toolbarButton-pageDown.svg +3 -0
- package/dist/images/toolbarButton-pageUp.svg +3 -0
- package/dist/images/toolbarButton-presentationMode.svg +3 -0
- package/dist/images/toolbarButton-print.svg +3 -0
- package/dist/images/toolbarButton-search.svg +3 -0
- package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
- package/dist/images/toolbarButton-signaturePropertiesError.svg +7 -0
- package/dist/images/toolbarButton-signaturePropertiesVerified.svg +7 -0
- package/dist/images/toolbarButton-viewAttachments.svg +3 -0
- package/dist/images/toolbarButton-viewLayers.svg +3 -0
- package/dist/images/toolbarButton-viewOutline.svg +3 -0
- package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
- package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
- package/dist/images/toolbarButton-zoomIn.svg +3 -0
- package/dist/images/toolbarButton-zoomOut.svg +3 -0
- package/dist/images/treeitem-collapsed.svg +1 -0
- package/dist/images/treeitem-expanded.svg +1 -0
- package/dist/pdf/PdfDocumentSurface.d.ts +71 -0
- package/dist/pdf/PdfDocumentSurface.js +235 -0
- package/dist/pdf/localization.d.ts +21 -0
- package/dist/pdf/localization.js +50 -0
- package/dist/pdf.css +6428 -0
- package/dist/pdf.d.ts +5 -0
- package/dist/pdf.js +7 -0
- package/package.json +16 -4
- package/scripts/pdf-assets.d.mts +2 -0
- package/scripts/pdf-assets.mjs +52 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GenericL10n } from 'pdfjs-dist/web/pdf_viewer.mjs';
|
|
2
|
+
export interface PdfLocalizedMessage {
|
|
3
|
+
text?: string;
|
|
4
|
+
attributes?: Partial<Record<'title' | 'aria-label' | 'alt' | 'placeholder', string>>;
|
|
5
|
+
}
|
|
6
|
+
export type PdfLocalize = (id: string, args: Record<string, unknown>) => PdfLocalizedMessage;
|
|
7
|
+
/** Bridge PDF.js generated layer labels to the host's existing localization
|
|
8
|
+
* catalog. Observes one stable viewer root, never detached virtualized pages. */
|
|
9
|
+
export declare class PdfLocalization extends GenericL10n {
|
|
10
|
+
#private;
|
|
11
|
+
readonly root: HTMLElement;
|
|
12
|
+
readonly localize: PdfLocalize;
|
|
13
|
+
constructor(root: HTMLElement, localize: PdfLocalize, language?: string);
|
|
14
|
+
private apply;
|
|
15
|
+
get(ids: string | string[], args?: Record<string, unknown> | null, _fallback?: string): Promise<string | string[]>;
|
|
16
|
+
translate(element: Element): Promise<void>;
|
|
17
|
+
translateOnce(element: Element): Promise<void>;
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
destroy(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GenericL10n as o } from "pdfjs-dist/web/pdf_viewer.mjs";
|
|
2
|
+
class l extends o {
|
|
3
|
+
constructor(t, a, i = "en-US") {
|
|
4
|
+
super(i), this.root = t, this.localize = a, this.#t = new MutationObserver((e) => {
|
|
5
|
+
for (const r of e)
|
|
6
|
+
if (r.type === "attributes") this.apply(r.target);
|
|
7
|
+
else for (const s of r.addedNodes) s instanceof Element && this.translateOnce(s);
|
|
8
|
+
}), this.#t.observe(t, {
|
|
9
|
+
subtree: !0,
|
|
10
|
+
childList: !0,
|
|
11
|
+
attributes: !0,
|
|
12
|
+
attributeFilter: ["data-l10n-id", "data-l10n-args"]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
#t;
|
|
16
|
+
apply(t) {
|
|
17
|
+
const a = t.getAttribute("data-l10n-id");
|
|
18
|
+
if (!a) return;
|
|
19
|
+
let i = {};
|
|
20
|
+
try {
|
|
21
|
+
i = JSON.parse(t.getAttribute("data-l10n-args") ?? "{}");
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
const e = this.localize(a, i);
|
|
25
|
+
e.text !== void 0 && t.textContent !== e.text && (t.textContent = e.text);
|
|
26
|
+
for (const [r, s] of Object.entries(e.attributes ?? {}))
|
|
27
|
+
s !== void 0 && t.getAttribute(r) !== s && t.setAttribute(r, s);
|
|
28
|
+
}
|
|
29
|
+
async get(t, a, i) {
|
|
30
|
+
const e = (r) => this.localize(r, a ?? {}).text ?? "";
|
|
31
|
+
return Array.isArray(t) ? t.map(e) : e(t);
|
|
32
|
+
}
|
|
33
|
+
async translate(t) {
|
|
34
|
+
await this.translateOnce(t);
|
|
35
|
+
}
|
|
36
|
+
async translateOnce(t) {
|
|
37
|
+
this.apply(t);
|
|
38
|
+
for (const a of t.querySelectorAll("[data-l10n-id]")) this.apply(a);
|
|
39
|
+
}
|
|
40
|
+
pause() {
|
|
41
|
+
}
|
|
42
|
+
resume() {
|
|
43
|
+
}
|
|
44
|
+
async destroy() {
|
|
45
|
+
this.#t.disconnect(), await super.destroy();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
l as PdfLocalization
|
|
50
|
+
};
|