@bendyline/squisq-editor-react 2.10.2 → 2.10.3

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.
@@ -125,7 +125,7 @@ function resolveFileKind(fileName, language) {
125
125
  import { parseMarkdown } from "@bendyline/squisq/markdown";
126
126
 
127
127
  // src/frontmatter.ts
128
- var FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
128
+ var FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?(?:[ \t]*\r?\n)*/;
129
129
  function stripFrontmatter(md) {
130
130
  const m = md.match(FRONTMATTER_RE);
131
131
  if (!m) return { body: md, frontmatter: "" };
@@ -383,6 +383,8 @@ function EditorProvider({
383
383
  mentionProvider = null,
384
384
  proofing = null,
385
385
  proofingDefaultEnabled = true,
386
+ proofingSpellingEnabled = true,
387
+ proofingGrammarEnabled = true,
386
388
  proofingIgnoreStore = null,
387
389
  documentLinkProvider = null,
388
390
  fenceRenderers = null,
@@ -876,6 +878,8 @@ function EditorProvider({
876
878
  mentionProvider,
877
879
  proofing,
878
880
  proofingDefaultEnabled,
881
+ proofingSpellingEnabled,
882
+ proofingGrammarEnabled,
879
883
  proofingIgnoreStore,
880
884
  articleId,
881
885
  documentLinkProvider,
@@ -944,6 +948,8 @@ function EditorProvider({
944
948
  mentionProvider,
945
949
  proofing,
946
950
  proofingDefaultEnabled,
951
+ proofingSpellingEnabled,
952
+ proofingGrammarEnabled,
947
953
  proofingIgnoreStore,
948
954
  articleId,
949
955
  documentLinkProvider,
@@ -5415,10 +5421,15 @@ var LINT_DEBOUNCE_MS = 450;
5415
5421
  var HOVER_DELAY_MS = 300;
5416
5422
  var HOVER_CLOSE_DELAY_MS = 260;
5417
5423
  var engineIgnoreOwner = /* @__PURE__ */ new WeakMap();
5424
+ function categoryEnabled(finding, filter) {
5425
+ return finding.category === "spelling" ? filter.spelling : filter.grammar;
5426
+ }
5418
5427
  function useProofing() {
5419
5428
  const {
5420
5429
  proofing,
5421
5430
  proofingDefaultEnabled,
5431
+ proofingSpellingEnabled,
5432
+ proofingGrammarEnabled,
5422
5433
  proofingIgnoreStore,
5423
5434
  articleId,
5424
5435
  fileName,
@@ -5458,13 +5469,19 @@ function useProofing() {
5458
5469
  const hoveredFindingRef = useRef8(null);
5459
5470
  const hoverHeldRef = useRef8(false);
5460
5471
  const settings = useMemo9(() => readProofingSettings(markdownDoc?.frontmatter), [markdownDoc]);
5461
- const enabled = proofing != null && editorMode === "markdown" && (sessionEnabled ?? settings.enabled ?? proofingDefaultEnabled);
5472
+ const anyCategoryEnabled = proofingSpellingEnabled || proofingGrammarEnabled;
5473
+ const enabled = proofing != null && editorMode === "markdown" && anyCategoryEnabled && (sessionEnabled ?? settings.enabled ?? proofingDefaultEnabled);
5462
5474
  const frontmatterEnabled = settings.enabled;
5463
5475
  useEffect9(() => {
5464
5476
  setSessionEnabled(null);
5465
5477
  }, [frontmatterEnabled]);
5466
5478
  const enabledRef = useRef8(enabled);
5467
5479
  enabledRef.current = enabled;
5480
+ const categoriesRef = useRef8({
5481
+ spelling: proofingSpellingEnabled,
5482
+ grammar: proofingGrammarEnabled
5483
+ });
5484
+ categoriesRef.current = { spelling: proofingSpellingEnabled, grammar: proofingGrammarEnabled };
5468
5485
  const activeViewRef = useRef8(activeView);
5469
5486
  activeViewRef.current = activeView;
5470
5487
  const tiptapRef = useRef8(tiptapEditor);
@@ -5552,6 +5569,7 @@ function useProofing() {
5552
5569
  const decorated = [];
5553
5570
  const kept = [];
5554
5571
  for (const finding of results) {
5572
+ if (!categoryEnabled(finding, categoriesRef.current)) continue;
5555
5573
  const segment = mapJoinedSpanToSegment(joined, finding.start, finding.end);
5556
5574
  if (!segment) continue;
5557
5575
  const blanked = blankedRuns[segment.segmentIndex].blanked;
@@ -5586,7 +5604,7 @@ function useProofing() {
5586
5604
  return;
5587
5605
  }
5588
5606
  const kept = results.filter(
5589
- (finding) => !blanked.some((r) => finding.start < r.end && finding.end > r.start)
5607
+ (finding) => categoryEnabled(finding, categoriesRef.current) && !blanked.some((r) => finding.start < r.end && finding.end > r.start)
5590
5608
  );
5591
5609
  if (!collectionRef.current) {
5592
5610
  collectionRef.current = editor.createDecorationsCollection([]);
@@ -5647,6 +5665,16 @@ function useProofing() {
5647
5665
  useEffect9(() => {
5648
5666
  if (status === "ready" && enabled) schedule("immediate");
5649
5667
  }, [status, enabled, schedule]);
5668
+ const categoryKey = `${proofingSpellingEnabled}:${proofingGrammarEnabled}`;
5669
+ const prevCategoryKeyRef = useRef8(categoryKey);
5670
+ useEffect9(() => {
5671
+ if (prevCategoryKeyRef.current === categoryKey) return;
5672
+ prevCategoryKeyRef.current = categoryKey;
5673
+ clearDecorations();
5674
+ setFindings([]);
5675
+ setActiveFindingId(null);
5676
+ if (status === "ready" && enabled) schedule("immediate");
5677
+ }, [categoryKey, status, enabled, schedule, clearDecorations]);
5650
5678
  const prevViewRef = useRef8(activeView);
5651
5679
  useEffect9(() => {
5652
5680
  if (status !== "ready" || !enabled) return;
@@ -6109,7 +6137,7 @@ function useProofing() {
6109
6137
  const capabilityInstance = providerRef.current ?? (typeof proofing === "function" ? null : proofing);
6110
6138
  const canAddToAppDictionary = capabilityInstance?.hasAppDictionary !== false;
6111
6139
  return useMemo9(() => {
6112
- if (!proofing) return null;
6140
+ if (!proofing || !anyCategoryEnabled) return null;
6113
6141
  return {
6114
6142
  status,
6115
6143
  errorMessage,
@@ -6139,6 +6167,7 @@ function useProofing() {
6139
6167
  };
6140
6168
  }, [
6141
6169
  proofing,
6170
+ anyCategoryEnabled,
6142
6171
  status,
6143
6172
  errorMessage,
6144
6173
  enabled,
@@ -31172,6 +31201,15 @@ function safeFontFamily(value) {
31172
31201
  return trimmed;
31173
31202
  }
31174
31203
 
31204
+ // src/accessoryFileLinks.ts
31205
+ var ACCESSORY_FILE_LINK_CLASS = "squisq-attachment-link";
31206
+ function syncAccessoryFileLinkPlaceholders(root, accessoryPaths) {
31207
+ for (const link of root.querySelectorAll("a[href]")) {
31208
+ const href = link.getAttribute("href") ?? "";
31209
+ link.classList.toggle(ACCESSORY_FILE_LINK_CLASS, accessoryPaths.has(href));
31210
+ }
31211
+ }
31212
+
31175
31213
  // src/WysiwygEditor.tsx
31176
31214
  import { useEditor as useEditor3 } from "@tiptap/react";
31177
31215
  import { jsx as jsx61, jsxs as jsxs48 } from "react/jsx-runtime";
@@ -31219,6 +31257,7 @@ function WysiwygEditor({
31219
31257
  themeInheritance,
31220
31258
  colorScheme,
31221
31259
  bumpMediaRevision,
31260
+ mediaRevision,
31222
31261
  sceneTextChannel,
31223
31262
  preserveSourceWrapping,
31224
31263
  layoutMode
@@ -31272,6 +31311,25 @@ function WysiwygEditor({
31272
31311
  useEffect46(() => {
31273
31312
  mediaProviderRef.current = mediaProvider;
31274
31313
  }, [mediaProvider]);
31314
+ const [accessoryPaths, setAccessoryPaths] = useState57(() => /* @__PURE__ */ new Set());
31315
+ useEffect46(() => {
31316
+ if (!mediaProvider) {
31317
+ setAccessoryPaths(/* @__PURE__ */ new Set());
31318
+ return;
31319
+ }
31320
+ let cancelled = false;
31321
+ mediaProvider.listMedia().then(
31322
+ (entries) => {
31323
+ if (!cancelled) setAccessoryPaths(new Set(entries.map((entry) => entry.name)));
31324
+ },
31325
+ () => {
31326
+ if (!cancelled) setAccessoryPaths(/* @__PURE__ */ new Set());
31327
+ }
31328
+ );
31329
+ return () => {
31330
+ cancelled = true;
31331
+ };
31332
+ }, [mediaProvider, mediaRevision]);
31275
31333
  const frontmatterRef = useRef44(stripFrontmatter(editorSource).frontmatter);
31276
31334
  const wrapStateRef = useRef44(null);
31277
31335
  const initialDisplayBodyRef = useRef44(void 0);
@@ -31483,6 +31541,17 @@ function WysiwygEditor({
31483
31541
  }
31484
31542
  return () => setTiptapEditor(null);
31485
31543
  }, [editor, setTiptapEditor]);
31544
+ useEffect46(() => {
31545
+ if (!editor) return;
31546
+ const syncPlaceholders = () => {
31547
+ syncAccessoryFileLinkPlaceholders(editor.view.dom, accessoryPaths);
31548
+ };
31549
+ syncPlaceholders();
31550
+ editor.on("update", syncPlaceholders);
31551
+ return () => {
31552
+ editor.off("update", syncPlaceholders);
31553
+ };
31554
+ }, [accessoryPaths, editor]);
31486
31555
  useEffect46(() => {
31487
31556
  if (editor) editor.setEditable(!readOnly);
31488
31557
  }, [editor, readOnly]);
@@ -38297,6 +38366,7 @@ function EditorShell({
38297
38366
  versioningAutoSaveIdleMs,
38298
38367
  onSaveVersion,
38299
38368
  showFilesToggle,
38369
+ showFilesWhenNotEmpty = false,
38300
38370
  showFormattingControls = hostMode !== "chat",
38301
38371
  showInsertControls = true,
38302
38372
  allowBinaryDownloads = true,
@@ -38325,6 +38395,8 @@ function EditorShell({
38325
38395
  mentionProvider,
38326
38396
  proofing = null,
38327
38397
  proofingDefaultEnabled = true,
38398
+ proofingSpellingEnabled = true,
38399
+ proofingGrammarEnabled = true,
38328
38400
  proofingIgnoreStore = null,
38329
38401
  documentLinkProvider,
38330
38402
  fenceRenderers,
@@ -38376,6 +38448,8 @@ function EditorShell({
38376
38448
  mentionProvider,
38377
38449
  proofing,
38378
38450
  proofingDefaultEnabled,
38451
+ proofingSpellingEnabled,
38452
+ proofingGrammarEnabled,
38379
38453
  proofingIgnoreStore,
38380
38454
  documentLinkProvider,
38381
38455
  fenceRenderers,
@@ -38414,6 +38488,7 @@ function EditorShell({
38414
38488
  mediaProvider: effectiveMediaProvider ?? null,
38415
38489
  workspaceContainer: effectiveContainer,
38416
38490
  filesToggleEnabled,
38491
+ showFilesWhenNotEmpty,
38417
38492
  showFormattingControls,
38418
38493
  showInsertControls,
38419
38494
  allowBinaryDownloads,
@@ -38488,6 +38563,7 @@ function EditorShellInner({
38488
38563
  mediaProvider,
38489
38564
  workspaceContainer,
38490
38565
  filesToggleEnabled,
38566
+ showFilesWhenNotEmpty,
38491
38567
  showFormattingControls,
38492
38568
  showInsertControls,
38493
38569
  allowBinaryDownloads,
@@ -38636,6 +38712,9 @@ function EditorShellInner({
38636
38712
  cancelled = true;
38637
38713
  };
38638
38714
  }, [mediaProvider, mediaListRefreshKey]);
38715
+ useEffect62(() => {
38716
+ if (showFilesWhenNotEmpty && mediaCount > 0) setShowFiles(true);
38717
+ }, [mediaCount, showFilesWhenNotEmpty]);
38639
38718
  const handleToggleFiles = useCallback53(() => {
38640
38719
  setShowFiles((prev) => !prev);
38641
38720
  }, []);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-vNr6KOF9.js';
2
- export { B as BlockTagVisibility, a as CodeContextSection, b as CoverImageSaveOutput, D as DashboardImageSaveOutput, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextMenuContext, h as EditorContextMenuItem, i as EditorContextMenuItemVisibility, j as EditorContextMenuProvider, k as EditorContextMenuProviderProps, l as EditorContextValue, m as EditorMode, n as EditorProvider, o as EditorProviderProps, p as EditorShell, q as EditorShellProps, r as EditorState, s as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, t as MentionProvider, P as PreviewPanel, u as PreviewPanelProps, R as RawEditor, v as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, w as WysiwygEditor, x as WysiwygEditorProps, y as useEditorContext, z as useEditorContextMenuItems } from './shell-vNr6KOF9.js';
1
+ import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-DSHMZvnK.js';
2
+ export { B as BlockTagVisibility, a as CodeContextSection, b as CoverImageSaveOutput, D as DashboardImageSaveOutput, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextMenuContext, h as EditorContextMenuItem, i as EditorContextMenuItemVisibility, j as EditorContextMenuProvider, k as EditorContextMenuProviderProps, l as EditorContextValue, m as EditorMode, n as EditorProvider, o as EditorProviderProps, p as EditorShell, q as EditorShellProps, r as EditorState, s as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, t as MentionProvider, P as PreviewPanel, u as PreviewPanelProps, R as RawEditor, v as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, w as WysiwygEditor, x as WysiwygEditorProps, y as useEditorContext, z as useEditorContextMenuItems } from './shell-DSHMZvnK.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, CSSProperties } from 'react';
package/dist/index.js CHANGED
@@ -212,7 +212,7 @@ import {
212
212
  usePreviewSettings,
213
213
  useTimelineData,
214
214
  useTreeViewData
215
- } from "./chunk-HFNE3K7X.js";
215
+ } from "./chunk-X3UQBUVO.js";
216
216
  import "./chunk-V4NBQF5C.js";
217
217
  import {
218
218
  JsonEditor
@@ -1,4 +1,4 @@
1
- export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextMenuContext, h as EditorContextMenuItem, i as EditorContextMenuItemVisibility, j as EditorContextMenuProvider, k as EditorContextMenuProviderProps, l as EditorContextValue, E as EditorHostMode, m as EditorMode, n as EditorProvider, o as EditorProviderProps, p as EditorShell, q as EditorShellProps, r as EditorState, s as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, t as MentionProvider, P as PreviewPanel, u as PreviewPanelProps, R as RawEditor, v as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, w as WysiwygEditor, x as WysiwygEditorProps, y as useEditorContext, z as useEditorContextMenuItems } from '../shell-vNr6KOF9.js';
1
+ export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextMenuContext, h as EditorContextMenuItem, i as EditorContextMenuItemVisibility, j as EditorContextMenuProvider, k as EditorContextMenuProviderProps, l as EditorContextValue, E as EditorHostMode, m as EditorMode, n as EditorProvider, o as EditorProviderProps, p as EditorShell, q as EditorShellProps, r as EditorState, s as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, t as MentionProvider, P as PreviewPanel, u as PreviewPanelProps, R as RawEditor, v as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, w as WysiwygEditor, x as WysiwygEditorProps, y as useEditorContext, z as useEditorContextMenuItems } from '../shell-DSHMZvnK.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@bendyline/squisq/schemas';
@@ -7,7 +7,7 @@ import {
7
7
  WysiwygEditor,
8
8
  useEditorContext,
9
9
  useEditorContextMenuItems
10
- } from "../chunk-HFNE3K7X.js";
10
+ } from "../chunk-X3UQBUVO.js";
11
11
  import "../chunk-V4NBQF5C.js";
12
12
  import "../chunk-TCLNRATG.js";
13
13
  import "../chunk-V44VP242.js";
@@ -378,6 +378,10 @@ interface EditorContextValue extends EditorState, EditorActions {
378
378
  * override it.
379
379
  */
380
380
  proofingDefaultEnabled: boolean;
381
+ /** Whether spelling findings are surfaced (host preference). */
382
+ proofingSpellingEnabled: boolean;
383
+ /** Whether grammar/style findings are surfaced (host preference). */
384
+ proofingGrammarEnabled: boolean;
381
385
  /**
382
386
  * Host-owned, per-document storage for dismissed findings. Ignores
383
387
  * are never written into the document; without a store they last only
@@ -484,6 +488,10 @@ interface EditorProviderProps {
484
488
  proofing?: ProofingCapability | null;
485
489
  /** Host default enable state for proofing (default true). */
486
490
  proofingDefaultEnabled?: boolean;
491
+ /** Whether spelling findings are surfaced (default true). */
492
+ proofingSpellingEnabled?: boolean;
493
+ /** Whether grammar/style findings are surfaced (default true). */
494
+ proofingGrammarEnabled?: boolean;
487
495
  /** Host-owned per-document storage for dismissed proofing findings. */
488
496
  proofingIgnoreStore?: ProofingIgnoreStore | null;
489
497
  /**
@@ -618,7 +626,7 @@ interface ViewPreferences {
618
626
  /** Document vs. block-at-a-time layout. */
619
627
  layoutMode?: LayoutMode;
620
628
  }
621
- declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
629
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
622
630
 
623
631
  /**
624
632
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -839,6 +847,12 @@ interface EditorShellProps {
839
847
  onSaveVersion?: (result: SaveVersionResult) => void;
840
848
  /** Show the Files toggle in the toolbar. Defaults to true when mediaProvider is passed. */
841
849
  showFilesToggle?: boolean;
850
+ /**
851
+ * Open the Files panel when its accessory bin becomes non-empty. The user
852
+ * can still close it normally; it opens again only when the visible count
853
+ * changes. Defaults to false.
854
+ */
855
+ showFilesWhenNotEmpty?: boolean;
842
856
  /**
843
857
  * Show the toolbar's built-in text, block, and contextual formatting
844
858
  * controls. The toolbar, Insert menu, and host-provided slots remain
@@ -1006,6 +1020,18 @@ interface EditorShellProps {
1006
1020
  * and the user's session toggle in the View menu override this.
1007
1021
  */
1008
1022
  proofingDefaultEnabled?: boolean;
1023
+ /**
1024
+ * Whether spelling findings (red squiggles) are shown (default `true`).
1025
+ * A host-level preference, deliberately independent of the enable
1026
+ * layers above: turning both this and `proofingGrammarEnabled` off is
1027
+ * equivalent to turning proofing off, and loads no engine.
1028
+ */
1029
+ proofingSpellingEnabled?: boolean;
1030
+ /**
1031
+ * Whether grammar and style findings (green/blue squiggles) are shown
1032
+ * (default `true`). See {@link EditorShellProps.proofingSpellingEnabled}.
1033
+ */
1034
+ proofingGrammarEnabled?: boolean;
1009
1035
  /**
1010
1036
  * Host-owned storage for findings the user dismissed with "Ignore",
1011
1037
  * scoped per document (`load`/`save` receive a
@@ -1193,7 +1219,7 @@ interface EditorShellProps {
1193
1219
  * Complete markdown editor shell with toolbar, view switcher, and three
1194
1220
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1195
1221
  */
1196
- declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1222
+ declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1197
1223
 
1198
1224
  /**
1199
1225
  * Shared editor context menu.
@@ -9744,6 +9744,29 @@
9744
9744
  text-decoration-thickness: 1px;
9745
9745
  text-underline-offset: 2px;
9746
9746
  }
9747
+ .squisq-wysiwyg-editor a.squisq-attachment-link {
9748
+ display: inline-flex;
9749
+ align-items: center;
9750
+ gap: 0.35em;
9751
+ max-width: 100%;
9752
+ border: 1px solid var(--squisq-border);
9753
+ border-radius: 999px;
9754
+ padding: 0.1em 0.5em;
9755
+ color: var(--squisq-text);
9756
+ background: var(--squisq-surface-sunken);
9757
+ font-size: 0.86em;
9758
+ line-height: 1.35;
9759
+ text-decoration: none;
9760
+ vertical-align: middle;
9761
+ cursor: text;
9762
+ }
9763
+ .squisq-wysiwyg-editor a.squisq-attachment-link::before {
9764
+ content: "\f0c6";
9765
+ flex: 0 0 auto;
9766
+ color: var(--squisq-text-muted);
9767
+ font-family: var(--fa-family-classic, "Font Awesome 7 Free");
9768
+ font-weight: 900;
9769
+ }
9747
9770
  .squisq-editor-shell[data-link-handler=true] a[href] {
9748
9771
  cursor: pointer;
9749
9772
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "2.10.2",
3
+ "version": "2.10.3",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -96,8 +96,8 @@
96
96
  "dependencies": {
97
97
  "@bendyline/squisq": "2.10.0",
98
98
  "@bendyline/squisq-formats": "2.5.1",
99
- "@bendyline/squisq-react": "2.10.0",
100
- "@bendyline/squisq-video-react": "2.4.2",
99
+ "@bendyline/squisq-react": "2.10.1",
100
+ "@bendyline/squisq-video-react": "2.4.3",
101
101
  "@fortawesome/fontawesome-free": "7.2.0",
102
102
  "@tiptap/core": "2.27.2",
103
103
  "@tiptap/extension-heading": "2.27.2",