@nuxt/ui 4.5.1 → 4.6.1

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.
Files changed (183) hide show
  1. package/README.md +1 -1
  2. package/dist/module.d.mts +7 -0
  3. package/dist/module.json +2 -2
  4. package/dist/module.mjs +79 -67
  5. package/dist/runtime/components/Avatar.vue +10 -12
  6. package/dist/runtime/components/Banner.vue +1 -1
  7. package/dist/runtime/components/BlogPost.vue +3 -2
  8. package/dist/runtime/components/Calendar.d.vue.ts +4 -4
  9. package/dist/runtime/components/Calendar.vue.d.ts +4 -4
  10. package/dist/runtime/components/ChangelogVersion.vue +3 -2
  11. package/dist/runtime/components/ChangelogVersions.vue +1 -1
  12. package/dist/runtime/components/ChatMessage.d.vue.ts +4 -1
  13. package/dist/runtime/components/ChatMessage.vue +5 -0
  14. package/dist/runtime/components/ChatMessage.vue.d.ts +4 -1
  15. package/dist/runtime/components/ChatMessages.vue +14 -1
  16. package/dist/runtime/components/ChatPrompt.vue +6 -1
  17. package/dist/runtime/components/ChatReasoning.d.vue.ts +78 -0
  18. package/dist/runtime/components/ChatReasoning.vue +162 -0
  19. package/dist/runtime/components/ChatReasoning.vue.d.ts +78 -0
  20. package/dist/runtime/components/ChatShimmer.d.vue.ts +34 -0
  21. package/dist/runtime/components/ChatShimmer.vue +37 -0
  22. package/dist/runtime/components/ChatShimmer.vue.d.ts +34 -0
  23. package/dist/runtime/components/ChatTool.d.vue.ts +88 -0
  24. package/dist/runtime/components/ChatTool.vue +105 -0
  25. package/dist/runtime/components/ChatTool.vue.d.ts +88 -0
  26. package/dist/runtime/components/Checkbox.d.vue.ts +22 -19
  27. package/dist/runtime/components/Checkbox.vue +9 -8
  28. package/dist/runtime/components/Checkbox.vue.d.ts +22 -19
  29. package/dist/runtime/components/DashboardGroup.d.vue.ts +1 -1
  30. package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
  31. package/dist/runtime/components/DashboardSearchButton.vue +2 -2
  32. package/dist/runtime/components/DashboardSidebar.vue +6 -3
  33. package/dist/runtime/components/Drawer.vue +6 -4
  34. package/dist/runtime/components/DropdownMenu.d.vue.ts +29 -3
  35. package/dist/runtime/components/DropdownMenu.vue +9 -0
  36. package/dist/runtime/components/DropdownMenu.vue.d.ts +29 -3
  37. package/dist/runtime/components/DropdownMenuContent.d.vue.ts +9 -3
  38. package/dist/runtime/components/DropdownMenuContent.vue +62 -9
  39. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +9 -3
  40. package/dist/runtime/components/EditorDragHandle.d.vue.ts +4 -4
  41. package/dist/runtime/components/EditorDragHandle.vue.d.ts +4 -4
  42. package/dist/runtime/components/Error.vue +5 -5
  43. package/dist/runtime/components/FileUpload.d.vue.ts +6 -0
  44. package/dist/runtime/components/FileUpload.vue +11 -7
  45. package/dist/runtime/components/FileUpload.vue.d.ts +6 -0
  46. package/dist/runtime/components/Icon.d.vue.ts +2 -1
  47. package/dist/runtime/components/Icon.vue +3 -3
  48. package/dist/runtime/components/Icon.vue.d.ts +2 -1
  49. package/dist/runtime/components/InputDate.d.vue.ts +4 -4
  50. package/dist/runtime/components/InputDate.vue.d.ts +4 -4
  51. package/dist/runtime/components/InputMenu.d.vue.ts +7 -1
  52. package/dist/runtime/components/InputMenu.vue +67 -48
  53. package/dist/runtime/components/InputMenu.vue.d.ts +7 -1
  54. package/dist/runtime/components/InputTime.d.vue.ts +53 -27
  55. package/dist/runtime/components/InputTime.vue +52 -27
  56. package/dist/runtime/components/InputTime.vue.d.ts +53 -27
  57. package/dist/runtime/components/Kbd.vue +1 -1
  58. package/dist/runtime/components/Modal.vue +6 -4
  59. package/dist/runtime/components/NavigationMenu.vue +1 -0
  60. package/dist/runtime/components/Popover.vue +1 -1
  61. package/dist/runtime/components/Progress.d.vue.ts +1 -1
  62. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  63. package/dist/runtime/components/SelectMenu.d.vue.ts +1 -1
  64. package/dist/runtime/components/SelectMenu.vue +1 -1
  65. package/dist/runtime/components/SelectMenu.vue.d.ts +1 -1
  66. package/dist/runtime/components/Sidebar.d.vue.ts +131 -0
  67. package/dist/runtime/components/Sidebar.vue +222 -0
  68. package/dist/runtime/components/Sidebar.vue.d.ts +131 -0
  69. package/dist/runtime/components/Slideover.vue +6 -4
  70. package/dist/runtime/components/Switch.d.vue.ts +22 -19
  71. package/dist/runtime/components/Switch.vue +7 -6
  72. package/dist/runtime/components/Switch.vue.d.ts +22 -19
  73. package/dist/runtime/components/Table.d.vue.ts +1 -1
  74. package/dist/runtime/components/Table.vue +12 -4
  75. package/dist/runtime/components/Table.vue.d.ts +1 -1
  76. package/dist/runtime/components/Tooltip.d.vue.ts +2 -0
  77. package/dist/runtime/components/Tooltip.vue +3 -2
  78. package/dist/runtime/components/Tooltip.vue.d.ts +2 -0
  79. package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +1 -1
  80. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  81. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +3 -1
  82. package/dist/runtime/components/content/ContentNavigation.vue +9 -2
  83. package/dist/runtime/components/content/ContentSurround.vue +6 -2
  84. package/dist/runtime/components/content/ContentToc.d.vue.ts +5 -0
  85. package/dist/runtime/components/content/ContentToc.vue +57 -11
  86. package/dist/runtime/components/content/ContentToc.vue.d.ts +5 -0
  87. package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +1 -1
  88. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
  89. package/dist/runtime/components/prose/Pre.vue +0 -4
  90. package/dist/runtime/composables/index.d.ts +12 -0
  91. package/dist/runtime/composables/index.js +12 -0
  92. package/dist/runtime/composables/useEditorMenu.js +1 -1
  93. package/dist/runtime/composables/useFileUpload.d.ts +2 -2
  94. package/dist/runtime/composables/useFileUpload.js +3 -3
  95. package/dist/runtime/composables/{internal/useFilter.js → useFilter.js} +1 -1
  96. package/dist/runtime/composables/useIMEGuard.d.ts +10 -0
  97. package/dist/runtime/composables/useIMEGuard.js +22 -0
  98. package/dist/runtime/composables/useScrollShadow.d.ts +23 -0
  99. package/dist/runtime/composables/useScrollShadow.js +36 -0
  100. package/dist/runtime/index.css +1 -1
  101. package/dist/runtime/keyframes.css +1 -1
  102. package/dist/runtime/locale/ar.js +13 -0
  103. package/dist/runtime/locale/az.js +13 -0
  104. package/dist/runtime/locale/be.js +13 -0
  105. package/dist/runtime/locale/bg.js +13 -0
  106. package/dist/runtime/locale/bn.js +13 -0
  107. package/dist/runtime/locale/ca.js +13 -0
  108. package/dist/runtime/locale/ckb.js +13 -0
  109. package/dist/runtime/locale/cs.js +13 -0
  110. package/dist/runtime/locale/da.js +13 -0
  111. package/dist/runtime/locale/de.js +13 -0
  112. package/dist/runtime/locale/de_ch.js +13 -0
  113. package/dist/runtime/locale/el.js +13 -0
  114. package/dist/runtime/locale/en.js +13 -0
  115. package/dist/runtime/locale/es.js +13 -0
  116. package/dist/runtime/locale/et.js +13 -0
  117. package/dist/runtime/locale/eu.js +13 -0
  118. package/dist/runtime/locale/fa_ir.js +13 -0
  119. package/dist/runtime/locale/fi.js +13 -0
  120. package/dist/runtime/locale/fr.js +13 -0
  121. package/dist/runtime/locale/gl.js +13 -0
  122. package/dist/runtime/locale/he.js +13 -0
  123. package/dist/runtime/locale/hi.js +13 -0
  124. package/dist/runtime/locale/hr.js +13 -0
  125. package/dist/runtime/locale/hu.js +13 -0
  126. package/dist/runtime/locale/hy.js +13 -0
  127. package/dist/runtime/locale/id.js +13 -0
  128. package/dist/runtime/locale/index.d.ts +1 -0
  129. package/dist/runtime/locale/index.js +1 -0
  130. package/dist/runtime/locale/is.d.ts +3 -0
  131. package/dist/runtime/locale/is.js +142 -0
  132. package/dist/runtime/locale/it.js +13 -0
  133. package/dist/runtime/locale/ja.js +13 -0
  134. package/dist/runtime/locale/ka.js +13 -0
  135. package/dist/runtime/locale/kk.js +13 -0
  136. package/dist/runtime/locale/km.js +13 -0
  137. package/dist/runtime/locale/ko.js +13 -0
  138. package/dist/runtime/locale/ky.js +13 -0
  139. package/dist/runtime/locale/lb.js +13 -0
  140. package/dist/runtime/locale/lo.js +13 -0
  141. package/dist/runtime/locale/lt.js +13 -0
  142. package/dist/runtime/locale/mn.js +13 -0
  143. package/dist/runtime/locale/ms.js +13 -0
  144. package/dist/runtime/locale/nb_no.js +13 -0
  145. package/dist/runtime/locale/nl.js +13 -0
  146. package/dist/runtime/locale/pl.js +13 -0
  147. package/dist/runtime/locale/pt.js +13 -0
  148. package/dist/runtime/locale/pt_br.js +13 -0
  149. package/dist/runtime/locale/ro.js +13 -0
  150. package/dist/runtime/locale/ru.js +13 -0
  151. package/dist/runtime/locale/sk.js +13 -0
  152. package/dist/runtime/locale/sl.js +13 -0
  153. package/dist/runtime/locale/sq.js +13 -0
  154. package/dist/runtime/locale/sv.js +13 -0
  155. package/dist/runtime/locale/th.js +13 -0
  156. package/dist/runtime/locale/tj.js +13 -0
  157. package/dist/runtime/locale/tr.js +13 -0
  158. package/dist/runtime/locale/ug_cn.js +13 -0
  159. package/dist/runtime/locale/uk.js +13 -0
  160. package/dist/runtime/locale/ur.js +13 -0
  161. package/dist/runtime/locale/uz.js +13 -0
  162. package/dist/runtime/locale/vi.js +13 -0
  163. package/dist/runtime/locale/zh_cn.js +13 -0
  164. package/dist/runtime/locale/zh_tw.js +13 -0
  165. package/dist/runtime/types/index.d.ts +4 -0
  166. package/dist/runtime/types/index.js +4 -0
  167. package/dist/runtime/types/locale.d.ts +13 -0
  168. package/dist/runtime/utils/ai.d.ts +23 -0
  169. package/dist/runtime/utils/ai.js +16 -0
  170. package/dist/runtime/utils/editor.js +17 -5
  171. package/dist/runtime/vue/components/Icon.d.vue.ts +1 -4
  172. package/dist/runtime/vue/components/Icon.vue +28 -3
  173. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -4
  174. package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +1 -1
  175. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  176. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +3 -1
  177. package/dist/shared/{ui.DI_ypO2T.mjs → ui.DJUbBpE2.mjs} +298 -39
  178. package/dist/unplugin.d.mts +15 -5
  179. package/dist/unplugin.mjs +53 -30
  180. package/dist/vite.d.mts +1 -0
  181. package/dist/vite.mjs +1 -1
  182. package/package.json +50 -47
  183. /package/dist/runtime/composables/{internal/useFilter.d.ts → useFilter.d.ts} +0 -0
@@ -1,3 +1,19 @@
1
1
  export function getTextFromMessage(message) {
2
2
  return message.parts.filter((part) => part.type === "text").map((part) => part.text).join("");
3
3
  }
4
+ export function isPartStreaming(part) {
5
+ return part.state === "streaming";
6
+ }
7
+ export function isToolStreaming(part) {
8
+ return !["output-available", "output-error", "output-denied"].includes(part.state);
9
+ }
10
+ export function isReasoningStreaming(message, partIndex, chat) {
11
+ if (chat.status !== "streaming") return false;
12
+ if (message.id !== chat.messages.at(-1)?.id) return false;
13
+ if (partIndex < 0 || partIndex >= message.parts.length) return false;
14
+ const partType = message.parts[partIndex].type;
15
+ for (let i = partIndex + 1; i < message.parts.length; i++) {
16
+ if (message.parts[i].type !== partType) return false;
17
+ }
18
+ return true;
19
+ }
@@ -136,9 +136,10 @@ export function createListHandler(listType) {
136
136
  };
137
137
  const fnName = fnNameMap[listType];
138
138
  const listItemType = listType === "taskList" ? "taskItem" : "listItem";
139
+ const allListTypes = ["bulletList", "orderedList", "taskList"];
139
140
  return {
140
141
  canExecute: (editor) => {
141
- return editor.can()[fnName]() || editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList") || editor.isActive("taskItem") || editor.isActive("listItem");
142
+ return editor.can()[fnName]() || editor.isActive("listItem") || allListTypes.some((type) => isExtensionAvailable(editor, type) && editor.isActive(type));
142
143
  },
143
144
  execute: (editor) => {
144
145
  const { state } = editor;
@@ -153,11 +154,22 @@ export function createListHandler(listType) {
153
154
  chain = chain.setTextSelection({ from, to }).clearNodes();
154
155
  }
155
156
  if (editor.isActive(listType)) {
156
- return chain.liftListItem(listItemType).lift("bulletList").lift("orderedList").lift("taskList").selectTextblockEnd();
157
+ let result = chain.liftListItem(listItemType);
158
+ for (const type of allListTypes) {
159
+ if (isExtensionAvailable(editor, type)) {
160
+ result = result.lift(type);
161
+ }
162
+ }
163
+ return result.selectTextblockEnd();
157
164
  }
158
- const currentListItemType = editor.isActive("taskList") ? "taskItem" : "listItem";
159
- if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
160
- const unwrapped = chain.liftListItem(currentListItemType).lift("bulletList").lift("orderedList").lift("taskList");
165
+ if (allListTypes.some((type) => isExtensionAvailable(editor, type) && editor.isActive(type))) {
166
+ const currentListItemType = editor.isActive("taskList") ? "taskItem" : "listItem";
167
+ let unwrapped = chain.liftListItem(currentListItemType);
168
+ for (const type of allListTypes) {
169
+ if (isExtensionAvailable(editor, type)) {
170
+ unwrapped = unwrapped.lift(type);
171
+ }
172
+ }
161
173
  return unwrapped[fnName]().selectTextblockEnd();
162
174
  }
163
175
  return chain[fnName]().selectTextblockEnd();
@@ -1,7 +1,4 @@
1
- import type { IconProps as NuxtIconProps } from '../../types';
2
- export interface IconProps {
3
- name: NuxtIconProps['name'];
4
- }
1
+ import type { IconProps } from '../../types';
5
2
  declare const _default: typeof __VLS_export;
6
3
  export default _default;
7
4
  declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -3,13 +3,38 @@
3
3
  </script>
4
4
 
5
5
  <script setup>
6
+ import { computed } from "vue";
6
7
  import { Icon as IconifyIcon } from "@iconify/vue";
7
- defineProps({
8
- name: { type: null, required: true }
8
+ import { useAppConfig } from "#imports";
9
+ const props = defineProps({
10
+ name: { type: null, required: true },
11
+ mode: { type: String, required: false },
12
+ size: { type: [String, Number], required: false },
13
+ customize: { type: [Function, Boolean, null], required: false }
9
14
  });
15
+ const appConfig = useAppConfig();
16
+ function resolveCustomizeFn(customize2, globalCustomize) {
17
+ if (customize2 === false) return void 0;
18
+ if (customize2 === true || customize2 === null) return globalCustomize;
19
+ return customize2;
20
+ }
21
+ const mode = computed(() => {
22
+ const mode2 = props.mode || appConfig.icon?.mode;
23
+ if (mode2 === "css") return "style";
24
+ return mode2;
25
+ });
26
+ const size = computed(() => props.size || appConfig.icon?.size);
27
+ const customize = computed(() => resolveCustomizeFn(props.customize, appConfig.icon?.customize));
10
28
  </script>
11
29
 
12
30
  <template>
13
- <IconifyIcon v-if="typeof name === 'string'" :icon="name.replace(/^i-/, '')" />
31
+ <IconifyIcon
32
+ v-if="typeof name === 'string'"
33
+ :icon="name.replace(/^i-/, '')"
34
+ :mode="mode"
35
+ :width="size"
36
+ :height="size"
37
+ :customise="customize"
38
+ />
14
39
  <component :is="name" v-else />
15
40
  </template>
@@ -1,7 +1,4 @@
1
- import type { IconProps as NuxtIconProps } from '../../types';
2
- export interface IconProps {
3
- name: NuxtIconProps['name'];
4
- }
1
+ import type { IconProps } from '../../types';
5
2
  declare const _default: typeof __VLS_export;
6
3
  export default _default;
7
4
  declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -4,5 +4,5 @@ export interface ColorModeSelectProps extends Omit<SelectMenuProps<SelectMenuIte
4
4
  declare const _default: typeof __VLS_export;
5
5
  export default _default;
6
6
  declare const __VLS_export: import("vue").DefineComponent<ColorModeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSelectProps> & Readonly<{}>, {
7
- searchInput: boolean | import("../../../types").InputProps;
7
+ searchInput: boolean | Omit<import("../../../types").InputProps, "modelValue" | "defaultValue">;
8
8
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -4,5 +4,5 @@ export interface ColorModeSelectProps extends Omit<SelectMenuProps<SelectMenuIte
4
4
  declare const _default: typeof __VLS_export;
5
5
  export default _default;
6
6
  declare const __VLS_export: import("vue").DefineComponent<ColorModeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeSelectProps> & Readonly<{}>, {
7
- searchInput: boolean | import("../../../types").InputProps;
7
+ searchInput: boolean | Omit<import("../../../types").InputProps, "modelValue" | "defaultValue">;
8
8
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -24,7 +24,9 @@ const props = defineProps({
24
24
  name: { type: String, required: false },
25
25
  required: { type: Boolean, required: false },
26
26
  value: { type: String, required: false },
27
- defaultValue: { type: Boolean, required: false }
27
+ defaultValue: { type: null, required: false },
28
+ trueValue: { type: null, required: false },
29
+ falseValue: { type: null, required: false }
28
30
  });
29
31
  const { t } = useLocale();
30
32
  const colorMode = useColorMode();