@abyss-project/commons-front-core 10.1.0 → 11.0.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 +319 -334
- package/catalog/catalog-entries.ts +0 -2
- package/catalog/pages/index.ts +0 -4
- package/dist/{AbyssCookieConsentProvider-DTHchhfw.js → AbyssCookieConsentProvider-C3NZfWxR.js} +1532 -2151
- package/dist/{CookieConsentSettings.component-D13TqxZl.js → CookieConsentSettings.component-Dvbp3MIX.js} +1 -1
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-BGMTwRaP.js → design-theme-sPEoMB7j.js} +12200 -9258
- package/dist/hooks/quota-dialog.store.d.ts +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +44 -666
- package/dist/{index-BlhbGVkk.js → index-BVGdsnC4.js} +2 -2
- package/dist/{index-s2djh_x_.js → index-C2KrTHAO.js} +2 -2
- package/dist/{index-kfzQWNLP.js → index-C9FzqvHz.js} +2 -2
- package/dist/{index-B9pFhQQG.js → index-CB-jdY_E.js} +2 -2
- package/dist/{index-JEsamj6m.js → index-CCaW-38I.js} +2 -2
- package/dist/{index-BUqYHWKw.js → index-CKCWWoQb.js} +3 -3
- package/dist/{index-Dop3xXC3.js → index-CNcmCFNN.js} +1 -1
- package/dist/{index-40JUFFwY.js → index-CXwwKVPn.js} +3 -3
- package/dist/{index-CdL2MLmd.js → index-Cb-uMz_V.js} +3 -3
- package/dist/{index-tN8hz-IX.js → index-CrWjgIMV.js} +4 -4
- package/dist/{index-BFBonBC2.js → index-D9s128sK.js} +4 -4
- package/dist/{index-D0EC1_iy.js → index-DD25yrsQ.js} +4 -4
- package/dist/{index-Cccq9d1E.js → index-DEqCdX0Q.js} +2 -2
- package/dist/{index-BsOQZ-n8.js → index-DIpJhT2r.js} +2 -2
- package/dist/index-DPi7aKci.js +95942 -0
- package/dist/{index-oBWWShwb.js → index-Di1amUHq.js} +2 -2
- package/dist/{index-CM-90k5s.js → index-DtHUaGVU.js} +3 -3
- package/dist/{index-Dk1JTU4K.js → index-QNJIP2m4.js} +2 -2
- package/dist/{index-DqAkOKf8.js → index-Ut9uJwau.js} +2 -2
- package/dist/{index-D7AFc1sX.js → index-aYivWEyJ.js} +2 -2
- package/dist/{index-CBrydj4V.js → index-lE9lxmTc.js} +2 -2
- package/dist/{index-BcRgJqSB.js → index-whpnjq54.js} +2 -2
- package/dist/index.js +7900 -5669
- 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/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/types.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 +209 -26787
- package/dist/translations/en.d.ts +22 -333
- package/dist/translations/fr.d.ts +22 -333
- package/package.json +5 -12
- package/vite.config.ts +0 -4
- package/catalog/pages/MarkdownEditor.tsx +0 -48
- package/catalog/pages/PdfEditor.tsx +0 -153
- package/dist/AbyssCloud-IuD91X6C.js +0 -2949
- package/dist/Tabs-CZQ1JYlW.js +0 -2315
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/components/editors/MarkdownEditor/MarkdownEditor.d.ts +0 -19
- package/dist/components/editors/MarkdownEditor/MarkdownEditor.spec.d.ts +0 -1
- package/dist/components/editors/MarkdownEditor/crepe-labels.d.ts +0 -17
- package/dist/components/editors/MarkdownEditor/index.d.ts +0 -2
- package/dist/components/editors/MarkdownEditor/markdown-theme.d.ts +0 -7
- package/dist/components/editors/PdfEditor/PdfEditor.d.ts +0 -9
- package/dist/components/editors/PdfEditor/PdfEditor.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/engine/open-pdf-document.d.ts +0 -8
- package/dist/components/editors/PdfEditor/index.d.ts +0 -3
- package/dist/components/editors/PdfEditor/pdf-colors.d.ts +0 -26
- package/dist/components/editors/PdfEditor/pdf-colors.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/signature/SignatureDrawPad.d.ts +0 -15
- package/dist/components/editors/PdfEditor/signature/SignaturePicker.d.ts +0 -31
- package/dist/components/editors/PdfEditor/signature/SignaturePicker.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/signature/SignatureSaveButton.d.ts +0 -14
- package/dist/components/editors/PdfEditor/signature/SignatureSavedList.d.ts +0 -19
- package/dist/components/editors/PdfEditor/signature/SignatureUploadPanel.d.ts +0 -14
- package/dist/components/editors/PdfEditor/signature/resolve-asset.d.ts +0 -19
- package/dist/components/editors/PdfEditor/signature/resolve-asset.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/signature/test-support/pdf-editor-test-harness.d.ts +0 -28
- package/dist/components/editors/PdfEditor/toolbar/EraserIcon.d.ts +0 -3
- package/dist/components/editors/PdfEditor/toolbar/GroupPanel.d.ts +0 -17
- package/dist/components/editors/PdfEditor/toolbar/PanelRow.d.ts +0 -14
- package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.d.ts +0 -65
- package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/toolbar/SavedAssets.d.ts +0 -24
- package/dist/components/editors/PdfEditor/toolbar/ToolGroupButton.d.ts +0 -20
- package/dist/components/editors/PdfEditor/toolbar/tool-groups.d.ts +0 -34
- package/dist/components/editors/PdfEditor/toolbar/tool-options/DrawOptions.d.ts +0 -6
- package/dist/components/editors/PdfEditor/toolbar/tool-options/FillFieldsOptions.d.ts +0 -13
- package/dist/components/editors/PdfEditor/toolbar/tool-options/HighlightOptions.d.ts +0 -6
- package/dist/components/editors/PdfEditor/toolbar/tool-options/RedactOptions.d.ts +0 -6
- package/dist/components/editors/PdfEditor/toolbar/tool-options/ShapeOptions.d.ts +0 -6
- package/dist/components/editors/PdfEditor/toolbar/tool-options/SignatureOptions.d.ts +0 -5
- package/dist/components/editors/PdfEditor/toolbar/tool-options/TextOptions.d.ts +0 -6
- package/dist/components/editors/PdfEditor/toolbar/tool-options/ToolOptions.d.ts +0 -14
- package/dist/components/editors/PdfEditor/toolbar/tool-options/swatches.d.ts +0 -2
- package/dist/components/editors/PdfEditor/toolbar/tool-settings.d.ts +0 -14
- package/dist/components/editors/PdfEditor/viewer/InsertPagesButton.d.ts +0 -14
- package/dist/components/editors/PdfEditor/viewer/InsertPagesButton.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/viewer/InsertPagesDialog.d.ts +0 -28
- package/dist/components/editors/PdfEditor/viewer/PageOverlay.d.ts +0 -37
- package/dist/components/editors/PdfEditor/viewer/PageOverlay.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/viewer/PageSidebar.d.ts +0 -16
- package/dist/components/editors/PdfEditor/viewer/PageSidebar.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/viewer/PageThumbnail.d.ts +0 -16
- package/dist/components/editors/PdfEditor/viewer/PdfCanvas.d.ts +0 -26
- package/dist/components/editors/PdfEditor/viewer/PdfCanvas.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/viewer/ViewerControls.d.ts +0 -21
- package/dist/components/editors/PdfEditor/viewer/ViewerControls.spec.d.ts +0 -1
- package/dist/components/editors/PdfEditor/viewer/test-support/viewer-test-harness.d.ts +0 -30
- package/dist/components/editors/editors-guard.spec.d.ts +0 -1
- package/dist/components/editors/index.d.ts +0 -2
- package/dist/editors.d.ts +0 -1
- package/dist/editors.js +0 -5151
- package/dist/sortable.esm-DM2HNEC7.js +0 -69322
- package/dist/translations/editors-i18n.spec.d.ts +0 -1
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/hooks/use-acro-form-fields.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/hooks/use-export.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/hooks/use-page-order.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/hooks/use-pdf-document.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/hooks/use-undo-redo.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/hooks/use-uploaded-docs.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/actions.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/apply.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/apply.spec.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/compute-page-order.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/compute-page-order.spec.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/extract.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/extract.spec.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/pdf-data-url.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/rasterize.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/redact.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/redact.spec.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/reducer.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/reducer.spec.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/rotate-coords.d.ts +0 -0
- /package/dist/{components/editors/PdfEditor/engine → legacy/components/PdfEditor}/operations/rotate-coords.spec.d.ts +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function l(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
o as c,
|
|
7
|
-
l as g
|
|
8
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { CrepeConfig } from '@milkdown/crepe';
|
|
3
|
-
export type MarkdownEditorProps = {
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
defaultValue?: string;
|
|
6
|
-
/** For external updates (SSE): replaces the document without triggering `onChange`. */
|
|
7
|
-
externalValue?: string;
|
|
8
|
-
onChange?: (md: string) => void;
|
|
9
|
-
readOnly?: boolean;
|
|
10
|
-
/** Uploads a file and returns its URL. */
|
|
11
|
-
onUploadFile?: (file: File) => Promise<string>;
|
|
12
|
-
enableImageUpload?: boolean;
|
|
13
|
-
enableFileUpload?: boolean;
|
|
14
|
-
} & CrepeConfig;
|
|
15
|
-
/**
|
|
16
|
-
* Markdown editor of the design system: Milkdown Crepe, themed from `theme.design`, with its
|
|
17
|
-
* labels translated by the core. The same rendering serves reading (`readOnly`) and editing.
|
|
18
|
-
*/
|
|
19
|
-
export declare const MarkdownEditor: React.FC<MarkdownEditorProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CrepeConfig } from '@milkdown/crepe';
|
|
2
|
-
/** Resolves a message id of the core translations. */
|
|
3
|
-
export type Translate = (id: string) => string;
|
|
4
|
-
type FeatureConfigs = NonNullable<CrepeConfig['featureConfigs']>;
|
|
5
|
-
/**
|
|
6
|
-
* The text Crepe draws itself (slash menu, link field, image block, code block), translated by the
|
|
7
|
-
* core (`ds.editors.markdown.crepe.*`, D7). Icon-only controls are named by `labelCrepeControls`.
|
|
8
|
-
*/
|
|
9
|
-
export declare const crepeLabelConfigs: (t: Translate) => FeatureConfigs;
|
|
10
|
-
/**
|
|
11
|
-
* Gives an accessible name to the Crepe controls that carry only an icon (Crepe 7.15 has no text
|
|
12
|
-
* option for them): the floating toolbar, block handle, link tooltip, table controls, image caption
|
|
13
|
-
* and LaTeX buttons. `toolbarKeys` is the order of the toolbar items, as Crepe built them. Safe to
|
|
14
|
-
* run after every DOM change: it only sets attributes.
|
|
15
|
-
*/
|
|
16
|
-
export declare const labelCrepeControls: (root: Element, t: Translate, toolbarKeys: readonly string[]) => void;
|
|
17
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Theme } from '@mui/material/styles';
|
|
2
|
-
/**
|
|
3
|
-
* Crepe (Milkdown) reads its whole palette, fonts and shadows from `--crepe-*` custom properties.
|
|
4
|
-
* They are all taken from `theme.design` (ADR-0174), so the editor follows the light and dark
|
|
5
|
-
* modes of the design system.
|
|
6
|
-
*/
|
|
7
|
-
export declare const crepeThemeVars: (theme: Theme) => Record<string, string>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PdfEditorProps } from './engine/types';
|
|
2
|
-
/** Delay between the last change of the operations and their flush to `operationsAdapter`. */
|
|
3
|
-
export declare const OPERATIONS_FLUSH_DELAY_MS = 800;
|
|
4
|
-
/**
|
|
5
|
-
* The PDF editor of the ecosystem on the design system: the grouped toolbar (D4), the viewer with
|
|
6
|
-
* its page sidebar, the signature picker and the document windows, over the shared engine. Same
|
|
7
|
-
* props, operations, persistence and exports as the legacy editor; see the README for the modes.
|
|
8
|
-
*/
|
|
9
|
-
export declare function PdfEditor(props: PdfEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PDFDocumentLoadingTask } from 'pdfjs-dist';
|
|
2
|
-
/**
|
|
3
|
-
* Starts loading a PDF in pdf.js. The worker is pointed at its file here, on first use, and not
|
|
4
|
-
* when this module loads: the package has no `sideEffects` field, so a module-level assignment on
|
|
5
|
-
* `pdfjsLib` would keep pdf.js (and pdf-lib) in the bundle of every app that imports anything from
|
|
6
|
-
* the root entry. `new URL(..., import.meta.url)` lets Vite bundle the worker file.
|
|
7
|
-
*/
|
|
8
|
-
export declare const openPdfDocument: (data: Uint8Array) => PDFDocumentLoadingTask;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { PdfOperationType } from './engine/types';
|
|
2
|
-
export type { PdfEditorProps, PdfOperation, ExportRequest, ExportOption, PdfSource, PdfEditorMode, AcroFormField, AssetPalette, AssetPaletteItem, AssetPaletteOrgBucket, AssetPaletteProjectBucket, SaveSignatureFn, OperationsAdapter, } from './engine/types';
|
|
3
|
-
export { PdfEditor } from './PdfEditor';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fixed annotation colours of the PDF editor (zone 4c, D5). The PDF page stays white in both themes
|
|
3
|
-
* (`paper`, ADR-0174), so these values do not follow the theme: an annotation is saved as a hex in
|
|
4
|
-
* the operation list and must look the same for every reader. This is the only file of `editors/`
|
|
5
|
-
* allowed to write a hexadecimal colour (see `editors-guard.spec.ts`).
|
|
6
|
-
*/
|
|
7
|
-
/** Default ink of the text and draw tools, and of the page numbers. */
|
|
8
|
-
export declare const PDF_DEFAULT_INK = "#000000";
|
|
9
|
-
/** Default highlighter fill. */
|
|
10
|
-
export declare const PDF_HIGHLIGHT_COLOR = "#ffeb3b";
|
|
11
|
-
/** Tints offered for highlights and shape fills, the highlighter colour first. */
|
|
12
|
-
export declare const PDF_SHAPE_TINTS: readonly string[];
|
|
13
|
-
/** Pen colours of the signature drawing canvas, the default ink first. */
|
|
14
|
-
export declare const PDF_SIGNATURE_INKS: readonly string[];
|
|
15
|
-
/**
|
|
16
|
-
* Inks offered for text, drawing and shape outlines, as the legacy offered them: black, then the
|
|
17
|
-
* accent (the brand blue), red, green and cyan, every one readable on the paper.
|
|
18
|
-
*/
|
|
19
|
-
export declare const PDF_ANNOTATION_INKS: readonly string[];
|
|
20
|
-
/** Fill of the opaque boxes that replace redacted regions when a page is rasterized. */
|
|
21
|
-
export declare const PDF_REDACTION_FILL = "#000000";
|
|
22
|
-
/**
|
|
23
|
-
* Ink of the watermark. It is drawn at a low opacity on purpose, so it is the one colour exempt from
|
|
24
|
-
* the text contrast rule.
|
|
25
|
-
*/
|
|
26
|
-
export declare const PDF_WATERMARK_INK = "#888888";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AssetPalette, SaveSignatureFn } from '../engine/types';
|
|
2
|
-
/** Size of the drawing, in canvas pixels: the image placed on the page keeps it whatever the screen. */
|
|
3
|
-
export declare const SIGNATURE_PAD_WIDTH = 460;
|
|
4
|
-
export declare const SIGNATURE_PAD_HEIGHT = 180;
|
|
5
|
-
export interface SignatureDrawPadProps {
|
|
6
|
-
onCapture(dataUrl: string): void;
|
|
7
|
-
onCancel(): void;
|
|
8
|
-
onSave?: SaveSignatureFn;
|
|
9
|
-
assetPalette?: AssetPalette;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Draw tab of the signature picker: a pad on paper, the pen colour among the signature inks of D5
|
|
13
|
-
* and a choice of three widths. A colour or width change applies to the next strokes only.
|
|
14
|
-
*/
|
|
15
|
-
export declare function SignatureDrawPad({ onCapture, onCancel, onSave, assetPalette, }: SignatureDrawPadProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AssetPalette, SaveSignatureFn } from '../engine/types';
|
|
2
|
-
import { ResolveAssetBytes } from './resolve-asset';
|
|
3
|
-
export declare enum SignatureTab {
|
|
4
|
-
Saved = "saved",
|
|
5
|
-
Draw = "draw",
|
|
6
|
-
Upload = "upload"
|
|
7
|
-
}
|
|
8
|
-
export interface SignaturePickerProps {
|
|
9
|
-
open: boolean;
|
|
10
|
-
/** Closed without a signature (close button, Escape, scrim or Cancel). */
|
|
11
|
-
onClose(): void;
|
|
12
|
-
/** A drawn, imported or saved image, as a data URL. */
|
|
13
|
-
onCapture(dataUrl: string): void;
|
|
14
|
-
/** A saved text asset: its raw text, to place as text. */
|
|
15
|
-
onCaptureText(text: string): void;
|
|
16
|
-
/** Saved assets: with at least one item, the Saved tab comes first. */
|
|
17
|
-
assetPalette?: AssetPalette;
|
|
18
|
-
/** Uploads a drawn or imported image as an asset: shows the Save button. */
|
|
19
|
-
onSaveSignature?: SaveSignatureFn;
|
|
20
|
-
resolveAssetBytes?: ResolveAssetBytes;
|
|
21
|
-
onAssetError?(message: string): void;
|
|
22
|
-
/** The host's asset management page: shows a link above the tabs. */
|
|
23
|
-
manageAssetsUrl?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Where a signature comes from: drawn on a pad, imported from an image, or picked among the saved
|
|
27
|
-
* assets when the host passes a palette that holds some. Each opening starts on the most useful
|
|
28
|
-
* tab: Saved when there is something saved, Draw otherwise. The panels stay mounted while the
|
|
29
|
-
* picker is open, so a drawing survives a tab switch.
|
|
30
|
-
*/
|
|
31
|
-
export declare function SignaturePicker({ open, onClose, onCapture, onCaptureText, assetPalette, onSaveSignature, resolveAssetBytes, onAssetError, manageAssetsUrl, }: SignaturePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AssetPalette, SaveSignatureFn } from '../engine/types';
|
|
2
|
-
export interface SignatureSaveButtonProps {
|
|
3
|
-
/** The image to save; the button is disabled while there is none. */
|
|
4
|
-
dataUrl: string | null;
|
|
5
|
-
onSave: SaveSignatureFn;
|
|
6
|
-
/** With at least one organization or project bucket, the save window offers a scope. */
|
|
7
|
-
assetPalette?: AssetPalette;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* « Save » of the signature picker: names the drawn or imported image, picks its kind (signature,
|
|
11
|
-
* initials, stamp) and, when the user belongs to organizations or projects, the space that owns
|
|
12
|
-
* it, then hands it to the host's `onSave`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function SignatureSaveButton({ dataUrl, onSave, assetPalette, }: SignatureSaveButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AssetPalette } from '../engine/types';
|
|
2
|
-
import { ResolveAssetBytes } from './resolve-asset';
|
|
3
|
-
/** Whether the palette has at least one item in any of its spaces. */
|
|
4
|
-
export declare const paletteHasItems: (palette: AssetPalette | undefined) => boolean;
|
|
5
|
-
export interface SignatureSavedListProps {
|
|
6
|
-
palette: AssetPalette;
|
|
7
|
-
/** An image asset, resolved to a data URL. */
|
|
8
|
-
onPick(dataUrl: string): void;
|
|
9
|
-
/** A text asset (text block or typed initials): its raw text. */
|
|
10
|
-
onPickText(text: string): void;
|
|
11
|
-
resolveAssetBytes?: ResolveAssetBytes;
|
|
12
|
-
onAssetError?(message: string): void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Saved tab of the signature picker: the signatures, initials, stamps and text blocks of the user,
|
|
16
|
-
* of their organizations and of their projects, one space at a time, filtered by kind. An image is
|
|
17
|
-
* resolved through the host before use; a text goes to text placement.
|
|
18
|
-
*/
|
|
19
|
-
export declare function SignatureSavedList({ palette, onPick, onPickText, resolveAssetBytes, onAssetError, }: SignatureSavedListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AssetPalette, SaveSignatureFn } from '../engine/types';
|
|
2
|
-
/** Largest signature image, as for a saved user asset. */
|
|
3
|
-
export declare const SIGNATURE_UPLOAD_MAX_BYTES: number;
|
|
4
|
-
export interface SignatureUploadPanelProps {
|
|
5
|
-
onCapture(dataUrl: string): void;
|
|
6
|
-
onCancel(): void;
|
|
7
|
-
onSave?: SaveSignatureFn;
|
|
8
|
-
assetPalette?: AssetPalette;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Import tab of the signature picker: a PNG or JPEG of 2 MB at most, from the device or dropped,
|
|
12
|
-
* previewed on paper before use. The drop zone checks the type and the size.
|
|
13
|
-
*/
|
|
14
|
-
export declare function SignatureUploadPanel({ onCapture, onCancel, onSave, assetPalette, }: SignatureUploadPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AssetPaletteItem } from '../engine/types';
|
|
2
|
-
/**
|
|
3
|
-
* Host-provided resolver that returns a usable data URL for a server-stored asset. Authenticated
|
|
4
|
-
* hosts implement it with a presigned download so it works cross-origin (a bare `fetch` of the
|
|
5
|
-
* storage public-access URL is CORS-blocked even though an `<img>` of the same URL renders).
|
|
6
|
-
*/
|
|
7
|
-
export type ResolveAssetBytes = (item: AssetPaletteItem) => Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* Resolves an asset palette item to a data URL ready to embed.
|
|
10
|
-
*
|
|
11
|
-
* - Prefers the host `resolver` (authenticated, cross-origin safe).
|
|
12
|
-
* - Falls back to a direct `fetch` of `downloadUrl`, which is right for same-origin or `data:`
|
|
13
|
-
* URLs (the local signatures of the anonymous page), so anonymous mode works without a resolver.
|
|
14
|
-
*
|
|
15
|
-
* Throws on failure so the caller can show an error instead of silently doing nothing.
|
|
16
|
-
*/
|
|
17
|
-
export declare const resolveAssetDataUrl: (item: AssetPaletteItem, resolver?: ResolveAssetBytes) => Promise<string>;
|
|
18
|
-
/** Reads a blob or a file as a `data:` URL. */
|
|
19
|
-
export declare const readAsDataUrl: (blob: Blob) => Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/components/editors/PdfEditor/signature/test-support/pdf-editor-test-harness.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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 { ThemeMode } from '../../../../../theme';
|
|
6
|
-
export interface EditorRenderOptions {
|
|
7
|
-
mode?: ThemeMode;
|
|
8
|
-
width?: number;
|
|
9
|
-
language?: UserLanguage;
|
|
10
|
-
}
|
|
11
|
-
export interface EditorRenderResult extends RenderResult {
|
|
12
|
-
theme: Theme;
|
|
13
|
-
}
|
|
14
|
-
/** Renders `ui` under the root theme and the messages of the language. */
|
|
15
|
-
export declare const renderEditor: (ui: ReactElement, { mode, width, language, }?: EditorRenderOptions) => EditorRenderResult;
|
|
16
|
-
/** What the canvas stub hands back for `toDataURL`: the image a drawn signature becomes. */
|
|
17
|
-
export declare const DRAWN_SIGNATURE = "data:image/png;base64,DRAWN";
|
|
18
|
-
/**
|
|
19
|
-
* jsdom has no 2D canvas: every canvas gets a context that accepts the calls of the viewer and of
|
|
20
|
-
* the signature pad, and `toDataURL` answers `DRAWN_SIGNATURE`.
|
|
21
|
-
*/
|
|
22
|
-
export declare const stubCanvas: () => void;
|
|
23
|
-
/** A real PDF of `pages` pages of 200 x 300 pt, for the bake paths (pdf-lib). */
|
|
24
|
-
export declare const realPdfBytes: (pages: number) => Promise<Uint8Array>;
|
|
25
|
-
/** The `download` names of the anchors the editor clicked, in order. */
|
|
26
|
-
export declare const stubDownloads: () => (() => string[]);
|
|
27
|
-
/** jsdom has no `IntersectionObserver`; the viewer only observes the pages. */
|
|
28
|
-
export declare const stubIntersectionObserver: () => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AssetPaletteItem, ToolKind } from '../engine/types';
|
|
2
|
-
import { PdfToolGroup } from './tool-groups';
|
|
3
|
-
import { PdfToolbarProps } from './PdfToolbar';
|
|
4
|
-
export interface GroupPanelProps extends PdfToolbarProps {
|
|
5
|
-
group: PdfToolGroup;
|
|
6
|
-
/** Picks a tool from a row of the panel. */
|
|
7
|
-
onPickTool(tool: ToolKind): void;
|
|
8
|
-
/** Runs an action of the panel, then closes the panel. */
|
|
9
|
-
onRun(action: () => void): void;
|
|
10
|
-
onPickSavedImage(item: AssetPaletteItem): void;
|
|
11
|
-
onPickSavedText(text: string): void;
|
|
12
|
-
onOpenPicker(): void;
|
|
13
|
-
}
|
|
14
|
-
/** Whether the group has anything to show: a tool, or an action the host wired. */
|
|
15
|
-
export declare const groupHasContent: (group: PdfToolGroup, props: PdfToolbarProps) => boolean;
|
|
16
|
-
/** The content of a group panel: its tools, its actions, then the options of the active tool. */
|
|
17
|
-
export declare function GroupPanel({ group, onPickTool, onRun, onPickSavedImage, onPickSavedText, onOpenPicker, ...props }: GroupPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface PanelRowProps {
|
|
3
|
-
icon: ReactNode;
|
|
4
|
-
label: string;
|
|
5
|
-
onClick(): void;
|
|
6
|
-
/** Set for a tool row: the row is a toggle that says whether the tool is the active one. */
|
|
7
|
-
pressed?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
/** Shows a spinner in place of the icon, as for an export in progress. */
|
|
10
|
-
busy?: boolean;
|
|
11
|
-
testId?: string;
|
|
12
|
-
}
|
|
13
|
-
/** A row of a group panel: a tool to pick or an action to run. */
|
|
14
|
-
export declare function PanelRow({ icon, label, onClick, pressed, disabled, busy, testId, }: PanelRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
import { AcroFormField, AssetPalette, AssetPaletteItem, EditorAction, ExportOption, PdfOperation, ToolKind } from '../engine/types';
|
|
3
|
-
import { PdfToolSettings } from './tool-settings';
|
|
4
|
-
/**
|
|
5
|
-
* What `PdfEditor` hands to the grouped toolbar. The data and callbacks are those of the legacy
|
|
6
|
-
* toolbar; the option panels of the tools now live in the toolbar, so the settings they edit come
|
|
7
|
-
* in through `settings`. The signature picker stays with the host.
|
|
8
|
-
*/
|
|
9
|
-
export interface PdfToolbarProps {
|
|
10
|
-
activeTool: ToolKind;
|
|
11
|
-
canUndo: boolean;
|
|
12
|
-
canRedo: boolean;
|
|
13
|
-
/** An export is running: Download and Save to Cloud are disabled. */
|
|
14
|
-
exporting: boolean;
|
|
15
|
-
dispatch: Dispatch<EditorAction>;
|
|
16
|
-
/** Download. Shown when `exportOptions` holds `DOWNLOAD`. */
|
|
17
|
-
onExport(): void;
|
|
18
|
-
/** Save to Cloud as a new file. Shown when `exportOptions` holds `CLOUD_NEW_FILE` and this is set. */
|
|
19
|
-
onSaveToCloud?(): void;
|
|
20
|
-
/** Change file. Shown when set. */
|
|
21
|
-
onChangeSource?(): void;
|
|
22
|
-
exportOptions: ExportOption[];
|
|
23
|
-
fileName?: string;
|
|
24
|
-
/** Saved signatures, initials, stamps and text blocks offered in « Sign and fill ». */
|
|
25
|
-
assetPalette?: AssetPalette;
|
|
26
|
-
/** Resolves a saved image asset to a data URL ready to place (the host binds `resolveAssetBytes`). */
|
|
27
|
-
resolveAsset(item: AssetPaletteItem): Promise<string>;
|
|
28
|
-
/** Called with the translated message when a saved asset cannot be loaded. */
|
|
29
|
-
onAssetError?(message: string): void;
|
|
30
|
-
/** The signature waiting to be placed: choosing the Signature tool without one opens the picker. */
|
|
31
|
-
pendingSignature: string | null;
|
|
32
|
-
pendingApplyAllPages?: boolean;
|
|
33
|
-
/** Opens the signature picker (drawn, imported or saved), which the host renders. */
|
|
34
|
-
onOpenSignaturePicker(): void;
|
|
35
|
-
sidebarOpen?: boolean;
|
|
36
|
-
/** Page thumbnails toggle, in « Pages ». */
|
|
37
|
-
onToggleSidebar?(): void;
|
|
38
|
-
onAddBlankPage?(): void;
|
|
39
|
-
onAddPageNumbers?(): void;
|
|
40
|
-
onWatermark?(): void;
|
|
41
|
-
/** Insert an image from the device. */
|
|
42
|
-
onInsertImage?(): void;
|
|
43
|
-
/** Insert an image picked from AbyssCloud. */
|
|
44
|
-
onInsertCloudImage?(): void;
|
|
45
|
-
onExtractPages?(): void;
|
|
46
|
-
/** Host-provided (qpdf-WASM) actions: shown only when wired. */
|
|
47
|
-
onProtect?(): void;
|
|
48
|
-
onCompress?(): void;
|
|
49
|
-
/** A password or compression runs: those two actions are disabled. */
|
|
50
|
-
securing?: boolean;
|
|
51
|
-
/** Values of the tool option panels, and how an edit patches them. */
|
|
52
|
-
settings: PdfToolSettings;
|
|
53
|
-
onSettingsChange(patch: Partial<PdfToolSettings>): void;
|
|
54
|
-
acroFormFields: AcroFormField[];
|
|
55
|
-
operations: PdfOperation[];
|
|
56
|
-
/** A signature, image or text is armed for placement: group panels stay closed so they never cover the page. */
|
|
57
|
-
placementActive?: boolean;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* The grouped toolbar of the PDF editor (D4). Selection, Undo and Redo are always on the bar; the
|
|
61
|
-
* other tools and the document actions sit in five groups (Annotate, Sign and fill, Pages, Security,
|
|
62
|
-
* File), each opening a panel under its button (a bottom sheet below 768 px) with the options of the
|
|
63
|
-
* active tool. A group button shows the active tool of its group.
|
|
64
|
-
*/
|
|
65
|
-
export declare function PdfToolbar(props: PdfToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AssetPalette, AssetPaletteItem } from '../engine/types';
|
|
3
|
-
export interface AssetBucket {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
avatar?: ReactNode;
|
|
7
|
-
signatures: AssetPaletteItem[];
|
|
8
|
-
texts: AssetPaletteItem[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The saved assets grouped by their owner (personal, each organization, each project), keeping the
|
|
12
|
-
* signature-like items that have a usable image and the text blocks that have a text. Buckets with
|
|
13
|
-
* nothing to pick are left out.
|
|
14
|
-
*/
|
|
15
|
-
export declare const bucketsOf: (palette: AssetPalette | undefined, personalLabel: string) => AssetBucket[];
|
|
16
|
-
export interface SavedAssetsProps {
|
|
17
|
-
buckets: AssetBucket[];
|
|
18
|
-
applyToAllPages: boolean;
|
|
19
|
-
onApplyToAllPagesChange(enabled: boolean): void;
|
|
20
|
-
onPickImage(item: AssetPaletteItem): void;
|
|
21
|
-
onPickText(text: string): void;
|
|
22
|
-
}
|
|
23
|
-
/** Saved signatures, initials, stamps and text blocks, one click from the page. */
|
|
24
|
-
export declare function SavedAssets({ buckets, applyToAllPages, onApplyToAllPagesChange, onPickImage, onPickText, }: SavedAssetsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ComponentType, MouseEvent } from 'react';
|
|
2
|
-
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
|
-
export interface ToolGroupButtonProps {
|
|
4
|
-
/** Accessible name of the button. */
|
|
5
|
-
ariaLabel: string;
|
|
6
|
-
/** Text drawn next to the icon from 1200 px; omitted for an icon-only button. */
|
|
7
|
-
label?: string;
|
|
8
|
-
icon: ComponentType<SvgIconProps>;
|
|
9
|
-
/** The button opens a group panel (a chevron says so); otherwise it acts at once. */
|
|
10
|
-
popup?: boolean;
|
|
11
|
-
/** The panel is open. */
|
|
12
|
-
expanded?: boolean;
|
|
13
|
-
/** A direct tool button: whether its tool is the active one. */
|
|
14
|
-
pressed?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
testId: string;
|
|
17
|
-
onClick(event: MouseEvent<HTMLButtonElement>): void;
|
|
18
|
-
}
|
|
19
|
-
/** A button of the bar: a group that opens its panel, or a tool or history control that acts at once. */
|
|
20
|
-
export declare function ToolGroupButton({ ariaLabel, label, icon: Icon, popup, expanded, pressed, disabled, testId, onClick, }: ToolGroupButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
|
-
import { ToolKind } from '../engine/types';
|
|
4
|
-
type IconComponent = ComponentType<SvgIconProps>;
|
|
5
|
-
/** The six groups of the bar (D4), in the order they are drawn. */
|
|
6
|
-
export declare enum PdfToolGroupId {
|
|
7
|
-
Select = "select",
|
|
8
|
-
Annotate = "annotate",
|
|
9
|
-
SignFill = "sign-fill",
|
|
10
|
-
Pages = "pages",
|
|
11
|
-
Security = "security",
|
|
12
|
-
File = "file"
|
|
13
|
-
}
|
|
14
|
-
export interface PdfToolGroup {
|
|
15
|
-
id: PdfToolGroupId;
|
|
16
|
-
/** Message id of the group name. */
|
|
17
|
-
labelId: string;
|
|
18
|
-
icon: IconComponent;
|
|
19
|
-
/** The tools the group holds, in the order of its panel. */
|
|
20
|
-
tools: readonly ToolKind[];
|
|
21
|
-
/** A group drawn as one button that picks its only tool, with no panel (Selection). */
|
|
22
|
-
direct: boolean;
|
|
23
|
-
/** Drawn at the far end of the bar, after the history controls (File). */
|
|
24
|
-
trailing: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare const PDF_TOOL_GROUPS: readonly PdfToolGroup[];
|
|
27
|
-
export interface PdfToolMeta {
|
|
28
|
-
labelId: string;
|
|
29
|
-
icon: IconComponent;
|
|
30
|
-
/** Whether the tool has an options panel (colour, width, font, hint…). */
|
|
31
|
-
hasOptions: boolean;
|
|
32
|
-
}
|
|
33
|
-
export declare const PDF_TOOLS: Record<ToolKind, PdfToolMeta>;
|
|
34
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PdfToolSettings } from '../tool-settings';
|
|
2
|
-
export interface DrawOptionsProps {
|
|
3
|
-
settings: PdfToolSettings;
|
|
4
|
-
onChange(patch: Partial<PdfToolSettings>): void;
|
|
5
|
-
}
|
|
6
|
-
export declare function DrawOptions({ settings, onChange }: DrawOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
import { AcroFormField, EditorAction, PdfOperation } from '../../engine/types';
|
|
3
|
-
export interface FillFieldsOptionsProps {
|
|
4
|
-
fields: AcroFormField[];
|
|
5
|
-
operations: PdfOperation[];
|
|
6
|
-
dispatch: Dispatch<EditorAction>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The form fields of the document. At most one FILL_FIELD operation exists per field: an edit
|
|
10
|
-
* updates it in place instead of stacking a new one, so the inputs stay in step with undo and redo
|
|
11
|
-
* (they derive their value from the operation).
|
|
12
|
-
*/
|
|
13
|
-
export declare function FillFieldsOptions({ fields, operations, dispatch, }: FillFieldsOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PdfToolSettings } from '../tool-settings';
|
|
2
|
-
export interface HighlightOptionsProps {
|
|
3
|
-
settings: PdfToolSettings;
|
|
4
|
-
onChange(patch: Partial<PdfToolSettings>): void;
|
|
5
|
-
}
|
|
6
|
-
export declare function HighlightOptions({ settings, onChange, }: HighlightOptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Redaction is destructive: on export the affected pages are flattened to an image with opaque
|
|
3
|
-
* boxes, so the content underneath is gone for good. The panel says so before the user draws;
|
|
4
|
-
* there is nothing to configure.
|
|
5
|
-
*/
|
|
6
|
-
export declare function RedactOptions(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
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>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
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>;
|