@bendyline/squisq-editor-react 1.2.1 → 1.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.
- package/dist/EditorContext.d.ts +65 -1
- package/dist/EditorContext.d.ts.map +1 -1
- package/dist/EditorContext.js +31 -4
- package/dist/EditorContext.js.map +1 -1
- package/dist/EditorShell.d.ts +101 -2
- package/dist/EditorShell.d.ts.map +1 -1
- package/dist/EditorShell.js +20 -8
- package/dist/EditorShell.js.map +1 -1
- package/dist/ImageNodeView.d.ts.map +1 -1
- package/dist/ImageNodeView.js +12 -2
- package/dist/ImageNodeView.js.map +1 -1
- package/dist/MediaBin.d.ts.map +1 -1
- package/dist/MediaBin.js +16 -1
- package/dist/MediaBin.js.map +1 -1
- package/dist/MentionExtension.d.ts +22 -0
- package/dist/MentionExtension.d.ts.map +1 -0
- package/dist/MentionExtension.js +242 -0
- package/dist/MentionExtension.js.map +1 -0
- package/dist/PreviewPanel.d.ts +3 -8
- package/dist/PreviewPanel.d.ts.map +1 -1
- package/dist/PreviewPanel.js +4 -282
- package/dist/PreviewPanel.js.map +1 -1
- package/dist/RawEditor.d.ts +8 -1
- package/dist/RawEditor.d.ts.map +1 -1
- package/dist/RawEditor.js +167 -30
- package/dist/RawEditor.js.map +1 -1
- package/dist/TemplateAnnotation.d.ts.map +1 -1
- package/dist/TemplateAnnotation.js +4 -2
- package/dist/TemplateAnnotation.js.map +1 -1
- package/dist/Toolbar.d.ts +7 -1
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +57 -18
- package/dist/Toolbar.js.map +1 -1
- package/dist/Tooltip.d.ts +10 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +104 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/ViewSwitcher.d.ts +1 -1
- package/dist/ViewSwitcher.d.ts.map +1 -1
- package/dist/ViewSwitcher.js +10 -4
- package/dist/ViewSwitcher.js.map +1 -1
- package/dist/WysiwygEditor.d.ts +13 -2
- package/dist/WysiwygEditor.d.ts.map +1 -1
- package/dist/WysiwygEditor.js +239 -4
- package/dist/WysiwygEditor.js.map +1 -1
- package/dist/__tests__/detectMarkdown.test.d.ts +2 -0
- package/dist/__tests__/detectMarkdown.test.d.ts.map +1 -0
- package/dist/__tests__/detectMarkdown.test.js +69 -0
- package/dist/__tests__/detectMarkdown.test.js.map +1 -0
- package/dist/__tests__/fileKind.test.d.ts +2 -0
- package/dist/__tests__/fileKind.test.d.ts.map +1 -0
- package/dist/__tests__/fileKind.test.js +81 -0
- package/dist/__tests__/fileKind.test.js.map +1 -0
- package/dist/__tests__/tiptapBridge.test.js +36 -0
- package/dist/__tests__/tiptapBridge.test.js.map +1 -1
- package/dist/buildPreviewDoc.d.ts +22 -0
- package/dist/buildPreviewDoc.d.ts.map +1 -0
- package/dist/buildPreviewDoc.js +212 -0
- package/dist/buildPreviewDoc.js.map +1 -0
- package/dist/detectMarkdown.d.ts +20 -0
- package/dist/detectMarkdown.d.ts.map +1 -0
- package/dist/detectMarkdown.js +61 -0
- package/dist/detectMarkdown.js.map +1 -0
- package/dist/fileKind.d.ts +30 -0
- package/dist/fileKind.d.ts.map +1 -0
- package/dist/fileKind.js +123 -0
- package/dist/fileKind.js.map +1 -0
- package/dist/hooks/useFileDrop.d.ts.map +1 -1
- package/dist/hooks/useFileDrop.js +9 -7
- package/dist/hooks/useFileDrop.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/mediaDragMime.d.ts +17 -0
- package/dist/mediaDragMime.d.ts.map +1 -0
- package/dist/mediaDragMime.js +22 -0
- package/dist/mediaDragMime.js.map +1 -0
- package/dist/tiptapBridge.d.ts.map +1 -1
- package/dist/tiptapBridge.js +58 -2
- package/dist/tiptapBridge.js.map +1 -1
- package/package.json +9 -7
- package/src/EditorContext.tsx +106 -3
- package/src/EditorShell.tsx +195 -15
- package/src/ImageNodeView.tsx +15 -2
- package/src/MediaBin.tsx +23 -1
- package/src/MentionExtension.tsx +258 -0
- package/src/PreviewPanel.tsx +5 -333
- package/src/RawEditor.tsx +193 -37
- package/src/TemplateAnnotation.ts +4 -2
- package/src/Toolbar.tsx +111 -48
- package/src/Tooltip.tsx +124 -0
- package/src/ViewSwitcher.tsx +15 -5
- package/src/WysiwygEditor.tsx +270 -5
- package/src/__tests__/detectMarkdown.test.ts +88 -0
- package/src/__tests__/fileKind.test.ts +96 -0
- package/src/__tests__/tiptapBridge.test.ts +44 -0
- package/src/buildPreviewDoc.ts +254 -0
- package/src/detectMarkdown.ts +62 -0
- package/src/fileKind.ts +134 -0
- package/src/hooks/useFileDrop.ts +10 -6
- package/src/index.ts +14 -0
- package/src/mediaDragMime.ts +32 -0
- package/src/styles/editor.css +214 -8
- package/src/tiptapBridge.ts +66 -2
package/dist/RawEditor.js
CHANGED
|
@@ -11,6 +11,7 @@ import Editor, { loader } from '@monaco-editor/react';
|
|
|
11
11
|
import * as monaco from 'monaco-editor';
|
|
12
12
|
import { useEditorContext } from './EditorContext';
|
|
13
13
|
import { getAvailableTemplates } from '@bendyline/squisq/doc';
|
|
14
|
+
import { SQUISQ_MEDIA_MIME, parseSquisqMediaPayload } from './mediaDragMime';
|
|
14
15
|
// Use locally installed monaco-editor instead of CDN.
|
|
15
16
|
//
|
|
16
17
|
// NOTE: By default this imports the full monaco-editor with all 80+ languages
|
|
@@ -26,51 +27,185 @@ loader.config({ monaco });
|
|
|
26
27
|
* Raw markdown editor using Monaco Editor.
|
|
27
28
|
* Binds to the shared EditorContext for source synchronization.
|
|
28
29
|
*/
|
|
29
|
-
export function RawEditor({ theme = 'vs', minimap = false, fontSize = 14, wordWrap = 'on', className, }) {
|
|
30
|
-
const { markdownSource, setMarkdownSource, setMonacoEditor } = useEditorContext();
|
|
30
|
+
export function RawEditor({ theme = 'vs', minimap = false, fontSize = 14, wordWrap = 'on', className, submitOnEnter, readOnly = false, }) {
|
|
31
|
+
const { markdownSource, setMarkdownSource, setMonacoEditor, language, mentionProvider } = useEditorContext();
|
|
31
32
|
const editorRef = useRef(null);
|
|
32
33
|
const isExternalUpdate = useRef(false);
|
|
33
34
|
const completionDisposable = useRef(null);
|
|
35
|
+
const mentionCompletionDisposable = useRef(null);
|
|
36
|
+
const dropCleanupRef = useRef(null);
|
|
37
|
+
const keyDisposable = useRef(null);
|
|
38
|
+
// Ref so the keydown handler always sees the latest callback.
|
|
39
|
+
const submitOnEnterRef = useRef(submitOnEnter);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
submitOnEnterRef.current = submitOnEnter;
|
|
42
|
+
}, [submitOnEnter]);
|
|
43
|
+
// Ref so the completion provider — registered once at mount — always
|
|
44
|
+
// sees the latest mentionProvider without needing to unregister.
|
|
45
|
+
const mentionProviderRef = useRef(mentionProvider);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
mentionProviderRef.current = mentionProvider;
|
|
48
|
+
}, [mentionProvider]);
|
|
34
49
|
const handleMount = useCallback((editor, monaco) => {
|
|
35
50
|
editorRef.current = editor;
|
|
36
51
|
setMonacoEditor(editor);
|
|
37
52
|
editor.focus();
|
|
38
53
|
// Dispose any previous completion provider (from a prior mount)
|
|
39
54
|
completionDisposable.current?.dispose();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
range,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
completionDisposable.current = null;
|
|
56
|
+
mentionCompletionDisposable.current?.dispose();
|
|
57
|
+
mentionCompletionDisposable.current = null;
|
|
58
|
+
// Register the `{[template]}` completion provider only for markdown
|
|
59
|
+
// files — it's meaningless for TypeScript, JSON, Python, etc.
|
|
60
|
+
if (language === 'markdown') {
|
|
61
|
+
const templates = getAvailableTemplates();
|
|
62
|
+
completionDisposable.current = monaco.languages.registerCompletionItemProvider('markdown', {
|
|
63
|
+
triggerCharacters: ['['],
|
|
64
|
+
provideCompletionItems(model, position) {
|
|
65
|
+
const lineContent = model.getLineContent(position.lineNumber);
|
|
66
|
+
// Only trigger inside a heading line that has {[ before the cursor
|
|
67
|
+
if (!/^#{1,6}\s/.test(lineContent))
|
|
68
|
+
return { suggestions: [] };
|
|
69
|
+
const textBeforeCursor = lineContent.substring(0, position.column - 1);
|
|
70
|
+
const bracketIdx = textBeforeCursor.lastIndexOf('{[');
|
|
71
|
+
if (bracketIdx === -1)
|
|
72
|
+
return { suggestions: [] };
|
|
73
|
+
// The range to replace: from after {[ to the cursor
|
|
74
|
+
const startCol = bracketIdx + 3; // after {[
|
|
75
|
+
const range = new monaco.Range(position.lineNumber, startCol, position.lineNumber, position.column);
|
|
76
|
+
const suggestions = templates.map((name) => ({
|
|
77
|
+
label: name,
|
|
78
|
+
kind: monaco.languages.CompletionItemKind.Value,
|
|
79
|
+
insertText: name + ']}',
|
|
80
|
+
range,
|
|
81
|
+
detail: 'Block template',
|
|
82
|
+
sortText: name,
|
|
83
|
+
}));
|
|
84
|
+
return { suggestions };
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
// `@mention` completion — queries the shared MentionProvider. Keep
|
|
88
|
+
// this in its own registration so we can dispose it independently
|
|
89
|
+
// of the template provider, and so the trigger character is just
|
|
90
|
+
// `@` (not `[`).
|
|
91
|
+
mentionCompletionDisposable.current = monaco.languages.registerCompletionItemProvider('markdown', {
|
|
92
|
+
triggerCharacters: ['@'],
|
|
93
|
+
async provideCompletionItems(model, position) {
|
|
94
|
+
const provider = mentionProviderRef.current;
|
|
95
|
+
if (!provider)
|
|
96
|
+
return { suggestions: [] };
|
|
97
|
+
const lineContent = model.getLineContent(position.lineNumber);
|
|
98
|
+
const textBeforeCursor = lineContent.substring(0, position.column - 1);
|
|
99
|
+
const atIdx = textBeforeCursor.lastIndexOf('@');
|
|
100
|
+
if (atIdx === -1)
|
|
101
|
+
return { suggestions: [] };
|
|
102
|
+
// `@` must be at line start or preceded by whitespace/punct —
|
|
103
|
+
// skip e.g. email addresses like `foo@bar`.
|
|
104
|
+
if (atIdx > 0) {
|
|
105
|
+
const prevChar = textBeforeCursor[atIdx - 1];
|
|
106
|
+
if (!/[\s\p{P}]/u.test(prevChar))
|
|
107
|
+
return { suggestions: [] };
|
|
108
|
+
}
|
|
109
|
+
const query = textBeforeCursor.slice(atIdx + 1);
|
|
110
|
+
// Only fire for short queries — once the user has typed
|
|
111
|
+
// a full word, the popover gets noisy.
|
|
112
|
+
if (query.length > 40)
|
|
113
|
+
return { suggestions: [] };
|
|
114
|
+
if (/\s/.test(query))
|
|
115
|
+
return { suggestions: [] };
|
|
116
|
+
let candidates;
|
|
117
|
+
try {
|
|
118
|
+
candidates = await provider(query);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return { suggestions: [] };
|
|
122
|
+
}
|
|
123
|
+
const range = new monaco.Range(position.lineNumber, atIdx + 1, position.lineNumber, position.column);
|
|
124
|
+
return {
|
|
125
|
+
suggestions: candidates.map((c) => ({
|
|
126
|
+
label: `@${c.label}`,
|
|
127
|
+
kind: monaco.languages.CompletionItemKind.User,
|
|
128
|
+
insertText: `@[${c.label}](${c.scheme}:${c.id}) `,
|
|
129
|
+
range,
|
|
130
|
+
...(c.description ? { detail: c.description } : {}),
|
|
131
|
+
sortText: c.label,
|
|
132
|
+
})),
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
// Chat-composer mode: intercept Enter before Monaco inserts a newline.
|
|
138
|
+
// Cmd/Ctrl+Enter falls through so the native newline still works.
|
|
139
|
+
keyDisposable.current?.dispose();
|
|
140
|
+
keyDisposable.current = editor.onKeyDown((e) => {
|
|
141
|
+
if (e.keyCode !== monaco.KeyCode.Enter)
|
|
142
|
+
return;
|
|
143
|
+
if (!submitOnEnterRef.current)
|
|
144
|
+
return;
|
|
145
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)
|
|
146
|
+
return;
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
e.stopPropagation();
|
|
149
|
+
submitOnEnterRef.current();
|
|
66
150
|
});
|
|
67
|
-
|
|
151
|
+
// Attach native drop listeners for in-app MediaBin drags. Monaco's own
|
|
152
|
+
// drop handling doesn't know about our custom MIME type, so we insert
|
|
153
|
+
// markdown image syntax explicitly in the capture phase.
|
|
154
|
+
dropCleanupRef.current?.();
|
|
155
|
+
const domNode = editor.getDomNode();
|
|
156
|
+
if (domNode) {
|
|
157
|
+
const onDragOver = (e) => {
|
|
158
|
+
if (e.dataTransfer?.types.includes(SQUISQ_MEDIA_MIME)) {
|
|
159
|
+
e.preventDefault();
|
|
160
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const onDrop = (e) => {
|
|
164
|
+
const dt = e.dataTransfer;
|
|
165
|
+
if (!dt)
|
|
166
|
+
return;
|
|
167
|
+
const raw = dt.getData(SQUISQ_MEDIA_MIME);
|
|
168
|
+
if (!raw)
|
|
169
|
+
return;
|
|
170
|
+
const payload = parseSquisqMediaPayload(raw);
|
|
171
|
+
if (!payload || !payload.mimeType.startsWith('image/'))
|
|
172
|
+
return;
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
e.stopPropagation();
|
|
175
|
+
const target = editor.getTargetAtClientPoint(e.clientX, e.clientY);
|
|
176
|
+
const position = target?.position ?? editor.getPosition();
|
|
177
|
+
if (!position)
|
|
178
|
+
return;
|
|
179
|
+
const markdown = ``;
|
|
180
|
+
editor.executeEdits('squisq-media-drop', [
|
|
181
|
+
{
|
|
182
|
+
range: new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column),
|
|
183
|
+
text: markdown,
|
|
184
|
+
forceMoveMarkers: true,
|
|
185
|
+
},
|
|
186
|
+
]);
|
|
187
|
+
editor.focus();
|
|
188
|
+
};
|
|
189
|
+
domNode.addEventListener('dragover', onDragOver, true);
|
|
190
|
+
domNode.addEventListener('drop', onDrop, true);
|
|
191
|
+
dropCleanupRef.current = () => {
|
|
192
|
+
domNode.removeEventListener('dragover', onDragOver, true);
|
|
193
|
+
domNode.removeEventListener('drop', onDrop, true);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}, [setMonacoEditor, language]);
|
|
68
197
|
// Unregister on unmount
|
|
69
198
|
useEffect(() => {
|
|
70
199
|
return () => {
|
|
71
200
|
setMonacoEditor(null);
|
|
72
201
|
completionDisposable.current?.dispose();
|
|
73
202
|
completionDisposable.current = null;
|
|
203
|
+
mentionCompletionDisposable.current?.dispose();
|
|
204
|
+
mentionCompletionDisposable.current = null;
|
|
205
|
+
dropCleanupRef.current?.();
|
|
206
|
+
dropCleanupRef.current = null;
|
|
207
|
+
keyDisposable.current?.dispose();
|
|
208
|
+
keyDisposable.current = null;
|
|
74
209
|
};
|
|
75
210
|
}, [setMonacoEditor]);
|
|
76
211
|
const handleChange = useCallback((value) => {
|
|
@@ -92,7 +227,7 @@ export function RawEditor({ theme = 'vs', minimap = false, fontSize = 14, wordWr
|
|
|
92
227
|
}
|
|
93
228
|
}
|
|
94
229
|
}, [markdownSource]);
|
|
95
|
-
return (_jsx("div", { className: className, style: { width: '100%', height: '100%' }, "data-testid": "raw-editor", children: _jsx(Editor, { defaultLanguage:
|
|
230
|
+
return (_jsx("div", { className: className, style: { width: '100%', height: '100%' }, "data-testid": "raw-editor", children: _jsx(Editor, { defaultLanguage: language, value: markdownSource, theme: theme, onMount: handleMount, onChange: handleChange, options: {
|
|
96
231
|
fontSize,
|
|
97
232
|
wordWrap,
|
|
98
233
|
minimap: { enabled: minimap },
|
|
@@ -104,6 +239,8 @@ export function RawEditor({ theme = 'vs', minimap = false, fontSize = 14, wordWr
|
|
|
104
239
|
bracketPairColorization: { enabled: true },
|
|
105
240
|
guides: { indentation: true },
|
|
106
241
|
padding: { top: 12, bottom: 12 },
|
|
242
|
+
readOnly,
|
|
243
|
+
domReadOnly: readOnly,
|
|
107
244
|
} }) }));
|
|
108
245
|
}
|
|
109
246
|
//# sourceMappingURL=RawEditor.js.map
|
package/dist/RawEditor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RawEditor.js","sourceRoot":"","sources":["../src/RawEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,MAAM,EAAE,EAAE,MAAM,EAA+B,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"RawEditor.js","sourceRoot":"","sources":["../src/RawEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,MAAM,EAAE,EAAE,MAAM,EAA+B,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,sDAAsD;AACtD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,kFAAkF;AAClF,EAAE;AACF,uFAAuF;AACvF,EAAE;AACF,gFAAgF;A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C,OAAO,GAAG,IAAI,CAAC;gBAChC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;gBAChC,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAc,YAAY,YAC3F,KAAC,MAAM,IACL,eAAe,EAAE,QAAQ,EACzB,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE;gBACP,QAAQ;gBACR,QAAQ;gBACR,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;gBAC7B,WAAW,EAAE,IAAI;gBACjB,oBAAoB,EAAE,KAAK;gBAC3B,eAAe,EAAE,IAAI;gBACrB,OAAO,EAAE,CAAC;gBACV,gBAAgB,EAAE,WAAW;gBAC7B,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBAC1C,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;gBAC7B,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;gBAChC,QAAQ;gBACR,WAAW,EAAE,QAAQ;aACtB,GACD,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateAnnotation.d.ts","sourceRoot":"","sources":["../src/TemplateAnnotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"TemplateAnnotation.d.ts","sourceRoot":"","sources":["../src/TemplateAnnotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sFAmD9B,CAAC"}
|
|
@@ -46,7 +46,10 @@ export const HeadingWithTemplate = Heading.extend({
|
|
|
46
46
|
const tag = `h${level}`;
|
|
47
47
|
const templateName = HTMLAttributes['data-template'];
|
|
48
48
|
if (templateName) {
|
|
49
|
-
// Render heading with a trailing badge span
|
|
49
|
+
// Render heading with a trailing badge span. The badge has no text
|
|
50
|
+
// content — its label is painted via CSS `content: attr(data-template)`
|
|
51
|
+
// so the template name never becomes part of the serialized heading
|
|
52
|
+
// text (which would leak into markdown on round-trip).
|
|
50
53
|
return [
|
|
51
54
|
tag,
|
|
52
55
|
HTMLAttributes,
|
|
@@ -58,7 +61,6 @@ export const HeadingWithTemplate = Heading.extend({
|
|
|
58
61
|
contenteditable: 'false',
|
|
59
62
|
'data-template': templateName,
|
|
60
63
|
},
|
|
61
|
-
templateName,
|
|
62
64
|
],
|
|
63
65
|
];
|
|
64
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateAnnotation.js","sourceRoot":"","sources":["../src/TemplateAnnotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAChD,aAAa;QACX,OAAO;YACL,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE;YAClB,YAAY,EAAE;gBACZ,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,CAAC,OAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI;gBAClF,UAAU,EAAE,CAAC,UAAmC,EAAE,EAAE;oBAClD,IAAI,CAAC,UAAU,CAAC,YAAY;wBAAE,OAAO,EAAE,CAAC;oBACxC,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,YAAY,EAAE,CA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C;gBACtD,CAAC;aACF;YACD,kBAAkB,EAAE;gBAClB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,CAAC,OAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,sBAAsB,CAAC,IAAI,IAAI;gBACzF,UAAU,EAAE,CAAC,UAAmC,EAAE,EAAE;oBAClD,IAAI,CAAC,UAAU,CAAC,kBAAkB;wBAAE,OAAO,EAAE,CAAC;oBAC9C,OAAO,EAAE,sBAAsB,EAAE,UAAU,CAAC,kBAAkB,EAAE,CAAC;gBACnE,CAAC;aACF;SACF,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,YAAY,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;QAErD,IAAI,YAAY,EAAE,CAAC;YACjB,mEAAmE;YACnE,wEAAwE;YACxE,oEAAoE;YACpE,uDAAuD;YACvD,OAAO;gBACL,GAAG;gBACH,cAAc;gBACd,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,CAAC,CAAC;gBAChD;oBACE,MAAM;oBACN;wBACE,KAAK,EAAE,uBAAuB;wBAC9B,eAAe,EAAE,OAAO;wBACxB,eAAe,EAAE,YAAY;qBAC9B;iBACF;aACF,CAAC;QACJ,CAAC;QAED,yCAAyC;QACzC,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC;CACF,CAAC,CAAC"}
|
package/dist/Toolbar.d.ts
CHANGED
|
@@ -20,11 +20,17 @@ export interface ToolbarProps {
|
|
|
20
20
|
slotAfterActions?: ReactNode;
|
|
21
21
|
/** Content rendered at the rightmost end of the toolbar, after all other elements. */
|
|
22
22
|
slotRight?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to include the "Play" (preview) tab in the view switcher.
|
|
25
|
+
* Defaults to true. Hosts that don't want the slideshow preview — e.g.
|
|
26
|
+
* editing free-form prompts — can pass false to suppress it.
|
|
27
|
+
*/
|
|
28
|
+
showPlayTab?: boolean;
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
25
31
|
* Formatting toolbar.
|
|
26
32
|
* - WYSIWYG: calls Tiptap chain commands (toggleBold, etc.)
|
|
27
33
|
* - Raw: appends markdown syntax to the source
|
|
28
34
|
*/
|
|
29
|
-
export declare function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAfterActions, slotRight, }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAfterActions, slotRight, showPlayTab, }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
30
36
|
//# sourceMappingURL=Toolbar.d.ts.map
|
package/dist/Toolbar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../src/Toolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAevC,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,sFAAsF;IACtF,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../src/Toolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAevC,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,sFAAsF;IACtF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA8FD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAkB,GACnB,EAAE,YAAY,2CAi1Bd"}
|
package/dist/Toolbar.js
CHANGED
|
@@ -6,11 +6,11 @@ import { getAvailableTemplates } from '@bendyline/squisq/doc';
|
|
|
6
6
|
const TEMPLATE_NAMES = getAvailableTemplates();
|
|
7
7
|
const VIEWS = [
|
|
8
8
|
{ id: 'wysiwyg', label: 'Editor', shortcut: '⌘1' },
|
|
9
|
-
{ id: 'raw', label: '
|
|
9
|
+
{ id: 'raw', label: 'Markdown', shortLabel: 'MD', shortcut: '⌘2' },
|
|
10
10
|
{ id: 'preview', label: 'Play', shortcut: '⌘3' },
|
|
11
11
|
];
|
|
12
12
|
const BUTTONS = [
|
|
13
|
-
// Format group
|
|
13
|
+
// Format group — B/I/S trio.
|
|
14
14
|
{
|
|
15
15
|
id: 'bold',
|
|
16
16
|
label: 'B',
|
|
@@ -35,20 +35,23 @@ const BUTTONS = [
|
|
|
35
35
|
group: 'format',
|
|
36
36
|
iconStyle: { textDecoration: 'line-through' },
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
// Lists group — sits between format and structure so bullets/numbers
|
|
39
|
+
// are adjacent to the inline formatters people reach for together.
|
|
40
|
+
{ id: 'ul', label: '•', icon: '•', title: 'Bullet list', group: 'lists' },
|
|
41
|
+
{ id: 'ol', label: '1.', icon: '1.', title: 'Numbered list', group: 'lists' },
|
|
39
42
|
// Structure group
|
|
40
43
|
{ id: 'h1', label: 'H1', icon: 'H1', title: 'Heading 1', group: 'structure' },
|
|
41
44
|
{ id: 'h2', label: 'H2', icon: 'H2', title: 'Heading 2', group: 'structure' },
|
|
42
45
|
{ id: 'h3', label: 'H3', icon: 'H3', title: 'Heading 3', group: 'structure' },
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{ id: 'ul', label: '•', icon: '•', title: 'Bullet list', group: 'insert' },
|
|
46
|
-
{ id: 'ol', label: '1.', icon: '1.', title: 'Numbered list', group: 'insert' },
|
|
46
|
+
// Insert group — block-level inserts (quote, code blocks, rules)
|
|
47
|
+
{ id: 'quote', label: '❝', icon: '❝', title: 'Blockquote', group: 'insert' },
|
|
47
48
|
{ id: 'codeblock', label: '{ }', icon: '{ }', title: 'Code block', group: 'insert' },
|
|
49
|
+
{ id: 'code', label: '</>', icon: '</>', title: 'Inline code', group: 'insert' },
|
|
48
50
|
{ id: 'hr', label: '—', icon: '—', title: 'Horizontal rule', group: 'insert' },
|
|
49
|
-
|
|
50
|
-
{ id: '
|
|
51
|
-
{ id: '
|
|
51
|
+
// Media group — links, tables, images
|
|
52
|
+
{ id: 'link', label: '🔗', icon: '🔗', title: 'Insert link', group: 'media' },
|
|
53
|
+
{ id: 'table', label: 'table', icon: '', title: 'Insert table', group: 'media' },
|
|
54
|
+
{ id: 'image', label: '🖼', icon: '🖼', title: 'Insert image', group: 'media' },
|
|
52
55
|
];
|
|
53
56
|
// ─── Tiptap active-state map ────────────────────────────
|
|
54
57
|
/** Returns true if the given button id is currently active in Tiptap */
|
|
@@ -87,8 +90,19 @@ function isTiptapActive(editor, id) {
|
|
|
87
90
|
* - WYSIWYG: calls Tiptap chain commands (toggleBold, etc.)
|
|
88
91
|
* - Raw: appends markdown syntax to the source
|
|
89
92
|
*/
|
|
90
|
-
export function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAfterActions, slotRight, }) {
|
|
91
|
-
const { activeView, setActiveView, markdownSource, setMarkdownSource, tiptapEditor, monacoEditor, mediaProvider, } = useEditorContext();
|
|
93
|
+
export function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAfterActions, slotRight, showPlayTab = true, }) {
|
|
94
|
+
const { activeView, setActiveView, markdownSource, setMarkdownSource, tiptapEditor, monacoEditor, mediaProvider, editorMode, } = useEditorContext();
|
|
95
|
+
const isCodeMode = editorMode === 'code';
|
|
96
|
+
// In code mode only the raw view is meaningful; the WYSIWYG and Preview
|
|
97
|
+
// surfaces aren't mounted, so hide their tabs.
|
|
98
|
+
const visibleViews = VIEWS.filter((v) => {
|
|
99
|
+
if (isCodeMode)
|
|
100
|
+
return v.id === 'raw';
|
|
101
|
+
if (v.id === 'preview' && !showPlayTab)
|
|
102
|
+
return false;
|
|
103
|
+
return true;
|
|
104
|
+
});
|
|
105
|
+
const showViewTabs = visibleViews.length > 1;
|
|
92
106
|
// Hidden file input for image picker
|
|
93
107
|
const imageInputRef = useRef(null);
|
|
94
108
|
// ── Narrow-screen detection ──────────────────────────
|
|
@@ -144,6 +158,31 @@ export function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAft
|
|
|
144
158
|
document.addEventListener('mousedown', handleClick);
|
|
145
159
|
return () => document.removeEventListener('mousedown', handleClick);
|
|
146
160
|
}, [showOverflow]);
|
|
161
|
+
// Open-up vs open-down: the overflow menu is anchored to its trigger with
|
|
162
|
+
// `top: 100%` by default. When the toolbar lives near the bottom of a
|
|
163
|
+
// small container (e.g. a chat composer), a downward menu gets clipped.
|
|
164
|
+
// Measure on open and flip the anchor to `bottom: 100%` if the space
|
|
165
|
+
// above the trigger is larger than the space below.
|
|
166
|
+
const [overflowPlacement, setOverflowPlacement] = useState('down');
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
if (!showOverflow || !overflowRef.current)
|
|
169
|
+
return;
|
|
170
|
+
const trigger = overflowRef.current.querySelector('.squisq-toolbar-overflow-trigger');
|
|
171
|
+
if (!trigger)
|
|
172
|
+
return;
|
|
173
|
+
const rect = trigger.getBoundingClientRect();
|
|
174
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
175
|
+
const spaceAbove = rect.top;
|
|
176
|
+
// Assume a typical menu height; exact measurement is unreliable on first
|
|
177
|
+
// open because the menu hasn't rendered yet when this runs.
|
|
178
|
+
const ESTIMATED_MENU_HEIGHT = 260;
|
|
179
|
+
if (spaceBelow < ESTIMATED_MENU_HEIGHT && spaceAbove > spaceBelow) {
|
|
180
|
+
setOverflowPlacement('up');
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
setOverflowPlacement('down');
|
|
184
|
+
}
|
|
185
|
+
}, [showOverflow]);
|
|
147
186
|
// Force re-render when Tiptap selection or formatting state changes
|
|
148
187
|
const [, forceUpdate] = useReducer((c) => c + 1, 0);
|
|
149
188
|
useEffect(() => {
|
|
@@ -404,7 +443,7 @@ export function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAft
|
|
|
404
443
|
handleRaw(id);
|
|
405
444
|
}
|
|
406
445
|
}, [activeView, tiptapEditor, handleTiptap, handleRaw]);
|
|
407
|
-
const groups = ['format', 'structure', 'insert'];
|
|
446
|
+
const groups = ['format', 'lists', 'structure', 'insert', 'media'];
|
|
408
447
|
const isWysiwyg = activeView === 'wysiwyg' && tiptapEditor;
|
|
409
448
|
const isPreview = activeView === 'preview';
|
|
410
449
|
// Detect whether cursor is inside a table (WYSIWYG mode only)
|
|
@@ -436,14 +475,14 @@ export function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAft
|
|
|
436
475
|
handleImageFile(file);
|
|
437
476
|
// Reset so the same file can be re-selected
|
|
438
477
|
e.target.value = '';
|
|
439
|
-
} }), slotLeft, _jsx("div", { className: "squisq-toolbar-view-tabs", role: "tablist", "aria-label": "Editor view", children:
|
|
478
|
+
} }), slotLeft, showViewTabs && (_jsx("div", { className: "squisq-toolbar-view-tabs", role: "tablist", "aria-label": "Editor view", children: visibleViews.map((view) => (_jsxs("button", { role: "tab", "data-view": view.id, "aria-selected": activeView === view.id, className: `squisq-toolbar-view-tab${activeView === view.id ? ' squisq-toolbar-view-tab--active' : ''}`, onClick: () => setActiveView(view.id), "data-tooltip": `${view.label} (${view.shortcut})`, children: [_jsx("span", { className: "squisq-toolbar-view-tab-label squisq-toolbar-view-tab-label--long", "data-label": view.label, children: view.label }), view.shortLabel && view.shortLabel !== view.label && (_jsx("span", { className: "squisq-toolbar-view-tab-label squisq-toolbar-view-tab-label--short", "data-label": view.shortLabel, children: view.shortLabel }))] }, view.id))) })), !isPreview && !isNarrow && !isCodeMode && (_jsxs("div", { className: "squisq-toolbar-actions", ref: actionsRef, children: [groups.map((group, gi) => (_jsxs("div", { className: "squisq-toolbar-group", children: [gi > 0 && _jsx("div", { className: "squisq-toolbar-separator" }), BUTTONS.filter((b) => b.group === group).map((btn) => {
|
|
440
479
|
const active = isWysiwyg ? isTiptapActive(tiptapEditor, btn.id) : false;
|
|
441
480
|
const disabled = btn.id === 'image' && !mediaProvider;
|
|
442
|
-
return (_jsx("button", { className: `squisq-toolbar-button${active ? ' squisq-toolbar-button--active' : ''}`,
|
|
443
|
-
})] }, group))), currentTemplate !== null && (_jsxs(_Fragment, { children: [_jsx("div", { className: "squisq-toolbar-separator" }), _jsx("div", { className: "squisq-toolbar-group squisq-template-picker", children: _jsxs("label", { className: "squisq-template-picker-label",
|
|
481
|
+
return (_jsx("button", { className: `squisq-toolbar-button${active ? ' squisq-toolbar-button--active' : ''}`, "data-tooltip": disabled ? 'Insert image (requires media provider)' : btn.title, onClick: () => handleAction(btn.id), "aria-label": btn.title, "aria-pressed": active, disabled: disabled, style: btn.iconStyle, children: btn.id === 'table' ? (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", children: [_jsx("rect", { x: "1", y: "1", width: "12", height: "12", rx: "1" }), _jsx("line", { x1: "1", y1: "5", x2: "13", y2: "5" }), _jsx("line", { x1: "1", y1: "9", x2: "13", y2: "9" }), _jsx("line", { x1: "5", y1: "1", x2: "5", y2: "13" }), _jsx("line", { x1: "9", y1: "1", x2: "9", y2: "13" })] })) : (btn.icon) }, btn.id));
|
|
482
|
+
})] }, group))), currentTemplate !== null && (_jsxs(_Fragment, { children: [_jsx("div", { className: "squisq-toolbar-separator" }), _jsx("div", { className: "squisq-toolbar-group squisq-template-picker", children: _jsxs("label", { className: "squisq-template-picker-label", "data-tooltip": "Block template for this heading", children: ["Template:", _jsxs("select", { className: "squisq-template-picker-select", value: currentTemplate, onChange: (e) => handleTemplatePick(e.target.value), children: [_jsx("option", { value: "", children: "\u2014 none \u2014" }), TEMPLATE_NAMES.map((name) => (_jsx("option", { value: name, children: name }, name)))] })] }) })] })), isInTable && (_jsxs(_Fragment, { children: [_jsx("div", { className: "squisq-toolbar-separator" }), _jsxs("div", { className: "squisq-toolbar-group squisq-table-controls", children: [_jsx("span", { className: "squisq-table-controls-label", children: "Table:" }), _jsx("button", { className: "squisq-toolbar-button", "data-tooltip": "Add column before", onClick: () => tiptapEditor.chain().focus().addColumnBefore().run(), "aria-label": "Add column before", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "7", y: "2", width: "8", height: "12", rx: "1" }), _jsx("line", { x1: "11", y1: "2", x2: "11", y2: "14" }), _jsx("line", { x1: "1", y1: "8", x2: "4.5", y2: "8" }), _jsx("line", { x1: "2.75", y1: "6.25", x2: "2.75", y2: "9.75" })] }) }), _jsx("button", { className: "squisq-toolbar-button", "data-tooltip": "Add column after", onClick: () => tiptapEditor.chain().focus().addColumnAfter().run(), "aria-label": "Add column after", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "1", y: "2", width: "8", height: "12", rx: "1" }), _jsx("line", { x1: "5", y1: "2", x2: "5", y2: "14" }), _jsx("line", { x1: "11.5", y1: "8", x2: "15", y2: "8" }), _jsx("line", { x1: "13.25", y1: "6.25", x2: "13.25", y2: "9.75" })] }) }), _jsx("button", { className: "squisq-toolbar-button", "data-tooltip": "Delete column", onClick: () => tiptapEditor.chain().focus().deleteColumn().run(), "aria-label": "Delete column", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "4", y: "1", width: "8", height: "14", rx: "1" }), _jsx("line", { x1: "6", y1: "5.5", x2: "10", y2: "10.5" }), _jsx("line", { x1: "10", y1: "5.5", x2: "6", y2: "10.5" })] }) }), _jsx("button", { className: "squisq-toolbar-button", "data-tooltip": "Add row above", onClick: () => tiptapEditor.chain().focus().addRowBefore().run(), "aria-label": "Add row above", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "2", y: "6", width: "12", height: "9", rx: "1" }), _jsx("line", { x1: "2", y1: "10.5", x2: "14", y2: "10.5" }), _jsx("line", { x1: "8", y1: "1", x2: "8", y2: "4.5" }), _jsx("line", { x1: "6.25", y1: "2.75", x2: "9.75", y2: "2.75" })] }) }), _jsx("button", { className: "squisq-toolbar-button", "data-tooltip": "Add row below", onClick: () => tiptapEditor.chain().focus().addRowAfter().run(), "aria-label": "Add row below", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "2", y: "1", width: "12", height: "9", rx: "1" }), _jsx("line", { x1: "2", y1: "5.5", x2: "14", y2: "5.5" }), _jsx("line", { x1: "8", y1: "11.5", x2: "8", y2: "15" }), _jsx("line", { x1: "6.25", y1: "13.25", x2: "9.75", y2: "13.25" })] }) }), _jsx("button", { className: "squisq-toolbar-button", "data-tooltip": "Delete row", onClick: () => tiptapEditor.chain().focus().deleteRow().run(), "aria-label": "Delete row", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "1", y: "4", width: "14", height: "8", rx: "1" }), _jsx("line", { x1: "5.5", y1: "6", x2: "10.5", y2: "10" }), _jsx("line", { x1: "10.5", y1: "6", x2: "5.5", y2: "10" })] }) }), _jsx("button", { className: "squisq-toolbar-button squisq-toolbar-button--danger", "data-tooltip": "Delete table", onClick: () => tiptapEditor.chain().focus().deleteTable().run(), "aria-label": "Delete table", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [_jsx("rect", { x: "1", y: "1", width: "14", height: "14", rx: "1" }), _jsx("line", { x1: "1", y1: "5.5", x2: "15", y2: "5.5" }), _jsx("line", { x1: "5.5", y1: "1", x2: "5.5", y2: "15" }), _jsx("line", { x1: "4.5", y1: "4.5", x2: "11.5", y2: "11.5", strokeWidth: "2" }), _jsx("line", { x1: "11.5", y1: "4.5", x2: "4.5", y2: "11.5", strokeWidth: "2" })] }) })] })] }))] })), !isPreview && !isCodeMode && overflowIndex !== null && (_jsxs("div", { className: "squisq-toolbar-overflow", ref: overflowRef, children: [_jsx("button", { className: `squisq-toolbar-button squisq-toolbar-overflow-trigger${showOverflow ? ' squisq-toolbar-button--active' : ''}`, "data-tooltip": "More actions", onClick: () => setShowOverflow((v) => !v), "aria-label": "More actions", "aria-expanded": showOverflow, children: "\u00B7\u00B7\u00B7" }), showOverflow && (_jsxs("div", { className: `squisq-toolbar-overflow-menu squisq-toolbar-overflow-menu--${overflowPlacement}`, children: [BUTTONS.slice(overflowIndex).map((btn) => {
|
|
444
483
|
const active = isWysiwyg ? isTiptapActive(tiptapEditor, btn.id) : false;
|
|
445
484
|
const disabled = btn.id === 'image' && !mediaProvider;
|
|
446
|
-
return (_jsxs("button", { className: `squisq-toolbar-overflow-item${active ? ' squisq-toolbar-overflow-item--active' : ''}`,
|
|
485
|
+
return (_jsxs("button", { className: `squisq-toolbar-overflow-item${active ? ' squisq-toolbar-overflow-item--active' : ''}`, onClick: () => {
|
|
447
486
|
handleAction(btn.id);
|
|
448
487
|
setShowOverflow(false);
|
|
449
488
|
}, disabled: disabled, children: [btn.id === 'table' ? (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", children: [_jsx("rect", { x: "1", y: "1", width: "12", height: "12", rx: "1" }), _jsx("line", { x1: "1", y1: "5", x2: "13", y2: "5" }), _jsx("line", { x1: "1", y1: "9", x2: "13", y2: "9" }), _jsx("line", { x1: "5", y1: "1", x2: "5", y2: "13" }), _jsx("line", { x1: "9", y1: "1", x2: "9", y2: "13" })] })) : (_jsx("span", { className: "squisq-toolbar-overflow-icon", style: btn.iconStyle, children: btn.icon })), _jsx("span", { children: btn.title })] }, btn.id));
|
|
@@ -482,6 +521,6 @@ export function Toolbar({ className, showFiles, onToggleFiles, slotLeft, slotAft
|
|
|
482
521
|
].map((item) => (_jsx("button", { className: `squisq-toolbar-overflow-item${item.label.startsWith('Delete') ? ' squisq-toolbar-overflow-item--danger' : ''}`, onClick: () => {
|
|
483
522
|
item.action();
|
|
484
523
|
setShowOverflow(false);
|
|
485
|
-
}, children: _jsx("span", { children: item.label }) }, item.label)))] }))] }))] })), slotAfterActions, _jsx("div", { style: { flex: 1 } }), onToggleFiles && (_jsx("button", { className: `squisq-toolbar-button squisq-toolbar-files-toggle${showFiles ? ' squisq-toolbar-button--active' : ''}`, onClick: onToggleFiles,
|
|
524
|
+
}, children: _jsx("span", { children: item.label }) }, item.label)))] }))] }))] })), slotAfterActions, (isPreview || isNarrow || isCodeMode) && _jsx("div", { style: { flex: 1 } }), onToggleFiles && (_jsx("button", { className: `squisq-toolbar-button squisq-toolbar-files-toggle${showFiles ? ' squisq-toolbar-button--active' : ''}`, onClick: onToggleFiles, "data-tooltip": showFiles ? 'Hide Files panel' : 'Show Files panel', "aria-pressed": showFiles, "aria-label": "Toggle Files panel", children: '\u{1F4CE}' })), slotRight] }));
|
|
486
525
|
}
|
|
487
526
|
//# sourceMappingURL=Toolbar.js.map
|