Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added bajour test data #37

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 37 additions & 26 deletions packages/core/src/DreifussWysiwygEditorDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,33 +122,44 @@ const toolbars = {
}
}

const DreifussWysiwygEditorDemo = () => (
<div style={{display: 'flex'}}>
<div style={{minHeight: 400, padding: 30}}>
<h1>RichText Component Demo</h1>
<DreifussWysiwygEditor
toolbars={toolbars}
// charactersCount={count => {
// console.log(count)
// }}
onChange={e => {
console.log(e)
}}
value={value}
/>
</div>
function download(content, fileName) {
const a = document.createElement('a')
const jsonse = JSON.stringify(content)
const blob = new Blob([jsonse], {type: 'application/json'})

a.href = URL.createObjectURL(blob)
a.download = fileName
a.click()
}

<div style={{minHeight: 400, padding: 30}}>
<h1>RichText Component Demo</h1>
<DreifussWysiwygEditor
onChange={e => {
console.log(e)
}}
id="two"
value={value}
/>
const DreifussWysiwygEditorDemo = () => {
const [val, setValu] = useState()

return (
<div style={{display: 'flex'}}>
<div style={{minHeight: 400, padding: 30}}>
<h1>RichText Component Demo</h1>
<DreifussWysiwygEditor
toolbars={toolbars}
// charactersCount={count => {
// console.log(count)
// }}
onChange={editorValue => {
console.log(editorValue)
setValu(editorValue)
}}
value={value}
/>
</div>
<button
onClick={e => {
e.preventDefault()
download(val, 'dreifuss.json')
}}>
Save
</button>
</div>
</div>
)
)
}

render(<DreifussWysiwygEditorDemo />, document.getElementById('root'))
226 changes: 226 additions & 0 deletions packages/core/src/test-data/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
[
{
"children": [
{
"text": "Auf dem Rhein"
}
],
"type": "heading-two"
},
{
"children": [
{
"text": "Fondue auf dem Wasser gibt es gleich mehrfach: Auf dem "
},
{
"children": [
{
"text": "Rhystärn"
}
],
"type": "link",
"url": "https://www.bpg.ch/de/Events/fondueschiff_rhystaern.php"
},
{
"text": ", dem "
},
{
"children": [
{
"text": "Rhytaxi"
}
],
"type": "link",
"url": "http://www.rhytaxi.ch/taxi.html"
},
{
"text": ", dem "
},
{
"children": [
{
"text": "Rhyschiffli"
}
],
"type": "link",
"url": "https://www.rhyschiffli.ch/essens-fahrten"
},
{
"text": ", der "
},
{
"children": [
{
"text": "Vogel-Gryff-"
}
],
"type": "link",
"url": "https://www.vogel-gryff-faehri.ch/"
},
{
"text": ", "
},
{
"children": [
{
"text": "Ueli-"
}
],
"type": "link",
"url": "https://www.ueli-faehri.ch/"
},
{
"text": " und "
},
{
"children": [
{
"text": "Wild-Maa-Fähri"
}
],
"type": "link",
"url": "https://www.wild-maa-faehri.ch/"
},
{
"text": ". Für spontanen Fonduegenuss kommt allerdings nur der Rhystärn in Frage. Bei den anderen Anbietern musst du reservieren."
}
],
"type": "paragraph"
},
{
"children": [
{
"text": "Bierfondue mit Bretzel"
}
],
"type": "heading-two"
},
{
"children": [
{
"text": "Das Kultfondue gibts im "
},
{
"children": [
{
"text": "Restaurant Linde"
}
],
"type": "link",
"url": "http://www.linde-basel.ch/"
},
{
"text": ", wo du dir ausserdem auch dein eigenes Bier zapfen kannst."
}
],
"type": "paragraph"
},
{
"children": [
{
"text": "Im Casino"
}
],
"type": "heading-two"
},
{
"children": [
{
"text": "Wer weder auf Käse, noch das Spielen verzichten möchte, ist im "
},
{
"children": [
{
"text": "Grandcasino"
}
],
"type": "link",
"url": "https://grandcasinobasel.com/de/fondueplausch"
},
{
"text": " richtig."
}
],
"type": "paragraph"
},
{
"children": [
{
"text": "Am Feuer"
}
],
"type": "heading-two"
},
{
"children": [
{
"text": "In der Aktienmühle gibt es einmal im Monat "
},
{
"children": [
{
"text": "Fondue am Feuer"
}
],
"type": "link",
"url": "https://turbinenhaus-basel.ch/fondue-am-feuer/"
},
{
"text": " inklusive Rahmenprogramm. Reservation ist möglich, aber nicht zwingend."
}
],
"type": "paragraph"
},
{
"children": [
{
"text": "In der Jurte, dem Zelt oder einem Hüttli"
}
],
"type": "heading-two"
},
{
"children": [
{
"text": "Wer so tun möchte, als wäre man nicht in der Stadt, die Stadt aber nicht verlassen möchte oder kann, wird in der "
},
{
"children": [
{
"text": "Jurte"
}
],
"type": "link",
"url": "https://www.baltazarbar.ch/de/winterjurte"
},
{
"text": " des Baltazars, dem "
},
{
"children": [
{
"text": "Winterdorf"
}
],
"type": "link",
"url": "https://www.sandoase.ch/winterdorf#ueber_uns"
},
{
"text": " der Sandoase oder der "
},
{
"children": [
{
"text": "Baracca-Berghütte"
}
],
"type": "link",
"url": "https://baracca-zermatt.ch/bs"
},
{
"text": " glücklich."
}
],
"type": "paragraph"
}
]
Loading