oasis-editor 0.0.19 → 0.0.21
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-xXfigQp4.js → OasisEditorApp-D-O4XHvu.js} +15 -4
- package/dist/core/plugin.d.ts +2 -1
- package/dist/i18n/locales/en.d.ts +13 -2
- package/dist/i18n/locales/pt-BR.d.ts +13 -2
- package/dist/{index-C7Ftk4dm.js → index-BmpiQ2A0.js} +506 -228
- 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 +3 -4
- package/dist/ui/components/Toolbar/groups/MarginsGroup.d.ts +7 -0
- package/dist/ui/components/Toolbar/groups/SectionGroup.d.ts +2 -1
- package/dist/ui/components/Toolbar/marginPresets.d.ts +34 -0
- package/dist/ui/components/Toolbar/presets/builtinToolbarIds.d.ts +1 -0
- package/dist/ui/components/Toolbar/primitives/Button.d.ts +1 -0
- package/dist/ui/components/Toolbar/primitives/Menu.d.ts +1 -0
- package/dist/ui/components/Toolbar/ribbon/RibbonGroup.d.ts +2 -1
- package/dist/ui/components/Toolbar/ribbon/ribbonModel.d.ts +2 -0
- package/dist/ui/components/Toolbar/schema/items.d.ts +3 -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 getPageColumnRects, aq as findFootnoteReference, ar as FOOTNOTE_MARKER_GUTTER_PX, as as resolveImporterForFile, at as createEditorStateFromDocument, au as getDocumentParagraphsCanonical, av as getToolbarStyleState, aw as STANDARD_FONT_SIZES_PT, ax as fontSizePxToPt, ay as probeLocalFontFamilies, az as createInitialEditorState, aA as parseFontSizePtToPx, aB as formatFontSizePt, aC as listKindForTag, aD as isParagraphTag, aE as collectInlineRuns, aF as parseParagraphStyle, aG as t, aH as preciseFontModeVersion, aI as isPreciseFontModeEnabled, aJ as togglePreciseFontMode, aK as nextFontSizePt, aL as previousFontSizePt, aM as fontSizePtToPx, aN as createDefaultToolbarPreset, aO as defaultMenuItems, aP as MenuRegistry, aQ as createToolbarRegistry, aR as Editor, aS as resolveCommandRef, aT as commandRefName, aU as InlineShell, aV as BalloonShell, aW as DocumentShell, aX as createMemo, aY as getCaretRectFromSnapshot, aZ as getParagraphRectFromSnapshot, a_ as createComponent, a$ as CaretOverlay, b0 as Show, b1 as createRenderEffect, b2 as style, b3 as setAttribute, b4 as setStyleProperty, b5 as memo, b6 as template, b7 as insert, b8 as use, b9 as addEventListener, ba as Dialog, bb as delegateEvents, bc as className, bd as For, be as UNDERLINE_STYLE_OPTIONS, bf as Tabs, bg as measureParagraphMinContentWidthPx, bh as getEditableBlocksForZone, bi as findParagraphLocation, bj as createSectionBoundaryParagraph, bk as normalizePageSettings, bl as DEFAULT_EDITOR_PAGE_SETTINGS, bm as markStart, bn as markEnd, bo as getParagraphEntries, bp as getParagraphById, bq as PluginUiHost, br as OasisEditorEditor, bs as perfTimer, bt as OasisBrandMark, bu as setPreciseFontPreference, bv as setWelcomeSeen, bw as enablePreciseFontMode, bx as createOasisEditorClient, by as setLocale, bz as startLongTaskObserver, bA as installGlobalReport, bB as applyStoredPreciseFontPreference, bC as getWelcomeSeen, bD as isLocalFontAccessSupported, bE as EDITOR_SCROLL_PADDING_PX, bF as Toolbar, bG as OasisEditorLoading, bH as createEditorLogger, bI as getCachedCanvasImage, bJ 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 getPageColumnRects, aq as findFootnoteReference, ar as FOOTNOTE_MARKER_GUTTER_PX, as as resolveImporterForFile, at as createEditorStateFromDocument, au as getDocumentParagraphsCanonical, av as getToolbarStyleState, aw as STANDARD_FONT_SIZES_PT, ax as fontSizePxToPt, ay as probeLocalFontFamilies, az as createInitialEditorState, aA as parseFontSizePtToPx, aB as formatFontSizePt, aC as listKindForTag, aD as isParagraphTag, aE as collectInlineRuns, aF as parseParagraphStyle, aG as t, aH as preciseFontModeVersion, aI as isPreciseFontModeEnabled, aJ as togglePreciseFontMode, aK as nextFontSizePt, aL as previousFontSizePt, aM as fontSizePtToPx, aN as createDefaultToolbarPreset, aO as defaultMenuItems, aP as MenuRegistry, aQ as createToolbarRegistry, aR as Editor, aS as resolveCommandRef, aT as commandRefName, aU as InlineShell, aV as BalloonShell, aW as DocumentShell, aX as createMemo, aY as getCaretRectFromSnapshot, aZ as getParagraphRectFromSnapshot, a_ as createComponent, a$ as CaretOverlay, b0 as Show, b1 as createRenderEffect, b2 as style, b3 as setAttribute, b4 as setStyleProperty, b5 as memo, b6 as template, b7 as insert, b8 as use, b9 as addEventListener, ba as Dialog, bb as delegateEvents, bc as className, bd as For, be as UNDERLINE_STYLE_OPTIONS, bf as Tabs, bg as measureParagraphMinContentWidthPx, bh as getEditableBlocksForZone, bi as findParagraphLocation, bj as createSectionBoundaryParagraph, bk as normalizePageSettings, bl as DEFAULT_EDITOR_PAGE_SETTINGS, bm as markStart, bn as markEnd, bo as getParagraphEntries, bp as getParagraphById, bq as PluginUiHost, br as OasisEditorEditor, bs as perfTimer, bt as OasisBrandMark, bu as setPreciseFontPreference, bv as setWelcomeSeen, bw as enablePreciseFontMode, bx as createOasisEditorClient, by as setLocale, bz as startLongTaskObserver, bA as installGlobalReport, bB as applyStoredPreciseFontPreference, bC as getWelcomeSeen, bD as isLocalFontAccessSupported, bE as EDITOR_SCROLL_PADDING_PX, bF as Toolbar, bG as OasisEditorLoading, bH as createEditorLogger, bI as getCachedCanvasImage, bJ as registerDomStatsSurface } from "./index-BmpiQ2A0.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) {
|
|
@@ -41233,9 +41233,13 @@ function buildParagraphAndSectionCommands({
|
|
|
41233
41233
|
"sectionBreakContinuous",
|
|
41234
41234
|
() => section.breakContinuous()
|
|
41235
41235
|
),
|
|
41236
|
-
setPageMargins: actionCommand(
|
|
41237
|
-
|
|
41238
|
-
|
|
41236
|
+
setPageMargins: actionCommand(
|
|
41237
|
+
"setPageMargins",
|
|
41238
|
+
(p) => {
|
|
41239
|
+
section.setPageMargins(p ?? {});
|
|
41240
|
+
},
|
|
41241
|
+
() => ({ value: section.getMargins() })
|
|
41242
|
+
)
|
|
41239
41243
|
};
|
|
41240
41244
|
}
|
|
41241
41245
|
function buildTableCommands({
|
|
@@ -41661,6 +41665,12 @@ function createEditorEssentialsRuntimePlugin(options) {
|
|
|
41661
41665
|
},
|
|
41662
41666
|
breakNextPage: () => options.commandsController.applyInsertSectionBreakCommand("nextPage"),
|
|
41663
41667
|
breakContinuous: () => options.commandsController.applyInsertSectionBreakCommand("continuous"),
|
|
41668
|
+
getMargins: () => {
|
|
41669
|
+
var _a, _b;
|
|
41670
|
+
const idx = getActiveSectionIndex(options.state());
|
|
41671
|
+
const section = ((_a = options.state().document.sections) == null ? void 0 : _a[idx]) ?? options.state().document;
|
|
41672
|
+
return (_b = section == null ? void 0 : section.pageSettings) == null ? void 0 : _b.margins;
|
|
41673
|
+
},
|
|
41664
41674
|
setPageMargins: (margins) => {
|
|
41665
41675
|
var _a;
|
|
41666
41676
|
const idx = getActiveSectionIndex(options.state());
|
|
@@ -41831,6 +41841,7 @@ function useEditorRuntimePlugins(options) {
|
|
|
41831
41841
|
tab: item.tab ?? "plugins",
|
|
41832
41842
|
group: item.group ?? "general",
|
|
41833
41843
|
row: item.row ?? 1,
|
|
41844
|
+
ribbonSize: item.ribbonSize,
|
|
41834
41845
|
order: item.order
|
|
41835
41846
|
};
|
|
41836
41847
|
toolbarRegistry.register(contributed);
|
package/dist/core/plugin.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { JSX } from 'solid-js';
|
|
|
2
2
|
import { EditorState } from './model.js';
|
|
3
3
|
import { Editor } from './Editor.js';
|
|
4
4
|
import { CommandRef } from './commands/CommandRef.js';
|
|
5
|
-
import { RibbonRow, RibbonTabId } from '../ui/components/Toolbar/schema/items.js';
|
|
5
|
+
import { RibbonRow, RibbonSize, RibbonTabId } from '../ui/components/Toolbar/schema/items.js';
|
|
6
6
|
|
|
7
7
|
export type Unsubscribe = () => void;
|
|
8
8
|
export interface OasisCommandContext {
|
|
@@ -47,6 +47,7 @@ export interface PluginAction {
|
|
|
47
47
|
tab?: RibbonTabId;
|
|
48
48
|
group?: string;
|
|
49
49
|
row?: RibbonRow;
|
|
50
|
+
ribbonSize?: RibbonSize;
|
|
50
51
|
order?: number;
|
|
51
52
|
}
|
|
52
53
|
export interface PluginMenuItem extends PluginAction {
|
|
@@ -148,8 +148,19 @@ export declare const en: {
|
|
|
148
148
|
"section.pageSetup": string;
|
|
149
149
|
"section.toggleOrientation": string;
|
|
150
150
|
"section.margins": string;
|
|
151
|
-
"section.
|
|
152
|
-
"section.
|
|
151
|
+
"section.marginPreset.normal": string;
|
|
152
|
+
"section.marginPreset.narrow": string;
|
|
153
|
+
"section.marginPreset.moderate": string;
|
|
154
|
+
"section.marginPreset.wide": string;
|
|
155
|
+
"section.marginPreset.mirrored": string;
|
|
156
|
+
"section.marginPreset.custom": string;
|
|
157
|
+
"section.marginField.top": string;
|
|
158
|
+
"section.marginField.bottom": string;
|
|
159
|
+
"section.marginField.left": string;
|
|
160
|
+
"section.marginField.right": string;
|
|
161
|
+
"section.marginValue": string;
|
|
162
|
+
"section.marginApply": string;
|
|
163
|
+
"number.decimalSeparator": string;
|
|
153
164
|
"section.secNext": string;
|
|
154
165
|
"section.secNextTooltip": string;
|
|
155
166
|
"section.secCont": string;
|
|
@@ -148,8 +148,19 @@ export declare const ptBR: {
|
|
|
148
148
|
"section.pageSetup": string;
|
|
149
149
|
"section.toggleOrientation": string;
|
|
150
150
|
"section.margins": string;
|
|
151
|
-
"section.
|
|
152
|
-
"section.
|
|
151
|
+
"section.marginPreset.normal": string;
|
|
152
|
+
"section.marginPreset.narrow": string;
|
|
153
|
+
"section.marginPreset.moderate": string;
|
|
154
|
+
"section.marginPreset.wide": string;
|
|
155
|
+
"section.marginPreset.mirrored": string;
|
|
156
|
+
"section.marginPreset.custom": string;
|
|
157
|
+
"section.marginField.top": string;
|
|
158
|
+
"section.marginField.bottom": string;
|
|
159
|
+
"section.marginField.left": string;
|
|
160
|
+
"section.marginField.right": string;
|
|
161
|
+
"section.marginValue": string;
|
|
162
|
+
"section.marginApply": string;
|
|
163
|
+
"number.decimalSeparator": string;
|
|
153
164
|
"section.secNext": string;
|
|
154
165
|
"section.secNextTooltip": string;
|
|
155
166
|
"section.secCont": string;
|