@pie-lib/plot 4.0.4-next.31 → 4.0.4-next.33
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/dist/draggable.d.ts +8 -3
- package/dist/draggable.js +4 -11
- package/dist/grid-draggable.d.ts +7 -0
- package/dist/grid-draggable.js +9 -5
- package/dist/index.js +1 -1
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +1 -1
- package/dist/node_modules/.bun/{react-draggable@4.6.0_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-D5BXCJ5G.js → react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.js} +69 -63
- package/dist/node_modules/.bun/react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/cjs.js +5 -0
- package/dist/root.js +4 -4
- package/dist/trig.js +1 -1
- package/dist/types.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +10 -5
- package/dist/node_modules/.bun/react-draggable@4.6.0_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/cjs.js +0 -5
package/dist/draggable.d.ts
CHANGED
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
8
|
*/
|
|
9
9
|
import Draggable, { DraggableCore } from 'react-draggable';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* This used to subclass Draggable to zero its internal x/y drag offset on every prop
|
|
12
|
+
* change. react-draggable v4 moved that position sync to a static getDerivedStateFromProps,
|
|
13
|
+
* which React prefers over the legacy componentWillReceiveProps, so the override stopped
|
|
14
|
+
* running. Nothing imports this Draggable - the drag handles all go through
|
|
15
|
+
* gridDraggable/DraggableCore - so it is re-exported unchanged rather than reworked.
|
|
16
|
+
*/
|
|
17
|
+
export default Draggable;
|
|
13
18
|
export { DraggableCore };
|
package/dist/draggable.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import "./node_modules/.bun/react-draggable@4.
|
|
2
|
-
import
|
|
1
|
+
import { DraggableCore as e } from "./node_modules/.bun/react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.js";
|
|
2
|
+
import t from "./node_modules/.bun/react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/cjs.js";
|
|
3
3
|
//#region src/draggable.tsx
|
|
4
|
-
var
|
|
5
|
-
componentWillReceiveProps(e) {
|
|
6
|
-
super.componentWillReceiveProps(e), this.setState({
|
|
7
|
-
x: 0,
|
|
8
|
-
y: 0
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
};
|
|
4
|
+
var n = t;
|
|
12
5
|
//#endregion
|
|
13
|
-
export {
|
|
6
|
+
export { e as DraggableCore, n as default };
|
package/dist/grid-draggable.d.ts
CHANGED
|
@@ -32,6 +32,13 @@ export declare const gridDraggable: (opts: any) => (Comp: any) => {
|
|
|
32
32
|
onDrag: any;
|
|
33
33
|
getDelta: any;
|
|
34
34
|
applyDelta: any;
|
|
35
|
+
/**
|
|
36
|
+
* Must not return false. react-draggable v4 treats a false return as "keep dragging"
|
|
37
|
+
* and bails out of handleDragStop before it detaches the document mousemove/mouseup
|
|
38
|
+
* listeners, so the handle would keep following the pointer after release - and every
|
|
39
|
+
* previously dragged handle would move along with the next one. (v3 ignored the
|
|
40
|
+
* return value and always detached, which is why returning false used to look inert.)
|
|
41
|
+
*/
|
|
35
42
|
onStop: any;
|
|
36
43
|
render(): React.JSX.Element;
|
|
37
44
|
context: unknown;
|
package/dist/grid-draggable.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __toESM as e } from "./_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { GraphPropsType as t } from "./types.js";
|
|
3
3
|
import { require_browser as n } from "./node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js";
|
|
4
4
|
import { getDelta as r } from "./utils.js";
|
|
5
|
-
import { DraggableCore as i } from "./node_modules/.bun/react-draggable@4.
|
|
5
|
+
import { DraggableCore as i } from "./node_modules/.bun/react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.js";
|
|
6
6
|
import a from "react";
|
|
7
7
|
import o from "prop-types";
|
|
8
8
|
import { pointer as s } from "d3-selection";
|
|
@@ -139,12 +139,16 @@ var d = /* @__PURE__ */ e(n(), 1), f = u("pie-lib:plot:grid-draggable"), p = (e,
|
|
|
139
139
|
r({});
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
this.setState({
|
|
143
|
+
startX: null,
|
|
144
|
+
startY: null
|
|
145
|
+
});
|
|
146
|
+
return;
|
|
143
147
|
}
|
|
144
|
-
|
|
148
|
+
this.setState({
|
|
145
149
|
startX: null,
|
|
146
150
|
startY: null
|
|
147
|
-
})
|
|
151
|
+
});
|
|
148
152
|
};
|
|
149
153
|
render() {
|
|
150
154
|
let { disabled: t, onClick: r, ...a } = this.props, o = this.grid(), s = (e) => e.nativeEvent.preventDefault(), l = this.state ? !!this.state.startX : !1;
|
|
@@ -165,4 +169,4 @@ var d = /* @__PURE__ */ e(n(), 1), f = u("pie-lib:plot:grid-draggable"), p = (e,
|
|
|
165
169
|
}
|
|
166
170
|
});
|
|
167
171
|
//#endregion
|
|
168
|
-
export { m as gridDraggable };
|
|
172
|
+
export { p as deltaFn, m as gridDraggable };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types_exports as e } from "./types.js";
|
|
2
2
|
import { utils_exports as t } from "./utils.js";
|
|
3
|
-
import n from "./root.js";
|
|
3
|
+
import { Root as n } from "./root.js";
|
|
4
4
|
import r from "./draggable.js";
|
|
5
5
|
import { gridDraggable as i } from "./grid-draggable.js";
|
|
6
6
|
import { trig_exports as a } from "./trig.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "../../../../../clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
1
|
+
import { clsx as e } from "../../../../../clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import n from "prop-types";
|
|
4
4
|
import r from "react-dom";
|
|
5
|
-
//#region ../../../node_modules/.bun/react-draggable@4.
|
|
5
|
+
//#region ../../../node_modules/.bun/react-draggable@4.7.1+6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.mjs
|
|
6
6
|
function i(e, t) {
|
|
7
7
|
for (let n = 0, r = e.length; n < r; n++) if (t.apply(t, [
|
|
8
8
|
e[n],
|
|
@@ -126,19 +126,27 @@ function O(e) {
|
|
|
126
126
|
if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
|
|
127
127
|
if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
|
|
128
128
|
}
|
|
129
|
-
function k(
|
|
129
|
+
function k() {
|
|
130
|
+
return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0;
|
|
131
|
+
}
|
|
132
|
+
function A(e, t) {
|
|
130
133
|
if (!e) return;
|
|
131
|
-
let
|
|
132
|
-
|
|
134
|
+
let n = e.getElementById("react-draggable-style-el");
|
|
135
|
+
if (!n) {
|
|
136
|
+
n = e.createElement("style"), n.type = "text/css", n.id = "react-draggable-style-el";
|
|
137
|
+
let r = t ?? k();
|
|
138
|
+
r && n.setAttribute("nonce", r), n.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n", n.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n", e.getElementsByTagName("head")[0].appendChild(n);
|
|
139
|
+
}
|
|
140
|
+
e.body && N(e.body, "react-draggable-transparent-selection");
|
|
133
141
|
}
|
|
134
|
-
function
|
|
142
|
+
function j(e) {
|
|
135
143
|
window.requestAnimationFrame ? window.requestAnimationFrame(() => {
|
|
136
|
-
|
|
137
|
-
}) :
|
|
144
|
+
M(e);
|
|
145
|
+
}) : M(e);
|
|
138
146
|
}
|
|
139
|
-
function
|
|
147
|
+
function M(e) {
|
|
140
148
|
if (e) try {
|
|
141
|
-
e.body &&
|
|
149
|
+
e.body && P(e.body, "react-draggable-transparent-selection");
|
|
142
150
|
let t = e.selection;
|
|
143
151
|
if (t) t.empty();
|
|
144
152
|
else {
|
|
@@ -147,17 +155,17 @@ function j(e) {
|
|
|
147
155
|
}
|
|
148
156
|
} catch {}
|
|
149
157
|
}
|
|
150
|
-
function
|
|
158
|
+
function N(e, t) {
|
|
151
159
|
e.classList ? e.classList.add(t) : e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`)) || (e.className += ` ${t}`);
|
|
152
160
|
}
|
|
153
|
-
function
|
|
161
|
+
function P(e, t) {
|
|
154
162
|
e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`, "g"), "");
|
|
155
163
|
}
|
|
156
|
-
function
|
|
164
|
+
function F(e, t, n) {
|
|
157
165
|
if (!e.props.bounds) return [t, n];
|
|
158
166
|
let { bounds: r } = e.props;
|
|
159
|
-
r = typeof r == "string" ? r :
|
|
160
|
-
let i =
|
|
167
|
+
r = typeof r == "string" ? r : H(r);
|
|
168
|
+
let i = U(e);
|
|
161
169
|
if (typeof r == "string") {
|
|
162
170
|
let { ownerDocument: e } = i, t = e.defaultView;
|
|
163
171
|
if (!t) throw Error("Cannot resolve the owner window of the draggable node.");
|
|
@@ -173,23 +181,23 @@ function P(e, t, n) {
|
|
|
173
181
|
}
|
|
174
182
|
return o(r.right) && (t = Math.min(t, r.right)), o(r.bottom) && (n = Math.min(n, r.bottom)), o(r.left) && (t = Math.max(t, r.left)), o(r.top) && (n = Math.max(n, r.top)), [t, n];
|
|
175
183
|
}
|
|
176
|
-
function
|
|
184
|
+
function I(e, t, n) {
|
|
177
185
|
return [Math.round(t / e[0]) * e[0], Math.round(n / e[1]) * e[1]];
|
|
178
186
|
}
|
|
179
|
-
function
|
|
187
|
+
function L(e) {
|
|
180
188
|
return e.props.axis === "both" || e.props.axis === "x";
|
|
181
189
|
}
|
|
182
|
-
function
|
|
190
|
+
function R(e) {
|
|
183
191
|
return e.props.axis === "both" || e.props.axis === "y";
|
|
184
192
|
}
|
|
185
|
-
function
|
|
193
|
+
function z(e, t, n) {
|
|
186
194
|
let r = typeof t == "number" ? D(e, t) : null;
|
|
187
195
|
if (typeof t == "number" && !r) return null;
|
|
188
|
-
let i =
|
|
196
|
+
let i = U(n), a = n.props.offsetParent || i.offsetParent || i.ownerDocument.body;
|
|
189
197
|
return C(r || e, a, n.props.scale);
|
|
190
198
|
}
|
|
191
|
-
function
|
|
192
|
-
let r = !o(e.lastX), i =
|
|
199
|
+
function B(e, t, n) {
|
|
200
|
+
let r = !o(e.lastX), i = U(e);
|
|
193
201
|
return r ? {
|
|
194
202
|
node: i,
|
|
195
203
|
deltaX: 0,
|
|
@@ -208,7 +216,7 @@ function z(e, t, n) {
|
|
|
208
216
|
y: n
|
|
209
217
|
};
|
|
210
218
|
}
|
|
211
|
-
function
|
|
219
|
+
function V(e, t) {
|
|
212
220
|
let n = e.props.scale;
|
|
213
221
|
return {
|
|
214
222
|
node: t.node,
|
|
@@ -220,7 +228,7 @@ function B(e, t) {
|
|
|
220
228
|
lastY: e.state.y
|
|
221
229
|
};
|
|
222
230
|
}
|
|
223
|
-
function
|
|
231
|
+
function H(e) {
|
|
224
232
|
return {
|
|
225
233
|
left: e.left,
|
|
226
234
|
top: e.top,
|
|
@@ -228,15 +236,12 @@ function V(e) {
|
|
|
228
236
|
bottom: e.bottom
|
|
229
237
|
};
|
|
230
238
|
}
|
|
231
|
-
function
|
|
239
|
+
function U(e) {
|
|
232
240
|
let t = e.findDOMNode();
|
|
233
241
|
if (!t) throw Error("<DraggableCore>: Unmounted during event!");
|
|
234
242
|
return t;
|
|
235
243
|
}
|
|
236
|
-
|
|
237
|
-
process.env.DRAGGABLE_DEBUG && console.log(...e);
|
|
238
|
-
}
|
|
239
|
-
var W = {
|
|
244
|
+
var W = typeof process < "u" && process.env.DRAGGABLE_DEBUG ? console.log.bind(console) : function() {}, G = {
|
|
240
245
|
touch: {
|
|
241
246
|
start: "touchstart",
|
|
242
247
|
move: "touchmove",
|
|
@@ -247,7 +252,7 @@ var W = {
|
|
|
247
252
|
move: "mousemove",
|
|
248
253
|
stop: "mouseup"
|
|
249
254
|
}
|
|
250
|
-
},
|
|
255
|
+
}, K = G.mouse, q = class extends t.Component {
|
|
251
256
|
constructor() {
|
|
252
257
|
super(...arguments), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, this.touchIdentifier = null, this.mounted = !1, this.handleDragStart = (e) => {
|
|
253
258
|
if (this.props.onMouseDown(e), !this.props.allowAnyClick && (typeof e.button == "number" && e.button !== 0 || e.ctrlKey)) return !1;
|
|
@@ -258,21 +263,21 @@ var W = {
|
|
|
258
263
|
e.type === "touchstart" && !this.props.allowMobileScroll && e.preventDefault();
|
|
259
264
|
let r = O(e);
|
|
260
265
|
this.touchIdentifier = r;
|
|
261
|
-
let i =
|
|
266
|
+
let i = z(e, r, this);
|
|
262
267
|
if (i == null) return;
|
|
263
|
-
let { x: a, y: o } = i, s =
|
|
264
|
-
|
|
268
|
+
let { x: a, y: o } = i, s = B(this, a, o);
|
|
269
|
+
W("DraggableCore: handleDragStart: %j", s), W("calling", this.props.onStart), !(this.props.onStart(e, s) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && A(n, this.props.nonce), this.dragging = !0, this.lastX = a, this.lastY = o, _(n, K.move, this.handleDrag), _(n, K.stop, this.handleDragStop));
|
|
265
270
|
}, this.handleDrag = (e) => {
|
|
266
|
-
let t =
|
|
271
|
+
let t = z(e, this.touchIdentifier, this);
|
|
267
272
|
if (t == null) return;
|
|
268
273
|
let { x: n, y: r } = t;
|
|
269
274
|
if (Array.isArray(this.props.grid)) {
|
|
270
275
|
let e = n - this.lastX, t = r - this.lastY;
|
|
271
|
-
if ([e, t] =
|
|
276
|
+
if ([e, t] = I(this.props.grid, e, t), !e && !t) return;
|
|
272
277
|
n = this.lastX + e, r = this.lastY + t;
|
|
273
278
|
}
|
|
274
|
-
let i =
|
|
275
|
-
if (
|
|
279
|
+
let i = B(this, n, r);
|
|
280
|
+
if (W("DraggableCore: handleDrag: %j", i), this.props.onDrag(e, i) === !1 || this.mounted === !1) {
|
|
276
281
|
try {
|
|
277
282
|
this.handleDragStop(new MouseEvent("mouseup"));
|
|
278
283
|
} catch {
|
|
@@ -284,36 +289,36 @@ var W = {
|
|
|
284
289
|
this.lastX = n, this.lastY = r;
|
|
285
290
|
}, this.handleDragStop = (e) => {
|
|
286
291
|
if (!this.dragging) return;
|
|
287
|
-
let t =
|
|
292
|
+
let t = z(e, this.touchIdentifier, this);
|
|
288
293
|
if (t == null) return;
|
|
289
294
|
let { x: n, y: r } = t;
|
|
290
295
|
if (Array.isArray(this.props.grid)) {
|
|
291
296
|
let e = n - this.lastX || 0, t = r - this.lastY || 0;
|
|
292
|
-
[e, t] =
|
|
297
|
+
[e, t] = I(this.props.grid, e, t), n = this.lastX + e, r = this.lastY + t;
|
|
293
298
|
}
|
|
294
|
-
let i =
|
|
299
|
+
let i = B(this, n, r);
|
|
295
300
|
if (this.props.onStop(e, i) === !1 || this.mounted === !1) return !1;
|
|
296
301
|
let a = this.findDOMNode();
|
|
297
|
-
a && this.props.enableUserSelectHack &&
|
|
298
|
-
}, this.onMouseDown = (e) => (
|
|
302
|
+
a && this.props.enableUserSelectHack && j(a.ownerDocument), W("DraggableCore: handleDragStop: %j", i), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, a && (W("DraggableCore: Removing handlers"), v(a.ownerDocument, K.move, this.handleDrag), v(a.ownerDocument, K.stop, this.handleDragStop));
|
|
303
|
+
}, this.onMouseDown = (e) => (K = G.mouse, this.handleDragStart(e)), this.onMouseUp = (e) => (K = G.mouse, this.handleDragStop(e)), this.onTouchStart = (e) => (K = G.touch, this.handleDragStart(e)), this.onTouchEnd = (e) => (K = G.touch, this.handleDragStop(e));
|
|
299
304
|
}
|
|
300
305
|
componentDidMount() {
|
|
301
306
|
this.mounted = !0;
|
|
302
307
|
let e = this.findDOMNode();
|
|
303
|
-
e && _(e,
|
|
308
|
+
e && _(e, G.touch.start, this.onTouchStart, { passive: !1 });
|
|
304
309
|
}
|
|
305
310
|
componentWillUnmount() {
|
|
306
311
|
this.mounted = !1;
|
|
307
312
|
let e = this.findDOMNode();
|
|
308
313
|
if (e) {
|
|
309
314
|
let { ownerDocument: t } = e;
|
|
310
|
-
v(t,
|
|
315
|
+
v(t, G.mouse.move, this.handleDrag), v(t, G.touch.move, this.handleDrag), v(t, G.mouse.stop, this.handleDragStop), v(t, G.touch.stop, this.handleDragStop), v(e, G.touch.start, this.onTouchStart, { passive: !1 }), this.props.enableUserSelectHack && j(t);
|
|
311
316
|
}
|
|
312
317
|
}
|
|
313
318
|
findDOMNode() {
|
|
314
319
|
if (this.props?.nodeRef) return this.props.nodeRef.current;
|
|
315
320
|
let e = r;
|
|
316
|
-
return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : (
|
|
321
|
+
return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : (W("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"), null);
|
|
317
322
|
}
|
|
318
323
|
render() {
|
|
319
324
|
return t.cloneElement(t.Children.only(this.props.children), {
|
|
@@ -323,7 +328,7 @@ var W = {
|
|
|
323
328
|
});
|
|
324
329
|
}
|
|
325
330
|
};
|
|
326
|
-
|
|
331
|
+
q.displayName = "DraggableCore", q.propTypes = {
|
|
327
332
|
allowAnyClick: n.bool,
|
|
328
333
|
allowMobileScroll: n.bool,
|
|
329
334
|
children: n.node.isRequired,
|
|
@@ -336,6 +341,7 @@ K.displayName = "DraggableCore", K.propTypes = {
|
|
|
336
341
|
handle: n.string,
|
|
337
342
|
cancel: n.string,
|
|
338
343
|
nodeRef: n.object,
|
|
344
|
+
nonce: n.string,
|
|
339
345
|
onStart: n.func,
|
|
340
346
|
onDrag: n.func,
|
|
341
347
|
onStop: n.func,
|
|
@@ -344,7 +350,7 @@ K.displayName = "DraggableCore", K.propTypes = {
|
|
|
344
350
|
className: c,
|
|
345
351
|
style: c,
|
|
346
352
|
transform: c
|
|
347
|
-
},
|
|
353
|
+
}, q.defaultProps = {
|
|
348
354
|
allowAnyClick: !1,
|
|
349
355
|
allowMobileScroll: !1,
|
|
350
356
|
disabled: !1,
|
|
@@ -355,18 +361,18 @@ K.displayName = "DraggableCore", K.propTypes = {
|
|
|
355
361
|
onMouseDown: function() {},
|
|
356
362
|
scale: 1
|
|
357
363
|
};
|
|
358
|
-
var
|
|
364
|
+
var J = class extends t.Component {
|
|
359
365
|
constructor(e) {
|
|
360
366
|
super(e), this.onDragStart = (e, t) => {
|
|
361
|
-
if (
|
|
367
|
+
if (W("Draggable: onDragStart: %j", t), this.props.onStart(e, V(this, t)) === !1) return !1;
|
|
362
368
|
this.setState({
|
|
363
369
|
dragging: !0,
|
|
364
370
|
dragged: !0
|
|
365
371
|
});
|
|
366
372
|
}, this.onDrag = (e, t) => {
|
|
367
373
|
if (!this.state.dragging) return !1;
|
|
368
|
-
|
|
369
|
-
let n =
|
|
374
|
+
W("Draggable: onDrag: %j", t);
|
|
375
|
+
let n = V(this, t), r = {
|
|
370
376
|
x: n.x,
|
|
371
377
|
y: n.y,
|
|
372
378
|
slackX: 0,
|
|
@@ -375,14 +381,14 @@ var q = class extends t.Component {
|
|
|
375
381
|
if (this.props.bounds) {
|
|
376
382
|
let { x: e, y: t } = r;
|
|
377
383
|
r.x += this.state.slackX, r.y += this.state.slackY;
|
|
378
|
-
let [i, a] =
|
|
384
|
+
let [i, a] = F(this, r.x, r.y);
|
|
379
385
|
r.x = i, r.y = a, r.slackX = this.state.slackX + (e - r.x), r.slackY = this.state.slackY + (t - r.y), n.x = r.x, n.y = r.y, n.deltaX = r.x - this.state.x, n.deltaY = r.y - this.state.y;
|
|
380
386
|
}
|
|
381
387
|
if (this.props.onDrag(e, n) === !1) return !1;
|
|
382
388
|
this.setState(r);
|
|
383
389
|
}, this.onDragStop = (e, t) => {
|
|
384
|
-
if (!this.state.dragging || this.props.onStop(e,
|
|
385
|
-
|
|
390
|
+
if (!this.state.dragging || this.props.onStop(e, V(this, t)) === !1) return !1;
|
|
391
|
+
W("Draggable: onDragStop: %j", t);
|
|
386
392
|
let n = {
|
|
387
393
|
dragging: !1,
|
|
388
394
|
slackX: 0,
|
|
@@ -405,7 +411,7 @@ var q = class extends t.Component {
|
|
|
405
411
|
}, e.position && !(e.onDrag || e.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
|
|
406
412
|
}
|
|
407
413
|
static getDerivedStateFromProps({ position: e }, { prevPropsPosition: t }) {
|
|
408
|
-
return e && (!t || e.x !== t.x || e.y !== t.y) ? (
|
|
414
|
+
return e && (!t || e.x !== t.x || e.y !== t.y) ? (W("Draggable: getDerivedStateFromProps %j", {
|
|
409
415
|
position: e,
|
|
410
416
|
prevPropsPosition: t
|
|
411
417
|
}), {
|
|
@@ -427,15 +433,15 @@ var q = class extends t.Component {
|
|
|
427
433
|
}
|
|
428
434
|
render() {
|
|
429
435
|
let { axis: n, bounds: r, children: i, defaultPosition: a, defaultClassName: o, defaultClassNameDragging: s, defaultClassNameDragged: c, position: l, positionOffset: u, scale: d, ...f } = this.props, p = {}, m = null, h = !l || this.state.dragging, g = l || a, _ = {
|
|
430
|
-
x:
|
|
431
|
-
y:
|
|
436
|
+
x: L(this) && h ? this.state.x : g.x,
|
|
437
|
+
y: R(this) && h ? this.state.y : g.y
|
|
432
438
|
};
|
|
433
439
|
this.state.isElementSVG ? m = T(_, u) : p = w(_, u);
|
|
434
440
|
let v = t.Children.only(i), y = e(v.props.className || "", o, {
|
|
435
441
|
[s]: this.state.dragging,
|
|
436
442
|
[c]: this.state.dragged
|
|
437
443
|
});
|
|
438
|
-
return /* @__PURE__ */ t.createElement(
|
|
444
|
+
return /* @__PURE__ */ t.createElement(q, {
|
|
439
445
|
...f,
|
|
440
446
|
onStart: this.onDragStart,
|
|
441
447
|
onDrag: this.onDrag,
|
|
@@ -450,8 +456,8 @@ var q = class extends t.Component {
|
|
|
450
456
|
}));
|
|
451
457
|
}
|
|
452
458
|
};
|
|
453
|
-
|
|
454
|
-
...
|
|
459
|
+
J.displayName = "Draggable", J.propTypes = {
|
|
460
|
+
...q.propTypes,
|
|
455
461
|
axis: n.oneOf([
|
|
456
462
|
"both",
|
|
457
463
|
"x",
|
|
@@ -486,8 +492,8 @@ q.displayName = "Draggable", q.propTypes = {
|
|
|
486
492
|
className: c,
|
|
487
493
|
style: c,
|
|
488
494
|
transform: c
|
|
489
|
-
},
|
|
490
|
-
...
|
|
495
|
+
}, J.defaultProps = {
|
|
496
|
+
...q.defaultProps,
|
|
491
497
|
axis: "both",
|
|
492
498
|
bounds: !1,
|
|
493
499
|
defaultClassName: "react-draggable",
|
|
@@ -500,4 +506,4 @@ q.displayName = "Draggable", q.propTypes = {
|
|
|
500
506
|
scale: 1
|
|
501
507
|
};
|
|
502
508
|
//#endregion
|
|
503
|
-
export {
|
|
509
|
+
export { J as Draggable, q as DraggableCore };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Draggable as e, DraggableCore as t } from "./chunk-ACOTSM7X.js";
|
|
2
|
+
//#region ../../../node_modules/.bun/react-draggable@4.7.1+6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/cjs.mjs
|
|
3
|
+
var n = e;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { t as DraggableCore, n as default };
|
package/dist/root.js
CHANGED
|
@@ -46,7 +46,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
46
46
|
fontSize: e.typography.fontSize + 2,
|
|
47
47
|
padding: `${e.spacing(1.5)} ${e.spacing(.5)} 0`,
|
|
48
48
|
textAlign: "center",
|
|
49
|
-
"&.
|
|
49
|
+
"&.disabledTitle": { pointerEvents: "none" },
|
|
50
50
|
"&.rightMargin": { marginRight: "74px" },
|
|
51
51
|
"& p": { margin: 0 },
|
|
52
52
|
...C
|
|
@@ -55,7 +55,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
55
55
|
fontSize: e.typography.fontSize + 4,
|
|
56
56
|
padding: `${e.spacing(1.5)} ${e.spacing(.5)} 0`,
|
|
57
57
|
textAlign: "center",
|
|
58
|
-
"&.
|
|
58
|
+
"&.disabledTitle": { pointerEvents: "none" },
|
|
59
59
|
"&.rightMargin": { marginRight: "74px" },
|
|
60
60
|
"& p": { margin: 0 },
|
|
61
61
|
...C
|
|
@@ -193,7 +193,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
193
193
|
...i(n(x)) && { display: "none" }
|
|
194
194
|
},
|
|
195
195
|
children: m(p ? A : k, {
|
|
196
|
-
className: "
|
|
196
|
+
className: "disabledTitle",
|
|
197
197
|
dangerouslySetInnerHTML: { __html: x || "" }
|
|
198
198
|
})
|
|
199
199
|
}) : /* @__PURE__ */ m("div", {
|
|
@@ -299,4 +299,4 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
301
|
//#endregion
|
|
302
|
-
export { F as default };
|
|
302
|
+
export { F as Root, F as default };
|
package/dist/trig.js
CHANGED
|
@@ -44,4 +44,4 @@ var i = /* @__PURE__ */ e({
|
|
|
44
44
|
return i("normalized:", S), S;
|
|
45
45
|
};
|
|
46
46
|
//#endregion
|
|
47
|
-
export { i as trig_exports };
|
|
47
|
+
export { f as acuteXAngle, p as acuteYAngle, c as angle, v as diffEdge, h as edges, g as getOpposingSide, m as hypotenuse, o as toDegrees, s as toRadians, i as trig_exports };
|
package/dist/types.js
CHANGED
|
@@ -43,4 +43,4 @@ var n = /* @__PURE__ */ e({
|
|
|
43
43
|
onClick: t.func
|
|
44
44
|
}, p = t.shape(f);
|
|
45
45
|
//#endregion
|
|
46
|
-
export { c as ChildrenType, d as GraphPropsType, n as types_exports };
|
|
46
|
+
export { r as BaseDomainRangeType, c as ChildrenType, i as DomainType, d as GraphPropsType, s as PointType, a as RangeType, l as ScaleType, o as SizeType, u as SnapType, p as ToolPropType, f as ToolPropTypeFields, n as types_exports };
|
package/dist/utils.js
CHANGED
|
@@ -79,4 +79,4 @@ var _ = (e) => {
|
|
|
79
79
|
bottom: n.min - e.bottom
|
|
80
80
|
}), b = (e) => new s(e.x, e.y), x = (e, t) => b(t).sub(b(e)), S = (e, t) => `${t}-${e.label || "-"}`, C = (e, t) => i(e.domain, t.domain) && i(e.range, t.range), w = (e) => (e || "").replace(/<[^>]+>/g, "").split(" ").sort((e, t) => t.length - e.length)[0].length, T = (e) => e ? e * 20 : 0, E = (e) => (new DOMParser()?.parseFromString(e, "text/html"))?.body?.textContent || "", D = (e) => e && Object.keys(e).length === 0 && e.constructor === Object, O = (e) => typeof e == "string" && e.trim() === "";
|
|
81
81
|
//#endregion
|
|
82
|
-
export { E as extractTextFromHTML, x as getDelta, D as isEmptyObject, O as isEmptyString, h as snapTo, c as utils_exports, u as xy };
|
|
82
|
+
export { T as amountToIncreaseWidth, S as bandKey, y as bounds, d as buildSizeArray, g as buildTickModel, E as extractTextFromHTML, w as findLongestWord, x as getDelta, p as getInterval, C as isDomainRangeEqual, D as isEmptyObject, O as isEmptyString, v as lineToArea, b as point, _ as polygonToArea, h as snapTo, f as tickCount, c as utils_exports, u as xy };
|
package/package.json
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/plot",
|
|
3
|
-
"version": "4.0.4-next.
|
|
3
|
+
"version": "4.0.4-next.33",
|
|
4
4
|
"description": "Some underlying components for building charts/graphs",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/pie-framework/pie-elements-ng.git",
|
|
8
|
+
"directory": "packages/lib-react/plot"
|
|
9
|
+
},
|
|
5
10
|
"dependencies": {
|
|
6
11
|
"@emotion/react": "^11.14.0",
|
|
7
|
-
"@emotion/
|
|
12
|
+
"@emotion/styled": "^11.14.1",
|
|
8
13
|
"@mapbox/point-geometry": "^1.1.0",
|
|
9
14
|
"@mui/icons-material": "^7.3.4",
|
|
10
15
|
"@mui/material": "^7.3.4",
|
|
11
|
-
"@pie-lib/editable-html-tip-tap": "2.1.2-next.
|
|
12
|
-
"@pie-lib/render-ui": "6.1.1-next.
|
|
16
|
+
"@pie-lib/editable-html-tip-tap": "2.1.2-next.33",
|
|
17
|
+
"@pie-lib/render-ui": "6.1.1-next.39",
|
|
13
18
|
"assert": "^1.4.1",
|
|
14
19
|
"d3-scale": "^4.0.2",
|
|
15
20
|
"d3-selection": "^3.0.0",
|
|
16
21
|
"debug": "^4.1.1",
|
|
17
22
|
"invariant": "^2.2.4",
|
|
18
23
|
"prop-types": "^15.7.2",
|
|
19
|
-
"react-draggable": "^4.
|
|
24
|
+
"react-draggable": "^4.7.1",
|
|
20
25
|
"react-redux": "^9.3.0",
|
|
21
26
|
"redux": "^5.0.1",
|
|
22
27
|
"@pie-element/shared-lodash": "0.1.1-next.1"
|