react-ink-scripter 0.0.26 → 0.0.27
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/InkScripter.css +1 -1
- package/dist/cjs/index.js +6 -6
- package/dist/esm/InkScripter.d.ts +4 -4
- package/dist/esm/index.js +6 -6
- package/package.json +1 -1
package/dist/InkScripter.css
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -187,8 +187,8 @@ var Container = function Container(_ref) {
|
|
|
187
187
|
return jsxRuntime.jsx(Text, _extends({}, item, {
|
|
188
188
|
className: clsx(itemClass, item.className)
|
|
189
189
|
}), idx);
|
|
190
|
-
case '
|
|
191
|
-
return jsxRuntime.jsx(
|
|
190
|
+
case 'compose':
|
|
191
|
+
return jsxRuntime.jsx(Compose, _extends({}, item, {
|
|
192
192
|
className: clsx(itemClass, item.className)
|
|
193
193
|
}), idx);
|
|
194
194
|
}
|
|
@@ -201,14 +201,14 @@ var Grid = function Grid(props) {
|
|
|
201
201
|
itemClass: "inks-grid-item"
|
|
202
202
|
}, props));
|
|
203
203
|
};
|
|
204
|
-
var
|
|
204
|
+
var Compose = function Compose(_ref2) {
|
|
205
205
|
var id = _ref2.id,
|
|
206
206
|
content = _ref2.content,
|
|
207
207
|
span = _ref2.span,
|
|
208
208
|
className = _ref2.className;
|
|
209
209
|
return jsxRuntime.jsx(Container, {
|
|
210
210
|
id: id,
|
|
211
|
-
className: clsx('inks-
|
|
211
|
+
className: clsx('inks-compose', span && "inks-span-".concat(span), className),
|
|
212
212
|
content: content
|
|
213
213
|
});
|
|
214
214
|
};
|
|
@@ -365,8 +365,8 @@ var InkScripter = react.forwardRef(function (props, ref) {
|
|
|
365
365
|
return jsxRuntime.jsx(Text, _extends({}, item), index);
|
|
366
366
|
case 'pair':
|
|
367
367
|
return jsxRuntime.jsx(Pair, _extends({}, item), index);
|
|
368
|
-
case '
|
|
369
|
-
return jsxRuntime.jsx(
|
|
368
|
+
case 'compose':
|
|
369
|
+
return jsxRuntime.jsx(Compose, _extends({}, item), index);
|
|
370
370
|
}
|
|
371
371
|
})
|
|
372
372
|
});
|
|
@@ -14,9 +14,9 @@ export type ContentPairItem = {
|
|
|
14
14
|
value: string;
|
|
15
15
|
span?: number;
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
17
|
+
export type ContentComposeItem = {
|
|
18
18
|
id?: string;
|
|
19
|
-
type: '
|
|
19
|
+
type: 'compose';
|
|
20
20
|
span?: number;
|
|
21
21
|
className?: string;
|
|
22
22
|
content: (ContentPairItem | ContentTextItem)[];
|
|
@@ -24,7 +24,7 @@ export type ContentLineItem = {
|
|
|
24
24
|
export type ContentGridItem = {
|
|
25
25
|
id?: string;
|
|
26
26
|
type: 'grid';
|
|
27
|
-
content: (ContentPairItem | ContentTextItem |
|
|
27
|
+
content: (ContentPairItem | ContentTextItem | ContentComposeItem)[];
|
|
28
28
|
};
|
|
29
29
|
export type ContentTableCellItem = {
|
|
30
30
|
id?: string;
|
|
@@ -41,7 +41,7 @@ export type ContentTableItem = {
|
|
|
41
41
|
body?: ContentTableCellItem[][];
|
|
42
42
|
foot?: ContentTableCellItem[][];
|
|
43
43
|
};
|
|
44
|
-
export type ContentItemType = ContentGridItem | ContentTableItem | ContentTextItem | ContentPairItem |
|
|
44
|
+
export type ContentItemType = ContentGridItem | ContentTableItem | ContentTextItem | ContentPairItem | ContentComposeItem;
|
|
45
45
|
export type ContentType = ContentItemType[];
|
|
46
46
|
export type InkScripterProps = {
|
|
47
47
|
value?: ContentType;
|
package/dist/esm/index.js
CHANGED
|
@@ -125,16 +125,16 @@ const Container = ({ id, content = [], className, itemClass, }) => {
|
|
|
125
125
|
return (jsx(Pair, { ...item, className: clsx(itemClass, item.className) }, idx));
|
|
126
126
|
case 'text':
|
|
127
127
|
return (jsx(Text, { ...item, className: clsx(itemClass, item.className) }, idx));
|
|
128
|
-
case '
|
|
129
|
-
return (jsx(
|
|
128
|
+
case 'compose':
|
|
129
|
+
return (jsx(Compose, { ...item, className: clsx(itemClass, item.className) }, idx));
|
|
130
130
|
}
|
|
131
131
|
}) }));
|
|
132
132
|
};
|
|
133
133
|
const Grid = (props) => {
|
|
134
134
|
return jsx(Container, { className: "inks-grid", itemClass: "inks-grid-item", ...props });
|
|
135
135
|
};
|
|
136
|
-
const
|
|
137
|
-
return (jsx(Container, { id: id, className: clsx('inks-
|
|
136
|
+
const Compose = ({ id, content, span, className }) => {
|
|
137
|
+
return (jsx(Container, { id: id, className: clsx('inks-compose', span && `inks-span-${span}`, className), content: content }));
|
|
138
138
|
};
|
|
139
139
|
const TableCell = ({ item }) => {
|
|
140
140
|
if (typeof item === 'string') {
|
|
@@ -198,8 +198,8 @@ const InkScripter = forwardRef((props, ref) => {
|
|
|
198
198
|
return jsx(Text, { ...item }, index);
|
|
199
199
|
case 'pair':
|
|
200
200
|
return jsx(Pair, { ...item }, index);
|
|
201
|
-
case '
|
|
202
|
-
return jsx(
|
|
201
|
+
case 'compose':
|
|
202
|
+
return jsx(Compose, { ...item }, index);
|
|
203
203
|
}
|
|
204
204
|
}) }));
|
|
205
205
|
});
|