@univerjs/sheets-hyper-link-ui 0.2.12 → 0.2.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/lib/cjs/index.js +2 -2
- package/lib/es/index.js +1460 -766
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/add-hyper-link.command.d.ts +9 -1
- package/lib/types/commands/commands/remove-hyper-link.command.d.ts +11 -3
- package/lib/types/commands/commands/update-hyper-link.command.d.ts +9 -1
- package/lib/types/commands/operations/popup.operations.d.ts +13 -0
- package/lib/types/controllers/menu.d.ts +21 -3
- package/lib/types/controllers/popup.controller.d.ts +13 -3
- package/lib/types/controllers/rich-text-ref-range.controller.d.ts +15 -0
- package/lib/types/controllers/set-range.controller.d.ts +5 -7
- package/lib/types/index.d.ts +9 -8
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/popup.service.d.ts +47 -19
- package/lib/types/services/resolver.service.d.ts +5 -26
- package/lib/types/services/side-panel.service.d.ts +4 -10
- package/lib/types/types/enums/edit-source.d.ts +20 -0
- package/lib/types/types/enums/index.d.ts +16 -0
- package/lib/types/types/interfaces/i-sheet-hyper-link-info.d.ts +10 -0
- package/lib/types/types/interfaces/i-sheet-url-params.d.ts +21 -0
- package/lib/types/types/interfaces/index.d.ts +17 -0
- package/lib/types/views/CellLinkEdit/index.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +26 -23
- package/lib/types/commands/operations/sidebar.operations.d.ts +0 -10
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-cell-link
|
|
1
|
+
.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}.univer-cell-link-edit{padding:16px;background-color:rgb(var(--color-white));width:296px;box-sizing:border-box;border-radius:var(--border-radius-xl);border:1px solid rgb(var(--grey-200));box-shadow:0 4px 10px -1px #1116281a}.univer-cell-link-edit-buttons{display:flex;flex-direction:row;justify-content:flex-end}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICommand } from '@univerjs/core';
|
|
2
1
|
import { ICellHyperLink } from '@univerjs/sheets-hyper-link';
|
|
2
|
+
import { ICommand } from '@univerjs/core';
|
|
3
3
|
export interface IAddHyperLinkCommandParams {
|
|
4
4
|
unitId: string;
|
|
5
5
|
subUnitId: string;
|
|
@@ -9,3 +9,11 @@ export interface IAddHyperLinkCommandParams {
|
|
|
9
9
|
* Command for add hyperlink
|
|
10
10
|
*/
|
|
11
11
|
export declare const AddHyperLinkCommand: ICommand<IAddHyperLinkCommandParams>;
|
|
12
|
+
export interface IAddRichHyperLinkCommandParams {
|
|
13
|
+
/**
|
|
14
|
+
* url of link
|
|
15
|
+
*/
|
|
16
|
+
documentId: string;
|
|
17
|
+
link: ICellHyperLink;
|
|
18
|
+
}
|
|
19
|
+
export declare const AddRichHyperLinkCommand: ICommand<IAddRichHyperLinkCommandParams>;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { ICommand } from '@univerjs/core';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ICancelHyperLinkCommandParams {
|
|
3
3
|
unitId: string;
|
|
4
4
|
subUnitId: string;
|
|
5
5
|
/**
|
|
6
6
|
* id of link
|
|
7
7
|
*/
|
|
8
8
|
id: string;
|
|
9
|
+
row: number;
|
|
10
|
+
column: number;
|
|
9
11
|
}
|
|
10
|
-
export declare const
|
|
11
|
-
export
|
|
12
|
+
export declare const CancelHyperLinkCommand: ICommand<ICancelHyperLinkCommandParams>;
|
|
13
|
+
export interface ICancelRichHyperLinkCommandParams extends ICancelHyperLinkCommandParams {
|
|
14
|
+
/**
|
|
15
|
+
* document id
|
|
16
|
+
*/
|
|
17
|
+
documentId: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const CancelRichHyperLinkCommand: ICommand<ICancelRichHyperLinkCommandParams>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { ICommand } from '@univerjs/core';
|
|
2
1
|
import { ICellLinkContent } from '@univerjs/sheets-hyper-link';
|
|
2
|
+
import { ICommand } from '@univerjs/core';
|
|
3
3
|
export interface IUpdateHyperLinkCommandParams {
|
|
4
4
|
unitId: string;
|
|
5
5
|
subUnitId: string;
|
|
6
6
|
id: string;
|
|
7
7
|
payload: ICellLinkContent;
|
|
8
|
+
row: number;
|
|
9
|
+
column: number;
|
|
8
10
|
}
|
|
9
11
|
export declare const UpdateHyperLinkCommand: ICommand<IUpdateHyperLinkCommandParams>;
|
|
12
|
+
export interface IUpdateRichHyperLinkCommandParams {
|
|
13
|
+
documentId: string;
|
|
14
|
+
id: string;
|
|
15
|
+
payload: ICellLinkContent;
|
|
16
|
+
}
|
|
17
|
+
export declare const UpdateRichHyperLinkCommand: ICommand<IUpdateRichHyperLinkCommandParams>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
3
|
+
import { HyperLinkEditSourceType } from '../../types/enums/edit-source';
|
|
4
|
+
export interface IOpenHyperLinkEditPanelOperationParams extends ISheetCommandSharedParams {
|
|
5
|
+
row: number;
|
|
6
|
+
col: number;
|
|
7
|
+
customRangeId?: string;
|
|
8
|
+
type: HyperLinkEditSourceType;
|
|
9
|
+
}
|
|
10
|
+
export declare const OpenHyperLinkEditPanelOperation: ICommand<IOpenHyperLinkEditPanelOperationParams>;
|
|
11
|
+
export declare const CloseHyperLinkPopupOperation: ICommand;
|
|
12
|
+
export declare const InsertHyperLinkOperation: ICommand;
|
|
13
|
+
export declare const InsertHyperLinkToolbarOperation: ICommand;
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
import { IMenuItem, IShortcutItem, MenuItemType } from '@univerjs/ui';
|
|
1
|
+
import { IMenuItem, IShortcutItem, MenuGroup, MenuItemType, MenuPosition } from '@univerjs/ui';
|
|
2
2
|
import { IAccessor } from '@univerjs/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
export declare const shouldDisableAddLink: (accessor: IAccessor) => boolean;
|
|
5
|
+
export declare const genZenEditorMenuId: (id: string) => string;
|
|
3
6
|
export declare const insertLinkMenuFactory: (accessor: IAccessor) => IMenuItem;
|
|
7
|
+
export declare const zenEditorInsertLinkMenuFactory: (accessor: IAccessor) => IMenuItem;
|
|
4
8
|
export declare const insertLinkMenuToolbarFactory: (accessor: IAccessor) => {
|
|
9
|
+
id: string;
|
|
10
|
+
hidden$: Observable<boolean>;
|
|
11
|
+
disabled$: Observable<boolean>;
|
|
5
12
|
tooltip: string;
|
|
13
|
+
positions: MenuPosition;
|
|
14
|
+
group: MenuGroup;
|
|
15
|
+
commandId: string;
|
|
16
|
+
type: MenuItemType;
|
|
17
|
+
icon: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const zenEditorInsertLinkMenuToolbarFactory: (accessor: IAccessor) => {
|
|
6
20
|
id: string;
|
|
21
|
+
hidden$: Observable<boolean>;
|
|
22
|
+
disabled$: Observable<boolean>;
|
|
23
|
+
tooltip: string;
|
|
24
|
+
positions: MenuPosition;
|
|
25
|
+
group: MenuGroup;
|
|
26
|
+
commandId: string;
|
|
7
27
|
type: MenuItemType;
|
|
8
28
|
icon: string;
|
|
9
|
-
hidden$: import('rxjs').Observable<boolean>;
|
|
10
|
-
disabled$: import('rxjs').Observable<boolean>;
|
|
11
29
|
};
|
|
12
30
|
export declare const InsertLinkShortcut: IShortcutItem;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Disposable, ICommandService, IPermissionService } from '@univerjs/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Disposable, ICommandService, IPermissionService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
3
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
|
+
import { HoverManagerService, IEditorBridgeService, SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
|
|
5
|
+
import { IZenZoneService } from '@univerjs/ui';
|
|
4
6
|
import { SheetsHyperLinkPopupService } from '../services/popup.service';
|
|
5
7
|
export declare class SheetsHyperLinkPopupController extends Disposable {
|
|
6
8
|
private readonly _hoverManagerService;
|
|
@@ -9,7 +11,15 @@ export declare class SheetsHyperLinkPopupController extends Disposable {
|
|
|
9
11
|
private readonly _permissionService;
|
|
10
12
|
private readonly _sheetPermissionInterceptorBaseController;
|
|
11
13
|
private readonly _commandService;
|
|
12
|
-
|
|
14
|
+
private readonly _editorBridgeService;
|
|
15
|
+
private readonly _textSelectionManagerService;
|
|
16
|
+
private readonly _univerInstanceService;
|
|
17
|
+
private readonly _zenZoneService;
|
|
18
|
+
constructor(_hoverManagerService: HoverManagerService, _sheetsHyperLinkPopupService: SheetsHyperLinkPopupService, _renderManagerService: IRenderManagerService, _permissionService: IPermissionService, _sheetPermissionInterceptorBaseController: SheetPermissionInterceptorBaseController, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _textSelectionManagerService: DocSelectionManagerService, _univerInstanceService: IUniverInstanceService, _zenZoneService: IZenZoneService);
|
|
19
|
+
private _getLinkPermission;
|
|
13
20
|
private _initHoverListener;
|
|
21
|
+
private _initHoverEditingListener;
|
|
22
|
+
private _initZenEditor;
|
|
23
|
+
private _initTextSelectionListener;
|
|
14
24
|
private _initCommandListener;
|
|
15
25
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { RefRangeService } from '@univerjs/sheets';
|
|
3
|
+
export declare class SheetsHyperLinkRichTextRefRangeController extends Disposable {
|
|
4
|
+
private readonly _commandService;
|
|
5
|
+
private readonly _univerInstanceService;
|
|
6
|
+
private readonly _refRangeService;
|
|
7
|
+
private _refRangeMap;
|
|
8
|
+
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _refRangeService: RefRangeService);
|
|
9
|
+
private _enusreMap;
|
|
10
|
+
private _isLegalRangeUrl;
|
|
11
|
+
private _registerRange;
|
|
12
|
+
private _initWorkbookLoad;
|
|
13
|
+
private _initWorkbookUnload;
|
|
14
|
+
private _initSetRangesListener;
|
|
15
|
+
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { Disposable,
|
|
1
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
2
3
|
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
3
4
|
import { HyperLinkModel } from '@univerjs/sheets-hyper-link';
|
|
4
5
|
import { IEditorBridgeService } from '@univerjs/sheets-ui';
|
|
5
6
|
export declare class SheetHyperLinkSetRangeController extends Disposable {
|
|
6
7
|
private readonly _sheetInterceptorService;
|
|
7
|
-
private readonly _injector;
|
|
8
8
|
private readonly _hyperLinkModel;
|
|
9
9
|
private readonly _selectionManagerService;
|
|
10
10
|
private readonly _univerInstanceService;
|
|
11
11
|
private readonly _editorBridgeService;
|
|
12
|
-
|
|
12
|
+
private readonly _renderManagerService;
|
|
13
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _hyperLinkModel: HyperLinkModel, _selectionManagerService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _editorBridgeService: IEditorBridgeService, _renderManagerService: IRenderManagerService);
|
|
13
14
|
private _initCommandInterceptor;
|
|
14
|
-
private _getCurrentCell;
|
|
15
|
-
private _initAddHyperLinkCommandInterceptor;
|
|
16
|
-
private _initUpdateHyperLinkCommandInterceptor;
|
|
17
15
|
private _initSetRangeValuesCommandInterceptor;
|
|
18
16
|
private _initClearSelectionCommandInterceptor;
|
|
19
|
-
private
|
|
17
|
+
private _initAfterEditor;
|
|
20
18
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
16
|
+
export { AddHyperLinkCommand, type IAddHyperLinkCommandParams } from './commands/commands/add-hyper-link.command';
|
|
17
|
+
export { CancelHyperLinkCommand, type ICancelHyperLinkCommandParams } from './commands/commands/remove-hyper-link.command';
|
|
18
|
+
export { type IUpdateHyperLinkCommandParams, UpdateHyperLinkCommand } from './commands/commands/update-hyper-link.command';
|
|
19
|
+
export { CloseHyperLinkPopupOperation, InsertHyperLinkOperation, type IOpenHyperLinkEditPanelOperationParams, OpenHyperLinkEditPanelOperation, } from './commands/operations/popup.operations';
|
|
19
20
|
export { SheetsHyperLinkCopyPasteController } from './controllers/copy-paste.controller';
|
|
20
|
-
export { UniverSheetsHyperLinkUIPlugin } from './plugin';
|
|
21
21
|
export { InsertLinkShortcut } from './controllers/menu';
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
22
|
+
export { UniverSheetsHyperLinkUIPlugin } from './plugin';
|
|
23
|
+
export { SheetsHyperLinkPopupService } from './services/popup.service';
|
|
24
|
+
export { SheetsHyperLinkResolverService } from './services/resolver.service';
|
|
25
|
+
export { type ICustomHyperLinkView, SheetsHyperLinkSidePanelService } from './services/side-panel.service';
|
|
26
|
+
export type { ISheetHyperLinkInfo, ISheetUrlParams } from './types/interfaces';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare class UniverSheetsHyperLinkUIPlugin extends Plugin {
|
|
|
8
8
|
private readonly _configService;
|
|
9
9
|
static pluginName: string;
|
|
10
10
|
static type: UniverInstanceType;
|
|
11
|
-
constructor(_config: Partial<IUniverSheetsHyperLinkUIConfig
|
|
11
|
+
constructor(_config: Partial<IUniverSheetsHyperLinkUIConfig> | undefined, _injector: Injector, _renderManagerService: IRenderManagerService, _configService: IConfigService);
|
|
12
12
|
onStarting(): void;
|
|
13
13
|
onReady(): void;
|
|
14
14
|
}
|
|
@@ -1,40 +1,68 @@
|
|
|
1
1
|
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { IEditorBridgeService, SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
3
|
+
import { ICustomRange, INeedCheckDisposable, Nullable, Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
4
|
+
import { IBoundRectNoAngle } from '@univerjs/engine-render';
|
|
5
|
+
import { DocCanvasPopManagerService } from '@univerjs/docs-ui';
|
|
6
|
+
import { IEditorService, IRangeSelectorService, IZenZoneService } from '@univerjs/ui';
|
|
7
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
8
|
+
import { HyperLinkEditSourceType } from '../types/enums/edit-source';
|
|
5
9
|
export interface IHyperLinkPopup {
|
|
6
10
|
unitId: string;
|
|
7
11
|
subUnitId: string;
|
|
8
|
-
|
|
9
|
-
disposable?: IDisposable;
|
|
12
|
+
disposable: INeedCheckDisposable;
|
|
10
13
|
row: number;
|
|
11
14
|
col: number;
|
|
12
|
-
editPermission
|
|
13
|
-
copyPermission
|
|
15
|
+
editPermission?: boolean;
|
|
16
|
+
copyPermission?: boolean;
|
|
17
|
+
customRange?: ICustomRange;
|
|
18
|
+
type: HyperLinkEditSourceType;
|
|
14
19
|
}
|
|
15
20
|
interface IHyperLinkEditing {
|
|
16
21
|
unitId: string;
|
|
17
22
|
subUnitId: string;
|
|
18
23
|
row: number;
|
|
19
|
-
|
|
24
|
+
col: number;
|
|
25
|
+
customRangeId?: string;
|
|
26
|
+
type: HyperLinkEditSourceType;
|
|
27
|
+
}
|
|
28
|
+
interface IHyperLinkPopupOptions extends ISheetLocationBase {
|
|
29
|
+
editPermission?: boolean;
|
|
30
|
+
copyPermission?: boolean;
|
|
31
|
+
customRange?: Nullable<ICustomRange>;
|
|
32
|
+
customRangeRect?: Nullable<IBoundRectNoAngle>;
|
|
33
|
+
type: HyperLinkEditSourceType;
|
|
20
34
|
}
|
|
21
35
|
export declare class SheetsHyperLinkPopupService extends Disposable {
|
|
22
|
-
private readonly _hyperLinkModel;
|
|
23
36
|
private readonly _sheetCanvasPopManagerService;
|
|
37
|
+
private readonly _injector;
|
|
38
|
+
private readonly _univerInstanceService;
|
|
39
|
+
private readonly _editorBridgeService;
|
|
40
|
+
private readonly _textSelectionManagerService;
|
|
41
|
+
private readonly _docCanvasPopManagerService;
|
|
42
|
+
private readonly _editorService;
|
|
43
|
+
private readonly _rangeSelectorService;
|
|
44
|
+
private readonly _zenZoneService;
|
|
24
45
|
private _currentPopup;
|
|
25
46
|
private _currentPopup$;
|
|
26
47
|
currentPopup$: import('rxjs').Observable<IHyperLinkPopup | null>;
|
|
48
|
+
private _currentEditingPopup;
|
|
27
49
|
private _currentEditing$;
|
|
28
|
-
currentEditing$: import('rxjs').Observable<IHyperLinkEditing
|
|
50
|
+
currentEditing$: import('rxjs').Observable<(IHyperLinkEditing & {
|
|
51
|
+
customRange?: ICustomRange;
|
|
52
|
+
label?: string;
|
|
53
|
+
}) | null>;
|
|
29
54
|
get currentPopup(): IHyperLinkPopup | null;
|
|
30
|
-
get currentEditing(): IHyperLinkEditing
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
hideCurrentPopup(): void;
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
get currentEditing(): (IHyperLinkEditing & {
|
|
56
|
+
customRange?: ICustomRange;
|
|
57
|
+
label?: string;
|
|
58
|
+
}) | null;
|
|
59
|
+
constructor(_sheetCanvasPopManagerService: SheetCanvasPopManagerService, _injector: Injector, _univerInstanceService: IUniverInstanceService, _editorBridgeService: IEditorBridgeService, _textSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _editorService: IEditorService, _rangeSelectorService: IRangeSelectorService, _zenZoneService: IZenZoneService);
|
|
60
|
+
showPopup(location: IHyperLinkPopupOptions): void;
|
|
61
|
+
hideCurrentPopup(type?: HyperLinkEditSourceType, force?: boolean): void;
|
|
62
|
+
private _getEditingRange;
|
|
63
|
+
private get _editPopup();
|
|
64
|
+
startAddEditing(link: IHyperLinkEditing): void;
|
|
65
|
+
startEditing(link: Required<IHyperLinkEditing>): void;
|
|
66
|
+
endEditing(type?: HyperLinkEditSourceType): void;
|
|
39
67
|
}
|
|
40
68
|
export {};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICommandService, IConfigService, IUniverInstanceService, LocaleService, IRange, Worksheet } from '@univerjs/core';
|
|
2
2
|
import { IDefinedNamesService } from '@univerjs/engine-formula';
|
|
3
3
|
import { IMessageService } from '@univerjs/ui';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
range?: string;
|
|
7
|
-
rangeid?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface IHyperLinkInfo<T extends string> {
|
|
10
|
-
type: T;
|
|
11
|
-
name: string;
|
|
12
|
-
url: string;
|
|
13
|
-
handler: () => void;
|
|
14
|
-
}
|
|
4
|
+
import { ISheetHyperLinkInfo } from '../types/interfaces/i-sheet-hyper-link-info';
|
|
5
|
+
import { ISheetUrlParams } from '../types/interfaces/i-sheet-url-params';
|
|
15
6
|
export declare class SheetsHyperLinkResolverService {
|
|
16
7
|
private _univerInstanceService;
|
|
17
8
|
private _commandService;
|
|
@@ -22,23 +13,11 @@ export declare class SheetsHyperLinkResolverService {
|
|
|
22
13
|
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _definedNamesService: IDefinedNamesService, _messageService: IMessageService, _localeService: LocaleService, _configService: IConfigService);
|
|
23
14
|
private _getURLName;
|
|
24
15
|
navigateTo(params: ISheetUrlParams): void;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly name: string;
|
|
28
|
-
readonly url: string;
|
|
29
|
-
readonly searchObj: ISheetUrlParams;
|
|
30
|
-
readonly handler: () => void;
|
|
31
|
-
} | {
|
|
32
|
-
readonly type: "outer";
|
|
33
|
-
readonly name: string;
|
|
34
|
-
readonly url: string;
|
|
35
|
-
readonly handler: () => void;
|
|
36
|
-
readonly searchObj?: undefined;
|
|
37
|
-
};
|
|
16
|
+
buildHyperLink(unitId: string, sheetId: string, range?: string | IRange): string;
|
|
17
|
+
parseHyperLink(urlStr: string): ISheetHyperLinkInfo;
|
|
38
18
|
navigateToRange(unitId: string, subUnitId: string, range: IRange): Promise<void>;
|
|
39
19
|
navigateToSheet(unitId: string, sheetName: string): Promise<boolean | undefined>;
|
|
40
20
|
navigateToSheetById(unitId: string, subUnitId: string): Promise<false | Worksheet>;
|
|
41
21
|
navigateToDefineName(unitId: string, rangeid: string): Promise<boolean>;
|
|
42
22
|
navigateToOtherWebsite(url: string): Promise<void>;
|
|
43
23
|
}
|
|
44
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Disposable } from '@univerjs/core';
|
|
2
|
-
import { ICellHyperLink } from '@univerjs/sheets-hyper-link';
|
|
2
|
+
import { ICellHyperLink, SheetHyperLinkType } from '@univerjs/sheets-hyper-link';
|
|
3
3
|
import { default as React } from 'react';
|
|
4
|
-
export interface
|
|
4
|
+
export interface ICustomHyperLinkFormProps {
|
|
5
5
|
linkId: string;
|
|
6
6
|
payload: string;
|
|
7
7
|
display: string;
|
|
@@ -16,7 +16,7 @@ export interface ICustomHyperLinkView {
|
|
|
16
16
|
label: string;
|
|
17
17
|
value: string;
|
|
18
18
|
};
|
|
19
|
-
Form: React.FC<
|
|
19
|
+
Form: React.FC<ICustomHyperLinkFormProps>;
|
|
20
20
|
convert: (link: ICellHyperLink) => {
|
|
21
21
|
display: string;
|
|
22
22
|
payload: string;
|
|
@@ -24,15 +24,9 @@ export interface ICustomHyperLinkView {
|
|
|
24
24
|
};
|
|
25
25
|
match: (link: ICellHyperLink) => boolean;
|
|
26
26
|
}
|
|
27
|
-
export declare enum LinkType {
|
|
28
|
-
link = "link",
|
|
29
|
-
range = "range",
|
|
30
|
-
sheet = "gid",
|
|
31
|
-
definedName = "rangeid"
|
|
32
|
-
}
|
|
33
27
|
export declare class SheetsHyperLinkSidePanelService extends Disposable {
|
|
34
28
|
private _customHyperLinks;
|
|
35
|
-
isBuiltInLinkType(type: string): boolean;
|
|
29
|
+
isBuiltInLinkType(type: SheetHyperLinkType | string): boolean;
|
|
36
30
|
getOptions(): {
|
|
37
31
|
label: string;
|
|
38
32
|
value: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 enum HyperLinkEditSourceType {
|
|
17
|
+
EDITING = "editing",
|
|
18
|
+
VIEWING = "viewing",
|
|
19
|
+
ZEN_EDITOR = "zen_mode"
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { HyperLinkEditSourceType } from './edit-source';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { SheetHyperLinkType } from '@univerjs/sheets-hyper-link';
|
|
3
|
+
import { ISheetUrlParams } from './i-sheet-url-params';
|
|
4
|
+
export interface ISheetHyperLinkInfo {
|
|
5
|
+
type: SheetHyperLinkType;
|
|
6
|
+
name: string;
|
|
7
|
+
url: string;
|
|
8
|
+
searchObj: Nullable<ISheetUrlParams>;
|
|
9
|
+
handler: () => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 interface ISheetUrlParams {
|
|
17
|
+
gid?: string;
|
|
18
|
+
range?: string;
|
|
19
|
+
rangeid?: string;
|
|
20
|
+
unitid?: string;
|
|
21
|
+
}
|
|
@@ -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 type { ISheetHyperLinkInfo } from './i-sheet-hyper-link-info';
|
|
17
|
+
export type { ISheetUrlParams } from './i-sheet-url-params';
|