@hywax/cms 0.0.22 → 1.0.1
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/editor/index.ts +0 -2
- package/.nuxt/cms/form-panel-section.ts +2 -2
- package/.nuxt/cms/index.ts +8 -21
- package/.nuxt/cms/table-search-input.ts +6 -0
- package/dist/module.json +3 -3
- package/dist/module.mjs +78 -182
- package/dist/runtime/components/AutocompleteSelect.d.vue.ts +56 -0
- package/dist/runtime/components/AutocompleteSelect.vue +131 -77
- package/dist/runtime/components/AutocompleteSelect.vue.d.ts +43 -29
- package/dist/runtime/components/{ButtonDelete.vue.d.ts → ButtonDeleteConfirm.d.vue.ts} +4 -3
- package/dist/runtime/components/{ButtonDelete.vue → ButtonDeleteConfirm.vue} +1 -1
- package/dist/runtime/components/ButtonDeleteConfirm.vue.d.ts +36 -0
- package/dist/runtime/components/DatePicker.d.vue.ts +43 -0
- package/dist/runtime/components/DatePicker.vue +232 -0
- package/dist/runtime/components/DatePicker.vue.d.ts +43 -0
- package/dist/runtime/components/EditorFull.d.vue.ts +13 -0
- package/dist/runtime/components/EditorFull.vue +127 -0
- package/dist/runtime/components/EditorFull.vue.d.ts +13 -0
- package/dist/runtime/components/EditorLinkPopover.d.vue.ts +8 -0
- package/dist/runtime/components/EditorLinkPopover.vue +137 -0
- package/dist/runtime/components/EditorLinkPopover.vue.d.ts +8 -0
- package/dist/runtime/components/FormPanel.d.vue.ts +47 -0
- package/dist/runtime/components/FormPanel.vue +10 -7
- package/dist/runtime/components/FormPanel.vue.d.ts +21 -15
- package/dist/runtime/components/FormPanelAsideSection.d.vue.ts +24 -0
- package/dist/runtime/components/FormPanelAsideSection.vue.d.ts +2 -1
- package/dist/runtime/components/FormPanelSection.d.vue.ts +21 -0
- package/dist/runtime/components/FormPanelSection.vue +2 -2
- package/dist/runtime/components/FormPanelSection.vue.d.ts +3 -2
- package/dist/runtime/components/Layout.d.vue.ts +27 -0
- package/dist/runtime/components/Layout.vue +79 -0
- package/dist/runtime/components/Layout.vue.d.ts +27 -0
- package/dist/runtime/components/ModalConfirm.d.vue.ts +33 -0
- package/dist/runtime/components/ModalConfirm.vue.d.ts +3 -2
- package/dist/runtime/components/TableColumnSorting.d.vue.ts +17 -0
- package/dist/runtime/components/{TablePanelColumnSorting.vue → TableColumnSorting.vue} +27 -18
- package/dist/runtime/components/TableColumnSorting.vue.d.ts +17 -0
- package/dist/runtime/components/TableColumnVisibility.d.vue.ts +24 -0
- package/dist/runtime/components/TableColumnVisibility.vue +111 -0
- package/dist/runtime/components/TableColumnVisibility.vue.d.ts +24 -0
- package/dist/runtime/components/TableFilters.d.vue.ts +90 -0
- package/dist/runtime/components/TableFilters.vue +198 -0
- package/dist/runtime/components/TableFilters.vue.d.ts +90 -0
- package/dist/runtime/components/TablePanel.d.vue.ts +95 -0
- package/dist/runtime/components/TablePanel.vue +207 -66
- package/dist/runtime/components/TablePanel.vue.d.ts +76 -31
- package/dist/runtime/components/TableSearchInput.d.vue.ts +33 -0
- package/dist/runtime/components/TableSearchInput.vue +96 -0
- package/dist/runtime/components/TableSearchInput.vue.d.ts +33 -0
- package/dist/runtime/components/UploraImage.d.vue.ts +35 -0
- package/dist/runtime/components/UploraImage.vue.d.ts +3 -2
- package/dist/runtime/components/prose/UploraImage.d.vue.ts +14 -0
- package/dist/runtime/components/prose/UploraImage.vue.d.ts +2 -1
- package/dist/runtime/composables/useAdmin.d.ts +1 -1
- package/dist/runtime/composables/useAdmin.js +2 -1
- package/dist/runtime/composables/useApi.d.ts +1 -1
- package/dist/runtime/composables/useAsyncHandler.d.ts +1 -1
- package/dist/runtime/composables/useAsyncHandler.js +1 -1
- package/dist/runtime/composables/useEditorDragHandle.d.ts +16 -0
- package/dist/runtime/composables/useEditorDragHandle.js +95 -0
- package/dist/runtime/composables/useEditorSuggestions.d.ts +68 -0
- package/dist/runtime/composables/useEditorSuggestions.js +24 -0
- package/dist/runtime/composables/useEditorToolbar.d.ts +120 -0
- package/dist/runtime/composables/useEditorToolbar.js +87 -0
- package/dist/runtime/composables/useFormState.d.ts +12 -0
- package/dist/runtime/composables/useFormState.js +33 -0
- package/dist/runtime/composables/useLogout.d.ts +1 -1
- package/dist/runtime/composables/useLogout.js +3 -1
- package/dist/runtime/composables/useNotification.d.ts +12 -0
- package/dist/runtime/composables/useNotification.js +46 -0
- package/dist/runtime/composables/useQueryState.d.ts +28 -0
- package/dist/runtime/composables/useQueryState.js +105 -0
- package/dist/runtime/composables/useRouteQuery.d.ts +37 -0
- package/dist/runtime/composables/useRouteQuery.js +81 -0
- package/dist/runtime/composables/useRowSelection.d.ts +8 -0
- package/dist/runtime/composables/useRowSelection.js +46 -0
- package/dist/runtime/composables/useTable.d.ts +17 -11
- package/dist/runtime/composables/useTable.js +47 -53
- package/dist/runtime/composables/useUplora.d.ts +1 -1
- package/dist/runtime/composables/useUplora.js +2 -1
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/plugins/zod.d.ts +2 -0
- package/dist/runtime/plugins/zod.js +26 -0
- package/dist/runtime/server/api/uplora/[id].delete.d.ts +1 -5
- package/dist/runtime/tv.d.ts +1 -1
- package/dist/runtime/types/date.d.ts +5 -0
- package/dist/runtime/types/index.d.ts +3 -21
- package/dist/runtime/types/index.js +1 -21
- package/dist/runtime/types/utils.d.ts +7 -0
- package/dist/runtime/utils/date.d.ts +9 -0
- package/dist/runtime/utils/date.js +28 -0
- package/dist/runtime/utils/formatters.d.ts +2 -0
- package/dist/runtime/utils/formatters.js +8 -0
- package/dist/runtime/utils/index.d.ts +5 -2
- package/dist/runtime/utils/index.js +5 -2
- package/dist/runtime/utils/storage.d.ts +2 -0
- package/dist/runtime/utils/storage.js +10 -0
- package/dist/runtime/utils/table.d.ts +23 -0
- package/dist/runtime/utils/table.js +51 -0
- package/package.json +26 -25
- package/.nuxt/cms/button-clear.ts +0 -5
- package/.nuxt/cms/button-copy.ts +0 -5
- package/.nuxt/cms/button-delete.ts +0 -5
- package/.nuxt/cms/editor/callout.ts +0 -21
- package/.nuxt/cms/editor/uplora-image.ts +0 -5
- package/.nuxt/cms/editor-content-full.ts +0 -6
- package/.nuxt/cms/editor-content-light.ts +0 -6
- package/.nuxt/cms/input-seo.ts +0 -5
- package/.nuxt/cms/input-slug.ts +0 -5
- package/.nuxt/cms/input-uplora-image.ts +0 -15
- package/.nuxt/cms/table-cell-preview.ts +0 -9
- package/.nuxt/cms/table-cell-seo.ts +0 -5
- package/.nuxt/cms/table-cell-user.ts +0 -9
- package/.nuxt/cms/table-panel-column-sorting.ts +0 -5
- package/.nuxt/cms/table-panel-column-visibility.ts +0 -5
- package/.nuxt/cms/table-panel-filters.ts +0 -5
- package/dist/runtime/components/ButtonClear.vue +0 -35
- package/dist/runtime/components/ButtonClear.vue.d.ts +0 -35
- package/dist/runtime/components/ButtonCopy.vue +0 -40
- package/dist/runtime/components/ButtonCopy.vue.d.ts +0 -23
- package/dist/runtime/components/EditorContentFull.vue +0 -53
- package/dist/runtime/components/EditorContentFull.vue.d.ts +0 -20
- package/dist/runtime/components/EditorContentLight.vue +0 -46
- package/dist/runtime/components/EditorContentLight.vue.d.ts +0 -20
- package/dist/runtime/components/InputSeo.vue +0 -73
- package/dist/runtime/components/InputSeo.vue.d.ts +0 -19
- package/dist/runtime/components/InputSlug.vue +0 -70
- package/dist/runtime/components/InputSlug.vue.d.ts +0 -29
- package/dist/runtime/components/InputUploraImage.vue +0 -136
- package/dist/runtime/components/InputUploraImage.vue.d.ts +0 -35
- package/dist/runtime/components/TableCellPreview.vue +0 -41
- package/dist/runtime/components/TableCellPreview.vue.d.ts +0 -18
- package/dist/runtime/components/TableCellSeo.vue +0 -34
- package/dist/runtime/components/TableCellSeo.vue.d.ts +0 -13
- package/dist/runtime/components/TableCellUser.vue +0 -40
- package/dist/runtime/components/TableCellUser.vue.d.ts +0 -18
- package/dist/runtime/components/TablePanelColumnSorting.vue.d.ts +0 -20
- package/dist/runtime/components/TablePanelColumnVisibility.vue +0 -49
- package/dist/runtime/components/TablePanelColumnVisibility.vue.d.ts +0 -20
- package/dist/runtime/components/TablePanelFilters.vue +0 -79
- package/dist/runtime/components/TablePanelFilters.vue.d.ts +0 -34
- package/dist/runtime/composables/useDeleteConfirm.d.ts +0 -15
- package/dist/runtime/composables/useDeleteConfirm.js +0 -27
- package/dist/runtime/composables/useSeoStats.d.ts +0 -12
- package/dist/runtime/composables/useSeoStats.js +0 -44
- package/dist/runtime/editor/components/BlockMenu.vue +0 -43
- package/dist/runtime/editor/components/BlockMenu.vue.d.ts +0 -2
- package/dist/runtime/editor/components/SlashCommand.vue +0 -92
- package/dist/runtime/editor/components/SlashCommand.vue.d.ts +0 -7
- package/dist/runtime/editor/components/TooltipLink.vue +0 -81
- package/dist/runtime/editor/components/TooltipLink.vue.d.ts +0 -9
- package/dist/runtime/editor/components/TooltipMenu.vue +0 -75
- package/dist/runtime/editor/components/TooltipMenu.vue.d.ts +0 -9
- package/dist/runtime/editor/extensions/callout/CalloutView.vue +0 -85
- package/dist/runtime/editor/extensions/callout/CalloutView.vue.d.ts +0 -7
- package/dist/runtime/editor/extensions/callout/extension.d.ts +0 -13
- package/dist/runtime/editor/extensions/callout/extension.js +0 -48
- package/dist/runtime/editor/extensions/callout/index.d.ts +0 -2
- package/dist/runtime/editor/extensions/callout/index.js +0 -2
- package/dist/runtime/editor/extensions/callout/types.d.ts +0 -3
- package/dist/runtime/editor/extensions/index.d.ts +0 -26
- package/dist/runtime/editor/extensions/index.js +0 -85
- package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue +0 -29
- package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue.d.ts +0 -7
- package/dist/runtime/editor/extensions/uplora-image/extension.d.ts +0 -13
- package/dist/runtime/editor/extensions/uplora-image/extension.js +0 -60
- package/dist/runtime/editor/extensions/uplora-image/index.d.ts +0 -2
- package/dist/runtime/editor/extensions/uplora-image/index.js +0 -2
- package/dist/runtime/editor/extensions/uplora-image/types.d.ts +0 -5
- package/dist/runtime/editor/extensions/uplora-image/types.js +0 -0
- package/dist/runtime/editor/markdown/index.d.ts +0 -3
- package/dist/runtime/editor/markdown/index.js +0 -47
- package/dist/runtime/editor/markdown/nodes/callout.d.ts +0 -2
- package/dist/runtime/editor/markdown/nodes/callout.js +0 -21
- package/dist/runtime/editor/markdown/nodes/uploraImage.d.ts +0 -2
- package/dist/runtime/editor/markdown/nodes/uploraImage.js +0 -31
- package/dist/runtime/utils/dictionaries.d.ts +0 -4
- package/dist/runtime/utils/dictionaries.js +0 -6
- /package/.nuxt/cms/{autocomplete-select.ts → button-delete-confirm.ts} +0 -0
- /package/dist/runtime/{editor/extensions/callout/types.js → types/date.js} +0 -0
- /package/dist/runtime/utils/{image.d.ts → uplora.d.ts} +0 -0
- /package/dist/runtime/utils/{image.js → uplora.js} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { formatDate as format, normalizeDate } from "@vueuse/core";
|
|
2
|
+
export function getPeriod(beforeDays, afterDays = 0, fixTime = true) {
|
|
3
|
+
const start = /* @__PURE__ */ new Date();
|
|
4
|
+
start.setDate(start.getDate() - beforeDays);
|
|
5
|
+
fixTime && start.setHours(0, 0, 0, 0);
|
|
6
|
+
const end = /* @__PURE__ */ new Date();
|
|
7
|
+
end.setDate(end.getDate() + afterDays);
|
|
8
|
+
fixTime && end.setHours(23, 59, 59, 999);
|
|
9
|
+
return { start: formatServerDateTime(start), end: formatServerDateTime(end) };
|
|
10
|
+
}
|
|
11
|
+
export function getPeriodFromDaysAgo(days, fixTime = true) {
|
|
12
|
+
return getPeriod(days, 0, fixTime);
|
|
13
|
+
}
|
|
14
|
+
export function getCurrentDayPeriod() {
|
|
15
|
+
return getPeriodFromDaysAgo(0);
|
|
16
|
+
}
|
|
17
|
+
export function formatDateTime(date) {
|
|
18
|
+
return normalizeDate(date).toLocaleString("ru-RU");
|
|
19
|
+
}
|
|
20
|
+
export function formatDate(date) {
|
|
21
|
+
return normalizeDate(date).toLocaleDateString("ru-RU");
|
|
22
|
+
}
|
|
23
|
+
export function formatTime(date) {
|
|
24
|
+
return normalizeDate(date).toLocaleTimeString("ru-RU");
|
|
25
|
+
}
|
|
26
|
+
export function formatServerDateTime(date) {
|
|
27
|
+
return format(normalizeDate(date), "YYYY-MM-DD HH:mm:ss");
|
|
28
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './avatar';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './date';
|
|
3
3
|
export * from './features';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './formatters';
|
|
5
5
|
export * from './logger';
|
|
6
6
|
export * from './slugify';
|
|
7
|
+
export * from './storage';
|
|
8
|
+
export * from './table';
|
|
9
|
+
export * from './uplora';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from "./avatar.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./date.js";
|
|
3
3
|
export * from "./features.js";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./formatters.js";
|
|
5
5
|
export * from "./logger.js";
|
|
6
6
|
export * from "./slugify.js";
|
|
7
|
+
export * from "./storage.js";
|
|
8
|
+
export * from "./table.js";
|
|
9
|
+
export * from "./uplora.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { kebabCase } from "scule";
|
|
2
|
+
const storagePrefix = "cms:";
|
|
3
|
+
export const getCmsStorageKey = (key) => `${storagePrefix}${kebabCase(key)}`;
|
|
4
|
+
export function clearCmsStorage() {
|
|
5
|
+
for (const key in localStorage) {
|
|
6
|
+
if (key.startsWith(storagePrefix)) {
|
|
7
|
+
localStorage.removeItem(key);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ButtonProps, FormSchema, TableColumn, TableData, TableRow } from '@nuxt/ui';
|
|
2
|
+
import type { RowData } from '@tanstack/table-core';
|
|
3
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
4
|
+
import type { FiltersField } from '../types';
|
|
5
|
+
declare module '@tanstack/table-core' {
|
|
6
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
7
|
+
headerLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare function createTableFiltersFields<S extends FormSchema, F extends readonly FiltersField<S>[]>(_schema: S, fields: F): {
|
|
11
|
+
-readonly [P in keyof F]: F[P];
|
|
12
|
+
};
|
|
13
|
+
export type TableColumnFormat = 'number' | 'date' | 'date-time';
|
|
14
|
+
export type TableColumnCustom<T extends TableData, D = unknown> = TableColumn<T, D> & {
|
|
15
|
+
format?: TableColumnFormat;
|
|
16
|
+
to?: ((row: TableRow<T>) => RouteLocationRaw | string | undefined) | RouteLocationRaw | string | undefined;
|
|
17
|
+
target?: ButtonProps['target'];
|
|
18
|
+
external?: boolean;
|
|
19
|
+
emptyValue?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function createTableColumns<I extends Record<string, any>, T extends readonly TableColumnCustom<I>[] = readonly TableColumnCustom<I>[]>(columns: T): {
|
|
22
|
+
-readonly [P in keyof T]: T[P];
|
|
23
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { UButton } from "#components";
|
|
2
|
+
import { h } from "vue";
|
|
3
|
+
import { formatDate, formatDateTime } from "./date.js";
|
|
4
|
+
import { formatNumber } from "./formatters.js";
|
|
5
|
+
export function createTableFiltersFields(_schema, fields) {
|
|
6
|
+
return fields;
|
|
7
|
+
}
|
|
8
|
+
function applyFormat(value, column) {
|
|
9
|
+
if (value === void 0 || value === null || !column.format) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
if (column.format === "number") {
|
|
13
|
+
return formatNumber(value);
|
|
14
|
+
}
|
|
15
|
+
if (column.format === "date") {
|
|
16
|
+
return value ? formatDate(value) : column.emptyValue;
|
|
17
|
+
}
|
|
18
|
+
if (column.format === "date-time") {
|
|
19
|
+
return value ? formatDateTime(value) : column.emptyValue;
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function transformColumn(column) {
|
|
24
|
+
const col = {
|
|
25
|
+
...column,
|
|
26
|
+
cell: column.cell ?? (({ getValue, row }) => {
|
|
27
|
+
const value = applyFormat(getValue(), column);
|
|
28
|
+
if (!value && typeof value !== "number") {
|
|
29
|
+
return void 0;
|
|
30
|
+
}
|
|
31
|
+
if (column.to) {
|
|
32
|
+
return h(UButton, {
|
|
33
|
+
to: typeof column.to === "function" ? column.to(row) : column.to,
|
|
34
|
+
external: column.external,
|
|
35
|
+
target: column.target,
|
|
36
|
+
label: value.toString(),
|
|
37
|
+
variant: "link",
|
|
38
|
+
class: "px-0"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
if (column.format === "number") {
|
|
45
|
+
col.meta = { ...col.meta, class: { td: "text-right tabular-nums", th: "text-right tabular-nums" } };
|
|
46
|
+
}
|
|
47
|
+
return col;
|
|
48
|
+
}
|
|
49
|
+
export function createTableColumns(columns) {
|
|
50
|
+
return columns.map((c) => transformColumn(c));
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hywax/cms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -55,45 +55,46 @@
|
|
|
55
55
|
"dist"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@dicebear/collection": "^9.2.
|
|
59
|
-
"@dicebear/core": "^9.2.
|
|
60
|
-
"@iconify-json/lucide": "1.2.
|
|
61
|
-
"@nuxt/kit": "^
|
|
62
|
-
"@nuxt/ui
|
|
63
|
-
"@nuxtjs/mdc": "^0.
|
|
64
|
-
"@sindresorhus/slugify": "^
|
|
65
|
-
"@unpress/mdc-prosemirror": "0.1.12-beta.2",
|
|
58
|
+
"@dicebear/collection": "^9.2.4",
|
|
59
|
+
"@dicebear/core": "^9.2.4",
|
|
60
|
+
"@iconify-json/lucide": "1.2.82",
|
|
61
|
+
"@nuxt/kit": "^4.2.2",
|
|
62
|
+
"@nuxt/ui": "^4.3.0",
|
|
63
|
+
"@nuxtjs/mdc": "^0.19.2",
|
|
64
|
+
"@sindresorhus/slugify": "^3.0.0",
|
|
66
65
|
"@uplora/formats": "^0.1.0",
|
|
67
66
|
"@uplora/serializer": "^0.1.3",
|
|
68
|
-
"@vueuse/nuxt": "^
|
|
67
|
+
"@vueuse/nuxt": "^14.1.0",
|
|
69
68
|
"consola": "^3.4.2",
|
|
70
69
|
"defu": "^6.1.4",
|
|
70
|
+
"fast-copy": "^3.0.2",
|
|
71
71
|
"fast-equals": "^5.2.2",
|
|
72
|
-
"nuxt-auth-utils": "^0.5.
|
|
72
|
+
"nuxt-auth-utils": "^0.5.26",
|
|
73
73
|
"pathe": "^2.0.3",
|
|
74
|
-
"prosekit": "^0.13.6",
|
|
75
74
|
"scule": "^1.3.0",
|
|
76
|
-
"
|
|
75
|
+
"sortablejs": "^1.15.6",
|
|
76
|
+
"zod": "^4.2.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@antfu/eslint-config": "^4.
|
|
80
|
-
"@commitlint/cli": "^
|
|
81
|
-
"@commitlint/config-conventional": "^
|
|
82
|
-
"@nuxt/devtools": "^
|
|
83
|
-
"@nuxt/module-builder": "^1.0.
|
|
84
|
-
"@nuxt/schema": "^
|
|
85
|
-
"@nuxt/test-utils": "^3.
|
|
86
|
-
"@types/node": "^
|
|
79
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
80
|
+
"@commitlint/cli": "^20.2.0",
|
|
81
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
82
|
+
"@nuxt/devtools": "^3.1.1",
|
|
83
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
84
|
+
"@nuxt/schema": "^4.2.2",
|
|
85
|
+
"@nuxt/test-utils": "^3.21.0",
|
|
86
|
+
"@types/node": "^24.10.4",
|
|
87
|
+
"@types/sortablejs": "^1.15.9",
|
|
87
88
|
"@vue/test-utils": "^2.4.6",
|
|
88
89
|
"changelogen": "^0.6.1",
|
|
89
|
-
"eslint": "^9.
|
|
90
|
-
"happy-dom": "^
|
|
90
|
+
"eslint": "^9.39.2",
|
|
91
|
+
"happy-dom": "^20.0.11",
|
|
91
92
|
"husky": "^9.1.7",
|
|
92
93
|
"lint-staged": "^16.1.2",
|
|
93
|
-
"nuxt": "^
|
|
94
|
+
"nuxt": "^4.2.2",
|
|
94
95
|
"typescript": "^5.8.3",
|
|
95
96
|
"vitest": "^3.2.4",
|
|
96
|
-
"vue-tsc": "^
|
|
97
|
+
"vue-tsc": "^3.2.1"
|
|
97
98
|
},
|
|
98
99
|
"resolutions": {
|
|
99
100
|
"@hywax/cms": "workspace:*"
|
package/.nuxt/cms/button-copy.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
package/.nuxt/cms/input-seo.ts
DELETED
package/.nuxt/cms/input-slug.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
"slots": {
|
|
3
|
-
"root": "relative w-full rounded-md overflow-hidden ring ring-inset ring-accented aspect-3/2 text-sm",
|
|
4
|
-
"image": "",
|
|
5
|
-
"imageActions": "absolute top-4 right-4 flex gap-2",
|
|
6
|
-
"uploader": "flex flex-col items-center justify-center w-full h-full p-4",
|
|
7
|
-
"uploaderPendingIcon": "size-6 animate-spin",
|
|
8
|
-
"uploaderIdleButton": "cursor-pointer bg-muted/50 border border-default border-dashed rounded-md h-full w-full",
|
|
9
|
-
"uploaderIdleIcon": "size-10 text-primary",
|
|
10
|
-
"uploaderIdleText": "mt-2 font-medium",
|
|
11
|
-
"uploaderIdleExtensions": "mt-2 text-xs text-muted uppercase",
|
|
12
|
-
"uploaderErrorText": "text-center font-medium",
|
|
13
|
-
"uploaderErrorActions": "flex gap-2 mt-4"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UButton
|
|
3
|
-
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
4
|
-
:color="color"
|
|
5
|
-
:variant="variant"
|
|
6
|
-
:size="size"
|
|
7
|
-
:icon="icon || appConfig.ui.icons.close"
|
|
8
|
-
:aria-label="label"
|
|
9
|
-
:disabled="!modelValue"
|
|
10
|
-
@click.stop="emit('update:modelValue', resetValue)"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import theme from "#build/cms/button-clear";
|
|
16
|
-
import { computed, useAppConfig } from "#imports";
|
|
17
|
-
import { tv } from "../tv";
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<script setup>
|
|
21
|
-
const props = defineProps({
|
|
22
|
-
icon: { type: String, required: false },
|
|
23
|
-
label: { type: String, required: false, default: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435" },
|
|
24
|
-
color: { type: null, required: false, default: "neutral" },
|
|
25
|
-
variant: { type: null, required: false, default: "link" },
|
|
26
|
-
size: { type: null, required: false, default: "sm" },
|
|
27
|
-
resetValue: { type: [String, Number, Boolean, null], required: false, skipCheck: true, default: void 0 },
|
|
28
|
-
class: { type: null, required: false },
|
|
29
|
-
ui: { type: null, required: false }
|
|
30
|
-
});
|
|
31
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
32
|
-
const modelValue = defineModel({ type: [String, Number, Boolean, null], skipCheck: true });
|
|
33
|
-
const appConfig = useAppConfig();
|
|
34
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.buttonClear || {} })());
|
|
35
|
-
</script>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
-
import type { ButtonProps } from '@nuxt/ui';
|
|
3
|
-
import type { ComponentConfig } from '../types';
|
|
4
|
-
import theme from '#build/cms/button-clear';
|
|
5
|
-
export type ButtonClear = ComponentConfig<typeof theme, AppConfig, 'buttonClear'>;
|
|
6
|
-
export type ResetValue = string | number | boolean | null | undefined;
|
|
7
|
-
export interface ButtonClearProps {
|
|
8
|
-
icon?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
color?: ButtonProps['color'];
|
|
11
|
-
variant?: ButtonProps['variant'];
|
|
12
|
-
size?: ButtonProps['size'];
|
|
13
|
-
resetValue?: ResetValue;
|
|
14
|
-
class?: any;
|
|
15
|
-
ui?: ButtonClear['slots'];
|
|
16
|
-
}
|
|
17
|
-
export interface ButtonClearEmits {
|
|
18
|
-
'update:modelValue': [ResetValue];
|
|
19
|
-
}
|
|
20
|
-
declare const _default: import("vue").DefineComponent<ButtonClearProps & {
|
|
21
|
-
modelValue?: ResetValue;
|
|
22
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
-
"update:modelValue": (...args: unknown[]) => any;
|
|
24
|
-
}, string, import("vue").PublicProps, Readonly<ButtonClearProps & {
|
|
25
|
-
modelValue?: ResetValue;
|
|
26
|
-
}> & Readonly<{
|
|
27
|
-
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
28
|
-
}>, {
|
|
29
|
-
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
30
|
-
color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
|
|
31
|
-
variant: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link";
|
|
32
|
-
label: string;
|
|
33
|
-
resetValue: string | number | boolean | null;
|
|
34
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
-
export default _default;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UTooltip
|
|
3
|
-
:text="tooltipText"
|
|
4
|
-
:content="{ side: 'top' }"
|
|
5
|
-
disable-hoverable-content
|
|
6
|
-
disable-closing-trigger
|
|
7
|
-
>
|
|
8
|
-
<UButton
|
|
9
|
-
:icon="copied ? appConfig.ui.icons.copyCheck : appConfig.ui.icons.copy"
|
|
10
|
-
:color="color"
|
|
11
|
-
:variant="variant"
|
|
12
|
-
:size="size"
|
|
13
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
14
|
-
@click="copy(value)"
|
|
15
|
-
/>
|
|
16
|
-
</UTooltip>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
import theme from "#build/cms/button-copy";
|
|
21
|
-
import { computed, useAppConfig, useClipboard } from "#imports";
|
|
22
|
-
import { tv } from "../tv";
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<script setup>
|
|
26
|
-
const props = defineProps({
|
|
27
|
-
label: { type: String, required: false, default: "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C" },
|
|
28
|
-
copiedLabel: { type: String, required: false, default: "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E" },
|
|
29
|
-
value: { type: String, required: true },
|
|
30
|
-
color: { type: null, required: false, default: "neutral" },
|
|
31
|
-
variant: { type: null, required: false, default: "link" },
|
|
32
|
-
size: { type: null, required: false, default: "sm" },
|
|
33
|
-
class: { type: null, required: false },
|
|
34
|
-
ui: { type: null, required: false }
|
|
35
|
-
});
|
|
36
|
-
const appConfig = useAppConfig();
|
|
37
|
-
const { copy, copied } = useClipboard();
|
|
38
|
-
const tooltipText = computed(() => copied.value ? props.copiedLabel : props.label);
|
|
39
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.buttonCopy || {} })());
|
|
40
|
-
</script>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
-
import type { ButtonProps } from '@nuxt/ui';
|
|
3
|
-
import type { ComponentConfig } from '../types';
|
|
4
|
-
import theme from '#build/cms/button-copy';
|
|
5
|
-
type ButtonCopy = ComponentConfig<typeof theme, AppConfig, 'buttonCopy'>;
|
|
6
|
-
export interface ButtonCopyProps {
|
|
7
|
-
label?: string;
|
|
8
|
-
copiedLabel?: string;
|
|
9
|
-
value: string;
|
|
10
|
-
color?: ButtonProps['color'];
|
|
11
|
-
variant?: ButtonProps['variant'];
|
|
12
|
-
size?: ButtonProps['size'];
|
|
13
|
-
class?: any;
|
|
14
|
-
ui?: ButtonCopy['slots'];
|
|
15
|
-
}
|
|
16
|
-
declare const _default: import("vue").DefineComponent<ButtonCopyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonCopyProps> & Readonly<{}>, {
|
|
17
|
-
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
18
|
-
color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
|
|
19
|
-
variant: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link";
|
|
20
|
-
label: string;
|
|
21
|
-
copiedLabel: string;
|
|
22
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
-
export default _default;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
3
|
-
<ProseKit :editor="editor">
|
|
4
|
-
<div ref="editorRef" :class="ui.editor({ class: [props.ui?.editor, 'pl-14'] })" />
|
|
5
|
-
|
|
6
|
-
<BlockMenu />
|
|
7
|
-
<SlashCommand />
|
|
8
|
-
<TooltipMenu />
|
|
9
|
-
</ProseKit>
|
|
10
|
-
</Primitive>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import theme from "#build/cms/editor-content-full";
|
|
15
|
-
import { computed, useAppConfig, useTemplateRef, watchPostEffect } from "#imports";
|
|
16
|
-
import { createEditor } from "prosekit/core";
|
|
17
|
-
import { ProseKit, useDocChange } from "prosekit/vue";
|
|
18
|
-
import { Primitive } from "reka-ui";
|
|
19
|
-
import BlockMenu from "../editor/components/BlockMenu.vue";
|
|
20
|
-
import SlashCommand from "../editor/components/SlashCommand.vue";
|
|
21
|
-
import TooltipMenu from "../editor/components/TooltipMenu.vue";
|
|
22
|
-
import { defineFullExtension } from "../editor/extensions";
|
|
23
|
-
import { docToMarkdown, markdownToDoc } from "../editor/markdown";
|
|
24
|
-
import { tv } from "../tv";
|
|
25
|
-
import "prosekit/basic/style.css";
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<script setup>
|
|
29
|
-
const props = defineProps({
|
|
30
|
-
as: { type: null, required: false },
|
|
31
|
-
class: { type: null, required: false },
|
|
32
|
-
ui: { type: null, required: false }
|
|
33
|
-
});
|
|
34
|
-
const modelValue = defineModel({ type: String, ...{ default: "" } });
|
|
35
|
-
const appConfig = useAppConfig();
|
|
36
|
-
const editor = createEditor({
|
|
37
|
-
extension: defineFullExtension(),
|
|
38
|
-
defaultContent: await markdownToDoc(modelValue.value)
|
|
39
|
-
});
|
|
40
|
-
const editorRef = useTemplateRef("editorRef");
|
|
41
|
-
useDocChange(async () => {
|
|
42
|
-
modelValue.value = await docToMarkdown(editor.getDocJSON());
|
|
43
|
-
}, { editor });
|
|
44
|
-
watchPostEffect((onCleanup) => {
|
|
45
|
-
editor.mount(editorRef.value);
|
|
46
|
-
onCleanup(() => editor.unmount());
|
|
47
|
-
});
|
|
48
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.editorContentFull || {} })());
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<style scoped>
|
|
52
|
-
::v-deep(.editor-content-full){line-height:calc(var(--spacing)*7)}::v-deep(.editor-content-full) [data-placeholder]:before{color:var(--ui-text-dimmed);content:attr(data-placeholder);height:0;pointer-events:none;position:absolute}::v-deep(.editor-content-full) h2,::v-deep(.editor-content-full) h3,::v-deep(.editor-content-full) h4{font-weight:600;margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-full) h2{font-size:var(--text-2xl)}::v-deep(.editor-content-full) h3{font-size:var(--text-xl)}::v-deep(.editor-content-full) h4{font-size:var(--text-lg)}::v-deep(.editor-content-full) blockquote{border-left:4px solid var(--ui-border-accented);margin-block:calc(var(--spacing)*4);padding-inline-start:calc(var(--spacing)*4)}::v-deep(.editor-content-full) [data-node-view-root=true],::v-deep(.editor-content-full)>p{margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-full) hr{border-block-start:1px solid var(--ui-border);margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-full) pre{background-color:var(--ui-bg-muted);border:1px solid var(--ui-border-muted);border-radius:calc(var(--ui-radius)*1.5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:calc(var(--spacing)*6);overflow-x:auto;padding-block:calc(var(--spacing)*3);padding-inline:calc(var(--spacing)*4)}::v-deep(.editor-content-full) p>code{background-color:var(--ui-bg-muted);border:1px solid var(--ui-border-muted);border-radius:calc(var(--ui-radius)*1.5);font-family:var(--font-mono);font-size:var(--text-sm);padding-inline:var(--spacing)}::v-deep(.editor-content-full) a{color:var(--ui-primary);cursor:pointer;text-decoration:underline;-webkit-user-select:all;-moz-user-select:all;user-select:all}
|
|
53
|
-
</style>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
-
import type { ComponentConfig } from '../types';
|
|
3
|
-
import theme from '#build/cms/editor-content-full';
|
|
4
|
-
import 'prosekit/basic/style.css';
|
|
5
|
-
type EditorContentFull = ComponentConfig<typeof theme, AppConfig, 'editorContentFull'>;
|
|
6
|
-
export interface EditorContentFullProps {
|
|
7
|
-
as?: any;
|
|
8
|
-
class?: any;
|
|
9
|
-
ui?: EditorContentFull['slots'];
|
|
10
|
-
}
|
|
11
|
-
declare const _default: import("vue").DefineComponent<EditorContentFullProps & {
|
|
12
|
-
modelValue?: string;
|
|
13
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
-
"update:modelValue": (value: string) => any;
|
|
15
|
-
}, string, import("vue").PublicProps, Readonly<EditorContentFullProps & {
|
|
16
|
-
modelValue?: string;
|
|
17
|
-
}> & Readonly<{
|
|
18
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
19
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
-
export default _default;
|