@xlabs-store/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/components/index.d.ts +35 -0
- package/components/index.js +1 -0
- package/components/p-5c86X8JO.js +1 -0
- package/components/p-6KpqCGp9.js +1 -0
- package/components/p-ADwHM_jT.js +1 -0
- package/components/p-AgSyA7Ia.js +1 -0
- package/components/p-B-7Hwizp.js +1 -0
- package/components/p-B-ClGFfy.js +1 -0
- package/components/p-B4R9Mtmk.js +1 -0
- package/components/p-B4rO7Sgt.js +1 -0
- package/components/p-B5Syz0fw.js +1 -0
- package/components/p-B6p-mzW-.js +1 -0
- package/components/p-B8SZP5Xz.js +1 -0
- package/components/p-BBGHXZqR.js +1 -0
- package/components/p-BHLvuyOq.js +1 -0
- package/components/p-BM-ap7lt.js +1 -0
- package/components/p-BOCR5Zk0.js +1 -0
- package/components/p-BPeosvTA.js +1 -0
- package/components/p-BRBrLtOz.js +1 -0
- package/components/p-BSRP2TGa.js +1 -0
- package/components/p-BUjRcJoK.js +1 -0
- package/components/p-BVeQ5W_G.js +1 -0
- package/components/p-BVnVlCcd.js +1 -0
- package/components/p-BZQcq9R_.js +1 -0
- package/components/p-BeIFU-wn.js +1 -0
- package/components/p-BkEgl31q.js +1 -0
- package/components/p-BkPJ1Whr.js +1 -0
- package/components/p-BkevSugc.js +1 -0
- package/components/p-BkiOFW3H.js +1 -0
- package/components/p-BskMfHyY.js +1 -0
- package/components/p-Bu2JqZs8.js +1 -0
- package/components/p-BvjR2Q5Q.js +1 -0
- package/components/p-Bz7MhZ4K.js +1 -0
- package/components/p-C3gvR6nN.js +1 -0
- package/components/p-C70KKm8p.js +1 -0
- package/components/p-C7csgUoA.js +1 -0
- package/components/p-CAPfC5Vn.js +1 -0
- package/components/p-CEBSDVyp.js +1 -0
- package/components/p-CFB6xkAX.js +1 -0
- package/components/p-CGIxdOEm.js +1 -0
- package/components/p-CGYOWZnh.js +1 -0
- package/components/p-CHRrsVXB.js +1 -0
- package/components/p-CKUzvJue.js +1 -0
- package/components/p-CKVSyuIH.js +1 -0
- package/components/p-COpzIi1n.js +1 -0
- package/components/p-CRBPzT4B.js +1 -0
- package/components/p-CSfrs76m.js +1 -0
- package/components/p-C_ZBjXFP.js +1 -0
- package/components/p-Cd919NAP.js +1 -0
- package/components/p-Ce32Mo_Q.js +1 -0
- package/components/p-Ce5L9qbY.js +1 -0
- package/components/p-CeBfFEIa.js +1 -0
- package/components/p-CfhgoXyB.js +1 -0
- package/components/p-Ck6SW8G3.js +1 -0
- package/components/p-Co3Y9VjQ.js +1 -0
- package/components/p-D66tF8_2.js +1 -0
- package/components/p-D7ijqXRY.js +1 -0
- package/components/p-D7n-26Q5.js +1 -0
- package/components/p-D8ew7Rgv.js +1 -0
- package/components/p-DBk4T-b-.js +1 -0
- package/components/p-DD-W_fMF.js +1 -0
- package/components/p-DElCk9ta.js +1 -0
- package/components/p-DEumEVI3.js +1 -0
- package/components/p-DGqQ8PT4.js +1 -0
- package/components/p-DJ1WhSJ4.js +1 -0
- package/components/p-DOxXxhXb.js +1 -0
- package/components/p-DRa4o4c6.js +1 -0
- package/components/p-DTlSrH8_.js +1 -0
- package/components/p-DTvD0UO5.js +1 -0
- package/components/p-DVz50Dd3.js +1 -0
- package/components/p-DZFphzg1.js +1 -0
- package/components/p-DZPUUptR.js +1 -0
- package/components/p-D_xaGiZU.js +1 -0
- package/components/p-DaL42JUi.js +1 -0
- package/components/p-DbRpEXwX.js +1 -0
- package/components/p-DcRlYBIl.js +1 -0
- package/components/p-Dg0xgMke.js +1 -0
- package/components/p-Dgxy93Bg.js +1 -0
- package/components/p-Dky_8i8S.js +1 -0
- package/components/p-DlwlBBr4.js +1 -0
- package/components/p-DoTf8yXn.js +1 -0
- package/components/p-DphUq6Z5.js +1 -0
- package/components/p-DsgWQbJY.js +1 -0
- package/components/p-Dx3yBe39.js +1 -0
- package/components/p-DxKMnrS8.js +1 -0
- package/components/p-O88oQkR1.js +1 -0
- package/components/p-PlUkLT0A.js +1 -0
- package/components/p-QTSiPk0I.js +1 -0
- package/components/p-TC9DZAbC.js +1 -0
- package/components/p-XBF88YT_.js +1 -0
- package/components/p-bVsOg7S9.js +1 -0
- package/components/p-ccpcKv5U.js +1 -0
- package/components/p-en06CSUT.js +1 -0
- package/components/p-g6ZBqIze.js +1 -0
- package/components/p-noTpj1Kh.js +1 -0
- package/components/x-address.d.ts +11 -0
- package/components/x-address.js +1 -0
- package/components/x-affix.d.ts +11 -0
- package/components/x-affix.js +1 -0
- package/components/x-alert.d.ts +11 -0
- package/components/x-alert.js +1 -0
- package/components/x-anchor-link.d.ts +11 -0
- package/components/x-anchor-link.js +1 -0
- package/components/x-anchor.d.ts +11 -0
- package/components/x-anchor.js +1 -0
- package/components/x-app.d.ts +11 -0
- package/components/x-app.js +1 -0
- package/components/x-auto-complete-dropdown-content.d.ts +11 -0
- package/components/x-auto-complete-dropdown-content.js +1 -0
- package/components/x-auto-complete.d.ts +11 -0
- package/components/x-auto-complete.js +1 -0
- package/components/x-avatar.d.ts +11 -0
- package/components/x-avatar.js +1 -0
- package/components/x-back-top.d.ts +11 -0
- package/components/x-back-top.js +1 -0
- package/components/x-badge.d.ts +11 -0
- package/components/x-badge.js +1 -0
- package/components/x-breadcrumb-item.d.ts +11 -0
- package/components/x-breadcrumb-item.js +1 -0
- package/components/x-breadcrumb.d.ts +11 -0
- package/components/x-breadcrumb.js +1 -0
- package/components/x-button.d.ts +11 -0
- package/components/x-button.js +1 -0
- package/components/x-captcha.d.ts +11 -0
- package/components/x-captcha.js +1 -0
- package/components/x-card.d.ts +11 -0
- package/components/x-card.js +1 -0
- package/components/x-carousel.d.ts +11 -0
- package/components/x-carousel.js +1 -0
- package/components/x-cascader-dropdown-content.d.ts +11 -0
- package/components/x-cascader-dropdown-content.js +1 -0
- package/components/x-cascader.d.ts +11 -0
- package/components/x-cascader.js +1 -0
- package/components/x-checkbox.d.ts +11 -0
- package/components/x-checkbox.js +1 -0
- package/components/x-col.d.ts +11 -0
- package/components/x-col.js +1 -0
- package/components/x-collapse-panel.d.ts +11 -0
- package/components/x-collapse-panel.js +1 -0
- package/components/x-collapse.d.ts +11 -0
- package/components/x-collapse.js +1 -0
- package/components/x-color-picker-panel.d.ts +11 -0
- package/components/x-color-picker-panel.js +1 -0
- package/components/x-color-picker.d.ts +11 -0
- package/components/x-color-picker.js +1 -0
- package/components/x-comment.d.ts +11 -0
- package/components/x-comment.js +1 -0
- package/components/x-content.d.ts +11 -0
- package/components/x-content.js +1 -0
- package/components/x-date-picker-dropdown-content.d.ts +11 -0
- package/components/x-date-picker-dropdown-content.js +1 -0
- package/components/x-date-picker.d.ts +11 -0
- package/components/x-date-picker.js +1 -0
- package/components/x-descriptions-item.d.ts +11 -0
- package/components/x-descriptions-item.js +1 -0
- package/components/x-descriptions.d.ts +11 -0
- package/components/x-descriptions.js +1 -0
- package/components/x-divider.d.ts +11 -0
- package/components/x-divider.js +1 -0
- package/components/x-drawer-content.d.ts +11 -0
- package/components/x-drawer-content.js +1 -0
- package/components/x-drawer.d.ts +11 -0
- package/components/x-drawer.js +1 -0
- package/components/x-dropdown-content.d.ts +11 -0
- package/components/x-dropdown-content.js +1 -0
- package/components/x-dropdown.d.ts +11 -0
- package/components/x-dropdown.js +1 -0
- package/components/x-editor.d.ts +11 -0
- package/components/x-editor.js +1 -0
- package/components/x-empty.d.ts +11 -0
- package/components/x-empty.js +1 -0
- package/components/x-finder.d.ts +11 -0
- package/components/x-finder.js +1 -0
- package/components/x-flex.d.ts +11 -0
- package/components/x-flex.js +1 -0
- package/components/x-float-button.d.ts +11 -0
- package/components/x-float-button.js +1 -0
- package/components/x-footer.d.ts +11 -0
- package/components/x-footer.js +1 -0
- package/components/x-form-builder.d.ts +11 -0
- package/components/x-form-builder.js +1 -0
- package/components/x-form-item.d.ts +11 -0
- package/components/x-form-item.js +1 -0
- package/components/x-form.d.ts +11 -0
- package/components/x-form.js +1 -0
- package/components/x-header.d.ts +11 -0
- package/components/x-header.js +1 -0
- package/components/x-icon.d.ts +11 -0
- package/components/x-icon.js +1 -0
- package/components/x-image.d.ts +11 -0
- package/components/x-image.js +1 -0
- package/components/x-infinite-scroll.d.ts +11 -0
- package/components/x-infinite-scroll.js +1 -0
- package/components/x-input-number.d.ts +11 -0
- package/components/x-input-number.js +1 -0
- package/components/x-input.d.ts +11 -0
- package/components/x-input.js +1 -0
- package/components/x-layout.d.ts +11 -0
- package/components/x-layout.js +1 -0
- package/components/x-list-item.d.ts +11 -0
- package/components/x-list-item.js +1 -0
- package/components/x-list.d.ts +11 -0
- package/components/x-list.js +1 -0
- package/components/x-mentions.d.ts +11 -0
- package/components/x-mentions.js +1 -0
- package/components/x-menu-divider.d.ts +11 -0
- package/components/x-menu-divider.js +1 -0
- package/components/x-menu-item-group.d.ts +11 -0
- package/components/x-menu-item-group.js +1 -0
- package/components/x-menu-item.d.ts +11 -0
- package/components/x-menu-item.js +1 -0
- package/components/x-menu-submenu.d.ts +11 -0
- package/components/x-menu-submenu.js +1 -0
- package/components/x-menu.d.ts +11 -0
- package/components/x-menu.js +1 -0
- package/components/x-message.d.ts +11 -0
- package/components/x-message.js +1 -0
- package/components/x-modal-content.d.ts +11 -0
- package/components/x-modal-content.js +1 -0
- package/components/x-modal.d.ts +11 -0
- package/components/x-modal.js +1 -0
- package/components/x-notification.d.ts +11 -0
- package/components/x-notification.js +1 -0
- package/components/x-page-header.d.ts +11 -0
- package/components/x-page-header.js +1 -0
- package/components/x-pagination.d.ts +11 -0
- package/components/x-pagination.js +1 -0
- package/components/x-popconfirm-content.d.ts +11 -0
- package/components/x-popconfirm-content.js +1 -0
- package/components/x-popconfirm.d.ts +11 -0
- package/components/x-popconfirm.js +1 -0
- package/components/x-popover-content.d.ts +11 -0
- package/components/x-popover-content.js +1 -0
- package/components/x-popover.d.ts +11 -0
- package/components/x-popover.js +1 -0
- package/components/x-progress.d.ts +11 -0
- package/components/x-progress.js +1 -0
- package/components/x-qr-code.d.ts +11 -0
- package/components/x-qr-code.js +1 -0
- package/components/x-radio-group.d.ts +11 -0
- package/components/x-radio-group.js +1 -0
- package/components/x-radio.d.ts +11 -0
- package/components/x-radio.js +1 -0
- package/components/x-range-picker-dropdown-content.d.ts +11 -0
- package/components/x-range-picker-dropdown-content.js +1 -0
- package/components/x-range-picker.d.ts +11 -0
- package/components/x-range-picker.js +1 -0
- package/components/x-rate.d.ts +11 -0
- package/components/x-rate.js +1 -0
- package/components/x-result.d.ts +11 -0
- package/components/x-result.js +1 -0
- package/components/x-row.d.ts +11 -0
- package/components/x-row.js +1 -0
- package/components/x-segmented.d.ts +11 -0
- package/components/x-segmented.js +1 -0
- package/components/x-select-dropdown-content.d.ts +11 -0
- package/components/x-select-dropdown-content.js +1 -0
- package/components/x-select-option.d.ts +11 -0
- package/components/x-select-option.js +1 -0
- package/components/x-select.d.ts +11 -0
- package/components/x-select.js +1 -0
- package/components/x-sider.d.ts +11 -0
- package/components/x-sider.js +1 -0
- package/components/x-skeleton.d.ts +11 -0
- package/components/x-skeleton.js +1 -0
- package/components/x-slider.d.ts +11 -0
- package/components/x-slider.js +1 -0
- package/components/x-space.d.ts +11 -0
- package/components/x-space.js +1 -0
- package/components/x-spin.d.ts +11 -0
- package/components/x-spin.js +1 -0
- package/components/x-splitter-panel.d.ts +11 -0
- package/components/x-splitter-panel.js +1 -0
- package/components/x-splitter.d.ts +11 -0
- package/components/x-splitter.js +1 -0
- package/components/x-statistic.d.ts +11 -0
- package/components/x-statistic.js +1 -0
- package/components/x-step.d.ts +11 -0
- package/components/x-step.js +1 -0
- package/components/x-steps.d.ts +11 -0
- package/components/x-steps.js +1 -0
- package/components/x-switch.d.ts +11 -0
- package/components/x-switch.js +1 -0
- package/components/x-tab-pane.d.ts +11 -0
- package/components/x-tab-pane.js +1 -0
- package/components/x-table-cell.d.ts +11 -0
- package/components/x-table-cell.js +1 -0
- package/components/x-table-row.d.ts +11 -0
- package/components/x-table-row.js +1 -0
- package/components/x-table.d.ts +11 -0
- package/components/x-table.js +1 -0
- package/components/x-tabs.d.ts +11 -0
- package/components/x-tabs.js +1 -0
- package/components/x-tag.d.ts +11 -0
- package/components/x-tag.js +1 -0
- package/components/x-textarea.d.ts +11 -0
- package/components/x-textarea.js +1 -0
- package/components/x-time-picker-dropdown-content.d.ts +11 -0
- package/components/x-time-picker-dropdown-content.js +1 -0
- package/components/x-time-picker.d.ts +11 -0
- package/components/x-time-picker.js +1 -0
- package/components/x-timeline-item.d.ts +11 -0
- package/components/x-timeline-item.js +1 -0
- package/components/x-timeline.d.ts +11 -0
- package/components/x-timeline.js +1 -0
- package/components/x-tooltip-content.d.ts +11 -0
- package/components/x-tooltip-content.js +1 -0
- package/components/x-tooltip.d.ts +11 -0
- package/components/x-tooltip.js +1 -0
- package/components/x-tour-panel.d.ts +11 -0
- package/components/x-tour-panel.js +1 -0
- package/components/x-tour.d.ts +11 -0
- package/components/x-tour.js +1 -0
- package/components/x-transfer.d.ts +11 -0
- package/components/x-transfer.js +1 -0
- package/components/x-tree-select-dropdown-content.d.ts +11 -0
- package/components/x-tree-select-dropdown-content.js +1 -0
- package/components/x-tree-select.d.ts +11 -0
- package/components/x-tree-select.js +1 -0
- package/components/x-tree.d.ts +11 -0
- package/components/x-tree.js +1 -0
- package/components/x-typography.d.ts +11 -0
- package/components/x-typography.js +1 -0
- package/components/x-upload.d.ts +11 -0
- package/components/x-upload.js +1 -0
- package/components/x-virtual-scroll.d.ts +11 -0
- package/components/x-virtual-scroll.js +1 -0
- package/components/x-workflow-builder.d.ts +11 -0
- package/components/x-workflow-builder.js +1 -0
- package/components/x-workflow.d.ts +11 -0
- package/components/x-workflow.js +1 -0
- package/dist/cjs/abstract-control-C4D0eNCC.js +277 -0
- package/dist/cjs/config-BP9bROYD.js +63 -0
- package/dist/cjs/index-C7sKs9A2.js +2170 -0
- package/dist/cjs/index.cjs.js +14 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/locale.service-Cz-aZQnr.js +8203 -0
- package/dist/cjs/modal-service-BtAF0mFq.js +399 -0
- package/dist/cjs/notification-service-m6I5U9aG.js +602 -0
- package/dist/cjs/portal-controller-CtYVbhXL.js +504 -0
- package/dist/cjs/schema-builder-CYnX7lKi.js +1505 -0
- package/dist/cjs/tree.service-fxLOCSpD.js +339 -0
- package/dist/cjs/types-DQ-V76ZQ.js +255 -0
- package/dist/cjs/x-address_14.cjs.entry.js +12577 -0
- package/dist/cjs/x-affix.cjs.entry.js +182 -0
- package/dist/cjs/x-alert_11.cjs.entry.js +3239 -0
- package/dist/cjs/x-anchor-link.cjs.entry.js +67 -0
- package/dist/cjs/x-anchor.cjs.entry.js +158 -0
- package/dist/cjs/x-app.cjs.entry.js +137 -0
- package/dist/cjs/x-auto-complete-dropdown-content.cjs.entry.js +69 -0
- package/dist/cjs/x-avatar.cjs.entry.js +269 -0
- package/dist/cjs/x-back-top.cjs.entry.js +89 -0
- package/dist/cjs/x-breadcrumb_5.cjs.entry.js +1554 -0
- package/dist/cjs/x-button.cjs.entry.js +174 -0
- package/dist/cjs/x-card_12.cjs.entry.js +1386 -0
- package/dist/cjs/x-carousel.cjs.entry.js +147 -0
- package/dist/cjs/x-cascader-dropdown-content.cjs.entry.js +364 -0
- package/dist/cjs/x-checkbox_5.cjs.entry.js +1376 -0
- package/dist/cjs/x-collapse-panel.cjs.entry.js +243 -0
- package/dist/cjs/x-collapse.cjs.entry.js +291 -0
- package/dist/cjs/x-color-picker-panel_2.cjs.entry.js +873 -0
- package/dist/cjs/x-color-picker_9.cjs.entry.js +3085 -0
- package/dist/cjs/x-comment.cjs.entry.js +189 -0
- package/dist/cjs/x-date-picker-dropdown-content.cjs.entry.js +757 -0
- package/dist/cjs/x-descriptions-item.cjs.entry.js +108 -0
- package/dist/cjs/x-drawer-content.cjs.entry.js +197 -0
- package/dist/cjs/x-drawer.cjs.entry.js +294 -0
- package/dist/cjs/x-dropdown_2.cjs.entry.js +735 -0
- package/dist/cjs/x-empty.cjs.entry.js +64 -0
- package/dist/cjs/x-finder.cjs.entry.js +647 -0
- package/dist/cjs/x-form-builder.cjs.entry.js +807 -0
- package/dist/cjs/x-icon.cjs.entry.js +144 -0
- package/dist/cjs/x-infinite-scroll.cjs.entry.js +129 -0
- package/dist/cjs/x-list-item.cjs.entry.js +27 -0
- package/dist/cjs/x-list.cjs.entry.js +138 -0
- package/dist/cjs/x-mentions.cjs.entry.js +275 -0
- package/dist/cjs/x-menu-divider.cjs.entry.js +49 -0
- package/dist/cjs/x-menu-item-group.cjs.entry.js +149 -0
- package/dist/cjs/x-menu-submenu.cjs.entry.js +373 -0
- package/dist/cjs/x-message.cjs.entry.js +219 -0
- package/dist/cjs/x-modal-content.cjs.entry.js +217 -0
- package/dist/cjs/x-notification.cjs.entry.js +325 -0
- package/dist/cjs/x-page-header.cjs.entry.js +67 -0
- package/dist/cjs/x-popconfirm-content.cjs.entry.js +72 -0
- package/dist/cjs/x-popconfirm.cjs.entry.js +181 -0
- package/dist/cjs/x-progress.cjs.entry.js +136 -0
- package/dist/cjs/x-qr-code.cjs.entry.js +446 -0
- package/dist/cjs/x-range-picker-dropdown-content.cjs.entry.js +821 -0
- package/dist/cjs/x-select_2.cjs.entry.js +1316 -0
- package/dist/cjs/x-skeleton.cjs.entry.js +75 -0
- package/dist/cjs/x-spin.cjs.entry.js +62 -0
- package/dist/cjs/x-splitter-panel.cjs.entry.js +91 -0
- package/dist/cjs/x-splitter.cjs.entry.js +612 -0
- package/dist/cjs/x-statistic.cjs.entry.js +104 -0
- package/dist/cjs/x-step.cjs.entry.js +179 -0
- package/dist/cjs/x-steps.cjs.entry.js +439 -0
- package/dist/cjs/x-tab-pane.cjs.entry.js +73 -0
- package/dist/cjs/x-table-cell.cjs.entry.js +45 -0
- package/dist/cjs/x-table-row.cjs.entry.js +85 -0
- package/dist/cjs/x-tabs.cjs.entry.js +609 -0
- package/dist/cjs/x-time-picker-dropdown-content.cjs.entry.js +389 -0
- package/dist/cjs/x-timeline-item.cjs.entry.js +50 -0
- package/dist/cjs/x-timeline.cjs.entry.js +52 -0
- package/dist/cjs/x-tour-panel.cjs.entry.js +89 -0
- package/dist/cjs/x-tour.cjs.entry.js +344 -0
- package/dist/cjs/x-tree-select-dropdown-content.cjs.entry.js +439 -0
- package/dist/cjs/x-virtual-scroll.cjs.entry.js +203 -0
- package/dist/cjs/x-workflow-builder.cjs.entry.js +366 -0
- package/dist/cjs/xlabs-store.cjs.js +24 -0
- package/dist/collection/collection-manifest.json +130 -0
- package/dist/collection/components/x-address/vietnam-data.js +28 -0
- package/dist/collection/components/x-address/x-address.css +367 -0
- package/dist/collection/components/x-address/x-address.js +403 -0
- package/dist/collection/components/x-affix/x-affix.css +27 -0
- package/dist/collection/components/x-affix/x-affix.js +299 -0
- package/dist/collection/components/x-alert/x-alert.css +475 -0
- package/dist/collection/components/x-alert/x-alert.js +273 -0
- package/dist/collection/components/x-anchor/x-anchor.css +74 -0
- package/dist/collection/components/x-anchor/x-anchor.js +371 -0
- package/dist/collection/components/x-anchor-link/x-anchor-link.css +43 -0
- package/dist/collection/components/x-anchor-link/x-anchor-link.js +145 -0
- package/dist/collection/components/x-app/x-app.css +14 -0
- package/dist/collection/components/x-app/x-app.js +308 -0
- package/dist/collection/components/x-auto-complete/auto-complete-dropdown-content/auto-complete-dropdown-content.css +410 -0
- package/dist/collection/components/x-auto-complete/auto-complete-dropdown-content/auto-complete-dropdown-content.js +166 -0
- package/dist/collection/components/x-auto-complete/auto-complete-dropdown-content/index.js +1 -0
- package/dist/collection/components/x-auto-complete/auto-complete-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-auto-complete/types.js +61 -0
- package/dist/collection/components/x-auto-complete/x-auto-complete.css +535 -0
- package/dist/collection/components/x-auto-complete/x-auto-complete.js +1829 -0
- package/dist/collection/components/x-avatar/types.js +1 -0
- package/dist/collection/components/x-avatar/x-avatar.css +128 -0
- package/dist/collection/components/x-avatar/x-avatar.js +533 -0
- package/dist/collection/components/x-back-top/x-back-top.css +56 -0
- package/dist/collection/components/x-back-top/x-back-top.js +148 -0
- package/dist/collection/components/x-badge/types.js +1 -0
- package/dist/collection/components/x-badge/x-badge.css +233 -0
- package/dist/collection/components/x-badge/x-badge.js +618 -0
- package/dist/collection/components/x-breadcrumb/x-breadcrumb.css +44 -0
- package/dist/collection/components/x-breadcrumb/x-breadcrumb.js +96 -0
- package/dist/collection/components/x-breadcrumb-item/x-breadcrumb-item.css +63 -0
- package/dist/collection/components/x-breadcrumb-item/x-breadcrumb-item.js +147 -0
- package/dist/collection/components/x-button/x-button.css +278 -0
- package/dist/collection/components/x-button/x-button.js +488 -0
- package/dist/collection/components/x-captcha/x-captcha.css +125 -0
- package/dist/collection/components/x-captcha/x-captcha.js +408 -0
- package/dist/collection/components/x-card/x-card.css +523 -0
- package/dist/collection/components/x-card/x-card.js +389 -0
- package/dist/collection/components/x-carousel/x-carousel.css +417 -0
- package/dist/collection/components/x-carousel/x-carousel.js +257 -0
- package/dist/collection/components/x-cascader/cascader-dropdown-content/cascader-dropdown-content.css +529 -0
- package/dist/collection/components/x-cascader/cascader-dropdown-content/cascader-dropdown-content.js +771 -0
- package/dist/collection/components/x-cascader/cascader-dropdown-content/index.js +2 -0
- package/dist/collection/components/x-cascader/cascader-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-cascader/types.js +1 -0
- package/dist/collection/components/x-cascader/x-cascader.css +691 -0
- package/dist/collection/components/x-cascader/x-cascader.js +1841 -0
- package/dist/collection/components/x-checkbox/types.js +1 -0
- package/dist/collection/components/x-checkbox/x-checkbox.css +541 -0
- package/dist/collection/components/x-checkbox/x-checkbox.js +681 -0
- package/dist/collection/components/x-col/x-col.css +1704 -0
- package/dist/collection/components/x-col/x-col.js +479 -0
- package/dist/collection/components/x-collapse/types.js +1 -0
- package/dist/collection/components/x-collapse/x-collapse.css +384 -0
- package/dist/collection/components/x-collapse/x-collapse.js +579 -0
- package/dist/collection/components/x-collapse-panel/x-collapse-panel.css +486 -0
- package/dist/collection/components/x-collapse-panel/x-collapse-panel.js +500 -0
- package/dist/collection/components/x-color-picker/types.js +251 -0
- package/dist/collection/components/x-color-picker/x-color-picker-panel.css +310 -0
- package/dist/collection/components/x-color-picker/x-color-picker-panel.js +575 -0
- package/dist/collection/components/x-color-picker/x-color-picker.css +446 -0
- package/dist/collection/components/x-color-picker/x-color-picker.js +1209 -0
- package/dist/collection/components/x-comment/types.js +1 -0
- package/dist/collection/components/x-comment/x-comment.css +442 -0
- package/dist/collection/components/x-comment/x-comment.js +306 -0
- package/dist/collection/components/x-content/types.js +1 -0
- package/dist/collection/components/x-content/x-content.css +361 -0
- package/dist/collection/components/x-content/x-content.js +402 -0
- package/dist/collection/components/x-date-picker/date-picker-dropdown-content/date-picker-dropdown-content.css +691 -0
- package/dist/collection/components/x-date-picker/date-picker-dropdown-content/date-picker-dropdown-content.js +1496 -0
- package/dist/collection/components/x-date-picker/date-picker-dropdown-content/index.js +1 -0
- package/dist/collection/components/x-date-picker/date-picker-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-date-picker/types.js +1 -0
- package/dist/collection/components/x-date-picker/x-date-picker.css +804 -0
- package/dist/collection/components/x-date-picker/x-date-picker.js +2110 -0
- package/dist/collection/components/x-descriptions/types.js +1 -0
- package/dist/collection/components/x-descriptions/x-descriptions.css +417 -0
- package/dist/collection/components/x-descriptions/x-descriptions.js +494 -0
- package/dist/collection/components/x-descriptions-item/x-descriptions-item.css +387 -0
- package/dist/collection/components/x-descriptions-item/x-descriptions-item.js +238 -0
- package/dist/collection/components/x-divider/x-divider.css +417 -0
- package/dist/collection/components/x-divider/x-divider.js +263 -0
- package/dist/collection/components/x-drawer/x-drawer.css +333 -0
- package/dist/collection/components/x-drawer/x-drawer.js +623 -0
- package/dist/collection/components/x-drawer-content/x-drawer-content.css +481 -0
- package/dist/collection/components/x-drawer-content/x-drawer-content.js +579 -0
- package/dist/collection/components/x-dropdown/dropdown-content/dropdown-content.css +673 -0
- package/dist/collection/components/x-dropdown/dropdown-content/dropdown-content.js +294 -0
- package/dist/collection/components/x-dropdown/dropdown-content/types.js +1 -0
- package/dist/collection/components/x-dropdown/types.js +1 -0
- package/dist/collection/components/x-dropdown/x-dropdown.css +669 -0
- package/dist/collection/components/x-dropdown/x-dropdown.js +1004 -0
- package/dist/collection/components/x-editor/editor-history.js +118 -0
- package/dist/collection/components/x-editor/editor-normalizer.js +263 -0
- package/dist/collection/components/x-editor/editor-parser.js +326 -0
- package/dist/collection/components/x-editor/editor-selection.js +415 -0
- package/dist/collection/components/x-editor/types.js +33 -0
- package/dist/collection/components/x-editor/x-editor.css +599 -0
- package/dist/collection/components/x-editor/x-editor.js +1636 -0
- package/dist/collection/components/x-empty/x-empty.css +357 -0
- package/dist/collection/components/x-empty/x-empty.js +117 -0
- package/dist/collection/components/x-finder/services/finder-service.js +250 -0
- package/dist/collection/components/x-finder/types.js +1 -0
- package/dist/collection/components/x-finder/x-finder.css +633 -0
- package/dist/collection/components/x-finder/x-finder.js +540 -0
- package/dist/collection/components/x-flex/x-flex.css +344 -0
- package/dist/collection/components/x-flex/x-flex.js +285 -0
- package/dist/collection/components/x-float-button/x-float-button.css +389 -0
- package/dist/collection/components/x-float-button/x-float-button.js +265 -0
- package/dist/collection/components/x-footer/x-footer.css +346 -0
- package/dist/collection/components/x-footer/x-footer.js +29 -0
- package/dist/collection/components/x-form/x-form.css +365 -0
- package/dist/collection/components/x-form/x-form.js +355 -0
- package/dist/collection/components/x-form-builder/services/apis/api-client.js +240 -0
- package/dist/collection/components/x-form-builder/services/constants/index.js +33 -0
- package/dist/collection/components/x-form-builder/services/forms/abstract-control.js +175 -0
- package/dist/collection/components/x-form-builder/services/forms/form-array.js +92 -0
- package/dist/collection/components/x-form-builder/services/forms/form-builder.js +40 -0
- package/dist/collection/components/x-form-builder/services/forms/form-control.js +33 -0
- package/dist/collection/components/x-form-builder/services/forms/form-group.js +150 -0
- package/dist/collection/components/x-form-builder/services/forms/index.js +7 -0
- package/dist/collection/components/x-form-builder/services/forms/types.js +1 -0
- package/dist/collection/components/x-form-builder/services/forms/validators.js +83 -0
- package/dist/collection/components/x-form-builder/services/schema/condition-builder.js +337 -0
- package/dist/collection/components/x-form-builder/services/schema/default-registry.js +440 -0
- package/dist/collection/components/x-form-builder/services/schema/form-mapping.js +176 -0
- package/dist/collection/components/x-form-builder/services/schema/form-registry.js +30 -0
- package/dist/collection/components/x-form-builder/services/schema/schema-actions.js +3 -0
- package/dist/collection/components/x-form-builder/services/schema/schema-builder.js +52 -0
- package/dist/collection/components/x-form-builder/services/schema/schema-validator.js +53 -0
- package/dist/collection/components/x-form-builder/types/api/api-common-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/api/api-interfaces.js +1 -0
- package/dist/collection/components/x-form-builder/types/api/index.js +2 -0
- package/dist/collection/components/x-form-builder/types/common/common-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/common/condition-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/common/field-types-enum.js +1 -0
- package/dist/collection/components/x-form-builder/types/common/index.js +7 -0
- package/dist/collection/components/x-form-builder/types/common/shared-interfaces.js +1 -0
- package/dist/collection/components/x-form-builder/types/common/validation-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/common/value-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/event/event-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/event/index.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/advanced-fields.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/base-field.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/datetime-file-fields.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/display-fields.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/form-field-union.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/index.js +9 -0
- package/dist/collection/components/x-form-builder/types/fields/input-fields.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/layout-fields.js +1 -0
- package/dist/collection/components/x-form-builder/types/fields/selection-fields.js +10 -0
- package/dist/collection/components/x-form-builder/types/fields/special-input-fields.js +1 -0
- package/dist/collection/components/x-form-builder/types/form/events-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/form/form-config.js +50 -0
- package/dist/collection/components/x-form-builder/types/form/index.js +2 -0
- package/dist/collection/components/x-form-builder/types/form/schema-types.js +1 -0
- package/dist/collection/components/x-form-builder/types/index.js +4 -0
- package/dist/collection/components/x-form-builder/utils/condition-engine.js +118 -0
- package/dist/collection/components/x-form-builder/utils/utils.js +138 -0
- package/dist/collection/components/x-form-builder/utils/values.js +36 -0
- package/dist/collection/components/x-form-builder/x-form-builder.css +3 -0
- package/dist/collection/components/x-form-builder/x-form-builder.js +1017 -0
- package/dist/collection/components/x-form-item/x-form-item.css +564 -0
- package/dist/collection/components/x-form-item/x-form-item.js +538 -0
- package/dist/collection/components/x-header/x-header.css +344 -0
- package/dist/collection/components/x-header/x-header.js +29 -0
- package/dist/collection/components/x-icon/fonts/xlabs-outlined.woff2 +0 -0
- package/dist/collection/components/x-icon/fonts/xlabs-rounded.woff2 +0 -0
- package/dist/collection/components/x-icon/fonts/xlabs-solided.woff2 +0 -0
- package/dist/collection/components/x-icon/icons.js +2716 -0
- package/dist/collection/components/x-icon/x-icon.css +378 -0
- package/dist/collection/components/x-icon/x-icon.js +353 -0
- package/dist/collection/components/x-image/types.js +1 -0
- package/dist/collection/components/x-image/x-image.css +556 -0
- package/dist/collection/components/x-image/x-image.js +628 -0
- package/dist/collection/components/x-infinite-scroll/x-infinite-scroll.css +345 -0
- package/dist/collection/components/x-infinite-scroll/x-infinite-scroll.js +294 -0
- package/dist/collection/components/x-input/types.js +1 -0
- package/dist/collection/components/x-input/x-input.css +640 -0
- package/dist/collection/components/x-input/x-input.js +1449 -0
- package/dist/collection/components/x-input-number/types.js +96 -0
- package/dist/collection/components/x-input-number/x-input-number.css +612 -0
- package/dist/collection/components/x-input-number/x-input-number.js +1488 -0
- package/dist/collection/components/x-layout/x-layout.css +361 -0
- package/dist/collection/components/x-layout/x-layout.js +188 -0
- package/dist/collection/components/x-list/x-list.css +382 -0
- package/dist/collection/components/x-list/x-list.js +373 -0
- package/dist/collection/components/x-list-item/x-list-item.css +351 -0
- package/dist/collection/components/x-list-item/x-list-item.js +31 -0
- package/dist/collection/components/x-mentions/types.js +1 -0
- package/dist/collection/components/x-mentions/x-mentions.css +388 -0
- package/dist/collection/components/x-mentions/x-mentions.js +528 -0
- package/dist/collection/components/x-menu/types.js +1 -0
- package/dist/collection/components/x-menu/x-menu.css +78 -0
- package/dist/collection/components/x-menu/x-menu.js +793 -0
- package/dist/collection/components/x-menu-divider/types.js +1 -0
- package/dist/collection/components/x-menu-divider/x-menu-divider.css +31 -0
- package/dist/collection/components/x-menu-divider/x-menu-divider.js +126 -0
- package/dist/collection/components/x-menu-item/types.js +1 -0
- package/dist/collection/components/x-menu-item/x-menu-item.css +183 -0
- package/dist/collection/components/x-menu-item/x-menu-item.js +449 -0
- package/dist/collection/components/x-menu-item-group/types.js +1 -0
- package/dist/collection/components/x-menu-item-group/x-menu-item-group.css +45 -0
- package/dist/collection/components/x-menu-item-group/x-menu-item-group.js +299 -0
- package/dist/collection/components/x-menu-submenu/types.js +1 -0
- package/dist/collection/components/x-menu-submenu/x-menu-submenu.css +236 -0
- package/dist/collection/components/x-menu-submenu/x-menu-submenu.js +775 -0
- package/dist/collection/components/x-message/message-service.js +263 -0
- package/dist/collection/components/x-message/types.js +1 -0
- package/dist/collection/components/x-message/x-message.css +402 -0
- package/dist/collection/components/x-message/x-message.js +487 -0
- package/dist/collection/components/x-modal/modal-service.js +402 -0
- package/dist/collection/components/x-modal/modal-service.types.js +1 -0
- package/dist/collection/components/x-modal/x-modal.css +468 -0
- package/dist/collection/components/x-modal/x-modal.js +683 -0
- package/dist/collection/components/x-modal-content/index.js +1 -0
- package/dist/collection/components/x-modal-content/types.js +1 -0
- package/dist/collection/components/x-modal-content/x-modal-content.css +749 -0
- package/dist/collection/components/x-modal-content/x-modal-content.js +701 -0
- package/dist/collection/components/x-notification/notification-service.js +335 -0
- package/dist/collection/components/x-notification/types.js +1 -0
- package/dist/collection/components/x-notification/x-notification.css +486 -0
- package/dist/collection/components/x-notification/x-notification.js +788 -0
- package/dist/collection/components/x-page-header/x-page-header.css +406 -0
- package/dist/collection/components/x-page-header/x-page-header.js +159 -0
- package/dist/collection/components/x-pagination/types.js +1 -0
- package/dist/collection/components/x-pagination/x-pagination.css +705 -0
- package/dist/collection/components/x-pagination/x-pagination.js +1241 -0
- package/dist/collection/components/x-popconfirm/popconfirm-content/popconfirm-content.css +456 -0
- package/dist/collection/components/x-popconfirm/popconfirm-content/popconfirm-content.js +244 -0
- package/dist/collection/components/x-popconfirm/x-popconfirm.css +412 -0
- package/dist/collection/components/x-popconfirm/x-popconfirm.js +355 -0
- package/dist/collection/components/x-popover/popover-content/popover-content.css +437 -0
- package/dist/collection/components/x-popover/popover-content/popover-content.js +261 -0
- package/dist/collection/components/x-popover/x-popover.css +442 -0
- package/dist/collection/components/x-popover/x-popover.js +390 -0
- package/dist/collection/components/x-portal/debug.js +42 -0
- package/dist/collection/components/x-portal/index.js +1 -0
- package/dist/collection/components/x-portal/portal-controller.js +146 -0
- package/dist/collection/components/x-portal/positioning.js +332 -0
- package/dist/collection/components/x-portal/types.js +1 -0
- package/dist/collection/components/x-portal/x-portal.js +21 -0
- package/dist/collection/components/x-progress/x-progress.css +424 -0
- package/dist/collection/components/x-progress/x-progress.js +326 -0
- package/dist/collection/components/x-qr-code/x-qr-code.css +37 -0
- package/dist/collection/components/x-qr-code/x-qr-code.js +292 -0
- package/dist/collection/components/x-radio/types.js +1 -0
- package/dist/collection/components/x-radio/x-radio.css +523 -0
- package/dist/collection/components/x-radio/x-radio.js +689 -0
- package/dist/collection/components/x-radio-group/types.js +1 -0
- package/dist/collection/components/x-radio-group/x-radio-group.css +326 -0
- package/dist/collection/components/x-radio-group/x-radio-group.js +531 -0
- package/dist/collection/components/x-range-picker/range-picker-dropdown-content/index.js +1 -0
- package/dist/collection/components/x-range-picker/range-picker-dropdown-content/range-picker-dropdown-content.css +609 -0
- package/dist/collection/components/x-range-picker/range-picker-dropdown-content/range-picker-dropdown-content.js +1497 -0
- package/dist/collection/components/x-range-picker/range-picker-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-range-picker/types.js +1 -0
- package/dist/collection/components/x-range-picker/x-range-picker.css +775 -0
- package/dist/collection/components/x-range-picker/x-range-picker.js +1883 -0
- package/dist/collection/components/x-rate/x-rate.css +396 -0
- package/dist/collection/components/x-rate/x-rate.js +445 -0
- package/dist/collection/components/x-result/types.js +1 -0
- package/dist/collection/components/x-result/x-result.css +434 -0
- package/dist/collection/components/x-result/x-result.js +376 -0
- package/dist/collection/components/x-row/x-row.css +345 -0
- package/dist/collection/components/x-row/x-row.js +196 -0
- package/dist/collection/components/x-segmented/types.js +1 -0
- package/dist/collection/components/x-segmented/x-segmented.css +407 -0
- package/dist/collection/components/x-segmented/x-segmented.js +414 -0
- package/dist/collection/components/x-select/select-dropdown-content/index.js +1 -0
- package/dist/collection/components/x-select/select-dropdown-content/select-dropdown-content.css +827 -0
- package/dist/collection/components/x-select/select-dropdown-content/select-dropdown-content.js +163 -0
- package/dist/collection/components/x-select/select-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-select/types.js +9 -0
- package/dist/collection/components/x-select/x-select.css +823 -0
- package/dist/collection/components/x-select/x-select.js +2247 -0
- package/dist/collection/components/x-select-option/x-select-option.css +379 -0
- package/dist/collection/components/x-select-option/x-select-option.js +207 -0
- package/dist/collection/components/x-sider/x-sider.css +379 -0
- package/dist/collection/components/x-sider/x-sider.js +379 -0
- package/dist/collection/components/x-skeleton/x-skeleton.css +400 -0
- package/dist/collection/components/x-skeleton/x-skeleton.js +221 -0
- package/dist/collection/components/x-slider/types.js +1 -0
- package/dist/collection/components/x-slider/x-slider.css +511 -0
- package/dist/collection/components/x-slider/x-slider.js +785 -0
- package/dist/collection/components/x-space/x-space.css +339 -0
- package/dist/collection/components/x-space/x-space.js +228 -0
- package/dist/collection/components/x-spin/x-spin.css +465 -0
- package/dist/collection/components/x-spin/x-spin.js +142 -0
- package/dist/collection/components/x-splitter/types.js +1 -0
- package/dist/collection/components/x-splitter/x-splitter.css +181 -0
- package/dist/collection/components/x-splitter/x-splitter.js +884 -0
- package/dist/collection/components/x-splitter-panel/types.js +1 -0
- package/dist/collection/components/x-splitter-panel/x-splitter-panel.css +25 -0
- package/dist/collection/components/x-splitter-panel/x-splitter-panel.js +292 -0
- package/dist/collection/components/x-statistic/x-statistic.css +366 -0
- package/dist/collection/components/x-statistic/x-statistic.js +291 -0
- package/dist/collection/components/x-step/types.js +1 -0
- package/dist/collection/components/x-step/x-step.css +801 -0
- package/dist/collection/components/x-step/x-step.js +539 -0
- package/dist/collection/components/x-steps/types.js +1 -0
- package/dist/collection/components/x-steps/x-steps.css +830 -0
- package/dist/collection/components/x-steps/x-steps.js +1032 -0
- package/dist/collection/components/x-switch/types.js +1 -0
- package/dist/collection/components/x-switch/x-switch.css +463 -0
- package/dist/collection/components/x-switch/x-switch.js +356 -0
- package/dist/collection/components/x-tab-pane/x-tab-pane.css +337 -0
- package/dist/collection/components/x-tab-pane/x-tab-pane.js +243 -0
- package/dist/collection/components/x-table/column-util.js +87 -0
- package/dist/collection/components/x-table/types.js +1 -0
- package/dist/collection/components/x-table/x-table.css +898 -0
- package/dist/collection/components/x-table/x-table.js +2464 -0
- package/dist/collection/components/x-table-cell/x-table-cell.css +337 -0
- package/dist/collection/components/x-table-cell/x-table-cell.js +167 -0
- package/dist/collection/components/x-table-row/x-table-row.css +336 -0
- package/dist/collection/components/x-table-row/x-table-row.js +172 -0
- package/dist/collection/components/x-tabs/types.js +1 -0
- package/dist/collection/components/x-tabs/x-tabs.css +664 -0
- package/dist/collection/components/x-tabs/x-tabs.js +1264 -0
- package/dist/collection/components/x-tag/types.js +1 -0
- package/dist/collection/components/x-tag/x-tag.css +1047 -0
- package/dist/collection/components/x-tag/x-tag.js +535 -0
- package/dist/collection/components/x-textarea/x-textarea.css +446 -0
- package/dist/collection/components/x-textarea/x-textarea.js +553 -0
- package/dist/collection/components/x-time-picker/time-picker-dropdown-content/index.js +1 -0
- package/dist/collection/components/x-time-picker/time-picker-dropdown-content/time-picker-dropdown-content.css +409 -0
- package/dist/collection/components/x-time-picker/time-picker-dropdown-content/time-picker-dropdown-content.js +855 -0
- package/dist/collection/components/x-time-picker/time-picker-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-time-picker/types.js +1 -0
- package/dist/collection/components/x-time-picker/x-time-picker.css +653 -0
- package/dist/collection/components/x-time-picker/x-time-picker.js +1454 -0
- package/dist/collection/components/x-timeline/x-timeline.css +404 -0
- package/dist/collection/components/x-timeline/x-timeline.js +129 -0
- package/dist/collection/components/x-timeline-item/x-timeline-item.css +400 -0
- package/dist/collection/components/x-timeline-item/x-timeline-item.js +125 -0
- package/dist/collection/components/x-tooltip/types.js +1 -0
- package/dist/collection/components/x-tooltip/x-tooltip.css +528 -0
- package/dist/collection/components/x-tooltip/x-tooltip.js +1006 -0
- package/dist/collection/components/x-tooltip-content/index.js +1 -0
- package/dist/collection/components/x-tooltip-content/types.js +1 -0
- package/dist/collection/components/x-tooltip-content/x-tooltip-content.css +217 -0
- package/dist/collection/components/x-tooltip-content/x-tooltip-content.js +238 -0
- package/dist/collection/components/x-tour/index.js +1 -0
- package/dist/collection/components/x-tour/types.js +1 -0
- package/dist/collection/components/x-tour/x-tour-panel.css +467 -0
- package/dist/collection/components/x-tour/x-tour-panel.js +265 -0
- package/dist/collection/components/x-tour/x-tour.css +353 -0
- package/dist/collection/components/x-tour/x-tour.js +555 -0
- package/dist/collection/components/x-transfer/types.js +1 -0
- package/dist/collection/components/x-transfer/x-transfer.css +626 -0
- package/dist/collection/components/x-transfer/x-transfer.js +956 -0
- package/dist/collection/components/x-tree/types.js +1 -0
- package/dist/collection/components/x-tree/x-tree.css +703 -0
- package/dist/collection/components/x-tree/x-tree.js +1793 -0
- package/dist/collection/components/x-tree-select/tree-select-dropdown-content/index.js +2 -0
- package/dist/collection/components/x-tree-select/tree-select-dropdown-content/tree-select-dropdown-content.css +635 -0
- package/dist/collection/components/x-tree-select/tree-select-dropdown-content/tree-select-dropdown-content.js +890 -0
- package/dist/collection/components/x-tree-select/tree-select-dropdown-content/types.js +1 -0
- package/dist/collection/components/x-tree-select/types.js +2 -0
- package/dist/collection/components/x-tree-select/x-tree-select.css +790 -0
- package/dist/collection/components/x-tree-select/x-tree-select.js +2750 -0
- package/dist/collection/components/x-typography/x-typography.css +409 -0
- package/dist/collection/components/x-typography/x-typography.js +431 -0
- package/dist/collection/components/x-upload/types.js +1 -0
- package/dist/collection/components/x-upload/x-upload.css +774 -0
- package/dist/collection/components/x-upload/x-upload.js +1452 -0
- package/dist/collection/components/x-virtual-scroll/x-virtual-scroll.css +79 -0
- package/dist/collection/components/x-virtual-scroll/x-virtual-scroll.js +478 -0
- package/dist/collection/components/x-workflow/x-workflow.css +486 -0
- package/dist/collection/components/x-workflow/x-workflow.js +1403 -0
- package/dist/collection/components/x-workflow-builder/x-workflow-builder.css +538 -0
- package/dist/collection/components/x-workflow-builder/x-workflow-builder.js +468 -0
- package/dist/collection/index.js +5 -0
- package/dist/collection/locales/index.js +2 -0
- package/dist/collection/locales/languages/ar_EG.js +120 -0
- package/dist/collection/locales/languages/az_AZ.js +120 -0
- package/dist/collection/locales/languages/bg_BG.js +120 -0
- package/dist/collection/locales/languages/bn_BD.js +120 -0
- package/dist/collection/locales/languages/by_BY.js +120 -0
- package/dist/collection/locales/languages/ca_ES.js +120 -0
- package/dist/collection/locales/languages/cs_CZ.js +120 -0
- package/dist/collection/locales/languages/da_DK.js +120 -0
- package/dist/collection/locales/languages/de_DE.js +120 -0
- package/dist/collection/locales/languages/el_GR.js +120 -0
- package/dist/collection/locales/languages/en_AU.js +120 -0
- package/dist/collection/locales/languages/en_GB.js +120 -0
- package/dist/collection/locales/languages/en_US.js +120 -0
- package/dist/collection/locales/languages/es_ES.js +120 -0
- package/dist/collection/locales/languages/et_EE.js +120 -0
- package/dist/collection/locales/languages/fa_IR.js +120 -0
- package/dist/collection/locales/languages/fi_FI.js +120 -0
- package/dist/collection/locales/languages/fr_BE.js +120 -0
- package/dist/collection/locales/languages/fr_CA.js +120 -0
- package/dist/collection/locales/languages/fr_FR.js +120 -0
- package/dist/collection/locales/languages/ga_IE.js +120 -0
- package/dist/collection/locales/languages/gl_ES.js +120 -0
- package/dist/collection/locales/languages/he_IL.js +120 -0
- package/dist/collection/locales/languages/hi_IN.js +120 -0
- package/dist/collection/locales/languages/hr_HR.js +120 -0
- package/dist/collection/locales/languages/hu_HU.js +120 -0
- package/dist/collection/locales/languages/hy_AM.js +120 -0
- package/dist/collection/locales/languages/id_ID.js +120 -0
- package/dist/collection/locales/languages/index.js +137 -0
- package/dist/collection/locales/languages/is_IS.js +120 -0
- package/dist/collection/locales/languages/it_IT.js +120 -0
- package/dist/collection/locales/languages/ja_JP.js +120 -0
- package/dist/collection/locales/languages/ka_GE.js +120 -0
- package/dist/collection/locales/languages/kk_KZ.js +120 -0
- package/dist/collection/locales/languages/km_KH.js +120 -0
- package/dist/collection/locales/languages/kmr_IQ.js +120 -0
- package/dist/collection/locales/languages/kn_IN.js +120 -0
- package/dist/collection/locales/languages/ko_KR.js +120 -0
- package/dist/collection/locales/languages/ku_IQ.js +120 -0
- package/dist/collection/locales/languages/lt_LT.js +120 -0
- package/dist/collection/locales/languages/lv_LV.js +120 -0
- package/dist/collection/locales/languages/mk_MK.js +120 -0
- package/dist/collection/locales/languages/ml_IN.js +120 -0
- package/dist/collection/locales/languages/mn_MN.js +120 -0
- package/dist/collection/locales/languages/ms_MY.js +120 -0
- package/dist/collection/locales/languages/nb_NO.js +120 -0
- package/dist/collection/locales/languages/ne_NP.js +120 -0
- package/dist/collection/locales/languages/nl_BE.js +120 -0
- package/dist/collection/locales/languages/nl_NL.js +120 -0
- package/dist/collection/locales/languages/pl_PL.js +120 -0
- package/dist/collection/locales/languages/pt_BR.js +120 -0
- package/dist/collection/locales/languages/pt_PT.js +120 -0
- package/dist/collection/locales/languages/ro_RO.js +120 -0
- package/dist/collection/locales/languages/ru_RU.js +120 -0
- package/dist/collection/locales/languages/sk_SK.js +120 -0
- package/dist/collection/locales/languages/sl_SI.js +120 -0
- package/dist/collection/locales/languages/sr_RS.js +120 -0
- package/dist/collection/locales/languages/sv_SE.js +120 -0
- package/dist/collection/locales/languages/ta_IN.js +120 -0
- package/dist/collection/locales/languages/th_TH.js +120 -0
- package/dist/collection/locales/languages/tr_TR.js +120 -0
- package/dist/collection/locales/languages/uk_UA.js +120 -0
- package/dist/collection/locales/languages/ur_PK.js +120 -0
- package/dist/collection/locales/languages/vi_VN.js +120 -0
- package/dist/collection/locales/languages/zh_CN.js +120 -0
- package/dist/collection/locales/languages/zh_HK.js +120 -0
- package/dist/collection/locales/languages/zh_TW.js +120 -0
- package/dist/collection/locales/locale.service.js +179 -0
- package/dist/collection/types.js +11 -0
- package/dist/collection/utils/app-service.js +19 -0
- package/dist/collection/utils/cascader.service.js +142 -0
- package/dist/collection/utils/config.js +59 -0
- package/dist/collection/utils/form/core/abstract-control.js +273 -0
- package/dist/collection/utils/form/core/form-array.js +131 -0
- package/dist/collection/utils/form/core/form-builder.js +56 -0
- package/dist/collection/utils/form/core/form-control.js +69 -0
- package/dist/collection/utils/form/core/form-group.js +163 -0
- package/dist/collection/utils/form/frameworks.js +37 -0
- package/dist/collection/utils/form/types.js +1 -0
- package/dist/collection/utils/form/validators/validators.js +198 -0
- package/dist/collection/utils/index.js +3 -0
- package/dist/collection/utils/qr-code/cache/qr.cache.js +20 -0
- package/dist/collection/utils/qr-code/engine/qr.engine.js +130 -0
- package/dist/collection/utils/qr-code/engine/qr.gf.js +22 -0
- package/dist/collection/utils/qr-code/engine/qr.mask.js +54 -0
- package/dist/collection/utils/qr-code/engine/qr.rs.js +29 -0
- package/dist/collection/utils/qr-code/engine/qr.util.js +0 -0
- package/dist/collection/utils/qr-code/engine/qr.version.js +11 -0
- package/dist/collection/utils/qr-code/renderer/canvas.renderer.js +36 -0
- package/dist/collection/utils/qr-code/renderer/svg.renderer.js +33 -0
- package/dist/collection/utils/qr-code/worker/worker.manager.js +24 -0
- package/dist/collection/utils/table.service.js +150 -0
- package/dist/collection/utils/tree.service.js +335 -0
- package/dist/collection/utils/workflow/flow.service.js +382 -0
- package/dist/collection/utils/workflow/types.js +1 -0
- package/dist/esm/abstract-control-XBF88YT_.js +275 -0
- package/dist/esm/config-BPeosvTA.js +60 -0
- package/dist/esm/index-ig_mFsVk.js +2159 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/locale.service-D66tF8_2.js +8199 -0
- package/dist/esm/modal-service-C_e0SaFZ.js +397 -0
- package/dist/esm/notification-service-DJTSPOq7.js +599 -0
- package/dist/esm/portal-controller-COpzIi1n.js +499 -0
- package/dist/esm/schema-builder-DBPGgJBx.js +1502 -0
- package/dist/esm/tree.service-Dgxy93Bg.js +337 -0
- package/dist/esm/types-C_QdJRdB.js +253 -0
- package/dist/esm/x-address_14.entry.js +12562 -0
- package/dist/esm/x-affix.entry.js +180 -0
- package/dist/esm/x-alert_11.entry.js +3227 -0
- package/dist/esm/x-anchor-link.entry.js +65 -0
- package/dist/esm/x-anchor.entry.js +156 -0
- package/dist/esm/x-app.entry.js +135 -0
- package/dist/esm/x-auto-complete-dropdown-content.entry.js +67 -0
- package/dist/esm/x-avatar.entry.js +267 -0
- package/dist/esm/x-back-top.entry.js +87 -0
- package/dist/esm/x-breadcrumb_5.entry.js +1548 -0
- package/dist/esm/x-button.entry.js +172 -0
- package/dist/esm/x-card_12.entry.js +1373 -0
- package/dist/esm/x-carousel.entry.js +145 -0
- package/dist/esm/x-cascader-dropdown-content.entry.js +362 -0
- package/dist/esm/x-checkbox_5.entry.js +1370 -0
- package/dist/esm/x-collapse-panel.entry.js +241 -0
- package/dist/esm/x-collapse.entry.js +289 -0
- package/dist/esm/x-color-picker-panel_2.entry.js +870 -0
- package/dist/esm/x-color-picker_9.entry.js +3075 -0
- package/dist/esm/x-comment.entry.js +187 -0
- package/dist/esm/x-date-picker-dropdown-content.entry.js +755 -0
- package/dist/esm/x-descriptions-item.entry.js +106 -0
- package/dist/esm/x-drawer-content.entry.js +195 -0
- package/dist/esm/x-drawer.entry.js +292 -0
- package/dist/esm/x-dropdown_2.entry.js +732 -0
- package/dist/esm/x-empty.entry.js +62 -0
- package/dist/esm/x-finder.entry.js +645 -0
- package/dist/esm/x-form-builder.entry.js +805 -0
- package/dist/esm/x-icon.entry.js +142 -0
- package/dist/esm/x-infinite-scroll.entry.js +127 -0
- package/dist/esm/x-list-item.entry.js +25 -0
- package/dist/esm/x-list.entry.js +136 -0
- package/dist/esm/x-mentions.entry.js +273 -0
- package/dist/esm/x-menu-divider.entry.js +47 -0
- package/dist/esm/x-menu-item-group.entry.js +147 -0
- package/dist/esm/x-menu-submenu.entry.js +371 -0
- package/dist/esm/x-message.entry.js +217 -0
- package/dist/esm/x-modal-content.entry.js +215 -0
- package/dist/esm/x-notification.entry.js +323 -0
- package/dist/esm/x-page-header.entry.js +65 -0
- package/dist/esm/x-popconfirm-content.entry.js +70 -0
- package/dist/esm/x-popconfirm.entry.js +179 -0
- package/dist/esm/x-progress.entry.js +134 -0
- package/dist/esm/x-qr-code.entry.js +444 -0
- package/dist/esm/x-range-picker-dropdown-content.entry.js +819 -0
- package/dist/esm/x-select_2.entry.js +1313 -0
- package/dist/esm/x-skeleton.entry.js +73 -0
- package/dist/esm/x-spin.entry.js +60 -0
- package/dist/esm/x-splitter-panel.entry.js +89 -0
- package/dist/esm/x-splitter.entry.js +610 -0
- package/dist/esm/x-statistic.entry.js +102 -0
- package/dist/esm/x-step.entry.js +177 -0
- package/dist/esm/x-steps.entry.js +437 -0
- package/dist/esm/x-tab-pane.entry.js +71 -0
- package/dist/esm/x-table-cell.entry.js +43 -0
- package/dist/esm/x-table-row.entry.js +83 -0
- package/dist/esm/x-tabs.entry.js +607 -0
- package/dist/esm/x-time-picker-dropdown-content.entry.js +387 -0
- package/dist/esm/x-timeline-item.entry.js +48 -0
- package/dist/esm/x-timeline.entry.js +50 -0
- package/dist/esm/x-tour-panel.entry.js +87 -0
- package/dist/esm/x-tour.entry.js +342 -0
- package/dist/esm/x-tree-select-dropdown-content.entry.js +437 -0
- package/dist/esm/x-virtual-scroll.entry.js +201 -0
- package/dist/esm/x-workflow-builder.entry.js +364 -0
- package/dist/esm/xlabs-store.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/x-address/vietnam-data.d.ts +14 -0
- package/dist/types/components/x-address/x-address.d.ts +64 -0
- package/dist/types/components/x-affix/x-affix.d.ts +111 -0
- package/dist/types/components/x-alert/x-alert.d.ts +74 -0
- package/dist/types/components/x-anchor/x-anchor.d.ts +120 -0
- package/dist/types/components/x-anchor-link/x-anchor-link.d.ts +47 -0
- package/dist/types/components/x-app/x-app.d.ts +93 -0
- package/dist/types/components/x-auto-complete/auto-complete-dropdown-content/auto-complete-dropdown-content.d.ts +58 -0
- package/dist/types/components/x-auto-complete/auto-complete-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-auto-complete/auto-complete-dropdown-content/types.d.ts +14 -0
- package/dist/types/components/x-auto-complete/types.d.ts +150 -0
- package/dist/types/components/x-auto-complete/x-auto-complete.d.ts +480 -0
- package/dist/types/components/x-avatar/types.d.ts +38 -0
- package/dist/types/components/x-avatar/x-avatar.d.ts +171 -0
- package/dist/types/components/x-back-top/x-back-top.d.ts +59 -0
- package/dist/types/components/x-badge/types.d.ts +23 -0
- package/dist/types/components/x-badge/x-badge.d.ts +184 -0
- package/dist/types/components/x-breadcrumb/x-breadcrumb.d.ts +43 -0
- package/dist/types/components/x-breadcrumb-item/x-breadcrumb-item.d.ts +43 -0
- package/dist/types/components/x-button/x-button.d.ts +121 -0
- package/dist/types/components/x-captcha/x-captcha.d.ts +78 -0
- package/dist/types/components/x-card/x-card.d.ts +139 -0
- package/dist/types/components/x-carousel/x-carousel.d.ts +104 -0
- package/dist/types/components/x-cascader/cascader-dropdown-content/cascader-dropdown-content.d.ts +255 -0
- package/dist/types/components/x-cascader/cascader-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-cascader/cascader-dropdown-content/types.d.ts +20 -0
- package/dist/types/components/x-cascader/types.d.ts +143 -0
- package/dist/types/components/x-cascader/x-cascader.d.ts +520 -0
- package/dist/types/components/x-checkbox/types.d.ts +83 -0
- package/dist/types/components/x-checkbox/x-checkbox.d.ts +156 -0
- package/dist/types/components/x-col/x-col.d.ts +89 -0
- package/dist/types/components/x-collapse/types.d.ts +55 -0
- package/dist/types/components/x-collapse/x-collapse.d.ts +157 -0
- package/dist/types/components/x-collapse-panel/x-collapse-panel.d.ts +143 -0
- package/dist/types/components/x-color-picker/types.d.ts +135 -0
- package/dist/types/components/x-color-picker/x-color-picker-panel.d.ts +80 -0
- package/dist/types/components/x-color-picker/x-color-picker.d.ts +328 -0
- package/dist/types/components/x-comment/types.d.ts +20 -0
- package/dist/types/components/x-comment/x-comment.d.ts +111 -0
- package/dist/types/components/x-content/types.d.ts +6 -0
- package/dist/types/components/x-content/x-content.d.ts +64 -0
- package/dist/types/components/x-date-picker/date-picker-dropdown-content/date-picker-dropdown-content.d.ts +376 -0
- package/dist/types/components/x-date-picker/date-picker-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-date-picker/date-picker-dropdown-content/types.d.ts +61 -0
- package/dist/types/components/x-date-picker/types.d.ts +28 -0
- package/dist/types/components/x-date-picker/x-date-picker.d.ts +512 -0
- package/dist/types/components/x-descriptions/types.d.ts +41 -0
- package/dist/types/components/x-descriptions/x-descriptions.d.ts +141 -0
- package/dist/types/components/x-descriptions-item/x-descriptions-item.d.ts +70 -0
- package/dist/types/components/x-divider/x-divider.d.ts +82 -0
- package/dist/types/components/x-drawer/x-drawer.d.ts +156 -0
- package/dist/types/components/x-drawer-content/x-drawer-content.d.ts +142 -0
- package/dist/types/components/x-dropdown/dropdown-content/dropdown-content.d.ts +83 -0
- package/dist/types/components/x-dropdown/dropdown-content/types.d.ts +16 -0
- package/dist/types/components/x-dropdown/types.d.ts +119 -0
- package/dist/types/components/x-dropdown/x-dropdown.d.ts +292 -0
- package/dist/types/components/x-editor/editor-history.d.ts +62 -0
- package/dist/types/components/x-editor/editor-normalizer.d.ts +70 -0
- package/dist/types/components/x-editor/editor-parser.d.ts +34 -0
- package/dist/types/components/x-editor/editor-selection.d.ts +92 -0
- package/dist/types/components/x-editor/types.d.ts +62 -0
- package/dist/types/components/x-editor/x-editor.d.ts +279 -0
- package/dist/types/components/x-empty/x-empty.d.ts +45 -0
- package/dist/types/components/x-finder/services/finder-service.d.ts +38 -0
- package/dist/types/components/x-finder/types.d.ts +63 -0
- package/dist/types/components/x-finder/x-finder.d.ts +66 -0
- package/dist/types/components/x-flex/x-flex.d.ts +62 -0
- package/dist/types/components/x-float-button/x-float-button.d.ts +66 -0
- package/dist/types/components/x-footer/x-footer.d.ts +11 -0
- package/dist/types/components/x-form/x-form.d.ts +64 -0
- package/dist/types/components/x-form-builder/services/apis/api-client.d.ts +63 -0
- package/dist/types/components/x-form-builder/services/constants/index.d.ts +2 -0
- package/dist/types/components/x-form-builder/services/forms/abstract-control.d.ts +59 -0
- package/dist/types/components/x-form-builder/services/forms/form-array.d.ts +25 -0
- package/dist/types/components/x-form-builder/services/forms/form-builder.d.ts +17 -0
- package/dist/types/components/x-form-builder/services/forms/form-control.d.ts +14 -0
- package/dist/types/components/x-form-builder/services/forms/form-group.d.ts +33 -0
- package/dist/types/components/x-form-builder/services/forms/index.d.ts +11 -0
- package/dist/types/components/x-form-builder/services/forms/types.d.ts +11 -0
- package/dist/types/components/x-form-builder/services/forms/validators.d.ts +16 -0
- package/dist/types/components/x-form-builder/services/schema/condition-builder.d.ts +39 -0
- package/dist/types/components/x-form-builder/services/schema/default-registry.d.ts +1 -0
- package/dist/types/components/x-form-builder/services/schema/form-mapping.d.ts +26 -0
- package/dist/types/components/x-form-builder/services/schema/form-registry.d.ts +27 -0
- package/dist/types/components/x-form-builder/services/schema/schema-actions.d.ts +3 -0
- package/dist/types/components/x-form-builder/services/schema/schema-builder.d.ts +19 -0
- package/dist/types/components/x-form-builder/services/schema/schema-validator.d.ts +9 -0
- package/dist/types/components/x-form-builder/types/api/api-common-types.d.ts +5 -0
- package/dist/types/components/x-form-builder/types/api/api-interfaces.d.ts +52 -0
- package/dist/types/components/x-form-builder/types/api/index.d.ts +2 -0
- package/dist/types/components/x-form-builder/types/common/common-types.d.ts +49 -0
- package/dist/types/components/x-form-builder/types/common/condition-types.d.ts +53 -0
- package/dist/types/components/x-form-builder/types/common/field-types-enum.d.ts +2 -0
- package/dist/types/components/x-form-builder/types/common/index.d.ts +7 -0
- package/dist/types/components/x-form-builder/types/common/shared-interfaces.d.ts +37 -0
- package/dist/types/components/x-form-builder/types/common/validation-types.d.ts +36 -0
- package/dist/types/components/x-form-builder/types/common/value-types.d.ts +15 -0
- package/dist/types/components/x-form-builder/types/event/event-types.d.ts +16 -0
- package/dist/types/components/x-form-builder/types/event/index.d.ts +1 -0
- package/dist/types/components/x-form-builder/types/fields/advanced-fields.d.ts +125 -0
- package/dist/types/components/x-form-builder/types/fields/base-field.d.ts +49 -0
- package/dist/types/components/x-form-builder/types/fields/datetime-file-fields.d.ts +37 -0
- package/dist/types/components/x-form-builder/types/fields/display-fields.d.ts +92 -0
- package/dist/types/components/x-form-builder/types/fields/form-field-union.d.ts +9 -0
- package/dist/types/components/x-form-builder/types/fields/index.d.ts +9 -0
- package/dist/types/components/x-form-builder/types/fields/input-fields.d.ts +53 -0
- package/dist/types/components/x-form-builder/types/fields/layout-fields.d.ts +55 -0
- package/dist/types/components/x-form-builder/types/fields/selection-fields.d.ts +130 -0
- package/dist/types/components/x-form-builder/types/fields/special-input-fields.d.ts +99 -0
- package/dist/types/components/x-form-builder/types/form/events-types.d.ts +29 -0
- package/dist/types/components/x-form-builder/types/form/form-config.d.ts +0 -0
- package/dist/types/components/x-form-builder/types/form/index.d.ts +2 -0
- package/dist/types/components/x-form-builder/types/form/schema-types.d.ts +134 -0
- package/dist/types/components/x-form-builder/types/index.d.ts +4 -0
- package/dist/types/components/x-form-builder/utils/condition-engine.d.ts +23 -0
- package/dist/types/components/x-form-builder/utils/utils.d.ts +19 -0
- package/dist/types/components/x-form-builder/utils/values.d.ts +8 -0
- package/dist/types/components/x-form-builder/x-form-builder.d.ts +65 -0
- package/dist/types/components/x-form-item/x-form-item.d.ts +94 -0
- package/dist/types/components/x-header/x-header.d.ts +11 -0
- package/dist/types/components/x-icon/icons.d.ts +2717 -0
- package/dist/types/components/x-icon/x-icon.d.ts +89 -0
- package/dist/types/components/x-image/types.d.ts +94 -0
- package/dist/types/components/x-image/x-image.d.ts +150 -0
- package/dist/types/components/x-infinite-scroll/x-infinite-scroll.d.ts +75 -0
- package/dist/types/components/x-input/types.d.ts +14 -0
- package/dist/types/components/x-input/x-input.d.ts +385 -0
- package/dist/types/components/x-input-number/types.d.ts +98 -0
- package/dist/types/components/x-input-number/x-input-number.d.ts +395 -0
- package/dist/types/components/x-layout/x-layout.d.ts +61 -0
- package/dist/types/components/x-list/x-list.d.ts +100 -0
- package/dist/types/components/x-list-item/x-list-item.d.ts +13 -0
- package/dist/types/components/x-mentions/types.d.ts +7 -0
- package/dist/types/components/x-mentions/x-mentions.d.ts +159 -0
- package/dist/types/components/x-menu/types.d.ts +83 -0
- package/dist/types/components/x-menu/x-menu.d.ts +153 -0
- package/dist/types/components/x-menu-divider/types.d.ts +6 -0
- package/dist/types/components/x-menu-divider/x-menu-divider.d.ts +19 -0
- package/dist/types/components/x-menu-item/types.d.ts +8 -0
- package/dist/types/components/x-menu-item/x-menu-item.d.ts +80 -0
- package/dist/types/components/x-menu-item-group/types.d.ts +6 -0
- package/dist/types/components/x-menu-item-group/x-menu-item-group.d.ts +60 -0
- package/dist/types/components/x-menu-submenu/types.d.ts +15 -0
- package/dist/types/components/x-menu-submenu/x-menu-submenu.d.ts +135 -0
- package/dist/types/components/x-message/message-service.d.ts +58 -0
- package/dist/types/components/x-message/types.d.ts +90 -0
- package/dist/types/components/x-message/x-message.d.ts +133 -0
- package/dist/types/components/x-modal/modal-service.d.ts +6 -0
- package/dist/types/components/x-modal/modal-service.types.d.ts +278 -0
- package/dist/types/components/x-modal/x-modal.d.ts +160 -0
- package/dist/types/components/x-modal-content/index.d.ts +1 -0
- package/dist/types/components/x-modal-content/types.d.ts +83 -0
- package/dist/types/components/x-modal-content/x-modal-content.d.ts +174 -0
- package/dist/types/components/x-notification/notification-service.d.ts +83 -0
- package/dist/types/components/x-notification/types.d.ts +112 -0
- package/dist/types/components/x-notification/x-notification.d.ts +212 -0
- package/dist/types/components/x-page-header/x-page-header.d.ts +51 -0
- package/dist/types/components/x-pagination/types.d.ts +104 -0
- package/dist/types/components/x-pagination/x-pagination.d.ts +274 -0
- package/dist/types/components/x-popconfirm/popconfirm-content/popconfirm-content.d.ts +62 -0
- package/dist/types/components/x-popconfirm/x-popconfirm.d.ts +97 -0
- package/dist/types/components/x-popover/popover-content/popover-content.d.ts +71 -0
- package/dist/types/components/x-popover/x-popover.d.ts +99 -0
- package/dist/types/components/x-portal/debug.d.ts +5 -0
- package/dist/types/components/x-portal/index.d.ts +2 -0
- package/dist/types/components/x-portal/portal-controller.d.ts +20 -0
- package/dist/types/components/x-portal/positioning.d.ts +102 -0
- package/dist/types/components/x-portal/types.d.ts +43 -0
- package/dist/types/components/x-portal/x-portal.d.ts +19 -0
- package/dist/types/components/x-progress/x-progress.d.ts +85 -0
- package/dist/types/components/x-qr-code/x-qr-code.d.ts +26 -0
- package/dist/types/components/x-radio/types.d.ts +94 -0
- package/dist/types/components/x-radio/x-radio.d.ts +186 -0
- package/dist/types/components/x-radio-group/types.d.ts +20 -0
- package/dist/types/components/x-radio-group/x-radio-group.d.ts +90 -0
- package/dist/types/components/x-range-picker/range-picker-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-range-picker/range-picker-dropdown-content/range-picker-dropdown-content.d.ts +437 -0
- package/dist/types/components/x-range-picker/range-picker-dropdown-content/types.d.ts +48 -0
- package/dist/types/components/x-range-picker/types.d.ts +35 -0
- package/dist/types/components/x-range-picker/x-range-picker.d.ts +457 -0
- package/dist/types/components/x-rate/x-rate.d.ts +129 -0
- package/dist/types/components/x-result/types.d.ts +45 -0
- package/dist/types/components/x-result/x-result.d.ts +120 -0
- package/dist/types/components/x-row/x-row.d.ts +44 -0
- package/dist/types/components/x-segmented/types.d.ts +10 -0
- package/dist/types/components/x-segmented/x-segmented.d.ts +128 -0
- package/dist/types/components/x-select/select-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-select/select-dropdown-content/select-dropdown-content.d.ts +52 -0
- package/dist/types/components/x-select/select-dropdown-content/types.d.ts +14 -0
- package/dist/types/components/x-select/types.d.ts +41 -0
- package/dist/types/components/x-select/x-select.d.ts +635 -0
- package/dist/types/components/x-select-option/x-select-option.d.ts +51 -0
- package/dist/types/components/x-sider/x-sider.d.ts +99 -0
- package/dist/types/components/x-skeleton/x-skeleton.d.ts +54 -0
- package/dist/types/components/x-slider/types.d.ts +1 -0
- package/dist/types/components/x-slider/x-slider.d.ts +240 -0
- package/dist/types/components/x-space/x-space.d.ts +54 -0
- package/dist/types/components/x-spin/x-spin.d.ts +41 -0
- package/dist/types/components/x-splitter/types.d.ts +41 -0
- package/dist/types/components/x-splitter/x-splitter.d.ts +187 -0
- package/dist/types/components/x-splitter-panel/types.d.ts +23 -0
- package/dist/types/components/x-splitter-panel/x-splitter-panel.d.ts +67 -0
- package/dist/types/components/x-statistic/x-statistic.d.ts +80 -0
- package/dist/types/components/x-step/types.d.ts +14 -0
- package/dist/types/components/x-step/x-step.d.ts +104 -0
- package/dist/types/components/x-steps/types.d.ts +124 -0
- package/dist/types/components/x-steps/x-steps.d.ts +270 -0
- package/dist/types/components/x-switch/types.d.ts +5 -0
- package/dist/types/components/x-switch/x-switch.d.ts +92 -0
- package/dist/types/components/x-tab-pane/x-tab-pane.d.ts +55 -0
- package/dist/types/components/x-table/column-util.d.ts +26 -0
- package/dist/types/components/x-table/types.d.ts +386 -0
- package/dist/types/components/x-table/x-table.d.ts +552 -0
- package/dist/types/components/x-table-cell/x-table-cell.d.ts +27 -0
- package/dist/types/components/x-table-row/x-table-row.d.ts +24 -0
- package/dist/types/components/x-tabs/types.d.ts +190 -0
- package/dist/types/components/x-tabs/x-tabs.d.ts +359 -0
- package/dist/types/components/x-tag/types.d.ts +27 -0
- package/dist/types/components/x-tag/x-tag.d.ts +148 -0
- package/dist/types/components/x-textarea/x-textarea.d.ts +165 -0
- package/dist/types/components/x-time-picker/time-picker-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-time-picker/time-picker-dropdown-content/time-picker-dropdown-content.d.ts +239 -0
- package/dist/types/components/x-time-picker/time-picker-dropdown-content/types.d.ts +28 -0
- package/dist/types/components/x-time-picker/types.d.ts +18 -0
- package/dist/types/components/x-time-picker/x-time-picker.d.ts +378 -0
- package/dist/types/components/x-timeline/x-timeline.d.ts +33 -0
- package/dist/types/components/x-timeline-item/x-timeline-item.d.ts +33 -0
- package/dist/types/components/x-tooltip/types.d.ts +53 -0
- package/dist/types/components/x-tooltip/x-tooltip.d.ts +274 -0
- package/dist/types/components/x-tooltip-content/index.d.ts +1 -0
- package/dist/types/components/x-tooltip-content/types.d.ts +25 -0
- package/dist/types/components/x-tooltip-content/x-tooltip-content.d.ts +57 -0
- package/dist/types/components/x-tour/index.d.ts +1 -0
- package/dist/types/components/x-tour/types.d.ts +71 -0
- package/dist/types/components/x-tour/x-tour-panel.d.ts +73 -0
- package/dist/types/components/x-tour/x-tour.d.ts +158 -0
- package/dist/types/components/x-transfer/types.d.ts +89 -0
- package/dist/types/components/x-transfer/x-transfer.d.ts +291 -0
- package/dist/types/components/x-tree/types.d.ts +163 -0
- package/dist/types/components/x-tree/x-tree.d.ts +406 -0
- package/dist/types/components/x-tree-select/tree-select-dropdown-content/index.d.ts +2 -0
- package/dist/types/components/x-tree-select/tree-select-dropdown-content/tree-select-dropdown-content.d.ts +268 -0
- package/dist/types/components/x-tree-select/tree-select-dropdown-content/types.d.ts +24 -0
- package/dist/types/components/x-tree-select/types.d.ts +100 -0
- package/dist/types/components/x-tree-select/x-tree-select.d.ts +750 -0
- package/dist/types/components/x-typography/x-typography.d.ts +89 -0
- package/dist/types/components/x-upload/types.d.ts +177 -0
- package/dist/types/components/x-upload/x-upload.d.ts +361 -0
- package/dist/types/components/x-virtual-scroll/x-virtual-scroll.d.ts +127 -0
- package/dist/types/components/x-workflow/x-workflow.d.ts +126 -0
- package/dist/types/components/x-workflow-builder/x-workflow-builder.d.ts +69 -0
- package/dist/types/components.d.ts +19048 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/locales/index.d.ts +2 -0
- package/dist/types/locales/languages/ar_EG.d.ts +119 -0
- package/dist/types/locales/languages/az_AZ.d.ts +119 -0
- package/dist/types/locales/languages/bg_BG.d.ts +119 -0
- package/dist/types/locales/languages/bn_BD.d.ts +119 -0
- package/dist/types/locales/languages/by_BY.d.ts +119 -0
- package/dist/types/locales/languages/ca_ES.d.ts +119 -0
- package/dist/types/locales/languages/cs_CZ.d.ts +119 -0
- package/dist/types/locales/languages/da_DK.d.ts +119 -0
- package/dist/types/locales/languages/de_DE.d.ts +119 -0
- package/dist/types/locales/languages/el_GR.d.ts +119 -0
- package/dist/types/locales/languages/en_AU.d.ts +119 -0
- package/dist/types/locales/languages/en_GB.d.ts +119 -0
- package/dist/types/locales/languages/en_US.d.ts +119 -0
- package/dist/types/locales/languages/es_ES.d.ts +119 -0
- package/dist/types/locales/languages/et_EE.d.ts +119 -0
- package/dist/types/locales/languages/fa_IR.d.ts +119 -0
- package/dist/types/locales/languages/fi_FI.d.ts +119 -0
- package/dist/types/locales/languages/fr_BE.d.ts +119 -0
- package/dist/types/locales/languages/fr_CA.d.ts +119 -0
- package/dist/types/locales/languages/fr_FR.d.ts +119 -0
- package/dist/types/locales/languages/ga_IE.d.ts +119 -0
- package/dist/types/locales/languages/gl_ES.d.ts +119 -0
- package/dist/types/locales/languages/he_IL.d.ts +119 -0
- package/dist/types/locales/languages/hi_IN.d.ts +119 -0
- package/dist/types/locales/languages/hr_HR.d.ts +119 -0
- package/dist/types/locales/languages/hu_HU.d.ts +119 -0
- package/dist/types/locales/languages/hy_AM.d.ts +119 -0
- package/dist/types/locales/languages/id_ID.d.ts +119 -0
- package/dist/types/locales/languages/index.d.ts +13 -0
- package/dist/types/locales/languages/is_IS.d.ts +119 -0
- package/dist/types/locales/languages/it_IT.d.ts +119 -0
- package/dist/types/locales/languages/ja_JP.d.ts +119 -0
- package/dist/types/locales/languages/ka_GE.d.ts +119 -0
- package/dist/types/locales/languages/kk_KZ.d.ts +119 -0
- package/dist/types/locales/languages/km_KH.d.ts +119 -0
- package/dist/types/locales/languages/kmr_IQ.d.ts +119 -0
- package/dist/types/locales/languages/kn_IN.d.ts +119 -0
- package/dist/types/locales/languages/ko_KR.d.ts +119 -0
- package/dist/types/locales/languages/ku_IQ.d.ts +119 -0
- package/dist/types/locales/languages/lt_LT.d.ts +119 -0
- package/dist/types/locales/languages/lv_LV.d.ts +119 -0
- package/dist/types/locales/languages/mk_MK.d.ts +119 -0
- package/dist/types/locales/languages/ml_IN.d.ts +119 -0
- package/dist/types/locales/languages/mn_MN.d.ts +119 -0
- package/dist/types/locales/languages/ms_MY.d.ts +119 -0
- package/dist/types/locales/languages/nb_NO.d.ts +119 -0
- package/dist/types/locales/languages/ne_NP.d.ts +119 -0
- package/dist/types/locales/languages/nl_BE.d.ts +119 -0
- package/dist/types/locales/languages/nl_NL.d.ts +119 -0
- package/dist/types/locales/languages/pl_PL.d.ts +119 -0
- package/dist/types/locales/languages/pt_BR.d.ts +119 -0
- package/dist/types/locales/languages/pt_PT.d.ts +119 -0
- package/dist/types/locales/languages/ro_RO.d.ts +119 -0
- package/dist/types/locales/languages/ru_RU.d.ts +119 -0
- package/dist/types/locales/languages/sk_SK.d.ts +119 -0
- package/dist/types/locales/languages/sl_SI.d.ts +119 -0
- package/dist/types/locales/languages/sr_RS.d.ts +119 -0
- package/dist/types/locales/languages/sv_SE.d.ts +119 -0
- package/dist/types/locales/languages/ta_IN.d.ts +119 -0
- package/dist/types/locales/languages/th_TH.d.ts +119 -0
- package/dist/types/locales/languages/tr_TR.d.ts +119 -0
- package/dist/types/locales/languages/uk_UA.d.ts +119 -0
- package/dist/types/locales/languages/ur_PK.d.ts +119 -0
- package/dist/types/locales/languages/vi_VN.d.ts +119 -0
- package/dist/types/locales/languages/zh_CN.d.ts +119 -0
- package/dist/types/locales/languages/zh_HK.d.ts +119 -0
- package/dist/types/locales/languages/zh_TW.d.ts +119 -0
- package/dist/types/locales/locale.service.d.ts +93 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/types.d.ts +59 -0
- package/dist/types/utils/app-service.d.ts +20 -0
- package/dist/types/utils/cascader.service.d.ts +45 -0
- package/dist/types/utils/config.d.ts +47 -0
- package/dist/types/utils/form/core/abstract-control.d.ts +121 -0
- package/dist/types/utils/form/core/form-array.d.ts +51 -0
- package/dist/types/utils/form/core/form-builder.d.ts +45 -0
- package/dist/types/utils/form/core/form-control.d.ts +37 -0
- package/dist/types/utils/form/core/form-group.d.ts +63 -0
- package/dist/types/utils/form/frameworks.d.ts +18 -0
- package/dist/types/utils/form/types.d.ts +8 -0
- package/dist/types/utils/form/validators/validators.d.ts +39 -0
- package/dist/types/utils/index.d.ts +10 -0
- package/dist/types/utils/qr-code/cache/qr.cache.d.ts +7 -0
- package/dist/types/utils/qr-code/engine/qr.engine.d.ts +15 -0
- package/dist/types/utils/qr-code/engine/qr.gf.d.ts +4 -0
- package/dist/types/utils/qr-code/engine/qr.mask.d.ts +2 -0
- package/dist/types/utils/qr-code/engine/qr.rs.d.ts +1 -0
- package/dist/types/utils/qr-code/engine/qr.util.d.ts +0 -0
- package/dist/types/utils/qr-code/engine/qr.version.d.ts +16 -0
- package/dist/types/utils/qr-code/renderer/canvas.renderer.d.ts +6 -0
- package/dist/types/utils/qr-code/renderer/svg.renderer.d.ts +7 -0
- package/dist/types/utils/qr-code/worker/worker.manager.d.ts +12 -0
- package/dist/types/utils/table.service.d.ts +48 -0
- package/dist/types/utils/tree.service.d.ts +85 -0
- package/dist/types/utils/workflow/flow.service.d.ts +61 -0
- package/dist/types/utils/workflow/types.d.ts +120 -0
- package/dist/xlabs-store/fonts/xlabs-outlined.woff2 +0 -0
- package/dist/xlabs-store/fonts/xlabs-rounded.woff2 +0 -0
- package/dist/xlabs-store/fonts/xlabs-solided.woff2 +0 -0
- package/dist/xlabs-store/index.esm.js +1 -0
- package/dist/xlabs-store/p-016194dc.entry.js +1 -0
- package/dist/xlabs-store/p-023259c9.entry.js +1 -0
- package/dist/xlabs-store/p-04a3721a.entry.js +1 -0
- package/dist/xlabs-store/p-072445b7.entry.js +1 -0
- package/dist/xlabs-store/p-0ec21454.entry.js +1 -0
- package/dist/xlabs-store/p-12b6a843.entry.js +1 -0
- package/dist/xlabs-store/p-1a81cf09.entry.js +1 -0
- package/dist/xlabs-store/p-1b019aeb.entry.js +1 -0
- package/dist/xlabs-store/p-262a0673.entry.js +1 -0
- package/dist/xlabs-store/p-34cce823.entry.js +1 -0
- package/dist/xlabs-store/p-3a9fdefe.entry.js +1 -0
- package/dist/xlabs-store/p-40036100.entry.js +1 -0
- package/dist/xlabs-store/p-45f04e8d.entry.js +1 -0
- package/dist/xlabs-store/p-48ba7c34.entry.js +1 -0
- package/dist/xlabs-store/p-48e2c26e.entry.js +1 -0
- package/dist/xlabs-store/p-4ac2e915.entry.js +1 -0
- package/dist/xlabs-store/p-4d7c2a35.entry.js +1 -0
- package/dist/xlabs-store/p-4f67cb33.entry.js +1 -0
- package/dist/xlabs-store/p-502b345e.entry.js +1 -0
- package/dist/xlabs-store/p-555c5e48.entry.js +1 -0
- package/dist/xlabs-store/p-5878525f.entry.js +1 -0
- package/dist/xlabs-store/p-5abbdca7.entry.js +1 -0
- package/dist/xlabs-store/p-6243ca69.entry.js +1 -0
- package/dist/xlabs-store/p-64e7a057.entry.js +1 -0
- package/dist/xlabs-store/p-6530d2ef.entry.js +1 -0
- package/dist/xlabs-store/p-675a39e1.entry.js +1 -0
- package/dist/xlabs-store/p-689c52ef.entry.js +1 -0
- package/dist/xlabs-store/p-69b8cb7d.entry.js +1 -0
- package/dist/xlabs-store/p-6b121c60.entry.js +1 -0
- package/dist/xlabs-store/p-6c75fc39.entry.js +1 -0
- package/dist/xlabs-store/p-6f705deb.entry.js +1 -0
- package/dist/xlabs-store/p-723d362c.entry.js +1 -0
- package/dist/xlabs-store/p-783545e3.entry.js +1 -0
- package/dist/xlabs-store/p-7a8f11b4.entry.js +1 -0
- package/dist/xlabs-store/p-81fb4caf.entry.js +1 -0
- package/dist/xlabs-store/p-863dd67d.entry.js +1 -0
- package/dist/xlabs-store/p-8bcbb4e3.entry.js +1 -0
- package/dist/xlabs-store/p-8bcc219a.entry.js +1 -0
- package/dist/xlabs-store/p-914b0ae2.entry.js +1 -0
- package/dist/xlabs-store/p-96b1939d.entry.js +1 -0
- package/dist/xlabs-store/p-9ac291ea.entry.js +1 -0
- package/dist/xlabs-store/p-9de03a07.entry.js +1 -0
- package/dist/xlabs-store/p-BPeosvTA.js +1 -0
- package/dist/xlabs-store/p-COpzIi1n.js +1 -0
- package/dist/xlabs-store/p-C_QdJRdB.js +1 -0
- package/dist/xlabs-store/p-Ce5L9qbY.js +1 -0
- package/dist/xlabs-store/p-Co3Y9VjQ.js +1 -0
- package/dist/xlabs-store/p-D66tF8_2.js +1 -0
- package/dist/xlabs-store/p-DElCk9ta.js +1 -0
- package/dist/xlabs-store/p-Dgxy93Bg.js +1 -0
- package/dist/xlabs-store/p-XBF88YT_.js +1 -0
- package/dist/xlabs-store/p-a4223feb.entry.js +1 -0
- package/dist/xlabs-store/p-a8c2eca7.entry.js +1 -0
- package/dist/xlabs-store/p-ac9ba3aa.entry.js +1 -0
- package/dist/xlabs-store/p-bd5084b8.entry.js +1 -0
- package/dist/xlabs-store/p-bda322db.entry.js +1 -0
- package/dist/xlabs-store/p-c0ca6f7d.entry.js +1 -0
- package/dist/xlabs-store/p-c4c8840c.entry.js +1 -0
- package/dist/xlabs-store/p-c4d0ce0d.entry.js +1 -0
- package/dist/xlabs-store/p-cd3c3374.entry.js +1 -0
- package/dist/xlabs-store/p-cf4697bc.entry.js +1 -0
- package/dist/xlabs-store/p-d2ec3d4a.entry.js +1 -0
- package/dist/xlabs-store/p-d4d00aff.entry.js +1 -0
- package/dist/xlabs-store/p-d9d0147b.entry.js +1 -0
- package/dist/xlabs-store/p-dd930f2a.entry.js +1 -0
- package/dist/xlabs-store/p-e04836e8.entry.js +1 -0
- package/dist/xlabs-store/p-e14b5f6d.entry.js +1 -0
- package/dist/xlabs-store/p-eb1dd3c2.entry.js +1 -0
- package/dist/xlabs-store/p-f02155e4.entry.js +1 -0
- package/dist/xlabs-store/p-f1331938.entry.js +1 -0
- package/dist/xlabs-store/p-fac0b689.entry.js +1 -0
- package/dist/xlabs-store/p-fd2e1d9c.entry.js +1 -0
- package/dist/xlabs-store/p-fdec5d89.entry.js +1 -0
- package/dist/xlabs-store/p-ffba56b2.entry.js +1 -0
- package/dist/xlabs-store/p-ig_mFsVk.js +2 -0
- package/dist/xlabs-store/xlabs-store.css +1 -0
- package/dist/xlabs-store/xlabs-store.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +69 -0
- package/readme.md +50 -0
|
@@ -0,0 +1,1636 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
import { EditorSelection } from "./editor-selection";
|
|
3
|
+
import { EditorNormalizer } from "./editor-normalizer";
|
|
4
|
+
import { EditorHistory } from "./editor-history";
|
|
5
|
+
import { parseDOM, /* stateToHTML, */ stateToDOM } from "./editor-parser";
|
|
6
|
+
import { translate } from "../../locales/locale.service";
|
|
7
|
+
/**
|
|
8
|
+
* WYSIWYG Editor Component
|
|
9
|
+
*
|
|
10
|
+
* A Notion-style editor with:
|
|
11
|
+
* - Inline formatting (bold, italic, underline)
|
|
12
|
+
* - Block editing (paragraph, headings, blockquote, code)
|
|
13
|
+
* - Undo/Redo
|
|
14
|
+
* - Paste sanitization
|
|
15
|
+
* - Slash command
|
|
16
|
+
*/
|
|
17
|
+
export class XEditor {
|
|
18
|
+
el;
|
|
19
|
+
/**
|
|
20
|
+
* Initial HTML content to be loaded into the editor.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @example
|
|
23
|
+
* <x-editor initialValue="<h1>Hello World</h1><p>Start editing...</p>"></x-editor>
|
|
24
|
+
*/
|
|
25
|
+
initialValue = '';
|
|
26
|
+
/**
|
|
27
|
+
* Placeholder text displayed when the editor is empty.
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @example
|
|
30
|
+
* <x-editor placeholder="Type / for commands..."></x-editor>
|
|
31
|
+
*/
|
|
32
|
+
placeholder = translate('Editor.placeholder', {}, 'Start typing...');
|
|
33
|
+
/**
|
|
34
|
+
* Whether the editor is in read-only mode.
|
|
35
|
+
* @type {boolean}
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disabled = false;
|
|
39
|
+
/**
|
|
40
|
+
* Toggles the visibility of the top toolbar.
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
showToolbar = true;
|
|
45
|
+
/**
|
|
46
|
+
* Configuration for the toolbar groups and actions.
|
|
47
|
+
* Allows customizing which tools are available to the user.
|
|
48
|
+
* @type {ToolbarConfig}
|
|
49
|
+
*/
|
|
50
|
+
toolbar = [
|
|
51
|
+
{
|
|
52
|
+
name: 'history',
|
|
53
|
+
actions: [
|
|
54
|
+
{ type: 'undo', title: translate('Editor.undo', {}, 'Undo (Ctrl+Z)') },
|
|
55
|
+
{ type: 'redo', title: translate('Editor.redo', {}, 'Redo (Ctrl+Shift+Z)') },
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
'divider',
|
|
59
|
+
{
|
|
60
|
+
name: 'text',
|
|
61
|
+
actions: [
|
|
62
|
+
{ type: 'bold', title: translate('Editor.bold', {}, 'Bold (Ctrl+B)') },
|
|
63
|
+
{ type: 'italic', title: translate('Editor.italic', {}, 'Italic (Ctrl+I)') },
|
|
64
|
+
{ type: 'underline', title: translate('Editor.underline', {}, 'Underline (Ctrl+U)') },
|
|
65
|
+
{ type: 'strikethrough', title: translate('Editor.strikethrough', {}, 'Strikethrough') },
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
'divider',
|
|
69
|
+
{
|
|
70
|
+
name: 'colors',
|
|
71
|
+
actions: [
|
|
72
|
+
{ type: 'textColor', title: translate('Editor.textColor', {}, 'Text Color') },
|
|
73
|
+
{ type: 'backgroundColor', title: translate('Editor.backgroundColor', {}, 'Background Color') },
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
'divider',
|
|
77
|
+
{
|
|
78
|
+
name: 'typography',
|
|
79
|
+
actions: [
|
|
80
|
+
{ type: 'fontFamily', title: translate('Editor.fontFamily', {}, 'Font Family') },
|
|
81
|
+
{ type: 'fontSize', title: translate('Editor.fontSize', {}, 'Font Size') },
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
'divider',
|
|
85
|
+
{
|
|
86
|
+
name: 'blocks',
|
|
87
|
+
actions: [
|
|
88
|
+
{ type: 'h1', title: translate('Editor.h1', {}, 'Heading 1') },
|
|
89
|
+
{ type: 'h2', title: translate('Editor.h2', {}, 'Heading 2') },
|
|
90
|
+
{ type: 'h3', title: translate('Editor.h3', {}, 'Heading 3') },
|
|
91
|
+
{ type: 'h4', title: translate('Editor.h4', {}, 'Heading 4') },
|
|
92
|
+
{ type: 'h5', title: translate('Editor.h5', {}, 'Heading 5') },
|
|
93
|
+
{ type: 'h6', title: translate('Editor.h6', {}, 'Heading 6') },
|
|
94
|
+
{ type: 'paragraph', title: translate('Editor.paragraph', {}, 'Paragraph') },
|
|
95
|
+
{ type: 'blockquote', title: translate('Editor.blockquote', {}, 'Quote') },
|
|
96
|
+
{ type: 'code', title: translate('Editor.codeBlock', {}, 'Code Block') },
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
'divider',
|
|
100
|
+
{
|
|
101
|
+
name: 'alignment',
|
|
102
|
+
actions: [
|
|
103
|
+
{ type: 'alignLeft', title: translate('Editor.alignLeft', {}, 'Align Left') },
|
|
104
|
+
{ type: 'alignCenter', title: translate('Editor.alignCenter', {}, 'Align Center') },
|
|
105
|
+
{ type: 'alignRight', title: translate('Editor.alignRight', {}, 'Align Right') },
|
|
106
|
+
{ type: 'alignJustify', title: translate('Editor.alignJustify', {}, 'Align Justify') },
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
'divider',
|
|
110
|
+
{
|
|
111
|
+
name: 'indentation',
|
|
112
|
+
actions: [
|
|
113
|
+
{ type: 'outdent', title: translate('Editor.outdent', {}, 'Decrease Indent') },
|
|
114
|
+
{ type: 'indent', title: translate('Editor.indent', {}, 'Increase Indent') },
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
'divider',
|
|
118
|
+
{
|
|
119
|
+
name: 'insert',
|
|
120
|
+
actions: [
|
|
121
|
+
{ type: 'link', title: translate('Editor.insertLink', {}, 'Insert Link') },
|
|
122
|
+
{ type: 'image', title: translate('Editor.insertImage', {}, 'Insert Image') },
|
|
123
|
+
{ type: 'video', title: translate('Editor.insertVideo', {}, 'Insert Video') },
|
|
124
|
+
{ type: 'file', title: translate('Editor.insertFile', {}, 'Insert File') },
|
|
125
|
+
{ type: 'table', title: translate('Editor.insertTable', {}, 'Insert Table') },
|
|
126
|
+
{ type: 'hr', title: translate('Editor.horizontalLine', {}, 'Horizontal Line') },
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
/**
|
|
131
|
+
* Emit value change events
|
|
132
|
+
*/
|
|
133
|
+
valueChange;
|
|
134
|
+
// Internal state
|
|
135
|
+
_showSlashMenu = false;
|
|
136
|
+
_slashMenuPosition = { x: 0, y: 0 };
|
|
137
|
+
_slashFilter = '';
|
|
138
|
+
_activeFormats = new Set();
|
|
139
|
+
_activeBlockType = 'paragraph';
|
|
140
|
+
_activeModal = null;
|
|
141
|
+
_modalData = {};
|
|
142
|
+
_activeAlignment = 'left';
|
|
143
|
+
// Editor helpers
|
|
144
|
+
editorRoot;
|
|
145
|
+
selectionHelper;
|
|
146
|
+
normalizer;
|
|
147
|
+
history;
|
|
148
|
+
// Slash command saved range
|
|
149
|
+
slashCommandSavedRange = null;
|
|
150
|
+
_toolbarSavedSelection = null;
|
|
151
|
+
// Slash command items
|
|
152
|
+
slashCommands = [
|
|
153
|
+
{ id: 'h1', label: translate('Editor.h1', {}, 'Heading 1'), blockType: 'heading', headingLevel: 1, icon: 'H1' },
|
|
154
|
+
{ id: 'h2', label: translate('Editor.h2', {}, 'Heading 2'), blockType: 'heading', headingLevel: 2, icon: 'H2' },
|
|
155
|
+
{ id: 'h3', label: translate('Editor.h3', {}, 'Heading 3'), blockType: 'heading', headingLevel: 3, icon: 'H3' },
|
|
156
|
+
{ id: 'quote', label: translate('Editor.blockquote', {}, 'Quote'), blockType: 'blockquote', icon: '"' },
|
|
157
|
+
{ id: 'code', label: translate('Editor.codeBlock', {}, 'Code Block'), blockType: 'code', icon: '</>' },
|
|
158
|
+
{ id: 'paragraph', label: translate('Editor.paragraph', {}, 'Plain Text'), blockType: 'paragraph', icon: 'P' },
|
|
159
|
+
];
|
|
160
|
+
componentWillLoad() {
|
|
161
|
+
this.selectionHelper = new EditorSelection();
|
|
162
|
+
this.normalizer = new EditorNormalizer();
|
|
163
|
+
this.history = new EditorHistory();
|
|
164
|
+
}
|
|
165
|
+
componentDidLoad() {
|
|
166
|
+
// Set initial content
|
|
167
|
+
if (this.initialValue) {
|
|
168
|
+
this.setHTML(this.initialValue);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
this.setHTML('<p><br></p>');
|
|
172
|
+
}
|
|
173
|
+
// Save initial state to history and update selection tracking
|
|
174
|
+
this.saveToHistory();
|
|
175
|
+
setTimeout(() => this.updateActiveStates(), 0);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Retrieves the current editor state as a structured object.
|
|
179
|
+
* This includes the block hierarchy and formatting metadata.
|
|
180
|
+
* @returns {Promise<EditorState>} The parsed state object.
|
|
181
|
+
*/
|
|
182
|
+
async getState() {
|
|
183
|
+
return parseDOM(this.editorRoot);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Reconstructs the editor content from a provided state object.
|
|
187
|
+
* @param {EditorState} state - The state object to apply.
|
|
188
|
+
* @returns {Promise<void>}
|
|
189
|
+
*/
|
|
190
|
+
async setState(state) {
|
|
191
|
+
stateToDOM(state, this.editorRoot);
|
|
192
|
+
this.emitValueChange();
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Retrieves the current RAW HTML content of the editor.
|
|
196
|
+
* @returns {Promise<string>} The HTML string.
|
|
197
|
+
*/
|
|
198
|
+
async getHTML() {
|
|
199
|
+
return this.editorRoot?.innerHTML || '';
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Replaces the entire editor content with the provided HTML string.
|
|
203
|
+
* Content is automatically normalized after insertion.
|
|
204
|
+
* @param {string} html - The new HTML content.
|
|
205
|
+
* @returns {Promise<void>}
|
|
206
|
+
*/
|
|
207
|
+
async setHTML(html) {
|
|
208
|
+
if (!this.editorRoot)
|
|
209
|
+
return;
|
|
210
|
+
this.editorRoot.innerHTML = html;
|
|
211
|
+
this.normalizer.normalize(this.editorRoot);
|
|
212
|
+
this.emitValueChange();
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Programmatically sets focus to the editor root element.
|
|
216
|
+
* @returns {Promise<void>}
|
|
217
|
+
*/
|
|
218
|
+
async focusEditor() {
|
|
219
|
+
this.selectionHelper?.focus(this.editorRoot);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Resets the editor to its empty state (single paragraph) and clears history.
|
|
223
|
+
* @returns {Promise<void>}
|
|
224
|
+
*/
|
|
225
|
+
async clear() {
|
|
226
|
+
this.setHTML('<p><br></p>');
|
|
227
|
+
this.history.clear();
|
|
228
|
+
this.saveToHistory();
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Undo last action
|
|
232
|
+
*/
|
|
233
|
+
async undo() {
|
|
234
|
+
const currentHtml = await this.getHTML();
|
|
235
|
+
const previousState = this.history.undo(currentHtml);
|
|
236
|
+
if (previousState) {
|
|
237
|
+
await this.setHTML(previousState);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Redo last undone action
|
|
242
|
+
*/
|
|
243
|
+
async redo() {
|
|
244
|
+
const currentHtml = await this.getHTML();
|
|
245
|
+
const nextState = this.history.redo(currentHtml);
|
|
246
|
+
if (nextState) {
|
|
247
|
+
await this.setHTML(nextState);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Check if undo is available
|
|
252
|
+
*/
|
|
253
|
+
async canUndo() {
|
|
254
|
+
return this.history.canUndo();
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Check if redo is available
|
|
258
|
+
*/
|
|
259
|
+
async canRedo() {
|
|
260
|
+
return this.history.canRedo();
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* General handler for input events (typing, deleting).
|
|
264
|
+
*
|
|
265
|
+
* Flow:
|
|
266
|
+
* 1. Normalizes the DOM structure (ensures blocks are valid).
|
|
267
|
+
* 2. Saves the current state to the undo/redo history.
|
|
268
|
+
* 3. Emits the `valueChange` event to notify external listeners.
|
|
269
|
+
* 4. Updates toolbar active states (bold, heading level, etc.).
|
|
270
|
+
*/
|
|
271
|
+
handleInput = () => {
|
|
272
|
+
this.normalizer.normalize(this.editorRoot);
|
|
273
|
+
this.saveToHistory();
|
|
274
|
+
this.emitValueChange();
|
|
275
|
+
this.updateActiveStates();
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Main keyboard event handler.
|
|
279
|
+
* Manages shortcuts (Ctrl+B, Ctrl+Z, etc.) and special keys like Enter/Backspace.
|
|
280
|
+
*
|
|
281
|
+
* Short-circuiting:
|
|
282
|
+
* - Ignores all input if the editor is `disabled`.
|
|
283
|
+
*/
|
|
284
|
+
handleKeyDown = (e) => {
|
|
285
|
+
if (this.disabled)
|
|
286
|
+
return;
|
|
287
|
+
// Handle Formatting Shortcuts (Ctrl/Cmd + Key)
|
|
288
|
+
if (e.ctrlKey || e.metaKey) {
|
|
289
|
+
if (e.key === 'b') {
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
this.toggleFormat('bold');
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (e.key === 'i') {
|
|
295
|
+
e.preventDefault();
|
|
296
|
+
this.toggleFormat('italic');
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if (e.key === 'u') {
|
|
300
|
+
e.preventDefault();
|
|
301
|
+
this.toggleFormat('underline');
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
// History Shortcuts
|
|
305
|
+
if (e.key === 'z') {
|
|
306
|
+
e.preventDefault();
|
|
307
|
+
if (e.shiftKey)
|
|
308
|
+
this.redo();
|
|
309
|
+
else
|
|
310
|
+
this.undo();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
if (e.key === 'y') {
|
|
314
|
+
e.preventDefault();
|
|
315
|
+
this.redo();
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
// Handle Enter Key (Block Management)
|
|
320
|
+
if (e.key === 'Enter') {
|
|
321
|
+
// If slash menu is visible, Enter is used to select or close
|
|
322
|
+
if (this._showSlashMenu) {
|
|
323
|
+
this.closeSlashMenu();
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
if (e.shiftKey) {
|
|
327
|
+
// Shift+Enter: Insert a soft line break (<br>) within the current block
|
|
328
|
+
e.preventDefault();
|
|
329
|
+
this.insertLineBreak();
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
// Plain Enter: Split the block or create a new paragraph
|
|
333
|
+
e.preventDefault();
|
|
334
|
+
this.handleEnter();
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
// Handle Backspace at start of block (Merging logic)
|
|
339
|
+
if (e.key === 'Backspace') {
|
|
340
|
+
this.handleBackspace();
|
|
341
|
+
}
|
|
342
|
+
// Handle Slash Command Trigger (/)
|
|
343
|
+
if (e.key === '/') {
|
|
344
|
+
// Trigger slash command only if at the very beginning of a block
|
|
345
|
+
if (this.selectionHelper.isAtBlockStart()) {
|
|
346
|
+
// Delay to allow the '/' character to be inserted before showing the menu
|
|
347
|
+
setTimeout(() => {
|
|
348
|
+
this.handleSlashCommand();
|
|
349
|
+
}, 0);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
// Handle Escape key to close floating menus
|
|
353
|
+
if (e.key === 'Escape' && this._showSlashMenu) {
|
|
354
|
+
this.closeSlashMenu();
|
|
355
|
+
}
|
|
356
|
+
// Update the slash command filtering if the menu is active
|
|
357
|
+
if (this._showSlashMenu) {
|
|
358
|
+
setTimeout(() => {
|
|
359
|
+
this.updateSlashFilter();
|
|
360
|
+
}, 0);
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
updateSlashFilter() {
|
|
364
|
+
const range = this.selectionHelper.getRange();
|
|
365
|
+
if (!range || !range.startContainer || range.startContainer.nodeType !== Node.TEXT_NODE)
|
|
366
|
+
return;
|
|
367
|
+
const text = range.startContainer.textContent || '';
|
|
368
|
+
const offset = range.startOffset;
|
|
369
|
+
const slashIndex = text.lastIndexOf('/', offset - 1);
|
|
370
|
+
if (slashIndex !== -1) {
|
|
371
|
+
this._slashFilter = text.substring(slashIndex + 1, offset).trim();
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
this.closeSlashMenu();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Handles clipboard paste events.
|
|
379
|
+
* Sanitizes the incoming HTML or plain text to prevent XSS and preserve design consistency.
|
|
380
|
+
*
|
|
381
|
+
* Flow:
|
|
382
|
+
* 1. Prevents default browser paste behavior.
|
|
383
|
+
* 2. Checks if HTML content is available in clipboard.
|
|
384
|
+
* 3. Sanitizes HTML (removes unwanted styles/scripts) and inserts.
|
|
385
|
+
* 4. If only text is available, escapes special chars and inserts as plain text.
|
|
386
|
+
* 5. Normalizes the whole editor and saves state.
|
|
387
|
+
*/
|
|
388
|
+
handlePaste = (e) => {
|
|
389
|
+
if (this.disabled)
|
|
390
|
+
return;
|
|
391
|
+
e.preventDefault();
|
|
392
|
+
const html = e.clipboardData?.getData('text/html');
|
|
393
|
+
const text = e.clipboardData?.getData('text/plain');
|
|
394
|
+
if (html) {
|
|
395
|
+
const sanitizedHtml = this.normalizer.sanitizePaste(html);
|
|
396
|
+
this.selectionHelper.insertHTML(sanitizedHtml);
|
|
397
|
+
}
|
|
398
|
+
else if (text) {
|
|
399
|
+
this.selectionHelper.insertHTML(this.escapeHtml(text));
|
|
400
|
+
}
|
|
401
|
+
setTimeout(() => {
|
|
402
|
+
this.normalizer.normalize(this.editorRoot);
|
|
403
|
+
this.saveToHistory();
|
|
404
|
+
this.emitValueChange();
|
|
405
|
+
}, 0);
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Internal handler for mouse click event.
|
|
409
|
+
* Closes the slash command menu if active.
|
|
410
|
+
*/
|
|
411
|
+
handleClick = () => {
|
|
412
|
+
if (this._showSlashMenu) {
|
|
413
|
+
this.closeSlashMenu();
|
|
414
|
+
}
|
|
415
|
+
this.updateActiveStates();
|
|
416
|
+
};
|
|
417
|
+
/**
|
|
418
|
+
* Internal handler for focus event.
|
|
419
|
+
*/
|
|
420
|
+
handleFocus = () => {
|
|
421
|
+
this.updateActiveStates();
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Internal handler for blur event.
|
|
425
|
+
*/
|
|
426
|
+
handleBlur = () => {
|
|
427
|
+
// Optional: clear active states or keep them
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* Internal handler for key up events (specifically for arrow navigation).
|
|
431
|
+
*/
|
|
432
|
+
handleKeyUp = (e) => {
|
|
433
|
+
if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'].includes(e.key)) {
|
|
434
|
+
this.updateActiveStates();
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* Updates toolbar active states based on current selection.
|
|
439
|
+
* Queries the DOM/Selection API for active formatting and block types.
|
|
440
|
+
*/
|
|
441
|
+
updateActiveStates = () => {
|
|
442
|
+
const formats = new Set();
|
|
443
|
+
if (this.selectionHelper.isFormatApplied('bold'))
|
|
444
|
+
formats.add('bold');
|
|
445
|
+
if (this.selectionHelper.isFormatApplied('italic'))
|
|
446
|
+
formats.add('italic');
|
|
447
|
+
if (this.selectionHelper.isFormatApplied('underline'))
|
|
448
|
+
formats.add('underline');
|
|
449
|
+
if (this.selectionHelper.isFormatApplied('strikethrough'))
|
|
450
|
+
formats.add('strikethrough');
|
|
451
|
+
this._activeFormats = new Set(formats);
|
|
452
|
+
this._activeBlockType = this.selectionHelper.getCurrentBlockType();
|
|
453
|
+
// Track text alignment using document.queryCommandState
|
|
454
|
+
try {
|
|
455
|
+
if (document.queryCommandState('justifyLeft'))
|
|
456
|
+
this._activeAlignment = 'left';
|
|
457
|
+
else if (document.queryCommandState('justifyCenter'))
|
|
458
|
+
this._activeAlignment = 'center';
|
|
459
|
+
else if (document.queryCommandState('justifyRight'))
|
|
460
|
+
this._activeAlignment = 'right';
|
|
461
|
+
else if (document.queryCommandState('justifyFull'))
|
|
462
|
+
this._activeAlignment = 'justify';
|
|
463
|
+
}
|
|
464
|
+
catch {
|
|
465
|
+
// Ignore errors if selection is outside
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
handleDropdownOpenChange = (open) => {
|
|
469
|
+
if (open) {
|
|
470
|
+
this._toolbarSavedSelection = this.selectionHelper.saveSelection();
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
restoreRange() {
|
|
474
|
+
this.editorRoot.focus();
|
|
475
|
+
if (this._toolbarSavedSelection) {
|
|
476
|
+
this.selectionHelper.restoreSelection(this._toolbarSavedSelection);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
// Handle composition start
|
|
480
|
+
handleCompositionStart = () => {
|
|
481
|
+
this.history.setComposing(true);
|
|
482
|
+
};
|
|
483
|
+
// Handle composition end
|
|
484
|
+
handleCompositionEnd = () => {
|
|
485
|
+
this.history.setComposing(false);
|
|
486
|
+
this.saveToHistory();
|
|
487
|
+
this.emitValueChange();
|
|
488
|
+
};
|
|
489
|
+
// Insert line break (Shift+Enter)
|
|
490
|
+
insertLineBreak() {
|
|
491
|
+
this.selectionHelper.insertHTML('<br>');
|
|
492
|
+
this.emitValueChange();
|
|
493
|
+
}
|
|
494
|
+
// Handle Enter key
|
|
495
|
+
/**
|
|
496
|
+
* Handle Enter key press.
|
|
497
|
+
*
|
|
498
|
+
* Flow:
|
|
499
|
+
* 1. Gets current selection range.
|
|
500
|
+
* 2. Identifies current block element.
|
|
501
|
+
* 3. Checks special cases:
|
|
502
|
+
* - Empty special block -> converts to paragraph.
|
|
503
|
+
* - End of heading -> creates paragraph.
|
|
504
|
+
* 4. Default action:
|
|
505
|
+
* - Creates new block of same type (or paragraph for headings).
|
|
506
|
+
* - Inserts after current block.
|
|
507
|
+
* - Moves cursor to new block.
|
|
508
|
+
* 5. Saves history.
|
|
509
|
+
*/
|
|
510
|
+
async handleEnter() {
|
|
511
|
+
const range = this.selectionHelper.getRange();
|
|
512
|
+
if (!range)
|
|
513
|
+
return;
|
|
514
|
+
const container = range.startContainer;
|
|
515
|
+
const element = container.nodeType === Node.TEXT_NODE
|
|
516
|
+
? container.parentElement
|
|
517
|
+
: container;
|
|
518
|
+
const blockElement = element?.closest('p, h1, h2, h3, h4, h5, h6, blockquote, pre');
|
|
519
|
+
if (!blockElement)
|
|
520
|
+
return;
|
|
521
|
+
// Get current block type
|
|
522
|
+
const currentBlockType = this.selectionHelper.getCurrentBlockType();
|
|
523
|
+
const isAtEnd = this.selectionHelper.isAtBlockEnd();
|
|
524
|
+
const isEmpty = !blockElement.textContent?.trim();
|
|
525
|
+
// Notion-style: Enter in empty special block converts to paragraph
|
|
526
|
+
if (isEmpty && currentBlockType !== 'paragraph') {
|
|
527
|
+
this.convertBlock('paragraph');
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
// Enter at end of heading creates paragraph
|
|
531
|
+
if (isAtEnd && currentBlockType === 'heading') {
|
|
532
|
+
const newBlock = document.createElement('p');
|
|
533
|
+
newBlock.innerHTML = '<br>';
|
|
534
|
+
if (blockElement.nextSibling) {
|
|
535
|
+
blockElement.parentNode?.insertBefore(newBlock, blockElement.nextSibling);
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
blockElement.parentNode?.appendChild(newBlock);
|
|
539
|
+
}
|
|
540
|
+
this.selectionHelper.setCursorAtEnd(newBlock);
|
|
541
|
+
this.emitValueChange();
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
// Default: split block (simple version: create new paragraph after)
|
|
545
|
+
// For a more advanced split, we'd use range.extractContents()
|
|
546
|
+
const newBlock = document.createElement(currentBlockType === 'heading' ? 'p' : blockElement.tagName.toLowerCase());
|
|
547
|
+
newBlock.innerHTML = '<br>';
|
|
548
|
+
if (blockElement.nextSibling) {
|
|
549
|
+
blockElement.parentNode?.insertBefore(newBlock, blockElement.nextSibling);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
blockElement.parentNode?.appendChild(newBlock);
|
|
553
|
+
}
|
|
554
|
+
this.selectionHelper.setCursorAtEnd(newBlock);
|
|
555
|
+
await this.saveToHistory();
|
|
556
|
+
this.emitValueChange();
|
|
557
|
+
}
|
|
558
|
+
// Handle backspace at block start
|
|
559
|
+
/**
|
|
560
|
+
* Handle Backspace at start of block.
|
|
561
|
+
*
|
|
562
|
+
* Flow:
|
|
563
|
+
* 1. Checks if cursor is at block start.
|
|
564
|
+
* 2. Identifies previous block.
|
|
565
|
+
* 3. If previous block exists:
|
|
566
|
+
* - Merges content of current block into previous block.
|
|
567
|
+
* - Preserves cursor position at merge point.
|
|
568
|
+
* - Removes current block.
|
|
569
|
+
* 4. Saves history.
|
|
570
|
+
*/
|
|
571
|
+
async handleBackspace() {
|
|
572
|
+
if (!this.selectionHelper.isAtBlockStart())
|
|
573
|
+
return;
|
|
574
|
+
const range = this.selectionHelper.getRange();
|
|
575
|
+
if (!range)
|
|
576
|
+
return;
|
|
577
|
+
const container = range.startContainer;
|
|
578
|
+
const element = container.nodeType === Node.TEXT_NODE
|
|
579
|
+
? container.parentElement
|
|
580
|
+
: container;
|
|
581
|
+
const blockElement = element?.closest('p, h1, h2, h3, h4, h5, h6, blockquote, pre');
|
|
582
|
+
if (!blockElement || !blockElement.previousSibling) {
|
|
583
|
+
// If at start of first block, maybe convert to paragraph if it's special
|
|
584
|
+
if (blockElement && this.selectionHelper.getCurrentBlockType() !== 'paragraph') {
|
|
585
|
+
this.convertBlock('paragraph');
|
|
586
|
+
}
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
// Get previous block
|
|
590
|
+
const prevBlock = blockElement.previousSibling;
|
|
591
|
+
if (prevBlock.nodeType !== Node.ELEMENT_NODE)
|
|
592
|
+
return;
|
|
593
|
+
// Save selection position in prevBlock (at the end)
|
|
594
|
+
const selection = this.selectionHelper.getSelection();
|
|
595
|
+
if (selection) {
|
|
596
|
+
// Merge content
|
|
597
|
+
const content = blockElement.innerHTML === '<br>' ? '' : blockElement.innerHTML;
|
|
598
|
+
// If prevBlock is empty (only <br>), clear it before merging
|
|
599
|
+
if (prevBlock.innerHTML === '<br>') {
|
|
600
|
+
prevBlock.innerHTML = '';
|
|
601
|
+
}
|
|
602
|
+
// Add marker to know where to put the cursor
|
|
603
|
+
const marker = document.createElement('span');
|
|
604
|
+
marker.id = 'cursor-marker';
|
|
605
|
+
prevBlock.appendChild(marker);
|
|
606
|
+
// Append content
|
|
607
|
+
if (content) {
|
|
608
|
+
prevBlock.innerHTML += content;
|
|
609
|
+
}
|
|
610
|
+
// Restore cursor to marker position
|
|
611
|
+
const newRange = document.createRange();
|
|
612
|
+
const markerElement = prevBlock.querySelector('#cursor-marker');
|
|
613
|
+
if (markerElement) {
|
|
614
|
+
newRange.setStartBefore(markerElement);
|
|
615
|
+
newRange.collapse(true);
|
|
616
|
+
markerElement.remove();
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
newRange.selectNodeContents(prevBlock);
|
|
620
|
+
newRange.collapse(false);
|
|
621
|
+
}
|
|
622
|
+
selection.removeAllRanges();
|
|
623
|
+
selection.addRange(newRange);
|
|
624
|
+
// Remove current block
|
|
625
|
+
blockElement.remove();
|
|
626
|
+
await this.saveToHistory();
|
|
627
|
+
this.emitValueChange();
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Displays the floating slash command menu at the current cursor position.
|
|
632
|
+
* Logic:
|
|
633
|
+
* 1. Clones the current range to remember where to insert the command.
|
|
634
|
+
* 2. Calculates the menu coordinates relative to the editor container.
|
|
635
|
+
* 3. Resets filters and toggles menu visibility.
|
|
636
|
+
*/
|
|
637
|
+
handleSlashCommand() {
|
|
638
|
+
const selection = this.selectionHelper.getSelection();
|
|
639
|
+
if (!selection)
|
|
640
|
+
return;
|
|
641
|
+
const range = this.selectionHelper.getRange();
|
|
642
|
+
if (!range)
|
|
643
|
+
return;
|
|
644
|
+
// Save range for later use
|
|
645
|
+
this.slashCommandSavedRange = range.cloneRange();
|
|
646
|
+
// Get cursor position for menu
|
|
647
|
+
const rect = range.getBoundingClientRect();
|
|
648
|
+
const editorRect = this.el.getBoundingClientRect();
|
|
649
|
+
this._slashMenuPosition = {
|
|
650
|
+
x: rect.left - editorRect.left,
|
|
651
|
+
y: rect.top - editorRect.top + 20, // Offset below cursor
|
|
652
|
+
};
|
|
653
|
+
this._slashFilter = '';
|
|
654
|
+
this._showSlashMenu = true;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Hides the slash command menu and clears the saved range.
|
|
658
|
+
*/
|
|
659
|
+
closeSlashMenu() {
|
|
660
|
+
this._showSlashMenu = false;
|
|
661
|
+
this.slashCommandSavedRange = null;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Finalizes the selection from the slash menu.
|
|
665
|
+
* Logic:
|
|
666
|
+
* 1. Restores the selection range that was active when the menu opened.
|
|
667
|
+
* 2. Removes the triggering '/' and any typed search filter text.
|
|
668
|
+
* 3. Converts the line to the chosen block type (e.g., H1, Quote).
|
|
669
|
+
*
|
|
670
|
+
* @param {SlashCommandItem} command - The command to execute.
|
|
671
|
+
*/
|
|
672
|
+
executeSlashCommand(command) {
|
|
673
|
+
if (!this.slashCommandSavedRange) {
|
|
674
|
+
this.closeSlashMenu();
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
// Restore selection
|
|
678
|
+
const selection = this.selectionHelper.getSelection();
|
|
679
|
+
if (selection) {
|
|
680
|
+
selection.removeAllRanges();
|
|
681
|
+
selection.addRange(this.slashCommandSavedRange);
|
|
682
|
+
}
|
|
683
|
+
// Delete the '/' character and filter text
|
|
684
|
+
const range = this.selectionHelper.getRange();
|
|
685
|
+
if (range && range.startContainer.nodeType === Node.TEXT_NODE) {
|
|
686
|
+
const textNode = range.startContainer;
|
|
687
|
+
const text = textNode.textContent || '';
|
|
688
|
+
if (text.endsWith('/')) {
|
|
689
|
+
textNode.textContent = text.slice(0, -1);
|
|
690
|
+
}
|
|
691
|
+
else if (text.includes('/')) {
|
|
692
|
+
// Find and remove the slash and anything after it
|
|
693
|
+
const slashIndex = text.lastIndexOf('/');
|
|
694
|
+
textNode.textContent = text.substring(0, slashIndex);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
// Convert block to selected type
|
|
698
|
+
this.convertBlock(command.blockType, command.headingLevel);
|
|
699
|
+
this.updateActiveStates();
|
|
700
|
+
this.closeSlashMenu();
|
|
701
|
+
}
|
|
702
|
+
// Convert current block to another type
|
|
703
|
+
/**
|
|
704
|
+
* Convert current block type.
|
|
705
|
+
*
|
|
706
|
+
* Flow:
|
|
707
|
+
* 1. Identifies current block element.
|
|
708
|
+
* 2. Creates new element tag based on `blockType`.
|
|
709
|
+
* 3. Moves content children to new element.
|
|
710
|
+
* 4. Replaces old element with new one in DOM.
|
|
711
|
+
* 5. Restores selection range.
|
|
712
|
+
* 6. Saves history.
|
|
713
|
+
*
|
|
714
|
+
* @param blockType - Target block type.
|
|
715
|
+
* @param headingLevel - Level for headings.
|
|
716
|
+
*/
|
|
717
|
+
convertBlock(blockType, headingLevel) {
|
|
718
|
+
const range = this.selectionHelper.getRange();
|
|
719
|
+
if (!range)
|
|
720
|
+
return;
|
|
721
|
+
const container = range.startContainer;
|
|
722
|
+
const element = container.nodeType === Node.TEXT_NODE
|
|
723
|
+
? container.parentElement
|
|
724
|
+
: container;
|
|
725
|
+
const blockElement = element?.closest('p, h1, h2, h3, h4, h5, h6, blockquote, pre');
|
|
726
|
+
if (!blockElement)
|
|
727
|
+
return;
|
|
728
|
+
// Create new element
|
|
729
|
+
let newTag;
|
|
730
|
+
switch (blockType) {
|
|
731
|
+
case 'heading':
|
|
732
|
+
newTag = `h${headingLevel || 1}`;
|
|
733
|
+
break;
|
|
734
|
+
case 'blockquote':
|
|
735
|
+
newTag = 'blockquote';
|
|
736
|
+
break;
|
|
737
|
+
case 'code':
|
|
738
|
+
newTag = 'pre';
|
|
739
|
+
break;
|
|
740
|
+
default:
|
|
741
|
+
newTag = 'p';
|
|
742
|
+
}
|
|
743
|
+
const newElement = document.createElement(newTag);
|
|
744
|
+
// Preserve content
|
|
745
|
+
if (blockType === 'code') {
|
|
746
|
+
const code = document.createElement('code');
|
|
747
|
+
while (blockElement.firstChild) {
|
|
748
|
+
code.appendChild(blockElement.firstChild);
|
|
749
|
+
}
|
|
750
|
+
newElement.appendChild(code);
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
while (blockElement.firstChild) {
|
|
754
|
+
newElement.appendChild(blockElement.firstChild);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
// Preserve selection if possible
|
|
758
|
+
const selection = this.selectionHelper.getSelection();
|
|
759
|
+
let offsets = null;
|
|
760
|
+
if (selection && selection.rangeCount > 0) {
|
|
761
|
+
const currentRange = selection.getRangeAt(0);
|
|
762
|
+
if (blockElement.contains(currentRange.startContainer) && blockElement.contains(currentRange.endContainer)) {
|
|
763
|
+
// Simple offset calculation
|
|
764
|
+
const preRange = document.createRange();
|
|
765
|
+
preRange.setStart(blockElement, 0);
|
|
766
|
+
preRange.setEnd(currentRange.startContainer, currentRange.startOffset);
|
|
767
|
+
const start = preRange.toString().length;
|
|
768
|
+
offsets = {
|
|
769
|
+
start,
|
|
770
|
+
end: start + currentRange.toString().length
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
// Replace element
|
|
775
|
+
if (blockElement.parentNode) {
|
|
776
|
+
blockElement.parentNode.replaceChild(newElement, blockElement);
|
|
777
|
+
}
|
|
778
|
+
// Restore selection to the new element
|
|
779
|
+
if (selection) {
|
|
780
|
+
const newRange = document.createRange();
|
|
781
|
+
if (offsets) {
|
|
782
|
+
// Try to restore offsets (simplified)
|
|
783
|
+
// For now, let's just select the whole new element if it was a selection,
|
|
784
|
+
// or put cursor at the same text offset.
|
|
785
|
+
// Actually, just putting it at the start is safer unless we do proper text node traversal.
|
|
786
|
+
// Let's at least keep it highlighting the content if it was more than a cursor.
|
|
787
|
+
if (offsets.start !== offsets.end) {
|
|
788
|
+
newRange.selectNodeContents(newElement);
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
newRange.setStart(newElement, 0);
|
|
792
|
+
newRange.collapse(true);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
newRange.setStart(newElement, 0);
|
|
797
|
+
newRange.collapse(true);
|
|
798
|
+
}
|
|
799
|
+
selection.removeAllRanges();
|
|
800
|
+
selection.addRange(newRange);
|
|
801
|
+
}
|
|
802
|
+
this.saveToHistory();
|
|
803
|
+
this.emitValueChange();
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Toggles an inline format (bold, italic, etc.) on the current selection.
|
|
807
|
+
* @param {FormatType} format - The format label.
|
|
808
|
+
*/
|
|
809
|
+
toggleFormat(format) {
|
|
810
|
+
this.selectionHelper.toggleFormat(format);
|
|
811
|
+
this.updateActiveStates();
|
|
812
|
+
this.saveToHistory();
|
|
813
|
+
this.emitValueChange();
|
|
814
|
+
}
|
|
815
|
+
// Check if format is applied
|
|
816
|
+
isFormatActive(format) {
|
|
817
|
+
// During render, we use the cached state for performance and reactivity
|
|
818
|
+
if (this._activeFormats.has(format))
|
|
819
|
+
return true;
|
|
820
|
+
// Fallback to helper for immediate checks
|
|
821
|
+
return this.selectionHelper.isFormatApplied(format);
|
|
822
|
+
}
|
|
823
|
+
// Get current block type
|
|
824
|
+
getCurrentBlockType() {
|
|
825
|
+
return this._activeBlockType || this.selectionHelper.getCurrentBlockType();
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Saves the current HTML snapshot to the history stack.
|
|
829
|
+
* Used for undo/redo functionality.
|
|
830
|
+
* @returns {Promise<void>}
|
|
831
|
+
*/
|
|
832
|
+
async saveToHistory() {
|
|
833
|
+
const html = await this.getHTML();
|
|
834
|
+
this.history.push(html);
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Internal helper to parse the current DOM and emit the `valueChange` event.
|
|
838
|
+
* Data is emitted as a JSON-stringified `EditorState`.
|
|
839
|
+
*/
|
|
840
|
+
emitValueChange() {
|
|
841
|
+
const state = parseDOM(this.editorRoot);
|
|
842
|
+
this.valueChange.emit(JSON.stringify(state));
|
|
843
|
+
}
|
|
844
|
+
// Escape HTML
|
|
845
|
+
escapeHtml(text) {
|
|
846
|
+
const div = document.createElement('div');
|
|
847
|
+
div.textContent = text;
|
|
848
|
+
return div.innerHTML;
|
|
849
|
+
}
|
|
850
|
+
// Filter slash commands
|
|
851
|
+
getFilteredSlashCommands() {
|
|
852
|
+
if (!this._slashFilter) {
|
|
853
|
+
return this.slashCommands;
|
|
854
|
+
}
|
|
855
|
+
const filter = this._slashFilter.toLowerCase();
|
|
856
|
+
return this.slashCommands.filter(cmd => cmd.label.toLowerCase().includes(filter) ||
|
|
857
|
+
cmd.id.toLowerCase().includes(filter));
|
|
858
|
+
}
|
|
859
|
+
renderToolbarItem(item) {
|
|
860
|
+
if (item === 'divider') {
|
|
861
|
+
return h("div", { class: "toolbar-divider" });
|
|
862
|
+
}
|
|
863
|
+
if (item.actions) {
|
|
864
|
+
const group = item;
|
|
865
|
+
// Alignment group as dropdown
|
|
866
|
+
if (group.name === 'alignment') {
|
|
867
|
+
const items = group.actions.filter(a => a !== 'divider').map(a => ({
|
|
868
|
+
key: a.type,
|
|
869
|
+
label: a.title || a.type,
|
|
870
|
+
icon: this.getIconSvg(a.type)
|
|
871
|
+
}));
|
|
872
|
+
const isActive = group.actions.some(a => a.type.toLowerCase().includes(this._activeAlignment));
|
|
873
|
+
return (h("x-dropdown", { trigger: "click", menu: { items }, onXOpenChange: (e) => this.handleDropdownOpenChange(e.detail.open), onXMenuClick: (e) => this.handleToolbarAction({ type: e.detail.key }) }, h("x-button", { onMouseDown: (e) => e.preventDefault(), type: "text", size: "small", shape: "round", class: { 'toolbar-btn': true, 'active': isActive } }, this.renderToolbarIcon(('align' + this._activeAlignment.charAt(0).toUpperCase() + this._activeAlignment.slice(1))))));
|
|
874
|
+
}
|
|
875
|
+
// Blocks (Heading) group as dropdown
|
|
876
|
+
if (group.name === 'blocks') {
|
|
877
|
+
const items = group.actions.filter(a => a !== 'divider').map(a => {
|
|
878
|
+
const action = a;
|
|
879
|
+
const level = action.type.startsWith('h') ? action.type.slice(1) : null;
|
|
880
|
+
return {
|
|
881
|
+
key: action.type,
|
|
882
|
+
label: level ? `<h${level} style="margin:0; font-size: 1.1em; line-height: 1.2;">${action.title || action.type}</h${level}>` : (action.title || action.type),
|
|
883
|
+
icon: action.type.startsWith('h') ? `<span class="text-icon">H${level}</span>` : this.getIconSvg(action.type)
|
|
884
|
+
};
|
|
885
|
+
});
|
|
886
|
+
const isActive = group.actions.some(a => a.type === this._activeBlockType);
|
|
887
|
+
return (h("x-dropdown", { trigger: "click", menu: { items }, onXOpenChange: (e) => this.handleDropdownOpenChange(e.detail.open), onXMenuClick: (e) => this.handleToolbarAction({ type: e.detail.key }) }, h("x-button", { onMouseDown: (e) => e.preventDefault(), type: "text", size: "small", shape: "round", class: { 'toolbar-btn': true, 'active': isActive } }, h("span", { class: "text-icon" }, "Heading"))));
|
|
888
|
+
}
|
|
889
|
+
// Typography (Font Family, Font Size)
|
|
890
|
+
if (group.name === 'typography') {
|
|
891
|
+
return (h("div", { class: "toolbar-group" }, group.actions.map(a => {
|
|
892
|
+
if (a === 'divider')
|
|
893
|
+
return h("div", { class: "toolbar-divider" });
|
|
894
|
+
const action = a;
|
|
895
|
+
const menuItems = action.type === 'fontFamily'
|
|
896
|
+
? [
|
|
897
|
+
{ key: 'Arial', label: 'Arial' },
|
|
898
|
+
{ key: 'Georgia', label: 'Georgia' },
|
|
899
|
+
{ key: 'Times New Roman', label: 'Times New Roman' },
|
|
900
|
+
{ key: 'Courier New', label: 'Courier New' }
|
|
901
|
+
]
|
|
902
|
+
: [
|
|
903
|
+
{ key: '12px', label: '12' },
|
|
904
|
+
{ key: '14px', label: '14' },
|
|
905
|
+
{ key: '16px', label: '16' },
|
|
906
|
+
{ key: '18px', label: '18' },
|
|
907
|
+
{ key: '24px', label: '24' },
|
|
908
|
+
{ key: '32px', label: '32' }
|
|
909
|
+
];
|
|
910
|
+
const isActive = false;
|
|
911
|
+
// const currentLabel = action.type === 'fontFamily' ? this._activeFontFamily : this._activeFontSize;
|
|
912
|
+
return (h("x-dropdown", { trigger: "click", menu: { items: menuItems }, onXOpenChange: (e) => this.handleDropdownOpenChange(e.detail.open), onXMenuClick: (e) => this.handleToolbarAction({ type: action.type }, e.detail.key) }, h("x-button", { onMouseDown: (e) => e.preventDefault(), type: "text", size: "small", shape: "round", class: { 'toolbar-btn': true, [action.type]: true, 'active': isActive } }, this.renderToolbarIcon(action.type))));
|
|
913
|
+
})));
|
|
914
|
+
}
|
|
915
|
+
// Insert group as dropdown
|
|
916
|
+
if (group.name === 'insert') {
|
|
917
|
+
const items = group.actions.filter(a => a !== 'divider').map(a => ({
|
|
918
|
+
key: a.type,
|
|
919
|
+
label: a.title || a.type,
|
|
920
|
+
icon: this.getIconSvg(a.type)
|
|
921
|
+
}));
|
|
922
|
+
return (h("x-dropdown", { trigger: "click", menu: { items }, onXOpenChange: (e) => this.handleDropdownOpenChange(e.detail.open), onXMenuClick: (e) => this.handleToolbarAction({ type: e.detail.key }) }, h("x-button", { onMouseDown: (e) => e.preventDefault(), type: "text", size: "small", shape: "round", class: "toolbar-btn" }, h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })))));
|
|
923
|
+
}
|
|
924
|
+
return (h("div", { class: "toolbar-group" }, group.actions.map(action => action === 'divider' ? h("div", { class: "toolbar-divider" }) : this.renderToolbarAction(action))));
|
|
925
|
+
}
|
|
926
|
+
return this.renderToolbarAction(item);
|
|
927
|
+
}
|
|
928
|
+
renderToolbarAction(action) {
|
|
929
|
+
const isActive = this.getToolbarActionState(action.type);
|
|
930
|
+
const isDisabled = this.getToolbarActionDisabled(action.type);
|
|
931
|
+
// Color Picker
|
|
932
|
+
if (action.type === 'textColor' || action.type === 'backgroundColor') {
|
|
933
|
+
return (h("x-color-picker", { size: "small", value: action.type === 'textColor' ? '#000000' : '#ffffff', disabled: isDisabled, onXOpenChange: (e) => this.handleDropdownOpenChange(e.detail.open), onXChange: (e) => {
|
|
934
|
+
const color = e.detail.color.toHexString();
|
|
935
|
+
this.handleToolbarAction({ ...action }, color);
|
|
936
|
+
} }, h("div", { class: { 'toolbar-btn': true, 'active': isActive }, title: action.title }, this.renderToolbarIcon(action.type))));
|
|
937
|
+
}
|
|
938
|
+
// Dropdowns
|
|
939
|
+
if (action.type === 'h1' || action.type === 'h2' || action.type === 'h3') {
|
|
940
|
+
// We'll render Heading as a single dropdown if we encounter h1?
|
|
941
|
+
// Actually, let's keep it simple for now or combine them.
|
|
942
|
+
}
|
|
943
|
+
const type = action.type;
|
|
944
|
+
const isDropdown = ['fontFamily', 'fontSize', 'h1', 'h2', 'h3'].includes(type) || type.startsWith('align');
|
|
945
|
+
if (isDropdown) {
|
|
946
|
+
// For now, let's just use the current button but we'll adapt for dropdowns if they were grouped.
|
|
947
|
+
// But the user said "Toolbar align, Heading, fontFamily, font size, thì sử dụng component dropdown"
|
|
948
|
+
// This implies these should be dropdowns.
|
|
949
|
+
// I'll implement specific renderers for these.
|
|
950
|
+
}
|
|
951
|
+
return (h("x-button", { onMouseDown: (e) => e.preventDefault(), type: "text", size: "small", shape: "round", class: { 'toolbar-btn-wrapper': true, [type]: true, 'active': isActive }, onXClick: (e) => {
|
|
952
|
+
if (e.detail && e.detail.preventDefault)
|
|
953
|
+
e.detail.preventDefault();
|
|
954
|
+
this.handleToolbarAction(action);
|
|
955
|
+
}, title: action.title, disabled: isDisabled }, h("div", { class: "toolbar-btn-inner" }, this.renderToolbarIcon(action.type), action.label && h("span", { class: "toolbar-btn-label" }, action.label))));
|
|
956
|
+
}
|
|
957
|
+
getToolbarActionState(type) {
|
|
958
|
+
switch (type) {
|
|
959
|
+
case 'bold':
|
|
960
|
+
case 'italic':
|
|
961
|
+
case 'underline':
|
|
962
|
+
return this.isFormatActive(type);
|
|
963
|
+
case 'h1':
|
|
964
|
+
case 'h2':
|
|
965
|
+
case 'h3':
|
|
966
|
+
case 'blockquote':
|
|
967
|
+
case 'code':
|
|
968
|
+
return this.getCurrentBlockType() === type;
|
|
969
|
+
case 'paragraph':
|
|
970
|
+
return this.getCurrentBlockType() === 'paragraph';
|
|
971
|
+
default:
|
|
972
|
+
return false;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
getToolbarActionDisabled(type) {
|
|
976
|
+
if (type === 'undo')
|
|
977
|
+
return !this.history.canUndo();
|
|
978
|
+
if (type === 'redo')
|
|
979
|
+
return !this.history.canRedo();
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
handleToolbarAction(action, value) {
|
|
983
|
+
this.restoreRange();
|
|
984
|
+
switch (action.type) {
|
|
985
|
+
case 'bold':
|
|
986
|
+
case 'italic':
|
|
987
|
+
case 'underline':
|
|
988
|
+
case 'strikethrough':
|
|
989
|
+
this.toggleFormat(action.type);
|
|
990
|
+
break;
|
|
991
|
+
case 'h1':
|
|
992
|
+
case 'h2':
|
|
993
|
+
case 'h3':
|
|
994
|
+
case 'h4':
|
|
995
|
+
case 'h5':
|
|
996
|
+
case 'h6':
|
|
997
|
+
this.convertBlock('heading', parseInt(action.type.slice(1)));
|
|
998
|
+
break;
|
|
999
|
+
case 'blockquote':
|
|
1000
|
+
case 'code':
|
|
1001
|
+
case 'paragraph':
|
|
1002
|
+
this.convertBlock(action.type);
|
|
1003
|
+
break;
|
|
1004
|
+
case 'alignLeft':
|
|
1005
|
+
case 'alignCenter':
|
|
1006
|
+
case 'alignRight':
|
|
1007
|
+
case 'alignJustify':
|
|
1008
|
+
document.execCommand('justify' + action.type.replace('align', ''), false);
|
|
1009
|
+
break;
|
|
1010
|
+
case 'indent':
|
|
1011
|
+
document.execCommand('indent', false);
|
|
1012
|
+
break;
|
|
1013
|
+
case 'outdent':
|
|
1014
|
+
document.execCommand('outdent', false);
|
|
1015
|
+
break;
|
|
1016
|
+
case 'hr':
|
|
1017
|
+
document.execCommand('insertHorizontalRule', false);
|
|
1018
|
+
break;
|
|
1019
|
+
case 'link':
|
|
1020
|
+
case 'image':
|
|
1021
|
+
case 'video':
|
|
1022
|
+
case 'file':
|
|
1023
|
+
case 'table':
|
|
1024
|
+
this._activeModal = action.type;
|
|
1025
|
+
this._modalData = {};
|
|
1026
|
+
break;
|
|
1027
|
+
case 'textColor':
|
|
1028
|
+
if (value)
|
|
1029
|
+
document.execCommand('foreColor', false, value);
|
|
1030
|
+
break;
|
|
1031
|
+
case 'backgroundColor':
|
|
1032
|
+
if (value) {
|
|
1033
|
+
if (!document.execCommand('hiliteColor', false, value)) {
|
|
1034
|
+
document.execCommand('backColor', false, value);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
break;
|
|
1038
|
+
case 'fontFamily':
|
|
1039
|
+
if (value)
|
|
1040
|
+
document.execCommand('fontName', false, value);
|
|
1041
|
+
break;
|
|
1042
|
+
case 'fontSize':
|
|
1043
|
+
if (value) {
|
|
1044
|
+
const sizeMap = { '12px': '2', '14px': '3', '16px': '4', '18px': '5', '24px': '6', '32px': '7' };
|
|
1045
|
+
document.execCommand('fontSize', false, sizeMap[value] || '3');
|
|
1046
|
+
}
|
|
1047
|
+
break;
|
|
1048
|
+
case 'undo':
|
|
1049
|
+
this.undo();
|
|
1050
|
+
break;
|
|
1051
|
+
case 'redo':
|
|
1052
|
+
this.redo();
|
|
1053
|
+
break;
|
|
1054
|
+
}
|
|
1055
|
+
// Focus back to editor and restore selection
|
|
1056
|
+
this.restoreRange();
|
|
1057
|
+
this._toolbarSavedSelection = null; // Clear after use
|
|
1058
|
+
setTimeout(() => {
|
|
1059
|
+
this.updateActiveStates();
|
|
1060
|
+
this.saveToHistory();
|
|
1061
|
+
this.emitValueChange();
|
|
1062
|
+
}, 0);
|
|
1063
|
+
}
|
|
1064
|
+
getIconSvg(type) {
|
|
1065
|
+
const svgs = {
|
|
1066
|
+
bold: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M15.6 11.8c1-.7 1.6-1.8 1.6-2.8 0-2.5-2-4.5-4.5-4.5H7v14h7c2.2 0 4-1.8 4-4 0-1.2-.6-2.2-1.4-2.7zM10 7.5h2.5c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5H10v-3zm3.5 9H10v-3h3.5c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5z"/></svg>',
|
|
1067
|
+
italic: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M10 5v3h2.2l-3.4 8H6v3h8v-3h-2.2l3.4-8H18V5h-8z"/></svg>',
|
|
1068
|
+
underline: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M12 17c3.3 0 6-2.7 6-6V3h-2.5v8c0 1.9-1.6 3.5-3.5 3.5S8.5 12.9 8.5 11V3H6v8c0 3.3 2.7 6 6 6zm-7 2v2h14v-2H5z"/></svg>',
|
|
1069
|
+
alignLeft: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"/></svg>',
|
|
1070
|
+
alignCenter: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M7 15v2h10v-2H7zm-4 4v2h18v-2H3zm0-16v2h18V3H3zm4 4v2h10V7H7zm-4 4v2h18v-2H3z"/></svg>',
|
|
1071
|
+
alignRight: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M21 15H9v2h12v-2zM21 7H9v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"/></svg>',
|
|
1072
|
+
alignJustify: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V3H3v2z"/></svg>',
|
|
1073
|
+
link: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',
|
|
1074
|
+
image: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>',
|
|
1075
|
+
video: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/></svg>',
|
|
1076
|
+
file: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/></svg>',
|
|
1077
|
+
table: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"/></svg>',
|
|
1078
|
+
hr: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M19 13H5v-2h14v2z"/></svg>',
|
|
1079
|
+
blockquote: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M6 17h3l2-4V7H5v6h3l-2 4zm8 0h3l2-4V7h-6v6h3l-2 4z"/></svg>',
|
|
1080
|
+
code: '<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg>'
|
|
1081
|
+
};
|
|
1082
|
+
return svgs[type] || '';
|
|
1083
|
+
}
|
|
1084
|
+
renderToolbarIcon(type) {
|
|
1085
|
+
switch (type) {
|
|
1086
|
+
case 'bold':
|
|
1087
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M15.6 11.8c1-.7 1.6-1.8 1.6-2.8 0-2.5-2-4.5-4.5-4.5H7v14h7c2.2 0 4-1.8 4-4 0-1.2-.6-2.2-1.4-2.7zM10 7.5h2.5c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5H10v-3zm3.5 9H10v-3h3.5c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5z" }));
|
|
1088
|
+
case 'italic':
|
|
1089
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M10 5v3h2.2l-3.4 8H6v3h8v-3h-2.2l3.4-8H18V5h-8z" }));
|
|
1090
|
+
case 'underline':
|
|
1091
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M12 17c3.3 0 6-2.7 6-6V3h-2.5v8c0 1.9-1.6 3.5-3.5 3.5S8.5 12.9 8.5 11V3H6v8c0 3.3 2.7 6 6 6zm-7 2v2h14v-2H5z" }));
|
|
1092
|
+
case 'h1': return h("span", { class: "text-icon" }, "H1");
|
|
1093
|
+
case 'h2': return h("span", { class: "text-icon" }, "H2");
|
|
1094
|
+
case 'h3': return h("span", { class: "text-icon" }, "H3");
|
|
1095
|
+
case 'h4': return h("span", { class: "text-icon" }, "H4");
|
|
1096
|
+
case 'h5': return h("span", { class: "text-icon" }, "H5");
|
|
1097
|
+
case 'h6': return h("span", { class: "text-icon" }, "H6");
|
|
1098
|
+
case 'blockquote':
|
|
1099
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M6 17h3l2-4V7H5v6h3l-2 4zm8 0h3l2-4V7h-6v6h3l-2 4z" }));
|
|
1100
|
+
case 'code':
|
|
1101
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z" }));
|
|
1102
|
+
case 'undo':
|
|
1103
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M12.5 8c-2.6 0-5 1-6.9 2.6L3 8v9h9l-3.6-3.6c1.3-1.1 3-1.8 4.7-1.8 3.5 0 6.4 2.5 7.1 5.8l2.4-.6c-1-4.2-4.7-7.4-9.1-7.4z" }));
|
|
1104
|
+
case 'redo':
|
|
1105
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M18.4 10.6C16.5 9 14.1 8 11.5 8c-4.4 0-8.1 3.2-9.1 7.4l2.4.6c.7-3.3 3.6-5.8 7.1-5.8 1.7 0 3.4.7 4.7 1.8L13 17h9V8l-2.6 2.6z" }));
|
|
1106
|
+
case 'strikethrough':
|
|
1107
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z" }));
|
|
1108
|
+
case 'alignLeft':
|
|
1109
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z" }));
|
|
1110
|
+
case 'alignCenter':
|
|
1111
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M7 15v2h10v-2H7zm-4 4v2h18v-2H3zm0-16v2h18V3H3zm4 4v2h10V7H7zm-4 4v2h18v-2H3z" }));
|
|
1112
|
+
case 'alignRight':
|
|
1113
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M21 15H9v2h12v-2zM21 7H9v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z" }));
|
|
1114
|
+
case 'alignJustify':
|
|
1115
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V3H3v2z" }));
|
|
1116
|
+
case 'indent':
|
|
1117
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" }));
|
|
1118
|
+
case 'outdent':
|
|
1119
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M11 17h10v-2H11v2zM7 16V8l-4 4 4 4zm-4 5h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" }));
|
|
1120
|
+
case 'link':
|
|
1121
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z" }));
|
|
1122
|
+
case 'image':
|
|
1123
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" }));
|
|
1124
|
+
case 'video':
|
|
1125
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z" }));
|
|
1126
|
+
case 'file':
|
|
1127
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z" }));
|
|
1128
|
+
case 'table':
|
|
1129
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z" }));
|
|
1130
|
+
case 'hr':
|
|
1131
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M19 13H5v-2h14v2z" }));
|
|
1132
|
+
case 'textColor':
|
|
1133
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62zM4 20v2h16v-2H4z" }));
|
|
1134
|
+
case 'backgroundColor':
|
|
1135
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M16.56 8.94L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10L10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5zM2 20h20v4H2v-4z" }));
|
|
1136
|
+
case 'fontFamily':
|
|
1137
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z" }));
|
|
1138
|
+
case 'fontSize':
|
|
1139
|
+
return h("svg", { viewBox: "0 0 24 24", width: "18", height: "18" }, h("path", { fill: "currentColor", d: "M9 4v3h5v12h3V7h5V4H9zm-6 8h3v7h3v-7h3V9H3v3z" }));
|
|
1140
|
+
default: return type;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
renderModal() {
|
|
1144
|
+
if (!this._activeModal)
|
|
1145
|
+
return null;
|
|
1146
|
+
let title = 'Insert';
|
|
1147
|
+
let content = null;
|
|
1148
|
+
switch (this._activeModal) {
|
|
1149
|
+
case 'link':
|
|
1150
|
+
title = 'Insert Link';
|
|
1151
|
+
content = (h("div", { class: "modal-form" }, h("div", { class: "form-item" }, h("label", null, "Link URL"), h("x-input", { placeholder: "https://example.com", value: this._modalData.url, onXChange: (e) => {
|
|
1152
|
+
this._modalData = { ...this._modalData, url: e.detail.value };
|
|
1153
|
+
} }))));
|
|
1154
|
+
break;
|
|
1155
|
+
case 'image':
|
|
1156
|
+
title = 'Insert Image';
|
|
1157
|
+
content = (h("div", { class: "modal-form" }, h("div", { class: "form-item" }, h("label", null, "Image URL"), h("x-input", { placeholder: "https://example.com/image.png", value: this._modalData.url, onXChange: (e) => {
|
|
1158
|
+
this._modalData = { ...this._modalData, url: e.detail.value };
|
|
1159
|
+
} }))));
|
|
1160
|
+
break;
|
|
1161
|
+
case 'video':
|
|
1162
|
+
title = 'Insert Video';
|
|
1163
|
+
content = (h("div", { class: "modal-form" }, h("div", { class: "form-item" }, h("label", null, "Video Embed URL"), h("x-input", { placeholder: "https://www.youtube.com/embed/...", value: this._modalData.url, onXChange: (e) => {
|
|
1164
|
+
this._modalData = { ...this._modalData, url: e.detail.value };
|
|
1165
|
+
} }))));
|
|
1166
|
+
break;
|
|
1167
|
+
case 'table':
|
|
1168
|
+
title = 'Insert Table';
|
|
1169
|
+
content = (h("div", { class: "modal-form" }, h("div", { class: "form-item" }, h("label", null, "Rows"), h("x-input-number", { placeholder: "Rows", min: 1, value: this._modalData.rows || 3, onXChange: (e) => {
|
|
1170
|
+
this._modalData = { ...this._modalData, rows: e.detail.value };
|
|
1171
|
+
} })), h("div", { class: "form-item" }, h("label", null, "Columns"), h("x-input-number", { placeholder: "Columns", min: 1, value: this._modalData.cols || 3, onXChange: (e) => {
|
|
1172
|
+
this._modalData = { ...this._modalData, cols: e.detail.value };
|
|
1173
|
+
} }))));
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
1176
|
+
return (h("x-modal", { visible: !!this._activeModal, modalTitle: title, onXOk: () => this.handleModalOk(), onXCancel: () => this._activeModal = null }, content));
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Handles the 'OK' action from insertion modals (Link, Image, etc.).
|
|
1180
|
+
* Logic:
|
|
1181
|
+
* 1. Consumes the modal data.
|
|
1182
|
+
* 2. Executes the corresponding `execCommand` or custom HTML insertion.
|
|
1183
|
+
* 3. Closes the modal and updates editor history.
|
|
1184
|
+
*/
|
|
1185
|
+
handleModalOk() {
|
|
1186
|
+
this.restoreRange();
|
|
1187
|
+
const type = this._activeModal;
|
|
1188
|
+
const data = this._modalData;
|
|
1189
|
+
this._activeModal = null;
|
|
1190
|
+
switch (type) {
|
|
1191
|
+
case 'link':
|
|
1192
|
+
if (data.url)
|
|
1193
|
+
document.execCommand('createLink', false, data.url);
|
|
1194
|
+
break;
|
|
1195
|
+
case 'image':
|
|
1196
|
+
if (data.url)
|
|
1197
|
+
document.execCommand('insertImage', false, data.url);
|
|
1198
|
+
break;
|
|
1199
|
+
case 'video':
|
|
1200
|
+
if (data.url) {
|
|
1201
|
+
const videoHtml = `<iframe width="100%" height="315" src="${data.url}" frameborder="0" allowfullscreen></iframe><p><br></p>`;
|
|
1202
|
+
document.execCommand('insertHTML', false, videoHtml);
|
|
1203
|
+
}
|
|
1204
|
+
break;
|
|
1205
|
+
case 'table': {
|
|
1206
|
+
const rows = data.rows || 3;
|
|
1207
|
+
const cols = data.cols || 3;
|
|
1208
|
+
let tableHtml = '<table border="1" style="width:100%; border-collapse: collapse;">';
|
|
1209
|
+
for (let i = 0; i < rows; i++) {
|
|
1210
|
+
tableHtml += '<tr>';
|
|
1211
|
+
for (let j = 0; j < cols; j++) {
|
|
1212
|
+
tableHtml += '<td style="padding: 8px; border: 1px solid #ddd;"> </td>';
|
|
1213
|
+
}
|
|
1214
|
+
tableHtml += '</tr>';
|
|
1215
|
+
}
|
|
1216
|
+
tableHtml += '</table><p><br></p>';
|
|
1217
|
+
document.execCommand('insertHTML', false, tableHtml);
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
this.updateActiveStates();
|
|
1222
|
+
this.saveToHistory();
|
|
1223
|
+
this.emitValueChange();
|
|
1224
|
+
}
|
|
1225
|
+
render() {
|
|
1226
|
+
return (h(Host, { key: 'e8b30279f566786aea6b0f12fd877a079c3fb2c0' }, h("div", { key: '10727c39d7d0b71cb50f81696623772a1fdc624e', class: "editor-container" }, this.showToolbar && !this.disabled && (h("div", { key: '75ab27cfb4f754d59bc418c79ab63e4f49898bc6', class: "editor-toolbar", onMouseDown: (e) => e.preventDefault() }, this.toolbar.map(item => this.renderToolbarItem(item)))), h("div", { key: 'da9b8193b67f62c22f090a28e1495d08a20edc25', ref: (el) => {
|
|
1227
|
+
this.editorRoot = el;
|
|
1228
|
+
if (el) {
|
|
1229
|
+
this.selectionHelper.setRootElement(el);
|
|
1230
|
+
}
|
|
1231
|
+
}, class: {
|
|
1232
|
+
'editor-content': true,
|
|
1233
|
+
'disabled': this.disabled,
|
|
1234
|
+
}, contentEditable: !this.disabled, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onPaste: this.handlePaste, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd, onMouseUp: this.updateActiveStates, "data-placeholder": this.placeholder }), this._showSlashMenu && (h("div", { key: '85242de39b0eeac2c99735b390926ed9391f7ddf', class: "slash-menu", style: {
|
|
1235
|
+
left: `${this._slashMenuPosition.x}px`,
|
|
1236
|
+
top: `${this._slashMenuPosition.y}px`,
|
|
1237
|
+
} }, this.getFilteredSlashCommands().map((cmd) => (h("div", { class: "slash-menu-item", onClick: () => this.executeSlashCommand(cmd) }, h("div", { class: "slash-menu-icon" }, cmd.icon), h("span", { class: "slash-menu-label" }, cmd.label))))))), this.renderModal()));
|
|
1238
|
+
}
|
|
1239
|
+
static get is() { return "x-editor"; }
|
|
1240
|
+
static get encapsulation() { return "shadow"; }
|
|
1241
|
+
static get originalStyleUrls() {
|
|
1242
|
+
return {
|
|
1243
|
+
"$": ["x-editor.scss"]
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
static get styleUrls() {
|
|
1247
|
+
return {
|
|
1248
|
+
"$": ["x-editor.css"]
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
static get properties() {
|
|
1252
|
+
return {
|
|
1253
|
+
"initialValue": {
|
|
1254
|
+
"type": "string",
|
|
1255
|
+
"mutable": false,
|
|
1256
|
+
"complexType": {
|
|
1257
|
+
"original": "string",
|
|
1258
|
+
"resolved": "string",
|
|
1259
|
+
"references": {}
|
|
1260
|
+
},
|
|
1261
|
+
"required": false,
|
|
1262
|
+
"optional": false,
|
|
1263
|
+
"docs": {
|
|
1264
|
+
"tags": [{
|
|
1265
|
+
"name": "type",
|
|
1266
|
+
"text": "{string}"
|
|
1267
|
+
}, {
|
|
1268
|
+
"name": "example",
|
|
1269
|
+
"text": "<x-editor initialValue=\"<h1>Hello World</h1><p>Start editing...</p>\"></x-editor>"
|
|
1270
|
+
}],
|
|
1271
|
+
"text": "Initial HTML content to be loaded into the editor."
|
|
1272
|
+
},
|
|
1273
|
+
"getter": false,
|
|
1274
|
+
"setter": false,
|
|
1275
|
+
"reflect": false,
|
|
1276
|
+
"attribute": "initial-value",
|
|
1277
|
+
"defaultValue": "''"
|
|
1278
|
+
},
|
|
1279
|
+
"placeholder": {
|
|
1280
|
+
"type": "string",
|
|
1281
|
+
"mutable": false,
|
|
1282
|
+
"complexType": {
|
|
1283
|
+
"original": "string",
|
|
1284
|
+
"resolved": "string",
|
|
1285
|
+
"references": {}
|
|
1286
|
+
},
|
|
1287
|
+
"required": false,
|
|
1288
|
+
"optional": false,
|
|
1289
|
+
"docs": {
|
|
1290
|
+
"tags": [{
|
|
1291
|
+
"name": "type",
|
|
1292
|
+
"text": "{string}"
|
|
1293
|
+
}, {
|
|
1294
|
+
"name": "example",
|
|
1295
|
+
"text": "<x-editor placeholder=\"Type / for commands...\"></x-editor>"
|
|
1296
|
+
}],
|
|
1297
|
+
"text": "Placeholder text displayed when the editor is empty."
|
|
1298
|
+
},
|
|
1299
|
+
"getter": false,
|
|
1300
|
+
"setter": false,
|
|
1301
|
+
"reflect": false,
|
|
1302
|
+
"attribute": "placeholder",
|
|
1303
|
+
"defaultValue": "translate('Editor.placeholder', {}, 'Start typing...')"
|
|
1304
|
+
},
|
|
1305
|
+
"disabled": {
|
|
1306
|
+
"type": "boolean",
|
|
1307
|
+
"mutable": false,
|
|
1308
|
+
"complexType": {
|
|
1309
|
+
"original": "boolean",
|
|
1310
|
+
"resolved": "boolean",
|
|
1311
|
+
"references": {}
|
|
1312
|
+
},
|
|
1313
|
+
"required": false,
|
|
1314
|
+
"optional": false,
|
|
1315
|
+
"docs": {
|
|
1316
|
+
"tags": [{
|
|
1317
|
+
"name": "type",
|
|
1318
|
+
"text": "{boolean}"
|
|
1319
|
+
}, {
|
|
1320
|
+
"name": "default",
|
|
1321
|
+
"text": "false"
|
|
1322
|
+
}],
|
|
1323
|
+
"text": "Whether the editor is in read-only mode."
|
|
1324
|
+
},
|
|
1325
|
+
"getter": false,
|
|
1326
|
+
"setter": false,
|
|
1327
|
+
"reflect": false,
|
|
1328
|
+
"attribute": "disabled",
|
|
1329
|
+
"defaultValue": "false"
|
|
1330
|
+
},
|
|
1331
|
+
"showToolbar": {
|
|
1332
|
+
"type": "boolean",
|
|
1333
|
+
"mutable": false,
|
|
1334
|
+
"complexType": {
|
|
1335
|
+
"original": "boolean",
|
|
1336
|
+
"resolved": "boolean",
|
|
1337
|
+
"references": {}
|
|
1338
|
+
},
|
|
1339
|
+
"required": false,
|
|
1340
|
+
"optional": false,
|
|
1341
|
+
"docs": {
|
|
1342
|
+
"tags": [{
|
|
1343
|
+
"name": "type",
|
|
1344
|
+
"text": "{boolean}"
|
|
1345
|
+
}, {
|
|
1346
|
+
"name": "default",
|
|
1347
|
+
"text": "true"
|
|
1348
|
+
}],
|
|
1349
|
+
"text": "Toggles the visibility of the top toolbar."
|
|
1350
|
+
},
|
|
1351
|
+
"getter": false,
|
|
1352
|
+
"setter": false,
|
|
1353
|
+
"reflect": false,
|
|
1354
|
+
"attribute": "show-toolbar",
|
|
1355
|
+
"defaultValue": "true"
|
|
1356
|
+
},
|
|
1357
|
+
"toolbar": {
|
|
1358
|
+
"type": "unknown",
|
|
1359
|
+
"mutable": false,
|
|
1360
|
+
"complexType": {
|
|
1361
|
+
"original": "ToolbarConfig",
|
|
1362
|
+
"resolved": "(\"divider\" | ToolbarAction | ToolbarGroup)[]",
|
|
1363
|
+
"references": {
|
|
1364
|
+
"ToolbarConfig": {
|
|
1365
|
+
"location": "import",
|
|
1366
|
+
"path": "./types",
|
|
1367
|
+
"id": "src/components/x-editor/types.ts::ToolbarConfig",
|
|
1368
|
+
"referenceLocation": "ToolbarConfig"
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
"required": false,
|
|
1373
|
+
"optional": false,
|
|
1374
|
+
"docs": {
|
|
1375
|
+
"tags": [{
|
|
1376
|
+
"name": "type",
|
|
1377
|
+
"text": "{ToolbarConfig}"
|
|
1378
|
+
}],
|
|
1379
|
+
"text": "Configuration for the toolbar groups and actions.\r\nAllows customizing which tools are available to the user."
|
|
1380
|
+
},
|
|
1381
|
+
"getter": false,
|
|
1382
|
+
"setter": false,
|
|
1383
|
+
"defaultValue": "[\r\n {\r\n name: 'history',\r\n actions: [\r\n { type: 'undo', title: translate('Editor.undo', {}, 'Undo (Ctrl+Z)') },\r\n { type: 'redo', title: translate('Editor.redo', {}, 'Redo (Ctrl+Shift+Z)') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'text',\r\n actions: [\r\n { type: 'bold', title: translate('Editor.bold', {}, 'Bold (Ctrl+B)') },\r\n { type: 'italic', title: translate('Editor.italic', {}, 'Italic (Ctrl+I)') },\r\n { type: 'underline', title: translate('Editor.underline', {}, 'Underline (Ctrl+U)') },\r\n { type: 'strikethrough', title: translate('Editor.strikethrough', {}, 'Strikethrough') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'colors',\r\n actions: [\r\n { type: 'textColor', title: translate('Editor.textColor', {}, 'Text Color') },\r\n { type: 'backgroundColor', title: translate('Editor.backgroundColor', {}, 'Background Color') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'typography',\r\n actions: [\r\n { type: 'fontFamily', title: translate('Editor.fontFamily', {}, 'Font Family') },\r\n { type: 'fontSize', title: translate('Editor.fontSize', {}, 'Font Size') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'blocks',\r\n actions: [\r\n { type: 'h1', title: translate('Editor.h1', {}, 'Heading 1') },\r\n { type: 'h2', title: translate('Editor.h2', {}, 'Heading 2') },\r\n { type: 'h3', title: translate('Editor.h3', {}, 'Heading 3') },\r\n { type: 'h4', title: translate('Editor.h4', {}, 'Heading 4') },\r\n { type: 'h5', title: translate('Editor.h5', {}, 'Heading 5') },\r\n { type: 'h6', title: translate('Editor.h6', {}, 'Heading 6') },\r\n { type: 'paragraph', title: translate('Editor.paragraph', {}, 'Paragraph') },\r\n { type: 'blockquote', title: translate('Editor.blockquote', {}, 'Quote') },\r\n { type: 'code', title: translate('Editor.codeBlock', {}, 'Code Block') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'alignment',\r\n actions: [\r\n { type: 'alignLeft', title: translate('Editor.alignLeft', {}, 'Align Left') },\r\n { type: 'alignCenter', title: translate('Editor.alignCenter', {}, 'Align Center') },\r\n { type: 'alignRight', title: translate('Editor.alignRight', {}, 'Align Right') },\r\n { type: 'alignJustify', title: translate('Editor.alignJustify', {}, 'Align Justify') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'indentation',\r\n actions: [\r\n { type: 'outdent', title: translate('Editor.outdent', {}, 'Decrease Indent') },\r\n { type: 'indent', title: translate('Editor.indent', {}, 'Increase Indent') },\r\n ]\r\n },\r\n 'divider',\r\n {\r\n name: 'insert',\r\n actions: [\r\n { type: 'link', title: translate('Editor.insertLink', {}, 'Insert Link') },\r\n { type: 'image', title: translate('Editor.insertImage', {}, 'Insert Image') },\r\n { type: 'video', title: translate('Editor.insertVideo', {}, 'Insert Video') },\r\n { type: 'file', title: translate('Editor.insertFile', {}, 'Insert File') },\r\n { type: 'table', title: translate('Editor.insertTable', {}, 'Insert Table') },\r\n { type: 'hr', title: translate('Editor.horizontalLine', {}, 'Horizontal Line') },\r\n ]\r\n },\r\n ]"
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
static get states() {
|
|
1388
|
+
return {
|
|
1389
|
+
"_showSlashMenu": {},
|
|
1390
|
+
"_slashMenuPosition": {},
|
|
1391
|
+
"_slashFilter": {},
|
|
1392
|
+
"_activeFormats": {},
|
|
1393
|
+
"_activeBlockType": {},
|
|
1394
|
+
"_activeModal": {},
|
|
1395
|
+
"_modalData": {},
|
|
1396
|
+
"_activeAlignment": {}
|
|
1397
|
+
};
|
|
1398
|
+
}
|
|
1399
|
+
static get events() {
|
|
1400
|
+
return [{
|
|
1401
|
+
"method": "valueChange",
|
|
1402
|
+
"name": "valueChange",
|
|
1403
|
+
"bubbles": true,
|
|
1404
|
+
"cancelable": true,
|
|
1405
|
+
"composed": true,
|
|
1406
|
+
"docs": {
|
|
1407
|
+
"tags": [],
|
|
1408
|
+
"text": "Emit value change events"
|
|
1409
|
+
},
|
|
1410
|
+
"complexType": {
|
|
1411
|
+
"original": "string",
|
|
1412
|
+
"resolved": "string",
|
|
1413
|
+
"references": {}
|
|
1414
|
+
}
|
|
1415
|
+
}];
|
|
1416
|
+
}
|
|
1417
|
+
static get methods() {
|
|
1418
|
+
return {
|
|
1419
|
+
"getState": {
|
|
1420
|
+
"complexType": {
|
|
1421
|
+
"signature": "() => Promise<EditorState>",
|
|
1422
|
+
"parameters": [],
|
|
1423
|
+
"references": {
|
|
1424
|
+
"Promise": {
|
|
1425
|
+
"location": "global",
|
|
1426
|
+
"id": "global::Promise"
|
|
1427
|
+
},
|
|
1428
|
+
"EditorState": {
|
|
1429
|
+
"location": "import",
|
|
1430
|
+
"path": "./types",
|
|
1431
|
+
"id": "src/components/x-editor/types.ts::EditorState",
|
|
1432
|
+
"referenceLocation": "EditorState"
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
"return": "Promise<EditorState>"
|
|
1436
|
+
},
|
|
1437
|
+
"docs": {
|
|
1438
|
+
"text": "Retrieves the current editor state as a structured object.\r\nThis includes the block hierarchy and formatting metadata.",
|
|
1439
|
+
"tags": [{
|
|
1440
|
+
"name": "returns",
|
|
1441
|
+
"text": "The parsed state object."
|
|
1442
|
+
}]
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
"setState": {
|
|
1446
|
+
"complexType": {
|
|
1447
|
+
"signature": "(state: EditorState) => Promise<void>",
|
|
1448
|
+
"parameters": [{
|
|
1449
|
+
"name": "state",
|
|
1450
|
+
"type": "EditorState",
|
|
1451
|
+
"docs": "- The state object to apply."
|
|
1452
|
+
}],
|
|
1453
|
+
"references": {
|
|
1454
|
+
"Promise": {
|
|
1455
|
+
"location": "global",
|
|
1456
|
+
"id": "global::Promise"
|
|
1457
|
+
},
|
|
1458
|
+
"EditorState": {
|
|
1459
|
+
"location": "import",
|
|
1460
|
+
"path": "./types",
|
|
1461
|
+
"id": "src/components/x-editor/types.ts::EditorState",
|
|
1462
|
+
"referenceLocation": "EditorState"
|
|
1463
|
+
}
|
|
1464
|
+
},
|
|
1465
|
+
"return": "Promise<void>"
|
|
1466
|
+
},
|
|
1467
|
+
"docs": {
|
|
1468
|
+
"text": "Reconstructs the editor content from a provided state object.",
|
|
1469
|
+
"tags": [{
|
|
1470
|
+
"name": "param",
|
|
1471
|
+
"text": "state - The state object to apply."
|
|
1472
|
+
}, {
|
|
1473
|
+
"name": "returns",
|
|
1474
|
+
"text": undefined
|
|
1475
|
+
}]
|
|
1476
|
+
}
|
|
1477
|
+
},
|
|
1478
|
+
"getHTML": {
|
|
1479
|
+
"complexType": {
|
|
1480
|
+
"signature": "() => Promise<string>",
|
|
1481
|
+
"parameters": [],
|
|
1482
|
+
"references": {
|
|
1483
|
+
"Promise": {
|
|
1484
|
+
"location": "global",
|
|
1485
|
+
"id": "global::Promise"
|
|
1486
|
+
}
|
|
1487
|
+
},
|
|
1488
|
+
"return": "Promise<string>"
|
|
1489
|
+
},
|
|
1490
|
+
"docs": {
|
|
1491
|
+
"text": "Retrieves the current RAW HTML content of the editor.",
|
|
1492
|
+
"tags": [{
|
|
1493
|
+
"name": "returns",
|
|
1494
|
+
"text": "The HTML string."
|
|
1495
|
+
}]
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
"setHTML": {
|
|
1499
|
+
"complexType": {
|
|
1500
|
+
"signature": "(html: string) => Promise<void>",
|
|
1501
|
+
"parameters": [{
|
|
1502
|
+
"name": "html",
|
|
1503
|
+
"type": "string",
|
|
1504
|
+
"docs": "- The new HTML content."
|
|
1505
|
+
}],
|
|
1506
|
+
"references": {
|
|
1507
|
+
"Promise": {
|
|
1508
|
+
"location": "global",
|
|
1509
|
+
"id": "global::Promise"
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
"return": "Promise<void>"
|
|
1513
|
+
},
|
|
1514
|
+
"docs": {
|
|
1515
|
+
"text": "Replaces the entire editor content with the provided HTML string.\r\nContent is automatically normalized after insertion.",
|
|
1516
|
+
"tags": [{
|
|
1517
|
+
"name": "param",
|
|
1518
|
+
"text": "html - The new HTML content."
|
|
1519
|
+
}, {
|
|
1520
|
+
"name": "returns",
|
|
1521
|
+
"text": undefined
|
|
1522
|
+
}]
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
"focusEditor": {
|
|
1526
|
+
"complexType": {
|
|
1527
|
+
"signature": "() => Promise<void>",
|
|
1528
|
+
"parameters": [],
|
|
1529
|
+
"references": {
|
|
1530
|
+
"Promise": {
|
|
1531
|
+
"location": "global",
|
|
1532
|
+
"id": "global::Promise"
|
|
1533
|
+
}
|
|
1534
|
+
},
|
|
1535
|
+
"return": "Promise<void>"
|
|
1536
|
+
},
|
|
1537
|
+
"docs": {
|
|
1538
|
+
"text": "Programmatically sets focus to the editor root element.",
|
|
1539
|
+
"tags": [{
|
|
1540
|
+
"name": "returns",
|
|
1541
|
+
"text": undefined
|
|
1542
|
+
}]
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1545
|
+
"clear": {
|
|
1546
|
+
"complexType": {
|
|
1547
|
+
"signature": "() => Promise<void>",
|
|
1548
|
+
"parameters": [],
|
|
1549
|
+
"references": {
|
|
1550
|
+
"Promise": {
|
|
1551
|
+
"location": "global",
|
|
1552
|
+
"id": "global::Promise"
|
|
1553
|
+
}
|
|
1554
|
+
},
|
|
1555
|
+
"return": "Promise<void>"
|
|
1556
|
+
},
|
|
1557
|
+
"docs": {
|
|
1558
|
+
"text": "Resets the editor to its empty state (single paragraph) and clears history.",
|
|
1559
|
+
"tags": [{
|
|
1560
|
+
"name": "returns",
|
|
1561
|
+
"text": undefined
|
|
1562
|
+
}]
|
|
1563
|
+
}
|
|
1564
|
+
},
|
|
1565
|
+
"undo": {
|
|
1566
|
+
"complexType": {
|
|
1567
|
+
"signature": "() => Promise<void>",
|
|
1568
|
+
"parameters": [],
|
|
1569
|
+
"references": {
|
|
1570
|
+
"Promise": {
|
|
1571
|
+
"location": "global",
|
|
1572
|
+
"id": "global::Promise"
|
|
1573
|
+
}
|
|
1574
|
+
},
|
|
1575
|
+
"return": "Promise<void>"
|
|
1576
|
+
},
|
|
1577
|
+
"docs": {
|
|
1578
|
+
"text": "Undo last action",
|
|
1579
|
+
"tags": []
|
|
1580
|
+
}
|
|
1581
|
+
},
|
|
1582
|
+
"redo": {
|
|
1583
|
+
"complexType": {
|
|
1584
|
+
"signature": "() => Promise<void>",
|
|
1585
|
+
"parameters": [],
|
|
1586
|
+
"references": {
|
|
1587
|
+
"Promise": {
|
|
1588
|
+
"location": "global",
|
|
1589
|
+
"id": "global::Promise"
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
"return": "Promise<void>"
|
|
1593
|
+
},
|
|
1594
|
+
"docs": {
|
|
1595
|
+
"text": "Redo last undone action",
|
|
1596
|
+
"tags": []
|
|
1597
|
+
}
|
|
1598
|
+
},
|
|
1599
|
+
"canUndo": {
|
|
1600
|
+
"complexType": {
|
|
1601
|
+
"signature": "() => Promise<boolean>",
|
|
1602
|
+
"parameters": [],
|
|
1603
|
+
"references": {
|
|
1604
|
+
"Promise": {
|
|
1605
|
+
"location": "global",
|
|
1606
|
+
"id": "global::Promise"
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1609
|
+
"return": "Promise<boolean>"
|
|
1610
|
+
},
|
|
1611
|
+
"docs": {
|
|
1612
|
+
"text": "Check if undo is available",
|
|
1613
|
+
"tags": []
|
|
1614
|
+
}
|
|
1615
|
+
},
|
|
1616
|
+
"canRedo": {
|
|
1617
|
+
"complexType": {
|
|
1618
|
+
"signature": "() => Promise<boolean>",
|
|
1619
|
+
"parameters": [],
|
|
1620
|
+
"references": {
|
|
1621
|
+
"Promise": {
|
|
1622
|
+
"location": "global",
|
|
1623
|
+
"id": "global::Promise"
|
|
1624
|
+
}
|
|
1625
|
+
},
|
|
1626
|
+
"return": "Promise<boolean>"
|
|
1627
|
+
},
|
|
1628
|
+
"docs": {
|
|
1629
|
+
"text": "Check if redo is available",
|
|
1630
|
+
"tags": []
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
}
|
|
1635
|
+
static get elementRef() { return "el"; }
|
|
1636
|
+
}
|