@cgi-learning-hub/ui 1.14.0-dev.1785319387 → 1.14.0-dev.1785404668
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.d.ts +7 -0
- package/dist/index.es.js +1 -1
- package/dist/{src-G-BmjM2S.js → src-B3iFugc4.js} +140 -2
- package/dist/tiptap/index.cjs.js +85 -129
- package/dist/tiptap/index.d.ts +1 -0
- package/dist/tiptap/index.es.js +84 -131
- package/dist/ui.css +2 -122
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ declare interface FormattingControlsProps extends BaseProps {
|
|
|
16
16
|
editor: Editor;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export declare function Spacer({ orientation, size, style, ...props }: React.ComponentProps<"div"> & {
|
|
20
|
+
orientation?: SpacerOrientation;
|
|
21
|
+
size?: string | number;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
|
|
24
|
+
export declare type SpacerOrientation = "horizontal" | "vertical";
|
|
25
|
+
|
|
19
26
|
export declare const Toolbar: ForwardRefExoticComponent<ToolbarProps & RefAttributes<HTMLDivElement>>;
|
|
20
27
|
|
|
21
28
|
export declare const ToolbarGroup: ForwardRefExoticComponent<BaseProps_2 & RefAttributes<HTMLDivElement>>;
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ListItemText, $t as Heading, A as DialogContentText, At as TableRow, B as GlobalStyles, Bt as useMediaQuery, C as Chip, Ct as Table, D as Container, Dt as TableFooter, E as Collapse, Et as TableContainer, F as FormControl, Ft as ToggleButtonGroup, G as InputBase, Gt as SearchInput, H as Grow, Ht as TreeView, I as FormControlLabel, It as Toolbar, J as Link, Jt as PasswordInput, K as InputLabel, Kt as ResourceCard, L as FormGroup, Lt as Tooltip, M as Divider, Mt as Tabs, N as Drawer, Nt as TextField, O as DialogActions, Ot as TableHead, P as Fade, Pt as ToggleButton, Q as ListItemIcon, R as FormHelperText, Rt as Typography, S as Checkbox, St as Tab, T as ClickAwayListener, Tt as TableCell, U as IconButton, Ut as ICON_TYPE, V as Grid, Vt as ZoomControl, W as Input, Wt as TimePicker, X as ListItem, Xt as Loader, Y as List, Yt as LoaderBackdrop, Z as ListItemButton, Zt as ImagePicker, _ as CardActionArea, _n as TabList, _t as StepButton, a as AccordionSummary, an as Dropzone, at as Pagination, b as CardHeader, bn as getTabId, bt as SvgIcon, c as Autocomplete, cn as ColorPicker, ct as Radio, d as Badge, dn as Alert, dt as Skeleton, en as FolderCard, et as ListSubheader, f as Box, fn as ActionBar, ft as Slide, g as Card, gt as Step, h as ButtonGroup, hn as tabPanelClasses, ht as Stack, i as AccordionDetails, in as EllipsisWithTooltip, it as Modal, j as DialogTitle, jt as TableSortLabel, k as DialogContent, kt as TablePagination, l as Avatar, ln as DEFAULT_COLOR_OPTIONS, lt as RadioGroup, m as Button, mn as getTabPanelUtilityClass, mt as Snackbar, n as Accordion, nn as FileListItem, nt as MenuItem, o as AlertTitle, on as Dialog, ot as Paper, p as Breadcrumbs, pn as TabPanel, pt as Slider, q as LinearProgress, qt as QueryError, r as AccordionActions, rn as EmptyState, rt as MobileStepper, s as AppBar, sn as DatePicker, st as Popover, tn as FileList, tt as Menu, u as Backdrop, ut as Select, v as CardActions, vn as TabContext, vt as StepLabel, w as CircularProgress, wt as TableBody, x as CardMedia, xn as useTabContext, xt as Switch, y as CardContent, yn as getPanelId, yt as Stepper, z as FormLabel, zt as Zoom } from "./src-B3iFugc4.js";
|
|
2
2
|
export * from "@mui/material/Tabs";
|
|
3
3
|
export * from "@mui/material/styles";
|
|
4
4
|
export * from "@mui/material/Accordion";
|
|
@@ -114,6 +114,15 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
114
114
|
var __getProtoOf = Object.getPrototypeOf;
|
|
115
115
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
116
116
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
117
|
+
var __exportAll = (all, no_symbols) => {
|
|
118
|
+
let target = {};
|
|
119
|
+
for (var name in all) __defProp(target, name, {
|
|
120
|
+
get: all[name],
|
|
121
|
+
enumerable: true
|
|
122
|
+
});
|
|
123
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
124
|
+
return target;
|
|
125
|
+
};
|
|
117
126
|
var __copyProps = (to, from, except, desc) => {
|
|
118
127
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
119
128
|
key = keys[i];
|
|
@@ -30524,6 +30533,135 @@ var ZoomControl = ({ step = 10, value = 50, onChange, max = 100, min = 0, label
|
|
|
30524
30533
|
});
|
|
30525
30534
|
};
|
|
30526
30535
|
//#endregion
|
|
30527
|
-
|
|
30536
|
+
//#region src/index.ts
|
|
30537
|
+
var src_exports = /* @__PURE__ */ __exportAll({
|
|
30538
|
+
Accordion: () => Accordion,
|
|
30539
|
+
AccordionActions: () => AccordionActions,
|
|
30540
|
+
AccordionDetails: () => AccordionDetails,
|
|
30541
|
+
AccordionSummary: () => AccordionSummary,
|
|
30542
|
+
ActionBar: () => ActionBar,
|
|
30543
|
+
Alert: () => Alert,
|
|
30544
|
+
AlertTitle: () => AlertTitle$1,
|
|
30545
|
+
AppBar: () => AppBar,
|
|
30546
|
+
Autocomplete: () => Autocomplete,
|
|
30547
|
+
Avatar: () => Avatar,
|
|
30548
|
+
Backdrop: () => Backdrop$1,
|
|
30549
|
+
Badge: () => Badge,
|
|
30550
|
+
Box: () => Box$1,
|
|
30551
|
+
Breadcrumbs: () => Breadcrumbs,
|
|
30552
|
+
Button: () => Button$1,
|
|
30553
|
+
ButtonGroup: () => ButtonGroup,
|
|
30554
|
+
Card: () => Card$1,
|
|
30555
|
+
CardActionArea: () => CardActionArea,
|
|
30556
|
+
CardActions: () => CardActions,
|
|
30557
|
+
CardContent: () => CardContent$1,
|
|
30558
|
+
CardHeader: () => CardHeader,
|
|
30559
|
+
CardMedia: () => CardMedia$1,
|
|
30560
|
+
Checkbox: () => Checkbox,
|
|
30561
|
+
Chip: () => Chip$1,
|
|
30562
|
+
CircularProgress: () => CircularProgress$1,
|
|
30563
|
+
ClickAwayListener: () => ClickAwayListener$1,
|
|
30564
|
+
Collapse: () => Collapse$1,
|
|
30565
|
+
ColorPicker: () => ColorPicker,
|
|
30566
|
+
Container: () => Container,
|
|
30567
|
+
DEFAULT_COLOR_OPTIONS: () => DEFAULT_COLOR_OPTIONS,
|
|
30568
|
+
DatePicker: () => DatePicker,
|
|
30569
|
+
Dialog: () => Dialog,
|
|
30570
|
+
DialogActions: () => DialogActions$1,
|
|
30571
|
+
DialogContent: () => DialogContent$1,
|
|
30572
|
+
DialogContentText: () => DialogContentText,
|
|
30573
|
+
DialogTitle: () => DialogTitle,
|
|
30574
|
+
Divider: () => Divider$1,
|
|
30575
|
+
Drawer: () => Drawer,
|
|
30576
|
+
Dropzone: () => Dropzone,
|
|
30577
|
+
EllipsisWithTooltip: () => EllipsisWithTooltip,
|
|
30578
|
+
EmptyState: () => EmptyState,
|
|
30579
|
+
Fade: () => Fade$1,
|
|
30580
|
+
FileList: () => FileList,
|
|
30581
|
+
FileListItem: () => FileListItem,
|
|
30582
|
+
FolderCard: () => FolderCard,
|
|
30583
|
+
FormControl: () => FormControl$1,
|
|
30584
|
+
FormControlLabel: () => FormControlLabel,
|
|
30585
|
+
FormGroup: () => FormGroup,
|
|
30586
|
+
FormHelperText: () => FormHelperText$1,
|
|
30587
|
+
FormLabel: () => FormLabel,
|
|
30588
|
+
GlobalStyles: () => GlobalStyles,
|
|
30589
|
+
Grid: () => Grid,
|
|
30590
|
+
Grow: () => Grow$1,
|
|
30591
|
+
Heading: () => Heading,
|
|
30592
|
+
ICON_TYPE: () => ICON_TYPE,
|
|
30593
|
+
IconButton: () => IconButton$1,
|
|
30594
|
+
ImagePicker: () => ImagePicker,
|
|
30595
|
+
Input: () => Input,
|
|
30596
|
+
InputBase: () => InputBase$1,
|
|
30597
|
+
InputLabel: () => InputLabel$1,
|
|
30598
|
+
LinearProgress: () => LinearProgress,
|
|
30599
|
+
Link: () => Link,
|
|
30600
|
+
List: () => List$1,
|
|
30601
|
+
ListItem: () => ListItem$1,
|
|
30602
|
+
ListItemButton: () => ListItemButton$1,
|
|
30603
|
+
ListItemIcon: () => ListItemIcon$1,
|
|
30604
|
+
ListItemText: () => ListItemText$1,
|
|
30605
|
+
ListSubheader: () => ListSubheader,
|
|
30606
|
+
Loader: () => Loader,
|
|
30607
|
+
LoaderBackdrop: () => LoaderBackdrop,
|
|
30608
|
+
Menu: () => Menu,
|
|
30609
|
+
MenuItem: () => MenuItem$1,
|
|
30610
|
+
MobileStepper: () => MobileStepper,
|
|
30611
|
+
Modal: () => Modal,
|
|
30612
|
+
Pagination: () => Pagination,
|
|
30613
|
+
Paper: () => Paper,
|
|
30614
|
+
PasswordInput: () => PasswordInput,
|
|
30615
|
+
Popover: () => Popover,
|
|
30616
|
+
QueryError: () => QueryError,
|
|
30617
|
+
Radio: () => Radio,
|
|
30618
|
+
RadioGroup: () => RadioGroup,
|
|
30619
|
+
ResourceCard: () => ResourceCard,
|
|
30620
|
+
SearchInput: () => SearchInput,
|
|
30621
|
+
Select: () => Select,
|
|
30622
|
+
Skeleton: () => Skeleton,
|
|
30623
|
+
Slide: () => Slide,
|
|
30624
|
+
Slider: () => Slider,
|
|
30625
|
+
Snackbar: () => Snackbar,
|
|
30626
|
+
Stack: () => Stack$1,
|
|
30627
|
+
Step: () => Step,
|
|
30628
|
+
StepButton: () => StepButton,
|
|
30629
|
+
StepLabel: () => StepLabel,
|
|
30630
|
+
Stepper: () => Stepper,
|
|
30631
|
+
SvgIcon: () => SvgIcon,
|
|
30632
|
+
Switch: () => Switch,
|
|
30633
|
+
Tab: () => Tab,
|
|
30634
|
+
TabContext: () => TabContext,
|
|
30635
|
+
TabList: () => TabList,
|
|
30636
|
+
TabPanel: () => TabPanel,
|
|
30637
|
+
Table: () => Table,
|
|
30638
|
+
TableBody: () => TableBody,
|
|
30639
|
+
TableCell: () => TableCell,
|
|
30640
|
+
TableContainer: () => TableContainer,
|
|
30641
|
+
TableFooter: () => TableFooter,
|
|
30642
|
+
TableHead: () => TableHead,
|
|
30643
|
+
TablePagination: () => TablePagination,
|
|
30644
|
+
TableRow: () => TableRow,
|
|
30645
|
+
TableSortLabel: () => TableSortLabel,
|
|
30646
|
+
Tabs: () => Tabs$1,
|
|
30647
|
+
TextField: () => TextField$1,
|
|
30648
|
+
TimePicker: () => TimePicker,
|
|
30649
|
+
ToggleButton: () => ToggleButton,
|
|
30650
|
+
ToggleButtonGroup: () => ToggleButtonGroup,
|
|
30651
|
+
Toolbar: () => Toolbar,
|
|
30652
|
+
Tooltip: () => Tooltip$1,
|
|
30653
|
+
TreeView: () => TreeView,
|
|
30654
|
+
Typography: () => Typography$1,
|
|
30655
|
+
Zoom: () => Zoom,
|
|
30656
|
+
ZoomControl: () => ZoomControl,
|
|
30657
|
+
getPanelId: () => getPanelId,
|
|
30658
|
+
getTabId: () => getTabId,
|
|
30659
|
+
getTabPanelUtilityClass: () => getTabPanelUtilityClass,
|
|
30660
|
+
tabPanelClasses: () => tabPanelClasses,
|
|
30661
|
+
useMediaQuery: () => useMediaQuery$1,
|
|
30662
|
+
useTabContext: () => useTabContext
|
|
30663
|
+
});
|
|
30664
|
+
//#endregion
|
|
30665
|
+
export { ListItemText$1 as $, Heading as $t, DialogContentText as A, TableRow as At, GlobalStyles as B, useMediaQuery$1 as Bt, Chip$1 as C, Table as Ct, Container as D, TableFooter as Dt, Collapse$1 as E, TableContainer as Et, FormControl$1 as F, ToggleButtonGroup as Ft, InputBase$1 as G, SearchInput as Gt, Grow$1 as H, TreeView as Ht, FormControlLabel as I, Toolbar as It, Link as J, PasswordInput as Jt, InputLabel$1 as K, ResourceCard as Kt, FormGroup as L, Tooltip$1 as Lt, Divider$1 as M, Tabs$1 as Mt, Drawer as N, TextField$1 as Nt, DialogActions$1 as O, TableHead as Ot, Fade$1 as P, ToggleButton as Pt, ListItemIcon$1 as Q, DeleteRounded_default as Qt, FormHelperText$1 as R, Typography$1 as Rt, Checkbox as S, Tab as St, ClickAwayListener$1 as T, TableCell as Tt, IconButton$1 as U, ICON_TYPE as Ut, Grid as V, ZoomControl as Vt, Input as W, TimePicker as Wt, ListItem$1 as X, Loader as Xt, List$1 as Y, LoaderBackdrop as Yt, ListItemButton$1 as Z, ImagePicker as Zt, CardActionArea as _, TabList as _n, StepButton as _t, AccordionSummary as a, Dropzone as an, Pagination as at, CardHeader as b, getTabId as bn, SvgIcon as bt, Autocomplete as c, ColorPicker as cn, Radio as ct, Badge as d, Alert as dn, Skeleton as dt, FolderCard as en, ListSubheader as et, Box$1 as f, ActionBar as fn, Slide as ft, Card$1 as g, clsx as gn, Step as gt, ButtonGroup as h, tabPanelClasses as hn, Stack$1 as ht, AccordionDetails as i, EllipsisWithTooltip as in, Modal as it, DialogTitle as j, TableSortLabel as jt, DialogContent$1 as k, TablePagination as kt, Avatar as l, DEFAULT_COLOR_OPTIONS as ln, RadioGroup as lt, Button$1 as m, getTabPanelUtilityClass as mn, Snackbar as mt, Accordion as n, FileListItem as nn, MenuItem$1 as nt, AlertTitle$1 as o, Dialog as on, Paper as ot, Breadcrumbs as p, TabPanel as pn, Slider as pt, LinearProgress as q, QueryError as qt, AccordionActions as r, EmptyState as rn, MobileStepper as rt, AppBar as s, DatePicker as sn, Popover as st, src_exports as t, FileList as tn, Menu as tt, Backdrop$1 as u, SvgIcon_default as un, Select as ut, CardActions as v, TabContext as vn, StepLabel as vt, CircularProgress$1 as w, TableBody as wt, CardMedia$1 as x, useTabContext as xn, Switch as xt, CardContent$1 as y, getPanelId as yn, Stepper as yt, FormLabel as z, Zoom as zt };
|
|
30528
30666
|
|
|
30529
|
-
//# sourceMappingURL=src-
|
|
30667
|
+
//# sourceMappingURL=src-B3iFugc4.js.map
|
package/dist/tiptap/index.cjs.js
CHANGED
|
@@ -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");
|
|
@@ -4356,7 +4358,7 @@ function useBlockquote(config) {
|
|
|
4356
4358
|
return success;
|
|
4357
4359
|
}, [editor, onToggled]),
|
|
4358
4360
|
canToggle,
|
|
4359
|
-
label: "
|
|
4361
|
+
label: "Citation en bloc",
|
|
4360
4362
|
shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
|
|
4361
4363
|
Icon: TextSnippetIcon
|
|
4362
4364
|
};
|
|
@@ -4371,6 +4373,7 @@ var Button = (0, react.forwardRef)(({ className, children, tooltip, showTooltip
|
|
|
4371
4373
|
const shortcuts = (0, react.useMemo)(() => parseShortcutKeys({ shortcutKeys }), [shortcutKeys]);
|
|
4372
4374
|
if (!tooltip || !showTooltip) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_ToggleButton.default, {
|
|
4373
4375
|
size: "small",
|
|
4376
|
+
color: "primary",
|
|
4374
4377
|
ref,
|
|
4375
4378
|
sx: {
|
|
4376
4379
|
border: "none",
|
|
@@ -4388,6 +4391,7 @@ var Button = (0, react.forwardRef)(({ className, children, tooltip, showTooltip
|
|
|
4388
4391
|
}] } },
|
|
4389
4392
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_ToggleButton.default, {
|
|
4390
4393
|
size: "small",
|
|
4394
|
+
color: "primary",
|
|
4391
4395
|
ref,
|
|
4392
4396
|
sx: {
|
|
4393
4397
|
border: "none",
|
|
@@ -4431,7 +4435,7 @@ var BlockquoteButton = (0, react.forwardRef)(({ editor: providedEditor, text, hi
|
|
|
4431
4435
|
disabled: !canToggle,
|
|
4432
4436
|
"data-disabled": !canToggle,
|
|
4433
4437
|
"aria-label": label,
|
|
4434
|
-
tooltip:
|
|
4438
|
+
tooltip: label,
|
|
4435
4439
|
onClick: handleClick,
|
|
4436
4440
|
...buttonProps,
|
|
4437
4441
|
ref,
|
|
@@ -4630,7 +4634,7 @@ function useCodeBlock(config) {
|
|
|
4630
4634
|
return success;
|
|
4631
4635
|
}, [editor, onToggled]),
|
|
4632
4636
|
canToggle: canToggleState,
|
|
4633
|
-
label: "
|
|
4637
|
+
label: "Bloc de code",
|
|
4634
4638
|
shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
4635
4639
|
Icon: IntegrationInstructionIcon
|
|
4636
4640
|
};
|
|
@@ -4667,7 +4671,7 @@ var CodeBlockButton = (0, react.forwardRef)(({ editor: providedEditor, text, hid
|
|
|
4667
4671
|
"data-disabled": !canToggle,
|
|
4668
4672
|
tabIndex: -1,
|
|
4669
4673
|
"aria-label": label,
|
|
4670
|
-
tooltip:
|
|
4674
|
+
tooltip: label,
|
|
4671
4675
|
onClick: handleClick,
|
|
4672
4676
|
...buttonProps,
|
|
4673
4677
|
ref,
|
|
@@ -4943,7 +4947,7 @@ function useHeading(config) {
|
|
|
4943
4947
|
onToggled
|
|
4944
4948
|
]),
|
|
4945
4949
|
canToggle: canToggleState,
|
|
4946
|
-
label: `
|
|
4950
|
+
label: `Titre ${level}`,
|
|
4947
4951
|
shortcutKeys: HEADING_SHORTCUT_KEYS[level],
|
|
4948
4952
|
Icon: headingIcons[level]
|
|
4949
4953
|
};
|
|
@@ -4987,9 +4991,11 @@ var HeadingMenuItem = (0, react.forwardRef)(({ editor: providedEditor, level, te
|
|
|
4987
4991
|
ref,
|
|
4988
4992
|
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
4989
4993
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { fontSize: "small" }),
|
|
4990
|
-
text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4991
|
-
|
|
4992
|
-
|
|
4994
|
+
text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Typography.default, {
|
|
4995
|
+
component: "span",
|
|
4996
|
+
variant: "body2",
|
|
4997
|
+
sx: { ml: 1 },
|
|
4998
|
+
children: label
|
|
4993
4999
|
}),
|
|
4994
5000
|
showShortcut && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeadingShortcutBadge, {
|
|
4995
5001
|
level,
|
|
@@ -5099,7 +5105,7 @@ function useHeadingMenu(config) {
|
|
|
5099
5105
|
isActive,
|
|
5100
5106
|
canToggle: canToggleState,
|
|
5101
5107
|
levels,
|
|
5102
|
-
label: "
|
|
5108
|
+
label: "Titre",
|
|
5103
5109
|
Icon: activeLevel ? headingIcons[activeLevel] : HeadingIcon
|
|
5104
5110
|
};
|
|
5105
5111
|
}
|
|
@@ -5121,7 +5127,7 @@ var HeadingMenu = (0, react.forwardRef)(({ editor: providedEditor, levels = [
|
|
|
5121
5127
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5122
5128
|
const [anchorEl, setAnchorEl] = (0, react.useState)(null);
|
|
5123
5129
|
const open = Boolean(anchorEl);
|
|
5124
|
-
const { isVisible, isActive, canToggle, Icon } = useHeadingMenu({
|
|
5130
|
+
const { isVisible, isActive, canToggle, Icon, label } = useHeadingMenu({
|
|
5125
5131
|
editor,
|
|
5126
5132
|
levels,
|
|
5127
5133
|
hideWhenUnavailable
|
|
@@ -5143,7 +5149,7 @@ var HeadingMenu = (0, react.forwardRef)(({ editor: providedEditor, levels = [
|
|
|
5143
5149
|
id: "heading-button",
|
|
5144
5150
|
value: "heading",
|
|
5145
5151
|
type: "button",
|
|
5146
|
-
selected: isActive,
|
|
5152
|
+
selected: isActive || open,
|
|
5147
5153
|
role: "button",
|
|
5148
5154
|
tabIndex: -1,
|
|
5149
5155
|
disabled: !canToggle,
|
|
@@ -5152,7 +5158,7 @@ var HeadingMenu = (0, react.forwardRef)(({ editor: providedEditor, levels = [
|
|
|
5152
5158
|
"aria-controls": "heading-menu",
|
|
5153
5159
|
"aria-label": "Format text as heading",
|
|
5154
5160
|
"aria-expanded": open,
|
|
5155
|
-
tooltip:
|
|
5161
|
+
tooltip: label,
|
|
5156
5162
|
onClick: handleClick,
|
|
5157
5163
|
...buttonProps,
|
|
5158
5164
|
ref,
|
|
@@ -5351,7 +5357,7 @@ function useLinkPopover(config) {
|
|
|
5351
5357
|
isVisible,
|
|
5352
5358
|
canSet,
|
|
5353
5359
|
isActive,
|
|
5354
|
-
label: "
|
|
5360
|
+
label: "Lien",
|
|
5355
5361
|
Icon: LinkRounded_default,
|
|
5356
5362
|
...useLinkHandler({
|
|
5357
5363
|
editor,
|
|
@@ -5360,77 +5366,6 @@ function useLinkPopover(config) {
|
|
|
5360
5366
|
};
|
|
5361
5367
|
}
|
|
5362
5368
|
//#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
5369
|
//#region src/tiptap/components/ui/link-popover/link-popover.tsx
|
|
5435
5370
|
/**
|
|
5436
5371
|
* Link button component for triggering the link popover
|
|
@@ -5441,14 +5376,16 @@ var LinkButton = (0, react.forwardRef)(({ className, children, ...props }, ref)
|
|
|
5441
5376
|
className,
|
|
5442
5377
|
role: "button",
|
|
5443
5378
|
tabIndex: -1,
|
|
5444
|
-
"aria-label": "Link",
|
|
5445
|
-
tooltip: "Link",
|
|
5446
5379
|
ref,
|
|
5447
5380
|
...props,
|
|
5448
5381
|
children: children || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkRounded_default, { fontSize: "small" })
|
|
5449
5382
|
});
|
|
5450
5383
|
});
|
|
5451
5384
|
LinkButton.displayName = "LinkButton";
|
|
5385
|
+
var StyledIconButton = (0, require_src.src_exports.styled)(_mui_material_IconButton.default)(({ theme }) => ({
|
|
5386
|
+
borderRadius: theme.shape.borderRadius,
|
|
5387
|
+
"& .MuiTouchRipple-root .MuiTouchRipple-child": { borderRadius: theme.shape.borderRadius }
|
|
5388
|
+
}));
|
|
5452
5389
|
/**
|
|
5453
5390
|
* Main content component for the link popover
|
|
5454
5391
|
*/
|
|
@@ -5469,7 +5406,7 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, openLink, isActive }) => {
|
|
|
5469
5406
|
children: [
|
|
5470
5407
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_InputBase.default, {
|
|
5471
5408
|
type: "url",
|
|
5472
|
-
placeholder: "
|
|
5409
|
+
placeholder: "Coller un lien...",
|
|
5473
5410
|
value: url,
|
|
5474
5411
|
onChange: (e) => setUrl(e.target.value),
|
|
5475
5412
|
onKeyDown: handleKeyDown,
|
|
@@ -5477,37 +5414,41 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, openLink, isActive }) => {
|
|
|
5477
5414
|
autoComplete: "off",
|
|
5478
5415
|
autoCorrect: "off",
|
|
5479
5416
|
autoCapitalize: "off",
|
|
5480
|
-
className: "tiptap-link-input",
|
|
5481
5417
|
sx: {
|
|
5482
5418
|
padding: ".25rem .625rem",
|
|
5483
|
-
fontSize: "0.875rem"
|
|
5419
|
+
fontSize: "0.875rem",
|
|
5420
|
+
minWidth: "12rem"
|
|
5484
5421
|
}
|
|
5485
5422
|
}),
|
|
5486
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5423
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
|
|
5424
|
+
size: "small",
|
|
5487
5425
|
type: "button",
|
|
5488
5426
|
onClick: setLink,
|
|
5489
|
-
title: "
|
|
5427
|
+
title: "Appliquer le lien",
|
|
5490
5428
|
disabled: !url && !isActive,
|
|
5491
5429
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(KeyboardReturnRounded_default, { fontSize: "small" })
|
|
5492
|
-
})
|
|
5430
|
+
}),
|
|
5493
5431
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Divider.default, {
|
|
5494
5432
|
orientation: "vertical",
|
|
5495
5433
|
flexItem: true,
|
|
5496
5434
|
sx: { my: .5 }
|
|
5497
5435
|
}),
|
|
5498
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
5436
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
|
|
5437
|
+
size: "small",
|
|
5499
5438
|
type: "button",
|
|
5500
5439
|
onClick: openLink,
|
|
5501
|
-
title: "
|
|
5440
|
+
title: "Ouvrir dans une nouvelle fenêtre",
|
|
5502
5441
|
disabled: !url && !isActive,
|
|
5503
5442
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenInNewRounded_default, { fontSize: "small" })
|
|
5504
|
-
})
|
|
5443
|
+
}),
|
|
5444
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
|
|
5445
|
+
size: "small",
|
|
5505
5446
|
type: "button",
|
|
5506
5447
|
onClick: removeLink,
|
|
5507
|
-
title: "
|
|
5448
|
+
title: "Supprimer le lien",
|
|
5508
5449
|
disabled: !url && !isActive,
|
|
5509
5450
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DeleteRounded_default, { fontSize: "small" })
|
|
5510
|
-
})
|
|
5451
|
+
})
|
|
5511
5452
|
]
|
|
5512
5453
|
});
|
|
5513
5454
|
};
|
|
@@ -5520,6 +5461,7 @@ var LinkPopover = (0, react.forwardRef)(({ editor: providedEditor, hideWhenUnava
|
|
|
5520
5461
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5521
5462
|
const [anchorEl, setAnchorEl] = (0, react.useState)(null);
|
|
5522
5463
|
const internalRef = (0, react.useRef)(null);
|
|
5464
|
+
const justSubmittedRef = (0, react.useRef)(false);
|
|
5523
5465
|
const { isVisible, canSet, isActive, url, setUrl, setLink, removeLink, openLink, label, Icon } = useLinkPopover({
|
|
5524
5466
|
editor,
|
|
5525
5467
|
hideWhenUnavailable,
|
|
@@ -5535,8 +5477,12 @@ var LinkPopover = (0, react.forwardRef)(({ editor: providedEditor, hideWhenUnava
|
|
|
5535
5477
|
onOpenChange?.(false);
|
|
5536
5478
|
}, [onOpenChange]);
|
|
5537
5479
|
const handleSetLink = (0, react.useCallback)(() => {
|
|
5480
|
+
justSubmittedRef.current = true;
|
|
5538
5481
|
setLink();
|
|
5539
5482
|
setAnchorEl(null);
|
|
5483
|
+
queueMicrotask(() => {
|
|
5484
|
+
justSubmittedRef.current = false;
|
|
5485
|
+
});
|
|
5540
5486
|
}, [setLink]);
|
|
5541
5487
|
const handleClick = (0, react.useCallback)((event) => {
|
|
5542
5488
|
onClick?.(event, !isActive);
|
|
@@ -5544,16 +5490,17 @@ var LinkPopover = (0, react.forwardRef)(({ editor: providedEditor, hideWhenUnava
|
|
|
5544
5490
|
setAnchorEl(event.currentTarget);
|
|
5545
5491
|
}, [onClick, anchorEl]);
|
|
5546
5492
|
(0, react.useEffect)(() => {
|
|
5547
|
-
if (autoOpenOnLinkActive && isActive) setAnchorEl(internalRef.current);
|
|
5493
|
+
if (autoOpenOnLinkActive && isActive && !justSubmittedRef.current) setAnchorEl(internalRef.current);
|
|
5548
5494
|
}, [autoOpenOnLinkActive, isActive]);
|
|
5549
5495
|
if (!isVisible) return null;
|
|
5550
5496
|
const open = Boolean(anchorEl);
|
|
5551
5497
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkButton, {
|
|
5552
5498
|
value: "link",
|
|
5553
5499
|
disabled: !canSet,
|
|
5554
|
-
selected: isActive,
|
|
5500
|
+
selected: isActive || open,
|
|
5555
5501
|
"data-disabled": !canSet,
|
|
5556
5502
|
"aria-label": label,
|
|
5503
|
+
tooltip: label,
|
|
5557
5504
|
onClick: handleClick,
|
|
5558
5505
|
...buttonProps,
|
|
5559
5506
|
ref: setRefs,
|
|
@@ -5620,9 +5567,9 @@ var listIcons = {
|
|
|
5620
5567
|
] }), "ListTodo")
|
|
5621
5568
|
};
|
|
5622
5569
|
var listLabels = {
|
|
5623
|
-
bulletList: "
|
|
5624
|
-
orderedList: "
|
|
5625
|
-
taskList: "
|
|
5570
|
+
bulletList: "Liste à puces",
|
|
5571
|
+
orderedList: "Liste numérotée",
|
|
5572
|
+
taskList: "Liste de tâches"
|
|
5626
5573
|
};
|
|
5627
5574
|
var LIST_SHORTCUT_KEYS = {
|
|
5628
5575
|
bulletList: "mod+shift+8",
|
|
@@ -5947,7 +5894,15 @@ function shouldShowButton$2(props) {
|
|
|
5947
5894
|
* Gets the formatted mark name
|
|
5948
5895
|
*/
|
|
5949
5896
|
function getFormattedMarkName(type) {
|
|
5950
|
-
|
|
5897
|
+
switch (type) {
|
|
5898
|
+
case "bold": return "Gras";
|
|
5899
|
+
case "italic": return "Italique";
|
|
5900
|
+
case "strike": return "Barré";
|
|
5901
|
+
case "code": return "Code";
|
|
5902
|
+
case "underline": return "Souligné";
|
|
5903
|
+
case "superscript": return "Exposant";
|
|
5904
|
+
case "subscript": return "Indice";
|
|
5905
|
+
}
|
|
5951
5906
|
}
|
|
5952
5907
|
/**
|
|
5953
5908
|
* Custom hook that provides mark functionality for Tiptap editor
|
|
@@ -6108,10 +6063,10 @@ var textAlignIcons = {
|
|
|
6108
6063
|
justify: FormatAlignJustifyRounded_default
|
|
6109
6064
|
};
|
|
6110
6065
|
var textAlignLabels = {
|
|
6111
|
-
left: "
|
|
6112
|
-
center: "
|
|
6113
|
-
right: "
|
|
6114
|
-
justify: "
|
|
6066
|
+
left: "Aligner à gauche",
|
|
6067
|
+
center: "Aligner au centre",
|
|
6068
|
+
right: "Aligner à droite",
|
|
6069
|
+
justify: "Justifier"
|
|
6115
6070
|
};
|
|
6116
6071
|
/**
|
|
6117
6072
|
* Checks if text alignment can be performed in the current editor state
|
|
@@ -6307,8 +6262,8 @@ var UNDO_REDO_SHORTCUT_KEYS = {
|
|
|
6307
6262
|
redo: "mod+shift+z"
|
|
6308
6263
|
};
|
|
6309
6264
|
var historyActionLabels = {
|
|
6310
|
-
undo: "
|
|
6311
|
-
redo: "
|
|
6265
|
+
undo: "Annuler",
|
|
6266
|
+
redo: "Rétablir"
|
|
6312
6267
|
};
|
|
6313
6268
|
var historyIcons = {
|
|
6314
6269
|
undo: UndoRounded_default,
|
|
@@ -6481,22 +6436,6 @@ var UndoRedoButton = (0, react.forwardRef)(({ editor: providedEditor, action, te
|
|
|
6481
6436
|
});
|
|
6482
6437
|
UndoRedoButton.displayName = "UndoRedoButton";
|
|
6483
6438
|
//#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
6439
|
//#region src/tiptap/hooks/use-composed-ref.ts
|
|
6501
6440
|
var updateRef = (ref, value) => {
|
|
6502
6441
|
if (typeof ref === "function") ref(value);
|
|
@@ -6686,6 +6625,8 @@ var useToolbarNavigation = (toolbarRef) => {
|
|
|
6686
6625
|
if (!items.length) return;
|
|
6687
6626
|
const toolbar = toolbarRef.current;
|
|
6688
6627
|
if (!toolbar) return;
|
|
6628
|
+
const activeEl = toolbar.ownerDocument.activeElement;
|
|
6629
|
+
if (activeEl && !toolbar.contains(activeEl)) return;
|
|
6689
6630
|
const initialContainerTabIndex = initialContainerTabIndexRef.current;
|
|
6690
6631
|
const currentIndex = selectedIndex ?? -1;
|
|
6691
6632
|
if (initialContainerTabIndex != null) {
|
|
@@ -6744,7 +6685,6 @@ ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
|
6744
6685
|
var FormattingControls = ({ editor }) => {
|
|
6745
6686
|
const hasSuperscriptSubscript = editor.extensionManager.extensions.map((e) => e.name).some((name) => name === "subscript" || name === "superscript");
|
|
6746
6687
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
6747
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spacer, {}),
|
|
6748
6688
|
/* @__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
6689
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarSeparator, {}),
|
|
6750
6690
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [
|
|
@@ -6771,20 +6711,36 @@ var FormattingControls = ({ editor }) => {
|
|
|
6771
6711
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkButton, { type: "underline" }),
|
|
6772
6712
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkPopover, {})
|
|
6773
6713
|
] }),
|
|
6714
|
+
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
6715
|
/* @__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
6716
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarGroup, { children: [
|
|
6777
6717
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "left" }),
|
|
6778
6718
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "center" }),
|
|
6779
6719
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "right" }),
|
|
6780
6720
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAlignButton, { align: "justify" })
|
|
6781
|
-
] })
|
|
6782
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spacer, {})
|
|
6721
|
+
] })
|
|
6783
6722
|
] });
|
|
6784
6723
|
};
|
|
6785
6724
|
FormattingControls.displayName = "FormattingControls";
|
|
6786
6725
|
//#endregion
|
|
6726
|
+
//#region src/tiptap/components/ui-primitive/spacer/spacer.tsx
|
|
6727
|
+
function Spacer({ orientation = "horizontal", size, style = {}, ...props }) {
|
|
6728
|
+
const computedStyle = {
|
|
6729
|
+
...style,
|
|
6730
|
+
...orientation === "horizontal" && !size && { flex: 1 },
|
|
6731
|
+
...size && {
|
|
6732
|
+
width: orientation === "vertical" ? "1px" : size,
|
|
6733
|
+
height: orientation === "horizontal" ? "1px" : size
|
|
6734
|
+
}
|
|
6735
|
+
};
|
|
6736
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6737
|
+
...props,
|
|
6738
|
+
style: computedStyle
|
|
6739
|
+
});
|
|
6740
|
+
}
|
|
6741
|
+
//#endregion
|
|
6787
6742
|
exports.FormattingControls = FormattingControls;
|
|
6743
|
+
exports.Spacer = Spacer;
|
|
6788
6744
|
exports.Toolbar = Toolbar;
|
|
6789
6745
|
exports.ToolbarGroup = ToolbarGroup;
|
|
6790
6746
|
exports.ToolbarSeparator = ToolbarSeparator;
|
package/dist/tiptap/index.d.ts
CHANGED
package/dist/tiptap/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as InputBase, Lt as Tooltip, M as Divider, Pt as ToggleButton, Qt as DeleteRounded_default, Rt as Typography, U as IconButton, d as Badge, gn as clsx, ht as Stack, nt as MenuItem, st as Popover, t as src_exports, tt as Menu, un as SvgIcon_default } from "../src-B3iFugc4.js";
|
|
2
2
|
import { Fragment, forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { createSvgIcon } from "@mui/material/utils";
|
|
@@ -4345,7 +4345,7 @@ function useBlockquote(config) {
|
|
|
4345
4345
|
return success;
|
|
4346
4346
|
}, [editor, onToggled]),
|
|
4347
4347
|
canToggle,
|
|
4348
|
-
label: "
|
|
4348
|
+
label: "Citation en bloc",
|
|
4349
4349
|
shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
|
|
4350
4350
|
Icon: TextSnippetIcon
|
|
4351
4351
|
};
|
|
@@ -4360,6 +4360,7 @@ var Button = forwardRef(({ className, children, tooltip, showTooltip = true, sho
|
|
|
4360
4360
|
const shortcuts = useMemo(() => parseShortcutKeys({ shortcutKeys }), [shortcutKeys]);
|
|
4361
4361
|
if (!tooltip || !showTooltip) return /* @__PURE__ */ jsx(ToggleButton, {
|
|
4362
4362
|
size: "small",
|
|
4363
|
+
color: "primary",
|
|
4363
4364
|
ref,
|
|
4364
4365
|
sx: {
|
|
4365
4366
|
border: "none",
|
|
@@ -4377,6 +4378,7 @@ var Button = forwardRef(({ className, children, tooltip, showTooltip = true, sho
|
|
|
4377
4378
|
}] } },
|
|
4378
4379
|
children: /* @__PURE__ */ jsx(ToggleButton, {
|
|
4379
4380
|
size: "small",
|
|
4381
|
+
color: "primary",
|
|
4380
4382
|
ref,
|
|
4381
4383
|
sx: {
|
|
4382
4384
|
border: "none",
|
|
@@ -4420,7 +4422,7 @@ var BlockquoteButton = forwardRef(({ editor: providedEditor, text, hideWhenUnava
|
|
|
4420
4422
|
disabled: !canToggle,
|
|
4421
4423
|
"data-disabled": !canToggle,
|
|
4422
4424
|
"aria-label": label,
|
|
4423
|
-
tooltip:
|
|
4425
|
+
tooltip: label,
|
|
4424
4426
|
onClick: handleClick,
|
|
4425
4427
|
...buttonProps,
|
|
4426
4428
|
ref,
|
|
@@ -4619,7 +4621,7 @@ function useCodeBlock(config) {
|
|
|
4619
4621
|
return success;
|
|
4620
4622
|
}, [editor, onToggled]),
|
|
4621
4623
|
canToggle: canToggleState,
|
|
4622
|
-
label: "
|
|
4624
|
+
label: "Bloc de code",
|
|
4623
4625
|
shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
4624
4626
|
Icon: IntegrationInstructionIcon
|
|
4625
4627
|
};
|
|
@@ -4656,7 +4658,7 @@ var CodeBlockButton = forwardRef(({ editor: providedEditor, text, hideWhenUnavai
|
|
|
4656
4658
|
"data-disabled": !canToggle,
|
|
4657
4659
|
tabIndex: -1,
|
|
4658
4660
|
"aria-label": label,
|
|
4659
|
-
tooltip:
|
|
4661
|
+
tooltip: label,
|
|
4660
4662
|
onClick: handleClick,
|
|
4661
4663
|
...buttonProps,
|
|
4662
4664
|
ref,
|
|
@@ -4932,7 +4934,7 @@ function useHeading(config) {
|
|
|
4932
4934
|
onToggled
|
|
4933
4935
|
]),
|
|
4934
4936
|
canToggle: canToggleState,
|
|
4935
|
-
label: `
|
|
4937
|
+
label: `Titre ${level}`,
|
|
4936
4938
|
shortcutKeys: HEADING_SHORTCUT_KEYS[level],
|
|
4937
4939
|
Icon: headingIcons[level]
|
|
4938
4940
|
};
|
|
@@ -4976,9 +4978,11 @@ var HeadingMenuItem = forwardRef(({ editor: providedEditor, level, text, hideWhe
|
|
|
4976
4978
|
ref,
|
|
4977
4979
|
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4978
4980
|
/* @__PURE__ */ jsx(Icon, { fontSize: "small" }),
|
|
4979
|
-
text && /* @__PURE__ */ jsx(
|
|
4980
|
-
|
|
4981
|
-
|
|
4981
|
+
text && /* @__PURE__ */ jsx(Typography, {
|
|
4982
|
+
component: "span",
|
|
4983
|
+
variant: "body2",
|
|
4984
|
+
sx: { ml: 1 },
|
|
4985
|
+
children: label
|
|
4982
4986
|
}),
|
|
4983
4987
|
showShortcut && /* @__PURE__ */ jsx(HeadingShortcutBadge, {
|
|
4984
4988
|
level,
|
|
@@ -5088,7 +5092,7 @@ function useHeadingMenu(config) {
|
|
|
5088
5092
|
isActive,
|
|
5089
5093
|
canToggle: canToggleState,
|
|
5090
5094
|
levels,
|
|
5091
|
-
label: "
|
|
5095
|
+
label: "Titre",
|
|
5092
5096
|
Icon: activeLevel ? headingIcons[activeLevel] : HeadingIcon
|
|
5093
5097
|
};
|
|
5094
5098
|
}
|
|
@@ -5110,7 +5114,7 @@ var HeadingMenu = forwardRef(({ editor: providedEditor, levels = [
|
|
|
5110
5114
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5111
5115
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
5112
5116
|
const open = Boolean(anchorEl);
|
|
5113
|
-
const { isVisible, isActive, canToggle, Icon } = useHeadingMenu({
|
|
5117
|
+
const { isVisible, isActive, canToggle, Icon, label } = useHeadingMenu({
|
|
5114
5118
|
editor,
|
|
5115
5119
|
levels,
|
|
5116
5120
|
hideWhenUnavailable
|
|
@@ -5132,7 +5136,7 @@ var HeadingMenu = forwardRef(({ editor: providedEditor, levels = [
|
|
|
5132
5136
|
id: "heading-button",
|
|
5133
5137
|
value: "heading",
|
|
5134
5138
|
type: "button",
|
|
5135
|
-
selected: isActive,
|
|
5139
|
+
selected: isActive || open,
|
|
5136
5140
|
role: "button",
|
|
5137
5141
|
tabIndex: -1,
|
|
5138
5142
|
disabled: !canToggle,
|
|
@@ -5141,7 +5145,7 @@ var HeadingMenu = forwardRef(({ editor: providedEditor, levels = [
|
|
|
5141
5145
|
"aria-controls": "heading-menu",
|
|
5142
5146
|
"aria-label": "Format text as heading",
|
|
5143
5147
|
"aria-expanded": open,
|
|
5144
|
-
tooltip:
|
|
5148
|
+
tooltip: label,
|
|
5145
5149
|
onClick: handleClick,
|
|
5146
5150
|
...buttonProps,
|
|
5147
5151
|
ref,
|
|
@@ -5340,7 +5344,7 @@ function useLinkPopover(config) {
|
|
|
5340
5344
|
isVisible,
|
|
5341
5345
|
canSet,
|
|
5342
5346
|
isActive,
|
|
5343
|
-
label: "
|
|
5347
|
+
label: "Lien",
|
|
5344
5348
|
Icon: LinkRounded_default,
|
|
5345
5349
|
...useLinkHandler({
|
|
5346
5350
|
editor,
|
|
@@ -5349,77 +5353,6 @@ function useLinkPopover(config) {
|
|
|
5349
5353
|
};
|
|
5350
5354
|
}
|
|
5351
5355
|
//#endregion
|
|
5352
|
-
//#region ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
5353
|
-
/**
|
|
5354
|
-
* Copyright 2022 Joe Bell. All rights reserved.
|
|
5355
|
-
*
|
|
5356
|
-
* This file is licensed to you under the Apache License, Version 2.0
|
|
5357
|
-
* (the "License"); you may not use this file except in compliance with the
|
|
5358
|
-
* License. You may obtain a copy of the License at
|
|
5359
|
-
*
|
|
5360
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5361
|
-
*
|
|
5362
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
5363
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
5364
|
-
* WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the
|
|
5365
|
-
* License for the specific language governing permissions and limitations under
|
|
5366
|
-
* the License.
|
|
5367
|
-
*/ var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
5368
|
-
var cx = clsx;
|
|
5369
|
-
var cva = (base, config) => (props) => {
|
|
5370
|
-
var _config_compoundVariants;
|
|
5371
|
-
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);
|
|
5372
|
-
const { variants, defaultVariants } = config;
|
|
5373
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
5374
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
5375
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
5376
|
-
if (variantProp === null) return null;
|
|
5377
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
5378
|
-
return variants[variant][variantKey];
|
|
5379
|
-
});
|
|
5380
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
5381
|
-
let [key, value] = param;
|
|
5382
|
-
if (value === void 0) return acc;
|
|
5383
|
-
acc[key] = value;
|
|
5384
|
-
return acc;
|
|
5385
|
-
}, {});
|
|
5386
|
-
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) => {
|
|
5387
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
5388
|
-
return Object.entries(compoundVariantOptions).every((param) => {
|
|
5389
|
-
let [key, value] = param;
|
|
5390
|
-
return Array.isArray(value) ? value.includes({
|
|
5391
|
-
...defaultVariants,
|
|
5392
|
-
...propsWithoutUndefined
|
|
5393
|
-
}[key]) : {
|
|
5394
|
-
...defaultVariants,
|
|
5395
|
-
...propsWithoutUndefined
|
|
5396
|
-
}[key] === value;
|
|
5397
|
-
}) ? [
|
|
5398
|
-
...acc,
|
|
5399
|
-
cvClass,
|
|
5400
|
-
cvClassName
|
|
5401
|
-
] : acc;
|
|
5402
|
-
}, []), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
5403
|
-
};
|
|
5404
|
-
//#endregion
|
|
5405
|
-
//#region src/tiptap/components/ui-primitive/button-group/button-group.tsx
|
|
5406
|
-
var buttonGroupVariants = cva("tiptap-button-group", {
|
|
5407
|
-
variants: { orientation: {
|
|
5408
|
-
horizontal: "tiptap-button-group-horizontal",
|
|
5409
|
-
vertical: "tiptap-button-group-vertical"
|
|
5410
|
-
} },
|
|
5411
|
-
defaultVariants: { orientation: "horizontal" }
|
|
5412
|
-
});
|
|
5413
|
-
function ButtonGroup({ className, orientation, ...props }) {
|
|
5414
|
-
return /* @__PURE__ */ jsx("div", {
|
|
5415
|
-
role: "group",
|
|
5416
|
-
"data-slot": "tiptap-button-group",
|
|
5417
|
-
"data-orientation": orientation,
|
|
5418
|
-
className: cn(buttonGroupVariants({ orientation }), className),
|
|
5419
|
-
...props
|
|
5420
|
-
});
|
|
5421
|
-
}
|
|
5422
|
-
//#endregion
|
|
5423
5356
|
//#region src/tiptap/components/ui/link-popover/link-popover.tsx
|
|
5424
5357
|
/**
|
|
5425
5358
|
* Link button component for triggering the link popover
|
|
@@ -5430,14 +5363,16 @@ var LinkButton = forwardRef(({ className, children, ...props }, ref) => {
|
|
|
5430
5363
|
className,
|
|
5431
5364
|
role: "button",
|
|
5432
5365
|
tabIndex: -1,
|
|
5433
|
-
"aria-label": "Link",
|
|
5434
|
-
tooltip: "Link",
|
|
5435
5366
|
ref,
|
|
5436
5367
|
...props,
|
|
5437
5368
|
children: children || /* @__PURE__ */ jsx(LinkRounded_default, { fontSize: "small" })
|
|
5438
5369
|
});
|
|
5439
5370
|
});
|
|
5440
5371
|
LinkButton.displayName = "LinkButton";
|
|
5372
|
+
var StyledIconButton = (0, src_exports.styled)(IconButton)(({ theme }) => ({
|
|
5373
|
+
borderRadius: theme.shape.borderRadius,
|
|
5374
|
+
"& .MuiTouchRipple-root .MuiTouchRipple-child": { borderRadius: theme.shape.borderRadius }
|
|
5375
|
+
}));
|
|
5441
5376
|
/**
|
|
5442
5377
|
* Main content component for the link popover
|
|
5443
5378
|
*/
|
|
@@ -5458,7 +5393,7 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, openLink, isActive }) => {
|
|
|
5458
5393
|
children: [
|
|
5459
5394
|
/* @__PURE__ */ jsx(InputBase, {
|
|
5460
5395
|
type: "url",
|
|
5461
|
-
placeholder: "
|
|
5396
|
+
placeholder: "Coller un lien...",
|
|
5462
5397
|
value: url,
|
|
5463
5398
|
onChange: (e) => setUrl(e.target.value),
|
|
5464
5399
|
onKeyDown: handleKeyDown,
|
|
@@ -5466,37 +5401,41 @@ var LinkMain = ({ url, setUrl, setLink, removeLink, openLink, isActive }) => {
|
|
|
5466
5401
|
autoComplete: "off",
|
|
5467
5402
|
autoCorrect: "off",
|
|
5468
5403
|
autoCapitalize: "off",
|
|
5469
|
-
className: "tiptap-link-input",
|
|
5470
5404
|
sx: {
|
|
5471
5405
|
padding: ".25rem .625rem",
|
|
5472
|
-
fontSize: "0.875rem"
|
|
5406
|
+
fontSize: "0.875rem",
|
|
5407
|
+
minWidth: "12rem"
|
|
5473
5408
|
}
|
|
5474
5409
|
}),
|
|
5475
|
-
/* @__PURE__ */ jsx(
|
|
5410
|
+
/* @__PURE__ */ jsx(StyledIconButton, {
|
|
5411
|
+
size: "small",
|
|
5476
5412
|
type: "button",
|
|
5477
5413
|
onClick: setLink,
|
|
5478
|
-
title: "
|
|
5414
|
+
title: "Appliquer le lien",
|
|
5479
5415
|
disabled: !url && !isActive,
|
|
5480
5416
|
children: /* @__PURE__ */ jsx(KeyboardReturnRounded_default, { fontSize: "small" })
|
|
5481
|
-
})
|
|
5417
|
+
}),
|
|
5482
5418
|
/* @__PURE__ */ jsx(Divider, {
|
|
5483
5419
|
orientation: "vertical",
|
|
5484
5420
|
flexItem: true,
|
|
5485
5421
|
sx: { my: .5 }
|
|
5486
5422
|
}),
|
|
5487
|
-
/* @__PURE__ */
|
|
5423
|
+
/* @__PURE__ */ jsx(StyledIconButton, {
|
|
5424
|
+
size: "small",
|
|
5488
5425
|
type: "button",
|
|
5489
5426
|
onClick: openLink,
|
|
5490
|
-
title: "
|
|
5427
|
+
title: "Ouvrir dans une nouvelle fenêtre",
|
|
5491
5428
|
disabled: !url && !isActive,
|
|
5492
5429
|
children: /* @__PURE__ */ jsx(OpenInNewRounded_default, { fontSize: "small" })
|
|
5493
|
-
})
|
|
5430
|
+
}),
|
|
5431
|
+
/* @__PURE__ */ jsx(StyledIconButton, {
|
|
5432
|
+
size: "small",
|
|
5494
5433
|
type: "button",
|
|
5495
5434
|
onClick: removeLink,
|
|
5496
|
-
title: "
|
|
5435
|
+
title: "Supprimer le lien",
|
|
5497
5436
|
disabled: !url && !isActive,
|
|
5498
5437
|
children: /* @__PURE__ */ jsx(DeleteRounded_default, { fontSize: "small" })
|
|
5499
|
-
})
|
|
5438
|
+
})
|
|
5500
5439
|
]
|
|
5501
5440
|
});
|
|
5502
5441
|
};
|
|
@@ -5509,6 +5448,7 @@ var LinkPopover = forwardRef(({ editor: providedEditor, hideWhenUnavailable = fa
|
|
|
5509
5448
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5510
5449
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
5511
5450
|
const internalRef = useRef(null);
|
|
5451
|
+
const justSubmittedRef = useRef(false);
|
|
5512
5452
|
const { isVisible, canSet, isActive, url, setUrl, setLink, removeLink, openLink, label, Icon } = useLinkPopover({
|
|
5513
5453
|
editor,
|
|
5514
5454
|
hideWhenUnavailable,
|
|
@@ -5524,8 +5464,12 @@ var LinkPopover = forwardRef(({ editor: providedEditor, hideWhenUnavailable = fa
|
|
|
5524
5464
|
onOpenChange?.(false);
|
|
5525
5465
|
}, [onOpenChange]);
|
|
5526
5466
|
const handleSetLink = useCallback(() => {
|
|
5467
|
+
justSubmittedRef.current = true;
|
|
5527
5468
|
setLink();
|
|
5528
5469
|
setAnchorEl(null);
|
|
5470
|
+
queueMicrotask(() => {
|
|
5471
|
+
justSubmittedRef.current = false;
|
|
5472
|
+
});
|
|
5529
5473
|
}, [setLink]);
|
|
5530
5474
|
const handleClick = useCallback((event) => {
|
|
5531
5475
|
onClick?.(event, !isActive);
|
|
@@ -5533,16 +5477,17 @@ var LinkPopover = forwardRef(({ editor: providedEditor, hideWhenUnavailable = fa
|
|
|
5533
5477
|
setAnchorEl(event.currentTarget);
|
|
5534
5478
|
}, [onClick, anchorEl]);
|
|
5535
5479
|
useEffect(() => {
|
|
5536
|
-
if (autoOpenOnLinkActive && isActive) setAnchorEl(internalRef.current);
|
|
5480
|
+
if (autoOpenOnLinkActive && isActive && !justSubmittedRef.current) setAnchorEl(internalRef.current);
|
|
5537
5481
|
}, [autoOpenOnLinkActive, isActive]);
|
|
5538
5482
|
if (!isVisible) return null;
|
|
5539
5483
|
const open = Boolean(anchorEl);
|
|
5540
5484
|
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(LinkButton, {
|
|
5541
5485
|
value: "link",
|
|
5542
5486
|
disabled: !canSet,
|
|
5543
|
-
selected: isActive,
|
|
5487
|
+
selected: isActive || open,
|
|
5544
5488
|
"data-disabled": !canSet,
|
|
5545
5489
|
"aria-label": label,
|
|
5490
|
+
tooltip: label,
|
|
5546
5491
|
onClick: handleClick,
|
|
5547
5492
|
...buttonProps,
|
|
5548
5493
|
ref: setRefs,
|
|
@@ -5609,9 +5554,9 @@ var listIcons = {
|
|
|
5609
5554
|
] }), "ListTodo")
|
|
5610
5555
|
};
|
|
5611
5556
|
var listLabels = {
|
|
5612
|
-
bulletList: "
|
|
5613
|
-
orderedList: "
|
|
5614
|
-
taskList: "
|
|
5557
|
+
bulletList: "Liste à puces",
|
|
5558
|
+
orderedList: "Liste numérotée",
|
|
5559
|
+
taskList: "Liste de tâches"
|
|
5615
5560
|
};
|
|
5616
5561
|
var LIST_SHORTCUT_KEYS = {
|
|
5617
5562
|
bulletList: "mod+shift+8",
|
|
@@ -5936,7 +5881,15 @@ function shouldShowButton$2(props) {
|
|
|
5936
5881
|
* Gets the formatted mark name
|
|
5937
5882
|
*/
|
|
5938
5883
|
function getFormattedMarkName(type) {
|
|
5939
|
-
|
|
5884
|
+
switch (type) {
|
|
5885
|
+
case "bold": return "Gras";
|
|
5886
|
+
case "italic": return "Italique";
|
|
5887
|
+
case "strike": return "Barré";
|
|
5888
|
+
case "code": return "Code";
|
|
5889
|
+
case "underline": return "Souligné";
|
|
5890
|
+
case "superscript": return "Exposant";
|
|
5891
|
+
case "subscript": return "Indice";
|
|
5892
|
+
}
|
|
5940
5893
|
}
|
|
5941
5894
|
/**
|
|
5942
5895
|
* Custom hook that provides mark functionality for Tiptap editor
|
|
@@ -6097,10 +6050,10 @@ var textAlignIcons = {
|
|
|
6097
6050
|
justify: FormatAlignJustifyRounded_default
|
|
6098
6051
|
};
|
|
6099
6052
|
var textAlignLabels = {
|
|
6100
|
-
left: "
|
|
6101
|
-
center: "
|
|
6102
|
-
right: "
|
|
6103
|
-
justify: "
|
|
6053
|
+
left: "Aligner à gauche",
|
|
6054
|
+
center: "Aligner au centre",
|
|
6055
|
+
right: "Aligner à droite",
|
|
6056
|
+
justify: "Justifier"
|
|
6104
6057
|
};
|
|
6105
6058
|
/**
|
|
6106
6059
|
* Checks if text alignment can be performed in the current editor state
|
|
@@ -6296,8 +6249,8 @@ var UNDO_REDO_SHORTCUT_KEYS = {
|
|
|
6296
6249
|
redo: "mod+shift+z"
|
|
6297
6250
|
};
|
|
6298
6251
|
var historyActionLabels = {
|
|
6299
|
-
undo: "
|
|
6300
|
-
redo: "
|
|
6252
|
+
undo: "Annuler",
|
|
6253
|
+
redo: "Rétablir"
|
|
6301
6254
|
};
|
|
6302
6255
|
var historyIcons = {
|
|
6303
6256
|
undo: UndoRounded_default,
|
|
@@ -6470,22 +6423,6 @@ var UndoRedoButton = forwardRef(({ editor: providedEditor, action, text, hideWhe
|
|
|
6470
6423
|
});
|
|
6471
6424
|
UndoRedoButton.displayName = "UndoRedoButton";
|
|
6472
6425
|
//#endregion
|
|
6473
|
-
//#region src/tiptap/components/ui-primitive/spacer/spacer.tsx
|
|
6474
|
-
function Spacer({ orientation = "horizontal", size, style = {}, ...props }) {
|
|
6475
|
-
const computedStyle = {
|
|
6476
|
-
...style,
|
|
6477
|
-
...orientation === "horizontal" && !size && { flex: 1 },
|
|
6478
|
-
...size && {
|
|
6479
|
-
width: orientation === "vertical" ? "1px" : size,
|
|
6480
|
-
height: orientation === "horizontal" ? "1px" : size
|
|
6481
|
-
}
|
|
6482
|
-
};
|
|
6483
|
-
return /* @__PURE__ */ jsx("div", {
|
|
6484
|
-
...props,
|
|
6485
|
-
style: computedStyle
|
|
6486
|
-
});
|
|
6487
|
-
}
|
|
6488
|
-
//#endregion
|
|
6489
6426
|
//#region src/tiptap/hooks/use-composed-ref.ts
|
|
6490
6427
|
var updateRef = (ref, value) => {
|
|
6491
6428
|
if (typeof ref === "function") ref(value);
|
|
@@ -6675,6 +6612,8 @@ var useToolbarNavigation = (toolbarRef) => {
|
|
|
6675
6612
|
if (!items.length) return;
|
|
6676
6613
|
const toolbar = toolbarRef.current;
|
|
6677
6614
|
if (!toolbar) return;
|
|
6615
|
+
const activeEl = toolbar.ownerDocument.activeElement;
|
|
6616
|
+
if (activeEl && !toolbar.contains(activeEl)) return;
|
|
6678
6617
|
const initialContainerTabIndex = initialContainerTabIndexRef.current;
|
|
6679
6618
|
const currentIndex = selectedIndex ?? -1;
|
|
6680
6619
|
if (initialContainerTabIndex != null) {
|
|
@@ -6733,7 +6672,6 @@ ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
|
6733
6672
|
var FormattingControls = ({ editor }) => {
|
|
6734
6673
|
const hasSuperscriptSubscript = editor.extensionManager.extensions.map((e) => e.name).some((name) => name === "subscript" || name === "superscript");
|
|
6735
6674
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6736
|
-
/* @__PURE__ */ jsx(Spacer, {}),
|
|
6737
6675
|
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [/* @__PURE__ */ jsx(UndoRedoButton, { action: "undo" }), /* @__PURE__ */ jsx(UndoRedoButton, { action: "redo" })] }),
|
|
6738
6676
|
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
6739
6677
|
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
@@ -6760,19 +6698,34 @@ var FormattingControls = ({ editor }) => {
|
|
|
6760
6698
|
/* @__PURE__ */ jsx(MarkButton, { type: "underline" }),
|
|
6761
6699
|
/* @__PURE__ */ jsx(LinkPopover, {})
|
|
6762
6700
|
] }),
|
|
6701
|
+
hasSuperscriptSubscript ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ToolbarSeparator, {}), /* @__PURE__ */ jsxs(ToolbarGroup, { children: [/* @__PURE__ */ jsx(MarkButton, { type: "superscript" }), /* @__PURE__ */ jsx(MarkButton, { type: "subscript" })] })] }) : null,
|
|
6763
6702
|
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
6764
|
-
hasSuperscriptSubscript ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(ToolbarGroup, { children: [/* @__PURE__ */ jsx(MarkButton, { type: "superscript" }), /* @__PURE__ */ jsx(MarkButton, { type: "subscript" })] }), /* @__PURE__ */ jsx(ToolbarSeparator, {})] }) : null,
|
|
6765
6703
|
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
6766
6704
|
/* @__PURE__ */ jsx(TextAlignButton, { align: "left" }),
|
|
6767
6705
|
/* @__PURE__ */ jsx(TextAlignButton, { align: "center" }),
|
|
6768
6706
|
/* @__PURE__ */ jsx(TextAlignButton, { align: "right" }),
|
|
6769
6707
|
/* @__PURE__ */ jsx(TextAlignButton, { align: "justify" })
|
|
6770
|
-
] })
|
|
6771
|
-
/* @__PURE__ */ jsx(Spacer, {})
|
|
6708
|
+
] })
|
|
6772
6709
|
] });
|
|
6773
6710
|
};
|
|
6774
6711
|
FormattingControls.displayName = "FormattingControls";
|
|
6775
6712
|
//#endregion
|
|
6776
|
-
|
|
6713
|
+
//#region src/tiptap/components/ui-primitive/spacer/spacer.tsx
|
|
6714
|
+
function Spacer({ orientation = "horizontal", size, style = {}, ...props }) {
|
|
6715
|
+
const computedStyle = {
|
|
6716
|
+
...style,
|
|
6717
|
+
...orientation === "horizontal" && !size && { flex: 1 },
|
|
6718
|
+
...size && {
|
|
6719
|
+
width: orientation === "vertical" ? "1px" : size,
|
|
6720
|
+
height: orientation === "horizontal" ? "1px" : size
|
|
6721
|
+
}
|
|
6722
|
+
};
|
|
6723
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6724
|
+
...props,
|
|
6725
|
+
style: computedStyle
|
|
6726
|
+
});
|
|
6727
|
+
}
|
|
6728
|
+
//#endregion
|
|
6729
|
+
export { FormattingControls, Spacer, Toolbar, ToolbarGroup, ToolbarSeparator };
|
|
6777
6730
|
|
|
6778
6731
|
//# sourceMappingURL=index.es.js.map
|
package/dist/ui.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
:root {
|
|
2
2
|
--toastify-color-light: var(--theme-palette-common-white);
|
|
3
3
|
--toastify-color-dark: var(--theme-palette-common-black);
|
|
4
4
|
--toastify-color-info: var(--theme-palette-info-main);
|
|
@@ -11,127 +11,7 @@
|
|
|
11
11
|
--toastify-text-color-light: var(--theme-palette-text-primary);
|
|
12
12
|
--toastify-text-color-dark: var(--theme-palette-common-white);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
.tiptap-button-group {
|
|
16
|
-
display: flex;
|
|
17
|
-
width: fit-content;
|
|
18
|
-
align-items: stretch;
|
|
19
|
-
/* nested tiptap-button-group gets a gap */
|
|
20
|
-
}
|
|
21
|
-
.tiptap-button-group:has(> [data-slot=tiptap-button-group]) {
|
|
22
|
-
gap: 0.125rem;
|
|
23
|
-
}
|
|
24
|
-
.tiptap-button-group {
|
|
25
|
-
/* focus-visible children stack correctly */
|
|
26
|
-
}
|
|
27
|
-
.tiptap-button-group > *:focus-visible {
|
|
28
|
-
position: relative;
|
|
29
|
-
z-index: 10;
|
|
30
|
-
}
|
|
31
|
-
.tiptap-button-group {
|
|
32
|
-
/* select trigger without explicit width becomes fit-content */
|
|
33
|
-
}
|
|
34
|
-
.tiptap-button-group > [data-slot=select-trigger]:not([class*=w-]) {
|
|
35
|
-
width: fit-content;
|
|
36
|
-
}
|
|
37
|
-
.tiptap-button-group {
|
|
38
|
-
/* input children fill remaining space */
|
|
39
|
-
}
|
|
40
|
-
.tiptap-button-group > input {
|
|
41
|
-
flex: 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* ─── Horizontal ────────────────────────────────────────── */
|
|
45
|
-
.tiptap-button-group-horizontal {
|
|
46
|
-
/* all [data-slot] children: remove right radius */
|
|
47
|
-
}
|
|
48
|
-
.tiptap-button-group-horizontal > [data-slot] {
|
|
49
|
-
border-top-right-radius: 0;
|
|
50
|
-
border-bottom-right-radius: 0;
|
|
51
|
-
}
|
|
52
|
-
.tiptap-button-group-horizontal {
|
|
53
|
-
/* last [data-slot] child: restore right radius */
|
|
54
|
-
}
|
|
55
|
-
.tiptap-button-group-horizontal > [data-slot]:not(:has(~ [data-slot])) {
|
|
56
|
-
border-top-right-radius: var(--tt-radius-lg) !important;
|
|
57
|
-
border-bottom-right-radius: var(--tt-radius-lg) !important;
|
|
58
|
-
}
|
|
59
|
-
.tiptap-button-group-horizontal {
|
|
60
|
-
/* non-first [data-slot] children: remove left radius + left border */
|
|
61
|
-
}
|
|
62
|
-
.tiptap-button-group-horizontal > [data-slot] ~ [data-slot] {
|
|
63
|
-
border-top-left-radius: 0;
|
|
64
|
-
border-bottom-left-radius: 0;
|
|
65
|
-
border-left-width: 0;
|
|
66
|
-
}
|
|
67
|
-
.tiptap-button-group-horizontal {
|
|
68
|
-
/* select trigger last of type when followed by hidden select */
|
|
69
|
-
}
|
|
70
|
-
.tiptap-button-group-horizontal:has(select[aria-hidden=true]:last-child) > [data-slot=select-trigger]:last-of-type {
|
|
71
|
-
border-top-right-radius: var(--tt-radius-lg);
|
|
72
|
-
border-bottom-right-radius: var(--tt-radius-lg);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* ─── Vertical ──────────────────────────────────────────── */
|
|
76
|
-
.tiptap-button-group-vertical {
|
|
77
|
-
flex-direction: column;
|
|
78
|
-
/* all [data-slot] children: remove bottom radius */
|
|
79
|
-
}
|
|
80
|
-
.tiptap-button-group-vertical > [data-slot] {
|
|
81
|
-
border-bottom-left-radius: 0;
|
|
82
|
-
border-bottom-right-radius: 0;
|
|
83
|
-
}
|
|
84
|
-
.tiptap-button-group-vertical {
|
|
85
|
-
/* last [data-slot] child: restore bottom radius */
|
|
86
|
-
}
|
|
87
|
-
.tiptap-button-group-vertical > [data-slot]:not(:has(~ [data-slot])) {
|
|
88
|
-
border-bottom-left-radius: var(--tt-radius-lg) !important;
|
|
89
|
-
border-bottom-right-radius: var(--tt-radius-lg) !important;
|
|
90
|
-
}
|
|
91
|
-
.tiptap-button-group-vertical {
|
|
92
|
-
/* non-first [data-slot] children: remove top radius + top border */
|
|
93
|
-
}
|
|
94
|
-
.tiptap-button-group-vertical > [data-slot] ~ [data-slot] {
|
|
95
|
-
border-top-left-radius: 0;
|
|
96
|
-
border-top-right-radius: 0;
|
|
97
|
-
border-top-width: 0;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* ─── Separator ──────────────────────────────────────────── */
|
|
101
|
-
.tiptap-button-group-separator {
|
|
102
|
-
position: relative;
|
|
103
|
-
align-self: stretch;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.tiptap-button-group-separator[data-orientation=horizontal] {
|
|
107
|
-
margin-left: 1px;
|
|
108
|
-
margin-right: 1px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.tiptap-button-group-separator[data-orientation=horizontal] {
|
|
112
|
-
width: auto;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.tiptap-button-group-separator[data-orientation=vertical] {
|
|
116
|
-
margin-top: 1px;
|
|
117
|
-
margin-bottom: 1px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.tiptap-button-group-separator[data-orientation=vertical] {
|
|
121
|
-
height: auto;
|
|
122
|
-
}.tiptap-link-input {
|
|
123
|
-
font-size: 0.875rem;
|
|
124
|
-
border: none;
|
|
125
|
-
/* Clamp the input */
|
|
126
|
-
min-width: 12rem;
|
|
127
|
-
padding-right: 0;
|
|
128
|
-
text-overflow: ellipsis;
|
|
129
|
-
white-space: nowrap;
|
|
130
|
-
}
|
|
131
|
-
.tiptap-link-input:focus {
|
|
132
|
-
text-overflow: clip;
|
|
133
|
-
overflow: visible;
|
|
134
|
-
}:root {
|
|
14
|
+
:root {
|
|
135
15
|
--tt-toolbar-height: 2.75rem;
|
|
136
16
|
--tt-safe-area-bottom: env(safe-area-inset-bottom, 0px);
|
|
137
17
|
--tt-toolbar-bg-color: var(--theme-palette-common-white);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgi-learning-hub/ui",
|
|
3
|
-
"version": "1.14.0-dev.
|
|
3
|
+
"version": "1.14.0-dev.1785404668",
|
|
4
4
|
"description": "React component library for Hub's design system, built on Material UI with custom and extended components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cgi-learning-hub",
|