magic-editor-x 2.0.0 → 2.2.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/CHANGELOG.md +107 -0
- package/README.md +315 -103
- package/bin/magic-editor-x.mjs +190 -0
- package/dist/admin/{ConfigurationPage-DvAifELO.mjs → ConfigurationPage-3Dir3dAf.mjs} +126 -7
- package/dist/admin/{ConfigurationPage-B1uCIE3J.js → ConfigurationPage-YvnPnna6.js} +125 -4
- package/dist/admin/{CustomBlocksPage-6eWCOreU.js → CustomBlocksPage-BiiL2ORG.js} +4 -4
- package/dist/admin/{CustomBlocksPage-6-OQwpXQ.mjs → CustomBlocksPage-CR2BaP9O.mjs} +4 -4
- package/dist/admin/EditorField-B8pyAxPE.mjs +11935 -0
- package/dist/admin/EditorField-Diq1j8kc.js +11970 -0
- package/dist/admin/{api-B-RsxJCs.js → api-Dsq53giv.js} +3 -0
- package/dist/admin/{api-C4XsDZxd.mjs → api-RZ0Fz0BD.mjs} +3 -0
- package/dist/admin/de-62Vxb2iw.js +250 -0
- package/dist/admin/de-BVvwSYYO.mjs +250 -0
- package/dist/admin/de-BmmLBJli.mjs +41 -0
- package/dist/admin/{de-BMxADn2Z.mjs → de-Bt6pYIWi.mjs} +16 -1
- package/dist/admin/{de-DcDPRzV4.js → de-BteRx2iA.js} +28 -1
- package/dist/admin/{de-n5V6c5RT.mjs → de-CFX5atOk.mjs} +28 -1
- package/dist/admin/{de-Dx7vUW0Z.js → de-CVbi685U.js} +16 -1
- package/dist/admin/de-DaJwN6nk.js +41 -0
- package/dist/admin/{en-sNn4z9lA.js → en-BX362fTp.js} +16 -1
- package/dist/admin/{en-BQ5Pxe2o.mjs → en-B_HltUxZ.mjs} +16 -1
- package/dist/admin/en-Cg2Ak5Cr.mjs +250 -0
- package/dist/admin/en-Cn78RZs-.js +41 -0
- package/dist/admin/{en-D-DGftl0.js → en-CyjAcccB.js} +28 -1
- package/dist/admin/en-D7mZWLGp.mjs +41 -0
- package/dist/admin/en-VlkaIzrM.js +250 -0
- package/dist/admin/{en-BqNm3nMQ.mjs → en-ea0tfA5i.mjs} +28 -1
- package/dist/admin/es-BT9oAcHf.js +250 -0
- package/dist/admin/es-BmGtLkJD.js +41 -0
- package/dist/admin/{es-Di0pyQCh.js → es-C8GZFGjv.js} +28 -1
- package/dist/admin/es-C9-cXdb6.mjs +250 -0
- package/dist/admin/{es-SzeTV4q8.mjs → es-CEi_ycX8.mjs} +28 -1
- package/dist/admin/{es-DVsXnS0N.js → es-CHHEZi44.js} +16 -1
- package/dist/admin/{es-B6NYq0VH.mjs → es-CrhwOq-5.mjs} +16 -1
- package/dist/admin/es-joykG5I9.mjs +41 -0
- package/dist/admin/{fr-DmG3_Cn-.mjs → fr-5djKfQ3s.mjs} +16 -1
- package/dist/admin/{fr-Fwxcj4SM.js → fr-B3SL0TBV.js} +16 -1
- package/dist/admin/{fr-DhgPYHIH.mjs → fr-BAMSvQbR.mjs} +28 -1
- package/dist/admin/fr-CrzxGe5e.mjs +41 -0
- package/dist/admin/fr-Ct_uPqxV.js +41 -0
- package/dist/admin/fr-D6KJqPWi.js +250 -0
- package/dist/admin/fr-DpU_qiXR.mjs +250 -0
- package/dist/admin/{fr-D6F--jIB.js → fr-oRCJNdeJ.js} +28 -1
- package/dist/admin/index-C-lyON1B.mjs +303 -0
- package/dist/admin/index-iA0lued_.js +302 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/pt-BOrl6x-r.js +250 -0
- package/dist/admin/{pt-BbdwHlWF.mjs → pt-BdnY2Cth.mjs} +16 -1
- package/dist/admin/{pt-BvSl1btT.mjs → pt-CQrfqsCN.mjs} +28 -1
- package/dist/admin/{pt-C6nr71Yw.js → pt-EVwCuBUK.js} +16 -1
- package/dist/admin/pt-Ga-4Hsv0.mjs +41 -0
- package/dist/admin/pt-chN2jrXl.js +41 -0
- package/dist/admin/pt-jUqOR7Xh.mjs +250 -0
- package/dist/admin/{pt-BPo0ex21.js → pt-tUeJ2Ywd.js} +28 -1
- package/dist/admin/{sanitize-9UVcXFfc.js → sanitize-Cb4jvBhj.js} +88 -12
- package/dist/admin/{sanitize-D4kfZ_ly.mjs → sanitize-ClkX823p.mjs} +89 -13
- package/dist/admin/{useT-B5M49wGH.js → useT-BWZ_-Hel.js} +1 -1
- package/dist/admin/{useT-CjX6fL2m.mjs → useT-pvHmgBFj.mjs} +1 -1
- package/dist/render/index.d.mts +75 -0
- package/dist/render/index.d.ts +75 -0
- package/dist/render/index.js +1420 -0
- package/dist/render/index.mjs +1398 -0
- package/dist/server/index.js +9562 -589
- package/dist/server/index.mjs +9565 -592
- package/package.json +21 -4
- package/schema/magic-editor-x.schema.json +967 -0
- package/types/index.d.ts +211 -0
- package/types/render.d.ts +75 -0
- package/dist/admin/EditorField-DocyD2Q3.js +0 -5506
- package/dist/admin/EditorField-ThSoOCPm.mjs +0 -5471
- package/dist/admin/de-B8XFFhHh.js +0 -95
- package/dist/admin/de-DBR893G4.js +0 -13
- package/dist/admin/de-RAxzvrwm.mjs +0 -95
- package/dist/admin/de-fBFh09Wl.mjs +0 -13
- package/dist/admin/en-BzfyifEU.mjs +0 -95
- package/dist/admin/en-D9Nfccux.mjs +0 -13
- package/dist/admin/en-DcWUTE2J.js +0 -95
- package/dist/admin/en-gueRT44P.js +0 -13
- package/dist/admin/es-B0Zy8DVg.mjs +0 -13
- package/dist/admin/es-BOtVc9qv.js +0 -95
- package/dist/admin/es-C2OJVYkV.mjs +0 -95
- package/dist/admin/es-DRGs7meF.js +0 -13
- package/dist/admin/fr-B8rdLAIL.js +0 -13
- package/dist/admin/fr-Bpo5Uq1f.mjs +0 -95
- package/dist/admin/fr-DfxKaOc_.js +0 -95
- package/dist/admin/fr-oiUb2bb_.mjs +0 -13
- package/dist/admin/index-CwfaB5-e.js +0 -155
- package/dist/admin/index-D1Q5Rlt6.mjs +0 -156
- package/dist/admin/pt-B3Jce6uT.mjs +0 -13
- package/dist/admin/pt-BiWuSBcH.js +0 -13
- package/dist/admin/pt-DqCXuI4S.mjs +0 -95
- package/dist/admin/pt-LCvjwk0y.js +0 -95
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
const pt = {
|
|
2
|
+
"editor.upload.failed": "Não foi possível enviar o arquivo.",
|
|
3
|
+
"editor.upload.urlFailed": "Não foi possível carregar a imagem a partir desta URL.",
|
|
4
|
+
"editor.placeholder": "Escreva algo ou pressione Tab para escolher um bloco",
|
|
5
|
+
"editor.value.invalid": "Não foi possível ler o conteúdo salvo. Ele é mantido até que edite este campo.",
|
|
6
|
+
"editor.config.error": "Não foi possível carregar o editor.",
|
|
7
|
+
"editor.config.retry": "Tentar novamente",
|
|
8
|
+
"editor.loading": "Carregando o editor",
|
|
9
|
+
"editor.collab.status.connecting": "Conectando",
|
|
10
|
+
"editor.collab.status.syncing": "Sincronizando",
|
|
11
|
+
"editor.collab.status.live": "Ao vivo",
|
|
12
|
+
"editor.collab.status.offline": "Offline",
|
|
13
|
+
"editor.collab.status.denied": "Edição ao vivo indisponível",
|
|
14
|
+
"editor.collab.status.error": "Edição ao vivo indisponível",
|
|
15
|
+
"editor.toolbar.undo": "Desfazer",
|
|
16
|
+
"editor.toolbar.redo": "Refazer",
|
|
17
|
+
"editor.toolbar.history": "Histórico de versões",
|
|
18
|
+
"editor.toolbar.exitFullscreen": "Sair da tela cheia",
|
|
19
|
+
"editor.toolbar.fullscreen": "Tela cheia",
|
|
20
|
+
"editor.collab.viewer": "{name} (visualizando)",
|
|
21
|
+
"editor.collab.readOnly": "Somente leitura",
|
|
22
|
+
"editor.collab.peers": "{count, plural, =0 {Ninguém mais está editando} one {# outra pessoa está editando} other {# outras pessoas estão editando}}",
|
|
23
|
+
"editor.history.trigger.manual": "Salva",
|
|
24
|
+
"editor.history.trigger.auto": "Automática",
|
|
25
|
+
"editor.history.trigger.restore": "Restaurada",
|
|
26
|
+
"editor.history.trigger.legacy": "Da 1.x",
|
|
27
|
+
"editor.history.saved": "Versão salva.",
|
|
28
|
+
"editor.history.unchanged": "Nada mudou desde a última versão.",
|
|
29
|
+
"editor.history.saveFailed": "Não foi possível salvar a versão.",
|
|
30
|
+
"editor.history.restored": "Versão {version} restaurada. Salve a entrada para mantê-la.",
|
|
31
|
+
"editor.history.restoreFailed": "Não foi possível restaurar esta versão.",
|
|
32
|
+
"editor.history.close": "Fechar",
|
|
33
|
+
"editor.history.title": "Histórico de versões",
|
|
34
|
+
"editor.history.description": "Versões deste campo. Restaurar substitui o conteúdo do editor; salve a entrada para mantê-lo.",
|
|
35
|
+
"editor.history.loading": "Carregando versões",
|
|
36
|
+
"editor.history.error": "Não foi possível carregar as versões.",
|
|
37
|
+
"editor.history.retry": "Tentar novamente",
|
|
38
|
+
"editor.history.empty": "Ainda não há versões. Salve uma para iniciar o histórico.",
|
|
39
|
+
"editor.history.listLabel": "Versões",
|
|
40
|
+
"editor.history.version": "Versão {version}",
|
|
41
|
+
"editor.history.byline": "{date} por {name}",
|
|
42
|
+
"editor.history.stats": "{blocks, plural, one {# bloco} other {# blocos}} · {words, plural, one {# palavra} other {# palavras}}",
|
|
43
|
+
"editor.history.preview": "Pré-visualizar a versão {version}",
|
|
44
|
+
"editor.history.restore": "Restaurar",
|
|
45
|
+
"editor.history.previewLoading": "Carregando pré-visualização",
|
|
46
|
+
"editor.history.previewError": "Não foi possível carregar a pré-visualização.",
|
|
47
|
+
"editor.history.cancel": "Fechar",
|
|
48
|
+
"editor.history.save": "Salvar a versão atual",
|
|
49
|
+
"editor.history.confirmTitle": "Restaurar a versão {version}?",
|
|
50
|
+
"editor.history.confirmBody": "O conteúdo do editor é substituído por esta versão. Nada é salvo até que salve a entrada, então ainda é possível descartar a alteração.",
|
|
51
|
+
"editor.ai.action.improve": "Melhorar o texto",
|
|
52
|
+
"editor.ai.action.grammar": "Corrigir ortografia e gramática",
|
|
53
|
+
"editor.ai.action.shorten": "Encurtar",
|
|
54
|
+
"editor.ai.action.expand": "Expandir",
|
|
55
|
+
"editor.ai.action.summarize": "Resumir",
|
|
56
|
+
"editor.ai.action.simplify": "Simplificar",
|
|
57
|
+
"editor.ai.action.translate": "Traduzir",
|
|
58
|
+
"editor.ai.action.tone": "Mudar o tom",
|
|
59
|
+
"editor.ai.action.continue": "Continuar escrevendo",
|
|
60
|
+
"editor.ai.tone.professional": "Profissional",
|
|
61
|
+
"editor.ai.tone.friendly": "Amigável",
|
|
62
|
+
"editor.ai.tone.casual": "Descontraído",
|
|
63
|
+
"editor.ai.tone.confident": "Confiante",
|
|
64
|
+
"editor.ai.tone.formal": "Formal",
|
|
65
|
+
"editor.ai.tone.persuasive": "Persuasivo",
|
|
66
|
+
"editor.ai.error.disabled": "O assistente de IA está desativado.",
|
|
67
|
+
"editor.ai.error.notConfigured": "O assistente de IA ainda não está configurado.",
|
|
68
|
+
"editor.ai.error.noKey": "A chave do provedor de IA está faltando.",
|
|
69
|
+
"editor.ai.error.auth": "O provedor de IA recusou a chave.",
|
|
70
|
+
"editor.ai.error.busy": "O provedor de IA está ocupado. Tente novamente mais tarde.",
|
|
71
|
+
"editor.ai.error.timeout": "O provedor de IA não respondeu a tempo.",
|
|
72
|
+
"editor.ai.error.refused": "O provedor de IA recusou este pedido.",
|
|
73
|
+
"editor.ai.error.rateLimit": "Você enviou muitos pedidos. Tente novamente em um minuto.",
|
|
74
|
+
"editor.ai.error.tooLong": "O texto selecionado é longo demais para o assistente.",
|
|
75
|
+
"editor.ai.error.generic": "O assistente de IA não está disponível no momento.",
|
|
76
|
+
"editor.ai.close": "Fechar",
|
|
77
|
+
"editor.ai.title": "Assistente de IA",
|
|
78
|
+
"editor.ai.selection": "Texto selecionado",
|
|
79
|
+
"editor.ai.noSelection": "Selecione primeiro um texto no editor.",
|
|
80
|
+
"editor.ai.action": "O que o assistente deve fazer?",
|
|
81
|
+
"editor.ai.language": "Idioma de destino",
|
|
82
|
+
"editor.ai.tone": "Tom",
|
|
83
|
+
"editor.ai.privacy": "O texto selecionado é enviado ao provedor de IA configurado pela sua administração.",
|
|
84
|
+
"editor.ai.working": "Escrevendo uma sugestão",
|
|
85
|
+
"editor.ai.suggestion": "Sugestão",
|
|
86
|
+
"editor.ai.cancel": "Cancelar",
|
|
87
|
+
"editor.ai.retry": "Tentar novamente",
|
|
88
|
+
"editor.ai.generate": "Gerar",
|
|
89
|
+
"editor.ai.apply": "Substituir a seleção",
|
|
90
|
+
"editor.keyboard": "Pressione Tab em um bloco vazio para escolher um tipo de bloco. Pressione Escape e depois Tab para sair do editor.",
|
|
91
|
+
"editor.collab.status.reconnecting": "Reconectando",
|
|
92
|
+
"editor.collab.away": "{name} (ausente)",
|
|
93
|
+
"editor.collab.editingBlock": "{name} está editando este bloco",
|
|
94
|
+
"editor.collab.more": "+{count}",
|
|
95
|
+
"editor.collab.unsent": "As alterações são mantidas e enviadas quando a conexão voltar",
|
|
96
|
+
"editor.collab.upgrade": "Recarregue a página para continuar editando ao vivo",
|
|
97
|
+
"editor.collab.joined": "{names} entrou",
|
|
98
|
+
"editor.collab.left": "{names} saiu",
|
|
99
|
+
"editor.history.namedLatest": "Nada mudou desde a última versão, por isso o nome foi atribuído a ela.",
|
|
100
|
+
"editor.history.labelField": "Nome da nova versão",
|
|
101
|
+
"editor.history.labelHint": 'Opcional. Por exemplo, "Antes da revisão jurídica". Até 120 caracteres.',
|
|
102
|
+
"editor.history.labelTooLong": "Use no máximo 120 caracteres.",
|
|
103
|
+
"editor.history.rename": "Renomear a versão {version}",
|
|
104
|
+
"editor.history.renameLabel": "Nome da versão",
|
|
105
|
+
"editor.history.renameHint": "Deixe vazio para remover o nome.",
|
|
106
|
+
"editor.history.renameSave": "Guardar o nome",
|
|
107
|
+
"editor.history.renameCancel": "Cancelar",
|
|
108
|
+
"editor.history.renamed": "Nome da versão guardado.",
|
|
109
|
+
"editor.history.renameFailed": "Não foi possível guardar o nome.",
|
|
110
|
+
"editor.history.tabs": "Vistas da versão",
|
|
111
|
+
"editor.history.tab.preview": "Pré-visualização",
|
|
112
|
+
"editor.history.tab.changes": "Alterações",
|
|
113
|
+
"editor.history.diff.loading": "A comparar com o conteúdo atual",
|
|
114
|
+
"editor.history.diff.error": "Não foi possível mostrar as alterações.",
|
|
115
|
+
"editor.history.diff.none": "Esta versão tem o mesmo conteúdo que o editor.",
|
|
116
|
+
"editor.history.diff.help": 'Comparado com o conteúdo atual do editor: "Adicionado" é novo no editor desde esta versão, "Removido" estava apenas nesta versão.',
|
|
117
|
+
"editor.history.diff.summary": "{changed} alterados · {added} adicionados · {removed} removidos · {moved} movidos",
|
|
118
|
+
"editor.history.diff.op.added": "Adicionado desde esta versão",
|
|
119
|
+
"editor.history.diff.op.removed": "Removido desde esta versão",
|
|
120
|
+
"editor.history.diff.op.changed": "Alterado",
|
|
121
|
+
"editor.history.diff.op.moved": "Movido",
|
|
122
|
+
"editor.history.diff.formatting": "Apenas formatação",
|
|
123
|
+
"editor.history.diff.inserted": "Texto adicionado:",
|
|
124
|
+
"editor.history.diff.deleted": "Texto removido:",
|
|
125
|
+
"editor.history.diff.empty": "(vazio)",
|
|
126
|
+
"editor.history.diff.restoreBlock": "Restaurar este bloco",
|
|
127
|
+
"editor.history.diff.restoreBlockLabel": "Restaurar o bloco {number} da versão {version}",
|
|
128
|
+
"editor.history.diff.blockRestored": "Bloco restaurado. Guarde a entrada para o manter.",
|
|
129
|
+
"editor.history.diff.restoreFailed": "Não foi possível restaurar o bloco.",
|
|
130
|
+
"editor.history.diff.more": "{count, plural, one {# alteração adicional não é mostrada} other {# alterações adicionais não são mostradas}}.",
|
|
131
|
+
"editor.paste.blocksDropped": "{count, plural, one {# bloco colado não é permitido neste campo e foi omitido} other {# blocos colados não são permitidos neste campo e foram omitidos}}.",
|
|
132
|
+
"editor.paste.imagesFailed": "{count, plural, one {Não foi possível adicionar # imagem. Carregue-a} other {Não foi possível adicionar # imagens. Carregue-as}} com o bloco de imagem.",
|
|
133
|
+
"editor.paste.imagesNoUpload": "{count, plural, one {# imagem foi omitida} other {# imagens foram omitidas}} porque não pode carregar ficheiros.",
|
|
134
|
+
"editor.paste.failed": "Não foi possível converter o conteúdo colado.",
|
|
135
|
+
"editor.quality.title": "Verificações de qualidade",
|
|
136
|
+
"editor.quality.summary": "{errors, plural, one {# erro} other {# erros}} · {warnings, plural, one {# aviso} other {# avisos}}",
|
|
137
|
+
"editor.quality.close": "Fechar as verificações de qualidade",
|
|
138
|
+
"editor.quality.errors": "Erros",
|
|
139
|
+
"editor.quality.warnings": "Avisos",
|
|
140
|
+
"editor.quality.empty": "Nenhum problema encontrado.",
|
|
141
|
+
"editor.quality.block": "Bloco {index}",
|
|
142
|
+
"editor.quality.guard.blocked": "A publicação fica bloqueada enquanto houver erros.",
|
|
143
|
+
"editor.quality.guard.info": "Este campo não pode ser publicado enquanto tiver erros.",
|
|
144
|
+
"editor.quality.rule.imageAlt": "Imagem sem texto alternativo",
|
|
145
|
+
"editor.quality.rule.headingOrder": "O título de nível {level} salta um nível",
|
|
146
|
+
"editor.quality.rule.multipleH1": "Mais de um título de nível 1",
|
|
147
|
+
"editor.quality.rule.emptyHeading": "Título vazio",
|
|
148
|
+
"editor.quality.rule.emptyLink": "Link sem texto ou endereço",
|
|
149
|
+
"editor.quality.rule.ambiguousLink": "O texto do link «{text}» não diz para onde o link leva",
|
|
150
|
+
"editor.quality.rule.tableHeader": "Tabela sem linha de cabeçalho",
|
|
151
|
+
"editor.quality.rule.lowContrast": "O contraste de cor do texto de {ratio}:1 é inferior a 4,5:1",
|
|
152
|
+
"editor.quality.rule.unknown": "Problema",
|
|
153
|
+
"editor.quality.links.title": "Links e mídia",
|
|
154
|
+
"editor.quality.links.check": "Verificar links",
|
|
155
|
+
"editor.quality.links.checking": "Verificando links",
|
|
156
|
+
"editor.quality.links.done": "Verificação de links concluída: {count, plural, =0 {nenhum problema} one {# problema} other {# problemas}}",
|
|
157
|
+
"editor.quality.links.rateLimited": "Demasiadas verificações de links. Tente novamente em um minuto.",
|
|
158
|
+
"editor.quality.links.failed": "Não foi possível verificar os links.",
|
|
159
|
+
"editor.quality.links.none": "Este conteúdo não tem links para verificar.",
|
|
160
|
+
"editor.quality.links.results": "Resultados da verificação de links",
|
|
161
|
+
"editor.quality.links.externalOff": "Os links externos não são verificados. Um administrador pode ativar isso na configuração do plugin.",
|
|
162
|
+
"editor.quality.link.ok": "Funciona",
|
|
163
|
+
"editor.quality.link.missing": "Não encontrado",
|
|
164
|
+
"editor.quality.link.draft": "Não publicado",
|
|
165
|
+
"editor.quality.link.unknown": "Não verificado (sem acesso)",
|
|
166
|
+
"editor.quality.link.broken": "Quebrado",
|
|
167
|
+
"editor.quality.link.timeout": "Sem resposta a tempo",
|
|
168
|
+
"editor.quality.link.blocked": "Endereço não permitido",
|
|
169
|
+
"editor.quality.link.error": "Inacessível",
|
|
170
|
+
"editor.quality.link.skipped": "Não verificado",
|
|
171
|
+
"editor.quality.link.entry": "Entrada {documentId} ({type})",
|
|
172
|
+
"editor.quality.link.media": "Arquivo de mídia {id}",
|
|
173
|
+
"editor.selection.deleted": "{count, plural, one {# bloco excluído} other {# blocos excluídos}}",
|
|
174
|
+
"editor.selection.duplicated": "{count, plural, one {# bloco duplicado} other {# blocos duplicados}}",
|
|
175
|
+
"editor.selection.converted": "{count, plural, one {# bloco convertido} other {# blocos convertidos}}",
|
|
176
|
+
"editor.selection.copied": "Copiado como Markdown",
|
|
177
|
+
"editor.selection.label": "Blocos selecionados",
|
|
178
|
+
"editor.selection.count": "{count, plural, one {# bloco selecionado} other {# blocos selecionados}}",
|
|
179
|
+
"editor.selection.moveUp": "Mover para cima",
|
|
180
|
+
"editor.selection.moveDown": "Mover para baixo",
|
|
181
|
+
"editor.selection.duplicate": "Duplicar",
|
|
182
|
+
"editor.selection.copyMarkdown": "Copiar como Markdown",
|
|
183
|
+
"editor.selection.delete": "Excluir",
|
|
184
|
+
"editor.selection.convert": "Converter em",
|
|
185
|
+
"editor.toolbar.find": "Localizar e substituir",
|
|
186
|
+
"editor.toolbar.qualityCount": "Verificações de qualidade ({count, plural, one {# problema} other {# problemas}})",
|
|
187
|
+
"editor.toolbar.quality": "Verificações de qualidade",
|
|
188
|
+
"editor.toolbar.more": "Mais ações do editor",
|
|
189
|
+
"editor.toolbar.focusOff": "Sair do modo foco",
|
|
190
|
+
"editor.toolbar.focusOn": "Modo foco",
|
|
191
|
+
"editor.toolbar.shortcuts": "Atalhos de teclado",
|
|
192
|
+
"editor.stats.blocksLimit": "{blocks} / {max} blocos",
|
|
193
|
+
"editor.stats.blocks": "{blocks, plural, one {# bloco} other {# blocos}}",
|
|
194
|
+
"editor.stats.words": "{words, plural, one {# palavra} other {# palavras}}",
|
|
195
|
+
"editor.stats.charactersLimit": "{characters} / {max} caracteres",
|
|
196
|
+
"editor.stats.characters": "{characters, plural, one {# caractere} other {# caracteres}}",
|
|
197
|
+
"editor.stats.reading": "{minutes, plural, one {# min de leitura} other {# min de leitura}}",
|
|
198
|
+
"editor.find.replaced": "{count, plural, one {# ocorrência substituída} other {# ocorrências substituídas}}",
|
|
199
|
+
"editor.find.position": "{current} de {total}",
|
|
200
|
+
"editor.find.none": "Nenhuma ocorrência",
|
|
201
|
+
"editor.find.title": "Localizar e substituir",
|
|
202
|
+
"editor.find.close": "Fechar localizar e substituir",
|
|
203
|
+
"editor.find.find": "Localizar",
|
|
204
|
+
"editor.find.replaceWith": "Substituir por",
|
|
205
|
+
"editor.find.matchCase": "Diferenciar maiúsculas e minúsculas",
|
|
206
|
+
"editor.find.wholeWord": "Palavras inteiras",
|
|
207
|
+
"editor.find.regex": "Expressão regular",
|
|
208
|
+
"editor.find.previous": "Ocorrência anterior",
|
|
209
|
+
"editor.find.next": "Próxima ocorrência",
|
|
210
|
+
"editor.find.replace": "Substituir",
|
|
211
|
+
"editor.find.replaceAll": "Substituir tudo",
|
|
212
|
+
"editor.find.truncated": "(apenas as primeiras ocorrências são mostradas)",
|
|
213
|
+
"editor.find.error.invalid": "Esta expressão regular não é válida.",
|
|
214
|
+
"editor.find.error.tooLong": "Pesquise no máximo {max} caracteres.",
|
|
215
|
+
"editor.preset.title": "Configurações do campo",
|
|
216
|
+
"editor.preset.fix": "Corrigir automaticamente",
|
|
217
|
+
"editor.preset.hint": "Não será possível salvar até que este conteúdo siga as configurações do campo. A correção automática muda os níveis de título, transforma blocos não permitidos em parágrafos e remove links não permitidos.",
|
|
218
|
+
"editor.preset.rule.block": 'O tipo de bloco "{type}" não é permitido neste campo',
|
|
219
|
+
"editor.preset.rule.heading": "O nível de título {level} não é permitido neste campo",
|
|
220
|
+
"editor.preset.rule.link": "{kind, select, internal {Links para entradas não são} other {Links para endereços da web não são}} permitidos neste campo",
|
|
221
|
+
"editor.preset.rule.alt": "A imagem precisa de um texto alternativo ou deve ser marcada como decorativa",
|
|
222
|
+
"editor.preset.rule.maxBlocks": "{count} blocos, no máximo {max} são permitidos",
|
|
223
|
+
"editor.preset.rule.maxCharacters": "{count} caracteres, no máximo {max} são permitidos",
|
|
224
|
+
"editor.shortcuts.undo": "Desfazer",
|
|
225
|
+
"editor.shortcuts.redo": "Refazer",
|
|
226
|
+
"editor.shortcuts.find": "Localizar e substituir",
|
|
227
|
+
"editor.shortcuts.help": "Mostrar atalhos de teclado",
|
|
228
|
+
"editor.shortcuts.toolbox": "Escolher um tipo de bloco (em um bloco vazio)",
|
|
229
|
+
"editor.shortcuts.leave": "Sair do editor",
|
|
230
|
+
"editor.shortcuts.plainPaste": "Colar como texto simples",
|
|
231
|
+
"editor.shortcuts.md.heading": "Título (# a ######, depois Espaço)",
|
|
232
|
+
"editor.shortcuts.md.bullets": "Lista com marcadores (- ou *, depois Espaço)",
|
|
233
|
+
"editor.shortcuts.md.numbers": "Lista numerada (1. depois Espaço)",
|
|
234
|
+
"editor.shortcuts.md.checklist": "Lista de verificação ([] ou [x], depois Espaço)",
|
|
235
|
+
"editor.shortcuts.md.quote": "Citação (> depois Espaço)",
|
|
236
|
+
"editor.shortcuts.md.code": "Bloco de código (``` depois Enter)",
|
|
237
|
+
"editor.shortcuts.md.delimiter": "Separador (--- depois Enter)",
|
|
238
|
+
"editor.shortcuts.md.bold": "**negrito**, _itálico_, ~~riscado~~, `código`",
|
|
239
|
+
"editor.shortcuts.close": "Fechar",
|
|
240
|
+
"editor.shortcuts.title": "Atalhos de teclado",
|
|
241
|
+
"editor.shortcuts.editor": "Editor",
|
|
242
|
+
"editor.shortcuts.tools": "Blocos e formatação",
|
|
243
|
+
"editor.shortcuts.markdown": "Markdown ao digitar",
|
|
244
|
+
"editor.preset.fixed": "{fixed, plural, one {# bloco corrigido} other {# blocos corrigidos}}{removed, plural, =0 {} one {, # removido} other {, # removidos}}",
|
|
245
|
+
"editor.preset.notice": "Este conteúdo não segue as configurações deste campo ({count, plural, one {# problema} other {# problemas}}). Não será possível salvar até que seja corrigido.",
|
|
246
|
+
"editor.preset.show": "Mostrar problemas"
|
|
247
|
+
};
|
|
248
|
+
export {
|
|
249
|
+
pt as default
|
|
250
|
+
};
|
|
@@ -61,6 +61,21 @@ const pt = {
|
|
|
61
61
|
"tools.header.level5": "Título 5",
|
|
62
62
|
"tools.header.level6": "Título 6",
|
|
63
63
|
"tools.header.placeholder": "Título",
|
|
64
|
+
"tools.hyperlink.internal.draft": "Rascunho",
|
|
65
|
+
"tools.hyperlink.internal.empty": "Nenhuma entrada corresponde à sua pesquisa",
|
|
66
|
+
"tools.hyperlink.internal.failed": "Não foi possível carregar as entradas",
|
|
67
|
+
"tools.hyperlink.internal.loading": "A carregar tipos de conteúdo",
|
|
68
|
+
"tools.hyperlink.internal.noTypes": "Não existe nenhum tipo de conteúdo que possa ler",
|
|
69
|
+
"tools.hyperlink.internal.open": "Ligar a uma entrada",
|
|
70
|
+
"tools.hyperlink.internal.published": "Publicado",
|
|
71
|
+
"tools.hyperlink.internal.results": "Entradas",
|
|
72
|
+
"tools.hyperlink.internal.search": "Pesquisar",
|
|
73
|
+
"tools.hyperlink.internal.searchPlaceholder": "Pesquisar por título",
|
|
74
|
+
"tools.hyperlink.internal.searching": "A pesquisar",
|
|
75
|
+
"tools.hyperlink.internal.title": "Ligar a uma entrada",
|
|
76
|
+
"tools.hyperlink.internal.type": "Tipo de conteúdo",
|
|
77
|
+
"tools.hyperlink.internal.typesFailed": "Não foi possível carregar os tipos de conteúdo",
|
|
78
|
+
"tools.hyperlink.internal.untitled": "Entrada sem título",
|
|
64
79
|
"tools.hyperlink.label": "Endereço da ligação",
|
|
65
80
|
"tools.hyperlink.newTab": "Abrir num novo separador",
|
|
66
81
|
"tools.hyperlink.placeholder": "Cole uma ligação e prima Enter",
|
|
@@ -150,6 +165,18 @@ const pt = {
|
|
|
150
165
|
"tools.ui.nothingFound": "Nada encontrado",
|
|
151
166
|
"tools.ui.stub": "Este bloco não pode ser apresentado. O seu conteúdo é mantido ao guardar.",
|
|
152
167
|
"tools.warning.message": "Mensagem",
|
|
153
|
-
"tools.warning.title": "Título"
|
|
168
|
+
"tools.warning.title": "Título",
|
|
169
|
+
"tools.csp.embedBlocked": "Este conteúdo incorporado está bloqueado pela sua Content Security Policy.",
|
|
170
|
+
"tools.csp.imageBlocked": "Esta imagem está bloqueada pela sua Content Security Policy.",
|
|
171
|
+
"tools.csp.hostBlocked": "O painel de administração não permite conteúdo de {host}. O bloco é guardado sem alterações e continua a aparecer no seu site.",
|
|
172
|
+
"tools.csp.blockedGeneric": "O painel de administração não permite este conteúdo. O bloco é guardado sem alterações e continua a aparecer no seu site.",
|
|
173
|
+
"tools.csp.howTo": "Como permitir",
|
|
174
|
+
"tools.csp.askAdmin": "Peça a um administrador que o permita na Content Security Policy.",
|
|
175
|
+
"tools.image.altRequired": "Texto alternativo (obrigatório)",
|
|
176
|
+
"tools.image.alt": "Texto alternativo",
|
|
177
|
+
"tools.image.altPlaceholder": "Descreva a imagem para pessoas que não podem vê-la",
|
|
178
|
+
"tools.image.decorative": "Imagem decorativa (sem texto alternativo)",
|
|
179
|
+
"tools.image.altMissing": "Adicione um texto alternativo ou marque a imagem como decorativa.",
|
|
180
|
+
"tools.hyperlink.internalOnly": 'Escolha uma entrada com "Ligar a uma entrada"'
|
|
154
181
|
};
|
|
155
182
|
exports.default = pt;
|
|
@@ -142,6 +142,13 @@ const normalizeEditorData = (value) => {
|
|
|
142
142
|
}
|
|
143
143
|
return result;
|
|
144
144
|
};
|
|
145
|
+
const normalizeEditorDataSafe = (value) => {
|
|
146
|
+
try {
|
|
147
|
+
return normalizeEditorData(value);
|
|
148
|
+
} catch {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
145
152
|
const byteLength = (text) => {
|
|
146
153
|
let bytes = 0;
|
|
147
154
|
for (let i = 0; i < text.length; i += 1) {
|
|
@@ -194,8 +201,28 @@ const INLINE_TAGS = Object.freeze([
|
|
|
194
201
|
"sub",
|
|
195
202
|
"sup"
|
|
196
203
|
]);
|
|
204
|
+
const INTERNAL_LINK_ATTRIBUTES = Object.freeze([
|
|
205
|
+
"data-mex-uid",
|
|
206
|
+
"data-mex-document-id",
|
|
207
|
+
"data-mex-locale"
|
|
208
|
+
]);
|
|
209
|
+
const INTERNAL_LINK_RULES = Object.freeze({
|
|
210
|
+
"data-mex-uid": /^api::[a-z0-9-]{1,60}\.[a-z0-9-]{1,60}$/,
|
|
211
|
+
"data-mex-document-id": /^[a-z0-9]{1,64}$/,
|
|
212
|
+
"data-mex-locale": /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/
|
|
213
|
+
});
|
|
214
|
+
const cleanInternalLinkAttributes = (attribs) => {
|
|
215
|
+
const out = {};
|
|
216
|
+
if (!attribs || typeof attribs !== "object") return out;
|
|
217
|
+
for (const name of INTERNAL_LINK_ATTRIBUTES) {
|
|
218
|
+
const value = attribs[name];
|
|
219
|
+
if (typeof value === "string" && INTERNAL_LINK_RULES[name].test(value)) out[name] = value;
|
|
220
|
+
}
|
|
221
|
+
if (!out["data-mex-uid"] || !out["data-mex-document-id"]) return {};
|
|
222
|
+
return out;
|
|
223
|
+
};
|
|
197
224
|
const INLINE_ATTRIBUTES = Object.freeze({
|
|
198
|
-
a: ["href", "target", "rel", "title"],
|
|
225
|
+
a: ["href", "target", "rel", "title", ...INTERNAL_LINK_ATTRIBUTES],
|
|
199
226
|
span: ["class", "data-tooltip"],
|
|
200
227
|
mark: ["class"],
|
|
201
228
|
u: ["class"],
|
|
@@ -211,6 +238,7 @@ const INLINE_CLASSES = Object.freeze({
|
|
|
211
238
|
});
|
|
212
239
|
const LINK_SCHEMES = Object.freeze(["http", "https", "mailto", "tel"]);
|
|
213
240
|
const MAX_URL_LENGTH = 2048;
|
|
241
|
+
const TARGETS = /* @__PURE__ */ new Set(["_blank", "_self", "_parent", "_top"]);
|
|
214
242
|
const sanitizeUrl = (value, options = {}) => {
|
|
215
243
|
const schemes = options.schemes || LINK_SCHEMES;
|
|
216
244
|
const allowRelative = options.allowRelative !== false;
|
|
@@ -331,7 +359,7 @@ const BLOCK_POLICIES = {
|
|
|
331
359
|
codeFlask: (d) => {
|
|
332
360
|
const out = {
|
|
333
361
|
code: plain(d.code, 5e5),
|
|
334
|
-
language: /^[a-z0-9+#-]{1,32}$/i.test(d.language
|
|
362
|
+
language: typeof d.language === "string" && /^[a-z0-9+#-]{1,32}$/i.test(d.language) ? d.language : "plaintext"
|
|
335
363
|
};
|
|
336
364
|
if (typeof d.showlinenumbers === "boolean") out.showlinenumbers = d.showlinenumbers;
|
|
337
365
|
return out;
|
|
@@ -358,21 +386,28 @@ const BLOCK_POLICIES = {
|
|
|
358
386
|
if (file.id !== void 0 && (Number.isInteger(file.id) || typeof file.id === "string"))
|
|
359
387
|
cleanFile.id = file.id;
|
|
360
388
|
if (typeof file.documentId === "string") cleanFile.documentId = plain(file.documentId, 64);
|
|
361
|
-
|
|
389
|
+
const out = {
|
|
362
390
|
file: cleanFile,
|
|
363
391
|
caption: inline(d.caption),
|
|
364
392
|
withBorder: bool(d.withBorder),
|
|
365
393
|
withBackground: bool(d.withBackground),
|
|
366
394
|
stretched: bool(d.stretched)
|
|
367
395
|
};
|
|
396
|
+
if (d.decorative === true) out.decorative = true;
|
|
397
|
+
return out;
|
|
398
|
+
},
|
|
399
|
+
simpleImage: (d, inline) => {
|
|
400
|
+
const out = {
|
|
401
|
+
url: sanitizeUrl(d.url, { schemes: ["http", "https"] }),
|
|
402
|
+
caption: inline(d.caption),
|
|
403
|
+
withBorder: bool(d.withBorder),
|
|
404
|
+
withBackground: bool(d.withBackground),
|
|
405
|
+
stretched: bool(d.stretched)
|
|
406
|
+
};
|
|
407
|
+
if (typeof d.alt === "string") out.alt = plain(d.alt, 500);
|
|
408
|
+
if (d.decorative === true) out.decorative = true;
|
|
409
|
+
return out;
|
|
368
410
|
},
|
|
369
|
-
simpleImage: (d, inline) => ({
|
|
370
|
-
url: sanitizeUrl(d.url, { schemes: ["http", "https"] }),
|
|
371
|
-
caption: inline(d.caption),
|
|
372
|
-
withBorder: bool(d.withBorder),
|
|
373
|
-
withBackground: bool(d.withBackground),
|
|
374
|
-
stretched: bool(d.stretched)
|
|
375
|
-
}),
|
|
376
411
|
linkTool: (d) => {
|
|
377
412
|
const meta = isPlainObject(d.meta) ? d.meta : {};
|
|
378
413
|
const image = isPlainObject(meta.image) ? { url: sanitizeUrl(meta.image.url, { schemes: ["http", "https"] }) } : void 0;
|
|
@@ -391,7 +426,7 @@ const BLOCK_POLICIES = {
|
|
|
391
426
|
return { file: cleanFile, title: plain(d.title, 255) };
|
|
392
427
|
},
|
|
393
428
|
embed: (d, inline) => ({
|
|
394
|
-
service: /^[a-z0-9_-]{1,40}$/i.test(d.service
|
|
429
|
+
service: typeof d.service === "string" && /^[a-z0-9_-]{1,40}$/i.test(d.service) ? d.service : "",
|
|
395
430
|
source: sanitizeUrl(d.source, { schemes: ["https", "http"], allowRelative: false }),
|
|
396
431
|
embed: sanitizeUrl(d.embed, { schemes: ["https"], allowRelative: false }),
|
|
397
432
|
width: int(d.width, 1, 1e4, void 0),
|
|
@@ -443,6 +478,7 @@ const sanitizeEditorData = (data, options) => {
|
|
|
443
478
|
});
|
|
444
479
|
return { time: data.time, blocks, version: data.version };
|
|
445
480
|
};
|
|
481
|
+
const sanitizeTarget = (value) => typeof value === "string" && TARGETS.has(value) ? value : null;
|
|
446
482
|
let purify = null;
|
|
447
483
|
const instance = () => {
|
|
448
484
|
if (purify) return purify;
|
|
@@ -466,6 +502,15 @@ const instance = () => {
|
|
|
466
502
|
purify.addHook("afterSanitizeAttributes", (node) => {
|
|
467
503
|
if (node.nodeName === "A" && node.getAttribute("target") === "_blank")
|
|
468
504
|
node.setAttribute("rel", "noopener noreferrer");
|
|
505
|
+
if (typeof node.hasAttribute !== "function") return;
|
|
506
|
+
if (!INTERNAL_LINK_ATTRIBUTES.some((name) => node.hasAttribute(name))) return;
|
|
507
|
+
const kept = node.nodeName === "A" ? cleanInternalLinkAttributes(
|
|
508
|
+
Object.fromEntries(INTERNAL_LINK_ATTRIBUTES.map((name) => [name, node.getAttribute(name)]))
|
|
509
|
+
) : {};
|
|
510
|
+
for (const name of INTERNAL_LINK_ATTRIBUTES) {
|
|
511
|
+
if (kept[name]) node.setAttribute(name, kept[name]);
|
|
512
|
+
else node.removeAttribute(name);
|
|
513
|
+
}
|
|
469
514
|
});
|
|
470
515
|
return purify;
|
|
471
516
|
};
|
|
@@ -473,7 +518,12 @@ const ALLOWED_ATTR = Array.from(new Set(Object.values(INLINE_ATTRIBUTES).flat())
|
|
|
473
518
|
const sanitizeInline = (html) => instance().sanitize(String(html || ""), {
|
|
474
519
|
ALLOWED_TAGS: [...INLINE_TAGS],
|
|
475
520
|
ALLOWED_ATTR,
|
|
476
|
-
ALLOW_DATA_ATTR: false
|
|
521
|
+
ALLOW_DATA_ATTR: false,
|
|
522
|
+
// DOMPurify checks attribute values like URIs; `api::article.article` looks
|
|
523
|
+
// like an unknown scheme and was dropped, which removed the entry reference
|
|
524
|
+
// of internal links whenever content was shown again. The values are
|
|
525
|
+
// validated by cleanInternalLinkAttributes in the hook above.
|
|
526
|
+
ADD_URI_SAFE_ATTR: [...INTERNAL_LINK_ATTRIBUTES]
|
|
477
527
|
});
|
|
478
528
|
const sanitizeTemplate = (html) => instance().sanitize(String(html || ""), {
|
|
479
529
|
ALLOWED_TAGS: [
|
|
@@ -543,10 +593,36 @@ const prepareEditorValue = (value, rawHtml = "allow") => {
|
|
|
543
593
|
return { data: null, error: error && error.code || "INVALID" };
|
|
544
594
|
}
|
|
545
595
|
};
|
|
596
|
+
const prepareRemoteData = (data, cache) => {
|
|
597
|
+
const blocks = [];
|
|
598
|
+
for (const block of data && data.blocks || []) {
|
|
599
|
+
let clean = cache.get(block);
|
|
600
|
+
if (clean === void 0) {
|
|
601
|
+
const prepared = prepareEditorValue({ time: data.time, version: data.version, blocks: [block] }).data;
|
|
602
|
+
clean = prepared && prepared.blocks.length === 1 ? prepared.blocks[0] : null;
|
|
603
|
+
cache.set(block, clean);
|
|
604
|
+
}
|
|
605
|
+
if (clean) blocks.push(clean);
|
|
606
|
+
}
|
|
607
|
+
return { time: data && data.time || Date.now(), version: data && data.version || "2.31.7", blocks };
|
|
608
|
+
};
|
|
609
|
+
exports.BLOCK_POLICIES = BLOCK_POLICIES;
|
|
610
|
+
exports.EDITOR_DATA_LIMITS = EDITOR_DATA_LIMITS;
|
|
611
|
+
exports.INLINE_ATTRIBUTES = INLINE_ATTRIBUTES;
|
|
612
|
+
exports.INLINE_CLASSES = INLINE_CLASSES;
|
|
613
|
+
exports.INLINE_TAGS = INLINE_TAGS;
|
|
614
|
+
exports.cleanInternalLinkAttributes = cleanInternalLinkAttributes;
|
|
615
|
+
exports.cloneJsonSafe = cloneJsonSafe;
|
|
546
616
|
exports.computeStats = computeStats;
|
|
617
|
+
exports.escapeHtml = escapeHtml;
|
|
618
|
+
exports.hashString = hashString;
|
|
547
619
|
exports.isPlainObject = isPlainObject;
|
|
620
|
+
exports.normalizeEditorDataSafe = normalizeEditorDataSafe;
|
|
548
621
|
exports.prepareEditorValue = prepareEditorValue;
|
|
622
|
+
exports.prepareRemoteData = prepareRemoteData;
|
|
549
623
|
exports.sanitizeInline = sanitizeInline;
|
|
550
624
|
exports.sanitizeSvg = sanitizeSvg;
|
|
625
|
+
exports.sanitizeTarget = sanitizeTarget;
|
|
551
626
|
exports.sanitizeTemplate = sanitizeTemplate;
|
|
627
|
+
exports.sanitizeTunes = sanitizeTunes;
|
|
552
628
|
exports.sanitizeUrl = sanitizeUrl;
|
|
@@ -139,6 +139,13 @@ const normalizeEditorData = (value) => {
|
|
|
139
139
|
}
|
|
140
140
|
return result;
|
|
141
141
|
};
|
|
142
|
+
const normalizeEditorDataSafe = (value) => {
|
|
143
|
+
try {
|
|
144
|
+
return normalizeEditorData(value);
|
|
145
|
+
} catch {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
142
149
|
const byteLength = (text) => {
|
|
143
150
|
let bytes = 0;
|
|
144
151
|
for (let i = 0; i < text.length; i += 1) {
|
|
@@ -191,8 +198,28 @@ const INLINE_TAGS = Object.freeze([
|
|
|
191
198
|
"sub",
|
|
192
199
|
"sup"
|
|
193
200
|
]);
|
|
201
|
+
const INTERNAL_LINK_ATTRIBUTES = Object.freeze([
|
|
202
|
+
"data-mex-uid",
|
|
203
|
+
"data-mex-document-id",
|
|
204
|
+
"data-mex-locale"
|
|
205
|
+
]);
|
|
206
|
+
const INTERNAL_LINK_RULES = Object.freeze({
|
|
207
|
+
"data-mex-uid": /^api::[a-z0-9-]{1,60}\.[a-z0-9-]{1,60}$/,
|
|
208
|
+
"data-mex-document-id": /^[a-z0-9]{1,64}$/,
|
|
209
|
+
"data-mex-locale": /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/
|
|
210
|
+
});
|
|
211
|
+
const cleanInternalLinkAttributes = (attribs) => {
|
|
212
|
+
const out = {};
|
|
213
|
+
if (!attribs || typeof attribs !== "object") return out;
|
|
214
|
+
for (const name of INTERNAL_LINK_ATTRIBUTES) {
|
|
215
|
+
const value = attribs[name];
|
|
216
|
+
if (typeof value === "string" && INTERNAL_LINK_RULES[name].test(value)) out[name] = value;
|
|
217
|
+
}
|
|
218
|
+
if (!out["data-mex-uid"] || !out["data-mex-document-id"]) return {};
|
|
219
|
+
return out;
|
|
220
|
+
};
|
|
194
221
|
const INLINE_ATTRIBUTES = Object.freeze({
|
|
195
|
-
a: ["href", "target", "rel", "title"],
|
|
222
|
+
a: ["href", "target", "rel", "title", ...INTERNAL_LINK_ATTRIBUTES],
|
|
196
223
|
span: ["class", "data-tooltip"],
|
|
197
224
|
mark: ["class"],
|
|
198
225
|
u: ["class"],
|
|
@@ -208,6 +235,7 @@ const INLINE_CLASSES = Object.freeze({
|
|
|
208
235
|
});
|
|
209
236
|
const LINK_SCHEMES = Object.freeze(["http", "https", "mailto", "tel"]);
|
|
210
237
|
const MAX_URL_LENGTH = 2048;
|
|
238
|
+
const TARGETS = /* @__PURE__ */ new Set(["_blank", "_self", "_parent", "_top"]);
|
|
211
239
|
const sanitizeUrl = (value, options = {}) => {
|
|
212
240
|
const schemes = options.schemes || LINK_SCHEMES;
|
|
213
241
|
const allowRelative = options.allowRelative !== false;
|
|
@@ -328,7 +356,7 @@ const BLOCK_POLICIES = {
|
|
|
328
356
|
codeFlask: (d) => {
|
|
329
357
|
const out = {
|
|
330
358
|
code: plain(d.code, 5e5),
|
|
331
|
-
language: /^[a-z0-9+#-]{1,32}$/i.test(d.language
|
|
359
|
+
language: typeof d.language === "string" && /^[a-z0-9+#-]{1,32}$/i.test(d.language) ? d.language : "plaintext"
|
|
332
360
|
};
|
|
333
361
|
if (typeof d.showlinenumbers === "boolean") out.showlinenumbers = d.showlinenumbers;
|
|
334
362
|
return out;
|
|
@@ -355,21 +383,28 @@ const BLOCK_POLICIES = {
|
|
|
355
383
|
if (file.id !== void 0 && (Number.isInteger(file.id) || typeof file.id === "string"))
|
|
356
384
|
cleanFile.id = file.id;
|
|
357
385
|
if (typeof file.documentId === "string") cleanFile.documentId = plain(file.documentId, 64);
|
|
358
|
-
|
|
386
|
+
const out = {
|
|
359
387
|
file: cleanFile,
|
|
360
388
|
caption: inline(d.caption),
|
|
361
389
|
withBorder: bool(d.withBorder),
|
|
362
390
|
withBackground: bool(d.withBackground),
|
|
363
391
|
stretched: bool(d.stretched)
|
|
364
392
|
};
|
|
393
|
+
if (d.decorative === true) out.decorative = true;
|
|
394
|
+
return out;
|
|
395
|
+
},
|
|
396
|
+
simpleImage: (d, inline) => {
|
|
397
|
+
const out = {
|
|
398
|
+
url: sanitizeUrl(d.url, { schemes: ["http", "https"] }),
|
|
399
|
+
caption: inline(d.caption),
|
|
400
|
+
withBorder: bool(d.withBorder),
|
|
401
|
+
withBackground: bool(d.withBackground),
|
|
402
|
+
stretched: bool(d.stretched)
|
|
403
|
+
};
|
|
404
|
+
if (typeof d.alt === "string") out.alt = plain(d.alt, 500);
|
|
405
|
+
if (d.decorative === true) out.decorative = true;
|
|
406
|
+
return out;
|
|
365
407
|
},
|
|
366
|
-
simpleImage: (d, inline) => ({
|
|
367
|
-
url: sanitizeUrl(d.url, { schemes: ["http", "https"] }),
|
|
368
|
-
caption: inline(d.caption),
|
|
369
|
-
withBorder: bool(d.withBorder),
|
|
370
|
-
withBackground: bool(d.withBackground),
|
|
371
|
-
stretched: bool(d.stretched)
|
|
372
|
-
}),
|
|
373
408
|
linkTool: (d) => {
|
|
374
409
|
const meta = isPlainObject(d.meta) ? d.meta : {};
|
|
375
410
|
const image = isPlainObject(meta.image) ? { url: sanitizeUrl(meta.image.url, { schemes: ["http", "https"] }) } : void 0;
|
|
@@ -388,7 +423,7 @@ const BLOCK_POLICIES = {
|
|
|
388
423
|
return { file: cleanFile, title: plain(d.title, 255) };
|
|
389
424
|
},
|
|
390
425
|
embed: (d, inline) => ({
|
|
391
|
-
service: /^[a-z0-9_-]{1,40}$/i.test(d.service
|
|
426
|
+
service: typeof d.service === "string" && /^[a-z0-9_-]{1,40}$/i.test(d.service) ? d.service : "",
|
|
392
427
|
source: sanitizeUrl(d.source, { schemes: ["https", "http"], allowRelative: false }),
|
|
393
428
|
embed: sanitizeUrl(d.embed, { schemes: ["https"], allowRelative: false }),
|
|
394
429
|
width: int(d.width, 1, 1e4, void 0),
|
|
@@ -440,6 +475,7 @@ const sanitizeEditorData = (data, options) => {
|
|
|
440
475
|
});
|
|
441
476
|
return { time: data.time, blocks, version: data.version };
|
|
442
477
|
};
|
|
478
|
+
const sanitizeTarget = (value) => typeof value === "string" && TARGETS.has(value) ? value : null;
|
|
443
479
|
let purify = null;
|
|
444
480
|
const instance = () => {
|
|
445
481
|
if (purify) return purify;
|
|
@@ -463,6 +499,15 @@ const instance = () => {
|
|
|
463
499
|
purify.addHook("afterSanitizeAttributes", (node) => {
|
|
464
500
|
if (node.nodeName === "A" && node.getAttribute("target") === "_blank")
|
|
465
501
|
node.setAttribute("rel", "noopener noreferrer");
|
|
502
|
+
if (typeof node.hasAttribute !== "function") return;
|
|
503
|
+
if (!INTERNAL_LINK_ATTRIBUTES.some((name) => node.hasAttribute(name))) return;
|
|
504
|
+
const kept = node.nodeName === "A" ? cleanInternalLinkAttributes(
|
|
505
|
+
Object.fromEntries(INTERNAL_LINK_ATTRIBUTES.map((name) => [name, node.getAttribute(name)]))
|
|
506
|
+
) : {};
|
|
507
|
+
for (const name of INTERNAL_LINK_ATTRIBUTES) {
|
|
508
|
+
if (kept[name]) node.setAttribute(name, kept[name]);
|
|
509
|
+
else node.removeAttribute(name);
|
|
510
|
+
}
|
|
466
511
|
});
|
|
467
512
|
return purify;
|
|
468
513
|
};
|
|
@@ -470,7 +515,12 @@ const ALLOWED_ATTR = Array.from(new Set(Object.values(INLINE_ATTRIBUTES).flat())
|
|
|
470
515
|
const sanitizeInline = (html) => instance().sanitize(String(html || ""), {
|
|
471
516
|
ALLOWED_TAGS: [...INLINE_TAGS],
|
|
472
517
|
ALLOWED_ATTR,
|
|
473
|
-
ALLOW_DATA_ATTR: false
|
|
518
|
+
ALLOW_DATA_ATTR: false,
|
|
519
|
+
// DOMPurify checks attribute values like URIs; `api::article.article` looks
|
|
520
|
+
// like an unknown scheme and was dropped, which removed the entry reference
|
|
521
|
+
// of internal links whenever content was shown again. The values are
|
|
522
|
+
// validated by cleanInternalLinkAttributes in the hook above.
|
|
523
|
+
ADD_URI_SAFE_ATTR: [...INTERNAL_LINK_ATTRIBUTES]
|
|
474
524
|
});
|
|
475
525
|
const sanitizeTemplate = (html) => instance().sanitize(String(html || ""), {
|
|
476
526
|
ALLOWED_TAGS: [
|
|
@@ -540,12 +590,38 @@ const prepareEditorValue = (value, rawHtml = "allow") => {
|
|
|
540
590
|
return { data: null, error: error && error.code || "INVALID" };
|
|
541
591
|
}
|
|
542
592
|
};
|
|
593
|
+
const prepareRemoteData = (data, cache) => {
|
|
594
|
+
const blocks = [];
|
|
595
|
+
for (const block of data && data.blocks || []) {
|
|
596
|
+
let clean = cache.get(block);
|
|
597
|
+
if (clean === void 0) {
|
|
598
|
+
const prepared = prepareEditorValue({ time: data.time, version: data.version, blocks: [block] }).data;
|
|
599
|
+
clean = prepared && prepared.blocks.length === 1 ? prepared.blocks[0] : null;
|
|
600
|
+
cache.set(block, clean);
|
|
601
|
+
}
|
|
602
|
+
if (clean) blocks.push(clean);
|
|
603
|
+
}
|
|
604
|
+
return { time: data && data.time || Date.now(), version: data && data.version || "2.31.7", blocks };
|
|
605
|
+
};
|
|
543
606
|
export {
|
|
607
|
+
BLOCK_POLICIES as B,
|
|
608
|
+
EDITOR_DATA_LIMITS as E,
|
|
609
|
+
INLINE_TAGS as I,
|
|
544
610
|
sanitizeInline as a,
|
|
545
611
|
sanitizeSvg as b,
|
|
546
612
|
sanitizeTemplate as c,
|
|
547
|
-
|
|
613
|
+
INLINE_ATTRIBUTES as d,
|
|
614
|
+
sanitizeTarget as e,
|
|
615
|
+
INLINE_CLASSES as f,
|
|
616
|
+
cleanInternalLinkAttributes as g,
|
|
617
|
+
computeStats as h,
|
|
548
618
|
isPlainObject as i,
|
|
619
|
+
cloneJsonSafe as j,
|
|
620
|
+
sanitizeTunes as k,
|
|
621
|
+
hashString as l,
|
|
622
|
+
escapeHtml as m,
|
|
623
|
+
normalizeEditorDataSafe as n,
|
|
624
|
+
prepareRemoteData as o,
|
|
549
625
|
prepareEditorValue as p,
|
|
550
626
|
sanitizeUrl as s
|
|
551
627
|
};
|