@hywax/cms-console 1.0.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/.nuxt/cms-console/button-copy-text.ts +19 -0
- package/.nuxt/cms-console/button-delete-confirm.ts +5 -0
- package/.nuxt/cms-console/editor/index.ts +0 -0
- package/.nuxt/cms-console/form-panel-aside-section.ts +9 -0
- package/.nuxt/cms-console/form-panel-section.ts +8 -0
- package/.nuxt/cms-console/form-panel.ts +15 -0
- package/.nuxt/cms-console/index.ts +11 -0
- package/.nuxt/cms-console/input-seo.ts +5 -0
- package/.nuxt/cms-console/input-slug.ts +5 -0
- package/.nuxt/cms-console/input-uplora-image.ts +27 -0
- package/.nuxt/cms-console/modal-confirm.ts +5 -0
- package/.nuxt/cms-console/table-panel.ts +8 -0
- package/.nuxt/cms-console/table-search-input.ts +6 -0
- package/.nuxt/cms-console.css +31 -0
- package/dist/module.d.mts +11 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +387 -0
- package/dist/runtime/components/AutocompleteSelect.d.vue.ts +56 -0
- package/dist/runtime/components/AutocompleteSelect.vue +225 -0
- package/dist/runtime/components/AutocompleteSelect.vue.d.ts +56 -0
- package/dist/runtime/components/ButtonCopyText.d.vue.ts +28 -0
- package/dist/runtime/components/ButtonCopyText.vue +70 -0
- package/dist/runtime/components/ButtonCopyText.vue.d.ts +28 -0
- package/dist/runtime/components/ButtonDeleteConfirm.d.vue.ts +38 -0
- package/dist/runtime/components/ButtonDeleteConfirm.vue +62 -0
- package/dist/runtime/components/ButtonDeleteConfirm.vue.d.ts +38 -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 +139 -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 +73 -0
- package/dist/runtime/components/FormPanel.vue.d.ts +47 -0
- package/dist/runtime/components/FormPanelAsideSection.d.vue.ts +24 -0
- package/dist/runtime/components/FormPanelAsideSection.vue +41 -0
- package/dist/runtime/components/FormPanelAsideSection.vue.d.ts +24 -0
- package/dist/runtime/components/FormPanelSection.d.vue.ts +21 -0
- package/dist/runtime/components/FormPanelSection.vue +31 -0
- package/dist/runtime/components/FormPanelSection.vue.d.ts +21 -0
- package/dist/runtime/components/InputSeo.d.vue.ts +21 -0
- package/dist/runtime/components/InputSeo.vue +73 -0
- package/dist/runtime/components/InputSeo.vue.d.ts +21 -0
- package/dist/runtime/components/InputSlug.d.vue.ts +30 -0
- package/dist/runtime/components/InputSlug.vue +70 -0
- package/dist/runtime/components/InputSlug.vue.d.ts +30 -0
- package/dist/runtime/components/InputUploraImage.d.vue.ts +39 -0
- package/dist/runtime/components/InputUploraImage.vue +163 -0
- package/dist/runtime/components/InputUploraImage.vue.d.ts +39 -0
- package/dist/runtime/components/Layout.d.vue.ts +30 -0
- package/dist/runtime/components/Layout.vue +82 -0
- package/dist/runtime/components/Layout.vue.d.ts +30 -0
- package/dist/runtime/components/ModalConfirm.d.vue.ts +33 -0
- package/dist/runtime/components/ModalConfirm.vue +97 -0
- package/dist/runtime/components/ModalConfirm.vue.d.ts +33 -0
- package/dist/runtime/components/TableColumnSorting.d.vue.ts +17 -0
- package/dist/runtime/components/TableColumnSorting.vue +81 -0
- 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 +110 -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 +199 -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 +297 -0
- package/dist/runtime/components/TablePanel.vue.d.ts +95 -0
- package/dist/runtime/components/TableSearchInput.d.vue.ts +33 -0
- package/dist/runtime/components/TableSearchInput.vue +97 -0
- package/dist/runtime/components/TableSearchInput.vue.d.ts +33 -0
- package/dist/runtime/composables/useAdmin.d.ts +6 -0
- package/dist/runtime/composables/useAdmin.js +14 -0
- package/dist/runtime/composables/useEditorDragHandle.d.ts +17 -0
- package/dist/runtime/composables/useEditorDragHandle.js +95 -0
- package/dist/runtime/composables/useEditorSuggestions.d.ts +74 -0
- package/dist/runtime/composables/useEditorSuggestions.js +25 -0
- package/dist/runtime/composables/useEditorToolbar.d.ts +121 -0
- package/dist/runtime/composables/useEditorToolbar.js +87 -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/useSeoStats.d.ts +12 -0
- package/dist/runtime/composables/useSeoStats.js +44 -0
- package/dist/runtime/composables/useTable.d.ts +25 -0
- package/dist/runtime/composables/useTable.js +84 -0
- package/dist/runtime/composables/useTableColumns.d.ts +28 -0
- package/dist/runtime/composables/useTableColumns.js +54 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImage.d.ts +18 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImage.js +42 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.d.vue.ts +4 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue +23 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue.d.ts +4 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/tv.d.ts +1 -0
- package/dist/runtime/tv.js +4 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/date.d.ts +5 -0
- package/dist/runtime/types/date.js +0 -0
- package/dist/runtime/types/dictionaries.d.ts +1 -0
- package/dist/runtime/types/dictionaries.js +0 -0
- package/dist/runtime/types/index.d.ts +30 -0
- package/dist/runtime/types/index.js +30 -0
- package/dist/runtime/types/seo.d.ts +4 -0
- package/dist/runtime/types/seo.js +0 -0
- package/dist/runtime/utils/auth.d.ts +2 -0
- package/dist/runtime/utils/auth.js +5 -0
- package/dist/runtime/utils/date.d.ts +5 -0
- package/dist/runtime/utils/date.js +15 -0
- package/dist/runtime/utils/formatters.d.ts +5 -0
- package/dist/runtime/utils/formatters.js +24 -0
- package/dist/runtime/utils/index.d.ts +4 -0
- package/dist/runtime/utils/index.js +4 -0
- package/dist/runtime/utils/slugify.d.ts +1 -0
- package/dist/runtime/utils/slugify.js +11 -0
- package/dist/types.d.mts +11 -0
- package/package.json +89 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed, toValue } from "#imports";
|
|
2
|
+
function computeScore(length, recommendedLength, maxLength) {
|
|
3
|
+
if (length === 0) {
|
|
4
|
+
return 0;
|
|
5
|
+
}
|
|
6
|
+
if (length < recommendedLength) {
|
|
7
|
+
return length / recommendedLength * 100;
|
|
8
|
+
}
|
|
9
|
+
if (length > maxLength) {
|
|
10
|
+
return Math.max(0, 100 - (length - maxLength) / maxLength * 100);
|
|
11
|
+
}
|
|
12
|
+
return 100;
|
|
13
|
+
}
|
|
14
|
+
function computeColor(score) {
|
|
15
|
+
if (score < 30) {
|
|
16
|
+
return "error";
|
|
17
|
+
}
|
|
18
|
+
if (score < 70) {
|
|
19
|
+
return "warning";
|
|
20
|
+
}
|
|
21
|
+
return "success";
|
|
22
|
+
}
|
|
23
|
+
export function useSeoStats(options) {
|
|
24
|
+
const title = computed(() => {
|
|
25
|
+
const value = toValue(options);
|
|
26
|
+
const score = computeScore(value.title.length, 45, 60);
|
|
27
|
+
return {
|
|
28
|
+
progress: Math.round(score),
|
|
29
|
+
color: computeColor(score)
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
const description = computed(() => {
|
|
33
|
+
const value = toValue(options);
|
|
34
|
+
const score = computeScore(value.description.length, 130, 160);
|
|
35
|
+
return {
|
|
36
|
+
progress: Math.round(score),
|
|
37
|
+
color: computeColor(score)
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
title,
|
|
42
|
+
description
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PaginationQuery, RequiredOptional, SortQuery } from '@hywax/cms-runtime';
|
|
2
|
+
import type { SortingState } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
4
|
+
import type { GetQueryTransforms } from '../types';
|
|
5
|
+
interface UseTableOptions<T> {
|
|
6
|
+
query?: {
|
|
7
|
+
enabled?: true | false;
|
|
8
|
+
transform: GetQueryTransforms<T>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface UseTableReturn<T> {
|
|
12
|
+
source: ComputedRef<T>;
|
|
13
|
+
filters: Ref<T>;
|
|
14
|
+
updateFilters: (value: Partial<T>) => void;
|
|
15
|
+
sorting: Ref<SortingState>;
|
|
16
|
+
pagination: Ref<PaginationQuery>;
|
|
17
|
+
query: ComputedRef<T & PaginationQuery & SortQuery | object>;
|
|
18
|
+
}
|
|
19
|
+
export declare function useTableFilters<T extends Record<string, any>>(initialFilters: MaybeRefOrGetter<T>, options?: UseTableOptions<T>): {
|
|
20
|
+
initial: ComputedRef<T>;
|
|
21
|
+
filters: Ref<T, T>;
|
|
22
|
+
updateFilters: (value: Partial<T>) => void;
|
|
23
|
+
};
|
|
24
|
+
export default function useTable<T extends Record<string, any>>(initialFilters: MaybeRefOrGetter<RequiredOptional<T>>, options?: UseTableOptions<RequiredOptional<T>>): UseTableReturn<RequiredOptional<T>>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import copy from "fast-copy";
|
|
2
|
+
import { computed, ref, toValue, watch } from "vue";
|
|
3
|
+
import { useQueryState } from "../composables/useQueryState.js";
|
|
4
|
+
export function useTableFilters(initialFilters, options) {
|
|
5
|
+
const initial = computed(() => toValue(initialFilters));
|
|
6
|
+
const filters = options?.query?.enabled ? useQueryState(initial, options.query.transform) : ref(initial.value);
|
|
7
|
+
watch(initial, (initial2) => {
|
|
8
|
+
filters.value = copy(initial2);
|
|
9
|
+
});
|
|
10
|
+
const updateFilters = (value) => {
|
|
11
|
+
Object.assign(filters.value, value);
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
initial,
|
|
15
|
+
filters,
|
|
16
|
+
updateFilters
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function useTablePagination(options) {
|
|
20
|
+
const initialPagination = { page: 1, perPage: 20 };
|
|
21
|
+
const pagination = options?.query?.enabled ? useQueryState(initialPagination, { page: "number", perPage: "number" }) : ref(initialPagination);
|
|
22
|
+
watch(() => pagination.value.perPage, () => {
|
|
23
|
+
if (pagination.value.page !== 1) {
|
|
24
|
+
pagination.value.page = 1;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return { pagination };
|
|
28
|
+
}
|
|
29
|
+
function useTableSort(query) {
|
|
30
|
+
const initialSort = { "sort.column": null, "sort.type": "asc" };
|
|
31
|
+
const state = query ? useQueryState(initialSort, {}) : ref(initialSort);
|
|
32
|
+
const sort = computed(() => {
|
|
33
|
+
if (!state.value["sort.column"]) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return { sortColumn: state.value["sort.column"], sortType: state.value["sort.type"] };
|
|
37
|
+
});
|
|
38
|
+
const sorting = computed({
|
|
39
|
+
get: () => {
|
|
40
|
+
if (!state.value["sort.column"]) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return [{ id: state.value["sort.column"], desc: state.value["sort.type"] === "desc" }];
|
|
44
|
+
},
|
|
45
|
+
set: (value) => {
|
|
46
|
+
if (value.length === 0) {
|
|
47
|
+
state.value = { "sort.column": null, "sort.type": "asc" };
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const { id, desc } = value[0];
|
|
51
|
+
state.value = { "sort.column": id, "sort.type": desc ? "desc" : "asc" };
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return { sort, sorting };
|
|
55
|
+
}
|
|
56
|
+
export default function useTable(initialFilters, options) {
|
|
57
|
+
const {
|
|
58
|
+
initial,
|
|
59
|
+
filters,
|
|
60
|
+
updateFilters
|
|
61
|
+
} = useTableFilters(initialFilters, options);
|
|
62
|
+
const { sort, sorting } = useTableSort();
|
|
63
|
+
const { pagination } = useTablePagination(options);
|
|
64
|
+
const query = computed(() => {
|
|
65
|
+
return {
|
|
66
|
+
...filters.value,
|
|
67
|
+
...sort.value,
|
|
68
|
+
...pagination.value
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
watch(filters, () => {
|
|
72
|
+
if (pagination.value.page !== 1) {
|
|
73
|
+
pagination.value.page = 1;
|
|
74
|
+
}
|
|
75
|
+
}, { deep: true });
|
|
76
|
+
return {
|
|
77
|
+
source: initial,
|
|
78
|
+
filters,
|
|
79
|
+
sorting,
|
|
80
|
+
pagination,
|
|
81
|
+
updateFilters,
|
|
82
|
+
query
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 useTableFiltersFields<S extends FormSchema, F extends readonly FiltersField<S>[]>(_schema: S, fields: F): {
|
|
11
|
+
filtersFields: {
|
|
12
|
+
-readonly [P in keyof F]: F[P];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type TableColumnFormat = 'number' | 'date' | 'date-time';
|
|
16
|
+
export type TableColumnCustom<T extends TableData, D = unknown> = TableColumn<T, D> & {
|
|
17
|
+
format?: TableColumnFormat;
|
|
18
|
+
to?: ((row: TableRow<T>) => RouteLocationRaw | string | undefined) | RouteLocationRaw | string | undefined;
|
|
19
|
+
target?: ButtonProps['target'];
|
|
20
|
+
emptyValue?: string;
|
|
21
|
+
image?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function useTableColumns<I extends Record<string, any>, T extends readonly TableColumnCustom<I>[] = readonly TableColumnCustom<I>[]>(columns: T): {
|
|
25
|
+
columns: {
|
|
26
|
+
-readonly [P in keyof T]: T[P];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { UUser } from "#components";
|
|
2
|
+
import { h } from "vue";
|
|
3
|
+
import { formatDate, formatDateTime, formatNumber } from "../utils/index.js";
|
|
4
|
+
export function useTableFiltersFields(_schema, fields) {
|
|
5
|
+
return { filtersFields: fields };
|
|
6
|
+
}
|
|
7
|
+
function applyFormat(value, column) {
|
|
8
|
+
if (value === void 0 || value === null || !column.format) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
if (column.format === "number") {
|
|
12
|
+
return formatNumber(value);
|
|
13
|
+
}
|
|
14
|
+
if (column.format === "date") {
|
|
15
|
+
return value ? formatDate(value) : column.emptyValue;
|
|
16
|
+
}
|
|
17
|
+
if (column.format === "date-time") {
|
|
18
|
+
return value ? formatDateTime(value) : column.emptyValue;
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function transformColumn(column) {
|
|
23
|
+
const col = {
|
|
24
|
+
...column,
|
|
25
|
+
cell: column.cell ?? (({ getValue, row }) => {
|
|
26
|
+
const value = applyFormat(getValue(), column);
|
|
27
|
+
if (!value && typeof value !== "number") {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
if (column.to) {
|
|
31
|
+
return h(UUser, {
|
|
32
|
+
to: typeof column.to === "function" ? column.to(row) : column.to,
|
|
33
|
+
target: column.target,
|
|
34
|
+
name: value.toString(),
|
|
35
|
+
class: "inline-flex",
|
|
36
|
+
ui: {
|
|
37
|
+
name: "text-primary",
|
|
38
|
+
avatar: "group-hover/user:scale-100"
|
|
39
|
+
},
|
|
40
|
+
avatar: column.image ? { src: column.image, size: "sm", alt: value.toString() } : void 0,
|
|
41
|
+
description: column.description
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
if (column.format === "number") {
|
|
48
|
+
col.meta = { ...col.meta, class: { td: "text-right tabular-nums", th: "text-right tabular-nums" } };
|
|
49
|
+
}
|
|
50
|
+
return col;
|
|
51
|
+
}
|
|
52
|
+
export function useTableColumns(columns) {
|
|
53
|
+
return { columns: columns.map((c) => transformColumn(c)) };
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { Node } from '@tiptap/core';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
uploraImage: {
|
|
6
|
+
insertUploraImage: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const UploraImageHandlers: {
|
|
11
|
+
uploraImage: {
|
|
12
|
+
canExecute: (editor: Editor) => boolean;
|
|
13
|
+
execute: (editor: Editor) => import("@tiptap/core").ChainedCommands;
|
|
14
|
+
isActive: (editor: Editor) => boolean;
|
|
15
|
+
isDisabled: undefined;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const UploraImage: Node<any, any>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
import EditorUploraImageNodeComponent from "./EditorUploraImageNode.vue";
|
|
4
|
+
export const UploraImageHandlers = {
|
|
5
|
+
uploraImage: {
|
|
6
|
+
canExecute: (editor) => editor.can().insertContent({ type: "uploraImage" }),
|
|
7
|
+
execute: (editor) => editor.chain().focus().insertContent({ type: "uploraImage" }),
|
|
8
|
+
isActive: (editor) => editor.isActive("uploraImage"),
|
|
9
|
+
isDisabled: void 0
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export const UploraImage = Node.create({
|
|
13
|
+
name: "uploraImage",
|
|
14
|
+
group: "block",
|
|
15
|
+
atom: true,
|
|
16
|
+
draggable: true,
|
|
17
|
+
addAttributes() {
|
|
18
|
+
return {
|
|
19
|
+
image: { default: "" },
|
|
20
|
+
alt: { default: "" },
|
|
21
|
+
lqip: { default: "" }
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
parseHTML() {
|
|
25
|
+
return [{
|
|
26
|
+
tag: 'div[data-type="uplora-image"]'
|
|
27
|
+
}];
|
|
28
|
+
},
|
|
29
|
+
renderHTML({ HTMLAttributes }) {
|
|
30
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "uplora-image" })];
|
|
31
|
+
},
|
|
32
|
+
addNodeView() {
|
|
33
|
+
return VueNodeViewRenderer(EditorUploraImageNodeComponent);
|
|
34
|
+
},
|
|
35
|
+
addCommands() {
|
|
36
|
+
return {
|
|
37
|
+
insertUploraImage: () => ({ commands }) => {
|
|
38
|
+
return commands.insertContent({ type: this.name });
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NodeViewWrapper>
|
|
3
|
+
<InputUploraImage />
|
|
4
|
+
</NodeViewWrapper>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { NodeViewWrapper } from "@tiptap/vue-3";
|
|
9
|
+
import InputUploraImage from "../../components/InputUploraImage.vue";
|
|
10
|
+
defineProps({
|
|
11
|
+
decorations: { type: Array, required: true },
|
|
12
|
+
selected: { type: Boolean, required: true },
|
|
13
|
+
updateAttributes: { type: Function, required: true },
|
|
14
|
+
deleteNode: { type: Function, required: true },
|
|
15
|
+
node: { type: null, required: true },
|
|
16
|
+
view: { type: null, required: true },
|
|
17
|
+
getPos: { type: null, required: true },
|
|
18
|
+
innerDecorations: { type: null, required: true },
|
|
19
|
+
editor: { type: Object, required: true },
|
|
20
|
+
extension: { type: Object, required: true },
|
|
21
|
+
HTMLAttributes: { type: Object, required: true }
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@hywax/cms-runtime";@import "#build/cms-console.css";@source "./components";@source "./editor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tv: import("tailwind-variants").TV;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Country = 'ru' | 'us';
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from '../components/AutocompleteSelect.vue';
|
|
2
|
+
export * from '../components/ButtonCopyText.vue';
|
|
3
|
+
export * from '../components/ButtonDeleteConfirm.vue';
|
|
4
|
+
export * from '../components/DatePicker.vue';
|
|
5
|
+
export * from '../components/EditorFull.vue';
|
|
6
|
+
export * from '../components/EditorLinkPopover.vue';
|
|
7
|
+
export * from '../components/FormPanel.vue';
|
|
8
|
+
export * from '../components/FormPanelAsideSection.vue';
|
|
9
|
+
export * from '../components/FormPanelSection.vue';
|
|
10
|
+
export * from '../components/InputSeo.vue';
|
|
11
|
+
export * from '../components/InputSlug.vue';
|
|
12
|
+
export * from '../components/InputUploraImage.vue';
|
|
13
|
+
export * from '../components/Layout.vue';
|
|
14
|
+
export * from '../components/ModalConfirm.vue';
|
|
15
|
+
export * from '../components/TableColumnSorting.vue';
|
|
16
|
+
export * from '../components/TableFilters.vue';
|
|
17
|
+
export * from '../components/TablePanel.vue';
|
|
18
|
+
export * from '../components/TableSearchInput.vue';
|
|
19
|
+
export * from '../composables/useAdmin';
|
|
20
|
+
export * from '../composables/useEditorDragHandle';
|
|
21
|
+
export * from '../composables/useEditorSuggestions';
|
|
22
|
+
export * from '../composables/useEditorToolbar';
|
|
23
|
+
export * from '../composables/useQueryState';
|
|
24
|
+
export * from '../composables/useRouteQuery';
|
|
25
|
+
export * from '../composables/useSeoStats';
|
|
26
|
+
export * from '../composables/useTable';
|
|
27
|
+
export * from '../composables/useTableColumns';
|
|
28
|
+
export * from './date';
|
|
29
|
+
export * from './dictionaries';
|
|
30
|
+
export * from './seo';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from "../components/AutocompleteSelect.vue";
|
|
2
|
+
export * from "../components/ButtonCopyText.vue";
|
|
3
|
+
export * from "../components/ButtonDeleteConfirm.vue";
|
|
4
|
+
export * from "../components/DatePicker.vue";
|
|
5
|
+
export * from "../components/EditorFull.vue";
|
|
6
|
+
export * from "../components/EditorLinkPopover.vue";
|
|
7
|
+
export * from "../components/FormPanel.vue";
|
|
8
|
+
export * from "../components/FormPanelAsideSection.vue";
|
|
9
|
+
export * from "../components/FormPanelSection.vue";
|
|
10
|
+
export * from "../components/InputSeo.vue";
|
|
11
|
+
export * from "../components/InputSlug.vue";
|
|
12
|
+
export * from "../components/InputUploraImage.vue";
|
|
13
|
+
export * from "../components/Layout.vue";
|
|
14
|
+
export * from "../components/ModalConfirm.vue";
|
|
15
|
+
export * from "../components/TableColumnSorting.vue";
|
|
16
|
+
export * from "../components/TableFilters.vue";
|
|
17
|
+
export * from "../components/TablePanel.vue";
|
|
18
|
+
export * from "../components/TableSearchInput.vue";
|
|
19
|
+
export * from "../composables/useAdmin.js";
|
|
20
|
+
export * from "../composables/useEditorDragHandle.js";
|
|
21
|
+
export * from "../composables/useEditorSuggestions.js";
|
|
22
|
+
export * from "../composables/useEditorToolbar.js";
|
|
23
|
+
export * from "../composables/useQueryState.js";
|
|
24
|
+
export * from "../composables/useRouteQuery.js";
|
|
25
|
+
export * from "../composables/useSeoStats.js";
|
|
26
|
+
export * from "../composables/useTable.js";
|
|
27
|
+
export * from "../composables/useTableColumns.js";
|
|
28
|
+
export * from "./date.js";
|
|
29
|
+
export * from "./dictionaries.js";
|
|
30
|
+
export * from "./seo.js";
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DateLike } from '@vueuse/core';
|
|
2
|
+
export declare function formatDateTime(date: DateLike): string;
|
|
3
|
+
export declare function formatDate(date: DateLike): string;
|
|
4
|
+
export declare function formatTime(date: DateLike): string;
|
|
5
|
+
export declare function formatServerDateTime(date: DateLike): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getCmsConfig } from "#imports";
|
|
2
|
+
import { formatDate as format, normalizeDate } from "@vueuse/core";
|
|
3
|
+
export function formatDateTime(date) {
|
|
4
|
+
return normalizeDate(date).toLocaleString("ru-RU");
|
|
5
|
+
}
|
|
6
|
+
export function formatDate(date) {
|
|
7
|
+
return normalizeDate(date).toLocaleDateString("ru-RU");
|
|
8
|
+
}
|
|
9
|
+
export function formatTime(date) {
|
|
10
|
+
return normalizeDate(date).toLocaleTimeString("ru-RU");
|
|
11
|
+
}
|
|
12
|
+
export function formatServerDateTime(date) {
|
|
13
|
+
const { formats } = getCmsConfig();
|
|
14
|
+
return format(normalizeDate(date), formats.serverDateTime);
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Country } from '../types';
|
|
2
|
+
export declare function formatMoney(value: number, country?: Country, locales?: Intl.LocalesArgument): string;
|
|
3
|
+
export declare function formatNumber(value: number, locales?: Intl.LocalesArgument): string;
|
|
4
|
+
export declare function formatPercentage(value: number, locales?: Intl.LocalesArgument): string;
|
|
5
|
+
export declare function formatBoolean(value: boolean | undefined | null): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const currencies = {
|
|
2
|
+
ru: "RUB",
|
|
3
|
+
us: "USD"
|
|
4
|
+
};
|
|
5
|
+
export function formatMoney(value, country = "ru", locales = "ru-RU") {
|
|
6
|
+
return value.toLocaleString(locales, {
|
|
7
|
+
style: "currency",
|
|
8
|
+
currency: currencies[country],
|
|
9
|
+
currencyDisplay: "narrowSymbol"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function formatNumber(value, locales = "ru-RU") {
|
|
13
|
+
return value.toLocaleString(locales, {
|
|
14
|
+
style: "decimal"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function formatPercentage(value, locales = "ru-RU") {
|
|
18
|
+
return value.toLocaleString(locales, {
|
|
19
|
+
style: "percent"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function formatBoolean(value) {
|
|
23
|
+
return value ? "\u0414\u0430" : "\u041D\u0435\u0442";
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function slugify(text?: string): string;
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
+
|
|
3
|
+
import type { default as Module } from './module.mjs'
|
|
4
|
+
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
+
|
|
7
|
+
export { default } from './module.mjs'
|
|
8
|
+
|
|
9
|
+
export { type CMSConsoleOptions } from './module.mjs'
|
|
10
|
+
|
|
11
|
+
export * from '../dist/runtime/types/index.js'
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hywax/cms-console",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"packageManager": "pnpm@10.27.0",
|
|
6
|
+
"description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/hywax/cms.git"
|
|
10
|
+
},
|
|
11
|
+
"imports": {
|
|
12
|
+
"#build/cms-console/*": "./.nuxt/cms-console/*.ts",
|
|
13
|
+
"#build/cms-console.css": "./.nuxt/cms-console.css"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/module.d.mts",
|
|
18
|
+
"style": "./dist/runtime/index.css",
|
|
19
|
+
"import": "./dist/module.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./runtime/*": "./dist/runtime/*",
|
|
22
|
+
"./utils": {
|
|
23
|
+
"types": "./dist/runtime/utils/index.d.ts",
|
|
24
|
+
"import": "./dist/runtime/utils/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./utils/*": {
|
|
27
|
+
"types": "./dist/runtime/utils/*.d.ts",
|
|
28
|
+
"import": "./dist/runtime/utils/*.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/module.mjs",
|
|
32
|
+
"typesVersions": {
|
|
33
|
+
"*": {
|
|
34
|
+
".": [
|
|
35
|
+
"./dist/module.d.mts"
|
|
36
|
+
],
|
|
37
|
+
"./runtime/*": [
|
|
38
|
+
"./dist/runtime/*"
|
|
39
|
+
],
|
|
40
|
+
"./utils": [
|
|
41
|
+
"./dist/runtime/utils/index.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"./utils/*": [
|
|
44
|
+
"./dist/runtime/utils/*.d.ts"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"style": "./dist/runtime/index.css",
|
|
49
|
+
"files": [
|
|
50
|
+
".nuxt/cms-console",
|
|
51
|
+
".nuxt/cms-console.css",
|
|
52
|
+
"dist"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@nuxt/kit": "catalog:",
|
|
56
|
+
"@sindresorhus/slugify": "^3.0.0",
|
|
57
|
+
"@unovis/ts": "^1.6.2",
|
|
58
|
+
"@unovis/vue": "^1.6.2",
|
|
59
|
+
"defu": "catalog:",
|
|
60
|
+
"fast-copy": "^3.0.2",
|
|
61
|
+
"fast-equals": "^5.4.0",
|
|
62
|
+
"pathe": "catalog:",
|
|
63
|
+
"scule": "catalog:",
|
|
64
|
+
"sortablejs": "^1.15.6",
|
|
65
|
+
"@hywax/cms-runtime": "1.0.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@nuxt/devtools": "catalog:",
|
|
69
|
+
"@nuxt/module-builder": "catalog:",
|
|
70
|
+
"@nuxt/schema": "catalog:",
|
|
71
|
+
"@nuxt/test-utils": "catalog:",
|
|
72
|
+
"@types/sortablejs": "^1.15.9",
|
|
73
|
+
"@vue/test-utils": "catalog:",
|
|
74
|
+
"happy-dom": "catalog:",
|
|
75
|
+
"nuxt": "catalog:",
|
|
76
|
+
"typescript": "catalog:",
|
|
77
|
+
"vitest": "catalog:",
|
|
78
|
+
"vue-tsc": "catalog:"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"release": "pnpm publish --access public",
|
|
82
|
+
"build": "nuxt-module-build build",
|
|
83
|
+
"module:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare",
|
|
84
|
+
"test": "vitest run",
|
|
85
|
+
"test:watch": "vitest watch",
|
|
86
|
+
"typecheck": "vue-tsc --noEmit",
|
|
87
|
+
"clean": "rm -rf .nuxt .output node_modules dist"
|
|
88
|
+
}
|
|
89
|
+
}
|