Skip to content

Commit

Permalink
Merge pull request #228 from MO-Movia/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Tezra authored Dec 25, 2024
2 parents 5748c7e + 4e14985 commit d1e8690
Show file tree
Hide file tree
Showing 33 changed files with 3,713 additions and 8,823 deletions.
3 changes: 2 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin
/dist
/dist
/coverage
6,448 changes: 2,445 additions & 4,003 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 11 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@modusoperandi/licit-info-icon",
"version": "1.0.3",
"version": "1.0.5",
"type": "module",
"description": "MO's Info Icon ProseMirror Plugin",
"main": "dist/index.js",
Expand All @@ -21,40 +21,35 @@
"prosemirror-utils": "^1.0.0"
},
"devDependencies": {
"@cfaester/enzyme-adapter-react-18": "^0.7.0",
"@cyclonedx/cyclonedx-npm": "^1.7.1",
"@testing-library/jest-dom": "^6.4.1",
"@testing-library/react": "^13.4.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.0.2",
"@types/node": "^20.11.17",
"@types/node": "^22.0.0",
"@types/orderedmap": "^2.0.0",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"copyfiles": "^2.4.1",
"enzyme": "^3.11.0",
"eslint": "^8.56.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.24.0",
"husky": "^9.0.10",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^14.0.1",
"jest-junit": "^16.0.0",
"jest-mock-extended": "^3.0.4",
"jest-prosemirror": "^2.1.5",
"jest-sonar-reporter": "^2.0.0",
"lint-staged": "^15.2.1",
"prettier": "^3.0.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-prettier": "^5.0.0",
"ts-jest": "^29.0.7",
"ts-node": "^10.4.0",
"typescript": "^5.3.3"
"typescript": "5.3.3"
},
"scripts": {
"clean": "rm -rf dist/ && rm -f modusoperandi-licit-info-icon-*.*.*.tgz",
Expand All @@ -65,31 +60,16 @@
"lint:css": "stylelint \"**/*.css\"",
"test:unit": "jest --collectCoverage=false",
"test:coverage": "jest --coverage",
"test": "jest --coverage"
"test": "jest --coverage",
"verify": "npm run lint -- --fix && npm run ci:build && npm run test:coverage && echo 'All Tests Passed!'"
},
"overrides": {
"semver": "^7.5.2"
"libxmljs2": "^1.0.0"
},
"importSort": {
".js": {
"parser": "babylon",
"style": "module-grouping"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.css": [
"stylelint --fix"
],
"!(*test|*.setup).ts": [
"eslint --fix"
],
"*.json": [
"prettier --write"
]
}
}
10 changes: 2 additions & 8 deletions src/InfoIconSubMenu.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import Enzyme, { shallow } from 'enzyme';
import Adapter from '@cfaester/enzyme-adapter-react-18';
import { InfoIconSubMenu } from './InfoIconSubMenu';
import React from 'react';
import {EditorView} from 'prosemirror-view';

Enzyme.configure({ adapter: new Adapter() });
function myVoidFunction(): void {
// Function body
// This function doesn't return any value
Expand All @@ -13,13 +9,11 @@ describe('InfoIconSubMenu', () => {
it('should render the InfoIconSubMenu component', () => {
const subMenuProps = {
editorView: {} as unknown as EditorView,
onCancel: myVoidFunction,
onEdit: myVoidFunction,
onRemove: myVoidFunction,
onMouseOut: myVoidFunction
};
const wrapper = shallow(<InfoIconSubMenu {...subMenuProps} />);
const infoIconSubMenu = wrapper.instance();
expect(infoIconSubMenu).toBeDefined();
const wrapper = new InfoIconSubMenu ({...subMenuProps});
expect(wrapper).toBeDefined();
});
});
6 changes: 1 addition & 5 deletions src/InfoIconSubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import * as React from 'react';
import {EditorView} from 'prosemirror-view';
import {InfoToolButton} from './ui/InfoToolButton';
import {InfoSubMenuIcon} from './ui/InfoSubMenuIcon';
import './ui/infoicon-note.css';

type CustomButtonProps = {
editorView: EditorView;
onCancel: (view: EditorView) => void;
onEdit: (view: EditorView) => void;
onRemove: (view: EditorView) => void;
onMouseOut: () => void;
Expand All @@ -15,8 +13,6 @@ type CustomButtonProps = {
export class InfoIconSubMenu extends React.PureComponent {
declare props: CustomButtonProps;

_unmounted = false;

state = {
hidden: false,
};
Expand All @@ -26,7 +22,7 @@ export class InfoIconSubMenu extends React.PureComponent {
const disabled = editorView['readOnly'];

return (
<div className="molcit-infoicon-submenu" onMouseLeave={onMouseOut}>
<div className="molcit-infoicon-submenu" onMouseLeave={onMouseOut} role='menu' tabIndex={0}>
<div className="molcit-infoicon-submenu-body">
<div className="molcit-infoicon-submenu-row">
<InfoToolButton
Expand Down
Loading

0 comments on commit d1e8690

Please sign in to comment.