@yh-ui/components 0.1.25 → 0.1.27

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 (41) hide show
  1. package/dist/ai-artifacts/src/ai-artifacts.vue +1 -1
  2. package/dist/ai-bubble/src/ai-bubble.vue +2 -2
  3. package/dist/ai-code-block/src/ai-code-block.vue +1 -1
  4. package/dist/ai-mention/index.d.ts +0 -1
  5. package/dist/ai-mention/src/ai-mention.vue +24 -9
  6. package/dist/ai-mention/src/ai-mention.vue.d.ts +1 -1
  7. package/dist/ai-thought-chain/src/ai-thought-chain.vue +1 -1
  8. package/dist/calendar/index.d.ts +84 -612
  9. package/dist/calendar/src/calendar.vue +3 -3
  10. package/dist/calendar/src/calendar.vue.d.ts +43 -220
  11. package/dist/date-picker/src/date-picker.vue +1 -1
  12. package/dist/date-picker/src/date-table.vue +1 -1
  13. package/dist/date-picker/src/month-table.vue +1 -1
  14. package/dist/date-picker/src/panel-utils.cjs +13 -13
  15. package/dist/date-picker/src/panel-utils.d.ts +1 -1
  16. package/dist/date-picker/src/panel-utils.mjs +13 -13
  17. package/dist/date-picker/src/quarter-table.vue +1 -1
  18. package/dist/date-picker/src/year-table.vue +1 -1
  19. package/dist/dayjs.cjs +11 -0
  20. package/dist/dayjs.d.ts +4 -0
  21. package/dist/dayjs.mjs +3 -0
  22. package/dist/form/src/form-schema.vue +13 -14
  23. package/dist/gantt-chart/src/gantt-chart.vue +7 -15
  24. package/dist/gantt-chart/src/gantt-chart.vue.d.ts +1 -1
  25. package/dist/highlight.cjs +34 -0
  26. package/dist/highlight.d.ts +13 -0
  27. package/dist/highlight.mjs +54 -0
  28. package/dist/image/src/image-viewer.vue +48 -26
  29. package/dist/image/src/image.vue +7 -5
  30. package/dist/markdown-it.cjs +11 -0
  31. package/dist/markdown-it.d.ts +2 -0
  32. package/dist/markdown-it.mjs +3 -0
  33. package/dist/menu/src/menu.vue +5 -5
  34. package/dist/transfer/index.cjs +9 -3
  35. package/dist/transfer/index.mjs +9 -3
  36. package/dist/typography/src/paragraph.vue +9 -2
  37. package/dist/upload/src/upload.vue +5 -4
  38. package/dist/viewerjs.cjs +11 -0
  39. package/dist/viewerjs.d.ts +2 -0
  40. package/dist/viewerjs.mjs +3 -0
  41. package/package.json +6 -6
@@ -9,7 +9,7 @@ import { YhIcon } from "../../icon";
9
9
  import { YhButton } from "../../button";
10
10
  import { YhSpin } from "../../spin";
11
11
  import { useComponentTheme } from "@yh-ui/theme";
12
- import hljs from "highlight.js";
12
+ import hljs from "../../highlight";
13
13
  import "highlight.js/styles/atom-one-dark.css";
14
14
  defineOptions({
15
15
  name: "YhAiArtifacts"
@@ -18,8 +18,8 @@ import { YhAvatar } from "../../avatar";
18
18
  import { YhButton } from "../../button";
19
19
  import { YhIcon } from "../../icon";
20
20
  import { YhAiThoughtChain } from "../../ai-thought-chain";
21
- import MarkdownIt from "markdown-it";
22
- import hljs from "highlight.js";
21
+ import MarkdownIt from "../../markdown-it";
22
+ import hljs from "../../highlight";
23
23
  import "highlight.js/styles/atom-one-dark.css";
24
24
  defineOptions({
25
25
  name: "YhAiBubble"
@@ -3,7 +3,7 @@ import { useNamespace, useLocale } from "@yh-ui/hooks";
3
3
  import { ref, computed, watch, useSlots, Comment, Text } from "vue";
4
4
  import { YhButton } from "../../button";
5
5
  import { YhIcon } from "../../icon";
6
- import hljs from "highlight.js";
6
+ import hljs from "../../highlight";
7
7
  import "highlight.js/styles/atom-one-dark.css";
8
8
  import { aiCodeBlockProps, aiCodeBlockEmits } from "./ai-code-block";
9
9
  import { useComponentTheme } from "@yh-ui/theme";
@@ -375,7 +375,6 @@ export declare const YhAiMention: import("@yh-ui/utils").SFCWithInstall<{
375
375
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
376
376
  $slots: {
377
377
  [x: string]: ((props: any) => any) | undefined;
378
- [x: number]: ((props: any) => any) | undefined;
379
378
  };
380
379
  })> & Record<string, unknown>;
381
380
  export default YhAiMention;
@@ -14,6 +14,7 @@ defineOptions({
14
14
  const props = defineProps(aiMentionProps);
15
15
  const emit = defineEmits(aiMentionEmits);
16
16
  const slots = useSlots();
17
+ const forwardedSlotNames = computed(() => Object.keys(slots));
17
18
  const ns = useNamespace("ai-mention");
18
19
  const { t } = useLocale();
19
20
  const { themeStyle } = useComponentTheme("ai-mention", props.themeOverrides);
@@ -67,6 +68,7 @@ const getOptionIcon = (type) => {
67
68
  return "sparkles";
68
69
  }
69
70
  };
71
+ const asAiMentionOption = (option) => option;
70
72
  const fileTreePanelStyle = computed(() => ({
71
73
  position: "fixed",
72
74
  top: "200px",
@@ -451,24 +453,37 @@ defineExpose({
451
453
  @input="emit('input', $event)"
452
454
  @keydown="emit('keydown', $event)"
453
455
  >
454
- <template #option="{ option }: { option: AiMentionOption }">
456
+ <template #option="{ option }">
455
457
  <div :class="ns.e('option-item')">
456
- <div :class="[ns.e('option-icon'), option.type ? ns.em('option-icon', option.type) : '']">
457
- <YhIcon :name="option.icon || getOptionIcon(option.type)" />
458
+ <div
459
+ :class="[ns.e('option-icon'), asAiMentionOption(option).type ? ns.em('option-icon', asAiMentionOption(option).type) : '']"
460
+ >
461
+ <YhIcon
462
+ :name="
463
+ asAiMentionOption(option).icon || getOptionIcon(asAiMentionOption(option).type)
464
+ "
465
+ />
458
466
  </div>
459
467
  <div :class="ns.e('option-info')">
460
- <div :class="ns.e('option-label')">{{ option.label || option.value }}</div>
461
- <div v-if="option.description" :class="ns.e('option-desc')">
462
- {{ option.description }}
468
+ <div :class="ns.e('option-label')">
469
+ {{ asAiMentionOption(option).label || asAiMentionOption(option).value }}
470
+ </div>
471
+ <div v-if="asAiMentionOption(option).description" :class="ns.e('option-desc')">
472
+ {{ asAiMentionOption(option).description }}
463
473
  </div>
464
474
  </div>
465
- <div v-if="option.type" :class="[ns.e('option-tag'), ns.em('option-tag', option.type)]">
466
- {{ t(`ai.mention.${option.type}`) || option.type }}
475
+ <div
476
+ v-if="asAiMentionOption(option).type"
477
+ :class="[ns.e('option-tag'), ns.em('option-tag', asAiMentionOption(option).type)]"
478
+ >
479
+ {{
480
+ t(`ai.mention.${asAiMentionOption(option).type}`) || asAiMentionOption(option).type
481
+ }}
467
482
  </div>
468
483
  </div>
469
484
  </template>
470
485
 
471
- <template v-for="(_, name) in slots" :key="name" #[name]="slotProps">
486
+ <template v-for="name in forwardedSlotNames" :key="name" #[name]="slotProps">
472
487
  <slot :name="name" v-bind="slotProps"></slot>
473
488
  </template>
474
489
  </YhMention>
@@ -1,5 +1,5 @@
1
1
  import { type AiMentionOption, type AiMentionFileNode } from './ai-mention';
2
- declare var __VLS_22: string | number, __VLS_23: any;
2
+ declare var __VLS_22: string, __VLS_23: any;
3
3
  type __VLS_Slots = {} & {
4
4
  [K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
5
5
  };
@@ -2,7 +2,7 @@
2
2
  import { useNamespace, useLocale } from "@yh-ui/hooks";
3
3
  import { ref, computed, watch } from "vue";
4
4
  import { YhIcon } from "../../icon";
5
- import MarkdownIt from "markdown-it";
5
+ import MarkdownIt from "../../markdown-it";
6
6
  import { aiThoughtChainProps, aiThoughtChainEmits } from "./ai-thought-chain";
7
7
  import { useComponentTheme } from "@yh-ui/theme";
8
8
  defineOptions({