@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, createCommentVNode, renderSlot } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { T as qv, Y as Yv } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "combobox-group",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, computed, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, createElementVNode } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { U as Wv } from "./chunks/index.js";
|
|
4
4
|
import TextInput from "./text-input.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
package/dist/es/combobox-item.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, normalizeClass, createCommentVNode, createElementBlock, renderSlot, toDisplayString } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import { x as xe,
|
|
3
|
+
import { x as xe, X as Qv } from "./chunks/index.js";
|
|
4
4
|
import { _ as _sfc_main$1 } from "./chunks/checkbox.vue_vue_type_style_index_0_lang.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _hoisted_1 = ["aria-disabled"];
|
package/dist/es/combobox-list.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import { x as xe,
|
|
3
|
+
import { x as xe, _ as nm, $ as Xv, a0 as Jv } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "combobox-list",
|
package/dist/es/combobox-root.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import { x as xe,
|
|
2
|
+
import { x as xe, a1 as Hv } from "./chunks/index.js";
|
|
3
3
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "combobox-root",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a2 as tm } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "combobox-separator",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import { A as At,
|
|
3
|
+
import { A as At, a3 as Uv } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "combobox-trigger",
|
package/dist/es/command-group.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, createCommentVNode, renderSlot } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { T as qv, Y as Yv } from "./chunks/index.js";
|
|
3
3
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "command-group",
|
package/dist/es/command-input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, createVNode, unref, mergeProps } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import { A as At,
|
|
3
|
+
import { A as At, U as Wv } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _hoisted_1 = {
|
|
6
6
|
class: "celeste-command-input",
|
package/dist/es/command-item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import { x as xe,
|
|
2
|
+
import { x as xe, X as Qv } from "./chunks/index.js";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "command-item",
|
|
5
5
|
props: {
|
package/dist/es/command-list.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, renderSlot } from "vue";
|
|
2
|
-
import { x as xe,
|
|
2
|
+
import { x as xe, $ as Xv } from "./chunks/index.js";
|
|
3
3
|
const _hoisted_1 = { role: "presentation" };
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "command-list",
|
package/dist/es/command-root.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import { x as xe,
|
|
2
|
+
import { x as xe, a1 as Hv } from "./chunks/index.js";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "command-root",
|
|
5
5
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a2 as tm } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "command-separator",
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
const fullToolbar = ref([
|
|
3
|
+
{
|
|
4
|
+
slug: "heading",
|
|
5
|
+
name: "Text styles",
|
|
6
|
+
children: [
|
|
7
|
+
{ option: "p", name: "Normal text", active: "paragraph" },
|
|
8
|
+
{ option: "1", name: "Heading 1", active: { level: 1 } },
|
|
9
|
+
{ option: "2", name: "Heading 2", active: { level: 2 } },
|
|
10
|
+
{ option: "3", name: "Heading 3", active: { level: 3 } },
|
|
11
|
+
{ option: "4", name: "Heading 4", active: { level: 4 } },
|
|
12
|
+
{ option: "5", name: "Heading 5", active: { level: 5 } },
|
|
13
|
+
{ option: "6", name: "Heading 6", active: { level: 6 } }
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{ type: "divider" },
|
|
17
|
+
{
|
|
18
|
+
slug: "fontSize",
|
|
19
|
+
name: "Font size",
|
|
20
|
+
children: [
|
|
21
|
+
{ option: "8px", name: "8", active: { fontSize: "8px" } },
|
|
22
|
+
{ option: "10px", name: "10", active: { fontSize: "10px" } },
|
|
23
|
+
{ option: "12px", name: "12", active: { fontSize: "12px" } },
|
|
24
|
+
{ option: "14px", name: "14", active: { fontSize: "14px" } },
|
|
25
|
+
{ option: "16px", name: "16", active: { fontSize: "16px" } },
|
|
26
|
+
{ option: "18px", name: "18", active: { fontSize: "18px" } },
|
|
27
|
+
{ option: "24px", name: "24", active: { fontSize: "24px" } },
|
|
28
|
+
{ option: "30px", name: "30", active: { fontSize: "30px" } },
|
|
29
|
+
{ option: "36px", name: "36", active: { fontSize: "36px" } },
|
|
30
|
+
{ option: "48px", name: "48", active: { fontSize: "48px" } },
|
|
31
|
+
{ option: "60px", name: "60", active: { fontSize: "60px" } },
|
|
32
|
+
{ option: "72px", name: "72", active: { fontSize: "72px" } },
|
|
33
|
+
{ option: "96px", name: "96", active: { fontSize: "96px" } }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{ type: "divider" },
|
|
37
|
+
{
|
|
38
|
+
slug: "color",
|
|
39
|
+
name: "Text color",
|
|
40
|
+
children: [
|
|
41
|
+
{ option: "#000000", name: "Black", icon: "i-celeste-circle-fill", active: { color: "#000000" } },
|
|
42
|
+
{ option: "#7B7B7B", name: "Gray", icon: "i-celeste-circle-fill", active: { color: "#7B7B7B" } },
|
|
43
|
+
{ option: "#335CFF", name: "Blue", icon: "i-celeste-circle-fill", active: { color: "#335CFF" } },
|
|
44
|
+
{ option: "#FA7319", name: "Orange", icon: "i-celeste-circle-fill", active: { color: "#FA7319" } },
|
|
45
|
+
{ option: "#7D52F4", name: "Purple", icon: "i-celeste-circle-fill", active: { color: "#7D52F4" } },
|
|
46
|
+
{ option: "#47C2FF", name: "Sky", icon: "i-celeste-circle-fill", active: { color: "#47C2FF" } }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{ type: "divider" },
|
|
50
|
+
{ slug: "bold", name: "Bold", icon: "i-celeste-bold", active: "bold" },
|
|
51
|
+
{ slug: "italic", name: "Italic", icon: "i-celeste-italic", active: "italic" },
|
|
52
|
+
{ slug: "underline", name: "Underline", icon: "i-celeste-underline", active: "underline" },
|
|
53
|
+
{ slug: "strike", name: "Strike", icon: "i-celeste-strikethrough", active: "strike" },
|
|
54
|
+
{ type: "divider" },
|
|
55
|
+
{ slug: "bulletList", name: "Bulleted list", icon: "i-celeste-list-unordered", active: "bulletList" },
|
|
56
|
+
{ slug: "orderedList", name: "Numbered list", icon: "i-celeste-list-ordered", active: "orderedList" },
|
|
57
|
+
{ type: "divider" },
|
|
58
|
+
{
|
|
59
|
+
slug: "align",
|
|
60
|
+
name: "Text alignment",
|
|
61
|
+
children: [
|
|
62
|
+
{ option: "left", name: "Left align", icon: "i-celeste-align-left", active: { textAlign: "left" } },
|
|
63
|
+
{ option: "center", name: "Center align", icon: "i-celeste-align-center", active: { textAlign: "center" } },
|
|
64
|
+
{ option: "right", name: "Right align", icon: "i-celeste-align-right", active: { textAlign: "right" } },
|
|
65
|
+
{ option: "justify", name: "Justify", icon: "i-celeste-align-justify", active: { textAlign: "justify" } }
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{ type: "divider" },
|
|
69
|
+
{ slug: "link", name: "Insert Link", icon: "i-celeste-link", active: "link" },
|
|
70
|
+
{ type: "divider" },
|
|
71
|
+
{ slug: "undo", name: "Undo", icon: "i-celeste-arrow-go-back-line", active: "undo" },
|
|
72
|
+
{ slug: "redo", name: "Redo", icon: "i-celeste-arrow-go-forward-line", active: "redo" },
|
|
73
|
+
{ slug: "clear", name: "Clear style", icon: "i-celeste-format-clear", active: "clear" }
|
|
74
|
+
]);
|
|
75
|
+
function onActionClick(editor, slug, option = null, showLinkBubble) {
|
|
76
|
+
var _a;
|
|
77
|
+
const chain = editor.chain().focus();
|
|
78
|
+
if (!chain) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const actionTriggers = {
|
|
82
|
+
heading: () => {
|
|
83
|
+
if (!option) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (option === "p") {
|
|
87
|
+
chain.setParagraph().run();
|
|
88
|
+
} else {
|
|
89
|
+
const headingLevel = Number(option);
|
|
90
|
+
chain.toggleHeading({ level: headingLevel }).run();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
fontSize: () => {
|
|
94
|
+
editor.chain().focus().setFontSize(option ?? "16px").run();
|
|
95
|
+
},
|
|
96
|
+
color: () => {
|
|
97
|
+
editor.chain().focus().setColor(option ?? "#000000").run();
|
|
98
|
+
},
|
|
99
|
+
bold: () => chain.toggleBold().run(),
|
|
100
|
+
italic: () => chain.toggleItalic().run(),
|
|
101
|
+
underline: () => chain.toggleUnderline().run(),
|
|
102
|
+
strike: () => chain.toggleStrike().run(),
|
|
103
|
+
bulletList: () => chain.toggleBulletList().run(),
|
|
104
|
+
orderedList: () => chain.toggleOrderedList().run(),
|
|
105
|
+
align: () => chain.setTextAlign(option ?? "left").run(),
|
|
106
|
+
link: () => {
|
|
107
|
+
if (showLinkBubble) {
|
|
108
|
+
showLinkBubble();
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
undo: () => chain.undo().run(),
|
|
112
|
+
redo: () => chain.redo().run(),
|
|
113
|
+
clear: () => chain.clearNodes().unsetAllMarks().run()
|
|
114
|
+
};
|
|
115
|
+
(_a = actionTriggers[slug]) == null ? void 0 : _a.call(actionTriggers);
|
|
116
|
+
}
|
|
117
|
+
function selectedOption(editor, children) {
|
|
118
|
+
if (!Array.isArray(children)) {
|
|
119
|
+
return "";
|
|
120
|
+
}
|
|
121
|
+
for (const child of children) {
|
|
122
|
+
if (Object.prototype.hasOwnProperty.call(child.active, "fontSize")) {
|
|
123
|
+
const currentFontSize = editor.getAttributes("textStyle").fontSize || "16px";
|
|
124
|
+
return currentFontSize;
|
|
125
|
+
}
|
|
126
|
+
if (editor.isActive(child.active)) {
|
|
127
|
+
return child.option;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return children[0].option;
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
fullToolbar,
|
|
134
|
+
onActionClick,
|
|
135
|
+
selectedOption
|
|
136
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { a4 as fh } from "./chunks/index.js";
|
|
3
3
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "dropdown-menu-group",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, renderSlot, toDisplayString, createElementBlock, createCommentVNode } from "vue";
|
|
2
2
|
import { useDelegatedProps } from "./use-delegated-props.js";
|
|
3
3
|
import { c as clsx } from "./chunks/clsx.js";
|
|
4
|
-
import { A as At,
|
|
4
|
+
import { A as At, a5 as ch } from "./chunks/index.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _hoisted_1 = { class: "celeste-dropdown-menu-item-prefix" };
|
|
7
7
|
const _hoisted_2 = { class: "celeste-dropdown-menu-item-body" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
2
|
import { useDelegatedProps } from "./use-delegated-props.js";
|
|
3
3
|
import { c as clsx } from "./chunks/clsx.js";
|
|
4
|
-
import { A as At,
|
|
4
|
+
import { A as At, a6 as hh } from "./chunks/index.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "dropdown-menu-label",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps } 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 { a7 as ph } from "./chunks/index.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "dropdown-menu-separator",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import { A as At,
|
|
2
|
+
import { A as At, a8 as rh } from "./chunks/index.js";
|
|
3
3
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "dropdown-menu-trigger",
|
package/dist/es/dropdown-menu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
2
|
import { useDelegatedProps } from "./use-delegated-props.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a9 as sh } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "dropdown-menu",
|
package/dist/es/dropdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, ref, computed, watch, openBlock, createElementBlock, withKeys, createVNode, unref, withCtx, normalizeClass, createElementVNode, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps, toDisplayString, createBlock, createSlots, Fragment, renderList } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a1 as Hv, j as jv, a3 as Uv, $ as Xv, a0 as Jv, a2 as tm, Z as Zv, T as qv, X as Qv } from "./chunks/index.js";
|
|
4
4
|
import Badge from "./badge.js";
|
|
5
5
|
import TextInput from "./text-input.js";
|
|
6
6
|
import DropdownItem from "./dropdown-item.js";
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createElementVNode, normalizeClass, toDisplayString } from "vue";
|
|
2
|
+
import CompactButton from "./compact-button.js";
|
|
3
|
+
import SelectContent from "./select-content.js";
|
|
4
|
+
import SelectIcon from "./select-icon.js";
|
|
5
|
+
import SelectItem from "./select-item.js";
|
|
6
|
+
import SelectTrigger from "./select-trigger.js";
|
|
7
|
+
import { _ as _sfc_main$1 } from "./chunks/select.js";
|
|
8
|
+
import Tooltip from "./tooltip.js";
|
|
9
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
10
|
+
const _hoisted_1 = { class: "show-more-wrapper" };
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "extra-settings",
|
|
13
|
+
props: {
|
|
14
|
+
editor: {}
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const defaultValue = ref("");
|
|
19
|
+
const extraSettings = [
|
|
20
|
+
{
|
|
21
|
+
name: "Copy",
|
|
22
|
+
icon: "i-celeste-file-copy-line"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "Cut",
|
|
26
|
+
icon: "i-celeste-scissors-line"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Delete",
|
|
30
|
+
icon: "i-celeste-delete-bin-4-line"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "Duplicate",
|
|
34
|
+
icon: "i-celeste-add-circle-line"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
function selectedText(editor) {
|
|
38
|
+
const { from, to } = editor.state.selection;
|
|
39
|
+
const text = editor.state.doc.textBetween(from, to, "\n");
|
|
40
|
+
return text || null;
|
|
41
|
+
}
|
|
42
|
+
async function copySelectionToClipboard(editor) {
|
|
43
|
+
const text = selectedText(editor);
|
|
44
|
+
if (!text) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
if (!window.isSecureContext) {
|
|
49
|
+
throw new Error("Clipboard API is not available in insecure contexts");
|
|
50
|
+
}
|
|
51
|
+
const copyText = await navigator.clipboard.writeText(text);
|
|
52
|
+
return copyText;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function cutSelection(editor) {
|
|
58
|
+
await copySelectionToClipboard(editor);
|
|
59
|
+
deleteSelection(editor);
|
|
60
|
+
}
|
|
61
|
+
function deleteSelection(editor) {
|
|
62
|
+
return editor.commands.deleteSelection();
|
|
63
|
+
}
|
|
64
|
+
function duplicateSelection(editor) {
|
|
65
|
+
const { to } = editor.state.selection;
|
|
66
|
+
const text = selectedText(editor);
|
|
67
|
+
if (!text) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
return editor.commands.insertContentAt(to, text);
|
|
71
|
+
}
|
|
72
|
+
function clearSelectedValue() {
|
|
73
|
+
defaultValue.value = "";
|
|
74
|
+
}
|
|
75
|
+
function onActionClick(name, editor) {
|
|
76
|
+
switch (name) {
|
|
77
|
+
case "Copy":
|
|
78
|
+
copySelectionToClipboard(editor);
|
|
79
|
+
break;
|
|
80
|
+
case "Cut":
|
|
81
|
+
cutSelection(editor);
|
|
82
|
+
break;
|
|
83
|
+
case "Delete":
|
|
84
|
+
deleteSelection(editor);
|
|
85
|
+
break;
|
|
86
|
+
case "Duplicate":
|
|
87
|
+
duplicateSelection(editor);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return (_ctx, _cache) => {
|
|
92
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
93
|
+
createVNode(_sfc_main$1, {
|
|
94
|
+
modelValue: defaultValue.value,
|
|
95
|
+
"onUpdate:modelValue": [
|
|
96
|
+
_cache[0] || (_cache[0] = ($event) => defaultValue.value = $event),
|
|
97
|
+
_cache[1] || (_cache[1] = ($event) => onActionClick($event, props.editor))
|
|
98
|
+
],
|
|
99
|
+
"onUpdate:open": clearSelectedValue
|
|
100
|
+
}, {
|
|
101
|
+
default: withCtx(() => [
|
|
102
|
+
createVNode(SelectTrigger, { variant: "inline" }, {
|
|
103
|
+
default: withCtx(() => [
|
|
104
|
+
createVNode(Tooltip, {
|
|
105
|
+
title: "Extra settings",
|
|
106
|
+
variant: "dark"
|
|
107
|
+
}, {
|
|
108
|
+
default: withCtx(() => [
|
|
109
|
+
createVNode(CompactButton, {
|
|
110
|
+
icon: "i-celeste-more-2-line",
|
|
111
|
+
variant: "ghost"
|
|
112
|
+
})
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
})
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}),
|
|
119
|
+
createVNode(SelectContent, {
|
|
120
|
+
align: "end",
|
|
121
|
+
width: "fit"
|
|
122
|
+
}, {
|
|
123
|
+
default: withCtx(() => [
|
|
124
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(extraSettings, (item, index) => {
|
|
125
|
+
return createVNode(SelectItem, {
|
|
126
|
+
key: index,
|
|
127
|
+
value: item.name
|
|
128
|
+
}, {
|
|
129
|
+
default: withCtx(() => [
|
|
130
|
+
createVNode(SelectIcon, null, {
|
|
131
|
+
default: withCtx(() => [
|
|
132
|
+
createElementVNode("i", {
|
|
133
|
+
class: normalizeClass(item.icon)
|
|
134
|
+
}, null, 2)
|
|
135
|
+
]),
|
|
136
|
+
_: 2
|
|
137
|
+
}, 1024),
|
|
138
|
+
createElementVNode("span", null, toDisplayString(item.name), 1)
|
|
139
|
+
]),
|
|
140
|
+
_: 2
|
|
141
|
+
}, 1032, ["value"]);
|
|
142
|
+
}), 64))
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
})
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["modelValue"])
|
|
149
|
+
]);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const ExtraSettings = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-49d51443"]]);
|
|
154
|
+
export {
|
|
155
|
+
ExtraSettings as default
|
|
156
|
+
};
|