oasis-editor 0.0.78 → 0.0.80

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, 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 { a as assertNever, c as createSignal, b as createEditorStateFromDocument, d as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, f as fontSizePxToPt, p as probeLocalFontFamilies, e as createEditorParagraphFromRuns, i as isInlineObjectRun, g as createEditorStyledRun, h as getParagraphLength, j as getParagraphText, k as getActiveZone, l as getDocumentSections, m as getActiveSectionIndex, n as getParagraphs, o as normalizeSelection, q as positionToParagraphOffset, r as paragraphOffsetToPosition, s as clampPosition, t as findParagraphIndex, u as createCollapsedSelection, v as isSelectionCollapsed, w as parseFontSizePtToPx, x as formatFontSizePt, y as createEditorParagraph, z as getBlockParagraphs, A as findParagraphTableLocation, B as buildTableCellLayout, P as PT_PER_PX, C as createEditorTableCell, D as createEditorTableRow, E as createEditorTable, F as underlineStyleToCssDecorationStyle, G as resolveImageSrc, H as listKindForTag, I as isParagraphTag, J as collectInlineRuns, K as parseParagraphStyle, L as InlineShell, M as BalloonShell, N as DocumentShell, O as createMemo, Q as buildCanvasLayoutSnapshot, R as getCaretRectFromSnapshot, T as getParagraphRectFromSnapshot, U as createComponent, V as CaretOverlay, W as Show, X as createRenderEffect, Y as style, Z as setAttribute, _ as setStyleProperty, $ as memo, a0 as template, a1 as useI18n, a2 as createEffect, a3 as insert, a4 as use, a5 as addEventListener, a6 as Dialog, a7 as delegateEvents, a8 as className, a9 as For, aa as UNDERLINE_STYLE_OPTIONS, ab as Tabs, ac as onMount, ad as onCleanup, ae as PluginUiHost, af as OasisEditorEditor, ag as OasisBrandMark, ah as setPreciseFontPreference, ai as setWelcomeSeen, aj as enablePreciseFontMode, ak as TWIPS_PER_POINT, al as PX_PER_INCH, am as TWIPS_PER_INCH, an as resolveEffectiveParagraphStyle, ao as resolveEffectiveTextStyleForParagraph, ap as EMU_PER_PX, aq as EMU_PER_PT, ar as iterateFootnoteReferenceRuns, as as iterateEndnoteReferenceRuns, at as imageContentTypeDefaults, au as createEditorRun, av as JSZip, aw as imageExtensionFromMime, ax as pxToPt$1, ay as resolveFloatingObjectRect, az as getTextBoxFloatingGeometry, aA as getPresetPathSegments, aB as projectBlocksLayout, aC as buildListLabels, aD as textStyleToFontSizePt, aE as PX_PER_POINT, aF as DEFAULT_FONT_SIZE_PX, aG as isDoubleUnderlineStyle, aH as isWavyUnderlineStyle, aI as underlineStyleLineWidthPx, aJ as underlineStyleDashArray, aK as resolveListLabel, aL as getListLabelInset, aM as getAlignedListLabelInset, aN as getParagraphBorderInsets, aO as buildSegmentTable, aP as buildCanvasTableLayout, aQ as normalizeFamily, aR as ROBOTO_FONT_FILES, aS as loadFontAsset, aT as OFFICE_COMPAT_FONT_FAMILIES, aU as buildSfnt, aV as defaultFontDecoderRegistry, aW as SfntFontProgram, aX as collectPdfFontFamilies, aY as projectDocumentLayout, aZ as getPageContentWidth, a_ as getPageHeaderZoneTop, a$ as getPageBodyTop, b0 as getPageColumnRects, b1 as findFootnoteReference, b2 as FOOTNOTE_MARKER_GUTTER_PX, b3 as resolveImporterForFile, b4 as getDocumentSectionsCanonical, b5 as getDocumentParagraphsCanonical, b6 as getDocumentParagraphs, b7 as getDocumentPageSettings, b8 as getTableCellContentWidthForParagraph, b9 as on, ba as debounce, bb as unwrap, bc as perfTimer, bd as createEditorDocument, be as resolveResizedDimensions, bf as resolveTextBoxRenderHeight, bg as getToolbarStyleState, bh as getCachedCanvasImage, bi as measureParagraphMinContentWidthPx, bj as getEditableBlocksForZone, bk as findParagraphLocation, bl as createSectionBoundaryParagraph, bm as normalizePageSettings, bn as DEFAULT_EDITOR_PAGE_SETTINGS, bo as markStart, bp as markEnd, bq as getParagraphEntries, br as getParagraphById, bs as createEditorFootnote, bt as createFootnoteReferenceRun, bu as renumberFootnotes, bv as getFootnoteDisplayMarker, bw as getHeadingLevel, bx as preciseFontModeVersion, by as isPreciseFontModeEnabled, bz as togglePreciseFontMode, bA as nextFontSizePt, bB as previousFontSizePt, bC as fontSizePtToPx, bD as createDefaultToolbarPreset, bE as MenuRegistry, bF as createToolbarRegistry, bG as Editor, bH as resolveCommandRef, bI as commandRefName, bJ as createOasisEditorClient, bK as createEditorZoom, bL as startLongTaskObserver, bM as installGlobalReport, bN as applyStoredPreciseFontPreference, bO as getWelcomeSeen, bP as isLocalFontAccessSupported, bQ as EDITOR_SCROLL_PADDING_PX, bR as Toolbar, bS as OasisEditorLoading, bT as I18nProvider, bU as createTranslator, bV as createEditorLogger, bW as registerDomStatsSurface } from "./index-CqVqLWyO.js";
4
+ import { a as assertNever, c as createSignal, b as createEditorStateFromDocument, d as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, f as fontSizePxToPt, p as probeLocalFontFamilies, e as createEditorParagraphFromRuns, i as isInlineObjectRun, g as createEditorStyledRun, h as getParagraphLength, j as getParagraphText, k as getActiveZone, l as getDocumentSections, m as getActiveSectionIndex, n as getParagraphs, o as normalizeSelection, q as positionToParagraphOffset, r as paragraphOffsetToPosition, s as clampPosition, t as findParagraphIndex, u as createCollapsedSelection, v as isSelectionCollapsed, w as parseFontSizePtToPx, x as formatFontSizePt, y as createEditorParagraph, z as getBlockParagraphs, A as findParagraphTableLocation, B as buildTableCellLayout, P as PT_PER_PX, C as createEditorTableCell, D as createEditorTableRow, E as createEditorTable, F as underlineStyleToCssDecorationStyle, G as resolveImageSrc, H as listKindForTag, I as isParagraphTag, J as collectInlineRuns, K as parseParagraphStyle, L as InlineShell, M as BalloonShell, N as DocumentShell, O as createMemo, Q as buildCanvasLayoutSnapshot, R as getCaretRectFromSnapshot, T as getParagraphRectFromSnapshot, U as createComponent, V as CaretOverlay, W as Show, X as createRenderEffect, Y as style, Z as setAttribute, _ as setStyleProperty, $ as memo, a0 as template, a1 as useI18n, a2 as createEffect, a3 as insert, a4 as use, a5 as addEventListener, a6 as Dialog, a7 as delegateEvents, a8 as className, a9 as For, aa as UNDERLINE_STYLE_OPTIONS, ab as Tabs, ac as onMount, ad as onCleanup, ae as PluginUiHost, af as OasisEditorEditor, ag as OasisBrandMark, ah as setPreciseFontPreference, ai as setWelcomeSeen, aj as enablePreciseFontMode, ak as TWIPS_PER_POINT, al as PX_PER_INCH, am as TWIPS_PER_INCH, an as resolveEffectiveParagraphStyle, ao as resolveEffectiveTextStyleForParagraph, ap as EMU_PER_PX, aq as EMU_PER_PT, ar as iterateFootnoteReferenceRuns, as as iterateEndnoteReferenceRuns, at as imageContentTypeDefaults, au as createEditorRun, av as JSZip, aw as imageExtensionFromMime, ax as pxToPt$1, ay as resolveFloatingObjectRect, az as getTextBoxFloatingGeometry, aA as getPresetPathSegments, aB as projectBlocksLayout, aC as buildListLabels, aD as textStyleToFontSizePt, aE as PX_PER_POINT, aF as DEFAULT_FONT_SIZE_PX, aG as isDoubleUnderlineStyle, aH as isWavyUnderlineStyle, aI as underlineStyleLineWidthPx, aJ as underlineStyleDashArray, aK as resolveListLabel, aL as getListLabelInset, aM as getAlignedListLabelInset, aN as getParagraphBorderInsets, aO as buildSegmentTable, aP as buildCanvasTableLayout, aQ as normalizeFamily, aR as ROBOTO_FONT_FILES, aS as loadFontAsset, aT as OFFICE_COMPAT_FONT_FAMILIES, aU as buildSfnt, aV as defaultFontDecoderRegistry, aW as SfntFontProgram, aX as collectPdfFontFamilies, aY as projectDocumentLayout, aZ as getPageContentWidth, a_ as getPageHeaderZoneTop, a$ as getPageBodyTop, b0 as getPageColumnRects, b1 as findFootnoteReference, b2 as FOOTNOTE_MARKER_GUTTER_PX, b3 as resolveImporterForFile, b4 as getDocumentSectionsCanonical, b5 as getDocumentParagraphsCanonical, b6 as getDocumentParagraphs, b7 as getDocumentPageSettings, b8 as getTableCellContentWidthForParagraph, b9 as on, ba as debounce, bb as unwrap, bc as perfTimer, bd as createEditorDocument, be as resolveResizedDimensions, bf as resolveTextBoxRenderHeight, bg as getToolbarStyleState, bh as getCachedCanvasImage, bi as measureParagraphMinContentWidthPx, bj as getEditableBlocksForZone, bk as findParagraphLocation, bl as createSectionBoundaryParagraph, bm as normalizePageSettings, bn as DEFAULT_EDITOR_PAGE_SETTINGS, bo as markStart, bp as markEnd, bq as getParagraphEntries, br as getParagraphById, bs as createEditorFootnote, bt as createFootnoteReferenceRun, bu as renumberFootnotes, bv as getFootnoteDisplayMarker, bw as getHeadingLevel, bx as preciseFontModeVersion, by as isPreciseFontModeEnabled, bz as togglePreciseFontMode, bA as nextFontSizePt, bB as previousFontSizePt, bC as fontSizePtToPx, bD as createDefaultToolbarPreset, bE as MenuRegistry, bF as createToolbarRegistry, bG as Editor, bH as resolveCommandRef, bI as commandRefName, bJ as createOasisEditorClient, bK as createEditorZoom, bL as startLongTaskObserver, bM as installGlobalReport, bN as applyStoredPreciseFontPreference, bO as getWelcomeSeen, bP as isLocalFontAccessSupported, bQ as EDITOR_SCROLL_PADDING_PX, bR as Toolbar, bS as OasisEditorLoading, bT as I18nProvider, bU as createTranslator, bV as createEditorLogger, bW as registerDomStatsSurface } from "./index-E2fsy7yp.js";
5
5
  function cloneBlock(block) {
6
6
  switch (block.type) {
7
7
  case "paragraph":
@@ -29133,93 +29133,84 @@ function buildInitialValues(ctx, activeTab = "table") {
29133
29133
  function setCellStyle(state, key, value) {
29134
29134
  return setTableCellStyleValue(state, key, value);
29135
29135
  }
29136
+ function hasActiveTable(state) {
29137
+ return Boolean(resolveActiveTableContext(state));
29138
+ }
29139
+ function readTableProperties(state, activeTab = "table") {
29140
+ const ctx = resolveActiveTableContext(state);
29141
+ if (!ctx) return null;
29142
+ return buildInitialValues(ctx, activeTab);
29143
+ }
29144
+ function applyTableProperties(state, values) {
29145
+ const ctx = resolveActiveTableContext(state);
29146
+ if (!ctx) return state;
29147
+ let next = state;
29148
+ next = setActiveTableStyleValue(next, ctx.tableId, "width", values.tableWidth);
29149
+ next = setActiveTableStyleValue(next, ctx.tableId, "align", values.tableAlign);
29150
+ next = setActiveTableStyleValue(
29151
+ next,
29152
+ ctx.tableId,
29153
+ "indentLeft",
29154
+ values.tableIndentLeft
29155
+ );
29156
+ next = setActiveTableStyleValue(
29157
+ next,
29158
+ ctx.tableId,
29159
+ "altTitle",
29160
+ values.altTitle
29161
+ );
29162
+ next = setActiveTableStyleValue(
29163
+ next,
29164
+ ctx.tableId,
29165
+ "altDescription",
29166
+ values.altDescription
29167
+ );
29168
+ next = setSelectedTableRowHeader(next, values.repeatHeader);
29169
+ next = setSelectedTableRowStyleValue(next, "height", values.rowHeight);
29170
+ next = setSelectedTableRowStyleValue(
29171
+ next,
29172
+ "heightRule",
29173
+ values.rowHeightRule
29174
+ );
29175
+ next = setSelectedTableRowStyleValue(next, "cantSplit", values.cantSplit);
29176
+ next = setSelectedTableRowStyleValue(next, "hidden", values.hiddenRow);
29177
+ if (values.columnWidth !== null) {
29178
+ next = setTableColumnWidths(next, ctx.tableId, {
29179
+ [ctx.visualColumnIndex]: values.columnWidth
29180
+ });
29181
+ }
29182
+ next = setCellStyle(next, "width", values.cellWidth);
29183
+ next = setCellStyle(next, "verticalAlign", values.cellVerticalAlign);
29184
+ next = setCellStyle(next, "textDirection", values.cellTextDirection);
29185
+ next = setCellStyle(next, "noWrap", values.cellNoWrap);
29186
+ next = setCellStyle(next, "fitText", values.cellFitText);
29187
+ next = setCellStyle(next, "hideMark", values.cellHideMark);
29188
+ next = setCellStyle(next, "paddingTop", values.margins.top);
29189
+ next = setCellStyle(next, "paddingRight", values.margins.right);
29190
+ next = setCellStyle(next, "paddingBottom", values.margins.bottom);
29191
+ next = setCellStyle(next, "paddingLeft", values.margins.left);
29192
+ next = setCellStyle(next, "borderTop", values.borders.top);
29193
+ next = setCellStyle(next, "borderRight", values.borders.right);
29194
+ next = setCellStyle(next, "borderBottom", values.borders.bottom);
29195
+ next = setCellStyle(next, "borderLeft", values.borders.left);
29196
+ next = setCellStyle(next, "shading", values.shading);
29197
+ return next;
29198
+ }
29136
29199
  function createTablePropertiesDialogBridge(deps) {
29137
- const isInsideTable = () => Boolean(resolveActiveTableContext(deps.state()));
29200
+ const isInsideTable = () => hasActiveTable(deps.state());
29138
29201
  const openTablePropertiesDialog = (activeTab = "table") => {
29139
- const ctx = resolveActiveTableContext(deps.state());
29140
- if (!ctx) return;
29202
+ const initial = readTableProperties(deps.state(), activeTab);
29203
+ if (!initial) return;
29141
29204
  deps.setContextMenu({ isOpen: false, x: 0, y: 0 });
29142
- deps.setTablePropertiesDialog({
29143
- isOpen: true,
29144
- initial: buildInitialValues(ctx, activeTab)
29145
- });
29205
+ deps.setTablePropertiesDialog({ isOpen: true, initial });
29146
29206
  };
29147
29207
  const applyTablePropertiesDialogValues = (values) => {
29148
29208
  if (deps.isReadOnly()) return;
29149
- const ctx = resolveActiveTableContext(deps.state());
29150
- if (!ctx) return;
29209
+ if (!isInsideTable()) return;
29151
29210
  deps.clearPreferredColumn();
29152
29211
  deps.resetTransactionGrouping();
29153
29212
  deps.applyTransactionalState(
29154
- (current) => {
29155
- const currentCtx = resolveActiveTableContext(current);
29156
- if (!currentCtx) return current;
29157
- let next = current;
29158
- next = setActiveTableStyleValue(
29159
- next,
29160
- currentCtx.tableId,
29161
- "width",
29162
- values.tableWidth
29163
- );
29164
- next = setActiveTableStyleValue(
29165
- next,
29166
- currentCtx.tableId,
29167
- "align",
29168
- values.tableAlign
29169
- );
29170
- next = setActiveTableStyleValue(
29171
- next,
29172
- currentCtx.tableId,
29173
- "indentLeft",
29174
- values.tableIndentLeft
29175
- );
29176
- next = setActiveTableStyleValue(
29177
- next,
29178
- currentCtx.tableId,
29179
- "altTitle",
29180
- values.altTitle
29181
- );
29182
- next = setActiveTableStyleValue(
29183
- next,
29184
- currentCtx.tableId,
29185
- "altDescription",
29186
- values.altDescription
29187
- );
29188
- next = setSelectedTableRowHeader(next, values.repeatHeader);
29189
- next = setSelectedTableRowStyleValue(next, "height", values.rowHeight);
29190
- next = setSelectedTableRowStyleValue(
29191
- next,
29192
- "heightRule",
29193
- values.rowHeightRule
29194
- );
29195
- next = setSelectedTableRowStyleValue(
29196
- next,
29197
- "cantSplit",
29198
- values.cantSplit
29199
- );
29200
- next = setSelectedTableRowStyleValue(next, "hidden", values.hiddenRow);
29201
- if (values.columnWidth !== null) {
29202
- next = setTableColumnWidths(next, currentCtx.tableId, {
29203
- [currentCtx.visualColumnIndex]: values.columnWidth
29204
- });
29205
- }
29206
- next = setCellStyle(next, "width", values.cellWidth);
29207
- next = setCellStyle(next, "verticalAlign", values.cellVerticalAlign);
29208
- next = setCellStyle(next, "textDirection", values.cellTextDirection);
29209
- next = setCellStyle(next, "noWrap", values.cellNoWrap);
29210
- next = setCellStyle(next, "fitText", values.cellFitText);
29211
- next = setCellStyle(next, "hideMark", values.cellHideMark);
29212
- next = setCellStyle(next, "paddingTop", values.margins.top);
29213
- next = setCellStyle(next, "paddingRight", values.margins.right);
29214
- next = setCellStyle(next, "paddingBottom", values.margins.bottom);
29215
- next = setCellStyle(next, "paddingLeft", values.margins.left);
29216
- next = setCellStyle(next, "borderTop", values.borders.top);
29217
- next = setCellStyle(next, "borderRight", values.borders.right);
29218
- next = setCellStyle(next, "borderBottom", values.borders.bottom);
29219
- next = setCellStyle(next, "borderLeft", values.borders.left);
29220
- next = setCellStyle(next, "shading", values.shading);
29221
- return next;
29222
- },
29213
+ (current) => applyTableProperties(current, values),
29223
29214
  { mergeKey: "tableProperties" }
29224
29215
  );
29225
29216
  deps.focusInput();
@@ -32290,83 +32281,91 @@ function EditorDialogsLayer(props) {
32290
32281
  })];
32291
32282
  }
32292
32283
  function buildEditorViewProps(ctx) {
32284
+ const {
32285
+ layout: layoutInput,
32286
+ overlays: overlayInput,
32287
+ refs: refsInput,
32288
+ surface,
32289
+ input,
32290
+ files
32291
+ } = ctx;
32293
32292
  const layout = {
32294
- viewportHeight: ctx.viewportHeight,
32295
- class: ctx.className,
32296
- style: ctx.style,
32297
- zoomPercent: ctx.zoomPercent,
32298
- setZoomPercent: ctx.setZoomPercent,
32299
- zoomFactor: ctx.zoomFactor
32293
+ viewportHeight: layoutInput.viewportHeight,
32294
+ class: layoutInput.className,
32295
+ style: layoutInput.style,
32296
+ zoomPercent: layoutInput.zoomPercent,
32297
+ setZoomPercent: layoutInput.setZoomPercent,
32298
+ zoomFactor: layoutInput.zoomFactor
32300
32299
  };
32301
32300
  const overlays = {
32302
- selectionBoxes: ctx.selectionBoxes,
32303
- commentHighlights: ctx.commentHighlights,
32304
- selectedImageBox: ctx.selectedImageBox,
32305
- selectedTextBoxBox: ctx.selectedTextBoxBox,
32306
- layoutOptions: ctx.layoutOptions,
32307
- caretBox: ctx.caretBox,
32308
- inputBox: ctx.inputBox,
32309
- hoveredRevision: ctx.hoveredRevision,
32310
- focused: ctx.focused,
32311
- showCaret: ctx.showCaret,
32312
- importProgress: ctx.importProgress
32301
+ selectionBoxes: overlayInput.selectionBoxes,
32302
+ commentHighlights: overlayInput.commentHighlights,
32303
+ selectedImageBox: overlayInput.selectedImageBox,
32304
+ selectedTextBoxBox: overlayInput.selectedTextBoxBox,
32305
+ layoutOptions: overlayInput.layoutOptions,
32306
+ caretBox: overlayInput.caretBox,
32307
+ inputBox: overlayInput.inputBox,
32308
+ hoveredRevision: overlayInput.hoveredRevision,
32309
+ focused: overlayInput.focused,
32310
+ showCaret: overlayInput.showCaret,
32311
+ importProgress: overlayInput.importProgress
32313
32312
  };
32314
32313
  const refs = {
32315
32314
  onViewportRef: (element) => {
32316
- ctx.focusController.viewportRef = element;
32315
+ refsInput.focusController.viewportRef = element;
32317
32316
  },
32318
32317
  onSurfaceRef: (element) => {
32319
- ctx.focusController.surfaceRef = element;
32318
+ refsInput.focusController.surfaceRef = element;
32320
32319
  },
32321
32320
  onTextareaRef: (element) => {
32322
- ctx.focusController.textareaRef = element;
32321
+ refsInput.focusController.textareaRef = element;
32323
32322
  },
32324
32323
  onImportInputRef: (element) => {
32325
- ctx.focusController.importInputRef = element;
32324
+ refsInput.focusController.importInputRef = element;
32326
32325
  },
32327
32326
  onImageInputRef: (element) => {
32328
- ctx.focusController.imageInputRef = element;
32327
+ refsInput.focusController.imageInputRef = element;
32329
32328
  }
32330
32329
  };
32331
32330
  const fileHandlers = {
32332
32331
  onImportInputChange: (e) => {
32333
32332
  var _a;
32334
- return ctx.handleImportFile(((_a = e.currentTarget.files) == null ? void 0 : _a[0]) ?? null);
32333
+ return files.handleImportFile(((_a = e.currentTarget.files) == null ? void 0 : _a[0]) ?? null);
32335
32334
  },
32336
32335
  onImageInputChange: (e) => {
32337
32336
  var _a;
32338
- return ctx.handleInsertImage(((_a = e.currentTarget.files) == null ? void 0 : _a[0]) ?? null);
32337
+ return files.handleInsertImage(((_a = e.currentTarget.files) == null ? void 0 : _a[0]) ?? null);
32339
32338
  }
32340
32339
  };
32341
32340
  const surfaceHandlers = {
32342
32341
  onDragOver: (event) => event.preventDefault(),
32343
- onDrop: ctx.handleDrop,
32344
- onEditorMouseDown: ctx.onEditorMouseDown,
32345
- onSurfaceMouseDown: ctx.surfaceEvents.handleSurfaceMouseDown,
32346
- onSurfaceClick: ctx.surfaceEvents.handleSurfaceClick,
32347
- onSurfaceMouseMove: ctx.tableResize.handleMouseMove,
32348
- onSurfaceDblClick: ctx.surfaceEvents.handleSurfaceDblClick,
32349
- onParagraphMouseDown: ctx.surfaceEvents.handleParagraphMouseDown,
32350
- onImageMouseDown: ctx.handleImageMouseDown,
32351
- onImageResizeHandleMouseDown: ctx.handleImageResizeHandleMouseDown,
32352
- onTextBoxResizeHandleMouseDown: ctx.handleTextBoxResizeHandleMouseDown,
32353
- onImageRotateHandleMouseDown: ctx.handleImageRotateHandleMouseDown,
32354
- onTextBoxRotateHandleMouseDown: ctx.handleTextBoxRotateHandleMouseDown,
32355
- onTableDragHandleMouseDown: ctx.tableDrag.handleMouseDown,
32356
- onRevisionMouseEnter: ctx.revisionController.handleRevisionMouseEnter,
32357
- onRevisionMouseLeave: ctx.revisionController.handleRevisionMouseLeave,
32358
- onEditorContextMenu: (event) => ctx.handleEditorContextMenu(event)
32342
+ onDrop: surface.handleDrop,
32343
+ onEditorMouseDown: surface.onEditorMouseDown,
32344
+ onSurfaceMouseDown: surface.surfaceEvents.handleSurfaceMouseDown,
32345
+ onSurfaceClick: surface.surfaceEvents.handleSurfaceClick,
32346
+ onSurfaceMouseMove: surface.tableResize.handleMouseMove,
32347
+ onSurfaceDblClick: surface.surfaceEvents.handleSurfaceDblClick,
32348
+ onParagraphMouseDown: surface.surfaceEvents.handleParagraphMouseDown,
32349
+ onImageMouseDown: surface.handleImageMouseDown,
32350
+ onImageResizeHandleMouseDown: surface.handleImageResizeHandleMouseDown,
32351
+ onTextBoxResizeHandleMouseDown: surface.handleTextBoxResizeHandleMouseDown,
32352
+ onImageRotateHandleMouseDown: surface.handleImageRotateHandleMouseDown,
32353
+ onTextBoxRotateHandleMouseDown: surface.handleTextBoxRotateHandleMouseDown,
32354
+ onTableDragHandleMouseDown: surface.tableDrag.handleMouseDown,
32355
+ onRevisionMouseEnter: surface.revisionController.handleRevisionMouseEnter,
32356
+ onRevisionMouseLeave: surface.revisionController.handleRevisionMouseLeave,
32357
+ onEditorContextMenu: (event) => surface.handleEditorContextMenu(event)
32359
32358
  };
32360
32359
  const inputHandlers = {
32361
- onInputBlur: () => ctx.setFocused(false),
32362
- onInputFocus: () => ctx.setFocused(true),
32363
- onCompositionEnd: ctx.textInput.handleCompositionEnd,
32364
- onCompositionStart: ctx.textInput.handleCompositionStart,
32365
- onCopy: ctx.handleCopy,
32366
- onCut: ctx.handleCut,
32367
- onInput: ctx.textInput.handleTextInput,
32368
- onKeyDown: ctx.handleKeyDown,
32369
- onPaste: ctx.handlePaste
32360
+ onInputBlur: () => input.setFocused(false),
32361
+ onInputFocus: () => input.setFocused(true),
32362
+ onCompositionEnd: input.textInput.handleCompositionEnd,
32363
+ onCompositionStart: input.textInput.handleCompositionStart,
32364
+ onCopy: input.handleCopy,
32365
+ onCut: input.handleCut,
32366
+ onInput: input.textInput.handleTextInput,
32367
+ onKeyDown: input.handleKeyDown,
32368
+ onPaste: input.handlePaste
32370
32369
  };
32371
32370
  return {
32372
32371
  layout,
@@ -47964,44 +47963,56 @@ function OasisEditorApp(props = {}) {
47964
47963
  inputHandlers: editorInputHandlers,
47965
47964
  fileHandlers: editorFileHandlers
47966
47965
  } = buildEditorViewProps({
47967
- viewportHeight: ui().viewportHeight,
47968
- className: ui().class,
47969
- style: ui().style,
47970
- zoomPercent: zoom.zoomPercent,
47971
- setZoomPercent: zoom.setZoomPercent,
47972
- zoomFactor: zoom.zoomFactor,
47973
- selectionBoxes,
47974
- commentHighlights,
47975
- selectedImageBox,
47976
- selectedTextBoxBox,
47977
- layoutOptions: layoutOptionsOverlay,
47978
- caretBox,
47979
- inputBox,
47980
- hoveredRevision: revisionController.hoveredRevision,
47981
- focused,
47982
- showCaret: shouldShowCaret,
47983
- importProgress: docIO.importProgress,
47984
- focusController,
47985
- handleImportFile: docIO.handleImportFile,
47986
- handleInsertImage: docIO.handleInsertImage,
47987
- surfaceEvents: surfaceEventsWithTextDrag,
47988
- tableResize,
47989
- tableDrag,
47990
- revisionController,
47991
- handleDrop,
47992
- onEditorMouseDown,
47993
- handleImageMouseDown: imageOps.handleImageMouseDown,
47994
- handleImageResizeHandleMouseDown: imageOps.handleImageResizeHandleMouseDown,
47995
- handleTextBoxResizeHandleMouseDown: textBoxOps.handleTextBoxResizeHandleMouseDown,
47996
- handleImageRotateHandleMouseDown: imageOps.handleImageRotateHandleMouseDown,
47997
- handleTextBoxRotateHandleMouseDown: textBoxOps.handleTextBoxRotateHandleMouseDown,
47998
- handleEditorContextMenu,
47999
- textInput,
48000
- setFocused,
48001
- handleCopy,
48002
- handleCut,
48003
- handlePaste,
48004
- handleKeyDown
47966
+ layout: {
47967
+ viewportHeight: ui().viewportHeight,
47968
+ className: ui().class,
47969
+ style: ui().style,
47970
+ zoomPercent: zoom.zoomPercent,
47971
+ setZoomPercent: zoom.setZoomPercent,
47972
+ zoomFactor: zoom.zoomFactor
47973
+ },
47974
+ overlays: {
47975
+ selectionBoxes,
47976
+ commentHighlights,
47977
+ selectedImageBox,
47978
+ selectedTextBoxBox,
47979
+ layoutOptions: layoutOptionsOverlay,
47980
+ caretBox,
47981
+ inputBox,
47982
+ hoveredRevision: revisionController.hoveredRevision,
47983
+ focused,
47984
+ showCaret: shouldShowCaret,
47985
+ importProgress: docIO.importProgress
47986
+ },
47987
+ refs: {
47988
+ focusController
47989
+ },
47990
+ files: {
47991
+ handleImportFile: docIO.handleImportFile,
47992
+ handleInsertImage: docIO.handleInsertImage
47993
+ },
47994
+ surface: {
47995
+ surfaceEvents: surfaceEventsWithTextDrag,
47996
+ tableResize,
47997
+ tableDrag,
47998
+ revisionController,
47999
+ handleDrop,
48000
+ onEditorMouseDown,
48001
+ handleImageMouseDown: imageOps.handleImageMouseDown,
48002
+ handleImageResizeHandleMouseDown: imageOps.handleImageResizeHandleMouseDown,
48003
+ handleTextBoxResizeHandleMouseDown: textBoxOps.handleTextBoxResizeHandleMouseDown,
48004
+ handleImageRotateHandleMouseDown: imageOps.handleImageRotateHandleMouseDown,
48005
+ handleTextBoxRotateHandleMouseDown: textBoxOps.handleTextBoxRotateHandleMouseDown,
48006
+ handleEditorContextMenu
48007
+ },
48008
+ input: {
48009
+ textInput,
48010
+ setFocused,
48011
+ handleCopy,
48012
+ handleCut,
48013
+ handlePaste,
48014
+ handleKeyDown
48015
+ }
48005
48016
  });
48006
48017
  onMount(() => {
48007
48018
  startIconObserver();
@@ -0,0 +1,15 @@
1
+ import { EditorState } from '../../core/model.js';
2
+ import { TablePropertiesDialogApplyValues, TablePropertiesDialogInitialValues } from '../../ui/components/Dialogs/TablePropertiesDialog.js';
3
+
4
+ /** Whether the current selection sits inside a table. */
5
+ export declare function hasActiveTable(state: EditorState): boolean;
6
+ /**
7
+ * Reads the active table/cell into the dialog's initial values, or `null` when
8
+ * the selection is not inside a table.
9
+ */
10
+ export declare function readTableProperties(state: EditorState, activeTab?: TablePropertiesDialogInitialValues["activeTab"]): TablePropertiesDialogInitialValues | null;
11
+ /**
12
+ * Applies the dialog's submitted values to the active table/cell, returning the
13
+ * next state. A no-op when the selection is no longer inside a table.
14
+ */
15
+ export declare function applyTableProperties(state: EditorState, values: TablePropertiesDialogApplyValues): EditorState;
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2483
  onCleanup(() => {
2484
2484
  cancelled = true;
2485
2485
  });
2486
- import("./OasisEditorApp-C3VK8dmM.js").then((m) => {
2486
+ import("./OasisEditorApp-DmrINFOV.js").then((m) => {
2487
2487
  cancelled = true;
2488
2488
  setProgress(1);
2489
2489
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -1,4 +1,4 @@
1
- import { M, bX, bY, bZ, b_, b$, a6, c0, N, bG, c1, c2, c3, L, c4, bE, c5, c6, c7, c8, c9, bS, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, ab, cl, bR, cm, bZ as bZ2, c2 as c22, c4 as c42, cd as cd2, cf as cf2, ck as ck2, cn, bI, bD, co, cp, cq, bF, cr, cs, bH } from "./index-CqVqLWyO.js";
1
+ import { M, bX, bY, bZ, b_, b$, a6, c0, N, bG, c1, c2, c3, L, c4, bE, c5, c6, c7, c8, c9, bS, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, ab, cl, bR, cm, bZ as bZ2, c2 as c22, c4 as c42, cd as cd2, cf as cf2, ck as ck2, cn, bI, bD, co, cp, cq, bF, cr, cs, bH } from "./index-E2fsy7yp.js";
2
2
  export {
3
3
  M as BalloonShell,
4
4
  bX as Button,