@windoc/core 0.3.13 → 0.3.15

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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var version = "0.3.13";
2
+ var version = "0.3.15";
3
3
 
4
4
  // src/dataset/enum/Common.ts
5
5
  var MaxHeightRatio = /* @__PURE__ */ ((MaxHeightRatio2) => {
@@ -6391,7 +6391,7 @@ var Cursor = class {
6391
6391
  if (isMobile && this.draw.isReadonly()) return;
6392
6392
  const agentCursorDom = this.cursorAgent.getAgentCursorDom();
6393
6393
  if (document.activeElement !== agentCursorDom) {
6394
- agentCursorDom.focus();
6394
+ agentCursorDom.focus({ preventScroll: true });
6395
6395
  agentCursorDom.setSelectionRange(0, 0);
6396
6396
  }
6397
6397
  }
@@ -25496,42 +25496,6 @@ var imageMenus = [
25496
25496
  ];
25497
25497
 
25498
25498
  // src/core/contextmenu/menus/tableMenus.ts
25499
- var COLOR_PALETTE = [
25500
- { name: "Black", value: "#000000" },
25501
- { name: "Dark gray", value: "#444444" },
25502
- { name: "Gray", value: "#888888" },
25503
- { name: "Light gray", value: "#cccccc" },
25504
- { name: "White", value: "#ffffff" },
25505
- { name: "Red", value: "#ff0000" },
25506
- { name: "Orange", value: "#ff9900" },
25507
- { name: "Yellow", value: "#ffff00" },
25508
- { name: "Green", value: "#00aa00" },
25509
- { name: "Cyan", value: "#00aaff" },
25510
- { name: "Blue", value: "#0000ff" },
25511
- { name: "Purple", value: "#9900ff" },
25512
- { name: "Pink", value: "#ff00aa" },
25513
- { name: "Light red", value: "#ffcccc" },
25514
- { name: "Light orange", value: "#ffeecc" },
25515
- { name: "Light yellow", value: "#ffffcc" },
25516
- { name: "Light green", value: "#ccffcc" },
25517
- { name: "Light blue", value: "#ccecff" },
25518
- { name: "Light purple", value: "#eeccff" }
25519
- ];
25520
- function openNativeColorPicker(defaultColor, onSelect) {
25521
- const input2 = document.createElement("input");
25522
- input2.type = "color";
25523
- input2.value = defaultColor;
25524
- input2.style.cssText = "position:fixed;opacity:0;pointer-events:none;top:0;left:0;width:0;height:0";
25525
- document.body.appendChild(input2);
25526
- input2.addEventListener("change", () => {
25527
- onSelect(input2.value);
25528
- document.body.removeChild(input2);
25529
- });
25530
- input2.addEventListener("cancel", () => {
25531
- document.body.removeChild(input2);
25532
- });
25533
- input2.click();
25534
- }
25535
25499
  var {
25536
25500
  TABLE: {
25537
25501
  BORDER,
@@ -25562,8 +25526,6 @@ var {
25562
25526
  DELETE_TABLE,
25563
25527
  MERGE_CELL,
25564
25528
  CANCEL_MERGE_CELL,
25565
- TD_BG_COLOR,
25566
- TD_BORDER_COLOR,
25567
25529
  TD_PADDING,
25568
25530
  TD_PADDING_COMPACT,
25569
25531
  TD_PADDING_NORMAL,
@@ -25834,86 +25796,6 @@ var tableMenus = [
25834
25796
  command.executeCancelMergeTableCell();
25835
25797
  }
25836
25798
  },
25837
- {
25838
- key: TD_BG_COLOR,
25839
- i18nPath: "contextmenu.table.cellBackgroundColor",
25840
- icon: "td-bg-color",
25841
- when: (payload) => {
25842
- return !payload.isReadonly && payload.isInTable && payload.options.mode !== "form" /* FORM */;
25843
- },
25844
- childMenus: [
25845
- ...COLOR_PALETTE.map((c) => ({
25846
- key: `${TD_BG_COLOR}_${c.value}`,
25847
- name: c.name,
25848
- color: c.value,
25849
- when: () => true,
25850
- callback: (command) => {
25851
- command.executeTableTdBackgroundColor(c.value);
25852
- }
25853
- })),
25854
- {
25855
- isDivider: true
25856
- },
25857
- {
25858
- key: `${TD_BG_COLOR}_custom`,
25859
- name: "Custom color...",
25860
- when: () => true,
25861
- callback: (command) => {
25862
- openNativeColorPicker("#ffffff", (color) => {
25863
- command.executeTableTdBackgroundColor(color);
25864
- });
25865
- }
25866
- },
25867
- {
25868
- key: `${TD_BG_COLOR}_none`,
25869
- name: "No fill",
25870
- when: () => true,
25871
- callback: (command) => {
25872
- command.executeTableTdBackgroundColor("");
25873
- }
25874
- }
25875
- ]
25876
- },
25877
- {
25878
- key: TD_BORDER_COLOR,
25879
- i18nPath: "contextmenu.table.tdBorderColor",
25880
- icon: "td-border-color",
25881
- when: (payload) => {
25882
- return !payload.isReadonly && payload.isInTable && payload.options.mode !== "form" /* FORM */;
25883
- },
25884
- childMenus: [
25885
- ...COLOR_PALETTE.map((c) => ({
25886
- key: `${TD_BORDER_COLOR}_${c.value}`,
25887
- name: c.name,
25888
- color: c.value,
25889
- when: () => true,
25890
- callback: (command) => {
25891
- command.executeTableTdBorderColor(c.value);
25892
- }
25893
- })),
25894
- {
25895
- isDivider: true
25896
- },
25897
- {
25898
- key: `${TD_BORDER_COLOR}_custom`,
25899
- name: "Custom color...",
25900
- when: () => true,
25901
- callback: (command) => {
25902
- openNativeColorPicker("#000000", (color) => {
25903
- command.executeTableTdBorderColor(color);
25904
- });
25905
- }
25906
- },
25907
- {
25908
- key: `${TD_BORDER_COLOR}_reset`,
25909
- name: "Reset to default",
25910
- when: () => true,
25911
- callback: (command) => {
25912
- command.executeTableTdBorderColor("");
25913
- }
25914
- }
25915
- ]
25916
- },
25917
25799
  {
25918
25800
  key: TD_PADDING,
25919
25801
  i18nPath: "contextmenu.table.cellPadding",
@@ -26185,7 +26067,9 @@ var ContextMenu = class {
26185
26067
  const contextMenuWidth = contextmenuRect.width;
26186
26068
  const adjustLeft = left2 + contextMenuWidth > innerWidth ? left2 - contextMenuWidth : left2;
26187
26069
  contextMenuContainer.style.left = `${adjustLeft}px`;
26188
- const innerHeight = window.innerHeight;
26070
+ const footerEl = document.querySelector(".ce-editor-footer");
26071
+ const footerHeight = footerEl ? footerEl.offsetHeight : 0;
26072
+ const innerHeight = window.innerHeight - footerHeight;
26189
26073
  const contextMenuHeight = contextmenuRect.height;
26190
26074
  const adjustTop = top + contextMenuHeight > innerHeight ? top - contextMenuHeight : top;
26191
26075
  contextMenuContainer.style.top = `${adjustTop}px`;