From ed621db4f947be30f06e0a2789f1a10332d7822e Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 4 Apr 2024 13:43:10 -0700 Subject: [PATCH 1/2] Add tip, caution and important notecard types --- client/src/assets/icons/important.svg | 4 ++++ client/src/assets/icons/note-caution.svg | 4 ++++ client/src/assets/icons/tip.svg | 9 ++++++++ client/src/ui/molecules/notecards/index.scss | 24 ++++++++++++++++++++ markdown/localizations/de.json | 12 ++++++++++ markdown/localizations/en-US.json | 12 ++++++++++ markdown/localizations/es.json | 12 ++++++++++ markdown/localizations/fr.json | 12 ++++++++++ markdown/localizations/ja.json | 12 ++++++++++ markdown/localizations/ko.json | 12 ++++++++++ markdown/localizations/pl.json | 12 ++++++++++ markdown/localizations/pt-BR.json | 12 ++++++++++ markdown/localizations/ru.json | 12 ++++++++++ markdown/localizations/zh-CN.json | 12 ++++++++++ markdown/localizations/zh-TW.json | 12 ++++++++++ markdown/m2h/handlers/index.ts | 2 ++ 16 files changed, 175 insertions(+) create mode 100644 client/src/assets/icons/important.svg create mode 100644 client/src/assets/icons/note-caution.svg create mode 100644 client/src/assets/icons/tip.svg diff --git a/client/src/assets/icons/important.svg b/client/src/assets/icons/important.svg new file mode 100644 index 000000000000..7d7b64b760e3 --- /dev/null +++ b/client/src/assets/icons/important.svg @@ -0,0 +1,4 @@ + + + diff --git a/client/src/assets/icons/note-caution.svg b/client/src/assets/icons/note-caution.svg new file mode 100644 index 000000000000..537b5eefe5f6 --- /dev/null +++ b/client/src/assets/icons/note-caution.svg @@ -0,0 +1,4 @@ + + + diff --git a/client/src/assets/icons/tip.svg b/client/src/assets/icons/tip.svg new file mode 100644 index 000000000000..c5f7ae646573 --- /dev/null +++ b/client/src/assets/icons/tip.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/client/src/ui/molecules/notecards/index.scss b/client/src/ui/molecules/notecards/index.scss index 3d8760d7e053..cc21942b1b4b 100644 --- a/client/src/ui/molecules/notecards/index.scss +++ b/client/src/ui/molecules/notecards/index.scss @@ -77,6 +77,15 @@ } } + &.caution { + --note-background: var(--background-critical); + --note-theme: var(--icon-critical); + + &:before { + mask-image: url("../../../assets/icons/note-caution.svg"); + } + } + &.deprecated { --note-background: var(--background-critical); --note-theme: var(--icon-critical); @@ -101,6 +110,21 @@ } } + &.tip { + --note-background: var(--background-success); + --note-theme: var(--icon-success); + + &:before { + mask-image: url("../../../assets/icons/tip.svg"); + } + } + + &.important { + &:before { + mask-image: url("../../../assets/icons/important.svg"); + } + } + // extra classes added to fix specificity. ul, diff --git a/markdown/localizations/de.json b/markdown/localizations/de.json index 768deebf760f..1216c93c0ccc 100644 --- a/markdown/localizations/de.json +++ b/markdown/localizations/de.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Hinweis:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Tipp:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Wichtig:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Warnung:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Vorsicht:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Bemerkung:"] diff --git a/markdown/localizations/en-US.json b/markdown/localizations/en-US.json index bd307aadf07a..e5cd567a6820 100644 --- a/markdown/localizations/en-US.json +++ b/markdown/localizations/en-US.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Note:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Tip:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Important:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Warning:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Caution:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Callout:"] diff --git a/markdown/localizations/es.json b/markdown/localizations/es.json index b20534d97e09..3bd8f78f7449 100644 --- a/markdown/localizations/es.json +++ b/markdown/localizations/es.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Nota:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Consejo:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Importante:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Advertencia:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Precaución:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Observación:"] diff --git a/markdown/localizations/fr.json b/markdown/localizations/fr.json index 96ceaa007066..aff2d6db8bbf 100644 --- a/markdown/localizations/fr.json +++ b/markdown/localizations/fr.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Note :"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Conseil :"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Important :"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Attention :"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Prudence :"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Remarque :"] diff --git a/markdown/localizations/ja.json b/markdown/localizations/ja.json index 291312d9619e..dbbc4af32283 100644 --- a/markdown/localizations/ja.json +++ b/markdown/localizations/ja.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["メモ:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["ヒント:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["重要:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["警告:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["注意:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["注目:"] diff --git a/markdown/localizations/ko.json b/markdown/localizations/ko.json index 74b714eb504f..365b3e49cf32 100644 --- a/markdown/localizations/ko.json +++ b/markdown/localizations/ko.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["참고:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["팁:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["중요한:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["경고:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["주의:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["알림:"] diff --git a/markdown/localizations/pl.json b/markdown/localizations/pl.json index ae4224a988e5..3c5aaaa3d99a 100644 --- a/markdown/localizations/pl.json +++ b/markdown/localizations/pl.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Uwaga:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Wskazówka:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Ważny:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Ważne:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Ostrożność:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Obserwacja:"] diff --git a/markdown/localizations/pt-BR.json b/markdown/localizations/pt-BR.json index dde3bcaabd5c..d36217b056b0 100644 --- a/markdown/localizations/pt-BR.json +++ b/markdown/localizations/pt-BR.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Nota:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Dica:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Importante:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Aviso:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Cuidado:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Observação:"] diff --git a/markdown/localizations/ru.json b/markdown/localizations/ru.json index 04272730ca65..ddef3dc813bb 100644 --- a/markdown/localizations/ru.json +++ b/markdown/localizations/ru.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["Примечание:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["Кончик:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["Важный:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["Предупреждение:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["Осторожность:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["Сноска:"] diff --git a/markdown/localizations/zh-CN.json b/markdown/localizations/zh-CN.json index 743cb603520b..3e34dc454994 100644 --- a/markdown/localizations/zh-CN.json +++ b/markdown/localizations/zh-CN.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["备注:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["提示:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["重要的:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["警告:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["警告:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["标注:"] diff --git a/markdown/localizations/zh-TW.json b/markdown/localizations/zh-TW.json index d01b524623be..01e87189f970 100644 --- a/markdown/localizations/zh-TW.json +++ b/markdown/localizations/zh-TW.json @@ -5,10 +5,22 @@ "msgid": "card_note_label", "msgstr": ["備註:"] }, + "card_tip_label": { + "msgid": "card_tip_label", + "msgstr": ["提示:"] + }, + "card_important_label": { + "msgid": "card_important_label", + "msgstr": ["重要的:"] + }, "card_warning_label": { "msgid": "card_warning_label", "msgstr": ["警告:"] }, + "card_caution_label": { + "msgid": "card_caution_label", + "msgstr": ["警告:"] + }, "card_callout_label": { "msgid": "card_callout_label", "msgstr": ["標註:"] diff --git a/markdown/m2h/handlers/index.ts b/markdown/m2h/handlers/index.ts index 54551bdf5f3b..cbbfcdad758c 100644 --- a/markdown/m2h/handlers/index.ts +++ b/markdown/m2h/handlers/index.ts @@ -43,6 +43,8 @@ interface NotecardType { function getNotecardType(node: any, locale: string): NotecardType | null { const types = ["note", "warning", "callout"]; + // The styling and infrastructure is in place to add the following types when ready: + // const types = ["note", "tip", "important", "warning", "caution", "callout"]; if (!node.children) { return null; From 5958a213472a1553e0d65b8b744e3d75969c4b71 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 11 Sep 2024 00:32:14 -0700 Subject: [PATCH 2/2] Enable new alert types --- markdown/m2h/handlers/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/markdown/m2h/handlers/index.ts b/markdown/m2h/handlers/index.ts index cbbfcdad758c..295b96eba29d 100644 --- a/markdown/m2h/handlers/index.ts +++ b/markdown/m2h/handlers/index.ts @@ -42,9 +42,7 @@ interface NotecardType { } function getNotecardType(node: any, locale: string): NotecardType | null { - const types = ["note", "warning", "callout"]; - // The styling and infrastructure is in place to add the following types when ready: - // const types = ["note", "tip", "important", "warning", "caution", "callout"]; + const types = ["note", "tip", "important", "warning", "caution", "callout"]; if (!node.children) { return null;