@idealyst/markdown 1.2.94 → 1.2.96

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": "@idealyst/markdown",
3
- "version": "1.2.94",
3
+ "version": "1.2.96",
4
4
  "description": "Cross-platform markdown renderer and editor for React and React Native with theme integration",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@10play/tentap-editor": ">=0.5.0",
44
- "@idealyst/theme": "^1.2.94",
44
+ "@idealyst/theme": "^1.2.96",
45
45
  "@tiptap/extension-link": ">=2.0.0",
46
46
  "@tiptap/extension-placeholder": ">=2.0.0",
47
47
  "@tiptap/extension-task-item": ">=2.0.0",
@@ -114,7 +114,9 @@
114
114
  },
115
115
  "devDependencies": {
116
116
  "@10play/tentap-editor": "^0.5.0",
117
- "@idealyst/theme": "^1.2.94",
117
+ "@idealyst/theme": "^1.2.96",
118
+ "@mdi/js": "^7.4.0",
119
+ "@mdi/react": "^1.6.0",
118
120
  "@tiptap/extension-link": "^2.11.0",
119
121
  "@tiptap/extension-placeholder": "^2.11.0",
120
122
  "@tiptap/extension-task-item": "^2.11.0",
@@ -27,7 +27,7 @@ import {
27
27
  mdiMenuDown,
28
28
  } from '@mdi/js';
29
29
  import type { ToolbarItem } from './types';
30
- import type { Size, Intent } from '@idealyst/theme';
30
+ import type { Size, Intent, Theme } from '@idealyst/theme';
31
31
  import type { Editor } from '@tiptap/react';
32
32
 
33
33
  interface EditorToolbarProps {
@@ -98,7 +98,7 @@ export const EditorToolbar = memo<EditorToolbarProps>(
98
98
  const [, setUpdateCounter] = useState(0);
99
99
 
100
100
  // Access theme directly
101
- const theme = UnistylesRuntime.getTheme();
101
+ const theme = UnistylesRuntime.getTheme() as Theme;
102
102
 
103
103
  useEffect(() => {
104
104
  if (!editor) return;
@@ -130,8 +130,8 @@ const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>(
130
130
  content: '', // Start empty, we'll set content after creation
131
131
  editable,
132
132
  autofocus: autoFocus,
133
- onUpdate: ({ editor: ed }) => {
134
- const markdown = ed.storage.markdown.getMarkdown();
133
+ onUpdate: ({ editor: ed }: { editor: ReturnType<typeof useEditor> }) => {
134
+ const markdown = (ed as any).storage.markdown.getMarkdown();
135
135
  lastValueRef.current = markdown;
136
136
  onChange?.(markdown);
137
137
  },
@@ -25,9 +25,6 @@
25
25
  * ```
26
26
  */
27
27
 
28
- // Main component
29
- export { default as MarkdownEditor } from './MarkdownEditor.web';
30
-
31
28
  // Types
32
29
  export type {
33
30
  MarkdownEditorProps,
@@ -41,3 +38,5 @@ export type {
41
38
  EditorDynamicProps,
42
39
  EditorVariants,
43
40
  } from './MarkdownEditor.styles';
41
+
42
+ // Main component is platform-specific, exported from index.web.ts and index.native.ts
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @idealyst/markdown/editor - Web implementation
3
+ *
4
+ * Uses Tiptap with tiptap-markdown extension for rich text editing.
5
+ */
6
+
7
+ // Main component
8
+ export { default as MarkdownEditor } from './MarkdownEditor.web';
9
+
10
+ // Types
11
+ export type {
12
+ MarkdownEditorProps,
13
+ MarkdownEditorRef,
14
+ ToolbarItem,
15
+ ToolbarConfig,
16
+ } from './types';
17
+
18
+ // Style types
19
+ export type {
20
+ EditorDynamicProps,
21
+ EditorVariants,
22
+ } from './MarkdownEditor.styles';
@@ -1,6 +1,5 @@
1
- import MarkdownComponent from './Markdown.web';
2
-
3
- export default MarkdownComponent;
4
- export { MarkdownComponent as Markdown };
1
+ // Types only - component is platform-specific
5
2
  export * from './types';
6
3
  export type { MarkdownDynamicProps, MarkdownVariants } from './Markdown.styles';
4
+
5
+ // Re-export nothing - platform-specific indexes handle components
@@ -0,0 +1,6 @@
1
+ import MarkdownComponent from './Markdown.web';
2
+
3
+ export default MarkdownComponent;
4
+ export { MarkdownComponent as Markdown };
5
+ export * from './types';
6
+ export type { MarkdownDynamicProps, MarkdownVariants } from './Markdown.styles';
package/src/index.ts CHANGED
@@ -20,9 +20,6 @@
20
20
  * ```
21
21
  */
22
22
 
23
- // Main component
24
- export { default as Markdown, Markdown as MarkdownComponent } from './Markdown';
25
-
26
23
  // Types
27
24
  export type {
28
25
  MarkdownProps,
@@ -39,3 +36,5 @@ export type {
39
36
  MarkdownDynamicProps,
40
37
  MarkdownVariants,
41
38
  } from './Markdown/Markdown.styles';
39
+
40
+ // Main component is platform-specific, exported from index.web.ts and index.native.ts
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @idealyst/markdown - Cross-platform markdown renderer (Web)
3
+ *
4
+ * Provides a Markdown component for rendering markdown content
5
+ * with theme integration on web.
6
+ */
7
+
8
+ // Main component
9
+ export { default as Markdown, Markdown as MarkdownComponent } from './Markdown/Markdown.web';
10
+
11
+ // Types
12
+ export type {
13
+ MarkdownProps,
14
+ MarkdownElementType,
15
+ MarkdownStyleOverrides,
16
+ LinkHandler,
17
+ ImageHandler,
18
+ CodeBlockOptions,
19
+ MarkdownRendererProps,
20
+ } from './Markdown/types';
21
+
22
+ // Style types
23
+ export type {
24
+ MarkdownDynamicProps,
25
+ MarkdownVariants,
26
+ } from './Markdown/Markdown.styles';