markdown-text-editor 1.9.0 → 2.0.0-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-text-editor",
3
- "version": "1.9.0",
3
+ "version": "2.0.0-beta.0",
4
4
  "type": "module",
5
5
  "description": "A markdown editor that enhances your textarea instead of replacing it, so form submission, validation and required fields keep working. WYSIWYG hybrid mode, live preview, find and replace, RTL, TypeScript types. Works with any backend.",
6
6
  "funding": "https://ko-fi.com/nezanuha",
@@ -15,7 +15,10 @@
15
15
  "import": "./dist/markdown-text-editor.es.js",
16
16
  "require": "./dist/markdown-text-editor.umd.js",
17
17
  "default": "./dist/markdown-text-editor.umd.js"
18
- }
18
+ },
19
+ "./style.css": "./dist/markdown-text-editor.css",
20
+ "./dist/*": "./dist/*",
21
+ "./package.json": "./package.json"
19
22
  },
20
23
  "files": [
21
24
  "dist/",
@@ -76,20 +79,19 @@
76
79
  },
77
80
  "dependencies": {
78
81
  "dompurify": "^3.4.16",
79
- "marked": "~18.0.14"
82
+ "marked": "~18.1.0"
80
83
  },
81
84
  "devDependencies": {
82
85
  "@tailwindcss/postcss": "^4.3.3",
83
86
  "@tailwindcss/typography": "^0.5.20",
84
87
  "@tailwindcss/vite": "^4.3.3",
85
88
  "diff": "^9.0.0",
86
- "frutjam": "^2.2.6",
87
- "happy-dom": "^20.14.5",
88
- "postcss": "^8.5.28",
89
+ "frutjam": "^2.3.0",
90
+ "happy-dom": "^20.14.6",
91
+ "postcss": "^8.5.29",
89
92
  "tailwindcss": "^4.3.3",
90
93
  "typescript": "^7.0.2",
91
- "vite": "^8.3.1",
92
- "vite-plugin-css-injected-by-js": "^5.0.2"
94
+ "vite": "^8.3.4"
93
95
  },
94
96
  "types": "./types/index.d.ts"
95
97
  }
package/types/index.d.ts CHANGED
@@ -52,6 +52,24 @@ export interface VariablesTool {
52
52
  variables: Array<Variable | VariableGroup>;
53
53
  }
54
54
 
55
+ export interface HeadingTool {
56
+ heading: {
57
+ /**
58
+ * Which heading levels the dropdown offers, in the order 1-6 regardless
59
+ * of how you list them. Defaults to all six. Useful where H1 belongs to
60
+ * the page rather than the content, e.g. `[2, 3, 4]`.
61
+ *
62
+ * `Ctrl+1`, `Ctrl+2` and `Ctrl+3` follow this list, so a level you leave
63
+ * out cannot be inserted from the keyboard either.
64
+ *
65
+ * This restricts the toolbar, not the document: someone can still type
66
+ * `# Title` by hand and it renders as a heading. Enforce the rule on the
67
+ * server if it has to hold.
68
+ */
69
+ levels?: Array<1 | 2 | 3 | 4 | 5 | 6>;
70
+ };
71
+ }
72
+
55
73
  export interface ImageTool {
56
74
  image: {
57
75
  fileInput?: {
@@ -114,6 +132,7 @@ export type ToolbarEntry =
114
132
  | ToolName
115
133
  | VariablesTool
116
134
  | ImageTool
135
+ | HeadingTool
117
136
  | DeclarativeTool
118
137
  | CustomTool
119
138
  | { tool: CustomTool; config?: any };