@markput/react 0.2.0 → 0.3.0
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/README.md +3 -1
- package/index.d.ts +11 -0
- package/index.js +603 -329
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# [Marked Input](https://marked-input.vercel.app)
|
|
1
|
+
# [Marked Input](https://marked-input.vercel.app)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@markput/react) [](https://www.npmjs.com/package/@markput/vue) [](https://bundlephobia.com/package/@markput/react) [](https://bundlephobia.com/package/@markput/vue) [](https://marked-input.vercel.app)
|
|
2
4
|
|
|
3
5
|
<img width="521" alt="image" src="https://user-images.githubusercontent.com/37639183/182974441-49e4b247-449a-47ba-a090-2cb3aab7ce44.png">
|
|
4
6
|
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { annotate } from '@markput/core';
|
|
2
|
+
import { Block } from '@markput/core';
|
|
2
3
|
import type { ComponentType } from 'react';
|
|
3
4
|
import type { CoreOption } from '@markput/core';
|
|
4
5
|
import type { CSSProperties } from 'react';
|
|
@@ -15,11 +16,15 @@ import type { OverlayTrigger } from '@markput/core';
|
|
|
15
16
|
import type { ReactNode } from 'react';
|
|
16
17
|
import type { Ref } from 'react';
|
|
17
18
|
import type { RefObject } from 'react';
|
|
19
|
+
import { reorderBlocks } from '@markput/core';
|
|
20
|
+
import { splitTokensIntoBlocks } from '@markput/core';
|
|
18
21
|
import { TextToken } from '@markput/core';
|
|
19
22
|
import { Token } from '@markput/core';
|
|
20
23
|
|
|
21
24
|
export { annotate }
|
|
22
25
|
|
|
26
|
+
export { Block }
|
|
27
|
+
|
|
23
28
|
/**
|
|
24
29
|
* Data attributes with automatic camelCase to kebab-case conversion
|
|
25
30
|
*/
|
|
@@ -86,6 +91,8 @@ export declare interface MarkedInputProps<TMarkProps = MarkProps, TOverlayProps
|
|
|
86
91
|
onChange?: (value: string) => void;
|
|
87
92
|
/** Read-only mode */
|
|
88
93
|
readOnly?: boolean;
|
|
94
|
+
/** Enable Notion-like draggable blocks with drag handles for reordering */
|
|
95
|
+
block?: boolean;
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
export { MarkHandler }
|
|
@@ -167,6 +174,8 @@ export declare interface OverlayProps {
|
|
|
167
174
|
data?: string[];
|
|
168
175
|
}
|
|
169
176
|
|
|
177
|
+
export { reorderBlocks }
|
|
178
|
+
|
|
170
179
|
/**
|
|
171
180
|
* Props for each slot component
|
|
172
181
|
*/
|
|
@@ -187,6 +196,8 @@ declare interface Slots {
|
|
|
187
196
|
span?: ElementType<HTMLAttributes<HTMLSpanElement>>;
|
|
188
197
|
}
|
|
189
198
|
|
|
199
|
+
export { splitTokensIntoBlocks }
|
|
200
|
+
|
|
190
201
|
export { TextToken }
|
|
191
202
|
|
|
192
203
|
export { Token }
|