@softistx/material 3.248.0 → 3.249.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/CHANGELOG.md +24 -0
- package/README.md +6 -2
- package/dist/adopt-styles-C3MfGnxE.js +20 -0
- package/dist/{async-slice-C5HfFq1M.js → async-slice-DdEr7vFx.js} +1 -1
- package/dist/{audio-player-2kKst8lH.js → audio-player-DMYszRGT.js} +3 -3
- package/dist/{audio-player-viewer-D9DsYBcy.js → audio-player-viewer-z13yCjo4.js} +2 -2
- package/dist/{autocomplete-JuRCjl48.js → autocomplete-Bgf_AJ6U.js} +11 -11
- package/dist/{avatar-CvvdaBu4.js → avatar-WvTropuJ.js} +1 -1
- package/dist/blank-placeholder-DZIFJ0DG.js +17 -0
- package/dist/{breadcrumb-DacRqg91.js → breadcrumb-DYa6pVsq.js} +5 -5
- package/dist/{button-CpUMPIdk.js → button-RsWgka2v.js} +1 -1
- package/dist/{calculator-BYgFgWHL.js → calculator-DPHCuAZy.js} +11 -11
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-DCHWZy6b.js → calculator-segment-Ckn9Fua9.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/canvas-BShNj4yp.js +144 -0
- package/dist/capture-outputs-qcYUPW6K.js +174 -0
- package/dist/capture-toolbar.css +2 -0
- package/dist/capture-toolbar.js +858 -0
- package/dist/capture.js +53 -139
- package/dist/charts.js +3 -3
- package/dist/{chip-CjJPmAYO.js → chip-tyDM0lpO.js} +2 -2
- package/dist/{code-editor-nNcxtslA.js → code-editor-gHHXEwF-.js} +6 -6
- package/dist/code-editor.js +6 -6
- package/dist/{code-file-viewer-CcESl49v.js → code-file-viewer-CYQcskvt.js} +4 -4
- package/dist/{code-language-items-CW8_Si05.js → code-language-items-DDFuDf_E.js} +2 -2
- package/dist/{components-BdMaUeOm.js → components-BbAylWQW.js} +16711 -20831
- package/dist/components.js +83 -79
- package/dist/{confirm-dialog-B2eonW2X.js → confirm-dialog-IHvPA3O2.js} +4 -4
- package/dist/{conversion-variant-DZm_xgUK.js → conversion-variant-MWTjnFnG.js} +5 -5
- package/dist/{currency-field-UIkYAlvP.js → currency-field-Bd9od1Ee.js} +5 -5
- package/dist/{detail-panel-header-CL2_tUG0.js → detail-panel-header-D2a63Sk3.js} +1 -1
- package/dist/{details-content-CPzj3vUr.js → details-content-CnN_ukTA.js} +6 -6
- package/dist/{details-header-band-D-CyB_Xx.js → details-header-band-wcgmC7qC.js} +5 -5
- package/dist/{details-host-BvYgFIWx.js → details-host-DKEaGH4P.js} +1 -1
- package/dist/{details-sheet-D4PTV_jR.js → details-sheet-CtNM4oDU.js} +2 -2
- package/dist/{details-shell-D4XoPRBu.js → details-shell-DZ80h6mN.js} +1 -1
- package/dist/{dialog-CleLsHkZ.js → dialog-DwUxG2-o.js} +1 -1
- package/dist/{dialog-app-bar-CLC990e6.js → dialog-app-bar-BsJ4UwKb.js} +2 -2
- package/dist/dist-Cb17ixQs.js +16 -0
- package/dist/dist-CyqFzDZ6.js +11 -0
- package/dist/dnd.js +1 -1
- package/dist/draw.js +1 -1
- package/dist/{drop-overlay-BTkVfscF.js → drop-overlay-B26hx0-T.js} +2 -2
- package/dist/{dropdown-menu-BoJC2DEH.js → dropdown-menu-D-PRbHaP.js} +1 -1
- package/dist/{editable-section-CTRGfbLJ.js → editable-section-DPmF1flG.js} +3 -3
- package/dist/editor.js +14 -14
- package/dist/embed-chunks/{avatar-GlGqPU7B.js → avatar-CSDtFCum.js} +1 -1
- package/dist/embed-chunks/{dist-BrYZYfsJ.js → dist-C-lAK_LC.js} +2 -2
- package/dist/embed-chunks/{emoji-picker-BSYBi_C8.js → emoji-picker-BWDQFdQu.js} +4 -4
- package/dist/embed-chunks/{mention-list-NW43QcRq.js → mention-list-CdUr0h3X.js} +3 -3
- package/dist/embed-chunks/{nxgt-theme-provider-B1aeqDja.js → nxgt-theme-provider-DdDsiEPj.js} +2 -2
- package/dist/embed-chunks/{switch-control-ChcowM3u.js → switch-control-B95ZWvna.js} +1 -1
- package/dist/embed-chunks/{tabs-root-CY-uLp1C.js → tabs-root-MF9lEHbq.js} +2 -2
- package/dist/embed-chunks/{use-shape-morph-NrJQMv7i.js → use-shape-morph-D1MOoQ4T.js} +110 -2
- package/dist/embed-chunks/{useLatest-B57qw3XH.js → useLatest-RGIW0nya.js} +1 -1
- package/dist/embed.js +626 -613
- package/dist/{emoji-picker-DZbTd3Fr.js → emoji-picker-DabgsEVQ.js} +7 -7
- package/dist/{empty-state-DBSJDLKL.js → empty-state-BylD7RYH.js} +1 -1
- package/dist/{error-state-kauz4If4.js → error-state-BTe_NzTC.js} +2 -2
- package/dist/fab-DUnGwNE7.js +41 -0
- package/dist/fab-dock-By2pLVh7.js +49 -0
- package/dist/{feature-popup-CcXMGFES.js → feature-popup-CW7VS2fx.js} +1 -1
- package/dist/{blank-placeholder-DeDn5Xor.js → field-box-BXN-uyrv.js} +1 -16
- package/dist/{field-group-BpV74Ttu.js → field-group-B2Ozd5Jn.js} +1 -1
- package/dist/{file-dialogs-CbdvmY__.js → file-dialogs-CgEXaCev.js} +7 -7
- package/dist/{file-manager-shell-DLaJ5Z_L.js → file-manager-shell-Tqduf5lh.js} +21 -21
- package/dist/{file-preview-host-RhZvGGqC.js → file-preview-host-CM4pV3ZD.js} +2367 -2384
- package/dist/{file-viewer-body-DM3RkXGn.js → file-viewer-body-DrWFmnp4.js} +3 -3
- package/dist/{file-viewer-dialog-impl-ei5EYj8k.js → file-viewer-dialog-impl-DZpuZZ7x.js} +2 -2
- package/dist/files-drop.js +1 -1
- package/dist/files-picker.js +8 -8
- package/dist/files.js +3 -3
- package/dist/{financial-variant-BNdOqzA5.js → financial-variant-ljdP0JL4.js} +5 -5
- package/dist/{flow-diagram-BBB6r8--.js → flow-diagram-DwUnyl0u.js} +1 -1
- package/dist/{gallery-CIIJHpmj.js → gallery-DfN2KE4Y.js} +11 -11
- package/dist/{gallery-file-viewer-DkshswFr.js → gallery-file-viewer-BfFWfLIF.js} +3 -3
- package/dist/{gl-markers-abqcNuYT.js → gl-markers-CBNFeWIk.js} +3 -3
- package/dist/{hooks-D6lOSXA5.js → hooks-DiAhgchz.js} +3 -3
- package/dist/hooks.js +3 -3
- package/dist/i18n.js +3 -3
- package/dist/{icon-button-GKYj7uC4.js → icon-button-D-gi4Plg.js} +1 -1
- package/dist/image-editor-mmhbsqs-.js +4423 -0
- package/dist/image-editor.css +1 -1
- package/dist/image-editor.js +1124 -848
- package/dist/image-markup-editor-D-QkZWKf.js +24 -0
- package/dist/input-CWf3Apid.js +18 -0
- package/dist/input-box-moFuoMt0.js +15 -0
- package/dist/{input-group-CKO68Pyi.js → input-group-Bb8sAFRF.js} +3 -2
- package/dist/{item-details-l_-rk3Hj.js → item-details-BWdHMfsS.js} +7 -7
- package/dist/keypad.js +2 -2
- package/dist/lib/capture/engine/canvas.d.ts +17 -0
- package/dist/lib/capture/engine/capture.d.ts +19 -0
- package/dist/lib/capture/engine/filters.d.ts +27 -0
- package/dist/lib/capture/engine/rect.d.ts +26 -0
- package/dist/lib/capture/engine/types.d.ts +66 -0
- package/dist/lib/capture/index.d.ts +16 -0
- package/dist/lib/capture/modes/capture-mode.d.ts +24 -0
- package/dist/lib/capture/modes/countdown.d.ts +16 -0
- package/dist/lib/capture/modes/full-page.d.ts +14 -0
- package/dist/lib/capture/modes/pick-element.d.ts +22 -0
- package/dist/lib/capture/modes/scroller.d.ts +13 -0
- package/dist/lib/capture/modes/visible.d.ts +3 -0
- package/dist/lib/capture-toolbar/index.d.ts +25 -0
- package/dist/lib/capture-toolbar/lazy-capture-outputs.d.ts +2 -0
- package/dist/lib/capture-toolbar/outputs-encode.d.ts +25 -0
- package/dist/lib/capture-toolbar/outputs.d.ts +38 -0
- package/dist/lib/capture-toolbar/partials/capture-editor.d.ts +11 -0
- package/dist/lib/capture-toolbar/partials/capture-outputs.d.ts +16 -0
- package/dist/lib/capture-toolbar/region-overlay.d.ts +15 -0
- package/dist/lib/capture-toolbar/screen-capture-toolbar.d.ts +31 -0
- package/dist/lib/capture-toolbar/types.d.ts +117 -0
- package/dist/lib/capture-toolbar/use-screen-capture.d.ts +16 -0
- package/dist/lib/components/ui/media/attachment-list/attachment-list.d.ts +2 -2
- package/dist/lib/components/ui/media/image-editor/image-markup-editor.d.ts +11 -3
- package/dist/lib/components/ui/media/image-editor/types-edits.d.ts +7 -0
- package/dist/lib/components/ui/media/image-editor/types-session.d.ts +1 -1
- package/dist/lib/components/ui/media/image-editor/types.d.ts +8 -0
- package/dist/lib/embed/index.d.ts +2 -0
- package/dist/lib/i18n/resources/resources.d.ts +108 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/image-editor/index.d.ts +1 -1
- package/dist/lib.js +38 -56
- package/dist/{list-sheet-D22J9I-K.js → list-sheet-CejfrKJr.js} +1 -1
- package/dist/{loading-indicator-sDzxZg8f.js → loading-indicator-BBjOF25N.js} +1 -1
- package/dist/main.js +103 -98
- package/dist/{map-draw-DfbfT0eJ.js → map-draw-DyRy9SSV.js} +2 -2
- package/dist/map-draw.js +5 -5
- package/dist/map-static.js +1 -1
- package/dist/{map-view-DAx2zvV-.js → map-view-YfuYD3zS.js} +9 -9
- package/dist/map-zone-events.js +1 -1
- package/dist/map-zone-field.js +7 -7
- package/dist/map.js +10 -10
- package/dist/{marker-button-D7hEvEZD.js → marker-button-CXBaToHp.js} +1 -1
- package/dist/{marker-count-image-CWS3G-k8.js → marker-count-image-DHuzSev9.js} +1 -1
- package/dist/material.css +1 -1
- package/dist/{measure-manual-Bfvu8B_R.js → measure-manual-CcESmV1d.js} +3 -3
- package/dist/{measurement-B-OeWv7j.js → measurement-D2or6yM_.js} +1 -1
- package/dist/{media-player-DGXmWK7W.js → media-player-qW9RXFuO.js} +451 -567
- package/dist/{media-player-viewer-C3vXYcd8.js → media-player-viewer-DozPiF6T.js} +2 -2
- package/dist/{media-surface-BySonDjv.js → media-surface-BJsdNynm.js} +6 -6
- package/dist/{mention-list-BpoZHwO6.js → mention-list-z1wnlJgs.js} +2 -2
- package/dist/{native-select-Dg4bc7aC.js → native-select-BnDOVnER.js} +1 -1
- package/dist/{nxgt-theme-Ob-uFqU_.js → nxgt-theme-EYZ5aFHi.js} +6 -15
- package/dist/nxgt-theme-provider-BPXd3h82.js +40 -0
- package/dist/outputs-DF-aVqUO.js +81 -0
- package/dist/passkey.js +1 -1
- package/dist/{pdf-form-filler-DgH52W2Q.js → pdf-form-filler-Ct4eexhZ.js} +34 -34
- package/dist/pdf-form.js +2 -2
- package/dist/{pdf-reader-Bilz5foK.js → pdf-reader-khpMMEjU.js} +16 -16
- package/dist/{pdf-reader-viewer-DwQP2IpV.js → pdf-reader-viewer-B3_TdFOn.js} +2 -2
- package/dist/pdf-reader.js +2 -2
- package/dist/{percent-field-Ldc7K2wC.js → percent-field-Bu-PmCNR.js} +2 -2
- package/dist/{picker-surface-DZQbBgvA.js → picker-surface-THexE1OU.js} +3 -3
- package/dist/{popover-DwsaHFrK.js → popover-osl5duoA.js} +1 -1
- package/dist/portal-container-provider-fZFUk-ZB.js +11 -0
- package/dist/{pos-types-CKDG7pZA.js → pos-types-BPPae99i.js} +1 -1
- package/dist/{pos-variant-9nhz-ZzW.js → pos-variant-D6bDUqwV.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-BzwfeMGC.js → programmer-variant-CDlFE24o.js} +2 -2
- package/dist/{progress-BBfp7sMi.js → progress-DjHnanxA.js} +2 -2
- package/dist/{progress-linear-BOJbHnzd.js → progress-linear-CTJ_U6kY.js} +1 -1
- package/dist/{public-I8nb8pCC.js → public-u9u2Osmx.js} +6 -6
- package/dist/{rendition-stage-A1nHXYrA.js → rendition-stage-BXjQpfKK.js} +2 -2
- package/dist/{rich-code-block-BJERY3N3.js → rich-code-block-DWSzyQRw.js} +5 -5
- package/dist/{scientific-variant-st2NBm1K.js → scientific-variant-DCgApH87.js} +2 -2
- package/dist/{scroll-area-B3XstZU2.js → scroll-area-BxKiT4Dn.js} +155 -164
- package/dist/{search-field-D3AOJr7s.js → search-field-Cgqa2bQf.js} +2 -2
- package/dist/{select-DhfzCkun.js → select-BGhRlBh4.js} +166 -179
- package/dist/{sheet-B8cO1T5K.js → sheet-BvNVroog.js} +1 -1
- package/dist/{signature-dialog-BNLMPgao.js → signature-dialog-x--_QWRB.js} +5 -5
- package/dist/signature.js +1 -1
- package/dist/{site-footer-cta-Cx7zsvkq.js → site-footer-cta-B3Kfqpep.js} +4 -4
- package/dist/{site-footer-link-Di8IMIw0.js → site-footer-link-SFHrO4ld.js} +1 -1
- package/dist/{size-slot-D1cKqb09.js → size-slot-Cb-W2Zm4.js} +1 -1
- package/dist/{sortable-provider-DrLnoygf.js → sortable-provider-KRScvvYx.js} +2 -2
- package/dist/{spinner-BpH9tE8R.js → spinner-DpB6XvJJ.js} +1 -1
- package/dist/switch-c_6OtXzW.js +125 -0
- package/dist/{tabs-root-BUnIfDah.js → tabs-root-C2n3K_Yv.js} +1 -1
- package/dist/{tags-form-BwqR4UVj.js → tags-form-BKB9fP03.js} +5 -5
- package/dist/{text-field-CFCHo07X.js → text-field-Dl7xTxZe.js} +2 -2
- package/dist/{textarea-B_iMDYgM.js → textarea-C3BGZELU.js} +1 -1
- package/dist/{textarea-field-DIOGxyUd.js → textarea-field-mqWhhbis.js} +2 -2
- package/dist/theme-picker.js +5 -4
- package/dist/{theme-toggle-CsBe64lm.js → theme-toggle-K-n5eq0T.js} +3 -3
- package/dist/theme-value-CD2nDrj_.js +12 -0
- package/dist/themes.js +15 -48
- package/dist/{toasts-McZnLRHP.js → toasts-DFLecXh0.js} +5 -5
- package/dist/{toggle-group-DKN1XLBS.js → toggle-group-DMDjNJWx.js} +1 -1
- package/dist/{toolbar-group-BmzGP_JO.js → toolbar-group-bttMdvg4.js} +1 -1
- package/dist/{toolbar-item-slot-BnqQLkVd.js → toolbar-item-slot-CBn3YjeE.js} +1 -1
- package/dist/{toolbar-items-C9uasXZ2.js → toolbar-items-zL5TYLf2.js} +4 -4
- package/dist/{toolbar-keep-focus-Vc5V-dX2.js → toolbar-keep-focus-C6bnzvpE.js} +2 -2
- package/dist/{tracked-layer-CjCXB_O6.js → tracked-layer-CYdLWRK-.js} +4 -4
- package/dist/{translate-material-C-qVvGLn.js → translate-material-DZNgWjYu.js} +1 -1
- package/dist/{translator-BrzI307E.js → translator-CrIFDzAz.js} +110 -2
- package/dist/{tree-DOAs456A.js → tree-CFXDccIe.js} +1 -1
- package/dist/{upload-host-ZpSSql8v.js → upload-host-DDktVohu.js} +9 -8
- package/dist/{use-calculator-keyboard-Ss25SRoM.js → use-calculator-keyboard-BWkYuIw5.js} +1 -1
- package/dist/{use-chat-composer-DopDN-zP.js → use-chat-composer-C1Qlnw2i.js} +20 -20
- package/dist/{use-file-meta-DyJX0JVs.js → use-file-meta-DcfQCh52.js} +1 -1
- package/dist/{use-heading-spy-CA2IAqMe.js → use-heading-spy-B9xEMHbZ.js} +2 -2
- package/dist/use-image-preview-BNq_RQm5.js +20 -0
- package/dist/{use-item-entries-CYbS5otl.js → use-item-entries-BKQHcWFx.js} +1 -1
- package/dist/{use-material-translation-eYySryw3.js → use-material-translation-ZEUtduro.js} +1 -1
- package/dist/{use-media-viewer-DoNdrzhN.js → use-media-viewer-DViJNx75.js} +1 -1
- package/dist/{use-text-preview-BQE4U9cT.js → use-text-preview-Ci97JKKo.js} +2 -2
- package/dist/{use-unsaved-guard-CSfDvdxd.js → use-unsaved-guard-CWlHEvjN.js} +2 -2
- package/dist/{viewer-CXF1dAv0.js → viewer-DDPJOxBt.js} +5 -5
- package/dist/{viewer-stage-class-CpyA8o-M.js → viewer-stage-class-DJ1uod4l.js} +4 -4
- package/dist/{viewer-states-BXyCdNhE.js → viewer-states-DkaPBkK4.js} +3 -3
- package/dist/{virtual-layer-rows-DHy8vAup.js → virtual-layer-rows-DKejQ_Jd.js} +1 -1
- package/dist/visible-B-IFZ4Nv.js +475 -0
- package/docs/components/media-and-files.md +1 -1
- package/docs/guides/capture.md +248 -0
- package/docs/guides/csp.md +1 -1
- package/docs/guides/embed.md +50 -2
- package/docs/roadmap.md +2 -1
- package/docs/troubleshooting.md +56 -0
- package/package.json +18 -1
- package/dist/fab-dock-DqwbI-5n.js +0 -86
- package/dist/input-BaBE_MR_.js +0 -27
- /package/dist/{dist-B1qFabLJ.js → dist-B1qFabLJ2.js} +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { FileSource, FileSourceItem } from '@softistx/material-core/files';
|
|
2
|
+
import { CaptureEngineName, CaptureOptions, CaptureRect } from '../capture/engine/types.js';
|
|
3
|
+
import { CaptureDelay } from '../capture/modes/countdown.js';
|
|
4
|
+
import { CaptureFormat, CaptureUploadOptions } from './outputs.js';
|
|
5
|
+
/** What the toolbar captures: `system` asks the browser for a window, tab or screen. */
|
|
6
|
+
export type ScreenCaptureMode = 'visible' | 'region' | 'element' | 'full-page' | 'system';
|
|
7
|
+
export declare const SCREEN_CAPTURE_MODES: readonly ScreenCaptureMode[];
|
|
8
|
+
export type ScreenCaptureStatus = 'idle' | 'reviewing' | 'counting' | 'selecting' | 'picking' | 'capturing' | 'editing';
|
|
9
|
+
export type ScreenCaptureResult = {
|
|
10
|
+
/** The PNG; the edited image when `edit` is on and the person pressed Done. */
|
|
11
|
+
blob: Blob;
|
|
12
|
+
/** `true` when `blob` went through the markup editor. */
|
|
13
|
+
edited: boolean;
|
|
14
|
+
canvas: HTMLCanvasElement;
|
|
15
|
+
/** Canvas pixels per CSS pixel. */
|
|
16
|
+
scale: number;
|
|
17
|
+
engine: CaptureEngineName | 'custom';
|
|
18
|
+
mode: ScreenCaptureMode;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The actions shown after Done (or after the capture, with `edit` off), and
|
|
22
|
+
* how the image is saved. Copy, Download and Share are on by default and shown
|
|
23
|
+
* only where the browser supports them; Upload shows when `upload` is set.
|
|
24
|
+
*/
|
|
25
|
+
export type ScreenCaptureOutputs = {
|
|
26
|
+
/** Copy to the clipboard, as a PNG. Default `true`. */
|
|
27
|
+
copy?: boolean;
|
|
28
|
+
/** Download as a file. Default `true`. */
|
|
29
|
+
download?: boolean;
|
|
30
|
+
/** The native share sheet, with the image as a file. Default `true`. */
|
|
31
|
+
share?: boolean;
|
|
32
|
+
/** Upload through a `FileSource` that has `upload`. */
|
|
33
|
+
upload?: CaptureUploadOptions & {
|
|
34
|
+
source: FileSource;
|
|
35
|
+
/** Called with the stored item once the upload is done. */
|
|
36
|
+
onUploaded?: (item: FileSourceItem) => void;
|
|
37
|
+
};
|
|
38
|
+
/** Download, share and upload format. Default `png`; copy is always PNG. */
|
|
39
|
+
format?: CaptureFormat;
|
|
40
|
+
/** 0 to 1, for `webp` and `jpeg`. Default 0.92. */
|
|
41
|
+
quality?: number;
|
|
42
|
+
/** File name, with or without the extension. Default `capture`. */
|
|
43
|
+
fileName?: string;
|
|
44
|
+
};
|
|
45
|
+
/** What `review` carries: the capture to act on and how to close the step. */
|
|
46
|
+
export type CaptureReviewHandlers = {
|
|
47
|
+
result: ScreenCaptureResult;
|
|
48
|
+
onClose: () => void;
|
|
49
|
+
};
|
|
50
|
+
export type UseScreenCaptureOptions = {
|
|
51
|
+
/**
|
|
52
|
+
* Keeps the capture open after `onCapture`, with `status` `reviewing` and
|
|
53
|
+
* `review` set, until `review.onClose()` or `cancel()`: the step where the
|
|
54
|
+
* output actions show. `ScreenCaptureToolbar` sets it with `outputs`.
|
|
55
|
+
*/
|
|
56
|
+
review?: boolean;
|
|
57
|
+
/** Called with the image once it is ready. */
|
|
58
|
+
onCapture?: (result: ScreenCaptureResult) => void;
|
|
59
|
+
/** Called when no image came out (a cancel is not an error). */
|
|
60
|
+
onError?: (error: unknown) => void;
|
|
61
|
+
/** Engine, masking, scale and background of the capture. */
|
|
62
|
+
capture?: Omit<CaptureOptions, 'engine'>;
|
|
63
|
+
/**
|
|
64
|
+
* Opens the markup editor on the capture (floating tools, crop, numbered
|
|
65
|
+
* step marker) before `onCapture`: Done hands over the edited image,
|
|
66
|
+
* Cancel returns to the page with nothing. The editor is loaded only when
|
|
67
|
+
* a capture opens it. Default `false` here (render `CaptureEditor` with
|
|
68
|
+
* `editor` when set), `true` on `ScreenCaptureToolbar`.
|
|
69
|
+
*/
|
|
70
|
+
edit?: boolean;
|
|
71
|
+
/** Full page: the scroller to capture instead of the detected one. */
|
|
72
|
+
target?: HTMLElement;
|
|
73
|
+
/** The first mode. Default `visible`. */
|
|
74
|
+
defaultMode?: ScreenCaptureMode;
|
|
75
|
+
/** The first timer, in seconds; `0` for none (default). */
|
|
76
|
+
defaultDelay?: CaptureDelay | 0;
|
|
77
|
+
/**
|
|
78
|
+
* A global shortcut that starts a capture, such as `Alt+Shift+S`. None by
|
|
79
|
+
* default: the page keeps every key it has.
|
|
80
|
+
*/
|
|
81
|
+
shortcut?: string;
|
|
82
|
+
};
|
|
83
|
+
export type RegionHandlers = {
|
|
84
|
+
/** Confirms the region. */
|
|
85
|
+
onSelect: (rect: CaptureRect) => void;
|
|
86
|
+
/** Cancels the selection. */
|
|
87
|
+
onCancel: () => void;
|
|
88
|
+
};
|
|
89
|
+
export type CaptureEditorHandlers = {
|
|
90
|
+
/** The capture to edit. */
|
|
91
|
+
blob: Blob;
|
|
92
|
+
/** Done: the edited image. */
|
|
93
|
+
onDone: (edited: Blob) => void;
|
|
94
|
+
/** Cancel: back to the page, no image. */
|
|
95
|
+
onCancel: () => void;
|
|
96
|
+
};
|
|
97
|
+
export type ScreenCaptureController = {
|
|
98
|
+
mode: ScreenCaptureMode;
|
|
99
|
+
setMode: (mode: ScreenCaptureMode) => void;
|
|
100
|
+
delay: CaptureDelay | 0;
|
|
101
|
+
setDelay: (delay: CaptureDelay | 0) => void;
|
|
102
|
+
status: ScreenCaptureStatus;
|
|
103
|
+
/** Seconds left while `status` is `counting`. */
|
|
104
|
+
left: number;
|
|
105
|
+
/** The last error, until the next capture. */
|
|
106
|
+
error: unknown;
|
|
107
|
+
/** Starts a capture of `mode` (the current one by default). */
|
|
108
|
+
start: (mode?: ScreenCaptureMode) => void;
|
|
109
|
+
/** Stops the countdown, the selection or the pick. */
|
|
110
|
+
cancel: () => void;
|
|
111
|
+
/** Set while the region overlay is to be shown. */
|
|
112
|
+
region: RegionHandlers | null;
|
|
113
|
+
/** Set while the markup editor is to be shown (`edit` on). */
|
|
114
|
+
editor: CaptureEditorHandlers | null;
|
|
115
|
+
/** Set while the output actions are to be shown (`review` on). */
|
|
116
|
+
review: CaptureReviewHandlers | null;
|
|
117
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScreenCaptureController, UseScreenCaptureOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The state of a capture, headless: the mode, the timer, the status and
|
|
4
|
+
* `start()`. `ScreenCaptureToolbar` is built on it; use it alone to start a
|
|
5
|
+
* capture from your own button or menu, and render `RegionOverlay` when
|
|
6
|
+
* `region` is set (and `<CaptureEditor {...cap.editor} />` when `editor` is, with
|
|
7
|
+
* `edit: true`).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const cap = useScreenCapture({ onCapture: ({ blob }) => upload(blob) });
|
|
12
|
+
* <button onClick={() => cap.start('visible')}>Capture</button>
|
|
13
|
+
* {cap.region && <RegionOverlay {...cap.region} />}
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useScreenCapture(options?: UseScreenCaptureOptions): ScreenCaptureController;
|
|
@@ -4,8 +4,8 @@ import { DropRefusalReason } from '../../../../files-drop/drop-files.js';
|
|
|
4
4
|
export type AttachmentItem = {
|
|
5
5
|
/** A stable key (the list's key and the id `onRemove` gets). */
|
|
6
6
|
id: string;
|
|
7
|
-
/** The file, or just what is known of it (a file already uploaded: no thumbnail without the bytes). */
|
|
8
|
-
file: Pick<File, 'name' | 'type'
|
|
7
|
+
/** The file, or just what is known of it (a file already uploaded: no thumbnail without the bytes, and no `size` when it is unknown: none is shown). */
|
|
8
|
+
file: Pick<File, 'name' | 'type'> & Partial<Blob>;
|
|
9
9
|
/** Uploading, 0 to 100: a progress bar. Unset: none. */
|
|
10
10
|
progress?: number;
|
|
11
11
|
/** Why the file was refused (`DropOverlay`'s `refused[].refusal`), or your own sentence. */
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { ImageEditorMarkupTool, ImageEditorProps } from './types.js';
|
|
2
2
|
/** The marks an annotation widget needs: freehand, arrows, boxes, notes and redaction. */
|
|
3
3
|
export declare const EMBED_MARKUP_TOOLS: ImageEditorMarkupTool[];
|
|
4
|
-
export type ImageMarkupEditorProps = Omit<ImageEditorProps, 'tools' | 'defaultTool' | 'hideDownload'
|
|
4
|
+
export type ImageMarkupEditorProps = Omit<ImageEditorProps, 'tools' | 'defaultTool' | 'hideDownload'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Adds the Crop panel beside Markup (the capture preset). Default `false`:
|
|
7
|
+
* Markup only.
|
|
8
|
+
*/
|
|
9
|
+
crop?: boolean;
|
|
10
|
+
};
|
|
5
11
|
/**
|
|
6
12
|
* `ImageEditor` set up to annotate an image inside an embedded widget: only
|
|
7
|
-
* the Markup panel
|
|
13
|
+
* the Markup panel (plus Crop with `crop`), with `EMBED_MARKUP_TOOLS`
|
|
14
|
+
* (pen, highlighter, arrow, rectangle, text, numbered step marker and redact;
|
|
15
|
+
* `markupTools` overrides them), `toolbar="floating"` for the annotate-mode pill,
|
|
8
16
|
* no Download item, and the image decoded with `createImageBitmap` (`decode`
|
|
9
17
|
* overrides it), so a page whose CSP `img-src` is `'self'` can edit a `Blob`.
|
|
10
18
|
*/
|
|
11
|
-
export declare function ImageMarkupEditor({ markupTools, decode, ...props }: ImageMarkupEditorProps): import("react").JSX.Element;
|
|
19
|
+
export declare function ImageMarkupEditor({ markupTools, decode, crop, ...props }: ImageMarkupEditorProps): import("react").JSX.Element;
|
|
@@ -79,6 +79,13 @@ export type ImageEditorAnnotation = (AnnotationBase & {
|
|
|
79
79
|
* safe for text or faces.
|
|
80
80
|
*/
|
|
81
81
|
mode?: ImageEditorRedactMode;
|
|
82
|
+
}) | (AnnotationBase & {
|
|
83
|
+
kind: 'step';
|
|
84
|
+
/** The centre of the round pin. */
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
/** The number shown, from 1; removing a pin renumbers the next ones. */
|
|
88
|
+
n: number;
|
|
82
89
|
}) | (AnnotationBase & {
|
|
83
90
|
kind: 'text';
|
|
84
91
|
x: number;
|
|
@@ -2,7 +2,7 @@ import { ImageEditorEdits, ImageEditorRedactMode } from './types-edits.js';
|
|
|
2
2
|
/** The editor's panels, in the order the tool rail shows them. */
|
|
3
3
|
export type ImageEditorTool = 'adjust' | 'filters' | 'crop' | 'markup';
|
|
4
4
|
/** What a pointer does on the stage while the Markup panel is open. */
|
|
5
|
-
export type ImageEditorMarkupTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'line' | 'arrow' | 'rect' | 'ellipse' | 'text' | 'redact';
|
|
5
|
+
export type ImageEditorMarkupTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'line' | 'arrow' | 'rect' | 'ellipse' | 'text' | 'step' | 'redact';
|
|
6
6
|
export type ImageEditorExportFormat = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
7
7
|
export type ImageEditorExportOptions = {
|
|
8
8
|
format: ImageEditorExportFormat;
|
|
@@ -52,5 +52,13 @@ export type ImageEditorProps = {
|
|
|
52
52
|
saveLabel?: string;
|
|
53
53
|
/** Hides the Download button of the export menu. */
|
|
54
54
|
hideDownload?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Where the controls sit. `'panel'` (default) is the side panel and the
|
|
57
|
+
* tool rail. `'floating'` is the annotate mode: a pill of tools floating
|
|
58
|
+
* over the image (the active tool widens to show its name), a top bar
|
|
59
|
+
* with a text Cancel and a primary Done (`saveLabel`), and the Crop
|
|
60
|
+
* controls in a card over the pill. Adjust and Filters are not offered.
|
|
61
|
+
*/
|
|
62
|
+
toolbar?: 'panel' | 'floating';
|
|
55
63
|
className?: string;
|
|
56
64
|
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* `ChatMessageSeparator`, `ChatComposer`; the emoji picker and the mention list load lazily), the
|
|
11
11
|
* `I18nProvider` (the language of the `AttachmentList` labels), the
|
|
12
12
|
* `Tabs` (underline, pill, segmented), the single-choice `ChipGroupField` (filter chips with counts), `Badge`, `ListRow` (title, meta, badge, unread mark), the `EmptyState`, `Skeleton`, `SkeletonText` and `Spinner` states, the
|
|
13
|
+
* `NonceProvider` (the host's CSP nonce for the scroll area's `<style>`), the
|
|
13
14
|
* portal container provider and the theme provider.
|
|
14
15
|
*
|
|
15
16
|
* Every export is imported from its own file, never from a barrel, so the
|
|
@@ -37,6 +38,7 @@ export { TextareaFormField } from '../components/ui/fields/textarea-field/textar
|
|
|
37
38
|
export { type AttachmentItem, AttachmentList, type AttachmentListProps, } from '../components/ui/media/attachment-list/attachment-list.js';
|
|
38
39
|
export { Dialog, DialogAside, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '../components/ui/overlays/dialog/dialog.js';
|
|
39
40
|
export { Input, type InputProps } from '../components/ui/primitives/input/input.js';
|
|
41
|
+
export { NonceProvider, type NonceProviderProps, } from '../components/ui/primitives/nonce-provider/nonce-provider.js';
|
|
40
42
|
export { PortalContainerProvider, type PortalContainerProviderProps, } from '../components/ui/primitives/portal-container-provider/portal-container-provider.js';
|
|
41
43
|
export { Tabs, TabsContent, TabsList, type TabsListProps, TabsTrigger, type TabsVariant, } from '../components/ui/primitives/tabs/tabs-embed.js';
|
|
42
44
|
export { Textarea } from '../components/ui/primitives/textarea/textarea.js';
|
|
@@ -1347,6 +1347,8 @@ export declare const resources: {
|
|
|
1347
1347
|
compare: string;
|
|
1348
1348
|
reset: string;
|
|
1349
1349
|
save: string;
|
|
1350
|
+
done: string;
|
|
1351
|
+
"floating-tools": string;
|
|
1350
1352
|
"zoom-in": string;
|
|
1351
1353
|
"zoom-out": string;
|
|
1352
1354
|
"zoom-fit": string;
|
|
@@ -1427,6 +1429,7 @@ export declare const resources: {
|
|
|
1427
1429
|
highlighter: string;
|
|
1428
1430
|
eraser: string;
|
|
1429
1431
|
text: string;
|
|
1432
|
+
step: string;
|
|
1430
1433
|
line: string;
|
|
1431
1434
|
arrow: string;
|
|
1432
1435
|
rect: string;
|
|
@@ -1470,6 +1473,7 @@ export declare const resources: {
|
|
|
1470
1473
|
shift: string;
|
|
1471
1474
|
delete: string;
|
|
1472
1475
|
esc: string;
|
|
1476
|
+
enter: string;
|
|
1473
1477
|
};
|
|
1474
1478
|
undo: string;
|
|
1475
1479
|
redo: string;
|
|
@@ -1483,6 +1487,7 @@ export declare const resources: {
|
|
|
1483
1487
|
"mark-nudge": string;
|
|
1484
1488
|
"mark-move": string;
|
|
1485
1489
|
"mark-drop": string;
|
|
1490
|
+
"mark-step": string;
|
|
1486
1491
|
"crop-move": string;
|
|
1487
1492
|
"crop-resize": string;
|
|
1488
1493
|
};
|
|
@@ -4801,6 +4806,55 @@ export declare const resources: {
|
|
|
4801
4806
|
"throttled-minutes": string;
|
|
4802
4807
|
"throttled-end": string;
|
|
4803
4808
|
};
|
|
4809
|
+
capture: {
|
|
4810
|
+
toolbar: string;
|
|
4811
|
+
mode: string;
|
|
4812
|
+
"mode-visible": string;
|
|
4813
|
+
"mode-region": string;
|
|
4814
|
+
"mode-element": string;
|
|
4815
|
+
"mode-full-page": string;
|
|
4816
|
+
"mode-system": string;
|
|
4817
|
+
capture: string;
|
|
4818
|
+
cancel: string;
|
|
4819
|
+
timer: string;
|
|
4820
|
+
"timer-off": string;
|
|
4821
|
+
"timer-seconds": string;
|
|
4822
|
+
counting: string;
|
|
4823
|
+
picking: string;
|
|
4824
|
+
capturing: string;
|
|
4825
|
+
error: string;
|
|
4826
|
+
editor: string;
|
|
4827
|
+
"editor-loading": string;
|
|
4828
|
+
editing: string;
|
|
4829
|
+
done: string;
|
|
4830
|
+
outputs: string;
|
|
4831
|
+
preview: string;
|
|
4832
|
+
copy: string;
|
|
4833
|
+
"copied-short": string;
|
|
4834
|
+
copied: string;
|
|
4835
|
+
"copy-failed": string;
|
|
4836
|
+
download: string;
|
|
4837
|
+
"saved-short": string;
|
|
4838
|
+
downloaded: string;
|
|
4839
|
+
"download-failed": string;
|
|
4840
|
+
share: string;
|
|
4841
|
+
"shared-short": string;
|
|
4842
|
+
shared: string;
|
|
4843
|
+
"share-failed": string;
|
|
4844
|
+
upload: string;
|
|
4845
|
+
"uploaded-short": string;
|
|
4846
|
+
uploaded: string;
|
|
4847
|
+
"upload-failed": string;
|
|
4848
|
+
close: string;
|
|
4849
|
+
region: {
|
|
4850
|
+
label: string;
|
|
4851
|
+
hint: string;
|
|
4852
|
+
adjust: string;
|
|
4853
|
+
size: string;
|
|
4854
|
+
snap: string;
|
|
4855
|
+
coords: string;
|
|
4856
|
+
};
|
|
4857
|
+
};
|
|
4804
4858
|
};
|
|
4805
4859
|
};
|
|
4806
4860
|
fr: {
|
|
@@ -6145,6 +6199,8 @@ export declare const resources: {
|
|
|
6145
6199
|
compare: string;
|
|
6146
6200
|
reset: string;
|
|
6147
6201
|
save: string;
|
|
6202
|
+
done: string;
|
|
6203
|
+
"floating-tools": string;
|
|
6148
6204
|
"zoom-in": string;
|
|
6149
6205
|
"zoom-out": string;
|
|
6150
6206
|
"zoom-fit": string;
|
|
@@ -6225,6 +6281,7 @@ export declare const resources: {
|
|
|
6225
6281
|
highlighter: string;
|
|
6226
6282
|
eraser: string;
|
|
6227
6283
|
text: string;
|
|
6284
|
+
step: string;
|
|
6228
6285
|
line: string;
|
|
6229
6286
|
arrow: string;
|
|
6230
6287
|
rect: string;
|
|
@@ -6268,6 +6325,7 @@ export declare const resources: {
|
|
|
6268
6325
|
shift: string;
|
|
6269
6326
|
delete: string;
|
|
6270
6327
|
esc: string;
|
|
6328
|
+
enter: string;
|
|
6271
6329
|
};
|
|
6272
6330
|
undo: string;
|
|
6273
6331
|
redo: string;
|
|
@@ -6281,6 +6339,7 @@ export declare const resources: {
|
|
|
6281
6339
|
"mark-nudge": string;
|
|
6282
6340
|
"mark-move": string;
|
|
6283
6341
|
"mark-drop": string;
|
|
6342
|
+
"mark-step": string;
|
|
6284
6343
|
"crop-move": string;
|
|
6285
6344
|
"crop-resize": string;
|
|
6286
6345
|
};
|
|
@@ -9599,6 +9658,55 @@ export declare const resources: {
|
|
|
9599
9658
|
"throttled-minutes": string;
|
|
9600
9659
|
"throttled-end": string;
|
|
9601
9660
|
};
|
|
9661
|
+
capture: {
|
|
9662
|
+
toolbar: string;
|
|
9663
|
+
mode: string;
|
|
9664
|
+
"mode-visible": string;
|
|
9665
|
+
"mode-region": string;
|
|
9666
|
+
"mode-element": string;
|
|
9667
|
+
"mode-full-page": string;
|
|
9668
|
+
"mode-system": string;
|
|
9669
|
+
capture: string;
|
|
9670
|
+
cancel: string;
|
|
9671
|
+
timer: string;
|
|
9672
|
+
"timer-off": string;
|
|
9673
|
+
"timer-seconds": string;
|
|
9674
|
+
counting: string;
|
|
9675
|
+
picking: string;
|
|
9676
|
+
capturing: string;
|
|
9677
|
+
error: string;
|
|
9678
|
+
editor: string;
|
|
9679
|
+
"editor-loading": string;
|
|
9680
|
+
editing: string;
|
|
9681
|
+
done: string;
|
|
9682
|
+
outputs: string;
|
|
9683
|
+
preview: string;
|
|
9684
|
+
copy: string;
|
|
9685
|
+
"copied-short": string;
|
|
9686
|
+
copied: string;
|
|
9687
|
+
"copy-failed": string;
|
|
9688
|
+
download: string;
|
|
9689
|
+
"saved-short": string;
|
|
9690
|
+
downloaded: string;
|
|
9691
|
+
"download-failed": string;
|
|
9692
|
+
share: string;
|
|
9693
|
+
"shared-short": string;
|
|
9694
|
+
shared: string;
|
|
9695
|
+
"share-failed": string;
|
|
9696
|
+
upload: string;
|
|
9697
|
+
"uploaded-short": string;
|
|
9698
|
+
uploaded: string;
|
|
9699
|
+
"upload-failed": string;
|
|
9700
|
+
close: string;
|
|
9701
|
+
region: {
|
|
9702
|
+
label: string;
|
|
9703
|
+
hint: string;
|
|
9704
|
+
adjust: string;
|
|
9705
|
+
size: string;
|
|
9706
|
+
snap: string;
|
|
9707
|
+
coords: string;
|
|
9708
|
+
};
|
|
9709
|
+
};
|
|
9602
9710
|
};
|
|
9603
9711
|
};
|
|
9604
9712
|
};
|