@prolibu-suite/cobalt-core 0.11.9 → 0.11.10

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 (48) hide show
  1. package/custom-elements.json +74 -31
  2. package/dist/cjs/co-color-picker.cjs.entry.js +1 -1
  3. package/dist/cjs/co-file-field.cjs.entry.js +30 -8
  4. package/dist/cjs/cobalt.cjs.js +1 -1
  5. package/dist/cjs/{fileI18n-6sdbKvo6.js → fileI18n-Bz8zbHlB.js} +3 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cobalt/cobalt.esm.js +1 -1
  8. package/dist/cobalt/{p-cd43d372.entry.js → p-15d995b4.entry.js} +1 -1
  9. package/dist/cobalt/p-b6463d35.entry.js +1 -0
  10. package/dist/cobalt/p-z0tbse7d.js +1 -0
  11. package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
  12. package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
  13. package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
  14. package/dist/collection/components/co-color-area/co-color-area.js +2 -2
  15. package/dist/collection/components/co-color-slider/co-color-slider.js +1 -1
  16. package/dist/collection/components/co-combobox/co-combobox.js +1 -1
  17. package/dist/collection/components/co-command-search/co-command-search.js +1 -1
  18. package/dist/collection/components/co-data-table/co-data-table.js +1 -1
  19. package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
  20. package/dist/collection/components/co-document-editor/co-document-editor.js +5 -5
  21. package/dist/collection/components/co-file-field/co-file-field.js +50 -8
  22. package/dist/collection/components/co-file-field/co-file-field.utils.js +14 -0
  23. package/dist/collection/components/co-popover/co-popover.js +1 -1
  24. package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
  25. package/dist/collection/components/co-ref-field/co-ref-field.js +4 -4
  26. package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
  27. package/dist/collection/components/co-select/co-select.js +1 -1
  28. package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
  29. package/dist/collection/components/co-toast/co-toast.js +2 -2
  30. package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
  31. package/dist/collection/components/co-tree-item/co-tree-item.js +2 -2
  32. package/dist/collection/utils/fileI18n.js +3 -0
  33. package/dist/components/co-color-picker.js +1 -1
  34. package/dist/components/co-file-field.js +1 -1
  35. package/dist/components/p-z0tbse7d.js +1 -0
  36. package/dist/esm/co-color-picker.entry.js +1 -1
  37. package/dist/esm/co-file-field.entry.js +30 -8
  38. package/dist/esm/cobalt.js +1 -1
  39. package/dist/esm/{fileI18n-gKnOhsd2.js → fileI18n-z0tbse7d.js} +3 -0
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/types/components/co-file-field/co-file-field.d.ts +13 -0
  42. package/dist/types/components/co-file-field/co-file-field.utils.d.ts +6 -0
  43. package/dist/types/components.d.ts +16 -0
  44. package/dist/types/utils/fileI18n.d.ts +1 -0
  45. package/package.json +4 -4
  46. package/dist/cobalt/p-c31b9b51.entry.js +0 -1
  47. package/dist/cobalt/p-gKnOhsd2.js +0 -1
  48. package/dist/components/p-gKnOhsd2.js +0 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-10-01T19:23:24",
2
+ "timestamp": "2026-10-01T20:21:56",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.43.4",
@@ -1434,7 +1434,7 @@
1434
1434
  "references": {
1435
1435
  "AutocompleteOption": {
1436
1436
  "location": "local",
1437
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-autocomplete/co-autocomplete.tsx",
1437
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-autocomplete/co-autocomplete.tsx",
1438
1438
  "id": "src/components/co-autocomplete/co-autocomplete.tsx::AutocompleteOption"
1439
1439
  }
1440
1440
  }
@@ -2270,7 +2270,7 @@
2270
2270
  "references": {
2271
2271
  "CoAvatarGroupItem": {
2272
2272
  "location": "local",
2273
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-avatar-group/co-avatar-group.tsx",
2273
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-avatar-group/co-avatar-group.tsx",
2274
2274
  "id": "src/components/co-avatar-group/co-avatar-group.tsx::CoAvatarGroupItem"
2275
2275
  }
2276
2276
  }
@@ -7076,7 +7076,7 @@
7076
7076
  "references": {
7077
7077
  "CheckboxOption": {
7078
7078
  "location": "local",
7079
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-checkbox-group/co-checkbox-group.tsx",
7079
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-checkbox-group/co-checkbox-group.tsx",
7080
7080
  "id": "src/components/co-checkbox-group/co-checkbox-group.tsx::CheckboxOption"
7081
7081
  }
7082
7082
  }
@@ -8196,7 +8196,7 @@
8196
8196
  "references": {
8197
8197
  "ColorAreaDetail": {
8198
8198
  "location": "local",
8199
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-color-area/co-color-area.tsx",
8199
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-color-area/co-color-area.tsx",
8200
8200
  "id": "src/components/co-color-area/co-color-area.tsx::ColorAreaDetail"
8201
8201
  }
8202
8202
  }
@@ -8216,7 +8216,7 @@
8216
8216
  "references": {
8217
8217
  "ColorAreaDetail": {
8218
8218
  "location": "local",
8219
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-color-area/co-color-area.tsx",
8219
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-color-area/co-color-area.tsx",
8220
8220
  "id": "src/components/co-color-area/co-color-area.tsx::ColorAreaDetail"
8221
8221
  }
8222
8222
  }
@@ -8751,7 +8751,7 @@
8751
8751
  "references": {
8752
8752
  "ColorSliderChannel": {
8753
8753
  "location": "local",
8754
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-color-slider/co-color-slider.tsx",
8754
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-color-slider/co-color-slider.tsx",
8755
8755
  "id": "src/components/co-color-slider/co-color-slider.tsx::ColorSliderChannel"
8756
8756
  }
8757
8757
  }
@@ -9971,7 +9971,7 @@
9971
9971
  "references": {
9972
9972
  "ComboboxOption": {
9973
9973
  "location": "local",
9974
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-combobox/co-combobox.tsx",
9974
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-combobox/co-combobox.tsx",
9975
9975
  "id": "src/components/co-combobox/co-combobox.tsx::ComboboxOption"
9976
9976
  }
9977
9977
  }
@@ -10680,7 +10680,7 @@
10680
10680
  "references": {
10681
10681
  "CommandItem": {
10682
10682
  "location": "local",
10683
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-command-search/co-command-search.tsx",
10683
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-command-search/co-command-search.tsx",
10684
10684
  "id": "src/components/co-command-search/co-command-search.tsx::CommandItem"
10685
10685
  }
10686
10686
  }
@@ -11072,7 +11072,7 @@
11072
11072
  "references": {
11073
11073
  "CoDataTableColumn": {
11074
11074
  "location": "local",
11075
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-data-table/co-data-table.tsx",
11075
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-data-table/co-data-table.tsx",
11076
11076
  "id": "src/components/co-data-table/co-data-table.tsx::CoDataTableColumn"
11077
11077
  }
11078
11078
  }
@@ -15242,7 +15242,7 @@
15242
15242
  "references": {
15243
15243
  "DateRangeValue": {
15244
15244
  "location": "local",
15245
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
15245
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
15246
15246
  "id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue"
15247
15247
  }
15248
15248
  }
@@ -15318,7 +15318,7 @@
15318
15318
  "references": {
15319
15319
  "DateRangeValue": {
15320
15320
  "location": "local",
15321
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
15321
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
15322
15322
  "id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue"
15323
15323
  }
15324
15324
  }
@@ -16532,7 +16532,7 @@
16532
16532
  "references": {
16533
16533
  "DocumentFeatures": {
16534
16534
  "location": "local",
16535
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-document-editor/co-document-editor.tsx",
16535
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
16536
16536
  "id": "src/components/co-document-editor/co-document-editor.tsx::DocumentFeatures"
16537
16537
  }
16538
16538
  }
@@ -16715,7 +16715,7 @@
16715
16715
  "references": {
16716
16716
  "DocumentMargins": {
16717
16717
  "location": "local",
16718
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-document-editor/co-document-editor.tsx",
16718
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
16719
16719
  "id": "src/components/co-document-editor/co-document-editor.tsx::DocumentMargins"
16720
16720
  }
16721
16721
  }
@@ -16750,7 +16750,7 @@
16750
16750
  "references": {
16751
16751
  "DocumentPageSize": {
16752
16752
  "location": "local",
16753
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-document-editor/co-document-editor.tsx",
16753
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
16754
16754
  "id": "src/components/co-document-editor/co-document-editor.tsx::DocumentPageSize"
16755
16755
  }
16756
16756
  }
@@ -17227,7 +17227,7 @@
17227
17227
  "references": {
17228
17228
  "DocumentActionDetail": {
17229
17229
  "location": "local",
17230
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-document-editor/co-document-editor.tsx",
17230
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
17231
17231
  "id": "src/components/co-document-editor/co-document-editor.tsx::DocumentActionDetail"
17232
17232
  }
17233
17233
  }
@@ -17282,7 +17282,7 @@
17282
17282
  "references": {
17283
17283
  "DocumentHeaderDetail": {
17284
17284
  "location": "local",
17285
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-document-editor/co-document-editor.tsx",
17285
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-document-editor/co-document-editor.tsx",
17286
17286
  "id": "src/components/co-document-editor/co-document-editor.tsx::DocumentHeaderDetail"
17287
17287
  }
17288
17288
  }
@@ -20923,6 +20923,35 @@
20923
20923
  "getter": false,
20924
20924
  "setter": false
20925
20925
  },
20926
+ {
20927
+ "name": "annotatable",
20928
+ "type": "boolean",
20929
+ "complexType": {
20930
+ "original": "boolean",
20931
+ "resolved": "boolean",
20932
+ "references": {}
20933
+ },
20934
+ "mutable": false,
20935
+ "attr": "annotatable",
20936
+ "reflectToAttr": false,
20937
+ "docs": "Offer an \"annotate\" action on stored raster images (png/jpg/webp). The\nfield draws nothing itself: it emits `coAnnotate` and the host opens its\neditor, uploads the result and removes the original — same contract as\nuploads (the WC emits intent, the host does the I/O).",
20938
+ "docsTags": [
20939
+ {
20940
+ "name": "default",
20941
+ "text": "false"
20942
+ }
20943
+ ],
20944
+ "default": "false",
20945
+ "values": [
20946
+ {
20947
+ "type": "boolean"
20948
+ }
20949
+ ],
20950
+ "optional": false,
20951
+ "required": false,
20952
+ "getter": false,
20953
+ "setter": false
20954
+ },
20926
20955
  {
20927
20956
  "name": "disabled",
20928
20957
  "type": "boolean",
@@ -21387,6 +21416,20 @@
21387
21416
  ],
21388
21417
  "methods": [],
21389
21418
  "events": [
21419
+ {
21420
+ "event": "coAnnotate",
21421
+ "detail": "{ id: string; url: string; name: string; }",
21422
+ "bubbles": false,
21423
+ "complexType": {
21424
+ "original": "{ id: string; url: string; name: string }",
21425
+ "resolved": "{ id: string; url: string; name: string; }",
21426
+ "references": {}
21427
+ },
21428
+ "cancelable": true,
21429
+ "composed": true,
21430
+ "docs": "Emitted when the user asks to annotate a stored image (see `annotatable`).",
21431
+ "docsTags": []
21432
+ },
21390
21433
  {
21391
21434
  "event": "coClear",
21392
21435
  "detail": "void",
@@ -30556,7 +30599,7 @@
30556
30599
  "references": {
30557
30600
  "PopoverPlacement": {
30558
30601
  "location": "local",
30559
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-popover/co-popover.tsx",
30602
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-popover/co-popover.tsx",
30560
30603
  "id": "src/components/co-popover/co-popover.tsx::PopoverPlacement"
30561
30604
  }
30562
30605
  }
@@ -31753,7 +31796,7 @@
31753
31796
  "references": {
31754
31797
  "RadioOption": {
31755
31798
  "location": "local",
31756
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-radio-group/co-radio-group.tsx",
31799
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-radio-group/co-radio-group.tsx",
31757
31800
  "id": "src/components/co-radio-group/co-radio-group.tsx::RadioOption"
31758
31801
  }
31759
31802
  }
@@ -33554,7 +33597,7 @@
33554
33597
  },
33555
33598
  "RefFieldOption": {
33556
33599
  "location": "local",
33557
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33600
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33558
33601
  "id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
33559
33602
  }
33560
33603
  },
@@ -33583,7 +33626,7 @@
33583
33626
  "references": {
33584
33627
  "RefFieldOption": {
33585
33628
  "location": "local",
33586
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33629
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33587
33630
  "id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
33588
33631
  }
33589
33632
  }
@@ -33673,7 +33716,7 @@
33673
33716
  "references": {
33674
33717
  "RefFieldOption": {
33675
33718
  "location": "local",
33676
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33719
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33677
33720
  "id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
33678
33721
  }
33679
33722
  }
@@ -33721,7 +33764,7 @@
33721
33764
  "references": {
33722
33765
  "RefFieldOption": {
33723
33766
  "location": "local",
33724
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33767
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-ref-field/co-ref-field.tsx",
33725
33768
  "id": "src/components/co-ref-field/co-ref-field.tsx::RefFieldOption"
33726
33769
  }
33727
33770
  }
@@ -36054,7 +36097,7 @@
36054
36097
  "references": {
36055
36098
  "CoSegment": {
36056
36099
  "location": "local",
36057
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-segmented-bar/co-segmented-bar.tsx",
36100
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-segmented-bar/co-segmented-bar.tsx",
36058
36101
  "id": "src/components/co-segmented-bar/co-segmented-bar.tsx::CoSegment"
36059
36102
  }
36060
36103
  }
@@ -36594,7 +36637,7 @@
36594
36637
  "references": {
36595
36638
  "SelectOption": {
36596
36639
  "location": "local",
36597
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-select/co-select.tsx",
36640
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-select/co-select.tsx",
36598
36641
  "id": "src/components/co-select/co-select.tsx::SelectOption"
36599
36642
  }
36600
36643
  }
@@ -37668,7 +37711,7 @@
37668
37711
  "references": {
37669
37712
  "NavigateDetail": {
37670
37713
  "location": "local",
37671
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-sidebar-nav/co-sidebar-nav.tsx",
37714
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-sidebar-nav/co-sidebar-nav.tsx",
37672
37715
  "id": "src/components/co-sidebar-nav/co-sidebar-nav.tsx::NavigateDetail"
37673
37716
  }
37674
37717
  }
@@ -41210,7 +41253,7 @@
41210
41253
  "references": {
41211
41254
  "CoToastActionsLayout": {
41212
41255
  "location": "local",
41213
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-toast/co-toast.tsx",
41256
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-toast/co-toast.tsx",
41214
41257
  "id": "src/components/co-toast/co-toast.tsx::CoToastActionsLayout"
41215
41258
  }
41216
41259
  }
@@ -41386,7 +41429,7 @@
41386
41429
  "references": {
41387
41430
  "CoToastVariant": {
41388
41431
  "location": "local",
41389
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-toast/co-toast.tsx",
41432
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-toast/co-toast.tsx",
41390
41433
  "id": "src/components/co-toast/co-toast.tsx::CoToastVariant"
41391
41434
  }
41392
41435
  }
@@ -42808,7 +42851,7 @@
42808
42851
  "references": {
42809
42852
  "TransferOption": {
42810
42853
  "location": "local",
42811
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-transfer-list/co-transfer-list.tsx",
42854
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-transfer-list/co-transfer-list.tsx",
42812
42855
  "id": "src/components/co-transfer-list/co-transfer-list.tsx::TransferOption"
42813
42856
  }
42814
42857
  }
@@ -43238,7 +43281,7 @@
43238
43281
  "references": {
43239
43282
  "TreeItemSelection": {
43240
43283
  "location": "local",
43241
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-tree-item/co-tree-item.tsx",
43284
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-tree-item/co-tree-item.tsx",
43242
43285
  "id": "src/components/co-tree-item/co-tree-item.tsx::TreeItemSelection"
43243
43286
  }
43244
43287
  }
@@ -43282,7 +43325,7 @@
43282
43325
  "references": {
43283
43326
  "TreeItemSize": {
43284
43327
  "location": "local",
43285
- "path": "/Users/agox/worktrees/cobalt-sidebar-icons/packages/core/src/components/co-tree-item/co-tree-item.tsx",
43328
+ "path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-tree-item/co-tree-item.tsx",
43286
43329
  "id": "src/components/co-tree-item/co-tree-item.tsx::TreeItemSize"
43287
43330
  }
43288
43331
  }
@@ -3,7 +3,7 @@
3
3
  var index = require('./index-bHoidDwv.js');
4
4
  var requiredMark = require('./requiredMark-21yHvvZS.js');
5
5
  var color = require('./color-DlKNWtdc.js');
6
- var fileI18n = require('./fileI18n-6sdbKvo6.js');
6
+ var fileI18n = require('./fileI18n-Bz8zbHlB.js');
7
7
 
8
8
  /**
9
9
  * Textos de co-color-picker. Mismo patrón que fileI18n/dateI18n: el componente
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-bHoidDwv.js');
4
4
  var requiredMark = require('./requiredMark-21yHvvZS.js');
5
- var fileI18n = require('./fileI18n-6sdbKvo6.js');
5
+ var fileI18n = require('./fileI18n-Bz8zbHlB.js');
6
6
 
7
7
  /** Format bytes like the Figma spec: "59.25 KB" (base 1024, up to 2 decimals). */
8
8
  function formatBytes(bytes) {
@@ -83,6 +83,20 @@ function isImage(item) {
83
83
  return true;
84
84
  return hasImageExtension(item);
85
85
  }
86
+ /** Raster formats a host can redraw on a canvas and export again without loss of
87
+ * meaning. GIF (animation), SVG (vector) and the rest stay out: flattening them
88
+ * to a bitmap would silently change the file. */
89
+ const ANNOTATABLE_EXTS = new Set(['png', 'jpg', 'jpeg', 'webp']);
90
+ /**
91
+ * A stored raster image the host can annotate (draw on and re-upload). Needs the
92
+ * ORIGINAL `url` — a thumbnail is a downscaled copy, and a PDF that entered the
93
+ * grid through its thumbnail is not an image at all.
94
+ */
95
+ function isAnnotatable(item) {
96
+ if (item.status !== 'done' || !item.url)
97
+ return false;
98
+ return ANNOTATABLE_EXTS.has(fileExtension(item));
99
+ }
86
100
  /** Items that earn a card in the previews grid: images and videos alike. */
87
101
  function isPreviewable(item) {
88
102
  return isImage(item) || isVideo(item);
@@ -166,6 +180,7 @@ const CoFileField = class {
166
180
  this.coClear = index.createEvent(this, "coClear", 3);
167
181
  this.coReorder = index.createEvent(this, "coReorder", 3);
168
182
  this.coCopy = index.createEvent(this, "coCopy", 3);
183
+ this.coAnnotate = index.createEvent(this, "coAnnotate", 3);
169
184
  this.coPreviewOpen = index.createEvent(this, "coPreviewOpen", 3);
170
185
  /** Deshabilita el campo: no acepta archivos ni acciones. */
171
186
  this.disabled = false;
@@ -183,6 +198,13 @@ const CoFileField = class {
183
198
  this.layout = 'vertical';
184
199
  /** Allow drag-reordering of the uploaded list (multiple mode). */
185
200
  this.reorderable = true;
201
+ /**
202
+ * Offer an "annotate" action on stored raster images (png/jpg/webp). The
203
+ * field draws nothing itself: it emits `coAnnotate` and the host opens its
204
+ * editor, uploads the result and removes the original — same contract as
205
+ * uploads (the WC emits intent, the host does the I/O).
206
+ */
207
+ this.annotatable = false;
186
208
  /** Controlled file list, JSON array of {@link FileItem} (owned by the host). */
187
209
  this.files = '[]';
188
210
  this.dragOver = false;
@@ -515,12 +537,12 @@ const CoFileField = class {
515
537
  const previews = this.previewItems();
516
538
  const canReorder = this.reorderable && this.multiple && !this.disabled && !this.readonly && items.length > 1;
517
539
  const capacity = this.capacityHint(s);
518
- return (index.h("div", { key: '4a6cea48737c68e53f90a32e962660473f49ce5a', class: {
540
+ return (index.h("div", { key: 'ce032373afbb21b082696b4d532655c3d599800c', class: {
519
541
  'co-file-field': true,
520
542
  'co-file-field--disabled': this.disabled,
521
543
  'co-file-field--invalid': this.isInvalid,
522
544
  [statusClass]: !!statusClass,
523
- }, part: "wrapper" }, this.label && (index.h("div", { key: '3532e314c63b19208c7a7665dd025ff38585a598', class: "co-file-field__labels" }, index.h("label", { key: 'ae8aa6da81d6b959233218473086ecabe5ab8017', class: "co-file-field__label", part: "label" }, this.label, index.h(requiredMark.RequiredMark, { key: '78d12c0e676217fd208bc03cc6a119b6fbf521e7', required: this.required })))), showDropzone && (index.h("div", { key: 'a6e5764aa57090d6b9383b1f8148bcba1239ff3a', class: {
545
+ }, part: "wrapper" }, this.label && (index.h("div", { key: '7650af04090b50b39e9dde6879156b51fd0a1b11', class: "co-file-field__labels" }, index.h("label", { key: '5f305d56f5dcbe3b8d267e22471f4c6536792510', class: "co-file-field__label", part: "label" }, this.label, index.h(requiredMark.RequiredMark, { key: '46896eae83028b9117c32b2ab9ac21443a58c608', required: this.required })))), showDropzone && (index.h("div", { key: 'c2767c1c6f8e0e928f328db2e985f747f34b13af', class: {
524
546
  'co-file-field__dropzone': true,
525
547
  'co-file-field__dropzone--drag': this.dragOver,
526
548
  }, part: "dropzone", role: "button", tabIndex: this.disabled ? -1 : 0, onClick: this.handleBrowse, onKeyDown: (e) => {
@@ -528,7 +550,7 @@ const CoFileField = class {
528
550
  e.preventDefault();
529
551
  this.handleBrowse();
530
552
  }
531
- }, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.h("button", { key: '44558c1a5d15c5aca23a7e204bcccf5e57d6b740', class: "co-file-field__upload-btn", part: "upload-button", type: "button", tabIndex: -1 }, index.h("co-icon", { key: '662340ae54f1d070606c0fd8226155b0360e803e', name: "file-arrow-up", size: 18 }), index.h("span", { key: '752f18e7121040eb4edf571a54a9a5308825cb13' }, this.uploadButtonText || s.uploadButton)), index.h("span", { key: 'b92332ee8e7e658b33814b8c1ae34a4630045819', class: "co-file-field__dropzone-text" }, this.dropText || s.dropHint), capacity && index.h("span", { key: 'ed1f7c9093145ecbb49446b72a3d3bc99ee232e2', class: "co-file-field__dropzone-hint" }, capacity), index.h("div", { key: 'fd4953e9dfebf35936ae836d6f28ccdc17ccf951', class: "co-file-field__actions", part: "actions" }, index.h("slot", { key: 'c2e568fabd1512ecfa298c2ab281d310fbe21664', name: "actions" })), index.h("input", { key: '17acb79e8d066c18f7c1ac051a365d4282c852af', ref: (el) => (this.inputEl = el), class: "co-file-field__input", type: "file", multiple: this.multiple, accept: this.inputAccept, disabled: this.disabled, onChange: this.handleInputChange, "aria-hidden": "true", tabIndex: -1 }))), items.length > 0 && (index.h("div", { key: 'a793e2b836269abaafe71fd56b07b3d54155cf75', class: "co-file-field__uploaded" }, this.multiple && (index.h("div", { key: '2a265874db718faf1e78f2dd46e5ff14bbfbbff2', class: "co-file-field__uploaded-title", part: "uploaded-title" }, `${this.uploadedTitle || s.uploadedTitle} (${items.length})`)), previews.length > 0 && (index.h("div", { key: 'a4ebb3fae5ad4b2b29263381f9eb5ae03a98867d', class: "co-file-field__previews", part: "previews" }, previews.map((item) => {
553
+ }, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.h("button", { key: 'f9b2ef43730b009a6ca322ea6cae833f86a52ff0', class: "co-file-field__upload-btn", part: "upload-button", type: "button", tabIndex: -1 }, index.h("co-icon", { key: 'ffa7d7fdb830fc789ffd4ada624c450c70109701', name: "file-arrow-up", size: 18 }), index.h("span", { key: 'c9c54dd9432f8c74894a0054ecdf0c59aede974a' }, this.uploadButtonText || s.uploadButton)), index.h("span", { key: '74f8884d62b79960e0080794404f24e45d229284', class: "co-file-field__dropzone-text" }, this.dropText || s.dropHint), capacity && index.h("span", { key: '4c6bdd2de90754b50135e9212510884d1495b8d4', class: "co-file-field__dropzone-hint" }, capacity), index.h("div", { key: '42bd92119fed5b9be39e7db5c351990faafc7135', class: "co-file-field__actions", part: "actions" }, index.h("slot", { key: 'fa2a649c222125ba63fa74028dba417c50f7b3f6', name: "actions" })), index.h("input", { key: '982021a63eb6bec0b19ca917382a6efd37938ab3', ref: (el) => (this.inputEl = el), class: "co-file-field__input", type: "file", multiple: this.multiple, accept: this.inputAccept, disabled: this.disabled, onChange: this.handleInputChange, "aria-hidden": "true", tabIndex: -1 }))), items.length > 0 && (index.h("div", { key: '95bd1f51b0a361dec2ca0b272212ef64d438db0a', class: "co-file-field__uploaded" }, this.multiple && (index.h("div", { key: '479851cd44dbdc9ad99e9b26764f558845966c53', class: "co-file-field__uploaded-title", part: "uploaded-title" }, `${this.uploadedTitle || s.uploadedTitle} (${items.length})`)), previews.length > 0 && (index.h("div", { key: '8be03edd2b1b8b7628d6e34fa82751045589b416', class: "co-file-field__previews", part: "previews" }, previews.map((item) => {
532
554
  const key = this.keyFor(item);
533
555
  const video = isVideo(item);
534
556
  // A video without a usable poster still gets a card — the
@@ -539,7 +561,7 @@ const CoFileField = class {
539
561
  'co-file-field__preview': true,
540
562
  'co-file-field__preview--video': video,
541
563
  }, part: "preview", type: "button", key: `prev-${key}`, title: item.name, "aria-label": `${video ? s.playVideo : s.openPreview}: ${item.name}`, onClick: () => this.handlePreviewOpen(item) }, showImg && (index.h("img", { src: video ? poster : item.thumbnail || item.url, alt: item.name, loading: "lazy", onError: () => this.handlePreviewError(item) })), video && (index.h("span", { class: "co-file-field__preview-play", "aria-hidden": "true" }, index.h("span", { class: "co-file-field__preview-play-badge" }, index.h("co-icon", { name: "play", size: 20, weight: "fill" })), !poster && (index.h("span", { class: "co-file-field__preview-ext" }, fileExtension(item).toUpperCase()))))));
542
- }))), index.h("ul", { key: '97ead2383d036b1ed2b09d6e931be2bfbcce25d2', class: "co-file-field__list", part: "list" }, items.map((item) => {
564
+ }))), index.h("ul", { key: '1fa661f14a8644a2703204d1faac79e5599c5e77', class: "co-file-field__list", part: "list" }, items.map((item) => {
543
565
  const key = this.keyFor(item);
544
566
  const draggable = canReorder && item.status === 'done';
545
567
  return (index.h("li", { class: {
@@ -559,14 +581,14 @@ const CoFileField = class {
559
581
  'co-file-field__row-icon--spin': item.status === 'uploading',
560
582
  } })), index.h("div", { class: "co-file-field__row-body" }, index.h("span", { class: "co-file-field__row-name", title: item.name }, truncateLeft(item.name)), item.status === 'uploading' && (index.h("div", { class: "co-file-field__progress" }, index.h("div", { class: "co-file-field__progress-bar", style: typeof item.progress === 'number'
561
583
  ? { width: `${item.progress}%` }
562
- : undefined }))), item.status === 'error' && item.error && (index.h("span", { class: "co-file-field__row-error" }, item.error))), item.size != null && (index.h("span", { class: "co-file-field__row-size" }, formatBytes(item.size))), item.status === 'done' && !!item.url && (index.h("co-tooltip", { content: s.downloadFile }, index.h("a", { class: "co-file-field__action", href: item.url, target: "_blank", rel: "noopener noreferrer", download: item.name, tabIndex: -1, "aria-label": s.downloadFile, onClick: (e) => this.onDownloadClick(e, item) }, index.h("co-icon", { name: "download", size: 18 })))), item.status === 'done' && !!item.url && (index.h("co-tooltip", { content: this.copiedKey === key ? s.copied : s.copyUrl }, index.h("button", { class: {
584
+ : undefined }))), item.status === 'error' && item.error && (index.h("span", { class: "co-file-field__row-error" }, item.error))), item.size != null && (index.h("span", { class: "co-file-field__row-size" }, formatBytes(item.size))), this.annotatable && !this.disabled && !this.readonly && isAnnotatable(item) && (index.h("co-tooltip", { content: s.annotateImage }, index.h("button", { class: "co-file-field__action", type: "button", tabIndex: -1, "aria-label": `${s.annotateImage}: ${item.name}`, onClick: () => this.coAnnotate.emit({ id: key, url: item.url, name: item.name }) }, index.h("co-icon", { name: "pencil-simple-line", size: 18 })))), item.status === 'done' && !!item.url && (index.h("co-tooltip", { content: s.downloadFile }, index.h("a", { class: "co-file-field__action", href: item.url, target: "_blank", rel: "noopener noreferrer", download: item.name, tabIndex: -1, "aria-label": s.downloadFile, onClick: (e) => this.onDownloadClick(e, item) }, index.h("co-icon", { name: "download", size: 18 })))), item.status === 'done' && !!item.url && (index.h("co-tooltip", { content: this.copiedKey === key ? s.copied : s.copyUrl }, index.h("button", { class: {
563
585
  'co-file-field__action': true,
564
586
  'co-file-field__action--copied': this.copiedKey === key,
565
587
  }, type: "button", tabIndex: -1, "aria-label": s.copyUrl, onClick: () => this.handleCopy(item) }, index.h("co-icon", { name: this.copiedKey === key ? 'check' : 'copy', size: 18 })))), !this.disabled && !this.readonly && (index.h("co-tooltip", { content: s.removeFile }, index.h("button", { class: "co-file-field__action", type: "button", tabIndex: -1, "aria-label": s.removeFile, onClick: () => this.coRemove.emit(key) }, index.h("co-icon", { name: "trash", size: 18 }))))));
566
- })))), helper && (index.h("div", { key: 'd4fef1bb2aa10f90ca7cd5e01bb5fed9ea917637', class: {
588
+ })))), helper && (index.h("div", { key: '7562fdf435667ae305e677830cae06a3374ef67b', class: {
567
589
  'co-file-field__helper': true,
568
590
  'co-file-field__helper--error': this.isInvalid,
569
- }, part: "helper" }, this.isInvalid && (index.h("co-icon", { key: '2fb9d5d28732c239bcec4b0a30dfe194367e8b5d', name: "warning-circle", size: 14, class: "co-file-field__helper-icon" })), index.h("span", { key: '09bd101388c52a7fb8d0139c20f52f2da733543b', class: "co-file-field__helper-text" }, helper)))));
591
+ }, part: "helper" }, this.isInvalid && (index.h("co-icon", { key: 'ac43b079725a8b015f2ba1a8b8f22783f60e556e', name: "warning-circle", size: 14, class: "co-file-field__helper-icon" })), index.h("span", { key: 'cd256498ce501e5b59ae1a5850f8f8ddccb98580', class: "co-file-field__helper-text" }, helper)))));
570
592
  }
571
593
  get el() { return index.getElement(this); }
572
594
  };