@furystack/shades-common-components 12.1.0 → 12.3.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/esm/components/avatar.d.ts.map +1 -1
  3. package/esm/components/avatar.js +3 -1
  4. package/esm/components/avatar.js.map +1 -1
  5. package/esm/components/avatar.spec.js +4 -4
  6. package/esm/components/avatar.spec.js.map +1 -1
  7. package/esm/components/icons/icon-definitions.d.ts +82 -0
  8. package/esm/components/icons/icon-definitions.d.ts.map +1 -1
  9. package/esm/components/icons/icon-definitions.js +717 -0
  10. package/esm/components/icons/icon-definitions.js.map +1 -1
  11. package/esm/components/icons/icon-definitions.spec.js +22 -2
  12. package/esm/components/icons/icon-definitions.spec.js.map +1 -1
  13. package/esm/components/icons/icon-types.d.ts +10 -0
  14. package/esm/components/icons/icon-types.d.ts.map +1 -1
  15. package/esm/components/icons/index.d.ts +1 -1
  16. package/esm/components/icons/index.d.ts.map +1 -1
  17. package/esm/components/index.d.ts +1 -0
  18. package/esm/components/index.d.ts.map +1 -1
  19. package/esm/components/index.js +1 -0
  20. package/esm/components/index.js.map +1 -1
  21. package/esm/components/markdown/index.d.ts +5 -0
  22. package/esm/components/markdown/index.d.ts.map +1 -0
  23. package/esm/components/markdown/index.js +5 -0
  24. package/esm/components/markdown/index.js.map +1 -0
  25. package/esm/components/markdown/markdown-display.d.ts +19 -0
  26. package/esm/components/markdown/markdown-display.d.ts.map +1 -0
  27. package/esm/components/markdown/markdown-display.js +149 -0
  28. package/esm/components/markdown/markdown-display.js.map +1 -0
  29. package/esm/components/markdown/markdown-display.spec.d.ts +2 -0
  30. package/esm/components/markdown/markdown-display.spec.d.ts.map +1 -0
  31. package/esm/components/markdown/markdown-display.spec.js +191 -0
  32. package/esm/components/markdown/markdown-display.spec.js.map +1 -0
  33. package/esm/components/markdown/markdown-editor.d.ts +25 -0
  34. package/esm/components/markdown/markdown-editor.d.ts.map +1 -0
  35. package/esm/components/markdown/markdown-editor.js +113 -0
  36. package/esm/components/markdown/markdown-editor.js.map +1 -0
  37. package/esm/components/markdown/markdown-editor.spec.d.ts +2 -0
  38. package/esm/components/markdown/markdown-editor.spec.d.ts.map +1 -0
  39. package/esm/components/markdown/markdown-editor.spec.js +111 -0
  40. package/esm/components/markdown/markdown-editor.spec.js.map +1 -0
  41. package/esm/components/markdown/markdown-input.d.ts +29 -0
  42. package/esm/components/markdown/markdown-input.d.ts.map +1 -0
  43. package/esm/components/markdown/markdown-input.js +100 -0
  44. package/esm/components/markdown/markdown-input.js.map +1 -0
  45. package/esm/components/markdown/markdown-input.spec.d.ts +2 -0
  46. package/esm/components/markdown/markdown-input.spec.d.ts.map +1 -0
  47. package/esm/components/markdown/markdown-input.spec.js +215 -0
  48. package/esm/components/markdown/markdown-input.spec.js.map +1 -0
  49. package/esm/components/markdown/markdown-parser.d.ts +82 -0
  50. package/esm/components/markdown/markdown-parser.d.ts.map +1 -0
  51. package/esm/components/markdown/markdown-parser.js +274 -0
  52. package/esm/components/markdown/markdown-parser.js.map +1 -0
  53. package/esm/components/markdown/markdown-parser.spec.d.ts +2 -0
  54. package/esm/components/markdown/markdown-parser.spec.d.ts.map +1 -0
  55. package/esm/components/markdown/markdown-parser.spec.js +229 -0
  56. package/esm/components/markdown/markdown-parser.spec.js.map +1 -0
  57. package/esm/components/page-container/index.d.ts +1 -1
  58. package/esm/components/page-container/index.js +1 -1
  59. package/esm/components/page-container/page-header.d.ts +5 -5
  60. package/esm/components/page-container/page-header.d.ts.map +1 -1
  61. package/esm/components/page-container/page-header.js +3 -3
  62. package/esm/components/styles.d.ts +1 -0
  63. package/esm/components/styles.d.ts.map +1 -1
  64. package/esm/components/styles.js.map +1 -1
  65. package/esm/components/suggest/index.d.ts +1 -1
  66. package/esm/components/suggest/index.d.ts.map +1 -1
  67. package/esm/components/typography.d.ts.map +1 -1
  68. package/esm/components/typography.js +26 -14
  69. package/esm/components/typography.js.map +1 -1
  70. package/esm/services/css-variable-theme.d.ts +3 -0
  71. package/esm/services/css-variable-theme.d.ts.map +1 -1
  72. package/esm/services/css-variable-theme.js +3 -0
  73. package/esm/services/css-variable-theme.js.map +1 -1
  74. package/esm/services/css-variable-theme.spec.js +3 -0
  75. package/esm/services/css-variable-theme.spec.js.map +1 -1
  76. package/esm/services/default-dark-palette.d.ts +8 -0
  77. package/esm/services/default-dark-palette.d.ts.map +1 -0
  78. package/esm/services/default-dark-palette.js +56 -0
  79. package/esm/services/default-dark-palette.js.map +1 -0
  80. package/esm/services/default-dark-theme.d.ts +3 -0
  81. package/esm/services/default-dark-theme.d.ts.map +1 -1
  82. package/esm/services/default-dark-theme.js +7 -4
  83. package/esm/services/default-dark-theme.js.map +1 -1
  84. package/esm/services/default-light-theme.d.ts +3 -0
  85. package/esm/services/default-light-theme.d.ts.map +1 -1
  86. package/esm/services/default-light-theme.js +3 -0
  87. package/esm/services/default-light-theme.js.map +1 -1
  88. package/esm/services/index.d.ts +1 -0
  89. package/esm/services/index.d.ts.map +1 -1
  90. package/esm/services/index.js +1 -0
  91. package/esm/services/index.js.map +1 -1
  92. package/esm/services/theme-provider-service.d.ts +10 -1
  93. package/esm/services/theme-provider-service.d.ts.map +1 -1
  94. package/esm/services/theme-provider-service.js.map +1 -1
  95. package/package.json +3 -3
  96. package/src/components/avatar.spec.tsx +4 -4
  97. package/src/components/avatar.tsx +3 -1
  98. package/src/components/icons/icon-definitions.spec.ts +28 -2
  99. package/src/components/icons/icon-definitions.ts +759 -0
  100. package/src/components/icons/icon-types.ts +12 -0
  101. package/src/components/icons/index.ts +1 -1
  102. package/src/components/index.ts +1 -0
  103. package/src/components/markdown/index.ts +4 -0
  104. package/src/components/markdown/markdown-display.spec.tsx +243 -0
  105. package/src/components/markdown/markdown-display.tsx +202 -0
  106. package/src/components/markdown/markdown-editor.spec.tsx +142 -0
  107. package/src/components/markdown/markdown-editor.tsx +167 -0
  108. package/src/components/markdown/markdown-input.spec.tsx +274 -0
  109. package/src/components/markdown/markdown-input.tsx +143 -0
  110. package/src/components/markdown/markdown-parser.spec.ts +258 -0
  111. package/src/components/markdown/markdown-parser.ts +333 -0
  112. package/src/components/page-container/index.tsx +1 -1
  113. package/src/components/page-container/page-header.tsx +5 -5
  114. package/src/components/styles.tsx +1 -0
  115. package/src/components/suggest/index.tsx +1 -1
  116. package/src/components/typography.tsx +28 -15
  117. package/src/services/css-variable-theme.spec.ts +3 -0
  118. package/src/services/css-variable-theme.ts +3 -0
  119. package/src/services/default-dark-palette.ts +57 -0
  120. package/src/services/default-dark-theme.ts +7 -4
  121. package/src/services/default-light-theme.ts +3 -0
  122. package/src/services/index.ts +1 -0
  123. package/src/services/theme-provider-service.ts +7 -1
@@ -0,0 +1,191 @@
1
+ import { Injector } from '@furystack/inject';
2
+ import { createComponent, initializeShadeRoot } from '@furystack/shades';
3
+ import { sleepAsync, usingAsync } from '@furystack/utils';
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
5
+ import { MarkdownDisplay } from './markdown-display.js';
6
+ describe('MarkdownDisplay', () => {
7
+ beforeEach(() => {
8
+ document.body.innerHTML = '<div id="root"></div>';
9
+ });
10
+ afterEach(() => {
11
+ document.body.innerHTML = '';
12
+ vi.restoreAllMocks();
13
+ });
14
+ it('should render with shadow DOM', async () => {
15
+ await usingAsync(new Injector(), async (injector) => {
16
+ const rootElement = document.getElementById('root');
17
+ initializeShadeRoot({
18
+ injector,
19
+ rootElement,
20
+ jsxElement: createComponent(MarkdownDisplay, { content: "Hello" }),
21
+ });
22
+ await sleepAsync(50);
23
+ const el = document.querySelector('shade-markdown-display');
24
+ expect(el).not.toBeNull();
25
+ });
26
+ });
27
+ it('should render a heading', async () => {
28
+ await usingAsync(new Injector(), async (injector) => {
29
+ const rootElement = document.getElementById('root');
30
+ initializeShadeRoot({
31
+ injector,
32
+ rootElement,
33
+ jsxElement: createComponent(MarkdownDisplay, { content: "# Hello World" }),
34
+ });
35
+ await sleepAsync(50);
36
+ const typography = document.querySelector('shade-markdown-display shade-typography');
37
+ expect(typography).not.toBeNull();
38
+ expect(typography?.getAttribute('data-variant')).toBe('h1');
39
+ expect(typography?.textContent).toContain('Hello World');
40
+ });
41
+ });
42
+ it('should render a paragraph', async () => {
43
+ await usingAsync(new Injector(), async (injector) => {
44
+ const rootElement = document.getElementById('root');
45
+ initializeShadeRoot({
46
+ injector,
47
+ rootElement,
48
+ jsxElement: createComponent(MarkdownDisplay, { content: "Just a paragraph." }),
49
+ });
50
+ await sleepAsync(50);
51
+ const typography = document.querySelector('shade-markdown-display shade-typography[data-variant="body1"]');
52
+ expect(typography).not.toBeNull();
53
+ expect(typography?.textContent).toContain('Just a paragraph.');
54
+ });
55
+ });
56
+ it('should render a code block', async () => {
57
+ await usingAsync(new Injector(), async (injector) => {
58
+ const rootElement = document.getElementById('root');
59
+ initializeShadeRoot({
60
+ injector,
61
+ rootElement,
62
+ jsxElement: createComponent(MarkdownDisplay, { content: '```js\nconsole.log("hi")\n```' }),
63
+ });
64
+ await sleepAsync(50);
65
+ const codeBlock = document.querySelector('shade-markdown-display .md-code-block');
66
+ expect(codeBlock).not.toBeNull();
67
+ expect(codeBlock?.textContent).toContain('console.log("hi")');
68
+ });
69
+ });
70
+ it('should render a list', async () => {
71
+ await usingAsync(new Injector(), async (injector) => {
72
+ const rootElement = document.getElementById('root');
73
+ initializeShadeRoot({
74
+ injector,
75
+ rootElement,
76
+ jsxElement: createComponent(MarkdownDisplay, { content: '- Item A\n- Item B' }),
77
+ });
78
+ await sleepAsync(50);
79
+ const list = document.querySelector('shade-markdown-display ul');
80
+ expect(list).not.toBeNull();
81
+ const items = document.querySelectorAll('shade-markdown-display .md-list-item');
82
+ expect(items.length).toBe(2);
83
+ });
84
+ });
85
+ it('should render checkboxes as disabled when readOnly (default)', async () => {
86
+ await usingAsync(new Injector(), async (injector) => {
87
+ const rootElement = document.getElementById('root');
88
+ initializeShadeRoot({
89
+ injector,
90
+ rootElement,
91
+ jsxElement: createComponent(MarkdownDisplay, { content: "- [ ] Task" }),
92
+ });
93
+ await sleepAsync(50);
94
+ const checkbox = document.querySelector('shade-markdown-display shade-checkbox');
95
+ expect(checkbox).not.toBeNull();
96
+ expect(checkbox?.hasAttribute('data-disabled')).toBe(true);
97
+ });
98
+ });
99
+ it('should render checkboxes as enabled when readOnly is false', async () => {
100
+ await usingAsync(new Injector(), async (injector) => {
101
+ const rootElement = document.getElementById('root');
102
+ const onChange = vi.fn();
103
+ initializeShadeRoot({
104
+ injector,
105
+ rootElement,
106
+ jsxElement: createComponent(MarkdownDisplay, { content: "- [ ] Task", readOnly: false, onChange: onChange }),
107
+ });
108
+ await sleepAsync(50);
109
+ const checkbox = document.querySelector('shade-markdown-display shade-checkbox');
110
+ expect(checkbox).not.toBeNull();
111
+ expect(checkbox?.hasAttribute('data-disabled')).toBe(false);
112
+ const input = checkbox?.querySelector('input[type="checkbox"]');
113
+ expect(input).not.toBeNull();
114
+ input.click();
115
+ await sleepAsync(50);
116
+ expect(onChange).toHaveBeenCalledOnce();
117
+ expect(onChange).toHaveBeenCalledWith('- [x] Task');
118
+ });
119
+ });
120
+ it('should render a blockquote', async () => {
121
+ await usingAsync(new Injector(), async (injector) => {
122
+ const rootElement = document.getElementById('root');
123
+ initializeShadeRoot({
124
+ injector,
125
+ rootElement,
126
+ jsxElement: createComponent(MarkdownDisplay, { content: "> Quote text" }),
127
+ });
128
+ await sleepAsync(50);
129
+ const bq = document.querySelector('shade-markdown-display .md-blockquote');
130
+ expect(bq).not.toBeNull();
131
+ expect(bq?.textContent).toContain('Quote text');
132
+ });
133
+ });
134
+ it('should render a horizontal rule', async () => {
135
+ await usingAsync(new Injector(), async (injector) => {
136
+ const rootElement = document.getElementById('root');
137
+ initializeShadeRoot({
138
+ injector,
139
+ rootElement,
140
+ jsxElement: createComponent(MarkdownDisplay, { content: "---" }),
141
+ });
142
+ await sleepAsync(50);
143
+ const hr = document.querySelector('shade-markdown-display .md-hr');
144
+ expect(hr).not.toBeNull();
145
+ });
146
+ });
147
+ it('should render links', async () => {
148
+ await usingAsync(new Injector(), async (injector) => {
149
+ const rootElement = document.getElementById('root');
150
+ initializeShadeRoot({
151
+ injector,
152
+ rootElement,
153
+ jsxElement: createComponent(MarkdownDisplay, { content: "[Click here](https://example.com)" }),
154
+ });
155
+ await sleepAsync(50);
156
+ const link = document.querySelector('shade-markdown-display .md-link');
157
+ expect(link).not.toBeNull();
158
+ expect(link?.href).toContain('example.com');
159
+ expect(link?.textContent).toContain('Click here');
160
+ });
161
+ });
162
+ it('should render images', async () => {
163
+ await usingAsync(new Injector(), async (injector) => {
164
+ const rootElement = document.getElementById('root');
165
+ initializeShadeRoot({
166
+ injector,
167
+ rootElement,
168
+ jsxElement: createComponent(MarkdownDisplay, { content: "![alt text](image.png)" }),
169
+ });
170
+ await sleepAsync(50);
171
+ const img = document.querySelector('shade-markdown-display .md-image');
172
+ expect(img).not.toBeNull();
173
+ expect(img?.alt).toBe('alt text');
174
+ });
175
+ });
176
+ it('should render empty for empty content', async () => {
177
+ await usingAsync(new Injector(), async (injector) => {
178
+ const rootElement = document.getElementById('root');
179
+ initializeShadeRoot({
180
+ injector,
181
+ rootElement,
182
+ jsxElement: createComponent(MarkdownDisplay, { content: "" }),
183
+ });
184
+ await sleepAsync(50);
185
+ const root = document.querySelector('shade-markdown-display .md-root');
186
+ expect(root).not.toBeNull();
187
+ expect(root?.children.length).toBe(0);
188
+ });
189
+ });
190
+ });
191
+ //# sourceMappingURL=markdown-display.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-display.spec.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-display.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACzD,OA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AC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,25 @@
1
+ export type MarkdownEditorLayout = 'side-by-side' | 'tabs' | 'above-below';
2
+ export type MarkdownEditorProps = {
3
+ /** The current Markdown string */
4
+ value: string;
5
+ /** Called when the value changes (from either the input or checkbox toggle) */
6
+ onValueChange?: (newValue: string) => void;
7
+ /** Layout mode for the editor. Defaults to 'side-by-side'. */
8
+ layout?: MarkdownEditorLayout;
9
+ /** Maximum image file size in bytes for base64 paste */
10
+ maxImageSizeBytes?: number;
11
+ /** When true, the editor is read-only */
12
+ readOnly?: boolean;
13
+ /** Inline styles applied to the host element */
14
+ style?: Partial<CSSStyleDeclaration>;
15
+ };
16
+ /**
17
+ * Combined Markdown editor with an input pane and a live preview pane.
18
+ * Supports three layouts: side-by-side, tabs (Edit/Preview), or above-below.
19
+ */
20
+ export declare const MarkdownEditor: (props: MarkdownEditorProps & Omit<Partial<HTMLElement>, "style"> & {
21
+ style?: Partial<CSSStyleDeclaration>;
22
+ } & {
23
+ ref?: import("@furystack/shades").RefObject<Element>;
24
+ }, children?: import("@furystack/shades").ChildrenList) => JSX.Element;
25
+ //# sourceMappingURL=markdown-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-editor.d.ts","sourceRoot":"","sources":["../../../src/components/markdown/markdown-editor.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,MAAM,GAAG,aAAa,CAAA;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,+EAA+E;IAC/E,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,8DAA8D;IAC9D,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACrC,CAAA;AAID;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;sEAyIzB,CAAA"}
@@ -0,0 +1,113 @@
1
+ import { Shade, createComponent } from '@furystack/shades';
2
+ import { cssVariableTheme } from '../../services/css-variable-theme.js';
3
+ import { Tabs } from '../tabs.js';
4
+ import { MarkdownDisplay } from './markdown-display.js';
5
+ import { MarkdownInput } from './markdown-input.js';
6
+ /**
7
+ * Combined Markdown editor with an input pane and a live preview pane.
8
+ * Supports three layouts: side-by-side, tabs (Edit/Preview), or above-below.
9
+ */
10
+ export const MarkdownEditor = Shade({
11
+ shadowDomName: 'shade-markdown-editor',
12
+ css: {
13
+ display: 'flex',
14
+ flexDirection: 'column',
15
+ border: `1px solid ${cssVariableTheme.action.subtleBorder}`,
16
+ borderRadius: cssVariableTheme.shape.borderRadius.md,
17
+ overflow: 'hidden',
18
+ minHeight: '0',
19
+ '& .md-editor-split': {
20
+ display: 'flex',
21
+ flex: '1',
22
+ minHeight: '0',
23
+ },
24
+ '& .md-editor-split[data-layout="side-by-side"]': {
25
+ flexDirection: 'row',
26
+ },
27
+ '& .md-editor-split[data-layout="above-below"]': {
28
+ flexDirection: 'column',
29
+ minHeight: 'auto',
30
+ },
31
+ '& .md-editor-pane': {
32
+ flex: '1',
33
+ minWidth: '0',
34
+ minHeight: '0',
35
+ overflow: 'auto',
36
+ display: 'flex',
37
+ flexDirection: 'column',
38
+ },
39
+ '& .md-editor-pane-input': {
40
+ borderRight: 'none',
41
+ },
42
+ '& .md-editor-split[data-layout="side-by-side"] .md-editor-pane-input': {
43
+ borderRight: `1px solid ${cssVariableTheme.action.subtleBorder}`,
44
+ },
45
+ '& .md-editor-split[data-layout="above-below"] .md-editor-pane-input': {
46
+ borderBottom: `1px solid ${cssVariableTheme.action.subtleBorder}`,
47
+ },
48
+ '& .md-editor-split[data-layout="above-below"] .md-editor-pane': {
49
+ flex: 'none',
50
+ overflow: 'visible',
51
+ minHeight: 'auto',
52
+ },
53
+ '& .md-editor-split[data-layout="above-below"] shade-markdown-input textarea': {
54
+ overflow: 'hidden',
55
+ fieldSizing: 'content',
56
+ },
57
+ '& .md-editor-pane-preview': {
58
+ padding: cssVariableTheme.spacing.md,
59
+ },
60
+ '& shade-markdown-input': {
61
+ marginBottom: '0',
62
+ flex: '1',
63
+ display: 'flex',
64
+ flexDirection: 'column',
65
+ },
66
+ '& shade-markdown-input label': {
67
+ border: 'none',
68
+ borderRadius: '0',
69
+ flex: '1',
70
+ display: 'flex',
71
+ flexDirection: 'column',
72
+ },
73
+ '& shade-markdown-input textarea': {
74
+ flex: '1',
75
+ resize: 'none',
76
+ },
77
+ '& shade-tabs': {
78
+ flex: '1',
79
+ minHeight: '0',
80
+ },
81
+ '& .md-editor-tab-content': {
82
+ padding: cssVariableTheme.spacing.md,
83
+ overflow: 'auto',
84
+ },
85
+ },
86
+ render: ({ props, useState, useHostProps }) => {
87
+ const layout = props.layout ?? 'side-by-side';
88
+ useHostProps({
89
+ ...(props.style ? { style: props.style } : {}),
90
+ });
91
+ const [activeTab, setActiveTab] = useState('activeTab', 'edit');
92
+ const inputPane = (createComponent(MarkdownInput, { value: props.value, onValueChange: props.onValueChange, maxImageSizeBytes: props.maxImageSizeBytes, readOnly: props.readOnly }));
93
+ const previewPane = createComponent(MarkdownDisplay, { content: props.value, readOnly: false, onChange: props.onValueChange });
94
+ if (layout === 'tabs') {
95
+ return (createComponent(Tabs, { activeKey: activeTab, onTabChange: (key) => setActiveTab(key), tabs: [
96
+ {
97
+ header: createComponent(createComponent, null, "Edit"),
98
+ hash: 'edit',
99
+ component: createComponent("div", { className: "md-editor-tab-content" }, inputPane),
100
+ },
101
+ {
102
+ header: createComponent(createComponent, null, "Preview"),
103
+ hash: 'preview',
104
+ component: createComponent("div", { className: "md-editor-tab-content" }, previewPane),
105
+ },
106
+ ] }));
107
+ }
108
+ return (createComponent("div", { className: "md-editor-split", "data-layout": layout },
109
+ createComponent("div", { className: "md-editor-pane md-editor-pane-input" }, inputPane),
110
+ createComponent("div", { className: "md-editor-pane md-editor-pane-preview" }, previewPane)));
111
+ },
112
+ });
113
+ //# sourceMappingURL=markdown-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-editor.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAqBnD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAsB;IACvD,aAAa,EAAE,uBAAuB;IACtC,GAAG,EAAE;QACH,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,MAAM,EAAE,aAAa,gBAAgB,CAAC,MAAM,CAAC,YAAY,EAAE;QAC3D,YAAY,EAAE,gBAAgB,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QACpD,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,GAAG;QAEd,oBAAoB,EAAE;YACpB,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,GAAG;YACT,SAAS,EAAE,GAAG;SACf;QAED,gDAAgD,EAAE;YAChD,aAAa,EAAE,KAAK;SACrB;QAED,+CAA+C,EAAE;YAC/C,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,MAAM;SAClB;QAED,mBAAmB,EAAE;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,GA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C,IAAE,WAAW,CAAO,CACtE,CACP,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=markdown-editor.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-editor.spec.d.ts","sourceRoot":"","sources":["../../../src/components/markdown/markdown-editor.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,111 @@
1
+ import { Injector } from '@furystack/inject';
2
+ import { createComponent, initializeShadeRoot } from '@furystack/shades';
3
+ import { sleepAsync, usingAsync } from '@furystack/utils';
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
5
+ import { MarkdownEditor } from './markdown-editor.js';
6
+ describe('MarkdownEditor', () => {
7
+ beforeEach(() => {
8
+ document.body.innerHTML = '<div id="root"></div>';
9
+ });
10
+ afterEach(() => {
11
+ document.body.innerHTML = '';
12
+ vi.restoreAllMocks();
13
+ });
14
+ it('should render with shadow DOM', async () => {
15
+ await usingAsync(new Injector(), async (injector) => {
16
+ const rootElement = document.getElementById('root');
17
+ initializeShadeRoot({
18
+ injector,
19
+ rootElement,
20
+ jsxElement: createComponent(MarkdownEditor, { value: "# Hello" }),
21
+ });
22
+ await sleepAsync(50);
23
+ const el = document.querySelector('shade-markdown-editor');
24
+ expect(el).not.toBeNull();
25
+ });
26
+ });
27
+ describe('side-by-side layout (default)', () => {
28
+ it('should render input and preview panes side by side', async () => {
29
+ await usingAsync(new Injector(), async (injector) => {
30
+ const rootElement = document.getElementById('root');
31
+ initializeShadeRoot({
32
+ injector,
33
+ rootElement,
34
+ jsxElement: createComponent(MarkdownEditor, { value: "# Hello" }),
35
+ });
36
+ await sleepAsync(50);
37
+ const split = document.querySelector('.md-editor-split');
38
+ expect(split).not.toBeNull();
39
+ expect(split.dataset.layout).toBe('side-by-side');
40
+ const input = document.querySelector('shade-markdown-editor shade-markdown-input');
41
+ expect(input).not.toBeNull();
42
+ const display = document.querySelector('shade-markdown-editor shade-markdown-display');
43
+ expect(display).not.toBeNull();
44
+ });
45
+ });
46
+ });
47
+ describe('above-below layout', () => {
48
+ it('should render with above-below layout', async () => {
49
+ await usingAsync(new Injector(), async (injector) => {
50
+ const rootElement = document.getElementById('root');
51
+ initializeShadeRoot({
52
+ injector,
53
+ rootElement,
54
+ jsxElement: createComponent(MarkdownEditor, { value: "# Hello", layout: "above-below" }),
55
+ });
56
+ await sleepAsync(50);
57
+ const split = document.querySelector('.md-editor-split');
58
+ expect(split).not.toBeNull();
59
+ expect(split.dataset.layout).toBe('above-below');
60
+ });
61
+ });
62
+ });
63
+ describe('tabs layout', () => {
64
+ it('should render with tabs layout', async () => {
65
+ await usingAsync(new Injector(), async (injector) => {
66
+ const rootElement = document.getElementById('root');
67
+ initializeShadeRoot({
68
+ injector,
69
+ rootElement,
70
+ jsxElement: createComponent(MarkdownEditor, { value: "# Hello", layout: "tabs" }),
71
+ });
72
+ await sleepAsync(50);
73
+ const tabs = document.querySelector('shade-markdown-editor shade-tabs');
74
+ expect(tabs).not.toBeNull();
75
+ const tabButtons = document.querySelectorAll('shade-markdown-editor .shade-tab-btn');
76
+ expect(tabButtons.length).toBe(2);
77
+ });
78
+ });
79
+ it('should show the edit tab by default', async () => {
80
+ await usingAsync(new Injector(), async (injector) => {
81
+ const rootElement = document.getElementById('root');
82
+ initializeShadeRoot({
83
+ injector,
84
+ rootElement,
85
+ jsxElement: createComponent(MarkdownEditor, { value: "# Hello", layout: "tabs" }),
86
+ });
87
+ await sleepAsync(50);
88
+ const input = document.querySelector('shade-markdown-editor shade-markdown-input');
89
+ expect(input).not.toBeNull();
90
+ });
91
+ });
92
+ });
93
+ it('should pass value to both input and display', async () => {
94
+ await usingAsync(new Injector(), async (injector) => {
95
+ const rootElement = document.getElementById('root');
96
+ const mdContent = '# Test Content';
97
+ initializeShadeRoot({
98
+ injector,
99
+ rootElement,
100
+ jsxElement: createComponent(MarkdownEditor, { value: mdContent }),
101
+ });
102
+ await sleepAsync(50);
103
+ const textarea = document.querySelector('shade-markdown-editor textarea');
104
+ expect(textarea.value).toBe(mdContent);
105
+ const heading = document.querySelector('shade-markdown-editor shade-markdown-display shade-typography[data-variant="h1"]');
106
+ expect(heading).not.toBeNull();
107
+ expect(heading?.textContent).toContain('Test Content');
108
+ });
109
+ });
110
+ });
111
+ //# sourceMappingURL=markdown-editor.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-editor.spec.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-editor.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,uBAAuB,CAAA;IACnD,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QAC5B,EAAE,CAAC,eAAe,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,UAAU,CAAC,IAAI,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YAClD,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAmB,CAAA;YAErE,mBAAmB,CAAC;gBAClB,QAAQ;gBACR,WAAW;gBAC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gB,CAAA;YAElC,mBAAmB,CAAC;gBAClB,QAAQ;gBACR,WAAW;gBACX,UAAU,EAAE,gBAAC,cAAc,IAAC,KAAK,EAAE,SAAS,GAAI;aACjD,CAAC,CAAA;YAEF,MAAM,UAAU,CAAC,EAAE,CAAC,CAAA;YAEpB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,gCAAgC,CAAwB,CAAA;YAChG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YAEtC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CACpC,kFAAkF,CACnF,CAAA;YACD,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;YAC9B,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,29 @@
1
+ export type MarkdownInputProps = {
2
+ /** The current Markdown string */
3
+ value: string;
4
+ /** Called when the value changes */
5
+ onValueChange?: (newValue: string) => void;
6
+ /** Maximum image file size in bytes for base64 paste. Defaults to 256KB. */
7
+ maxImageSizeBytes?: number;
8
+ /** Whether the textarea is read-only */
9
+ readOnly?: boolean;
10
+ /** Whether the textarea is disabled */
11
+ disabled?: boolean;
12
+ /** Placeholder text */
13
+ placeholder?: string;
14
+ /** Label shown above the textarea */
15
+ labelTitle?: string;
16
+ /** Number of visible text rows */
17
+ rows?: number;
18
+ };
19
+ /**
20
+ * Markdown text input with base64 image paste support.
21
+ * When the user pastes an image below the configured size limit,
22
+ * it is inlined as a `![pasted image](data:...)` Markdown image.
23
+ */
24
+ export declare const MarkdownInput: (props: MarkdownInputProps & Omit<Partial<HTMLElement>, "style"> & {
25
+ style?: Partial<CSSStyleDeclaration>;
26
+ } & {
27
+ ref?: import("@furystack/shades").RefObject<Element>;
28
+ }, children?: import("@furystack/shades").ChildrenList) => JSX.Element;
29
+ //# sourceMappingURL=markdown-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-input.d.ts","sourceRoot":"","sources":["../../../src/components/markdown/markdown-input.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;sEAiHxB,CAAA"}
@@ -0,0 +1,100 @@
1
+ import { Shade, createComponent } from '@furystack/shades';
2
+ import { cssVariableTheme } from '../../services/css-variable-theme.js';
3
+ const DEFAULT_MAX_IMAGE_SIZE = 256 * 1024;
4
+ /**
5
+ * Markdown text input with base64 image paste support.
6
+ * When the user pastes an image below the configured size limit,
7
+ * it is inlined as a `![pasted image](data:...)` Markdown image.
8
+ */
9
+ export const MarkdownInput = Shade({
10
+ shadowDomName: 'shade-markdown-input',
11
+ css: {
12
+ display: 'block',
13
+ marginBottom: '1em',
14
+ '& label': {
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ alignItems: 'flex-start',
18
+ fontSize: cssVariableTheme.typography.fontSize.xs,
19
+ color: cssVariableTheme.text.secondary,
20
+ padding: '1em',
21
+ borderRadius: cssVariableTheme.shape.borderRadius.md,
22
+ border: `1px solid ${cssVariableTheme.action.subtleBorder}`,
23
+ transition: `color ${cssVariableTheme.transitions.duration.slow} ${cssVariableTheme.transitions.easing.default}`,
24
+ },
25
+ '&[data-disabled] label': {
26
+ color: cssVariableTheme.text.disabled,
27
+ },
28
+ '&:focus-within label': {
29
+ color: cssVariableTheme.palette.primary.main,
30
+ },
31
+ '& textarea': {
32
+ border: 'none',
33
+ backgroundColor: 'transparent',
34
+ outline: 'none',
35
+ fontSize: cssVariableTheme.typography.fontSize.sm,
36
+ fontFamily: 'monospace',
37
+ width: '100%',
38
+ resize: 'vertical',
39
+ color: cssVariableTheme.text.primary,
40
+ boxShadow: '0px 0px 0px rgba(128,128,128,0.1)',
41
+ transition: `box-shadow ${cssVariableTheme.transitions.duration.normal} ease`,
42
+ lineHeight: cssVariableTheme.typography.lineHeight.relaxed,
43
+ padding: `${cssVariableTheme.spacing.sm} 0`,
44
+ },
45
+ '&:focus-within textarea': {
46
+ boxShadow: `0px 3px 0px ${cssVariableTheme.palette.primary.main}`,
47
+ },
48
+ },
49
+ render: ({ props, useHostProps, useRef }) => {
50
+ const maxSize = props.maxImageSizeBytes ?? DEFAULT_MAX_IMAGE_SIZE;
51
+ const textareaRef = useRef('textarea');
52
+ useHostProps({
53
+ 'data-disabled': props.disabled ? '' : undefined,
54
+ });
55
+ const handleInput = (ev) => {
56
+ const target = ev.target;
57
+ props.onValueChange?.(target.value);
58
+ };
59
+ const handlePaste = (ev) => {
60
+ const items = ev.clipboardData?.items;
61
+ if (!items)
62
+ return;
63
+ for (let i = 0; i < items.length; i++) {
64
+ const item = items[i];
65
+ if (item.type.startsWith('image/')) {
66
+ const file = item.getAsFile();
67
+ if (!file || file.size > maxSize)
68
+ continue;
69
+ ev.preventDefault();
70
+ const reader = new FileReader();
71
+ reader.onload = () => {
72
+ const base64 = reader.result;
73
+ const textarea = textareaRef.current;
74
+ if (!textarea)
75
+ return;
76
+ const start = textarea.selectionStart;
77
+ const end = textarea.selectionEnd;
78
+ const before = textarea.value.slice(0, start);
79
+ const after = textarea.value.slice(end);
80
+ const imageMarkdown = `![pasted image](${base64})`;
81
+ const newValue = before + imageMarkdown + after;
82
+ textarea.value = newValue;
83
+ const cursorPos = start + imageMarkdown.length;
84
+ textarea.setSelectionRange(cursorPos, cursorPos);
85
+ props.onValueChange?.(newValue);
86
+ };
87
+ reader.onerror = () => {
88
+ console.warn('Failed to read pasted image file');
89
+ };
90
+ reader.readAsDataURL(file);
91
+ return;
92
+ }
93
+ }
94
+ };
95
+ return (createComponent("label", null,
96
+ props.labelTitle ? createComponent("span", null, props.labelTitle) : null,
97
+ createComponent("textarea", { ref: textareaRef, value: props.value, oninput: handleInput, onpaste: handlePaste, readOnly: props.readOnly, disabled: props.disabled, placeholder: props.placeholder, rows: props.rows ?? 10 })));
98
+ },
99
+ });
100
+ //# sourceMappingURL=markdown-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-input.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvE,MAAM,sBAAsB,GAAG,GAAG,GAAG,IAAI,CAAA;AAqBzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAqB;IACrD,aAAa,EAAE,sBAAsB;IACrC,GAAG,EAAE;QACH,OAAO,EAAE,OAAO;QAChB,YAAY,EAAE,KAAK;QAEnB,SAAS,EAAE;YACT,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,YAAY;YACxB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YACjD,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,SAAS;YACtC,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,gBAAgB,CAAC,KAAK,CAA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d.ts","sourceRoot":"","sources":["../../../src/components/markdown/markdown-input.spec.tsx"],"names":[],"mappings":""}