@esershnr/artalk-sidebar 1.0.3

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 (75) hide show
  1. package/README.md +16 -0
  2. package/auto-imports.d.ts +76 -0
  3. package/components.d.ts +31 -0
  4. package/env.d.ts +2 -0
  5. package/index.html +15 -0
  6. package/package.json +32 -0
  7. package/public/favicon.png +0 -0
  8. package/public/robots.txt +2 -0
  9. package/src/App.vue +89 -0
  10. package/src/artalk.ts +82 -0
  11. package/src/assets/favicon.png +0 -0
  12. package/src/assets/icon-darkmode-off.svg +1 -0
  13. package/src/assets/icon-darkmode-on.svg +1 -0
  14. package/src/assets/icon-eye-off.svg +1 -0
  15. package/src/assets/icon-eye-on.svg +1 -0
  16. package/src/assets/nav-icon-comments.svg +1 -0
  17. package/src/assets/nav-icon-pages.svg +1 -0
  18. package/src/assets/nav-icon-search.svg +1 -0
  19. package/src/assets/nav-icon-settings.svg +1 -0
  20. package/src/assets/nav-icon-sites.svg +1 -0
  21. package/src/assets/nav-icon-transfer.svg +1 -0
  22. package/src/assets/nav-icon-users.svg +1 -0
  23. package/src/components/AppHeader.vue +235 -0
  24. package/src/components/AppNavigation.vue +11 -0
  25. package/src/components/AppNavigationDesktop.vue +176 -0
  26. package/src/components/AppNavigationMenu.ts +152 -0
  27. package/src/components/AppNavigationMobile.vue +187 -0
  28. package/src/components/AppNavigationSearch.vue +137 -0
  29. package/src/components/FileUploader.vue +149 -0
  30. package/src/components/ItemTextEditor.vue +130 -0
  31. package/src/components/LoadingLayer.vue +37 -0
  32. package/src/components/LogTerminal.vue +89 -0
  33. package/src/components/PageEditor.vue +171 -0
  34. package/src/components/Pagination.vue +253 -0
  35. package/src/components/PreferenceArr.vue +105 -0
  36. package/src/components/PreferenceGrp.vue +153 -0
  37. package/src/components/PreferenceItem.vue +159 -0
  38. package/src/components/SiteCreate.vue +96 -0
  39. package/src/components/SiteEditor.vue +138 -0
  40. package/src/components/SiteSwitcher.vue +184 -0
  41. package/src/components/UserEditor.vue +229 -0
  42. package/src/global.ts +62 -0
  43. package/src/hooks/MobileWidth.ts +27 -0
  44. package/src/i18n/fr.ts +103 -0
  45. package/src/i18n/ja.ts +100 -0
  46. package/src/i18n/ko.ts +99 -0
  47. package/src/i18n/ru.ts +102 -0
  48. package/src/i18n/tr.ts +102 -0
  49. package/src/i18n/zh-CN.ts +97 -0
  50. package/src/i18n/zh-TW.ts +97 -0
  51. package/src/i18n-en.ts +99 -0
  52. package/src/i18n.ts +37 -0
  53. package/src/lib/promise-polyfill.ts +9 -0
  54. package/src/lib/settings-option.ts +186 -0
  55. package/src/lib/settings-sensitive.ts +44 -0
  56. package/src/lib/settings.ts +94 -0
  57. package/src/main.ts +65 -0
  58. package/src/pages/comments.vue +110 -0
  59. package/src/pages/index.vue +33 -0
  60. package/src/pages/login.vue +245 -0
  61. package/src/pages/pages.vue +309 -0
  62. package/src/pages/settings.vue +181 -0
  63. package/src/pages/sites.vue +353 -0
  64. package/src/pages/transfer.vue +204 -0
  65. package/src/pages/users.vue +271 -0
  66. package/src/stores/nav.ts +114 -0
  67. package/src/stores/user.ts +48 -0
  68. package/src/style/_extends.scss +100 -0
  69. package/src/style/_variables.scss +18 -0
  70. package/src/style.scss +245 -0
  71. package/src/vue-i18n.d.ts +7 -0
  72. package/tsconfig.json +40 -0
  73. package/tsconfig.node.json +11 -0
  74. package/typed-router.d.ts +30 -0
  75. package/vite.config.ts +71 -0
@@ -0,0 +1,100 @@
1
+ .atk-slim-scrollbar {
2
+ &::-webkit-scrollbar {
3
+ width: 4px;
4
+ height: 4px;
5
+ background: transparent;
6
+ }
7
+
8
+ &::-webkit-scrollbar-thumb,
9
+ &::-webkit-scrollbar-thumb:window-inactive {
10
+ background: rgba(86, 86, 86, 0.3);
11
+ }
12
+
13
+ &::-webkit-scrollbar-thumb:vertical:hover {
14
+ background: rgba(65, 74, 82, 0.77);
15
+ }
16
+
17
+ &::-webkit-scrollbar-thumb:vertical:active {
18
+ background: rgba(41, 47, 53, 0.77);
19
+ }
20
+ }
21
+
22
+ .atk-list-text-actions {
23
+ display: flex;
24
+ flex-direction: column;
25
+ flex: auto;
26
+ padding: 0 35px;
27
+ padding-top: 10px;
28
+ padding-bottom: 0;
29
+ flex-wrap: wrap;
30
+ align-content: flex-start;
31
+
32
+ .atk-item {
33
+ position: relative;
34
+ font-size: 17px;
35
+ // max-width: 5em;
36
+ display: inline-flex;
37
+ margin-right: 15px;
38
+ margin-bottom: 6px;
39
+ cursor: pointer;
40
+ user-select: none;
41
+
42
+ &.atk-green:after {
43
+ position: absolute;
44
+ content: ' ';
45
+ height: 5px;
46
+ width: 100%;
47
+ left: 0;
48
+ bottom: 5px;
49
+ background: rgba(50, 199, 134, 0.39);
50
+ }
51
+
52
+ &.atk-yellow:after {
53
+ position: absolute;
54
+ content: ' ';
55
+ height: 5px;
56
+ width: 100%;
57
+ left: 0;
58
+ bottom: 5px;
59
+ background: rgba(255, 203, 0, 39%);
60
+ }
61
+ }
62
+ }
63
+
64
+ .atk-list-btn-actions {
65
+ display: flex;
66
+ flex-direction: row;
67
+ align-items: center;
68
+ padding: 0 20px;
69
+
70
+ .atk-item {
71
+ cursor: pointer;
72
+ user-select: none;
73
+ display: flex;
74
+ width: 35px;
75
+ height: 35px;
76
+ border-radius: 2px;
77
+ align-items: center;
78
+ justify-content: center;
79
+
80
+ &:hover {
81
+ background: var(--at-color-bg-grey);
82
+ }
83
+
84
+ &:not(:last-child) {
85
+ margin-right: 15px;
86
+ }
87
+
88
+ &.atk-item-close {
89
+ margin-left: 10px;
90
+ }
91
+ }
92
+
93
+ .atk-icon::after {
94
+ background-color: var(--at-color-meta);
95
+ }
96
+
97
+ .atk-icon-yes::after {
98
+ background-color: var(--at-color-main);
99
+ }
100
+ }
@@ -0,0 +1,18 @@
1
+ $font-family:
2
+ ui-sans-serif,
3
+ -apple-system,
4
+ BlinkMacSystemFont,
5
+ 'Segoe UI Variable Display',
6
+ 'Segoe UI',
7
+ Helvetica,
8
+ 'PingFang SC',
9
+ 'Microsoft YaHei',
10
+ Helvetica,
11
+ 'Apple Color Emoji',
12
+ Arial,
13
+ sans-serif,
14
+ 'Segoe UI Emoji',
15
+ 'Segoe UI Symbol';
16
+ $font-size: 14px;
17
+ $line-height: 1.6em;
18
+ $block-radius: 6px;
package/src/style.scss ADDED
@@ -0,0 +1,245 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ body {
6
+ margin: 0;
7
+ }
8
+
9
+ .artalk,
10
+ .atk-layer-wrap {
11
+ font-family: $font-family;
12
+ }
13
+
14
+ .artalk {
15
+ --at-sidebar-header-bg: #f6f8fa;
16
+ }
17
+
18
+ .artalk.atk-dark-mode {
19
+ --at-sidebar-header-bg: #1e1e1e;
20
+
21
+ .atk-comment-wrap.atk-openable:hover {
22
+ background: #1e1e1e;
23
+ }
24
+ }
25
+
26
+ .atk-sidebar {
27
+ .atk-list {
28
+ .atk-main-editor {
29
+ margin-top: -4px;
30
+ margin-bottom: -2px;
31
+ }
32
+ }
33
+
34
+ .atk-sidebar-no-content {
35
+ position: absolute;
36
+ left: 0;
37
+ right: 0;
38
+ top: 0;
39
+ font-size: 35px;
40
+ color: var(--at-color-meta);
41
+ pointer-events: none;
42
+ height: 100%;
43
+ display: flex;
44
+ justify-content: center;
45
+ align-items: center;
46
+ }
47
+
48
+ .atk-form {
49
+ $form-height: 35px;
50
+
51
+ padding: 20px 30px;
52
+
53
+ .atk-label {
54
+ font-size: 16px;
55
+ margin-bottom: 12px;
56
+ color: var(--at-color-font);
57
+
58
+ &.required::after {
59
+ content: '*';
60
+ color: var(--at-color-red);
61
+ margin-left: 5px;
62
+ vertical-align: top;
63
+ }
64
+ }
65
+
66
+ .atk-desc {
67
+ font-size: 14px;
68
+ margin-top: 10px;
69
+ margin-left: 15px;
70
+ margin-bottom: 25px;
71
+ display: block;
72
+ color: var(--at-color-meta);
73
+
74
+ a {
75
+ opacity: 0.8;
76
+ }
77
+ }
78
+
79
+ input,
80
+ textarea {
81
+ display: block;
82
+ line-height: $form-height;
83
+ padding: 0 10px;
84
+ margin: 0;
85
+ border: none;
86
+ border-bottom: 1px solid var(--at-color-border);
87
+ outline: none;
88
+ width: 100%;
89
+ margin-bottom: 25px;
90
+ background: var(--at-color-bg);
91
+
92
+ &:focus {
93
+ border-bottom-color: var(--at-color-bg-light);
94
+ }
95
+
96
+ &[type='file'] {
97
+ background: transparent;
98
+ border: 1px solid var(--at-color-border);
99
+ cursor: pointer;
100
+ position: relative;
101
+ padding: 6px 15px;
102
+ line-height: 0;
103
+ margin-bottom: 17px;
104
+ border-radius: 4px;
105
+
106
+ &:hover {
107
+ background: var(--at-color-bg-light);
108
+ border-color: var(--at-color-bg-light);
109
+ }
110
+ }
111
+
112
+ &[type='file']::-webkit-file-upload-button {
113
+ background: transparent;
114
+ color: var(--at-color-font);
115
+ border: 0;
116
+ border-right: 1px solid var(--at-color-border);
117
+ border-left: 0;
118
+ border-top: 0;
119
+ border-bottom: 0;
120
+ padding: 0 20px 0 10px;
121
+ line-height: 25px;
122
+ margin-right: 15px;
123
+ cursor: pointer;
124
+ transition: 0.2s ease;
125
+ -webkit-appearance: none;
126
+ border-radius: 0;
127
+ }
128
+ }
129
+
130
+ textarea {
131
+ font-size: 13px;
132
+ line-height: 20px;
133
+ min-height: 80px;
134
+ resize: vertical;
135
+ }
136
+
137
+ select {
138
+ display: block;
139
+ outline: none;
140
+ height: $form-height;
141
+ padding: 5px 10px;
142
+ width: 100%;
143
+ border: none;
144
+ border-bottom: 2px solid var(--at-color-border);
145
+ margin-bottom: 25px;
146
+ -webkit-appearance: none;
147
+ border-radius: 0;
148
+ background: var(--at-color-bg);
149
+ }
150
+
151
+ button {
152
+ text-align: center;
153
+ color: var(--at-color-light);
154
+ background: transparent;
155
+ border: 1px solid var(--at-color-bg-light);
156
+ line-height: $form-height;
157
+ cursor: pointer;
158
+ outline: none;
159
+ padding: 0 20px;
160
+ border-radius: 4px;
161
+ margin: 0 5px;
162
+ width: 100%;
163
+ user-select: none;
164
+
165
+ &:hover {
166
+ background: var(--at-color-bg-light);
167
+ }
168
+ }
169
+
170
+ input,
171
+ select,
172
+ button {
173
+ font-size: 15px;
174
+ }
175
+
176
+ .atk-file-upload-group {
177
+ height: 100px;
178
+ overflow: hidden;
179
+ }
180
+
181
+ .atk-uploading-wrap {
182
+ .atk-progress {
183
+ width: 100%;
184
+ height: 12px;
185
+ display: block;
186
+ overflow: hidden;
187
+ background: var(--at-color-bg-grey);
188
+ border-radius: 100px;
189
+ margin-bottom: 7px;
190
+ margin-top: 20px;
191
+
192
+ .atk-bar {
193
+ transition: 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
194
+ background: var(--at-color-main);
195
+ height: 100%;
196
+ width: 0%;
197
+ opacity: 0.7;
198
+ }
199
+ }
200
+
201
+ .atk-status {
202
+ color: var(--at-color-meta);
203
+ font-size: 14px;
204
+
205
+ .atk-curt {
206
+ color: var(--at-color-main);
207
+ }
208
+
209
+ .atk-abort {
210
+ cursor: pointer;
211
+ float: right;
212
+
213
+ &:hover {
214
+ color: var(--at-color-main);
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ .atk-log-wrap {
222
+ .atk-log-back-btn {
223
+ display: inline-block;
224
+ padding: 5px 33px;
225
+ cursor: pointer;
226
+ user-select: none;
227
+ border-right: 1px solid var(--at-color-border);
228
+ border-left: 1px solid transparent;
229
+ &:hover {
230
+ background: var(--at-color-bg-grey);
231
+ }
232
+ }
233
+
234
+ .atk-log {
235
+ }
236
+
237
+ .atk-iframe {
238
+ width: 100%;
239
+ height: calc(100vh - 150px);
240
+ border: 0;
241
+ background: var(--at-color-bg-grey);
242
+ border: 3px solid var(--at-color-border);
243
+ }
244
+ }
245
+ }
@@ -0,0 +1,7 @@
1
+ import { DefineLocaleMessage } from 'vue-i18n'
2
+ import { MessageSchema } from './i18n'
3
+
4
+ declare module 'vue-i18n' {
5
+ // define the locale messages schema
6
+ export interface DefineLocaleMessage extends MessageSchema {}
7
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable", "ESNext.Promise"],
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "jsx": "preserve",
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": false,
20
+ "noUnusedParameters": false,
21
+ "noFallthroughCasesInSwitch": true,
22
+
23
+ /* Alias */
24
+ "baseUrl": ".", // Must be set, otherwise the alias won't work
25
+ "paths": {
26
+ "@/*": ["./src/*"]
27
+ }
28
+ },
29
+ "include": [
30
+ "typed-router.d.ts",
31
+ "components.d.ts",
32
+ "auto-imports.d.ts",
33
+ "env.d.ts",
34
+ "src/**/*.ts",
35
+ "src/**/*.tsx",
36
+ "src/**/*.vue"
37
+ ],
38
+ "exclude": ["src/**/__tests__/*"],
39
+ "references": [{ "path": "./tsconfig.node.json" }]
40
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true
9
+ },
10
+ "include": ["vite.config.ts"]
11
+ }
@@ -0,0 +1,30 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️
5
+ // It's recommended to commit this file.
6
+ // Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry.
7
+
8
+ declare module 'vue-router/auto-routes' {
9
+ import type {
10
+ RouteRecordInfo,
11
+ ParamValue,
12
+ ParamValueOneOrMore,
13
+ ParamValueZeroOrMore,
14
+ ParamValueZeroOrOne,
15
+ } from 'vue-router'
16
+
17
+ /**
18
+ * Route name map generated by unplugin-vue-router
19
+ */
20
+ export interface RouteNamedMap {
21
+ '/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
22
+ '/comments': RouteRecordInfo<'/comments', '/comments', Record<never, never>, Record<never, never>>,
23
+ '/login': RouteRecordInfo<'/login', '/login', Record<never, never>, Record<never, never>>,
24
+ '/pages': RouteRecordInfo<'/pages', '/pages', Record<never, never>, Record<never, never>>,
25
+ '/settings': RouteRecordInfo<'/settings', '/settings', Record<never, never>, Record<never, never>>,
26
+ '/sites': RouteRecordInfo<'/sites', '/sites', Record<never, never>, Record<never, never>>,
27
+ '/transfer': RouteRecordInfo<'/transfer', '/transfer', Record<never, never>, Record<never, never>>,
28
+ '/users': RouteRecordInfo<'/users', '/users', Record<never, never>, Record<never, never>>,
29
+ }
30
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,71 @@
1
+ import { defineConfig } from 'vite'
2
+ import { resolve } from 'path'
3
+ import vue from '@vitejs/plugin-vue'
4
+ import AutoImport from 'unplugin-auto-import/vite'
5
+ import VueRouter from 'unplugin-vue-router/vite'
6
+ import { VueRouterAutoImports } from 'unplugin-vue-router'
7
+ import Components from 'unplugin-vue-components/vite'
8
+ import { HeadlessUiResolver } from 'unplugin-vue-components/resolvers'
9
+ import { fileURLToPath, URL } from 'node:url'
10
+ import checker from 'vite-plugin-checker'
11
+
12
+ // https://vitejs.dev/config/
13
+ export default defineConfig({
14
+ base: './',
15
+ build: {
16
+ target: 'es2015',
17
+ outDir: resolve(__dirname, 'dist'),
18
+ minify: 'terser',
19
+ },
20
+ plugins: [
21
+ VueRouter({ importMode: 'sync' }),
22
+ vue(),
23
+ Components({ resolvers: [HeadlessUiResolver()] }),
24
+ AutoImport({
25
+ imports: ['vue', VueRouterAutoImports, 'vue-i18n'],
26
+ }),
27
+ {
28
+ ...checker({
29
+ // vueTsc: true, // FIXME: see https://github.com/fi3ework/vite-plugin-checker/issues/306
30
+ eslint: {
31
+ useFlatConfig: true,
32
+ lintCommand: 'eslint .',
33
+ },
34
+ }),
35
+ apply: 'serve',
36
+ },
37
+ (() => ({
38
+ name: 'prod-vue-resolver',
39
+ resolveId(id) {
40
+ // @issue https://github.com/vitejs/vite/issues/6607
41
+ // dev mode vite resolves vue in other way
42
+ // only in prod mode, `id === vue` is true
43
+ if (id === 'vue') {
44
+ return resolve(__dirname, './node_modules/vue/dist/vue.runtime.esm-bundler.js')
45
+ }
46
+ },
47
+ }))(),
48
+ ],
49
+ resolve: {
50
+ alias: {
51
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
52
+ },
53
+ },
54
+ server: {
55
+ port: 23367,
56
+ proxy: {
57
+ '/api': 'http://127.0.0.1:23366',
58
+ '/dist': 'http://127.0.0.1:23366',
59
+ },
60
+ },
61
+ css: {
62
+ preprocessorOptions: {
63
+ scss: {
64
+ api: 'modern-compiler',
65
+ loadPaths: [resolve(__dirname, 'src/style')],
66
+ silenceDeprecations: ['import'], // https://sass-lang.com/documentation/breaking-changes/import/
67
+ additionalData: `@import "variables";@import "extends";`,
68
+ },
69
+ },
70
+ },
71
+ })