@deck.gl/react 8.9.16 → 8.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,9 +47,9 @@ function isComponent(child) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function isReactMap(child) {
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
return
|
|
50
|
+
var _child$props;
|
|
51
|
+
|
|
52
|
+
return (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.mapStyle;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function needsDeckGLViewProps(child) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/evaluate-children.ts"],"names":["MAP_STYLE","position","zIndex","evaluateChildren","children","childProps","Array","isArray","map","child","isComponent","isReactMap","style","needsDeckGLViewProps","
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/evaluate-children.ts"],"names":["MAP_STYLE","position","zIndex","evaluateChildren","children","childProps","Array","isArray","map","child","isComponent","isReactMap","style","needsDeckGLViewProps","props","mapStyle","componentClass","type","deckGLViewProps"],"mappings":";;;;;;;;;;;;AACA;;AAEA,IAAMA,SAAS,GAAG;AAACC,EAAAA,QAAQ,EAAE,UAAX;AAAuBC,EAAAA,MAAM,EAAE,CAAC;AAAhC,CAAlB;;AAEe,SAASC,gBAAT,CACbC,QADa,EAEbC,UAFa,EAGI;AACjB,MAAI,OAAOD,QAAP,KAAoB,UAAxB,EAAoC;AAClC,WAAOA,QAAQ,CAACC,UAAD,CAAf;AACD;;AACD,MAAIC,KAAK,CAACC,OAAN,CAAcH,QAAd,CAAJ,EAA6B;AAC3B,WAAOA,QAAQ,CAACI,GAAT,CAAa,UAAAC,KAAK;AAAA,aAAIN,gBAAgB,CAACM,KAAD,EAAQJ,UAAR,CAApB;AAAA,KAAlB,CAAP;AACD;;AACD,MAAIK,WAAW,CAACN,QAAD,CAAf,EAA2B;AAGzB,QAAIO,UAAU,CAACP,QAAD,CAAd,EAA0B;AAExBC,MAAAA,UAAU,CAACO,KAAX,GAAmBZ,SAAnB;AACA,aAAO,yBAAaI,QAAb,EAAuBC,UAAvB,CAAP;AACD;;AACD,QAAIQ,oBAAoB,CAACT,QAAD,CAAxB,EAAoC;AAClC,aAAO,yBAAaA,QAAb,EAAuBC,UAAvB,CAAP;AACD;AACF;;AAED,SAAOD,QAAP;AACD;;AAEM,SAASM,WAAT,CAAqBD,KAArB,EAA0E;AAC/E,SAAQA,KAAK,IAAI,sBAAOA,KAAP,MAAiB,QAA1B,IAAsC,UAAUA,KAAjD,IAA2D,KAAlE;AACD;;AAED,SAASE,UAAT,CAAoBF,KAApB,EAAwD;AAAA;;AACtD,yBAAOA,KAAK,CAACK,KAAb,iDAAO,aAAaC,QAApB;AACD;;AAED,SAASF,oBAAT,CAA8BJ,KAA9B,EAAkE;AAChE,MAAMO,cAAc,GAAGP,KAAK,CAACQ,IAA7B;AAEA,SAAOD,cAAc,IAAIA,cAAc,CAACE,eAAxC;AACD","sourcesContent":["import * as React from 'react';\nimport {cloneElement} from 'react';\n\nconst MAP_STYLE = {position: 'absolute', zIndex: -1};\n\nexport default function evaluateChildren(\n children: React.ReactNode | Function,\n childProps: any\n): React.ReactNode {\n if (typeof children === 'function') {\n return children(childProps);\n }\n if (Array.isArray(children)) {\n return children.map(child => evaluateChildren(child, childProps));\n }\n if (isComponent(children)) {\n // Special treatment for react-map-gl's Map component\n // to support shorthand use case <DeckGL><StaticMap /></DeckGL>\n if (isReactMap(children)) {\n // Place map under the canvas\n childProps.style = MAP_STYLE;\n return cloneElement(children, childProps);\n }\n if (needsDeckGLViewProps(children)) {\n return cloneElement(children, childProps);\n }\n }\n\n return children;\n}\n\nexport function isComponent(child: React.ReactNode): child is React.ReactElement {\n return (child && typeof child === 'object' && 'type' in child) || false;\n}\n\nfunction isReactMap(child: React.ReactElement): boolean {\n return child.props?.mapStyle;\n}\n\nfunction needsDeckGLViewProps(child: React.ReactElement): boolean {\n const componentClass = child.type;\n // @ts-expect-error deckGLViewProps is a custom hack defined on the constructor (nebula.gl)\n return componentClass && componentClass.deckGLViewProps;\n}\n"],"file":"evaluate-children.js"}
|
|
@@ -30,9 +30,9 @@ export function isComponent(child) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function isReactMap(child) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
33
|
+
var _child$props;
|
|
34
|
+
|
|
35
|
+
return (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.mapStyle;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function needsDeckGLViewProps(child) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/evaluate-children.ts"],"names":["cloneElement","MAP_STYLE","position","zIndex","evaluateChildren","children","childProps","Array","isArray","map","child","isComponent","isReactMap","style","needsDeckGLViewProps","
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/evaluate-children.ts"],"names":["cloneElement","MAP_STYLE","position","zIndex","evaluateChildren","children","childProps","Array","isArray","map","child","isComponent","isReactMap","style","needsDeckGLViewProps","props","mapStyle","componentClass","type","deckGLViewProps"],"mappings":"AACA,SAAQA,YAAR,QAA2B,OAA3B;AAEA,MAAMC,SAAS,GAAG;AAACC,EAAAA,QAAQ,EAAE,UAAX;AAAuBC,EAAAA,MAAM,EAAE,CAAC;AAAhC,CAAlB;AAEA,eAAe,SAASC,gBAAT,CACbC,QADa,EAEbC,UAFa,EAGI;AACjB,MAAI,OAAOD,QAAP,KAAoB,UAAxB,EAAoC;AAClC,WAAOA,QAAQ,CAACC,UAAD,CAAf;AACD;;AACD,MAAIC,KAAK,CAACC,OAAN,CAAcH,QAAd,CAAJ,EAA6B;AAC3B,WAAOA,QAAQ,CAACI,GAAT,CAAaC,KAAK,IAAIN,gBAAgB,CAACM,KAAD,EAAQJ,UAAR,CAAtC,CAAP;AACD;;AACD,MAAIK,WAAW,CAACN,QAAD,CAAf,EAA2B;AAGzB,QAAIO,UAAU,CAACP,QAAD,CAAd,EAA0B;AAExBC,MAAAA,UAAU,CAACO,KAAX,GAAmBZ,SAAnB;AACA,aAAOD,YAAY,CAACK,QAAD,EAAWC,UAAX,CAAnB;AACD;;AACD,QAAIQ,oBAAoB,CAACT,QAAD,CAAxB,EAAoC;AAClC,aAAOL,YAAY,CAACK,QAAD,EAAWC,UAAX,CAAnB;AACD;AACF;;AAED,SAAOD,QAAP;AACD;AAED,OAAO,SAASM,WAAT,CAAqBD,KAArB,EAA0E;AAC/E,SAAQA,KAAK,IAAI,OAAOA,KAAP,KAAiB,QAA1B,IAAsC,UAAUA,KAAjD,IAA2D,KAAlE;AACD;;AAED,SAASE,UAAT,CAAoBF,KAApB,EAAwD;AAAA;;AACtD,yBAAOA,KAAK,CAACK,KAAb,iDAAO,aAAaC,QAApB;AACD;;AAED,SAASF,oBAAT,CAA8BJ,KAA9B,EAAkE;AAChE,QAAMO,cAAc,GAAGP,KAAK,CAACQ,IAA7B;AAEA,SAAOD,cAAc,IAAIA,cAAc,CAACE,eAAxC;AACD","sourcesContent":["import * as React from 'react';\nimport {cloneElement} from 'react';\n\nconst MAP_STYLE = {position: 'absolute', zIndex: -1};\n\nexport default function evaluateChildren(\n children: React.ReactNode | Function,\n childProps: any\n): React.ReactNode {\n if (typeof children === 'function') {\n return children(childProps);\n }\n if (Array.isArray(children)) {\n return children.map(child => evaluateChildren(child, childProps));\n }\n if (isComponent(children)) {\n // Special treatment for react-map-gl's Map component\n // to support shorthand use case <DeckGL><StaticMap /></DeckGL>\n if (isReactMap(children)) {\n // Place map under the canvas\n childProps.style = MAP_STYLE;\n return cloneElement(children, childProps);\n }\n if (needsDeckGLViewProps(children)) {\n return cloneElement(children, childProps);\n }\n }\n\n return children;\n}\n\nexport function isComponent(child: React.ReactNode): child is React.ReactElement {\n return (child && typeof child === 'object' && 'type' in child) || false;\n}\n\nfunction isReactMap(child: React.ReactElement): boolean {\n return child.props?.mapStyle;\n}\n\nfunction needsDeckGLViewProps(child: React.ReactElement): boolean {\n const componentClass = child.type;\n // @ts-expect-error deckGLViewProps is a custom hack defined on the constructor (nebula.gl)\n return componentClass && componentClass.deckGLViewProps;\n}\n"],"file":"evaluate-children.js"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@deck.gl/react",
|
|
3
3
|
"description": "React Components for deck.gl",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "8.9.
|
|
5
|
+
"version": "8.9.18",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"react": ">=16.3",
|
|
32
32
|
"react-dom": ">=16.3"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "e581cda7ad4df20fb3706023d64216e07ac78692"
|
|
35
35
|
}
|
|
@@ -34,10 +34,7 @@ export function isComponent(child: React.ReactNode): child is React.ReactElement
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function isReactMap(child: React.ReactElement): boolean {
|
|
37
|
-
|
|
38
|
-
// @ts-expect-error defaultProps is not defined on JSXElementConstructor
|
|
39
|
-
const componentProps = componentClass && componentClass.defaultProps;
|
|
40
|
-
return componentProps && componentProps.mapStyle;
|
|
37
|
+
return child.props?.mapStyle;
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
function needsDeckGLViewProps(child: React.ReactElement): boolean {
|