@hyebook/vue3-adapter 0.2.4 → 2.2.6

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 +1 @@
1
- {"version":3,"file":"editor-workbench.d.ts","sourceRoot":"","sources":["../../../../../core/src/workbench/editor-workbench.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,EAKR,kBAAkB,EAWnB,MAAM,gBAAgB,CAAC;AA8KxB,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC5C,kBAAkB,CAAC,EAAE,uCAAuC,CAAC;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,4BAA4B,CAAC;IACtC,UAAU,CAAC,EAAE,gCAAgC,CAAC;IAC9C,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,uCAAuC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,uCAAuC;IACtD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,wBAAwB,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;IAClD,iBAAiB,CAAC,EAAE,uCAAuC,CAAC;CAC7D;AAED,MAAM,WAAW,gCAAgC;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG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I,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9B,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;IACjD,sBAAsB,EAAE,CACtB,WAAW,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,KAC/C,kBAAkB,CAAC;IACxB,WAAW,EAAE,MAAM,uBAAuB,CAAC;IAC3C,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAC;CACnE;AAED,eAAO,MAAM,iCAAiC,EAAE,uBAM/C,CAAC;AAEF,KAAK,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;AAoSjC,wBAAgB,8BAA8B,IAAI,QAAQ,CA6GzD;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CA0pKvB"}
@@ -144,6 +144,14 @@ const WORKBENCH_CSS = `
144
144
  .hyewb-upload-progress{height:8px;background:#e2e8f0;border-radius:999px;overflow:hidden}
145
145
  .hyewb-upload-progress > span{display:block;height:100%;width:0;background:#0b7285;transition:width .18s ease}
146
146
  .hyewb-upload-error{min-height:18px;font-size:12px;color:#b91c1c;margin:0}
147
+ .hyewb-preview-note-backdrop{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.45);z-index:10080;padding:16px}
148
+ .hyewb-preview-note-backdrop.show{display:flex}
149
+ .hyewb-preview-note-dialog{width:min(520px,100%);background:#fff;border:1px solid #cbd5e1;border-radius:12px;padding:14px;display:grid;gap:10px;box-shadow:0 16px 34px rgba(15,23,42,.28)}
150
+ .hyewb-preview-note-title{margin:0;font-size:14px;font-weight:600;color:#0f172a}
151
+ .hyewb-preview-note-input{width:100%;min-height:120px;resize:vertical;border:1px solid #94a3b8;border-radius:8px;padding:8px 10px;background:#fff;color:#0f172a;box-sizing:border-box;font-family:inherit;font-size:14px;line-height:1.5}
152
+ .hyewb-preview-note-actions{display:flex;justify-content:flex-end;gap:8px}
153
+ .hyewb-preview-note-btn{height:34px;padding:0 12px;border-radius:8px;border:1px solid #94a3b8;background:#fff;color:#0f172a;cursor:pointer}
154
+ .hyewb-preview-note-btn.primary{border-color:#0b7285;background:#0b7285;color:#fff}
147
155
  .hyewb-preview-highlight-mark{background:var(--hyewb-highlight-color,#fff59d);color:inherit;padding:0 .08em;border-radius:.2em}
148
156
  .hyewb-preview-note-mark{background:rgba(14,116,144,.14);border-bottom:2px solid #0e7490;color:inherit;padding:0 .04em;border-radius:.2em}
149
157
  .hyewb-preview-annotation-panel{display:none;align-content:start;gap:10px;border:1px solid #d8e0ea;border-radius:10px;background:#ffffff;padding:12px;max-height:100%;overflow:auto}
@@ -779,6 +787,35 @@ export function mountEditorWorkbench(container, options = {}) {
779
787
  previewNoteBtn.setAttribute("aria-label", "创建笔记");
780
788
  previewNoteBtn.append(createIconPlaceholder("notebook-pen"));
781
789
  previewSelectionToolbar.append(previewHighlightBtn, previewNoteBtn);
790
+ const preservePreviewSelectionOnToolbarPointerDown = (event) => {
791
+ // Keep native text selection active while clicking toolbar actions.
792
+ event.preventDefault();
793
+ event.stopPropagation();
794
+ };
795
+ previewSelectionToolbar.addEventListener("mousedown", preservePreviewSelectionOnToolbarPointerDown);
796
+ const previewNoteBackdrop = document.createElement("div");
797
+ previewNoteBackdrop.className = "hyewb-preview-note-backdrop";
798
+ const previewNoteDialog = document.createElement("div");
799
+ previewNoteDialog.className = "hyewb-preview-note-dialog";
800
+ const previewNoteTitle = document.createElement("h4");
801
+ previewNoteTitle.className = "hyewb-preview-note-title";
802
+ previewNoteTitle.textContent = "新增笔记";
803
+ const previewNoteInput = document.createElement("textarea");
804
+ previewNoteInput.className = "hyewb-preview-note-input";
805
+ previewNoteInput.placeholder = "请输入笔记内容";
806
+ const previewNoteActions = document.createElement("div");
807
+ previewNoteActions.className = "hyewb-preview-note-actions";
808
+ const previewNoteCancelBtn = document.createElement("button");
809
+ previewNoteCancelBtn.type = "button";
810
+ previewNoteCancelBtn.className = "hyewb-preview-note-btn";
811
+ previewNoteCancelBtn.textContent = "取消";
812
+ const previewNoteConfirmBtn = document.createElement("button");
813
+ previewNoteConfirmBtn.type = "button";
814
+ previewNoteConfirmBtn.className = "hyewb-preview-note-btn primary";
815
+ previewNoteConfirmBtn.textContent = "保存";
816
+ previewNoteActions.append(previewNoteCancelBtn, previewNoteConfirmBtn);
817
+ previewNoteDialog.append(previewNoteTitle, previewNoteInput, previewNoteActions);
818
+ previewNoteBackdrop.append(previewNoteDialog);
782
819
  const floatingToolbar = document.createElement("div");
783
820
  floatingToolbar.className = "hyewb-float";
784
821
  const floatBoldBtn = createButton("bold");
@@ -853,9 +890,10 @@ export function mountEditorWorkbench(container, options = {}) {
853
890
  const colorGrid = document.createElement("div");
854
891
  colorGrid.className = "hyewb-color-grid";
855
892
  colorPalette.append(colorGrid);
856
- root.append(header, toolbar, pageRow, previewLayout, status, colorPalette, tablePicker, tableTools, tableRowDeleteBtn, tableMoveHandle, tableScaleHandle, tableColEdgeLayer, tableRowEdgeLayer, tableRowGapInsertBtn, tableColGapInsertBtn, tableDropIndicator, tableContextMenu, uploadBackdrop, docxInput, previewSelectionToolbar);
893
+ root.append(header, toolbar, pageRow, previewLayout, status, colorPalette, tablePicker, tableTools, tableRowDeleteBtn, tableMoveHandle, tableScaleHandle, tableColEdgeLayer, tableRowEdgeLayer, tableRowGapInsertBtn, tableColGapInsertBtn, tableDropIndicator, tableContextMenu, uploadBackdrop, previewNoteBackdrop, docxInput, previewSelectionToolbar);
857
894
  container.innerHTML = "";
858
- container.append(root, floatingToolbar);
895
+ root.append(floatingToolbar);
896
+ container.append(root);
859
897
  renderWorkbenchIcons();
860
898
  let editorRenderKey = "";
861
899
  let lastSelection = null;
@@ -881,6 +919,7 @@ export function mountEditorWorkbench(container, options = {}) {
881
919
  let selectedTableColIndex = null;
882
920
  let annotationActiveTab = previewAnnotationOptions.annotationListDefaultTab;
883
921
  let previewSelectionDraft = null;
922
+ let previewNoteDialogDraft = null;
884
923
  const isTableGapInsertTarget = (node) => {
885
924
  if (!node) {
886
925
  return false;
@@ -896,6 +935,7 @@ export function mountEditorWorkbench(container, options = {}) {
896
935
  speedMbps: undefined,
897
936
  error: undefined,
898
937
  };
938
+ let shouldRestoreFullscreenAfterFilePicker = false;
899
939
  const setButtonIcon = (button, iconName) => {
900
940
  button.innerHTML = "";
901
941
  button.append(createIconPlaceholder(iconName));
@@ -989,6 +1029,26 @@ export function mountEditorWorkbench(container, options = {}) {
989
1029
  updateShellViewportHeight();
990
1030
  }
991
1031
  };
1032
+ const restoreWorkbenchFullscreenIfNeeded = async () => {
1033
+ if (!shouldRestoreFullscreenAfterFilePicker) {
1034
+ return;
1035
+ }
1036
+ shouldRestoreFullscreenAfterFilePicker = false;
1037
+ if (isWorkbenchFullscreen()) {
1038
+ return;
1039
+ }
1040
+ try {
1041
+ await requestWorkbenchFullscreen();
1042
+ }
1043
+ catch {
1044
+ // Ignore restore failure when browser blocks fullscreen without activation.
1045
+ }
1046
+ finally {
1047
+ updateFullscreenButtonState();
1048
+ updateShellViewportHeight();
1049
+ updateTopControlShieldHeight();
1050
+ }
1051
+ };
992
1052
  const formatUploadProgress = (percent) => {
993
1053
  const safe = Number.isFinite(percent) ? percent : 0;
994
1054
  const clamped = Math.max(0, Math.min(100, safe));
@@ -1007,6 +1067,48 @@ export function mountEditorWorkbench(container, options = {}) {
1007
1067
  uploadProgressBar.style.width = `${formatUploadProgress(uploadState.progress)}%`;
1008
1068
  uploadError.textContent = uploadState.error || "";
1009
1069
  };
1070
+ const closePreviewNoteDialog = () => {
1071
+ previewNoteDialogDraft = null;
1072
+ previewNoteInput.value = "";
1073
+ previewNoteBackdrop.classList.remove("show");
1074
+ previewNoteInput.blur();
1075
+ };
1076
+ const openPreviewNoteDialog = (draft) => {
1077
+ previewNoteDialogDraft = { ...draft };
1078
+ previewNoteInput.value = draft.text || "";
1079
+ previewNoteBackdrop.classList.add("show");
1080
+ window.setTimeout(() => {
1081
+ previewNoteInput.focus();
1082
+ previewNoteInput.select();
1083
+ }, 0);
1084
+ };
1085
+ const savePreviewNoteFromDialog = () => {
1086
+ if (!previewNoteDialogDraft) {
1087
+ return;
1088
+ }
1089
+ const noteText = previewNoteInput.value.trim();
1090
+ if (!noteText) {
1091
+ status.textContent = "请输入笔记内容";
1092
+ previewNoteInput.focus();
1093
+ return;
1094
+ }
1095
+ const current = normalizePreviewAnnotations(state.doc.meta.previewAnnotations);
1096
+ current.notes = mergeNoteRecords(current.notes, {
1097
+ id: `note-${Date.now()}-${Math.round(Math.random() * 10000)}`,
1098
+ pageId: previewNoteDialogDraft.pageId,
1099
+ start: previewNoteDialogDraft.start,
1100
+ end: previewNoteDialogDraft.end,
1101
+ text: noteText,
1102
+ selectedText: previewNoteDialogDraft.text,
1103
+ color: "#0e7490",
1104
+ createdAt: new Date().toISOString(),
1105
+ });
1106
+ annotationActiveTab = "notes";
1107
+ savePreviewAnnotations(current);
1108
+ window.getSelection()?.removeAllRanges();
1109
+ closePreviewNoteDialog();
1110
+ hidePreviewSelectionToolbar();
1111
+ };
1010
1112
  const closeUploadDialog = () => {
1011
1113
  if (uploadState.uploading) {
1012
1114
  return;
@@ -3713,26 +3815,25 @@ export function mountEditorWorkbench(container, options = {}) {
3713
3815
  if (!previewSelectionDraft) {
3714
3816
  return;
3715
3817
  }
3716
- const text = window.prompt("请输入笔记内容", previewSelectionDraft.text || "") || "";
3717
- const noteText = text.trim();
3718
- if (!noteText) {
3719
- return;
3818
+ openPreviewNoteDialog(previewSelectionDraft);
3819
+ });
3820
+ previewNoteConfirmBtn.addEventListener("click", () => {
3821
+ savePreviewNoteFromDialog();
3822
+ });
3823
+ previewNoteCancelBtn.addEventListener("click", () => {
3824
+ closePreviewNoteDialog();
3825
+ });
3826
+ previewNoteBackdrop.addEventListener("click", () => {
3827
+ closePreviewNoteDialog();
3828
+ });
3829
+ previewNoteDialog.addEventListener("click", (event) => {
3830
+ event.stopPropagation();
3831
+ });
3832
+ previewNoteInput.addEventListener("keydown", (event) => {
3833
+ if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
3834
+ event.preventDefault();
3835
+ savePreviewNoteFromDialog();
3720
3836
  }
3721
- const current = normalizePreviewAnnotations(state.doc.meta.previewAnnotations);
3722
- current.notes = mergeNoteRecords(current.notes, {
3723
- id: `note-${Date.now()}-${Math.round(Math.random() * 10000)}`,
3724
- pageId: previewSelectionDraft.pageId,
3725
- start: previewSelectionDraft.start,
3726
- end: previewSelectionDraft.end,
3727
- text: noteText,
3728
- selectedText: previewSelectionDraft.text,
3729
- color: "#0e7490",
3730
- createdAt: new Date().toISOString(),
3731
- });
3732
- annotationActiveTab = "notes";
3733
- savePreviewAnnotations(current);
3734
- window.getSelection()?.removeAllRanges();
3735
- hidePreviewSelectionToolbar();
3736
3837
  });
3737
3838
  floatLeftBtn.addEventListener("click", () => updateAlign("left"));
3738
3839
  floatCenterBtn.addEventListener("click", () => updateAlign("center"));
@@ -4504,6 +4605,9 @@ export function mountEditorWorkbench(container, options = {}) {
4504
4605
  const handleDocumentKeyDown = (event) => {
4505
4606
  if (event.key === "Escape") {
4506
4607
  hideTableContextMenu();
4608
+ if (previewNoteBackdrop.classList.contains("show")) {
4609
+ closePreviewNoteDialog();
4610
+ }
4507
4611
  }
4508
4612
  };
4509
4613
  document.addEventListener("pointerdown", handleDocumentPointerDownForPalette);
@@ -4540,10 +4644,12 @@ export function mountEditorWorkbench(container, options = {}) {
4540
4644
  status.textContent = "请先切换到编辑模式后再导入 Word";
4541
4645
  return;
4542
4646
  }
4647
+ shouldRestoreFullscreenAfterFilePicker = isWorkbenchFullscreen();
4543
4648
  docxInput.value = "";
4544
4649
  docxInput.click();
4545
4650
  });
4546
4651
  docxInput.addEventListener("change", () => {
4652
+ void restoreWorkbenchFullscreenIfNeeded();
4547
4653
  const picked = docxInput.files?.[0] || null;
4548
4654
  docxInput.value = "";
4549
4655
  if (!picked) {
@@ -4551,7 +4657,11 @@ export function mountEditorWorkbench(container, options = {}) {
4551
4657
  }
4552
4658
  void importDocxFile(picked);
4553
4659
  });
4660
+ uploadInput.addEventListener("click", () => {
4661
+ shouldRestoreFullscreenAfterFilePicker = isWorkbenchFullscreen();
4662
+ });
4554
4663
  uploadInput.addEventListener("change", () => {
4664
+ void restoreWorkbenchFullscreenIfNeeded();
4555
4665
  const picked = uploadInput.files?.[0] || null;
4556
4666
  uploadState.progress = 0;
4557
4667
  uploadState.speedMbps = undefined;
@@ -4586,6 +4696,10 @@ export function mountEditorWorkbench(container, options = {}) {
4586
4696
  uploadDialog.addEventListener("click", (event) => {
4587
4697
  event.stopPropagation();
4588
4698
  });
4699
+ const handleWindowFocusForFullscreenRestore = () => {
4700
+ void restoreWorkbenchFullscreenIfNeeded();
4701
+ };
4702
+ window.addEventListener("focus", handleWindowFocusForFullscreenRestore);
4589
4703
  prevPageBtn.addEventListener("click", () => jumpPage(-1));
4590
4704
  nextPageBtn.addEventListener("click", () => jumpPage(1));
4591
4705
  addPageBtn.addEventListener("click", addPage);
@@ -4603,6 +4717,7 @@ export function mountEditorWorkbench(container, options = {}) {
4603
4717
  document.removeEventListener("pointerup", onMediaPointerUp);
4604
4718
  window.removeEventListener("resize", handleWindowResize);
4605
4719
  window.removeEventListener("scroll", handleWindowScroll, true);
4720
+ window.removeEventListener("focus", handleWindowFocusForFullscreenRestore);
4606
4721
  document.removeEventListener("pointerdown", handleDocumentPointerDownForPalette);
4607
4722
  document.removeEventListener("keydown", handleDocumentKeyDown);
4608
4723
  document.removeEventListener("fullscreenchange", handleFullscreenChange);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyebook/vue3-adapter",
3
- "version": "0.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "Vue3 adapter for hy-ebook core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,11 +17,11 @@
17
17
  "dist"
18
18
  ],
19
19
  "dependencies": {
20
- "@hyebook/core": "^0.2.4"
20
+ "@hyebook/core": "^2.2.6"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsc -p tsconfig.json",
24
24
  "typecheck": "tsc -p tsconfig.json --noEmit",
25
25
  "lint": "echo 'No lint configured for @hyebook/vue3-adapter'"
26
26
  }
27
- }
27
+ }