@univerjs/docs-hyper-link-ui 1.0.0-alpha.6 → 1.0.0-alpha.8
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/lib/cjs/index.js +8 -8
- package/lib/cjs/locale/fr-FR.js +7 -7
- package/lib/es/index.js +12 -12
- package/lib/es/locale/fr-FR.js +7 -7
- package/lib/index.js +12 -12
- package/lib/locale/fr-FR.js +7 -7
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/package.json +11 -11
package/lib/cjs/index.js
CHANGED
|
@@ -316,7 +316,7 @@ const DocLinkPopup = () => {
|
|
|
316
316
|
DocLinkPopup.componentKey = "univer.doc.link-info-popup";
|
|
317
317
|
|
|
318
318
|
//#endregion
|
|
319
|
-
//#region \0@oxc-project+runtime@0.
|
|
319
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
320
320
|
function _typeof(o) {
|
|
321
321
|
"@babel/helpers - typeof";
|
|
322
322
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -327,7 +327,7 @@ function _typeof(o) {
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
//#endregion
|
|
330
|
-
//#region \0@oxc-project+runtime@0.
|
|
330
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
331
331
|
function toPrimitive(t, r) {
|
|
332
332
|
if ("object" != _typeof(t) || !t) return t;
|
|
333
333
|
var e = t[Symbol.toPrimitive];
|
|
@@ -340,14 +340,14 @@ function toPrimitive(t, r) {
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
//#endregion
|
|
343
|
-
//#region \0@oxc-project+runtime@0.
|
|
343
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
344
344
|
function toPropertyKey(t) {
|
|
345
345
|
var i = toPrimitive(t, "string");
|
|
346
346
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
//#endregion
|
|
350
|
-
//#region \0@oxc-project+runtime@0.
|
|
350
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
351
351
|
function _defineProperty(e, r, t) {
|
|
352
352
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
353
353
|
value: t,
|
|
@@ -358,7 +358,7 @@ function _defineProperty(e, r, t) {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
//#endregion
|
|
361
|
-
//#region \0@oxc-project+runtime@0.
|
|
361
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
362
362
|
function __decorateParam(paramIndex, decorator) {
|
|
363
363
|
return function(target, key) {
|
|
364
364
|
decorator(target, key, paramIndex);
|
|
@@ -366,7 +366,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
//#endregion
|
|
369
|
-
//#region \0@oxc-project+runtime@0.
|
|
369
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
370
370
|
function __decorate(decorators, target, key, desc) {
|
|
371
371
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
372
372
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -589,7 +589,7 @@ const menuSchema = {
|
|
|
589
589
|
//#endregion
|
|
590
590
|
//#region package.json
|
|
591
591
|
var name = "@univerjs/docs-hyper-link-ui";
|
|
592
|
-
var version = "1.0.0-alpha.
|
|
592
|
+
var version = "1.0.0-alpha.8";
|
|
593
593
|
|
|
594
594
|
//#endregion
|
|
595
595
|
//#region src/config/config.ts
|
|
@@ -888,7 +888,7 @@ _defineProperty(UniverDocsHyperLinkUIPlugin, "packageName", name);
|
|
|
888
888
|
_defineProperty(UniverDocsHyperLinkUIPlugin, "version", version);
|
|
889
889
|
_defineProperty(UniverDocsHyperLinkUIPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
890
890
|
UniverDocsHyperLinkUIPlugin = __decorate([
|
|
891
|
-
(0, _univerjs_core.DependentOn)(_univerjs_docs_hyper_link.UniverDocsHyperLinkPlugin),
|
|
891
|
+
(0, _univerjs_core.DependentOn)(_univerjs_docs.UniverDocsPlugin, _univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_docs_hyper_link.UniverDocsHyperLinkPlugin, _univerjs_ui.UniverUIPlugin, _univerjs_docs_ui.UniverDocsUIPlugin),
|
|
892
892
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
893
893
|
__decorateParam(2, _univerjs_engine_render.IRenderManagerService),
|
|
894
894
|
__decorateParam(3, _univerjs_core.IConfigService)
|
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -5,19 +5,19 @@ const locale = { "docs-hyper-link-ui": {
|
|
|
5
5
|
confirm: "Confirmer",
|
|
6
6
|
cancel: "Annuler",
|
|
7
7
|
title: "Lien",
|
|
8
|
-
address: "
|
|
8
|
+
address: "Lien",
|
|
9
9
|
placeholder: "Veuillez entrer un lien",
|
|
10
10
|
addressError: "L'url est illégal!",
|
|
11
|
-
label: "
|
|
11
|
+
label: "Libellé",
|
|
12
12
|
labelError: "Veuillez entrer le label du lien"
|
|
13
13
|
},
|
|
14
14
|
info: {
|
|
15
|
-
copy: "
|
|
16
|
-
edit: "
|
|
17
|
-
cancel: "
|
|
18
|
-
coped: "
|
|
15
|
+
copy: "Copier",
|
|
16
|
+
edit: "Modifier",
|
|
17
|
+
cancel: "Supprimer le lien",
|
|
18
|
+
coped: "Lien copié dans le presse-papiers"
|
|
19
19
|
},
|
|
20
|
-
menu: { tooltip: "
|
|
20
|
+
menu: { tooltip: "Ajouter un lien" }
|
|
21
21
|
} };
|
|
22
22
|
|
|
23
23
|
//#endregion
|
package/lib/es/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { DocCanvasPopManagerService, DocEventManagerService, DocRenderController, EMPTY_PARAGRAPH_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, INSERT_BELLOW_MENU_ID, whenDocAndEditorFocused } from "@univerjs/docs-ui";
|
|
2
|
-
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
1
|
+
import { DocCanvasPopManagerService, DocEventManagerService, DocRenderController, EMPTY_PARAGRAPH_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, INSERT_BELLOW_MENU_ID, UniverDocsUIPlugin, whenDocAndEditorFocused } from "@univerjs/docs-ui";
|
|
2
|
+
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup, UniverUIPlugin, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
3
3
|
import { BuildTextUtils, CommandType, CustomRangeType, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DependentOn, Disposable, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, Tools, UniverInstanceType, generateRandomId, getBodySlice, isSafeUrl, merge } from "@univerjs/core";
|
|
4
|
-
import { DOC_INTERCEPTOR_POINT, DocInterceptorService, DocSelectionManagerService, DocSkeletonManagerService, SetTextSelectionsOperation, addCustomRangeBySelectionFactory, deleteCustomRangeFactory, replaceSelectionFactory } from "@univerjs/docs";
|
|
4
|
+
import { DOC_INTERCEPTOR_POINT, DocInterceptorService, DocSelectionManagerService, DocSkeletonManagerService, SetTextSelectionsOperation, UniverDocsPlugin, addCustomRangeBySelectionFactory, deleteCustomRangeFactory, replaceSelectionFactory } from "@univerjs/docs";
|
|
5
5
|
import { BehaviorSubject, Observable, debounceTime, distinctUntilChanged, pairwise } from "rxjs";
|
|
6
6
|
import { Button, FormLayout, Input, MessageType, Tooltip, borderClassName, clsx } from "@univerjs/design";
|
|
7
7
|
import { useEffect, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { CopyIcon, LinkIcon, UnlinkIcon, WriteIcon } from "@univerjs/icons";
|
|
10
10
|
import { UniverDocsHyperLinkPlugin } from "@univerjs/docs-hyper-link";
|
|
11
|
-
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
11
|
+
import { IRenderManagerService, UniverRenderEnginePlugin } from "@univerjs/engine-render";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/commands/add-link.command.ts
|
|
14
14
|
const AddDocHyperLinkCommand = {
|
|
@@ -315,7 +315,7 @@ const DocLinkPopup = () => {
|
|
|
315
315
|
DocLinkPopup.componentKey = "univer.doc.link-info-popup";
|
|
316
316
|
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region \0@oxc-project+runtime@0.
|
|
318
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
319
319
|
function _typeof(o) {
|
|
320
320
|
"@babel/helpers - typeof";
|
|
321
321
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -326,7 +326,7 @@ function _typeof(o) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
//#endregion
|
|
329
|
-
//#region \0@oxc-project+runtime@0.
|
|
329
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
330
330
|
function toPrimitive(t, r) {
|
|
331
331
|
if ("object" != _typeof(t) || !t) return t;
|
|
332
332
|
var e = t[Symbol.toPrimitive];
|
|
@@ -339,14 +339,14 @@ function toPrimitive(t, r) {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
//#endregion
|
|
342
|
-
//#region \0@oxc-project+runtime@0.
|
|
342
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
343
343
|
function toPropertyKey(t) {
|
|
344
344
|
var i = toPrimitive(t, "string");
|
|
345
345
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
//#endregion
|
|
349
|
-
//#region \0@oxc-project+runtime@0.
|
|
349
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
350
350
|
function _defineProperty(e, r, t) {
|
|
351
351
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
352
352
|
value: t,
|
|
@@ -357,7 +357,7 @@ function _defineProperty(e, r, t) {
|
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
//#endregion
|
|
360
|
-
//#region \0@oxc-project+runtime@0.
|
|
360
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
361
361
|
function __decorateParam(paramIndex, decorator) {
|
|
362
362
|
return function(target, key) {
|
|
363
363
|
decorator(target, key, paramIndex);
|
|
@@ -365,7 +365,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
//#endregion
|
|
368
|
-
//#region \0@oxc-project+runtime@0.
|
|
368
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
369
369
|
function __decorate(decorators, target, key, desc) {
|
|
370
370
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
371
371
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -588,7 +588,7 @@ const menuSchema = {
|
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region package.json
|
|
590
590
|
var name = "@univerjs/docs-hyper-link-ui";
|
|
591
|
-
var version = "1.0.0-alpha.
|
|
591
|
+
var version = "1.0.0-alpha.8";
|
|
592
592
|
|
|
593
593
|
//#endregion
|
|
594
594
|
//#region src/config/config.ts
|
|
@@ -887,7 +887,7 @@ _defineProperty(UniverDocsHyperLinkUIPlugin, "packageName", name);
|
|
|
887
887
|
_defineProperty(UniverDocsHyperLinkUIPlugin, "version", version);
|
|
888
888
|
_defineProperty(UniverDocsHyperLinkUIPlugin, "type", UniverInstanceType.UNIVER_DOC);
|
|
889
889
|
UniverDocsHyperLinkUIPlugin = __decorate([
|
|
890
|
-
DependentOn(UniverDocsHyperLinkPlugin),
|
|
890
|
+
DependentOn(UniverDocsPlugin, UniverRenderEnginePlugin, UniverDocsHyperLinkPlugin, UniverUIPlugin, UniverDocsUIPlugin),
|
|
891
891
|
__decorateParam(1, Inject(Injector)),
|
|
892
892
|
__decorateParam(2, IRenderManagerService),
|
|
893
893
|
__decorateParam(3, IConfigService)
|
package/lib/es/locale/fr-FR.js
CHANGED
|
@@ -4,19 +4,19 @@ const locale = { "docs-hyper-link-ui": {
|
|
|
4
4
|
confirm: "Confirmer",
|
|
5
5
|
cancel: "Annuler",
|
|
6
6
|
title: "Lien",
|
|
7
|
-
address: "
|
|
7
|
+
address: "Lien",
|
|
8
8
|
placeholder: "Veuillez entrer un lien",
|
|
9
9
|
addressError: "L'url est illégal!",
|
|
10
|
-
label: "
|
|
10
|
+
label: "Libellé",
|
|
11
11
|
labelError: "Veuillez entrer le label du lien"
|
|
12
12
|
},
|
|
13
13
|
info: {
|
|
14
|
-
copy: "
|
|
15
|
-
edit: "
|
|
16
|
-
cancel: "
|
|
17
|
-
coped: "
|
|
14
|
+
copy: "Copier",
|
|
15
|
+
edit: "Modifier",
|
|
16
|
+
cancel: "Supprimer le lien",
|
|
17
|
+
coped: "Lien copié dans le presse-papiers"
|
|
18
18
|
},
|
|
19
|
-
menu: { tooltip: "
|
|
19
|
+
menu: { tooltip: "Ajouter un lien" }
|
|
20
20
|
} };
|
|
21
21
|
|
|
22
22
|
//#endregion
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { DocCanvasPopManagerService, DocEventManagerService, DocRenderController, EMPTY_PARAGRAPH_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, INSERT_BELLOW_MENU_ID, whenDocAndEditorFocused } from "@univerjs/docs-ui";
|
|
2
|
-
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
1
|
+
import { DocCanvasPopManagerService, DocEventManagerService, DocRenderController, EMPTY_PARAGRAPH_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, INSERT_BELLOW_MENU_ID, UniverDocsUIPlugin, whenDocAndEditorFocused } from "@univerjs/docs-ui";
|
|
2
|
+
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup, UniverUIPlugin, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
3
3
|
import { BuildTextUtils, CommandType, CustomRangeType, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DependentOn, Disposable, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, Tools, UniverInstanceType, generateRandomId, getBodySlice, isSafeUrl, merge } from "@univerjs/core";
|
|
4
|
-
import { DOC_INTERCEPTOR_POINT, DocInterceptorService, DocSelectionManagerService, DocSkeletonManagerService, SetTextSelectionsOperation, addCustomRangeBySelectionFactory, deleteCustomRangeFactory, replaceSelectionFactory } from "@univerjs/docs";
|
|
4
|
+
import { DOC_INTERCEPTOR_POINT, DocInterceptorService, DocSelectionManagerService, DocSkeletonManagerService, SetTextSelectionsOperation, UniverDocsPlugin, addCustomRangeBySelectionFactory, deleteCustomRangeFactory, replaceSelectionFactory } from "@univerjs/docs";
|
|
5
5
|
import { BehaviorSubject, Observable, debounceTime, distinctUntilChanged, pairwise } from "rxjs";
|
|
6
6
|
import { Button, FormLayout, Input, MessageType, Tooltip, borderClassName, clsx } from "@univerjs/design";
|
|
7
7
|
import { useEffect, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { CopyIcon, LinkIcon, UnlinkIcon, WriteIcon } from "@univerjs/icons";
|
|
10
10
|
import { UniverDocsHyperLinkPlugin } from "@univerjs/docs-hyper-link";
|
|
11
|
-
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
11
|
+
import { IRenderManagerService, UniverRenderEnginePlugin } from "@univerjs/engine-render";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/commands/add-link.command.ts
|
|
14
14
|
const AddDocHyperLinkCommand = {
|
|
@@ -315,7 +315,7 @@ const DocLinkPopup = () => {
|
|
|
315
315
|
DocLinkPopup.componentKey = "univer.doc.link-info-popup";
|
|
316
316
|
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region \0@oxc-project+runtime@0.
|
|
318
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
319
319
|
function _typeof(o) {
|
|
320
320
|
"@babel/helpers - typeof";
|
|
321
321
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -326,7 +326,7 @@ function _typeof(o) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
//#endregion
|
|
329
|
-
//#region \0@oxc-project+runtime@0.
|
|
329
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
330
330
|
function toPrimitive(t, r) {
|
|
331
331
|
if ("object" != _typeof(t) || !t) return t;
|
|
332
332
|
var e = t[Symbol.toPrimitive];
|
|
@@ -339,14 +339,14 @@ function toPrimitive(t, r) {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
//#endregion
|
|
342
|
-
//#region \0@oxc-project+runtime@0.
|
|
342
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
343
343
|
function toPropertyKey(t) {
|
|
344
344
|
var i = toPrimitive(t, "string");
|
|
345
345
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
//#endregion
|
|
349
|
-
//#region \0@oxc-project+runtime@0.
|
|
349
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
350
350
|
function _defineProperty(e, r, t) {
|
|
351
351
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
352
352
|
value: t,
|
|
@@ -357,7 +357,7 @@ function _defineProperty(e, r, t) {
|
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
//#endregion
|
|
360
|
-
//#region \0@oxc-project+runtime@0.
|
|
360
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
361
361
|
function __decorateParam(paramIndex, decorator) {
|
|
362
362
|
return function(target, key) {
|
|
363
363
|
decorator(target, key, paramIndex);
|
|
@@ -365,7 +365,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
//#endregion
|
|
368
|
-
//#region \0@oxc-project+runtime@0.
|
|
368
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
369
369
|
function __decorate(decorators, target, key, desc) {
|
|
370
370
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
371
371
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -588,7 +588,7 @@ const menuSchema = {
|
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region package.json
|
|
590
590
|
var name = "@univerjs/docs-hyper-link-ui";
|
|
591
|
-
var version = "1.0.0-alpha.
|
|
591
|
+
var version = "1.0.0-alpha.8";
|
|
592
592
|
|
|
593
593
|
//#endregion
|
|
594
594
|
//#region src/config/config.ts
|
|
@@ -887,7 +887,7 @@ _defineProperty(UniverDocsHyperLinkUIPlugin, "packageName", name);
|
|
|
887
887
|
_defineProperty(UniverDocsHyperLinkUIPlugin, "version", version);
|
|
888
888
|
_defineProperty(UniverDocsHyperLinkUIPlugin, "type", UniverInstanceType.UNIVER_DOC);
|
|
889
889
|
UniverDocsHyperLinkUIPlugin = __decorate([
|
|
890
|
-
DependentOn(UniverDocsHyperLinkPlugin),
|
|
890
|
+
DependentOn(UniverDocsPlugin, UniverRenderEnginePlugin, UniverDocsHyperLinkPlugin, UniverUIPlugin, UniverDocsUIPlugin),
|
|
891
891
|
__decorateParam(1, Inject(Injector)),
|
|
892
892
|
__decorateParam(2, IRenderManagerService),
|
|
893
893
|
__decorateParam(3, IConfigService)
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -4,19 +4,19 @@ const locale = { "docs-hyper-link-ui": {
|
|
|
4
4
|
confirm: "Confirmer",
|
|
5
5
|
cancel: "Annuler",
|
|
6
6
|
title: "Lien",
|
|
7
|
-
address: "
|
|
7
|
+
address: "Lien",
|
|
8
8
|
placeholder: "Veuillez entrer un lien",
|
|
9
9
|
addressError: "L'url est illégal!",
|
|
10
|
-
label: "
|
|
10
|
+
label: "Libellé",
|
|
11
11
|
labelError: "Veuillez entrer le label du lien"
|
|
12
12
|
},
|
|
13
13
|
info: {
|
|
14
|
-
copy: "
|
|
15
|
-
edit: "
|
|
16
|
-
cancel: "
|
|
17
|
-
coped: "
|
|
14
|
+
copy: "Copier",
|
|
15
|
+
edit: "Modifier",
|
|
16
|
+
cancel: "Supprimer le lien",
|
|
17
|
+
coped: "Lien copié dans le presse-papiers"
|
|
18
18
|
},
|
|
19
|
-
menu: { tooltip: "
|
|
19
|
+
menu: { tooltip: "Ajouter un lien" }
|
|
20
20
|
} };
|
|
21
21
|
|
|
22
22
|
//#endregion
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/docs-ui"),require("@univerjs/ui"),require("@univerjs/core"),require("@univerjs/docs"),require("rxjs"),require("@univerjs/design"),require("react"),require("react/jsx-runtime"),require("@univerjs/docs-hyper-link"),require("@univerjs/engine-render")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/docs-ui`,`@univerjs/ui`,`@univerjs/core`,`@univerjs/docs`,`rxjs`,`@univerjs/design`,`react`,`react/jsx-runtime`,`@univerjs/docs-hyper-link`,`@univerjs/engine-render`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsHyperLinkUi={},e.UniverDocsUi,e.UniverUi,e.UniverCore,e.UniverDocs,e.rxjs,e.UniverDesign,e.React,e.React,e.UniverDocsHyperLink,e.UniverEngineRender))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let d={type:r.CommandType.COMMAND,id:`docs.command.add-hyper-link`,async handler(e,t){if(!t)return!1;let{payload:n,unitId:a,selections:o}=t,s=e.get(r.ICommandService),c=(0,i.addCustomRangeBySelectionFactory)(e,{rangeId:(0,r.generateRandomId)(),rangeType:r.CustomRangeType.HYPERLINK,properties:{url:n},unitId:a,selections:o});return c?s.syncExecuteCommand(c.id,c.params):!1}},f={id:`docs.command.update-hyper-link`,type:r.CommandType.COMMAND,handler(e,t){var n,a;if(!t)return!1;let{unitId:o,payload:s,segmentId:c,linkId:l}=t,u=e.get(r.ICommandService),d=e.get(r.IUniverInstanceService),f=e.get(i.DocSelectionManagerService).getActiveTextRange(),p=d.getUnit(o,r.UniverInstanceType.UNIVER_DOC);if(!f||!p)return!1;let m=(n=p.getSelfOrHeaderFooterModel(c))==null?void 0:n.getBody();if(!m)return!1;let h=(a=(0,r.getBodySlice)(m,f.startOffset,f.endOffset).textRuns)==null?void 0:a[0];h&&(h.ed=t.label.length+1);let g=(0,i.replaceSelectionFactory)(e,{unitId:o,body:{dataStream:`${t.label}`,customRanges:[{rangeId:l,rangeType:r.CustomRangeType.HYPERLINK,startIndex:0,endIndex:t.label.length+1,properties:{url:s}}],textRuns:h?[h]:void 0},selection:{startOffset:f.startOffset,endOffset:f.endOffset,collapsed:!1,segmentId:c}});return g?u.syncExecuteCommand(g.id,g.params):!1}};function p(e){return e.trim().length===0}function m(e){return/^[a-zA-Z]+:\/\//.test(e)}function h(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function g(e){return m(e)?e:h(e)?`mailto://${e}`:`https://${e}`}let _=()=>{let e=(0,n.useDependency)(L),t=(0,n.useDependency)(r.LocaleService),a=(0,n.useObservable)(e.editingLink$),l=(0,n.useDependency)(r.ICommandService),u=(0,n.useDependency)(r.IUniverInstanceService),m=(0,n.useDependency)(i.DocSelectionManagerService),[h,_]=(0,s.useState)(``),[v,y]=(0,s.useState)(``),[b,x]=(0,s.useState)(!1),S=r.Tools.isLegalUrl(h),C=a?u.getUnit(a.unitId,r.UniverInstanceType.UNIVER_DOC):u.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_DOC);(0,s.useEffect)(()=>{var e,t,n;let i=m.getActiveTextRange();if(!i)return;if(a){var o,s;let e=C==null||(o=C.getSelfOrHeaderFooterModel(a.segmentId))==null?void 0:o.getBody(),t=e==null||(s=e.customRanges)==null?void 0:s.find(e=>(a==null?void 0:a.linkId)===e.rangeId&&e.startIndex===a.startIndex&&e.endIndex===a.endIndex);if(C&&t){var c,l;_((c=(l=t.properties)==null?void 0:l.url)==null?``:c),y(r.BuildTextUtils.transform.getPlainText((0,r.getBodySlice)(e,t.startIndex,t.endIndex+1).dataStream))}return}let u=C==null||(e=C.getSelfOrHeaderFooterModel(i.segmentId))==null?void 0:e.getBody(),d=u?i:null,f=d&&((t=r.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(d,(n=u==null?void 0:u.customRanges)==null?[]:n))==null?void 0:t[0]);if(C&&f){var p,h;_((p=f==null||(h=f.properties)==null?void 0:h.url)==null?``:p)}},[C,a,m,u]);let w=()=>{e.hideEditPopup()},T=()=>{if(x(!0),!S||!C)return;let t=g(h);if(!a)l.executeCommand(d.id,{unitId:C.getUnitId(),payload:t});else{if(p(v))return;l.executeCommand(f.id,{unitId:C.getUnitId(),payload:t,linkId:a.linkId,label:v,segmentId:a.segmentId})}e.hideEditPopup()};if(C)return(0,c.jsxs)(`div`,{className:(0,o.clsx)(`univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow dark:!univer-bg-gray-900`,o.borderClassName),children:[(0,c.jsxs)(`div`,{children:[a?(0,c.jsx)(o.FormLayout,{label:t.t(`docs-hyper-link-ui.edit.label`),error:b&&p(v)?t.t(`docs-hyper-link-ui.edit.labelError`):``,children:(0,c.jsx)(o.Input,{value:v,onChange:y,autoFocus:!0,onKeyDown:e=>{e.keyCode===n.KeyCode.ENTER&&T()}})}):null,(0,c.jsx)(o.FormLayout,{label:t.t(`docs-hyper-link-ui.edit.address`),error:b&&!S?t.t(`docs-hyper-link-ui.edit.addressError`):``,children:(0,c.jsx)(o.Input,{value:h,onChange:_,autoFocus:!0,onKeyDown:e=>{e.keyCode===n.KeyCode.ENTER&&T()}})})]}),(0,c.jsxs)(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[(0,c.jsx)(o.Button,{onClick:w,children:t.t(`docs-hyper-link-ui.edit.cancel`)}),(0,c.jsx)(o.Button,{variant:`primary`,disabled:p(h),onClick:T,children:t.t(`docs-hyper-link-ui.edit.confirm`)})]})]})};_.componentKey=`docs-hyper-link-edit`;function v({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,c=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),l=(0,s.useRef)(`_${S()}`);return y(n,`${r}`,{defIds:n.defIds,idSuffix:l.current},{ref:e,className:c,...o},a)}function y(e,t,n,r,i){return(0,s.createElement)(e.tag,{key:t,...b(e,n,i),...r},(x(e,n).children||[]).map((r,a)=>y(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function b(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function x(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function S(){return Math.random().toString(36).substring(2,8)}v.displayName=`UniverIcon`;let C={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},w=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`copy-icon`,ref:t,icon:C}))});w.displayName=`CopyIcon`;let T={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z`}}]},E=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`link-icon`,ref:t,icon:T}))});E.displayName=`LinkIcon`;let ee={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z`}}]},D=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`unlink-icon`,ref:t,icon:ee}))});D.displayName=`UnlinkIcon`;let O={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},k=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`write-icon`,ref:t,icon:O}))});k.displayName=`WriteIcon`;let A={type:r.CommandType.COMMAND,id:`docs.command.delete-hyper-link`,async handler(e,t){if(!t)return!1;let{unitId:n,linkId:a,segmentId:o}=t,s=e.get(r.ICommandService),c=(0,i.deleteCustomRangeFactory)(e,{unitId:n,rangeId:a,segmentId:o});return c?await s.syncExecuteCommand(c.id,c.params):!1}},j=()=>{var e,t,i;let a=(0,n.useDependency)(L),s=(0,n.useDependency)(r.ICommandService),l=(0,n.useDependency)(n.IMessageService),u=(0,n.useDependency)(r.LocaleService),d=(0,n.useObservable)(a.showingLink$),f=(0,n.useDependency)(r.IUniverInstanceService);if(!d)return null;let{unitId:p,linkId:m,segmentId:h,startIndex:g,endIndex:_}=d,v=f.getUnit(p,r.UniverInstanceType.UNIVER_DOC),y=v==null||(e=v.getSelfOrHeaderFooterModel(h))==null?void 0:e.getBody(),b=y==null||(t=y.customRanges)==null?void 0:t.find(e=>e.rangeId===m&&e.rangeType===r.CustomRangeType.HYPERLINK&&e.startIndex===g&&e.endIndex===_);if(!b)return null;let x=(i=b.properties)==null?void 0:i.url;return(0,c.jsxs)(`div`,{className:(0,o.clsx)(`univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow dark:!univer-bg-gray-900`,o.borderClassName),onClick:()=>{a.hideInfoPopup()},children:[(0,c.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-500`,onClick:()=>window.open(x,void 0,`noopener noreferrer`),children:[(0,c.jsx)(`div`,{className:`univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white`,children:(0,c.jsx)(E,{})}),(0,c.jsx)(o.Tooltip,{showIfEllipsis:!0,title:x,children:(0,c.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:x})})]}),(0,c.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center`,children:[(0,c.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{navigator.clipboard.writeText(x),l.show({content:u.t(`docs-hyper-link-ui.info.coped`),type:o.MessageType.Info})},children:(0,c.jsx)(o.Tooltip,{placement:`bottom`,title:u.t(`docs-hyper-link-ui.info.copy`),children:(0,c.jsx)(w,{})})}),(0,c.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{s.executeCommand(z.id,{link:d})},children:(0,c.jsx)(o.Tooltip,{placement:`bottom`,title:u.t(`docs-hyper-link-ui.info.edit`),children:(0,c.jsx)(k,{})})}),(0,c.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{s.executeCommand(A.id,{unitId:p,linkId:b.rangeId,segmentId:h})},children:(0,c.jsx)(o.Tooltip,{placement:`bottom`,title:u.t(`docs-hyper-link-ui.info.cancel`),children:(0,c.jsx)(D,{})})})]})]})};j.componentKey=`univer.doc.link-info-popup`;function M(e){"@babel/helpers - typeof";return M=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},M(e)}function te(e,t){if(M(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(M(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function N(e){var t=te(e,`string`);return M(t)==`symbol`?t:t+``}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e,t){return function(n,r){t(n,r,e)}}function I(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let L=class extends r.Disposable{constructor(e,t,n){super(),this._docCanvasPopupManagerService=e,this._textSelectionManagerService=t,this._univerInstanceService=n,P(this,`_editingLink$`,new a.BehaviorSubject(null)),P(this,`_showingLink$`,new a.BehaviorSubject(null)),P(this,`editingLink$`,this._editingLink$.asObservable()),P(this,`showingLink$`,this._showingLink$.asObservable()),P(this,`_editPopup`,null),P(this,`_infoPopup`,null),this.disposeWithMe(()=>{this._editingLink$.complete(),this._showingLink$.complete()})}get editing(){return this._editingLink$.value}get showing(){return this._showingLink$.value}showEditPopup(e,t){this._editPopup&&this._editPopup.dispose(),this._editingLink$.next(t);let n=this._textSelectionManagerService.getTextRanges({unitId:e,subUnitId:e}),r=n==null?void 0:n[n.length-1];if(t){let{segmentId:e,segmentPage:n,startIndex:i,endIndex:a}=t;r={collapsed:!1,startOffset:i,endOffset:a+1,segmentId:e,segmentPage:n},this._textSelectionManagerService.replaceDocRanges([{startOffset:i,endOffset:a+1}])}return r?(this._editPopup=this._docCanvasPopupManagerService.attachPopupToRange(r,{componentKey:_.componentKey,direction:`bottom`},e),this._editPopup):null}hideEditPopup(){var e;this._editingLink$.next(null),(e=this._editPopup)==null||e.dispose()}showInfoPopup(e){var t,n,i,a,o,s;let{linkId:c,unitId:l,segmentId:u,segmentPage:d,startIndex:f,endIndex:p}=e;if(!(((t=this.showing)==null?void 0:t.linkId)===c&&((n=this.showing)==null?void 0:n.unitId)===l&&((i=this.showing)==null?void 0:i.segmentId)===u&&((a=this.showing)==null?void 0:a.segmentPage)===d&&((o=this.showing)==null?void 0:o.startIndex)===f&&((s=this.showing)==null?void 0:s.endIndex)===p)&&(this._infoPopup&&this._infoPopup.dispose(),this._univerInstanceService.getUnit(l,r.UniverInstanceType.UNIVER_DOC)))return this._showingLink$.next({unitId:l,linkId:c,segmentId:u,segmentPage:d,startIndex:f,endIndex:p}),this._infoPopup=this._docCanvasPopupManagerService.attachPopupToRange({collapsed:!1,startOffset:f,endOffset:p+1,segmentId:u,segmentPage:d},{componentKey:j.componentKey,direction:`top-center`,multipleDirection:`top`,onClickOutside:()=>{this.hideInfoPopup()}},l),this._infoPopup}hideInfoPopup(){var e;this._showingLink$.next(null),(e=this._infoPopup)==null||e.dispose()}};L=I([F(0,(0,r.Inject)(t.DocCanvasPopManagerService)),F(1,(0,r.Inject)(i.DocSelectionManagerService)),F(2,r.IUniverInstanceService)],L);let R=e=>{let t=e.get(i.DocSelectionManagerService),n=e.get(r.IUniverInstanceService),a=t.getTextRanges();if(!(a!=null&&a.length))return!0;let o=a[0];return!!(!n.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_DOC)||!o||o.collapsed)},z={type:r.CommandType.OPERATION,id:`doc.operation.show-hyper-link-edit-popup`,handler(e,t){var n;let i=t==null?void 0:t.link,a=e.get(r.IUniverInstanceService);if(R(e)&&!i)return!1;let o=e.get(L),s=(i==null?void 0:i.unitId)||((n=a.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_DOC))==null?void 0:n.getUnitId());return s?(o.showEditPopup(s,i),!0):!1}},B={type:r.CommandType.OPERATION,id:`doc.operation.toggle-hyper-link-info-popup`,handler(e,t){let n=e.get(L);return t?(n.showInfoPopup(t),!0):(n.hideInfoPopup(),!0)}},V={type:r.CommandType.OPERATION,id:`doc.operation.click-hyper-link`,handler(e,t){var n,i;if(!t)return!1;let{unitId:a,linkId:o,segmentId:s}=t,c=e.get(r.IUniverInstanceService).getUnit(a,r.UniverInstanceType.UNIVER_DOC),l=c==null||(n=c.getSelfOrHeaderFooterModel(s))==null?void 0:n.getBody(),u=l==null||(i=l.customRanges)==null||(i=i.find(e=>e.rangeId===o&&e.rangeType===r.CustomRangeType.HYPERLINK))==null||(i=i.properties)==null?void 0:i.url;return(0,r.isSafeUrl)(u)?(window.open(u,`_blank`,`noopener noreferrer`),!0):!1}};function H(e){return{id:z.id,type:n.MenuItemType.BUTTON,icon:`LinkIcon`,title:`docs-hyper-link-ui.menu.tooltip`,tooltip:`docs-hyper-link-ui.menu.tooltip`,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_DOC),disabled$:new a.Observable(function(t){let n=e.get(i.DocSelectionManagerService).textSelection$.pipe((0,a.debounceTime)(16)).subscribe(()=>{t.next(R(e))});return()=>{n.unsubscribe()}})}}let U={id:z.id,binding:n.MetaKeys.CTRL_COMMAND|n.KeyCode.K,description:`docs-hyper-link-ui.menu.tooltip`,preconditions:t.whenDocAndEditorFocused},W={[n.RibbonInsertGroup.MEDIA]:{[z.id]:{order:1,menuItemFactory:H}},[t.FLOAT_TOOLBAR_MENU_POSITION]:{[z.id]:{order:20,menuItemFactory:H}},[n.ContextMenuPosition.MAIN_AREA]:{[n.ContextMenuGroup.DATA]:{[z.id]:{order:0,menuItemFactory:H}}},[n.ContextMenuPosition.PARAGRAPH]:{[n.ContextMenuGroup.LAYOUT]:{[t.INSERT_BELLOW_MENU_ID]:{[z.id]:{order:6,menuItemFactory:H}}},[t.EMPTY_PARAGRAPH_MENU_ID]:{[n.ContextMenuGroup.LAYOUT]:{[z.id]:{order:6,menuItemFactory:H}}}}};var G=`@univerjs/docs-hyper-link-ui`,K=`1.0.0-alpha.6`;let q={},J=class extends r.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[_.componentKey,_],[j.componentKey,j]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({LinkIcon:E}))}};J=I([F(0,(0,r.Inject)(n.ComponentManager)),F(1,(0,r.Inject)(n.IconManager))],J);let Y=class extends r.Disposable{constructor(e,t,n){super(),this._commandService=e,this._univerInstanceService=t,this._docHyperLinkService=n,this._initSelectionChange()}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===i.SetTextSelectionsOperation.id){let{unitId:i,ranges:a,segmentId:o}=e.params,s=this._univerInstanceService.getUnit(i,r.UniverInstanceType.UNIVER_DOC),c=a[0];if(c&&s){var t;let{startOffset:e,endOffset:r,collapsed:a,segmentPage:l}=c,u=(t=s.getSelfOrHeaderFooterModel(o))==null||(t=t.getBody())==null?void 0:t.customRanges;if(a){var n;let t=(n=u==null?void 0:u.findIndex(t=>t.startIndex<e&&t.endIndex>r-1))==null?-1:n;if(t>-1){let e=u[t];this._docHyperLinkService.showInfoPopup({unitId:i,linkId:e.rangeId,segmentId:o,segmentPage:l,startIndex:e.startIndex,endIndex:e.endIndex});return}}else if(u!=null&&u.find(t=>t.startIndex<=e&&t.endIndex>=r-1))return}this._docHyperLinkService.hideInfoPopup(),this._docHyperLinkService.hideEditPopup()}}))}};Y=I([F(0,r.ICommandService),F(1,r.IUniverInstanceService),F(2,(0,r.Inject)(L))],Y);let X=class extends r.Disposable{get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}constructor(e,t,n,i,a,o){super(),this._context=e,this._docEventManagerService=t,this._commandService=n,this._hyperLinkPopupService=i,this._docSkeletonManagerService=a,this._docSelectionManagerService=o,this._context.unitId!==r.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&(this._initHover(),this._initClick())}_hideInfoPopup(){this._hyperLinkPopupService.showing&&this._commandService.executeCommand(B.id)}_initHover(){this.disposeWithMe(this._docEventManagerService.hoverCustomRanges$.subscribe(e=>{var t,n;let i=e.find(e=>e.range.rangeType===r.CustomRangeType.HYPERLINK),a=this._docSelectionManagerService.getTextRanges(),o=a==null||(t=a[0])==null?void 0:t.segmentId;if(((n=i==null?void 0:i.segmentId)==null?``:n)!==o){this._hideInfoPopup();return}i?this._commandService.executeCommand(B.id,{unitId:this._context.unitId,linkId:i.range.rangeId,segmentId:i.segmentId,segmentPage:i.segmentPageIndex,rangeId:i.range.rangeId,startIndex:i.range.startIndex,endIndex:i.range.endIndex}):this._hideInfoPopup()}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(e=>{let t=e.range;t&&this._commandService.executeCommand(V.id,{unitId:this._context.unitId,linkId:t.rangeId,segmentId:e.segmentId})}))}};X=I([F(1,(0,r.Inject)(t.DocEventManagerService)),F(2,r.ICommandService),F(3,(0,r.Inject)(L)),F(4,(0,r.Inject)(i.DocSkeletonManagerService)),F(5,(0,r.Inject)(i.DocSelectionManagerService))],X);let Z=class extends r.Disposable{constructor(e,t,n,r){super(),this._context=e,this._docInterceptorService=t,this._hyperLinkService=n,this._docRenderController=r,this._init(),this._initReRender()}_init(){this._docInterceptorService.intercept(i.DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:r,index:i}=t,a=this._hyperLinkService.showing;if(!a)return n({...e,active:!1});let{linkId:o,unitId:s,startIndex:c,endIndex:l}=a,u=s===r&&e.rangeId===o&&i>=c&&i<=l;return n({...e,active:u})}})}_initReRender(){this.disposeWithMe(this._hyperLinkService.showingLink$.pipe((0,a.distinctUntilChanged)((e,t)=>(e==null?void 0:e.linkId)===(t==null?void 0:t.linkId)&&(e==null?void 0:e.unitId)===(t==null?void 0:t.unitId)&&(e==null?void 0:e.startIndex)===(t==null?void 0:t.startIndex)),(0,a.pairwise)()).subscribe(([e,t])=>{t?t.unitId===this._context.unitId&&this._docRenderController.reRender(t.unitId):e&&e.unitId===this._context.unitId&&this._docRenderController.reRender(e.unitId)}))}};Z=I([F(1,(0,r.Inject)(i.DocInterceptorService)),F(2,(0,r.Inject)(L)),F(3,(0,r.Inject)(t.DocRenderController))],Z);let Q=class extends r.Disposable{constructor(e,t,n){super(),this._commandService=e,this._menuManagerService=t,this._shortcutService=n,this._initCommands(),this._initMenus(),this._initShortcut()}_initCommands(){[d,f,A,z,B,V].forEach(e=>{this._commandService.registerCommand(e)})}_initShortcut(){[U].forEach(e=>{this._shortcutService.registerShortcut(e)})}_initMenus(){this._menuManagerService.appendRootMenu({[t.FLOAT_TOOLBAR_MENU_POSITION]:{}}),this._menuManagerService.mergeMenu(W)}};Q=I([F(0,r.ICommandService),F(1,n.IMenuManagerService),F(2,n.IShortcutService)],Q);let $=class extends r.Plugin{constructor(e=q,t,n,i){super(),this._config=e,this._injector=t,this._renderManagerSrv=n,this._configService=i;let{menu:a,...o}=(0,r.merge)({},q,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(`docs-hyper-link-ui.config`,o)}onStarting(){this._injector.add([J]),this._injector.get(J),[[L],[Q],[Y]].forEach(e=>{this._injector.add(e)}),this._injector.get(Q)}onReady(){this._injector.get(Y)}onRendered(){this._initRenderModule()}_initRenderModule(){[[Z],[X]].forEach(e=>{this._renderManagerSrv.registerRenderModule(r.UniverInstanceType.UNIVER_DOC,e)})}};P($,`pluginName`,`DOC_HYPER_LINK_UI_PLUGIN`),P($,`packageName`,G),P($,`version`,K),P($,`type`,r.UniverInstanceType.UNIVER_DOC),$=I([(0,r.DependentOn)(l.UniverDocsHyperLinkPlugin),F(1,(0,r.Inject)(r.Injector)),F(2,u.IRenderManagerService),F(3,r.IConfigService)],$),e.DocsHyperLinkUIMenuSchema=W,Object.defineProperty(e,"UniverDocsHyperLinkUIPlugin",{enumerable:!0,get:function(){return $}})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/docs-ui"),require("@univerjs/ui"),require("@univerjs/core"),require("@univerjs/docs"),require("rxjs"),require("@univerjs/design"),require("react"),require("react/jsx-runtime"),require("@univerjs/docs-hyper-link"),require("@univerjs/engine-render")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/docs-ui`,`@univerjs/ui`,`@univerjs/core`,`@univerjs/docs`,`rxjs`,`@univerjs/design`,`react`,`react/jsx-runtime`,`@univerjs/docs-hyper-link`,`@univerjs/engine-render`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsHyperLinkUi={},e.UniverDocsUi,e.UniverUi,e.UniverCore,e.UniverDocs,e.rxjs,e.UniverDesign,e.React,e.React,e.UniverDocsHyperLink,e.UniverEngineRender))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let d={type:r.CommandType.COMMAND,id:`docs.command.add-hyper-link`,async handler(e,t){if(!t)return!1;let{payload:n,unitId:a,selections:o}=t,s=e.get(r.ICommandService),c=(0,i.addCustomRangeBySelectionFactory)(e,{rangeId:(0,r.generateRandomId)(),rangeType:r.CustomRangeType.HYPERLINK,properties:{url:n},unitId:a,selections:o});return c?s.syncExecuteCommand(c.id,c.params):!1}},f={id:`docs.command.update-hyper-link`,type:r.CommandType.COMMAND,handler(e,t){var n,a;if(!t)return!1;let{unitId:o,payload:s,segmentId:c,linkId:l}=t,u=e.get(r.ICommandService),d=e.get(r.IUniverInstanceService),f=e.get(i.DocSelectionManagerService).getActiveTextRange(),p=d.getUnit(o,r.UniverInstanceType.UNIVER_DOC);if(!f||!p)return!1;let m=(n=p.getSelfOrHeaderFooterModel(c))==null?void 0:n.getBody();if(!m)return!1;let h=(a=(0,r.getBodySlice)(m,f.startOffset,f.endOffset).textRuns)==null?void 0:a[0];h&&(h.ed=t.label.length+1);let g=(0,i.replaceSelectionFactory)(e,{unitId:o,body:{dataStream:`${t.label}`,customRanges:[{rangeId:l,rangeType:r.CustomRangeType.HYPERLINK,startIndex:0,endIndex:t.label.length+1,properties:{url:s}}],textRuns:h?[h]:void 0},selection:{startOffset:f.startOffset,endOffset:f.endOffset,collapsed:!1,segmentId:c}});return g?u.syncExecuteCommand(g.id,g.params):!1}};function p(e){return e.trim().length===0}function m(e){return/^[a-zA-Z]+:\/\//.test(e)}function h(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function g(e){return m(e)?e:h(e)?`mailto://${e}`:`https://${e}`}let _=()=>{let e=(0,n.useDependency)(L),t=(0,n.useDependency)(r.LocaleService),a=(0,n.useObservable)(e.editingLink$),l=(0,n.useDependency)(r.ICommandService),u=(0,n.useDependency)(r.IUniverInstanceService),m=(0,n.useDependency)(i.DocSelectionManagerService),[h,_]=(0,s.useState)(``),[v,y]=(0,s.useState)(``),[b,x]=(0,s.useState)(!1),S=r.Tools.isLegalUrl(h),C=a?u.getUnit(a.unitId,r.UniverInstanceType.UNIVER_DOC):u.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_DOC);(0,s.useEffect)(()=>{var e,t,n;let i=m.getActiveTextRange();if(!i)return;if(a){var o,s;let e=C==null||(o=C.getSelfOrHeaderFooterModel(a.segmentId))==null?void 0:o.getBody(),t=e==null||(s=e.customRanges)==null?void 0:s.find(e=>(a==null?void 0:a.linkId)===e.rangeId&&e.startIndex===a.startIndex&&e.endIndex===a.endIndex);if(C&&t){var c,l;_((c=(l=t.properties)==null?void 0:l.url)==null?``:c),y(r.BuildTextUtils.transform.getPlainText((0,r.getBodySlice)(e,t.startIndex,t.endIndex+1).dataStream))}return}let u=C==null||(e=C.getSelfOrHeaderFooterModel(i.segmentId))==null?void 0:e.getBody(),d=u?i:null,f=d&&((t=r.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(d,(n=u==null?void 0:u.customRanges)==null?[]:n))==null?void 0:t[0]);if(C&&f){var p,h;_((p=f==null||(h=f.properties)==null?void 0:h.url)==null?``:p)}},[C,a,m,u]);let w=()=>{e.hideEditPopup()},T=()=>{if(x(!0),!S||!C)return;let t=g(h);if(!a)l.executeCommand(d.id,{unitId:C.getUnitId(),payload:t});else{if(p(v))return;l.executeCommand(f.id,{unitId:C.getUnitId(),payload:t,linkId:a.linkId,label:v,segmentId:a.segmentId})}e.hideEditPopup()};if(C)return(0,c.jsxs)(`div`,{className:(0,o.clsx)(`univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow dark:!univer-bg-gray-900`,o.borderClassName),children:[(0,c.jsxs)(`div`,{children:[a?(0,c.jsx)(o.FormLayout,{label:t.t(`docs-hyper-link-ui.edit.label`),error:b&&p(v)?t.t(`docs-hyper-link-ui.edit.labelError`):``,children:(0,c.jsx)(o.Input,{value:v,onChange:y,autoFocus:!0,onKeyDown:e=>{e.keyCode===n.KeyCode.ENTER&&T()}})}):null,(0,c.jsx)(o.FormLayout,{label:t.t(`docs-hyper-link-ui.edit.address`),error:b&&!S?t.t(`docs-hyper-link-ui.edit.addressError`):``,children:(0,c.jsx)(o.Input,{value:h,onChange:_,autoFocus:!0,onKeyDown:e=>{e.keyCode===n.KeyCode.ENTER&&T()}})})]}),(0,c.jsxs)(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[(0,c.jsx)(o.Button,{onClick:w,children:t.t(`docs-hyper-link-ui.edit.cancel`)}),(0,c.jsx)(o.Button,{variant:`primary`,disabled:p(h),onClick:T,children:t.t(`docs-hyper-link-ui.edit.confirm`)})]})]})};_.componentKey=`docs-hyper-link-edit`;function v({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,c=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),l=(0,s.useRef)(`_${S()}`);return y(n,`${r}`,{defIds:n.defIds,idSuffix:l.current},{ref:e,className:c,...o},a)}function y(e,t,n,r,i){return(0,s.createElement)(e.tag,{key:t,...b(e,n,i),...r},(x(e,n).children||[]).map((r,a)=>y(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function b(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function x(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function S(){return Math.random().toString(36).substring(2,8)}v.displayName=`UniverIcon`;let C={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},w=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`copy-icon`,ref:t,icon:C}))});w.displayName=`CopyIcon`;let T={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z`}}]},E=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`link-icon`,ref:t,icon:T}))});E.displayName=`LinkIcon`;let ee={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z`}}]},D=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`unlink-icon`,ref:t,icon:ee}))});D.displayName=`UnlinkIcon`;let O={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},k=(0,s.forwardRef)(function(e,t){return(0,s.createElement)(v,Object.assign({},e,{id:`write-icon`,ref:t,icon:O}))});k.displayName=`WriteIcon`;let A={type:r.CommandType.COMMAND,id:`docs.command.delete-hyper-link`,async handler(e,t){if(!t)return!1;let{unitId:n,linkId:a,segmentId:o}=t,s=e.get(r.ICommandService),c=(0,i.deleteCustomRangeFactory)(e,{unitId:n,rangeId:a,segmentId:o});return c?await s.syncExecuteCommand(c.id,c.params):!1}},j=()=>{var e,t,i;let a=(0,n.useDependency)(L),s=(0,n.useDependency)(r.ICommandService),l=(0,n.useDependency)(n.IMessageService),u=(0,n.useDependency)(r.LocaleService),d=(0,n.useObservable)(a.showingLink$),f=(0,n.useDependency)(r.IUniverInstanceService);if(!d)return null;let{unitId:p,linkId:m,segmentId:h,startIndex:g,endIndex:_}=d,v=f.getUnit(p,r.UniverInstanceType.UNIVER_DOC),y=v==null||(e=v.getSelfOrHeaderFooterModel(h))==null?void 0:e.getBody(),b=y==null||(t=y.customRanges)==null?void 0:t.find(e=>e.rangeId===m&&e.rangeType===r.CustomRangeType.HYPERLINK&&e.startIndex===g&&e.endIndex===_);if(!b)return null;let x=(i=b.properties)==null?void 0:i.url;return(0,c.jsxs)(`div`,{className:(0,o.clsx)(`univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow dark:!univer-bg-gray-900`,o.borderClassName),onClick:()=>{a.hideInfoPopup()},children:[(0,c.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-500`,onClick:()=>window.open(x,void 0,`noopener noreferrer`),children:[(0,c.jsx)(`div`,{className:`univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white`,children:(0,c.jsx)(E,{})}),(0,c.jsx)(o.Tooltip,{showIfEllipsis:!0,title:x,children:(0,c.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:x})})]}),(0,c.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center`,children:[(0,c.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{navigator.clipboard.writeText(x),l.show({content:u.t(`docs-hyper-link-ui.info.coped`),type:o.MessageType.Info})},children:(0,c.jsx)(o.Tooltip,{placement:`bottom`,title:u.t(`docs-hyper-link-ui.info.copy`),children:(0,c.jsx)(w,{})})}),(0,c.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{s.executeCommand(z.id,{link:d})},children:(0,c.jsx)(o.Tooltip,{placement:`bottom`,title:u.t(`docs-hyper-link-ui.info.edit`),children:(0,c.jsx)(k,{})})}),(0,c.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{s.executeCommand(A.id,{unitId:p,linkId:b.rangeId,segmentId:h})},children:(0,c.jsx)(o.Tooltip,{placement:`bottom`,title:u.t(`docs-hyper-link-ui.info.cancel`),children:(0,c.jsx)(D,{})})})]})]})};j.componentKey=`univer.doc.link-info-popup`;function M(e){"@babel/helpers - typeof";return M=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},M(e)}function te(e,t){if(M(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(M(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function N(e){var t=te(e,`string`);return M(t)==`symbol`?t:t+``}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e,t){return function(n,r){t(n,r,e)}}function I(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let L=class extends r.Disposable{constructor(e,t,n){super(),this._docCanvasPopupManagerService=e,this._textSelectionManagerService=t,this._univerInstanceService=n,P(this,`_editingLink$`,new a.BehaviorSubject(null)),P(this,`_showingLink$`,new a.BehaviorSubject(null)),P(this,`editingLink$`,this._editingLink$.asObservable()),P(this,`showingLink$`,this._showingLink$.asObservable()),P(this,`_editPopup`,null),P(this,`_infoPopup`,null),this.disposeWithMe(()=>{this._editingLink$.complete(),this._showingLink$.complete()})}get editing(){return this._editingLink$.value}get showing(){return this._showingLink$.value}showEditPopup(e,t){this._editPopup&&this._editPopup.dispose(),this._editingLink$.next(t);let n=this._textSelectionManagerService.getTextRanges({unitId:e,subUnitId:e}),r=n==null?void 0:n[n.length-1];if(t){let{segmentId:e,segmentPage:n,startIndex:i,endIndex:a}=t;r={collapsed:!1,startOffset:i,endOffset:a+1,segmentId:e,segmentPage:n},this._textSelectionManagerService.replaceDocRanges([{startOffset:i,endOffset:a+1}])}return r?(this._editPopup=this._docCanvasPopupManagerService.attachPopupToRange(r,{componentKey:_.componentKey,direction:`bottom`},e),this._editPopup):null}hideEditPopup(){var e;this._editingLink$.next(null),(e=this._editPopup)==null||e.dispose()}showInfoPopup(e){var t,n,i,a,o,s;let{linkId:c,unitId:l,segmentId:u,segmentPage:d,startIndex:f,endIndex:p}=e;if((((t=this.showing)==null?void 0:t.linkId)!==c||((n=this.showing)==null?void 0:n.unitId)!==l||((i=this.showing)==null?void 0:i.segmentId)!==u||((a=this.showing)==null?void 0:a.segmentPage)!==d||((o=this.showing)==null?void 0:o.startIndex)!==f||((s=this.showing)==null?void 0:s.endIndex)!==p)&&(this._infoPopup&&this._infoPopup.dispose(),this._univerInstanceService.getUnit(l,r.UniverInstanceType.UNIVER_DOC)))return this._showingLink$.next({unitId:l,linkId:c,segmentId:u,segmentPage:d,startIndex:f,endIndex:p}),this._infoPopup=this._docCanvasPopupManagerService.attachPopupToRange({collapsed:!1,startOffset:f,endOffset:p+1,segmentId:u,segmentPage:d},{componentKey:j.componentKey,direction:`top-center`,multipleDirection:`top`,onClickOutside:()=>{this.hideInfoPopup()}},l),this._infoPopup}hideInfoPopup(){var e;this._showingLink$.next(null),(e=this._infoPopup)==null||e.dispose()}};L=I([F(0,(0,r.Inject)(t.DocCanvasPopManagerService)),F(1,(0,r.Inject)(i.DocSelectionManagerService)),F(2,r.IUniverInstanceService)],L);let R=e=>{let t=e.get(i.DocSelectionManagerService),n=e.get(r.IUniverInstanceService),a=t.getTextRanges();if(!(a!=null&&a.length))return!0;let o=a[0];return!!(!n.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_DOC)||!o||o.collapsed)},z={type:r.CommandType.OPERATION,id:`doc.operation.show-hyper-link-edit-popup`,handler(e,t){var n;let i=t==null?void 0:t.link,a=e.get(r.IUniverInstanceService);if(R(e)&&!i)return!1;let o=e.get(L),s=(i==null?void 0:i.unitId)||((n=a.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_DOC))==null?void 0:n.getUnitId());return s?(o.showEditPopup(s,i),!0):!1}},B={type:r.CommandType.OPERATION,id:`doc.operation.toggle-hyper-link-info-popup`,handler(e,t){let n=e.get(L);return t?(n.showInfoPopup(t),!0):(n.hideInfoPopup(),!0)}},V={type:r.CommandType.OPERATION,id:`doc.operation.click-hyper-link`,handler(e,t){var n,i;if(!t)return!1;let{unitId:a,linkId:o,segmentId:s}=t,c=e.get(r.IUniverInstanceService).getUnit(a,r.UniverInstanceType.UNIVER_DOC),l=c==null||(n=c.getSelfOrHeaderFooterModel(s))==null?void 0:n.getBody(),u=l==null||(i=l.customRanges)==null||(i=i.find(e=>e.rangeId===o&&e.rangeType===r.CustomRangeType.HYPERLINK))==null||(i=i.properties)==null?void 0:i.url;return(0,r.isSafeUrl)(u)?(window.open(u,`_blank`,`noopener noreferrer`),!0):!1}};function H(e){return{id:z.id,type:n.MenuItemType.BUTTON,icon:`LinkIcon`,title:`docs-hyper-link-ui.menu.tooltip`,tooltip:`docs-hyper-link-ui.menu.tooltip`,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_DOC),disabled$:new a.Observable(function(t){let n=e.get(i.DocSelectionManagerService).textSelection$.pipe((0,a.debounceTime)(16)).subscribe(()=>{t.next(R(e))});return()=>{n.unsubscribe()}})}}let U={id:z.id,binding:n.MetaKeys.CTRL_COMMAND|n.KeyCode.K,description:`docs-hyper-link-ui.menu.tooltip`,preconditions:t.whenDocAndEditorFocused},W={[n.RibbonInsertGroup.MEDIA]:{[z.id]:{order:1,menuItemFactory:H}},[t.FLOAT_TOOLBAR_MENU_POSITION]:{[z.id]:{order:20,menuItemFactory:H}},[n.ContextMenuPosition.MAIN_AREA]:{[n.ContextMenuGroup.DATA]:{[z.id]:{order:0,menuItemFactory:H}}},[n.ContextMenuPosition.PARAGRAPH]:{[n.ContextMenuGroup.LAYOUT]:{[t.INSERT_BELLOW_MENU_ID]:{[z.id]:{order:6,menuItemFactory:H}}},[t.EMPTY_PARAGRAPH_MENU_ID]:{[n.ContextMenuGroup.LAYOUT]:{[z.id]:{order:6,menuItemFactory:H}}}}};var G=`@univerjs/docs-hyper-link-ui`,K=`1.0.0-alpha.8`;let q={},J=class extends r.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[_.componentKey,_],[j.componentKey,j]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({LinkIcon:E}))}};J=I([F(0,(0,r.Inject)(n.ComponentManager)),F(1,(0,r.Inject)(n.IconManager))],J);let Y=class extends r.Disposable{constructor(e,t,n){super(),this._commandService=e,this._univerInstanceService=t,this._docHyperLinkService=n,this._initSelectionChange()}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===i.SetTextSelectionsOperation.id){let{unitId:i,ranges:a,segmentId:o}=e.params,s=this._univerInstanceService.getUnit(i,r.UniverInstanceType.UNIVER_DOC),c=a[0];if(c&&s){var t;let{startOffset:e,endOffset:r,collapsed:a,segmentPage:l}=c,u=(t=s.getSelfOrHeaderFooterModel(o))==null||(t=t.getBody())==null?void 0:t.customRanges;if(a){var n;let t=(n=u==null?void 0:u.findIndex(t=>t.startIndex<e&&t.endIndex>r-1))==null?-1:n;if(t>-1){let e=u[t];this._docHyperLinkService.showInfoPopup({unitId:i,linkId:e.rangeId,segmentId:o,segmentPage:l,startIndex:e.startIndex,endIndex:e.endIndex});return}}else if(u!=null&&u.find(t=>t.startIndex<=e&&t.endIndex>=r-1))return}this._docHyperLinkService.hideInfoPopup(),this._docHyperLinkService.hideEditPopup()}}))}};Y=I([F(0,r.ICommandService),F(1,r.IUniverInstanceService),F(2,(0,r.Inject)(L))],Y);let X=class extends r.Disposable{get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}constructor(e,t,n,i,a,o){super(),this._context=e,this._docEventManagerService=t,this._commandService=n,this._hyperLinkPopupService=i,this._docSkeletonManagerService=a,this._docSelectionManagerService=o,this._context.unitId!==r.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&(this._initHover(),this._initClick())}_hideInfoPopup(){this._hyperLinkPopupService.showing&&this._commandService.executeCommand(B.id)}_initHover(){this.disposeWithMe(this._docEventManagerService.hoverCustomRanges$.subscribe(e=>{var t,n;let i=e.find(e=>e.range.rangeType===r.CustomRangeType.HYPERLINK),a=this._docSelectionManagerService.getTextRanges(),o=a==null||(t=a[0])==null?void 0:t.segmentId;if(((n=i==null?void 0:i.segmentId)==null?``:n)!==o){this._hideInfoPopup();return}i?this._commandService.executeCommand(B.id,{unitId:this._context.unitId,linkId:i.range.rangeId,segmentId:i.segmentId,segmentPage:i.segmentPageIndex,rangeId:i.range.rangeId,startIndex:i.range.startIndex,endIndex:i.range.endIndex}):this._hideInfoPopup()}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(e=>{let t=e.range;t&&this._commandService.executeCommand(V.id,{unitId:this._context.unitId,linkId:t.rangeId,segmentId:e.segmentId})}))}};X=I([F(1,(0,r.Inject)(t.DocEventManagerService)),F(2,r.ICommandService),F(3,(0,r.Inject)(L)),F(4,(0,r.Inject)(i.DocSkeletonManagerService)),F(5,(0,r.Inject)(i.DocSelectionManagerService))],X);let Z=class extends r.Disposable{constructor(e,t,n,r){super(),this._context=e,this._docInterceptorService=t,this._hyperLinkService=n,this._docRenderController=r,this._init(),this._initReRender()}_init(){this._docInterceptorService.intercept(i.DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:r,index:i}=t,a=this._hyperLinkService.showing;if(!a)return n({...e,active:!1});let{linkId:o,unitId:s,startIndex:c,endIndex:l}=a,u=s===r&&e.rangeId===o&&i>=c&&i<=l;return n({...e,active:u})}})}_initReRender(){this.disposeWithMe(this._hyperLinkService.showingLink$.pipe((0,a.distinctUntilChanged)((e,t)=>(e==null?void 0:e.linkId)===(t==null?void 0:t.linkId)&&(e==null?void 0:e.unitId)===(t==null?void 0:t.unitId)&&(e==null?void 0:e.startIndex)===(t==null?void 0:t.startIndex)),(0,a.pairwise)()).subscribe(([e,t])=>{t?t.unitId===this._context.unitId&&this._docRenderController.reRender(t.unitId):e&&e.unitId===this._context.unitId&&this._docRenderController.reRender(e.unitId)}))}};Z=I([F(1,(0,r.Inject)(i.DocInterceptorService)),F(2,(0,r.Inject)(L)),F(3,(0,r.Inject)(t.DocRenderController))],Z);let Q=class extends r.Disposable{constructor(e,t,n){super(),this._commandService=e,this._menuManagerService=t,this._shortcutService=n,this._initCommands(),this._initMenus(),this._initShortcut()}_initCommands(){[d,f,A,z,B,V].forEach(e=>{this._commandService.registerCommand(e)})}_initShortcut(){[U].forEach(e=>{this._shortcutService.registerShortcut(e)})}_initMenus(){this._menuManagerService.appendRootMenu({[t.FLOAT_TOOLBAR_MENU_POSITION]:{}}),this._menuManagerService.mergeMenu(W)}};Q=I([F(0,r.ICommandService),F(1,n.IMenuManagerService),F(2,n.IShortcutService)],Q);let $=class extends r.Plugin{constructor(e=q,t,n,i){super(),this._config=e,this._injector=t,this._renderManagerSrv=n,this._configService=i;let{menu:a,...o}=(0,r.merge)({},q,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(`docs-hyper-link-ui.config`,o)}onStarting(){this._injector.add([J]),this._injector.get(J),[[L],[Q],[Y]].forEach(e=>{this._injector.add(e)}),this._injector.get(Q)}onReady(){this._injector.get(Y)}onRendered(){this._initRenderModule()}_initRenderModule(){[[Z],[X]].forEach(e=>{this._renderManagerSrv.registerRenderModule(r.UniverInstanceType.UNIVER_DOC,e)})}};P($,`pluginName`,`DOC_HYPER_LINK_UI_PLUGIN`),P($,`packageName`,G),P($,`version`,K),P($,`type`,r.UniverInstanceType.UNIVER_DOC),$=I([(0,r.DependentOn)(i.UniverDocsPlugin,u.UniverRenderEnginePlugin,l.UniverDocsHyperLinkPlugin,n.UniverUIPlugin,t.UniverDocsUIPlugin),F(1,(0,r.Inject)(r.Injector)),F(2,u.IRenderManagerService),F(3,r.IConfigService)],$),e.DocsHyperLinkUIMenuSchema=W,Object.defineProperty(e,"UniverDocsHyperLinkUIPlugin",{enumerable:!0,get:function(){return $}})});
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiFrFR=t())})(this,function(){return{"docs-hyper-link-ui":{edit:{confirm:`Confirmer`,cancel:`Annuler`,title:`Lien`,address:`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiFrFR=t())})(this,function(){return{"docs-hyper-link-ui":{edit:{confirm:`Confirmer`,cancel:`Annuler`,title:`Lien`,address:`Lien`,placeholder:`Veuillez entrer un lien`,addressError:`L'url est illégal!`,label:`Libellé`,labelError:`Veuillez entrer le label du lien`},info:{copy:`Copier`,edit:`Modifier`,cancel:`Supprimer le lien`,coped:`Lien copié dans le presse-papiers`},menu:{tooltip:`Ajouter un lien`}}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-hyper-link-ui",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Hyperlink editing UI for Univer Docs.",
|
|
6
6
|
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
@@ -58,23 +58,23 @@
|
|
|
58
58
|
"rxjs": ">=7.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@univerjs/icons": "1.
|
|
62
|
-
"@univerjs/core": "1.0.0-alpha.
|
|
63
|
-
"@univerjs/design": "1.0.0-alpha.
|
|
64
|
-
"@univerjs/docs": "1.0.0-alpha.
|
|
65
|
-
"@univerjs/
|
|
66
|
-
"@univerjs/docs
|
|
67
|
-
"@univerjs/
|
|
68
|
-
"@univerjs/ui": "1.0.0-alpha.
|
|
61
|
+
"@univerjs/icons": "1.34.0",
|
|
62
|
+
"@univerjs/core": "1.0.0-alpha.8",
|
|
63
|
+
"@univerjs/design": "1.0.0-alpha.8",
|
|
64
|
+
"@univerjs/docs-hyper-link": "1.0.0-alpha.8",
|
|
65
|
+
"@univerjs/engine-render": "1.0.0-alpha.8",
|
|
66
|
+
"@univerjs/docs": "1.0.0-alpha.8",
|
|
67
|
+
"@univerjs/docs-ui": "1.0.0-alpha.8",
|
|
68
|
+
"@univerjs/ui": "1.0.0-alpha.8"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"postcss": "^8.5.
|
|
71
|
+
"postcss": "^8.5.23",
|
|
72
72
|
"react": "18.3.1",
|
|
73
73
|
"rxjs": "^7.8.2",
|
|
74
74
|
"tailwindcss": "3.4.18",
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
76
|
"vitest": "^4.1.10",
|
|
77
|
-
"@univerjs-infra/shared": "1.0.0-alpha.
|
|
77
|
+
"@univerjs-infra/shared": "1.0.0-alpha.8"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"test": "vitest run",
|