@vite-hub/ui 0.8.0 → 0.9.0
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/README.md +66 -50
- package/dist/{Chat-CuSthJVg.js → Chat-DYQitDw8.js} +1 -1
- package/dist/{ChatMessage-CFQs0v4N.js → ChatMessage-DzjHnxMT.js} +1 -1
- package/dist/{CodeBlockTitle-DIu8Ef3V.js → CodeBlockTitle-DX13mCTi.js} +1 -1
- package/dist/{CommentRow-XY3FNp30.js → CommentRow-DLW77qch.js} +2 -2
- package/dist/{CopyButton-Bs6DT-Z8.js → CopyButton-D-g6PWc8.js} +3 -3
- package/dist/{Markdown-Da5t-931.js → Markdown-3-Tvy5Kl.js} +1 -1
- package/dist/{MarkdownCodeBlock-BWDLOWPO.js → MarkdownCodeBlock-CALGW0iw.js} +1 -1
- package/dist/{MessageParts-CyJLG34y.js → MessageParts-BGSctG7Z.js} +1 -1
- package/dist/{MorphText-B6MWdeIv.js → MorphText-DAHAswWX.js} +1 -1
- package/dist/{RollNumber-CnF52zJM.js → RollNumber-CkdLiy2i.js} +1 -1
- package/dist/{SwapIcon-CUIq1TU5.js → SwapIcon-Bjkk7WlZ.js} +1 -1
- package/dist/{agent-session-2j2gbGpp.js → agent-session-D291hyRk.js} +1 -1
- package/dist/{avatar-stack-CoLlsmwJ.js → avatar-stack-Bi4CJPuU.js} +1 -1
- package/dist/{chat-session-cxUzvwdj.js → chat-session-Bl-x4c9b.js} +1 -1
- package/dist/{code-block-BqOEVWPh.d.ts → code-block-Bp8y-XJp.d.ts} +1 -1
- package/dist/{comment-composer-D_mcH3Ts.js → comment-composer-BtYrIT5W.js} +14 -19
- package/dist/{comment-composer-CsVOvG9j.d.ts → comment-composer-PmERtNNb.d.ts} +6 -6
- package/dist/{comment-layer-C3xmg-0_.d.ts → comment-layer-BgQz1ixK.d.ts} +6 -6
- package/dist/{comment-layer-Ci6ipGi2.js → comment-layer-T8hN_7bN.js} +11 -12
- package/dist/{comment-panel-DxN21VoY.d.ts → comment-panel-Vo3m6rHB.d.ts} +8 -8
- package/dist/{comment-selection-bar-DZAtiRZ9.js → comment-selection-bar-BMFTtI3V.js} +2 -3
- package/dist/{comment-thread-BzOZVqF2.js → comment-thread-CAexk1r7.js} +78 -38
- package/dist/{comment-thread-BmsqcjVQ.d.ts → comment-thread-Cp9k80uv.d.ts} +53 -5
- package/dist/{comments-BU8cTt5o.d.ts → comments-BBNiQTxK.d.ts} +4 -4
- package/dist/{components-B_2Q0dJ3.js → components-D44u1fsy.js} +22 -47
- package/dist/{config-BDQYUjjp.js → config-7CiYbXk6.js} +8 -5
- package/dist/{config-JmsTI7gs.d.ts → config-BYLPA0Ts.d.ts} +8 -6
- package/dist/{drop-field-DeIvKoJs.js → drop-field-BkoJOWR9.js} +1 -1
- package/dist/{editor-hXea1i46.js → editor-CE_q2Yzb.js} +89 -49
- package/dist/{editor-BsOTjnnN.d.ts → editor-DZxaa6vs.d.ts} +8 -7
- package/dist/editor.d.ts +2 -2
- package/dist/editor.js +2 -2
- package/dist/{hold-to-delete-DazElJT2.js → hold-to-delete-pyrlKzk0.js} +1 -1
- package/dist/{hold-to-delete-D1Vy40w5.js → hold-to-delete-sscThmPW.js} +1 -1
- package/dist/icon-component-ofUeRW4L.js +4 -0
- package/dist/{index-CffOzibW.d.ts → index-BlQsW8ZZ.d.ts} +1 -1
- package/dist/index.d.ts +11 -18
- package/dist/index.js +23 -24
- package/dist/{markdown-_0HhbsOo.js → markdown-CqVyNG-h.js} +2 -2
- package/dist/markdown-editor.d.ts +1 -1
- package/dist/markdown-editor.js +4 -4
- package/dist/markdown.js +1 -1
- package/dist/motion/core.d.ts +1 -1
- package/dist/motion/core.js +4 -4
- package/dist/{motion-BhARaNBB.js → motion-C8P5yWaA.js} +1 -1
- package/dist/{motion-core-gfsTPLbh.d.ts → motion-core-BEwxN7Il.d.ts} +0 -2
- package/dist/{motion-core-JZZiPKEk.js → motion-core-pkL0M4Y1.js} +3 -46
- package/dist/{motion-list-9vD1hSS0.js → motion-list-DDVUyVYa.js} +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +5 -5
- package/dist/nuxt.d.ts +2 -4
- package/dist/nuxt.js +1 -33
- package/dist/parts/components/agent-session.js +1 -1
- package/dist/parts/components/avatar-stack.js +1 -1
- package/dist/parts/components/chat-message.js +1 -1
- package/dist/parts/components/chat-session.js +1 -1
- package/dist/parts/components/chat.js +1 -1
- package/dist/parts/components/code-block.d.ts +1 -1
- package/dist/parts/components/code-block.js +1 -1
- package/dist/parts/components/comment-composer.d.ts +1 -1
- package/dist/parts/components/comment-composer.js +1 -1
- package/dist/parts/components/comment-layer.d.ts +1 -1
- package/dist/parts/components/comment-layer.js +1 -1
- package/dist/parts/components/comment-panel.d.ts +1 -1
- package/dist/parts/components/comment-panel.js +6 -7
- package/dist/parts/components/comment-selection-bar.js +1 -1
- package/dist/parts/components/comment-thread.d.ts +1 -1
- package/dist/parts/components/comment-thread.js +1 -1
- package/dist/parts/components/comments.d.ts +5 -5
- package/dist/parts/components/comments.js +4 -4
- package/dist/parts/components/copy-button.js +1 -1
- package/dist/parts/components/drop-field.js +1 -1
- package/dist/parts/components/hold-to-delete.js +1 -1
- package/dist/parts/components/markdown.js +1 -1
- package/dist/parts/components/message-parts.js +1 -1
- package/dist/parts/components/motion-list.d.ts +1 -1
- package/dist/parts/components/motion-list.js +1 -1
- package/dist/parts/components/motion.d.ts +2 -2
- package/dist/parts/components/motion.js +4 -4
- package/dist/parts/components/progress.js +1 -1
- package/dist/parts/components/prompt-input.d.ts +1 -1
- package/dist/parts/components/sync-status.js +1 -1
- package/dist/parts/playground/share.js +0 -1
- package/dist/parts/workspace/browser-support-notice.d.ts +2 -2
- package/dist/parts/workspace/browser-support-notice.js +4 -4
- package/dist/parts/workspace/codemirror.js +0 -4
- package/dist/parts/workspace/connect-panel.js +2 -3
- package/dist/parts/workspace/file-icons.js +0 -8
- package/dist/parts/workspace/runners/web-container.js +2 -2
- package/dist/parts/workspace/workspace-bar.d.ts +1 -1
- package/dist/parts/workspace/workspace-bar.js +2 -3
- package/dist/parts/workspace/workspace-boot-status.js +1 -1
- package/dist/parts/workspace/workspace-editor-head.js +2 -3
- package/dist/parts/workspace/workspace-examples.js +4 -5
- package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
- package/dist/parts/workspace/workspace-guide.d.ts +1 -1
- package/dist/parts/workspace/workspace-guide.js +3 -4
- package/dist/parts/workspace/workspace-preview.d.ts +1 -1
- package/dist/parts/workspace/workspace-preview.js +2 -4
- package/dist/parts/workspace/workspace-shell.d.ts +1 -1
- package/dist/parts/workspace/workspace-shell.js +2 -7
- package/dist/parts/workspace/workspace-sidebar.d.ts +3 -3
- package/dist/parts/workspace/workspace-sidebar.js +5 -6
- package/dist/parts/workspace/workspace-start.d.ts +1 -1
- package/dist/parts/workspace/workspace-start.js +2 -3
- package/dist/parts/workspace/workspace-steps.js +6 -7
- package/dist/parts/workspace/workspace-terminal.js +0 -6
- package/dist/parts/workspace/workspace.d.ts +5 -5
- package/dist/parts/workspace/workspace.js +15 -18
- package/dist/{progress-8P8RLYMy.js → progress-D7CyDkLW.js} +1 -1
- package/dist/{prompt-input-j4OFTF5p.d.ts → prompt-input-DZM3E6WP.d.ts} +2 -2
- package/dist/{ring-B0nZBnU0.js → ring-C5lNUEAG.js} +1 -1
- package/dist/runtime/nuxt-plugin.js +27 -1
- package/dist/{stand-ins-CuKM1UH1.js → stand-ins-C2oSoNwV.js} +29 -84
- package/dist/styles.css +27 -9
- package/dist/{sync-status-B29eG_n-.js → sync-status-D27Qt7mk.js} +1 -1
- package/dist/theme-focus-ring.css +1 -1
- package/dist/{tween-1W-LlKk9.js → tween-DGAmrS3r.js} +0 -2
- package/dist/{vue-BdA18K5-.js → vue-D70TZJhJ.js} +1 -1
- package/dist/{workspace-boot-status-CyGlJS06.js → workspace-boot-status-BDkpubHd.js} +0 -1
- package/dist/{workspace-shell-B4A7CINd.d.ts → workspace-shell-CwEQT_1s.d.ts} +1 -1
- package/dist/workspace.d.ts +1 -1
- package/dist/workspace.js +1 -1
- package/package.json +10 -15
- package/dist/nuxt-ui-D3Qda35W.js +0 -22
- package/dist/theme.css +0 -379
- package/dist/theme.d.ts +0 -410
- package/dist/theme.js +0 -290
- package/dist/ui-components-CKQAPI-W.js +0 -7
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as useUIComponent } from "./nuxt-ui-D3Qda35W.js";
|
|
4
|
-
import { n as UIcon, r as text, t as UButton } from "./stand-ins-CuKM1UH1.js";
|
|
1
|
+
import { r as useViteHubUIIcons } from "./config-7CiYbXk6.js";
|
|
2
|
+
import { i as text, r as ViteHubIcon } from "./stand-ins-C2oSoNwV.js";
|
|
5
3
|
import { cloneVNode, computed, defineComponent, h, isVNode, nextTick, onMounted, ref } from "vue";
|
|
6
4
|
import { Tabs, TabsList, TabsTab } from "@ui-sdk/vue/tabs";
|
|
7
5
|
import { Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "@ui-sdk/vue/dialog";
|
|
8
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "@ui-sdk/vue/tooltip";
|
|
9
6
|
import { Input, InputGroup } from "@ui-sdk/vue/input";
|
|
10
7
|
import { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuItemIcon, MenuItemIndicator, MenuSeparator, MenuTrigger } from "@ui-sdk/vue/menu";
|
|
8
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@ui-sdk/vue/tooltip";
|
|
11
9
|
// src/ui-sdk/components.ts
|
|
12
|
-
var components_exports = /* @__PURE__ */ __exportAll({ uiSdkComponents: () => uiSdkComponents });
|
|
13
|
-
/**
|
|
14
|
-
* The parts render components by Nuxt UI's names (see `internal/nuxt-ui.ts`), and these are the defaults. They take the
|
|
15
|
-
* props that the parts pass, render ui-sdk parts, and carry the `data-slot` and `data-variant` names that the kit style
|
|
16
|
-
* family (`@vite-hub/kit/styles/default.css`) styles.
|
|
17
|
-
*/
|
|
18
10
|
/**
|
|
19
|
-
*
|
|
20
|
-
* a part's `data-slot` goes to `data-part` of the input, as on `
|
|
11
|
+
* The input: a frame with the `leading` and `trailing` slots around the input. `class` goes to the frame, and
|
|
12
|
+
* a part's `data-slot` goes to `data-part` of the input, as on `ViteHubButton`.
|
|
21
13
|
*/
|
|
22
|
-
const
|
|
23
|
-
name: "
|
|
14
|
+
const ViteHubInput = defineComponent({
|
|
15
|
+
name: "ViteHubInput",
|
|
24
16
|
inheritAttrs: false,
|
|
25
17
|
props: {
|
|
26
18
|
autofocus: {
|
|
@@ -77,11 +69,11 @@ function asTrigger(children, props) {
|
|
|
77
69
|
return cloneVNode(vnode, trigger, true);
|
|
78
70
|
}
|
|
79
71
|
/**
|
|
80
|
-
*
|
|
72
|
+
* The dialog: the default slot opens it, and `content` replaces the title, the description, `body`, and
|
|
81
73
|
* `footer`. `open` with `update:open` controls it. `ui.overlay` and `ui.content` style the backdrop and the dialog.
|
|
82
74
|
*/
|
|
83
|
-
const
|
|
84
|
-
name: "
|
|
75
|
+
const ViteHubModal = defineComponent({
|
|
76
|
+
name: "ViteHubModal",
|
|
85
77
|
inheritAttrs: false,
|
|
86
78
|
props: {
|
|
87
79
|
close: {
|
|
@@ -109,7 +101,6 @@ const UModal = defineComponent({
|
|
|
109
101
|
},
|
|
110
102
|
emits: { "update:open": (_open) => true },
|
|
111
103
|
setup(props, { emit, slots }) {
|
|
112
|
-
const UIcon = useUIComponent("UIcon");
|
|
113
104
|
const icons = useViteHubUIIcons();
|
|
114
105
|
const inner = ref(false);
|
|
115
106
|
const open = computed(() => props.open ?? inner.value);
|
|
@@ -133,14 +124,14 @@ const UModal = defineComponent({
|
|
|
133
124
|
props.description ? h(DialogDescription, () => props.description) : null,
|
|
134
125
|
slots.body?.({ close }),
|
|
135
126
|
slots.footer ? h("div", { "data-slot": "dialog-footer" }, slots.footer({ close })) : null,
|
|
136
|
-
props.close ? h(DialogClose, { "aria-label": "Close" }, () => h(
|
|
127
|
+
props.close ? h(DialogClose, { "aria-label": "Close" }, () => h(ViteHubIcon, { name: icons.value.close })) : null
|
|
137
128
|
])
|
|
138
129
|
]);
|
|
139
130
|
}
|
|
140
131
|
});
|
|
141
|
-
/** Nuxt UI's
|
|
142
|
-
const
|
|
143
|
-
name: "
|
|
132
|
+
/** The tab list, like Nuxt UI's tabs with `content: false`: a tab list from `items`, with `v-model`. */
|
|
133
|
+
const ViteHubTabs = defineComponent({
|
|
134
|
+
name: "ViteHubTabs",
|
|
144
135
|
inheritAttrs: false,
|
|
145
136
|
props: {
|
|
146
137
|
content: {
|
|
@@ -155,7 +146,6 @@ const UTabs = defineComponent({
|
|
|
155
146
|
},
|
|
156
147
|
emits: { "update:modelValue": (_value) => true },
|
|
157
148
|
setup(props, { attrs, emit }) {
|
|
158
|
-
const UIcon = useUIComponent("UIcon");
|
|
159
149
|
return () => {
|
|
160
150
|
const { "aria-label": label, ...root } = attrs;
|
|
161
151
|
return h(Tabs, {
|
|
@@ -170,7 +160,7 @@ const UTabs = defineComponent({
|
|
|
170
160
|
key: item.value,
|
|
171
161
|
value: String(item.value)
|
|
172
162
|
}, () => [
|
|
173
|
-
item.icon ? h(
|
|
163
|
+
item.icon ? h(ViteHubIcon, { name: item.icon }) : null,
|
|
174
164
|
item.label,
|
|
175
165
|
item.badge === void 0 || item.badge === false ? null : h("span", { "data-slot": "tabs-tab-badge" }, item.badge === true ? "" : String(item.badge))
|
|
176
166
|
]))));
|
|
@@ -178,11 +168,11 @@ const UTabs = defineComponent({
|
|
|
178
168
|
}
|
|
179
169
|
});
|
|
180
170
|
/**
|
|
181
|
-
*
|
|
171
|
+
* The menu: the default slot opens it, and `items` holds groups of entries, or one group.
|
|
182
172
|
* `update:open` tells when it opens and closes.
|
|
183
173
|
*/
|
|
184
|
-
const
|
|
185
|
-
name: "
|
|
174
|
+
const ViteHubDropdownMenu = defineComponent({
|
|
175
|
+
name: "ViteHubDropdownMenu",
|
|
186
176
|
inheritAttrs: false,
|
|
187
177
|
props: {
|
|
188
178
|
content: {
|
|
@@ -200,12 +190,11 @@ const UDropdownMenu = defineComponent({
|
|
|
200
190
|
},
|
|
201
191
|
emits: { "update:open": (_open) => true },
|
|
202
192
|
setup(props, { emit, slots }) {
|
|
203
|
-
const UIcon = useUIComponent("UIcon");
|
|
204
193
|
const entry = (item, index, group) => {
|
|
205
194
|
if (item.type === "label") return h(MenuGroupLabel, { key: index }, () => item.label);
|
|
206
195
|
if (item.type === "separator") return h(MenuSeparator, { key: index });
|
|
207
196
|
const body = () => [
|
|
208
|
-
item.icon ? h(MenuItemIcon, () => h(
|
|
197
|
+
item.icon ? h(MenuItemIcon, () => h(ViteHubIcon, { name: item.icon })) : null,
|
|
209
198
|
h("span", item.label),
|
|
210
199
|
item.description ? h("span", { "data-slot": "menu-item-description" }, item.description) : null
|
|
211
200
|
];
|
|
@@ -234,8 +223,8 @@ const UDropdownMenu = defineComponent({
|
|
|
234
223
|
};
|
|
235
224
|
}
|
|
236
225
|
});
|
|
237
|
-
const
|
|
238
|
-
name: "
|
|
226
|
+
const ViteHubTooltip = defineComponent({
|
|
227
|
+
name: "ViteHubTooltip",
|
|
239
228
|
inheritAttrs: false,
|
|
240
229
|
props: {
|
|
241
230
|
content: {
|
|
@@ -252,18 +241,4 @@ const UTooltip = defineComponent({
|
|
|
252
241
|
}, () => slots.content ? slots.content() : props.text) : null]);
|
|
253
242
|
}
|
|
254
243
|
});
|
|
255
|
-
|
|
256
|
-
* The components that the parts render by default, on ui-sdk. Load the kit style family for their look. `UIcon` draws
|
|
257
|
-
* the icons that the parts use; to show other icons, such as your own in `createViteHubUI({ icons })`, pass your own
|
|
258
|
-
* `UIcon` to `createViteHubUI({ components })`.
|
|
259
|
-
*/
|
|
260
|
-
const uiSdkComponents = {
|
|
261
|
-
UButton,
|
|
262
|
-
UDropdownMenu,
|
|
263
|
-
UIcon,
|
|
264
|
-
UInput,
|
|
265
|
-
UModal,
|
|
266
|
-
UTabs,
|
|
267
|
-
UTooltip
|
|
268
|
-
};
|
|
269
|
-
export { uiSdkComponents as n, components_exports as t };
|
|
244
|
+
export { ViteHubTooltip as a, ViteHubTabs as i, ViteHubInput as n, ViteHubModal as r, ViteHubDropdownMenu as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as iconComponentKey } from "./icon-component-ofUeRW4L.js";
|
|
2
2
|
import { vRing } from "./parts/components/motion.js";
|
|
3
|
-
import { h as setMotionPressMode } from "./motion-core-
|
|
4
|
-
import { t as installMotion } from "./motion-
|
|
3
|
+
import { h as setMotionPressMode } from "./motion-core-pkL0M4Y1.js";
|
|
4
|
+
import { t as installMotion } from "./motion-C8P5yWaA.js";
|
|
5
5
|
import { computed, inject, toValue } from "vue";
|
|
6
6
|
// src/config.ts
|
|
7
7
|
const iconsKey = Symbol("ViteHubUIIcons");
|
|
@@ -39,9 +39,12 @@ function useViteHubUIIcons() {
|
|
|
39
39
|
...Object.fromEntries(Object.entries(toValue(icons) ?? {}).filter(([, icon]) => icon))
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
|
+
function useViteHubUIIconComponent() {
|
|
43
|
+
return inject(iconComponentKey, void 0);
|
|
44
|
+
}
|
|
42
45
|
function createViteHubUI(options = {}) {
|
|
43
46
|
return { install(app) {
|
|
44
|
-
if (options.
|
|
47
|
+
if (options.iconComponent) app.provide(iconComponentKey, options.iconComponent);
|
|
45
48
|
if (options.icons) app.provide(iconsKey, options.icons);
|
|
46
49
|
const motionEnabled = options.motion !== false;
|
|
47
50
|
app.provide(motionEnabledKey, motionEnabled);
|
|
@@ -53,4 +56,4 @@ function createViteHubUI(options = {}) {
|
|
|
53
56
|
if (!app.directive("ring")) app.directive("ring", vRing);
|
|
54
57
|
} };
|
|
55
58
|
}
|
|
56
|
-
export {
|
|
59
|
+
export { useViteHubUIMotionEnabled as i, useViteHubUIIconComponent as n, useViteHubUIIcons as r, createViteHubUI as t };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { t as MotionPressMode } from "./press-BuEC-XvZ.js";
|
|
2
2
|
import { Component, ComputedRef, MaybeRefOrGetter, Plugin } from "vue";
|
|
3
|
-
type ViteHubUIComponentName = "UButton" | "UDropdownMenu" | "UEditorDragHandle" | "UEditorSuggestionMenu" | "UEditorToolbar" | "UIcon" | "UInput" | "UModal" | "UTabs" | "UTooltip";
|
|
4
|
-
type ViteHubUIComponents = Partial<Record<ViteHubUIComponentName, Component>>;
|
|
5
3
|
/**
|
|
6
4
|
* The icons that the parts render, by name. The names from `arrowLeft` to `stop` are Nuxt UI's `appConfig.ui.icons`
|
|
7
5
|
* names. The others are ViteHub names, for actions that Nuxt UI has no icon for. In Nuxt, the module reads both from
|
|
@@ -58,9 +56,12 @@ interface ViteHubUIMotionOptions {
|
|
|
58
56
|
press?: MotionPressMode;
|
|
59
57
|
}
|
|
60
58
|
interface ViteHubUIOptions {
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
/**
|
|
60
|
+
* The component that draws an icon, with the icon name in its `name` prop, such as `i-lucide-x`. The default draws the
|
|
61
|
+
* Lucide icons that the parts use and nothing for other names. Pass your own to draw the icons of `icons`.
|
|
62
|
+
*/
|
|
63
|
+
iconComponent?: Component;
|
|
64
|
+
/** Icons by name, such as `{ close: "i-lucide-circle-x" }`. A ref or a getter keeps them reactive. */
|
|
64
65
|
icons?: MaybeRefOrGetter<ViteHubUIIconOptions | undefined>;
|
|
65
66
|
/**
|
|
66
67
|
* The motion layer of `@vite-hub/ui/motion`: press, toggle, select, drag, and appear motion by role. It starts in the
|
|
@@ -71,5 +72,6 @@ interface ViteHubUIOptions {
|
|
|
71
72
|
declare function useViteHubUIMotionEnabled(): boolean;
|
|
72
73
|
/** The icons that the parts render. It reads them on each render, so a reactive app config updates them. */
|
|
73
74
|
declare function useViteHubUIIcons(): ComputedRef<Required<ViteHubUIIconOptions>>;
|
|
75
|
+
declare function useViteHubUIIconComponent(): Component | undefined;
|
|
74
76
|
declare function createViteHubUI(options?: ViteHubUIOptions): Plugin;
|
|
75
|
-
export {
|
|
77
|
+
export { useViteHubUIIconComponent as a, createViteHubUI as i, ViteHubUIMotionOptions as n, useViteHubUIIcons as o, ViteHubUIOptions as r, useViteHubUIMotionEnabled as s, ViteHubUIIconOptions as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createDropField } from "./motion-core-
|
|
1
|
+
import { t as createDropField } from "./motion-core-pkL0M4Y1.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, toDisplayString, useTemplateRef } from "vue";
|
|
3
3
|
// registry/drop-field/DropField.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1 = ["data-disabled"];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { C as shikiDark, S as theme, T as isElement$2, c as rowsOf, d as src_default, f as src_default$2, g as hash, h as src_default$3, m as src_default$1, r as Properties, t as createProgress, u as addStyles, v as scalar, w as childrenOf$1 } from "./client-BG-oCUtv-5i4sRwXP.js";
|
|
2
2
|
import { t as uiErrorDiagnostics } from "./error-diagnostics-BlgA9rI2.js";
|
|
3
|
-
import {
|
|
4
|
-
import { r as createMotionList } from "./motion-core-
|
|
5
|
-
import {
|
|
3
|
+
import { r as useViteHubUIIcons } from "./config-7CiYbXk6.js";
|
|
4
|
+
import { r as createMotionList } from "./motion-core-pkL0M4Y1.js";
|
|
5
|
+
import { n as ViteHubButton, r as ViteHubIcon } from "./stand-ins-C2oSoNwV.js";
|
|
6
6
|
import { Comment, Fragment, computed, defineComponent, h, inject, isVNode, onBeforeUnmount, onMounted, onScopeDispose, provide, ref, shallowRef, unref, watch, watchEffect } from "vue";
|
|
7
7
|
import { defineDiagnostics } from "nostics";
|
|
8
|
-
import { Tooltip, TooltipContent, TooltipShortcut, TooltipTrigger } from "@ui-sdk/vue/tooltip";
|
|
9
8
|
import { Menu, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuItemIcon, MenuSeparator, MenuTrigger } from "@ui-sdk/vue/menu";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipShortcut, TooltipTrigger } from "@ui-sdk/vue/tooltip";
|
|
10
10
|
import { defineComarkPlugin, parseMarkdown } from "comark";
|
|
11
11
|
import { indent } from "comark/utils";
|
|
12
12
|
import { renderFrontmatter, renderMarkdown } from "comark/render";
|
|
@@ -20,9 +20,10 @@ import components from "comark/plugins/components";
|
|
|
20
20
|
import frontmatterPlugin from "comark/plugins/frontmatter";
|
|
21
21
|
import taskList from "comark/plugins/task-list";
|
|
22
22
|
import { parseFrontmatter } from "comark/parse";
|
|
23
|
-
import { NodeSelection, Plugin as Plugin$1, PluginKey } from "@tiptap/pm/state";
|
|
23
|
+
import { NodeSelection, Plugin as Plugin$1, PluginKey, Selection } from "@tiptap/pm/state";
|
|
24
24
|
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
|
25
25
|
import { Editor as Editor$1, EditorContent, NodeViewContent, NodeViewWrapper, VueNodeViewRenderer, nodeViewProps } from "@tiptap/vue-3";
|
|
26
|
+
import { Fragment as Fragment$1 } from "@tiptap/pm/model";
|
|
26
27
|
import { flip, offset, shift } from "@floating-ui/dom";
|
|
27
28
|
import DragHandle from "@tiptap/extension-drag-handle-vue-3";
|
|
28
29
|
import { ReplaceStep } from "@tiptap/pm/transform";
|
|
@@ -161,10 +162,6 @@ async function uploadFiles(apiBase, input, options = {}) {
|
|
|
161
162
|
};
|
|
162
163
|
return await readJson(options.onProgress ? await sendWithProgress(apiBase, init, options.onProgress) : await (options.fetch ?? globalThis.fetch)(apiBase, init), parseSerializedBlobObjectArray);
|
|
163
164
|
}
|
|
164
|
-
/**
|
|
165
|
-
* Upload each file in three requests: `sign` asks the route for a signed `PUT`, the `PUT` sends the file to storage,
|
|
166
|
-
* and `complete` asks the route to check the stored file. The files go one after the other.
|
|
167
|
-
*/
|
|
168
165
|
async function uploadDirect(apiBase, files, options) {
|
|
169
166
|
const request = options.fetch ?? globalThis.fetch;
|
|
170
167
|
const step = (body) => request(apiBase, {
|
|
@@ -2404,14 +2401,61 @@ function blockHandler(name, toggle, can) {
|
|
|
2404
2401
|
};
|
|
2405
2402
|
}
|
|
2406
2403
|
const listItemTypes = ["bulletList", "orderedList"];
|
|
2404
|
+
function selectedTaskList(selection) {
|
|
2405
|
+
if (selection instanceof NodeSelection && selection.node.type.name === "taskList") return {
|
|
2406
|
+
list: selection.node,
|
|
2407
|
+
from: selection.from,
|
|
2408
|
+
first: 0,
|
|
2409
|
+
end: selection.node.childCount
|
|
2410
|
+
};
|
|
2411
|
+
const { $from, $to } = selection;
|
|
2412
|
+
const range = $from.blockRange($to, (node) => node.type.name === "taskList");
|
|
2413
|
+
if (!range) return;
|
|
2414
|
+
return {
|
|
2415
|
+
list: range.parent,
|
|
2416
|
+
from: $from.before(range.depth),
|
|
2417
|
+
first: range.startIndex,
|
|
2418
|
+
end: range.endIndex
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
function convertTasks(type) {
|
|
2422
|
+
return ({ tr, dispatch, state }) => {
|
|
2423
|
+
const tasks = selectedTaskList(tr.selection);
|
|
2424
|
+
if (!tasks) return false;
|
|
2425
|
+
const { list, from, first, end } = tasks;
|
|
2426
|
+
const items = list.content.content;
|
|
2427
|
+
const { listItem, [type]: targetList } = state.schema.nodes;
|
|
2428
|
+
if (!listItem || !targetList) return false;
|
|
2429
|
+
const selected = items.slice(first, end);
|
|
2430
|
+
if (!selected.length || selected.some((item) => !listItem.validContent(item.content))) return false;
|
|
2431
|
+
const before = first ? list.copy(Fragment$1.from(items.slice(0, first))) : null;
|
|
2432
|
+
const after = end < items.length ? list.copy(Fragment$1.from(items.slice(end))) : null;
|
|
2433
|
+
const converted = targetList.create(null, selected.map((item) => listItem.create(null, item.content)));
|
|
2434
|
+
const replacement = Fragment$1.from([
|
|
2435
|
+
...before ? [before] : [],
|
|
2436
|
+
converted,
|
|
2437
|
+
...after ? [after] : []
|
|
2438
|
+
]);
|
|
2439
|
+
const $from = tr.doc.resolve(from);
|
|
2440
|
+
const index = $from.index();
|
|
2441
|
+
if (!$from.parent.canReplace(index, index + 1, replacement)) return false;
|
|
2442
|
+
if (dispatch) {
|
|
2443
|
+
tr.replaceWith(from, from + list.nodeSize, replacement);
|
|
2444
|
+
const lastItemEnd = from + (before?.nodeSize ?? 0) + converted.nodeSize - 2;
|
|
2445
|
+
tr.setSelection(Selection.findFrom(tr.doc.resolve(lastItemEnd), -1, true) ?? tr.selection);
|
|
2446
|
+
}
|
|
2447
|
+
return true;
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2407
2450
|
function listHandler(type) {
|
|
2408
2451
|
const toggle = (chain) => type === "bulletList" ? chain.toggleBulletList() : chain.toggleOrderedList();
|
|
2409
2452
|
const inAnyList = (editor) => listItemTypes.some((name) => hasExtension(editor, name) && editor.isActive(name));
|
|
2410
2453
|
return {
|
|
2411
|
-
canExecute: (editor) => (type === "bulletList" ? editor.can().toggleBulletList() : editor.can().toggleOrderedList()) || editor.isActive("listItem") || inAnyList(editor),
|
|
2454
|
+
canExecute: (editor) => selectedTaskList(editor.state.selection) ? editor.can().command(convertTasks(type)) : (type === "bulletList" ? editor.can().toggleBulletList() : editor.can().toggleOrderedList()) || editor.isActive("listItem") || inAnyList(editor),
|
|
2412
2455
|
execute: (editor) => {
|
|
2413
2456
|
const { selection } = editor.state;
|
|
2414
2457
|
let chain = editor.chain().focus();
|
|
2458
|
+
if (selectedTaskList(selection)) return chain.command(convertTasks(type)).selectTextblockEnd();
|
|
2415
2459
|
if (selection instanceof NodeSelection) {
|
|
2416
2460
|
const first = selection.node.firstChild?.firstChild;
|
|
2417
2461
|
const last = selection.node.lastChild?.lastChild;
|
|
@@ -2486,7 +2530,10 @@ function createEditorHandlers() {
|
|
|
2486
2530
|
canExecute: (editor, { level = 1 }) => editor.can().toggleHeading({ level }),
|
|
2487
2531
|
execute: (editor, { level = 1 }) => editor.chain().focus().toggleHeading({ level }),
|
|
2488
2532
|
isActive: (editor, item) => editor.isActive("heading", { level: item.level }),
|
|
2489
|
-
isDisabled:
|
|
2533
|
+
isDisabled: (editor) => {
|
|
2534
|
+
const { selection } = editor.state;
|
|
2535
|
+
return selection instanceof NodeSelection && selection.node.type.name === "image" || editor.isActive("code");
|
|
2536
|
+
}
|
|
2490
2537
|
},
|
|
2491
2538
|
paragraph: blockHandler("paragraph", (chain) => chain.setParagraph(), (editor) => editor.can().setParagraph()),
|
|
2492
2539
|
blockquote: blockHandler("blockquote", (chain) => chain.toggleBlockquote(), (editor) => editor.can().toggleBlockquote()),
|
|
@@ -2548,12 +2595,15 @@ function mapEditorItems(editor, items, handlers) {
|
|
|
2548
2595
|
...rest,
|
|
2549
2596
|
children: mappedChildren
|
|
2550
2597
|
};
|
|
2598
|
+
const disabled = () => !editor.isEditable || Boolean(handler.isDisabled?.(editor, entry)) || !handler.canExecute(editor, entry);
|
|
2551
2599
|
return {
|
|
2552
2600
|
...rest,
|
|
2553
2601
|
active: handler.isActive(editor, entry),
|
|
2554
2602
|
children: mappedChildren,
|
|
2555
|
-
disabled:
|
|
2556
|
-
onSelect: () =>
|
|
2603
|
+
disabled: disabled(),
|
|
2604
|
+
onSelect: () => {
|
|
2605
|
+
if (!disabled()) handler.execute(editor, entry).run();
|
|
2606
|
+
}
|
|
2557
2607
|
};
|
|
2558
2608
|
});
|
|
2559
2609
|
return items.length && Array.isArray(items[0]) ? items.map(map) : map(items);
|
|
@@ -2747,12 +2797,6 @@ function useMarkdownEditor(markdown, options = {}) {
|
|
|
2747
2797
|
};
|
|
2748
2798
|
}
|
|
2749
2799
|
// src/ui-sdk/editor.ts
|
|
2750
|
-
/**
|
|
2751
|
-
* The editor parts on ui-sdk: Nuxt UI's `UEditorToolbar`, `UEditorSuggestionMenu`, and `UEditorDragHandle`, with the
|
|
2752
|
-
* props, slots, and events that ViteHub's editors use. Positioning at the selection and the block, and dragging blocks,
|
|
2753
|
-
* stay with Tiptap's own menu plugins. They run items through the handlers that the editor provides under
|
|
2754
|
-
* `editorHandlersKey`, as Nuxt UI's do.
|
|
2755
|
-
*/
|
|
2756
2800
|
const ToggleButton = Toggle;
|
|
2757
2801
|
const ToggleButtonIcon = ToggleIcon;
|
|
2758
2802
|
const Bar = Toolbar;
|
|
@@ -2780,9 +2824,9 @@ function useHandlers() {
|
|
|
2780
2824
|
const isGroups = (items) => items.length > 0 && Array.isArray(items[0]);
|
|
2781
2825
|
const groupsOf = (items) => !items?.length ? [] : isGroups(items) ? items : [items];
|
|
2782
2826
|
const shortcutOf = (kbds) => kbds?.length ? kbds.map((key) => key === "meta" ? "mod" : key).join("+") : void 0;
|
|
2783
|
-
/** Nuxt UI's
|
|
2784
|
-
const
|
|
2785
|
-
name: "
|
|
2827
|
+
/** Nuxt UI's editor toolbar, in its `fixed` and `bubble` layouts, on ui-sdk's `Toolbar`, `Toggle`, and `Menu`. */
|
|
2828
|
+
const EditorToolbar = defineComponent({
|
|
2829
|
+
name: "EditorToolbar",
|
|
2786
2830
|
inheritAttrs: false,
|
|
2787
2831
|
props: {
|
|
2788
2832
|
editor: {
|
|
@@ -2836,7 +2880,6 @@ const UEditorToolbar = defineComponent({
|
|
|
2836
2880
|
}
|
|
2837
2881
|
},
|
|
2838
2882
|
setup(props, { attrs, slots }) {
|
|
2839
|
-
const UIcon = useStandIn("UIcon");
|
|
2840
2883
|
const handlers = useHandlers();
|
|
2841
2884
|
const icons = useViteHubUIIcons();
|
|
2842
2885
|
const isActive = (item) => {
|
|
@@ -2869,9 +2912,9 @@ const UEditorToolbar = defineComponent({
|
|
|
2869
2912
|
const icon = child?.icon ?? item.icon;
|
|
2870
2913
|
const label = item.label !== void 0 && child?.label ? child.label : item.label;
|
|
2871
2914
|
return [
|
|
2872
|
-
icon ? h(ToggleButtonIcon, () => h(
|
|
2915
|
+
icon ? h(ToggleButtonIcon, () => h(ViteHubIcon, { name: icon })) : null,
|
|
2873
2916
|
label ? h("span", { "data-slot": "editor-toolbar-label" }, label) : null,
|
|
2874
|
-
item.trailingIcon ? h(
|
|
2917
|
+
item.trailingIcon ? h(ViteHubIcon, {
|
|
2875
2918
|
"data-slot": "editor-toolbar-trailing-icon",
|
|
2876
2919
|
name: item.trailingIcon
|
|
2877
2920
|
}) : null
|
|
@@ -2898,9 +2941,9 @@ const UEditorToolbar = defineComponent({
|
|
|
2898
2941
|
label: entry.label,
|
|
2899
2942
|
onSelect: (event) => entry.kind ? onClick(event, entry) : entry.onSelect?.(event)
|
|
2900
2943
|
}, () => [
|
|
2901
|
-
entry.icon ? h(MenuItemIcon, () => h(
|
|
2944
|
+
entry.icon ? h(MenuItemIcon, () => h(ViteHubIcon, { name: entry.icon })) : null,
|
|
2902
2945
|
h("span", entry.label),
|
|
2903
|
-
active ? h(
|
|
2946
|
+
active ? h(ViteHubIcon, {
|
|
2904
2947
|
"data-slot": "editor-toolbar-check",
|
|
2905
2948
|
name: icons.value.check
|
|
2906
2949
|
}) : null
|
|
@@ -3035,11 +3078,6 @@ function rank(items, query, fields) {
|
|
|
3035
3078
|
}
|
|
3036
3079
|
const OBJECT = "";
|
|
3037
3080
|
const choosable = (item) => item.type !== "label" && item.type !== "separator";
|
|
3038
|
-
/**
|
|
3039
|
-
* The editor as ui-sdk's `TriggerMenu` reads it. Offsets are document positions. The text before the caret is the text
|
|
3040
|
-
* of its block, after a line break that stands for the block's start, so a trigger at the start of a block matches as
|
|
3041
|
-
* one after a space does.
|
|
3042
|
-
*/
|
|
3043
3081
|
function tiptapAdapter(editor) {
|
|
3044
3082
|
return {
|
|
3045
3083
|
get element() {
|
|
@@ -3048,8 +3086,16 @@ function tiptapAdapter(editor) {
|
|
|
3048
3086
|
textBefore(length) {
|
|
3049
3087
|
const { $head } = editor.state.selection;
|
|
3050
3088
|
if (!$head.parent.isTextblock) return null;
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3089
|
+
const { parent, parentOffset } = $head;
|
|
3090
|
+
let text = "";
|
|
3091
|
+
for (let index = Math.min($head.index(), parent.childCount - 1); index >= 0 && text.length < length; index--) {
|
|
3092
|
+
const child = parent.child(index);
|
|
3093
|
+
const childStart = $head.posAtIndex(index) - $head.start();
|
|
3094
|
+
const end = Math.min(child.nodeSize, parentOffset - childStart);
|
|
3095
|
+
text = (child.isText ? child.text.slice(0, end) : OBJECT.repeat(end)) + text;
|
|
3096
|
+
}
|
|
3097
|
+
const from = Math.max(0, parentOffset - length);
|
|
3098
|
+
text = text.slice(-length);
|
|
3053
3099
|
return from === 0 && text.length < length ? {
|
|
3054
3100
|
offset: $head.start() - 1,
|
|
3055
3101
|
text: `\n${text}`
|
|
@@ -3121,13 +3167,13 @@ function tiptapAdapter(editor) {
|
|
|
3121
3167
|
};
|
|
3122
3168
|
}
|
|
3123
3169
|
/**
|
|
3124
|
-
* Nuxt UI's
|
|
3170
|
+
* Nuxt UI's editor suggestion menu on ui-sdk's `TriggerMenu`. Typing `char` opens a list at the caret, the text after
|
|
3125
3171
|
* it filters `items` with Nuxt UI's ranking, the arrow keys move the highlight and wrap, Enter or Tab runs it, and
|
|
3126
3172
|
* Escape closes the list until the trigger is typed again. The caret stays in the editor, which points at the list
|
|
3127
3173
|
* with `aria-controls` and `aria-activedescendant`.
|
|
3128
3174
|
*/
|
|
3129
|
-
const
|
|
3130
|
-
name: "
|
|
3175
|
+
const EditorSuggestionMenu = defineComponent({
|
|
3176
|
+
name: "EditorSuggestionMenu",
|
|
3131
3177
|
inheritAttrs: false,
|
|
3132
3178
|
props: {
|
|
3133
3179
|
editor: {
|
|
@@ -3156,7 +3202,6 @@ const UEditorSuggestionMenu = defineComponent({
|
|
|
3156
3202
|
}
|
|
3157
3203
|
},
|
|
3158
3204
|
setup(props, { attrs }) {
|
|
3159
|
-
const UIcon = useStandIn("UIcon");
|
|
3160
3205
|
const handlers = useHandlers();
|
|
3161
3206
|
const query = ref("");
|
|
3162
3207
|
const adapter = shallowRef();
|
|
@@ -3211,14 +3256,10 @@ const UEditorSuggestionMenu = defineComponent({
|
|
|
3211
3256
|
keywords: item.keywords,
|
|
3212
3257
|
label: item.label,
|
|
3213
3258
|
value
|
|
3214
|
-
}, () => [item.icon ? h(TriggerMenuItemIcon, () => h(
|
|
3259
|
+
}, () => [item.icon ? h(TriggerMenuItemIcon, () => h(ViteHubIcon, { name: item.icon })) : null, h("span", { "data-slot": "editor-suggestion-text" }, [h("span", { "data-slot": "editor-suggestion-label" }, item.label), item.description ? h("span", { "data-slot": "editor-suggestion-description" }, item.description) : null])]);
|
|
3215
3260
|
}))])))]);
|
|
3216
3261
|
}
|
|
3217
3262
|
});
|
|
3218
|
-
/**
|
|
3219
|
-
* Moves the drag handle to each new place with the list mover of the motion layer, as a neighbor of a list moves. The
|
|
3220
|
-
* drag handle extension places it with `left` and `top`. A handle that was hidden shows at its new place at once.
|
|
3221
|
-
*/
|
|
3222
3263
|
function followPlace(element) {
|
|
3223
3264
|
const parent = element.parentElement;
|
|
3224
3265
|
if (!parent) return () => {};
|
|
@@ -3246,12 +3287,12 @@ function followPlace(element) {
|
|
|
3246
3287
|
};
|
|
3247
3288
|
}
|
|
3248
3289
|
/**
|
|
3249
|
-
* Nuxt UI's
|
|
3290
|
+
* Nuxt UI's editor drag handle: a handle beside the block under the pointer, which drags the block to move it. A press
|
|
3250
3291
|
* selects the block and emits `nodeChange`. The default slot replaces the button and gets `onClick`, which selects the
|
|
3251
3292
|
* block and returns it, and `ui.handle()`, the class of a handle button.
|
|
3252
3293
|
*/
|
|
3253
|
-
const
|
|
3254
|
-
name: "
|
|
3294
|
+
const EditorDragHandle = defineComponent({
|
|
3295
|
+
name: "EditorDragHandle",
|
|
3255
3296
|
inheritAttrs: false,
|
|
3256
3297
|
props: {
|
|
3257
3298
|
editor: {
|
|
@@ -3280,7 +3321,6 @@ const UEditorDragHandle = defineComponent({
|
|
|
3280
3321
|
nodeChange: (_node) => true
|
|
3281
3322
|
},
|
|
3282
3323
|
setup(props, { attrs, emit, slots }) {
|
|
3283
|
-
const UButton = useStandIn("UButton");
|
|
3284
3324
|
const current = ref();
|
|
3285
3325
|
const nodeAt = (pos) => {
|
|
3286
3326
|
if (pos == null || pos < 0) return void 0;
|
|
@@ -3339,7 +3379,7 @@ const UEditorDragHandle = defineComponent({
|
|
|
3339
3379
|
}, () => slots.default ? slots.default({
|
|
3340
3380
|
onClick,
|
|
3341
3381
|
ui
|
|
3342
|
-
}) : h(
|
|
3382
|
+
}) : h(ViteHubButton, {
|
|
3343
3383
|
"aria-label": "Drag to move, or press to select the block",
|
|
3344
3384
|
color: "neutral",
|
|
3345
3385
|
icon: props.icon ?? "i-lucide-grip-vertical",
|
|
@@ -3351,4 +3391,4 @@ const UEditorDragHandle = defineComponent({
|
|
|
3351
3391
|
}));
|
|
3352
3392
|
}
|
|
3353
3393
|
});
|
|
3354
|
-
export { useMarkdownEditor as a, mapEditorItems as c, blobUpload as i,
|
|
3394
|
+
export { useMarkdownEditor as a, mapEditorItems as c, blobUpload as i, EditorSuggestionMenu as n, createEditorHandlers as o, EditorToolbar as r, editorHandlersKey as s, EditorDragHandle as t };
|
|
@@ -7,6 +7,7 @@ import { StarterKitOptions } from "@tiptap/starter-kit";
|
|
|
7
7
|
import { Plugin as Plugin$1, PluginKey } from "@tiptap/pm/state";
|
|
8
8
|
import { DecorationSet } from "@tiptap/pm/view";
|
|
9
9
|
import { Editor as Editor$1 } from "@tiptap/vue-3";
|
|
10
|
+
import "@ui-sdk/vue/trigger-menu";
|
|
10
11
|
//#region src/typeset-css.d.ts
|
|
11
12
|
/**
|
|
12
13
|
* The text around the blocks: headings, paragraphs, lists, tables, code, and quotes. `@scope` with no selector styles
|
|
@@ -190,8 +191,8 @@ type EditorToolbarItem = EditorItem & {
|
|
|
190
191
|
content?: string;
|
|
191
192
|
};
|
|
192
193
|
};
|
|
193
|
-
/** Nuxt UI's
|
|
194
|
-
declare const
|
|
194
|
+
/** Nuxt UI's editor toolbar, in its `fixed` and `bubble` layouts, on ui-sdk's `Toolbar`, `Toggle`, and `Menu`. */
|
|
195
|
+
declare const EditorToolbar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
195
196
|
editor: {
|
|
196
197
|
required: true;
|
|
197
198
|
type: PropType<Editor>;
|
|
@@ -356,12 +357,12 @@ type EditorSuggestionMenuItem = EditorItem & {
|
|
|
356
357
|
class?: string;
|
|
357
358
|
};
|
|
358
359
|
/**
|
|
359
|
-
* Nuxt UI's
|
|
360
|
+
* Nuxt UI's editor suggestion menu on ui-sdk's `TriggerMenu`. Typing `char` opens a list at the caret, the text after
|
|
360
361
|
* it filters `items` with Nuxt UI's ranking, the arrow keys move the highlight and wrap, Enter or Tab runs it, and
|
|
361
362
|
* Escape closes the list until the trigger is typed again. The caret stays in the editor, which points at the list
|
|
362
363
|
* with `aria-controls` and `aria-activedescendant`.
|
|
363
364
|
*/
|
|
364
|
-
declare const
|
|
365
|
+
declare const EditorSuggestionMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
365
366
|
editor: {
|
|
366
367
|
required: true;
|
|
367
368
|
type: PropType<Editor>;
|
|
@@ -432,11 +433,11 @@ interface EditorDragHandleNode {
|
|
|
432
433
|
pos: number;
|
|
433
434
|
}
|
|
434
435
|
/**
|
|
435
|
-
* Nuxt UI's
|
|
436
|
+
* Nuxt UI's editor drag handle: a handle beside the block under the pointer, which drags the block to move it. A press
|
|
436
437
|
* selects the block and emits `nodeChange`. The default slot replaces the button and gets `onClick`, which selects the
|
|
437
438
|
* block and returns it, and `ui.handle()`, the class of a handle button.
|
|
438
439
|
*/
|
|
439
|
-
declare const
|
|
440
|
+
declare const EditorDragHandle: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
440
441
|
editor: {
|
|
441
442
|
required: true;
|
|
442
443
|
type: PropType<Editor>;
|
|
@@ -537,4 +538,4 @@ declare function blobUpload(route: string): MarkdownEditorUpload;
|
|
|
537
538
|
* the menus run. Call it in `setup()`.
|
|
538
539
|
*/
|
|
539
540
|
declare function useMarkdownEditor(markdown: Ref<string>, options?: UseMarkdownEditorOptions): UseMarkdownEditorReturn;
|
|
540
|
-
export { typesetCss as C, mapEditorItems as S, EditorItem as _, blobUpload as a, createEditorHandlers as b,
|
|
541
|
+
export { typesetCss as C, mapEditorItems as S, EditorItem as _, blobUpload as a, createEditorHandlers as b, EditorDragHandleNode as c, EditorToolbar as d, EditorToolbarItem as f, EditorHandlers as g, EditorHandler as h, UseMarkdownEditorReturn as i, EditorSuggestionMenu as l, EditorToolbarTooltip as m, MarkdownEditorUpload as n, useMarkdownEditor as o, EditorToolbarMenuEntry as p, UseMarkdownEditorOptions as r, EditorDragHandle as s, MarkdownEditorError as t, EditorSuggestionMenuItem as u, EditorMenuEntry as v, editorHandlersKey as x, MappedEditorMenuEntry as y };
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as typesetCss, S as mapEditorItems, _ as EditorItem, a as blobUpload, b as createEditorHandlers, c as
|
|
2
|
-
export {
|
|
1
|
+
import { C as typesetCss, S as mapEditorItems, _ as EditorItem, a as blobUpload, b as createEditorHandlers, c as EditorDragHandleNode, d as EditorToolbar, f as EditorToolbarItem, g as EditorHandlers, h as EditorHandler, i as UseMarkdownEditorReturn, l as EditorSuggestionMenu, m as EditorToolbarTooltip, n as MarkdownEditorUpload, o as useMarkdownEditor, p as EditorToolbarMenuEntry, r as UseMarkdownEditorOptions, s as EditorDragHandle, t as MarkdownEditorError, u as EditorSuggestionMenuItem, v as EditorMenuEntry, x as editorHandlersKey, y as MappedEditorMenuEntry } from "./editor-DZxaa6vs.js";
|
|
2
|
+
export { EditorDragHandle, type EditorDragHandleNode, type EditorHandler, type EditorHandlers, type EditorItem, type EditorMenuEntry, EditorSuggestionMenu, type EditorSuggestionMenuItem, EditorToolbar, type EditorToolbarItem, type EditorToolbarMenuEntry, type EditorToolbarTooltip, type MappedEditorMenuEntry, type MarkdownEditorError, type MarkdownEditorUpload, type UseMarkdownEditorOptions, type UseMarkdownEditorReturn, blobUpload, createEditorHandlers, editorHandlersKey, mapEditorItems, typesetCss, useMarkdownEditor };
|
package/dist/editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { x as typesetCss } from "./client-BG-oCUtv-5i4sRwXP.js";
|
|
2
|
-
import { a as useMarkdownEditor, c as mapEditorItems, i as blobUpload, n as
|
|
3
|
-
export {
|
|
2
|
+
import { a as useMarkdownEditor, c as mapEditorItems, i as blobUpload, n as EditorSuggestionMenu, o as createEditorHandlers, r as EditorToolbar, s as editorHandlersKey, t as EditorDragHandle } from "./editor-CE_q2Yzb.js";
|
|
3
|
+
export { EditorDragHandle, EditorSuggestionMenu, EditorToolbar, blobUpload, createEditorHandlers, editorHandlersKey, mapEditorItems, typesetCss, useMarkdownEditor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createHoldToDelete } from "./hold-to-delete-
|
|
1
|
+
import { t as createHoldToDelete } from "./hold-to-delete-sscThmPW.js";
|
|
2
2
|
import { createElementBlock, createElementVNode, createStaticVNode, defineComponent, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, useTemplateRef } from "vue";
|
|
3
3
|
// registry/hold-to-delete/HoldToDelete.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1 = ["data-status", "data-icon-only"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createSpring, h as prefersReducedMotion, i as playTween, l as getMotionSlowFactor, m as onReducedMotionChange, o as isMotionOff, t as cubicBezier, u as onEachFrame } from "./tween-
|
|
1
|
+
import { c as createSpring, h as prefersReducedMotion, i as playTween, l as getMotionSlowFactor, m as onReducedMotionChange, o as isMotionOff, t as cubicBezier, u as onEachFrame } from "./tween-DGAmrS3r.js";
|
|
2
2
|
// registry/core/announce.ts
|
|
3
3
|
const regionSlot = "live-announcer";
|
|
4
4
|
const hidden = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0";
|