@adminforth/text-complete 1.1.1 → 1.2.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.
@@ -22,9 +22,8 @@ steps:
22
22
  image: node:20
23
23
  when:
24
24
  - event: push
25
- volumes:
26
- - /var/run/docker.sock:/var/run/docker.sock
27
25
  commands:
26
+ - apt update && apt install -y rsync
28
27
  - export $(cat /woodpecker/deploy.vault.env | xargs)
29
28
  - npm clean-install
30
29
  - /bin/bash ./.woodpecker/buildRelease.sh
package/build.log CHANGED
@@ -1,4 +1,13 @@
1
1
 
2
2
  > @adminforth/text-complete@1.0.21 build
3
- > tsc
3
+ > tsc && rsync -av --exclude 'node_modules' custom dist/
4
4
 
5
+ sending incremental file list
6
+ custom/
7
+ custom/completionInput.vue
8
+ custom/package-lock.json
9
+ custom/package.json
10
+ custom/tsconfig.json
11
+
12
+ sent 16,559 bytes received 96 bytes 33,310.00 bytes/sec
13
+ total size is 16,206 speedup is 0.97
@@ -0,0 +1,64 @@
1
+ <template>
2
+
3
+ <SuggestionInput
4
+ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500
5
+ focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400
6
+ dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 whitespace-normal"
7
+ v-model="currentValue"
8
+ :type="column.type"
9
+ :completionRequest="complete"
10
+ :debounceTime="meta.debounceTime"
11
+ />
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { ref, onMounted, watch, Ref } from 'vue';
16
+ import { callAdminForthApi } from '@/utils';
17
+ import { AdminForthColumnCommon } from '@/types/Common';
18
+ import SuggestionInput from 'vue-suggestion-input';
19
+ import 'vue-suggestion-input/dist/style.css';
20
+
21
+
22
+ const props = defineProps<{
23
+ column: AdminForthColumnCommon,
24
+ record: any,
25
+ meta: any,
26
+ }>();
27
+
28
+ const emit = defineEmits([
29
+ 'update:value',
30
+ ]);
31
+
32
+ const currentValue: Ref<string> = ref('');
33
+
34
+ onMounted(() => {
35
+ currentValue.value = props.record[props.column.name] || '';
36
+ });
37
+
38
+ watch(() => currentValue.value, (value) => {
39
+ emit('update:value', value);
40
+ });
41
+
42
+ watch(() => props.record, (value) => {
43
+ currentValue.value = value[props.column.name] || '';
44
+ });
45
+
46
+ async function complete(textBeforeCursor: string) {
47
+ const res = await callAdminForthApi({
48
+ path: `/plugin/${props.meta.pluginInstanceId}/doComplete`,
49
+ method: 'POST',
50
+ body: {
51
+ record: {...props.record, [props.column.name]: textBeforeCursor},
52
+ },
53
+ });
54
+
55
+ return res.completion;
56
+ }
57
+
58
+ </script>
59
+
60
+ <style>
61
+ .ql-editor::before {
62
+ @apply text-gray-500 dark:text-gray-400 text-sm font-normal font-sans !important;
63
+ }
64
+ </style>
@@ -0,0 +1,368 @@
1
+ {
2
+ "name": "custom",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "custom",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "devDependencies": {
12
+ "vue-suggestion-input": "^0.0.18"
13
+ }
14
+ },
15
+ "node_modules/@babel/helper-string-parser": {
16
+ "version": "7.24.8",
17
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",
18
+ "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",
19
+ "dev": true,
20
+ "engines": {
21
+ "node": ">=6.9.0"
22
+ }
23
+ },
24
+ "node_modules/@babel/helper-validator-identifier": {
25
+ "version": "7.24.7",
26
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
27
+ "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
28
+ "dev": true,
29
+ "engines": {
30
+ "node": ">=6.9.0"
31
+ }
32
+ },
33
+ "node_modules/@babel/parser": {
34
+ "version": "7.25.3",
35
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz",
36
+ "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==",
37
+ "dev": true,
38
+ "dependencies": {
39
+ "@babel/types": "^7.25.2"
40
+ },
41
+ "bin": {
42
+ "parser": "bin/babel-parser.js"
43
+ },
44
+ "engines": {
45
+ "node": ">=6.0.0"
46
+ }
47
+ },
48
+ "node_modules/@babel/types": {
49
+ "version": "7.25.2",
50
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz",
51
+ "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==",
52
+ "dev": true,
53
+ "dependencies": {
54
+ "@babel/helper-string-parser": "^7.24.8",
55
+ "@babel/helper-validator-identifier": "^7.24.7",
56
+ "to-fast-properties": "^2.0.0"
57
+ },
58
+ "engines": {
59
+ "node": ">=6.9.0"
60
+ }
61
+ },
62
+ "node_modules/@jridgewell/sourcemap-codec": {
63
+ "version": "1.5.0",
64
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
65
+ "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
66
+ "dev": true
67
+ },
68
+ "node_modules/@vue/compiler-core": {
69
+ "version": "3.4.35",
70
+ "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.35.tgz",
71
+ "integrity": "sha512-gKp0zGoLnMYtw4uS/SJRRO7rsVggLjvot3mcctlMXunYNsX+aRJDqqw/lV5/gHK91nvaAAlWFgdVl020AW1Prg==",
72
+ "dev": true,
73
+ "dependencies": {
74
+ "@babel/parser": "^7.24.7",
75
+ "@vue/shared": "3.4.35",
76
+ "entities": "^4.5.0",
77
+ "estree-walker": "^2.0.2",
78
+ "source-map-js": "^1.2.0"
79
+ }
80
+ },
81
+ "node_modules/@vue/compiler-dom": {
82
+ "version": "3.4.35",
83
+ "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.35.tgz",
84
+ "integrity": "sha512-pWIZRL76/oE/VMhdv/ovZfmuooEni6JPG1BFe7oLk5DZRo/ImydXijoZl/4kh2406boRQ7lxTYzbZEEXEhj9NQ==",
85
+ "dev": true,
86
+ "dependencies": {
87
+ "@vue/compiler-core": "3.4.35",
88
+ "@vue/shared": "3.4.35"
89
+ }
90
+ },
91
+ "node_modules/@vue/compiler-sfc": {
92
+ "version": "3.4.35",
93
+ "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.35.tgz",
94
+ "integrity": "sha512-xacnRS/h/FCsjsMfxBkzjoNxyxEyKyZfBch/P4vkLRvYJwe5ChXmZZrj8Dsed/752H2Q3JE8kYu9Uyha9J6PgA==",
95
+ "dev": true,
96
+ "dependencies": {
97
+ "@babel/parser": "^7.24.7",
98
+ "@vue/compiler-core": "3.4.35",
99
+ "@vue/compiler-dom": "3.4.35",
100
+ "@vue/compiler-ssr": "3.4.35",
101
+ "@vue/shared": "3.4.35",
102
+ "estree-walker": "^2.0.2",
103
+ "magic-string": "^0.30.10",
104
+ "postcss": "^8.4.40",
105
+ "source-map-js": "^1.2.0"
106
+ }
107
+ },
108
+ "node_modules/@vue/compiler-ssr": {
109
+ "version": "3.4.35",
110
+ "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.35.tgz",
111
+ "integrity": "sha512-7iynB+0KB1AAJKk/biENTV5cRGHRdbdaD7Mx3nWcm1W8bVD6QmnH3B4AHhQQ1qZHhqFwzEzMwiytXm3PX1e60A==",
112
+ "dev": true,
113
+ "dependencies": {
114
+ "@vue/compiler-dom": "3.4.35",
115
+ "@vue/shared": "3.4.35"
116
+ }
117
+ },
118
+ "node_modules/@vue/reactivity": {
119
+ "version": "3.4.35",
120
+ "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.35.tgz",
121
+ "integrity": "sha512-Ggtz7ZZHakriKioveJtPlStYardwQH6VCs9V13/4qjHSQb/teE30LVJNrbBVs4+aoYGtTQKJbTe4CWGxVZrvEw==",
122
+ "dev": true,
123
+ "dependencies": {
124
+ "@vue/shared": "3.4.35"
125
+ }
126
+ },
127
+ "node_modules/@vue/runtime-core": {
128
+ "version": "3.4.35",
129
+ "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.35.tgz",
130
+ "integrity": "sha512-D+BAjFoWwT5wtITpSxwqfWZiBClhBbR+bm0VQlWYFOadUUXFo+5wbe9ErXhLvwguPiLZdEF13QAWi2vP3ZD5tA==",
131
+ "dev": true,
132
+ "dependencies": {
133
+ "@vue/reactivity": "3.4.35",
134
+ "@vue/shared": "3.4.35"
135
+ }
136
+ },
137
+ "node_modules/@vue/runtime-dom": {
138
+ "version": "3.4.35",
139
+ "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.35.tgz",
140
+ "integrity": "sha512-yGOlbos+MVhlS5NWBF2HDNgblG8e2MY3+GigHEyR/dREAluvI5tuUUgie3/9XeqhPE4LF0i2wjlduh5thnfOqw==",
141
+ "dev": true,
142
+ "dependencies": {
143
+ "@vue/reactivity": "3.4.35",
144
+ "@vue/runtime-core": "3.4.35",
145
+ "@vue/shared": "3.4.35",
146
+ "csstype": "^3.1.3"
147
+ }
148
+ },
149
+ "node_modules/@vue/server-renderer": {
150
+ "version": "3.4.35",
151
+ "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.35.tgz",
152
+ "integrity": "sha512-iZ0e/u9mRE4T8tNhlo0tbA+gzVkgv8r5BX6s1kRbOZqfpq14qoIvCZ5gIgraOmYkMYrSEZgkkojFPr+Nyq/Mnw==",
153
+ "dev": true,
154
+ "dependencies": {
155
+ "@vue/compiler-ssr": "3.4.35",
156
+ "@vue/shared": "3.4.35"
157
+ },
158
+ "peerDependencies": {
159
+ "vue": "3.4.35"
160
+ }
161
+ },
162
+ "node_modules/@vue/shared": {
163
+ "version": "3.4.35",
164
+ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.35.tgz",
165
+ "integrity": "sha512-hvuhBYYDe+b1G8KHxsQ0diDqDMA8D9laxWZhNAjE83VZb5UDaXl9Xnz7cGdDSyiHM90qqI/CyGMcpBpiDy6VVQ==",
166
+ "dev": true
167
+ },
168
+ "node_modules/csstype": {
169
+ "version": "3.1.3",
170
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
171
+ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
172
+ "dev": true
173
+ },
174
+ "node_modules/entities": {
175
+ "version": "4.5.0",
176
+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
177
+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
178
+ "dev": true,
179
+ "engines": {
180
+ "node": ">=0.12"
181
+ },
182
+ "funding": {
183
+ "url": "https://github.com/fb55/entities?sponsor=1"
184
+ }
185
+ },
186
+ "node_modules/estree-walker": {
187
+ "version": "2.0.2",
188
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
189
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
190
+ "dev": true
191
+ },
192
+ "node_modules/eventemitter3": {
193
+ "version": "5.0.1",
194
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
195
+ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
196
+ "dev": true
197
+ },
198
+ "node_modules/fast-diff": {
199
+ "version": "1.3.0",
200
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
201
+ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
202
+ "dev": true
203
+ },
204
+ "node_modules/lodash-es": {
205
+ "version": "4.17.21",
206
+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
207
+ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
208
+ "dev": true
209
+ },
210
+ "node_modules/lodash.clonedeep": {
211
+ "version": "4.5.0",
212
+ "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
213
+ "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==",
214
+ "dev": true
215
+ },
216
+ "node_modules/lodash.isequal": {
217
+ "version": "4.5.0",
218
+ "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
219
+ "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
220
+ "dev": true
221
+ },
222
+ "node_modules/magic-string": {
223
+ "version": "0.30.11",
224
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz",
225
+ "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",
226
+ "dev": true,
227
+ "dependencies": {
228
+ "@jridgewell/sourcemap-codec": "^1.5.0"
229
+ }
230
+ },
231
+ "node_modules/nanoid": {
232
+ "version": "3.3.7",
233
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
234
+ "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
235
+ "dev": true,
236
+ "funding": [
237
+ {
238
+ "type": "github",
239
+ "url": "https://github.com/sponsors/ai"
240
+ }
241
+ ],
242
+ "bin": {
243
+ "nanoid": "bin/nanoid.cjs"
244
+ },
245
+ "engines": {
246
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
247
+ }
248
+ },
249
+ "node_modules/parchment": {
250
+ "version": "3.0.0",
251
+ "resolved": "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz",
252
+ "integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==",
253
+ "dev": true
254
+ },
255
+ "node_modules/picocolors": {
256
+ "version": "1.0.1",
257
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
258
+ "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
259
+ "dev": true
260
+ },
261
+ "node_modules/postcss": {
262
+ "version": "8.4.40",
263
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz",
264
+ "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==",
265
+ "dev": true,
266
+ "funding": [
267
+ {
268
+ "type": "opencollective",
269
+ "url": "https://opencollective.com/postcss/"
270
+ },
271
+ {
272
+ "type": "tidelift",
273
+ "url": "https://tidelift.com/funding/github/npm/postcss"
274
+ },
275
+ {
276
+ "type": "github",
277
+ "url": "https://github.com/sponsors/ai"
278
+ }
279
+ ],
280
+ "dependencies": {
281
+ "nanoid": "^3.3.7",
282
+ "picocolors": "^1.0.1",
283
+ "source-map-js": "^1.2.0"
284
+ },
285
+ "engines": {
286
+ "node": "^10 || ^12 || >=14"
287
+ }
288
+ },
289
+ "node_modules/quill": {
290
+ "version": "2.0.2",
291
+ "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.2.tgz",
292
+ "integrity": "sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==",
293
+ "dev": true,
294
+ "dependencies": {
295
+ "eventemitter3": "^5.0.1",
296
+ "lodash-es": "^4.17.21",
297
+ "parchment": "^3.0.0",
298
+ "quill-delta": "^5.1.0"
299
+ },
300
+ "engines": {
301
+ "npm": ">=8.2.3"
302
+ }
303
+ },
304
+ "node_modules/quill-delta": {
305
+ "version": "5.1.0",
306
+ "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz",
307
+ "integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==",
308
+ "dev": true,
309
+ "dependencies": {
310
+ "fast-diff": "^1.3.0",
311
+ "lodash.clonedeep": "^4.5.0",
312
+ "lodash.isequal": "^4.5.0"
313
+ },
314
+ "engines": {
315
+ "node": ">= 12.0.0"
316
+ }
317
+ },
318
+ "node_modules/source-map-js": {
319
+ "version": "1.2.0",
320
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
321
+ "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
322
+ "dev": true,
323
+ "engines": {
324
+ "node": ">=0.10.0"
325
+ }
326
+ },
327
+ "node_modules/to-fast-properties": {
328
+ "version": "2.0.0",
329
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
330
+ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
331
+ "dev": true,
332
+ "engines": {
333
+ "node": ">=4"
334
+ }
335
+ },
336
+ "node_modules/vue": {
337
+ "version": "3.4.35",
338
+ "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.35.tgz",
339
+ "integrity": "sha512-+fl/GLmI4GPileHftVlCdB7fUL4aziPcqTudpTGXCT8s+iZWuOCeNEB5haX6Uz2IpRrbEXOgIFbe+XciCuGbNQ==",
340
+ "dev": true,
341
+ "dependencies": {
342
+ "@vue/compiler-dom": "3.4.35",
343
+ "@vue/compiler-sfc": "3.4.35",
344
+ "@vue/runtime-dom": "3.4.35",
345
+ "@vue/server-renderer": "3.4.35",
346
+ "@vue/shared": "3.4.35"
347
+ },
348
+ "peerDependencies": {
349
+ "typescript": "*"
350
+ },
351
+ "peerDependenciesMeta": {
352
+ "typescript": {
353
+ "optional": true
354
+ }
355
+ }
356
+ },
357
+ "node_modules/vue-suggestion-input": {
358
+ "version": "0.0.18",
359
+ "resolved": "https://registry.npmjs.org/vue-suggestion-input/-/vue-suggestion-input-0.0.18.tgz",
360
+ "integrity": "sha512-jYyImQFcOvY9l2WJvSJ9mDCnQLSNzrGtCsbACL77p3jePWfbvPNCRwFEzEELCoBVYqYFmRtON+24Qhrb2Da7kw==",
361
+ "dev": true,
362
+ "dependencies": {
363
+ "quill": "^2.0.2",
364
+ "vue": "^3.4.31"
365
+ }
366
+ }
367
+ }
368
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "custom",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "devDependencies": {
13
+ "vue-suggestion-input": "^0.0.18"
14
+ }
15
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".", // This should point to your project root
4
+ "paths": {
5
+ "@/*": [
6
+ // "node_modules/adminforth/dist/spa/src/*"
7
+ "../../../spa/src/*"
8
+ ],
9
+ "*": [
10
+ // "node_modules/adminforth/dist/spa/node_modules/*"
11
+ "../../../spa/node_modules/*"
12
+ ],
13
+ "@@/*": [
14
+ // "node_modules/adminforth/dist/spa/src/*"
15
+ "."
16
+ ]
17
+ }
18
+ }
19
+ }
package/dist/index.js CHANGED
@@ -91,9 +91,15 @@ export default class TextCompletePlugin extends AdminForthPlugin {
91
91
  "Don't talk to me. Just write text. No quotes. Don't repeat current field value, just write completion\n";
92
92
  }
93
93
  else {
94
- content = `Fill text/string field "${this.options.fieldName}" in the table "${resLabel}"\n` +
95
- (Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
96
- "Be short, clear and precise. No quotes. Don't talk to me. Just write text\n";
94
+ if (this.options.initialPrompt) {
95
+ content = `${this.options.initialPrompt}\n` +
96
+ "No quotes. Don't talk to me. Just write text\n";
97
+ }
98
+ else {
99
+ content = `Fill text/string field "${this.options.fieldName}" in the table "${resLabel}"\n` +
100
+ (Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
101
+ "Be short, clear and precise. No quotes. Don't talk to me. Just write text\n";
102
+ }
97
103
  }
98
104
  process.env.HEAVY_DEBUG && console.log('🪲 OpenAI Prompt 🧠', content);
99
105
  const { content: respContent, finishReason } = yield this.options.adapter.complete(content, (_l = this.options.expert) === null || _l === void 0 ? void 0 : _l.stop, (_m = this.options.expert) === null || _m === void 0 ? void 0 : _m.maxTokens);
package/index.ts CHANGED
@@ -119,9 +119,15 @@ export default class TextCompletePlugin extends AdminForthPlugin {
119
119
  "Don't talk to me. Just write text. No quotes. Don't repeat current field value, just write completion\n";
120
120
 
121
121
  } else {
122
- content = `Fill text/string field "${this.options.fieldName}" in the table "${resLabel}"\n` +
123
- (Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
124
- "Be short, clear and precise. No quotes. Don't talk to me. Just write text\n";
122
+
123
+ if (this.options.initialPrompt) {
124
+ content = `${this.options.initialPrompt}\n` +
125
+ "No quotes. Don't talk to me. Just write text\n";
126
+ } else {
127
+ content = `Fill text/string field "${this.options.fieldName}" in the table "${resLabel}"\n` +
128
+ (Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
129
+ "Be short, clear and precise. No quotes. Don't talk to me. Just write text\n";
130
+ }
125
131
  }
126
132
 
127
133
  process.env.HEAVY_DEBUG && console.log('🪲 OpenAI Prompt 🧠', content);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@adminforth/text-complete",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Text completion plugin for adminforth",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
9
- "build": "tsc",
9
+ "build": "tsc && rsync -av --exclude 'node_modules' custom dist/",
10
10
  "prepare": "npm link adminforth"
11
11
  },
12
12
  "repository": {
package/types.ts CHANGED
@@ -6,6 +6,16 @@ export interface PluginOptions {
6
6
  */
7
7
  fieldName: string;
8
8
 
9
+
10
+ /**
11
+ * Initial prompt request when field is empty. Mustache syntax for record context fields is supported.
12
+ * E.g.
13
+ * 'I need to introduce "{{ name }}" technology to my software development company website, I need short but very attractive description if it.'
14
+ *
15
+ * Where `name` is a field name which contains technology name e.g. Vue.js
16
+ */
17
+ initialPrompt?: string;
18
+
9
19
  /**
10
20
  * Expert settings
11
21
  */
@@ -21,6 +31,7 @@ export interface PluginOptions {
21
31
  */
22
32
  debounceTime?: number;
23
33
 
34
+
24
35
  /**
25
36
  * When completion is made, this plugin passes non-empty fields of the record to the LLM model for record context understanding.
26
37
  */