@opentiny/tiny-robot 0.1.0 → 0.2.0-alpha.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 (150) hide show
  1. package/dist/action-group/ActionGroup.vue.d.ts +26 -0
  2. package/dist/action-group/ActionGroupItem.vue.d.ts +18 -0
  3. package/dist/action-group/index.d.ts +12 -0
  4. package/dist/action-group/index.type.d.ts +16 -0
  5. package/dist/bubble/index.type.d.ts +1 -1
  6. package/dist/container/index.d.ts +7 -0
  7. package/dist/container/index.type.d.ts +16 -0
  8. package/dist/container/index.vue.d.ts +26 -0
  9. package/dist/feedback/components/SourceList.vue.d.ts +11 -0
  10. package/dist/feedback/components/index.d.ts +1 -0
  11. package/dist/feedback/index.d.ts +7 -0
  12. package/dist/feedback/index.type.d.ts +25 -0
  13. package/dist/feedback/index.vue.d.ts +13 -0
  14. package/dist/history/components/index.d.ts +2 -0
  15. package/dist/history/components/item-tag.vue.d.ts +5 -0
  16. package/dist/history/components/search-empty.vue.d.ts +7 -0
  17. package/dist/history/composables/index.d.ts +1 -0
  18. package/dist/history/composables/useEditItemTitle.d.ts +12 -0
  19. package/dist/history/index.d.ts +6 -0
  20. package/dist/history/index.type.d.ts +43 -0
  21. package/dist/history/index.vue.d.ts +2 -0
  22. package/dist/icon-button/index.d.ts +7 -0
  23. package/dist/icon-button/index.type.d.ts +7 -0
  24. package/dist/icon-button/index.vue.d.ts +6 -0
  25. package/dist/index.d.ts +12 -2
  26. package/dist/index.js +56 -22
  27. package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +1335 -884
  28. package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +660 -144
  29. package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +85 -0
  30. package/dist/node_modules/.pnpm/@opentiny_vue-locale@3.22.0/node_modules/@opentiny/vue-locale/lib/index.js +1783 -0
  31. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/index.js +77 -0
  32. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +90 -0
  33. package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/index.js +176 -0
  34. package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/pc.js +248 -0
  35. package/dist/node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js +190 -0
  36. package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +53 -0
  37. package/dist/packages/components/src/action-group/ActionGroup.vue.js +7 -0
  38. package/dist/packages/components/src/action-group/ActionGroup.vue2.js +97 -0
  39. package/dist/packages/components/src/action-group/ActionGroupItem.vue.js +14 -0
  40. package/dist/packages/components/src/action-group/ActionGroupItem.vue2.js +4 -0
  41. package/dist/packages/components/src/action-group/index.js +17 -0
  42. package/dist/packages/components/src/bubble/bubble-list.vue.js +2 -2
  43. package/dist/packages/components/src/bubble/bubble-list.vue2.js +18 -19
  44. package/dist/packages/components/src/bubble/bubble.vue.js +2 -2
  45. package/dist/packages/components/src/bubble/bubble.vue2.js +46 -46
  46. package/dist/packages/components/src/container/index.js +9 -0
  47. package/dist/packages/components/src/container/index.vue.js +7 -0
  48. package/dist/packages/components/src/container/index.vue2.js +55 -0
  49. package/dist/packages/components/src/feedback/components/SourceList.vue.js +7 -0
  50. package/dist/packages/components/src/feedback/components/SourceList.vue2.js +52 -0
  51. package/dist/packages/components/src/feedback/index.js +9 -0
  52. package/dist/packages/components/src/feedback/index.vue.js +7 -0
  53. package/dist/packages/components/src/feedback/index.vue2.js +142 -0
  54. package/dist/packages/components/src/history/components/item-tag.vue.js +7 -0
  55. package/dist/packages/components/src/history/components/item-tag.vue2.js +21 -0
  56. package/dist/packages/components/src/history/components/search-empty.vue.js +7 -0
  57. package/dist/packages/components/src/history/components/search-empty.vue2.js +20 -0
  58. package/dist/packages/components/src/history/composables/useEditItemTitle.js +43 -0
  59. package/dist/packages/components/src/history/index.js +11 -0
  60. package/dist/packages/components/src/history/index.vue.js +7 -0
  61. package/dist/packages/components/src/history/index.vue2.js +130 -0
  62. package/dist/packages/components/src/icon-button/index.js +9 -0
  63. package/dist/packages/components/src/icon-button/index.vue.js +7 -0
  64. package/dist/packages/components/src/icon-button/index.vue2.js +40 -0
  65. package/dist/packages/components/src/prompts/prompt.vue.js +2 -2
  66. package/dist/packages/components/src/prompts/prompt.vue2.js +17 -15
  67. package/dist/packages/components/src/question/components/HotQuestions.vue.js +22 -22
  68. package/dist/packages/components/src/question/index.vue.js +7 -7
  69. package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +7 -0
  70. package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +121 -0
  71. package/dist/packages/components/src/sender/index.vue.js +149 -128
  72. package/dist/packages/components/src/suggestion/components/CategoryNav.vue.js +38 -0
  73. package/dist/packages/components/src/suggestion/components/CategoryNav.vue2.js +4 -0
  74. package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue.js +107 -0
  75. package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue2.js +4 -0
  76. package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue.js +123 -0
  77. package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue2.js +4 -0
  78. package/dist/packages/components/src/suggestion/composables/useKeyboardNavigation.js +45 -0
  79. package/dist/packages/components/src/suggestion/composables/useTriggerDetection.js +17 -0
  80. package/dist/packages/components/src/suggestion/index.js +9 -0
  81. package/dist/packages/components/src/suggestion/index.vue.js +179 -0
  82. package/dist/packages/components/src/suggestion/index.vue2.js +4 -0
  83. package/dist/packages/components/src/suggestion/utils/dom.js +18 -0
  84. package/dist/packages/svgs/dist/tiny-robot-svgs.js +364 -69
  85. package/dist/question/components/HotQuestions.vue.d.ts +2 -2
  86. package/dist/question/index.vue.d.ts +1 -1
  87. package/dist/sender/components/ActionButtons.vue.d.ts +2 -2
  88. package/dist/sender/components/TemplateEditor.vue.d.ts +18 -0
  89. package/dist/sender/index.type.d.ts +47 -0
  90. package/dist/sender/index.vue.d.ts +70 -5
  91. package/dist/style.css +1 -1
  92. package/dist/suggestion/components/CategoryNav.vue.d.ts +45 -0
  93. package/dist/suggestion/components/SuggestionCapsule.vue.d.ts +32 -0
  94. package/dist/suggestion/components/SuggestionPanel.vue.d.ts +84 -0
  95. package/dist/suggestion/composables/useKeyboardNavigation.d.ts +18 -0
  96. package/dist/suggestion/composables/useSuggestionFilter.d.ts +10 -0
  97. package/dist/suggestion/composables/useTriggerDetection.d.ts +11 -0
  98. package/dist/suggestion/index.d.ts +7 -0
  99. package/dist/suggestion/index.type.d.ts +94 -0
  100. package/dist/suggestion/index.vue.d.ts +343 -0
  101. package/dist/suggestion/utils/dom.d.ts +20 -0
  102. package/package.json +5 -5
  103. package/src/action-group/ActionGroup.vue +232 -0
  104. package/src/action-group/ActionGroupItem.vue +9 -0
  105. package/src/action-group/index.ts +25 -0
  106. package/src/action-group/index.type.ts +20 -0
  107. package/src/bubble/bubble-list.vue +1 -3
  108. package/src/bubble/bubble.vue +4 -14
  109. package/src/bubble/index.type.ts +1 -1
  110. package/src/container/index.ts +12 -0
  111. package/src/container/index.type.ts +17 -0
  112. package/src/container/index.vue +134 -0
  113. package/src/feedback/components/SourceList.vue +112 -0
  114. package/src/feedback/components/index.ts +1 -0
  115. package/src/feedback/index.ts +12 -0
  116. package/src/feedback/index.type.ts +27 -0
  117. package/src/feedback/index.vue +166 -0
  118. package/src/history/components/index.ts +2 -0
  119. package/src/history/components/item-tag.vue +49 -0
  120. package/src/history/components/search-empty.vue +38 -0
  121. package/src/history/composables/index.ts +1 -0
  122. package/src/history/composables/useEditItemTitle.ts +75 -0
  123. package/src/history/index.ts +12 -0
  124. package/src/history/index.type.ts +50 -0
  125. package/src/history/index.vue +292 -0
  126. package/src/icon-button/index.ts +12 -0
  127. package/src/icon-button/index.type.ts +8 -0
  128. package/src/icon-button/index.vue +52 -0
  129. package/src/index.ts +37 -2
  130. package/src/prompts/prompt.vue +7 -21
  131. package/src/question/components/HotQuestions.vue +1 -1
  132. package/src/question/index.less +9 -10
  133. package/src/sender/components/TemplateEditor.vue +274 -0
  134. package/src/sender/index.less +17 -7
  135. package/src/sender/index.type.ts +51 -0
  136. package/src/sender/index.vue +56 -8
  137. package/src/sender/vars.less +3 -3
  138. package/src/suggestion/components/CategoryNav.vue +38 -0
  139. package/src/suggestion/components/SuggestionCapsule.vue +183 -0
  140. package/src/suggestion/components/SuggestionPanel.vue +147 -0
  141. package/src/suggestion/composables/useKeyboardNavigation.ts +101 -0
  142. package/src/suggestion/composables/useSuggestionFilter.ts +34 -0
  143. package/src/suggestion/composables/useTriggerDetection.ts +46 -0
  144. package/src/suggestion/index.less +497 -0
  145. package/src/suggestion/index.ts +12 -0
  146. package/src/suggestion/index.type.ts +101 -0
  147. package/src/suggestion/index.vue +338 -0
  148. package/src/suggestion/utils/dom.ts +66 -0
  149. package/src/suggestion/vars.less +141 -0
  150. package/.vscode/extensions.json +0 -3
@@ -0,0 +1,27 @@
1
+ import { Component, VNode } from 'vue'
2
+
3
+ export interface FeedbackProps {
4
+ operations?: {
5
+ name: string
6
+ label: string
7
+ onClick?: () => void
8
+ }[]
9
+ operationsLimit?: number
10
+ actions?: {
11
+ name: string
12
+ label: string
13
+ icon?: 'copy' | 'refresh' | 'like' | 'dislike' | VNode | Component
14
+ onClick?: () => void
15
+ }[]
16
+ actionsLimit?: number
17
+ sources?: {
18
+ label: string
19
+ link: string
20
+ }[]
21
+ sourcesLinesLimit?: number
22
+ }
23
+
24
+ export interface FeedbackEvents {
25
+ (e: 'operation', name: string): void
26
+ (e: 'action', name: string): void
27
+ }
@@ -0,0 +1,166 @@
1
+ <script lang="ts" setup>
2
+ import { IconArrowDown, IconArrowUp, IconCopy, IconDislike, IconLike, IconRefresh } from '@opentiny/tiny-robot-svgs'
3
+ import TinyButton from '@opentiny/vue-button'
4
+ import { ref } from 'vue'
5
+ import ActionGroup, { ActionGroupItem } from '../action-group'
6
+ import IconButton from '../icon-button'
7
+ import { SourceList } from './components'
8
+ import type { FeedbackEvents, FeedbackProps } from './index.type'
9
+
10
+ const props = withDefaults(defineProps<FeedbackProps>(), {
11
+ operationsLimit: Number.MAX_SAFE_INTEGER,
12
+ actionsLimit: Number.MAX_SAFE_INTEGER,
13
+ sourcesLinesLimit: Number.MAX_SAFE_INTEGER,
14
+ })
15
+
16
+ const iconMap = {
17
+ copy: IconCopy,
18
+ refresh: IconRefresh,
19
+ like: IconLike,
20
+ dislike: IconDislike,
21
+ }
22
+
23
+ const emit = defineEmits<FeedbackEvents>()
24
+
25
+ const handleOperation = (name: string) => {
26
+ props.operations?.find((operation) => operation.name === name)?.onClick?.()
27
+ emit('operation', name)
28
+ }
29
+
30
+ const handleAction = (name: string) => {
31
+ props.actions?.find((action) => action.name === name)?.onClick?.()
32
+ emit('action', name)
33
+ }
34
+
35
+ const showSourceList = ref(false)
36
+
37
+ const handleSourceList = () => {
38
+ showSourceList.value = !showSourceList.value
39
+ }
40
+ </script>
41
+
42
+ <template>
43
+ <div class="tr-feedback">
44
+ <div class="tr-feedback__operations">
45
+ <div v-if="props.operations?.length" class="tr-feedback__operations-left">
46
+ <action-group
47
+ :max-num="props.operationsLimit"
48
+ :drop-down-show-label-only="true"
49
+ @item-click="handleOperation"
50
+ class="tr-feedback__operations-left-action-group"
51
+ >
52
+ <action-group-item
53
+ v-for="operation in props.operations"
54
+ :key="operation.name"
55
+ :name="operation.name"
56
+ :label="operation.label"
57
+ >
58
+ <tiny-button round :reset-time="0" size="mini">
59
+ {{ operation.label }}
60
+ </tiny-button>
61
+ </action-group-item>
62
+ <template #moreBtn>
63
+ <tiny-button round size="mini" :reset-time="0" class="tr-feedback__operations-more-btn">
64
+ <span>更多</span>
65
+ <icon-arrow-down />
66
+ </tiny-button>
67
+ </template>
68
+ </action-group>
69
+ </div>
70
+ <div v-else-if="props.sources?.length">
71
+ <span class="tr-feedback__source" @click="handleSourceList">
72
+ <span>{{ props.sources?.length }}条来源</span>
73
+ <component :is="showSourceList ? IconArrowUp : IconArrowDown" />
74
+ </span>
75
+ </div>
76
+ <div class="tr-feedback__operations-right">
77
+ <action-group :max-num="props.actionsLimit" @item-click="handleAction">
78
+ <action-group-item
79
+ v-for="action in props.actions"
80
+ :key="action.name"
81
+ :name="action.name"
82
+ :label="action.label"
83
+ >
84
+ <icon-button
85
+ v-if="typeof action.icon === 'string'"
86
+ :icon="iconMap[action.icon]"
87
+ :tooltip="action.label"
88
+ ></icon-button>
89
+ <component v-else :is="action.icon"></component>
90
+ </action-group-item>
91
+ </action-group>
92
+ </div>
93
+ </div>
94
+ <div class="tr-feedback__footer">
95
+ <div v-if="props.operations?.length && props.sources?.length">
96
+ <span class="tr-feedback__source" @click="handleSourceList">
97
+ <span>{{ props.sources?.length }}条来源</span>
98
+ <component :is="showSourceList ? IconArrowUp : IconArrowDown" />
99
+ </span>
100
+ </div>
101
+ <source-list
102
+ v-if="showSourceList && props.sources"
103
+ :sources="props.sources"
104
+ :lines-limit="props.sourcesLinesLimit"
105
+ />
106
+ </div>
107
+ </div>
108
+ </template>
109
+
110
+ <style lang="less" scoped>
111
+ .tr-feedback {
112
+ .tr-feedback__operations {
113
+ display: flex;
114
+ justify-content: space-between;
115
+ align-items: center;
116
+ gap: 8px;
117
+
118
+ .tr-feedback__operations-left {
119
+ .tr-feedback__operations-left-action-group {
120
+ gap: 8px;
121
+ }
122
+
123
+ .tr-feedback__operations-more-btn {
124
+ display: inline-flex;
125
+ align-items: center;
126
+ gap: 4px;
127
+
128
+ svg {
129
+ font-size: 12px;
130
+ }
131
+ }
132
+ }
133
+
134
+ .tr-feedback__operations-right {
135
+ display: flex;
136
+ align-items: center;
137
+ gap: 4px;
138
+ }
139
+ }
140
+ .tr-feedback__footer {
141
+ margin-top: 8px;
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: 8px;
145
+ }
146
+
147
+ .tr-feedback__source {
148
+ height: 24px;
149
+ display: inline-flex;
150
+ align-items: center;
151
+ font-size: 12px;
152
+ line-height: 20px;
153
+ color: rgb(128, 128, 128);
154
+ cursor: pointer;
155
+ gap: 2px;
156
+
157
+ &:hover {
158
+ text-decoration: underline;
159
+ }
160
+
161
+ svg {
162
+ font-size: 16px;
163
+ }
164
+ }
165
+ }
166
+ </style>
@@ -0,0 +1,2 @@
1
+ export { default as ItemTag } from './item-tag.vue'
2
+ export { default as SearchEmpty } from './search-empty.vue'
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts">
2
+ import type { HistoryItemTagProps } from '../index.type'
3
+
4
+ const props = withDefaults(defineProps<HistoryItemTagProps>(), {
5
+ type: 'default',
6
+ })
7
+ </script>
8
+
9
+ <template>
10
+ <div :class="['tr-history__item-tag', props.type]" :style="props.style">
11
+ <span>{{ props.text }}</span>
12
+ </div>
13
+ </template>
14
+
15
+ <style lang="less" scoped>
16
+ .tr-history__item-tag {
17
+ padding: 0 4px;
18
+ font-size: 12px;
19
+ line-height: 18px;
20
+ border-radius: 2px;
21
+
22
+ &.default {
23
+ color: rgb(25, 25, 25);
24
+ background-color: rgb(245, 245, 245);
25
+ }
26
+
27
+ &.success {
28
+ // TODO 成功
29
+ color: rgb(25, 25, 25);
30
+ background-color: rgb(245, 245, 245);
31
+ }
32
+
33
+ &.warning {
34
+ // TODO 警告
35
+ color: rgb(25, 25, 25);
36
+ background-color: rgb(245, 245, 245);
37
+ }
38
+
39
+ &.error {
40
+ color: rgb(242, 48, 48);
41
+ background-color: rgb(252, 227, 224);
42
+ }
43
+
44
+ &.info {
45
+ color: rgb(20, 118, 255);
46
+ background-color: rgb(222, 236, 255);
47
+ }
48
+ }
49
+ </style>
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <div class="tr-history__empty">
3
+ <span class="tr-history__empty-icon">
4
+ <IconEmptySearch />
5
+ </span>
6
+ <span class="tr-history__empty-text">{{ props.text }}</span>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { IconEmptySearch } from '@opentiny/tiny-robot-svgs'
12
+
13
+ const props = withDefaults(defineProps<{ text: string }>(), {
14
+ text: '暂无内容',
15
+ })
16
+ </script>
17
+
18
+ <style lang="less" scoped>
19
+ .tr-history__empty {
20
+ display: flex;
21
+ flex-direction: column;
22
+ align-items: center;
23
+ justify-content: center;
24
+ gap: 12px;
25
+ padding: 84px;
26
+ padding-bottom: 0;
27
+
28
+ .tr-history__empty-icon {
29
+ font-size: 16px;
30
+ }
31
+
32
+ .tr-history__empty-text {
33
+ font-size: 12px;
34
+ line-height: 24px;
35
+ color: rgb(25, 25, 25);
36
+ }
37
+ }
38
+ </style>
@@ -0,0 +1 @@
1
+ export * from './useEditItemTitle'
@@ -0,0 +1,75 @@
1
+ import { onClickOutside } from '@vueuse/core'
2
+ import { ComponentPublicInstance, nextTick, ref, watchEffect } from 'vue'
3
+ import { HistoryEvents, HistoryItem } from '../index.type'
4
+
5
+ export const useEditItemTitle = (emit: HistoryEvents) => {
6
+ const editingItem = ref<Pick<HistoryItem, 'id' | 'title'> & { rawData: HistoryItem }>()
7
+
8
+ const handleEdit = (item: HistoryItem) => {
9
+ editingItem.value = {
10
+ id: item.id,
11
+ title: item.title,
12
+ rawData: item,
13
+ }
14
+ }
15
+
16
+ const inputRef = ref<HTMLInputElement | null>(null)
17
+
18
+ const handleEditorInputRef = (el: Element | ComponentPublicInstance | null) => {
19
+ if (!el) {
20
+ return
21
+ }
22
+
23
+ nextTick(() => {
24
+ inputRef.value = el as HTMLInputElement
25
+ inputRef.value.focus()
26
+ })
27
+ }
28
+
29
+ let stopFn: (() => void) | undefined = undefined
30
+
31
+ const handleConfirm = () => {
32
+ if (editingItem.value) {
33
+ if (editingItem.value.title !== editingItem.value.rawData.title) {
34
+ const { title, rawData } = editingItem.value
35
+ emit('item-title-change', title, rawData)
36
+ }
37
+ editingItem.value = undefined
38
+ }
39
+
40
+ stopFn?.()
41
+ stopFn = undefined
42
+ }
43
+
44
+ const handleCancel = () => {
45
+ editingItem.value = undefined
46
+ stopFn?.()
47
+ stopFn = undefined
48
+ }
49
+
50
+ const handleKeyDown = (e: KeyboardEvent) => {
51
+ if (e.key === 'Enter') {
52
+ handleConfirm()
53
+ } else if (e.key === 'Escape') {
54
+ handleCancel()
55
+ }
56
+ }
57
+
58
+ watchEffect(() => {
59
+ if (!inputRef.value) {
60
+ return
61
+ }
62
+
63
+ stopFn?.()
64
+ stopFn = onClickOutside(inputRef, () => {
65
+ handleConfirm()
66
+ })
67
+ })
68
+
69
+ return {
70
+ editingItem,
71
+ handleEdit,
72
+ handleEditorInputRef,
73
+ handleKeyDown,
74
+ }
75
+ }
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue'
2
+ import History from './index.vue'
3
+
4
+ const install = function <T>(app: App<T>) {
5
+ app.component('TrHistory', History)
6
+ }
7
+
8
+ export default {
9
+ ...History,
10
+ install,
11
+ name: 'TrHistory',
12
+ }
@@ -0,0 +1,50 @@
1
+ import { CSSProperties } from 'vue'
2
+
3
+ interface BaseHistoryProps {
4
+ activeTab?: string
5
+ searchBar?: boolean
6
+ searchQuery?: string
7
+ searchPlaceholder?: string
8
+ searchFn?: (query: string, item: HistoryItem) => boolean
9
+ selected?: string
10
+ }
11
+
12
+ export type SingleTabHistoryProps = {
13
+ tabTitle: string
14
+ data: HistoryGroup[]
15
+ } & BaseHistoryProps
16
+
17
+ export type MultiTabHistoryProps = {
18
+ tabs: {
19
+ title: string
20
+ id: string
21
+ }[]
22
+ data: Record<string, HistoryGroup[]>
23
+ } & BaseHistoryProps
24
+
25
+ export type HistoryProps = SingleTabHistoryProps | MultiTabHistoryProps
26
+
27
+ export interface HistoryGroup<T = Record<string, unknown>> {
28
+ date: string
29
+ items: HistoryItem<T>[]
30
+ }
31
+
32
+ export interface HistoryItemTagProps {
33
+ text: string
34
+ type?: 'success' | 'warning' | 'error' | 'info' | 'default'
35
+ style?: CSSProperties
36
+ }
37
+
38
+ export interface HistoryItem<T = Record<string, unknown>> {
39
+ id: string
40
+ title: string
41
+ tag?: HistoryItemTagProps
42
+ data?: T
43
+ }
44
+
45
+ export interface HistoryEvents {
46
+ (e: 'close'): void
47
+ (e: 'item-click', item: HistoryItem): void
48
+ (e: 'item-title-change', newTitle: string, rawData: HistoryItem): void
49
+ (e: 'item-delete', item: HistoryItem): void
50
+ }