Calixte Denizet
95f9bedc7c
[Editor] Disable annotation layer when highlighting (bug 1868759)
...
When highlighting, the annotation editor layer is disabled to get pointer events
from the text layer, but the annotation layer must be then disabled either in
order to avoid bad interactions.
2024-02-20 21:17:05 +01:00
Calixte Denizet
c2fcc66302
[Editor] Avoid to scroll when an editor is unselected
2024-02-18 19:21:45 +01:00
calixteman
05b035602e
Merge pull request #17664 from calixteman/bug1879281
...
[Editor] Ends a free highlight where the mouse pointer is (bug 1879281)
2024-02-12 18:39:18 +01:00
Calixte Denizet
750b8e328a
[Editor] Ends a free highlight where the mouse pointer is (bug 1879281)
2024-02-12 17:26:33 +01:00
Calixte Denizet
de1985abbb
[Editor] Set rotated free highlight at the right position after having changed its thickness (bug 1879108)
2024-02-11 21:06:56 +01:00
calixteman
f15b4b34fd
Merge pull request #17650 from calixteman/editor_highlight_keyboard
...
[Editor] Add a way to highlight text in using the keyboard (bug 1877426)
2024-02-11 18:52:37 +01:00
Calixte Denizet
b5e446213e
[Editor] Disable the thickness slider for non-free highlight
2024-02-09 22:54:53 +01:00
Calixte Denizet
8fc6c5c8a6
[Editor] Add a way to highlight text in using the keyboard (bug 1877426)
2024-02-09 22:52:24 +01:00
Calixte Denizet
8d61fc1fde
[Editor] Compute the position of the last point before applying rotation (bug 1879113)
2024-02-08 21:08:24 +01:00
Calixte Denizet
7529c1e3dc
[Editor] Fix the position of the free highlight toolbar
2024-01-30 15:40:33 +01:00
Calixte Denizet
f3bdbedf9b
[Editor] Change the cursors for highlighting (bug 1876588)
2024-01-26 18:17:05 +01:00
Calixte Denizet
2b8ecf5688
[Editor] Add the possibility to change the thickness of a free highlight (bug 1876096)
2024-01-24 22:04:39 +01:00
Calixte Denizet
d713df28c3
[Editor] Update the parameters in the UI of the last selected editor when undoing/redoing
2024-01-24 18:16:51 +01:00
Jonas Jenwald
f9a384d711
Enable the arrow-body-style ESLint rule
...
This manually ignores some cases where the resulting auto-formatting would not, as far as I'm concerned, constitute a readability improvement or where we'd just end up with more overall indentation.
Please see https://eslint.org/docs/latest/rules/arrow-body-style
2024-01-21 16:20:55 +01:00
Calixte Denizet
0cca9a0240
[Editor] Don't add the keyboard listener on the color-picker each time the dropdown menu is shown
...
and display/hide the dropdown menu when pressing arrow keys.
2024-01-20 21:57:54 +01:00
Calixte Denizet
f3b76f5ae2
[Editor] Unselect highlights when the user click on the text layer (bug 1869767)
2024-01-19 20:16:55 +01:00
calixteman
f6c4b29aa2
Merge pull request #17531 from calixteman/editor_free_highlight_print_save
...
[Editor] Add support for printing/saving free highlight annotations
2024-01-19 15:23:29 +01:00
Calixte Denizet
a1bf12537c
[Editor] Change the arrow direction when the dropdown is visible in the color picker (bug 1875357)
...
and hide the dropdown when the user click outside of the color picker.
2024-01-19 13:02:11 +01:00
Calixte Denizet
d64f334f98
[Editor] Add support for printing/saving free highlight annotations
2024-01-19 12:58:46 +01:00
Calixte Denizet
8fbfef0c07
[Editor] Add the ability to make a free highlight (i.e. without having to select some text) (bug 1856218)
...
The free highlighting is enabled when the mouse pointer isn't on some text.
Then we draw a shape with smoothed borders corresponding to the movement of
the mouse.
Printing/saving and changing the thickness will come later.
2024-01-18 16:26:04 +01:00
Calixte Denizet
70a9d8f3bc
[Editor] Avoid to move a non-draggable editor with the keyboard
2024-01-16 21:41:52 +01:00
Calixte Denizet
a76cc40ab8
[Editor] Avoid an exception when pressing space key to change the color of an highlight
2024-01-16 20:00:23 +01:00
calixteman
51413be5b6
Merge pull request #17519 from calixteman/editor_movable_touchscreen
...
[Editor] Make editors draggable with touchscreens
2024-01-16 10:47:38 +01:00
Calixte Denizet
b8aab5d14e
[Editor] Make editors draggable with touchscreens
2024-01-15 23:20:55 +01:00
Calixte Denizet
ee72b32dc2
[Editor] Slightly simplify the serialization of an highlight annotation
...
We were computing width and height of the annotation before serializing
which is useless because the rect already contains this information.
2024-01-15 18:22:01 +01:00
Calixte Denizet
e9946fa22a
[Editor] Draw a line instead of a Bezier curve when an Ink has only one point
...
Fixes #17418 .
2024-01-15 13:32:36 +01:00
Calixte Denizet
9765d57a26
[Editor] Extract all the lines when adding a FreeText annotation
...
Fixes #17079 .
2024-01-14 21:11:51 +01:00
Calixte Denizet
fc7c320bd8
[Editor] Correctly serialize highlight data (regression from #17499 )
2024-01-12 15:37:01 +01:00
Calixte Denizet
94ad3afab6
[Editor] Move the code to generate the SVG path from draw_layer.js to outliner.js
...
It'll be useful to avoid too much duplicated code when adding the free highlighting tool.
2024-01-11 19:10:33 +01:00
Calixte Denizet
b4a7007397
[Editor] Don't throw when changing the color of an invisible highlight
2024-01-11 17:48:06 +01:00
Calixte Denizet
17e1519410
[Editor] Init the default highlight color before creating the first editor instance
...
We want to be able to draw an highlight with the default color but without having an
instance of the HighlightEditor.
2024-01-05 17:52:54 +01:00
Calixte Denizet
7839e7b495
Preserve the whitespaces when getting text from FreeText annotations (bug 1871353)
...
When the text of an annotation is extracted in using getTextContent, consecutive white spaces
are just replaced by one space and. So this patch add an option to make sure that white
spaces are preserved when appearance is parsed.
For the case where there's no appearance, we can have a fast path to get the correct string
from the Content entry.
When an existing FreeText is edited, space (0x20) are replaced by non-breakable (0xa0) ones
to make to see all of them on screen.
2024-01-05 10:20:32 +01:00
Calixte Denizet
35863cd54b
[Editor] Take into account the crop box when saving/printing some highlighted text (bug 1872721)
2024-01-02 18:53:33 +01:00
Varun Patil
4d34107228
Prevent error in AnnotationEditorUIManager.destroy if altTextManager is null
2023-12-20 23:18:34 +05:30
calixteman
8702e1bbb2
Merge pull request #17359 from calixteman/editor_highlight_color_picker
...
[Editor] Add a color picker with predefined colors for highlighting text (bug 1866434)
2023-12-06 11:06:55 +01:00
Calixte Denizet
ff23d37fa2
[Editor] Add a color picker with predefined colors for highlighting text (bug 1866434)
...
The doorhanger for highlighting has a basic color picker composed of 5 predefined colors
to set the default color to use.
These colors can be changed thanks to a preference for now but it's something which could
be changed in the Firefox settings in the future.
Each highlight has in its own toolbar a color picker to just change its color.
The different color pickers are so similar (modulo few differences in their styles) that
this patch introduces a new class ColorPicker which provides a color picker component
which could be reused in future editors.
All in all, a large part of this patch is dedicated to color picker itself and its style
and the rest is almost a matter of wiring the component.
2023-12-05 23:27:22 +01:00
Calixte Denizet
621b7af60d
[Editor] Highlight must keep selected after the document has been scrolled
2023-12-05 23:22:35 +01:00
Calixte Denizet
11610a9e66
[Editor] Always give the focus to the ink editor when starting drawing (bug 1867588)
...
This way, when the editor is blurred, it can be committed and everything works fine.
It fixes issue #17373 .
2023-12-05 10:26:59 +01:00
Calixte Denizet
43eea0b38e
[Editor] Make sure that all layers are disabled when an editing session is done
...
Fixes issue #17368 .
2023-12-04 13:27:39 +01:00
Calixte Denizet
83d0b6cb55
[Editor] Disable mouse events when leaving the highlight mode
2023-12-01 17:10:19 +01:00
Calixte Denizet
05ca005eeb
[Editor] Fix subtype for telemetry data (follow-up of #17329 )
...
Fix a test failure in m-c.
2023-11-29 11:09:22 +01:00
Calixte Denizet
59112a7730
[Editor] Move the alt text button in the editor toolbar
2023-11-28 15:36:29 +01:00
Calixte Denizet
1ea6293923
[Editor] Add a new editor to highlight some text in a pdf (bug 1866119)
...
This patch is first big step for the new highlight feature.
Few patches will follow in order to conform to the specs UX/UI gave us.
2023-11-28 14:21:53 +01:00
Calixte Denizet
2be136ab70
[Editor] Avoid to add a new ink editor when we aren't editing anymore
2023-11-27 16:18:31 +01:00
Jonas Jenwald
3d9f68cb97
Merge pull request #17328 from Snuffleupagus/fetchData-blob
...
Use the `fetchData` helper function in more cases
2023-11-25 08:31:12 +01:00
Calixte Denizet
42147e8839
[Editor] Only focus the canvas for mouse events when drawing in the canvas
...
And if we've to focus it, we must prevent scrolling to avoid to draw at an
unexpected position.
2023-11-24 16:00:04 +01:00
Jonas Jenwald
fd7a7e2859
Use the fetchData helper function in more cases
...
- Extend the `fetchData` helper function to also support fetching of "blob" data.
- Use the `fetchData` helper function more in the code-base, when fetching non-PDF data. Given that the Fetch API isn't supported for all protocols, this should improve compatibility for the PDF.js library.
2023-11-24 13:05:57 +01:00
Calixte Denizet
31d9b9f574
[Editor] Add a way to extract the outlines of a union of rectangles
...
The goal is to be able to get these outlines to fill the shape corresponding
to a text selection in order to highlight some text contents.
The outlines will be used either to show selected/hovered highlights.
2023-11-20 18:45:19 +01:00
Calixte Denizet
b7d28a3bf6
[Editor] Add a tooltip to the delete button
2023-11-15 10:51:39 +01:00
Calixte Denizet
334f0eb060
[Editor] Add a toolbar to selected editors with a button to delete it (bug 1863763)
2023-11-10 15:19:43 +01:00