@univerjs/sheets-hyper-link-ui 1.0.0-alpha.0 → 1.0.0-alpha.2

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.
Files changed (83) hide show
  1. package/lib/cjs/index.js +13 -10
  2. package/lib/cjs/locale/ar-SA.js +1 -0
  3. package/lib/cjs/locale/ca-ES.js +1 -0
  4. package/lib/cjs/locale/de-DE.js +1 -0
  5. package/lib/cjs/locale/en-US.js +1 -0
  6. package/lib/cjs/locale/es-ES.js +1 -0
  7. package/lib/cjs/locale/fa-IR.js +1 -0
  8. package/lib/cjs/locale/fr-FR.js +1 -0
  9. package/lib/cjs/locale/id-ID.js +1 -0
  10. package/lib/cjs/locale/it-IT.js +1 -0
  11. package/lib/cjs/locale/ja-JP.js +1 -0
  12. package/lib/cjs/locale/ko-KR.js +1 -0
  13. package/lib/cjs/locale/pl-PL.js +1 -0
  14. package/lib/cjs/locale/pt-BR.js +1 -0
  15. package/lib/cjs/locale/ru-RU.js +1 -0
  16. package/lib/cjs/locale/sk-SK.js +1 -0
  17. package/lib/cjs/locale/vi-VN.js +1 -0
  18. package/lib/cjs/locale/zh-CN.js +1 -0
  19. package/lib/cjs/locale/zh-HK.js +1 -0
  20. package/lib/cjs/locale/zh-TW.js +1 -0
  21. package/lib/es/index.js +14 -11
  22. package/lib/es/locale/ar-SA.js +1 -0
  23. package/lib/es/locale/ca-ES.js +1 -0
  24. package/lib/es/locale/de-DE.js +1 -0
  25. package/lib/es/locale/en-US.js +1 -0
  26. package/lib/es/locale/es-ES.js +1 -0
  27. package/lib/es/locale/fa-IR.js +1 -0
  28. package/lib/es/locale/fr-FR.js +1 -0
  29. package/lib/es/locale/id-ID.js +1 -0
  30. package/lib/es/locale/it-IT.js +1 -0
  31. package/lib/es/locale/ja-JP.js +1 -0
  32. package/lib/es/locale/ko-KR.js +1 -0
  33. package/lib/es/locale/pl-PL.js +1 -0
  34. package/lib/es/locale/pt-BR.js +1 -0
  35. package/lib/es/locale/ru-RU.js +1 -0
  36. package/lib/es/locale/sk-SK.js +1 -0
  37. package/lib/es/locale/vi-VN.js +1 -0
  38. package/lib/es/locale/zh-CN.js +1 -0
  39. package/lib/es/locale/zh-HK.js +1 -0
  40. package/lib/es/locale/zh-TW.js +1 -0
  41. package/lib/index.css +6 -10
  42. package/lib/index.js +14 -11
  43. package/lib/locale/ar-SA.js +1 -0
  44. package/lib/locale/ca-ES.js +1 -0
  45. package/lib/locale/de-DE.js +1 -0
  46. package/lib/locale/en-US.js +1 -0
  47. package/lib/locale/es-ES.js +1 -0
  48. package/lib/locale/fa-IR.js +1 -0
  49. package/lib/locale/fr-FR.js +1 -0
  50. package/lib/locale/id-ID.js +1 -0
  51. package/lib/locale/it-IT.js +1 -0
  52. package/lib/locale/ja-JP.js +1 -0
  53. package/lib/locale/ko-KR.js +1 -0
  54. package/lib/locale/pl-PL.js +1 -0
  55. package/lib/locale/pt-BR.js +1 -0
  56. package/lib/locale/ru-RU.js +1 -0
  57. package/lib/locale/sk-SK.js +1 -0
  58. package/lib/locale/vi-VN.js +1 -0
  59. package/lib/locale/zh-CN.js +1 -0
  60. package/lib/locale/zh-HK.js +1 -0
  61. package/lib/locale/zh-TW.js +1 -0
  62. package/lib/types/locale/en-US.d.ts +3 -0
  63. package/lib/umd/index.js +1 -1
  64. package/lib/umd/locale/ar-SA.js +1 -1
  65. package/lib/umd/locale/ca-ES.js +1 -1
  66. package/lib/umd/locale/de-DE.js +1 -1
  67. package/lib/umd/locale/en-US.js +1 -1
  68. package/lib/umd/locale/es-ES.js +1 -1
  69. package/lib/umd/locale/fa-IR.js +1 -1
  70. package/lib/umd/locale/fr-FR.js +1 -1
  71. package/lib/umd/locale/id-ID.js +1 -1
  72. package/lib/umd/locale/it-IT.js +1 -1
  73. package/lib/umd/locale/ja-JP.js +1 -1
  74. package/lib/umd/locale/ko-KR.js +1 -1
  75. package/lib/umd/locale/pl-PL.js +1 -1
  76. package/lib/umd/locale/pt-BR.js +1 -1
  77. package/lib/umd/locale/ru-RU.js +1 -1
  78. package/lib/umd/locale/sk-SK.js +1 -1
  79. package/lib/umd/locale/vi-VN.js +1 -1
  80. package/lib/umd/locale/zh-CN.js +1 -1
  81. package/lib/umd/locale/zh-HK.js +1 -1
  82. package/lib/umd/locale/zh-TW.js +1 -1
  83. package/package.json +16 -16
package/lib/cjs/index.js CHANGED
@@ -779,7 +779,7 @@ CellLinkEdit.componentKey = "univer.sheet.cell-link-edit";
779
779
  //#region src/views/CellLinkPopup.tsx
780
780
  const iconsMap = {
781
781
  [_univerjs_sheets_hyper_link.SheetHyperLinkType.URL]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.LinkIcon, {}),
782
- [_univerjs_sheets_hyper_link.SheetHyperLinkType.SHEET]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.XlsxMultiIcon, { className: "univer-text-green-500" }),
782
+ [_univerjs_sheets_hyper_link.SheetHyperLinkType.SHEET]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.SheetsMultiIcon, { className: "univer-text-green-500" }),
783
783
  [_univerjs_sheets_hyper_link.SheetHyperLinkType.RANGE]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AllBorderIcon, {}),
784
784
  [_univerjs_sheets_hyper_link.SheetHyperLinkType.DEFINE_NAME]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AllBorderIcon, {}),
785
785
  [_univerjs_sheets_hyper_link.SheetHyperLinkType.INVALID]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AllBorderIcon, {})
@@ -798,16 +798,16 @@ const CellLinkPopupPure = (props) => {
798
798
  const linkObj = parserHyperLinkService.parseHyperLink((_customRange$properti2 = customRange.properties.url) !== null && _customRange$properti2 !== void 0 ? _customRange$properti2 : "");
799
799
  const isError = linkObj.type === _univerjs_sheets_hyper_link.SheetHyperLinkType.INVALID;
800
800
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
801
- className: (0, _univerjs_design.clsx)("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
801
+ className: (0, _univerjs_design.clsx)("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-gap-2 univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-2 univer-shadow-md dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
802
802
  onClick: () => popupService.hideCurrentPopup(),
803
803
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
804
- className: (0, _univerjs_design.clsx)("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": isError }),
804
+ className: (0, _univerjs_design.clsx)("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-gap-1 univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": isError }),
805
805
  onClick: () => {
806
806
  if (isError) return;
807
807
  resolverService.navigate(linkObj);
808
808
  },
809
809
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
810
- className: "univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",
810
+ className: "univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",
811
811
  children: iconsMap[linkObj.type]
812
812
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
813
813
  showIfEllipsis: true,
@@ -819,9 +819,9 @@ const CellLinkPopupPure = (props) => {
819
819
  })
820
820
  })]
821
821
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
822
- className: "univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center",
822
+ className: "univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center univer-gap-2",
823
823
  children: [copyPermission && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
824
- className: (0, _univerjs_design.clsx)("univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-text-red-500": isError }),
824
+ className: (0, _univerjs_design.clsx)("univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-text-red-500": isError }),
825
825
  onClick: () => {
826
826
  if (isError) return;
827
827
  if (linkObj.type !== _univerjs_sheets_hyper_link.SheetHyperLinkType.URL) {
@@ -840,7 +840,8 @@ const CellLinkPopupPure = (props) => {
840
840
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CopyIcon, { className: "dark:!univer-text-white" })
841
841
  })
842
842
  }), editPermission && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
843
- className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
843
+ "data-u-comp": "cell-link-popup-edit",
844
+ className: "univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
844
845
  onClick: () => {
845
846
  commandService.executeCommand(OpenHyperLinkEditPanelOperation.id, {
846
847
  unitId,
@@ -857,7 +858,8 @@ const CellLinkPopupPure = (props) => {
857
858
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.WriteIcon, { className: "dark:!univer-text-white" })
858
859
  })
859
860
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
860
- className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
861
+ "data-u-comp": "cell-link-popup-remove",
862
+ className: "univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
861
863
  onClick: () => {
862
864
  const commandId = type === "editing" ? _univerjs_sheets_hyper_link.CancelRichHyperLinkCommand.id : _univerjs_sheets_hyper_link.CancelHyperLinkCommand.id;
863
865
  if (commandService.syncExecuteCommand(commandId, {
@@ -1174,13 +1176,14 @@ const getShouldDisableCurrentCellLink = (accessor) => {
1174
1176
  return getShouldDisableCellLink(accessor, worksheet, row, col) === 1;
1175
1177
  };
1176
1178
  const shouldDisableAddLink = (accessor) => {
1179
+ var _doc$getSelfOrHeaderF;
1177
1180
  const textSelectionService = accessor.get(_univerjs_docs.DocSelectionManagerService);
1178
1181
  const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
1179
1182
  const textRanges = textSelectionService.getTextRanges();
1180
1183
  if (!(textRanges === null || textRanges === void 0 ? void 0 : textRanges.length)) return true;
1181
1184
  const doc = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
1182
1185
  if (!doc || textRanges.every((range) => range.collapsed)) return true;
1183
- if (!doc.getSelfOrHeaderFooterModel(textRanges[0].segmentId).getBody()) return true;
1186
+ if (!((_doc$getSelfOrHeaderF = doc.getSelfOrHeaderFooterModel(textRanges[0].segmentId)) === null || _doc$getSelfOrHeaderF === void 0 ? void 0 : _doc$getSelfOrHeaderF.getBody())) return true;
1184
1187
  return false;
1185
1188
  };
1186
1189
 
@@ -1527,7 +1530,7 @@ const InsertLinkShortcut = {
1527
1530
  //#endregion
1528
1531
  //#region package.json
1529
1532
  var name = "@univerjs/sheets-hyper-link-ui";
1530
- var version = "1.0.0-alpha.0";
1533
+ var version = "1.0.0-alpha.2";
1531
1534
 
1532
1535
  //#endregion
1533
1536
  //#region src/controllers/auto-fill.controller.ts
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "الرجاء إدخال رابط صالح"
20
20
  },
21
21
  menu: { add: "إدراج ارتباط تشعبي" },
22
+ permission: { hyperLinkErr: "ليس لديك إذن لإدراج رابط." },
22
23
  message: {
23
24
  noSheet: "تم حذف الورقة المستهدفة",
24
25
  refError: "نطاق غير صالح",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Si us plau, introdueix un enllaç vàlid"
20
20
  },
21
21
  menu: { add: "Insereix enllaç" },
22
+ permission: { hyperLinkErr: "No teniu permís per inserir un enllaç." },
22
23
  message: {
23
24
  noSheet: "El full de destinació ha estat eliminat",
24
25
  refError: "Interval no vàlid",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Bitte einen gültigen Link eingeben"
20
20
  },
21
21
  menu: { add: "Link einfügen" },
22
+ permission: { hyperLinkErr: "Sie haben keine Berechtigung, einen Link einzufügen." },
22
23
  message: {
23
24
  noSheet: "Zielblatt wurde gelöscht",
24
25
  refError: "Ungültiger Bereich",
@@ -34,6 +34,7 @@ const locale = { "sheets-hyper-link-ui": {
34
34
  linkError: "Please enter a legal link"
35
35
  },
36
36
  menu: { add: "Insert Link" },
37
+ permission: { hyperLinkErr: "You do not have permission to insert a link." },
37
38
  message: {
38
39
  noSheet: "Target sheet has been delete",
39
40
  refError: "Invalid Range",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Por favor, introduce un enlace válido"
20
20
  },
21
21
  menu: { add: "Insertar enlace" },
22
+ permission: { hyperLinkErr: "No tiene permiso para insertar un enlace." },
22
23
  message: {
23
24
  noSheet: "La hoja de destino ha sido eliminada",
24
25
  refError: "Rango no válido",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "لطفا یک لینک معتبر وارد کنید"
20
20
  },
21
21
  menu: { add: "درج لینک" },
22
+ permission: { hyperLinkErr: "شما مجوز درج لینک را ندارید." },
22
23
  message: {
23
24
  noSheet: "برگ هدف حذف شده است",
24
25
  refError: "محدوده نامعتبر",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Veuillez entrer un lien valide"
20
20
  },
21
21
  menu: { add: "Insérer un lien" },
22
+ permission: { hyperLinkErr: "Vous n’avez pas l’autorisation d’insérer un lien." },
22
23
  message: {
23
24
  noSheet: "La feuille cible a été supprimée",
24
25
  refError: "Plage invalide",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Silakan masukkan tautan yang valid"
20
20
  },
21
21
  menu: { add: "Sisipkan Tautan" },
22
+ permission: { hyperLinkErr: "Anda tidak memiliki izin untuk menyisipkan tautan." },
22
23
  message: {
23
24
  noSheet: "Lembar target telah dihapus",
24
25
  refError: "Rentang Tidak Valid",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Inserisci un collegamento valido"
20
20
  },
21
21
  menu: { add: "Inserisci collegamento" },
22
+ permission: { hyperLinkErr: "Non hai l’autorizzazione per inserire un collegamento." },
22
23
  message: {
23
24
  noSheet: "Il foglio di destinazione è stato eliminato",
24
25
  refError: "Intervallo non valido",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "有効なリンクを入力してください"
20
20
  },
21
21
  menu: { add: "リンクの挿入" },
22
+ permission: { hyperLinkErr: "リンクを挿入する権限がありません。" },
22
23
  message: {
23
24
  noSheet: "対象のワークシートが削除されました",
24
25
  refError: "無効な範囲です",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "유효한 링크를 입력하세요"
20
20
  },
21
21
  menu: { add: "링크 삽입" },
22
+ permission: { hyperLinkErr: "링크를 삽입할 권한이 없습니다." },
22
23
  message: {
23
24
  noSheet: "대상 워크시트가 삭제되었습니다",
24
25
  refError: "잘못된 범위입니다",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Wprowadź prawidłowe łącze"
20
20
  },
21
21
  menu: { add: "Wstaw łącze" },
22
+ permission: { hyperLinkErr: "Nie masz uprawnień do wstawiania łącza." },
22
23
  message: {
23
24
  noSheet: "Arkusz docelowy został usunięty",
24
25
  refError: "Nieprawidłowy zakres",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Por favor, digite um link válido"
20
20
  },
21
21
  menu: { add: "Inserir Link" },
22
+ permission: { hyperLinkErr: "Você não tem permissão para inserir um link." },
22
23
  message: {
23
24
  noSheet: "A planilha de destino foi excluída",
24
25
  refError: "Intervalo Inválido",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Пожалуйста, введите корректную ссылку"
20
20
  },
21
21
  menu: { add: "Вставить ссылку" },
22
+ permission: { hyperLinkErr: "У вас нет разрешения на вставку ссылки." },
22
23
  message: {
23
24
  noSheet: "Целевой лист был удален",
24
25
  refError: "Недопустимый диапазон",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Zadajte platný odkaz"
20
20
  },
21
21
  menu: { add: "Vložiť odkaz" },
22
+ permission: { hyperLinkErr: "Nemáte povolenie vložiť odkaz." },
22
23
  message: {
23
24
  noSheet: "Cieľový hárok bol odstránený",
24
25
  refError: "Neplatný rozsah",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "Vui lòng nhập liên kết hợp lệ"
20
20
  },
21
21
  menu: { add: "Thêm liên kết" },
22
+ permission: { hyperLinkErr: "Bạn không có quyền chèn liên kết." },
22
23
  message: {
23
24
  noSheet: "Bảng con này đã bị xóa",
24
25
  refError: "Tham chiếu lỗi",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "请输入合法的链接"
20
20
  },
21
21
  menu: { add: "添加链接" },
22
+ permission: { hyperLinkErr: "你没有权限插入链接。" },
22
23
  message: {
23
24
  noSheet: "该子表已被删除",
24
25
  refError: "错误的引用",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "請輸入合法的連結"
20
20
  },
21
21
  menu: { add: "新增連結" },
22
+ permission: { hyperLinkErr: "你沒有權限插入連結。" },
22
23
  message: {
23
24
  noSheet: "該子表已被刪除",
24
25
  refError: "錯誤的引用",
@@ -19,6 +19,7 @@ const locale = { "sheets-hyper-link-ui": {
19
19
  linkError: "請輸入合法的連結"
20
20
  },
21
21
  menu: { add: "新增連結" },
22
+ permission: { hyperLinkErr: "你沒有權限插入連結。" },
22
23
  message: {
23
24
  noSheet: "該子表已被刪除",
24
25
  refError: "錯誤的引用",
package/lib/es/index.js CHANGED
@@ -12,7 +12,7 @@ import { AddHyperLinkCommand, AddHyperLinkMutation, AddRichHyperLinkCommand, Can
12
12
  import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup, getMenuHiddenObservable, useDependency, useEvent, useObservable } from "@univerjs/ui";
13
13
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
14
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
- import { AllBorderIcon, CopyIcon, LinkIcon, UnlinkIcon, WriteIcon, XlsxMultiIcon } from "@univerjs/icons";
15
+ import { AllBorderIcon, CopyIcon, LinkIcon, SheetsMultiIcon, UnlinkIcon, WriteIcon } from "@univerjs/icons";
16
16
  import { SheetDataValidationModel } from "@univerjs/sheets-data-validation";
17
17
 
18
18
  //#region src/common/util.ts
@@ -778,7 +778,7 @@ CellLinkEdit.componentKey = "univer.sheet.cell-link-edit";
778
778
  //#region src/views/CellLinkPopup.tsx
779
779
  const iconsMap = {
780
780
  [SheetHyperLinkType.URL]: /* @__PURE__ */ jsx(LinkIcon, {}),
781
- [SheetHyperLinkType.SHEET]: /* @__PURE__ */ jsx(XlsxMultiIcon, { className: "univer-text-green-500" }),
781
+ [SheetHyperLinkType.SHEET]: /* @__PURE__ */ jsx(SheetsMultiIcon, { className: "univer-text-green-500" }),
782
782
  [SheetHyperLinkType.RANGE]: /* @__PURE__ */ jsx(AllBorderIcon, {}),
783
783
  [SheetHyperLinkType.DEFINE_NAME]: /* @__PURE__ */ jsx(AllBorderIcon, {}),
784
784
  [SheetHyperLinkType.INVALID]: /* @__PURE__ */ jsx(AllBorderIcon, {})
@@ -797,16 +797,16 @@ const CellLinkPopupPure = (props) => {
797
797
  const linkObj = parserHyperLinkService.parseHyperLink((_customRange$properti2 = customRange.properties.url) !== null && _customRange$properti2 !== void 0 ? _customRange$properti2 : "");
798
798
  const isError = linkObj.type === SheetHyperLinkType.INVALID;
799
799
  return /* @__PURE__ */ jsxs("div", {
800
- className: clsx("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900", borderClassName),
800
+ className: clsx("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-gap-2 univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-2 univer-shadow-md dark:!univer-bg-gray-900", borderClassName),
801
801
  onClick: () => popupService.hideCurrentPopup(),
802
802
  children: [/* @__PURE__ */ jsxs("div", {
803
- className: clsx("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": isError }),
803
+ className: clsx("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-gap-1 univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": isError }),
804
804
  onClick: () => {
805
805
  if (isError) return;
806
806
  resolverService.navigate(linkObj);
807
807
  },
808
808
  children: [/* @__PURE__ */ jsx("div", {
809
- className: "univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",
809
+ className: "univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",
810
810
  children: iconsMap[linkObj.type]
811
811
  }), /* @__PURE__ */ jsx(Tooltip, {
812
812
  showIfEllipsis: true,
@@ -818,9 +818,9 @@ const CellLinkPopupPure = (props) => {
818
818
  })
819
819
  })]
820
820
  }), /* @__PURE__ */ jsxs("div", {
821
- className: "univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center",
821
+ className: "univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center univer-gap-2",
822
822
  children: [copyPermission && /* @__PURE__ */ jsx("div", {
823
- className: clsx("univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-text-red-500": isError }),
823
+ className: clsx("univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-text-red-500": isError }),
824
824
  onClick: () => {
825
825
  if (isError) return;
826
826
  if (linkObj.type !== SheetHyperLinkType.URL) {
@@ -839,7 +839,8 @@ const CellLinkPopupPure = (props) => {
839
839
  children: /* @__PURE__ */ jsx(CopyIcon, { className: "dark:!univer-text-white" })
840
840
  })
841
841
  }), editPermission && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
842
- className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
842
+ "data-u-comp": "cell-link-popup-edit",
843
+ className: "univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
843
844
  onClick: () => {
844
845
  commandService.executeCommand(OpenHyperLinkEditPanelOperation.id, {
845
846
  unitId,
@@ -856,7 +857,8 @@ const CellLinkPopupPure = (props) => {
856
857
  children: /* @__PURE__ */ jsx(WriteIcon, { className: "dark:!univer-text-white" })
857
858
  })
858
859
  }), /* @__PURE__ */ jsx("div", {
859
- className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
860
+ "data-u-comp": "cell-link-popup-remove",
861
+ className: "univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
860
862
  onClick: () => {
861
863
  const commandId = type === "editing" ? CancelRichHyperLinkCommand.id : CancelHyperLinkCommand.id;
862
864
  if (commandService.syncExecuteCommand(commandId, {
@@ -1173,13 +1175,14 @@ const getShouldDisableCurrentCellLink = (accessor) => {
1173
1175
  return getShouldDisableCellLink(accessor, worksheet, row, col) === 1;
1174
1176
  };
1175
1177
  const shouldDisableAddLink = (accessor) => {
1178
+ var _doc$getSelfOrHeaderF;
1176
1179
  const textSelectionService = accessor.get(DocSelectionManagerService);
1177
1180
  const univerInstanceService = accessor.get(IUniverInstanceService);
1178
1181
  const textRanges = textSelectionService.getTextRanges();
1179
1182
  if (!(textRanges === null || textRanges === void 0 ? void 0 : textRanges.length)) return true;
1180
1183
  const doc = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
1181
1184
  if (!doc || textRanges.every((range) => range.collapsed)) return true;
1182
- if (!doc.getSelfOrHeaderFooterModel(textRanges[0].segmentId).getBody()) return true;
1185
+ if (!((_doc$getSelfOrHeaderF = doc.getSelfOrHeaderFooterModel(textRanges[0].segmentId)) === null || _doc$getSelfOrHeaderF === void 0 ? void 0 : _doc$getSelfOrHeaderF.getBody())) return true;
1183
1186
  return false;
1184
1187
  };
1185
1188
 
@@ -1526,7 +1529,7 @@ const InsertLinkShortcut = {
1526
1529
  //#endregion
1527
1530
  //#region package.json
1528
1531
  var name = "@univerjs/sheets-hyper-link-ui";
1529
- var version = "1.0.0-alpha.0";
1532
+ var version = "1.0.0-alpha.2";
1530
1533
 
1531
1534
  //#endregion
1532
1535
  //#region src/controllers/auto-fill.controller.ts
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "الرجاء إدخال رابط صالح"
19
19
  },
20
20
  menu: { add: "إدراج ارتباط تشعبي" },
21
+ permission: { hyperLinkErr: "ليس لديك إذن لإدراج رابط." },
21
22
  message: {
22
23
  noSheet: "تم حذف الورقة المستهدفة",
23
24
  refError: "نطاق غير صالح",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Si us plau, introdueix un enllaç vàlid"
19
19
  },
20
20
  menu: { add: "Insereix enllaç" },
21
+ permission: { hyperLinkErr: "No teniu permís per inserir un enllaç." },
21
22
  message: {
22
23
  noSheet: "El full de destinació ha estat eliminat",
23
24
  refError: "Interval no vàlid",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Bitte einen gültigen Link eingeben"
19
19
  },
20
20
  menu: { add: "Link einfügen" },
21
+ permission: { hyperLinkErr: "Sie haben keine Berechtigung, einen Link einzufügen." },
21
22
  message: {
22
23
  noSheet: "Zielblatt wurde gelöscht",
23
24
  refError: "Ungültiger Bereich",
@@ -33,6 +33,7 @@ const locale = { "sheets-hyper-link-ui": {
33
33
  linkError: "Please enter a legal link"
34
34
  },
35
35
  menu: { add: "Insert Link" },
36
+ permission: { hyperLinkErr: "You do not have permission to insert a link." },
36
37
  message: {
37
38
  noSheet: "Target sheet has been delete",
38
39
  refError: "Invalid Range",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Por favor, introduce un enlace válido"
19
19
  },
20
20
  menu: { add: "Insertar enlace" },
21
+ permission: { hyperLinkErr: "No tiene permiso para insertar un enlace." },
21
22
  message: {
22
23
  noSheet: "La hoja de destino ha sido eliminada",
23
24
  refError: "Rango no válido",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "لطفا یک لینک معتبر وارد کنید"
19
19
  },
20
20
  menu: { add: "درج لینک" },
21
+ permission: { hyperLinkErr: "شما مجوز درج لینک را ندارید." },
21
22
  message: {
22
23
  noSheet: "برگ هدف حذف شده است",
23
24
  refError: "محدوده نامعتبر",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Veuillez entrer un lien valide"
19
19
  },
20
20
  menu: { add: "Insérer un lien" },
21
+ permission: { hyperLinkErr: "Vous n’avez pas l’autorisation d’insérer un lien." },
21
22
  message: {
22
23
  noSheet: "La feuille cible a été supprimée",
23
24
  refError: "Plage invalide",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Silakan masukkan tautan yang valid"
19
19
  },
20
20
  menu: { add: "Sisipkan Tautan" },
21
+ permission: { hyperLinkErr: "Anda tidak memiliki izin untuk menyisipkan tautan." },
21
22
  message: {
22
23
  noSheet: "Lembar target telah dihapus",
23
24
  refError: "Rentang Tidak Valid",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Inserisci un collegamento valido"
19
19
  },
20
20
  menu: { add: "Inserisci collegamento" },
21
+ permission: { hyperLinkErr: "Non hai l’autorizzazione per inserire un collegamento." },
21
22
  message: {
22
23
  noSheet: "Il foglio di destinazione è stato eliminato",
23
24
  refError: "Intervallo non valido",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "有効なリンクを入力してください"
19
19
  },
20
20
  menu: { add: "リンクの挿入" },
21
+ permission: { hyperLinkErr: "リンクを挿入する権限がありません。" },
21
22
  message: {
22
23
  noSheet: "対象のワークシートが削除されました",
23
24
  refError: "無効な範囲です",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "유효한 링크를 입력하세요"
19
19
  },
20
20
  menu: { add: "링크 삽입" },
21
+ permission: { hyperLinkErr: "링크를 삽입할 권한이 없습니다." },
21
22
  message: {
22
23
  noSheet: "대상 워크시트가 삭제되었습니다",
23
24
  refError: "잘못된 범위입니다",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Wprowadź prawidłowe łącze"
19
19
  },
20
20
  menu: { add: "Wstaw łącze" },
21
+ permission: { hyperLinkErr: "Nie masz uprawnień do wstawiania łącza." },
21
22
  message: {
22
23
  noSheet: "Arkusz docelowy został usunięty",
23
24
  refError: "Nieprawidłowy zakres",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Por favor, digite um link válido"
19
19
  },
20
20
  menu: { add: "Inserir Link" },
21
+ permission: { hyperLinkErr: "Você não tem permissão para inserir um link." },
21
22
  message: {
22
23
  noSheet: "A planilha de destino foi excluída",
23
24
  refError: "Intervalo Inválido",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Пожалуйста, введите корректную ссылку"
19
19
  },
20
20
  menu: { add: "Вставить ссылку" },
21
+ permission: { hyperLinkErr: "У вас нет разрешения на вставку ссылки." },
21
22
  message: {
22
23
  noSheet: "Целевой лист был удален",
23
24
  refError: "Недопустимый диапазон",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Zadajte platný odkaz"
19
19
  },
20
20
  menu: { add: "Vložiť odkaz" },
21
+ permission: { hyperLinkErr: "Nemáte povolenie vložiť odkaz." },
21
22
  message: {
22
23
  noSheet: "Cieľový hárok bol odstránený",
23
24
  refError: "Neplatný rozsah",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "Vui lòng nhập liên kết hợp lệ"
19
19
  },
20
20
  menu: { add: "Thêm liên kết" },
21
+ permission: { hyperLinkErr: "Bạn không có quyền chèn liên kết." },
21
22
  message: {
22
23
  noSheet: "Bảng con này đã bị xóa",
23
24
  refError: "Tham chiếu lỗi",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "请输入合法的链接"
19
19
  },
20
20
  menu: { add: "添加链接" },
21
+ permission: { hyperLinkErr: "你没有权限插入链接。" },
21
22
  message: {
22
23
  noSheet: "该子表已被删除",
23
24
  refError: "错误的引用",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "請輸入合法的連結"
19
19
  },
20
20
  menu: { add: "新增連結" },
21
+ permission: { hyperLinkErr: "你沒有權限插入連結。" },
21
22
  message: {
22
23
  noSheet: "該子表已被刪除",
23
24
  refError: "錯誤的引用",
@@ -18,6 +18,7 @@ const locale = { "sheets-hyper-link-ui": {
18
18
  linkError: "請輸入合法的連結"
19
19
  },
20
20
  menu: { add: "新增連結" },
21
+ permission: { hyperLinkErr: "你沒有權限插入連結。" },
21
22
  message: {
22
23
  noSheet: "該子表已被刪除",
23
24
  refError: "錯誤的引用",
package/lib/index.css CHANGED
@@ -2,14 +2,6 @@
2
2
  margin-bottom: .25rem;
3
3
  }
4
4
 
5
- .univer-ml-2 {
6
- margin-left: .5rem;
7
- }
8
-
9
- .univer-mr-2 {
10
- margin-right: .5rem;
11
- }
12
-
13
5
  .univer-box-border {
14
6
  box-sizing: border-box;
15
7
  }
@@ -76,6 +68,10 @@
76
68
  justify-content: space-between;
77
69
  }
78
70
 
71
+ .univer-gap-1 {
72
+ gap: .25rem;
73
+ }
74
+
79
75
  .univer-gap-2 {
80
76
  gap: .5rem;
81
77
  }
@@ -106,8 +102,8 @@
106
102
  background-color: var(--univer-white);
107
103
  }
108
104
 
109
- .univer-p-3 {
110
- padding: .75rem;
105
+ .univer-p-2 {
106
+ padding: .5rem;
111
107
  }
112
108
 
113
109
  .univer-p-4 {