-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
650 additions
and
605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
export * from './drop-cursor'; | ||
export * from './font-family'; | ||
export * from './gap-cursor'; | ||
export * from './history'; | ||
export * from './letter-spacing'; | ||
export * from './line-height'; | ||
export * from './node-id'; | ||
export * from './placeholder'; | ||
export * from './text-align'; |
47 changes: 0 additions & 47 deletions
47
apps/penxle.com/src/lib/tiptap/extensions/letter-spacing.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Extension } from '@tiptap/core'; | ||
import { Heading, Paragraph } from '$lib/tiptap/nodes'; | ||
|
||
const types = [Heading.name, Paragraph.name]; | ||
|
||
export const LegacyFontFamily = Extension.create({ | ||
name: 'legacy_font_family', | ||
|
||
addGlobalAttributes() { | ||
return [ | ||
{ | ||
types, | ||
attributes: { | ||
'font-family': { | ||
default: undefined, | ||
parseHTML: (element) => element.dataset.fontFamily, | ||
renderHTML: ({ 'font-family': fontFamily }) => ({ | ||
'data-font-family': fontFamily, | ||
}), | ||
}, | ||
}, | ||
}, | ||
]; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './font-family'; | ||
export * from './letter-spacing'; | ||
export * from './line-height'; | ||
export * from './text-align'; | ||
export * from './text-color'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Extension } from '@tiptap/core'; | ||
import { Heading, Paragraph } from '$lib/tiptap/nodes'; | ||
|
||
// value reference from classname: https://tailwindcss.com/docs/letter-spacing | ||
const types = [Heading.name, Paragraph.name]; | ||
|
||
export const LegacyLetterSpacing = Extension.create({ | ||
name: 'legacy_letter_spacing', | ||
|
||
addGlobalAttributes() { | ||
return [ | ||
{ | ||
types, | ||
attributes: { | ||
'letter-spacing': { | ||
default: undefined, | ||
parseHTML: (element) => element.dataset.letterSpacing, | ||
renderHTML: ({ 'letter-spacing': letterSpacing }) => ({ | ||
'data-letter-spacing': letterSpacing, | ||
}), | ||
}, | ||
}, | ||
}, | ||
]; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Extension } from '@tiptap/core'; | ||
import { Heading, Paragraph } from '$lib/tiptap/nodes'; | ||
|
||
const types = [Heading.name, Paragraph.name]; | ||
|
||
export const LegacyLineHeight = Extension.create({ | ||
name: 'legacy_line_height', | ||
|
||
addGlobalAttributes() { | ||
return [ | ||
{ | ||
types, | ||
attributes: { | ||
'line-height': { | ||
default: undefined, | ||
parseHTML: (element) => element.dataset.lineHeight, | ||
renderHTML: ({ 'line-height': lineHeight }) => ({ | ||
'data-line-height': lineHeight, | ||
}), | ||
}, | ||
}, | ||
}, | ||
]; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Extension } from '@tiptap/core'; | ||
|
||
export const LegacyTextAlign = Extension.create({ | ||
name: 'legacy_text_align', | ||
|
||
addGlobalAttributes() { | ||
return [ | ||
{ | ||
types: ['heading', 'paragraph'], | ||
attributes: { | ||
'text-align': { | ||
default: undefined, | ||
parseHTML: (element) => element.dataset.textAlign, | ||
renderHTML: ({ 'text-align': textAlign }) => ({ | ||
'data-text-align': textAlign, | ||
}), | ||
}, | ||
}, | ||
}, | ||
]; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Mark } from '@tiptap/core'; | ||
|
||
export const LegacyTextColor = Mark.create({ | ||
name: 'text-color', | ||
|
||
addAttributes() { | ||
return { | ||
'data-text-color': { | ||
parseHTML: (element) => element.dataset.textColor, | ||
renderHTML: ({ 'data-text-color': textColor }) => ({ | ||
'data-text-color': textColor, | ||
}), | ||
}, | ||
}; | ||
}, | ||
|
||
renderHTML({ HTMLAttributes }) { | ||
return ['span', HTMLAttributes, 0]; | ||
}, | ||
}); |
Oops, something went wrong.