oasis-editor 0.0.13 → 0.0.15

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
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as findFootnoteReference, aq as FOOTNOTE_MARKER_GUTTER_PX, ar as resolveImporterForFile, as as createEditorStateFromDocument, at as getDocumentParagraphsCanonical, au as getToolbarStyleState, av as STANDARD_FONT_SIZES_PT, aw as fontSizePxToPt, ax as probeLocalFontFamilies, ay as createInitialEditorState, az as parseFontSizePtToPx, aA as formatFontSizePt, aB as listKindForTag, aC as isParagraphTag, aD as collectInlineRuns, aE as parseParagraphStyle, aF as t, aG as preciseFontModeVersion, aH as isPreciseFontModeEnabled, aI as togglePreciseFontMode, aJ as nextFontSizePt, aK as previousFontSizePt, aL as fontSizePtToPx, aM as createDefaultToolbarPreset, aN as defaultMenuItems, aO as MenuRegistry, aP as createToolbarRegistry, aQ as Editor, aR as resolveCommandRef, aS as commandRefName, aT as InlineShell, aU as BalloonShell, aV as DocumentShell, aW as createMemo, aX as getCaretRectFromSnapshot, aY as getParagraphRectFromSnapshot, aZ as createComponent, a_ as CaretOverlay, a$ as Show, b0 as createRenderEffect, b1 as style, b2 as setAttribute, b3 as setStyleProperty, b4 as memo, b5 as template, b6 as insert, b7 as use, b8 as addEventListener, b9 as Dialog, ba as delegateEvents, bb as className, bc as For, bd as UNDERLINE_STYLE_OPTIONS, be as Tabs, bf as measureParagraphMinContentWidthPx, bg as getEditableBlocksForZone, bh as findParagraphLocation, bi as createSectionBoundaryParagraph, bj as normalizePageSettings, bk as DEFAULT_EDITOR_PAGE_SETTINGS, bl as markStart, bm as markEnd, bn as getParagraphEntries, bo as getParagraphById, bp as PluginUiHost, bq as OasisEditorEditor, br as perfTimer, bs as OasisBrandMark, bt as setPreciseFontPreference, bu as setWelcomeSeen, bv as enablePreciseFontMode, bw as createOasisEditorClient, bx as setLocale, by as startLongTaskObserver, bz as installGlobalReport, bA as applyStoredPreciseFontPreference, bB as getWelcomeSeen, bC as isLocalFontAccessSupported, bD as EDITOR_SCROLL_PADDING_PX, bE as Toolbar, bF as OasisEditorLoading, bG as createEditorLogger, bH as getCachedCanvasImage, bI as registerDomStatsSurface } from "./index-CWev1Jg0.js";
4
+ import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as findFootnoteReference, aq as FOOTNOTE_MARKER_GUTTER_PX, ar as resolveImporterForFile, as as createEditorStateFromDocument, at as getDocumentParagraphsCanonical, au as getToolbarStyleState, av as STANDARD_FONT_SIZES_PT, aw as fontSizePxToPt, ax as probeLocalFontFamilies, ay as createInitialEditorState, az as parseFontSizePtToPx, aA as formatFontSizePt, aB as listKindForTag, aC as isParagraphTag, aD as collectInlineRuns, aE as parseParagraphStyle, aF as t, aG as preciseFontModeVersion, aH as isPreciseFontModeEnabled, aI as togglePreciseFontMode, aJ as nextFontSizePt, aK as previousFontSizePt, aL as fontSizePtToPx, aM as createDefaultToolbarPreset, aN as defaultMenuItems, aO as MenuRegistry, aP as createToolbarRegistry, aQ as Editor, aR as resolveCommandRef, aS as commandRefName, aT as InlineShell, aU as BalloonShell, aV as DocumentShell, aW as createMemo, aX as getCaretRectFromSnapshot, aY as getParagraphRectFromSnapshot, aZ as createComponent, a_ as CaretOverlay, a$ as Show, b0 as createRenderEffect, b1 as style, b2 as setAttribute, b3 as setStyleProperty, b4 as memo, b5 as template, b6 as insert, b7 as use, b8 as addEventListener, b9 as Dialog, ba as delegateEvents, bb as className, bc as For, bd as UNDERLINE_STYLE_OPTIONS, be as Tabs, bf as measureParagraphMinContentWidthPx, bg as getEditableBlocksForZone, bh as findParagraphLocation, bi as createSectionBoundaryParagraph, bj as normalizePageSettings, bk as DEFAULT_EDITOR_PAGE_SETTINGS, bl as markStart, bm as markEnd, bn as getParagraphEntries, bo as getParagraphById, bp as PluginUiHost, bq as OasisEditorEditor, br as perfTimer, bs as OasisBrandMark, bt as setPreciseFontPreference, bu as setWelcomeSeen, bv as enablePreciseFontMode, bw as createOasisEditorClient, bx as setLocale, by as startLongTaskObserver, bz as installGlobalReport, bA as applyStoredPreciseFontPreference, bB as getWelcomeSeen, bC as isLocalFontAccessSupported, bD as EDITOR_SCROLL_PADDING_PX, bE as Toolbar, bF as OasisEditorLoading, bG as createEditorLogger, bH as getCachedCanvasImage, bI as registerDomStatsSurface } from "./index-Dqm-2RUA.js";
5
5
  function getSelectedObjectRun(state, predicate) {
6
6
  const normalized = normalizeSelection(state);
7
7
  if (normalized.isCollapsed || normalized.startIndex !== normalized.endIndex || normalized.endParagraphOffset - normalized.startParagraphOffset !== 1) {
@@ -41131,6 +41131,25 @@ function buildParagraphAndSectionCommands({
41131
41131
  (p) => (paragraph.setIndentHanging(numOrNull(p)), true),
41132
41132
  () => s().indentHanging
41133
41133
  ),
41134
+ setSpecialIndent: actionCommand(
41135
+ "setSpecialIndent",
41136
+ (p) => {
41137
+ const payload = p ?? {};
41138
+ paragraph.setSpecialIndent(
41139
+ payload.kind ?? "none",
41140
+ numOrNull(payload.value)
41141
+ );
41142
+ },
41143
+ () => {
41144
+ const firstLine = Number(s().indentFirstLine);
41145
+ const hanging = Number(s().indentHanging);
41146
+ const kind = Number.isFinite(hanging) && hanging > 0 ? "hanging" : Number.isFinite(firstLine) && firstLine > 0 ? "firstLine" : "none";
41147
+ return {
41148
+ isActive: kind !== "none",
41149
+ value: kind
41150
+ };
41151
+ }
41152
+ ),
41134
41153
  setParagraphShading: valueCommand(
41135
41154
  "setParagraphShading",
41136
41155
  (p) => (paragraph.setShading(p ?? null), true),
@@ -41158,6 +41177,10 @@ function buildParagraphAndSectionCommands({
41158
41177
  () => section.toggleOrientation(),
41159
41178
  () => ({ isActive: section.isLandscape() })
41160
41179
  ),
41180
+ setOrientation: actionCommand(
41181
+ "setOrientation",
41182
+ (p) => section.setOrientation(p)
41183
+ ),
41161
41184
  sectionBreakNextPage: actionCommand(
41162
41185
  "sectionBreakNextPage",
41163
41186
  () => section.breakNextPage()
@@ -41516,6 +41539,23 @@ function createEditorEssentialsRuntimePlugin(options) {
41516
41539
  "indentHanging",
41517
41540
  value
41518
41541
  ),
41542
+ setSpecialIndent: (kind, value) => {
41543
+ const resolvedValue = value ?? 48;
41544
+ options.applyTransactionalState(
41545
+ (current) => {
41546
+ let next = setParagraphStyle(current, "indentFirstLine", null);
41547
+ next = setParagraphStyle(next, "indentHanging", null);
41548
+ if (kind === "firstLine") {
41549
+ next = setParagraphStyle(next, "indentFirstLine", resolvedValue);
41550
+ } else if (kind === "hanging") {
41551
+ next = setParagraphStyle(next, "indentHanging", resolvedValue);
41552
+ }
41553
+ return next;
41554
+ },
41555
+ { mergeKey: "specialIndent" }
41556
+ );
41557
+ options.focusInput();
41558
+ },
41519
41559
  setShading: (value) => options.commandsController.applyParagraphStyleCommand("shading", value),
41520
41560
  applyBorders: () => {
41521
41561
  const border = {
@@ -41553,19 +41593,28 @@ function createEditorEssentialsRuntimePlugin(options) {
41553
41593
  const section = ((_a = options.state().document.sections) == null ? void 0 : _a[idx]) ?? options.state().document;
41554
41594
  return ((_b = section == null ? void 0 : section.pageSettings) == null ? void 0 : _b.orientation) === "landscape";
41555
41595
  },
41556
- toggleOrientation: () => {
41557
- var _a, _b;
41596
+ setOrientation: (orientation) => {
41597
+ var _a;
41558
41598
  const idx = getActiveSectionIndex(options.state());
41559
41599
  const section = ((_a = options.state().document.sections) == null ? void 0 : _a[idx]) ?? options.state().document;
41560
41600
  if (!section) return;
41561
- const current = ((_b = section.pageSettings) == null ? void 0 : _b.orientation) ?? "portrait";
41562
41601
  options.commandsController.applyUpdateSectionSettingsCommand(idx, {
41563
41602
  pageSettings: {
41564
41603
  ...section.pageSettings,
41565
- orientation: current === "portrait" ? "landscape" : "portrait"
41604
+ orientation
41566
41605
  }
41567
41606
  });
41568
41607
  },
41608
+ toggleOrientation: () => {
41609
+ var _a, _b;
41610
+ const idx = getActiveSectionIndex(options.state());
41611
+ const section = ((_a = options.state().document.sections) == null ? void 0 : _a[idx]) ?? options.state().document;
41612
+ if (!section) return;
41613
+ const current = ((_b = section.pageSettings) == null ? void 0 : _b.orientation) ?? "portrait";
41614
+ essentialsSection.setOrientation(
41615
+ current === "portrait" ? "landscape" : "portrait"
41616
+ );
41617
+ },
41569
41618
  breakNextPage: () => options.commandsController.applyInsertSectionBreakCommand("nextPage"),
41570
41619
  breakContinuous: () => options.commandsController.applyInsertSectionBreakCommand("continuous"),
41571
41620
  setPageMargins: (margins) => {
@@ -1,2 +1,2 @@
1
- export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -11,6 +11,10 @@ export interface SetFontSizePayload {
11
11
  }
12
12
  export interface SetPageMarginsPayload extends Partial<EditorPageMargins> {
13
13
  }
14
+ export interface SetSpecialIndentPayload {
15
+ kind: "none" | "firstLine" | "hanging";
16
+ value?: number | null;
17
+ }
14
18
  export interface OasisCommandPayloads {
15
19
  selectAll: undefined;
16
20
  insertFootnote: undefined;
@@ -72,12 +76,14 @@ export interface OasisCommandPayloads {
72
76
  setIndentRight: number | null;
73
77
  setIndentFirstLine: number | null;
74
78
  setIndentHanging: number | null;
79
+ setSpecialIndent: SetSpecialIndentPayload;
75
80
  setParagraphShading: string | null;
76
81
  applyParagraphBorders: undefined;
77
82
  setLineHeight: number | null;
78
83
  setListFormat: string;
79
84
  setListStartAt: number | null;
80
85
  toggleOrientation: undefined;
86
+ setOrientation: "portrait" | "landscape";
81
87
  sectionBreakNextPage: undefined;
82
88
  sectionBreakContinuous: undefined;
83
89
  setPageMargins: SetPageMarginsPayload;
@@ -42,6 +42,10 @@ export declare const en: {
42
42
  "toolbar.decreaseIndent": string;
43
43
  "toolbar.listFormat": string;
44
44
  "toolbar.listStartAt": string;
45
+ "toolbar.specialIndent": string;
46
+ "toolbar.specialIndentNone": string;
47
+ "toolbar.specialIndentFirstLine": string;
48
+ "toolbar.specialIndentHanging": string;
45
49
  "toolbar.formatDecimal": string;
46
50
  "toolbar.formatLowerLetter": string;
47
51
  "toolbar.formatUpperLetter": string;
@@ -138,6 +142,9 @@ export declare const en: {
138
142
  "paragraph.preview": string;
139
143
  "paragraph.previewText": string;
140
144
  "section.orient": string;
145
+ "section.orientation": string;
146
+ "section.portrait": string;
147
+ "section.landscape": string;
141
148
  "section.pageSetup": string;
142
149
  "section.toggleOrientation": string;
143
150
  "section.margins": string;
@@ -352,6 +359,7 @@ export declare const en: {
352
359
  "menu.view.outline": string;
353
360
  "menu.view.fullscreen": string;
354
361
  "menu.insert": string;
362
+ "menu.layout": string;
355
363
  "menu.format": string;
356
364
  "menu.format.align": string;
357
365
  "menu.format.text": string;
@@ -42,6 +42,10 @@ export declare const ptBR: {
42
42
  "toolbar.decreaseIndent": string;
43
43
  "toolbar.listFormat": string;
44
44
  "toolbar.listStartAt": string;
45
+ "toolbar.specialIndent": string;
46
+ "toolbar.specialIndentNone": string;
47
+ "toolbar.specialIndentFirstLine": string;
48
+ "toolbar.specialIndentHanging": string;
45
49
  "toolbar.formatDecimal": string;
46
50
  "toolbar.formatLowerLetter": string;
47
51
  "toolbar.formatUpperLetter": string;
@@ -138,6 +142,9 @@ export declare const ptBR: {
138
142
  "paragraph.preview": string;
139
143
  "paragraph.previewText": string;
140
144
  "section.orient": string;
145
+ "section.orientation": string;
146
+ "section.portrait": string;
147
+ "section.landscape": string;
141
148
  "section.pageSetup": string;
142
149
  "section.toggleOrientation": string;
143
150
  "section.margins": string;
@@ -352,6 +359,7 @@ export declare const ptBR: {
352
359
  "menu.view.outline": string;
353
360
  "menu.view.fullscreen": string;
354
361
  "menu.insert": string;
362
+ "menu.layout": string;
355
363
  "menu.format": string;
356
364
  "menu.format.align": string;
357
365
  "menu.format.text": string;
@@ -1458,6 +1458,10 @@ const en = {
1458
1458
  "toolbar.decreaseIndent": "Decrease indent (Shift+Tab)",
1459
1459
  "toolbar.listFormat": "Change list numbering format",
1460
1460
  "toolbar.listStartAt": "Start numbering at",
1461
+ "toolbar.specialIndent": "Special Indent",
1462
+ "toolbar.specialIndentNone": "None",
1463
+ "toolbar.specialIndentFirstLine": "First Line",
1464
+ "toolbar.specialIndentHanging": "Hanging",
1461
1465
  "toolbar.formatDecimal": "1, 2, 3",
1462
1466
  "toolbar.formatLowerLetter": "a, b, c",
1463
1467
  "toolbar.formatUpperLetter": "A, B, C",
@@ -1558,6 +1562,9 @@ const en = {
1558
1562
  "paragraph.previewText": "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.",
1559
1563
  // Section
1560
1564
  "section.orient": "Orient",
1565
+ "section.orientation": "Orientation",
1566
+ "section.portrait": "Portrait",
1567
+ "section.landscape": "Landscape",
1561
1568
  "section.pageSetup": "Page Setup",
1562
1569
  "section.toggleOrientation": "Toggle Orientation",
1563
1570
  "section.margins": "Margins",
@@ -1780,6 +1787,7 @@ const en = {
1780
1787
  "menu.view.outline": "Show Outline",
1781
1788
  "menu.view.fullscreen": "Full Screen",
1782
1789
  "menu.insert": "Insert",
1790
+ "menu.layout": "Layout",
1783
1791
  "menu.format": "Format",
1784
1792
  "menu.format.align": "Align",
1785
1793
  "menu.format.text": "Text",
@@ -1850,6 +1858,10 @@ const ptBR = {
1850
1858
  "toolbar.decreaseIndent": "Diminuir recuo (Shift+Tab)",
1851
1859
  "toolbar.listFormat": "Alterar formato de numeração",
1852
1860
  "toolbar.listStartAt": "Iniciar numeração em",
1861
+ "toolbar.specialIndent": "Recuo especial",
1862
+ "toolbar.specialIndentNone": "Nenhum",
1863
+ "toolbar.specialIndentFirstLine": "Primeira linha",
1864
+ "toolbar.specialIndentHanging": "Deslocamento",
1853
1865
  "toolbar.formatDecimal": "1, 2, 3",
1854
1866
  "toolbar.formatLowerLetter": "a, b, c",
1855
1867
  "toolbar.formatUpperLetter": "A, B, C",
@@ -1950,6 +1962,9 @@ const ptBR = {
1950
1962
  "paragraph.previewText": "Texto de Exemplo Texto de Exemplo Texto de Exemplo Texto de Exemplo Texto de Exemplo Texto de Exemplo.",
1951
1963
  // Section
1952
1964
  "section.orient": "Orient",
1965
+ "section.orientation": "Orientação",
1966
+ "section.portrait": "Retrato",
1967
+ "section.landscape": "Paisagem",
1953
1968
  "section.pageSetup": "Configurações de Página",
1954
1969
  "section.toggleOrientation": "Alternar Orientação",
1955
1970
  "section.margins": "Margens",
@@ -2172,6 +2187,7 @@ const ptBR = {
2172
2187
  "menu.view.outline": "Mostrar Estrutura",
2173
2188
  "menu.view.fullscreen": "Tela Inteira",
2174
2189
  "menu.insert": "Inserir",
2190
+ "menu.layout": "Layout",
2175
2191
  "menu.format": "Formatar",
2176
2192
  "menu.format.align": "Alinhar",
2177
2193
  "menu.format.text": "Texto",
@@ -2310,7 +2326,7 @@ function OasisEditorAppLazy(props = {}) {
2310
2326
  onCleanup(() => {
2311
2327
  cancelled = true;
2312
2328
  });
2313
- import("./OasisEditorApp-DYcAe_1n.js").then((m) => {
2329
+ import("./OasisEditorApp-C8YG4Yzr.js").then((m) => {
2314
2330
  cancelled = true;
2315
2331
  setProgress(1);
2316
2332
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -4277,12 +4293,14 @@ const OASIS_BUILTIN_COMMANDS = [
4277
4293
  "setIndentRight",
4278
4294
  "setIndentFirstLine",
4279
4295
  "setIndentHanging",
4296
+ "setSpecialIndent",
4280
4297
  "setParagraphShading",
4281
4298
  "applyParagraphBorders",
4282
4299
  "setLineHeight",
4283
4300
  "setListFormat",
4284
4301
  "setListStartAt",
4285
4302
  "toggleOrientation",
4303
+ "setOrientation",
4286
4304
  "sectionBreakNextPage",
4287
4305
  "sectionBreakContinuous",
4288
4306
  "setPageMargins",
@@ -4347,10 +4365,12 @@ class MenuRegistry {
4347
4365
  }
4348
4366
  }
4349
4367
  const defaultMenuRegistry = new MenuRegistry();
4350
- var _tmpl$$P = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$w = /* @__PURE__ */ template(`<i>`);
4368
+ var _tmpl$$P = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$w = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"aria-hidden=true><g fill=currentColor><path d="M3.375 4.875 L7.125 8.625 L3.375 12.375 L2.25 11.25 L4.875 8.625 L2.25 6 Z"></path><rect x=10.125 y=6 width=9 height=1.6875 rx=0.25></rect><rect x=5.625 y=10.875 width=13.5 height=1.6875 rx=0.25></rect><rect x=5.625 y=15.75 width=13.5 height=1.6875 rx=0.25>`), _tmpl$3$k = /* @__PURE__ */ template(`<i>`);
4351
4369
  const FootnoteIcon = () => _tmpl$$P();
4370
+ const SpecialIndentFirstLineIcon = () => _tmpl$2$w();
4352
4371
  const CUSTOM_ICONS = {
4353
- footnote: FootnoteIcon
4372
+ footnote: FootnoteIcon,
4373
+ specialIndentFirstLine: SpecialIndentFirstLineIcon
4354
4374
  };
4355
4375
  function getCustomIcon(name) {
4356
4376
  return name ? CUSTOM_ICONS[name] : void 0;
@@ -4362,9 +4382,9 @@ function ToolIcon(props) {
4362
4382
  },
4363
4383
  get fallback() {
4364
4384
  return (() => {
4365
- var _el$2 = _tmpl$2$w();
4366
- createRenderEffect(() => setAttribute(_el$2, "data-lucide", props.name));
4367
- return _el$2;
4385
+ var _el$3 = _tmpl$3$k();
4386
+ createRenderEffect(() => setAttribute(_el$3, "data-lucide", props.name));
4387
+ return _el$3;
4368
4388
  })();
4369
4389
  },
4370
4390
  children: (render2) => render2()()
@@ -4667,6 +4687,27 @@ const defaultMenuItems = [
4667
4687
  icon: "list-ordered"
4668
4688
  },
4669
4689
  { id: "format_clear", path: "Format/Clear formatting", hidden: true },
4690
+ // Layout
4691
+ {
4692
+ id: "layout_orientation",
4693
+ path: "Layout/Orientation",
4694
+ labelKey: "section.orientation",
4695
+ icon: "layout"
4696
+ },
4697
+ {
4698
+ id: "layout_orientation_portrait",
4699
+ path: "Layout/Orientation/Portrait",
4700
+ labelKey: "section.portrait",
4701
+ command: { name: "setOrientation", payload: "portrait" },
4702
+ icon: (host) => host.commands.state("toggleOrientation").isActive ? "" : "check"
4703
+ },
4704
+ {
4705
+ id: "layout_orientation_landscape",
4706
+ path: "Layout/Orientation/Landscape",
4707
+ labelKey: "section.landscape",
4708
+ command: { name: "setOrientation", payload: "landscape" },
4709
+ icon: (host) => host.commands.state("toggleOrientation").isActive ? "check" : ""
4710
+ },
4670
4711
  // Tools
4671
4712
  {
4672
4713
  id: "tools_wordcount",
@@ -4691,7 +4732,7 @@ const defaultMenuItems = [
4691
4732
  }
4692
4733
  ];
4693
4734
  defaultMenuItems.forEach((item) => defaultMenuRegistry.register(item));
4694
- var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$v = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$k = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$d = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$6 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4735
+ var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$v = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$d = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$6 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4695
4736
  function Menubar(props) {
4696
4737
  const [activeMenu, setActiveMenu] = createSignal(null);
4697
4738
  const menuItems = () => (props.registry ?? defaultMenuRegistry).getItems();
@@ -4764,7 +4805,7 @@ function Menubar(props) {
4764
4805
  return topLevelItems();
4765
4806
  },
4766
4807
  children: (topLevel) => (() => {
4767
- var _el$2 = _tmpl$3$k(), _el$3 = _el$2.firstChild;
4808
+ var _el$2 = _tmpl$3$j(), _el$3 = _el$2.firstChild;
4768
4809
  _el$2.addEventListener("mouseenter", () => {
4769
4810
  if (activeMenu() && activeMenu() !== topLevel.id) {
4770
4811
  setActiveMenu(topLevel.id);
@@ -16880,7 +16921,7 @@ function getCaretRectFromSnapshot(snapshot, position2, paragraphOffset) {
16880
16921
  );
16881
16922
  return rectFromBox(slot.left, slot.top, 1, slot.height || line.height);
16882
16923
  }
16883
- var _tmpl$$M = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$d = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$c = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16924
+ var _tmpl$$M = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$i = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$d = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$c = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16884
16925
  function OutlinePanel(props) {
16885
16926
  const [collapsed, setCollapsed] = createSignal(props.defaultCollapsed ?? false);
16886
16927
  const [items, setItems] = createSignal([]);
@@ -16948,7 +16989,7 @@ function OutlinePanel(props) {
16948
16989
  }
16949
16990
  });
16950
16991
  return (() => {
16951
- var _el$ = _tmpl$3$j(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16992
+ var _el$ = _tmpl$3$i(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16952
16993
  insert(_el$2, createComponent(Show, {
16953
16994
  get when() {
16954
16995
  return !collapsed();
@@ -17445,7 +17486,7 @@ function Popover(props) {
17445
17486
  }
17446
17487
  })];
17447
17488
  }
17448
- var _tmpl$$I = /* @__PURE__ */ template(`<div>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$i = /* @__PURE__ */ template(`<i>`), _tmpl$4$c = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$b = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$5 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
17489
+ var _tmpl$$I = /* @__PURE__ */ template(`<div>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$h = /* @__PURE__ */ template(`<i>`), _tmpl$4$c = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$b = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$5 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
17449
17490
  function Menu(props) {
17450
17491
  const [open, setOpen] = createSignal(false);
17451
17492
  const ariaLabel = () => props.tooltip || props.label || "";
@@ -17473,7 +17514,7 @@ function Menu(props) {
17473
17514
  return props.icon;
17474
17515
  },
17475
17516
  get children() {
17476
- var _el$4 = _tmpl$3$i();
17517
+ var _el$4 = _tmpl$3$h();
17477
17518
  createRenderEffect(() => setAttribute(_el$4, "data-lucide", props.icon));
17478
17519
  return _el$4;
17479
17520
  }
@@ -17639,7 +17680,7 @@ function SplitButton(props) {
17639
17680
  });
17640
17681
  }
17641
17682
  delegateEvents(["click"]);
17642
- var _tmpl$$E = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$q = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$h = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$b = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$4 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17683
+ var _tmpl$$E = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$q = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$b = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$4 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17643
17684
  const normalizeColor = (value) => (value == null ? void 0 : value.trim().toLowerCase()) ?? "";
17644
17685
  function ColorPicker(props) {
17645
17686
  const [isOpen, setIsOpen] = createSignal(false);
@@ -17722,7 +17763,7 @@ function ColorPicker(props) {
17722
17763
  return _el$;
17723
17764
  }
17724
17765
  }), (() => {
17725
- var _el$5 = _tmpl$3$h(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17766
+ var _el$5 = _tmpl$3$g(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17726
17767
  insert(_el$6, () => props.themeColorsLabel);
17727
17768
  insert(_el$7, createComponent(For, {
17728
17769
  get each() {
@@ -17827,7 +17868,7 @@ function ColorPicker(props) {
17827
17868
  });
17828
17869
  }
17829
17870
  delegateEvents(["click", "input"]);
17830
- var _tmpl$$D = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$p = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17871
+ var _tmpl$$D = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$p = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$f = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17831
17872
  function GridPicker(props) {
17832
17873
  const [isOpen, setIsOpen] = createSignal(false);
17833
17874
  const [hover, setHover] = createSignal({
@@ -17901,7 +17942,7 @@ function GridPicker(props) {
17901
17942
  return h.row === 0 || h.col === 0 ? t("toolbar.table") : `${h.row} × ${h.col}`;
17902
17943
  };
17903
17944
  return (() => {
17904
- var _el$ = _tmpl$3$g();
17945
+ var _el$ = _tmpl$3$f();
17905
17946
  insert(_el$, createComponent(Popover, {
17906
17947
  get open() {
17907
17948
  return isOpen();
@@ -18039,7 +18080,7 @@ const DEFAULT_PALETTE = {
18039
18080
  standardColors: STANDARD_COLORS,
18040
18081
  allowCustom: true
18041
18082
  };
18042
- var _tmpl$$C = /* @__PURE__ */ template(`<i>`), _tmpl$2$o = /* @__PURE__ */ template(`<option value>`), _tmpl$3$f = /* @__PURE__ */ template(`<option>`);
18083
+ var _tmpl$$C = /* @__PURE__ */ template(`<option value>`), _tmpl$2$o = /* @__PURE__ */ template(`<option>`);
18043
18084
  function renderMenuContent(content, api) {
18044
18085
  if (content.kind === "custom") {
18045
18086
  return content.render(api);
@@ -18167,14 +18208,16 @@ function RenderSplit(props) {
18167
18208
  get menuTestId() {
18168
18209
  return memo(() => !!props.item.testId)() ? `${props.item.testId}-dropdown` : void 0;
18169
18210
  },
18170
- panelClass: "oasis-editor-color-menu",
18211
+ get panelClass() {
18212
+ return props.item.panelClass ?? "oasis-editor-color-menu";
18213
+ },
18171
18214
  panelRole: "menu",
18172
18215
  get mainContent() {
18173
- return (() => {
18174
- var _el$ = _tmpl$$C();
18175
- createRenderEffect(() => setAttribute(_el$, "data-lucide", props.item.iconName));
18176
- return _el$;
18177
- })();
18216
+ return memo(() => !!props.item.iconName)() ? createComponent(ToolIcon, {
18217
+ get name() {
18218
+ return props.item.iconName;
18219
+ }
18220
+ }) : [];
18178
18221
  },
18179
18222
  get children() {
18180
18223
  return renderMenuContent(props.item.menu, props.api);
@@ -18210,19 +18253,19 @@ function RenderSelect(props) {
18210
18253
  return props.item.placeholder !== void 0;
18211
18254
  },
18212
18255
  get children() {
18213
- var _el$2 = _tmpl$2$o();
18214
- insert(_el$2, () => props.item.placeholder);
18215
- return _el$2;
18256
+ var _el$ = _tmpl$$C();
18257
+ insert(_el$, () => props.item.placeholder);
18258
+ return _el$;
18216
18259
  }
18217
18260
  }), createComponent(For, {
18218
18261
  get each() {
18219
18262
  return props.item.options(props.api);
18220
18263
  },
18221
18264
  children: (option) => (() => {
18222
- var _el$3 = _tmpl$3$f();
18223
- insert(_el$3, () => option.label);
18224
- createRenderEffect(() => _el$3.value = option.value);
18225
- return _el$3;
18265
+ var _el$2 = _tmpl$2$o();
18266
+ insert(_el$2, () => option.label);
18267
+ createRenderEffect(() => _el$2.value = option.value);
18268
+ return _el$2;
18226
18269
  })()
18227
18270
  })];
18228
18271
  }
@@ -19889,6 +19932,7 @@ function getToolbarStyleState(state) {
19889
19932
  };
19890
19933
  }
19891
19934
  const EDITOR_SCROLL_PADDING_PX = 34;
19935
+ const EDITOR_SCROLLBAR_RESERVE_PX = 10;
19892
19936
  const PX_PER_INCH$2 = 96;
19893
19937
  const PX_PER_CM = PX_PER_INCH$2 / 2.54;
19894
19938
  const MIN_CONTENT_WIDTH_PX = 24;
@@ -34728,6 +34772,7 @@ function OasisEditorEditor(props) {
34728
34772
  let viewportElement;
34729
34773
  const [viewportRef, setViewportRef] = createSignal();
34730
34774
  const pageSettings = () => getDocumentPageSettings(props.state().document);
34775
+ const widestPageWidth = () => getDocumentSections(props.state().document).reduce((max, section) => Math.max(max, section.pageSettings.width), 0) || pageSettings().width;
34731
34776
  const viewportHeight = () => {
34732
34777
  const rawViewportHeight = layout().viewportHeight;
34733
34778
  if (typeof rawViewportHeight === "number") {
@@ -34736,7 +34781,13 @@ function OasisEditorEditor(props) {
34736
34781
  return rawViewportHeight ?? "min(72vh, 920px)";
34737
34782
  };
34738
34783
  const shellStyle = createMemo(() => ({
34739
- width: `min(${pageSettings().width + EDITOR_SCROLL_PADDING_PX * 2}px, 100%)`,
34784
+ // pageWidth + both horizontal gutters + the reserved vertical-scrollbar
34785
+ // gutter. The paper is width:100% of the scroll content and
34786
+ // `.oasis-editor-editor` reserves the scrollbar via `scrollbar-gutter:
34787
+ // stable`, so this keeps the paper exactly `pageWidth` while leaving room for
34788
+ // the scrollbar — preventing a spurious horizontal scrollbar (notably in
34789
+ // landscape) and letting the editor area grow to fit a wider page.
34790
+ width: `min(${widestPageWidth() + EDITOR_SCROLL_PADDING_PX * 2 + EDITOR_SCROLLBAR_RESERVE_PX}px, 100%)`,
34740
34791
  height: "100%",
34741
34792
  "max-height": viewportHeight(),
34742
34793
  ...layout().style ?? {}
@@ -37205,16 +37256,33 @@ function SectionGroup(props) {
37205
37256
  return [(() => {
37206
37257
  var _el$ = _tmpl$();
37207
37258
  insert(_el$, createComponent(Button$1, {
37208
- icon: "layout",
37259
+ icon: "rectangle-vertical",
37260
+ get active() {
37261
+ return !api.commands.state("toggleOrientation").isActive;
37262
+ },
37263
+ "data-testid": "editor-toolbar-orientation-portrait",
37264
+ onClick: () => api.commands.execute({
37265
+ name: "setOrientation",
37266
+ payload: "portrait"
37267
+ }),
37268
+ get tooltip() {
37269
+ return t("section.portrait");
37270
+ }
37271
+ }), null);
37272
+ insert(_el$, createComponent(Button$1, {
37273
+ icon: "rectangle-horizontal",
37209
37274
  get active() {
37210
37275
  return api.commands.state("toggleOrientation").isActive;
37211
37276
  },
37212
- "data-testid": "editor-toolbar-orientation",
37213
- onClick: () => api.commands.execute("toggleOrientation"),
37277
+ "data-testid": "editor-toolbar-orientation-landscape",
37278
+ onClick: () => api.commands.execute({
37279
+ name: "setOrientation",
37280
+ payload: "landscape"
37281
+ }),
37214
37282
  get tooltip() {
37215
- return t("section.toggleOrientation");
37283
+ return t("section.landscape");
37216
37284
  }
37217
- }));
37285
+ }), null);
37218
37286
  return _el$;
37219
37287
  })(), (() => {
37220
37288
  var _el$2 = _tmpl$();
@@ -37367,6 +37435,11 @@ const RIBBON_PLACEMENTS = {
37367
37435
  "editor-toolbar-list-outdent": { tab: "home", group: "paragraph", row: 1 },
37368
37436
  "editor-toolbar-list-indent": { tab: "home", group: "paragraph", row: 1 },
37369
37437
  "editor-toolbar-list-options": { tab: "home", group: "paragraph", row: 1 },
37438
+ "editor-toolbar-special-indent": {
37439
+ tab: "home",
37440
+ group: "paragraph",
37441
+ row: 1
37442
+ },
37370
37443
  "editor-toolbar-line-spacing-control": {
37371
37444
  tab: "home",
37372
37445
  group: "paragraph",
@@ -37808,6 +37881,54 @@ function createDefaultToolbarPreset() {
37808
37881
  id: "editor-toolbar-list-options",
37809
37882
  render: (api) => ListOptionsControl({ api })
37810
37883
  });
37884
+ items.push({
37885
+ type: "split",
37886
+ id: "editor-toolbar-special-indent",
37887
+ testId: "editor-toolbar-special-indent",
37888
+ iconName: "specialIndentFirstLine",
37889
+ tooltipKey: "toolbar.specialIndent",
37890
+ command: { name: "setSpecialIndent", payload: { kind: "firstLine" } },
37891
+ isActive: () => false,
37892
+ panelClass: "oasis-editor-toolbar-dropdown-menu oasis-editor-special-indent-menu",
37893
+ menu: {
37894
+ kind: "items",
37895
+ items: [
37896
+ {
37897
+ type: "button",
37898
+ id: "editor-toolbar-special-indent-none",
37899
+ testId: "editor-toolbar-special-indent-none",
37900
+ iconName: "minus",
37901
+ labelKey: "toolbar.specialIndentNone",
37902
+ tooltipKey: "toolbar.specialIndentNone",
37903
+ command: { name: "setSpecialIndent", payload: { kind: "none" } },
37904
+ wide: true
37905
+ },
37906
+ {
37907
+ type: "button",
37908
+ id: "editor-toolbar-special-indent-first-line",
37909
+ testId: "editor-toolbar-special-indent-first-line",
37910
+ iconName: "list-collapse",
37911
+ labelKey: "toolbar.specialIndentFirstLine",
37912
+ tooltipKey: "toolbar.specialIndentFirstLine",
37913
+ command: {
37914
+ name: "setSpecialIndent",
37915
+ payload: { kind: "firstLine" }
37916
+ },
37917
+ wide: true
37918
+ },
37919
+ {
37920
+ type: "button",
37921
+ id: "editor-toolbar-special-indent-hanging",
37922
+ testId: "editor-toolbar-special-indent-hanging",
37923
+ iconName: "list-indent-increase",
37924
+ labelKey: "toolbar.specialIndentHanging",
37925
+ tooltipKey: "toolbar.specialIndentHanging",
37926
+ command: { name: "setSpecialIndent", payload: { kind: "hanging" } },
37927
+ wide: true
37928
+ }
37929
+ ]
37930
+ }
37931
+ });
37811
37932
  items.push({
37812
37933
  type: "custom",
37813
37934
  id: "editor-toolbar-line-spacing-control",
@@ -37873,6 +37994,7 @@ const OASIS_TOOLBAR_ITEMS = {
37873
37994
  outdent: "editor-toolbar-list-outdent",
37874
37995
  indent: "editor-toolbar-list-indent",
37875
37996
  listOptions: "editor-toolbar-list-options",
37997
+ specialIndent: "editor-toolbar-special-indent",
37876
37998
  lineSpacing: "editor-toolbar-line-spacing-control",
37877
37999
  metrics: "editor-toolbar-metrics",
37878
38000
  table: "editor-toolbar-table",