@kystverket/styrbord 1.8.2 → 1.8.3
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/dist/src/components/kystverket/RichTextArea/richTextArea.types.d.ts +3 -3
- package/dist/src/components/kystverket/RichTextArea/utils/ImageRefUtils.d.ts +7 -0
- package/dist/src/components/kystverket/RichTextArea/utils/linkUtils.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/style.js +1575 -1564
- package/dist/style.umd.cjs +7 -7
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@ import type { CmdKey } from '@milkdown/core';
|
|
|
2
2
|
export type RichTextAreaProps = {
|
|
3
3
|
value: string | null | undefined;
|
|
4
4
|
onChange: (markdown: string) => void;
|
|
5
|
-
onUpload?: UploadImageFn;
|
|
6
5
|
placeholder?: string;
|
|
7
6
|
disabled?: boolean;
|
|
8
7
|
className?: string;
|
|
@@ -11,6 +10,9 @@ export type RichTextAreaProps = {
|
|
|
11
10
|
optional?: boolean | string;
|
|
12
11
|
required?: boolean | string;
|
|
13
12
|
error?: string;
|
|
13
|
+
/** For when image is uploaded, to give it a ref */
|
|
14
|
+
onImageUpload?: UploadImageFn;
|
|
15
|
+
resolveImageRef?: (ref: string) => string | null | undefined;
|
|
14
16
|
};
|
|
15
17
|
export type ToolbarCommand<T = unknown> = {
|
|
16
18
|
key: CmdKey<T>;
|
|
@@ -19,13 +21,11 @@ export type ToolbarCommand<T = unknown> = {
|
|
|
19
21
|
export type ImageMarkdown = {
|
|
20
22
|
src: string;
|
|
21
23
|
alt?: string;
|
|
22
|
-
title?: string;
|
|
23
24
|
};
|
|
24
25
|
export type ImageUploadResult = {
|
|
25
26
|
src: string;
|
|
26
27
|
ref?: string;
|
|
27
28
|
alt?: string;
|
|
28
|
-
title?: string;
|
|
29
29
|
};
|
|
30
30
|
export type ImageInsertHandler = (file: File) => void;
|
|
31
31
|
export type UploadImageFn = (file: File) => Promise<ImageUploadResult | string | null>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type ResolvedImageRef = {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
} | string | null | undefined;
|
|
5
|
+
export declare const convertFromRefToImage: (markdown: string, resolveImageRef: (ref: string) => ResolvedImageRef, urlToRefMap?: Map<string, string>) => string;
|
|
6
|
+
export declare const replaceImageUrlsWithRefs: (markdown: string, sasToRefMap: Map<string, string>) => string;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { EditorState } from '@milkdown/prose/state';
|
|
2
2
|
export declare const normalizeHref: (rawHref: string) => string;
|
|
3
|
-
export declare const replaceUrlsWithRefs: (markdown: string, sasToRefMap: Map<string, string>) => string;
|
|
4
3
|
export declare const getSelectionLinkRange: (state: EditorState) => {
|
|
5
4
|
from: number;
|
|
6
5
|
to: number;
|