Skip to content

Commit

Permalink
[add] Open Map component
Browse files Browse the repository at this point in the history
[optimize] upgrade to JSX runtime
  • Loading branch information
TechQuery committed Sep 10, 2022
1 parent 74e7fb1 commit 1da5303
Show file tree
Hide file tree
Showing 35 changed files with 215 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ dist/
preview/pnpm-lock.yaml
docs/
.parcel-cache
.vscode/settings.json
.vercel
27 changes: 16 additions & 11 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
```html
<link
rel="stylesheet"
href="https://unpkg.com/bootstrap@5.2.0/dist/css/bootstrap.min.css"
href="https://unpkg.com/bootstrap@5.2.1/dist/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
Expand All @@ -31,7 +31,11 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
/>
<link
rel="stylesheet"
href="https://unpkg.com/idea-react@0.26.8/dist/index.umd.css"
href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/idea-react@0.27.0/dist/index.umd.css"
/>
```

Expand All @@ -54,15 +58,16 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
15. [Code Block](source/CodeBlock.tsx)
16. [Editor](source/Editor.tsx)
17. [Editor HTML](source/EditorHTML.tsx)
18. [Address Picker](source/AddressPicker.tsx)
19. [Idea Info](source/IdeaInfo.tsx)
20. [Idea Table](source/IdeaTable.tsx)
21. [Table Spinner](source/TableSpinner.tsx)
22. [Loading](source/Loading.tsx)
23. [Pagination Bar](source/PaginationBar.tsx)
24. [Idea Form](source/IdeaForm.tsx)
25. [Idea Popover](source/IdeaPopover.tsx)
26. [Idea Dialog](source/IdeaDialog.tsx)
18. [Open Map](source/OpenMap.tsx)
19. [Address Picker](source/AddressPicker.tsx)
20. [Idea Info](source/IdeaInfo.tsx)
21. [Idea Table](source/IdeaTable.tsx)
22. [Table Spinner](source/TableSpinner.tsx)
23. [Loading](source/Loading.tsx)
24. [Pagination Bar](source/PaginationBar.tsx)
25. [Idea Form](source/IdeaForm.tsx)
26. [Idea Popover](source/IdeaPopover.tsx)
27. [Idea Dialog](source/IdeaDialog.tsx)

## Utilities

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idea-react",
"version": "0.26.10",
"version": "0.27.0",
"license": "LGPL-3.0",
"author": "shiy2008@gmail.com",
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
Expand Down Expand Up @@ -28,21 +28,24 @@
"@swc/helpers": "^0.4.11",
"classnames": "^2.3.1",
"editorjs-html": "^3.4.2",
"leaflet": "^1.8.0",
"lodash": "^4.17.21",
"prismjs": "^1.29.0",
"react": "^17.0.2",
"react-bootstrap": "^2.5.0",
"react-dom": "^17.0.2",
"react-editor-js": "^2.1.0",
"react-element-to-jsx-string": "^15.0.0",
"web-utility": "^3.9.2"
"react-leaflet": "^4.0.2",
"web-utility": "^3.9.4"
},
"devDependencies": {
"@parcel/packager-ts": "~2.6.2",
"@parcel/transformer-less": "~2.6.2",
"@parcel/transformer-typescript-types": "~2.6.2",
"@types/leaflet": "^1.7.11",
"@types/lodash": "^4.14.184",
"@types/node": "^14.18.27",
"@types/node": "^14.18.28",
"@types/prismjs": "^1.26.0",
"@types/react": "^17.0.49",
"@types/react-dom": "^17.0.17",
Expand Down
73 changes: 59 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion preview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="Cache-control" content="no-store" />
<link
rel="stylesheet"
href="https://unpkg.com/bootstrap@5.2.0/dist/css/bootstrap.min.css"
href="https://unpkg.com/bootstrap@5.2.1/dist/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
Expand All @@ -14,6 +14,10 @@
rel="stylesheet"
href="https://unpkg.com/prismjs@1.29.0/themes/prism.min.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"
/>
</head>
<body>
<div id="app"></div>
Expand Down
7 changes: 7 additions & 0 deletions preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
IdeaTable,
Loading,
CodeBlock,
OpenMap,
AddressPicker,
MultipleFileUploader,
Nameplate,
Expand Down Expand Up @@ -389,6 +390,12 @@ export class App extends PureComponent<{}, State> {
)}
</Section>

<Section title="Open Map">
{this.renderCode(
<OpenMap center={[34.32, 108.55]} zoom={4} />
)}
</Section>

<Section title="Map Select">
{this.renderCode(
<AddressPicker
Expand Down
2 changes: 1 addition & 1 deletion preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"dependencies": {
"classnames": "^2.3.1",
"web-utility": "^3.9.2"
"web-utility": "^3.9.4"
},
"devDependencies": {
"@parcel/transformer-less": "^2.7.0",
Expand Down
2 changes: 1 addition & 1 deletion source/AddressPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithChildren, PureComponent, SyntheticEvent } from 'react';
import { PropsWithChildren, PureComponent, SyntheticEvent } from 'react';
import { Modal } from 'react-bootstrap';

export interface MapData {
Expand Down
2 changes: 1 addition & 1 deletion source/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classNames from 'classnames';
import React, { CSSProperties, FC, PropsWithoutRef } from 'react';
import { CSSProperties, FC, PropsWithoutRef } from 'react';

export type AvatarProps = PropsWithoutRef<{
style?: CSSProperties;
Expand Down
2 changes: 1 addition & 1 deletion source/ClickBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithChildren, PureComponent, createRef } from 'react';
import { PropsWithChildren, PureComponent, createRef } from 'react';

export type ClickBoundaryProps = PropsWithChildren<{
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion source/CodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithChildren } from 'react';
import { PropsWithChildren } from 'react';
import reactElementToJSXString from 'react-element-to-jsx-string';
import { highlight, languages } from 'prismjs';

Expand Down
2 changes: 1 addition & 1 deletion source/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithoutRef, ComponentClass, PureComponent } from 'react';
import { PropsWithoutRef, ComponentClass, PureComponent } from 'react';
import EditorJS from '@editorjs/editorjs';
import { createReactEditorJS } from 'react-editor-js';

Expand Down
2 changes: 1 addition & 1 deletion source/EditorHTML.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, PropsWithoutRef } from 'react';
import { FC, PropsWithoutRef } from 'react';
import EditorJS_HTML from 'editorjs-html';

export const parser = new EditorJS_HTML({
Expand Down
2 changes: 1 addition & 1 deletion source/FilePicker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, PropsWithoutRef, PureComponent } from 'react';
import { ChangeEvent, PropsWithoutRef, PureComponent } from 'react';

import { Icon } from '../Icon';
import * as style from './index.module.less';
Expand Down
2 changes: 1 addition & 1 deletion source/FileUploader/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, Component } from 'react';
import { ChangeEvent, Component } from 'react';
import { Form, Image } from 'react-bootstrap';

import { Icon } from '../Icon';
Expand Down
2 changes: 1 addition & 1 deletion source/FilterInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { debounce } from 'lodash';
import React, { KeyboardEvent, PureComponent, createRef } from 'react';
import { KeyboardEvent, PureComponent, createRef } from 'react';
import { Badge } from 'react-bootstrap';

import { Icon } from '../Icon';
Expand Down
2 changes: 1 addition & 1 deletion source/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { HTMLAttributes, FC, PropsWithRef } from 'react';
import { HTMLAttributes, FC, PropsWithRef } from 'react';
import classNames from 'classnames';

export type IconProps = PropsWithRef<
Expand Down
2 changes: 1 addition & 1 deletion source/IdeaDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import { FC } from 'react';
import { Button, Modal } from 'react-bootstrap';

import { SpinnerButtonProps, SpinnerButton } from './SpinnerButton';
Expand Down
Loading

1 comment on commit 1da5303

@github-actions
Copy link

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-k7c9f7xg7-stevending1st.vercel.app

Built with commit 1da5303.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.