@pie-lib/graphing-module 2.2.1 → 2.4.0
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/module/index.js +512 -185
- package/module/manifest.json +8 -8
- package/package.json +1 -1
package/module/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {_dll_prop_types, _dll_lodash, _dll_pie_lib__render_ui, _dll_material_ui__core_styles, _dll_react, _dll_classnames, _dll_react_dom, _dll_debug, _dll_material_ui__core, _dll_material_ui__core_styles_color_manipulator, _dll_material_ui__icons} from "../../shared-module@^1.
|
|
2
|
-
import {_dll_pie_lib__editable_html} from "../../editable-html-module@^5.
|
|
3
|
-
import {_dll_pie_lib__drag} from "../../drag-module@^2.
|
|
4
|
-
import {_dll_pie_lib__config_ui} from "../../config-module@^2.
|
|
1
|
+
import {_dll_prop_types, _dll_lodash, _dll_pie_lib__render_ui, _dll_material_ui__core_styles, _dll_react, _dll_classnames, _dll_react_dom, _dll_debug, _dll_material_ui__core, _dll_material_ui__core_styles_color_manipulator, _dll_material_ui__icons} from "../../shared-module@^1.13.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__editable_html} from "../../editable-html-module@^5.5.0/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__drag} from "../../drag-module@^2.7.0/module/index.js";
|
|
4
|
+
import {_dll_pie_lib__config_ui} from "../../config-module@^2.18.0/module/index.js";
|
|
5
5
|
var xhtml = "http://www.w3.org/1999/xhtml";
|
|
6
6
|
var namespaces = {
|
|
7
7
|
svg: "http://www.w3.org/2000/svg",
|
|
@@ -737,6 +737,9 @@ var types = Object.freeze({
|
|
|
737
737
|
GraphPropsType: GraphPropsType
|
|
738
738
|
});
|
|
739
739
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
740
|
+
function getDefaultExportFromCjs(x) {
|
|
741
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
742
|
+
}
|
|
740
743
|
var invariant = function (condition, format, a, b, c, d, e, f) {
|
|
741
744
|
{
|
|
742
745
|
if (format === undefined) {
|
|
@@ -3017,11 +3020,11 @@ class LocalDraggable extends Draggable {
|
|
|
3017
3020
|
}
|
|
3018
3021
|
const React$J = _dll_react;
|
|
3019
3022
|
const PropTypes$E = _dll_prop_types;
|
|
3020
|
-
const debug$
|
|
3023
|
+
const debug$d = _dll_debug;
|
|
3021
3024
|
const {isFunction: isFunction$1} = _dll_lodash;
|
|
3022
3025
|
const _jsxFileName$A = "/Users/carlacostea/Pie_Work/pie-framework/pie-lib/packages/plot/src/grid-draggable.jsx";
|
|
3023
3026
|
var _class$1;
|
|
3024
|
-
const log$
|
|
3027
|
+
const log$d = debug$d('pie-lib:plot:grid-draggable');
|
|
3025
3028
|
const deltaFn = (scale, snap, val) => delta => {
|
|
3026
3029
|
const normalized = delta + scale(0);
|
|
3027
3030
|
const inverted = scale.invert(normalized);
|
|
@@ -3103,14 +3106,14 @@ const gridDraggable = opts => Comp => {
|
|
|
3103
3106
|
const start = this.state[`start${K}`];
|
|
3104
3107
|
const delta = Math.abs(end - start);
|
|
3105
3108
|
const out = delta < Math.abs(this.grid()[key]) / 10;
|
|
3106
|
-
log$
|
|
3109
|
+
log$d('[tiny] key: ', key, 'delta: ', delta, 'out: ', out);
|
|
3107
3110
|
return out;
|
|
3108
3111
|
};
|
|
3109
3112
|
}
|
|
3110
3113
|
__init5() {
|
|
3111
3114
|
this.getScaledBounds = () => {
|
|
3112
3115
|
const bounds = opts.bounds(this.props, this.props.graphProps);
|
|
3113
|
-
log$
|
|
3116
|
+
log$d('bounds: ', bounds);
|
|
3114
3117
|
const grid = this.grid();
|
|
3115
3118
|
const scaled = {
|
|
3116
3119
|
left: bounds.left / grid.interval * grid.x,
|
|
@@ -3118,7 +3121,7 @@ const gridDraggable = opts => Comp => {
|
|
|
3118
3121
|
top: bounds.top / grid.interval * grid.y,
|
|
3119
3122
|
bottom: bounds.bottom / grid.interval * grid.y
|
|
3120
3123
|
};
|
|
3121
|
-
log$
|
|
3124
|
+
log$d('[getScaledBounds]: ', scaled);
|
|
3122
3125
|
return scaled;
|
|
3123
3126
|
};
|
|
3124
3127
|
}
|
|
@@ -3213,22 +3216,22 @@ const gridDraggable = opts => Comp => {
|
|
|
3213
3216
|
__init10() {
|
|
3214
3217
|
this.applyDelta = point => {
|
|
3215
3218
|
const delta = this.getDelta(point);
|
|
3216
|
-
log$
|
|
3219
|
+
log$d('[applyDelta] delta:', delta);
|
|
3217
3220
|
return opts.fromDelta(this.props, delta);
|
|
3218
3221
|
};
|
|
3219
3222
|
}
|
|
3220
3223
|
__init11() {
|
|
3221
3224
|
this.onStop = (e, dd) => {
|
|
3222
|
-
log$
|
|
3225
|
+
log$d('[onStop] dd:', dd);
|
|
3223
3226
|
const {onDragStop, onClick} = this.props;
|
|
3224
3227
|
if (onDragStop) {
|
|
3225
3228
|
onDragStop();
|
|
3226
3229
|
}
|
|
3227
|
-
log$
|
|
3230
|
+
log$d('[onStop] lastX/Y: ', dd.lastX, dd.lastY);
|
|
3228
3231
|
const isClick = this.tiny('x', e) && this.tiny('y', e);
|
|
3229
3232
|
if (isClick) {
|
|
3230
3233
|
if (onClick) {
|
|
3231
|
-
log$
|
|
3234
|
+
log$d('call onClick');
|
|
3232
3235
|
this.setState({
|
|
3233
3236
|
startX: null
|
|
3234
3237
|
});
|
|
@@ -3284,14 +3287,14 @@ const gridDraggable = opts => Comp => {
|
|
|
3284
3287
|
}
|
|
3285
3288
|
}, _class$1.__initStatic(), _class$1);
|
|
3286
3289
|
};
|
|
3287
|
-
const debug$
|
|
3288
|
-
const log$
|
|
3290
|
+
const debug$c = _dll_debug;
|
|
3291
|
+
const log$c = debug$c('pie-lib:plot:trig');
|
|
3289
3292
|
const toDegrees = radians => radians * (180 / Math.PI);
|
|
3290
3293
|
const toRadians = degrees => degrees * (Math.PI / 180);
|
|
3291
3294
|
const angle = (a, b) => {
|
|
3292
3295
|
const vd = b.y - a.y;
|
|
3293
3296
|
const hd = b.x - a.x;
|
|
3294
|
-
log$
|
|
3297
|
+
log$c(a, b, 'vd: ', vd, 'hd: ', hd);
|
|
3295
3298
|
const radians = Math.atan2(vd, hd);
|
|
3296
3299
|
return radians < 0 ? radians + Math.PI * 2 : radians;
|
|
3297
3300
|
};
|
|
@@ -3299,7 +3302,7 @@ const NINETY = Math.PI / 2;
|
|
|
3299
3302
|
const ONE_EIGHTY = Math.PI;
|
|
3300
3303
|
const TWO_SEVENTY = ONE_EIGHTY + NINETY;
|
|
3301
3304
|
const acuteXAngle = a => {
|
|
3302
|
-
log$
|
|
3305
|
+
log$c(toDegrees(a));
|
|
3303
3306
|
if (a < NINETY) {
|
|
3304
3307
|
return a;
|
|
3305
3308
|
}
|
|
@@ -3326,7 +3329,7 @@ const edges = (domain, range) => (a, b) => {
|
|
|
3326
3329
|
return [aToB, bToA];
|
|
3327
3330
|
};
|
|
3328
3331
|
const getOpposingSide = (hyp, angle) => {
|
|
3329
|
-
log$
|
|
3332
|
+
log$c('[getOpposingSide] hyp: ', hyp, 'angle:', angle);
|
|
3330
3333
|
return Math.abs(hyp * Math.sin(angle));
|
|
3331
3334
|
};
|
|
3332
3335
|
const getShortestSide = (xh, yh) => {
|
|
@@ -3354,7 +3357,7 @@ const getShortestSide = (xh, yh) => {
|
|
|
3354
3357
|
console.warn('hypotenuse - which is shorter? x:', xh, 'y:', yh);
|
|
3355
3358
|
};
|
|
3356
3359
|
const diffEdge = (bounds, a, b) => {
|
|
3357
|
-
let l = log$
|
|
3360
|
+
let l = log$c.enabled ? log$c.bind(log$c, `diffEdge: [${a.x},${a.y} -> ${b.x},${b.y}]`) : () => {};
|
|
3358
3361
|
const xRadians = angle(a, b);
|
|
3359
3362
|
l('x angle', toDegrees(xRadians));
|
|
3360
3363
|
const yRadians = Math.abs(xRadians - toRadians(90));
|
|
@@ -4520,14 +4523,14 @@ Linear.prototype = {
|
|
|
4520
4523
|
function curveLinear(context) {
|
|
4521
4524
|
return new Linear(context);
|
|
4522
4525
|
}
|
|
4523
|
-
function x
|
|
4526
|
+
function x(p) {
|
|
4524
4527
|
return p[0];
|
|
4525
4528
|
}
|
|
4526
4529
|
function y(p) {
|
|
4527
4530
|
return p[1];
|
|
4528
4531
|
}
|
|
4529
4532
|
function line() {
|
|
4530
|
-
var x = x
|
|
4533
|
+
var x$1 = x, y$1 = y, defined = constant(true), context = null, curve = curveLinear, output = null;
|
|
4531
4534
|
function line(data) {
|
|
4532
4535
|
var i, n = data.length, d, defined0 = false, buffer;
|
|
4533
4536
|
if (context == null) output = curve(buffer = path());
|
|
@@ -4535,12 +4538,12 @@ function line() {
|
|
|
4535
4538
|
if (!(i < n && defined(d = data[i], i, data)) === defined0) {
|
|
4536
4539
|
if (defined0 = !defined0) output.lineStart(); else output.lineEnd();
|
|
4537
4540
|
}
|
|
4538
|
-
if (defined0) output.point(+x(d, i, data), +y$1(d, i, data));
|
|
4541
|
+
if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data));
|
|
4539
4542
|
}
|
|
4540
4543
|
if (buffer) return (output = null, buffer + "" || null);
|
|
4541
4544
|
}
|
|
4542
4545
|
line.x = function (_) {
|
|
4543
|
-
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), line) : x;
|
|
4546
|
+
return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1;
|
|
4544
4547
|
};
|
|
4545
4548
|
line.y = function (_) {
|
|
4546
4549
|
return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1;
|
|
@@ -8193,9 +8196,9 @@ const React$x = _dll_react;
|
|
|
8193
8196
|
const PropTypes$s = _dll_prop_types;
|
|
8194
8197
|
const {isEqual: isEqual$4} = _dll_lodash;
|
|
8195
8198
|
const {cloneDeep: cloneDeep$1} = _dll_lodash;
|
|
8196
|
-
const debug$
|
|
8199
|
+
const debug$b = _dll_debug;
|
|
8197
8200
|
const _jsxFileName$u = "/Users/carlacostea/Pie_Work/pie-framework/pie-lib/packages/graphing/src/graph.jsx";
|
|
8198
|
-
const log$
|
|
8201
|
+
const log$b = debug$b('pie-lib:graphing:graph');
|
|
8199
8202
|
const graphPropTypes = {
|
|
8200
8203
|
axesSettings: PropTypes$s.shape(AxisPropTypes),
|
|
8201
8204
|
backgroundMarks: PropTypes$s.array,
|
|
@@ -8330,7 +8333,7 @@ class Graph extends React$x.Component {
|
|
|
8330
8333
|
if (labelModeEnabled || !currentTool || [null, undefined].includes(x) || [null, undefined].includes(y)) {
|
|
8331
8334
|
return;
|
|
8332
8335
|
}
|
|
8333
|
-
log$
|
|
8336
|
+
log$b('[onBgClick] x,y: ', x, y);
|
|
8334
8337
|
const buildingMark = marks.filter(m => m.building)[0];
|
|
8335
8338
|
let updatedMark;
|
|
8336
8339
|
if (buildingMark && currentTool && buildingMark.type === currentTool.type) {
|
|
@@ -9040,7 +9043,7 @@ var $$observable = (function () {
|
|
|
9040
9043
|
var randomString = function randomString() {
|
|
9041
9044
|
return Math.random().toString(36).substring(7).split('').join('.');
|
|
9042
9045
|
};
|
|
9043
|
-
var ActionTypes = {
|
|
9046
|
+
var ActionTypes$1 = {
|
|
9044
9047
|
INIT: "@@redux/INIT" + randomString(),
|
|
9045
9048
|
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
9046
9049
|
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
@@ -9188,7 +9191,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
9188
9191
|
}
|
|
9189
9192
|
currentReducer = nextReducer;
|
|
9190
9193
|
dispatch({
|
|
9191
|
-
type: ActionTypes.REPLACE
|
|
9194
|
+
type: ActionTypes$1.REPLACE
|
|
9192
9195
|
});
|
|
9193
9196
|
}
|
|
9194
9197
|
function observable() {
|
|
@@ -9215,7 +9218,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
9215
9218
|
}, _ref);
|
|
9216
9219
|
}
|
|
9217
9220
|
dispatch({
|
|
9218
|
-
type: ActionTypes.INIT
|
|
9221
|
+
type: ActionTypes$1.INIT
|
|
9219
9222
|
});
|
|
9220
9223
|
return (_ref2 = {
|
|
9221
9224
|
dispatch: dispatch,
|
|
@@ -9234,7 +9237,7 @@ function warning$1(message) {
|
|
|
9234
9237
|
}
|
|
9235
9238
|
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
9236
9239
|
var reducerKeys = Object.keys(reducers);
|
|
9237
|
-
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
|
9240
|
+
var argumentName = action && action.type === ActionTypes$1.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
|
9238
9241
|
if (reducerKeys.length === 0) {
|
|
9239
9242
|
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
|
9240
9243
|
}
|
|
@@ -9247,7 +9250,7 @@ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, une
|
|
|
9247
9250
|
unexpectedKeys.forEach(function (key) {
|
|
9248
9251
|
unexpectedKeyCache[key] = true;
|
|
9249
9252
|
});
|
|
9250
|
-
if (action && action.type === ActionTypes.REPLACE) return;
|
|
9253
|
+
if (action && action.type === ActionTypes$1.REPLACE) return;
|
|
9251
9254
|
if (unexpectedKeys.length > 0) {
|
|
9252
9255
|
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
|
|
9253
9256
|
}
|
|
@@ -9256,15 +9259,15 @@ function assertReducerShape(reducers) {
|
|
|
9256
9259
|
Object.keys(reducers).forEach(function (key) {
|
|
9257
9260
|
var reducer = reducers[key];
|
|
9258
9261
|
var initialState = reducer(undefined, {
|
|
9259
|
-
type: ActionTypes.INIT
|
|
9262
|
+
type: ActionTypes$1.INIT
|
|
9260
9263
|
});
|
|
9261
9264
|
if (typeof initialState === 'undefined') {
|
|
9262
9265
|
throw new Error("The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
|
|
9263
9266
|
}
|
|
9264
9267
|
if (typeof reducer(undefined, {
|
|
9265
|
-
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
|
9268
|
+
type: ActionTypes$1.PROBE_UNKNOWN_ACTION()
|
|
9266
9269
|
}) === 'undefined') {
|
|
9267
|
-
throw new Error("The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
|
9270
|
+
throw new Error("The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes$1.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
|
9268
9271
|
}
|
|
9269
9272
|
});
|
|
9270
9273
|
}
|
|
@@ -9638,73 +9641,152 @@ const marks = (state = [], action) => {
|
|
|
9638
9641
|
return state;
|
|
9639
9642
|
}
|
|
9640
9643
|
};
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
undo
|
|
9644
|
+
var lib = {};
|
|
9645
|
+
var actions = {};
|
|
9646
|
+
Object.defineProperty(actions, "__esModule", {
|
|
9647
|
+
value: true
|
|
9648
|
+
});
|
|
9649
|
+
var ActionTypes = actions.ActionTypes = {
|
|
9650
|
+
UNDO: '@@redux-undo/UNDO',
|
|
9651
|
+
REDO: '@@redux-undo/REDO',
|
|
9652
|
+
JUMP_TO_FUTURE: '@@redux-undo/JUMP_TO_FUTURE',
|
|
9653
|
+
JUMP_TO_PAST: '@@redux-undo/JUMP_TO_PAST',
|
|
9654
|
+
JUMP: '@@redux-undo/JUMP',
|
|
9655
|
+
CLEAR_HISTORY: '@@redux-undo/CLEAR_HISTORY'
|
|
9656
|
+
};
|
|
9657
|
+
actions.ActionCreators = {
|
|
9658
|
+
undo: function undo() {
|
|
9650
9659
|
return {
|
|
9651
|
-
type:
|
|
9660
|
+
type: ActionTypes.UNDO
|
|
9652
9661
|
};
|
|
9653
9662
|
},
|
|
9654
|
-
redo() {
|
|
9663
|
+
redo: function redo() {
|
|
9655
9664
|
return {
|
|
9656
|
-
type:
|
|
9665
|
+
type: ActionTypes.REDO
|
|
9657
9666
|
};
|
|
9658
9667
|
},
|
|
9659
|
-
jumpToFuture(
|
|
9668
|
+
jumpToFuture: function jumpToFuture(index) {
|
|
9660
9669
|
return {
|
|
9661
|
-
type:
|
|
9662
|
-
index:
|
|
9670
|
+
type: ActionTypes.JUMP_TO_FUTURE,
|
|
9671
|
+
index: index
|
|
9663
9672
|
};
|
|
9664
9673
|
},
|
|
9665
|
-
jumpToPast(
|
|
9674
|
+
jumpToPast: function jumpToPast(index) {
|
|
9666
9675
|
return {
|
|
9667
|
-
type:
|
|
9668
|
-
index:
|
|
9676
|
+
type: ActionTypes.JUMP_TO_PAST,
|
|
9677
|
+
index: index
|
|
9669
9678
|
};
|
|
9670
9679
|
},
|
|
9671
|
-
jump(
|
|
9680
|
+
jump: function jump(index) {
|
|
9672
9681
|
return {
|
|
9673
|
-
type:
|
|
9674
|
-
index:
|
|
9682
|
+
type: ActionTypes.JUMP,
|
|
9683
|
+
index: index
|
|
9675
9684
|
};
|
|
9676
9685
|
},
|
|
9677
|
-
clearHistory() {
|
|
9686
|
+
clearHistory: function clearHistory() {
|
|
9678
9687
|
return {
|
|
9679
|
-
type:
|
|
9688
|
+
type: ActionTypes.CLEAR_HISTORY
|
|
9680
9689
|
};
|
|
9681
9690
|
}
|
|
9682
9691
|
};
|
|
9683
|
-
|
|
9684
|
-
|
|
9692
|
+
var helpers = {};
|
|
9693
|
+
Object.defineProperty(helpers, "__esModule", {
|
|
9694
|
+
value: true
|
|
9695
|
+
});
|
|
9696
|
+
helpers.parseActions = parseActions;
|
|
9697
|
+
helpers.isHistory = isHistory;
|
|
9698
|
+
helpers.distinctState = distinctState;
|
|
9699
|
+
helpers.includeAction = includeAction;
|
|
9700
|
+
helpers.excludeAction = excludeAction;
|
|
9701
|
+
helpers.combineFilters = combineFilters;
|
|
9702
|
+
helpers.groupByActionTypes = groupByActionTypes;
|
|
9703
|
+
helpers.newHistory = newHistory;
|
|
9704
|
+
function parseActions(rawActions) {
|
|
9705
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
9706
|
+
if (Array.isArray(rawActions)) {
|
|
9707
|
+
return rawActions;
|
|
9708
|
+
} else if (typeof rawActions === 'string') {
|
|
9709
|
+
return [rawActions];
|
|
9710
|
+
}
|
|
9711
|
+
return defaultValue;
|
|
9712
|
+
}
|
|
9713
|
+
function isHistory(history) {
|
|
9714
|
+
return typeof history.present !== 'undefined' && typeof history.future !== 'undefined' && typeof history.past !== 'undefined' && Array.isArray(history.future) && Array.isArray(history.past);
|
|
9715
|
+
}
|
|
9716
|
+
function distinctState() {
|
|
9717
|
+
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.');
|
|
9718
|
+
return function () {
|
|
9719
|
+
return true;
|
|
9720
|
+
};
|
|
9721
|
+
}
|
|
9722
|
+
function includeAction(rawActions) {
|
|
9723
|
+
var actions = parseActions(rawActions);
|
|
9724
|
+
return function (action) {
|
|
9725
|
+
return actions.indexOf(action.type) >= 0;
|
|
9726
|
+
};
|
|
9727
|
+
}
|
|
9728
|
+
function excludeAction(rawActions) {
|
|
9729
|
+
var actions = parseActions(rawActions);
|
|
9730
|
+
return function (action) {
|
|
9731
|
+
return actions.indexOf(action.type) < 0;
|
|
9732
|
+
};
|
|
9733
|
+
}
|
|
9734
|
+
function combineFilters() {
|
|
9735
|
+
for (var _len = arguments.length, filters = Array(_len), _key = 0; _key < _len; _key++) {
|
|
9736
|
+
filters[_key] = arguments[_key];
|
|
9737
|
+
}
|
|
9738
|
+
return filters.reduce(function (prev, curr) {
|
|
9739
|
+
return function (action, currentState, previousHistory) {
|
|
9740
|
+
return prev(action, currentState, previousHistory) && curr(action, currentState, previousHistory);
|
|
9741
|
+
};
|
|
9742
|
+
}, function () {
|
|
9743
|
+
return true;
|
|
9744
|
+
});
|
|
9685
9745
|
}
|
|
9686
|
-
function
|
|
9687
|
-
|
|
9746
|
+
function groupByActionTypes(rawActions) {
|
|
9747
|
+
var actions = parseActions(rawActions);
|
|
9748
|
+
return function (action) {
|
|
9749
|
+
return actions.indexOf(action.type) >= 0 ? action.type : null;
|
|
9750
|
+
};
|
|
9688
9751
|
}
|
|
9689
|
-
function
|
|
9752
|
+
function newHistory(past, present, future) {
|
|
9753
|
+
var group = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
9690
9754
|
return {
|
|
9691
|
-
past:
|
|
9692
|
-
present:
|
|
9693
|
-
future:
|
|
9694
|
-
group:
|
|
9695
|
-
_latestUnfiltered:
|
|
9696
|
-
index:
|
|
9697
|
-
limit:
|
|
9755
|
+
past: past,
|
|
9756
|
+
present: present,
|
|
9757
|
+
future: future,
|
|
9758
|
+
group: group,
|
|
9759
|
+
_latestUnfiltered: present,
|
|
9760
|
+
index: past.length,
|
|
9761
|
+
limit: past.length + future.length + 1
|
|
9698
9762
|
};
|
|
9699
9763
|
}
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
prevState: "#9E9E9E",
|
|
9703
|
-
action: "#03A9F4",
|
|
9704
|
-
nextState: "#4CAF50"
|
|
9764
|
+
var reducer$1 = {
|
|
9765
|
+
exports: {}
|
|
9705
9766
|
};
|
|
9706
|
-
|
|
9707
|
-
|
|
9767
|
+
var debug$a = {};
|
|
9768
|
+
Object.defineProperty(debug$a, "__esModule", {
|
|
9769
|
+
value: true
|
|
9770
|
+
});
|
|
9771
|
+
function _toConsumableArray(arr) {
|
|
9772
|
+
if (Array.isArray(arr)) {
|
|
9773
|
+
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
|
|
9774
|
+
arr2[i] = arr[i];
|
|
9775
|
+
}
|
|
9776
|
+
return arr2;
|
|
9777
|
+
} else {
|
|
9778
|
+
return Array.from(arr);
|
|
9779
|
+
}
|
|
9780
|
+
}
|
|
9781
|
+
var __DEBUG__ = void 0;
|
|
9782
|
+
var displayBuffer = void 0;
|
|
9783
|
+
var colors = {
|
|
9784
|
+
prevState: '#9E9E9E',
|
|
9785
|
+
action: '#03A9F4',
|
|
9786
|
+
nextState: '#4CAF50'
|
|
9787
|
+
};
|
|
9788
|
+
function initBuffer() {
|
|
9789
|
+
displayBuffer = {
|
|
9708
9790
|
header: [],
|
|
9709
9791
|
prev: [],
|
|
9710
9792
|
action: [],
|
|
@@ -9712,117 +9794,362 @@ function F() {
|
|
|
9712
9794
|
msgs: []
|
|
9713
9795
|
};
|
|
9714
9796
|
}
|
|
9715
|
-
function
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
}
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
}
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
}
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
}
|
|
9761
|
-
function
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
if (!l) if ((f("history is uninitialized"), i === void 0)) {
|
|
9787
|
-
const g = e(i, {
|
|
9788
|
-
type: "@@redux-undo/CREATE_HISTORY"
|
|
9789
|
-
}, ...p);
|
|
9790
|
-
return (r = m(g, n.ignoreInitialState), f("do not set initialState on probe actions"), a(r), r);
|
|
9791
|
-
} else E(i) ? (r = l = n.ignoreInitialState ? i : T(i.past, i.present, i.future), f("initialHistory initialized: initialState is a history", l)) : (r = l = m(i, n.ignoreInitialState), f("initialHistory initialized: initialState is not a history", l));
|
|
9792
|
-
let u;
|
|
9793
|
-
switch (o.type) {
|
|
9794
|
-
case void 0:
|
|
9795
|
-
return r;
|
|
9796
|
-
case n.undoType:
|
|
9797
|
-
return (u = O(r, -1), f("perform undo"), a(u), s(u, o, ...p));
|
|
9798
|
-
case n.redoType:
|
|
9799
|
-
return (u = O(r, 1), f("perform redo"), a(u), s(u, o, ...p));
|
|
9800
|
-
case n.jumpToPastType:
|
|
9801
|
-
return (u = x(r, o.index), f(`perform jumpToPast to ${o.index}`), a(u), s(u, o, ...p));
|
|
9802
|
-
case n.jumpToFutureType:
|
|
9803
|
-
return (u = A(r, o.index), f(`perform jumpToFuture to ${o.index}`), a(u), s(u, o, ...p));
|
|
9804
|
-
case n.jumpType:
|
|
9805
|
-
return (u = O(r, o.index), f(`perform jump to ${o.index}`), a(u), s(u, o, ...p));
|
|
9806
|
-
case J(o.type, n.clearHistoryType):
|
|
9807
|
-
return (u = m(r.present, n.ignoreInitialState), f("perform clearHistory"), a(u), s(u, o, ...p));
|
|
9808
|
-
default:
|
|
9809
|
-
if ((u = e(r.present, o, ...p), n.initTypes.some(y => y === o.type))) return (f("reset history due to init action"), a(l), l);
|
|
9810
|
-
if (r._latestUnfiltered === u) return r;
|
|
9811
|
-
if (typeof n.filter == "function" && !n.filter(o, u, r)) {
|
|
9812
|
-
const y = T(r.past, u, r.future, r.group);
|
|
9813
|
-
return (n.syncFilter || (y._latestUnfiltered = r._latestUnfiltered), f("filter ignored action, not storing it in past"), a(y), y);
|
|
9797
|
+
function printBuffer() {
|
|
9798
|
+
var _displayBuffer = displayBuffer, header = _displayBuffer.header, prev = _displayBuffer.prev, next = _displayBuffer.next, action = _displayBuffer.action, msgs = _displayBuffer.msgs;
|
|
9799
|
+
if (console.group) {
|
|
9800
|
+
var _console, _console2, _console3, _console4, _console5;
|
|
9801
|
+
(_console = console).groupCollapsed.apply(_console, _toConsumableArray(header));
|
|
9802
|
+
(_console2 = console).log.apply(_console2, _toConsumableArray(prev));
|
|
9803
|
+
(_console3 = console).log.apply(_console3, _toConsumableArray(action));
|
|
9804
|
+
(_console4 = console).log.apply(_console4, _toConsumableArray(next));
|
|
9805
|
+
(_console5 = console).log.apply(_console5, _toConsumableArray(msgs));
|
|
9806
|
+
console.groupEnd();
|
|
9807
|
+
} else {
|
|
9808
|
+
var _console6, _console7, _console8, _console9, _console10;
|
|
9809
|
+
(_console6 = console).log.apply(_console6, _toConsumableArray(header));
|
|
9810
|
+
(_console7 = console).log.apply(_console7, _toConsumableArray(prev));
|
|
9811
|
+
(_console8 = console).log.apply(_console8, _toConsumableArray(action));
|
|
9812
|
+
(_console9 = console).log.apply(_console9, _toConsumableArray(next));
|
|
9813
|
+
(_console10 = console).log.apply(_console10, _toConsumableArray(msgs));
|
|
9814
|
+
}
|
|
9815
|
+
}
|
|
9816
|
+
function colorFormat(text, color, obj) {
|
|
9817
|
+
return ['%c' + text, 'color: ' + color + '; font-weight: bold', obj];
|
|
9818
|
+
}
|
|
9819
|
+
function start(action, state) {
|
|
9820
|
+
initBuffer();
|
|
9821
|
+
if (__DEBUG__) {
|
|
9822
|
+
if (console.group) {
|
|
9823
|
+
displayBuffer.header = ['%credux-undo', 'font-style: italic', 'action', action.type];
|
|
9824
|
+
displayBuffer.action = colorFormat('action', colors.action, action);
|
|
9825
|
+
displayBuffer.prev = colorFormat('prev history', colors.prevState, state);
|
|
9826
|
+
} else {
|
|
9827
|
+
displayBuffer.header = ['redux-undo action', action.type];
|
|
9828
|
+
displayBuffer.action = ['action', action];
|
|
9829
|
+
displayBuffer.prev = ['prev history', state];
|
|
9830
|
+
}
|
|
9831
|
+
}
|
|
9832
|
+
}
|
|
9833
|
+
function end(nextState) {
|
|
9834
|
+
if (__DEBUG__) {
|
|
9835
|
+
if (console.group) {
|
|
9836
|
+
displayBuffer.next = colorFormat('next history', colors.nextState, nextState);
|
|
9837
|
+
} else {
|
|
9838
|
+
displayBuffer.next = ['next history', nextState];
|
|
9839
|
+
}
|
|
9840
|
+
printBuffer();
|
|
9841
|
+
}
|
|
9842
|
+
}
|
|
9843
|
+
function log$a() {
|
|
9844
|
+
if (__DEBUG__) {
|
|
9845
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
9846
|
+
args[_key] = arguments[_key];
|
|
9847
|
+
}
|
|
9848
|
+
displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\n']));
|
|
9849
|
+
}
|
|
9850
|
+
}
|
|
9851
|
+
function set(debug) {
|
|
9852
|
+
__DEBUG__ = debug;
|
|
9853
|
+
}
|
|
9854
|
+
debug$a.set = set;
|
|
9855
|
+
debug$a.start = start;
|
|
9856
|
+
debug$a.end = end;
|
|
9857
|
+
debug$a.log = log$a;
|
|
9858
|
+
(function (module, exports) {
|
|
9859
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9860
|
+
value: true
|
|
9861
|
+
});
|
|
9862
|
+
var _extends = Object.assign || (function (target) {
|
|
9863
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
9864
|
+
var source = arguments[i];
|
|
9865
|
+
for (var key in source) {
|
|
9866
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9867
|
+
target[key] = source[key];
|
|
9814
9868
|
}
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9869
|
+
}
|
|
9870
|
+
}
|
|
9871
|
+
return target;
|
|
9872
|
+
});
|
|
9873
|
+
exports.default = undoable;
|
|
9874
|
+
var _debug = debug$a;
|
|
9875
|
+
var debug = _interopRequireWildcard(_debug);
|
|
9876
|
+
var _actions = actions;
|
|
9877
|
+
var _helpers = helpers;
|
|
9878
|
+
function _interopRequireWildcard(obj) {
|
|
9879
|
+
if (obj && obj.__esModule) {
|
|
9880
|
+
return obj;
|
|
9881
|
+
} else {
|
|
9882
|
+
var newObj = {};
|
|
9883
|
+
if (obj != null) {
|
|
9884
|
+
for (var key in obj) {
|
|
9885
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
9819
9886
|
}
|
|
9820
|
-
|
|
9887
|
+
}
|
|
9888
|
+
newObj.default = obj;
|
|
9889
|
+
return newObj;
|
|
9821
9890
|
}
|
|
9822
|
-
}
|
|
9823
|
-
|
|
9891
|
+
}
|
|
9892
|
+
function _toConsumableArray(arr) {
|
|
9893
|
+
if (Array.isArray(arr)) {
|
|
9894
|
+
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
|
|
9895
|
+
arr2[i] = arr[i];
|
|
9896
|
+
}
|
|
9897
|
+
return arr2;
|
|
9898
|
+
} else {
|
|
9899
|
+
return Array.from(arr);
|
|
9900
|
+
}
|
|
9901
|
+
}
|
|
9902
|
+
function createHistory(state, ignoreInitialState) {
|
|
9903
|
+
var history = (0, _helpers.newHistory)([], state, []);
|
|
9904
|
+
if (ignoreInitialState) {
|
|
9905
|
+
history._latestUnfiltered = null;
|
|
9906
|
+
}
|
|
9907
|
+
return history;
|
|
9908
|
+
}
|
|
9909
|
+
function lengthWithoutFuture(history) {
|
|
9910
|
+
return history.past.length + 1;
|
|
9911
|
+
}
|
|
9912
|
+
function insert(history, state, limit, group) {
|
|
9913
|
+
debug.log('inserting', state);
|
|
9914
|
+
debug.log('new free: ', limit - lengthWithoutFuture(history));
|
|
9915
|
+
var past = history.past, _latestUnfiltered = history._latestUnfiltered;
|
|
9916
|
+
var historyOverflow = limit && lengthWithoutFuture(history) >= limit;
|
|
9917
|
+
var pastSliced = past.slice(historyOverflow ? 1 : 0);
|
|
9918
|
+
var newPast = _latestUnfiltered != null ? [].concat(_toConsumableArray(pastSliced), [_latestUnfiltered]) : pastSliced;
|
|
9919
|
+
return (0, _helpers.newHistory)(newPast, state, [], group);
|
|
9920
|
+
}
|
|
9921
|
+
function jumpToFuture(history, index) {
|
|
9922
|
+
if (index < 0 || index >= history.future.length) return history;
|
|
9923
|
+
var past = history.past, future = history.future, _latestUnfiltered = history._latestUnfiltered;
|
|
9924
|
+
var newPast = [].concat(_toConsumableArray(past), [_latestUnfiltered], _toConsumableArray(future.slice(0, index)));
|
|
9925
|
+
var newPresent = future[index];
|
|
9926
|
+
var newFuture = future.slice(index + 1);
|
|
9927
|
+
return (0, _helpers.newHistory)(newPast, newPresent, newFuture);
|
|
9928
|
+
}
|
|
9929
|
+
function jumpToPast(history, index) {
|
|
9930
|
+
if (index < 0 || index >= history.past.length) return history;
|
|
9931
|
+
var past = history.past, future = history.future, _latestUnfiltered = history._latestUnfiltered;
|
|
9932
|
+
var newPast = past.slice(0, index);
|
|
9933
|
+
var newFuture = [].concat(_toConsumableArray(past.slice(index + 1)), [_latestUnfiltered], _toConsumableArray(future));
|
|
9934
|
+
var newPresent = past[index];
|
|
9935
|
+
return (0, _helpers.newHistory)(newPast, newPresent, newFuture);
|
|
9936
|
+
}
|
|
9937
|
+
function jump(history, n) {
|
|
9938
|
+
if (n > 0) return jumpToFuture(history, n - 1);
|
|
9939
|
+
if (n < 0) return jumpToPast(history, history.past.length + n);
|
|
9940
|
+
return history;
|
|
9941
|
+
}
|
|
9942
|
+
function actionTypeAmongClearHistoryType(actionType, clearHistoryType) {
|
|
9943
|
+
return clearHistoryType.indexOf(actionType) > -1 ? actionType : !actionType;
|
|
9944
|
+
}
|
|
9945
|
+
function undoable(reducer) {
|
|
9946
|
+
var rawConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9947
|
+
debug.set(rawConfig.debug);
|
|
9948
|
+
var config = {
|
|
9949
|
+
initTypes: (0, _helpers.parseActions)(rawConfig.initTypes, ['@@redux-undo/INIT']),
|
|
9950
|
+
limit: rawConfig.limit,
|
|
9951
|
+
filter: rawConfig.filter || (function () {
|
|
9952
|
+
return true;
|
|
9953
|
+
}),
|
|
9954
|
+
groupBy: rawConfig.groupBy || (function () {
|
|
9955
|
+
return null;
|
|
9956
|
+
}),
|
|
9957
|
+
undoType: rawConfig.undoType || _actions.ActionTypes.UNDO,
|
|
9958
|
+
redoType: rawConfig.redoType || _actions.ActionTypes.REDO,
|
|
9959
|
+
jumpToPastType: rawConfig.jumpToPastType || _actions.ActionTypes.JUMP_TO_PAST,
|
|
9960
|
+
jumpToFutureType: rawConfig.jumpToFutureType || _actions.ActionTypes.JUMP_TO_FUTURE,
|
|
9961
|
+
jumpType: rawConfig.jumpType || _actions.ActionTypes.JUMP,
|
|
9962
|
+
clearHistoryType: Array.isArray(rawConfig.clearHistoryType) ? rawConfig.clearHistoryType : [rawConfig.clearHistoryType || _actions.ActionTypes.CLEAR_HISTORY],
|
|
9963
|
+
neverSkipReducer: rawConfig.neverSkipReducer || false,
|
|
9964
|
+
ignoreInitialState: rawConfig.ignoreInitialState || false,
|
|
9965
|
+
syncFilter: rawConfig.syncFilter || false
|
|
9966
|
+
};
|
|
9967
|
+
var initialState = config.history;
|
|
9968
|
+
return function () {
|
|
9969
|
+
for (var _len = arguments.length, slices = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
9970
|
+
slices[_key - 2] = arguments[_key];
|
|
9971
|
+
}
|
|
9972
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
9973
|
+
var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9974
|
+
debug.start(action, state);
|
|
9975
|
+
var history = state;
|
|
9976
|
+
if (!initialState) {
|
|
9977
|
+
debug.log('history is uninitialized');
|
|
9978
|
+
if (state === undefined) {
|
|
9979
|
+
var clearHistoryAction = {
|
|
9980
|
+
type: _actions.ActionTypes.CLEAR_HISTORY
|
|
9981
|
+
};
|
|
9982
|
+
var start = reducer.apply(undefined, [state, clearHistoryAction].concat(slices));
|
|
9983
|
+
history = createHistory(start, config.ignoreInitialState);
|
|
9984
|
+
debug.log('do not set initialState on probe actions');
|
|
9985
|
+
} else if ((0, _helpers.isHistory)(state)) {
|
|
9986
|
+
history = initialState = config.ignoreInitialState ? state : (0, _helpers.newHistory)(state.past, state.present, state.future);
|
|
9987
|
+
debug.log('initialHistory initialized: initialState is a history', initialState);
|
|
9988
|
+
} else {
|
|
9989
|
+
history = initialState = createHistory(state, config.ignoreInitialState);
|
|
9990
|
+
debug.log('initialHistory initialized: initialState is not a history', initialState);
|
|
9991
|
+
}
|
|
9992
|
+
}
|
|
9993
|
+
var skipReducer = function skipReducer(res) {
|
|
9994
|
+
return config.neverSkipReducer ? _extends({}, res, {
|
|
9995
|
+
present: reducer.apply(undefined, [res.present, action].concat(slices))
|
|
9996
|
+
}) : res;
|
|
9997
|
+
};
|
|
9998
|
+
var res = void 0;
|
|
9999
|
+
switch (action.type) {
|
|
10000
|
+
case undefined:
|
|
10001
|
+
return history;
|
|
10002
|
+
case config.undoType:
|
|
10003
|
+
res = jump(history, -1);
|
|
10004
|
+
debug.log('perform undo');
|
|
10005
|
+
debug.end(res);
|
|
10006
|
+
return skipReducer(res);
|
|
10007
|
+
case config.redoType:
|
|
10008
|
+
res = jump(history, 1);
|
|
10009
|
+
debug.log('perform redo');
|
|
10010
|
+
debug.end(res);
|
|
10011
|
+
return skipReducer(res);
|
|
10012
|
+
case config.jumpToPastType:
|
|
10013
|
+
res = jumpToPast(history, action.index);
|
|
10014
|
+
debug.log('perform jumpToPast to ' + action.index);
|
|
10015
|
+
debug.end(res);
|
|
10016
|
+
return skipReducer(res);
|
|
10017
|
+
case config.jumpToFutureType:
|
|
10018
|
+
res = jumpToFuture(history, action.index);
|
|
10019
|
+
debug.log('perform jumpToFuture to ' + action.index);
|
|
10020
|
+
debug.end(res);
|
|
10021
|
+
return skipReducer(res);
|
|
10022
|
+
case config.jumpType:
|
|
10023
|
+
res = jump(history, action.index);
|
|
10024
|
+
debug.log('perform jump to ' + action.index);
|
|
10025
|
+
debug.end(res);
|
|
10026
|
+
return skipReducer(res);
|
|
10027
|
+
case actionTypeAmongClearHistoryType(action.type, config.clearHistoryType):
|
|
10028
|
+
res = createHistory(history.present);
|
|
10029
|
+
debug.log('perform clearHistory');
|
|
10030
|
+
debug.end(res);
|
|
10031
|
+
return skipReducer(res);
|
|
10032
|
+
default:
|
|
10033
|
+
res = reducer.apply(undefined, [history.present, action].concat(slices));
|
|
10034
|
+
if (config.initTypes.some(function (actionType) {
|
|
10035
|
+
return actionType === action.type;
|
|
10036
|
+
})) {
|
|
10037
|
+
debug.log('reset history due to init action');
|
|
10038
|
+
debug.end(initialState);
|
|
10039
|
+
return initialState;
|
|
10040
|
+
}
|
|
10041
|
+
if (history._latestUnfiltered === res) {
|
|
10042
|
+
return history;
|
|
10043
|
+
}
|
|
10044
|
+
var filtered = typeof config.filter === 'function' && !config.filter(action, res, history);
|
|
10045
|
+
var group = config.groupBy(action, res, history);
|
|
10046
|
+
if (filtered) {
|
|
10047
|
+
var filteredState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);
|
|
10048
|
+
if (!config.syncFilter) {
|
|
10049
|
+
filteredState._latestUnfiltered = history._latestUnfiltered;
|
|
10050
|
+
}
|
|
10051
|
+
debug.log('filter ignored action, not storing it in past');
|
|
10052
|
+
debug.end(filteredState);
|
|
10053
|
+
return filteredState;
|
|
10054
|
+
} else if (group != null && group === history.group) {
|
|
10055
|
+
var groupedState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);
|
|
10056
|
+
debug.log('groupBy grouped the action with the previous action');
|
|
10057
|
+
debug.end(groupedState);
|
|
10058
|
+
return groupedState;
|
|
10059
|
+
} else {
|
|
10060
|
+
history = insert(history, res, config.limit, group);
|
|
10061
|
+
debug.log('inserted new state into history');
|
|
10062
|
+
debug.end(history);
|
|
10063
|
+
return history;
|
|
10064
|
+
}
|
|
10065
|
+
}
|
|
10066
|
+
};
|
|
10067
|
+
}
|
|
10068
|
+
module.exports = exports['default'];
|
|
10069
|
+
})(reducer$1, reducer$1.exports);
|
|
10070
|
+
getDefaultExportFromCjs(reducer$1.exports);
|
|
10071
|
+
(function (exports) {
|
|
10072
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10073
|
+
value: true
|
|
10074
|
+
});
|
|
10075
|
+
var _actions = actions;
|
|
10076
|
+
Object.defineProperty(exports, 'ActionTypes', {
|
|
10077
|
+
enumerable: true,
|
|
10078
|
+
get: function get() {
|
|
10079
|
+
return _actions.ActionTypes;
|
|
10080
|
+
}
|
|
10081
|
+
});
|
|
10082
|
+
Object.defineProperty(exports, 'ActionCreators', {
|
|
10083
|
+
enumerable: true,
|
|
10084
|
+
get: function get() {
|
|
10085
|
+
return _actions.ActionCreators;
|
|
10086
|
+
}
|
|
10087
|
+
});
|
|
10088
|
+
var _helpers = helpers;
|
|
10089
|
+
Object.defineProperty(exports, 'parseActions', {
|
|
10090
|
+
enumerable: true,
|
|
10091
|
+
get: function get() {
|
|
10092
|
+
return _helpers.parseActions;
|
|
10093
|
+
}
|
|
10094
|
+
});
|
|
10095
|
+
Object.defineProperty(exports, 'isHistory', {
|
|
10096
|
+
enumerable: true,
|
|
10097
|
+
get: function get() {
|
|
10098
|
+
return _helpers.isHistory;
|
|
10099
|
+
}
|
|
10100
|
+
});
|
|
10101
|
+
Object.defineProperty(exports, 'distinctState', {
|
|
10102
|
+
enumerable: true,
|
|
10103
|
+
get: function get() {
|
|
10104
|
+
return _helpers.distinctState;
|
|
10105
|
+
}
|
|
10106
|
+
});
|
|
10107
|
+
Object.defineProperty(exports, 'includeAction', {
|
|
10108
|
+
enumerable: true,
|
|
10109
|
+
get: function get() {
|
|
10110
|
+
return _helpers.includeAction;
|
|
10111
|
+
}
|
|
10112
|
+
});
|
|
10113
|
+
Object.defineProperty(exports, 'excludeAction', {
|
|
10114
|
+
enumerable: true,
|
|
10115
|
+
get: function get() {
|
|
10116
|
+
return _helpers.excludeAction;
|
|
10117
|
+
}
|
|
10118
|
+
});
|
|
10119
|
+
Object.defineProperty(exports, 'combineFilters', {
|
|
10120
|
+
enumerable: true,
|
|
10121
|
+
get: function get() {
|
|
10122
|
+
return _helpers.combineFilters;
|
|
10123
|
+
}
|
|
10124
|
+
});
|
|
10125
|
+
Object.defineProperty(exports, 'groupByActionTypes', {
|
|
10126
|
+
enumerable: true,
|
|
10127
|
+
get: function get() {
|
|
10128
|
+
return _helpers.groupByActionTypes;
|
|
10129
|
+
}
|
|
10130
|
+
});
|
|
10131
|
+
Object.defineProperty(exports, 'newHistory', {
|
|
10132
|
+
enumerable: true,
|
|
10133
|
+
get: function get() {
|
|
10134
|
+
return _helpers.newHistory;
|
|
10135
|
+
}
|
|
10136
|
+
});
|
|
10137
|
+
var _reducer = reducer$1.exports;
|
|
10138
|
+
Object.defineProperty(exports, 'default', {
|
|
10139
|
+
enumerable: true,
|
|
10140
|
+
get: function get() {
|
|
10141
|
+
return _interopRequireDefault(_reducer).default;
|
|
10142
|
+
}
|
|
10143
|
+
});
|
|
10144
|
+
function _interopRequireDefault(obj) {
|
|
10145
|
+
return obj && obj.__esModule ? obj : {
|
|
10146
|
+
default: obj
|
|
10147
|
+
};
|
|
10148
|
+
}
|
|
10149
|
+
})(lib);
|
|
10150
|
+
var undoable = getDefaultExportFromCjs(lib);
|
|
9824
10151
|
var reducer = () => combineReducers({
|
|
9825
|
-
marks:
|
|
10152
|
+
marks: undoable(marks, {
|
|
9826
10153
|
debug: false
|
|
9827
10154
|
})
|
|
9828
10155
|
});
|
|
@@ -17360,8 +17687,8 @@ const mapStateToProps = s => ({
|
|
|
17360
17687
|
});
|
|
17361
17688
|
const mapDispatchToProps = dispatch => ({
|
|
17362
17689
|
onChangeMarks: m => dispatch(changeMarks(m)),
|
|
17363
|
-
onUndo: () => dispatch(
|
|
17364
|
-
onRedo: () => dispatch(
|
|
17690
|
+
onUndo: () => dispatch(lib.ActionCreators.undo()),
|
|
17691
|
+
onRedo: () => dispatch(lib.ActionCreators.redo()),
|
|
17365
17692
|
onReset: () => dispatch(changeMarks([]))
|
|
17366
17693
|
});
|
|
17367
17694
|
const GraphContainer = connect(mapStateToProps, mapDispatchToProps)(GraphWithControls$1);
|
package/module/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/graphing-module",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"mappings": {
|
|
5
5
|
"@pie-lib/plot": "_dll_pie_lib__plot",
|
|
6
6
|
"@pie-lib/graphing": "_dll_pie_lib__graphing"
|
|
@@ -8,30 +8,30 @@
|
|
|
8
8
|
"versionInfo": {
|
|
9
9
|
"data": {
|
|
10
10
|
"@pie-lib/plot": {
|
|
11
|
-
"version": "2.
|
|
11
|
+
"version": "2.22.0"
|
|
12
12
|
},
|
|
13
13
|
"@pie-lib/graphing": {
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.29.0"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"hash": "
|
|
17
|
+
"hash": "42916a51d373b14cf40d3b206d9707029ea56acc"
|
|
18
18
|
},
|
|
19
19
|
"modules": [
|
|
20
20
|
{
|
|
21
21
|
"name": "@pie-lib/shared-module",
|
|
22
|
-
"version": "^1.
|
|
22
|
+
"version": "^1.13.0"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "@pie-lib/editable-html-module",
|
|
26
|
-
"version": "^5.
|
|
26
|
+
"version": "^5.5.0"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"name": "@pie-lib/drag-module",
|
|
30
|
-
"version": "^2.
|
|
30
|
+
"version": "^2.7.0"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"name": "@pie-lib/config-module",
|
|
34
|
-
"version": "^2.
|
|
34
|
+
"version": "^2.18.0"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
37
|
"isLocal": true
|