oasis-editor 0.0.14 → 0.0.16
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/{OasisEditorApp-BtRbOf8l.js → OasisEditorApp-CVvcxpbi.js} +19 -6
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/publicCommandTypes.d.ts +1 -0
- package/dist/i18n/locales/en.d.ts +20 -0
- package/dist/i18n/locales/pt-BR.d.ts +20 -0
- package/dist/{index-4CDpujGG.js → index-u3nvOtUO.js} +113 -26
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/createEssentialsPlugin.d.ts +1 -0
- package/dist/ui/components/Toolbar/underlineStyles.d.ts +3 -2
- package/dist/ui/editorLayoutConstants.d.ts +13 -0
- package/package.json +1 -1
|
@@ -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-
|
|
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-u3nvOtUO.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) {
|
|
@@ -41177,6 +41177,10 @@ function buildParagraphAndSectionCommands({
|
|
|
41177
41177
|
() => section.toggleOrientation(),
|
|
41178
41178
|
() => ({ isActive: section.isLandscape() })
|
|
41179
41179
|
),
|
|
41180
|
+
setOrientation: actionCommand(
|
|
41181
|
+
"setOrientation",
|
|
41182
|
+
(p) => section.setOrientation(p)
|
|
41183
|
+
),
|
|
41180
41184
|
sectionBreakNextPage: actionCommand(
|
|
41181
41185
|
"sectionBreakNextPage",
|
|
41182
41186
|
() => section.breakNextPage()
|
|
@@ -41589,19 +41593,28 @@ function createEditorEssentialsRuntimePlugin(options) {
|
|
|
41589
41593
|
const section = ((_a = options.state().document.sections) == null ? void 0 : _a[idx]) ?? options.state().document;
|
|
41590
41594
|
return ((_b = section == null ? void 0 : section.pageSettings) == null ? void 0 : _b.orientation) === "landscape";
|
|
41591
41595
|
},
|
|
41592
|
-
|
|
41593
|
-
var _a
|
|
41596
|
+
setOrientation: (orientation) => {
|
|
41597
|
+
var _a;
|
|
41594
41598
|
const idx = getActiveSectionIndex(options.state());
|
|
41595
41599
|
const section = ((_a = options.state().document.sections) == null ? void 0 : _a[idx]) ?? options.state().document;
|
|
41596
41600
|
if (!section) return;
|
|
41597
|
-
const current = ((_b = section.pageSettings) == null ? void 0 : _b.orientation) ?? "portrait";
|
|
41598
41601
|
options.commandsController.applyUpdateSectionSettingsCommand(idx, {
|
|
41599
41602
|
pageSettings: {
|
|
41600
41603
|
...section.pageSettings,
|
|
41601
|
-
orientation
|
|
41604
|
+
orientation
|
|
41602
41605
|
}
|
|
41603
41606
|
});
|
|
41604
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
|
+
},
|
|
41605
41618
|
breakNextPage: () => options.commandsController.applyInsertSectionBreakCommand("nextPage"),
|
|
41606
41619
|
breakContinuous: () => options.commandsController.applyInsertSectionBreakCommand("continuous"),
|
|
41607
41620
|
setPageMargins: (margins) => {
|
|
@@ -42744,7 +42757,7 @@ function FontTab(props) {
|
|
|
42744
42757
|
each: UNDERLINE_STYLE_OPTIONS,
|
|
42745
42758
|
children: (option) => (() => {
|
|
42746
42759
|
var _el$84 = _tmpl$2$5();
|
|
42747
|
-
insert(_el$84, () => option.
|
|
42760
|
+
insert(_el$84, () => t(option.labelKey));
|
|
42748
42761
|
createRenderEffect(() => _el$84.value = option.value);
|
|
42749
42762
|
return _el$84;
|
|
42750
42763
|
})()
|
|
@@ -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", "setSpecialIndent", "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];
|
|
@@ -83,6 +83,7 @@ export interface OasisCommandPayloads {
|
|
|
83
83
|
setListFormat: string;
|
|
84
84
|
setListStartAt: number | null;
|
|
85
85
|
toggleOrientation: undefined;
|
|
86
|
+
setOrientation: "portrait" | "landscape";
|
|
86
87
|
sectionBreakNextPage: undefined;
|
|
87
88
|
sectionBreakContinuous: undefined;
|
|
88
89
|
setPageMargins: SetPageMarginsPayload;
|
|
@@ -142,6 +142,9 @@ export declare const en: {
|
|
|
142
142
|
"paragraph.preview": string;
|
|
143
143
|
"paragraph.previewText": string;
|
|
144
144
|
"section.orient": string;
|
|
145
|
+
"section.orientation": string;
|
|
146
|
+
"section.portrait": string;
|
|
147
|
+
"section.landscape": string;
|
|
145
148
|
"section.pageSetup": string;
|
|
146
149
|
"section.toggleOrientation": string;
|
|
147
150
|
"section.margins": string;
|
|
@@ -260,6 +263,22 @@ export declare const en: {
|
|
|
260
263
|
"dialog.font.styleItalic": string;
|
|
261
264
|
"dialog.font.styleBold": string;
|
|
262
265
|
"dialog.font.styleBoldItalic": string;
|
|
266
|
+
"underline.style.single": string;
|
|
267
|
+
"underline.style.double": string;
|
|
268
|
+
"underline.style.thick": string;
|
|
269
|
+
"underline.style.dotted": string;
|
|
270
|
+
"underline.style.dottedHeavy": string;
|
|
271
|
+
"underline.style.dashed": string;
|
|
272
|
+
"underline.style.dashedHeavy": string;
|
|
273
|
+
"underline.style.longDashes": string;
|
|
274
|
+
"underline.style.longDashesHeavy": string;
|
|
275
|
+
"underline.style.dotDash": string;
|
|
276
|
+
"underline.style.dotDashHeavy": string;
|
|
277
|
+
"underline.style.dotDotDash": string;
|
|
278
|
+
"underline.style.dotDotDashHeavy": string;
|
|
279
|
+
"underline.style.wave": string;
|
|
280
|
+
"underline.style.waveHeavy": string;
|
|
281
|
+
"underline.style.waveDouble": string;
|
|
263
282
|
"dialog.font.underlineStyle": string;
|
|
264
283
|
"dialog.font.underlineColor": string;
|
|
265
284
|
"dialog.font.doubleStrike": string;
|
|
@@ -356,6 +375,7 @@ export declare const en: {
|
|
|
356
375
|
"menu.view.outline": string;
|
|
357
376
|
"menu.view.fullscreen": string;
|
|
358
377
|
"menu.insert": string;
|
|
378
|
+
"menu.layout": string;
|
|
359
379
|
"menu.format": string;
|
|
360
380
|
"menu.format.align": string;
|
|
361
381
|
"menu.format.text": string;
|
|
@@ -142,6 +142,9 @@ export declare const ptBR: {
|
|
|
142
142
|
"paragraph.preview": string;
|
|
143
143
|
"paragraph.previewText": string;
|
|
144
144
|
"section.orient": string;
|
|
145
|
+
"section.orientation": string;
|
|
146
|
+
"section.portrait": string;
|
|
147
|
+
"section.landscape": string;
|
|
145
148
|
"section.pageSetup": string;
|
|
146
149
|
"section.toggleOrientation": string;
|
|
147
150
|
"section.margins": string;
|
|
@@ -260,6 +263,22 @@ export declare const ptBR: {
|
|
|
260
263
|
"dialog.font.styleItalic": string;
|
|
261
264
|
"dialog.font.styleBold": string;
|
|
262
265
|
"dialog.font.styleBoldItalic": string;
|
|
266
|
+
"underline.style.single": string;
|
|
267
|
+
"underline.style.double": string;
|
|
268
|
+
"underline.style.thick": string;
|
|
269
|
+
"underline.style.dotted": string;
|
|
270
|
+
"underline.style.dottedHeavy": string;
|
|
271
|
+
"underline.style.dashed": string;
|
|
272
|
+
"underline.style.dashedHeavy": string;
|
|
273
|
+
"underline.style.longDashes": string;
|
|
274
|
+
"underline.style.longDashesHeavy": string;
|
|
275
|
+
"underline.style.dotDash": string;
|
|
276
|
+
"underline.style.dotDashHeavy": string;
|
|
277
|
+
"underline.style.dotDotDash": string;
|
|
278
|
+
"underline.style.dotDotDashHeavy": string;
|
|
279
|
+
"underline.style.wave": string;
|
|
280
|
+
"underline.style.waveHeavy": string;
|
|
281
|
+
"underline.style.waveDouble": string;
|
|
263
282
|
"dialog.font.underlineStyle": string;
|
|
264
283
|
"dialog.font.underlineColor": string;
|
|
265
284
|
"dialog.font.doubleStrike": string;
|
|
@@ -356,6 +375,7 @@ export declare const ptBR: {
|
|
|
356
375
|
"menu.view.outline": string;
|
|
357
376
|
"menu.view.fullscreen": string;
|
|
358
377
|
"menu.insert": string;
|
|
378
|
+
"menu.layout": string;
|
|
359
379
|
"menu.format": string;
|
|
360
380
|
"menu.format.align": string;
|
|
361
381
|
"menu.format.text": string;
|
|
@@ -1562,6 +1562,9 @@ const en = {
|
|
|
1562
1562
|
"paragraph.previewText": "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.",
|
|
1563
1563
|
// Section
|
|
1564
1564
|
"section.orient": "Orient",
|
|
1565
|
+
"section.orientation": "Orientation",
|
|
1566
|
+
"section.portrait": "Portrait",
|
|
1567
|
+
"section.landscape": "Landscape",
|
|
1565
1568
|
"section.pageSetup": "Page Setup",
|
|
1566
1569
|
"section.toggleOrientation": "Toggle Orientation",
|
|
1567
1570
|
"section.margins": "Margins",
|
|
@@ -1684,6 +1687,22 @@ const en = {
|
|
|
1684
1687
|
"dialog.font.styleItalic": "Italic",
|
|
1685
1688
|
"dialog.font.styleBold": "Bold",
|
|
1686
1689
|
"dialog.font.styleBoldItalic": "Bold Italic",
|
|
1690
|
+
"underline.style.single": "Single",
|
|
1691
|
+
"underline.style.double": "Double",
|
|
1692
|
+
"underline.style.thick": "Thick",
|
|
1693
|
+
"underline.style.dotted": "Dotted",
|
|
1694
|
+
"underline.style.dottedHeavy": "Dotted (Heavy)",
|
|
1695
|
+
"underline.style.dashed": "Dashed",
|
|
1696
|
+
"underline.style.dashedHeavy": "Dashed (Heavy)",
|
|
1697
|
+
"underline.style.longDashes": "Long Dashes",
|
|
1698
|
+
"underline.style.longDashesHeavy": "Long Dashes (Heavy)",
|
|
1699
|
+
"underline.style.dotDash": "Dot-Dash",
|
|
1700
|
+
"underline.style.dotDashHeavy": "Dot-Dash (Heavy)",
|
|
1701
|
+
"underline.style.dotDotDash": "Dot-Dot-Dash",
|
|
1702
|
+
"underline.style.dotDotDashHeavy": "Dot-Dot-Dash (Heavy)",
|
|
1703
|
+
"underline.style.wave": "Wave",
|
|
1704
|
+
"underline.style.waveHeavy": "Wave (Heavy)",
|
|
1705
|
+
"underline.style.waveDouble": "Wave (Double)",
|
|
1687
1706
|
"dialog.font.underlineStyle": "Underline style",
|
|
1688
1707
|
"dialog.font.underlineColor": "Underline color",
|
|
1689
1708
|
"dialog.font.doubleStrike": "Double strikethrough",
|
|
@@ -1784,6 +1803,7 @@ const en = {
|
|
|
1784
1803
|
"menu.view.outline": "Show Outline",
|
|
1785
1804
|
"menu.view.fullscreen": "Full Screen",
|
|
1786
1805
|
"menu.insert": "Insert",
|
|
1806
|
+
"menu.layout": "Layout",
|
|
1787
1807
|
"menu.format": "Format",
|
|
1788
1808
|
"menu.format.align": "Align",
|
|
1789
1809
|
"menu.format.text": "Text",
|
|
@@ -1958,6 +1978,9 @@ const ptBR = {
|
|
|
1958
1978
|
"paragraph.previewText": "Texto de Exemplo Texto de Exemplo Texto de Exemplo Texto de Exemplo Texto de Exemplo Texto de Exemplo.",
|
|
1959
1979
|
// Section
|
|
1960
1980
|
"section.orient": "Orient",
|
|
1981
|
+
"section.orientation": "Orientação",
|
|
1982
|
+
"section.portrait": "Retrato",
|
|
1983
|
+
"section.landscape": "Paisagem",
|
|
1961
1984
|
"section.pageSetup": "Configurações de Página",
|
|
1962
1985
|
"section.toggleOrientation": "Alternar Orientação",
|
|
1963
1986
|
"section.margins": "Margens",
|
|
@@ -2080,6 +2103,22 @@ const ptBR = {
|
|
|
2080
2103
|
"dialog.font.styleItalic": "Itálico",
|
|
2081
2104
|
"dialog.font.styleBold": "Negrito",
|
|
2082
2105
|
"dialog.font.styleBoldItalic": "Negrito Itálico",
|
|
2106
|
+
"underline.style.single": "Simples",
|
|
2107
|
+
"underline.style.double": "Duplo",
|
|
2108
|
+
"underline.style.thick": "Espesso",
|
|
2109
|
+
"underline.style.dotted": "Pontilhado",
|
|
2110
|
+
"underline.style.dottedHeavy": "Pontilhado (Espesso)",
|
|
2111
|
+
"underline.style.dashed": "Tracejado",
|
|
2112
|
+
"underline.style.dashedHeavy": "Tracejado (Espesso)",
|
|
2113
|
+
"underline.style.longDashes": "Traços longos",
|
|
2114
|
+
"underline.style.longDashesHeavy": "Traços longos (Espesso)",
|
|
2115
|
+
"underline.style.dotDash": "Ponto-traço",
|
|
2116
|
+
"underline.style.dotDashHeavy": "Ponto-traço (Espesso)",
|
|
2117
|
+
"underline.style.dotDotDash": "Ponto-ponto-traço",
|
|
2118
|
+
"underline.style.dotDotDashHeavy": "Ponto-ponto-traço (Espesso)",
|
|
2119
|
+
"underline.style.wave": "Ondulado",
|
|
2120
|
+
"underline.style.waveHeavy": "Ondulado (Espesso)",
|
|
2121
|
+
"underline.style.waveDouble": "Ondulado duplo",
|
|
2083
2122
|
"dialog.font.underlineStyle": "Estilo do sublinhado",
|
|
2084
2123
|
"dialog.font.underlineColor": "Cor do sublinhado",
|
|
2085
2124
|
"dialog.font.doubleStrike": "Tachado duplo",
|
|
@@ -2180,6 +2219,7 @@ const ptBR = {
|
|
|
2180
2219
|
"menu.view.outline": "Mostrar Estrutura",
|
|
2181
2220
|
"menu.view.fullscreen": "Tela Inteira",
|
|
2182
2221
|
"menu.insert": "Inserir",
|
|
2222
|
+
"menu.layout": "Layout",
|
|
2183
2223
|
"menu.format": "Formatar",
|
|
2184
2224
|
"menu.format.align": "Alinhar",
|
|
2185
2225
|
"menu.format.text": "Texto",
|
|
@@ -2318,7 +2358,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2318
2358
|
onCleanup(() => {
|
|
2319
2359
|
cancelled = true;
|
|
2320
2360
|
});
|
|
2321
|
-
import("./OasisEditorApp-
|
|
2361
|
+
import("./OasisEditorApp-CVvcxpbi.js").then((m) => {
|
|
2322
2362
|
cancelled = true;
|
|
2323
2363
|
setProgress(1);
|
|
2324
2364
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -4292,6 +4332,7 @@ const OASIS_BUILTIN_COMMANDS = [
|
|
|
4292
4332
|
"setListFormat",
|
|
4293
4333
|
"setListStartAt",
|
|
4294
4334
|
"toggleOrientation",
|
|
4335
|
+
"setOrientation",
|
|
4295
4336
|
"sectionBreakNextPage",
|
|
4296
4337
|
"sectionBreakContinuous",
|
|
4297
4338
|
"setPageMargins",
|
|
@@ -4678,6 +4719,27 @@ const defaultMenuItems = [
|
|
|
4678
4719
|
icon: "list-ordered"
|
|
4679
4720
|
},
|
|
4680
4721
|
{ id: "format_clear", path: "Format/Clear formatting", hidden: true },
|
|
4722
|
+
// Layout
|
|
4723
|
+
{
|
|
4724
|
+
id: "layout_orientation",
|
|
4725
|
+
path: "Layout/Orientation",
|
|
4726
|
+
labelKey: "section.orientation",
|
|
4727
|
+
icon: "layout"
|
|
4728
|
+
},
|
|
4729
|
+
{
|
|
4730
|
+
id: "layout_orientation_portrait",
|
|
4731
|
+
path: "Layout/Orientation/Portrait",
|
|
4732
|
+
labelKey: "section.portrait",
|
|
4733
|
+
command: { name: "setOrientation", payload: "portrait" },
|
|
4734
|
+
icon: (host) => host.commands.state("toggleOrientation").isActive ? "" : "check"
|
|
4735
|
+
},
|
|
4736
|
+
{
|
|
4737
|
+
id: "layout_orientation_landscape",
|
|
4738
|
+
path: "Layout/Orientation/Landscape",
|
|
4739
|
+
labelKey: "section.landscape",
|
|
4740
|
+
command: { name: "setOrientation", payload: "landscape" },
|
|
4741
|
+
icon: (host) => host.commands.state("toggleOrientation").isActive ? "check" : ""
|
|
4742
|
+
},
|
|
4681
4743
|
// Tools
|
|
4682
4744
|
{
|
|
4683
4745
|
id: "tools_wordcount",
|
|
@@ -19902,6 +19964,7 @@ function getToolbarStyleState(state) {
|
|
|
19902
19964
|
};
|
|
19903
19965
|
}
|
|
19904
19966
|
const EDITOR_SCROLL_PADDING_PX = 34;
|
|
19967
|
+
const EDITOR_SCROLLBAR_RESERVE_PX = 10;
|
|
19905
19968
|
const PX_PER_INCH$2 = 96;
|
|
19906
19969
|
const PX_PER_CM = PX_PER_INCH$2 / 2.54;
|
|
19907
19970
|
const MIN_CONTENT_WIDTH_PX = 24;
|
|
@@ -34741,6 +34804,7 @@ function OasisEditorEditor(props) {
|
|
|
34741
34804
|
let viewportElement;
|
|
34742
34805
|
const [viewportRef, setViewportRef] = createSignal();
|
|
34743
34806
|
const pageSettings = () => getDocumentPageSettings(props.state().document);
|
|
34807
|
+
const widestPageWidth = () => getDocumentSections(props.state().document).reduce((max, section) => Math.max(max, section.pageSettings.width), 0) || pageSettings().width;
|
|
34744
34808
|
const viewportHeight = () => {
|
|
34745
34809
|
const rawViewportHeight = layout().viewportHeight;
|
|
34746
34810
|
if (typeof rawViewportHeight === "number") {
|
|
@@ -34749,7 +34813,13 @@ function OasisEditorEditor(props) {
|
|
|
34749
34813
|
return rawViewportHeight ?? "min(72vh, 920px)";
|
|
34750
34814
|
};
|
|
34751
34815
|
const shellStyle = createMemo(() => ({
|
|
34752
|
-
|
|
34816
|
+
// pageWidth + both horizontal gutters + the reserved vertical-scrollbar
|
|
34817
|
+
// gutter. The paper is width:100% of the scroll content and
|
|
34818
|
+
// `.oasis-editor-editor` reserves the scrollbar via `scrollbar-gutter:
|
|
34819
|
+
// stable`, so this keeps the paper exactly `pageWidth` while leaving room for
|
|
34820
|
+
// the scrollbar — preventing a spurious horizontal scrollbar (notably in
|
|
34821
|
+
// landscape) and letting the editor area grow to fit a wider page.
|
|
34822
|
+
width: `min(${widestPageWidth() + EDITOR_SCROLL_PADDING_PX * 2 + EDITOR_SCROLLBAR_RESERVE_PX}px, 100%)`,
|
|
34753
34823
|
height: "100%",
|
|
34754
34824
|
"max-height": viewportHeight(),
|
|
34755
34825
|
...layout().style ?? {}
|
|
@@ -36425,58 +36495,58 @@ function parseFontSizePtToPx(pt) {
|
|
|
36425
36495
|
return fontSizePtToPx(value);
|
|
36426
36496
|
}
|
|
36427
36497
|
const UNDERLINE_STYLE_OPTIONS = [
|
|
36428
|
-
{ value: "single",
|
|
36498
|
+
{ value: "single", labelKey: "underline.style.single", preview: { borderStyle: "solid" } },
|
|
36429
36499
|
{
|
|
36430
36500
|
value: "double",
|
|
36431
|
-
|
|
36501
|
+
labelKey: "underline.style.double",
|
|
36432
36502
|
preview: { borderStyle: "double", borderBottomWidth: "3px" }
|
|
36433
36503
|
},
|
|
36434
36504
|
{
|
|
36435
36505
|
value: "thick",
|
|
36436
|
-
|
|
36506
|
+
labelKey: "underline.style.thick",
|
|
36437
36507
|
preview: { borderStyle: "solid", borderBottomWidth: "3px" }
|
|
36438
36508
|
},
|
|
36439
|
-
{ value: "dotted",
|
|
36509
|
+
{ value: "dotted", labelKey: "underline.style.dotted", preview: { borderStyle: "dotted" } },
|
|
36440
36510
|
{
|
|
36441
36511
|
value: "dottedHeavy",
|
|
36442
|
-
|
|
36512
|
+
labelKey: "underline.style.dottedHeavy",
|
|
36443
36513
|
preview: { borderStyle: "dotted", borderBottomWidth: "3px" }
|
|
36444
36514
|
},
|
|
36445
|
-
{ value: "dash",
|
|
36515
|
+
{ value: "dash", labelKey: "underline.style.dashed", preview: { borderStyle: "dashed" } },
|
|
36446
36516
|
{
|
|
36447
36517
|
value: "dashedHeavy",
|
|
36448
|
-
|
|
36518
|
+
labelKey: "underline.style.dashedHeavy",
|
|
36449
36519
|
preview: { borderStyle: "dashed", borderBottomWidth: "3px" }
|
|
36450
36520
|
},
|
|
36451
36521
|
{
|
|
36452
36522
|
value: "dashLong",
|
|
36453
|
-
|
|
36523
|
+
labelKey: "underline.style.longDashes",
|
|
36454
36524
|
preview: { borderStyle: "dashed" }
|
|
36455
36525
|
},
|
|
36456
36526
|
{
|
|
36457
36527
|
value: "dashLongHeavy",
|
|
36458
|
-
|
|
36528
|
+
labelKey: "underline.style.longDashesHeavy",
|
|
36459
36529
|
preview: { borderStyle: "dashed", borderBottomWidth: "3px" }
|
|
36460
36530
|
},
|
|
36461
|
-
{ value: "dotDash",
|
|
36531
|
+
{ value: "dotDash", labelKey: "underline.style.dotDash", preview: { borderStyle: "dashed" } },
|
|
36462
36532
|
{
|
|
36463
36533
|
value: "dashDotHeavy",
|
|
36464
|
-
|
|
36534
|
+
labelKey: "underline.style.dotDashHeavy",
|
|
36465
36535
|
preview: { borderStyle: "dashed", borderBottomWidth: "3px" }
|
|
36466
36536
|
},
|
|
36467
36537
|
{
|
|
36468
36538
|
value: "dotDotDash",
|
|
36469
|
-
|
|
36539
|
+
labelKey: "underline.style.dotDotDash",
|
|
36470
36540
|
preview: { borderStyle: "dashed" }
|
|
36471
36541
|
},
|
|
36472
36542
|
{
|
|
36473
36543
|
value: "dashDotDotHeavy",
|
|
36474
|
-
|
|
36544
|
+
labelKey: "underline.style.dotDotDashHeavy",
|
|
36475
36545
|
preview: { borderStyle: "dashed", borderBottomWidth: "3px" }
|
|
36476
36546
|
},
|
|
36477
36547
|
{
|
|
36478
36548
|
value: "wave",
|
|
36479
|
-
|
|
36549
|
+
labelKey: "underline.style.wave",
|
|
36480
36550
|
preview: {
|
|
36481
36551
|
borderStyle: "wavy",
|
|
36482
36552
|
svg: `<svg width="100%" height="6" viewBox="0 0 60 6" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3 Q 5 0 10 3 T 20 3 T 30 3 T 40 3 T 50 3 T 60 3" fill="none" stroke="currentColor" stroke-width="1"/></svg>`
|
|
@@ -36484,7 +36554,7 @@ const UNDERLINE_STYLE_OPTIONS = [
|
|
|
36484
36554
|
},
|
|
36485
36555
|
{
|
|
36486
36556
|
value: "wavyHeavy",
|
|
36487
|
-
|
|
36557
|
+
labelKey: "underline.style.waveHeavy",
|
|
36488
36558
|
preview: {
|
|
36489
36559
|
borderStyle: "wavy",
|
|
36490
36560
|
svg: `<svg width="100%" height="6" viewBox="0 0 60 6" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3 Q 5 0 10 3 T 20 3 T 30 3 T 40 3 T 50 3 T 60 3" fill="none" stroke="currentColor" stroke-width="2"/></svg>`
|
|
@@ -36492,7 +36562,7 @@ const UNDERLINE_STYLE_OPTIONS = [
|
|
|
36492
36562
|
},
|
|
36493
36563
|
{
|
|
36494
36564
|
value: "wavyDouble",
|
|
36495
|
-
|
|
36565
|
+
labelKey: "underline.style.waveDouble",
|
|
36496
36566
|
preview: {
|
|
36497
36567
|
borderStyle: "wavy",
|
|
36498
36568
|
svg: `<svg width="100%" height="9" viewBox="0 0 60 9" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 2 Q 5 -1 10 2 T 20 2 T 30 2 T 40 2 T 50 2 T 60 2" fill="none" stroke="currentColor" stroke-width="1"/><path d="M0 7 Q 5 4 10 7 T 20 7 T 30 7 T 40 7 T 50 7 T 60 7" fill="none" stroke="currentColor" stroke-width="1"/></svg>`
|
|
@@ -36501,7 +36571,7 @@ const UNDERLINE_STYLE_OPTIONS = [
|
|
|
36501
36571
|
];
|
|
36502
36572
|
var _tmpl$$6 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action data-testid=editor-toolbar-underline-remove role=menuitem><span class=oasis-editor-color-menu-action-swatch><i data-lucide=slash></i></span><span>`), _tmpl$2$5 = /* @__PURE__ */ template(`<div class=oasis-editor-underline-menu-list>`), _tmpl$3$3 = /* @__PURE__ */ template(`<span class="oasis-editor-color-split-icon oasis-editor-underline-split-icon"><span class=oasis-editor-underline-split-glyph aria-hidden=true>U</span><span class=oasis-editor-underline-split-indicator>`), _tmpl$4$3 = /* @__PURE__ */ template(`<span class="oasis-editor-underline-menu-stroke oasis-editor-underline-menu-stroke-svg">`), _tmpl$5$3 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-underline-menu-item role=menuitemradio><span class=oasis-editor-underline-menu-preview></span><span class=oasis-editor-underline-menu-label>`), _tmpl$6$2 = /* @__PURE__ */ template(`<span class=oasis-editor-underline-menu-stroke>`);
|
|
36503
36573
|
const mod$1 = /Mac/i.test(navigator.userAgent) ? "⌘" : "Ctrl";
|
|
36504
|
-
const UNDERLINE_BUTTON_TOOLTIP =
|
|
36574
|
+
const UNDERLINE_BUTTON_TOOLTIP = `${t("toolbar.underline")} (${mod$1}+U)`;
|
|
36505
36575
|
const TEST_ID = "editor-toolbar-underline";
|
|
36506
36576
|
function UnderlineControl(props) {
|
|
36507
36577
|
const api = props.api;
|
|
@@ -36595,9 +36665,9 @@ function UnderlineControl(props) {
|
|
|
36595
36665
|
return _el$0;
|
|
36596
36666
|
}
|
|
36597
36667
|
}));
|
|
36598
|
-
insert(_el$1, () => option.
|
|
36668
|
+
insert(_el$1, () => t(option.labelKey));
|
|
36599
36669
|
createRenderEffect((_p$) => {
|
|
36600
|
-
var _v$ = !!isActive(), _v$2 = isActive(), _v$3 = `${TEST_ID}-style-${option.value}`, _v$4 = option.
|
|
36670
|
+
var _v$ = !!isActive(), _v$2 = isActive(), _v$3 = `${TEST_ID}-style-${option.value}`, _v$4 = t(option.labelKey);
|
|
36601
36671
|
_v$ !== _p$.e && _el$8.classList.toggle("oasis-editor-underline-menu-item-active", _p$.e = _v$);
|
|
36602
36672
|
_v$2 !== _p$.t && setAttribute(_el$8, "aria-checked", _p$.t = _v$2);
|
|
36603
36673
|
_v$3 !== _p$.a && setAttribute(_el$8, "data-testid", _p$.a = _v$3);
|
|
@@ -37218,16 +37288,33 @@ function SectionGroup(props) {
|
|
|
37218
37288
|
return [(() => {
|
|
37219
37289
|
var _el$ = _tmpl$();
|
|
37220
37290
|
insert(_el$, createComponent(Button$1, {
|
|
37221
|
-
icon: "
|
|
37291
|
+
icon: "rectangle-vertical",
|
|
37292
|
+
get active() {
|
|
37293
|
+
return !api.commands.state("toggleOrientation").isActive;
|
|
37294
|
+
},
|
|
37295
|
+
"data-testid": "editor-toolbar-orientation-portrait",
|
|
37296
|
+
onClick: () => api.commands.execute({
|
|
37297
|
+
name: "setOrientation",
|
|
37298
|
+
payload: "portrait"
|
|
37299
|
+
}),
|
|
37300
|
+
get tooltip() {
|
|
37301
|
+
return t("section.portrait");
|
|
37302
|
+
}
|
|
37303
|
+
}), null);
|
|
37304
|
+
insert(_el$, createComponent(Button$1, {
|
|
37305
|
+
icon: "rectangle-horizontal",
|
|
37222
37306
|
get active() {
|
|
37223
37307
|
return api.commands.state("toggleOrientation").isActive;
|
|
37224
37308
|
},
|
|
37225
|
-
"data-testid": "editor-toolbar-orientation",
|
|
37226
|
-
onClick: () => api.commands.execute(
|
|
37309
|
+
"data-testid": "editor-toolbar-orientation-landscape",
|
|
37310
|
+
onClick: () => api.commands.execute({
|
|
37311
|
+
name: "setOrientation",
|
|
37312
|
+
payload: "landscape"
|
|
37313
|
+
}),
|
|
37227
37314
|
get tooltip() {
|
|
37228
|
-
return t("section.
|
|
37315
|
+
return t("section.landscape");
|
|
37229
37316
|
}
|
|
37230
|
-
}));
|
|
37317
|
+
}), null);
|
|
37231
37318
|
return _el$;
|
|
37232
37319
|
})(), (() => {
|
|
37233
37320
|
var _el$2 = _tmpl$();
|