markdown-wysiwyg-editor 0.2.4 → 0.2.6
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 +143 -67
- package/dist/components/EditorChrome.d.ts +25 -0
- package/dist/components/EditorChrome.d.ts.map +1 -0
- package/dist/components/EmojiPicker.d.ts +1 -1
- package/dist/components/EmojiPicker.d.ts.map +1 -1
- package/dist/components/ImagePicker.d.ts +1 -1
- package/dist/components/ImagePicker.d.ts.map +1 -1
- package/dist/components/LinkContextMenu.d.ts +8 -1
- package/dist/components/LinkContextMenu.d.ts.map +1 -1
- package/dist/components/MarkdownEditor.d.ts +2 -2
- package/dist/components/MarkdownEditor.d.ts.map +1 -1
- package/dist/components/MarkdownSyntaxStatus.d.ts +2 -2
- package/dist/components/MarkdownToolbar.d.ts +7 -2
- package/dist/components/MarkdownToolbar.d.ts.map +1 -1
- package/dist/components/TableContextMenu.d.ts +4 -1
- package/dist/components/TableEdgeControls.d.ts +3 -2
- package/dist/components/TableToolbar.d.ts +3 -2
- package/dist/components/toolbar/DownloadMenu.d.ts +13 -0
- package/dist/components/toolbar/DownloadMenu.d.ts.map +1 -0
- package/dist/components/toolbar/HeadingMenu.d.ts +13 -0
- package/dist/components/toolbar/HeadingMenu.d.ts.map +1 -0
- package/dist/components/toolbar/LinkModal.d.ts +12 -0
- package/dist/components/toolbar/LinkModal.d.ts.map +1 -0
- package/dist/components/toolbar/ToolbarButton.d.ts +11 -0
- package/dist/components/toolbar/ToolbarButton.d.ts.map +1 -0
- package/dist/components/ui/icons.d.ts +30 -0
- package/dist/components/ui/icons.d.ts.map +1 -0
- package/dist/constants/emojiData.d.ts +1 -1
- package/dist/converters/JsonToMarkdownConverter.d.ts +5 -2
- package/dist/converters/JsonToMarkdownConverter.d.ts.map +1 -1
- package/dist/converters/MarkdownTipTapConverter.d.ts +13 -7
- package/dist/converters/MarkdownTipTapConverter.d.ts.map +1 -1
- package/dist/converters/markdown/BlockExtractor.d.ts +20 -0
- package/dist/converters/markdown/BlockExtractor.d.ts.map +1 -0
- package/dist/converters/markdown/BlockParser.d.ts +9 -0
- package/dist/converters/markdown/BlockParser.d.ts.map +1 -0
- package/dist/converters/markdown/InlineParser.d.ts +10 -0
- package/dist/converters/markdown/InlineParser.d.ts.map +1 -0
- package/dist/extensions/CodeBlockNodeView/IconButton.d.ts +9 -0
- package/dist/extensions/CodeBlockNodeView/IconButton.d.ts.map +1 -0
- package/dist/extensions/CodeBlockNodeView/MermaidCodeBlockView.d.ts +12 -0
- package/dist/extensions/CodeBlockNodeView/MermaidCodeBlockView.d.ts.map +1 -0
- package/dist/extensions/CodeBlockNodeView/RegularCodeBlockView.d.ts +10 -0
- package/dist/extensions/CodeBlockNodeView/RegularCodeBlockView.d.ts.map +1 -0
- package/dist/extensions/CodeBlockNodeView/constants.d.ts +5 -0
- package/dist/extensions/CodeBlockNodeView/constants.d.ts.map +1 -0
- package/dist/extensions/CodeBlockNodeView.d.ts +1 -1
- package/dist/extensions/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/extensions/CustomCodeBlock.d.ts +1 -1
- package/dist/extensions/LinkClickExtension.d.ts +3 -1
- package/dist/extensions/LinkClickExtension.d.ts.map +1 -1
- package/dist/extensions/TableRightClickExtension.d.ts +1 -1
- package/dist/extensions/mermaidRegistry.d.ts +2 -2
- package/dist/hooks/useEditorContextMenus.d.ts +34 -0
- package/dist/hooks/useEditorContextMenus.d.ts.map +1 -0
- package/dist/hooks/useEditorState.d.ts +3 -3
- package/dist/hooks/useMarkdownEditor.d.ts +4 -2
- package/dist/hooks/useMarkdownEditor.d.ts.map +1 -1
- package/dist/hooks/useMarkdownInsertion.d.ts +11 -0
- package/dist/hooks/useMarkdownInsertion.d.ts.map +1 -0
- package/dist/hooks/useTableToolbar.d.ts +1 -1
- package/dist/i18n/I18nContext.d.ts +1 -1
- package/dist/index.css +704 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33640 -27167
- package/dist/index.js.map +150 -1
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/setupTests.d.ts +2 -0
- package/dist/setupTests.d.ts.map +1 -0
- package/dist/theme.css +96 -0
- package/dist/types/editor.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/pasteHandler.d.ts +2 -2
- package/dist/utils/pasteHandler.d.ts.map +1 -1
- package/dist/utils/selectionUtils.d.ts +2 -3
- package/dist/utils/selectionUtils.d.ts.map +1 -1
- package/package.json +40 -16
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* クラス名を条件に応じて結合するユーティリティ。
|
|
4
|
+
* Tailwind v4 では、コンポーネント設計レベルでクラスの衝突を避けることを推奨し、
|
|
5
|
+
* ライブラリによる自動マージ(tailwind-merge)は使用しない。
|
|
6
|
+
*/
|
|
7
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../src/setupTests.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown WYSIWYG Editor - Theme Variables
|
|
3
|
+
*
|
|
4
|
+
* This file provides shadcn-compatible CSS variables for theming.
|
|
5
|
+
* Import this file in your Tailwind v4 CSS to get default light/dark mode support.
|
|
6
|
+
*
|
|
7
|
+
* You can override these variables in your own CSS to customize the theme.
|
|
8
|
+
*
|
|
9
|
+
* Usage in your index.css:
|
|
10
|
+
* @import "tailwindcss";
|
|
11
|
+
* @source "./node_modules/markdown-wysiwyg-editor/dist/*.js";
|
|
12
|
+
* @import "markdown-wysiwyg-editor/theme.css";
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
@layer base {
|
|
16
|
+
:root {
|
|
17
|
+
/* Core colors */
|
|
18
|
+
--background: 0 0% 100%;
|
|
19
|
+
--foreground: 222.2 84% 4.9%;
|
|
20
|
+
|
|
21
|
+
/* Card */
|
|
22
|
+
--card: 0 0% 100%;
|
|
23
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
24
|
+
|
|
25
|
+
/* Popover (dropdowns, menus) */
|
|
26
|
+
--popover: 0 0% 100%;
|
|
27
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
28
|
+
|
|
29
|
+
/* Primary action */
|
|
30
|
+
--primary: 222.2 47.4% 11.2%;
|
|
31
|
+
--primary-foreground: 210 40% 98%;
|
|
32
|
+
|
|
33
|
+
/* Secondary */
|
|
34
|
+
--secondary: 210 40% 96.1%;
|
|
35
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
36
|
+
|
|
37
|
+
/* Muted/subtle elements */
|
|
38
|
+
--muted: 210 40% 96.1%;
|
|
39
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
40
|
+
|
|
41
|
+
/* Accent (hover states) */
|
|
42
|
+
--accent: 210 40% 96.1%;
|
|
43
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
44
|
+
|
|
45
|
+
/* Destructive actions */
|
|
46
|
+
--destructive: 0 84.2% 60.2%;
|
|
47
|
+
--destructive-foreground: 210 40% 98%;
|
|
48
|
+
|
|
49
|
+
/* Borders and inputs */
|
|
50
|
+
--border: 214.3 31.8% 91.4%;
|
|
51
|
+
--input: 214.3 31.8% 91.4%;
|
|
52
|
+
--ring: 222.2 84% 4.9%;
|
|
53
|
+
|
|
54
|
+
/* Radius */
|
|
55
|
+
--radius: 0.5rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dark {
|
|
59
|
+
/* Core colors */
|
|
60
|
+
--background: 222.2 84% 4.9%;
|
|
61
|
+
--foreground: 210 40% 98%;
|
|
62
|
+
|
|
63
|
+
/* Card */
|
|
64
|
+
--card: 222.2 84% 4.9%;
|
|
65
|
+
--card-foreground: 210 40% 98%;
|
|
66
|
+
|
|
67
|
+
/* Popover (dropdowns, menus) */
|
|
68
|
+
--popover: 222.2 84% 4.9%;
|
|
69
|
+
--popover-foreground: 210 40% 98%;
|
|
70
|
+
|
|
71
|
+
/* Primary action */
|
|
72
|
+
--primary: 210 40% 98%;
|
|
73
|
+
--primary-foreground: 222.2 47.4% 11.2%;
|
|
74
|
+
|
|
75
|
+
/* Secondary */
|
|
76
|
+
--secondary: 217.2 32.6% 17.5%;
|
|
77
|
+
--secondary-foreground: 210 40% 98%;
|
|
78
|
+
|
|
79
|
+
/* Muted/subtle elements */
|
|
80
|
+
--muted: 217.2 32.6% 17.5%;
|
|
81
|
+
--muted-foreground: 215 20.2% 65.1%;
|
|
82
|
+
|
|
83
|
+
/* Accent (hover states) */
|
|
84
|
+
--accent: 217.2 32.6% 17.5%;
|
|
85
|
+
--accent-foreground: 210 40% 98%;
|
|
86
|
+
|
|
87
|
+
/* Destructive actions */
|
|
88
|
+
--destructive: 0 62.8% 30.6%;
|
|
89
|
+
--destructive-foreground: 210 40% 98%;
|
|
90
|
+
|
|
91
|
+
/* Borders and inputs */
|
|
92
|
+
--border: 217.2 32.6% 17.5%;
|
|
93
|
+
--input: 217.2 32.6% 17.5%;
|
|
94
|
+
--ring: 212.7 26.8% 83.9%;
|
|
95
|
+
}
|
|
96
|
+
}
|
package/dist/types/editor.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtendedEditor } from '../types/editor';
|
|
2
|
-
import { ILogger } from './logger';
|
|
1
|
+
import type { ExtendedEditor } from '../types/editor';
|
|
2
|
+
import type { ILogger } from './logger';
|
|
3
3
|
type SetProcessing = (processing: boolean) => void;
|
|
4
4
|
type SetProgress = (progress: {
|
|
5
5
|
processed: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pasteHandler.d.ts","sourceRoot":"","sources":["../../src/utils/pasteHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,KAAK,aAAa,GAAG,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;AAEnD,KAAK,WAAW,GAAG,CAAC,QAAQ,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAE5E,UAAU,yBAAyB;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,aAAa,CAAC;IAC/B,qBAAqB,EAAE,WAAW,CAAC;IACnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE;QACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;CACH;AAWD,eAAO,MAAM,mBAAmB,GAAU,qHAQvC,yBAAyB,KAAG,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"pasteHandler.d.ts","sourceRoot":"","sources":["../../src/utils/pasteHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,KAAK,aAAa,GAAG,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;AAEnD,KAAK,WAAW,GAAG,CAAC,QAAQ,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAE5E,UAAU,yBAAyB;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,aAAa,CAAC;IAC/B,qBAAqB,EAAE,WAAW,CAAC;IACnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE;QACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;CACH;AAWD,eAAO,MAAM,mBAAmB,GAAU,qHAQvC,yBAAyB,KAAG,OAAO,CAAC,IAAI,CAiD1C,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { ISelectionInfo } from '../types/index';
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
import type { ISelectionInfo } from '../types/index';
|
|
3
3
|
export declare class SelectionUtils {
|
|
4
|
-
private readonly _instanceMarker;
|
|
5
4
|
private constructor();
|
|
6
5
|
/**
|
|
7
6
|
* 現在の選択範囲からMarkdown構文情報を抽出
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/selectionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYrD,qBAAa,cAAc;IACzB,OAAO
|
|
1
|
+
{"version":3,"file":"selectionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/selectionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYrD,qBAAa,cAAc;IACzB,OAAO;IAGP;;OAEG;IACH,MAAM,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,GAAG,IAAI;IA8B/E;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IA2HlC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAY9F;AAED,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-wysiwyg-editor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Lightweight Markdown WYSIWYG editor with TipTap, Mermaid support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,12 +11,24 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts"
|
|
13
13
|
},
|
|
14
|
-
"./style.css": "./dist/index.css"
|
|
14
|
+
"./style.css": "./dist/index.css",
|
|
15
|
+
"./theme.css": "./dist/theme.css"
|
|
15
16
|
},
|
|
16
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"CHANGELOG.md"
|
|
22
|
+
],
|
|
23
|
+
"workspaces": [
|
|
24
|
+
"example"
|
|
25
|
+
],
|
|
17
26
|
"scripts": {
|
|
18
|
-
"dev": "
|
|
19
|
-
"build": "
|
|
27
|
+
"dev": "bun build --watch ./src/index.ts --outdir ./dist --external react --external react-dom --external mermaid",
|
|
28
|
+
"build": "bun run build:js && bun run build:css && bun run build:types",
|
|
29
|
+
"build:js": "NODE_ENV=production bun build ./src/index.ts --outdir ./dist --external react --external react-dom --external mermaid --sourcemap=linked --define 'process.env.NODE_ENV=\"production\"'",
|
|
30
|
+
"build:css": "cp ./src/index.css ./dist/index.css && cp ./src/theme.css ./dist/theme.css",
|
|
31
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
20
32
|
"test": "vitest run",
|
|
21
33
|
"test:coverage": "vitest run --coverage",
|
|
22
34
|
"test:watch": "vitest",
|
|
@@ -26,7 +38,15 @@
|
|
|
26
38
|
"format:check": "biome format .",
|
|
27
39
|
"prepublishOnly": "npm run build && npm run test"
|
|
28
40
|
},
|
|
29
|
-
"keywords": [
|
|
41
|
+
"keywords": [
|
|
42
|
+
"markdown",
|
|
43
|
+
"wysiwyg",
|
|
44
|
+
"editor",
|
|
45
|
+
"tiptap",
|
|
46
|
+
"mermaid",
|
|
47
|
+
"react",
|
|
48
|
+
"typescript"
|
|
49
|
+
],
|
|
30
50
|
"author": "Yuji Noguchi (https://github.com/ugnoguchigxp)",
|
|
31
51
|
"repository": {
|
|
32
52
|
"type": "git",
|
|
@@ -50,15 +70,15 @@
|
|
|
50
70
|
"@tiptap/extension-typography": "^3.3.0",
|
|
51
71
|
"@tiptap/react": "^3.3.0",
|
|
52
72
|
"@tiptap/starter-kit": "^3.3.0",
|
|
73
|
+
"clsx": "^2.1.1",
|
|
53
74
|
"lowlight": "^3.3.0",
|
|
54
|
-
"lucide-react": "^0.452.0",
|
|
55
75
|
"prosemirror-state": "^1.4.3",
|
|
56
76
|
"uuid": "^11.0.3"
|
|
57
77
|
},
|
|
58
78
|
"peerDependencies": {
|
|
59
79
|
"mermaid": "^11.0.0",
|
|
60
|
-
"react": "^
|
|
61
|
-
"react-dom": "^
|
|
80
|
+
"react": "^19.2.3",
|
|
81
|
+
"react-dom": "^19.2.3"
|
|
62
82
|
},
|
|
63
83
|
"peerDependenciesMeta": {
|
|
64
84
|
"mermaid": {
|
|
@@ -66,20 +86,24 @@
|
|
|
66
86
|
}
|
|
67
87
|
},
|
|
68
88
|
"devDependencies": {
|
|
89
|
+
"@biomejs/biome": "^1.9.4",
|
|
90
|
+
"@tailwindcss/cli": "^4.1.18",
|
|
69
91
|
"@testing-library/dom": "^10.4.1",
|
|
92
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
70
93
|
"@testing-library/react": "^16.3.0",
|
|
94
|
+
"@types/bun": "^1.3.5",
|
|
71
95
|
"@types/node": "^22.0.0",
|
|
72
96
|
"@types/react": "^19.0.0",
|
|
73
97
|
"@types/react-dom": "^19.0.0",
|
|
74
98
|
"@types/uuid": "^10.0.0",
|
|
75
|
-
"@vitejs/plugin-react": "^
|
|
76
|
-
"@vitest/coverage-v8": "2.1.
|
|
99
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
100
|
+
"@vitest/coverage-v8": "2.1.9",
|
|
101
|
+
"@vitest/ui": "^4.0.16",
|
|
77
102
|
"jsdom": "^27.2.0",
|
|
78
|
-
"
|
|
103
|
+
"tailwindcss": "^4.1.18",
|
|
79
104
|
"typescript": "^5.6.0",
|
|
80
|
-
"vite": "^
|
|
81
|
-
"
|
|
82
|
-
"vitest": "^2.1.0"
|
|
105
|
+
"vite": "^7.3.0",
|
|
106
|
+
"vitest": "2.1.9"
|
|
83
107
|
},
|
|
84
|
-
"packageManager": "
|
|
108
|
+
"packageManager": "bun@1.3.5"
|
|
85
109
|
}
|