@cgi-learning-hub/ui 1.14.0-dev.1785252242 → 1.14.0-dev.1785338327

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.
@@ -9,7 +9,9 @@ let _mui_material_Tooltip = require("@mui/material/Tooltip");
9
9
  let _mui_material_Badge = require("@mui/material/Badge");
10
10
  let _mui_material_SvgIcon = require("@mui/material/SvgIcon");
11
11
  let _mui_material_MenuItem = require("@mui/material/MenuItem");
12
+ let _mui_material_Typography = require("@mui/material/Typography");
12
13
  let _mui_material_Menu = require("@mui/material/Menu");
14
+ let _mui_material_IconButton = require("@mui/material/IconButton");
13
15
  let _mui_material_Stack = require("@mui/material/Stack");
14
16
  let _mui_material_InputBase = require("@mui/material/InputBase");
15
17
  let _mui_material_Divider = require("@mui/material/Divider");
@@ -4281,7 +4283,7 @@ function toggleBlockquote(editor) {
4281
4283
  /**
4282
4284
  * Determines if the blockquote button should be shown
4283
4285
  */
4284
- function shouldShowButton$6(props) {
4286
+ function shouldShowButton$5(props) {
4285
4287
  const { editor, hideWhenUnavailable } = props;
4286
4288
  if (!editor) return false;
4287
4289
  if (!hideWhenUnavailable) return true;
@@ -4335,7 +4337,7 @@ function useBlockquote(config) {
4335
4337
  (0, react.useEffect)(() => {
4336
4338
  if (!editor) return;
4337
4339
  const handleSelectionUpdate = () => {
4338
- setIsVisible(shouldShowButton$6({
4340
+ setIsVisible(shouldShowButton$5({
4339
4341
  editor,
4340
4342
  hideWhenUnavailable
4341
4343
  }));
@@ -4356,7 +4358,7 @@ function useBlockquote(config) {
4356
4358
  return success;
4357
4359
  }, [editor, onToggled]),
4358
4360
  canToggle,
4359
- label: "Blockquote",
4361
+ label: "Citation en bloc",
4360
4362
  shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
4361
4363
  Icon: TextSnippetIcon
4362
4364
  };
@@ -4431,7 +4433,7 @@ var BlockquoteButton = (0, react.forwardRef)(({ editor: providedEditor, text, hi
4431
4433
  disabled: !canToggle,
4432
4434
  "data-disabled": !canToggle,
4433
4435
  "aria-label": label,
4434
- tooltip: "Blockquote",
4436
+ tooltip: label,
4435
4437
  onClick: handleClick,
4436
4438
  ...buttonProps,
4437
4439
  ref,
@@ -4548,7 +4550,7 @@ function toggleCodeBlock(editor) {
4548
4550
  /**
4549
4551
  * Determines if the code block button should be shown
4550
4552
  */
4551
- function shouldShowButton$5(props) {
4553
+ function shouldShowButton$4(props) {
4552
4554
  const { editor, hideWhenUnavailable } = props;
4553
4555
  if (!editor) return false;
4554
4556
  if (!hideWhenUnavailable) return true;
@@ -4609,7 +4611,7 @@ function useCodeBlock(config) {
4609
4611
  (0, react.useEffect)(() => {
4610
4612
  if (!editor) return;
4611
4613
  const handleSelectionUpdate = () => {
4612
- setIsVisible(shouldShowButton$5({
4614
+ setIsVisible(shouldShowButton$4({
4613
4615
  editor,
4614
4616
  hideWhenUnavailable
4615
4617
  }));
@@ -4630,7 +4632,7 @@ function useCodeBlock(config) {
4630
4632
  return success;
4631
4633
  }, [editor, onToggled]),
4632
4634
  canToggle: canToggleState,
4633
- label: "Code Block",
4635
+ label: "Bloc de code",
4634
4636
  shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
4635
4637
  Icon: IntegrationInstructionIcon
4636
4638
  };
@@ -4667,7 +4669,7 @@ var CodeBlockButton = (0, react.forwardRef)(({ editor: providedEditor, text, hid
4667
4669
  "data-disabled": !canToggle,
4668
4670
  tabIndex: -1,
4669
4671
  "aria-label": label,
4670
- tooltip: "Code Block",
4672
+ tooltip: label,
4671
4673
  onClick: handleClick,
4672
4674
  ...buttonProps,
4673
4675
  ref,
@@ -4744,7 +4746,7 @@ var HeadingThreeIcon = (0, _mui_material_utils.createSvgIcon)(/* @__PURE__ */ (0
4744
4746
  })
4745
4747
  ] }), "HeadingThree");
4746
4748
  //#endregion
4747
- //#region src/tiptap/components/ui/heading-button/use-heading.ts
4749
+ //#region src/tiptap/components/ui/heading-menu-item/use-heading.ts
4748
4750
  var headingIcons = {
4749
4751
  1: HeadingOneIcon,
4750
4752
  2: (0, _mui_material_utils.createSvgIcon)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
@@ -4844,9 +4846,9 @@ function toggleHeading(editor, level) {
4844
4846
  }
4845
4847
  }
4846
4848
  /**
4847
- * Determines if the heading button should be shown
4849
+ * Determines if the heading menu item should be shown
4848
4850
  */
4849
- function shouldShowButton$4(props) {
4851
+ function shouldShowItem(props) {
4850
4852
  const { editor, level, hideWhenUnavailable } = props;
4851
4853
  if (!editor) return false;
4852
4854
  if (!hideWhenUnavailable) return true;
@@ -4864,7 +4866,7 @@ function shouldShowButton$4(props) {
4864
4866
  * @example
4865
4867
  * ```tsx
4866
4868
  * // Simple usage
4867
- * function MySimpleHeadingButton() {
4869
+ * function MySimpleHeadingItem() {
4868
4870
  * const { isVisible, isActive, handleToggle, Icon } = useHeading({ level: 1 })
4869
4871
  *
4870
4872
  * if (!isVisible) return null
@@ -4881,7 +4883,7 @@ function shouldShowButton$4(props) {
4881
4883
  * }
4882
4884
  *
4883
4885
  * // Advanced usage with configuration
4884
- * function MyAdvancedHeadingButton() {
4886
+ * function MyAdvancedHeadingItem() {
4885
4887
  * const { isVisible, isActive, handleToggle, label, Icon } = useHeading({
4886
4888
  * level: 2,
4887
4889
  * editor: myEditor,
@@ -4913,7 +4915,7 @@ function useHeading(config) {
4913
4915
  (0, react.useEffect)(() => {
4914
4916
  if (!editor) return;
4915
4917
  const handleSelectionUpdate = () => {
4916
- setIsVisible(shouldShowButton$4({
4918
+ setIsVisible(shouldShowItem({
4917
4919
  editor,
4918
4920
  level,
4919
4921
  hideWhenUnavailable
@@ -4943,22 +4945,22 @@ function useHeading(config) {
4943
4945
  onToggled
4944
4946
  ]),
4945
4947
  canToggle: canToggleState,
4946
- label: `Heading ${level}`,
4948
+ label: `Titre ${level}`,
4947
4949
  shortcutKeys: HEADING_SHORTCUT_KEYS[level],
4948
4950
  Icon: headingIcons[level]
4949
4951
  };
4950
4952
  }
4951
4953
  //#endregion
4952
- //#region src/tiptap/components/ui/heading-button/heading-button.tsx
4954
+ //#region src/tiptap/components/ui/heading-menu-item/heading-menu-item.tsx
4953
4955
  function HeadingShortcutBadge({ level, shortcutKeys = HEADING_SHORTCUT_KEYS[level] }) {
4954
4956
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Badge.default, { children: parseShortcutKeys({ shortcutKeys }) });
4955
4957
  }
4956
4958
  /**
4957
- * Button component for toggling heading in a Tiptap editor.
4959
+ * Menu item component for toggling heading in a Tiptap editor.
4958
4960
  *
4959
- * For custom button implementations, use the `useHeading` hook instead.
4961
+ * For custom menu item implementations, use the `useHeading` hook instead.
4960
4962
  */
4961
- var HeadingButton = (0, react.forwardRef)(({ editor: providedEditor, level, text, hideWhenUnavailable = false, onToggled, showShortcut = false, onClick, children, ...buttonProps }, ref) => {
4963
+ var HeadingMenuItem = (0, react.forwardRef)(({ editor: providedEditor, level, text, hideWhenUnavailable = false, onToggled, showShortcut = false, onClick, children, ...menuItemProps }, ref) => {
4962
4964
  const { editor } = useTiptapEditor(providedEditor);
4963
4965
  const { isVisible, canToggle, isActive, handleToggle, label, Icon, shortcutKeys } = useHeading({
4964
4966
  editor,
@@ -4983,13 +4985,15 @@ var HeadingButton = (0, react.forwardRef)(({ editor: providedEditor, level, text
4983
4985
  tooltip: label,
4984
4986
  selected: isActive,
4985
4987
  onClick: handleClick,
4986
- ...buttonProps,
4988
+ ...menuItemProps,
4987
4989
  ref,
4988
4990
  children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
4989
4991
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { fontSize: "small" }),
4990
- text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4991
- className: "tiptap-button-text",
4992
- children: text
4992
+ text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Typography.default, {
4993
+ component: "span",
4994
+ variant: "body2",
4995
+ sx: { ml: 1 },
4996
+ children: label
4993
4997
  }),
4994
4998
  showShortcut && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingShortcutBadge, {
4995
4999
  level,
@@ -4998,7 +5002,7 @@ var HeadingButton = (0, react.forwardRef)(({ editor: providedEditor, level, text
4998
5002
  ] })
4999
5003
  });
5000
5004
  });
5001
- HeadingButton.displayName = "HeadingButton";
5005
+ HeadingMenuItem.displayName = "HeadingMenuItem";
5002
5006
  //#endregion
5003
5007
  //#region src/tiptap/components/icons/heading-icon.tsx
5004
5008
  var HeadingIcon = (0, _mui_material_utils.createSvgIcon)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
@@ -5006,7 +5010,7 @@ var HeadingIcon = (0, _mui_material_utils.createSvgIcon)(/* @__PURE__ */ (0, rea
5006
5010
  fill: "currentColor"
5007
5011
  }), "Heading");
5008
5012
  //#endregion
5009
- //#region src/tiptap/components/ui/heading-dropdown-menu/use-heading-dropdown-menu.ts
5013
+ //#region src/tiptap/components/ui/heading-menu/use-heading-menu.ts
5010
5014
  /**
5011
5015
  * Gets the currently active heading level from the available levels
5012
5016
  */
@@ -5022,35 +5026,35 @@ function getActiveHeadingLevel(editor, levels = [
5022
5026
  return levels.find((level) => isHeadingActive(editor, level));
5023
5027
  }
5024
5028
  /**
5025
- * Custom hook that provides heading dropdown menu functionality for Tiptap editor
5029
+ * Custom hook that provides heading menu functionality for Tiptap editor
5026
5030
  *
5027
5031
  * @example
5028
5032
  * ```tsx
5029
5033
  * // Simple usage
5030
- * function MyHeadingDropdown() {
5034
+ * function MyHeading() {
5031
5035
  * const {
5032
5036
  * isVisible,
5033
5037
  * activeLevel,
5034
5038
  * isAnyHeadingActive,
5035
5039
  * canToggle,
5036
5040
  * levels,
5037
- * } = useHeadingDropdownMenu()
5041
+ * } = useHeadingMenu()
5038
5042
  *
5039
5043
  * if (!isVisible) return null
5040
5044
  *
5041
5045
  * return (
5042
- * <DropdownMenu>
5043
- * // dropdown content
5044
- * </DropdownMenu>
5046
+ * <Menu>
5047
+ * // content
5048
+ * </Menu>
5045
5049
  * )
5046
5050
  * }
5047
5051
  *
5048
5052
  * // Advanced usage with configuration
5049
- * function MyAdvancedHeadingDropdown() {
5053
+ * function MyAdvancedHeading() {
5050
5054
  * const {
5051
5055
  * isVisible,
5052
5056
  * activeLevel,
5053
- * } = useHeadingDropdownMenu({
5057
+ * } = useHeadingMenu({
5054
5058
  * editor: myEditor,
5055
5059
  * levels: [1, 2, 3],
5056
5060
  * hideWhenUnavailable: true,
@@ -5060,7 +5064,7 @@ function getActiveHeadingLevel(editor, levels = [
5060
5064
  * }
5061
5065
  * ```
5062
5066
  */
5063
- function useHeadingDropdownMenu(config) {
5067
+ function useHeadingMenu(config) {
5064
5068
  const { editor: providedEditor, levels = [
5065
5069
  1,
5066
5070
  2,
@@ -5077,7 +5081,7 @@ function useHeadingDropdownMenu(config) {
5077
5081
  (0, react.useEffect)(() => {
5078
5082
  if (!editor) return;
5079
5083
  const handleSelectionUpdate = () => {
5080
- setIsVisible(shouldShowButton$4({
5084
+ setIsVisible(shouldShowItem({
5081
5085
  editor,
5082
5086
  hideWhenUnavailable,
5083
5087
  level: levels
@@ -5099,18 +5103,18 @@ function useHeadingDropdownMenu(config) {
5099
5103
  isActive,
5100
5104
  canToggle: canToggleState,
5101
5105
  levels,
5102
- label: "Heading",
5106
+ label: "Titre",
5103
5107
  Icon: activeLevel ? headingIcons[activeLevel] : HeadingIcon
5104
5108
  };
5105
5109
  }
5106
5110
  //#endregion
5107
- //#region src/tiptap/components/ui/heading-dropdown-menu/heading-dropdown-menu.tsx
5111
+ //#region src/tiptap/components/ui/heading-menu/heading-menu.tsx
5108
5112
  /**
5109
- * Dropdown menu component for selecting heading levels in a Tiptap editor.
5113
+ * Menu component for selecting heading levels in a Tiptap editor.
5110
5114
  *
5111
- * For custom dropdown implementations, use the `useHeadingDropdownMenu` hook instead.
5115
+ * For custom menu implementations, use the `useHeadingMenu` hook instead.
5112
5116
  */
5113
- var HeadingDropdownMenu = (0, react.forwardRef)(({ editor: providedEditor, levels = [
5117
+ var HeadingMenu = (0, react.forwardRef)(({ editor: providedEditor, levels = [
5114
5118
  1,
5115
5119
  2,
5116
5120
  3,
@@ -5121,7 +5125,7 @@ var HeadingDropdownMenu = (0, react.forwardRef)(({ editor: providedEditor, level
5121
5125
  const { editor } = useTiptapEditor(providedEditor);
5122
5126
  const [anchorEl, setAnchorEl] = (0, react.useState)(null);
5123
5127
  const open = Boolean(anchorEl);
5124
- const { isVisible, isActive, canToggle, Icon } = useHeadingDropdownMenu({
5128
+ const { isVisible, isActive, canToggle, Icon, label } = useHeadingMenu({
5125
5129
  editor,
5126
5130
  levels,
5127
5131
  hideWhenUnavailable
@@ -5152,7 +5156,7 @@ var HeadingDropdownMenu = (0, react.forwardRef)(({ editor: providedEditor, level
5152
5156
  "aria-controls": "heading-menu",
5153
5157
  "aria-label": "Format text as heading",
5154
5158
  "aria-expanded": open,
5155
- tooltip: "Heading",
5159
+ tooltip: label,
5156
5160
  onClick: handleClick,
5157
5161
  ...buttonProps,
5158
5162
  ref,
@@ -5166,7 +5170,7 @@ var HeadingDropdownMenu = (0, react.forwardRef)(({ editor: providedEditor, level
5166
5170
  "aria-labelledby": "heading-button",
5167
5171
  role: "listbox"
5168
5172
  } },
5169
- children: levels.map((level) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingButton, {
5173
+ children: levels.map((level) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingMenuItem, {
5170
5174
  editor,
5171
5175
  level,
5172
5176
  text: `Heading ${level}`,
@@ -5174,7 +5178,7 @@ var HeadingDropdownMenu = (0, react.forwardRef)(({ editor: providedEditor, level
5174
5178
  }, `heading-${level}`))
5175
5179
  })] });
5176
5180
  });
5177
- HeadingDropdownMenu.displayName = "HeadingDropdownMenu";
5181
+ HeadingMenu.displayName = "HeadingMenu";
5178
5182
  //#endregion
5179
5183
  //#region ../../node_modules/.pnpm/@mui+icons-material@9.1.1_@mui+material@9.1.1_@emotion+react@11.14.0_@types+react@19.2._9b347fe2e167545244369f75d4366d7f/node_modules/@mui/icons-material/KeyboardReturnRounded.mjs
5180
5184
  var KeyboardReturnRounded_default = (0, _mui_material_SvgIcon.createSvgIcon)(/*#__PURE__*/ (0, react_jsx_runtime.jsx)("path", { d: "M19 8v3H5.83l2.88-2.88c.39-.39.39-1.02 0-1.41a.996.996 0 0 0-1.41 0L2.71 11.3c-.39.39-.39 1.02 0 1.41L7.3 17.3c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L5.83 13H20c.55 0 1-.45 1-1V8c0-.55-.45-1-1-1s-1 .45-1 1" }), "KeyboardReturnRounded");
@@ -5351,7 +5355,7 @@ function useLinkPopover(config) {
5351
5355
  isVisible,
5352
5356
  canSet,
5353
5357
  isActive,
5354
- label: "Link",
5358
+ label: "Lien",
5355
5359
  Icon: LinkRounded_default,
5356
5360
  ...useLinkHandler({
5357
5361
  editor,
@@ -5360,77 +5364,6 @@ function useLinkPopover(config) {
5360
5364
  };
5361
5365
  }
5362
5366
  //#endregion
5363
- //#region ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
5364
- /**
5365
- * Copyright 2022 Joe Bell. All rights reserved.
5366
- *
5367
- * This file is licensed to you under the Apache License, Version 2.0
5368
- * (the "License"); you may not use this file except in compliance with the
5369
- * License. You may obtain a copy of the License at
5370
- *
5371
- * http://www.apache.org/licenses/LICENSE-2.0
5372
- *
5373
- * Unless required by applicable law or agreed to in writing, software
5374
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
5375
- * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the
5376
- * License for the specific language governing permissions and limitations under
5377
- * the License.
5378
- */ var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
5379
- var cx = require_src.clsx;
5380
- var cva = (base, config) => (props) => {
5381
- var _config_compoundVariants;
5382
- if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
5383
- const { variants, defaultVariants } = config;
5384
- const getVariantClassNames = Object.keys(variants).map((variant) => {
5385
- const variantProp = props === null || props === void 0 ? void 0 : props[variant];
5386
- const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
5387
- if (variantProp === null) return null;
5388
- const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
5389
- return variants[variant][variantKey];
5390
- });
5391
- const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
5392
- let [key, value] = param;
5393
- if (value === void 0) return acc;
5394
- acc[key] = value;
5395
- return acc;
5396
- }, {});
5397
- return cx(base, getVariantClassNames, config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
5398
- let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
5399
- return Object.entries(compoundVariantOptions).every((param) => {
5400
- let [key, value] = param;
5401
- return Array.isArray(value) ? value.includes({
5402
- ...defaultVariants,
5403
- ...propsWithoutUndefined
5404
- }[key]) : {
5405
- ...defaultVariants,
5406
- ...propsWithoutUndefined
5407
- }[key] === value;
5408
- }) ? [
5409
- ...acc,
5410
- cvClass,
5411
- cvClassName
5412
- ] : acc;
5413
- }, []), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
5414
- };
5415
- //#endregion
5416
- //#region src/tiptap/components/ui-primitive/button-group/button-group.tsx
5417
- var buttonGroupVariants = cva("tiptap-button-group", {
5418
- variants: { orientation: {
5419
- horizontal: "tiptap-button-group-horizontal",
5420
- vertical: "tiptap-button-group-vertical"
5421
- } },
5422
- defaultVariants: { orientation: "horizontal" }
5423
- });
5424
- function ButtonGroup({ className, orientation, ...props }) {
5425
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5426
- role: "group",
5427
- "data-slot": "tiptap-button-group",
5428
- "data-orientation": orientation,
5429
- className: cn(buttonGroupVariants({ orientation }), className),
5430
- ...props
5431
- });
5432
- }
5433
- //#endregion
5434
5367
  //#region src/tiptap/components/ui/link-popover/link-popover.tsx
5435
5368
  /**
5436
5369
  * Link button component for triggering the link popover
@@ -5441,14 +5374,16 @@ var LinkButton = (0, react.forwardRef)(({ className, children, ...props }, ref)
5441
5374
  className,
5442
5375
  role: "button",
5443
5376
  tabIndex: -1,
5444
- "aria-label": "Link",
5445
- tooltip: "Link",
5446
5377
  ref,
5447
5378
  ...props,
5448
5379
  children: children || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkRounded_default, { fontSize: "small" })
5449
5380
  });
5450
5381
  });
5451
5382
  LinkButton.displayName = "LinkButton";
5383
+ var StyledIconButton = (0, require_src.src_exports.styled)(_mui_material_IconButton.default)(({ theme }) => ({
5384
+ borderRadius: theme.shape.borderRadius,
5385
+ "& .MuiTouchRipple-root .MuiTouchRipple-child": { borderRadius: theme.shape.borderRadius }
5386
+ }));
5452
5387
  /**
5453
5388
  * Main content component for the link popover
5454
5389
  */
@@ -5469,7 +5404,7 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, openLink, isActive }) => {
5469
5404
  children: [
5470
5405
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_InputBase.default, {
5471
5406
  type: "url",
5472
- placeholder: "Paste a link...",
5407
+ placeholder: "Coller un lien...",
5473
5408
  value: url,
5474
5409
  onChange: (e) => setUrl(e.target.value),
5475
5410
  onKeyDown: handleKeyDown,
@@ -5483,31 +5418,35 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, openLink, isActive }) => {
5483
5418
  fontSize: "0.875rem"
5484
5419
  }
5485
5420
  }),
5486
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
5421
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
5422
+ size: "small",
5487
5423
  type: "button",
5488
5424
  onClick: setLink,
5489
- title: "Apply link",
5425
+ title: "Appliquer le lien",
5490
5426
  disabled: !url && !isActive,
5491
5427
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(KeyboardReturnRounded_default, { fontSize: "small" })
5492
- }) }),
5428
+ }),
5493
5429
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Divider.default, {
5494
5430
  orientation: "vertical",
5495
5431
  flexItem: true,
5496
5432
  sx: { my: .5 }
5497
5433
  }),
5498
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonGroup, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
5434
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
5435
+ size: "small",
5499
5436
  type: "button",
5500
5437
  onClick: openLink,
5501
- title: "Open in new window",
5438
+ title: "Ouvrir dans une nouvelle fenêtre",
5502
5439
  disabled: !url && !isActive,
5503
5440
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenInNewRounded_default, { fontSize: "small" })
5504
- }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
5441
+ }),
5442
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
5443
+ size: "small",
5505
5444
  type: "button",
5506
5445
  onClick: removeLink,
5507
- title: "Remove link",
5446
+ title: "Supprimer le lien",
5508
5447
  disabled: !url && !isActive,
5509
5448
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DeleteRounded_default, { fontSize: "small" })
5510
- }) })] })
5449
+ })
5511
5450
  ]
5512
5451
  });
5513
5452
  };
@@ -5554,6 +5493,7 @@ var LinkPopover = (0, react.forwardRef)(({ editor: providedEditor, hideWhenUnava
5554
5493
  selected: isActive,
5555
5494
  "data-disabled": !canSet,
5556
5495
  "aria-label": label,
5496
+ tooltip: label,
5557
5497
  onClick: handleClick,
5558
5498
  ...buttonProps,
5559
5499
  ref: setRefs,
@@ -5620,9 +5560,9 @@ var listIcons = {
5620
5560
  ] }), "ListTodo")
5621
5561
  };
5622
5562
  var listLabels = {
5623
- bulletList: "Bullet List",
5624
- orderedList: "Ordered List",
5625
- taskList: "Task List"
5563
+ bulletList: "Liste à puces",
5564
+ orderedList: "Liste numérotée",
5565
+ taskList: "Liste de tâches"
5626
5566
  };
5627
5567
  var LIST_SHORTCUT_KEYS = {
5628
5568
  bulletList: "mod+shift+8",
@@ -5710,7 +5650,7 @@ function toggleList(editor, type) {
5710
5650
  const resolvedTo = state.doc.resolve(to);
5711
5651
  chain = chain.setTextSelection(TextSelection.between(resolvedFrom, resolvedTo)).clearNodes();
5712
5652
  }
5713
- if (editor.isActive(type)) chain.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run();
5653
+ if (editor.isActive(type)) chain.liftListItem("listItem").lift("bulletList").lift("orderedList").run();
5714
5654
  else {
5715
5655
  const toggle = {
5716
5656
  bulletList: () => chain.toggleBulletList(),
@@ -5947,7 +5887,15 @@ function shouldShowButton$2(props) {
5947
5887
  * Gets the formatted mark name
5948
5888
  */
5949
5889
  function getFormattedMarkName(type) {
5950
- return type.charAt(0).toUpperCase() + type.slice(1);
5890
+ switch (type) {
5891
+ case "bold": return "Gras";
5892
+ case "italic": return "Italique";
5893
+ case "strike": return "Barré";
5894
+ case "code": return "Code";
5895
+ case "underline": return "Souligné";
5896
+ case "superscript": return "Exposant";
5897
+ case "subscript": return "Indice";
5898
+ }
5951
5899
  }
5952
5900
  /**
5953
5901
  * Custom hook that provides mark functionality for Tiptap editor
@@ -6108,10 +6056,10 @@ var textAlignIcons = {
6108
6056
  justify: FormatAlignJustifyRounded_default
6109
6057
  };
6110
6058
  var textAlignLabels = {
6111
- left: "Align left",
6112
- center: "Align center",
6113
- right: "Align right",
6114
- justify: "Align justify"
6059
+ left: "Aligner à gauche",
6060
+ center: "Aligner au centre",
6061
+ right: "Aligner à droite",
6062
+ justify: "Justifier"
6115
6063
  };
6116
6064
  /**
6117
6065
  * Checks if text alignment can be performed in the current editor state
@@ -6307,8 +6255,8 @@ var UNDO_REDO_SHORTCUT_KEYS = {
6307
6255
  redo: "mod+shift+z"
6308
6256
  };
6309
6257
  var historyActionLabels = {
6310
- undo: "Undo",
6311
- redo: "Redo"
6258
+ undo: "Annuler",
6259
+ redo: "Rétablir"
6312
6260
  };
6313
6261
  var historyIcons = {
6314
6262
  undo: UndoRounded_default,
@@ -6481,22 +6429,6 @@ var UndoRedoButton = (0, react.forwardRef)(({ editor: providedEditor, action, te
6481
6429
  });
6482
6430
  UndoRedoButton.displayName = "UndoRedoButton";
6483
6431
  //#endregion
6484
- //#region src/tiptap/components/ui-primitive/spacer/spacer.tsx
6485
- function Spacer({ orientation = "horizontal", size, style = {}, ...props }) {
6486
- const computedStyle = {
6487
- ...style,
6488
- ...orientation === "horizontal" && !size && { flex: 1 },
6489
- ...size && {
6490
- width: orientation === "vertical" ? "1px" : size,
6491
- height: orientation === "horizontal" ? "1px" : size
6492
- }
6493
- };
6494
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6495
- ...props,
6496
- style: computedStyle
6497
- });
6498
- }
6499
- //#endregion
6500
6432
  //#region src/tiptap/hooks/use-composed-ref.ts
6501
6433
  var updateRef = (ref, value) => {
6502
6434
  if (typeof ref === "function") ref(value);
@@ -6744,11 +6676,10 @@ ToolbarSeparator.displayName = "ToolbarSeparator";
6744
6676
  var FormattingControls = ({ editor }) => {
6745
6677
  const hasSuperscriptSubscript = editor.extensionManager.extensions.map((e) => e.name).some((name) => name === "subscript" || name === "superscript");
6746
6678
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
6747
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spacer, {}),
6748
6679
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UndoRedoButton, { action: "undo" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UndoRedoButton, { action: "redo" })] }),
6749
6680
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarSeparator, {}),
6750
6681
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [
6751
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingDropdownMenu, {
6682
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingMenu, {
6752
6683
  modal: false,
6753
6684
  levels: [
6754
6685
  1,
@@ -6771,20 +6702,36 @@ var FormattingControls = ({ editor }) => {
6771
6702
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkButton, { type: "underline" }),
6772
6703
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkPopover, {})
6773
6704
  ] }),
6705
+ hasSuperscriptSubscript ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkButton, { type: "superscript" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkButton, { type: "subscript" })] })] }) : null,
6774
6706
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarSeparator, {}),
6775
- hasSuperscriptSubscript ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkButton, { type: "superscript" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkButton, { type: "subscript" })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarSeparator, {})] }) : null,
6776
6707
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [
6777
6708
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "left" }),
6778
6709
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "center" }),
6779
6710
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "right" }),
6780
6711
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "justify" })
6781
- ] }),
6782
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spacer, {})
6712
+ ] })
6783
6713
  ] });
6784
6714
  };
6785
6715
  FormattingControls.displayName = "FormattingControls";
6786
6716
  //#endregion
6717
+ //#region src/tiptap/components/ui-primitive/spacer/spacer.tsx
6718
+ function Spacer({ orientation = "horizontal", size, style = {}, ...props }) {
6719
+ const computedStyle = {
6720
+ ...style,
6721
+ ...orientation === "horizontal" && !size && { flex: 1 },
6722
+ ...size && {
6723
+ width: orientation === "vertical" ? "1px" : size,
6724
+ height: orientation === "horizontal" ? "1px" : size
6725
+ }
6726
+ };
6727
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6728
+ ...props,
6729
+ style: computedStyle
6730
+ });
6731
+ }
6732
+ //#endregion
6787
6733
  exports.FormattingControls = FormattingControls;
6734
+ exports.Spacer = Spacer;
6788
6735
  exports.Toolbar = Toolbar;
6789
6736
  exports.ToolbarGroup = ToolbarGroup;
6790
6737
  exports.ToolbarSeparator = ToolbarSeparator;
@@ -1,4 +1,5 @@
1
1
  export * from './components/ui-primitive/formatting-controls';
2
+ export * from './components/ui-primitive/spacer';
2
3
  export * from './components/ui-primitive/toolbar';
3
4
  //# sourceMappingURL=index.d.ts.map
4
5