@youcan/celeste 0.6.73 → 0.6.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/celeste.css +233 -201
- package/dist/cjs/alert.js +33 -33
- package/dist/cjs/badge.js +17 -14
- package/dist/cjs/button.js +6 -6
- package/dist/cjs/checkbox-card.js +33 -33
- package/dist/cjs/checkbox-label.js +31 -31
- package/dist/cjs/chunks/alpha-slider.js +12 -12
- package/dist/cjs/chunks/checkbox.js +7 -7
- package/dist/cjs/chunks/collapsible-content.js +6 -6
- package/dist/cjs/chunks/collapsible-trigger.js +5 -5
- package/dist/cjs/chunks/collapsible.js +6 -6
- package/dist/cjs/chunks/combobox-anchor.js +8 -8
- package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +15 -15
- package/dist/cjs/chunks/counter-input.js +13 -13
- package/dist/cjs/chunks/dropdown-menu-sub.js +6 -6
- package/dist/cjs/chunks/index.js +2292 -2289
- package/dist/cjs/chunks/index2.js +14 -14
- package/dist/cjs/chunks/index3.js +28 -28
- package/dist/cjs/chunks/index4.js +125 -96
- package/dist/cjs/chunks/index5.js +4720 -4015
- package/dist/cjs/chunks/modal-close.js +5 -5
- package/dist/cjs/chunks/modal-trigger.js +5 -5
- package/dist/cjs/chunks/modal.js +6 -6
- package/dist/cjs/chunks/pagination-first.js +9 -9
- package/dist/cjs/chunks/pagination-item.js +6 -6
- package/dist/cjs/chunks/pagination-last.js +9 -9
- package/dist/cjs/chunks/pagination-next.js +9 -9
- package/dist/cjs/chunks/pagination-previous.js +9 -9
- package/dist/cjs/chunks/popover.js +6 -6
- package/dist/cjs/chunks/radio-group-item.js +7 -7
- package/dist/cjs/chunks/radio-group.js +8 -8
- package/dist/cjs/chunks/rich-editor.vue_vue_type_style_index_0_scoped_dbc85b1a_lang.js +742 -45
- package/dist/cjs/chunks/select-group.js +5 -5
- package/dist/cjs/chunks/select.js +7 -7
- package/dist/cjs/chunks/sheet-trigger.js +5 -5
- package/dist/cjs/chunks/sheet.js +6 -6
- package/dist/cjs/chunks/sidebar-content.js +5 -5
- package/dist/cjs/chunks/sidebar-element.js +6 -6
- package/dist/cjs/chunks/sidebar-footer.js +5 -5
- package/dist/cjs/chunks/sidebar-group-label.js +6 -6
- package/dist/cjs/chunks/sidebar-group.js +5 -5
- package/dist/cjs/chunks/sidebar-header.js +5 -5
- package/dist/cjs/chunks/sidebar-menu-action.js +6 -6
- package/dist/cjs/chunks/sidebar-menu-badge.js +4 -4
- package/dist/cjs/chunks/sidebar-menu-button.js +7 -7
- package/dist/cjs/chunks/sidebar-menu-item.js +5 -5
- package/dist/cjs/chunks/sidebar-menu-sub-button.js +6 -6
- package/dist/cjs/chunks/sidebar-menu-sub-item.js +5 -5
- package/dist/cjs/chunks/sidebar-menu-sub.js +5 -5
- package/dist/cjs/chunks/sidebar-menu.js +5 -5
- package/dist/cjs/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +9 -9
- package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +5 -4
- package/dist/cjs/chunks/sidebar.js +21 -21
- package/dist/cjs/chunks/slider.js +11 -11
- package/dist/cjs/chunks/sonner.js +214 -146
- package/dist/cjs/chunks/switch.js +7 -7
- package/dist/cjs/chunks/tinycolor.js +2 -2
- package/dist/cjs/chunks/tooltip-provider.js +5 -5
- package/dist/cjs/chunks/tooltip-root.js +7 -7
- package/dist/cjs/chunks/tooltip-trigger.js +6 -6
- package/dist/cjs/chunks/tooltip.js +12 -12
- package/dist/cjs/color-area.js +16 -16
- package/dist/cjs/color-picker.js +102 -102
- package/dist/cjs/color-swatch.js +11 -11
- package/dist/cjs/combobox-empty.js +7 -7
- package/dist/cjs/combobox-group.js +11 -11
- package/dist/cjs/combobox-input.js +12 -12
- package/dist/cjs/combobox-item.js +24 -24
- package/dist/cjs/combobox-list.js +12 -12
- package/dist/cjs/combobox-root.js +7 -6
- package/dist/cjs/combobox-separator.js +7 -7
- package/dist/cjs/combobox-trigger.js +8 -8
- package/dist/cjs/combobox.js +54 -53
- package/dist/cjs/command-group.js +10 -10
- package/dist/cjs/command-input.js +8 -8
- package/dist/cjs/command-item.js +7 -7
- package/dist/cjs/command-list.js +8 -8
- package/dist/cjs/command-root.js +8 -7
- package/dist/cjs/command-separator.js +7 -7
- package/dist/cjs/compact-button.js +7 -7
- package/dist/cjs/config.js +2 -2
- package/dist/cjs/digit-input-group.js +7 -7
- package/dist/cjs/digit-input-slot.js +5 -5
- package/dist/cjs/digit-input.js +7 -7
- package/dist/cjs/dropdown-menu-content.js +9 -9
- package/dist/cjs/dropdown-menu-group.js +5 -5
- package/dist/cjs/dropdown-menu-item.js +14 -14
- package/dist/cjs/dropdown-menu-label.js +7 -7
- package/dist/cjs/dropdown-menu-separator.js +4 -4
- package/dist/cjs/dropdown-menu-sub-content.js +9 -9
- package/dist/cjs/dropdown-menu-sub-trigger.js +12 -12
- package/dist/cjs/dropdown-menu-trigger.js +6 -6
- package/dist/cjs/dropdown-menu.js +7 -7
- package/dist/cjs/extra-settings.js +21 -21
- package/dist/cjs/fancy-button.js +6 -6
- package/dist/cjs/file-upload-area.js +22 -22
- package/dist/cjs/hint-text.js +9 -9
- package/dist/cjs/hue-slider.js +15 -15
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/label.js +13 -13
- package/dist/cjs/link-bubble.js +40 -40
- package/dist/cjs/link-button.js +6 -6
- package/dist/cjs/modal-body.js +5 -5
- package/dist/cjs/modal-content.js +12 -12
- package/dist/cjs/modal-footer.js +5 -5
- package/dist/cjs/modal-header.js +22 -22
- package/dist/cjs/pagination-content.js +6 -6
- package/dist/cjs/pagination-ellipsis.js +8 -8
- package/dist/cjs/pagination.js +14 -14
- package/dist/cjs/popover-content.js +30 -30
- package/dist/cjs/popover-trigger.js +5 -5
- package/dist/cjs/progress-bar.js +19 -19
- package/dist/cjs/progress-circle.js +20 -20
- package/dist/cjs/radio-group-card.js +33 -33
- package/dist/cjs/radio-group-label.js +31 -31
- package/dist/cjs/rich-editor.js +76 -76
- package/dist/cjs/scroll-area.js +42 -2
- package/dist/cjs/scroll-bar.js +10 -17
- package/dist/cjs/segmented-control-item.js +6 -8
- package/dist/cjs/segmented-control.js +8 -8
- package/dist/cjs/select-content.js +11 -11
- package/dist/cjs/select-icon.js +5 -5
- package/dist/cjs/select-item.js +11 -11
- package/dist/cjs/select-label.js +6 -6
- package/dist/cjs/select-separator.js +4 -4
- package/dist/cjs/select-trigger.js +9 -9
- package/dist/cjs/select-value.js +6 -6
- package/dist/cjs/sheet-close.js +6 -6
- package/dist/cjs/sheet-content.js +14 -14
- package/dist/cjs/sheet-description.js +7 -7
- package/dist/cjs/sheet-footer.js +6 -6
- package/dist/cjs/sheet-header.js +5 -5
- package/dist/cjs/sheet-title.js +7 -7
- package/dist/cjs/sidebar-group-content.js +5 -5
- package/dist/cjs/sidebar-trigger.js +7 -7
- package/dist/cjs/social-button.js +8 -8
- package/dist/cjs/sonner-alert.js +8 -8
- package/dist/cjs/status-badge.js +8 -8
- package/dist/cjs/tab-menu-content.js +7 -7
- package/dist/cjs/tab-menu-item.js +11 -11
- package/dist/cjs/tab-menu-list.js +6 -6
- package/dist/cjs/tab-menu.js +6 -6
- package/dist/cjs/table-body.js +5 -5
- package/dist/cjs/table-caption.js +5 -5
- package/dist/cjs/table-cell.js +5 -5
- package/dist/cjs/table-empty.js +9 -9
- package/dist/cjs/table-footer.js +5 -5
- package/dist/cjs/table-head.js +5 -5
- package/dist/cjs/table-header.js +5 -5
- package/dist/cjs/table-row.js +8 -8
- package/dist/cjs/table.js +6 -6
- package/dist/cjs/tag.js +10 -10
- package/dist/cjs/text-input-affix.js +5 -5
- package/dist/cjs/text-input-button.js +6 -6
- package/dist/cjs/text-input.js +31 -31
- package/dist/cjs/textarea.js +9 -9
- package/dist/cjs/tooltip-content.js +21 -21
- package/dist/cjs/use-color-model.js +2 -2
- package/dist/cjs/use-delegated-props.js +2 -2
- package/dist/cjs/use-sidebar.js +1 -1
- package/dist/cjs/use-user-select.js +4 -4
- package/dist/components/color-picker/alpha-slider.d.ts +1 -1
- package/dist/components/color-picker/color-area.d.ts +1 -1
- package/dist/components/color-picker/hue-slider.d.ts +1 -1
- package/dist/components/file-upload/file-upload-area.d.ts +4 -2
- package/dist/components/rich-editor/link-bubble.d.ts +3 -1
- package/dist/components/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/scroll-bar.d.ts +1 -1
- package/dist/es/alert.js +2 -2
- package/dist/es/badge.js +6 -3
- package/dist/es/button.js +2 -2
- package/dist/es/checkbox-card.js +3 -3
- package/dist/es/checkbox-label.js +3 -3
- package/dist/es/chunks/alpha-slider.js +1 -1
- package/dist/es/chunks/checkbox.js +5 -5
- package/dist/es/chunks/collapsible-content.js +3 -3
- package/dist/es/chunks/collapsible-trigger.js +3 -3
- package/dist/es/chunks/collapsible.js +4 -4
- package/dist/es/chunks/combobox-anchor.js +4 -4
- package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +3 -3
- package/dist/es/chunks/counter-input.js +7 -7
- package/dist/es/chunks/dropdown-menu-sub.js +4 -4
- package/dist/es/chunks/index.js +1156 -1153
- package/dist/es/chunks/index2.js +3 -3
- package/dist/es/chunks/index3.js +2 -2
- package/dist/es/chunks/index4.js +119 -90
- package/dist/es/chunks/index5.js +4733 -4028
- package/dist/es/chunks/modal-close.js +3 -3
- package/dist/es/chunks/modal-trigger.js +3 -3
- package/dist/es/chunks/modal.js +4 -4
- package/dist/es/chunks/pagination-first.js +4 -4
- package/dist/es/chunks/pagination-item.js +3 -3
- package/dist/es/chunks/pagination-last.js +4 -4
- package/dist/es/chunks/pagination-next.js +4 -4
- package/dist/es/chunks/pagination-previous.js +4 -4
- package/dist/es/chunks/popover.js +4 -4
- package/dist/es/chunks/radio-group-item.js +5 -5
- package/dist/es/chunks/radio-group.js +4 -4
- package/dist/es/chunks/rich-editor.vue_vue_type_style_index_0_scoped_dbc85b1a_lang.js +743 -46
- package/dist/es/chunks/select-group.js +3 -3
- package/dist/es/chunks/select.js +4 -4
- package/dist/es/chunks/sheet-trigger.js +3 -3
- package/dist/es/chunks/sheet.js +4 -4
- package/dist/es/chunks/sidebar-content.js +1 -1
- package/dist/es/chunks/sidebar-element.js +2 -2
- package/dist/es/chunks/sidebar-footer.js +1 -1
- package/dist/es/chunks/sidebar-group-label.js +2 -2
- package/dist/es/chunks/sidebar-group.js +1 -1
- package/dist/es/chunks/sidebar-header.js +1 -1
- package/dist/es/chunks/sidebar-menu-action.js +2 -2
- package/dist/es/chunks/sidebar-menu-badge.js +1 -1
- package/dist/es/chunks/sidebar-menu-button.js +2 -2
- package/dist/es/chunks/sidebar-menu-item.js +1 -1
- package/dist/es/chunks/sidebar-menu-sub-button.js +2 -2
- package/dist/es/chunks/sidebar-menu-sub-item.js +1 -1
- package/dist/es/chunks/sidebar-menu-sub.js +1 -1
- package/dist/es/chunks/sidebar-menu.js +1 -1
- package/dist/es/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +3 -3
- package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +2 -1
- package/dist/es/chunks/sidebar.js +1 -1
- package/dist/es/chunks/slider.js +7 -7
- package/dist/es/chunks/sonner.js +97 -29
- package/dist/es/chunks/switch.js +5 -5
- package/dist/es/chunks/tinycolor.js +2 -2
- package/dist/es/chunks/tooltip-provider.js +3 -3
- package/dist/es/chunks/tooltip-root.js +4 -4
- package/dist/es/chunks/tooltip-trigger.js +4 -4
- package/dist/es/chunks/tooltip.js +3 -3
- package/dist/es/color-area.js +2 -2
- package/dist/es/color-picker.js +5 -5
- package/dist/es/color-swatch.js +1 -1
- package/dist/es/combobox-empty.js +3 -3
- package/dist/es/combobox-group.js +4 -4
- package/dist/es/combobox-input.js +3 -3
- package/dist/es/combobox-item.js +4 -4
- package/dist/es/combobox-list.js +6 -6
- package/dist/es/combobox-root.js +5 -4
- package/dist/es/combobox-separator.js +3 -3
- package/dist/es/combobox-trigger.js +4 -4
- package/dist/es/combobox.js +4 -3
- package/dist/es/command-group.js +4 -4
- package/dist/es/command-input.js +4 -4
- package/dist/es/command-item.js +4 -4
- package/dist/es/command-list.js +4 -4
- package/dist/es/command-root.js +5 -4
- package/dist/es/command-separator.js +3 -3
- package/dist/es/compact-button.js +2 -2
- package/dist/es/digit-input-group.js +3 -3
- package/dist/es/digit-input-slot.js +4 -4
- package/dist/es/digit-input.js +4 -4
- package/dist/es/dropdown-menu-content.js +5 -5
- package/dist/es/dropdown-menu-group.js +3 -3
- package/dist/es/dropdown-menu-item.js +4 -4
- package/dist/es/dropdown-menu-label.js +4 -4
- package/dist/es/dropdown-menu-separator.js +3 -3
- package/dist/es/dropdown-menu-sub-content.js +5 -5
- package/dist/es/dropdown-menu-sub-trigger.js +4 -4
- package/dist/es/dropdown-menu-trigger.js +4 -4
- package/dist/es/dropdown-menu.js +4 -4
- package/dist/es/extra-settings.js +1 -1
- package/dist/es/fancy-button.js +2 -2
- package/dist/es/file-upload-area.js +1 -1
- package/dist/es/hint-text.js +2 -2
- package/dist/es/hue-slider.js +3 -3
- package/dist/es/index.js +90 -90
- package/dist/es/label.js +3 -3
- package/dist/es/link-bubble.js +1 -1
- package/dist/es/link-button.js +2 -2
- package/dist/es/modal-body.js +1 -1
- package/dist/es/modal-content.js +6 -6
- package/dist/es/modal-footer.js +1 -1
- package/dist/es/modal-header.js +5 -5
- package/dist/es/pagination-content.js +3 -3
- package/dist/es/pagination-ellipsis.js +3 -3
- package/dist/es/pagination.js +4 -4
- package/dist/es/popover-content.js +7 -7
- package/dist/es/popover-trigger.js +3 -3
- package/dist/es/progress-bar.js +4 -4
- package/dist/es/progress-circle.js +4 -4
- package/dist/es/radio-group-card.js +3 -3
- package/dist/es/radio-group-label.js +3 -3
- package/dist/es/rich-editor.js +4 -4
- package/dist/es/scroll-area.js +42 -2
- package/dist/es/scroll-bar.js +8 -15
- package/dist/es/segmented-control-item.js +3 -5
- package/dist/es/segmented-control.js +4 -4
- package/dist/es/select-content.js +6 -6
- package/dist/es/select-icon.js +1 -1
- package/dist/es/select-item.js +5 -5
- package/dist/es/select-label.js +3 -3
- package/dist/es/select-separator.js +3 -3
- package/dist/es/select-trigger.js +4 -4
- package/dist/es/select-value.js +3 -3
- package/dist/es/sheet-close.js +3 -3
- package/dist/es/sheet-content.js +7 -7
- package/dist/es/sheet-description.js +3 -3
- package/dist/es/sheet-footer.js +1 -1
- package/dist/es/sheet-header.js +1 -1
- package/dist/es/sheet-title.js +3 -3
- package/dist/es/sidebar-group-content.js +1 -1
- package/dist/es/sidebar-trigger.js +1 -1
- package/dist/es/social-button.js +2 -2
- package/dist/es/sonner-alert.js +1 -1
- package/dist/es/status-badge.js +1 -1
- package/dist/es/tab-menu-content.js +3 -3
- package/dist/es/tab-menu-item.js +4 -4
- package/dist/es/tab-menu-list.js +3 -3
- package/dist/es/tab-menu.js +4 -4
- package/dist/es/table-body.js +1 -1
- package/dist/es/table-caption.js +1 -1
- package/dist/es/table-cell.js +1 -1
- package/dist/es/table-empty.js +1 -1
- package/dist/es/table-footer.js +1 -1
- package/dist/es/table-head.js +1 -1
- package/dist/es/table-header.js +1 -1
- package/dist/es/table-row.js +1 -1
- package/dist/es/table.js +1 -1
- package/dist/es/tag.js +2 -2
- package/dist/es/text-input-affix.js +1 -1
- package/dist/es/text-input-button.js +1 -1
- package/dist/es/text-input.js +2 -2
- package/dist/es/textarea.js +1 -1
- package/dist/es/tooltip-content.js +7 -7
- package/dist/es/use-sidebar.js +2 -2
- package/package.json +3 -3
- package/src/components/alert/alert.vue +1 -1
- package/src/components/badge/badge.vue +5 -1
- package/src/components/hint-text/hint-text.vue +1 -1
- package/src/components/scroll-area/scroll-area.vue +22 -8
- package/src/components/scroll-area/scroll-bar.vue +33 -17
- package/src/components/scroll-area/stories/scroll-area.stories.ts +184 -0
- package/src/components/tooltip/tooltip-content.vue +1 -0
- package/dist/cjs/chunks/scroll-area.js +0 -41
- package/dist/es/chunks/scroll-area.js +0 -42
package/dist/es/chunks/index2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentScope, onScopeDispose,
|
|
1
|
+
import { watch, getCurrentScope, onScopeDispose, getCurrentInstance, hasInjectionContext, inject, computed, isRef, reactive, unref, toRefs, toValue } from "vue";
|
|
2
2
|
function tryOnScopeDispose(fn) {
|
|
3
3
|
if (getCurrentScope()) {
|
|
4
4
|
onScopeDispose(fn);
|
|
@@ -80,9 +80,9 @@ function watchImmediate(source, cb, options) {
|
|
|
80
80
|
}
|
|
81
81
|
export {
|
|
82
82
|
tryOnScopeDispose as a,
|
|
83
|
-
|
|
83
|
+
injectLocal as b,
|
|
84
84
|
isDef as c,
|
|
85
|
-
|
|
85
|
+
isObject as d,
|
|
86
86
|
isClient as i,
|
|
87
87
|
pxValue as p,
|
|
88
88
|
reactiveOmit as r,
|
package/dist/es/chunks/index3.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { p as pxValue, t as toArray, w as watchImmediate, a as tryOnScopeDispose, i as isClient, b as injectLocal, c as isDef, d as isObject } from "./index2.js";
|
|
2
|
+
import { shallowRef, watchEffect, toValue, computed, getCurrentInstance, ref, watch, nextTick, hasInjectionContext, onMounted, unref } from "vue";
|
|
3
3
|
const defaultWindow = isClient ? window : void 0;
|
|
4
4
|
const defaultDocument = isClient ? window.document : void 0;
|
|
5
5
|
function unrefElement(elRef) {
|
package/dist/es/chunks/index4.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as PluginKey, S as Selection, k as keydownHandler, a as SelectionRange, T as TextSelection, F as Fragment, b as Slice, E as Extension, c as Plugin, i as isTextSelection, p as posToDOMRect, g as getText, d as getTextSerializersFromSchema } from "./index5.js";
|
|
2
1
|
import { aN as flip, aO as shift, aP as offset, aQ as arrow$1, aR as size, aS as autoPlacement, aT as hide, aU as inline, aV as computePosition } from "./index.js";
|
|
3
|
-
import {
|
|
2
|
+
import { S as Selection, a as SelectionRange, T as TextSelection, F as Fragment, b as Slice, P as PluginKey, k as keydownHandler, c as Plugin, i as isTextSelection, p as posToDOMRect, N as NodeSelection, g as getText, d as getTextSerializersFromSchema } from "./index5.js";
|
|
3
|
+
import { defineComponent, ref, onMounted, nextTick, onBeforeUnmount, h } from "vue";
|
|
4
4
|
var readFromCache;
|
|
5
5
|
var addToCache;
|
|
6
6
|
if (typeof WeakMap != "undefined") {
|
|
@@ -823,10 +823,13 @@ var BubbleMenuView = class {
|
|
|
823
823
|
updateDelay = 250,
|
|
824
824
|
resizeDelay = 60,
|
|
825
825
|
shouldShow,
|
|
826
|
+
appendTo,
|
|
827
|
+
getReferencedVirtualElement,
|
|
826
828
|
options
|
|
827
829
|
}) {
|
|
828
830
|
this.preventHide = false;
|
|
829
831
|
this.isVisible = false;
|
|
832
|
+
this.scrollTarget = window;
|
|
830
833
|
this.floatingUIOptions = {
|
|
831
834
|
strategy: "absolute",
|
|
832
835
|
placement: "top",
|
|
@@ -872,12 +875,16 @@ var BubbleMenuView = class {
|
|
|
872
875
|
setTimeout(() => this.update(this.editor.view));
|
|
873
876
|
};
|
|
874
877
|
this.blurHandler = ({ event }) => {
|
|
875
|
-
var
|
|
878
|
+
var _a2;
|
|
879
|
+
if (this.editor.isDestroyed) {
|
|
880
|
+
this.destroy();
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
876
883
|
if (this.preventHide) {
|
|
877
884
|
this.preventHide = false;
|
|
878
885
|
return;
|
|
879
886
|
}
|
|
880
|
-
if ((event == null ? void 0 : event.relatedTarget) && ((
|
|
887
|
+
if ((event == null ? void 0 : event.relatedTarget) && ((_a2 = this.element.parentNode) == null ? void 0 : _a2.contains(event.relatedTarget))) {
|
|
881
888
|
return;
|
|
882
889
|
}
|
|
883
890
|
if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
|
|
@@ -912,11 +919,21 @@ var BubbleMenuView = class {
|
|
|
912
919
|
this.updatePosition();
|
|
913
920
|
this.show();
|
|
914
921
|
};
|
|
922
|
+
this.transactionHandler = ({ transaction: tr }) => {
|
|
923
|
+
const meta = tr.getMeta("bubbleMenu");
|
|
924
|
+
if (meta === "updatePosition") {
|
|
925
|
+
this.updatePosition();
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
var _a;
|
|
915
929
|
this.editor = editor;
|
|
916
930
|
this.element = element;
|
|
917
931
|
this.view = view;
|
|
918
932
|
this.updateDelay = updateDelay;
|
|
919
933
|
this.resizeDelay = resizeDelay;
|
|
934
|
+
this.appendTo = appendTo;
|
|
935
|
+
this.scrollTarget = (_a = options == null ? void 0 : options.scrollTarget) != null ? _a : window;
|
|
936
|
+
this.getReferencedVirtualElement = getReferencedVirtualElement;
|
|
920
937
|
this.floatingUIOptions = {
|
|
921
938
|
...this.floatingUIOptions,
|
|
922
939
|
...options
|
|
@@ -929,10 +946,13 @@ var BubbleMenuView = class {
|
|
|
929
946
|
this.view.dom.addEventListener("dragstart", this.dragstartHandler);
|
|
930
947
|
this.editor.on("focus", this.focusHandler);
|
|
931
948
|
this.editor.on("blur", this.blurHandler);
|
|
949
|
+
this.editor.on("transaction", this.transactionHandler);
|
|
932
950
|
window.addEventListener("resize", this.resizeHandler);
|
|
951
|
+
this.scrollTarget.addEventListener("scroll", this.resizeHandler);
|
|
933
952
|
this.update(view, view.state);
|
|
934
953
|
if (this.getShouldShow()) {
|
|
935
954
|
this.show();
|
|
955
|
+
this.updatePosition();
|
|
936
956
|
}
|
|
937
957
|
}
|
|
938
958
|
get middlewares() {
|
|
@@ -973,13 +993,31 @@ var BubbleMenuView = class {
|
|
|
973
993
|
}
|
|
974
994
|
return middlewares;
|
|
975
995
|
}
|
|
976
|
-
|
|
996
|
+
get virtualElement() {
|
|
997
|
+
var _a;
|
|
977
998
|
const { selection } = this.editor.state;
|
|
999
|
+
const referencedVirtualElement = (_a = this.getReferencedVirtualElement) == null ? void 0 : _a.call(this);
|
|
1000
|
+
if (referencedVirtualElement) {
|
|
1001
|
+
return referencedVirtualElement;
|
|
1002
|
+
}
|
|
978
1003
|
const domRect = posToDOMRect(this.view, selection.from, selection.to);
|
|
979
1004
|
let virtualElement = {
|
|
980
1005
|
getBoundingClientRect: () => domRect,
|
|
981
1006
|
getClientRects: () => [domRect]
|
|
982
1007
|
};
|
|
1008
|
+
if (selection instanceof NodeSelection) {
|
|
1009
|
+
let node = this.view.nodeDOM(selection.from);
|
|
1010
|
+
const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector("[data-node-view-wrapper]");
|
|
1011
|
+
if (nodeViewWrapper) {
|
|
1012
|
+
node = nodeViewWrapper;
|
|
1013
|
+
}
|
|
1014
|
+
if (node) {
|
|
1015
|
+
virtualElement = {
|
|
1016
|
+
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
1017
|
+
getClientRects: () => [node.getBoundingClientRect()]
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
983
1021
|
if (selection instanceof CellSelection) {
|
|
984
1022
|
const { $anchorCell, $headCell } = selection;
|
|
985
1023
|
const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
|
|
@@ -998,6 +1036,13 @@ var BubbleMenuView = class {
|
|
|
998
1036
|
getClientRects: () => [clientRect]
|
|
999
1037
|
};
|
|
1000
1038
|
}
|
|
1039
|
+
return virtualElement;
|
|
1040
|
+
}
|
|
1041
|
+
updatePosition() {
|
|
1042
|
+
const virtualElement = this.virtualElement;
|
|
1043
|
+
if (!virtualElement) {
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1001
1046
|
computePosition(virtualElement, this.element, {
|
|
1002
1047
|
placement: this.floatingUIOptions.placement,
|
|
1003
1048
|
strategy: this.floatingUIOptions.strategy,
|
|
@@ -1039,7 +1084,7 @@ var BubbleMenuView = class {
|
|
|
1039
1084
|
from,
|
|
1040
1085
|
to
|
|
1041
1086
|
});
|
|
1042
|
-
return shouldShow;
|
|
1087
|
+
return shouldShow || false;
|
|
1043
1088
|
}
|
|
1044
1089
|
show() {
|
|
1045
1090
|
var _a;
|
|
@@ -1048,7 +1093,8 @@ var BubbleMenuView = class {
|
|
|
1048
1093
|
}
|
|
1049
1094
|
this.element.style.visibility = "visible";
|
|
1050
1095
|
this.element.style.opacity = "1";
|
|
1051
|
-
|
|
1096
|
+
const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
|
|
1097
|
+
(_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
|
|
1052
1098
|
if (this.floatingUIOptions.onShow) {
|
|
1053
1099
|
this.floatingUIOptions.onShow();
|
|
1054
1100
|
}
|
|
@@ -1071,8 +1117,10 @@ var BubbleMenuView = class {
|
|
|
1071
1117
|
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
1072
1118
|
this.view.dom.removeEventListener("dragstart", this.dragstartHandler);
|
|
1073
1119
|
window.removeEventListener("resize", this.resizeHandler);
|
|
1120
|
+
this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
|
|
1074
1121
|
this.editor.off("focus", this.focusHandler);
|
|
1075
1122
|
this.editor.off("blur", this.blurHandler);
|
|
1123
|
+
this.editor.off("transaction", this.transactionHandler);
|
|
1076
1124
|
if (this.floatingUIOptions.onDestroy) {
|
|
1077
1125
|
this.floatingUIOptions.onDestroy();
|
|
1078
1126
|
}
|
|
@@ -1084,34 +1132,9 @@ var BubbleMenuPlugin = (options) => {
|
|
|
1084
1132
|
view: (view) => new BubbleMenuView({ view, ...options })
|
|
1085
1133
|
});
|
|
1086
1134
|
};
|
|
1087
|
-
|
|
1088
|
-
name: "bubbleMenu",
|
|
1089
|
-
addOptions() {
|
|
1090
|
-
return {
|
|
1091
|
-
element: null,
|
|
1092
|
-
pluginKey: "bubbleMenu",
|
|
1093
|
-
updateDelay: void 0,
|
|
1094
|
-
shouldShow: null
|
|
1095
|
-
};
|
|
1096
|
-
},
|
|
1097
|
-
addProseMirrorPlugins() {
|
|
1098
|
-
if (!this.options.element) {
|
|
1099
|
-
return [];
|
|
1100
|
-
}
|
|
1101
|
-
return [
|
|
1102
|
-
BubbleMenuPlugin({
|
|
1103
|
-
pluginKey: this.options.pluginKey,
|
|
1104
|
-
editor: this.editor,
|
|
1105
|
-
element: this.options.element,
|
|
1106
|
-
updateDelay: this.options.updateDelay,
|
|
1107
|
-
options: this.options.options,
|
|
1108
|
-
shouldShow: this.options.shouldShow
|
|
1109
|
-
})
|
|
1110
|
-
];
|
|
1111
|
-
}
|
|
1112
|
-
});
|
|
1113
|
-
var BubbleMenu2 = defineComponent({
|
|
1135
|
+
var BubbleMenu = defineComponent({
|
|
1114
1136
|
name: "BubbleMenu",
|
|
1137
|
+
inheritAttrs: false,
|
|
1115
1138
|
props: {
|
|
1116
1139
|
pluginKey: {
|
|
1117
1140
|
type: [String, Object],
|
|
@@ -1133,32 +1156,54 @@ var BubbleMenu2 = defineComponent({
|
|
|
1133
1156
|
type: Object,
|
|
1134
1157
|
default: () => ({})
|
|
1135
1158
|
},
|
|
1159
|
+
appendTo: {
|
|
1160
|
+
type: Object,
|
|
1161
|
+
default: void 0
|
|
1162
|
+
},
|
|
1136
1163
|
shouldShow: {
|
|
1137
1164
|
type: Function,
|
|
1138
1165
|
default: null
|
|
1166
|
+
},
|
|
1167
|
+
getReferencedVirtualElement: {
|
|
1168
|
+
type: Function,
|
|
1169
|
+
default: void 0
|
|
1139
1170
|
}
|
|
1140
1171
|
},
|
|
1141
|
-
setup(props, { slots }) {
|
|
1172
|
+
setup(props, { slots, attrs }) {
|
|
1142
1173
|
const root = ref(null);
|
|
1143
1174
|
onMounted(() => {
|
|
1144
|
-
const {
|
|
1145
|
-
|
|
1175
|
+
const {
|
|
1176
|
+
editor,
|
|
1177
|
+
options,
|
|
1178
|
+
pluginKey,
|
|
1179
|
+
resizeDelay,
|
|
1180
|
+
appendTo,
|
|
1181
|
+
shouldShow,
|
|
1182
|
+
getReferencedVirtualElement,
|
|
1183
|
+
updateDelay
|
|
1184
|
+
} = props;
|
|
1185
|
+
const el = root.value;
|
|
1186
|
+
if (!el) {
|
|
1146
1187
|
return;
|
|
1147
1188
|
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1189
|
+
el.style.visibility = "hidden";
|
|
1190
|
+
el.style.position = "absolute";
|
|
1191
|
+
el.remove();
|
|
1192
|
+
nextTick(() => {
|
|
1193
|
+
editor.registerPlugin(
|
|
1194
|
+
BubbleMenuPlugin({
|
|
1195
|
+
editor,
|
|
1196
|
+
element: el,
|
|
1197
|
+
options,
|
|
1198
|
+
pluginKey,
|
|
1199
|
+
resizeDelay,
|
|
1200
|
+
appendTo,
|
|
1201
|
+
shouldShow,
|
|
1202
|
+
getReferencedVirtualElement,
|
|
1203
|
+
updateDelay
|
|
1204
|
+
})
|
|
1205
|
+
);
|
|
1206
|
+
});
|
|
1162
1207
|
});
|
|
1163
1208
|
onBeforeUnmount(() => {
|
|
1164
1209
|
const { pluginKey, editor } = props;
|
|
@@ -1166,12 +1211,12 @@ var BubbleMenu2 = defineComponent({
|
|
|
1166
1211
|
});
|
|
1167
1212
|
return () => {
|
|
1168
1213
|
var _a;
|
|
1169
|
-
return h(
|
|
1214
|
+
return h("div", { ref: root, ...attrs }, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
1170
1215
|
};
|
|
1171
1216
|
}
|
|
1172
1217
|
});
|
|
1173
1218
|
var FloatingMenuView = class {
|
|
1174
|
-
constructor({ editor, element, view, options, shouldShow }) {
|
|
1219
|
+
constructor({ editor, element, view, options, appendTo, shouldShow }) {
|
|
1175
1220
|
this.preventHide = false;
|
|
1176
1221
|
this.isVisible = false;
|
|
1177
1222
|
this.shouldShow = ({ view: view2, state }) => {
|
|
@@ -1233,6 +1278,7 @@ var FloatingMenuView = class {
|
|
|
1233
1278
|
this.editor = editor;
|
|
1234
1279
|
this.element = element;
|
|
1235
1280
|
this.view = view;
|
|
1281
|
+
this.appendTo = appendTo;
|
|
1236
1282
|
this.floatingUIOptions = {
|
|
1237
1283
|
...this.floatingUIOptions,
|
|
1238
1284
|
...options
|
|
@@ -1247,6 +1293,7 @@ var FloatingMenuView = class {
|
|
|
1247
1293
|
this.update(view, view.state);
|
|
1248
1294
|
if (this.getShouldShow()) {
|
|
1249
1295
|
this.show();
|
|
1296
|
+
this.updatePosition();
|
|
1250
1297
|
}
|
|
1251
1298
|
}
|
|
1252
1299
|
getTextContent(node) {
|
|
@@ -1340,7 +1387,8 @@ var FloatingMenuView = class {
|
|
|
1340
1387
|
}
|
|
1341
1388
|
this.element.style.visibility = "visible";
|
|
1342
1389
|
this.element.style.opacity = "1";
|
|
1343
|
-
|
|
1390
|
+
const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
|
|
1391
|
+
(_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
|
|
1344
1392
|
if (this.floatingUIOptions.onShow) {
|
|
1345
1393
|
this.floatingUIOptions.onShow();
|
|
1346
1394
|
}
|
|
@@ -1374,33 +1422,9 @@ var FloatingMenuPlugin = (options) => {
|
|
|
1374
1422
|
view: (view) => new FloatingMenuView({ view, ...options })
|
|
1375
1423
|
});
|
|
1376
1424
|
};
|
|
1377
|
-
|
|
1378
|
-
name: "floatingMenu",
|
|
1379
|
-
addOptions() {
|
|
1380
|
-
return {
|
|
1381
|
-
element: null,
|
|
1382
|
-
options: {},
|
|
1383
|
-
pluginKey: "floatingMenu",
|
|
1384
|
-
shouldShow: null
|
|
1385
|
-
};
|
|
1386
|
-
},
|
|
1387
|
-
addProseMirrorPlugins() {
|
|
1388
|
-
if (!this.options.element) {
|
|
1389
|
-
return [];
|
|
1390
|
-
}
|
|
1391
|
-
return [
|
|
1392
|
-
FloatingMenuPlugin({
|
|
1393
|
-
pluginKey: this.options.pluginKey,
|
|
1394
|
-
editor: this.editor,
|
|
1395
|
-
element: this.options.element,
|
|
1396
|
-
options: this.options.options,
|
|
1397
|
-
shouldShow: this.options.shouldShow
|
|
1398
|
-
})
|
|
1399
|
-
];
|
|
1400
|
-
}
|
|
1401
|
-
});
|
|
1402
|
-
var FloatingMenu2 = defineComponent({
|
|
1425
|
+
defineComponent({
|
|
1403
1426
|
name: "FloatingMenu",
|
|
1427
|
+
inheritAttrs: false,
|
|
1404
1428
|
props: {
|
|
1405
1429
|
pluginKey: {
|
|
1406
1430
|
// TODO: TypeScript breaks :(
|
|
@@ -1416,27 +1440,33 @@ var FloatingMenu2 = defineComponent({
|
|
|
1416
1440
|
type: Object,
|
|
1417
1441
|
default: () => ({})
|
|
1418
1442
|
},
|
|
1443
|
+
appendTo: {
|
|
1444
|
+
type: Object,
|
|
1445
|
+
default: void 0
|
|
1446
|
+
},
|
|
1419
1447
|
shouldShow: {
|
|
1420
1448
|
type: Function,
|
|
1421
1449
|
default: null
|
|
1422
1450
|
}
|
|
1423
1451
|
},
|
|
1424
|
-
setup(props, { slots }) {
|
|
1452
|
+
setup(props, { slots, attrs }) {
|
|
1425
1453
|
const root = ref(null);
|
|
1426
1454
|
onMounted(() => {
|
|
1427
|
-
const { pluginKey, editor, options, shouldShow } = props;
|
|
1428
|
-
|
|
1455
|
+
const { pluginKey, editor, options, appendTo, shouldShow } = props;
|
|
1456
|
+
const el = root.value;
|
|
1457
|
+
if (!el) {
|
|
1429
1458
|
return;
|
|
1430
1459
|
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1460
|
+
el.style.visibility = "hidden";
|
|
1461
|
+
el.style.position = "absolute";
|
|
1462
|
+
el.remove();
|
|
1434
1463
|
editor.registerPlugin(
|
|
1435
1464
|
FloatingMenuPlugin({
|
|
1436
1465
|
pluginKey,
|
|
1437
1466
|
editor,
|
|
1438
|
-
element:
|
|
1467
|
+
element: el,
|
|
1439
1468
|
options,
|
|
1469
|
+
appendTo,
|
|
1440
1470
|
shouldShow
|
|
1441
1471
|
})
|
|
1442
1472
|
);
|
|
@@ -1447,11 +1477,10 @@ var FloatingMenu2 = defineComponent({
|
|
|
1447
1477
|
});
|
|
1448
1478
|
return () => {
|
|
1449
1479
|
var _a;
|
|
1450
|
-
return h(
|
|
1480
|
+
return h("div", { ref: root, ...attrs }, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
1451
1481
|
};
|
|
1452
1482
|
}
|
|
1453
1483
|
});
|
|
1454
1484
|
export {
|
|
1455
|
-
|
|
1456
|
-
FloatingMenu2 as FloatingMenu
|
|
1485
|
+
BubbleMenu
|
|
1457
1486
|
};
|