oasis-editor 0.0.185 → 0.0.186

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, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
3
3
  var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
4
- import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, q as createSignal, r as cloneEditorState, s as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, v as probeLocalFontFamilies, w as createEditorParagraphFromRuns, x as isInlineObjectRun, y as stylesEqual, z as cloneStyle, A as createEditorStyledRun, B as cloneParagraphList, C as cloneParagraph, D as getParagraphLength, G as cloneRun, H as getActiveZone, I as getActiveSectionIndex, J as getParagraphs, K as normalizeSelection, L as positionToParagraphOffset, M as cloneParagraphs, N as paragraphOffsetToPosition, O as findParagraphIndex, P as createCollapsedSelection, Q as isSelectionCollapsed, R as MATH_OBJECT_REPLACEMENT, T as setValueStyle, U as setBooleanStyle, V as parseFontSizePtToPx, W as formatFontSizePt, X as setParagraphStyleValue, Y as createEditorParagraph, Z as cloneBlocks, _ as resolveDefaultParagraphStyleId, $ as findParagraphTablePathLocation, a0 as findParagraphLocation, a1 as resolveTablePath, a2 as buildTableCellLayout, a3 as PT_PER_PX, a4 as createEditorTableCell, a5 as createEditorTableRow, a6 as createEditorTable, a7 as clampPosition, a8 as PX_PER_POINT, a9 as underlineStyleToCssDecorationStyle, aa as resolveImageSrc, ab as listKindForTag, ac as isParagraphTag, ad as collectInlineRuns, ae as parseParagraphStyle, af as getRunImage, ag as InlineShell, ah as BalloonShell, ai as DocumentShell, aj as findParagraphTableLocation, ak as createMemo, al as getCaretRectFromSnapshot, am as getParagraphRectFromSnapshot, an as createComponent, ao as CaretOverlay, ap as Show, aq as createRenderEffect, ar as style, as as setStyleProperty, at as setAttribute, au as memo, av as template, aw as Button, ax as useI18n, ay as createEffect, az as TextField, aA as Dialog, aB as insert, aC as className, aD as Grid, aE as SelectField, aF as StatusText, aG as ColorField, aH as UNDERLINE_STYLE_OPTIONS, aI as Stack, aJ as For, aK as ToggleChip, aL as FormField, aM as Checkbox, aN as FieldGroup, aO as Tabs, aP as NumberField, aQ as parseNumber, aR as createStore, aS as reconcile, aT as RadioGroup, aU as Radio$1, aV as TextAreaField, aW as COMMON_SYMBOLS, aX as getRecentSymbols, aY as SYMBOL_CATEGORIES, aZ as rememberSymbol, a_ as delegateEvents, a$ as EMPTY_EDITOR_MATH_EXPRESSION, b0 as serializeLinearMath, b1 as parseLinearMath, b2 as Text, b3 as SurfaceButton, b4 as onMount, b5 as onCleanup, b6 as CheckIcon, b7 as use, b8 as PluginUiHost, b9 as OasisEditorEditor, ba as OasisBrandMark, bb as setPreciseFontPreference, bc as setWelcomeSeen, bd as enablePreciseFontMode, be as WORD_NS$6, bf as XMLSerializer, bg as DOMParser, bh as WORD14_NS, bi as mergeNestedExtensionMarkup, bj as resolveOpcRelationships, bk as parseOpcRelationships, bl as JSZip, bm as normalizeOpcPartPath, bn as OPC_CONTENT_TYPES_PATH, bo as getOpcRelationshipOwnerPath, bp as serializeOpcRelationships, bq as OPC_ROOT_RELATIONSHIPS_PATH, br as hashDocxPartBytes, bs as parseOpcContentTypes, bt as serializeOpcContentTypes, bu as mergeParagraphPropertiesXmlSource, bv as setEditorRunOoxmlSource, bw as mergeRunOoxmlSourceIntoGeneratedXml, bx as mergeTableCellPropertiesXmlSource, by as mergeTableRowPropertiesXmlSource, bz as mergeTablePropertiesXmlSource, bA as getDocumentSectionsCanonical, bB as exportEditorDocumentToDocxBlob, bC as exportEditorDocumentToDocx, bD as pxToPt$1, bE as resolveFloatingObjectRect, bF as getTextBoxFloatingGeometry, bG as getPresetPathSegments, bH as buildListLabels, bI as assertNever, bJ as lineDashPatternPt, bK as DEFAULT_FONT_SIZE_PX, bL as resolveGradientAxis, bM as isDoubleUnderlineStyle, bN as isWavyUnderlineStyle, bO as underlineStyleLineWidthPx, bP as WAVY_UNDERLINE_WAVELENGTH_PX, bQ as WAVY_UNDERLINE_AMPLITUDE_PX, bR as DOUBLE_UNDERLINE_OFFSET_PX, bS as underlineStyleDashArray, bT as resolveEffectiveParagraphStyle, bU as EMPHASIS_GLYPH, bV as parseHexColorToRgb255, bW as rgb255ToHex, bX as getImageFloatingGeometry, bY as resolveEffectiveTextStyleForParagraph, bZ as textStyleToFontSizePt, b_ as mathDisplayText, b$ as TEXT_BASELINE_RATIO, c0 as resolveTextAlignmentBaselineOffset, c1 as resolveRenderedTextChar, c2 as resolveOpenTypeFeatureTags, c3 as isLowercaseSmallCapsChar, c4 as resolveDecorationLineY, c5 as DOUBLE_STRIKE_OFFSET_PX, c6 as resolveListLabel, c7 as getListLabelInset, c8 as getAlignedListLabelInset, c9 as getParagraphBorderInsets, ca as buildSegmentTable, cb as buildCanvasTableLayout, cc as resolveCanvasTableWidth, cd as resolveFloatingTableRect, ce as paragraphBetweenBorderMatches, cf as normalizeFamily, cg as ROBOTO_FONT_FILES, ch as loadFontAsset, ci as getRemotePdfFontFaces, cj as OFFICE_COMPAT_FONT_FAMILIES, ck as BinaryReader, cl as buildSfnt, cm as defaultFontDecoderRegistry, cn as SfntFontProgram, co as zlibSync, cp as renumberImageCaptionsInDocument, cq as collectPdfFontFamilies, cr as outlineFrom, cs as getPageHeaderZoneTop, ct as getPageColumnRects, cu as findFootnoteReference, cv as resolveImporterForFile, cw as roundTo, cx as getDocumentParagraphsCanonical, cy as getDocumentParagraphs, cz as getImageCaptionText, cA as isImageCaptionParagraph, cB as updateImageCaptionParagraph, cC as createImageCaptionParagraph, cD as renumberImageCaptionParagraphs, cE as getCaptionSelectionOffset, cF as PX_PER_CM, cG as getDocumentPageSettings, cH as getTableCellContentWidthForParagraph, cI as layoutMetricsEpoch, cJ as bumpLayoutMetricsEpoch, cK as createCanvasLayoutSnapshotProvider, cL as on, cM as debounce, cN as unwrap, cO as cloneSection, cP as perfTimer, cQ as prepareDocumentFonts, cR as getRunTextBox, cS as EMU_PER_PX, cT as createEditorDocument, cU as cloneBlock, cV as resolveResizedDimensions, cW as axisSignForDirection, cX as clamp$1, cY as MIN_RESIZE_SIZE_PX, cZ as resolveTextBoxRenderHeight, c_ as getToolbarStyleState, c$ as VERTICAL_HIT_WEIGHT, d0 as getCachedCanvasImage, d1 as measureParagraphMinContentWidthPx, d2 as createSectionBoundaryParagraph, d3 as normalizePageSettings, d4 as DEFAULT_EDITOR_PAGE_SETTINGS, d5 as markStart, d6 as markEnd, d7 as getParagraphEntries, d8 as getParagraphById, d9 as createEditorFootnote, da as createFootnoteReferenceRun, db as renumberFootnotes, dc as iterateFootnoteReferenceRuns, dd as preciseFontModeVersion, de as isPreciseFontModeEnabled, df as getRunFieldChar, dg as getRunFieldInstruction, dh as getHeadingLevel, di as createEditorRun, dj as TWIPS_PER_INCH, dk as PX_PER_INCH, dl as togglePreciseFontMode, dm as nextFontSizePt, dn as previousFontSizePt, dp as fontSizePtToPx, dq as resolveNamedTextStyle, dr as resolveNamedTableStyle, ds as resolveEffectiveTableStyle, dt as createDefaultToolbarPreset, du as MenuRegistry, dv as createToolbarRegistry, dw as Editor, dx as resolveCommandRef, dy as commandRefName, dz as createOasisEditorClient, dA as createEditorZoom, dB as startLongTaskObserver, dC as installGlobalReport, dD as applyStoredPreciseFontPreference, dE as getWelcomeSeen, dF as isLocalFontAccessSupported, dG as EDITOR_SCROLL_PADDING_PX, dH as Toolbar, dI as OasisEditorLoading, dJ as I18nProvider, dK as createTranslator, dL as registerDomStatsSurface, dM as createEditorLogger } from "./index-CdeBKnqS.js";
4
+ import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, q as createSignal, r as cloneEditorState, s as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, v as probeLocalFontFamilies, w as createEditorParagraphFromRuns, x as isInlineObjectRun, y as stylesEqual, z as cloneStyle, A as createEditorStyledRun, B as cloneParagraphList, C as cloneParagraph, D as getParagraphLength, G as cloneRun, H as getActiveZone, I as getActiveSectionIndex, J as getParagraphs, K as normalizeSelection, L as positionToParagraphOffset, M as cloneParagraphs, N as paragraphOffsetToPosition, O as findParagraphIndex, P as createCollapsedSelection, Q as isSelectionCollapsed, R as MATH_OBJECT_REPLACEMENT, T as setValueStyle, U as setBooleanStyle, V as parseFontSizePtToPx, W as formatFontSizePt, X as setParagraphStyleValue, Y as createEditorParagraph, Z as cloneBlocks, _ as resolveDefaultParagraphStyleId, $ as findParagraphTablePathLocation, a0 as findParagraphLocation, a1 as resolveTablePath, a2 as buildTableCellLayout, a3 as PT_PER_PX, a4 as createEditorTableCell, a5 as createEditorTableRow, a6 as createEditorTable, a7 as clampPosition, a8 as PX_PER_POINT, a9 as underlineStyleToCssDecorationStyle, aa as resolveImageSrc, ab as listKindForTag, ac as isParagraphTag, ad as collectInlineRuns, ae as parseParagraphStyle, af as getRunImage, ag as InlineShell, ah as BalloonShell, ai as DocumentShell, aj as findParagraphTableLocation, ak as createMemo, al as getCaretRectFromSnapshot, am as getParagraphRectFromSnapshot, an as createComponent, ao as CaretOverlay, ap as Show, aq as createRenderEffect, ar as style, as as setStyleProperty, at as setAttribute, au as memo, av as template, aw as Button, ax as useI18n, ay as createEffect, az as TextField, aA as Dialog, aB as insert, aC as className, aD as Grid, aE as SelectField, aF as StatusText, aG as ColorField, aH as UNDERLINE_STYLE_OPTIONS, aI as Stack, aJ as For, aK as ToggleChip, aL as FormField, aM as Checkbox, aN as FieldGroup, aO as Tabs, aP as NumberField, aQ as parseNumber, aR as createStore, aS as reconcile, aT as RadioGroup, aU as Radio$1, aV as TextAreaField, aW as COMMON_SYMBOLS, aX as getRecentSymbols, aY as SYMBOL_CATEGORIES, aZ as rememberSymbol, a_ as delegateEvents, a$ as EMPTY_EDITOR_MATH_EXPRESSION, b0 as serializeLinearMath, b1 as parseLinearMath, b2 as Text, b3 as SurfaceButton, b4 as onMount, b5 as onCleanup, b6 as CheckIcon, b7 as use, b8 as PluginUiHost, b9 as OasisEditorEditor, ba as OasisBrandMark, bb as setPreciseFontPreference, bc as setWelcomeSeen, bd as enablePreciseFontMode, be as WORD_NS$6, bf as XMLSerializer, bg as DOMParser, bh as WORD14_NS, bi as mergeNestedExtensionMarkup, bj as resolveOpcRelationships, bk as parseOpcRelationships, bl as JSZip, bm as normalizeOpcPartPath, bn as OPC_CONTENT_TYPES_PATH, bo as getOpcRelationshipOwnerPath, bp as serializeOpcRelationships, bq as OPC_ROOT_RELATIONSHIPS_PATH, br as hashDocxPartBytes, bs as parseOpcContentTypes, bt as serializeOpcContentTypes, bu as mergeParagraphPropertiesXmlSource, bv as setEditorRunOoxmlSource, bw as mergeRunOoxmlSourceIntoGeneratedXml, bx as mergeTableCellPropertiesXmlSource, by as mergeTableRowPropertiesXmlSource, bz as mergeTablePropertiesXmlSource, bA as getDocumentSectionsCanonical, bB as exportEditorDocumentToDocxBlob, bC as exportEditorDocumentToDocx, bD as pxToPt$1, bE as resolveFloatingObjectRect, bF as getTextBoxFloatingGeometry, bG as getPresetPathSegments, bH as buildListLabels, bI as assertNever, bJ as lineDashPatternPt, bK as DEFAULT_FONT_SIZE_PX, bL as resolveGradientAxis, bM as isDoubleUnderlineStyle, bN as isWavyUnderlineStyle, bO as underlineStyleLineWidthPx, bP as WAVY_UNDERLINE_WAVELENGTH_PX, bQ as WAVY_UNDERLINE_AMPLITUDE_PX, bR as DOUBLE_UNDERLINE_OFFSET_PX, bS as underlineStyleDashArray, bT as resolveEffectiveParagraphStyle, bU as EMPHASIS_GLYPH, bV as parseHexColorToRgb255, bW as rgb255ToHex, bX as getImageFloatingGeometry, bY as resolveEffectiveTextStyleForParagraph, bZ as textStyleToFontSizePt, b_ as mathDisplayText, b$ as TEXT_BASELINE_RATIO, c0 as resolveTextAlignmentBaselineOffset, c1 as resolveRenderedTextChar, c2 as resolveOpenTypeFeatureTags, c3 as isLowercaseSmallCapsChar, c4 as resolveDecorationLineY, c5 as DOUBLE_STRIKE_OFFSET_PX, c6 as resolveListLabel, c7 as getListLabelInset, c8 as getAlignedListLabelInset, c9 as getParagraphBorderInsets, ca as buildSegmentTable, cb as buildCanvasTableLayout, cc as resolveCanvasTableWidth, cd as resolveFloatingTableRect, ce as paragraphBetweenBorderMatches, cf as normalizeFamily, cg as ROBOTO_FONT_FILES, ch as loadFontAsset, ci as getRemotePdfFontFaces, cj as OFFICE_COMPAT_FONT_FAMILIES, ck as BinaryReader, cl as buildSfnt, cm as defaultFontDecoderRegistry, cn as SfntFontProgram, co as zlibSync, cp as renumberImageCaptionsInDocument, cq as collectPdfFontFamilies, cr as outlineFrom, cs as getPageHeaderZoneTop, ct as getPageColumnRects, cu as findFootnoteReference, cv as resolveImporterForFile, cw as roundTo, cx as getDocumentParagraphsCanonical, cy as getDocumentParagraphs, cz as getImageCaptionText, cA as isImageCaptionParagraph, cB as updateImageCaptionParagraph, cC as createImageCaptionParagraph, cD as renumberImageCaptionParagraphs, cE as getCaptionSelectionOffset, cF as PX_PER_CM, cG as getDocumentPageSettings, cH as getTableCellContentWidthForParagraph, cI as layoutMetricsEpoch, cJ as bumpLayoutMetricsEpoch, cK as createCanvasLayoutSnapshotProvider, cL as on, cM as debounce, cN as unwrap, cO as cloneSection, cP as perfTimer, cQ as prepareDocumentFonts, cR as getRunTextBox, cS as EMU_PER_PX, cT as createEditorDocument, cU as cloneBlock, cV as resolveResizedDimensions, cW as axisSignForDirection, cX as clamp$1, cY as MIN_RESIZE_SIZE_PX, cZ as resolveTextBoxRenderHeight, c_ as getToolbarStyleState, c$ as VERTICAL_HIT_WEIGHT, d0 as getCachedCanvasImage, d1 as measureParagraphMinContentWidthPx, d2 as createSectionBoundaryParagraph, d3 as normalizePageSettings, d4 as DEFAULT_EDITOR_PAGE_SETTINGS, d5 as markStart, d6 as markEnd, d7 as getParagraphEntries, d8 as getParagraphById, d9 as createEditorFootnote, da as createFootnoteReferenceRun, db as renumberFootnotes, dc as iterateFootnoteReferenceRuns, dd as preciseFontModeVersion, de as isPreciseFontModeEnabled, df as getRunFieldChar, dg as getRunFieldInstruction, dh as getHeadingLevel, di as createEditorRun, dj as TWIPS_PER_INCH, dk as PX_PER_INCH, dl as togglePreciseFontMode, dm as nextFontSizePt, dn as previousFontSizePt, dp as fontSizePtToPx, dq as resolveNamedTextStyle, dr as resolveNamedTableStyle, ds as resolveEffectiveTableStyle, dt as createDefaultToolbarPreset, du as MenuRegistry, dv as createToolbarRegistry, dw as Editor, dx as resolveCommandRef, dy as commandRefName, dz as createOasisEditorClient, dA as createEditorZoom, dB as startLongTaskObserver, dC as installGlobalReport, dD as applyStoredPreciseFontPreference, dE as getWelcomeSeen, dF as isLocalFontAccessSupported, dG as EDITOR_SCROLL_PADDING_PX, dH as Toolbar, dI as OasisEditorLoading, dJ as I18nProvider, dK as createTranslator, dL as registerDomStatsSurface, dM as createEditorLogger } from "./index-DazwB_Pd.js";
5
5
  function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
6
6
  const {
7
7
  pageIndex,
@@ -27165,6 +27165,7 @@ function createEditorFontOptionsImpl(ctx) {
27165
27165
  }
27166
27166
  const MERGE_KEYS = {
27167
27167
  insertText: "insertText",
27168
+ composition: "composition",
27168
27169
  insertImage: "insertImage",
27169
27170
  insertTable: "insertTable",
27170
27171
  moveImage: "moveImage",
@@ -28086,6 +28087,33 @@ function insertPlainTextAtSelection(state, text, styleOverride) {
28086
28087
  )
28087
28088
  );
28088
28089
  }
28090
+ function deleteCharsBackwardRaw(state, count) {
28091
+ if (count <= 0) {
28092
+ return state;
28093
+ }
28094
+ const { paragraph, index, offset } = getFocusParagraph(state);
28095
+ if (offset < count) {
28096
+ return state;
28097
+ }
28098
+ const paragraphs = getParagraphs(state);
28099
+ const start = offset - count;
28100
+ const nextParagraph = buildParagraphFromRuns(
28101
+ paragraph,
28102
+ [
28103
+ ...sliceRuns(paragraph, 0, start),
28104
+ ...sliceRuns(paragraph, offset, getParagraphLength(paragraph))
28105
+ ],
28106
+ getStyleAtOffset(paragraph, start)
28107
+ );
28108
+ const nextParagraphs = paragraphs.map(
28109
+ (candidate, candidateIndex) => candidateIndex === index ? nextParagraph : candidate
28110
+ );
28111
+ return cloneStateWithParagraphs(
28112
+ state,
28113
+ nextParagraphs,
28114
+ withSelection(paragraphOffsetToPosition(nextParagraph, start))
28115
+ );
28116
+ }
28089
28117
  function deleteBackward(state) {
28090
28118
  var _a;
28091
28119
  if (!isSelectionCollapsed(state.selection)) {
@@ -36486,6 +36514,7 @@ function buildEditorViewProps(ctx) {
36486
36514
  onInputFocus: () => input.setFocused(true),
36487
36515
  onCompositionEnd: input.textInput.handleCompositionEnd,
36488
36516
  onCompositionStart: input.textInput.handleCompositionStart,
36517
+ onCompositionUpdate: input.textInput.handleCompositionUpdate,
36489
36518
  onCopy: input.handleCopy,
36490
36519
  onCut: input.handleCut,
36491
36520
  onInput: input.textInput.handleTextInput,
@@ -52837,7 +52866,43 @@ function createEditorTextInput(deps) {
52837
52866
  }
52838
52867
  function createEditorTextInputImpl(deps) {
52839
52868
  const [composing, setComposing] = createSignal(false);
52840
- let suppressedInputText = null;
52869
+ let previewLength = 0;
52870
+ let previewText = "";
52871
+ let compositionStyle;
52872
+ let justCommitted = null;
52873
+ const resetComposition = () => {
52874
+ previewLength = 0;
52875
+ previewText = "";
52876
+ compositionStyle = void 0;
52877
+ };
52878
+ const applyCompositionText = (text, isFinal) => {
52879
+ if (!isFinal && text === previewText) {
52880
+ return;
52881
+ }
52882
+ if (previewLength === 0 && text.length === 0) {
52883
+ if (isFinal) {
52884
+ resetComposition();
52885
+ }
52886
+ return;
52887
+ }
52888
+ const retracted = previewLength;
52889
+ const pendingStyle = cloneStyle(compositionStyle);
52890
+ deps.clearPreferredColumn();
52891
+ deps.applyTransactionalState(
52892
+ (current) => deps.applyTableAwareParagraphEdit(current, (temp) => {
52893
+ const cleared = deleteCharsBackwardRaw(temp, retracted);
52894
+ return text.length > 0 ? insertTextAtSelection(cleared, text, pendingStyle) : cleared;
52895
+ }),
52896
+ { mergeKey: MERGE_KEYS.composition }
52897
+ );
52898
+ if (isFinal) {
52899
+ resetComposition();
52900
+ justCommitted = text.length > 0 ? text : null;
52901
+ } else {
52902
+ previewLength = text.length;
52903
+ previewText = text;
52904
+ }
52905
+ };
52841
52906
  const handleTextInput = (event) => {
52842
52907
  var _a, _b, _c, _d;
52843
52908
  markStart("input:text");
@@ -52846,6 +52911,7 @@ function createEditorTextInputImpl(deps) {
52846
52911
  `input:readonly ignored value=${JSON.stringify(event.currentTarget.value)}`
52847
52912
  );
52848
52913
  event.currentTarget.value = "";
52914
+ resetComposition();
52849
52915
  return;
52850
52916
  }
52851
52917
  const text = event.currentTarget.value;
@@ -52854,13 +52920,17 @@ function createEditorTextInputImpl(deps) {
52854
52920
  }
52855
52921
  if (composing()) {
52856
52922
  deps.logger.debug(`input:composing buffer=${JSON.stringify(text)}`);
52923
+ applyCompositionText(text, false);
52857
52924
  return;
52858
52925
  }
52859
- if (suppressedInputText !== null && text === suppressedInputText) {
52860
- deps.logger.debug(`input:suppressed text=${JSON.stringify(text)}`);
52861
- suppressedInputText = null;
52862
- event.currentTarget.value = "";
52863
- return;
52926
+ if (justCommitted !== null) {
52927
+ const wasCommitted = text === justCommitted;
52928
+ justCommitted = null;
52929
+ if (wasCommitted) {
52930
+ deps.logger.debug(`input:suppressed text=${JSON.stringify(text)}`);
52931
+ event.currentTarget.value = "";
52932
+ return;
52933
+ }
52864
52934
  }
52865
52935
  const state = deps.state();
52866
52936
  const sel = state.selection;
@@ -52890,43 +52960,38 @@ function createEditorTextInputImpl(deps) {
52890
52960
  };
52891
52961
  const handleCompositionStart = () => {
52892
52962
  deps.logger.debug("input:composition start");
52963
+ resetComposition();
52964
+ justCommitted = null;
52965
+ compositionStyle = cloneStyle(deps.pendingCaretTextStyle());
52893
52966
  setComposing(true);
52894
52967
  };
52895
- const handleCompositionEnd = (event) => {
52968
+ const handleCompositionUpdate = (event) => {
52896
52969
  if (deps.isReadOnly()) {
52897
- event.currentTarget.value = "";
52898
- setComposing(false);
52899
52970
  return;
52900
52971
  }
52901
- const text = event.data ?? event.currentTarget.value;
52972
+ applyCompositionText(event.data ?? "", false);
52973
+ };
52974
+ const handleCompositionEnd = (event) => {
52902
52975
  setComposing(false);
52903
- if (text.length === 0) {
52976
+ if (deps.isReadOnly()) {
52904
52977
  event.currentTarget.value = "";
52978
+ resetComposition();
52905
52979
  return;
52906
52980
  }
52981
+ const text = event.data ?? event.currentTarget.value;
52907
52982
  const state = deps.state();
52908
52983
  const sel = state.selection;
52909
52984
  deps.logger.info(
52910
52985
  `input:composition end ${JSON.stringify(text)} (len=${text.length}) at ${sel.anchor.paragraphId}:${sel.anchor.runId}[${sel.anchor.offset}]`
52911
52986
  );
52912
- suppressedInputText = text;
52913
- deps.clearPreferredColumn();
52914
- const pendingStyle = cloneStyle(deps.pendingCaretTextStyle());
52915
- deps.applyTransactionalState(
52916
- (current) => deps.applyTableAwareParagraphEdit(
52917
- current,
52918
- (temp) => insertTextAtSelection(temp, text, pendingStyle)
52919
- ),
52920
- {
52921
- mergeKey: MERGE_KEYS.insertText
52922
- }
52923
- );
52987
+ applyCompositionText(text, true);
52924
52988
  event.currentTarget.value = "";
52925
52989
  deps.focusInput();
52926
52990
  };
52927
52991
  return {
52928
52992
  handleTextInput,
52929
52993
  handleCompositionStart,
52994
+ handleCompositionUpdate,
52930
52995
  handleCompositionEnd,
52931
52996
  composing
52932
52997
  };
@@ -55183,6 +55248,9 @@ function createEditorKeyboardControllerImpl(deps) {
55183
55248
  }
55184
55249
  return;
55185
55250
  }
55251
+ if (event.isComposing || event.keyCode === 229) {
55252
+ return;
55253
+ }
55186
55254
  const commandExecutor = deps.executeCommand ? {
55187
55255
  executeCommand: (commandName, payload) => {
55188
55256
  var _a;
@@ -22,6 +22,9 @@ declare function createEditorTextInputImpl(deps: UseEditorTextInputProps): {
22
22
  currentTarget: HTMLTextAreaElement;
23
23
  }) => void;
24
24
  handleCompositionStart: () => void;
25
+ handleCompositionUpdate: (event: CompositionEvent & {
26
+ currentTarget: HTMLTextAreaElement;
27
+ }) => void;
25
28
  handleCompositionEnd: (event: CompositionEvent & {
26
29
  currentTarget: HTMLTextAreaElement;
27
30
  }) => void;
@@ -1,4 +1,4 @@
1
1
  export { moveOrCopySelectionToPosition, insertTextAtSelection, insertPlainTextAtSelection, insertMathAtSelection, updateMathRun, } from './textEditing.js';
2
- export { deleteBackward, deleteForward } from './textDeletion.js';
2
+ export { deleteBackward, deleteForward, deleteCharsBackwardRaw, } from './textDeletion.js';
3
3
  export { toggleTextStyle, clearSelectedTextFormatting, setTextStyleValue, } from './textFormatting.js';
4
4
  export { type TextCaseMode, transformSelectedText, changeSelectedTextCase, } from './textCase.js';
@@ -1,4 +1,13 @@
1
1
  import { EditorState } from '../model.js';
2
2
 
3
+ /**
4
+ * Removes `count` UTF-16 code units immediately before the caret, inside the
5
+ * focused paragraph only.
6
+ *
7
+ * Unlike `deleteBackward` this never marks revisions when track changes is on
8
+ * and never merges paragraphs: it exists to retract IME composition previews,
9
+ * which are provisional text the user has not committed yet.
10
+ */
11
+ export declare function deleteCharsBackwardRaw(state: EditorState, count: number): EditorState;
3
12
  export declare function deleteBackward(state: EditorState): EditorState;
4
13
  export declare function deleteForward(state: EditorState): EditorState;
@@ -1,5 +1,6 @@
1
1
  export declare const MERGE_KEYS: {
2
2
  readonly insertText: "insertText";
3
+ readonly composition: "composition";
3
4
  readonly insertImage: "insertImage";
4
5
  readonly insertTable: "insertTable";
5
6
  readonly moveImage: "moveImage";
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
2863
2863
  onCleanup(() => {
2864
2864
  cancelled = true;
2865
2865
  });
2866
- import("./OasisEditorApp-WP25r3Sz.js").then((m) => {
2866
+ import("./OasisEditorApp-voAqwV96.js").then((m) => {
2867
2867
  cancelled = true;
2868
2868
  setProgress(1);
2869
2869
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -49465,6 +49465,7 @@ function OasisEditorEditor(props) {
49465
49465
  addEventListener(_el$5, "focus", inputHandlers().onInputFocus);
49466
49466
  addEventListener(_el$5, "cut", inputHandlers().onCut);
49467
49467
  addEventListener(_el$5, "copy", inputHandlers().onCopy);
49468
+ addEventListener(_el$5, "compositionupdate", inputHandlers().onCompositionUpdate);
49468
49469
  addEventListener(_el$5, "compositionstart", inputHandlers().onCompositionStart);
49469
49470
  addEventListener(_el$5, "compositionend", inputHandlers().onCompositionEnd);
49470
49471
  addEventListener(_el$5, "blur", inputHandlers().onInputBlur);
@@ -1,4 +1,4 @@
1
- import { dN, ah, aw, aM, aG, dO, dP, dQ, aA, dR, ai, dS, dw, aN, dT, dU, aL, aD, dV, dW, dX, ag, dY, du, aP, dZ, d_, d$, e0, e1, dI, e2, e3, e4, aU, aT, e5, aE, e6, e7, e8, e9, ea, eb, aI, aF, ec, b3, aO, b2, aV, az, aK, dH, ed, dO as dO2, dV as dV2, dY as dY2, e5 as e52, e6 as e62, eb as eb2, ee, ef, dy, dt, eg, eh, ei, ej, ek, el, em, dv, en, eo, ep, eq, er, dx, es, et } from "./index-CdeBKnqS.js";
1
+ import { dN, ah, aw, aM, aG, dO, dP, dQ, aA, dR, ai, dS, dw, aN, dT, dU, aL, aD, dV, dW, dX, ag, dY, du, aP, dZ, d_, d$, e0, e1, dI, e2, e3, e4, aU, aT, e5, aE, e6, e7, e8, e9, ea, eb, aI, aF, ec, b3, aO, b2, aV, az, aK, dH, ed, dO as dO2, dV as dV2, dY as dY2, e5 as e52, e6 as e62, eb as eb2, ee, ef, dy, dt, eg, eh, ei, ej, ek, el, em, dv, en, eo, ep, eq, er, dx, es, et } from "./index-DazwB_Pd.js";
2
2
  export {
3
3
  dN as ActionRow,
4
4
  ah as BalloonShell,