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

[migrate] move Open Map component to an Independent package #47

Merged
merged 1 commit into from
Aug 28, 2023
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
84 changes: 24 additions & 60 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
35 changes: 16 additions & 19 deletions package.json
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.",
Expand All @@ -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": {
Expand All @@ -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",
Expand Down Expand Up @@ -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"
}
}
Loading