vue-devui 1.5.9 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,17 @@
1
1
  import type { SetupContext, Ref } from 'vue';
2
- import type { LineSide } from '../code-review-types';
3
- export declare function useCodeReviewComment(reviewContentRef: Ref<HTMLElement>, ctx: SetupContext): {
2
+ import type { LineSide, CodeReviewProps } from '../code-review-types';
3
+ export declare function useCodeReviewComment(reviewContentRef: Ref<HTMLElement>, props: CodeReviewProps, ctx: SetupContext): {
4
4
  commentLeft: Ref<number>;
5
5
  commentTop: Ref<number>;
6
- onMouseEnter: (e: MouseEvent) => void;
7
- onMouseMove: (e: MouseEvent) => void;
8
- onMouseleave: (e: MouseEvent) => void;
6
+ mouseEvent: {
7
+ onMousemove: (e: MouseEvent) => void;
8
+ onMouseleave: (e: MouseEvent) => void;
9
+ } | {
10
+ onMousemove?: undefined;
11
+ onMouseleave?: undefined;
12
+ };
9
13
  onCommentMouseLeave: (e: MouseEvent) => void;
10
- onCommentIconClick: () => void;
14
+ onCommentIconClick: (e: Event) => void;
11
15
  insertComment: (lineNumber: number, lineSide: LineSide, commentDom: HTMLElement) => void;
12
16
  removeComment: (lineNumber: number, lineSide: LineSide) => void;
13
17
  };
@@ -1,2 +1,22 @@
1
1
  export declare const ExpandLineReg: RegExp;
2
2
  export declare const FirstLineReg: RegExp;
3
+ export declare const TableTrReg: RegExp;
4
+ export declare const TableTdReg: RegExp;
5
+ export declare const TableTbodyReg: RegExp;
6
+ export declare const TableTbodyAttrReg: RegExp;
7
+ export declare const EmptyDataLangReg: RegExp;
8
+ export declare const LineByLineTemplate = "<div id=\"{{fileHtmlId}}\" class=\"d2h-file-wrapper\" data-lang=\"{{file.language}}\">\n<div class=\"d2h-file-diff\">\n <div class=\"d2h-code-wrapper\">\n <table class=\"d2h-diff-table\">\n <tbody class=\"d2h-diff-tbody\">\n {{{diffs}}}\n </tbody>\n </table>\n </div>\n</div>\n</div>";
9
+ export declare const SideBySideTemplate = "<div id=\"{{fileHtmlId}}\" class=\"d2h-file-wrapper\" data-lang=\"{{file.language}}\">\n<div class=\"d2h-files-diff\">\n <div class=\"d2h-file-side-diff\">\n <div class=\"d2h-code-wrapper\">\n <table class=\"d2h-diff-table\">\n <tbody class=\"d2h-diff-tbody\">\n {{{diffs.left}}}\n {{{diffs.right}}}\n </tbody>\n </table>\n </div>\n </div>\n</div>\n</div>";
10
+ export declare const EmptyTemplate: {
11
+ 'generic-empty-diff': string;
12
+ };
13
+ export declare const TemplateMap: {
14
+ 'line-by-line': {
15
+ 'generic-empty-diff': string;
16
+ 'line-by-line-file-diff': string;
17
+ };
18
+ 'side-by-side': {
19
+ 'generic-empty-diff': string;
20
+ 'side-by-side-file-diff': string;
21
+ };
22
+ };
@@ -1,15 +1,20 @@
1
1
  import type { OutputFormat, ExpandDirection, LineSide, IncrementCodeInsertDirection } from './code-review-types';
2
2
  export declare function notEmptyNode(node: HTMLElement): boolean;
3
3
  export declare function insertIncrementLineToPage(referenceDom: HTMLElement, trNodes: HTMLTableRowElement[], direction: IncrementCodeInsertDirection): void;
4
+ export declare function ifRemoveExpandLineForDoubleColumn(expandDom: HTMLElement, newExpandDom: HTMLTableRowElement, direction: IncrementCodeInsertDirection): boolean;
4
5
  export declare function ifRemoveExpandLine(expandDom: HTMLElement, newExpandDom: HTMLTableRowElement, direction: IncrementCodeInsertDirection): boolean;
5
6
  export declare function updateExpandLineCount(expandDom: HTMLElement, newExpandDom: HTMLElement): void;
6
7
  export declare function parseDiffCode(container: HTMLElement, code: string, outputFormat: OutputFormat): void;
7
8
  export declare function setLineNumberInDataset(trNode: HTMLElement, prevL: number, prevR: number, nextL: number, nextR: number): void;
8
9
  export declare function updateExpandUpDownButton(trNode: HTMLElement): void;
9
- export declare function updateLineNumberInDataset(trNode: HTMLElement, expandAllThreshold: number, position: 'top' | 'bottom' | 'middle', updateExpandButton?: boolean): void;
10
- export declare function getLineNumberFormDataset(expandDom: HTMLElement, expandAllThreshold: number): (number | undefined)[];
10
+ export declare function updateLineNumberInDatasetForDoubleColumn(trNode: HTMLElement, expandThreshold: number, position: 'top' | 'bottom' | 'middle', updateExpandButton?: boolean): void;
11
+ export declare function updateLineNumberInDataset(trNode: HTMLElement, expandThreshold: number, position: 'top' | 'bottom' | 'middle', updateExpandButton?: boolean): void;
12
+ export declare function getLineNumberFromDataset(expandDom: HTMLElement, expandThreshold: number): (number | undefined)[];
11
13
  export declare function insertNode(parent: HTMLElement, child: HTMLElement): void;
12
14
  export declare function addExpandButton(parentNode: HTMLElement, className: string, icon: string): void;
13
15
  export declare function attachToggleButton(dom: HTMLElement, outputFormat: OutputFormat): void;
14
16
  export declare function attachExpandUpDownButton(parentNode: HTMLElement, direction: ExpandDirection): void;
15
- export declare function addCommentToPage(lineHost: HTMLElement, commentDom: HTMLElement, lineSide: LineSide): void;
17
+ export declare function addCommentToPageForSingleColumn(lineHost: HTMLElement, commentDom: HTMLElement, lineSide: LineSide): void;
18
+ export declare function addCommentToPageForDoubleColumn(lineHost: HTMLElement, commentDom: HTMLElement, lineSide: LineSide): void;
19
+ export declare function findReferenceDomForSingleColumn(parentNode: HTMLElement, lineNumber: number, lineSide: LineSide): HTMLTableRowElement | undefined;
20
+ export declare function findReferenceDomForDoubleColumn(parentNode: HTMLElement, lineNumber: number, lineSide: LineSide): HTMLTableRowElement | undefined;
@@ -11,3 +11,5 @@ export * from './middle-num';
11
11
  export * from './is';
12
12
  export * from './wait';
13
13
  export * from './omit';
14
+ export * from './use-namespace';
15
+ export * from './url';
@@ -0,0 +1,13 @@
1
+ export declare type UseNamespace = {
2
+ b: () => string;
3
+ e: (el: string) => string;
4
+ m: (mo: string) => string;
5
+ em: (el: string, mo: string) => string;
6
+ };
7
+ /**
8
+ * useNamespace
9
+ * @param block current block name
10
+ * @param needDot Do you need a dot prefix (defalut: false)
11
+ * @returns UseNamespace
12
+ */
13
+ export declare function useNamespace(block: string, needDot?: boolean): UseNamespace;