@1doc/1ds-react 2.11.0 → 2.11.1
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 +16 -0
- package/dist/components/CodeBlock/CodeBlock.css +3 -3
- package/dist/components/CodeBlock/CodeBlock.d.ts +2 -2
- package/dist/components/Kbd/Kbd.css +3 -3
- package/dist/components/Kbd/Kbd.d.ts +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/dist/components/RichTextEditor/RichTextEditor.js +0 -5
- package/dist/teste/RichTextEditorEstiloDeTexto.test.js +7 -7
- package/dist/utils/html-seguro.js +1 -1
- package/package.json +3 -3
- package/src/teste/RichTextEditorEstiloDeTexto.test.tsx +8 -8
- package/src/utils/html-seguro.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @1doc/1ds-react
|
|
2
2
|
|
|
3
|
+
## 2.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ffc6176: remove(tokens): `--umds-semantic-font-family-mono` e `--umds-primitive-font-family-mono` saem
|
|
8
|
+
|
|
9
|
+
REMOÇÃO de token, não acréscimo. O DS não cria token novo: a família monoespaçada (introduzida no 0.6.0) volta a não
|
|
10
|
+
existir. Como estamos em 0.x, a remoção sai como minor nos tokens.
|
|
11
|
+
|
|
12
|
+
- `Kbd` e `CodeBlock` passam a usar `--umds-semantic-font-family-base`: o texto da tecla e do código sai na fonte do DS,
|
|
13
|
+
não mais monoespaçada (muda a largura dos caracteres; o espaço e as quebras de linha do `CodeBlock` seguem mantidos).
|
|
14
|
+
- `RichTextEditor`: a opção "Monoespaçada" da ferramenta `fontFamily` sai (o label `fontFamilyMono` também). Fica só a
|
|
15
|
+
opção "Padrão" (`fontFamilyBase`). A higienização do valor passa a aceitar só `font-family-base` em `font-family`:
|
|
16
|
+
um `<span style="font-family: var(--umds-semantic-font-family-mono)">` salvo antes perde a declaração ao carregar.
|
|
17
|
+
- Quem usou o token: troque por `--umds-semantic-font-family-base`.
|
|
18
|
+
|
|
3
19
|
## 2.11.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* ─────────────────────────────────────────────
|
|
2
2
|
CODE BLOCK
|
|
3
|
-
Texto
|
|
3
|
+
Texto na fonte do DS (a base, sem fonte de código), com borda, rolagem e botão de copiar.
|
|
4
4
|
|
|
5
5
|
Fundo claro e texto escuro (contraste de texto, nos temas claro e escuro: os
|
|
6
6
|
dois vêm dos semânticos). Sem cor de sintaxe.
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.umds-code-block__language {
|
|
31
|
-
font-family: var(--umds-semantic-font-family-
|
|
31
|
+
font-family: var(--umds-semantic-font-family-base);
|
|
32
32
|
font-size: var(--umds-primitive-font-size-xxxs); /* 12px */
|
|
33
33
|
font-weight: var(--umds-primitive-font-weight-semibold);
|
|
34
34
|
color: var(--umds-semantic-color-neutral-dark-down);
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
margin: 0;
|
|
66
66
|
padding: var(--umds-primitive-spacing-mini) var(--umds-primitive-spacing-xxxs); /* 12px 16px */
|
|
67
67
|
overflow: auto;
|
|
68
|
-
font-family: var(--umds-semantic-font-family-
|
|
68
|
+
font-family: var(--umds-semantic-font-family-base);
|
|
69
69
|
font-size: var(--umds-primitive-font-size-xxs); /* 14px */
|
|
70
70
|
line-height: var(--umds-primitive-font-line-height-lg);
|
|
71
71
|
color: var(--umds-semantic-color-neutral-dark-pure);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './CodeBlock.css';
|
|
2
2
|
/**
|
|
3
|
-
* CodeBlock — trecho de código (ou JSON, ou um log)
|
|
3
|
+
* CodeBlock — trecho de código (ou JSON, ou um log) com a fonte do DS, com
|
|
4
4
|
* borda, rolagem e botão de copiar.
|
|
5
5
|
*
|
|
6
6
|
* O texto vem por `code` ou como conteúdo (`<CodeBlock>{...}</CodeBlock>`); o
|
|
@@ -25,7 +25,7 @@ import './CodeBlock.css';
|
|
|
25
25
|
* @property {string} ariaLabel - Nome da área de rolagem (padrão: a linguagem, ou "Código")
|
|
26
26
|
* @property {string} className - Classes CSS adicionais
|
|
27
27
|
* @property {function} onCopy - Chamado com o texto depois de copiar
|
|
28
|
-
* @quandoUsar Mostrar JSON de uma resposta, um comando, um log, um exemplo de uso: texto que se lê
|
|
28
|
+
* @quandoUsar Mostrar JSON de uma resposta, um comando, um log, um exemplo de uso: texto que se lê como foi escrito e se copia.
|
|
29
29
|
* @quandoNaoUsar Para uma tecla ou atalho, use `Kbd`. Para código dentro de uma frase, use `<code>` direto. Para editar código, use um editor especializado: este bloco só mostra.
|
|
30
30
|
*/
|
|
31
31
|
export interface CodeBlockProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* ─────────────────────────────────────────────
|
|
2
2
|
KBD
|
|
3
|
-
Uma tecla, ou uma combinação,
|
|
3
|
+
Uma tecla, ou uma combinação, na fonte do DS (a base).
|
|
4
4
|
|
|
5
5
|
A caixa é cinza com borda e uma sombra de base de 1px (a "espessura" da
|
|
6
6
|
tecla). Texto escuro sobre cinza claro: contraste de texto, não só de cor.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
min-width: var(--umds-primitive-spacing-xxs); /* 24px */
|
|
15
15
|
padding: var(--umds-primitive-spacing-micro) var(--umds-primitive-spacing-nano); /* 2px 8px */
|
|
16
|
-
font-family: var(--umds-semantic-font-family-
|
|
16
|
+
font-family: var(--umds-semantic-font-family-base);
|
|
17
17
|
font-weight: var(--umds-primitive-font-weight-semibold);
|
|
18
18
|
line-height: var(--umds-primitive-font-line-height-lg);
|
|
19
19
|
text-align: center;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
display: inline-flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
gap: var(--umds-primitive-spacing-quarck); /* 4px */
|
|
43
|
-
font-family: var(--umds-semantic-font-family-
|
|
43
|
+
font-family: var(--umds-semantic-font-family-base);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.umds-kbd-combo__item {
|
|
@@ -4,7 +4,7 @@ import './Kbd.css';
|
|
|
4
4
|
*
|
|
5
5
|
* Uma tecla: `<Kbd>Esc</Kbd>`. Uma combinação: `keys` (`["Ctrl", "Shift", "P"]`),
|
|
6
6
|
* que desenha uma caixa por tecla com o `separator` entre elas (`+` por padrão).
|
|
7
|
-
* A fonte é a
|
|
7
|
+
* A fonte é a do DS (`--umds-semantic-font-family-base`), a caixa é
|
|
8
8
|
* cinza com borda e uma sombra de base, como uma tecla de verdade.
|
|
9
9
|
*
|
|
10
10
|
* Semântica: `<kbd>` é o elemento HTML de "entrada de teclado", e um `<kbd>`
|
|
@@ -35,7 +35,7 @@ export type RichTextTool = "bold" | "italic" | "underline" | "strike" | "ul" | "
|
|
|
35
35
|
* higienização: só PNG, JPEG, GIF e WebP em `data:`, ou `http(s)`; sem SVG.
|
|
36
36
|
*
|
|
37
37
|
* Estilo de texto por TOKEN do DS, também opcional na `toolbar`: `fontFamily`
|
|
38
|
-
* (
|
|
38
|
+
* (a fonte do DS), `fontSize` (12, 14, 16, 20 e 24px, da escala do DS) e
|
|
39
39
|
* `textColor` (a paleta do DS). Cada um abre um painel abaixo da barra e aplica ao
|
|
40
40
|
* texto selecionado (sem seleção, o painel pede que se selecione). O valor guarda
|
|
41
41
|
* `<span style="color: var(--umds-primitive-red-pure)">`: só token do DS passa na
|
|
@@ -53,7 +53,7 @@ export type RichTextTool = "bold" | "italic" | "underline" | "strike" | "ul" | "
|
|
|
53
53
|
* @property {string} placeholder - Texto de apoio com o editor vazio
|
|
54
54
|
* @property {string[]} toolbar - Ferramentas da barra, em ordem: 'bold' | 'italic' | 'underline' | 'strike' | 'ul' | 'ol' | 'link' | 'undo' | 'redo' | 'clear' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'image' | 'table' | 'fontFamily' | 'fontSize' | 'textColor' | '|' (separador)
|
|
55
55
|
* @property {string} toolbarLabel - Nome da barra (padrão "Formatação")
|
|
56
|
-
* @property {object} labels - Nomes das ferramentas e dos campos, parcial: `{ bold, italic, underline, strike, ul, ol, link, undo, redo, clear, alignLeft, alignCenter, alignRight, alignJustify, image, table, linkAddress, linkApply, linkRemove, linkCancel, linkInvalid, imageUrl, imageAlt, imageFile, imageApply, imageCancel, imageInvalid, imageType, imageTooLarge, tableRows, tableCols, tableApply, tableCancel, tableInvalid, tableActions, tableAddRow, tableRemoveRow, tableAddCol, tableRemoveCol, tableRemove, fontFamily, fontSize, textColor, fontFamilyBase,
|
|
56
|
+
* @property {object} labels - Nomes das ferramentas e dos campos, parcial: `{ bold, italic, underline, strike, ul, ol, link, undo, redo, clear, alignLeft, alignCenter, alignRight, alignJustify, image, table, linkAddress, linkApply, linkRemove, linkCancel, linkInvalid, imageUrl, imageAlt, imageFile, imageApply, imageCancel, imageInvalid, imageType, imageTooLarge, tableRows, tableCols, tableApply, tableCancel, tableInvalid, tableActions, tableAddRow, tableRemoveRow, tableAddCol, tableRemoveCol, tableRemove, fontFamily, fontSize, textColor, fontFamilyBase, styleClose, styleNeedsSelection }`
|
|
57
57
|
* @property {number} minHeight - Altura mínima da área de escrita, em px (padrão 120)
|
|
58
58
|
* @property {boolean} resizable - Deixa redimensionar a altura pelo canto
|
|
59
59
|
* @property {boolean} disabled - Desabilita barra e área
|
|
@@ -148,7 +148,6 @@ function RichTextEditor(props) {
|
|
|
148
148
|
fontSize: "Tamanho da fonte",
|
|
149
149
|
textColor: "Cor do texto",
|
|
150
150
|
fontFamilyBase: "Padrão",
|
|
151
|
-
fontFamilyMono: "Monoespaçada",
|
|
152
151
|
styleClose: "Fechar",
|
|
153
152
|
styleNeedsSelection: "Selecione o texto antes de aplicar.",
|
|
154
153
|
};
|
|
@@ -790,10 +789,6 @@ function RichTextEditor(props) {
|
|
|
790
789
|
label: rotulo("fontFamilyBase"),
|
|
791
790
|
value: "var(--umds-semantic-font-family-base)",
|
|
792
791
|
},
|
|
793
|
-
{
|
|
794
|
-
label: rotulo("fontFamilyMono"),
|
|
795
|
-
value: "var(--umds-semantic-font-family-mono)",
|
|
796
|
-
},
|
|
797
792
|
];
|
|
798
793
|
}
|
|
799
794
|
function fontSizeOptions() {
|
|
@@ -25,7 +25,7 @@ describe("html-seguro: estilo de texto por token", () => {
|
|
|
25
25
|
expect(estiloDeTexto("color", "var(--umds-primitive-red-pure)")).toBe("color: var(--umds-primitive-red-pure);");
|
|
26
26
|
expect(estiloDeTexto("color", "var(--umds-semantic-color-feedback-negative-pure)")).toBe("color: var(--umds-semantic-color-feedback-negative-pure);");
|
|
27
27
|
expect(estiloDeTexto("font-size", "var(--umds-primitive-font-size-xs)")).toBe("font-size: var(--umds-primitive-font-size-xs);");
|
|
28
|
-
expect(estiloDeTexto("font-family", "var(--umds-semantic-font-family-
|
|
28
|
+
expect(estiloDeTexto("font-family", "var(--umds-semantic-font-family-base)")).toBe("font-family: var(--umds-semantic-font-family-base);");
|
|
29
29
|
for (const mau of ["red", "#ff0000", "rgb(255,0,0)", "var(--outra-coisa)", "var(--umds-primitive-red-pure); background: red", "expression(alert(1))", "url(x)"]) {
|
|
30
30
|
expect(estiloDeTexto("color", mau)).toBe("");
|
|
31
31
|
}
|
|
@@ -36,7 +36,7 @@ describe("html-seguro: estilo de texto por token", () => {
|
|
|
36
36
|
});
|
|
37
37
|
it("o span guarda só as declarações válidas; o resto do style sai", () => {
|
|
38
38
|
expect(sanitizarHtml('<span style="color: var(--umds-primitive-red-pure); background: red; font-size: 40px">a</span>')).toBe('<span style="color: var(--umds-primitive-red-pure);">a</span>');
|
|
39
|
-
expect(sanitizarHtml('<span style="font-family: var(--umds-semantic-font-family-
|
|
39
|
+
expect(sanitizarHtml('<span style="font-family: var(--umds-semantic-font-family-base); font-size: var(--umds-primitive-font-size-sm)">a</span>')).toBe('<span style="font-family: var(--umds-semantic-font-family-base); font-size: var(--umds-primitive-font-size-sm);">a</span>');
|
|
40
40
|
expect(sanitizarHtml('<span style="color: red">a</span>')).toBe("<span>a</span>");
|
|
41
41
|
});
|
|
42
42
|
it("estilo só vale em span: em outras tags sai", () => {
|
|
@@ -62,15 +62,15 @@ describe("RichTextEditor: fonte, tamanho e cor do texto", () => {
|
|
|
62
62
|
fireEvent.keyDown(screen.getByRole("group", { name: "Cor do texto" }), { key: "Escape" });
|
|
63
63
|
expect(screen.queryByRole("group", { name: "Cor do texto" })).toBeNull();
|
|
64
64
|
});
|
|
65
|
-
it("a fonte
|
|
65
|
+
it("a fonte do DS embrulha o texto selecionado num span com o token", async () => {
|
|
66
66
|
const usuario = userEvent.setup();
|
|
67
67
|
const aoMudar = vi.fn();
|
|
68
68
|
abrir(["fontFamily"], { onChange: aoMudar });
|
|
69
69
|
selecionarTexto();
|
|
70
70
|
await usuario.click(screen.getByRole("button", { name: "Fonte" }));
|
|
71
71
|
await usuario.click(screen.getByRole("combobox", { name: "Fonte" }));
|
|
72
|
-
await usuario.click(screen.getByRole("option", { name: "
|
|
73
|
-
expect(execCommand).toHaveBeenCalledWith("insertHTML", false, '<span style="font-family: var(--umds-semantic-font-family-
|
|
72
|
+
await usuario.click(screen.getByRole("option", { name: "Padrão" }));
|
|
73
|
+
expect(execCommand).toHaveBeenCalledWith("insertHTML", false, '<span style="font-family: var(--umds-semantic-font-family-base);">Parecer</span>');
|
|
74
74
|
expect(aoMudar).toHaveBeenCalled();
|
|
75
75
|
expect(screen.queryByRole("group", { name: "Fonte" })).toBeNull();
|
|
76
76
|
});
|
|
@@ -105,11 +105,11 @@ describe("RichTextEditor: fonte, tamanho e cor do texto", () => {
|
|
|
105
105
|
});
|
|
106
106
|
it("os textos vêm por labels", async () => {
|
|
107
107
|
const usuario = userEvent.setup();
|
|
108
|
-
abrir(["fontFamily", "textColor"], { labels: { fontFamily: "Font", textColor: "Text color",
|
|
108
|
+
abrir(["fontFamily", "textColor"], { labels: { fontFamily: "Font", textColor: "Text color", fontFamilyBase: "Default", styleClose: "Close" } });
|
|
109
109
|
selecionarTexto();
|
|
110
110
|
await usuario.click(screen.getByRole("button", { name: "Font" }));
|
|
111
111
|
await usuario.click(screen.getByRole("combobox", { name: "Font" }));
|
|
112
|
-
expect(screen.getByRole("option", { name: "
|
|
112
|
+
expect(screen.getByRole("option", { name: "Default" })).toBeInTheDocument();
|
|
113
113
|
await usuario.keyboard("{Escape}");
|
|
114
114
|
expect(screen.getByRole("button", { name: "Close" })).toBeInTheDocument();
|
|
115
115
|
});
|
|
@@ -53,7 +53,7 @@ export const normalizarEndereco = (bruto) => {
|
|
|
53
53
|
/** Cor, tamanho e família de fonte só valem como TOKEN do DS: `var(--umds-...)`. Cor em hex, rgb ou nome sai. */
|
|
54
54
|
const COR_TOKEN = /^var\(--umds-(?:primitive|semantic)-[a-z0-9-]+\)$/;
|
|
55
55
|
const TAMANHO_TOKEN = /^var\(--umds-primitive-font-size-[a-z0-9]+\)$/;
|
|
56
|
-
const FAMILIA_TOKEN = /^var\(--umds-(?:primitive|semantic)-font-family-
|
|
56
|
+
const FAMILIA_TOKEN = /^var\(--umds-(?:primitive|semantic)-font-family-base\)$/;
|
|
57
57
|
/**
|
|
58
58
|
* Declaração de estilo de texto que o editor aceita: `color`, `font-size` e `font-family`,
|
|
59
59
|
* cada uma só com um token do DS. Devolve a declaração limpa ("color: var(--x);") ou "".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1doc/1ds-react",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"react-dom": "^18.0.0",
|
|
46
46
|
"typescript": "^5.0.0",
|
|
47
47
|
"vitest": "^3.2.7",
|
|
48
|
-
"@1doc/1ds-core": "2.11.
|
|
49
|
-
"@1doc/1ds-tokens": "0.
|
|
48
|
+
"@1doc/1ds-core": "2.11.1",
|
|
49
|
+
"@1doc/1ds-tokens": "0.7.0"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
@@ -29,7 +29,7 @@ describe("html-seguro: estilo de texto por token", () => {
|
|
|
29
29
|
expect(estiloDeTexto("color", "var(--umds-primitive-red-pure)")).toBe("color: var(--umds-primitive-red-pure);");
|
|
30
30
|
expect(estiloDeTexto("color", "var(--umds-semantic-color-feedback-negative-pure)")).toBe("color: var(--umds-semantic-color-feedback-negative-pure);");
|
|
31
31
|
expect(estiloDeTexto("font-size", "var(--umds-primitive-font-size-xs)")).toBe("font-size: var(--umds-primitive-font-size-xs);");
|
|
32
|
-
expect(estiloDeTexto("font-family", "var(--umds-semantic-font-family-
|
|
32
|
+
expect(estiloDeTexto("font-family", "var(--umds-semantic-font-family-base)")).toBe("font-family: var(--umds-semantic-font-family-base);");
|
|
33
33
|
for (const mau of ["red", "#ff0000", "rgb(255,0,0)", "var(--outra-coisa)", "var(--umds-primitive-red-pure); background: red", "expression(alert(1))", "url(x)"]) {
|
|
34
34
|
expect(estiloDeTexto("color", mau)).toBe("");
|
|
35
35
|
}
|
|
@@ -43,8 +43,8 @@ describe("html-seguro: estilo de texto por token", () => {
|
|
|
43
43
|
expect(sanitizarHtml('<span style="color: var(--umds-primitive-red-pure); background: red; font-size: 40px">a</span>')).toBe(
|
|
44
44
|
'<span style="color: var(--umds-primitive-red-pure);">a</span>',
|
|
45
45
|
);
|
|
46
|
-
expect(sanitizarHtml('<span style="font-family: var(--umds-semantic-font-family-
|
|
47
|
-
'<span style="font-family: var(--umds-semantic-font-family-
|
|
46
|
+
expect(sanitizarHtml('<span style="font-family: var(--umds-semantic-font-family-base); font-size: var(--umds-primitive-font-size-sm)">a</span>')).toBe(
|
|
47
|
+
'<span style="font-family: var(--umds-semantic-font-family-base); font-size: var(--umds-primitive-font-size-sm);">a</span>',
|
|
48
48
|
);
|
|
49
49
|
expect(sanitizarHtml('<span style="color: red">a</span>')).toBe("<span>a</span>");
|
|
50
50
|
});
|
|
@@ -74,15 +74,15 @@ describe("RichTextEditor: fonte, tamanho e cor do texto", () => {
|
|
|
74
74
|
expect(screen.queryByRole("group", { name: "Cor do texto" })).toBeNull();
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
it("a fonte
|
|
77
|
+
it("a fonte do DS embrulha o texto selecionado num span com o token", async () => {
|
|
78
78
|
const usuario = userEvent.setup();
|
|
79
79
|
const aoMudar = vi.fn();
|
|
80
80
|
abrir(["fontFamily"], { onChange: aoMudar });
|
|
81
81
|
selecionarTexto();
|
|
82
82
|
await usuario.click(screen.getByRole("button", { name: "Fonte" }));
|
|
83
83
|
await usuario.click(screen.getByRole("combobox", { name: "Fonte" }));
|
|
84
|
-
await usuario.click(screen.getByRole("option", { name: "
|
|
85
|
-
expect(execCommand).toHaveBeenCalledWith("insertHTML", false, '<span style="font-family: var(--umds-semantic-font-family-
|
|
84
|
+
await usuario.click(screen.getByRole("option", { name: "Padrão" }));
|
|
85
|
+
expect(execCommand).toHaveBeenCalledWith("insertHTML", false, '<span style="font-family: var(--umds-semantic-font-family-base);">Parecer</span>');
|
|
86
86
|
expect(aoMudar).toHaveBeenCalled();
|
|
87
87
|
expect(screen.queryByRole("group", { name: "Fonte" })).toBeNull();
|
|
88
88
|
});
|
|
@@ -121,11 +121,11 @@ describe("RichTextEditor: fonte, tamanho e cor do texto", () => {
|
|
|
121
121
|
|
|
122
122
|
it("os textos vêm por labels", async () => {
|
|
123
123
|
const usuario = userEvent.setup();
|
|
124
|
-
abrir(["fontFamily", "textColor"], { labels: { fontFamily: "Font", textColor: "Text color",
|
|
124
|
+
abrir(["fontFamily", "textColor"], { labels: { fontFamily: "Font", textColor: "Text color", fontFamilyBase: "Default", styleClose: "Close" } });
|
|
125
125
|
selecionarTexto();
|
|
126
126
|
await usuario.click(screen.getByRole("button", { name: "Font" }));
|
|
127
127
|
await usuario.click(screen.getByRole("combobox", { name: "Font" }));
|
|
128
|
-
expect(screen.getByRole("option", { name: "
|
|
128
|
+
expect(screen.getByRole("option", { name: "Default" })).toBeInTheDocument();
|
|
129
129
|
await usuario.keyboard("{Escape}");
|
|
130
130
|
expect(screen.getByRole("button", { name: "Close" })).toBeInTheDocument();
|
|
131
131
|
});
|
package/src/utils/html-seguro.ts
CHANGED
|
@@ -51,7 +51,7 @@ export const normalizarEndereco = (bruto: string): string => {
|
|
|
51
51
|
/** Cor, tamanho e família de fonte só valem como TOKEN do DS: `var(--umds-...)`. Cor em hex, rgb ou nome sai. */
|
|
52
52
|
const COR_TOKEN = /^var\(--umds-(?:primitive|semantic)-[a-z0-9-]+\)$/;
|
|
53
53
|
const TAMANHO_TOKEN = /^var\(--umds-primitive-font-size-[a-z0-9]+\)$/;
|
|
54
|
-
const FAMILIA_TOKEN = /^var\(--umds-(?:primitive|semantic)-font-family-
|
|
54
|
+
const FAMILIA_TOKEN = /^var\(--umds-(?:primitive|semantic)-font-family-base\)$/;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Declaração de estilo de texto que o editor aceita: `color`, `font-size` e `font-family`,
|