react-text-forge 1.2.11 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-text-forge.css +1 -1
- package/dist/react-text-forge.js +201 -122
- package/dist/react-text-forge.umd.cjs +9 -9
- package/dist/src/components/functions/deserialize.d.ts +6 -1
- package/dist/src/components/functions/serialize.d.ts +6 -1
- package/dist/src/components/useToolbar.d.ts +2 -1
- package/dist/src/components/utils/CustomEditor.d.ts +142 -130
- package/dist/src/components/utils/Images.d.ts +1 -1
- package/dist/src/components/utils/Tooltip.d.ts +1 -1
- package/dist/src/components/utils/dropdown/ContainerDropdown.d.ts +2 -6
- package/dist/src/components/utils/dropdown/{TableDropdown.d.ts → TableButtons.d.ts} +2 -2
- package/dist/src/components/utils/elements/BlockquoteElement.d.ts +1 -1
- package/dist/src/components/utils/elements/CodeElement.d.ts +1 -1
- package/dist/src/components/utils/elements/DefaultElement.d.ts +1 -1
- package/dist/src/components/utils/elements/ListElement.d.ts +1 -1
- package/dist/src/components/utils/form/BulletTypeSelector.d.ts +3 -3
- package/dist/src/components/utils/form/NumeredTypeSelector.d.ts +3 -3
- package/dist/types/react-text-forge.d.ts +90 -0
- package/package.json +4 -1
|
@@ -5,12 +5,12 @@ export default BulletTypeSelector;
|
|
|
5
5
|
* @param {object} props
|
|
6
6
|
* @param {function} props.onChange - permet de définir la nouvelle puce
|
|
7
7
|
* @param {object} props.selectStyle - style appliqué pour l'élément
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {() => void} props.onClose - Ferme le formulaire
|
|
9
9
|
*
|
|
10
10
|
* @returns {JSX.Element}
|
|
11
11
|
*/
|
|
12
|
-
declare function BulletTypeSelector({ onChange, selectStyle,
|
|
12
|
+
declare function BulletTypeSelector({ onChange, selectStyle, onClose }: {
|
|
13
13
|
onChange: Function;
|
|
14
14
|
selectStyle: object;
|
|
15
|
-
|
|
15
|
+
onClose: () => void;
|
|
16
16
|
}): JSX.Element;
|
|
@@ -5,12 +5,12 @@ export default NumeredTypeSelector;
|
|
|
5
5
|
* @param {object} props
|
|
6
6
|
* @param {function} props.onChange - permet de définir la nouvelle puce
|
|
7
7
|
* @param {object} props.selectStyle - style appliqué pour l'élément
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {() => void} props.onClose - Affiche le formulaire
|
|
9
9
|
*
|
|
10
10
|
* @returns {JSX.Element}
|
|
11
11
|
*/
|
|
12
|
-
declare function NumeredTypeSelector({ onChange, selectStyle,
|
|
12
|
+
declare function NumeredTypeSelector({ onChange, selectStyle, onClose }: {
|
|
13
13
|
onChange: Function;
|
|
14
14
|
selectStyle: object;
|
|
15
|
-
|
|
15
|
+
onClose: () => void;
|
|
16
16
|
}): JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// react-text-forge.d.ts
|
|
2
|
+
import { ComponentType, ReactNode } from "react";
|
|
3
|
+
import { Descendant, Text } from "slate";
|
|
4
|
+
|
|
5
|
+
// Types pour les props du composant ReactTextForge
|
|
6
|
+
interface ReactTextForgeProps {
|
|
7
|
+
/**
|
|
8
|
+
* Contenu textuel de l'éditeur (format Slate)
|
|
9
|
+
*/
|
|
10
|
+
value: Descendant[];
|
|
11
|
+
/**
|
|
12
|
+
* Fonction pour mettre à jour le contenu
|
|
13
|
+
*/
|
|
14
|
+
setValue: (value: Descendant[]) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Active/désactive le mode plein écran
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
fullScreen?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Affiche/masque le sélecteur de thème
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
showTheme?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Couleur de bordure des éléments (thème clair)
|
|
27
|
+
* @default "#ccc"
|
|
28
|
+
*/
|
|
29
|
+
borderColor?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Couleur d'arrière-plan (thème clair)
|
|
32
|
+
* @default "#FFF"
|
|
33
|
+
*/
|
|
34
|
+
backgroundColor?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Couleur des images (thème clair)
|
|
37
|
+
* @default "#000"
|
|
38
|
+
*/
|
|
39
|
+
imageColor?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Couleur de bordure des éléments (thème sombre)
|
|
42
|
+
* @default "#1A1A1A"
|
|
43
|
+
*/
|
|
44
|
+
borderDarkColor?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Couleur d'arrière-plan (thème sombre)
|
|
47
|
+
* @default "#444444"
|
|
48
|
+
*/
|
|
49
|
+
backgroundDarkColor?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Couleur des images (thème sombre)
|
|
52
|
+
* @default "#ffffff"
|
|
53
|
+
*/
|
|
54
|
+
imageDarkColor?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Couleur du bouton de bascule
|
|
57
|
+
* @default "#2584aa"
|
|
58
|
+
*/
|
|
59
|
+
toggleColor?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Liste des raccourcis personnalisés
|
|
62
|
+
* @default null
|
|
63
|
+
*/
|
|
64
|
+
raccourcis?: Record<string, string> | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Déclaration du composant ReactTextForge
|
|
68
|
+
declare const ReactTextForge: ComponentType<ReactTextForgeProps>;
|
|
69
|
+
|
|
70
|
+
// Types pour les fonctions serialize et deserialize
|
|
71
|
+
type SerializedOutput = string;
|
|
72
|
+
type DeserializedOutput = Descendant[];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sérialise le contenu Slate en HTML
|
|
76
|
+
* @param nodes - Nœuds Slate à sérialiser
|
|
77
|
+
* @returns Chaîne HTML
|
|
78
|
+
*/
|
|
79
|
+
declare function serialize(nodes: Descendant[]): SerializedOutput;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Désérialise le contenu HTML en nœuds Slate
|
|
83
|
+
* @param html - Chaîne HTML à désérialiser
|
|
84
|
+
* @returns Nœuds Slate
|
|
85
|
+
*/
|
|
86
|
+
declare function deserialize(html: string): DeserializedOutput;
|
|
87
|
+
|
|
88
|
+
// Export par défaut et nommés
|
|
89
|
+
export default ReactTextForge;
|
|
90
|
+
export { serialize, deserialize };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "react-text-forge",
|
|
3
3
|
"author": "Jahylis",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.3.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/react-text-forge.umd.js",
|
|
8
8
|
"module": "dist/react-text-forge.js",
|
|
@@ -69,5 +69,8 @@
|
|
|
69
69
|
"moduleNameMapper": {
|
|
70
70
|
"\\.(css|sass|scss)$": "identity-obj-proxy"
|
|
71
71
|
}
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"slate-dom": "^0.124.0"
|
|
72
75
|
}
|
|
73
76
|
}
|