oasis-editor 0.0.27 → 0.0.29
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-TgBKJPpl.js → OasisEditorApp-D0fgzHt5.js} +198 -6
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/tableOfContents.d.ts +32 -0
- package/dist/core/headings.d.ts +8 -0
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/pt-BR.d.ts +2 -0
- package/dist/{index-BaKkmGAh.js → index-CMOt03WH.js} +141 -119
- package/dist/oasis-editor.js +54 -54
- package/dist/oasis-editor.umd.cjs +4 -4
- package/package.json +1 -1
|
@@ -1843,6 +1843,8 @@ const en = {
|
|
|
1843
1843
|
"menu.view.outline": "Show Outline",
|
|
1844
1844
|
"menu.view.fullscreen": "Full Screen",
|
|
1845
1845
|
"menu.insert": "Insert",
|
|
1846
|
+
"menu.insert.toc": "Table of Contents",
|
|
1847
|
+
"menu.insert.updateToc": "Update Table of Contents",
|
|
1846
1848
|
"menu.layout": "Layout",
|
|
1847
1849
|
"menu.format": "Format",
|
|
1848
1850
|
"menu.format.align": "Align",
|
|
@@ -2299,6 +2301,8 @@ const ptBR = {
|
|
|
2299
2301
|
"menu.view.outline": "Mostrar Estrutura",
|
|
2300
2302
|
"menu.view.fullscreen": "Tela Inteira",
|
|
2301
2303
|
"menu.insert": "Inserir",
|
|
2304
|
+
"menu.insert.toc": "Sumário",
|
|
2305
|
+
"menu.insert.updateToc": "Atualizar Sumário",
|
|
2302
2306
|
"menu.layout": "Layout",
|
|
2303
2307
|
"menu.format": "Formatar",
|
|
2304
2308
|
"menu.format.align": "Alinhar",
|
|
@@ -2438,7 +2442,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2438
2442
|
onCleanup(() => {
|
|
2439
2443
|
cancelled = true;
|
|
2440
2444
|
});
|
|
2441
|
-
import("./OasisEditorApp-
|
|
2445
|
+
import("./OasisEditorApp-D0fgzHt5.js").then((m) => {
|
|
2442
2446
|
cancelled = true;
|
|
2443
2447
|
setProgress(1);
|
|
2444
2448
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -4381,6 +4385,8 @@ function createEditorCommandBus(editor) {
|
|
|
4381
4385
|
const OASIS_BUILTIN_COMMANDS = [
|
|
4382
4386
|
"selectAll",
|
|
4383
4387
|
"insertFootnote",
|
|
4388
|
+
"insertTableOfContents",
|
|
4389
|
+
"updateTableOfContents",
|
|
4384
4390
|
"pastePlainText",
|
|
4385
4391
|
"bold",
|
|
4386
4392
|
"italic",
|
|
@@ -4723,6 +4729,20 @@ const defaultMenuItems = [
|
|
|
4723
4729
|
command: "insertFootnote",
|
|
4724
4730
|
icon: "footnote"
|
|
4725
4731
|
},
|
|
4732
|
+
{
|
|
4733
|
+
id: "insert_toc",
|
|
4734
|
+
path: "Insert/Table of Contents",
|
|
4735
|
+
labelKey: "menu.insert.toc",
|
|
4736
|
+
command: "insertTableOfContents",
|
|
4737
|
+
icon: "list"
|
|
4738
|
+
},
|
|
4739
|
+
{
|
|
4740
|
+
id: "insert_toc_update",
|
|
4741
|
+
path: "Insert/Update Table of Contents",
|
|
4742
|
+
labelKey: "menu.insert.updateToc",
|
|
4743
|
+
command: "updateTableOfContents",
|
|
4744
|
+
icon: "refresh-cw"
|
|
4745
|
+
},
|
|
4726
4746
|
{ id: "insert_hr", path: "Insert/Horizontal Rule", hidden: true },
|
|
4727
4747
|
{
|
|
4728
4748
|
id: "insert_pageBreak",
|
|
@@ -5106,26 +5126,27 @@ function TitleBar(props) {
|
|
|
5106
5126
|
return _el$;
|
|
5107
5127
|
})();
|
|
5108
5128
|
}
|
|
5129
|
+
function getHeadingLevel(styleId) {
|
|
5130
|
+
if (!styleId) return null;
|
|
5131
|
+
const match = /^heading\s*([1-9])$/i.exec(styleId.trim());
|
|
5132
|
+
return match ? parseInt(match[1], 10) : null;
|
|
5133
|
+
}
|
|
5109
5134
|
function outlineFrom(doc) {
|
|
5110
5135
|
var _a;
|
|
5111
5136
|
const paragraphs = getDocumentParagraphs(doc);
|
|
5112
5137
|
const items = [];
|
|
5113
5138
|
for (const p of paragraphs) {
|
|
5114
|
-
const
|
|
5115
|
-
if (
|
|
5116
|
-
const
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
anchor: p.id
|
|
5126
|
-
// Using paragraph ID as the anchor
|
|
5127
|
-
});
|
|
5128
|
-
}
|
|
5139
|
+
const level = getHeadingLevel((_a = p.style) == null ? void 0 : _a.styleId);
|
|
5140
|
+
if (level !== null && level <= 6) {
|
|
5141
|
+
const text = getParagraphText(p).trim();
|
|
5142
|
+
if (text) {
|
|
5143
|
+
items.push({
|
|
5144
|
+
id: p.id,
|
|
5145
|
+
level,
|
|
5146
|
+
text,
|
|
5147
|
+
anchor: p.id
|
|
5148
|
+
// Using paragraph ID as the anchor
|
|
5149
|
+
});
|
|
5129
5150
|
}
|
|
5130
5151
|
}
|
|
5131
5152
|
}
|
|
@@ -11176,7 +11197,7 @@ function resolveTabAdvancePx(paragraph, styles, defaultTabStop, lineStartInset,
|
|
|
11176
11197
|
styles
|
|
11177
11198
|
);
|
|
11178
11199
|
const currentLeft = lineStartInset + lineWidth;
|
|
11179
|
-
const tabOrigin =
|
|
11200
|
+
const tabOrigin = 0;
|
|
11180
11201
|
const explicitStops = (paragraphStyle.tabs ?? []).filter((tab) => tab.type !== "clear" && Number.isFinite(tab.position)).map((tab) => ({
|
|
11181
11202
|
...tab,
|
|
11182
11203
|
positionPx: tabOrigin + tab.position * PX_PER_POINT$1
|
|
@@ -40133,7 +40154,7 @@ export {
|
|
|
40133
40154
|
imageExtensionFromMime as Z,
|
|
40134
40155
|
pxToPt as _,
|
|
40135
40156
|
getParagraphLength as a,
|
|
40136
|
-
|
|
40157
|
+
createComponent as a$,
|
|
40137
40158
|
buildCanvasTableLayout as a0,
|
|
40138
40159
|
resolveFloatingObjectRect as a1,
|
|
40139
40160
|
getTextBoxFloatingGeometry as a2,
|
|
@@ -40151,26 +40172,26 @@ export {
|
|
|
40151
40172
|
collectInlineRuns as aE,
|
|
40152
40173
|
parseParagraphStyle as aF,
|
|
40153
40174
|
t as aG,
|
|
40154
|
-
|
|
40155
|
-
|
|
40156
|
-
|
|
40157
|
-
|
|
40158
|
-
|
|
40159
|
-
|
|
40160
|
-
|
|
40161
|
-
|
|
40162
|
-
|
|
40163
|
-
|
|
40164
|
-
|
|
40165
|
-
|
|
40166
|
-
|
|
40167
|
-
|
|
40168
|
-
|
|
40169
|
-
|
|
40170
|
-
|
|
40171
|
-
|
|
40172
|
-
|
|
40173
|
-
|
|
40175
|
+
getHeadingLevel as aH,
|
|
40176
|
+
preciseFontModeVersion as aI,
|
|
40177
|
+
isPreciseFontModeEnabled as aJ,
|
|
40178
|
+
togglePreciseFontMode as aK,
|
|
40179
|
+
nextFontSizePt as aL,
|
|
40180
|
+
previousFontSizePt as aM,
|
|
40181
|
+
fontSizePtToPx as aN,
|
|
40182
|
+
createDefaultToolbarPreset as aO,
|
|
40183
|
+
defaultMenuItems as aP,
|
|
40184
|
+
MenuRegistry as aQ,
|
|
40185
|
+
createToolbarRegistry as aR,
|
|
40186
|
+
Editor as aS,
|
|
40187
|
+
resolveCommandRef as aT,
|
|
40188
|
+
commandRefName as aU,
|
|
40189
|
+
InlineShell as aV,
|
|
40190
|
+
BalloonShell as aW,
|
|
40191
|
+
DocumentShell as aX,
|
|
40192
|
+
createMemo as aY,
|
|
40193
|
+
getCaretRectFromSnapshot as aZ,
|
|
40194
|
+
getParagraphRectFromSnapshot as a_,
|
|
40174
40195
|
underlineStyleLineWidthPx as aa,
|
|
40175
40196
|
underlineStyleDashArray as ab,
|
|
40176
40197
|
getListLabelInset as ac,
|
|
@@ -40198,88 +40219,89 @@ export {
|
|
|
40198
40219
|
probeLocalFontFamilies as ay,
|
|
40199
40220
|
createInitialEditorState as az,
|
|
40200
40221
|
createEditorRun as b,
|
|
40201
|
-
|
|
40202
|
-
|
|
40203
|
-
|
|
40204
|
-
|
|
40205
|
-
|
|
40206
|
-
|
|
40207
|
-
|
|
40208
|
-
|
|
40209
|
-
|
|
40210
|
-
|
|
40211
|
-
|
|
40212
|
-
|
|
40213
|
-
|
|
40214
|
-
|
|
40215
|
-
|
|
40216
|
-
|
|
40217
|
-
|
|
40218
|
-
|
|
40219
|
-
|
|
40220
|
-
|
|
40221
|
-
|
|
40222
|
-
|
|
40223
|
-
|
|
40224
|
-
|
|
40225
|
-
|
|
40226
|
-
|
|
40227
|
-
|
|
40228
|
-
|
|
40229
|
-
|
|
40230
|
-
|
|
40231
|
-
|
|
40232
|
-
|
|
40233
|
-
|
|
40234
|
-
|
|
40235
|
-
|
|
40236
|
-
|
|
40237
|
-
|
|
40238
|
-
|
|
40239
|
-
|
|
40240
|
-
|
|
40241
|
-
|
|
40242
|
-
|
|
40243
|
-
|
|
40244
|
-
|
|
40245
|
-
|
|
40246
|
-
|
|
40247
|
-
|
|
40248
|
-
|
|
40249
|
-
|
|
40250
|
-
|
|
40251
|
-
|
|
40252
|
-
|
|
40253
|
-
|
|
40254
|
-
|
|
40255
|
-
|
|
40256
|
-
|
|
40257
|
-
|
|
40258
|
-
|
|
40259
|
-
|
|
40260
|
-
|
|
40261
|
-
|
|
40262
|
-
|
|
40263
|
-
|
|
40264
|
-
|
|
40222
|
+
PluginCollection as b$,
|
|
40223
|
+
CaretOverlay as b0,
|
|
40224
|
+
Show as b1,
|
|
40225
|
+
createRenderEffect as b2,
|
|
40226
|
+
style as b3,
|
|
40227
|
+
setAttribute as b4,
|
|
40228
|
+
setStyleProperty as b5,
|
|
40229
|
+
memo as b6,
|
|
40230
|
+
template as b7,
|
|
40231
|
+
insert as b8,
|
|
40232
|
+
use as b9,
|
|
40233
|
+
createEditorZoom as bA,
|
|
40234
|
+
startLongTaskObserver as bB,
|
|
40235
|
+
installGlobalReport as bC,
|
|
40236
|
+
applyStoredPreciseFontPreference as bD,
|
|
40237
|
+
getWelcomeSeen as bE,
|
|
40238
|
+
isLocalFontAccessSupported as bF,
|
|
40239
|
+
EDITOR_SCROLL_PADDING_PX as bG,
|
|
40240
|
+
Toolbar as bH,
|
|
40241
|
+
OasisEditorLoading as bI,
|
|
40242
|
+
createEditorLogger as bJ,
|
|
40243
|
+
getCachedCanvasImage as bK,
|
|
40244
|
+
registerDomStatsSurface as bL,
|
|
40245
|
+
Button as bM,
|
|
40246
|
+
Checkbox as bN,
|
|
40247
|
+
ColorPicker as bO,
|
|
40248
|
+
CommandRegistry as bP,
|
|
40249
|
+
DEFAULT_PALETTE as bQ,
|
|
40250
|
+
DialogFooter as bR,
|
|
40251
|
+
FloatingActionButton as bS,
|
|
40252
|
+
GridPicker as bT,
|
|
40253
|
+
IconButton as bU,
|
|
40254
|
+
Menu as bV,
|
|
40255
|
+
OASIS_BUILTIN_COMMANDS as bW,
|
|
40256
|
+
OASIS_MENU_ITEMS as bX,
|
|
40257
|
+
OASIS_TOOLBAR_ITEMS as bY,
|
|
40258
|
+
OasisEditorAppLazy as bZ,
|
|
40259
|
+
OasisEditorContainer as b_,
|
|
40260
|
+
addEventListener as ba,
|
|
40261
|
+
Dialog as bb,
|
|
40262
|
+
delegateEvents as bc,
|
|
40263
|
+
className as bd,
|
|
40264
|
+
For as be,
|
|
40265
|
+
UNDERLINE_STYLE_OPTIONS as bf,
|
|
40266
|
+
Tabs as bg,
|
|
40267
|
+
measureParagraphMinContentWidthPx as bh,
|
|
40268
|
+
getEditableBlocksForZone as bi,
|
|
40269
|
+
findParagraphLocation as bj,
|
|
40270
|
+
createSectionBoundaryParagraph as bk,
|
|
40271
|
+
normalizePageSettings as bl,
|
|
40272
|
+
DEFAULT_EDITOR_PAGE_SETTINGS as bm,
|
|
40273
|
+
markStart as bn,
|
|
40274
|
+
markEnd as bo,
|
|
40275
|
+
getParagraphEntries as bp,
|
|
40276
|
+
getParagraphById as bq,
|
|
40277
|
+
PluginUiHost as br,
|
|
40278
|
+
OasisEditorEditor as bs,
|
|
40279
|
+
perfTimer as bt,
|
|
40280
|
+
OasisBrandMark as bu,
|
|
40281
|
+
setPreciseFontPreference as bv,
|
|
40282
|
+
setWelcomeSeen as bw,
|
|
40283
|
+
enablePreciseFontMode as bx,
|
|
40284
|
+
createOasisEditorClient as by,
|
|
40285
|
+
setLocale as bz,
|
|
40265
40286
|
createEditorParagraphFromRuns as c,
|
|
40266
|
-
|
|
40267
|
-
|
|
40268
|
-
|
|
40269
|
-
|
|
40270
|
-
|
|
40271
|
-
|
|
40272
|
-
|
|
40273
|
-
|
|
40274
|
-
|
|
40275
|
-
|
|
40276
|
-
|
|
40277
|
-
|
|
40278
|
-
|
|
40279
|
-
|
|
40280
|
-
|
|
40281
|
-
|
|
40282
|
-
|
|
40287
|
+
Popover as c0,
|
|
40288
|
+
RIBBON_TABS as c1,
|
|
40289
|
+
RIBBON_TAB_DEFINITIONS as c2,
|
|
40290
|
+
Select as c3,
|
|
40291
|
+
SelectField as c4,
|
|
40292
|
+
Separator as c5,
|
|
40293
|
+
SidePanel as c6,
|
|
40294
|
+
SidePanelBody as c7,
|
|
40295
|
+
SidePanelFooter as c8,
|
|
40296
|
+
SidePanelHeader as c9,
|
|
40297
|
+
SplitButton as ca,
|
|
40298
|
+
TextField as cb,
|
|
40299
|
+
Button$1 as cc,
|
|
40300
|
+
createEditorCommandBus as cd,
|
|
40301
|
+
createOasisEditor as ce,
|
|
40302
|
+
createOasisEditorContainer as cf,
|
|
40303
|
+
mount as cg,
|
|
40304
|
+
registerToolbarRenderer as ch,
|
|
40283
40305
|
getDocumentSections as d,
|
|
40284
40306
|
createEditorStyledRun as e,
|
|
40285
40307
|
getParagraphText as f,
|
package/dist/oasis-editor.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aW, bM, bN, bO, bP, bQ, bb, bR, aX, aS, bS, bT, bU, aV, bV, aQ, bW, bX, bY, bZ, b_, bI, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, bg, cb, bH, cc, bO as bO2, bT as bT2, bV as bV2, c3 as c32, c5 as c52, ca as ca2, aU, aO, cd, ce, cf, aR, cg, ch, aT } from "./index-CMOt03WH.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
3
|
+
aW as BalloonShell,
|
|
4
|
+
bM as Button,
|
|
5
|
+
bN as Checkbox,
|
|
6
|
+
bO as ColorPicker,
|
|
7
|
+
bP as CommandRegistry,
|
|
8
|
+
bQ as DEFAULT_PALETTE,
|
|
9
|
+
bb as Dialog,
|
|
10
|
+
bR as DialogFooter,
|
|
11
|
+
aX as DocumentShell,
|
|
12
|
+
aS as Editor,
|
|
13
|
+
bS as FloatingActionButton,
|
|
14
|
+
bT as GridPicker,
|
|
15
|
+
bU as IconButton,
|
|
16
|
+
aV as InlineShell,
|
|
17
|
+
bV as Menu,
|
|
18
|
+
aQ as MenuRegistry,
|
|
19
|
+
bW as OASIS_BUILTIN_COMMANDS,
|
|
20
|
+
bX as OASIS_MENU_ITEMS,
|
|
21
|
+
bY as OASIS_TOOLBAR_ITEMS,
|
|
22
|
+
bZ as OasisEditorAppLazy,
|
|
23
|
+
b_ as OasisEditorContainer,
|
|
24
|
+
bI as OasisEditorLoading,
|
|
25
|
+
b$ as PluginCollection,
|
|
26
|
+
c0 as Popover,
|
|
27
|
+
c1 as RIBBON_TABS,
|
|
28
|
+
c2 as RIBBON_TAB_DEFINITIONS,
|
|
29
|
+
c3 as Select,
|
|
30
|
+
c4 as SelectField,
|
|
31
|
+
c5 as Separator,
|
|
32
|
+
c6 as SidePanel,
|
|
33
|
+
c7 as SidePanelBody,
|
|
34
|
+
c8 as SidePanelFooter,
|
|
35
|
+
c9 as SidePanelHeader,
|
|
36
|
+
ca as SplitButton,
|
|
37
|
+
bg as Tabs,
|
|
38
|
+
cb as TextField,
|
|
39
|
+
bH as Toolbar,
|
|
40
|
+
cc as ToolbarButton,
|
|
41
|
+
bO2 as ToolbarColorPicker,
|
|
42
|
+
bT2 as ToolbarGridPicker,
|
|
43
|
+
bV2 as ToolbarMenu,
|
|
44
|
+
c32 as ToolbarSelect,
|
|
45
|
+
c52 as ToolbarSeparator,
|
|
46
|
+
ca2 as ToolbarSplitButton,
|
|
47
|
+
aU as commandRefName,
|
|
48
|
+
aO as createDefaultToolbarPreset,
|
|
49
|
+
cd as createEditorCommandBus,
|
|
50
|
+
ce as createOasisEditor,
|
|
51
|
+
cf as createOasisEditorContainer,
|
|
52
|
+
aR as createToolbarRegistry,
|
|
53
|
+
cg as mount,
|
|
54
|
+
ch as registerToolbarRenderer,
|
|
55
|
+
aT as resolveCommandRef
|
|
56
56
|
};
|