@timeax/form-palette 0.1.4 → 0.1.5
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/extra.js +3 -2029
- package/dist/extra.js.map +1 -1
- package/dist/extra.mjs +2 -2029
- package/dist/extra.mjs.map +1 -1
- package/package.json +3 -2
package/dist/extra.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React72 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var reactDom = require('react-dom');
|
|
6
|
+
var Draggable = require('react-draggable');
|
|
6
7
|
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
7
8
|
var SelectPrimitive = require('@radix-ui/react-select');
|
|
8
9
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
@@ -43,6 +44,7 @@ function _interopNamespace(e) {
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
var React72__namespace = /*#__PURE__*/_interopNamespace(React72);
|
|
47
|
+
var Draggable__default = /*#__PURE__*/_interopDefault(Draggable);
|
|
46
48
|
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
47
49
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
48
50
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
@@ -58,2019 +60,11 @@ var Editor__default = /*#__PURE__*/_interopDefault(Editor);
|
|
|
58
60
|
var Ajv__default = /*#__PURE__*/_interopDefault(Ajv);
|
|
59
61
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
60
62
|
|
|
61
|
-
var __create = Object.create;
|
|
62
63
|
var __defProp = Object.defineProperty;
|
|
63
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
64
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
65
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
66
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
67
|
-
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
|
|
68
|
-
get: (a3, b2) => (typeof require !== "undefined" ? require : a3)[b2]
|
|
69
|
-
}) : x2)(function(x2) {
|
|
70
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
71
|
-
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
72
|
-
});
|
|
73
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
74
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
75
|
-
};
|
|
76
64
|
var __export = (target, all) => {
|
|
77
65
|
for (var name in all)
|
|
78
66
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
79
67
|
};
|
|
80
|
-
var __copyProps = (to, from, except, desc) => {
|
|
81
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
82
|
-
for (let key of __getOwnPropNames(from))
|
|
83
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
84
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
85
|
-
}
|
|
86
|
-
return to;
|
|
87
|
-
};
|
|
88
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
89
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
90
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
91
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
92
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
93
|
-
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
94
|
-
mod
|
|
95
|
-
));
|
|
96
|
-
|
|
97
|
-
// ../../node_modules/react-is/cjs/react-is.development.js
|
|
98
|
-
var require_react_is_development = __commonJS({
|
|
99
|
-
"../../node_modules/react-is/cjs/react-is.development.js"(exports$1) {
|
|
100
|
-
{
|
|
101
|
-
(function() {
|
|
102
|
-
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
103
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
104
|
-
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
105
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
106
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
107
|
-
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
108
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
109
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
110
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
111
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
112
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
113
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
114
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
115
|
-
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
116
|
-
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
117
|
-
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
118
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
119
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
120
|
-
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
121
|
-
function isValidElementType(type) {
|
|
122
|
-
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
123
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
124
|
-
}
|
|
125
|
-
function typeOf(object) {
|
|
126
|
-
if (typeof object === "object" && object !== null) {
|
|
127
|
-
var $$typeof = object.$$typeof;
|
|
128
|
-
switch ($$typeof) {
|
|
129
|
-
case REACT_ELEMENT_TYPE:
|
|
130
|
-
var type = object.type;
|
|
131
|
-
switch (type) {
|
|
132
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
133
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
134
|
-
case REACT_FRAGMENT_TYPE:
|
|
135
|
-
case REACT_PROFILER_TYPE:
|
|
136
|
-
case REACT_STRICT_MODE_TYPE:
|
|
137
|
-
case REACT_SUSPENSE_TYPE:
|
|
138
|
-
return type;
|
|
139
|
-
default:
|
|
140
|
-
var $$typeofType = type && type.$$typeof;
|
|
141
|
-
switch ($$typeofType) {
|
|
142
|
-
case REACT_CONTEXT_TYPE:
|
|
143
|
-
case REACT_FORWARD_REF_TYPE:
|
|
144
|
-
case REACT_LAZY_TYPE:
|
|
145
|
-
case REACT_MEMO_TYPE:
|
|
146
|
-
case REACT_PROVIDER_TYPE:
|
|
147
|
-
return $$typeofType;
|
|
148
|
-
default:
|
|
149
|
-
return $$typeof;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
case REACT_PORTAL_TYPE:
|
|
153
|
-
return $$typeof;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return void 0;
|
|
157
|
-
}
|
|
158
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
159
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
160
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
161
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
162
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
163
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
164
|
-
var Fragment14 = REACT_FRAGMENT_TYPE;
|
|
165
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
166
|
-
var Memo = REACT_MEMO_TYPE;
|
|
167
|
-
var Portal5 = REACT_PORTAL_TYPE;
|
|
168
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
169
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
170
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
171
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
172
|
-
function isAsyncMode(object) {
|
|
173
|
-
{
|
|
174
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
175
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
176
|
-
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
180
|
-
}
|
|
181
|
-
function isConcurrentMode(object) {
|
|
182
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
183
|
-
}
|
|
184
|
-
function isContextConsumer(object) {
|
|
185
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
186
|
-
}
|
|
187
|
-
function isContextProvider(object) {
|
|
188
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
189
|
-
}
|
|
190
|
-
function isElement(object) {
|
|
191
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
192
|
-
}
|
|
193
|
-
function isForwardRef(object) {
|
|
194
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
195
|
-
}
|
|
196
|
-
function isFragment(object) {
|
|
197
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
198
|
-
}
|
|
199
|
-
function isLazy(object) {
|
|
200
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
201
|
-
}
|
|
202
|
-
function isMemo(object) {
|
|
203
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
204
|
-
}
|
|
205
|
-
function isPortal(object) {
|
|
206
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
207
|
-
}
|
|
208
|
-
function isProfiler(object) {
|
|
209
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
210
|
-
}
|
|
211
|
-
function isStrictMode(object) {
|
|
212
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
213
|
-
}
|
|
214
|
-
function isSuspense(object) {
|
|
215
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
216
|
-
}
|
|
217
|
-
exports$1.AsyncMode = AsyncMode;
|
|
218
|
-
exports$1.ConcurrentMode = ConcurrentMode;
|
|
219
|
-
exports$1.ContextConsumer = ContextConsumer;
|
|
220
|
-
exports$1.ContextProvider = ContextProvider;
|
|
221
|
-
exports$1.Element = Element;
|
|
222
|
-
exports$1.ForwardRef = ForwardRef;
|
|
223
|
-
exports$1.Fragment = Fragment14;
|
|
224
|
-
exports$1.Lazy = Lazy;
|
|
225
|
-
exports$1.Memo = Memo;
|
|
226
|
-
exports$1.Portal = Portal5;
|
|
227
|
-
exports$1.Profiler = Profiler;
|
|
228
|
-
exports$1.StrictMode = StrictMode;
|
|
229
|
-
exports$1.Suspense = Suspense;
|
|
230
|
-
exports$1.isAsyncMode = isAsyncMode;
|
|
231
|
-
exports$1.isConcurrentMode = isConcurrentMode;
|
|
232
|
-
exports$1.isContextConsumer = isContextConsumer;
|
|
233
|
-
exports$1.isContextProvider = isContextProvider;
|
|
234
|
-
exports$1.isElement = isElement;
|
|
235
|
-
exports$1.isForwardRef = isForwardRef;
|
|
236
|
-
exports$1.isFragment = isFragment;
|
|
237
|
-
exports$1.isLazy = isLazy;
|
|
238
|
-
exports$1.isMemo = isMemo;
|
|
239
|
-
exports$1.isPortal = isPortal;
|
|
240
|
-
exports$1.isProfiler = isProfiler;
|
|
241
|
-
exports$1.isStrictMode = isStrictMode;
|
|
242
|
-
exports$1.isSuspense = isSuspense;
|
|
243
|
-
exports$1.isValidElementType = isValidElementType;
|
|
244
|
-
exports$1.typeOf = typeOf;
|
|
245
|
-
})();
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
// ../../node_modules/react-is/index.js
|
|
251
|
-
var require_react_is = __commonJS({
|
|
252
|
-
"../../node_modules/react-is/index.js"(exports$1, module2) {
|
|
253
|
-
{
|
|
254
|
-
module2.exports = require_react_is_development();
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
// ../../node_modules/object-assign/index.js
|
|
260
|
-
var require_object_assign = __commonJS({
|
|
261
|
-
"../../node_modules/object-assign/index.js"(exports$1, module2) {
|
|
262
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
263
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
264
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
265
|
-
function toObject(val) {
|
|
266
|
-
if (val === null || val === void 0) {
|
|
267
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
268
|
-
}
|
|
269
|
-
return Object(val);
|
|
270
|
-
}
|
|
271
|
-
function shouldUseNative() {
|
|
272
|
-
try {
|
|
273
|
-
if (!Object.assign) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
var test1 = new String("abc");
|
|
277
|
-
test1[5] = "de";
|
|
278
|
-
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
279
|
-
return false;
|
|
280
|
-
}
|
|
281
|
-
var test2 = {};
|
|
282
|
-
for (var i3 = 0; i3 < 10; i3++) {
|
|
283
|
-
test2["_" + String.fromCharCode(i3)] = i3;
|
|
284
|
-
}
|
|
285
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function(n3) {
|
|
286
|
-
return test2[n3];
|
|
287
|
-
});
|
|
288
|
-
if (order2.join("") !== "0123456789") {
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
var test3 = {};
|
|
292
|
-
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
293
|
-
test3[letter] = letter;
|
|
294
|
-
});
|
|
295
|
-
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
return true;
|
|
299
|
-
} catch (err) {
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
304
|
-
var from;
|
|
305
|
-
var to = toObject(target);
|
|
306
|
-
var symbols;
|
|
307
|
-
for (var s3 = 1; s3 < arguments.length; s3++) {
|
|
308
|
-
from = Object(arguments[s3]);
|
|
309
|
-
for (var key in from) {
|
|
310
|
-
if (hasOwnProperty.call(from, key)) {
|
|
311
|
-
to[key] = from[key];
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
if (getOwnPropertySymbols) {
|
|
315
|
-
symbols = getOwnPropertySymbols(from);
|
|
316
|
-
for (var i3 = 0; i3 < symbols.length; i3++) {
|
|
317
|
-
if (propIsEnumerable.call(from, symbols[i3])) {
|
|
318
|
-
to[symbols[i3]] = from[symbols[i3]];
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
return to;
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
329
|
-
var require_ReactPropTypesSecret = __commonJS({
|
|
330
|
-
"../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports$1, module2) {
|
|
331
|
-
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
332
|
-
module2.exports = ReactPropTypesSecret;
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
// ../../node_modules/prop-types/lib/has.js
|
|
337
|
-
var require_has = __commonJS({
|
|
338
|
-
"../../node_modules/prop-types/lib/has.js"(exports$1, module2) {
|
|
339
|
-
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
// ../../node_modules/prop-types/checkPropTypes.js
|
|
344
|
-
var require_checkPropTypes = __commonJS({
|
|
345
|
-
"../../node_modules/prop-types/checkPropTypes.js"(exports$1, module2) {
|
|
346
|
-
var printWarning = function() {
|
|
347
|
-
};
|
|
348
|
-
{
|
|
349
|
-
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
350
|
-
loggedTypeFailures = {};
|
|
351
|
-
has = require_has();
|
|
352
|
-
printWarning = function(text) {
|
|
353
|
-
var message2 = "Warning: " + text;
|
|
354
|
-
if (typeof console !== "undefined") {
|
|
355
|
-
console.error(message2);
|
|
356
|
-
}
|
|
357
|
-
try {
|
|
358
|
-
throw new Error(message2);
|
|
359
|
-
} catch (x2) {
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
var ReactPropTypesSecret;
|
|
364
|
-
var loggedTypeFailures;
|
|
365
|
-
var has;
|
|
366
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
367
|
-
{
|
|
368
|
-
for (var typeSpecName in typeSpecs) {
|
|
369
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
370
|
-
var error;
|
|
371
|
-
try {
|
|
372
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
373
|
-
var err = Error(
|
|
374
|
-
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
375
|
-
);
|
|
376
|
-
err.name = "Invariant Violation";
|
|
377
|
-
throw err;
|
|
378
|
-
}
|
|
379
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
380
|
-
} catch (ex) {
|
|
381
|
-
error = ex;
|
|
382
|
-
}
|
|
383
|
-
if (error && !(error instanceof Error)) {
|
|
384
|
-
printWarning(
|
|
385
|
-
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
386
|
-
);
|
|
387
|
-
}
|
|
388
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
389
|
-
loggedTypeFailures[error.message] = true;
|
|
390
|
-
var stack = getStack ? getStack() : "";
|
|
391
|
-
printWarning(
|
|
392
|
-
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
checkPropTypes.resetWarningCache = function() {
|
|
400
|
-
{
|
|
401
|
-
loggedTypeFailures = {};
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
module2.exports = checkPropTypes;
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
// ../../node_modules/prop-types/factoryWithTypeCheckers.js
|
|
409
|
-
var require_factoryWithTypeCheckers = __commonJS({
|
|
410
|
-
"../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports$1, module2) {
|
|
411
|
-
var ReactIs = require_react_is();
|
|
412
|
-
var assign = require_object_assign();
|
|
413
|
-
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
414
|
-
var has = require_has();
|
|
415
|
-
var checkPropTypes = require_checkPropTypes();
|
|
416
|
-
var printWarning = function() {
|
|
417
|
-
};
|
|
418
|
-
{
|
|
419
|
-
printWarning = function(text) {
|
|
420
|
-
var message2 = "Warning: " + text;
|
|
421
|
-
if (typeof console !== "undefined") {
|
|
422
|
-
console.error(message2);
|
|
423
|
-
}
|
|
424
|
-
try {
|
|
425
|
-
throw new Error(message2);
|
|
426
|
-
} catch (x2) {
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
function emptyFunctionThatReturnsNull() {
|
|
431
|
-
return null;
|
|
432
|
-
}
|
|
433
|
-
module2.exports = function(isValidElement5, throwOnDirectAccess) {
|
|
434
|
-
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
435
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
436
|
-
function getIteratorFn(maybeIterable) {
|
|
437
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
438
|
-
if (typeof iteratorFn === "function") {
|
|
439
|
-
return iteratorFn;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
var ANONYMOUS = "<<anonymous>>";
|
|
443
|
-
var ReactPropTypes = {
|
|
444
|
-
array: createPrimitiveTypeChecker("array"),
|
|
445
|
-
bigint: createPrimitiveTypeChecker("bigint"),
|
|
446
|
-
bool: createPrimitiveTypeChecker("boolean"),
|
|
447
|
-
func: createPrimitiveTypeChecker("function"),
|
|
448
|
-
number: createPrimitiveTypeChecker("number"),
|
|
449
|
-
object: createPrimitiveTypeChecker("object"),
|
|
450
|
-
string: createPrimitiveTypeChecker("string"),
|
|
451
|
-
symbol: createPrimitiveTypeChecker("symbol"),
|
|
452
|
-
any: createAnyTypeChecker(),
|
|
453
|
-
arrayOf: createArrayOfTypeChecker,
|
|
454
|
-
element: createElementTypeChecker(),
|
|
455
|
-
elementType: createElementTypeTypeChecker(),
|
|
456
|
-
instanceOf: createInstanceTypeChecker,
|
|
457
|
-
node: createNodeChecker(),
|
|
458
|
-
objectOf: createObjectOfTypeChecker,
|
|
459
|
-
oneOf: createEnumTypeChecker,
|
|
460
|
-
oneOfType: createUnionTypeChecker,
|
|
461
|
-
shape: createShapeTypeChecker,
|
|
462
|
-
exact: createStrictShapeTypeChecker
|
|
463
|
-
};
|
|
464
|
-
function is(x2, y2) {
|
|
465
|
-
if (x2 === y2) {
|
|
466
|
-
return x2 !== 0 || 1 / x2 === 1 / y2;
|
|
467
|
-
} else {
|
|
468
|
-
return x2 !== x2 && y2 !== y2;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
function PropTypeError(message2, data) {
|
|
472
|
-
this.message = message2;
|
|
473
|
-
this.data = data && typeof data === "object" ? data : {};
|
|
474
|
-
this.stack = "";
|
|
475
|
-
}
|
|
476
|
-
PropTypeError.prototype = Error.prototype;
|
|
477
|
-
function createChainableTypeChecker(validate) {
|
|
478
|
-
{
|
|
479
|
-
var manualPropTypeCallCache = {};
|
|
480
|
-
var manualPropTypeWarningCount = 0;
|
|
481
|
-
}
|
|
482
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
483
|
-
componentName = componentName || ANONYMOUS;
|
|
484
|
-
propFullName = propFullName || propName;
|
|
485
|
-
if (secret !== ReactPropTypesSecret) {
|
|
486
|
-
if (throwOnDirectAccess) {
|
|
487
|
-
var err = new Error(
|
|
488
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
489
|
-
);
|
|
490
|
-
err.name = "Invariant Violation";
|
|
491
|
-
throw err;
|
|
492
|
-
} else if (typeof console !== "undefined") {
|
|
493
|
-
var cacheKey = componentName + ":" + propName;
|
|
494
|
-
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
495
|
-
manualPropTypeWarningCount < 3) {
|
|
496
|
-
printWarning(
|
|
497
|
-
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
498
|
-
);
|
|
499
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
500
|
-
manualPropTypeWarningCount++;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
if (props[propName] == null) {
|
|
505
|
-
if (isRequired) {
|
|
506
|
-
if (props[propName] === null) {
|
|
507
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
508
|
-
}
|
|
509
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
510
|
-
}
|
|
511
|
-
return null;
|
|
512
|
-
} else {
|
|
513
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
517
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
518
|
-
return chainedCheckType;
|
|
519
|
-
}
|
|
520
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
521
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
522
|
-
var propValue = props[propName];
|
|
523
|
-
var propType = getPropType(propValue);
|
|
524
|
-
if (propType !== expectedType) {
|
|
525
|
-
var preciseType = getPreciseType(propValue);
|
|
526
|
-
return new PropTypeError(
|
|
527
|
-
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
528
|
-
{ expectedType }
|
|
529
|
-
);
|
|
530
|
-
}
|
|
531
|
-
return null;
|
|
532
|
-
}
|
|
533
|
-
return createChainableTypeChecker(validate);
|
|
534
|
-
}
|
|
535
|
-
function createAnyTypeChecker() {
|
|
536
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
537
|
-
}
|
|
538
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
539
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
540
|
-
if (typeof typeChecker !== "function") {
|
|
541
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
542
|
-
}
|
|
543
|
-
var propValue = props[propName];
|
|
544
|
-
if (!Array.isArray(propValue)) {
|
|
545
|
-
var propType = getPropType(propValue);
|
|
546
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
547
|
-
}
|
|
548
|
-
for (var i3 = 0; i3 < propValue.length; i3++) {
|
|
549
|
-
var error = typeChecker(propValue, i3, componentName, location, propFullName + "[" + i3 + "]", ReactPropTypesSecret);
|
|
550
|
-
if (error instanceof Error) {
|
|
551
|
-
return error;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
return null;
|
|
555
|
-
}
|
|
556
|
-
return createChainableTypeChecker(validate);
|
|
557
|
-
}
|
|
558
|
-
function createElementTypeChecker() {
|
|
559
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
560
|
-
var propValue = props[propName];
|
|
561
|
-
if (!isValidElement5(propValue)) {
|
|
562
|
-
var propType = getPropType(propValue);
|
|
563
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
564
|
-
}
|
|
565
|
-
return null;
|
|
566
|
-
}
|
|
567
|
-
return createChainableTypeChecker(validate);
|
|
568
|
-
}
|
|
569
|
-
function createElementTypeTypeChecker() {
|
|
570
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
571
|
-
var propValue = props[propName];
|
|
572
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
573
|
-
var propType = getPropType(propValue);
|
|
574
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
575
|
-
}
|
|
576
|
-
return null;
|
|
577
|
-
}
|
|
578
|
-
return createChainableTypeChecker(validate);
|
|
579
|
-
}
|
|
580
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
581
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
582
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
583
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
584
|
-
var actualClassName = getClassName(props[propName]);
|
|
585
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
586
|
-
}
|
|
587
|
-
return null;
|
|
588
|
-
}
|
|
589
|
-
return createChainableTypeChecker(validate);
|
|
590
|
-
}
|
|
591
|
-
function createEnumTypeChecker(expectedValues) {
|
|
592
|
-
if (!Array.isArray(expectedValues)) {
|
|
593
|
-
{
|
|
594
|
-
if (arguments.length > 1) {
|
|
595
|
-
printWarning(
|
|
596
|
-
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
597
|
-
);
|
|
598
|
-
} else {
|
|
599
|
-
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
return emptyFunctionThatReturnsNull;
|
|
603
|
-
}
|
|
604
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
605
|
-
var propValue = props[propName];
|
|
606
|
-
for (var i3 = 0; i3 < expectedValues.length; i3++) {
|
|
607
|
-
if (is(propValue, expectedValues[i3])) {
|
|
608
|
-
return null;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
612
|
-
var type = getPreciseType(value);
|
|
613
|
-
if (type === "symbol") {
|
|
614
|
-
return String(value);
|
|
615
|
-
}
|
|
616
|
-
return value;
|
|
617
|
-
});
|
|
618
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
619
|
-
}
|
|
620
|
-
return createChainableTypeChecker(validate);
|
|
621
|
-
}
|
|
622
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
623
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
624
|
-
if (typeof typeChecker !== "function") {
|
|
625
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
626
|
-
}
|
|
627
|
-
var propValue = props[propName];
|
|
628
|
-
var propType = getPropType(propValue);
|
|
629
|
-
if (propType !== "object") {
|
|
630
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
631
|
-
}
|
|
632
|
-
for (var key in propValue) {
|
|
633
|
-
if (has(propValue, key)) {
|
|
634
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
635
|
-
if (error instanceof Error) {
|
|
636
|
-
return error;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
return null;
|
|
641
|
-
}
|
|
642
|
-
return createChainableTypeChecker(validate);
|
|
643
|
-
}
|
|
644
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
645
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
646
|
-
printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") ;
|
|
647
|
-
return emptyFunctionThatReturnsNull;
|
|
648
|
-
}
|
|
649
|
-
for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) {
|
|
650
|
-
var checker = arrayOfTypeCheckers[i3];
|
|
651
|
-
if (typeof checker !== "function") {
|
|
652
|
-
printWarning(
|
|
653
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i3 + "."
|
|
654
|
-
);
|
|
655
|
-
return emptyFunctionThatReturnsNull;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
659
|
-
var expectedTypes = [];
|
|
660
|
-
for (var i4 = 0; i4 < arrayOfTypeCheckers.length; i4++) {
|
|
661
|
-
var checker2 = arrayOfTypeCheckers[i4];
|
|
662
|
-
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
663
|
-
if (checkerResult == null) {
|
|
664
|
-
return null;
|
|
665
|
-
}
|
|
666
|
-
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
667
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
671
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
672
|
-
}
|
|
673
|
-
return createChainableTypeChecker(validate);
|
|
674
|
-
}
|
|
675
|
-
function createNodeChecker() {
|
|
676
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
677
|
-
if (!isNode(props[propName])) {
|
|
678
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
679
|
-
}
|
|
680
|
-
return null;
|
|
681
|
-
}
|
|
682
|
-
return createChainableTypeChecker(validate);
|
|
683
|
-
}
|
|
684
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
685
|
-
return new PropTypeError(
|
|
686
|
-
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
687
|
-
);
|
|
688
|
-
}
|
|
689
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
690
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
691
|
-
var propValue = props[propName];
|
|
692
|
-
var propType = getPropType(propValue);
|
|
693
|
-
if (propType !== "object") {
|
|
694
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
695
|
-
}
|
|
696
|
-
for (var key in shapeTypes) {
|
|
697
|
-
var checker = shapeTypes[key];
|
|
698
|
-
if (typeof checker !== "function") {
|
|
699
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
700
|
-
}
|
|
701
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
702
|
-
if (error) {
|
|
703
|
-
return error;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
|
-
return createChainableTypeChecker(validate);
|
|
709
|
-
}
|
|
710
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
711
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
712
|
-
var propValue = props[propName];
|
|
713
|
-
var propType = getPropType(propValue);
|
|
714
|
-
if (propType !== "object") {
|
|
715
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
716
|
-
}
|
|
717
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
718
|
-
for (var key in allKeys) {
|
|
719
|
-
var checker = shapeTypes[key];
|
|
720
|
-
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
721
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
722
|
-
}
|
|
723
|
-
if (!checker) {
|
|
724
|
-
return new PropTypeError(
|
|
725
|
-
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
729
|
-
if (error) {
|
|
730
|
-
return error;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
return null;
|
|
734
|
-
}
|
|
735
|
-
return createChainableTypeChecker(validate);
|
|
736
|
-
}
|
|
737
|
-
function isNode(propValue) {
|
|
738
|
-
switch (typeof propValue) {
|
|
739
|
-
case "number":
|
|
740
|
-
case "string":
|
|
741
|
-
case "undefined":
|
|
742
|
-
return true;
|
|
743
|
-
case "boolean":
|
|
744
|
-
return !propValue;
|
|
745
|
-
case "object":
|
|
746
|
-
if (Array.isArray(propValue)) {
|
|
747
|
-
return propValue.every(isNode);
|
|
748
|
-
}
|
|
749
|
-
if (propValue === null || isValidElement5(propValue)) {
|
|
750
|
-
return true;
|
|
751
|
-
}
|
|
752
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
753
|
-
if (iteratorFn) {
|
|
754
|
-
var iterator = iteratorFn.call(propValue);
|
|
755
|
-
var step;
|
|
756
|
-
if (iteratorFn !== propValue.entries) {
|
|
757
|
-
while (!(step = iterator.next()).done) {
|
|
758
|
-
if (!isNode(step.value)) {
|
|
759
|
-
return false;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
} else {
|
|
763
|
-
while (!(step = iterator.next()).done) {
|
|
764
|
-
var entry = step.value;
|
|
765
|
-
if (entry) {
|
|
766
|
-
if (!isNode(entry[1])) {
|
|
767
|
-
return false;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
} else {
|
|
773
|
-
return false;
|
|
774
|
-
}
|
|
775
|
-
return true;
|
|
776
|
-
default:
|
|
777
|
-
return false;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
function isSymbol(propType, propValue) {
|
|
781
|
-
if (propType === "symbol") {
|
|
782
|
-
return true;
|
|
783
|
-
}
|
|
784
|
-
if (!propValue) {
|
|
785
|
-
return false;
|
|
786
|
-
}
|
|
787
|
-
if (propValue["@@toStringTag"] === "Symbol") {
|
|
788
|
-
return true;
|
|
789
|
-
}
|
|
790
|
-
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
791
|
-
return true;
|
|
792
|
-
}
|
|
793
|
-
return false;
|
|
794
|
-
}
|
|
795
|
-
function getPropType(propValue) {
|
|
796
|
-
var propType = typeof propValue;
|
|
797
|
-
if (Array.isArray(propValue)) {
|
|
798
|
-
return "array";
|
|
799
|
-
}
|
|
800
|
-
if (propValue instanceof RegExp) {
|
|
801
|
-
return "object";
|
|
802
|
-
}
|
|
803
|
-
if (isSymbol(propType, propValue)) {
|
|
804
|
-
return "symbol";
|
|
805
|
-
}
|
|
806
|
-
return propType;
|
|
807
|
-
}
|
|
808
|
-
function getPreciseType(propValue) {
|
|
809
|
-
if (typeof propValue === "undefined" || propValue === null) {
|
|
810
|
-
return "" + propValue;
|
|
811
|
-
}
|
|
812
|
-
var propType = getPropType(propValue);
|
|
813
|
-
if (propType === "object") {
|
|
814
|
-
if (propValue instanceof Date) {
|
|
815
|
-
return "date";
|
|
816
|
-
} else if (propValue instanceof RegExp) {
|
|
817
|
-
return "regexp";
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
return propType;
|
|
821
|
-
}
|
|
822
|
-
function getPostfixForTypeWarning(value) {
|
|
823
|
-
var type = getPreciseType(value);
|
|
824
|
-
switch (type) {
|
|
825
|
-
case "array":
|
|
826
|
-
case "object":
|
|
827
|
-
return "an " + type;
|
|
828
|
-
case "boolean":
|
|
829
|
-
case "date":
|
|
830
|
-
case "regexp":
|
|
831
|
-
return "a " + type;
|
|
832
|
-
default:
|
|
833
|
-
return type;
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
function getClassName(propValue) {
|
|
837
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
838
|
-
return ANONYMOUS;
|
|
839
|
-
}
|
|
840
|
-
return propValue.constructor.name;
|
|
841
|
-
}
|
|
842
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
843
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
844
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
845
|
-
return ReactPropTypes;
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
});
|
|
849
|
-
|
|
850
|
-
// ../../node_modules/prop-types/index.js
|
|
851
|
-
var require_prop_types = __commonJS({
|
|
852
|
-
"../../node_modules/prop-types/index.js"(exports$1, module2) {
|
|
853
|
-
{
|
|
854
|
-
ReactIs = require_react_is();
|
|
855
|
-
throwOnDirectAccess = true;
|
|
856
|
-
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
857
|
-
}
|
|
858
|
-
var ReactIs;
|
|
859
|
-
var throwOnDirectAccess;
|
|
860
|
-
}
|
|
861
|
-
});
|
|
862
|
-
|
|
863
|
-
// ../../node_modules/clsx/dist/clsx.js
|
|
864
|
-
var require_clsx = __commonJS({
|
|
865
|
-
"../../node_modules/clsx/dist/clsx.js"(exports$1, module2) {
|
|
866
|
-
function r5(e5) {
|
|
867
|
-
var o3, t4, f2 = "";
|
|
868
|
-
if ("string" == typeof e5 || "number" == typeof e5) f2 += e5;
|
|
869
|
-
else if ("object" == typeof e5) if (Array.isArray(e5)) {
|
|
870
|
-
var n3 = e5.length;
|
|
871
|
-
for (o3 = 0; o3 < n3; o3++) e5[o3] && (t4 = r5(e5[o3])) && (f2 && (f2 += " "), f2 += t4);
|
|
872
|
-
} else for (t4 in e5) e5[t4] && (f2 && (f2 += " "), f2 += t4);
|
|
873
|
-
return f2;
|
|
874
|
-
}
|
|
875
|
-
function e4() {
|
|
876
|
-
for (var e5, o3, t4 = 0, f2 = "", n3 = arguments.length; t4 < n3; t4++) (e5 = arguments[t4]) && (o3 = r5(e5)) && (f2 && (f2 += " "), f2 += o3);
|
|
877
|
-
return f2;
|
|
878
|
-
}
|
|
879
|
-
module2.exports = e4, module2.exports.clsx = e4;
|
|
880
|
-
}
|
|
881
|
-
});
|
|
882
|
-
|
|
883
|
-
// ../../node_modules/react-draggable/build/cjs/utils/shims.js
|
|
884
|
-
var require_shims = __commonJS({
|
|
885
|
-
"../../node_modules/react-draggable/build/cjs/utils/shims.js"(exports$1) {
|
|
886
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
887
|
-
value: true
|
|
888
|
-
});
|
|
889
|
-
exports$1.dontSetMe = dontSetMe;
|
|
890
|
-
exports$1.findInArray = findInArray;
|
|
891
|
-
exports$1.int = int;
|
|
892
|
-
exports$1.isFunction = isFunction;
|
|
893
|
-
exports$1.isNum = isNum;
|
|
894
|
-
function findInArray(array, callback) {
|
|
895
|
-
for (let i3 = 0, length = array.length; i3 < length; i3++) {
|
|
896
|
-
if (callback.apply(callback, [array[i3], i3, array])) return array[i3];
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
function isFunction(func) {
|
|
900
|
-
return typeof func === "function" || Object.prototype.toString.call(func) === "[object Function]";
|
|
901
|
-
}
|
|
902
|
-
function isNum(num) {
|
|
903
|
-
return typeof num === "number" && !isNaN(num);
|
|
904
|
-
}
|
|
905
|
-
function int(a3) {
|
|
906
|
-
return parseInt(a3, 10);
|
|
907
|
-
}
|
|
908
|
-
function dontSetMe(props, propName, componentName) {
|
|
909
|
-
if (props[propName]) {
|
|
910
|
-
return new Error(`Invalid prop ${propName} passed to ${componentName} - do not set this, set it on the child.`);
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
|
|
916
|
-
// ../../node_modules/react-draggable/build/cjs/utils/getPrefix.js
|
|
917
|
-
var require_getPrefix = __commonJS({
|
|
918
|
-
"../../node_modules/react-draggable/build/cjs/utils/getPrefix.js"(exports$1) {
|
|
919
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
920
|
-
value: true
|
|
921
|
-
});
|
|
922
|
-
exports$1.browserPrefixToKey = browserPrefixToKey;
|
|
923
|
-
exports$1.browserPrefixToStyle = browserPrefixToStyle;
|
|
924
|
-
exports$1.default = void 0;
|
|
925
|
-
exports$1.getPrefix = getPrefix;
|
|
926
|
-
var prefixes = ["Moz", "Webkit", "O", "ms"];
|
|
927
|
-
function getPrefix() {
|
|
928
|
-
var _a, _b;
|
|
929
|
-
let prop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
930
|
-
if (typeof window === "undefined") return "";
|
|
931
|
-
const style = (_b = (_a = window.document) == null ? void 0 : _a.documentElement) == null ? void 0 : _b.style;
|
|
932
|
-
if (!style) return "";
|
|
933
|
-
if (prop in style) return "";
|
|
934
|
-
for (let i3 = 0; i3 < prefixes.length; i3++) {
|
|
935
|
-
if (browserPrefixToKey(prop, prefixes[i3]) in style) return prefixes[i3];
|
|
936
|
-
}
|
|
937
|
-
return "";
|
|
938
|
-
}
|
|
939
|
-
function browserPrefixToKey(prop, prefix) {
|
|
940
|
-
return prefix ? `${prefix}${kebabToTitleCase(prop)}` : prop;
|
|
941
|
-
}
|
|
942
|
-
function browserPrefixToStyle(prop, prefix) {
|
|
943
|
-
return prefix ? `-${prefix.toLowerCase()}-${prop}` : prop;
|
|
944
|
-
}
|
|
945
|
-
function kebabToTitleCase(str) {
|
|
946
|
-
let out = "";
|
|
947
|
-
let shouldCapitalize = true;
|
|
948
|
-
for (let i3 = 0; i3 < str.length; i3++) {
|
|
949
|
-
if (shouldCapitalize) {
|
|
950
|
-
out += str[i3].toUpperCase();
|
|
951
|
-
shouldCapitalize = false;
|
|
952
|
-
} else if (str[i3] === "-") {
|
|
953
|
-
shouldCapitalize = true;
|
|
954
|
-
} else {
|
|
955
|
-
out += str[i3];
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
return out;
|
|
959
|
-
}
|
|
960
|
-
exports$1.default = getPrefix();
|
|
961
|
-
}
|
|
962
|
-
});
|
|
963
|
-
|
|
964
|
-
// ../../node_modules/react-draggable/build/cjs/utils/domFns.js
|
|
965
|
-
var require_domFns = __commonJS({
|
|
966
|
-
"../../node_modules/react-draggable/build/cjs/utils/domFns.js"(exports$1) {
|
|
967
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
968
|
-
value: true
|
|
969
|
-
});
|
|
970
|
-
exports$1.addClassName = addClassName;
|
|
971
|
-
exports$1.addEvent = addEvent;
|
|
972
|
-
exports$1.addUserSelectStyles = addUserSelectStyles;
|
|
973
|
-
exports$1.createCSSTransform = createCSSTransform;
|
|
974
|
-
exports$1.createSVGTransform = createSVGTransform;
|
|
975
|
-
exports$1.getTouch = getTouch;
|
|
976
|
-
exports$1.getTouchIdentifier = getTouchIdentifier;
|
|
977
|
-
exports$1.getTranslation = getTranslation;
|
|
978
|
-
exports$1.innerHeight = innerHeight;
|
|
979
|
-
exports$1.innerWidth = innerWidth;
|
|
980
|
-
exports$1.matchesSelector = matchesSelector;
|
|
981
|
-
exports$1.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
|
|
982
|
-
exports$1.offsetXYFromParent = offsetXYFromParent;
|
|
983
|
-
exports$1.outerHeight = outerHeight;
|
|
984
|
-
exports$1.outerWidth = outerWidth;
|
|
985
|
-
exports$1.removeClassName = removeClassName;
|
|
986
|
-
exports$1.removeEvent = removeEvent;
|
|
987
|
-
exports$1.scheduleRemoveUserSelectStyles = scheduleRemoveUserSelectStyles;
|
|
988
|
-
var _shims = require_shims();
|
|
989
|
-
var _getPrefix = _interopRequireWildcard(require_getPrefix());
|
|
990
|
-
function _interopRequireWildcard(e4, t4) {
|
|
991
|
-
if ("function" == typeof WeakMap) var r5 = /* @__PURE__ */ new WeakMap(), n3 = /* @__PURE__ */ new WeakMap();
|
|
992
|
-
return (_interopRequireWildcard = function(e5, t5) {
|
|
993
|
-
if (!t5 && e5 && e5.__esModule) return e5;
|
|
994
|
-
var o3, i3, f2 = { __proto__: null, default: e5 };
|
|
995
|
-
if (null === e5 || "object" != typeof e5 && "function" != typeof e5) return f2;
|
|
996
|
-
if (o3 = t5 ? n3 : r5) {
|
|
997
|
-
if (o3.has(e5)) return o3.get(e5);
|
|
998
|
-
o3.set(e5, f2);
|
|
999
|
-
}
|
|
1000
|
-
for (const t6 in e5) "default" !== t6 && {}.hasOwnProperty.call(e5, t6) && ((i3 = (o3 = Object.defineProperty) && Object.getOwnPropertyDescriptor(e5, t6)) && (i3.get || i3.set) ? o3(f2, t6, i3) : f2[t6] = e5[t6]);
|
|
1001
|
-
return f2;
|
|
1002
|
-
})(e4, t4);
|
|
1003
|
-
}
|
|
1004
|
-
var matchesSelectorFunc = "";
|
|
1005
|
-
function matchesSelector(el, selector) {
|
|
1006
|
-
if (!matchesSelectorFunc) {
|
|
1007
|
-
matchesSelectorFunc = (0, _shims.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(method) {
|
|
1008
|
-
return (0, _shims.isFunction)(el[method]);
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;
|
|
1012
|
-
return el[matchesSelectorFunc](selector);
|
|
1013
|
-
}
|
|
1014
|
-
function matchesSelectorAndParentsTo(el, selector, baseNode) {
|
|
1015
|
-
let node = el;
|
|
1016
|
-
do {
|
|
1017
|
-
if (matchesSelector(node, selector)) return true;
|
|
1018
|
-
if (node === baseNode) return false;
|
|
1019
|
-
node = node.parentNode;
|
|
1020
|
-
} while (node);
|
|
1021
|
-
return false;
|
|
1022
|
-
}
|
|
1023
|
-
function addEvent(el, event, handler, inputOptions) {
|
|
1024
|
-
if (!el) return;
|
|
1025
|
-
const options = {
|
|
1026
|
-
capture: true,
|
|
1027
|
-
...inputOptions
|
|
1028
|
-
};
|
|
1029
|
-
if (el.addEventListener) {
|
|
1030
|
-
el.addEventListener(event, handler, options);
|
|
1031
|
-
} else if (el.attachEvent) {
|
|
1032
|
-
el.attachEvent("on" + event, handler);
|
|
1033
|
-
} else {
|
|
1034
|
-
el["on" + event] = handler;
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
function removeEvent(el, event, handler, inputOptions) {
|
|
1038
|
-
if (!el) return;
|
|
1039
|
-
const options = {
|
|
1040
|
-
capture: true,
|
|
1041
|
-
...inputOptions
|
|
1042
|
-
};
|
|
1043
|
-
if (el.removeEventListener) {
|
|
1044
|
-
el.removeEventListener(event, handler, options);
|
|
1045
|
-
} else if (el.detachEvent) {
|
|
1046
|
-
el.detachEvent("on" + event, handler);
|
|
1047
|
-
} else {
|
|
1048
|
-
el["on" + event] = null;
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
function outerHeight(node) {
|
|
1052
|
-
let height = node.clientHeight;
|
|
1053
|
-
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1054
|
-
height += (0, _shims.int)(computedStyle.borderTopWidth);
|
|
1055
|
-
height += (0, _shims.int)(computedStyle.borderBottomWidth);
|
|
1056
|
-
return height;
|
|
1057
|
-
}
|
|
1058
|
-
function outerWidth(node) {
|
|
1059
|
-
let width = node.clientWidth;
|
|
1060
|
-
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1061
|
-
width += (0, _shims.int)(computedStyle.borderLeftWidth);
|
|
1062
|
-
width += (0, _shims.int)(computedStyle.borderRightWidth);
|
|
1063
|
-
return width;
|
|
1064
|
-
}
|
|
1065
|
-
function innerHeight(node) {
|
|
1066
|
-
let height = node.clientHeight;
|
|
1067
|
-
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1068
|
-
height -= (0, _shims.int)(computedStyle.paddingTop);
|
|
1069
|
-
height -= (0, _shims.int)(computedStyle.paddingBottom);
|
|
1070
|
-
return height;
|
|
1071
|
-
}
|
|
1072
|
-
function innerWidth(node) {
|
|
1073
|
-
let width = node.clientWidth;
|
|
1074
|
-
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1075
|
-
width -= (0, _shims.int)(computedStyle.paddingLeft);
|
|
1076
|
-
width -= (0, _shims.int)(computedStyle.paddingRight);
|
|
1077
|
-
return width;
|
|
1078
|
-
}
|
|
1079
|
-
function offsetXYFromParent(evt, offsetParent, scale) {
|
|
1080
|
-
const isBody = offsetParent === offsetParent.ownerDocument.body;
|
|
1081
|
-
const offsetParentRect = isBody ? {
|
|
1082
|
-
left: 0,
|
|
1083
|
-
top: 0
|
|
1084
|
-
} : offsetParent.getBoundingClientRect();
|
|
1085
|
-
const x2 = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
|
|
1086
|
-
const y2 = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
|
|
1087
|
-
return {
|
|
1088
|
-
x: x2,
|
|
1089
|
-
y: y2
|
|
1090
|
-
};
|
|
1091
|
-
}
|
|
1092
|
-
function createCSSTransform(controlPos, positionOffset) {
|
|
1093
|
-
const translation = getTranslation(controlPos, positionOffset, "px");
|
|
1094
|
-
return {
|
|
1095
|
-
[(0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default)]: translation
|
|
1096
|
-
};
|
|
1097
|
-
}
|
|
1098
|
-
function createSVGTransform(controlPos, positionOffset) {
|
|
1099
|
-
const translation = getTranslation(controlPos, positionOffset, "");
|
|
1100
|
-
return translation;
|
|
1101
|
-
}
|
|
1102
|
-
function getTranslation(_ref, positionOffset, unitSuffix) {
|
|
1103
|
-
let {
|
|
1104
|
-
x: x2,
|
|
1105
|
-
y: y2
|
|
1106
|
-
} = _ref;
|
|
1107
|
-
let translation = `translate(${x2}${unitSuffix},${y2}${unitSuffix})`;
|
|
1108
|
-
if (positionOffset) {
|
|
1109
|
-
const defaultX = `${typeof positionOffset.x === "string" ? positionOffset.x : positionOffset.x + unitSuffix}`;
|
|
1110
|
-
const defaultY = `${typeof positionOffset.y === "string" ? positionOffset.y : positionOffset.y + unitSuffix}`;
|
|
1111
|
-
translation = `translate(${defaultX}, ${defaultY})` + translation;
|
|
1112
|
-
}
|
|
1113
|
-
return translation;
|
|
1114
|
-
}
|
|
1115
|
-
function getTouch(e4, identifier) {
|
|
1116
|
-
return e4.targetTouches && (0, _shims.findInArray)(e4.targetTouches, (t4) => identifier === t4.identifier) || e4.changedTouches && (0, _shims.findInArray)(e4.changedTouches, (t4) => identifier === t4.identifier);
|
|
1117
|
-
}
|
|
1118
|
-
function getTouchIdentifier(e4) {
|
|
1119
|
-
if (e4.targetTouches && e4.targetTouches[0]) return e4.targetTouches[0].identifier;
|
|
1120
|
-
if (e4.changedTouches && e4.changedTouches[0]) return e4.changedTouches[0].identifier;
|
|
1121
|
-
}
|
|
1122
|
-
function addUserSelectStyles(doc) {
|
|
1123
|
-
if (!doc) return;
|
|
1124
|
-
let styleEl = doc.getElementById("react-draggable-style-el");
|
|
1125
|
-
if (!styleEl) {
|
|
1126
|
-
styleEl = doc.createElement("style");
|
|
1127
|
-
styleEl.type = "text/css";
|
|
1128
|
-
styleEl.id = "react-draggable-style-el";
|
|
1129
|
-
styleEl.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n";
|
|
1130
|
-
styleEl.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n";
|
|
1131
|
-
doc.getElementsByTagName("head")[0].appendChild(styleEl);
|
|
1132
|
-
}
|
|
1133
|
-
if (doc.body) addClassName(doc.body, "react-draggable-transparent-selection");
|
|
1134
|
-
}
|
|
1135
|
-
function scheduleRemoveUserSelectStyles(doc) {
|
|
1136
|
-
if (window.requestAnimationFrame) {
|
|
1137
|
-
window.requestAnimationFrame(() => {
|
|
1138
|
-
removeUserSelectStyles(doc);
|
|
1139
|
-
});
|
|
1140
|
-
} else {
|
|
1141
|
-
removeUserSelectStyles(doc);
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
function removeUserSelectStyles(doc) {
|
|
1145
|
-
if (!doc) return;
|
|
1146
|
-
try {
|
|
1147
|
-
if (doc.body) removeClassName(doc.body, "react-draggable-transparent-selection");
|
|
1148
|
-
if (doc.selection) {
|
|
1149
|
-
doc.selection.empty();
|
|
1150
|
-
} else {
|
|
1151
|
-
const selection = (doc.defaultView || window).getSelection();
|
|
1152
|
-
if (selection && selection.type !== "Caret") {
|
|
1153
|
-
selection.removeAllRanges();
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
} catch (e4) {
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
function addClassName(el, className) {
|
|
1160
|
-
if (el.classList) {
|
|
1161
|
-
el.classList.add(className);
|
|
1162
|
-
} else {
|
|
1163
|
-
if (!el.className.match(new RegExp(`(?:^|\\s)${className}(?!\\S)`))) {
|
|
1164
|
-
el.className += ` ${className}`;
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
function removeClassName(el, className) {
|
|
1169
|
-
if (el.classList) {
|
|
1170
|
-
el.classList.remove(className);
|
|
1171
|
-
} else {
|
|
1172
|
-
el.className = el.className.replace(new RegExp(`(?:^|\\s)${className}(?!\\S)`, "g"), "");
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
|
|
1178
|
-
// ../../node_modules/react-draggable/build/cjs/utils/positionFns.js
|
|
1179
|
-
var require_positionFns = __commonJS({
|
|
1180
|
-
"../../node_modules/react-draggable/build/cjs/utils/positionFns.js"(exports$1) {
|
|
1181
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
1182
|
-
value: true
|
|
1183
|
-
});
|
|
1184
|
-
exports$1.canDragX = canDragX;
|
|
1185
|
-
exports$1.canDragY = canDragY;
|
|
1186
|
-
exports$1.createCoreData = createCoreData;
|
|
1187
|
-
exports$1.createDraggableData = createDraggableData;
|
|
1188
|
-
exports$1.getBoundPosition = getBoundPosition;
|
|
1189
|
-
exports$1.getControlPosition = getControlPosition;
|
|
1190
|
-
exports$1.snapToGrid = snapToGrid;
|
|
1191
|
-
var _shims = require_shims();
|
|
1192
|
-
var _domFns = require_domFns();
|
|
1193
|
-
function getBoundPosition(draggable, x2, y2) {
|
|
1194
|
-
if (!draggable.props.bounds) return [x2, y2];
|
|
1195
|
-
let {
|
|
1196
|
-
bounds
|
|
1197
|
-
} = draggable.props;
|
|
1198
|
-
bounds = typeof bounds === "string" ? bounds : cloneBounds(bounds);
|
|
1199
|
-
const node = findDOMNode(draggable);
|
|
1200
|
-
if (typeof bounds === "string") {
|
|
1201
|
-
const {
|
|
1202
|
-
ownerDocument
|
|
1203
|
-
} = node;
|
|
1204
|
-
const ownerWindow = ownerDocument.defaultView;
|
|
1205
|
-
let boundNode;
|
|
1206
|
-
if (bounds === "parent") {
|
|
1207
|
-
boundNode = node.parentNode;
|
|
1208
|
-
} else {
|
|
1209
|
-
const rootNode = node.getRootNode();
|
|
1210
|
-
boundNode = rootNode.querySelector(bounds);
|
|
1211
|
-
}
|
|
1212
|
-
if (!(boundNode instanceof ownerWindow.HTMLElement)) {
|
|
1213
|
-
throw new Error('Bounds selector "' + bounds + '" could not find an element.');
|
|
1214
|
-
}
|
|
1215
|
-
const boundNodeEl = boundNode;
|
|
1216
|
-
const nodeStyle = ownerWindow.getComputedStyle(node);
|
|
1217
|
-
const boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl);
|
|
1218
|
-
bounds = {
|
|
1219
|
-
left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
|
|
1220
|
-
top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
|
|
1221
|
-
right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
|
|
1222
|
-
bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
if ((0, _shims.isNum)(bounds.right)) x2 = Math.min(x2, bounds.right);
|
|
1226
|
-
if ((0, _shims.isNum)(bounds.bottom)) y2 = Math.min(y2, bounds.bottom);
|
|
1227
|
-
if ((0, _shims.isNum)(bounds.left)) x2 = Math.max(x2, bounds.left);
|
|
1228
|
-
if ((0, _shims.isNum)(bounds.top)) y2 = Math.max(y2, bounds.top);
|
|
1229
|
-
return [x2, y2];
|
|
1230
|
-
}
|
|
1231
|
-
function snapToGrid(grid, pendingX, pendingY) {
|
|
1232
|
-
const x2 = Math.round(pendingX / grid[0]) * grid[0];
|
|
1233
|
-
const y2 = Math.round(pendingY / grid[1]) * grid[1];
|
|
1234
|
-
return [x2, y2];
|
|
1235
|
-
}
|
|
1236
|
-
function canDragX(draggable) {
|
|
1237
|
-
return draggable.props.axis === "both" || draggable.props.axis === "x";
|
|
1238
|
-
}
|
|
1239
|
-
function canDragY(draggable) {
|
|
1240
|
-
return draggable.props.axis === "both" || draggable.props.axis === "y";
|
|
1241
|
-
}
|
|
1242
|
-
function getControlPosition(e4, touchIdentifier, draggableCore) {
|
|
1243
|
-
const touchObj = typeof touchIdentifier === "number" ? (0, _domFns.getTouch)(e4, touchIdentifier) : null;
|
|
1244
|
-
if (typeof touchIdentifier === "number" && !touchObj) return null;
|
|
1245
|
-
const node = findDOMNode(draggableCore);
|
|
1246
|
-
const offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
|
|
1247
|
-
return (0, _domFns.offsetXYFromParent)(touchObj || e4, offsetParent, draggableCore.props.scale);
|
|
1248
|
-
}
|
|
1249
|
-
function createCoreData(draggable, x2, y2) {
|
|
1250
|
-
const isStart = !(0, _shims.isNum)(draggable.lastX);
|
|
1251
|
-
const node = findDOMNode(draggable);
|
|
1252
|
-
if (isStart) {
|
|
1253
|
-
return {
|
|
1254
|
-
node,
|
|
1255
|
-
deltaX: 0,
|
|
1256
|
-
deltaY: 0,
|
|
1257
|
-
lastX: x2,
|
|
1258
|
-
lastY: y2,
|
|
1259
|
-
x: x2,
|
|
1260
|
-
y: y2
|
|
1261
|
-
};
|
|
1262
|
-
} else {
|
|
1263
|
-
return {
|
|
1264
|
-
node,
|
|
1265
|
-
deltaX: x2 - draggable.lastX,
|
|
1266
|
-
deltaY: y2 - draggable.lastY,
|
|
1267
|
-
lastX: draggable.lastX,
|
|
1268
|
-
lastY: draggable.lastY,
|
|
1269
|
-
x: x2,
|
|
1270
|
-
y: y2
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
function createDraggableData(draggable, coreData) {
|
|
1275
|
-
const scale = draggable.props.scale;
|
|
1276
|
-
return {
|
|
1277
|
-
node: coreData.node,
|
|
1278
|
-
x: draggable.state.x + coreData.deltaX / scale,
|
|
1279
|
-
y: draggable.state.y + coreData.deltaY / scale,
|
|
1280
|
-
deltaX: coreData.deltaX / scale,
|
|
1281
|
-
deltaY: coreData.deltaY / scale,
|
|
1282
|
-
lastX: draggable.state.x,
|
|
1283
|
-
lastY: draggable.state.y
|
|
1284
|
-
};
|
|
1285
|
-
}
|
|
1286
|
-
function cloneBounds(bounds) {
|
|
1287
|
-
return {
|
|
1288
|
-
left: bounds.left,
|
|
1289
|
-
top: bounds.top,
|
|
1290
|
-
right: bounds.right,
|
|
1291
|
-
bottom: bounds.bottom
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
function findDOMNode(draggable) {
|
|
1295
|
-
const node = draggable.findDOMNode();
|
|
1296
|
-
if (!node) {
|
|
1297
|
-
throw new Error("<DraggableCore>: Unmounted during event!");
|
|
1298
|
-
}
|
|
1299
|
-
return node;
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
});
|
|
1303
|
-
|
|
1304
|
-
// ../../node_modules/react-draggable/build/cjs/utils/log.js
|
|
1305
|
-
var require_log = __commonJS({
|
|
1306
|
-
"../../node_modules/react-draggable/build/cjs/utils/log.js"(exports$1) {
|
|
1307
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
1308
|
-
value: true
|
|
1309
|
-
});
|
|
1310
|
-
exports$1.default = log;
|
|
1311
|
-
function log() {
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
});
|
|
1315
|
-
|
|
1316
|
-
// ../../node_modules/react-draggable/build/cjs/DraggableCore.js
|
|
1317
|
-
var require_DraggableCore = __commonJS({
|
|
1318
|
-
"../../node_modules/react-draggable/build/cjs/DraggableCore.js"(exports$1) {
|
|
1319
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
1320
|
-
value: true
|
|
1321
|
-
});
|
|
1322
|
-
exports$1.default = void 0;
|
|
1323
|
-
var React73 = _interopRequireWildcard(__require("react"));
|
|
1324
|
-
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
1325
|
-
var _reactDom = _interopRequireDefault(__require("react-dom"));
|
|
1326
|
-
var _domFns = require_domFns();
|
|
1327
|
-
var _positionFns = require_positionFns();
|
|
1328
|
-
var _shims = require_shims();
|
|
1329
|
-
var _log = _interopRequireDefault(require_log());
|
|
1330
|
-
function _interopRequireDefault(e4) {
|
|
1331
|
-
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
1332
|
-
}
|
|
1333
|
-
function _interopRequireWildcard(e4, t4) {
|
|
1334
|
-
if ("function" == typeof WeakMap) var r5 = /* @__PURE__ */ new WeakMap(), n3 = /* @__PURE__ */ new WeakMap();
|
|
1335
|
-
return (_interopRequireWildcard = function(e5, t5) {
|
|
1336
|
-
if (!t5 && e5 && e5.__esModule) return e5;
|
|
1337
|
-
var o3, i3, f2 = { __proto__: null, default: e5 };
|
|
1338
|
-
if (null === e5 || "object" != typeof e5 && "function" != typeof e5) return f2;
|
|
1339
|
-
if (o3 = t5 ? n3 : r5) {
|
|
1340
|
-
if (o3.has(e5)) return o3.get(e5);
|
|
1341
|
-
o3.set(e5, f2);
|
|
1342
|
-
}
|
|
1343
|
-
for (const t6 in e5) "default" !== t6 && {}.hasOwnProperty.call(e5, t6) && ((i3 = (o3 = Object.defineProperty) && Object.getOwnPropertyDescriptor(e5, t6)) && (i3.get || i3.set) ? o3(f2, t6, i3) : f2[t6] = e5[t6]);
|
|
1344
|
-
return f2;
|
|
1345
|
-
})(e4, t4);
|
|
1346
|
-
}
|
|
1347
|
-
function _defineProperty(e4, r5, t4) {
|
|
1348
|
-
return (r5 = _toPropertyKey(r5)) in e4 ? Object.defineProperty(e4, r5, { value: t4, enumerable: true, configurable: true, writable: true }) : e4[r5] = t4, e4;
|
|
1349
|
-
}
|
|
1350
|
-
function _toPropertyKey(t4) {
|
|
1351
|
-
var i3 = _toPrimitive(t4, "string");
|
|
1352
|
-
return "symbol" == typeof i3 ? i3 : i3 + "";
|
|
1353
|
-
}
|
|
1354
|
-
function _toPrimitive(t4, r5) {
|
|
1355
|
-
if ("object" != typeof t4 || !t4) return t4;
|
|
1356
|
-
var e4 = t4[Symbol.toPrimitive];
|
|
1357
|
-
if (void 0 !== e4) {
|
|
1358
|
-
var i3 = e4.call(t4, r5);
|
|
1359
|
-
if ("object" != typeof i3) return i3;
|
|
1360
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1361
|
-
}
|
|
1362
|
-
return ("string" === r5 ? String : Number)(t4);
|
|
1363
|
-
}
|
|
1364
|
-
var eventsFor = {
|
|
1365
|
-
touch: {
|
|
1366
|
-
start: "touchstart",
|
|
1367
|
-
move: "touchmove",
|
|
1368
|
-
stop: "touchend"
|
|
1369
|
-
},
|
|
1370
|
-
mouse: {
|
|
1371
|
-
start: "mousedown",
|
|
1372
|
-
move: "mousemove",
|
|
1373
|
-
stop: "mouseup"
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
var dragEventFor = eventsFor.mouse;
|
|
1377
|
-
var DraggableCore = class extends React73.Component {
|
|
1378
|
-
constructor() {
|
|
1379
|
-
super(...arguments);
|
|
1380
|
-
_defineProperty(this, "dragging", false);
|
|
1381
|
-
_defineProperty(this, "lastX", NaN);
|
|
1382
|
-
_defineProperty(this, "lastY", NaN);
|
|
1383
|
-
_defineProperty(this, "touchIdentifier", null);
|
|
1384
|
-
_defineProperty(this, "mounted", false);
|
|
1385
|
-
_defineProperty(this, "handleDragStart", (e4) => {
|
|
1386
|
-
this.props.onMouseDown(e4);
|
|
1387
|
-
if (!this.props.allowAnyClick && typeof e4.button === "number" && e4.button !== 0) return false;
|
|
1388
|
-
const thisNode = this.findDOMNode();
|
|
1389
|
-
if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
|
|
1390
|
-
throw new Error("<DraggableCore> not mounted on DragStart!");
|
|
1391
|
-
}
|
|
1392
|
-
const {
|
|
1393
|
-
ownerDocument
|
|
1394
|
-
} = thisNode;
|
|
1395
|
-
if (this.props.disabled || !(e4.target instanceof ownerDocument.defaultView.Node) || this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e4.target, this.props.handle, thisNode) || this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e4.target, this.props.cancel, thisNode)) {
|
|
1396
|
-
return;
|
|
1397
|
-
}
|
|
1398
|
-
if (e4.type === "touchstart" && !this.props.allowMobileScroll) e4.preventDefault();
|
|
1399
|
-
const touchIdentifier = (0, _domFns.getTouchIdentifier)(e4);
|
|
1400
|
-
this.touchIdentifier = touchIdentifier;
|
|
1401
|
-
const position = (0, _positionFns.getControlPosition)(e4, touchIdentifier, this);
|
|
1402
|
-
if (position == null) return;
|
|
1403
|
-
const {
|
|
1404
|
-
x: x2,
|
|
1405
|
-
y: y2
|
|
1406
|
-
} = position;
|
|
1407
|
-
const coreEvent = (0, _positionFns.createCoreData)(this, x2, y2);
|
|
1408
|
-
(0, _log.default)("DraggableCore: handleDragStart: %j", coreEvent);
|
|
1409
|
-
(0, _log.default)("calling", this.props.onStart);
|
|
1410
|
-
const shouldUpdate = this.props.onStart(e4, coreEvent);
|
|
1411
|
-
if (shouldUpdate === false || this.mounted === false) return;
|
|
1412
|
-
if (this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument);
|
|
1413
|
-
this.dragging = true;
|
|
1414
|
-
this.lastX = x2;
|
|
1415
|
-
this.lastY = y2;
|
|
1416
|
-
(0, _domFns.addEvent)(ownerDocument, dragEventFor.move, this.handleDrag);
|
|
1417
|
-
(0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, this.handleDragStop);
|
|
1418
|
-
});
|
|
1419
|
-
_defineProperty(this, "handleDrag", (e4) => {
|
|
1420
|
-
const position = (0, _positionFns.getControlPosition)(e4, this.touchIdentifier, this);
|
|
1421
|
-
if (position == null) return;
|
|
1422
|
-
let {
|
|
1423
|
-
x: x2,
|
|
1424
|
-
y: y2
|
|
1425
|
-
} = position;
|
|
1426
|
-
if (Array.isArray(this.props.grid)) {
|
|
1427
|
-
let deltaX = x2 - this.lastX, deltaY = y2 - this.lastY;
|
|
1428
|
-
[deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
|
|
1429
|
-
if (!deltaX && !deltaY) return;
|
|
1430
|
-
x2 = this.lastX + deltaX, y2 = this.lastY + deltaY;
|
|
1431
|
-
}
|
|
1432
|
-
const coreEvent = (0, _positionFns.createCoreData)(this, x2, y2);
|
|
1433
|
-
(0, _log.default)("DraggableCore: handleDrag: %j", coreEvent);
|
|
1434
|
-
const shouldUpdate = this.props.onDrag(e4, coreEvent);
|
|
1435
|
-
if (shouldUpdate === false || this.mounted === false) {
|
|
1436
|
-
try {
|
|
1437
|
-
this.handleDragStop(new MouseEvent("mouseup"));
|
|
1438
|
-
} catch (err) {
|
|
1439
|
-
const event = document.createEvent("MouseEvents");
|
|
1440
|
-
event.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
1441
|
-
this.handleDragStop(event);
|
|
1442
|
-
}
|
|
1443
|
-
return;
|
|
1444
|
-
}
|
|
1445
|
-
this.lastX = x2;
|
|
1446
|
-
this.lastY = y2;
|
|
1447
|
-
});
|
|
1448
|
-
_defineProperty(this, "handleDragStop", (e4) => {
|
|
1449
|
-
if (!this.dragging) return;
|
|
1450
|
-
const position = (0, _positionFns.getControlPosition)(e4, this.touchIdentifier, this);
|
|
1451
|
-
if (position == null) return;
|
|
1452
|
-
let {
|
|
1453
|
-
x: x2,
|
|
1454
|
-
y: y2
|
|
1455
|
-
} = position;
|
|
1456
|
-
if (Array.isArray(this.props.grid)) {
|
|
1457
|
-
let deltaX = x2 - this.lastX || 0;
|
|
1458
|
-
let deltaY = y2 - this.lastY || 0;
|
|
1459
|
-
[deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
|
|
1460
|
-
x2 = this.lastX + deltaX, y2 = this.lastY + deltaY;
|
|
1461
|
-
}
|
|
1462
|
-
const coreEvent = (0, _positionFns.createCoreData)(this, x2, y2);
|
|
1463
|
-
const shouldContinue = this.props.onStop(e4, coreEvent);
|
|
1464
|
-
if (shouldContinue === false || this.mounted === false) return false;
|
|
1465
|
-
const thisNode = this.findDOMNode();
|
|
1466
|
-
if (thisNode) {
|
|
1467
|
-
if (this.props.enableUserSelectHack) (0, _domFns.scheduleRemoveUserSelectStyles)(thisNode.ownerDocument);
|
|
1468
|
-
}
|
|
1469
|
-
(0, _log.default)("DraggableCore: handleDragStop: %j", coreEvent);
|
|
1470
|
-
this.dragging = false;
|
|
1471
|
-
this.lastX = NaN;
|
|
1472
|
-
this.lastY = NaN;
|
|
1473
|
-
if (thisNode) {
|
|
1474
|
-
(0, _log.default)("DraggableCore: Removing handlers");
|
|
1475
|
-
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, this.handleDrag);
|
|
1476
|
-
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, this.handleDragStop);
|
|
1477
|
-
}
|
|
1478
|
-
});
|
|
1479
|
-
_defineProperty(this, "onMouseDown", (e4) => {
|
|
1480
|
-
dragEventFor = eventsFor.mouse;
|
|
1481
|
-
return this.handleDragStart(e4);
|
|
1482
|
-
});
|
|
1483
|
-
_defineProperty(this, "onMouseUp", (e4) => {
|
|
1484
|
-
dragEventFor = eventsFor.mouse;
|
|
1485
|
-
return this.handleDragStop(e4);
|
|
1486
|
-
});
|
|
1487
|
-
_defineProperty(this, "onTouchStart", (e4) => {
|
|
1488
|
-
dragEventFor = eventsFor.touch;
|
|
1489
|
-
return this.handleDragStart(e4);
|
|
1490
|
-
});
|
|
1491
|
-
_defineProperty(this, "onTouchEnd", (e4) => {
|
|
1492
|
-
dragEventFor = eventsFor.touch;
|
|
1493
|
-
return this.handleDragStop(e4);
|
|
1494
|
-
});
|
|
1495
|
-
}
|
|
1496
|
-
componentDidMount() {
|
|
1497
|
-
this.mounted = true;
|
|
1498
|
-
const thisNode = this.findDOMNode();
|
|
1499
|
-
if (thisNode) {
|
|
1500
|
-
(0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
|
|
1501
|
-
passive: false
|
|
1502
|
-
});
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
componentWillUnmount() {
|
|
1506
|
-
this.mounted = false;
|
|
1507
|
-
const thisNode = this.findDOMNode();
|
|
1508
|
-
if (thisNode) {
|
|
1509
|
-
const {
|
|
1510
|
-
ownerDocument
|
|
1511
|
-
} = thisNode;
|
|
1512
|
-
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
|
|
1513
|
-
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
|
|
1514
|
-
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
|
|
1515
|
-
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
|
|
1516
|
-
(0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
|
|
1517
|
-
passive: false
|
|
1518
|
-
});
|
|
1519
|
-
if (this.props.enableUserSelectHack) (0, _domFns.scheduleRemoveUserSelectStyles)(ownerDocument);
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
1523
|
-
// the underlying DOM node ourselves. See the README for more information.
|
|
1524
|
-
findDOMNode() {
|
|
1525
|
-
var _a, _b, _c;
|
|
1526
|
-
return ((_a = this.props) == null ? void 0 : _a.nodeRef) ? (_c = (_b = this.props) == null ? void 0 : _b.nodeRef) == null ? void 0 : _c.current : _reactDom.default.findDOMNode(this);
|
|
1527
|
-
}
|
|
1528
|
-
render() {
|
|
1529
|
-
return /* @__PURE__ */ React73.cloneElement(React73.Children.only(this.props.children), {
|
|
1530
|
-
// Note: mouseMove handler is attached to document so it will still function
|
|
1531
|
-
// when the user drags quickly and leaves the bounds of the element.
|
|
1532
|
-
onMouseDown: this.onMouseDown,
|
|
1533
|
-
onMouseUp: this.onMouseUp,
|
|
1534
|
-
// onTouchStart is added on `componentDidMount` so they can be added with
|
|
1535
|
-
// {passive: false}, which allows it to cancel. See
|
|
1536
|
-
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
|
|
1537
|
-
onTouchEnd: this.onTouchEnd
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
};
|
|
1541
|
-
exports$1.default = DraggableCore;
|
|
1542
|
-
_defineProperty(DraggableCore, "displayName", "DraggableCore");
|
|
1543
|
-
_defineProperty(DraggableCore, "propTypes", {
|
|
1544
|
-
/**
|
|
1545
|
-
* `allowAnyClick` allows dragging using any mouse button.
|
|
1546
|
-
* By default, we only accept the left button.
|
|
1547
|
-
*
|
|
1548
|
-
* Defaults to `false`.
|
|
1549
|
-
*/
|
|
1550
|
-
allowAnyClick: _propTypes.default.bool,
|
|
1551
|
-
/**
|
|
1552
|
-
* `allowMobileScroll` turns off cancellation of the 'touchstart' event
|
|
1553
|
-
* on mobile devices. Only enable this if you are having trouble with click
|
|
1554
|
-
* events. Prefer using 'handle' / 'cancel' instead.
|
|
1555
|
-
*
|
|
1556
|
-
* Defaults to `false`.
|
|
1557
|
-
*/
|
|
1558
|
-
allowMobileScroll: _propTypes.default.bool,
|
|
1559
|
-
children: _propTypes.default.node.isRequired,
|
|
1560
|
-
/**
|
|
1561
|
-
* `disabled`, if true, stops the <Draggable> from dragging. All handlers,
|
|
1562
|
-
* with the exception of `onMouseDown`, will not fire.
|
|
1563
|
-
*/
|
|
1564
|
-
disabled: _propTypes.default.bool,
|
|
1565
|
-
/**
|
|
1566
|
-
* By default, we add 'user-select:none' attributes to the document body
|
|
1567
|
-
* to prevent ugly text selection during drag. If this is causing problems
|
|
1568
|
-
* for your app, set this to `false`.
|
|
1569
|
-
*/
|
|
1570
|
-
enableUserSelectHack: _propTypes.default.bool,
|
|
1571
|
-
/**
|
|
1572
|
-
* `offsetParent`, if set, uses the passed DOM node to compute drag offsets
|
|
1573
|
-
* instead of using the parent node.
|
|
1574
|
-
*/
|
|
1575
|
-
offsetParent: function(props, propName) {
|
|
1576
|
-
if (props[propName] && props[propName].nodeType !== 1) {
|
|
1577
|
-
throw new Error("Draggable's offsetParent must be a DOM Node.");
|
|
1578
|
-
}
|
|
1579
|
-
},
|
|
1580
|
-
/**
|
|
1581
|
-
* `grid` specifies the x and y that dragging should snap to.
|
|
1582
|
-
*/
|
|
1583
|
-
grid: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
1584
|
-
/**
|
|
1585
|
-
* `handle` specifies a selector to be used as the handle that initiates drag.
|
|
1586
|
-
*
|
|
1587
|
-
* Example:
|
|
1588
|
-
*
|
|
1589
|
-
* ```jsx
|
|
1590
|
-
* let App = React.createClass({
|
|
1591
|
-
* render: function () {
|
|
1592
|
-
* return (
|
|
1593
|
-
* <Draggable handle=".handle">
|
|
1594
|
-
* <div>
|
|
1595
|
-
* <div className="handle">Click me to drag</div>
|
|
1596
|
-
* <div>This is some other content</div>
|
|
1597
|
-
* </div>
|
|
1598
|
-
* </Draggable>
|
|
1599
|
-
* );
|
|
1600
|
-
* }
|
|
1601
|
-
* });
|
|
1602
|
-
* ```
|
|
1603
|
-
*/
|
|
1604
|
-
handle: _propTypes.default.string,
|
|
1605
|
-
/**
|
|
1606
|
-
* `cancel` specifies a selector to be used to prevent drag initialization.
|
|
1607
|
-
*
|
|
1608
|
-
* Example:
|
|
1609
|
-
*
|
|
1610
|
-
* ```jsx
|
|
1611
|
-
* let App = React.createClass({
|
|
1612
|
-
* render: function () {
|
|
1613
|
-
* return(
|
|
1614
|
-
* <Draggable cancel=".cancel">
|
|
1615
|
-
* <div>
|
|
1616
|
-
* <div className="cancel">You can't drag from here</div>
|
|
1617
|
-
* <div>Dragging here works fine</div>
|
|
1618
|
-
* </div>
|
|
1619
|
-
* </Draggable>
|
|
1620
|
-
* );
|
|
1621
|
-
* }
|
|
1622
|
-
* });
|
|
1623
|
-
* ```
|
|
1624
|
-
*/
|
|
1625
|
-
cancel: _propTypes.default.string,
|
|
1626
|
-
/* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
|
|
1627
|
-
* Unfortunately, in order for <Draggable> to work properly, we need raw access
|
|
1628
|
-
* to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
|
|
1629
|
-
* as in this example:
|
|
1630
|
-
*
|
|
1631
|
-
* function MyComponent() {
|
|
1632
|
-
* const nodeRef = React.useRef(null);
|
|
1633
|
-
* return (
|
|
1634
|
-
* <Draggable nodeRef={nodeRef}>
|
|
1635
|
-
* <div ref={nodeRef}>Example Target</div>
|
|
1636
|
-
* </Draggable>
|
|
1637
|
-
* );
|
|
1638
|
-
* }
|
|
1639
|
-
*
|
|
1640
|
-
* This can be used for arbitrarily nested components, so long as the ref ends up
|
|
1641
|
-
* pointing to the actual child DOM node and not a custom component.
|
|
1642
|
-
*/
|
|
1643
|
-
nodeRef: _propTypes.default.object,
|
|
1644
|
-
/**
|
|
1645
|
-
* Called when dragging starts.
|
|
1646
|
-
* If this function returns the boolean false, dragging will be canceled.
|
|
1647
|
-
*/
|
|
1648
|
-
onStart: _propTypes.default.func,
|
|
1649
|
-
/**
|
|
1650
|
-
* Called while dragging.
|
|
1651
|
-
* If this function returns the boolean false, dragging will be canceled.
|
|
1652
|
-
*/
|
|
1653
|
-
onDrag: _propTypes.default.func,
|
|
1654
|
-
/**
|
|
1655
|
-
* Called when dragging stops.
|
|
1656
|
-
* If this function returns the boolean false, the drag will remain active.
|
|
1657
|
-
*/
|
|
1658
|
-
onStop: _propTypes.default.func,
|
|
1659
|
-
/**
|
|
1660
|
-
* A workaround option which can be passed if onMouseDown needs to be accessed,
|
|
1661
|
-
* since it'll always be blocked (as there is internal use of onMouseDown)
|
|
1662
|
-
*/
|
|
1663
|
-
onMouseDown: _propTypes.default.func,
|
|
1664
|
-
/**
|
|
1665
|
-
* `scale`, if set, applies scaling while dragging an element
|
|
1666
|
-
*/
|
|
1667
|
-
scale: _propTypes.default.number,
|
|
1668
|
-
/**
|
|
1669
|
-
* These properties should be defined on the child, not here.
|
|
1670
|
-
*/
|
|
1671
|
-
className: _shims.dontSetMe,
|
|
1672
|
-
style: _shims.dontSetMe,
|
|
1673
|
-
transform: _shims.dontSetMe
|
|
1674
|
-
});
|
|
1675
|
-
_defineProperty(DraggableCore, "defaultProps", {
|
|
1676
|
-
allowAnyClick: false,
|
|
1677
|
-
// by default only accept left click
|
|
1678
|
-
allowMobileScroll: false,
|
|
1679
|
-
disabled: false,
|
|
1680
|
-
enableUserSelectHack: true,
|
|
1681
|
-
onStart: function() {
|
|
1682
|
-
},
|
|
1683
|
-
onDrag: function() {
|
|
1684
|
-
},
|
|
1685
|
-
onStop: function() {
|
|
1686
|
-
},
|
|
1687
|
-
onMouseDown: function() {
|
|
1688
|
-
},
|
|
1689
|
-
scale: 1
|
|
1690
|
-
});
|
|
1691
|
-
}
|
|
1692
|
-
});
|
|
1693
|
-
|
|
1694
|
-
// ../../node_modules/react-draggable/build/cjs/Draggable.js
|
|
1695
|
-
var require_Draggable = __commonJS({
|
|
1696
|
-
"../../node_modules/react-draggable/build/cjs/Draggable.js"(exports$1) {
|
|
1697
|
-
Object.defineProperty(exports$1, "__esModule", {
|
|
1698
|
-
value: true
|
|
1699
|
-
});
|
|
1700
|
-
Object.defineProperty(exports$1, "DraggableCore", {
|
|
1701
|
-
enumerable: true,
|
|
1702
|
-
get: function() {
|
|
1703
|
-
return _DraggableCore.default;
|
|
1704
|
-
}
|
|
1705
|
-
});
|
|
1706
|
-
exports$1.default = void 0;
|
|
1707
|
-
var React73 = _interopRequireWildcard(__require("react"));
|
|
1708
|
-
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
1709
|
-
var _reactDom = _interopRequireDefault(__require("react-dom"));
|
|
1710
|
-
var _clsx = require_clsx();
|
|
1711
|
-
var _domFns = require_domFns();
|
|
1712
|
-
var _positionFns = require_positionFns();
|
|
1713
|
-
var _shims = require_shims();
|
|
1714
|
-
var _DraggableCore = _interopRequireDefault(require_DraggableCore());
|
|
1715
|
-
var _log = _interopRequireDefault(require_log());
|
|
1716
|
-
function _interopRequireDefault(e4) {
|
|
1717
|
-
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
1718
|
-
}
|
|
1719
|
-
function _interopRequireWildcard(e4, t4) {
|
|
1720
|
-
if ("function" == typeof WeakMap) var r5 = /* @__PURE__ */ new WeakMap(), n3 = /* @__PURE__ */ new WeakMap();
|
|
1721
|
-
return (_interopRequireWildcard = function(e5, t5) {
|
|
1722
|
-
if (!t5 && e5 && e5.__esModule) return e5;
|
|
1723
|
-
var o3, i3, f2 = { __proto__: null, default: e5 };
|
|
1724
|
-
if (null === e5 || "object" != typeof e5 && "function" != typeof e5) return f2;
|
|
1725
|
-
if (o3 = t5 ? n3 : r5) {
|
|
1726
|
-
if (o3.has(e5)) return o3.get(e5);
|
|
1727
|
-
o3.set(e5, f2);
|
|
1728
|
-
}
|
|
1729
|
-
for (const t6 in e5) "default" !== t6 && {}.hasOwnProperty.call(e5, t6) && ((i3 = (o3 = Object.defineProperty) && Object.getOwnPropertyDescriptor(e5, t6)) && (i3.get || i3.set) ? o3(f2, t6, i3) : f2[t6] = e5[t6]);
|
|
1730
|
-
return f2;
|
|
1731
|
-
})(e4, t4);
|
|
1732
|
-
}
|
|
1733
|
-
function _extends() {
|
|
1734
|
-
return _extends = Object.assign ? Object.assign.bind() : function(n3) {
|
|
1735
|
-
for (var e4 = 1; e4 < arguments.length; e4++) {
|
|
1736
|
-
var t4 = arguments[e4];
|
|
1737
|
-
for (var r5 in t4) ({}).hasOwnProperty.call(t4, r5) && (n3[r5] = t4[r5]);
|
|
1738
|
-
}
|
|
1739
|
-
return n3;
|
|
1740
|
-
}, _extends.apply(null, arguments);
|
|
1741
|
-
}
|
|
1742
|
-
function _defineProperty(e4, r5, t4) {
|
|
1743
|
-
return (r5 = _toPropertyKey(r5)) in e4 ? Object.defineProperty(e4, r5, { value: t4, enumerable: true, configurable: true, writable: true }) : e4[r5] = t4, e4;
|
|
1744
|
-
}
|
|
1745
|
-
function _toPropertyKey(t4) {
|
|
1746
|
-
var i3 = _toPrimitive(t4, "string");
|
|
1747
|
-
return "symbol" == typeof i3 ? i3 : i3 + "";
|
|
1748
|
-
}
|
|
1749
|
-
function _toPrimitive(t4, r5) {
|
|
1750
|
-
if ("object" != typeof t4 || !t4) return t4;
|
|
1751
|
-
var e4 = t4[Symbol.toPrimitive];
|
|
1752
|
-
if (void 0 !== e4) {
|
|
1753
|
-
var i3 = e4.call(t4, r5);
|
|
1754
|
-
if ("object" != typeof i3) return i3;
|
|
1755
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1756
|
-
}
|
|
1757
|
-
return ("string" === r5 ? String : Number)(t4);
|
|
1758
|
-
}
|
|
1759
|
-
var Draggable2 = class extends React73.Component {
|
|
1760
|
-
// React 16.3+
|
|
1761
|
-
// Arity (props, state)
|
|
1762
|
-
static getDerivedStateFromProps(_ref, _ref2) {
|
|
1763
|
-
let {
|
|
1764
|
-
position
|
|
1765
|
-
} = _ref;
|
|
1766
|
-
let {
|
|
1767
|
-
prevPropsPosition
|
|
1768
|
-
} = _ref2;
|
|
1769
|
-
if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
|
|
1770
|
-
(0, _log.default)("Draggable: getDerivedStateFromProps %j", {
|
|
1771
|
-
position,
|
|
1772
|
-
prevPropsPosition
|
|
1773
|
-
});
|
|
1774
|
-
return {
|
|
1775
|
-
x: position.x,
|
|
1776
|
-
y: position.y,
|
|
1777
|
-
prevPropsPosition: {
|
|
1778
|
-
...position
|
|
1779
|
-
}
|
|
1780
|
-
};
|
|
1781
|
-
}
|
|
1782
|
-
return null;
|
|
1783
|
-
}
|
|
1784
|
-
constructor(props) {
|
|
1785
|
-
super(props);
|
|
1786
|
-
_defineProperty(this, "onDragStart", (e4, coreData) => {
|
|
1787
|
-
(0, _log.default)("Draggable: onDragStart: %j", coreData);
|
|
1788
|
-
const shouldStart = this.props.onStart(e4, (0, _positionFns.createDraggableData)(this, coreData));
|
|
1789
|
-
if (shouldStart === false) return false;
|
|
1790
|
-
this.setState({
|
|
1791
|
-
dragging: true,
|
|
1792
|
-
dragged: true
|
|
1793
|
-
});
|
|
1794
|
-
});
|
|
1795
|
-
_defineProperty(this, "onDrag", (e4, coreData) => {
|
|
1796
|
-
if (!this.state.dragging) return false;
|
|
1797
|
-
(0, _log.default)("Draggable: onDrag: %j", coreData);
|
|
1798
|
-
const uiData = (0, _positionFns.createDraggableData)(this, coreData);
|
|
1799
|
-
const newState = {
|
|
1800
|
-
x: uiData.x,
|
|
1801
|
-
y: uiData.y,
|
|
1802
|
-
slackX: 0,
|
|
1803
|
-
slackY: 0
|
|
1804
|
-
};
|
|
1805
|
-
if (this.props.bounds) {
|
|
1806
|
-
const {
|
|
1807
|
-
x: x2,
|
|
1808
|
-
y: y2
|
|
1809
|
-
} = newState;
|
|
1810
|
-
newState.x += this.state.slackX;
|
|
1811
|
-
newState.y += this.state.slackY;
|
|
1812
|
-
const [newStateX, newStateY] = (0, _positionFns.getBoundPosition)(this, newState.x, newState.y);
|
|
1813
|
-
newState.x = newStateX;
|
|
1814
|
-
newState.y = newStateY;
|
|
1815
|
-
newState.slackX = this.state.slackX + (x2 - newState.x);
|
|
1816
|
-
newState.slackY = this.state.slackY + (y2 - newState.y);
|
|
1817
|
-
uiData.x = newState.x;
|
|
1818
|
-
uiData.y = newState.y;
|
|
1819
|
-
uiData.deltaX = newState.x - this.state.x;
|
|
1820
|
-
uiData.deltaY = newState.y - this.state.y;
|
|
1821
|
-
}
|
|
1822
|
-
const shouldUpdate = this.props.onDrag(e4, uiData);
|
|
1823
|
-
if (shouldUpdate === false) return false;
|
|
1824
|
-
this.setState(newState);
|
|
1825
|
-
});
|
|
1826
|
-
_defineProperty(this, "onDragStop", (e4, coreData) => {
|
|
1827
|
-
if (!this.state.dragging) return false;
|
|
1828
|
-
const shouldContinue = this.props.onStop(e4, (0, _positionFns.createDraggableData)(this, coreData));
|
|
1829
|
-
if (shouldContinue === false) return false;
|
|
1830
|
-
(0, _log.default)("Draggable: onDragStop: %j", coreData);
|
|
1831
|
-
const newState = {
|
|
1832
|
-
dragging: false,
|
|
1833
|
-
slackX: 0,
|
|
1834
|
-
slackY: 0
|
|
1835
|
-
};
|
|
1836
|
-
const controlled = Boolean(this.props.position);
|
|
1837
|
-
if (controlled) {
|
|
1838
|
-
const {
|
|
1839
|
-
x: x2,
|
|
1840
|
-
y: y2
|
|
1841
|
-
} = this.props.position;
|
|
1842
|
-
newState.x = x2;
|
|
1843
|
-
newState.y = y2;
|
|
1844
|
-
}
|
|
1845
|
-
this.setState(newState);
|
|
1846
|
-
});
|
|
1847
|
-
this.state = {
|
|
1848
|
-
// Whether or not we are currently dragging.
|
|
1849
|
-
dragging: false,
|
|
1850
|
-
// Whether or not we have been dragged before.
|
|
1851
|
-
dragged: false,
|
|
1852
|
-
// Current transform x and y.
|
|
1853
|
-
x: props.position ? props.position.x : props.defaultPosition.x,
|
|
1854
|
-
y: props.position ? props.position.y : props.defaultPosition.y,
|
|
1855
|
-
prevPropsPosition: {
|
|
1856
|
-
...props.position
|
|
1857
|
-
},
|
|
1858
|
-
// Used for compensating for out-of-bounds drags
|
|
1859
|
-
slackX: 0,
|
|
1860
|
-
slackY: 0,
|
|
1861
|
-
// Can only determine if SVG after mounting
|
|
1862
|
-
isElementSVG: false
|
|
1863
|
-
};
|
|
1864
|
-
if (props.position && !(props.onDrag || props.onStop)) {
|
|
1865
|
-
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.");
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
componentDidMount() {
|
|
1869
|
-
if (typeof window.SVGElement !== "undefined" && this.findDOMNode() instanceof window.SVGElement) {
|
|
1870
|
-
this.setState({
|
|
1871
|
-
isElementSVG: true
|
|
1872
|
-
});
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
|
-
componentWillUnmount() {
|
|
1876
|
-
if (this.state.dragging) {
|
|
1877
|
-
this.setState({
|
|
1878
|
-
dragging: false
|
|
1879
|
-
});
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
1883
|
-
// the underlying DOM node ourselves. See the README for more information.
|
|
1884
|
-
findDOMNode() {
|
|
1885
|
-
var _a, _b, _c;
|
|
1886
|
-
return (_c = (_b = (_a = this.props) == null ? void 0 : _a.nodeRef) == null ? void 0 : _b.current) != null ? _c : _reactDom.default.findDOMNode(this);
|
|
1887
|
-
}
|
|
1888
|
-
render() {
|
|
1889
|
-
const {
|
|
1890
|
-
axis,
|
|
1891
|
-
bounds,
|
|
1892
|
-
children,
|
|
1893
|
-
defaultPosition,
|
|
1894
|
-
defaultClassName,
|
|
1895
|
-
defaultClassNameDragging,
|
|
1896
|
-
defaultClassNameDragged,
|
|
1897
|
-
position,
|
|
1898
|
-
positionOffset,
|
|
1899
|
-
scale,
|
|
1900
|
-
...draggableCoreProps
|
|
1901
|
-
} = this.props;
|
|
1902
|
-
let style = {};
|
|
1903
|
-
let svgTransform = null;
|
|
1904
|
-
const controlled = Boolean(position);
|
|
1905
|
-
const draggable = !controlled || this.state.dragging;
|
|
1906
|
-
const validPosition = position || defaultPosition;
|
|
1907
|
-
const transformOpts = {
|
|
1908
|
-
// Set left if horizontal drag is enabled
|
|
1909
|
-
x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
|
|
1910
|
-
// Set top if vertical drag is enabled
|
|
1911
|
-
y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
|
|
1912
|
-
};
|
|
1913
|
-
if (this.state.isElementSVG) {
|
|
1914
|
-
svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
|
|
1915
|
-
} else {
|
|
1916
|
-
style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
|
|
1917
|
-
}
|
|
1918
|
-
const className = (0, _clsx.clsx)(children.props.className || "", defaultClassName, {
|
|
1919
|
-
[defaultClassNameDragging]: this.state.dragging,
|
|
1920
|
-
[defaultClassNameDragged]: this.state.dragged
|
|
1921
|
-
});
|
|
1922
|
-
return /* @__PURE__ */ React73.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
|
|
1923
|
-
onStart: this.onDragStart,
|
|
1924
|
-
onDrag: this.onDrag,
|
|
1925
|
-
onStop: this.onDragStop
|
|
1926
|
-
}), /* @__PURE__ */ React73.cloneElement(React73.Children.only(children), {
|
|
1927
|
-
className,
|
|
1928
|
-
style: {
|
|
1929
|
-
...children.props.style,
|
|
1930
|
-
...style
|
|
1931
|
-
},
|
|
1932
|
-
transform: svgTransform
|
|
1933
|
-
}));
|
|
1934
|
-
}
|
|
1935
|
-
};
|
|
1936
|
-
exports$1.default = Draggable2;
|
|
1937
|
-
_defineProperty(Draggable2, "displayName", "Draggable");
|
|
1938
|
-
_defineProperty(Draggable2, "propTypes", {
|
|
1939
|
-
// Accepts all props <DraggableCore> accepts.
|
|
1940
|
-
..._DraggableCore.default.propTypes,
|
|
1941
|
-
/**
|
|
1942
|
-
* `axis` determines which axis the draggable can move.
|
|
1943
|
-
*
|
|
1944
|
-
* Note that all callbacks will still return data as normal. This only
|
|
1945
|
-
* controls flushing to the DOM.
|
|
1946
|
-
*
|
|
1947
|
-
* 'both' allows movement horizontally and vertically.
|
|
1948
|
-
* 'x' limits movement to horizontal axis.
|
|
1949
|
-
* 'y' limits movement to vertical axis.
|
|
1950
|
-
* 'none' limits all movement.
|
|
1951
|
-
*
|
|
1952
|
-
* Defaults to 'both'.
|
|
1953
|
-
*/
|
|
1954
|
-
axis: _propTypes.default.oneOf(["both", "x", "y", "none"]),
|
|
1955
|
-
/**
|
|
1956
|
-
* `bounds` determines the range of movement available to the element.
|
|
1957
|
-
* Available values are:
|
|
1958
|
-
*
|
|
1959
|
-
* 'parent' restricts movement within the Draggable's parent node.
|
|
1960
|
-
*
|
|
1961
|
-
* Alternatively, pass an object with the following properties, all of which are optional:
|
|
1962
|
-
*
|
|
1963
|
-
* {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
|
|
1964
|
-
*
|
|
1965
|
-
* All values are in px.
|
|
1966
|
-
*
|
|
1967
|
-
* Example:
|
|
1968
|
-
*
|
|
1969
|
-
* ```jsx
|
|
1970
|
-
* let App = React.createClass({
|
|
1971
|
-
* render: function () {
|
|
1972
|
-
* return (
|
|
1973
|
-
* <Draggable bounds={{right: 300, bottom: 300}}>
|
|
1974
|
-
* <div>Content</div>
|
|
1975
|
-
* </Draggable>
|
|
1976
|
-
* );
|
|
1977
|
-
* }
|
|
1978
|
-
* });
|
|
1979
|
-
* ```
|
|
1980
|
-
*/
|
|
1981
|
-
bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
1982
|
-
left: _propTypes.default.number,
|
|
1983
|
-
right: _propTypes.default.number,
|
|
1984
|
-
top: _propTypes.default.number,
|
|
1985
|
-
bottom: _propTypes.default.number
|
|
1986
|
-
}), _propTypes.default.string, _propTypes.default.oneOf([false])]),
|
|
1987
|
-
defaultClassName: _propTypes.default.string,
|
|
1988
|
-
defaultClassNameDragging: _propTypes.default.string,
|
|
1989
|
-
defaultClassNameDragged: _propTypes.default.string,
|
|
1990
|
-
/**
|
|
1991
|
-
* `defaultPosition` specifies the x and y that the dragged item should start at
|
|
1992
|
-
*
|
|
1993
|
-
* Example:
|
|
1994
|
-
*
|
|
1995
|
-
* ```jsx
|
|
1996
|
-
* let App = React.createClass({
|
|
1997
|
-
* render: function () {
|
|
1998
|
-
* return (
|
|
1999
|
-
* <Draggable defaultPosition={{x: 25, y: 25}}>
|
|
2000
|
-
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
2001
|
-
* </Draggable>
|
|
2002
|
-
* );
|
|
2003
|
-
* }
|
|
2004
|
-
* });
|
|
2005
|
-
* ```
|
|
2006
|
-
*/
|
|
2007
|
-
defaultPosition: _propTypes.default.shape({
|
|
2008
|
-
x: _propTypes.default.number,
|
|
2009
|
-
y: _propTypes.default.number
|
|
2010
|
-
}),
|
|
2011
|
-
positionOffset: _propTypes.default.shape({
|
|
2012
|
-
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
2013
|
-
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
2014
|
-
}),
|
|
2015
|
-
/**
|
|
2016
|
-
* `position`, if present, defines the current position of the element.
|
|
2017
|
-
*
|
|
2018
|
-
* This is similar to how form elements in React work - if no `position` is supplied, the component
|
|
2019
|
-
* is uncontrolled.
|
|
2020
|
-
*
|
|
2021
|
-
* Example:
|
|
2022
|
-
*
|
|
2023
|
-
* ```jsx
|
|
2024
|
-
* let App = React.createClass({
|
|
2025
|
-
* render: function () {
|
|
2026
|
-
* return (
|
|
2027
|
-
* <Draggable position={{x: 25, y: 25}}>
|
|
2028
|
-
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
2029
|
-
* </Draggable>
|
|
2030
|
-
* );
|
|
2031
|
-
* }
|
|
2032
|
-
* });
|
|
2033
|
-
* ```
|
|
2034
|
-
*/
|
|
2035
|
-
position: _propTypes.default.shape({
|
|
2036
|
-
x: _propTypes.default.number,
|
|
2037
|
-
y: _propTypes.default.number
|
|
2038
|
-
}),
|
|
2039
|
-
/**
|
|
2040
|
-
* These properties should be defined on the child, not here.
|
|
2041
|
-
*/
|
|
2042
|
-
className: _shims.dontSetMe,
|
|
2043
|
-
style: _shims.dontSetMe,
|
|
2044
|
-
transform: _shims.dontSetMe
|
|
2045
|
-
});
|
|
2046
|
-
_defineProperty(Draggable2, "defaultProps", {
|
|
2047
|
-
..._DraggableCore.default.defaultProps,
|
|
2048
|
-
axis: "both",
|
|
2049
|
-
bounds: false,
|
|
2050
|
-
defaultClassName: "react-draggable",
|
|
2051
|
-
defaultClassNameDragging: "react-draggable-dragging",
|
|
2052
|
-
defaultClassNameDragged: "react-draggable-dragged",
|
|
2053
|
-
defaultPosition: {
|
|
2054
|
-
x: 0,
|
|
2055
|
-
y: 0
|
|
2056
|
-
},
|
|
2057
|
-
scale: 1
|
|
2058
|
-
});
|
|
2059
|
-
}
|
|
2060
|
-
});
|
|
2061
|
-
|
|
2062
|
-
// ../../node_modules/react-draggable/build/cjs/cjs.js
|
|
2063
|
-
var require_cjs = __commonJS({
|
|
2064
|
-
"../../node_modules/react-draggable/build/cjs/cjs.js"(exports$1, module2) {
|
|
2065
|
-
var {
|
|
2066
|
-
default: Draggable2,
|
|
2067
|
-
DraggableCore
|
|
2068
|
-
} = require_Draggable();
|
|
2069
|
-
module2.exports = Draggable2;
|
|
2070
|
-
module2.exports.default = Draggable2;
|
|
2071
|
-
module2.exports.DraggableCore = DraggableCore;
|
|
2072
|
-
}
|
|
2073
|
-
});
|
|
2074
68
|
|
|
2075
69
|
// src/presets/lister/runtime/session/store.ts
|
|
2076
70
|
function createSessionStore(initial) {
|
|
@@ -3177,9 +1171,6 @@ function useListerRuntime() {
|
|
|
3177
1171
|
return ctx;
|
|
3178
1172
|
}
|
|
3179
1173
|
|
|
3180
|
-
// src/presets/lister/lister-ui.tsx
|
|
3181
|
-
var import_react_draggable = __toESM(require_cjs());
|
|
3182
|
-
|
|
3183
1174
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
3184
1175
|
function r(e4) {
|
|
3185
1176
|
var t4, f2, n3 = "";
|
|
@@ -28280,7 +26271,7 @@ function ListerSessionPanel(props) {
|
|
|
28280
26271
|
);
|
|
28281
26272
|
}
|
|
28282
26273
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
28283
|
-
|
|
26274
|
+
Draggable__default.default,
|
|
28284
26275
|
{
|
|
28285
26276
|
nodeRef,
|
|
28286
26277
|
bounds: "parent",
|
|
@@ -28756,23 +26747,6 @@ function useData(opts) {
|
|
|
28756
26747
|
}
|
|
28757
26748
|
/*! Bundled license information:
|
|
28758
26749
|
|
|
28759
|
-
react-is/cjs/react-is.development.js:
|
|
28760
|
-
(** @license React v16.13.1
|
|
28761
|
-
* react-is.development.js
|
|
28762
|
-
*
|
|
28763
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28764
|
-
*
|
|
28765
|
-
* This source code is licensed under the MIT license found in the
|
|
28766
|
-
* LICENSE file in the root directory of this source tree.
|
|
28767
|
-
*)
|
|
28768
|
-
|
|
28769
|
-
object-assign/index.js:
|
|
28770
|
-
(*
|
|
28771
|
-
object-assign
|
|
28772
|
-
(c) Sindre Sorhus
|
|
28773
|
-
@license MIT
|
|
28774
|
-
*)
|
|
28775
|
-
|
|
28776
26750
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
28777
26751
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
28778
26752
|
lucide-react/dist/esm/Icon.js:
|