@pie-lib/graphing-solution-set 4.1.0-beta.7 → 5.0.0-next.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +20 -0
- package/dist/autosize-input.d.ts +10 -0
- package/dist/autosize-input.js +66 -0
- package/dist/axis/arrow.d.ts +13 -0
- package/dist/axis/arrow.js +34 -0
- package/dist/axis/axes.d.ts +132 -0
- package/dist/axis/axes.js +214 -0
- package/dist/axis/index.d.ts +10 -0
- package/dist/bg.d.ts +51 -0
- package/dist/bg.js +44 -0
- package/dist/container/actions.d.ts +15 -0
- package/dist/container/actions.js +7 -0
- package/dist/container/index.d.ts +58 -0
- package/dist/container/index.js +48 -0
- package/dist/container/marks.d.ts +10 -0
- package/dist/container/marks.js +11 -0
- package/dist/container/middleware.d.ts +10 -0
- package/dist/container/middleware.js +4 -0
- package/dist/container/reducer.d.ts +14 -0
- package/dist/container/reducer.js +7 -0
- package/dist/coordinates-label.d.ts +50 -0
- package/dist/coordinates-label.js +46 -0
- package/dist/graph-with-controls.d.ts +85 -0
- package/dist/graph-with-controls.js +155 -0
- package/dist/graph.d.ts +119 -0
- package/dist/graph.js +221 -0
- package/dist/grid-setup.d.ts +27 -0
- package/dist/grid-setup.js +307 -0
- package/dist/grid.d.ts +43 -0
- package/dist/grid.js +59 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +6 -0
- package/dist/labels.d.ts +73 -0
- package/dist/labels.js +134 -0
- package/dist/mark-label.d.ts +50 -0
- package/dist/mark-label.js +84 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Axis.js +67 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +66 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Ticks.js +39 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +13 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickPosition.js +14 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/Grid.js +43 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridColumns.js +46 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridRows.js +46 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
- package/dist/node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js +17 -0
- package/dist/node_modules/.bun/@visx_point@4.0.0/node_modules/@visx/point/esm/Point.js +20 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js +7 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js +27 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js +27 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js +68 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/getStringWidth.js +19 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/memoize.js +13 -0
- package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
- package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
- package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +32 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +28 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +37 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +509 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +108 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +31 -0
- package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +45 -0
- package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +49 -0
- package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +34 -0
- package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +185 -0
- package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +198 -0
- package/dist/toggle-bar.d.ts +40 -0
- package/dist/tool-menu.d.ts +21 -0
- package/dist/tool-menu.js +188 -0
- package/dist/tools/index.d.ts +17 -0
- package/dist/tools/index.js +12 -0
- package/dist/tools/line/component.d.ts +113 -0
- package/dist/tools/line/component.js +58 -0
- package/dist/tools/line/index.d.ts +13 -0
- package/dist/tools/line/index.js +6 -0
- package/dist/tools/polygon/component.d.ts +117 -0
- package/dist/tools/polygon/component.js +194 -0
- package/dist/tools/polygon/index.d.ts +19 -0
- package/dist/tools/polygon/index.js +55 -0
- package/dist/tools/polygon/line.d.ts +125 -0
- package/dist/tools/polygon/polygon.d.ts +122 -0
- package/dist/tools/polygon/polygon.js +62 -0
- package/dist/tools/shared/arrow-head.d.ts +43 -0
- package/dist/tools/shared/arrow-head.js +37 -0
- package/dist/tools/shared/line/index.d.ts +240 -0
- package/dist/tools/shared/line/index.js +320 -0
- package/dist/tools/shared/line/line-path.d.ts +57 -0
- package/dist/tools/shared/line/with-root-edge.d.ts +143 -0
- package/dist/tools/shared/point/arrow-point.d.ts +57 -0
- package/dist/tools/shared/point/arrow-point.js +47 -0
- package/dist/tools/shared/point/arrow.d.ts +46 -0
- package/dist/tools/shared/point/arrow.js +36 -0
- package/dist/tools/shared/point/base-point.d.ts +50 -0
- package/dist/tools/shared/point/base-point.js +88 -0
- package/dist/tools/shared/point/index.d.ts +217 -0
- package/dist/tools/shared/point/index.js +51 -0
- package/dist/tools/shared/styles.d.ts +24 -0
- package/dist/tools/shared/styles.js +17 -0
- package/dist/tools/shared/types.d.ts +15 -0
- package/dist/tools/shared/types.js +10 -0
- package/dist/undo-redo.d.ts +20 -0
- package/dist/undo-redo.js +33 -0
- package/dist/use-debounce.d.ts +9 -0
- package/dist/use-debounce.js +13 -0
- package/dist/utils.d.ts +58 -0
- package/dist/utils.js +72 -0
- package/package.json +52 -42
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -449
- package/lib/__tests__/bg.test.js +0 -282
- package/lib/__tests__/bg.test.js.map +0 -1
- package/lib/__tests__/coordinates-label.test.js +0 -276
- package/lib/__tests__/coordinates-label.test.js.map +0 -1
- package/lib/__tests__/graph-with-controls.test.js +0 -256
- package/lib/__tests__/graph-with-controls.test.js.map +0 -1
- package/lib/__tests__/graph.test.js +0 -113
- package/lib/__tests__/graph.test.js.map +0 -1
- package/lib/__tests__/grid-setup.test.js +0 -729
- package/lib/__tests__/grid-setup.test.js.map +0 -1
- package/lib/__tests__/grid.test.js +0 -29
- package/lib/__tests__/grid.test.js.map +0 -1
- package/lib/__tests__/labels.test.js +0 -45
- package/lib/__tests__/labels.test.js.map +0 -1
- package/lib/__tests__/mark-label.test.js +0 -133
- package/lib/__tests__/mark-label.test.js.map +0 -1
- package/lib/__tests__/toggle-bar.test.js +0 -146
- package/lib/__tests__/toggle-bar.test.js.map +0 -1
- package/lib/__tests__/tool-menu.test.js +0 -540
- package/lib/__tests__/tool-menu.test.js.map +0 -1
- package/lib/__tests__/undo-redo.test.js +0 -31
- package/lib/__tests__/undo-redo.test.js.map +0 -1
- package/lib/__tests__/use-debounce.test.js +0 -24
- package/lib/__tests__/use-debounce.test.js.map +0 -1
- package/lib/__tests__/utils.js +0 -70
- package/lib/__tests__/utils.js.map +0 -1
- package/lib/__tests__/utils.test.js +0 -123
- package/lib/__tests__/utils.test.js.map +0 -1
- package/lib/axis/__tests__/arrow.test.js +0 -60
- package/lib/axis/__tests__/arrow.test.js.map +0 -1
- package/lib/axis/__tests__/axes.test.js +0 -160
- package/lib/axis/__tests__/axes.test.js.map +0 -1
- package/lib/axis/arrow.js +0 -79
- package/lib/axis/arrow.js.map +0 -1
- package/lib/axis/axes.js +0 -327
- package/lib/axis/axes.js.map +0 -1
- package/lib/axis/index.js +0 -21
- package/lib/axis/index.js.map +0 -1
- package/lib/bg.js +0 -114
- package/lib/bg.js.map +0 -1
- package/lib/container/__tests__/actions.test.js +0 -108
- package/lib/container/__tests__/actions.test.js.map +0 -1
- package/lib/container/__tests__/index.test.js +0 -346
- package/lib/container/__tests__/index.test.js.map +0 -1
- package/lib/container/__tests__/marks.test.js +0 -259
- package/lib/container/__tests__/marks.test.js.map +0 -1
- package/lib/container/__tests__/middleware.test.js +0 -244
- package/lib/container/__tests__/middleware.test.js.map +0 -1
- package/lib/container/__tests__/reducer.test.js +0 -450
- package/lib/container/__tests__/reducer.test.js.map +0 -1
- package/lib/container/actions.js +0 -18
- package/lib/container/actions.js.map +0 -1
- package/lib/container/index.js +0 -129
- package/lib/container/index.js.map +0 -1
- package/lib/container/marks.js +0 -22
- package/lib/container/marks.js.map +0 -1
- package/lib/container/middleware.js +0 -19
- package/lib/container/middleware.js.map +0 -1
- package/lib/container/reducer.js +0 -18
- package/lib/container/reducer.js.map +0 -1
- package/lib/coordinates-label.js +0 -77
- package/lib/coordinates-label.js.map +0 -1
- package/lib/graph-with-controls.js +0 -297
- package/lib/graph-with-controls.js.map +0 -1
- package/lib/graph.js +0 -353
- package/lib/graph.js.map +0 -1
- package/lib/grid-setup.js +0 -414
- package/lib/grid-setup.js.map +0 -1
- package/lib/grid.js +0 -131
- package/lib/grid.js.map +0 -1
- package/lib/index.js +0 -40
- package/lib/index.js.map +0 -1
- package/lib/labels.js +0 -199
- package/lib/labels.js.map +0 -1
- package/lib/mark-label.js +0 -159
- package/lib/mark-label.js.map +0 -1
- package/lib/toggle-bar.js +0 -248
- package/lib/toggle-bar.js.map +0 -1
- package/lib/tool-menu.js +0 -218
- package/lib/tool-menu.js.map +0 -1
- package/lib/tools/index.js +0 -24
- package/lib/tools/index.js.map +0 -1
- package/lib/tools/line/__tests__/component.test.js +0 -45
- package/lib/tools/line/__tests__/component.test.js.map +0 -1
- package/lib/tools/line/component.js +0 -92
- package/lib/tools/line/component.js.map +0 -1
- package/lib/tools/line/index.js +0 -11
- package/lib/tools/line/index.js.map +0 -1
- package/lib/tools/polygon/__tests__/component.test.js +0 -501
- package/lib/tools/polygon/__tests__/component.test.js.map +0 -1
- package/lib/tools/polygon/__tests__/index.test.js +0 -92
- package/lib/tools/polygon/__tests__/index.test.js.map +0 -1
- package/lib/tools/polygon/__tests__/line.test.js +0 -30
- package/lib/tools/polygon/__tests__/line.test.js.map +0 -1
- package/lib/tools/polygon/__tests__/polygon.test.js +0 -61
- package/lib/tools/polygon/__tests__/polygon.test.js.map +0 -1
- package/lib/tools/polygon/component.js +0 -358
- package/lib/tools/polygon/component.js.map +0 -1
- package/lib/tools/polygon/index.js +0 -89
- package/lib/tools/polygon/index.js.map +0 -1
- package/lib/tools/polygon/line.js +0 -114
- package/lib/tools/polygon/line.js.map +0 -1
- package/lib/tools/polygon/polygon.js +0 -128
- package/lib/tools/polygon/polygon.js.map +0 -1
- package/lib/tools/shared/__tests__/arrow-head.test.js +0 -45
- package/lib/tools/shared/__tests__/arrow-head.test.js.map +0 -1
- package/lib/tools/shared/arrow-head.js +0 -62
- package/lib/tools/shared/arrow-head.js.map +0 -1
- package/lib/tools/shared/line/__tests__/index.test.js +0 -725
- package/lib/tools/shared/line/__tests__/index.test.js.map +0 -1
- package/lib/tools/shared/line/__tests__/line-path.test.js +0 -64
- package/lib/tools/shared/line/__tests__/line-path.test.js.map +0 -1
- package/lib/tools/shared/line/__tests__/with-root-edge.test.js +0 -618
- package/lib/tools/shared/line/__tests__/with-root-edge.test.js.map +0 -1
- package/lib/tools/shared/line/index.js +0 -539
- package/lib/tools/shared/line/index.js.map +0 -1
- package/lib/tools/shared/line/line-path.js +0 -121
- package/lib/tools/shared/line/line-path.js.map +0 -1
- package/lib/tools/shared/line/with-root-edge.js +0 -121
- package/lib/tools/shared/line/with-root-edge.js.map +0 -1
- package/lib/tools/shared/point/__tests__/arrow-point.test.js +0 -127
- package/lib/tools/shared/point/__tests__/arrow-point.test.js.map +0 -1
- package/lib/tools/shared/point/__tests__/arrow.test.js +0 -619
- package/lib/tools/shared/point/__tests__/arrow.test.js.map +0 -1
- package/lib/tools/shared/point/__tests__/base-point.test.js +0 -122
- package/lib/tools/shared/point/__tests__/base-point.test.js.map +0 -1
- package/lib/tools/shared/point/arrow-point.js +0 -86
- package/lib/tools/shared/point/arrow-point.js.map +0 -1
- package/lib/tools/shared/point/arrow.js +0 -70
- package/lib/tools/shared/point/arrow.js.map +0 -1
- package/lib/tools/shared/point/base-point.js +0 -137
- package/lib/tools/shared/point/base-point.js.map +0 -1
- package/lib/tools/shared/point/index.js +0 -80
- package/lib/tools/shared/point/index.js.map +0 -1
- package/lib/tools/shared/styles.js +0 -26
- package/lib/tools/shared/styles.js.map +0 -1
- package/lib/tools/shared/types.js +0 -15
- package/lib/tools/shared/types.js.map +0 -1
- package/lib/undo-redo.js +0 -67
- package/lib/undo-redo.js.map +0 -1
- package/lib/use-debounce.js +0 -25
- package/lib/use-debounce.js.map +0 -1
- package/lib/utils.js +0 -235
- package/lib/utils.js.map +0 -1
- package/src/__tests__/bg.test.jsx +0 -250
- package/src/__tests__/coordinates-label.test.jsx +0 -243
- package/src/__tests__/graph-with-controls.test.jsx +0 -184
- package/src/__tests__/graph.test.jsx +0 -93
- package/src/__tests__/grid-setup.test.jsx +0 -645
- package/src/__tests__/grid.test.jsx +0 -23
- package/src/__tests__/labels.test.jsx +0 -41
- package/src/__tests__/mark-label.test.jsx +0 -66
- package/src/__tests__/toggle-bar.test.jsx +0 -106
- package/src/__tests__/tool-menu.test.jsx +0 -453
- package/src/__tests__/undo-redo.test.jsx +0 -26
- package/src/__tests__/use-debounce.test.js +0 -21
- package/src/__tests__/utils.js +0 -41
- package/src/__tests__/utils.test.js +0 -105
- package/src/axis/__tests__/arrow.test.jsx +0 -43
- package/src/axis/__tests__/axes.test.jsx +0 -182
- package/src/axis/arrow.jsx +0 -57
- package/src/axis/axes.jsx +0 -284
- package/src/axis/index.js +0 -3
- package/src/bg.jsx +0 -96
- package/src/container/__tests__/actions.test.js +0 -105
- package/src/container/__tests__/index.test.jsx +0 -227
- package/src/container/__tests__/marks.test.js +0 -172
- package/src/container/__tests__/middleware.test.js +0 -235
- package/src/container/__tests__/reducer.test.js +0 -324
- package/src/container/actions.js +0 -8
- package/src/container/index.jsx +0 -93
- package/src/container/marks.js +0 -14
- package/src/container/middleware.js +0 -7
- package/src/container/reducer.js +0 -5
- package/src/coordinates-label.jsx +0 -62
- package/src/graph-with-controls.jsx +0 -242
- package/src/graph.jsx +0 -333
- package/src/grid-setup.jsx +0 -432
- package/src/grid.jsx +0 -133
- package/src/index.js +0 -7
- package/src/labels.jsx +0 -173
- package/src/mark-label.jsx +0 -125
- package/src/toggle-bar.jsx +0 -221
- package/src/tool-menu.jsx +0 -235
- package/src/tools/index.js +0 -8
- package/src/tools/line/__tests__/component.test.jsx +0 -37
- package/src/tools/line/component.jsx +0 -77
- package/src/tools/line/index.js +0 -4
- package/src/tools/polygon/__tests__/component.test.jsx +0 -487
- package/src/tools/polygon/__tests__/index.test.js +0 -65
- package/src/tools/polygon/__tests__/line.test.jsx +0 -23
- package/src/tools/polygon/__tests__/polygon.test.jsx +0 -44
- package/src/tools/polygon/component.jsx +0 -324
- package/src/tools/polygon/index.js +0 -52
- package/src/tools/polygon/line.jsx +0 -80
- package/src/tools/polygon/polygon.jsx +0 -93
- package/src/tools/shared/__tests__/arrow-head.test.jsx +0 -33
- package/src/tools/shared/arrow-head.jsx +0 -46
- package/src/tools/shared/line/__tests__/index.test.jsx +0 -553
- package/src/tools/shared/line/__tests__/line-path.test.jsx +0 -56
- package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +0 -488
- package/src/tools/shared/line/index.jsx +0 -471
- package/src/tools/shared/line/line-path.jsx +0 -85
- package/src/tools/shared/line/with-root-edge.jsx +0 -97
- package/src/tools/shared/point/__tests__/arrow-point.test.jsx +0 -91
- package/src/tools/shared/point/__tests__/arrow.test.jsx +0 -469
- package/src/tools/shared/point/__tests__/base-point.test.jsx +0 -87
- package/src/tools/shared/point/arrow-point.jsx +0 -60
- package/src/tools/shared/point/arrow.jsx +0 -40
- package/src/tools/shared/point/base-point.jsx +0 -113
- package/src/tools/shared/point/index.jsx +0 -58
- package/src/tools/shared/styles.js +0 -20
- package/src/tools/shared/types.js +0 -8
- package/src/undo-redo.jsx +0 -37
- package/src/use-debounce.js +0 -13
- package/src/utils.js +0 -230
|
@@ -1,450 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
5
|
-
var _reducer = _interopRequireDefault(require("../reducer"));
|
|
6
|
-
var _actions = require("../actions");
|
|
7
|
-
describe('container reducer', function () {
|
|
8
|
-
describe('reducer creation', function () {
|
|
9
|
-
it('creates a reducer function', function () {
|
|
10
|
-
var rootReducer = (0, _reducer["default"])();
|
|
11
|
-
expect((0, _typeof2["default"])(rootReducer)).toBe('function');
|
|
12
|
-
});
|
|
13
|
-
it('returns an object with marks property', function () {
|
|
14
|
-
var rootReducer = (0, _reducer["default"])();
|
|
15
|
-
var state = rootReducer(undefined, {
|
|
16
|
-
type: 'INIT'
|
|
17
|
-
});
|
|
18
|
-
expect(state).toHaveProperty('marks');
|
|
19
|
-
});
|
|
20
|
-
it('wraps marks reducer with undoable', function () {
|
|
21
|
-
var rootReducer = (0, _reducer["default"])();
|
|
22
|
-
var state = rootReducer(undefined, {
|
|
23
|
-
type: 'INIT'
|
|
24
|
-
});
|
|
25
|
-
expect(state.marks).toHaveProperty('past');
|
|
26
|
-
expect(state.marks).toHaveProperty('present');
|
|
27
|
-
expect(state.marks).toHaveProperty('future');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
describe('initial state', function () {
|
|
31
|
-
it('initializes with empty past', function () {
|
|
32
|
-
var rootReducer = (0, _reducer["default"])();
|
|
33
|
-
var state = rootReducer(undefined, {
|
|
34
|
-
type: 'INIT'
|
|
35
|
-
});
|
|
36
|
-
expect(state.marks.past).toEqual([]);
|
|
37
|
-
});
|
|
38
|
-
it('initializes with empty present', function () {
|
|
39
|
-
var rootReducer = (0, _reducer["default"])();
|
|
40
|
-
var state = rootReducer(undefined, {
|
|
41
|
-
type: 'INIT'
|
|
42
|
-
});
|
|
43
|
-
expect(state.marks.present).toEqual([]);
|
|
44
|
-
});
|
|
45
|
-
it('initializes with empty future', function () {
|
|
46
|
-
var rootReducer = (0, _reducer["default"])();
|
|
47
|
-
var state = rootReducer(undefined, {
|
|
48
|
-
type: 'INIT'
|
|
49
|
-
});
|
|
50
|
-
expect(state.marks.future).toEqual([]);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('CHANGE_MARKS action', function () {
|
|
54
|
-
it('updates present with new marks', function () {
|
|
55
|
-
var rootReducer = (0, _reducer["default"])();
|
|
56
|
-
var newMarks = [{
|
|
57
|
-
id: 1,
|
|
58
|
-
type: 'point',
|
|
59
|
-
x: 5,
|
|
60
|
-
y: 10
|
|
61
|
-
}];
|
|
62
|
-
var action = (0, _actions.changeMarks)(newMarks);
|
|
63
|
-
var state = rootReducer(undefined, {
|
|
64
|
-
type: '@@INIT'
|
|
65
|
-
});
|
|
66
|
-
state = rootReducer(state, action);
|
|
67
|
-
expect(state.marks.present).toEqual(newMarks);
|
|
68
|
-
});
|
|
69
|
-
it('adds previous state to past', function () {
|
|
70
|
-
var rootReducer = (0, _reducer["default"])();
|
|
71
|
-
var firstMarks = [{
|
|
72
|
-
id: 1,
|
|
73
|
-
type: 'point'
|
|
74
|
-
}];
|
|
75
|
-
var secondMarks = [{
|
|
76
|
-
id: 2,
|
|
77
|
-
type: 'line'
|
|
78
|
-
}];
|
|
79
|
-
var state = rootReducer(undefined, {
|
|
80
|
-
type: '@@INIT'
|
|
81
|
-
});
|
|
82
|
-
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
83
|
-
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
84
|
-
expect(state.marks.past.length).toBeGreaterThan(0);
|
|
85
|
-
expect(state.marks.present).toEqual(secondMarks);
|
|
86
|
-
});
|
|
87
|
-
it('clears future on new action', function () {
|
|
88
|
-
var rootReducer = (0, _reducer["default"])();
|
|
89
|
-
var firstMarks = [{
|
|
90
|
-
id: 1,
|
|
91
|
-
type: 'point'
|
|
92
|
-
}];
|
|
93
|
-
var secondMarks = [{
|
|
94
|
-
id: 2,
|
|
95
|
-
type: 'line'
|
|
96
|
-
}];
|
|
97
|
-
var thirdMarks = [{
|
|
98
|
-
id: 3,
|
|
99
|
-
type: 'circle'
|
|
100
|
-
}];
|
|
101
|
-
var state = rootReducer(undefined, {
|
|
102
|
-
type: '@@INIT'
|
|
103
|
-
});
|
|
104
|
-
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
105
|
-
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
106
|
-
state = rootReducer(state, {
|
|
107
|
-
type: '@@redux-undo/UNDO'
|
|
108
|
-
});
|
|
109
|
-
expect(state.marks.future.length).toBeGreaterThan(0);
|
|
110
|
-
state = rootReducer(state, (0, _actions.changeMarks)(thirdMarks));
|
|
111
|
-
expect(state.marks.future).toEqual([]);
|
|
112
|
-
});
|
|
113
|
-
it('handles empty marks array', function () {
|
|
114
|
-
var rootReducer = (0, _reducer["default"])();
|
|
115
|
-
var action = (0, _actions.changeMarks)([]);
|
|
116
|
-
var state = rootReducer(undefined, {
|
|
117
|
-
type: '@@INIT'
|
|
118
|
-
});
|
|
119
|
-
state = rootReducer(state, action);
|
|
120
|
-
expect(state.marks.present).toEqual([]);
|
|
121
|
-
});
|
|
122
|
-
it('handles multiple marks', function () {
|
|
123
|
-
var rootReducer = (0, _reducer["default"])();
|
|
124
|
-
var marks = [{
|
|
125
|
-
id: 1,
|
|
126
|
-
type: 'point',
|
|
127
|
-
x: 1,
|
|
128
|
-
y: 2
|
|
129
|
-
}, {
|
|
130
|
-
id: 2,
|
|
131
|
-
type: 'line',
|
|
132
|
-
from: {
|
|
133
|
-
x: 0,
|
|
134
|
-
y: 0
|
|
135
|
-
},
|
|
136
|
-
to: {
|
|
137
|
-
x: 5,
|
|
138
|
-
y: 5
|
|
139
|
-
}
|
|
140
|
-
}, {
|
|
141
|
-
id: 3,
|
|
142
|
-
type: 'circle',
|
|
143
|
-
center: {
|
|
144
|
-
x: 3,
|
|
145
|
-
y: 3
|
|
146
|
-
},
|
|
147
|
-
radius: 2
|
|
148
|
-
}];
|
|
149
|
-
var action = (0, _actions.changeMarks)(marks);
|
|
150
|
-
var state = rootReducer(undefined, {
|
|
151
|
-
type: '@@INIT'
|
|
152
|
-
});
|
|
153
|
-
state = rootReducer(state, action);
|
|
154
|
-
expect(state.marks.present).toEqual(marks);
|
|
155
|
-
expect(state.marks.present.length).toBe(3);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
describe('undo functionality', function () {
|
|
159
|
-
it('supports undo action', function () {
|
|
160
|
-
var rootReducer = (0, _reducer["default"])();
|
|
161
|
-
var firstMarks = [{
|
|
162
|
-
id: 1,
|
|
163
|
-
type: 'point'
|
|
164
|
-
}];
|
|
165
|
-
var secondMarks = [{
|
|
166
|
-
id: 2,
|
|
167
|
-
type: 'line'
|
|
168
|
-
}];
|
|
169
|
-
var state = rootReducer(undefined, {
|
|
170
|
-
type: '@@INIT'
|
|
171
|
-
});
|
|
172
|
-
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
173
|
-
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
174
|
-
state = rootReducer(state, {
|
|
175
|
-
type: '@@redux-undo/UNDO'
|
|
176
|
-
});
|
|
177
|
-
expect(state.marks.present).toEqual(firstMarks);
|
|
178
|
-
});
|
|
179
|
-
it('moves present to future on undo', function () {
|
|
180
|
-
var rootReducer = (0, _reducer["default"])();
|
|
181
|
-
var firstMarks = [{
|
|
182
|
-
id: 1,
|
|
183
|
-
type: 'point'
|
|
184
|
-
}];
|
|
185
|
-
var secondMarks = [{
|
|
186
|
-
id: 2,
|
|
187
|
-
type: 'line'
|
|
188
|
-
}];
|
|
189
|
-
var state = rootReducer(undefined, {
|
|
190
|
-
type: '@@INIT'
|
|
191
|
-
});
|
|
192
|
-
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
193
|
-
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
194
|
-
state = rootReducer(state, {
|
|
195
|
-
type: '@@redux-undo/UNDO'
|
|
196
|
-
});
|
|
197
|
-
expect(state.marks.future.length).toBeGreaterThan(0);
|
|
198
|
-
});
|
|
199
|
-
it('handles multiple undos', function () {
|
|
200
|
-
var rootReducer = (0, _reducer["default"])();
|
|
201
|
-
var marks1 = [{
|
|
202
|
-
id: 1
|
|
203
|
-
}];
|
|
204
|
-
var marks2 = [{
|
|
205
|
-
id: 2
|
|
206
|
-
}];
|
|
207
|
-
var marks3 = [{
|
|
208
|
-
id: 3
|
|
209
|
-
}];
|
|
210
|
-
var state = rootReducer(undefined, {
|
|
211
|
-
type: '@@INIT'
|
|
212
|
-
});
|
|
213
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks1));
|
|
214
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks2));
|
|
215
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks3));
|
|
216
|
-
state = rootReducer(state, {
|
|
217
|
-
type: '@@redux-undo/UNDO'
|
|
218
|
-
});
|
|
219
|
-
state = rootReducer(state, {
|
|
220
|
-
type: '@@redux-undo/UNDO'
|
|
221
|
-
});
|
|
222
|
-
expect(state.marks.present).toEqual(marks1);
|
|
223
|
-
});
|
|
224
|
-
it('does not undo beyond initial state', function () {
|
|
225
|
-
var rootReducer = (0, _reducer["default"])();
|
|
226
|
-
var marks = [{
|
|
227
|
-
id: 1,
|
|
228
|
-
type: 'point'
|
|
229
|
-
}];
|
|
230
|
-
var state = rootReducer(undefined, {
|
|
231
|
-
type: '@@INIT'
|
|
232
|
-
});
|
|
233
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
234
|
-
state = rootReducer(state, {
|
|
235
|
-
type: '@@redux-undo/UNDO'
|
|
236
|
-
});
|
|
237
|
-
state = rootReducer(state, {
|
|
238
|
-
type: '@@redux-undo/UNDO'
|
|
239
|
-
});
|
|
240
|
-
state = rootReducer(state, {
|
|
241
|
-
type: '@@redux-undo/UNDO'
|
|
242
|
-
});
|
|
243
|
-
expect(state.marks.present).toEqual([]);
|
|
244
|
-
expect(state.marks.past).toEqual([]);
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
describe('redo functionality', function () {
|
|
248
|
-
it('supports redo action', function () {
|
|
249
|
-
var rootReducer = (0, _reducer["default"])();
|
|
250
|
-
var firstMarks = [{
|
|
251
|
-
id: 1,
|
|
252
|
-
type: 'point'
|
|
253
|
-
}];
|
|
254
|
-
var secondMarks = [{
|
|
255
|
-
id: 2,
|
|
256
|
-
type: 'line'
|
|
257
|
-
}];
|
|
258
|
-
var state = rootReducer(undefined, {
|
|
259
|
-
type: '@@INIT'
|
|
260
|
-
});
|
|
261
|
-
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
262
|
-
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
263
|
-
state = rootReducer(state, {
|
|
264
|
-
type: '@@redux-undo/UNDO'
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
// Redo
|
|
268
|
-
state = rootReducer(state, {
|
|
269
|
-
type: '@@redux-undo/REDO'
|
|
270
|
-
});
|
|
271
|
-
expect(state.marks.present).toEqual(secondMarks);
|
|
272
|
-
});
|
|
273
|
-
it('moves future to past on redo', function () {
|
|
274
|
-
var rootReducer = (0, _reducer["default"])();
|
|
275
|
-
var firstMarks = [{
|
|
276
|
-
id: 1,
|
|
277
|
-
type: 'point'
|
|
278
|
-
}];
|
|
279
|
-
var secondMarks = [{
|
|
280
|
-
id: 2,
|
|
281
|
-
type: 'line'
|
|
282
|
-
}];
|
|
283
|
-
var state = rootReducer(undefined, {
|
|
284
|
-
type: '@@INIT'
|
|
285
|
-
});
|
|
286
|
-
state = rootReducer(state, (0, _actions.changeMarks)(firstMarks));
|
|
287
|
-
state = rootReducer(state, (0, _actions.changeMarks)(secondMarks));
|
|
288
|
-
state = rootReducer(state, {
|
|
289
|
-
type: '@@redux-undo/UNDO'
|
|
290
|
-
});
|
|
291
|
-
var futureBeforeRedo = state.marks.future.length;
|
|
292
|
-
state = rootReducer(state, {
|
|
293
|
-
type: '@@redux-undo/REDO'
|
|
294
|
-
});
|
|
295
|
-
expect(state.marks.future.length).toBe(futureBeforeRedo - 1);
|
|
296
|
-
});
|
|
297
|
-
it('handles multiple redos', function () {
|
|
298
|
-
var rootReducer = (0, _reducer["default"])();
|
|
299
|
-
var marks1 = [{
|
|
300
|
-
id: 1
|
|
301
|
-
}];
|
|
302
|
-
var marks2 = [{
|
|
303
|
-
id: 2
|
|
304
|
-
}];
|
|
305
|
-
var marks3 = [{
|
|
306
|
-
id: 3
|
|
307
|
-
}];
|
|
308
|
-
var state = rootReducer(undefined, {
|
|
309
|
-
type: '@@INIT'
|
|
310
|
-
});
|
|
311
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks1));
|
|
312
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks2));
|
|
313
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks3));
|
|
314
|
-
|
|
315
|
-
// undo twice, then redo twice
|
|
316
|
-
state = rootReducer(state, {
|
|
317
|
-
type: '@@redux-undo/UNDO'
|
|
318
|
-
});
|
|
319
|
-
state = rootReducer(state, {
|
|
320
|
-
type: '@@redux-undo/UNDO'
|
|
321
|
-
});
|
|
322
|
-
state = rootReducer(state, {
|
|
323
|
-
type: '@@redux-undo/REDO'
|
|
324
|
-
});
|
|
325
|
-
state = rootReducer(state, {
|
|
326
|
-
type: '@@redux-undo/REDO'
|
|
327
|
-
});
|
|
328
|
-
expect(state.marks.present).toEqual(marks3);
|
|
329
|
-
});
|
|
330
|
-
it('does not redo beyond last state', function () {
|
|
331
|
-
var rootReducer = (0, _reducer["default"])();
|
|
332
|
-
var marks = [{
|
|
333
|
-
id: 1,
|
|
334
|
-
type: 'point'
|
|
335
|
-
}];
|
|
336
|
-
var state = rootReducer(undefined, {
|
|
337
|
-
type: '@@INIT'
|
|
338
|
-
});
|
|
339
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
340
|
-
state = rootReducer(state, {
|
|
341
|
-
type: '@@redux-undo/UNDO'
|
|
342
|
-
});
|
|
343
|
-
state = rootReducer(state, {
|
|
344
|
-
type: '@@redux-undo/REDO'
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
// try to redo beyond the end
|
|
348
|
-
state = rootReducer(state, {
|
|
349
|
-
type: '@@redux-undo/REDO'
|
|
350
|
-
});
|
|
351
|
-
state = rootReducer(state, {
|
|
352
|
-
type: '@@redux-undo/REDO'
|
|
353
|
-
});
|
|
354
|
-
expect(state.marks.present).toEqual(marks);
|
|
355
|
-
expect(state.marks.future).toEqual([]);
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
describe('state structure', function () {
|
|
359
|
-
it('maintains correct undoable structure', function () {
|
|
360
|
-
var rootReducer = (0, _reducer["default"])();
|
|
361
|
-
var state = rootReducer(undefined, {
|
|
362
|
-
type: 'INIT'
|
|
363
|
-
});
|
|
364
|
-
expect(state.marks).toHaveProperty('past');
|
|
365
|
-
expect(state.marks).toHaveProperty('present');
|
|
366
|
-
expect(state.marks).toHaveProperty('future');
|
|
367
|
-
expect(Array.isArray(state.marks.past)).toBe(true);
|
|
368
|
-
expect(Array.isArray(state.marks.future)).toBe(true);
|
|
369
|
-
});
|
|
370
|
-
it('preserves mark properties through undo/redo', function () {
|
|
371
|
-
var rootReducer = (0, _reducer["default"])();
|
|
372
|
-
var marks = [{
|
|
373
|
-
id: 1,
|
|
374
|
-
type: 'point',
|
|
375
|
-
x: 10,
|
|
376
|
-
y: 20,
|
|
377
|
-
label: 'A',
|
|
378
|
-
correctness: {
|
|
379
|
-
value: 'correct'
|
|
380
|
-
}
|
|
381
|
-
}];
|
|
382
|
-
var state = rootReducer(undefined, {
|
|
383
|
-
type: 'INIT'
|
|
384
|
-
});
|
|
385
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
386
|
-
state = rootReducer(state, (0, _actions.changeMarks)([]));
|
|
387
|
-
state = rootReducer(state, {
|
|
388
|
-
type: '@@redux-undo/UNDO'
|
|
389
|
-
});
|
|
390
|
-
expect(state.marks.present).toEqual(marks);
|
|
391
|
-
expect(state.marks.present[0]).toBeDefined();
|
|
392
|
-
if (state.marks.present[0]) {
|
|
393
|
-
expect(state.marks.present[0]).toEqual(marks[0]);
|
|
394
|
-
expect(state.marks.present[0].correctness).toBeDefined();
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
});
|
|
398
|
-
describe('integration', function () {
|
|
399
|
-
it('handles complex undo/redo sequences', function () {
|
|
400
|
-
var rootReducer = (0, _reducer["default"])();
|
|
401
|
-
var marks1 = [{
|
|
402
|
-
id: 1
|
|
403
|
-
}];
|
|
404
|
-
var marks2 = [{
|
|
405
|
-
id: 2
|
|
406
|
-
}];
|
|
407
|
-
var marks3 = [{
|
|
408
|
-
id: 3
|
|
409
|
-
}];
|
|
410
|
-
var marks4 = [{
|
|
411
|
-
id: 4
|
|
412
|
-
}];
|
|
413
|
-
var state = rootReducer(undefined, {
|
|
414
|
-
type: '@@INIT'
|
|
415
|
-
});
|
|
416
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks1));
|
|
417
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks2));
|
|
418
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks3));
|
|
419
|
-
state = rootReducer(state, {
|
|
420
|
-
type: '@@redux-undo/UNDO'
|
|
421
|
-
}); // back to marks2
|
|
422
|
-
state = rootReducer(state, {
|
|
423
|
-
type: '@@redux-undo/UNDO'
|
|
424
|
-
}); // back to marks1
|
|
425
|
-
state = rootReducer(state, {
|
|
426
|
-
type: '@@redux-undo/REDO'
|
|
427
|
-
}); // forward to marks2
|
|
428
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks4));
|
|
429
|
-
expect(state.marks.present).toEqual(marks4);
|
|
430
|
-
expect(state.marks.future).toEqual([]);
|
|
431
|
-
});
|
|
432
|
-
it('works with empty state transitions', function () {
|
|
433
|
-
var rootReducer = (0, _reducer["default"])();
|
|
434
|
-
var marks = [{
|
|
435
|
-
id: 1
|
|
436
|
-
}];
|
|
437
|
-
var state = rootReducer(undefined, {
|
|
438
|
-
type: '@@INIT'
|
|
439
|
-
});
|
|
440
|
-
state = rootReducer(state, (0, _actions.changeMarks)([]));
|
|
441
|
-
state = rootReducer(state, (0, _actions.changeMarks)(marks));
|
|
442
|
-
state = rootReducer(state, (0, _actions.changeMarks)([]));
|
|
443
|
-
state = rootReducer(state, {
|
|
444
|
-
type: '@@redux-undo/UNDO'
|
|
445
|
-
});
|
|
446
|
-
expect(state.marks.present).toEqual(marks);
|
|
447
|
-
});
|
|
448
|
-
});
|
|
449
|
-
});
|
|
450
|
-
//# sourceMappingURL=reducer.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.test.js","names":["_reducer","_interopRequireDefault","require","_actions","describe","it","rootReducer","reducer","expect","_typeof2","toBe","state","undefined","type","toHaveProperty","marks","past","toEqual","present","future","newMarks","id","x","y","action","changeMarks","firstMarks","secondMarks","length","toBeGreaterThan","thirdMarks","from","to","center","radius","marks1","marks2","marks3","futureBeforeRedo","Array","isArray","label","correctness","value","toBeDefined","marks4"],"sources":["../../../src/container/__tests__/reducer.test.js"],"sourcesContent":["import reducer from '../reducer';\nimport { changeMarks } from '../actions';\n\ndescribe('container reducer', () => {\n describe('reducer creation', () => {\n it('creates a reducer function', () => {\n const rootReducer = reducer();\n expect(typeof rootReducer).toBe('function');\n });\n\n it('returns an object with marks property', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n expect(state).toHaveProperty('marks');\n });\n\n it('wraps marks reducer with undoable', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks).toHaveProperty('past');\n expect(state.marks).toHaveProperty('present');\n expect(state.marks).toHaveProperty('future');\n });\n });\n\n describe('initial state', () => {\n it('initializes with empty past', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks.past).toEqual([]);\n });\n\n it('initializes with empty present', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks.present).toEqual([]);\n });\n\n it('initializes with empty future', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks.future).toEqual([]);\n });\n });\n\n describe('CHANGE_MARKS action', () => {\n it('updates present with new marks', () => {\n const rootReducer = reducer();\n const newMarks = [{ id: 1, type: 'point', x: 5, y: 10 }];\n const action = changeMarks(newMarks);\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, action);\n\n expect(state.marks.present).toEqual(newMarks);\n });\n\n it('adds previous state to past', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n\n expect(state.marks.past.length).toBeGreaterThan(0);\n expect(state.marks.present).toEqual(secondMarks);\n });\n\n it('clears future on new action', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n const thirdMarks = [{ id: 3, type: 'circle' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.future.length).toBeGreaterThan(0);\n\n state = rootReducer(state, changeMarks(thirdMarks));\n expect(state.marks.future).toEqual([]);\n });\n\n it('handles empty marks array', () => {\n const rootReducer = reducer();\n const action = changeMarks([]);\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, action);\n\n expect(state.marks.present).toEqual([]);\n });\n\n it('handles multiple marks', () => {\n const rootReducer = reducer();\n const marks = [\n { id: 1, type: 'point', x: 1, y: 2 },\n { id: 2, type: 'line', from: { x: 0, y: 0 }, to: { x: 5, y: 5 } },\n { id: 3, type: 'circle', center: { x: 3, y: 3 }, radius: 2 },\n ];\n const action = changeMarks(marks);\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, action);\n\n expect(state.marks.present).toEqual(marks);\n expect(state.marks.present.length).toBe(3);\n });\n });\n\n describe('undo functionality', () => {\n it('supports undo action', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(firstMarks);\n });\n\n it('moves present to future on undo', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.future.length).toBeGreaterThan(0);\n });\n\n it('handles multiple undos', () => {\n const rootReducer = reducer();\n const marks1 = [{ id: 1 }];\n const marks2 = [{ id: 2 }];\n const marks3 = [{ id: 3 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks1));\n state = rootReducer(state, changeMarks(marks2));\n state = rootReducer(state, changeMarks(marks3));\n\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(marks1);\n });\n\n it('does not undo beyond initial state', () => {\n const rootReducer = reducer();\n const marks = [{ id: 1, type: 'point' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks));\n\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual([]);\n expect(state.marks.past).toEqual([]);\n });\n });\n\n describe('redo functionality', () => {\n it('supports redo action', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n // Redo\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.present).toEqual(secondMarks);\n });\n\n it('moves future to past on redo', () => {\n const rootReducer = reducer();\n const firstMarks = [{ id: 1, type: 'point' }];\n const secondMarks = [{ id: 2, type: 'line' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(firstMarks));\n state = rootReducer(state, changeMarks(secondMarks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n const futureBeforeRedo = state.marks.future.length;\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.future.length).toBe(futureBeforeRedo - 1);\n });\n\n it('handles multiple redos', () => {\n const rootReducer = reducer();\n const marks1 = [{ id: 1 }];\n const marks2 = [{ id: 2 }];\n const marks3 = [{ id: 3 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks1));\n state = rootReducer(state, changeMarks(marks2));\n state = rootReducer(state, changeMarks(marks3));\n\n // undo twice, then redo twice\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.present).toEqual(marks3);\n });\n\n it('does not redo beyond last state', () => {\n const rootReducer = reducer();\n const marks = [{ id: 1, type: 'point' }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n // try to redo beyond the end\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n state = rootReducer(state, { type: '@@redux-undo/REDO' });\n\n expect(state.marks.present).toEqual(marks);\n expect(state.marks.future).toEqual([]);\n });\n });\n\n describe('state structure', () => {\n it('maintains correct undoable structure', () => {\n const rootReducer = reducer();\n const state = rootReducer(undefined, { type: 'INIT' });\n\n expect(state.marks).toHaveProperty('past');\n expect(state.marks).toHaveProperty('present');\n expect(state.marks).toHaveProperty('future');\n expect(Array.isArray(state.marks.past)).toBe(true);\n expect(Array.isArray(state.marks.future)).toBe(true);\n });\n\n it('preserves mark properties through undo/redo', () => {\n const rootReducer = reducer();\n const marks = [\n {\n id: 1,\n type: 'point',\n x: 10,\n y: 20,\n label: 'A',\n correctness: { value: 'correct' },\n },\n ];\n\n let state = rootReducer(undefined, { type: 'INIT' });\n state = rootReducer(state, changeMarks(marks));\n state = rootReducer(state, changeMarks([]));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(marks);\n expect(state.marks.present[0]).toBeDefined();\n if (state.marks.present[0]) {\n expect(state.marks.present[0]).toEqual(marks[0]);\n expect(state.marks.present[0].correctness).toBeDefined();\n }\n });\n });\n\n describe('integration', () => {\n it('handles complex undo/redo sequences', () => {\n const rootReducer = reducer();\n const marks1 = [{ id: 1 }];\n const marks2 = [{ id: 2 }];\n const marks3 = [{ id: 3 }];\n const marks4 = [{ id: 4 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks(marks1));\n state = rootReducer(state, changeMarks(marks2));\n state = rootReducer(state, changeMarks(marks3));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' }); // back to marks2\n state = rootReducer(state, { type: '@@redux-undo/UNDO' }); // back to marks1\n state = rootReducer(state, { type: '@@redux-undo/REDO' }); // forward to marks2\n state = rootReducer(state, changeMarks(marks4));\n\n expect(state.marks.present).toEqual(marks4);\n expect(state.marks.future).toEqual([]);\n });\n\n it('works with empty state transitions', () => {\n const rootReducer = reducer();\n const marks = [{ id: 1 }];\n\n let state = rootReducer(undefined, { type: '@@INIT' });\n state = rootReducer(state, changeMarks([]));\n state = rootReducer(state, changeMarks(marks));\n state = rootReducer(state, changeMarks([]));\n state = rootReducer(state, { type: '@@redux-undo/UNDO' });\n\n expect(state.marks.present).toEqual(marks);\n });\n });\n});\n"],"mappings":";;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEAE,QAAQ,CAAC,mBAAmB,EAAE,YAAM;EAClCA,QAAQ,CAAC,kBAAkB,EAAE,YAAM;IACjCC,EAAE,CAAC,4BAA4B,EAAE,YAAM;MACrC,IAAMC,WAAW,GAAG,IAAAC,mBAAO,EAAC,CAAC;MAC7BC,MAAM,KAAAC,QAAA,aAAQH,WAAW,EAAC,CAACI,IAAI,CAAC,UAAU,CAAC;IAC7C,CAAC,CAAC;IAEFL,EAAE,CAAC,uCAAuC,EAAE,YAAM;MAChD,IAAMC,WAAW,GAAG,IAAAC,mBAAO,EAAC,CAAC;MAC7B,IAAMI,KAAK,GAAGL,WAAW,CAACM,SAAS,EAAE;QAAEC,IAAI,EAAE;MAAO,CAAC,CAAC;MACtDL,MAAM,CAACG,KAAK,CAAC,CAACG,cAAc,CAAC,OAAO,CAAC;IACvC,CAAC,CAAC;IAEFT,EAAE,CAAC,mCAAmC,EAAE,YAAM;MAC5C,IAAMC,W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C;IAC5C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/lib/container/actions.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.changeMarks = exports.addMark = void 0;
|
|
7
|
-
var addMark = exports.addMark = function addMark() {
|
|
8
|
-
return {
|
|
9
|
-
type: 'ADD_MARK'
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
var changeMarks = exports.changeMarks = function changeMarks(marks) {
|
|
13
|
-
return {
|
|
14
|
-
type: 'CHANGE_MARKS',
|
|
15
|
-
marks: marks
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","names":["addMark","exports","type","changeMarks","marks"],"sources":["../../src/container/actions.js"],"sourcesContent":["export const addMark = () => ({\n type: 'ADD_MARK',\n});\n\nexport const changeMarks = (marks) => ({\n type: 'CHANGE_MARKS',\n marks,\n});\n"],"mappings":";;;;;;AAAO,IAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAAA;EAAA,OAAU;IAC5BE,IAAI,EAAE;EACR,CAAC;AAAA,CAAC;AAEK,IAAMC,WAAW,GAAAF,OAAA,CAAAE,WAAA,GAAG,SAAdA,WAAWA,CAAIC,KAAK;EAAA,OAAM;IACrCF,IAAI,EAAE,cAAc;IACpBE,KAAK,EAALA;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
|
package/lib/container/index.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.GraphContainer = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _reactRedux = require("react-redux");
|
|
17
|
-
var _react = _interopRequireDefault(require("react"));
|
|
18
|
-
var _redux = require("redux");
|
|
19
|
-
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
20
|
-
var _actions = require("./actions");
|
|
21
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
-
var _lodashEs = require("lodash-es");
|
|
23
|
-
var _reduxUndo = require("redux-undo");
|
|
24
|
-
var _graphWithControls = _interopRequireDefault(require("../graph-with-controls"));
|
|
25
|
-
var _middleware = require("./middleware");
|
|
26
|
-
var _excluded = ["onChangeMarks", "marks"];
|
|
27
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
29
|
-
var mapStateToProps = function mapStateToProps(s) {
|
|
30
|
-
return {
|
|
31
|
-
marks: s.marks.present
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
35
|
-
return {
|
|
36
|
-
onChangeMarks: function onChangeMarks(m) {
|
|
37
|
-
return dispatch((0, _actions.changeMarks)(m));
|
|
38
|
-
},
|
|
39
|
-
onUndo: function onUndo() {
|
|
40
|
-
return dispatch(_reduxUndo.ActionCreators.undo());
|
|
41
|
-
},
|
|
42
|
-
onRedo: function onRedo() {
|
|
43
|
-
return dispatch(_reduxUndo.ActionCreators.redo());
|
|
44
|
-
},
|
|
45
|
-
onReset: function onReset() {
|
|
46
|
-
return dispatch((0, _actions.changeMarks)([]));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
var GraphContainer = exports.GraphContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_graphWithControls["default"]);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The graph component entry point with undo/redo
|
|
54
|
-
* Redux is an implementation detail, hide it in the react component.
|
|
55
|
-
*/
|
|
56
|
-
var Root = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
function Root(props) {
|
|
58
|
-
var _this;
|
|
59
|
-
(0, _classCallCheck2["default"])(this, Root);
|
|
60
|
-
_this = _callSuper(this, Root, [props]);
|
|
61
|
-
(0, _defineProperty2["default"])(_this, "onStoreChange", function () {
|
|
62
|
-
var _this$props = _this.props,
|
|
63
|
-
marks = _this$props.marks,
|
|
64
|
-
onChangeMarks = _this$props.onChangeMarks;
|
|
65
|
-
var storeState = _this.store.getState();
|
|
66
|
-
var lastAction = (0, _middleware.getLastAction)();
|
|
67
|
-
var isUndoOperation = lastAction.type.includes('UNDO') || lastAction.type.includes('REDO');
|
|
68
|
-
if (!(0, _lodashEs.isEqual)(storeState.marks.present, marks)) {
|
|
69
|
-
onChangeMarks(storeState.marks.present, isUndoOperation);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
var r = (0, _reducer["default"])();
|
|
73
|
-
_this.store = (0, _redux.createStore)(r, {
|
|
74
|
-
marks: props.marks
|
|
75
|
-
}, (0, _redux.applyMiddleware)(_middleware.lastActionMiddleware));
|
|
76
|
-
_this.store.subscribe(_this.onStoreChange);
|
|
77
|
-
return _this;
|
|
78
|
-
}
|
|
79
|
-
(0, _inherits2["default"])(Root, _React$Component);
|
|
80
|
-
return (0, _createClass2["default"])(Root, [{
|
|
81
|
-
key: "componentDidUpdate",
|
|
82
|
-
value: function componentDidUpdate(prevProps) {
|
|
83
|
-
var marks = this.props.marks;
|
|
84
|
-
var storeState = this.store.getState();
|
|
85
|
-
if ((0, _lodashEs.isEqual)(storeState.marks.present, marks)) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (!(0, _lodashEs.isEqual)(prevProps.marks, marks)) {
|
|
89
|
-
// Don't dispatch marks that have correctness (evaluate mode marks) into the undo history.
|
|
90
|
-
// These marks are already handled in render() via the correctnessSet path and bypass the
|
|
91
|
-
// Redux store entirely. Dispatching them would pollute the undo history and cause the graph
|
|
92
|
-
// to show the correct answer when the user presses undo after returning to gather mode.
|
|
93
|
-
var hasCorrectness = marks && marks.find(function (m) {
|
|
94
|
-
return m.correctness;
|
|
95
|
-
});
|
|
96
|
-
if (!hasCorrectness) {
|
|
97
|
-
this.store.dispatch((0, _actions.changeMarks)(marks));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
key: "render",
|
|
103
|
-
value: function render() {
|
|
104
|
-
// eslint-disable-next-line no-unused-vars
|
|
105
|
-
var _this$props2 = this.props,
|
|
106
|
-
onChangeMarks = _this$props2.onChangeMarks,
|
|
107
|
-
marks = _this$props2.marks,
|
|
108
|
-
rest = (0, _objectWithoutProperties2["default"])(_this$props2, _excluded);
|
|
109
|
-
var correctnessSet = marks && marks.find(function (m) {
|
|
110
|
-
return m.correctness;
|
|
111
|
-
});
|
|
112
|
-
if (correctnessSet) {
|
|
113
|
-
return /*#__PURE__*/_react["default"].createElement(_graphWithControls["default"], (0, _extends2["default"])({}, rest, {
|
|
114
|
-
marks: marks,
|
|
115
|
-
disabled: correctnessSet
|
|
116
|
-
}));
|
|
117
|
-
}
|
|
118
|
-
return /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
119
|
-
store: this.store
|
|
120
|
-
}, /*#__PURE__*/_react["default"].createElement(GraphContainer, rest));
|
|
121
|
-
}
|
|
122
|
-
}]);
|
|
123
|
-
}(_react["default"].Component);
|
|
124
|
-
(0, _defineProperty2["default"])(Root, "propTypes", {
|
|
125
|
-
onChangeMarks: _propTypes["default"].func,
|
|
126
|
-
marks: _propTypes["default"].array
|
|
127
|
-
});
|
|
128
|
-
var _default = exports["default"] = Root;
|
|
129
|
-
//# sourceMappingURL=index.js.map
|