@gramps-connect/story 0.4.0 → 0.5.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.
- package/README.md +13 -4
- package/dist/editor.js +1710 -121
- package/dist/editor.js.map +4 -4
- package/dist/embed.js +1 -1
- package/dist/map-edit.js +361 -0
- package/dist/map-edit.js.map +7 -0
- package/dist/player.js +3 -1
- package/dist/player.js.map +2 -2
- package/dist/types/editor/MapEditor.d.ts +89 -0
- package/dist/types/editor/PlaceField.d.ts +4 -1
- package/dist/types/editor/PlaceMapDialog.d.ts +18 -0
- package/dist/types/editor/StoryEditor.d.ts +4 -1
- package/dist/types/editor/index.d.ts +4 -0
- package/dist/types/editor/mapEditorStrings.d.ts +50 -0
- package/dist/types/editor/placeShapes.d.ts +13 -0
- package/dist/types/editor/strings.d.ts +13 -0
- package/dist/types/mapEdit/geometry.d.ts +91 -0
- package/dist/types/mapEdit/index.d.ts +3 -0
- package/dist/types/mapEdit/mapFile.d.ts +77 -0
- package/dist/types/mapEdit/model.d.ts +55 -0
- package/package.json +18 -2
- package/src/editor/MapEditor.tsx +1545 -0
- package/src/editor/PlaceField.tsx +12 -2
- package/src/editor/PlaceMapDialog.tsx +228 -0
- package/src/editor/StoryEditor.tsx +24 -1
- package/src/editor/index.ts +6 -0
- package/src/editor/mapEditorStrings.ts +109 -0
- package/src/editor/placeShapes.ts +63 -0
- package/src/editor/strings.ts +27 -1
- package/src/mapEdit/geometry.ts +211 -0
- package/src/mapEdit/index.ts +15 -0
- package/src/mapEdit/mapFile.ts +199 -0
- package/src/mapEdit/model.ts +250 -0
- package/src/player/MapBackground.tsx +3 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ writes them and presents them with this package's player.
|
|
|
16
16
|
- **Change a story, or make one:** the Story Editor, at
|
|
17
17
|
**https://dsblank.github.io/gramps-connect-stories/edit.html** (or
|
|
18
18
|
**Edit** on an open story in the viewer). Titles, dates, text, photos,
|
|
19
|
-
places and the order of slides; it saves a new `.story.zip`, back into
|
|
19
|
+
places, shapes and old maps on the map, and the order of slides; it saves a new `.story.zip`, back into
|
|
20
20
|
the opened file in Chrome and Edge. Also entirely in the browser, except
|
|
21
21
|
a place search on Wikidata when you ask for one.
|
|
22
22
|
- **Put a story on a web page:** the [`<gramps-connect-story>`](#on-any-web-page-gramps-connect-story)
|
|
@@ -180,14 +180,23 @@ coordinates, or pick one of the story's other places to use the very same
|
|
|
180
180
|
one (its shape and map overlays too). **Find on Wikidata** looks the name
|
|
181
181
|
up and puts the pin there; it's the only thing the editor sends anywhere,
|
|
182
182
|
the name only, and only when clicked. Pass `placeSearch` to use another
|
|
183
|
-
service, or `placeSearch={null}` to leave it out.
|
|
184
|
-
|
|
183
|
+
service, or `placeSearch={null}` to leave it out.
|
|
184
|
+
|
|
185
|
+
**Edit map** opens the place's map full screen: draw shapes (points,
|
|
186
|
+
lines, areas) or import them from a KML, GPX or GeoJSON file, and lay
|
|
187
|
+
scans of old maps over it (stored at up to 2048px, PNG when they have
|
|
188
|
+
transparency), moving, resizing, rotating or dragging their corners to
|
|
189
|
+
line them up, with the years each one shows. The map editor itself is
|
|
190
|
+
`MapEditor`, which Gramps Connect's own map overlay editor uses too; the
|
|
191
|
+
plain functions behind it (map files, the shape model, overlay geometry)
|
|
192
|
+
are `@gramps-connect/story/map-edit`. The editor also needs `terra-draw`
|
|
193
|
+
and `terra-draw-maplibre-gl-adapter` (optional peer dependencies).
|
|
185
194
|
|
|
186
195
|
The editor is built with [Mantine](https://mantine.dev) 8 (optional peer
|
|
187
196
|
dependencies `@mantine/core` and `@mantine/hooks`, needed only by the
|
|
188
197
|
editor): wrap it in a `MantineProvider` and load Mantine's stylesheet. The
|
|
189
198
|
pieces it's made of (`SlideList`, `StoryTextField`, `DateField`,
|
|
190
|
-
`PlaceField`, `PhotosField`) and its editing functions (`addSlide`, `moveSlide`,
|
|
199
|
+
`PlaceField`, `PhotosField`, `MapEditor`, `PlaceMapDialog`) and its editing functions (`addSlide`, `moveSlide`,
|
|
191
200
|
`updateSlide`, `addImage`, undo history, ...) are exported too.
|
|
192
201
|
|
|
193
202
|
## Writing stories from Python: `python/gramps_connect_story.py`
|