@nanahoshi/mona-ui 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/editor.md +67 -0
- package/docs/api/file-upload.md +1 -1
- package/docs/api/i18n.md +16 -0
- package/docs/api/locales.md +14 -14
- package/docs/api/popup.md +1 -1
- package/docs/editor.md +238 -9
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1348 -190
- package/fesm2022/nanahoshi-mona-ui-file-upload.mjs +28 -94
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +50 -1
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +83 -2
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +59 -1
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +23 -1
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +35 -1
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +35 -1
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +17 -1
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +35 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +17 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +17 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +47 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +35 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +47 -1
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +17 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +17 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +17 -1
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +29 -8
- package/i18n/catalogs/en-US.messages.json +17 -1
- package/llms.txt +1 -1
- package/locales/ar-sa/ar-sa.messages.json +17 -1
- package/locales/de-de/de-de.messages.json +17 -1
- package/locales/es-es/es-es.messages.json +17 -1
- package/locales/fr-fr/fr-fr.messages.json +17 -1
- package/locales/id-id/id-id.messages.json +17 -1
- package/locales/it-it/it-it.messages.json +17 -1
- package/locales/ja-jp/ja-jp.messages.json +17 -1
- package/locales/ko-kr/ko-kr.messages.json +17 -1
- package/locales/pl-pl/pl-pl.messages.json +17 -1
- package/locales/pt-br/pt-br.messages.json +17 -1
- package/locales/ru-ru/ru-ru.messages.json +17 -1
- package/locales/tr-tr/tr-tr.messages.json +17 -1
- package/locales/zh-cn/zh-cn.messages.json +17 -1
- package/locales/zh-tw/zh-tw.messages.json +17 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +124 -2
- package/types/nanahoshi-mona-ui-file-upload.d.ts +1 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +32 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +37 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +16 -0
- package/types/nanahoshi-mona-ui-popup.d.ts +3 -1
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
"backgroundColor": "Kolor tła",
|
|
233
233
|
"bold": "Pogrubienie",
|
|
234
234
|
"cancel": "Anuluj",
|
|
235
|
+
"characterCount": "{count, plural, one {# znak} few {# znaki} many {# znaków} other {# znaku}}",
|
|
236
|
+
"characterLimitHint": "Możesz wpisać maksymalnie {limit, plural, one {# znak} few {# znaki} many {# znaków} other {# znaku}}.",
|
|
237
|
+
"charactersLeft": "{count, plural, one {Pozostał # znak} few {Pozostały # znaki} many {Pozostało # znaków} other {Pozostało # znaku}}",
|
|
238
|
+
"charactersOver": "{count, plural, one {# znak za dużo} few {# znaki za dużo} many {# znaków za dużo} other {# znaku za dużo}}",
|
|
235
239
|
"codeBlock": "Blok kodu",
|
|
236
240
|
"color": "Kolor",
|
|
237
241
|
"contentLabel": "Edytor tekstu sformatowanego",
|
|
@@ -239,6 +243,7 @@
|
|
|
239
243
|
"deleteColumn": "Usuń kolumnę",
|
|
240
244
|
"deleteRow": "Usuń wiersz",
|
|
241
245
|
"deleteTable": "Usuń tabelę",
|
|
246
|
+
"editImage": "Edytuj obraz",
|
|
242
247
|
"editLink": "Edytuj link",
|
|
243
248
|
"enterUrl": "Wprowadź adres URL",
|
|
244
249
|
"fontSize": "Rozmiar czcionki",
|
|
@@ -246,6 +251,11 @@
|
|
|
246
251
|
"heading": "Nagłówek {level}",
|
|
247
252
|
"heightPx": "Wysokość (px)",
|
|
248
253
|
"historyGroup": "Historia",
|
|
254
|
+
"imageFile": "Plik obrazu",
|
|
255
|
+
"imageInserted": "Wstawiono {name}.",
|
|
256
|
+
"imageTooLarge": "Nie dodano pliku {name}. Plik jest większy niż {size}.",
|
|
257
|
+
"imageUploadFailed": "Nie udało się przesłać pliku {name}.",
|
|
258
|
+
"imageUploading": "Przesyłanie pliku {name}",
|
|
249
259
|
"imageUrl": "Adres URL obrazu",
|
|
250
260
|
"indent": "Zwiększ wcięcie",
|
|
251
261
|
"indentGroup": "Wcięcia",
|
|
@@ -261,12 +271,17 @@
|
|
|
261
271
|
"justify": "Wyjustuj",
|
|
262
272
|
"linkGroup": "Linki",
|
|
263
273
|
"listGroup": "Listy",
|
|
274
|
+
"mentionNoResults": "Brak wyników",
|
|
275
|
+
"mentionResults": "{count, plural, one {# sugestia} few {# sugestie} many {# sugestii} other {# sugestii}}",
|
|
276
|
+
"mentionSearching": "Wyszukiwanie…",
|
|
277
|
+
"mentionSuggestions": "Sugestie",
|
|
264
278
|
"mergeCells": "Scal zaznaczone komórki",
|
|
265
279
|
"outdent": "Zmniejsz wcięcie",
|
|
266
280
|
"paragraph": "Akapit",
|
|
267
281
|
"quotation": "Cytat",
|
|
268
282
|
"redo": "Ponów",
|
|
269
283
|
"removeLink": "Usuń link",
|
|
284
|
+
"save": "Zapisz",
|
|
270
285
|
"selectFontFamily": "Wybierz czcionkę",
|
|
271
286
|
"selectFontSize": "Wybierz rozmiar czcionki",
|
|
272
287
|
"splitCell": "Podziel komórkę",
|
|
@@ -280,7 +295,8 @@
|
|
|
280
295
|
"toolbar": "Formatowanie",
|
|
281
296
|
"underline": "Podkreślenie",
|
|
282
297
|
"undo": "Cofnij",
|
|
283
|
-
"widthPx": "Szerokość (px)"
|
|
298
|
+
"widthPx": "Szerokość (px)",
|
|
299
|
+
"wordCount": "{count, plural, one {# słowo} few {# słowa} many {# słów} other {# słowa}}"
|
|
284
300
|
},
|
|
285
301
|
"fileUpload": {
|
|
286
302
|
"browse": "Przeglądaj pliki",
|
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
"backgroundColor": "Cor de fundo",
|
|
233
233
|
"bold": "Negrito",
|
|
234
234
|
"cancel": "Cancelar",
|
|
235
|
+
"characterCount": "{count, plural, one {# caractere} other {# caracteres}}",
|
|
236
|
+
"characterLimitHint": "Você pode digitar até {limit, plural, one {# caractere} other {# caracteres}}.",
|
|
237
|
+
"charactersLeft": "{count, plural, one {Resta # caractere} other {Restam # caracteres}}",
|
|
238
|
+
"charactersOver": "{count, plural, one {# caractere a mais} other {# caracteres a mais}}",
|
|
235
239
|
"codeBlock": "Bloco de código",
|
|
236
240
|
"color": "Cor",
|
|
237
241
|
"contentLabel": "Editor de texto formatado",
|
|
@@ -239,6 +243,7 @@
|
|
|
239
243
|
"deleteColumn": "Excluir coluna",
|
|
240
244
|
"deleteRow": "Excluir linha",
|
|
241
245
|
"deleteTable": "Excluir tabela",
|
|
246
|
+
"editImage": "Editar imagem",
|
|
242
247
|
"editLink": "Editar link",
|
|
243
248
|
"enterUrl": "Inserir a URL",
|
|
244
249
|
"fontSize": "Tamanho da fonte",
|
|
@@ -246,6 +251,11 @@
|
|
|
246
251
|
"heading": "Título {level}",
|
|
247
252
|
"heightPx": "Altura (px)",
|
|
248
253
|
"historyGroup": "Histórico",
|
|
254
|
+
"imageFile": "Arquivo de imagem",
|
|
255
|
+
"imageInserted": "{name} inserido.",
|
|
256
|
+
"imageTooLarge": "{name} não foi adicionado. O arquivo é maior que {size}.",
|
|
257
|
+
"imageUploadFailed": "Não foi possível enviar {name}.",
|
|
258
|
+
"imageUploading": "Enviando {name}",
|
|
249
259
|
"imageUrl": "URL da imagem",
|
|
250
260
|
"indent": "Aumentar recuo",
|
|
251
261
|
"indentGroup": "Recuo",
|
|
@@ -261,12 +271,17 @@
|
|
|
261
271
|
"justify": "Justificar",
|
|
262
272
|
"linkGroup": "Hiperlink",
|
|
263
273
|
"listGroup": "Listas",
|
|
274
|
+
"mentionNoResults": "Nenhuma correspondência",
|
|
275
|
+
"mentionResults": "{count, plural, one {# sugestão} other {# sugestões}}",
|
|
276
|
+
"mentionSearching": "Pesquisando…",
|
|
277
|
+
"mentionSuggestions": "Sugestões",
|
|
264
278
|
"mergeCells": "Mesclar células selecionadas",
|
|
265
279
|
"outdent": "Diminuir recuo",
|
|
266
280
|
"paragraph": "Parágrafo",
|
|
267
281
|
"quotation": "Citação",
|
|
268
282
|
"redo": "Refazer",
|
|
269
283
|
"removeLink": "Remover link",
|
|
284
|
+
"save": "Salvar",
|
|
270
285
|
"selectFontFamily": "Selecionar família de fontes",
|
|
271
286
|
"selectFontSize": "Selecionar tamanho da fonte",
|
|
272
287
|
"splitCell": "Dividir célula",
|
|
@@ -280,7 +295,8 @@
|
|
|
280
295
|
"toolbar": "Formatação",
|
|
281
296
|
"underline": "Sublinhado",
|
|
282
297
|
"undo": "Desfazer",
|
|
283
|
-
"widthPx": "Largura (px)"
|
|
298
|
+
"widthPx": "Largura (px)",
|
|
299
|
+
"wordCount": "{count, plural, one {# palavra} other {# palavras}}"
|
|
284
300
|
},
|
|
285
301
|
"fileUpload": {
|
|
286
302
|
"browse": "Procurar arquivos",
|
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
"backgroundColor": "Цвет фона",
|
|
233
233
|
"bold": "Полужирный",
|
|
234
234
|
"cancel": "Отмена",
|
|
235
|
+
"characterCount": "{count, plural, one {# символ} few {# символа} many {# символов} other {# символа}}",
|
|
236
|
+
"characterLimitHint": "Можно ввести не более {limit, plural, one {# символа} few {# символов} many {# символов} other {# символа}}.",
|
|
237
|
+
"charactersLeft": "{count, plural, one {Остался # символ} few {Осталось # символа} many {Осталось # символов} other {Осталось # символа}}",
|
|
238
|
+
"charactersOver": "{count, plural, one {# символ сверх лимита} few {# символа сверх лимита} many {# символов сверх лимита} other {# символа сверх лимита}}",
|
|
235
239
|
"codeBlock": "Блок кода",
|
|
236
240
|
"color": "Цвет",
|
|
237
241
|
"contentLabel": "Редактор форматированного текста",
|
|
@@ -239,6 +243,7 @@
|
|
|
239
243
|
"deleteColumn": "Удалить столбец",
|
|
240
244
|
"deleteRow": "Удалить строку",
|
|
241
245
|
"deleteTable": "Удалить таблицу",
|
|
246
|
+
"editImage": "Изменить изображение",
|
|
242
247
|
"editLink": "Изменить ссылку",
|
|
243
248
|
"enterUrl": "Введите URL",
|
|
244
249
|
"fontSize": "Размер шрифта",
|
|
@@ -246,6 +251,11 @@
|
|
|
246
251
|
"heading": "Заголовок {level}",
|
|
247
252
|
"heightPx": "Высота (px)",
|
|
248
253
|
"historyGroup": "История",
|
|
254
|
+
"imageFile": "Файл изображения",
|
|
255
|
+
"imageInserted": "Изображение {name} вставлено.",
|
|
256
|
+
"imageTooLarge": "Файл {name} не добавлен. Его размер больше {size}.",
|
|
257
|
+
"imageUploadFailed": "Не удалось загрузить {name}.",
|
|
258
|
+
"imageUploading": "Загрузка {name}",
|
|
249
259
|
"imageUrl": "URL изображения",
|
|
250
260
|
"indent": "Увеличить отступ",
|
|
251
261
|
"indentGroup": "Отступ",
|
|
@@ -261,12 +271,17 @@
|
|
|
261
271
|
"justify": "Выровнять по ширине",
|
|
262
272
|
"linkGroup": "Ссылка",
|
|
263
273
|
"listGroup": "Списки",
|
|
274
|
+
"mentionNoResults": "Совпадений нет",
|
|
275
|
+
"mentionResults": "{count, plural, one {# вариант} few {# варианта} many {# вариантов} other {# варианта}}",
|
|
276
|
+
"mentionSearching": "Поиск…",
|
|
277
|
+
"mentionSuggestions": "Варианты",
|
|
264
278
|
"mergeCells": "Объединить выбранные ячейки",
|
|
265
279
|
"outdent": "Уменьшить отступ",
|
|
266
280
|
"paragraph": "Абзац",
|
|
267
281
|
"quotation": "Цитата",
|
|
268
282
|
"redo": "Повторить",
|
|
269
283
|
"removeLink": "Удалить ссылку",
|
|
284
|
+
"save": "Сохранить",
|
|
270
285
|
"selectFontFamily": "Выбрать шрифт",
|
|
271
286
|
"selectFontSize": "Выбрать размер шрифта",
|
|
272
287
|
"splitCell": "Разделить ячейку",
|
|
@@ -280,7 +295,8 @@
|
|
|
280
295
|
"toolbar": "Форматирование",
|
|
281
296
|
"underline": "Подчёркнутый",
|
|
282
297
|
"undo": "Отменить",
|
|
283
|
-
"widthPx": "Ширина (px)"
|
|
298
|
+
"widthPx": "Ширина (px)",
|
|
299
|
+
"wordCount": "{count, plural, one {# слово} few {# слова} many {# слов} other {# слова}}"
|
|
284
300
|
},
|
|
285
301
|
"fileUpload": {
|
|
286
302
|
"browse": "Выбрать файлы",
|
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
"backgroundColor": "Arka plan rengi",
|
|
233
233
|
"bold": "Kalın",
|
|
234
234
|
"cancel": "İptal",
|
|
235
|
+
"characterCount": "{count} karakter",
|
|
236
|
+
"characterLimitHint": "En fazla {limit} karakter girebilirsiniz.",
|
|
237
|
+
"charactersLeft": "{count} karakter kaldı",
|
|
238
|
+
"charactersOver": "{count} karakter fazla",
|
|
235
239
|
"codeBlock": "Kod bloğu",
|
|
236
240
|
"color": "Renk",
|
|
237
241
|
"contentLabel": "Zengin metin düzenleyici",
|
|
@@ -239,6 +243,7 @@
|
|
|
239
243
|
"deleteColumn": "Sütunu sil",
|
|
240
244
|
"deleteRow": "Satırı sil",
|
|
241
245
|
"deleteTable": "Tabloyu sil",
|
|
246
|
+
"editImage": "Görseli düzenle",
|
|
242
247
|
"editLink": "Bağlantıyı düzenle",
|
|
243
248
|
"enterUrl": "URL'yi gir",
|
|
244
249
|
"fontSize": "Yazı tipi boyutu",
|
|
@@ -246,6 +251,11 @@
|
|
|
246
251
|
"heading": "Başlık {level}",
|
|
247
252
|
"heightPx": "Yükseklik (px)",
|
|
248
253
|
"historyGroup": "Geçmiş",
|
|
254
|
+
"imageFile": "Görsel dosyası",
|
|
255
|
+
"imageInserted": "{name} eklendi.",
|
|
256
|
+
"imageTooLarge": "{name} eklenmedi. Dosya {size} boyutundan büyük.",
|
|
257
|
+
"imageUploadFailed": "{name} yüklenemedi.",
|
|
258
|
+
"imageUploading": "{name} yükleniyor",
|
|
249
259
|
"imageUrl": "Görsel URL'si",
|
|
250
260
|
"indent": "Girintiyi artır",
|
|
251
261
|
"indentGroup": "Girinti",
|
|
@@ -261,12 +271,17 @@
|
|
|
261
271
|
"justify": "İki yana yasla",
|
|
262
272
|
"linkGroup": "Bağlantı",
|
|
263
273
|
"listGroup": "Listeler",
|
|
274
|
+
"mentionNoResults": "Eşleşme yok",
|
|
275
|
+
"mentionResults": "{count} öneri",
|
|
276
|
+
"mentionSearching": "Aranıyor…",
|
|
277
|
+
"mentionSuggestions": "Öneriler",
|
|
264
278
|
"mergeCells": "Seçili hücreleri birleştir",
|
|
265
279
|
"outdent": "Girintiyi azalt",
|
|
266
280
|
"paragraph": "Paragraf",
|
|
267
281
|
"quotation": "Alıntı",
|
|
268
282
|
"redo": "Yinele",
|
|
269
283
|
"removeLink": "Bağlantıyı kaldır",
|
|
284
|
+
"save": "Kaydet",
|
|
270
285
|
"selectFontFamily": "Yazı tipi ailesini seç",
|
|
271
286
|
"selectFontSize": "Yazı tipi boyutunu seç",
|
|
272
287
|
"splitCell": "Hücreyi böl",
|
|
@@ -280,7 +295,8 @@
|
|
|
280
295
|
"toolbar": "Biçimlendirme",
|
|
281
296
|
"underline": "Altı çizili",
|
|
282
297
|
"undo": "Geri al",
|
|
283
|
-
"widthPx": "Genişlik (px)"
|
|
298
|
+
"widthPx": "Genişlik (px)",
|
|
299
|
+
"wordCount": "{count} kelime"
|
|
284
300
|
},
|
|
285
301
|
"fileUpload": {
|
|
286
302
|
"browse": "Dosyalara göz at",
|
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
"backgroundColor": "背景颜色",
|
|
233
233
|
"bold": "粗体",
|
|
234
234
|
"cancel": "取消",
|
|
235
|
+
"characterCount": "{count} 个字符",
|
|
236
|
+
"characterLimitHint": "最多可输入 {limit} 个字符。",
|
|
237
|
+
"charactersLeft": "还可输入 {count} 个字符",
|
|
238
|
+
"charactersOver": "超出 {count} 个字符",
|
|
235
239
|
"codeBlock": "代码块",
|
|
236
240
|
"color": "颜色",
|
|
237
241
|
"contentLabel": "富文本编辑器",
|
|
@@ -239,6 +243,7 @@
|
|
|
239
243
|
"deleteColumn": "删除列",
|
|
240
244
|
"deleteRow": "删除行",
|
|
241
245
|
"deleteTable": "删除表格",
|
|
246
|
+
"editImage": "编辑图片",
|
|
242
247
|
"editLink": "编辑链接",
|
|
243
248
|
"enterUrl": "输入 URL",
|
|
244
249
|
"fontSize": "字号",
|
|
@@ -246,6 +251,11 @@
|
|
|
246
251
|
"heading": "标题 {level}",
|
|
247
252
|
"heightPx": "高度 (px)",
|
|
248
253
|
"historyGroup": "历史记录",
|
|
254
|
+
"imageFile": "图片文件",
|
|
255
|
+
"imageInserted": "已插入 {name}。",
|
|
256
|
+
"imageTooLarge": "未添加 {name}。文件大于 {size}。",
|
|
257
|
+
"imageUploadFailed": "无法上传 {name}。",
|
|
258
|
+
"imageUploading": "正在上传 {name}",
|
|
249
259
|
"imageUrl": "图片 URL",
|
|
250
260
|
"indent": "增加缩进",
|
|
251
261
|
"indentGroup": "缩进",
|
|
@@ -261,12 +271,17 @@
|
|
|
261
271
|
"justify": "两端对齐",
|
|
262
272
|
"linkGroup": "链接",
|
|
263
273
|
"listGroup": "列表",
|
|
274
|
+
"mentionNoResults": "没有匹配项",
|
|
275
|
+
"mentionResults": "{count} 条建议",
|
|
276
|
+
"mentionSearching": "正在搜索…",
|
|
277
|
+
"mentionSuggestions": "建议",
|
|
264
278
|
"mergeCells": "合并所选单元格",
|
|
265
279
|
"outdent": "减少缩进",
|
|
266
280
|
"paragraph": "段落",
|
|
267
281
|
"quotation": "引用",
|
|
268
282
|
"redo": "重做",
|
|
269
283
|
"removeLink": "移除链接",
|
|
284
|
+
"save": "保存",
|
|
270
285
|
"selectFontFamily": "选择字体",
|
|
271
286
|
"selectFontSize": "选择字号",
|
|
272
287
|
"splitCell": "拆分单元格",
|
|
@@ -280,7 +295,8 @@
|
|
|
280
295
|
"toolbar": "格式",
|
|
281
296
|
"underline": "下划线",
|
|
282
297
|
"undo": "撤销",
|
|
283
|
-
"widthPx": "宽度 (px)"
|
|
298
|
+
"widthPx": "宽度 (px)",
|
|
299
|
+
"wordCount": "{count} 个词"
|
|
284
300
|
},
|
|
285
301
|
"fileUpload": {
|
|
286
302
|
"browse": "浏览文件",
|
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
"backgroundColor": "背景顏色",
|
|
233
233
|
"bold": "粗體",
|
|
234
234
|
"cancel": "取消",
|
|
235
|
+
"characterCount": "{count} 個字元",
|
|
236
|
+
"characterLimitHint": "最多可輸入 {limit} 個字元。",
|
|
237
|
+
"charactersLeft": "還可輸入 {count} 個字元",
|
|
238
|
+
"charactersOver": "超出 {count} 個字元",
|
|
235
239
|
"codeBlock": "程式碼區塊",
|
|
236
240
|
"color": "顏色",
|
|
237
241
|
"contentLabel": "富文字編輯器",
|
|
@@ -239,6 +243,7 @@
|
|
|
239
243
|
"deleteColumn": "刪除欄",
|
|
240
244
|
"deleteRow": "刪除列",
|
|
241
245
|
"deleteTable": "刪除表格",
|
|
246
|
+
"editImage": "編輯圖片",
|
|
242
247
|
"editLink": "編輯連結",
|
|
243
248
|
"enterUrl": "輸入 URL",
|
|
244
249
|
"fontSize": "字型大小",
|
|
@@ -246,6 +251,11 @@
|
|
|
246
251
|
"heading": "標題 {level}",
|
|
247
252
|
"heightPx": "高度 (px)",
|
|
248
253
|
"historyGroup": "歷程記錄",
|
|
254
|
+
"imageFile": "圖片檔案",
|
|
255
|
+
"imageInserted": "已插入 {name}。",
|
|
256
|
+
"imageTooLarge": "未新增 {name}。檔案大於 {size}。",
|
|
257
|
+
"imageUploadFailed": "無法上傳 {name}。",
|
|
258
|
+
"imageUploading": "正在上傳 {name}",
|
|
249
259
|
"imageUrl": "圖片 URL",
|
|
250
260
|
"indent": "增加縮排",
|
|
251
261
|
"indentGroup": "縮排",
|
|
@@ -261,12 +271,17 @@
|
|
|
261
271
|
"justify": "左右對齊",
|
|
262
272
|
"linkGroup": "連結",
|
|
263
273
|
"listGroup": "清單",
|
|
274
|
+
"mentionNoResults": "沒有相符的項目",
|
|
275
|
+
"mentionResults": "{count} 個建議",
|
|
276
|
+
"mentionSearching": "正在搜尋…",
|
|
277
|
+
"mentionSuggestions": "建議",
|
|
264
278
|
"mergeCells": "合併選取的儲存格",
|
|
265
279
|
"outdent": "減少縮排",
|
|
266
280
|
"paragraph": "段落",
|
|
267
281
|
"quotation": "引用",
|
|
268
282
|
"redo": "重做",
|
|
269
283
|
"removeLink": "移除連結",
|
|
284
|
+
"save": "儲存",
|
|
270
285
|
"selectFontFamily": "選取字型",
|
|
271
286
|
"selectFontSize": "選取字型大小",
|
|
272
287
|
"splitCell": "分割儲存格",
|
|
@@ -280,7 +295,8 @@
|
|
|
280
295
|
"toolbar": "格式設定",
|
|
281
296
|
"underline": "底線",
|
|
282
297
|
"undo": "復原",
|
|
283
|
-
"widthPx": "寬度 (px)"
|
|
298
|
+
"widthPx": "寬度 (px)",
|
|
299
|
+
"wordCount": "{count} 個字詞"
|
|
284
300
|
},
|
|
285
301
|
"fileUpload": {
|
|
286
302
|
"browse": "瀏覽檔案",
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ElementRef } from "@angular/core";
|
|
3
3
|
import { FormValueControl } from "@angular/forms/signals";
|
|
4
|
+
import { FileUploadHandler } from "@nanahoshi/mona-ui/file-upload";
|
|
4
5
|
import { Editor, JSONContent } from "@tiptap/core";
|
|
6
|
+
import { Observable, Subject } from "rxjs";
|
|
5
7
|
import { ImmutableSet } from "@mirei/ts-collections";
|
|
6
8
|
import { EditorState } from "@tiptap/pm/state";
|
|
7
|
-
import { Subject } from "rxjs";
|
|
8
9
|
import { MonaEditorMessages } from "@nanahoshi/mona-ui/i18n";
|
|
10
|
+
import "@tiptap/pm/model";
|
|
9
11
|
/** The content of the editor after a user change, emitted by `EditorComponent.update`. */
|
|
10
12
|
interface ContentChangeEvent {
|
|
11
13
|
/** The content as HTML, the same as the editor's `html` property. */
|
|
@@ -13,6 +15,22 @@ interface ContentChangeEvent {
|
|
|
13
15
|
/** The content as a `JSONContent` document, the same as the editor's `json` property. */
|
|
14
16
|
json: JSONContent;
|
|
15
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Someone, or something, the content can mention. A mention keeps both: the content shows `@label`, and the HTML
|
|
20
|
+
* keeps the id in `data-id` for the page to read, such as to notify the person.
|
|
21
|
+
*/
|
|
22
|
+
interface EditorMention {
|
|
23
|
+
/** What the mention refers to, such as a user id. */
|
|
24
|
+
readonly id: string;
|
|
25
|
+
/** What the mention shows after the `@`, such as a name. */
|
|
26
|
+
readonly label: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Finds the mentions to offer for the text typed after `@`, which is empty right after the `@`. It returns them, or a
|
|
30
|
+
* promise or an observable of them; a new search replaces one still running, so an observable can be HttpClient's
|
|
31
|
+
* request. Return a few, such as the first ten matches: the list doesn't page.
|
|
32
|
+
*/
|
|
33
|
+
type EditorMentionSearch = (query: string) => Iterable<EditorMention> | Observable<Iterable<EditorMention>> | Promise<Iterable<EditorMention>>;
|
|
16
34
|
/**
|
|
17
35
|
* The features of an editor. Every feature is on unless it is set to `false`. Turning one off removes its toolbar
|
|
18
36
|
* control, and the editor no longer keeps that kind of content.
|
|
@@ -57,6 +75,11 @@ interface EditorSettings {
|
|
|
57
75
|
link: boolean;
|
|
58
76
|
/** Whether the toolbar shows the numbered and bulleted list buttons and the editor keeps those lists. */
|
|
59
77
|
list: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the editor keeps mentions, and offers them as `@` is typed when it has a `mentionSearch`. It has no
|
|
80
|
+
* toolbar control. Optional, unlike the others, so settings written before it still compile.
|
|
81
|
+
*/
|
|
82
|
+
mention?: boolean;
|
|
60
83
|
/** Whether the toolbar shows the strikethrough button and the editor keeps struck-through text. */
|
|
61
84
|
strikethrough: boolean;
|
|
62
85
|
/** Whether the toolbar shows the subscript button and the editor keeps subscript text. */
|
|
@@ -93,6 +116,10 @@ declare class EditorService {
|
|
|
93
116
|
readonly settings: import("@angular/core").WritableSignal<Partial<EditorSettings>>;
|
|
94
117
|
readonly state: import("@angular/core").Signal<EditorState | null>;
|
|
95
118
|
readonly update$: Subject<void>;
|
|
119
|
+
/** Set by the image upload service, which uploads pasted and dropped images. */
|
|
120
|
+
imageUploader: EditorImageUploader | null;
|
|
121
|
+
/** Set by the mention service, which offers mentions as `@` is typed. */
|
|
122
|
+
mentionController: EditorMentionController | null;
|
|
96
123
|
destroy(): void;
|
|
97
124
|
/**
|
|
98
125
|
* Replaces the document without emitting an update, as for a value set from outside.
|
|
@@ -115,11 +142,24 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
115
142
|
#private;
|
|
116
143
|
protected readonly baseClass: import("@angular/core").Signal<string>;
|
|
117
144
|
protected readonly containerClass: import("@angular/core").Signal<string>;
|
|
145
|
+
/** The counts under the content: the words, then the characters or the characters left. */
|
|
146
|
+
protected readonly countParts: import("@angular/core").Signal<{
|
|
147
|
+
readonly class: string;
|
|
148
|
+
readonly text: string;
|
|
149
|
+
}[]>;
|
|
118
150
|
protected readonly editorContainer: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
|
|
119
151
|
protected readonly editorService: EditorService;
|
|
120
152
|
protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
|
|
153
|
+
protected readonly footerClass = "not-prose flex flex-wrap justify-end gap-x-3 border-t border-border-subtle px-2 py-1 text-xs text-muted-foreground";
|
|
121
154
|
protected readonly invalidState: import("@angular/core").Signal<boolean>;
|
|
155
|
+
/** Says how many characters the content can have, for assistive technology. */
|
|
156
|
+
protected readonly limitHint: import("@angular/core").Signal<string>;
|
|
157
|
+
protected readonly limitHintId: string;
|
|
158
|
+
/** How many characters are left, or how many are over the limit. Null without a limit. */
|
|
159
|
+
protected readonly limitMessage: import("@angular/core").Signal<string | null>;
|
|
122
160
|
protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaEditorMessages>;
|
|
161
|
+
/** Whether the content has more characters than its limit. */
|
|
162
|
+
protected readonly overLimit: import("@angular/core").Signal<boolean>;
|
|
123
163
|
protected readonly placeholderClass: import("@angular/core").Signal<string>;
|
|
124
164
|
protected readonly toolbarClass: import("@angular/core").Signal<string>;
|
|
125
165
|
protected readonly toolbarElement: import("@angular/core").Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
@@ -141,6 +181,13 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
141
181
|
* @deprecated Use `editorBlur`.
|
|
142
182
|
*/
|
|
143
183
|
readonly blur: import("@angular/core").OutputEmitterRef<void>;
|
|
184
|
+
/**
|
|
185
|
+
* @description How many characters the content should fit, counted as people see them: the text without the
|
|
186
|
+
* markup, where an emoji or a letter with an accent counts once. Under the content, a count says how many are
|
|
187
|
+
* left. Typing past the limit isn't blocked, so nothing pasted is lost: the count turns into how many are over,
|
|
188
|
+
* and the editor shows as invalid. For a form, validate the value with `countEditorText`.
|
|
189
|
+
*/
|
|
190
|
+
readonly characterLimit: import("@angular/core").InputSignal<number | null>;
|
|
144
191
|
/**
|
|
145
192
|
* @description The initial content of the editor, as HTML or a {@link JSONContent} document. A later change
|
|
146
193
|
* replaces the document, unless it is the content the editor already has.
|
|
@@ -166,11 +213,30 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
166
213
|
* @description Emits when the editor gains focus.
|
|
167
214
|
*/
|
|
168
215
|
readonly editorFocus: import("@angular/core").OutputEmitterRef<void>;
|
|
216
|
+
/**
|
|
217
|
+
* @description The image files `imageUpload` takes, as an `accept` attribute: MIME types such as `image/png`,
|
|
218
|
+
* `image/*` for any image, and extensions such as `.png`.
|
|
219
|
+
*/
|
|
220
|
+
readonly imageAccept: import("@angular/core").InputSignal<string>;
|
|
221
|
+
/** @description The largest image file, in bytes, that `imageUpload` takes. Null takes any size. */
|
|
222
|
+
readonly imageMaxFileSize: import("@angular/core").InputSignal<number | null>;
|
|
223
|
+
/**
|
|
224
|
+
* @description Uploads image files, and returns the image's address: as a promise or an observable, the same
|
|
225
|
+
* way as the file upload's `upload`. With it, the image form takes a file, and images pasted or dropped into the
|
|
226
|
+
* content upload in place, with a placeholder while they do. Without it, images are added by their address.
|
|
227
|
+
*/
|
|
228
|
+
readonly imageUpload: import("@angular/core").InputSignal<FileUploadHandler | null>;
|
|
169
229
|
/**
|
|
170
230
|
* @description Marks the editor as invalid once it has been touched. When bound to a signal form field via
|
|
171
231
|
* `[formField]`, the form sets it.
|
|
172
232
|
*/
|
|
173
233
|
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
234
|
+
/**
|
|
235
|
+
* @description Finds the mentions to offer as `@` and a query are typed. With it, a list of suggestions opens at
|
|
236
|
+
* the `@`: the arrow keys move through it, Enter or Tab puts the highlighted one in the content, and Escape closes
|
|
237
|
+
* it. A mention is kept in the HTML as `<span data-type="mention" data-id="…">`.
|
|
238
|
+
*/
|
|
239
|
+
readonly mentionSearch: import("@angular/core").InputSignal<EditorMentionSearch | null>;
|
|
174
240
|
/**
|
|
175
241
|
* @description Text shown in the empty editor, and given to assistive technology as `aria-placeholder`. It is not
|
|
176
242
|
* a name: use a label or `aria-label` too.
|
|
@@ -193,6 +259,10 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
193
259
|
* @description The settings of the editor. Changing them rebuilds the editor and keeps its document.
|
|
194
260
|
*/
|
|
195
261
|
readonly settings: import("@angular/core").InputSignal<Partial<EditorSettings>>;
|
|
262
|
+
/** @description Shows how many characters the content has, under it. A `characterLimit` shows the count anyway. */
|
|
263
|
+
readonly showCharacterCount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
264
|
+
/** @description Shows how many words the content has, under it. */
|
|
265
|
+
readonly showWordCount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
196
266
|
/**
|
|
197
267
|
* @description Emits when the editor loses focus.
|
|
198
268
|
* Form directives (`[formField]`, `ngModel`, `formControl`) listen to this to mark the field as touched.
|
|
@@ -249,6 +319,11 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
249
319
|
"required": false;
|
|
250
320
|
"isSignal": true;
|
|
251
321
|
};
|
|
322
|
+
"characterLimit": {
|
|
323
|
+
"alias": "characterLimit";
|
|
324
|
+
"required": false;
|
|
325
|
+
"isSignal": true;
|
|
326
|
+
};
|
|
252
327
|
"content": {
|
|
253
328
|
"alias": "content";
|
|
254
329
|
"required": false;
|
|
@@ -259,11 +334,31 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
259
334
|
"required": false;
|
|
260
335
|
"isSignal": true;
|
|
261
336
|
};
|
|
337
|
+
"imageAccept": {
|
|
338
|
+
"alias": "imageAccept";
|
|
339
|
+
"required": false;
|
|
340
|
+
"isSignal": true;
|
|
341
|
+
};
|
|
342
|
+
"imageMaxFileSize": {
|
|
343
|
+
"alias": "imageMaxFileSize";
|
|
344
|
+
"required": false;
|
|
345
|
+
"isSignal": true;
|
|
346
|
+
};
|
|
347
|
+
"imageUpload": {
|
|
348
|
+
"alias": "imageUpload";
|
|
349
|
+
"required": false;
|
|
350
|
+
"isSignal": true;
|
|
351
|
+
};
|
|
262
352
|
"invalid": {
|
|
263
353
|
"alias": "invalid";
|
|
264
354
|
"required": false;
|
|
265
355
|
"isSignal": true;
|
|
266
356
|
};
|
|
357
|
+
"mentionSearch": {
|
|
358
|
+
"alias": "mentionSearch";
|
|
359
|
+
"required": false;
|
|
360
|
+
"isSignal": true;
|
|
361
|
+
};
|
|
267
362
|
"placeholder": {
|
|
268
363
|
"alias": "placeholder";
|
|
269
364
|
"required": false;
|
|
@@ -284,6 +379,16 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
284
379
|
"required": false;
|
|
285
380
|
"isSignal": true;
|
|
286
381
|
};
|
|
382
|
+
"showCharacterCount": {
|
|
383
|
+
"alias": "showCharacterCount";
|
|
384
|
+
"required": false;
|
|
385
|
+
"isSignal": true;
|
|
386
|
+
};
|
|
387
|
+
"showWordCount": {
|
|
388
|
+
"alias": "showWordCount";
|
|
389
|
+
"required": false;
|
|
390
|
+
"isSignal": true;
|
|
391
|
+
};
|
|
287
392
|
"touched": {
|
|
288
393
|
"alias": "touched";
|
|
289
394
|
"required": false;
|
|
@@ -311,4 +416,21 @@ export declare class EditorComponent implements FormValueControl<string> {
|
|
|
311
416
|
}, never, never, true, never>;
|
|
312
417
|
}
|
|
313
418
|
export declare const EDITOR_DEFAULT_MESSAGES: MonaEditorMessages;
|
|
314
|
-
|
|
419
|
+
/** What {@link countEditorText} counts: characters as people see them, or words. */
|
|
420
|
+
type EditorTextUnit = "characters" | "words";
|
|
421
|
+
/**
|
|
422
|
+
* Counts the characters or words of the editor's HTML value, as the editor's own count does: the text people see,
|
|
423
|
+
* without the markup. Use it in a validator for a limit:
|
|
424
|
+
*
|
|
425
|
+
* ```ts
|
|
426
|
+
* validate(path.body, ({ value }) =>
|
|
427
|
+
* countEditorText(value(), "characters") > 500 ? { kind: "tooLong", message: "Keep it to 500 characters." } : undefined
|
|
428
|
+
* );
|
|
429
|
+
* ```
|
|
430
|
+
*
|
|
431
|
+
* @param html The editor's value.
|
|
432
|
+
* @param unit Characters, as people see them, or words.
|
|
433
|
+
* @param locale The locale whose rules find the words, such as `"ja-JP"`. Defaults to the browser's.
|
|
434
|
+
*/
|
|
435
|
+
export declare function countEditorText(html: string, unit: EditorTextUnit, locale?: string): number;
|
|
436
|
+
export type { ContentChangeEvent, EditorMention, EditorMentionSearch, EditorSettings, EditorTextUnit };
|
|
@@ -3,6 +3,7 @@ import { ElementRef } from "@angular/core";
|
|
|
3
3
|
import { FormValueControl } from "@angular/forms/signals";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
5
5
|
import { MonaFileUploadMessages } from "@nanahoshi/mona-ui/i18n";
|
|
6
|
+
import "@nanahoshi/mona-ui/internal";
|
|
6
7
|
/**
|
|
7
8
|
* What the upload function gets with each file.
|
|
8
9
|
*/
|