mirror of
https://github.com/maputnik/editor.git
synced 2026-07-25 15:27:27 +00:00
Migrate more components, fix spec documentation missing information
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import Block from './Block'
|
|
||||||
import InputArray from './InputArray'
|
|
||||||
import Fieldset from './Fieldset'
|
|
||||||
|
|
||||||
export default class FieldArray extends React.Component {
|
|
||||||
static propTypes = {
|
|
||||||
...InputArray.propTypes,
|
|
||||||
name: PropTypes.string,
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {props} = this;
|
|
||||||
|
|
||||||
return <Fieldset label={props.label}>
|
|
||||||
<InputArray {...props} />
|
|
||||||
</Fieldset>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import InputArray, { FieldArrayProps as InputArrayProps } from './InputArray'
|
||||||
|
import Fieldset from './Fieldset'
|
||||||
|
|
||||||
|
type FieldArrayProps = InputArrayProps & {
|
||||||
|
name?: string
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default class FieldArray extends React.Component<FieldArrayProps> {
|
||||||
|
render() {
|
||||||
|
return <Fieldset label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
|
<InputArray {...this.props} />
|
||||||
|
</Fieldset>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import Block from './Block'
|
|
||||||
import InputColor from './InputColor'
|
|
||||||
|
|
||||||
|
|
||||||
export default class FieldColor extends React.Component {
|
|
||||||
static propTypes = {
|
|
||||||
...InputColor.propTypes,
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {props} = this;
|
|
||||||
|
|
||||||
return <Block label={props.label}>
|
|
||||||
<InputColor {...props} />
|
|
||||||
</Block>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import Block from './Block'
|
||||||
|
import InputColor, {InputColorProps} from './InputColor'
|
||||||
|
|
||||||
|
|
||||||
|
type FieldColorProps = InputColorProps & {
|
||||||
|
label?: string
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default class FieldColor extends React.Component<FieldColorProps> {
|
||||||
|
render() {
|
||||||
|
return <Block label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
|
<InputColor {...this.props} />
|
||||||
|
</Block>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -3,15 +3,18 @@ import InputEnum, {InputEnumProps} from './InputEnum'
|
|||||||
import Fieldset from './Fieldset';
|
import Fieldset from './Fieldset';
|
||||||
|
|
||||||
|
|
||||||
type FieldEnumProps = InputEnumProps & { label : string };
|
type FieldEnumProps = InputEnumProps & {
|
||||||
|
label?: string;
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
export default class FieldEnum extends React.Component<FieldEnumProps> {
|
export default class FieldEnum extends React.Component<FieldEnumProps> {
|
||||||
render() {
|
render() {
|
||||||
const {props} = this;
|
return <Fieldset label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
|
<InputEnum {...this.props} />
|
||||||
return <Fieldset label={props.label}>
|
|
||||||
<InputEnum {...props} />
|
|
||||||
</Fieldset>
|
</Fieldset>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import InputJson from './InputJson'
|
|
||||||
|
|
||||||
|
|
||||||
export default class FieldJson extends React.Component {
|
|
||||||
static propTypes = {
|
|
||||||
...InputJson.propTypes,
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {props} = this;
|
|
||||||
return <InputJson {...props} />
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import InputJson, {InputJsonProps} from './InputJson'
|
||||||
|
|
||||||
|
|
||||||
|
type FieldJsonProps = InputJsonProps & {};
|
||||||
|
|
||||||
|
|
||||||
|
export default class FieldJson extends React.Component<FieldJsonProps> {
|
||||||
|
render() {
|
||||||
|
return <InputJson {...this.props} />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
|
|
||||||
import {latest} from '@maplibre/maplibre-gl-style-spec'
|
import {latest} from '@maplibre/maplibre-gl-style-spec'
|
||||||
import Block from './Block'
|
import Block from './Block'
|
||||||
import InputNumber from './InputNumber'
|
import InputNumber from './InputNumber'
|
||||||
|
|
||||||
export default class FieldMaxZoom extends React.Component {
|
type FieldMaxZoomProps = {
|
||||||
static propTypes = {
|
value?: number
|
||||||
value: PropTypes.number,
|
onChange(...args: unknown[]): unknown
|
||||||
onChange: PropTypes.func.isRequired,
|
error?: unknown[]
|
||||||
error: PropTypes.object,
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
export default class FieldMaxZoom extends React.Component<FieldMaxZoomProps> {
|
||||||
render() {
|
render() {
|
||||||
return <Block label={"Max Zoom"} fieldSpec={latest.layer.maxzoom}
|
return <Block label={"Max Zoom"} fieldSpec={latest.layer.maxzoom}
|
||||||
error={this.props.error}
|
error={this.props.error}
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
|
|
||||||
import {latest} from '@maplibre/maplibre-gl-style-spec'
|
import {latest} from '@maplibre/maplibre-gl-style-spec'
|
||||||
import Block from './Block'
|
import Block from './Block'
|
||||||
import InputNumber from './InputNumber'
|
import InputNumber from './InputNumber'
|
||||||
|
|
||||||
export default class FieldMinZoom extends React.Component {
|
type FieldMinZoomProps = {
|
||||||
static propTypes = {
|
value?: number
|
||||||
value: PropTypes.number,
|
onChange(...args: unknown[]): unknown
|
||||||
onChange: PropTypes.func.isRequired,
|
error?: unknown[]
|
||||||
error: PropTypes.object,
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
export default class FieldMinZoom extends React.Component<FieldMinZoomProps> {
|
||||||
render() {
|
render() {
|
||||||
return <Block label={"Min Zoom"} fieldSpec={latest.layer.minzoom}
|
return <Block label={"Min Zoom"} fieldSpec={latest.layer.minzoom}
|
||||||
error={this.props.error}
|
error={this.props.error}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import Block from './Block'
|
|
||||||
import InputMultiInput from './InputMultiInput'
|
|
||||||
import Fieldset from './Fieldset'
|
|
||||||
|
|
||||||
|
|
||||||
export default class FieldMultiInput extends React.Component {
|
|
||||||
static propTypes = {
|
|
||||||
...InputMultiInput.propTypes,
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {props} = this;
|
|
||||||
|
|
||||||
return <Fieldset label={props.label}>
|
|
||||||
<InputMultiInput {...props} />
|
|
||||||
</Fieldset>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import InputMultiInput, {InputMultiInputProps} from './InputMultiInput'
|
||||||
|
import Fieldset from './Fieldset'
|
||||||
|
|
||||||
|
|
||||||
|
type FieldMultiInputProps = InputMultiInputProps & {
|
||||||
|
label?: string
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default class FieldMultiInput extends React.Component<FieldMultiInputProps> {
|
||||||
|
render() {
|
||||||
|
const {props} = this;
|
||||||
|
|
||||||
|
return <Fieldset label={props.label}>
|
||||||
|
<InputMultiInput {...props} />
|
||||||
|
</Fieldset>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import InputNumber from './InputNumber'
|
|
||||||
import Block from './Block'
|
|
||||||
|
|
||||||
|
|
||||||
export default class FieldNumber extends React.Component {
|
|
||||||
static propTypes = {
|
|
||||||
...InputNumber.propTypes,
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {props} = this;
|
|
||||||
return <Block label={props.label}>
|
|
||||||
<InputNumber {...props} />
|
|
||||||
</Block>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import InputNumber, {InputNumberProps} from './InputNumber'
|
||||||
|
import Block from './Block'
|
||||||
|
|
||||||
|
|
||||||
|
type FieldNumberProps = InputNumberProps & {
|
||||||
|
label?: string
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default class FieldNumber extends React.Component<FieldNumberProps> {
|
||||||
|
render() {
|
||||||
|
return <Block label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
|
<InputNumber {...this.props} />
|
||||||
|
</Block>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import Block from './Block'
|
|
||||||
import InputSelect from './InputSelect'
|
|
||||||
|
|
||||||
|
|
||||||
export default class FieldSelect extends React.Component {
|
|
||||||
static propTypes = {
|
|
||||||
...InputSelect.propTypes,
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {props} = this;
|
|
||||||
|
|
||||||
return <Block label={props.label}>
|
|
||||||
<InputSelect {...props}/>
|
|
||||||
</Block>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import Block from './Block'
|
||||||
|
import InputSelect, {InputSelectProps} from './InputSelect'
|
||||||
|
|
||||||
|
|
||||||
|
type FieldSelectProps = InputSelectProps & {
|
||||||
|
label?: string
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default class FieldSelect extends React.Component<FieldSelectProps> {
|
||||||
|
render() {
|
||||||
|
return <Block label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
|
<InputSelect {...this.props}/>
|
||||||
|
</Block>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -5,14 +5,15 @@ import InputString, {InputStringProps} from './InputString'
|
|||||||
type FieldStringProps = InputStringProps & {
|
type FieldStringProps = InputStringProps & {
|
||||||
name?: string
|
name?: string
|
||||||
label?: string
|
label?: string
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class FieldString extends React.Component<FieldStringProps> {
|
export default class FieldString extends React.Component<FieldStringProps> {
|
||||||
render() {
|
render() {
|
||||||
const {props} = this;
|
return <Block label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
|
<InputString {...this.props} />
|
||||||
return <Block label={props.label}>
|
|
||||||
<InputString {...props} />
|
|
||||||
</Block>
|
</Block>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,16 +5,17 @@ import Block from './Block'
|
|||||||
|
|
||||||
type FieldUrlProps = InputUrlProps & {
|
type FieldUrlProps = InputUrlProps & {
|
||||||
label: string;
|
label: string;
|
||||||
|
fieldSpec?: {
|
||||||
|
doc: string
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default class FieldUrl extends React.Component<FieldUrlProps> {
|
export default class FieldUrl extends React.Component<FieldUrlProps> {
|
||||||
render () {
|
render () {
|
||||||
const {props} = this;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Block label={this.props.label}>
|
<Block label={this.props.label} fieldSpec={this.props.fieldSpec}>
|
||||||
<InputUrl {...props} />
|
<InputUrl {...this.props} />
|
||||||
</Block>
|
</Block>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import FieldDocLabel from './FieldDocLabel'
|
|||||||
import Doc from './Doc'
|
import Doc from './Doc'
|
||||||
|
|
||||||
type FieldsetProps = {
|
type FieldsetProps = {
|
||||||
label: string,
|
label?: string,
|
||||||
fieldSpec?: { doc?: string },
|
fieldSpec?: { doc?: string },
|
||||||
action?: ReactElement,
|
action?: ReactElement,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import InputString from './InputString'
|
|||||||
import InputNumber from './InputNumber'
|
import InputNumber from './InputNumber'
|
||||||
|
|
||||||
export type FieldArrayProps = {
|
export type FieldArrayProps = {
|
||||||
value: string[]
|
value: string[] | number[]
|
||||||
type?: string
|
type?: string
|
||||||
length?: number
|
length?: number
|
||||||
default?: string[] | number[]
|
default?: string[] | number[]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import stringifyPretty from 'json-stringify-pretty-compact'
|
|||||||
import '../util/codemirror-mgl';
|
import '../util/codemirror-mgl';
|
||||||
|
|
||||||
|
|
||||||
type InputJsonProps = {
|
export type InputJsonProps = {
|
||||||
layer: any
|
layer: any
|
||||||
maxHeight?: number
|
maxHeight?: number
|
||||||
onChange?(...args: unknown[]): unknown
|
onChange?(...args: unknown[]): unknown
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
|
||||||
type InputMultiInputProps = {
|
export type InputMultiInputProps = {
|
||||||
name?: string
|
name?: string
|
||||||
value: string
|
value: string
|
||||||
options: any[]
|
options: any[]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
type InputSelectProps = {
|
export type InputSelectProps = {
|
||||||
value: string
|
value: string
|
||||||
"data-wd-key"?: string
|
"data-wd-key"?: string
|
||||||
options: [string, any][] | string[]
|
options: [string, any][] | string[]
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export type FieldUrlProps = {
|
|||||||
style?: object
|
style?: object
|
||||||
default?: string
|
default?: string
|
||||||
onChange(...args: unknown[]): unknown
|
onChange(...args: unknown[]): unknown
|
||||||
onInput(...args: unknown[]): unknown
|
onInput?(...args: unknown[]): unknown
|
||||||
multi?: boolean
|
multi?: boolean
|
||||||
required?: boolean
|
required?: boolean
|
||||||
'aria-label'?: string
|
'aria-label'?: string
|
||||||
@@ -79,7 +79,7 @@ export default class FieldUrl extends React.Component<FieldUrlProps, FieldUrlSta
|
|||||||
this.setState({
|
this.setState({
|
||||||
error: validate(url)
|
error: validate(url)
|
||||||
});
|
});
|
||||||
this.props.onInput(url);
|
if (this.props.onInput) this.props.onInput(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange = (url: string) => {
|
onChange = (url: string) => {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import {LightSpecification, StyleSpecification, TransitionSpecification, latest} from '@maplibre/maplibre-gl-style-spec'
|
||||||
|
|
||||||
import {latest} from '@maplibre/maplibre-gl-style-spec'
|
|
||||||
import Block from './Block'
|
|
||||||
import FieldArray from './FieldArray'
|
import FieldArray from './FieldArray'
|
||||||
import FieldNumber from './FieldNumber'
|
import FieldNumber from './FieldNumber'
|
||||||
import FieldString from './FieldString'
|
import FieldString from './FieldString'
|
||||||
@@ -13,16 +11,16 @@ import FieldColor from './FieldColor'
|
|||||||
import Modal from './Modal'
|
import Modal from './Modal'
|
||||||
import fieldSpecAdditional from '../libs/field-spec-additional'
|
import fieldSpecAdditional from '../libs/field-spec-additional'
|
||||||
|
|
||||||
export default class ModalSettings extends React.Component {
|
type ModalSettingsProps = {
|
||||||
static propTypes = {
|
mapStyle: StyleSpecification
|
||||||
mapStyle: PropTypes.object.isRequired,
|
onStyleChanged(...args: unknown[]): unknown
|
||||||
onStyleChanged: PropTypes.func.isRequired,
|
onChangeMetadataProperty(...args: unknown[]): unknown
|
||||||
onChangeMetadataProperty: PropTypes.func.isRequired,
|
isOpen: boolean
|
||||||
isOpen: PropTypes.bool.isRequired,
|
onOpenToggle(...args: unknown[]): unknown
|
||||||
onOpenToggle: PropTypes.func.isRequired,
|
};
|
||||||
}
|
|
||||||
|
|
||||||
changeTransitionProperty(property, value) {
|
export default class ModalSettings extends React.Component<ModalSettingsProps> {
|
||||||
|
changeTransitionProperty(property: keyof TransitionSpecification, value: number | undefined) {
|
||||||
const transition = {
|
const transition = {
|
||||||
...this.props.mapStyle.transition,
|
...this.props.mapStyle.transition,
|
||||||
}
|
}
|
||||||
@@ -40,7 +38,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeLightProperty(property, value) {
|
changeLightProperty(property: keyof LightSpecification, value: any) {
|
||||||
const light = {
|
const light = {
|
||||||
...this.props.mapStyle.light,
|
...this.props.mapStyle.light,
|
||||||
}
|
}
|
||||||
@@ -49,6 +47,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
delete light[property];
|
delete light[property];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// @ts-ignore
|
||||||
light[property] = value;
|
light[property] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,22 +57,24 @@ export default class ModalSettings extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeStyleProperty(property, value) {
|
changeStyleProperty(property: keyof StyleSpecification | "owner", value: any) {
|
||||||
const changedStyle = {
|
const changedStyle = {
|
||||||
...this.props.mapStyle,
|
...this.props.mapStyle,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
// @ts-ignore
|
||||||
delete changedStyle[property];
|
delete changedStyle[property];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// @ts-ignore
|
||||||
changedStyle[property] = value;
|
changedStyle[property] = value;
|
||||||
}
|
}
|
||||||
this.props.onStyleChanged(changedStyle);
|
this.props.onStyleChanged(changedStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const metadata = this.props.mapStyle.metadata || {}
|
const metadata = this.props.mapStyle.metadata || {} as any;
|
||||||
const {onChangeMetadataProperty, mapStyle} = this.props;
|
const {onChangeMetadataProperty, mapStyle} = this.props;
|
||||||
const inputProps = { }
|
const inputProps = { }
|
||||||
|
|
||||||
@@ -98,14 +99,14 @@ export default class ModalSettings extends React.Component {
|
|||||||
label={"Owner"}
|
label={"Owner"}
|
||||||
fieldSpec={{doc: "Owner ID of the style. Used by Mapbox or future style APIs."}}
|
fieldSpec={{doc: "Owner ID of the style. Used by Mapbox or future style APIs."}}
|
||||||
data-wd-key="modal:settings.owner"
|
data-wd-key="modal:settings.owner"
|
||||||
value={this.props.mapStyle.owner}
|
value={(this.props.mapStyle as any).owner}
|
||||||
onChange={this.changeStyleProperty.bind(this, "owner")}
|
onChange={this.changeStyleProperty.bind(this, "owner")}
|
||||||
/>
|
/>
|
||||||
<FieldUrl {...inputProps}
|
<FieldUrl {...inputProps}
|
||||||
fieldSpec={latest.$root.sprite}
|
fieldSpec={latest.$root.sprite}
|
||||||
label="Sprite URL"
|
label="Sprite URL"
|
||||||
data-wd-key="modal:settings.sprite"
|
data-wd-key="modal:settings.sprite"
|
||||||
value={this.props.mapStyle.sprite}
|
value={this.props.mapStyle.sprite as string}
|
||||||
onChange={this.changeStyleProperty.bind(this, "sprite")}
|
onChange={this.changeStyleProperty.bind(this, "sprite")}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
label="Glyphs URL"
|
label="Glyphs URL"
|
||||||
fieldSpec={latest.$root.glyphs}
|
fieldSpec={latest.$root.glyphs}
|
||||||
data-wd-key="modal:settings.glyphs"
|
data-wd-key="modal:settings.glyphs"
|
||||||
value={this.props.mapStyle.glyphs}
|
value={this.props.mapStyle.glyphs as string}
|
||||||
onChange={this.changeStyleProperty.bind(this, "glyphs")}
|
onChange={this.changeStyleProperty.bind(this, "glyphs")}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -138,7 +139,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
fieldSpec={latest.$root.center}
|
fieldSpec={latest.$root.center}
|
||||||
length={2}
|
length={2}
|
||||||
type="number"
|
type="number"
|
||||||
value={mapStyle.center}
|
value={mapStyle.center || []}
|
||||||
default={latest.$root.center.default || [0, 0]}
|
default={latest.$root.center.default || [0, 0]}
|
||||||
onChange={this.changeStyleProperty.bind(this, "center")}
|
onChange={this.changeStyleProperty.bind(this, "center")}
|
||||||
/>
|
/>
|
||||||
@@ -175,7 +176,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
label={"Light anchor"}
|
label={"Light anchor"}
|
||||||
fieldSpec={latest.light.anchor}
|
fieldSpec={latest.light.anchor}
|
||||||
name="light-anchor"
|
name="light-anchor"
|
||||||
value={light.anchor}
|
value={light.anchor as string}
|
||||||
options={Object.keys(latest.light.anchor.values)}
|
options={Object.keys(latest.light.anchor.values)}
|
||||||
default={latest.light.anchor.default}
|
default={latest.light.anchor.default}
|
||||||
onChange={this.changeLightProperty.bind(this, "anchor")}
|
onChange={this.changeLightProperty.bind(this, "anchor")}
|
||||||
@@ -185,7 +186,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
{...inputProps}
|
{...inputProps}
|
||||||
label={"Light color"}
|
label={"Light color"}
|
||||||
fieldSpec={latest.light.color}
|
fieldSpec={latest.light.color}
|
||||||
value={light.color}
|
value={light.color as string}
|
||||||
default={latest.light.color.default}
|
default={latest.light.color.default}
|
||||||
onChange={this.changeLightProperty.bind(this, "color")}
|
onChange={this.changeLightProperty.bind(this, "color")}
|
||||||
/>
|
/>
|
||||||
@@ -194,7 +195,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
{...inputProps}
|
{...inputProps}
|
||||||
label={"Light intensity"}
|
label={"Light intensity"}
|
||||||
fieldSpec={latest.light.intensity}
|
fieldSpec={latest.light.intensity}
|
||||||
value={light.intensity}
|
value={light.intensity as number}
|
||||||
default={latest.light.intensity.default}
|
default={latest.light.intensity.default}
|
||||||
onChange={this.changeLightProperty.bind(this, "intensity")}
|
onChange={this.changeLightProperty.bind(this, "intensity")}
|
||||||
/>
|
/>
|
||||||
@@ -205,7 +206,7 @@ export default class ModalSettings extends React.Component {
|
|||||||
fieldSpec={latest.light.position}
|
fieldSpec={latest.light.position}
|
||||||
type="number"
|
type="number"
|
||||||
length={latest.light.position.length}
|
length={latest.light.position.length}
|
||||||
value={light.position}
|
value={light.position as number[]}
|
||||||
default={latest.light.position.default}
|
default={latest.light.position.default}
|
||||||
onChange={this.changeLightProperty.bind(this, "position")}
|
onChange={this.changeLightProperty.bind(this, "position")}
|
||||||
/>
|
/>
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
|
|
||||||
import Modal from './Modal'
|
import Modal from './Modal'
|
||||||
|
|
||||||
|
|
||||||
export default class ModalShortcuts extends React.Component {
|
type ModalShortcutsProps = {
|
||||||
static propTypes = {
|
isOpen: boolean
|
||||||
isOpen: PropTypes.bool.isRequired,
|
onOpenToggle(...args: unknown[]): unknown
|
||||||
onOpenToggle: PropTypes.func.isRequired,
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
export default class ModalShortcuts extends React.Component<ModalShortcutsProps> {
|
||||||
render() {
|
render() {
|
||||||
const help = [
|
const help = [
|
||||||
{
|
{
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
|
|
||||||
import InputButton from './InputButton'
|
import InputButton from './InputButton'
|
||||||
import Modal from './Modal'
|
import Modal from './Modal'
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
import logoImage from 'maputnik-design/logos/logo-color.svg'
|
import logoImage from 'maputnik-design/logos/logo-color.svg'
|
||||||
|
|
||||||
export default class ModalSurvey extends React.Component {
|
type ModalSurveyProps = {
|
||||||
static propTypes = {
|
isOpen: boolean
|
||||||
isOpen: PropTypes.bool.isRequired,
|
onOpenToggle(...args: unknown[]): unknown
|
||||||
onOpenToggle: PropTypes.func.isRequired,
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
export default class ModalSurvey extends React.Component<ModalSurveyProps> {
|
||||||
onClick = () => {
|
onClick = () => {
|
||||||
window.open('https://gregorywolanski.typeform.com/to/cPgaSY', '_blank');
|
window.open('https://gregorywolanski.typeform.com/to/cPgaSY', '_blank');
|
||||||
|
|
||||||
Reference in New Issue
Block a user