hazo_pdf 1.6.4 → 1.6.6

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.
@@ -32,7 +32,7 @@
32
32
  # Accepts hex format: #RRGGBB (e.g., "#000000" for black) or rgb(r, g, b) format
33
33
  # This is used as the default text color and can be overridden by annotation-specific colors
34
34
  # Default: "#000000" (black)
35
- font_foreground_color = rgb(11, 120, 237)
35
+ # font_foreground_color = #000000
36
36
 
37
37
  # =============================================================================
38
38
  # [highlight_annotation] - Styling for highlight annotations
@@ -123,13 +123,13 @@ font_foreground_color = rgb(11, 120, 237)
123
123
  # Leave empty string ("") for transparent background
124
124
  # Default: "#E6F3FF" (light blue)
125
125
  # Supports both hex (#RRGGBB) and rgb(r, g, b) formats
126
- freetext_background_color = rgb(15, 219, 80)
126
+ # freetext_background_color = #E6F3FF
127
127
 
128
128
  # Background opacity for FreeText annotation box (0.0 to 1.0)
129
129
  # Only used if background_color is set (not empty)
130
130
  # 0.0 = fully transparent, 1.0 = fully opaque
131
131
  # Default: 0.1 (10% opacity)
132
- freetext_background_opacity = 1
132
+ # freetext_background_opacity = 0.1
133
133
 
134
134
  # Font weight for FreeText annotations
135
135
  # CSS font-weight values: "normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"
@@ -189,39 +189,32 @@ freetext_background_opacity = 1
189
189
  # Append timestamp to annotated text edits (true/false, yes/no, 1/0)
190
190
  # When enabled, appends a newline followed by a timestamp in format [YYYY-MM-DD h:mmam/pm]
191
191
  # to any annotated text that is added or edited.
192
- # Example: If text "This is an update." is added, the annotation will contain:
193
- # "This is an update.
194
- # [2025-11-17 2:24pm]"
195
192
  # Default: false
196
- append_timestamp_to_text_edits = true
193
+ # append_timestamp_to_text_edits = false
197
194
 
198
195
  # Fixed text to add in square brackets before timestamp (string)
199
196
  # If provided and timestamp is enabled, the fixed text will be added in square brackets
200
197
  # before the timestamp on a new line.
201
- # Example: If annotation_text_suffix_fixed_text = "Fixed text" and text "This is an update." is added:
202
- # "This is an update.
203
- # [Fixed text] [2025-11-17 2:24pm]"
204
- # If not provided or empty, only the timestamp will be appended.
205
198
  # Default: empty (no fixed text)
206
- annotation_text_suffix_fixed_text = user_x
199
+ # annotation_text_suffix_fixed_text =
207
200
 
208
201
  # Whether to add enclosing brackets around suffix text
209
202
  # true - suffixes appear like [Fixed] [timestamp]
210
203
  # false - suffixes appear without brackets
211
204
  # Default: true
212
- add_enclosing_brackets_to_suffixes = true
205
+ # add_enclosing_brackets_to_suffixes = true
213
206
 
214
207
  # Pair of characters used to enclose suffix text.
215
208
  # Must be exactly two characters (e.g., "[]", "{}", "()", "<>").
216
209
  # Default: "[]"
217
- suffix_enclosing_brackets = []
210
+ # suffix_enclosing_brackets = []
218
211
 
219
212
  # Placement of suffix text relative to the annotation text
220
- # adjacent -> suffix appended on same line, e.g., Text [Fixed] [timestamp]
221
- # below_single_line -> suffix shown on one new line, e.g., Text\n[Fixed] [timestamp]
222
- # below_multi_line -> suffix shown on separate lines, e.g., Text\n[Fixed]\n[timestamp]
213
+ # adjacent -> suffix appended on same line
214
+ # below_single_line -> suffix shown on one new line
215
+ # below_multi_line -> suffix shown on separate lines
223
216
  # Default: below_multi_line
224
- suffix_text_position = below_multi_line
217
+ # suffix_text_position = below_multi_line
225
218
 
226
219
  # =============================================================================
227
220
  # [context_menu] - Styling for right-click context menu
@@ -229,47 +222,27 @@ suffix_text_position = below_multi_line
229
222
  [context_menu]
230
223
 
231
224
  # Background color for context menu (hex format: #RRGGBB)
232
- # Background color of the context menu popup
233
225
  # Default: "#ffffff" (white)
234
226
  # context_menu_background_color = #ffffff
235
227
 
236
228
  # Border color for context menu (hex format: #RRGGBB)
237
- # Border color around the context menu
238
229
  # Default: "#d1d5db" (light grey)
239
230
  # context_menu_border_color = #d1d5db
240
231
 
241
232
  # Background color for context menu item on hover (hex format: #RRGGBB)
242
- # Background color when mouse hovers over a menu item
243
233
  # Default: "#f3f4f6" (very light grey)
244
234
  # context_menu_item_hover_background = #f3f4f6
245
235
 
246
236
  # Opacity for disabled context menu items (0.0 to 1.0)
247
- # Transparency level for disabled menu items (e.g., Undo when no history)
248
237
  # Default: 0.5
249
238
  # context_menu_item_disabled_opacity = 0.5
250
239
 
251
240
  # Custom stamps for right-click menu (JSON array string)
252
- # Each stamp is a JSON object with the following properties:
253
- # - name: string (name of the menu item, required)
254
- # - text: string (text content to add to PDF, required)
255
- # - order: number (position in menu, lower numbers appear first, required)
256
- # - time_stamp_suffix_enabled: boolean (default false) - append timestamp suffix if enabled
257
- # - fixed_text_suffix_enabled: boolean (default false) - append fixed text suffix if enabled
258
- # Optional styling fields:
259
- # - background_color: string (hex format: #RRGGBB or rgb(r, g, b), empty string for transparent, default: uses config)
260
- # - border_size: number (border width in pixels, 0 means no border, default: uses config)
261
- # - font_color: string (hex format: #RRGGBB or rgb(r, g, b), default: uses config)
262
- # - font_weight: string (normal, bold, etc., default: uses config)
263
- # - font_style: string (normal, italic, etc., default: uses config)
264
- # - font_size: number (font size in pixels, default: uses config)
265
- # - font_name: string (font family, e.g., "Arial, sans-serif", default: uses config)
266
- # Stamps appear at the bottom of the context menu, separated by a line, sorted by order.
267
- # Example:
268
- # [{"name":"Verified","text":"XX","order":1,"time_stamp_suffix_enabled":true,"fixed_text_suffix_enabled":true,"background_color":"rgb(15,219,80)","border_size":2,"font_color":"#000000","font_weight":"bold","font_size":16}]
269
- # When clicked, adds the text to the PDF at the right-click position with optional timestamp and fixed text suffixes,
270
- # and applies stamp-specific styling if provided, otherwise uses config defaults.
241
+ # Each stamp is a JSON object with: name, text, order (required)
242
+ # Optional: time_stamp_suffix_enabled, fixed_text_suffix_enabled,
243
+ # background_color, border_size, font_color, font_weight, font_style, font_size, font_name
271
244
  # Default: empty (no custom stamps)
272
- right_click_custom_stamps = [{"name":"Verified","text":"✅","order":1,"time_stamp_suffix_enabled":true,"fixed_text_suffix_enabled":true, "background_color":"rgb(255, 255, 255)","border_size":0,"font_color":"#000000","font_weight":"bold","font_size":16}]
245
+ # right_click_custom_stamps = [{"name":"Verified","text":"✅","order":1}]
273
246
 
274
247
  # =============================================================================
275
248
  # [dialog] - Styling for text annotation dialog
@@ -277,43 +250,34 @@ right_click_custom_stamps = [{"name":"Verified","text":"✅","order":1,"time_sta
277
250
  [dialog]
278
251
 
279
252
  # Opacity for dialog backdrop (0.0 to 1.0)
280
- # Transparency of the dark overlay behind the dialog
281
- # 0.0 = transparent, 1.0 = fully opaque
282
253
  # Default: 0.2
283
254
  # dialog_backdrop_opacity = 0.2
284
255
 
285
256
  # Background color for dialog (hex format: #RRGGBB)
286
- # Background color of the text annotation dialog box
287
257
  # Default: "#ffffff" (white)
288
258
  # dialog_background_color = #ffffff
289
259
 
290
260
  # Border color for dialog (hex format: #RRGGBB)
291
- # Border color around the dialog box
292
261
  # Default: "#d1d5db" (light grey)
293
262
  # dialog_border_color = #d1d5db
294
263
 
295
264
  # Submit button color (hex format: #RRGGBB)
296
- # Color of the submit/OK button (checkmark icon)
297
265
  # Default: "#16a34a" (green)
298
266
  # dialog_button_submit_color = #16a34a
299
267
 
300
268
  # Submit button color on hover (hex format: #RRGGBB)
301
- # Color when mouse hovers over submit button
302
269
  # Default: "#15803d" (darker green)
303
270
  # dialog_button_submit_color_hover = #15803d
304
271
 
305
272
  # Cancel button color (hex format: #RRGGBB)
306
- # Color of the cancel button (X icon)
307
273
  # Default: "#6b7280" (grey)
308
274
  # dialog_button_cancel_color = #6b7280
309
275
 
310
276
  # Cancel button color on hover (hex format: #RRGGBB)
311
- # Color when mouse hovers over cancel button
312
277
  # Default: "#4b5563" (darker grey)
313
278
  # dialog_button_cancel_color_hover = #4b5563
314
279
 
315
280
  # Opacity for disabled dialog buttons (0.0 to 1.0)
316
- # Transparency level for disabled buttons (e.g., submit when text is empty)
317
281
  # Default: 0.4
318
282
  # dialog_button_disabled_opacity = 0.4
319
283
 
@@ -323,220 +287,138 @@ right_click_custom_stamps = [{"name":"Verified","text":"✅","order":1,"time_sta
323
287
  [toolbar]
324
288
 
325
289
  # Background color for toolbar (hex format: #RRGGBB or rgb(r, g, b))
326
- # Color of the toolbar background area
327
290
  # Default: "#f9fafb" (very light grey)
328
291
  # toolbar_background_color = #f9fafb
329
292
 
330
293
  # Border color for toolbar (hex format: #RRGGBB or rgb(r, g, b))
331
- # Color of the border at the bottom of the toolbar
332
294
  # Default: "#e5e7eb" (light grey)
333
295
  # toolbar_border_color = #e5e7eb
334
296
 
335
297
  # Font family for toolbar text
336
- # CSS font-family value (e.g., "Arial, sans-serif", "Times New Roman")
337
298
  # Default: "system-ui, -apple-system, sans-serif"
338
299
  # toolbar_font_family = system-ui, -apple-system, sans-serif
339
300
 
340
301
  # Font size for toolbar text (pixels)
341
- # Size of all text in the toolbar
342
302
  # Default: 14
343
303
  # toolbar_font_size = 14
344
304
 
345
305
  # Font color for toolbar text (hex format: #RRGGBB or rgb(r, g, b))
346
- # Color of text displayed in the toolbar
347
306
  # Default: "#111827" (dark grey)
348
307
  # toolbar_font_color = #111827
349
308
 
350
309
  # Button background color (hex format: #RRGGBB or rgb(r, g, b))
351
- # Background color for regular toolbar buttons
352
310
  # Default: "#ffffff" (white)
353
311
  # toolbar_button_background_color = #ffffff
354
312
 
355
313
  # Button background color on hover (hex format: #RRGGBB or rgb(r, g, b))
356
- # Background color when mouse hovers over a button
357
314
  # Default: "#f3f4f6" (light grey)
358
315
  # toolbar_button_background_color_hover = #f3f4f6
359
316
 
360
317
  # Button text color (hex format: #RRGGBB or rgb(r, g, b))
361
- # Color of text in toolbar buttons
362
318
  # Default: "#374151" (medium grey)
363
319
  # toolbar_button_text_color = #374151
364
320
 
365
321
  # Active button background color (hex format: #RRGGBB or rgb(r, g, b))
366
- # Background color for active/selected buttons (e.g., Square tool when active)
367
322
  # Default: "#3b82f6" (blue)
368
323
  # toolbar_button_active_background_color = #3b82f6
369
324
 
370
325
  # Active button text color (hex format: #RRGGBB or rgb(r, g, b))
371
- # Text color for active/selected buttons
372
326
  # Default: "#ffffff" (white)
373
327
  # toolbar_button_active_text_color = #ffffff
374
328
 
375
329
  # Save button background color (hex format: #RRGGBB or rgb(r, g, b))
376
- # Background color for the Save button
377
330
  # Default: "#10b981" (green)
378
331
  # toolbar_button_save_background_color = #10b981
379
332
 
380
333
  # Save button background color on hover (hex format: #RRGGBB or rgb(r, g, b))
381
- # Background color when mouse hovers over Save button
382
334
  # Default: "#059669" (darker green)
383
335
  # toolbar_button_save_background_color_hover = #059669
384
336
 
385
337
  # Save button text color (hex format: #RRGGBB or rgb(r, g, b))
386
- # Text color for the Save button
387
338
  # Default: "#ffffff" (white)
388
339
  # toolbar_button_save_text_color = #ffffff
389
340
 
390
341
  # Disabled button opacity (0.0 to 1.0)
391
- # Transparency level for disabled buttons (e.g., Undo when no history)
392
- # 0.0 = fully transparent, 1.0 = fully opaque
393
342
  # Default: 0.5
394
343
  # toolbar_button_disabled_opacity = 0.5
395
344
 
396
- # Show zoom controls (true/false, yes/no, 1/0)
397
- # Whether to display zoom in, zoom out, and reset zoom buttons
345
+ # Show zoom controls (true/false)
398
346
  # Default: true
399
347
  # toolbar_show_zoom_controls = true
400
348
 
401
- # Show square annotation button (true/false, yes/no, 1/0)
402
- # Whether to display the Square annotation tool button
349
+ # Show square annotation button (true/false)
403
350
  # Default: true
404
351
  # toolbar_show_square_button = true
405
352
 
406
- # Show undo button (true/false, yes/no, 1/0)
407
- # Whether to display the Undo button
353
+ # Show undo button (true/false)
408
354
  # Default: true
409
355
  # toolbar_show_undo_button = true
410
356
 
411
- # Show redo button (true/false, yes/no, 1/0)
412
- # Whether to display the Redo button
357
+ # Show redo button (true/false)
413
358
  # Default: true
414
359
  # toolbar_show_redo_button = true
415
360
 
416
- # Show save button (true/false, yes/no, 1/0)
417
- # Whether to display the Save button
361
+ # Show save button (true/false)
418
362
  # Default: true
419
363
  # toolbar_show_save_button = true
420
364
 
421
- # Show metadata panel button (true/false, yes/no, 1/0)
422
- # Whether to display the Metadata panel toggle button (only shown when sidepanel is enabled)
365
+ # Show metadata panel button (true/false)
423
366
  # Default: true
424
367
  # toolbar_show_metadata_button = true
425
368
 
426
- # Show file info button (true/false, yes/no, 1/0)
427
- # Whether to display the File Info panel toggle button
428
- # Requires hazo_files package to be installed
369
+ # Show file info button (true/false)
429
370
  # Default: true
430
371
  # toolbar_show_file_info_button = true
431
372
 
432
- # Show extract data button (true/false, yes/no, 1/0)
433
- # Whether to display the Extract button (Sparkles icon)
434
- # Requires hazo_llm_api and extract_api_endpoint prop
373
+ # Show extract data button (true/false)
435
374
  # Default: true
436
375
  # toolbar_show_extract_button = true
437
376
 
438
- # Label for zoom out button
439
- # Text displayed on the zoom out button
440
- # Default: "−" (minus sign)
377
+ # Button labels (uncomment to customize)
441
378
  # toolbar_zoom_out_label = −
442
-
443
- # Label for zoom in button
444
- # Text displayed on the zoom in button
445
- # Default: "+" (plus sign)
446
379
  # toolbar_zoom_in_label = +
447
-
448
- # Label for reset zoom button
449
- # Text displayed on the reset zoom button
450
- # Default: "Reset"
451
380
  # toolbar_zoom_reset_label = Reset
452
-
453
- # Label for square annotation button
454
- # Text displayed on the square annotation tool button
455
- # Default: "Square"
456
381
  # toolbar_square_label = Square
457
-
458
- # Label for undo button
459
- # Text displayed on the undo button
460
- # Default: "Undo"
461
382
  # toolbar_undo_label = Undo
462
-
463
- # Label for redo button
464
- # Text displayed on the redo button
465
- # Default: "Redo"
466
383
  # toolbar_redo_label = Redo
467
-
468
- # Label for save button
469
- # Text displayed on the save button when not saving
470
- # Default: "Save"
471
384
  # toolbar_save_label = Save
472
-
473
- # Label for saving button
474
- # Text displayed on the save button while saving is in progress
475
- # Default: "Saving..."
476
385
  # toolbar_saving_label = Saving...
477
-
478
- # Label for metadata panel button
479
- # Text displayed on the metadata panel toggle button (only shown when sidepanel is enabled)
480
- # Default: "Metadata"
481
386
  # toolbar_metadata_label = Metadata
482
387
 
483
- # Test toolbar configuration values (uncomment to test)
484
- # These values demonstrate toolbar customization in the test app
485
- toolbar_background_color = rgb(240, 248, 255)
486
- toolbar_border_color = rgb(59, 130, 246)
487
- toolbar_font_color = rgb(30, 58, 138)
488
- toolbar_button_background_color = rgb(219, 234, 254)
489
- toolbar_button_background_color_hover = rgb(191, 219, 254)
490
- toolbar_button_text_color = rgb(30, 64, 175)
491
- toolbar_button_active_background_color = rgb(37, 99, 235)
492
- toolbar_button_active_text_color = rgb(255, 255, 255)
493
- toolbar_button_save_background_color = rgb(34, 197, 94)
494
- toolbar_button_save_background_color_hover = rgb(22, 163, 74)
495
- toolbar_button_save_text_color = rgb(255, 255, 255)
496
- toolbar_show_metadata_button = false
497
-
498
388
  # =============================================================================
499
389
  # [file_manager] - Multi-file manager configuration
500
390
  # =============================================================================
501
391
  [file_manager]
502
392
 
503
- # Enable file manager features (true/false, yes/no, 1/0)
504
- # When enabled and files prop is provided, shows file list and management UI
393
+ # Enable file manager features (true/false)
505
394
  # Default: false
506
395
  # file_manager_enabled = false
507
396
 
508
- # Show file list above viewer (true/false, yes/no, 1/0)
509
- # When enabled, displays horizontal scrollable file list
397
+ # Show file list above viewer (true/false)
510
398
  # Default: true
511
399
  # show_file_list = true
512
400
 
513
- # Allow file deletion (true/false, yes/no, 1/0)
514
- # When enabled, shows delete button on file list items
401
+ # Allow file deletion (true/false)
515
402
  # Default: true
516
403
  # allow_delete = true
517
404
 
518
- # Show popout button (true/false, yes/no, 1/0)
519
- # When enabled, shows button to open viewer in new tab
405
+ # Show popout button (true/false)
520
406
  # Default: true
521
407
  # show_popout_button = true
522
408
 
523
409
  # File list height in pixels
524
- # Height of the file list container
525
410
  # Default: 72
526
411
  # file_list_height = 72
527
412
 
528
413
  # Selected file indicator color (hex format: #RRGGBB)
529
- # Border color for the currently selected file
530
414
  # Default: "#3b82f6" (blue)
531
415
  # selected_color = #3b82f6
532
416
 
533
417
  # File list background color (hex format: #RRGGBB)
534
- # Background color of the file list container
535
418
  # Default: "#f9fafb" (light grey)
536
419
  # file_list_background_color = #f9fafb
537
420
 
538
421
  # File list border color (hex format: #RRGGBB)
539
- # Border color of the file list container
540
422
  # Default: "#e5e7eb" (grey)
541
423
  # file_list_border_color = #e5e7eb
542
424
 
@@ -545,43 +427,35 @@ toolbar_show_metadata_button = false
545
427
  # =============================================================================
546
428
  [file_upload]
547
429
 
548
- # Enable file upload/dropzone (true/false, yes/no, 1/0)
549
- # When enabled, allows drag-and-drop file uploads
430
+ # Enable file upload/dropzone (true/false)
550
431
  # Default: false
551
432
  # upload_enabled = false
552
433
 
553
434
  # Allowed file types (MIME types, comma-separated)
554
- # List of MIME types that can be uploaded
555
435
  # Default: "application/pdf,image/jpeg,image/png,image/gif,image/webp,text/plain"
556
436
  # allowed_types = application/pdf,image/jpeg,image/png,image/gif,image/webp,text/plain
557
437
 
558
438
  # Maximum file size in bytes
559
- # Files larger than this will be rejected
560
439
  # Default: 10485760 (10MB)
561
440
  # max_file_size = 10485760
562
441
 
563
442
  # Maximum number of files allowed
564
- # Total number of files that can be in the file list
565
443
  # Default: 10
566
444
  # max_files = 10
567
445
 
568
- # Show add file button in file list (true/false, yes/no, 1/0)
569
- # When enabled, shows "+" button to add files
446
+ # Show add file button in file list (true/false)
570
447
  # Default: true
571
448
  # show_add_button = true
572
449
 
573
450
  # Dropzone border color (hex format: #RRGGBB)
574
- # Border color of the drag-and-drop zone
575
451
  # Default: "#d1d5db" (grey)
576
452
  # dropzone_border_color = #d1d5db
577
453
 
578
454
  # Dropzone border color on hover/drag (hex format: #RRGGBB)
579
- # Border color when dragging over the zone
580
455
  # Default: "#3b82f6" (blue)
581
456
  # dropzone_border_color_active = #3b82f6
582
457
 
583
458
  # Dropzone background color (hex format: #RRGGBB)
584
- # Background color of the drag-and-drop zone
585
459
  # Default: "#f9fafb" (light grey)
586
460
  # dropzone_background_color = #f9fafb
587
461
 
@@ -590,8 +464,7 @@ toolbar_show_metadata_button = false
590
464
  # =============================================================================
591
465
  [pdf_conversion]
592
466
 
593
- # Enable automatic conversion of non-PDF files (true/false, yes/no, 1/0)
594
- # When enabled, images and text files are automatically converted to PDF
467
+ # Enable automatic conversion of non-PDF files (true/false)
595
468
  # Default: true
596
469
  # conversion_enabled = true
597
470
 
@@ -601,17 +474,15 @@ toolbar_show_metadata_button = false
601
474
  # page_size = letter
602
475
 
603
476
  # Image quality for lossy compression (0.0 to 1.0)
604
- # Used when converting images to PDF
605
477
  # Default: 0.85
606
478
  # image_quality = 0.85
607
479
 
608
480
  # Image fit mode
609
- # Options: "fit" (preserve aspect, fit within), "fill" (crop to fill), "stretch" (distort to fill)
481
+ # Options: "fit" (preserve aspect), "fill" (crop to fill), "stretch" (distort)
610
482
  # Default: "fit"
611
483
  # image_fit = fit
612
484
 
613
485
  # Page margin in points (72 points = 1 inch)
614
- # Margin around the content on converted PDFs
615
486
  # Default: 36 (0.5 inch)
616
487
  # margin = 36
617
488
 
@@ -621,42 +492,34 @@ toolbar_show_metadata_button = false
621
492
  [auto_highlight]
622
493
 
623
494
  # Border color for auto-created highlights (hex format: #RRGGBB)
624
- # Color of the highlight border when using auto-highlighting feature
625
495
  # Default: "#FF6B00" (orange)
626
496
  # auto_highlight_border_color = #FF6B00
627
497
 
628
498
  # Background color for auto-created highlights (hex format: #RRGGBB)
629
- # Fill color inside the highlight box
630
499
  # Default: "#FFF3E0" (light orange)
631
500
  # auto_highlight_background_color = #FFF3E0
632
501
 
633
502
  # Background opacity for auto-created highlights (0.0 to 1.0)
634
- # Transparency level of the highlight background
635
503
  # Default: 0.3
636
504
  # auto_highlight_background_opacity = 0.3
637
505
 
638
506
  # Border width for auto-created highlights in pixels
639
- # Thickness of the highlight border
640
507
  # Default: 1
641
508
  # auto_highlight_border_width = 1
642
509
 
643
510
  # Whether to normalize text during search (true/false)
644
- # When enabled, removes commas and spaces from text before matching
645
511
  # Default: true
646
512
  # auto_highlight_normalize_text = true
647
513
 
648
514
  # Horizontal padding around highlighted text (in PDF units)
649
- # Extra space to add on left/right sides of the text box
650
515
  # Default: 2
651
516
  # auto_highlight_padding_x = 2
652
517
 
653
518
  # Vertical padding around highlighted text (in PDF units)
654
- # Extra space to add on top/bottom of the text box
655
519
  # Default: 1
656
520
  # auto_highlight_padding_y = 1
657
521
 
658
522
  # Y-axis offset to adjust highlight position (in PDF units)
659
- # Negative values move highlight down, positive values move up
660
523
  # Default: -3
661
524
  # auto_highlight_y_offset = -3
662
525
 
@@ -666,47 +529,25 @@ toolbar_show_metadata_button = false
666
529
  [file_button]
667
530
 
668
531
  # Icon size in pixels
669
- # Size of the file manager button icon
670
532
  # Default: 24
671
533
  # icon_size = 24
672
534
 
673
535
  # Icon color when no files (hex format: #RRGGBB)
674
- # Color of the icon when file list is empty
675
536
  # Default: "#6b7280" (grey)
676
537
  # icon_color = #6b7280
677
538
 
678
539
  # Icon color on hover (hex format: #RRGGBB)
679
- # Color of the icon when mouse hovers
680
540
  # Default: "#374151" (dark grey)
681
541
  # icon_color_hover = #374151
682
542
 
683
543
  # Icon color when files are loaded (hex format: #RRGGBB)
684
- # Color of the icon when files are present
685
544
  # Default: "#3b82f6" (blue)
686
545
  # icon_color_with_files = #3b82f6
687
546
 
688
547
  # Badge background color (hex format: #RRGGBB)
689
- # Background color of the file count badge
690
548
  # Default: "#3b82f6" (blue)
691
549
  # badge_background = #3b82f6
692
550
 
693
551
  # Badge text color (hex format: #RRGGBB)
694
- # Text color of the file count badge
695
552
  # Default: "#ffffff" (white)
696
553
  # badge_text_color = #ffffff
697
-
698
- # =============================================================================
699
- # [test_app] - Test application configuration
700
- # =============================================================================
701
- [test_app]
702
-
703
- # Enable/disable the test app (true/false, yes/no, 1/0)
704
- # When false, all test app routes return 404 for security
705
- # Default: falser
706
- test_app_enabled = true
707
-
708
- # Directory path for test PDF files (relative to project root or absolute)
709
- # This directory is used for the test app file browser
710
- # Default: "test/pdfs"
711
- test_app_directory = test/pdfs
712
-
@@ -1,5 +1,44 @@
1
1
  "use client";
2
2
 
3
+ // src/utils/logger.ts
4
+ var console_logger = {
5
+ info: (message, data) => {
6
+ if (data) {
7
+ console.log(`[hazo_pdf] ${message}`, data);
8
+ } else {
9
+ console.log(`[hazo_pdf] ${message}`);
10
+ }
11
+ },
12
+ debug: (message, data) => {
13
+ if (data) {
14
+ console.debug(`[hazo_pdf] ${message}`, data);
15
+ } else {
16
+ console.debug(`[hazo_pdf] ${message}`);
17
+ }
18
+ },
19
+ warn: (message, data) => {
20
+ if (data) {
21
+ console.warn(`[hazo_pdf] ${message}`, data);
22
+ } else {
23
+ console.warn(`[hazo_pdf] ${message}`);
24
+ }
25
+ },
26
+ error: (message, data) => {
27
+ if (data) {
28
+ console.error(`[hazo_pdf] ${message}`, data);
29
+ } else {
30
+ console.error(`[hazo_pdf] ${message}`);
31
+ }
32
+ }
33
+ };
34
+ var current_logger = console_logger;
35
+ function set_logger(logger) {
36
+ current_logger = logger || console_logger;
37
+ }
38
+ function get_logger() {
39
+ return current_logger;
40
+ }
41
+
3
42
  // src/config/default_config.ts
4
43
  var default_config = {
5
44
  fonts: {
@@ -154,6 +193,8 @@ var default_config = {
154
193
  };
155
194
 
156
195
  export {
196
+ set_logger,
197
+ get_logger,
157
198
  default_config
158
199
  };
159
- //# sourceMappingURL=chunk-LTUXHTQF.js.map
200
+ //# sourceMappingURL=chunk-264BTVJT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/logger.ts","../src/config/default_config.ts"],"sourcesContent":["/**\n * Logger Utility for hazo_pdf\n * Provides a unified logging interface that can use hazo_logs or fallback to console\n */\n\n/**\n * Logger interface matching hazo_logs Logger type\n * This allows consumers to pass in their own logger instance\n */\nexport interface Logger {\n info: (message: string, data?: Record<string, unknown>) => void;\n debug: (message: string, data?: Record<string, unknown>) => void;\n warn: (message: string, data?: Record<string, unknown>) => void;\n error: (message: string, data?: Record<string, unknown>) => void;\n}\n\n/**\n * Fallback logger using console\n * Used when no external logger is provided\n */\nconst console_logger: Logger = {\n info: (message: string, data?: Record<string, unknown>) => {\n if (data) {\n console.log(`[hazo_pdf] ${message}`, data);\n } else {\n console.log(`[hazo_pdf] ${message}`);\n }\n },\n debug: (message: string, data?: Record<string, unknown>) => {\n if (data) {\n console.debug(`[hazo_pdf] ${message}`, data);\n } else {\n console.debug(`[hazo_pdf] ${message}`);\n }\n },\n warn: (message: string, data?: Record<string, unknown>) => {\n if (data) {\n console.warn(`[hazo_pdf] ${message}`, data);\n } else {\n console.warn(`[hazo_pdf] ${message}`);\n }\n },\n error: (message: string, data?: Record<string, unknown>) => {\n if (data) {\n console.error(`[hazo_pdf] ${message}`, data);\n } else {\n console.error(`[hazo_pdf] ${message}`);\n }\n },\n};\n\n/**\n * Current logger instance\n * Defaults to console_logger, can be set via set_logger()\n */\nlet current_logger: Logger = console_logger;\n\n/**\n * Set the logger instance to use throughout hazo_pdf\n * @param logger - Logger instance (from hazo_logs or custom), or undefined to reset to console\n */\nexport function set_logger(logger: Logger | undefined): void {\n current_logger = logger || console_logger;\n}\n\n/**\n * Get the current logger instance\n * @returns Current logger (either hazo_logs instance or console fallback)\n */\nexport function get_logger(): Logger {\n return current_logger;\n}\n","/**\n * Default configuration values for hazo_pdf\n * All styling defaults organized by category\n */\n\nimport type { PdfViewerConfig } from '../types/config';\n\n/**\n * Default PDF Viewer Configuration\n * These values are used when no config file is provided or when values are missing\n */\nexport const default_config: PdfViewerConfig = {\n fonts: {\n freetext_font_family: 'Arial, sans-serif',\n freetext_font_size_min: 12,\n freetext_font_size_max: 24,\n freetext_font_size_default: 14,\n font_foreground_color: '#000000', // Black by default\n },\n\n highlight_annotation: {\n highlight_fill_color: '#FFFF00',\n highlight_fill_opacity: 0.3,\n highlight_border_color: '#FFD700',\n highlight_border_color_hover: '#FFD700',\n highlight_fill_opacity_hover: 0.4,\n },\n\n square_annotation: {\n square_fill_color: '#FF0000',\n square_fill_opacity: 0.2,\n square_border_color: '#FF0000',\n square_border_color_hover: '#CC0000',\n square_fill_opacity_hover: 0.3,\n },\n\n freetext_annotation: {\n freetext_text_color: '#000000',\n freetext_text_color_hover: '#000000',\n freetext_border_color: '#003366',\n freetext_border_width: 1,\n freetext_background_color: '#E6F3FF',\n freetext_background_opacity: 0.1,\n freetext_font_weight: 'normal',\n freetext_font_style: 'normal',\n freetext_text_decoration: 'none',\n freetext_padding_horizontal: 4,\n freetext_padding_vertical: 2,\n },\n\n page_styling: {\n page_border_color: '#999999',\n page_box_shadow: '0 2px 8px rgba(0, 0, 0, 0.3)',\n page_background_color: '#ffffff',\n },\n\n viewer: {\n viewer_background_color: '#2d2d2d',\n append_timestamp_to_text_edits: false,\n annotation_text_suffix_fixed_text: '',\n add_enclosing_brackets_to_suffixes: true,\n suffix_enclosing_brackets: '[]',\n suffix_text_position: 'below_multi_line',\n },\n\n context_menu: {\n context_menu_background_color: '#ffffff',\n context_menu_border_color: '#d1d5db',\n context_menu_item_hover_background: '#f3f4f6',\n context_menu_item_disabled_opacity: 0.5,\n right_click_custom_stamps: '', // Empty string means no custom stamps\n },\n\n dialog: {\n dialog_backdrop_opacity: 0.2,\n dialog_background_color: '#ffffff',\n dialog_border_color: '#d1d5db',\n dialog_button_submit_color: '#16a34a',\n dialog_button_submit_color_hover: '#15803d',\n dialog_button_cancel_color: '#6b7280',\n dialog_button_cancel_color_hover: '#4b5563',\n dialog_button_disabled_opacity: 0.4,\n },\n\n toolbar: {\n toolbar_background_color: '#f9fafb',\n toolbar_border_color: '#e5e7eb',\n toolbar_font_family: 'system-ui, -apple-system, sans-serif',\n toolbar_font_size: 14,\n toolbar_font_color: '#111827',\n toolbar_button_background_color: '#ffffff',\n toolbar_button_background_color_hover: '#f3f4f6',\n toolbar_button_text_color: '#374151',\n toolbar_button_active_background_color: '#3b82f6',\n toolbar_button_active_text_color: '#ffffff',\n toolbar_button_save_background_color: '#10b981',\n toolbar_button_save_background_color_hover: '#059669',\n toolbar_button_save_text_color: '#ffffff',\n toolbar_button_disabled_opacity: 0.5,\n toolbar_show_zoom_controls: true,\n toolbar_show_rotation_controls: true,\n toolbar_show_square_button: true,\n toolbar_show_undo_button: true,\n toolbar_show_redo_button: true,\n toolbar_show_save_button: true,\n toolbar_show_metadata_button: true,\n toolbar_show_annotate_button: true,\n toolbar_show_file_info_button: true,\n toolbar_show_extract_button: true,\n toolbar_show_download_button: false,\n toolbar_zoom_out_label: '−',\n toolbar_zoom_in_label: '+',\n toolbar_zoom_reset_label: 'Reset',\n toolbar_square_label: 'Square',\n toolbar_undo_label: 'Undo',\n toolbar_redo_label: 'Redo',\n toolbar_save_label: 'Save',\n toolbar_saving_label: 'Saving...',\n toolbar_metadata_label: 'Metadata',\n },\n\n file_manager: {\n file_manager_enabled: false,\n show_file_list: true,\n allow_delete: true,\n show_popout_button: true,\n file_list_height: 60,\n selected_color: '#3b82f6',\n file_list_background_color: '#f9fafb',\n file_list_border_color: '#e5e7eb',\n },\n\n file_upload: {\n upload_enabled: true,\n allowed_types: 'application/pdf,image/jpeg,image/png,image/gif,image/webp,text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel',\n max_file_size: 10485760, // 10MB\n max_files: 10,\n show_add_button: true,\n dropzone_border_color: '#d1d5db',\n dropzone_border_color_active: '#3b82f6',\n dropzone_background_color: '#f9fafb',\n direct_upload: false,\n },\n\n pdf_conversion: {\n conversion_enabled: true,\n page_size: 'letter',\n image_quality: 0.85,\n image_fit: 'fit',\n margin: 36,\n },\n\n auto_highlight: {\n auto_highlight_border_color: '#FF6B00',\n auto_highlight_background_color: '#FFF3E0',\n auto_highlight_background_opacity: 0.3,\n auto_highlight_border_width: 1,\n auto_highlight_normalize_text: true,\n auto_highlight_padding_x: 2,\n auto_highlight_padding_y: 1,\n auto_highlight_y_offset: -3,\n },\n\n file_button: {\n icon_size: 24,\n icon_color: '#6b7280',\n icon_color_hover: '#374151',\n icon_color_with_files: '#3b82f6',\n badge_background: '#3b82f6',\n badge_text_color: '#ffffff',\n },\n};\n"],"mappings":";;;AAoBA,IAAM,iBAAyB;AAAA,EAC7B,MAAM,CAAC,SAAiB,SAAmC;AACzD,QAAI,MAAM;AACR,cAAQ,IAAI,cAAc,OAAO,IAAI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