@eightshift/ui-components 5.2.1 → 5.3.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.
Files changed (98) hide show
  1. package/dist/{Button-RTwMSBs-.js → Button-npzfSoYo.js} +3 -3
  2. package/dist/{Dialog-Xf6AsnV-.js → Dialog-CQ8H6Noi.js} +77 -50
  3. package/dist/{FocusScope-BnwM-e8R.js → FocusScope-DJApHXhY.js} +1 -1
  4. package/dist/Form-Cq3fu75_.js +5 -0
  5. package/dist/{Group-C4cXobNT.js → Input-ChJaTNa5.js} +39 -39
  6. package/dist/{List-CwJTORxj.js → List-BiAnh5G5.js} +5 -5
  7. package/dist/{ListBox-BeC97FZ4.js → ListBox-D0Stb4wr.js} +13 -23
  8. package/dist/{OverlayArrow-EZ0v_ljk.js → OverlayArrow-DivvkAVb.js} +46 -25
  9. package/dist/{Separator-Fl7qSeN-.js → SearchField-jVsbJe1O.js} +151 -475
  10. package/dist/{Select-DEQf8ZWI.js → Select-ciHB1pub.js} +12 -11
  11. package/dist/{Select-ef7c0426.esm-D6WOCaYm.js → Select-ef7c0426.esm-CmTkSxDx.js} +3 -3
  12. package/dist/{Collection-D_KhdLDC.js → SelectionManager-CabSdgMq.js} +1801 -1777
  13. package/dist/Separator-BPvqJny4.js +344 -0
  14. package/dist/{Slider-BQFSEhvk.js → Slider-ChP04COa.js} +4 -4
  15. package/dist/{VisuallyHidden-D9s7FTtC.js → VisuallyHidden-X6SggVVO.js} +1 -1
  16. package/dist/assets/style-admin.css +315 -79
  17. package/dist/assets/style-editor.css +315 -79
  18. package/dist/assets/style.css +315 -79
  19. package/dist/assets/wp-font-enhancements.css +1 -1
  20. package/dist/assets/wp-ui-enhancements.css +5 -14
  21. package/dist/components/animated-visibility/animated-visibility.js +16 -16
  22. package/dist/components/button/button.js +7 -23
  23. package/dist/components/checkbox/checkbox.js +11 -10
  24. package/dist/components/color-pickers/color-picker.js +5 -4
  25. package/dist/components/color-pickers/color-swatch.js +1 -1
  26. package/dist/components/color-pickers/gradient-editor.js +7 -7
  27. package/dist/components/color-pickers/solid-color-picker.js +8 -8
  28. package/dist/components/component-toggle/component-toggle.js +1 -1
  29. package/dist/components/draggable/draggable-handle.js +1 -1
  30. package/dist/components/draggable/draggable.js +34 -17
  31. package/dist/components/draggable-list/draggable-list-item.js +1 -1
  32. package/dist/components/draggable-list/draggable-list.js +6 -4
  33. package/dist/components/expandable/expandable.js +5 -5
  34. package/dist/components/index.js +2 -1
  35. package/dist/components/input-field/input-field.js +139 -3
  36. package/dist/components/item-collection/item-collection.js +1 -1
  37. package/dist/components/link-input/link-input.js +16 -15
  38. package/dist/components/matrix-align/matrix-align.js +1 -1
  39. package/dist/components/menu/menu.js +94 -24
  40. package/dist/components/modal/modal.js +4 -4
  41. package/dist/components/notice/notice.js +6 -5
  42. package/dist/components/number-picker/number-picker.js +5 -5
  43. package/dist/components/option-select/option-select.js +1 -1
  44. package/dist/components/placeholders/file-placeholder.js +1 -1
  45. package/dist/components/popover/popover.js +7 -21
  46. package/dist/components/radio/radio.js +7 -6
  47. package/dist/components/repeater/repeater-item.js +1 -1
  48. package/dist/components/repeater/repeater.js +2 -2
  49. package/dist/components/responsive/mini-responsive.js +1 -1
  50. package/dist/components/responsive/responsive-legacy.js +1 -1
  51. package/dist/components/responsive/responsive.js +21 -20
  52. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  53. package/dist/components/rich-label/rich-label.js +28 -15
  54. package/dist/components/select/async-multi-select.js +3 -3
  55. package/dist/components/select/async-single-select.js +2 -2
  56. package/dist/components/select/custom-select-default-components.js +1 -1
  57. package/dist/components/select/multi-select-components.js +1 -1
  58. package/dist/components/select/multi-select.js +3 -3
  59. package/dist/components/select/react-select-component-wrappers.js +1 -1
  60. package/dist/components/select/single-select.js +2 -2
  61. package/dist/components/select/styles.js +1 -1
  62. package/dist/components/select/v2/async-multi-select.js +9 -9
  63. package/dist/components/select/v2/async-select.js +9 -9
  64. package/dist/components/select/v2/multi-select.js +8 -8
  65. package/dist/components/select/v2/shared.js +1 -1
  66. package/dist/components/select/v2/single-select.js +8 -8
  67. package/dist/components/slider/column-config-slider.js +2 -2
  68. package/dist/components/slider/slider.js +1 -1
  69. package/dist/components/slider/utils.js +1 -1
  70. package/dist/components/tabs/tabs.js +13 -9
  71. package/dist/components/toggle/switch.js +5 -5
  72. package/dist/components/toggle-button/toggle-button.js +7 -7
  73. package/dist/components/tooltip/tooltip.js +12 -35
  74. package/dist/context-DCAZLyDS.js +7 -0
  75. package/dist/{default-i18n-DY6EfUSA.js → default-i18n-CN_q3KUs.js} +15 -56
  76. package/dist/icons/icons.js +3347 -30273
  77. package/dist/{index-641ee5b8.esm-Bu-mgopl.js → index-641ee5b8.esm-DVp0njHa.js} +10 -8
  78. package/dist/{index-CBHA_HDD.js → index-D8-Zjpbd.js} +18 -18
  79. package/dist/index.js +2 -1
  80. package/dist/{multi-select-components-rCCyCaKO.js → multi-select-components-CT_W0Cy9.js} +1 -1
  81. package/dist/{react-select-async.esm-XYrsKYb2.js → react-select-async.esm-Zl1LPaPb.js} +3 -3
  82. package/dist/{react-select.esm-CCSPY6XR.js → react-select.esm-Bu36HujU.js} +3 -3
  83. package/dist/{textSelection-D5tWX1rJ.js → textSelection-k0u64dDA.js} +1 -1
  84. package/dist/{useAsyncList-ZqaIH2gh.js → useAsyncList-D52mQcrH.js} +30 -0
  85. package/dist/{useButton-BtJSiQi3.js → useButton-Bn4ZT295.js} +4 -3
  86. package/dist/{useDragAndDrop-CddFteYC.js → useDragAndDrop-DVLrIdEn.js} +18 -10
  87. package/dist/{useFilter-Cl2ggwwq.js → useFilter-C4wo8Iii.js} +1 -1
  88. package/dist/{useFocusRing-D5BfOWag.js → useFocusRing-CUxgjvAY.js} +1 -1
  89. package/dist/{Form-BeMxJA29.js → useFormValidation-CUtZcedF.js} +5 -7
  90. package/dist/{useHover-44IApaa2.js → useHover-LmGemtHE.js} +24 -24
  91. package/dist/{useListState-BSkHuB7-.js → useListState-Xsk-aOvN.js} +8 -5
  92. package/dist/{useNumberField-JhWPy1JY.js → useNumberField-BCjjZWaz.js} +100 -99
  93. package/dist/{usePress-BnrkvZ7e.js → usePress-CBQIDzpQ.js} +12 -12
  94. package/dist/{useSingleSelectListState-CzJFsSHr.js → useSingleSelectListState-DattSD7d.js} +2 -2
  95. package/dist/{useToggle-OaIBlwRu.js → useToggle-C8CedY6Z.js} +2 -2
  96. package/dist/{useToggleState-BF8hvidm.js → useToggleState-CiAradXs.js} +1 -1
  97. package/package.json +25 -25
  98. package/dist/TextField-x_eEa_qR.js +0 -143
@@ -2,10 +2,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { p as $ff5963eb1fccf552$export$e08e3b67e392101e, b as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-cvK1vxO7.js";
3
3
  import React__default, { createContext, forwardRef, useContext } from "react";
4
4
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
5
- import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-BF8hvidm.js";
6
- import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../../useButton-BtJSiQi3.js";
7
- import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-D5BfOWag.js";
8
- import { e as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-44IApaa2.js";
5
+ import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-CiAradXs.js";
6
+ import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../../useButton-Bn4ZT295.js";
7
+ import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CUxgjvAY.js";
8
+ import { w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-LmGemtHE.js";
9
9
  import { c as cva } from "../../index-Dq3gT5pW.js";
10
10
  import { Tooltip } from "../tooltip/tooltip.js";
11
11
  function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
@@ -116,7 +116,7 @@ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ forwardRef(fun
116
116
  * @param {boolean} props.selected - Whether the button is selected.
117
117
  * @param {Function} [props.onChange] - Function to run when the toggle state changes.
118
118
  * @param {string} [props.wrapperClassName] - Classes to pass to the tooltip wrapper.
119
- * @param {Object} [props.tooltipProps] - Props to pass to the tooltip.
119
+ * @param {TooltipProps} [props.tooltipProps] - Props to pass to the tooltip.
120
120
  * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
121
121
  *
122
122
  * @returns {JSX.Element} The ToggleButton component.
@@ -181,8 +181,8 @@ const ToggleButton2 = (props) => {
181
181
  {
182
182
  variants: {
183
183
  size: {
184
- small: "es:icon:size-4.5 es:rounded-7",
185
- default: "es:icon:size-5.5 es:rounded-10",
184
+ small: "es:icon:size-5 es:rounded-7",
185
+ default: "es:icon:size-5 es:rounded-10",
186
186
  large: "es:icon:size-6 es:rounded-xl"
187
187
  },
188
188
  type: {
@@ -1,11 +1,11 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f, e as $44f671af83e7d9e0$export$746d02f47f4d381 } from "../../OverlayArrow-EZ0v_ljk.js";
3
- import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, i as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, h as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-cvK1vxO7.js";
2
+ import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f, e as $44f671af83e7d9e0$export$746d02f47f4d381 } from "../../OverlayArrow-DivvkAVb.js";
3
+ import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, i as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-cvK1vxO7.js";
4
4
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
5
- import { e as $6179b936705e76d3$export$ae780daf29e6d456, $ as $f645667febf57a63$export$4c014de7c8940b4c, v as $507fabe10e71c6fb$export$630ff653c5ada6a9, m as $507fabe10e71c6fb$export$b9b3dfddab17db27, y as $f645667febf57a63$export$13f3202a3e5ddd5 } from "../../useHover-44IApaa2.js";
5
+ import { w as $6179b936705e76d3$export$ae780daf29e6d456, $ as $f645667febf57a63$export$4c014de7c8940b4c, u as $507fabe10e71c6fb$export$630ff653c5ada6a9, l as $507fabe10e71c6fb$export$b9b3dfddab17db27, y as $f645667febf57a63$export$13f3202a3e5ddd5 } from "../../useHover-LmGemtHE.js";
6
6
  import React__default, { useContext, useState, useMemo, useRef, useEffect, forwardRef, createContext } from "react";
7
7
  import { a as $96b38030c423d352$export$9fc1347d4195ccb3 } from "../../PortalProvider---wyKpMr.js";
8
- import { $ as $dbSRa$reactdom } from "../../index-CBHA_HDD.js";
8
+ import { $ as $dbSRa$reactdom } from "../../index-D8-Zjpbd.js";
9
9
  import { c as clsx } from "../../lite-DVmmD_-j.js";
10
10
  const $f57aed4a881a3485$var$Context = /* @__PURE__ */ React__default.createContext(null);
11
11
  function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
@@ -152,9 +152,9 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
152
152
  "aria-describedby": state.isOpen ? tooltipId : void 0,
153
153
  ...$3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, hoverProps, {
154
154
  onPointerDown: onPressStart,
155
- onKeyDown: onPressStart,
156
- tabIndex: void 0
157
- })
155
+ onKeyDown: onPressStart
156
+ }),
157
+ tabIndex: void 0
158
158
  },
159
159
  tooltipProps: {
160
160
  id: tooltipId
@@ -297,23 +297,17 @@ const $4e3b923658d69c60$export$28c660c63b792dea = /* @__PURE__ */ forwardRef(fun
297
297
  function $4e3b923658d69c60$var$TooltipInner(props) {
298
298
  let state = useContext($4e3b923658d69c60$export$7a7623236eec67fa);
299
299
  let arrowRef = useRef(null);
300
- let [arrowWidth, setArrowWidth] = useState(0);
301
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
302
- if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);
303
- }, [
304
- state.isOpen,
305
- arrowRef
306
- ]);
307
- let { overlayProps, arrowProps, placement } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
300
+ let { overlayProps, arrowProps, placement, triggerAnchorPoint } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
308
301
  placement: props.placement || "top",
309
302
  targetRef: props.triggerRef,
310
303
  overlayRef: props.tooltipRef,
304
+ arrowRef,
311
305
  offset: props.offset,
312
306
  crossOffset: props.crossOffset,
313
307
  isOpen: state.isOpen,
314
- arrowSize: arrowWidth,
315
308
  arrowBoundaryOffset: props.arrowBoundaryOffset,
316
309
  shouldFlip: props.shouldFlip,
310
+ containerPadding: props.containerPadding,
317
311
  onClose: () => state.close(true)
318
312
  });
319
313
  let isEntering = $d3f049242431219c$export$6d3443f2c48bfc20(props.tooltipRef, !!placement) || props.isEntering || false;
@@ -337,6 +331,7 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
337
331
  ref: props.tooltipRef,
338
332
  style: {
339
333
  ...overlayProps.style,
334
+ "--trigger-anchor-point": triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : void 0,
340
335
  ...renderProps.style
341
336
  },
342
337
  "data-placement": placement !== null && placement !== void 0 ? placement : void 0,
@@ -358,28 +353,10 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
358
353
  * - **Uncontrolled mode**: The tooltip will be open by default with the `defaultOpen` prop.
359
354
  *
360
355
  * @component
361
- * @param {Object} props - Component props.
362
- * @param {string|JSX.Element} props.text - The text to display in the tooltip.
363
- * @param {TooltipTheme} [props.theme='dark'] - The theme of the tooltip.
364
- * @param {number} [props.offset=0] - Additional offset between the tooltip and the element on the main axis (same axis as element).
365
- * @param {number} [props.crossOffset=0] - Additional offset between the tooltip and the element on the cross axis (opposite axis as element).
366
- * @param {number} [props.containerPadding=12] - Space that should be left between the tooltip and the main containing element (usually browser window).
367
- * @param {number} [props.openDelay=1500] - Duration before the tooltip is shown, in milliseconds.
368
- * @param {number} [props.closeDelay=500] - Duration before the tooltip is hidden, in milliseconds.
369
- * @param {boolean} [props.shouldFlip=true] - If `false`, the tooltip will not flip to the opposite side if there is not enough space.
370
- * @param {boolean} [props.defaultOpen] - (**Uncontrolled mode**) Whether the tooltip is initially open.
371
- * @param {boolean} [props.open] - (**Controlled mode**) Whether the tooltip is open.
372
- * @param {Function} [props.onOpenChange] - (**Controlled mode**) Function to run when the tooltip is opened or closed.
373
- * @param {TooltipPlacement} [props.placement] - The side of the trigger element where the tooltip will be displayed.
374
- * @param {string} [props.className] - Classes to pass to the tooltip.
375
- * @param {RefObject<Element>} [props.triggerRef] - Ref to anchor the tooltip to. If not provided, the tooltip will be anchored to the trigger element.
376
- * @param {boolean} [props.arrow] - If `true`, an arrow is shown on the tooltip.
356
+ * @param {TooltipProps} props - Component props.
377
357
  *
378
358
  * @returns {JSX.Element} The Tooltip component.
379
359
  *
380
- * @typedef {'light' | 'dark'} TooltipTheme
381
- * @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} TooltipPlacement
382
- *
383
360
  * @example
384
361
  * <Tooltip text='My tooltip'>
385
362
  * <Button>Hover me</Button>
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+ const $8e6cc465cc68f603$export$b0d3ecf7112093a7 = /* @__PURE__ */ createContext(null);
3
+ const $8e6cc465cc68f603$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
4
+ export {
5
+ $8e6cc465cc68f603$export$698f465ec27e93df as $,
6
+ $8e6cc465cc68f603$export$b0d3ecf7112093a7 as a
7
+ };
@@ -208,7 +208,6 @@ Tannin.prototype.dcnpgettext = function(domain, context, singular, plural, n) {
208
208
  };
209
209
  const DEFAULT_LOCALE_DATA = {
210
210
  "": {
211
- /** @param {number} n */
212
211
  plural_forms(n) {
213
212
  return n === 1 ? 0 : 1;
214
213
  }
@@ -267,74 +266,38 @@ const createI18n = (initialData, initialDomain, hooks) => {
267
266
  }
268
267
  return tannin.dcnpgettext(domain, context, single, plural, number);
269
268
  };
270
- const getFilterDomain = (domain = "default") => domain;
269
+ const getFilterDomain = (domain) => domain || "default";
271
270
  const __2 = (text, domain) => {
272
271
  let translation = dcnpgettext(domain, void 0, text);
273
272
  if (!hooks) {
274
- return (
275
- /** @type {import('./types').TranslatableText<typeof text>} */
276
- translation
277
- );
273
+ return translation;
278
274
  }
279
- translation = /** @type {string} */
280
- /** @type {*} */
281
- hooks.applyFilters("i18n.gettext", translation, text, domain);
282
- return (
283
- /** @type {import('./types').TranslatableText<typeof text>} */
284
- /** @type {*} */
285
- hooks.applyFilters("i18n.gettext_" + getFilterDomain(domain), translation, text, domain)
286
- );
275
+ translation = hooks.applyFilters("i18n.gettext", translation, text, domain);
276
+ return hooks.applyFilters("i18n.gettext_" + getFilterDomain(domain), translation, text, domain);
287
277
  };
288
278
  const _x = (text, context, domain) => {
289
279
  let translation = dcnpgettext(domain, context, text);
290
280
  if (!hooks) {
291
- return (
292
- /** @type {import('./types').TranslatableText<typeof text>} */
293
- translation
294
- );
281
+ return translation;
295
282
  }
296
- translation = /** @type {string} */
297
- /** @type {*} */
298
- hooks.applyFilters("i18n.gettext_with_context", translation, text, context, domain);
299
- return (
300
- /** @type {import('./types').TranslatableText<typeof text>} */
301
- /** @type {*} */
302
- hooks.applyFilters("i18n.gettext_with_context_" + getFilterDomain(domain), translation, text, context, domain)
303
- );
283
+ translation = hooks.applyFilters("i18n.gettext_with_context", translation, text, context, domain);
284
+ return hooks.applyFilters("i18n.gettext_with_context_" + getFilterDomain(domain), translation, text, context, domain);
304
285
  };
305
286
  const _n2 = (single, plural, number, domain) => {
306
287
  let translation = dcnpgettext(domain, void 0, single, plural, number);
307
288
  if (!hooks) {
308
- return (
309
- /** @type {import('./types').TranslatableText<typeof single | typeof plural>} */
310
- translation
311
- );
289
+ return translation;
312
290
  }
313
- translation = /** @type {string} */
314
- /** @type {*} */
315
- hooks.applyFilters("i18n.ngettext", translation, single, plural, number, domain);
316
- return (
317
- /** @type {import('./types').TranslatableText<typeof single | typeof plural>} */
318
- /** @type {*} */
319
- hooks.applyFilters("i18n.ngettext_" + getFilterDomain(domain), translation, single, plural, number, domain)
320
- );
291
+ translation = hooks.applyFilters("i18n.ngettext", translation, single, plural, number, domain);
292
+ return hooks.applyFilters("i18n.ngettext_" + getFilterDomain(domain), translation, single, plural, number, domain);
321
293
  };
322
294
  const _nx = (single, plural, number, context, domain) => {
323
295
  let translation = dcnpgettext(domain, context, single, plural, number);
324
296
  if (!hooks) {
325
- return (
326
- /** @type {import('./types').TranslatableText<typeof single | typeof plural>} */
327
- translation
328
- );
297
+ return translation;
329
298
  }
330
- translation = /** @type {string} */
331
- /** @type {*} */
332
- hooks.applyFilters("i18n.ngettext_with_context", translation, single, plural, number, context, domain);
333
- return (
334
- /** @type {import('./types').TranslatableText<typeof single | typeof plural>} */
335
- /** @type {*} */
336
- hooks.applyFilters("i18n.ngettext_with_context_" + getFilterDomain(domain), translation, single, plural, number, context, domain)
337
- );
299
+ translation = hooks.applyFilters("i18n.ngettext_with_context", translation, single, plural, number, context, domain);
300
+ return hooks.applyFilters("i18n.ngettext_with_context_" + getFilterDomain(domain), translation, single, plural, number, context, domain);
338
301
  };
339
302
  const isRTL = () => {
340
303
  return "rtl" === _x("ltr", "text direction");
@@ -343,12 +306,8 @@ const createI18n = (initialData, initialDomain, hooks) => {
343
306
  const key = context ? context + "" + single : single;
344
307
  let result = !!tannin.data?.[domain !== null && domain !== void 0 ? domain : "default"]?.[key];
345
308
  if (hooks) {
346
- result = /** @type { boolean } */
347
- /** @type {*} */
348
- hooks.applyFilters("i18n.has_translation", result, single, context, domain);
349
- result = /** @type { boolean } */
350
- /** @type {*} */
351
- hooks.applyFilters("i18n.has_translation_" + getFilterDomain(domain), result, single, context, domain);
309
+ result = hooks.applyFilters("i18n.has_translation", result, single, context, domain);
310
+ result = hooks.applyFilters("i18n.has_translation_" + getFilterDomain(domain), result, single, context, domain);
352
311
  }
353
312
  return result;
354
313
  };