@floegence/floe-webapp-core 0.78.3 → 0.78.7
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/components/layout/AppViewport.js +24 -14
- package/dist/pdf/PdfDocumentSurface.d.ts +4 -3
- package/dist/pdf/PdfDocumentSurface.js +2 -2
- package/dist/pdf/localization.d.ts +1 -1
- package/dist/pdf/localization.js +1 -1
- package/dist/pdf.css +1 -1
- package/dist/viewport.js +1 -1
- package/package.json +1 -1
- package/scripts/pdf-assets.mjs +8 -9
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { viewportStyle as g, observeViewport as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
const [i,
|
|
1
|
+
import { insert as d, effect as u, className as f, setAttribute as p, style as m, template as w, use as h } from "solid-js/web";
|
|
2
|
+
import { createSignal as V, onMount as b, onCleanup as s, untrack as y } from "solid-js";
|
|
3
|
+
import { viewportStyle as g, observeViewport as E } from "../../viewport.js";
|
|
4
|
+
var L = /* @__PURE__ */ w("<div data-floe-app-viewport style=position:fixed;inset:0;overflow:hidden;min-height:0>");
|
|
5
|
+
function A(o) {
|
|
6
|
+
const [i, v] = V();
|
|
7
7
|
let n;
|
|
8
|
-
return
|
|
8
|
+
return b(() => {
|
|
9
9
|
const e = n?.ownerDocument.defaultView;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
if (!e) return;
|
|
11
|
+
const r = () => {
|
|
12
|
+
Math.abs((e.visualViewport?.scale ?? 1) - 1) >= 0.01 || (e.scrollX || e.scrollY) && e.scrollTo({
|
|
13
|
+
left: 0,
|
|
14
|
+
top: 0,
|
|
15
|
+
behavior: "instant"
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
e.addEventListener("scroll", r), e.visualViewport?.addEventListener("resize", r), r(), s(() => {
|
|
19
|
+
e.removeEventListener("scroll", r), e.visualViewport?.removeEventListener("resize", r);
|
|
20
|
+
}), s(E(e, (t) => {
|
|
21
|
+
v(t), y(() => o.onViewportChange?.(t));
|
|
12
22
|
}));
|
|
13
23
|
}), (() => {
|
|
14
|
-
var e =
|
|
15
|
-
return typeof
|
|
16
|
-
var a =
|
|
24
|
+
var e = L(), r = n;
|
|
25
|
+
return typeof r == "function" ? h(r, e) : n = e, d(e, () => o.children), u((t) => {
|
|
26
|
+
var a = o.class, l = i()?.keyboardOpen || void 0, c = {
|
|
17
27
|
...i() ? g(i()) : {
|
|
18
28
|
height: "100dvh"
|
|
19
29
|
}
|
|
20
30
|
};
|
|
21
|
-
return a !== t.e &&
|
|
31
|
+
return a !== t.e && f(e, t.e = a), l !== t.t && p(e, "data-keyboard-open", t.t = l), t.a = m(e, c, t.a), t;
|
|
22
32
|
}, {
|
|
23
33
|
e: void 0,
|
|
24
34
|
t: void 0,
|
|
@@ -27,5 +37,5 @@ function D(r) {
|
|
|
27
37
|
})();
|
|
28
38
|
}
|
|
29
39
|
export {
|
|
30
|
-
|
|
40
|
+
A as AppViewport
|
|
31
41
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnnotationEditorUIManager } from 'pdfjs-dist';
|
|
1
|
+
import { AnnotationEditorUIManager } from 'pdfjs-dist/legacy/build/pdf.mjs';
|
|
2
2
|
import type { PDFDocumentProxy, PDFPageProxy } from 'pdfjs-dist';
|
|
3
|
-
import { EventBus, PDFFindController, PDFLinkService, PDFPageView } from 'pdfjs-dist/web/pdf_viewer.mjs';
|
|
3
|
+
import { EventBus, PDFFindController, PDFLinkService, PDFPageView } from 'pdfjs-dist/legacy/web/pdf_viewer.mjs';
|
|
4
4
|
export interface PdfEditorState {
|
|
5
5
|
canUndo: boolean;
|
|
6
6
|
canRedo: boolean;
|
|
@@ -28,7 +28,8 @@ export interface PdfPageRenderer {
|
|
|
28
28
|
render: (scale: number) => Promise<void>;
|
|
29
29
|
dispose: () => void;
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
31
|
+
/** The official legacy runtime and worker support embedded clients without the
|
|
32
|
+
* newest JavaScript APIs. All resources are host-served; scripting and XFA are disabled. */
|
|
32
33
|
export declare function openPdfDocument(bytes: Uint8Array<ArrayBuffer>, assetsUrl: string): import("pdfjs-dist/types/src/display/api").PDFDocumentLoadingTask;
|
|
33
34
|
/** PDF.js defaults to a single viewer per document. Scope its public input handlers
|
|
34
35
|
* so multiple embedded readers cannot consume each other's shortcuts or clipboard. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GlobalWorkerOptions as u, getDocument as f, AnnotationMode as c, AnnotationEditorUIManager as g } from "pdfjs-dist";
|
|
2
|
-
import { GenericL10n as p, EventBus as m, PDFLinkService as v, PDFFindController as S, PDFPageView as b } from "pdfjs-dist/web/pdf_viewer.mjs";
|
|
1
|
+
import { GlobalWorkerOptions as u, getDocument as f, AnnotationMode as c, AnnotationEditorUIManager as g } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
2
|
+
import { GenericL10n as p, EventBus as m, PDFLinkService as v, PDFFindController as S, PDFPageView as b } from "pdfjs-dist/legacy/web/pdf_viewer.mjs";
|
|
3
3
|
function C(h, e) {
|
|
4
4
|
const n = new URL(e, document.baseURI).href.replace(/\/?$/, "/");
|
|
5
5
|
return u.workerSrc = `${n}pdf.worker.min.mjs`, f({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenericL10n } from 'pdfjs-dist/web/pdf_viewer.mjs';
|
|
1
|
+
import { GenericL10n } from 'pdfjs-dist/legacy/web/pdf_viewer.mjs';
|
|
2
2
|
export interface PdfLocalizedMessage {
|
|
3
3
|
text?: string;
|
|
4
4
|
attributes?: Partial<Record<'title' | 'aria-label' | 'alt' | 'placeholder', string>>;
|
package/dist/pdf/localization.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenericL10n as o } from "pdfjs-dist/web/pdf_viewer.mjs";
|
|
1
|
+
import { GenericL10n as o } from "pdfjs-dist/legacy/web/pdf_viewer.mjs";
|
|
2
2
|
class l extends o {
|
|
3
3
|
constructor(t, a, i = "en-US") {
|
|
4
4
|
super(i), this.root = t, this.localize = a, this.#t = new MutationObserver((e) => {
|
package/dist/pdf.css
CHANGED
|
@@ -6410,7 +6410,7 @@ button.hasPopupMenu{
|
|
|
6410
6410
|
}
|
|
6411
6411
|
|
|
6412
6412
|
}
|
|
6413
|
-
/* Import after pdfjs-dist/web/pdf_viewer.css. Layers use PDF page coordinates;
|
|
6413
|
+
/* Import after pdfjs-dist/legacy/web/pdf_viewer.css. Layers use PDF page coordinates;
|
|
6414
6414
|
surrounding transforms belong to the host surface and need no compensating math. */
|
|
6415
6415
|
.floe-pdf-page > .page {
|
|
6416
6416
|
position: relative;
|
package/dist/viewport.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const p = (t, e) => Number.isFinite(t) && Number(t) > 0 ? Number(t) : Math.max(0, e);
|
|
2
2
|
function g(t) {
|
|
3
|
-
const e = t.visualViewport, o = p(e?.width, t.width), s = p(e?.height, t.height), n = t.fixedOrigin ?? { left: 0, top: 0 }, r = Math.max(0, e?.offsetLeft || 0) + n.left, a = Math.max(0, e?.offsetTop || 0) + n.top, i = t.touch && t.editing && Math.abs((e?.scale ?? 1) - 1) < 0.01 && t.height - s > 100;
|
|
3
|
+
const e = t.visualViewport, o = p(e?.width, t.width), s = p(e?.height, t.height), n = t.fixedOrigin ?? { left: 0, top: 0 }, r = Math.max(0, (e?.offsetLeft || 0) + n.left), a = Math.max(0, (e?.offsetTop || 0) + n.top), i = t.touch && t.editing && Math.abs((e?.scale ?? 1) - 1) < 0.01 && t.height - s > 100;
|
|
4
4
|
return {
|
|
5
5
|
visible: { left: r, top: a, width: o, height: s, right: r + o, bottom: a + s },
|
|
6
6
|
layout: { width: t.width, height: t.height },
|
package/package.json
CHANGED
package/scripts/pdf-assets.mjs
CHANGED
|
@@ -6,21 +6,20 @@ import { readdirSync, readFileSync } from 'node:fs';
|
|
|
6
6
|
const require = createRequire(import.meta.url);
|
|
7
7
|
const root = dirname(require.resolve('pdfjs-dist/package.json'));
|
|
8
8
|
const version = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).version;
|
|
9
|
-
const prefix = `pdf-assets/${version}/`;
|
|
9
|
+
const prefix = `pdf-assets/${version}/legacy/`;
|
|
10
10
|
const files = new Map();
|
|
11
|
-
function collect(directory) {
|
|
11
|
+
function collect(directory, outputDirectory = directory) {
|
|
12
12
|
for (const entry of readdirSync(join(root, directory), { withFileTypes: true })) {
|
|
13
13
|
const file = join(directory, entry.name);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const output = join(outputDirectory, entry.name);
|
|
15
|
+
if (entry.isDirectory()) collect(file, output);
|
|
16
|
+
else files.set(output.replaceAll('\\', '/'), join(root, file));
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
for (const directory of ['cmaps', 'standard_fonts', 'wasm', 'iccs'
|
|
19
|
-
|
|
19
|
+
for (const directory of ['cmaps', 'standard_fonts', 'wasm', 'iccs']) collect(directory);
|
|
20
|
+
collect('legacy/web/images', 'images');
|
|
21
|
+
files.set('pdf.worker.min.mjs', join(root, 'legacy/build/pdf.worker.min.mjs'));
|
|
20
22
|
files.set('LICENSE', join(root, 'LICENSE'));
|
|
21
|
-
for (const [name, path] of [...files]) if (name.startsWith('web/')) {
|
|
22
|
-
files.delete(name); files.set(name.slice(4), path);
|
|
23
|
-
}
|
|
24
23
|
|
|
25
24
|
/** Vite-compatible asset plugin. Keeps workers, CMaps, fonts, codecs and their
|
|
26
25
|
* original notices self-hosted and versioned, outside the initial JS graph. */
|