pxd 0.1.6 → 0.1.8
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/components/_internal/mention-editor.d.vue.ts +23 -14
- package/dist/components/_internal/mention-editor.vue +78 -10
- package/dist/components/_internal/tree-node.d.vue.ts +2 -2
- package/dist/components/_internal/tree-node.vue +1 -1
- package/dist/components/active-graph/index.vue +3 -3
- package/dist/components/approval-card/index.d.vue.ts +11 -1
- package/dist/components/approval-card/index.vue +28 -8
- package/dist/components/approval-card/types.d.ts +5 -6
- package/dist/components/avatar/index.vue +1 -1
- package/dist/components/backtop/index.d.vue.ts +1 -1
- package/dist/components/backtop/index.vue +32 -10
- package/dist/components/badge/index.vue +2 -2
- package/dist/components/book/index.vue +1 -1
- package/dist/components/book/types.d.ts +2 -2
- package/dist/components/breadcrumb-item/index.vue +1 -1
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.d.vue.ts +1 -1
- package/dist/components/bubble/index.vue +6 -6
- package/dist/components/bubble/types.d.ts +1 -1
- package/dist/components/bubble-group/index.d.vue.ts +11 -3
- package/dist/components/bubble-group/index.vue +31 -19
- package/dist/components/bubble-group/types.d.ts +1 -0
- package/dist/components/button/index.vue +2 -2
- package/dist/components/button/types.d.ts +2 -2
- package/dist/components/button-group/types.d.ts +2 -2
- package/dist/components/calendar/index.vue +4 -4
- package/dist/components/carousel/types.d.ts +2 -2
- package/dist/components/checkbox/index.vue +1 -1
- package/dist/components/checkbox/types.d.ts +2 -2
- package/dist/components/checkerboard/index.vue +1 -1
- package/dist/components/chip/index.vue +1 -1
- package/dist/components/chip/types.d.ts +2 -2
- package/dist/components/choicebox/types.d.ts +2 -2
- package/dist/components/choicebox-item/index.vue +1 -1
- package/dist/components/choicebox-item/types.d.ts +2 -2
- package/dist/components/code-block/index.vue +12 -12
- package/dist/components/code-block/types.d.ts +2 -2
- package/dist/components/collapse/index.vue +6 -6
- package/dist/components/collapse/types.d.ts +2 -2
- package/dist/components/collapse-group/index.vue +6 -6
- package/dist/components/command-menu/index.d.vue.ts +1 -1
- package/dist/components/command-menu/index.vue +17 -5
- package/dist/components/command-menu/types.d.ts +8 -1
- package/dist/components/config-provider/index.d.vue.ts +3 -0
- package/dist/components/confirm-popover/index.vue +1 -1
- package/dist/components/confirm-popover/types.d.ts +5 -5
- package/dist/components/context-usage/index.vue +13 -6
- package/dist/components/copy-button/index.d.vue.ts +2 -0
- package/dist/components/copy-button/index.vue +7 -3
- package/dist/components/copy-button/types.d.ts +3 -2
- package/dist/components/countdown/index.d.vue.ts +1 -1
- package/dist/components/countdown/index.vue +1 -1
- package/dist/components/date-picker/index.d.vue.ts +11 -1
- package/dist/components/date-picker/index.vue +4 -2
- package/dist/components/description/types.d.ts +2 -2
- package/dist/components/drawer/index.vue +4 -1
- package/dist/components/drawer/types.d.ts +4 -4
- package/dist/components/effort-slider/index.vue +13 -16
- package/dist/components/ellipsis-text/types.d.ts +3 -3
- package/dist/components/empty-state/index.vue +1 -1
- package/dist/components/empty-state/types.d.ts +2 -2
- package/dist/components/error/index.vue +2 -2
- package/dist/components/error/types.d.ts +2 -2
- package/dist/components/feedback-bar/index.vue +4 -4
- package/dist/components/gauge/index.vue +3 -3
- package/dist/components/hint/index.vue +2 -2
- package/dist/components/hold-button/index.d.vue.ts +2 -4
- package/dist/components/hold-button/index.vue +9 -13
- package/dist/components/hold-button/types.d.ts +2 -4
- package/dist/components/hue-text/types.d.ts +2 -2
- package/dist/components/image-preview/index.vue +6 -6
- package/dist/components/input/index.d.vue.ts +6 -6
- package/dist/components/input/index.vue +5 -5
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/kbd/types.d.ts +2 -2
- package/dist/components/link-button/index.d.vue.ts +1 -1
- package/dist/components/link-button/types.d.ts +1 -1
- package/dist/components/list/index.d.vue.ts +2 -1
- package/dist/components/list/index.vue +8 -2
- package/dist/components/list/types.d.ts +16 -8
- package/dist/components/list-group/index.vue +1 -7
- package/dist/components/list-group/types.d.ts +1 -1
- package/dist/components/list-item/index.d.vue.ts +2 -2
- package/dist/components/list-item/index.vue +16 -3
- package/dist/components/list-item/types.d.ts +1 -0
- package/dist/components/loading-mask/types.d.ts +1 -1
- package/dist/components/marching-ants/index.d.vue.ts +1 -1
- package/dist/components/marching-ants/index.vue +2 -2
- package/dist/components/marquee/index.d.vue.ts +3 -3
- package/dist/components/marquee/types.d.ts +2 -2
- package/dist/components/mention/index.d.vue.ts +27 -7
- package/dist/components/mention/index.vue +96 -11
- package/dist/components/mention/types.d.ts +37 -5
- package/dist/components/menu/index.d.vue.ts +3 -1
- package/dist/components/menu/index.vue +4 -0
- package/dist/components/message/index.d.vue.ts +4 -4
- package/dist/components/message/index.vue +3 -3
- package/dist/components/message-item/index.vue +1 -1
- package/dist/components/modal/index.vue +5 -2
- package/dist/components/modal/types.d.ts +4 -4
- package/dist/components/more-button/types.d.ts +2 -2
- package/dist/components/note/index.vue +3 -3
- package/dist/components/note/types.d.ts +3 -3
- package/dist/components/number-input/index.d.vue.ts +4 -4
- package/dist/components/page-number/index.vue +2 -2
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pin-input/index.d.vue.ts +1 -1
- package/dist/components/pin-input/index.vue +1 -1
- package/dist/components/popover/index.vue +111 -100
- package/dist/components/popover/types.d.ts +0 -2
- package/dist/components/progress/index.d.vue.ts +1 -1
- package/dist/components/project-banner/index.vue +3 -3
- package/dist/components/project-banner/types.d.ts +2 -2
- package/dist/components/questionnaire/index.d.vue.ts +1 -1
- package/dist/components/questionnaire/index.vue +110 -46
- package/dist/components/questionnaire/types.d.ts +5 -1
- package/dist/components/radio/index.vue +1 -1
- package/dist/components/radio/types.d.ts +2 -2
- package/dist/components/rating/index.d.vue.ts +1 -1
- package/dist/components/rating/index.vue +1 -0
- package/dist/components/rating/types.d.ts +2 -2
- package/dist/components/reasoning/index.vue +4 -4
- package/dist/components/reasoning/types.d.ts +2 -2
- package/dist/components/resizable/index.d.vue.ts +1 -1
- package/dist/components/resizable/index.vue +34 -30
- package/dist/components/reveal/index.d.vue.ts +1 -1
- package/dist/components/reveal/index.vue +2 -2
- package/dist/components/rolling-number/index.d.vue.ts +1 -1
- package/dist/components/rolling-number/index.vue +6 -6
- package/dist/components/rolling-number/types.d.ts +1 -1
- package/dist/components/scroll-text/index.vue +3 -2
- package/dist/components/scroll-text/types.d.ts +2 -2
- package/dist/components/scrollable/index.vue +1 -6
- package/dist/components/scrollable/types.d.ts +0 -2
- package/dist/components/search-input/index.d.vue.ts +14 -14
- package/dist/components/search-input/index.vue +2 -2
- package/dist/components/select/index.d.vue.ts +8 -4
- package/dist/components/select/index.vue +29 -12
- package/dist/components/select/types.d.ts +9 -1
- package/dist/components/shimmer-text/index.d.vue.ts +2 -2
- package/dist/components/shimmer-text/index.vue +2 -2
- package/dist/components/shimmer-text/types.d.ts +4 -2
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +34 -2
- package/dist/components/snippet/index.d.vue.ts +2 -0
- package/dist/components/snippet/index.vue +6 -2
- package/dist/components/snippet/types.d.ts +3 -2
- package/dist/components/split-button/index.d.vue.ts +10 -6
- package/dist/components/split-button/index.vue +25 -6
- package/dist/components/split-button/types.d.ts +3 -1
- package/dist/components/status-dot/types.d.ts +2 -2
- package/dist/components/steps/types.d.ts +3 -3
- package/dist/components/stick-to-bottom/index.vue +9 -12
- package/dist/components/stick-to-bottom/types.d.ts +0 -2
- package/dist/components/switch/index.vue +1 -1
- package/dist/components/switch-item/types.d.ts +2 -2
- package/dist/components/tabs/index.vue +3 -3
- package/dist/components/teleport/index.vue +6 -3
- package/dist/components/text/index.vue +1 -1
- package/dist/components/text/types.d.ts +1 -1
- package/dist/components/textarea/index.d.vue.ts +6 -6
- package/dist/components/textarea/index.vue +1 -1
- package/dist/components/textarea/types.d.ts +2 -2
- package/dist/components/time-picker/index.d.vue.ts +11 -1
- package/dist/components/time-picker/index.vue +8 -6
- package/dist/components/toc/index.d.vue.ts +4 -1
- package/dist/components/toc/index.vue +72 -10
- package/dist/components/toc/types.d.ts +11 -1
- package/dist/components/todo-list/index.d.vue.ts +1 -1
- package/dist/components/todo-list/index.vue +138 -103
- package/dist/components/todo-list/types.d.ts +7 -5
- package/dist/components/toggle/index.vue +1 -1
- package/dist/components/toggle-button/index.vue +11 -9
- package/dist/components/toggle-button/types.d.ts +3 -3
- package/dist/components/toggle-button-group/index.vue +2 -1
- package/dist/components/toggle-button-group/types.d.ts +2 -2
- package/dist/components/tool-call/index.vue +31 -35
- package/dist/components/tool-call/types.d.ts +2 -2
- package/dist/components/tooltip/index.d.vue.ts +1 -1
- package/dist/components/tour/index.d.vue.ts +3 -3
- package/dist/components/tour/index.vue +1 -1
- package/dist/components/tour/types.d.ts +4 -4
- package/dist/components/tree/index.d.vue.ts +1 -1
- package/dist/components/tree/index.vue +5 -4
- package/dist/components/tree/types.d.ts +4 -5
- package/dist/components/virtual-list/index.d.vue.ts +1 -0
- package/dist/components/virtual-list/index.vue +2 -1
- package/dist/components/virtual-list/types.d.ts +3 -3
- package/dist/composables/_internal/use-details-collapse.js +28 -3
- package/dist/composables/_internal/use-list-search.d.ts +15 -0
- package/dist/composables/_internal/use-list-search.js +50 -0
- package/dist/composables/_internal/use-mention-editor.d.ts +10 -5
- package/dist/composables/_internal/use-mention-editor.js +180 -140
- package/dist/composables/_internal/use-mention-suggest.d.ts +10 -8
- package/dist/composables/_internal/use-mention-suggest.js +39 -25
- package/dist/composables/_internal/use-message-group.js +6 -6
- package/dist/composables/_internal/use-popover-responsive.d.ts +1 -1
- package/dist/composables/_internal/use-popover-responsive.js +1 -1
- package/dist/composables/_internal/use-remote-search.d.ts +17 -0
- package/dist/composables/_internal/use-remote-search.js +58 -0
- package/dist/composables/_internal/use-tree.d.ts +2 -2
- package/dist/composables/_internal/use-tree.js +7 -52
- package/dist/composables/_internal/use-word-limit.d.ts +2 -2
- package/dist/composables/use-backoff-retry.d.ts +2 -35
- package/dist/composables/use-backoff-retry.js +5 -98
- package/dist/composables/use-copy-click.js +14 -13
- package/dist/composables/use-countdown.d.ts +1 -1
- package/dist/composables/use-countdown.js +4 -4
- package/dist/composables/use-delay-destroy.js +8 -6
- package/dist/composables/use-message.d.ts +1 -1
- package/dist/composables/use-message.js +1 -1
- package/dist/composables/use-repeat-action.d.ts +1 -1
- package/dist/composables/use-repeat-action.js +3 -3
- package/dist/composables/use-stick-to-bottom.d.ts +4 -21
- package/dist/composables/use-stick-to-bottom.js +138 -24
- package/dist/composables/use-view-transition.d.ts +23 -9
- package/dist/composables/use-virtual-list.d.ts +20 -0
- package/dist/composables/use-virtual-list.js +30 -9
- package/dist/constants/tooltip-variants.d.ts +1 -1
- package/dist/constants/tooltip-variants.js +1 -1
- package/dist/locales/en-us.d.ts +3 -0
- package/dist/locales/en-us.js +4 -1
- package/dist/locales/zh-cn.d.ts +3 -0
- package/dist/locales/zh-cn.js +4 -1
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +5 -14
- package/dist/types/shared/props.d.ts +5 -2
- package/dist/utils/_internal/mention-html.d.ts +1 -0
- package/dist/utils/_internal/mention-html.js +6 -4
- package/dist/utils/_internal/observer.js +3 -3
- package/dist/utils/backoff-retry.d.ts +15 -0
- package/dist/utils/backoff-retry.js +94 -0
- package/dist/utils/mention-html.d.ts +14 -0
- package/dist/utils/mention-html.js +71 -0
- package/package.json +2 -9
- package/dist/composables/_internal/use-list-filter.d.ts +0 -15
- package/dist/composables/_internal/use-list-filter.js +0 -48
|
@@ -18,6 +18,7 @@ export function useMentionEditor({
|
|
|
18
18
|
getModelValue,
|
|
19
19
|
getTriggers,
|
|
20
20
|
isDisabled,
|
|
21
|
+
isSubmitOnEnter,
|
|
21
22
|
onUpdate,
|
|
22
23
|
onTrigger,
|
|
23
24
|
onSubmit,
|
|
@@ -31,8 +32,20 @@ export function useMentionEditor({
|
|
|
31
32
|
let restoreTimer = null;
|
|
32
33
|
let lastEmittedHtml = "";
|
|
33
34
|
let pendingAtInsert = false;
|
|
34
|
-
function
|
|
35
|
-
|
|
35
|
+
function setCaret(range) {
|
|
36
|
+
window.getSelection()?.removeAllRanges();
|
|
37
|
+
window.getSelection()?.addRange(range);
|
|
38
|
+
}
|
|
39
|
+
function clearTriggerRange() {
|
|
40
|
+
triggerRange = null;
|
|
41
|
+
triggerKeyword = DEFAULT_TRIGGER;
|
|
42
|
+
restoreRange = null;
|
|
43
|
+
}
|
|
44
|
+
function cancelScheduledRestore() {
|
|
45
|
+
if (restoreTimer != null) {
|
|
46
|
+
clearTimeout(restoreTimer);
|
|
47
|
+
restoreTimer = null;
|
|
48
|
+
}
|
|
36
49
|
}
|
|
37
50
|
function ensureCaretAnchors() {
|
|
38
51
|
const editor = editorRef.value;
|
|
@@ -56,65 +69,40 @@ export function useMentionEditor({
|
|
|
56
69
|
return;
|
|
57
70
|
}
|
|
58
71
|
const html = serializeMentionHtml(editorRef.value);
|
|
59
|
-
|
|
72
|
+
isEmpty.value = html === "";
|
|
60
73
|
lastEmittedHtml = html;
|
|
61
74
|
onUpdate(html);
|
|
62
75
|
}
|
|
63
76
|
function applyHTML(html) {
|
|
64
77
|
if (!editorRef.value) {
|
|
65
|
-
return;
|
|
78
|
+
return "";
|
|
66
79
|
}
|
|
67
80
|
clearTriggerRange();
|
|
68
81
|
cancelScheduledRestore();
|
|
69
82
|
setMentionEditorContent(editorRef.value, html);
|
|
70
83
|
const serialized = serializeMentionHtml(editorRef.value);
|
|
71
|
-
|
|
84
|
+
isEmpty.value = serialized === "";
|
|
72
85
|
lastEmittedHtml = serialized;
|
|
73
|
-
|
|
74
|
-
function clearTriggerRange() {
|
|
75
|
-
triggerRange = null;
|
|
76
|
-
triggerKeyword = DEFAULT_TRIGGER;
|
|
77
|
-
restoreRange = null;
|
|
78
|
-
}
|
|
79
|
-
function cancelScheduledRestore() {
|
|
80
|
-
if (restoreTimer != null) {
|
|
81
|
-
clearTimeout(restoreTimer);
|
|
82
|
-
restoreTimer = null;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function applyRestoreCaret() {
|
|
86
|
-
restoreTimer = null;
|
|
87
|
-
if (!editorRef.value) {
|
|
88
|
-
clearTriggerRange();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const range = restoreRange;
|
|
92
|
-
clearTriggerRange();
|
|
93
|
-
editorRef.value.focus({ preventScroll: true });
|
|
94
|
-
if (!range) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
try {
|
|
98
|
-
if (!editorRef.value.contains(range.startContainer)) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const selection = window.getSelection();
|
|
102
|
-
selection?.removeAllRanges();
|
|
103
|
-
selection?.addRange(range);
|
|
104
|
-
} catch {
|
|
105
|
-
}
|
|
86
|
+
return serialized;
|
|
106
87
|
}
|
|
107
88
|
function restoreCaret() {
|
|
108
89
|
cancelScheduledRestore();
|
|
109
90
|
restoreTimer = setTimeout(() => {
|
|
110
|
-
|
|
91
|
+
restoreTimer = null;
|
|
92
|
+
const editor = editorRef.value;
|
|
93
|
+
const range = restoreRange;
|
|
94
|
+
clearTriggerRange();
|
|
95
|
+
editor?.focus({ preventScroll: true });
|
|
96
|
+
try {
|
|
97
|
+
if (editor && range && editor.contains(range.startContainer)) {
|
|
98
|
+
setCaret(range);
|
|
99
|
+
}
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
111
102
|
}, 0);
|
|
112
103
|
}
|
|
113
|
-
function sortedTriggers() {
|
|
114
|
-
return getTriggers().slice().sort((a, b) => b.length - a.length);
|
|
115
|
-
}
|
|
116
104
|
function findTriggerBeforeCaret(caret) {
|
|
117
|
-
for (const keyword of
|
|
105
|
+
for (const keyword of [...getTriggers()].sort((a, b) => b.length - a.length)) {
|
|
118
106
|
const start = caret.startOffset - keyword.length;
|
|
119
107
|
if (start < 0) {
|
|
120
108
|
continue;
|
|
@@ -125,12 +113,8 @@ export function useMentionEditor({
|
|
|
125
113
|
} catch {
|
|
126
114
|
continue;
|
|
127
115
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
if (isTriggerBoundary(range)) {
|
|
133
|
-
return candidate;
|
|
116
|
+
if (range.toString() === keyword && isTriggerBoundary(range)) {
|
|
117
|
+
return { keyword, range };
|
|
134
118
|
}
|
|
135
119
|
}
|
|
136
120
|
return null;
|
|
@@ -152,10 +136,7 @@ export function useMentionEditor({
|
|
|
152
136
|
}
|
|
153
137
|
function isTriggerBoundary(keywordRange) {
|
|
154
138
|
const before = boundaryBefore(keywordRange.startContainer, keywordRange.startOffset);
|
|
155
|
-
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
return /\s/.test(before) || before === CARET_ANCHOR;
|
|
139
|
+
return before === "start" || before === "mention" || /\s/.test(before) || before === CARET_ANCHOR;
|
|
159
140
|
}
|
|
160
141
|
function boundaryBefore(container, offset) {
|
|
161
142
|
if (container.nodeType === Node.TEXT_NODE) {
|
|
@@ -190,29 +171,51 @@ export function useMentionEditor({
|
|
|
190
171
|
onTrigger(triggerKeyword);
|
|
191
172
|
}
|
|
192
173
|
}
|
|
193
|
-
function isInsertInputType(inputType) {
|
|
194
|
-
return inputType === "insertText" || inputType === "insertCompositionText" || inputType === "insertReplacementText";
|
|
195
|
-
}
|
|
196
174
|
function notePendingAtInsert(ev) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
pendingAtInsert = false;
|
|
175
|
+
const insert = ev.inputType === "insertText" || ev.inputType === "insertCompositionText" || ev.inputType === "insertReplacementText";
|
|
176
|
+
pendingAtInsert = insert && ev.data != null && getTriggers().some((k) => ev.data?.includes(k));
|
|
202
177
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
178
|
+
function resolveInsertRange() {
|
|
179
|
+
const editor = editorRef.value;
|
|
180
|
+
if (!editor) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
if (isEmpty.value) {
|
|
184
|
+
const range2 = document.createRange();
|
|
185
|
+
range2.selectNodeContents(editor);
|
|
186
|
+
return range2;
|
|
187
|
+
}
|
|
188
|
+
const selection = window.getSelection();
|
|
189
|
+
if (selection && selection.rangeCount > 0) {
|
|
190
|
+
const range2 = selection.getRangeAt(0);
|
|
191
|
+
if (editor.contains(range2.startContainer) && editor.contains(range2.endContainer)) {
|
|
192
|
+
return range2.cloneRange();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const range = document.createRange();
|
|
196
|
+
range.selectNodeContents(editor);
|
|
197
|
+
range.collapse(false);
|
|
198
|
+
return range;
|
|
205
199
|
}
|
|
206
|
-
function insertMention(key, label) {
|
|
200
|
+
function insertMention(key, label, trigger) {
|
|
207
201
|
if (!editorRef.value || isDisabled()) {
|
|
208
202
|
return false;
|
|
209
203
|
}
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
let range = triggerRange;
|
|
205
|
+
let keyword = triggerKeyword;
|
|
206
|
+
if (range && editorRef.value.contains(range.startContainer)) {
|
|
207
|
+
if (trigger !== void 0) {
|
|
208
|
+
keyword = trigger;
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
range = resolveInsertRange();
|
|
212
|
+
keyword = trigger ?? DEFAULT_TRIGGER;
|
|
213
|
+
}
|
|
214
|
+
if (!range) {
|
|
212
215
|
return false;
|
|
213
216
|
}
|
|
214
217
|
range.deleteContents();
|
|
215
|
-
const mention = createMentionElement(key, label,
|
|
218
|
+
const mention = createMentionElement(key, label, keyword);
|
|
216
219
|
range.insertNode(mention);
|
|
217
220
|
const sibling = mention.nextSibling;
|
|
218
221
|
let anchor;
|
|
@@ -232,6 +235,71 @@ export function useMentionEditor({
|
|
|
232
235
|
emitHTML();
|
|
233
236
|
return true;
|
|
234
237
|
}
|
|
238
|
+
function focus() {
|
|
239
|
+
editorRef.value?.focus({ preventScroll: true });
|
|
240
|
+
}
|
|
241
|
+
function blur() {
|
|
242
|
+
editorRef.value?.blur();
|
|
243
|
+
}
|
|
244
|
+
function placeCaret(node, offset) {
|
|
245
|
+
const range = document.createRange();
|
|
246
|
+
range.setStart(node, offset);
|
|
247
|
+
range.collapse(true);
|
|
248
|
+
setCaret(range);
|
|
249
|
+
}
|
|
250
|
+
function placeCaretAfter(node) {
|
|
251
|
+
const range = document.createRange();
|
|
252
|
+
range.setStartAfter(node);
|
|
253
|
+
range.collapse(true);
|
|
254
|
+
setCaret(range);
|
|
255
|
+
}
|
|
256
|
+
function placeCaretAtEnd() {
|
|
257
|
+
const editor = editorRef.value;
|
|
258
|
+
if (!editor) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const range = document.createRange();
|
|
262
|
+
range.selectNodeContents(editor);
|
|
263
|
+
range.collapse(false);
|
|
264
|
+
setCaret(range);
|
|
265
|
+
}
|
|
266
|
+
function clear() {
|
|
267
|
+
onUpdate(applyHTML(""));
|
|
268
|
+
}
|
|
269
|
+
function setText(text) {
|
|
270
|
+
onUpdate(applyHTML(escapePlainTextAsHtml(text)));
|
|
271
|
+
placeCaretAtEnd();
|
|
272
|
+
}
|
|
273
|
+
function insertText(text) {
|
|
274
|
+
const range = resolveInsertRange();
|
|
275
|
+
if (!range || isDisabled()) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
range.deleteContents();
|
|
279
|
+
range.insertNode(sanitizeMentionClipboardHtml(escapePlainTextAsHtml(text)));
|
|
280
|
+
range.collapse(false);
|
|
281
|
+
setCaret(range);
|
|
282
|
+
ensureCaretAnchors();
|
|
283
|
+
emitHTML();
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
function replaceQuery(text) {
|
|
287
|
+
const range = triggerRange;
|
|
288
|
+
if (!editorRef.value || isDisabled() || !range || !editorRef.value.contains(range.startContainer)) {
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
range.deleteContents();
|
|
292
|
+
if (text) {
|
|
293
|
+
range.insertNode(sanitizeMentionClipboardHtml(escapePlainTextAsHtml(text)));
|
|
294
|
+
}
|
|
295
|
+
range.collapse(false);
|
|
296
|
+
clearTriggerRange();
|
|
297
|
+
restoreRange = range.cloneRange();
|
|
298
|
+
setCaret(range);
|
|
299
|
+
ensureCaretAnchors();
|
|
300
|
+
emitHTML();
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
235
303
|
function closestMention(node) {
|
|
236
304
|
if (!node || !editorRef.value) {
|
|
237
305
|
return null;
|
|
@@ -246,37 +314,18 @@ export function useMentionEditor({
|
|
|
246
314
|
}
|
|
247
315
|
return mention;
|
|
248
316
|
}
|
|
249
|
-
function retainEditorFocus() {
|
|
250
|
-
editorRef.value?.focus({ preventScroll: true });
|
|
251
|
-
}
|
|
252
|
-
function placeCaret(node, offset) {
|
|
253
|
-
const selection = window.getSelection();
|
|
254
|
-
const range = document.createRange();
|
|
255
|
-
range.setStart(node, offset);
|
|
256
|
-
range.collapse(true);
|
|
257
|
-
selection?.removeAllRanges();
|
|
258
|
-
selection?.addRange(range);
|
|
259
|
-
}
|
|
260
|
-
function placeCaretAfter(node) {
|
|
261
|
-
const selection = window.getSelection();
|
|
262
|
-
const range = document.createRange();
|
|
263
|
-
range.setStartAfter(node);
|
|
264
|
-
range.collapse(true);
|
|
265
|
-
selection?.removeAllRanges();
|
|
266
|
-
selection?.addRange(range);
|
|
267
|
-
}
|
|
268
317
|
function deleteMentionElement(mention) {
|
|
269
318
|
const editor = editorRef.value;
|
|
270
319
|
const parent = mention.parentNode;
|
|
271
320
|
if (!editor || !parent || !editor.contains(mention)) {
|
|
272
321
|
return;
|
|
273
322
|
}
|
|
274
|
-
const before = mention.previousSibling;
|
|
275
323
|
const next = mention.nextSibling;
|
|
276
324
|
cancelScheduledRestore();
|
|
277
325
|
clearTriggerRange();
|
|
278
326
|
mention.remove();
|
|
279
|
-
|
|
327
|
+
editor.focus({ preventScroll: true });
|
|
328
|
+
const before = mention.previousSibling;
|
|
280
329
|
if (before?.nodeType === Node.TEXT_NODE && editor.contains(before)) {
|
|
281
330
|
placeCaret(before, before.textContent?.length ?? 0);
|
|
282
331
|
} else if (before && editor.contains(before)) {
|
|
@@ -309,8 +358,7 @@ export function useMentionEditor({
|
|
|
309
358
|
deleteMentionElement(insideMention);
|
|
310
359
|
handled = true;
|
|
311
360
|
} else if (startContainer.nodeType === Node.TEXT_NODE) {
|
|
312
|
-
const
|
|
313
|
-
const prev = textNode.previousSibling;
|
|
361
|
+
const prev = startContainer.previousSibling;
|
|
314
362
|
if (isMentionElement(prev) && startOffset === 0) {
|
|
315
363
|
deleteMentionElement(prev);
|
|
316
364
|
handled = true;
|
|
@@ -342,33 +390,31 @@ export function useMentionEditor({
|
|
|
342
390
|
const prev = text.previousSibling;
|
|
343
391
|
return isMentionElement(prev) ? prev : null;
|
|
344
392
|
}
|
|
345
|
-
function resolvePasteRange(selection) {
|
|
346
|
-
if (selection.rangeCount > 0) {
|
|
347
|
-
return selection.getRangeAt(0);
|
|
348
|
-
}
|
|
349
|
-
const range = document.createRange();
|
|
350
|
-
range.selectNodeContents(editorRef.value);
|
|
351
|
-
return range;
|
|
352
|
-
}
|
|
353
393
|
function onPaste(ev) {
|
|
354
394
|
if (isDisabled()) {
|
|
355
395
|
return;
|
|
356
396
|
}
|
|
357
397
|
ev.preventDefault();
|
|
358
398
|
const clipboard = ev.clipboardData;
|
|
359
|
-
const html = clipboard?.getData("text/html");
|
|
360
|
-
const plain = clipboard?.getData("text/plain") ?? "";
|
|
361
399
|
const selection = window.getSelection();
|
|
362
400
|
if (!selection) {
|
|
363
401
|
return;
|
|
364
402
|
}
|
|
365
|
-
|
|
403
|
+
let range;
|
|
404
|
+
if (selection.rangeCount > 0) {
|
|
405
|
+
range = selection.getRangeAt(0);
|
|
406
|
+
} else {
|
|
407
|
+
range = document.createRange();
|
|
408
|
+
range.selectNodeContents(editorRef.value);
|
|
409
|
+
}
|
|
366
410
|
range.deleteContents();
|
|
367
|
-
|
|
368
|
-
|
|
411
|
+
range.insertNode(
|
|
412
|
+
sanitizeMentionClipboardHtml(
|
|
413
|
+
clipboard?.getData("text/html") || escapePlainTextAsHtml(clipboard?.getData("text/plain") ?? "")
|
|
414
|
+
)
|
|
415
|
+
);
|
|
369
416
|
range.collapse(false);
|
|
370
|
-
|
|
371
|
-
selection.addRange(range);
|
|
417
|
+
setCaret(range);
|
|
372
418
|
ensureCaretAnchors();
|
|
373
419
|
emitHTML();
|
|
374
420
|
}
|
|
@@ -378,10 +424,8 @@ export function useMentionEditor({
|
|
|
378
424
|
return;
|
|
379
425
|
}
|
|
380
426
|
notePendingAtInsert(ev);
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
if (!isComposing.value && tryDeleteBackward()) {
|
|
427
|
+
const backwardDelete = ev.inputType === "deleteEntireSoftLine" || ev.inputType.endsWith("Backward");
|
|
428
|
+
if (backwardDelete && !isComposing.value && tryDeleteBackward()) {
|
|
385
429
|
ev.preventDefault();
|
|
386
430
|
}
|
|
387
431
|
}
|
|
@@ -390,6 +434,9 @@ export function useMentionEditor({
|
|
|
390
434
|
return;
|
|
391
435
|
}
|
|
392
436
|
if (ev.key === "Enter" && !ev.shiftKey && !ev.isComposing) {
|
|
437
|
+
if (!isSubmitOnEnter()) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
393
440
|
ev.preventDefault();
|
|
394
441
|
if (editorRef.value) {
|
|
395
442
|
onSubmit(serializeMentionHtml(editorRef.value));
|
|
@@ -401,10 +448,8 @@ export function useMentionEditor({
|
|
|
401
448
|
} else if (!ev.isComposing && getTriggers().includes(ev.key)) {
|
|
402
449
|
pendingAtInsert = true;
|
|
403
450
|
}
|
|
404
|
-
if (ev.key === "Backspace" && !ev.isComposing) {
|
|
405
|
-
|
|
406
|
-
ev.preventDefault();
|
|
407
|
-
}
|
|
451
|
+
if (ev.key === "Backspace" && !ev.isComposing && tryDeleteBackward()) {
|
|
452
|
+
ev.preventDefault();
|
|
408
453
|
}
|
|
409
454
|
}
|
|
410
455
|
function onInput() {
|
|
@@ -443,18 +488,14 @@ export function useMentionEditor({
|
|
|
443
488
|
clipboard.setData("text/html", `<meta charset="utf-8">${serializeMentionHtml(source)}`);
|
|
444
489
|
clipboard.setData("text/plain", (source.textContent ?? "").replace(/\u200B/g, ""));
|
|
445
490
|
ev.preventDefault();
|
|
446
|
-
if (ev.type === "cut") {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
ensureCaretAnchors();
|
|
451
|
-
emitHTML();
|
|
452
|
-
}
|
|
491
|
+
if (ev.type === "cut" && selection.rangeCount > 0) {
|
|
492
|
+
selection.getRangeAt(0).deleteContents();
|
|
493
|
+
ensureCaretAnchors();
|
|
494
|
+
emitHTML();
|
|
453
495
|
}
|
|
454
496
|
}
|
|
455
497
|
function onClick(ev) {
|
|
456
|
-
const
|
|
457
|
-
const mention = target?.closest?.(MENTION_TAG_LOWER);
|
|
498
|
+
const mention = ev.target?.closest?.(MENTION_TAG_LOWER);
|
|
458
499
|
if (!mention || !editorRef.value?.contains(mention) || !isMentionElement(mention)) {
|
|
459
500
|
return;
|
|
460
501
|
}
|
|
@@ -466,26 +507,19 @@ export function useMentionEditor({
|
|
|
466
507
|
});
|
|
467
508
|
}
|
|
468
509
|
function mount() {
|
|
469
|
-
applyHTML(getModelValue()
|
|
510
|
+
applyHTML(getModelValue());
|
|
470
511
|
}
|
|
471
|
-
watch(
|
|
472
|
-
|
|
473
|
-
(html)
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
const current = serializeMentionHtml(editorRef.value);
|
|
482
|
-
if (next === current) {
|
|
483
|
-
lastEmittedHtml = next;
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
applyHTML(next);
|
|
512
|
+
watch(getModelValue, (html) => {
|
|
513
|
+
const editor = editorRef.value;
|
|
514
|
+
if (!editor || html === lastEmittedHtml) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
if (html === serializeMentionHtml(editor)) {
|
|
518
|
+
lastEmittedHtml = html;
|
|
519
|
+
return;
|
|
487
520
|
}
|
|
488
|
-
|
|
521
|
+
applyHTML(html);
|
|
522
|
+
});
|
|
489
523
|
onBeforeUnmount(() => {
|
|
490
524
|
cancelScheduledRestore();
|
|
491
525
|
clearTriggerRange();
|
|
@@ -494,6 +528,12 @@ export function useMentionEditor({
|
|
|
494
528
|
isEmpty,
|
|
495
529
|
isComposing,
|
|
496
530
|
insertMention,
|
|
531
|
+
focus,
|
|
532
|
+
blur,
|
|
533
|
+
clear,
|
|
534
|
+
setText,
|
|
535
|
+
insertText,
|
|
536
|
+
replaceQuery,
|
|
497
537
|
restoreCaret,
|
|
498
538
|
onBeforeInput,
|
|
499
539
|
onInput,
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import type { ListOptions } from '../../components/list/types';
|
|
2
|
-
import type {
|
|
1
|
+
import type { ListFilterMethodFn, ListOptions } from '../../components/list/types';
|
|
2
|
+
import type { MentionRemoteFilterFn } from '../../components/mention/types';
|
|
3
3
|
import type { ComputedRef, Ref, ShallowRef } from 'vue';
|
|
4
|
+
export type MentionOptionsResult = ListOptions | Promise<ListOptions>;
|
|
4
5
|
export interface UseMentionSuggestOptions {
|
|
5
|
-
getOptions: (trigger: string) =>
|
|
6
|
-
|
|
6
|
+
getOptions: (trigger: string) => MentionOptionsResult;
|
|
7
|
+
getFilter: () => ListFilterMethodFn | undefined;
|
|
8
|
+
getRemoteFilter: () => MentionRemoteFilterFn | undefined;
|
|
9
|
+
isFilterDebounced: () => boolean;
|
|
7
10
|
isDisabled: () => boolean;
|
|
8
11
|
visible: Ref<boolean>;
|
|
9
12
|
setVisible: (visible: boolean) => void;
|
|
10
13
|
}
|
|
11
14
|
export interface UseMentionSuggestReturn {
|
|
15
|
+
activeTrigger: ShallowRef<string>;
|
|
12
16
|
filterKeyword: ShallowRef<string>;
|
|
13
17
|
listOptions: ShallowRef<ListOptions>;
|
|
14
18
|
isPending: ShallowRef<boolean>;
|
|
@@ -17,7 +21,5 @@ export interface UseMentionSuggestReturn {
|
|
|
17
21
|
close: () => void;
|
|
18
22
|
setKeyword: (query: string) => void;
|
|
19
23
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
export declare function useMentionSuggest({ getOptions, getFilterMethod, isDisabled, visible, setVisible, }: UseMentionSuggestOptions): UseMentionSuggestReturn;
|
|
24
|
+
/** Suggestion popover state: keyword, list options, and async filter races. */
|
|
25
|
+
export declare function useMentionSuggest({ getOptions, getFilter, getRemoteFilter, isFilterDebounced, isDisabled, visible, setVisible, }: UseMentionSuggestOptions): UseMentionSuggestReturn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, shallowRef, watch } from "vue";
|
|
2
2
|
import { debounce } from "../../utils/timing.js";
|
|
3
|
-
import { filterListOptions } from "./use-list-
|
|
3
|
+
import { filterListOptions } from "./use-list-search.js";
|
|
4
4
|
import { isListOptionGroup } from "./use-selected-list-item.js";
|
|
5
5
|
const ASYNC_FILTER_DEBOUNCE = 200;
|
|
6
6
|
function isOptionsEmpty(options) {
|
|
@@ -16,7 +16,9 @@ function isOptionsEmpty(options) {
|
|
|
16
16
|
}
|
|
17
17
|
export function useMentionSuggest({
|
|
18
18
|
getOptions,
|
|
19
|
-
|
|
19
|
+
getFilter,
|
|
20
|
+
getRemoteFilter,
|
|
21
|
+
isFilterDebounced,
|
|
20
22
|
isDisabled,
|
|
21
23
|
visible,
|
|
22
24
|
setVisible
|
|
@@ -34,45 +36,52 @@ export function useMentionSuggest({
|
|
|
34
36
|
filterRequestId += 1;
|
|
35
37
|
runFilterDebounced.cancel();
|
|
36
38
|
}
|
|
37
|
-
async function
|
|
38
|
-
const requestId = ++filterRequestId;
|
|
39
|
-
const trimmed = query.trim();
|
|
40
|
-
if (!trimmed) {
|
|
41
|
-
isPending.value = false;
|
|
42
|
-
listOptions.value = getOptions(trigger);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const filterMethod = getFilterMethod();
|
|
46
|
-
if (!filterMethod) {
|
|
47
|
-
isPending.value = false;
|
|
48
|
-
listOptions.value = filterListOptions(getOptions(trigger), trimmed);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
39
|
+
async function settlePending(requestId, load) {
|
|
51
40
|
isPending.value = true;
|
|
52
41
|
try {
|
|
53
|
-
const result = await
|
|
54
|
-
if (requestId
|
|
55
|
-
|
|
42
|
+
const result = await load();
|
|
43
|
+
if (requestId === filterRequestId) {
|
|
44
|
+
listOptions.value = result;
|
|
56
45
|
}
|
|
57
|
-
listOptions.value = Array.isArray(result) ? result : [];
|
|
58
46
|
} catch {
|
|
59
|
-
if (requestId
|
|
60
|
-
|
|
47
|
+
if (requestId === filterRequestId) {
|
|
48
|
+
listOptions.value = [];
|
|
61
49
|
}
|
|
62
|
-
listOptions.value = [];
|
|
63
50
|
} finally {
|
|
64
51
|
if (requestId === filterRequestId) {
|
|
65
52
|
isPending.value = false;
|
|
66
53
|
}
|
|
67
54
|
}
|
|
68
55
|
}
|
|
56
|
+
function withFilter(options, query) {
|
|
57
|
+
return query ? filterListOptions(options, query, getFilter()) : options;
|
|
58
|
+
}
|
|
59
|
+
async function runFilter(query, trigger) {
|
|
60
|
+
const requestId = ++filterRequestId;
|
|
61
|
+
const trimmed = query.trim();
|
|
62
|
+
const remoteFilter = getRemoteFilter();
|
|
63
|
+
if (trimmed && remoteFilter) {
|
|
64
|
+
await settlePending(requestId, async () => {
|
|
65
|
+
const result2 = await remoteFilter(trimmed, trigger);
|
|
66
|
+
return Array.isArray(result2) ? result2 : [];
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const result = getOptions(trigger);
|
|
71
|
+
if (!(result instanceof Promise)) {
|
|
72
|
+
isPending.value = false;
|
|
73
|
+
listOptions.value = withFilter(result, trimmed);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
await settlePending(requestId, async () => withFilter(await result, trimmed));
|
|
77
|
+
}
|
|
69
78
|
function open(trigger) {
|
|
70
79
|
if (isDisabled() || visible.value) {
|
|
71
80
|
return;
|
|
72
81
|
}
|
|
73
82
|
activeTrigger.value = trigger;
|
|
74
83
|
filterKeyword.value = "";
|
|
75
|
-
|
|
84
|
+
void runFilter("", trigger);
|
|
76
85
|
setVisible(true);
|
|
77
86
|
}
|
|
78
87
|
function close() {
|
|
@@ -88,11 +97,15 @@ export function useMentionSuggest({
|
|
|
88
97
|
function setKeyword(query) {
|
|
89
98
|
const trigger = activeTrigger.value;
|
|
90
99
|
filterKeyword.value = query;
|
|
91
|
-
if (!query.trim() || !
|
|
100
|
+
if (!query.trim() || !getRemoteFilter()) {
|
|
92
101
|
runFilterDebounced.cancel();
|
|
93
102
|
void runFilter(query, trigger);
|
|
94
103
|
return;
|
|
95
104
|
}
|
|
105
|
+
if (!isFilterDebounced()) {
|
|
106
|
+
void runFilter(query, trigger);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
96
109
|
isPending.value = true;
|
|
97
110
|
runFilterDebounced(query, trigger);
|
|
98
111
|
}
|
|
@@ -102,6 +115,7 @@ export function useMentionSuggest({
|
|
|
102
115
|
}
|
|
103
116
|
});
|
|
104
117
|
return {
|
|
118
|
+
activeTrigger,
|
|
105
119
|
filterKeyword,
|
|
106
120
|
listOptions,
|
|
107
121
|
isPending,
|
|
@@ -49,7 +49,7 @@ export function useMessageGroup({ messages, expand, onTimeout }) {
|
|
|
49
49
|
function startTimer(message) {
|
|
50
50
|
message._startedAtMs = Date.now();
|
|
51
51
|
if (isNil(message._remainingMs)) {
|
|
52
|
-
message._remainingMs = message.
|
|
52
|
+
message._remainingMs = message.duration;
|
|
53
53
|
}
|
|
54
54
|
clearTimer(message);
|
|
55
55
|
message._timerId = setTimeout(() => {
|
|
@@ -57,7 +57,7 @@ export function useMessageGroup({ messages, expand, onTimeout }) {
|
|
|
57
57
|
}, message._remainingMs);
|
|
58
58
|
}
|
|
59
59
|
function pauseMessage(message) {
|
|
60
|
-
if (!message.
|
|
60
|
+
if (!message.duration || message.duration <= 0) {
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
if (!message._timerId) {
|
|
@@ -65,11 +65,11 @@ export function useMessageGroup({ messages, expand, onTimeout }) {
|
|
|
65
65
|
}
|
|
66
66
|
clearTimer(message);
|
|
67
67
|
const elapsed = Date.now() - message._startedAtMs;
|
|
68
|
-
const remaining = message._remainingMs ?? message.
|
|
68
|
+
const remaining = message._remainingMs ?? message.duration;
|
|
69
69
|
message._remainingMs = Math.max(0, remaining - elapsed);
|
|
70
70
|
}
|
|
71
71
|
function resumeMessage(message) {
|
|
72
|
-
if (!message.
|
|
72
|
+
if (!message.duration || message.duration <= 0) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (message._startedAtMs == null) {
|
|
@@ -107,8 +107,8 @@ export function useMessageGroup({ messages, expand, onTimeout }) {
|
|
|
107
107
|
message.error = void 0;
|
|
108
108
|
message.finally = void 0;
|
|
109
109
|
const isAlive = toValue(messages).includes(message);
|
|
110
|
-
if (isAlive && message.
|
|
111
|
-
message._remainingMs = message.
|
|
110
|
+
if (isAlive && message.duration && message.duration > 0) {
|
|
111
|
+
message._remainingMs = message.duration;
|
|
112
112
|
startTimer(message);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -2,7 +2,7 @@ export declare function usePopoverResponsive(): {
|
|
|
2
2
|
isAdaptive: import("vue").Ref<boolean, boolean>;
|
|
3
3
|
responsiveClasses: import("vue").ComputedRef<{
|
|
4
4
|
readonly content: "bg-background-100 shadow-border-menu w-full rounded-tl-xl rounded-tr-xl";
|
|
5
|
-
readonly wrapper: "
|
|
5
|
+
readonly wrapper: "w-full h-full items-end pointer-events-none";
|
|
6
6
|
} | {
|
|
7
7
|
readonly content: "bg-background-100 shadow-border-menu rounded-xl";
|
|
8
8
|
readonly wrapper: "";
|
|
@@ -2,7 +2,7 @@ import { computed } from "vue";
|
|
|
2
2
|
import { PRESET_MEDIA_QUERIES, useMediaQuery } from "../use-media-query.js";
|
|
3
3
|
const ADAPTIVE_CLASSES = {
|
|
4
4
|
content: "bg-background-100 shadow-border-menu w-full rounded-tl-xl rounded-tr-xl",
|
|
5
|
-
wrapper: "
|
|
5
|
+
wrapper: "w-full h-full items-end pointer-events-none"
|
|
6
6
|
};
|
|
7
7
|
const DEFAULT_CLASSES = {
|
|
8
8
|
content: "bg-background-100 shadow-border-menu rounded-xl",
|