@gct-paas/word 0.1.42 → 0.1.43

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.es.js CHANGED
@@ -32089,11 +32089,20 @@ class Enter extends CommandBase {
32089
32089
  const { nodeId, offset: offset2, side } = cursor.getCursor();
32090
32090
  const mapper = this.doc.layoutMapper;
32091
32091
  const run = mapper.getLayoutNodeById(nodeId);
32092
+ const wpId = run?.parent?.modelRef?.id;
32093
+ if (!run || !wpId) {
32094
+ this.isTerminated = true;
32095
+ return null;
32096
+ }
32092
32097
  if (!this.doc.eventManager.policy.canInput(run)) {
32093
32098
  this.isTerminated = true;
32094
32099
  return null;
32095
32100
  }
32096
- const wp = mapper.getModelNodeById(run.parent.modelRef.id);
32101
+ const wp = mapper.getModelNodeById(wpId);
32102
+ if (!wp) {
32103
+ this.isTerminated = true;
32104
+ return null;
32105
+ }
32097
32106
  let targetModelIndex = 0;
32098
32107
  if (!run.isPlaceholderRun) {
32099
32108
  if (run.isWidgetRun || run.isPageWidgetRun) {
@@ -40350,6 +40359,7 @@ class CommandManager {
40350
40359
  compositionUpdate(text) {
40351
40360
  }
40352
40361
  compositionEnd(text) {
40362
+ if (!text) return;
40353
40363
  this.doc.commandManager.execute(CommandType.insertText, {
40354
40364
  text
40355
40365
  });
@@ -46547,10 +46557,11 @@ class IMEHandler {
46547
46557
  this.eventManager.doc.commandManager.compositionUpdate(data);
46548
46558
  }
46549
46559
  handleCompositionEnd(payload) {
46550
- const data = payload?.data ?? this.lastComposedText ?? "";
46560
+ const data = payload?.data !== null && payload?.data !== void 0 ? payload.data : this.lastComposedText ?? "";
46551
46561
  this.lastComposedText = null;
46552
46562
  this.isComposing = false;
46553
46563
  this.lastCompositionCommitTime = performance.now();
46564
+ if (!data) return;
46554
46565
  this.eventManager.doc.commandManager.compositionEnd(data);
46555
46566
  }
46556
46567
  handleInput(payload) {
@@ -46579,6 +46590,7 @@ class IMEHandler {
46579
46590
  case "delete":
46580
46591
  break;
46581
46592
  case "enter":
46593
+ if (this.isComposing) return;
46582
46594
  doc.commandManager.execute(CommandType.enter);
46583
46595
  break;
46584
46596
  case "tab":
@@ -51118,8 +51130,18 @@ const _sfc_main$2X = /* @__PURE__ */ defineComponent({
51118
51130
  lastComposedText.value = data;
51119
51131
  dispatch("ime:compositionupdate", { data });
51120
51132
  }
51133
+ function resolveCompositionEndData(e) {
51134
+ if (e.data !== null && e.data !== void 0) {
51135
+ return e.data;
51136
+ }
51137
+ const fromTextarea = ta2.value?.value ?? "";
51138
+ if (fromTextarea !== lastComposedText.value) {
51139
+ lastComposedText.value = fromTextarea;
51140
+ }
51141
+ return lastComposedText.value ?? "";
51142
+ }
51121
51143
  function onCompositionEnd(e) {
51122
- const data = e.data ?? lastComposedText.value ?? "";
51144
+ const data = resolveCompositionEndData(e);
51123
51145
  isComposing.value = false;
51124
51146
  pos.opacity = props.idleOpacity;
51125
51147
  lastComposedText.value = "";
@@ -51148,6 +51170,7 @@ const _sfc_main$2X = /* @__PURE__ */ defineComponent({
51148
51170
  }
51149
51171
  break;
51150
51172
  case "Enter":
51173
+ if (isComposing.value) return;
51151
51174
  e.preventDefault();
51152
51175
  dispatch("ime:keydown", { type: "enter" });
51153
51176
  break;
@@ -51195,9 +51218,10 @@ const _sfc_main$2X = /* @__PURE__ */ defineComponent({
51195
51218
  function onBlur(e) {
51196
51219
  if (isComposing.value) {
51197
51220
  isComposing.value = false;
51198
- dispatch("ime:compositionend", { data: lastComposedText.value });
51221
+ const data = ta2.value?.value ?? lastComposedText.value ?? "";
51199
51222
  lastComposedText.value = "";
51200
51223
  lastCompositionCommitTime.value = performance.now();
51224
+ dispatch("ime:compositionend", { data });
51201
51225
  }
51202
51226
  dispatch("ime:blur", {});
51203
51227
  }
@@ -51296,7 +51320,7 @@ const _sfc_main$2X = /* @__PURE__ */ defineComponent({
51296
51320
  };
51297
51321
  }
51298
51322
  });
51299
- const HiddenInput = /* @__PURE__ */ _export_sfc(_sfc_main$2X, [["__scopeId", "data-v-58dae928"]]);
51323
+ const HiddenInput = /* @__PURE__ */ _export_sfc(_sfc_main$2X, [["__scopeId", "data-v-72d0b6f5"]]);
51300
51324
  function useLatestRequest(execFn) {
51301
51325
  let lastReqId = 0;
51302
51326
  const loading = ref(false);
package/dist/word.css CHANGED
@@ -7572,7 +7572,7 @@ textarea[data-v-57fe54a3]::placeholder {
7572
7572
  .avatar--horizontal .avatar__name[data-v-b2773d93] {
7573
7573
  margin-left: 6px;
7574
7574
  }
7575
- .hidden-input[data-v-58dae928] {
7575
+ .hidden-input[data-v-72d0b6f5] {
7576
7576
  position: absolute;
7577
7577
  resize: none;
7578
7578
  border: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",