@markput/react 0.6.0 → 0.7.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/index.d.ts +11 -12
- package/index.js +844 -642
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -49,13 +49,15 @@ export declare function MarkedInput<TMarkProps = MarkProps, TOverlayProps = Over
|
|
|
49
49
|
export declare interface MarkedInputProps<TMarkProps = MarkProps, TOverlayProps = OverlayProps> {
|
|
50
50
|
/** Ref to handler */
|
|
51
51
|
ref?: Ref<MarkputHandler>;
|
|
52
|
-
/** Global component used for rendering
|
|
52
|
+
/** Global component used for rendering text tokens (default: built-in Span) */
|
|
53
|
+
Span?: ComponentType<MarkProps>;
|
|
54
|
+
/** Global component used for rendering markups (fallback for option.Mark) */
|
|
53
55
|
Mark?: ComponentType<TMarkProps>;
|
|
54
|
-
/** Global component used for rendering overlays (fallback for option.
|
|
56
|
+
/** Global component used for rendering overlays (fallback for option.Overlay) */
|
|
55
57
|
Overlay?: ComponentType<TOverlayProps>;
|
|
56
58
|
/**
|
|
57
59
|
* Configuration options for markups and overlays.
|
|
58
|
-
* Each option can specify its own
|
|
60
|
+
* Each option can specify its own component via option.Mark or option.Overlay.
|
|
59
61
|
* Falls back to global Mark/Overlay components when not specified.
|
|
60
62
|
*/
|
|
61
63
|
options?: Option_2<TMarkProps, TOverlayProps>[];
|
|
@@ -101,14 +103,10 @@ export { MarkHandler }
|
|
|
101
103
|
* Props passed to Mark components.
|
|
102
104
|
*/
|
|
103
105
|
export declare interface MarkProps {
|
|
104
|
-
/** Custom component to render this mark */
|
|
105
|
-
slot?: ComponentType<MarkProps>;
|
|
106
106
|
/** Main content value of the mark */
|
|
107
107
|
value?: string;
|
|
108
108
|
/** Additional metadata for the mark */
|
|
109
109
|
meta?: string;
|
|
110
|
-
/** Nested content as string (raw, unparsed) */
|
|
111
|
-
nested?: string;
|
|
112
110
|
/** Rendered children content (ReactNode) for nested marks */
|
|
113
111
|
children?: ReactNode;
|
|
114
112
|
}
|
|
@@ -132,11 +130,15 @@ export { Markup }
|
|
|
132
130
|
* }
|
|
133
131
|
*/
|
|
134
132
|
declare interface Option_2<TMarkProps = MarkProps, TOverlayProps = OverlayProps> extends CoreOption {
|
|
133
|
+
/** Per-option component for rendering this mark */
|
|
134
|
+
Mark?: ComponentType<TMarkProps>;
|
|
135
135
|
/**
|
|
136
136
|
* Props for the mark component.
|
|
137
137
|
* Can be a static object or a function that transforms MarkProps.
|
|
138
138
|
*/
|
|
139
139
|
mark?: TMarkProps | ((props: MarkProps) => TMarkProps);
|
|
140
|
+
/** Per-option component for rendering this overlay */
|
|
141
|
+
Overlay?: ComponentType<TOverlayProps>;
|
|
140
142
|
/**
|
|
141
143
|
* Props for the overlay component.
|
|
142
144
|
*/
|
|
@@ -162,8 +164,6 @@ export declare interface OverlayHandler {
|
|
|
162
164
|
* Props for Overlay components.
|
|
163
165
|
*/
|
|
164
166
|
export declare interface OverlayProps {
|
|
165
|
-
/** Custom component to render this overlay */
|
|
166
|
-
slot?: ComponentType<OverlayProps>;
|
|
167
167
|
/** Trigger character(s) that activate the overlay */
|
|
168
168
|
trigger?: string;
|
|
169
169
|
/** Data array for suggestions/autocomplete */
|
|
@@ -172,7 +172,6 @@ export declare interface OverlayProps {
|
|
|
172
172
|
|
|
173
173
|
declare interface SlotProps {
|
|
174
174
|
container?: HTMLAttributes<HTMLDivElement> & DataAttributes;
|
|
175
|
-
span?: HTMLAttributes<HTMLSpanElement> & DataAttributes;
|
|
176
175
|
}
|
|
177
176
|
|
|
178
177
|
/**
|
|
@@ -181,10 +180,10 @@ declare interface SlotProps {
|
|
|
181
180
|
declare interface Slots {
|
|
182
181
|
/** Root container component */
|
|
183
182
|
container?: ElementType<HTMLAttributes<HTMLDivElement>>;
|
|
184
|
-
/** Text span component for rendering text tokens */
|
|
185
|
-
span?: ElementType<HTMLAttributes<HTMLSpanElement>>;
|
|
186
183
|
}
|
|
187
184
|
|
|
185
|
+
export declare const Span: (_props: MarkProps) => JSX.Element;
|
|
186
|
+
|
|
188
187
|
export { TextToken }
|
|
189
188
|
|
|
190
189
|
export { Token }
|