From b014d315772e2baa02b927b8fae4d8c379ff6f10 Mon Sep 17 00:00:00 2001 From: webfussel Date: Fri, 21 Feb 2025 19:15:20 +0100 Subject: [PATCH] ADD: RichText Added RichText system --- app/components/RichText/General.vue | 40 +++++ app/components/RichText/Link.vue | 12 ++ app/components/RichText/NewLine.vue | 3 + app/components/RichText/Paragraph.vue | 11 ++ app/components/RichText/Plain.vue | 9 ++ app/components/RichText/RichText.vue | 22 +++ app/components/RichText/String.vue | 11 ++ app/components/RichText/Types.ts | 34 +++++ app/components/SkillsEasy.vue | 203 ++++++++++++++------------ 9 files changed, 250 insertions(+), 95 deletions(-) create mode 100644 app/components/RichText/General.vue create mode 100644 app/components/RichText/Link.vue create mode 100644 app/components/RichText/NewLine.vue create mode 100644 app/components/RichText/Paragraph.vue create mode 100644 app/components/RichText/Plain.vue create mode 100644 app/components/RichText/RichText.vue create mode 100644 app/components/RichText/String.vue create mode 100644 app/components/RichText/Types.ts diff --git a/app/components/RichText/General.vue b/app/components/RichText/General.vue new file mode 100644 index 0000000..2dda4a1 --- /dev/null +++ b/app/components/RichText/General.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/components/RichText/Link.vue b/app/components/RichText/Link.vue new file mode 100644 index 0000000..266fce6 --- /dev/null +++ b/app/components/RichText/Link.vue @@ -0,0 +1,12 @@ + + + diff --git a/app/components/RichText/NewLine.vue b/app/components/RichText/NewLine.vue new file mode 100644 index 0000000..1502375 --- /dev/null +++ b/app/components/RichText/NewLine.vue @@ -0,0 +1,3 @@ + diff --git a/app/components/RichText/Paragraph.vue b/app/components/RichText/Paragraph.vue new file mode 100644 index 0000000..5ec1196 --- /dev/null +++ b/app/components/RichText/Paragraph.vue @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/app/components/RichText/Plain.vue b/app/components/RichText/Plain.vue new file mode 100644 index 0000000..162d9d3 --- /dev/null +++ b/app/components/RichText/Plain.vue @@ -0,0 +1,9 @@ + + + diff --git a/app/components/RichText/RichText.vue b/app/components/RichText/RichText.vue new file mode 100644 index 0000000..b1749de --- /dev/null +++ b/app/components/RichText/RichText.vue @@ -0,0 +1,22 @@ + + + diff --git a/app/components/RichText/String.vue b/app/components/RichText/String.vue new file mode 100644 index 0000000..926b4e0 --- /dev/null +++ b/app/components/RichText/String.vue @@ -0,0 +1,11 @@ + + + diff --git a/app/components/RichText/Types.ts b/app/components/RichText/Types.ts new file mode 100644 index 0000000..997566e --- /dev/null +++ b/app/components/RichText/Types.ts @@ -0,0 +1,34 @@ +type RichTextBasis = { + type: string + content: string + css ?: string +} + +export type RichTextPlain = RichTextBasis & { + type: 'plain' +} + +export type RichTextParagraph = Omit & { + type: 'p' + children ?: RichText[] +} + +export type RichTextSpan = RichTextBasis & { + type: 'span' +} + +export type RichTextLink = RichTextBasis & { + type: 'a' + href: string + icon ?: { + name: string + position : 'start' | 'end' + } + target ?: string +} + +export type RichTextNewLine = { + type: 'br' +} + +export type RichText = RichTextPlain | RichTextParagraph | RichTextSpan | RichTextLink | RichTextNewLine \ No newline at end of file diff --git a/app/components/SkillsEasy.vue b/app/components/SkillsEasy.vue index 36be7e4..6e49910 100644 --- a/app/components/SkillsEasy.vue +++ b/app/components/SkillsEasy.vue @@ -8,26 +8,7 @@

{{skill.title}}

- - {{ content}} - - +
@@ -43,31 +24,8 @@