@pie-lib/graphing-solution-set 2.31.1 → 2.31.3
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 +1050 -7
- package/esm/index.js.map +1 -1
- package/package.json +9 -9
- package/LICENSE.md +0 -5
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 Radio from '@material-ui/core/Radio';
|
|
@@ -31,7 +30,7 @@ import ReactDOM from 'react-dom';
|
|
|
31
30
|
import AutosizeInput from 'react-input-autosize';
|
|
32
31
|
import { withStyles as withStyles$2 } from '@material-ui/core/styles/index';
|
|
33
32
|
import InputBase from '@material-ui/core/InputBase';
|
|
34
|
-
import
|
|
33
|
+
import require$$3 from '@material-ui/core/SvgIcon';
|
|
35
34
|
import ExpansionPanelSummary$1 from '@material-ui/core/ExpansionPanelSummary';
|
|
36
35
|
import Typography$1 from '@material-ui/core/Typography';
|
|
37
36
|
import ExpansionPanelDetails$1 from '@material-ui/core/ExpansionPanelDetails';
|
|
@@ -1032,7 +1031,7 @@ Bg.propTypes = {
|
|
|
1032
1031
|
};
|
|
1033
1032
|
Bg.defaultProps = {};
|
|
1034
1033
|
|
|
1035
|
-
const log$1 = debug('pie-lib:graphing-solution-set:graph');
|
|
1034
|
+
const log$1 = debug$1('pie-lib:graphing-solution-set:graph');
|
|
1036
1035
|
const graphPropTypes = {
|
|
1037
1036
|
axesSettings: PropTypes.shape(AxisPropTypes),
|
|
1038
1037
|
backgroundMarks: PropTypes.array,
|
|
@@ -1366,6 +1365,629 @@ const marks = (state = [], action) => {
|
|
|
1366
1365
|
}
|
|
1367
1366
|
};
|
|
1368
1367
|
|
|
1368
|
+
function getDefaultExportFromCjs (x) {
|
|
1369
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
var lib = {};
|
|
1373
|
+
|
|
1374
|
+
var actions = {};
|
|
1375
|
+
|
|
1376
|
+
var hasRequiredActions;
|
|
1377
|
+
|
|
1378
|
+
function requireActions () {
|
|
1379
|
+
if (hasRequiredActions) return actions;
|
|
1380
|
+
hasRequiredActions = 1;
|
|
1381
|
+
|
|
1382
|
+
Object.defineProperty(actions, "__esModule", {
|
|
1383
|
+
value: true
|
|
1384
|
+
});
|
|
1385
|
+
var ActionTypes = actions.ActionTypes = {
|
|
1386
|
+
UNDO: '@@redux-undo/UNDO',
|
|
1387
|
+
REDO: '@@redux-undo/REDO',
|
|
1388
|
+
JUMP_TO_FUTURE: '@@redux-undo/JUMP_TO_FUTURE',
|
|
1389
|
+
JUMP_TO_PAST: '@@redux-undo/JUMP_TO_PAST',
|
|
1390
|
+
JUMP: '@@redux-undo/JUMP',
|
|
1391
|
+
CLEAR_HISTORY: '@@redux-undo/CLEAR_HISTORY'
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
actions.ActionCreators = {
|
|
1395
|
+
undo: function undo() {
|
|
1396
|
+
return { type: ActionTypes.UNDO };
|
|
1397
|
+
},
|
|
1398
|
+
redo: function redo() {
|
|
1399
|
+
return { type: ActionTypes.REDO };
|
|
1400
|
+
},
|
|
1401
|
+
jumpToFuture: function jumpToFuture(index) {
|
|
1402
|
+
return { type: ActionTypes.JUMP_TO_FUTURE, index: index };
|
|
1403
|
+
},
|
|
1404
|
+
jumpToPast: function jumpToPast(index) {
|
|
1405
|
+
return { type: ActionTypes.JUMP_TO_PAST, index: index };
|
|
1406
|
+
},
|
|
1407
|
+
jump: function jump(index) {
|
|
1408
|
+
return { type: ActionTypes.JUMP, index: index };
|
|
1409
|
+
},
|
|
1410
|
+
clearHistory: function clearHistory() {
|
|
1411
|
+
return { type: ActionTypes.CLEAR_HISTORY };
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
return actions;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
var helpers = {};
|
|
1418
|
+
|
|
1419
|
+
var hasRequiredHelpers;
|
|
1420
|
+
|
|
1421
|
+
function requireHelpers () {
|
|
1422
|
+
if (hasRequiredHelpers) return helpers;
|
|
1423
|
+
hasRequiredHelpers = 1;
|
|
1424
|
+
|
|
1425
|
+
Object.defineProperty(helpers, "__esModule", {
|
|
1426
|
+
value: true
|
|
1427
|
+
});
|
|
1428
|
+
helpers.parseActions = parseActions;
|
|
1429
|
+
helpers.isHistory = isHistory;
|
|
1430
|
+
helpers.distinctState = distinctState;
|
|
1431
|
+
helpers.includeAction = includeAction;
|
|
1432
|
+
helpers.excludeAction = excludeAction;
|
|
1433
|
+
helpers.combineFilters = combineFilters;
|
|
1434
|
+
helpers.groupByActionTypes = groupByActionTypes;
|
|
1435
|
+
helpers.newHistory = newHistory;
|
|
1436
|
+
// parseActions helper: takes a string (or array)
|
|
1437
|
+
// and makes it an array if it isn't yet
|
|
1438
|
+
function parseActions(rawActions) {
|
|
1439
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
1440
|
+
|
|
1441
|
+
if (Array.isArray(rawActions)) {
|
|
1442
|
+
return rawActions;
|
|
1443
|
+
} else if (typeof rawActions === 'string') {
|
|
1444
|
+
return [rawActions];
|
|
1445
|
+
}
|
|
1446
|
+
return defaultValue;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
// isHistory helper: check for a valid history object
|
|
1450
|
+
function isHistory(history) {
|
|
1451
|
+
return typeof history.present !== 'undefined' && typeof history.future !== 'undefined' && typeof history.past !== 'undefined' && Array.isArray(history.future) && Array.isArray(history.past);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
// distinctState helper: deprecated, does nothing in latest beta
|
|
1455
|
+
/* istanbul ignore next */
|
|
1456
|
+
function distinctState() {
|
|
1457
|
+
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.');
|
|
1458
|
+
return function () {
|
|
1459
|
+
return true;
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// includeAction helper: whitelist actions to be added to the history
|
|
1464
|
+
function includeAction(rawActions) {
|
|
1465
|
+
var actions = parseActions(rawActions);
|
|
1466
|
+
return function (action) {
|
|
1467
|
+
return actions.indexOf(action.type) >= 0;
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
// excludeAction helper: blacklist actions from being added to the history
|
|
1472
|
+
function excludeAction(rawActions) {
|
|
1473
|
+
var actions = parseActions(rawActions);
|
|
1474
|
+
return function (action) {
|
|
1475
|
+
return actions.indexOf(action.type) < 0;
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
// combineFilters helper: combine multiple filters to one
|
|
1480
|
+
function combineFilters() {
|
|
1481
|
+
for (var _len = arguments.length, filters = Array(_len), _key = 0; _key < _len; _key++) {
|
|
1482
|
+
filters[_key] = arguments[_key];
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
return filters.reduce(function (prev, curr) {
|
|
1486
|
+
return function (action, currentState, previousHistory) {
|
|
1487
|
+
return prev(action, currentState, previousHistory) && curr(action, currentState, previousHistory);
|
|
1488
|
+
};
|
|
1489
|
+
}, function () {
|
|
1490
|
+
return true;
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
function groupByActionTypes(rawActions) {
|
|
1495
|
+
var actions = parseActions(rawActions);
|
|
1496
|
+
return function (action) {
|
|
1497
|
+
return actions.indexOf(action.type) >= 0 ? action.type : null;
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
function newHistory(past, present, future) {
|
|
1502
|
+
var group = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
1503
|
+
|
|
1504
|
+
return {
|
|
1505
|
+
past: past,
|
|
1506
|
+
present: present,
|
|
1507
|
+
future: future,
|
|
1508
|
+
group: group,
|
|
1509
|
+
_latestUnfiltered: present,
|
|
1510
|
+
index: past.length,
|
|
1511
|
+
limit: past.length + future.length + 1
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
return helpers;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
var reducer$1 = {exports: {}};
|
|
1518
|
+
|
|
1519
|
+
var debug = {};
|
|
1520
|
+
|
|
1521
|
+
var hasRequiredDebug;
|
|
1522
|
+
|
|
1523
|
+
function requireDebug () {
|
|
1524
|
+
if (hasRequiredDebug) return debug;
|
|
1525
|
+
hasRequiredDebug = 1;
|
|
1526
|
+
|
|
1527
|
+
Object.defineProperty(debug, "__esModule", {
|
|
1528
|
+
value: true
|
|
1529
|
+
});
|
|
1530
|
+
|
|
1531
|
+
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); } }
|
|
1532
|
+
|
|
1533
|
+
var __DEBUG__ = void 0;
|
|
1534
|
+
var displayBuffer = void 0;
|
|
1535
|
+
|
|
1536
|
+
var colors = {
|
|
1537
|
+
prevState: '#9E9E9E',
|
|
1538
|
+
action: '#03A9F4',
|
|
1539
|
+
nextState: '#4CAF50'
|
|
1540
|
+
|
|
1541
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1542
|
+
};function initBuffer() {
|
|
1543
|
+
displayBuffer = {
|
|
1544
|
+
header: [],
|
|
1545
|
+
prev: [],
|
|
1546
|
+
action: [],
|
|
1547
|
+
next: [],
|
|
1548
|
+
msgs: []
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1553
|
+
function printBuffer() {
|
|
1554
|
+
var _displayBuffer = displayBuffer,
|
|
1555
|
+
header = _displayBuffer.header,
|
|
1556
|
+
prev = _displayBuffer.prev,
|
|
1557
|
+
next = _displayBuffer.next,
|
|
1558
|
+
action = _displayBuffer.action,
|
|
1559
|
+
msgs = _displayBuffer.msgs;
|
|
1560
|
+
|
|
1561
|
+
if (console.group) {
|
|
1562
|
+
var _console, _console2, _console3, _console4, _console5;
|
|
1563
|
+
|
|
1564
|
+
(_console = console).groupCollapsed.apply(_console, _toConsumableArray(header));
|
|
1565
|
+
(_console2 = console).log.apply(_console2, _toConsumableArray(prev));
|
|
1566
|
+
(_console3 = console).log.apply(_console3, _toConsumableArray(action));
|
|
1567
|
+
(_console4 = console).log.apply(_console4, _toConsumableArray(next));
|
|
1568
|
+
(_console5 = console).log.apply(_console5, _toConsumableArray(msgs));
|
|
1569
|
+
console.groupEnd();
|
|
1570
|
+
} else {
|
|
1571
|
+
var _console6, _console7, _console8, _console9, _console10;
|
|
1572
|
+
|
|
1573
|
+
(_console6 = console).log.apply(_console6, _toConsumableArray(header));
|
|
1574
|
+
(_console7 = console).log.apply(_console7, _toConsumableArray(prev));
|
|
1575
|
+
(_console8 = console).log.apply(_console8, _toConsumableArray(action));
|
|
1576
|
+
(_console9 = console).log.apply(_console9, _toConsumableArray(next));
|
|
1577
|
+
(_console10 = console).log.apply(_console10, _toConsumableArray(msgs));
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1582
|
+
function colorFormat(text, color, obj) {
|
|
1583
|
+
return ['%c' + text, 'color: ' + color + '; font-weight: bold', obj];
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1587
|
+
function start(action, state) {
|
|
1588
|
+
initBuffer();
|
|
1589
|
+
if (__DEBUG__) {
|
|
1590
|
+
if (console.group) {
|
|
1591
|
+
displayBuffer.header = ['%credux-undo', 'font-style: italic', 'action', action.type];
|
|
1592
|
+
displayBuffer.action = colorFormat('action', colors.action, action);
|
|
1593
|
+
displayBuffer.prev = colorFormat('prev history', colors.prevState, state);
|
|
1594
|
+
} else {
|
|
1595
|
+
displayBuffer.header = ['redux-undo action', action.type];
|
|
1596
|
+
displayBuffer.action = ['action', action];
|
|
1597
|
+
displayBuffer.prev = ['prev history', state];
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1603
|
+
function end(nextState) {
|
|
1604
|
+
if (__DEBUG__) {
|
|
1605
|
+
if (console.group) {
|
|
1606
|
+
displayBuffer.next = colorFormat('next history', colors.nextState, nextState);
|
|
1607
|
+
} else {
|
|
1608
|
+
displayBuffer.next = ['next history', nextState];
|
|
1609
|
+
}
|
|
1610
|
+
printBuffer();
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1615
|
+
function log() {
|
|
1616
|
+
if (__DEBUG__) {
|
|
1617
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
1618
|
+
args[_key] = arguments[_key];
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\n']));
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
/* istanbul ignore next: debug messaging is not tested */
|
|
1626
|
+
function set(debug) {
|
|
1627
|
+
__DEBUG__ = debug;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
debug.set = set;
|
|
1631
|
+
debug.start = start;
|
|
1632
|
+
debug.end = end;
|
|
1633
|
+
debug.log = log;
|
|
1634
|
+
return debug;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
var hasRequiredReducer;
|
|
1638
|
+
|
|
1639
|
+
function requireReducer () {
|
|
1640
|
+
if (hasRequiredReducer) return reducer$1.exports;
|
|
1641
|
+
hasRequiredReducer = 1;
|
|
1642
|
+
(function (module, exports) {
|
|
1643
|
+
|
|
1644
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1645
|
+
value: true
|
|
1646
|
+
});
|
|
1647
|
+
|
|
1648
|
+
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; };
|
|
1649
|
+
|
|
1650
|
+
exports.default = undoable;
|
|
1651
|
+
|
|
1652
|
+
var _debug = requireDebug();
|
|
1653
|
+
|
|
1654
|
+
var debug = _interopRequireWildcard(_debug);
|
|
1655
|
+
|
|
1656
|
+
var _actions = requireActions();
|
|
1657
|
+
|
|
1658
|
+
var _helpers = requireHelpers();
|
|
1659
|
+
|
|
1660
|
+
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; } }
|
|
1661
|
+
|
|
1662
|
+
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); } }
|
|
1663
|
+
|
|
1664
|
+
// createHistory
|
|
1665
|
+
function createHistory(state, ignoreInitialState) {
|
|
1666
|
+
// ignoreInitialState essentially prevents the user from undoing to the
|
|
1667
|
+
// beginning, in the case that the undoable reducer handles initialization
|
|
1668
|
+
// in a way that can't be redone simply
|
|
1669
|
+
var history = (0, _helpers.newHistory)([], state, []);
|
|
1670
|
+
if (ignoreInitialState) {
|
|
1671
|
+
history._latestUnfiltered = null;
|
|
1672
|
+
}
|
|
1673
|
+
return history;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
// lengthWithoutFuture: get length of history
|
|
1677
|
+
function lengthWithoutFuture(history) {
|
|
1678
|
+
return history.past.length + 1;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
// insert: insert `state` into history, which means adding the current state
|
|
1682
|
+
// into `past`, setting the new `state` as `present` and erasing
|
|
1683
|
+
// the `future`.
|
|
1684
|
+
function insert(history, state, limit, group) {
|
|
1685
|
+
debug.log('inserting', state);
|
|
1686
|
+
debug.log('new free: ', limit - lengthWithoutFuture(history));
|
|
1687
|
+
|
|
1688
|
+
var past = history.past,
|
|
1689
|
+
_latestUnfiltered = history._latestUnfiltered;
|
|
1690
|
+
|
|
1691
|
+
var historyOverflow = limit && lengthWithoutFuture(history) >= limit;
|
|
1692
|
+
|
|
1693
|
+
var pastSliced = past.slice(historyOverflow ? 1 : 0);
|
|
1694
|
+
var newPast = _latestUnfiltered != null ? [].concat(_toConsumableArray(pastSliced), [_latestUnfiltered]) : pastSliced;
|
|
1695
|
+
|
|
1696
|
+
return (0, _helpers.newHistory)(newPast, state, [], group);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
// jumpToFuture: jump to requested index in future history
|
|
1700
|
+
function jumpToFuture(history, index) {
|
|
1701
|
+
if (index < 0 || index >= history.future.length) return history;
|
|
1702
|
+
|
|
1703
|
+
var past = history.past,
|
|
1704
|
+
future = history.future,
|
|
1705
|
+
_latestUnfiltered = history._latestUnfiltered;
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
var newPast = [].concat(_toConsumableArray(past), [_latestUnfiltered], _toConsumableArray(future.slice(0, index)));
|
|
1709
|
+
var newPresent = future[index];
|
|
1710
|
+
var newFuture = future.slice(index + 1);
|
|
1711
|
+
|
|
1712
|
+
return (0, _helpers.newHistory)(newPast, newPresent, newFuture);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// jumpToPast: jump to requested index in past history
|
|
1716
|
+
function jumpToPast(history, index) {
|
|
1717
|
+
if (index < 0 || index >= history.past.length) return history;
|
|
1718
|
+
|
|
1719
|
+
var past = history.past,
|
|
1720
|
+
future = history.future,
|
|
1721
|
+
_latestUnfiltered = history._latestUnfiltered;
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
var newPast = past.slice(0, index);
|
|
1725
|
+
var newFuture = [].concat(_toConsumableArray(past.slice(index + 1)), [_latestUnfiltered], _toConsumableArray(future));
|
|
1726
|
+
var newPresent = past[index];
|
|
1727
|
+
|
|
1728
|
+
return (0, _helpers.newHistory)(newPast, newPresent, newFuture);
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
// jump: jump n steps in the past or forward
|
|
1732
|
+
function jump(history, n) {
|
|
1733
|
+
if (n > 0) return jumpToFuture(history, n - 1);
|
|
1734
|
+
if (n < 0) return jumpToPast(history, history.past.length + n);
|
|
1735
|
+
return history;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
// helper to dynamically match in the reducer's switch-case
|
|
1739
|
+
function actionTypeAmongClearHistoryType(actionType, clearHistoryType) {
|
|
1740
|
+
return clearHistoryType.indexOf(actionType) > -1 ? actionType : !actionType;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
// redux-undo higher order reducer
|
|
1744
|
+
function undoable(reducer) {
|
|
1745
|
+
var rawConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1746
|
+
|
|
1747
|
+
debug.set(rawConfig.debug);
|
|
1748
|
+
|
|
1749
|
+
var config = {
|
|
1750
|
+
initTypes: (0, _helpers.parseActions)(rawConfig.initTypes, ['@@redux-undo/INIT']),
|
|
1751
|
+
limit: rawConfig.limit,
|
|
1752
|
+
filter: rawConfig.filter || function () {
|
|
1753
|
+
return true;
|
|
1754
|
+
},
|
|
1755
|
+
groupBy: rawConfig.groupBy || function () {
|
|
1756
|
+
return null;
|
|
1757
|
+
},
|
|
1758
|
+
undoType: rawConfig.undoType || _actions.ActionTypes.UNDO,
|
|
1759
|
+
redoType: rawConfig.redoType || _actions.ActionTypes.REDO,
|
|
1760
|
+
jumpToPastType: rawConfig.jumpToPastType || _actions.ActionTypes.JUMP_TO_PAST,
|
|
1761
|
+
jumpToFutureType: rawConfig.jumpToFutureType || _actions.ActionTypes.JUMP_TO_FUTURE,
|
|
1762
|
+
jumpType: rawConfig.jumpType || _actions.ActionTypes.JUMP,
|
|
1763
|
+
clearHistoryType: Array.isArray(rawConfig.clearHistoryType) ? rawConfig.clearHistoryType : [rawConfig.clearHistoryType || _actions.ActionTypes.CLEAR_HISTORY],
|
|
1764
|
+
neverSkipReducer: rawConfig.neverSkipReducer || false,
|
|
1765
|
+
ignoreInitialState: rawConfig.ignoreInitialState || false,
|
|
1766
|
+
syncFilter: rawConfig.syncFilter || false
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
var initialState = config.history;
|
|
1770
|
+
return function () {
|
|
1771
|
+
for (var _len = arguments.length, slices = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1772
|
+
slices[_key - 2] = arguments[_key];
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
1776
|
+
var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1777
|
+
|
|
1778
|
+
debug.start(action, state);
|
|
1779
|
+
|
|
1780
|
+
var history = state;
|
|
1781
|
+
if (!initialState) {
|
|
1782
|
+
debug.log('history is uninitialized');
|
|
1783
|
+
|
|
1784
|
+
if (state === undefined) {
|
|
1785
|
+
var clearHistoryAction = { type: _actions.ActionTypes.CLEAR_HISTORY };
|
|
1786
|
+
var start = reducer.apply(undefined, [state, clearHistoryAction].concat(slices));
|
|
1787
|
+
|
|
1788
|
+
history = createHistory(start, config.ignoreInitialState);
|
|
1789
|
+
|
|
1790
|
+
debug.log('do not set initialState on probe actions');
|
|
1791
|
+
} else if ((0, _helpers.isHistory)(state)) {
|
|
1792
|
+
history = initialState = config.ignoreInitialState ? state : (0, _helpers.newHistory)(state.past, state.present, state.future);
|
|
1793
|
+
debug.log('initialHistory initialized: initialState is a history', initialState);
|
|
1794
|
+
} else {
|
|
1795
|
+
history = initialState = createHistory(state, config.ignoreInitialState);
|
|
1796
|
+
debug.log('initialHistory initialized: initialState is not a history', initialState);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
var skipReducer = function skipReducer(res) {
|
|
1801
|
+
return config.neverSkipReducer ? _extends({}, res, {
|
|
1802
|
+
present: reducer.apply(undefined, [res.present, action].concat(slices))
|
|
1803
|
+
}) : res;
|
|
1804
|
+
};
|
|
1805
|
+
|
|
1806
|
+
var res = void 0;
|
|
1807
|
+
switch (action.type) {
|
|
1808
|
+
case undefined:
|
|
1809
|
+
return history;
|
|
1810
|
+
|
|
1811
|
+
case config.undoType:
|
|
1812
|
+
res = jump(history, -1);
|
|
1813
|
+
debug.log('perform undo');
|
|
1814
|
+
debug.end(res);
|
|
1815
|
+
return skipReducer(res);
|
|
1816
|
+
|
|
1817
|
+
case config.redoType:
|
|
1818
|
+
res = jump(history, 1);
|
|
1819
|
+
debug.log('perform redo');
|
|
1820
|
+
debug.end(res);
|
|
1821
|
+
return skipReducer(res);
|
|
1822
|
+
|
|
1823
|
+
case config.jumpToPastType:
|
|
1824
|
+
res = jumpToPast(history, action.index);
|
|
1825
|
+
debug.log('perform jumpToPast to ' + action.index);
|
|
1826
|
+
debug.end(res);
|
|
1827
|
+
return skipReducer(res);
|
|
1828
|
+
|
|
1829
|
+
case config.jumpToFutureType:
|
|
1830
|
+
res = jumpToFuture(history, action.index);
|
|
1831
|
+
debug.log('perform jumpToFuture to ' + action.index);
|
|
1832
|
+
debug.end(res);
|
|
1833
|
+
return skipReducer(res);
|
|
1834
|
+
|
|
1835
|
+
case config.jumpType:
|
|
1836
|
+
res = jump(history, action.index);
|
|
1837
|
+
debug.log('perform jump to ' + action.index);
|
|
1838
|
+
debug.end(res);
|
|
1839
|
+
return skipReducer(res);
|
|
1840
|
+
|
|
1841
|
+
case actionTypeAmongClearHistoryType(action.type, config.clearHistoryType):
|
|
1842
|
+
res = createHistory(history.present);
|
|
1843
|
+
debug.log('perform clearHistory');
|
|
1844
|
+
debug.end(res);
|
|
1845
|
+
return skipReducer(res);
|
|
1846
|
+
|
|
1847
|
+
default:
|
|
1848
|
+
res = reducer.apply(undefined, [history.present, action].concat(slices));
|
|
1849
|
+
|
|
1850
|
+
if (config.initTypes.some(function (actionType) {
|
|
1851
|
+
return actionType === action.type;
|
|
1852
|
+
})) {
|
|
1853
|
+
debug.log('reset history due to init action');
|
|
1854
|
+
debug.end(initialState);
|
|
1855
|
+
return initialState;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
if (history._latestUnfiltered === res) {
|
|
1859
|
+
// Don't handle this action. Do not call debug.end here,
|
|
1860
|
+
// because this action should not produce side effects to the console
|
|
1861
|
+
return history;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
var filtered = typeof config.filter === 'function' && !config.filter(action, res, history);
|
|
1865
|
+
var group = config.groupBy(action, res, history);
|
|
1866
|
+
|
|
1867
|
+
if (filtered) {
|
|
1868
|
+
// if filtering an action, merely update the present
|
|
1869
|
+
var filteredState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);
|
|
1870
|
+
if (!config.syncFilter) {
|
|
1871
|
+
filteredState._latestUnfiltered = history._latestUnfiltered;
|
|
1872
|
+
}
|
|
1873
|
+
debug.log('filter ignored action, not storing it in past');
|
|
1874
|
+
debug.end(filteredState);
|
|
1875
|
+
return filteredState;
|
|
1876
|
+
} else if (group != null && group === history.group) {
|
|
1877
|
+
var groupedState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);
|
|
1878
|
+
debug.log('groupBy grouped the action with the previous action');
|
|
1879
|
+
debug.end(groupedState);
|
|
1880
|
+
return groupedState;
|
|
1881
|
+
} else {
|
|
1882
|
+
// If the action wasn't filtered, insert normally
|
|
1883
|
+
history = insert(history, res, config.limit, group);
|
|
1884
|
+
|
|
1885
|
+
debug.log('inserted new state into history');
|
|
1886
|
+
debug.end(history);
|
|
1887
|
+
return history;
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
module.exports = exports['default'];
|
|
1893
|
+
} (reducer$1, reducer$1.exports));
|
|
1894
|
+
return reducer$1.exports;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
var hasRequiredLib;
|
|
1898
|
+
|
|
1899
|
+
function requireLib () {
|
|
1900
|
+
if (hasRequiredLib) return lib;
|
|
1901
|
+
hasRequiredLib = 1;
|
|
1902
|
+
(function (exports) {
|
|
1903
|
+
|
|
1904
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1905
|
+
value: true
|
|
1906
|
+
});
|
|
1907
|
+
|
|
1908
|
+
var _actions = requireActions();
|
|
1909
|
+
|
|
1910
|
+
Object.defineProperty(exports, 'ActionTypes', {
|
|
1911
|
+
enumerable: true,
|
|
1912
|
+
get: function get() {
|
|
1913
|
+
return _actions.ActionTypes;
|
|
1914
|
+
}
|
|
1915
|
+
});
|
|
1916
|
+
Object.defineProperty(exports, 'ActionCreators', {
|
|
1917
|
+
enumerable: true,
|
|
1918
|
+
get: function get() {
|
|
1919
|
+
return _actions.ActionCreators;
|
|
1920
|
+
}
|
|
1921
|
+
});
|
|
1922
|
+
|
|
1923
|
+
var _helpers = requireHelpers();
|
|
1924
|
+
|
|
1925
|
+
Object.defineProperty(exports, 'parseActions', {
|
|
1926
|
+
enumerable: true,
|
|
1927
|
+
get: function get() {
|
|
1928
|
+
return _helpers.parseActions;
|
|
1929
|
+
}
|
|
1930
|
+
});
|
|
1931
|
+
Object.defineProperty(exports, 'isHistory', {
|
|
1932
|
+
enumerable: true,
|
|
1933
|
+
get: function get() {
|
|
1934
|
+
return _helpers.isHistory;
|
|
1935
|
+
}
|
|
1936
|
+
});
|
|
1937
|
+
Object.defineProperty(exports, 'distinctState', {
|
|
1938
|
+
enumerable: true,
|
|
1939
|
+
get: function get() {
|
|
1940
|
+
return _helpers.distinctState;
|
|
1941
|
+
}
|
|
1942
|
+
});
|
|
1943
|
+
Object.defineProperty(exports, 'includeAction', {
|
|
1944
|
+
enumerable: true,
|
|
1945
|
+
get: function get() {
|
|
1946
|
+
return _helpers.includeAction;
|
|
1947
|
+
}
|
|
1948
|
+
});
|
|
1949
|
+
Object.defineProperty(exports, 'excludeAction', {
|
|
1950
|
+
enumerable: true,
|
|
1951
|
+
get: function get() {
|
|
1952
|
+
return _helpers.excludeAction;
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
Object.defineProperty(exports, 'combineFilters', {
|
|
1956
|
+
enumerable: true,
|
|
1957
|
+
get: function get() {
|
|
1958
|
+
return _helpers.combineFilters;
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
Object.defineProperty(exports, 'groupByActionTypes', {
|
|
1962
|
+
enumerable: true,
|
|
1963
|
+
get: function get() {
|
|
1964
|
+
return _helpers.groupByActionTypes;
|
|
1965
|
+
}
|
|
1966
|
+
});
|
|
1967
|
+
Object.defineProperty(exports, 'newHistory', {
|
|
1968
|
+
enumerable: true,
|
|
1969
|
+
get: function get() {
|
|
1970
|
+
return _helpers.newHistory;
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
|
|
1974
|
+
var _reducer = requireReducer();
|
|
1975
|
+
|
|
1976
|
+
Object.defineProperty(exports, 'default', {
|
|
1977
|
+
enumerable: true,
|
|
1978
|
+
get: function get() {
|
|
1979
|
+
return _interopRequireDefault(_reducer).default;
|
|
1980
|
+
}
|
|
1981
|
+
});
|
|
1982
|
+
|
|
1983
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1984
|
+
} (lib));
|
|
1985
|
+
return lib;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
var libExports = requireLib();
|
|
1989
|
+
var undoable = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
1990
|
+
|
|
1369
1991
|
var reducer = (() => combineReducers({
|
|
1370
1992
|
marks: undoable(marks, {
|
|
1371
1993
|
debug: false
|
|
@@ -1966,7 +2588,7 @@ var MarkLabel$1 = withStyles(styles$5, {
|
|
|
1966
2588
|
withTheme: true
|
|
1967
2589
|
})(MarkLabel);
|
|
1968
2590
|
|
|
1969
|
-
const log = debug('pie-lib:graphing-solution-set:polygon');
|
|
2591
|
+
const log = debug$1('pie-lib:graphing-solution-set:polygon');
|
|
1970
2592
|
const swap = (arr, ...rest) => {
|
|
1971
2593
|
const pairs = chunk(rest, 2);
|
|
1972
2594
|
return pairs.reduce((acc, pr) => {
|
|
@@ -3377,6 +3999,427 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
3377
3999
|
toolsArr: toolsArr
|
|
3378
4000
|
});
|
|
3379
4001
|
|
|
4002
|
+
var ExpandMore = {};
|
|
4003
|
+
|
|
4004
|
+
var interopRequireDefault = {exports: {}};
|
|
4005
|
+
|
|
4006
|
+
var hasRequiredInteropRequireDefault;
|
|
4007
|
+
|
|
4008
|
+
function requireInteropRequireDefault () {
|
|
4009
|
+
if (hasRequiredInteropRequireDefault) return interopRequireDefault.exports;
|
|
4010
|
+
hasRequiredInteropRequireDefault = 1;
|
|
4011
|
+
(function (module) {
|
|
4012
|
+
function _interopRequireDefault(obj) {
|
|
4013
|
+
return obj && obj.__esModule ? obj : {
|
|
4014
|
+
"default": obj
|
|
4015
|
+
};
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4019
|
+
} (interopRequireDefault));
|
|
4020
|
+
return interopRequireDefault.exports;
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
var createSvgIcon = {};
|
|
4024
|
+
|
|
4025
|
+
var pure = {};
|
|
4026
|
+
|
|
4027
|
+
var shouldUpdate = {};
|
|
4028
|
+
|
|
4029
|
+
var inheritsLoose = {exports: {}};
|
|
4030
|
+
|
|
4031
|
+
var setPrototypeOf = {exports: {}};
|
|
4032
|
+
|
|
4033
|
+
var hasRequiredSetPrototypeOf;
|
|
4034
|
+
|
|
4035
|
+
function requireSetPrototypeOf () {
|
|
4036
|
+
if (hasRequiredSetPrototypeOf) return setPrototypeOf.exports;
|
|
4037
|
+
hasRequiredSetPrototypeOf = 1;
|
|
4038
|
+
(function (module) {
|
|
4039
|
+
function _setPrototypeOf(o, p) {
|
|
4040
|
+
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
4041
|
+
o.__proto__ = p;
|
|
4042
|
+
return o;
|
|
4043
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4044
|
+
return _setPrototypeOf(o, p);
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4047
|
+
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4048
|
+
} (setPrototypeOf));
|
|
4049
|
+
return setPrototypeOf.exports;
|
|
4050
|
+
}
|
|
4051
|
+
|
|
4052
|
+
var hasRequiredInheritsLoose;
|
|
4053
|
+
|
|
4054
|
+
function requireInheritsLoose () {
|
|
4055
|
+
if (hasRequiredInheritsLoose) return inheritsLoose.exports;
|
|
4056
|
+
hasRequiredInheritsLoose = 1;
|
|
4057
|
+
(function (module) {
|
|
4058
|
+
var setPrototypeOf = requireSetPrototypeOf();
|
|
4059
|
+
|
|
4060
|
+
function _inheritsLoose(subClass, superClass) {
|
|
4061
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
4062
|
+
subClass.prototype.constructor = subClass;
|
|
4063
|
+
setPrototypeOf(subClass, superClass);
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4067
|
+
} (inheritsLoose));
|
|
4068
|
+
return inheritsLoose.exports;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
var setDisplayName = {};
|
|
4072
|
+
|
|
4073
|
+
var setStatic = {};
|
|
4074
|
+
|
|
4075
|
+
var hasRequiredSetStatic;
|
|
4076
|
+
|
|
4077
|
+
function requireSetStatic () {
|
|
4078
|
+
if (hasRequiredSetStatic) return setStatic;
|
|
4079
|
+
hasRequiredSetStatic = 1;
|
|
4080
|
+
|
|
4081
|
+
setStatic.__esModule = true;
|
|
4082
|
+
setStatic.default = void 0;
|
|
4083
|
+
|
|
4084
|
+
var setStatic$1 = function setStatic(key, value) {
|
|
4085
|
+
return function (BaseComponent) {
|
|
4086
|
+
/* eslint-disable no-param-reassign */
|
|
4087
|
+
BaseComponent[key] = value;
|
|
4088
|
+
/* eslint-enable no-param-reassign */
|
|
4089
|
+
|
|
4090
|
+
return BaseComponent;
|
|
4091
|
+
};
|
|
4092
|
+
};
|
|
4093
|
+
|
|
4094
|
+
var _default = setStatic$1;
|
|
4095
|
+
setStatic.default = _default;
|
|
4096
|
+
return setStatic;
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
var hasRequiredSetDisplayName;
|
|
4100
|
+
|
|
4101
|
+
function requireSetDisplayName () {
|
|
4102
|
+
if (hasRequiredSetDisplayName) return setDisplayName;
|
|
4103
|
+
hasRequiredSetDisplayName = 1;
|
|
4104
|
+
|
|
4105
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4106
|
+
|
|
4107
|
+
setDisplayName.__esModule = true;
|
|
4108
|
+
setDisplayName.default = void 0;
|
|
4109
|
+
|
|
4110
|
+
var _setStatic = _interopRequireDefault(requireSetStatic());
|
|
4111
|
+
|
|
4112
|
+
var setDisplayName$1 = function setDisplayName(displayName) {
|
|
4113
|
+
return (0, _setStatic.default)('displayName', displayName);
|
|
4114
|
+
};
|
|
4115
|
+
|
|
4116
|
+
var _default = setDisplayName$1;
|
|
4117
|
+
setDisplayName.default = _default;
|
|
4118
|
+
return setDisplayName;
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
var wrapDisplayName = {};
|
|
4122
|
+
|
|
4123
|
+
var getDisplayName = {};
|
|
4124
|
+
|
|
4125
|
+
var hasRequiredGetDisplayName;
|
|
4126
|
+
|
|
4127
|
+
function requireGetDisplayName () {
|
|
4128
|
+
if (hasRequiredGetDisplayName) return getDisplayName;
|
|
4129
|
+
hasRequiredGetDisplayName = 1;
|
|
4130
|
+
|
|
4131
|
+
getDisplayName.__esModule = true;
|
|
4132
|
+
getDisplayName.default = void 0;
|
|
4133
|
+
|
|
4134
|
+
var getDisplayName$1 = function getDisplayName(Component) {
|
|
4135
|
+
if (typeof Component === 'string') {
|
|
4136
|
+
return Component;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
if (!Component) {
|
|
4140
|
+
return undefined;
|
|
4141
|
+
}
|
|
4142
|
+
|
|
4143
|
+
return Component.displayName || Component.name || 'Component';
|
|
4144
|
+
};
|
|
4145
|
+
|
|
4146
|
+
var _default = getDisplayName$1;
|
|
4147
|
+
getDisplayName.default = _default;
|
|
4148
|
+
return getDisplayName;
|
|
4149
|
+
}
|
|
4150
|
+
|
|
4151
|
+
var hasRequiredWrapDisplayName;
|
|
4152
|
+
|
|
4153
|
+
function requireWrapDisplayName () {
|
|
4154
|
+
if (hasRequiredWrapDisplayName) return wrapDisplayName;
|
|
4155
|
+
hasRequiredWrapDisplayName = 1;
|
|
4156
|
+
|
|
4157
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4158
|
+
|
|
4159
|
+
wrapDisplayName.__esModule = true;
|
|
4160
|
+
wrapDisplayName.default = void 0;
|
|
4161
|
+
|
|
4162
|
+
var _getDisplayName = _interopRequireDefault(requireGetDisplayName());
|
|
4163
|
+
|
|
4164
|
+
var wrapDisplayName$1 = function wrapDisplayName(BaseComponent, hocName) {
|
|
4165
|
+
return hocName + "(" + (0, _getDisplayName.default)(BaseComponent) + ")";
|
|
4166
|
+
};
|
|
4167
|
+
|
|
4168
|
+
var _default = wrapDisplayName$1;
|
|
4169
|
+
wrapDisplayName.default = _default;
|
|
4170
|
+
return wrapDisplayName;
|
|
4171
|
+
}
|
|
4172
|
+
|
|
4173
|
+
var hasRequiredShouldUpdate;
|
|
4174
|
+
|
|
4175
|
+
function requireShouldUpdate () {
|
|
4176
|
+
if (hasRequiredShouldUpdate) return shouldUpdate;
|
|
4177
|
+
hasRequiredShouldUpdate = 1;
|
|
4178
|
+
|
|
4179
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4180
|
+
|
|
4181
|
+
shouldUpdate.__esModule = true;
|
|
4182
|
+
shouldUpdate.default = void 0;
|
|
4183
|
+
|
|
4184
|
+
var _inheritsLoose2 = _interopRequireDefault(requireInheritsLoose());
|
|
4185
|
+
|
|
4186
|
+
var _react = React;
|
|
4187
|
+
|
|
4188
|
+
var _setDisplayName = _interopRequireDefault(requireSetDisplayName());
|
|
4189
|
+
|
|
4190
|
+
var _wrapDisplayName = _interopRequireDefault(requireWrapDisplayName());
|
|
4191
|
+
|
|
4192
|
+
var shouldUpdate$1 = function shouldUpdate(test) {
|
|
4193
|
+
return function (BaseComponent) {
|
|
4194
|
+
var factory = (0, _react.createFactory)(BaseComponent);
|
|
4195
|
+
|
|
4196
|
+
var ShouldUpdate =
|
|
4197
|
+
/*#__PURE__*/
|
|
4198
|
+
function (_Component) {
|
|
4199
|
+
(0, _inheritsLoose2.default)(ShouldUpdate, _Component);
|
|
4200
|
+
|
|
4201
|
+
function ShouldUpdate() {
|
|
4202
|
+
return _Component.apply(this, arguments) || this;
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4205
|
+
var _proto = ShouldUpdate.prototype;
|
|
4206
|
+
|
|
4207
|
+
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
|
4208
|
+
return test(this.props, nextProps);
|
|
4209
|
+
};
|
|
4210
|
+
|
|
4211
|
+
_proto.render = function render() {
|
|
4212
|
+
return factory(this.props);
|
|
4213
|
+
};
|
|
4214
|
+
|
|
4215
|
+
return ShouldUpdate;
|
|
4216
|
+
}(_react.Component);
|
|
4217
|
+
|
|
4218
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4219
|
+
return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'shouldUpdate'))(ShouldUpdate);
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4222
|
+
return ShouldUpdate;
|
|
4223
|
+
};
|
|
4224
|
+
};
|
|
4225
|
+
|
|
4226
|
+
var _default = shouldUpdate$1;
|
|
4227
|
+
shouldUpdate.default = _default;
|
|
4228
|
+
return shouldUpdate;
|
|
4229
|
+
}
|
|
4230
|
+
|
|
4231
|
+
var shallowEqual = {};
|
|
4232
|
+
|
|
4233
|
+
/**
|
|
4234
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4235
|
+
*
|
|
4236
|
+
* This source code is licensed under the MIT license found in the
|
|
4237
|
+
* LICENSE file in the root directory of this source tree.
|
|
4238
|
+
*
|
|
4239
|
+
* @typechecks
|
|
4240
|
+
*
|
|
4241
|
+
*/
|
|
4242
|
+
|
|
4243
|
+
var shallowEqual_1;
|
|
4244
|
+
var hasRequiredShallowEqual$1;
|
|
4245
|
+
|
|
4246
|
+
function requireShallowEqual$1 () {
|
|
4247
|
+
if (hasRequiredShallowEqual$1) return shallowEqual_1;
|
|
4248
|
+
hasRequiredShallowEqual$1 = 1;
|
|
4249
|
+
|
|
4250
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4251
|
+
|
|
4252
|
+
/**
|
|
4253
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
4254
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
4255
|
+
*/
|
|
4256
|
+
function is(x, y) {
|
|
4257
|
+
// SameValue algorithm
|
|
4258
|
+
if (x === y) {
|
|
4259
|
+
// Steps 1-5, 7-10
|
|
4260
|
+
// Steps 6.b-6.e: +0 != -0
|
|
4261
|
+
// Added the nonzero y check to make Flow happy, but it is redundant
|
|
4262
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
4263
|
+
} else {
|
|
4264
|
+
// Step 6.a: NaN == NaN
|
|
4265
|
+
return x !== x && y !== y;
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
|
|
4269
|
+
/**
|
|
4270
|
+
* Performs equality by iterating through keys on an object and returning false
|
|
4271
|
+
* when any key has values which are not strictly equal between the arguments.
|
|
4272
|
+
* Returns true when the values of all keys are strictly equal.
|
|
4273
|
+
*/
|
|
4274
|
+
function shallowEqual(objA, objB) {
|
|
4275
|
+
if (is(objA, objB)) {
|
|
4276
|
+
return true;
|
|
4277
|
+
}
|
|
4278
|
+
|
|
4279
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
4280
|
+
return false;
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
var keysA = Object.keys(objA);
|
|
4284
|
+
var keysB = Object.keys(objB);
|
|
4285
|
+
|
|
4286
|
+
if (keysA.length !== keysB.length) {
|
|
4287
|
+
return false;
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
// Test for A's keys different from B.
|
|
4291
|
+
for (var i = 0; i < keysA.length; i++) {
|
|
4292
|
+
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
4293
|
+
return false;
|
|
4294
|
+
}
|
|
4295
|
+
}
|
|
4296
|
+
|
|
4297
|
+
return true;
|
|
4298
|
+
}
|
|
4299
|
+
|
|
4300
|
+
shallowEqual_1 = shallowEqual;
|
|
4301
|
+
return shallowEqual_1;
|
|
4302
|
+
}
|
|
4303
|
+
|
|
4304
|
+
var hasRequiredShallowEqual;
|
|
4305
|
+
|
|
4306
|
+
function requireShallowEqual () {
|
|
4307
|
+
if (hasRequiredShallowEqual) return shallowEqual;
|
|
4308
|
+
hasRequiredShallowEqual = 1;
|
|
4309
|
+
|
|
4310
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4311
|
+
|
|
4312
|
+
shallowEqual.__esModule = true;
|
|
4313
|
+
shallowEqual.default = void 0;
|
|
4314
|
+
|
|
4315
|
+
var _shallowEqual = _interopRequireDefault(requireShallowEqual$1());
|
|
4316
|
+
|
|
4317
|
+
var _default = _shallowEqual.default;
|
|
4318
|
+
shallowEqual.default = _default;
|
|
4319
|
+
return shallowEqual;
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
var hasRequiredPure;
|
|
4323
|
+
|
|
4324
|
+
function requirePure () {
|
|
4325
|
+
if (hasRequiredPure) return pure;
|
|
4326
|
+
hasRequiredPure = 1;
|
|
4327
|
+
|
|
4328
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4329
|
+
|
|
4330
|
+
pure.__esModule = true;
|
|
4331
|
+
pure.default = void 0;
|
|
4332
|
+
|
|
4333
|
+
var _shouldUpdate = _interopRequireDefault(requireShouldUpdate());
|
|
4334
|
+
|
|
4335
|
+
var _shallowEqual = _interopRequireDefault(requireShallowEqual());
|
|
4336
|
+
|
|
4337
|
+
var _setDisplayName = _interopRequireDefault(requireSetDisplayName());
|
|
4338
|
+
|
|
4339
|
+
var _wrapDisplayName = _interopRequireDefault(requireWrapDisplayName());
|
|
4340
|
+
|
|
4341
|
+
var pure$1 = function pure(BaseComponent) {
|
|
4342
|
+
var hoc = (0, _shouldUpdate.default)(function (props, nextProps) {
|
|
4343
|
+
return !(0, _shallowEqual.default)(props, nextProps);
|
|
4344
|
+
});
|
|
4345
|
+
|
|
4346
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4347
|
+
return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'pure'))(hoc(BaseComponent));
|
|
4348
|
+
}
|
|
4349
|
+
|
|
4350
|
+
return hoc(BaseComponent);
|
|
4351
|
+
};
|
|
4352
|
+
|
|
4353
|
+
var _default = pure$1;
|
|
4354
|
+
pure.default = _default;
|
|
4355
|
+
return pure;
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4358
|
+
var hasRequiredCreateSvgIcon;
|
|
4359
|
+
|
|
4360
|
+
function requireCreateSvgIcon () {
|
|
4361
|
+
if (hasRequiredCreateSvgIcon) return createSvgIcon;
|
|
4362
|
+
hasRequiredCreateSvgIcon = 1;
|
|
4363
|
+
|
|
4364
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4365
|
+
|
|
4366
|
+
Object.defineProperty(createSvgIcon, "__esModule", {
|
|
4367
|
+
value: true
|
|
4368
|
+
});
|
|
4369
|
+
createSvgIcon.default = void 0;
|
|
4370
|
+
|
|
4371
|
+
var _react = _interopRequireDefault(React);
|
|
4372
|
+
|
|
4373
|
+
var _pure = _interopRequireDefault(requirePure());
|
|
4374
|
+
|
|
4375
|
+
var _SvgIcon = _interopRequireDefault(require$$3);
|
|
4376
|
+
|
|
4377
|
+
function createSvgIcon$1(path, displayName) {
|
|
4378
|
+
var Icon = function Icon(props) {
|
|
4379
|
+
return _react.default.createElement(_SvgIcon.default, props, path);
|
|
4380
|
+
};
|
|
4381
|
+
|
|
4382
|
+
Icon.displayName = "".concat(displayName, "Icon");
|
|
4383
|
+
Icon = (0, _pure.default)(Icon);
|
|
4384
|
+
Icon.muiName = 'SvgIcon';
|
|
4385
|
+
return Icon;
|
|
4386
|
+
}
|
|
4387
|
+
var _default = createSvgIcon$1;
|
|
4388
|
+
createSvgIcon.default = _default;
|
|
4389
|
+
return createSvgIcon;
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
var hasRequiredExpandMore;
|
|
4393
|
+
|
|
4394
|
+
function requireExpandMore () {
|
|
4395
|
+
if (hasRequiredExpandMore) return ExpandMore;
|
|
4396
|
+
hasRequiredExpandMore = 1;
|
|
4397
|
+
|
|
4398
|
+
var _interopRequireDefault = requireInteropRequireDefault();
|
|
4399
|
+
|
|
4400
|
+
Object.defineProperty(ExpandMore, "__esModule", {
|
|
4401
|
+
value: true
|
|
4402
|
+
});
|
|
4403
|
+
ExpandMore.default = void 0;
|
|
4404
|
+
|
|
4405
|
+
var _react = _interopRequireDefault(React);
|
|
4406
|
+
|
|
4407
|
+
var _createSvgIcon = _interopRequireDefault(/*@__PURE__*/ requireCreateSvgIcon());
|
|
4408
|
+
|
|
4409
|
+
var _default = (0, _createSvgIcon.default)(_react.default.createElement(_react.default.Fragment, null, _react.default.createElement("path", {
|
|
4410
|
+
d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
4411
|
+
}), _react.default.createElement("path", {
|
|
4412
|
+
fill: "none",
|
|
4413
|
+
d: "M0 0h24v24H0z"
|
|
4414
|
+
})), 'ExpandMore');
|
|
4415
|
+
|
|
4416
|
+
ExpandMore.default = _default;
|
|
4417
|
+
return ExpandMore;
|
|
4418
|
+
}
|
|
4419
|
+
|
|
4420
|
+
var ExpandMoreExports = /*@__PURE__*/ requireExpandMore();
|
|
4421
|
+
var ExpandMoreIcon = /*@__PURE__*/getDefaultExportFromCjs(ExpandMoreExports);
|
|
4422
|
+
|
|
3380
4423
|
const setToolbarAvailability = toolbarTools => toolsArr.map(tA => _extends({}, tA, {
|
|
3381
4424
|
toolbar: !!toolbarTools.find(t => t === tA.type)
|
|
3382
4425
|
})) || [];
|
|
@@ -3629,8 +4672,8 @@ const mapStateToProps = s => ({
|
|
|
3629
4672
|
|
|
3630
4673
|
const mapDispatchToProps = dispatch => ({
|
|
3631
4674
|
onChangeMarks: m => dispatch(changeMarks(m)),
|
|
3632
|
-
onUndo: () => dispatch(ActionCreators.undo()),
|
|
3633
|
-
onRedo: () => dispatch(ActionCreators.redo()),
|
|
4675
|
+
onUndo: () => dispatch(libExports.ActionCreators.undo()),
|
|
4676
|
+
onRedo: () => dispatch(libExports.ActionCreators.redo()),
|
|
3634
4677
|
onReset: () => dispatch(changeMarks([]))
|
|
3635
4678
|
});
|
|
3636
4679
|
|