@progress/kendo-react-diagram 16.2.0-develop.9 → 16.2.1-develop.1
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/Diagram.js +1 -1
- package/Diagram.mjs +119 -114
- package/EULA.pdf +0 -0
- package/EULA.rtf +2730 -0
- package/EULA.txt +292 -0
- package/dist/cdn/js/kendo-react-diagram.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +25 -23
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/rich-text-editing/DiagramEditor.js +1 -1
- package/rich-text-editing/DiagramEditor.mjs +49 -48
- package/rich-text-editing/MainToolbar.d.ts +1 -1
- package/rich-text-editing/MainToolbar.js +1 -1
- package/rich-text-editing/MainToolbar.mjs +55 -71
- package/rich-text-editing/types.d.ts +1 -1
- package/utils/consts.d.ts +5 -0
- package/utils/consts.js +1 -1
- package/utils/consts.mjs +8 -3
|
@@ -11,40 +11,40 @@ import { useLocalization as Se } from "@progress/kendo-react-intl";
|
|
|
11
11
|
import { TextEditingToolbar as xe } from "./TextEditingToolbar.mjs";
|
|
12
12
|
import { ShapeEditingToolbar as ve } from "./ShapeEditingToolbar.mjs";
|
|
13
13
|
import { ConnectionEditingToolbar as we } from "./ConnectionEditingToolbar.mjs";
|
|
14
|
-
import { defaultTextToolbarTools as Ce, defaultMainToolbarTools as Pe, defaultShapeToolbarTools as ke, defaultConnectionToolbarTools as
|
|
15
|
-
import { getContextToolbarAnchors as X, isDiagramItemVisibleInViewport as Y, EditingUtils as
|
|
16
|
-
import { MainToolbar as
|
|
17
|
-
import { FloatingToolbarPopup as
|
|
18
|
-
import { toolbarPopupWrapClass as
|
|
19
|
-
import { useDiagramEditorController as Me, useRegisteredSurfaceRef as
|
|
20
|
-
import { placeholder as Z, messages as
|
|
21
|
-
const { pmDocToRTContent: Oe, rtContentToPM: Ke, schemaSpec: ze, styleEditor: Be, scheduleRafCall: ee, recalcVerticalAlign: te } =
|
|
14
|
+
import { defaultTextToolbarTools as Ce, defaultMainToolbarTools as Pe, defaultShapeToolbarTools as ke, defaultConnectionToolbarTools as De } from "./default-toolbar-tools.mjs";
|
|
15
|
+
import { getContextToolbarAnchors as X, isDiagramItemVisibleInViewport as Y, EditingUtils as Ve } from "@progress/kendo-diagram-common";
|
|
16
|
+
import { MainToolbar as Ae } from "./MainToolbar.mjs";
|
|
17
|
+
import { FloatingToolbarPopup as K } from "./FloatingToolbarPopup.mjs";
|
|
18
|
+
import { toolbarPopupWrapClass as z } from "./utils.mjs";
|
|
19
|
+
import { useDiagramEditorController as Me, useRegisteredSurfaceRef as B, DiagramEditorProvider as Ne } from "./DiagramEditorContext.mjs";
|
|
20
|
+
import { placeholder as Z, messages as Re } from "../messages/index.mjs";
|
|
21
|
+
const { pmDocToRTContent: Oe, rtContentToPM: Ke, schemaSpec: ze, styleEditor: Be, scheduleRafCall: ee, recalcVerticalAlign: te } = Ve, ne = new b.Schema(ze), Ie = Ke(b.Node, ne), { imageResizing: Fe } = oe;
|
|
22
22
|
class Le extends b.EditorView {
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class ot extends b.Node {
|
|
25
25
|
}
|
|
26
26
|
const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdownlist, .k-colorpicker', Ue = (i) => {
|
|
27
|
-
const
|
|
28
|
-
return i.childCount === 0 || !!(i.childCount === 1 && (
|
|
29
|
-
},
|
|
27
|
+
const l = i.content.firstChild;
|
|
28
|
+
return i.childCount === 0 || !!(i.childCount === 1 && (l != null && l.inlineContent) && l.childCount === 0);
|
|
29
|
+
}, $e = (i) => {
|
|
30
30
|
var U, $;
|
|
31
|
-
const { diagram:
|
|
31
|
+
const { diagram: l, toolbars: se = {} } = i, v = {
|
|
32
32
|
position: "top",
|
|
33
33
|
tools: Pe,
|
|
34
34
|
shapes: i.shapes
|
|
35
|
-
},
|
|
35
|
+
}, w = { tools: ke, shapes: i.shapes }, C = { tools: De }, P = {
|
|
36
36
|
tools: Ce,
|
|
37
37
|
fontNames: i.fontTypes,
|
|
38
38
|
fontSizes: i.fontSizes
|
|
39
39
|
}, {
|
|
40
|
-
diagram:
|
|
41
|
-
shape:
|
|
42
|
-
connection:
|
|
43
|
-
text:
|
|
44
|
-
} = se, I = typeof
|
|
40
|
+
diagram: k = v,
|
|
41
|
+
shape: D = w,
|
|
42
|
+
connection: V = C,
|
|
43
|
+
text: A = P
|
|
44
|
+
} = se, I = typeof k == "boolean" ? k ? v : { position: "top", tools: [] } : { ...v, ...k }, M = typeof D == "boolean" ? D ? w : { tools: [] } : { ...w, ...D }, N = typeof V == "boolean" ? V ? C : { tools: [] } : { ...C, ...V }, F = typeof A == "boolean" ? A ? P : { tools: [] } : { ...P, ...A }, { controller: n, snapshot: e } = Me(l), ie = B(n), re = B(n), L = B(n), _ = t.useRef(null), [p, R] = t.useState(null), T = t.useRef(null), [c, g] = t.useState(null), s = t.useRef(null), le = Se(), ae = e.editingSession ? `${e.editingSession.target.type}:${e.editingSession.target.id}` : null, ce = t.useCallback(
|
|
45
45
|
(o) => {
|
|
46
|
-
var
|
|
47
|
-
(
|
|
46
|
+
var r;
|
|
47
|
+
(r = s.current) == null || r.call(s), s.current = o && n ? n.registerSurface(o) : null;
|
|
48
48
|
},
|
|
49
49
|
[n]
|
|
50
50
|
), ue = t.useCallback(
|
|
@@ -53,21 +53,21 @@ const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdown
|
|
|
53
53
|
},
|
|
54
54
|
[L]
|
|
55
55
|
), de = t.useCallback(() => {
|
|
56
|
-
var
|
|
57
|
-
const o = (
|
|
56
|
+
var r;
|
|
57
|
+
const o = (r = _.current) == null ? void 0 : r.querySelector(_e);
|
|
58
58
|
return o ? (o.focus({ preventScroll: !0 }), !0) : !1;
|
|
59
59
|
}, []);
|
|
60
60
|
t.useEffect(() => () => {
|
|
61
61
|
var o;
|
|
62
62
|
(o = s.current) == null || o.call(s), s.current = null;
|
|
63
63
|
}, []), t.useLayoutEffect(() => {
|
|
64
|
-
var
|
|
64
|
+
var r;
|
|
65
65
|
if (!n || !e.editingSession) {
|
|
66
|
-
|
|
66
|
+
R(null), T.current = null, g(null), n == null || n.setTextEditingAdapter(null), (r = s.current) == null || r.call(s), s.current = null;
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
const o = Ie(e.editingSession.item._contentVisual.options);
|
|
70
|
-
return
|
|
70
|
+
return R(o), T.current = o, g(null), n.setTextEditingAdapter({
|
|
71
71
|
getCommitPayload: () => {
|
|
72
72
|
const u = T.current;
|
|
73
73
|
return u ? {
|
|
@@ -80,31 +80,31 @@ const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdown
|
|
|
80
80
|
n.setTextEditingAdapter(null);
|
|
81
81
|
};
|
|
82
82
|
}, [n, ae, e.editingSession]);
|
|
83
|
-
const me = e.editingSession ? e.editingSession.item._contentVisual.options : {}, d = e.selectedShape, m = e.selectedConnection, f = (U =
|
|
83
|
+
const me = e.editingSession ? e.editingSession.item._contentVisual.options : {}, d = e.selectedShape, m = e.selectedConnection, f = (U = l == null ? void 0 : l.element) != null ? U : null, E = t.useMemo(() => X(d, e.anchors.shape), [d, e.anchors.shape]), y = t.useMemo(() => X(m, e.anchors.connection), [m, e.anchors.connection]), fe = t.useMemo(() => !!(d && E.base && e.visibility.shape && M.tools.length > 0 && Y(d, f)), [
|
|
84
84
|
d,
|
|
85
85
|
E.base,
|
|
86
86
|
e.visibility.shape,
|
|
87
|
-
|
|
87
|
+
M.tools.length,
|
|
88
88
|
f
|
|
89
|
-
]), be = t.useMemo(() => !!(m && y.base && e.visibility.connection &&
|
|
89
|
+
]), be = t.useMemo(() => !!(m && y.base && e.visibility.connection && N.tools.length > 0 && Y(m, f)), [
|
|
90
90
|
m,
|
|
91
91
|
y.base,
|
|
92
92
|
e.visibility.connection,
|
|
93
|
-
|
|
93
|
+
N.tools.length,
|
|
94
94
|
f
|
|
95
95
|
]), pe = (o) => {
|
|
96
|
-
|
|
96
|
+
R(o.value), T.current = o.value, c && g({ view: c.view });
|
|
97
97
|
}, ge = (o) => {
|
|
98
98
|
var j;
|
|
99
|
-
const
|
|
100
|
-
if (!e.editingSession || !
|
|
99
|
+
const r = o.target;
|
|
100
|
+
if (!e.editingSession || !r.element || !n || !p)
|
|
101
101
|
return;
|
|
102
|
-
const u =
|
|
102
|
+
const u = r.element;
|
|
103
103
|
ce(u);
|
|
104
|
-
const { item: S } = e.editingSession, q = S.name === "Shape" ? S._contentVisual.padding() : { top: 0, bottom: 0, left: 0, right: 0 },
|
|
104
|
+
const { item: S } = e.editingSession, q = S.name === "Shape" ? S._contentVisual.padding() : { top: 0, bottom: 0, left: 0, right: 0 }, O = o.dom, W = le.toLanguageString(Z, Re[Z]);
|
|
105
105
|
let h;
|
|
106
106
|
const Te = new b.Plugin({
|
|
107
|
-
filterTransaction: (x) => (ee(te, [x.doc.attrs.alignment,
|
|
107
|
+
filterTransaction: (x) => (ee(te, [x.doc.attrs.alignment, O, q]), g({ view: h }), !0)
|
|
108
108
|
}), Ee = b.EditorState.create({
|
|
109
109
|
doc: p,
|
|
110
110
|
schema: ne,
|
|
@@ -116,7 +116,7 @@ const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdown
|
|
|
116
116
|
]
|
|
117
117
|
});
|
|
118
118
|
return h = new Le(
|
|
119
|
-
{ mount:
|
|
119
|
+
{ mount: O },
|
|
120
120
|
{
|
|
121
121
|
...o.viewProps,
|
|
122
122
|
state: Ee,
|
|
@@ -125,40 +125,40 @@ const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdown
|
|
|
125
125
|
return a.key === "Escape" ? (n.handleKeyDown(a), a.defaultPrevented || ((H = (G = o.viewProps).handleKeyDown) == null ? void 0 : H.call(G, x, a)) === !0) : a.key === "F10" && a.altKey && de() ? (a.preventDefault(), !0) : (Q = (J = o.viewProps).handleKeyDown) == null ? void 0 : Q.call(J, x, a);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
), Be(S, u, W), h.focus(), ee(te, [(j = S.options.content) == null ? void 0 : j.align,
|
|
128
|
+
), Be(S, u, W), h.focus(), ee(te, [(j = S.options.content) == null ? void 0 : j.align, O, q]), g({ view: h }), h;
|
|
129
129
|
}, he = t.useCallback(
|
|
130
130
|
(o) => {
|
|
131
131
|
o.key !== "Tab" || o.shiftKey || c && (o.preventDefault(), c.view.focus());
|
|
132
132
|
},
|
|
133
133
|
[c]
|
|
134
134
|
);
|
|
135
|
-
return n ? /* @__PURE__ */ t.createElement(
|
|
136
|
-
|
|
135
|
+
return n ? /* @__PURE__ */ t.createElement(Ne, { value: { controller: n, snapshot: e } }, /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ t.createElement(
|
|
136
|
+
Ae,
|
|
137
137
|
{
|
|
138
|
-
diagram:
|
|
138
|
+
diagram: l,
|
|
139
139
|
visible: e.visibility.main && I.tools.length > 0,
|
|
140
140
|
...I
|
|
141
141
|
}
|
|
142
142
|
), /* @__PURE__ */ t.createElement(
|
|
143
|
-
|
|
143
|
+
K,
|
|
144
144
|
{
|
|
145
145
|
show: fe,
|
|
146
146
|
baseAnchor: E.base,
|
|
147
147
|
fallbackAnchor: E.fallback,
|
|
148
148
|
boundaryElement: f
|
|
149
149
|
},
|
|
150
|
-
/* @__PURE__ */ t.createElement("div", { ref: ie, className:
|
|
150
|
+
/* @__PURE__ */ t.createElement("div", { ref: ie, className: z }, /* @__PURE__ */ t.createElement(ve, { shape: d, ...M }))
|
|
151
151
|
), /* @__PURE__ */ t.createElement(
|
|
152
|
-
|
|
152
|
+
K,
|
|
153
153
|
{
|
|
154
154
|
show: be,
|
|
155
155
|
baseAnchor: y.base,
|
|
156
156
|
fallbackAnchor: y.fallback,
|
|
157
157
|
boundaryElement: f
|
|
158
158
|
},
|
|
159
|
-
/* @__PURE__ */ t.createElement("div", { ref:
|
|
159
|
+
/* @__PURE__ */ t.createElement("div", { ref: re, className: z }, /* @__PURE__ */ t.createElement(we, { connection: m, ...N }))
|
|
160
160
|
), /* @__PURE__ */ t.createElement(
|
|
161
|
-
|
|
161
|
+
K,
|
|
162
162
|
{
|
|
163
163
|
show: !!(e.editingSession && c && p && e.anchors.textEditing && e.visibility.textEditing && F.tools.length > 0),
|
|
164
164
|
baseAnchor: e.anchors.textEditing ? { left: e.anchors.textEditing.x, top: e.anchors.textEditing.y } : null
|
|
@@ -167,7 +167,7 @@ const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdown
|
|
|
167
167
|
"div",
|
|
168
168
|
{
|
|
169
169
|
ref: ue,
|
|
170
|
-
className:
|
|
170
|
+
className: z,
|
|
171
171
|
onKeyDown: he
|
|
172
172
|
},
|
|
173
173
|
/* @__PURE__ */ t.createElement(
|
|
@@ -192,6 +192,7 @@ const _e = '[tabindex]:not([tabindex="-1"]), button:not([disabled]), .k-dropdown
|
|
|
192
192
|
}
|
|
193
193
|
))) : null;
|
|
194
194
|
};
|
|
195
|
+
$e.displayName = "KendoDiagramEditor";
|
|
195
196
|
export {
|
|
196
|
-
|
|
197
|
+
$e as DiagramEditor
|
|
197
198
|
};
|
|
@@ -17,5 +17,5 @@ interface MainToolbarProps extends MainToolbarOptions {
|
|
|
17
17
|
visible?: boolean;
|
|
18
18
|
}
|
|
19
19
|
/** @hidden */
|
|
20
|
-
export declare const MainToolbar: (props: MainToolbarProps) => React.
|
|
20
|
+
export declare const MainToolbar: (props: MainToolbarProps) => React.JSX.Element | null;
|
|
21
21
|
export {};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),a=require("@progress/kendo-react-buttons"),y=require("@progress/kendo-react-popup"),E=require("@progress/kendo-diagram-common"),g=require("@progress/kendo-svg-icons"),w=require("@progress/kendo-react-intl"),e=require("../messages/index.js"),O=require("./shapes-dropdown.js"),m=require("./utils.js"),f=require("./DiagramEditorContext.js");function L(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return t.default=n,Object.freeze(t)}const i=L(B),{floatingToolbarStyle:S}=E.EditingUtils.Data,v=2,z=10,j={zIndex:1},U={type:"fade",openDuration:140,closeDuration:140},A=n=>{const{diagram:t,tools:s,position:r="top",shapes:h,visible:T=!0}=n,{controller:p,snapshot:P}=f.useDiagramEditorContext(),I=f.useRegisteredSurfaceRef(p),x=f.useDiagramEditorPopupProps("main-toolbar"),l=P.activeTool,C=!!(t&&t.canUndo()),M=!!(t&&t.canRedo()),c=w.useLocalization();i.useEffect(()=>{if(!t)return;const{element:o}=t,u=o.ownerDocument.defaultView;if(!u||u.getComputedStyle(o).position!=="static")return;const q=o.style.position;return o.style.position="relative",()=>{o.style.position=q}},[t]);const d=i.useCallback(o=>{p.dispatch({type:"setActiveTool",tool:o})},[p]),k=o=>{d({type:"insert-shape",shape:o})},R={undo:{component:a.Button,props:{svgIcon:g.undoIcon,fillMode:"flat",onClick:()=>p.execute({type:"undo"}),disabled:!C,title:c.toLanguageString(e.editingUndo,e.messages[e.editingUndo])}},redo:{component:a.Button,props:{svgIcon:g.redoIcon,fillMode:"flat",onClick:()=>p.execute({type:"redo"}),disabled:!M,title:c.toLanguageString(e.editingRedo,e.messages[e.editingRedo])}},select:{component:a.Button,props:{svgIcon:g.pointerIcon,fillMode:"flat",onClick:()=>d({type:"select"}),togglable:!0,selected:l.type==="select",title:c.toLanguageString(e.editingSelect,e.messages[e.editingSelect])}},pan:{component:a.Button,props:{svgIcon:g.handIcon,fillMode:"flat",onClick:()=>d({type:"pan"}),togglable:!0,selected:l.type==="pan",title:c.toLanguageString(e.editingPan,e.messages[e.editingPan])}},text:{component:a.Button,props:{svgIcon:g.freeTextIcon,fillMode:"flat",onClick:()=>d({type:"insert-text"}),togglable:!0,selected:l.type==="insert-text",title:c.toLanguageString(e.editingText,e.messages[e.editingText])}},shape:{component:O.ShapeSelector,props:{onSelect:k,value:l.type==="insert-shape"?l.shape:null,active:l.type==="insert-shape",buttonTitle:c.toLanguageString(e.editingShape,e.messages[e.editingShape]),shapes:h,popupClass:m.mainToolbarPopupClass,overlayOwner:"main-toolbar"}},separator:{component:a.ToolbarSeparator,props:{}}},D=i.useMemo(()=>{const o={horizontal:0,vertical:r==="top"?v:v+z},u={vertical:r,horizontal:"center"};return{anchorAlign:u,popupAlign:{...u},margin:o}},[r]),b=m.mapTools(s,R);return!t||b.length===0?null:i.createElement(y.Popup,{appendTo:t.element,show:T,animate:U,style:j,anchor:t.element,...D},i.createElement("div",{ref:I,style:S},i.createElement(y.PopupPropsContext.Provider,{value:x},i.createElement(a.Toolbar,{fillMode:"flat",style:S,buttons:m.floatingToolbarButtons},b))))};exports.MainToolbar=A;
|
|
@@ -5,139 +5,123 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { PopupPropsContext as N } from "@progress/kendo-react-popup";
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { Toolbar as z, ToolbarSeparator as A, Button as s } from "@progress/kendo-react-buttons";
|
|
10
|
+
import { Popup as B, PopupPropsContext as U } from "@progress/kendo-react-popup";
|
|
12
11
|
import { EditingUtils as O } from "@progress/kendo-diagram-common";
|
|
13
|
-
import { freeTextIcon as W, handIcon as
|
|
12
|
+
import { freeTextIcon as W, handIcon as V, pointerIcon as j, redoIcon as q, undoIcon as F } from "@progress/kendo-svg-icons";
|
|
14
13
|
import { useLocalization as G } from "@progress/kendo-react-intl";
|
|
15
|
-
import { editingShape as
|
|
14
|
+
import { editingShape as g, messages as i, editingText as m, editingPan as d, editingSelect as f, editingRedo as y, editingUndo as b } from "../messages/index.mjs";
|
|
16
15
|
import { ShapeSelector as H } from "./shapes-dropdown.mjs";
|
|
17
|
-
import { mapTools as J, floatingToolbarButtons as K, mainToolbarPopupClass as
|
|
18
|
-
import { useDiagramEditorContext as
|
|
19
|
-
const { floatingToolbarStyle: h } = O.Data,
|
|
20
|
-
const { diagram: t, tools:
|
|
21
|
-
|
|
16
|
+
import { mapTools as J, floatingToolbarButtons as K, mainToolbarPopupClass as N } from "./utils.mjs";
|
|
17
|
+
import { useDiagramEditorContext as Q, useRegisteredSurfaceRef as X, useDiagramEditorPopupProps as Y } from "./DiagramEditorContext.mjs";
|
|
18
|
+
const { floatingToolbarStyle: h } = O.Data, v = 2, Z = 10, _ = { zIndex: 1 }, $ = { type: "fade", openDuration: 140, closeDuration: 140 }, po = (S) => {
|
|
19
|
+
const { diagram: t, tools: T, position: c = "top", shapes: I, visible: P = !0 } = S, { controller: r, snapshot: x } = Q(), C = X(r), M = Y("main-toolbar"), n = x.activeTool, E = !!(t && t.canUndo()), L = !!(t && t.canRedo()), a = G();
|
|
20
|
+
e.useEffect(() => {
|
|
22
21
|
if (!t)
|
|
23
22
|
return;
|
|
24
|
-
const { element: o } = t,
|
|
25
|
-
if (!
|
|
23
|
+
const { element: o } = t, l = o.ownerDocument.defaultView;
|
|
24
|
+
if (!l || l.getComputedStyle(o).position !== "static")
|
|
26
25
|
return;
|
|
27
26
|
const D = o.style.position;
|
|
28
27
|
return o.style.position = "relative", () => {
|
|
29
28
|
o.style.position = D;
|
|
30
29
|
};
|
|
31
30
|
}, [t]);
|
|
32
|
-
const p =
|
|
31
|
+
const p = e.useCallback(
|
|
33
32
|
(o) => {
|
|
34
|
-
|
|
33
|
+
r.dispatch({ type: "setActiveTool", tool: o });
|
|
35
34
|
},
|
|
36
|
-
[
|
|
37
|
-
),
|
|
35
|
+
[r]
|
|
36
|
+
), R = (o) => {
|
|
38
37
|
p({ type: "insert-shape", shape: o });
|
|
39
|
-
},
|
|
38
|
+
}, k = {
|
|
40
39
|
undo: {
|
|
41
|
-
component:
|
|
40
|
+
component: s,
|
|
42
41
|
props: {
|
|
43
42
|
svgIcon: F,
|
|
44
43
|
fillMode: "flat",
|
|
45
|
-
onClick: () =>
|
|
46
|
-
disabled: !
|
|
47
|
-
title:
|
|
44
|
+
onClick: () => r.execute({ type: "undo" }),
|
|
45
|
+
disabled: !E,
|
|
46
|
+
title: a.toLanguageString(b, i[b])
|
|
48
47
|
}
|
|
49
48
|
},
|
|
50
49
|
redo: {
|
|
51
|
-
component:
|
|
50
|
+
component: s,
|
|
52
51
|
props: {
|
|
53
52
|
svgIcon: q,
|
|
54
53
|
fillMode: "flat",
|
|
55
|
-
onClick: () =>
|
|
54
|
+
onClick: () => r.execute({ type: "redo" }),
|
|
56
55
|
disabled: !L,
|
|
57
|
-
title:
|
|
56
|
+
title: a.toLanguageString(y, i[y])
|
|
58
57
|
}
|
|
59
58
|
},
|
|
60
59
|
select: {
|
|
61
|
-
component:
|
|
60
|
+
component: s,
|
|
62
61
|
props: {
|
|
63
|
-
svgIcon:
|
|
62
|
+
svgIcon: j,
|
|
64
63
|
fillMode: "flat",
|
|
65
64
|
onClick: () => p({ type: "select" }),
|
|
66
65
|
togglable: !0,
|
|
67
66
|
selected: n.type === "select",
|
|
68
|
-
title:
|
|
67
|
+
title: a.toLanguageString(f, i[f])
|
|
69
68
|
}
|
|
70
69
|
},
|
|
71
70
|
pan: {
|
|
72
|
-
component:
|
|
71
|
+
component: s,
|
|
73
72
|
props: {
|
|
74
|
-
svgIcon:
|
|
73
|
+
svgIcon: V,
|
|
75
74
|
fillMode: "flat",
|
|
76
75
|
onClick: () => p({ type: "pan" }),
|
|
77
76
|
togglable: !0,
|
|
78
77
|
selected: n.type === "pan",
|
|
79
|
-
title:
|
|
78
|
+
title: a.toLanguageString(d, i[d])
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
text: {
|
|
83
|
-
component:
|
|
82
|
+
component: s,
|
|
84
83
|
props: {
|
|
85
84
|
svgIcon: W,
|
|
86
85
|
fillMode: "flat",
|
|
87
86
|
onClick: () => p({ type: "insert-text" }),
|
|
88
87
|
togglable: !0,
|
|
89
88
|
selected: n.type === "insert-text",
|
|
90
|
-
title:
|
|
89
|
+
title: a.toLanguageString(m, i[m])
|
|
91
90
|
}
|
|
92
91
|
},
|
|
93
92
|
shape: {
|
|
94
93
|
component: H,
|
|
95
94
|
props: {
|
|
96
|
-
onSelect:
|
|
95
|
+
onSelect: R,
|
|
97
96
|
value: n.type === "insert-shape" ? n.shape : null,
|
|
98
97
|
active: n.type === "insert-shape",
|
|
99
|
-
buttonTitle:
|
|
100
|
-
shapes:
|
|
101
|
-
popupClass:
|
|
98
|
+
buttonTitle: a.toLanguageString(g, i[g]),
|
|
99
|
+
shapes: I,
|
|
100
|
+
popupClass: N,
|
|
102
101
|
overlayOwner: "main-toolbar"
|
|
103
102
|
}
|
|
104
103
|
},
|
|
105
104
|
separator: { component: A, props: {} }
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
...h
|
|
125
|
-
};
|
|
126
|
-
return U(
|
|
127
|
-
/* @__PURE__ */ a.createElement("div", { style: w, className: "k-animation-container k-animation-container-shown" }, /* @__PURE__ */ a.createElement(
|
|
128
|
-
"div",
|
|
129
|
-
{
|
|
130
|
-
ref: E,
|
|
131
|
-
className: "k-popup k-diagram-top-toolbar-container",
|
|
132
|
-
style: B,
|
|
133
|
-
onPointerEnter: () => e.handlePointerEnter(),
|
|
134
|
-
onPointerLeave: () => e.handlePointerLeave()
|
|
135
|
-
},
|
|
136
|
-
/* @__PURE__ */ a.createElement(N.Provider, { value: I }, /* @__PURE__ */ a.createElement(z, { fillMode: "flat", style: h, buttons: K }, m))
|
|
137
|
-
)),
|
|
138
|
-
t.element
|
|
105
|
+
}, w = e.useMemo(() => {
|
|
106
|
+
const o = {
|
|
107
|
+
horizontal: 0,
|
|
108
|
+
vertical: c === "top" ? v : v + Z
|
|
109
|
+
}, l = { vertical: c, horizontal: "center" };
|
|
110
|
+
return { anchorAlign: l, popupAlign: { ...l }, margin: o };
|
|
111
|
+
}, [c]), u = J(T, k);
|
|
112
|
+
return !t || u.length === 0 ? null : /* @__PURE__ */ e.createElement(
|
|
113
|
+
B,
|
|
114
|
+
{
|
|
115
|
+
appendTo: t.element,
|
|
116
|
+
show: P,
|
|
117
|
+
animate: $,
|
|
118
|
+
style: _,
|
|
119
|
+
anchor: t.element,
|
|
120
|
+
...w
|
|
121
|
+
},
|
|
122
|
+
/* @__PURE__ */ e.createElement("div", { ref: C, style: h }, /* @__PURE__ */ e.createElement(U.Provider, { value: M }, /* @__PURE__ */ e.createElement(z, { fillMode: "flat", style: h, buttons: K }, u)))
|
|
139
123
|
);
|
|
140
124
|
};
|
|
141
125
|
export {
|
|
142
|
-
|
|
126
|
+
po as MainToolbar
|
|
143
127
|
};
|
|
@@ -10,5 +10,5 @@ export type { ToolbarTools, FontTypeItem, FontSizeItem, ConnectionToolbarOptions
|
|
|
10
10
|
/**
|
|
11
11
|
* The props of the `DiagramEditor` component.
|
|
12
12
|
*/
|
|
13
|
-
export interface DiagramEditorProps extends DiagramEditorOptions {
|
|
13
|
+
export interface DiagramEditorProps extends Omit<DiagramEditorOptions, 'diagram'> {
|
|
14
14
|
}
|
package/utils/consts.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
import { ShapeRichTextContent, ConnectionRichTextContent } from '@progress/kendo-diagram-common';
|
|
8
9
|
import { DiagramNavigationOptions, DiagramDataItem } from '../interfaces/index.js';
|
|
9
10
|
import { ConnectionOptions } from '../interfaces/ConnectionTypes';
|
|
10
11
|
import { ShapeOptions } from '../interfaces/ShapeTypes';
|
|
@@ -35,3 +36,7 @@ export declare const diagramDefaultProps: {
|
|
|
35
36
|
zoomRate: number;
|
|
36
37
|
role: string;
|
|
37
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* The default content style for shapes and connections in the diagram for text editing.
|
|
41
|
+
*/
|
|
42
|
+
export declare const diagramEditingContentDefaults: ShapeRichTextContent | ConnectionRichTextContent;
|
package/utils/consts.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={enabled:!0,smallStep:1,largeStep:5},a={connections:[],shapes:[],editable:!0,pannable:{enabled:!0,showScrollbars:!0,autoHideScrollbars:!0},selectable:!0,zoom:1,zoomMax:2,zoomMin:.1,zoomRate:.1,role:"application"};exports.DEFAULT_NAVIGABLE_OPTIONS=
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-diagram-common"),t={enabled:!0,smallStep:1,largeStep:5},a={connections:[],shapes:[],editable:!0,pannable:{enabled:!0,showScrollbars:!0,autoHideScrollbars:!0},selectable:!0,zoom:1,zoomMax:2,zoomMin:.1,zoomRate:.1,role:"application"},o={fontSize:16,fontFamily:e.EditingUtils.Data.fontNames[0].value};exports.DEFAULT_NAVIGABLE_OPTIONS=t;exports.diagramDefaultProps=a;exports.diagramEditingContentDefaults=o;
|
package/utils/consts.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
import { EditingUtils as e } from "@progress/kendo-diagram-common";
|
|
9
|
+
const a = { enabled: !0, smallStep: 1, largeStep: 5 }, o = {
|
|
9
10
|
connections: [],
|
|
10
11
|
shapes: [],
|
|
11
12
|
editable: !0,
|
|
@@ -20,8 +21,12 @@ const e = { enabled: !0, smallStep: 1, largeStep: 5 }, o = {
|
|
|
20
21
|
zoomMin: 0.1,
|
|
21
22
|
zoomRate: 0.1,
|
|
22
23
|
role: "application"
|
|
24
|
+
}, l = {
|
|
25
|
+
fontSize: 16,
|
|
26
|
+
fontFamily: e.Data.fontNames[0].value
|
|
23
27
|
};
|
|
24
28
|
export {
|
|
25
|
-
|
|
26
|
-
o as diagramDefaultProps
|
|
29
|
+
a as DEFAULT_NAVIGABLE_OPTIONS,
|
|
30
|
+
o as diagramDefaultProps,
|
|
31
|
+
l as diagramEditingContentDefaults
|
|
27
32
|
};
|