@pie-lib/graphing 2.31.1 → 2.31.4
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/esm/index.js +1058 -15
- package/esm/index.js.map +1 -1
- package/package.json +8 -8
package/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import isEqual from 'lodash/isEqual';
|
|
4
4
|
import cloneDeep from 'lodash/cloneDeep';
|
|
5
5
|
import { types, utils, createGraphProps, Root as Root$1, gridDraggable, trig } from '@pie-lib/plot';
|
|
6
|
-
import debug from 'debug';
|
|
6
|
+
import debug$1 from 'debug';
|
|
7
7
|
import { Axis } from '@vx/axis';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { withStyles } from '@material-ui/core/styles';
|
|
@@ -18,7 +18,6 @@ import EditableHtml from '@pie-lib/editable-html';
|
|
|
18
18
|
import { mouse, select } from 'd3-selection';
|
|
19
19
|
import { connect, Provider } from 'react-redux';
|
|
20
20
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
21
|
-
import undoable, { ActionCreators } from 'redux-undo';
|
|
22
21
|
import uniq from 'lodash/uniq';
|
|
23
22
|
import isString from 'lodash/isString';
|
|
24
23
|
import Button from '@material-ui/core/Button';
|
|
@@ -34,7 +33,7 @@ import { fade } from '@material-ui/core/styles/colorManipulator';
|
|
|
34
33
|
import { getAmplitudeAndFreq, buildDataPoints, sinY, FREQ_DIVIDER, parabolaFromTwoPoints, absoluteFromTwoPoints, exponentialFromTwoPoints } from '@pie-lib/graphing-utils';
|
|
35
34
|
import { DropTarget, withDragContext, DragSource } from '@pie-lib/drag';
|
|
36
35
|
import Translator from '@pie-lib/translator';
|
|
37
|
-
import
|
|
36
|
+
import require$$3 from '@material-ui/core/SvgIcon';
|
|
38
37
|
import ExpansionPanelSummary$1 from '@material-ui/core/ExpansionPanelSummary';
|
|
39
38
|
import Typography$1 from '@material-ui/core/Typography';
|
|
40
39
|
import ExpansionPanelDetails$1 from '@material-ui/core/ExpansionPanelDetails';
|
|
@@ -1033,7 +1032,7 @@ Bg.propTypes = {
|
|
|
1033
1032
|
};
|
|
1034
1033
|
Bg.defaultProps = {};
|
|
1035
1034
|
|
|
1036
|
-
const log$9 = debug('pie-lib:graphing:graph');
|
|
1035
|
+
const log$9 = debug$1('pie-lib:graphing:graph');
|
|
1037
1036
|
const graphPropTypes = {
|
|
1038
1037
|
axesSettings: PropTypes.shape(AxisPropTypes),
|
|
1039
1038
|
backgroundMarks: PropTypes.array,
|
|
@@ -1325,6 +1324,629 @@ const marks = (state = [], action) => {
|
|
|
1325
1324
|
}
|
|
1326
1325
|
};
|
|
1327
1326
|
|
|
1327
|
+
function getDefaultExportFromCjs (x) {
|
|
1328
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
var lib = {};
|
|
1332
|
+
|
|
1333
|
+
var actions = {};
|
|
1334
|
+
|
|
1335
|
+
var hasRequiredActions;
|
|
1336
|
+
|
|
1337
|
+
function requireActions () {
|
|
1338
|
+
if (hasRequiredActions) return actions;
|
|
1339
|
+
hasRequiredActions = 1;
|
|
1340
|
+
|
|
1341
|
+
Object.defineProperty(actions, "__esModule", {
|
|
1342
|
+
value: true
|
|
1343
|
+
});
|
|
1344
|
+
var ActionTypes = actions.ActionTypes = {
|
|
1345
|
+
UNDO: '@@redux-undo/UNDO',
|
|
1346
|
+
REDO: '@@redux-undo/REDO',
|
|
1347
|
+
JUMP_TO_FUTURE: '@@redux-undo/JUMP_TO_FUTURE',
|
|
1348
|
+
JUMP_TO_PAST: '@@redux-undo/JUMP_TO_PAST',
|
|
1349
|
+
JUMP: '@@redux-undo/JUMP',
|
|
1350
|
+
CLEAR_HISTORY: '@@redux-undo/CLEAR_HISTORY'
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
actions.ActionCreators = {
|
|
1354
|
+
undo: function undo() {
|
|
1355
|
+
return { type: ActionTypes.UNDO };
|
|
1356
|
+
},
|
|
1357
|
+
redo: function redo() {
|
|
1358
|
+
return { type: ActionTypes.REDO };
|
|
1359
|
+
},
|
|
1360
|
+
jumpToFuture: function jumpToFuture(index) {
|
|
1361
|
+
return { type: ActionTypes.JUMP_TO_FUTURE, index: index };
|
|
1362
|
+
},
|
|
1363
|
+
jumpToPast: function jumpToPast(index) {
|
|
1364
|
+
return { type: ActionTypes.JUMP_TO_PAST, index: index };
|
|
1365
|
+
},
|
|
1366
|
+
jump: function jump(index) {
|
|
1367
|
+
return { type: ActionTypes.JUMP, index: index };
|
|
1368
|
+
},
|
|
1369
|
+
clearHistory: function clearHistory() {
|
|
1370
|
+
return { type: ActionTypes.CLEAR_HISTORY };
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
return actions;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
var helpers = {};
|
|
1377
|
+
|
|
1378
|
+
var hasRequiredHelpers;
|
|
1379
|
+
|
|
1380
|
+
function requireHelpers () {
|
|
1381
|
+
if (hasRequiredHelpers) return helpers;
|
|
1382
|
+
hasRequiredHelpers = 1;
|
|
1383
|
+
|
|
1384
|
+
Object.defineProperty(helpers, "__esModule", {
|
|
1385
|
+
value: true
|
|
1386
|
+
});
|
|
1387
|
+
helpers.parseActions = parseActions;
|
|
1388
|
+
helpers.isHistory = isHistory;
|
|
1389
|
+
helpers.distinctState = distinctState;
|
|
1390
|
+
helpers.includeAction = includeAction;
|
|
1391
|
+
helpers.excludeAction = excludeAction;
|
|
1392
|
+
helpers.combineFilters = combineFilters;
|
|
1393
|
+
helpers.groupByActionTypes = groupByActionTypes;
|
|
1394
|
+
helpers.newHistory = newHistory;
|
|
1395
|
+
// parseActions helper: takes a string (or array)
|
|
1396
|
+
// and makes it an array if it isn't yet
|
|
1397
|
+
function parseActions(rawActions) {
|
|
1398
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
1399
|
+
|
|
1400
|
+
if (Array.isArray(rawActions)) {
|
|
1401
|
+
return rawActions;
|
|
1402
|
+
} else if (typeof rawActions === 'string') {
|
|
1403
|
+
return [rawActions];
|
|
1404
|
+
}
|
|
1405
|
+
return defaultValue;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
// isHistory helper: check for a valid history object
|
|
1409
|
+
function isHistory(history) {
|
|
1410
|
+
return typeof history.present !== 'undefined' && typeof history.future !== 'undefined' && typeof history.past !== 'undefined' && Array.isArray(history.future) && Array.isArray(history.past);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
// distinctState helper: deprecated, does nothing in latest beta
|
|
1414
|
+
/* istanbul ignore next */
|
|
1415
|
+
function distinctState() {
|
|
1416
|
+
console.warn('distinctState is deprecated in beta4 and newer. ' + 'The distinctState behavior is now default, which means only ' + 'actions resulting in a new state are recorded. ' + 'See https://github.com/omnidan/redux-undo#filtering-actions ' + 'for more details.');
|
|
1417
|
+
return function () {
|
|
1418
|
+
return true;
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
// includeAction helper: whitelist actions to be added to the history
|
|
1423
|
+
function includeAction(rawActions) {
|
|
1424
|
+
var actions = parseActions(rawActions);
|
|
1425
|
+
return function (action) {
|
|
1426
|
+
return actions.indexOf(action.type) >= 0;
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
// excludeAction helper: blacklist actions from being added to the history
|
|
1431
|
+
function excludeAction(rawActions) {
|
|
1432
|
+
var actions = parseActions(rawActions);
|
|
1433
|
+
return function (action) {
|
|
1434
|
+
return actions.indexOf(action.type) < 0;
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
// combineFilters helper: combine multiple filters to one
|
|
1439
|
+
function combineFilters() {
|
|
1440
|
+
for (var _len = arguments.length, filters = Array(_len), _key = 0; _key < _len; _key++) {
|
|
1441
|
+
filters[_key] = arguments[_key];
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
return filters.reduce(function (prev, curr) {
|
|
1445
|
+
return function (action, currentState, previousHistory) {
|
|
1446
|
+
return prev(action, currentState, previousHistory) && curr(action, currentState, previousHistory);
|
|
1447
|
+
};
|
|
1448
|
+
}, function () {
|
|
1449
|
+
return true;
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
function groupByActionTypes(rawActions) {
|
|
1454
|
+
var actions = parseActions(rawActions);
|
|
1455
|
+
return function (action) {
|
|
1456
|
+
return actions.indexOf(action.type) >= 0 ? action.type : null;
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
function newHistory(past, present, future) {
|
|
1461
|
+
var group = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
1462
|
+
|
|
1463
|
+
return {
|
|
1464
|
+
past: past,
|
|
1465
|
+
present: present,
|
|
1466
|
+
future: future,
|
|
1467
|
+
group: group,
|
|
1468
|
+
_latestUnfiltered: present,
|
|
1469
|
+
index: past.length,
|
|
1470
|
+
limit: past.length + future.length + 1
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
return helpers;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
var reducer$1 = {exports: {}};
|
|
1477
|
+
|
|
1478
|
+
var debug = {};
|
|
1479
|
+
|
|
1480
|
+
var hasRequiredDebug;
|
|
1481
|
+
|
|
1482
|
+
function requireDebug () {
|
|
1483
|
+
if (hasRequiredDebug) return debug;
|
|
1484
|
+
hasRequiredDebug = 1;
|
|
1485
|
+
|
|
1486
|
+
Object.defineProperty(debug, "__esModule", {
|
|
1487
|
+
value: true
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
1491
|
+
|
|
1492
|
+
var __DEBUG__ = void 0;
|
|
1493
|
+
var displayBuffer = void 0;
|
|
1494
|
+
|
|
1495
|
+
var colors = {
|
|
1496
|
+
prevState: '#9E9E9E',
|
|
1497
|
+
action: '#03A9F4',
|
|
1498
|
+
nextState: '#4CAF50'
|
|
1499
|
+
|
|
1500
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1501
|
+
};function initBuffer() {
|
|
1502
|
+
displayBuffer = {
|
|
1503
|
+
header: [],
|
|
1504
|
+
prev: [],
|
|
1505
|
+
action: [],
|
|
1506
|
+
next: [],
|
|
1507
|
+
msgs: []
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1512
|
+
function printBuffer() {
|
|
1513
|
+
var _displayBuffer = displayBuffer,
|
|
1514
|
+
header = _displayBuffer.header,
|
|
1515
|
+
prev = _displayBuffer.prev,
|
|
1516
|
+
next = _displayBuffer.next,
|
|
1517
|
+
action = _displayBuffer.action,
|
|
1518
|
+
msgs = _displayBuffer.msgs;
|
|
1519
|
+
|
|
1520
|
+
if (console.group) {
|
|
1521
|
+
var _console, _console2, _console3, _console4, _console5;
|
|
1522
|
+
|
|
1523
|
+
(_console = console).groupCollapsed.apply(_console, _toConsumableArray(header));
|
|
1524
|
+
(_console2 = console).log.apply(_console2, _toConsumableArray(prev));
|
|
1525
|
+
(_console3 = console).log.apply(_console3, _toConsumableArray(action));
|
|
1526
|
+
(_console4 = console).log.apply(_console4, _toConsumableArray(next));
|
|
1527
|
+
(_console5 = console).log.apply(_console5, _toConsumableArray(msgs));
|
|
1528
|
+
console.groupEnd();
|
|
1529
|
+
} else {
|
|
1530
|
+
var _console6, _console7, _console8, _console9, _console10;
|
|
1531
|
+
|
|
1532
|
+
(_console6 = console).log.apply(_console6, _toConsumableArray(header));
|
|
1533
|
+
(_console7 = console).log.apply(_console7, _toConsumableArray(prev));
|
|
1534
|
+
(_console8 = console).log.apply(_console8, _toConsumableArray(action));
|
|
1535
|
+
(_console9 = console).log.apply(_console9, _toConsumableArray(next));
|
|
1536
|
+
(_console10 = console).log.apply(_console10, _toConsumableArray(msgs));
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1541
|
+
function colorFormat(text, color, obj) {
|
|
1542
|
+
return ['%c' + text, 'color: ' + color + '; font-weight: bold', obj];
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1546
|
+
function start(action, state) {
|
|
1547
|
+
initBuffer();
|
|
1548
|
+
if (__DEBUG__) {
|
|
1549
|
+
if (console.group) {
|
|
1550
|
+
displayBuffer.header = ['%credux-undo', 'font-style: italic', 'action', action.type];
|
|
1551
|
+
displayBuffer.action = colorFormat('action', colors.action, action);
|
|
1552
|
+
displayBuffer.prev = colorFormat('prev history', colors.prevState, state);
|
|
1553
|
+
} else {
|
|
1554
|
+
displayBuffer.header = ['redux-undo action', action.type];
|
|
1555
|
+
displayBuffer.action = ['action', action];
|
|
1556
|
+
displayBuffer.prev = ['prev history', state];
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1562
|
+
function end(nextState) {
|
|
1563
|
+
if (__DEBUG__) {
|
|
1564
|
+
if (console.group) {
|
|
1565
|
+
displayBuffer.next = colorFormat('next history', colors.nextState, nextState);
|
|
1566
|
+
} else {
|
|
1567
|
+
displayBuffer.next = ['next history', nextState];
|
|
1568
|
+
}
|
|
1569
|
+
printBuffer();
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1574
|
+
function log() {
|
|
1575
|
+
if (__DEBUG__) {
|
|
1576
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
1577
|
+
args[_key] = arguments[_key];
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\n']));
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1585
|
+
function set(debug) {
|
|
1586
|
+
__DEBUG__ = debug;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
debug.set = set;
|
|
1590
|
+
debug.start = start;
|
|
1591
|
+
debug.end = end;
|
|
1592
|
+
debug.log = log;
|
|
1593
|
+
return debug;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
var hasRequiredReducer;
|
|
1597
|
+
|
|
1598
|
+
function requireReducer () {
|
|
1599
|
+
if (hasRequiredReducer) return reducer$1.exports;
|
|
1600
|
+
hasRequiredReducer = 1;
|
|
1601
|
+
(function (module, exports) {
|
|
1602
|
+
|
|
1603
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1604
|
+
value: true
|
|
1605
|
+
});
|
|
1606
|
+
|
|
1607
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
1608
|
+
|
|
1609
|
+
exports.default = undoable;
|
|
1610
|
+
|
|
1611
|
+
var _debug = requireDebug();
|
|
1612
|
+
|
|
1613
|
+
var debug = _interopRequireWildcard(_debug);
|
|
1614
|
+
|
|
1615
|
+
var _actions = requireActions();
|
|
1616
|
+
|
|
1617
|
+
var _helpers = requireHelpers();
|
|
1618
|
+
|
|
1619
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
1620
|
+
|
|
1621
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
1622
|
+
|
|
1623
|
+
// createHistory
|
|
1624
|
+
function createHistory(state, ignoreInitialState) {
|
|
1625
|
+
// ignoreInitialState essentially prevents the user from undoing to the
|
|
1626
|
+
// beginning, in the case that the undoable reducer handles initialization
|
|
1627
|
+
// in a way that can't be redone simply
|
|
1628
|
+
var history = (0, _helpers.newHistory)([], state, []);
|
|
1629
|
+
if (ignoreInitialState) {
|
|
1630
|
+
history._latestUnfiltered = null;
|
|
1631
|
+
}
|
|
1632
|
+
return history;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
// lengthWithoutFuture: get length of history
|
|
1636
|
+
function lengthWithoutFuture(history) {
|
|
1637
|
+
return history.past.length + 1;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// insert: insert `state` into history, which means adding the current state
|
|
1641
|
+
// into `past`, setting the new `state` as `present` and erasing
|
|
1642
|
+
// the `future`.
|
|
1643
|
+
function insert(history, state, limit, group) {
|
|
1644
|
+
debug.log('inserting', state);
|
|
1645
|
+
debug.log('new free: ', limit - lengthWithoutFuture(history));
|
|
1646
|
+
|
|
1647
|
+
var past = history.past,
|
|
1648
|
+
_latestUnfiltered = history._latestUnfiltered;
|
|
1649
|
+
|
|
1650
|
+
var historyOverflow = limit && lengthWithoutFuture(history) >= limit;
|
|
1651
|
+
|
|
1652
|
+
var pastSliced = past.slice(historyOverflow ? 1 : 0);
|
|
1653
|
+
var newPast = _latestUnfiltered != null ? [].concat(_toConsumableArray(pastSliced), [_latestUnfiltered]) : pastSliced;
|
|
1654
|
+
|
|
1655
|
+
return (0, _helpers.newHistory)(newPast, state, [], group);
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
// jumpToFuture: jump to requested index in future history
|
|
1659
|
+
function jumpToFuture(history, index) {
|
|
1660
|
+
if (index < 0 || index >= history.future.length) return history;
|
|
1661
|
+
|
|
1662
|
+
var past = history.past,
|
|
1663
|
+
future = history.future,
|
|
1664
|
+
_latestUnfiltered = history._latestUnfiltered;
|
|
1665
|
+
|
|
1666
|
+
|
|
1667
|
+
var newPast = [].concat(_toConsumableArray(past), [_latestUnfiltered], _toConsumableArray(future.slice(0, index)));
|
|
1668
|
+
var newPresent = future[index];
|
|
1669
|
+
var newFuture = future.slice(index + 1);
|
|
1670
|
+
|
|
1671
|
+
return (0, _helpers.newHistory)(newPast, newPresent, newFuture);
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
// jumpToPast: jump to requested index in past history
|
|
1675
|
+
function jumpToPast(history, index) {
|
|
1676
|
+
if (index < 0 || index >= history.past.length) return history;
|
|
1677
|
+
|
|
1678
|
+
var past = history.past,
|
|
1679
|
+
future = history.future,
|
|
1680
|
+
_latestUnfiltered = history._latestUnfiltered;
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
var newPast = past.slice(0, index);
|
|
1684
|
+
var newFuture = [].concat(_toConsumableArray(past.slice(index + 1)), [_latestUnfiltered], _toConsumableArray(future));
|
|
1685
|
+
var newPresent = past[index];
|
|
1686
|
+
|
|
1687
|
+
return (0, _helpers.newHistory)(newPast, newPresent, newFuture);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
// jump: jump n steps in the past or forward
|
|
1691
|
+
function jump(history, n) {
|
|
1692
|
+
if (n > 0) return jumpToFuture(history, n - 1);
|
|
1693
|
+
if (n < 0) return jumpToPast(history, history.past.length + n);
|
|
1694
|
+
return history;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
// helper to dynamically match in the reducer's switch-case
|
|
1698
|
+
function actionTypeAmongClearHistoryType(actionType, clearHistoryType) {
|
|
1699
|
+
return clearHistoryType.indexOf(actionType) > -1 ? actionType : !actionType;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
// redux-undo higher order reducer
|
|
1703
|
+
function undoable(reducer) {
|
|
1704
|
+
var rawConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1705
|
+
|
|
1706
|
+
debug.set(rawConfig.debug);
|
|
1707
|
+
|
|
1708
|
+
var config = {
|
|
1709
|
+
initTypes: (0, _helpers.parseActions)(rawConfig.initTypes, ['@@redux-undo/INIT']),
|
|
1710
|
+
limit: rawConfig.limit,
|
|
1711
|
+
filter: rawConfig.filter || function () {
|
|
1712
|
+
return true;
|
|
1713
|
+
},
|
|
1714
|
+
groupBy: rawConfig.groupBy || function () {
|
|
1715
|
+
return null;
|
|
1716
|
+
},
|
|
1717
|
+
undoType: rawConfig.undoType || _actions.ActionTypes.UNDO,
|
|
1718
|
+
redoType: rawConfig.redoType || _actions.ActionTypes.REDO,
|
|
1719
|
+
jumpToPastType: rawConfig.jumpToPastType || _actions.ActionTypes.JUMP_TO_PAST,
|
|
1720
|
+
jumpToFutureType: rawConfig.jumpToFutureType || _actions.ActionTypes.JUMP_TO_FUTURE,
|
|
1721
|
+
jumpType: rawConfig.jumpType || _actions.ActionTypes.JUMP,
|
|
1722
|
+
clearHistoryType: Array.isArray(rawConfig.clearHistoryType) ? rawConfig.clearHistoryType : [rawConfig.clearHistoryType || _actions.ActionTypes.CLEAR_HISTORY],
|
|
1723
|
+
neverSkipReducer: rawConfig.neverSkipReducer || false,
|
|
1724
|
+
ignoreInitialState: rawConfig.ignoreInitialState || false,
|
|
1725
|
+
syncFilter: rawConfig.syncFilter || false
|
|
1726
|
+
};
|
|
1727
|
+
|
|
1728
|
+
var initialState = config.history;
|
|
1729
|
+
return function () {
|
|
1730
|
+
for (var _len = arguments.length, slices = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1731
|
+
slices[_key - 2] = arguments[_key];
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
1735
|
+
var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1736
|
+
|
|
1737
|
+
debug.start(action, state);
|
|
1738
|
+
|
|
1739
|
+
var history = state;
|
|
1740
|
+
if (!initialState) {
|
|
1741
|
+
debug.log('history is uninitialized');
|
|
1742
|
+
|
|
1743
|
+
if (state === undefined) {
|
|
1744
|
+
var clearHistoryAction = { type: _actions.ActionTypes.CLEAR_HISTORY };
|
|
1745
|
+
var start = reducer.apply(undefined, [state, clearHistoryAction].concat(slices));
|
|
1746
|
+
|
|
1747
|
+
history = createHistory(start, config.ignoreInitialState);
|
|
1748
|
+
|
|
1749
|
+
debug.log('do not set initialState on probe actions');
|
|
1750
|
+
} else if ((0, _helpers.isHistory)(state)) {
|
|
1751
|
+
history = initialState = config.ignoreInitialState ? state : (0, _helpers.newHistory)(state.past, state.present, state.future);
|
|
1752
|
+
debug.log('initialHistory initialized: initialState is a history', initialState);
|
|
1753
|
+
} else {
|
|
1754
|
+
history = initialState = createHistory(state, config.ignoreInitialState);
|
|
1755
|
+
debug.log('initialHistory initialized: initialState is not a history', initialState);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
var skipReducer = function skipReducer(res) {
|
|
1760
|
+
return config.neverSkipReducer ? _extends({}, res, {
|
|
1761
|
+
present: reducer.apply(undefined, [res.present, action].concat(slices))
|
|
1762
|
+
}) : res;
|
|
1763
|
+
};
|
|
1764
|
+
|
|
1765
|
+
var res = void 0;
|
|
1766
|
+
switch (action.type) {
|
|
1767
|
+
case undefined:
|
|
1768
|
+
return history;
|
|
1769
|
+
|
|
1770
|
+
case config.undoType:
|
|
1771
|
+
res = jump(history, -1);
|
|
1772
|
+
debug.log('perform undo');
|
|
1773
|
+
debug.end(res);
|
|
1774
|
+
return skipReducer(res);
|
|
1775
|
+
|
|
1776
|
+
case config.redoType:
|
|
1777
|
+
res = jump(history, 1);
|
|
1778
|
+
debug.log('perform redo');
|
|
1779
|
+
debug.end(res);
|
|
1780
|
+
return skipReducer(res);
|
|
1781
|
+
|
|
1782
|
+
case config.jumpToPastType:
|
|
1783
|
+
res = jumpToPast(history, action.index);
|
|
1784
|
+
debug.log('perform jumpToPast to ' + action.index);
|
|
1785
|
+
debug.end(res);
|
|
1786
|
+
return skipReducer(res);
|
|
1787
|
+
|
|
1788
|
+
case config.jumpToFutureType:
|
|
1789
|
+
res = jumpToFuture(history, action.index);
|
|
1790
|
+
debug.log('perform jumpToFuture to ' + action.index);
|
|
1791
|
+
debug.end(res);
|
|
1792
|
+
return skipReducer(res);
|
|
1793
|
+
|
|
1794
|
+
case config.jumpType:
|
|
1795
|
+
res = jump(history, action.index);
|
|
1796
|
+
debug.log('perform jump to ' + action.index);
|
|
1797
|
+
debug.end(res);
|
|
1798
|
+
return skipReducer(res);
|
|
1799
|
+
|
|
1800
|
+
case actionTypeAmongClearHistoryType(action.type, config.clearHistoryType):
|
|
1801
|
+
res = createHistory(history.present);
|
|
1802
|
+
debug.log('perform clearHistory');
|
|
1803
|
+
debug.end(res);
|
|
1804
|
+
return skipReducer(res);
|
|
1805
|
+
|
|
1806
|
+
default:
|
|
1807
|
+
res = reducer.apply(undefined, [history.present, action].concat(slices));
|
|
1808
|
+
|
|
1809
|
+
if (config.initTypes.some(function (actionType) {
|
|
1810
|
+
return actionType === action.type;
|
|
1811
|
+
})) {
|
|
1812
|
+
debug.log('reset history due to init action');
|
|
1813
|
+
debug.end(initialState);
|
|
1814
|
+
return initialState;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
if (history._latestUnfiltered === res) {
|
|
1818
|
+
// Don't handle this action. Do not call debug.end here,
|
|
1819
|
+
// because this action should not produce side effects to the console
|
|
1820
|
+
return history;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
var filtered = typeof config.filter === 'function' && !config.filter(action, res, history);
|
|
1824
|
+
var group = config.groupBy(action, res, history);
|
|
1825
|
+
|
|
1826
|
+
if (filtered) {
|
|
1827
|
+
// if filtering an action, merely update the present
|
|
1828
|
+
var filteredState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);
|
|
1829
|
+
if (!config.syncFilter) {
|
|
1830
|
+
filteredState._latestUnfiltered = history._latestUnfiltered;
|
|
1831
|
+
}
|
|
1832
|
+
debug.log('filter ignored action, not storing it in past');
|
|
1833
|
+
debug.end(filteredState);
|
|
1834
|
+
return filteredState;
|
|
1835
|
+
} else if (group != null && group === history.group) {
|
|
1836
|
+
var groupedState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);
|
|
1837
|
+
debug.log('groupBy grouped the action with the previous action');
|
|
1838
|
+
debug.end(groupedState);
|
|
1839
|
+
return groupedState;
|
|
1840
|
+
} else {
|
|
1841
|
+
// If the action wasn't filtered, insert normally
|
|
1842
|
+
history = insert(history, res, config.limit, group);
|
|
1843
|
+
|
|
1844
|
+
debug.log('inserted new state into history');
|
|
1845
|
+
debug.end(history);
|
|
1846
|
+
return history;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
module.exports = exports['default'];
|
|
1852
|
+
} (reducer$1, reducer$1.exports));
|
|
1853
|
+
return reducer$1.exports;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
var hasRequiredLib;
|
|
1857
|
+
|
|
1858
|
+
function requireLib () {
|
|
1859
|
+
if (hasRequiredLib) return lib;
|
|
1860
|
+
hasRequiredLib = 1;
|
|
1861
|
+
(function (exports) {
|
|
1862
|
+
|
|
1863
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1864
|
+
value: true
|
|
1865
|
+
});
|
|
1866
|
+
|
|
1867
|
+
var _actions = requireActions();
|
|
1868
|
+
|
|
1869
|
+
Object.defineProperty(exports, 'ActionTypes', {
|
|
1870
|
+
enumerable: true,
|
|
1871
|
+
get: function get() {
|
|
1872
|
+
return _actions.ActionTypes;
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1875
|
+
Object.defineProperty(exports, 'ActionCreators', {
|
|
1876
|
+
enumerable: true,
|
|
1877
|
+
get: function get() {
|
|
1878
|
+
return _actions.ActionCreators;
|
|
1879
|
+
}
|
|
1880
|
+
});
|
|
1881
|
+
|
|
1882
|
+
var _helpers = requireHelpers();
|
|
1883
|
+
|
|
1884
|
+
Object.defineProperty(exports, 'parseActions', {
|
|
1885
|
+
enumerable: true,
|
|
1886
|
+
get: function get() {
|
|
1887
|
+
return _helpers.parseActions;
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
Object.defineProperty(exports, 'isHistory', {
|
|
1891
|
+
enumerable: true,
|
|
1892
|
+
get: function get() {
|
|
1893
|
+
return _helpers.isHistory;
|
|
1894
|
+
}
|
|
1895
|
+
});
|
|
1896
|
+
Object.defineProperty(exports, 'distinctState', {
|
|
1897
|
+
enumerable: true,
|
|
1898
|
+
get: function get() {
|
|
1899
|
+
return _helpers.distinctState;
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
Object.defineProperty(exports, 'includeAction', {
|
|
1903
|
+
enumerable: true,
|
|
1904
|
+
get: function get() {
|
|
1905
|
+
return _helpers.includeAction;
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
Object.defineProperty(exports, 'excludeAction', {
|
|
1909
|
+
enumerable: true,
|
|
1910
|
+
get: function get() {
|
|
1911
|
+
return _helpers.excludeAction;
|
|
1912
|
+
}
|
|
1913
|
+
});
|
|
1914
|
+
Object.defineProperty(exports, 'combineFilters', {
|
|
1915
|
+
enumerable: true,
|
|
1916
|
+
get: function get() {
|
|
1917
|
+
return _helpers.combineFilters;
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1920
|
+
Object.defineProperty(exports, 'groupByActionTypes', {
|
|
1921
|
+
enumerable: true,
|
|
1922
|
+
get: function get() {
|
|
1923
|
+
return _helpers.groupByActionTypes;
|
|
1924
|
+
}
|
|
1925
|
+
});
|
|
1926
|
+
Object.defineProperty(exports, 'newHistory', {
|
|
1927
|
+
enumerable: true,
|
|
1928
|
+
get: function get() {
|
|
1929
|
+
return _helpers.newHistory;
|
|
1930
|
+
}
|
|
1931
|
+
});
|
|
1932
|
+
|
|
1933
|
+
var _reducer = requireReducer();
|
|
1934
|
+
|
|
1935
|
+
Object.defineProperty(exports, 'default', {
|
|
1936
|
+
enumerable: true,
|
|
1937
|
+
get: function get() {
|
|
1938
|
+
return _interopRequireDefault(_reducer).default;
|
|
1939
|
+
}
|
|
1940
|
+
});
|
|
1941
|
+
|
|
1942
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1943
|
+
} (lib));
|
|
1944
|
+
return lib;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
var libExports = requireLib();
|
|
1948
|
+
var undoable = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
1949
|
+
|
|
1328
1950
|
var reducer = (() => combineReducers({
|
|
1329
1951
|
marks: undoable(marks, {
|
|
1330
1952
|
debug: false
|
|
@@ -3616,7 +4238,7 @@ var DraggablePolygon = gridDraggable({
|
|
|
3616
4238
|
}
|
|
3617
4239
|
})(Polygon);
|
|
3618
4240
|
|
|
3619
|
-
const log$8 = debug('pie-lib:graphing:polygon');
|
|
4241
|
+
const log$8 = debug$1('pie-lib:graphing:polygon');
|
|
3620
4242
|
const buildLines = (points, closed) => {
|
|
3621
4243
|
const expanded = points.reduce((acc, p, index) => {
|
|
3622
4244
|
acc.push(_extends({}, p, {
|
|
@@ -4100,7 +4722,7 @@ const tool$8 = () => ({
|
|
|
4100
4722
|
}
|
|
4101
4723
|
});
|
|
4102
4724
|
|
|
4103
|
-
const log$7 = debug('pie-lib:graphing:sine');
|
|
4725
|
+
const log$7 = debug$1('pie-lib:graphing:sine');
|
|
4104
4726
|
const Sine = withRootEdge(props => {
|
|
4105
4727
|
const {
|
|
4106
4728
|
root,
|
|
@@ -4131,7 +4753,7 @@ const Sine = withRootEdge(props => {
|
|
|
4131
4753
|
});
|
|
4132
4754
|
const Component$7 = rootEdgeComponent(Sine);
|
|
4133
4755
|
|
|
4134
|
-
const log$6 = debug('pie-lib:graphing:sine');
|
|
4756
|
+
const log$6 = debug$1('pie-lib:graphing:sine');
|
|
4135
4757
|
const tool$7 = () => ({
|
|
4136
4758
|
type: 'sine',
|
|
4137
4759
|
Component: Component$7,
|
|
@@ -4168,7 +4790,7 @@ const tool$7 = () => ({
|
|
|
4168
4790
|
}
|
|
4169
4791
|
});
|
|
4170
4792
|
|
|
4171
|
-
const log$5 = debug('pie-lib:graphing:parabola');
|
|
4793
|
+
const log$5 = debug$1('pie-lib:graphing:parabola');
|
|
4172
4794
|
const Parabola = withRootEdge(props => {
|
|
4173
4795
|
const {
|
|
4174
4796
|
root,
|
|
@@ -4189,7 +4811,7 @@ const Parabola = withRootEdge(props => {
|
|
|
4189
4811
|
});
|
|
4190
4812
|
const Component$6 = rootEdgeComponent(Parabola);
|
|
4191
4813
|
|
|
4192
|
-
const log$4 = debug('pie-lib:graphing:parabola');
|
|
4814
|
+
const log$4 = debug$1('pie-lib:graphing:parabola');
|
|
4193
4815
|
const tool$6 = () => ({
|
|
4194
4816
|
type: 'parabola',
|
|
4195
4817
|
Component: Component$6,
|
|
@@ -4473,7 +5095,7 @@ const Component$2 = lineToolComponent(Vector);
|
|
|
4473
5095
|
|
|
4474
5096
|
const tool$2 = lineTool('vector', Component$2);
|
|
4475
5097
|
|
|
4476
|
-
const log$3 = debug('pie-lib:graphing:absolute');
|
|
5098
|
+
const log$3 = debug$1('pie-lib:graphing:absolute');
|
|
4477
5099
|
const Absolute = withRootEdge(props => {
|
|
4478
5100
|
const {
|
|
4479
5101
|
root,
|
|
@@ -4495,7 +5117,7 @@ const Absolute = withRootEdge(props => {
|
|
|
4495
5117
|
});
|
|
4496
5118
|
const Component$1 = rootEdgeComponent(Absolute);
|
|
4497
5119
|
|
|
4498
|
-
const log$2 = debug('pie-lib:graphing:absolute');
|
|
5120
|
+
const log$2 = debug$1('pie-lib:graphing:absolute');
|
|
4499
5121
|
const tool$1 = () => ({
|
|
4500
5122
|
type: 'absolute',
|
|
4501
5123
|
Component: Component$1,
|
|
@@ -4530,7 +5152,7 @@ const tool$1 = () => ({
|
|
|
4530
5152
|
}
|
|
4531
5153
|
});
|
|
4532
5154
|
|
|
4533
|
-
const log$1 = debug('pie-lib:graphing:exponential');
|
|
5155
|
+
const log$1 = debug$1('pie-lib:graphing:exponential');
|
|
4534
5156
|
const Exponential = withRootEdge(props => {
|
|
4535
5157
|
const {
|
|
4536
5158
|
root,
|
|
@@ -4551,7 +5173,7 @@ const Exponential = withRootEdge(props => {
|
|
|
4551
5173
|
});
|
|
4552
5174
|
const Component = rootEdgeComponent(Exponential);
|
|
4553
5175
|
|
|
4554
|
-
const log = debug('pie-lib:graphing:exponential');
|
|
5176
|
+
const log = debug$1('pie-lib:graphing:exponential');
|
|
4555
5177
|
const tool = () => ({
|
|
4556
5178
|
type: 'exponential',
|
|
4557
5179
|
Component: Component,
|
|
@@ -4980,6 +5602,427 @@ const styles$3 = theme => ({
|
|
|
4980
5602
|
|
|
4981
5603
|
var UndoRedo$1 = withStyles$1(styles$3)(UndoRedo);
|
|
4982
5604
|
|
|
5605
|
+
var ExpandMore = {};
|
|
5606
|
+
|
|
5607
|
+
var interopRequireDefault = {exports: {}};
|
|
5608
|
+
|
|
5609
|
+
var hasRequiredInteropRequireDefault;
|
|
5610
|
+
|
|
5611
|
+
function requireInteropRequireDefault () {
|
|
5612
|
+
if (hasRequiredInteropRequireDefault) return interopRequireDefault.exports;
|
|
5613
|
+
hasRequiredInteropRequireDefault = 1;
|
|
5614
|
+
(function (module) {
|
|
5615
|
+
function _interopRequireDefault(obj) {
|
|
5616
|
+
return obj && obj.__esModule ? obj : {
|
|
5617
|
+
"default": obj
|
|
5618
|
+
};
|
|
5619
|
+
}
|
|
5620
|
+
|
|
5621
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5622
|
+
} (interopRequireDefault));
|
|
5623
|
+
return interopRequireDefault.exports;
|
|
5624
|
+
}
|
|
5625
|
+
|
|
5626
|
+
var createSvgIcon = {};
|
|
5627
|
+
|
|
5628
|
+
var pure = {};
|
|
5629
|
+
|
|
5630
|
+
var shouldUpdate = {};
|
|
5631
|
+
|
|
5632
|
+
var inheritsLoose = {exports: {}};
|
|
5633
|
+
|
|
5634
|
+
var setPrototypeOf = {exports: {}};
|
|
5635
|
+
|
|
5636
|
+
var hasRequiredSetPrototypeOf;
|
|
5637
|
+
|
|
5638
|
+
function requireSetPrototypeOf () {
|
|
5639
|
+
if (hasRequiredSetPrototypeOf) return setPrototypeOf.exports;
|
|
5640
|
+
hasRequiredSetPrototypeOf = 1;
|
|
5641
|
+
(function (module) {
|
|
5642
|
+
function _setPrototypeOf(o, p) {
|
|
5643
|
+
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
5644
|
+
o.__proto__ = p;
|
|
5645
|
+
return o;
|
|
5646
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5647
|
+
return _setPrototypeOf(o, p);
|
|
5648
|
+
}
|
|
5649
|
+
|
|
5650
|
+
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5651
|
+
} (setPrototypeOf));
|
|
5652
|
+
return setPrototypeOf.exports;
|
|
5653
|
+
}
|
|
5654
|
+
|
|
5655
|
+
var hasRequiredInheritsLoose;
|
|
5656
|
+
|
|
5657
|
+
function requireInheritsLoose () {
|
|
5658
|
+
if (hasRequiredInheritsLoose) return inheritsLoose.exports;
|
|
5659
|
+
hasRequiredInheritsLoose = 1;
|
|
5660
|
+
(function (module) {
|
|
5661
|
+
var setPrototypeOf = requireSetPrototypeOf();
|
|
5662
|
+
|
|
5663
|
+
function _inheritsLoose(subClass, superClass) {
|
|
5664
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
5665
|
+
subClass.prototype.constructor = subClass;
|
|
5666
|
+
setPrototypeOf(subClass, superClass);
|
|
5667
|
+
}
|
|
5668
|
+
|
|
5669
|
+
module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5670
|
+
} (inheritsLoose));
|
|
5671
|
+
return inheritsLoose.exports;
|
|
5672
|
+
}
|
|
5673
|
+
|
|
5674
|
+
var setDisplayName = {};
|
|
5675
|
+
|
|
5676
|
+
var setStatic = {};
|
|
5677
|
+
|
|
5678
|
+
var hasRequiredSetStatic;
|
|
5679
|
+
|
|
5680
|
+
function requireSetStatic () {
|
|
5681
|
+
if (hasRequiredSetStatic) return setStatic;
|
|
5682
|
+
hasRequiredSetStatic = 1;
|
|
5683
|
+
|
|
5684
|
+
setStatic.__esModule = true;
|
|
5685
|
+
setStatic.default = void 0;
|
|
5686
|
+
|
|
5687
|
+
var setStatic$1 = function setStatic(key, value) {
|
|
5688
|
+
return function (BaseComponent) {
|
|
5689
|
+
/* eslint-disable no-param-reassign */
|
|
5690
|
+
BaseComponent[key] = value;
|
|
5691
|
+
/* eslint-enable no-param-reassign */
|
|
5692
|
+
|
|
5693
|
+
return BaseComponent;
|
|
5694
|
+
};
|
|
5695
|
+
};
|
|
5696
|
+
|
|
5697
|
+
var _default = setStatic$1;
|
|
5698
|
+
setStatic.default = _default;
|
|
5699
|
+
return setStatic;
|
|
5700
|
+
}
|
|
5701
|
+
|
|
5702
|
+
var hasRequiredSetDisplayName;
|
|
5703
|
+
|
|
5704
|
+
function requireSetDisplayName () {
|
|
5705
|
+
if (hasRequiredSetDisplayName) return setDisplayName;
|
|
5706
|
+
hasRequiredSetDisplayName = 1;
|
|
5707
|
+
|
|
5708
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
5709
|
+
|
|
5710
|
+
setDisplayName.__esModule = true;
|
|
5711
|
+
setDisplayName.default = void 0;
|
|
5712
|
+
|
|
5713
|
+
var _setStatic = _interopRequireDefault(requireSetStatic());
|
|
5714
|
+
|
|
5715
|
+
var setDisplayName$1 = function setDisplayName(displayName) {
|
|
5716
|
+
return (0, _setStatic.default)('displayName', displayName);
|
|
5717
|
+
};
|
|
5718
|
+
|
|
5719
|
+
var _default = setDisplayName$1;
|
|
5720
|
+
setDisplayName.default = _default;
|
|
5721
|
+
return setDisplayName;
|
|
5722
|
+
}
|
|
5723
|
+
|
|
5724
|
+
var wrapDisplayName = {};
|
|
5725
|
+
|
|
5726
|
+
var getDisplayName = {};
|
|
5727
|
+
|
|
5728
|
+
var hasRequiredGetDisplayName;
|
|
5729
|
+
|
|
5730
|
+
function requireGetDisplayName () {
|
|
5731
|
+
if (hasRequiredGetDisplayName) return getDisplayName;
|
|
5732
|
+
hasRequiredGetDisplayName = 1;
|
|
5733
|
+
|
|
5734
|
+
getDisplayName.__esModule = true;
|
|
5735
|
+
getDisplayName.default = void 0;
|
|
5736
|
+
|
|
5737
|
+
var getDisplayName$1 = function getDisplayName(Component) {
|
|
5738
|
+
if (typeof Component === 'string') {
|
|
5739
|
+
return Component;
|
|
5740
|
+
}
|
|
5741
|
+
|
|
5742
|
+
if (!Component) {
|
|
5743
|
+
return undefined;
|
|
5744
|
+
}
|
|
5745
|
+
|
|
5746
|
+
return Component.displayName || Component.name || 'Component';
|
|
5747
|
+
};
|
|
5748
|
+
|
|
5749
|
+
var _default = getDisplayName$1;
|
|
5750
|
+
getDisplayName.default = _default;
|
|
5751
|
+
return getDisplayName;
|
|
5752
|
+
}
|
|
5753
|
+
|
|
5754
|
+
var hasRequiredWrapDisplayName;
|
|
5755
|
+
|
|
5756
|
+
function requireWrapDisplayName () {
|
|
5757
|
+
if (hasRequiredWrapDisplayName) return wrapDisplayName;
|
|
5758
|
+
hasRequiredWrapDisplayName = 1;
|
|
5759
|
+
|
|
5760
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
5761
|
+
|
|
5762
|
+
wrapDisplayName.__esModule = true;
|
|
5763
|
+
wrapDisplayName.default = void 0;
|
|
5764
|
+
|
|
5765
|
+
var _getDisplayName = _interopRequireDefault(requireGetDisplayName());
|
|
5766
|
+
|
|
5767
|
+
var wrapDisplayName$1 = function wrapDisplayName(BaseComponent, hocName) {
|
|
5768
|
+
return hocName + "(" + (0, _getDisplayName.default)(BaseComponent) + ")";
|
|
5769
|
+
};
|
|
5770
|
+
|
|
5771
|
+
var _default = wrapDisplayName$1;
|
|
5772
|
+
wrapDisplayName.default = _default;
|
|
5773
|
+
return wrapDisplayName;
|
|
5774
|
+
}
|
|
5775
|
+
|
|
5776
|
+
var hasRequiredShouldUpdate;
|
|
5777
|
+
|
|
5778
|
+
function requireShouldUpdate () {
|
|
5779
|
+
if (hasRequiredShouldUpdate) return shouldUpdate;
|
|
5780
|
+
hasRequiredShouldUpdate = 1;
|
|
5781
|
+
|
|
5782
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
5783
|
+
|
|
5784
|
+
shouldUpdate.__esModule = true;
|
|
5785
|
+
shouldUpdate.default = void 0;
|
|
5786
|
+
|
|
5787
|
+
var _inheritsLoose2 = _interopRequireDefault(requireInheritsLoose());
|
|
5788
|
+
|
|
5789
|
+
var _react = React;
|
|
5790
|
+
|
|
5791
|
+
var _setDisplayName = _interopRequireDefault(requireSetDisplayName());
|
|
5792
|
+
|
|
5793
|
+
var _wrapDisplayName = _interopRequireDefault(requireWrapDisplayName());
|
|
5794
|
+
|
|
5795
|
+
var shouldUpdate$1 = function shouldUpdate(test) {
|
|
5796
|
+
return function (BaseComponent) {
|
|
5797
|
+
var factory = (0, _react.createFactory)(BaseComponent);
|
|
5798
|
+
|
|
5799
|
+
var ShouldUpdate =
|
|
5800
|
+
/*#__PURE__*/
|
|
5801
|
+
function (_Component) {
|
|
5802
|
+
(0, _inheritsLoose2.default)(ShouldUpdate, _Component);
|
|
5803
|
+
|
|
5804
|
+
function ShouldUpdate() {
|
|
5805
|
+
return _Component.apply(this, arguments) || this;
|
|
5806
|
+
}
|
|
5807
|
+
|
|
5808
|
+
var _proto = ShouldUpdate.prototype;
|
|
5809
|
+
|
|
5810
|
+
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
|
5811
|
+
return test(this.props, nextProps);
|
|
5812
|
+
};
|
|
5813
|
+
|
|
5814
|
+
_proto.render = function render() {
|
|
5815
|
+
return factory(this.props);
|
|
5816
|
+
};
|
|
5817
|
+
|
|
5818
|
+
return ShouldUpdate;
|
|
5819
|
+
}(_react.Component);
|
|
5820
|
+
|
|
5821
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5822
|
+
return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'shouldUpdate'))(ShouldUpdate);
|
|
5823
|
+
}
|
|
5824
|
+
|
|
5825
|
+
return ShouldUpdate;
|
|
5826
|
+
};
|
|
5827
|
+
};
|
|
5828
|
+
|
|
5829
|
+
var _default = shouldUpdate$1;
|
|
5830
|
+
shouldUpdate.default = _default;
|
|
5831
|
+
return shouldUpdate;
|
|
5832
|
+
}
|
|
5833
|
+
|
|
5834
|
+
var shallowEqual = {};
|
|
5835
|
+
|
|
5836
|
+
/**
|
|
5837
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5838
|
+
*
|
|
5839
|
+
* This source code is licensed under the MIT license found in the
|
|
5840
|
+
* LICENSE file in the root directory of this source tree.
|
|
5841
|
+
*
|
|
5842
|
+
* @typechecks
|
|
5843
|
+
*
|
|
5844
|
+
*/
|
|
5845
|
+
|
|
5846
|
+
var shallowEqual_1;
|
|
5847
|
+
var hasRequiredShallowEqual$1;
|
|
5848
|
+
|
|
5849
|
+
function requireShallowEqual$1 () {
|
|
5850
|
+
if (hasRequiredShallowEqual$1) return shallowEqual_1;
|
|
5851
|
+
hasRequiredShallowEqual$1 = 1;
|
|
5852
|
+
|
|
5853
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
5854
|
+
|
|
5855
|
+
/**
|
|
5856
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
5857
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
5858
|
+
*/
|
|
5859
|
+
function is(x, y) {
|
|
5860
|
+
// SameValue algorithm
|
|
5861
|
+
if (x === y) {
|
|
5862
|
+
// Steps 1-5, 7-10
|
|
5863
|
+
// Steps 6.b-6.e: +0 != -0
|
|
5864
|
+
// Added the nonzero y check to make Flow happy, but it is redundant
|
|
5865
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
5866
|
+
} else {
|
|
5867
|
+
// Step 6.a: NaN == NaN
|
|
5868
|
+
return x !== x && y !== y;
|
|
5869
|
+
}
|
|
5870
|
+
}
|
|
5871
|
+
|
|
5872
|
+
/**
|
|
5873
|
+
* Performs equality by iterating through keys on an object and returning false
|
|
5874
|
+
* when any key has values which are not strictly equal between the arguments.
|
|
5875
|
+
* Returns true when the values of all keys are strictly equal.
|
|
5876
|
+
*/
|
|
5877
|
+
function shallowEqual(objA, objB) {
|
|
5878
|
+
if (is(objA, objB)) {
|
|
5879
|
+
return true;
|
|
5880
|
+
}
|
|
5881
|
+
|
|
5882
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
5883
|
+
return false;
|
|
5884
|
+
}
|
|
5885
|
+
|
|
5886
|
+
var keysA = Object.keys(objA);
|
|
5887
|
+
var keysB = Object.keys(objB);
|
|
5888
|
+
|
|
5889
|
+
if (keysA.length !== keysB.length) {
|
|
5890
|
+
return false;
|
|
5891
|
+
}
|
|
5892
|
+
|
|
5893
|
+
// Test for A's keys different from B.
|
|
5894
|
+
for (var i = 0; i < keysA.length; i++) {
|
|
5895
|
+
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
5896
|
+
return false;
|
|
5897
|
+
}
|
|
5898
|
+
}
|
|
5899
|
+
|
|
5900
|
+
return true;
|
|
5901
|
+
}
|
|
5902
|
+
|
|
5903
|
+
shallowEqual_1 = shallowEqual;
|
|
5904
|
+
return shallowEqual_1;
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5907
|
+
var hasRequiredShallowEqual;
|
|
5908
|
+
|
|
5909
|
+
function requireShallowEqual () {
|
|
5910
|
+
if (hasRequiredShallowEqual) return shallowEqual;
|
|
5911
|
+
hasRequiredShallowEqual = 1;
|
|
5912
|
+
|
|
5913
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
5914
|
+
|
|
5915
|
+
shallowEqual.__esModule = true;
|
|
5916
|
+
shallowEqual.default = void 0;
|
|
5917
|
+
|
|
5918
|
+
var _shallowEqual = _interopRequireDefault(requireShallowEqual$1());
|
|
5919
|
+
|
|
5920
|
+
var _default = _shallowEqual.default;
|
|
5921
|
+
shallowEqual.default = _default;
|
|
5922
|
+
return shallowEqual;
|
|
5923
|
+
}
|
|
5924
|
+
|
|
5925
|
+
var hasRequiredPure;
|
|
5926
|
+
|
|
5927
|
+
function requirePure () {
|
|
5928
|
+
if (hasRequiredPure) return pure;
|
|
5929
|
+
hasRequiredPure = 1;
|
|
5930
|
+
|
|
5931
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
5932
|
+
|
|
5933
|
+
pure.__esModule = true;
|
|
5934
|
+
pure.default = void 0;
|
|
5935
|
+
|
|
5936
|
+
var _shouldUpdate = _interopRequireDefault(requireShouldUpdate());
|
|
5937
|
+
|
|
5938
|
+
var _shallowEqual = _interopRequireDefault(requireShallowEqual());
|
|
5939
|
+
|
|
5940
|
+
var _setDisplayName = _interopRequireDefault(requireSetDisplayName());
|
|
5941
|
+
|
|
5942
|
+
var _wrapDisplayName = _interopRequireDefault(requireWrapDisplayName());
|
|
5943
|
+
|
|
5944
|
+
var pure$1 = function pure(BaseComponent) {
|
|
5945
|
+
var hoc = (0, _shouldUpdate.default)(function (props, nextProps) {
|
|
5946
|
+
return !(0, _shallowEqual.default)(props, nextProps);
|
|
5947
|
+
});
|
|
5948
|
+
|
|
5949
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5950
|
+
return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'pure'))(hoc(BaseComponent));
|
|
5951
|
+
}
|
|
5952
|
+
|
|
5953
|
+
return hoc(BaseComponent);
|
|
5954
|
+
};
|
|
5955
|
+
|
|
5956
|
+
var _default = pure$1;
|
|
5957
|
+
pure.default = _default;
|
|
5958
|
+
return pure;
|
|
5959
|
+
}
|
|
5960
|
+
|
|
5961
|
+
var hasRequiredCreateSvgIcon;
|
|
5962
|
+
|
|
5963
|
+
function requireCreateSvgIcon () {
|
|
5964
|
+
if (hasRequiredCreateSvgIcon) return createSvgIcon;
|
|
5965
|
+
hasRequiredCreateSvgIcon = 1;
|
|
5966
|
+
|
|
5967
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
5968
|
+
|
|
5969
|
+
Object.defineProperty(createSvgIcon, "__esModule", {
|
|
5970
|
+
value: true
|
|
5971
|
+
});
|
|
5972
|
+
createSvgIcon.default = void 0;
|
|
5973
|
+
|
|
5974
|
+
var _react = _interopRequireDefault(React);
|
|
5975
|
+
|
|
5976
|
+
var _pure = _interopRequireDefault(requirePure());
|
|
5977
|
+
|
|
5978
|
+
var _SvgIcon = _interopRequireDefault(require$$3);
|
|
5979
|
+
|
|
5980
|
+
function createSvgIcon$1(path, displayName) {
|
|
5981
|
+
var Icon = function Icon(props) {
|
|
5982
|
+
return _react.default.createElement(_SvgIcon.default, props, path);
|
|
5983
|
+
};
|
|
5984
|
+
|
|
5985
|
+
Icon.displayName = "".concat(displayName, "Icon");
|
|
5986
|
+
Icon = (0, _pure.default)(Icon);
|
|
5987
|
+
Icon.muiName = 'SvgIcon';
|
|
5988
|
+
return Icon;
|
|
5989
|
+
}
|
|
5990
|
+
var _default = createSvgIcon$1;
|
|
5991
|
+
createSvgIcon.default = _default;
|
|
5992
|
+
return createSvgIcon;
|
|
5993
|
+
}
|
|
5994
|
+
|
|
5995
|
+
var hasRequiredExpandMore;
|
|
5996
|
+
|
|
5997
|
+
function requireExpandMore () {
|
|
5998
|
+
if (hasRequiredExpandMore) return ExpandMore;
|
|
5999
|
+
hasRequiredExpandMore = 1;
|
|
6000
|
+
|
|
6001
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
6002
|
+
|
|
6003
|
+
Object.defineProperty(ExpandMore, "__esModule", {
|
|
6004
|
+
value: true
|
|
6005
|
+
});
|
|
6006
|
+
ExpandMore.default = void 0;
|
|
6007
|
+
|
|
6008
|
+
var _react = _interopRequireDefault(React);
|
|
6009
|
+
|
|
6010
|
+
var _createSvgIcon = _interopRequireDefault(/*@__PURE__*/ requireCreateSvgIcon());
|
|
6011
|
+
|
|
6012
|
+
var _default = (0, _createSvgIcon.default)(_react.default.createElement(_react.default.Fragment, null, _react.default.createElement("path", {
|
|
6013
|
+
d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
6014
|
+
}), _react.default.createElement("path", {
|
|
6015
|
+
fill: "none",
|
|
6016
|
+
d: "M0 0h24v24H0z"
|
|
6017
|
+
})), 'ExpandMore');
|
|
6018
|
+
|
|
6019
|
+
ExpandMore.default = _default;
|
|
6020
|
+
return ExpandMore;
|
|
6021
|
+
}
|
|
6022
|
+
|
|
6023
|
+
var ExpandMoreExports = /*@__PURE__*/ requireExpandMore();
|
|
6024
|
+
var ExpandMoreIcon = /*@__PURE__*/getDefaultExportFromCjs(ExpandMoreExports);
|
|
6025
|
+
|
|
4983
6026
|
const setToolbarAvailability = toolbarTools => toolsArr.map(tA => _extends({}, tA, {
|
|
4984
6027
|
toolbar: !!toolbarTools.find(t => t === tA.type)
|
|
4985
6028
|
})) || [];
|
|
@@ -5218,8 +6261,8 @@ const mapStateToProps = s => ({
|
|
|
5218
6261
|
|
|
5219
6262
|
const mapDispatchToProps = dispatch => ({
|
|
5220
6263
|
onChangeMarks: m => dispatch(changeMarks(m)),
|
|
5221
|
-
onUndo: () => dispatch(ActionCreators.undo()),
|
|
5222
|
-
onRedo: () => dispatch(ActionCreators.redo()),
|
|
6264
|
+
onUndo: () => dispatch(libExports.ActionCreators.undo()),
|
|
6265
|
+
onRedo: () => dispatch(libExports.ActionCreators.redo()),
|
|
5223
6266
|
onReset: () => dispatch(changeMarks([]))
|
|
5224
6267
|
});
|
|
5225
6268
|
|