Setze Symbole vor Absätze, Nummern in Kreise und Symbole statt Aufzählungspunkte im Text (ADR-69)
Zwei Werkzeuge im Texteditor (Symbol vor dem Absatz, Listenstil); gespeichert werden nur Schlüssel, Bild und Farbe setzt die Ausgabe ein. Kreisfarben aus der Palette, Verwendung wird mitgezählt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
67764c3e4f
commit
e904b500fb
24 files changed
+814
-14
No files matched your search
@@ -0,0 +1,30 @@
|
||||
// Zeichen im Text der Website (ADR-69): Symbol vor einem Absatz, Nummern im Kreis, Symbol statt Aufzählungspunkt.
|
||||
// Der Editor führt nur Schlüssel als Attribute der Knoten: data-symbol am Absatz; data-marker, data-symbol und data-tone an
|
||||
// Aufzählung und Nummerierung. Bilder und Farben setzt erst die Ausgabe der Website ein.
|
||||
// Gegenstück: App\Filament\Support\TipTap\TextMarksExtension (PHP-Modell beim Speichern). Filament lädt diese Datei als
|
||||
// Erweiterung (RichContentPlugin::getTipTapJsExtensions) und stellt TipTap über window.FilamentRichEditor bereit.
|
||||
const { Extension } = window.FilamentRichEditor.tiptap.core
|
||||
|
||||
const attribute = (name) => ({
|
||||
default: null,
|
||||
parseHTML: (element) => element.getAttribute(name),
|
||||
renderHTML: (attributes) => (attributes[name] ? { [name]: attributes[name] } : {}),
|
||||
})
|
||||
|
||||
export default Extension.create({
|
||||
name: 'textMarks',
|
||||
|
||||
addGlobalAttributes() {
|
||||
return [
|
||||
{ types: ['paragraph'], attributes: { 'data-symbol': attribute('data-symbol') } },
|
||||
{
|
||||
types: ['bulletList', 'orderedList'],
|
||||
attributes: {
|
||||
'data-marker': attribute('data-marker'),
|
||||
'data-symbol': attribute('data-symbol'),
|
||||
'data-tone': attribute('data-tone'),
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user