@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,58 @@
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 r from "react";
10
+ import { canInsert as d } from "@progress/kendo-editor-common";
11
+ import { Button as p } from "@progress/kendo-react-buttons";
12
+ import { onDownPreventDefault as u } from "./utils.mjs";
13
+ import { EditorDialogs as D } from "../dialogs/index.mjs";
14
+ import { registerForLocalization as f, provideLocalizationService as h } from "@progress/kendo-react-intl";
15
+ import { messages as I } from "../messages/index.mjs";
16
+ import { classNames as v } from "@progress/kendo-react-common";
17
+ const L = (e) => {
18
+ const i = class extends r.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: n, ...s } = this.props, t = o && o.state, l = t ? t.schema.nodes[e.node] : void 0, g = h(this), { insertImage: m } = e.messages, a = !l || !t || !d(t, l), c = [/* @__PURE__ */ r.createElement(
30
+ p,
31
+ {
32
+ onClick: a ? void 0 : this.toggleDialog,
33
+ "aria-disabled": a ? !0 : void 0,
34
+ key: "insertImage",
35
+ ...u,
36
+ title: g.toLanguageString(m, I[m]),
37
+ ...e.props,
38
+ ...s,
39
+ className: v(s.className, e.props.className, { "k-disabled": a })
40
+ }
41
+ ), this.state.openedDialog && o && /* @__PURE__ */ r.createElement(
42
+ D.InsertImageDialog,
43
+ {
44
+ key: "insertImageDialog",
45
+ view: o,
46
+ settings: e,
47
+ dir: s.dir,
48
+ onClose: this.toggleDialog
49
+ }
50
+ ) || null];
51
+ return n ? n.call(void 0, c, { view: o }) : c;
52
+ }
53
+ };
54
+ return f(i), i;
55
+ };
56
+ export {
57
+ L as createInsertImageTool
58
+ };
@@ -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"),f=require("@progress/kendo-react-buttons"),b=require("@progress/kendo-editor-common"),h=require("./utils.js"),v=require("../dialogs/index.js"),g=require("@progress/kendo-react-intl"),L=require("../messages/index.js"),S=require("@progress/kendo-react-common");function y(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const l=y(D);exports.LinkToolNS=void 0;(t=>{t.createLinkTool=e=>{const o=class extends l.Component{constructor(){super(...arguments),this.state={openedDialog:!1},this.toggleDialog=()=>{this.setState({openedDialog:!this.state.openedDialog})}}render(){const{view:n,render:c,...s}=this.props,r=n&&n.state,p=r?r.selection.empty:!0,k=r&&b.getMark(r,r.schema.marks[e.mark]),m=g.provideLocalizationService(this),{insertHyperlink:d}=e.messages,a=p&&!k,u=[l.createElement(f.Button,{onClick:a?void 0:this.toggleDialog,"aria-disabled":a?!0:void 0,key:"link",...h.onDownPreventDefault,title:m.toLanguageString(d,L.messages[d]),...e.props,...s,className:S.classNames(s.className,e.props.className,{"k-disabled":a})}),this.state.openedDialog&&n&&l.createElement(v.EditorDialogs.InsertLinkDialog,{key:"insertLinkDialog",settings:e,dir:s.dir,view:n,onClose:this.toggleDialog})||null];return c?c.call(void 0,u,{view:n}):u}};return g.registerForLocalization(o),o}})(exports.LinkToolNS||(exports.LinkToolNS={}));
@@ -0,0 +1,61 @@
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 s from "react";
10
+ import { Button as u } from "@progress/kendo-react-buttons";
11
+ import { getMark as D } from "@progress/kendo-editor-common";
12
+ import { onDownPreventDefault as f } from "./utils.mjs";
13
+ import { EditorDialogs as h } from "../dialogs/index.mjs";
14
+ import { registerForLocalization as v, provideLocalizationService as L } from "@progress/kendo-react-intl";
15
+ import { messages as N } from "../messages/index.mjs";
16
+ import { classNames as y } from "@progress/kendo-react-common";
17
+ var m;
18
+ ((p) => {
19
+ p.createLinkTool = (o) => {
20
+ const a = class extends s.Component {
21
+ constructor() {
22
+ super(...arguments), this.state = {
23
+ openedDialog: !1
24
+ }, this.toggleDialog = () => {
25
+ this.setState({
26
+ openedDialog: !this.state.openedDialog
27
+ });
28
+ };
29
+ }
30
+ render() {
31
+ const { view: e, render: l, ...r } = this.props, t = e && e.state, d = t ? t.selection.empty : !0, g = t && D(t, t.schema.marks[o.mark]), k = L(this), { insertHyperlink: n } = o.messages, i = d && !g, c = [/* @__PURE__ */ s.createElement(
32
+ u,
33
+ {
34
+ onClick: i ? void 0 : this.toggleDialog,
35
+ "aria-disabled": i ? !0 : void 0,
36
+ key: "link",
37
+ ...f,
38
+ title: k.toLanguageString(n, N[n]),
39
+ ...o.props,
40
+ ...r,
41
+ className: y(r.className, o.props.className, { "k-disabled": i })
42
+ }
43
+ ), this.state.openedDialog && e && /* @__PURE__ */ s.createElement(
44
+ h.InsertLinkDialog,
45
+ {
46
+ key: "insertLinkDialog",
47
+ settings: o,
48
+ dir: r.dir,
49
+ view: e,
50
+ onClose: this.toggleDialog
51
+ }
52
+ ) || null];
53
+ return l ? l.call(void 0, c, { view: e }) : c;
54
+ }
55
+ };
56
+ return v(a), a;
57
+ };
58
+ })(m || (m = {}));
59
+ export {
60
+ m as LinkToolNS
61
+ };
@@ -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"),o=require("prop-types"),w=require("@progress/kendo-react-popup"),h=require("./popupGrid.js");function m(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const p=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,p.get?p:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const i=m(d);exports.InsertTablePopupNS=void 0;(t=>{const e=class e extends i.Component{constructor(){super(...arguments),this.pointerdown=!1,this.onWindowDown=s=>{const{anchor:r}=this.props;r&&(r===s.target||r.firstElementChild===s.target)||(this.props.show&&!this.pointerdown&&this.props.onClose(),this.pointerdown=!1)},this.onPointerDown=()=>this.pointerdown=!0}componentDidUpdate(s){s.show&&this.props.show&&this.props.onClose()}componentDidMount(){window.addEventListener("mousedown",this.onWindowDown),window.addEventListener("pointerdown",this.onWindowDown)}componentWillUnmount(){window.removeEventListener("mousedown",this.onWindowDown),window.removeEventListener("pointerdown",this.onWindowDown)}render(){const{show:s,anchor:r,dir:a,rows:l=e.defaultProps.rows,columns:u=e.defaultProps.columns}=this.props,c=a==="rtl"?"right":"left";return i.createElement(w.Popup,{anchor:r,anchorAlign:{horizontal:c,vertical:"bottom"},popupAlign:{horizontal:c,vertical:"top"},popupClass:"k-ct-popup k-group k-reset k-state-border-up",show:s,style:a==="rtl"?{direction:"rtl"}:void 0},i.createElement(h,{rows:l,columns:u,createTableMessage:this.props.createTableMessage,createTableHintMessage:this.props.createTableHintMessage,onCellClick:this.props.onTableInsert,onDown:this.onPointerDown}))}};e.propTypes={show:o.bool.isRequired,createTableMessage:o.string.isRequired,createTableHintMessage:o.string.isRequired,onClose:o.func.isRequired,onTableInsert:o.func.isRequired,anchor:o.any,rows:o.number,columns:o.number,dir:o.string},e.defaultProps={rows:6,columns:8};let n=e;t.InsertTablePopup=n})(exports.InsertTablePopupNS||(exports.InsertTablePopupNS={}));
@@ -0,0 +1,94 @@
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 r from "react";
10
+ import o from "prop-types";
11
+ import { Popup as c } from "@progress/kendo-react-popup";
12
+ import h from "./popupGrid.mjs";
13
+ var a;
14
+ ((l) => {
15
+ const e = class e extends r.Component {
16
+ constructor() {
17
+ super(...arguments), this.pointerdown = !1, this.onWindowDown = (t) => {
18
+ const { anchor: n } = this.props;
19
+ n && (n === t.target || n.firstElementChild === t.target) || (this.props.show && !this.pointerdown && this.props.onClose(), this.pointerdown = !1);
20
+ }, this.onPointerDown = () => this.pointerdown = !0;
21
+ }
22
+ /**
23
+ * @hidden
24
+ */
25
+ componentDidUpdate(t) {
26
+ t.show && this.props.show && this.props.onClose();
27
+ }
28
+ /**
29
+ * @hidden
30
+ */
31
+ componentDidMount() {
32
+ window.addEventListener("mousedown", this.onWindowDown), window.addEventListener("pointerdown", this.onWindowDown);
33
+ }
34
+ /**
35
+ * @hidden
36
+ */
37
+ componentWillUnmount() {
38
+ window.removeEventListener("mousedown", this.onWindowDown), window.removeEventListener("pointerdown", this.onWindowDown);
39
+ }
40
+ /**
41
+ * @hidden
42
+ */
43
+ render() {
44
+ const {
45
+ show: t,
46
+ anchor: n,
47
+ dir: i,
48
+ rows: d = e.defaultProps.rows,
49
+ columns: w = e.defaultProps.columns
50
+ } = this.props, p = i === "rtl" ? "right" : "left";
51
+ return /* @__PURE__ */ r.createElement(
52
+ c,
53
+ {
54
+ anchor: n,
55
+ anchorAlign: { horizontal: p, vertical: "bottom" },
56
+ popupAlign: { horizontal: p, vertical: "top" },
57
+ popupClass: "k-ct-popup k-group k-reset k-state-border-up",
58
+ show: t,
59
+ style: i === "rtl" ? { direction: "rtl" } : void 0
60
+ },
61
+ /* @__PURE__ */ r.createElement(
62
+ h,
63
+ {
64
+ rows: d,
65
+ columns: w,
66
+ createTableMessage: this.props.createTableMessage,
67
+ createTableHintMessage: this.props.createTableHintMessage,
68
+ onCellClick: this.props.onTableInsert,
69
+ onDown: this.onPointerDown
70
+ }
71
+ )
72
+ );
73
+ }
74
+ };
75
+ e.propTypes = {
76
+ show: o.bool.isRequired,
77
+ createTableMessage: o.string.isRequired,
78
+ createTableHintMessage: o.string.isRequired,
79
+ onClose: o.func.isRequired,
80
+ onTableInsert: o.func.isRequired,
81
+ anchor: o.any,
82
+ rows: o.number,
83
+ columns: o.number,
84
+ dir: o.string
85
+ }, e.defaultProps = {
86
+ rows: 6,
87
+ columns: 8
88
+ };
89
+ let s = e;
90
+ l.InsertTablePopup = s;
91
+ })(a || (a = {}));
92
+ export {
93
+ a as InsertTablePopupNS
94
+ };
@@ -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";const i=require("react"),u=require("../utils.js");function p(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const l=p(i),d="k-ct-cell k-disabled",h="k-selected";class m extends l.Component{constructor(){super(...arguments),this.state={row:-1,col:-1}}renderCell(e,t,o){const r=Math.floor(e/this.props.columns),s=e%this.props.columns,c=s<=o&&r<=t;return l.createElement("span",{className:d+(c?` ${h}`:""),onMouseEnter:()=>this.setState({row:r,col:s}),onClick:()=>this.props.onCellClick.call(void 0,r,s),key:e})}render(){const e=[],t=this.props.columns*this.props.rows,{row:o,col:r}=this.state,{onDown:s}=this.props;let c=this.props.createTableMessage;r>-1&&(c=u.formatString(this.props.createTableHintMessage,o+1,r+1));for(let a=0;a<t;a++)e.push(this.renderCell(a,o,r));return[l.createElement("div",{onMouseLeave:()=>this.setState({row:-1,col:-1}),key:"cells",style:{borderColor:"inherit"},onPointerDown:s,onMouseDown:s},e),l.createElement("div",{className:"k-status",key:"status",onPointerDown:s,onMouseDown:s},c)]}}module.exports=m;
@@ -0,0 +1,58 @@
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 { formatString as a } from "../utils.mjs";
11
+ const i = "k-ct-cell k-disabled", p = "k-selected";
12
+ class m extends l.Component {
13
+ constructor() {
14
+ super(...arguments), this.state = { row: -1, col: -1 };
15
+ }
16
+ renderCell(t, n, o) {
17
+ const s = Math.floor(t / this.props.columns), e = t % this.props.columns, r = e <= o && s <= n;
18
+ return /* @__PURE__ */ l.createElement(
19
+ "span",
20
+ {
21
+ className: i + (r ? ` ${p}` : ""),
22
+ onMouseEnter: () => this.setState({ row: s, col: e }),
23
+ onClick: () => this.props.onCellClick.call(void 0, s, e),
24
+ key: t
25
+ }
26
+ );
27
+ }
28
+ render() {
29
+ const t = [], n = this.props.columns * this.props.rows, { row: o, col: s } = this.state, { onDown: e } = this.props;
30
+ let r = this.props.createTableMessage;
31
+ s > -1 && (r = a(this.props.createTableHintMessage, o + 1, s + 1));
32
+ for (let c = 0; c < n; c++)
33
+ t.push(this.renderCell(c, o, s));
34
+ return [/* @__PURE__ */ l.createElement(
35
+ "div",
36
+ {
37
+ onMouseLeave: () => this.setState({ row: -1, col: -1 }),
38
+ key: "cells",
39
+ style: { borderColor: "inherit" },
40
+ onPointerDown: e,
41
+ onMouseDown: e
42
+ },
43
+ t
44
+ ), /* @__PURE__ */ l.createElement(
45
+ "div",
46
+ {
47
+ className: "k-status",
48
+ key: "status",
49
+ onPointerDown: e,
50
+ onMouseDown: e
51
+ },
52
+ r
53
+ )];
54
+ }
55
+ }
56
+ export {
57
+ m as default
58
+ };
@@ -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 S=require("react"),v=require("@progress/kendo-react-buttons"),h=require("../utils.js"),f=require("@progress/kendo-react-intl"),P=require("../../messages/index.js"),N=require("./popup.js"),d=require("@progress/kendo-editor-common"),k=require("@progress/kendo-react-common");function y(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const b=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(o,s,b.get?b:{enumerable:!0,get:()=>t[s]})}}return o.default=t,Object.freeze(o)}const T=y(S);exports.InsertTableToolNS=void 0;(t=>{t.createInsertTableTool=o=>{const s=class extends T.Component{constructor(){super(...arguments),this.state={openedPopup:!1},this.button=null,this.togglePopup=()=>{this.setState({openedPopup:!this.state.openedPopup})},this.closePopup=()=>{this.state.openedPopup&&this.togglePopup()},this.onTableInsert=(n,l)=>{const{view:e}=this.props;if(!e)return;const{table:a,table_row:c,table_cell:i}=e.state.schema.nodes,r=d.createTable({table:a,table_row:c,table_cell:i},n,l);r&&d.insertNode(r,!0)(e.state,e.dispatch),e.focus(),this.closePopup()}}render(){const{view:n,render:l,...e}=this.props,a=n&&n.state,c=f.provideLocalizationService(this),{createTable:i,createTableHint:r}=o.messages,g=c.toLanguageString(i,P.messages[i]),I=c.toLanguageString(r,P.messages[r]),p=!!(!a||!d.canInsert(a,a.schema.nodes.table)||h.parentNode(a.selection.$from,u=>u.type.name==="table_caption_external")),m=[T.createElement(v.Button,{onClick:p?void 0:this.togglePopup,"aria-disabled":p?!0:void 0,ref:u=>this.button=u&&u.element,key:"InsertTable",...h.onDownPreventDefault,title:g,...o.props,...e,className:k.classNames(e.className,o.props.className,{"k-disabled":p})}),n&&!p&&T.createElement(N.InsertTablePopupNS.InsertTablePopup,{key:"insertTablePopup",createTableMessage:g,createTableHintMessage:I,dir:e.dir,anchor:this.button,show:this.state.openedPopup,onClose:this.closePopup,onTableInsert:this.onTableInsert})||null];return l?l.call(void 0,m,{view:n}):m}};return f.registerForLocalization(s),s}})(exports.InsertTableToolNS||(exports.InsertTableToolNS={}));
@@ -0,0 +1,73 @@
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 c from "react";
10
+ import { Button as f } from "@progress/kendo-react-buttons";
11
+ import { parentNode as P, onDownPreventDefault as I } from "../utils.mjs";
12
+ import { registerForLocalization as v, provideLocalizationService as N } from "@progress/kendo-react-intl";
13
+ import { messages as d } from "../../messages/index.mjs";
14
+ import { InsertTablePopupNS as w } from "./popup.mjs";
15
+ import { createTable as S, insertNode as M, canInsert as k } from "@progress/kendo-editor-common";
16
+ import { classNames as y } from "@progress/kendo-react-common";
17
+ var h;
18
+ ((T) => {
19
+ T.createInsertTableTool = (p) => {
20
+ const u = class extends c.Component {
21
+ constructor() {
22
+ super(...arguments), this.state = {
23
+ openedPopup: !1
24
+ }, this.button = null, this.togglePopup = () => {
25
+ this.setState({
26
+ openedPopup: !this.state.openedPopup
27
+ });
28
+ }, this.closePopup = () => {
29
+ this.state.openedPopup && this.togglePopup();
30
+ }, this.onTableInsert = (t, a) => {
31
+ const { view: e } = this.props;
32
+ if (!e)
33
+ return;
34
+ const { table: o, table_row: r, table_cell: n } = e.state.schema.nodes, s = S({ table: o, table_row: r, table_cell: n }, t, a);
35
+ s && M(s, !0)(e.state, e.dispatch), e.focus(), this.closePopup();
36
+ };
37
+ }
38
+ render() {
39
+ const { view: t, render: a, ...e } = this.props, o = t && t.state, r = N(this), { createTable: n, createTableHint: s } = p.messages, m = r.toLanguageString(n, d[n]), g = r.toLanguageString(s, d[s]), l = !!(!o || !k(o, o.schema.nodes.table) || P(o.selection.$from, (i) => i.type.name === "table_caption_external")), b = [/* @__PURE__ */ c.createElement(
40
+ f,
41
+ {
42
+ onClick: l ? void 0 : this.togglePopup,
43
+ "aria-disabled": l ? !0 : void 0,
44
+ ref: (i) => this.button = i && i.element,
45
+ key: "InsertTable",
46
+ ...I,
47
+ title: m,
48
+ ...p.props,
49
+ ...e,
50
+ className: y(e.className, p.props.className, { "k-disabled": l })
51
+ }
52
+ ), t && !l && /* @__PURE__ */ c.createElement(
53
+ w.InsertTablePopup,
54
+ {
55
+ key: "insertTablePopup",
56
+ createTableMessage: m,
57
+ createTableHintMessage: g,
58
+ dir: e.dir,
59
+ anchor: this.button,
60
+ show: this.state.openedPopup,
61
+ onClose: this.closePopup,
62
+ onTableInsert: this.onTableInsert
63
+ }
64
+ ) || null];
65
+ return a ? a.call(void 0, b, { view: t }) : b;
66
+ }
67
+ };
68
+ return v(u), u;
69
+ };
70
+ })(h || (h = {}));
71
+ export {
72
+ h as InsertTableToolNS
73
+ };
@@ -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 S=require("react"),d=require("@progress/kendo-editor-common"),p=require("@progress/kendo-react-buttons"),v=require("../config/toolsSettings.js"),k=require("@progress/kendo-react-intl"),T=require("../messages/index.js");function I(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const f=I(S),m=(e,i)=>{let{from:t,to:n}=e.selection,l=null;return e.doc.nodesBetween(t,n,a=>(l=l||(a.type===i?a:null),!l)),l},h=e=>{let i=!1;const t=e.view,n=v.listsTypes,l=e.listType,a=k.useLocalization();let y=[...e.items||[]],c,r;if(t){const s=t.state,o=s&&s.schema.nodes;c=o&&m(s,o[n.orderedList]),r=o&&m(s,o[n.bulletList]),i=!!(l===n.orderedList?c&&!r:!c&&r)}const g=s=>{t&&(d.toggleList(t.state,t.dispatch,t,{listType:l,...n,listAttrs:{}},"InsertList"),t.focus())},L=s=>{if(t){const o=s.item.style?{style:"list-style-type: "+s.item.style+";"}:{},u=c||r;if(u&&d.listStyle(u.attrs)!==s.item.style){const b=t.state.selection.$head.posAtIndex(0,-2)-1;t.dispatch(t.state.tr.setNodeMarkup(b,t.state.schema.nodes[l],o))}else d.toggleList(t.state,t.dispatch,t,{listType:l,...n,listAttrs:o},"InsertList");t.focus()}};if(i&&(c||r)){const s=d.listStyle((c||r).attrs);y=y.map((o,u)=>({...o,selected:s?o.style===s:u===0}))}return f.createElement("span",{onMouseDown:s=>{s.preventDefault()}},f.createElement(p.SplitButton,{textField:"text",items:y,icon:e.icon,svgIcon:e.svgIcon,onButtonClick:g,onItemClick:L,buttonClass:i?"k-selected":void 0,title:e.title!==void 0?e.title:a.toLanguageString(e.titleKey,T.messages[e.titleKey])}))};exports.ListTool=h;
@@ -0,0 +1,61 @@
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 u from "react";
10
+ import { listStyle as y, toggleList as f } from "@progress/kendo-editor-common";
11
+ import { SplitButton as h } from "@progress/kendo-react-buttons";
12
+ import { listsTypes as I } from "../config/toolsSettings.mjs";
13
+ import { useLocalization as T } from "@progress/kendo-react-intl";
14
+ import { messages as k } from "../messages/index.mjs";
15
+ const L = (s, a) => {
16
+ let { from: t, to: l } = s.selection, i = null;
17
+ return s.doc.nodesBetween(t, l, (r) => (i = i || (r.type === a ? r : null), !i)), i;
18
+ }, C = (s) => {
19
+ let a = !1;
20
+ const t = s.view, l = I, i = s.listType, r = T();
21
+ let d = [...s.items || []], n, c;
22
+ if (t) {
23
+ const e = t.state, o = e && e.schema.nodes;
24
+ n = o && L(e, o[l.orderedList]), c = o && L(e, o[l.bulletList]), a = !!(i === l.orderedList ? n && !c : !n && c);
25
+ }
26
+ const p = (e) => {
27
+ t && (f(t.state, t.dispatch, t, { listType: i, ...l, listAttrs: {} }, "InsertList"), t.focus());
28
+ }, g = (e) => {
29
+ if (t) {
30
+ const o = e.item.style ? { style: "list-style-type: " + e.item.style + ";" } : {}, m = n || c;
31
+ if (m && y(m.attrs) !== e.item.style) {
32
+ const v = t.state.selection.$head.posAtIndex(0, -2) - 1;
33
+ t.dispatch(t.state.tr.setNodeMarkup(v, t.state.schema.nodes[i], o));
34
+ } else
35
+ f(t.state, t.dispatch, t, { listType: i, ...l, listAttrs: o }, "InsertList");
36
+ t.focus();
37
+ }
38
+ };
39
+ if (a && (n || c)) {
40
+ const e = y((n || c).attrs);
41
+ d = d.map((o, m) => ({ ...o, selected: e ? o.style === e : m === 0 }));
42
+ }
43
+ return /* @__PURE__ */ u.createElement("span", { onMouseDown: (e) => {
44
+ e.preventDefault();
45
+ } }, /* @__PURE__ */ u.createElement(
46
+ h,
47
+ {
48
+ textField: "text",
49
+ items: d,
50
+ icon: s.icon,
51
+ svgIcon: s.svgIcon,
52
+ onButtonClick: p,
53
+ onItemClick: g,
54
+ buttonClass: a ? "k-selected" : void 0,
55
+ title: s.title !== void 0 ? s.title : r.toLanguageString(s.titleKey, k[s.titleKey])
56
+ }
57
+ ));
58
+ };
59
+ export {
60
+ C as ListTool
61
+ };
package/tools/lists.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 v=require("react"),S=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-editor-common"),h=require("./utils.js"),b=require("@progress/kendo-react-intl"),N=require("../messages/index.js");function O(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 L=O(v);exports.ListToolNS=void 0;(t=>{t.createListTool=e=>{const o=class extends L.Component{render(){const{view:s,render:a,...y}=this.props;let i=!1;const T=b.provideLocalizationService(this),u=e.messages.title,n=e.types,d=e.listType;if(s){const c=s.state,m=c.schema.nodes,f=l.hasNode(c,m[n.orderedList]),g=l.hasNode(c,m[n.bulletList]);d===n.orderedList?i=f&&!g:i=!f&&g}const p=L.createElement(S.Button,{onClick:()=>s&&l.toggleList(s.state,s.dispatch,s,{listType:d,...n},e.commandName),togglable:!0,selected:i,title:T.toLanguageString(u,N.messages[u]),...h.onDownPreventDefault,...e.props,...y});return a?a.call(void 0,p,{view:s}):p}};return b.registerForLocalization(o),o}})(exports.ListToolNS||(exports.ListToolNS={}));
@@ -0,0 +1,47 @@
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 f from "react";
10
+ import { Button as T } from "@progress/kendo-react-buttons";
11
+ import { hasNode as u, toggleList as y } from "@progress/kendo-editor-common";
12
+ import { onDownPreventDefault as b } from "./utils.mjs";
13
+ import { registerForLocalization as z, provideLocalizationService as N } from "@progress/kendo-react-intl";
14
+ import { messages as S } from "../messages/index.mjs";
15
+ var L;
16
+ ((h) => {
17
+ h.createListTool = (e) => {
18
+ const i = class extends f.Component {
19
+ render() {
20
+ const { view: t, render: l, ...v } = this.props;
21
+ let s = !1;
22
+ const g = N(this), a = e.messages.title, o = e.types, n = e.listType;
23
+ if (t) {
24
+ const r = t.state, m = r.schema.nodes, p = u(r, m[o.orderedList]), d = u(r, m[o.bulletList]);
25
+ n === o.orderedList ? s = p && !d : s = !p && d;
26
+ }
27
+ const c = /* @__PURE__ */ f.createElement(
28
+ T,
29
+ {
30
+ onClick: () => t && y(t.state, t.dispatch, t, { listType: n, ...o }, e.commandName),
31
+ togglable: !0,
32
+ selected: s,
33
+ title: g.toLanguageString(a, S[a]),
34
+ ...b,
35
+ ...e.props,
36
+ ...v
37
+ }
38
+ );
39
+ return l ? l.call(void 0, c, { view: t }) : c;
40
+ }
41
+ };
42
+ return z(i), i;
43
+ };
44
+ })(L || (L = {}));
45
+ export {
46
+ L as ListToolNS
47
+ };
@@ -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 N=require("react"),S=require("@progress/kendo-react-buttons"),c=require("@progress/kendo-editor-common"),k=require("./utils.js"),b=require("@progress/kendo-react-intl"),q=require("../messages/index.js"),I=require("@progress/kendo-react-common");function L(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>o[n]})}}return e.default=o,Object.freeze(e)}const T=L(N);exports.OutdentToolNS=void 0;(o=>{o.createOutdentTool=e=>{const n=class extends T.Component{render(){const{view:t,render:l,...i}=this.props,s=t&&t.state,d=i.dir,u=!!s&&c.isIndented(s,e.actions,d),m=s&&s.schema.nodes[e.listsTypes.listItem],p=!!s&&c.canOutdentAsListItem(s,{nodes:e.actions,listsTypes:e.listsTypes}),v=u||p,y=b.provideLocalizationService(this),f=e.messages.title,r=!v,O=T.createElement(S.Button,{onClick:r?void 0:()=>{t&&p&&m?c.liftListItem(m)(t.state,t.dispatch):t&&u&&c.indentBlocks(e.actions,e.commandName,d)(t.state,t.dispatch)},"aria-disabled":r?!0:void 0,title:y.toLanguageString(f,q.messages[f]),...k.onDownPreventDefault,...e.props,...i,className:I.classNames(i.className,e.props.className,{"k-disabled":r})});return l?l.call(void 0,O,{view:t}):O}};return b.registerForLocalization(n),n}})(exports.OutdentToolNS||(exports.OutdentToolNS={}));
@@ -0,0 +1,43 @@
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 u from "react";
10
+ import { Button as N } from "@progress/kendo-react-buttons";
11
+ import { isIndented as O, canOutdentAsListItem as b, liftListItem as h, indentBlocks as I } from "@progress/kendo-editor-common";
12
+ import { onDownPreventDefault as y } from "./utils.mjs";
13
+ import { registerForLocalization as k, provideLocalizationService as z } from "@progress/kendo-react-intl";
14
+ import { messages as S } from "../messages/index.mjs";
15
+ import { classNames as w } from "@progress/kendo-react-common";
16
+ var f;
17
+ ((v) => {
18
+ v.createOutdentTool = (t) => {
19
+ const n = class extends u.Component {
20
+ render() {
21
+ const { view: o, render: i, ...s } = this.props, e = o && o.state, r = s.dir, c = !!e && O(e, t.actions, r), l = e && e.schema.nodes[t.listsTypes.listItem], d = !!e && b(e, { nodes: t.actions, listsTypes: t.listsTypes }), T = c || d, L = z(this), m = t.messages.title, a = !T, p = /* @__PURE__ */ u.createElement(
22
+ N,
23
+ {
24
+ onClick: a ? void 0 : () => {
25
+ o && d && l ? h(l)(o.state, o.dispatch) : o && c && I(t.actions, t.commandName, r)(o.state, o.dispatch);
26
+ },
27
+ "aria-disabled": a ? !0 : void 0,
28
+ title: L.toLanguageString(m, S[m]),
29
+ ...y,
30
+ ...t.props,
31
+ ...s,
32
+ className: w(s.className, t.props.className, { "k-disabled": a })
33
+ }
34
+ );
35
+ return i ? i.call(void 0, p, { view: o }) : p;
36
+ }
37
+ };
38
+ return k(n), n;
39
+ };
40
+ })(f || (f = {}));
41
+ export {
42
+ f as OutdentToolNS
43
+ };
package/tools/pdf.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 d=require("react"),f=require("@progress/kendo-react-buttons"),g=require("@progress/kendo-react-intl"),p=require("@progress/kendo-react-pdf"),P=require("./utils.js"),b=require("../messages/index.js"),v=require("../config/toolsSettings.js");function m(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const a=m(d),{pdf:O,savePdfOptions:S}=v.EditorToolsSettings,k=t=>{const{view:e,render:n,settings:o=O,savePdfOptions:s,savePdfCallback:r,...u}=t,c=o.messages.title,l=a.useCallback(()=>{e&&p.savePDF(e.dom,{...S,...s||{}},r)},[e,s,r]),i=a.createElement(f.Button,{onClick:l,title:g.useLocalization().toLanguageString(c,b.messages[c]),...P.onDownPreventDefault,...o.props,...u});return n?n.call(void 0,i,{view:e}):i};exports.Pdf=k;
package/tools/pdf.mjs ADDED
@@ -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 * as a from "react";
10
+ import { Button as p } from "@progress/kendo-react-buttons";
11
+ import { useLocalization as c } from "@progress/kendo-react-intl";
12
+ import { savePDF as d } from "@progress/kendo-react-pdf";
13
+ import { onDownPreventDefault as u } from "./utils.mjs";
14
+ import { messages as v } from "../messages/index.mjs";
15
+ import { EditorToolsSettings as P } from "../config/toolsSettings.mjs";
16
+ const { pdf: g, savePdfOptions: b } = P, E = (m) => {
17
+ const { view: t, render: o, settings: e = g, savePdfOptions: s, savePdfCallback: n, ...f } = m, r = e.messages.title, l = a.useCallback(
18
+ () => {
19
+ t && d(t.dom, { ...b, ...s || {} }, n);
20
+ },
21
+ [t, s, n]
22
+ ), i = /* @__PURE__ */ a.createElement(
23
+ p,
24
+ {
25
+ onClick: l,
26
+ title: c().toLanguageString(r, v[r]),
27
+ ...u,
28
+ ...e.props,
29
+ ...f
30
+ }
31
+ );
32
+ return o ? o.call(void 0, i, { view: t }) : i;
33
+ };
34
+ export {
35
+ E as Pdf
36
+ };
package/tools/print.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 g=require("react"),b=require("@progress/kendo-react-buttons"),p=require("@progress/kendo-react-intl"),f=require("./utils.js"),k=require("../messages/index.js"),w=require("../config/toolsSettings.js"),q=require("@progress/kendo-react-common");function v(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const d=v(g),{print:P}=w.EditorToolsSettings,S=e=>{const{view:t,render:o,settings:n=P,...c}=e,i=t&&t.dom,a=i&&i.ownerDocument,s=a&&a.defaultView,l=n.messages.title,r=!s||s===window,m=d.useCallback(()=>{s&&s.print()},[s]),u=d.createElement(b.Button,{onClick:r?void 0:m,"aria-disabled":r?!0:void 0,title:p.useLocalization().toLanguageString(l,k.messages[l]),...f.onDownPreventDefault,...n.props,...c,className:q.classNames(c.className,n.props.className,{"k-disabled":r})});return o?o.call(void 0,u,{view:t}):u};exports.Print=S;