@pie-lib/plot 4.1.0-beta.8 → 5.0.0-next.35

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 (58) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +20 -0
  2. package/dist/draggable.d.ts +18 -0
  3. package/dist/draggable.js +6 -0
  4. package/dist/graph-props.d.ts +22 -0
  5. package/dist/graph-props.js +29 -0
  6. package/dist/grid-draggable.d.ts +98 -0
  7. package/dist/grid-draggable.js +172 -0
  8. package/dist/index.d.ts +16 -0
  9. package/dist/index.js +8 -0
  10. package/dist/label.d.ts +30 -0
  11. package/dist/label.js +132 -0
  12. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  13. package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +28 -0
  14. package/dist/node_modules/.bun/react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.js +509 -0
  15. package/dist/node_modules/.bun/react-draggable@4.7.1_6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/cjs.js +5 -0
  16. package/dist/root.d.ts +68 -0
  17. package/dist/root.js +302 -0
  18. package/dist/trig.d.ts +41 -0
  19. package/dist/trig.js +47 -0
  20. package/dist/types.d.ts +125 -0
  21. package/dist/types.js +46 -0
  22. package/dist/utils.d.ts +44 -0
  23. package/dist/utils.js +82 -0
  24. package/package.json +33 -25
  25. package/CHANGELOG.json +0 -17
  26. package/CHANGELOG.md +0 -838
  27. package/lib/draggable.js +0 -44
  28. package/lib/draggable.js.map +0 -1
  29. package/lib/graph-props.js +0 -46
  30. package/lib/graph-props.js.map +0 -1
  31. package/lib/grid-draggable.js +0 -361
  32. package/lib/grid-draggable.js.map +0 -1
  33. package/lib/index.js +0 -44
  34. package/lib/index.js.map +0 -1
  35. package/lib/label.js +0 -173
  36. package/lib/label.js.map +0 -1
  37. package/lib/root.js +0 -474
  38. package/lib/root.js.map +0 -1
  39. package/lib/trig.js +0 -149
  40. package/lib/trig.js.map +0 -1
  41. package/lib/types.js +0 -40
  42. package/lib/types.js.map +0 -1
  43. package/lib/utils.js +0 -165
  44. package/lib/utils.js.map +0 -1
  45. package/src/__tests__/draggable.test.jsx +0 -41
  46. package/src/__tests__/grid-draggable.test.jsx +0 -487
  47. package/src/__tests__/root.test.jsx +0 -277
  48. package/src/__tests__/trig.test.js +0 -163
  49. package/src/__tests__/utils.test.js +0 -229
  50. package/src/draggable.jsx +0 -11
  51. package/src/graph-props.js +0 -34
  52. package/src/grid-draggable.jsx +0 -332
  53. package/src/index.js +0 -9
  54. package/src/label.jsx +0 -199
  55. package/src/root.jsx +0 -485
  56. package/src/trig.js +0 -151
  57. package/src/types.js +0 -41
  58. package/src/utils.js +0 -167
@@ -0,0 +1,509 @@
1
+ import { clsx as e } from "../../../../../clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
+ import * as t from "react";
3
+ import n from "prop-types";
4
+ import r from "react-dom";
5
+ //#region ../../../node_modules/.bun/react-draggable@4.7.1+6dbf9a050bc9aadb/node_modules/react-draggable/build/cjs/chunk-ACOTSM7X.mjs
6
+ function i(e, t) {
7
+ for (let n = 0, r = e.length; n < r; n++) if (t.apply(t, [
8
+ e[n],
9
+ n,
10
+ e
11
+ ])) return e[n];
12
+ }
13
+ function a(e) {
14
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
15
+ }
16
+ function o(e) {
17
+ return typeof e == "number" && !isNaN(e);
18
+ }
19
+ function s(e) {
20
+ return parseInt(e, 10);
21
+ }
22
+ function c(e, t, n) {
23
+ if (e[t]) return /* @__PURE__ */ Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`);
24
+ }
25
+ var l = [
26
+ "Moz",
27
+ "Webkit",
28
+ "O",
29
+ "ms"
30
+ ];
31
+ function u(e = "transform") {
32
+ if (typeof window > "u") return "";
33
+ let t = window.document?.documentElement?.style;
34
+ if (!t || e in t) return "";
35
+ for (let n = 0; n < l.length; n++) if (d(e, l[n]) in t) return l[n];
36
+ return "";
37
+ }
38
+ function d(e, t) {
39
+ return t ? `${t}${f(e)}` : e;
40
+ }
41
+ function f(e) {
42
+ let t = "", n = !0;
43
+ for (let r = 0; r < e.length; r++) n ? (t += e[r].toUpperCase(), n = !1) : e[r] === "-" ? n = !0 : t += e[r];
44
+ return t;
45
+ }
46
+ var p = u(), m = "";
47
+ function h(e, t) {
48
+ m ||= i([
49
+ "matches",
50
+ "webkitMatchesSelector",
51
+ "mozMatchesSelector",
52
+ "msMatchesSelector",
53
+ "oMatchesSelector"
54
+ ], function(t) {
55
+ return a(e[t]);
56
+ }) ?? "";
57
+ let n = e[m];
58
+ return a(n) ? !!n.call(e, t) : !1;
59
+ }
60
+ function g(e, t, n) {
61
+ let r = e;
62
+ do {
63
+ if (h(r, t)) return !0;
64
+ if (r === n) return !1;
65
+ r = r.parentNode;
66
+ } while (r);
67
+ return !1;
68
+ }
69
+ function _(e, t, n, r) {
70
+ if (!e) return;
71
+ let i = {
72
+ capture: !0,
73
+ ...r
74
+ }, a = n;
75
+ e.addEventListener ? e.addEventListener(t, a, i) : e.attachEvent ? e.attachEvent("on" + t, a) : e["on" + t] = a;
76
+ }
77
+ function v(e, t, n, r) {
78
+ if (!e) return;
79
+ let i = {
80
+ capture: !0,
81
+ ...r
82
+ }, a = n;
83
+ e.removeEventListener ? e.removeEventListener(t, a, i) : e.detachEvent ? e.detachEvent("on" + t, a) : e["on" + t] = null;
84
+ }
85
+ function y(e) {
86
+ let t = e.clientHeight, n = e.ownerDocument.defaultView.getComputedStyle(e);
87
+ return t += s(n.borderTopWidth), t += s(n.borderBottomWidth), t;
88
+ }
89
+ function b(e) {
90
+ let t = e.clientWidth, n = e.ownerDocument.defaultView.getComputedStyle(e);
91
+ return t += s(n.borderLeftWidth), t += s(n.borderRightWidth), t;
92
+ }
93
+ function x(e) {
94
+ let t = e.clientHeight, n = e.ownerDocument.defaultView.getComputedStyle(e);
95
+ return t -= s(n.paddingTop), t -= s(n.paddingBottom), t;
96
+ }
97
+ function S(e) {
98
+ let t = e.clientWidth, n = e.ownerDocument.defaultView.getComputedStyle(e);
99
+ return t -= s(n.paddingLeft), t -= s(n.paddingRight), t;
100
+ }
101
+ function C(e, t, n) {
102
+ let r = t === t.ownerDocument.body ? {
103
+ left: 0,
104
+ top: 0
105
+ } : t.getBoundingClientRect();
106
+ return {
107
+ x: (e.clientX + t.scrollLeft - r.left) / n,
108
+ y: (e.clientY + t.scrollTop - r.top) / n
109
+ };
110
+ }
111
+ function w(e, t) {
112
+ let n = E(e, t, "px");
113
+ return { [d("transform", p)]: n };
114
+ }
115
+ function T(e, t) {
116
+ return E(e, t, "");
117
+ }
118
+ function E({ x: e, y: t }, n, r) {
119
+ let i = `translate(${e}${r},${t}${r})`;
120
+ return n && (i = `translate(${`${typeof n.x == "string" ? n.x : n.x + r}`}, ${`${typeof n.y == "string" ? n.y : n.y + r}`})` + i), i;
121
+ }
122
+ function D(e, t) {
123
+ return e.targetTouches && i(e.targetTouches, (e) => t === e.identifier) || e.changedTouches && i(e.changedTouches, (e) => t === e.identifier);
124
+ }
125
+ function O(e) {
126
+ if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
127
+ if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
128
+ }
129
+ function k() {
130
+ return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0;
131
+ }
132
+ function A(e, t) {
133
+ if (!e) return;
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");
141
+ }
142
+ function j(e) {
143
+ window.requestAnimationFrame ? window.requestAnimationFrame(() => {
144
+ M(e);
145
+ }) : M(e);
146
+ }
147
+ function M(e) {
148
+ if (e) try {
149
+ e.body && P(e.body, "react-draggable-transparent-selection");
150
+ let t = e.selection;
151
+ if (t) t.empty();
152
+ else {
153
+ let t = (e.defaultView || window).getSelection();
154
+ t && t.type !== "Caret" && t.removeAllRanges();
155
+ }
156
+ } catch {}
157
+ }
158
+ function N(e, t) {
159
+ e.classList ? e.classList.add(t) : e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`)) || (e.className += ` ${t}`);
160
+ }
161
+ function P(e, t) {
162
+ e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`, "g"), "");
163
+ }
164
+ function F(e, t, n) {
165
+ if (!e.props.bounds) return [t, n];
166
+ let { bounds: r } = e.props;
167
+ r = typeof r == "string" ? r : H(r);
168
+ let i = U(e);
169
+ if (typeof r == "string") {
170
+ let { ownerDocument: e } = i, t = e.defaultView;
171
+ if (!t) throw Error("Cannot resolve the owner window of the draggable node.");
172
+ let n;
173
+ if (n = r === "parent" ? i.parentNode : i.getRootNode().querySelector(r), !(n instanceof t.HTMLElement)) throw Error("Bounds selector \"" + r + "\" could not find an element.");
174
+ let a = n, o = t.getComputedStyle(i), c = t.getComputedStyle(a);
175
+ r = {
176
+ left: -i.offsetLeft + s(c.paddingLeft) + s(o.marginLeft),
177
+ top: -i.offsetTop + s(c.paddingTop) + s(o.marginTop),
178
+ right: S(a) - b(i) - i.offsetLeft + s(c.paddingRight) - s(o.marginRight),
179
+ bottom: x(a) - y(i) - i.offsetTop + s(c.paddingBottom) - s(o.marginBottom)
180
+ };
181
+ }
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];
183
+ }
184
+ function I(e, t, n) {
185
+ return [Math.round(t / e[0]) * e[0], Math.round(n / e[1]) * e[1]];
186
+ }
187
+ function L(e) {
188
+ return e.props.axis === "both" || e.props.axis === "x";
189
+ }
190
+ function R(e) {
191
+ return e.props.axis === "both" || e.props.axis === "y";
192
+ }
193
+ function z(e, t, n) {
194
+ let r = typeof t == "number" ? D(e, t) : null;
195
+ if (typeof t == "number" && !r) return null;
196
+ let i = U(n), a = n.props.offsetParent || i.offsetParent || i.ownerDocument.body;
197
+ return C(r || e, a, n.props.scale);
198
+ }
199
+ function B(e, t, n) {
200
+ let r = !o(e.lastX), i = U(e);
201
+ return r ? {
202
+ node: i,
203
+ deltaX: 0,
204
+ deltaY: 0,
205
+ lastX: t,
206
+ lastY: n,
207
+ x: t,
208
+ y: n
209
+ } : {
210
+ node: i,
211
+ deltaX: t - e.lastX,
212
+ deltaY: n - e.lastY,
213
+ lastX: e.lastX,
214
+ lastY: e.lastY,
215
+ x: t,
216
+ y: n
217
+ };
218
+ }
219
+ function V(e, t) {
220
+ let n = e.props.scale;
221
+ return {
222
+ node: t.node,
223
+ x: e.state.x + t.deltaX / n,
224
+ y: e.state.y + t.deltaY / n,
225
+ deltaX: t.deltaX / n,
226
+ deltaY: t.deltaY / n,
227
+ lastX: e.state.x,
228
+ lastY: e.state.y
229
+ };
230
+ }
231
+ function H(e) {
232
+ return {
233
+ left: e.left,
234
+ top: e.top,
235
+ right: e.right,
236
+ bottom: e.bottom
237
+ };
238
+ }
239
+ function U(e) {
240
+ let t = e.findDOMNode();
241
+ if (!t) throw Error("<DraggableCore>: Unmounted during event!");
242
+ return t;
243
+ }
244
+ var W = typeof process < "u" && process.env.DRAGGABLE_DEBUG ? console.log.bind(console) : function() {}, G = {
245
+ touch: {
246
+ start: "touchstart",
247
+ move: "touchmove",
248
+ stop: "touchend"
249
+ },
250
+ mouse: {
251
+ start: "mousedown",
252
+ move: "mousemove",
253
+ stop: "mouseup"
254
+ }
255
+ }, K = G.mouse, q = class extends t.Component {
256
+ constructor() {
257
+ super(...arguments), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, this.touchIdentifier = null, this.mounted = !1, this.handleDragStart = (e) => {
258
+ if (this.props.onMouseDown(e), !this.props.allowAnyClick && (typeof e.button == "number" && e.button !== 0 || e.ctrlKey)) return !1;
259
+ let t = this.findDOMNode();
260
+ if (!t || !t.ownerDocument || !t.ownerDocument.body) throw Error("<DraggableCore> not mounted on DragStart!");
261
+ let { ownerDocument: n } = t;
262
+ if (this.props.disabled || !(e.target instanceof n.defaultView.Node) || this.props.handle && !g(e.target, this.props.handle, t) || this.props.cancel && g(e.target, this.props.cancel, t)) return;
263
+ e.type === "touchstart" && !this.props.allowMobileScroll && e.preventDefault();
264
+ let r = O(e);
265
+ this.touchIdentifier = r;
266
+ let i = z(e, r, this);
267
+ if (i == null) return;
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));
270
+ }, this.handleDrag = (e) => {
271
+ let t = z(e, this.touchIdentifier, this);
272
+ if (t == null) return;
273
+ let { x: n, y: r } = t;
274
+ if (Array.isArray(this.props.grid)) {
275
+ let e = n - this.lastX, t = r - this.lastY;
276
+ if ([e, t] = I(this.props.grid, e, t), !e && !t) return;
277
+ n = this.lastX + e, r = this.lastY + t;
278
+ }
279
+ let i = B(this, n, r);
280
+ if (W("DraggableCore: handleDrag: %j", i), this.props.onDrag(e, i) === !1 || this.mounted === !1) {
281
+ try {
282
+ this.handleDragStop(new MouseEvent("mouseup"));
283
+ } catch {
284
+ let e = document.createEvent("MouseEvents");
285
+ e.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(e);
286
+ }
287
+ return;
288
+ }
289
+ this.lastX = n, this.lastY = r;
290
+ }, this.handleDragStop = (e) => {
291
+ if (!this.dragging) return;
292
+ let t = z(e, this.touchIdentifier, this);
293
+ if (t == null) return;
294
+ let { x: n, y: r } = t;
295
+ if (Array.isArray(this.props.grid)) {
296
+ let e = n - this.lastX || 0, t = r - this.lastY || 0;
297
+ [e, t] = I(this.props.grid, e, t), n = this.lastX + e, r = this.lastY + t;
298
+ }
299
+ let i = B(this, n, r);
300
+ if (this.props.onStop(e, i) === !1 || this.mounted === !1) return !1;
301
+ let a = this.findDOMNode();
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));
304
+ }
305
+ componentDidMount() {
306
+ this.mounted = !0;
307
+ let e = this.findDOMNode();
308
+ e && _(e, G.touch.start, this.onTouchStart, { passive: !1 });
309
+ }
310
+ componentWillUnmount() {
311
+ this.mounted = !1;
312
+ let e = this.findDOMNode();
313
+ if (e) {
314
+ let { ownerDocument: t } = e;
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);
316
+ }
317
+ }
318
+ findDOMNode() {
319
+ if (this.props?.nodeRef) return this.props.nodeRef.current;
320
+ let e = r;
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);
322
+ }
323
+ render() {
324
+ return t.cloneElement(t.Children.only(this.props.children), {
325
+ onMouseDown: this.onMouseDown,
326
+ onMouseUp: this.onMouseUp,
327
+ onTouchEnd: this.onTouchEnd
328
+ });
329
+ }
330
+ };
331
+ q.displayName = "DraggableCore", q.propTypes = {
332
+ allowAnyClick: n.bool,
333
+ allowMobileScroll: n.bool,
334
+ children: n.node.isRequired,
335
+ disabled: n.bool,
336
+ enableUserSelectHack: n.bool,
337
+ offsetParent: function(e, t) {
338
+ if (e[t] && e[t].nodeType !== 1) throw Error("Draggable's offsetParent must be a DOM Node.");
339
+ },
340
+ grid: n.arrayOf(n.number),
341
+ handle: n.string,
342
+ cancel: n.string,
343
+ nodeRef: n.object,
344
+ nonce: n.string,
345
+ onStart: n.func,
346
+ onDrag: n.func,
347
+ onStop: n.func,
348
+ onMouseDown: n.func,
349
+ scale: n.number,
350
+ className: c,
351
+ style: c,
352
+ transform: c
353
+ }, q.defaultProps = {
354
+ allowAnyClick: !1,
355
+ allowMobileScroll: !1,
356
+ disabled: !1,
357
+ enableUserSelectHack: !0,
358
+ onStart: function() {},
359
+ onDrag: function() {},
360
+ onStop: function() {},
361
+ onMouseDown: function() {},
362
+ scale: 1
363
+ };
364
+ var J = class extends t.Component {
365
+ constructor(e) {
366
+ super(e), this.onDragStart = (e, t) => {
367
+ if (W("Draggable: onDragStart: %j", t), this.props.onStart(e, V(this, t)) === !1) return !1;
368
+ this.setState({
369
+ dragging: !0,
370
+ dragged: !0
371
+ });
372
+ }, this.onDrag = (e, t) => {
373
+ if (!this.state.dragging) return !1;
374
+ W("Draggable: onDrag: %j", t);
375
+ let n = V(this, t), r = {
376
+ x: n.x,
377
+ y: n.y,
378
+ slackX: 0,
379
+ slackY: 0
380
+ };
381
+ if (this.props.bounds) {
382
+ let { x: e, y: t } = r;
383
+ r.x += this.state.slackX, r.y += this.state.slackY;
384
+ let [i, a] = F(this, r.x, r.y);
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;
386
+ }
387
+ if (this.props.onDrag(e, n) === !1) return !1;
388
+ this.setState(r);
389
+ }, this.onDragStop = (e, t) => {
390
+ if (!this.state.dragging || this.props.onStop(e, V(this, t)) === !1) return !1;
391
+ W("Draggable: onDragStop: %j", t);
392
+ let n = {
393
+ dragging: !1,
394
+ slackX: 0,
395
+ slackY: 0
396
+ };
397
+ if (this.props.position) {
398
+ let { x: e, y: t } = this.props.position;
399
+ n.x = e, n.y = t;
400
+ }
401
+ this.setState(n);
402
+ }, this.state = {
403
+ dragging: !1,
404
+ dragged: !1,
405
+ x: e.position ? e.position.x : e.defaultPosition.x,
406
+ y: e.position ? e.position.y : e.defaultPosition.y,
407
+ prevPropsPosition: { ...e.position },
408
+ slackX: 0,
409
+ slackY: 0,
410
+ isElementSVG: !1
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.");
412
+ }
413
+ static getDerivedStateFromProps({ position: e }, { prevPropsPosition: t }) {
414
+ return e && (!t || e.x !== t.x || e.y !== t.y) ? (W("Draggable: getDerivedStateFromProps %j", {
415
+ position: e,
416
+ prevPropsPosition: t
417
+ }), {
418
+ x: e.x,
419
+ y: e.y,
420
+ prevPropsPosition: { ...e }
421
+ }) : null;
422
+ }
423
+ componentDidMount() {
424
+ window.SVGElement !== void 0 && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: !0 });
425
+ }
426
+ componentWillUnmount() {
427
+ this.state.dragging && this.setState({ dragging: !1 });
428
+ }
429
+ findDOMNode() {
430
+ if (this.props?.nodeRef) return this.props.nodeRef.current;
431
+ let e = r;
432
+ return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : null;
433
+ }
434
+ render() {
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, _ = {
436
+ x: L(this) && h ? this.state.x : g.x,
437
+ y: R(this) && h ? this.state.y : g.y
438
+ };
439
+ this.state.isElementSVG ? m = T(_, u) : p = w(_, u);
440
+ let v = t.Children.only(i), y = e(v.props.className || "", o, {
441
+ [s]: this.state.dragging,
442
+ [c]: this.state.dragged
443
+ });
444
+ return /* @__PURE__ */ t.createElement(q, {
445
+ ...f,
446
+ onStart: this.onDragStart,
447
+ onDrag: this.onDrag,
448
+ onStop: this.onDragStop
449
+ }, t.cloneElement(v, {
450
+ className: y,
451
+ style: {
452
+ ...v.props.style,
453
+ ...p
454
+ },
455
+ transform: m
456
+ }));
457
+ }
458
+ };
459
+ J.displayName = "Draggable", J.propTypes = {
460
+ ...q.propTypes,
461
+ axis: n.oneOf([
462
+ "both",
463
+ "x",
464
+ "y",
465
+ "none"
466
+ ]),
467
+ bounds: n.oneOfType([
468
+ n.shape({
469
+ left: n.number,
470
+ right: n.number,
471
+ top: n.number,
472
+ bottom: n.number
473
+ }),
474
+ n.string,
475
+ n.oneOf([!1])
476
+ ]),
477
+ defaultClassName: n.string,
478
+ defaultClassNameDragging: n.string,
479
+ defaultClassNameDragged: n.string,
480
+ defaultPosition: n.shape({
481
+ x: n.number,
482
+ y: n.number
483
+ }),
484
+ positionOffset: n.shape({
485
+ x: n.oneOfType([n.number, n.string]),
486
+ y: n.oneOfType([n.number, n.string])
487
+ }),
488
+ position: n.shape({
489
+ x: n.number,
490
+ y: n.number
491
+ }),
492
+ className: c,
493
+ style: c,
494
+ transform: c
495
+ }, J.defaultProps = {
496
+ ...q.defaultProps,
497
+ axis: "both",
498
+ bounds: !1,
499
+ defaultClassName: "react-draggable",
500
+ defaultClassNameDragging: "react-draggable-dragging",
501
+ defaultClassNameDragged: "react-draggable-dragged",
502
+ defaultPosition: {
503
+ x: 0,
504
+ y: 0
505
+ },
506
+ scale: 1
507
+ };
508
+ //#endregion
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.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/plot/src/root.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Root extends React.Component {
12
+ constructor(props: any);
13
+ static propTypes: {
14
+ title: PropTypes.Requireable<string>;
15
+ children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
16
+ defineChart: PropTypes.Requireable<boolean>;
17
+ disabledLabels: PropTypes.Requireable<boolean>;
18
+ disabledTitle: PropTypes.Requireable<boolean>;
19
+ graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
20
+ scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
21
+ x: PropTypes.Validator<(...args: any[]) => any>;
22
+ y: PropTypes.Validator<(...args: any[]) => any>;
23
+ }>>>;
24
+ snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
25
+ x: PropTypes.Validator<(...args: any[]) => any>;
26
+ y: PropTypes.Validator<(...args: any[]) => any>;
27
+ }>>>;
28
+ domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
29
+ min: PropTypes.Validator<number>;
30
+ max: PropTypes.Validator<number>;
31
+ step: PropTypes.Requireable<number>;
32
+ }>>>;
33
+ range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
34
+ min: PropTypes.Validator<number>;
35
+ max: PropTypes.Validator<number>;
36
+ step: PropTypes.Requireable<number>;
37
+ }>>>;
38
+ size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
39
+ width: PropTypes.Validator<number>;
40
+ height: PropTypes.Validator<number>;
41
+ }>>>;
42
+ }>>>;
43
+ isChart: PropTypes.Requireable<boolean>;
44
+ labels: PropTypes.Requireable<object>;
45
+ labelsPlaceholders: PropTypes.Requireable<object>;
46
+ onChangeTitle: PropTypes.Requireable<(...args: any[]) => any>;
47
+ onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
48
+ showLabels: PropTypes.Requireable<boolean>;
49
+ showTitle: PropTypes.Requireable<boolean>;
50
+ showPixelGuides: PropTypes.Requireable<boolean>;
51
+ rootRef: PropTypes.Requireable<(...args: any[]) => any>;
52
+ onChangeLabels: PropTypes.Requireable<(...args: any[]) => any>;
53
+ titlePlaceholder: PropTypes.Requireable<string>;
54
+ mathMlOptions: PropTypes.Requireable<object>;
55
+ labelsCharactersLimit: PropTypes.Requireable<number>;
56
+ };
57
+ mouseMove: any;
58
+ componentDidMount(): void;
59
+ componentWillUnmount(): void;
60
+ componentDidUpdate(prevProps: any): void;
61
+ onChangeLabel: any;
62
+ measureTitleHeight: any;
63
+ handleKeyDown: any;
64
+ setupVisibilityObserver: any;
65
+ cleanupVisibilityObserver: any;
66
+ render(): React.JSX.Element;
67
+ }
68
+ export default Root;