• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

keplergl / kepler.gl / 22361650031

24 Feb 2026 05:09PM UTC coverage: 61.612% (-0.2%) from 61.806%
22361650031

Pull #3219

github

web-flow
Merge 1d9b34cb5 into cc33b0c8f
Pull Request #3219: Update kepler-jupyter to use kepler.gl v3.2.0

6382 of 12288 branches covered (51.94%)

Branch coverage included in aggregate %.

13078 of 19297 relevant lines covered (67.77%)

81.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.69
/src/components/src/modals/export-map-modal/export-html-map.tsx
1
// SPDX-License-Identifier: MIT
2
// Copyright contributors to the kepler.gl project
3

4
import React from 'react';
5
import {StyledExportSection, StyledType, CheckMark} from '../../common/styled-components';
6
import {StyledExportMapSection, StyledWarning, ExportMapLink} from './components';
7
import {
8
  EXPORT_HTML_MAP_MODE_OPTIONS,
9
  EXPORT_HTML_MAP_DOC,
10
  EXPORT_HTML_MAP_MODES_DOC
11
} from '@kepler.gl/constants';
12
import styled from 'styled-components';
13
import {injectIntl} from 'react-intl';
14
import {FormattedMessage} from '@kepler.gl/localization';
15
import {IntlShape} from 'react-intl';
16

17
import {setUserMapboxAccessToken, setExportHTMLMapMode, ActionHandler} from '@kepler.gl/actions';
18

19
const ExportMapStyledExportSection = styled(StyledExportSection)`
7✔
20
  .disclaimer {
21
    font-size: ${props => props.theme.inputFontSize};
×
22
    color: ${props => props.theme.inputColor};
×
23
    margin-top: 12px;
24
  }
25
`;
26

27
interface StyledInputProps {
28
  error?: boolean;
29
}
30

31
const StyledInput = styled.input<StyledInputProps>`
7✔
32
  width: 100%;
33
  padding: ${props => props.theme.inputPadding};
×
34
  color: ${props => (props.error ? 'red' : props.theme.titleColorLT)};
×
35
  height: ${props => props.theme.inputBoxHeight};
×
36
  outline: 0;
37
  font-size: ${props => props.theme.inputFontSize};
×
38

39
  &:active,
40
  &:focus,
41
  &.focus,
42
  &.active {
43
    outline: 0;
44
  }
45
`;
46

47
const BigStyledTile = styled(StyledType)`
7✔
48
  height: unset;
49
  width: unset;
50
  img {
51
    width: 180px;
52
    height: 120px;
53
  }
54
`;
55

56
type ExportHtmlMapProps = {
57
  onChangeExportMapHTMLMode: ActionHandler<typeof setExportHTMLMapMode>;
58
  onEditUserMapboxAccessToken: ActionHandler<typeof setUserMapboxAccessToken>;
59
  options: {
60
    userMapboxToken?: string;
61
    mode?: string;
62
  };
63
};
64

65
type IntlProps = {
66
  intl: IntlShape;
67
};
68

69
function ExportHtmlMapFactory(): React.ComponentType<ExportHtmlMapProps> {
70
  /** @type {typeof import('./export-html-map').ExportHtmlMap} */
71
  const ExportHtmlMap: React.FC<ExportHtmlMapProps & IntlProps> = ({
14✔
72
    onChangeExportMapHTMLMode = () => {
×
73
      return;
×
74
    },
75
    onEditUserMapboxAccessToken = () => {
×
76
      return;
×
77
    },
78
    options = {},
×
79
    intl
80
  }) => (
81
    <div>
×
82
      <StyledExportMapSection>
83
        <div className="description" />
84
        <div className="selection">
85
          <FormattedMessage id={'modal.exportMap.html.selection'} />
86
        </div>
87
      </StyledExportMapSection>
88
      <ExportMapStyledExportSection className="export-map-modal__html-options">
89
        <div className="description">
90
          <div className="title">
91
            <FormattedMessage id={'modal.exportMap.html.tokenTitle'} />
92
          </div>
93
          <div className="subtitle">
94
            <FormattedMessage id={'modal.exportMap.html.tokenSubtitle'} />
95
          </div>
96
        </div>
97
        <div className="selection">
98
          <StyledInput
99
            onChange={e => onEditUserMapboxAccessToken(e.target.value)}
×
100
            type="text"
101
            placeholder={intl.formatMessage({id: 'modal.exportMap.html.tokenPlaceholder'})}
102
            value={options ? options.userMapboxToken : ''}
×
103
          />
104
          <div className="disclaimer">
105
            <StyledWarning>
106
              <FormattedMessage id={'modal.exportMap.html.tokenMisuseWarning'} />
107
            </StyledWarning>
108
            <StyledWarning>
109
              <FormattedMessage id={'modal.exportMap.html.tokenSecurityWarning'} />
110
            </StyledWarning>
111
            <FormattedMessage id={'modal.exportMap.html.tokenDisclaimer'} />
112
            <ExportMapLink href={EXPORT_HTML_MAP_DOC}>
113
              <FormattedMessage id={'modal.exportMap.html.tokenUpdate'} />
114
            </ExportMapLink>
115
          </div>
116
        </div>
117
      </ExportMapStyledExportSection>
118
      <ExportMapStyledExportSection>
119
        <div className="description">
120
          <div className="title">
121
            <FormattedMessage id={'modal.exportMap.html.modeTitle'} />
122
          </div>
123
          <div className="subtitle">
124
            <FormattedMessage id={'modal.exportMap.html.modeSubtitle1'} />
125
            <a href={EXPORT_HTML_MAP_MODES_DOC}>
126
              <FormattedMessage id={'modal.exportMap.html.modeSubtitle2'} />
127
            </a>
128
          </div>
129
        </div>
130
        <div className="selection">
131
          {EXPORT_HTML_MAP_MODE_OPTIONS.map(mode => (
132
            <BigStyledTile
×
133
              key={mode.id}
134
              selected={options.mode === mode.id}
135
              onClick={() => mode.available && onChangeExportMapHTMLMode(mode.id)}
×
136
            >
137
              <img src={mode.url} alt="" />
138
              <p>
139
                <FormattedMessage
140
                  id={'modal.exportMap.html.modeDescription'}
141
                  values={{mode: intl.formatMessage({id: mode.label})}}
142
                />
143
              </p>
144
              {options.mode === mode.id && <CheckMark />}
×
145
            </BigStyledTile>
146
          ))}
147
        </div>
148
      </ExportMapStyledExportSection>
149
    </div>
150
  );
151

152
  ExportHtmlMap.displayName = 'ExportHtmlMap';
14✔
153

154
  return injectIntl(ExportHtmlMap);
14✔
155
}
156

157
export default ExportHtmlMapFactory;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc