@univerjs/sheets-hyper-link-ui 0.1.13
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/LICENSE +176 -0
- package/README.md +22 -0
- package/lib/cjs/index.js +9 -0
- package/lib/es/index.js +1717 -0
- package/lib/index.css +1 -0
- package/lib/locale/en-US.json +35 -0
- package/lib/locale/ru-RU.json +35 -0
- package/lib/locale/zh-CN.json +35 -0
- package/lib/types/commands/operations/sidebar.operations.d.ts +11 -0
- package/lib/types/common/util.d.ts +19 -0
- package/lib/types/controllers/auto-fill.controller.d.ts +10 -0
- package/lib/types/controllers/copy-paste.controller.d.ts +17 -0
- package/lib/types/controllers/hyper-link-permission.controller.d.ts +10 -0
- package/lib/types/controllers/menu.d.ts +15 -0
- package/lib/types/controllers/popup.controller.d.ts +10 -0
- package/lib/types/controllers/ref-range.controller.d.ts +20 -0
- package/lib/types/controllers/remove-sheet.controller.d.ts +11 -0
- package/lib/types/controllers/render-controllers/render.controller.d.ts +17 -0
- package/lib/types/controllers/set-range.controller.d.ts +18 -0
- package/lib/types/controllers/ui.controller.d.ts +21 -0
- package/lib/types/controllers/url.controller.d.ts +8 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/locale/en-US.d.ts +4 -0
- package/lib/types/locale/ru-RU.d.ts +4 -0
- package/lib/types/locale/zh-CN.d.ts +51 -0
- package/lib/types/plugin.d.ts +13 -0
- package/lib/types/services/popup.service.d.ts +34 -0
- package/lib/types/services/resolver.service.d.ts +38 -0
- package/lib/types/types/const.d.ts +17 -0
- package/lib/types/views/CellLinkEdit/index.d.ts +6 -0
- package/lib/types/views/CellLinkPopup/index.d.ts +6 -0
- package/lib/umd/index.js +9 -0
- package/package.json +94 -0
package/lib/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.univer-cell-link-edit-buttons{display:flex;flex-direction:row;justify-content:flex-end}.univer-cell-link{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:12px;box-shadow:var(--box-shadow-base);border-radius:8px;border:1px solid rgb(var(--grey-200));background:rgb(var(--color-white));max-width:328px;overflow:hidden}.univer-cell-link-type{height:20px;width:20px;font-size:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;color:rgb(var(--color-black))}.univer-cell-link-content{height:24px;display:flex;flex-direction:row;align-items:center;font-size:13px;line-height:20px;color:rgb(var(--blue-500));cursor:pointer;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-cell-link-content-error{color:rgb(var(--grey-500))}.univer-cell-link-url{flex:1;overflow:hidden;text-overflow:ellipsis}.univer-cell-link-operations{display:flex;flex-direction:row;justify-content:center;align-items:center;height:24px;flex-basis:auto;flex-grow:0;flex-shrink:0}.univer-cell-link-operation{width:24px;height:24px;margin-left:8px;font-size:16px;display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;border-radius:4px}.univer-cell-link-operation-error{color:rgb(var(--grey-500))}.univer-cell-link-operation:hover{background:#ccc}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hyperLink": {
|
|
3
|
+
"form": {
|
|
4
|
+
"editTitle": "Edit Link",
|
|
5
|
+
"addTitle": "Insert Link",
|
|
6
|
+
"label": "Label",
|
|
7
|
+
"type": "Type",
|
|
8
|
+
"link": "Link",
|
|
9
|
+
"linkPlaceholder": "Enter link",
|
|
10
|
+
"range": "Range",
|
|
11
|
+
"worksheet": "Worksheet",
|
|
12
|
+
"definedName": "Defined Name",
|
|
13
|
+
"ok": "OK",
|
|
14
|
+
"cancel": "Cancel",
|
|
15
|
+
"labelPlaceholder": "Enter label",
|
|
16
|
+
"inputError": "Please enter",
|
|
17
|
+
"selectError": "Please select",
|
|
18
|
+
"linkError": "Please enter a legal link"
|
|
19
|
+
},
|
|
20
|
+
"menu": {
|
|
21
|
+
"add": "Insert Link"
|
|
22
|
+
},
|
|
23
|
+
"message": {
|
|
24
|
+
"noSheet": "Target sheet has been delete",
|
|
25
|
+
"refError": "Invalid Range",
|
|
26
|
+
"hiddenSheet": "Cannot open the link because the linked sheet is hidden",
|
|
27
|
+
"coped": "Link copied to clipboard"
|
|
28
|
+
},
|
|
29
|
+
"popup": {
|
|
30
|
+
"copy": "Copy Link",
|
|
31
|
+
"edit": "Edit Link",
|
|
32
|
+
"cancel": "Cancel Link"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hyperLink": {
|
|
3
|
+
"form": {
|
|
4
|
+
"editTitle": "Edit Link",
|
|
5
|
+
"addTitle": "Insert Link",
|
|
6
|
+
"label": "Label",
|
|
7
|
+
"type": "Type",
|
|
8
|
+
"link": "Link",
|
|
9
|
+
"linkPlaceholder": "Enter link",
|
|
10
|
+
"range": "Range",
|
|
11
|
+
"worksheet": "Worksheet",
|
|
12
|
+
"definedName": "Defined Name",
|
|
13
|
+
"ok": "OK",
|
|
14
|
+
"cancel": "Cancel",
|
|
15
|
+
"labelPlaceholder": "Enter label",
|
|
16
|
+
"inputError": "Please enter",
|
|
17
|
+
"selectError": "Please select",
|
|
18
|
+
"linkError": "Please enter a legal link"
|
|
19
|
+
},
|
|
20
|
+
"menu": {
|
|
21
|
+
"add": "Insert Link"
|
|
22
|
+
},
|
|
23
|
+
"message": {
|
|
24
|
+
"noSheet": "Target sheet has been delete",
|
|
25
|
+
"refError": "Invalid Range",
|
|
26
|
+
"hiddenSheet": "Cannot open the link because the linked sheet is hidden",
|
|
27
|
+
"coped": "Link copied to clipboard"
|
|
28
|
+
},
|
|
29
|
+
"popup": {
|
|
30
|
+
"copy": "Copy Link",
|
|
31
|
+
"edit": "Edit Link",
|
|
32
|
+
"cancel": "Cancel Link"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hyperLink": {
|
|
3
|
+
"form": {
|
|
4
|
+
"editTitle": "编辑链接",
|
|
5
|
+
"addTitle": "插入链接",
|
|
6
|
+
"label": "文本",
|
|
7
|
+
"labelPlaceholder": "输入文本",
|
|
8
|
+
"type": "类型",
|
|
9
|
+
"link": "链接",
|
|
10
|
+
"linkPlaceholder": "输入链接地址",
|
|
11
|
+
"range": "单元格",
|
|
12
|
+
"worksheet": "工作表",
|
|
13
|
+
"definedName": "定义的名称",
|
|
14
|
+
"ok": "确认",
|
|
15
|
+
"cancel": "取消",
|
|
16
|
+
"inputError": "请输入",
|
|
17
|
+
"selectError": "请选择",
|
|
18
|
+
"linkError": "请输入合法的链接"
|
|
19
|
+
},
|
|
20
|
+
"menu": {
|
|
21
|
+
"add": "添加链接"
|
|
22
|
+
},
|
|
23
|
+
"message": {
|
|
24
|
+
"noSheet": "该子表已被删除",
|
|
25
|
+
"refError": "错误的引用",
|
|
26
|
+
"hiddenSheet": "无法打开被隐藏的子表",
|
|
27
|
+
"coped": "链接已被复制到剪贴板"
|
|
28
|
+
},
|
|
29
|
+
"popup": {
|
|
30
|
+
"copy": "复制",
|
|
31
|
+
"edit": "编辑",
|
|
32
|
+
"cancel": "取消链接"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
3
|
+
|
|
4
|
+
export interface IOpenHyperLinkSidebarOperationParams extends ISheetCommandSharedParams {
|
|
5
|
+
row: number;
|
|
6
|
+
column: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const OpenHyperLinkSidebarOperation: ICommand<IOpenHyperLinkSidebarOperationParams>;
|
|
9
|
+
export declare const CloseHyperLinkSidebarOperation: ICommand;
|
|
10
|
+
export declare const InsertHyperLinkOperation: ICommand;
|
|
11
|
+
export declare const InsertHyperLinkToolbarOperation: ICommand;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isLegalLink(link: string): boolean;
|
|
17
|
+
export declare function hasProtocol(urlString: string): boolean;
|
|
18
|
+
export declare function isEmail(url: string): boolean;
|
|
19
|
+
export declare function serializeUrl(url: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
3
|
+
import { IAutoFillService } from '@univerjs/sheets-ui';
|
|
4
|
+
|
|
5
|
+
export declare class SheetsHyperLinkAutoFillController extends Disposable {
|
|
6
|
+
private readonly _autoFillService;
|
|
7
|
+
private readonly _hyperLinkModel;
|
|
8
|
+
constructor(_autoFillService: IAutoFillService, _hyperLinkModel: HyperLinkModel);
|
|
9
|
+
private _initAutoFill;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
3
|
+
import { ISheetClipboardService } from '@univerjs/sheets-ui';
|
|
4
|
+
import { Injector } from '@wendellhu/redi';
|
|
5
|
+
import { SheetsHyperLinkResolverService } from '../services/resolver.service';
|
|
6
|
+
|
|
7
|
+
export declare class SheetsHyperLinkCopyPasteController extends Disposable {
|
|
8
|
+
private _sheetClipboardService;
|
|
9
|
+
private _hyperLinkModel;
|
|
10
|
+
private _injector;
|
|
11
|
+
private _resolverService;
|
|
12
|
+
private _copyInfo;
|
|
13
|
+
constructor(_sheetClipboardService: ISheetClipboardService, _hyperLinkModel: HyperLinkModel, _injector: Injector, _resolverService: SheetsHyperLinkResolverService);
|
|
14
|
+
private _initCopyPaste;
|
|
15
|
+
private _collect;
|
|
16
|
+
private _generateMutations;
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
|
|
3
|
+
|
|
4
|
+
export declare class SheetsHyperLinkPermissionController extends Disposable {
|
|
5
|
+
private _localeService;
|
|
6
|
+
private readonly _commandService;
|
|
7
|
+
private readonly _sheetPermissionInterceptorBaseController;
|
|
8
|
+
constructor(_localeService: LocaleService, _commandService: ICommandService, _sheetPermissionInterceptorBaseController: SheetPermissionInterceptorBaseController);
|
|
9
|
+
private _commandExecutedListener;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IMenuItem, IShortcutItem, MenuGroup, MenuItemType, MenuPosition } from '@univerjs/ui';
|
|
2
|
+
import { IAccessor } from '@wendellhu/redi';
|
|
3
|
+
|
|
4
|
+
export declare const insertLinkMenuFactory: (accessor: IAccessor) => IMenuItem;
|
|
5
|
+
export declare const insertLinkMenuToolbarFactory: (accessor: IAccessor) => {
|
|
6
|
+
tooltip: string;
|
|
7
|
+
positions: MenuPosition;
|
|
8
|
+
group: MenuGroup;
|
|
9
|
+
id: string;
|
|
10
|
+
type: MenuItemType;
|
|
11
|
+
icon: string;
|
|
12
|
+
hidden$: import('rxjs').Observable<boolean>;
|
|
13
|
+
disabled$: import('rxjs').Observable<boolean>;
|
|
14
|
+
};
|
|
15
|
+
export declare const InsertLinkShortcut: IShortcutItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { HoverManagerService } from '@univerjs/sheets-ui';
|
|
3
|
+
import { SheetsHyperLinkPopupService } from '../services/popup.service';
|
|
4
|
+
|
|
5
|
+
export declare class SheetsHyperLinkPopupController extends Disposable {
|
|
6
|
+
private readonly _hoverManagerService;
|
|
7
|
+
private readonly _sheetsHyperLinkPopupService;
|
|
8
|
+
constructor(_hoverManagerService: HoverManagerService, _sheetsHyperLinkPopupService: SheetsHyperLinkPopupService);
|
|
9
|
+
private _initHoverListener;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { RefRangeService } from '@univerjs/sheets';
|
|
3
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
4
|
+
import { SheetsHyperLinkResolverService } from '../services/resolver.service';
|
|
5
|
+
|
|
6
|
+
export declare class SheetsHyperLinkRefRangeController extends Disposable {
|
|
7
|
+
private readonly _refRangeService;
|
|
8
|
+
private readonly _hyperLinkModel;
|
|
9
|
+
private readonly _resolverService;
|
|
10
|
+
private readonly _univerInstanceService;
|
|
11
|
+
private _disposableMap;
|
|
12
|
+
private _rangeDisableMap;
|
|
13
|
+
constructor(_refRangeService: RefRangeService, _hyperLinkModel: HyperLinkModel, _resolverService: SheetsHyperLinkResolverService, _univerInstanceService: IUniverInstanceService);
|
|
14
|
+
private _register;
|
|
15
|
+
private _unregister;
|
|
16
|
+
private _registerRange;
|
|
17
|
+
private _unregisterRange;
|
|
18
|
+
private _initData;
|
|
19
|
+
private _initRefRange;
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
4
|
+
|
|
5
|
+
export declare class SheetsHyperLinkRemoveSheetController extends Disposable {
|
|
6
|
+
private _sheetInterceptorService;
|
|
7
|
+
private _univerInstanceService;
|
|
8
|
+
private _hyperLinkModel;
|
|
9
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _hyperLinkModel: HyperLinkModel);
|
|
10
|
+
private _initSheetChange;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService, ThemeService } from '@univerjs/core';
|
|
2
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
4
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
5
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
6
|
+
|
|
7
|
+
export declare class SheetsHyperLinkRenderController extends Disposable {
|
|
8
|
+
private readonly _sheetInterceptorService;
|
|
9
|
+
private readonly _hyperLinkModel;
|
|
10
|
+
private readonly _univerInstanceService;
|
|
11
|
+
private readonly _sheetSkeletonManagerService;
|
|
12
|
+
private readonly _renderManagerService;
|
|
13
|
+
private readonly _themeService;
|
|
14
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _hyperLinkModel: HyperLinkModel, _univerInstanceService: IUniverInstanceService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _renderManagerService: IRenderManagerService, _themeService: ThemeService);
|
|
15
|
+
private _initViewModelIntercept;
|
|
16
|
+
private _initSkeletonChange;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { Injector } from '@wendellhu/redi';
|
|
3
|
+
import { SelectionManagerService, SheetInterceptorService } from '@univerjs/sheets';
|
|
4
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
5
|
+
|
|
6
|
+
export declare class SheetHyperLinkSetRangeController extends Disposable {
|
|
7
|
+
private readonly _sheetInterceptorService;
|
|
8
|
+
private readonly _injector;
|
|
9
|
+
private readonly _hyperLinkModel;
|
|
10
|
+
private readonly _selectionManagerService;
|
|
11
|
+
private readonly _univerInstanceService;
|
|
12
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _injector: Injector, _hyperLinkModel: HyperLinkModel, _selectionManagerService: SelectionManagerService, _univerInstanceService: IUniverInstanceService);
|
|
13
|
+
private _initCommandInterceptor;
|
|
14
|
+
private _initAddHyperLinkCommandInterceptor;
|
|
15
|
+
private _initUpdateHyperLinkCommandInterceptor;
|
|
16
|
+
private _initSetRangeValuesCommandInterceptor;
|
|
17
|
+
private _initClearSelectionCommandInterceptor;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { MenuConfig, ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
|
|
3
|
+
import { Injector } from '@wendellhu/redi';
|
|
4
|
+
|
|
5
|
+
export interface IUniverSheetsHyperLinkUIConfig {
|
|
6
|
+
menu?: MenuConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare class SheetsHyperLinkUIController extends Disposable {
|
|
9
|
+
private _config;
|
|
10
|
+
private _componentManager;
|
|
11
|
+
private _commandService;
|
|
12
|
+
private _localeService;
|
|
13
|
+
private _menuService;
|
|
14
|
+
private _injector;
|
|
15
|
+
private _shortcutService;
|
|
16
|
+
constructor(_config: IUniverSheetsHyperLinkUIConfig | undefined, _componentManager: ComponentManager, _commandService: ICommandService, _localeService: LocaleService, _menuService: IMenuService, _injector: Injector, _shortcutService: IShortcutService);
|
|
17
|
+
private _initComponents;
|
|
18
|
+
private _initCommands;
|
|
19
|
+
private _initMenus;
|
|
20
|
+
private _initShortCut;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { SheetsHyperLinkResolverService } from '../services/resolver.service';
|
|
3
|
+
|
|
4
|
+
export declare class SheetHyperLinkUrlController extends Disposable {
|
|
5
|
+
private _resolverService;
|
|
6
|
+
constructor(_resolverService: SheetsHyperLinkResolverService);
|
|
7
|
+
private _handleInitUrl;
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { SheetsHyperLinkRemoveSheetController } from './controllers/remove-sheet.controller';
|
|
17
|
+
export { SheetsHyperLinkRefRangeController } from './controllers/ref-range.controller';
|
|
18
|
+
export { SheetsHyperLinkRenderController } from './controllers/render-controllers/render.controller';
|
|
19
|
+
export { SheetsHyperLinkPopupService } from './services/popup.service';
|
|
20
|
+
export { SheetsHyperLinkResolverService } from './services/resolver.service';
|
|
21
|
+
export { SheetHyperLinkSetRangeController } from './controllers/set-range.controller';
|
|
22
|
+
export { SheetsHyperLinkPopupController } from './controllers/popup.controller';
|
|
23
|
+
export { SheetsHyperLinkUIController } from './controllers/ui.controller';
|
|
24
|
+
export { SheetsHyperLinkAutoFillController } from './controllers/auto-fill.controller';
|
|
25
|
+
export { SheetsHyperLinkCopyPasteController } from './controllers/copy-paste.controller';
|
|
26
|
+
export { SheetHyperLinkUrlController } from './controllers/url.controller';
|
|
27
|
+
export { UniverSheetsHyperLinkUIPlugin } from './plugin';
|
|
28
|
+
export { OpenHyperLinkSidebarOperation, InsertHyperLinkOperation, CloseHyperLinkSidebarOperation } from './commands/operations/sidebar.operations';
|
|
29
|
+
export type { IOpenHyperLinkSidebarOperationParams } from './commands/operations/sidebar.operations';
|
|
30
|
+
export { InsertLinkShortcut } from './controllers/menu';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
declare const _default: {
|
|
17
|
+
hyperLink: {
|
|
18
|
+
form: {
|
|
19
|
+
editTitle: string;
|
|
20
|
+
addTitle: string;
|
|
21
|
+
label: string;
|
|
22
|
+
labelPlaceholder: string;
|
|
23
|
+
type: string;
|
|
24
|
+
link: string;
|
|
25
|
+
linkPlaceholder: string;
|
|
26
|
+
range: string;
|
|
27
|
+
worksheet: string;
|
|
28
|
+
definedName: string;
|
|
29
|
+
ok: string;
|
|
30
|
+
cancel: string;
|
|
31
|
+
inputError: string;
|
|
32
|
+
selectError: string;
|
|
33
|
+
linkError: string;
|
|
34
|
+
};
|
|
35
|
+
menu: {
|
|
36
|
+
add: string;
|
|
37
|
+
};
|
|
38
|
+
message: {
|
|
39
|
+
noSheet: string;
|
|
40
|
+
refError: string;
|
|
41
|
+
hiddenSheet: string;
|
|
42
|
+
coped: string;
|
|
43
|
+
};
|
|
44
|
+
popup: {
|
|
45
|
+
copy: string;
|
|
46
|
+
edit: string;
|
|
47
|
+
cancel: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Injector } from '@wendellhu/redi';
|
|
2
|
+
import { UniverInstanceType } from '@univerjs/core';
|
|
3
|
+
import { UniverSheetsHyperLinkPlugin } from '@univerjs/sheets-hyper-link';
|
|
4
|
+
import { IUniverSheetsHyperLinkUIConfig } from './controllers/ui.controller';
|
|
5
|
+
|
|
6
|
+
export declare class UniverSheetsHyperLinkUIPlugin extends UniverSheetsHyperLinkPlugin {
|
|
7
|
+
private _config;
|
|
8
|
+
protected _injector: Injector;
|
|
9
|
+
static pluginName: string;
|
|
10
|
+
static type: UniverInstanceType;
|
|
11
|
+
constructor(_config: IUniverSheetsHyperLinkUIConfig, _injector: Injector);
|
|
12
|
+
onStarting(injector: Injector): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
2
|
+
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
3
|
+
import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
4
|
+
import { IDisposable } from '@wendellhu/redi';
|
|
5
|
+
|
|
6
|
+
interface IHyperLinkPopup {
|
|
7
|
+
unitId: string;
|
|
8
|
+
subUnitId: string;
|
|
9
|
+
id: string;
|
|
10
|
+
disposable?: IDisposable;
|
|
11
|
+
}
|
|
12
|
+
interface IHyperLinkEditing {
|
|
13
|
+
unitId: string;
|
|
14
|
+
subUnitId: string;
|
|
15
|
+
row: number;
|
|
16
|
+
column: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class SheetsHyperLinkPopupService {
|
|
19
|
+
private readonly _hyperLinkModel;
|
|
20
|
+
private readonly _sheetCanvasPopManagerService;
|
|
21
|
+
private _currentPopup;
|
|
22
|
+
private _currentPopup$;
|
|
23
|
+
currentPopup$: import('rxjs').Observable<IHyperLinkPopup | null>;
|
|
24
|
+
private _currentEditing$;
|
|
25
|
+
currentEditing$: import('rxjs').Observable<IHyperLinkEditing | null>;
|
|
26
|
+
get currentPopup(): IHyperLinkPopup | null;
|
|
27
|
+
get currentEditing(): IHyperLinkEditing | null;
|
|
28
|
+
constructor(_hyperLinkModel: HyperLinkModel, _sheetCanvasPopManagerService: SheetCanvasPopManagerService);
|
|
29
|
+
showPopup(location: ISheetLocationBase): void;
|
|
30
|
+
hideCurrentPopup(): void;
|
|
31
|
+
startEditing(link: IHyperLinkEditing): void;
|
|
32
|
+
endEditing(): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IRange, ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { IDefinedNamesService } from '@univerjs/engine-formula';
|
|
3
|
+
import { IMessageService } from '@univerjs/ui';
|
|
4
|
+
|
|
5
|
+
interface ISheetUrlParams {
|
|
6
|
+
gid?: string;
|
|
7
|
+
range?: string;
|
|
8
|
+
rangeid?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class SheetsHyperLinkResolverService {
|
|
11
|
+
private _univerInstanceService;
|
|
12
|
+
private _commandService;
|
|
13
|
+
private _definedNamesService;
|
|
14
|
+
private _messageService;
|
|
15
|
+
private _localeService;
|
|
16
|
+
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _definedNamesService: IDefinedNamesService, _messageService: IMessageService, _localeService: LocaleService);
|
|
17
|
+
private _getURLName;
|
|
18
|
+
navigateTo(params: ISheetUrlParams): void;
|
|
19
|
+
parseHyperLink(urlStr: string): {
|
|
20
|
+
readonly type: "link" | "range" | "sheet" | "range-error" | "defineName" | "sheet-error";
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly url: string;
|
|
23
|
+
readonly searchObj: ISheetUrlParams;
|
|
24
|
+
readonly handler: () => void;
|
|
25
|
+
} | {
|
|
26
|
+
readonly type: "outer";
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly url: string;
|
|
29
|
+
readonly handler: () => void;
|
|
30
|
+
readonly searchObj?: undefined;
|
|
31
|
+
};
|
|
32
|
+
navigateToRange(unitId: string, subUnitId: string, range: IRange): Promise<void>;
|
|
33
|
+
navigateToSheet(unitId: string, sheetName: string): Promise<boolean | undefined>;
|
|
34
|
+
navigateToSheetById(unitId: string, subUnitId: string): Promise<false | import('@univerjs/core').Worksheet>;
|
|
35
|
+
navigateToDefineName(unitId: string, rangeid: string): Promise<boolean>;
|
|
36
|
+
navigateToOtherWebsite(url: string): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SHEETS_HYPER_LINK_UI_PLUGIN = "SHEETS_HYPER_LINK_UI_PLUGIN";
|
|
17
|
+
export declare const ERROR_RANGE = "err";
|