@hywax/cms 0.0.4 → 0.0.6
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/.nuxt/cms/autocomplete-select.ts +5 -0
- package/.nuxt/cms/button-copy.ts +5 -0
- package/.nuxt/cms/button-delete.ts +5 -0
- package/.nuxt/cms/editor/callout.ts +21 -0
- package/.nuxt/cms/editor/index.ts +2 -0
- package/.nuxt/cms/editor/uplora-image.ts +5 -0
- package/.nuxt/cms/form-panel-aside-section.ts +9 -0
- package/.nuxt/cms/form-panel-section.ts +8 -0
- package/.nuxt/cms/form-panel.ts +15 -0
- package/.nuxt/cms/index.ts +16 -0
- package/.nuxt/cms/input-seo.ts +5 -0
- package/.nuxt/cms/input-slug.ts +5 -0
- package/.nuxt/cms/modal-confirm.ts +5 -0
- package/.nuxt/cms/table-cell-preview.ts +9 -0
- package/.nuxt/cms/table-cell-seo.ts +5 -0
- package/.nuxt/cms/table-cell-user.ts +5 -0
- package/.nuxt/cms/table-panel-column-sorting.ts +5 -0
- package/.nuxt/cms/table-panel-column-visibility.ts +5 -0
- package/.nuxt/cms/table-panel-filters.ts +5 -0
- package/.nuxt/cms/table-panel.ts +8 -0
- package/cli/templates.mjs +4 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +213 -11
- package/dist/runtime/components/AutocompleteSelect.vue +170 -0
- package/dist/runtime/components/AutocompleteSelect.vue.d.ts +42 -0
- package/dist/runtime/components/ButtonCopy.vue +40 -0
- package/dist/runtime/components/ButtonCopy.vue.d.ts +23 -0
- package/dist/runtime/components/ButtonDelete.vue +59 -0
- package/dist/runtime/components/ButtonDelete.vue.d.ts +34 -0
- package/dist/runtime/components/FormPanel.vue +70 -0
- package/dist/runtime/components/FormPanel.vue.d.ts +41 -0
- package/dist/runtime/components/FormPanelAsideSection.vue +41 -0
- package/dist/runtime/components/FormPanelAsideSection.vue.d.ts +23 -0
- package/dist/runtime/components/FormPanelSection.vue +31 -0
- package/dist/runtime/components/FormPanelSection.vue.d.ts +20 -0
- package/dist/runtime/components/InputSeo.vue +73 -0
- package/dist/runtime/components/InputSeo.vue.d.ts +19 -0
- package/dist/runtime/components/InputSlug.vue +74 -0
- package/dist/runtime/components/InputSlug.vue.d.ts +31 -0
- package/dist/runtime/components/ModalConfirm.vue +96 -0
- package/dist/runtime/components/ModalConfirm.vue.d.ts +32 -0
- package/dist/runtime/components/TableCellPreview.vue +40 -0
- package/dist/runtime/components/TableCellPreview.vue.d.ts +18 -0
- package/dist/runtime/components/TableCellSeo.vue +34 -0
- package/dist/runtime/components/TableCellSeo.vue.d.ts +13 -0
- package/dist/runtime/components/TableCellUser.vue +33 -0
- package/dist/runtime/components/TableCellUser.vue.d.ts +15 -0
- package/dist/runtime/components/TablePanel.vue +153 -0
- package/dist/runtime/components/TablePanel.vue.d.ts +50 -0
- package/dist/runtime/components/TablePanelColumnSorting.vue +72 -0
- package/dist/runtime/components/TablePanelColumnSorting.vue.d.ts +20 -0
- package/dist/runtime/components/TablePanelColumnVisibility.vue +49 -0
- package/dist/runtime/components/TablePanelColumnVisibility.vue.d.ts +20 -0
- package/dist/runtime/components/TablePanelFilters.vue +79 -0
- package/dist/runtime/components/TablePanelFilters.vue.d.ts +34 -0
- package/dist/runtime/components/prose/UploraImage.vue +8 -3
- package/dist/runtime/composables/useAdmin.d.ts +6 -0
- package/dist/runtime/composables/useAdmin.js +14 -0
- package/dist/runtime/composables/useDeleteConfirm.d.ts +15 -0
- package/dist/runtime/composables/useDeleteConfirm.js +27 -0
- package/dist/runtime/composables/useSeoStats.d.ts +2 -2
- package/dist/runtime/composables/useSeoStats.js +1 -1
- package/dist/runtime/composables/useTable.d.ts +19 -0
- package/dist/runtime/composables/useTable.js +90 -0
- package/dist/runtime/editor/extensions/callout/CalloutView.vue +79 -0
- package/dist/runtime/editor/extensions/callout/CalloutView.vue.d.ts +7 -0
- package/dist/runtime/editor/extensions/callout/extension.d.ts +13 -0
- package/dist/runtime/editor/extensions/callout/extension.js +48 -0
- package/dist/runtime/editor/extensions/callout/index.d.ts +2 -0
- package/dist/runtime/editor/extensions/callout/index.js +2 -0
- package/dist/runtime/editor/extensions/callout/types.d.ts +3 -0
- package/dist/runtime/editor/extensions/callout/types.js +0 -0
- package/dist/runtime/editor/extensions/index.d.ts +26 -0
- package/dist/runtime/editor/extensions/index.js +85 -0
- package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue +26 -0
- package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue.d.ts +7 -0
- package/dist/runtime/editor/extensions/uplora-image/extension.d.ts +13 -0
- package/dist/runtime/editor/extensions/uplora-image/extension.js +60 -0
- package/dist/runtime/editor/extensions/uplora-image/index.d.ts +2 -0
- package/dist/runtime/editor/extensions/uplora-image/index.js +2 -0
- package/dist/runtime/editor/extensions/uplora-image/types.d.ts +5 -0
- package/dist/runtime/editor/extensions/uplora-image/types.js +0 -0
- package/dist/runtime/editor/markdown/index.d.ts +3 -0
- package/dist/runtime/editor/markdown/index.js +47 -0
- package/dist/runtime/editor/markdown/nodes/callout.d.ts +2 -0
- package/dist/runtime/editor/markdown/nodes/callout.js +21 -0
- package/dist/runtime/editor/markdown/nodes/uploraImage.d.ts +2 -0
- package/dist/runtime/editor/markdown/nodes/uploraImage.js +31 -0
- package/dist/runtime/server/api/uplora/[id].delete.d.ts +2 -0
- package/dist/runtime/server/api/uplora/[id].delete.js +4 -0
- package/dist/runtime/server/api/uplora/index.post.d.ts +2 -0
- package/dist/runtime/server/api/uplora/index.post.js +4 -0
- package/dist/runtime/server/utils/validation.d.ts +2 -2
- package/dist/runtime/types/index.d.ts +16 -0
- package/dist/runtime/types/index.js +16 -0
- package/dist/runtime/types/query.d.ts +3 -1
- package/dist/runtime/types/tv.d.ts +9 -3
- package/package.json +5 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"slots": {
|
|
3
|
+
"root": "px-4 py-3 text-sm/6 rounded-md border flex gap-2"
|
|
4
|
+
},
|
|
5
|
+
"variants": {
|
|
6
|
+
"type": {
|
|
7
|
+
"caution": {
|
|
8
|
+
"root": "border border-error/25 bg-error/10 text-error-600 dark:text-error-300"
|
|
9
|
+
},
|
|
10
|
+
"note": {
|
|
11
|
+
"root": "border border-info/25 bg-info/10 text-info-600 dark:text-info-300"
|
|
12
|
+
},
|
|
13
|
+
"warning": {
|
|
14
|
+
"root": "border border-warning/25 bg-warning/10 text-warning-600 dark:text-warning-300"
|
|
15
|
+
},
|
|
16
|
+
"tip": {
|
|
17
|
+
"root": "border border-success/25 bg-success/10 text-success-600 dark:text-success-300"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"slots": {
|
|
3
|
+
"root": "",
|
|
4
|
+
"title": "text-base text-pretty font-semibold text-highlighted",
|
|
5
|
+
"description": "text-[15px] text-pretty text-muted mt-1",
|
|
6
|
+
"body": "relative rounded-lg bg-elevated/50 ring ring-default grid gap-x-8 gap-y-4 p-4 sm:p-6 mt-4"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"slots": {
|
|
3
|
+
"root": "",
|
|
4
|
+
"form": "flex flex-1 flex-row",
|
|
5
|
+
"body": "flex-1 overflow-y-auto w-full lg:max-w-2xl mx-auto p-4 sm:p-6",
|
|
6
|
+
"sidebar": "flex-1 overflow-y-auto border-l border-default w-full max-w-xs p-4 sm:p-4"
|
|
7
|
+
},
|
|
8
|
+
"variants": {
|
|
9
|
+
"asideDivide": {
|
|
10
|
+
"true": {
|
|
11
|
+
"sidebar": "*:not-last:after:absolute *:not-last:after:inset-x-1 *:not-last:after:bottom-0 *:not-last:after:bg-border *:not-last:after:h-px *:not-last:relative *:not-last:pb-4 flex flex-col gap-4"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/.nuxt/cms/index.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
+
export { default as autocompleteSelect } from './autocomplete-select'
|
|
1
2
|
export { default as buttonClear } from './button-clear'
|
|
3
|
+
export { default as buttonCopy } from './button-copy'
|
|
4
|
+
export { default as buttonDelete } from './button-delete'
|
|
5
|
+
export { default as formPanel } from './form-panel'
|
|
6
|
+
export { default as formPanelAsideSection } from './form-panel-aside-section'
|
|
7
|
+
export { default as formPanelSection } from './form-panel-section'
|
|
8
|
+
export { default as inputSeo } from './input-seo'
|
|
9
|
+
export { default as inputSlug } from './input-slug'
|
|
10
|
+
export { default as modalConfirm } from './modal-confirm'
|
|
11
|
+
export { default as tableCellPreview } from './table-cell-preview'
|
|
12
|
+
export { default as tableCellSeo } from './table-cell-seo'
|
|
13
|
+
export { default as tableCellUser } from './table-cell-user'
|
|
14
|
+
export { default as tablePanel } from './table-panel'
|
|
15
|
+
export { default as tablePanelColumnSorting } from './table-panel-column-sorting'
|
|
16
|
+
export { default as tablePanelColumnVisibility } from './table-panel-column-visibility'
|
|
17
|
+
export { default as tablePanelFilters } from './table-panel-filters'
|
|
2
18
|
export { default as uploraImage } from './uplora-image'
|
package/cli/templates.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import { computed, useAppConfig } from '#imports'
|
|
|
23
23
|
import { Primitive } from 'reka-ui'
|
|
24
24
|
import { tv } from '${prose ? '../../utils/tv' : '../utils/tv'}'
|
|
25
25
|
|
|
26
|
-
type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${
|
|
26
|
+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
|
|
27
27
|
|
|
28
28
|
export interface ${upperName}Props {
|
|
29
29
|
as?: any
|
|
@@ -62,13 +62,14 @@ function test({ name, prose }) {
|
|
|
62
62
|
? undefined
|
|
63
63
|
: `
|
|
64
64
|
import type { ${upperName}Props, ${upperName}Slots } from '../../../src/runtime/components/${upperName}.vue'
|
|
65
|
-
import { describe,
|
|
65
|
+
import { describe, expect, it } from 'vitest'
|
|
66
66
|
import ${upperName} from '../../../src/runtime/components/${upperName}.vue'
|
|
67
67
|
import ComponentRender from '../../component-render'
|
|
68
68
|
|
|
69
|
-
describe('${upperName}', () => {
|
|
69
|
+
describe('${upperName}.vue', () => {
|
|
70
70
|
it.each([
|
|
71
71
|
// Props
|
|
72
|
+
['базовый компонент', { props: {} }],
|
|
72
73
|
['с алиасом', { props: { as: 'section' } }],
|
|
73
74
|
['с class', { props: { class: '' } }],
|
|
74
75
|
['с ui', { props: { ui: {} } }],
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createResolver, addComponentsDir, addImportsDir, addPlugin, addImports, addServerImports, addServerImportsDir, addTypeTemplate, addTemplate, addServerTemplate, defineNuxtModule, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
1
|
+
import { createResolver, addComponentsDir, addImportsDir, addPlugin, addImports, addServerImports, addServerImportsDir, addServerHandler, addTypeTemplate, addTemplate, addServerTemplate, defineNuxtModule, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname } from 'pathe';
|
|
5
5
|
import { snakeCase, kebabCase } from 'scule';
|
|
6
6
|
|
|
7
7
|
const name = "@hywax/cms";
|
|
8
|
-
const version = "0.0.
|
|
8
|
+
const version = "0.0.6";
|
|
9
9
|
|
|
10
10
|
function createContext(options, nuxt) {
|
|
11
11
|
const { resolve } = createResolver(import.meta.url);
|
|
@@ -20,9 +20,7 @@ function createContext(options, nuxt) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
return {};
|
|
25
|
-
}
|
|
23
|
+
const defaultCMSConfig = {};
|
|
26
24
|
const defaultModuleOptions = {
|
|
27
25
|
name: "cms",
|
|
28
26
|
prefix: "C",
|
|
@@ -54,7 +52,7 @@ function prepareAutoImports({ resolve, options, nuxt }) {
|
|
|
54
52
|
path: resolve("./runtime/components"),
|
|
55
53
|
pathPrefix: false,
|
|
56
54
|
prefix: options?.prefix,
|
|
57
|
-
ignore: ["prose/**"]
|
|
55
|
+
ignore: ["prose/**", "editor/**"]
|
|
58
56
|
});
|
|
59
57
|
addComponentsDir({
|
|
60
58
|
path: resolve("./runtime/components/prose"),
|
|
@@ -64,20 +62,161 @@ function prepareAutoImports({ resolve, options, nuxt }) {
|
|
|
64
62
|
});
|
|
65
63
|
addImportsDir(resolve("./runtime/composables"));
|
|
66
64
|
addPlugin(resolve("./runtime/plugins/api.ts"));
|
|
67
|
-
addImports(
|
|
68
|
-
|
|
65
|
+
addImports([
|
|
66
|
+
...httpCodesImports,
|
|
67
|
+
{ name: "docToMarkdown", from: resolve("./runtime/editor/markdown") },
|
|
68
|
+
{ name: "markdownToDoc", from: resolve("./runtime/editor/markdown") }
|
|
69
|
+
]);
|
|
70
|
+
addServerImports([
|
|
71
|
+
...httpCodesImports,
|
|
72
|
+
{ name: "docToMarkdown", from: resolve("./runtime/editor/markdown") },
|
|
73
|
+
{ name: "markdownToDoc", from: resolve("./runtime/editor/markdown") }
|
|
74
|
+
]);
|
|
69
75
|
addServerImportsDir(resolve("./runtime/server/utils"));
|
|
70
76
|
nuxt.options.nitro.alias ||= {};
|
|
71
77
|
nuxt.options.nitro.alias["#cms/http-codes"] = httpCodesPath;
|
|
72
78
|
}
|
|
73
79
|
|
|
80
|
+
function prepareServerRoutes({ resolve }) {
|
|
81
|
+
addServerHandler({
|
|
82
|
+
route: "/api/_uplora",
|
|
83
|
+
method: "post",
|
|
84
|
+
handler: resolve("./runtime/server/api/uplora/index.post.ts")
|
|
85
|
+
});
|
|
86
|
+
addServerHandler({
|
|
87
|
+
route: "/api/_uplora/:id",
|
|
88
|
+
method: "delete",
|
|
89
|
+
handler: resolve("./runtime/server/api/uplora/[id].delete.ts")
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const autocompleteSelect = {
|
|
94
|
+
slots: {
|
|
95
|
+
root: ""
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
74
99
|
const buttonClear = {
|
|
75
100
|
slots: {
|
|
76
101
|
base: "p-0"
|
|
77
102
|
}
|
|
78
103
|
};
|
|
79
104
|
|
|
80
|
-
const
|
|
105
|
+
const buttonCopy = {
|
|
106
|
+
slots: {
|
|
107
|
+
root: ""
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const buttonDelete = {
|
|
112
|
+
slots: {
|
|
113
|
+
root: ""
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const formPanel = {
|
|
118
|
+
slots: {
|
|
119
|
+
root: "",
|
|
120
|
+
form: "flex flex-1 flex-row",
|
|
121
|
+
body: "flex-1 overflow-y-auto w-full lg:max-w-2xl mx-auto p-4 sm:p-6",
|
|
122
|
+
sidebar: "flex-1 overflow-y-auto border-l border-default w-full max-w-xs p-4 sm:p-4"
|
|
123
|
+
},
|
|
124
|
+
variants: {
|
|
125
|
+
asideDivide: {
|
|
126
|
+
true: {
|
|
127
|
+
sidebar: "*:not-last:after:absolute *:not-last:after:inset-x-1 *:not-last:after:bottom-0 *:not-last:after:bg-border *:not-last:after:h-px *:not-last:relative *:not-last:pb-4 flex flex-col gap-4"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const formPanelAsideSection = {
|
|
134
|
+
slots: {
|
|
135
|
+
root: "",
|
|
136
|
+
header: "flex items-center gap-2 mb-2",
|
|
137
|
+
icon: "size-5",
|
|
138
|
+
title: "break-words text-sm font-semibold",
|
|
139
|
+
body: ""
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const formPanelSection = {
|
|
144
|
+
slots: {
|
|
145
|
+
root: "",
|
|
146
|
+
title: "text-base text-pretty font-semibold text-highlighted",
|
|
147
|
+
description: "text-[15px] text-pretty text-muted mt-1",
|
|
148
|
+
body: "relative rounded-lg bg-elevated/50 ring ring-default grid gap-x-8 gap-y-4 p-4 sm:p-6 mt-4"
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const inputSeo = {
|
|
153
|
+
slots: {
|
|
154
|
+
root: "flex flex-col gap-4"
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const inputSlug = {
|
|
159
|
+
slots: {
|
|
160
|
+
root: "flex flex-col gap-4"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const modalConfirm = {
|
|
165
|
+
slots: {
|
|
166
|
+
root: ""
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const tableCellPreview = {
|
|
171
|
+
slots: {
|
|
172
|
+
root: "flex items-center gap-2",
|
|
173
|
+
image: "bg-elevated size-7 rounded-md",
|
|
174
|
+
container: "text-xs",
|
|
175
|
+
title: "font-medium text-default",
|
|
176
|
+
description: "text-muted truncate max-w-40"
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const tableCellSeo = {
|
|
181
|
+
slots: {
|
|
182
|
+
root: "flex gap-2"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const tableCellUser = {
|
|
187
|
+
slots: {
|
|
188
|
+
root: ""
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const tablePanel = {
|
|
193
|
+
slots: {
|
|
194
|
+
root: "",
|
|
195
|
+
table: "",
|
|
196
|
+
loader: "absolute z-10 inset-0 left-0 bg-default/90 flex items-center justify-center",
|
|
197
|
+
loaderIcon: "animate-spin size-6"
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const tablePanelColumnSorting = {
|
|
202
|
+
slots: {
|
|
203
|
+
root: ""
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const tablePanelColumnVisibility = {
|
|
208
|
+
slots: {
|
|
209
|
+
root: ""
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const tablePanelFilters = {
|
|
214
|
+
slots: {
|
|
215
|
+
root: ""
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const uploraImage$2 = {
|
|
81
220
|
slots: {
|
|
82
221
|
root: "relative grid grid-cols-[100%] grid-rows-[100%] overflow-hidden",
|
|
83
222
|
lqip: "bg-cover bg-no-repeat bg-center col-[1] row-[1]",
|
|
@@ -88,7 +227,57 @@ const uploraImage$1 = {
|
|
|
88
227
|
|
|
89
228
|
const theme = {
|
|
90
229
|
__proto__: null,
|
|
230
|
+
autocompleteSelect: autocompleteSelect,
|
|
91
231
|
buttonClear: buttonClear,
|
|
232
|
+
buttonCopy: buttonCopy,
|
|
233
|
+
buttonDelete: buttonDelete,
|
|
234
|
+
formPanel: formPanel,
|
|
235
|
+
formPanelAsideSection: formPanelAsideSection,
|
|
236
|
+
formPanelSection: formPanelSection,
|
|
237
|
+
inputSeo: inputSeo,
|
|
238
|
+
inputSlug: inputSlug,
|
|
239
|
+
modalConfirm: modalConfirm,
|
|
240
|
+
tableCellPreview: tableCellPreview,
|
|
241
|
+
tableCellSeo: tableCellSeo,
|
|
242
|
+
tableCellUser: tableCellUser,
|
|
243
|
+
tablePanel: tablePanel,
|
|
244
|
+
tablePanelColumnSorting: tablePanelColumnSorting,
|
|
245
|
+
tablePanelColumnVisibility: tablePanelColumnVisibility,
|
|
246
|
+
tablePanelFilters: tablePanelFilters,
|
|
247
|
+
uploraImage: uploraImage$2
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const callout = {
|
|
251
|
+
slots: {
|
|
252
|
+
root: "px-4 py-3 text-sm/6 rounded-md border flex gap-2"
|
|
253
|
+
},
|
|
254
|
+
variants: {
|
|
255
|
+
type: {
|
|
256
|
+
caution: {
|
|
257
|
+
root: "border border-error/25 bg-error/10 text-error-600 dark:text-error-300"
|
|
258
|
+
},
|
|
259
|
+
note: {
|
|
260
|
+
root: "border border-info/25 bg-info/10 text-info-600 dark:text-info-300"
|
|
261
|
+
},
|
|
262
|
+
warning: {
|
|
263
|
+
root: "border border-warning/25 bg-warning/10 text-warning-600 dark:text-warning-300"
|
|
264
|
+
},
|
|
265
|
+
tip: {
|
|
266
|
+
root: "border border-success/25 bg-success/10 text-success-600 dark:text-success-300"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const uploraImage$1 = {
|
|
273
|
+
slots: {
|
|
274
|
+
root: "rounded-md overflow-hidden"
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const themeEditor = {
|
|
279
|
+
__proto__: null,
|
|
280
|
+
callout: callout,
|
|
92
281
|
uploraImage: uploraImage$1
|
|
93
282
|
};
|
|
94
283
|
|
|
@@ -140,12 +329,18 @@ function getAppTemplates({ options }) {
|
|
|
140
329
|
}
|
|
141
330
|
}
|
|
142
331
|
writeThemeTemplate(themeProse, "prose");
|
|
332
|
+
writeThemeTemplate(themeEditor, "editor");
|
|
143
333
|
writeThemeTemplate(theme);
|
|
144
334
|
templates.push({
|
|
145
335
|
filename: `cms/prose/index.ts`,
|
|
146
336
|
write: true,
|
|
147
337
|
getContents: () => Object.keys(themeProse).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
|
|
148
338
|
});
|
|
339
|
+
templates.push({
|
|
340
|
+
filename: `cms/editor/index.ts`,
|
|
341
|
+
write: true,
|
|
342
|
+
getContents: () => Object.keys(themeEditor).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
|
|
343
|
+
});
|
|
149
344
|
templates.push({
|
|
150
345
|
filename: "cms.css",
|
|
151
346
|
write: true,
|
|
@@ -215,7 +410,13 @@ function prepareTemplates(context) {
|
|
|
215
410
|
}
|
|
216
411
|
}
|
|
217
412
|
|
|
218
|
-
const icons = {
|
|
413
|
+
const icons = {
|
|
414
|
+
sortAsc: "lucide:arrow-up-wide-narrow",
|
|
415
|
+
sortDesc: "lucide:arrow-down-wide-narrow",
|
|
416
|
+
columns: "lucide:columns-3-cog",
|
|
417
|
+
filter: "lucide:filter",
|
|
418
|
+
link: "lucide:link-2"
|
|
419
|
+
};
|
|
219
420
|
|
|
220
421
|
const module = defineNuxtModule({
|
|
221
422
|
meta: {
|
|
@@ -265,9 +466,10 @@ const module = defineNuxtModule({
|
|
|
265
466
|
await installModule("nuxt-auth-utils");
|
|
266
467
|
}
|
|
267
468
|
nuxt.options.alias["#cms"] = context.resolve("./runtime");
|
|
268
|
-
nuxt.options.appConfig.cms = defu(nuxt.options.appConfig.cms || {},
|
|
469
|
+
nuxt.options.appConfig.cms = defu(nuxt.options.appConfig.cms || {}, defaultCMSConfig);
|
|
269
470
|
prepareAutoImports(context);
|
|
270
471
|
prepareTemplates(context);
|
|
472
|
+
prepareServerRoutes(context);
|
|
271
473
|
}
|
|
272
474
|
});
|
|
273
475
|
|