@hywax/cms 1.10.0 → 2.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/config.ts +7 -1
- package/.nuxt/cms/editor/uplora-image.ts +5 -0
- package/.nuxt/cms/index.ts +4 -1
- package/.nuxt/cms/input-seo.ts +5 -0
- package/.nuxt/cms/input-slug.ts +5 -0
- package/.nuxt/cms/input-uplora-image.ts +27 -0
- package/.nuxt/cms.css +1 -29
- package/dist/module.d.mts +20 -5
- package/dist/module.json +2 -2
- package/dist/module.mjs +289 -100
- package/dist/runtime/components/AutocompleteSelect.d.vue.ts +3 -3
- package/dist/runtime/components/AutocompleteSelect.vue.d.ts +3 -3
- package/dist/runtime/components/ButtonCopyText.d.vue.ts +2 -2
- package/dist/runtime/components/ButtonCopyText.vue.d.ts +2 -2
- package/dist/runtime/components/ButtonDeleteConfirm.vue +3 -3
- package/dist/runtime/components/DatePicker.d.vue.ts +3 -3
- package/dist/runtime/components/DatePicker.vue +1 -2
- package/dist/runtime/components/DatePicker.vue.d.ts +3 -3
- package/dist/runtime/components/EditorFull.d.vue.ts +7 -6
- package/dist/runtime/components/EditorFull.vue +23 -8
- package/dist/runtime/components/EditorFull.vue.d.ts +7 -6
- package/dist/runtime/components/FormPanelAsideSection.vue +2 -1
- package/dist/runtime/components/FormPanelSection.vue +2 -1
- package/dist/runtime/components/InputSeo.d.vue.ts +20 -0
- package/dist/runtime/components/InputSeo.vue +74 -0
- package/dist/runtime/components/InputSeo.vue.d.ts +20 -0
- package/dist/runtime/components/InputSlug.d.vue.ts +30 -0
- package/dist/runtime/components/InputSlug.vue +71 -0
- package/dist/runtime/components/InputSlug.vue.d.ts +30 -0
- package/dist/runtime/components/InputUploraImage.d.vue.ts +40 -0
- package/dist/runtime/components/InputUploraImage.vue +181 -0
- package/dist/runtime/components/InputUploraImage.vue.d.ts +40 -0
- package/dist/runtime/components/ModalConfirm.d.vue.ts +0 -1
- package/dist/runtime/components/ModalConfirm.vue +2 -4
- package/dist/runtime/components/ModalConfirm.vue.d.ts +0 -1
- package/dist/runtime/components/TableColumnVisibility.vue +1 -2
- package/dist/runtime/components/TableFilters.d.vue.ts +1 -1
- package/dist/runtime/components/TableFilters.vue +12 -11
- package/dist/runtime/components/TableFilters.vue.d.ts +1 -1
- package/dist/runtime/components/TablePanel.vue +6 -6
- package/dist/runtime/components/UploraImage.d.vue.ts +2 -1
- package/dist/runtime/components/UploraImage.vue +7 -4
- package/dist/runtime/components/UploraImage.vue.d.ts +2 -1
- package/dist/runtime/components/prose/UploraImage.d.vue.ts +3 -3
- package/dist/runtime/components/prose/UploraImage.vue +11 -5
- package/dist/runtime/components/prose/UploraImage.vue.d.ts +3 -3
- package/dist/runtime/composables/useEditorDragHandle.d.ts +2 -1
- package/dist/runtime/composables/useEditorDragHandle.js +2 -2
- package/dist/runtime/composables/useEditorSuggestions.d.ts +7 -1
- package/dist/runtime/composables/useEditorSuggestions.js +2 -1
- package/dist/runtime/composables/useEditorToolbar.d.ts +2 -1
- package/dist/runtime/composables/useFormState.js +2 -2
- package/dist/runtime/composables/useModal.js +1 -1
- package/dist/runtime/composables/useSeoStats.d.ts +12 -0
- package/dist/runtime/composables/useSeoStats.js +44 -0
- package/dist/runtime/composables/useTable.d.ts +1 -2
- package/dist/runtime/composables/useTable.js +2 -2
- package/dist/runtime/composables/useTableColumns.js +1 -2
- package/dist/runtime/editor/uplora-image/EditorUploraImage.d.ts +18 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImage.js +43 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.d.vue.ts +9 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue +28 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue.d.ts +9 -0
- package/dist/runtime/editor/utils.d.ts +13 -0
- package/dist/runtime/editor/utils.js +73 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/server/api/uplora/index.post.d.ts +1 -0
- package/dist/runtime/server/api/uplora/index.post.js +1 -0
- package/dist/runtime/types/index.d.ts +36 -3
- package/dist/runtime/types/index.js +36 -1
- package/dist/runtime/types/tv.d.ts +1 -1
- package/dist/runtime/utils/date.d.ts +0 -4
- package/dist/runtime/utils/date.js +0 -15
- package/dist/runtime/utils/formatters.d.ts +2 -1
- package/dist/runtime/utils/index.d.ts +0 -1
- package/dist/runtime/utils/index.js +0 -1
- package/dist/runtime/utils/slugify.js +2 -1
- package/dist/types.d.mts +2 -0
- package/package.json +19 -25
- package/cli/commands/make/component.mjs +0 -75
- package/cli/commands/make/index.mjs +0 -12
- package/cli/index.mjs +0 -15
- package/cli/package.json +0 -13
- package/cli/templates.mjs +0 -102
- package/cli/utils.mjs +0 -31
- package/dist/runtime/composables/useRowSelection.d.ts +0 -8
- package/dist/runtime/composables/useRowSelection.js +0 -46
- package/dist/runtime/types/dictionaries.d.ts +0 -1
- package/dist/runtime/types/dictionaries.js +0 -0
- package/dist/runtime/utils/features.d.ts +0 -4
- package/dist/runtime/utils/features.js +0 -13
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { SEO } from '../types';
|
|
3
|
+
interface SEOStats {
|
|
4
|
+
progress: number;
|
|
5
|
+
color: 'error' | 'warning' | 'success';
|
|
6
|
+
}
|
|
7
|
+
interface UseSeoStatsReturn {
|
|
8
|
+
title: ComputedRef<SEOStats>;
|
|
9
|
+
description: ComputedRef<SEOStats>;
|
|
10
|
+
}
|
|
11
|
+
export declare function useSeoStats(options: MaybeRefOrGetter<SEO>): UseSeoStatsReturn;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed, toValue } from "vue";
|
|
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
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { SortingState } from '@tanstack/vue-table';
|
|
2
2
|
import type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
-
import type { PaginationQuery, RequiredOptional, SortQuery } from '../types';
|
|
4
|
-
import type { GetQueryTransforms } from './useQueryState';
|
|
3
|
+
import type { GetQueryTransforms, PaginationQuery, RequiredOptional, SortQuery } from '../types';
|
|
5
4
|
interface UseTableOptions<T> {
|
|
6
5
|
query?: {
|
|
7
6
|
enabled?: true | false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import copy from "fast-copy";
|
|
1
|
+
import { copy } from "fast-copy";
|
|
2
2
|
import { computed, ref, toValue, watch } from "vue";
|
|
3
|
-
import { useQueryState } from "
|
|
3
|
+
import { useQueryState } from "../composables/useQueryState.js";
|
|
4
4
|
export function useTableFilters(initialFilters, options) {
|
|
5
5
|
const initial = computed(() => toValue(initialFilters));
|
|
6
6
|
const filters = options?.query?.enabled ? useQueryState(initial, options.query.transform) : ref(initial.value);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UUser } from "#components";
|
|
2
2
|
import { h } from "vue";
|
|
3
|
-
import { formatDate, formatDateTime } from "../utils/
|
|
4
|
-
import { formatNumber } from "../utils/formatters.js";
|
|
3
|
+
import { formatDate, formatDateTime, formatNumber } from "../utils/index.js";
|
|
5
4
|
export function useTableFiltersFields(_schema, fields) {
|
|
6
5
|
return { filtersFields: fields };
|
|
7
6
|
}
|
|
@@ -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
|
+
'uplora-image': {
|
|
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,43 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
import { createAtomBlockMarkdownSpec } from "../utils.js";
|
|
4
|
+
import EditorUploraImageNodeComponent from "./EditorUploraImageNode.vue";
|
|
5
|
+
export const UploraImageHandlers = {
|
|
6
|
+
"uplora-image": {
|
|
7
|
+
canExecute: (editor) => editor.can().insertContent({ type: "uplora-image" }),
|
|
8
|
+
execute: (editor) => editor.chain().focus().insertContent({ type: "uplora-image" }),
|
|
9
|
+
isActive: (editor) => editor.isActive("uplora-image"),
|
|
10
|
+
isDisabled: void 0
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const UploraImage = Node.create({
|
|
14
|
+
name: "uplora-image",
|
|
15
|
+
group: "block",
|
|
16
|
+
atom: true,
|
|
17
|
+
addAttributes() {
|
|
18
|
+
return {
|
|
19
|
+
image: {},
|
|
20
|
+
alt: {},
|
|
21
|
+
color: {}
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
...createAtomBlockMarkdownSpec({ name: "uplora-image" }),
|
|
25
|
+
parseHTML() {
|
|
26
|
+
return [{
|
|
27
|
+
tag: 'div[data-type="uplora-image"]'
|
|
28
|
+
}];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes }) {
|
|
31
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "uplora-image" })];
|
|
32
|
+
},
|
|
33
|
+
addNodeView() {
|
|
34
|
+
return VueNodeViewRenderer(EditorUploraImageNodeComponent);
|
|
35
|
+
},
|
|
36
|
+
addCommands() {
|
|
37
|
+
return {
|
|
38
|
+
insertUploraImage: () => ({ commands }) => {
|
|
39
|
+
return commands.insertContent({ type: this.name });
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
export interface EditorUploraImageNodeAttrs {
|
|
3
|
+
image?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NodeViewWrapper>
|
|
3
|
+
<InputUploraImage v-model="attrs" />
|
|
4
|
+
</NodeViewWrapper>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { NodeViewWrapper } from "@tiptap/vue-3";
|
|
9
|
+
import { computed } from "vue";
|
|
10
|
+
import InputUploraImage from "../../components/InputUploraImage.vue";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
decorations: { type: Array, required: true },
|
|
13
|
+
selected: { type: Boolean, required: true },
|
|
14
|
+
updateAttributes: { type: Function, required: true },
|
|
15
|
+
deleteNode: { type: Function, required: true },
|
|
16
|
+
node: { type: null, required: true },
|
|
17
|
+
view: { type: null, required: true },
|
|
18
|
+
getPos: { type: null, required: true },
|
|
19
|
+
innerDecorations: { type: null, required: true },
|
|
20
|
+
editor: { type: Object, required: true },
|
|
21
|
+
extension: { type: Object, required: true },
|
|
22
|
+
HTMLAttributes: { type: Object, required: true }
|
|
23
|
+
});
|
|
24
|
+
const attrs = computed({
|
|
25
|
+
get: () => props.node.attrs,
|
|
26
|
+
set: (value) => props.updateAttributes(value)
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
export interface EditorUploraImageNodeAttrs {
|
|
3
|
+
image?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JSONContent, MarkdownParseHelpers, MarkdownParseResult, MarkdownRendererHelpers, MarkdownToken, MarkdownTokenizer, RenderContext } from '@tiptap/core';
|
|
2
|
+
interface CreateAtomBlockMarkdownSpecOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
interface CreateAtomBlockMarkdownSpecResult {
|
|
6
|
+
markdownTokenizer: MarkdownTokenizer;
|
|
7
|
+
parseMarkdown: (token: MarkdownToken, helpers: MarkdownParseHelpers) => MarkdownParseResult;
|
|
8
|
+
renderMarkdown: (node: JSONContent, helpers: MarkdownRendererHelpers, ctx: RenderContext) => string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseAttributes(attrString: string): Record<string, any>;
|
|
11
|
+
export declare function serializeAttributes(attributes: Record<string, any>): string;
|
|
12
|
+
export declare function createAtomBlockMarkdownSpec(options: CreateAtomBlockMarkdownSpecOptions): CreateAtomBlockMarkdownSpecResult;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export function parseAttributes(attrString) {
|
|
2
|
+
if (!attrString?.trim()) {
|
|
3
|
+
return {};
|
|
4
|
+
}
|
|
5
|
+
const attributes = {};
|
|
6
|
+
const quotedStrings = [];
|
|
7
|
+
const tempString = attrString.replace(/["']([^"']*)["']/g, (match) => {
|
|
8
|
+
quotedStrings.push(match);
|
|
9
|
+
return `__QUOTED_${quotedStrings.length - 1}__`;
|
|
10
|
+
});
|
|
11
|
+
const kvRegex = /([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;
|
|
12
|
+
const kvMatches = Array.from(tempString.matchAll(kvRegex));
|
|
13
|
+
kvMatches.forEach(([, key, quotedRef]) => {
|
|
14
|
+
const quotedIndex = Number.parseInt(quotedRef.match(/__QUOTED_(\d+)__/)?.[1] || "0", 10);
|
|
15
|
+
const quotedValue = quotedStrings[quotedIndex];
|
|
16
|
+
if (quotedValue) {
|
|
17
|
+
attributes[key] = quotedValue.slice(1, -1);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const cleanString = tempString.replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g, "").trim();
|
|
21
|
+
if (cleanString) {
|
|
22
|
+
const booleanAttrs = cleanString.split(/\s+/).filter(Boolean);
|
|
23
|
+
booleanAttrs.forEach((attr) => {
|
|
24
|
+
if (attr.match(/^[a-z][\w-]*$/i)) {
|
|
25
|
+
attributes[attr] = true;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return attributes;
|
|
30
|
+
}
|
|
31
|
+
export function serializeAttributes(attributes) {
|
|
32
|
+
if (!attributes || Object.keys(attributes).length === 0) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
const parts = [];
|
|
36
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
37
|
+
if (value === true) {
|
|
38
|
+
parts.push(key);
|
|
39
|
+
} else if (value !== false && value != null) {
|
|
40
|
+
parts.push(`${key}="${String(value)}"`);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return parts.join(" ");
|
|
44
|
+
}
|
|
45
|
+
export function createAtomBlockMarkdownSpec(options) {
|
|
46
|
+
return {
|
|
47
|
+
markdownTokenizer: {
|
|
48
|
+
name: options.name,
|
|
49
|
+
level: "block",
|
|
50
|
+
start: `:${options.name}`,
|
|
51
|
+
tokenize: (src) => {
|
|
52
|
+
const match = src.match(new RegExp(`^:${options.name}{([^}]+)}`));
|
|
53
|
+
if (!match || !match[1]) {
|
|
54
|
+
return void 0;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
type: options.name,
|
|
58
|
+
raw: match[0],
|
|
59
|
+
attrs: parseAttributes(match[1])
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
parseMarkdown(token) {
|
|
64
|
+
return {
|
|
65
|
+
type: options.name,
|
|
66
|
+
attrs: token.attrs
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
renderMarkdown: (node) => {
|
|
70
|
+
return `:${options.name}{${serializeAttributes(node.attrs ?? {})}}`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
package/dist/runtime/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "@nuxt/ui";@import "#build/cms.css";@source "./components";@source "./editor";
|
|
1
|
+
@import "@nuxt/ui";@import "#build/cms.css";@source "./components";@source "./editor";@source "./prose";
|
|
@@ -24,6 +24,7 @@ export default defineHttpHandler(async (event) => {
|
|
|
24
24
|
formData.append("file", new Blob([file.data], { type: file.type }), file.filename);
|
|
25
25
|
if (isImageMimeType(file.type)) {
|
|
26
26
|
formData.append("lqip", "true");
|
|
27
|
+
formData.append("color", "true");
|
|
27
28
|
}
|
|
28
29
|
return await $fetch(`${uplora.url}/api/files`, {
|
|
29
30
|
method: "POST",
|
|
@@ -1,7 +1,40 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
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/prose/UploraImage.vue';
|
|
16
|
+
export * from '../components/TableColumnSorting.vue';
|
|
17
|
+
export * from '../components/TableFilters.vue';
|
|
18
|
+
export * from '../components/TablePanel.vue';
|
|
19
|
+
export * from '../components/TableSearchInput.vue';
|
|
20
|
+
export * from '../components/UploraImage.vue';
|
|
21
|
+
export * from '../composables/useAdmin';
|
|
22
|
+
export * from '../composables/useApi';
|
|
23
|
+
export * from '../composables/useAsyncHandler';
|
|
24
|
+
export * from '../composables/useEditorDragHandle';
|
|
25
|
+
export * from '../composables/useEditorSuggestions';
|
|
26
|
+
export * from '../composables/useEditorToolbar';
|
|
27
|
+
export * from '../composables/useFormState';
|
|
28
|
+
export * from '../composables/useLogout';
|
|
29
|
+
export * from '../composables/useModal';
|
|
30
|
+
export * from '../composables/useNotification';
|
|
31
|
+
export * from '../composables/useQueryState';
|
|
32
|
+
export * from '../composables/useRouteQuery';
|
|
33
|
+
export * from '../composables/useSeoStats';
|
|
34
|
+
export * from '../composables/useTable';
|
|
35
|
+
export * from '../composables/useTableColumns';
|
|
36
|
+
export * from '../composables/useUplora';
|
|
3
37
|
export * from './date';
|
|
4
|
-
export * from './dictionaries';
|
|
5
38
|
export * from './image';
|
|
6
39
|
export * from './query';
|
|
7
40
|
export * from './seo';
|
|
@@ -1,5 +1,40 @@
|
|
|
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/prose/UploraImage.vue";
|
|
16
|
+
export * from "../components/TableColumnSorting.vue";
|
|
17
|
+
export * from "../components/TableFilters.vue";
|
|
18
|
+
export * from "../components/TablePanel.vue";
|
|
19
|
+
export * from "../components/TableSearchInput.vue";
|
|
20
|
+
export * from "../components/UploraImage.vue";
|
|
21
|
+
export * from "../composables/useAdmin.js";
|
|
22
|
+
export * from "../composables/useApi.js";
|
|
23
|
+
export * from "../composables/useAsyncHandler.js";
|
|
24
|
+
export * from "../composables/useEditorDragHandle.js";
|
|
25
|
+
export * from "../composables/useEditorSuggestions.js";
|
|
26
|
+
export * from "../composables/useEditorToolbar.js";
|
|
27
|
+
export * from "../composables/useFormState.js";
|
|
28
|
+
export * from "../composables/useLogout.js";
|
|
29
|
+
export * from "../composables/useModal.js";
|
|
30
|
+
export * from "../composables/useNotification.js";
|
|
31
|
+
export * from "../composables/useQueryState.js";
|
|
32
|
+
export * from "../composables/useRouteQuery.js";
|
|
33
|
+
export * from "../composables/useSeoStats.js";
|
|
34
|
+
export * from "../composables/useTable.js";
|
|
35
|
+
export * from "../composables/useTableColumns.js";
|
|
36
|
+
export * from "../composables/useUplora.js";
|
|
1
37
|
export * from "./date.js";
|
|
2
|
-
export * from "./dictionaries.js";
|
|
3
38
|
export * from "./image.js";
|
|
4
39
|
export * from "./query.js";
|
|
5
40
|
export * from "./seo.js";
|
|
@@ -46,7 +46,7 @@ type ComponentAppConfig<T, A extends Record<string, any>, K extends string, U ex
|
|
|
46
46
|
});
|
|
47
47
|
/**
|
|
48
48
|
* Defines the configuration shape expected for a component.
|
|
49
|
-
* @template T The component's theme imported from `#build/cms/*`.
|
|
49
|
+
* @template T The component's theme imported from `#build/cms/*` and `#build/cms/*`.
|
|
50
50
|
* @template A The base AppConfig type from `@nuxt/schema`.
|
|
51
51
|
* @template K The key identifying the component (e.g., 'badge').
|
|
52
52
|
* @template U The top-level key in AppConfig ('cms' or 'cms.prose').
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { DateLike } from '@vueuse/core';
|
|
2
|
-
import type { DateRange } from '../types/date';
|
|
3
|
-
export declare function getPeriod(beforeDays: number, afterDays?: number, fixTime?: boolean): DateRange;
|
|
4
|
-
export declare function getPeriodFromDaysAgo(days: number, fixTime?: boolean): DateRange;
|
|
5
|
-
export declare function getCurrentDayPeriod(): DateRange;
|
|
6
2
|
export declare function formatDateTime(date: DateLike): string;
|
|
7
3
|
export declare function formatDate(date: DateLike): string;
|
|
8
4
|
export declare function formatTime(date: DateLike): string;
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
import { getCmsConfig } from "#imports";
|
|
2
2
|
import { formatDate as format, normalizeDate } from "@vueuse/core";
|
|
3
|
-
export function getPeriod(beforeDays, afterDays = 0, fixTime = true) {
|
|
4
|
-
const start = /* @__PURE__ */ new Date();
|
|
5
|
-
start.setDate(start.getDate() - beforeDays);
|
|
6
|
-
fixTime && start.setHours(0, 0, 0, 0);
|
|
7
|
-
const end = /* @__PURE__ */ new Date();
|
|
8
|
-
end.setDate(end.getDate() + afterDays);
|
|
9
|
-
fixTime && end.setHours(23, 59, 59, 999);
|
|
10
|
-
return { start: formatServerDateTime(start), end: formatServerDateTime(end) };
|
|
11
|
-
}
|
|
12
|
-
export function getPeriodFromDaysAgo(days, fixTime = true) {
|
|
13
|
-
return getPeriod(days, 0, fixTime);
|
|
14
|
-
}
|
|
15
|
-
export function getCurrentDayPeriod() {
|
|
16
|
-
return getPeriodFromDaysAgo(0);
|
|
17
|
-
}
|
|
18
3
|
export function formatDateTime(date) {
|
|
19
4
|
return normalizeDate(date).toLocaleString("ru-RU");
|
|
20
5
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type Country = 'ru' | 'us';
|
|
2
2
|
export declare function formatMoney(value: number, country?: Country, locales?: Intl.LocalesArgument): string;
|
|
3
3
|
export declare function formatNumber(value: number, locales?: Intl.LocalesArgument): string;
|
|
4
4
|
export declare function formatPercentage(value: number, locales?: Intl.LocalesArgument): string;
|
|
5
5
|
export declare function formatBoolean(value: boolean | undefined | null): string;
|
|
6
|
+
export {};
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hywax/cms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/hywax/cms.git"
|
|
9
|
-
},
|
|
10
6
|
"imports": {
|
|
11
7
|
"#build/cms/*": "./.nuxt/cms/*.ts",
|
|
12
8
|
"#build/cms.css": "./.nuxt/cms.css"
|
|
@@ -44,33 +40,37 @@
|
|
|
44
40
|
]
|
|
45
41
|
}
|
|
46
42
|
},
|
|
47
|
-
"bin": {
|
|
48
|
-
"cms": "./cli/index.mjs"
|
|
49
|
-
},
|
|
50
43
|
"style": "./dist/runtime/index.css",
|
|
51
44
|
"files": [
|
|
52
45
|
".nuxt/cms",
|
|
53
46
|
".nuxt/cms.css",
|
|
54
|
-
"cli",
|
|
55
47
|
"dist"
|
|
56
48
|
],
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@unovis/ts": "^1.6.2",
|
|
51
|
+
"@unovis/vue": "^1.6.2"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@unovis/ts": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"@unovis/vue": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
57
61
|
"dependencies": {
|
|
58
62
|
"@dicebear/collection": "^9.2.4",
|
|
59
63
|
"@dicebear/core": "^9.2.4",
|
|
60
|
-
"@iconify-json/lucide": "1.2.82",
|
|
61
64
|
"@nuxt/kit": "^4.2.2",
|
|
62
65
|
"@nuxt/ui": "^4.3.0",
|
|
63
66
|
"@nuxtjs/mdc": "^0.19.2",
|
|
64
|
-
"@nuxtjs/seo": "^3.3.0",
|
|
65
67
|
"@sindresorhus/slugify": "^3.0.0",
|
|
66
|
-
"@unovis/ts": "^1.6.2",
|
|
67
|
-
"@unovis/vue": "^1.6.2",
|
|
68
68
|
"@uplora/formats": "^0.1.0",
|
|
69
69
|
"@uplora/serializer": "^0.1.3",
|
|
70
70
|
"@vueuse/nuxt": "^14.1.0",
|
|
71
71
|
"consola": "^3.4.2",
|
|
72
72
|
"defu": "^6.1.4",
|
|
73
|
-
"fast-copy": "^
|
|
73
|
+
"fast-copy": "^4.0.2",
|
|
74
74
|
"fast-equals": "^5.4.0",
|
|
75
75
|
"nuxt-auth-utils": "^0.5.26",
|
|
76
76
|
"object-to-formdata": "^4.5.1",
|
|
@@ -78,20 +78,20 @@
|
|
|
78
78
|
"plural-ru": "^2.0.2",
|
|
79
79
|
"scule": "^1.3.0",
|
|
80
80
|
"sortablejs": "^1.15.6",
|
|
81
|
-
"
|
|
81
|
+
"tinyglobby": "^0.2.15",
|
|
82
|
+
"zod": "^4.3.4"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"@antfu/eslint-config": "^5.4.1",
|
|
85
|
-
"@commitlint/cli": "^20.
|
|
86
|
-
"@commitlint/config-conventional": "^20.
|
|
86
|
+
"@commitlint/cli": "^20.3.0",
|
|
87
|
+
"@commitlint/config-conventional": "^20.3.0",
|
|
87
88
|
"@nuxt/devtools": "^3.1.1",
|
|
88
89
|
"@nuxt/module-builder": "^1.0.2",
|
|
89
90
|
"@nuxt/schema": "^4.2.2",
|
|
90
91
|
"@nuxt/test-utils": "^3.21.0",
|
|
91
|
-
"@types/node": "^24.10.4",
|
|
92
92
|
"@types/sortablejs": "^1.15.9",
|
|
93
93
|
"@vue/test-utils": "^2.4.6",
|
|
94
|
-
"changelogen": "^0.
|
|
94
|
+
"changelogen-monorepo": "^0.5.0",
|
|
95
95
|
"eslint": "^9.39.2",
|
|
96
96
|
"happy-dom": "^20.0.11",
|
|
97
97
|
"husky": "^9.1.7",
|
|
@@ -104,12 +104,6 @@
|
|
|
104
104
|
"resolutions": {
|
|
105
105
|
"@hywax/cms": "workspace:*"
|
|
106
106
|
},
|
|
107
|
-
"ignoredBuiltDependencies": [
|
|
108
|
-
"@parcel/watcher",
|
|
109
|
-
"@tailwindcss/oxide",
|
|
110
|
-
"esbuild",
|
|
111
|
-
"vue-demi"
|
|
112
|
-
],
|
|
113
107
|
"lint-staged": {
|
|
114
108
|
"*.ts": "pnpm run lint"
|
|
115
109
|
},
|