@prolibu-suite/cobalt-core 0.10.4 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/custom-elements.json +7034 -1203
- package/dist/cjs/co-accordion.cjs.entry.js +3 -3
- package/dist/cjs/co-action-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-app-shell.cjs.entry.js +3 -3
- package/dist/cjs/co-audio-player.cjs.entry.js +4 -4
- package/dist/cjs/co-autocomplete.cjs.entry.js +12 -5
- package/dist/cjs/co-avatar-group.cjs.entry.js +3 -3
- package/dist/cjs/co-avatar.cjs.entry.js +7 -4
- package/dist/cjs/co-badge.cjs.entry.js +2 -2
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +5 -5
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +3 -3
- package/dist/cjs/co-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/co-button-group.cjs.entry.js +4 -3
- package/dist/cjs/co-button.cjs.entry.js +9 -7
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +16 -4
- package/dist/cjs/co-calendar_3.cjs.entry.js +76 -27
- package/dist/cjs/co-card.cjs.entry.js +3 -3
- package/dist/cjs/co-carousel-item.cjs.entry.js +2 -2
- package/dist/cjs/co-carousel.cjs.entry.js +6 -3
- package/dist/cjs/co-checkbox-group.cjs.entry.js +4 -4
- package/dist/cjs/co-checkbox.cjs.entry.js +13 -5
- package/dist/cjs/co-chip_2.cjs.entry.js +20 -7
- package/dist/cjs/co-color-area.cjs.entry.js +169 -0
- package/dist/cjs/co-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/co-color-slider.cjs.entry.js +189 -0
- package/dist/cjs/co-column-picker.cjs.entry.js +23 -3
- package/dist/cjs/co-combobox.cjs.entry.js +5 -5
- package/dist/cjs/co-command-search.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +3 -3
- package/dist/cjs/co-date-picker.cjs.entry.js +10 -2
- package/dist/cjs/co-date-range-picker.cjs.entry.js +11 -2
- package/dist/cjs/co-date-range.cjs.entry.js +8 -2
- package/dist/cjs/co-date-time-picker.cjs.entry.js +11 -4
- package/dist/cjs/co-document-editor.cjs.entry.js +1167 -0
- package/dist/cjs/co-drive-card.cjs.entry.js +2 -2
- package/dist/cjs/co-drop-zone.cjs.entry.js +2 -2
- package/dist/cjs/co-emoji-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-empty-state.cjs.entry.js +3 -3
- package/dist/cjs/co-event-calendar.cjs.entry.js +5 -3
- package/dist/cjs/co-event-popover.cjs.entry.js +7 -3
- package/dist/cjs/co-fab.cjs.entry.js +7 -3
- package/dist/cjs/co-file-field.cjs.entry.js +12 -8
- package/dist/cjs/co-file-type-tile.cjs.entry.js +3 -3
- package/dist/cjs/co-gradient-bar.cjs.entry.js +220 -0
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +48 -9
- package/dist/cjs/co-icon.cjs.entry.js +3 -3
- package/dist/cjs/co-input.cjs.entry.js +14 -8
- package/dist/cjs/co-json-field.cjs.entry.js +10 -5
- package/dist/cjs/{co-tooltip.cjs.entry.js → co-kbd_2.cjs.entry.js} +194 -6
- package/dist/cjs/co-lightbox.cjs.entry.js +5 -5
- package/dist/cjs/co-list-footer.cjs.entry.js +2 -2
- package/dist/cjs/co-list-item.cjs.entry.js +5 -5
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-media-thumb.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-divider.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-item.cjs.entry.js +41 -43
- package/dist/cjs/co-menu.cjs.entry.js +81 -5
- package/dist/cjs/co-modal.cjs.entry.js +350 -7
- package/dist/cjs/co-navbar.cjs.entry.js +3 -3
- package/dist/cjs/co-number-field.cjs.entry.js +11 -5
- package/dist/cjs/co-overlay.cjs.entry.js +8 -4
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +3 -3
- package/dist/cjs/co-popover.cjs.entry.js +69 -6
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +3 -3
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +2 -2
- package/dist/cjs/co-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/co-radio.cjs.entry.js +4 -4
- package/dist/cjs/co-rating.cjs.entry.js +11 -4
- package/dist/cjs/co-ref-field.cjs.entry.js +14 -5
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +40 -92
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +80 -20
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +9 -2
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-segmented-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-select.cjs.entry.js +171 -29
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +20 -5
- package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/co-slider.cjs.entry.js +209 -23
- package/dist/cjs/co-swatch-grid.cjs.entry.js +121 -0
- package/dist/cjs/co-switch.cjs.entry.js +5 -5
- package/dist/cjs/co-tab-group.cjs.entry.js +113 -4
- package/dist/cjs/co-tab.cjs.entry.js +15 -5
- package/dist/cjs/co-tags-field.cjs.entry.js +13 -8
- package/dist/cjs/co-textarea.cjs.entry.js +6 -6
- package/dist/cjs/co-tile.cjs.entry.js +61 -0
- package/dist/cjs/co-time-field.cjs.entry.js +5 -2
- package/dist/cjs/co-toast.cjs.entry.js +3 -3
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +29 -5
- package/dist/cjs/co-toggle-button.cjs.entry.js +70 -6
- package/dist/cjs/co-transfer-list.cjs.entry.js +7 -3
- package/dist/cjs/co-tree-item.cjs.entry.js +110 -0
- package/dist/cjs/co-video.cjs.entry.js +11 -3
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/{color-CML2Cfdh.js → color-DQVrQGi0.js} +10 -5
- package/dist/cjs/{fieldChip-B6YIGU1V.js → fieldChip-C7MxxBVO.js} +1 -1
- package/dist/cjs/gradientStops-CMpH4fB_.js +153 -0
- package/dist/cjs/hsv-DpfSF3M2.js +95 -0
- package/dist/cjs/{index-MDAnKsze.js → index-bHoidDwv.js} +67 -27
- package/dist/cjs/index-oMHzCXm6.js +144 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{index-2kMmd5-a.js → pagination-DV43TRj9.js} +1780 -297
- package/dist/cjs/{positioning-CyatXeT_.js → positioning-CILo5esi.js} +45 -18
- package/dist/cjs/{requiredMark-D-t-IPN0.js → requiredMark-21yHvvZS.js} +1 -1
- package/dist/cjs/rich-text-host-ueFSfW-6.js +119 -0
- package/dist/cjs/{richTextI18n-B28uAhh4.js → richTextI18n-DXGIv5w1.js} +45 -0
- package/dist/cjs/submenu-RlaX6irw.js +65 -0
- package/dist/cjs/{toolbar-config-CYACt9hh.js → toolbar-config-DczL6C4W.js} +32 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-76249983.entry.js → p-019eed8e.entry.js} +1 -1
- package/dist/cobalt/p-04e3e1f6.entry.js +1 -0
- package/dist/cobalt/p-06689166.entry.js +1 -0
- package/dist/cobalt/p-0d046d98.entry.js +1 -0
- package/dist/cobalt/{p-28764b8e.entry.js → p-0e4c2234.entry.js} +1 -1
- package/dist/cobalt/{p-b90d41e4.entry.js → p-1348d5ca.entry.js} +1 -1
- package/dist/cobalt/{p-49834b8e.entry.js → p-13e5b724.entry.js} +1 -1
- package/dist/cobalt/p-1a5bec8c.entry.js +1 -0
- package/dist/cobalt/p-21b4a830.entry.js +1 -0
- package/dist/cobalt/p-2231bacc.entry.js +1 -0
- package/dist/cobalt/{p-b437eff6.entry.js → p-26cbdc33.entry.js} +1 -1
- package/dist/cobalt/{p-aa9400bf.entry.js → p-28cf05f3.entry.js} +1 -1
- package/dist/cobalt/{p-eadfd661.entry.js → p-358a6c2a.entry.js} +1 -1
- package/dist/cobalt/p-3b5024ce.entry.js +1 -0
- package/dist/cobalt/p-3b6efb79.entry.js +1 -0
- package/dist/cobalt/p-3d1a48e5.entry.js +1 -0
- package/dist/cobalt/p-47eca182.entry.js +1 -0
- package/dist/cobalt/{p-eb82358d.entry.js → p-4bcdd422.entry.js} +1 -1
- package/dist/cobalt/{p-17244412.entry.js → p-4d743628.entry.js} +1 -1
- package/dist/cobalt/{p-011dc80b.entry.js → p-4e81e580.entry.js} +1 -1
- package/dist/cobalt/{p-ee9a623d.entry.js → p-53a251ca.entry.js} +1 -1
- package/dist/cobalt/{p-11c5ce78.entry.js → p-56176aa0.entry.js} +1 -1
- package/dist/cobalt/{p-a32b20eb.entry.js → p-58ebb303.entry.js} +1 -1
- package/dist/cobalt/{p-4592ca00.entry.js → p-5a32b9a2.entry.js} +1 -1
- package/dist/cobalt/{p-2636b7eb.entry.js → p-5e678e88.entry.js} +1 -1
- package/dist/cobalt/{p-996f4e38.entry.js → p-60f948c4.entry.js} +1 -1
- package/dist/cobalt/p-63908a8d.entry.js +1 -0
- package/dist/cobalt/p-65c191aa.entry.js +1 -0
- package/dist/cobalt/{p-c2ebf0ec.entry.js → p-65d44da2.entry.js} +1 -1
- package/dist/cobalt/p-67a024dd.entry.js +1 -0
- package/dist/cobalt/{p-ee149fd2.entry.js → p-6974df59.entry.js} +1 -1
- package/dist/cobalt/{p-000a15b8.entry.js → p-69ecc933.entry.js} +1 -1
- package/dist/cobalt/p-6c1992c9.entry.js +1 -0
- package/dist/cobalt/{p-b821d9de.entry.js → p-6d4a660c.entry.js} +1 -1
- package/dist/cobalt/{p-f57dffca.entry.js → p-713637f2.entry.js} +1 -1
- package/dist/cobalt/{p-292b0389.entry.js → p-71ae1551.entry.js} +1 -1
- package/dist/cobalt/{p-91e73a92.entry.js → p-71dc8e4a.entry.js} +1 -1
- package/dist/cobalt/{p-aaca6dab.entry.js → p-71ee36a8.entry.js} +1 -1
- package/dist/cobalt/p-71fe35c4.entry.js +1 -0
- package/dist/cobalt/{p-08e42e00.entry.js → p-73313cbe.entry.js} +1 -1
- package/dist/cobalt/{p-7b5c555c.entry.js → p-763698b3.entry.js} +1 -1
- package/dist/cobalt/p-77e0d401.entry.js +1 -0
- package/dist/cobalt/{p-c91d4fc6.entry.js → p-78412feb.entry.js} +1 -1
- package/dist/cobalt/p-7beface1.entry.js +1 -0
- package/dist/cobalt/{p-f4e1c3c3.entry.js → p-7d1718ed.entry.js} +1 -1
- package/dist/cobalt/{p-826ee074.entry.js → p-7df18a52.entry.js} +1 -1
- package/dist/cobalt/p-7e678cbd.entry.js +1 -0
- package/dist/cobalt/{p-d0b2c418.entry.js → p-7fabd8ba.entry.js} +1 -1
- package/dist/cobalt/{p-23ab0cc5.entry.js → p-848f5ca4.entry.js} +1 -1
- package/dist/cobalt/{p-623cc195.entry.js → p-8680559b.entry.js} +1 -1
- package/dist/cobalt/p-87de5469.entry.js +1 -0
- package/dist/cobalt/p-87e62e2b.entry.js +1 -0
- package/dist/cobalt/{p-1861fe41.entry.js → p-8a2a2b6c.entry.js} +1 -1
- package/dist/cobalt/p-903237f9.entry.js +1 -0
- package/dist/cobalt/{p-2c9dba2f.entry.js → p-95f2ebb1.entry.js} +1 -1
- package/dist/cobalt/{p-24196410.entry.js → p-99df434b.entry.js} +1 -1
- package/dist/cobalt/{p-290066ef.entry.js → p-9adbab95.entry.js} +1 -1
- package/dist/cobalt/p-9dc01092.entry.js +1 -0
- package/dist/cobalt/p-9ee5bef3.entry.js +1 -0
- package/dist/cobalt/p-B1JT7us1.js +1 -0
- package/dist/cobalt/{p-BRbgGqLw.js → p-BVGGRfNG.js} +1 -1
- package/dist/cobalt/p-BmdKHBZP.js +1 -0
- package/dist/cobalt/p-BtliEQAT.js +1 -0
- package/dist/cobalt/p-COJdaKBU.js +1 -0
- package/dist/cobalt/{p-BAYo-RBt.js → p-CRxTFT_z.js} +1 -1
- package/dist/cobalt/p-CYN5B3IQ.js +1 -0
- package/dist/cobalt/p-DJkaRtbb.js +2 -0
- package/dist/cobalt/p-DU-KOQ8L.js +1 -0
- package/dist/cobalt/p-DXLeDZvr.js +1 -0
- package/dist/cobalt/{p-D_zA1Pv4.js → p-DgJovDdy.js} +1 -1
- package/dist/cobalt/p-RVQJEYxa.js +1 -0
- package/dist/cobalt/{p-ee2023da.entry.js → p-a27013e6.entry.js} +1 -1
- package/dist/cobalt/{p-2f9cbbd5.entry.js → p-a4eb298c.entry.js} +1 -1
- package/dist/cobalt/p-a56bd4a8.entry.js +1 -0
- package/dist/cobalt/{p-59963937.entry.js → p-a5eabecb.entry.js} +1 -1
- package/dist/cobalt/p-a5ee1fc2.entry.js +1 -0
- package/dist/cobalt/{p-fb2d1144.entry.js → p-a7cd61ce.entry.js} +1 -1
- package/dist/cobalt/{p-39a50e7f.entry.js → p-ad752791.entry.js} +1 -1
- package/dist/cobalt/{p-07416e31.entry.js → p-ae999b94.entry.js} +1 -1
- package/dist/cobalt/{p-4d65e713.entry.js → p-aed832d5.entry.js} +1 -1
- package/dist/cobalt/p-b2457431.entry.js +1 -0
- package/dist/cobalt/{p-6dd220e0.entry.js → p-b39a4999.entry.js} +1 -1
- package/dist/cobalt/p-b5dabdc3.entry.js +1 -0
- package/dist/cobalt/{p-8471abe2.entry.js → p-b67fb616.entry.js} +1 -1
- package/dist/cobalt/{p-f7eb1a40.entry.js → p-b9b73dcb.entry.js} +1 -1
- package/dist/cobalt/{p-f9a7b7c6.entry.js → p-ba39a965.entry.js} +1 -1
- package/dist/cobalt/{p-58d9b650.entry.js → p-be520bd5.entry.js} +1 -1
- package/dist/cobalt/{p-1dc55e43.entry.js → p-bee30373.entry.js} +1 -1
- package/dist/cobalt/{p-44c4e4a3.entry.js → p-c220362c.entry.js} +1 -1
- package/dist/cobalt/p-c4c997f3.entry.js +1 -0
- package/dist/cobalt/{p-a2462d7a.entry.js → p-c5464a98.entry.js} +1 -1
- package/dist/cobalt/p-c567533e.entry.js +1 -0
- package/dist/cobalt/{p-c30b4cb5.entry.js → p-cf5b91be.entry.js} +1 -1
- package/dist/cobalt/p-cfaaa684.entry.js +1 -0
- package/dist/cobalt/p-d00c3894.entry.js +1 -0
- package/dist/cobalt/p-d1e83525.entry.js +1 -0
- package/dist/cobalt/{p-44ea675f.entry.js → p-d5d8fa8b.entry.js} +1 -1
- package/dist/cobalt/p-d6215d80.entry.js +1 -0
- package/dist/cobalt/p-d6e7c258.entry.js +1 -0
- package/dist/cobalt/p-dabcbba7.entry.js +1 -0
- package/dist/cobalt/p-db623519.entry.js +1 -0
- package/dist/cobalt/{p-c7d7d7f7.entry.js → p-df529110.entry.js} +1 -1
- package/dist/cobalt/{p-1cc818ca.entry.js → p-ea24eea8.entry.js} +1 -1
- package/dist/cobalt/{p-d29bb0fa.entry.js → p-efb3cbb0.entry.js} +1 -1
- package/dist/cobalt/{p-f6691108.entry.js → p-f0898e21.entry.js} +1 -1
- package/dist/cobalt/{p-0c004735.entry.js → p-f2fa2ac0.entry.js} +1 -1
- package/dist/cobalt/p-f403eeec.entry.js +1 -0
- package/dist/cobalt/{p-e4264532.entry.js → p-f69804a6.entry.js} +1 -1
- package/dist/cobalt/p-xnrKkNWQ.js +1 -0
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/co-accordion/co-accordion.js +12 -2
- package/dist/collection/components/co-action-bar/co-action-bar.css +6 -0
- package/dist/collection/components/co-action-bar/co-action-bar.js +3 -2
- package/dist/collection/components/co-app-shell/co-app-shell.css +6 -0
- package/dist/collection/components/co-app-shell/co-app-shell.js +13 -2
- package/dist/collection/components/co-audio-player/co-audio-player.js +19 -7
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +30 -17
- package/dist/collection/components/co-avatar/co-avatar.css +16 -2
- package/dist/collection/components/co-avatar/co-avatar.js +14 -4
- package/dist/collection/components/co-avatar-group/co-avatar-group.css +4 -0
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +8 -3
- package/dist/collection/components/co-badge/co-badge.js +8 -1
- package/dist/collection/components/co-bottom-sheet/co-bottom-sheet.js +13 -4
- package/dist/collection/components/co-breadcrumb/co-breadcrumb.js +5 -1
- package/dist/collection/components/co-breadcrumb-item/co-breadcrumb-item.js +8 -2
- package/dist/collection/components/co-button/co-button.css +81 -6
- package/dist/collection/components/co-button/co-button.js +39 -11
- package/dist/collection/components/co-button-group/co-button-group.js +10 -3
- package/dist/collection/components/co-calendar/calendarMarks.js +40 -0
- package/dist/collection/components/co-calendar/co-calendar.css +19 -1
- package/dist/collection/components/co-calendar/co-calendar.js +84 -20
- package/dist/collection/components/co-calendar-month/co-calendar-month.js +1 -1
- package/dist/collection/components/co-calendar-timegrid/co-calendar-timegrid.js +36 -19
- package/dist/collection/components/co-card/co-card.js +11 -2
- package/dist/collection/components/co-carousel/co-carousel.css +10 -0
- package/dist/collection/components/co-carousel/co-carousel.js +17 -5
- package/dist/collection/components/co-carousel-item/co-carousel-item.js +1 -1
- package/dist/collection/components/co-checkbox/co-checkbox.css +43 -1
- package/dist/collection/components/co-checkbox/co-checkbox.js +39 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +9 -4
- package/dist/collection/components/co-chip/co-chip.css +9 -0
- package/dist/collection/components/co-chip/co-chip.js +15 -2
- package/dist/collection/components/co-color-area/co-color-area.css +87 -0
- package/dist/collection/components/co-color-area/co-color-area.js +342 -0
- package/dist/collection/components/co-color-picker/co-color-picker.js +4 -2
- package/dist/collection/components/co-color-slider/co-color-slider.css +115 -0
- package/dist/collection/components/co-color-slider/co-color-slider.js +354 -0
- package/dist/collection/components/co-column-picker/co-column-picker.js +51 -25
- package/dist/collection/components/co-combobox/co-combobox.js +18 -4
- package/dist/collection/components/co-command-search/co-command-search.js +19 -8
- package/dist/collection/components/co-data-table/co-data-table.js +8 -3
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +16 -4
- package/dist/collection/components/co-date-field/co-date-field.js +19 -13
- package/dist/collection/components/co-date-picker/co-date-picker.js +38 -25
- package/dist/collection/components/co-date-range/co-date-range.js +19 -10
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +44 -30
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +31 -22
- package/dist/collection/components/co-document-editor/change-throttle.js +30 -0
- package/dist/collection/components/co-document-editor/co-document-editor.css +438 -0
- package/dist/collection/components/co-document-editor/co-document-editor.js +1549 -0
- package/dist/collection/components/co-document-editor/document-props.js +40 -0
- package/dist/collection/components/co-document-editor/header-tools.js +11 -0
- package/dist/collection/components/co-document-editor/image-bar.js +66 -0
- package/dist/collection/components/co-document-editor/page-styles.js +90 -0
- package/dist/collection/components/co-document-editor/zoom.js +45 -0
- package/dist/collection/components/co-drawer/co-drawer.css +5 -0
- package/dist/collection/components/co-drawer/co-drawer.js +13 -0
- package/dist/collection/components/co-drive-card/co-drive-card.js +14 -1
- package/dist/collection/components/co-drop-zone/co-drop-zone.js +7 -2
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.css +4 -0
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.js +11 -2
- package/dist/collection/components/co-empty-state/co-empty-state.js +4 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.js +16 -4
- package/dist/collection/components/co-event-popover/co-event-popover.js +18 -6
- package/dist/collection/components/co-fab/co-fab.css +8 -0
- package/dist/collection/components/co-fab/co-fab.js +17 -8
- package/dist/collection/components/co-file-field/co-file-field.js +16 -11
- package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +9 -2
- package/dist/collection/components/co-gradient-bar/co-gradient-bar.css +143 -0
- package/dist/collection/components/co-gradient-bar/co-gradient-bar.js +412 -0
- package/dist/collection/components/co-helper-text/co-helper-text.js +4 -2
- package/dist/collection/components/co-icon/co-icon.js +6 -2
- package/dist/collection/components/co-icon-button/co-icon-button.css +104 -19
- package/dist/collection/components/co-icon-button/co-icon-button.js +125 -10
- package/dist/collection/components/co-input/co-input.css +125 -0
- package/dist/collection/components/co-input/co-input.js +48 -11
- package/dist/collection/components/co-json-field/co-json-field.js +19 -12
- package/dist/collection/components/co-kbd/co-kbd.css +99 -0
- package/dist/collection/components/co-kbd/co-kbd.js +298 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +4 -4
- package/dist/collection/components/co-list-footer/co-list-footer.js +4 -1
- package/dist/collection/components/co-list-item/co-list-item.js +7 -4
- package/dist/collection/components/co-loader/co-loader.js +5 -0
- package/dist/collection/components/co-media-thumb/co-media-thumb.js +9 -2
- package/dist/collection/components/co-menu/co-menu.css +70 -0
- package/dist/collection/components/co-menu/co-menu.js +146 -6
- package/dist/collection/components/co-menu-divider/co-menu-divider.css +21 -0
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +2 -1
- package/dist/collection/components/co-menu-item/co-menu-item.css +56 -6
- package/dist/collection/components/co-menu-item/co-menu-item.js +60 -4
- package/dist/collection/components/co-modal/co-modal.css +218 -1
- package/dist/collection/components/co-modal/co-modal.js +354 -12
- package/dist/collection/components/co-navbar/co-navbar.css +7 -0
- package/dist/collection/components/co-navbar/co-navbar.js +4 -2
- package/dist/collection/components/co-number-field/co-number-field.js +29 -15
- package/dist/collection/components/co-option-list/co-option-list.css +102 -21
- package/dist/collection/components/co-option-list/co-option-list.js +37 -16
- package/dist/collection/components/co-overlay/co-overlay.css +4 -0
- package/dist/collection/components/co-overlay/co-overlay.js +17 -3
- package/dist/collection/components/co-page-header/co-page-header.js +4 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.css +20 -2
- package/dist/collection/components/co-popover/co-popover.js +148 -10
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +5 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +5 -2
- package/dist/collection/components/co-provider-logo/co-provider-logo.js +3 -0
- package/dist/collection/components/co-radio/co-radio.js +11 -3
- package/dist/collection/components/co-radio-group/co-radio-group.js +9 -4
- package/dist/collection/components/co-rating/co-rating.js +25 -13
- package/dist/collection/components/co-ref-field/co-ref-field.css +14 -0
- package/dist/collection/components/co-ref-field/co-ref-field.js +55 -27
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +66 -111
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +12 -0
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +127 -19
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +16 -1
- package/dist/collection/components/co-row/co-row.js +5 -2
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +9 -3
- package/dist/collection/components/co-select/co-select.css +207 -11
- package/dist/collection/components/co-select/co-select.js +198 -48
- package/dist/collection/components/co-select/virtualRows.js +57 -0
- package/dist/collection/components/co-separator/co-separator.js +8 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +10 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.css +15 -0
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +20 -4
- package/dist/collection/components/co-skeleton/co-skeleton.js +4 -1
- package/dist/collection/components/co-slider/co-slider.css +155 -5
- package/dist/collection/components/co-slider/co-slider.js +263 -32
- package/dist/collection/components/co-swatch-grid/co-swatch-grid.css +56 -0
- package/dist/collection/components/co-swatch-grid/co-swatch-grid.js +293 -0
- package/dist/collection/components/co-switch/co-switch.css +4 -0
- package/dist/collection/components/co-switch/co-switch.js +12 -3
- package/dist/collection/components/co-tab/co-tab.css +60 -0
- package/dist/collection/components/co-tab/co-tab.js +44 -6
- package/dist/collection/components/co-tab-group/co-tab-group.css +24 -0
- package/dist/collection/components/co-tab-group/co-tab-group.js +133 -2
- package/dist/collection/components/co-tab-group/revealTab.js +26 -0
- package/dist/collection/components/co-tags-field/co-tags-field.js +21 -14
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-tile/co-tile.css +63 -0
- package/dist/collection/components/co-tile/co-tile.js +167 -0
- package/dist/collection/components/co-time-field/co-time-field.js +9 -4
- package/dist/collection/components/co-toast/co-toast.css +11 -0
- package/dist/collection/components/co-toast/co-toast.js +13 -4
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +106 -0
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +91 -15
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +21 -0
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +41 -11
- package/dist/collection/components/co-tooltip/co-tooltip.css +36 -0
- package/dist/collection/components/co-tooltip/co-tooltip.js +61 -3
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +19 -10
- package/dist/collection/components/co-tree-item/co-tree-item.css +235 -0
- package/dist/collection/components/co-tree-item/co-tree-item.js +355 -0
- package/dist/collection/components/co-tree-item/treeItemI18n.js +16 -0
- package/dist/collection/components/co-video/co-video.css +11 -0
- package/dist/collection/components/co-video/co-video.js +41 -22
- package/dist/collection/utils/color.js +9 -5
- package/dist/collection/utils/dragMove.js +95 -0
- package/dist/collection/utils/gradientBarI18n.js +24 -0
- package/dist/collection/utils/gradientStops.js +142 -0
- package/dist/collection/utils/hsv.js +114 -0
- package/dist/collection/utils/kbdI18n.js +29 -0
- package/dist/collection/utils/positioning.js +44 -18
- package/dist/collection/utils/rich-text-host.js +109 -0
- package/dist/collection/utils/richTextI18n.js +45 -0
- package/dist/collection/utils/submenu.js +23 -3
- package/dist/collection/utils/swatchGridI18n.js +14 -0
- package/dist/collection/utils/test/fake-block-layout.js +41 -0
- package/dist/collection/utils/test/prosemirror-dom-shim.js +17 -0
- package/dist/collection/utils/test/shared-contract-css.js +9 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-app-shell.js +1 -1
- package/dist/components/co-audio-player.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-badge.js +1 -1
- package/dist/components/co-bottom-sheet.js +1 -1
- package/dist/components/co-breadcrumb-item.js +1 -1
- package/dist/components/co-breadcrumb.js +1 -1
- package/dist/components/co-button-group.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.js +1 -1
- package/dist/components/co-calendar.js +1 -1
- package/dist/components/co-card.js +1 -1
- package/dist/components/co-carousel-item.js +1 -1
- package/dist/components/co-carousel.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-area.d.ts +11 -0
- package/dist/components/co-color-area.js +1 -0
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-color-slider.d.ts +11 -0
- package/dist/components/co-color-slider.js +1 -0
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-field.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-document-editor.d.ts +11 -0
- package/dist/components/co-document-editor.js +1 -0
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-drive-card.js +1 -1
- package/dist/components/co-drop-zone.js +1 -1
- package/dist/components/co-emoji-picker.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-event-popover.js +1 -1
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-file-type-tile.js +1 -1
- package/dist/components/co-gradient-bar.d.ts +11 -0
- package/dist/components/co-gradient-bar.js +1 -0
- package/dist/components/co-helper-text.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-icon.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-json-field.js +1 -1
- package/dist/components/co-kbd.d.ts +11 -0
- package/dist/components/co-kbd.js +1 -0
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-footer.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-media-thumb.js +1 -1
- package/dist/components/co-menu-divider.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.js +1 -1
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- package/dist/components/co-radio-group.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.js +1 -1
- package/dist/components/co-rich-text-toolbar.js +1 -1
- package/dist/components/co-rich-text-viewer.js +1 -1
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-segmented-bar.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-skeleton.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-swatch-grid.d.ts +11 -0
- package/dist/components/co-swatch-grid.js +1 -0
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.js +1 -1
- package/dist/components/co-textarea.js +1 -1
- package/dist/components/co-tile.d.ts +11 -0
- package/dist/components/co-tile.js +1 -0
- package/dist/components/co-time-field.js +1 -1
- package/dist/components/co-toast.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/co-tree-item.d.ts +11 -0
- package/dist/components/co-tree-item.js +1 -0
- package/dist/components/co-video.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-8XzG8pzY.js +1 -0
- package/dist/components/p-9VoFSbIH.js +1 -0
- package/dist/components/p-B1JT7us1.js +1 -0
- package/dist/components/{p-Dc_Kbari.js → p-B3Egz082.js} +1 -1
- package/dist/components/p-B9wdMd_0.js +1 -0
- package/dist/components/p-BRZci8B3.js +1 -0
- package/dist/components/{p-BRbgGqLw.js → p-BVGGRfNG.js} +1 -1
- package/dist/components/{p-B56LX2SH.js → p-BVdCvEza.js} +1 -1
- package/dist/components/p-BdmzslA5.js +1 -0
- package/dist/components/p-BmdKHBZP.js +1 -0
- package/dist/components/p-BtliEQAT.js +1 -0
- package/dist/components/{p-CT2enQ6h.js → p-Bw_b_czs.js} +1 -1
- package/dist/components/{p-NNxjElcX.js → p-C4sZjIDj.js} +1 -1
- package/dist/components/{p-Nt4JJxbL.js → p-C6WHpL5X.js} +1 -1
- package/dist/components/p-COJdaKBU.js +1 -0
- package/dist/components/p-COozgrEk.js +1 -0
- package/dist/components/{p-BAYo-RBt.js → p-CRxTFT_z.js} +1 -1
- package/dist/components/{p-uxdXViMV.js → p-CiYPJW0B.js} +1 -1
- package/dist/components/p-Cnfd6Zze.js +1 -0
- package/dist/components/{p-BhCVadcA.js → p-CxWo3qDo.js} +1 -1
- package/dist/components/p-D4XP17VP.js +1 -0
- package/dist/components/{p-e5KibEs8.js → p-DJ468fPu.js} +1 -1
- package/dist/components/p-DU-KOQ8L.js +1 -0
- package/dist/components/p-DXLeDZvr.js +1 -0
- package/dist/components/{p-DvR45CLa.js → p-Dn2wblrA.js} +1 -1
- package/dist/components/p-Dnz99Ox_.js +1 -0
- package/dist/components/p-DsuFNmTI.js +1 -0
- package/dist/components/{p-Du_CgT5E.js → p-Du8EpQb-.js} +1 -1
- package/dist/components/{p-DFlJMEJ-.js → p-DymSqdlK.js} +1 -1
- package/dist/components/p-Hi57w2_2.js +1 -0
- package/dist/components/{p-DNJAIVfI.js → p-KK2vAKs-.js} +1 -1
- package/dist/components/p-RVQJEYxa.js +1 -0
- package/dist/components/p-TGRbLkLz.js +1 -0
- package/dist/components/p-VcrjNCew.js +1 -0
- package/dist/components/{p-Dxa7c4Ap.js → p-dnaee7fS.js} +1 -1
- package/dist/components/p-nrwDl_gx.js +1 -0
- package/dist/components/{p-P4HlMBlL.js → p-zJ3pjFzW.js} +1 -1
- package/dist/esm/co-accordion.entry.js +3 -3
- package/dist/esm/co-action-bar.entry.js +3 -3
- package/dist/esm/co-app-shell.entry.js +3 -3
- package/dist/esm/co-audio-player.entry.js +4 -4
- package/dist/esm/co-autocomplete.entry.js +12 -5
- package/dist/esm/co-avatar-group.entry.js +3 -3
- package/dist/esm/co-avatar.entry.js +7 -4
- package/dist/esm/co-badge.entry.js +2 -2
- package/dist/esm/co-bottom-sheet.entry.js +5 -5
- package/dist/esm/co-breadcrumb-item.entry.js +3 -3
- package/dist/esm/co-breadcrumb.entry.js +2 -2
- package/dist/esm/co-button-group.entry.js +4 -3
- package/dist/esm/co-button.entry.js +9 -7
- package/dist/esm/co-calendar-month_2.entry.js +16 -4
- package/dist/esm/co-calendar_3.entry.js +76 -27
- package/dist/esm/co-card.entry.js +3 -3
- package/dist/esm/co-carousel-item.entry.js +2 -2
- package/dist/esm/co-carousel.entry.js +6 -3
- package/dist/esm/co-checkbox-group.entry.js +4 -4
- package/dist/esm/co-checkbox.entry.js +13 -5
- package/dist/esm/co-chip_2.entry.js +20 -7
- package/dist/esm/co-color-area.entry.js +167 -0
- package/dist/esm/co-color-picker.entry.js +5 -5
- package/dist/esm/co-color-slider.entry.js +187 -0
- package/dist/esm/co-column-picker.entry.js +23 -3
- package/dist/esm/co-combobox.entry.js +5 -5
- package/dist/esm/co-command-search.entry.js +5 -5
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +3 -3
- package/dist/esm/co-date-picker.entry.js +10 -2
- package/dist/esm/co-date-range-picker.entry.js +11 -2
- package/dist/esm/co-date-range.entry.js +8 -2
- package/dist/esm/co-date-time-picker.entry.js +11 -4
- package/dist/esm/co-document-editor.entry.js +1165 -0
- package/dist/esm/co-drive-card.entry.js +2 -2
- package/dist/esm/co-drop-zone.entry.js +2 -2
- package/dist/esm/co-emoji-picker.entry.js +3 -3
- package/dist/esm/co-empty-state.entry.js +3 -3
- package/dist/esm/co-event-calendar.entry.js +5 -3
- package/dist/esm/co-event-popover.entry.js +7 -3
- package/dist/esm/co-fab.entry.js +7 -3
- package/dist/esm/co-file-field.entry.js +12 -8
- package/dist/esm/co-file-type-tile.entry.js +3 -3
- package/dist/esm/co-gradient-bar.entry.js +218 -0
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +48 -9
- package/dist/esm/co-icon.entry.js +3 -3
- package/dist/esm/co-input.entry.js +14 -8
- package/dist/esm/co-json-field.entry.js +10 -5
- package/dist/esm/{co-tooltip.entry.js → co-kbd_2.entry.js} +194 -7
- package/dist/esm/co-lightbox.entry.js +5 -5
- package/dist/esm/co-list-footer.entry.js +2 -2
- package/dist/esm/co-list-item.entry.js +5 -5
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-media-thumb.entry.js +3 -3
- package/dist/esm/co-menu-divider.entry.js +3 -3
- package/dist/esm/co-menu-item.entry.js +39 -41
- package/dist/esm/co-menu.entry.js +81 -5
- package/dist/esm/co-modal.entry.js +350 -7
- package/dist/esm/co-navbar.entry.js +3 -3
- package/dist/esm/co-number-field.entry.js +11 -5
- package/dist/esm/co-overlay.entry.js +8 -4
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +3 -3
- package/dist/esm/co-popover.entry.js +69 -6
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +3 -3
- package/dist/esm/co-provider-logo_2.entry.js +2 -2
- package/dist/esm/co-radio-group.entry.js +4 -4
- package/dist/esm/co-radio.entry.js +4 -4
- package/dist/esm/co-rating.entry.js +11 -4
- package/dist/esm/co-ref-field.entry.js +14 -5
- package/dist/esm/co-rich-text-editor.entry.js +40 -92
- package/dist/esm/co-rich-text-toolbar.entry.js +80 -20
- package/dist/esm/co-rich-text-viewer.entry.js +9 -2
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-segmented-bar.entry.js +3 -3
- package/dist/esm/co-select.entry.js +171 -29
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +20 -5
- package/dist/esm/co-sidebar.entry.js +3 -3
- package/dist/esm/co-slider.entry.js +209 -23
- package/dist/esm/co-swatch-grid.entry.js +119 -0
- package/dist/esm/co-switch.entry.js +5 -5
- package/dist/esm/co-tab-group.entry.js +113 -4
- package/dist/esm/co-tab.entry.js +15 -5
- package/dist/esm/co-tags-field.entry.js +13 -8
- package/dist/esm/co-textarea.entry.js +6 -6
- package/dist/esm/co-tile.entry.js +59 -0
- package/dist/esm/co-time-field.entry.js +5 -2
- package/dist/esm/co-toast.entry.js +3 -3
- package/dist/esm/co-toggle-button-group.entry.js +29 -5
- package/dist/esm/co-toggle-button.entry.js +70 -6
- package/dist/esm/co-transfer-list.entry.js +7 -3
- package/dist/esm/co-tree-item.entry.js +108 -0
- package/dist/esm/co-video.entry.js +11 -3
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/{color-BRbgGqLw.js → color-BVGGRfNG.js} +10 -6
- package/dist/esm/{fieldChip-uyggU8VV.js → fieldChip-B2ctp2m6.js} +1 -1
- package/dist/esm/gradientStops-DDK0y8ra.js +145 -0
- package/dist/esm/hsv-COJdaKBU.js +90 -0
- package/dist/esm/index-Cpo8HTwr.js +142 -0
- package/dist/esm/{index-DH5lfRNj.js → index-DJkaRtbb.js} +67 -28
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{index-BBIYyvq-.js → pagination-D9OfZUnY.js} +1728 -297
- package/dist/esm/{positioning-DFHRS9cJ.js → positioning-BtliEQAT.js} +45 -19
- package/dist/esm/{requiredMark-BCJUuZvC.js → requiredMark-D5C5NzOE.js} +1 -1
- package/dist/esm/rich-text-host-BmdKHBZP.js +111 -0
- package/dist/esm/{richTextI18n-BYKAgwq3.js → richTextI18n-xnrKkNWQ.js} +45 -0
- package/dist/esm/submenu-DU-KOQ8L.js +57 -0
- package/dist/esm/{toolbar-config-BAYo-RBt.js → toolbar-config-CRxTFT_z.js} +32 -0
- package/dist/types/components/co-accordion/co-accordion.d.ts +10 -0
- package/dist/types/components/co-action-bar/co-action-bar.d.ts +1 -0
- package/dist/types/components/co-app-shell/co-app-shell.d.ts +11 -0
- package/dist/types/components/co-audio-player/co-audio-player.d.ts +16 -0
- package/dist/types/components/co-autocomplete/co-autocomplete.d.ts +21 -0
- package/dist/types/components/co-avatar/co-avatar.d.ts +11 -2
- package/dist/types/components/co-avatar-group/co-avatar-group.d.ts +5 -0
- package/dist/types/components/co-badge/co-badge.d.ts +7 -0
- package/dist/types/components/co-bottom-sheet/co-bottom-sheet.d.ts +9 -0
- package/dist/types/components/co-breadcrumb/co-breadcrumb.d.ts +4 -0
- package/dist/types/components/co-breadcrumb-item/co-breadcrumb-item.d.ts +6 -0
- package/dist/types/components/co-button/co-button.d.ts +12 -4
- package/dist/types/components/co-button-group/co-button-group.d.ts +7 -0
- package/dist/types/components/co-calendar/calendarMarks.d.ts +15 -0
- package/dist/types/components/co-calendar/co-calendar.d.ts +18 -0
- package/dist/types/components/co-calendar-timegrid/co-calendar-timegrid.d.ts +23 -0
- package/dist/types/components/co-card/co-card.d.ts +9 -0
- package/dist/types/components/co-carousel/co-carousel.d.ts +12 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +15 -0
- package/dist/types/components/co-checkbox-group/co-checkbox-group.d.ts +5 -0
- package/dist/types/components/co-chip/co-chip.d.ts +13 -0
- package/dist/types/components/co-color-area/co-color-area.d.ts +65 -0
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +2 -0
- package/dist/types/components/co-color-slider/co-color-slider.d.ts +62 -0
- package/dist/types/components/co-column-picker/co-column-picker.d.ts +32 -0
- package/dist/types/components/co-combobox/co-combobox.d.ts +14 -0
- package/dist/types/components/co-command-search/co-command-search.d.ts +15 -0
- package/dist/types/components/co-data-table/co-data-table.d.ts +5 -0
- package/dist/types/components/co-data-table-pagination/co-data-table-pagination.d.ts +12 -0
- package/dist/types/components/co-date-field/co-date-field.d.ts +11 -0
- package/dist/types/components/co-date-picker/co-date-picker.d.ts +30 -0
- package/dist/types/components/co-date-range/co-date-range.d.ts +12 -0
- package/dist/types/components/co-date-range-picker/co-date-range-picker.d.ts +33 -0
- package/dist/types/components/co-date-time-picker/co-date-time-picker.d.ts +22 -1
- package/dist/types/components/co-document-editor/change-throttle.d.ts +9 -0
- package/dist/types/components/co-document-editor/co-document-editor.d.ts +284 -0
- package/dist/types/components/co-document-editor/document-props.d.ts +6 -0
- package/dist/types/components/co-document-editor/header-tools.d.ts +11 -0
- package/dist/types/components/co-document-editor/image-bar.d.ts +50 -0
- package/dist/types/components/co-document-editor/page-styles.d.ts +1 -0
- package/dist/types/components/co-document-editor/zoom.d.ts +26 -0
- package/dist/types/components/co-drawer/co-drawer.d.ts +13 -0
- package/dist/types/components/co-drive-card/co-drive-card.d.ts +13 -0
- package/dist/types/components/co-drop-zone/co-drop-zone.d.ts +6 -1
- package/dist/types/components/co-emoji-picker/co-emoji-picker.d.ts +9 -0
- package/dist/types/components/co-empty-state/co-empty-state.d.ts +2 -0
- package/dist/types/components/co-event-calendar/co-event-calendar.d.ts +12 -16
- package/dist/types/components/co-event-popover/co-event-popover.d.ts +13 -0
- package/dist/types/components/co-fab/co-fab.d.ts +11 -0
- package/dist/types/components/co-file-field/co-file-field.d.ts +6 -0
- package/dist/types/components/co-file-type-tile/co-file-type-tile.d.ts +7 -0
- package/dist/types/components/co-gradient-bar/co-gradient-bar.d.ts +77 -0
- package/dist/types/components/co-helper-text/co-helper-text.d.ts +2 -0
- package/dist/types/components/co-icon/co-icon.d.ts +4 -0
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +39 -2
- package/dist/types/components/co-input/co-input.d.ts +25 -5
- package/dist/types/components/co-json-field/co-json-field.d.ts +11 -0
- package/dist/types/components/co-kbd/co-kbd.d.ts +50 -0
- package/dist/types/components/co-list-footer/co-list-footer.d.ts +3 -0
- package/dist/types/components/co-list-item/co-list-item.d.ts +3 -0
- package/dist/types/components/co-loader/co-loader.d.ts +5 -0
- package/dist/types/components/co-media-thumb/co-media-thumb.d.ts +7 -0
- package/dist/types/components/co-menu/co-menu.d.ts +42 -1
- package/dist/types/components/co-menu-divider/co-menu-divider.d.ts +1 -0
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +19 -0
- package/dist/types/components/co-modal/co-modal.d.ts +126 -5
- package/dist/types/components/co-navbar/co-navbar.d.ts +2 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +20 -0
- package/dist/types/components/co-option-list/co-option-list.d.ts +29 -1
- package/dist/types/components/co-option-list/optionListLogic.d.ts +3 -0
- package/dist/types/components/co-overlay/co-overlay.d.ts +10 -0
- package/dist/types/components/co-page-header/co-page-header.d.ts +3 -0
- package/dist/types/components/co-popover/co-popover.d.ts +51 -0
- package/dist/types/components/co-progress-bar/co-progress-bar.d.ts +3 -0
- package/dist/types/components/co-progress-circle/co-progress-circle.d.ts +3 -0
- package/dist/types/components/co-provider-logo/co-provider-logo.d.ts +3 -0
- package/dist/types/components/co-radio/co-radio.d.ts +8 -0
- package/dist/types/components/co-radio-group/co-radio-group.d.ts +5 -0
- package/dist/types/components/co-rating/co-rating.d.ts +15 -0
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +42 -0
- package/dist/types/components/co-rich-text-editor/co-rich-text-editor.d.ts +31 -5
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +20 -2
- package/dist/types/components/co-rich-text-viewer/co-rich-text-viewer.d.ts +8 -0
- package/dist/types/components/co-row/co-row.d.ts +3 -0
- package/dist/types/components/co-segmented-bar/co-segmented-bar.d.ts +6 -0
- package/dist/types/components/co-select/co-select.d.ts +73 -5
- package/dist/types/components/co-select/virtualRows.d.ts +44 -0
- package/dist/types/components/co-separator/co-separator.d.ts +7 -0
- package/dist/types/components/co-sidebar/co-sidebar.d.ts +8 -0
- package/dist/types/components/co-sidebar-nav/co-sidebar-nav.d.ts +1 -0
- package/dist/types/components/co-skeleton/co-skeleton.d.ts +3 -0
- package/dist/types/components/co-slider/co-slider.d.ts +160 -1
- package/dist/types/components/co-swatch-grid/co-swatch-grid.d.ts +38 -0
- package/dist/types/components/co-switch/co-switch.d.ts +9 -0
- package/dist/types/components/co-tab/co-tab.d.ts +20 -2
- package/dist/types/components/co-tab-group/co-tab-group.d.ts +46 -0
- package/dist/types/components/co-tab-group/revealTab.d.ts +29 -0
- package/dist/types/components/co-tags-field/co-tags-field.d.ts +11 -0
- package/dist/types/components/co-tile/co-tile.d.ts +45 -0
- package/dist/types/components/co-time-field/co-time-field.d.ts +5 -0
- package/dist/types/components/co-toast/co-toast.d.ts +9 -0
- package/dist/types/components/co-toggle-button/co-toggle-button.d.ts +45 -2
- package/dist/types/components/co-toggle-button-group/co-toggle-button-group.d.ts +30 -2
- package/dist/types/components/co-tooltip/co-tooltip.d.ts +22 -0
- package/dist/types/components/co-transfer-list/co-transfer-list.d.ts +12 -0
- package/dist/types/components/co-tree-item/co-tree-item.d.ts +75 -0
- package/dist/types/components/co-tree-item/treeItemI18n.d.ts +6 -0
- package/dist/types/components/co-video/co-video.d.ts +31 -0
- package/dist/types/components.d.ts +3905 -85
- package/dist/types/utils/color.d.ts +9 -1
- package/dist/types/utils/dragMove.d.ts +63 -0
- package/dist/types/utils/gradientBarI18n.d.ts +8 -0
- package/dist/types/utils/gradientStops.d.ts +63 -0
- package/dist/types/utils/hsv.d.ts +44 -0
- package/dist/types/utils/kbdI18n.d.ts +25 -0
- package/dist/types/utils/positioning.d.ts +24 -0
- package/dist/types/utils/rich-text-host.d.ts +41 -0
- package/dist/types/utils/richTextI18n.d.ts +15 -0
- package/dist/types/utils/submenu.d.ts +16 -2
- package/dist/types/utils/swatchGridI18n.d.ts +6 -0
- package/dist/types/utils/test/fake-block-layout.d.ts +7 -0
- package/dist/types/utils/test/prosemirror-dom-shim.d.ts +1 -0
- package/dist/types/utils/test/shared-contract-css.d.ts +9 -0
- package/package.json +5 -5
- package/dist/cobalt/p-0678c797.entry.js +0 -1
- package/dist/cobalt/p-1d3a79af.entry.js +0 -1
- package/dist/cobalt/p-216a63ee.entry.js +0 -1
- package/dist/cobalt/p-3d31c575.entry.js +0 -1
- package/dist/cobalt/p-416795f5.entry.js +0 -1
- package/dist/cobalt/p-56551580.entry.js +0 -1
- package/dist/cobalt/p-58137c9e.entry.js +0 -1
- package/dist/cobalt/p-5a3e4c81.entry.js +0 -1
- package/dist/cobalt/p-5c756787.entry.js +0 -1
- package/dist/cobalt/p-67f3b9d6.entry.js +0 -1
- package/dist/cobalt/p-6a4f3179.entry.js +0 -1
- package/dist/cobalt/p-71cbc53c.entry.js +0 -1
- package/dist/cobalt/p-72e52af7.entry.js +0 -1
- package/dist/cobalt/p-8530ad16.entry.js +0 -1
- package/dist/cobalt/p-8a74bf7d.entry.js +0 -1
- package/dist/cobalt/p-8e05b979.entry.js +0 -1
- package/dist/cobalt/p-8ebc0c12.entry.js +0 -1
- package/dist/cobalt/p-8f2199ff.entry.js +0 -1
- package/dist/cobalt/p-9246e09c.entry.js +0 -1
- package/dist/cobalt/p-99a655f6.entry.js +0 -1
- package/dist/cobalt/p-BYKAgwq3.js +0 -1
- package/dist/cobalt/p-CJW9H3Gi.js +0 -1
- package/dist/cobalt/p-DFHRS9cJ.js +0 -1
- package/dist/cobalt/p-DH5lfRNj.js +0 -2
- package/dist/cobalt/p-a1b422ca.entry.js +0 -1
- package/dist/cobalt/p-ade07307.entry.js +0 -1
- package/dist/cobalt/p-b0762fd8.entry.js +0 -1
- package/dist/cobalt/p-b698188c.entry.js +0 -1
- package/dist/cobalt/p-bde32f8b.entry.js +0 -1
- package/dist/cobalt/p-d375014b.entry.js +0 -1
- package/dist/cobalt/p-db805569.entry.js +0 -1
- package/dist/cobalt/p-e3aae282.entry.js +0 -1
- package/dist/cobalt/p-e49a564c.entry.js +0 -1
- package/dist/cobalt/p-ef301976.entry.js +0 -1
- package/dist/cobalt/p-fMqVDypp.js +0 -1
- package/dist/components/p-2EOI1nrz.js +0 -1
- package/dist/components/p-7TncUlLN.js +0 -1
- package/dist/components/p-B4NCaKrR.js +0 -1
- package/dist/components/p-BGDqldEg.js +0 -1
- package/dist/components/p-BJh68Jqe.js +0 -1
- package/dist/components/p-BrAFTkAn.js +0 -1
- package/dist/components/p-Bsh0JMGf.js +0 -1
- package/dist/components/p-CJW9H3Gi.js +0 -1
- package/dist/components/p-CWCYYQrF.js +0 -1
- package/dist/components/p-D9T7zKeL.js +0 -1
- package/dist/components/p-DFHRS9cJ.js +0 -1
- package/dist/components/p-DTPYZwaZ.js +0 -1
- package/dist/components/p-Dcg4krSX.js +0 -1
- package/dist/components/p-Dh8ffSjK.js +0 -1
|
@@ -0,0 +1,1165 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, a as getElement } from './index-DJkaRtbb.js';
|
|
2
|
+
import { g as getRichTextStrings } from './richTextI18n-xnrKkNWQ.js';
|
|
3
|
+
import { b as parseFeatures, s as syncToolbarEditor } from './rich-text-host-BmdKHBZP.js';
|
|
4
|
+
import { B as getImageLayoutMode, F as FIELD_SYNC_META, E as headerImageWidth, w as writePrintHtml, r as readPrintHtml, Q as resolvePageSize, s as sanitize, q as Pagination, x as collectFields, z as createEditor, W as setFieldValuesInHtml, I as IMAGE_LAYOUT_MODES, P as PAGE_GAP_PX, G as layoutBox } from './pagination-D9OfZUnY.js';
|
|
5
|
+
import './purify.es-B2QLgWrz.js';
|
|
6
|
+
|
|
7
|
+
/** Ventana de `coChange`: avisa como mucho cada 250 ms (nunca por tecla). */
|
|
8
|
+
const DOC_CHANGE_THROTTLE_MS = 250;
|
|
9
|
+
function createThrottle(ms, fn) {
|
|
10
|
+
let timer = null;
|
|
11
|
+
return {
|
|
12
|
+
run() {
|
|
13
|
+
if (timer)
|
|
14
|
+
return;
|
|
15
|
+
timer = setTimeout(() => {
|
|
16
|
+
timer = null;
|
|
17
|
+
fn();
|
|
18
|
+
}, ms);
|
|
19
|
+
},
|
|
20
|
+
flush() {
|
|
21
|
+
if (!timer)
|
|
22
|
+
return;
|
|
23
|
+
clearTimeout(timer);
|
|
24
|
+
timer = null;
|
|
25
|
+
fn();
|
|
26
|
+
},
|
|
27
|
+
cancel() {
|
|
28
|
+
if (timer)
|
|
29
|
+
clearTimeout(timer);
|
|
30
|
+
timer = null;
|
|
31
|
+
},
|
|
32
|
+
get pending() {
|
|
33
|
+
return timer !== null;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const DEFAULT_MARGINS = { top: 38, right: 38, bottom: 38, left: 38 };
|
|
39
|
+
const NAMED = new Set(['letter', 'a4', 'legal']);
|
|
40
|
+
/** `true` o `'true'`. Un `'false'` que dejó el multipart de V1 cuenta como falso (spec §3.6). */
|
|
41
|
+
function toBoolIntent(v) {
|
|
42
|
+
return v === true || v === 'true';
|
|
43
|
+
}
|
|
44
|
+
function parsePageSize(v) {
|
|
45
|
+
if (typeof v === 'string') {
|
|
46
|
+
if (NAMED.has(v))
|
|
47
|
+
return v;
|
|
48
|
+
try {
|
|
49
|
+
return parsePageSize(JSON.parse(v));
|
|
50
|
+
}
|
|
51
|
+
catch (_a) {
|
|
52
|
+
return 'letter';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (v && typeof v === 'object') {
|
|
56
|
+
const { width, height } = v;
|
|
57
|
+
if (Number(width) > 0 && Number(height) > 0)
|
|
58
|
+
return { width: Number(width), height: Number(height) };
|
|
59
|
+
}
|
|
60
|
+
return 'letter';
|
|
61
|
+
}
|
|
62
|
+
function parseMargins(v) {
|
|
63
|
+
let raw = v;
|
|
64
|
+
if (typeof v === 'string') {
|
|
65
|
+
try {
|
|
66
|
+
raw = JSON.parse(v);
|
|
67
|
+
}
|
|
68
|
+
catch (_a) {
|
|
69
|
+
return Object.assign({}, DEFAULT_MARGINS);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!raw || typeof raw !== 'object')
|
|
73
|
+
return Object.assign({}, DEFAULT_MARGINS);
|
|
74
|
+
const m = raw;
|
|
75
|
+
const pick = (k) => (Number.isFinite(Number(m[k])) && m[k] !== undefined ? Number(m[k]) : DEFAULT_MARGINS[k]);
|
|
76
|
+
return { top: pick('top'), right: pick('right'), bottom: pick('bottom'), left: pick('left') };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Acota el CSS de impresión del host (SharedContractUtils: editorCss + defaultCss)
|
|
81
|
+
* a UNA hoja: cada selector queda bajo `:where(scope)`; `*`, `html`, `body` y `:root`
|
|
82
|
+
* pasan a ser la hoja (el `*` global de defaultCss no puede escapar a la página).
|
|
83
|
+
* Se entra en @media/@supports, se conserva @keyframes y se descartan las
|
|
84
|
+
* reglas que no aplican a pantalla o traerían red (@page, @font-face, @import).
|
|
85
|
+
*/
|
|
86
|
+
const DROP_STATEMENTS = /@(import|charset|namespace)[^;]*;/gi;
|
|
87
|
+
function scopePageStyles(css, scope) {
|
|
88
|
+
if (!css)
|
|
89
|
+
return '';
|
|
90
|
+
const src = css.replace(/\/\*[\s\S]*?\*\//g, '').replace(DROP_STATEMENTS, '');
|
|
91
|
+
return scopeBlock(src, scope).trim();
|
|
92
|
+
}
|
|
93
|
+
function matchingBrace(src, open) {
|
|
94
|
+
let depth = 0;
|
|
95
|
+
let quote = null;
|
|
96
|
+
for (let i = open; i < src.length; i += 1) {
|
|
97
|
+
const c = src[i];
|
|
98
|
+
if (quote) {
|
|
99
|
+
if (c === quote && src[i - 1] !== '\\')
|
|
100
|
+
quote = null;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (c === '"' || c === "'")
|
|
104
|
+
quote = c;
|
|
105
|
+
else if (c === '{')
|
|
106
|
+
depth += 1;
|
|
107
|
+
else if (c === '}') {
|
|
108
|
+
depth -= 1;
|
|
109
|
+
if (depth === 0)
|
|
110
|
+
return i;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return -1;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* El scope va dentro de `:where()`: especificidad 0. Cada regla del host conserva la
|
|
117
|
+
* especificidad que tenía en el PDF, y la geometría propia de la hoja (clases del
|
|
118
|
+
* componente, ≥ (0,1,0)) le gana a sus resets (`* { padding: 0 }`, `.tiptap table td`…).
|
|
119
|
+
*
|
|
120
|
+
* Excepción del `*`: en el PDF es CSS de autor y le gana a la UA de `pre`/`code`
|
|
121
|
+
* (`font-family: monospace`). En la app, el normalize global (Quasar: `code, kbd, pre, samp
|
|
122
|
+
* { font-family: monospace }`, (0,0,1)) es de autor y le ganaba al `:where(scope) *` (0,0,0):
|
|
123
|
+
* un bloque de código medía distinto en la hoja que en el PDF. `:where(scope) :is(pre, code)`
|
|
124
|
+
* sube el reset a (0,0,1): empata con el normalize y gana por orden (el `<style>` de la hoja
|
|
125
|
+
* vive dentro del documento, después de las hojas globales del `<head>`), y sigue perdiendo
|
|
126
|
+
* contra cualquier regla del host más específica o posterior (`.tiptap pre`, `pre {…}`), como en
|
|
127
|
+
* el PDF. `inherit` desde la hoja no sirve: un `pre` hijo directo de `.ProseMirror` heredaría la
|
|
128
|
+
* fuente del contenedor (Geist) y no la del `*` (Roboto) que ve el PDF.
|
|
129
|
+
*/
|
|
130
|
+
function scopeSelector(sel, scope) {
|
|
131
|
+
const s = sel.trim();
|
|
132
|
+
if (!s)
|
|
133
|
+
return '';
|
|
134
|
+
const root = `:where(${scope})`;
|
|
135
|
+
if (s === '*')
|
|
136
|
+
return `${root}, ${root} *, ${root} :is(pre, code)`;
|
|
137
|
+
const rest = s.replace(/^(?:(?:html|body|:root)(?=$|[\s>+~.#:[])\s*)+/i, '').trim();
|
|
138
|
+
return rest ? `${root} ${rest}` : root;
|
|
139
|
+
}
|
|
140
|
+
function scopeBlock(src, scope) {
|
|
141
|
+
let out = '';
|
|
142
|
+
let i = 0;
|
|
143
|
+
while (i < src.length) {
|
|
144
|
+
const open = src.indexOf('{', i);
|
|
145
|
+
if (open === -1)
|
|
146
|
+
break;
|
|
147
|
+
const close = matchingBrace(src, open);
|
|
148
|
+
if (close === -1)
|
|
149
|
+
break;
|
|
150
|
+
const prelude = src.slice(i, open).trim();
|
|
151
|
+
const body = src.slice(open + 1, close);
|
|
152
|
+
i = close + 1;
|
|
153
|
+
if (!prelude)
|
|
154
|
+
continue;
|
|
155
|
+
if (prelude.startsWith('@')) {
|
|
156
|
+
const at = prelude.slice(1).split(/[\s(]/)[0].toLowerCase();
|
|
157
|
+
if (at === 'media' || at === 'supports')
|
|
158
|
+
out += `${prelude}{${scopeBlock(body, scope)}}`;
|
|
159
|
+
else if (at.endsWith('keyframes'))
|
|
160
|
+
out += `${prelude}{${body}}`;
|
|
161
|
+
continue; // @page, @font-face y cualquier otra at-rule: fuera
|
|
162
|
+
}
|
|
163
|
+
const selectors = prelude.split(',').map((x) => scopeSelector(x, scope)).filter(Boolean);
|
|
164
|
+
if (selectors.length)
|
|
165
|
+
out += `${selectors.join(', ')}{${body}}`;
|
|
166
|
+
}
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Aire lateral que se descuenta del lienzo al ajustar al ancho (2 × --co-spacing-lg). */
|
|
171
|
+
const ZOOM_GUTTER_PX = 32;
|
|
172
|
+
/** Escala para que la hoja entre en el ancho disponible: nunca agranda, nunca baja de 25 %. */
|
|
173
|
+
function fitScale(available, pageWidth) {
|
|
174
|
+
if (!(available > 0) || !(pageWidth > 0))
|
|
175
|
+
return 1;
|
|
176
|
+
const s = Math.min(1, Math.max(0.25, available / pageWidth));
|
|
177
|
+
return Math.round(s * 1000) / 1000;
|
|
178
|
+
}
|
|
179
|
+
/** Tope del zoom libre (pinza / ctrl+rueda). El piso es el mismo de «Ajustar al ancho». */
|
|
180
|
+
const ZOOM_MIN = 0.25;
|
|
181
|
+
const ZOOM_MAX = 3;
|
|
182
|
+
/** Acota la escala a [ZOOM_MIN, ZOOM_MAX] y la redondea a milésimas (NaN → 1). */
|
|
183
|
+
function clampScale(scale) {
|
|
184
|
+
if (!Number.isFinite(scale))
|
|
185
|
+
return 1;
|
|
186
|
+
return Math.round(Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, scale)) * 1000) / 1000;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Nueva escala para un evento `wheel` con ctrlKey (la pinza del trackpad llega así en Chrome,
|
|
190
|
+
* Edge y Firefox; también ctrl+rueda del mouse). Exponencial: acercar y alejar el mismo delta
|
|
191
|
+
* vuelve al punto de partida, y la velocidad se siente igual a cualquier escala.
|
|
192
|
+
*/
|
|
193
|
+
function pinchScale(current, deltaY) {
|
|
194
|
+
if (!Number.isFinite(deltaY))
|
|
195
|
+
return current;
|
|
196
|
+
return clampScale(current * Math.exp(-deltaY * 0.01));
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Punto del papel (px de layout, sin escala) bajo el cursor: `stageStart` es el borde de la hoja
|
|
200
|
+
* escalada en pantalla (getBoundingClientRect), `scale` la escala que el DOM refleja HOY.
|
|
201
|
+
*/
|
|
202
|
+
function paperPoint(client, stageStart, scale) {
|
|
203
|
+
if (!(scale > 0))
|
|
204
|
+
return 0;
|
|
205
|
+
return (client - stageStart) / scale;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Cuánto hay que correr el scroll para que el punto `paper` vuelva a quedar bajo el cursor,
|
|
209
|
+
* medido DESPUÉS del render con la escala nueva (la hoja está centrada y el lienzo tiene
|
|
210
|
+
* relleno fijo: predecir la posición falla, medirla no).
|
|
211
|
+
*/
|
|
212
|
+
function anchorCorrection(stageStart, paper, scale, client) {
|
|
213
|
+
return stageStart + paper * scale - client;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Herramientas de la banda del encabezado en edición (interruptor de número de
|
|
218
|
+
* página + ✓). La fila cuelga ENCIMA de la banda, dentro del margen superior de la
|
|
219
|
+
* hoja, y el papel tiene `overflow: clip`: tiene que entrar en el margen mínimo
|
|
220
|
+
* (10 mm = 38 px) o se recorta. `co-icon-button size="sm"` mide 48 px: el tamaño va
|
|
221
|
+
* por `box-size`. Fila = max(✓, switch de 24) + padding + borde (ver la prueba).
|
|
222
|
+
*/
|
|
223
|
+
const HEADER_TOOL_BOX_PX = 28;
|
|
224
|
+
const HEADER_TOOL_ICON_PX = 16;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Barra de diseño de imagen (4 modos de V1). Vive DENTRO del papel, que tiene
|
|
228
|
+
* `overflow: clip`: su posición se decide acá para que nunca quede recortada.
|
|
229
|
+
* Las medidas son las del CSS (`.co-doc-editor__image-bar` / `__image-mode`,
|
|
230
|
+
* ver la prueba): se calculan sin medir el DOM porque la barra todavía no existe
|
|
231
|
+
* cuando se decide dónde va.
|
|
232
|
+
*/
|
|
233
|
+
const IMAGE_MODE_ICONS = {
|
|
234
|
+
inline: 'image-square',
|
|
235
|
+
'wrap-left': 'text-align-left',
|
|
236
|
+
'wrap-right': 'text-align-right',
|
|
237
|
+
break: 'rows',
|
|
238
|
+
};
|
|
239
|
+
const IMAGE_MODE_ICON_PX = 16;
|
|
240
|
+
/** 4 botones × 28 + 3 separaciones de 2 + relleno 2 × 2 + borde 1 × 2. */
|
|
241
|
+
const IMAGE_BAR_SIZE = { width: 124, height: 34 };
|
|
242
|
+
/** Aire entre la imagen y la barra. */
|
|
243
|
+
const IMAGE_BAR_GAP_PX = 4;
|
|
244
|
+
/**
|
|
245
|
+
* Debajo de la imagen (por defecto: una imagen pegada al margen superior no la
|
|
246
|
+
* saca por arriba); si no entra debajo (final del papel), encima; si tampoco,
|
|
247
|
+
* dentro de la imagen, sobre su borde inferior. En horizontal se acota al papel.
|
|
248
|
+
* Un papel sin medidas (0) no acota.
|
|
249
|
+
*/
|
|
250
|
+
function imageBarPosition(img, sheet, bar = IMAGE_BAR_SIZE, gap = IMAGE_BAR_GAP_PX) {
|
|
251
|
+
const below = img.top + img.height + gap;
|
|
252
|
+
const above = img.top - gap - bar.height;
|
|
253
|
+
let top = below;
|
|
254
|
+
let placement = 'below';
|
|
255
|
+
if (sheet.height > 0 && below + bar.height > sheet.height) {
|
|
256
|
+
if (above >= 0) {
|
|
257
|
+
top = above;
|
|
258
|
+
placement = 'above';
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
top = Math.max(0, Math.min(img.top + img.height - gap - bar.height, sheet.height - bar.height));
|
|
262
|
+
placement = 'inside';
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
let left = img.left;
|
|
266
|
+
if (sheet.width > 0)
|
|
267
|
+
left = Math.max(0, Math.min(left, sheet.width - bar.width));
|
|
268
|
+
return { top, left, placement };
|
|
269
|
+
}
|
|
270
|
+
/** `offsetLeft` acumulado hasta `root` (par de `layoutBox`, que da el top). */
|
|
271
|
+
function layoutLeft(el, root) {
|
|
272
|
+
let left = 0;
|
|
273
|
+
let node = el;
|
|
274
|
+
while (node && node !== root) {
|
|
275
|
+
left += node.offsetLeft;
|
|
276
|
+
node = node.offsetParent;
|
|
277
|
+
}
|
|
278
|
+
return left;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Ancho con el que nace una imagen insertada (nota T8 / plan B §6.4): sin `width`,
|
|
282
|
+
* V1 la abre a 800 px, más que la columna (≈740 en carta). Nunca pasa de la columna.
|
|
283
|
+
*/
|
|
284
|
+
function defaultImageWidth(naturalWidth, columnWidth) {
|
|
285
|
+
const natural = naturalWidth > 0 ? naturalWidth : 0;
|
|
286
|
+
const column = columnWidth > 0 ? columnWidth : 0;
|
|
287
|
+
const w = natural && column ? Math.min(natural, column) : natural || column;
|
|
288
|
+
return w ? Math.max(1, Math.round(w)) : null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const coDocumentEditorCss = () => `co-document-editor{display:block;height:100%;min-height:0}.co-doc-editor{--co-doc-canvas:var(--co-semantic-surface-muted);--co-doc-sheet-shadow:0 1px 3px var(--co-color-opacity-negro-16), 0 0 0 1px var(--co-color-opacity-negro-8);display:flex;flex-direction:column;height:100%;min-height:0;background:var(--co-doc-canvas);color:var(--co-semantic-text-default);font-family:var(--co-font-family-primary)}.co-doc-editor__bar{display:flex;align-items:center;gap:var(--co-spacing-sm2);min-width:0;padding-inline:var(--co-spacing-md);background:var(--co-semantic-surface-page);border-bottom:1px solid var(--co-semantic-border-subtle)}.co-doc-editor__toolbar{flex:1 1 auto;min-width:0}.co-doc-editor__body{flex:1 1 auto;display:flex;min-height:0}.co-doc-editor__body>[slot='aside']{flex:0 0 var(--co-doc-aside-width, 320px);width:var(--co-doc-aside-width, 320px);min-width:0;min-height:0;box-sizing:border-box;border-left:1px solid var(--co-semantic-border-subtle)}.co-doc-editor__canvas{flex:1 1 auto;min-width:0;overflow:auto;box-sizing:border-box;padding:var(--co-spacing-2xl) var(--co-spacing-lg)}.co-doc-editor__content .ProseMirror{position:relative;outline:none}.co-doc-editor--loading .co-doc-editor__content{visibility:hidden}.co-doc-field{--co-doc-field-bg:var(--co-color-primary-amarillo);background:var(--co-doc-field-bg);box-shadow:0 0 0 2px var(--co-doc-field-bg);border-radius:var(--co-border-radius-xxs);color:var(--co-color-base-negro);cursor:pointer}.co-doc-field--empty{--co-doc-field-bg:color-mix(in srgb, var(--co-color-primary-amarillo) 55%, var(--co-color-base-blanco))}.co-doc-field--required.co-doc-field--empty{box-shadow:0 0 0 2px var(--co-doc-field-bg), inset 0 -2px 0 var(--co-color-status-error)}.co-doc-field__input{width:14ch;border:0;outline:1px solid var(--co-semantic-border-focus);background:var(--co-color-base-blanco);font:inherit}.co-doc-signature{display:inline-flex;align-items:center;justify-content:center;vertical-align:top;box-sizing:border-box;outline:1px dashed var(--co-color-primary-azul);outline-offset:-1px;background:color-mix(in srgb, var(--co-color-primary-azul) 6%, transparent);color:var(--co-color-primary-azul);font-size:var(--co-font-size-12);user-select:none}.co-doc-hb{background:color-mix(in srgb, var(--co-color-primary-azul) 12%, transparent);border-radius:var(--co-border-radius-xxs)}.co-doc-editor__zoom{display:inline-flex;flex-shrink:0;align-items:center;gap:var(--co-spacing-xxs);margin-inline-start:auto}.co-doc-editor__zoom-level{min-width:5ch;padding-inline:var(--co-spacing-xs);font-size:var(--co-font-size-13);font-variant-numeric:tabular-nums;text-align:end;color:var(--co-semantic-text-secondary)}.co-doc-editor__zoom-btn{padding:var(--co-spacing-xs) var(--co-spacing-sm2);border:0;border-radius:var(--co-border-radius-xs);background:transparent;color:var(--co-semantic-text-secondary);font:inherit;font-size:var(--co-font-size-13);white-space:nowrap;cursor:pointer}.co-doc-editor__zoom-btn:hover{background:var(--co-semantic-surface-hover)}.co-doc-editor__zoom-btn--active{background:var(--co-semantic-surface-hover);color:var(--co-semantic-text-default)}.co-doc-editor__zoom-btn:focus-visible{outline:1px solid var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-doc-editor__zoom-frame{margin-inline:auto}.co-doc-editor__stage{width:var(--co-doc-page-w);transform-origin:top left}.co-doc-editor__sheet{--co-semantic-surface-page:var(--co-color-base-blanco);--co-semantic-surface-hover:var(--co-color-opacity-negro-8);--co-semantic-text-default:var(--co-color-base-negro);--co-semantic-text-secondary:var(--co-color-gray-600);--co-semantic-text-muted:var(--co-color-gray-500);--co-semantic-border-default:var(--co-color-opacity-negro-16);--co-semantic-border-subtle:var(--co-color-opacity-negro-8);--co-semantic-border-field:var(--co-color-opacity-negro-25);--co-semantic-border-focus:var(--co-color-opacity-negro-50);--co-semantic-border-focus-ring:var(--co-color-opacity-negro-8);position:relative;width:var(--co-doc-page-w);min-height:calc(var(--co-doc-pages, 1) * var(--co-doc-page-h) + (var(--co-doc-pages, 1) - 1) * var(--co-doc-gap));box-sizing:border-box;padding-top:calc(var(--co-doc-margin-top) + var(--co-doc-header-h, 0px));padding-right:var(--co-doc-margin-right);padding-bottom:var(--co-doc-margin-bottom);padding-left:var(--co-doc-margin-left);overflow:clip;background:var(--co-color-base-blanco);color:var(--co-color-base-negro);color-scheme:light;box-shadow:var(--co-doc-sheet-shadow)}.co-doc-editor__paper{display:contents;color:var(--co-semantic-text-default)}.co-doc-editor .co-doc-editor__sheet .co-doc-editor__content .ProseMirror.tiptap{padding:0 !important;min-height:1em}.co-doc-editor__header-band{position:absolute;top:var(--co-doc-margin-top);left:var(--co-doc-margin-left);right:var(--co-doc-margin-right);height:var(--co-doc-header-h);box-sizing:border-box}.co-doc-editor__header-band[hidden]{display:none}.co-doc-editor__header-band:hover{outline:1px dashed var(--co-color-opacity-negro-25)}.co-doc-editor__header-static{display:flex;align-items:center;justify-content:space-between;height:100%;overflow:hidden;font-size:var(--co-font-size-12);line-height:1.5;user-select:none}.co-doc-editor__header-html{flex:1 1 auto;min-width:0;max-height:100%;overflow:hidden}.co-doc-editor__page-number{flex-shrink:0;margin-inline-start:var(--co-spacing-sm2);white-space:nowrap;color:var(--co-color-gray-600)}.co-doc-page-gap,.co-doc-page-gap__foot,.co-doc-page-gap__between,.co-doc-page-gap__head{margin:0 !important;padding:0 !important;border-width:0 !important;box-sizing:border-box !important}.co-doc-editor__sheet .co-doc-page-gap{position:relative;margin-left:calc(-1 * var(--co-doc-margin-left)) !important;margin-right:calc(-1 * var(--co-doc-margin-right)) !important;user-select:none}.co-doc-page-gap__between{background:var(--co-doc-canvas);border-image:linear-gradient(var(--co-doc-canvas), var(--co-doc-canvas)) fill 0 / 0 / 0 100vmax;box-shadow:inset 0 1px 0 var(--co-color-opacity-negro-8), inset 0 4px 3px -3px var(--co-color-opacity-negro-16), inset 0 -1px 0 var(--co-color-opacity-negro-8)}:is(ul,ol)>.co-doc-page-gap{list-style:none}.co-doc-editor__sheet .co-doc-page-gap__head{padding-top:var(--co-doc-margin-top) !important;padding-left:var(--co-doc-margin-left) !important;padding-right:var(--co-doc-margin-right) !important}.co-doc-page-gap-row>td{padding:0 !important;border:0 !important;background:transparent !important}.co-doc-editor__header-band--editing,.co-doc-editor__header-band--editing:hover{outline:1px solid var(--co-semantic-border-focus);outline-offset:2px}.co-doc-editor__header-editing{display:flex;align-items:center;gap:var(--co-spacing-sm2);height:100%}.co-doc-editor__header-editor{flex:1 1 auto;min-width:0;max-height:100%;overflow:hidden;font-size:var(--co-font-size-12);line-height:1.5}.co-doc-editor__header-editor .ProseMirror{outline:none}.co-doc-editor__header-tools{position:absolute;right:0;bottom:100%;display:flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-xxs) var(--co-spacing-xs);box-sizing:border-box;background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-default);border-radius:var(--co-border-radius-xs)}.co-doc-editor__image-bar{position:absolute;z-index:2;display:flex;gap:var(--co-spacing-xxs);padding:var(--co-spacing-xxs);box-sizing:border-box;background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-default);border-radius:var(--co-border-radius-xs);user-select:none}.co-doc-editor__image-bar co-tooltip{display:inline-flex}.co-doc-editor__image-mode{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:var(--co-border-radius-xxs);background:transparent;color:var(--co-semantic-text-default);cursor:pointer}.co-doc-editor__image-mode:hover,.co-doc-editor__image-mode--active{background:var(--co-semantic-surface-hover)}.co-doc-editor__image-mode--active{box-shadow:inset 0 0 0 1px var(--co-semantic-border-focus)}.co-doc-editor__image-mode:focus-visible{outline:1px solid var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-doc-editor__image-mode--active:focus-visible{box-shadow:inset 0 0 0 1px var(--co-semantic-border-focus), 0 0 0 2px var(--co-semantic-border-focus-ring)}`;
|
|
292
|
+
|
|
293
|
+
let instanceSeq = 0;
|
|
294
|
+
const CoDocumentEditor = class {
|
|
295
|
+
constructor(hostRef) {
|
|
296
|
+
registerInstance(this, hostRef);
|
|
297
|
+
this.coChange = createEvent(this, "coChange", 3);
|
|
298
|
+
this.coFieldsChange = createEvent(this, "coFieldsChange", 3);
|
|
299
|
+
this.coHeaderChange = createEvent(this, "coHeaderChange", 3);
|
|
300
|
+
this.coPagesChange = createEvent(this, "coPagesChange", 3);
|
|
301
|
+
this.coAction = createEvent(this, "coAction", 3);
|
|
302
|
+
this.coReady = createEvent(this, "coReady", 3);
|
|
303
|
+
/** Cuerpo: HTML de impresión (tolera el que guardó V1) o JSON de ProseMirror como string. */
|
|
304
|
+
this.value = null;
|
|
305
|
+
/** HTML del encabezado (banda superior de cada hoja). Vacío = sin encabezado. */
|
|
306
|
+
this.headerHtml = '';
|
|
307
|
+
/** Número de página en la banda. Se lee como intención: `true` o `'true'`. */
|
|
308
|
+
this.showPageNumber = false;
|
|
309
|
+
/** `letter` | `a4` | `legal` o `{width, height}` en px a 96 dpi (objeto o JSON). */
|
|
310
|
+
this.pageSize = 'letter';
|
|
311
|
+
/** Alto de la banda del encabezado en px (cuando hay encabezado). */
|
|
312
|
+
this.headerHeight = 45;
|
|
313
|
+
/** CSS de impresión del host; se acota a la hoja. */
|
|
314
|
+
this.pageStyles = '';
|
|
315
|
+
/** Solo lectura: sin barra ni edición (el encabezado tampoco se puede editar). */
|
|
316
|
+
this.readonly = false;
|
|
317
|
+
/** BCP-47 para los textos de la UI ('es', 'en', 'pt-BR'…). */
|
|
318
|
+
this.locale = 'en';
|
|
319
|
+
this.ready = false;
|
|
320
|
+
this.pageCount = 1;
|
|
321
|
+
/** `custom` = zoom libre por gesto (pinza del trackpad / ctrl+rueda); la escala queda donde la dejó el usuario. */
|
|
322
|
+
this.zoomMode = 'fit';
|
|
323
|
+
this.scale = 1;
|
|
324
|
+
this.stageHeight = 0;
|
|
325
|
+
/** La banda del encabezado está en edición (editor `print-header` montado). */
|
|
326
|
+
this.headerEditing = false;
|
|
327
|
+
/** Interruptor de número de página mientras se edita (se confirma con el encabezado). */
|
|
328
|
+
this.draftShowPageNumber = false;
|
|
329
|
+
/** Barra de diseño de la imagen seleccionada en el cuerpo (null = no hay). Posición en px del papel. */
|
|
330
|
+
this.imageBar = null;
|
|
331
|
+
/** Encabezado vigente (confirmado). La Task 16 lo cambia al confirmar la banda. */
|
|
332
|
+
this.currentHeaderHtml = '';
|
|
333
|
+
this.currentShowPageNumber = false;
|
|
334
|
+
/** JSON del encabezado confirmado (lista de campos sin montar un editor). */
|
|
335
|
+
this.headerDoc = null;
|
|
336
|
+
this.instanceId = String(++instanceSeq);
|
|
337
|
+
this.applyingExternal = false;
|
|
338
|
+
this.lastAppliedValue = null;
|
|
339
|
+
this.userDirty = false;
|
|
340
|
+
this.lastFieldsKey = '';
|
|
341
|
+
/** src de imágenes insertadas por el usuario sin `width`: al cargar reciben uno (nota T8). */
|
|
342
|
+
this.pendingImageSrcs = new Set();
|
|
343
|
+
this.changeThrottle = createThrottle(DOC_CHANGE_THROTTLE_MS, () => this.emitPendingChange());
|
|
344
|
+
/**
|
|
345
|
+
* Barra bajo la imagen seleccionada (corre en cada transacción del cuerpo). Solo
|
|
346
|
+
* cambia el estado si cambió algo: sin re-render por tecla ni bucles.
|
|
347
|
+
*/
|
|
348
|
+
this.updateImageBar = () => {
|
|
349
|
+
const ed = this.editor;
|
|
350
|
+
const sel = ed === null || ed === void 0 ? void 0 : ed.state.selection;
|
|
351
|
+
const node = sel === null || sel === void 0 ? void 0 : sel.node;
|
|
352
|
+
if (!ed || this.readonly || !node || node.type.name !== 'image') {
|
|
353
|
+
if (this.imageBar)
|
|
354
|
+
this.imageBar = null;
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const dom = ed.view.nodeDOM(sel.from);
|
|
358
|
+
const sheet = this.el.querySelector('.co-doc-editor__sheet');
|
|
359
|
+
if (!dom || !sheet) {
|
|
360
|
+
if (this.imageBar)
|
|
361
|
+
this.imageBar = null;
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
// px de layout (no los altera el zoom: la barra vive dentro del escenario escalado).
|
|
365
|
+
const box = layoutBox(dom, sheet);
|
|
366
|
+
const pos = imageBarPosition({ top: box.top, height: box.height, left: layoutLeft(dom, sheet)}, { width: sheet.offsetWidth, height: sheet.offsetHeight });
|
|
367
|
+
const mode = getImageLayoutMode({ wrapperStyle: node.attrs.wrapperStyle, containerStyle: node.attrs.containerStyle });
|
|
368
|
+
const cur = this.imageBar;
|
|
369
|
+
if (!cur || cur.mode !== mode || cur.top !== pos.top || cur.left !== pos.left)
|
|
370
|
+
this.imageBar = { mode, top: pos.top, left: pos.left };
|
|
371
|
+
};
|
|
372
|
+
/** Una imagen insertada sin ancho nace acotada a la columna (V1 la abriría a 800 px). */
|
|
373
|
+
this.onBodyImageLoad = (e) => {
|
|
374
|
+
const img = e.target;
|
|
375
|
+
const ed = this.editor;
|
|
376
|
+
if (!ed || !img || img.tagName !== 'IMG')
|
|
377
|
+
return;
|
|
378
|
+
const src = img.getAttribute('src') || '';
|
|
379
|
+
if (!this.pendingImageSrcs.has(src))
|
|
380
|
+
return;
|
|
381
|
+
let target = -1;
|
|
382
|
+
ed.state.doc.descendants((n, pos) => {
|
|
383
|
+
if (target >= 0)
|
|
384
|
+
return false;
|
|
385
|
+
if (n.type.name === 'image' && !n.attrs.width && n.attrs.src === src)
|
|
386
|
+
target = pos;
|
|
387
|
+
return true;
|
|
388
|
+
});
|
|
389
|
+
const node = target >= 0 ? ed.state.doc.nodeAt(target) : null;
|
|
390
|
+
if (!node)
|
|
391
|
+
return;
|
|
392
|
+
const m = this.marginsPx;
|
|
393
|
+
const width = defaultImageWidth(img.naturalWidth, this.pageSizePx.width - m.left - m.right);
|
|
394
|
+
if (!width)
|
|
395
|
+
return;
|
|
396
|
+
// Quedan otras del mismo src sin ancho: su propio `load` las toma.
|
|
397
|
+
let more = false;
|
|
398
|
+
ed.state.doc.descendants((n, pos) => {
|
|
399
|
+
if (pos !== target && n.type.name === 'image' && !n.attrs.width && n.attrs.src === src)
|
|
400
|
+
more = true;
|
|
401
|
+
return !more;
|
|
402
|
+
});
|
|
403
|
+
if (!more)
|
|
404
|
+
this.pendingImageSrcs.delete(src);
|
|
405
|
+
const wasSelected = ed.state.selection.node && ed.state.selection.from === target;
|
|
406
|
+
ed.view.dispatch(ed.state.tr.setNodeMarkup(target, undefined, Object.assign(Object.assign({}, node.attrs), { width })));
|
|
407
|
+
if (wasSelected)
|
|
408
|
+
ed.commands.setNodeSelection(target);
|
|
409
|
+
};
|
|
410
|
+
/** Al salir del editor (p. ej. mousedown en «Cerrar») el aviso no espera la ventana. */
|
|
411
|
+
this.onEditorBlur = () => {
|
|
412
|
+
this.changeThrottle.flush();
|
|
413
|
+
};
|
|
414
|
+
this.onHostKeydown = (e) => {
|
|
415
|
+
if (e.key === 'Escape')
|
|
416
|
+
this.changeThrottle.flush();
|
|
417
|
+
};
|
|
418
|
+
this.onTransaction = ({ transaction }) => {
|
|
419
|
+
if (!transaction.docChanged)
|
|
420
|
+
return;
|
|
421
|
+
const external = this.applyingExternal || !!transaction.getMeta(FIELD_SYNC_META);
|
|
422
|
+
if (!external) {
|
|
423
|
+
this.userDirty = true;
|
|
424
|
+
this.trackInsertedImages(transaction);
|
|
425
|
+
}
|
|
426
|
+
this.changeThrottle.run();
|
|
427
|
+
};
|
|
428
|
+
/** La barra emite coAction burbujeante: se corta acá y solo salen los botones del host. */
|
|
429
|
+
this.handleToolbarAction = (e) => {
|
|
430
|
+
e.stopPropagation();
|
|
431
|
+
const { action, payload } = e.detail || {};
|
|
432
|
+
// Se reemite EXACTAMENTE el detalle de la barra para los botones del host; las
|
|
433
|
+
// acciones propias de la barra (bold…) no salen del componente. `documentHeader`
|
|
434
|
+
// abre la banda y tampoco se reemite.
|
|
435
|
+
if (payload && payload.extra === true)
|
|
436
|
+
this.coAction.emit({ action, payload: { extra: true } });
|
|
437
|
+
else if (action === 'documentHeader')
|
|
438
|
+
this.startHeaderEdit();
|
|
439
|
+
};
|
|
440
|
+
/* ── Banda del encabezado en edición (como V1: doble clic o «Encabezado»; clic afuera o ✓ confirma; Esc cancela) ── */
|
|
441
|
+
this.startHeaderEdit = () => {
|
|
442
|
+
if (this.readonly || this.headerEditing || !this.editor)
|
|
443
|
+
return;
|
|
444
|
+
this.draftShowPageNumber = this.currentShowPageNumber;
|
|
445
|
+
this.headerEditing = true; // el render monta .co-doc-editor__header-editor y componentDidRender el editor
|
|
446
|
+
this.refreshPagination(); // sin encabezado previo, la banda aparece y corre el cuerpo
|
|
447
|
+
};
|
|
448
|
+
/** Cambios en la banda: solo la lista de campos (decisión 16: el encabezado no emite coChange). */
|
|
449
|
+
this.onHeaderTransaction = ({ transaction }) => {
|
|
450
|
+
if (transaction.docChanged)
|
|
451
|
+
this.changeThrottle.run();
|
|
452
|
+
};
|
|
453
|
+
/** Como fitHeaderImage de V1: una imagen sin ancho se ajusta a la banda (40×400) al cargar. */
|
|
454
|
+
this.onHeaderImageLoad = (e) => {
|
|
455
|
+
const img = e.target;
|
|
456
|
+
const ed = this.headerEditor;
|
|
457
|
+
if (!ed || !img || img.tagName !== 'IMG')
|
|
458
|
+
return;
|
|
459
|
+
const width = headerImageWidth({ w: img.naturalWidth, h: img.naturalHeight });
|
|
460
|
+
if (!width)
|
|
461
|
+
return;
|
|
462
|
+
let target = -1;
|
|
463
|
+
try {
|
|
464
|
+
const pos = ed.view.posAtDOM(img, 0);
|
|
465
|
+
const node = ed.state.doc.nodeAt(pos);
|
|
466
|
+
if (node && node.type.name === 'image')
|
|
467
|
+
target = pos;
|
|
468
|
+
}
|
|
469
|
+
catch (_a) {
|
|
470
|
+
/* el img ya no está en el editor */
|
|
471
|
+
}
|
|
472
|
+
if (target < 0) {
|
|
473
|
+
const src = img.getAttribute('src');
|
|
474
|
+
ed.state.doc.descendants((node, pos) => {
|
|
475
|
+
if (target >= 0)
|
|
476
|
+
return false;
|
|
477
|
+
if (node.type.name === 'image' && !node.attrs.width && node.attrs.src === src)
|
|
478
|
+
target = pos;
|
|
479
|
+
return true;
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
const node = target >= 0 ? ed.state.doc.nodeAt(target) : null;
|
|
483
|
+
if (!node || node.attrs.width)
|
|
484
|
+
return;
|
|
485
|
+
ed.view.dispatch(ed.state.tr.setNodeMarkup(target, undefined, Object.assign(Object.assign({}, node.attrs), { width })));
|
|
486
|
+
};
|
|
487
|
+
/** Clic afuera de la banda (y de la barra, que la edita) confirma. */
|
|
488
|
+
this.onDocumentPointer = (e) => {
|
|
489
|
+
const path = e.composedPath();
|
|
490
|
+
if (this.headerBandEl && path.includes(this.headerBandEl))
|
|
491
|
+
return;
|
|
492
|
+
if (this.toolbarEl && path.includes(this.toolbarEl))
|
|
493
|
+
return;
|
|
494
|
+
this.commitHeader();
|
|
495
|
+
};
|
|
496
|
+
/**
|
|
497
|
+
* Esc cancela y NO sigue hasta el editor ni burbujea al host (no cierra el overlay
|
|
498
|
+
* de abajo). Convive con `onHostKeydown`: el host captura antes (es ancestro) y
|
|
499
|
+
* solo adelanta el coChange pendiente del cuerpo.
|
|
500
|
+
*/
|
|
501
|
+
this.onHeaderKeydown = (e) => {
|
|
502
|
+
var _a;
|
|
503
|
+
if (e.key !== 'Escape' || e.isComposing)
|
|
504
|
+
return;
|
|
505
|
+
// Desde la barra: si tiene un panel abierto (color, enlace, tamaño…) el Esc es suyo y lo cierra.
|
|
506
|
+
const toolbar = this.toolbarEl;
|
|
507
|
+
if (toolbar && e.currentTarget === toolbar && ((_a = toolbar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[aria-expanded="true"]')))
|
|
508
|
+
return;
|
|
509
|
+
e.preventDefault();
|
|
510
|
+
e.stopPropagation();
|
|
511
|
+
this.cancelHeader(true);
|
|
512
|
+
};
|
|
513
|
+
/**
|
|
514
|
+
* `restoreFocus`: confirmar con el ✓ (teclado o clic) desmonta el botón enfocado →
|
|
515
|
+
* el foco vuelve al cuerpo. El clic afuera NO lo toca: el foco ya se fue adonde se hizo clic.
|
|
516
|
+
*/
|
|
517
|
+
this.commitHeader = (restoreFocus = false) => {
|
|
518
|
+
var _a;
|
|
519
|
+
const ed = this.headerEditor;
|
|
520
|
+
if (!ed)
|
|
521
|
+
return;
|
|
522
|
+
const refocus = restoreFocus && this.focusIsInBandOrLost();
|
|
523
|
+
const html = ed.isEmpty ? '' : writePrintHtml(ed.state.doc, 'print-header', this.resolvedFeatures);
|
|
524
|
+
const showPageNumber = this.draftShowPageNumber;
|
|
525
|
+
this.teardownHeaderEditor();
|
|
526
|
+
this.currentHeaderHtml = html;
|
|
527
|
+
this.currentShowPageNumber = showPageNumber;
|
|
528
|
+
this.headerDoc = html ? readPrintHtml(html, 'print-header', this.resolvedFeatures) : null;
|
|
529
|
+
this.headerEditing = false;
|
|
530
|
+
this.refreshPagination();
|
|
531
|
+
this.coHeaderChange.emit({ html, showPageNumber });
|
|
532
|
+
this.emitFieldsIfChanged();
|
|
533
|
+
if (refocus)
|
|
534
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.commands.focus();
|
|
535
|
+
};
|
|
536
|
+
/** `restoreFocus` solo para la cancelación del usuario (Esc); un cambio de prop no roba el foco. */
|
|
537
|
+
this.cancelHeader = (restoreFocus = false) => {
|
|
538
|
+
var _a;
|
|
539
|
+
if (!this.headerEditing)
|
|
540
|
+
return;
|
|
541
|
+
this.teardownHeaderEditor();
|
|
542
|
+
this.headerEditing = false;
|
|
543
|
+
this.refreshPagination();
|
|
544
|
+
this.emitFieldsIfChanged();
|
|
545
|
+
if (restoreFocus)
|
|
546
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.commands.focus();
|
|
547
|
+
};
|
|
548
|
+
/** Escala que refleja el DOM (se actualiza en componentDidRender). */
|
|
549
|
+
this.renderedScale = 1;
|
|
550
|
+
this.onCanvasWheel = (e) => {
|
|
551
|
+
// ctrlKey = pinza del trackpad (Chrome/Edge/Firefox) o ctrl+rueda; ⌘+rueda en mac también.
|
|
552
|
+
if (!e.ctrlKey && !e.metaKey)
|
|
553
|
+
return;
|
|
554
|
+
e.preventDefault();
|
|
555
|
+
// deltaMode 1 = líneas (rueda de mouse clásica): ~16px por línea.
|
|
556
|
+
const delta = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY;
|
|
557
|
+
this.zoomTo(pinchScale(this.scale, delta), e.clientX, e.clientY);
|
|
558
|
+
};
|
|
559
|
+
/** Safari no manda la pinza como ctrl+wheel sino como GestureEvent (escala acumulada desde el inicio). */
|
|
560
|
+
this.gestureBase = 1;
|
|
561
|
+
this.onGestureStart = (e) => {
|
|
562
|
+
e.preventDefault();
|
|
563
|
+
this.gestureBase = this.scale;
|
|
564
|
+
};
|
|
565
|
+
this.onGestureChange = (e) => {
|
|
566
|
+
var _a, _b, _c, _d;
|
|
567
|
+
e.preventDefault();
|
|
568
|
+
const rect = (_a = this.canvasEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
569
|
+
const cx = (_b = e.clientX) !== null && _b !== void 0 ? _b : (rect ? rect.left + rect.width / 2 : 0);
|
|
570
|
+
const cy = (_c = e.clientY) !== null && _c !== void 0 ? _c : (rect ? rect.top + rect.height / 2 : 0);
|
|
571
|
+
this.zoomTo(clampScale(this.gestureBase * ((_d = e.scale) !== null && _d !== void 0 ? _d : 1)), cx, cy);
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
get s() {
|
|
575
|
+
return getRichTextStrings(this.locale);
|
|
576
|
+
}
|
|
577
|
+
get resolvedFeatures() {
|
|
578
|
+
var _a;
|
|
579
|
+
return (_a = parseFeatures(this.features)) !== null && _a !== void 0 ? _a : {};
|
|
580
|
+
}
|
|
581
|
+
get parsedExtraItems() {
|
|
582
|
+
const v = parseFeatures(this.extraItems);
|
|
583
|
+
return Array.isArray(v) ? v : [];
|
|
584
|
+
}
|
|
585
|
+
get pageSizePx() {
|
|
586
|
+
return resolvePageSize(parsePageSize(this.pageSize));
|
|
587
|
+
}
|
|
588
|
+
get marginsPx() {
|
|
589
|
+
return parseMargins(this.margins);
|
|
590
|
+
}
|
|
591
|
+
/** Con la banda en edición hay banda aunque el encabezado confirmado esté vacío. */
|
|
592
|
+
get hasHeader() {
|
|
593
|
+
return !!this.currentHeaderHtml || this.headerEditing;
|
|
594
|
+
}
|
|
595
|
+
get sanitizedHeaderHtml() {
|
|
596
|
+
return sanitize(this.currentHeaderHtml, 'print-header');
|
|
597
|
+
}
|
|
598
|
+
get pageScope() {
|
|
599
|
+
return `.co-doc-editor__sheet[data-co-doc="${this.instanceId}"]`;
|
|
600
|
+
}
|
|
601
|
+
/** Editor que maneja la barra: el del encabezado mientras la banda está en edición. */
|
|
602
|
+
get activeEditor() {
|
|
603
|
+
var _a;
|
|
604
|
+
return (_a = this.headerEditor) !== null && _a !== void 0 ? _a : this.editor;
|
|
605
|
+
}
|
|
606
|
+
/** «Encabezado» en la barra: apagado en solo lectura y con la banda ya abierta. */
|
|
607
|
+
get documentHeaderEnabled() {
|
|
608
|
+
return !this.readonly && !this.headerEditing;
|
|
609
|
+
}
|
|
610
|
+
/** Paginación del cuerpo: tamaño, márgenes y banda del encabezado. */
|
|
611
|
+
buildCustomExtensions() {
|
|
612
|
+
return [
|
|
613
|
+
Pagination.configure({
|
|
614
|
+
page: this.pageSizePx,
|
|
615
|
+
margins: this.marginsPx,
|
|
616
|
+
header: { height: this.hasHeader ? this.headerHeight : 0 },
|
|
617
|
+
footer: { height: 0 },
|
|
618
|
+
renderHeader: (page, count) => this.buildHeaderClone(page, count),
|
|
619
|
+
onPagesChange: (n) => {
|
|
620
|
+
this.pageCount = n;
|
|
621
|
+
this.coPagesChange.emit(n);
|
|
622
|
+
},
|
|
623
|
+
}),
|
|
624
|
+
];
|
|
625
|
+
}
|
|
626
|
+
/** Campos del cuerpo y, detrás, los del encabezado (el que se edita o el confirmado). */
|
|
627
|
+
collectAllFields() {
|
|
628
|
+
if (!this.editor)
|
|
629
|
+
return [];
|
|
630
|
+
const list = collectFields(this.editor.state.doc);
|
|
631
|
+
const header = this.headerEditor ? this.headerEditor.state.doc : this.headerDoc;
|
|
632
|
+
if (header)
|
|
633
|
+
collectFields(header, list);
|
|
634
|
+
return list;
|
|
635
|
+
}
|
|
636
|
+
connectedCallback() {
|
|
637
|
+
// Captura sobre el host: el Escape pasa por acá antes que el listener del drawer/modal
|
|
638
|
+
// que cierra. No se frena la propagación: solo se adelanta el coChange pendiente.
|
|
639
|
+
this.el.addEventListener('keydown', this.onHostKeydown, true);
|
|
640
|
+
}
|
|
641
|
+
componentWillLoad() {
|
|
642
|
+
// H3: el harness de specs no aplica los defaults de clase de @State.
|
|
643
|
+
this.ready = false;
|
|
644
|
+
this.pageCount = 1;
|
|
645
|
+
this.zoomMode = 'fit';
|
|
646
|
+
this.scale = 1;
|
|
647
|
+
this.stageHeight = 0;
|
|
648
|
+
this.headerEditing = false;
|
|
649
|
+
this.draftShowPageNumber = false;
|
|
650
|
+
this.imageBar = null;
|
|
651
|
+
}
|
|
652
|
+
componentDidLoad() {
|
|
653
|
+
var _a, _b, _c;
|
|
654
|
+
if (!this.contentEl)
|
|
655
|
+
return;
|
|
656
|
+
this.syncHeaderFromProps();
|
|
657
|
+
this.editor = createEditor({
|
|
658
|
+
preset: 'print',
|
|
659
|
+
element: this.contentEl,
|
|
660
|
+
// Nota T14: el contenido inicial pasa por readPrintHtml (parseBody), igual que todo setContent posterior.
|
|
661
|
+
content: this.value ? this.parseBody(this.value) : null,
|
|
662
|
+
editable: !this.readonly,
|
|
663
|
+
features: this.resolvedFeatures,
|
|
664
|
+
labels: { signature: (n) => `${this.s.signature} ${n}`, fieldName: this.s.fieldNamePlaceholder },
|
|
665
|
+
customExtensions: this.buildCustomExtensions(),
|
|
666
|
+
imageUpload: this.imageUpload,
|
|
667
|
+
});
|
|
668
|
+
this.lastAppliedValue = this.value;
|
|
669
|
+
this.wireEditor(this.editor);
|
|
670
|
+
this.applyPageStyles();
|
|
671
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
672
|
+
this.resizeObserver = new ResizeObserver(() => this.updateScale());
|
|
673
|
+
if (this.canvasEl)
|
|
674
|
+
this.resizeObserver.observe(this.canvasEl);
|
|
675
|
+
if (this.stageEl)
|
|
676
|
+
this.resizeObserver.observe(this.stageEl);
|
|
677
|
+
}
|
|
678
|
+
// passive:false — sin preventDefault la pinza hace zoom de TODA la página del navegador.
|
|
679
|
+
(_a = this.canvasEl) === null || _a === void 0 ? void 0 : _a.addEventListener('wheel', this.onCanvasWheel, { passive: false });
|
|
680
|
+
(_b = this.canvasEl) === null || _b === void 0 ? void 0 : _b.addEventListener('gesturestart', this.onGestureStart);
|
|
681
|
+
(_c = this.canvasEl) === null || _c === void 0 ? void 0 : _c.addEventListener('gesturechange', this.onGestureChange);
|
|
682
|
+
this.updateScale();
|
|
683
|
+
this.syncToolbar();
|
|
684
|
+
this.ready = true;
|
|
685
|
+
this.emitFieldsIfChanged();
|
|
686
|
+
this.coReady.emit();
|
|
687
|
+
}
|
|
688
|
+
componentDidRender() {
|
|
689
|
+
this.applyPendingAnchor();
|
|
690
|
+
if (this.headerEditing && !this.headerEditor && this.headerMountEl)
|
|
691
|
+
this.mountHeaderEditor();
|
|
692
|
+
this.syncToolbar();
|
|
693
|
+
}
|
|
694
|
+
disconnectedCallback() {
|
|
695
|
+
var _a, _b, _c, _d;
|
|
696
|
+
this.el.removeEventListener('keydown', this.onHostKeydown, true);
|
|
697
|
+
this.changeThrottle.cancel();
|
|
698
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
699
|
+
this.resizeObserver = undefined;
|
|
700
|
+
(_b = this.canvasEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('wheel', this.onCanvasWheel);
|
|
701
|
+
(_c = this.canvasEl) === null || _c === void 0 ? void 0 : _c.removeEventListener('gesturestart', this.onGestureStart);
|
|
702
|
+
(_d = this.canvasEl) === null || _d === void 0 ? void 0 : _d.removeEventListener('gesturechange', this.onGestureChange);
|
|
703
|
+
// H9: soltar la barra ANTES de destruir, o re-renderiza con un editor destruido.
|
|
704
|
+
if (this.toolbarEl)
|
|
705
|
+
this.toolbarEl.editor = undefined;
|
|
706
|
+
this.teardownHeaderEditor(false);
|
|
707
|
+
this.headerEditing = false;
|
|
708
|
+
if (this.editor) {
|
|
709
|
+
this.editor.off('transaction', this.onTransaction);
|
|
710
|
+
this.editor.off('blur', this.onEditorBlur);
|
|
711
|
+
this.editor.off('transaction', this.updateImageBar);
|
|
712
|
+
this.editor.view.dom.removeEventListener('load', this.onBodyImageLoad, true);
|
|
713
|
+
this.editor.destroy();
|
|
714
|
+
}
|
|
715
|
+
this.editor = undefined;
|
|
716
|
+
this.pendingImageSrcs.clear();
|
|
717
|
+
this.imageBar = null;
|
|
718
|
+
}
|
|
719
|
+
onValueChange(next) {
|
|
720
|
+
if (next === this.lastAppliedValue)
|
|
721
|
+
return;
|
|
722
|
+
// Eco del host: devolvió por `value` lo que getPrintHtml() dio. Re-aplicarlo movería el cursor.
|
|
723
|
+
// Solo corre cuando cambia la prop (nunca por tecla).
|
|
724
|
+
if (this.editor && next && next === writePrintHtml(this.editor.state.doc, 'print', this.resolvedFeatures)) {
|
|
725
|
+
this.lastAppliedValue = next;
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
this.applyBody(next);
|
|
729
|
+
}
|
|
730
|
+
onReadonlyChange() {
|
|
731
|
+
var _a;
|
|
732
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.setEditable(!this.readonly);
|
|
733
|
+
if (this.readonly && this.headerEditing)
|
|
734
|
+
this.cancelHeader();
|
|
735
|
+
this.updateImageBar();
|
|
736
|
+
}
|
|
737
|
+
onPageGeometryChange() {
|
|
738
|
+
this.refreshPagination();
|
|
739
|
+
this.updateScale();
|
|
740
|
+
}
|
|
741
|
+
onHeaderPropsChange() {
|
|
742
|
+
if (this.headerEditing)
|
|
743
|
+
return; // lo que se está editando manda hasta confirmar o cancelar
|
|
744
|
+
this.syncHeaderFromProps();
|
|
745
|
+
this.refreshPagination();
|
|
746
|
+
this.emitFieldsIfChanged();
|
|
747
|
+
}
|
|
748
|
+
onPageStylesChange() {
|
|
749
|
+
this.applyPageStyles();
|
|
750
|
+
}
|
|
751
|
+
onLabelChange() {
|
|
752
|
+
if (this.editor)
|
|
753
|
+
this.editor.view.dom.setAttribute('aria-label', this.label || this.s.documentEditor);
|
|
754
|
+
}
|
|
755
|
+
/** «Página N / M» de las bandas de salto sale del idioma: redibujarlas. */
|
|
756
|
+
onLocaleChange() {
|
|
757
|
+
if (this.currentShowPageNumber)
|
|
758
|
+
this.refreshPagination();
|
|
759
|
+
}
|
|
760
|
+
/* ── Métodos públicos ── */
|
|
761
|
+
/** Cuerpo en la forma canónica de impresión (spec §3.4). */
|
|
762
|
+
async getPrintHtml() {
|
|
763
|
+
if (!this.editor)
|
|
764
|
+
return '';
|
|
765
|
+
return writePrintHtml(this.editor.state.doc, 'print', this.resolvedFeatures);
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* HTML del encabezado confirmado: el de la prop tal cual, o la forma canónica
|
|
769
|
+
* si pasó por la banda o por `setFieldValues`. Lo que se está editando en la
|
|
770
|
+
* banda sin confirmar NO cuenta.
|
|
771
|
+
*/
|
|
772
|
+
async getHeaderHtml() {
|
|
773
|
+
return this.currentHeaderHtml;
|
|
774
|
+
}
|
|
775
|
+
/** Cuerpo como JSON de ProseMirror, o `null` si todavía no montó. */
|
|
776
|
+
async getJSON() {
|
|
777
|
+
return this.editor ? this.editor.getJSON() : null;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Emite YA el `coChange` pendiente (no-op si no hay). El host lo llama antes de
|
|
781
|
+
* decidir «cambios sin aplicar» (cerrar, navegar): `coChange` sale al final de
|
|
782
|
+
* la ventana de 250 ms y una edición recién tipeada todavía no avisó.
|
|
783
|
+
* El blur del editor y un Escape dentro del componente lo hacen solos.
|
|
784
|
+
*/
|
|
785
|
+
async flushChange() {
|
|
786
|
+
this.changeThrottle.flush();
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* ¿Cuerpo vacío? En print un documento vacío NO serializa a `''`
|
|
790
|
+
* (`<p><br class="ProseMirror-trailingBreak"></p>`): el host pregunta acá.
|
|
791
|
+
*/
|
|
792
|
+
async isEmpty() {
|
|
793
|
+
return this.editor ? this.editor.isEmpty : true;
|
|
794
|
+
}
|
|
795
|
+
/** Reemplaza el cuerpo (HTML de impresión, V1 incluido). A diferencia del RTE, NO emite coChange. */
|
|
796
|
+
async setContent(html) {
|
|
797
|
+
this.applyBody(html);
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Valores de los campos (cuerpo y encabezado) en UNA transacción por editor; no
|
|
801
|
+
* cuenta como edición del usuario ni emite coHeaderChange. Con la banda abierta
|
|
802
|
+
* se aplican también al confirmado, así cancelar no los pierde.
|
|
803
|
+
*/
|
|
804
|
+
async setFieldValues(values) {
|
|
805
|
+
var _a, _b;
|
|
806
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.commands.setFieldValues(values);
|
|
807
|
+
(_b = this.headerEditor) === null || _b === void 0 ? void 0 : _b.commands.setFieldValues(values);
|
|
808
|
+
if (!this.currentHeaderHtml)
|
|
809
|
+
return;
|
|
810
|
+
const next = setFieldValuesInHtml(this.currentHeaderHtml, values, 'print-header', this.resolvedFeatures);
|
|
811
|
+
if (next === this.currentHeaderHtml)
|
|
812
|
+
return;
|
|
813
|
+
this.currentHeaderHtml = next;
|
|
814
|
+
this.headerDoc = readPrintHtml(next, 'print-header', this.resolvedFeatures);
|
|
815
|
+
if (!this.headerEditing) {
|
|
816
|
+
this.refreshPagination(); // las bandas de salto clonan el encabezado
|
|
817
|
+
forceUpdate(this);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
/** Inserta un campo `[[name]]` en el cursor; `opts`: `required`, `type`, `enum`, `value`. */
|
|
821
|
+
async insertField(name, opts) {
|
|
822
|
+
var _a;
|
|
823
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.chain().focus().insertField(name, opts).run();
|
|
824
|
+
}
|
|
825
|
+
/** Inserta el siguiente marcador de firma libre (`⟦sig:N⟧`) en el cursor. */
|
|
826
|
+
async insertSignatureSlot() {
|
|
827
|
+
var _a;
|
|
828
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.chain().focus().insertSignatureSlot().run();
|
|
829
|
+
}
|
|
830
|
+
/** Enfoca el cuerpo del documento. */
|
|
831
|
+
async focusEditor() {
|
|
832
|
+
var _a;
|
|
833
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.commands.focus();
|
|
834
|
+
}
|
|
835
|
+
/** Instancia Tiptap del cuerpo (escape hatch), o `null` antes de montar. */
|
|
836
|
+
async getEditorInstance() {
|
|
837
|
+
var _a;
|
|
838
|
+
return (_a = this.editor) !== null && _a !== void 0 ? _a : null;
|
|
839
|
+
}
|
|
840
|
+
/* ── internos ── */
|
|
841
|
+
/** Listeners y atributos del editor del cuerpo. */
|
|
842
|
+
wireEditor(editor) {
|
|
843
|
+
const dom = editor.view.dom;
|
|
844
|
+
dom.classList.add('tiptap');
|
|
845
|
+
dom.setAttribute('aria-label', this.label || this.s.documentEditor);
|
|
846
|
+
dom.setAttribute('aria-multiline', 'true');
|
|
847
|
+
editor.on('transaction', this.onTransaction);
|
|
848
|
+
editor.on('transaction', this.updateImageBar);
|
|
849
|
+
editor.on('blur', this.onEditorBlur);
|
|
850
|
+
// `load` no burbujea: se escucha en captura.
|
|
851
|
+
dom.addEventListener('load', this.onBodyImageLoad, true);
|
|
852
|
+
}
|
|
853
|
+
imageModeLabel(mode) {
|
|
854
|
+
const s = this.s;
|
|
855
|
+
return { inline: s.imageLayoutInline, 'wrap-left': s.imageLayoutWrapLeft, 'wrap-right': s.imageLayoutWrapRight, break: s.imageLayoutBreak }[mode];
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Sin `.focus()`: con el mouse el mousedown de la barra ya no le quita el foco al
|
|
859
|
+
* editor, y con el teclado el foco se queda en el botón (se puede seguir en la barra).
|
|
860
|
+
* H7: el comando re-selecciona el nodo, así la barra sigue tras el cambio.
|
|
861
|
+
*/
|
|
862
|
+
setImageMode(mode) {
|
|
863
|
+
var _a;
|
|
864
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.commands.setImageLayoutMode(mode);
|
|
865
|
+
this.updateImageBar();
|
|
866
|
+
}
|
|
867
|
+
/** Imágenes que entran por una transacción del usuario sin `width` (barra, pegar, soltar, subida). */
|
|
868
|
+
trackInsertedImages(transaction) {
|
|
869
|
+
var _a, _b, _c;
|
|
870
|
+
// Deshacer/rehacer REPONE una imagen que ya existía (p. ej. una de V1 sin ancho): no es
|
|
871
|
+
// una inserción, y estamparle ancho cambiaría el HTML de V1 y vaciaría la pila de rehacer.
|
|
872
|
+
// `history$` = PluginKey('history') de prosemirror-history (el undoRedo de StarterKit).
|
|
873
|
+
if (transaction.getMeta('history$'))
|
|
874
|
+
return;
|
|
875
|
+
const found = [];
|
|
876
|
+
for (const step of transaction.steps) {
|
|
877
|
+
(_c = (_b = (_a = step.slice) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.descendants) === null || _c === void 0 ? void 0 : _c.call(_b, (n) => {
|
|
878
|
+
if (n.type.name === 'image' && !n.attrs.width && n.attrs.src)
|
|
879
|
+
found.push(n.attrs.src);
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
if (!found.length)
|
|
883
|
+
return;
|
|
884
|
+
// Un cambio de modo (setNodeMarkup) reescribe la MISMA imagen: la que ya estaba no es nueva.
|
|
885
|
+
const before = new Set();
|
|
886
|
+
transaction.before.descendants((n) => {
|
|
887
|
+
if (n.type.name === 'image' && !n.attrs.width)
|
|
888
|
+
before.add(n.attrs.src);
|
|
889
|
+
});
|
|
890
|
+
found.forEach((src) => {
|
|
891
|
+
if (!before.has(src))
|
|
892
|
+
this.pendingImageSrcs.add(src);
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
/** JSON de ProseMirror como string, o HTML de impresión (V1 incluido) por el lector tolerante. */
|
|
896
|
+
parseBody(v) {
|
|
897
|
+
const t = v.trim();
|
|
898
|
+
if (t.startsWith('{')) {
|
|
899
|
+
try {
|
|
900
|
+
return JSON.parse(t);
|
|
901
|
+
}
|
|
902
|
+
catch (_a) {
|
|
903
|
+
/* no era JSON: se lee como HTML */
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return readPrintHtml(v, 'print', this.resolvedFeatures);
|
|
907
|
+
}
|
|
908
|
+
applyBody(v) {
|
|
909
|
+
if (!this.editor)
|
|
910
|
+
return;
|
|
911
|
+
// Otro cuerpo: lo pendiente del anterior ya no es «insertado» (una V1 con la misma src no se toca).
|
|
912
|
+
this.pendingImageSrcs.clear();
|
|
913
|
+
this.applyingExternal = true;
|
|
914
|
+
try {
|
|
915
|
+
if (!v)
|
|
916
|
+
this.editor.commands.clearContent(false);
|
|
917
|
+
else
|
|
918
|
+
this.editor.commands.setContent(this.parseBody(v), { emitUpdate: false });
|
|
919
|
+
}
|
|
920
|
+
finally {
|
|
921
|
+
this.applyingExternal = false;
|
|
922
|
+
this.lastAppliedValue = v;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
emitPendingChange() {
|
|
926
|
+
if (!this.editor)
|
|
927
|
+
return;
|
|
928
|
+
this.emitFieldsIfChanged();
|
|
929
|
+
if (this.userDirty) {
|
|
930
|
+
this.userDirty = false;
|
|
931
|
+
this.coChange.emit();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
emitFieldsIfChanged() {
|
|
935
|
+
const fields = this.collectAllFields();
|
|
936
|
+
const key = JSON.stringify(fields);
|
|
937
|
+
if (key === this.lastFieldsKey)
|
|
938
|
+
return;
|
|
939
|
+
this.lastFieldsKey = key;
|
|
940
|
+
this.coFieldsChange.emit(fields);
|
|
941
|
+
}
|
|
942
|
+
syncToolbar() {
|
|
943
|
+
syncToolbarEditor(this.toolbarEl, this.activeEditor, this.imageUpload);
|
|
944
|
+
}
|
|
945
|
+
syncHeaderFromProps() {
|
|
946
|
+
this.currentHeaderHtml = this.headerHtml || '';
|
|
947
|
+
this.currentShowPageNumber = toBoolIntent(this.showPageNumber);
|
|
948
|
+
this.headerDoc = this.currentHeaderHtml ? readPrintHtml(this.currentHeaderHtml, 'print-header', this.resolvedFeatures) : null;
|
|
949
|
+
}
|
|
950
|
+
mountHeaderEditor() {
|
|
951
|
+
var _a, _b;
|
|
952
|
+
const editor = createEditor({
|
|
953
|
+
preset: 'print-header',
|
|
954
|
+
element: this.headerMountEl,
|
|
955
|
+
content: this.currentHeaderHtml ? readPrintHtml(this.currentHeaderHtml, 'print-header', this.resolvedFeatures) : null,
|
|
956
|
+
editable: true,
|
|
957
|
+
features: { fields: this.resolvedFeatures.fields },
|
|
958
|
+
labels: { fieldName: this.s.fieldNamePlaceholder },
|
|
959
|
+
imageUpload: this.imageUpload,
|
|
960
|
+
});
|
|
961
|
+
this.headerEditor = editor;
|
|
962
|
+
const dom = editor.view.dom;
|
|
963
|
+
dom.classList.add('tiptap');
|
|
964
|
+
dom.setAttribute('aria-label', this.s.documentHeader);
|
|
965
|
+
editor.on('transaction', this.onHeaderTransaction);
|
|
966
|
+
// `load` no burbujea: se escucha en captura.
|
|
967
|
+
dom.addEventListener('load', this.onHeaderImageLoad, true);
|
|
968
|
+
document.addEventListener('mousedown', this.onDocumentPointer, true);
|
|
969
|
+
(_a = this.headerBandEl) === null || _a === void 0 ? void 0 : _a.addEventListener('keydown', this.onHeaderKeydown, true);
|
|
970
|
+
// Con la banda abierta la barra edita el encabezado: su Esc también cancela la banda.
|
|
971
|
+
(_b = this.toolbarEl) === null || _b === void 0 ? void 0 : _b.addEventListener('keydown', this.onHeaderKeydown, true);
|
|
972
|
+
editor.commands.focus('end');
|
|
973
|
+
this.syncToolbar();
|
|
974
|
+
}
|
|
975
|
+
/** `resync`: devolverle la barra al cuerpo (no al desconectar: la barra ya se soltó). */
|
|
976
|
+
teardownHeaderEditor(resync = true) {
|
|
977
|
+
var _a, _b;
|
|
978
|
+
document.removeEventListener('mousedown', this.onDocumentPointer, true);
|
|
979
|
+
(_a = this.headerBandEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', this.onHeaderKeydown, true);
|
|
980
|
+
(_b = this.toolbarEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('keydown', this.onHeaderKeydown, true);
|
|
981
|
+
const ed = this.headerEditor;
|
|
982
|
+
this.headerEditor = undefined;
|
|
983
|
+
// H9: la barra suelta el editor del encabezado ANTES de que se destruya.
|
|
984
|
+
if (resync)
|
|
985
|
+
this.syncToolbar();
|
|
986
|
+
else if (this.toolbarEl && ed && this.toolbarEl.editor === ed)
|
|
987
|
+
this.toolbarEl.editor = undefined;
|
|
988
|
+
if (ed) {
|
|
989
|
+
ed.off('transaction', this.onHeaderTransaction);
|
|
990
|
+
ed.view.dom.removeEventListener('load', this.onHeaderImageLoad, true);
|
|
991
|
+
ed.destroy();
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
/** ¿El foco está en la banda (editor, interruptor, ✓) o se perdió al `<body>`? */
|
|
995
|
+
focusIsInBandOrLost() {
|
|
996
|
+
const active = document.activeElement;
|
|
997
|
+
return !active || active === document.body || !!(this.headerBandEl && this.headerBandEl.contains(active));
|
|
998
|
+
}
|
|
999
|
+
/** Tamaño, márgenes o banda cambiaron: la extensión redibuja bandas y vuelve a medir. */
|
|
1000
|
+
refreshPagination() {
|
|
1001
|
+
var _a;
|
|
1002
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.commands.setPaginationOptions({
|
|
1003
|
+
page: this.pageSizePx,
|
|
1004
|
+
margins: this.marginsPx,
|
|
1005
|
+
header: { height: this.hasHeader ? this.headerHeight : 0 },
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
applyPageStyles() {
|
|
1009
|
+
if (this.styleEl)
|
|
1010
|
+
this.styleEl.textContent = scopePageStyles(this.pageStyles, this.pageScope);
|
|
1011
|
+
}
|
|
1012
|
+
/** Cabecera de la hoja `page` dentro de una banda de salto (DOM imperativo: la pinta un widget). */
|
|
1013
|
+
buildHeaderClone(page, count) {
|
|
1014
|
+
if (!this.currentHeaderHtml)
|
|
1015
|
+
return null;
|
|
1016
|
+
const el = document.createElement('div');
|
|
1017
|
+
el.className = 'co-doc-editor__header-static';
|
|
1018
|
+
el.style.height = `${this.headerHeight}px`;
|
|
1019
|
+
const html = document.createElement('div');
|
|
1020
|
+
html.className = 'co-doc-editor__header-html';
|
|
1021
|
+
html.innerHTML = this.sanitizedHeaderHtml;
|
|
1022
|
+
el.appendChild(html);
|
|
1023
|
+
if (this.currentShowPageNumber) {
|
|
1024
|
+
const n = document.createElement('span');
|
|
1025
|
+
n.className = 'co-doc-editor__page-number';
|
|
1026
|
+
n.textContent = `${this.s.page} ${page} / ${count}`;
|
|
1027
|
+
el.appendChild(n);
|
|
1028
|
+
}
|
|
1029
|
+
return el;
|
|
1030
|
+
}
|
|
1031
|
+
updateScale() {
|
|
1032
|
+
var _a, _b, _c, _d;
|
|
1033
|
+
if (this.zoomMode !== 'custom') {
|
|
1034
|
+
const next = this.zoomMode === 'actual' ? 1 : fitScale(((_b = (_a = this.canvasEl) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0) - ZOOM_GUTTER_PX, this.pageSizePx.width);
|
|
1035
|
+
if (next !== this.scale)
|
|
1036
|
+
this.scale = next;
|
|
1037
|
+
}
|
|
1038
|
+
const h = (_d = (_c = this.stageEl) === null || _c === void 0 ? void 0 : _c.offsetHeight) !== null && _d !== void 0 ? _d : 0;
|
|
1039
|
+
if (h !== this.stageHeight)
|
|
1040
|
+
this.stageHeight = h;
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Zoom libre anclado al cursor: guarda el punto del PAPEL bajo el puntero (con la escala que el
|
|
1044
|
+
* DOM muestra ahora) y, tras el render, corrige el scroll midiendo dónde quedó. Varios eventos
|
|
1045
|
+
* antes de un render reusan el mismo punto: la hoja todavía no se movió.
|
|
1046
|
+
*/
|
|
1047
|
+
zoomTo(next, clientX, clientY) {
|
|
1048
|
+
if (!this.canvasEl || !this.stageEl || next === this.scale)
|
|
1049
|
+
return;
|
|
1050
|
+
if (!this.pendingAnchor) {
|
|
1051
|
+
const r = this.stageEl.getBoundingClientRect();
|
|
1052
|
+
this.pendingAnchor = {
|
|
1053
|
+
px: paperPoint(clientX, r.left, this.renderedScale),
|
|
1054
|
+
py: paperPoint(clientY, r.top, this.renderedScale),
|
|
1055
|
+
cx: clientX,
|
|
1056
|
+
cy: clientY,
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
else {
|
|
1060
|
+
this.pendingAnchor.cx = clientX;
|
|
1061
|
+
this.pendingAnchor.cy = clientY;
|
|
1062
|
+
}
|
|
1063
|
+
this.zoomMode = 'custom';
|
|
1064
|
+
this.scale = next;
|
|
1065
|
+
}
|
|
1066
|
+
applyPendingAnchor() {
|
|
1067
|
+
const a = this.pendingAnchor;
|
|
1068
|
+
const canvas = this.canvasEl;
|
|
1069
|
+
this.renderedScale = this.scale;
|
|
1070
|
+
if (!a || !canvas || !this.stageEl)
|
|
1071
|
+
return;
|
|
1072
|
+
this.pendingAnchor = undefined;
|
|
1073
|
+
const r = this.stageEl.getBoundingClientRect();
|
|
1074
|
+
canvas.scrollLeft += anchorCorrection(r.left, a.px, this.scale, a.cx);
|
|
1075
|
+
canvas.scrollTop += anchorCorrection(r.top, a.py, this.scale, a.cy);
|
|
1076
|
+
}
|
|
1077
|
+
setZoom(mode) {
|
|
1078
|
+
this.zoomMode = mode;
|
|
1079
|
+
this.updateScale();
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Banda de la primera hoja. Siempre montada (oculta con `hidden`); doble clic la
|
|
1083
|
+
* vuelve un editor `print-header` con el interruptor de número de página.
|
|
1084
|
+
*/
|
|
1085
|
+
renderHeaderBand() {
|
|
1086
|
+
const s = this.s;
|
|
1087
|
+
return (h("div", { key: "header-band", class: { 'co-doc-editor__header-band': true, 'co-doc-editor__header-band--editing': this.headerEditing }, part: "header-band", hidden: !this.hasHeader, ref: (el) => (this.headerBandEl = el), onDblClick: () => this.startHeaderEdit() }, this.headerEditing ? (h("div", { key: "header-editing", class: "co-doc-editor__header-editing" }, h("div", { class: "co-doc-editor__header-editor", ref: (el) => (this.headerMountEl = el) }), h("div", { class: "co-doc-editor__header-tools" }, h("co-switch", { checked: this.draftShowPageNumber, label: s.pageNumber, disabled: false, required: false, status: "default", onCoChange: (e) => {
|
|
1088
|
+
e.stopPropagation(); // su coChange burbujea: no es el coChange del documento
|
|
1089
|
+
this.draftShowPageNumber = !!e.detail;
|
|
1090
|
+
} }), h("co-tooltip", { content: s.confirmHeader }, h("co-icon-button", { icon: "check", variant: "ghost", size: "xs", boxSize: HEADER_TOOL_BOX_PX, iconSize: HEADER_TOOL_ICON_PX, label: s.confirmHeader, onClick: () => this.commitHeader(true) }))))) : (h("div", { key: "header-static", class: "co-doc-editor__header-static" }, h("div", { class: "co-doc-editor__header-html", innerHTML: this.sanitizedHeaderHtml }), this.currentShowPageNumber && h("span", { class: "co-doc-editor__page-number" }, `${s.page} 1 / ${this.pageCount}`)))));
|
|
1091
|
+
}
|
|
1092
|
+
/** Controles flotantes sobre la hoja: la barra de diseño de la imagen seleccionada. */
|
|
1093
|
+
renderOverlays() {
|
|
1094
|
+
const bar = this.imageBar;
|
|
1095
|
+
if (!bar || this.readonly || this.headerEditing)
|
|
1096
|
+
return null;
|
|
1097
|
+
return (h("div", { key: "image-bar", class: "co-doc-editor__image-bar", role: "toolbar", "aria-label": this.s.imageLayoutLabel, style: { top: `${bar.top}px`, left: `${bar.left}px` }, onMouseDown: (e) => e.preventDefault() }, IMAGE_LAYOUT_MODES.map((mode) => {
|
|
1098
|
+
const label = this.imageModeLabel(mode);
|
|
1099
|
+
const active = bar.mode === mode;
|
|
1100
|
+
// <button> nativo (no co-icon-button): necesita aria-pressed, que ningún co-* reenvía.
|
|
1101
|
+
return (h("co-tooltip", { key: mode, content: label }, h("button", { type: "button", class: { 'co-doc-editor__image-mode': true, 'co-doc-editor__image-mode--active': active }, "data-mode": mode, "aria-label": label, "aria-pressed": String(active), onClick: () => this.setImageMode(mode) }, h("co-icon", { name: IMAGE_MODE_ICONS[mode], size: IMAGE_MODE_ICON_PX, "aria-hidden": "true" }))));
|
|
1102
|
+
})));
|
|
1103
|
+
}
|
|
1104
|
+
render() {
|
|
1105
|
+
const s = this.s;
|
|
1106
|
+
const page = this.pageSizePx;
|
|
1107
|
+
const m = this.marginsPx;
|
|
1108
|
+
const headerH = this.hasHeader ? this.headerHeight : 0;
|
|
1109
|
+
const sheetVars = {
|
|
1110
|
+
'--co-doc-page-w': `${page.width}px`,
|
|
1111
|
+
'--co-doc-page-h': `${page.height}px`,
|
|
1112
|
+
'--co-doc-margin-top': `${m.top}px`,
|
|
1113
|
+
'--co-doc-margin-right': `${m.right}px`,
|
|
1114
|
+
'--co-doc-margin-bottom': `${m.bottom}px`,
|
|
1115
|
+
'--co-doc-margin-left': `${m.left}px`,
|
|
1116
|
+
'--co-doc-header-h': `${headerH}px`,
|
|
1117
|
+
'--co-doc-pages': String(this.pageCount),
|
|
1118
|
+
'--co-doc-gap': `${PAGE_GAP_PX}px`,
|
|
1119
|
+
};
|
|
1120
|
+
const frameStyle = {
|
|
1121
|
+
width: `${page.width * this.scale}px`,
|
|
1122
|
+
height: this.stageHeight ? `${this.stageHeight * this.scale}px` : 'auto',
|
|
1123
|
+
};
|
|
1124
|
+
const zoomButton = (mode, label) => (h("button", { key: 'da1c68e89c973899e18720d3cf25b861d158f7c1', type: "button", class: { 'co-doc-editor__zoom-btn': true, 'co-doc-editor__zoom-btn--active': this.zoomMode === mode }, "aria-pressed": String(this.zoomMode === mode), onClick: () => this.setZoom(mode) }, label));
|
|
1125
|
+
return (h(Host, { key: '254d9df102441f867dc46eb71039df92d99ad102' }, h("div", { key: '29723bbee5dd3eae004c6df4c330e8589388636d', class: { 'co-doc-editor': true, 'co-doc-editor--readonly': this.readonly, 'co-doc-editor--loading': !this.ready }, part: "wrapper" }, h("div", { key: '9257d370d8547f08402fbaaed2d4a6aa30d94e70', class: "co-doc-editor__bar", part: "bar" }, !this.readonly && (h("co-rich-text-toolbar", { key: '8fff97e80464889cb0e6e60d8d9f69308f987e9f', class: "co-doc-editor__toolbar", part: "toolbar", variant: "document", position: "top", disabled: false, locale: this.locale, attachmentsEnabled: false, documentHeaderEnabled: this.documentHeaderEnabled, extraItems: this.parsedExtraItems, onCoAction: this.handleToolbarAction, ref: (el) => (this.toolbarEl = el) })), h("div", { key: '00ff09c93887815f84bbb9c68e9485fd64c3c0b6', class: "co-doc-editor__zoom", role: "group", "aria-label": s.zoom }, this.zoomMode === 'custom' && h("span", { key: '956f0fa4e803a0e27fa32a28116d1e397a2dc402', class: "co-doc-editor__zoom-level" }, `${Math.round(this.scale * 100)} %`), zoomButton('fit', s.zoomFit), zoomButton('actual', s.zoomActual))), h("div", { key: '4a44bc41d6a641a5f4543422bd7263f2bd962f99', class: "co-doc-editor__body" }, h("div", { key: '467491e684b9487d507861d54c37b06b752216f4', class: "co-doc-editor__canvas", part: "canvas", ref: (el) => (this.canvasEl = el) }, h("div", { key: '66653efbda8e0dffb7bc1fdb07d0be31b4f5c8a9', class: "co-doc-editor__zoom-frame", style: frameStyle }, h("div", { key: '06407fc5177c21f4edc60b900a17a8c44ef193ab', class: "co-doc-editor__stage", style: { transform: `scale(${this.scale})` }, ref: (el) => (this.stageEl = el) }, h("div", { key: '440f1ced158d76650618bc0f153c3201503550a1', class: "co-doc-editor__sheet", part: "sheet", "data-co-doc": this.instanceId, style: sheetVars }, h("style", { key: "page-styles", "data-co-doc-page-styles": "", ref: (el) => (this.styleEl = el) }), h("div", { key: "paper", class: "co-doc-editor__paper", "data-theme": "light" }, this.renderHeaderBand(), h("div", { key: "content", class: "co-doc-editor__content", ref: (el) => (this.contentEl = el) }), this.renderOverlays()))))), h("slot", { key: '1478889436471ed2707db4e361d878faf7c56f2e', name: "aside" })))));
|
|
1126
|
+
}
|
|
1127
|
+
get el() { return getElement(this); }
|
|
1128
|
+
static get watchers() { return {
|
|
1129
|
+
"value": [{
|
|
1130
|
+
"onValueChange": 0
|
|
1131
|
+
}],
|
|
1132
|
+
"readonly": [{
|
|
1133
|
+
"onReadonlyChange": 0
|
|
1134
|
+
}],
|
|
1135
|
+
"pageSize": [{
|
|
1136
|
+
"onPageGeometryChange": 0
|
|
1137
|
+
}],
|
|
1138
|
+
"margins": [{
|
|
1139
|
+
"onPageGeometryChange": 0
|
|
1140
|
+
}],
|
|
1141
|
+
"headerHeight": [{
|
|
1142
|
+
"onPageGeometryChange": 0
|
|
1143
|
+
}],
|
|
1144
|
+
"headerHtml": [{
|
|
1145
|
+
"onHeaderPropsChange": 0
|
|
1146
|
+
}],
|
|
1147
|
+
"showPageNumber": [{
|
|
1148
|
+
"onHeaderPropsChange": 0
|
|
1149
|
+
}],
|
|
1150
|
+
"pageStyles": [{
|
|
1151
|
+
"onPageStylesChange": 0
|
|
1152
|
+
}],
|
|
1153
|
+
"label": [{
|
|
1154
|
+
"onLabelChange": 0
|
|
1155
|
+
}],
|
|
1156
|
+
"locale": [{
|
|
1157
|
+
"onLabelChange": 0
|
|
1158
|
+
}, {
|
|
1159
|
+
"onLocaleChange": 0
|
|
1160
|
+
}]
|
|
1161
|
+
}; }
|
|
1162
|
+
};
|
|
1163
|
+
CoDocumentEditor.style = coDocumentEditorCss();
|
|
1164
|
+
|
|
1165
|
+
export { CoDocumentEditor as co_document_editor };
|