@bendyline/squisq-editor-react 2.12.8 → 2.12.10

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.
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  MarkdownEscape
3
- } from "./chunk-LRUBYTKW.js";
3
+ } from "./chunk-MJNLKPGH.js";
4
4
  import {
5
5
  markdownToTiptap,
6
6
  tiptapToMarkdown
7
- } from "./chunk-MHG4KPMA.js";
7
+ } from "./chunk-LTT6QQHJ.js";
8
8
 
9
9
  // src/jsonEditor/JsonEditorContext.tsx
10
10
  import { createContext, useContext, useEffect, useMemo } from "react";
@@ -1,6 +1,7 @@
1
1
  // src/tiptapBridge.ts
2
2
  import { resolveIcon } from "@bendyline/squisq/icons";
3
3
  import {
4
+ parseWikiLink,
4
5
  matchTrailingTemplateAnnotation,
5
6
  matchTrailingPandocAttr,
6
7
  tokenizeAttrTokens,
@@ -962,7 +963,21 @@ function parseTableCells(line) {
962
963
  let inner = line.trim();
963
964
  if (inner.startsWith("|")) inner = inner.slice(1);
964
965
  if (inner.endsWith("|")) inner = inner.slice(0, -1);
965
- return inner.split("|").map((cell) => cell.trim());
966
+ const cells = [];
967
+ let cell = "";
968
+ let slashes = 0;
969
+ for (const char of inner) {
970
+ if (char === "|") {
971
+ if (slashes % 2) cell = cell.slice(0, -1) + "|";
972
+ else {
973
+ cells.push(cell.trim());
974
+ cell = "";
975
+ }
976
+ } else cell += char;
977
+ slashes = char === "\\" ? slashes + 1 : 0;
978
+ }
979
+ cells.push(cell.trim());
980
+ return cells;
966
981
  }
967
982
  function parseAlignments(separatorLine) {
968
983
  return parseTableCells(separatorLine).map((cell) => {
@@ -1049,8 +1064,16 @@ function inlineToHtml(text) {
1049
1064
  return token;
1050
1065
  };
1051
1066
  let staged = text.replace(
1052
- RE_INLINE_CODE,
1053
- (_m, code) => stash(`<code>${escapeHtml(code)}</code>`)
1067
+ /`(.+?)`|\[\[([^\u005b\]\n]+)\]\]/g,
1068
+ (full, code, value, offset) => {
1069
+ if (code !== void 0) return stash(`<code>${escapeHtml(code)}</code>`);
1070
+ const wiki = parseWikiLink((value ?? "").replace(/\\\|/g, "|"));
1071
+ if (isEscapedMarkdownCharacter(text, offset) || !wiki) return full;
1072
+ const labelAttr = wiki.label !== void 0 ? ` data-wiki-label="${escapeHtml(wiki.label)}"` : "";
1073
+ return stash(
1074
+ `<span data-wiki-link="${escapeHtml(wiki.target)}"${labelAttr}>${escapeHtml(wiki.label ?? wiki.target)}</span>`
1075
+ );
1076
+ }
1054
1077
  );
1055
1078
  staged = staged.replace(RE_VERT_ALIGN_TAG, (_m, tag, inner) => {
1056
1079
  const name = tag.toLowerCase();
@@ -1277,6 +1300,19 @@ var RawHtmlVault = class {
1277
1300
  function htmlToInline(html) {
1278
1301
  let result = html;
1279
1302
  const vault = new RawHtmlVault();
1303
+ result = result.replace(
1304
+ /<span\b((?:[^>"']|"[^"]*"|'[^']*')*)>[^<]*<\/span>/gi,
1305
+ (full, attrs) => {
1306
+ const values = new Map(
1307
+ [...attrs.matchAll(/([-\w]+)="([^"]*)"/g)].map((match) => [match[1], match[2]])
1308
+ );
1309
+ const target = values.get("data-wiki-link");
1310
+ if (target === void 0) return full;
1311
+ const label = values.get("data-wiki-label");
1312
+ const value = target + (label !== void 0 ? `|${label}` : "");
1313
+ return parseWikiLink(unescapeHtml(value)) ? vault.protect(`[[${value}]]`) : full;
1314
+ }
1315
+ );
1280
1316
  result = result.replace(
1281
1317
  RE_ESCAPE_SPAN,
1282
1318
  (_span, inner) => inner.replace(
@@ -1329,7 +1365,7 @@ function htmlToTableCell(html) {
1329
1365
  return `<div data-squisq-table-cell="">${safe.replace(/\|/g, "&#124;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;")}</div>`;
1330
1366
  }
1331
1367
  const withParagraphBreaks = html.replace(/<\/p>\s*<p(?:\s[^>]*)?>/gi, "<br>").replace(/^\s*<p(?:\s[^>]*)?>/i, "").replace(/<\/p>\s*$/i, "");
1332
- return htmlToInline(withParagraphBreaks).replace(/ {2}\n/g, "<br>");
1368
+ return htmlToInline(withParagraphBreaks).replace(/ {2}\n/g, "<br>").replace(/\\*\|/g, (match) => (match.length - 1) % 2 ? match : `${match.slice(0, -1)}\\|`);
1333
1369
  }
1334
1370
  function preserveLeadingSpaces(html) {
1335
1371
  return html.replace(/^ +/, (spaces) => "&nbsp;".repeat(spaces.length));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MARKDOWN_ESCAPE_ATTR
3
- } from "./chunk-MHG4KPMA.js";
3
+ } from "./chunk-LTT6QQHJ.js";
4
4
 
5
5
  // src/MarkdownEscape.ts
6
6
  import { Mark, mergeAttributes } from "@tiptap/core";
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel, a as CalcEngineFactory, b as EditorView$1, c as CsvSourceMeta, X as XlsxSourceMeta, F as FormulaEditRecord } from './shell-DXhttvsO.js';
2
- export { A as ApplySourceEditsOptions, B as BlockInsertionBuilder, d as BlockInsertionContext, e as BlockPlacement, f as BlockRange, g as BlockSlice, h as BlockTagVisibility, i as CodeContextSection, j as CoverImageSaveOutput, D as DashboardImageSaveOutput, k as DocumentLinkCandidate, l as DocumentLinkProvider, m as EditorActions, n as EditorColorScheme, o as EditorContextMenuContext, p as EditorContextMenuItem, q as EditorContextMenuItemVisibility, r as EditorContextMenuProvider, s as EditorContextMenuProviderProps, t as EditorContextValue, u as EditorInsertMenuItem, v as EditorMode, w as EditorProvider, x as EditorProviderProps, y as EditorSelectionInfo, z as EditorShell, G as EditorShellProps, H as EditorState, I as FindOptions, J as FindRequest, K as FormulaSessionOptions, L as ImageDisplayMode, M as IngestedSidecar, N as InsertBlockOptions, O as LayoutMode, P as MentionCandidate, Q as MentionProvider, R as OutlineBlock, T as OutlineInsertion, U as PreviewPanel, V as PreviewPanelProps, W as RawEditor, Y as RawEditorProps, Z as ThemeInheritance, _ as ViewPreferences, $ as WriteCanvasSettings, a0 as WysiwygEditor, a1 as WysiwygEditorProps, a2 as XLSX_LOCKED_REASON, a3 as XlsxFormulaSession, a4 as applySourceEditsToText, a5 as blockInsertionPoint, a6 as createXlsxFormulaSession, a7 as getBlockSlices, a8 as headingDepthForInsertion, a9 as ingestSidecarBytes, aa as joinBlockAt, ab as lineToOffset, ac as minimalReplaceEdit, ad as normalizeSourceEdits, ae as offsetToLine, af as resolveOutlineInsertion, ag as sliceIndexAtOffset, ah as sourceOutline, ai as spliceBlock, aj as useEditorContext, ak as useEditorContextMenuItems, al as useEditorInsertMenuItems } from './shell-DXhttvsO.js';
1
+ import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel, a as CalcEngineFactory, b as EditorView$1, c as CsvSourceMeta, X as XlsxSourceMeta, F as FormulaEditRecord } from './shell-D0XgDAZj.js';
2
+ export { A as ApplySourceEditsOptions, B as BlockInsertionBuilder, d as BlockInsertionContext, e as BlockPlacement, f as BlockRange, g as BlockSlice, h as BlockTagVisibility, i as CodeContextSection, j as CoverImageSaveOutput, D as DashboardImageSaveOutput, k as DocumentLinkCandidate, l as DocumentLinkProvider, m as EditorActions, n as EditorColorScheme, o as EditorContextMenuContext, p as EditorContextMenuItem, q as EditorContextMenuItemVisibility, r as EditorContextMenuProvider, s as EditorContextMenuProviderProps, t as EditorContextValue, u as EditorInsertMenuItem, v as EditorMode, w as EditorProvider, x as EditorProviderProps, y as EditorSelectionInfo, z as EditorShell, G as EditorShellProps, H as EditorState, I as FindOptions, J as FindRequest, K as FormulaSessionOptions, L as ImageDisplayMode, M as IngestedSidecar, N as InsertBlockOptions, O as LayoutMode, P as MentionCandidate, Q as MentionProvider, R as OutlineBlock, T as OutlineInsertion, U as PreviewPanel, V as PreviewPanelProps, W as RawEditor, Y as RawEditorProps, Z as ThemeInheritance, _ as ViewPreferences, $ as WriteCanvasSettings, a0 as WysiwygEditor, a1 as WysiwygEditorProps, a2 as XLSX_LOCKED_REASON, a3 as XlsxFormulaSession, a4 as applySourceEditsToText, a5 as blockInsertionPoint, a6 as createXlsxFormulaSession, a7 as getBlockSlices, a8 as headingDepthForInsertion, a9 as ingestSidecarBytes, aa as joinBlockAt, ab as lineToOffset, ac as minimalReplaceEdit, ad as normalizeSourceEdits, ae as offsetToLine, af as resolveOutlineInsertion, ag as sliceIndexAtOffset, ah as sourceOutline, ai as spliceBlock, aj as useEditorContext, ak as useEditorContextMenuItems, al as useEditorInsertMenuItems } from './shell-D0XgDAZj.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, CSSProperties, ReactElement } from 'react';
5
5
  import { Doc, ScheduledClip, VideoPlacement, VideoPipSize, VideoPipShape, VideoPipPosition, MediaEdits, MediaProvider, Theme, CustomTemplateDefinition, ThemeSeedColors, ViewportPreset, ViewportConfig, Block, MediaEntry, DiagramEdgeAnchor } from '@bendyline/squisq/schemas';
6
6
  import { ContentContainer } from '@bendyline/squisq/storage';
7
7
  export { CanvasRect, ImageEditor, ImageEditorAction, ImageEditorProps, ImageEditorState, ImageEditorTool, ImageViewer, ImageViewerProps, UseImageEditorOptions, UseImageEditorReturn, imageEditorReducer, initialImageEditorState, useImageEditor } from './image-editor/index.js';
8
+ import { WikiLinkSupport, MarkdownWrapState, SvgIslandDiagnostic, BlockVideoEmbed, VideoEmbed } from '@bendyline/squisq/markdown';
9
+ export { MarkdownSourceEdit } from '@bendyline/squisq/markdown';
8
10
  import { CodeBlockCopyHandler, DisplayMode, CaptionStyle, VideoPresentation, PipSize, PipShape, PipPosition } from '@bendyline/squisq-react';
9
11
  import { IconFamily } from '@bendyline/squisq/icons';
10
12
  import { CoverSlideTemplate, CoverSlidePlayback, DashboardStyleId, DashboardLayoutSummary, ConnectorRouting, AsciiDiagram, Tree, AsciiTimeline, AsciiTimelineSide, AsciiTimelineMarker } from '@bendyline/squisq/doc';
11
13
  export { BuildPreviewDocOptions, buildPreviewDoc, documentTitleFromFileName } from '@bendyline/squisq/doc';
12
- import { MarkdownWrapState, SvgIslandDiagnostic, BlockVideoEmbed, VideoEmbed } from '@bendyline/squisq/markdown';
13
- export { MarkdownSourceEdit } from '@bendyline/squisq/markdown';
14
14
  import * as monaco_editor from 'monaco-editor';
15
15
  import { editor } from 'monaco-editor';
16
16
  import { M as MonacoLanguageRequest, a as MonacoLanguageLoadOptions } from './monacoLanguageDetection-DEyUW-BS.js';
@@ -415,6 +415,8 @@ declare function resolveFileKind(fileName?: string, language?: string): FileKind
415
415
  interface PlainHtmlPreviewProps {
416
416
  /** Raw markdown source. */
417
417
  markdown: string;
418
+ /** Optional article resolver for a connected document workspace. */
419
+ wikiLinks?: WikiLinkSupport | null;
418
420
  /** Document title — populates the iframe's `<title>`. */
419
421
  title?: string;
420
422
  /**
@@ -454,7 +456,7 @@ interface PlainHtmlPreviewProps {
454
456
  /** Optional host clipboard adapter; otherwise the browser Clipboard API is used. */
455
457
  onCopyCode?: CodeBlockCopyHandler;
456
458
  }
457
- declare function PlainHtmlPreview({ markdown, title, images, mediaProvider, mediaRevision, theme, className, style, globalKeyboardShortcuts, onFrameChange, onLinkClick, showCodeCopyButton, onCopyCode, }: PlainHtmlPreviewProps): react.JSX.Element;
459
+ declare function PlainHtmlPreview({ markdown, wikiLinks, title, images, mediaProvider, mediaRevision, theme, className, style, globalKeyboardShortcuts, onFrameChange, onLinkClick, showCodeCopyButton, onCopyCode, }: PlainHtmlPreviewProps): react.JSX.Element;
458
460
 
459
461
  /**
460
462
  * Emoji Dataset
package/dist/index.js CHANGED
@@ -243,7 +243,7 @@ import {
243
243
  videoEmbedParagraphJson,
244
244
  viewStateFromBinding,
245
245
  writeHeadingViewState
246
- } from "./chunk-W63WEDBC.js";
246
+ } from "./chunk-B6DGISKE.js";
247
247
  import {
248
248
  EditorProvider,
249
249
  applySourceEditsToText,
@@ -264,7 +264,7 @@ import {
264
264
  useBlockNavigator,
265
265
  useEditorContext,
266
266
  useEditorInsertMenuItems
267
- } from "./chunk-XF2YCVZM.js";
267
+ } from "./chunk-2DHVG55U.js";
268
268
  import {
269
269
  SPEECH_INPUT_SAMPLE_RATE,
270
270
  isSpeechInputProviderFactory,
@@ -273,14 +273,14 @@ import {
273
273
  import "./chunk-A2H3JOA5.js";
274
274
  import {
275
275
  JsonEditor
276
- } from "./chunk-ZA6VWQUQ.js";
276
+ } from "./chunk-HXQQK2S2.js";
277
277
  import {
278
278
  MarkdownEscape
279
- } from "./chunk-LRUBYTKW.js";
279
+ } from "./chunk-MJNLKPGH.js";
280
280
  import {
281
281
  markdownToTiptap,
282
282
  tiptapToMarkdown
283
- } from "./chunk-MHG4KPMA.js";
283
+ } from "./chunk-LTT6QQHJ.js";
284
284
  import {
285
285
  ImageEditor,
286
286
  ImageViewer,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  JsonEditor
3
- } from "../chunk-ZA6VWQUQ.js";
4
- import "../chunk-LRUBYTKW.js";
5
- import "../chunk-MHG4KPMA.js";
3
+ } from "../chunk-HXQQK2S2.js";
4
+ import "../chunk-MJNLKPGH.js";
5
+ import "../chunk-LTT6QQHJ.js";
6
6
  export {
7
7
  JsonEditor
8
8
  };
package/dist/monaco.js CHANGED
@@ -41,6 +41,9 @@ import "monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShow
41
41
  // src/monaco.ts
42
42
  export * from "monaco-editor/esm/vs/editor/editor.api.js";
43
43
 
44
+ // src/monacoLanguages.ts
45
+ import * as monaco from "monaco-editor/esm/vs/editor/editor.api.js";
46
+
44
47
  // src/monacoJsonc.ts
45
48
  var JSON_LANGUAGE = {
46
49
  defaultToken: "",
@@ -90,27 +93,27 @@ var JSONC_CONFIGURATION = {
90
93
  { open: '"', close: '"' }
91
94
  ]
92
95
  };
93
- function registerJsoncLanguage(monaco) {
94
- if (monaco.languages.getLanguages().some(({ id }) => id === "jsonc")) return;
95
- monaco.languages.register({
96
+ function registerJsoncLanguage(monaco2) {
97
+ if (monaco2.languages.getLanguages().some(({ id }) => id === "jsonc")) return;
98
+ monaco2.languages.register({
96
99
  id: "jsonc",
97
100
  aliases: ["JSONC", "JSON with Comments", "jsonc"],
98
101
  extensions: [".jsonc"],
99
102
  mimetypes: ["application/jsonc"]
100
103
  });
101
- monaco.languages.setLanguageConfiguration("jsonc", JSONC_CONFIGURATION);
102
- monaco.languages.setMonarchTokensProvider("jsonc", JSON_LANGUAGE);
104
+ monaco2.languages.setLanguageConfiguration("jsonc", JSONC_CONFIGURATION);
105
+ monaco2.languages.setMonarchTokensProvider("jsonc", JSON_LANGUAGE);
103
106
  }
104
- function registerJsonLanguage(monaco) {
105
- if (monaco.languages.getLanguages().some(({ id }) => id === "json")) return;
106
- monaco.languages.register({
107
+ function registerJsonLanguage(monaco2) {
108
+ if (monaco2.languages.getLanguages().some(({ id }) => id === "json")) return;
109
+ monaco2.languages.register({
107
110
  id: "json",
108
111
  aliases: ["JSON", "json"],
109
112
  extensions: [".json"],
110
113
  mimetypes: ["application/json"]
111
114
  });
112
- monaco.languages.setLanguageConfiguration("json", JSONC_CONFIGURATION);
113
- monaco.languages.setMonarchTokensProvider("json", JSON_LANGUAGE);
115
+ monaco2.languages.setLanguageConfiguration("json", JSONC_CONFIGURATION);
116
+ monaco2.languages.setMonarchTokensProvider("json", JSON_LANGUAGE);
114
117
  }
115
118
 
116
119
  // src/monacoLanguages.ts
@@ -153,7 +156,6 @@ var SERVICE_LOADERS = {
153
156
  };
154
157
  var languagePromises = /* @__PURE__ */ new Map();
155
158
  async function registerLightweightJson(language) {
156
- const monaco = await import("monaco-editor/esm/vs/editor/editor.api.js");
157
159
  if (language === "json") registerJsonLanguage(monaco);
158
160
  else registerJsoncLanguage(monaco);
159
161
  }
@@ -19,9 +19,9 @@ import {
19
19
  updateReviewDecorations,
20
20
  useReview,
21
21
  useReviewState
22
- } from "../chunk-XF2YCVZM.js";
22
+ } from "../chunk-2DHVG55U.js";
23
23
  import "../chunk-DNEVUOBZ.js";
24
- import "../chunk-MHG4KPMA.js";
24
+ import "../chunk-LTT6QQHJ.js";
25
25
 
26
26
  // src/review/proofingAdapter.ts
27
27
  import {
@@ -1,13 +1,13 @@
1
- export { h as BlockTagVisibility, k as DocumentLinkCandidate, l as DocumentLinkProvider, m as EditorActions, n as EditorColorScheme, o as EditorContextMenuContext, p as EditorContextMenuItem, q as EditorContextMenuItemVisibility, r as EditorContextMenuProvider, s as EditorContextMenuProviderProps, t as EditorContextValue, E as EditorHostMode, u as EditorInsertMenuItem, v as EditorMode, w as EditorProvider, x as EditorProviderProps, z as EditorShell, G as EditorShellProps, H as EditorState, b as EditorView, L as ImageDisplayMode, O as LayoutMode, P as MentionCandidate, Q as MentionProvider, U as PreviewPanel, V as PreviewPanelProps, W as RawEditor, Y as RawEditorProps, Z as ThemeInheritance, _ as ViewPreferences, a0 as WysiwygEditor, a1 as WysiwygEditorProps, aj as useEditorContext, ak as useEditorContextMenuItems, al as useEditorInsertMenuItems } from '../shell-DXhttvsO.js';
1
+ export { h as BlockTagVisibility, k as DocumentLinkCandidate, l as DocumentLinkProvider, m as EditorActions, n as EditorColorScheme, o as EditorContextMenuContext, p as EditorContextMenuItem, q as EditorContextMenuItemVisibility, r as EditorContextMenuProvider, s as EditorContextMenuProviderProps, t as EditorContextValue, E as EditorHostMode, u as EditorInsertMenuItem, v as EditorMode, w as EditorProvider, x as EditorProviderProps, z as EditorShell, G as EditorShellProps, H as EditorState, b as EditorView, L as ImageDisplayMode, O as LayoutMode, P as MentionCandidate, Q as MentionProvider, U as PreviewPanel, V as PreviewPanelProps, W as RawEditor, Y as RawEditorProps, Z as ThemeInheritance, _ as ViewPreferences, a0 as WysiwygEditor, a1 as WysiwygEditorProps, aj as useEditorContext, ak as useEditorContextMenuItems, al as useEditorInsertMenuItems } from '../shell-D0XgDAZj.js';
2
2
  import 'react';
3
3
  import '@bendyline/squisq/table';
4
4
  import '@bendyline/squisq-calc';
5
5
  import '@bendyline/squisq-grid-react';
6
6
  import '@bendyline/squisq-formats/xlsx';
7
+ import '@bendyline/squisq/markdown';
7
8
  import '@bendyline/squisq/schemas';
8
9
  import '@bendyline/squisq/fence';
9
10
  import '@bendyline/squisq-react';
10
- import '@bendyline/squisq/markdown';
11
11
  import '@bendyline/squisq/storage';
12
12
  import '../types-qxwhho3e.js';
13
13
  import '@bendyline/squisq/proof';
@@ -5,16 +5,16 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContextMenuItems
8
- } from "../chunk-W63WEDBC.js";
8
+ } from "../chunk-B6DGISKE.js";
9
9
  import {
10
10
  EditorProvider,
11
11
  useEditorContext,
12
12
  useEditorInsertMenuItems
13
- } from "../chunk-XF2YCVZM.js";
13
+ } from "../chunk-2DHVG55U.js";
14
14
  import "../chunk-DNEVUOBZ.js";
15
15
  import "../chunk-A2H3JOA5.js";
16
- import "../chunk-LRUBYTKW.js";
17
- import "../chunk-MHG4KPMA.js";
16
+ import "../chunk-MJNLKPGH.js";
17
+ import "../chunk-LTT6QQHJ.js";
18
18
  import "../chunk-HLU6ZBS7.js";
19
19
  import "../chunk-LXGQA2SY.js";
20
20
  import "../chunk-LRZJD5YD.js";
@@ -4,10 +4,10 @@ import { TableCellValue, TableCellEdit } from '@bendyline/squisq/table';
4
4
  import { CalcEngineConfig, CalcEngine } from '@bendyline/squisq-calc';
5
5
  import { IngestTable } from '@bendyline/squisq-grid-react';
6
6
  import { XlsxWorkbookGrids } from '@bendyline/squisq-formats/xlsx';
7
+ import { MarkdownSourceEdit, MarkdownDocument, WikiLinkSupport } from '@bendyline/squisq/markdown';
7
8
  import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/schemas';
8
9
  import { FenceRendererMap } from '@bendyline/squisq/fence';
9
10
  import { CodeBlockCopyHandler } from '@bendyline/squisq-react';
10
- import { MarkdownSourceEdit, MarkdownDocument } from '@bendyline/squisq/markdown';
11
11
  import { ContentContainer } from '@bendyline/squisq/storage';
12
12
  import { a as ProofingCapability, c as ProofingIgnoreStore } from './types-qxwhho3e.js';
13
13
  import { D as DictationControl, b as SpeechInputCapability } from './types-Bi4ZVKvN.js';
@@ -832,6 +832,7 @@ interface EditorContextValue extends EditorState, EditorActions {
832
832
  * path link. When unset, the dialog falls back to URL-only.
833
833
  */
834
834
  documentLinkProvider: DocumentLinkProvider | null;
835
+ wikiLinks: WikiLinkSupport | null;
835
836
  /**
836
837
  * Extra link schemes the host intercepts itself (e.g. an app-internal
837
838
  * navigation protocol). The link dialog validates against core's
@@ -948,6 +949,7 @@ interface EditorProviderProps {
948
949
  * Omit to fall back to URL-only link insertion.
949
950
  */
950
951
  documentLinkProvider?: DocumentLinkProvider | null;
952
+ wikiLinks?: WikiLinkSupport | null;
951
953
  /**
952
954
  * Host fence-renderer registry (`@bendyline/squisq/fence`). Omit to
953
955
  * leave every explicit-language fence to the built-in families.
@@ -1082,7 +1084,7 @@ interface ViewPreferences {
1082
1084
  /** Document vs. block-at-a-time layout. */
1083
1085
  layoutMode?: LayoutMode;
1084
1086
  }
1085
- declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, mediaEditRenders, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, fenceRenderers, onCopyCode, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, findRequest, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react.JSX.Element;
1087
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, mediaEditRenders, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, wikiLinks, fenceRenderers, onCopyCode, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, findRequest, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react.JSX.Element;
1086
1088
 
1087
1089
  /**
1088
1090
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -1572,6 +1574,9 @@ interface EditorShellProps {
1572
1574
  * remote API, …) implement this; the editor stays agnostic.
1573
1575
  */
1574
1576
  documentLinkProvider?: DocumentLinkProvider | null;
1577
+ /** Optional workspace article access. Separate from the media/history container.
1578
+ * Hosts must validate paths, exclusively create files, and flush before opening. */
1579
+ wikiLinks?: WikiLinkSupport | null;
1575
1580
  /**
1576
1581
  * Host fence-renderer registry (`@bendyline/squisq/fence`). Claimed
1577
1582
  * fence languages mount as interactive host widgets in the WYSIWYG
@@ -1759,7 +1764,7 @@ interface EditorShellProps {
1759
1764
  * Complete markdown editor shell with toolbar, view switcher, and three
1760
1765
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1761
1766
  */
1762
- declare function EditorShell({ ariaLabel, initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, mediaEditRenders, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, summarizationDesigner, statusBarSlotRight, sidePanelSlot, reviewProviders, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, findRequest, findShortcut, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, defaultThemeId, defaultThemeLabel, }: EditorShellProps): react.JSX.Element;
1767
+ declare function EditorShell({ ariaLabel, initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, mediaEditRenders, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, summarizationDesigner, statusBarSlotRight, sidePanelSlot, reviewProviders, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, findRequest, findShortcut, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, wikiLinks, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, defaultThemeId, defaultThemeLabel, }: EditorShellProps): react.JSX.Element;
1763
1768
 
1764
1769
  /**
1765
1770
  * Shared editor context menu.
@@ -8550,10 +8550,7 @@
8550
8550
  .squisq-toolbar-button:active {
8551
8551
  background: var(--squisq-surface-raised);
8552
8552
  }
8553
- .squisq-toolbar-button--active {
8554
- background: var(--squisq-accent-soft);
8555
- color: var(--squisq-accent);
8556
- }
8553
+ .squisq-toolbar-button--active,
8557
8554
  .squisq-toolbar-button--active:hover {
8558
8555
  background: var(--squisq-accent-soft);
8559
8556
  color: var(--squisq-accent-strong);
@@ -10962,12 +10959,9 @@
10962
10959
  .squisq-editor-shell[data-theme=dark] .squisq-toolbar-button:active {
10963
10960
  background: var(--squisq-surface-raised);
10964
10961
  }
10965
- .squisq-editor-shell[data-theme=dark] .squisq-toolbar-button--active {
10966
- background: var(--squisq-accent-soft);
10967
- color: var(--squisq-accent);
10968
- }
10962
+ .squisq-editor-shell[data-theme=dark] .squisq-toolbar-button--active,
10969
10963
  .squisq-editor-shell[data-theme=dark] .squisq-toolbar-button--active:hover {
10970
- background: var(--squisq-accent-hover);
10964
+ background: var(--squisq-accent-soft);
10971
10965
  color: var(--squisq-accent-strong);
10972
10966
  }
10973
10967
  .squisq-editor-shell[data-theme=dark] .squisq-toolbar-files-badge {
@@ -11367,24 +11361,36 @@
11367
11361
  letter-spacing: 0.05em;
11368
11362
  }
11369
11363
  .squisq-media-bin-actions {
11370
- display: flex;
11371
- align-items: center;
11364
+ display: grid;
11365
+ grid-auto-flow: column;
11366
+ grid-auto-columns: 1fr;
11372
11367
  gap: 5px;
11373
11368
  }
11374
11369
  .squisq-media-bin-record,
11375
11370
  .squisq-media-bin-upload {
11376
11371
  display: inline-flex;
11372
+ flex-direction: column;
11377
11373
  align-items: center;
11378
11374
  justify-content: center;
11379
- gap: 4px;
11375
+ gap: 2px;
11376
+ min-width: 50px;
11380
11377
  font-size: 11px;
11381
- padding: 2px 8px;
11378
+ line-height: 14px;
11379
+ padding: 2px 6px;
11382
11380
  cursor: pointer;
11383
11381
  background: var(--squisq-surface-raised);
11384
11382
  color: var(--squisq-text-soft);
11385
11383
  border: 1px solid var(--squisq-border);
11386
11384
  border-radius: 4px;
11387
11385
  }
11386
+ .squisq-media-bin-action-icon {
11387
+ display: flex;
11388
+ align-items: center;
11389
+ justify-content: center;
11390
+ width: 14px;
11391
+ height: 14px;
11392
+ flex: 0 0 auto;
11393
+ }
11388
11394
  .squisq-media-bin-record-dot {
11389
11395
  width: 7px;
11390
11396
  height: 7px;
@@ -14951,6 +14957,67 @@ button.squisq-view-menu-radio-row:focus-visible {
14951
14957
  color: var(--squisq-text-soft);
14952
14958
  }
14953
14959
 
14960
+ /* src/styles/wiki-links.css */
14961
+ .squisq-wiki-link button {
14962
+ font: inherit;
14963
+ color: var(--squisq-accent);
14964
+ background: transparent;
14965
+ border: 0;
14966
+ padding: 0;
14967
+ text-decoration: underline;
14968
+ cursor: pointer;
14969
+ }
14970
+ .squisq-wiki-link button[data-wiki-missing] {
14971
+ text-decoration-style: dashed;
14972
+ }
14973
+ .squisq-wiki-link button:disabled {
14974
+ color: inherit;
14975
+ cursor: default;
14976
+ text-decoration: none;
14977
+ }
14978
+ .squisq-wiki-link button:focus-visible {
14979
+ outline: 2px solid var(--squisq-accent);
14980
+ outline-offset: 2px;
14981
+ }
14982
+ .squisq-wiki-error {
14983
+ color: var(--squisq-danger);
14984
+ font-size: 0.85em;
14985
+ }
14986
+ .squisq-wiki-suggestions {
14987
+ position: fixed;
14988
+ z-index: 10000;
14989
+ min-width: 200px;
14990
+ max-width: min(360px, calc(100vw - 16px));
14991
+ max-height: 240px;
14992
+ overflow-y: auto;
14993
+ padding: 4px;
14994
+ border: 1px solid var(--squisq-border);
14995
+ border-radius: 6px;
14996
+ background: var(--squisq-surface);
14997
+ color: var(--squisq-text);
14998
+ font-family: var(--squisq-ux-font);
14999
+ box-shadow: var(--squisq-shadow-md);
15000
+ }
15001
+ .squisq-wiki-suggestions button {
15002
+ display: block;
15003
+ width: 100%;
15004
+ border: 0;
15005
+ padding: 8px 12px;
15006
+ text-align: left;
15007
+ background: transparent;
15008
+ color: inherit;
15009
+ font: inherit;
15010
+ cursor: pointer;
15011
+ overflow-wrap: anywhere;
15012
+ }
15013
+ .squisq-wiki-suggestions button[aria-selected=true],
15014
+ .squisq-wiki-suggestions button:hover {
15015
+ background: var(--squisq-row-hover);
15016
+ }
15017
+ .squisq-wiki-suggestions button[data-kind=folder] {
15018
+ font-weight: 600;
15019
+ }
15020
+
14954
15021
  /* src/styles/document-tray.css */
14955
15022
  .squisq-wysiwyg-editor .squisq-document-tray-source {
14956
15023
  display: none !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "2.12.8",
3
+ "version": "2.12.10",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -102,12 +102,12 @@
102
102
  }
103
103
  },
104
104
  "dependencies": {
105
- "@bendyline/squisq": "2.12.4",
105
+ "@bendyline/squisq": "2.12.5",
106
106
  "@bendyline/squisq-calc": "2.11.2",
107
- "@bendyline/squisq-formats": "2.7.5",
108
- "@bendyline/squisq-grid-react": "2.11.27",
109
- "@bendyline/squisq-react": "2.12.5",
110
- "@bendyline/squisq-video-react": "2.5.6",
107
+ "@bendyline/squisq-formats": "2.7.6",
108
+ "@bendyline/squisq-grid-react": "2.11.28",
109
+ "@bendyline/squisq-react": "2.12.6",
110
+ "@bendyline/squisq-video-react": "2.5.7",
111
111
  "@fortawesome/fontawesome-free": "7.3.1",
112
112
  "@tiptap/core": "2.27.3",
113
113
  "@tiptap/extension-heading": "2.27.3",