reactjs-tiptap-editor 1.0.25 → 1.0.26
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/{ActionMenuButton-8cTG45Ft.js → ActionMenuButton-B4KDkZ0z.js} +1 -1
- package/lib/{ActionMenuButton-CXeFhner.cjs → ActionMenuButton-C3Cfeza9.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +25 -25
- package/lib/Blockquote.cjs +5 -5
- package/lib/Blockquote.js +1490 -53
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +3 -3
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +222 -8
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +56 -39
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +8 -4
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +3 -3
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +2 -2
- package/lib/{Drawer-TJY4NuHx.cjs → Drawer-D7E9kTca.cjs} +1 -1
- package/lib/{Drawer-C-EO1uoK.js → Drawer-DA0FLHs9.js} +20 -20
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +1644 -148
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +10 -10
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/FormatPainter.cjs +1 -0
- package/lib/FormatPainter.js +133 -0
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +10 -6
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +3 -3
- package/lib/History.cjs +7 -1
- package/lib/History.js +519 -478
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-CGb6-2LD.js → Iframe-DZ3r3QzK.js} +7 -7
- package/lib/{Iframe-5zx43DL4.cjs → Iframe-OMVd0xa_.cjs} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +6 -6
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +35 -35
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +15 -15
- package/lib/{Indent-DuwV8s1t.cjs → Indent-QgCoonRk.cjs} +1 -1
- package/lib/{Indent-CdMYsDNS.js → Indent-kI4G-clX.js} +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -2
- package/lib/{Katex-CCP_ZQz2.js → Katex-BPbXjcZQ.js} +6 -7
- package/lib/Katex-CUofhjB5.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +3 -3
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +4 -4
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-B1m-TVMu.js → LinkEditBlock-BYWwH2_x.js} +59 -32
- package/lib/{LinkEditBlock-DQ8-iufJ.cjs → LinkEditBlock-Z7RRurvx.cjs} +2 -2
- package/lib/MarkdownPaste.cjs +1 -1
- package/lib/MarkdownPaste.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +9 -5
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +61 -62
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +5 -5
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +14 -14
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +7 -7
- package/lib/{SlashCommandNodeView-Dt6n1SP9.js → SlashCommandNodeView-C0l3Fb_3.js} +10 -10
- package/lib/{SlashCommandNodeView-DNixmQGa.cjs → SlashCommandNodeView-DPPmYEjC.cjs} +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-C5JxBXef.cjs → Table-D5G3rfwb.cjs} +5 -5
- package/lib/{Table-DdEgaUwa.js → Table-DwseaFSD.js} +115 -97
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +11 -11
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +3 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -2
- package/lib/{Twitter-Dnz9qyW0.js → Twitter-DP26Lkn8.js} +195 -195
- package/lib/Twitter-q4ZGZL0i.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -5
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +2783 -2137
- package/lib/{clsx-D6gYQn3o.cjs → clsx-DRbkQ4T7.cjs} +1 -1
- package/lib/{clsx-0OU6n9va.js → clsx-_bq4MQQ7.js} +14 -4
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleKatex.d.ts +2 -1
- package/lib/components/Bubble/RichTextBubbleLink.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleMedia.d.ts +3 -3
- package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +2 -1
- package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleTable.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleText.d.ts +1 -1
- package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -1
- package/lib/components/ColorPicker.d.ts +1 -1
- package/lib/components/ReactBus.d.ts +1 -1
- package/lib/components/RichTextProvider.d.ts +1 -1
- package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -1
- package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -1
- package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +2 -1
- package/lib/components/icons/Activity.d.ts +2 -1
- package/lib/components/icons/Animas.d.ts +2 -1
- package/lib/components/icons/AspectRatio.d.ts +1 -1
- package/lib/components/icons/Blockquote.d.ts +1 -1
- package/lib/components/icons/CodeView.d.ts +1 -1
- package/lib/components/icons/ColumnAddLeft.d.ts +1 -1
- package/lib/components/icons/ColumnAddRight.d.ts +1 -1
- package/lib/components/icons/DeleteColumn.d.ts +1 -1
- package/lib/components/icons/DeleteRow.d.ts +1 -1
- package/lib/components/icons/Direction.d.ts +1 -1
- package/lib/components/icons/Excalidraw.d.ts +1 -1
- package/lib/components/icons/ExportPdf.d.ts +1 -1
- package/lib/components/icons/ExportWord.d.ts +2 -1
- package/lib/components/icons/FileWordOutline.d.ts +1 -1
- package/lib/components/icons/Flag.d.ts +2 -1
- package/lib/components/icons/Food.d.ts +2 -1
- package/lib/components/icons/GIfIcon.d.ts +1 -1
- package/lib/components/icons/Html.d.ts +1 -1
- package/lib/components/icons/Icon.d.ts +1 -1
- package/lib/components/icons/IconColorFill.d.ts +1 -1
- package/lib/components/icons/IconHighlightFill.d.ts +1 -1
- package/lib/components/icons/ImportWord.d.ts +2 -1
- package/lib/components/icons/LeftToRight.d.ts +1 -1
- package/lib/components/icons/LineHeight.d.ts +1 -1
- package/lib/components/icons/MenuDown.d.ts +1 -1
- package/lib/components/icons/Mermaid.d.ts +1 -1
- package/lib/components/icons/NoFill.d.ts +1 -1
- package/lib/components/icons/Object.d.ts +2 -1
- package/lib/components/icons/RightToLeft.d.ts +1 -1
- package/lib/components/icons/SizeL.d.ts +1 -1
- package/lib/components/icons/SizeM.d.ts +1 -1
- package/lib/components/icons/SizeS.d.ts +1 -1
- package/lib/components/icons/Symbol.d.ts +2 -1
- package/lib/components/icons/Travel.d.ts +2 -1
- package/lib/components/icons/Twitter.d.ts +1 -1
- package/lib/components/ui/dialog.d.ts +2 -2
- package/lib/components/ui/dropdown-menu.d.ts +1 -1
- package/lib/components/ui/emoji-picker.d.ts +4 -4
- package/lib/components/ui/toaster.d.ts +1 -1
- package/lib/{dropdown-menu-ROihzXsP.js → dropdown-menu-BKSX4gvT.js} +1 -1
- package/lib/{dropdown-menu-yQ-sQ1k4.cjs → dropdown-menu-CURWpB9o.cjs} +1 -1
- package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -1
- package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -1
- package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -1
- package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -1
- package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -1
- package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -1
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -1
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -1
- package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -1
- package/lib/extensions/Code/components/RichTextCode.d.ts +1 -1
- package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +2 -1
- package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -1
- package/lib/extensions/Color/components/RichTextColor.d.ts +1 -1
- package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -1
- package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -1
- package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +27 -27
- package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -1
- package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +2 -1
- package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -1
- package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +2 -1
- package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -1
- package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -1
- package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -1
- package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -1
- package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +1 -1
- package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +1 -1
- package/lib/extensions/FormatPainter/FormatPainter.d.ts +17 -0
- package/lib/extensions/FormatPainter/components/RichTextFormatPainter.d.ts +1 -0
- package/lib/extensions/FormatPainter/index.d.ts +1 -0
- package/lib/extensions/Heading/components/RichTextHeading.d.ts +1 -1
- package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +2 -1
- package/lib/extensions/History/components/RichTextHistory.d.ts +3 -2
- package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -1
- package/lib/extensions/Iframe/components/IframeNodeView.d.ts +1 -1
- package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -1
- package/lib/extensions/Image/components/ImageCropper.d.ts +2 -1
- package/lib/extensions/Image/components/ImageView.d.ts +2 -1
- package/lib/extensions/Image/components/RichTextImage.d.ts +1 -1
- package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -1
- package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +2 -1
- package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -1
- package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -1
- package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -1
- package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -1
- package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -1
- package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -1
- package/lib/extensions/Link/components/LinkEditBlock.d.ts +1 -1
- package/lib/extensions/Link/components/LinkViewBlock.d.ts +2 -1
- package/lib/extensions/Link/components/RichTextLink.d.ts +1 -1
- package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +2 -1
- package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -1
- package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +1 -1
- package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -1
- package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -1
- package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +1 -1
- package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -1
- package/lib/extensions/Table/components/CreateTablePopover.d.ts +2 -1
- package/lib/extensions/Table/components/RichTextTable.d.ts +2 -1
- package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -1
- package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +1 -1
- package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +1 -1
- package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -1
- package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +1 -1
- package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +1 -1
- package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -1
- package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -1
- package/lib/index-BGfIcDCQ.cjs +26 -0
- package/lib/index-BaR0Brts.js +1115 -0
- package/lib/index-BgNKVyMW.cjs +2 -0
- package/lib/index-BpLw6ebr.cjs +1 -0
- package/lib/{index-X6WZUM9O.js → index-C52cuQ_Y.js} +1503 -1352
- package/lib/index-CDw4Eszh.cjs +12 -0
- package/lib/{index-CUvjYuRp.cjs → index-CHVV5iY-.cjs} +1 -1
- package/lib/{index-zw-Kd38i.js → index-CJMI7Fjf.js} +1 -1
- package/lib/{index-D-Ouz0vF.js → index-DQy9iBzV.js} +1 -1
- package/lib/index-Dbm_Mans.js +1756 -0
- package/lib/{index-oj858lQO.js → index-DtyAGMbq.js} +208 -208
- package/lib/{index-BblvcbTH.js → index-Dx-Dh7KS.js} +1464 -1348
- package/lib/{index-BAb_UADw.cjs → index-SEMQrdk2.cjs} +1 -1
- package/lib/index-aujjnfSJ.cjs +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +12 -12
- package/lib/{jsx-runtime-CT7Pcg-t.js → jsx-runtime-DE8oVoME.js} +3 -1
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/index.d.ts +1 -1
- package/lib/{popover-BfWFqCIs.js → popover-BB-ZDnqk.js} +1 -1
- package/lib/{popover-BPzkMuyi.cjs → popover-CrywEkBR.cjs} +1 -1
- package/lib/{renderNodeView-D--fDFov.cjs → renderNodeView-5h3-p80E.cjs} +1 -1
- package/lib/{renderNodeView-CfWJK4rG.js → renderNodeView-DoKZ4GYy.js} +2 -2
- package/lib/{separator-DpaS43Gt.cjs → separator-BGO9AZp4.cjs} +1 -1
- package/lib/{separator-CBPrZizK.js → separator-DuuOJRQd.js} +21 -21
- package/lib/store/EditorEditableReactive.d.ts +1 -1
- package/lib/store/ThemeColorReactive.d.ts +1 -1
- package/lib/style.css +1 -1
- package/lib/types.d.ts +2 -2
- package/lib/{updatePosition-DGPtRfWN.cjs → updatePosition-B1oRJE1x.cjs} +1 -1
- package/lib/{updatePosition-BwzAsiY0.js → updatePosition-CFTYKYNJ.js} +2 -2
- package/package.json +79 -66
- package/lib/Callout-DWOMZPiP.cjs +0 -1
- package/lib/Callout-ZlPQrMEt.js +0 -340
- package/lib/Katex-D9FP7EUE.cjs +0 -4
- package/lib/Twitter--tfifMt1.cjs +0 -1
- package/lib/index-BF3EVCB1.cjs +0 -2
- package/lib/index-Bcj8cyOO.cjs +0 -24
- package/lib/index-CGjT-a9h.js +0 -1377
- package/lib/index-CPTpXLfX.cjs +0 -11
- package/lib/index-CWw4s87s.cjs +0 -1
- package/lib/index-Cal5SPfB.js +0 -779
- package/lib/index-Gi752TMk.cjs +0 -1
- package/lib/textarea-Bl64keav.js +0 -20
- package/lib/textarea-wvARZKyA.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const F=require("./index-Bcj8cyOO.cjs"),i=require("./index-Gi752TMk.cjs"),U=require("./clsx-D6gYQn3o.cjs"),e=require("react/jsx-runtime"),g=require("react"),B=require("./index-CWw4s87s.cjs"),m=require("easydrawer"),G=require("./shortId-Bfj8TyNr.cjs"),R={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function Q({editor:t,node:o,updateAttributes:r,getPos:s,selected:f}){const[M,H]=g.useState({width:B.IMAGE_MAX_SIZE,height:B.IMAGE_MAX_SIZE}),[w,u]=g.useState({width:0,height:0}),[k]=g.useState([R.TOP_LEFT,R.TOP_RIGHT,R.BOTTOM_LEFT,R.BOTTOM_RIGHT]),[j,A]=g.useState(!1),[c,h]=g.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=o==null?void 0:o.attrs,C=g.useMemo(()=>{const{src:d,alt:y,width:S,height:N}=o==null?void 0:o.attrs,_=F.isNumber(S)?`${S}px`:S,v=F.isNumber(N)?`${N}px`:N;return{src:d||void 0,alt:y||void 0,style:{width:_||void 0,height:v||void 0}}},[o==null?void 0:o.attrs]),n=g.useMemo(()=>{const{style:{width:d}}=C;return{width:d==="100%"?d:void 0}},[C]);function D(d){u({width:d.target.width,height:d.target.height})}const z=g.useCallback(()=>{t.commands.setNodeSelection(s())},[]),I=g.useCallback(i.throttle(()=>{const{width:d}=getComputedStyle(t.view.dom);H(y=>({...y,width:Number.parseInt(d,10)}))},B.IMAGE_THROTTLE_WAIT_TIME),[t]);function W(d,y){d.preventDefault(),d.stopPropagation();const S=w.width,N=w.height,_=S/N;let v=Number(o.attrs.width),E=Number(o.attrs.height);const b=M.width;v&&!E?(v=v>b?b:v,E=Math.round(v/_)):E&&!v?(v=Math.round(E*_),v=v>b?b:v):!v&&!E?(v=S>b?b:S,E=Math.round(v/_)):v=v>b?b:v,A(!0),h({x:d.clientX,y:d.clientY,w:v,h:E,dir:y})}const p=g.useCallback(i.throttle(d=>{if(d.preventDefault(),d.stopPropagation(),!j)return;const{x:y,w:S,dir:N}=c,_=(d.clientX-y)*(/l/.test(N)?-1:1),{width:v,height:E}=o==null?void 0:o.attrs,b=v/E,V=i.clamp(S+_,B.IMAGE_MIN_SIZE,M.width),K=Math.round(V/b);r({width:V,height:K})},B.IMAGE_THROTTLE_WAIT_TIME),[j,c,M,r,o==null?void 0:o.attrs]),a=g.useCallback(d=>{d.preventDefault(),d.stopPropagation(),j&&(h({x:0,y:0,w:0,h:0,dir:""}),A(!1),z())},[j,z]),x=g.useCallback(()=>{document==null||document.addEventListener("mousemove",p,!0),document==null||document.addEventListener("mouseup",a,!0)},[p,a]),L=g.useCallback(()=>{document==null||document.removeEventListener("mousemove",p,!0),document==null||document.removeEventListener("mouseup",a,!0)},[p,a]);g.useEffect(()=>(j?x():L(),()=>{L()}),[j,x,L]);const q=g.useMemo(()=>new ResizeObserver(()=>I()),[I]);return g.useEffect(()=>(q.observe(t.view.dom),()=>{q.disconnect()}),[t.view.dom,q]),e.jsx(U.NodeViewWrapper,{className:"image-view",style:{...n,width:"100%",textAlign:T},children:e.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:{...n,background:"#fff"},className:`image-view__body ${f?"image-view__body--focused":""} ${j?"image-view__body--resizing":""}`,children:[e.jsx("img",{alt:C.alt,className:"image-view__body__image block",height:"auto",onClick:z,onLoad:D,src:C.src,style:C.style}),t.view.editable&&(f||j)&&e.jsx("div",{className:"image-resizer",children:k==null?void 0:k.map(d=>e.jsx("span",{className:`image-resizer__handler image-resizer__handler--${d}`,onMouseDown:y=>W(y,d)},`image-dir-${d}`))})]})})}function Y(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{color:"currentColor",d:"M2 9.2v3.6M12.8 2H9.2M7.5 20H9M20 7.5V9M2.133 4.699c.155-.727.415-1.274.854-1.712c.426-.426.954-.684 1.652-.84m15.228 2.552c-.155-.727-.415-1.274-.854-1.712c-.417-.417-.932-.673-1.608-.83M4.64 19.853c-.698-.156-1.226-.414-1.652-.84c-.43-.43-.69-.965-.845-1.673m11.638 3.626c-1.812.125-3.607-8.326-2.374-9.559s9.684.561 9.559 2.373c-.087 1.187-2.095 1.656-2.037 2.711c.018.309.408.59 1.188 1.154c.543.39 1.096.77 1.629 1.175a.66.66 0 0 1 .234.687a3.35 3.35 0 0 1-2.472 2.473a.66.66 0 0 1-.688-.235c-.404-.533-.784-1.086-1.175-1.628c-.563-.78-.844-1.17-1.153-1.188c-1.055-.059-1.524 1.95-2.71 2.037",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})}function J(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M20.06 18a4 4 0 0 1-.2-.89c-.67.7-1.48 1.05-2.41 1.05c-.83 0-1.52-.24-2.05-.71c-.53-.45-.8-1.06-.8-1.79c0-.88.33-1.56 1-2.05s1.61-.73 2.83-.73h1.4v-.64q0-.735-.45-1.17c-.3-.29-.75-.43-1.33-.43c-.52 0-.95.12-1.3.36c-.35.25-.52.54-.52.89h-1.46c0-.43.15-.84.45-1.24c.28-.4.71-.71 1.22-.94c.51-.21 1.06-.35 1.69-.35c.98 0 1.74.24 2.29.73s.84 1.16.86 2.02V16c0 .8.1 1.42.3 1.88V18zm-2.4-1.12c.45 0 .88-.11 1.29-.32c.4-.21.7-.49.88-.83v-1.57H18.7c-1.77 0-2.66.47-2.66 1.41c0 .43.15.73.46.96c.3.23.68.35 1.16.35m-12.2-3.17h4.07L7.5 8.29zM6.64 6h1.72l4.71 12h-1.93l-.97-2.57H4.82L3.86 18H1.93z",fill:"currentColor"})})}function ee(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z",fill:"currentColor"})})}function te(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 256 256",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M253.66 106.34a8 8 0 0 0-11.32 0L192 156.69L107.31 72l50.35-50.34a8 8 0 1 0-11.32-11.32L96 60.69a16 16 0 0 0-2.82 18.81L72 100.69a16 16 0 0 0 0 22.62l4.69 4.69l-58.35 58.34a8 8 0 0 0 3.13 13.25l72 24A7.9 7.9 0 0 0 96 224a8 8 0 0 0 5.66-2.34L136 187.31l4.69 4.69a16 16 0 0 0 22.62 0l21.19-21.18a16 16 0 0 0 18.81-2.82l50.35-50.34a8 8 0 0 0 0-11.32M93.84 206.85l-55-18.35L88 139.31L124.69 176ZM152 180.69L83.31 112L104 91.31L172.69 160Z",fill:"currentColor"})})}function oe(t){return e.jsxs("svg",{height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsx("path",{d:"m2.648 9.937l7.29-7.288a2.21 2.21 0 0 1 3.124 0l2.29 2.288a2.21 2.21 0 0 1 0 3.126L10.413 13H12.5a.5.5 0 0 1 0 1H4.501a2.2 2.2 0 0 1-1.563-.647l.707-.707c.227.226.535.354.856.354h4.005a1.2 1.2 0 0 0 .848-.354l1.292-1.293l-4-4l-3.29 3.291a1.21 1.21 0 0 0 0 1.712l.29.29l-.708.707l-.29-.29a2.21 2.21 0 0 1 0-3.126M8 6h6.89a1.2 1.2 0 0 0-.246-.356L14 5H9zm2-2h3l-.645-.644a1.21 1.21 0 0 0-1.71 0zm4.89 3H7.708l1 1H14l.644-.644A1.2 1.2 0 0 0 14.891 7zM9.708 9l1.646 1.646L13 9z",fill:"currentColor"}),e.jsx("path",{d:"M14 11.5a.5.5 0 1 1-1 0a.5.5 0 0 1 1 0m1.5-.5a.5.5 0 1 0 0-1a.5.5 0 0 0 0 1m-1 2a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z",fill:"currentColor"})]})}function re(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M3 3h18v18H3zm2 2v14h14V5z",fill:"currentColor"})})}function le(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M2 20V4h20v16zm2-2h16V6H4zm0 0V6z",fill:"currentColor"})})}function ne(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8",fill:"currentColor"})})}function se(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M10.363 3.591L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function ie(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"m6.8 21l-5.2-9l5.2-9h10.4l5.2 9l-5.2 9zm1.15-2h8.1l4.025-7l-4.025-7h-8.1L3.9 12zM12 12",fill:"currentColor"})})}function ae(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsxs("g",{fill:"none",fillRule:"evenodd",children:[e.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),e.jsx("path",{d:"M10.586 2.807a2 2 0 0 1 2.828 0l7.778 7.779a2 2 0 0 1 0 2.828l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.828zM12 4.222L4.222 12L12 19.778L19.778 12z",fill:"currentColor"})]})})}function ce(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z",fill:"currentColor"})})}function he(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{clipRule:"evenodd",d:"M7.53 3.47a.75.75 0 0 1 0 1.06L5.81 6.25H15a5.75 5.75 0 0 1 0 11.5H8a.75.75 0 0 1 0-1.5h7a4.25 4.25 0 0 0 0-8.5H5.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0",fill:"currentColor",fillRule:"evenodd"})})}function ue(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{clipRule:"evenodd",d:"M16.47 3.47a.75.75 0 0 1 1.06 0l3 3a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06l1.72-1.72H9a4.25 4.25 0 0 0 0 8.5h7a.75.75 0 0 1 0 1.5H9a5.75 5.75 0 0 1 0-11.5h9.19l-1.72-1.72a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})})}function de(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zm2-4h2V8H9zm4 0h2V8h-2z",fill:"currentColor"})})}function ge(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 256 256",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M211.81 83.79a28 28 0 0 1-33.12 4.83l-90.07 90.07a28 28 0 1 1-44.43-6.48a28 28 0 0 1 33.12-4.83l90.07-90.07a28 28 0 1 1 44.43 6.48",fill:"currentColor"})})}function me(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125M11.05 6.75q-.725-1.025-1.55-1.563t-2-.537q-1.5 0-2.5 1t-1 2.5q0 1.3.925 2.763t2.213 2.837t2.65 2.575T12 18.3q.85-.775 2.213-1.975t2.65-2.575t2.212-2.837T20 8.15q0-1.5-1-2.5t-2.5-1q-1.175 0-2 .538T12.95 6.75q-.175.25-.425.375T12 7.25t-.525-.125t-.425-.375m.95 4.725",fill:"currentColor"})})}function pe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"m7.625 6.4l2.8-3.625q.3-.4.713-.587T12 2t.863.188t.712.587l2.8 3.625l4.25 1.425q.65.2 1.025.738t.375 1.187q0 .3-.088.6t-.287.575l-2.75 3.9l.1 4.1q.025.875-.575 1.475t-1.4.6q-.05 0-.55-.075L12 19.675l-4.475 1.25q-.125.05-.275.063T6.975 21q-.8 0-1.4-.6T5 18.925l.1-4.125l-2.725-3.875q-.2-.275-.288-.575T2 9.75q0-.625.363-1.162t1.012-.763zM8.85 8.125L4 9.725L7.1 14.2L7 18.975l5-1.375l5 1.4l-.1-4.8L20 9.775l-4.85-1.65L12 4zM12 11.5",fill:"currentColor"})})}function xe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12.01 6c2.61 0 4.89 1.86 5.4 4.43l.3 1.5l1.52.11c1.56.11 2.78 1.41 2.78 2.96c0 1.65-1.35 3-3 3h-13c-2.21 0-4-1.79-4-4c0-2.05 1.53-3.76 3.56-3.97l1.07-.11l.5-.95A5.46 5.46 0 0 1 12.01 6m0-2C9.12 4 6.6 5.64 5.35 8.04C2.35 8.36.01 10.91.01 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.64-4.96C18.68 6.59 15.65 4 12.01 4",fill:"currentColor"})})}function we(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M5.586 6.45A2 2 0 0 1 7.509 5h11.84a2 2 0 0 1 1.923 2.55l-2.858 10A2 2 0 0 1 16.491 19H4.651a2 2 0 0 1-1.923-2.55z",fill:"none",stroke:"currentColor",strokeWidth:"2"})})}const ve="_wrapper_pva9d_1",Ce="_tool_pva9d_17",fe="_active_pva9d_37",Te="_pen_pva9d_41",je="_line_pva9d_48",be="_options_pva9d_56",Me="_colorWrap_pva9d_66",ye="_color_pva9d_66",Se="_colorActive_pva9d_83",l={wrapper:ve,tool:Ce,active:fe,pen:Te,line:je,options:be,colorWrap:Me,color:ye,colorActive:Se},Ee=[m.Color4.blackHighlight,m.Color4.ofRGBA(166/255,81/255,167/255,.3),m.Color4.ofRGBA(247/255,78/255,158/255,.3),m.Color4.ofRGBA(166/255,83/255,88/255,.3),m.Color4.ofRGBA(246/255,130/255,28/255,.3),m.Color4.ofRGBA(166/255,198/255,0,.3),m.Color4.ofRGBA(98/255,186/255,70/255,.3)],$=[m.Color4.black,m.Color4.fromHex("#007AFF"),m.Color4.fromHex("#A651A7"),m.Color4.fromHex("#F74E9E"),m.Color4.fromHex("#FF5358"),m.Color4.fromHex("#F6821C"),m.Color4.fromHex("#FFC600"),m.Color4.fromHex("#62BA46"),m.Color4.fromHex("#E6BFE8"),m.Color4.fromHex("#FEA3D2"),m.Color4.fromHex("#FFA0A3"),m.Color4.fromHex("#FBC276"),m.Color4.fromHex("#FFFB85"),m.Color4.fromHex("#AADC99")];function He({onChange:t}){const[o,r]=g.useState(m.Color4.blackHighlight);return e.jsx("div",{className:l.colorWrap,children:Ee.map((s,f)=>e.jsx("button",{style:{backgroundColor:s.toHexString()},className:i.cn(l.color,{[l.colorActive]:o.toHexString()===s.toHexString()}),onClick:()=>{r(s),t(s)}},f))})}function O({onChange:t}){const[o,r]=g.useState(m.Color4.black);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l.colorWrap,children:$.slice(0,7).map((s,f)=>e.jsx("button",{style:{backgroundColor:s.toHexString()},className:i.cn(l.color,{[l.colorActive]:o.toHexString()===s.toHexString()}),onClick:()=>{r(s),t(s)}},f))}),e.jsx("div",{className:l.colorWrap,children:$.slice(7).map((s,f)=>e.jsx("button",{style:{backgroundColor:s.toHexString()},className:i.cn(l.color,{[l.colorActive]:o.toHexString()===s.toHexString()}),onClick:()=>{r(s),t(s)}},f))})]})}function ke({setColorPen:t,setThicknessPen:o}){const[r,s]=g.useState(2);return e.jsxs("div",{className:l.options,children:[e.jsx("div",{children:e.jsx(O,{onChange:f=>t(f)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx("input",{max:10,min:1,step:.1,type:"range",value:r,onChange:f=>{o(Number.parseFloat(f.target.value)),s(Number.parseFloat(f.target.value))}})})]})}function Le({setColorHighlight:t}){return e.jsx("div",{className:l.options,children:e.jsx(He,{onChange:o=>t(o)})})}function Ne({changeColorShape:t,changeBorderColorShape:o,onThicknessChange:r}){return e.jsxs("div",{className:l.options,children:[e.jsx("div",{children:e.jsx(O,{onChange:s=>t(s)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx(O,{onChange:s=>o(s)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx("input",{defaultValue:0,max:20,min:0,step:1,type:"range",onChange:s=>{r(Number.parseFloat(s.target.value))}})})]})}function Z(t){const{setColorPen:o,refEditor:r,setThicknessPen:s,setColorHighlight:f,changeBorderColorShape:M,onUndo:H,changeColorShape:w,changeShape:u,onThicknessChange:k,onRedo:j,onClear:A}=t,[c,h]=g.useState(null),[T,C]=g.useState(0);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:l.wrapper,children:[e.jsxs("div",{className:l.pen,children:[e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="select"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="select"){h(null),n[0].setEnabled(!1);return}h("select"),n[0].setEnabled(!0)},children:e.jsx(Y,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="text"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(r.current.toolController.setToolEnabled(n[1]),c==="text"){n[1].setEnabled(!1),h(null);return}h("text"),n[1].setEnabled(!0)},children:e.jsx(J,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="pencil"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="pencil"){h(null),n[2].setEnabled(!1);return}h("pencil"),n[2].setEnabled(!0)},children:e.jsx(ee,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="highlighter"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="highlighter"){h(null),n[3].setEnabled(!1);return}h("highlighter"),n[3].setEnabled(!0)},children:e.jsx(te,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="eraser"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="eraser"){h(null),n[4].setEnabled(!1);return}h("eraser"),n[4].setEnabled(!0)},children:e.jsx(oe,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===0}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(0),C(0)},children:e.jsx(re,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===1}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(1),C(1)},children:e.jsx(le,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===2}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(2),C(2)},children:e.jsx(ne,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===3}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(3),C(3)},children:e.jsx(se,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===4}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(4),C(4)},children:e.jsx(ie,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===5}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(5),C(5)},children:e.jsx(ae,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===6}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(6),C(6)},children:e.jsx(ce,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===7}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(7),C(7)},children:e.jsx(ge,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===8}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(8),C(8)},children:e.jsx(me,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===9}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(9),C(9)},children:e.jsx(pe,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===10}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(10),C(10)},children:e.jsx(xe,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===11}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(11),C(11)},children:e.jsx(we,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool),onClick:H,children:e.jsx(he,{})}),e.jsx("button",{className:i.cn(l.tool),onClick:j,children:e.jsx(ue,{})}),e.jsx("button",{className:i.cn(l.tool),onClick:A,children:e.jsx(de,{})})]}),e.jsxs("div",{className:l.optionsWrap,children:[c==="pencil"&&e.jsx(ke,{setColorPen:o,setThicknessPen:s}),c==="highlighter"&&e.jsx(Le,{setColorHighlight:f}),c==="shapes"&&e.jsx(Ne,{changeBorderColorShape:M,changeColorShape:w,changeShape:u,onThicknessChange:k})]})]})})}let P=!1;function _e(){const t=i.useEditorInstance(),o=i.useButtonProps(X.name),{isActive:r=void 0,upload:s}=(o==null?void 0:o.componentProps)??{},{editorDisabled:f}=i.useToggleActive(r),[M,H]=g.useState(!1),w=g.useRef(null),u=g.useRef(null),k=()=>{(async()=>{const a=document.querySelector("#easydrawer");a&&(w.current=new m.Editor(a,{wheelEventsEnabled:!1,disableZoom:!0}),u.current=m.makeDropdownToolbar(w.current),u.current.addDefaultToolWidgets())})()};g.useEffect(()=>{M&&setTimeout(()=>{k()},200)},[M]);const j=async()=>{if(w.current){const p=w.current.toSVG(),a=p.outerHTML,x=`drawer-${G.shortId()}.svg`;let L=G.i(p.outerHTML);if(s){const q=i.dataURLtoFile(L,x);L=await s(q)}t==null||t.chain().focus().setDrawer({type:"drawer",src:L,alt:encodeURIComponent(a),width:426,height:212},!!a).run()}H(!1)},A=p=>{const a=w.current.toolController.getPrimaryTools()[2],x=u.current.getWidgetById("pen-1");a&&x&&(a.setColor(p),x.serializeState())},c=p=>{const a=w.current.toolController.getPrimaryTools()[2],x=u.current.getWidgetById("pen-1");a&&x&&(a.setThickness(p),x.serializeState())},h=p=>{const a=w.current.toolController.getPrimaryTools()[3],x=u.current.getWidgetById("pen-2");a&&x&&(a.setColor(p),x.serializeState())},T=p=>{const a=u.current.getWidgetById("shape");a&&a.setShapeType(p)},C=p=>{const a=w.current.toolController.getPrimaryTools()[5],x=u.current.getWidgetById("shape");a&&x&&(a.setColor(p),x.serializeState())},n=p=>{const a=w.current.toolController.getPrimaryTools()[5],x=u.current.getWidgetById("shape");a&&x&&(a.setThickness(p),x.serializeState())},D=p=>{const a=w.current.toolController.getPrimaryTools()[5],x=u.current.getWidgetById("shape");a&&x&&(a.setBorderColor(p),x.serializeState())},z=()=>{if(P){for(;w.current.history.redoStackSize>0;)w.current.history.redo();P=!1;return}w.current.history.undo()},I=()=>{P||w.current.history.redo()},W=()=>{if(!P){for(;w.current.history.undoStackSize>0;)z();P=!0}};return o?e.jsxs(i.Dialog,{onOpenChange:H,open:M,children:[e.jsx(i.DialogTrigger,{asChild:!0,children:e.jsx(i.ActionButton,{disabled:f,action:()=>{f||H(!0)},icon:"PencilRuler",tooltip:"Drawer"})}),e.jsxs(i.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[e.jsx(i.DialogTitle,{children:"Drawer"}),e.jsxs("div",{style:{height:"600px",width:"100%",borderWidth:1,background:"white",position:"relative"},children:[e.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),e.jsx(Z,{changeBorderColorShape:D,changeColorShape:C,changeShape:T,onClear:W,onRedo:I,onThicknessChange:n,onUndo:z,refEditor:w,setColorHighlight:h,setColorPen:A,setThicknessPen:c})]}),e.jsx(i.DialogFooter,{children:e.jsx(i.Button,{onClick:j,type:"button",children:"Save changes"})})]})]}):e.jsx(e.Fragment,{})}const X=i.index_default.extend({name:"richTextDrawer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"drawer"},button:({t:o,extension:r})=>{var s;return{componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"PencilRuler",tooltip:o("editor.drawer.tooltip"),upload:(s=r==null?void 0:r.options)==null?void 0:s.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:o=>{const r=o.querySelector("img"),s=r==null?void 0:r.getAttribute("width");return s?Number.parseInt(s,10):320},renderHTML:o=>({width:o.width})},height:{default:null,parseHTML:o=>{const r=o.querySelector("img"),s=r==null?void 0:r.getAttribute("height");return s?Number.parseInt(s,10):212},renderHTML:o=>({height:o.height})},align:{default:"center",parseHTML:o=>o.getAttribute("align"),renderHTML:o=>({align:o.align})}}},addNodeView(){return U.ReactNodeViewRenderer(Q)},addCommands(){return{setDrawer:(t,o)=>({commands:r,editor:s})=>o?r.insertContent({type:this.name,attrs:t}):r.insertContentAt(s.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageDrawer:t=>({commands:o})=>o.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:o}=t;return["div",{style:o?`text-align: ${o};`:"",class:"imageDrawer"},["img",F.mergeAttributes(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageDrawer]",getAttrs:t=>{const o=t.querySelector("img"),r=o==null?void 0:o.getAttribute("width"),s=o==null?void 0:o.getAttribute("height");return{src:o==null?void 0:o.getAttribute("src"),alt:o==null?void 0:o.getAttribute("alt"),width:r?Number.parseInt(r,10):null,height:s?Number.parseInt(s,10):null,align:(o==null?void 0:o.getAttribute("align"))||t.style.textAlign||null}}}]}});exports.ControlDrawer=Z;exports.Drawer=X;exports.RichTextDrawer=_e;
|
|
1
|
+
"use strict";const F=require("./index-BGfIcDCQ.cjs"),i=require("./index-aujjnfSJ.cjs"),U=require("./clsx-DRbkQ4T7.cjs"),e=require("react/jsx-runtime"),g=require("react"),B=require("./index-BpLw6ebr.cjs"),m=require("easydrawer"),G=require("./shortId-Bfj8TyNr.cjs"),R={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function Q({editor:t,node:o,updateAttributes:r,getPos:s,selected:f}){const[M,H]=g.useState({width:B.IMAGE_MAX_SIZE,height:B.IMAGE_MAX_SIZE}),[w,u]=g.useState({width:0,height:0}),[k]=g.useState([R.TOP_LEFT,R.TOP_RIGHT,R.BOTTOM_LEFT,R.BOTTOM_RIGHT]),[j,A]=g.useState(!1),[c,h]=g.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=o==null?void 0:o.attrs,C=g.useMemo(()=>{const{src:d,alt:y,width:S,height:N}=o==null?void 0:o.attrs,_=F.isNumber(S)?`${S}px`:S,v=F.isNumber(N)?`${N}px`:N;return{src:d||void 0,alt:y||void 0,style:{width:_||void 0,height:v||void 0}}},[o==null?void 0:o.attrs]),n=g.useMemo(()=>{const{style:{width:d}}=C;return{width:d==="100%"?d:void 0}},[C]);function D(d){u({width:d.target.width,height:d.target.height})}const z=g.useCallback(()=>{t.commands.setNodeSelection(s())},[]),I=g.useCallback(i.throttle(()=>{const{width:d}=getComputedStyle(t.view.dom);H(y=>({...y,width:Number.parseInt(d,10)}))},B.IMAGE_THROTTLE_WAIT_TIME),[t]);function W(d,y){d.preventDefault(),d.stopPropagation();const S=w.width,N=w.height,_=S/N;let v=Number(o.attrs.width),E=Number(o.attrs.height);const b=M.width;v&&!E?(v=v>b?b:v,E=Math.round(v/_)):E&&!v?(v=Math.round(E*_),v=v>b?b:v):!v&&!E?(v=S>b?b:S,E=Math.round(v/_)):v=v>b?b:v,A(!0),h({x:d.clientX,y:d.clientY,w:v,h:E,dir:y})}const p=g.useCallback(i.throttle(d=>{if(d.preventDefault(),d.stopPropagation(),!j)return;const{x:y,w:S,dir:N}=c,_=(d.clientX-y)*(/l/.test(N)?-1:1),{width:v,height:E}=o==null?void 0:o.attrs,b=v/E,V=i.clamp(S+_,B.IMAGE_MIN_SIZE,M.width),K=Math.round(V/b);r({width:V,height:K})},B.IMAGE_THROTTLE_WAIT_TIME),[j,c,M,r,o==null?void 0:o.attrs]),a=g.useCallback(d=>{d.preventDefault(),d.stopPropagation(),j&&(h({x:0,y:0,w:0,h:0,dir:""}),A(!1),z())},[j,z]),x=g.useCallback(()=>{document==null||document.addEventListener("mousemove",p,!0),document==null||document.addEventListener("mouseup",a,!0)},[p,a]),L=g.useCallback(()=>{document==null||document.removeEventListener("mousemove",p,!0),document==null||document.removeEventListener("mouseup",a,!0)},[p,a]);g.useEffect(()=>(j?x():L(),()=>{L()}),[j,x,L]);const q=g.useMemo(()=>new ResizeObserver(()=>I()),[I]);return g.useEffect(()=>(q.observe(t.view.dom),()=>{q.disconnect()}),[t.view.dom,q]),e.jsx(U.NodeViewWrapper,{className:"image-view",style:{...n,width:"100%",textAlign:T},children:e.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:{...n,background:"#fff"},className:`image-view__body ${f?"image-view__body--focused":""} ${j?"image-view__body--resizing":""}`,children:[e.jsx("img",{alt:C.alt,className:"image-view__body__image block",height:"auto",onClick:z,onLoad:D,src:C.src,style:C.style}),t.view.editable&&(f||j)&&e.jsx("div",{className:"image-resizer",children:k==null?void 0:k.map(d=>e.jsx("span",{className:`image-resizer__handler image-resizer__handler--${d}`,onMouseDown:y=>W(y,d)},`image-dir-${d}`))})]})})}function Y(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{color:"currentColor",d:"M2 9.2v3.6M12.8 2H9.2M7.5 20H9M20 7.5V9M2.133 4.699c.155-.727.415-1.274.854-1.712c.426-.426.954-.684 1.652-.84m15.228 2.552c-.155-.727-.415-1.274-.854-1.712c-.417-.417-.932-.673-1.608-.83M4.64 19.853c-.698-.156-1.226-.414-1.652-.84c-.43-.43-.69-.965-.845-1.673m11.638 3.626c-1.812.125-3.607-8.326-2.374-9.559s9.684.561 9.559 2.373c-.087 1.187-2.095 1.656-2.037 2.711c.018.309.408.59 1.188 1.154c.543.39 1.096.77 1.629 1.175a.66.66 0 0 1 .234.687a3.35 3.35 0 0 1-2.472 2.473a.66.66 0 0 1-.688-.235c-.404-.533-.784-1.086-1.175-1.628c-.563-.78-.844-1.17-1.153-1.188c-1.055-.059-1.524 1.95-2.71 2.037",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})}function J(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M20.06 18a4 4 0 0 1-.2-.89c-.67.7-1.48 1.05-2.41 1.05c-.83 0-1.52-.24-2.05-.71c-.53-.45-.8-1.06-.8-1.79c0-.88.33-1.56 1-2.05s1.61-.73 2.83-.73h1.4v-.64q0-.735-.45-1.17c-.3-.29-.75-.43-1.33-.43c-.52 0-.95.12-1.3.36c-.35.25-.52.54-.52.89h-1.46c0-.43.15-.84.45-1.24c.28-.4.71-.71 1.22-.94c.51-.21 1.06-.35 1.69-.35c.98 0 1.74.24 2.29.73s.84 1.16.86 2.02V16c0 .8.1 1.42.3 1.88V18zm-2.4-1.12c.45 0 .88-.11 1.29-.32c.4-.21.7-.49.88-.83v-1.57H18.7c-1.77 0-2.66.47-2.66 1.41c0 .43.15.73.46.96c.3.23.68.35 1.16.35m-12.2-3.17h4.07L7.5 8.29zM6.64 6h1.72l4.71 12h-1.93l-.97-2.57H4.82L3.86 18H1.93z",fill:"currentColor"})})}function ee(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z",fill:"currentColor"})})}function te(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 256 256",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M253.66 106.34a8 8 0 0 0-11.32 0L192 156.69L107.31 72l50.35-50.34a8 8 0 1 0-11.32-11.32L96 60.69a16 16 0 0 0-2.82 18.81L72 100.69a16 16 0 0 0 0 22.62l4.69 4.69l-58.35 58.34a8 8 0 0 0 3.13 13.25l72 24A7.9 7.9 0 0 0 96 224a8 8 0 0 0 5.66-2.34L136 187.31l4.69 4.69a16 16 0 0 0 22.62 0l21.19-21.18a16 16 0 0 0 18.81-2.82l50.35-50.34a8 8 0 0 0 0-11.32M93.84 206.85l-55-18.35L88 139.31L124.69 176ZM152 180.69L83.31 112L104 91.31L172.69 160Z",fill:"currentColor"})})}function oe(t){return e.jsxs("svg",{height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsx("path",{d:"m2.648 9.937l7.29-7.288a2.21 2.21 0 0 1 3.124 0l2.29 2.288a2.21 2.21 0 0 1 0 3.126L10.413 13H12.5a.5.5 0 0 1 0 1H4.501a2.2 2.2 0 0 1-1.563-.647l.707-.707c.227.226.535.354.856.354h4.005a1.2 1.2 0 0 0 .848-.354l1.292-1.293l-4-4l-3.29 3.291a1.21 1.21 0 0 0 0 1.712l.29.29l-.708.707l-.29-.29a2.21 2.21 0 0 1 0-3.126M8 6h6.89a1.2 1.2 0 0 0-.246-.356L14 5H9zm2-2h3l-.645-.644a1.21 1.21 0 0 0-1.71 0zm4.89 3H7.708l1 1H14l.644-.644A1.2 1.2 0 0 0 14.891 7zM9.708 9l1.646 1.646L13 9z",fill:"currentColor"}),e.jsx("path",{d:"M14 11.5a.5.5 0 1 1-1 0a.5.5 0 0 1 1 0m1.5-.5a.5.5 0 1 0 0-1a.5.5 0 0 0 0 1m-1 2a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z",fill:"currentColor"})]})}function re(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M3 3h18v18H3zm2 2v14h14V5z",fill:"currentColor"})})}function le(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M2 20V4h20v16zm2-2h16V6H4zm0 0V6z",fill:"currentColor"})})}function ne(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8",fill:"currentColor"})})}function se(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M10.363 3.591L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function ie(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"m6.8 21l-5.2-9l5.2-9h10.4l5.2 9l-5.2 9zm1.15-2h8.1l4.025-7l-4.025-7h-8.1L3.9 12zM12 12",fill:"currentColor"})})}function ae(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsxs("g",{fill:"none",fillRule:"evenodd",children:[e.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),e.jsx("path",{d:"M10.586 2.807a2 2 0 0 1 2.828 0l7.778 7.779a2 2 0 0 1 0 2.828l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.828zM12 4.222L4.222 12L12 19.778L19.778 12z",fill:"currentColor"})]})})}function ce(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z",fill:"currentColor"})})}function he(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{clipRule:"evenodd",d:"M7.53 3.47a.75.75 0 0 1 0 1.06L5.81 6.25H15a5.75 5.75 0 0 1 0 11.5H8a.75.75 0 0 1 0-1.5h7a4.25 4.25 0 0 0 0-8.5H5.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0",fill:"currentColor",fillRule:"evenodd"})})}function ue(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{clipRule:"evenodd",d:"M16.47 3.47a.75.75 0 0 1 1.06 0l3 3a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06l1.72-1.72H9a4.25 4.25 0 0 0 0 8.5h7a.75.75 0 0 1 0 1.5H9a5.75 5.75 0 0 1 0-11.5h9.19l-1.72-1.72a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})})}function de(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zm2-4h2V8H9zm4 0h2V8h-2z",fill:"currentColor"})})}function ge(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 256 256",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M211.81 83.79a28 28 0 0 1-33.12 4.83l-90.07 90.07a28 28 0 1 1-44.43-6.48a28 28 0 0 1 33.12-4.83l90.07-90.07a28 28 0 1 1 44.43 6.48",fill:"currentColor"})})}function me(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125M11.05 6.75q-.725-1.025-1.55-1.563t-2-.537q-1.5 0-2.5 1t-1 2.5q0 1.3.925 2.763t2.213 2.837t2.65 2.575T12 18.3q.85-.775 2.213-1.975t2.65-2.575t2.212-2.837T20 8.15q0-1.5-1-2.5t-2.5-1q-1.175 0-2 .538T12.95 6.75q-.175.25-.425.375T12 7.25t-.525-.125t-.425-.375m.95 4.725",fill:"currentColor"})})}function pe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"m7.625 6.4l2.8-3.625q.3-.4.713-.587T12 2t.863.188t.712.587l2.8 3.625l4.25 1.425q.65.2 1.025.738t.375 1.187q0 .3-.088.6t-.287.575l-2.75 3.9l.1 4.1q.025.875-.575 1.475t-1.4.6q-.05 0-.55-.075L12 19.675l-4.475 1.25q-.125.05-.275.063T6.975 21q-.8 0-1.4-.6T5 18.925l.1-4.125l-2.725-3.875q-.2-.275-.288-.575T2 9.75q0-.625.363-1.162t1.012-.763zM8.85 8.125L4 9.725L7.1 14.2L7 18.975l5-1.375l5 1.4l-.1-4.8L20 9.775l-4.85-1.65L12 4zM12 11.5",fill:"currentColor"})})}function xe(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M12.01 6c2.61 0 4.89 1.86 5.4 4.43l.3 1.5l1.52.11c1.56.11 2.78 1.41 2.78 2.96c0 1.65-1.35 3-3 3h-13c-2.21 0-4-1.79-4-4c0-2.05 1.53-3.76 3.56-3.97l1.07-.11l.5-.95A5.46 5.46 0 0 1 12.01 6m0-2C9.12 4 6.6 5.64 5.35 8.04C2.35 8.36.01 10.91.01 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.64-4.96C18.68 6.59 15.65 4 12.01 4",fill:"currentColor"})})}function we(t){return e.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M5.586 6.45A2 2 0 0 1 7.509 5h11.84a2 2 0 0 1 1.923 2.55l-2.858 10A2 2 0 0 1 16.491 19H4.651a2 2 0 0 1-1.923-2.55z",fill:"none",stroke:"currentColor",strokeWidth:"2"})})}const ve="_wrapper_pva9d_1",Ce="_tool_pva9d_17",fe="_active_pva9d_37",Te="_pen_pva9d_41",je="_line_pva9d_48",be="_options_pva9d_56",Me="_colorWrap_pva9d_66",ye="_color_pva9d_66",Se="_colorActive_pva9d_83",l={wrapper:ve,tool:Ce,active:fe,pen:Te,line:je,options:be,colorWrap:Me,color:ye,colorActive:Se},Ee=[m.Color4.blackHighlight,m.Color4.ofRGBA(166/255,81/255,167/255,.3),m.Color4.ofRGBA(247/255,78/255,158/255,.3),m.Color4.ofRGBA(166/255,83/255,88/255,.3),m.Color4.ofRGBA(246/255,130/255,28/255,.3),m.Color4.ofRGBA(166/255,198/255,0,.3),m.Color4.ofRGBA(98/255,186/255,70/255,.3)],$=[m.Color4.black,m.Color4.fromHex("#007AFF"),m.Color4.fromHex("#A651A7"),m.Color4.fromHex("#F74E9E"),m.Color4.fromHex("#FF5358"),m.Color4.fromHex("#F6821C"),m.Color4.fromHex("#FFC600"),m.Color4.fromHex("#62BA46"),m.Color4.fromHex("#E6BFE8"),m.Color4.fromHex("#FEA3D2"),m.Color4.fromHex("#FFA0A3"),m.Color4.fromHex("#FBC276"),m.Color4.fromHex("#FFFB85"),m.Color4.fromHex("#AADC99")];function He({onChange:t}){const[o,r]=g.useState(m.Color4.blackHighlight);return e.jsx("div",{className:l.colorWrap,children:Ee.map((s,f)=>e.jsx("button",{style:{backgroundColor:s.toHexString()},className:i.cn(l.color,{[l.colorActive]:o.toHexString()===s.toHexString()}),onClick:()=>{r(s),t(s)}},f))})}function O({onChange:t}){const[o,r]=g.useState(m.Color4.black);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l.colorWrap,children:$.slice(0,7).map((s,f)=>e.jsx("button",{style:{backgroundColor:s.toHexString()},className:i.cn(l.color,{[l.colorActive]:o.toHexString()===s.toHexString()}),onClick:()=>{r(s),t(s)}},f))}),e.jsx("div",{className:l.colorWrap,children:$.slice(7).map((s,f)=>e.jsx("button",{style:{backgroundColor:s.toHexString()},className:i.cn(l.color,{[l.colorActive]:o.toHexString()===s.toHexString()}),onClick:()=>{r(s),t(s)}},f))})]})}function ke({setColorPen:t,setThicknessPen:o}){const[r,s]=g.useState(2);return e.jsxs("div",{className:l.options,children:[e.jsx("div",{children:e.jsx(O,{onChange:f=>t(f)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx("input",{max:10,min:1,step:.1,type:"range",value:r,onChange:f=>{o(Number.parseFloat(f.target.value)),s(Number.parseFloat(f.target.value))}})})]})}function Le({setColorHighlight:t}){return e.jsx("div",{className:l.options,children:e.jsx(He,{onChange:o=>t(o)})})}function Ne({changeColorShape:t,changeBorderColorShape:o,onThicknessChange:r}){return e.jsxs("div",{className:l.options,children:[e.jsx("div",{children:e.jsx(O,{onChange:s=>t(s)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx(O,{onChange:s=>o(s)})}),e.jsx("div",{className:l.line}),e.jsx("div",{children:e.jsx("input",{defaultValue:0,max:20,min:0,step:1,type:"range",onChange:s=>{r(Number.parseFloat(s.target.value))}})})]})}function Z(t){const{setColorPen:o,refEditor:r,setThicknessPen:s,setColorHighlight:f,changeBorderColorShape:M,onUndo:H,changeColorShape:w,changeShape:u,onThicknessChange:k,onRedo:j,onClear:A}=t,[c,h]=g.useState(null),[T,C]=g.useState(0);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:l.wrapper,children:[e.jsxs("div",{className:l.pen,children:[e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="select"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="select"){h(null),n[0].setEnabled(!1);return}h("select"),n[0].setEnabled(!0)},children:e.jsx(Y,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="text"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(r.current.toolController.setToolEnabled(n[1]),c==="text"){n[1].setEnabled(!1),h(null);return}h("text"),n[1].setEnabled(!0)},children:e.jsx(J,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="pencil"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="pencil"){h(null),n[2].setEnabled(!1);return}h("pencil"),n[2].setEnabled(!0)},children:e.jsx(ee,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="highlighter"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="highlighter"){h(null),n[3].setEnabled(!1);return}h("highlighter"),n[3].setEnabled(!0)},children:e.jsx(te,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="eraser"}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();if(c==="eraser"){h(null),n[4].setEnabled(!1);return}h("eraser"),n[4].setEnabled(!0)},children:e.jsx(oe,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===0}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(0),C(0)},children:e.jsx(re,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===1}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(1),C(1)},children:e.jsx(le,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===2}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(2),C(2)},children:e.jsx(ne,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===3}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(3),C(3)},children:e.jsx(se,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===4}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(4),C(4)},children:e.jsx(ie,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===5}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(5),C(5)},children:e.jsx(ae,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===6}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(6),C(6)},children:e.jsx(ce,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===7}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(7),C(7)},children:e.jsx(ge,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===8}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(8),C(8)},children:e.jsx(me,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===9}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(9),C(9)},children:e.jsx(pe,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===10}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(10),C(10)},children:e.jsx(xe,{})}),e.jsx("button",{className:i.cn(l.tool,{[l.active]:c==="shapes"&&T===11}),onClick:()=>{const n=r.current.toolController.getPrimaryTools();r.current.toolController.setToolEnabled(n[5]),h("shapes"),n[5].setEnabled(!0),u(11),C(11)},children:e.jsx(we,{})}),e.jsx("div",{className:l.line}),e.jsx("button",{className:i.cn(l.tool),onClick:H,children:e.jsx(he,{})}),e.jsx("button",{className:i.cn(l.tool),onClick:j,children:e.jsx(ue,{})}),e.jsx("button",{className:i.cn(l.tool),onClick:A,children:e.jsx(de,{})})]}),e.jsxs("div",{className:l.optionsWrap,children:[c==="pencil"&&e.jsx(ke,{setColorPen:o,setThicknessPen:s}),c==="highlighter"&&e.jsx(Le,{setColorHighlight:f}),c==="shapes"&&e.jsx(Ne,{changeBorderColorShape:M,changeColorShape:w,changeShape:u,onThicknessChange:k})]})]})})}let P=!1;function _e(){const t=i.useEditorInstance(),o=i.useButtonProps(X.name),{isActive:r=void 0,upload:s}=(o==null?void 0:o.componentProps)??{},{editorDisabled:f}=i.useToggleActive(r),[M,H]=g.useState(!1),w=g.useRef(null),u=g.useRef(null),k=()=>{(async()=>{const a=document.querySelector("#easydrawer");a&&(w.current=new m.Editor(a,{wheelEventsEnabled:!1,disableZoom:!0}),u.current=m.makeDropdownToolbar(w.current),u.current.addDefaultToolWidgets())})()};g.useEffect(()=>{M&&setTimeout(()=>{k()},200)},[M]);const j=async()=>{if(w.current){const p=w.current.toSVG(),a=p.outerHTML,x=`drawer-${G.shortId()}.svg`;let L=G.i(p.outerHTML);if(s){const q=i.dataURLtoFile(L,x);L=await s(q)}t==null||t.chain().focus().setDrawer({type:"drawer",src:L,alt:encodeURIComponent(a),width:426,height:212},!!a).run()}H(!1)},A=p=>{const a=w.current.toolController.getPrimaryTools()[2],x=u.current.getWidgetById("pen-1");a&&x&&(a.setColor(p),x.serializeState())},c=p=>{const a=w.current.toolController.getPrimaryTools()[2],x=u.current.getWidgetById("pen-1");a&&x&&(a.setThickness(p),x.serializeState())},h=p=>{const a=w.current.toolController.getPrimaryTools()[3],x=u.current.getWidgetById("pen-2");a&&x&&(a.setColor(p),x.serializeState())},T=p=>{const a=u.current.getWidgetById("shape");a&&a.setShapeType(p)},C=p=>{const a=w.current.toolController.getPrimaryTools()[5],x=u.current.getWidgetById("shape");a&&x&&(a.setColor(p),x.serializeState())},n=p=>{const a=w.current.toolController.getPrimaryTools()[5],x=u.current.getWidgetById("shape");a&&x&&(a.setThickness(p),x.serializeState())},D=p=>{const a=w.current.toolController.getPrimaryTools()[5],x=u.current.getWidgetById("shape");a&&x&&(a.setBorderColor(p),x.serializeState())},z=()=>{if(P){for(;w.current.history.redoStackSize>0;)w.current.history.redo();P=!1;return}w.current.history.undo()},I=()=>{P||w.current.history.redo()},W=()=>{if(!P){for(;w.current.history.undoStackSize>0;)z();P=!0}};return o?e.jsxs(i.Dialog,{onOpenChange:H,open:M,children:[e.jsx(i.DialogTrigger,{asChild:!0,children:e.jsx(i.ActionButton,{disabled:f,action:()=>{f||H(!0)},icon:"PencilRuler",tooltip:"Drawer"})}),e.jsxs(i.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[e.jsx(i.DialogTitle,{children:"Drawer"}),e.jsxs("div",{style:{height:"600px",width:"100%",borderWidth:1,background:"white",position:"relative"},children:[e.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),e.jsx(Z,{changeBorderColorShape:D,changeColorShape:C,changeShape:T,onClear:W,onRedo:I,onThicknessChange:n,onUndo:z,refEditor:w,setColorHighlight:h,setColorPen:A,setThicknessPen:c})]}),e.jsx(i.DialogFooter,{children:e.jsx(i.Button,{onClick:j,type:"button",children:"Save changes"})})]})]}):e.jsx(e.Fragment,{})}const X=i.index_default.extend({name:"richTextDrawer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"drawer"},button:({t:o,extension:r})=>{var s;return{componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"PencilRuler",tooltip:o("editor.drawer.tooltip"),upload:(s=r==null?void 0:r.options)==null?void 0:s.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:o=>{const r=o.querySelector("img"),s=r==null?void 0:r.getAttribute("width");return s?Number.parseInt(s,10):320},renderHTML:o=>({width:o.width})},height:{default:null,parseHTML:o=>{const r=o.querySelector("img"),s=r==null?void 0:r.getAttribute("height");return s?Number.parseInt(s,10):212},renderHTML:o=>({height:o.height})},align:{default:"center",parseHTML:o=>o.getAttribute("align"),renderHTML:o=>({align:o.align})}}},addNodeView(){return U.ReactNodeViewRenderer(Q)},addCommands(){return{setDrawer:(t,o)=>({commands:r,editor:s})=>o?r.insertContent({type:this.name,attrs:t}):r.insertContentAt(s.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageDrawer:t=>({commands:o})=>o.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:o}=t;return["div",{style:o?`text-align: ${o};`:"",class:"imageDrawer"},["img",F.mergeAttributes(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageDrawer]",getAttrs:t=>{const o=t.querySelector("img"),r=o==null?void 0:o.getAttribute("width"),s=o==null?void 0:o.getAttribute("height");return{src:o==null?void 0:o.getAttribute("src"),alt:o==null?void 0:o.getAttribute("alt"),width:r?Number.parseInt(r,10):null,height:s?Number.parseInt(s,10):null,align:(o==null?void 0:o.getAttribute("align"))||t.style.textAlign||null}}}]}});exports.ControlDrawer=Z;exports.Drawer=X;exports.RichTextDrawer=_e;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as Z, m as te } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { N as pe, a as we } from "./clsx-
|
|
1
|
+
import { s as Z, m as te } from "./index-Dx-Dh7KS.js";
|
|
2
|
+
import { E as X, F as oe, c as d, h as re, u as le, d as ne, D as ie, n as se, A as ae, o as ce, p as he, v as ue, B as de, H as ge, J as me } from "./index-C52cuQ_Y.js";
|
|
3
|
+
import { N as pe, a as we } from "./clsx-_bq4MQQ7.js";
|
|
4
4
|
import { jsx as e, jsxs as x, Fragment as U } from "react/jsx-runtime";
|
|
5
|
-
import { useState as y, useMemo as V, useCallback as q, useEffect as G, useRef as
|
|
6
|
-
import { I as
|
|
5
|
+
import { useState as y, useMemo as V, useCallback as q, useEffect as G, useRef as J } from "react";
|
|
6
|
+
import { I as K, j as Q, k as ve } from "./index-DtyAGMbq.js";
|
|
7
7
|
import { Color4 as g, Editor as fe, makeDropdownToolbar as Te } from "easydrawer";
|
|
8
8
|
import { s as Ce, i as be } from "./shortId-WJVkrvml.js";
|
|
9
9
|
const W = {
|
|
@@ -14,8 +14,8 @@ const W = {
|
|
|
14
14
|
};
|
|
15
15
|
function xe({ editor: t, node: o, updateAttributes: r, getPos: i, selected: T }) {
|
|
16
16
|
const [H, S] = y({
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
17
|
+
width: K,
|
|
18
|
+
height: K
|
|
19
19
|
}), [w, h] = y({
|
|
20
20
|
width: 0,
|
|
21
21
|
height: 0
|
|
@@ -61,7 +61,7 @@ function xe({ editor: t, node: o, updateAttributes: r, getPos: i, selected: T })
|
|
|
61
61
|
...E,
|
|
62
62
|
width: Number.parseInt(u, 10)
|
|
63
63
|
}));
|
|
64
|
-
},
|
|
64
|
+
}, Q),
|
|
65
65
|
[t]
|
|
66
66
|
);
|
|
67
67
|
function O(u, E) {
|
|
@@ -86,7 +86,7 @@ function xe({ editor: t, node: o, updateAttributes: r, getPos: i, selected: T })
|
|
|
86
86
|
width: j,
|
|
87
87
|
height: ee
|
|
88
88
|
});
|
|
89
|
-
},
|
|
89
|
+
}, Q),
|
|
90
90
|
[b, a, H, r, o == null ? void 0 : o.attrs]
|
|
91
91
|
), s = q(
|
|
92
92
|
(u) => {
|
|
@@ -358,7 +358,7 @@ function Oe(t) {
|
|
|
358
358
|
}
|
|
359
359
|
) });
|
|
360
360
|
}
|
|
361
|
-
const Ve = "_wrapper_pva9d_1", Ge = "_tool_pva9d_17", $e = "_active_pva9d_37", Ue = "_pen_pva9d_41", je = "_line_pva9d_48", Ze = "_options_pva9d_56", Xe = "_colorWrap_pva9d_66",
|
|
361
|
+
const Ve = "_wrapper_pva9d_1", Ge = "_tool_pva9d_17", $e = "_active_pva9d_37", Ue = "_pen_pva9d_41", je = "_line_pva9d_48", Ze = "_options_pva9d_56", Xe = "_colorWrap_pva9d_66", Je = "_color_pva9d_66", Ke = "_colorActive_pva9d_83", l = {
|
|
362
362
|
wrapper: Ve,
|
|
363
363
|
tool: Ge,
|
|
364
364
|
active: $e,
|
|
@@ -366,9 +366,9 @@ const Ve = "_wrapper_pva9d_1", Ge = "_tool_pva9d_17", $e = "_active_pva9d_37", U
|
|
|
366
366
|
line: je,
|
|
367
367
|
options: Ze,
|
|
368
368
|
colorWrap: Xe,
|
|
369
|
-
color:
|
|
370
|
-
colorActive:
|
|
371
|
-
},
|
|
369
|
+
color: Je,
|
|
370
|
+
colorActive: Ke
|
|
371
|
+
}, Qe = [
|
|
372
372
|
g.blackHighlight,
|
|
373
373
|
g.ofRGBA(166 / 255, 81 / 255, 167 / 255, 0.3),
|
|
374
374
|
g.ofRGBA(247 / 255, 78 / 255, 158 / 255, 0.3),
|
|
@@ -376,7 +376,7 @@ const Ve = "_wrapper_pva9d_1", Ge = "_tool_pva9d_17", $e = "_active_pva9d_37", U
|
|
|
376
376
|
g.ofRGBA(246 / 255, 130 / 255, 28 / 255, 0.3),
|
|
377
377
|
g.ofRGBA(166 / 255, 198 / 255, 0, 0.3),
|
|
378
378
|
g.ofRGBA(98 / 255, 186 / 255, 70 / 255, 0.3)
|
|
379
|
-
],
|
|
379
|
+
], Y = [
|
|
380
380
|
g.black,
|
|
381
381
|
g.fromHex("#007AFF"),
|
|
382
382
|
g.fromHex("#A651A7"),
|
|
@@ -392,9 +392,9 @@ const Ve = "_wrapper_pva9d_1", Ge = "_tool_pva9d_17", $e = "_active_pva9d_37", U
|
|
|
392
392
|
g.fromHex("#FFFB85"),
|
|
393
393
|
g.fromHex("#AADC99")
|
|
394
394
|
];
|
|
395
|
-
function
|
|
395
|
+
function Ye({ onChange: t }) {
|
|
396
396
|
const [o, r] = y(g.blackHighlight);
|
|
397
|
-
return /* @__PURE__ */ e("div", { className: l.colorWrap, children:
|
|
397
|
+
return /* @__PURE__ */ e("div", { className: l.colorWrap, children: Qe.map((i, T) => /* @__PURE__ */ e(
|
|
398
398
|
"button",
|
|
399
399
|
{
|
|
400
400
|
style: { backgroundColor: i.toHexString() },
|
|
@@ -411,7 +411,7 @@ function Je({ onChange: t }) {
|
|
|
411
411
|
function $({ onChange: t }) {
|
|
412
412
|
const [o, r] = y(g.black);
|
|
413
413
|
return /* @__PURE__ */ x(U, { children: [
|
|
414
|
-
/* @__PURE__ */ e("div", { className: l.colorWrap, children:
|
|
414
|
+
/* @__PURE__ */ e("div", { className: l.colorWrap, children: Y.slice(0, 7).map((i, T) => /* @__PURE__ */ e(
|
|
415
415
|
"button",
|
|
416
416
|
{
|
|
417
417
|
style: { backgroundColor: i.toHexString() },
|
|
@@ -424,7 +424,7 @@ function $({ onChange: t }) {
|
|
|
424
424
|
},
|
|
425
425
|
T
|
|
426
426
|
)) }),
|
|
427
|
-
/* @__PURE__ */ e("div", { className: l.colorWrap, children:
|
|
427
|
+
/* @__PURE__ */ e("div", { className: l.colorWrap, children: Y.slice(7).map((i, T) => /* @__PURE__ */ e(
|
|
428
428
|
"button",
|
|
429
429
|
{
|
|
430
430
|
style: { backgroundColor: i.toHexString() },
|
|
@@ -460,7 +460,7 @@ function et({ setColorPen: t, setThicknessPen: o }) {
|
|
|
460
460
|
] });
|
|
461
461
|
}
|
|
462
462
|
function tt({ setColorHighlight: t }) {
|
|
463
|
-
return /* @__PURE__ */ e("div", { className: l.options, children: /* @__PURE__ */ e(
|
|
463
|
+
return /* @__PURE__ */ e("div", { className: l.options, children: /* @__PURE__ */ e(Ye, { onChange: (o) => t(o) }) });
|
|
464
464
|
}
|
|
465
465
|
function ot({ changeColorShape: t, changeBorderColorShape: o, onThicknessChange: r }) {
|
|
466
466
|
return /* @__PURE__ */ x("div", { className: l.options, children: [
|
|
@@ -853,7 +853,7 @@ function rt(t) {
|
|
|
853
853
|
}
|
|
854
854
|
let I = !1;
|
|
855
855
|
function gt() {
|
|
856
|
-
const t = re(), o = le(lt.name), { isActive: r = void 0, upload: i } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: T } = ne(r), [H, S] = y(!1), w =
|
|
856
|
+
const t = re(), o = le(lt.name), { isActive: r = void 0, upload: i } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: T } = ne(r), [H, S] = y(!1), w = J(null), h = J(null), k = () => {
|
|
857
857
|
(async () => {
|
|
858
858
|
const s = document.querySelector("#easydrawer");
|
|
859
859
|
s && (w.current = new fe(s, {
|
package/lib/Drawer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BGfIcDCQ.cjs");require("./index-aujjnfSJ.cjs");require("./clsx-DRbkQ4T7.cjs");const e=require("./Drawer-D7E9kTca.cjs");exports.Drawer=e.Drawer;exports.RichTextDrawer=e.RichTextDrawer;
|
package/lib/Drawer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import "./index-
|
|
3
|
-
import "./clsx-
|
|
4
|
-
import { D as i, R as m } from "./Drawer-
|
|
1
|
+
import "./index-Dx-Dh7KS.js";
|
|
2
|
+
import "./index-C52cuQ_Y.js";
|
|
3
|
+
import "./clsx-_bq4MQQ7.js";
|
|
4
|
+
import { D as i, R as m } from "./Drawer-DA0FLHs9.js";
|
|
5
5
|
export {
|
|
6
6
|
i as Drawer,
|
|
7
7
|
m as RichTextDrawer
|