@quadrats/react 0.7.0 → 0.7.1
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/highlight/createReactHighlight.js +1 -1
- package/highlight/defaultRenderHighlight.d.ts +1 -1
- package/highlight/defaultRenderHighlight.js +1 -1
- package/highlight/index.cjs.js +2 -2
- package/highlight/jsx-serializer/createJsxSerializeHighlight.d.ts +1 -1
- package/highlight/jsx-serializer/createJsxSerializeHighlight.js +3 -3
- package/highlight/jsx-serializer/index.cjs.js +3 -3
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ import { HIGHLIGHT_HOTKEY } from './constants.js';
|
|
|
5
5
|
|
|
6
6
|
const createReactHighlight = (variant) => createReactToggleMarkCreator(createHighlight(variant), {
|
|
7
7
|
hotkey: HIGHLIGHT_HOTKEY,
|
|
8
|
-
render: defaultRenderHighlight,
|
|
8
|
+
render: defaultRenderHighlight(variant),
|
|
9
9
|
})();
|
|
10
10
|
|
|
11
11
|
export { createReactHighlight };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RenderMarkPropsBase } from '@quadrats/react/_internal';
|
|
3
|
-
export declare const defaultRenderHighlight: ({ children, leaf }: RenderMarkPropsBase<boolean>) => React.JSX.Element;
|
|
3
|
+
export declare const defaultRenderHighlight: (variant?: string) => ({ children, leaf }: RenderMarkPropsBase<boolean>) => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HIGHLIGHT_TYPE } from '@quadrats/common/highlight';
|
|
3
3
|
|
|
4
|
-
const defaultRenderHighlight = ({ children, leaf }) => (React.createElement("mark", { className: leaf.highlightVariant
|
|
4
|
+
const defaultRenderHighlight = (variant) => ({ children, leaf }) => (React.createElement("mark", { "data-type": variant !== null && variant !== void 0 ? variant : undefined, className: leaf.highlightVariant
|
|
5
5
|
? `${HIGHLIGHT_TYPE}.${leaf.highlightVariant}` : `${HIGHLIGHT_TYPE}` }, children));
|
|
6
6
|
|
|
7
7
|
export { defaultRenderHighlight };
|
package/highlight/index.cjs.js
CHANGED
|
@@ -11,12 +11,12 @@ var toggleMark = require('@quadrats/react/toggle-mark');
|
|
|
11
11
|
*/
|
|
12
12
|
const HIGHLIGHT_HOTKEY = 'mod+h';
|
|
13
13
|
|
|
14
|
-
const defaultRenderHighlight = ({ children, leaf }) => (React.createElement("mark", { className: leaf.highlightVariant
|
|
14
|
+
const defaultRenderHighlight = (variant) => ({ children, leaf }) => (React.createElement("mark", { "data-type": variant !== null && variant !== void 0 ? variant : undefined, className: leaf.highlightVariant
|
|
15
15
|
? `${highlight.HIGHLIGHT_TYPE}.${leaf.highlightVariant}` : `${highlight.HIGHLIGHT_TYPE}` }, children));
|
|
16
16
|
|
|
17
17
|
const createReactHighlight = (variant) => toggleMark.createReactToggleMarkCreator(highlight.createHighlight(variant), {
|
|
18
18
|
hotkey: HIGHLIGHT_HOTKEY,
|
|
19
|
-
render: defaultRenderHighlight,
|
|
19
|
+
render: defaultRenderHighlight(variant),
|
|
20
20
|
})();
|
|
21
21
|
|
|
22
22
|
exports.HIGHLIGHT_HOTKEY = HIGHLIGHT_HOTKEY;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const createJsxSerializeHighlight: (
|
|
2
|
+
export declare const createJsxSerializeHighlight: (variant?: string) => (props: Omit<import("@quadrats/react/jsx-serializer").JsxSerializeMarkProps<boolean>, "mark">) => JSX.Element;
|
|
@@ -2,9 +2,9 @@ import { HIGHLIGHT_TYPE } from '@quadrats/common/highlight';
|
|
|
2
2
|
import { createJsxSerializeToggleMarkCreator } from '@quadrats/react/toggle-mark/jsx-serializer';
|
|
3
3
|
import { defaultRenderHighlight } from '@quadrats/react/highlight';
|
|
4
4
|
|
|
5
|
-
const createJsxSerializeHighlight = createJsxSerializeToggleMarkCreator({
|
|
5
|
+
const createJsxSerializeHighlight = (variant) => createJsxSerializeToggleMarkCreator({
|
|
6
6
|
type: HIGHLIGHT_TYPE,
|
|
7
|
-
render: defaultRenderHighlight,
|
|
8
|
-
});
|
|
7
|
+
render: defaultRenderHighlight(variant),
|
|
8
|
+
})();
|
|
9
9
|
|
|
10
10
|
export { createJsxSerializeHighlight };
|
|
@@ -4,10 +4,10 @@ var highlight = require('@quadrats/react/highlight');
|
|
|
4
4
|
var highlight$1 = require('@quadrats/common/highlight');
|
|
5
5
|
var jsxSerializer = require('@quadrats/react/toggle-mark/jsx-serializer');
|
|
6
6
|
|
|
7
|
-
const createJsxSerializeHighlight = jsxSerializer.createJsxSerializeToggleMarkCreator({
|
|
7
|
+
const createJsxSerializeHighlight = (variant) => jsxSerializer.createJsxSerializeToggleMarkCreator({
|
|
8
8
|
type: highlight$1.HIGHLIGHT_TYPE,
|
|
9
|
-
render: highlight.defaultRenderHighlight,
|
|
10
|
-
});
|
|
9
|
+
render: highlight.defaultRenderHighlight(variant),
|
|
10
|
+
})();
|
|
11
11
|
|
|
12
12
|
exports.defaultRenderHighlight = highlight.defaultRenderHighlight;
|
|
13
13
|
exports.createJsxSerializeHighlight = createJsxSerializeHighlight;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quadrats/react",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Rytass",
|
|
6
6
|
"homepage": "https://github.com/Quadrats/quadrats#readme",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"url": "https://github.com/Quadrats/quadrats/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@quadrats/common": "^0.7.
|
|
23
|
+
"@quadrats/common": "^0.7.1",
|
|
24
24
|
"@quadrats/core": "^0.7.0",
|
|
25
25
|
"@quadrats/icons": "^0.7.0",
|
|
26
26
|
"@quadrats/locales": "^0.7.0",
|
|
27
27
|
"@quadrats/theme": "^0.7.0",
|
|
28
|
-
"@quadrats/utils": "^0.7.
|
|
28
|
+
"@quadrats/utils": "^0.7.1",
|
|
29
29
|
"@types/is-hotkey": "^0.1.7",
|
|
30
30
|
"@types/react-transition-group": "^4.4.4",
|
|
31
31
|
"clsx": "^1.1.1",
|