@xyo-network/react-map 2.49.1 → 2.49.2
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.
- package/dist/docs.json +246 -246
- package/package.json +5 -5
- package/src/Components/MapBox.stories.tsx +30 -32
package/package.json
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"@xyo-network/archivist": "^2.56.0",
|
|
20
20
|
"@xyo-network/module": "^2.56.0",
|
|
21
21
|
"@xyo-network/payload-model": "^2.56.0",
|
|
22
|
-
"@xyo-network/react-app-settings": "^2.49.
|
|
23
|
-
"@xyo-network/react-archivist": "^2.49.
|
|
24
|
-
"@xyo-network/react-network": "^2.49.
|
|
25
|
-
"@xyo-network/react-shared": "^2.49.
|
|
22
|
+
"@xyo-network/react-app-settings": "^2.49.2",
|
|
23
|
+
"@xyo-network/react-archivist": "^2.49.2",
|
|
24
|
+
"@xyo-network/react-network": "^2.49.2",
|
|
25
|
+
"@xyo-network/react-shared": "^2.49.2",
|
|
26
26
|
"@xyo-network/sdk-geo": "^2.8.0",
|
|
27
27
|
"geojson": "^0.5.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
},
|
|
88
88
|
"sideEffects": false,
|
|
89
89
|
"types": "dist/types/index.d.ts",
|
|
90
|
-
"version": "2.49.
|
|
90
|
+
"version": "2.49.2"
|
|
91
91
|
}
|
|
@@ -22,34 +22,6 @@ const WithMapboxProviders: Decorator = (Story, props) => {
|
|
|
22
22
|
)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const ContainerResizeTemplate: StoryFn<typeof MapBox> = (args) => {
|
|
26
|
-
const containerRef = useRef<HTMLDivElement | null>()
|
|
27
|
-
const handleClick = () => {
|
|
28
|
-
if (containerRef.current) {
|
|
29
|
-
const containerWidth = containerRef.current.style.minWidth
|
|
30
|
-
if (containerWidth === '100%') {
|
|
31
|
-
containerRef.current.style.minWidth = '50%'
|
|
32
|
-
} else {
|
|
33
|
-
containerRef.current.style.minWidth = '100%'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<FlexGrowCol rowGap={2} alignItems="start">
|
|
40
|
-
<Button variant="contained" sx={{ my: 1 }} onClick={handleClick}>
|
|
41
|
-
Toggle Container minWidth
|
|
42
|
-
</Button>
|
|
43
|
-
<div
|
|
44
|
-
ref={(ref) => (containerRef.current = ref)}
|
|
45
|
-
style={{ minHeight: 'calc(100vh - 2rem)', minWidth: '100%', position: 'relative', transition: 'min-width 300ms ease' }}
|
|
46
|
-
>
|
|
47
|
-
<MapBox {...args} />
|
|
48
|
-
</div>
|
|
49
|
-
</FlexGrowCol>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
25
|
const WithMapSettingsDecorator: Decorator = (Story, args) => {
|
|
54
26
|
return (
|
|
55
27
|
<>
|
|
@@ -61,10 +33,8 @@ const WithMapSettingsDecorator: Decorator = (Story, args) => {
|
|
|
61
33
|
|
|
62
34
|
// eslint-disable-next-line import/no-default-export
|
|
63
35
|
export default {
|
|
64
|
-
|
|
65
|
-
accessToken:
|
|
66
|
-
defaultValue: process.env.STORYBOOK_MAPBOX_TOKEN,
|
|
67
|
-
},
|
|
36
|
+
args: {
|
|
37
|
+
accessToken: process.env.STORYBOOK_MAPBOX_TOKEN,
|
|
68
38
|
},
|
|
69
39
|
component: MapBox,
|
|
70
40
|
decorators: [WithMapboxProviders],
|
|
@@ -84,6 +54,34 @@ const Template: StoryFn<typeof MapBox> = (args) => {
|
|
|
84
54
|
)
|
|
85
55
|
}
|
|
86
56
|
|
|
57
|
+
const ContainerResizeTemplate: StoryFn<typeof MapBox> = (args) => {
|
|
58
|
+
const containerRef = useRef<HTMLDivElement | null>()
|
|
59
|
+
const handleClick = () => {
|
|
60
|
+
if (containerRef.current) {
|
|
61
|
+
const containerWidth = containerRef.current.style.minWidth
|
|
62
|
+
if (containerWidth === '100%') {
|
|
63
|
+
containerRef.current.style.minWidth = '50%'
|
|
64
|
+
} else {
|
|
65
|
+
containerRef.current.style.minWidth = '100%'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<FlexGrowCol rowGap={2} alignItems="start">
|
|
72
|
+
<Button variant="contained" sx={{ my: 1 }} onClick={handleClick}>
|
|
73
|
+
Toggle Container minWidth
|
|
74
|
+
</Button>
|
|
75
|
+
<div
|
|
76
|
+
ref={(ref) => (containerRef.current = ref)}
|
|
77
|
+
style={{ minHeight: 'calc(100vh - 2rem)', minWidth: '100%', position: 'relative', transition: 'min-width 300ms ease' }}
|
|
78
|
+
>
|
|
79
|
+
<MapBox {...args} />
|
|
80
|
+
</div>
|
|
81
|
+
</FlexGrowCol>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
87
85
|
const Default = Template.bind({})
|
|
88
86
|
Default.args = {}
|
|
89
87
|
|