@hywax/cms 3.6.1 → 3.7.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 +0 -3
- package/.nuxt/cms/prose/index.ts +2 -1
- package/.nuxt/cms/prose/uplora-image-gallery.ts +15 -0
- package/.nuxt/cms/uplora-image.ts +12 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +34 -4
- package/dist/runtime/components/EditorFull.vue +18 -3
- package/dist/runtime/components/FormSeo.d.vue.ts +4 -4
- package/dist/runtime/components/FormSeo.vue +25 -13
- package/dist/runtime/components/FormSeo.vue.d.ts +4 -4
- package/dist/runtime/components/FormUploraImage.d.vue.ts +7 -9
- package/dist/runtime/components/FormUploraImage.vue +70 -46
- package/dist/runtime/components/FormUploraImage.vue.d.ts +7 -9
- package/dist/runtime/components/UploraImage.d.vue.ts +4 -0
- package/dist/runtime/components/UploraImage.vue +13 -2
- package/dist/runtime/components/UploraImage.vue.d.ts +4 -0
- package/dist/runtime/components/prose/UploraImage.d.vue.ts +4 -7
- package/dist/runtime/components/prose/UploraImage.vue +13 -7
- package/dist/runtime/components/prose/UploraImage.vue.d.ts +4 -7
- package/dist/runtime/components/prose/UploraImageGallery.d.vue.ts +19 -0
- package/dist/runtime/components/prose/UploraImageGallery.vue +24 -0
- package/dist/runtime/components/prose/UploraImageGallery.vue.d.ts +19 -0
- package/dist/runtime/composables/useEditorSuggestions.d.ts +29 -6
- package/dist/runtime/composables/useEditorSuggestions.js +7 -3
- package/dist/runtime/editor/caution/EditorCaution.d.ts +18 -0
- package/dist/runtime/editor/caution/EditorCaution.js +36 -0
- package/dist/runtime/editor/caution/EditorCautionNode.d.vue.ts +4 -0
- package/dist/runtime/editor/caution/EditorCautionNode.vue +22 -0
- package/dist/runtime/editor/caution/EditorCautionNode.vue.d.ts +4 -0
- package/dist/runtime/editor/note/EditorNote.d.ts +18 -0
- package/dist/runtime/editor/note/EditorNote.js +36 -0
- package/dist/runtime/editor/note/EditorNoteNode.d.vue.ts +4 -0
- package/dist/runtime/editor/note/EditorNoteNode.vue +22 -0
- package/dist/runtime/editor/note/EditorNoteNode.vue.d.ts +4 -0
- package/dist/runtime/editor/tip/EditorTip.d.ts +18 -0
- package/dist/runtime/editor/tip/EditorTip.js +36 -0
- package/dist/runtime/editor/tip/EditorTipNode.d.vue.ts +4 -0
- package/dist/runtime/editor/tip/EditorTipNode.vue +22 -0
- package/dist/runtime/editor/tip/EditorTipNode.vue.d.ts +4 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImage.js +10 -4
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.d.vue.ts +0 -5
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue +2 -2
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue.d.ts +0 -5
- package/dist/runtime/editor/uplora-image-gallery/EditorUploraImageGallery.d.ts +18 -0
- package/dist/runtime/editor/uplora-image-gallery/EditorUploraImageGallery.js +71 -0
- package/dist/runtime/editor/uplora-image-gallery/EditorUploraImageGalleryNode.d.vue.ts +4 -0
- package/dist/runtime/editor/uplora-image-gallery/EditorUploraImageGalleryNode.vue +93 -0
- package/dist/runtime/editor/uplora-image-gallery/EditorUploraImageGalleryNode.vue.d.ts +4 -0
- package/dist/runtime/editor/utils/attributes.d.ts +2 -0
- package/dist/runtime/editor/{utils.js → utils/attributes.js} +0 -29
- package/dist/runtime/editor/utils/createAtomBlockMarkdownSpec.d.ts +10 -0
- package/dist/runtime/editor/utils/createAtomBlockMarkdownSpec.js +32 -0
- package/dist/runtime/editor/utils/createBlockMarkdownSpec.d.ts +12 -0
- package/dist/runtime/editor/utils/createBlockMarkdownSpec.js +99 -0
- package/dist/runtime/editor/utils/index.d.ts +3 -0
- package/dist/runtime/editor/utils/index.js +3 -0
- package/dist/runtime/editor/warning/EditorWarning.d.ts +18 -0
- package/dist/runtime/editor/warning/EditorWarning.js +36 -0
- package/dist/runtime/editor/warning/EditorWarningNode.d.vue.ts +4 -0
- package/dist/runtime/editor/warning/EditorWarningNode.vue +22 -0
- package/dist/runtime/editor/warning/EditorWarningNode.vue.d.ts +4 -0
- package/dist/runtime/server/utils/pagination.d.ts +4 -0
- package/dist/runtime/server/utils/pagination.js +2 -2
- package/package.json +1 -1
- package/dist/runtime/editor/utils.d.ts +0 -13
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
-
import type { ComponentConfig
|
|
2
|
+
import type { ComponentConfig } from '../../types';
|
|
3
|
+
import type { UploraImageProps } from '../UploraImage.vue';
|
|
3
4
|
import theme from '#build/cms/prose/uplora-image';
|
|
4
5
|
export type ProseUploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage', 'cms.prose'>;
|
|
5
|
-
export interface ProseUploraImageProps {
|
|
6
|
-
image
|
|
7
|
-
formats?: ImageFormat[];
|
|
8
|
-
alt?: string;
|
|
9
|
-
color?: string;
|
|
10
|
-
sizes?: ImageSize[];
|
|
6
|
+
export interface ProseUploraImageProps extends Pick<UploraImageProps, 'alt' | 'color' | 'formats' | 'sizes' | 'aspect' | 'width' | 'height'> {
|
|
7
|
+
image?: string;
|
|
11
8
|
class?: any;
|
|
12
9
|
ui?: ProseUploraImage['slots'];
|
|
13
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<DialogRoot
|
|
3
|
+
v-if="image"
|
|
3
4
|
v-slot="{ close }"
|
|
4
5
|
v-model:open="open"
|
|
5
6
|
:modal="false"
|
|
@@ -7,11 +8,13 @@
|
|
|
7
8
|
<DialogTrigger as-child>
|
|
8
9
|
<Motion :layout-id="layoutId" as-child :transition="{ type: 'spring', bounce: 0.15, duration: 0.5, ease: 'easeInOut' }">
|
|
9
10
|
<BaseUploraImage
|
|
10
|
-
v-if="image"
|
|
11
11
|
:image="image"
|
|
12
12
|
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
13
13
|
:alt="alt"
|
|
14
14
|
:color="color"
|
|
15
|
+
:aspect="aspect"
|
|
16
|
+
:width="width"
|
|
17
|
+
:height="height"
|
|
15
18
|
/>
|
|
16
19
|
</Motion>
|
|
17
20
|
</DialogTrigger>
|
|
@@ -54,23 +57,26 @@ import BaseUploraImage from "../UploraImage.vue";
|
|
|
54
57
|
|
|
55
58
|
<script setup>
|
|
56
59
|
const props = defineProps({
|
|
57
|
-
image: { type: String, required:
|
|
58
|
-
|
|
60
|
+
image: { type: String, required: false },
|
|
61
|
+
class: { type: null, required: false },
|
|
62
|
+
ui: { type: null, required: false },
|
|
59
63
|
alt: { type: String, required: false },
|
|
60
64
|
color: { type: String, required: false },
|
|
65
|
+
formats: { type: Array, required: false },
|
|
61
66
|
sizes: { type: Array, required: false },
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
aspect: { type: String, required: false },
|
|
68
|
+
width: { type: [Number, String], required: false },
|
|
69
|
+
height: { type: [Number, String], required: false }
|
|
64
70
|
});
|
|
65
71
|
const appConfig = useAppConfig();
|
|
66
72
|
const cmsConfig = useCmsConfig();
|
|
67
73
|
const layoutId = computed(() => `${props.image}::${useId()}`);
|
|
68
74
|
const open = ref(false);
|
|
69
|
-
const image = computed(() => buildUploraImage({
|
|
75
|
+
const image = computed(() => props.image ? buildUploraImage({
|
|
70
76
|
id: props.image,
|
|
71
77
|
formats: props.formats ?? cmsConfig?.components?.uploraImage?.formats,
|
|
72
78
|
sizes: props.sizes ?? cmsConfig?.components?.prose?.uploraImage?.sizes
|
|
73
|
-
}));
|
|
79
|
+
}) : void 0);
|
|
74
80
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.prose?.uploraImage || {} })({
|
|
75
81
|
open: open.value
|
|
76
82
|
}));
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
-
import type { ComponentConfig
|
|
2
|
+
import type { ComponentConfig } from '../../types';
|
|
3
|
+
import type { UploraImageProps } from '../UploraImage.vue';
|
|
3
4
|
import theme from '#build/cms/prose/uplora-image';
|
|
4
5
|
export type ProseUploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage', 'cms.prose'>;
|
|
5
|
-
export interface ProseUploraImageProps {
|
|
6
|
-
image
|
|
7
|
-
formats?: ImageFormat[];
|
|
8
|
-
alt?: string;
|
|
9
|
-
color?: string;
|
|
10
|
-
sizes?: ImageSize[];
|
|
6
|
+
export interface ProseUploraImageProps extends Pick<UploraImageProps, 'alt' | 'color' | 'formats' | 'sizes' | 'aspect' | 'width' | 'height'> {
|
|
7
|
+
image?: string;
|
|
11
8
|
class?: any;
|
|
12
9
|
ui?: ProseUploraImage['slots'];
|
|
13
10
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ComponentConfig } from '../../types';
|
|
3
|
+
import theme from '#build/cms/prose/uplora-image-gallery';
|
|
4
|
+
export type ProseUploraImageGallery = ComponentConfig<typeof theme, AppConfig, 'uploraImageGallery', 'cms.prose'>;
|
|
5
|
+
export interface ProseUploraImageGalleryProps {
|
|
6
|
+
columns: 'two-columns' | 'three-columns';
|
|
7
|
+
class?: any;
|
|
8
|
+
ui?: ProseUploraImageGallery['slots'];
|
|
9
|
+
}
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ProseUploraImageGalleryProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseUploraImageGalleryProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
13
|
+
default?: (props: {}) => any;
|
|
14
|
+
}>;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ui.base({ class: [props.ui?.base, props.class] })">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import theme from "#build/cms/prose/uplora-image-gallery";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { computed } from "vue";
|
|
11
|
+
import { tv } from "../../tv";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
columns: { type: String, required: true },
|
|
17
|
+
class: { type: null, required: false },
|
|
18
|
+
ui: { type: null, required: false }
|
|
19
|
+
});
|
|
20
|
+
const appConfig = useAppConfig();
|
|
21
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.prose?.uploraImageGallery || {} })({
|
|
22
|
+
columns: props.columns
|
|
23
|
+
}));
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ComponentConfig } from '../../types';
|
|
3
|
+
import theme from '#build/cms/prose/uplora-image-gallery';
|
|
4
|
+
export type ProseUploraImageGallery = ComponentConfig<typeof theme, AppConfig, 'uploraImageGallery', 'cms.prose'>;
|
|
5
|
+
export interface ProseUploraImageGalleryProps {
|
|
6
|
+
columns: 'two-columns' | 'three-columns';
|
|
7
|
+
class?: any;
|
|
8
|
+
ui?: ProseUploraImageGallery['slots'];
|
|
9
|
+
}
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ProseUploraImageGalleryProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseUploraImageGalleryProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
13
|
+
default?: (props: {}) => any;
|
|
14
|
+
}>;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -13,12 +13,6 @@ export declare function useEditorSuggestions<T extends EditorCustomHandlers>(_cu
|
|
|
13
13
|
icon: any;
|
|
14
14
|
type?: undefined;
|
|
15
15
|
level?: undefined;
|
|
16
|
-
} | {
|
|
17
|
-
kind: "heading";
|
|
18
|
-
level: 1;
|
|
19
|
-
label: string;
|
|
20
|
-
icon: any;
|
|
21
|
-
type?: undefined;
|
|
22
16
|
} | {
|
|
23
17
|
kind: "heading";
|
|
24
18
|
level: 2;
|
|
@@ -55,6 +49,30 @@ export declare function useEditorSuggestions<T extends EditorCustomHandlers>(_cu
|
|
|
55
49
|
icon: any;
|
|
56
50
|
type?: undefined;
|
|
57
51
|
level?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "note";
|
|
54
|
+
label: string;
|
|
55
|
+
icon: any;
|
|
56
|
+
type?: undefined;
|
|
57
|
+
level?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "tip";
|
|
60
|
+
label: string;
|
|
61
|
+
icon: any;
|
|
62
|
+
type?: undefined;
|
|
63
|
+
level?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
kind: "warning";
|
|
66
|
+
label: string;
|
|
67
|
+
icon: any;
|
|
68
|
+
type?: undefined;
|
|
69
|
+
level?: undefined;
|
|
70
|
+
} | {
|
|
71
|
+
kind: "caution";
|
|
72
|
+
label: string;
|
|
73
|
+
icon: any;
|
|
74
|
+
type?: undefined;
|
|
75
|
+
level?: undefined;
|
|
58
76
|
})[] | ({
|
|
59
77
|
type: "label";
|
|
60
78
|
label: string;
|
|
@@ -70,5 +88,10 @@ export declare function useEditorSuggestions<T extends EditorCustomHandlers>(_cu
|
|
|
70
88
|
label: string;
|
|
71
89
|
icon: any;
|
|
72
90
|
type?: undefined;
|
|
91
|
+
} | {
|
|
92
|
+
kind: "uplora-image-gallery";
|
|
93
|
+
label: string;
|
|
94
|
+
icon: any;
|
|
95
|
+
type?: undefined;
|
|
73
96
|
})[])[];
|
|
74
97
|
};
|
|
@@ -5,18 +5,22 @@ export function useEditorSuggestions(_customHandlers) {
|
|
|
5
5
|
[
|
|
6
6
|
{ type: "label", label: "\u0422\u0438\u043F" },
|
|
7
7
|
{ kind: "paragraph", label: "\u041F\u0430\u0440\u0430\u0433\u0440\u0430\u0444", icon: appConfig.ui.icons.paragraph },
|
|
8
|
-
{ kind: "heading", level: 1, label: "\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 1", icon: appConfig.ui.icons.heading1 },
|
|
9
8
|
{ kind: "heading", level: 2, label: "\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 2", icon: appConfig.ui.icons.heading2 },
|
|
10
9
|
{ kind: "heading", level: 3, label: "\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 3", icon: appConfig.ui.icons.heading3 },
|
|
11
10
|
{ kind: "bulletList", label: "\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A", icon: appConfig.ui.icons.list },
|
|
12
11
|
{ kind: "orderedList", label: "\u041D\u0443\u043C\u0435\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A", icon: appConfig.ui.icons.listOrdered },
|
|
13
12
|
{ kind: "blockquote", label: "\u0426\u0438\u0442\u0430\u0442\u0430", icon: appConfig.ui.icons.blockquote },
|
|
14
|
-
{ kind: "codeBlock", label: "\u0411\u043B\u043E\u043A \u043A\u043E\u0434\u0430", icon: appConfig.ui.icons.codeBlock }
|
|
13
|
+
{ kind: "codeBlock", label: "\u0411\u043B\u043E\u043A \u043A\u043E\u0434\u0430", icon: appConfig.ui.icons.codeBlock },
|
|
14
|
+
{ kind: "note", label: "\u0417\u0430\u043C\u0435\u0442\u043A\u0430", icon: appConfig.ui.icons.info },
|
|
15
|
+
{ kind: "tip", label: "\u0421\u043E\u0432\u0435\u0442", icon: appConfig.ui.icons.tip },
|
|
16
|
+
{ kind: "warning", label: "\u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435", icon: appConfig.ui.icons.warning },
|
|
17
|
+
{ kind: "caution", label: "\u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435", icon: appConfig.ui.icons.caution }
|
|
15
18
|
],
|
|
16
19
|
[
|
|
17
20
|
{ type: "label", label: "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C" },
|
|
18
21
|
{ kind: "horizontalRule", label: "\u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u043B\u0438\u043D\u0438\u044F", icon: appConfig.ui.icons.horizontalRule },
|
|
19
|
-
{ kind: "uplora-image", label: "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", icon: appConfig.ui.icons.image }
|
|
22
|
+
{ kind: "uplora-image", label: "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", icon: appConfig.ui.icons.image },
|
|
23
|
+
{ kind: "uplora-image-gallery", label: "\u0413\u0430\u043B\u0435\u0440\u0435\u044F", icon: appConfig.ui.icons.images }
|
|
20
24
|
]
|
|
21
25
|
];
|
|
22
26
|
return {
|
|
@@ -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
|
+
caution: {
|
|
6
|
+
insertCaution: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const CautionHandlers: {
|
|
11
|
+
caution: {
|
|
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 Caution: Node<any, any>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
import { createBlockMarkdownSpec } from "../utils/index.js";
|
|
4
|
+
import EditorCautionNodeComponent from "./EditorCautionNode.vue";
|
|
5
|
+
export const CautionHandlers = {
|
|
6
|
+
caution: {
|
|
7
|
+
canExecute: (editor) => editor.can().insertContent({ type: "caution" }),
|
|
8
|
+
execute: (editor) => editor.chain().focus().insertContent({ type: "caution" }),
|
|
9
|
+
isActive: (editor) => editor.isActive("caution"),
|
|
10
|
+
isDisabled: void 0
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const Caution = Node.create({
|
|
14
|
+
name: "caution",
|
|
15
|
+
group: "block",
|
|
16
|
+
content: "inline*",
|
|
17
|
+
...createBlockMarkdownSpec({ name: "caution", content: "inline" }),
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [{
|
|
20
|
+
tag: 'div[data-type="caution"]'
|
|
21
|
+
}];
|
|
22
|
+
},
|
|
23
|
+
renderHTML({ HTMLAttributes }) {
|
|
24
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "caution" })];
|
|
25
|
+
},
|
|
26
|
+
addNodeView() {
|
|
27
|
+
return VueNodeViewRenderer(EditorCautionNodeComponent);
|
|
28
|
+
},
|
|
29
|
+
addCommands() {
|
|
30
|
+
return {
|
|
31
|
+
insertCaution: () => ({ commands }) => {
|
|
32
|
+
return commands.insertContent({ type: this.name });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -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,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NodeViewWrapper class="relative px-4 py-1 rounded-md text-sm border border-error/25 bg-error/10 text-error-600 dark:text-error-300">
|
|
3
|
+
<NodeViewContent class="py-1" />
|
|
4
|
+
</NodeViewWrapper>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { NodeViewContent, NodeViewWrapper } from "@tiptap/vue-3";
|
|
9
|
+
defineProps({
|
|
10
|
+
decorations: { type: Array, required: true },
|
|
11
|
+
selected: { type: Boolean, required: true },
|
|
12
|
+
updateAttributes: { type: Function, required: true },
|
|
13
|
+
deleteNode: { type: Function, required: true },
|
|
14
|
+
node: { type: null, required: true },
|
|
15
|
+
view: { type: null, required: true },
|
|
16
|
+
getPos: { type: null, required: true },
|
|
17
|
+
innerDecorations: { type: null, required: true },
|
|
18
|
+
editor: { type: Object, required: true },
|
|
19
|
+
extension: { type: Object, required: true },
|
|
20
|
+
HTMLAttributes: { type: Object, required: true }
|
|
21
|
+
});
|
|
22
|
+
</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,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
|
+
note: {
|
|
6
|
+
insertNote: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const NoteHandlers: {
|
|
11
|
+
note: {
|
|
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 Note: Node<any, any>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
import { createBlockMarkdownSpec } from "../utils/index.js";
|
|
4
|
+
import EditorNoteNodeComponent from "./EditorNoteNode.vue";
|
|
5
|
+
export const NoteHandlers = {
|
|
6
|
+
note: {
|
|
7
|
+
canExecute: (editor) => editor.can().insertContent({ type: "note" }),
|
|
8
|
+
execute: (editor) => editor.chain().focus().insertContent({ type: "note" }),
|
|
9
|
+
isActive: (editor) => editor.isActive("note"),
|
|
10
|
+
isDisabled: void 0
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const Note = Node.create({
|
|
14
|
+
name: "note",
|
|
15
|
+
group: "block",
|
|
16
|
+
content: "inline*",
|
|
17
|
+
...createBlockMarkdownSpec({ name: "note", content: "inline" }),
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [{
|
|
20
|
+
tag: 'div[data-type="note"]'
|
|
21
|
+
}];
|
|
22
|
+
},
|
|
23
|
+
renderHTML({ HTMLAttributes }) {
|
|
24
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "note" })];
|
|
25
|
+
},
|
|
26
|
+
addNodeView() {
|
|
27
|
+
return VueNodeViewRenderer(EditorNoteNodeComponent);
|
|
28
|
+
},
|
|
29
|
+
addCommands() {
|
|
30
|
+
return {
|
|
31
|
+
insertNote: () => ({ commands }) => {
|
|
32
|
+
return commands.insertContent({ type: this.name });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -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,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NodeViewWrapper class="relative px-4 py-1 rounded-md text-sm border border-info/25 bg-info/10 text-info-600 dark:text-info-300">
|
|
3
|
+
<NodeViewContent class="py-1" />
|
|
4
|
+
</NodeViewWrapper>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { NodeViewContent, NodeViewWrapper } from "@tiptap/vue-3";
|
|
9
|
+
defineProps({
|
|
10
|
+
decorations: { type: Array, required: true },
|
|
11
|
+
selected: { type: Boolean, required: true },
|
|
12
|
+
updateAttributes: { type: Function, required: true },
|
|
13
|
+
deleteNode: { type: Function, required: true },
|
|
14
|
+
node: { type: null, required: true },
|
|
15
|
+
view: { type: null, required: true },
|
|
16
|
+
getPos: { type: null, required: true },
|
|
17
|
+
innerDecorations: { type: null, required: true },
|
|
18
|
+
editor: { type: Object, required: true },
|
|
19
|
+
extension: { type: Object, required: true },
|
|
20
|
+
HTMLAttributes: { type: Object, required: true }
|
|
21
|
+
});
|
|
22
|
+
</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,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
|
+
tip: {
|
|
6
|
+
insertTip: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const TipHandlers: {
|
|
11
|
+
tip: {
|
|
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 Tip: Node<any, any>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
import { createBlockMarkdownSpec } from "../utils/index.js";
|
|
4
|
+
import EditorTipNodeComponent from "./EditorTipNode.vue";
|
|
5
|
+
export const TipHandlers = {
|
|
6
|
+
tip: {
|
|
7
|
+
canExecute: (editor) => editor.can().insertContent({ type: "tip" }),
|
|
8
|
+
execute: (editor) => editor.chain().focus().insertContent({ type: "tip" }),
|
|
9
|
+
isActive: (editor) => editor.isActive("tip"),
|
|
10
|
+
isDisabled: void 0
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const Tip = Node.create({
|
|
14
|
+
name: "tip",
|
|
15
|
+
group: "block",
|
|
16
|
+
content: "inline*",
|
|
17
|
+
...createBlockMarkdownSpec({ name: "tip", content: "inline" }),
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [{
|
|
20
|
+
tag: 'div[data-type="tip"]'
|
|
21
|
+
}];
|
|
22
|
+
},
|
|
23
|
+
renderHTML({ HTMLAttributes }) {
|
|
24
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "tip" })];
|
|
25
|
+
},
|
|
26
|
+
addNodeView() {
|
|
27
|
+
return VueNodeViewRenderer(EditorTipNodeComponent);
|
|
28
|
+
},
|
|
29
|
+
addCommands() {
|
|
30
|
+
return {
|
|
31
|
+
insertTip: () => ({ commands }) => {
|
|
32
|
+
return commands.insertContent({ type: this.name });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -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,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NodeViewWrapper class="relative px-4 py-1 rounded-md text-sm border border-success/25 bg-success/10 text-success-600 dark:text-success-300">
|
|
3
|
+
<NodeViewContent class="py-1" />
|
|
4
|
+
</NodeViewWrapper>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { NodeViewContent, NodeViewWrapper } from "@tiptap/vue-3";
|
|
9
|
+
defineProps({
|
|
10
|
+
decorations: { type: Array, required: true },
|
|
11
|
+
selected: { type: Boolean, required: true },
|
|
12
|
+
updateAttributes: { type: Function, required: true },
|
|
13
|
+
deleteNode: { type: Function, required: true },
|
|
14
|
+
node: { type: null, required: true },
|
|
15
|
+
view: { type: null, required: true },
|
|
16
|
+
getPos: { type: null, required: true },
|
|
17
|
+
innerDecorations: { type: null, required: true },
|
|
18
|
+
editor: { type: Object, required: true },
|
|
19
|
+
extension: { type: Object, required: true },
|
|
20
|
+
HTMLAttributes: { type: Object, required: true }
|
|
21
|
+
});
|
|
22
|
+
</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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeAttributes, Node } from "@tiptap/core";
|
|
2
2
|
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
-
import { createAtomBlockMarkdownSpec } from "../utils.js";
|
|
3
|
+
import { createAtomBlockMarkdownSpec } from "../utils/index.js";
|
|
4
4
|
import EditorUploraImageNodeComponent from "./EditorUploraImageNode.vue";
|
|
5
5
|
export const UploraImageHandlers = {
|
|
6
6
|
"uplora-image": {
|
|
@@ -13,12 +13,18 @@ export const UploraImageHandlers = {
|
|
|
13
13
|
export const UploraImage = Node.create({
|
|
14
14
|
name: "uplora-image",
|
|
15
15
|
group: "block",
|
|
16
|
+
draggable: true,
|
|
17
|
+
isolating: true,
|
|
16
18
|
atom: true,
|
|
17
19
|
addAttributes() {
|
|
18
20
|
return {
|
|
19
|
-
image: {},
|
|
20
|
-
alt: {},
|
|
21
|
-
|
|
21
|
+
image: { default: void 0 },
|
|
22
|
+
alt: { default: void 0 },
|
|
23
|
+
width: { default: void 0 },
|
|
24
|
+
height: { default: void 0 },
|
|
25
|
+
// lqip: { default: undefined },
|
|
26
|
+
color: { default: void 0 },
|
|
27
|
+
aspect: { default: void 0 }
|
|
22
28
|
};
|
|
23
29
|
},
|
|
24
30
|
...createAtomBlockMarkdownSpec({ name: "uplora-image" }),
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
-
export interface EditorUploraImageNodeAttrs {
|
|
3
|
-
image?: string;
|
|
4
|
-
alt?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
}
|
|
7
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>;
|
|
8
3
|
declare const _default: typeof __VLS_export;
|
|
9
4
|
export default _default;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
-
export interface EditorUploraImageNodeAttrs {
|
|
3
|
-
image?: string;
|
|
4
|
-
alt?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
}
|
|
7
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>;
|
|
8
3
|
declare const _default: typeof __VLS_export;
|
|
9
4
|
export default _default;
|
|
@@ -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
|
+
uploraImageGallery: {
|
|
6
|
+
insertUploraImageGallery: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const UploraImageGalleryHandlers: {
|
|
11
|
+
'uplora-image-gallery': {
|
|
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 UploraImageGallery: Node<any, any>;
|