github-markdown-editor 1.0.0 → 1.0.2
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 +5 -5
- package/dist/MarkdownEditor.d.ts +12 -0
- package/dist/MarkdownEditor.d.ts.map +1 -0
- package/dist/Toolbar.d.ts +12 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/fileHandler.d.ts +19 -0
- package/dist/fileHandler.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +2360 -2361
- package/dist/index.js +121 -0
- package/dist/markdown.d.ts +16 -0
- package/dist/markdown.d.ts.map +1 -0
- package/package.json +23 -9
- package/dist/index.cjs.js +0 -121
- /package/dist/{github-markdown-editor.css → style.css} +0 -0
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ function ControlledEditor() {
|
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
164
|
# Clone the repository
|
|
165
|
-
git clone https://github.com/
|
|
165
|
+
git clone https://github.com/justq-me/gh-markdown-editor.git
|
|
166
166
|
|
|
167
167
|
# Install dependencies
|
|
168
168
|
npm install
|
|
@@ -187,7 +187,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
187
187
|
|
|
188
188
|
## 🐛 Issues
|
|
189
189
|
|
|
190
|
-
If you find a bug or have a feature request, please create an issue on [GitHub](https://github.com/
|
|
190
|
+
If you find a bug or have a feature request, please create an issue on [GitHub](https://github.com/justq-me/gh-markdown-editor/issues).
|
|
191
191
|
|
|
192
192
|
## 🙏 Acknowledgments
|
|
193
193
|
|
|
@@ -204,10 +204,10 @@ If you find a bug or have a feature request, please create an issue on [GitHub](
|
|
|
204
204
|
|
|
205
205
|
## 🔗 Links
|
|
206
206
|
|
|
207
|
-
- [Documentation](https://github.com/
|
|
207
|
+
- [Documentation](https://github.com/justq-me/gh-markdown-editor#readme)
|
|
208
208
|
- [NPM Package](https://www.npmjs.com/package/github-markdown-editor)
|
|
209
|
-
- [GitHub Repository](https://github.com/
|
|
209
|
+
- [GitHub Repository](https://github.com/justq-me/gh-markdown-editor)
|
|
210
210
|
|
|
211
211
|
---
|
|
212
212
|
|
|
213
|
-
Made with ❤️ by [JustQ]
|
|
213
|
+
Made with ❤️ by [JustQ](https://justq.me/)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MarkdownEditorProps {
|
|
4
|
+
initialValue?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
height?: string;
|
|
7
|
+
theme?: 'light' | 'dark';
|
|
8
|
+
showToolbar?: boolean;
|
|
9
|
+
showPreview?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const MarkdownEditor: React.FC<MarkdownEditorProps>;
|
|
12
|
+
//# sourceMappingURL=MarkdownEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownEditor.d.ts","sourceRoot":"","sources":["../src/MarkdownEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkJxD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ToolbarProps {
|
|
4
|
+
onInsert: (before: string, after?: string) => void;
|
|
5
|
+
onTogglePreview: () => void;
|
|
6
|
+
onExport: () => void;
|
|
7
|
+
onImport: () => void;
|
|
8
|
+
showPreview: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Toolbar: React.FC<ToolbarProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../src/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,YAAY;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyD1C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exports markdown content as a .md file
|
|
3
|
+
* @param content - The markdown content to export
|
|
4
|
+
* @param filename - Optional filename (default: 'document.md')
|
|
5
|
+
*/
|
|
6
|
+
export declare function exportToMarkdown(content: string, filename?: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Exports markdown content as HTML file
|
|
9
|
+
* @param html - The HTML content to export
|
|
10
|
+
* @param filename - Optional filename (default: 'document.html')
|
|
11
|
+
*/
|
|
12
|
+
export declare function exportToHtml(html: string, filename?: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Imports markdown from a file
|
|
15
|
+
* @param event - The file input change event
|
|
16
|
+
* @returns Promise resolving to the file content
|
|
17
|
+
*/
|
|
18
|
+
export declare function importFromMarkdown(event: React.ChangeEvent<HTMLInputElement>): Promise<string | null>;
|
|
19
|
+
//# sourceMappingURL=fileHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileHandler.d.ts","sourceRoot":"","sources":["../src/fileHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAsB,GAAG,IAAI,CAUtF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAwB,GAAG,IAAI,CAmEnF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,GACzC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { MarkdownEditor } from './MarkdownEditor';
|
|
2
|
+
export type { MarkdownEditorProps } from './MarkdownEditor';
|
|
3
|
+
export { convertMarkdownToHtml, extractFrontmatter } from './markdown';
|
|
4
|
+
export { exportToMarkdown, exportToHtml, importFromMarkdown } from './fileHandler';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|