@progress/kendo-react-editor 16.2.0-develop.18 → 16.2.0-develop.19

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/Editor.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("react"),s=require("prop-types"),T=require("@progress/kendo-react-buttons"),S=require("@progress/kendo-react-common"),c=require("@progress/kendo-editor-common"),W=require("./config/defaultStyles.js"),Ee=require("./config/toolsSettings.js"),Re=require("./dialogs/index.js"),H=require("./utils/index.js"),G=require("./utils/props-key.js"),Se=require("./utils/controlled-value.js"),J=require("./package-metadata.js"),m=require("./messages/index.js"),we=require("@progress/kendo-react-intl");function Ce(u){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const v in u)if(v!=="default"){const w=Object.getOwnPropertyDescriptor(u,v);Object.defineProperty(k,v,w.get?w:{enumerable:!0,get:()=>u[v]})}}return k.default=u,Object.freeze(k)}const t=Ce(he),{link:Q,bold:Le,italic:Pe,underline:qe}=Ee.EditorToolsSettings,j=t.forwardRef((u,k)=>{const{tools:v=[],defaultEditMode:w="iframe",preserveWhitespace:X="full",style:C,className:Y}=u,[Z,L]=t.useState({view:void 0,linkDialog:!1}),I=t.useRef(null),g=t.useRef(null),F=t.useRef(null),l=t.useRef(void 0),h=t.useRef(null),P=t.useRef(null),q=t.useRef(void 0),a=t.useRef(u);a.current=u;const ee=t.useCallback(e=>{I.current=e},[]),te=t.useCallback(e=>{F.current=e},[]),re=t.useCallback(e=>{g.current=e},[]),[ne]=t.useState(()=>!S.validatePackage(J.packageMetadata,{component:"Editor"})),[ae]=t.useState(()=>S.getLicenseMessage(J.packageMetadata)),B=we.useLocalization(),N=t.useRef(null);t.useImperativeHandle(N,()=>({get element(){return I.current},get contentElement(){return g.current},get view(){return l.current},get value(){return h.current!==null?h.current.doc:a.current.value!==void 0?a.current.value:l.current?l.current.state.doc:a.current.defaultContent||""},get props(){return a.current},focus:()=>{l.current&&l.current.focus()}})),t.useImperativeHandle(k,()=>N.current),S.useWebMcpRegister("editor",N,u,u.webMcp);const p=()=>N.current,oe=t.useRef((e,r)=>{var i,y;const n={target:p(),transaction:e,state:r};return((y=(i=a.current).onExecute)==null?void 0:y.call(i,n))!==!1}).current,se=t.useRef(e=>{if(a.current.onPasteHtml&&q.current){const r={target:p(),pastedHtml:e,nativeEvent:q.current},n=a.current.onPasteHtml(r);if(q.current=void 0,typeof n=="string")return n}return e}).current,ce=t.useRef(e=>{const r=e.docChanged;if(a.current.onChange&&r){h.current=e;const i=e.doc,y=e.doc.type.schema,E={target:p(),value:i,html:"",transaction:e,schema:y};Object.defineProperty(E,"html",{get:()=>(P.current=H.EditorUtils.getHtml({doc:i,schema:y}),P.current)}),a.current.onChange(E)}const n=l.current;n&&(a.current.value===void 0||!r)&&n.updateState(n.state.apply(e))}).current,ue=t.useRef((e,r)=>{if(a.current.onFocus){const n={target:p(),nativeEvent:r};a.current.onFocus(n)}return!1}).current,ie=t.useRef((e,r)=>{if(a.current.onBlur){const n={target:p(),nativeEvent:r};a.current.onBlur(n)}return!1}).current,le=t.useRef((e,r)=>(a.current.onPasteHtml&&(q.current=r),!1)).current,de=t.useRef(e=>{if(a.current.onIFrameInit){const r={target:p(),iframe:e};a.current.onIFrameInit(r)}return!1}).current,fe=t.useRef((e,r)=>{L(n=>({...n,view:e}))}).current;t.useEffect(()=>{var U;const e=F.current,r=e==null?void 0:e.contentWindow;if(r){const o=r.document;if(!o.head.querySelector("meta[charset]")){const f=o.createElement("meta");f.setAttribute("charset","utf-8"),o.head.appendChild(f)}const d=o.body.querySelector(".k-content");d?(d.textContent="",g.current=d):(g.current=o.createElement("div"),o.body.appendChild(g.current),g.current.classList.add("k-content")),g.current.setAttribute("role","textbox"),g.current.setAttribute("aria-label",a.current.ariaLabel||B.toLanguageString(m.keys.contentAreaLabel,m.messages[m.keys.contentAreaLabel])),a.current.ariaLabelledBy&&g.current.setAttribute("aria-labelledby",a.current.ariaLabelledBy),a.current.ariaDescribedBy&&g.current.setAttribute("aria-describedby",a.current.ariaDescribedBy),e&&a.current.onIFrameInit?de(e):o.head.querySelector("style")||[W.defaultStyle,W.tablesStyles,a.current.dir==="rtl"?W.rtlStyles:void 0].forEach(f=>{if(f){const b=o.createElement("style");b.appendChild(o.createTextNode(f)),o.head.appendChild(b)}})}const n=g.current;if(!n)return;const i=(U=a.current.preserveWhitespace)!=null?U:"full",y=[new c.Plugin({view:(()=>({update:fe})),key:new c.PluginKey("toolbar-tools-update-plugin")}),new c.Plugin({filterTransaction:oe,key:new c.PluginKey("onExecute-event-plugin")}),new c.Plugin({key:G.editorPropsKey,state:{init:()=>({preserveWhitespace:i}),apply:(o,d)=>d}}),c.spacesFix(),c.caretColor(),c.history(),c.dropCursor(),c.gapCursor(),c.tableEditing(),c.cspFix()],E={...H.EditorUtils.getShortcuts({types:{listItem:"list_item",hardBreak:"hard_break"},toolsSettings:{bold:Le,italic:Pe,underline:qe}}),"Mod-k":()=>{const o=l.current;if(o){const d=o.state,f=d.selection.empty,b=c.getMark(d,d.schema.marks[Q.mark]);f&&!b||L(R=>R.linkDialog?R:{...R,linkDialog:!0})}return!0},"Alt-F10":()=>{var d;const o=(d=I.current)==null?void 0:d.querySelector(".k-toolbar");if(o){const f=o.querySelector(T.toolbarButtons.join(","));if(f)return f.focus(),!0}return!1}},{defaultContent:pe="",value:D,onMount:x}=a.current,ve=D&&typeof D!="string"?D:H.EditorUtils.createDocument(new c.Schema({nodes:c.nodes,marks:c.marks}),D||pe,{preserveWhitespace:i}),z={state:c.EditorState.create({plugins:[...y,c.keymap(E),c.keymap(c.baseKeymap)],doc:ve}),transformPastedHTML:se,dispatchTransaction:ce,handleDOMEvents:{focus:ue,blur:ie,paste:le},handleDrop:(o,d,f,b)=>{let M=!1;return f.content.nodesBetween(0,f.content.size,R=>{M=M||R.type.name==="table_caption_external"}),M}},ke={plugins:y,shortcuts:E,target:p(),viewProps:z,dom:n},$=(x==null?void 0:x(ke))||new c.EditorView({mount:n},z);return l.current=$,L(o=>({...o,view:$})),()=>{var d,f;l.current&&l.current.destroy(),l.current=void 0;const o=e==null?void 0:e.contentWindow;if(o!=null&&o.document){(f=(d=g.current)==null?void 0:d.parentNode)==null||f.removeChild(g.current);const b=o.document.head;for(;b!=null&&b.firstChild;)b.removeChild(b.firstChild)}}},[]);const O=t.useRef(u.value);if(t.useEffect(()=>{const{value:e}=a.current,r=l.current;if(e===void 0||!r){O.current=e;return}Se.updateEditorValue(r,e,O.current,h.current,P.current),h.current=null,P.current=null,O.current=e}),l.current){const e=G.editorPropsKey.getState(l.current.state);e.preserveWhitespace=X}let A=u.contentStyle;A===void 0&&(C==null?void 0:C.height)===void 0&&(A={height:"300px"});const _=(e,r,n)=>e.displayName||e.name||`tool-${r}-${n}`,ge=(e,r)=>e.map((n,i)=>_(n,r,i)).join("-")||`group-${r}`,K=(e,r,n=!1)=>{const i=t.createElement(e,{view:l.current,dir:u.dir,key:r,className:n?"k-toolbar-button":void 0});return i.type===T.ToolbarSeparator?t.createElement(e,{key:r}):i},me=(e,r,n)=>Z[n]&&t.createElement(e,{view:l.current,settings:r,dir:u.dir,onClose:()=>L(i=>({...i,[n]:!1}))}),V=v.map((e,r)=>Array.isArray(e)?t.createElement(T.ButtonGroup,{key:ge(e,r),className:"k-toolbar-button-group"},e.map((n,i)=>K(n,_(n,r,i)))):K(e,_(e,r,0),!0)),be=B.toLanguageString(m.keys.toolbarAriaLabel,m.messages[m.keys.toolbarAriaLabel]),ye=B.toLanguageString(m.keys.contentAreaLabel,m.messages[m.keys.contentAreaLabel]);return t.createElement("div",{ref:ee,className:S.classNames("k-editor",Y,{"k-editor-resizable":u.resizable}),dir:u.dir,style:C},V.length>0&&t.createElement(T.Toolbar,{className:"k-editor-toolbar",keyboardNavigation:u.keyboardNavigation,ariaLabel:be},V),w==="iframe"?t.createElement("div",{className:"k-editor-content"},t.createElement("iframe",{ref:te,frameBorder:"0",title:B.toLanguageString(m.keys.iframeTitle,m.messages[m.keys.iframeTitle]),style:A,className:"k-iframe"})):t.createElement("div",{ref:re,style:A,className:"k-editor-content",role:"textbox","aria-label":ye,"aria-labelledby":u.ariaLabelledBy,"aria-describedby":u.ariaDescribedBy,suppressContentEditableWarning:!0}),me(Re.EditorDialogs.InsertLinkDialog,Q,"linkDialog"),ne&&t.createElement(S.WatermarkOverlay,{message:ae}))});j.propTypes={defaultContent:s.string,value:s.oneOfType([s.object,s.string]),defaultEditMode:s.oneOf(["iframe","div"]),contentStyle:s.object,dir:s.string,className:s.string,ariaDescribedBy:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,style:s.object,tools:s.arrayOf(s.any),keyboardNavigation:s.bool,resizable:s.bool,preserveWhitespace:s.oneOf([!0,!1,"full"]),onMount:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onPasteHtml:s.func,onExecute:s.func,onIFrameInit:s.func};j.displayName="KendoReactEditor";exports.Editor=j;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("react"),s=require("prop-types"),T=require("@progress/kendo-react-buttons"),S=require("@progress/kendo-react-common"),u=require("@progress/kendo-editor-common"),G=require("./config/schema.js"),W=require("./config/defaultStyles.js"),Re=require("./config/toolsSettings.js"),Se=require("./dialogs/index.js"),H=require("./utils/index.js"),J=require("./utils/props-key.js"),we=require("./utils/controlled-value.js"),Q=require("./package-metadata.js"),g=require("./messages/index.js"),Ce=require("@progress/kendo-react-intl");function Le(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const v in c)if(v!=="default"){const w=Object.getOwnPropertyDescriptor(c,v);Object.defineProperty(k,v,w.get?w:{enumerable:!0,get:()=>c[v]})}}return k.default=c,Object.freeze(k)}const t=Le(Ee),{link:X,bold:Pe,italic:qe,underline:Ne}=Re.EditorToolsSettings,j=t.forwardRef((c,k)=>{const{tools:v=[],defaultEditMode:w="iframe",preserveWhitespace:Y="full",style:C,className:Z}=c,[ee,L]=t.useState({view:void 0,linkDialog:!1}),I=t.useRef(null),m=t.useRef(null),F=t.useRef(null),l=t.useRef(void 0),h=t.useRef(null),P=t.useRef(null),q=t.useRef(void 0),a=t.useRef(c);a.current=c;const te=t.useCallback(e=>{I.current=e},[]),re=t.useCallback(e=>{F.current=e},[]),ne=t.useCallback(e=>{m.current=e},[]),[ae]=t.useState(()=>!S.validatePackage(Q.packageMetadata,{component:"Editor"})),[oe]=t.useState(()=>S.getLicenseMessage(Q.packageMetadata)),N=Ce.useLocalization(),B=t.useRef(null);t.useImperativeHandle(B,()=>({get element(){return I.current},get contentElement(){return m.current},get view(){return l.current},get value(){return h.current!==null?h.current.doc:a.current.value!==void 0?a.current.value:l.current?l.current.state.doc:a.current.defaultContent||""},get props(){return a.current},focus:()=>{l.current&&l.current.focus()}})),t.useImperativeHandle(k,()=>B.current),S.useWebMcpRegister("editor",B,c,c.webMcp);const p=()=>B.current,se=t.useRef((e,r)=>{var i,y;const n={target:p(),transaction:e,state:r};return((y=(i=a.current).onExecute)==null?void 0:y.call(i,n))!==!1}).current,ce=t.useRef(e=>{if(a.current.onPasteHtml&&q.current){const r={target:p(),pastedHtml:e,nativeEvent:q.current},n=a.current.onPasteHtml(r);if(q.current=void 0,typeof n=="string")return n}return e}).current,ue=t.useRef(e=>{const r=e.docChanged;if(a.current.onChange&&r){h.current=e;const i=e.doc,y=e.doc.type.schema,E={target:p(),value:i,html:"",transaction:e,schema:y};Object.defineProperty(E,"html",{get:()=>(P.current=H.EditorUtils.getHtml({doc:i,schema:y}),P.current)}),a.current.onChange(E)}const n=l.current;n&&(a.current.value===void 0||!r)&&n.updateState(n.state.apply(e))}).current,ie=t.useRef((e,r)=>{if(a.current.onFocus){const n={target:p(),nativeEvent:r};a.current.onFocus(n)}return!1}).current,le=t.useRef((e,r)=>{if(a.current.onBlur){const n={target:p(),nativeEvent:r};a.current.onBlur(n)}return!1}).current,de=t.useRef((e,r)=>(a.current.onPasteHtml&&(q.current=r),!1)).current,fe=t.useRef(e=>{if(a.current.onIFrameInit){const r={target:p(),iframe:e};a.current.onIFrameInit(r)}return!1}).current,me=t.useRef((e,r)=>{L(n=>({...n,view:e}))}).current;t.useEffect(()=>{var U;const e=F.current,r=e==null?void 0:e.contentWindow;if(r){const o=r.document;if(!o.head.querySelector("meta[charset]")){const f=o.createElement("meta");f.setAttribute("charset","utf-8"),o.head.appendChild(f)}const d=o.body.querySelector(".k-content");d?(d.textContent="",m.current=d):(m.current=o.createElement("div"),o.body.appendChild(m.current),m.current.classList.add("k-content")),m.current.setAttribute("role","textbox"),m.current.setAttribute("aria-label",a.current.ariaLabel||N.toLanguageString(g.keys.contentAreaLabel,g.messages[g.keys.contentAreaLabel])),a.current.ariaLabelledBy&&m.current.setAttribute("aria-labelledby",a.current.ariaLabelledBy),a.current.ariaDescribedBy&&m.current.setAttribute("aria-describedby",a.current.ariaDescribedBy),e&&a.current.onIFrameInit?fe(e):o.head.querySelector("style")||[W.defaultStyle,W.tablesStyles,a.current.dir==="rtl"?W.rtlStyles:void 0].forEach(f=>{if(f){const b=o.createElement("style");b.appendChild(o.createTextNode(f)),o.head.appendChild(b)}})}const n=m.current;if(!n)return;const i=(U=a.current.preserveWhitespace)!=null?U:"full",y=[new u.Plugin({view:(()=>({update:me})),key:new u.PluginKey("toolbar-tools-update-plugin")}),new u.Plugin({filterTransaction:se,key:new u.PluginKey("onExecute-event-plugin")}),new u.Plugin({key:J.editorPropsKey,state:{init:()=>({preserveWhitespace:i}),apply:(o,d)=>d}}),u.spacesFix(),u.caretColor(),u.history(),u.dropCursor(),u.gapCursor(),u.tableEditing(),u.cspFix()],E={...H.EditorUtils.getShortcuts({types:{listItem:"list_item",hardBreak:"hard_break"},toolsSettings:{bold:Pe,italic:qe,underline:Ne}}),"Mod-k":()=>{const o=l.current;if(o){const d=o.state,f=d.selection.empty,b=u.getMark(d,d.schema.marks[X.mark]);f&&!b||L(R=>R.linkDialog?R:{...R,linkDialog:!0})}return!0},"Alt-F10":()=>{var d;const o=(d=I.current)==null?void 0:d.querySelector(".k-toolbar");if(o){const f=o.querySelector(T.toolbarButtons.join(","));if(f)return f.focus(),!0}return!1}},{defaultContent:ve="",value:D,onMount:x}=a.current,ke=D&&typeof D!="string"?G.sanitizeLinkNode(D):H.EditorUtils.createDocument(new u.Schema({nodes:u.nodes,marks:G.marks}),D||ve,{preserveWhitespace:i}),V={state:u.EditorState.create({plugins:[...y,u.keymap(E),u.keymap(u.baseKeymap)],doc:ke}),transformPastedHTML:ce,dispatchTransaction:ue,handleDOMEvents:{focus:ie,blur:le,paste:de},handleDrop:(o,d,f,b)=>{let M=!1;return f.content.nodesBetween(0,f.content.size,R=>{M=M||R.type.name==="table_caption_external"}),M}},he={plugins:y,shortcuts:E,target:p(),viewProps:V,dom:n},$=(x==null?void 0:x(he))||new u.EditorView({mount:n},V);return l.current=$,L(o=>({...o,view:$})),()=>{var d,f;l.current&&l.current.destroy(),l.current=void 0;const o=e==null?void 0:e.contentWindow;if(o!=null&&o.document){(f=(d=m.current)==null?void 0:d.parentNode)==null||f.removeChild(m.current);const b=o.document.head;for(;b!=null&&b.firstChild;)b.removeChild(b.firstChild)}}},[]);const O=t.useRef(c.value);if(t.useEffect(()=>{const{value:e}=a.current,r=l.current;if(e===void 0||!r){O.current=e;return}we.updateEditorValue(r,e,O.current,h.current,P.current),h.current=null,P.current=null,O.current=e}),l.current){const e=J.editorPropsKey.getState(l.current.state);e.preserveWhitespace=Y}let A=c.contentStyle;A===void 0&&(C==null?void 0:C.height)===void 0&&(A={height:"300px"});const _=(e,r,n)=>e.displayName||e.name||`tool-${r}-${n}`,ge=(e,r)=>e.map((n,i)=>_(n,r,i)).join("-")||`group-${r}`,z=(e,r,n=!1)=>{const i=t.createElement(e,{view:l.current,dir:c.dir,key:r,className:n?"k-toolbar-button":void 0});return i.type===T.ToolbarSeparator?t.createElement(e,{key:r}):i},be=(e,r,n)=>ee[n]&&t.createElement(e,{view:l.current,settings:r,dir:c.dir,onClose:()=>L(i=>({...i,[n]:!1}))}),K=v.map((e,r)=>Array.isArray(e)?t.createElement(T.ButtonGroup,{key:ge(e,r),className:"k-toolbar-button-group"},e.map((n,i)=>z(n,_(n,r,i)))):z(e,_(e,r,0),!0)),ye=N.toLanguageString(g.keys.toolbarAriaLabel,g.messages[g.keys.toolbarAriaLabel]),pe=N.toLanguageString(g.keys.contentAreaLabel,g.messages[g.keys.contentAreaLabel]);return t.createElement("div",{ref:te,className:S.classNames("k-editor",Z,{"k-editor-resizable":c.resizable}),dir:c.dir,style:C},K.length>0&&t.createElement(T.Toolbar,{className:"k-editor-toolbar",keyboardNavigation:c.keyboardNavigation,ariaLabel:ye},K),w==="iframe"?t.createElement("div",{className:"k-editor-content"},t.createElement("iframe",{ref:re,frameBorder:"0",title:N.toLanguageString(g.keys.iframeTitle,g.messages[g.keys.iframeTitle]),style:A,className:"k-iframe"})):t.createElement("div",{ref:ne,style:A,className:"k-editor-content",role:"textbox","aria-label":pe,"aria-labelledby":c.ariaLabelledBy,"aria-describedby":c.ariaDescribedBy,suppressContentEditableWarning:!0}),be(Se.EditorDialogs.InsertLinkDialog,X,"linkDialog"),ae&&t.createElement(S.WatermarkOverlay,{message:oe}))});j.propTypes={defaultContent:s.string,value:s.oneOfType([s.object,s.string]),defaultEditMode:s.oneOf(["iframe","div"]),contentStyle:s.object,dir:s.string,className:s.string,ariaDescribedBy:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,style:s.object,tools:s.arrayOf(s.any),keyboardNavigation:s.bool,resizable:s.bool,preserveWhitespace:s.oneOf([!0,!1,"full"]),onMount:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onPasteHtml:s.func,onExecute:s.func,onIFrameInit:s.func};j.displayName="KendoReactEditor";exports.Editor=j;
package/Editor.mjs CHANGED
@@ -8,30 +8,31 @@
8
8
  import * as t from "react";
9
9
  import c from "prop-types";
10
10
  import { ButtonGroup as ke, Toolbar as Ee, toolbarButtons as Re, ToolbarSeparator as we } from "@progress/kendo-react-buttons";
11
- import { validatePackage as Ce, getLicenseMessage as Se, useWebMcpRegister as Le, classNames as Ae, WatermarkOverlay as Be } from "@progress/kendo-react-common";
12
- import { Plugin as W, PluginKey as j, spacesFix as Ne, caretColor as Pe, history as De, dropCursor as Ie, gapCursor as Te, tableEditing as We, cspFix as xe, Schema as He, marks as Me, nodes as _e, EditorState as Fe, keymap as z, baseKeymap as Oe, EditorView as Ve, getMark as je } from "@progress/kendo-editor-common";
13
- import { defaultStyle as ze, tablesStyles as qe, rtlStyles as Ke } from "./config/defaultStyles.mjs";
14
- import { EditorToolsSettings as $e } from "./config/toolsSettings.mjs";
15
- import { EditorDialogs as Ge } from "./dialogs/index.mjs";
11
+ import { validatePackage as Ce, getLicenseMessage as Se, useWebMcpRegister as Le, classNames as Ne, WatermarkOverlay as Ae } from "@progress/kendo-react-common";
12
+ import { Plugin as W, PluginKey as V, spacesFix as Be, caretColor as Pe, history as De, dropCursor as Ie, gapCursor as Te, tableEditing as We, cspFix as xe, Schema as He, nodes as Me, EditorState as _e, keymap as j, baseKeymap as Fe, EditorView as Oe, getMark as ze } from "@progress/kendo-editor-common";
13
+ import { sanitizeLinkNode as Ve, marks as je } from "./config/schema.mjs";
14
+ import { defaultStyle as qe, tablesStyles as Ke, rtlStyles as $e } from "./config/defaultStyles.mjs";
15
+ import { EditorToolsSettings as Ge } from "./config/toolsSettings.mjs";
16
+ import { EditorDialogs as Ue } from "./dialogs/index.mjs";
16
17
  import { EditorUtils as x } from "./utils/index.mjs";
17
18
  import { editorPropsKey as q } from "./utils/props-key.mjs";
18
- import { updateEditorValue as Ue } from "./utils/controlled-value.mjs";
19
+ import { updateEditorValue as Je } from "./utils/controlled-value.mjs";
19
20
  import { packageMetadata as K } from "./package-metadata.mjs";
20
- import { keys as b, messages as N } from "./messages/index.mjs";
21
- import { useLocalization as Je } from "@progress/kendo-react-intl";
22
- const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d, U) => {
21
+ import { keys as b, messages as B } from "./messages/index.mjs";
22
+ import { useLocalization as Qe } from "@progress/kendo-react-intl";
23
+ const { link: $, bold: Xe, italic: Ye, underline: Ze } = Ge, G = t.forwardRef((d, U) => {
23
24
  const { tools: J = [], defaultEditMode: Q = "iframe", preserveWhitespace: X = "full", style: k, className: Y } = d, [Z, E] = t.useState({
24
25
  view: void 0,
25
26
  linkDialog: !1
26
- }), P = t.useRef(null), f = t.useRef(null), H = t.useRef(null), i = t.useRef(void 0), v = t.useRef(null), R = t.useRef(null), w = t.useRef(void 0), a = t.useRef(d);
27
- a.current = d;
27
+ }), P = t.useRef(null), f = t.useRef(null), H = t.useRef(null), i = t.useRef(void 0), v = t.useRef(null), R = t.useRef(null), w = t.useRef(void 0), o = t.useRef(d);
28
+ o.current = d;
28
29
  const ee = t.useCallback((e) => {
29
30
  P.current = e;
30
31
  }, []), te = t.useCallback((e) => {
31
32
  H.current = e;
32
33
  }, []), re = t.useCallback((e) => {
33
34
  f.current = e;
34
- }, []), [ne] = t.useState(() => !Ce(K, { component: "Editor" })), [ae] = t.useState(() => Se(K)), C = Je(), S = t.useRef(null);
35
+ }, []), [ne] = t.useState(() => !Ce(K, { component: "Editor" })), [oe] = t.useState(() => Se(K)), C = Qe(), S = t.useRef(null);
35
36
  t.useImperativeHandle(
36
37
  S,
37
38
  () => ({
@@ -45,34 +46,34 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
45
46
  return i.current;
46
47
  },
47
48
  get value() {
48
- return v.current !== null ? v.current.doc : a.current.value !== void 0 ? a.current.value : i.current ? i.current.state.doc : a.current.defaultContent || "";
49
+ return v.current !== null ? v.current.doc : o.current.value !== void 0 ? o.current.value : i.current ? i.current.state.doc : o.current.defaultContent || "";
49
50
  },
50
51
  get props() {
51
- return a.current;
52
+ return o.current;
52
53
  },
53
54
  focus: () => {
54
55
  i.current && i.current.focus();
55
56
  }
56
57
  })
57
58
  ), t.useImperativeHandle(U, () => S.current), Le("editor", S, d, d.webMcp);
58
- const p = () => S.current, oe = t.useRef((e, r) => {
59
+ const p = () => S.current, ae = t.useRef((e, r) => {
59
60
  var s, g;
60
61
  const n = { target: p(), transaction: e, state: r };
61
- return ((g = (s = a.current).onExecute) == null ? void 0 : g.call(s, n)) !== !1;
62
+ return ((g = (s = o.current).onExecute) == null ? void 0 : g.call(s, n)) !== !1;
62
63
  }).current, ce = t.useRef((e) => {
63
- if (a.current.onPasteHtml && w.current) {
64
+ if (o.current.onPasteHtml && w.current) {
64
65
  const r = {
65
66
  target: p(),
66
67
  pastedHtml: e,
67
68
  nativeEvent: w.current
68
- }, n = a.current.onPasteHtml(r);
69
+ }, n = o.current.onPasteHtml(r);
69
70
  if (w.current = void 0, typeof n == "string")
70
71
  return n;
71
72
  }
72
73
  return e;
73
74
  }).current, se = t.useRef((e) => {
74
75
  const r = e.docChanged;
75
- if (a.current.onChange && r) {
76
+ if (o.current.onChange && r) {
76
77
  v.current = e;
77
78
  const s = e.doc, g = e.doc.type.schema, y = {
78
79
  target: p(),
@@ -83,58 +84,58 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
83
84
  };
84
85
  Object.defineProperty(y, "html", {
85
86
  get: () => (R.current = x.getHtml({ doc: s, schema: g }), R.current)
86
- }), a.current.onChange(y);
87
+ }), o.current.onChange(y);
87
88
  }
88
89
  const n = i.current;
89
- n && (a.current.value === void 0 || !r) && n.updateState(n.state.apply(e));
90
+ n && (o.current.value === void 0 || !r) && n.updateState(n.state.apply(e));
90
91
  }).current, ie = t.useRef((e, r) => {
91
- if (a.current.onFocus) {
92
+ if (o.current.onFocus) {
92
93
  const n = {
93
94
  target: p(),
94
95
  nativeEvent: r
95
96
  };
96
- a.current.onFocus(n);
97
+ o.current.onFocus(n);
97
98
  }
98
99
  return !1;
99
100
  }).current, ue = t.useRef((e, r) => {
100
- if (a.current.onBlur) {
101
+ if (o.current.onBlur) {
101
102
  const n = {
102
103
  target: p(),
103
104
  nativeEvent: r
104
105
  };
105
- a.current.onBlur(n);
106
+ o.current.onBlur(n);
106
107
  }
107
108
  return !1;
108
- }).current, le = t.useRef((e, r) => (a.current.onPasteHtml && (w.current = r), !1)).current, de = t.useRef((e) => {
109
- if (a.current.onIFrameInit) {
109
+ }).current, le = t.useRef((e, r) => (o.current.onPasteHtml && (w.current = r), !1)).current, de = t.useRef((e) => {
110
+ if (o.current.onIFrameInit) {
110
111
  const r = {
111
112
  target: p(),
112
113
  iframe: e
113
114
  };
114
- a.current.onIFrameInit(r);
115
+ o.current.onIFrameInit(r);
115
116
  }
116
117
  return !1;
117
118
  }).current, fe = t.useRef((e, r) => {
118
119
  E((n) => ({ ...n, view: e }));
119
120
  }).current;
120
121
  t.useEffect(() => {
121
- var V;
122
+ var z;
122
123
  const e = H.current, r = e == null ? void 0 : e.contentWindow;
123
124
  if (r) {
124
- const o = r.document;
125
- if (!o.head.querySelector("meta[charset]")) {
126
- const l = o.createElement("meta");
127
- l.setAttribute("charset", "utf-8"), o.head.appendChild(l);
125
+ const a = r.document;
126
+ if (!a.head.querySelector("meta[charset]")) {
127
+ const l = a.createElement("meta");
128
+ l.setAttribute("charset", "utf-8"), a.head.appendChild(l);
128
129
  }
129
- const u = o.body.querySelector(".k-content");
130
- u ? (u.textContent = "", f.current = u) : (f.current = o.createElement("div"), o.body.appendChild(f.current), f.current.classList.add("k-content")), f.current.setAttribute("role", "textbox"), f.current.setAttribute(
130
+ const u = a.body.querySelector(".k-content");
131
+ u ? (u.textContent = "", f.current = u) : (f.current = a.createElement("div"), a.body.appendChild(f.current), f.current.classList.add("k-content")), f.current.setAttribute("role", "textbox"), f.current.setAttribute(
131
132
  "aria-label",
132
- a.current.ariaLabel || C.toLanguageString(b.contentAreaLabel, N[b.contentAreaLabel])
133
- ), a.current.ariaLabelledBy && f.current.setAttribute("aria-labelledby", a.current.ariaLabelledBy), a.current.ariaDescribedBy && f.current.setAttribute("aria-describedby", a.current.ariaDescribedBy), e && a.current.onIFrameInit ? de(e) : o.head.querySelector("style") || [ze, qe, a.current.dir === "rtl" ? Ke : void 0].forEach(
133
+ o.current.ariaLabel || C.toLanguageString(b.contentAreaLabel, B[b.contentAreaLabel])
134
+ ), o.current.ariaLabelledBy && f.current.setAttribute("aria-labelledby", o.current.ariaLabelledBy), o.current.ariaDescribedBy && f.current.setAttribute("aria-describedby", o.current.ariaDescribedBy), e && o.current.onIFrameInit ? de(e) : a.head.querySelector("style") || [qe, Ke, o.current.dir === "rtl" ? $e : void 0].forEach(
134
135
  (l) => {
135
136
  if (l) {
136
- const m = o.createElement("style");
137
- m.appendChild(o.createTextNode(l)), o.head.appendChild(m);
137
+ const m = a.createElement("style");
138
+ m.appendChild(a.createTextNode(l)), a.head.appendChild(m);
138
139
  }
139
140
  }
140
141
  );
@@ -142,24 +143,24 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
142
143
  const n = f.current;
143
144
  if (!n)
144
145
  return;
145
- const s = (V = a.current.preserveWhitespace) != null ? V : "full", g = [
146
+ const s = (z = o.current.preserveWhitespace) != null ? z : "full", g = [
146
147
  // https://prosemirror.net/docs/ref/#state.PluginSpec
147
148
  new W({
148
149
  view: (() => ({ update: fe })),
149
- key: new j("toolbar-tools-update-plugin")
150
+ key: new V("toolbar-tools-update-plugin")
150
151
  }),
151
152
  new W({
152
- filterTransaction: oe,
153
- key: new j("onExecute-event-plugin")
153
+ filterTransaction: ae,
154
+ key: new V("onExecute-event-plugin")
154
155
  }),
155
156
  new W({
156
157
  key: q,
157
158
  state: {
158
159
  init: () => ({ preserveWhitespace: s }),
159
- apply: (o, u) => u
160
+ apply: (a, u) => u
160
161
  }
161
162
  }),
162
- Ne(),
163
+ Be(),
163
164
  Pe(),
164
165
  De(),
165
166
  Ie(),
@@ -169,31 +170,31 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
169
170
  ], y = {
170
171
  ...x.getShortcuts({
171
172
  types: { listItem: "list_item", hardBreak: "hard_break" },
172
- toolsSettings: { bold: Qe, italic: Xe, underline: Ye }
173
+ toolsSettings: { bold: Xe, italic: Ye, underline: Ze }
173
174
  }),
174
175
  "Mod-k": () => {
175
- const o = i.current;
176
- if (o) {
177
- const u = o.state, l = u.selection.empty, m = je(u, u.schema.marks[$.mark]);
176
+ const a = i.current;
177
+ if (a) {
178
+ const u = a.state, l = u.selection.empty, m = ze(u, u.schema.marks[$.mark]);
178
179
  l && !m || E((h) => h.linkDialog ? h : { ...h, linkDialog: !0 });
179
180
  }
180
181
  return !0;
181
182
  },
182
183
  "Alt-F10": () => {
183
184
  var u;
184
- const o = (u = P.current) == null ? void 0 : u.querySelector(".k-toolbar");
185
- if (o) {
186
- const l = o.querySelector(Re.join(","));
185
+ const a = (u = P.current) == null ? void 0 : u.querySelector(".k-toolbar");
186
+ if (a) {
187
+ const l = a.querySelector(Re.join(","));
187
188
  if (l)
188
189
  return l.focus(), !0;
189
190
  }
190
191
  return !1;
191
192
  }
192
- }, { defaultContent: ve = "", value: A, onMount: T } = a.current, ye = A && typeof A != "string" ? A : x.createDocument(new He({ nodes: _e, marks: Me }), A || ve, {
193
+ }, { defaultContent: ve = "", value: N, onMount: T } = o.current, ye = N && typeof N != "string" ? Ve(N) : x.createDocument(new He({ nodes: Me, marks: je }), N || ve, {
193
194
  preserveWhitespace: s
194
195
  }), F = {
195
- state: Fe.create({
196
- plugins: [...g, z(y), z(Oe)],
196
+ state: _e.create({
197
+ plugins: [...g, j(y), j(Fe)],
197
198
  doc: ye
198
199
  }),
199
200
  transformPastedHTML: ce,
@@ -203,20 +204,20 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
203
204
  blur: ue,
204
205
  paste: le
205
206
  },
206
- handleDrop: (o, u, l, m) => {
207
- let B = !1;
207
+ handleDrop: (a, u, l, m) => {
208
+ let A = !1;
208
209
  return l.content.nodesBetween(0, l.content.size, (h) => {
209
- B = B || h.type.name === "table_caption_external";
210
- }), B;
210
+ A = A || h.type.name === "table_caption_external";
211
+ }), A;
211
212
  }
212
- }, he = { plugins: g, shortcuts: y, target: p(), viewProps: F, dom: n }, O = (T == null ? void 0 : T(he)) || new Ve({ mount: n }, F);
213
- return i.current = O, E((o) => ({ ...o, view: O })), () => {
213
+ }, he = { plugins: g, shortcuts: y, target: p(), viewProps: F, dom: n }, O = (T == null ? void 0 : T(he)) || new Oe({ mount: n }, F);
214
+ return i.current = O, E((a) => ({ ...a, view: O })), () => {
214
215
  var u, l;
215
216
  i.current && i.current.destroy(), i.current = void 0;
216
- const o = e == null ? void 0 : e.contentWindow;
217
- if (o != null && o.document) {
217
+ const a = e == null ? void 0 : e.contentWindow;
218
+ if (a != null && a.document) {
218
219
  (l = (u = f.current) == null ? void 0 : u.parentNode) == null || l.removeChild(f.current);
219
- const m = o.document.head;
220
+ const m = a.document.head;
220
221
  for (; m != null && m.firstChild; )
221
222
  m.removeChild(m.firstChild);
222
223
  }
@@ -224,12 +225,12 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
224
225
  }, []);
225
226
  const D = t.useRef(d.value);
226
227
  if (t.useEffect(() => {
227
- const { value: e } = a.current, r = i.current;
228
+ const { value: e } = o.current, r = i.current;
228
229
  if (e === void 0 || !r) {
229
230
  D.current = e;
230
231
  return;
231
232
  }
232
- Ue(r, e, D.current, v.current, R.current), v.current = null, R.current = null, D.current = e;
233
+ Je(r, e, D.current, v.current, R.current), v.current = null, R.current = null, D.current = e;
233
234
  }), i.current) {
234
235
  const e = q.getState(i.current.state);
235
236
  e.preserveWhitespace = X;
@@ -259,16 +260,16 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
259
260
  (e, r) => Array.isArray(e) ? /* @__PURE__ */ t.createElement(ke, { key: me(e, r), className: "k-toolbar-button-group" }, e.map((n, s) => M(n, I(n, r, s)))) : M(e, I(e, r, 0), !0)
260
261
  ), be = C.toLanguageString(
261
262
  b.toolbarAriaLabel,
262
- N[b.toolbarAriaLabel]
263
+ B[b.toolbarAriaLabel]
263
264
  ), pe = C.toLanguageString(
264
265
  b.contentAreaLabel,
265
- N[b.contentAreaLabel]
266
+ B[b.contentAreaLabel]
266
267
  );
267
268
  return /* @__PURE__ */ t.createElement(
268
269
  "div",
269
270
  {
270
271
  ref: ee,
271
- className: Ae("k-editor", Y, { "k-editor-resizable": d.resizable }),
272
+ className: Ne("k-editor", Y, { "k-editor-resizable": d.resizable }),
272
273
  dir: d.dir,
273
274
  style: k
274
275
  },
@@ -286,7 +287,7 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
286
287
  {
287
288
  ref: te,
288
289
  frameBorder: "0",
289
- title: C.toLanguageString(b.iframeTitle, N[b.iframeTitle]),
290
+ title: C.toLanguageString(b.iframeTitle, B[b.iframeTitle]),
290
291
  style: L,
291
292
  className: "k-iframe"
292
293
  }
@@ -303,8 +304,8 @@ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d
303
304
  suppressContentEditableWarning: !0
304
305
  }
305
306
  ),
306
- ge(Ge.InsertLinkDialog, $, "linkDialog"),
307
- ne && /* @__PURE__ */ t.createElement(Be, { message: ae })
307
+ ge(Ue.InsertLinkDialog, $, "linkDialog"),
308
+ ne && /* @__PURE__ */ t.createElement(Ae, { message: oe })
308
309
  );
309
310
  });
310
311
  G.propTypes = {
@@ -5,4 +5,14 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- export { marks, nodes } from '@progress/kendo-editor-common';
8
+ import { MarkSpec, Node, Schema, parseContent as parseContentCommon } from '@progress/kendo-editor-common';
9
+ export { nodes } from '@progress/kendo-editor-common';
10
+ declare const marks: {
11
+ link: MarkSpec;
12
+ };
13
+ /** @hidden */
14
+ export declare const sanitizeLinkSchema: (schema: Schema) => Schema;
15
+ export declare const parseContent: typeof parseContentCommon;
16
+ /** @hidden */
17
+ export declare const sanitizeLinkNode: (node: Node) => Node;
18
+ export { marks };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-editor-common"),k=require("@progress/kendo-react-common"),u=t=>{const r=(t.parseDOM||[]).map(i=>({...i,getAttrs:c=>{const s=typeof i.getAttrs=="function"?i.getAttrs(c):{};return s&&typeof s=="object"&&"href"in s&&(s.href=k.sanitizeUrl(s.href)||null),s}})),n=t.toDOM;return{...t,parseDOM:r,toDOM:typeof n=="function"?(i,c)=>{var s;return n({...i,attrs:{...i.attrs,href:k.sanitizeUrl((s=i.attrs)==null?void 0:s.href)||null}},c)}:n}},l={...a.marks,link:u(a.marks.link)},o=new WeakMap,p=new WeakMap,m=t=>{const r=o.get(t);if(r)return r;const n=t.spec.marks.get("link");if(!n)return o.set(t,t),t;const e=new a.Schema({...t.spec,marks:t.spec.marks.update("link",u(n))});return o.set(t,e),o.set(e,e),e},f=t=>{const r=t.marks.map(e=>e.type.name==="link"?e.type.create({...e.attrs,href:k.sanitizeUrl(e.attrs.href)||null}):e);if(t.isText)return t.mark(r);const n=[];return t.forEach(e=>n.push(f(e))),t.copy(a.Fragment.fromArray(n)).mark(r)},h=(t,r,n)=>f(a.parseContent(t,r,n)),d=t=>{const r=p.get(t);if(r)return r;const n=m(t.type.schema),e=f(n===t.type.schema?t:n.nodeFromJSON(t.toJSON()));return p.set(t,e),p.set(e,e),e};Object.defineProperty(exports,"nodes",{enumerable:!0,get:()=>a.nodes});exports.marks=l;exports.parseContent=h;exports.sanitizeLinkNode=d;exports.sanitizeLinkSchema=m;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { marks as k, parseContent as h, Fragment as u, Schema as l } from "@progress/kendo-editor-common";
9
+ import { nodes as d } from "@progress/kendo-editor-common";
10
+ import { sanitizeUrl as p } from "@progress/kendo-react-common";
11
+ const m = (t) => {
12
+ const r = (t.parseDOM || []).map((a) => ({
13
+ ...a,
14
+ getAttrs: (i) => {
15
+ const n = typeof a.getAttrs == "function" ? a.getAttrs(i) : {};
16
+ return n && typeof n == "object" && "href" in n && (n.href = p(n.href) || null), n;
17
+ }
18
+ })), s = t.toDOM;
19
+ return { ...t, parseDOM: r, toDOM: typeof s == "function" ? (a, i) => {
20
+ var n;
21
+ return s(
22
+ {
23
+ ...a,
24
+ attrs: { ...a.attrs, href: p((n = a.attrs) == null ? void 0 : n.href) || null }
25
+ },
26
+ i
27
+ );
28
+ } : s };
29
+ }, g = { ...k, link: m(k.link) }, o = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), M = (t) => {
30
+ const r = o.get(t);
31
+ if (r)
32
+ return r;
33
+ const s = t.spec.marks.get("link");
34
+ if (!s)
35
+ return o.set(t, t), t;
36
+ const e = new l({
37
+ ...t.spec,
38
+ marks: t.spec.marks.update("link", m(s))
39
+ });
40
+ return o.set(t, e), o.set(e, e), e;
41
+ }, f = (t) => {
42
+ const r = t.marks.map(
43
+ (e) => e.type.name === "link" ? e.type.create({ ...e.attrs, href: p(e.attrs.href) || null }) : e
44
+ );
45
+ if (t.isText)
46
+ return t.mark(r);
47
+ const s = [];
48
+ return t.forEach((e) => s.push(f(e))), t.copy(u.fromArray(s)).mark(r);
49
+ }, O = (t, r, s) => f(h(t, r, s)), S = (t) => {
50
+ const r = c.get(t);
51
+ if (r)
52
+ return r;
53
+ const s = M(t.type.schema), e = f(s === t.type.schema ? t : s.nodeFromJSON(t.toJSON()));
54
+ return c.set(t, e), c.set(e, e), e;
55
+ };
56
+ export {
57
+ g as marks,
58
+ d as nodes,
59
+ O as parseContent,
60
+ S as sanitizeLinkNode,
61
+ M as sanitizeLinkSchema
62
+ };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),y=require("@progress/kendo-react-dialogs"),C=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-react-inputs"),c=require("@progress/kendo-react-form"),w=require("@progress/kendo-editor-common"),L=require("@progress/kendo-react-intl"),o=require("../messages/index.js");function x(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const e=x(S);let F=class extends e.Component{constructor(){super(...arguments),this.href=null,this.title=null,this.target=null,this.onClose=()=>{this.props.view.focus(),this.props.onClose()},this.onInsert=()=>{const t=this.props.view,n=this.props.settings.mark,r={href:this.href?this.href.value:void 0,title:this.title?this.title.value:void 0,target:this.target&&this.target.element&&this.target.element.checked?"_blank":void 0};w.applyLink({mark:n,attrs:r},this.props.settings.commandName)(t.state,t.dispatch),this.onClose()}}render(){const{view:t,settings:n,dir:r,render:u}=this.props,l=L.provideLocalizationService(this),{insertHyperlinkDialogTitle:d,insertHyperlinkAddress:g,insertHyperlinkTitle:k,insertHyperlinkNewWindow:h,insertHyperlinkCancel:p,insertHyperlinkInsert:f}=n.messages,a=t?w.getMark(t.state,t.state.schema.marks[n.mark]):!1,v=e.createElement(c.Form,{render:()=>e.createElement(c.FormElement,{horizontal:!0},e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-url",className:"k-form-label"},l.toLanguageString(g,o.messages[g])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(m.Input,{type:"text",id:"k-editor-link-url",ref:i=>{this.href=i&&i.element},defaultValue:a&&a.attrs.href||void 0,autoFocus:!0}))),e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-text",className:"k-form-label"},l.toLanguageString(k,o.messages[k])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(m.Input,{type:"text",id:"k-editor-link-text",ref:i=>{this.title=i&&i.element},defaultValue:a&&a.attrs.title||void 0}))),n.linkTarget!==!1&&e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-target",className:"k-checkbox-label"},e.createElement(m.Checkbox,{id:"k-editor-link-target",ref:i=>{this.target=i},defaultChecked:a&&!!a.attrs.target||void 0}),l.toLanguageString(h,o.messages[h]))))}),E=[e.createElement(C.Button,{onClick:this.onClose,dir:r,key:"cancel"},l.toLanguageString(p,o.messages[p])),e.createElement(C.Button,{onClick:this.onInsert,themeColor:"primary",dir:r,key:"insert"},l.toLanguageString(f,o.messages[f]))],b=e.createElement(y.Window,{initialWidth:450,initialHeight:250,className:"k-editor-window",title:l.toLanguageString(d,o.messages[d]),onClose:this.onClose,style:r==="rtl"?{textAlign:"right"}:void 0,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},v,e.createElement(y.WindowActionsBar,null,...E));return u?u(b,{content:v,actionButtons:E}):b}};L.registerForLocalization(F);exports.InsertLinkDialog=F;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),y=require("@progress/kendo-react-dialogs"),C=require("@progress/kendo-react-buttons"),u=require("@progress/kendo-react-inputs"),c=require("@progress/kendo-react-form"),x=require("@progress/kendo-react-common"),w=require("@progress/kendo-editor-common"),L=require("@progress/kendo-react-intl"),o=require("../messages/index.js");function I(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const e=I(S);let F=class extends e.Component{constructor(){super(...arguments),this.href=null,this.title=null,this.target=null,this.onClose=()=>{this.props.view.focus(),this.props.onClose()},this.onInsert=()=>{const t=this.props.view,n=this.props.settings.mark,m={href:(this.href?x.sanitizeUrl(this.href.value):void 0)||void 0,title:this.title?this.title.value:void 0,target:this.target&&this.target.element&&this.target.element.checked?"_blank":void 0};w.applyLink({mark:n,attrs:m},this.props.settings.commandName)(t.state,t.dispatch),this.onClose()}}render(){const{view:t,settings:n,dir:r,render:m}=this.props,l=L.provideLocalizationService(this),{insertHyperlinkDialogTitle:d,insertHyperlinkAddress:g,insertHyperlinkTitle:k,insertHyperlinkNewWindow:h,insertHyperlinkCancel:p,insertHyperlinkInsert:f}=n.messages,a=t?w.getMark(t.state,t.state.schema.marks[n.mark]):!1,v=e.createElement(c.Form,{render:()=>e.createElement(c.FormElement,{horizontal:!0},e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-url",className:"k-form-label"},l.toLanguageString(g,o.messages[g])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(u.Input,{type:"text",id:"k-editor-link-url",ref:i=>{this.href=i&&i.element},defaultValue:a&&a.attrs.href||void 0,autoFocus:!0}))),e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-text",className:"k-form-label"},l.toLanguageString(k,o.messages[k])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(u.Input,{type:"text",id:"k-editor-link-text",ref:i=>{this.title=i&&i.element},defaultValue:a&&a.attrs.title||void 0}))),n.linkTarget!==!1&&e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-target",className:"k-checkbox-label"},e.createElement(u.Checkbox,{id:"k-editor-link-target",ref:i=>{this.target=i},defaultChecked:a&&!!a.attrs.target||void 0}),l.toLanguageString(h,o.messages[h]))))}),E=[e.createElement(C.Button,{onClick:this.onClose,dir:r,key:"cancel"},l.toLanguageString(p,o.messages[p])),e.createElement(C.Button,{onClick:this.onInsert,themeColor:"primary",dir:r,key:"insert"},l.toLanguageString(f,o.messages[f]))],b=e.createElement(y.Window,{initialWidth:450,initialHeight:250,className:"k-editor-window",title:l.toLanguageString(d,o.messages[d]),onClose:this.onClose,style:r==="rtl"?{textAlign:"right"}:void 0,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},v,e.createElement(y.WindowActionsBar,null,...E));return m?m(b,{content:v,actionButtons:E}):b}};L.registerForLocalization(F);exports.InsertLinkDialog=F;
@@ -7,42 +7,43 @@
7
7
  */
8
8
  import * as e from "react";
9
9
  import { Window as C, WindowActionsBar as w } from "@progress/kendo-react-dialogs";
10
- import { Button as v } from "@progress/kendo-react-buttons";
10
+ import { Button as E } from "@progress/kendo-react-buttons";
11
11
  import { Input as y, Checkbox as L } from "@progress/kendo-react-inputs";
12
- import { Form as b, FormElement as x, FieldWrapper as s } from "@progress/kendo-react-form";
12
+ import { Form as b, FormElement as x, FieldWrapper as m } from "@progress/kendo-react-form";
13
+ import { sanitizeUrl as z } from "@progress/kendo-react-common";
13
14
  import { applyLink as F, getMark as N } from "@progress/kendo-editor-common";
14
- import { provideLocalizationService as z, registerForLocalization as H } from "@progress/kendo-react-intl";
15
- import { messages as n } from "../messages/index.mjs";
16
- let I = class extends e.Component {
15
+ import { provideLocalizationService as H, registerForLocalization as I } from "@progress/kendo-react-intl";
16
+ import { messages as l } from "../messages/index.mjs";
17
+ let S = class extends e.Component {
17
18
  constructor() {
18
19
  super(...arguments), this.href = null, this.title = null, this.target = null, this.onClose = () => {
19
20
  this.props.view.focus(), this.props.onClose();
20
21
  }, this.onInsert = () => {
21
- const r = this.props.view, a = this.props.settings.mark, o = {
22
- href: this.href ? this.href.value : void 0,
22
+ const r = this.props.view, o = this.props.settings.mark, s = {
23
+ href: (this.href ? z(this.href.value) : void 0) || void 0,
23
24
  title: this.title ? this.title.value : void 0,
24
25
  target: this.target && this.target.element && this.target.element.checked ? "_blank" : void 0
25
26
  };
26
- F({ mark: a, attrs: o }, this.props.settings.commandName)(r.state, r.dispatch), this.onClose();
27
+ F({ mark: o, attrs: s }, this.props.settings.commandName)(r.state, r.dispatch), this.onClose();
27
28
  };
28
29
  }
29
30
  /**
30
31
  * @hidden
31
32
  */
32
33
  render() {
33
- const { view: r, settings: a, dir: o, render: m } = this.props, i = z(this), {
34
+ const { view: r, settings: o, dir: a, render: s } = this.props, i = H(this), {
34
35
  insertHyperlinkDialogTitle: c,
35
36
  insertHyperlinkAddress: h,
36
- insertHyperlinkTitle: k,
37
- insertHyperlinkNewWindow: d,
37
+ insertHyperlinkTitle: d,
38
+ insertHyperlinkNewWindow: k,
38
39
  insertHyperlinkCancel: g,
39
40
  insertHyperlinkInsert: p
40
- } = a.messages, l = r ? N(r.state, r.state.schema.marks[a.mark]) : !1, u = /* @__PURE__ */ e.createElement(
41
+ } = o.messages, n = r ? N(r.state, r.state.schema.marks[o.mark]) : !1, u = /* @__PURE__ */ e.createElement(
41
42
  b,
42
43
  {
43
- render: () => /* @__PURE__ */ e.createElement(x, { horizontal: !0 }, /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-url", className: "k-form-label" }, i.toLanguageString(
44
+ render: () => /* @__PURE__ */ e.createElement(x, { horizontal: !0 }, /* @__PURE__ */ e.createElement(m, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-url", className: "k-form-label" }, i.toLanguageString(
44
45
  h,
45
- n[h]
46
+ l[h]
46
47
  )), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
47
48
  y,
48
49
  {
@@ -51,12 +52,12 @@ let I = class extends e.Component {
51
52
  ref: (t) => {
52
53
  this.href = t && t.element;
53
54
  },
54
- defaultValue: l && l.attrs.href || void 0,
55
+ defaultValue: n && n.attrs.href || void 0,
55
56
  autoFocus: !0
56
57
  }
57
- ))), /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-text", className: "k-form-label" }, i.toLanguageString(
58
- k,
59
- n[k]
58
+ ))), /* @__PURE__ */ e.createElement(m, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-text", className: "k-form-label" }, i.toLanguageString(
59
+ d,
60
+ l[d]
60
61
  )), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
61
62
  y,
62
63
  {
@@ -65,26 +66,26 @@ let I = class extends e.Component {
65
66
  ref: (t) => {
66
67
  this.title = t && t.element;
67
68
  },
68
- defaultValue: l && l.attrs.title || void 0
69
+ defaultValue: n && n.attrs.title || void 0
69
70
  }
70
- ))), a.linkTarget !== !1 && /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-target", className: "k-checkbox-label" }, /* @__PURE__ */ e.createElement(
71
+ ))), o.linkTarget !== !1 && /* @__PURE__ */ e.createElement(m, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-target", className: "k-checkbox-label" }, /* @__PURE__ */ e.createElement(
71
72
  L,
72
73
  {
73
74
  id: "k-editor-link-target",
74
75
  ref: (t) => {
75
76
  this.target = t;
76
77
  },
77
- defaultChecked: l && !!l.attrs.target || void 0
78
+ defaultChecked: n && !!n.attrs.target || void 0
78
79
  }
79
80
  ), i.toLanguageString(
80
- d,
81
- n[d]
81
+ k,
82
+ l[k]
82
83
  ))))
83
84
  }
84
85
  ), f = [
85
- /* @__PURE__ */ e.createElement(v, { onClick: this.onClose, dir: o, key: "cancel" }, i.toLanguageString(g, n[g])),
86
- /* @__PURE__ */ e.createElement(v, { onClick: this.onInsert, themeColor: "primary", dir: o, key: "insert" }, i.toLanguageString(p, n[p]))
87
- ], E = /* @__PURE__ */ e.createElement(
86
+ /* @__PURE__ */ e.createElement(E, { onClick: this.onClose, dir: a, key: "cancel" }, i.toLanguageString(g, l[g])),
87
+ /* @__PURE__ */ e.createElement(E, { onClick: this.onInsert, themeColor: "primary", dir: a, key: "insert" }, i.toLanguageString(p, l[p]))
88
+ ], v = /* @__PURE__ */ e.createElement(
88
89
  C,
89
90
  {
90
91
  initialWidth: 450,
@@ -92,10 +93,10 @@ let I = class extends e.Component {
92
93
  className: "k-editor-window",
93
94
  title: i.toLanguageString(
94
95
  c,
95
- n[c]
96
+ l[c]
96
97
  ),
97
98
  onClose: this.onClose,
98
- style: o === "rtl" ? { textAlign: "right" } : void 0,
99
+ style: a === "rtl" ? { textAlign: "right" } : void 0,
99
100
  modal: !0,
100
101
  minimizeButton: () => null,
101
102
  maximizeButton: () => null,
@@ -104,10 +105,10 @@ let I = class extends e.Component {
104
105
  u,
105
106
  /* @__PURE__ */ e.createElement(w, null, ...f)
106
107
  );
107
- return m ? m(E, { content: u, actionButtons: f }) : E;
108
+ return s ? s(v, { content: u, actionButtons: f }) : v;
108
109
  }
109
110
  };
110
- H(I);
111
+ I(S);
111
112
  export {
112
- I as InsertLinkDialog
113
+ S as InsertLinkDialog
113
114
  };