@qwanyx/ai-editor 1.3.7 → 1.3.8
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.
|
@@ -19,6 +19,9 @@ export interface ImagePayload {
|
|
|
19
19
|
captionVerticalAlign?: CaptionVerticalAlignType;
|
|
20
20
|
captionSize?: CaptionSizeType;
|
|
21
21
|
showFileName?: boolean;
|
|
22
|
+
borderWidth?: number;
|
|
23
|
+
borderColor?: string;
|
|
24
|
+
borderRadius?: number;
|
|
22
25
|
}
|
|
23
26
|
export type SerializedImageNode = Spread<{
|
|
24
27
|
src: string;
|
|
@@ -34,6 +37,9 @@ export type SerializedImageNode = Spread<{
|
|
|
34
37
|
captionVerticalAlign?: CaptionVerticalAlignType;
|
|
35
38
|
captionSize?: CaptionSizeType;
|
|
36
39
|
showFileName?: boolean;
|
|
40
|
+
borderWidth?: number;
|
|
41
|
+
borderColor?: string;
|
|
42
|
+
borderRadius?: number;
|
|
37
43
|
}, SerializedLexicalNode>;
|
|
38
44
|
export declare class ImageNode extends DecoratorNode<React.ReactElement> {
|
|
39
45
|
__src: string;
|
|
@@ -49,9 +55,12 @@ export declare class ImageNode extends DecoratorNode<React.ReactElement> {
|
|
|
49
55
|
__captionVerticalAlign?: CaptionVerticalAlignType;
|
|
50
56
|
__captionSize?: CaptionSizeType;
|
|
51
57
|
__showFileName?: boolean;
|
|
58
|
+
__borderWidth?: number;
|
|
59
|
+
__borderColor?: string;
|
|
60
|
+
__borderRadius?: number;
|
|
52
61
|
static getType(): string;
|
|
53
62
|
static clone(node: ImageNode): ImageNode;
|
|
54
|
-
constructor(src: string, altText?: string, width?: number, height?: number, copyright?: string, photographer?: string, comment?: string, float?: ImageFloatType, captionPosition?: CaptionPositionType, captionAlign?: CaptionAlignType, captionVerticalAlign?: CaptionVerticalAlignType, captionSize?: CaptionSizeType, showFileName?: boolean, key?: NodeKey);
|
|
63
|
+
constructor(src: string, altText?: string, width?: number, height?: number, copyright?: string, photographer?: string, comment?: string, float?: ImageFloatType, captionPosition?: CaptionPositionType, captionAlign?: CaptionAlignType, captionVerticalAlign?: CaptionVerticalAlignType, captionSize?: CaptionSizeType, showFileName?: boolean, borderWidth?: number, borderColor?: string, borderRadius?: number, key?: NodeKey);
|
|
55
64
|
createDOM(): HTMLElement;
|
|
56
65
|
updateDOM(): false;
|
|
57
66
|
setSrc(src: string): void;
|
|
@@ -80,6 +89,12 @@ export declare class ImageNode extends DecoratorNode<React.ReactElement> {
|
|
|
80
89
|
getCaptionSize(): CaptionSizeType | undefined;
|
|
81
90
|
setShowFileName(showFileName: boolean | undefined): void;
|
|
82
91
|
getShowFileName(): boolean | undefined;
|
|
92
|
+
setBorderWidth(borderWidth: number | undefined): void;
|
|
93
|
+
getBorderWidth(): number | undefined;
|
|
94
|
+
setBorderColor(borderColor: string | undefined): void;
|
|
95
|
+
getBorderColor(): string | undefined;
|
|
96
|
+
setBorderRadius(borderRadius: number | undefined): void;
|
|
97
|
+
getBorderRadius(): number | undefined;
|
|
83
98
|
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
84
99
|
exportJSON(): SerializedImageNode;
|
|
85
100
|
exportDOM(): DOMExportOutput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageNode.d.ts","sourceRoot":"","sources":["../../src/nodes/ImageNode.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EAUP,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAmD,MAAM,OAAO,CAAA;AAGvE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AACtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AAChE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC1D,MAAM,M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IAAI,eAAe,GAAG,SAAS;IAI7C,eAAe,CAAC,YAAY,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAKxD,eAAe,IAAI,OAAO,GAAG,SAAS;IAItC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAKrD,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAKrD,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAKvD,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,mBAAmB,GAAG,SAAS;IAKjE,UAAU,IAAI,mBAAmB;IAuBjC,SAAS,IAAI,eAAe;IAS5B,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAgB3C,QAAQ,IAAI,KAAK,CAAC,YAAY;CAuB/B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,CAmBjE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,SAAS,CAEpF"}
|
package/dist/nodes/ImageNode.js
CHANGED
|
@@ -17,7 +17,7 @@ const CAPTION_FONT_SIZES = {
|
|
|
17
17
|
medium: { base: 16, alt: 18 },
|
|
18
18
|
large: { base: 24, alt: 26 }
|
|
19
19
|
};
|
|
20
|
-
function ImageComponent({ src, altText, width, height, copyright: initialCopyright, photographer: initialPhotographer, comment: initialComment, float: initialFloat, captionPosition: initialCaptionPosition, captionAlign: initialCaptionAlign, captionVerticalAlign: initialCaptionVerticalAlign, captionSize: initialCaptionSize, showFileName: initialShowFileName, nodeKey, }) {
|
|
20
|
+
function ImageComponent({ src, altText, width, height, copyright: initialCopyright, photographer: initialPhotographer, comment: initialComment, float: initialFloat, captionPosition: initialCaptionPosition, captionAlign: initialCaptionAlign, captionVerticalAlign: initialCaptionVerticalAlign, captionSize: initialCaptionSize, showFileName: initialShowFileName, borderWidth: initialBorderWidth, borderColor: initialBorderColor, borderRadius: initialBorderRadius, nodeKey, }) {
|
|
21
21
|
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
22
22
|
const { isViewer } = (0, EditorModeContext_1.useEditorMode)();
|
|
23
23
|
const containerRef = (0, react_1.useRef)(null);
|
|
@@ -38,6 +38,9 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
38
38
|
const [displayCaptionVerticalAlign, setDisplayCaptionVerticalAlign] = (0, react_1.useState)(initialCaptionVerticalAlign || 'middle');
|
|
39
39
|
const [displayCaptionSize, setDisplayCaptionSize] = (0, react_1.useState)(initialCaptionSize || 'small');
|
|
40
40
|
const [displayShowFileName, setDisplayShowFileName] = (0, react_1.useState)(initialShowFileName || false);
|
|
41
|
+
const [displayBorderWidth, setDisplayBorderWidth] = (0, react_1.useState)(initialBorderWidth || 0);
|
|
42
|
+
const [displayBorderColor, setDisplayBorderColor] = (0, react_1.useState)(initialBorderColor || '#000000');
|
|
43
|
+
const [displayBorderRadius, setDisplayBorderRadius] = (0, react_1.useState)(initialBorderRadius || 0);
|
|
41
44
|
// Edit form state
|
|
42
45
|
const [editSrc, setEditSrc] = (0, react_1.useState)('');
|
|
43
46
|
const [editAltText, setEditAltText] = (0, react_1.useState)('');
|
|
@@ -50,6 +53,9 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
50
53
|
const [editCaptionVerticalAlign, setEditCaptionVerticalAlign] = (0, react_1.useState)('middle');
|
|
51
54
|
const [editCaptionSize, setEditCaptionSize] = (0, react_1.useState)('small');
|
|
52
55
|
const [editShowFileName, setEditShowFileName] = (0, react_1.useState)(false);
|
|
56
|
+
const [editBorderWidth, setEditBorderWidth] = (0, react_1.useState)(0);
|
|
57
|
+
const [editBorderColor, setEditBorderColor] = (0, react_1.useState)('#000000');
|
|
58
|
+
const [editBorderRadius, setEditBorderRadius] = (0, react_1.useState)(0);
|
|
53
59
|
// Extract file name from URL
|
|
54
60
|
const getFileName = (url) => {
|
|
55
61
|
try {
|
|
@@ -154,6 +160,9 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
154
160
|
setEditCaptionVerticalAlign(node.getCaptionVerticalAlign() || 'middle');
|
|
155
161
|
setEditCaptionSize(node.getCaptionSize() || 'small');
|
|
156
162
|
setEditShowFileName(node.getShowFileName() || false);
|
|
163
|
+
setEditBorderWidth(node.getBorderWidth() || 0);
|
|
164
|
+
setEditBorderColor(node.getBorderColor() || '#000000');
|
|
165
|
+
setEditBorderRadius(node.getBorderRadius() || 0);
|
|
157
166
|
}
|
|
158
167
|
});
|
|
159
168
|
setShowMetadataEditor(true);
|
|
@@ -194,6 +203,9 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
194
203
|
node.setCaptionVerticalAlign(editCaptionVerticalAlign);
|
|
195
204
|
node.setCaptionSize(editCaptionSize);
|
|
196
205
|
node.setShowFileName(editShowFileName);
|
|
206
|
+
node.setBorderWidth(editBorderWidth || undefined);
|
|
207
|
+
node.setBorderColor(editBorderColor || undefined);
|
|
208
|
+
node.setBorderRadius(editBorderRadius || undefined);
|
|
197
209
|
}
|
|
198
210
|
});
|
|
199
211
|
// Update display state
|
|
@@ -206,8 +218,11 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
206
218
|
setDisplayCaptionVerticalAlign(editCaptionVerticalAlign);
|
|
207
219
|
setDisplayCaptionSize(editCaptionSize);
|
|
208
220
|
setDisplayShowFileName(editShowFileName);
|
|
221
|
+
setDisplayBorderWidth(editBorderWidth);
|
|
222
|
+
setDisplayBorderColor(editBorderColor);
|
|
223
|
+
setDisplayBorderRadius(editBorderRadius);
|
|
209
224
|
setShowMetadataEditor(false);
|
|
210
|
-
}, [editor, nodeKey, editSrc, editAltText, editCopyright, editPhotographer, editComment, editFloat, editCaptionPosition, editCaptionAlign, editCaptionVerticalAlign, editCaptionSize, editShowFileName]);
|
|
225
|
+
}, [editor, nodeKey, editSrc, editAltText, editCopyright, editPhotographer, editComment, editFloat, editCaptionPosition, editCaptionAlign, editCaptionVerticalAlign, editCaptionSize, editShowFileName, editBorderWidth, editBorderColor, editBorderRadius]);
|
|
211
226
|
// Get float styles
|
|
212
227
|
const getFloatStyles = () => {
|
|
213
228
|
if (displayFloat === 'left') {
|
|
@@ -263,7 +278,8 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
263
278
|
height: 'auto',
|
|
264
279
|
width: currentWidth ? `${currentWidth}px` : 'auto',
|
|
265
280
|
display: 'block',
|
|
266
|
-
borderRadius: '4px',
|
|
281
|
+
borderRadius: displayBorderRadius ? `${displayBorderRadius}px` : '4px',
|
|
282
|
+
border: displayBorderWidth ? `${displayBorderWidth}px solid ${displayBorderColor}` : 'none',
|
|
267
283
|
outline: !isViewer && isSelected ? '2px solid #3b82f6' : 'none',
|
|
268
284
|
cursor: 'pointer',
|
|
269
285
|
}, draggable: false }), displayCaptionPosition === 'overlay' && hasMetadata && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -624,7 +640,28 @@ function ImageComponent({ src, altText, width, height, copyright: initialCopyrig
|
|
|
624
640
|
width: '18px',
|
|
625
641
|
height: '18px',
|
|
626
642
|
cursor: 'pointer',
|
|
627
|
-
} }), (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px', color: '#6b7280' }, children: "insert_drive_file" }), "Afficher le nom du fichier"] }) })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: '
|
|
643
|
+
} }), (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px', color: '#6b7280' }, children: "insert_drive_file" }), "Afficher le nom du fichier"] }) })), (0, jsx_runtime_1.jsx)("hr", { style: { border: 'none', borderTop: '1px solid #e5e7eb', margin: '20px 0' } }), (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: '16px' }, children: [(0, jsx_runtime_1.jsxs)("label", { style: { display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '6px', fontSize: '14px', fontWeight: 500, color: '#374151' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px', color: '#6b7280' }, children: "crop_square" }), "Bordure"] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: '12px', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)("label", { style: { fontSize: '12px', color: '#6b7280', marginBottom: '4px', display: 'block' }, children: "\u00C9paisseur (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", min: "0", max: "20", value: editBorderWidth, onChange: (e) => setEditBorderWidth(parseInt(e.target.value) || 0), style: {
|
|
644
|
+
width: '100%',
|
|
645
|
+
padding: '8px 10px',
|
|
646
|
+
border: '1px solid #d1d5db',
|
|
647
|
+
borderRadius: '6px',
|
|
648
|
+
fontSize: '14px',
|
|
649
|
+
boxSizing: 'border-box',
|
|
650
|
+
} })] }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)("label", { style: { fontSize: '12px', color: '#6b7280', marginBottom: '4px', display: 'block' }, children: "Couleur" }), (0, jsx_runtime_1.jsx)("input", { type: "color", value: editBorderColor, onChange: (e) => setEditBorderColor(e.target.value), style: {
|
|
651
|
+
width: '100%',
|
|
652
|
+
height: '38px',
|
|
653
|
+
padding: '2px',
|
|
654
|
+
border: '1px solid #d1d5db',
|
|
655
|
+
borderRadius: '6px',
|
|
656
|
+
cursor: 'pointer',
|
|
657
|
+
} })] }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)("label", { style: { fontSize: '12px', color: '#6b7280', marginBottom: '4px', display: 'block' }, children: "Coins arrondis (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", min: "0", max: "100", value: editBorderRadius, onChange: (e) => setEditBorderRadius(parseInt(e.target.value) || 0), style: {
|
|
658
|
+
width: '100%',
|
|
659
|
+
padding: '8px 10px',
|
|
660
|
+
border: '1px solid #d1d5db',
|
|
661
|
+
borderRadius: '6px',
|
|
662
|
+
fontSize: '14px',
|
|
663
|
+
boxSizing: 'border-box',
|
|
664
|
+
} })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: '12px', justifyContent: 'flex-end' }, children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowMetadataEditor(false), style: {
|
|
628
665
|
padding: '10px 20px',
|
|
629
666
|
border: '1px solid #d1d5db',
|
|
630
667
|
backgroundColor: 'white',
|
|
@@ -694,9 +731,9 @@ class ImageNode extends lexical_1.DecoratorNode {
|
|
|
694
731
|
return 'image';
|
|
695
732
|
}
|
|
696
733
|
static clone(node) {
|
|
697
|
-
return new ImageNode(node.__src, node.__altText, node.__width, node.__height, node.__copyright, node.__photographer, node.__comment, node.__float, node.__captionPosition, node.__captionAlign, node.__captionVerticalAlign, node.__captionSize, node.__showFileName, node.__key);
|
|
734
|
+
return new ImageNode(node.__src, node.__altText, node.__width, node.__height, node.__copyright, node.__photographer, node.__comment, node.__float, node.__captionPosition, node.__captionAlign, node.__captionVerticalAlign, node.__captionSize, node.__showFileName, node.__borderWidth, node.__borderColor, node.__borderRadius, node.__key);
|
|
698
735
|
}
|
|
699
|
-
constructor(src, altText = '', width, height, copyright, photographer, comment, float, captionPosition, captionAlign, captionVerticalAlign, captionSize, showFileName, key) {
|
|
736
|
+
constructor(src, altText = '', width, height, copyright, photographer, comment, float, captionPosition, captionAlign, captionVerticalAlign, captionSize, showFileName, borderWidth, borderColor, borderRadius, key) {
|
|
700
737
|
super(key);
|
|
701
738
|
this.__src = src;
|
|
702
739
|
this.__altText = altText;
|
|
@@ -711,6 +748,9 @@ class ImageNode extends lexical_1.DecoratorNode {
|
|
|
711
748
|
this.__captionVerticalAlign = captionVerticalAlign;
|
|
712
749
|
this.__captionSize = captionSize;
|
|
713
750
|
this.__showFileName = showFileName;
|
|
751
|
+
this.__borderWidth = borderWidth;
|
|
752
|
+
this.__borderColor = borderColor;
|
|
753
|
+
this.__borderRadius = borderRadius;
|
|
714
754
|
}
|
|
715
755
|
createDOM() {
|
|
716
756
|
const span = document.createElement('span');
|
|
@@ -811,9 +851,30 @@ class ImageNode extends lexical_1.DecoratorNode {
|
|
|
811
851
|
getShowFileName() {
|
|
812
852
|
return this.__showFileName;
|
|
813
853
|
}
|
|
854
|
+
setBorderWidth(borderWidth) {
|
|
855
|
+
const writable = this.getWritable();
|
|
856
|
+
writable.__borderWidth = borderWidth;
|
|
857
|
+
}
|
|
858
|
+
getBorderWidth() {
|
|
859
|
+
return this.__borderWidth;
|
|
860
|
+
}
|
|
861
|
+
setBorderColor(borderColor) {
|
|
862
|
+
const writable = this.getWritable();
|
|
863
|
+
writable.__borderColor = borderColor;
|
|
864
|
+
}
|
|
865
|
+
getBorderColor() {
|
|
866
|
+
return this.__borderColor;
|
|
867
|
+
}
|
|
868
|
+
setBorderRadius(borderRadius) {
|
|
869
|
+
const writable = this.getWritable();
|
|
870
|
+
writable.__borderRadius = borderRadius;
|
|
871
|
+
}
|
|
872
|
+
getBorderRadius() {
|
|
873
|
+
return this.__borderRadius;
|
|
874
|
+
}
|
|
814
875
|
static importJSON(serializedNode) {
|
|
815
|
-
const { src, altText, width, height, copyright, photographer, comment, float, captionPosition, captionAlign, captionVerticalAlign, captionSize, showFileName } = serializedNode;
|
|
816
|
-
return $createImageNode({ src, altText, width, height, copyright, photographer, comment, float, captionPosition, captionAlign, captionVerticalAlign, captionSize, showFileName });
|
|
876
|
+
const { src, altText, width, height, copyright, photographer, comment, float, captionPosition, captionAlign, captionVerticalAlign, captionSize, showFileName, borderWidth, borderColor, borderRadius } = serializedNode;
|
|
877
|
+
return $createImageNode({ src, altText, width, height, copyright, photographer, comment, float, captionPosition, captionAlign, captionVerticalAlign, captionSize, showFileName, borderWidth, borderColor, borderRadius });
|
|
817
878
|
}
|
|
818
879
|
exportJSON() {
|
|
819
880
|
return {
|
|
@@ -832,6 +893,9 @@ class ImageNode extends lexical_1.DecoratorNode {
|
|
|
832
893
|
captionVerticalAlign: this.__captionVerticalAlign,
|
|
833
894
|
captionSize: this.__captionSize,
|
|
834
895
|
showFileName: this.__showFileName,
|
|
896
|
+
borderWidth: this.__borderWidth,
|
|
897
|
+
borderColor: this.__borderColor,
|
|
898
|
+
borderRadius: this.__borderRadius,
|
|
835
899
|
};
|
|
836
900
|
}
|
|
837
901
|
exportDOM() {
|
|
@@ -860,12 +924,12 @@ class ImageNode extends lexical_1.DecoratorNode {
|
|
|
860
924
|
};
|
|
861
925
|
}
|
|
862
926
|
decorate() {
|
|
863
|
-
return ((0, jsx_runtime_1.jsx)(ImageComponent, { src: this.__src, altText: this.__altText, width: this.__width, height: this.__height, copyright: this.__copyright, photographer: this.__photographer, comment: this.__comment, float: this.__float, captionPosition: this.__captionPosition, captionAlign: this.__captionAlign, captionVerticalAlign: this.__captionVerticalAlign, captionSize: this.__captionSize, showFileName: this.__showFileName, nodeKey: this.__key }));
|
|
927
|
+
return ((0, jsx_runtime_1.jsx)(ImageComponent, { src: this.__src, altText: this.__altText, width: this.__width, height: this.__height, copyright: this.__copyright, photographer: this.__photographer, comment: this.__comment, float: this.__float, captionPosition: this.__captionPosition, captionAlign: this.__captionAlign, captionVerticalAlign: this.__captionVerticalAlign, captionSize: this.__captionSize, showFileName: this.__showFileName, borderWidth: this.__borderWidth, borderColor: this.__borderColor, borderRadius: this.__borderRadius, nodeKey: this.__key }));
|
|
864
928
|
}
|
|
865
929
|
}
|
|
866
930
|
exports.ImageNode = ImageNode;
|
|
867
931
|
function $createImageNode(payload) {
|
|
868
|
-
return new ImageNode(payload.src, payload.altText || '', payload.width, payload.height, payload.copyright, payload.photographer, payload.comment, payload.float, payload.captionPosition, payload.captionAlign, payload.captionVerticalAlign, payload.captionSize, payload.showFileName);
|
|
932
|
+
return new ImageNode(payload.src, payload.altText || '', payload.width, payload.height, payload.copyright, payload.photographer, payload.comment, payload.float, payload.captionPosition, payload.captionAlign, payload.captionVerticalAlign, payload.captionSize, payload.showFileName, payload.borderWidth, payload.borderColor, payload.borderRadius);
|
|
869
933
|
}
|
|
870
934
|
function $isImageNode(node) {
|
|
871
935
|
return node instanceof ImageNode;
|