-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[migrate] move Open Map component to an Independent package
[refactor] simplify Configuration & Logic of Preview page [optimize] update Upstream packages
- Loading branch information
Showing
15 changed files
with
1,164 additions
and
1,811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,15 @@ | |
|
||
A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstrap][3], built by **[idea2app][4] remote developers team**. | ||
|
||
[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/Idea-React.svg)][5] | ||
[![CI & CD](https://github.com/idea2app/Idea-React/actions/workflows/main.yml/badge.svg)][6] | ||
[![MobX compatibility](https://img.shields.io/badge/Compatible-1?logo=mobx&label=MobX%204%2F5%2F6)][5] | ||
[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/Idea-React.svg)][6] | ||
[![CI & CD](https://github.com/idea2app/Idea-React/actions/workflows/main.yml/badge.svg)][7] | ||
|
||
[![NPM](https://nodei.co/npm/idea-react.png?downloads=true&downloadRank=true&stars=true)][7] | ||
[![NPM](https://nodei.co/npm/idea-react.png?downloads=true&downloadRank=true&stars=true)][8] | ||
|
||
- API document: https://idea2app.github.io/Idea-React/ | ||
- Preview site: https://idea-react.vercel.app/ | ||
- Preview site: https://idea2app.github.io/Idea-React/preview/ | ||
- Storybook playground: https://idea-react.vercel.app/ | ||
|
||
## Content | ||
|
||
|
@@ -27,16 +29,19 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr | |
11. [Page Nav](source/PageNav.tsx) | ||
12. [Editor](source/Editor.tsx) | ||
13. [Editor HTML](source/EditorHTML.tsx) | ||
14. [Open Map](source/OpenMap/index.tsx) | ||
15. [Table Spinner](source/TableSpinner.tsx) | ||
16. [Loading](source/Loading.tsx) | ||
17. [Overlay Box](source/OverlayBox.tsx) | ||
18. [Dialog](source/Dialog.tsx) | ||
14. [Table Spinner](source/TableSpinner.tsx) | ||
15. [Loading](source/Loading.tsx) | ||
16. [Overlay Box](source/OverlayBox.tsx) | ||
17. [Dialog](source/Dialog.tsx) | ||
|
||
#### Data components | ||
|
||
Table, List & Form components around Data models, have been migrated to https://github.com/idea2app/MobX-RESTful-table, since Idea-React v1.0.0. | ||
|
||
#### Map components | ||
|
||
Open Map component & model, have been migrated to https://github.com/idea2app/OpenMap, since Idea-React v1.0.0. | ||
|
||
### Utilities | ||
|
||
1. [`text2color`](source/color.ts) | ||
|
@@ -46,8 +51,8 @@ Table, List & Form components around Data models, have been migrated to https:// | |
|
||
### Scaffolds | ||
|
||
1. MobX: [demo][8] & [usage][9] | ||
2. Next.js: [demo][10] & [usage][11] | ||
1. MobX: [demo][9] & [usage][10] | ||
2. Next.js: [demo][11] & [usage][12] | ||
|
||
### CSS on CDN | ||
|
||
|
@@ -68,10 +73,6 @@ Table, List & Form components around Data models, have been migrated to https:// | |
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/themes/prism.min.css" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/dist/leaflet.css" | ||
/> | ||
``` | ||
|
||
### Dialog | ||
|
@@ -139,43 +140,6 @@ export class ExamplePage extends PureComponent { | |
} | ||
``` | ||
|
||
### Open Map | ||
|
||
#### Common example | ||
|
||
[China map in China Open-source Map project][12] | ||
|
||
```tsx | ||
import { FC } from 'react'; | ||
import { OpenMap, OpenMapProps } from 'idea-react'; | ||
|
||
export const ChinaMap: FC<OpenMapProps> = props => ( | ||
<OpenMap center={[34.32, 108.55]} zoom={4} {...props} /> | ||
); | ||
``` | ||
|
||
#### Use in Next.js | ||
|
||
```tsx | ||
import ChinaMap from '../../components/ChinaMap'; | ||
|
||
export default function ExampleMap() { | ||
return ( | ||
typeof window !== 'undefined' && ( | ||
<ChinaMap | ||
markers={[ | ||
{ | ||
position: [34.32, 108.55], | ||
tooltip: 'Geo Center of China' | ||
} | ||
]} | ||
onMarkerClick={console.log} | ||
/> | ||
) | ||
); | ||
} | ||
``` | ||
|
||
## Development | ||
|
||
### Publish | ||
|
@@ -204,11 +168,11 @@ git push origin master --tags # push all branches and tags on master | |
[2]: https://www.typescriptlang.org/ | ||
[3]: https://getbootstrap.com/ | ||
[4]: https://idea2app.github.io/ | ||
[5]: https://libraries.io/npm/idea-react | ||
[6]: https://github.com/idea2app/Idea-React/actions/workflows/main.yml | ||
[7]: https://nodei.co/npm/idea-react/ | ||
[8]: https://idea2app.github.io/React-MobX-Bootstrap-ts/ | ||
[9]: https://github.com/idea2app/React-MobX-Bootstrap-ts/blob/master/src/page/Component.tsx | ||
[10]: https://next-bootstrap-ts.vercel.app/ | ||
[11]: https://github.com/idea2app/next-bootstrap-ts/blob/main/pages/component.tsx | ||
[12]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/04d6311a6bd7f131e214034801a42f5044c87133/components/ChinaMap.tsx | ||
[5]: https://mobx.js.org/ | ||
[6]: https://libraries.io/npm/idea-react | ||
[7]: https://github.com/idea2app/Idea-React/actions/workflows/main.yml | ||
[8]: https://nodei.co/npm/idea-react/ | ||
[9]: https://idea2app.github.io/React-MobX-Bootstrap-ts/ | ||
[10]: https://github.com/idea2app/React-MobX-Bootstrap-ts/blob/master/src/page/Component.tsx | ||
[11]: https://next-bootstrap-ts.vercel.app/ | ||
[12]: https://github.com/idea2app/next-bootstrap-ts/blob/main/pages/component.tsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "idea-react", | ||
"version": "1.0.0-rc.18", | ||
"version": "1.0.0-rc.21", | ||
"license": "LGPL-3.0-or-later", | ||
"author": "[email protected]", | ||
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.", | ||
|
@@ -27,22 +27,16 @@ | |
"@editorjs/paragraph": "^2.10.0", | ||
"@react-editor-js/core": "^2.1.0", | ||
"@swc/helpers": "^0.5.1", | ||
"@types/leaflet": "^1.9.3", | ||
"classnames": "^2.3.2", | ||
"editorjs-html": "^3.4.3", | ||
"iterable-observer": "^1.0.0", | ||
"koajax": "^0.8.6", | ||
"leaflet": "^1.9.4", | ||
"lodash": "^4.17.21", | ||
"mobx": ">=4", | ||
"mobx-react": ">=6", | ||
"mobx-react-helper": "^0.2.0", | ||
"prismjs": "^1.29.0", | ||
"react-bootstrap": "^2.8.0", | ||
"react-editor-js": "^2.1.0", | ||
"react-element-to-jsx-string": "^15.0.0", | ||
"react-leaflet": "^3.2.5", | ||
"regenerator-runtime": "^0.14.0", | ||
"web-utility": "^4.1.0" | ||
}, | ||
"peerDependencies": { | ||
|
@@ -65,28 +59,28 @@ | |
"@storybook/react-vite": "^7.3.2", | ||
"@storybook/testing-library": "0.2.0", | ||
"@types/lodash": "^4.14.197", | ||
"@types/node": "^18.17.11", | ||
"@types/node": "^18.17.12", | ||
"@types/prismjs": "^1.26.0", | ||
"@types/react": "^17.0.65", | ||
"@types/react-dom": "^17.0.20", | ||
"@typescript-eslint/eslint-plugin": "^6.4.1", | ||
"@typescript-eslint/parser": "^6.4.1", | ||
"@types/react": "^18.2.21", | ||
"@types/react-dom": "^18.2.7", | ||
"@typescript-eslint/eslint-plugin": "^6.5.0", | ||
"@typescript-eslint/parser": "^6.5.0", | ||
"@vitejs/plugin-react": "^4.0.4", | ||
"eslint": "^8.48.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
"husky": "^8.0.3", | ||
"koapache": "^2.2.2", | ||
"less": "^4.2.0", | ||
"lint-staged": "^14.0.1", | ||
"open-cli": "^7.2.0", | ||
"parcel": "~2.9.3", | ||
"postcss-preset-env": "^9.1.1", | ||
"postcss-preset-env": "^9.1.2", | ||
"prettier": "^3.0.2", | ||
"process": "^0.11.10", | ||
"prop-types": "15.8.1", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rimraf": "^5.0.1", | ||
"storybook": "^7.3.2", | ||
"ts-node": "^10.9.1", | ||
|
@@ -115,12 +109,15 @@ | |
"prepare": "husky install", | ||
"test": "lint-staged", | ||
"api-extractor": "tsc --project tsconfig.build.json --outDir dist/dts && api-extractor run && rimraf dist/dts", | ||
"build": "rimraf dist/ docs/ && typedoc source/ && parcel build && npm run api-extractor", | ||
"start": "typedoc source/ && open-cli docs/index.html", | ||
"pack-preview": "cd preview/ && rimraf ../.parcel-cache dist/ && parcel build --public-url=. --dist-dir=../docs/preview/", | ||
"pack-docs": "rimraf docs/ && typedoc source/", | ||
"pack-dist": "rimraf .parcel-cache/ dist/ && parcel build", | ||
"start": "npm run pack-docs && npm run pack-preview && web-server docs/ -p 8080 -o", | ||
"build": "npm run pack-docs && npm run pack-preview && npm run pack-dist && npm run api-extractor", | ||
"prepublishOnly": "npm test && npm run build", | ||
"dev:storybook": "storybook dev -p 6006", | ||
"build:storybook": "rimraf storybook-static && storybook build -c .storybook", | ||
"preview:storybook": "vite preview --outDir storybook-static", | ||
"preview": "cd preview && npm start" | ||
"preview": "cd preview/ && rimraf ../.parcel-cache dist/ && parcel --open" | ||
} | ||
} |
Oops, something went wrong.
d453074
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for idea-react ready!
✅ Preview
https://idea-react-eicz1z7ie-stevending1st.vercel.app
Built with commit d453074.
This pull request is being automatically deployed with vercel-action