@peng_kai/kit 0.2.0-beta.9 → 0.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.
- package/admin/adminPlugin.ts +11 -1
- package/admin/components/filter/src/FilterReset.vue +12 -9
- package/admin/components/rich-text/index.ts +1 -1
- package/admin/components/rich-text/src/RichText.new.vue +164 -0
- package/admin/components/rich-text/src/RichText.vue +3 -6
- package/admin/components/rich-text/src/editorConfig.ts +126 -0
- package/admin/components/rich-text/src/imageUploader.ts +20 -18
- package/admin/components/scroll-nav/src/ScrollNav.vue +1 -1
- package/admin/components/settings/index.ts +1 -0
- package/admin/components/settings/src/Settings.vue +333 -0
- package/admin/components/upload/index.ts +1 -0
- package/admin/components/upload/src/PictureCardUpload.vue +1 -1
- package/admin/components/upload/src/helpers.ts +37 -0
- package/admin/defines/route/defineRoute.ts +2 -4
- package/admin/defines/route/getRoutes.ts +4 -4
- package/admin/defines/route/index.ts +1 -1
- package/admin/defines/route-guard/defineRouteGuard.ts +1 -4
- package/admin/defines/route-guard/getRouteGuards.ts +5 -7
- package/admin/defines/startup/defineStartup.ts +1 -3
- package/admin/defines/startup/runStartup.ts +4 -6
- package/admin/layout/large/Breadcrumb.vue +2 -3
- package/admin/layout/large/Content.vue +2 -2
- package/admin/layout/large/Menu.vue +2 -2
- package/admin/layout/large/PageTab.vue +2 -2
- package/admin/permission/routerGuard.ts +1 -1
- package/admin/permission/vuePlugin.ts +1 -0
- package/admin/stores/createUsePageStore.ts +1 -3
- package/admin/styles/classCover.scss +123 -3
- package/admin/styles/index.scss +18 -12
- package/antd/hooks/useAntdForm.ts +1 -1
- package/antd/hooks/useAntdModal.ts +4 -1
- package/antd/hooks/useAntdTable.ts +2 -1
- package/libs/echarts.ts +1 -1
- package/libs/vue-i18n.ts +21 -0
- package/package.json +36 -35
- package/request/interceptors/returnResultType.ts +3 -3
- package/request/interceptors/toLogin.ts +27 -10
- package/request/request.ts +0 -3
- package/request/type.d.ts +4 -4
- package/utils/LocaleManager.ts +125 -0
- package/vite/index.mjs +34 -8
package/admin/adminPlugin.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { inject } from 'vue';
|
|
1
2
|
import type { App } from 'vue';
|
|
2
3
|
import type { Router } from 'vue-router';
|
|
3
4
|
import type { TUseMenuStore } from './stores/createUseMenuStore';
|
|
@@ -5,7 +6,7 @@ import type { TUsePageStore } from './stores/createUsePageStore';
|
|
|
5
6
|
import type { TUsePageTabStore } from './stores/createUsePageTabStore';
|
|
6
7
|
import type { TRole, TUsePermissionStore } from './stores/createUsePermissionStore';
|
|
7
8
|
|
|
8
|
-
interface IOtions {
|
|
9
|
+
export interface IOtions {
|
|
9
10
|
meta: {
|
|
10
11
|
appId: string
|
|
11
12
|
appName: string
|
|
@@ -20,6 +21,7 @@ interface IOtions {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
const PROVIDE_KEY = 'TT_ADMIN';
|
|
23
25
|
let _meta: IOtions['meta'];
|
|
24
26
|
let _deps: IOtions['deps'];
|
|
25
27
|
|
|
@@ -27,6 +29,10 @@ export const adminPlugin = {
|
|
|
27
29
|
install(_app: App, options: IOtions) {
|
|
28
30
|
_meta = options.meta;
|
|
29
31
|
_deps = options.deps;
|
|
32
|
+
_app.provide(PROVIDE_KEY, {
|
|
33
|
+
meta: this.meta,
|
|
34
|
+
deps: this.deps,
|
|
35
|
+
});
|
|
30
36
|
},
|
|
31
37
|
meta: new Proxy({} as IOtions['meta'], {
|
|
32
38
|
get(_, p) {
|
|
@@ -45,3 +51,7 @@ export const adminPlugin = {
|
|
|
45
51
|
},
|
|
46
52
|
}),
|
|
47
53
|
};
|
|
54
|
+
|
|
55
|
+
export function injectTTAdmin() {
|
|
56
|
+
return inject<IOtions>(PROVIDE_KEY);
|
|
57
|
+
}
|
|
@@ -41,21 +41,24 @@ function reset() {
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
|
-
<div class="flex-none flex w-min ml-auto">
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
<div class="btns flex-none flex w-min ml-auto gap-2">
|
|
45
|
+
<slot :loading="loading" :filter="filter" :reset="reset">
|
|
46
|
+
<AButton class="filter-btn" type="primary" htmlType="submit" :loading="loading" @click="filter()">
|
|
47
|
+
查询
|
|
48
|
+
</AButton>
|
|
49
|
+
<AButton :disabled="loading" @click="reset()">
|
|
50
|
+
重置
|
|
51
|
+
</AButton>
|
|
52
|
+
</slot>
|
|
51
53
|
</div>
|
|
52
54
|
</template>
|
|
53
55
|
|
|
54
56
|
<style scoped lang="scss">
|
|
55
|
-
.filter-btn
|
|
57
|
+
.filter-btn,
|
|
58
|
+
:slotted(.filter-btn) {
|
|
56
59
|
position: relative;
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
.ant-btn-loading-icon{
|
|
59
62
|
position: absolute;
|
|
60
63
|
left: 50%;
|
|
61
64
|
transform: translateX(-50%);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as RichText } from './src/RichText.vue';
|
|
1
|
+
export { default as RichText } from './src/RichText.new.vue';
|
|
2
2
|
export { createImageUploaderForAws3 } from './src/imageUploader';
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useIntervalFn } from '@vueuse/core';
|
|
3
|
+
import CKEditor from '@ckeditor/ckeditor5-vue';
|
|
4
|
+
import { shallowRef } from 'vue';
|
|
5
|
+
import { useInjectDisabled } from 'ant-design-vue/es/config-provider/DisabledContext';
|
|
6
|
+
import { defaultConfig } from './editorConfig';
|
|
7
|
+
import 'https://cdn.ckeditor.com/ckeditor5/41.1.0/super-build/ckeditor.js';
|
|
8
|
+
import 'https://cdn.ckeditor.com/ckeditor5/41.1.0/super-build/translations/zh-cn.js';
|
|
9
|
+
|
|
10
|
+
function useClassicEditor() {
|
|
11
|
+
const ClassicEditor = shallowRef();
|
|
12
|
+
|
|
13
|
+
const { pause } = useIntervalFn(() => {
|
|
14
|
+
ClassicEditor.value = (window as any).CKEDITOR?.ClassicEditor;
|
|
15
|
+
ClassicEditor.value && pause();
|
|
16
|
+
}, 500);
|
|
17
|
+
|
|
18
|
+
return ClassicEditor;
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
const props = defineProps(['modelValue', 'disabled', 'plugins']);
|
|
24
|
+
const emits = defineEmits<{
|
|
25
|
+
(e: 'update:modelValue', value: string): void
|
|
26
|
+
}>();
|
|
27
|
+
|
|
28
|
+
const ClassicEditor = useClassicEditor();
|
|
29
|
+
const disabled = useInjectDisabled();
|
|
30
|
+
const editorConfig = { ...defaultConfig };
|
|
31
|
+
editorConfig.extraPlugins = props.plugins;
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<div class="editor-wrapper">
|
|
36
|
+
<CKEditor.component
|
|
37
|
+
v-if="ClassicEditor"
|
|
38
|
+
:modelValue="props.modelValue"
|
|
39
|
+
:editor="ClassicEditor"
|
|
40
|
+
:config="editorConfig"
|
|
41
|
+
:disabled="props.disabled ?? disabled"
|
|
42
|
+
@update:modelValue="v => emits('update:modelValue', v)"
|
|
43
|
+
/>
|
|
44
|
+
<div v-else class="flex justify-center">
|
|
45
|
+
<i class="i-svg-spinners:180-ring-with-bg block text-5 text-$loading-color" />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<style scoped lang="scss">
|
|
51
|
+
.editor-wrapper {
|
|
52
|
+
--loading-color: var(--antd-colorPrimary);
|
|
53
|
+
|
|
54
|
+
:deep(.ck-editor__main > .ck-content) {
|
|
55
|
+
height: 500px;
|
|
56
|
+
overflow: auto;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:root.dark .editor-wrapper {
|
|
61
|
+
/* Overrides the border radius setting in the theme. */
|
|
62
|
+
// --ck-border-radius: 4px;
|
|
63
|
+
|
|
64
|
+
/* Overrides the default font size in the theme. */
|
|
65
|
+
// --ck-font-size-base: 14px;
|
|
66
|
+
|
|
67
|
+
/* Helper variables to avoid duplication in the colors. */
|
|
68
|
+
--ck-custom-background: hsl(270deg 1% 29%);
|
|
69
|
+
--ck-custom-foreground: hsl(255deg 3% 18%);
|
|
70
|
+
--ck-custom-border: hsl(300deg 1% 22%);
|
|
71
|
+
--ck-custom-white: hsl(0deg 0% 100%);
|
|
72
|
+
|
|
73
|
+
/* -- Overrides generic colors. ------------------------------------------------------------- */
|
|
74
|
+
|
|
75
|
+
--ck-color-base-foreground: var(--ck-custom-background);
|
|
76
|
+
--ck-color-focus-border: hsl(208deg 90% 62%);
|
|
77
|
+
--ck-color-text: hsl(0deg 0% 98%);
|
|
78
|
+
--ck-color-shadow-drop: hsl(0deg 0% 0% / 20%);
|
|
79
|
+
--ck-color-shadow-inner: hsl(0deg 0% 0% / 10%);
|
|
80
|
+
|
|
81
|
+
/* -- Overrides the default .ck-button class colors. ---------------------------------------- */
|
|
82
|
+
|
|
83
|
+
--ck-color-button-default-background: var(--ck-custom-background);
|
|
84
|
+
--ck-color-button-default-hover-background: hsl(270deg 1% 22%);
|
|
85
|
+
--ck-color-button-default-active-background: hsl(270deg 2% 20%);
|
|
86
|
+
--ck-color-button-default-active-shadow: hsl(270deg 2% 23%);
|
|
87
|
+
--ck-color-button-default-disabled-background: var(--ck-custom-background);
|
|
88
|
+
--ck-color-button-on-background: var(--ck-custom-foreground);
|
|
89
|
+
--ck-color-button-on-hover-background: hsl(255deg 4% 16%);
|
|
90
|
+
--ck-color-button-on-active-background: hsl(255deg 4% 14%);
|
|
91
|
+
--ck-color-button-on-active-shadow: hsl(240deg 3% 19%);
|
|
92
|
+
--ck-color-button-on-disabled-background: var(--ck-custom-foreground);
|
|
93
|
+
--ck-color-button-action-background: hsl(168deg 76% 42%);
|
|
94
|
+
--ck-color-button-action-hover-background: hsl(168deg 76% 38%);
|
|
95
|
+
--ck-color-button-action-active-background: hsl(168deg 76% 36%);
|
|
96
|
+
--ck-color-button-action-active-shadow: hsl(168deg 75% 34%);
|
|
97
|
+
--ck-color-button-action-disabled-background: hsl(168deg 76% 42%);
|
|
98
|
+
--ck-color-button-action-text: var(--ck-custom-white);
|
|
99
|
+
--ck-color-button-save: hsl(120deg 100% 46%);
|
|
100
|
+
--ck-color-button-cancel: hsl(15deg 100% 56%);
|
|
101
|
+
|
|
102
|
+
/* -- Overrides the default .ck-dropdown class colors. -------------------------------------- */
|
|
103
|
+
|
|
104
|
+
--ck-color-dropdown-panel-background: var(--ck-custom-background);
|
|
105
|
+
--ck-color-dropdown-panel-border: var(--ck-custom-foreground);
|
|
106
|
+
|
|
107
|
+
/* -- Overrides the default .ck-splitbutton class colors. ----------------------------------- */
|
|
108
|
+
|
|
109
|
+
--ck-color-split-button-hover-background: var(--ck-color-button-default-hover-background);
|
|
110
|
+
--ck-color-split-button-hover-border: var(--ck-custom-foreground);
|
|
111
|
+
|
|
112
|
+
/* -- Overrides the default .ck-input class colors. ----------------------------------------- */
|
|
113
|
+
|
|
114
|
+
--ck-color-input-background: var(--ck-custom-background);
|
|
115
|
+
--ck-color-input-border: hsl(257deg 3% 43%);
|
|
116
|
+
--ck-color-input-text: hsl(0deg 0% 98%);
|
|
117
|
+
--ck-color-input-disabled-background: hsl(255deg 4% 21%);
|
|
118
|
+
--ck-color-input-disabled-border: hsl(250deg 3% 38%);
|
|
119
|
+
--ck-color-input-disabled-text: hsl(0deg 0% 78%);
|
|
120
|
+
|
|
121
|
+
/* -- Overrides the default .ck-labeled-field-view class colors. ---------------------------- */
|
|
122
|
+
|
|
123
|
+
--ck-color-labeled-field-label-background: var(--ck-custom-background);
|
|
124
|
+
|
|
125
|
+
/* -- Overrides the default .ck-list class colors. ------------------------------------------ */
|
|
126
|
+
|
|
127
|
+
--ck-color-list-background: var(--ck-custom-background);
|
|
128
|
+
--ck-color-list-button-hover-background: var(--ck-custom-foreground);
|
|
129
|
+
--ck-color-list-button-on-background: hsl(208deg 88% 52%);
|
|
130
|
+
--ck-color-list-button-on-text: var(--ck-custom-white);
|
|
131
|
+
|
|
132
|
+
/* -- Overrides the default .ck-balloon-panel class colors. --------------------------------- */
|
|
133
|
+
|
|
134
|
+
--ck-color-panel-background: var(--ck-custom-background);
|
|
135
|
+
--ck-color-panel-border: var(--ck-custom-border);
|
|
136
|
+
|
|
137
|
+
/* -- Overrides the default .ck-toolbar class colors. --------------------------------------- */
|
|
138
|
+
|
|
139
|
+
--ck-color-toolbar-background: var(--ck-custom-background);
|
|
140
|
+
--ck-color-toolbar-border: var(--ck-custom-border);
|
|
141
|
+
|
|
142
|
+
/* -- Overrides the default .ck-tooltip class colors. --------------------------------------- */
|
|
143
|
+
|
|
144
|
+
--ck-color-tooltip-background: hsl(252deg 7% 14%);
|
|
145
|
+
--ck-color-tooltip-text: hsl(0deg 0% 93%);
|
|
146
|
+
|
|
147
|
+
/* -- Overrides the default colors used by the ckeditor5-image package. --------------------- */
|
|
148
|
+
|
|
149
|
+
--ck-color-image-caption-background: hsl(0deg 0% 97%);
|
|
150
|
+
--ck-color-image-caption-text: hsl(0deg 0% 20%);
|
|
151
|
+
|
|
152
|
+
/* -- Overrides the default colors used by the ckeditor5-widget package. -------------------- */
|
|
153
|
+
|
|
154
|
+
--ck-color-widget-blurred-border: hsl(0deg 0% 87%);
|
|
155
|
+
--ck-color-widget-hover-border: hsl(43deg 100% 68%);
|
|
156
|
+
--ck-color-widget-editable-focus-background: var(--ck-custom-white);
|
|
157
|
+
|
|
158
|
+
/* -- Overrides the default colors used by the ckeditor5-link package. ---------------------- */
|
|
159
|
+
|
|
160
|
+
--ck-color-link-default: hsl(190deg 100% 75%);
|
|
161
|
+
--ck-color-base-background: #141414;
|
|
162
|
+
--ck-color-base-border: #424242;
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { defineModel, defineProps, withDefaults } from 'vue';
|
|
3
3
|
import CKEditor from '@ckeditor/ckeditor5-vue';
|
|
4
4
|
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
|
|
5
5
|
import { Alignment } from '@ckeditor/ckeditor5-alignment';
|
|
@@ -212,18 +212,15 @@ const props = withDefaults(defineProps<{
|
|
|
212
212
|
modelValue: '',
|
|
213
213
|
plugins: () => [],
|
|
214
214
|
});
|
|
215
|
-
const emits = defineEmits<{
|
|
216
|
-
(e: 'update:modelValue', value: string): void
|
|
217
|
-
}>();
|
|
218
215
|
|
|
219
|
-
const
|
|
216
|
+
const modelValue = defineModel({ default: '' });
|
|
220
217
|
const localeEditorConfig = { ...editorConfig };
|
|
221
218
|
localeEditorConfig.extraPlugins = [...props.plugins];
|
|
222
219
|
</script>
|
|
223
220
|
|
|
224
221
|
<template>
|
|
225
222
|
<div class="editor-wrapper">
|
|
226
|
-
<CKEditor.component v-model="
|
|
223
|
+
<CKEditor.component v-model="modelValue" :editor="ClassicEditor" :config="localeEditorConfig" />
|
|
227
224
|
</div>
|
|
228
225
|
</template>
|
|
229
226
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export const defaultConfig: Record<string, any> = {
|
|
2
|
+
language: {
|
|
3
|
+
ui: 'zh-cn',
|
|
4
|
+
},
|
|
5
|
+
removePlugins: ['ImportWord', 'ExportWord', 'RevisionHistory', 'RealTimeCollaborativeEditing', 'RealTimeCollaborativeComments', 'RealTimeCollaborativeRevisionHistory', 'RealTimeCollaborativeTrackChanges', 'PresenceList', 'WProofreader', 'DocumentOutline', 'Comments', 'TrackChanges', 'TrackChangesData', 'TableOfContents', 'SlashCommand', 'PasteFromOfficeEnhanced', 'ContentTemplates', 'FormatPainter', 'Mentions', 'PageBreak', 'Pagination', 'AIAssistant', 'CaseChange', 'Template'],
|
|
6
|
+
toolbar: {
|
|
7
|
+
items: [
|
|
8
|
+
'undo',
|
|
9
|
+
'redo',
|
|
10
|
+
'|',
|
|
11
|
+
'showBlocks',
|
|
12
|
+
'selectAll',
|
|
13
|
+
'|',
|
|
14
|
+
'heading',
|
|
15
|
+
'|',
|
|
16
|
+
'fontSize',
|
|
17
|
+
'fontFamily',
|
|
18
|
+
'fontColor',
|
|
19
|
+
'fontBackgroundColor',
|
|
20
|
+
'|',
|
|
21
|
+
'bold',
|
|
22
|
+
'italic',
|
|
23
|
+
'underline',
|
|
24
|
+
{
|
|
25
|
+
label: 'Formatting',
|
|
26
|
+
icon: 'text',
|
|
27
|
+
items: ['strikethrough', 'subscript', 'superscript', 'code', 'horizontalLine', '|', 'removeFormat'],
|
|
28
|
+
},
|
|
29
|
+
'|',
|
|
30
|
+
'link',
|
|
31
|
+
'uploadImage',
|
|
32
|
+
'insertTable',
|
|
33
|
+
{
|
|
34
|
+
label: 'Insert',
|
|
35
|
+
icon: 'plus',
|
|
36
|
+
items: ['highlight', 'blockQuote', 'mediaEmbed', 'codeBlock', 'htmlEmbed'],
|
|
37
|
+
},
|
|
38
|
+
'|',
|
|
39
|
+
'alignment',
|
|
40
|
+
'|',
|
|
41
|
+
'bulletedList',
|
|
42
|
+
'numberedList',
|
|
43
|
+
'todoList',
|
|
44
|
+
'outdent',
|
|
45
|
+
'indent',
|
|
46
|
+
'|',
|
|
47
|
+
'sourceEditing',
|
|
48
|
+
],
|
|
49
|
+
shouldNotGroupWhenFull: true,
|
|
50
|
+
},
|
|
51
|
+
htmlSupport: {
|
|
52
|
+
allow: [
|
|
53
|
+
{
|
|
54
|
+
name: /^.*$/,
|
|
55
|
+
styles: true,
|
|
56
|
+
attributes: true,
|
|
57
|
+
classes: true,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
fontSize: {
|
|
62
|
+
options: [10, 12, 14, 'default', 18, 20, 22],
|
|
63
|
+
supportAllValues: true,
|
|
64
|
+
},
|
|
65
|
+
image: {
|
|
66
|
+
styles: [
|
|
67
|
+
'alignCenter',
|
|
68
|
+
'alignLeft',
|
|
69
|
+
'alignRight',
|
|
70
|
+
],
|
|
71
|
+
resizeOptions: [
|
|
72
|
+
{ name: 'resizeImage:original', label: 'Original', value: null },
|
|
73
|
+
{ name: 'resizeImage:25', label: '25%', value: '25' },
|
|
74
|
+
{ name: 'resizeImage:50', label: '50%', value: '50' },
|
|
75
|
+
{ name: 'resizeImage:75', label: '75%', value: '75' },
|
|
76
|
+
],
|
|
77
|
+
toolbar: [
|
|
78
|
+
'imageTextAlternative',
|
|
79
|
+
'toggleImageCaption',
|
|
80
|
+
'|',
|
|
81
|
+
'imageStyle:inline',
|
|
82
|
+
'imageStyle:wrapText',
|
|
83
|
+
'imageStyle:breakText',
|
|
84
|
+
'imageStyle:side',
|
|
85
|
+
'|',
|
|
86
|
+
'resizeImage',
|
|
87
|
+
],
|
|
88
|
+
resizeUnit: 'px',
|
|
89
|
+
},
|
|
90
|
+
list: {
|
|
91
|
+
properties: {
|
|
92
|
+
styles: true,
|
|
93
|
+
startIndex: true,
|
|
94
|
+
reversed: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
link: {
|
|
98
|
+
addTargetToExternalLinks: true,
|
|
99
|
+
defaultProtocol: 'https://',
|
|
100
|
+
decorators: {
|
|
101
|
+
toggleDownloadable: {
|
|
102
|
+
mode: 'manual',
|
|
103
|
+
label: 'Downloadable',
|
|
104
|
+
attributes: {
|
|
105
|
+
download: 'file',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
table: {
|
|
111
|
+
contentToolbar: [
|
|
112
|
+
'tableColumn',
|
|
113
|
+
'tableRow',
|
|
114
|
+
'mergeTableCells',
|
|
115
|
+
'tableProperties',
|
|
116
|
+
'tableCellProperties',
|
|
117
|
+
'toggleTableCaption',
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
htmlEmbed: {
|
|
121
|
+
showPreviews: true,
|
|
122
|
+
},
|
|
123
|
+
wordCount: {
|
|
124
|
+
displayWords: true,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
@@ -5,30 +5,32 @@ export { createImageUploaderForAws3 };
|
|
|
5
5
|
|
|
6
6
|
function createImageUploaderForAws3(awsS3: AwsS3, rootDir?: string): PluginConstructor {
|
|
7
7
|
return function (editor) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
setTimeout(() => {
|
|
9
|
+
editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {
|
|
10
|
+
return {
|
|
11
|
+
async upload() {
|
|
12
|
+
const file = await loader.file;
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
if (file) {
|
|
15
|
+
const { uploader, fileURL } = await awsS3.upload(file, rootDir);
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
uploader.on('httpUploadProgress', (progress) => {
|
|
18
|
+
loader.uploadTotal = progress.total ?? null;
|
|
19
|
+
loader.uploaded = progress.loaded ?? 0;
|
|
20
|
+
});
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
await uploader.done();
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
return { default: fileURL };
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
return {};
|
|
28
|
+
},
|
|
29
|
+
abort() {
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
},
|
|
32
|
+
};
|
|
31
33
|
};
|
|
32
|
-
};
|
|
34
|
+
});
|
|
33
35
|
};
|
|
34
36
|
}
|
|
@@ -10,7 +10,7 @@ const $content = document.querySelector(props.selector) as HTMLElement;
|
|
|
10
10
|
const $contentParent = $content.parentElement;
|
|
11
11
|
const { height: contentParentH } = useElementSize($contentParent);
|
|
12
12
|
const { height: contentH } = useElementSize($content);
|
|
13
|
-
const visible = computed(() => contentParentH.value *
|
|
13
|
+
const visible = computed(() => contentParentH.value * 1.5 < contentH.value);
|
|
14
14
|
|
|
15
15
|
function scrollTo(top: number) {
|
|
16
16
|
$contentParent?.scrollTo({ top });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Settings } from './src/Settings.vue';
|