@progress/kendo-react-editor 7.2.4-develop.3 → 7.2.4-develop.4

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.
Files changed (150) hide show
  1. package/Editor.js +8 -0
  2. package/Editor.mjs +327 -0
  3. package/config/defaultStyles.js +229 -0
  4. package/config/defaultStyles.mjs +235 -0
  5. package/config/shortcuts.js +8 -0
  6. package/config/shortcuts.mjs +34 -0
  7. package/config/toolsSettings.js +8 -0
  8. package/config/toolsSettings.mjs +549 -0
  9. package/dialogs/FindReplace.js +8 -0
  10. package/dialogs/FindReplace.mjs +214 -0
  11. package/dialogs/index.js +8 -0
  12. package/dialogs/index.mjs +30 -0
  13. package/dialogs/insertImage.js +8 -0
  14. package/dialogs/insertImage.mjs +117 -0
  15. package/dialogs/insertLink.js +8 -0
  16. package/dialogs/insertLink.mjs +96 -0
  17. package/dialogs/viewHtml.js +8 -0
  18. package/dialogs/viewHtml.mjs +70 -0
  19. package/dist/cdn/js/kendo-react-editor.js +8 -226
  20. package/index.d.mts +2943 -5
  21. package/index.d.ts +2941 -178
  22. package/index.js +8 -226
  23. package/index.mjs +165 -4118
  24. package/messages/index.js +8 -0
  25. package/messages/index.mjs +345 -0
  26. package/package-metadata.js +8 -0
  27. package/package-metadata.mjs +19 -0
  28. package/package.json +11 -11
  29. package/tools/align.js +8 -0
  30. package/tools/align.mjs +38 -0
  31. package/tools/applyColor.js +8 -0
  32. package/tools/applyColor.mjs +34 -0
  33. package/tools/cleanFormatting.js +8 -0
  34. package/tools/cleanFormatting.mjs +41 -0
  35. package/tools/findReplace.js +8 -0
  36. package/tools/findReplace.mjs +53 -0
  37. package/tools/fontStyle.js +8 -0
  38. package/tools/fontStyle.mjs +61 -0
  39. package/tools/formatBlock.js +8 -0
  40. package/tools/formatBlock.mjs +60 -0
  41. package/tools/history.js +8 -0
  42. package/tools/history.mjs +17 -0
  43. package/tools/indent.js +8 -0
  44. package/tools/indent.mjs +43 -0
  45. package/tools/index.js +8 -0
  46. package/tools/index.mjs +278 -0
  47. package/tools/inlineFormat.js +8 -0
  48. package/tools/inlineFormat.mjs +43 -0
  49. package/tools/insertImage.js +8 -0
  50. package/tools/insertImage.mjs +58 -0
  51. package/tools/insertLink.js +8 -0
  52. package/tools/insertLink.mjs +61 -0
  53. package/tools/insertTable/popup.js +8 -0
  54. package/tools/insertTable/popup.mjs +94 -0
  55. package/tools/insertTable/popupGrid.js +8 -0
  56. package/tools/insertTable/popupGrid.mjs +58 -0
  57. package/tools/insertTable/tool.js +8 -0
  58. package/tools/insertTable/tool.mjs +73 -0
  59. package/tools/lists-styled.js +8 -0
  60. package/tools/lists-styled.mjs +61 -0
  61. package/tools/lists.js +8 -0
  62. package/tools/lists.mjs +47 -0
  63. package/tools/outdent.js +8 -0
  64. package/tools/outdent.mjs +43 -0
  65. package/tools/pdf.js +8 -0
  66. package/tools/pdf.mjs +36 -0
  67. package/tools/print.js +8 -0
  68. package/tools/print.mjs +38 -0
  69. package/tools/proseMirrorTool.js +8 -0
  70. package/tools/proseMirrorTool.mjs +37 -0
  71. package/tools/selectAll.js +8 -0
  72. package/tools/selectAll.mjs +36 -0
  73. package/tools/table-wizard/cellPropsUtils.js +8 -0
  74. package/tools/table-wizard/cellPropsUtils.mjs +124 -0
  75. package/tools/table-wizard/tableCellProperties.js +8 -0
  76. package/tools/table-wizard/tableCellProperties.mjs +238 -0
  77. package/tools/table-wizard/tableProperties.js +8 -0
  78. package/tools/table-wizard/tableProperties.mjs +292 -0
  79. package/tools/table-wizard/tablePropsUtils.js +8 -0
  80. package/tools/table-wizard/tablePropsUtils.mjs +288 -0
  81. package/tools/table-wizard/utils.js +8 -0
  82. package/tools/table-wizard/utils.mjs +91 -0
  83. package/tools/tableEdit.js +8 -0
  84. package/tools/tableEdit.mjs +36 -0
  85. package/tools/unlink.js +8 -0
  86. package/tools/unlink.mjs +41 -0
  87. package/tools/utils.js +8 -0
  88. package/tools/utils.mjs +51 -0
  89. package/tools/viewHtml.js +8 -0
  90. package/tools/viewHtml.mjs +57 -0
  91. package/utils/browser-detection.js +8 -0
  92. package/utils/browser-detection.mjs +12 -0
  93. package/utils/controlled-value.js +8 -0
  94. package/utils/controlled-value.mjs +19 -0
  95. package/utils/index.js +8 -0
  96. package/utils/index.mjs +162 -0
  97. package/utils/props-key.js +8 -0
  98. package/utils/props-key.mjs +13 -0
  99. package/Editor.d.ts +0 -122
  100. package/EditorProps.d.ts +0 -200
  101. package/config/defaultStyles.d.ts +0 -16
  102. package/config/pasteSettings.d.ts +0 -10
  103. package/config/schema.d.ts +0 -5
  104. package/config/shortcuts.d.ts +0 -28
  105. package/config/toolsSettings.d.ts +0 -493
  106. package/dialogs/EditorDialogProps.d.ts +0 -30
  107. package/dialogs/FindReplace.d.ts +0 -75
  108. package/dialogs/index.d.ts +0 -53
  109. package/dialogs/insertImage.d.ts +0 -32
  110. package/dialogs/insertLink.d.ts +0 -30
  111. package/dialogs/viewHtml.d.ts +0 -29
  112. package/messages/index.d.ts +0 -338
  113. package/package-metadata.d.ts +0 -9
  114. package/tools/ToolProps.d.ts +0 -41
  115. package/tools/align.d.ts +0 -11
  116. package/tools/applyColor.d.ts +0 -16
  117. package/tools/cleanFormatting.d.ts +0 -20
  118. package/tools/findReplace.d.ts +0 -33
  119. package/tools/fontStyle.d.ts +0 -32
  120. package/tools/formatBlock.d.ts +0 -22
  121. package/tools/history.d.ts +0 -30
  122. package/tools/indent.d.ts +0 -21
  123. package/tools/index.d.ts +0 -718
  124. package/tools/inlineFormat.d.ts +0 -51
  125. package/tools/insertImage.d.ts +0 -17
  126. package/tools/insertLink.d.ts +0 -28
  127. package/tools/insertTable/index.d.ts +0 -7
  128. package/tools/insertTable/popup.d.ts +0 -97
  129. package/tools/insertTable/popupGrid.d.ts +0 -35
  130. package/tools/insertTable/tool.d.ts +0 -28
  131. package/tools/lists-styled.d.ts +0 -8
  132. package/tools/lists.d.ts +0 -31
  133. package/tools/outdent.d.ts +0 -21
  134. package/tools/pdf.d.ts +0 -29
  135. package/tools/print.d.ts +0 -20
  136. package/tools/proseMirrorTool.d.ts +0 -16
  137. package/tools/selectAll.d.ts +0 -20
  138. package/tools/table-wizard/cellPropsUtils.d.ts +0 -40
  139. package/tools/table-wizard/tableCellProperties.d.ts +0 -24
  140. package/tools/table-wizard/tableProperties.d.ts +0 -15
  141. package/tools/table-wizard/tablePropsUtils.d.ts +0 -56
  142. package/tools/table-wizard/utils.d.ts +0 -43
  143. package/tools/tableEdit.d.ts +0 -102
  144. package/tools/unlink.d.ts +0 -21
  145. package/tools/utils.d.ts +0 -54
  146. package/tools/viewHtml.d.ts +0 -28
  147. package/utils/browser-detection.d.ts +0 -8
  148. package/utils/controlled-value.d.ts +0 -9
  149. package/utils/index.d.ts +0 -367
  150. package/utils/props-key.d.ts +0 -9
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import { TableMap as f } from "@progress/kendo-editor-common";
10
+ import { parentNode as i } from "../utils.mjs";
11
+ const d = /[\D]+$/, h = (e) => {
12
+ const t = e.match(d);
13
+ return t ? t[0] : "";
14
+ }, C = (e, t) => {
15
+ var n;
16
+ const s = u(((n = e.attrs) == null ? void 0 : n.style) || "")[t] || "";
17
+ return {
18
+ [t]: parseFloat(s) || null,
19
+ [t + "Unit"]: h(s)
20
+ };
21
+ }, u = (e) => (e || "").split(/\s*;\s*/).filter(Boolean).map((s) => {
22
+ const n = s.split(/\s*:\s*/);
23
+ return { [n[0]]: n[1] };
24
+ }).reduce((s, n) => ({ ...s, ...n }), {}), m = (e, t) => {
25
+ const s = t.style, n = t.value, l = t.newValue;
26
+ if (!e)
27
+ return { changed: !1, style: null };
28
+ const o = e.split(/\s*;\s*/).filter((r) => !!r), c = o.filter((r) => {
29
+ const a = r.split(/\s*:\s*/);
30
+ return !(a[0].toLowerCase() === s && n.test(a[1]));
31
+ });
32
+ return l && c.push(`${s}: ${l}`), {
33
+ style: c.join("; ") + (c.length ? ";" : ""),
34
+ changed: !!l || c.length !== o.length
35
+ };
36
+ }, b = /^.+$/;
37
+ function N(e, t, s) {
38
+ let n;
39
+ if (new RegExp("[^-]?" + t + ":").test(e.style || "")) {
40
+ const { style: l } = m(
41
+ e.style || "",
42
+ { style: t, value: b, newValue: s }
43
+ );
44
+ n = { ...e, style: l };
45
+ } else if (e.style) {
46
+ const l = u(e.style);
47
+ l[t] = s, n = {
48
+ ...e,
49
+ style: Object.keys(l).filter((o) => !!l[o]).reduce((o, c) => o + c + ": " + l[c] + "; ", "").trim()
50
+ };
51
+ } else
52
+ s ? n = { ...e, style: t + ": " + s + ";" } : n = { ...e };
53
+ return n;
54
+ }
55
+ const y = (e) => {
56
+ const { doc: t, selection: s } = e, n = [];
57
+ return s.ranges.forEach((l) => {
58
+ const o = l.$from.pos, c = l.$to.pos;
59
+ t.nodesBetween(o, c, (r, a, p, $) => {
60
+ (r.type.name === "table_cell" || r.type.name === "table_header") && n.push({ node: r, pos: a });
61
+ });
62
+ }), n;
63
+ }, g = (e) => {
64
+ const t = i(e.selection.$from, (n) => n.type.name === "table"), s = i(e.selection.$to, (n) => n.type.name === "table");
65
+ return t && s && t.depth === s.depth && t.node.eq(s.node) ? y(e).filter(({ pos: l }) => {
66
+ const o = i(e.doc.resolve(l), (c) => c.type.name === "table");
67
+ return o && o.depth === t.depth && t.node.eq(o.node);
68
+ }) : [];
69
+ }, w = (e) => {
70
+ const t = [];
71
+ if (g(e).length) {
72
+ const s = e.selection.$from, n = i(s, (a) => a.type.spec.tableRole === "table");
73
+ if (n === null)
74
+ return t;
75
+ const l = s.start(n.depth), o = n.node, c = f.get(o), r = e.doc;
76
+ c.map.forEach((a) => {
77
+ const p = a + l;
78
+ t.push({ pos: p, node: r.nodeAt(p) });
79
+ });
80
+ }
81
+ return t;
82
+ };
83
+ export {
84
+ h as getUnit,
85
+ C as nodeSize,
86
+ u as parseStyle,
87
+ d as reUnit,
88
+ g as selectedCells,
89
+ N as setNodeStyle,
90
+ w as tableCells
91
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-editor-common"),t=require("./proseMirrorTool.js"),d=(o,e)=>{const n=r.deleteColumn(o,e);if(n&&!e){const l=r.selectionCell(o),c=l&&l.node(l.depth);if(c&&c.content.childCount===1)return!1}return n},u=(o,e)=>{const n=r.deleteRow(o,e);if(n&&!e){const l=r.selectionCell(o),c=l&&l.node(l.depth-1);if(c&&c.content.childCount===1)return!1}return n};exports.TableEditNS=void 0;(o=>{o.createAddRowBeforeTool=e=>t.createProseMirrorTool(e,r.addRowBefore),o.createAddRowAfterTool=e=>t.createProseMirrorTool(e,r.addRowAfter),o.createAddColumnBeforeTool=e=>t.createProseMirrorTool(e,r.addColumnBefore),o.createAddColumnAfterTool=e=>t.createProseMirrorTool(e,r.addColumnAfter),o.createDeleteRowTool=e=>t.createProseMirrorTool(e,u),o.createDeleteColumnTool=e=>t.createProseMirrorTool(e,d),o.createDeleteTableTool=e=>t.createProseMirrorTool(e,r.deleteTable),o.createMergeCellsTool=e=>t.createProseMirrorTool(e,r.mergeCells),o.createSplitCellTool=e=>t.createProseMirrorTool(e,r.splitCell)})(exports.TableEditNS||(exports.TableEditNS={}));exports.deleteColumnCmd=d;exports.deleteRowCmd=u;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import { addRowBefore as d, addRowAfter as f, addColumnBefore as s, addColumnAfter as C, deleteTable as m, mergeCells as a, splitCell as w, deleteColumn as A, selectionCell as c, deleteRow as p } from "@progress/kendo-editor-common";
10
+ import { createProseMirrorTool as r } from "./proseMirrorTool.mjs";
11
+ const R = (o, e) => {
12
+ const l = A(o, e);
13
+ if (l && !e) {
14
+ const t = c(o), n = t && t.node(t.depth);
15
+ if (n && n.content.childCount === 1)
16
+ return !1;
17
+ }
18
+ return l;
19
+ }, T = (o, e) => {
20
+ const l = p(o, e);
21
+ if (l && !e) {
22
+ const t = c(o), n = t && t.node(t.depth - 1);
23
+ if (n && n.content.childCount === 1)
24
+ return !1;
25
+ }
26
+ return l;
27
+ };
28
+ var u;
29
+ ((o) => {
30
+ o.createAddRowBeforeTool = (e) => r(e, d), o.createAddRowAfterTool = (e) => r(e, f), o.createAddColumnBeforeTool = (e) => r(e, s), o.createAddColumnAfterTool = (e) => r(e, C), o.createDeleteRowTool = (e) => r(e, T), o.createDeleteColumnTool = (e) => r(e, R), o.createDeleteTableTool = (e) => r(e, m), o.createMergeCellsTool = (e) => r(e, a), o.createSplitCellTool = (e) => r(e, w);
31
+ })(u || (u = {}));
32
+ export {
33
+ u as TableEditNS,
34
+ R as deleteColumnCmd,
35
+ T as deleteRowCmd
36
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),v=require("@progress/kendo-react-buttons"),d=require("@progress/kendo-editor-common"),N=require("./utils.js"),m=require("@progress/kendo-react-intl"),g=require("../messages/index.js"),S=require("@progress/kendo-react-common");function T(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const p=T(f);exports.UnlinkToolNS=void 0;(t=>{t.createUnlinkTool=e=>{const o=class extends p.Component{render(){const{view:n,render:s,...c}=this.props,i={mark:e.mark},k=n?d.hasMark(n.state,i):!1,b=m.provideLocalizationService(this),l=e.messages.title,a=!k,u=p.createElement(v.Button,{onClick:a?void 0:()=>n&&d.removeLink(i,n.state.tr.setMeta("commandName",e.commandName))(n.state,n.dispatch),"aria-disabled":a?!0:void 0,...N.onDownPreventDefault,title:b.toLanguageString(l,g.messages[l]),...e.props,...c,className:S.classNames(c.className,e.props.className,{"k-disabled":a})});return s?s.call(void 0,u,{view:n}):u}};return m.registerForLocalization(o),o}})(exports.UnlinkToolNS||(exports.UnlinkToolNS={}));
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import * as l from "react";
10
+ import { Button as f } from "@progress/kendo-react-buttons";
11
+ import { hasMark as u, removeLink as v } from "@progress/kendo-editor-common";
12
+ import { onDownPreventDefault as N } from "./utils.mjs";
13
+ import { registerForLocalization as b, provideLocalizationService as h } from "@progress/kendo-react-intl";
14
+ import { messages as L } from "../messages/index.mjs";
15
+ import { classNames as T } from "@progress/kendo-react-common";
16
+ var c;
17
+ ((p) => {
18
+ p.createUnlinkTool = (e) => {
19
+ const a = class extends l.Component {
20
+ render() {
21
+ const { view: o, render: r, ...s } = this.props, n = { mark: e.mark }, d = o ? u(o.state, n) : !1, k = h(this), i = e.messages.title, t = !d, m = /* @__PURE__ */ l.createElement(
22
+ f,
23
+ {
24
+ onClick: t ? void 0 : () => o && v(n, o.state.tr.setMeta("commandName", e.commandName))(o.state, o.dispatch),
25
+ "aria-disabled": t ? !0 : void 0,
26
+ ...N,
27
+ title: k.toLanguageString(i, L[i]),
28
+ ...e.props,
29
+ ...s,
30
+ className: T(s.className, e.props.className, { "k-disabled": t })
31
+ }
32
+ );
33
+ return r ? r.call(void 0, m, { view: o }) : m;
34
+ }
35
+ };
36
+ return b(a), a;
37
+ };
38
+ })(c || (c = {}));
39
+ export {
40
+ c as UnlinkToolNS
41
+ };
package/tools/utils.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),e=require("../messages/index.js");function y(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const n=y(l),d={onMouseDown:t=>t.preventDefault(),onPointerDown:t=>t.preventDefault()},a={userSelect:"none"},u=function(t,...s){return s.forEach((r,o)=>{t=t.replace("{"+o+"}",String(r))}),t},i=(t,s)=>s.dataItem.style?n.cloneElement(t,t.props,n.createElement("span",{style:s.dataItem.style},t.props.children)):t,S=["px","em","%"],c={animate:{openDuration:150,closeDuration:150}},b=[{textKey:e.keys.borderStyleNone,text:e.messages[e.keys.borderStyleNone],value:"none"},{textKey:e.keys.borderStyleSolid,text:e.messages[e.keys.borderStyleSolid],value:"solid"},{textKey:e.keys.borderStyleDotted,text:e.messages[e.keys.borderStyleDotted],value:"dotted"},{textKey:e.keys.borderStyleDashed,text:e.messages[e.keys.borderStyleDashed],value:"dashed"},{textKey:e.keys.borderStyleDouble,text:e.messages[e.keys.borderStyleDouble],value:"double"},{textKey:e.keys.borderStyleGroove,text:e.messages[e.keys.borderStyleGroove],value:"groove"},{textKey:e.keys.borderStyleRidge,text:e.messages[e.keys.borderStyleRidge],value:"ridge"},{textKey:e.keys.borderStyleInset,text:e.messages[e.keys.borderStyleInset],value:"inset"},{textKey:e.keys.borderStyleOutset,text:e.messages[e.keys.borderStyleOutset],value:"outset"},{textKey:e.keys.borderStyleInitial,text:e.messages[e.keys.borderStyleInitial],value:"initial"},{textKey:e.keys.borderStyleInherit,text:e.messages[e.keys.borderStyleInherit],value:"inherit"},{textKey:e.keys.borderStyleHidden,text:e.messages[e.keys.borderStyleHidden],value:"hidden"}];function g(t,s){for(let r=t.depth;r>0;r--){let o=t.node(r);if(s(o))return{node:o,depth:r}}return null}exports.borderStyles=b;exports.formatString=u;exports.itemRender=i;exports.onDownPreventDefault=d;exports.parentNode=g;exports.popupSettings=c;exports.units=S;exports.userSelectNone=a;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import * as d from "react";
10
+ import { keys as e, messages as r } from "../messages/index.mjs";
11
+ const a = {
12
+ onMouseDown: (t) => t.preventDefault(),
13
+ onPointerDown: (t) => t.preventDefault()
14
+ }, s = {
15
+ userSelect: "none"
16
+ }, u = function(t, ...o) {
17
+ return o.forEach((l, n) => {
18
+ t = t.replace("{" + n + "}", String(l));
19
+ }), t;
20
+ }, S = (t, o) => o.dataItem.style ? d.cloneElement(t, t.props, /* @__PURE__ */ d.createElement("span", { style: o.dataItem.style }, t.props.children)) : t, i = ["px", "em", "%"], b = { animate: { openDuration: 150, closeDuration: 150 } }, x = [
21
+ { textKey: e.borderStyleNone, text: r[e.borderStyleNone], value: "none" },
22
+ { textKey: e.borderStyleSolid, text: r[e.borderStyleSolid], value: "solid" },
23
+ { textKey: e.borderStyleDotted, text: r[e.borderStyleDotted], value: "dotted" },
24
+ { textKey: e.borderStyleDashed, text: r[e.borderStyleDashed], value: "dashed" },
25
+ { textKey: e.borderStyleDouble, text: r[e.borderStyleDouble], value: "double" },
26
+ { textKey: e.borderStyleGroove, text: r[e.borderStyleGroove], value: "groove" },
27
+ { textKey: e.borderStyleRidge, text: r[e.borderStyleRidge], value: "ridge" },
28
+ { textKey: e.borderStyleInset, text: r[e.borderStyleInset], value: "inset" },
29
+ { textKey: e.borderStyleOutset, text: r[e.borderStyleOutset], value: "outset" },
30
+ { textKey: e.borderStyleInitial, text: r[e.borderStyleInitial], value: "initial" },
31
+ { textKey: e.borderStyleInherit, text: r[e.borderStyleInherit], value: "inherit" },
32
+ { textKey: e.borderStyleHidden, text: r[e.borderStyleHidden], value: "hidden" }
33
+ ];
34
+ function c(t, o) {
35
+ for (let l = t.depth; l > 0; l--) {
36
+ let n = t.node(l);
37
+ if (o(n))
38
+ return { node: n, depth: l };
39
+ }
40
+ return null;
41
+ }
42
+ export {
43
+ x as borderStyles,
44
+ u as formatString,
45
+ S as itemRender,
46
+ a as onDownPreventDefault,
47
+ c as parentNode,
48
+ b as popupSettings,
49
+ i as units,
50
+ s as userSelectNone
51
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),m=require("@progress/kendo-react-buttons"),p=require("./utils.js"),D=require("../dialogs/index.js"),u=require("@progress/kendo-react-intl"),f=require("../messages/index.js");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const r=w(d);exports.ViewHtmlToolNS=void 0;(e=>{e.createViewHtmlTool=t=>{const o=class extends r.Component{constructor(){super(...arguments),this.state={openedDialog:!1},this.toggleDialog=()=>{this.setState({openedDialog:!this.state.openedDialog})}}render(){const{view:n,render:l,...s}=this.props,g=u.provideLocalizationService(this),a=t.messages.viewHtml,c=[r.createElement(m.Button,{onClick:this.toggleDialog,key:"viewHtml",...p.onDownPreventDefault,title:g.toLanguageString(a,f.messages[a]),...t.props,...s}),this.state.openedDialog&&n&&r.createElement(D.EditorDialogs.ViewHtmlDialog,{key:"viewHtmlDialog",view:n,settings:t,dir:s.dir,onClose:this.toggleDialog})||null];return l?l.call(void 0,c,{view:n}):c}};return u.registerForLocalization(o),o}})(exports.ViewHtmlToolNS||(exports.ViewHtmlToolNS={}));
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import * as t from "react";
10
+ import { Button as c } from "@progress/kendo-react-buttons";
11
+ import { onDownPreventDefault as p } from "./utils.mjs";
12
+ import { EditorDialogs as d } from "../dialogs/index.mjs";
13
+ import { registerForLocalization as D, provideLocalizationService as u } from "@progress/kendo-react-intl";
14
+ import { messages as h } from "../messages/index.mjs";
15
+ var n;
16
+ ((m) => {
17
+ m.createViewHtmlTool = (e) => {
18
+ const i = class extends t.Component {
19
+ constructor() {
20
+ super(...arguments), this.state = {
21
+ openedDialog: !1
22
+ }, this.toggleDialog = () => {
23
+ this.setState({
24
+ openedDialog: !this.state.openedDialog
25
+ });
26
+ };
27
+ }
28
+ render() {
29
+ const { view: o, render: r, ...l } = this.props, g = u(this), a = e.messages.viewHtml, s = [/* @__PURE__ */ t.createElement(
30
+ c,
31
+ {
32
+ onClick: this.toggleDialog,
33
+ key: "viewHtml",
34
+ ...p,
35
+ title: g.toLanguageString(a, h[a]),
36
+ ...e.props,
37
+ ...l
38
+ }
39
+ ), this.state.openedDialog && o && /* @__PURE__ */ t.createElement(
40
+ d.ViewHtmlDialog,
41
+ {
42
+ key: "viewHtmlDialog",
43
+ view: o,
44
+ settings: e,
45
+ dir: l.dir,
46
+ onClose: this.toggleDialog
47
+ }
48
+ ) || null];
49
+ return r ? r.call(void 0, s, { view: o }) : s;
50
+ }
51
+ };
52
+ return D(i), i;
53
+ };
54
+ })(n || (n = {}));
55
+ export {
56
+ n as ViewHtmlToolNS
57
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent);exports.firefox=e;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ const e = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent);
10
+ export {
11
+ e as firefox
12
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-editor-common"),i=require("./index.js"),s=(t,e)=>{const c=e.tr||t.state.tr.setSelection(new r.AllSelection(t.state.doc)).replaceSelectionWith(e.doc||i.EditorUtils.createDocument(t.state.schema,e.html||"")).setMeta("commandName","setHTML");t.updateState(t.state.apply(c))},l=(t,e,c,o,d)=>{typeof e=="string"?o&&e===d?s(t,{tr:o}):e!==c&&s(t,{html:e}):o&&e.eq(o.doc)?s(t,{tr:o}):t.state.doc.eq(e)||s(t,{doc:e})};exports.updateEditorValue=l;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import { AllSelection as r } from "@progress/kendo-editor-common";
10
+ import { EditorUtils as d } from "./index.mjs";
11
+ const s = (t, o) => {
12
+ const c = o.tr || t.state.tr.setSelection(new r(t.state.doc)).replaceSelectionWith(o.doc || d.createDocument(t.state.schema, o.html || "")).setMeta("commandName", "setHTML");
13
+ t.updateState(t.state.apply(c));
14
+ }, f = (t, o, c, e, m) => {
15
+ typeof o == "string" ? e && o === m ? s(t, { tr: e }) : o !== c && s(t, { html: o }) : e && o.eq(e.doc) ? s(t, { tr: e }) : t.state.doc.eq(o) || s(t, { doc: o });
16
+ };
17
+ export {
18
+ f as updateEditorValue
19
+ };
package/utils/index.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("../config/shortcuts.js"),a=require("@progress/kendo-editor-common"),Q=require("./props-key.js");exports.EditorUtils=void 0;(t=>{function s(e,n,r){return!!a.alignBlocks(n,r)(e.state,e.dispatch)}t.alignBlocks=s;function u(e,n,r){return a.applyInlineStyle(n,r)(e.state,e.dispatch)}t.applyInlineStyle=u;function o(e,n,r){return a.applyLink(n,r)(e.state,e.dispatch)}t.applyLink=o;function i(e,n){return a.canIndentAsListItem(e,n)}t.canIndentList=i;function m(e,n){return a.canInsert(e,n)}t.canInsert=m;function g(e,n){return a.canOutdentAsListItem(e,{listsTypes:n,nodes:[]})}t.canOutdentList=g;function l(e){return a.convertMsLists(e)}t.convertMsLists=l;function f(e,n,r){return a.parseContent(a.trimWhitespace(n),e,r!==void 0?r:{preserveWhitespace:"full"})}t.createDocument=f;function p(e,n,r){return a.createTable(e,n,r)}t.createTable=p;function h(e,n,r){return a.formatBlockElements(n,r)(e.state,e.dispatch)}t.formatBlockElements=h;function k(e){return a.getBlockFormats(e)}t.getBlockFormats=k;function I(e){return a.getHtml(e)}t.getHtml=I;function y(e,n){return a.getInlineStyles(e,n)}t.getInlineStyles=y;function z(e,n){return a.getMark(e,n)}t.getMark=z;function S(e,n){return a.hasMark(e,n)}t.hasMark=S;function L(e,n){return a.hasNode(e,n)}t.hasNode=L;function A(e,n,r,c){return!!a.indentBlocks(n,r,c)(e.state,e.dispatch)}t.indentBlocks=A;function B(e){return a.indentHtml(e)}t.indentHtml=B;function H(e,n,r){a.insertNode(n,r)(e.state,e.dispatch)}t.insertNode=H;function b(e,n){return a.isAligned(e,n)}t.isAligned=b;function d(e,n,r){return a.isIndented(e,n,r)}t.isIndented=d;function C(e){return a.removeComments(e)}t.removeComments=C;function R(e,n){return a.removeTag(e,n)}t.removeTag=R;function M(e,n){return a.pasteCleanup(e,n)}t.pasteCleanup=M;function F(e){a.sanitizeClassAttr(e)}t.sanitizeClassAttr=F;function T(e){a.sanitizeStyleAttr(e)}t.sanitizeStyleAttr=T;function v(e){a.removeAttribute(e)}t.removeAttribute=v;function N(e){return a.sanitize(e)}t.sanitize=N;function K(e,n){return a.replaceImageSourcesFromRtf(e,n)}t.replaceImageSourcesFromRtf=K;function q(e){return a.textHighlight(e)}t.textHighlight=q;function x(e){return a.imageResizing(e)}t.imageResizing=x;function O(){return a.tableResizing()}t.tableResizing=O;function W(e,n,r,c){const G=a.trimWhitespace(n);a.setHtml(G,r,c)(e.state,e.dispatch)}t.setHtml=W;function D(e,n,r,c){return a.toggleInlineFormat(n,r,c)(e.state,e.dispatch)}t.toggleInlineFormat=D;function P(e,n,r){return a.toggleList(e.state,e.dispatch,e,n,r)}t.toggleList=P;function j(e){return J.getShortcuts(e)}t.getShortcuts=j,t.propsKey=Q.editorPropsKey,t.imageResizeKey=a.imageResizeKey,t.marks={...a.marks},t.nodes={...a.nodes}})(exports.EditorUtils||(exports.EditorUtils={}));
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import { getShortcuts as J } from "../config/shortcuts.mjs";
10
+ import { imageResizeKey as Q, marks as V, nodes as X, alignBlocks as Y, applyInlineStyle as Z, applyLink as _, canIndentAsListItem as w, canInsert as E, canOutdentAsListItem as U, convertMsLists as ee, parseContent as ne, trimWhitespace as c, createTable as te, formatBlockElements as ae, getBlockFormats as re, getHtml as ce, getInlineStyles as ue, getMark as se, hasMark as oe, hasNode as me, indentBlocks as ie, indentHtml as ge, insertNode as fe, isAligned as le, isIndented as pe, removeComments as $e, removeTag as he, pasteCleanup as ke, sanitizeClassAttr as Ie, sanitizeStyleAttr as ye, removeAttribute as ze, sanitize as Le, replaceImageSourcesFromRtf as Se, textHighlight as Ae, imageResizing as Be, tableResizing as He, setHtml as Re, toggleInlineFormat as Ce, toggleList as be } from "@progress/kendo-editor-common";
11
+ import { editorPropsKey as Fe } from "./props-key.mjs";
12
+ var u;
13
+ ((t) => {
14
+ function s(e, n, a) {
15
+ return !!Y(n, a)(e.state, e.dispatch);
16
+ }
17
+ t.alignBlocks = s;
18
+ function o(e, n, a) {
19
+ return Z(n, a)(e.state, e.dispatch);
20
+ }
21
+ t.applyInlineStyle = o;
22
+ function m(e, n, a) {
23
+ return _(n, a)(e.state, e.dispatch);
24
+ }
25
+ t.applyLink = m;
26
+ function i(e, n) {
27
+ return w(e, n);
28
+ }
29
+ t.canIndentList = i;
30
+ function g(e, n) {
31
+ return E(e, n);
32
+ }
33
+ t.canInsert = g;
34
+ function f(e, n) {
35
+ return U(e, { listsTypes: n, nodes: [] });
36
+ }
37
+ t.canOutdentList = f;
38
+ function l(e) {
39
+ return ee(e);
40
+ }
41
+ t.convertMsLists = l;
42
+ function p(e, n, a) {
43
+ return ne(c(n), e, a !== void 0 ? a : { preserveWhitespace: "full" });
44
+ }
45
+ t.createDocument = p;
46
+ function $(e, n, a) {
47
+ return te(e, n, a);
48
+ }
49
+ t.createTable = $;
50
+ function h(e, n, a) {
51
+ return ae(n, a)(e.state, e.dispatch);
52
+ }
53
+ t.formatBlockElements = h;
54
+ function k(e) {
55
+ return re(e);
56
+ }
57
+ t.getBlockFormats = k;
58
+ function I(e) {
59
+ return ce(e);
60
+ }
61
+ t.getHtml = I;
62
+ function y(e, n) {
63
+ return ue(e, n);
64
+ }
65
+ t.getInlineStyles = y;
66
+ function z(e, n) {
67
+ return se(e, n);
68
+ }
69
+ t.getMark = z;
70
+ function L(e, n) {
71
+ return oe(e, n);
72
+ }
73
+ t.hasMark = L;
74
+ function S(e, n) {
75
+ return me(e, n);
76
+ }
77
+ t.hasNode = S;
78
+ function A(e, n, a, r) {
79
+ return !!ie(n, a, r)(e.state, e.dispatch);
80
+ }
81
+ t.indentBlocks = A;
82
+ function B(e) {
83
+ return ge(e);
84
+ }
85
+ t.indentHtml = B;
86
+ function H(e, n, a) {
87
+ fe(n, a)(e.state, e.dispatch);
88
+ }
89
+ t.insertNode = H;
90
+ function R(e, n) {
91
+ return le(e, n);
92
+ }
93
+ t.isAligned = R;
94
+ function C(e, n, a) {
95
+ return pe(e, n, a);
96
+ }
97
+ t.isIndented = C;
98
+ function b(e) {
99
+ return $e(e);
100
+ }
101
+ t.removeComments = b;
102
+ function F(e, n) {
103
+ return he(e, n);
104
+ }
105
+ t.removeTag = F;
106
+ function M(e, n) {
107
+ return ke(e, n);
108
+ }
109
+ t.pasteCleanup = M;
110
+ function N(e) {
111
+ Ie(e);
112
+ }
113
+ t.sanitizeClassAttr = N;
114
+ function T(e) {
115
+ ye(e);
116
+ }
117
+ t.sanitizeStyleAttr = T;
118
+ function v(e) {
119
+ ze(e);
120
+ }
121
+ t.removeAttribute = v;
122
+ function d(e) {
123
+ return Le(e);
124
+ }
125
+ t.sanitize = d;
126
+ function x(e, n) {
127
+ return Se(e, n);
128
+ }
129
+ t.replaceImageSourcesFromRtf = x;
130
+ function K(e) {
131
+ return Ae(e);
132
+ }
133
+ t.textHighlight = K;
134
+ function D(e) {
135
+ return Be(e);
136
+ }
137
+ t.imageResizing = D;
138
+ function O() {
139
+ return He();
140
+ }
141
+ t.tableResizing = O;
142
+ function W(e, n, a, r) {
143
+ const G = c(n);
144
+ Re(G, a, r)(e.state, e.dispatch);
145
+ }
146
+ t.setHtml = W;
147
+ function P(e, n, a, r) {
148
+ return Ce(n, a, r)(e.state, e.dispatch);
149
+ }
150
+ t.toggleInlineFormat = P;
151
+ function j(e, n, a) {
152
+ return be(e.state, e.dispatch, e, n, a);
153
+ }
154
+ t.toggleList = j;
155
+ function q(e) {
156
+ return J(e);
157
+ }
158
+ t.getShortcuts = q, t.propsKey = Fe, t.imageResizeKey = Q, t.marks = { ...V }, t.nodes = { ...X };
159
+ })(u || (u = {}));
160
+ export {
161
+ u as EditorUtils
162
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-editor-common"),o=new e.PluginKey("editor-props");exports.editorPropsKey=o;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 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 client";
9
+ import { PluginKey as e } from "@progress/kendo-editor-common";
10
+ const r = new e("editor-props");
11
+ export {
12
+ r as editorPropsKey
13
+ };