@fto-consult/expo-ui 7.4.42 → 7.4.44

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.
Files changed (31) hide show
  1. package/electron/index.js +0 -7
  2. package/electron/pdf-viewer/viewer.css +14 -3718
  3. package/electron/pdf-viewer/wiewer.html +30 -0
  4. package/electron/preload.js +3 -4
  5. package/package.json +2 -1
  6. package/src/pdf/print.electron.js +11 -3
  7. package/src/pdf/print.web.js +3 -2
  8. package/electron/pdf-viewer/locale/en-CA/viewer.ftl +0 -311
  9. package/electron/pdf-viewer/locale/en-GB/viewer.ftl +0 -351
  10. package/electron/pdf-viewer/locale/en-US/viewer.ftl +0 -377
  11. package/electron/pdf-viewer/locale/fr/viewer.ftl +0 -347
  12. package/electron/pdf-viewer/locale/locale.json +0 -6
  13. package/electron/pdf-viewer/pdf.min.mjs +0 -21
  14. package/electron/pdf-viewer/viewer.html +0 -491
  15. package/electron/pdf-viewer/web/images/altText_add.svg +0 -3
  16. package/electron/pdf-viewer/web/images/altText_done.svg +0 -3
  17. package/electron/pdf-viewer/web/images/annotation-check.svg +0 -11
  18. package/electron/pdf-viewer/web/images/annotation-comment.svg +0 -16
  19. package/electron/pdf-viewer/web/images/annotation-help.svg +0 -26
  20. package/electron/pdf-viewer/web/images/annotation-insert.svg +0 -10
  21. package/electron/pdf-viewer/web/images/annotation-key.svg +0 -11
  22. package/electron/pdf-viewer/web/images/annotation-newparagraph.svg +0 -11
  23. package/electron/pdf-viewer/web/images/annotation-noicon.svg +0 -7
  24. package/electron/pdf-viewer/web/images/annotation-note.svg +0 -42
  25. package/electron/pdf-viewer/web/images/annotation-paperclip.svg +0 -6
  26. package/electron/pdf-viewer/web/images/annotation-paragraph.svg +0 -16
  27. package/electron/pdf-viewer/web/images/annotation-pushpin.svg +0 -7
  28. package/electron/pdf-viewer/web/images/editor-toolbar-delete.svg +0 -5
  29. package/electron/pdf-viewer/web/images/loading-icon.gif +0 -0
  30. package/electron/pdf-viewer/web/pdf_viewer.css +0 -2120
  31. package/electron/pdf-viewer/web/pdf_viewer.mjs +0 -8598
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html>
2
+ <html dir="ltr">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+
7
+ <title>PDF Viewer</title>
8
+
9
+ <link rel="stylesheet" type="text/css" href="./viewer.css">
10
+
11
+ <script src="../../node_modules/pdfobject/pdfobject.min.js"></script>
12
+ </head>
13
+
14
+ <body>
15
+ <div id="pdf-container"></div>
16
+ <script type="text/javascript">
17
+ const url = new URL(window.location.href);
18
+ const container = `#pdf-container`;
19
+ // Get a URLSearchParams object from the URL object
20
+ const params = Object.assign({},url.searchParams);
21
+ params.width = params.width ||"100%";
22
+ params.height = params.height || "100%";
23
+ if(params.file){
24
+ PDFObject.embed(params.file,container,params);
25
+ } else if(params.dataURL){
26
+ PDFObject.embed(params.dataURL,container,params);
27
+ }
28
+ </script>
29
+ </body>
30
+ </html>
@@ -108,7 +108,7 @@ const createPDFFile = (options)=>{
108
108
  return new Promise((resolve,reject)=>{
109
109
  const dir = getPath("temp");
110
110
  options = Object.assign({},options);
111
- let {content,filename,fileName,charset,success,fileExtension,extension,type} = options;
111
+ let {content,filename,fileName,charset,fileExtension,extension} = options;
112
112
  filename = defaultStr(filename,fileName)
113
113
  if(isDataURL(content)){
114
114
  content = isDataURL.toBase64(content);
@@ -380,13 +380,12 @@ const ELECTRON = {
380
380
  },
381
381
  get printPDF (){
382
382
  return (options)=>{
383
- const urlPath = path.resolve(__dirname,"pdf-viewer","viewer.html");
384
- console.log("will create window ",urlPath);
385
- return createWindow({file:urlPath,modal:true,showOnLoad:true});
386
383
  return createPDFFile(options).then(({path,filePathUrl})=>{
384
+ const urlPath = path.resolve(__dirname,"pdf-viewer","viewer.html");
387
385
  if(fs.existsSync(path)){
388
386
  opts.loadURL = `file://${urlPath}?file=${decodeURIComponent(filePathUrl)}&locale=fr`;
389
387
  opts.showOnLoad = true;
388
+ console.log("will print url ",options.loadURL,options);
390
389
  return this.createPDFWindow(opts)
391
390
  }
392
391
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.42",
3
+ "version": "7.4.44",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -105,6 +105,7 @@
105
105
  "node-machine-id": "^1.1.12",
106
106
  "npm": "^10.2.5",
107
107
  "pdfmake": "^0.2.8",
108
+ "pdfobject": "^2.2.12",
108
109
  "process": "^0.11.10",
109
110
  "prop-types": "^15.8.1",
110
111
  "react": "^18.2.0",
@@ -1,4 +1,12 @@
1
- export default function print(pdfMakeInstance,...rest){
2
- console.log("printint electron pdf make ",rest);
3
- return pdfMakeInstance.print(...rest);
1
+ import {isElectron} from "$cplatform";
2
+ export default function print(pdfMakeInstance,options){
3
+ if(isElectron() && window?.ELECTRON && typeof window?.ELECTRON?.printPDF =='function'){
4
+ return pdfMakeInstance.getBase64((content)=>{
5
+ ELECTRON.printPDF({
6
+ ...Object.assign({},options),
7
+ content,
8
+ })
9
+ })
10
+ }
11
+ return pdfMakeInstance.print();
4
12
  }
@@ -1,7 +1,8 @@
1
1
  import {isElectron} from "$cplatform";
2
+ import electronPrint from "./print.electron";
2
3
  export default function print(pdfMakeInstance,options,...rest){
3
- if(isElectron() && ELECTRON.printPDF){
4
- return ELECTRON.printPDF(options);
4
+ if(isElectron()){
5
+ return electronPrint(pdfMakeInstance,options,...rest);
5
6
  }
6
7
  return pdfMakeInstance.print(options,...rest);
7
8
  }
@@ -1,311 +0,0 @@
1
- # This Source Code Form is subject to the terms of the Mozilla Public
2
- # License, v. 2.0. If a copy of the MPL was not distributed with this
3
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
-
5
-
6
- ## Main toolbar buttons (tooltips and alt text for images)
7
-
8
- pdfjs-previous-button =
9
- .title = Previous Page
10
- pdfjs-previous-button-label = Previous
11
- pdfjs-next-button =
12
- .title = Next Page
13
- pdfjs-next-button-label = Next
14
- # .title: Tooltip for the pageNumber input.
15
- pdfjs-page-input =
16
- .title = Page
17
- # Variables:
18
- # $pagesCount (Number) - the total number of pages in the document
19
- # This string follows an input field with the number of the page currently displayed.
20
- pdfjs-of-pages = of { $pagesCount }
21
- # Variables:
22
- # $pageNumber (Number) - the currently visible page
23
- # $pagesCount (Number) - the total number of pages in the document
24
- pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })
25
- pdfjs-zoom-out-button =
26
- .title = Zoom Out
27
- pdfjs-zoom-out-button-label = Zoom Out
28
- pdfjs-zoom-in-button =
29
- .title = Zoom In
30
- pdfjs-zoom-in-button-label = Zoom In
31
- pdfjs-zoom-select =
32
- .title = Zoom
33
- pdfjs-presentation-mode-button =
34
- .title = Switch to Presentation Mode
35
- pdfjs-presentation-mode-button-label = Presentation Mode
36
- pdfjs-open-file-button =
37
- .title = Open File
38
- pdfjs-open-file-button-label = Open
39
- pdfjs-print-button =
40
- .title = Print
41
- pdfjs-print-button-label = Print
42
- pdfjs-save-button =
43
- .title = Save
44
- pdfjs-save-button-label = Save
45
- # Used in Firefox for Android as a tooltip for the download button (“download” is a verb).
46
- pdfjs-download-button =
47
- .title = Download
48
- # Used in Firefox for Android as a label for the download button (“download” is a verb).
49
- # Length of the translation matters since we are in a mobile context, with limited screen estate.
50
- pdfjs-download-button-label = Download
51
- pdfjs-bookmark-button =
52
- .title = Current Page (View URL from Current Page)
53
- pdfjs-bookmark-button-label = Current Page
54
- # Used in Firefox for Android.
55
- pdfjs-open-in-app-button =
56
- .title = Open in app
57
- # Used in Firefox for Android.
58
- # Length of the translation matters since we are in a mobile context, with limited screen estate.
59
- pdfjs-open-in-app-button-label = Open in app
60
-
61
- ## Secondary toolbar and context menu
62
-
63
- pdfjs-tools-button =
64
- .title = Tools
65
- pdfjs-tools-button-label = Tools
66
- pdfjs-first-page-button =
67
- .title = Go to First Page
68
- pdfjs-first-page-button-label = Go to First Page
69
- pdfjs-last-page-button =
70
- .title = Go to Last Page
71
- pdfjs-last-page-button-label = Go to Last Page
72
- pdfjs-page-rotate-cw-button =
73
- .title = Rotate Clockwise
74
- pdfjs-page-rotate-cw-button-label = Rotate Clockwise
75
- pdfjs-page-rotate-ccw-button =
76
- .title = Rotate Counterclockwise
77
- pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise
78
- pdfjs-cursor-text-select-tool-button =
79
- .title = Enable Text Selection Tool
80
- pdfjs-cursor-text-select-tool-button-label = Text Selection Tool
81
- pdfjs-cursor-hand-tool-button =
82
- .title = Enable Hand Tool
83
- pdfjs-cursor-hand-tool-button-label = Hand Tool
84
- pdfjs-scroll-page-button =
85
- .title = Use Page Scrolling
86
- pdfjs-scroll-page-button-label = Page Scrolling
87
- pdfjs-scroll-vertical-button =
88
- .title = Use Vertical Scrolling
89
- pdfjs-scroll-vertical-button-label = Vertical Scrolling
90
- pdfjs-scroll-horizontal-button =
91
- .title = Use Horizontal Scrolling
92
- pdfjs-scroll-horizontal-button-label = Horizontal Scrolling
93
- pdfjs-scroll-wrapped-button =
94
- .title = Use Wrapped Scrolling
95
- pdfjs-scroll-wrapped-button-label = Wrapped Scrolling
96
- pdfjs-spread-none-button =
97
- .title = Do not join page spreads
98
- pdfjs-spread-none-button-label = No Spreads
99
- pdfjs-spread-odd-button =
100
- .title = Join page spreads starting with odd-numbered pages
101
- pdfjs-spread-odd-button-label = Odd Spreads
102
- pdfjs-spread-even-button =
103
- .title = Join page spreads starting with even-numbered pages
104
- pdfjs-spread-even-button-label = Even Spreads
105
-
106
- ## Document properties dialog
107
-
108
- pdfjs-document-properties-button =
109
- .title = Document Properties…
110
- pdfjs-document-properties-button-label = Document Properties…
111
- pdfjs-document-properties-file-name = File name:
112
- pdfjs-document-properties-file-size = File size:
113
- # Variables:
114
- # $size_kb (Number) - the PDF file size in kilobytes
115
- # $size_b (Number) - the PDF file size in bytes
116
- pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } bytes)
117
- # Variables:
118
- # $size_mb (Number) - the PDF file size in megabytes
119
- # $size_b (Number) - the PDF file size in bytes
120
- pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)
121
- pdfjs-document-properties-title = Title:
122
- pdfjs-document-properties-author = Author:
123
- pdfjs-document-properties-subject = Subject:
124
- pdfjs-document-properties-keywords = Keywords:
125
- pdfjs-document-properties-creation-date = Creation Date:
126
- pdfjs-document-properties-modification-date = Modification Date:
127
- # Variables:
128
- # $date (Date) - the creation/modification date of the PDF file
129
- # $time (Time) - the creation/modification time of the PDF file
130
- pdfjs-document-properties-date-string = { $date }, { $time }
131
- pdfjs-document-properties-creator = Creator:
132
- pdfjs-document-properties-producer = PDF Producer:
133
- pdfjs-document-properties-version = PDF Version:
134
- pdfjs-document-properties-page-count = Page Count:
135
- pdfjs-document-properties-page-size = Page Size:
136
- pdfjs-document-properties-page-size-unit-inches = in
137
- pdfjs-document-properties-page-size-unit-millimeters = mm
138
- pdfjs-document-properties-page-size-orientation-portrait = portrait
139
- pdfjs-document-properties-page-size-orientation-landscape = landscape
140
- pdfjs-document-properties-page-size-name-a-three = A3
141
- pdfjs-document-properties-page-size-name-a-four = A4
142
- pdfjs-document-properties-page-size-name-letter = Letter
143
- pdfjs-document-properties-page-size-name-legal = Legal
144
-
145
- ## Variables:
146
- ## $width (Number) - the width of the (current) page
147
- ## $height (Number) - the height of the (current) page
148
- ## $unit (String) - the unit of measurement of the (current) page
149
- ## $name (String) - the name of the (current) page
150
- ## $orientation (String) - the orientation of the (current) page
151
-
152
- pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })
153
- pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })
154
-
155
- ##
156
-
157
- # The linearization status of the document; usually called "Fast Web View" in
158
- # English locales of Adobe software.
159
- pdfjs-document-properties-linearized = Fast Web View:
160
- pdfjs-document-properties-linearized-yes = Yes
161
- pdfjs-document-properties-linearized-no = No
162
- pdfjs-document-properties-close-button = Close
163
-
164
- ## Print
165
-
166
- pdfjs-print-progress-message = Preparing document for printing…
167
- # Variables:
168
- # $progress (Number) - percent value
169
- pdfjs-print-progress-percent = { $progress }%
170
- pdfjs-print-progress-close-button = Cancel
171
- pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.
172
- pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.
173
-
174
- ## Tooltips and alt text for side panel toolbar buttons
175
-
176
- pdfjs-toggle-sidebar-button =
177
- .title = Toggle Sidebar
178
- pdfjs-toggle-sidebar-notification-button =
179
- .title = Toggle Sidebar (document contains outline/attachments/layers)
180
- pdfjs-toggle-sidebar-button-label = Toggle Sidebar
181
- pdfjs-document-outline-button =
182
- .title = Show Document Outline (double-click to expand/collapse all items)
183
- pdfjs-document-outline-button-label = Document Outline
184
- pdfjs-attachments-button =
185
- .title = Show Attachments
186
- pdfjs-attachments-button-label = Attachments
187
- pdfjs-layers-button =
188
- .title = Show Layers (double-click to reset all layers to the default state)
189
- pdfjs-layers-button-label = Layers
190
- pdfjs-thumbs-button =
191
- .title = Show Thumbnails
192
- pdfjs-thumbs-button-label = Thumbnails
193
- pdfjs-current-outline-item-button =
194
- .title = Find Current Outline Item
195
- pdfjs-current-outline-item-button-label = Current Outline Item
196
- pdfjs-findbar-button =
197
- .title = Find in Document
198
- pdfjs-findbar-button-label = Find
199
- pdfjs-additional-layers = Additional Layers
200
-
201
- ## Thumbnails panel item (tooltip and alt text for images)
202
-
203
- # Variables:
204
- # $page (Number) - the page number
205
- pdfjs-thumb-page-title =
206
- .title = Page { $page }
207
- # Variables:
208
- # $page (Number) - the page number
209
- pdfjs-thumb-page-canvas =
210
- .aria-label = Thumbnail of Page { $page }
211
-
212
- ## Find panel button title and messages
213
-
214
- pdfjs-find-input =
215
- .title = Find
216
- .placeholder = Find in document…
217
- pdfjs-find-previous-button =
218
- .title = Find the previous occurrence of the phrase
219
- pdfjs-find-previous-button-label = Previous
220
- pdfjs-find-next-button =
221
- .title = Find the next occurrence of the phrase
222
- pdfjs-find-next-button-label = Next
223
- pdfjs-find-highlight-checkbox = Highlight All
224
- pdfjs-find-match-case-checkbox-label = Match Case
225
- pdfjs-find-match-diacritics-checkbox-label = Match Diacritics
226
- pdfjs-find-entire-word-checkbox-label = Whole Words
227
- pdfjs-find-reached-top = Reached top of document, continued from bottom
228
- pdfjs-find-reached-bottom = Reached end of document, continued from top
229
- pdfjs-find-not-found = Phrase not found
230
-
231
- ## Predefined zoom values
232
-
233
- pdfjs-page-scale-width = Page Width
234
- pdfjs-page-scale-fit = Page Fit
235
- pdfjs-page-scale-auto = Automatic Zoom
236
- pdfjs-page-scale-actual = Actual Size
237
- # Variables:
238
- # $scale (Number) - percent value for page scale
239
- pdfjs-page-scale-percent = { $scale }%
240
-
241
- ## PDF page
242
-
243
- # Variables:
244
- # $page (Number) - the page number
245
- pdfjs-page-landmark =
246
- .aria-label = Page { $page }
247
-
248
- ## Loading indicator messages
249
-
250
- pdfjs-loading-error = An error occurred while loading the PDF.
251
- pdfjs-invalid-file-error = Invalid or corrupted PDF file.
252
- pdfjs-missing-file-error = Missing PDF file.
253
- pdfjs-unexpected-response-error = Unexpected server response.
254
- pdfjs-rendering-error = An error occurred while rendering the page.
255
-
256
- ## Annotations
257
-
258
- # Variables:
259
- # $date (Date) - the modification date of the annotation
260
- # $time (Time) - the modification time of the annotation
261
- pdfjs-annotation-date-string = { $date }, { $time }
262
- # .alt: This is used as a tooltip.
263
- # Variables:
264
- # $type (String) - an annotation type from a list defined in the PDF spec
265
- # (32000-1:2008 Table 169 – Annotation types).
266
- # Some common types are e.g.: "Check", "Text", "Comment", "Note"
267
- pdfjs-text-annotation-type =
268
- .alt = [{ $type } Annotation]
269
-
270
- ## Password
271
-
272
- pdfjs-password-label = Enter the password to open this PDF file.
273
- pdfjs-password-invalid = Invalid password. Please try again.
274
- pdfjs-password-ok-button = OK
275
- pdfjs-password-cancel-button = Cancel
276
- pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.
277
-
278
- ## Editing
279
-
280
- pdfjs-editor-free-text-button =
281
- .title = Text
282
- pdfjs-editor-free-text-button-label = Text
283
- pdfjs-editor-ink-button =
284
- .title = Draw
285
- pdfjs-editor-ink-button-label = Draw
286
- pdfjs-editor-stamp-button =
287
- .title = Add or edit images
288
- pdfjs-editor-stamp-button-label = Add or edit images
289
- # Editor Parameters
290
- pdfjs-editor-free-text-color-input = Colour
291
- pdfjs-editor-free-text-size-input = Size
292
- pdfjs-editor-ink-color-input = Colour
293
- pdfjs-editor-ink-thickness-input = Thickness
294
- pdfjs-editor-ink-opacity-input = Opacity
295
- pdfjs-editor-stamp-add-image-button =
296
- .title = Add image
297
- pdfjs-editor-stamp-add-image-button-label = Add image
298
- pdfjs-free-text =
299
- .aria-label = Text Editor
300
- pdfjs-free-text-default-content = Start typing…
301
- pdfjs-ink =
302
- .aria-label = Draw Editor
303
- pdfjs-ink-canvas =
304
- .aria-label = User-created image
305
-
306
- ## Alt-text dialog
307
-
308
-
309
- ## Editor resizers
310
- ## This is used in an aria label to help to understand the role of the resizer.
311
-