Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] V10 #968

Merged
merged 74 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
94a36ff
9.1.3
fkhadra May 14, 2023
01aec2d
move playground to vite
fkhadra May 28, 2023
c05b833
setup component testing
fkhadra May 28, 2023
4baf4d4
import stylesheet in test
fkhadra May 28, 2023
3bbd87b
WIP rewrite tests
fkhadra May 29, 2023
4c7eb9b
ignore cypress video
fkhadra Jun 1, 2023
916d60d
Add toast tests
fkhadra Jun 1, 2023
f938ee8
rewrite toast tests
fkhadra Jun 4, 2023
b6c7c5b
remove default props
fkhadra Jun 10, 2023
dfe2250
export default props
fkhadra Jun 11, 2023
6c6a968
[WIP] rewrite toast tests
fkhadra Jun 11, 2023
b42e1a4
drop synthetic event to start timer
fkhadra Jun 12, 2023
a068110
formatting
fkhadra Jun 12, 2023
e9b09c4
remove unused import
fkhadra Jun 12, 2023
0a597a6
WIP
fkhadra Jun 16, 2023
b5e46f6
core fully tested
fkhadra Jun 17, 2023
c79df9c
playground: add some containers with limit
fkhadra Jun 17, 2023
932ce37
feat: initial implementation without event manager
fkhadra Jun 17, 2023
cb9dbb2
update workflow
fkhadra Jun 17, 2023
ec376f4
drop displayed toast count
fkhadra Jun 17, 2023
56861bf
skip addons for now
fkhadra Jun 17, 2023
423b70e
add build config to ease work with addons
fkhadra Jun 17, 2023
76d30a3
chore: run tests wit chrome
fkhadra Jun 18, 2023
ef396b5
migrate notification center
fkhadra Jun 18, 2023
3a3ff4a
remove jest and reenable addons
fkhadra Jun 18, 2023
517d5d7
exclude types from coverage
fkhadra Jun 18, 2023
207578e
drop unused style
fkhadra Jun 19, 2023
3a049cb
drop position and type constant
fkhadra Jun 19, 2023
cb6d988
tweak shadow and animation duration
fkhadra Jun 19, 2023
841bbf0
update playground
fkhadra Jun 19, 2023
66a968f
fix newestOnTop
fkhadra Jun 20, 2023
b6f081f
remove container id var
fkhadra Jun 23, 2023
bcd94e7
rewrite store
fkhadra Jun 23, 2023
68b81a1
refactor container observer
fkhadra Jun 23, 2023
eb17a31
[WIP] feat: play pause toast
fkhadra Jun 23, 2023
62b486f
export decorate func #979
fkhadra Jul 1, 2023
4665865
fix typos
fkhadra Jul 2, 2023
c386141
review draggable logic
fkhadra Jul 9, 2023
628347b
update defaults
fkhadra Jul 9, 2023
fa7e6b1
remove closeOnClick from default props
fkhadra Jul 9, 2023
8085770
add stacked notifications
fkhadra Aug 1, 2023
70fcee0
support drag for stacked container
fkhadra Aug 3, 2023
d14c523
clean effect
fkhadra Aug 4, 2023
147e6ac
handle progress for stacked notification
fkhadra Aug 4, 2023
ad4ba7b
fix progress
fkhadra Aug 4, 2023
1ce1119
skip hidden folders
fkhadra Aug 4, 2023
ad5c93a
fix tests
fkhadra Aug 5, 2023
a42e9f3
fix overflow
fkhadra Sep 3, 2023
c1ecc4e
fix issue #1011
fkhadra Oct 31, 2023
fb8744b
use sync external store shim
fkhadra Oct 31, 2023
a2e1942
export map #1002
fkhadra Nov 1, 2023
6e74a0c
add stacked container tests
fkhadra Nov 3, 2023
8b8644f
improve typescript support
fkhadra Nov 3, 2023
21dd642
reenable test
fkhadra Nov 3, 2023
054a6a9
cleanup playground
fkhadra Nov 3, 2023
a9d3256
update usages
fkhadra Nov 3, 2023
53f8a73
add isLoading to icon #1003
fkhadra Nov 3, 2023
e428326
update props instead of overriding
fkhadra Nov 25, 2023
50f76d0
upload artifact for test
fkhadra Nov 26, 2023
673990c
hack test
fkhadra Nov 26, 2023
14ff114
try hard
fkhadra Nov 26, 2023
deb09a8
progress bar background
kifrud Dec 4, 2023
89390ec
tweak progress bar
fkhadra Dec 6, 2023
4c5397c
drop react 17 support
fkhadra Dec 6, 2023
f060d34
bump deps
fkhadra Dec 7, 2023
7633800
update workflow
fkhadra Dec 7, 2023
18df567
fix path
fkhadra Dec 7, 2023
de26fee
bump action
fkhadra Dec 7, 2023
de177a2
update progress bar opacity
fkhadra Dec 7, 2023
568fa60
handle both object and primitive
fkhadra Dec 17, 2023
0edcf87
refactor expression
fkhadra Dec 17, 2023
172bcc5
update readme
fkhadra Dec 20, 2023
bcde4ab
update readme
fkhadra Jan 8, 2024
cbc7109
bump dependencies
fkhadra Jan 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ jobs:
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
- name: Install dependencies
run: yarn
- name: Lint
run: yarn lint
- name: Setup
run: yarn setup
- name: Test
run: yarn run test:coverage
run: yarn run test:run
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.2
with:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ cjs/
esm/
dist/
.cache
/addons
/addons
.nyc_output
cypress/videos/*
cypress/screenshots/*
16 changes: 16 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"all": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": true,
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"exclude": [
"cypress/**/*.*",
"src/types.ts",
"**/*.d.ts",
"**/*.cy.tsx",
"**/*.cy.ts"
]
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

![React toastify](https://user-images.githubusercontent.com/5574267/130804494-a9d2d69c-f170-4576-b2e1-0bb7f13dd92d.gif "React toastify")

![stacked](https://github.com/fkhadra/react-toastify/assets/5574267/975c7c01-b95e-43cf-9100-256fa8ef2760)


🎉 React-Toastify allows you to add notifications to your app with ease. No more nonsense!

Expand Down Expand Up @@ -37,6 +39,8 @@ $ yarn add react-toastify
- You can control the progress bar a la `nprogress` 😲
- You can limit the number of toast displayed at the same time
- Dark mode 🌒
- Pause timer programmaticaly
- Stacked notifications!
- And much more !

## The gist
Expand Down
4 changes: 3 additions & 1 deletion build-addons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ try {
const dirs = await readdir(BASE_DIR);

for (const dir of dirs) {
if (dir.startsWith('.')) continue;

let entryPoint = path.join(BASE_DIR, dir, 'index.ts');
const exportKey = `./addons/${dir}`;
const exportValues = {
Expand All @@ -39,7 +41,7 @@ try {
const exportOut = `./addons/${dir}/${filename}`;

const { stdout, stderr } = await asyncExec(
`${MICRO_BUNDLE} -i ${entryPoint} -o ${out} --no-pkg-main -f ${moduleType} --jsx React.createElement --external react-toastify --compress false`
`${MICRO_BUNDLE} -i ${entryPoint} -o ${out} --no-pkg-main -f ${moduleType} --jsx React.createElement --external react-toastify --compress false --tsconfig tsconfig.build.json`
);
console.log(stdout);
console.log(stderr);
Expand Down
14 changes: 14 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'cypress';

export default defineConfig({
component: {
setupNodeEvents(on, config) {
require('@cypress/code-coverage/task')(on, config);
return config;
},
devServer: {
framework: 'react',
bundler: 'vite'
}
}
});
42 changes: 42 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/// <reference types="cypress" />
/// <reference types="@testing-library/cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
declare global {
namespace Cypress {
interface Chainable {
resolveEntranceAnimation(): void;
}
}
}

import '@4tw/cypress-drag-drop';
import '@testing-library/cypress/add-commands';

Cypress.Commands.add('resolveEntranceAnimation', () => {
cy.wait(800);
});
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
43 changes: 43 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ***********************************************************
// This example support/component.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
// cypress/support/e2e.js
import '@cypress/code-coverage/support';
import './commands';
import '../../scss/main.scss';
import './style.css';

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react18';

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount;
}
}
}

Cypress.Commands.add('mount', mount);

// Example use:
// cy.mount(<MyComponent />)
4 changes: 4 additions & 0 deletions cypress/support/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

[data-cy-root]{
height: 80vh;
}
4 changes: 0 additions & 4 deletions example/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions example/.parcelrc

This file was deleted.

18 changes: 0 additions & 18 deletions example/index.html

This file was deleted.

14 changes: 0 additions & 14 deletions example/index.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions example/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions example/tsconfig.json

This file was deleted.