@bendyline/squisq-editor-react 2.7.3 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  markdownToTiptap,
3
3
  tiptapToMarkdown
4
- } from "./chunk-K2WJYVS4.js";
4
+ } from "./chunk-TLRB3IQC.js";
5
5
 
6
6
  // src/jsonEditor/JsonEditorContext.tsx
7
7
  import { createContext, useContext, useEffect, useMemo } from "react";
@@ -10,6 +10,8 @@ var RE_BOLD_UNDER = /(?<![\p{L}\p{N}_])__(?![\s_])(.+?)(?<![\s_])__(?![\p{L}\p{N
10
10
  var RE_ITALIC_STAR = /\*(?![\s*])(.+?)(?<![\s*])\*/g;
11
11
  var RE_ITALIC_UNDER = /(?<![\p{L}\p{N}_])_(?![\s_])(.+?)(?<![\s_])_(?![\p{L}\p{N}_])/gu;
12
12
  var RE_STRIKETHROUGH = /~~(.+?)~~/g;
13
+ var RE_LEGACY_BOLD_STAR = /\*\*(?![\s*])(.+?)(?<![\s*])([ \t]+)\*\*(?=$|[^\s*])/g;
14
+ var RE_LEGACY_ITALIC_STAR = /(?<!\*)\*(?![\s*])(.+?)(?<![\s*])([ \t]+)\*(?=$|[^\s*])/g;
13
15
  var ESCAPABLE_MD_CHARS = ["*", "_", "~", "\\"];
14
16
  var RE_MD_ESCAPE = /\\([*_~\\])/g;
15
17
  var RE_INLINE_CODE = /`(.+?)`/g;
@@ -18,12 +20,7 @@ var RE_MENTION = /@\[([^\]]+?)\]\(([a-z][a-z0-9+.-]*)\\?:([^)\s]+)\)/gi;
18
20
  var RE_MENTION_TAG = /<span\b[^>]*?\bdata-mention\b[^>]*?>(?:<[^>]+>)*([^<]*)<\/span>/gi;
19
21
  var RE_ICON_MD = /\{\[([a-zA-Z0-9_:-]+)\]\}/g;
20
22
  var RE_ICON_TAG = /<i\b[^>]*?\bdata-icon="([^"]*)"[^>]*?><\/i>/gi;
21
- var RE_STRONG_TAG = /<strong>(.*?)<\/strong>/g;
22
- var RE_B_TAG = /<b>(.*?)<\/b>/g;
23
- var RE_EM_TAG = /<em>(.*?)<\/em>/g;
24
- var RE_I_TAG = /<i>(.*?)<\/i>/g;
25
- var RE_S_TAG = /<s>(.*?)<\/s>/g;
26
- var RE_DEL_TAG = /<del>(.*?)<\/del>/g;
23
+ var RE_MARK_TAG = /<(strong|b|em|i|s|del)>(.*?)<\/\1>/gs;
27
24
  var RE_CODE_TAG = /<code>(.*?)<\/code>/g;
28
25
  var RE_A_TAG = /<a\b([^>]*)>(.*?)<\/a>/g;
29
26
  var RE_IMG_TAG = /<img\b([^>]*)>/g;
@@ -814,8 +811,10 @@ function inlineToHtml(text) {
814
811
  RE_MD_ESCAPE,
815
812
  (_m, ch) => `\0ESC${ESCAPABLE_MD_CHARS.indexOf(ch)}\0`
816
813
  );
814
+ result = result.replace(RE_LEGACY_BOLD_STAR, "<strong>$1</strong>$2");
817
815
  result = result.replace(RE_BOLD_STAR, "<strong>$1</strong>");
818
816
  result = result.replace(RE_BOLD_UNDER, "<strong>$1</strong>");
817
+ result = result.replace(RE_LEGACY_ITALIC_STAR, "<em>$1</em>$2");
819
818
  result = result.replace(RE_ITALIC_STAR, "<em>$1</em>");
820
819
  result = result.replace(RE_ITALIC_UNDER, "<em>$1</em>");
821
820
  result = result.replace(RE_STRIKETHROUGH, "<s>$1</s>");
@@ -961,17 +960,23 @@ function escapeMarkdownTextNodes(html) {
961
960
  }
962
961
  return out + escapeMarkdownText(html.slice(cursor));
963
962
  }
963
+ function markdownFromMarkTags(html) {
964
+ return html.replace(RE_MARK_TAG, (_match, tag, inner) => {
965
+ const convertedInner = markdownFromMarkTags(inner);
966
+ const leading = convertedInner.match(/^\s*/)?.[0] ?? "";
967
+ const trailing = convertedInner.match(/\s*$/)?.[0] ?? "";
968
+ const content = convertedInner.slice(leading.length, convertedInner.length - trailing.length);
969
+ if (!content) return convertedInner;
970
+ const delimiter = tag === "strong" || tag === "b" ? "**" : tag === "em" || tag === "i" ? "*" : "~~";
971
+ return `${leading}${delimiter}${content}${delimiter}${trailing}`;
972
+ });
973
+ }
964
974
  function htmlToInline(html) {
965
975
  let result = html;
966
976
  result = result.replace(/<br\s*\/?>/gi, " \n");
967
977
  result = escapeMarkdownTextNodes(result);
968
978
  result = result.replace(RE_ICON_TAG, (_m, token) => `{[${token}]}`);
969
- result = result.replace(RE_STRONG_TAG, "**$1**");
970
- result = result.replace(RE_B_TAG, "**$1**");
971
- result = result.replace(RE_EM_TAG, "*$1*");
972
- result = result.replace(RE_I_TAG, "*$1*");
973
- result = result.replace(RE_S_TAG, "~~$1~~");
974
- result = result.replace(RE_DEL_TAG, "~~$1~~");
979
+ result = markdownFromMarkTags(result);
975
980
  result = result.replace(RE_CODE_TAG, "`$1`");
976
981
  result = result.replace(RE_MENTION_TAG, (match, _inner) => {
977
982
  const kind = /data-kind="([^"]*)"/i.exec(match)?.[1] ?? "";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-595XbANu.js';
2
- export { B as BlockTagVisibility, a as CodeContextSection, D as DocumentLinkCandidate, b as DocumentLinkProvider, c as EditorActions, d as EditorColorScheme, e as EditorContextValue, f as EditorMode, g as EditorProvider, h as EditorProviderProps, i as EditorShell, j as EditorShellProps, k as EditorState, l as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, m as MentionProvider, P as PreviewPanel, n as PreviewPanelProps, R as RawEditor, o as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, p as WysiwygEditor, q as WysiwygEditorProps, u as useEditorContext } from './shell-595XbANu.js';
1
+ import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-Bv6neeA6.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 EditorContextValue, h as EditorMode, i as EditorProvider, j as EditorProviderProps, k as EditorShell, l as EditorShellProps, m as EditorState, n as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, o as MentionProvider, P as PreviewPanel, p as PreviewPanelProps, R as RawEditor, q as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, r as WysiwygEditor, s as WysiwygEditorProps, u as useEditorContext } from './shell-Bv6neeA6.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';
@@ -8,7 +8,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';
10
10
  import { IconFamily } from '@bendyline/squisq/icons';
11
- import { CoverSlideTemplate, CoverSlidePlayback, ConnectorRouting, AsciiDiagram, Tree, AsciiTimeline, AsciiTimelineSide, AsciiTimelineMarker } from '@bendyline/squisq/doc';
11
+ import { CoverSlideTemplate, CoverSlidePlayback, DashboardStyleId, DashboardLayoutSummary, ConnectorRouting, AsciiDiagram, Tree, AsciiTimeline, AsciiTimelineSide, AsciiTimelineMarker } from '@bendyline/squisq/doc';
12
12
  export { BuildPreviewDocOptions, buildPreviewDoc, documentTitleFromFileName } from '@bendyline/squisq/doc';
13
13
  import { MarkdownWrapState } from '@bendyline/squisq/markdown';
14
14
  import * as monaco_editor from 'monaco-editor';
@@ -572,7 +572,7 @@ declare function EmojiPicker({ open, onSelect, onClose, anchorRef, className, st
572
572
  * DocumentSettingsDialog
573
573
  *
574
574
  * Modal editor for the frontmatter values that Squisq currently
575
- * understands: document title plus the persisted preview keys
575
+ * understands: document title and cover subtitle plus the persisted preview keys
576
576
  * (`squisq-theme`, `squisq-transform`, `squisq-captions`). Writes back
577
577
  * to the same `setFrontmatterValues` channel that `PreviewControls`
578
578
  * uses, so any change made here is reflected in the play-mode controls
@@ -842,6 +842,20 @@ interface PreviewSettings {
842
842
  activeVideoLoop: boolean;
843
843
  /** Enable/disable automatic Video-mode playback restart. */
844
844
  setVideoLoopEnabled: (enabled: boolean) => void;
845
+ /** Dashboard layout id, or `'auto'` for the block-count auto-pick. */
846
+ activeDashboardLayout: string;
847
+ /** Set (and persist) the dashboard layout; null resets to auto. */
848
+ setDashboardLayout: (id: string | null) => void;
849
+ /** Whether the dashboard renders the document-title band. */
850
+ activeDashboardTitle: boolean;
851
+ /** Enable/disable (and persist) the dashboard title band. */
852
+ setDashboardTitleEnabled: (enabled: boolean) => void;
853
+ /** Dashboard cell style variant — the dressing axis beside the layout. */
854
+ activeDashboardStyle: DashboardStyleId;
855
+ /** Set (and persist) the dashboard cell style; null resets to `basic`. */
856
+ setDashboardStyle: (id: string | null) => void;
857
+ /** Layouts available to the doc: customs first, then built-ins. */
858
+ dashboardLayoutOptions: DashboardLayoutSummary[];
845
859
  /** User-authored themes (doc + browser library) for the picker's "Custom" group. */
846
860
  customThemes: Theme[];
847
861
  /** Open the custom-theme designer for a theme (or null to create a new one). */
package/dist/index.js CHANGED
@@ -205,15 +205,15 @@ import {
205
205
  usePreviewSettings,
206
206
  useTimelineData,
207
207
  useTreeViewData
208
- } from "./chunk-7K4LSSNL.js";
208
+ } from "./chunk-53PXOIMU.js";
209
209
  import "./chunk-V4NBQF5C.js";
210
210
  import {
211
211
  JsonEditor
212
- } from "./chunk-YPRX32GY.js";
212
+ } from "./chunk-SAYCG257.js";
213
213
  import {
214
214
  markdownToTiptap,
215
215
  tiptapToMarkdown
216
- } from "./chunk-K2WJYVS4.js";
216
+ } from "./chunk-TLRB3IQC.js";
217
217
  import {
218
218
  ImageEditor,
219
219
  ImageViewer,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  JsonEditor
3
- } from "../chunk-YPRX32GY.js";
4
- import "../chunk-K2WJYVS4.js";
3
+ } from "../chunk-SAYCG257.js";
4
+ import "../chunk-TLRB3IQC.js";
5
5
  export {
6
6
  JsonEditor
7
7
  };
@@ -1,4 +1,4 @@
1
- export { B as BlockTagVisibility, D as DocumentLinkCandidate, b as DocumentLinkProvider, c as EditorActions, d as EditorColorScheme, e as EditorContextValue, E as EditorHostMode, f as EditorMode, g as EditorProvider, h as EditorProviderProps, i as EditorShell, j as EditorShellProps, k as EditorState, l as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, m as MentionProvider, P as PreviewPanel, n as PreviewPanelProps, R as RawEditor, o as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, p as WysiwygEditor, q as WysiwygEditorProps, u as useEditorContext } from '../shell-595XbANu.js';
1
+ export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextValue, E as EditorHostMode, h as EditorMode, i as EditorProvider, j as EditorProviderProps, k as EditorShell, l as EditorShellProps, m as EditorState, n as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, o as MentionProvider, P as PreviewPanel, p as PreviewPanelProps, R as RawEditor, q as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, r as WysiwygEditor, s as WysiwygEditorProps, u as useEditorContext } from '../shell-Bv6neeA6.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@bendyline/squisq/schemas';
@@ -5,9 +5,9 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContext
8
- } from "../chunk-7K4LSSNL.js";
8
+ } from "../chunk-53PXOIMU.js";
9
9
  import "../chunk-V4NBQF5C.js";
10
- import "../chunk-K2WJYVS4.js";
10
+ import "../chunk-TLRB3IQC.js";
11
11
  import "../chunk-V44VP242.js";
12
12
  import "../chunk-V3J5S7X6.js";
13
13
  import "../chunk-GS7QWYFT.js";
@@ -301,6 +301,16 @@ interface EditorActions {
301
301
  */
302
302
  bumpMediaRevision: () => void;
303
303
  }
304
+ /**
305
+ * Host-owned persistence for a rendered cover image. Return `false` when the
306
+ * user cancels so the export modal stays open without reporting an error.
307
+ */
308
+ type CoverImageSaveOutput = (blob: Blob, filename: string) => boolean | void | Promise<boolean | void>;
309
+ /**
310
+ * Host-owned persistence for a rendered dashboard image — the same contract
311
+ * as {@link CoverImageSaveOutput} (`false` keeps the export dialog open).
312
+ */
313
+ type DashboardImageSaveOutput = CoverImageSaveOutput;
304
314
  interface EditorContextValue extends EditorState, EditorActions {
305
315
  /** The live Tiptap editor instance (null when WYSIWYG is not mounted) */
306
316
  tiptapEditor: Editor | null;
@@ -382,6 +392,10 @@ interface EditorContextValue extends EditorState, EditorActions {
382
392
  * document has no frontmatter `title:`.
383
393
  */
384
394
  fileName: string | undefined;
395
+ /** Optional host save flow for cover-slide image exports. */
396
+ saveCoverImageOutput: CoverImageSaveOutput | undefined;
397
+ /** Optional host save flow for dashboard image exports. */
398
+ saveDashboardImageOutput: DashboardImageSaveOutput | undefined;
385
399
  }
386
400
  type ImageDisplayMode = 'inline' | 'thumbnail';
387
401
  /**
@@ -481,6 +495,10 @@ interface EditorProviderProps {
481
495
  * language and decide between markdown vs. code mode.
482
496
  */
483
497
  fileName?: string;
498
+ /** Optional host save flow for cover-slide image exports. */
499
+ saveCoverImageOutput?: CoverImageSaveOutput;
500
+ /** Optional host save flow for dashboard image exports. */
501
+ saveDashboardImageOutput?: DashboardImageSaveOutput;
484
502
  /** Explicit Monaco language ID — wins over the fileName-derived one. */
485
503
  language?: string;
486
504
  /**
@@ -569,7 +587,7 @@ interface ViewPreferences {
569
587
  /** Document vs. block-at-a-time layout. */
570
588
  layoutMode?: LayoutMode;
571
589
  }
572
- declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
590
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, 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;
573
591
 
574
592
  /**
575
593
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -908,6 +926,16 @@ interface EditorShellProps {
908
926
  * experience. Omit to get today's markdown behavior unchanged.
909
927
  */
910
928
  fileName?: string;
929
+ /**
930
+ * Optional host save flow for cover-slide image exports. When omitted, the
931
+ * editor uses the browser File System Access picker or download fallback.
932
+ */
933
+ saveCoverImageOutput?: CoverImageSaveOutput;
934
+ /**
935
+ * Optional host save flow for dashboard image exports. When omitted, the
936
+ * editor uses the browser File System Access picker or download fallback.
937
+ */
938
+ saveDashboardImageOutput?: DashboardImageSaveOutput;
911
939
  /**
912
940
  * Explicit Monaco language ID override (e.g. `'typescript'`,
913
941
  * `'python'`, `'json'`). Wins over the language derived from
@@ -1108,7 +1136,7 @@ interface EditorShellProps {
1108
1136
  * Complete markdown editor shell with toolbar, view switcher, and three
1109
1137
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1110
1138
  */
1111
- 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, language, findMode, onFindModeChange, mentionProvider, 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;
1139
+ 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, 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;
1112
1140
 
1113
1141
  /**
1114
1142
  * RawEditor
@@ -1198,4 +1226,4 @@ interface PreviewPanelProps {
1198
1226
  */
1199
1227
  declare function PreviewPanel({ basePath, className, workspaceContainer, onLinkClick, showCodeCopyButton, onCopyCode, }: PreviewPanelProps): react_jsx_runtime.JSX.Element;
1200
1228
 
1201
- export { type BlockTagVisibility as B, type CodeContext as C, type DocumentLinkCandidate as D, type EditorHostMode as E, type ImageDisplayMode as I, type LayoutMode as L, type MentionCandidate as M, PreviewPanel as P, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, type ViewPreferences as V, type WriteCanvasSettings as W, type CodeContextSection as a, type DocumentLinkProvider as b, type EditorActions as c, type EditorColorScheme as d, type EditorContextValue as e, type EditorMode as f, EditorProvider as g, type EditorProviderProps as h, EditorShell as i, type EditorShellProps as j, type EditorState as k, type EditorView as l, type MentionProvider as m, type PreviewPanelProps as n, type RawEditorProps as o, WysiwygEditor as p, type WysiwygEditorProps as q, useEditorContext as u };
1229
+ export { type BlockTagVisibility as B, type CodeContext as C, type DashboardImageSaveOutput as D, type EditorHostMode as E, type ImageDisplayMode as I, type LayoutMode as L, type MentionCandidate as M, PreviewPanel as P, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, type ViewPreferences as V, type WriteCanvasSettings as W, type CodeContextSection as a, type CoverImageSaveOutput as b, type DocumentLinkCandidate as c, type DocumentLinkProvider as d, type EditorActions as e, type EditorColorScheme as f, type EditorContextValue as g, type EditorMode as h, EditorProvider as i, type EditorProviderProps as j, EditorShell as k, type EditorShellProps as l, type EditorState as m, type EditorView as n, type MentionProvider as o, type PreviewPanelProps as p, type RawEditorProps as q, WysiwygEditor as r, type WysiwygEditorProps as s, useEditorContext as u };
@@ -9715,6 +9715,19 @@
9715
9715
  background: #f5f5f5;
9716
9716
  padding: 16px;
9717
9717
  }
9718
+ .squisq-dashboard-fit {
9719
+ width: 100%;
9720
+ height: 100%;
9721
+ min-width: 0;
9722
+ min-height: 0;
9723
+ container-type: size;
9724
+ display: flex;
9725
+ align-items: center;
9726
+ justify-content: center;
9727
+ }
9728
+ .squisq-dashboard-fit .squisq-dashboard {
9729
+ --squisq-dashboard-fit-width: min(100%, calc(100cqh * var(--squisq-dashboard-aspect, 1.7778)));
9730
+ }
9718
9731
  .squisq-editor-shell[data-print-preview=true] > .squisq-status-bar,
9719
9732
  .squisq-editor-shell[data-print-preview=true] > .squisq-timeline,
9720
9733
  .squisq-editor-shell[data-print-preview=true] .squisq-media-bin,
@@ -9807,6 +9820,71 @@
9807
9820
  color: #6b7280;
9808
9821
  font: 500 14px/1.4 var(--squisq-ux-font, sans-serif);
9809
9822
  }
9823
+ .squisq-print-preview--flashcards {
9824
+ display: grid;
9825
+ gap: 24px;
9826
+ color: var(--squisq-print-flashcard-text);
9827
+ }
9828
+ .squisq-print-flashcard-sheet {
9829
+ width: min(1100px, 100%);
9830
+ aspect-ratio: 11 / 8.5;
9831
+ margin-inline: auto;
9832
+ padding: 4%;
9833
+ background: var(--squisq-print-flashcard-bg);
9834
+ box-shadow: 0 8px 30px rgb(15 23 42 / 18%);
9835
+ break-after: page;
9836
+ }
9837
+ .squisq-print-flashcard-sheet > header {
9838
+ display: flex;
9839
+ justify-content: space-between;
9840
+ margin-bottom: 2%;
9841
+ color: var(--squisq-print-flashcard-muted);
9842
+ font-size: 12px;
9843
+ }
9844
+ .squisq-print-flashcard-pair {
9845
+ display: grid;
9846
+ grid-template-columns: 1fr 1fr;
9847
+ gap: 3%;
9848
+ height: 88%;
9849
+ }
9850
+ .squisq-print-flashcard-face {
9851
+ overflow: hidden;
9852
+ border: 1px solid color-mix(in srgb, var(--squisq-print-flashcard-text) 18%, transparent);
9853
+ border-radius: 16px;
9854
+ padding: 7%;
9855
+ background: var(--squisq-print-flashcard-surface);
9856
+ }
9857
+ .squisq-print-flashcard-face > small,
9858
+ .squisq-print-flashcard-explanation > small {
9859
+ display: block;
9860
+ margin-bottom: 12px;
9861
+ color: var(--squisq-print-flashcard-accent);
9862
+ font-weight: 800;
9863
+ letter-spacing: 0.12em;
9864
+ text-transform: uppercase;
9865
+ }
9866
+ .squisq-print-flashcard-face .squisq-flashcards__content-title {
9867
+ margin: 0 0 0.5em;
9868
+ font-size: clamp(20px, 2.4vw, 34px);
9869
+ }
9870
+ .squisq-print-flashcard-face .squisq-md {
9871
+ font-size: clamp(13px, 1.4vw, 18px);
9872
+ line-height: 1.45;
9873
+ }
9874
+ .squisq-print-flashcard-choices {
9875
+ display: grid;
9876
+ gap: 8px;
9877
+ margin: 18px 0 0;
9878
+ padding-left: 24px;
9879
+ }
9880
+ .squisq-print-flashcard-choices .squisq-flashcards__content-title {
9881
+ font-size: 16px;
9882
+ }
9883
+ .squisq-print-flashcard-explanation {
9884
+ margin-top: 20px;
9885
+ border-top: 1px solid color-mix(in srgb, var(--squisq-print-flashcard-text) 16%, transparent);
9886
+ padding-top: 16px;
9887
+ }
9810
9888
  @container squisq-toolbar (max-width: 820px) {
9811
9889
  .squisq-print-trigger > span,
9812
9890
  .squisq-print-toolbar-title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "2.7.3",
3
+ "version": "2.9.0",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -84,10 +84,10 @@
84
84
  "react-dom": "^18.0.0 || ^19.0.0"
85
85
  },
86
86
  "dependencies": {
87
- "@bendyline/squisq": "2.7.1",
88
- "@bendyline/squisq-formats": "2.4.4",
89
- "@bendyline/squisq-react": "2.7.2",
90
- "@bendyline/squisq-video-react": "2.3.5",
87
+ "@bendyline/squisq": "2.9.0",
88
+ "@bendyline/squisq-formats": "2.4.6",
89
+ "@bendyline/squisq-react": "2.9.0",
90
+ "@bendyline/squisq-video-react": "2.4.1",
91
91
  "@fortawesome/fontawesome-free": "7.2.0",
92
92
  "@tiptap/core": "2.27.2",
93
93
  "@tiptap/extension-heading": "2.27.2",