Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {

// Transform ES modules from these packages
transformIgnorePatterns: [
'node_modules/(?!(@mui|@emotion|@testing-library|@dnd-kit|@hello-pangea|@tiptap|konva|react-konva)/)',
'node_modules/(?!(@mui|@emotion|@testing-library|@dnd-kit|@hello-pangea|@tiptap|konva|react-konva|d3-.*|internmap|@mapbox/point-geometry)(/|$))',
],

// Custom resolver to handle node: protocol imports
Expand Down
27 changes: 19 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,49 @@
"packages/*/controller",
"packages/*/print"
],
"dependencies": {
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@rollup/plugin-commonjs": "^20.0.0",
"core-js": "^3.40.0",
"express": "^4.17.1",
"rollup-plugin-analyzer": "^4.0.0"
},
"resolutions": {
"jest": "29.7.0",
"jest-config": "29.7.0",
"core-js": "^3.40.0",
"d3-scale": "4.0.2",
"d3-selection": "3.0.0",
"@jest/test-sequencer": "29.7.0",
"@types/d3-array": "3.0.3",
"@pie-lib/categorize": "1.1.0-next.4",
"@pie-lib/charting": "6.1.0-next.5",
"@pie-lib/categorize": "1.1.0-next.9",
"@pie-lib/charting": "6.1.0-next.25",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/controller-utils": "1.1.0-next.4",
"@pie-lib/correct-answer-toggle": "3.1.0-next.5",
"@pie-lib/drag": "3.1.0-next.5",
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
"@pie-lib/feedback": "1.1.0-next.4",
"@pie-lib/graphing-solution-set": "3.1.0-next.5",
"@pie-lib/graphing-solution-set": "3.1.0-next.25",
"@pie-lib/graphing-utils": "2.1.0-next.4",
"@pie-lib/graphing": "3.1.0-next.5",
"@pie-lib/graphing": "3.1.0-next.25",
"@pie-lib/icons": "3.1.0-next.4",
"@pie-lib/mask-markup": "2.1.0-next.5",
"@pie-lib/math-evaluator": "3.1.0-next.4",
"@pie-lib/math-input": "7.1.0-next.4",
"@pie-lib/math-rendering-accessible": "4.1.0-next.4",
"@pie-lib/math-rendering-accessible/@pie-lib/math-rendering": "4.1.0-next.4",
"@pie-lib/math-rendering": "4.1.0-next.4",
"@pie-lib/math-toolbar": "2.1.0-next.5",
"@pie-lib/plot": "3.1.0-next.5",
"@pie-lib/plot": "3.1.0-next.25",
"@pie-lib/render-ui": "5.1.0-next.5",
"@pie-lib/rubric": "1.1.0-next.5",
"@pie-lib/scoring-config": "4.1.0-next.4",
"@pie-lib/style-utils": "1.1.0-next.4",
"@pie-lib/test-utils": "1.1.0-next.4",
"@pie-lib/text-select": "2.1.0-next.5",
"@pie-lib/tools": "1.1.0-next.4",
"@pie-lib/translator": "3.1.0-next.4",
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
"@pie-lib/editable-html": "12.1.0-next.5"
"@pie-lib/translator": "3.1.0-next.4"
}
}
2 changes: 1 addition & 1 deletion packages/categorize/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@mui/icons-material": "^7.3.4",
"@mui/material": "^7.3.4",
"@pie-framework/pie-configure-events": "^1.3.0",
"@pie-lib/categorize": "1.1.0-next.4",
"@pie-lib/categorize": "1.1.0-next.9",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/drag": "3.1.0-next.5",
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@pie-element/categorize-controller",
"private": true,
"dependencies": {
"@pie-lib/categorize": "1.1.0-next.4",
"@pie-lib/categorize": "1.1.0-next.9",
"@pie-lib/controller-utils": "1.1.0-next.4",
"@pie-lib/feedback": "1.1.0-next.4",
"@pie-lib/translator": "3.1.0-next.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@mui/icons-material": "^7.3.4",
"@mui/material": "^7.3.4",
"@pie-framework/pie-player-events": "^0.1.0",
"@pie-lib/categorize": "1.1.0-next.4",
"@pie-lib/categorize": "1.1.0-next.9",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/correct-answer-toggle": "3.1.0-next.5",
"@pie-lib/drag": "3.1.0-next.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/charting/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@mui/icons-material": "^7.3.4",
"@mui/material": "^7.3.4",
"@pie-framework/pie-configure-events": "^1.3.0",
"@pie-lib/charting": "6.1.0-next.5",
"@pie-lib/charting": "6.1.0-next.25",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
"@pie-lib/math-rendering": "4.1.0-next.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/charting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@mui/icons-material": "^7.3.4",
"@mui/material": "^7.3.4",
"@pie-framework/pie-player-events": "^0.1.0",
"@pie-lib/charting": "6.1.0-next.5",
"@pie-lib/charting": "6.1.0-next.25",
"@pie-lib/correct-answer-toggle": "3.1.0-next.5",
"@pie-lib/math-rendering": "4.1.0-next.4",
"@pie-lib/render-ui": "5.1.0-next.5",
Expand Down
10 changes: 9 additions & 1 deletion packages/complex-rubric/configure/src/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@ jest.mock('@pie-lib/config-ui', () => ({

jest.mock('@pie-lib/render-ui', () => ({
color: {
tertiary: jest.fn(() => '#146EB3'),
text: jest.fn(() => '#000000'),
background: jest.fn(() => '#ffffff'),
primaryLight: jest.fn(() => '#e3f2fd'),
primary: jest.fn(() => '#1976d2'),
secondary: jest.fn(() => '#888'),
tertiary: jest.fn(() => '#146EB3'),
disabled: jest.fn(() => '#999999'),
correct: jest.fn(() => '#00c853'),
incorrect: jest.fn(() => '#d32f2f'),
},
Collapsible: (props) => <div data-testid="collapsible">{props.children}</div>,
Readable: (props) => <div data-testid="readable">{props.children}</div>,
Feedback: (props) => <div data-testid="feedback">{props.children}</div>,
PreviewPrompt: (props) => <div data-testid="preview-prompt">{props.children}</div>,
UiLayout: (props) => <div data-testid="ui-layout">{props.children}</div>,
hasText: jest.fn(),
hasMedia: jest.fn(),
}));

jest.mock('@pie-element/rubric/configure/lib', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/graphing-solution-set/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"@pie-framework/pie-configure-events": "^1.3.0",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
"@pie-lib/graphing-solution-set": "3.1.0-next.5",
"@pie-lib/graphing-solution-set": "3.1.0-next.25",
"@pie-lib/math-rendering": "4.1.0-next.4",
"classnames": "^2.2.5",
"core-js": "^3.40.0",
"debug": "^4.1.1",
"prop-types": "^15.6.2",
"react": "18.2.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/graphing-solution-set/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
"@pie-framework/pie-player-events": "^0.1.0",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/correct-answer-toggle": "3.1.0-next.5",
"@pie-lib/graphing-solution-set": "3.1.0-next.5",
"@pie-lib/graphing-solution-set": "3.1.0-next.25",
"@pie-lib/math-rendering": "4.1.0-next.4",
"@pie-lib/render-ui": "5.1.0-next.5",
"classnames": "^2.2.5",
"core-js": "^3.40.0",
"debug": "^4.1.1",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/graphing/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"@pie-framework/pie-configure-events": "^1.3.0",
"@pie-lib/config-ui": "12.1.0-next.5",
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
"@pie-lib/graphing": "3.1.0-next.5",
"@pie-lib/graphing": "3.1.0-next.25",
"@pie-lib/math-rendering": "4.1.0-next.4",
"classnames": "^2.2.5",
"core-js": "^3.40.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"prop-types": "^15.6.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/graphing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
"@mui/material": "^7.3.4",
"@pie-framework/pie-player-events": "^0.1.0",
"@pie-lib/correct-answer-toggle": "3.1.0-next.5",
"@pie-lib/graphing": "3.1.0-next.5",
"@pie-lib/graphing": "3.1.0-next.25",
"@pie-lib/math-rendering": "4.1.0-next.4",
"@pie-lib/render-ui": "5.1.0-next.5",
"classnames": "^2.2.5",
"core-js": "^3.40.0",
"debug": "^4.1.1",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/number-line/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@pie-lib/render-ui": "5.1.0-next.5",
"@pie-lib/translator": "3.1.0-next.4",
"classnames": "^2.2.5",
"d3-scale": "^3.2.1",
"d3-selection": "^1.4.1",
"d3-scale": "^4.0.2",
"d3-selection": "^3.0.0",
"lodash": "^4.17.10",
"mathjs": "^7.5.1",
"prop-types": "^15.6.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/number-line/src/number-line/graph/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { scaleLinear } from 'd3-scale';
import { select, mouse } from 'd3-selection';
import { select, pointer } from 'd3-selection';
import { color } from '@pie-lib/render-ui';
import { DndContext } from '@dnd-kit/core';
import Point from './elements/point';
Expand Down Expand Up @@ -93,10 +93,10 @@ export class NumberLineGraph extends React.Component {
}

/**
* Note: we use d3 click + mouse to give us domain values directly.
* Note: we use d3 click + pointer to give us domain values directly.
* Saves us having to calculate them ourselves from a MouseEvent.
*/
onRectClick(rect) {
onRectClick(event) {
const { elements, disabled } = this.props;

if (disabled) {
Expand All @@ -108,15 +108,15 @@ export class NumberLineGraph extends React.Component {
if (anyElementSelected) {
this.props.onDeselectElements();
} else {
var coords = mouse(rect._groups[0][0]);
const coords = pointer(event, this.rect);
const x = this.xScaleFn().invert(coords[0]);
this.addElement(x);
}
}

componentDidMount() {
const rect = select(this.rect);
rect.on('click', this.onRectClick.bind(this, rect));
rect.on('click', this.onRectClick.bind(this));
}

addElement(x) {
Expand Down
Loading