@bendyline/squisq-editor-react 2.11.7 → 2.11.9
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/{chunk-DUO5XZQK.js → chunk-AKWS5KEQ.js} +278 -1
- package/dist/{chunk-UYKOTWJM.js → chunk-E5QXSFW3.js} +1 -1
- package/dist/{chunk-WMNH5ROU.js → chunk-MDW5NY3Q.js} +2169 -817
- package/dist/{chunk-ES6CPRCW.js → chunk-MFE325P4.js} +77 -8
- package/dist/index.d.ts +15 -6
- package/dist/index.js +4 -4
- package/dist/json-editor/index.js +2 -2
- package/dist/recorder/index.d.ts +1 -1
- package/dist/{recorder-B6MtQH5u.d.ts → recorder-CC3VW9Z7.d.ts} +7 -1
- package/dist/review/index.js +2 -2
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/index.js +3 -3
- package/dist/{shell-Dwf_W4K4.d.ts → shell-3UAmXcYE.d.ts} +33 -2
- package/dist/styles/index.css +437 -1
- package/package.json +6 -6
|
@@ -5,6 +5,63 @@ import {
|
|
|
5
5
|
matchTrailingPandocAttr,
|
|
6
6
|
tokenizeAttrTokens
|
|
7
7
|
} from "@bendyline/squisq/markdown";
|
|
8
|
+
import { mediaEditHtmlAttribute as mediaEditHtmlAttribute2 } from "@bendyline/squisq/mediaEdit";
|
|
9
|
+
|
|
10
|
+
// src/tiptap/mediaEditAttributes.ts
|
|
11
|
+
import {
|
|
12
|
+
MEDIA_EDIT_PARAMS,
|
|
13
|
+
mediaEditHtmlAttribute
|
|
14
|
+
} from "@bendyline/squisq/mediaEdit";
|
|
15
|
+
function mediaEditNodeAttributeName(key) {
|
|
16
|
+
return `edit${key[0].toUpperCase()}${key.slice(1)}`;
|
|
17
|
+
}
|
|
18
|
+
function mediaEditKeysFor(kind) {
|
|
19
|
+
return MEDIA_EDIT_PARAMS.map((p) => p.key).filter((key) => kind === "video" || key !== "crop");
|
|
20
|
+
}
|
|
21
|
+
function mediaEditNodeAttributes(kind) {
|
|
22
|
+
const specs = {};
|
|
23
|
+
for (const key of mediaEditKeysFor(kind)) {
|
|
24
|
+
const name = mediaEditNodeAttributeName(key);
|
|
25
|
+
const html = mediaEditHtmlAttribute(kind, key);
|
|
26
|
+
specs[name] = {
|
|
27
|
+
default: null,
|
|
28
|
+
parseHTML: (element) => element.getAttribute(html),
|
|
29
|
+
renderHTML: (attributes) => {
|
|
30
|
+
const value = attributes[name];
|
|
31
|
+
return typeof value === "string" && value !== "" ? { [html]: value } : {};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return specs;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/markdownDestination.ts
|
|
39
|
+
function hasUnbalancedParens(url) {
|
|
40
|
+
let depth = 0;
|
|
41
|
+
for (let i = 0; i < url.length; i++) {
|
|
42
|
+
if (url[i] === "\\") {
|
|
43
|
+
i++;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (url[i] === "(") depth++;
|
|
47
|
+
else if (url[i] === ")" && --depth < 0) return true;
|
|
48
|
+
}
|
|
49
|
+
return depth !== 0;
|
|
50
|
+
}
|
|
51
|
+
function needsAngleDestination(url) {
|
|
52
|
+
return /\s/.test(url) || hasUnbalancedParens(url);
|
|
53
|
+
}
|
|
54
|
+
function formatLinkDestination(url) {
|
|
55
|
+
return needsAngleDestination(url) ? `<${url}>` : url;
|
|
56
|
+
}
|
|
57
|
+
function unwrapLinkDestination(destination) {
|
|
58
|
+
return destination.length >= 2 && destination.startsWith("<") && destination.endsWith(">") ? destination.slice(1, -1) : destination;
|
|
59
|
+
}
|
|
60
|
+
function escapeLinkLabel(text) {
|
|
61
|
+
return text.replace(/([\\[\]])/g, "\\$1");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/tiptapBridge.ts
|
|
8
65
|
var RE_BOLD_STAR = /\*\*(?![\s*])(.+?)(?<![\s*])\*\*/g;
|
|
9
66
|
var RE_BOLD_UNDER = /(?<![\p{L}\p{N}_])__(?![\s_])(.+?)(?<![\s_])__(?![\p{L}\p{N}_])/gu;
|
|
10
67
|
var RE_ITALIC_STAR = /\*(?![\s*])(.+?)(?<![\s*])\*/g;
|
|
@@ -328,7 +385,7 @@ function markdownToTiptap(markdown) {
|
|
|
328
385
|
if (standaloneImageMatch) {
|
|
329
386
|
flushList();
|
|
330
387
|
const alt = escapeHtml(standaloneImageMatch[1] ?? "");
|
|
331
|
-
const src = escapeHtml(standaloneImageMatch[2] ?? "");
|
|
388
|
+
const src = escapeHtml(unwrapLinkDestination(standaloneImageMatch[2] ?? ""));
|
|
332
389
|
pushBlock(`<img alt="${alt}" src="${src}">`);
|
|
333
390
|
continue;
|
|
334
391
|
}
|
|
@@ -511,7 +568,8 @@ function tiptapToMarkdown(html) {
|
|
|
511
568
|
const src = /\bsrc="([^"]*)"/i.exec(attrs)?.[1];
|
|
512
569
|
if (src) {
|
|
513
570
|
const alt = /\balt="([^"]*)"/i.exec(attrs)?.[1] ?? "";
|
|
514
|
-
|
|
571
|
+
const serialized = serializeImage(src, alt, attrs);
|
|
572
|
+
lines.push(serialized.startsWith("<") ? serialized : unescapeHtml(serialized));
|
|
515
573
|
lines.push("");
|
|
516
574
|
}
|
|
517
575
|
remaining = remaining.slice(imgMatch[0].length);
|
|
@@ -793,6 +851,11 @@ function serializeMediaTag(tag, attrs) {
|
|
|
793
851
|
if (startAt != null) parts.push(` ${timingPrefix}-start-at="${startAt}"`);
|
|
794
852
|
if (clipStart != null) parts.push(` ${timingPrefix}-clip-start="${clipStart}"`);
|
|
795
853
|
if (clipEnd != null) parts.push(` ${timingPrefix}-clip-end="${clipEnd}"`);
|
|
854
|
+
for (const key of mediaEditKeysFor(tag)) {
|
|
855
|
+
const name = mediaEditHtmlAttribute2(tag, key);
|
|
856
|
+
const value = new RegExp(`\\b${name}="([^"]*)"`, "i").exec(attrs)?.[1];
|
|
857
|
+
if (value != null && value !== "") parts.push(` ${name}="${value}"`);
|
|
858
|
+
}
|
|
796
859
|
parts.push(`></${tag}>`);
|
|
797
860
|
return parts.join("");
|
|
798
861
|
}
|
|
@@ -801,7 +864,7 @@ function serializeImage(src, alt, attrs) {
|
|
|
801
864
|
const height = /\bheight="([^"]*)"/i.exec(attrs)?.[1];
|
|
802
865
|
const title = /\btitle="([^"]*)"/i.exec(attrs)?.[1];
|
|
803
866
|
if (!width && !height) {
|
|
804
|
-
return ``;
|
|
867
|
+
return `})`;
|
|
805
868
|
}
|
|
806
869
|
const parts = [`<img alt="${alt}" src="${src}"`];
|
|
807
870
|
if (width) parts.push(` width="${width}"`);
|
|
@@ -810,6 +873,9 @@ function serializeImage(src, alt, attrs) {
|
|
|
810
873
|
parts.push(">");
|
|
811
874
|
return parts.join("");
|
|
812
875
|
}
|
|
876
|
+
function escapedDestination(attrValue) {
|
|
877
|
+
return needsAngleDestination(attrValue) ? `<${attrValue}>` : attrValue;
|
|
878
|
+
}
|
|
813
879
|
function escapeHtml(text) {
|
|
814
880
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
815
881
|
}
|
|
@@ -834,7 +900,7 @@ function inlineToHtml(text) {
|
|
|
834
900
|
staged = staged.replace(/<br\s*\/?>/gi, () => stash("<br>"));
|
|
835
901
|
staged = staged.replace(
|
|
836
902
|
RE_IMAGE,
|
|
837
|
-
(_m, alt, src) => stash(`<img alt="${escapeHtml(alt)}" src="${escapeHtml(src)}">`)
|
|
903
|
+
(_m, alt, src) => stash(`<img alt="${escapeHtml(alt)}" src="${escapeHtml(unwrapLinkDestination(src))}">`)
|
|
838
904
|
);
|
|
839
905
|
staged = staged.replace(
|
|
840
906
|
RE_MENTION,
|
|
@@ -912,7 +978,7 @@ function splitLinkDestination(destination) {
|
|
|
912
978
|
const OPENER_FOR = { '"': '"', "'": "'", ")": "(" };
|
|
913
979
|
const trimmed = destination.trimEnd();
|
|
914
980
|
const opener = OPENER_FOR[trimmed[trimmed.length - 1] ?? ""];
|
|
915
|
-
if (!opener) return { url: destination.trim(), title: null };
|
|
981
|
+
if (!opener) return { url: unwrapLinkDestination(destination.trim()), title: null };
|
|
916
982
|
for (let index = trimmed.length - 2; index > 0; index--) {
|
|
917
983
|
if (trimmed[index] !== opener) continue;
|
|
918
984
|
if (isEscapedMarkdownCharacter(trimmed, index)) continue;
|
|
@@ -920,13 +986,13 @@ function splitLinkDestination(destination) {
|
|
|
920
986
|
const url = trimmed.slice(0, index).trim();
|
|
921
987
|
if (!url) continue;
|
|
922
988
|
return {
|
|
923
|
-
url,
|
|
989
|
+
url: unwrapLinkDestination(url),
|
|
924
990
|
// Backslash escapes inside a title are real escapes (`\"` is a literal
|
|
925
991
|
// quote), matching core's parser.
|
|
926
992
|
title: trimmed.slice(index + 1, -1).replace(/\\([\\"'()])/g, "$1")
|
|
927
993
|
};
|
|
928
994
|
}
|
|
929
|
-
return { url: destination.trim(), title: null };
|
|
995
|
+
return { url: unwrapLinkDestination(destination.trim()), title: null };
|
|
930
996
|
}
|
|
931
997
|
function escapeLinkTitleAttr(attrValue) {
|
|
932
998
|
return attrValue.replace(/\\/g, "\\\\").replace(/"/g, "\\"");
|
|
@@ -1061,7 +1127,7 @@ function htmlToInline(html) {
|
|
|
1061
1127
|
if (href === void 0) return match;
|
|
1062
1128
|
const title = /\btitle="([^"]*)"/i.exec(attrs)?.[1];
|
|
1063
1129
|
const titlePart = title ? ` "${escapeLinkTitleAttr(title)}"` : "";
|
|
1064
|
-
return `[${text}](${href}${titlePart})`;
|
|
1130
|
+
return `[${text}](${escapedDestination(href)}${titlePart})`;
|
|
1065
1131
|
});
|
|
1066
1132
|
result = result.replace(RE_IMG_TAG, (match, attrs) => {
|
|
1067
1133
|
const src = /\bsrc="([^"]*)"/i.exec(attrs)?.[1];
|
|
@@ -1088,6 +1154,9 @@ function restoreLeadingSpaces(text) {
|
|
|
1088
1154
|
}
|
|
1089
1155
|
|
|
1090
1156
|
export {
|
|
1157
|
+
mediaEditNodeAttributes,
|
|
1158
|
+
formatLinkDestination,
|
|
1159
|
+
escapeLinkLabel,
|
|
1091
1160
|
markdownToTiptap,
|
|
1092
1161
|
tiptapToMarkdown
|
|
1093
1162
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel, a as CalcEngineFactory, b as CsvSourceMeta, X as XlsxSourceMeta, F as FormulaEditRecord } from './shell-
|
|
2
|
-
export { B as BlockRange, c as BlockSlice, d as BlockTagVisibility, e as CodeContextSection, f as CoverImageSaveOutput, D as DashboardImageSaveOutput, g as DocumentLinkCandidate, h as DocumentLinkProvider, i as EditorActions, j as EditorColorScheme, k as EditorContextMenuContext, l as EditorContextMenuItem, m as EditorContextMenuItemVisibility, n as EditorContextMenuProvider, o as EditorContextMenuProviderProps, p as EditorContextValue, q as EditorMode, r as EditorProvider, s as EditorProviderProps, t as EditorSelectionInfo, u as EditorShell, v as EditorShellProps, w as EditorState, x as EditorView, y as FormulaSessionOptions, I as ImageDisplayMode, z as IngestedSidecar, L as LayoutMode, M as MentionCandidate, A as MentionProvider, P as PreviewPanel, G as PreviewPanelProps, R as RawEditor, H as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, J as WysiwygEditor, K as WysiwygEditorProps, N as XLSX_LOCKED_REASON, O as XlsxFormulaSession, Q as createXlsxFormulaSession, U as getBlockSlices, Y as ingestSidecarBytes, Z as lineToOffset, _ as offsetToLine, $ as sliceIndexAtOffset, a0 as spliceBlock, a1 as useEditorContext, a2 as useEditorContextMenuItems } from './shell-
|
|
1
|
+
import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel, a as CalcEngineFactory, b as CsvSourceMeta, X as XlsxSourceMeta, F as FormulaEditRecord } from './shell-3UAmXcYE.js';
|
|
2
|
+
export { B as BlockRange, c as BlockSlice, d as BlockTagVisibility, e as CodeContextSection, f as CoverImageSaveOutput, D as DashboardImageSaveOutput, g as DocumentLinkCandidate, h as DocumentLinkProvider, i as EditorActions, j as EditorColorScheme, k as EditorContextMenuContext, l as EditorContextMenuItem, m as EditorContextMenuItemVisibility, n as EditorContextMenuProvider, o as EditorContextMenuProviderProps, p as EditorContextValue, q as EditorMode, r as EditorProvider, s as EditorProviderProps, t as EditorSelectionInfo, u as EditorShell, v as EditorShellProps, w as EditorState, x as EditorView, y as FormulaSessionOptions, I as ImageDisplayMode, z as IngestedSidecar, L as LayoutMode, M as MentionCandidate, A as MentionProvider, P as PreviewPanel, G as PreviewPanelProps, R as RawEditor, H as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, J as WysiwygEditor, K as WysiwygEditorProps, N as XLSX_LOCKED_REASON, O as XlsxFormulaSession, Q as createXlsxFormulaSession, U as getBlockSlices, Y as ingestSidecarBytes, Z as lineToOffset, _ as offsetToLine, $ as sliceIndexAtOffset, a0 as spliceBlock, a1 as useEditorContext, a2 as useEditorContextMenuItems } from './shell-3UAmXcYE.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
6
|
-
import { Doc, ScheduledClip, VideoPlacement, VideoPipSize, VideoPipShape, VideoPipPosition, MediaProvider, Theme, CustomTemplateDefinition, ThemeSeedColors, ViewportPreset, ViewportConfig, Block, MediaEntry, DiagramEdgeAnchor } from '@bendyline/squisq/schemas';
|
|
6
|
+
import { Doc, ScheduledClip, VideoPlacement, VideoPipSize, VideoPipShape, VideoPipPosition, MediaEdits, MediaProvider, Theme, CustomTemplateDefinition, ThemeSeedColors, ViewportPreset, ViewportConfig, Block, MediaEntry, DiagramEdgeAnchor } from '@bendyline/squisq/schemas';
|
|
7
7
|
import { ContentContainer } from '@bendyline/squisq/storage';
|
|
8
8
|
export { CanvasRect, ImageEditor, ImageEditorAction, ImageEditorProps, ImageEditorState, ImageEditorTool, ImageViewer, ImageViewerProps, UseImageEditorOptions, UseImageEditorReturn, imageEditorReducer, initialImageEditorState, useImageEditor } from './image-editor/index.js';
|
|
9
9
|
import { CodeBlockCopyHandler, DisplayMode, CaptionStyle, VideoPresentation, PipSize, PipShape, PipPosition } from '@bendyline/squisq-react';
|
|
@@ -26,7 +26,7 @@ import { FenceRendererMap } from '@bendyline/squisq/fence';
|
|
|
26
26
|
import { TableViewState } from '@bendyline/squisq/table';
|
|
27
27
|
import { EditJournal } from '@bendyline/squisq-grid-react';
|
|
28
28
|
export { JsonEditor, JsonEditorProps } from './json-editor/index.js';
|
|
29
|
-
export { C as CameraStreamOptions, D as DEFAULT_RECORDER_DEVICE_SETTINGS, M as MediaDeviceInventory, R as RecordedBookmark, a as RecordedMediaKind, b as RecorderAudioDeviceSettings, c as RecorderButton, d as RecorderButtonProps, e as RecorderCameraDeviceSettings, f as RecorderCameraSaveResult, g as RecorderColorScheme, h as RecorderConstraintMode, i as RecorderDeviceOption, j as RecorderDeviceQuickPicks, k as RecorderDeviceQuickPicksProps, l as RecorderDeviceSettings, m as RecorderDeviceSettingsPanel, n as RecorderDeviceSettingsPanelProps, o as RecorderEncodingSettings, p as RecorderModal, q as RecorderModalProps, r as RecorderNarrationOptions, s as RecorderPanel, t as RecorderPanelProps, u as RecorderSaveResult, v as RecorderScreenAudioSettings, w as RecorderScreenDeviceSettings, x as RecorderSlidesOptions, S as ScreenStreamHandle, y as ScreenStreamOptions, z as SlideTimingSaveResult, T as TimingJson, A as buildRecorderAudioConstraints, B as buildRecorderCameraConstraints, E as buildRecorderScreenAudioConstraints, F as buildRecorderScreenConstraints, G as buildTimingJson, H as encodeTimingJson, I as hasRecorderDeviceChoice, J as recordedMediaKind, K as recorderBitsPerSecond, L as recorderDeviceGroups, N as recorderDeviceOptions, O as requestCameraStream, P as requestMicStream, Q as requestScreenStream, U as timingPathFor, V as useMediaDevices, W as useStreamPreview } from './recorder-
|
|
29
|
+
export { C as CameraStreamOptions, D as DEFAULT_RECORDER_DEVICE_SETTINGS, M as MediaDeviceInventory, R as RecordedBookmark, a as RecordedMediaKind, b as RecorderAudioDeviceSettings, c as RecorderButton, d as RecorderButtonProps, e as RecorderCameraDeviceSettings, f as RecorderCameraSaveResult, g as RecorderColorScheme, h as RecorderConstraintMode, i as RecorderDeviceOption, j as RecorderDeviceQuickPicks, k as RecorderDeviceQuickPicksProps, l as RecorderDeviceSettings, m as RecorderDeviceSettingsPanel, n as RecorderDeviceSettingsPanelProps, o as RecorderEncodingSettings, p as RecorderModal, q as RecorderModalProps, r as RecorderNarrationOptions, s as RecorderPanel, t as RecorderPanelProps, u as RecorderSaveResult, v as RecorderScreenAudioSettings, w as RecorderScreenDeviceSettings, x as RecorderSlidesOptions, S as ScreenStreamHandle, y as ScreenStreamOptions, z as SlideTimingSaveResult, T as TimingJson, A as buildRecorderAudioConstraints, B as buildRecorderCameraConstraints, E as buildRecorderScreenAudioConstraints, F as buildRecorderScreenConstraints, G as buildTimingJson, H as encodeTimingJson, I as hasRecorderDeviceChoice, J as recordedMediaKind, K as recorderBitsPerSecond, L as recorderDeviceGroups, N as recorderDeviceOptions, O as requestCameraStream, P as requestMicStream, Q as requestScreenStream, U as timingPathFor, V as useMediaDevices, W as useStreamPreview } from './recorder-CC3VW9Z7.js';
|
|
30
30
|
import { R as RecorderState } from './useNarrationStage-D3Sgcf0L.js';
|
|
31
31
|
export { C as CanvasSink, a as CaptureKind, D as DEFAULT_TELEPROMPTER_PREFS, F as FloatOpenOptions, b as FloatTier, c as FloatingWindowHandle, d as FloatingWindowManager, M as MicAnalysisHandle, e as MicAnalysisStatus, N as NarrationRecorderController, f as NarrationRecorderState, g as NarrationStageHandle, h as NarrationTake, P as PrompterTransport, i as RecorderAudioBitrateMode, j as RecorderCameraLane, k as RecorderExtendedMediaOptions, l as RecorderSource, m as ResolvedFormat, T as TeleprompterController, n as TeleprompterPrefs, o as TeleprompterRecordingDeps, U as UseMediaRecorderOptions, p as UseMediaRecorderResult, q as UseNarrationStageOptions, r as buildFilename, s as createFloatingWindowManager, t as detectFloatTiers, u as getCaptureKind, v as resolveFormat, w as supportsDisplayMedia, x as supportsMediaRecorder, y as supportsUserMedia, z as useFloatingWindow, A as useMediaRecorder, B as useMicAnalysis, E as useNarrationRecorder, G as useNarrationStage, H as useTeleprompter, I as vadConfigForSensitivity } from './useNarrationStage-D3Sgcf0L.js';
|
|
32
32
|
export { EYE_LINE_FRACTION, NarrationSavePlan, NarrationSaveResult, NarrationStage, NarrationStageProps, PCM_WORKLET_NAME, PCM_WORKLET_SOURCE, TELEPROMPTER_CSS, TeleprompterControls, TeleprompterControlsProps, TeleprompterSurface, TeleprompterSurfaceProps, TeleprompterView, TeleprompterViewProps, TokenLineMap, buildNarrationSavePlan, cameraVideoLine, ensureTeleprompterStyles, executeNarrationSave, insertNarrationPreamble, measureTokenLines, narrationAnnotationLine, prompterVarsFromTheme, registerPcmWorklet, stepScroll, targetOffsetFor } from './teleprompter/index.js';
|
|
@@ -36,6 +36,7 @@ export { PROOF_DIALECTS, PROOF_FRONTMATTER_KEYS, ProofCategory, ProofDialect, Pr
|
|
|
36
36
|
import '@bendyline/squisq-calc';
|
|
37
37
|
import '@bendyline/squisq-formats/xlsx';
|
|
38
38
|
import '@bendyline/squisq/versions';
|
|
39
|
+
import '@bendyline/squisq-video-react/media-edit';
|
|
39
40
|
import './types-C0puuw-M.js';
|
|
40
41
|
import '@bendyline/squisq/review';
|
|
41
42
|
import '@bendyline/squisq/imageEdit';
|
|
@@ -354,6 +355,12 @@ interface MediaClipPatch {
|
|
|
354
355
|
pipSize?: VideoPipSize | null;
|
|
355
356
|
pipShape?: VideoPipShape | null;
|
|
356
357
|
pipPosition?: VideoPipPosition | null;
|
|
358
|
+
/**
|
|
359
|
+
* The clip's complete edit recipe. Replaces every recipe parameter at once
|
|
360
|
+
* (fields absent from the recipe are removed); `null` clears them all.
|
|
361
|
+
* Unrelated parameters and attributes are untouched.
|
|
362
|
+
*/
|
|
363
|
+
edits?: MediaEdits | null;
|
|
357
364
|
}
|
|
358
365
|
/**
|
|
359
366
|
* Patch a `{[audio …]}` / `{[video …]}` annotation or standalone HTML media
|
|
@@ -1403,13 +1410,15 @@ declare function DropZoneOverlay({ dragContentType, zoneProps, hasMediaProvider,
|
|
|
1403
1410
|
*/
|
|
1404
1411
|
|
|
1405
1412
|
/**
|
|
1406
|
-
* Partition an array of files into media, text, and data categories
|
|
1407
|
-
*
|
|
1413
|
+
* Partition an array of files into media, text, and data categories, plus
|
|
1414
|
+
* `other` for everything else (a .zip, a .dat) — which a drop attaches as a
|
|
1415
|
+
* link rather than discarding.
|
|
1408
1416
|
*/
|
|
1409
1417
|
declare function partitionFiles(files: File[]): {
|
|
1410
1418
|
media: File[];
|
|
1411
1419
|
text: File[];
|
|
1412
1420
|
data: File[];
|
|
1421
|
+
other: File[];
|
|
1413
1422
|
};
|
|
1414
1423
|
/**
|
|
1415
1424
|
* Add media files to a MediaProvider. Returns the relative paths
|
package/dist/index.js
CHANGED
|
@@ -219,7 +219,7 @@ import {
|
|
|
219
219
|
useTreeViewData,
|
|
220
220
|
viewStateFromBinding,
|
|
221
221
|
writeHeadingViewState
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-MDW5NY3Q.js";
|
|
223
223
|
import {
|
|
224
224
|
EditorProvider,
|
|
225
225
|
detectLanguageFromFileName,
|
|
@@ -231,15 +231,15 @@ import {
|
|
|
231
231
|
spliceBlock,
|
|
232
232
|
useBlockNavigator,
|
|
233
233
|
useEditorContext
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-AKWS5KEQ.js";
|
|
235
235
|
import "./chunk-V4NBQF5C.js";
|
|
236
236
|
import {
|
|
237
237
|
JsonEditor
|
|
238
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-E5QXSFW3.js";
|
|
239
239
|
import {
|
|
240
240
|
markdownToTiptap,
|
|
241
241
|
tiptapToMarkdown
|
|
242
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-MFE325P4.js";
|
|
243
243
|
import {
|
|
244
244
|
ImageEditor,
|
|
245
245
|
ImageViewer,
|
package/dist/recorder/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CameraStreamOptions, D as DEFAULT_RECORDER_DEVICE_SETTINGS, M as MediaDeviceInventory, R as RecordedBookmark, a as RecordedMediaKind, b as RecorderAudioDeviceSettings, c as RecorderButton, d as RecorderButtonProps, e as RecorderCameraDeviceSettings, f as RecorderCameraSaveResult, g as RecorderColorScheme, h as RecorderConstraintMode, i as RecorderDeviceOption, j as RecorderDeviceQuickPicks, k as RecorderDeviceQuickPicksProps, l as RecorderDeviceSettings, m as RecorderDeviceSettingsPanel, n as RecorderDeviceSettingsPanelProps, o as RecorderEncodingSettings, p as RecorderModal, q as RecorderModalProps, s as RecorderPanel, t as RecorderPanelProps, u as RecorderSaveResult, v as RecorderScreenAudioSettings, w as RecorderScreenDeviceSettings, S as ScreenStreamHandle, y as ScreenStreamOptions, T as TimingJson, A as buildRecorderAudioConstraints, B as buildRecorderCameraConstraints, E as buildRecorderScreenAudioConstraints, F as buildRecorderScreenConstraints, G as buildTimingJson, H as encodeTimingJson, I as hasRecorderDeviceChoice, J as recordedMediaKind, K as recorderBitsPerSecond, L as recorderDeviceGroups, N as recorderDeviceOptions, O as requestCameraStream, P as requestMicStream, Q as requestScreenStream, U as timingPathFor, V as useMediaDevices, W as useStreamPreview } from '../recorder-
|
|
1
|
+
export { C as CameraStreamOptions, D as DEFAULT_RECORDER_DEVICE_SETTINGS, M as MediaDeviceInventory, R as RecordedBookmark, a as RecordedMediaKind, b as RecorderAudioDeviceSettings, c as RecorderButton, d as RecorderButtonProps, e as RecorderCameraDeviceSettings, f as RecorderCameraSaveResult, g as RecorderColorScheme, h as RecorderConstraintMode, i as RecorderDeviceOption, j as RecorderDeviceQuickPicks, k as RecorderDeviceQuickPicksProps, l as RecorderDeviceSettings, m as RecorderDeviceSettingsPanel, n as RecorderDeviceSettingsPanelProps, o as RecorderEncodingSettings, p as RecorderModal, q as RecorderModalProps, s as RecorderPanel, t as RecorderPanelProps, u as RecorderSaveResult, v as RecorderScreenAudioSettings, w as RecorderScreenDeviceSettings, S as ScreenStreamHandle, y as ScreenStreamOptions, T as TimingJson, A as buildRecorderAudioConstraints, B as buildRecorderCameraConstraints, E as buildRecorderScreenAudioConstraints, F as buildRecorderScreenConstraints, G as buildTimingJson, H as encodeTimingJson, I as hasRecorderDeviceChoice, J as recordedMediaKind, K as recorderBitsPerSecond, L as recorderDeviceGroups, N as recorderDeviceOptions, O as requestCameraStream, P as requestMicStream, Q as requestScreenStream, U as timingPathFor, V as useMediaDevices, W as useStreamPreview } from '../recorder-CC3VW9Z7.js';
|
|
2
2
|
export { a as CaptureKind, i as RecorderAudioBitrateMode, j as RecorderCameraLane, k as RecorderExtendedMediaOptions, l as RecorderSource, R as RecorderState, m as ResolvedFormat, U as UseMediaRecorderOptions, p as UseMediaRecorderResult, r as buildFilename, u as getCaptureKind, v as resolveFormat, w as supportsDisplayMedia, x as supportsMediaRecorder, y as supportsUserMedia, A as useMediaRecorder } from '../useNarrationStage-D3Sgcf0L.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '@bendyline/squisq/schemas';
|
|
@@ -12,8 +12,14 @@ type RecordedMediaKind = 'audio' | 'video';
|
|
|
12
12
|
* can negotiate a `video/webm` container even when the stream contains only
|
|
13
13
|
* audio. MIME and requested source are retained as fallbacks for hosts that
|
|
14
14
|
* construct a save result without exposing the stream.
|
|
15
|
+
*
|
|
16
|
+
* `stream` is structural rather than `Pick<MediaStream, …>`: mediabunny's
|
|
17
|
+
* `@types/dom-mediacapture-transform` overloads `getVideoTracks`, which no
|
|
18
|
+
* plain stub can satisfy, and only the track count matters here.
|
|
15
19
|
*/
|
|
16
|
-
declare function recordedMediaKind(source: RecorderSource, stream:
|
|
20
|
+
declare function recordedMediaKind(source: RecorderSource, stream: {
|
|
21
|
+
getVideoTracks(): readonly unknown[];
|
|
22
|
+
} | null, mimeType: string | null | undefined): RecordedMediaKind;
|
|
17
23
|
|
|
18
24
|
type RecorderColorScheme = 'light' | 'dark';
|
|
19
25
|
/**
|
package/dist/review/index.js
CHANGED
package/dist/shell/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as BlockTagVisibility, g as DocumentLinkCandidate, h as DocumentLinkProvider, i as EditorActions, j as EditorColorScheme, k as EditorContextMenuContext, l as EditorContextMenuItem, m as EditorContextMenuItemVisibility, n as EditorContextMenuProvider, o as EditorContextMenuProviderProps, p as EditorContextValue, E as EditorHostMode, q as EditorMode, r as EditorProvider, s as EditorProviderProps, u as EditorShell, v as EditorShellProps, w as EditorState, x as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, A as MentionProvider, P as PreviewPanel, G as PreviewPanelProps, R as RawEditor, H as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, J as WysiwygEditor, K as WysiwygEditorProps, a1 as useEditorContext, a2 as useEditorContextMenuItems } from '../shell-
|
|
1
|
+
export { d as BlockTagVisibility, g as DocumentLinkCandidate, h as DocumentLinkProvider, i as EditorActions, j as EditorColorScheme, k as EditorContextMenuContext, l as EditorContextMenuItem, m as EditorContextMenuItemVisibility, n as EditorContextMenuProvider, o as EditorContextMenuProviderProps, p as EditorContextValue, E as EditorHostMode, q as EditorMode, r as EditorProvider, s as EditorProviderProps, u as EditorShell, v as EditorShellProps, w as EditorState, x as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, A as MentionProvider, P as PreviewPanel, G as PreviewPanelProps, R as RawEditor, H as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, J as WysiwygEditor, K as WysiwygEditorProps, a1 as useEditorContext, a2 as useEditorContextMenuItems } from '../shell-3UAmXcYE.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import '@bendyline/squisq/table';
|
|
4
4
|
import '@bendyline/squisq-calc';
|
|
@@ -15,5 +15,6 @@ import '@bendyline/squisq/proof';
|
|
|
15
15
|
import '@bendyline/squisq/versions';
|
|
16
16
|
import '@tiptap/core';
|
|
17
17
|
import 'monaco-editor';
|
|
18
|
+
import '@bendyline/squisq-video-react/media-edit';
|
|
18
19
|
import '../types-C0puuw-M.js';
|
|
19
20
|
import '@bendyline/squisq/review';
|
package/dist/shell/index.js
CHANGED
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
RawEditor,
|
|
6
6
|
WysiwygEditor,
|
|
7
7
|
useEditorContextMenuItems
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-MDW5NY3Q.js";
|
|
9
9
|
import {
|
|
10
10
|
EditorProvider,
|
|
11
11
|
useEditorContext
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-AKWS5KEQ.js";
|
|
13
13
|
import "../chunk-V4NBQF5C.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-MFE325P4.js";
|
|
15
15
|
import "../chunk-V44VP242.js";
|
|
16
16
|
import "../chunk-BJ3TXAIQ.js";
|
|
17
17
|
import "../chunk-GS7QWYFT.js";
|
|
@@ -13,6 +13,7 @@ import { a as ProofingCapability, c as ProofingIgnoreStore } from './types-De4z-
|
|
|
13
13
|
import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
|
|
14
14
|
import { Editor } from '@tiptap/core';
|
|
15
15
|
import { editor } from 'monaco-editor';
|
|
16
|
+
import { MediaEditRenderManager } from '@bendyline/squisq-video-react/media-edit';
|
|
16
17
|
import { a as ReviewCapability } from './types-C0puuw-M.js';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -385,6 +386,11 @@ interface EditorState {
|
|
|
385
386
|
* and consumed by `<EditorShell>` to render the modal `<ImageEditor>`.
|
|
386
387
|
*/
|
|
387
388
|
imageEditTarget: string | null;
|
|
389
|
+
/**
|
|
390
|
+
* The media clip the edit panel is open on (by its authoring line), or
|
|
391
|
+
* `null` when the panel is closed. Consumed by `<EditorShell>`.
|
|
392
|
+
*/
|
|
393
|
+
mediaEditTarget: MediaEditTarget | null;
|
|
388
394
|
/**
|
|
389
395
|
* Monotonic counter bumped whenever a managed media asset is rewritten
|
|
390
396
|
* (e.g. after the image-editor modal saves back). Image render paths
|
|
@@ -524,6 +530,10 @@ interface EditorActions {
|
|
|
524
530
|
openImageEdit: (relativePath: string) => void;
|
|
525
531
|
/** Close the image editor modal without saving. */
|
|
526
532
|
closeImageEdit: () => void;
|
|
533
|
+
/** Open the media-edit panel on a clip. */
|
|
534
|
+
openMediaEdit: (target: MediaEditTarget) => void;
|
|
535
|
+
/** Close the media-edit panel. */
|
|
536
|
+
closeMediaEdit: () => void;
|
|
527
537
|
/**
|
|
528
538
|
* Bump `mediaRevision`. Called after the image editor writes back to
|
|
529
539
|
* the original media path so dependent `<img>` nodes re-resolve their
|
|
@@ -541,6 +551,13 @@ type CoverImageSaveOutput = (blob: Blob, filename: string) => boolean | void | P
|
|
|
541
551
|
* as {@link CoverImageSaveOutput} (`false` keeps the export dialog open).
|
|
542
552
|
*/
|
|
543
553
|
type DashboardImageSaveOutput = CoverImageSaveOutput;
|
|
554
|
+
/** Identifies the clip the media-edit panel is open on. */
|
|
555
|
+
interface MediaEditTarget {
|
|
556
|
+
/** 1-based source line of the clip's annotation or standalone media tag, when known. */
|
|
557
|
+
sourceLine?: number;
|
|
558
|
+
src: string;
|
|
559
|
+
kind: 'audio' | 'video';
|
|
560
|
+
}
|
|
544
561
|
interface EditorContextValue extends EditorState, EditorActions {
|
|
545
562
|
/** The live Tiptap editor instance (null when WYSIWYG is not mounted) */
|
|
546
563
|
tiptapEditor: Editor | null;
|
|
@@ -579,6 +596,11 @@ interface EditorContextValue extends EditorState, EditorActions {
|
|
|
579
596
|
saveVersion: (options?: SaveVersionOptions) => Promise<SaveVersionResult>;
|
|
580
597
|
/** MediaProvider for resolving image URLs in the WYSIWYG editor */
|
|
581
598
|
mediaProvider: MediaProvider | null;
|
|
599
|
+
/**
|
|
600
|
+
* Processed-audio renders for media-edit recipes (`fx`), or null when the
|
|
601
|
+
* host disabled media edits or no media provider is wired.
|
|
602
|
+
*/
|
|
603
|
+
mediaEditRenders: MediaEditRenderManager | null;
|
|
582
604
|
/**
|
|
583
605
|
* How pasted/inserted images should be displayed in the WYSIWYG view.
|
|
584
606
|
* `'inline'` (default) lets them flow at natural size up to the editor
|
|
@@ -710,6 +732,8 @@ interface EditorProviderProps {
|
|
|
710
732
|
onSaveVersion?: (result: SaveVersionResult) => void;
|
|
711
733
|
/** MediaProvider for resolving image URLs */
|
|
712
734
|
mediaProvider?: MediaProvider | null;
|
|
735
|
+
/** Processed-audio render manager for media-edit recipes; null disables. */
|
|
736
|
+
mediaEditRenders?: MediaEditRenderManager | null;
|
|
713
737
|
/** Display mode for images in the WYSIWYG view. Defaults to `'inline'`. */
|
|
714
738
|
imageDisplayMode?: ImageDisplayMode;
|
|
715
739
|
/**
|
|
@@ -867,7 +891,7 @@ interface ViewPreferences {
|
|
|
867
891
|
/** Document vs. block-at-a-time layout. */
|
|
868
892
|
layoutMode?: LayoutMode;
|
|
869
893
|
}
|
|
870
|
-
declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, onCopyCode, 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;
|
|
894
|
+
declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, mediaEditRenders, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, onCopyCode, 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;
|
|
871
895
|
|
|
872
896
|
/**
|
|
873
897
|
* Host-supplied context sections rendered INSIDE the Monaco (raw/code)
|
|
@@ -1037,6 +1061,13 @@ interface EditorShellProps {
|
|
|
1037
1061
|
maxHeight?: string;
|
|
1038
1062
|
/** Optional MediaProvider for the Files panel. When set (even to null), a Files toggle appears in the toolbar. */
|
|
1039
1063
|
mediaProvider?: MediaProvider | null;
|
|
1064
|
+
/**
|
|
1065
|
+
* Processed-audio render manager for media-edit recipes (denoise,
|
|
1066
|
+
* de-breath, loudness — see docs/media-edits.md). Omitted: the shell creates
|
|
1067
|
+
* one for its media provider. Pass a host-owned manager to share renders
|
|
1068
|
+
* with the host's export flow; pass `null` to disable media edits.
|
|
1069
|
+
*/
|
|
1070
|
+
mediaEditRenders?: MediaEditRenderManager | null;
|
|
1040
1071
|
/**
|
|
1041
1072
|
* The workspace-scoped `ContentContainer` for this document — the
|
|
1042
1073
|
* folder that contains the doc, its `_files/` sidecar, sibling
|
|
@@ -1490,7 +1521,7 @@ interface EditorShellProps {
|
|
|
1490
1521
|
* Complete markdown editor shell with toolbar, view switcher, and three
|
|
1491
1522
|
* editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
|
|
1492
1523
|
*/
|
|
1493
|
-
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, sidePanelSlot, reviewProviders, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, 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;
|
|
1524
|
+
declare function EditorShell({ 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, statusBarSlotRight, sidePanelSlot, reviewProviders, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, 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;
|
|
1494
1525
|
|
|
1495
1526
|
/**
|
|
1496
1527
|
* Shared editor context menu.
|