diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f4d5ed1..8528ec79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ ## main ### ✨ Features and improvements +- Added translation to "Links" in debug modal - _...Add new stuff here..._ ### 🐞 Bug fixes +- Fix modal close button possition +- Fixed an issue with the generation of tranlations - _...Add new stuff here..._ ## 3.0.0 diff --git a/src/components/App.tsx b/src/components/App.tsx index 252e4773..9ba85167 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -18,12 +18,12 @@ import AppToolbar, { MapState } from './AppToolbar' import AppLayout from './AppLayout' import MessagePanel from './AppMessagePanel' -import ModalSettings from './ModalSettings' -import ModalExport from './ModalExport' -import ModalSources from './ModalSources' -import ModalOpen from './ModalOpen' -import ModalShortcuts from './ModalShortcuts' -import ModalDebug from './ModalDebug' +import ModalSettings from './modals/ModalSettings' +import ModalExport from './modals/ModalExport' +import ModalSources from './modals/ModalSources' +import ModalOpen from './modals/ModalOpen' +import ModalShortcuts from './modals/ModalShortcuts' +import ModalDebug from './modals/ModalDebug' import {downloadGlyphsMetadata, downloadSpriteMetadata} from '../libs/metadata' import style from '../libs/style' diff --git a/src/components/FieldArray.tsx b/src/components/FieldArray.tsx index 51d1b740..91fdab0a 100644 --- a/src/components/FieldArray.tsx +++ b/src/components/FieldArray.tsx @@ -1,4 +1,4 @@ -import InputArray, { FieldArrayProps as InputArrayProps } from './InputArray' +import InputArray, { InputArrayProps } from './InputArray' import Fieldset from './Fieldset' type FieldArrayProps = InputArrayProps & { diff --git a/src/components/FieldDynamicArray.tsx b/src/components/FieldDynamicArray.tsx index b99c643c..c383bb9a 100644 --- a/src/components/FieldDynamicArray.tsx +++ b/src/components/FieldDynamicArray.tsx @@ -1,4 +1,4 @@ -import InputDynamicArray, {FieldDynamicArrayProps as InputDynamicArrayProps} from './InputDynamicArray' +import InputDynamicArray, {InputDynamicArrayProps} from './InputDynamicArray' import Fieldset from './Fieldset' type FieldDynamicArrayProps = InputDynamicArrayProps & { diff --git a/src/components/SpecField.tsx b/src/components/FieldSpec.tsx similarity index 78% rename from src/components/SpecField.tsx rename to src/components/FieldSpec.tsx index 71b2396a..e7b31f34 100644 --- a/src/components/SpecField.tsx +++ b/src/components/FieldSpec.tsx @@ -1,5 +1,5 @@ import Block from './Block' -import InputSpec, { SpecFieldProps as InputFieldSpecProps } from './InputSpec' +import InputSpec, { InputSpecProps } from './InputSpec' import Fieldset from './Fieldset' @@ -15,11 +15,11 @@ const typeMap = { padding: () => Block, }; -export type SpecFieldProps = InputFieldSpecProps & { +export type FieldSpecProps = InputSpecProps & { name?: string }; -const SpecField: React.FC = (props) => { +const FieldSpec: React.FC = (props) => { const fieldType = props.fieldSpec?.type; const typeBlockFn = typeMap[fieldType!]; @@ -40,4 +40,4 @@ const SpecField: React.FC = (props) => { ); }; -export default SpecField; +export default FieldSpec; diff --git a/src/components/IconBackground.tsx b/src/components/IconBackground.tsx deleted file mode 100644 index e0960034..00000000 --- a/src/components/IconBackground.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React, { type CSSProperties } from 'react' -import { BsDiamondFill } from 'react-icons/bs'; - -const IconBackground: React.FC<{style: CSSProperties | undefined}> = (props) => { - return ( - - ) -} - -export default IconBackground; diff --git a/src/components/IconCircle.tsx b/src/components/IconCircle.tsx deleted file mode 100644 index 302a0450..00000000 --- a/src/components/IconCircle.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React, { type CSSProperties } from 'react' -import {MdOutlineCircle} from 'react-icons/md' - -const IconCircle: React.FC<{style: CSSProperties | undefined}> = (props) => { - return ( - - ) -} -export default IconCircle; diff --git a/src/components/IconFill.tsx b/src/components/IconFill.tsx deleted file mode 100644 index b766b95f..00000000 --- a/src/components/IconFill.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React, { type CSSProperties } from 'react' -import { BsDiamond } from 'react-icons/bs'; - - -const IconFill: React.FC<{style: CSSProperties | undefined}> = (props) => { - return ( - - ) -} -export default IconFill; diff --git a/src/components/IconLayer.tsx b/src/components/IconLayer.tsx index f8691449..953a9960 100644 --- a/src/components/IconLayer.tsx +++ b/src/components/IconLayer.tsx @@ -1,12 +1,9 @@ import React from 'react' -import IconLine from './IconLine' -import IconFill from './IconFill' -import IconSymbol from './IconSymbol' -import IconBackground from './IconBackground' -import IconCircle from './IconCircle' -import IconMissing from './IconMissing' import type {CSSProperties} from 'react' +import { BsDiamond, BsDiamondFill, BsFonts } from 'react-icons/bs' +import { MdOutlineCircle, MdPriorityHigh } from 'react-icons/md' +import { IoAnalyticsOutline } from 'react-icons/io5' type IconLayerProps = { type: string @@ -17,16 +14,16 @@ type IconLayerProps = { const IconLayer: React.FC = (props) => { const iconProps = { style: props.style } switch(props.type) { - case 'fill-extrusion': return - case 'raster': return - case 'hillshade': return - case 'heatmap': return - case 'fill': return - case 'background': return - case 'line': return - case 'symbol': return - case 'circle': return - default: return + case 'fill-extrusion': return + case 'raster': return + case 'hillshade': return + case 'heatmap': return + case 'fill': return + case 'background': return + case 'line': return + case 'symbol': return + case 'circle': return + default: return } } diff --git a/src/components/IconLine.tsx b/src/components/IconLine.tsx deleted file mode 100644 index 0284b674..00000000 --- a/src/components/IconLine.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { type CSSProperties } from 'react' -import { IoAnalyticsOutline } from 'react-icons/io5'; - - -const IconLine: React.FC<{style: CSSProperties | undefined}> = (props) => { - return ( - - ) -} - -export default IconLine; diff --git a/src/components/IconMissing.tsx b/src/components/IconMissing.tsx deleted file mode 100644 index f119fd7d..00000000 --- a/src/components/IconMissing.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React, { type CSSProperties } from 'react' -import {MdPriorityHigh} from 'react-icons/md' - -const IconMissing: React.FC<{style: CSSProperties | undefined}> = (props) => { - return ( - - ) -} -export default IconMissing; diff --git a/src/components/IconSymbol.tsx b/src/components/IconSymbol.tsx deleted file mode 100644 index f2f29120..00000000 --- a/src/components/IconSymbol.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React, { type CSSProperties } from 'react' -import { BsFonts } from 'react-icons/bs'; - - -const IconSymbol: React.FC<{style: CSSProperties | undefined}> = (props) => { - return ( - - ) -} -export default IconSymbol; diff --git a/src/components/InputArray.tsx b/src/components/InputArray.tsx index 182191c3..4db2310b 100644 --- a/src/components/InputArray.tsx +++ b/src/components/InputArray.tsx @@ -2,7 +2,7 @@ import React from 'react' import InputString from './InputString' import InputNumber from './InputNumber' -export type FieldArrayProps = { +export type InputArrayProps = { value: (string | number | undefined)[] type?: string length?: number @@ -12,18 +12,18 @@ export type FieldArrayProps = { label?: string }; -type FieldArrayState = { +type InputArrayState = { value: (string | number | undefined)[] initialPropsValue: unknown[] } -export default class FieldArray extends React.Component { +export default class InputArray extends React.Component { static defaultProps = { value: [], default: [], } - constructor (props: FieldArrayProps) { + constructor (props: InputArrayProps) { super(props); this.state = { value: this.props.value.slice(0), @@ -32,7 +32,7 @@ export default class FieldArray extends React.Component, state: FieldArrayState) { + static getDerivedStateFromProps(props: Readonly, state: InputArrayState) { const value: any[] = []; const initialPropsValue = state.initialPropsValue.slice(0); diff --git a/src/components/InputDynamicArray.tsx b/src/components/InputDynamicArray.tsx index 52a364f9..b2267920 100644 --- a/src/components/InputDynamicArray.tsx +++ b/src/components/InputDynamicArray.tsx @@ -11,7 +11,7 @@ import InputEnum from './InputEnum' import InputUrl from './InputUrl' -export type FieldDynamicArrayProps = { +export type InputDynamicArrayProps = { value?: (string | number | undefined)[] type?: 'url' | 'number' | 'enum' | 'string' default?: (string | number | undefined)[] @@ -24,9 +24,9 @@ export type FieldDynamicArrayProps = { label: string } -type FieldDynamicArrayInternalProps = FieldDynamicArrayProps & WithTranslation; +type InputDynamicArrayInternalProps = InputDynamicArrayProps & WithTranslation; -class FieldDynamicArrayInternal extends React.Component { +class InputDynamicArrayInternal extends React.Component { changeValue(idx: number, newValue: string | number | undefined) { const values = this.values.slice(0) values[idx] = newValue @@ -131,8 +131,8 @@ class FieldDynamicArrayInternal extends React.Component { +export default class InputFont extends React.Component { static defaultProps = { fonts: [] } diff --git a/src/components/InputSpec.tsx b/src/components/InputSpec.tsx index 311bc142..0a50824c 100644 --- a/src/components/InputSpec.tsx +++ b/src/components/InputSpec.tsx @@ -4,16 +4,16 @@ import InputColor, { InputColorProps } from './InputColor' import InputNumber, { InputNumberProps } from './InputNumber' import InputCheckbox, { InputCheckboxProps } from './InputCheckbox' import InputString, { InputStringProps } from './InputString' -import InputArray, { FieldArrayProps } from './InputArray' -import InputDynamicArray, { FieldDynamicArrayProps } from './InputDynamicArray' -import InputFont, { FieldFontProps } from './InputFont' +import InputArray, { InputArrayProps } from './InputArray' +import InputDynamicArray, { InputDynamicArrayProps } from './InputDynamicArray' +import InputFont, { InputFontProps } from './InputFont' import InputAutocomplete, { InputAutocompleteProps } from './InputAutocomplete' import InputEnum, { InputEnumProps } from './InputEnum' import capitalize from 'lodash.capitalize' const iconProperties = ['background-pattern', 'fill-pattern', 'line-pattern', 'fill-extrusion-pattern', 'icon-image'] -export type SpecFieldProps = { +export type InputSpecProps = { onChange?(fieldName: string | undefined, value: number | undefined | (string | number | undefined)[]): unknown fieldName?: string fieldSpec?: { @@ -37,7 +37,7 @@ export type SpecFieldProps = { /** Display any field from the Maplibre GL style spec and * choose the correct field component based on the @{fieldSpec} * to display @{value}. */ -export default class SpecField extends React.Component { +export default class InputSpec extends React.Component { childNodes() { const commonProps = { @@ -96,21 +96,21 @@ export default class SpecField extends React.Component { case 'array': if(this.props.fieldName === 'text-font') { return } else { if (this.props.fieldSpec.length) { return } else { return } } diff --git a/src/components/InputUrl.tsx b/src/components/InputUrl.tsx index af7456ab..f8779d61 100644 --- a/src/components/InputUrl.tsx +++ b/src/components/InputUrl.tsx @@ -68,18 +68,18 @@ export type FieldUrlProps = { className?: string }; -type FieldUrlInternalProps = FieldUrlProps & WithTranslation; +type InputUrlInternalProps = FieldUrlProps & WithTranslation; -type FieldUrlState = { +type InputUrlState = { error?: React.ReactNode } -class FieldUrlInternal extends React.Component { +class InputUrlInternal extends React.Component { static defaultProps = { onInput: () => {}, } - constructor (props: FieldUrlInternalProps) { + constructor (props: InputUrlInternalProps) { super(props); this.state = { error: validate(props.value, props.t), @@ -115,5 +115,5 @@ class FieldUrlInternal extends React.Component { const error = errors![fieldType+"."+fieldName as any] as any; - return { return

{this.props.title}

- +