Skip to content

Commit e2b240a

Browse files
committed
param name style to styles changed and prod files
1 parent 46343a0 commit e2b240a

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ Renders the converted HTML content in a preview pane.
7171

7272
#### Props:
7373

74-
| Prop | Type | Description |
75-
| --------- | ------------ | ------------------------------------------- |
76-
| `md` | `string` | HTML string to preview (from `useMarkdown`) |
77-
| `onClose` | `() => void` | Function to close the preview |
74+
| Prop | Type | Description |
75+
| --------- | ------------------------------------- | ------------------------------------------- |
76+
| `md` | `string` | HTML string to preview (from `useMarkdown`) |
77+
| `onClose` | `() => void` | Function to close the preview |
78+
| `styles` | `Record<string, React.CSSProperties>` | Custom styles for Preview |
7879
7980
---
8081
@@ -215,6 +216,7 @@ export default function App() {
215216
<MarkdownPreview
216217
md={html}
217218
onClose={() => setShowPreview(false)}
219+
styles={/* optional custom styles */}
218220
/>
219221
)}
220222
</div>

dist/MarkdownInput.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ type MarkdownShortcutIcon = Record<string, {
66
type MarkdownInputProps = {
77
md: string;
88
setMd: React.Dispatch<React.SetStateAction<string>>;
9-
style?: Partial<typeof defaultStyles>;
9+
styles?: Partial<typeof defaultStyles>;
1010
svgIcons?: MarkdownShortcutIcon;
1111
};
12-
export default function MarkdownInput({ svgIcons, style, md, setMd, }: MarkdownInputProps): import("react/jsx-runtime").JSX.Element;
12+
export default function MarkdownInput({ svgIcons, styles, md, setMd, }: MarkdownInputProps): import("react/jsx-runtime").JSX.Element;
1313
export {};

dist/MarkdownInput.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ var markdownShortcuts = {
7575
};
7676
function MarkdownInput(_a) {
7777
var _b;
78-
var svgIcons = _a.svgIcons, style = _a.style, md = _a.md, setMd = _a.setMd;
78+
var svgIcons = _a.svgIcons, styles = _a.styles, md = _a.md, setMd = _a.setMd;
7979
var inputRef = (0, react_1.useRef)(null);
8080
var _c = (0, react_1.useState)(false), previewToggle = _c[0], setPreviewToggle = _c[1];
81-
var mergedStyles = __assign(__assign({}, defaultStyles_1.defaultStyles), style);
81+
var mergedStyles = __assign(__assign({}, defaultStyles_1.defaultStyles), styles);
8282
var markdownShortcutIcons = __assign({
8383
h1: {
8484
icon: function () { return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", className: "bi bi-type-h1", viewBox: "0 0 16 16", children: (0, jsx_runtime_1.jsx)("path", { d: "M7.648 13V3H6.3v4.234H1.348V3H0v10h1.348V8.421H6.3V13zM14 13V3h-1.333l-2.381 1.766V6.12L12.6 4.443h.066V13z" }) })); },

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markdown-input-display",
3-
"version": "1.1.19",
3+
"version": "1.1.21",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

src/MarkdownInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type MarkdownShortcutFunctions = Record<
2121
type MarkdownInputProps = {
2222
md: string;
2323
setMd: React.Dispatch<React.SetStateAction<string>>;
24-
style?: Partial<typeof defaultStyles>;
24+
styles?: Partial<typeof defaultStyles>;
2525
svgIcons?: MarkdownShortcutIcon;
2626
};
2727

@@ -81,7 +81,7 @@ const markdownShortcuts: MarkdownShortcutFunctions = {
8181

8282
export default function MarkdownInput({
8383
svgIcons,
84-
style,
84+
styles,
8585
md,
8686
setMd,
8787
}: MarkdownInputProps) {
@@ -90,7 +90,7 @@ export default function MarkdownInput({
9090

9191
const mergedStyles: Partial<typeof defaultStyles> = {
9292
...defaultStyles,
93-
...style,
93+
...styles,
9494
};
9595

9696
const markdownShortcutIcons: MarkdownShortcutIcon = {

0 commit comments

Comments
 (0)