@abyss-project/commons-front-core 9.6.0 → 10.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/README.md +334 -315
- package/catalog/catalog-entries.ts +2 -0
- package/catalog/pages/MarkdownEditor.tsx +48 -0
- package/catalog/pages/PdfEditor.tsx +153 -0
- package/catalog/pages/index.ts +4 -0
- package/dist/AbyssCloud-IuD91X6C.js +2949 -0
- package/dist/{AbyssCookieConsentProvider-D-HRRYCd.js → AbyssCookieConsentProvider-DTHchhfw.js} +2038 -1387
- package/dist/{CookieConsentSettings.component-iG_abYsq.js → CookieConsentSettings.component-D13TqxZl.js} +1 -1
- package/dist/Tabs-CZQ1JYlW.js +2315 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/auth/client/web-bridge.d.ts +6 -0
- package/dist/auth/components/AuthFlow/AuthFlow.component.d.ts +9 -2
- package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +5 -0
- package/dist/auth/components/AuthFlow/steps/EmailStep.component.d.ts +4 -1
- package/dist/auth/components/index.d.ts +1 -0
- package/dist/auth/components/shared/auth-errors.d.ts +1 -0
- package/dist/auth-client.js +1 -1
- package/dist/components/editors/MarkdownEditor/MarkdownEditor.d.ts +19 -0
- package/dist/components/editors/MarkdownEditor/crepe-labels.d.ts +17 -0
- package/dist/components/editors/MarkdownEditor/index.d.ts +2 -0
- package/dist/components/editors/MarkdownEditor/markdown-theme.d.ts +7 -0
- package/dist/components/editors/PdfEditor/PdfEditor.d.ts +9 -0
- package/dist/components/editors/PdfEditor/engine/open-pdf-document.d.ts +8 -0
- package/dist/components/editors/PdfEditor/engine/operations/redact.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/engine/operations/reducer.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/engine/operations/rotate-coords.spec.d.ts +1 -0
- package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/types.d.ts +1 -1
- package/dist/components/editors/PdfEditor/index.d.ts +3 -0
- package/dist/components/editors/PdfEditor/pdf-colors.d.ts +26 -0
- package/dist/components/editors/PdfEditor/pdf-colors.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/signature/SignatureDrawPad.d.ts +15 -0
- package/dist/components/editors/PdfEditor/signature/SignaturePicker.d.ts +31 -0
- package/dist/components/editors/PdfEditor/signature/SignaturePicker.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/signature/SignatureSaveButton.d.ts +14 -0
- package/dist/components/editors/PdfEditor/signature/SignatureSavedList.d.ts +19 -0
- package/dist/components/editors/PdfEditor/signature/SignatureUploadPanel.d.ts +14 -0
- package/dist/components/editors/PdfEditor/signature/resolve-asset.d.ts +19 -0
- package/dist/components/editors/PdfEditor/signature/resolve-asset.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/signature/test-support/pdf-editor-test-harness.d.ts +28 -0
- package/dist/components/editors/PdfEditor/toolbar/EraserIcon.d.ts +3 -0
- package/dist/components/editors/PdfEditor/toolbar/GroupPanel.d.ts +17 -0
- package/dist/components/editors/PdfEditor/toolbar/PanelRow.d.ts +14 -0
- package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.d.ts +65 -0
- package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/toolbar/SavedAssets.d.ts +24 -0
- package/dist/components/editors/PdfEditor/toolbar/ToolGroupButton.d.ts +20 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-groups.d.ts +34 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/DrawOptions.d.ts +6 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/FillFieldsOptions.d.ts +13 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/HighlightOptions.d.ts +6 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/RedactOptions.d.ts +6 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/ShapeOptions.d.ts +6 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/SignatureOptions.d.ts +5 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/TextOptions.d.ts +6 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/ToolOptions.d.ts +14 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-options/swatches.d.ts +2 -0
- package/dist/components/editors/PdfEditor/toolbar/tool-settings.d.ts +14 -0
- package/dist/components/editors/PdfEditor/viewer/InsertPagesButton.d.ts +14 -0
- package/dist/components/editors/PdfEditor/viewer/InsertPagesButton.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/viewer/InsertPagesDialog.d.ts +28 -0
- package/dist/components/editors/PdfEditor/viewer/PageOverlay.d.ts +37 -0
- package/dist/components/editors/PdfEditor/viewer/PageOverlay.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/viewer/PageSidebar.d.ts +16 -0
- package/dist/components/editors/PdfEditor/viewer/PageSidebar.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/viewer/PageThumbnail.d.ts +16 -0
- package/dist/components/editors/PdfEditor/viewer/PdfCanvas.d.ts +26 -0
- package/dist/components/editors/PdfEditor/viewer/PdfCanvas.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/viewer/ViewerControls.d.ts +21 -0
- package/dist/components/editors/PdfEditor/viewer/ViewerControls.spec.d.ts +1 -0
- package/dist/components/editors/PdfEditor/viewer/test-support/viewer-test-harness.d.ts +30 -0
- package/dist/components/editors/editors-guard.spec.d.ts +1 -0
- package/dist/components/editors/index.d.ts +2 -0
- package/dist/components/inputs/DropZone/DropZone.d.ts +6 -1
- package/dist/components/layers/ProductTour/product-tour-geometry.d.ts +2 -0
- package/dist/components/structure/AccountMenu/AccountMenu.d.ts +2 -1
- package/dist/components/structure/AppShell/app-shell.types.d.ts +5 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-Cz9YXXYF.js → design-theme-BGMTwRaP.js} +9279 -12219
- package/dist/editors.d.ts +1 -0
- package/dist/editors.js +5151 -0
- package/dist/hooks/use-rich-intl.hook.d.ts +702 -0
- package/dist/{index-C4zd0qai.js → index-40JUFFwY.js} +3 -3
- package/dist/{index-hmLJVQI5.js → index-B9pFhQQG.js} +2 -2
- package/dist/{index-BmNsW-7e.js → index-BFBonBC2.js} +4 -4
- package/dist/{index-CtIh_DWT.js → index-BUqYHWKw.js} +3 -3
- package/dist/{index-DP-wuPBm.js → index-BcRgJqSB.js} +2 -2
- package/dist/{index-122nruW2.js → index-BlhbGVkk.js} +2 -2
- package/dist/{index-uctTt51v.js → index-BsOQZ-n8.js} +2 -2
- package/dist/{index-Bx3HHL-R.js → index-CBrydj4V.js} +2 -2
- package/dist/{index-Dodsh0PI.js → index-CM-90k5s.js} +3 -3
- package/dist/{index-D4RSXnjv.js → index-Cccq9d1E.js} +2 -2
- package/dist/{index-D-Sa8nQo.js → index-CdL2MLmd.js} +3 -3
- package/dist/{index-71ZKDT76.js → index-D0EC1_iy.js} +4 -4
- package/dist/{index-CfMACXTF.js → index-D7AFc1sX.js} +2 -2
- package/dist/{index-DIW1zdfO.js → index-Dk1JTU4K.js} +2 -2
- package/dist/{index-XQsb7DVh.js → index-Dop3xXC3.js} +1 -1
- package/dist/{index-ri1JKKHf.js → index-DqAkOKf8.js} +2 -2
- package/dist/{index-D5lR_Znk.js → index-JEsamj6m.js} +2 -2
- package/dist/{index-y2047KCu.js → index-kfzQWNLP.js} +2 -2
- package/dist/{index-ClFFE5ao.js → index-oBWWShwb.js} +2 -2
- package/dist/{index-B1LNfIcu.js → index-s2djh_x_.js} +2 -2
- package/dist/{index-BGjmUj-Y.js → index-tN8hz-IX.js} +4 -4
- package/dist/index.js +6124 -8229
- package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.d.ts +2 -1
- package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.spec.d.ts +1 -0
- package/dist/legacy/components/PdfEditor/PdfEditor.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/index.d.ts +2 -2
- package/dist/legacy/components/PdfEditor/signature/SignatureDrawCanvas.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/signature/SignaturePicker.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/signature/SignatureSaveButton.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/signature/SignatureSavedList.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/signature/SignatureUploadDropzone.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/signature/resolve-asset.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/tools/FillFieldsTool.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/tools/ShapeTool.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/tools/SignatureTool.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/tools/TextTool.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/tools/Toolbar.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/viewer/InsertPagesButton.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/viewer/PageOverlay.d.ts +1 -1
- package/dist/legacy/components/PdfEditor/viewer/PageSidebar.d.ts +2 -2
- package/dist/legacy/components/PdfEditor/viewer/PageThumbnail.d.ts +2 -2
- package/dist/legacy/components/PdfEditor/viewer/PdfCanvas.d.ts +1 -1
- package/dist/legacy.js +26787 -209
- package/dist/rum/AbyssRumProvider.d.ts +5 -2
- package/dist/rum/abyss-rum-report.context.d.ts +14 -0
- package/dist/rum/index.d.ts +1 -0
- package/dist/rum/report-locale.d.ts +3 -0
- package/dist/rum/report-locale.spec.d.ts +1 -0
- package/dist/rum/track-key-action.d.ts +7 -0
- package/dist/rum/track-key-action.spec.d.ts +1 -0
- package/dist/sortable.esm-DM2HNEC7.js +69322 -0
- package/dist/translations/editors-i18n.spec.d.ts +1 -0
- package/dist/translations/en.d.ts +327 -0
- package/dist/translations/fr.d.ts +327 -0
- package/dist/{use-auth.hook-oRxzI95f.js → use-auth.hook-D8vfSYRv.js} +101 -101
- package/package.json +16 -9
- package/vite.config.ts +4 -0
- package/dist/index-DNe1tEo2.js +0 -95914
- package/test-results/catalog/.last-run.json +0 -4
- /package/dist/{legacy/components/PdfEditor/operations/apply.spec.d.ts → auth/components/shared/auth-errors.spec.d.ts} +0 -0
- /package/dist/{legacy/components/PdfEditor/operations/compute-page-order.spec.d.ts → components/editors/MarkdownEditor/MarkdownEditor.spec.d.ts} +0 -0
- /package/dist/{legacy/components/PdfEditor/operations/extract.spec.d.ts → components/editors/PdfEditor/PdfEditor.spec.d.ts} +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-acro-form-fields.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-export.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-page-order.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-pdf-document.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-undo-redo.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-uploaded-docs.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/actions.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/apply.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor/operations/redact.spec.d.ts → components/editors/PdfEditor/engine/operations/apply.spec.d.ts} +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/compute-page-order.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor/operations/reducer.spec.d.ts → components/editors/PdfEditor/engine/operations/compute-page-order.spec.d.ts} +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/extract.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor/operations/rotate-coords.spec.d.ts → components/editors/PdfEditor/engine/operations/extract.spec.d.ts} +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/pdf-data-url.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/rasterize.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/redact.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/reducer.d.ts +0 -0
- /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/rotate-coords.d.ts +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfToolSettings } from '../tool-settings';
|
|
2
|
+
export interface ShapeOptionsProps {
|
|
3
|
+
settings: PdfToolSettings;
|
|
4
|
+
onChange(patch: Partial<PdfToolSettings>): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function ShapeOptions({ settings, onChange }: ShapeOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface SignatureOptionsProps {
|
|
2
|
+
onOpenSignaturePicker(): void;
|
|
3
|
+
}
|
|
4
|
+
/** The picker itself belongs to the host: the panel only reaches it. */
|
|
5
|
+
export declare function SignatureOptions({ onOpenSignaturePicker, }: SignatureOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfToolSettings } from '../tool-settings';
|
|
2
|
+
export interface TextOptionsProps {
|
|
3
|
+
settings: PdfToolSettings;
|
|
4
|
+
onChange(patch: Partial<PdfToolSettings>): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function TextOptions({ settings, onChange }: TextOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { AcroFormField, EditorAction, PdfOperation, ToolKind } from '../../engine/types';
|
|
3
|
+
import { PdfToolSettings } from '../tool-settings';
|
|
4
|
+
export interface ToolOptionsProps {
|
|
5
|
+
tool: ToolKind;
|
|
6
|
+
settings: PdfToolSettings;
|
|
7
|
+
onSettingsChange(patch: Partial<PdfToolSettings>): void;
|
|
8
|
+
acroFormFields: AcroFormField[];
|
|
9
|
+
operations: PdfOperation[];
|
|
10
|
+
dispatch: Dispatch<EditorAction>;
|
|
11
|
+
onOpenSignaturePicker(): void;
|
|
12
|
+
}
|
|
13
|
+
/** The options panel of `tool`; `null` for a tool that has none (see `PDF_TOOLS`). */
|
|
14
|
+
export declare function ToolOptions({ tool, settings, onSettingsChange, acroFormFields, operations, dispatch, onOpenSignaturePicker, }: ToolOptionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ShapeKind, TextFontFamily } from '../engine/types';
|
|
2
|
+
/** What the option panels of the annotation tools edit; the host keeps it and hands it back. */
|
|
3
|
+
export interface PdfToolSettings {
|
|
4
|
+
textColor: string;
|
|
5
|
+
textSize: number;
|
|
6
|
+
textFamily: TextFontFamily;
|
|
7
|
+
drawColor: string;
|
|
8
|
+
drawStrokeWidth: number;
|
|
9
|
+
shapeKind: ShapeKind;
|
|
10
|
+
/** Fill colour of a rectangle or an ellipse; `null` for no fill. */
|
|
11
|
+
shapeFill: string | null;
|
|
12
|
+
highlightColor: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_PDF_TOOL_SETTINGS: PdfToolSettings;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EditorAction, PdfEditorCloudImportProps } from '../engine/types';
|
|
3
|
+
export interface InsertPagesButtonProps {
|
|
4
|
+
/** Virtual index of the page the new pages go after; -1 inserts at the start. */
|
|
5
|
+
afterVirtualIndex: number;
|
|
6
|
+
dispatch: React.Dispatch<EditorAction>;
|
|
7
|
+
cloudImport?: PdfEditorCloudImportProps;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The « Insert pages » button of the sidebar. It opens a modal that takes a PDF from a drop zone
|
|
11
|
+
* (device, drag and drop, AbyssCloud when wired); a single-page file is inserted at once, a longer
|
|
12
|
+
* one asks which pages to keep.
|
|
13
|
+
*/
|
|
14
|
+
export declare const InsertPagesButton: React.FC<InsertPagesButtonProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CloudImportWiring } from '../../../../hooks/cloud-picker.types';
|
|
3
|
+
/** A PDF read from the device or AbyssCloud, waiting for its pages to be chosen. */
|
|
4
|
+
export interface InsertPagesFile {
|
|
5
|
+
numPages: number;
|
|
6
|
+
fileName: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InsertPagesDialogProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
/** The file once read; null while the dialog still asks for one. */
|
|
11
|
+
file: InsertPagesFile | null;
|
|
12
|
+
/** A file is being read: the drop zone gives way to a status line. */
|
|
13
|
+
busy: boolean;
|
|
14
|
+
/** Why the last file could not be used, written under the drop zone. */
|
|
15
|
+
error: string | null;
|
|
16
|
+
/** When set, the drop zone also offers AbyssCloud. */
|
|
17
|
+
cloudImport?: CloudImportWiring;
|
|
18
|
+
/** The PDF dropped or picked from the device. */
|
|
19
|
+
onFiles: (files: File[]) => void;
|
|
20
|
+
/** The pages kept, as 0-based indices in ascending order. */
|
|
21
|
+
onConfirm: (selectedPages: number[]) => void;
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The modal of « Insert pages »: first it asks for a PDF (drop zone, device picker, AbyssCloud),
|
|
26
|
+
* then, for a file of several pages, which of them to insert.
|
|
27
|
+
*/
|
|
28
|
+
export declare const InsertPagesDialog: React.FC<InsertPagesDialogProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PdfOperation, ToolKind, EditorAction, ShapeKind, TextFontFamily } from '../engine/types';
|
|
3
|
+
export interface PageOverlayProps {
|
|
4
|
+
pageIndex: number;
|
|
5
|
+
displayIndex: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
operations: PdfOperation[];
|
|
9
|
+
activeTool: ToolKind;
|
|
10
|
+
activePageIndex: number;
|
|
11
|
+
pendingSignature: string | null;
|
|
12
|
+
pendingText: string | null;
|
|
13
|
+
pendingApplyAllPages: boolean;
|
|
14
|
+
/** Live virtual page indices (pageOrder) — the targets for "apply to all pages". */
|
|
15
|
+
pageIndices: number[];
|
|
16
|
+
dispatch: React.Dispatch<EditorAction>;
|
|
17
|
+
drawColor?: string;
|
|
18
|
+
drawStrokeWidth?: number;
|
|
19
|
+
/** New-text styling (existing text keeps its own values). */
|
|
20
|
+
textColor?: string;
|
|
21
|
+
textSize?: number;
|
|
22
|
+
textFamily?: TextFontFamily;
|
|
23
|
+
/** Active shape kind (rect/ellipse/line/arrow) when the shape tool is on. */
|
|
24
|
+
shapeKind?: ShapeKind;
|
|
25
|
+
/** Fill color for rect/ellipse shapes (hex), or null for outline only. */
|
|
26
|
+
shapeFill?: string | null;
|
|
27
|
+
/** Highlighter color (hex). */
|
|
28
|
+
highlightColor?: string;
|
|
29
|
+
/** Render scale (px per PDF point) — driven by the zoom control. */
|
|
30
|
+
scale?: number;
|
|
31
|
+
/** Total displayed rotation (page intrinsic /Rotate + user delta), clockwise.
|
|
32
|
+
* Annotations are stored in unrotated content space; the overlay maps pointer
|
|
33
|
+
* input back to content space and renders inside a rotated inner layer so the
|
|
34
|
+
* preview matches the baked output. */
|
|
35
|
+
rotation?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare const PageOverlay: React.FC<PageOverlayProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PDFDocumentProxy } from 'pdfjs-dist';
|
|
3
|
+
import { PdfOperation, EditorAction, PdfEditorCloudImportProps } from '../engine/types';
|
|
4
|
+
import { InsertedPageRef } from '../engine/operations/compute-page-order';
|
|
5
|
+
/** Width of the sidebar in px; the host offsets the floating viewer controls by it. */
|
|
6
|
+
export declare const PAGE_SIDEBAR_WIDTH = 220;
|
|
7
|
+
export interface PageSidebarProps {
|
|
8
|
+
pdfDoc: PDFDocumentProxy;
|
|
9
|
+
operations: PdfOperation[];
|
|
10
|
+
activePageIndex: number;
|
|
11
|
+
uploadedDocs: Map<string, PDFDocumentProxy>;
|
|
12
|
+
insertionTable: Map<number, InsertedPageRef>;
|
|
13
|
+
dispatch: React.Dispatch<EditorAction>;
|
|
14
|
+
cloudImport?: PdfEditorCloudImportProps;
|
|
15
|
+
}
|
|
16
|
+
export declare const PageSidebar: React.FC<PageSidebarProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PDFDocumentProxy } from 'pdfjs-dist';
|
|
3
|
+
import { EditorAction, PdfOperation } from '../engine/types';
|
|
4
|
+
import { InsertedPageRef } from '../engine/operations/compute-page-order';
|
|
5
|
+
export interface PageThumbnailProps {
|
|
6
|
+
pdfDoc: PDFDocumentProxy;
|
|
7
|
+
uploadedDocs: Map<string, PDFDocumentProxy>;
|
|
8
|
+
virtualIndex: number;
|
|
9
|
+
insertedRef: InsertedPageRef | undefined;
|
|
10
|
+
displayIndex: number;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
rotation: number;
|
|
13
|
+
operations: PdfOperation[];
|
|
14
|
+
dispatch: React.Dispatch<EditorAction>;
|
|
15
|
+
}
|
|
16
|
+
export declare const PageThumbnail: React.FC<PageThumbnailProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PDFDocumentProxy } from 'pdfjs-dist';
|
|
3
|
+
import { InsertedPageRef } from '../engine/operations/compute-page-order';
|
|
4
|
+
declare const RENDER_SCALE = 1.5;
|
|
5
|
+
export { RENDER_SCALE };
|
|
6
|
+
interface PdfCanvasProps {
|
|
7
|
+
pdfDoc: PDFDocumentProxy;
|
|
8
|
+
uploadedDocs: Map<string, PDFDocumentProxy>;
|
|
9
|
+
insertionTable: Map<number, InsertedPageRef>;
|
|
10
|
+
blankPages?: Map<number, {
|
|
11
|
+
widthPt: number;
|
|
12
|
+
heightPt: number;
|
|
13
|
+
}>;
|
|
14
|
+
rotationMap?: Map<number, number>;
|
|
15
|
+
scale?: number;
|
|
16
|
+
activePageIndex: number;
|
|
17
|
+
pageOrder: number[];
|
|
18
|
+
onPageDimensions?: (pageIndex: number, width: number, height: number, totalRotation: number, pointWidth: number) => void;
|
|
19
|
+
/** Reports the display index of the page currently dominant in the viewport. */
|
|
20
|
+
onVisiblePageChange?: (displayIndex: number) => void;
|
|
21
|
+
children?: (virtualIndex: number, displayIndex: number) => React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export interface PdfCanvasHandle {
|
|
24
|
+
scrollToPage: (displayIndex: number) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const PdfCanvas: React.ForwardRefExoticComponent<PdfCanvasProps & React.RefAttributes<PdfCanvasHandle>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ViewerControlsProps {
|
|
3
|
+
/** Current zoom as a fraction of the base scale (1 = 100%). */
|
|
4
|
+
zoom: number;
|
|
5
|
+
onZoomIn: () => void;
|
|
6
|
+
onZoomOut: () => void;
|
|
7
|
+
onFitWidth: () => void;
|
|
8
|
+
onResetZoom: () => void;
|
|
9
|
+
canZoomIn: boolean;
|
|
10
|
+
canZoomOut: boolean;
|
|
11
|
+
currentPage: number;
|
|
12
|
+
totalPages: number;
|
|
13
|
+
onGoToPage: (index: number) => void;
|
|
14
|
+
/** Narrow viewport: dock as a flush full-width bottom bar (no floating pills). */
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
/** Width (px) of the inline page sidebar, so the floating pills center over the
|
|
17
|
+
* PAGE region rather than the whole area (kept in sync with the placement banner). */
|
|
18
|
+
sidebarWidth?: number;
|
|
19
|
+
}
|
|
20
|
+
/** The floating page navigation and zoom controls of the viewer. */
|
|
21
|
+
export declare const ViewerControls: React.FC<ViewerControlsProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { RenderResult } from '@testing-library/react';
|
|
3
|
+
import { Theme } from '@mui/material/styles';
|
|
4
|
+
import { UserLanguage } from '@abyss-project/main';
|
|
5
|
+
import { PDFDocumentProxy } from 'pdfjs-dist';
|
|
6
|
+
import { EditorAction, PdfOperation } from '../../engine/types';
|
|
7
|
+
import { ThemeMode } from '../../../../../theme';
|
|
8
|
+
export interface ViewerRenderOptions {
|
|
9
|
+
mode?: ThemeMode;
|
|
10
|
+
width?: number;
|
|
11
|
+
language?: UserLanguage;
|
|
12
|
+
}
|
|
13
|
+
export interface ViewerRenderResult extends RenderResult {
|
|
14
|
+
theme: Theme;
|
|
15
|
+
}
|
|
16
|
+
/** Renders `ui` under the root theme, the messages of the language and the confirm-dialog host. */
|
|
17
|
+
export declare const renderViewer: (ui: ReactElement, { mode, width, language, }?: ViewerRenderOptions) => ViewerRenderResult;
|
|
18
|
+
/** The page width in points of every page of `fakePdfDoc`. */
|
|
19
|
+
export declare const FAKE_PAGE_WIDTH_PT = 200;
|
|
20
|
+
export declare const FAKE_PAGE_HEIGHT_PT = 300;
|
|
21
|
+
/**
|
|
22
|
+
* A pdf.js document double: `numPages` pages of 200 x 300 pt whose render resolves at once. The
|
|
23
|
+
* viewer only reads `numPages` and `getPage`, so the double carries just those; the cast stands
|
|
24
|
+
* for the rest of the pdf.js proxy.
|
|
25
|
+
*/
|
|
26
|
+
export declare const fakePdfDoc: (numPages: number) => PDFDocumentProxy;
|
|
27
|
+
/** jsdom has no 2D canvas: gives every canvas a context that accepts the calls the viewer makes. */
|
|
28
|
+
export declare const stubCanvasContext: () => void;
|
|
29
|
+
/** The operations a mocked `dispatch` was asked to append, in order. */
|
|
30
|
+
export declare const addedOperations: (dispatch: (action: EditorAction) => void) => PdfOperation[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,6 +10,11 @@ export interface DropZoneProps {
|
|
|
10
10
|
accept?: Accept;
|
|
11
11
|
/** Largest accepted file, in bytes; shown under the zone. */
|
|
12
12
|
maxSize?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The line under the zone, in place of the default « Taille maximale par fichier : … » that
|
|
15
|
+
* `maxSize` writes: the host's own wording of the limit. Without `maxSize`, shown all the same.
|
|
16
|
+
*/
|
|
17
|
+
caption?: string;
|
|
13
18
|
/** Title above the zone, which names it. */
|
|
14
19
|
title?: string;
|
|
15
20
|
/**
|
|
@@ -20,4 +25,4 @@ export interface DropZoneProps {
|
|
|
20
25
|
/** Replaces the icon and the prompt inside the zone (a preview of the current file, say). */
|
|
21
26
|
children?: ReactNode;
|
|
22
27
|
}
|
|
23
|
-
export declare function DropZone({ onDrop, multiple, accept, maxSize, title, cloudImport, children, }: DropZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function DropZone({ onDrop, multiple, accept, maxSize, caption, title, cloudImport, children, }: DropZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -39,6 +39,8 @@ export declare const placeBubble: (target: TourRect, bubble: TourSize, viewport:
|
|
|
39
39
|
export declare const centerBubble: (bubble: TourSize, viewport: TourSize, margin: number) => Pick<BubblePlacement, "top" | "left">;
|
|
40
40
|
/** The rectangle `rect` grown by `by` px on every side. */
|
|
41
41
|
export declare const inflateRect: (rect: TourRect, by: number) => TourRect;
|
|
42
|
+
/** The part of `rect` that lies `inset` px or more inside the viewport. */
|
|
43
|
+
export declare const clampRect: (rect: TourRect, viewport: TourSize, inset: number) => TourRect;
|
|
42
44
|
export declare const toTourRect: (rect: DOMRectReadOnly) => TourRect;
|
|
43
45
|
export declare const sameRect: (a: TourRect | null, b: TourRect | null) => boolean;
|
|
44
46
|
export declare const sameSize: (a: TourSize, b: TourSize) => boolean;
|
|
@@ -22,6 +22,7 @@ export interface AccountMenuProps {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* The account entry of the top bar: the viewer's avatar opens a menu with their name and email,
|
|
25
|
-
* the host's entries (account, settings, billing…),
|
|
25
|
+
* the host's entries (account, settings, billing…), « Report a problem » under an installed
|
|
26
|
+
* `AbyssRumProvider`, the dark theme switch and the logout.
|
|
26
27
|
*/
|
|
27
28
|
export declare function AccountMenu({ user, themeMode, onThemeModeChange, items, onLogout, }: AccountMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -39,6 +39,11 @@ export interface NavItem {
|
|
|
39
39
|
* drawer, absent from the rail.
|
|
40
40
|
*/
|
|
41
41
|
action?: NavItemAction;
|
|
42
|
+
/**
|
|
43
|
+
* A sub-entry of the product entry above it: drawn without its icon, indented under it, in the
|
|
44
|
+
* sidebar and the drawer, and absent from the rail. `icon` stays required but is not rendered.
|
|
45
|
+
*/
|
|
46
|
+
nested?: boolean;
|
|
42
47
|
}
|
|
43
48
|
export interface NavSection {
|
|
44
49
|
id: string;
|
package/dist/cookie-consent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-
|
|
2
|
-
import { C as E } from "./CookieConsentSettings.component-
|
|
1
|
+
import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-DTHchhfw.js";
|
|
2
|
+
import { C as E } from "./CookieConsentSettings.component-D13TqxZl.js";
|
|
3
3
|
export {
|
|
4
4
|
e as AbyssCookieConsentProvider,
|
|
5
5
|
a as COOKIE_NAME,
|