mino-daisy-react 1.1.5 → 1.1.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.
- package/dist/index.js +541 -476
- package/dist/rich-text-editor/image-node.d.ts +37 -0
- package/dist/rich-text-editor/image-node.d.ts.map +1 -0
- package/dist/rich-text-editor/markdown-transformers.d.ts +12 -6
- package/dist/rich-text-editor/markdown-transformers.d.ts.map +1 -1
- package/dist/rich-text-editor/plugins.d.ts +4 -1
- package/dist/rich-text-editor/plugins.d.ts.map +1 -1
- package/dist/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/rich-text-editor/toolbar.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
2
|
+
import { DecoratorNode } from 'lexical';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
export interface ImagePayload {
|
|
5
|
+
src: string;
|
|
6
|
+
alt?: string;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
height?: number | string;
|
|
9
|
+
key?: NodeKey;
|
|
10
|
+
}
|
|
11
|
+
export type SerializedImageNode = Spread<{
|
|
12
|
+
src: string;
|
|
13
|
+
alt?: string;
|
|
14
|
+
width?: number | string;
|
|
15
|
+
height?: number | string;
|
|
16
|
+
}, SerializedLexicalNode>;
|
|
17
|
+
export declare class ImageNode extends DecoratorNode<ReactNode> {
|
|
18
|
+
__src: string;
|
|
19
|
+
__alt?: string;
|
|
20
|
+
__width?: number | string;
|
|
21
|
+
__height?: number | string;
|
|
22
|
+
static getType(): string;
|
|
23
|
+
static clone(node: ImageNode): ImageNode;
|
|
24
|
+
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
25
|
+
exportJSON(): SerializedImageNode;
|
|
26
|
+
static importDOM(): DOMConversionMap | null;
|
|
27
|
+
constructor(src: string, alt?: string, width?: number | string, height?: number | string, key?: NodeKey);
|
|
28
|
+
exportDOM(): DOMExportOutput;
|
|
29
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
30
|
+
updateDOM(): false;
|
|
31
|
+
getSrc(): string;
|
|
32
|
+
getAlt(): string | undefined;
|
|
33
|
+
decorate(): ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export declare function $createImageNode({ src, alt, width, height, key }: ImagePayload): ImageNode;
|
|
36
|
+
export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
|
|
37
|
+
//# sourceMappingURL=image-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-node.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/image-node.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,EAAyB,aAAa,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC;IACE,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACzB,EACD,qBAAqB,CACtB,CAAA;AAWD,qBAAa,SAAU,SAAQ,aAAa,CAAC,SAAS,CAAC;IACrD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAE1B,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAIxC,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,mBAAmB,GAAG,SAAS;IAKjE,UAAU,IAAI,mBAAmB;IAWjC,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;gBAUzC,GAAG,EAAE,MAAM,EACX,GAAG,CAAC,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EACxB,GAAG,CAAC,EAAE,OAAO;IASf,SAAS,IAAI,eAAe;IAe5B,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;IAU5C,SAAS,IAAI,KAAK;IAIlB,MAAM,IAAI,MAAM;IAIhB,MAAM,IAAI,MAAM,GAAG,SAAS;IAI5B,QAAQ,IAAI,SAAS;CAWtB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,YAAY,GAAG,SAAS,CAE1F;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,SAAS,CAEpF"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { type TextMatchTransformer } from '@lexical/markdown';
|
|
2
|
+
/**
|
|
3
|
+
* Image transformer for markdown format: 
|
|
4
|
+
*/
|
|
5
|
+
export declare const IMAGE: TextMatchTransformer;
|
|
1
6
|
/**
|
|
2
7
|
* Markdown transformers matching RichTextEditor's supported nodes.
|
|
3
8
|
*
|
|
@@ -15,15 +20,11 @@
|
|
|
15
20
|
* - Strikethrough: ~~strikethrough~~
|
|
16
21
|
* - Inline code: `code`
|
|
17
22
|
* - Links: [text](url)
|
|
23
|
+
* - Images: 
|
|
18
24
|
* - Unordered lists: - item or * item
|
|
19
25
|
* - Ordered lists: 1. item
|
|
20
26
|
*/
|
|
21
|
-
export declare const MARKDOWN_TRANSFORMERS: (
|
|
22
|
-
format: ReadonlyArray<import("lexical").TextFormatType>;
|
|
23
|
-
tag: string;
|
|
24
|
-
intraword?: boolean;
|
|
25
|
-
type: "text-format";
|
|
26
|
-
}> | Readonly<{
|
|
27
|
+
export declare const MARKDOWN_TRANSFORMERS: (Readonly<{
|
|
27
28
|
dependencies: Array<import("lexical").Klass<import("lexical").LexicalNode>>;
|
|
28
29
|
export?: (node: import("lexical").LexicalNode, exportChildren: (node: import("lexical").ElementNode) => string, exportFormat: (node: import("lexical").TextNode, textContent: string) => string) => string | null;
|
|
29
30
|
importRegExp?: RegExp;
|
|
@@ -32,5 +33,10 @@ export declare const MARKDOWN_TRANSFORMERS: (import("@lexical/markdown").Element
|
|
|
32
33
|
getEndIndex?: (node: import("lexical").TextNode, match: RegExpMatchArray) => number | false;
|
|
33
34
|
trigger?: string;
|
|
34
35
|
type: "text-match";
|
|
36
|
+
}> | import("@lexical/markdown").ElementTransformer | Readonly<{
|
|
37
|
+
format: ReadonlyArray<import("lexical").TextFormatType>;
|
|
38
|
+
tag: string;
|
|
39
|
+
intraword?: boolean;
|
|
40
|
+
type: "text-format";
|
|
35
41
|
}>)[];
|
|
36
42
|
//# sourceMappingURL=markdown-transformers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-transformers.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/markdown-transformers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown-transformers.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/markdown-transformers.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAA;AAG1B;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,oBAiBnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;KAejC,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type LexicalCommand, type LexicalEditor } from 'lexical';
|
|
2
|
+
import { type ImagePayload } from './image-node';
|
|
3
|
+
export declare const INSERT_IMAGE_COMMAND: LexicalCommand<ImagePayload>;
|
|
2
4
|
export interface OnChangePluginProps {
|
|
3
5
|
onChange?: (content: string) => void;
|
|
4
6
|
contentFormat?: 'html' | 'markdown';
|
|
@@ -17,4 +19,5 @@ export interface MarkdownShortcutsPluginProps {
|
|
|
17
19
|
enabled?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare function MarkdownShortcutsPlugin({ enabled }: MarkdownShortcutsPluginProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export declare function ImagePlugin(): null;
|
|
20
23
|
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/plugins.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/plugins.tsx"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAGlE,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,YAAY,CACvB,CAAA;AAEvC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CACpC;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,aAAsB,EAAE,EAAE,mBAAmB,QAoBvF;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;CACrC;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,cAAc,QActD;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CACpC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,aAAsB,GACvB,EAAE,yBAAyB,QAuB3B;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,uBAAuB,CAAC,EAAE,OAAe,EAAE,EAAE,4BAA4B,kDAIxF;AAED,wBAAgB,WAAW,SAmB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/rich-text-editor.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"rich-text-editor.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/rich-text-editor.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAW3C,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAEpC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAEnC;;;;;;;;;;;;;;;;;OAiBG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IAEjC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;CAC/B;AA+BD,wBAAgB,cAAc,CAAC,EAC7B,cAAc,EACd,QAAQ,EACR,aAAsB,EACtB,uBAA+B,EAC/B,QAAgB,EAChB,WAA+B,EAC/B,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAgDrB;yBA5De,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/rich-text-editor/toolbar.tsx"],"names":[],"mappings":"AAmCA,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAcD,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE,YAAY,2CAmTlD"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/giacomorebonato/mino-daisy-react.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.1.
|
|
7
|
+
"version": "1.1.8",
|
|
8
8
|
"description": "React component library wrapping DaisyUI components",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/index.js",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@types/node": "^24.10.0",
|
|
53
53
|
"@types/react": "^19.2.2",
|
|
54
54
|
"@types/react-dom": "^19.2.2",
|
|
55
|
+
"@typescript/native-preview": "^7.0.0-dev.20251212.1",
|
|
55
56
|
"daisyui": "^5.4.5",
|
|
56
57
|
"playwright": "^1.56.1",
|
|
57
58
|
"react": "^19.2.0",
|