react-three-map 0.2.1 → 0.3.0

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +14 -13
  3. package/dist/cjs/main.js.js +1 -1318
  4. package/dist/es/main.js2.mjs +24 -20
  5. package/dist/es/main.js2.mjs.map +1 -1
  6. package/dist/es/main.js3.mjs.map +1 -1
  7. package/dist/es/main.js4.mjs +12 -24
  8. package/dist/es/main.js4.mjs.map +1 -1
  9. package/dist/es/main.js5.mjs +55 -23532
  10. package/dist/es/main.js5.mjs.map +1 -1
  11. package/dist/es/main.js6.mjs +13 -2
  12. package/dist/es/main.js6.mjs.map +1 -1
  13. package/dist/es/main.js7.mjs +53 -2
  14. package/dist/es/main.js7.mjs.map +1 -1
  15. package/dist/es/main.js8.mjs +6 -57
  16. package/dist/es/main.js8.mjs.map +1 -1
  17. package/dist/maplibre/cjs/main.js.js +1 -1
  18. package/dist/maplibre/es/main.js2.mjs +24 -20
  19. package/dist/maplibre/es/main.js2.mjs.map +1 -1
  20. package/dist/maplibre/es/main.js3.mjs.map +1 -1
  21. package/dist/maplibre/es/main.js4.mjs +12 -24
  22. package/dist/maplibre/es/main.js4.mjs.map +1 -1
  23. package/dist/maplibre/es/main.js5.mjs.map +1 -1
  24. package/dist/maplibre/es/main.js6.mjs.map +1 -1
  25. package/dist/maplibre/es/main.js7.mjs.map +1 -1
  26. package/dist/maplibre/es/main.js8.mjs.map +1 -1
  27. package/example-mapbox/package.json +29 -0
  28. package/example-mapbox/sandbox.config.json +3 -0
  29. package/example-mapbox/src/canvas.basic.stories.tsx +69 -0
  30. package/example-mapbox/src/comparison.stories.tsx +24 -0
  31. package/example-mapbox/src/html-on-top.stories.tsx +24 -0
  32. package/example-mapbox/src/my-scene.tsx +96 -0
  33. package/example-mapbox/src/render-on-demand.stories.tsx +32 -0
  34. package/example-mapbox/src/story-map.tsx +46 -0
  35. package/example-mapbox/src/vite-env.d.ts +1 -0
  36. package/example-mapbox/tsconfig.json +27 -0
  37. package/example-mapbox/tsconfig.node.json +10 -0
  38. package/example-mapbox/yarn.lock +4154 -0
  39. package/example-maplibre/package.json +29 -0
  40. package/example-maplibre/sandbox.config.json +3 -0
  41. package/example-maplibre/src/canvas.basic.stories.tsx +61 -0
  42. package/example-maplibre/src/comparison.stories.tsx +22 -0
  43. package/example-maplibre/src/html-on-top.stories.tsx +24 -0
  44. package/example-maplibre/src/my-scene.tsx +97 -0
  45. package/example-maplibre/src/render-on-demand.stories.tsx +32 -0
  46. package/example-maplibre/src/story-map.tsx +38 -0
  47. package/example-maplibre/src/vite-env.d.ts +1 -0
  48. package/example-maplibre/tsconfig.json +25 -0
  49. package/example-maplibre/tsconfig.node.json +10 -0
  50. package/example-maplibre/yarn.lock +4181 -0
  51. package/maplibre/package.json +1 -1
  52. package/package.json +9 -6
  53. package/src/{canvas/core → core}/generic-map.ts +15 -2
  54. package/src/{canvas/core → core}/state-ref.ts +2 -2
  55. package/src/{canvas/core/internal-canvas.tsx → core/use-canvas.tsx} +6 -18
  56. package/src/{canvas/core → core}/use-on-add.ts +3 -3
  57. package/src/{canvas/canvas-mapbox.tsx → mapbox/canvas.tsx} +15 -9
  58. package/src/mapbox/index.ts +1 -0
  59. package/src/{canvas/canvas-maplibre.tsx → maplibre/canvas.tsx} +13 -7
  60. package/src/maplibre/index.ts +1 -0
  61. package/src/stories/comparison.stories.tsx +13 -30
  62. package/src/stories/html-on-top.stories.tsx +11 -16
  63. package/src/stories/mapbox/story-mapbox.tsx +43 -0
  64. package/src/stories/mapbox-example.stories.tsx +69 -0
  65. package/src/stories/maplibre/story-maplibre.tsx +32 -0
  66. package/src/stories/{canvas.basic.stories.tsx → maplibre-example.stories.tsx} +28 -30
  67. package/src/stories/my-scene.tsx +0 -1
  68. package/src/stories/render-on-demand.stories.tsx +18 -37
  69. package/src/stories/story-map.tsx +26 -24
  70. package/tsconfig.json +5 -0
  71. package/dist/es/main.js10.mjs +0 -56
  72. package/dist/es/main.js10.mjs.map +0 -1
  73. package/dist/es/main.js11.mjs +0 -9
  74. package/dist/es/main.js11.mjs.map +0 -1
  75. package/dist/es/main.js9.mjs +0 -16
  76. package/dist/es/main.js9.mjs.map +0 -1
  77. package/src/main-mapbox.ts +0 -1
  78. package/src/main-maplibre.ts +0 -1
  79. /package/src/{canvas/core → core}/coords-to-matrix.ts +0 -0
  80. /package/src/{canvas/core → core}/create-events.ts +0 -0
  81. /package/src/{canvas/core → core}/generic-map.test.ts +0 -0
  82. /package/src/{canvas/core → core}/use-function.ts +0 -0
  83. /package/src/{canvas/core → core}/use-render.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-three-map
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f3155c6: Upgrade to `react-map-gl@7.1.0`, which changes how to use Maplibre. Find more in their [changelog](https://github.com/visgl/react-map-gl/releases/tag/v7.1.0).
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  [![Version](https://img.shields.io/npm/v/react-three-map?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/@react-three/fiber)
4
4
 
5
-
6
- ⚠️ **Alpha Warning: This library is currently in its alpha phase. While functional, it's still under active development and may have bugs. Please use with caution in production and feel free to report any issues you encounter. Thank you for your understanding!**
7
-
8
5
  `react-three-map` is a bridge to use [`react-three-fiber`](https://github.com/pmndrs/react-three-fiber) inside [`react-map-gl`](https://github.com/visgl/react-map-gl).
9
6
 
10
7
  Until now you had:
@@ -20,9 +17,11 @@ Now with `react-three-map`, you can use them together :fist_right::fist_left:.
20
17
  npm install react-three-map
21
18
  ```
22
19
 
23
- Find use examples in our [Stories :book:](https://rodrigohamuy.github.io/react-three-map).
20
+ ## :book: Examples
24
21
 
25
- ## What does it look like?
22
+ You can check our examples here [here](https://rodrigohamuy.github.io/react-three-map) (powered by [Ladle](https://ladle.dev/)).
23
+
24
+ ## :mag: What does it look like?
26
25
 
27
26
 
28
27
  <table>
@@ -77,7 +76,7 @@ function BasicExample() {
77
76
  }
78
77
  ```
79
78
 
80
- # Why we build this?
79
+ ## :thinking: Why we build this?
81
80
 
82
81
  Look [how complex](https://maplibre.org/maplibre-gl-js-docs/example/add-3d-model/) is to add just one ThreeJS object to a map.
83
82
 
@@ -85,7 +84,7 @@ Look [how complex](https://docs.pmnd.rs/react-three-fiber/api/canvas#createroot)
85
84
 
86
85
  You can now replace all that complexity and hundreds of lines of code with the `<Canvas>` component exported by `react-three-map`, which includes a tone of extra features and seamless integration, supporting pointer events, raycasting, and much more, all out of the box.
87
86
 
88
- ## API
87
+ ## :gear: API
89
88
 
90
89
  ### Canvas
91
90
 
@@ -116,17 +115,19 @@ It shares most of the props from R3F `<Canvas>`, so you can check them directly
116
115
 
117
116
  #### Render Props
118
117
 
119
- | PROP | DESCRIPTION | DEFAULT |
120
- | --------- | ------------------------------------------------ | -------- |
121
- | latitude | The latitude coordinate where to add the scene. | |
122
- | longitude | The longitude coordinate where to add the scene. | |
123
- | altitude | The altitude coordinate where to add the scene. | `0` |
124
- | frameloop | Render mode: always, demand. | `always` |
118
+ | PROP | DESCRIPTION | DEFAULT |
119
+ | --------- | ------------------------------------------------ | ---------- |
120
+ | latitude | The latitude coordinate where to add the scene. | |
121
+ | longitude | The longitude coordinate where to add the scene. | |
122
+ | altitude | The altitude coordinate where to add the scene. | `0` |
123
+ | frameloop | Render mode: `"always"`, `"demand"`. | `"always"` |
125
124
 
126
125
  #### Render Props removed from `@react-three/fiber`
127
126
 
128
127
  Because the scene now lives in a map, we leave a lot of the render and camera control to the map, rather than to R3F.
129
128
 
129
+ Therefore, the following `<Canvas>` props are ignored:
130
+
130
131
  - gl
131
132
  - camera
132
133
  - resize