@qwanyx/stack 0.2.59 → 0.2.61
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/components/ImageNode.d.ts +5 -3
- package/dist/components/QRCodeNode.d.ts +33 -0
- package/dist/index.cjs.js +39 -39
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +1665 -1534
- package/dist/stack-BDMct_Gn.mjs +4 -0
- package/dist/stack-CDTLCo61.js +1 -0
- package/package.json +14 -7
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ImageNode for Lexical
|
|
3
3
|
* Allows embedding images in the rich text editor
|
|
4
|
+
* Uses DecoratorNode to render React components properly
|
|
4
5
|
*/
|
|
6
|
+
import React from 'react';
|
|
5
7
|
import { DecoratorNode, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
6
8
|
export interface ImagePayload {
|
|
7
9
|
src: string;
|
|
@@ -15,7 +17,7 @@ export type SerializedImageNode = Spread<{
|
|
|
15
17
|
width?: number;
|
|
16
18
|
height?: number;
|
|
17
19
|
}, SerializedLexicalNode>;
|
|
18
|
-
export declare class ImageNode extends DecoratorNode<
|
|
20
|
+
export declare class ImageNode extends DecoratorNode<React.ReactElement> {
|
|
19
21
|
__src: string;
|
|
20
22
|
__altText: string;
|
|
21
23
|
__width?: number;
|
|
@@ -28,8 +30,8 @@ export declare class ImageNode extends DecoratorNode<null> {
|
|
|
28
30
|
static importDOM(): DOMConversionMap | null;
|
|
29
31
|
exportDOM(): DOMExportOutput;
|
|
30
32
|
createDOM(): HTMLElement;
|
|
31
|
-
updateDOM(
|
|
32
|
-
decorate():
|
|
33
|
+
updateDOM(): boolean;
|
|
34
|
+
decorate(): React.ReactElement;
|
|
33
35
|
}
|
|
34
36
|
export declare function $createImageNode(payload: ImagePayload): ImageNode;
|
|
35
37
|
export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QRCodeNode for Lexical
|
|
3
|
+
* Renders QR codes directly using React - no data URL conversion needed
|
|
4
|
+
* Requires qrcode.react as a peer dependency
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { DecoratorNode, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
8
|
+
export interface QRCodePayload {
|
|
9
|
+
data: string;
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
export type SerializedQRCodeNode = Spread<{
|
|
13
|
+
data: string;
|
|
14
|
+
size?: number;
|
|
15
|
+
}, SerializedLexicalNode>;
|
|
16
|
+
export declare class QRCodeNode extends DecoratorNode<React.ReactElement> {
|
|
17
|
+
__data: string;
|
|
18
|
+
__size: number;
|
|
19
|
+
static getType(): string;
|
|
20
|
+
static clone(node: QRCodeNode): QRCodeNode;
|
|
21
|
+
constructor(data: string, size?: number, key?: NodeKey);
|
|
22
|
+
static importJSON(serializedNode: SerializedQRCodeNode): QRCodeNode;
|
|
23
|
+
exportJSON(): SerializedQRCodeNode;
|
|
24
|
+
static importDOM(): DOMConversionMap | null;
|
|
25
|
+
exportDOM(): DOMExportOutput;
|
|
26
|
+
createDOM(): HTMLElement;
|
|
27
|
+
updateDOM(): boolean;
|
|
28
|
+
decorate(): React.ReactElement;
|
|
29
|
+
getData(): string;
|
|
30
|
+
getSize(): number;
|
|
31
|
+
}
|
|
32
|
+
export declare function $createQRCodeNode(payload: QRCodePayload): QRCodeNode;
|
|
33
|
+
export declare function $isQRCodeNode(node: LexicalNode | null | undefined): node is QRCodeNode;
|