Commit 8c62eb1d authored by Mab's avatar Mab
Browse files

feat: side menu

parent de0dc3f0
Pipeline #12948 failed with stages
in 12 seconds
......@@ -18,18 +18,18 @@ const DropdownStyled = styled(Dropdown)`
`;
const dropDownOptions = [
{ label: "add column before", value: "addColumnBefore" },
{ label: "add column after", value: "addColumnAfter" },
{ label: "Delete column", value: "deleteColumn" },
{ label: "Insert row before", value: "addRowBefore" },
{ label: "Insert row after", value: "addRowAfter" },
{ label: "Delete row", value: "deleteRow" },
{ label: "Delete table", value: "deleteTable" },
{ label: "Merge cells", value: "mergeCells" },
{ label: "Split cell", value: "splitCell" },
{ label: "Toggle header column", value: "toggleHeaderColumn" },
{ label: "Toggle header row", value: "toggleHeaderRow" },
{ label: "Toggle header cells", value: "toggleHeaderCell" }
{ label: "ajouter colonne avant", value: "addColumnBefore" },
{ label: "ajouter colonne après", value: "addColumnAfter" },
{ label: "supprimer colonne", value: "deleteColumn" },
{ label: "insérer ligne avant", value: "addRowBefore" },
{ label: "insérer ligne après", value: "addRowAfter" },
{ label: "supprimer ligne", value: "deleteRow" },
{ label: "supprimer tableau", value: "deleteTable" },
{ label: "fusionner cellule", value: "mergeCells" },
{ label: "diviser cellule", value: "splitCell" },
{ label: "Colonne titre", value: "toggleHeaderColumn" },
{ label: "Ligne titre", value: "toggleHeaderRow" },
{ label: "Cellule titre", value: "toggleHeaderCell" }
];
const TableDropDown = ({ dispatch, state, item }) => (
......@@ -38,7 +38,7 @@ const TableDropDown = ({ dispatch, state, item }) => (
onChange={option => {
tablesFn[option.value](state, dispatch);
}}
placeholder="Table Options"
placeholder="Options de tableau"
select={item.select && item.select(state)}
/>
);
......
......@@ -66,7 +66,7 @@ const promptForURL = () => {
export default {
undo: {
title: "Undo last change",
title: "Annuler dernier changement",
content: icons.undo,
enable: undo,
run: undo,
......@@ -74,7 +74,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
redo: {
title: "Redo last undone change",
title: "Rétablir derniere annulation",
content: icons.redo,
enable: redo,
run: redo,
......@@ -82,7 +82,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
em: {
title: "Toggle emphasis",
title: "Italique",
content: icons.em,
active: state => {
return markActive(state.config.schema.marks.em)(state);
......@@ -94,7 +94,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
strong: {
title: "Toggle strong",
title: "Gras",
content: icons.strong,
active: state => {
return markActive(state.config.schema.marks.strong)(state);
......@@ -105,21 +105,8 @@ export default {
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
code: {
title: "Toggle code",
content: icons.code,
active: state => {
return markActive(state.config.schema.marks.code)(state);
},
run(state, dispatch) {
toggleMark(state.config.schema.marks.code)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
small_caps: {
title: "Toggle Small Caps",
title: "Petite capitale",
content: icons.small_caps,
active: state => {
return markActive(state.config.schema.marks.small_caps)(state);
......@@ -132,7 +119,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
subscript: {
title: "Toggle subscript",
title: "Indice",
content: icons.subscript,
active: state => {
return markActive(state.config.schema.marks.subscript)(state);
......@@ -144,7 +131,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
superscript: {
title: "Toggle superscript",
title: "Exposant",
content: icons.superscript,
active: state => {
return markActive(state.config.schema.marks.superscript)(state);
......@@ -155,21 +142,8 @@ export default {
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
underline: {
title: "Toggle underline",
content: icons.underline,
active: state => {
return markActive(state.config.schema.marks.underline)(state);
},
run(state, dispatch) {
toggleMark(state.config.schema.marks.underline)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
strikethrough: {
title: "Toggle strikethrough",
title: "Barré",
content: icons.strikethrough,
active: state => {
return markActive(state.config.schema.marks.strikethrough)(state);
......@@ -181,7 +155,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
link: {
title: "Add or remove link",
title: "Liens hypertexte",
content: icons.link,
active: state => {
return markActive(state.config.schema.marks.link)(state);
......@@ -202,7 +176,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
blockquote: {
title: "Wrap in block quote",
title: "Citation",
content: icons.blockquote,
// active: blockActive(schema.nodes.blockquote),
// enable: wrapIn(schema.nodes.blockquote),
......@@ -213,7 +187,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
bullet_list: {
title: "Wrap in bullet list",
title: "Liste à puce",
content: icons.bullet_list,
// active: blockActive(schema.nodes.bullet_list),
// enable: wrapInList(schema.nodes.bullet_list),
......@@ -224,7 +198,7 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
ordered_list: {
title: "Wrap in ordered list",
title: "Liste numérotée",
content: icons.ordered_list,
// active: blockActive(schema.nodes.ordered_list),
// enable: wrapInList(schema.nodes.ordered_list),
......@@ -235,24 +209,8 @@ export default {
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
lift: {
title: "Lift out of enclosing block",
content: icons.lift,
enable: lift,
run: lift,
select: state => lift(state),
menu: props => <Button key={uuid()} {...props} />
},
join_up: {
title: "Join with above block",
content: icons.join_up,
select: state => joinUp(state),
enable: joinUp,
run: joinUp,
menu: props => <Button key={uuid()} {...props} />
},
image: {
title: "Insert image",
title: "Insérer image",
content: icons.image,
// enable: canInsert(schema.nodes.image),
select: state => true,
......@@ -260,7 +218,7 @@ export default {
menu: props => <ImageUpload key={uuid()} {...props} />
},
table: {
title: "Insert table",
title: "Insérer tableau",
content: icons.table,
// enable: canInsert(schema.nodes.table),
run: (state, dispatch) => {
......@@ -287,9 +245,9 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
tableDropDownOptions: {
content: "table",
content: "tableau",
run: option => true,
title: "Select Options",
title: "Selectionner Options",
select: state => addColumnBefore(state),
menu: props => <TableDropDown key={uuid()} {...props} />
}
......
......@@ -15,8 +15,8 @@ const blockActive = (type, attrs = {}) => state => {
export default {
title: {
title: "Change to Title",
content: "Title",
title: "Définir comme titre",
content: "Titre",
enable: state => {
return setBlockType(state.config.schema.nodes.title)(state);
},
......@@ -28,8 +28,8 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
subtitle: {
title: "Change to Subtilte",
content: "Subtilte",
title: "Définir comme sous-titre",
content: "Sous-titre",
enable: state => {
return setBlockType(state.config.schema.nodes.subtitle)(state);
},
......@@ -40,8 +40,8 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
author: {
title: "Change to Author",
content: "Author",
title: "Définir comme auteur",
content: "Auteur",
enable: state => {
return setBlockType(state.config.schema.nodes.author)(state);
},
......@@ -51,9 +51,9 @@ export default {
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
epigraphPoetry: {
title: "Change to Epigraph Poetry",
content: "Epigraph Poetry",
Poetry: {
title: "Définir comme Epigraph Poetry",
content: "Épigraphe Poésie",
enable: state => {
return setBlockType(state.config.schema.nodes.epigraphPoetry)(state);
},
......@@ -64,8 +64,8 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
epigraphProse: {
title: "Change to Epigraph Prose",
content: "Epigraph Prose",
title: "Définir comme Epigraph Prose",
content: "Épigraphe Prose",
enable: state => {
return setBlockType(state.config.schema.nodes.epigraphProse)(state);
},
......@@ -76,9 +76,9 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
plain: {
title: "Change to General Text",
title: "Définir comme corps de texte",
// content: icons.paragraph,
content: "General Text",
content: "Corps de texte",
enable: state => {
return setBlockType(state.config.schema.nodes.paragraph)(state);
},
......@@ -90,51 +90,51 @@ export default {
menu: props => <Button key={uuid()} {...props} />
},
heading1: {
title: "Change to heading level 1",
content: "Heading 1",
title: "Définir comme Titre 1",
content: "Titre 1",
enable: state => {
return setBlockType(state.config.schema.nodes.heading, { level: 1 })(
state
state
);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.heading, { level: 1 })(
state,
dispatch
state,
dispatch
);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
heading2: {
title: "Change to heading level 2",
content: "Heading 2",
title: "Définir comme Titre 2",
content: "Titre 2",
enable: state => {
return setBlockType(state.config.schema.nodes.heading, { level: 2 })(
state
state
);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.heading, { level: 2 })(
state,
dispatch
state,
dispatch
);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
heading3: {
title: "Change to heading level 3",
content: "Heading 3",
title: "Définir comme Titre 3",
content: "Titre 3",
enable: state => {
return setBlockType(state.config.schema.nodes.heading, { level: 3 })(
state
state
);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.heading, { level: 3 })(
state,
dispatch
state,
dispatch
);
},
select: state => true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment