Skip to content

Commit

Permalink
refactor: add org in package name
Browse files Browse the repository at this point in the history
  • Loading branch information
tonai committed Jan 9, 2025
1 parent 7dbc64c commit b596700
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 195 deletions.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@codegouvfr/react-dsfr": "^1.16.4",
"@hookform/resolvers": "^3.9.1",
"@ignf/react-dsfr-tiptap": "^0.0.0",
"@tiptap/extension-color": "^2.10.4",
"@tiptap/extension-highlight": "^2.10.4",
"@tiptap/extension-subscript": "^2.10.4",
Expand All @@ -25,7 +26,6 @@
"@tiptap/extension-underline": "^2.10.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-dsfr-tiptap": "^0.0.0",
"react-hook-form": "^7.54.1",
"tiptap-markdown": "^0.8.10",
"tss-react": "^4.9.14",
Expand Down
4 changes: 2 additions & 2 deletions examples/src/Custom.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import { RichTextEditor } from "react-dsfr-tiptap";
import { ControlImage, ControlLink, ControlUnlink, ControlYoutube } from "react-dsfr-tiptap/dialog";
import { RichTextEditor } from "@ignf/react-dsfr-tiptap";
import { ControlImage, ControlLink, ControlUnlink, ControlYoutube } from "@ignf/react-dsfr-tiptap/dialog";
import StarterKit from "@tiptap/starter-kit";
import Link from "@tiptap/extension-link";

Expand Down
4 changes: 2 additions & 2 deletions examples/src/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import { ControlImage, ControlLink, ControlUnlink } from "react-dsfr-tiptap/dialog";
import { MarkdownEditor } from "react-dsfr-tiptap/markdown";
import { ControlImage, ControlLink, ControlUnlink } from "@ignf/react-dsfr-tiptap/dialog";
import { MarkdownEditor } from "@ignf/react-dsfr-tiptap/markdown";

const initialContent = `
# Tiptap Editor
Expand Down
5 changes: 3 additions & 2 deletions examples/src/Tiptap.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useState } from "react";

import { RichTextEditor } from "react-dsfr-tiptap";
import { ControlImage, ControlLink, ControlUnlink, ControlYoutube } from "react-dsfr-tiptap/dialog";
import { RichTextEditor } from "@ignf/react-dsfr-tiptap";
import { ControlImage, ControlLink, ControlUnlink, ControlYoutube } from "@ignf/react-dsfr-tiptap/dialog";

import { CustomControl1, CustomControl2, CustomControl3 } from "./TiptapCustomButtons";

const initialContent = `
Expand Down
4 changes: 2 additions & 2 deletions examples/src/TiptapCustomButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Select } from "@codegouvfr/react-dsfr/Select";
import { useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
import { createControl, createDialogControl, useEditor } from "react-dsfr-tiptap";
import { useDialog } from "react-dsfr-tiptap/dialog";
import { createControl, createDialogControl, useEditor } from "@ignf/react-dsfr-tiptap";
import { useDialog } from "@ignf/react-dsfr-tiptap/dialog";

// 1. Create the component yourself: use the hook `useRichTextEditor` to access the editor object
export function CustomControl1() {
Expand Down
357 changes: 184 additions & 173 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions packages/react-dsfr-tiptap/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# react-dsfr-tiptap
# `@ignf/react-dsfr-tiptap`

Composant de texte riche React pour le [System de design du gouvernement français (alias DSFR) 🇫🇷](https://www.systeme-de-design.gouv.fr/).

Expand All @@ -21,7 +21,7 @@ Ce dépôt contient :
Pour installer ce package dans votre projet React lancez la commande:

```bash
npm i react-dsfr-tiptap
npm i @ignf/react-dsfr-tiptap
```

(ou installez avec le package manager de votre choix)
Expand Down Expand Up @@ -50,7 +50,7 @@ npm i tiptap-markdown
Une fois installée vous pouvez utilisé le composant `RichTextEditor` de cette manière:

```tsx
import { RichTextEditor } from "react-dsfr-tiptap";
import { RichTextEditor } from "@ignf/react-dsfr-tiptap";

function MyComponent() {
const [content, setContent] = useState(`<h2>Content title</h2>`);
Expand All @@ -65,10 +65,10 @@ function MyComponent() {

### Editeur Markdown

Utilisez l'éditeur markdown en important le composant `MarkdownEditor` depuis `react-dsfr-tiptap/markdown`
Utilisez l'éditeur markdown en important le composant `MarkdownEditor` depuis `@ignf/react-dsfr-tiptap/markdown`

```tsx
import { MarkdownEditor } from "react-dsfr-tiptap/markdown";
import { MarkdownEditor } from "@ignf/react-dsfr-tiptap/markdown";

function MyComponent() {
const [content, setContent] = useState(`## Markdown title`);
Expand All @@ -87,7 +87,7 @@ Vous pouvez également utiliser les composants de plus bas niveau pour construir

```tsx
import StarterKit from "@tiptap/starter-kit";
import { RichTextEditor } from "react-dsfr-tiptap";
import { RichTextEditor } from "@ignf/react-dsfr-tiptap";

function MyComponent() {
const [content, setContent] = useState(`## Markdown title`);
Expand Down Expand Up @@ -145,8 +145,8 @@ npm i react-hook-form @hookform/resolvers yup validator
et activez les boutons dans le menu via la props `controlMap`:

```tsx
import { RichTextEditor } from "react-dsfr-tiptap";
import { ControlImage, ControlLink, ControlUnlink, ControlYoutube } from "react-dsfr-tiptap/dialog";
import { RichTextEditor } from "@ignf/react-dsfr-tiptap";
import { ControlImage, ControlLink, ControlUnlink, ControlYoutube } from "@ignf/react-dsfr-tiptap/dialog";

function MyComponent() {
const [content, setContent] = useState(`<h2>Content title</h2>`);
Expand Down Expand Up @@ -222,7 +222,7 @@ Exemple de bouton:
```tsx
import { Editor, useEditorState } from "@tiptap/react";
import Button from "@codegouvfr/react-dsfr/Button";
import { useEditor } from "react-dsfr-tiptap";
import { useEditor } from "@ignf/react-dsfr-tiptap";
export default function CustomControl() {
const editor = useEditor();
Expand All @@ -249,7 +249,7 @@ export default function CustomControl() {
Dans ce cas vous pouvez ajoutez votre bouton personnalisé via la props `controls`:

```tsx
import { RichTextEditor } from "react-dsfr-tiptap";
import { RichTextEditor } from "@ignf/react-dsfr-tiptap";
import CustomControl from "./CustomControl";
function MyComponent() {
Expand Down Expand Up @@ -283,7 +283,7 @@ Dans ce cas il vous faudra fournir la liste complète des contrôles.
Vous pouvez aussi utilisez les utilitaires suivants pour faciliter la création de boutons personalisées:

```tsx
import { createControl } from "react-dsfr-tiptap";
import { createControl } from "@ignf/react-dsfr-tiptap";
export default createControl({
buttonProps: { children: "Insérer du contenu" },
Expand All @@ -298,7 +298,7 @@ De la même manière il suffira ensuite de l'ajouter à la props `controls` du c
Il y a également un utilitaire pour créer un bouton qui ouvre une modale:

```tsx
import { createDialogControl } from "react-dsfr-tiptap";
import { createDialogControl } from "@ignf/react-dsfr-tiptap";
export default createDialogControl({
buttonProps: { children: "Insérer du contenu" },
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dsfr-tiptap/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-dsfr-tiptap",
"name": "@ignf/react-dsfr-tiptap",
"private": true,
"version": "0.0.0",
"description": "React Tiptap component for dsfr design system",
Expand Down

0 comments on commit b596700

Please sign in to comment.