@adminforth/rich-editor 1.6.13 → 1.6.15
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.
- package/.woodpecker/buildSlackNotify.sh +3 -1
- package/.woodpecker/release.yml +24 -7
- package/build.log +2 -2
- package/custom/quillEditor.vue +20 -0
- package/dist/custom/quillEditor.vue +20 -0
- package/package.json +1 -1
|
@@ -4,8 +4,10 @@ set -x
|
|
|
4
4
|
|
|
5
5
|
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
|
|
6
6
|
|
|
7
|
+
STATUS=${1}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
if [ "$STATUS" = "success" ]; then
|
|
9
11
|
MESSAGE="Did a build without issues on \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\`. Commit: _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
|
|
10
12
|
|
|
11
13
|
curl -s -X POST -H "Content-Type: application/json" -d '{
|
package/.woodpecker/release.yml
CHANGED
|
@@ -16,25 +16,42 @@ steps:
|
|
|
16
16
|
commands:
|
|
17
17
|
- infisical export --domain https://vault.devforth.io/api --format=dotenv-export --env="prod" > /woodpecker/deploy.vault.env
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
build:
|
|
20
20
|
image: node:20
|
|
21
21
|
when:
|
|
22
22
|
- event: push
|
|
23
23
|
commands:
|
|
24
24
|
- apt update && apt install -y rsync
|
|
25
|
-
-
|
|
25
|
+
- . /woodpecker/deploy.vault.env
|
|
26
26
|
- npm clean-install
|
|
27
27
|
- /bin/bash ./.woodpecker/buildRelease.sh
|
|
28
28
|
- npm audit signatures
|
|
29
|
+
|
|
30
|
+
release:
|
|
31
|
+
image: node:20
|
|
32
|
+
when:
|
|
33
|
+
- event:
|
|
34
|
+
- push
|
|
35
|
+
branch:
|
|
36
|
+
- main
|
|
37
|
+
commands:
|
|
38
|
+
- . /woodpecker/deploy.vault.env
|
|
29
39
|
- npx semantic-release
|
|
30
40
|
|
|
31
41
|
slack-on-failure:
|
|
42
|
+
image: curlimages/curl
|
|
32
43
|
when:
|
|
33
44
|
- event: push
|
|
34
|
-
status: [failure
|
|
35
|
-
|
|
45
|
+
status: [failure]
|
|
46
|
+
commands:
|
|
47
|
+
- . /woodpecker/deploy.vault.env
|
|
48
|
+
- /bin/sh ./.woodpecker/buildSlackNotify.sh failure
|
|
49
|
+
|
|
50
|
+
slack-on-success:
|
|
36
51
|
image: curlimages/curl
|
|
52
|
+
when:
|
|
53
|
+
- event: push
|
|
54
|
+
status: [success]
|
|
37
55
|
commands:
|
|
38
|
-
-
|
|
39
|
-
- /bin/sh ./.woodpecker/buildSlackNotify.sh
|
|
40
|
-
|
|
56
|
+
- . /woodpecker/deploy.vault.env
|
|
57
|
+
- /bin/sh ./.woodpecker/buildSlackNotify.sh success
|
package/build.log
CHANGED
|
@@ -10,5 +10,5 @@ custom/package.json
|
|
|
10
10
|
custom/quillEditor.vue
|
|
11
11
|
custom/tsconfig.json
|
|
12
12
|
|
|
13
|
-
sent
|
|
14
|
-
total size is
|
|
13
|
+
sent 34,602 bytes received 115 bytes 69,434.00 bytes/sec
|
|
14
|
+
total size is 34,185 speedup is 0.98
|
package/custom/quillEditor.vue
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@keydown.tab.prevent.stop="approveCompletion('all')"
|
|
11
11
|
@keydown.ctrl.right.prevent.stop="approveCompletion('word')"
|
|
12
12
|
@keydown.ctrl.down.prevent.stop="startCompletion()"
|
|
13
|
+
@mousedown="textAreaClickHandler"
|
|
13
14
|
>
|
|
14
15
|
|
|
15
16
|
</div>
|
|
@@ -144,6 +145,7 @@ let lastText: string | null = null;
|
|
|
144
145
|
|
|
145
146
|
const imageProgress = ref(0);
|
|
146
147
|
|
|
148
|
+
const selectedSymbolsCount = ref(0);
|
|
147
149
|
|
|
148
150
|
async function saveToServer(file: File) {
|
|
149
151
|
const fd = new FormData();
|
|
@@ -314,6 +316,10 @@ onMounted(() => {
|
|
|
314
316
|
quill = new Quill(editor.value as HTMLElement, quillOptions);
|
|
315
317
|
initValue(quill);
|
|
316
318
|
lastText = quill.getText();
|
|
319
|
+
const linkButton = document.querySelector('.ql-link');
|
|
320
|
+
if (linkButton) {
|
|
321
|
+
linkButton.classList.add('ql-table-button-disabled');
|
|
322
|
+
}
|
|
317
323
|
|
|
318
324
|
quill.on(Quill.events.TEXT_CHANGE, async (delta: any, oldDelta: any, source: string) => {
|
|
319
325
|
dbg('🪽 TEXT_CHANGE fired ', delta, oldDelta, source);
|
|
@@ -332,6 +338,13 @@ onMounted(() => {
|
|
|
332
338
|
editorFocused.value = true;
|
|
333
339
|
startCompletion();
|
|
334
340
|
}
|
|
341
|
+
if (range.length > 0) {
|
|
342
|
+
selectedSymbolsCount.value = range.length;
|
|
343
|
+
linkButton?.classList.remove('ql-table-button-disabled');
|
|
344
|
+
} else {
|
|
345
|
+
selectedSymbolsCount.value = 0;
|
|
346
|
+
linkButton.classList.add('ql-table-button-disabled');
|
|
347
|
+
}
|
|
335
348
|
const text = quill.getText();
|
|
336
349
|
// don't allow to select after completion
|
|
337
350
|
// TODO
|
|
@@ -350,6 +363,13 @@ onMounted(() => {
|
|
|
350
363
|
}
|
|
351
364
|
});
|
|
352
365
|
|
|
366
|
+
function textAreaClickHandler() {
|
|
367
|
+
const linkButton = document.querySelector('.ql-link');
|
|
368
|
+
if (linkButton && selectedSymbolsCount.value === 0) {
|
|
369
|
+
linkButton.classList.add('ql-table-button-disabled');
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
353
373
|
function isQuillContentEmpty(html: string): boolean {
|
|
354
374
|
const div = document.createElement('div');
|
|
355
375
|
div.innerHTML = html;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@keydown.tab.prevent.stop="approveCompletion('all')"
|
|
11
11
|
@keydown.ctrl.right.prevent.stop="approveCompletion('word')"
|
|
12
12
|
@keydown.ctrl.down.prevent.stop="startCompletion()"
|
|
13
|
+
@mousedown="textAreaClickHandler"
|
|
13
14
|
>
|
|
14
15
|
|
|
15
16
|
</div>
|
|
@@ -144,6 +145,7 @@ let lastText: string | null = null;
|
|
|
144
145
|
|
|
145
146
|
const imageProgress = ref(0);
|
|
146
147
|
|
|
148
|
+
const selectedSymbolsCount = ref(0);
|
|
147
149
|
|
|
148
150
|
async function saveToServer(file: File) {
|
|
149
151
|
const fd = new FormData();
|
|
@@ -314,6 +316,10 @@ onMounted(() => {
|
|
|
314
316
|
quill = new Quill(editor.value as HTMLElement, quillOptions);
|
|
315
317
|
initValue(quill);
|
|
316
318
|
lastText = quill.getText();
|
|
319
|
+
const linkButton = document.querySelector('.ql-link');
|
|
320
|
+
if (linkButton) {
|
|
321
|
+
linkButton.classList.add('ql-table-button-disabled');
|
|
322
|
+
}
|
|
317
323
|
|
|
318
324
|
quill.on(Quill.events.TEXT_CHANGE, async (delta: any, oldDelta: any, source: string) => {
|
|
319
325
|
dbg('🪽 TEXT_CHANGE fired ', delta, oldDelta, source);
|
|
@@ -332,6 +338,13 @@ onMounted(() => {
|
|
|
332
338
|
editorFocused.value = true;
|
|
333
339
|
startCompletion();
|
|
334
340
|
}
|
|
341
|
+
if (range.length > 0) {
|
|
342
|
+
selectedSymbolsCount.value = range.length;
|
|
343
|
+
linkButton?.classList.remove('ql-table-button-disabled');
|
|
344
|
+
} else {
|
|
345
|
+
selectedSymbolsCount.value = 0;
|
|
346
|
+
linkButton.classList.add('ql-table-button-disabled');
|
|
347
|
+
}
|
|
335
348
|
const text = quill.getText();
|
|
336
349
|
// don't allow to select after completion
|
|
337
350
|
// TODO
|
|
@@ -350,6 +363,13 @@ onMounted(() => {
|
|
|
350
363
|
}
|
|
351
364
|
});
|
|
352
365
|
|
|
366
|
+
function textAreaClickHandler() {
|
|
367
|
+
const linkButton = document.querySelector('.ql-link');
|
|
368
|
+
if (linkButton && selectedSymbolsCount.value === 0) {
|
|
369
|
+
linkButton.classList.add('ql-table-button-disabled');
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
353
373
|
function isQuillContentEmpty(html: string): boolean {
|
|
354
374
|
const div = document.createElement('div');
|
|
355
375
|
div.innerHTML = html;
|