@youcan/celeste 0.6.30 → 0.6.32
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 +483 -264
- package/dist/cjs/alert.js +2 -2
- package/dist/cjs/chunks/index.js +229 -2
- package/dist/cjs/chunks/index2.js +1457 -0
- package/dist/cjs/chunks/index3.js +16457 -0
- package/dist/cjs/chunks/sonner.js +1154 -0
- package/dist/cjs/config.js +136 -0
- package/dist/cjs/extra-settings.js +155 -0
- package/dist/cjs/index.js +75 -0
- package/dist/cjs/label.js +2 -2
- package/dist/cjs/link-bubble.js +228 -0
- package/dist/cjs/link-button.js +2 -2
- package/dist/cjs/rich-editor.js +4996 -0
- package/dist/cjs/select-icon.js +2 -2
- package/dist/cjs/sonner-alert.js +41 -0
- package/dist/cjs/sonner.js +3 -0
- package/dist/cjs/text-input-affix.js +2 -2
- package/dist/cjs/types.js +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/rich-editor/config.d.ts +33 -0
- package/dist/components/rich-editor/extra-settings.d.ts +6 -0
- package/dist/components/rich-editor/index.d.ts +2 -0
- package/dist/components/rich-editor/link-bubble.d.ts +11 -0
- package/dist/components/rich-editor/rich-editor.d.ts +55 -0
- package/dist/components/rich-editor/types.d.ts +19 -0
- package/dist/components/sonner/index.d.ts +4 -0
- package/dist/components/sonner/sonner-alert.d.ts +13 -0
- package/dist/components/sonner/sonner.d.ts +5 -0
- package/dist/es/alert.js +2 -2
- package/dist/es/checkbox-label.js +1 -1
- package/dist/es/chunks/index.js +277 -50
- package/dist/es/chunks/index2.js +1457 -0
- package/dist/es/chunks/index3.js +16458 -0
- package/dist/es/chunks/sonner.js +1155 -0
- package/dist/es/combobox-group.js +1 -1
- package/dist/es/combobox-input.js +1 -1
- package/dist/es/combobox-item.js +1 -1
- package/dist/es/combobox-list.js +1 -1
- package/dist/es/combobox-root.js +1 -1
- package/dist/es/combobox-separator.js +1 -1
- package/dist/es/combobox-trigger.js +1 -1
- package/dist/es/command-group.js +1 -1
- package/dist/es/command-input.js +1 -1
- package/dist/es/command-item.js +1 -1
- package/dist/es/command-list.js +1 -1
- package/dist/es/command-root.js +1 -1
- package/dist/es/command-separator.js +1 -1
- package/dist/es/config.js +136 -0
- package/dist/es/dropdown-menu-group.js +1 -1
- package/dist/es/dropdown-menu-item.js +1 -1
- package/dist/es/dropdown-menu-label.js +1 -1
- package/dist/es/dropdown-menu-separator.js +1 -1
- package/dist/es/dropdown-menu-trigger.js +1 -1
- package/dist/es/dropdown-menu.js +1 -1
- package/dist/es/dropdown.js +1 -1
- package/dist/es/extra-settings.js +156 -0
- package/dist/es/index.js +94 -19
- package/dist/es/label.js +3 -3
- package/dist/es/link-bubble.js +229 -0
- package/dist/es/link-button.js +2 -2
- package/dist/es/modal-content.js +1 -1
- package/dist/es/modal-header.js +1 -1
- package/dist/es/popover-content.js +1 -1
- package/dist/es/popover-trigger.js +1 -1
- package/dist/es/rich-editor.js +4997 -0
- package/dist/es/scroll-bar.js +1 -1
- package/dist/es/segmented-control-item.js +1 -1
- package/dist/es/segmented-control.js +1 -1
- package/dist/es/select-content.js +1 -1
- package/dist/es/select-icon.js +2 -2
- package/dist/es/select-item.js +1 -1
- package/dist/es/select-trigger.js +1 -1
- package/dist/es/select-value.js +1 -1
- package/dist/es/sonner-alert.js +42 -0
- package/dist/es/sonner.js +4 -0
- package/dist/es/tab-menu-content.js +1 -1
- package/dist/es/tab-menu-item.js +1 -1
- package/dist/es/tab-menu-list.js +1 -1
- package/dist/es/tab-menu.js +1 -1
- package/dist/es/text-input-affix.js +2 -2
- package/dist/es/tooltip.js +1 -1
- package/dist/es/types.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/sonner.d.ts +19 -0
- package/package.json +15 -4
- package/src/components/index.ts +2 -0
- package/src/components/rich-editor/config.ts +150 -0
- package/src/components/rich-editor/extra-settings.vue +151 -0
- package/src/components/rich-editor/index.ts +2 -0
- package/src/components/rich-editor/link-bubble.vue +288 -0
- package/src/components/rich-editor/rich-editor.vue +428 -0
- package/src/components/rich-editor/stories/rich-editor.stories.ts +87 -0
- package/src/components/rich-editor/types.ts +21 -0
- package/src/components/sonner/index.ts +5 -0
- package/src/components/sonner/sonner-alert.vue +54 -0
- package/src/components/sonner/sonner.vue +13 -0
- package/src/components/sonner/stories/sonner.stories.ts +194 -0
- package/src/index.ts +1 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/sonner.ts +72 -0
package/dist/cjs/select-icon.js
CHANGED
|
@@ -21,5 +21,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
const
|
|
25
|
-
module.exports =
|
|
24
|
+
const SelectIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-5c4a7fcf"]]);
|
|
25
|
+
module.exports = SelectIcon;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const alert = require("./alert.js");
|
|
4
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
6
|
+
__name: "sonner-alert",
|
|
7
|
+
props: {
|
|
8
|
+
title: {},
|
|
9
|
+
description: {},
|
|
10
|
+
onDismiss: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
function handleDismiss() {
|
|
15
|
+
if (props.onDismiss) {
|
|
16
|
+
props.onDismiss();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(alert), Mo.mergeProps(props, {
|
|
21
|
+
class: "sonner-alert",
|
|
22
|
+
onDismiss: handleDismiss
|
|
23
|
+
}), Mo.createSlots({
|
|
24
|
+
title: Mo.withCtx(() => [
|
|
25
|
+
Mo.createTextVNode(Mo.toDisplayString(props.title), 1)
|
|
26
|
+
]),
|
|
27
|
+
_: 2
|
|
28
|
+
}, [
|
|
29
|
+
props.description ? {
|
|
30
|
+
name: "description",
|
|
31
|
+
fn: Mo.withCtx(() => [
|
|
32
|
+
Mo.createTextVNode(Mo.toDisplayString(props.description), 1)
|
|
33
|
+
]),
|
|
34
|
+
key: "0"
|
|
35
|
+
} : void 0
|
|
36
|
+
]), 1040);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const SonnerAlert = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-c8bb23e0"]]);
|
|
41
|
+
module.exports = SonnerAlert;
|
|
@@ -23,5 +23,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
module.exports =
|
|
26
|
+
const TextInputAffix = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-2d8a1dbc"]]);
|
|
27
|
+
module.exports = TextInputAffix;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -10,10 +10,12 @@ export * from './hint-text';
|
|
|
10
10
|
export * from './label';
|
|
11
11
|
export * from './modal';
|
|
12
12
|
export * from './popover';
|
|
13
|
+
export * from './rich-editor';
|
|
13
14
|
export * from './scroll-area';
|
|
14
15
|
export * from './segmented-control';
|
|
15
16
|
export * from './select';
|
|
16
17
|
export * from './slider';
|
|
18
|
+
export * from './sonner';
|
|
17
19
|
export * from './switch';
|
|
18
20
|
export * from './tab-menu';
|
|
19
21
|
export * from './text-input';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { ToolbarChildOption, ToolbarItem } from './types';
|
|
3
|
+
export declare const fullToolbar: import('vue').Ref<({
|
|
4
|
+
type?: "action" | undefined;
|
|
5
|
+
slug: string;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
icon?: string | undefined;
|
|
8
|
+
active?: (string | Record<string, unknown>) | undefined;
|
|
9
|
+
children?: {
|
|
10
|
+
option: string;
|
|
11
|
+
name: string;
|
|
12
|
+
icon?: string | undefined;
|
|
13
|
+
active: string | Record<string, unknown>;
|
|
14
|
+
}[] | undefined;
|
|
15
|
+
} | {
|
|
16
|
+
type: "divider";
|
|
17
|
+
})[], ToolbarItem[] | ({
|
|
18
|
+
type?: "action" | undefined;
|
|
19
|
+
slug: string;
|
|
20
|
+
name?: string | undefined;
|
|
21
|
+
icon?: string | undefined;
|
|
22
|
+
active?: (string | Record<string, unknown>) | undefined;
|
|
23
|
+
children?: {
|
|
24
|
+
option: string;
|
|
25
|
+
name: string;
|
|
26
|
+
icon?: string | undefined;
|
|
27
|
+
active: string | Record<string, unknown>;
|
|
28
|
+
}[] | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
type: "divider";
|
|
31
|
+
})[]>;
|
|
32
|
+
export declare function onActionClick(editor: Editor, slug: string, option?: string | null, showLinkBubble?: () => void): void;
|
|
33
|
+
export declare function selectedOption(editor: Editor, children: ToolbarChildOption[]): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
showSetLinkFromToolbar: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"set-link-closed": (...args: any[]) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onSet-link-closed"?: ((...args: any[]) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
placeholder: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
customToolbar: {
|
|
12
|
+
type: PropType<string[]>;
|
|
13
|
+
default: () => never[];
|
|
14
|
+
};
|
|
15
|
+
maxLimit: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: null;
|
|
18
|
+
};
|
|
19
|
+
showExtraSettings: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (...args: any[]) => void;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
placeholder: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
customToolbar: {
|
|
35
|
+
type: PropType<string[]>;
|
|
36
|
+
default: () => never[];
|
|
37
|
+
};
|
|
38
|
+
maxLimit: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
default: null;
|
|
41
|
+
};
|
|
42
|
+
showExtraSettings: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
}>> & Readonly<{
|
|
47
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
modelValue: string;
|
|
50
|
+
placeholder: string;
|
|
51
|
+
customToolbar: string[];
|
|
52
|
+
maxLimit: number;
|
|
53
|
+
showExtraSettings: boolean;
|
|
54
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ToolbarChildOption {
|
|
2
|
+
option: string;
|
|
3
|
+
name: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
active: string | Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
interface ToolbarAction {
|
|
8
|
+
type?: 'action';
|
|
9
|
+
slug: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
active?: string | Record<string, unknown>;
|
|
13
|
+
children?: ToolbarChildOption[];
|
|
14
|
+
}
|
|
15
|
+
interface ToolbarDivider {
|
|
16
|
+
type: 'divider';
|
|
17
|
+
}
|
|
18
|
+
export type ToolbarItem = ToolbarAction | ToolbarDivider;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AlertProps } from '../alert';
|
|
2
|
+
export interface SonnerAlertProps extends /* @vue-ignore */ Partial<AlertProps> {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
onDismiss?: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('vue').DefineComponent<SonnerAlertProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SonnerAlertProps> & Readonly<{}>, {
|
|
8
|
+
size: "xs" | "sm" | "lg";
|
|
9
|
+
variant: "fill" | "light" | "lighter" | "stroke";
|
|
10
|
+
state: "information" | "success" | "warning" | "error" | "feature";
|
|
11
|
+
dismissable: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ToasterProps } from 'vue-sonner';
|
|
2
|
+
export interface SonnerProps extends ToasterProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import('vue').DefineComponent<SonnerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SonnerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
package/dist/es/alert.js
CHANGED
|
@@ -106,7 +106,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
const
|
|
109
|
+
const Alert = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a07f0877"]]);
|
|
110
110
|
export {
|
|
111
|
-
|
|
111
|
+
Alert as default
|
|
112
112
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, createElementVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { useDelegatedProps } from "./use-delegated-props.js";
|
|
3
3
|
import { c as clsx } from "./chunks/clsx.js";
|
|
4
|
-
import {
|
|
4
|
+
import { S as Oh, f as O } from "./chunks/index.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _hoisted_1 = { role: "presentation" };
|
|
7
7
|
const _hoisted_2 = {
|
package/dist/es/chunks/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as Mo from "vue";
|
|
2
2
|
import { computed, ref, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, unref, getCurrentInstance, toRef, camelize, defineComponent, Comment, mergeProps, cloneVNode, h, toRefs, renderSlot, onMounted, openBlock, createBlock, withCtx, normalizeProps, guardReactiveProps, reactive, createVNode, createCommentVNode, createElementBlock, Fragment, withKeys, withModifiers, watchEffect, markRaw, nextTick, watchSyncEffect, withDirectives, vShow, createTextVNode, toDisplayString, isRef, resolveDynamicComponent, normalizeStyle, createElementVNode, onUnmounted, renderList, Teleport, onBeforeUnmount, useSlots, onBeforeMount, toHandlers, effectScope, readonly, toHandlerKey, vModelSelect, toRaw, inject, provide, customRef, onBeforeUpdate, onUpdated, mergeDefaults, watchPostEffect } from "vue";
|
|
3
3
|
const sides = ["top", "right", "bottom", "left"];
|
|
4
|
+
const alignments = ["start", "end"];
|
|
5
|
+
const placements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
4
6
|
const min = Math.min;
|
|
5
7
|
const max = Math.max;
|
|
6
8
|
const round = Math.round;
|
|
@@ -385,6 +387,102 @@ const arrow$2 = (options) => ({
|
|
|
385
387
|
};
|
|
386
388
|
}
|
|
387
389
|
});
|
|
390
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
391
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getSide(placement) === placement);
|
|
392
|
+
return allowedPlacementsSortedByAlignment.filter((placement) => {
|
|
393
|
+
if (alignment) {
|
|
394
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
395
|
+
}
|
|
396
|
+
return true;
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
const autoPlacement$1 = function(options) {
|
|
400
|
+
if (options === void 0) {
|
|
401
|
+
options = {};
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
name: "autoPlacement",
|
|
405
|
+
options,
|
|
406
|
+
async fn(state) {
|
|
407
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
408
|
+
const {
|
|
409
|
+
rects,
|
|
410
|
+
middlewareData,
|
|
411
|
+
placement,
|
|
412
|
+
platform: platform2,
|
|
413
|
+
elements
|
|
414
|
+
} = state;
|
|
415
|
+
const {
|
|
416
|
+
crossAxis = false,
|
|
417
|
+
alignment,
|
|
418
|
+
allowedPlacements = placements,
|
|
419
|
+
autoAlignment = true,
|
|
420
|
+
...detectOverflowOptions
|
|
421
|
+
} = evaluate(options, state);
|
|
422
|
+
const placements$1 = alignment !== void 0 || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
423
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
424
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
425
|
+
const currentPlacement = placements$1[currentIndex];
|
|
426
|
+
if (currentPlacement == null) {
|
|
427
|
+
return {};
|
|
428
|
+
}
|
|
429
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)));
|
|
430
|
+
if (placement !== currentPlacement) {
|
|
431
|
+
return {
|
|
432
|
+
reset: {
|
|
433
|
+
placement: placements$1[0]
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
438
|
+
const allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
|
|
439
|
+
placement: currentPlacement,
|
|
440
|
+
overflows: currentOverflows
|
|
441
|
+
}];
|
|
442
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
|
443
|
+
if (nextPlacement) {
|
|
444
|
+
return {
|
|
445
|
+
data: {
|
|
446
|
+
index: currentIndex + 1,
|
|
447
|
+
overflows: allOverflows
|
|
448
|
+
},
|
|
449
|
+
reset: {
|
|
450
|
+
placement: nextPlacement
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
const placementsSortedByMostSpace = allOverflows.map((d) => {
|
|
455
|
+
const alignment2 = getAlignment(d.placement);
|
|
456
|
+
return [d.placement, alignment2 && crossAxis ? (
|
|
457
|
+
// Check along the mainAxis and main crossAxis side.
|
|
458
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0)
|
|
459
|
+
) : (
|
|
460
|
+
// Check only the mainAxis.
|
|
461
|
+
d.overflows[0]
|
|
462
|
+
), d.overflows];
|
|
463
|
+
}).sort((a2, b) => a2[1] - b[1]);
|
|
464
|
+
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter((d) => d[2].slice(
|
|
465
|
+
0,
|
|
466
|
+
// Aligned placements should not check their opposite crossAxis
|
|
467
|
+
// side.
|
|
468
|
+
getAlignment(d[0]) ? 2 : 3
|
|
469
|
+
).every((v) => v <= 0));
|
|
470
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
471
|
+
if (resetPlacement !== placement) {
|
|
472
|
+
return {
|
|
473
|
+
data: {
|
|
474
|
+
index: currentIndex + 1,
|
|
475
|
+
overflows: allOverflows
|
|
476
|
+
},
|
|
477
|
+
reset: {
|
|
478
|
+
placement: resetPlacement
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
return {};
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
};
|
|
388
486
|
const flip$1 = function(options) {
|
|
389
487
|
if (options === void 0) {
|
|
390
488
|
options = {};
|
|
@@ -423,7 +521,7 @@ const flip$1 = function(options) {
|
|
|
423
521
|
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
424
522
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
425
523
|
}
|
|
426
|
-
const
|
|
524
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
427
525
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
428
526
|
const overflows = [];
|
|
429
527
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
@@ -441,7 +539,7 @@ const flip$1 = function(options) {
|
|
|
441
539
|
if (!overflows.every((side2) => side2 <= 0)) {
|
|
442
540
|
var _middlewareData$flip2, _overflowsData$filter;
|
|
443
541
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
444
|
-
const nextPlacement =
|
|
542
|
+
const nextPlacement = placements2[nextIndex];
|
|
445
543
|
if (nextPlacement) {
|
|
446
544
|
return {
|
|
447
545
|
data: {
|
|
@@ -549,6 +647,124 @@ const hide$1 = function(options) {
|
|
|
549
647
|
}
|
|
550
648
|
};
|
|
551
649
|
};
|
|
650
|
+
function getBoundingRect(rects) {
|
|
651
|
+
const minX = min(...rects.map((rect) => rect.left));
|
|
652
|
+
const minY = min(...rects.map((rect) => rect.top));
|
|
653
|
+
const maxX = max(...rects.map((rect) => rect.right));
|
|
654
|
+
const maxY = max(...rects.map((rect) => rect.bottom));
|
|
655
|
+
return {
|
|
656
|
+
x: minX,
|
|
657
|
+
y: minY,
|
|
658
|
+
width: maxX - minX,
|
|
659
|
+
height: maxY - minY
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function getRectsByLine(rects) {
|
|
663
|
+
const sortedRects = rects.slice().sort((a2, b) => a2.y - b.y);
|
|
664
|
+
const groups = [];
|
|
665
|
+
let prevRect = null;
|
|
666
|
+
for (let i = 0; i < sortedRects.length; i++) {
|
|
667
|
+
const rect = sortedRects[i];
|
|
668
|
+
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
|
|
669
|
+
groups.push([rect]);
|
|
670
|
+
} else {
|
|
671
|
+
groups[groups.length - 1].push(rect);
|
|
672
|
+
}
|
|
673
|
+
prevRect = rect;
|
|
674
|
+
}
|
|
675
|
+
return groups.map((rect) => rectToClientRect(getBoundingRect(rect)));
|
|
676
|
+
}
|
|
677
|
+
const inline$1 = function(options) {
|
|
678
|
+
if (options === void 0) {
|
|
679
|
+
options = {};
|
|
680
|
+
}
|
|
681
|
+
return {
|
|
682
|
+
name: "inline",
|
|
683
|
+
options,
|
|
684
|
+
async fn(state) {
|
|
685
|
+
const {
|
|
686
|
+
placement,
|
|
687
|
+
elements,
|
|
688
|
+
rects,
|
|
689
|
+
platform: platform2,
|
|
690
|
+
strategy
|
|
691
|
+
} = state;
|
|
692
|
+
const {
|
|
693
|
+
padding = 2,
|
|
694
|
+
x,
|
|
695
|
+
y
|
|
696
|
+
} = evaluate(options, state);
|
|
697
|
+
const nativeClientRects = Array.from(await (platform2.getClientRects == null ? void 0 : platform2.getClientRects(elements.reference)) || []);
|
|
698
|
+
const clientRects = getRectsByLine(nativeClientRects);
|
|
699
|
+
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
700
|
+
const paddingObject = getPaddingObject(padding);
|
|
701
|
+
function getBoundingClientRect2() {
|
|
702
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
703
|
+
return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
704
|
+
}
|
|
705
|
+
if (clientRects.length >= 2) {
|
|
706
|
+
if (getSideAxis(placement) === "y") {
|
|
707
|
+
const firstRect = clientRects[0];
|
|
708
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
709
|
+
const isTop = getSide(placement) === "top";
|
|
710
|
+
const top2 = firstRect.top;
|
|
711
|
+
const bottom2 = lastRect.bottom;
|
|
712
|
+
const left2 = isTop ? firstRect.left : lastRect.left;
|
|
713
|
+
const right2 = isTop ? firstRect.right : lastRect.right;
|
|
714
|
+
const width2 = right2 - left2;
|
|
715
|
+
const height2 = bottom2 - top2;
|
|
716
|
+
return {
|
|
717
|
+
top: top2,
|
|
718
|
+
bottom: bottom2,
|
|
719
|
+
left: left2,
|
|
720
|
+
right: right2,
|
|
721
|
+
width: width2,
|
|
722
|
+
height: height2,
|
|
723
|
+
x: left2,
|
|
724
|
+
y: top2
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
const isLeftSide = getSide(placement) === "left";
|
|
728
|
+
const maxRight = max(...clientRects.map((rect) => rect.right));
|
|
729
|
+
const minLeft = min(...clientRects.map((rect) => rect.left));
|
|
730
|
+
const measureRects = clientRects.filter((rect) => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
731
|
+
const top = measureRects[0].top;
|
|
732
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
733
|
+
const left = minLeft;
|
|
734
|
+
const right = maxRight;
|
|
735
|
+
const width = right - left;
|
|
736
|
+
const height = bottom - top;
|
|
737
|
+
return {
|
|
738
|
+
top,
|
|
739
|
+
bottom,
|
|
740
|
+
left,
|
|
741
|
+
right,
|
|
742
|
+
width,
|
|
743
|
+
height,
|
|
744
|
+
x: left,
|
|
745
|
+
y: top
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
return fallback;
|
|
749
|
+
}
|
|
750
|
+
const resetRects = await platform2.getElementRects({
|
|
751
|
+
reference: {
|
|
752
|
+
getBoundingClientRect: getBoundingClientRect2
|
|
753
|
+
},
|
|
754
|
+
floating: elements.floating,
|
|
755
|
+
strategy
|
|
756
|
+
});
|
|
757
|
+
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
758
|
+
return {
|
|
759
|
+
reset: {
|
|
760
|
+
rects: resetRects
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
return {};
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
};
|
|
552
768
|
async function convertValueToCoords(state, options) {
|
|
553
769
|
const {
|
|
554
770
|
placement,
|
|
@@ -1548,11 +1764,13 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1548
1764
|
};
|
|
1549
1765
|
}
|
|
1550
1766
|
const offset = offset$1;
|
|
1767
|
+
const autoPlacement = autoPlacement$1;
|
|
1551
1768
|
const shift = shift$1;
|
|
1552
1769
|
const flip = flip$1;
|
|
1553
1770
|
const size = size$1;
|
|
1554
1771
|
const hide = hide$1;
|
|
1555
1772
|
const arrow$1 = arrow$2;
|
|
1773
|
+
const inline = inline$1;
|
|
1556
1774
|
const limitShift = limitShift$1;
|
|
1557
1775
|
const computePosition = (reference, floating, options) => {
|
|
1558
1776
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -8975,82 +9193,91 @@ const av = /* @__PURE__ */ defineComponent({
|
|
|
8975
9193
|
}
|
|
8976
9194
|
});
|
|
8977
9195
|
export {
|
|
8978
|
-
|
|
9196
|
+
Xv as $,
|
|
8979
9197
|
At as A,
|
|
8980
|
-
|
|
9198
|
+
hide as B,
|
|
8981
9199
|
Ch as C,
|
|
8982
|
-
|
|
8983
|
-
|
|
9200
|
+
inline as D,
|
|
9201
|
+
computePosition as E,
|
|
8984
9202
|
Fy as F,
|
|
8985
9203
|
Gy as G,
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
9204
|
+
yg as H,
|
|
9205
|
+
gg as I,
|
|
9206
|
+
Cg as J,
|
|
8989
9207
|
Kv as K,
|
|
8990
|
-
|
|
8991
|
-
|
|
9208
|
+
bg as L,
|
|
9209
|
+
lv as M,
|
|
8992
9210
|
Ny as N,
|
|
8993
9211
|
Oy as O,
|
|
8994
|
-
|
|
9212
|
+
sv as P,
|
|
8995
9213
|
Qf as Q,
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9214
|
+
My as R,
|
|
9215
|
+
Oh as S,
|
|
9216
|
+
qv as T,
|
|
9217
|
+
Wv as U,
|
|
9000
9218
|
Vy as V,
|
|
9001
9219
|
Wy as W,
|
|
9002
|
-
|
|
9220
|
+
Qv as X,
|
|
9003
9221
|
Yv as Y,
|
|
9004
9222
|
Zv as Z,
|
|
9005
|
-
|
|
9223
|
+
nm as _,
|
|
9006
9224
|
Gl as a,
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9225
|
+
Jv as a0,
|
|
9226
|
+
Hv as a1,
|
|
9227
|
+
tm as a2,
|
|
9228
|
+
Uv as a3,
|
|
9229
|
+
fh as a4,
|
|
9230
|
+
ch as a5,
|
|
9231
|
+
hh as a6,
|
|
9232
|
+
ph as a7,
|
|
9233
|
+
rh as a8,
|
|
9234
|
+
sh as a9,
|
|
9235
|
+
Dv as aa,
|
|
9236
|
+
Eu as ab,
|
|
9237
|
+
xu as ac,
|
|
9238
|
+
Pu as ad,
|
|
9239
|
+
Du as ae,
|
|
9240
|
+
bs as af,
|
|
9241
|
+
ws as ag,
|
|
9242
|
+
_s as ah,
|
|
9243
|
+
xs as ai,
|
|
9244
|
+
gs as aj,
|
|
9245
|
+
zy as ak,
|
|
9246
|
+
Ky as al,
|
|
9247
|
+
Xy as am,
|
|
9248
|
+
jy as an,
|
|
9249
|
+
Yy as ao,
|
|
9250
|
+
Uy as ap,
|
|
9251
|
+
Ly as aq,
|
|
9252
|
+
eg as ar,
|
|
9253
|
+
Qy as as,
|
|
9254
|
+
Lg as at,
|
|
9255
|
+
zg as au,
|
|
9256
|
+
Kg as av,
|
|
9257
|
+
jg as aw,
|
|
9258
|
+
Hg as ax,
|
|
9259
|
+
Wg as ay,
|
|
9033
9260
|
bh as b,
|
|
9034
9261
|
tg as c,
|
|
9035
9262
|
ag as d,
|
|
9036
9263
|
eu as e,
|
|
9037
9264
|
O as f,
|
|
9038
|
-
|
|
9265
|
+
flip as g,
|
|
9039
9266
|
hg as h,
|
|
9040
9267
|
ih as i,
|
|
9041
9268
|
jv as j,
|
|
9042
9269
|
ky as k,
|
|
9043
|
-
|
|
9270
|
+
offset as l,
|
|
9044
9271
|
mg as m,
|
|
9045
9272
|
ng as n,
|
|
9046
9273
|
og as o,
|
|
9047
|
-
|
|
9274
|
+
arrow$1 as p,
|
|
9048
9275
|
qy as q,
|
|
9049
|
-
|
|
9050
|
-
|
|
9276
|
+
size as r,
|
|
9277
|
+
shift as s,
|
|
9051
9278
|
tu as t,
|
|
9052
9279
|
uh as u,
|
|
9053
|
-
|
|
9280
|
+
autoPlacement as v,
|
|
9054
9281
|
wh as w,
|
|
9055
9282
|
xe as x,
|
|
9056
9283
|
ys as y,
|