web-component-gallery 1.2.1 → 1.2.4

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 (99) hide show
  1. package/dist/amap.umd.js +117 -1764
  2. package/dist/index.umd.js +117 -1764
  3. package/dist/multiTab.umd.js +1 -1
  4. package/lib/amap/AmapDraw.jsx +1 -1
  5. package/lib/amap/components/AmapSearch/index.jsx +1 -1
  6. package/lib/index.js +2 -6
  7. package/lib/multiTab/MultiTab.jsx +0 -1
  8. package/package.json +2 -3
  9. package/plugins/lib/index.js +2 -6
  10. package/plugins/lib/multiTab/MultiTab.jsx +0 -1
  11. package/dist/chat.umd.js +0 -5087
  12. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  13. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  14. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  15. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  16. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  17. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  18. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  19. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  20. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  21. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  22. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  23. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  24. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  25. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  26. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  27. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  28. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  29. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  30. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  31. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  32. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  33. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  34. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  35. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  36. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  37. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  38. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  39. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  40. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  41. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  42. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  43. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  44. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  45. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  46. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  47. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  48. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  49. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  50. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  51. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  52. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  53. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  54. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  55. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  56. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  57. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  58. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  59. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  60. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  61. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  62. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  63. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  64. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  65. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  66. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  67. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  68. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  69. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  70. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  71. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  72. package/dist/plugins_lib_chat_icons_CheckAll_vue.umd.js +0 -62
  73. package/dist/plugins_lib_chat_icons_Check_vue.umd.js +0 -62
  74. package/dist/plugins_lib_chat_icons_Image_vue.umd.js +0 -62
  75. package/dist/plugins_lib_chat_icons_Send_vue.umd.js +0 -62
  76. package/lib/chat/Chat.js +0 -96
  77. package/lib/chat/Chat.vue +0 -224
  78. package/lib/chat/Header.vue +0 -120
  79. package/lib/chat/MessageDisplay.vue +0 -296
  80. package/lib/chat/MessageManager.vue +0 -189
  81. package/lib/chat/MyMessage.vue +0 -134
  82. package/lib/chat/OtherMessage.vue +0 -243
  83. package/lib/chat/icons/Check.vue +0 -43
  84. package/lib/chat/icons/CheckAll.vue +0 -43
  85. package/lib/chat/icons/Image.vue +0 -31
  86. package/lib/chat/icons/Send.vue +0 -31
  87. package/lib/chat/index.js +0 -7
  88. package/plugins/lib/chat/Chat.js +0 -96
  89. package/plugins/lib/chat/Chat.vue +0 -224
  90. package/plugins/lib/chat/Header.vue +0 -120
  91. package/plugins/lib/chat/MessageDisplay.vue +0 -296
  92. package/plugins/lib/chat/MessageManager.vue +0 -189
  93. package/plugins/lib/chat/MyMessage.vue +0 -134
  94. package/plugins/lib/chat/OtherMessage.vue +0 -243
  95. package/plugins/lib/chat/icons/Check.vue +0 -43
  96. package/plugins/lib/chat/icons/CheckAll.vue +0 -43
  97. package/plugins/lib/chat/icons/Image.vue +0 -31
  98. package/plugins/lib/chat/icons/Send.vue +0 -31
  99. package/plugins/lib/chat/index.js +0 -7
@@ -1,31 +0,0 @@
1
- <template>
2
- <svg :fill="fillColor"
3
- class="material-design-icon__svg"
4
- :width="size"
5
- :height="size"
6
- viewBox="0 0 24 24">
7
- <path d="M3 12.9999H9V10.9999H3V1.84558C3 1.56944 3.22386 1.34558 3.5 1.34558C3.58425 1.34558 3.66714 1.36687 3.74096 1.40747L22.2034 11.5618C22.4454 11.6949 22.5337 11.9989 22.4006 12.2409C22.3549 12.324 22.2865 12.3924 22.2034 12.4381L3.74096 22.5924C3.499 22.7255 3.19497 22.6372 3.06189 22.3953C3.02129 22.3214 3 22.2386 3 22.1543V12.9999Z">
8
- <title v-if="title">{{ title }}</title>
9
- </path>
10
- </svg>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- name: "SendIcon",
16
- emits: ['click'],
17
- props: {
18
- title: {
19
- type: String,
20
- },
21
- fillColor: {
22
- type: String,
23
- default: "currentColor"
24
- },
25
- size: {
26
- type: Number,
27
- default: 24
28
- }
29
- }
30
- }
31
- </script>
package/lib/chat/index.js DELETED
@@ -1,7 +0,0 @@
1
- import Chat from './Chat.vue'
2
-
3
- Chat.install = function (Vue) {
4
- Vue.component(Chat.name, Chat)
5
- }
6
-
7
- export default Chat
@@ -1,96 +0,0 @@
1
- import katex from 'katex'
2
- import {marked} from 'marked' // @4.3.0版本
3
- import DOMPurify from 'dompurify'
4
-
5
- // 配置 Marked
6
- marked.setOptions({ mangle: false, breaks: false })
7
-
8
- export function parseMarkdown(text) {
9
- if(!text) return
10
- // $\\frac{1}{|a|} F\\left(\\frac{\\omega}{a}\\right)$
11
- const rawText = text.trim()
12
- .replace(/\\\[/g, "$")
13
- .replace(/\\\]/g, "$")
14
- const rawHtml = marked(rawText)
15
- return DOMPurify.sanitize(rawHtml, {
16
- ADD_TAGS: ['math', 'semantics'],
17
- ADD_ATTR: ['class', 'encoding']
18
- })
19
- }
20
-
21
-
22
- import KatexAutoRender from 'katex/dist/contrib/auto-render'
23
- import 'katex/dist/katex.min.css'
24
-
25
- export function katexAutoRender(el, binding) {
26
- let options = {
27
- delimiters: [
28
- { left: "$$", right: "$$", display: true },
29
- { left: "$", right: "$", display: false },
30
- { left: "\\(", right: "\\)", display: false },
31
- { left: "\(", right: "\)", display: false },
32
- { left: "\\[", right: "\\]", display: true },
33
- { left: "\[", right: "\]", display: false }
34
- ]
35
- }
36
-
37
- if(binding.value) {
38
- options = {
39
- ...options,
40
- ...binding.value
41
- }
42
- }
43
-
44
- KatexAutoRender(el, options)
45
- }
46
-
47
-
48
-
49
- // // 块级公式解析 ($$...$$)
50
- // const blockMathExtension = {
51
- // name: 'blockMath',
52
- // level: 'block',
53
- // start(src) { return src.indexOf('$$') },
54
- // tokenizer(src) {
55
- // const match = src.match(/^\$\$((?:\\\$|[^$])+?)\$\$/)
56
- // if (match) {
57
- // return {
58
- // type: 'blockMath',
59
- // raw: match,
60
- // text: match.trim()
61
- // }
62
- // }
63
- // },
64
- // renderer(token) {
65
- // try {
66
- // return katex.renderToString(token.text, { displayMode: true })
67
- // } catch (e) {
68
- // return `<div class="katex-error">块级公式错误: ${e.message}</div>`
69
- // }
70
- // }
71
- // }
72
-
73
- // // 行内公式解析 ($...$)
74
- // const inlineMathExtension = {
75
- // name: 'inlineMath',
76
- // level: 'inline',
77
- // start(src) { return src.indexOf('$') },
78
- // tokenizer(src) {
79
- // const match = src.match(/^\$((?:\\\$|[^$])+?)\$/)
80
- // if (match) {
81
- // return {
82
- // type: 'inlineMath',
83
- // raw: match,
84
- // text: match.trim()
85
- // }
86
- // }
87
- // },
88
- // renderer(token) {
89
- // try {
90
- // return katex.renderToString(token.text, { displayMode: false })
91
- // } catch (e) {
92
- // return `<span class="katex-error">行内公式错误: ${e.message}</span>`
93
- // }
94
- // }
95
- // }
96
- // marked.use({ extensions: [blockMathExtension, inlineMathExtension] })
@@ -1,224 +0,0 @@
1
- <template>
2
- <div class="quick-chat-container">
3
- <Header v-if="displayHeader"
4
- :hide-close-button="hideCloseButton" :close-button-icon-size="closeButtonIconSize" @onClose="onClose()">
5
- <template #header>
6
- <slot name="header"></slot>
7
- </template>
8
- </Header>
9
- <MessageDisplay :async-mode="asyncMode" :load-more-messages="loadMoreMessages"
10
- :link-options="linkOptions"
11
- :scroll-bottom="scrollBottom"
12
- :profile-picture-config="profilePictureConfig"
13
- :timestamp-config="timestampConfig"
14
- @onImageClicked="onImageClicked"/>
15
- <MessageManager
16
- :submit-icon-size="submitIconSize"
17
- :submit-image-icon-size="submitImageIconSize"
18
- :send-images="sendImages"
19
- :accept-image-types="acceptImageTypes"
20
- @onImageSelected="onImageSelected"
21
- @onMessageSubmit="onMessageSubmit"
22
- @onType="onType"/>
23
- </div>
24
- </template>
25
-
26
- <script>
27
- import Header from './Header.vue'
28
- import MessageDisplay from './MessageDisplay.vue'
29
- import MessageManager from './MessageManager.vue'
30
- import {mapMutations} from 'vuex'
31
-
32
- export default {
33
- name: 'chat',
34
- components: {
35
- Header,
36
- MessageDisplay,
37
- MessageManager
38
- },
39
- props: {
40
- participants: {
41
- type: Array,
42
- required: true
43
- },
44
- messages: {
45
- type: Array,
46
- required: true
47
- },
48
- myself: {
49
- type: Object,
50
- required: true
51
- },
52
- chatTitle: {
53
- type: String,
54
- required: false,
55
- default: '七星安全助手'
56
- },
57
- chatDescription: {
58
- type: String,
59
- required: false,
60
- default: 'deepseek'
61
- },
62
- placeholder: {
63
- type: String,
64
- required: false,
65
- default: '在此输入消息'
66
- },
67
- hideCloseButton: {
68
- type: Boolean,
69
- required: false,
70
- default: false
71
- },
72
- submitIconSize: {
73
- type: Number,
74
- required: false,
75
- default: 24
76
- },
77
- submitImageIconSize: {
78
- type: Number,
79
- required: false,
80
- default: 24
81
- },
82
- closeButtonIconSize: {
83
- type: String,
84
- required: false,
85
- default: "15px"
86
- },
87
- asyncMode: {
88
- type: Boolean,
89
- required: false,
90
- default: false
91
- },
92
- loadMoreMessages: {
93
- type: Function,
94
- required: false,
95
- default: null
96
- },
97
- scrollBottom:{
98
- type: Object,
99
- required: false,
100
- default: () => {
101
- return {
102
- messageSent: true,
103
- messageReceived: false
104
- }
105
- }
106
- },
107
- displayHeader: {
108
- type: Boolean,
109
- required: false,
110
- default: true
111
- },
112
- sendImages: {
113
- type: Boolean,
114
- required: false,
115
- default: false
116
- },
117
- profilePictureConfig: {
118
- type: Object,
119
- required: false,
120
- default: () => {
121
- return {
122
- others: true,
123
- myself: false,
124
- styles: {
125
- width: '25px',
126
- height: '25px',
127
- borderRadius: '50%'
128
- }
129
- }
130
- }
131
- },
132
- timestampConfig: {
133
- type: Object,
134
- required: false,
135
- default: () => {
136
- return {
137
- format: 'HH:mm',
138
- relative: false
139
- }
140
- }
141
- },
142
- linkOptions: {
143
- type: Object,
144
- required: false,
145
- default: () => {
146
- return {
147
- myself: {},
148
- others: {}
149
- }
150
- }
151
- },
152
- acceptImageTypes: {
153
- type: String,
154
- required: false,
155
- default: "image/*"
156
- }
157
- },
158
- watch: {
159
- participants() {
160
- this.setParticipants(this.participants);
161
- },
162
- myself() {
163
- this.setMyself(this.myself);
164
- },
165
- messages() {
166
- this.setMessages(this.messages);
167
- },
168
- placeholder() {
169
- this.setPlaceholder(this.placeholder);
170
- },
171
- chatTitle() {
172
- this.setChatTitle(this.chatTitle);
173
- },
174
- chatDescription() {
175
- this.setChatDescription(this.chatDescription);
176
- }
177
- },
178
- created() {
179
- this.setParticipants(this.participants);
180
- this.setMyself(this.myself);
181
- this.setMessages(this.messages);
182
- this.setPlaceholder(this.placeholder);
183
- this.setChatTitle(this.chatTitle);
184
- this.setChatDescription(this.chatDescription);
185
- },
186
- methods: {
187
- ...mapMutations([
188
- 'setParticipants',
189
- 'setMyself',
190
- 'setMessages',
191
- 'setPlaceholder',
192
- 'setChatTitle',
193
- 'setChatDescription'
194
- ]),
195
- onClose: function(){
196
- this.$emit("onClose");
197
- },
198
- onType: function(e){
199
- this.$emit("onType", e)
200
- },
201
- onMessageSubmit: function(message){
202
- this.$emit("onMessageSubmit", message)
203
- },
204
- onImageSelected: function(data){
205
- this.$emit("onImageSelected", data)
206
- },
207
- onImageClicked: function(message){
208
- this.$emit("onImageClicked", message)
209
- },
210
- },
211
- }
212
- </script>
213
-
214
- <style lang="less">
215
- /* 混入样式 */
216
- @import url('../style/mixins.less');
217
- .quick-chat-container {
218
- .square(100%);
219
- .flex-layout(column);
220
- align-items: stretch;
221
- border-radius: 10px;
222
- overflow: hidden;
223
- }
224
- </style>
@@ -1,120 +0,0 @@
1
- <template>
2
- <div class="header-container">
3
- <slot name="header" :chatTitle="chatTitle"
4
- :participants="participants"
5
- :myself="myself"></slot>
6
- <div v-if="!hasHeaderSlot" class="header-title">
7
- <p class="header-title-text">{{chatTitle}}</p>
8
- <p class="header-paticipants-text">
9
- {{chatDescription}}
10
- </p>
11
- </div>
12
-
13
- <div v-if="!hideCloseButton && !hasHeaderSlot" class="header-exit">
14
- <slot name="close-button">
15
- <a class="header-exit-button" href="#" :style="{fontSize: closeButtonIconSize}"
16
- @click.prevent="onClose">✕</a>
17
- </slot>
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <script>
23
- /*
24
- * TODO: improve support for more than 10 participants (the names list may break in some cases)
25
- */
26
- export default {
27
- props: {
28
- hideCloseButton: {
29
- type: Boolean,
30
- required: false,
31
- default: false
32
- },
33
- closeButtonIconSize: {
34
- type: String,
35
- required: false,
36
- default: "15px"
37
- },
38
- /* onClose: {
39
- type: Function,
40
- required: false,
41
- default: () => false
42
- } */
43
- },
44
- computed: {
45
- participants() {
46
- return this.$store.state.chat.participants
47
- },
48
- myself() {
49
- return this.$store.state.chat.myself
50
- },
51
- chatTitle() {
52
- return this.$store.state.chat.chatTitle
53
- },
54
- chatDescription() {
55
- return this.$store.state.chat.chatDescription
56
- },
57
- hasHeaderSlot: function () {
58
- return !!this.$slots['header']
59
- }
60
- },
61
- methods:{
62
- onClose: function(){
63
- this.$emit("onClose")
64
- }
65
- }
66
- }
67
- </script>
68
-
69
- <style lang="less">
70
- @import '~ant-design-vue/lib/style/themes/default.less';
71
-
72
- .quick-chat-container .header-container {
73
- height: 70px;
74
- display: flex;
75
- padding: 0 20px 0 10px;
76
- align-items: center;
77
- background: @layout-header-background;
78
- -webkit-box-shadow: 0 2px 20px 2px @shadow-color;
79
- box-shadow: 0 2px 20px 2px @shadow-color;
80
- z-index: 5;
81
-
82
- .header-title {
83
- padding: 10px;
84
- flex: 1;
85
- text-align: left;
86
- }
87
-
88
- .header-title-text {
89
- color: @white;
90
- font-size: @font-size-lg;
91
- margin-bottom: 0;
92
- }
93
-
94
- .header-paticipants-text {
95
- color: #F2F3F5;
96
- font-size: @font-size-sm;
97
- margin: 5px 0;
98
- max-height: 30px;
99
- overflow: hidden;
100
- }
101
-
102
- .header-exit-button {
103
- text-decoration: none;
104
- color: @text-color;
105
- font-size: 20px;
106
- &:hover {
107
- color: @error-color
108
- }
109
- }
110
-
111
- .icon-close-chat {
112
- color: @text-color;
113
- width: 100%;
114
- }
115
-
116
- .icon-close-chat:hover {
117
- color: @error-color
118
- }
119
- }
120
- </style>