UNPKG

@chief-editor/editor

Version:

FlowEditor Editor

1 lines 1.09 kB
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(r){for(var t,e=1,s=arguments.length;e<s;e++)for(var a in t=arguments[e])Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r}).apply(this,arguments)},__rest=this&&this.__rest||function(r,t){var e={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&t.indexOf(s)<0&&(e[s]=r[s]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(r);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(r,s[a])&&(e[s[a]]=r[s[a]])}return e};import{classnames}from"@co-hooks/util";import{useDrag}from"@rc-hooks/drag";import React,{useRef}from"react";import{useEditorCls}from"../..";export function DirectDragger(r){var t,e=r.className,s=r.data,a=r.style,o=__rest(r,["className","data","style"]),n=useRef(null),i=classnames(useEditorCls("direct-drag-mask-dragger",{dir:null==s?void 0:s.direct}),((t={})[String(e)]=!!e,t));return useDrag(n,__assign(__assign({},o),{data:s})),React.createElement("div",{className:i,ref:n,style:a})}