@tiptap/extension-image 2.11.7 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +104 -79
- package/dist/index.cjs.map +1 -1
- package/dist/{image.d.ts → index.d.cts} +14 -9
- package/dist/index.d.ts +56 -4
- package/dist/index.js +78 -75
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
- package/src/image.ts +29 -19
- package/dist/image.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.umd.js +0 -87
- package/dist/index.umd.js.map +0 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Tiptap GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# @tiptap/extension-image
|
|
2
|
+
|
|
2
3
|
[](https://www.npmjs.com/package/@tiptap/extension-image)
|
|
3
4
|
[](https://npmcharts.com/compare/tiptap?minimal=true)
|
|
4
5
|
[](https://www.npmjs.com/package/@tiptap/extension-image)
|
|
5
6
|
[](https://github.com/sponsors/ueberdosis)
|
|
6
7
|
|
|
7
8
|
## Introduction
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
|
|
9
11
|
|
|
10
12
|
## Official Documentation
|
|
13
|
+
|
|
11
14
|
Documentation can be found on the [Tiptap website](https://tiptap.dev).
|
|
12
15
|
|
|
13
16
|
## License
|
|
17
|
+
|
|
14
18
|
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
package/dist/index.cjs
CHANGED
|
@@ -1,83 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2
19
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Image: () => Image,
|
|
24
|
+
default: () => index_default,
|
|
25
|
+
inputRegex: () => inputRegex
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
6
28
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
29
|
+
// src/image.ts
|
|
30
|
+
var import_core = require("@tiptap/core");
|
|
31
|
+
var inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
32
|
+
var Image = import_core.Node.create({
|
|
33
|
+
name: "image",
|
|
34
|
+
addOptions() {
|
|
35
|
+
return {
|
|
36
|
+
inline: false,
|
|
37
|
+
allowBase64: false,
|
|
38
|
+
HTMLAttributes: {}
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
inline() {
|
|
42
|
+
return this.options.inline;
|
|
43
|
+
},
|
|
44
|
+
group() {
|
|
45
|
+
return this.options.inline ? "inline" : "block";
|
|
46
|
+
},
|
|
47
|
+
draggable: true,
|
|
48
|
+
addAttributes() {
|
|
49
|
+
return {
|
|
50
|
+
src: {
|
|
51
|
+
default: null
|
|
52
|
+
},
|
|
53
|
+
alt: {
|
|
54
|
+
default: null
|
|
55
|
+
},
|
|
56
|
+
title: {
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
width: {
|
|
60
|
+
default: null
|
|
61
|
+
},
|
|
62
|
+
height: {
|
|
63
|
+
default: null
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
parseHTML() {
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
},
|
|
74
|
+
renderHTML({ HTMLAttributes }) {
|
|
75
|
+
return ["img", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
|
|
76
|
+
},
|
|
77
|
+
addCommands() {
|
|
78
|
+
return {
|
|
79
|
+
setImage: (options) => ({ commands }) => {
|
|
80
|
+
return commands.insertContent({
|
|
81
|
+
type: this.name,
|
|
82
|
+
attrs: options
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
addInputRules() {
|
|
88
|
+
return [
|
|
89
|
+
(0, import_core.nodeInputRule)({
|
|
90
|
+
find: inputRegex,
|
|
91
|
+
type: this.type,
|
|
92
|
+
getAttributes: (match) => {
|
|
93
|
+
const [, , alt, src, title] = match;
|
|
94
|
+
return { src, alt, title };
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
];
|
|
98
|
+
}
|
|
78
99
|
});
|
|
79
100
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
101
|
+
// src/index.ts
|
|
102
|
+
var index_default = Image;
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
Image,
|
|
106
|
+
inputRegex
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/image.ts"],"sourcesContent":["import { Image } from './image.js'\n\nexport * from './image.js'\n\nexport default Image\n","import { mergeAttributes, Node, nodeInputRule } from '@tiptap/core'\n\nexport interface ImageOptions {\n /**\n * Controls if the image node should be inline or not.\n * @default false\n * @example true\n */\n inline: boolean\n\n /**\n * Controls if base64 images are allowed. Enable this if you want to allow\n * base64 image urls in the `src` attribute.\n * @default false\n * @example true\n */\n allowBase64: boolean\n\n /**\n * HTML attributes to add to the image element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\nexport interface SetImageOptions {\n src: string\n alt?: string\n title?: string\n width?: number\n height?: number\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n image: {\n /**\n * Add an image\n * @param options The image attributes\n * @example\n * editor\n * .commands\n * .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })\n */\n setImage: (options: SetImageOptions) => ReturnType\n }\n }\n}\n\n/**\n * Matches an image to a  on input.\n */\nexport const inputRegex = /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/\n\n/**\n * This extension allows you to insert images.\n * @see https://www.tiptap.dev/api/nodes/image\n */\nexport const Image = Node.create<ImageOptions>({\n name: 'image',\n\n addOptions() {\n return {\n inline: false,\n allowBase64: false,\n HTMLAttributes: {},\n }\n },\n\n inline() {\n return this.options.inline\n },\n\n group() {\n return this.options.inline ? 'inline' : 'block'\n },\n\n draggable: true,\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n alt: {\n default: null,\n },\n title: {\n default: null,\n },\n width: {\n default: null,\n },\n height: {\n default: null,\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: this.options.allowBase64 ? 'img[src]' : 'img[src]:not([src^=\"data:\"])',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['img', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]\n },\n\n addCommands() {\n return {\n setImage:\n options =>\n ({ commands }) => {\n return commands.insertContent({\n type: this.name,\n attrs: options,\n })\n },\n }\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => {\n const [, , alt, src, title] = match\n\n return { src, alt, title }\n },\n }),\n ]\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAqD;AAqD9C,IAAM,aAAa;AAMnB,IAAM,QAAQ,iBAAK,OAAqB;AAAA,EAC7C,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,QAAQ;AACN,WAAO,KAAK,QAAQ,SAAS,WAAW;AAAA,EAC1C;AAAA,EAEA,WAAW;AAAA,EAEX,gBAAgB;AACd,WAAO;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,MACX;AAAA,MACA,KAAK;AAAA,QACH,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK,KAAK,QAAQ,cAAc,aAAa;AAAA,MAC/C;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,WAAO,6BAAgB,KAAK,QAAQ,gBAAgB,cAAc,CAAC;AAAA,EAC7E;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,UACE,aACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,cAAc;AAAA,UAC5B,MAAM,KAAK;AAAA,UACX,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,UACL,2BAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,QACX,eAAe,WAAS;AACtB,gBAAM,CAAC,EAAE,EAAE,KAAK,KAAK,KAAK,IAAI;AAE9B,iBAAO,EAAE,KAAK,KAAK,MAAM;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;;;ADtID,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
interface ImageOptions {
|
|
3
4
|
/**
|
|
4
5
|
* Controls if the image node should be inline or not.
|
|
5
6
|
* @default false
|
|
@@ -20,6 +21,13 @@ export interface ImageOptions {
|
|
|
20
21
|
*/
|
|
21
22
|
HTMLAttributes: Record<string, any>;
|
|
22
23
|
}
|
|
24
|
+
interface SetImageOptions {
|
|
25
|
+
src: string;
|
|
26
|
+
alt?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
}
|
|
23
31
|
declare module '@tiptap/core' {
|
|
24
32
|
interface Commands<ReturnType> {
|
|
25
33
|
image: {
|
|
@@ -31,21 +39,18 @@ declare module '@tiptap/core' {
|
|
|
31
39
|
* .commands
|
|
32
40
|
* .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })
|
|
33
41
|
*/
|
|
34
|
-
setImage: (options:
|
|
35
|
-
src: string;
|
|
36
|
-
alt?: string;
|
|
37
|
-
title?: string;
|
|
38
|
-
}) => ReturnType;
|
|
42
|
+
setImage: (options: SetImageOptions) => ReturnType;
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
/**
|
|
43
47
|
* Matches an image to a  on input.
|
|
44
48
|
*/
|
|
45
|
-
|
|
49
|
+
declare const inputRegex: RegExp;
|
|
46
50
|
/**
|
|
47
51
|
* This extension allows you to insert images.
|
|
48
52
|
* @see https://www.tiptap.dev/api/nodes/image
|
|
49
53
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
declare const Image: Node<ImageOptions, any>;
|
|
55
|
+
|
|
56
|
+
export { Image, type ImageOptions, type SetImageOptions, Image as default, inputRegex };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
interface ImageOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Controls if the image node should be inline or not.
|
|
6
|
+
* @default false
|
|
7
|
+
* @example true
|
|
8
|
+
*/
|
|
9
|
+
inline: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Controls if base64 images are allowed. Enable this if you want to allow
|
|
12
|
+
* base64 image urls in the `src` attribute.
|
|
13
|
+
* @default false
|
|
14
|
+
* @example true
|
|
15
|
+
*/
|
|
16
|
+
allowBase64: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* HTML attributes to add to the image element.
|
|
19
|
+
* @default {}
|
|
20
|
+
* @example { class: 'foo' }
|
|
21
|
+
*/
|
|
22
|
+
HTMLAttributes: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
interface SetImageOptions {
|
|
25
|
+
src: string;
|
|
26
|
+
alt?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
}
|
|
31
|
+
declare module '@tiptap/core' {
|
|
32
|
+
interface Commands<ReturnType> {
|
|
33
|
+
image: {
|
|
34
|
+
/**
|
|
35
|
+
* Add an image
|
|
36
|
+
* @param options The image attributes
|
|
37
|
+
* @example
|
|
38
|
+
* editor
|
|
39
|
+
* .commands
|
|
40
|
+
* .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })
|
|
41
|
+
*/
|
|
42
|
+
setImage: (options: SetImageOptions) => ReturnType;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Matches an image to a  on input.
|
|
48
|
+
*/
|
|
49
|
+
declare const inputRegex: RegExp;
|
|
50
|
+
/**
|
|
51
|
+
* This extension allows you to insert images.
|
|
52
|
+
* @see https://www.tiptap.dev/api/nodes/image
|
|
53
|
+
*/
|
|
54
|
+
declare const Image: Node<ImageOptions, any>;
|
|
55
|
+
|
|
56
|
+
export { Image, type ImageOptions, type SetImageOptions, Image as default, inputRegex };
|
package/dist/index.js
CHANGED
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}),
|
|
72
|
-
];
|
|
73
|
-
},
|
|
1
|
+
// src/image.ts
|
|
2
|
+
import { mergeAttributes, Node, nodeInputRule } from "@tiptap/core";
|
|
3
|
+
var inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
4
|
+
var Image = Node.create({
|
|
5
|
+
name: "image",
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
inline: false,
|
|
9
|
+
allowBase64: false,
|
|
10
|
+
HTMLAttributes: {}
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
inline() {
|
|
14
|
+
return this.options.inline;
|
|
15
|
+
},
|
|
16
|
+
group() {
|
|
17
|
+
return this.options.inline ? "inline" : "block";
|
|
18
|
+
},
|
|
19
|
+
draggable: true,
|
|
20
|
+
addAttributes() {
|
|
21
|
+
return {
|
|
22
|
+
src: {
|
|
23
|
+
default: null
|
|
24
|
+
},
|
|
25
|
+
alt: {
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
width: {
|
|
32
|
+
default: null
|
|
33
|
+
},
|
|
34
|
+
height: {
|
|
35
|
+
default: null
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
parseHTML() {
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
},
|
|
46
|
+
renderHTML({ HTMLAttributes }) {
|
|
47
|
+
return ["img", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
48
|
+
},
|
|
49
|
+
addCommands() {
|
|
50
|
+
return {
|
|
51
|
+
setImage: (options) => ({ commands }) => {
|
|
52
|
+
return commands.insertContent({
|
|
53
|
+
type: this.name,
|
|
54
|
+
attrs: options
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
addInputRules() {
|
|
60
|
+
return [
|
|
61
|
+
nodeInputRule({
|
|
62
|
+
find: inputRegex,
|
|
63
|
+
type: this.type,
|
|
64
|
+
getAttributes: (match) => {
|
|
65
|
+
const [, , alt, src, title] = match;
|
|
66
|
+
return { src, alt, title };
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
];
|
|
70
|
+
}
|
|
74
71
|
});
|
|
75
72
|
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
// src/index.ts
|
|
74
|
+
var index_default = Image;
|
|
75
|
+
export {
|
|
76
|
+
Image,
|
|
77
|
+
index_default as default,
|
|
78
|
+
inputRegex
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/image.ts","../src/index.ts"],"sourcesContent":["import { mergeAttributes, Node, nodeInputRule } from '@tiptap/core'\n\nexport interface ImageOptions {\n /**\n * Controls if the image node should be inline or not.\n * @default false\n * @example true\n */\n inline: boolean\n\n /**\n * Controls if base64 images are allowed. Enable this if you want to allow\n * base64 image urls in the `src` attribute.\n * @default false\n * @example true\n */\n allowBase64: boolean\n\n /**\n * HTML attributes to add to the image element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\nexport interface SetImageOptions {\n src: string\n alt?: string\n title?: string\n width?: number\n height?: number\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n image: {\n /**\n * Add an image\n * @param options The image attributes\n * @example\n * editor\n * .commands\n * .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })\n */\n setImage: (options: SetImageOptions) => ReturnType\n }\n }\n}\n\n/**\n * Matches an image to a  on input.\n */\nexport const inputRegex = /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/\n\n/**\n * This extension allows you to insert images.\n * @see https://www.tiptap.dev/api/nodes/image\n */\nexport const Image = Node.create<ImageOptions>({\n name: 'image',\n\n addOptions() {\n return {\n inline: false,\n allowBase64: false,\n HTMLAttributes: {},\n }\n },\n\n inline() {\n return this.options.inline\n },\n\n group() {\n return this.options.inline ? 'inline' : 'block'\n },\n\n draggable: true,\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n alt: {\n default: null,\n },\n title: {\n default: null,\n },\n width: {\n default: null,\n },\n height: {\n default: null,\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: this.options.allowBase64 ? 'img[src]' : 'img[src]:not([src^=\"data:\"])',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['img', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]\n },\n\n addCommands() {\n return {\n setImage:\n options =>\n ({ commands }) => {\n return commands.insertContent({\n type: this.name,\n attrs: options,\n })\n },\n }\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => {\n const [, , alt, src, title] = match\n\n return { src, alt, title }\n },\n }),\n ]\n },\n})\n","import { Image } from './image.js'\n\nexport * from './image.js'\n\nexport default Image\n"],"mappings":";AAAA,SAAS,iBAAiB,MAAM,qBAAqB;AAqD9C,IAAM,aAAa;AAMnB,IAAM,QAAQ,KAAK,OAAqB;AAAA,EAC7C,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,QAAQ;AACN,WAAO,KAAK,QAAQ,SAAS,WAAW;AAAA,EAC1C;AAAA,EAEA,WAAW;AAAA,EAEX,gBAAgB;AACd,WAAO;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,MACX;AAAA,MACA,KAAK;AAAA,QACH,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK,KAAK,QAAQ,cAAc,aAAa;AAAA,MAC/C;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,OAAO,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc,CAAC;AAAA,EAC7E;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,UACE,aACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,cAAc;AAAA,UAC5B,MAAM,KAAK;AAAA,UACX,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,MACL,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,QACX,eAAe,WAAS;AACtB,gBAAM,CAAC,EAAE,EAAE,KAAK,KAAK,KAAK,IAAI;AAE9B,iBAAO,EAAE,KAAK,KAAK,MAAM;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;;;ACtID,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-image",
|
|
3
3
|
"description": "image extension for tiptap",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0-beta.1",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -15,24 +15,26 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types":
|
|
18
|
+
"types": {
|
|
19
|
+
"import": "./dist/index.d.ts",
|
|
20
|
+
"require": "./dist/index.d.cts"
|
|
21
|
+
},
|
|
19
22
|
"import": "./dist/index.js",
|
|
20
23
|
"require": "./dist/index.cjs"
|
|
21
24
|
}
|
|
22
25
|
},
|
|
23
26
|
"main": "dist/index.cjs",
|
|
24
27
|
"module": "dist/index.js",
|
|
25
|
-
"umd": "dist/index.umd.js",
|
|
26
28
|
"types": "dist/index.d.ts",
|
|
27
29
|
"files": [
|
|
28
30
|
"src",
|
|
29
31
|
"dist"
|
|
30
32
|
],
|
|
31
33
|
"devDependencies": {
|
|
32
|
-
"@tiptap/core": "^
|
|
34
|
+
"@tiptap/core": "^3.0.0-beta.1"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
|
-
"@tiptap/core": "^
|
|
37
|
+
"@tiptap/core": "^3.0.0-beta.0"
|
|
36
38
|
},
|
|
37
39
|
"repository": {
|
|
38
40
|
"type": "git",
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
"directory": "packages/extension-image"
|
|
41
43
|
},
|
|
42
44
|
"scripts": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
|
|
45
47
|
}
|
|
46
|
-
}
|
|
48
|
+
}
|
package/src/image.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
mergeAttributes,
|
|
3
|
-
Node,
|
|
4
|
-
nodeInputRule,
|
|
5
|
-
} from '@tiptap/core'
|
|
1
|
+
import { mergeAttributes, Node, nodeInputRule } from '@tiptap/core'
|
|
6
2
|
|
|
7
3
|
export interface ImageOptions {
|
|
8
4
|
/**
|
|
@@ -10,7 +6,7 @@ export interface ImageOptions {
|
|
|
10
6
|
* @default false
|
|
11
7
|
* @example true
|
|
12
8
|
*/
|
|
13
|
-
inline: boolean
|
|
9
|
+
inline: boolean
|
|
14
10
|
|
|
15
11
|
/**
|
|
16
12
|
* Controls if base64 images are allowed. Enable this if you want to allow
|
|
@@ -18,14 +14,22 @@ export interface ImageOptions {
|
|
|
18
14
|
* @default false
|
|
19
15
|
* @example true
|
|
20
16
|
*/
|
|
21
|
-
allowBase64: boolean
|
|
17
|
+
allowBase64: boolean
|
|
22
18
|
|
|
23
19
|
/**
|
|
24
20
|
* HTML attributes to add to the image element.
|
|
25
21
|
* @default {}
|
|
26
22
|
* @example { class: 'foo' }
|
|
27
23
|
*/
|
|
28
|
-
HTMLAttributes: Record<string, any
|
|
24
|
+
HTMLAttributes: Record<string, any>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface SetImageOptions {
|
|
28
|
+
src: string
|
|
29
|
+
alt?: string
|
|
30
|
+
title?: string
|
|
31
|
+
width?: number
|
|
32
|
+
height?: number
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
declare module '@tiptap/core' {
|
|
@@ -39,7 +43,7 @@ declare module '@tiptap/core' {
|
|
|
39
43
|
* .commands
|
|
40
44
|
* .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })
|
|
41
45
|
*/
|
|
42
|
-
setImage: (options:
|
|
46
|
+
setImage: (options: SetImageOptions) => ReturnType
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
}
|
|
@@ -85,15 +89,19 @@ export const Image = Node.create<ImageOptions>({
|
|
|
85
89
|
title: {
|
|
86
90
|
default: null,
|
|
87
91
|
},
|
|
92
|
+
width: {
|
|
93
|
+
default: null,
|
|
94
|
+
},
|
|
95
|
+
height: {
|
|
96
|
+
default: null,
|
|
97
|
+
},
|
|
88
98
|
}
|
|
89
99
|
},
|
|
90
100
|
|
|
91
101
|
parseHTML() {
|
|
92
102
|
return [
|
|
93
103
|
{
|
|
94
|
-
tag: this.options.allowBase64
|
|
95
|
-
? 'img[src]'
|
|
96
|
-
: 'img[src]:not([src^="data:"])',
|
|
104
|
+
tag: this.options.allowBase64 ? 'img[src]' : 'img[src]:not([src^="data:"])',
|
|
97
105
|
},
|
|
98
106
|
]
|
|
99
107
|
},
|
|
@@ -104,12 +112,14 @@ export const Image = Node.create<ImageOptions>({
|
|
|
104
112
|
|
|
105
113
|
addCommands() {
|
|
106
114
|
return {
|
|
107
|
-
setImage:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
setImage:
|
|
116
|
+
options =>
|
|
117
|
+
({ commands }) => {
|
|
118
|
+
return commands.insertContent({
|
|
119
|
+
type: this.name,
|
|
120
|
+
attrs: options,
|
|
121
|
+
})
|
|
122
|
+
},
|
|
113
123
|
}
|
|
114
124
|
},
|
|
115
125
|
|
|
@@ -119,7 +129,7 @@ export const Image = Node.create<ImageOptions>({
|
|
|
119
129
|
find: inputRegex,
|
|
120
130
|
type: this.type,
|
|
121
131
|
getAttributes: match => {
|
|
122
|
-
const [
|
|
132
|
+
const [, , alt, src, title] = match
|
|
123
133
|
|
|
124
134
|
return { src, alt, title }
|
|
125
135
|
},
|
package/dist/image.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEL,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,KAAK,EAAE;YACL;;;;;;;eAOG;YACH,QAAQ,EAAE,CAAC,OAAO,EAAE;gBAAE,GAAG,EAAE,MAAM,CAAC;gBAAC,GAAG,CAAC,EAAE,MAAM,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,KAAK,UAAU,CAAC;SAClF,CAAA;KACF;CACF;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,QAA6D,CAAA;AAEpF;;;GAGG;AACH,eAAO,MAAM,KAAK,yBAyEhB,CAAA"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,cAAc,YAAY,CAAA;AAE1B,eAAe,KAAK,CAAA"}
|
package/dist/index.umd.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-image"] = {}, global.core));
|
|
5
|
-
})(this, (function (exports, core) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Matches an image to a  on input.
|
|
9
|
-
*/
|
|
10
|
-
const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
11
|
-
/**
|
|
12
|
-
* This extension allows you to insert images.
|
|
13
|
-
* @see https://www.tiptap.dev/api/nodes/image
|
|
14
|
-
*/
|
|
15
|
-
const Image = core.Node.create({
|
|
16
|
-
name: 'image',
|
|
17
|
-
addOptions() {
|
|
18
|
-
return {
|
|
19
|
-
inline: false,
|
|
20
|
-
allowBase64: false,
|
|
21
|
-
HTMLAttributes: {},
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
inline() {
|
|
25
|
-
return this.options.inline;
|
|
26
|
-
},
|
|
27
|
-
group() {
|
|
28
|
-
return this.options.inline ? 'inline' : 'block';
|
|
29
|
-
},
|
|
30
|
-
draggable: true,
|
|
31
|
-
addAttributes() {
|
|
32
|
-
return {
|
|
33
|
-
src: {
|
|
34
|
-
default: null,
|
|
35
|
-
},
|
|
36
|
-
alt: {
|
|
37
|
-
default: null,
|
|
38
|
-
},
|
|
39
|
-
title: {
|
|
40
|
-
default: null,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
parseHTML() {
|
|
45
|
-
return [
|
|
46
|
-
{
|
|
47
|
-
tag: this.options.allowBase64
|
|
48
|
-
? 'img[src]'
|
|
49
|
-
: 'img[src]:not([src^="data:"])',
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
|
-
},
|
|
53
|
-
renderHTML({ HTMLAttributes }) {
|
|
54
|
-
return ['img', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
55
|
-
},
|
|
56
|
-
addCommands() {
|
|
57
|
-
return {
|
|
58
|
-
setImage: options => ({ commands }) => {
|
|
59
|
-
return commands.insertContent({
|
|
60
|
-
type: this.name,
|
|
61
|
-
attrs: options,
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
addInputRules() {
|
|
67
|
-
return [
|
|
68
|
-
core.nodeInputRule({
|
|
69
|
-
find: inputRegex,
|
|
70
|
-
type: this.type,
|
|
71
|
-
getAttributes: match => {
|
|
72
|
-
const [, , alt, src, title] = match;
|
|
73
|
-
return { src, alt, title };
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
];
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
exports.Image = Image;
|
|
81
|
-
exports.default = Image;
|
|
82
|
-
exports.inputRegex = inputRegex;
|
|
83
|
-
|
|
84
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
85
|
-
|
|
86
|
-
}));
|
|
87
|
-
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/image.ts"],"sourcesContent":["import {\n mergeAttributes,\n Node,\n nodeInputRule,\n} from '@tiptap/core'\n\nexport interface ImageOptions {\n /**\n * Controls if the image node should be inline or not.\n * @default false\n * @example true\n */\n inline: boolean,\n\n /**\n * Controls if base64 images are allowed. Enable this if you want to allow\n * base64 image urls in the `src` attribute.\n * @default false\n * @example true\n */\n allowBase64: boolean,\n\n /**\n * HTML attributes to add to the image element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n image: {\n /**\n * Add an image\n * @param options The image attributes\n * @example\n * editor\n * .commands\n * .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })\n */\n setImage: (options: { src: string, alt?: string, title?: string }) => ReturnType,\n }\n }\n}\n\n/**\n * Matches an image to a  on input.\n */\nexport const inputRegex = /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/\n\n/**\n * This extension allows you to insert images.\n * @see https://www.tiptap.dev/api/nodes/image\n */\nexport const Image = Node.create<ImageOptions>({\n name: 'image',\n\n addOptions() {\n return {\n inline: false,\n allowBase64: false,\n HTMLAttributes: {},\n }\n },\n\n inline() {\n return this.options.inline\n },\n\n group() {\n return this.options.inline ? 'inline' : 'block'\n },\n\n draggable: true,\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n alt: {\n default: null,\n },\n title: {\n default: null,\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: this.options.allowBase64\n ? 'img[src]'\n : 'img[src]:not([src^=\"data:\"])',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['img', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]\n },\n\n addCommands() {\n return {\n setImage: options => ({ commands }) => {\n return commands.insertContent({\n type: this.name,\n attrs: options,\n })\n },\n }\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => {\n const [,, alt, src, title] = match\n\n return { src, alt, title }\n },\n }),\n ]\n },\n})\n"],"names":["Node","mergeAttributes","nodeInputRule"],"mappings":";;;;;;EA8CA;;EAEG;AACI,QAAM,UAAU,GAAG;EAE1B;;;EAGG;AACU,QAAA,KAAK,GAAGA,SAAI,CAAC,MAAM,CAAe;EAC7C,IAAA,IAAI,EAAE,OAAO;MAEb,UAAU,GAAA;UACR,OAAO;EACL,YAAA,MAAM,EAAE,KAAK;EACb,YAAA,WAAW,EAAE,KAAK;EAClB,YAAA,cAAc,EAAE,EAAE;WACnB;OACF;MAED,MAAM,GAAA;EACJ,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;OAC3B;MAED,KAAK,GAAA;EACH,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO;OAChD;EAED,IAAA,SAAS,EAAE,IAAI;MAEf,aAAa,GAAA;UACX,OAAO;EACL,YAAA,GAAG,EAAE;EACH,gBAAA,OAAO,EAAE,IAAI;EACd,aAAA;EACD,YAAA,GAAG,EAAE;EACH,gBAAA,OAAO,EAAE,IAAI;EACd,aAAA;EACD,YAAA,KAAK,EAAE;EACL,gBAAA,OAAO,EAAE,IAAI;EACd,aAAA;WACF;OACF;MAED,SAAS,GAAA;UACP,OAAO;EACL,YAAA;EACE,gBAAA,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC;EAChB,sBAAE;EACF,sBAAE,8BAA8B;EACnC,aAAA;WACF;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;EAC3B,QAAA,OAAO,CAAC,KAAK,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;OAC7E;MAED,WAAW,GAAA;UACT,OAAO;cACL,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACpC,OAAO,QAAQ,CAAC,aAAa,CAAC;sBAC5B,IAAI,EAAE,IAAI,CAAC,IAAI;EACf,oBAAA,KAAK,EAAE,OAAO;EACf,iBAAA,CAAC;eACH;WACF;OACF;MAED,aAAa,GAAA;UACX,OAAO;EACL,YAAAC,kBAAa,CAAC;EACZ,gBAAA,IAAI,EAAE,UAAU;kBAChB,IAAI,EAAE,IAAI,CAAC,IAAI;kBACf,aAAa,EAAE,KAAK,IAAG;sBACrB,MAAM,KAAI,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK;EAElC,oBAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;mBAC3B;eACF,CAAC;WACH;OACF;EACF,CAAA;;;;;;;;;;;;"}
|