@yurikilian/lex4 1.4.0 → 1.4.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.
@@ -548,7 +548,20 @@ const DEFAULT_TRANSLATIONS = {
548
548
  page: "Page {{page}}"
549
549
  },
550
550
  headerFooter: {
551
- label: "Headers & Footers"
551
+ label: "Headers & Footers",
552
+ settingsLabel: "Header and footer settings",
553
+ pageCounter: "Page counter",
554
+ pageCounterModes: {
555
+ none: "None",
556
+ header: "Header",
557
+ footer: "Footer",
558
+ both: "Both"
559
+ },
560
+ headerSection: "Header",
561
+ footerSection: "Footer",
562
+ copyToAllPages: "Copy to all pages",
563
+ clearThisPage: "Clear this page",
564
+ clearAll: "Clear all"
552
565
  },
553
566
  sidebar: {
554
567
  close: "Close sidebar"
@@ -666,7 +679,20 @@ const PT_BR_TRANSLATIONS = {
666
679
  page: "Página {{page}}"
667
680
  },
668
681
  headerFooter: {
669
- label: "Cabeçalhos e Rodapés"
682
+ label: "Cabeçalhos e Rodapés",
683
+ settingsLabel: "Configurações de cabeçalho e rodapé",
684
+ pageCounter: "Contador de páginas",
685
+ pageCounterModes: {
686
+ none: "Nenhum",
687
+ header: "Cabeçalho",
688
+ footer: "Rodapé",
689
+ both: "Ambos"
690
+ },
691
+ headerSection: "Cabeçalho",
692
+ footerSection: "Rodapé",
693
+ copyToAllPages: "Copiar para todas as páginas",
694
+ clearThisPage: "Limpar esta página",
695
+ clearAll: "Limpar tudo"
670
696
  },
671
697
  sidebar: {
672
698
  close: "Fechar barra lateral"
@@ -2077,12 +2103,7 @@ const HeaderFooterToggle = ({
2077
2103
  }
2078
2104
  );
2079
2105
  };
2080
- const PAGE_COUNTER_OPTIONS = [
2081
- { value: "none", label: "None" },
2082
- { value: "header", label: "Header" },
2083
- { value: "footer", label: "Footer" },
2084
- { value: "both", label: "Both" }
2085
- ];
2106
+ const PAGE_COUNTER_OPTIONS = ["none", "header", "footer", "both"];
2086
2107
  const HeaderFooterActions = ({
2087
2108
  activePageId,
2088
2109
  pageCounterMode,
@@ -2097,6 +2118,7 @@ const HeaderFooterActions = ({
2097
2118
  const [open, setOpen] = useState(false);
2098
2119
  const containerRef = useRef(null);
2099
2120
  const hasActivePage = activePageId !== null;
2121
+ const t = useTranslations();
2100
2122
  const close = useCallback(() => setOpen(false), []);
2101
2123
  useEffect(() => {
2102
2124
  if (!open) return;
@@ -2123,8 +2145,8 @@ const HeaderFooterActions = ({
2123
2145
  "data-testid": "header-footer-menu-trigger",
2124
2146
  "aria-expanded": open,
2125
2147
  "aria-haspopup": "true",
2126
- "aria-label": "Header and footer settings",
2127
- title: "Header and footer settings",
2148
+ "aria-label": t.headerFooter.settingsLabel,
2149
+ title: t.headerFooter.settingsLabel,
2128
2150
  children: /* @__PURE__ */ jsx(Settings2, { size: 14 })
2129
2151
  }
2130
2152
  ),
@@ -2135,8 +2157,8 @@ const HeaderFooterActions = ({
2135
2157
  role: "menu",
2136
2158
  "data-testid": "header-footer-menu",
2137
2159
  children: [
2138
- /* @__PURE__ */ jsx(SectionLabel, { children: "Page counter" }),
2139
- /* @__PURE__ */ jsx("div", { className: "lex4-settings-counter-grid", "data-testid": "page-counter-mode", children: PAGE_COUNTER_OPTIONS.map(({ value, label }) => /* @__PURE__ */ jsx(
2160
+ /* @__PURE__ */ jsx(SectionLabel, { children: t.headerFooter.pageCounter }),
2161
+ /* @__PURE__ */ jsx("div", { className: "lex4-settings-counter-grid", "data-testid": "page-counter-mode", children: PAGE_COUNTER_OPTIONS.map((value) => /* @__PURE__ */ jsx(
2140
2162
  "button",
2141
2163
  {
2142
2164
  type: "button",
@@ -2146,17 +2168,17 @@ const HeaderFooterActions = ({
2146
2168
  onClick: () => onPageCounterModeChange(value),
2147
2169
  className: "lex4-settings-counter-btn",
2148
2170
  "data-testid": `page-counter-${value}`,
2149
- children: label
2171
+ children: t.headerFooter.pageCounterModes[value]
2150
2172
  },
2151
2173
  value
2152
2174
  )) }),
2153
2175
  /* @__PURE__ */ jsx(MenuDivider, {}),
2154
- /* @__PURE__ */ jsx(SectionLabel, { children: "Header" }),
2176
+ /* @__PURE__ */ jsx(SectionLabel, { children: t.headerFooter.headerSection }),
2155
2177
  /* @__PURE__ */ jsx(
2156
2178
  MenuItem,
2157
2179
  {
2158
2180
  icon: /* @__PURE__ */ jsx(CopyPlus, { size: 14 }),
2159
- label: "Copy to all pages",
2181
+ label: t.headerFooter.copyToAllPages,
2160
2182
  onClick: () => handleAction(onCopyHeaderToAll),
2161
2183
  disabled: !hasActivePage,
2162
2184
  testId: "copy-header-all"
@@ -2166,7 +2188,7 @@ const HeaderFooterActions = ({
2166
2188
  MenuItem,
2167
2189
  {
2168
2190
  icon: /* @__PURE__ */ jsx(Eraser, { size: 14 }),
2169
- label: "Clear this page",
2191
+ label: t.headerFooter.clearThisPage,
2170
2192
  onClick: () => handleAction(onClearHeader),
2171
2193
  disabled: !hasActivePage,
2172
2194
  testId: "clear-header"
@@ -2176,18 +2198,18 @@ const HeaderFooterActions = ({
2176
2198
  MenuItem,
2177
2199
  {
2178
2200
  icon: /* @__PURE__ */ jsx(Trash2, { size: 14 }),
2179
- label: "Clear all",
2201
+ label: t.headerFooter.clearAll,
2180
2202
  onClick: () => handleAction(onClearAllHeaders),
2181
2203
  testId: "clear-all-headers"
2182
2204
  }
2183
2205
  ),
2184
2206
  /* @__PURE__ */ jsx(MenuDivider, {}),
2185
- /* @__PURE__ */ jsx(SectionLabel, { children: "Footer" }),
2207
+ /* @__PURE__ */ jsx(SectionLabel, { children: t.headerFooter.footerSection }),
2186
2208
  /* @__PURE__ */ jsx(
2187
2209
  MenuItem,
2188
2210
  {
2189
2211
  icon: /* @__PURE__ */ jsx(CopyPlus, { size: 14 }),
2190
- label: "Copy to all pages",
2212
+ label: t.headerFooter.copyToAllPages,
2191
2213
  onClick: () => handleAction(onCopyFooterToAll),
2192
2214
  disabled: !hasActivePage,
2193
2215
  testId: "copy-footer-all"
@@ -2197,7 +2219,7 @@ const HeaderFooterActions = ({
2197
2219
  MenuItem,
2198
2220
  {
2199
2221
  icon: /* @__PURE__ */ jsx(Eraser, { size: 14 }),
2200
- label: "Clear this page",
2222
+ label: t.headerFooter.clearThisPage,
2201
2223
  onClick: () => handleAction(onClearFooter),
2202
2224
  disabled: !hasActivePage,
2203
2225
  testId: "clear-footer"
@@ -2207,7 +2229,7 @@ const HeaderFooterActions = ({
2207
2229
  MenuItem,
2208
2230
  {
2209
2231
  icon: /* @__PURE__ */ jsx(Trash2, { size: 14 }),
2210
- label: "Clear all",
2232
+ label: t.headerFooter.clearAll,
2211
2233
  onClick: () => handleAction(onClearAllFooters),
2212
2234
  testId: "clear-all-footers"
2213
2235
  }
@@ -5411,7 +5433,7 @@ const VariableToolbarToggle = () => {
5411
5433
  "aria-label": panelOpen ? t.variables.closePanel : t.variables.openPanel,
5412
5434
  children: [
5413
5435
  /* @__PURE__ */ jsx(Braces, { size: 14 }),
5414
- "Variables"
5436
+ t.variables.title
5415
5437
  ]
5416
5438
  }
5417
5439
  );