@gramps-connect/story 0.3.0 → 0.4.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 +14 -5
- package/dist/editor.js +464 -165
- package/dist/editor.js.map +4 -4
- package/dist/types/editor/PlaceField.d.ts +21 -0
- package/dist/types/editor/PlaceMap.d.ts +12 -0
- package/dist/types/editor/StoryEditor.d.ts +5 -1
- package/dist/types/editor/index.d.ts +3 -1
- package/dist/types/editor/model.d.ts +17 -1
- package/dist/types/editor/placeSearch.d.ts +22 -0
- package/dist/types/editor/strings.d.ts +15 -0
- package/package.json +1 -1
- package/src/editor/PlaceField.tsx +160 -0
- package/src/editor/PlaceMap.tsx +88 -0
- package/src/editor/StoryEditor.tsx +27 -14
- package/src/editor/index.ts +5 -2
- package/src/editor/model.ts +38 -1
- package/src/editor/placeSearch.ts +61 -0
- package/src/editor/strings.ts +30 -0
package/README.md
CHANGED
|
@@ -15,9 +15,10 @@ writes them and presents them with this package's player.
|
|
|
15
15
|
Everything happens in the browser: an opened story is never uploaded.
|
|
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
|
-
**Edit** on an open story in the viewer). Titles, dates, text, photos
|
|
19
|
-
and the order of slides; it saves a new `.story.zip`, back into
|
|
20
|
-
in Chrome and Edge. Also entirely in the browser
|
|
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
|
|
20
|
+
the opened file in Chrome and Edge. Also entirely in the browser, except
|
|
21
|
+
a place search on Wikidata when you ask for one.
|
|
21
22
|
- **Put a story on a web page:** the [`<gramps-connect-story>`](#on-any-web-page-gramps-connect-story)
|
|
22
23
|
element.
|
|
23
24
|
- **Format specification:** [`spec/1.0/README.md`](spec/1.0/README.md)
|
|
@@ -142,7 +143,7 @@ needed only by the player. With TypeScript 6 or later, add `"geojson"` to
|
|
|
142
143
|
## The editor: `@gramps-connect/story/editor`
|
|
143
144
|
|
|
144
145
|
A React component that edits a story: the slides on the left (drag to
|
|
145
|
-
reorder), the selected slide's title, date, text and photos in the middle,
|
|
146
|
+
reorder), the selected slide's title, date, text, place and photos in the middle,
|
|
146
147
|
and the player on the right showing it as it changes, with undo and redo
|
|
147
148
|
and the format's validation as you go. Photos are added by picking,
|
|
148
149
|
dropping or pasting, prepared in the browser (`optimizeImage`: resized,
|
|
@@ -174,11 +175,19 @@ Gramps' own date parser, in all of Gramps' languages. Pass
|
|
|
174
175
|
`parseDateText` to use another. Fields the editor doesn't know are kept as
|
|
175
176
|
they are, so opening and saving a story never loses anything.
|
|
176
177
|
|
|
178
|
+
A place is a name and a point: click the map or drag the pin, type the
|
|
179
|
+
coordinates, or pick one of the story's other places to use the very same
|
|
180
|
+
one (its shape and map overlays too). **Find on Wikidata** looks the name
|
|
181
|
+
up and puts the pin there; it's the only thing the editor sends anywhere,
|
|
182
|
+
the name only, and only when clicked. Pass `placeSearch` to use another
|
|
183
|
+
service, or `placeSearch={null}` to leave it out. Shapes and overlays
|
|
184
|
+
aren't edited yet, only kept.
|
|
185
|
+
|
|
177
186
|
The editor is built with [Mantine](https://mantine.dev) 8 (optional peer
|
|
178
187
|
dependencies `@mantine/core` and `@mantine/hooks`, needed only by the
|
|
179
188
|
editor): wrap it in a `MantineProvider` and load Mantine's stylesheet. The
|
|
180
189
|
pieces it's made of (`SlideList`, `StoryTextField`, `DateField`,
|
|
181
|
-
`PhotosField`) and its editing functions (`addSlide`, `moveSlide`,
|
|
190
|
+
`PlaceField`, `PhotosField`) and its editing functions (`addSlide`, `moveSlide`,
|
|
182
191
|
`updateSlide`, `addImage`, undo history, ...) are exported too.
|
|
183
192
|
|
|
184
193
|
## Writing stories from Python: `python/gramps_connect_story.py`
|