@sofereditor/core 0.4.0 → 0.5.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/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -138,6 +138,11 @@ interface BlockAttrs {
|
|
|
138
138
|
* Ausente = "all" — documentos existentes não mudam de aparência.
|
|
139
139
|
*/
|
|
140
140
|
borderPreset?: TableBorderPreset;
|
|
141
|
+
/**
|
|
142
|
+
* Só relevante quando `type === "table"`. Cor das linhas da grade.
|
|
143
|
+
* Ausente = `TABLE_BORDER_COLOR` — documentos existentes não mudam.
|
|
144
|
+
*/
|
|
145
|
+
borderColor?: string;
|
|
141
146
|
/**
|
|
142
147
|
* Só relevante quando `type === "paragraph"`. Parágrafo pautado para o aluno
|
|
143
148
|
* escrever a resposta: renderiza com régua inferior de largura total.
|
|
@@ -582,9 +587,9 @@ interface CellBorderColors {
|
|
|
582
587
|
* `:first-child`/`:last-child`, que quebram assim que uma célula `covered` some
|
|
583
588
|
* do DOM por causa de um rowspan.
|
|
584
589
|
*/
|
|
585
|
-
declare function cellBorderColors(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print"): CellBorderColors;
|
|
590
|
+
declare function cellBorderColors(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print", color?: string): CellBorderColors;
|
|
586
591
|
/** `cellBorderColors` no formato de estilo inline consumido pelos renderizadores. */
|
|
587
|
-
declare function cellBorderStyle(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print"): StyleRecord;
|
|
592
|
+
declare function cellBorderStyle(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print", color?: string): StyleRecord;
|
|
588
593
|
|
|
589
594
|
/** MIME custom que carrega o slice serializado no clipboard. */
|
|
590
595
|
declare const SOFER_MIME = "application/x-sofer-slice";
|
package/dist/index.d.ts
CHANGED
|
@@ -138,6 +138,11 @@ interface BlockAttrs {
|
|
|
138
138
|
* Ausente = "all" — documentos existentes não mudam de aparência.
|
|
139
139
|
*/
|
|
140
140
|
borderPreset?: TableBorderPreset;
|
|
141
|
+
/**
|
|
142
|
+
* Só relevante quando `type === "table"`. Cor das linhas da grade.
|
|
143
|
+
* Ausente = `TABLE_BORDER_COLOR` — documentos existentes não mudam.
|
|
144
|
+
*/
|
|
145
|
+
borderColor?: string;
|
|
141
146
|
/**
|
|
142
147
|
* Só relevante quando `type === "paragraph"`. Parágrafo pautado para o aluno
|
|
143
148
|
* escrever a resposta: renderiza com régua inferior de largura total.
|
|
@@ -582,9 +587,9 @@ interface CellBorderColors {
|
|
|
582
587
|
* `:first-child`/`:last-child`, que quebram assim que uma célula `covered` some
|
|
583
588
|
* do DOM por causa de um rowspan.
|
|
584
589
|
*/
|
|
585
|
-
declare function cellBorderColors(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print"): CellBorderColors;
|
|
590
|
+
declare function cellBorderColors(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print", color?: string): CellBorderColors;
|
|
586
591
|
/** `cellBorderColors` no formato de estilo inline consumido pelos renderizadores. */
|
|
587
|
-
declare function cellBorderStyle(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print"): StyleRecord;
|
|
592
|
+
declare function cellBorderStyle(preset: TableBorderPreset | undefined, pos: CellBorderPos, variant: "screen" | "print", color?: string): StyleRecord;
|
|
588
593
|
|
|
589
594
|
/** MIME custom que carrega o slice serializado no clipboard. */
|
|
590
595
|
declare const SOFER_MIME = "application/x-sofer-slice";
|
package/dist/index.js
CHANGED
|
@@ -768,8 +768,8 @@ function kebab(prop) {
|
|
|
768
768
|
// src/table-borders.ts
|
|
769
769
|
var TABLE_BORDER_COLOR = "#cbd5e1";
|
|
770
770
|
var TABLE_GUIDE_COLOR = "var(--ed-guide-color, transparent)";
|
|
771
|
-
function cellBorderColors(preset, pos, variant) {
|
|
772
|
-
const on = TABLE_BORDER_COLOR;
|
|
771
|
+
function cellBorderColors(preset, pos, variant, color) {
|
|
772
|
+
const on = color && color.length > 0 ? color : TABLE_BORDER_COLOR;
|
|
773
773
|
const off = variant === "screen" ? TABLE_GUIDE_COLOR : "transparent";
|
|
774
774
|
switch (preset ?? "all") {
|
|
775
775
|
case "horizontal":
|
|
@@ -795,8 +795,8 @@ function cellBorderColors(preset, pos, variant) {
|
|
|
795
795
|
return { top: on, right: on, bottom: on, left: on };
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
function cellBorderStyle(preset, pos, variant) {
|
|
799
|
-
const c = cellBorderColors(preset, pos, variant);
|
|
798
|
+
function cellBorderStyle(preset, pos, variant, color) {
|
|
799
|
+
const c = cellBorderColors(preset, pos, variant, color);
|
|
800
800
|
return {
|
|
801
801
|
borderTopColor: c.top,
|
|
802
802
|
borderRightColor: c.right,
|