Skip to content

Commit ffb632d

Browse files
committed
Merge branch 'datatable/theme' of https://github.com/sudhanshutech/sistent into datatable/theme
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
2 parents 78f8857 + 253f2c6 commit ffb632d

File tree

8 files changed

+23277
-13515
lines changed

8 files changed

+23277
-13515
lines changed

package-lock.json

Lines changed: 22880 additions & 13415 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 100 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,108 @@
11
{
2-
"name": "@layer5/sistent",
3-
"version": "0.14.11",
4-
"description": "Reusable React Components and SVG Icons library",
5-
"repository": {
6-
"type": "git",
7-
"url": "git+ssh://[email protected]/layer5io/sistent.git"
8-
},
9-
"main": "./dist/index.js",
10-
"module": "./dist/index..js",
11-
"types": "./dist/index.d.ts",
12-
"files": [
13-
"dist"
14-
],
15-
"scripts": {
16-
"build": "NODE_ENV=production tsup",
17-
"build:watch": "NODE_ENV=production tsup --watch",
18-
"commitlint": "commitlint --edit",
19-
"coverage": "jest --coverage",
20-
"dev": "NODE_ENV=development tsup",
21-
"format:check": "prettier --check \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
22-
"format:write": "prettier --write \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
23-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
24-
"lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
25-
"prepare": "husky install",
26-
"test": "jest",
27-
"versionup:major": "npm version major",
28-
"versionup:minor": "npm version minor",
29-
"versionup:patch": "npm version patch"
30-
},
31-
"lint-staged": {
32-
"*.{ts,tsx,md}": [
33-
"prettier --write",
34-
"eslint --fix"
35-
]
2+
"name": "@layer5/sistent",
3+
"version": "0.14.11",
4+
"description": "Reusable React Components and SVG Icons library",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+ssh://[email protected]/layer5io/sistent.git"
8+
},
9+
"main": "./dist/index.js",
10+
"module": "./dist/index..js",
11+
"types": "./dist/index.d.ts",
12+
"files": [
13+
"dist"
14+
],
15+
"scripts": {
16+
"build": "NODE_ENV=production tsup",
17+
"build:watch": "NODE_ENV=production tsup --watch",
18+
"commitlint": "commitlint --edit",
19+
"coverage": "jest --coverage",
20+
"dev": "NODE_ENV=development tsup",
21+
"format:check": "prettier --check \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
22+
"format:write": "prettier --write \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
23+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
24+
"lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
25+
"prepare": "husky install",
26+
"test": "jest",
27+
"versionup:major": "npm version major",
28+
"versionup:minor": "npm version minor",
29+
"versionup:patch": "npm version patch"
30+
},
31+
"lint-staged": {
32+
"*.{ts,tsx,md}": [
33+
"prettier --write",
34+
"eslint --fix"
35+
]
36+
},
37+
"config": {
38+
"commitizen": {
39+
"path": "./node_modules/cz-conventional-changelog"
40+
}
41+
},
42+
"devDependencies": {
43+
"@commitlint/cli": "^17.7.2",
44+
"@commitlint/config-conventional": "^17.7.0",
45+
"@mui/icons-material": "^5.15.11",
46+
"@testing-library/react": "^14.1.2",
47+
"@types/jest": "^29.5.11",
48+
"@types/react": "^18.2.45",
49+
"@types/react-dom": "^18.2.18",
50+
"@typescript-eslint/eslint-plugin": "^6.12.0",
51+
"@typescript-eslint/parser": "^6.12.0",
52+
"commitizen": "^4.3.0",
53+
"cz-conventional-changelog": "^3.3.0",
54+
"eslint": "^8.49.0",
55+
"eslint-plugin-react": "^7.33.2",
56+
"eslint-plugin-react-hooks": "^4.6.0",
57+
"eslint-plugin-react-refresh": "^0.4.4",
58+
"eslint-plugin-storybook": "^0.6.15",
59+
"husky": "^8.0.0",
60+
"jest": "^29.7.0",
61+
"jest-environment-jsdom": "^29.7.0",
62+
"lint-staged": "^14.0.1",
63+
"mui-datatables": "^4.3.0",
64+
"notistack": "^3.0.1",
65+
"prettier": "^3.0.3",
66+
"prettier-plugin-organize-imports": "^3.2.3",
67+
"react-error-boundary": "^4.0.12",
68+
"react-markdown": "^8.0.7",
69+
"remark-gfm": "^3.0.1",
70+
"ts-jest": "^29.1.1",
71+
"tsup": "^8.0.1",
72+
"typescript": "^5.3.3"
73+
},
74+
"peerDependencies": {
75+
"@emotion/react": "^11.11.3",
76+
"@emotion/styled": "^11.11.0",
77+
"@mui/material": "^5.15.11",
78+
"@types/mui-datatables": "*",
79+
"mui-datatables": "*",
80+
"react": ">=17",
81+
"react-dom": ">=17",
82+
"@xstate/react": "^4.1.1",
83+
"xstate": "^5.13.0"
84+
},
85+
"peerDependenciesMeta": {
86+
"@emotion/react": {
87+
"optional": true
3688
},
37-
"config": {
38-
"commitizen": {
39-
"path": "./node_modules/cz-conventional-changelog"
40-
}
89+
"@emotion/styled": {
90+
"optional": true
4191
},
42-
"devDependencies": {
43-
"@commitlint/cli": "^17.7.2",
44-
"@commitlint/config-conventional": "^17.7.0",
45-
"@mui/icons-material": "^5.15.11",
46-
"@testing-library/react": "^14.1.2",
47-
"@types/jest": "^29.5.11",
48-
"@types/react": "^18.2.45",
49-
"@types/react-dom": "^18.2.18",
50-
"@typescript-eslint/eslint-plugin": "^6.12.0",
51-
"@typescript-eslint/parser": "^6.12.0",
52-
"commitizen": "^4.3.0",
53-
"cz-conventional-changelog": "^3.3.0",
54-
"eslint": "^8.49.0",
55-
"eslint-plugin-react": "^7.33.2",
56-
"eslint-plugin-react-hooks": "^4.6.0",
57-
"eslint-plugin-react-refresh": "^0.4.4",
58-
"eslint-plugin-storybook": "^0.6.15",
59-
"husky": "^8.0.0",
60-
"jest": "^29.7.0",
61-
"jest-environment-jsdom": "^29.7.0",
62-
"lint-staged": "^14.0.1",
63-
"mui-datatables": "^4.3.0",
64-
"notistack": "^3.0.1",
65-
"prettier": "^3.0.3",
66-
"prettier-plugin-organize-imports": "^3.2.3",
67-
"react-error-boundary": "^4.0.12",
68-
"react-markdown": "^8.0.7",
69-
"remark-gfm": "^3.0.1",
70-
"ts-jest": "^29.1.1",
71-
"tsup": "^8.0.1",
72-
"typescript": "^5.3.3"
92+
"@mui/material": {
93+
"optional": true
7394
},
74-
"peerDependencies": {
75-
"@emotion/react": "^11.11.3",
76-
"@emotion/styled": "^11.11.0",
77-
"@mui/material": "^5.15.11",
78-
"@types/mui-datatables": "*",
79-
"mui-datatables": "*",
80-
"react": ">=17",
81-
"react-dom": ">=17"
95+
"mui-datatables": {
96+
"optional": true
8297
},
83-
"peerDependenciesMeta": {
84-
"@emotion/react": {
85-
"optional": true
86-
},
87-
"@emotion/styled": {
88-
"optional": true
89-
},
90-
"@mui/material": {
91-
"optional": true
92-
},
93-
"mui-datatables": {
94-
"optional": true
95-
},
96-
"react": {
97-
"optional": true
98-
},
99-
"react-dom": {
100-
"optional": true
101-
}
98+
"react": {
99+
"optional": true
102100
},
103-
"publishConfig": {
104-
"access": "public"
101+
"react-dom": {
102+
"optional": true
105103
}
104+
},
105+
"publishConfig": {
106+
"access": "public"
107+
}
106108
}

src/actors/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export {
2+
DATA_VALIDATOR_COMMANDS,
3+
DATA_VALIDATOR_EVENTS,
4+
dataValidatorCommands,
5+
dataValidatorEvents,
6+
dataValidatorMachine,
7+
selectIsValidating,
8+
selectValidationResults
9+
} from './validators/dataValidator';
10+
11+
export {
12+
XSTATE_DEBUG_EVENT,
13+
deadLetter,
14+
forwardToActors,
15+
reply,
16+
sendToActor,
17+
sendToActors
18+
} from './utils';

src/actors/utils.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// disbale stict no any for now for full file
2+
/* eslint-disable @typescript-eslint/no-explicit-any */
3+
4+
import { AnyActorRef, AnyEventObject, enqueueActions, sendTo } from 'xstate';
5+
import { AnyActorSystem } from 'xstate/dist/declarations/src/system';
6+
7+
type ContextWithReturnAddress = { returnAddress: AnyActorRef };
8+
9+
export const sendToActor = (actor: string, event: AnyEventObject) =>
10+
sendTo(({ system }: { system: AnyActorSystem }) => {
11+
console.log('sendToActor', actor, event);
12+
return system.get(actor);
13+
}, event);
14+
15+
export const sendToActors = (
16+
actorSystemIds: string[],
17+
eventCreator: (actionArgs: any, params: any) => AnyEventObject
18+
) =>
19+
enqueueActions(({ enqueue, ...actionArgs }, params) => {
20+
actorSystemIds.forEach((actorSystemId) => {
21+
const actor = actionArgs.system.get(actorSystemId);
22+
if (!actor) {
23+
console.log('actor not found --sendToActors', actorSystemId);
24+
return;
25+
}
26+
enqueue.sendTo(actor, eventCreator(actionArgs, params));
27+
});
28+
});
29+
30+
export const forwardToActors = (actorSystemIds: string[]) =>
31+
enqueueActions(({ enqueue, event, system }) => {
32+
actorSystemIds.forEach((actorSystemId) => {
33+
const actor = system.get(actorSystemId);
34+
if (actor) {
35+
enqueue.sendTo(actor, event);
36+
}
37+
});
38+
});
39+
40+
export const deadLetter = (event: AnyEventObject) => ({ type: 'DEAD_LETTER', event });
41+
42+
export const reply = (eventFn: (actionArgs: any, params: any) => AnyEventObject) =>
43+
sendTo(({ context }: { context: ContextWithReturnAddress }) => context.returnAddress, eventFn);
44+
45+
export const XSTATE_DEBUG_EVENT = 'XSTATE_DEBUG_EVENT';

0 commit comments

Comments
 (0)