Browse Source

Up naming

pull/6471/head
Artur Arseniev 2 years ago
parent
commit
e03f75b65f
  1. 36
      packages/core/src/commands/view/ComponentDrag.ts

36
packages/core/src/commands/view/ComponentDrag.ts

@ -125,7 +125,7 @@ export default {
}, },
getGuidesStatic() { getGuidesStatic() {
let result: ComponentGuide[] = []; let result: ComponentDragGuide[] = [];
const el = this.target.getEl(); const el = this.target.getEl();
const parentNode = el?.parentElement; const parentNode = el?.parentElement;
if (!parentNode) return []; if (!parentNode) return [];
@ -249,7 +249,7 @@ export default {
guideEl: guide, guideEl: guide,
guide, guide,
}; };
}) as ComponentGuide[]; }) as ComponentDragGuide[];
guides.forEach((guidePoint) => this.guides?.push(guidePoint)); guides.forEach((guidePoint) => this.guides?.push(guidePoint));
@ -568,11 +568,11 @@ export default {
interface ComponentDragProps { interface ComponentDragProps {
editor: Editor; editor: Editor;
em?: EditorModel; em?: EditorModel;
guides?: ComponentGuide[]; guides?: ComponentDragGuide[];
guidesContainer?: HTMLElement; guidesContainer?: HTMLElement;
guidesEl?: HTMLElement; guidesEl?: HTMLElement;
guidesStatic?: ComponentGuide[]; guidesStatic?: ComponentDragGuide[];
guidesTarget?: ComponentGuide[]; guidesTarget?: ComponentDragGuide[];
isTran?: boolean; isTran?: boolean;
opts: ComponentDragOpts; opts: ComponentDragOpts;
target: Component; target: Component;
@ -586,13 +586,13 @@ interface ComponentDragProps {
stop: () => void; stop: () => void;
setupGuides: () => void; setupGuides: () => void;
getGuidesContainer: () => HTMLElement; getGuidesContainer: () => HTMLElement;
getGuidesStatic: () => ComponentGuide[]; getGuidesStatic: () => ComponentDragGuide[];
getGuidesTarget: () => ComponentGuide[]; getGuidesTarget: () => ComponentDragGuide[];
updateGuides: (guides?: ComponentGuide[]) => void; updateGuides: (guides?: ComponentDragGuide[]) => void;
getGuidePosUpdate: (item: ComponentGuide, rect: ComponentOrigRect) => { x?: number; y?: number }; getGuidePosUpdate: (item: ComponentDragGuide, rect: ComponentOrigRect) => { x?: number; y?: number };
renderGuide: (item: { active?: boolean; guide?: HTMLElement; x?: number; y?: number }) => HTMLElement; renderGuide: (item: { active?: boolean; guide?: HTMLElement; x?: number; y?: number }) => HTMLElement;
getElementPos: (el: HTMLElement) => ComponentOrigRect; getElementPos: (el: HTMLElement) => ComponentOrigRect;
getElementGuides: (el: HTMLElement) => ComponentGuide[]; getElementGuides: (el: HTMLElement) => ComponentDragGuide[];
getTranslate: (transform: string, axis?: string) => number; getTranslate: (transform: string, axis?: string) => number;
setTranslate: (transform: string, axis: string, value: string) => string; setTranslate: (transform: string, axis: string, value: string) => string;
getPosition: DraggerOptions['getPosition']; getPosition: DraggerOptions['getPosition'];
@ -602,9 +602,9 @@ interface ComponentDragProps {
onDrag: DraggerOptions['onDrag']; onDrag: DraggerOptions['onDrag'];
onEnd: DraggerOptions['onEnd']; onEnd: DraggerOptions['onEnd'];
hideGuidesInfo: () => void; hideGuidesInfo: () => void;
renderGuideInfo: (guides?: ComponentGuide[]) => void; renderGuideInfo: (guides?: ComponentDragGuide[]) => void;
renderSingleGuideInfo: (guideMatched: ComponentGuideMatched) => void; renderSingleGuideInfo: (guideMatched: ComponentGuideMatched) => void;
getGuidesMatched: (guides?: ComponentGuide[]) => ComponentGuideMatched[]; getGuidesMatched: (guides?: ComponentDragGuide[]) => ComponentGuideMatched[];
toggleDrag: (enable?: boolean) => void; toggleDrag: (enable?: boolean) => void;
} }
@ -644,12 +644,12 @@ export interface ComponentDragEventProps {
* The guides of the component being dragged. * The guides of the component being dragged.
* @deprecated Use `guidesMatched` instead. * @deprecated Use `guidesMatched` instead.
*/ */
guidesTarget: ComponentGuide[]; guidesTarget: ComponentDragGuide[];
/** /**
* All the guides except the ones of the component being dragged. * All the guides except the ones of the component being dragged.
* @deprecated Use `guidesMatched` instead. * @deprecated Use `guidesMatched` instead.
*/ */
guidesStatic: ComponentGuide[]; guidesStatic: ComponentDragGuide[];
/** /**
* The guides that are being matched. * The guides that are being matched.
*/ */
@ -659,7 +659,7 @@ export interface ComponentDragEventProps {
/** /**
* Represents a guide used during component dragging. * Represents a guide used during component dragging.
*/ */
interface ComponentGuide { interface ComponentDragGuide {
/** /**
* The type of the guide (e.g., 't', 'b', 'l', 'r', 'x', 'y'). * The type of the guide (e.g., 't', 'b', 'l', 'r', 'x', 'y').
*/ */
@ -721,15 +721,15 @@ interface ComponentGuideMatched {
/** /**
* The static guides used for matching. * The static guides used for matching.
*/ */
guidesStatic: ComponentGuide[]; guidesStatic: ComponentDragGuide[];
/** /**
* The origin component guide. * The origin component guide.
*/ */
guide: ComponentGuide; guide: ComponentDragGuide;
/** /**
* The matched component guide. * The matched component guide.
*/ */
matched: ComponentGuide; matched: ComponentDragGuide;
/** /**
* The primary position of the guide (either x or y depending on the axis). * The primary position of the guide (either x or y depending on the axis).
*/ */

Loading…
Cancel
Save