oasis-editor 0.0.108 → 0.0.110
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-DkiTrFZ6.js → OasisEditorApp-D3M38bHd.js} +35 -44
- package/dist/assets/{importDocxWorker-thqRCD9m.js → importDocxWorker-DyYGjoXG.js} +1 -1
- package/dist/core/color.d.ts +15 -0
- package/dist/core/units.d.ts +15 -0
- package/dist/export/docx/text/constants.d.ts +1 -3
- package/dist/export/pdf/units.d.ts +2 -1
- package/dist/i18n/locales/en.d.ts +10 -0
- package/dist/i18n/locales/pt-BR.d.ts +10 -0
- package/dist/import/docx/runs/units.d.ts +2 -4
- package/dist/import/docx/units.d.ts +2 -2
- package/dist/{index-DzBLUs91.js → index-DezzFA4l.js} +1745 -1054
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +50 -50
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/canvas/canvasInlineReaders.d.ts +23 -0
- package/dist/ui/components/Toolbar/ShapeGallery.d.ts +11 -0
- package/dist/ui/components/Toolbar/recentShapes.d.ts +8 -0
- package/dist/ui/components/Toolbar/shapeCatalog.d.ts +23 -0
- package/dist/ui/components/Toolbar/shapePreview.d.ts +16 -0
- package/dist/ui/textMeasurement/constants.d.ts +1 -1
- 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 { d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageContentWidth, b as getPageBodyTop, c as getPageBodyBottom, l as listReferencedEndnotes, f as getFootnoteDisplayMarker, s as setActiveHyphenation, h as getDocumentSections, i as buildFootnoteReservations, M as MAX_FOOTNOTE_LAYOUT_ITERATIONS, r as reservationSignature, j as applyFootnotesToPages, k as getRunField, m as projectBlocksLayout, v as visitRun, n as assertNever, o as createSignal, q as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as createEditorStyledRun, A as getParagraphLength, B as getParagraphText, C as getActiveZone, D as getActiveSectionIndex, E as getParagraphs, F as normalizeSelection, G as positionToParagraphOffset, H as paragraphOffsetToPosition, I as clampPosition, J as findParagraphIndex, K as createCollapsedSelection, L as isSelectionCollapsed, N as parseFontSizePtToPx, O as formatFontSizePt, P as createEditorParagraph, Q as getBlockParagraphs, R as findParagraphTableLocation, T as buildTableCellLayout, U as PT_PER_PX, V as createEditorTableCell, W as createEditorTableRow, X as createEditorTable, Y as underlineStyleToCssDecorationStyle, Z as resolveImageSrc, _ as listKindForTag, $ as isParagraphTag, a0 as collectInlineRuns, a1 as parseParagraphStyle, a2 as getRunImage, a3 as InlineShell, a4 as BalloonShell, a5 as DocumentShell, a6 as createMemo, a7 as getCaretRectFromSnapshot, a8 as getParagraphRectFromSnapshot, a9 as createComponent, aa as CaretOverlay, ab as Show, ac as createRenderEffect, ad as style, ae as setAttribute, af as setStyleProperty, ag as memo, ah as template, ai as useI18n, aj as createEffect, ak as insert, al as use, am as addEventListener, an as Dialog, ao as delegateEvents, ap as className, aq as For, ar as UNDERLINE_STYLE_OPTIONS, as as Tabs, at as onMount, au as onCleanup, av as PluginUiHost, aw as OasisEditorEditor, ax as OasisBrandMark, ay as setPreciseFontPreference, az as setWelcomeSeen, aA as enablePreciseFontMode, aB as TWIPS_PER_POINT, aC as PX_PER_INCH, aD as TWIPS_PER_INCH, aE as
|
|
4
|
+
import { d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageContentWidth, b as getPageBodyTop, c as getPageBodyBottom, l as listReferencedEndnotes, f as getFootnoteDisplayMarker, s as setActiveHyphenation, h as getDocumentSections, i as buildFootnoteReservations, M as MAX_FOOTNOTE_LAYOUT_ITERATIONS, r as reservationSignature, j as applyFootnotesToPages, k as getRunField, m as projectBlocksLayout, v as visitRun, n as assertNever, o as createSignal, q as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as createEditorStyledRun, A as getParagraphLength, B as getParagraphText, C as getActiveZone, D as getActiveSectionIndex, E as getParagraphs, F as normalizeSelection, G as positionToParagraphOffset, H as paragraphOffsetToPosition, I as clampPosition, J as findParagraphIndex, K as createCollapsedSelection, L as isSelectionCollapsed, N as parseFontSizePtToPx, O as formatFontSizePt, P as createEditorParagraph, Q as getBlockParagraphs, R as findParagraphTableLocation, T as buildTableCellLayout, U as PT_PER_PX, V as createEditorTableCell, W as createEditorTableRow, X as createEditorTable, Y as underlineStyleToCssDecorationStyle, Z as resolveImageSrc, _ as listKindForTag, $ as isParagraphTag, a0 as collectInlineRuns, a1 as parseParagraphStyle, a2 as getRunImage, a3 as InlineShell, a4 as BalloonShell, a5 as DocumentShell, a6 as createMemo, a7 as getCaretRectFromSnapshot, a8 as getParagraphRectFromSnapshot, a9 as createComponent, aa as CaretOverlay, ab as Show, ac as createRenderEffect, ad as style, ae as setAttribute, af as setStyleProperty, ag as memo, ah as template, ai as useI18n, aj as createEffect, ak as insert, al as use, am as addEventListener, an as Dialog, ao as delegateEvents, ap as className, aq as For, ar as UNDERLINE_STYLE_OPTIONS, as as Tabs, at as onMount, au as onCleanup, av as PluginUiHost, aw as OasisEditorEditor, ax as OasisBrandMark, ay as setPreciseFontPreference, az as setWelcomeSeen, aA as enablePreciseFontMode, aB as TWIPS_PER_POINT, aC as PX_PER_INCH, aD as TWIPS_PER_INCH, aE as normalizeHex6, aF as resolveEffectiveParagraphStyle, aG as resolveEffectiveTextStyleForParagraph, aH as EMU_PER_PT, aI as OOXML_ROTATION_UNITS, aJ as OOXML_PERCENT_DENOMINATOR, aK as parseHexColorToRgb255, aL as EMU_PER_PX, aM as getRunFootnoteReference, aN as getRunEndnoteReference, aO as iterateFootnoteReferenceRuns, aP as iterateEndnoteReferenceRuns, aQ as imageContentTypeDefaults, aR as getRunFieldChar, aS as getRunFieldInstruction, aT as createEditorRun, aU as JSZip, aV as imageExtensionFromMime, aW as pxToPt$1, aX as resolveFloatingObjectRect, aY as getTextBoxFloatingGeometry, aZ as getPresetPathSegments, a_ as buildListLabels, a$ as getImageFloatingGeometry, b0 as textStyleToFontSizePt, b1 as PX_PER_POINT, b2 as DEFAULT_FONT_SIZE_PX, b3 as resolveOpenTypeFeatureTags, b4 as rgb255ToHex, b5 as isDoubleUnderlineStyle, b6 as isWavyUnderlineStyle, b7 as underlineStyleLineWidthPx, b8 as underlineStyleDashArray, b9 as resolveListLabel, ba as getListLabelInset, bb as getAlignedListLabelInset, bc as getParagraphBorderInsets, bd as buildSegmentTable, be as buildCanvasTableLayout, bf as resolveCanvasTableWidth, bg as resolveFloatingTableRect, bh as normalizeFamily, bi as ROBOTO_FONT_FILES, bj as loadFontAsset, bk as OFFICE_COMPAT_FONT_FAMILIES, bl as BinaryReader, bm as buildSfnt, bn as defaultFontDecoderRegistry, bo as SfntFontProgram, bp as collectPdfFontFamilies, bq as outlineFrom, br as getPageHeaderZoneTop, bs as getPageColumnRects, bt as findFootnoteReference, bu as FOOTNOTE_MARKER_GUTTER_PX, bv as resolveImporterForFile, bw as getDocumentSectionsCanonical, bx as getDocumentParagraphsCanonical, by as getDocumentParagraphs, bz as getDocumentPageSettings, bA as getTableCellContentWidthForParagraph, bB as layoutMetricsEpoch, bC as bumpLayoutMetricsEpoch, bD as createCanvasLayoutSnapshotProvider, bE as on, bF as debounce, bG as unwrap, bH as perfTimer, bI as getRunTextBox, bJ as createEditorDocument, bK as resolveResizedDimensions, bL as resolveTextBoxRenderHeight, bM as getToolbarStyleState, bN as getCachedCanvasImage, bO as measureParagraphMinContentWidthPx, bP as getEditableBlocksForZone, bQ as findParagraphLocation, bR as createSectionBoundaryParagraph, bS as normalizePageSettings, bT as DEFAULT_EDITOR_PAGE_SETTINGS, bU as markStart, bV as markEnd, bW as getParagraphEntries, bX as getParagraphById, bY as createEditorFootnote, bZ as createFootnoteReferenceRun, b_ as renumberFootnotes, b$ as getHeadingLevel, c0 as preciseFontModeVersion, c1 as isPreciseFontModeEnabled, c2 as resolveNamedTextStyle, c3 as togglePreciseFontMode, c4 as nextFontSizePt, c5 as previousFontSizePt, c6 as fontSizePtToPx, c7 as createDefaultToolbarPreset, c8 as MenuRegistry, c9 as createToolbarRegistry, ca as Editor, cb as resolveCommandRef, cc as commandRefName, cd as createOasisEditorClient, ce as createEditorZoom, cf as startLongTaskObserver, cg as installGlobalReport, ch as applyStoredPreciseFontPreference, ci as getWelcomeSeen, cj as isLocalFontAccessSupported, ck as EDITOR_SCROLL_PADDING_PX, cl as Toolbar, cm as OasisEditorLoading, cn as I18nProvider, co as createTranslator, cp as createEditorLogger, cq as registerDomStatsSurface } from "./index-DezzFA4l.js";
|
|
5
5
|
function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
|
|
6
6
|
const {
|
|
7
7
|
pageIndex,
|
|
@@ -33518,8 +33518,7 @@ function pointsToTwips(value) {
|
|
|
33518
33518
|
return Math.max(0, Math.round(value * TWIPS_PER_POINT));
|
|
33519
33519
|
}
|
|
33520
33520
|
function normalizeDocxColor(color, fallback = "000000") {
|
|
33521
|
-
|
|
33522
|
-
return normalized && /^[0-9a-fA-F]{6}$/.test(normalized) ? normalized.toUpperCase() : fallback;
|
|
33521
|
+
return normalizeHex6(color) ?? fallback;
|
|
33523
33522
|
}
|
|
33524
33523
|
function buildBookmarkExportPlan(document2) {
|
|
33525
33524
|
const registry = document2.bookmarks;
|
|
@@ -34469,8 +34468,6 @@ const DOCX_HIGHLIGHT_HEX_ALIASES = {
|
|
|
34469
34468
|
"000000": "black",
|
|
34470
34469
|
ffffff: "white"
|
|
34471
34470
|
};
|
|
34472
|
-
const OOXML_PERCENT_DENOMINATOR = 1e5;
|
|
34473
|
-
const OOXML_ROTATION_UNITS = 6e4;
|
|
34474
34471
|
const MC_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006";
|
|
34475
34472
|
function serializeW14SolidFillXml(color) {
|
|
34476
34473
|
const hex = normalizeDocxColor(color);
|
|
@@ -34482,11 +34479,11 @@ function serializeW14FillXml(fill) {
|
|
|
34482
34479
|
}
|
|
34483
34480
|
const gsXml = fill.stops.map((s) => {
|
|
34484
34481
|
const hex = normalizeDocxColor(s.color);
|
|
34485
|
-
const pos = Math.round(s.position *
|
|
34486
|
-
const alphaXml = s.alpha !== void 0 ? `<w14:alpha w14:val="${Math.round(s.alpha *
|
|
34482
|
+
const pos = Math.round(s.position * OOXML_PERCENT_DENOMINATOR);
|
|
34483
|
+
const alphaXml = s.alpha !== void 0 ? `<w14:alpha w14:val="${Math.round(s.alpha * OOXML_PERCENT_DENOMINATOR)}"/>` : "";
|
|
34487
34484
|
return `<w14:gs w14:pos="${pos}"><w14:srgbClr w14:val="${hex}">${alphaXml}</w14:srgbClr></w14:gs>`;
|
|
34488
34485
|
}).join("");
|
|
34489
|
-
const angVal = Math.round((fill.angle ?? 0) *
|
|
34486
|
+
const angVal = Math.round((fill.angle ?? 0) * OOXML_ROTATION_UNITS);
|
|
34490
34487
|
return `<w14:gradFill><w14:gsLst>${gsXml}</w14:gsLst><w14:lin w14:ang="${angVal}" w14:scaled="0"/></w14:gradFill>`;
|
|
34491
34488
|
}
|
|
34492
34489
|
function serializeTextFillMC(fill, fallbackColor) {
|
|
@@ -34495,34 +34492,34 @@ function serializeTextFillMC(fill, fallbackColor) {
|
|
|
34495
34492
|
return `<mc:AlternateContent xmlns:mc="${MC_NS}"><mc:Choice Requires="w14"><w14:textFill>${fillXml}</w14:textFill></mc:Choice><mc:Fallback><w:color w:val="${fbHex}"/></mc:Fallback></mc:AlternateContent>`;
|
|
34496
34493
|
}
|
|
34497
34494
|
function serializeTextOutlineMC(outline) {
|
|
34498
|
-
const widthEmu = Math.round(Math.max(0, outline.widthPt) *
|
|
34495
|
+
const widthEmu = Math.round(Math.max(0, outline.widthPt) * EMU_PER_PT);
|
|
34499
34496
|
const fillXml = outline.fill ? serializeW14FillXml(outline.fill) : outline.color ? serializeW14SolidFillXml(outline.color) : "";
|
|
34500
34497
|
return `<mc:AlternateContent xmlns:mc="${MC_NS}"><mc:Choice Requires="w14"><w14:textOutline w14:w="${widthEmu}" w14:cap="flat" w14:cmpd="sng" w14:algn="ctr">` + fillXml + `</w14:textOutline></mc:Choice><mc:Fallback><w:outline/></mc:Fallback></mc:AlternateContent>`;
|
|
34501
34498
|
}
|
|
34502
34499
|
function serializeW14ColorEl(color, alpha) {
|
|
34503
34500
|
const hex = normalizeDocxColor(color);
|
|
34504
|
-
const alphaXml = alpha !== void 0 ? `<w14:alpha w14:val="${Math.round(alpha *
|
|
34501
|
+
const alphaXml = alpha !== void 0 ? `<w14:alpha w14:val="${Math.round(alpha * OOXML_PERCENT_DENOMINATOR)}"/>` : "";
|
|
34505
34502
|
return `<w14:srgbClr w14:val="${hex}">${alphaXml}</w14:srgbClr>`;
|
|
34506
34503
|
}
|
|
34507
34504
|
function serializeTextShadowMC(shadow) {
|
|
34508
|
-
const blurEmu = Math.round(Math.max(0, shadow.blurPt) *
|
|
34509
|
-
const distEmu = Math.round(Math.max(0, shadow.distPt) *
|
|
34510
|
-
const dirVal = Math.round(shadow.dirDeg *
|
|
34505
|
+
const blurEmu = Math.round(Math.max(0, shadow.blurPt) * EMU_PER_PT);
|
|
34506
|
+
const distEmu = Math.round(Math.max(0, shadow.distPt) * EMU_PER_PT);
|
|
34507
|
+
const dirVal = Math.round(shadow.dirDeg * OOXML_ROTATION_UNITS);
|
|
34511
34508
|
const colorXml = serializeW14ColorEl(shadow.color, shadow.alpha);
|
|
34512
34509
|
return `<mc:AlternateContent xmlns:mc="${MC_NS}"><mc:Choice Requires="w14"><w14:shadow w14:blurRad="${blurEmu}" w14:dist="${distEmu}" w14:dir="${dirVal}" w14:sx="100000" w14:sy="100000" w14:kx="0" w14:ky="0" w14:algn="ctr">` + colorXml + `</w14:shadow></mc:Choice><mc:Fallback><w:shadow/></mc:Fallback></mc:AlternateContent>`;
|
|
34513
34510
|
}
|
|
34514
34511
|
function serializeGlowMC(glow) {
|
|
34515
|
-
const radEmu = Math.round(Math.max(0, glow.radiusPt) *
|
|
34512
|
+
const radEmu = Math.round(Math.max(0, glow.radiusPt) * EMU_PER_PT);
|
|
34516
34513
|
const colorXml = serializeW14ColorEl(glow.color, glow.alpha);
|
|
34517
34514
|
return `<mc:AlternateContent xmlns:mc="${MC_NS}"><mc:Choice Requires="w14"><w14:glow w14:rad="${radEmu}">${colorXml}</w14:glow></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
|
|
34518
34515
|
}
|
|
34519
34516
|
function serializeReflectionMC(reflection) {
|
|
34520
|
-
const blurEmu = Math.round(Math.max(0, reflection.blurPt) *
|
|
34521
|
-
const stA = Math.round(reflection.startAlpha *
|
|
34522
|
-
const stPos = Math.round(reflection.startPos *
|
|
34523
|
-
const endA = Math.round(reflection.endAlpha *
|
|
34524
|
-
const endPos = Math.round(reflection.endPos *
|
|
34525
|
-
const distEmu = Math.round(Math.max(0, reflection.distPt) *
|
|
34517
|
+
const blurEmu = Math.round(Math.max(0, reflection.blurPt) * EMU_PER_PT);
|
|
34518
|
+
const stA = Math.round(reflection.startAlpha * OOXML_PERCENT_DENOMINATOR);
|
|
34519
|
+
const stPos = Math.round(reflection.startPos * OOXML_PERCENT_DENOMINATOR);
|
|
34520
|
+
const endA = Math.round(reflection.endAlpha * OOXML_PERCENT_DENOMINATOR);
|
|
34521
|
+
const endPos = Math.round(reflection.endPos * OOXML_PERCENT_DENOMINATOR);
|
|
34522
|
+
const distEmu = Math.round(Math.max(0, reflection.distPt) * EMU_PER_PT);
|
|
34526
34523
|
return `<mc:AlternateContent xmlns:mc="${MC_NS}"><mc:Choice Requires="w14"><w14:reflection w14:blurRad="${blurEmu}" w14:stA="${stA}" w14:stPos="${stPos}" w14:endA="${endA}" w14:endPos="${endPos}" w14:dist="${distEmu}" w14:dir="5400000" w14:fadeDir="5400000" w14:sx="100000" w14:sy="-100000" w14:kx="0" w14:ky="0" w14:algn="bl"/></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
|
|
34527
34524
|
}
|
|
34528
34525
|
function serialize3dBlobMC(blob) {
|
|
@@ -34576,17 +34573,7 @@ function stylisticSetToDocx(value) {
|
|
|
34576
34573
|
}
|
|
34577
34574
|
return (1 << value - 1).toString(16).toUpperCase().padStart(8, "0");
|
|
34578
34575
|
}
|
|
34579
|
-
|
|
34580
|
-
const normalized = color.trim().replace(/^#/, "");
|
|
34581
|
-
if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {
|
|
34582
|
-
return null;
|
|
34583
|
-
}
|
|
34584
|
-
return [
|
|
34585
|
-
Number.parseInt(normalized.slice(0, 2), 16),
|
|
34586
|
-
Number.parseInt(normalized.slice(2, 4), 16),
|
|
34587
|
-
Number.parseInt(normalized.slice(4, 6), 16)
|
|
34588
|
-
];
|
|
34589
|
-
}
|
|
34576
|
+
const parseHexColor = parseHexColorToRgb255;
|
|
34590
34577
|
function normalizeHighlightForDocx(highlight) {
|
|
34591
34578
|
if (highlight in DOCX_HIGHLIGHT_COLORS) {
|
|
34592
34579
|
return highlight;
|
|
@@ -36851,11 +36838,16 @@ async function drawFloatingImagesForParagraph(options) {
|
|
|
36851
36838
|
}
|
|
36852
36839
|
}
|
|
36853
36840
|
function blendColorWithWhite(hex, alpha) {
|
|
36841
|
+
const rgb = parseHexColorToRgb255(hex);
|
|
36842
|
+
if (!rgb) {
|
|
36843
|
+
return hex;
|
|
36844
|
+
}
|
|
36854
36845
|
const a = Math.max(0, Math.min(1, alpha));
|
|
36855
|
-
|
|
36856
|
-
|
|
36857
|
-
|
|
36858
|
-
|
|
36846
|
+
return rgb255ToHex(
|
|
36847
|
+
255 + (rgb[0] - 255) * a,
|
|
36848
|
+
255 + (rgb[1] - 255) * a,
|
|
36849
|
+
255 + (rgb[2] - 255) * a
|
|
36850
|
+
);
|
|
36859
36851
|
}
|
|
36860
36852
|
function drawFragmentHighlight(writer, pageIndex, line, fragment, originX, originY, styles) {
|
|
36861
36853
|
if (!styles.highlight) {
|
|
@@ -38069,15 +38061,11 @@ function colorToRgb(color, fallback) {
|
|
|
38069
38061
|
if (!color) {
|
|
38070
38062
|
return fallback;
|
|
38071
38063
|
}
|
|
38072
|
-
const
|
|
38073
|
-
if (
|
|
38064
|
+
const rgb = parseHexColorToRgb255(color);
|
|
38065
|
+
if (!rgb) {
|
|
38074
38066
|
return fallback;
|
|
38075
38067
|
}
|
|
38076
|
-
return [
|
|
38077
|
-
Number.parseInt(normalized.slice(0, 2), 16) / 255,
|
|
38078
|
-
Number.parseInt(normalized.slice(2, 4), 16) / 255,
|
|
38079
|
-
Number.parseInt(normalized.slice(4, 6), 16) / 255
|
|
38080
|
-
];
|
|
38068
|
+
return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255];
|
|
38081
38069
|
}
|
|
38082
38070
|
function colorCommand(color, operator, fallback) {
|
|
38083
38071
|
const [r, g, b] = colorToRgb(color, fallback);
|
|
@@ -40538,7 +40526,8 @@ function buildDocumentInfoBody(info) {
|
|
|
40538
40526
|
const entries = [];
|
|
40539
40527
|
if (info.title) entries.push(`/Title ${encodePdfTextString(info.title)}`);
|
|
40540
40528
|
if (info.author) entries.push(`/Author ${encodePdfTextString(info.author)}`);
|
|
40541
|
-
if (info.subject)
|
|
40529
|
+
if (info.subject)
|
|
40530
|
+
entries.push(`/Subject ${encodePdfTextString(info.subject)}`);
|
|
40542
40531
|
if (info.keywords)
|
|
40543
40532
|
entries.push(`/Keywords ${encodePdfTextString(info.keywords)}`);
|
|
40544
40533
|
if (info.producer)
|
|
@@ -47188,6 +47177,8 @@ function findNextWordBoundary(text, offset) {
|
|
|
47188
47177
|
}
|
|
47189
47178
|
return index;
|
|
47190
47179
|
}
|
|
47180
|
+
const REUSE_MOUSE_DOWN_HIT_MAX_AGE_MS = 600;
|
|
47181
|
+
const REUSE_MOUSE_DOWN_HIT_MAX_DISTANCE_PX = 8;
|
|
47191
47182
|
function resolveTripleClickParagraphRange(state, paragraph, targetZone) {
|
|
47192
47183
|
const zoneParagraphs = getDocumentParagraphs(state.document).filter(
|
|
47193
47184
|
(candidate) => {
|
|
@@ -47596,7 +47587,7 @@ function createEditorSurfaceEvents(deps) {
|
|
|
47596
47587
|
event.clientX - lastMouseDownX,
|
|
47597
47588
|
event.clientY - lastMouseDownY
|
|
47598
47589
|
);
|
|
47599
|
-
const useMouseDownHit = Date.now() - lastMouseDownAt <=
|
|
47590
|
+
const useMouseDownHit = Date.now() - lastMouseDownAt <= REUSE_MOUSE_DOWN_HIT_MAX_AGE_MS && distanceFromMouseDown <= REUSE_MOUSE_DOWN_HIT_MAX_DISTANCE_PX;
|
|
47600
47591
|
const hit = useMouseDownHit ? lastMouseDownHit : deps.resolveSurfaceHitAtPoint(event.clientX, event.clientY);
|
|
47601
47592
|
if (!(hit == null ? void 0 : hit.resolvedFromParagraph)) {
|
|
47602
47593
|
deps.focusInputAfterPointerSelection();
|