diff --git a/docs/components/api-item.js b/docs/components/api-item.js index c8c500bc92f..a5ef44217d2 100644 --- a/docs/components/api-item.js +++ b/docs/components/api-item.js @@ -6,6 +6,8 @@ import {highlightJavascript} from '../components/prism_highlight.js'; import docs from '../components/api.json'; // eslint-disable-line import/no-unresolved import ApiItemMember from './api-item-member'; import IconText from '@mapbox/mr-ui/icon-text'; +import Feedback from '@mapbox/dr-ui/feedback'; +import constants from '../constants'; const linkerStack = new LinkerStack({}) .namespaceResolver(docs, (namespace) => { @@ -17,6 +19,21 @@ const formatters = createFormatters(linkerStack.link); class ApiItem extends React.Component { + constructor(props) { + super(props); + this.state = { + userName: undefined + }; + } + + componentDidMount() { + MapboxPageShell.afterUserCheck(() => { + this.setState({ userName: MapboxPageShell.getUser() ? + MapboxPageShell.getUser().id : + undefined}); + }); + } + md = (ast, inline) => { if (inline && ast && ast.children.length && ast.children[0].type === 'paragraph') { ast = { @@ -160,6 +177,17 @@ class ApiItem extends React.Component {
Related
} + +
+ +
); } diff --git a/docs/components/example.js b/docs/components/example.js index bcd8a217376..fad1b9814ef 100644 --- a/docs/components/example.js +++ b/docs/components/example.js @@ -6,6 +6,8 @@ import Prism from 'prismjs'; import supported from '@mapbox/mapbox-gl-supported'; import Icon from '@mapbox/mr-ui/icon'; import CodeSnippet from '@mapbox/mr-ui/code-snippet'; +import Feedback from '@mapbox/dr-ui/feedback'; +import constants from '../constants'; const highlightTheme = require('raw-loader!@mapbox/dr-ui/css/prism.css'); // eslint-disable-line import/no-commonjs @@ -15,7 +17,8 @@ export default function (html) { super(props); this.state = { filter: '', - token: undefined + token: undefined, + userName: undefined }; } @@ -101,6 +104,15 @@ ${html} +
+ +
); } @@ -113,7 +125,9 @@ ${html} doc.close(); MapboxPageShell.afterUserCheck(() => { - this.setState({token: MapboxPageShell.getUserPublicAccessToken()}); + this.setState({token: MapboxPageShell.getUserPublicAccessToken(), userName: MapboxPageShell.getUser() ? + MapboxPageShell.getUser().id : + undefined}); }); } diff --git a/docs/components/markdown-page-shell.js b/docs/components/markdown-page-shell.js index 0b8947cf456..11c97a370de 100644 --- a/docs/components/markdown-page-shell.js +++ b/docs/components/markdown-page-shell.js @@ -1,7 +1,26 @@ import React from 'react'; import PageShell from './page_shell'; +import Feedback from '@mapbox/dr-ui/feedback'; +import constants from '../constants'; class MarkdownPageshell extends React.Component { + constructor(props) { + super(props); + this.state = { + userName: undefined + }; + } + + componentDidMount() { + MapboxPageShell.afterUserCheck(() => { + // fetches username so we can identify them in segment + this.setState({ + userName: MapboxPageShell.getUser() ? + MapboxPageShell.getUser().id : + undefined + }); + }); + } render() { const { frontMatter, location } = this.props; const meta = this.props.meta || {}; @@ -22,6 +41,14 @@ class MarkdownPageshell extends React.Component {
{this.props.children}
+
+ +
); } diff --git a/docs/constants.json b/docs/constants.json new file mode 100644 index 00000000000..261d5e6afac --- /dev/null +++ b/docs/constants.json @@ -0,0 +1,6 @@ +{ + "FORWARD_EVENT_WEBHOOK": { + "staging": "https://fbtme2z025.execute-api.us-east-1.amazonaws.com/hookshot/webhook", + "production": "https://2n40g6lyc9.execute-api.us-east-1.amazonaws.com/hookshot/webhook" + } +} diff --git a/docs/pages/api.js b/docs/pages/api.js index bca7d6fa9da..bfad153e632 100644 --- a/docs/pages/api.js +++ b/docs/pages/api.js @@ -66,7 +66,7 @@ export default class extends React.Component {
{docs.map((doc, i) => doc.kind === 'note' ? : - )} + )}
diff --git a/docs/pages/style-spec.js b/docs/pages/style-spec.js index 6db94b1e2ab..0932b79b51e 100644 --- a/docs/pages/style-spec.js +++ b/docs/pages/style-spec.js @@ -8,6 +8,8 @@ import {highlightJavascript, highlightJSON} from '../components/prism_highlight' import entries from 'object.entries'; import ref from '../../src/style-spec/reference/latest'; import Icon from '@mapbox/mr-ui/icon'; +import Feedback from '@mapbox/dr-ui/feedback'; +import constants from '../constants'; const meta = { title: 'Style Specification', @@ -68,6 +70,20 @@ function renderParams(params, maxLength) { } class SectionH2 extends React.Component { + constructor(props) { + super(props); + this.state = { + userName: undefined + }; + } + + componentDidMount() { + MapboxPageShell.afterUserCheck(() => { + this.setState({ userName: MapboxPageShell.getUser() ? + MapboxPageShell.getUser().id : + undefined}); + }); + } render() { const {props} = this; return ( @@ -75,12 +91,23 @@ class SectionH2 extends React.Component {

{props.title}

{this.props.children} +
+ +
); } } class SectionH3 extends React.Component { + render() { const {props} = this; return ( @@ -233,6 +260,7 @@ class Item extends React.Component { } export default class extends React.Component { + render() { return ( @@ -255,7 +283,7 @@ export default class extends React.Component {

For platform-appropriate documentation of style-related features, developers using the Mapbox Maps SDK for iOS should consult the iOS SDK API reference, and developers using the Mapbox Maps SDK for macOS should consult the macOS SDK API reference.

- +

Root level properties of a Mapbox style specify the map's layers, tile sources and other resources, and default values for the initial camera position when not specified elsewhere.

@@ -276,7 +304,7 @@ export default class extends React.Component {
- +

A style's light property provides global light source for that style.

@@ -288,7 +316,7 @@ export default class extends React.Component {
- +

Sources supply data to be shown on the map. The type of source is specified by the "type" property, and must be one of {sourceTypes.map((t, i) => {t}).reduce((prev, curr) => [prev, ', ', curr])}. @@ -561,7 +589,7 @@ export default class extends React.Component { - +

A style's sprite property supplies a URL template for loading small images to use in rendering background-pattern, fill-pattern, line-pattern, @@ -618,7 +646,7 @@ export default class extends React.Component {

- +

A style's glyphs property provides a URL template for loading signed-distance-field glyph sets in PBF format.

@@ -643,7 +671,7 @@ export default class extends React.Component {
- +

A transition property controls timing for the interpolation between a transitionable style property's previous value and new value. A style's @@ -659,7 +687,7 @@ export default class extends React.Component { - +

A style's layers property lists all of the layers available in that style. The type of layer is specified by the "type" property, and must be one of {layerTypes.map((t, i) => {t}).reduce((prev, curr) => [prev, ', ', curr])}. @@ -700,7 +728,7 @@ export default class extends React.Component { - +

A Mapbox style contains values of various types, most commonly as values for the style properties of a layer.

@@ -764,7 +792,7 @@ export default class extends React.Component { - +

The value for any layout property, paint property, or filter may be specified as an expression. An expression defines a formula for computing the @@ -1037,7 +1065,7 @@ export default class extends React.Component { - +

The value for any layout or paint property may be specified as a function. Functions allow you to make the appearance of a map feature @@ -1273,7 +1301,7 @@ export default class extends React.Component { - +

In previous versions of the style specification, filters were defined using the deprecated syntax documented below. Though filters defined with this syntax will continue to work, we recommend using the more flexible expression syntax instead. Expression syntax and the deprecated syntax below cannot be mixed in a single filter definition.

diff --git a/package.json b/package.json index 0ce9f2cf91e..263a7ab4e9f 100644 --- a/package.json +++ b/package.json @@ -42,13 +42,13 @@ "@mapbox/appropriate-images": "^2.0.0", "@mapbox/appropriate-images-react": "^1.0.0", "@mapbox/batfish": "1.9.8", - "@mapbox/dr-ui": "0.16.2", + "@mapbox/dr-ui": "0.19.0", "@mapbox/flow-remove-types": "^1.3.0-await.upstream.2", "@mapbox/gazetteer": "^3.1.2", "@mapbox/mapbox-gl-rtl-text": "^0.2.1", "@mapbox/mapbox-gl-test-suite": "file:test/integration", "@mapbox/mbx-assembly": "^0.28.2", - "@mapbox/mr-ui": "0.7.1", + "@mapbox/mr-ui": "0.7.2", "@octokit/rest": "^15.15.1", "babel-eslint": "^10.0.1", "benchmark": "^2.1.4", diff --git a/yarn.lock b/yarn.lock index a066474355d..8f7db480323 100644 --- a/yarn.lock +++ b/yarn.lock @@ -814,14 +814,6 @@ "@babel/helper-regex" "^7.4.3" regexpu-core "^4.5.4" -"@babel/polyfill@^7.2.5": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.4.4.tgz#78801cf3dbe657844eeabf31c1cae3828051e893" - integrity sha512-WlthFLfhQQhh+A2Gn5NSFl0Huxz36x86Jn+E9OW7ibK8edKPq+KLy4apM1yDpQ8kJOVi1OVjpP4vSDLdrI04dg== - dependencies: - core-js "^2.6.5" - regenerator-runtime "^0.13.2" - "@babel/preset-env@^7.1.0": version "7.4.3" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.3.tgz#e71e16e123dc0fbf65a52cbcbcefd072fbd02880" @@ -900,7 +892,7 @@ resolved "https://registry.yarnpkg.com/@babel/preset-stage-0/-/preset-stage-0-7.0.0.tgz#999aaec79ee8f0a763042c68c06539c97c6e0646" integrity sha512-FBMd0IiARPtH5aaOFUVki6evHiJQiY0pFy7fizyRF7dtwc+el3nwpzvhb9qBNzceG1OIJModG1xpE0DDFjPXwA== -"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.2": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.2", "@babel/runtime@^7.5.4": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== @@ -940,45 +932,41 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" -"@elastic/react-search-ui-views@0.10.0", "@elastic/react-search-ui-views@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@elastic/react-search-ui-views/-/react-search-ui-views-0.10.0.tgz#4ae423e0a10592d11c1083ee9875b40fec040a09" - integrity sha512-g2BZDa1XLVSZJf6bqeMXsrufaxUQyTfzxFvVhvMUn7IumkXXsZISqu0CvGT5esDoV9m8ipaB6hgZjA28+t1D5A== +"@elastic/react-search-ui-views@1.0.0", "@elastic/react-search-ui-views@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@elastic/react-search-ui-views/-/react-search-ui-views-1.0.0.tgz#b170d68685048031abb92df73fe9ee41cf663c06" + integrity sha512-kcIGvxqs4AFtQ8J8mxoJHwV9AkYJE3DX5Jc+LDoKzp8GXi55WqtcO9jPCbTBvK9spZicYyA3WUhA2438lQe20w== dependencies: - "@babel/polyfill" "^7.2.5" + "@babel/runtime" "^7.5.4" autoprefixer "^9.4.7" - core-js "^2.6.9" deep-equal "^1.0.1" downshift "^3.2.7" rc-pagination "^1.17.3" react-select "^2.1.1" -"@elastic/react-search-ui@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@elastic/react-search-ui/-/react-search-ui-0.10.0.tgz#c65343f44d84d9af83876d15047e5bfa7140bab9" - integrity sha512-YfSqLND2OqQw37OiEk3ugKptvQ0TRpTVTO2mKpwctRWs9HQMMfdTZf21PkLe8mowylWqz1VH7wCqsV87Xg5Rnw== +"@elastic/react-search-ui@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@elastic/react-search-ui/-/react-search-ui-1.0.0.tgz#e3c48ef021362c643fe1b25800a3f4b8b5aaf978" + integrity sha512-r2oLZL8mhT5xNZNXB7mV8a2QwAJuOHTa76Lgb10Kob9fD1fM1BfRCS+ffM7klx4IcJ3L43OF5KXo6GwrGcGZyA== dependencies: - "@babel/polyfill" "^7.2.5" - "@elastic/react-search-ui-views" "0.10.0" - "@elastic/search-ui" "0.10.0" - core-js "^2.6.9" + "@babel/runtime" "^7.5.4" + "@elastic/react-search-ui-views" "1.0.0" + "@elastic/search-ui" "1.0.0" debounce-fn "^1.0.0" -"@elastic/search-ui-site-search-connector@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@elastic/search-ui-site-search-connector/-/search-ui-site-search-connector-0.10.0.tgz#b3b705214a7bc690c45cdd4ed4a20608554b74fa" - integrity sha512-ZTxV57vhrGRdIQc3B/fjJJu9kh9JFLW3GVgNT5pn/CAg9q1TGO/+6/AMqBNWBrGWQNEY8x5qHobqbDTrea09HQ== +"@elastic/search-ui-site-search-connector@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@elastic/search-ui-site-search-connector/-/search-ui-site-search-connector-1.0.0.tgz#0a221e7214f68e828962dc8c149437313963817a" + integrity sha512-I8uQL7uo2bnCft/7ruvMov0zqlM2tmMIAD3scs21P6wmiUUjG9UUX6Hv7GygcmTA/0gAVTEracjgqLH1CKDWSA== dependencies: - "@babel/polyfill" "^7.2.5" - core-js "^2.6.9" + "@babel/runtime" "^7.5.4" -"@elastic/search-ui@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@elastic/search-ui/-/search-ui-0.10.0.tgz#bcf86faaa12f5c16655397cf64f93056bf618a0a" - integrity sha512-5pMbeY/sodixMXh8aaJjUcey8FM7iV5I7gtRbXHjz9VY2mb3MdO88gHxKVYYb4PWzNQn+s2tzsaYiw2Cvgkkaw== +"@elastic/search-ui@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@elastic/search-ui/-/search-ui-1.0.0.tgz#90b202676215937c86707b5125e1b9bd8e75f27c" + integrity sha512-Dg5xtfIxAHNWNYyW2jI1Mda4llleVBp3Yise3zTdGhNhzP30Ewgb3idaCFdxbd28WNEL/sHCI8reTxZA3itLsQ== dependencies: - "@babel/polyfill" "^7.2.5" - core-js "^2.6.9" + "@babel/runtime" "^7.5.4" date-fns "^1.29.0" debounce-fn "^1.0.0" deep-equal "^1.0.1" @@ -1174,22 +1162,24 @@ webpack-merge "^4.1.2" worker-farm "^1.6.0" -"@mapbox/dr-ui@0.16.2": - version "0.16.2" - resolved "https://registry.yarnpkg.com/@mapbox/dr-ui/-/dr-ui-0.16.2.tgz#82e3f69bc0fa59a7a514ca8747b4845a7adcf688" - integrity sha512-Wsio/ieF5OZ91lrHjZ0hCpjALiMRXFj8KkMmjaI+E3voZ8bFZZPySHfJQT75NZG66OHBhH1klsJMKnZUpql38A== +"@mapbox/dr-ui@0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@mapbox/dr-ui/-/dr-ui-0.19.0.tgz#cd5a89f91370633e1eda697b9f6147d8991b1141" + integrity sha512-bRA6dQUtJ582Eja9cfJ10oM4C+Kb9rT7KYYcT2yku/QsqchSMceW7eJekzG4fffU7PL49+7Iwnzxa0QiMLmxKQ== dependencies: - "@elastic/react-search-ui" "^0.10.0" - "@elastic/react-search-ui-views" "^0.10.0" - "@elastic/search-ui-site-search-connector" "^0.10.0" + "@elastic/react-search-ui" "^1.0.0" + "@elastic/react-search-ui-views" "^1.0.0" + "@elastic/search-ui-site-search-connector" "^1.0.0" "@mapbox/mr-ui" "^0.7.0" classnames "^2.2.6" + compare-versions "^3.4.0" debounce "^1.2.0" downshift "^3.2.7" hastscript "^5.0.0" react-html-parser "^2.0.2" react-stickynode "^2.1.1" rehype-sectionize-headings "^1.0.0-rc.1" + uuid "^3.3.2" "@mapbox/flow-remove-types@^1.3.0-await.upstream.2": version "1.3.0-await.upstream.2" @@ -1335,29 +1325,7 @@ postcss-custom-media "^6.0.0" postcss-custom-properties "^7.0.0" -"@mapbox/mr-ui@0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@mapbox/mr-ui/-/mr-ui-0.7.1.tgz#832974fc2984a0af8678992d64ab11edeec18d44" - integrity sha512-ii3jiWjq4pCzXN9u+HxjyhLVR06lGt3bA9iMcxK5JwuWk+/qgDwUTZKsfKMij/MHyVKoucLxTk/DxxC8O1rPIA== - dependencies: - "@mapbox/query-selector-contains-node" "^1.0.0" - classnames "^2.2.6" - clipboard "^2.0.0" - debounce "^1.1.0" - focus-trap "^3.0.0" - hoverintent "^2.0.0" - os-key "^1.0.0" - prefix "^1.0.0" - react-aria-modal "^3.0.0" - react-datepicker "^0.60.2" - react-displace "^2.3.0" - react-submittable "^2.0.0" - select "^1.1.2" - shallow-equal "^1.0.0" - tabbable "^3.1.1" - xtend "^4.0.0" - -"@mapbox/mr-ui@^0.7.0": +"@mapbox/mr-ui@0.7.2", "@mapbox/mr-ui@^0.7.0": version "0.7.2" resolved "https://registry.yarnpkg.com/@mapbox/mr-ui/-/mr-ui-0.7.2.tgz#32ce7f7777890a8efd91f6593ac458ff9ee30c73" integrity sha512-gBUaM3Tr3ORirkNuuDt64FCTHOtVAT/tmEfxMOWvOmdEAH6YzOOm2ZzD+w1A88NhXsI/QAqWxx3d7xuIIOLelA== @@ -4053,6 +4021,11 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= +compare-versions@^3.4.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.5.0.tgz#85fc22a1ae9612ff730d77fb092295acd056d311" + integrity sha512-hX+4kt2Rcwu+x1U0SsEFCn1quURjEjPEGH/cPBlpME/IidGimAdwfMU+B+xDr7et/KTR7VH2+ZqWGerv4NGs2w== + component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -4237,11 +4210,6 @@ core-js@^2.0.0, core-js@^2.4.0, core-js@^2.5.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== -core-js@^2.6.5, core-js@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" - integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== - core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -6678,13 +6646,6 @@ flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: inherits "^2.0.3" readable-stream "^2.3.6" -focus-trap-react@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/focus-trap-react/-/focus-trap-react-4.0.1.tgz#3cffd39341df3b2f546a4a2fe94cfdea66154683" - integrity sha512-UUZKVEn5cFbF6yUnW7lbXNW0iqN617ShSqYKgxctUvWw1wuylLtyVmC0RmPQNnJ/U+zoKc/djb0tZMs0uN/0QQ== - dependencies: - focus-trap "^3.0.0" - focus-trap-react@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/focus-trap-react/-/focus-trap-react-6.0.0.tgz#3f5a9f68447dd374d22388fb4c50018be83e74a5" @@ -11923,15 +11884,6 @@ rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-aria-modal@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/react-aria-modal/-/react-aria-modal-3.1.0.tgz#9b028113a69d649aec3ddd4ce5a53505b25acfa0" - integrity sha512-wTnKxbCe2uGRrHuxd//5mqIkMRskwr4QHWjISeVjOuyY8KNVjqAQ/iXGHN9OrWYqouKwE5r1RMcvX52wODwimA== - dependencies: - focus-trap-react "^4.0.0" - no-scroll "^2.1.1" - react-displace "^2.3.0" - react-aria-modal@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/react-aria-modal/-/react-aria-modal-4.0.0.tgz#b195e9ad6bd360b628c1853381ab4e7466d2328c" @@ -15884,4 +15836,4 @@ yn@^3.0.0: zwitch@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.3.tgz#159fae4b3f737db1e42bf321d3423e4c96688a18" - integrity sha512-aynRpmJDw7JIq6X4NDWJoiK1yVSiG57ArWSg4HLC1SFupX5/bo0Cf4jpX0ifwuzBfxpYBuNSyvMlWNNRuy3cVA== \ No newline at end of file + integrity sha512-aynRpmJDw7JIq6X4NDWJoiK1yVSiG57ArWSg4HLC1SFupX5/bo0Cf4jpX0ifwuzBfxpYBuNSyvMlWNNRuy3cVA==