New source found from dndbeyond.com

This commit is contained in:
2026-07-08 01:00:09 -07:00
parent 9a983a6d7b
commit dcefa0d2f2
2865 changed files with 222467 additions and 49053 deletions
@@ -0,0 +1,22 @@
import isFunction from '../isFunction';
/*
* Composes multiple callbacks into a single callback that will invoke them all with the same arguments.
*
* Usage:
* onAdd={callAll(onAdd, onClose, close)}
*/
var callAll = function () {
var callbacks = [];
for (var _i = 0; _i < arguments.length; _i++) {
callbacks[_i] = arguments[_i];
}
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return callbacks.filter(isFunction).forEach(function (callback) { return callback.apply(void 0, args); });
};
};
export default callAll;
//# sourceMappingURL=callAll.js.map
@@ -0,0 +1,32 @@
import isFunction from '../isFunction';
import callAll from './callAll';
/*
* Combines one or more conditions with one or more callbacks to create a single callback function that will invoke all callbacks if all conditions are true
*
* Usage:
* onKeyDown={ifAll(isCtrl, isZ)(onUndo, preventDefault)}
*/
var ifAll = function () {
var conditions = [];
for (var _i = 0; _i < arguments.length; _i++) {
conditions[_i] = arguments[_i];
}
return function () {
var callbacks = [];
for (var _i = 0; _i < arguments.length; _i++) {
callbacks[_i] = arguments[_i];
}
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var conditionsToCheck = conditions.filter(isFunction);
if (conditionsToCheck.length && conditionsToCheck.every(function (condition) { return condition.apply(void 0, args); })) {
callAll.apply(void 0, callbacks).apply(void 0, args);
}
};
};
};
export default ifAll;
//# sourceMappingURL=ifAll.js.map
@@ -0,0 +1,7 @@
var isCtrl = function (event) {
return event.ctrlKey ||
// Also check metaKey for Mac command key (⌘)
event.metaKey;
};
export default isCtrl;
//# sourceMappingURL=isCtrl.js.map
@@ -0,0 +1,8 @@
var isEscape = function (event) {
return event.code === 'Escape' ||
event.code === 'Esc' ||
// eslint-disable-next-line no-magic-numbers
event.keyCode === 27;
};
export default isEscape;
//# sourceMappingURL=isEscape.js.map
@@ -0,0 +1,7 @@
var isY = function (event) {
return event.code === 'KeyY' ||
// eslint-disable-next-line no-magic-numbers
event.keyCode === 89;
};
export default isY;
//# sourceMappingURL=isY.js.map
@@ -0,0 +1,7 @@
var isZ = function (event) {
return event.code === 'KeyZ' ||
// eslint-disable-next-line no-magic-numbers
event.keyCode === 90;
};
export default isZ;
//# sourceMappingURL=isZ.js.map
@@ -0,0 +1,4 @@
import ifAll from './ifAll';
import isEscape from './isEscape';
export default ifAll(isEscape);
//# sourceMappingURL=onEscape.js.map
@@ -0,0 +1,5 @@
import ifAll from './ifAll';
import isCtrl from './isCtrl';
import isY from './isY';
export default ifAll(isCtrl, isY);
//# sourceMappingURL=onRedoHotkey.js.map
@@ -0,0 +1,5 @@
import ifAll from './ifAll';
import isCtrl from './isCtrl';
import isZ from './isZ';
export default ifAll(isCtrl, isZ);
//# sourceMappingURL=onUndoHotkey.js.map
@@ -0,0 +1,5 @@
// https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging
export default (function (WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
});
//# sourceMappingURL=getDisplayName.js.map
@@ -0,0 +1,13 @@
var portalId = 'ddbcc-popup-container';
var getPortalRoot = function () { return document.querySelector("#" + portalId); };
var createPortalRoot = function () {
var portalRoot = document.createElement('div');
portalRoot.id = portalId;
document.body.appendChild(portalRoot);
return portalRoot;
};
export default (function () {
return getPortalRoot() ||
createPortalRoot();
});
//# sourceMappingURL=getPopupPortalRoot.js.map
@@ -0,0 +1,3 @@
var isFunction = function (value) { return typeof value === 'function'; };
export default isFunction;
//# sourceMappingURL=isFunction.js.map
@@ -0,0 +1,27 @@
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import React from 'react';
import getDisplayName from './getDisplayName';
/**
* Applies a mapping function over the props for a component.
* @param {function(object): object} map The mapping function to apply to the props
* @returns {function(Component): Component} HOC that will apply the provided mapping function
*/
var mapProps = function (map) { return function (WrappedComponent) {
var MappedPropsComponent = React.forwardRef(function (props, ref) {
return React.createElement(WrappedComponent, __assign({ ref: ref }, map(props)));
});
MappedPropsComponent.displayName = "MappedPropsComponent(" + getDisplayName(WrappedComponent) + ")";
return MappedPropsComponent;
}; };
export default mapProps;
//# sourceMappingURL=mapProps.js.map
@@ -0,0 +1,9 @@
var pipe = function () {
var funcs = [];
for (var _i = 0; _i < arguments.length; _i++) {
funcs[_i] = arguments[_i];
}
return function (arg) { return funcs.reduce(function (result, func) { return func(result); }, arg); };
};
export default pipe;
//# sourceMappingURL=pipe.js.map
@@ -0,0 +1,24 @@
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import React from 'react';
import getDisplayName from './getDisplayName';
var renderIfProp = function (propSelector) { return function (WrappedComponent) {
var WithPortal = function (props) {
return propSelector(props) ?
React.createElement(WrappedComponent, __assign({}, props)) :
null;
};
WithPortal.displayName = "RenderIfProp(" + getDisplayName(WrappedComponent) + ")";
return WithPortal;
}; };
export default renderIfProp;
//# sourceMappingURL=renderIfProp.js.map
@@ -0,0 +1,23 @@
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import React from 'react';
import ReactDOM from 'react-dom';
import getDisplayName from './getDisplayName';
var withPortal = function (portalRoot) { return function (WrappedComponent) {
var WithPortal = function (props) {
return ReactDOM.createPortal(React.createElement(WrappedComponent, __assign({}, props)), portalRoot);
};
WithPortal.displayName = "WithPortal(" + getDisplayName(WrappedComponent) + ")";
return WithPortal;
}; };
export default withPortal;
//# sourceMappingURL=withPortal.js.map