@caspeco/casper-ui-library 9.12.0 → 10.0.0
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/dist/_virtual/compiler-runtime.js +5 -0
- package/dist/_virtual/compiler-runtime2.js +4 -0
- package/dist/_virtual/react-compiler-runtime.development.js +4 -0
- package/dist/_virtual/react-compiler-runtime.production.js +4 -0
- package/dist/components/accordion/accordion-item.d.ts +3 -2
- package/dist/components/accordion/accordion-item.d.ts.map +1 -1
- package/dist/components/accordion/accordion-item.js +36 -19
- package/dist/components/accordion/accordion-panel.d.ts +1 -1
- package/dist/components/accordion/accordion-panel.d.ts.map +1 -1
- package/dist/components/accordion/accordion-panel.js +13 -5
- package/dist/components/accordion/accordion.composition.d.ts +3 -3
- package/dist/components/accordion/accordion.composition.d.ts.map +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +18 -6
- package/dist/components/alert/alert.composition.d.ts +5 -5
- package/dist/components/alert/alert.composition.d.ts.map +1 -1
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +58 -74
- package/dist/components/alert/helper.d.ts +1 -1
- package/dist/components/alert/helper.d.ts.map +1 -1
- package/dist/components/alert/helper.js +10 -15
- package/dist/components/badge/badge-recipe.js +13 -19
- package/dist/components/badge/badge.composition.d.ts +3 -3
- package/dist/components/badge/badge.composition.d.ts.map +1 -1
- package/dist/components/badge/badge.js +70 -31
- package/dist/components/box/box.composition.d.ts +6 -6
- package/dist/components/box/box.composition.d.ts.map +1 -1
- package/dist/components/box/box.js +10 -5
- package/dist/components/breadcrumbs/breadcrumb-item.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumb-item.d.ts.map +1 -1
- package/dist/components/breadcrumbs/breadcrumb-item.js +16 -5
- package/dist/components/breadcrumbs/breadcrumb-link.js +19 -17
- package/dist/components/breadcrumbs/breadcrumbs.composition.d.ts +2 -2
- package/dist/components/breadcrumbs/breadcrumbs.composition.d.ts.map +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.js +82 -80
- package/dist/components/button/button-recipe.js +6 -2
- package/dist/components/button/button.composition.d.ts +5 -5
- package/dist/components/button/button.composition.d.ts.map +1 -1
- package/dist/components/button/button.js +38 -42
- package/dist/components/checkbox/checkbox-icon.d.ts +2 -1
- package/dist/components/checkbox/checkbox-icon.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.composition.d.ts +3 -3
- package/dist/components/checkbox/checkbox.composition.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +34 -53
- package/dist/components/checkbox/icons/check.js +1 -6
- package/dist/components/checkbox/icons/minus.js +1 -6
- package/dist/components/checkbox/icons/plus.js +1 -6
- package/dist/components/checkbox-group/checkbox-group.composition.d.ts +2 -2
- package/dist/components/checkbox-group/checkbox-group.composition.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +13 -4
- package/dist/components/collapsible/collapsible.composition.d.ts +3 -3
- package/dist/components/collapsible/collapsible.composition.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.d.ts +1 -1
- package/dist/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.js +93 -108
- package/dist/components/combobox/combobox-button.d.ts +1 -1
- package/dist/components/combobox/combobox-button.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.js +131 -174
- package/dist/components/combobox/combobox-item.d.ts +1 -1
- package/dist/components/combobox/combobox-item.d.ts.map +1 -1
- package/dist/components/combobox/combobox-item.js +18 -11
- package/dist/components/combobox/combobox-menu.d.ts +2 -2
- package/dist/components/combobox/combobox-menu.d.ts.map +1 -1
- package/dist/components/combobox/combobox-menu.js +171 -270
- package/dist/components/combobox/combobox.composition.d.ts +9 -9
- package/dist/components/combobox/combobox.composition.d.ts.map +1 -1
- package/dist/components/combobox/combobox.d.ts +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +286 -209
- package/dist/components/combobox/types.d.ts +7 -7
- package/dist/components/combobox/types.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.d.ts +2 -1
- package/dist/components/date-picker/base-date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.js +242 -240
- package/dist/components/date-picker/date-multi-picker.d.ts +8 -0
- package/dist/components/date-picker/date-multi-picker.d.ts.map +1 -0
- package/dist/components/date-picker/date-multi-picker.js +30 -0
- package/dist/components/date-picker/date-picker-date-cell.d.ts +1 -1
- package/dist/components/date-picker/date-picker-date-cell.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-date-cell.js +111 -117
- package/dist/components/date-picker/date-picker-header.d.ts +1 -1
- package/dist/components/date-picker/date-picker-header.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-header.js +153 -120
- package/dist/components/date-picker/date-picker-week-cell.d.ts +1 -1
- package/dist/components/date-picker/date-picker-week-cell.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-week-cell.js +41 -36
- package/dist/components/date-picker/date-picker.composition.d.ts +7 -4
- package/dist/components/date-picker/date-picker.composition.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +24 -45
- package/dist/components/date-picker/date-range-picker.d.ts +1 -1
- package/dist/components/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-range-picker.js +23 -41
- package/dist/components/date-picker/date-week-picker.d.ts +1 -1
- package/dist/components/date-picker/date-week-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-week-picker.js +18 -36
- package/dist/components/date-picker/helper.js +1 -1
- package/dist/components/date-picker/index.d.ts +2 -1
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/types.d.ts +16 -0
- package/dist/components/date-picker/types.d.ts.map +1 -1
- package/dist/components/divider/divider.composition.d.ts +2 -2
- package/dist/components/divider/divider.composition.d.ts.map +1 -1
- package/dist/components/divider/divider.d.ts +1 -1
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/divider.js +16 -19
- package/dist/components/drawer/drawer-recipe.js +25 -5
- package/dist/components/drawer/drawer.composition.d.ts +5 -5
- package/dist/components/drawer/drawer.composition.d.ts.map +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +38 -36
- package/dist/components/drawer/inline-drawer.d.ts +1 -1
- package/dist/components/drawer/inline-drawer.d.ts.map +1 -1
- package/dist/components/drawer/inline-drawer.js +62 -57
- package/dist/components/drawer/use-drawer-key-down.js +15 -8
- package/dist/components/fieldset/fieldset-error-text.d.ts +1 -1
- package/dist/components/fieldset/fieldset-error-text.d.ts.map +1 -1
- package/dist/components/fieldset/fieldset-error-text.js +13 -5
- package/dist/components/fieldset/fieldset-helper-text.d.ts +1 -1
- package/dist/components/fieldset/fieldset-helper-text.d.ts.map +1 -1
- package/dist/components/fieldset/fieldset-helper-text.js +13 -5
- package/dist/components/fieldset/fieldset-legend.d.ts +1 -1
- package/dist/components/fieldset/fieldset-legend.d.ts.map +1 -1
- package/dist/components/fieldset/fieldset-legend.js +13 -5
- package/dist/components/fieldset/fieldset.d.ts +1 -1
- package/dist/components/fieldset/fieldset.d.ts.map +1 -1
- package/dist/components/fieldset/fieldset.js +15 -5
- package/dist/components/flex/flex.composition.d.ts +2 -2
- package/dist/components/flex/flex.composition.d.ts.map +1 -1
- package/dist/components/flex/flex.d.ts +1 -1
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/flex.js +13 -5
- package/dist/components/form-control/form-control.composition.d.ts +6 -6
- package/dist/components/form-control/form-control.composition.d.ts.map +1 -1
- package/dist/components/form-control/form-control.d.ts +1 -1
- package/dist/components/form-control/form-control.d.ts.map +1 -1
- package/dist/components/form-control/form-control.js +17 -22
- package/dist/components/form-control/form-error-message.d.ts +1 -1
- package/dist/components/form-control/form-error-message.d.ts.map +1 -1
- package/dist/components/form-control/form-error-message.js +13 -5
- package/dist/components/form-control/form-helper-text.d.ts +1 -1
- package/dist/components/form-control/form-helper-text.d.ts.map +1 -1
- package/dist/components/form-control/form-helper-text.js +13 -5
- package/dist/components/form-control/form-label.d.ts +1 -1
- package/dist/components/form-control/form-label.d.ts.map +1 -1
- package/dist/components/form-control/form-label.js +24 -11
- package/dist/components/grid/grid-item.d.ts +1 -1
- package/dist/components/grid/grid-item.d.ts.map +1 -1
- package/dist/components/grid/grid-item.js +12 -4
- package/dist/components/grid/grid.composition.d.ts +2 -2
- package/dist/components/grid/grid.composition.d.ts.map +1 -1
- package/dist/components/grid/grid.d.ts +1 -1
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +13 -5
- package/dist/components/heading/heading.composition.d.ts +3 -3
- package/dist/components/heading/heading.composition.d.ts.map +1 -1
- package/dist/components/heading/heading.d.ts +1 -1
- package/dist/components/heading/heading.d.ts.map +1 -1
- package/dist/components/heading/heading.js +21 -29
- package/dist/components/highlight/highlight.composition.d.ts +2 -2
- package/dist/components/highlight/highlight.composition.d.ts.map +1 -1
- package/dist/components/highlight/highlight.d.ts +1 -1
- package/dist/components/highlight/highlight.d.ts.map +1 -1
- package/dist/components/highlight/highlight.js +19 -15
- package/dist/components/icon/create-icon.js +24 -15
- package/dist/components/icon/icon.composition.d.ts +1 -1
- package/dist/components/icon/icon.composition.d.ts.map +1 -1
- package/dist/components/icon/icons/absence-icon.js +1 -4
- package/dist/components/icon/icons/accessibility-icon.js +1 -4
- package/dist/components/icon/icons/add-absence-icon.js +1 -4
- package/dist/components/icon/icons/add-emoji-icon.js +1 -4
- package/dist/components/icon/icons/add-icon.js +1 -4
- package/dist/components/icon/icons/apple-icon.js +1 -4
- package/dist/components/icon/icons/apps-icon.js +1 -4
- package/dist/components/icon/icons/archive-icon.js +4 -5
- package/dist/components/icon/icons/area-icon.js +1 -4
- package/dist/components/icon/icons/at-icon.js +1 -4
- package/dist/components/icon/icons/attachment-icon.js +1 -4
- package/dist/components/icon/icons/baby-icon.js +1 -4
- package/dist/components/icon/icons/back-icon.js +1 -4
- package/dist/components/icon/icons/backspace-icon.js +1 -4
- package/dist/components/icon/icons/bank-icon.js +1 -4
- package/dist/components/icon/icons/bank-id-icon.js +1 -4
- package/dist/components/icon/icons/barcode-icon.js +1 -4
- package/dist/components/icon/icons/bell-icon.js +1 -4
- package/dist/components/icon/icons/bolt-icon.js +4 -5
- package/dist/components/icon/icons/calendar-icon.js +1 -4
- package/dist/components/icon/icons/camera-icon.js +1 -4
- package/dist/components/icon/icons/cancel-icon.js +1 -4
- package/dist/components/icon/icons/card-icon.js +1 -4
- package/dist/components/icon/icons/cart-icon.js +1 -4
- package/dist/components/icon/icons/caspeco-icon.js +4 -5
- package/dist/components/icon/icons/channels-icon.js +1 -4
- package/dist/components/icon/icons/chart-icon.js +1 -4
- package/dist/components/icon/icons/chart-line-icon.js +1 -4
- package/dist/components/icon/icons/chart-mixed-icon.js +1 -4
- package/dist/components/icon/icons/chart-pie-icon.js +1 -4
- package/dist/components/icon/icons/chart-scatter-icon.js +1 -4
- package/dist/components/icon/icons/check-icon.js +1 -4
- package/dist/components/icon/icons/checkbox-icon.js +1 -4
- package/dist/components/icon/icons/chevron-left-icon.js +1 -4
- package/dist/components/icon/icons/chevron-right-icon.js +1 -4
- package/dist/components/icon/icons/child-icon.js +1 -4
- package/dist/components/icon/icons/circle-info-icon.js +1 -4
- package/dist/components/icon/icons/circle-parking-icon.js +1 -4
- package/dist/components/icon/icons/circle-question-icon.js +1 -4
- package/dist/components/icon/icons/circle-select-icon.js +1 -4
- package/dist/components/icon/icons/circle-success-icon.js +1 -4
- package/dist/components/icon/icons/circle-user-icon.js +1 -4
- package/dist/components/icon/icons/clear-icon.js +1 -4
- package/dist/components/icon/icons/close-icon.js +1 -4
- package/dist/components/icon/icons/closed-icon.js +1 -4
- package/dist/components/icon/icons/collapse-icon.js +1 -4
- package/dist/components/icon/icons/color-icon.js +1 -4
- package/dist/components/icon/icons/columns-icon.js +1 -4
- package/dist/components/icon/icons/comment-add-icon.js +1 -4
- package/dist/components/icon/icons/comment-icon.js +1 -4
- package/dist/components/icon/icons/cookies-icon.js +1 -4
- package/dist/components/icon/icons/copy-icon.js +1 -4
- package/dist/components/icon/icons/date-icon.js +1 -4
- package/dist/components/icon/icons/decrease-icon.js +1 -4
- package/dist/components/icon/icons/delete-icon.js +1 -4
- package/dist/components/icon/icons/deliverect-icon.js +1 -4
- package/dist/components/icon/icons/delivery-icon.js +1 -4
- package/dist/components/icon/icons/description-icon.js +1 -4
- package/dist/components/icon/icons/discount-icon.js +1 -4
- package/dist/components/icon/icons/distribute-evenly-icon.js +1 -4
- package/dist/components/icon/icons/door-closed-icon.js +1 -4
- package/dist/components/icon/icons/door-open-icon.js +1 -4
- package/dist/components/icon/icons/down-icon.js +1 -4
- package/dist/components/icon/icons/eat-in-icon.js +1 -4
- package/dist/components/icon/icons/edit-icon.js +1 -4
- package/dist/components/icon/icons/email-icon.js +1 -4
- package/dist/components/icon/icons/error-icon.js +1 -4
- package/dist/components/icon/icons/expand-icon.js +1 -4
- package/dist/components/icon/icons/export-icon.js +1 -4
- package/dist/components/icon/icons/extract-icon.js +1 -4
- package/dist/components/icon/icons/facebook-icon.js +1 -4
- package/dist/components/icon/icons/failed-print-icon.js +1 -4
- package/dist/components/icon/icons/file-icon.js +1 -4
- package/dist/components/icon/icons/filter-icon.js +1 -4
- package/dist/components/icon/icons/folder-icon.js +1 -4
- package/dist/components/icon/icons/foodora-icon.js +1 -4
- package/dist/components/icon/icons/forward-icon.js +1 -4
- package/dist/components/icon/icons/glovo-icon.js +4 -5
- package/dist/components/icon/icons/goal-icon.js +1 -4
- package/dist/components/icon/icons/google-icon.js +1 -4
- package/dist/components/icon/icons/grip-more-icon.js +1 -4
- package/dist/components/icon/icons/hash-icon.js +1 -4
- package/dist/components/icon/icons/hexagon-error-icon.js +1 -4
- package/dist/components/icon/icons/hide-icon.js +1 -4
- package/dist/components/icon/icons/history-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-anchor-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-asterisk-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-beer-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-bicycle-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-binoculars-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-bomb-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-car-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-cocktail-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-gem-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-heart-full-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-heart-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-magnet-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-money-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-moon-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-music-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-star-full-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-star-half-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-star-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-tint-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-tree-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-utensils-icon.js +1 -4
- package/dist/components/icon/icons/icon-picker-wheelchair-icon.js +1 -4
- package/dist/components/icon/icons/image-icon.js +1 -4
- package/dist/components/icon/icons/import-icon.js +1 -4
- package/dist/components/icon/icons/inbox-icon.js +1 -4
- package/dist/components/icon/icons/increase-icon.js +1 -4
- package/dist/components/icon/icons/indeterminate-icon.js +1 -4
- package/dist/components/icon/icons/info-icon.js +1 -4
- package/dist/components/icon/icons/inheritance-icon.js +1 -4
- package/dist/components/icon/icons/just-eat-icon.js +1 -4
- package/dist/components/icon/icons/karma-icon.js +1 -4
- package/dist/components/icon/icons/key-command-icon.js +1 -4
- package/dist/components/icon/icons/key-enter-icon.js +1 -4
- package/dist/components/icon/icons/key-icon.js +1 -4
- package/dist/components/icon/icons/key-option-icon.js +1 -4
- package/dist/components/icon/icons/language-icon.js +1 -4
- package/dist/components/icon/icons/link-broken-icon.js +1 -4
- package/dist/components/icon/icons/link-external-icon.js +1 -4
- package/dist/components/icon/icons/link-icon.js +1 -4
- package/dist/components/icon/icons/list-ol-icon.js +1 -4
- package/dist/components/icon/icons/list-ul-icon.js +1 -4
- package/dist/components/icon/icons/loading-icon.js +1 -4
- package/dist/components/icon/icons/location-icon.js +1 -4
- package/dist/components/icon/icons/lock-icon.js +1 -4
- package/dist/components/icon/icons/log-in-icon.js +1 -4
- package/dist/components/icon/icons/log-out-icon.js +1 -4
- package/dist/components/icon/icons/map-icon.js +1 -4
- package/dist/components/icon/icons/maximize-icon.js +1 -4
- package/dist/components/icon/icons/members-icon.js +1 -4
- package/dist/components/icon/icons/menu-hide-icon.js +1 -4
- package/dist/components/icon/icons/menu-icon.js +1 -4
- package/dist/components/icon/icons/menu-show-icon.js +1 -4
- package/dist/components/icon/icons/message-add-icon.js +1 -4
- package/dist/components/icon/icons/message-icon.js +1 -4
- package/dist/components/icon/icons/message-lines-icon.js +1 -4
- package/dist/components/icon/icons/minimize-icon.js +1 -4
- package/dist/components/icon/icons/minimize-window-icon.js +1 -4
- package/dist/components/icon/icons/mobile-rotate-icon.js +1 -4
- package/dist/components/icon/icons/module-accounting-icon.js +1 -4
- package/dist/components/icon/icons/module-ai-forecast-icon.js +1 -4
- package/dist/components/icon/icons/module-app-icon.js +1 -4
- package/dist/components/icon/icons/module-articles-icon.js +1 -4
- package/dist/components/icon/icons/module-benchmark-icon.js +1 -4
- package/dist/components/icon/icons/module-booking-icon.js +1 -4
- package/dist/components/icon/icons/module-cai-icon.js +1 -4
- package/dist/components/icon/icons/module-campaigns-icon.js +1 -4
- package/dist/components/icon/icons/module-cashier-icon.js +1 -4
- package/dist/components/icon/icons/module-communication-icon.js +1 -4
- package/dist/components/icon/icons/module-copilot-icon.js +1 -4
- package/dist/components/icon/icons/module-dashboard-icon.js +1 -4
- package/dist/components/icon/icons/module-document-icon.js +1 -4
- package/dist/components/icon/icons/module-employees-icon.js +1 -4
- package/dist/components/icon/icons/module-feed-icon.js +1 -4
- package/dist/components/icon/icons/module-history-icon.js +1 -4
- package/dist/components/icon/icons/module-home-icon.js +1 -4
- package/dist/components/icon/icons/module-insights-icon.js +1 -4
- package/dist/components/icon/icons/module-kds-icon.js +1 -4
- package/dist/components/icon/icons/module-members-icon.js +1 -4
- package/dist/components/icon/icons/module-menus-icon.js +1 -4
- package/dist/components/icon/icons/module-my-city-icon.js +1 -4
- package/dist/components/icon/icons/module-notification-center-icon.js +1 -4
- package/dist/components/icon/icons/module-online-order-icon.js +1 -4
- package/dist/components/icon/icons/module-organisation-icon.js +1 -4
- package/dist/components/icon/icons/module-pos-icon.js +1 -4
- package/dist/components/icon/icons/module-pulse-icon.js +1 -4
- package/dist/components/icon/icons/module-result-icon.js +1 -4
- package/dist/components/icon/icons/module-salary-icon.js +1 -4
- package/dist/components/icon/icons/module-schedule-icon.js +1 -4
- package/dist/components/icon/icons/module-settings-alt-icon.js +1 -4
- package/dist/components/icon/icons/module-settings-icon.js +1 -4
- package/dist/components/icon/icons/module-support-icon.js +1 -4
- package/dist/components/icon/icons/module-survey-icon.js +1 -4
- package/dist/components/icon/icons/module-table-map-icon.js +4 -5
- package/dist/components/icon/icons/module-tablet-icon.js +1 -4
- package/dist/components/icon/icons/module-time-icon.js +1 -4
- package/dist/components/icon/icons/module-timeline-icon.js +1 -4
- package/dist/components/icon/icons/module-tip-icon.js +1 -4
- package/dist/components/icon/icons/module-to-do-icon.js +1 -4
- package/dist/components/icon/icons/module-tools-icon.js +1 -4
- package/dist/components/icon/icons/module-top-list-icon.js +1 -4
- package/dist/components/icon/icons/module-web-charts-icon.js +1 -4
- package/dist/components/icon/icons/module-web-icon.js +1 -4
- package/dist/components/icon/icons/more-horizontal-icon.js +1 -4
- package/dist/components/icon/icons/more-vertical-icon.js +1 -4
- package/dist/components/icon/icons/nfc-icon.js +1 -4
- package/dist/components/icon/icons/no-cart-icon.js +1 -4
- package/dist/components/icon/icons/note-icon.js +1 -4
- package/dist/components/icon/icons/number-icon.js +4 -5
- package/dist/components/icon/icons/open-modal-icon.js +1 -4
- package/dist/components/icon/icons/parking-icon.js +1 -4
- package/dist/components/icon/icons/party-horn-icon.js +1 -4
- package/dist/components/icon/icons/pause-icon.js +1 -4
- package/dist/components/icon/icons/payment-card-icon.js +1 -4
- package/dist/components/icon/icons/payment-cash-icon.js +1 -4
- package/dist/components/icon/icons/payment-generic-icon.js +1 -4
- package/dist/components/icon/icons/payment-giftcard-icon.js +1 -4
- package/dist/components/icon/icons/payment-hotel-icon.js +1 -4
- package/dist/components/icon/icons/payment-invoice-icon.js +1 -4
- package/dist/components/icon/icons/percentage-icon.js +1 -4
- package/dist/components/icon/icons/phone-icon.js +1 -4
- package/dist/components/icon/icons/pin-icon.js +1 -4
- package/dist/components/icon/icons/pin-map-icon.js +1 -4
- package/dist/components/icon/icons/play-icon.js +1 -4
- package/dist/components/icon/icons/preview-icon.js +1 -4
- package/dist/components/icon/icons/print-icon.js +1 -4
- package/dist/components/icon/icons/privacy-icon.js +1 -4
- package/dist/components/icon/icons/product-admin-icon.js +1 -4
- package/dist/components/icon/icons/product-analytics-icon.js +1 -4
- package/dist/components/icon/icons/product-booking-icon.js +1 -4
- package/dist/components/icon/icons/product-checkout-icon.js +1 -4
- package/dist/components/icon/icons/product-my-pages-icon.js +1 -4
- package/dist/components/icon/icons/product-staff-icon.js +1 -4
- package/dist/components/icon/icons/puck-icon.js +1 -4
- package/dist/components/icon/icons/qr-code-icon.js +1 -4
- package/dist/components/icon/icons/question-icon.js +1 -4
- package/dist/components/icon/icons/radio-icon.js +1 -4
- package/dist/components/icon/icons/receipt-icon.js +1 -4
- package/dist/components/icon/icons/redo-icon.js +1 -4
- package/dist/components/icon/icons/refund-icon.js +1 -4
- package/dist/components/icon/icons/remove-icon.js +1 -4
- package/dist/components/icon/icons/replace-icon.js +1 -4
- package/dist/components/icon/icons/schedule-icon.js +1 -4
- package/dist/components/icon/icons/search-icon.js +1 -4
- package/dist/components/icon/icons/select-icon.js +1 -4
- package/dist/components/icon/icons/send-icon.js +1 -4
- package/dist/components/icon/icons/share-icon.js +1 -4
- package/dist/components/icon/icons/show-icon.js +1 -4
- package/dist/components/icon/icons/shuffle-icon.js +1 -4
- package/dist/components/icon/icons/sidebar-hide-icon.js +1 -4
- package/dist/components/icon/icons/sidebar-left-icon.js +1 -4
- package/dist/components/icon/icons/sidebar-right-icon.js +1 -4
- package/dist/components/icon/icons/sidebar-show-icon.js +1 -4
- package/dist/components/icon/icons/sliders-icon.js +1 -4
- package/dist/components/icon/icons/slightly-sad-icon.js +1 -4
- package/dist/components/icon/icons/smile-icon.js +1 -4
- package/dist/components/icon/icons/sort-asc-icon.js +1 -4
- package/dist/components/icon/icons/sort-desc-icon.js +1 -4
- package/dist/components/icon/icons/split-icon.js +1 -4
- package/dist/components/icon/icons/status-icon.js +1 -4
- package/dist/components/icon/icons/stop-icon.js +1 -4
- package/dist/components/icon/icons/submenu-icon.js +1 -4
- package/dist/components/icon/icons/success-icon.js +1 -4
- package/dist/components/icon/icons/swap-icon.js +1 -4
- package/dist/components/icon/icons/swatch-icon.js +1 -4
- package/dist/components/icon/icons/sweat-icon.js +1 -4
- package/dist/components/icon/icons/table-icon.js +1 -4
- package/dist/components/icon/icons/table-map-icon.js +1 -4
- package/dist/components/icon/icons/take-away-dot-com-icon.js +1 -4
- package/dist/components/icon/icons/take-away-icon.js +1 -4
- package/dist/components/icon/icons/talk-icon.js +1 -4
- package/dist/components/icon/icons/thumbtack-icon.js +1 -4
- package/dist/components/icon/icons/time-icon.js +1 -4
- package/dist/components/icon/icons/timeline-icon.js +1 -4
- package/dist/components/icon/icons/tip-icon.js +1 -4
- package/dist/components/icon/icons/title-icon.js +1 -4
- package/dist/components/icon/icons/translate-icon.js +1 -4
- package/dist/components/icon/icons/tree-view-collapse-icon.js +1 -4
- package/dist/components/icon/icons/tree-view-expand-icon.js +1 -4
- package/dist/components/icon/icons/tree-view-last-icon.js +1 -4
- package/dist/components/icon/icons/trend-down-icon.js +1 -4
- package/dist/components/icon/icons/trend-up-icon.js +1 -4
- package/dist/components/icon/icons/triangle-warning-icon.js +1 -4
- package/dist/components/icon/icons/trivec-icon.js +4 -5
- package/dist/components/icon/icons/uber-eats-icon.js +1 -4
- package/dist/components/icon/icons/undo-icon.js +1 -4
- package/dist/components/icon/icons/unlock-icon.js +1 -4
- package/dist/components/icon/icons/unwrap-content-icon.js +1 -4
- package/dist/components/icon/icons/up-icon.js +1 -4
- package/dist/components/icon/icons/user-group-icon.js +1 -4
- package/dist/components/icon/icons/user-icon.js +1 -4
- package/dist/components/icon/icons/user-permissions-icon.js +1 -4
- package/dist/components/icon/icons/user-wait-icon.js +1 -4
- package/dist/components/icon/icons/users-icon.js +1 -4
- package/dist/components/icon/icons/version-control-icon.js +1 -4
- package/dist/components/icon/icons/volume-high-icon.js +1 -4
- package/dist/components/icon/icons/volume-icon.js +1 -4
- package/dist/components/icon/icons/volume-low-icon.js +1 -4
- package/dist/components/icon/icons/volume-off-icon.js +1 -4
- package/dist/components/icon/icons/warning-icon.js +1 -4
- package/dist/components/icon/icons/waste-icon.js +1 -4
- package/dist/components/icon/icons/wifi-icon.js +1 -4
- package/dist/components/icon/icons/wifi-off-icon.js +1 -4
- package/dist/components/icon/icons/wolt-icon.js +1 -4
- package/dist/components/icon/icons/wrap-content-icon.js +1 -4
- package/dist/components/icon-button/icon-button.composition.d.ts +4 -4
- package/dist/components/icon-button/icon-button.composition.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +38 -32
- package/dist/components/image/image.composition.d.ts +1 -1
- package/dist/components/image/image.composition.d.ts.map +1 -1
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/image.d.ts.map +1 -1
- package/dist/components/image/image.js +12 -5
- package/dist/components/image-upload/image-cropper.d.ts +2 -1
- package/dist/components/image-upload/image-cropper.d.ts.map +1 -1
- package/dist/components/image-upload/image-cropper.helper.d.ts +1 -1
- package/dist/components/image-upload/image-cropper.helper.d.ts.map +1 -1
- package/dist/components/image-upload/image-cropper.helper.js +38 -40
- package/dist/components/image-upload/image-cropper.js +63 -73
- package/dist/components/image-upload/image-upload-dropzone.d.ts +2 -1
- package/dist/components/image-upload/image-upload-dropzone.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-dropzone.js +102 -72
- package/dist/components/image-upload/image-upload-icons.d.ts +5 -5
- package/dist/components/image-upload/image-upload-icons.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-icons.js +19 -26
- package/dist/components/image-upload/image-upload-modal.d.ts +1 -1
- package/dist/components/image-upload/image-upload-modal.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-modal.js +54 -95
- package/dist/components/image-upload/image-upload.composition.d.ts +3 -3
- package/dist/components/image-upload/image-upload.composition.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload.d.ts +1 -1
- package/dist/components/image-upload/image-upload.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload.js +69 -78
- package/dist/components/input/input.composition.d.ts +9 -9
- package/dist/components/input/input.composition.d.ts.map +1 -1
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.js +54 -58
- package/dist/components/input/types.d.ts +5 -4
- package/dist/components/input/types.d.ts.map +1 -1
- package/dist/components/link/link.composition.d.ts +2 -2
- package/dist/components/link/link.composition.d.ts.map +1 -1
- package/dist/components/link/link.d.ts +1 -1
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/link/link.js +11 -3
- package/dist/components/list/list-item.d.ts +1 -1
- package/dist/components/list/list-item.d.ts.map +1 -1
- package/dist/components/list/list-item.js +13 -5
- package/dist/components/list/list.composition.d.ts +1 -1
- package/dist/components/list/list.composition.d.ts.map +1 -1
- package/dist/components/list/list.d.ts +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.js +17 -11
- package/dist/components/menu/menu-box-button.js +16 -8
- package/dist/components/menu/menu-button.d.ts +1 -1
- package/dist/components/menu/menu-button.d.ts.map +1 -1
- package/dist/components/menu/menu-button.js +15 -5
- package/dist/components/menu/menu-divider.d.ts +2 -1
- package/dist/components/menu/menu-divider.d.ts.map +1 -1
- package/dist/components/menu/menu-divider.js +21 -12
- package/dist/components/menu/menu-group.d.ts +3 -2
- package/dist/components/menu/menu-group.d.ts.map +1 -1
- package/dist/components/menu/menu-group.js +131 -129
- package/dist/components/menu/menu-icon-button.d.ts +1 -1
- package/dist/components/menu/menu-icon-button.d.ts.map +1 -1
- package/dist/components/menu/menu-icon-button.js +10 -5
- package/dist/components/menu/menu-item.d.ts +1 -1
- package/dist/components/menu/menu-item.d.ts.map +1 -1
- package/dist/components/menu/menu-item.js +43 -32
- package/dist/components/menu/menu-list.d.ts +1 -1
- package/dist/components/menu/menu-list.d.ts.map +1 -1
- package/dist/components/menu/menu-list.js +14 -4
- package/dist/components/menu/menu-recipe.js +6 -2
- package/dist/components/menu/menu.composition.d.ts +10 -10
- package/dist/components/menu/menu.composition.d.ts.map +1 -1
- package/dist/components/menu/menu.js +36 -19
- package/dist/components/message/message.composition.d.ts +1 -1
- package/dist/components/message/message.composition.d.ts.map +1 -1
- package/dist/components/message/message.d.ts +1 -1
- package/dist/components/message/message.d.ts.map +1 -1
- package/dist/components/message/message.js +36 -58
- package/dist/components/modal/modal-body.d.ts +1 -1
- package/dist/components/modal/modal-body.d.ts.map +1 -1
- package/dist/components/modal/modal-body.js +15 -7
- package/dist/components/modal/modal-close-button.d.ts +1 -1
- package/dist/components/modal/modal-close-button.d.ts.map +1 -1
- package/dist/components/modal/modal-close-button.js +16 -16
- package/dist/components/modal/modal-footer.d.ts +1 -1
- package/dist/components/modal/modal-footer.d.ts.map +1 -1
- package/dist/components/modal/modal-footer.js +29 -18
- package/dist/components/modal/modal-header.d.ts +1 -1
- package/dist/components/modal/modal-header.d.ts.map +1 -1
- package/dist/components/modal/modal-header.js +15 -5
- package/dist/components/modal/modal.composition.d.ts +11 -11
- package/dist/components/modal/modal.composition.d.ts.map +1 -1
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +53 -43
- package/dist/components/navigation-list/navigation-list-item.d.ts +2 -2
- package/dist/components/navigation-list/navigation-list-item.d.ts.map +1 -1
- package/dist/components/navigation-list/navigation-list-item.js +54 -67
- package/dist/components/navigation-list/navigation-list.composition.d.ts +6 -5
- package/dist/components/navigation-list/navigation-list.composition.d.ts.map +1 -1
- package/dist/components/navigation-list/navigation-list.d.ts +1 -1
- package/dist/components/navigation-list/navigation-list.d.ts.map +1 -1
- package/dist/components/navigation-list/navigation-list.js +15 -5
- package/dist/components/paginator/paginator.composition.d.ts +2 -2
- package/dist/components/paginator/paginator.composition.d.ts.map +1 -1
- package/dist/components/paginator/paginator.d.ts +1 -1
- package/dist/components/paginator/paginator.d.ts.map +1 -1
- package/dist/components/paginator/paginator.js +67 -51
- package/dist/components/quantity-button/minus-button.d.ts +1 -1
- package/dist/components/quantity-button/minus-button.d.ts.map +1 -1
- package/dist/components/quantity-button/minus-button.js +14 -16
- package/dist/components/quantity-button/plus-button.d.ts +1 -1
- package/dist/components/quantity-button/plus-button.d.ts.map +1 -1
- package/dist/components/quantity-button/plus-button.js +14 -16
- package/dist/components/quantity-button/quantity-button.composition.d.ts +3 -3
- package/dist/components/quantity-button/quantity-button.composition.d.ts.map +1 -1
- package/dist/components/quantity-button/quantity-button.d.ts +1 -1
- package/dist/components/quantity-button/quantity-button.d.ts.map +1 -1
- package/dist/components/quantity-button/quantity-button.js +38 -74
- package/dist/components/radio/check-icon.js +1 -6
- package/dist/components/radio/radio-group-context.js +2 -2
- package/dist/components/radio/radio-group.composition.d.ts +5 -5
- package/dist/components/radio/radio-group.composition.d.ts.map +1 -1
- package/dist/components/radio/radio-group.d.ts +1 -1
- package/dist/components/radio/radio-group.d.ts.map +1 -1
- package/dist/components/radio/radio-group.js +26 -33
- package/dist/components/radio/radio.composition.d.ts +2 -2
- package/dist/components/radio/radio.composition.d.ts.map +1 -1
- package/dist/components/radio/radio.js +53 -49
- package/dist/components/radio-card/radio-card-group.d.ts +1 -1
- package/dist/components/radio-card/radio-card-group.d.ts.map +1 -1
- package/dist/components/radio-card/radio-card-group.js +23 -31
- package/dist/components/radio-card/radio-card.composition.d.ts +4 -4
- package/dist/components/radio-card/radio-card.composition.d.ts.map +1 -1
- package/dist/components/radio-card/radio-card.js +64 -81
- package/dist/components/rich-text-editor/boolean-control.d.ts +1 -1
- package/dist/components/rich-text-editor/boolean-control.d.ts.map +1 -1
- package/dist/components/rich-text-editor/boolean-control.js +50 -30
- package/dist/components/rich-text-editor/extensions.js +15 -17
- package/dist/components/rich-text-editor/rich-text-editor-control.d.ts +10 -10
- package/dist/components/rich-text-editor/rich-text-editor-control.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor-control.js +273 -166
- package/dist/components/rich-text-editor/rich-text-editor-recipe.js +36 -10
- package/dist/components/rich-text-editor/rich-text-editor.composition.d.ts +4 -4
- package/dist/components/rich-text-editor/rich-text-editor.composition.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +4 -4
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +68 -54
- package/dist/components/rich-text-editor/rich-text-renderer.d.ts +1 -1
- package/dist/components/rich-text-editor/rich-text-renderer.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-renderer.js +30 -17
- package/dist/components/rich-text-editor/use-rich-text-editor.js +27 -14
- package/dist/components/segmented-control/segmented-control-item.d.ts +1 -1
- package/dist/components/segmented-control/segmented-control-item.d.ts.map +1 -1
- package/dist/components/segmented-control/segmented-control-item.js +23 -25
- package/dist/components/segmented-control/segmented-control.composition.d.ts +5 -5
- package/dist/components/segmented-control/segmented-control.composition.d.ts.map +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +38 -38
- package/dist/components/segmented-control/types.d.ts +2 -1
- package/dist/components/segmented-control/types.d.ts.map +1 -1
- package/dist/components/select/select.composition.d.ts +3 -3
- package/dist/components/select/select.composition.d.ts.map +1 -1
- package/dist/components/select/select.js +27 -12
- package/dist/components/skeleton/skeleton-text.d.ts +1 -1
- package/dist/components/skeleton/skeleton-text.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton-text.js +17 -12
- package/dist/components/skeleton/skeleton.composition.d.ts +2 -2
- package/dist/components/skeleton/skeleton.composition.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +18 -13
- package/dist/components/spinner/spinner.composition.d.ts +2 -2
- package/dist/components/spinner/spinner.composition.d.ts.map +1 -1
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +26 -49
- package/dist/components/stack/stack.composition.d.ts +3 -3
- package/dist/components/stack/stack.composition.d.ts.map +1 -1
- package/dist/components/stack/stack.js +17 -7
- package/dist/components/stepper/check-icon.js +1 -6
- package/dist/components/stepper/step-context.d.ts +2 -1
- package/dist/components/stepper/step-context.d.ts.map +1 -1
- package/dist/components/stepper/step.d.ts +1 -1
- package/dist/components/stepper/step.d.ts.map +1 -1
- package/dist/components/stepper/step.js +89 -69
- package/dist/components/stepper/stepper.composition.d.ts +6 -6
- package/dist/components/stepper/stepper.composition.d.ts.map +1 -1
- package/dist/components/stepper/stepper.d.ts +1 -1
- package/dist/components/stepper/stepper.d.ts.map +1 -1
- package/dist/components/stepper/stepper.js +41 -21
- package/dist/components/stepper/times-icon.js +1 -6
- package/dist/components/stepper/types.d.ts +2 -1
- package/dist/components/stepper/types.d.ts.map +1 -1
- package/dist/components/switch/switch.composition.d.ts +2 -2
- package/dist/components/switch/switch.composition.d.ts.map +1 -1
- package/dist/components/switch/switch.js +29 -33
- package/dist/components/table/table-cell.d.ts +1 -1
- package/dist/components/table/table-cell.d.ts.map +1 -1
- package/dist/components/table/table-cell.js +67 -92
- package/dist/components/table/table-content.d.ts +1 -1
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +26 -76
- package/dist/components/table/table-context-provider.d.ts +1 -1
- package/dist/components/table/table-context-provider.d.ts.map +1 -1
- package/dist/components/table/table-context-provider.js +28 -49
- package/dist/components/table/table-context.d.ts.map +1 -1
- package/dist/components/table/table-filter.d.ts +1 -1
- package/dist/components/table/table-filter.d.ts.map +1 -1
- package/dist/components/table/table-filter.js +68 -96
- package/dist/components/table/table-header-dropdown.d.ts +1 -1
- package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
- package/dist/components/table/table-header-dropdown.js +65 -113
- package/dist/components/table/table-header-row.d.ts +1 -1
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +53 -106
- package/dist/components/table/table-recipe.js +6 -2
- package/dist/components/table/table-row-expand-toggle-button.d.ts +1 -1
- package/dist/components/table/table-row-expand-toggle-button.d.ts.map +1 -1
- package/dist/components/table/table-row-expand-toggle-button.js +26 -23
- package/dist/components/table/table-row.d.ts +1 -1
- package/dist/components/table/table-row.d.ts.map +1 -1
- package/dist/components/table/table-row.js +8 -26
- package/dist/components/table/table-toolbar-actions.d.ts +1 -1
- package/dist/components/table/table-toolbar-actions.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-actions.js +4 -10
- package/dist/components/table/table-toolbar-add-button.d.ts +1 -1
- package/dist/components/table/table-toolbar-add-button.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-search.d.ts +1 -1
- package/dist/components/table/table-toolbar-search.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-search.js +6 -11
- package/dist/components/table/table-toolbar-settings.d.ts +1 -1
- package/dist/components/table/table-toolbar-settings.d.ts.map +1 -1
- package/dist/components/table/table-toolbar-settings.js +75 -144
- package/dist/components/table/table-toolbar.d.ts +1 -1
- package/dist/components/table/table-toolbar.d.ts.map +1 -1
- package/dist/components/table/table-toolbar.js +28 -34
- package/dist/components/table/table.composition.d.ts +5 -4
- package/dist/components/table/table.composition.d.ts.map +1 -1
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +1 -34
- package/dist/components/tabs/tab-list.d.ts +1 -1
- package/dist/components/tabs/tab-list.d.ts.map +1 -1
- package/dist/components/tabs/tab-list.js +15 -5
- package/dist/components/tabs/tab-panel.d.ts +1 -1
- package/dist/components/tabs/tab-panel.d.ts.map +1 -1
- package/dist/components/tabs/tab-panel.js +13 -5
- package/dist/components/tabs/tab-panels.d.ts +1 -1
- package/dist/components/tabs/tab-panels.d.ts.map +1 -1
- package/dist/components/tabs/tab-panels.js +12 -4
- package/dist/components/tabs/tab-with-image.d.ts +1 -1
- package/dist/components/tabs/tab-with-image.d.ts.map +1 -1
- package/dist/components/tabs/tab-with-image.js +51 -32
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/tab.d.ts.map +1 -1
- package/dist/components/tabs/tab.js +21 -16
- package/dist/components/tabs/tabs-recipe.js +3 -1
- package/dist/components/tabs/tabs.composition.d.ts +6 -6
- package/dist/components/tabs/tabs.composition.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +22 -16
- package/dist/components/tag/tag-recipe.js +6 -1
- package/dist/components/tag/tag.composition.d.ts +4 -4
- package/dist/components/tag/tag.composition.d.ts.map +1 -1
- package/dist/components/tag/tag.d.ts +20 -20
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/tag/tag.js +41 -35
- package/dist/components/tag/types.d.ts +3 -2
- package/dist/components/tag/types.d.ts.map +1 -1
- package/dist/components/text/text.composition.d.ts +4 -4
- package/dist/components/text/text.composition.d.ts.map +1 -1
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/text/text.js +25 -35
- package/dist/components/textarea/textarea.composition.d.ts +3 -3
- package/dist/components/textarea/textarea.composition.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +16 -16
- package/dist/components/toaster/toast-store.d.ts +2 -1
- package/dist/components/toaster/toast-store.d.ts.map +1 -1
- package/dist/components/toaster/toast-store.js +19 -12
- package/dist/components/toaster/toaster.composition.d.ts +6 -6
- package/dist/components/toaster/toaster.composition.d.ts.map +1 -1
- package/dist/components/toaster/toaster.d.ts +1 -1
- package/dist/components/toaster/toaster.d.ts.map +1 -1
- package/dist/components/toaster/toaster.js +33 -18
- package/dist/components/toggle-button/toggle-button.composition.d.ts +2 -2
- package/dist/components/toggle-button/toggle-button.composition.d.ts.map +1 -1
- package/dist/components/toggle-button/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/toggle-button/toggle-button.js +23 -17
- package/dist/components/toggle-button/use-button-children.js +33 -24
- package/dist/components/tooltip/tooltip.composition.d.ts +4 -4
- package/dist/components/tooltip/tooltip.composition.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +44 -32
- package/dist/hooks/use-color-mode.js +20 -11
- package/dist/hooks/use-disclosure.js +8 -2
- package/dist/hooks/use-remove-attributes.js +20 -12
- package/dist/index.js +664 -662
- package/dist/node_modules/@tiptap/core/dist/index.js +541 -525
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +1464 -27
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +26 -9
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +314 -250
- package/dist/node_modules/@tiptap/extensions/dist/index.js +205 -182
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
- package/dist/node_modules/react/compiler-runtime.js +10 -0
- package/dist/theme/theme-provider-context.composition.d.ts +9 -9
- package/dist/theme/theme-provider-context.composition.d.ts.map +1 -1
- package/dist/theme/theme-provider.d.ts +1 -1
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +32 -28
- package/dist/theme/theme.js +6 -2
- package/package.json +15 -14
|
@@ -1,6 +1,1442 @@
|
|
|
1
|
-
import { Node as
|
|
2
|
-
import { createElement as
|
|
3
|
-
|
|
1
|
+
import { Node as yt, wrappingInputRule as xt, mergeAttributes as Nt } from "../../core/dist/index.js";
|
|
2
|
+
import { createElement as Z } from "../../core/dist/jsx-runtime/jsx-runtime.js";
|
|
3
|
+
function it(i, t, e) {
|
|
4
|
+
for (let r = 0; ; r++) {
|
|
5
|
+
if (r == i.childCount || r == t.childCount)
|
|
6
|
+
return i.childCount == t.childCount ? null : e;
|
|
7
|
+
let n = i.child(r), s = t.child(r);
|
|
8
|
+
if (n == s) {
|
|
9
|
+
e += n.nodeSize;
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
if (!n.sameMarkup(s))
|
|
13
|
+
return e;
|
|
14
|
+
if (n.isText && n.text != s.text) {
|
|
15
|
+
for (let o = 0; n.text[o] == s.text[o]; o++)
|
|
16
|
+
e++;
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
if (n.content.size || s.content.size) {
|
|
20
|
+
let o = it(n.content, s.content, e + 1);
|
|
21
|
+
if (o != null)
|
|
22
|
+
return o;
|
|
23
|
+
}
|
|
24
|
+
e += n.nodeSize;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function st(i, t, e, r) {
|
|
28
|
+
for (let n = i.childCount, s = t.childCount; ; ) {
|
|
29
|
+
if (n == 0 || s == 0)
|
|
30
|
+
return n == s ? null : { a: e, b: r };
|
|
31
|
+
let o = i.child(--n), a = t.child(--s), l = o.nodeSize;
|
|
32
|
+
if (o == a) {
|
|
33
|
+
e -= l, r -= l;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (!o.sameMarkup(a))
|
|
37
|
+
return { a: e, b: r };
|
|
38
|
+
if (o.isText && o.text != a.text) {
|
|
39
|
+
let h = 0, u = Math.min(o.text.length, a.text.length);
|
|
40
|
+
for (; h < u && o.text[o.text.length - h - 1] == a.text[a.text.length - h - 1]; )
|
|
41
|
+
h++, e--, r--;
|
|
42
|
+
return { a: e, b: r };
|
|
43
|
+
}
|
|
44
|
+
if (o.content.size || a.content.size) {
|
|
45
|
+
let h = st(o.content, a.content, e - 1, r - 1);
|
|
46
|
+
if (h)
|
|
47
|
+
return h;
|
|
48
|
+
}
|
|
49
|
+
e -= l, r -= l;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var g = class m {
|
|
53
|
+
/**
|
|
54
|
+
@internal
|
|
55
|
+
*/
|
|
56
|
+
constructor(t, e) {
|
|
57
|
+
if (this.content = t, this.size = e || 0, e == null)
|
|
58
|
+
for (let r = 0; r < t.length; r++)
|
|
59
|
+
this.size += t[r].nodeSize;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
Invoke a callback for all descendant nodes between the given two
|
|
63
|
+
positions (relative to start of this fragment). Doesn't descend
|
|
64
|
+
into a node when the callback returns `false`.
|
|
65
|
+
*/
|
|
66
|
+
nodesBetween(t, e, r, n = 0, s) {
|
|
67
|
+
for (let o = 0, a = 0; a < e; o++) {
|
|
68
|
+
let l = this.content[o], h = a + l.nodeSize;
|
|
69
|
+
if (h > t && r(l, n + a, s || null, o) !== !1 && l.content.size) {
|
|
70
|
+
let u = a + 1;
|
|
71
|
+
l.nodesBetween(Math.max(0, t - u), Math.min(l.content.size, e - u), r, n + u);
|
|
72
|
+
}
|
|
73
|
+
a = h;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
Call the given callback for every descendant node. `pos` will be
|
|
78
|
+
relative to the start of the fragment. The callback may return
|
|
79
|
+
`false` to prevent traversal of a given node's children.
|
|
80
|
+
*/
|
|
81
|
+
descendants(t) {
|
|
82
|
+
this.nodesBetween(0, this.size, t);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
Extract the text between `from` and `to`. See the same method on
|
|
86
|
+
[`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
|
|
87
|
+
*/
|
|
88
|
+
textBetween(t, e, r, n) {
|
|
89
|
+
let s = "", o = !0;
|
|
90
|
+
return this.nodesBetween(t, e, (a, l) => {
|
|
91
|
+
let h = a.isText ? a.text.slice(Math.max(t, l) - l, e - l) : a.isLeaf ? n ? typeof n == "function" ? n(a) : n : a.type.spec.leafText ? a.type.spec.leafText(a) : "" : "";
|
|
92
|
+
a.isBlock && (a.isLeaf && h || a.isTextblock) && r && (o ? o = !1 : s += r), s += h;
|
|
93
|
+
}, 0), s;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
Create a new fragment containing the combined content of this
|
|
97
|
+
fragment and the other.
|
|
98
|
+
*/
|
|
99
|
+
append(t) {
|
|
100
|
+
if (!t.size)
|
|
101
|
+
return this;
|
|
102
|
+
if (!this.size)
|
|
103
|
+
return t;
|
|
104
|
+
let e = this.lastChild, r = t.firstChild, n = this.content.slice(), s = 0;
|
|
105
|
+
for (e.isText && e.sameMarkup(r) && (n[n.length - 1] = e.withText(e.text + r.text), s = 1); s < t.content.length; s++)
|
|
106
|
+
n.push(t.content[s]);
|
|
107
|
+
return new m(n, this.size + t.size);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
Cut out the sub-fragment between the two given positions.
|
|
111
|
+
*/
|
|
112
|
+
cut(t, e = this.size) {
|
|
113
|
+
if (t == 0 && e == this.size)
|
|
114
|
+
return this;
|
|
115
|
+
let r = [], n = 0;
|
|
116
|
+
if (e > t)
|
|
117
|
+
for (let s = 0, o = 0; o < e; s++) {
|
|
118
|
+
let a = this.content[s], l = o + a.nodeSize;
|
|
119
|
+
l > t && ((o < t || l > e) && (a.isText ? a = a.cut(Math.max(0, t - o), Math.min(a.text.length, e - o)) : a = a.cut(Math.max(0, t - o - 1), Math.min(a.content.size, e - o - 1))), r.push(a), n += a.nodeSize), o = l;
|
|
120
|
+
}
|
|
121
|
+
return new m(r, n);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
@internal
|
|
125
|
+
*/
|
|
126
|
+
cutByIndex(t, e) {
|
|
127
|
+
return t == e ? m.empty : t == 0 && e == this.content.length ? this : new m(this.content.slice(t, e));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
Create a new fragment in which the node at the given index is
|
|
131
|
+
replaced by the given node.
|
|
132
|
+
*/
|
|
133
|
+
replaceChild(t, e) {
|
|
134
|
+
let r = this.content[t];
|
|
135
|
+
if (r == e)
|
|
136
|
+
return this;
|
|
137
|
+
let n = this.content.slice(), s = this.size + e.nodeSize - r.nodeSize;
|
|
138
|
+
return n[t] = e, new m(n, s);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
Create a new fragment by prepending the given node to this
|
|
142
|
+
fragment.
|
|
143
|
+
*/
|
|
144
|
+
addToStart(t) {
|
|
145
|
+
return new m([t].concat(this.content), this.size + t.nodeSize);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
Create a new fragment by appending the given node to this
|
|
149
|
+
fragment.
|
|
150
|
+
*/
|
|
151
|
+
addToEnd(t) {
|
|
152
|
+
return new m(this.content.concat(t), this.size + t.nodeSize);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
Compare this fragment to another one.
|
|
156
|
+
*/
|
|
157
|
+
eq(t) {
|
|
158
|
+
if (this.content.length != t.content.length)
|
|
159
|
+
return !1;
|
|
160
|
+
for (let e = 0; e < this.content.length; e++)
|
|
161
|
+
if (!this.content[e].eq(t.content[e]))
|
|
162
|
+
return !1;
|
|
163
|
+
return !0;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
The first child of the fragment, or `null` if it is empty.
|
|
167
|
+
*/
|
|
168
|
+
get firstChild() {
|
|
169
|
+
return this.content.length ? this.content[0] : null;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
The last child of the fragment, or `null` if it is empty.
|
|
173
|
+
*/
|
|
174
|
+
get lastChild() {
|
|
175
|
+
return this.content.length ? this.content[this.content.length - 1] : null;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
The number of child nodes in this fragment.
|
|
179
|
+
*/
|
|
180
|
+
get childCount() {
|
|
181
|
+
return this.content.length;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
Get the child node at the given index. Raise an error when the
|
|
185
|
+
index is out of range.
|
|
186
|
+
*/
|
|
187
|
+
child(t) {
|
|
188
|
+
let e = this.content[t];
|
|
189
|
+
if (!e)
|
|
190
|
+
throw new RangeError("Index " + t + " out of range for " + this);
|
|
191
|
+
return e;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
Get the child node at the given index, if it exists.
|
|
195
|
+
*/
|
|
196
|
+
maybeChild(t) {
|
|
197
|
+
return this.content[t] || null;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
Call `f` for every child node, passing the node, its offset
|
|
201
|
+
into this parent node, and its index.
|
|
202
|
+
*/
|
|
203
|
+
forEach(t) {
|
|
204
|
+
for (let e = 0, r = 0; e < this.content.length; e++) {
|
|
205
|
+
let n = this.content[e];
|
|
206
|
+
t(n, r, e), r += n.nodeSize;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
Find the first position at which this fragment and another
|
|
211
|
+
fragment differ, or `null` if they are the same.
|
|
212
|
+
*/
|
|
213
|
+
findDiffStart(t, e = 0) {
|
|
214
|
+
return it(this, t, e);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
Find the first position, searching from the end, at which this
|
|
218
|
+
fragment and the given fragment differ, or `null` if they are
|
|
219
|
+
the same. Since this position will not be the same in both
|
|
220
|
+
nodes, an object with two separate positions is returned.
|
|
221
|
+
*/
|
|
222
|
+
findDiffEnd(t, e = this.size, r = t.size) {
|
|
223
|
+
return st(this, t, e, r);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
Find the index and inner offset corresponding to a given relative
|
|
227
|
+
position in this fragment. The result object will be reused
|
|
228
|
+
(overwritten) the next time the function is called. @internal
|
|
229
|
+
*/
|
|
230
|
+
findIndex(t) {
|
|
231
|
+
if (t == 0)
|
|
232
|
+
return F(0, t);
|
|
233
|
+
if (t == this.size)
|
|
234
|
+
return F(this.content.length, t);
|
|
235
|
+
if (t > this.size || t < 0)
|
|
236
|
+
throw new RangeError(`Position ${t} outside of fragment (${this})`);
|
|
237
|
+
for (let e = 0, r = 0; ; e++) {
|
|
238
|
+
let n = this.child(e), s = r + n.nodeSize;
|
|
239
|
+
if (s >= t)
|
|
240
|
+
return s == t ? F(e + 1, s) : F(e, r);
|
|
241
|
+
r = s;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
Return a debugging string that describes this fragment.
|
|
246
|
+
*/
|
|
247
|
+
toString() {
|
|
248
|
+
return "<" + this.toStringInner() + ">";
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
@internal
|
|
252
|
+
*/
|
|
253
|
+
toStringInner() {
|
|
254
|
+
return this.content.join(", ");
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
Create a JSON-serializeable representation of this fragment.
|
|
258
|
+
*/
|
|
259
|
+
toJSON() {
|
|
260
|
+
return this.content.length ? this.content.map((t) => t.toJSON()) : null;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
Deserialize a fragment from its JSON representation.
|
|
264
|
+
*/
|
|
265
|
+
static fromJSON(t, e) {
|
|
266
|
+
if (!e)
|
|
267
|
+
return m.empty;
|
|
268
|
+
if (!Array.isArray(e))
|
|
269
|
+
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
270
|
+
return m.fromArray(e.map(t.nodeFromJSON));
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
Build a fragment from an array of nodes. Ensures that adjacent
|
|
274
|
+
text nodes with the same marks are joined together.
|
|
275
|
+
*/
|
|
276
|
+
static fromArray(t) {
|
|
277
|
+
if (!t.length)
|
|
278
|
+
return m.empty;
|
|
279
|
+
let e, r = 0;
|
|
280
|
+
for (let n = 0; n < t.length; n++) {
|
|
281
|
+
let s = t[n];
|
|
282
|
+
r += s.nodeSize, n && s.isText && t[n - 1].sameMarkup(s) ? (e || (e = t.slice(0, n)), e[e.length - 1] = s.withText(e[e.length - 1].text + s.text)) : e && e.push(s);
|
|
283
|
+
}
|
|
284
|
+
return new m(e || t, r);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
Create a fragment from something that can be interpreted as a
|
|
288
|
+
set of nodes. For `null`, it returns the empty fragment. For a
|
|
289
|
+
fragment, the fragment itself. For a node or array of nodes, a
|
|
290
|
+
fragment containing those nodes.
|
|
291
|
+
*/
|
|
292
|
+
static from(t) {
|
|
293
|
+
if (!t)
|
|
294
|
+
return m.empty;
|
|
295
|
+
if (t instanceof m)
|
|
296
|
+
return t;
|
|
297
|
+
if (Array.isArray(t))
|
|
298
|
+
return this.fromArray(t);
|
|
299
|
+
if (t.attrs)
|
|
300
|
+
return new m([t], t.nodeSize);
|
|
301
|
+
throw new RangeError("Can not convert " + t + " to a Fragment" + (t.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
g.empty = new g([], 0);
|
|
305
|
+
var H = { index: 0, offset: 0 };
|
|
306
|
+
function F(i, t) {
|
|
307
|
+
return H.index = i, H.offset = t, H;
|
|
308
|
+
}
|
|
309
|
+
var Rt = class extends Error {
|
|
310
|
+
}, c = class y {
|
|
311
|
+
/**
|
|
312
|
+
Create a slice. When specifying a non-zero open depth, you must
|
|
313
|
+
make sure that there are nodes of at least that depth at the
|
|
314
|
+
appropriate side of the fragment—i.e. if the fragment is an
|
|
315
|
+
empty paragraph node, `openStart` and `openEnd` can't be greater
|
|
316
|
+
than 1.
|
|
317
|
+
|
|
318
|
+
It is not necessary for the content of open nodes to conform to
|
|
319
|
+
the schema's content constraints, though it should be a valid
|
|
320
|
+
start/end/middle for such a node, depending on which sides are
|
|
321
|
+
open.
|
|
322
|
+
*/
|
|
323
|
+
constructor(t, e, r) {
|
|
324
|
+
this.content = t, this.openStart = e, this.openEnd = r;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
The size this slice would add when inserted into a document.
|
|
328
|
+
*/
|
|
329
|
+
get size() {
|
|
330
|
+
return this.content.size - this.openStart - this.openEnd;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
@internal
|
|
334
|
+
*/
|
|
335
|
+
insertAt(t, e) {
|
|
336
|
+
let r = at(this.content, t + this.openStart, e, this.openStart + 1, this.openEnd + 1);
|
|
337
|
+
return r && new y(r, this.openStart, this.openEnd);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
@internal
|
|
341
|
+
*/
|
|
342
|
+
removeBetween(t, e) {
|
|
343
|
+
return new y(ot(this.content, t + this.openStart, e + this.openStart), this.openStart, this.openEnd);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
Tests whether this slice is equal to another slice.
|
|
347
|
+
*/
|
|
348
|
+
eq(t) {
|
|
349
|
+
return this.content.eq(t.content) && this.openStart == t.openStart && this.openEnd == t.openEnd;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
@internal
|
|
353
|
+
*/
|
|
354
|
+
toString() {
|
|
355
|
+
return this.content + "(" + this.openStart + "," + this.openEnd + ")";
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
Convert a slice to a JSON-serializable representation.
|
|
359
|
+
*/
|
|
360
|
+
toJSON() {
|
|
361
|
+
if (!this.content.size)
|
|
362
|
+
return null;
|
|
363
|
+
let t = { content: this.content.toJSON() };
|
|
364
|
+
return this.openStart > 0 && (t.openStart = this.openStart), this.openEnd > 0 && (t.openEnd = this.openEnd), t;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
Deserialize a slice from its JSON representation.
|
|
368
|
+
*/
|
|
369
|
+
static fromJSON(t, e) {
|
|
370
|
+
if (!e)
|
|
371
|
+
return y.empty;
|
|
372
|
+
let r = e.openStart || 0, n = e.openEnd || 0;
|
|
373
|
+
if (typeof r != "number" || typeof n != "number")
|
|
374
|
+
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
375
|
+
return new y(g.fromJSON(t, e.content), r, n);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
Create a slice from a fragment by taking the maximum possible
|
|
379
|
+
open value on both side of the fragment.
|
|
380
|
+
*/
|
|
381
|
+
static maxOpen(t, e = !0) {
|
|
382
|
+
let r = 0, n = 0;
|
|
383
|
+
for (let s = t.firstChild; s && !s.isLeaf && (e || !s.type.spec.isolating); s = s.firstChild)
|
|
384
|
+
r++;
|
|
385
|
+
for (let s = t.lastChild; s && !s.isLeaf && (e || !s.type.spec.isolating); s = s.lastChild)
|
|
386
|
+
n++;
|
|
387
|
+
return new y(t, r, n);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
c.empty = new c(g.empty, 0, 0);
|
|
391
|
+
function ot(i, t, e) {
|
|
392
|
+
let { index: r, offset: n } = i.findIndex(t), s = i.maybeChild(r), { index: o, offset: a } = i.findIndex(e);
|
|
393
|
+
if (n == t || s.isText) {
|
|
394
|
+
if (a != e && !i.child(o).isText)
|
|
395
|
+
throw new RangeError("Removing non-flat range");
|
|
396
|
+
return i.cut(0, t).append(i.cut(e));
|
|
397
|
+
}
|
|
398
|
+
if (r != o)
|
|
399
|
+
throw new RangeError("Removing non-flat range");
|
|
400
|
+
return i.replaceChild(r, s.copy(ot(s.content, t - n - 1, e - n - 1)));
|
|
401
|
+
}
|
|
402
|
+
function at(i, t, e, r, n, s) {
|
|
403
|
+
let { index: o, offset: a } = i.findIndex(t), l = i.maybeChild(o);
|
|
404
|
+
if (a == t || l.isText)
|
|
405
|
+
return s && r <= 0 && n <= 0 && !s.canReplace(o, o, e) ? null : i.cut(0, t).append(e).append(i.cut(t));
|
|
406
|
+
let h = at(l.content, t - a - 1, e, o == 0 ? r - 1 : 0, o == i.childCount - 1 ? n - 1 : 0, l);
|
|
407
|
+
return h && i.replaceChild(o, l.copy(h));
|
|
408
|
+
}
|
|
409
|
+
var lt = 65535, ht = Math.pow(2, 16);
|
|
410
|
+
function Et(i, t) {
|
|
411
|
+
return i + t * ht;
|
|
412
|
+
}
|
|
413
|
+
function j(i) {
|
|
414
|
+
return i & lt;
|
|
415
|
+
}
|
|
416
|
+
function Ot(i) {
|
|
417
|
+
return (i - (i & lt)) / ht;
|
|
418
|
+
}
|
|
419
|
+
var ut = 1, ct = 2, D = 4, ft = 8, _ = class {
|
|
420
|
+
/**
|
|
421
|
+
@internal
|
|
422
|
+
*/
|
|
423
|
+
constructor(i, t, e) {
|
|
424
|
+
this.pos = i, this.delInfo = t, this.recover = e;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
Tells you whether the position was deleted, that is, whether the
|
|
428
|
+
step removed the token on the side queried (via the `assoc`)
|
|
429
|
+
argument from the document.
|
|
430
|
+
*/
|
|
431
|
+
get deleted() {
|
|
432
|
+
return (this.delInfo & ft) > 0;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
Tells you whether the token before the mapped position was deleted.
|
|
436
|
+
*/
|
|
437
|
+
get deletedBefore() {
|
|
438
|
+
return (this.delInfo & (ut | D)) > 0;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
True when the token after the mapped position was deleted.
|
|
442
|
+
*/
|
|
443
|
+
get deletedAfter() {
|
|
444
|
+
return (this.delInfo & (ct | D)) > 0;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
Tells whether any of the steps mapped through deletes across the
|
|
448
|
+
position (including both the token before and after the
|
|
449
|
+
position).
|
|
450
|
+
*/
|
|
451
|
+
get deletedAcross() {
|
|
452
|
+
return (this.delInfo & D) > 0;
|
|
453
|
+
}
|
|
454
|
+
}, k = class x {
|
|
455
|
+
/**
|
|
456
|
+
Create a position map. The modifications to the document are
|
|
457
|
+
represented as an array of numbers, in which each group of three
|
|
458
|
+
represents a modified chunk as `[start, oldSize, newSize]`.
|
|
459
|
+
*/
|
|
460
|
+
constructor(t, e = !1) {
|
|
461
|
+
if (this.ranges = t, this.inverted = e, !t.length && x.empty)
|
|
462
|
+
return x.empty;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
@internal
|
|
466
|
+
*/
|
|
467
|
+
recover(t) {
|
|
468
|
+
let e = 0, r = j(t);
|
|
469
|
+
if (!this.inverted)
|
|
470
|
+
for (let n = 0; n < r; n++)
|
|
471
|
+
e += this.ranges[n * 3 + 2] - this.ranges[n * 3 + 1];
|
|
472
|
+
return this.ranges[r * 3] + e + Ot(t);
|
|
473
|
+
}
|
|
474
|
+
mapResult(t, e = 1) {
|
|
475
|
+
return this._map(t, e, !1);
|
|
476
|
+
}
|
|
477
|
+
map(t, e = 1) {
|
|
478
|
+
return this._map(t, e, !0);
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
@internal
|
|
482
|
+
*/
|
|
483
|
+
_map(t, e, r) {
|
|
484
|
+
let n = 0, s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
|
|
485
|
+
for (let a = 0; a < this.ranges.length; a += 3) {
|
|
486
|
+
let l = this.ranges[a] - (this.inverted ? n : 0);
|
|
487
|
+
if (l > t)
|
|
488
|
+
break;
|
|
489
|
+
let h = this.ranges[a + s], u = this.ranges[a + o], S = l + h;
|
|
490
|
+
if (t <= S) {
|
|
491
|
+
let X = h ? t == l ? -1 : t == S ? 1 : e : e, O = l + n + (X < 0 ? 0 : u);
|
|
492
|
+
if (r)
|
|
493
|
+
return O;
|
|
494
|
+
let v = t == (e < 0 ? l : S) ? null : Et(a / 3, t - l), Y = t == l ? ct : t == S ? ut : D;
|
|
495
|
+
return (e < 0 ? t != l : t != S) && (Y |= ft), new _(O, Y, v);
|
|
496
|
+
}
|
|
497
|
+
n += u - h;
|
|
498
|
+
}
|
|
499
|
+
return r ? t + n : new _(t + n, 0, null);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
@internal
|
|
503
|
+
*/
|
|
504
|
+
touches(t, e) {
|
|
505
|
+
let r = 0, n = j(e), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
|
|
506
|
+
for (let a = 0; a < this.ranges.length; a += 3) {
|
|
507
|
+
let l = this.ranges[a] - (this.inverted ? r : 0);
|
|
508
|
+
if (l > t)
|
|
509
|
+
break;
|
|
510
|
+
let h = this.ranges[a + s], u = l + h;
|
|
511
|
+
if (t <= u && a == n * 3)
|
|
512
|
+
return !0;
|
|
513
|
+
r += this.ranges[a + o] - h;
|
|
514
|
+
}
|
|
515
|
+
return !1;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
Calls the given function on each of the changed ranges included in
|
|
519
|
+
this map.
|
|
520
|
+
*/
|
|
521
|
+
forEach(t) {
|
|
522
|
+
let e = this.inverted ? 2 : 1, r = this.inverted ? 1 : 2;
|
|
523
|
+
for (let n = 0, s = 0; n < this.ranges.length; n += 3) {
|
|
524
|
+
let o = this.ranges[n], a = o - (this.inverted ? s : 0), l = o + (this.inverted ? 0 : s), h = this.ranges[n + e], u = this.ranges[n + r];
|
|
525
|
+
t(a, a + h, l, l + u), s += u - h;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
Create an inverted version of this map. The result can be used to
|
|
530
|
+
map positions in the post-step document to the pre-step document.
|
|
531
|
+
*/
|
|
532
|
+
invert() {
|
|
533
|
+
return new x(this.ranges, !this.inverted);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
@internal
|
|
537
|
+
*/
|
|
538
|
+
toString() {
|
|
539
|
+
return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
Create a map that moves all positions by offset `n` (which may be
|
|
543
|
+
negative). This can be useful when applying steps meant for a
|
|
544
|
+
sub-document to a larger document, or vice-versa.
|
|
545
|
+
*/
|
|
546
|
+
static offset(t) {
|
|
547
|
+
return t == 0 ? x.empty : new x(t < 0 ? [0, -t, 0] : [0, 0, t]);
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
k.empty = new k([]);
|
|
551
|
+
var W = /* @__PURE__ */ Object.create(null), p = class {
|
|
552
|
+
/**
|
|
553
|
+
Get the step map that represents the changes made by this step,
|
|
554
|
+
and which can be used to transform between positions in the old
|
|
555
|
+
and the new document.
|
|
556
|
+
*/
|
|
557
|
+
getMap() {
|
|
558
|
+
return k.empty;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
Try to merge this step with another one, to be applied directly
|
|
562
|
+
after it. Returns the merged step when possible, null if the
|
|
563
|
+
steps can't be merged.
|
|
564
|
+
*/
|
|
565
|
+
merge(i) {
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
Deserialize a step from its JSON representation. Will call
|
|
570
|
+
through to the step class' own implementation of this method.
|
|
571
|
+
*/
|
|
572
|
+
static fromJSON(i, t) {
|
|
573
|
+
if (!t || !t.stepType)
|
|
574
|
+
throw new RangeError("Invalid input for Step.fromJSON");
|
|
575
|
+
let e = W[t.stepType];
|
|
576
|
+
if (!e)
|
|
577
|
+
throw new RangeError(`No step type ${t.stepType} defined`);
|
|
578
|
+
return e.fromJSON(i, t);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
To be able to serialize steps to JSON, each step needs a string
|
|
582
|
+
ID to attach to its JSON representation. Use this method to
|
|
583
|
+
register an ID for your step classes. Try to pick something
|
|
584
|
+
that's unlikely to clash with steps from other modules.
|
|
585
|
+
*/
|
|
586
|
+
static jsonID(i, t) {
|
|
587
|
+
if (i in W)
|
|
588
|
+
throw new RangeError("Duplicate use of step JSON ID " + i);
|
|
589
|
+
return W[i] = t, t.prototype.jsonID = i, t;
|
|
590
|
+
}
|
|
591
|
+
}, d = class I {
|
|
592
|
+
/**
|
|
593
|
+
@internal
|
|
594
|
+
*/
|
|
595
|
+
constructor(t, e) {
|
|
596
|
+
this.doc = t, this.failed = e;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
Create a successful step result.
|
|
600
|
+
*/
|
|
601
|
+
static ok(t) {
|
|
602
|
+
return new I(t, null);
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
Create a failed step result.
|
|
606
|
+
*/
|
|
607
|
+
static fail(t) {
|
|
608
|
+
return new I(null, t);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
|
|
612
|
+
arguments. Create a successful result if it succeeds, and a
|
|
613
|
+
failed one if it throws a `ReplaceError`.
|
|
614
|
+
*/
|
|
615
|
+
static fromReplace(t, e, r, n) {
|
|
616
|
+
try {
|
|
617
|
+
return I.ok(t.replace(e, r, n));
|
|
618
|
+
} catch (s) {
|
|
619
|
+
if (s instanceof Rt)
|
|
620
|
+
return I.fail(s.message);
|
|
621
|
+
throw s;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
function Q(i, t, e) {
|
|
626
|
+
let r = [];
|
|
627
|
+
for (let n = 0; n < i.childCount; n++) {
|
|
628
|
+
let s = i.child(n);
|
|
629
|
+
s.content.size && (s = s.copy(Q(s.content, t, s))), s.isInline && (s = t(s, e, n)), r.push(s);
|
|
630
|
+
}
|
|
631
|
+
return g.fromArray(r);
|
|
632
|
+
}
|
|
633
|
+
var pt = class z extends p {
|
|
634
|
+
/**
|
|
635
|
+
Create a mark step.
|
|
636
|
+
*/
|
|
637
|
+
constructor(t, e, r) {
|
|
638
|
+
super(), this.from = t, this.to = e, this.mark = r;
|
|
639
|
+
}
|
|
640
|
+
apply(t) {
|
|
641
|
+
let e = t.slice(this.from, this.to), r = t.resolve(this.from), n = r.node(r.sharedDepth(this.to)), s = new c(Q(e.content, (o, a) => !o.isAtom || !a.type.allowsMarkType(this.mark.type) ? o : o.mark(this.mark.addToSet(o.marks)), n), e.openStart, e.openEnd);
|
|
642
|
+
return d.fromReplace(t, this.from, this.to, s);
|
|
643
|
+
}
|
|
644
|
+
invert() {
|
|
645
|
+
return new mt(this.from, this.to, this.mark);
|
|
646
|
+
}
|
|
647
|
+
map(t) {
|
|
648
|
+
let e = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
|
|
649
|
+
return e.deleted && r.deleted || e.pos >= r.pos ? null : new z(e.pos, r.pos, this.mark);
|
|
650
|
+
}
|
|
651
|
+
merge(t) {
|
|
652
|
+
return t instanceof z && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new z(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
|
|
653
|
+
}
|
|
654
|
+
toJSON() {
|
|
655
|
+
return {
|
|
656
|
+
stepType: "addMark",
|
|
657
|
+
mark: this.mark.toJSON(),
|
|
658
|
+
from: this.from,
|
|
659
|
+
to: this.to
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
@internal
|
|
664
|
+
*/
|
|
665
|
+
static fromJSON(t, e) {
|
|
666
|
+
if (typeof e.from != "number" || typeof e.to != "number")
|
|
667
|
+
throw new RangeError("Invalid input for AddMarkStep.fromJSON");
|
|
668
|
+
return new z(e.from, e.to, t.markFromJSON(e.mark));
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
p.jsonID("addMark", pt);
|
|
672
|
+
var mt = class T extends p {
|
|
673
|
+
/**
|
|
674
|
+
Create a mark-removing step.
|
|
675
|
+
*/
|
|
676
|
+
constructor(t, e, r) {
|
|
677
|
+
super(), this.from = t, this.to = e, this.mark = r;
|
|
678
|
+
}
|
|
679
|
+
apply(t) {
|
|
680
|
+
let e = t.slice(this.from, this.to), r = new c(Q(e.content, (n) => n.mark(this.mark.removeFromSet(n.marks)), t), e.openStart, e.openEnd);
|
|
681
|
+
return d.fromReplace(t, this.from, this.to, r);
|
|
682
|
+
}
|
|
683
|
+
invert() {
|
|
684
|
+
return new pt(this.from, this.to, this.mark);
|
|
685
|
+
}
|
|
686
|
+
map(t) {
|
|
687
|
+
let e = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
|
|
688
|
+
return e.deleted && r.deleted || e.pos >= r.pos ? null : new T(e.pos, r.pos, this.mark);
|
|
689
|
+
}
|
|
690
|
+
merge(t) {
|
|
691
|
+
return t instanceof T && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new T(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
|
|
692
|
+
}
|
|
693
|
+
toJSON() {
|
|
694
|
+
return {
|
|
695
|
+
stepType: "removeMark",
|
|
696
|
+
mark: this.mark.toJSON(),
|
|
697
|
+
from: this.from,
|
|
698
|
+
to: this.to
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
@internal
|
|
703
|
+
*/
|
|
704
|
+
static fromJSON(t, e) {
|
|
705
|
+
if (typeof e.from != "number" || typeof e.to != "number")
|
|
706
|
+
throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
|
|
707
|
+
return new T(e.from, e.to, t.markFromJSON(e.mark));
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
p.jsonID("removeMark", mt);
|
|
711
|
+
var dt = class J extends p {
|
|
712
|
+
/**
|
|
713
|
+
Create a node mark step.
|
|
714
|
+
*/
|
|
715
|
+
constructor(t, e) {
|
|
716
|
+
super(), this.pos = t, this.mark = e;
|
|
717
|
+
}
|
|
718
|
+
apply(t) {
|
|
719
|
+
let e = t.nodeAt(this.pos);
|
|
720
|
+
if (!e)
|
|
721
|
+
return d.fail("No node at mark step's position");
|
|
722
|
+
let r = e.type.create(e.attrs, null, this.mark.addToSet(e.marks));
|
|
723
|
+
return d.fromReplace(t, this.pos, this.pos + 1, new c(g.from(r), 0, e.isLeaf ? 0 : 1));
|
|
724
|
+
}
|
|
725
|
+
invert(t) {
|
|
726
|
+
let e = t.nodeAt(this.pos);
|
|
727
|
+
if (e) {
|
|
728
|
+
let r = this.mark.addToSet(e.marks);
|
|
729
|
+
if (r.length == e.marks.length) {
|
|
730
|
+
for (let n = 0; n < e.marks.length; n++)
|
|
731
|
+
if (!e.marks[n].isInSet(r))
|
|
732
|
+
return new J(this.pos, e.marks[n]);
|
|
733
|
+
return new J(this.pos, this.mark);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return new St(this.pos, this.mark);
|
|
737
|
+
}
|
|
738
|
+
map(t) {
|
|
739
|
+
let e = t.mapResult(this.pos, 1);
|
|
740
|
+
return e.deletedAfter ? null : new J(e.pos, this.mark);
|
|
741
|
+
}
|
|
742
|
+
toJSON() {
|
|
743
|
+
return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
@internal
|
|
747
|
+
*/
|
|
748
|
+
static fromJSON(t, e) {
|
|
749
|
+
if (typeof e.pos != "number")
|
|
750
|
+
throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
|
|
751
|
+
return new J(e.pos, t.markFromJSON(e.mark));
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
p.jsonID("addNodeMark", dt);
|
|
755
|
+
var St = class V extends p {
|
|
756
|
+
/**
|
|
757
|
+
Create a mark-removing step.
|
|
758
|
+
*/
|
|
759
|
+
constructor(t, e) {
|
|
760
|
+
super(), this.pos = t, this.mark = e;
|
|
761
|
+
}
|
|
762
|
+
apply(t) {
|
|
763
|
+
let e = t.nodeAt(this.pos);
|
|
764
|
+
if (!e)
|
|
765
|
+
return d.fail("No node at mark step's position");
|
|
766
|
+
let r = e.type.create(e.attrs, null, this.mark.removeFromSet(e.marks));
|
|
767
|
+
return d.fromReplace(t, this.pos, this.pos + 1, new c(g.from(r), 0, e.isLeaf ? 0 : 1));
|
|
768
|
+
}
|
|
769
|
+
invert(t) {
|
|
770
|
+
let e = t.nodeAt(this.pos);
|
|
771
|
+
return !e || !this.mark.isInSet(e.marks) ? this : new dt(this.pos, this.mark);
|
|
772
|
+
}
|
|
773
|
+
map(t) {
|
|
774
|
+
let e = t.mapResult(this.pos, 1);
|
|
775
|
+
return e.deletedAfter ? null : new V(e.pos, this.mark);
|
|
776
|
+
}
|
|
777
|
+
toJSON() {
|
|
778
|
+
return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
@internal
|
|
782
|
+
*/
|
|
783
|
+
static fromJSON(t, e) {
|
|
784
|
+
if (typeof e.pos != "number")
|
|
785
|
+
throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
|
|
786
|
+
return new V(e.pos, t.markFromJSON(e.mark));
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
p.jsonID("removeNodeMark", St);
|
|
790
|
+
var U = class w extends p {
|
|
791
|
+
/**
|
|
792
|
+
The given `slice` should fit the 'gap' between `from` and
|
|
793
|
+
`to`—the depths must line up, and the surrounding nodes must be
|
|
794
|
+
able to be joined with the open sides of the slice. When
|
|
795
|
+
`structure` is true, the step will fail if the content between
|
|
796
|
+
from and to is not just a sequence of closing and then opening
|
|
797
|
+
tokens (this is to guard against rebased replace steps
|
|
798
|
+
overwriting something they weren't supposed to).
|
|
799
|
+
*/
|
|
800
|
+
constructor(t, e, r, n = !1) {
|
|
801
|
+
super(), this.from = t, this.to = e, this.slice = r, this.structure = n;
|
|
802
|
+
}
|
|
803
|
+
apply(t) {
|
|
804
|
+
return this.structure && G(t, this.from, this.to) ? d.fail("Structure replace would overwrite content") : d.fromReplace(t, this.from, this.to, this.slice);
|
|
805
|
+
}
|
|
806
|
+
getMap() {
|
|
807
|
+
return new k([this.from, this.to - this.from, this.slice.size]);
|
|
808
|
+
}
|
|
809
|
+
invert(t) {
|
|
810
|
+
return new w(this.from, this.from + this.slice.size, t.slice(this.from, this.to));
|
|
811
|
+
}
|
|
812
|
+
map(t) {
|
|
813
|
+
let e = t.mapResult(this.to, -1), r = this.from == this.to && w.MAP_BIAS < 0 ? e : t.mapResult(this.from, 1);
|
|
814
|
+
return r.deletedAcross && e.deletedAcross ? null : new w(r.pos, Math.max(r.pos, e.pos), this.slice, this.structure);
|
|
815
|
+
}
|
|
816
|
+
merge(t) {
|
|
817
|
+
if (!(t instanceof w) || t.structure || this.structure)
|
|
818
|
+
return null;
|
|
819
|
+
if (this.from + this.slice.size == t.from && !this.slice.openEnd && !t.slice.openStart) {
|
|
820
|
+
let e = this.slice.size + t.slice.size == 0 ? c.empty : new c(this.slice.content.append(t.slice.content), this.slice.openStart, t.slice.openEnd);
|
|
821
|
+
return new w(this.from, this.to + (t.to - t.from), e, this.structure);
|
|
822
|
+
} else if (t.to == this.from && !this.slice.openStart && !t.slice.openEnd) {
|
|
823
|
+
let e = this.slice.size + t.slice.size == 0 ? c.empty : new c(t.slice.content.append(this.slice.content), t.slice.openStart, this.slice.openEnd);
|
|
824
|
+
return new w(t.from, this.to, e, this.structure);
|
|
825
|
+
} else
|
|
826
|
+
return null;
|
|
827
|
+
}
|
|
828
|
+
toJSON() {
|
|
829
|
+
let t = { stepType: "replace", from: this.from, to: this.to };
|
|
830
|
+
return this.slice.size && (t.slice = this.slice.toJSON()), this.structure && (t.structure = !0), t;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
@internal
|
|
834
|
+
*/
|
|
835
|
+
static fromJSON(t, e) {
|
|
836
|
+
if (typeof e.from != "number" || typeof e.to != "number")
|
|
837
|
+
throw new RangeError("Invalid input for ReplaceStep.fromJSON");
|
|
838
|
+
return new w(e.from, e.to, c.fromJSON(t, e.slice), !!e.structure);
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
U.MAP_BIAS = 1;
|
|
842
|
+
p.jsonID("replace", U);
|
|
843
|
+
var gt = class q extends p {
|
|
844
|
+
/**
|
|
845
|
+
Create a replace-around step with the given range and gap.
|
|
846
|
+
`insert` should be the point in the slice into which the content
|
|
847
|
+
of the gap should be moved. `structure` has the same meaning as
|
|
848
|
+
it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.
|
|
849
|
+
*/
|
|
850
|
+
constructor(t, e, r, n, s, o, a = !1) {
|
|
851
|
+
super(), this.from = t, this.to = e, this.gapFrom = r, this.gapTo = n, this.slice = s, this.insert = o, this.structure = a;
|
|
852
|
+
}
|
|
853
|
+
apply(t) {
|
|
854
|
+
if (this.structure && (G(t, this.from, this.gapFrom) || G(t, this.gapTo, this.to)))
|
|
855
|
+
return d.fail("Structure gap-replace would overwrite content");
|
|
856
|
+
let e = t.slice(this.gapFrom, this.gapTo);
|
|
857
|
+
if (e.openStart || e.openEnd)
|
|
858
|
+
return d.fail("Gap is not a flat range");
|
|
859
|
+
let r = this.slice.insertAt(this.insert, e.content);
|
|
860
|
+
return r ? d.fromReplace(t, this.from, this.to, r) : d.fail("Content does not fit in gap");
|
|
861
|
+
}
|
|
862
|
+
getMap() {
|
|
863
|
+
return new k([
|
|
864
|
+
this.from,
|
|
865
|
+
this.gapFrom - this.from,
|
|
866
|
+
this.insert,
|
|
867
|
+
this.gapTo,
|
|
868
|
+
this.to - this.gapTo,
|
|
869
|
+
this.slice.size - this.insert
|
|
870
|
+
]);
|
|
871
|
+
}
|
|
872
|
+
invert(t) {
|
|
873
|
+
let e = this.gapTo - this.gapFrom;
|
|
874
|
+
return new q(this.from, this.from + this.slice.size + e, this.from + this.insert, this.from + this.insert + e, t.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
875
|
+
}
|
|
876
|
+
map(t) {
|
|
877
|
+
let e = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1), n = this.from == this.gapFrom ? e.pos : t.map(this.gapFrom, -1), s = this.to == this.gapTo ? r.pos : t.map(this.gapTo, 1);
|
|
878
|
+
return e.deletedAcross && r.deletedAcross || n < e.pos || s > r.pos ? null : new q(e.pos, r.pos, n, s, this.slice, this.insert, this.structure);
|
|
879
|
+
}
|
|
880
|
+
toJSON() {
|
|
881
|
+
let t = {
|
|
882
|
+
stepType: "replaceAround",
|
|
883
|
+
from: this.from,
|
|
884
|
+
to: this.to,
|
|
885
|
+
gapFrom: this.gapFrom,
|
|
886
|
+
gapTo: this.gapTo,
|
|
887
|
+
insert: this.insert
|
|
888
|
+
};
|
|
889
|
+
return this.slice.size && (t.slice = this.slice.toJSON()), this.structure && (t.structure = !0), t;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
@internal
|
|
893
|
+
*/
|
|
894
|
+
static fromJSON(t, e) {
|
|
895
|
+
if (typeof e.from != "number" || typeof e.to != "number" || typeof e.gapFrom != "number" || typeof e.gapTo != "number" || typeof e.insert != "number")
|
|
896
|
+
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
897
|
+
return new q(e.from, e.to, e.gapFrom, e.gapTo, c.fromJSON(t, e.slice), e.insert, !!e.structure);
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
p.jsonID("replaceAround", gt);
|
|
901
|
+
function G(i, t, e) {
|
|
902
|
+
let r = i.resolve(t), n = e - t, s = r.depth;
|
|
903
|
+
for (; n > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
|
|
904
|
+
s--, n--;
|
|
905
|
+
if (n > 0) {
|
|
906
|
+
let o = r.node(s).maybeChild(r.indexAfter(s));
|
|
907
|
+
for (; n > 0; ) {
|
|
908
|
+
if (!o || o.isLeaf)
|
|
909
|
+
return !0;
|
|
910
|
+
o = o.firstChild, n--;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
return !1;
|
|
914
|
+
}
|
|
915
|
+
var It = class L extends p {
|
|
916
|
+
/**
|
|
917
|
+
Construct an attribute step.
|
|
918
|
+
*/
|
|
919
|
+
constructor(t, e, r) {
|
|
920
|
+
super(), this.pos = t, this.attr = e, this.value = r;
|
|
921
|
+
}
|
|
922
|
+
apply(t) {
|
|
923
|
+
let e = t.nodeAt(this.pos);
|
|
924
|
+
if (!e)
|
|
925
|
+
return d.fail("No node at attribute step's position");
|
|
926
|
+
let r = /* @__PURE__ */ Object.create(null);
|
|
927
|
+
for (let s in e.attrs)
|
|
928
|
+
r[s] = e.attrs[s];
|
|
929
|
+
r[this.attr] = this.value;
|
|
930
|
+
let n = e.type.create(r, null, e.marks);
|
|
931
|
+
return d.fromReplace(t, this.pos, this.pos + 1, new c(g.from(n), 0, e.isLeaf ? 0 : 1));
|
|
932
|
+
}
|
|
933
|
+
getMap() {
|
|
934
|
+
return k.empty;
|
|
935
|
+
}
|
|
936
|
+
invert(t) {
|
|
937
|
+
return new L(this.pos, this.attr, t.nodeAt(this.pos).attrs[this.attr]);
|
|
938
|
+
}
|
|
939
|
+
map(t) {
|
|
940
|
+
let e = t.mapResult(this.pos, 1);
|
|
941
|
+
return e.deletedAfter ? null : new L(e.pos, this.attr, this.value);
|
|
942
|
+
}
|
|
943
|
+
toJSON() {
|
|
944
|
+
return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
|
|
945
|
+
}
|
|
946
|
+
static fromJSON(t, e) {
|
|
947
|
+
if (typeof e.pos != "number" || typeof e.attr != "string")
|
|
948
|
+
throw new RangeError("Invalid input for AttrStep.fromJSON");
|
|
949
|
+
return new L(e.pos, e.attr, e.value);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
p.jsonID("attr", It);
|
|
953
|
+
var zt = class K extends p {
|
|
954
|
+
/**
|
|
955
|
+
Construct an attribute step.
|
|
956
|
+
*/
|
|
957
|
+
constructor(t, e) {
|
|
958
|
+
super(), this.attr = t, this.value = e;
|
|
959
|
+
}
|
|
960
|
+
apply(t) {
|
|
961
|
+
let e = /* @__PURE__ */ Object.create(null);
|
|
962
|
+
for (let n in t.attrs)
|
|
963
|
+
e[n] = t.attrs[n];
|
|
964
|
+
e[this.attr] = this.value;
|
|
965
|
+
let r = t.type.create(e, t.content, t.marks);
|
|
966
|
+
return d.ok(r);
|
|
967
|
+
}
|
|
968
|
+
getMap() {
|
|
969
|
+
return k.empty;
|
|
970
|
+
}
|
|
971
|
+
invert(t) {
|
|
972
|
+
return new K(this.attr, t.attrs[this.attr]);
|
|
973
|
+
}
|
|
974
|
+
map(t) {
|
|
975
|
+
return this;
|
|
976
|
+
}
|
|
977
|
+
toJSON() {
|
|
978
|
+
return { stepType: "docAttr", attr: this.attr, value: this.value };
|
|
979
|
+
}
|
|
980
|
+
static fromJSON(t, e) {
|
|
981
|
+
if (typeof e.attr != "string")
|
|
982
|
+
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
983
|
+
return new K(e.attr, e.value);
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
p.jsonID("docAttr", zt);
|
|
987
|
+
var C = class extends Error {
|
|
988
|
+
};
|
|
989
|
+
C = function i(t) {
|
|
990
|
+
let e = Error.call(this, t);
|
|
991
|
+
return e.__proto__ = i.prototype, e;
|
|
992
|
+
};
|
|
993
|
+
C.prototype = Object.create(Error.prototype);
|
|
994
|
+
C.prototype.constructor = C;
|
|
995
|
+
C.prototype.name = "TransformError";
|
|
996
|
+
var $ = /* @__PURE__ */ Object.create(null), f = class {
|
|
997
|
+
/**
|
|
998
|
+
Initialize a selection with the head and anchor and ranges. If no
|
|
999
|
+
ranges are given, constructs a single range across `$anchor` and
|
|
1000
|
+
`$head`.
|
|
1001
|
+
*/
|
|
1002
|
+
constructor(i, t, e) {
|
|
1003
|
+
this.$anchor = i, this.$head = t, this.ranges = e || [new Tt(i.min(t), i.max(t))];
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
The selection's anchor, as an unresolved position.
|
|
1007
|
+
*/
|
|
1008
|
+
get anchor() {
|
|
1009
|
+
return this.$anchor.pos;
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
The selection's head.
|
|
1013
|
+
*/
|
|
1014
|
+
get head() {
|
|
1015
|
+
return this.$head.pos;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
The lower bound of the selection's main range.
|
|
1019
|
+
*/
|
|
1020
|
+
get from() {
|
|
1021
|
+
return this.$from.pos;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
The upper bound of the selection's main range.
|
|
1025
|
+
*/
|
|
1026
|
+
get to() {
|
|
1027
|
+
return this.$to.pos;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
The resolved lower bound of the selection's main range.
|
|
1031
|
+
*/
|
|
1032
|
+
get $from() {
|
|
1033
|
+
return this.ranges[0].$from;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
The resolved upper bound of the selection's main range.
|
|
1037
|
+
*/
|
|
1038
|
+
get $to() {
|
|
1039
|
+
return this.ranges[0].$to;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
Indicates whether the selection contains any content.
|
|
1043
|
+
*/
|
|
1044
|
+
get empty() {
|
|
1045
|
+
let i = this.ranges;
|
|
1046
|
+
for (let t = 0; t < i.length; t++)
|
|
1047
|
+
if (i[t].$from.pos != i[t].$to.pos)
|
|
1048
|
+
return !1;
|
|
1049
|
+
return !0;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
Get the content of this selection as a slice.
|
|
1053
|
+
*/
|
|
1054
|
+
content() {
|
|
1055
|
+
return this.$from.doc.slice(this.from, this.to, !0);
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
Replace the selection with a slice or, if no slice is given,
|
|
1059
|
+
delete the selection. Will append to the given transaction.
|
|
1060
|
+
*/
|
|
1061
|
+
replace(i, t = c.empty) {
|
|
1062
|
+
let e = t.content.lastChild, r = null;
|
|
1063
|
+
for (let o = 0; o < t.openEnd; o++)
|
|
1064
|
+
r = e, e = e.lastChild;
|
|
1065
|
+
let n = i.steps.length, s = this.ranges;
|
|
1066
|
+
for (let o = 0; o < s.length; o++) {
|
|
1067
|
+
let { $from: a, $to: l } = s[o], h = i.mapping.slice(n);
|
|
1068
|
+
i.replaceRange(h.map(a.pos), h.map(l.pos), o ? c.empty : t), o == 0 && rt(i, n, (e ? e.isInline : r && r.isTextblock) ? -1 : 1);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
Replace the selection with the given node, appending the changes
|
|
1073
|
+
to the given transaction.
|
|
1074
|
+
*/
|
|
1075
|
+
replaceWith(i, t) {
|
|
1076
|
+
let e = i.steps.length, r = this.ranges;
|
|
1077
|
+
for (let n = 0; n < r.length; n++) {
|
|
1078
|
+
let { $from: s, $to: o } = r[n], a = i.mapping.slice(e), l = a.map(s.pos), h = a.map(o.pos);
|
|
1079
|
+
n ? i.deleteRange(l, h) : (i.replaceRangeWith(l, h, t), rt(i, e, t.isInline ? -1 : 1));
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
Find a valid cursor or leaf node selection starting at the given
|
|
1084
|
+
position and searching back if `dir` is negative, and forward if
|
|
1085
|
+
positive. When `textOnly` is true, only consider cursor
|
|
1086
|
+
selections. Will return null when no valid selection position is
|
|
1087
|
+
found.
|
|
1088
|
+
*/
|
|
1089
|
+
static findFrom(i, t, e = !1) {
|
|
1090
|
+
let r = i.parent.inlineContent ? new R(i) : N(i.node(0), i.parent, i.pos, i.index(), t, e);
|
|
1091
|
+
if (r)
|
|
1092
|
+
return r;
|
|
1093
|
+
for (let n = i.depth - 1; n >= 0; n--) {
|
|
1094
|
+
let s = t < 0 ? N(i.node(0), i.node(n), i.before(n + 1), i.index(n), t, e) : N(i.node(0), i.node(n), i.after(n + 1), i.index(n) + 1, t, e);
|
|
1095
|
+
if (s)
|
|
1096
|
+
return s;
|
|
1097
|
+
}
|
|
1098
|
+
return null;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
Find a valid cursor or leaf node selection near the given
|
|
1102
|
+
position. Searches forward first by default, but if `bias` is
|
|
1103
|
+
negative, it will search backwards first.
|
|
1104
|
+
*/
|
|
1105
|
+
static near(i, t = 1) {
|
|
1106
|
+
return this.findFrom(i, t) || this.findFrom(i, -t) || new b(i.node(0));
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
Find the cursor or leaf node selection closest to the start of
|
|
1110
|
+
the given document. Will return an
|
|
1111
|
+
[`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
|
|
1112
|
+
exists.
|
|
1113
|
+
*/
|
|
1114
|
+
static atStart(i) {
|
|
1115
|
+
return N(i, i, 0, 0, 1) || new b(i);
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
Find the cursor or leaf node selection closest to the end of the
|
|
1119
|
+
given document.
|
|
1120
|
+
*/
|
|
1121
|
+
static atEnd(i) {
|
|
1122
|
+
return N(i, i, i.content.size, i.childCount, -1) || new b(i);
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
Deserialize the JSON representation of a selection. Must be
|
|
1126
|
+
implemented for custom classes (as a static class method).
|
|
1127
|
+
*/
|
|
1128
|
+
static fromJSON(i, t) {
|
|
1129
|
+
if (!t || !t.type)
|
|
1130
|
+
throw new RangeError("Invalid input for Selection.fromJSON");
|
|
1131
|
+
let e = $[t.type];
|
|
1132
|
+
if (!e)
|
|
1133
|
+
throw new RangeError(`No selection type ${t.type} defined`);
|
|
1134
|
+
return e.fromJSON(i, t);
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
To be able to deserialize selections from JSON, custom selection
|
|
1138
|
+
classes must register themselves with an ID string, so that they
|
|
1139
|
+
can be disambiguated. Try to pick something that's unlikely to
|
|
1140
|
+
clash with classes from other modules.
|
|
1141
|
+
*/
|
|
1142
|
+
static jsonID(i, t) {
|
|
1143
|
+
if (i in $)
|
|
1144
|
+
throw new RangeError("Duplicate use of selection JSON ID " + i);
|
|
1145
|
+
return $[i] = t, t.prototype.jsonID = i, t;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
1149
|
+
which is a value that can be mapped without having access to a
|
|
1150
|
+
current document, and later resolved to a real selection for a
|
|
1151
|
+
given document again. (This is used mostly by the history to
|
|
1152
|
+
track and restore old selections.) The default implementation of
|
|
1153
|
+
this method just converts the selection to a text selection and
|
|
1154
|
+
returns the bookmark for that.
|
|
1155
|
+
*/
|
|
1156
|
+
getBookmark() {
|
|
1157
|
+
return R.between(this.$anchor, this.$head).getBookmark();
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
f.prototype.visible = !0;
|
|
1161
|
+
var Tt = class {
|
|
1162
|
+
/**
|
|
1163
|
+
Create a range.
|
|
1164
|
+
*/
|
|
1165
|
+
constructor(i, t) {
|
|
1166
|
+
this.$from = i, this.$to = t;
|
|
1167
|
+
}
|
|
1168
|
+
}, tt = !1;
|
|
1169
|
+
function et(i) {
|
|
1170
|
+
!tt && !i.parent.inlineContent && (tt = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + i.parent.type.name + ")"));
|
|
1171
|
+
}
|
|
1172
|
+
var R = class A extends f {
|
|
1173
|
+
/**
|
|
1174
|
+
Construct a text selection between the given points.
|
|
1175
|
+
*/
|
|
1176
|
+
constructor(t, e = t) {
|
|
1177
|
+
et(t), et(e), super(t, e);
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
Returns a resolved position if this is a cursor selection (an
|
|
1181
|
+
empty text selection), and null otherwise.
|
|
1182
|
+
*/
|
|
1183
|
+
get $cursor() {
|
|
1184
|
+
return this.$anchor.pos == this.$head.pos ? this.$head : null;
|
|
1185
|
+
}
|
|
1186
|
+
map(t, e) {
|
|
1187
|
+
let r = t.resolve(e.map(this.head));
|
|
1188
|
+
if (!r.parent.inlineContent)
|
|
1189
|
+
return f.near(r);
|
|
1190
|
+
let n = t.resolve(e.map(this.anchor));
|
|
1191
|
+
return new A(n.parent.inlineContent ? n : r, r);
|
|
1192
|
+
}
|
|
1193
|
+
replace(t, e = c.empty) {
|
|
1194
|
+
if (super.replace(t, e), e == c.empty) {
|
|
1195
|
+
let r = this.$from.marksAcross(this.$to);
|
|
1196
|
+
r && t.ensureMarks(r);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
eq(t) {
|
|
1200
|
+
return t instanceof A && t.anchor == this.anchor && t.head == this.head;
|
|
1201
|
+
}
|
|
1202
|
+
getBookmark() {
|
|
1203
|
+
return new wt(this.anchor, this.head);
|
|
1204
|
+
}
|
|
1205
|
+
toJSON() {
|
|
1206
|
+
return { type: "text", anchor: this.anchor, head: this.head };
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
@internal
|
|
1210
|
+
*/
|
|
1211
|
+
static fromJSON(t, e) {
|
|
1212
|
+
if (typeof e.anchor != "number" || typeof e.head != "number")
|
|
1213
|
+
throw new RangeError("Invalid input for TextSelection.fromJSON");
|
|
1214
|
+
return new A(t.resolve(e.anchor), t.resolve(e.head));
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
Create a text selection from non-resolved positions.
|
|
1218
|
+
*/
|
|
1219
|
+
static create(t, e, r = e) {
|
|
1220
|
+
let n = t.resolve(e);
|
|
1221
|
+
return new this(n, r == e ? n : t.resolve(r));
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
Return a text selection that spans the given positions or, if
|
|
1225
|
+
they aren't text positions, find a text selection near them.
|
|
1226
|
+
`bias` determines whether the method searches forward (default)
|
|
1227
|
+
or backwards (negative number) first. Will fall back to calling
|
|
1228
|
+
[`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
|
|
1229
|
+
doesn't contain a valid text position.
|
|
1230
|
+
*/
|
|
1231
|
+
static between(t, e, r) {
|
|
1232
|
+
let n = t.pos - e.pos;
|
|
1233
|
+
if ((!r || n) && (r = n >= 0 ? 1 : -1), !e.parent.inlineContent) {
|
|
1234
|
+
let s = f.findFrom(e, r, !0) || f.findFrom(e, -r, !0);
|
|
1235
|
+
if (s)
|
|
1236
|
+
e = s.$head;
|
|
1237
|
+
else
|
|
1238
|
+
return f.near(e, r);
|
|
1239
|
+
}
|
|
1240
|
+
return t.parent.inlineContent || (n == 0 ? t = e : (t = (f.findFrom(t, -r, !0) || f.findFrom(t, r, !0)).$anchor, t.pos < e.pos != n < 0 && (t = e))), new A(t, e);
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
f.jsonID("text", R);
|
|
1244
|
+
var wt = class kt {
|
|
1245
|
+
constructor(t, e) {
|
|
1246
|
+
this.anchor = t, this.head = e;
|
|
1247
|
+
}
|
|
1248
|
+
map(t) {
|
|
1249
|
+
return new kt(t.map(this.anchor), t.map(this.head));
|
|
1250
|
+
}
|
|
1251
|
+
resolve(t) {
|
|
1252
|
+
return R.between(t.resolve(this.anchor), t.resolve(this.head));
|
|
1253
|
+
}
|
|
1254
|
+
}, E = class M extends f {
|
|
1255
|
+
/**
|
|
1256
|
+
Create a node selection. Does not verify the validity of its
|
|
1257
|
+
argument.
|
|
1258
|
+
*/
|
|
1259
|
+
constructor(t) {
|
|
1260
|
+
let e = t.nodeAfter, r = t.node(0).resolve(t.pos + e.nodeSize);
|
|
1261
|
+
super(t, r), this.node = e;
|
|
1262
|
+
}
|
|
1263
|
+
map(t, e) {
|
|
1264
|
+
let { deleted: r, pos: n } = e.mapResult(this.anchor), s = t.resolve(n);
|
|
1265
|
+
return r ? f.near(s) : new M(s);
|
|
1266
|
+
}
|
|
1267
|
+
content() {
|
|
1268
|
+
return new c(g.from(this.node), 0, 0);
|
|
1269
|
+
}
|
|
1270
|
+
eq(t) {
|
|
1271
|
+
return t instanceof M && t.anchor == this.anchor;
|
|
1272
|
+
}
|
|
1273
|
+
toJSON() {
|
|
1274
|
+
return { type: "node", anchor: this.anchor };
|
|
1275
|
+
}
|
|
1276
|
+
getBookmark() {
|
|
1277
|
+
return new Jt(this.anchor);
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
@internal
|
|
1281
|
+
*/
|
|
1282
|
+
static fromJSON(t, e) {
|
|
1283
|
+
if (typeof e.anchor != "number")
|
|
1284
|
+
throw new RangeError("Invalid input for NodeSelection.fromJSON");
|
|
1285
|
+
return new M(t.resolve(e.anchor));
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
Create a node selection from non-resolved positions.
|
|
1289
|
+
*/
|
|
1290
|
+
static create(t, e) {
|
|
1291
|
+
return new M(t.resolve(e));
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
Determines whether the given node may be selected as a node
|
|
1295
|
+
selection.
|
|
1296
|
+
*/
|
|
1297
|
+
static isSelectable(t) {
|
|
1298
|
+
return !t.isText && t.type.spec.selectable !== !1;
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
E.prototype.visible = !1;
|
|
1302
|
+
f.jsonID("node", E);
|
|
1303
|
+
var Jt = class vt {
|
|
1304
|
+
constructor(t) {
|
|
1305
|
+
this.anchor = t;
|
|
1306
|
+
}
|
|
1307
|
+
map(t) {
|
|
1308
|
+
let { deleted: e, pos: r } = t.mapResult(this.anchor);
|
|
1309
|
+
return e ? new wt(r, r) : new vt(r);
|
|
1310
|
+
}
|
|
1311
|
+
resolve(t) {
|
|
1312
|
+
let e = t.resolve(this.anchor), r = e.nodeAfter;
|
|
1313
|
+
return r && E.isSelectable(r) ? new E(e) : f.near(e);
|
|
1314
|
+
}
|
|
1315
|
+
}, b = class P extends f {
|
|
1316
|
+
/**
|
|
1317
|
+
Create an all-selection over the given document.
|
|
1318
|
+
*/
|
|
1319
|
+
constructor(t) {
|
|
1320
|
+
super(t.resolve(0), t.resolve(t.content.size));
|
|
1321
|
+
}
|
|
1322
|
+
replace(t, e = c.empty) {
|
|
1323
|
+
if (e == c.empty) {
|
|
1324
|
+
t.delete(0, t.doc.content.size);
|
|
1325
|
+
let r = f.atStart(t.doc);
|
|
1326
|
+
r.eq(t.selection) || t.setSelection(r);
|
|
1327
|
+
} else
|
|
1328
|
+
super.replace(t, e);
|
|
1329
|
+
}
|
|
1330
|
+
toJSON() {
|
|
1331
|
+
return { type: "all" };
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
@internal
|
|
1335
|
+
*/
|
|
1336
|
+
static fromJSON(t) {
|
|
1337
|
+
return new P(t);
|
|
1338
|
+
}
|
|
1339
|
+
map(t) {
|
|
1340
|
+
return new P(t);
|
|
1341
|
+
}
|
|
1342
|
+
eq(t) {
|
|
1343
|
+
return t instanceof P;
|
|
1344
|
+
}
|
|
1345
|
+
getBookmark() {
|
|
1346
|
+
return At;
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
f.jsonID("all", b);
|
|
1350
|
+
var At = {
|
|
1351
|
+
map() {
|
|
1352
|
+
return this;
|
|
1353
|
+
},
|
|
1354
|
+
resolve(i) {
|
|
1355
|
+
return new b(i);
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
function N(i, t, e, r, n, s = !1) {
|
|
1359
|
+
if (t.inlineContent)
|
|
1360
|
+
return R.create(i, e);
|
|
1361
|
+
for (let o = r - (n > 0 ? 0 : 1); n > 0 ? o < t.childCount : o >= 0; o += n) {
|
|
1362
|
+
let a = t.child(o);
|
|
1363
|
+
if (a.isAtom) {
|
|
1364
|
+
if (!s && E.isSelectable(a))
|
|
1365
|
+
return E.create(i, e - (n < 0 ? a.nodeSize : 0));
|
|
1366
|
+
} else {
|
|
1367
|
+
let l = N(i, a, e + n, n < 0 ? a.childCount : 0, n, s);
|
|
1368
|
+
if (l)
|
|
1369
|
+
return l;
|
|
1370
|
+
}
|
|
1371
|
+
e += a.nodeSize * n;
|
|
1372
|
+
}
|
|
1373
|
+
return null;
|
|
1374
|
+
}
|
|
1375
|
+
function rt(i, t, e) {
|
|
1376
|
+
let r = i.steps.length - 1;
|
|
1377
|
+
if (r < t)
|
|
1378
|
+
return;
|
|
1379
|
+
let n = i.steps[r];
|
|
1380
|
+
if (!(n instanceof U || n instanceof gt))
|
|
1381
|
+
return;
|
|
1382
|
+
let s = i.mapping.maps[r], o;
|
|
1383
|
+
s.forEach((a, l, h, u) => {
|
|
1384
|
+
o == null && (o = u);
|
|
1385
|
+
}), i.setSelection(f.near(i.doc.resolve(o), e));
|
|
1386
|
+
}
|
|
1387
|
+
function nt(i, t) {
|
|
1388
|
+
return !t || !i ? i : i.bind(t);
|
|
1389
|
+
}
|
|
1390
|
+
var B = class {
|
|
1391
|
+
constructor(i, t, e) {
|
|
1392
|
+
this.name = i, this.init = nt(t.init, e), this.apply = nt(t.apply, e);
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
new B("doc", {
|
|
1396
|
+
init(i) {
|
|
1397
|
+
return i.doc || i.schema.topNodeType.createAndFill();
|
|
1398
|
+
},
|
|
1399
|
+
apply(i) {
|
|
1400
|
+
return i.doc;
|
|
1401
|
+
}
|
|
1402
|
+
}), new B("selection", {
|
|
1403
|
+
init(i, t) {
|
|
1404
|
+
return i.selection || f.atStart(t.doc);
|
|
1405
|
+
},
|
|
1406
|
+
apply(i) {
|
|
1407
|
+
return i.selection;
|
|
1408
|
+
}
|
|
1409
|
+
}), new B("storedMarks", {
|
|
1410
|
+
init(i) {
|
|
1411
|
+
return i.storedMarks || null;
|
|
1412
|
+
},
|
|
1413
|
+
apply(i, t, e, r) {
|
|
1414
|
+
return r.selection.$cursor ? i.storedMarks : null;
|
|
1415
|
+
}
|
|
1416
|
+
}), new B("scrollToSelection", {
|
|
1417
|
+
init() {
|
|
1418
|
+
return 0;
|
|
1419
|
+
},
|
|
1420
|
+
apply(i, t) {
|
|
1421
|
+
return i.scrolledIntoView ? t + 1 : t;
|
|
1422
|
+
}
|
|
1423
|
+
});
|
|
1424
|
+
var Mt = (i, t) => {
|
|
1425
|
+
var e;
|
|
1426
|
+
const { state: r, view: n } = i, { selection: s } = r;
|
|
1427
|
+
if (!s.empty) return !1;
|
|
1428
|
+
const { $from: o } = s;
|
|
1429
|
+
if (o.parentOffset !== 0) return !1;
|
|
1430
|
+
const a = o.depth - 1, l = o.node(a), h = o.index(a);
|
|
1431
|
+
if (h === 0) return !1;
|
|
1432
|
+
if (l.type === t)
|
|
1433
|
+
return i.commands.lift(t.name);
|
|
1434
|
+
const u = l.child(h - 1);
|
|
1435
|
+
if (u.type !== t || !((e = u.lastChild) != null && e.isTextblock))
|
|
1436
|
+
return !1;
|
|
1437
|
+
const S = o.before(), O = S - 1 - 1, { tr: v } = r;
|
|
1438
|
+
return v.delete(S, o.after()).insert(O, o.parent.content), v.setSelection(R.create(v.doc, O)), n.dispatch(v.scrollIntoView()), !0;
|
|
1439
|
+
}, bt = /^\s*>\s$/, Bt = yt.create({
|
|
4
1440
|
name: "blockquote",
|
|
5
1441
|
addOptions() {
|
|
6
1442
|
return {
|
|
@@ -13,50 +1449,51 @@ var m = /^\s*>\s$/, q = c.create({
|
|
|
13
1449
|
parseHTML() {
|
|
14
1450
|
return [{ tag: "blockquote" }];
|
|
15
1451
|
},
|
|
16
|
-
renderHTML({ HTMLAttributes:
|
|
17
|
-
return /* @__PURE__ */
|
|
1452
|
+
renderHTML({ HTMLAttributes: i }) {
|
|
1453
|
+
return /* @__PURE__ */ Z("blockquote", { ...Nt(this.options.HTMLAttributes, i), children: /* @__PURE__ */ Z("slot", {}) });
|
|
18
1454
|
},
|
|
19
|
-
parseMarkdown: (
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
return
|
|
1455
|
+
parseMarkdown: (i, t) => {
|
|
1456
|
+
var e;
|
|
1457
|
+
const r = (e = t.parseBlockChildren) != null ? e : t.parseChildren;
|
|
1458
|
+
return t.createNode("blockquote", void 0, r(i.tokens || []));
|
|
23
1459
|
},
|
|
24
|
-
renderMarkdown: (
|
|
25
|
-
if (!
|
|
1460
|
+
renderMarkdown: (i, t) => {
|
|
1461
|
+
if (!i.content)
|
|
26
1462
|
return "";
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
`).map((
|
|
32
|
-
|
|
1463
|
+
const e = ">", r = [];
|
|
1464
|
+
return i.content.forEach((n, s) => {
|
|
1465
|
+
var o, a;
|
|
1466
|
+
const u = ((a = (o = t.renderChild) == null ? void 0 : o.call(t, n, s)) != null ? a : t.renderChildren([n])).split(`
|
|
1467
|
+
`).map((S) => S.trim() === "" ? e : `${e} ${S}`);
|
|
1468
|
+
r.push(u.join(`
|
|
33
1469
|
`));
|
|
34
|
-
}),
|
|
35
|
-
${
|
|
1470
|
+
}), r.join(`
|
|
1471
|
+
${e}
|
|
36
1472
|
`);
|
|
37
1473
|
},
|
|
38
1474
|
addCommands() {
|
|
39
1475
|
return {
|
|
40
|
-
setBlockquote: () => ({ commands:
|
|
41
|
-
toggleBlockquote: () => ({ commands:
|
|
42
|
-
unsetBlockquote: () => ({ commands:
|
|
1476
|
+
setBlockquote: () => ({ commands: i }) => i.wrapIn(this.name),
|
|
1477
|
+
toggleBlockquote: () => ({ commands: i }) => i.toggleWrap(this.name),
|
|
1478
|
+
unsetBlockquote: () => ({ commands: i }) => i.lift(this.name)
|
|
43
1479
|
};
|
|
44
1480
|
},
|
|
45
1481
|
addKeyboardShortcuts() {
|
|
46
1482
|
return {
|
|
47
|
-
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote()
|
|
1483
|
+
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
|
|
1484
|
+
Backspace: () => Mt(this.editor, this.type)
|
|
48
1485
|
};
|
|
49
1486
|
},
|
|
50
1487
|
addInputRules() {
|
|
51
1488
|
return [
|
|
52
|
-
|
|
53
|
-
find:
|
|
1489
|
+
xt({
|
|
1490
|
+
find: bt,
|
|
54
1491
|
type: this.type
|
|
55
1492
|
})
|
|
56
1493
|
];
|
|
57
1494
|
}
|
|
58
1495
|
});
|
|
59
1496
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
1497
|
+
Bt as Blockquote,
|
|
1498
|
+
bt as inputRegex
|
|
62
1499
|
};
|