@progress/kendo-react-editor 9.0.0-develop.2 → 9.0.0-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.
- package/README.md +27 -26
- package/config/toolsSettings.mjs +31 -11
- package/dialogs/FindReplace.js +1 -1
- package/dialogs/FindReplace.mjs +56 -48
- package/dist/cdn/js/kendo-react-editor.js +1 -1
- package/index.d.mts +1 -4
- package/index.d.ts +1 -4
- package/messages/index.mjs +2 -0
- package/package-metadata.mjs +1 -1
- package/package.json +11 -11
- package/tools/cleanFormatting.mjs +5 -8
- package/tools/findReplace.mjs +16 -21
- package/tools/indent.mjs +3 -1
- package/tools/insertImage.mjs +25 -22
- package/tools/insertLink.mjs +25 -22
- package/tools/insertTable/popupGrid.mjs +14 -20
- package/tools/lists-styled.js +1 -1
- package/tools/lists-styled.mjs +26 -16
- package/tools/outdent.mjs +8 -2
- package/tools/pdf.mjs +3 -6
- package/tools/print.mjs +3 -6
- package/tools/proseMirrorTool.mjs +4 -1
- package/tools/selectAll.mjs +3 -6
- package/tools/table-wizard/cellPropsUtils.js +1 -1
- package/tools/table-wizard/cellPropsUtils.mjs +39 -36
- package/tools/table-wizard/tableCellProperties.mjs +81 -21
- package/tools/table-wizard/tableProperties.mjs +183 -62
- package/tools/table-wizard/utils.mjs +5 -4
- package/tools/unlink.mjs +7 -2
- package/tools/utils.js +1 -1
- package/tools/utils.mjs +6 -6
- package/tools/viewHtml.mjs +23 -20
- package/utils/index.mjs +5 -1
package/index.d.mts
CHANGED
|
@@ -2891,10 +2891,7 @@ declare interface ToolWithDialogRenderProp {
|
|
|
2891
2891
|
/**
|
|
2892
2892
|
* Fires when a tool is about to be rendered. Used to override the default appearance of the tool.
|
|
2893
2893
|
*/
|
|
2894
|
-
render?: (tool: [
|
|
2895
|
-
React.ReactElement<any>,
|
|
2896
|
-
React.ReactElement<any> | null
|
|
2897
|
-
], args?: any) => React.ReactNode;
|
|
2894
|
+
render?: (tool: [React.ReactElement<any>, React.ReactElement<any> | null], args?: any) => React.ReactNode;
|
|
2898
2895
|
}
|
|
2899
2896
|
|
|
2900
2897
|
/**
|
package/index.d.ts
CHANGED
|
@@ -2891,10 +2891,7 @@ declare interface ToolWithDialogRenderProp {
|
|
|
2891
2891
|
/**
|
|
2892
2892
|
* Fires when a tool is about to be rendered. Used to override the default appearance of the tool.
|
|
2893
2893
|
*/
|
|
2894
|
-
render?: (tool: [
|
|
2895
|
-
React.ReactElement<any>,
|
|
2896
|
-
React.ReactElement<any> | null
|
|
2897
|
-
], args?: any) => React.ReactNode;
|
|
2894
|
+
render?: (tool: [React.ReactElement<any>, React.ReactElement<any> | null], args?: any) => React.ReactNode;
|
|
2898
2895
|
}
|
|
2899
2896
|
|
|
2900
2897
|
/**
|
package/messages/index.mjs
CHANGED
|
@@ -134,7 +134,9 @@ const e = "editor.bold", t = "editor.italic", o = "editor.underline", r = "edito
|
|
|
134
134
|
[at]: "Top",
|
|
135
135
|
[pt]: "Bottom",
|
|
136
136
|
[bt]: "None",
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/quotes
|
|
137
138
|
[Pt]: "Using 'scope' attribute",
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/quotes
|
|
138
140
|
[gt]: "Using 'id' attributes",
|
|
139
141
|
[Ct]: "Rows",
|
|
140
142
|
[ht]: "Columns",
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-editor",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1729499721,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-editor",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.4",
|
|
4
4
|
"description": "React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-drawing": "^1.20.4",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-buttons": "9.0.0-develop.
|
|
28
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
29
|
-
"@progress/kendo-react-dialogs": "9.0.0-develop.
|
|
30
|
-
"@progress/kendo-react-dropdowns": "9.0.0-develop.
|
|
31
|
-
"@progress/kendo-react-form": "9.0.0-develop.
|
|
32
|
-
"@progress/kendo-react-inputs": "9.0.0-develop.
|
|
33
|
-
"@progress/kendo-react-intl": "9.0.0-develop.
|
|
34
|
-
"@progress/kendo-react-layout": "9.0.0-develop.
|
|
35
|
-
"@progress/kendo-react-pdf": "9.0.0-develop.
|
|
36
|
-
"@progress/kendo-react-popup": "9.0.0-develop.
|
|
27
|
+
"@progress/kendo-react-buttons": "9.0.0-develop.4",
|
|
28
|
+
"@progress/kendo-react-common": "9.0.0-develop.4",
|
|
29
|
+
"@progress/kendo-react-dialogs": "9.0.0-develop.4",
|
|
30
|
+
"@progress/kendo-react-dropdowns": "9.0.0-develop.4",
|
|
31
|
+
"@progress/kendo-react-form": "9.0.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-inputs": "9.0.0-develop.4",
|
|
33
|
+
"@progress/kendo-react-intl": "9.0.0-develop.4",
|
|
34
|
+
"@progress/kendo-react-layout": "9.0.0-develop.4",
|
|
35
|
+
"@progress/kendo-react-pdf": "9.0.0-develop.4",
|
|
36
|
+
"@progress/kendo-react-popup": "9.0.0-develop.4",
|
|
37
37
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
38
38
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
39
39
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
@@ -15,14 +15,11 @@ import { cleanFormatting as b } from "@progress/kendo-editor-common";
|
|
|
15
15
|
import { EditorToolsSettings as N } from "../config/toolsSettings.mjs";
|
|
16
16
|
import { classNames as v } from "@progress/kendo-react-common";
|
|
17
17
|
const { cleanFormatting: k } = N, c = b(), S = (a) => {
|
|
18
|
-
const { view: t, render: s, settings: o = k, ...l } = a, n = o.messages.title, e = !t || !c(t.state), d = r.useCallback(
|
|
19
|
-
() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
[t]
|
|
25
|
-
), m = /* @__PURE__ */ r.createElement(
|
|
18
|
+
const { view: t, render: s, settings: o = k, ...l } = a, n = o.messages.title, e = !t || !c(t.state), d = r.useCallback(() => {
|
|
19
|
+
t && c(t.state, (i) => {
|
|
20
|
+
i.setMeta("commandName", o.commandName), t.dispatch(i);
|
|
21
|
+
});
|
|
22
|
+
}, [t]), m = /* @__PURE__ */ r.createElement(
|
|
26
23
|
p,
|
|
27
24
|
{
|
|
28
25
|
onClick: e ? void 0 : d,
|
package/tools/findReplace.mjs
CHANGED
|
@@ -24,27 +24,22 @@ let u = class extends s.Component {
|
|
|
24
24
|
*/
|
|
25
25
|
render() {
|
|
26
26
|
const { view: e, ...t } = this.props, { props: i } = n, l = h(this), a = n.messages.findReplaceToolTitle, o = !e;
|
|
27
|
-
return [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
onClose: this.onClose,
|
|
44
|
-
dir: t.dir,
|
|
45
|
-
key: "dialog"
|
|
46
|
-
}
|
|
47
|
-
)];
|
|
27
|
+
return [
|
|
28
|
+
/* @__PURE__ */ s.createElement(
|
|
29
|
+
r,
|
|
30
|
+
{
|
|
31
|
+
onClick: o ? void 0 : this.onOpen,
|
|
32
|
+
"aria-disabled": o ? !0 : void 0,
|
|
33
|
+
...d,
|
|
34
|
+
title: l.toLanguageString(a, m[a]),
|
|
35
|
+
key: "tool",
|
|
36
|
+
...i,
|
|
37
|
+
...t,
|
|
38
|
+
className: f(t.className, i.className, { "k-disabled": o })
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
this.state.showDialog && e && /* @__PURE__ */ s.createElement(c, { view: e, onClose: this.onClose, dir: t.dir, key: "dialog" })
|
|
42
|
+
];
|
|
48
43
|
}
|
|
49
44
|
};
|
|
50
45
|
g(u);
|
package/tools/indent.mjs
CHANGED
package/tools/insertImage.mjs
CHANGED
|
@@ -26,28 +26,31 @@ const L = (e) => {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
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 = [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 = [
|
|
30
|
+
/* @__PURE__ */ r.createElement(
|
|
31
|
+
p,
|
|
32
|
+
{
|
|
33
|
+
onClick: a ? void 0 : this.toggleDialog,
|
|
34
|
+
"aria-disabled": a ? !0 : void 0,
|
|
35
|
+
key: "insertImage",
|
|
36
|
+
...u,
|
|
37
|
+
title: g.toLanguageString(m, I[m]),
|
|
38
|
+
...e.props,
|
|
39
|
+
...s,
|
|
40
|
+
className: v(s.className, e.props.className, { "k-disabled": a })
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
this.state.openedDialog && o && /* @__PURE__ */ r.createElement(
|
|
44
|
+
D.InsertImageDialog,
|
|
45
|
+
{
|
|
46
|
+
key: "insertImageDialog",
|
|
47
|
+
view: o,
|
|
48
|
+
settings: e,
|
|
49
|
+
dir: s.dir,
|
|
50
|
+
onClose: this.toggleDialog
|
|
51
|
+
}
|
|
52
|
+
) || null
|
|
53
|
+
];
|
|
51
54
|
return n ? n.call(void 0, c, { view: o }) : c;
|
|
52
55
|
}
|
|
53
56
|
};
|
package/tools/insertLink.mjs
CHANGED
|
@@ -28,28 +28,31 @@ var m;
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
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 = [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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 = [
|
|
32
|
+
/* @__PURE__ */ s.createElement(
|
|
33
|
+
u,
|
|
34
|
+
{
|
|
35
|
+
onClick: i ? void 0 : this.toggleDialog,
|
|
36
|
+
"aria-disabled": i ? !0 : void 0,
|
|
37
|
+
key: "link",
|
|
38
|
+
...f,
|
|
39
|
+
title: k.toLanguageString(n, N[n]),
|
|
40
|
+
...o.props,
|
|
41
|
+
...r,
|
|
42
|
+
className: y(r.className, o.props.className, { "k-disabled": i })
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
this.state.openedDialog && e && /* @__PURE__ */ s.createElement(
|
|
46
|
+
h.InsertLinkDialog,
|
|
47
|
+
{
|
|
48
|
+
key: "insertLinkDialog",
|
|
49
|
+
settings: o,
|
|
50
|
+
dir: r.dir,
|
|
51
|
+
view: e,
|
|
52
|
+
onClose: this.toggleDialog
|
|
53
|
+
}
|
|
54
|
+
) || null
|
|
55
|
+
];
|
|
53
56
|
return l ? l.call(void 0, c, { view: e }) : c;
|
|
54
57
|
}
|
|
55
58
|
};
|
|
@@ -31,26 +31,20 @@ class m extends l.Component {
|
|
|
31
31
|
s > -1 && (r = a(this.props.createTableHintMessage, o + 1, s + 1));
|
|
32
32
|
for (let c = 0; c < n; c++)
|
|
33
33
|
t.push(this.renderCell(c, o, s));
|
|
34
|
-
return [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
key: "status",
|
|
49
|
-
onPointerDown: e,
|
|
50
|
-
onMouseDown: e
|
|
51
|
-
},
|
|
52
|
-
r
|
|
53
|
-
)];
|
|
34
|
+
return [
|
|
35
|
+
/* @__PURE__ */ l.createElement(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
onMouseLeave: () => this.setState({ row: -1, col: -1 }),
|
|
39
|
+
key: "cells",
|
|
40
|
+
style: { borderColor: "inherit" },
|
|
41
|
+
onPointerDown: e,
|
|
42
|
+
onMouseDown: e
|
|
43
|
+
},
|
|
44
|
+
t
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ l.createElement("div", { className: "k-status", key: "status", onPointerDown: e, onMouseDown: e }, r)
|
|
47
|
+
];
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
50
|
export {
|
package/tools/lists-styled.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 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)=>{
|
|
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)=>{const{from:t,to:n}=e.selection;let 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;
|
package/tools/lists-styled.mjs
CHANGED
|
@@ -13,7 +13,8 @@ import { listsTypes as I } from "../config/toolsSettings.mjs";
|
|
|
13
13
|
import { useLocalization as T } from "@progress/kendo-react-intl";
|
|
14
14
|
import { messages as k } from "../messages/index.mjs";
|
|
15
15
|
const L = (s, a) => {
|
|
16
|
-
|
|
16
|
+
const { from: t, to: l } = s.selection;
|
|
17
|
+
let i = null;
|
|
17
18
|
return s.doc.nodesBetween(t, l, (r) => (i = i || (r.type === a ? r : null), !i)), i;
|
|
18
19
|
}, C = (s) => {
|
|
19
20
|
let a = !1;
|
|
@@ -38,23 +39,32 @@ const L = (s, a) => {
|
|
|
38
39
|
};
|
|
39
40
|
if (a && (n || c)) {
|
|
40
41
|
const e = y((n || c).attrs);
|
|
41
|
-
d = d.map((o, m) => ({
|
|
42
|
+
d = d.map((o, m) => ({
|
|
43
|
+
...o,
|
|
44
|
+
selected: e ? o.style === e : m === 0
|
|
45
|
+
}));
|
|
42
46
|
}
|
|
43
|
-
return /* @__PURE__ */ u.createElement(
|
|
44
|
-
|
|
45
|
-
} }, /* @__PURE__ */ u.createElement(
|
|
46
|
-
h,
|
|
47
|
+
return /* @__PURE__ */ u.createElement(
|
|
48
|
+
"span",
|
|
47
49
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
onMouseDown: (e) => {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
/* @__PURE__ */ u.createElement(
|
|
55
|
+
h,
|
|
56
|
+
{
|
|
57
|
+
textField: "text",
|
|
58
|
+
items: d,
|
|
59
|
+
icon: s.icon,
|
|
60
|
+
svgIcon: s.svgIcon,
|
|
61
|
+
onButtonClick: p,
|
|
62
|
+
onItemClick: g,
|
|
63
|
+
buttonClass: a ? "k-selected" : void 0,
|
|
64
|
+
title: s.title !== void 0 ? s.title : r.toLanguageString(s.titleKey, k[s.titleKey])
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
58
68
|
};
|
|
59
69
|
export {
|
|
60
70
|
C as ListTool
|
package/tools/outdent.mjs
CHANGED
|
@@ -22,14 +22,20 @@ var f;
|
|
|
22
22
|
N,
|
|
23
23
|
{
|
|
24
24
|
onClick: a ? void 0 : () => {
|
|
25
|
-
o && d && l ? h(l)(o.state, o.dispatch) : o && c && I(
|
|
25
|
+
o && d && l ? h(l)(o.state, o.dispatch) : o && c && I(
|
|
26
|
+
t.actions,
|
|
27
|
+
t.commandName,
|
|
28
|
+
r
|
|
29
|
+
)(o.state, o.dispatch);
|
|
26
30
|
},
|
|
27
31
|
"aria-disabled": a ? !0 : void 0,
|
|
28
32
|
title: L.toLanguageString(m, S[m]),
|
|
29
33
|
...y,
|
|
30
34
|
...t.props,
|
|
31
35
|
...s,
|
|
32
|
-
className: w(s.className, t.props.className, {
|
|
36
|
+
className: w(s.className, t.props.className, {
|
|
37
|
+
"k-disabled": a
|
|
38
|
+
})
|
|
33
39
|
}
|
|
34
40
|
);
|
|
35
41
|
return i ? i.call(void 0, p, { view: o }) : p;
|
package/tools/pdf.mjs
CHANGED
|
@@ -14,12 +14,9 @@ import { onDownPreventDefault as u } from "./utils.mjs";
|
|
|
14
14
|
import { messages as v } from "../messages/index.mjs";
|
|
15
15
|
import { EditorToolsSettings as P } from "../config/toolsSettings.mjs";
|
|
16
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
|
-
|
|
20
|
-
},
|
|
21
|
-
[t, s, n]
|
|
22
|
-
), i = /* @__PURE__ */ a.createElement(
|
|
17
|
+
const { view: t, render: o, settings: e = g, savePdfOptions: s, savePdfCallback: n, ...f } = m, r = e.messages.title, l = a.useCallback(() => {
|
|
18
|
+
t && d(t.dom, { ...b, ...s || {} }, n);
|
|
19
|
+
}, [t, s, n]), i = /* @__PURE__ */ a.createElement(
|
|
23
20
|
p,
|
|
24
21
|
{
|
|
25
22
|
onClick: l,
|
package/tools/print.mjs
CHANGED
|
@@ -14,12 +14,9 @@ import { messages as w } from "../messages/index.mjs";
|
|
|
14
14
|
import { EditorToolsSettings as b } from "../config/toolsSettings.mjs";
|
|
15
15
|
import { classNames as v } from "@progress/kendo-react-common";
|
|
16
16
|
const { print: k } = b, S = (d) => {
|
|
17
|
-
const { view: t, render: i, settings: e = k, ...n } = d, r = t && t.dom, a = r && r.ownerDocument, o = a && a.defaultView, c = e.messages.title, s = !o || o === window, p = l.useCallback(
|
|
18
|
-
()
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
[o]
|
|
22
|
-
), m = /* @__PURE__ */ l.createElement(
|
|
17
|
+
const { view: t, render: i, settings: e = k, ...n } = d, r = t && t.dom, a = r && r.ownerDocument, o = a && a.defaultView, c = e.messages.title, s = !o || o === window, p = l.useCallback(() => {
|
|
18
|
+
o && o.print();
|
|
19
|
+
}, [o]), m = /* @__PURE__ */ l.createElement(
|
|
23
20
|
u,
|
|
24
21
|
{
|
|
25
22
|
onClick: s ? void 0 : p,
|
|
@@ -18,7 +18,10 @@ const k = (e, r) => {
|
|
|
18
18
|
const { view: o, render: a, ...i } = this.props, p = N(this), n = e.messages.title, c = o && o.state, t = c ? !r(c) : !1, l = /* @__PURE__ */ m.createElement(
|
|
19
19
|
u,
|
|
20
20
|
{
|
|
21
|
-
onClick: t ? void 0 : () => o && r(
|
|
21
|
+
onClick: t ? void 0 : () => o && r(
|
|
22
|
+
o.state,
|
|
23
|
+
(d) => o.dispatch(d.setMeta("commandName", e.commandName))
|
|
24
|
+
),
|
|
22
25
|
"aria-disabled": t ? !0 : void 0,
|
|
23
26
|
...f,
|
|
24
27
|
title: p.toLanguageString(n, b[n]),
|
package/tools/selectAll.mjs
CHANGED
|
@@ -14,12 +14,9 @@ import { messages as f } from "../messages/index.mjs";
|
|
|
14
14
|
import { selectAll as u } from "@progress/kendo-editor-common";
|
|
15
15
|
import { EditorToolsSettings as g } from "../config/toolsSettings.mjs";
|
|
16
16
|
const { selectAll: d } = g, C = (i) => {
|
|
17
|
-
const { view: t, render: e, settings: o = d, ...n } = i, s = o.messages.title, c = r.useCallback(
|
|
18
|
-
()
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
[t]
|
|
22
|
-
), l = /* @__PURE__ */ r.createElement(
|
|
17
|
+
const { view: t, render: e, settings: o = d, ...n } = i, s = o.messages.title, c = r.useCallback(() => {
|
|
18
|
+
t && (u(t.state, t.dispatch), t.focus());
|
|
19
|
+
}, [t]), l = /* @__PURE__ */ r.createElement(
|
|
23
20
|
m,
|
|
24
21
|
{
|
|
25
22
|
onClick: c,
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@progress/kendo-editor-common"),s=require("./utils.js"),N=require("../utils.js"),b="k-colgroup-data",x=(o,e,n)=>{const l={cellWidth:null,widthUnit:""},r=e.node,t=n.start(e.depth);if(!r.attrs[b])return l;const h=new Set;let i="";const y=w.htmlToFragment(r.attrs[b]).firstChild;return o.forEach(a=>{const u=r.resolve(a.pos-t),c=u.parent,C=u.index();let g=0;for(let f=0;f<=C;f++)g+=c.child(f).attrs.colspan;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@progress/kendo-editor-common"),s=require("./utils.js"),N=require("../utils.js"),b="k-colgroup-data",x=(o,e,n)=>{const l={cellWidth:null,widthUnit:""},r=e.node,t=n.start(e.depth);if(!r.attrs[b])return l;const h=new Set;let i="";const y=w.htmlToFragment(r.attrs[b]).firstChild;return o.forEach(a=>{const u=r.resolve(a.pos-t),c=u.parent,C=u.index();let g=0;for(let f=0;f<=C;f++)g+=c.child(f).attrs.colspan;const d=y.children[g-1];d&&(i=d.style.width,h.add(i))}),h.size===1&&i&&(l.cellWidth=parseFloat(i)||null,l.widthUnit=s.getUnit(i)),l},v=(o,e,n)=>{const l={cellHeight:null,heightUnit:""},r=e.node,t=n.start(e.depth),h=new Set;let i="";return o.forEach(y=>{var c;const u=r.resolve(y.pos-t).parent;i=s.parseStyle(((c=u.attrs)==null?void 0:c.style)||"").height||"",h.add(i)}),h.size===1&&i&&(l.cellHeight=parseFloat(i)||null,l.heightUnit=s.getUnit(i)),l},p=(o,e)=>{const n=new Set;let l="";return o.forEach(r=>{var t;l=s.parseStyle(((t=r.node.attrs)==null?void 0:t.style)||"")[e]||"",n.add(l)}),n.size===1&&l?l:""},S=(o,e)=>{const n=new Set;let l="";return o.forEach(r=>{l=(r.node.attrs||{})[e]||"",n.add(l)}),n.size===1&&l?l:""},m={applyToAll:!1,cellWidth:null,widthUnit:"",cellHeight:null,heightUnit:"",alignment:{x:"",y:""},textControl:"",backgroundColor:void 0,cellPadding:null,borderWidth:null,borderColor:void 0,borderStyle:null,id:"",className:""},k=o=>{const e=s.selectedCells(o),n=o.selection.$from,l=e.length?N.parentNode(n,r=>r.type.spec.tableRole==="table"):null;return l?{...m,...x(e,l,n),...v(e,l,n),alignment:{x:p(e,"text-align"),y:p(e,"vertical-align")},textControl:p(e,"white-space"),backgroundColor:p(e,"background-color")||void 0,cellPadding:parseFloat(p(e,"padding"))||null,borderWidth:parseFloat(p(e,"border-width"))||null,borderColor:p(e,"border-color")||void 0,borderStyle:p(e,"border-style")||null,id:S(e,"id"),className:S(e,"class")}:m},W=(o,e,n)=>{const l=o.doc.resolve(e),r=l.parent,t=l.index();let h=0;for(let c=0;c<=t;c++)h+=r.child(c).attrs.colspan;const i=l.node(l.depth-1),y=l.posAtIndex(0,l.depth-1)-1;let a=i.attrs,u;if(a&&a[b]){const c=w.htmlToFragment(a[b]).firstChild;u=c.children[h-1],u.style.width=n,a={...a,[b]:c.outerHTML},o.setNodeMarkup(y,null,a)}else{let c=0;for(let d=0;d<r.childCount;d++)c+=r.child(d).attrs.colspan;const C=document.createElement("colgroup"),g=new Array(c);for(let d=0;d<c;d++)g[d]=document.createElement("col"),C.appendChild(g[d]);u=g[t],u.style.width=n,a={...a,[b]:"<colgroup>"+g.reduce((d,f)=>d+f.outerHTML,"")+"</colgroup>"},o.setNodeMarkup(y,null,a)}},P=(o,e,n)=>{const l=o.doc.resolve(e),r=l.parent,t=l.posAtIndex(0)-1;o.setNodeMarkup(t,null,s.setNodeStyle(r.attrs,"height",n))},U=(o,e,n)=>{n.forEach(({node:l,pos:r})=>{let t={...l.attrs};t=s.setNodeStyle(t,"border-color",e.borderColor||""),t=s.setNodeStyle(t,"border-style",e.borderStyle||""),t=s.setNodeStyle(t,"border-width",typeof e.borderWidth=="number"?e.borderWidth+"px":""),t=s.setNodeStyle(t,"padding",typeof e.cellPadding=="number"?e.cellPadding+"px":""),t=s.setNodeStyle(t,"background-color",e.backgroundColor||""),t=s.setNodeStyle(t,"text-align",e.alignment.x||""),t=s.setNodeStyle(t,"vertical-align",e.alignment.y||""),t=s.setNodeStyle(t,"white-space",e.textControl||""),t.id=e.id||null,t.class=e.className||null,o.setNodeMarkup(r,null,t),typeof e.cellWidth=="number"&&W(o,r,e.cellWidth+(e.widthUnit||"px")),typeof e.cellHeight=="number"&&P(o,r,e.cellHeight+(e.heightUnit||"px"))})},H=(o,e)=>{const n=o.tr,l=e.applyToAll?s.tableCells(o):s.selectedCells(o);return U(n,e,l),n};exports.applyCellsData=H;exports.cellsDefaultData=k;exports.initialCellData=m;
|