From 803e49f7876442f23e09d07cb4060436f993723d Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Wed, 16 Dec 2020 16:41:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20D=C3=A9place=20le=20site=20publi?= =?UTF-8?q?codes=20dans=20le=20bon=20r=C3=A9pertoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Déplace: mon-entreprise/source/sites/publi.codes → publicodes/site mon-entreprise/source/sites/mon-entreprise.fr → mon-entreprise/source/site La config Webpack du site publicodes reste encore liée à celle de mon-entreprise.fr, il faudra la dissocier quand nous déplacerons le projet publicodes dans son propre dépôt. --- .../source/components/SchemeComparaison.tsx | 2 +- .../components/utils/SitePathsContext.tsx | 2 +- .../source/components/utils/markdown.tsx | 13 +- mon-entreprise/source/server.js | 3 +- .../{sites/mon-entreprise.fr => site}/App.css | 0 .../{sites/mon-entreprise.fr => site}/App.tsx | 8 +- .../mon-entreprise.fr => site}/entry.en.tsx | 6 +- .../mon-entreprise.fr => site}/entry.fr.tsx | 2 +- .../favicon/android-chrome-192x192.png | Bin .../favicon/android-chrome-512x512.png | Bin .../favicon/apple-touch-icon.png | Bin .../favicon/browserconfig.xml | 0 .../favicon/favicon-16x16.png | Bin .../favicon/favicon-32x32.png | Bin .../favicon/favicon.ico | Bin .../favicon/mstile-150x150.png | Bin .../favicon/safari-pinned-tab.svg | 0 .../iframe-integration-script.js | 0 .../layout/Footer/Contact.tsx | 0 .../layout/Footer/Footer.css | 0 .../layout/Footer/Footer.tsx | 2 +- .../layout/Footer/Privacy.tsx | 0 .../layout/Header.tsx | 0 .../layout/NewsBanner.tsx | 2 +- .../middlewares/trackSimulatorActions.ts | 0 .../pages/Budget/Budget.tsx | 0 .../pages/Budget/budget.md | 0 .../pages/Budget/budget.yaml | 0 .../pages/Créer/AfterRegistration.tsx | 0 .../pages/Créer/CreationChecklist.tsx | 0 .../Créer/GuideStatut/AutoEntrepreneur.tsx | 0 .../Créer/GuideStatut/DirectorStatus.tsx | 0 .../Créer/GuideStatut/MinorityDirector.tsx | 0 .../Créer/GuideStatut/NumberOfAssociate.tsx | 0 .../Créer/GuideStatut/PickLegalStatus.tsx | 0 .../Créer/GuideStatut/PreviousAnswers.tsx | 0 .../Créer/GuideStatut/SoleProprietorship.tsx | 0 .../pages/Créer/GuideStatut/index.tsx | 0 .../pages/Créer/Guide_Auto-Entrepreneur.pdf | Bin .../pages/Créer/Home.tsx | 0 .../pages/Créer/StatutDescription.tsx | 0 .../pages/Créer/créer.svg | 0 .../pages/Créer/index.tsx | 0 .../pages/Créer/siret.jpg | Bin .../pages/Dev/ColorPicker.tsx | 0 .../pages/Dev/IntegrationTest.tsx | 0 .../pages/Dev/Personas.tsx | 0 .../pages/Dev/Sitemap.tsx | 0 .../pages/Documentation.tsx | 0 .../AideDéclarationIndépendant/config.yaml | 0 .../AideDéclarationIndépendant/index.tsx | 0 .../pages/Gérer/AideOrganismeLocal.tsx | 0 .../pages/Gérer/DemandeMobilite/EndBlock.tsx | 0 .../pages/Gérer/DemandeMobilite/FieldsPDF.tsx | 0 .../DemandeMobilite/Montserrat-SemiBold.ttf | Bin .../Gérer/DemandeMobilite/PDFDocument.tsx | 0 .../Gérer/DemandeMobilite/Roboto-Regular.ttf | Bin .../formulaire-détachement.yaml | 0 .../pages/Gérer/DemandeMobilite/index.tsx | 2 +- .../pages/Gérer/Embaucher.tsx | 0 .../pages/Gérer/Home.tsx | 0 .../pages/Gérer/SchemeSelection.tsx | 0 .../pages/Gérer/SécuritéSociale.tsx | 0 .../pages/Gérer/Video.tsx | 0 .../pages/Gérer/aideOrganisme.svg | 0 .../pages/Gérer/businessPlan.svg | 0 .../pages/Gérer/index.tsx | 0 .../pages/Iframes/IframeFooter.tsx | 0 .../pages/Iframes/index.tsx | 2 +- .../pages/Landing/Landing.css | 0 .../pages/Landing/Landing.tsx | 0 .../pages/Landing/illustration.svg | 0 .../pages/Nouveautés/Nouveautés.tsx | 0 .../pages/Simulateurs/ArtisteAuteur.tsx | 0 .../pages/Simulateurs/ChômagePartiel.tsx | 0 .../pages/Simulateurs/Home.tsx | 0 .../Simulateurs/IndépendantSimulation.tsx | 0 .../pages/Simulateurs/PAMCHome.tsx | 0 .../pages/Simulateurs/Page.tsx | 0 .../pages/Simulateurs/SalariéSimulation.tsx | 0 .../pages/Simulateurs/SchemeComparaison.tsx | 0 .../Simulateurs/configs/artiste-auteur.yaml | 0 .../configs/auto-entrepreneur.yaml | 0 .../Simulateurs/configs/chômage-partiel.yaml | 0 .../Simulateurs/configs/dirigeant-sasu.yaml | 0 .../Simulateurs/configs/indépendant.yaml | 0 .../configs/profession-libérale.yaml | 0 .../configs/rémunération-dirigeant.yaml | 0 .../pages/Simulateurs/configs/salarié.yaml | 0 .../images/AutoEntrepreneurPreview.png | Bin .../images/ChômagePartielPreview.png | Bin .../images/RémunérationSASUPreview.png | Bin .../images/SalaireBrutNetPreviewEN.png | Bin .../images/SalaireBrutNetPreviewFR.png | Bin .../images/illustration-net-brut-en.png | Bin .../images/illustration-net-brut.png | Bin .../images/illustration-simulateur.svg | 0 .../pages/Simulateurs/index.tsx | 0 .../pages/Simulateurs/metadata.tsx | 0 .../ÉconomieCollaborative/Activité.tsx | 0 .../ActivitésSelection.tsx | 2 +- .../ExceptionsExonération.tsx | 0 .../ÉconomieCollaborative/NextButton.tsx | 0 .../ÉconomieCollaborative/StoreContext.tsx | 0 .../ÉconomieCollaborative/VotreSituation.tsx | 0 .../ÉconomieCollaborative/actions.ts | 0 .../ÉconomieCollaborative/activités.en.yaml | 0 .../ÉconomieCollaborative/activités.yaml | 0 .../ÉconomieCollaborative/activitésData.ts | 0 .../ÉconomieCollaborative/images/car.svg | 0 .../images/checklist.svg | 0 .../images/multitasking.svg | 0 .../images/pizzaSharing.svg | 0 .../ÉconomieCollaborative/index.tsx | 0 .../ÉconomieCollaborative/reducer.ts | 0 .../ÉconomieCollaborative/selectors.js | 0 .../pages/Stats/LazyStats.tsx | 0 .../pages/Stats/Stats.tsx | 4 +- .../pages/integration/Iframe.tsx | 0 .../pages/integration/Library.tsx | 0 .../pages/integration/Options.tsx | 0 .../pages/integration/iframe.css | 0 .../pages/integration/illustration.png | Bin .../pages/integration/images/apec.png | Bin .../pages/integration/images/cci.png | Bin .../integration/images/logo-betagouv.svg | 0 .../pages/integration/images/min-tra.jpg | Bin .../pages/integration/images/pole-emploi.png | Bin .../pages/integration/index.tsx | 0 .../mon-entreprise.fr => site}/redirects.js | 2 +- .../mon-entreprise.fr => site}/robots.txt | 0 .../mon-entreprise.fr => site}/sitePaths.ts | 0 .../mon-entreprise.fr => site}/sitemap.en.txt | 0 .../mon-entreprise.fr => site}/sitemap.fr.txt | 0 .../source/sites/publi.codes/Communauté.tsx | 16 -- .../test/regressions/simulations.jest.js | 14 +- mon-entreprise/webpack.common.js | 16 +- package.json | 1 + publicodes/react/package.json | 12 +- .../site/components}/App.tsx | 8 +- .../site/components}/Header.tsx | 1 - .../site/components}/LazyStudio.tsx | 0 publicodes/site/components/Provider.tsx | 64 +++++ publicodes/site/components/Scroll.tsx | 92 +++++++ .../site/components}/Studio.tsx | 22 +- .../site}/components/SyntaxHighlighter.tsx | 0 publicodes/site/components/colors.tsx | 127 ++++++++++ publicodes/site/components/markdown.tsx | 230 ++++++++++++++++++ .../publi.codes => publicodes/site}/entry.tsx | 5 +- publicodes/site/package.json | 18 ++ .../site/pages}/Api.tsx | 8 +- publicodes/site/pages/Communauté.tsx | 14 ++ .../site/pages}/Documentation.tsx | 12 +- .../site/pages}/Landing.tsx | 6 +- .../site/pages}/Mécanismes.tsx | 10 +- publicodes/site/tsconfig.json | 7 + publicodes/site/types/css-prop.d.ts | 1 + publicodes/site/types/import-markdown.d.ts | 9 + yarn.lock | 26 ++ 159 files changed, 681 insertions(+), 90 deletions(-) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/App.css (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/App.tsx (96%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/entry.en.tsx (78%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/entry.fr.tsx (92%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/android-chrome-192x192.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/android-chrome-512x512.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/apple-touch-icon.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/browserconfig.xml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/favicon-16x16.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/favicon-32x32.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/favicon.ico (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/mstile-150x150.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/favicon/safari-pinned-tab.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/iframe-integration-script.js (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/layout/Footer/Contact.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/layout/Footer/Footer.css (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/layout/Footer/Footer.tsx (98%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/layout/Footer/Privacy.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/layout/Header.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/layout/NewsBanner.tsx (95%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/middlewares/trackSimulatorActions.ts (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Budget/Budget.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Budget/budget.md (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Budget/budget.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/AfterRegistration.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/CreationChecklist.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/AutoEntrepreneur.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/DirectorStatus.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/MinorityDirector.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/NumberOfAssociate.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/PickLegalStatus.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/PreviousAnswers.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/SoleProprietorship.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/GuideStatut/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/Guide_Auto-Entrepreneur.pdf (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/Home.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/StatutDescription.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/créer.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Créer/siret.jpg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Dev/ColorPicker.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Dev/IntegrationTest.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Dev/Personas.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Dev/Sitemap.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Documentation.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/AideDéclarationIndépendant/config.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/AideDéclarationIndépendant/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/AideOrganismeLocal.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/EndBlock.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/FieldsPDF.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/Montserrat-SemiBold.ttf (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/PDFDocument.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/Roboto-Regular.ttf (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/formulaire-détachement.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/DemandeMobilite/index.tsx (99%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/Embaucher.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/Home.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/SchemeSelection.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/SécuritéSociale.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/Video.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/aideOrganisme.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/businessPlan.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Gérer/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Iframes/IframeFooter.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Iframes/index.tsx (96%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Landing/Landing.css (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Landing/Landing.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Landing/illustration.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Nouveautés/Nouveautés.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ArtisteAuteur.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ChômagePartiel.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/Home.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/IndépendantSimulation.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/PAMCHome.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/Page.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/SalariéSimulation.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/SchemeComparaison.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/artiste-auteur.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/auto-entrepreneur.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/chômage-partiel.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/dirigeant-sasu.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/indépendant.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/profession-libérale.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/rémunération-dirigeant.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/configs/salarié.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/AutoEntrepreneurPreview.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/ChômagePartielPreview.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/RémunérationSASUPreview.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/SalaireBrutNetPreviewEN.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/SalaireBrutNetPreviewFR.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/illustration-net-brut-en.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/illustration-net-brut.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/images/illustration-simulateur.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/metadata.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/Activité.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx (99%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/ExceptionsExonération.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/NextButton.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/StoreContext.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/VotreSituation.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/actions.ts (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/activités.en.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/activités.yaml (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/activitésData.ts (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/images/car.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/images/checklist.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/images/multitasking.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/images/pizzaSharing.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/reducer.ts (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Simulateurs/ÉconomieCollaborative/selectors.js (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Stats/LazyStats.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/Stats/Stats.tsx (98%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/Iframe.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/Library.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/Options.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/iframe.css (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/illustration.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/images/apec.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/images/cci.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/images/logo-betagouv.svg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/images/min-tra.jpg (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/images/pole-emploi.png (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/pages/integration/index.tsx (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/redirects.js (86%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/robots.txt (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/sitePaths.ts (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/sitemap.en.txt (100%) rename mon-entreprise/source/{sites/mon-entreprise.fr => site}/sitemap.fr.txt (100%) delete mode 100644 mon-entreprise/source/sites/publi.codes/Communauté.tsx rename {mon-entreprise/source/sites/publi.codes => publicodes/site/components}/App.tsx (87%) rename {mon-entreprise/source/sites/publi.codes => publicodes/site/components}/Header.tsx (98%) rename {mon-entreprise/source/sites/publi.codes => publicodes/site/components}/LazyStudio.tsx (100%) create mode 100644 publicodes/site/components/Provider.tsx create mode 100644 publicodes/site/components/Scroll.tsx rename {mon-entreprise/source/sites/publi.codes => publicodes/site/components}/Studio.tsx (89%) rename {mon-entreprise/source => publicodes/site}/components/SyntaxHighlighter.tsx (100%) create mode 100644 publicodes/site/components/colors.tsx create mode 100644 publicodes/site/components/markdown.tsx rename {mon-entreprise/source/sites/publi.codes => publicodes/site}/entry.tsx (51%) create mode 100644 publicodes/site/package.json rename {mon-entreprise/source/sites/publi.codes => publicodes/site/pages}/Api.tsx (75%) create mode 100644 publicodes/site/pages/Communauté.tsx rename {mon-entreprise/source/sites/publi.codes => publicodes/site/pages}/Documentation.tsx (73%) rename {mon-entreprise/source/sites/publi.codes => publicodes/site/pages}/Landing.tsx (63%) rename {mon-entreprise/source/sites/publi.codes => publicodes/site/pages}/Mécanismes.tsx (85%) create mode 100644 publicodes/site/tsconfig.json create mode 100644 publicodes/site/types/css-prop.d.ts create mode 100644 publicodes/site/types/import-markdown.d.ts diff --git a/mon-entreprise/source/components/SchemeComparaison.tsx b/mon-entreprise/source/components/SchemeComparaison.tsx index 998f6c639..76e61073e 100644 --- a/mon-entreprise/source/components/SchemeComparaison.tsx +++ b/mon-entreprise/source/components/SchemeComparaison.tsx @@ -7,7 +7,7 @@ import classnames from 'classnames' import Conversation from 'Components/conversation/Conversation' import SeeAnswersButton from 'Components/conversation/SeeAnswersButton' import Value from 'Components/EngineValue' -import dirigeantComparaison from '../sites/mon-entreprise.fr/pages/Simulateurs/configs/rémunération-dirigeant.yaml' +import dirigeantComparaison from '../site/pages/Simulateurs/configs/rémunération-dirigeant.yaml' import Engine from 'publicodes' import revenusSVG from 'Images/revenus.svg' import { useCallback, useMemo, useState, useEffect } from 'react' diff --git a/mon-entreprise/source/components/utils/SitePathsContext.tsx b/mon-entreprise/source/components/utils/SitePathsContext.tsx index 0b6f71f9f..8899b41df 100644 --- a/mon-entreprise/source/components/utils/SitePathsContext.tsx +++ b/mon-entreprise/source/components/utils/SitePathsContext.tsx @@ -1,5 +1,5 @@ import { createContext } from 'react' -import { SitePathsType } from 'sites/mon-entreprise.fr/sitePaths' +import { SitePathsType } from 'site/sitePaths' export const SitePathsContext = createContext( {} as SitePathsType diff --git a/mon-entreprise/source/components/utils/markdown.tsx b/mon-entreprise/source/components/utils/markdown.tsx index 0ebd24f85..fc3404e6f 100644 --- a/mon-entreprise/source/components/utils/markdown.tsx +++ b/mon-entreprise/source/components/utils/markdown.tsx @@ -65,7 +65,6 @@ type MarkdownProps = ReactMarkdownProps & { className?: string } -const LazySyntaxHighlighter = React.lazy(() => import('../SyntaxHighlighter')) const CodeBlock = ({ value, language, @@ -78,15 +77,9 @@ const CodeBlock = ({ position: relative; `} > - - {value} - - } - > - - +
+			{value}
+		
{language === 'yaml' && ( ({ app.get('/', function (req, res) { res.send(``) +
  • intégration du simulateur sur site tiers [iframe fr]
  • +
  • publicodes
  • `) }) app.use( diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/App.css b/mon-entreprise/source/site/App.css similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/App.css rename to mon-entreprise/source/site/App.css diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/App.tsx b/mon-entreprise/source/site/App.tsx similarity index 96% rename from mon-entreprise/source/sites/mon-entreprise.fr/App.tsx rename to mon-entreprise/source/site/App.tsx index 1e35b7ca6..d9703fe36 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/App.tsx +++ b/mon-entreprise/source/site/App.tsx @@ -19,16 +19,16 @@ import { configSituationSelector, situationSelector, } from 'Selectors/simulationSelectors' -import Provider, { ProviderProps } from '../../Provider' +import Provider, { ProviderProps } from '../Provider' import { persistEverything, retrievePersistedState, -} from '../../storage/persistEverything' +} from '../storage/persistEverything' import { persistSimulation, retrievePersistedSimulation, -} from '../../storage/persistSimulation' -import Tracker, { devTracker } from '../../Tracker' +} from '../storage/persistSimulation' +import Tracker, { devTracker } from '../Tracker' import './App.css' import Footer from './layout/Footer/Footer' import Header from './layout/Header' diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/entry.en.tsx b/mon-entreprise/source/site/entry.en.tsx similarity index 78% rename from mon-entreprise/source/sites/mon-entreprise.fr/entry.en.tsx rename to mon-entreprise/source/site/entry.en.tsx index 4c13e2401..29697c293 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/entry.en.tsx +++ b/mon-entreprise/source/site/entry.en.tsx @@ -4,9 +4,9 @@ import { translateRules } from 'publicodes' import { render } from 'react-dom' import 'regenerator-runtime/runtime' import rules from 'modele-social' -import i18next from '../../i18n' -import translations from '../../locales/ui-en.yaml' -import ruleTranslations from '../../locales/rules-en.yaml' +import i18next from '../i18n' +import translations from '../locales/ui-en.yaml' +import ruleTranslations from '../locales/rules-en.yaml' import App from './App' i18next.addResourceBundle('en', 'translation', translations) diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/entry.fr.tsx b/mon-entreprise/source/site/entry.fr.tsx similarity index 92% rename from mon-entreprise/source/sites/mon-entreprise.fr/entry.fr.tsx rename to mon-entreprise/source/site/entry.fr.tsx index 8767966fd..7aa84e014 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/entry.fr.tsx +++ b/mon-entreprise/source/site/entry.fr.tsx @@ -5,7 +5,7 @@ import { render } from 'react-dom' import 'regenerator-runtime/runtime' import rules from 'modele-social' import App from './App' -import i18next from '../../i18n' +import i18next from '../i18n' i18next.changeLanguage('fr') diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/android-chrome-192x192.png b/mon-entreprise/source/site/favicon/android-chrome-192x192.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/android-chrome-192x192.png rename to mon-entreprise/source/site/favicon/android-chrome-192x192.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/android-chrome-512x512.png b/mon-entreprise/source/site/favicon/android-chrome-512x512.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/android-chrome-512x512.png rename to mon-entreprise/source/site/favicon/android-chrome-512x512.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/apple-touch-icon.png b/mon-entreprise/source/site/favicon/apple-touch-icon.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/apple-touch-icon.png rename to mon-entreprise/source/site/favicon/apple-touch-icon.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/browserconfig.xml b/mon-entreprise/source/site/favicon/browserconfig.xml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/browserconfig.xml rename to mon-entreprise/source/site/favicon/browserconfig.xml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/favicon-16x16.png b/mon-entreprise/source/site/favicon/favicon-16x16.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/favicon-16x16.png rename to mon-entreprise/source/site/favicon/favicon-16x16.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/favicon-32x32.png b/mon-entreprise/source/site/favicon/favicon-32x32.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/favicon-32x32.png rename to mon-entreprise/source/site/favicon/favicon-32x32.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/favicon.ico b/mon-entreprise/source/site/favicon/favicon.ico similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/favicon.ico rename to mon-entreprise/source/site/favicon/favicon.ico diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/mstile-150x150.png b/mon-entreprise/source/site/favicon/mstile-150x150.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/mstile-150x150.png rename to mon-entreprise/source/site/favicon/mstile-150x150.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/favicon/safari-pinned-tab.svg b/mon-entreprise/source/site/favicon/safari-pinned-tab.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/favicon/safari-pinned-tab.svg rename to mon-entreprise/source/site/favicon/safari-pinned-tab.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/iframe-integration-script.js b/mon-entreprise/source/site/iframe-integration-script.js similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/iframe-integration-script.js rename to mon-entreprise/source/site/iframe-integration-script.js diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Contact.tsx b/mon-entreprise/source/site/layout/Footer/Contact.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Contact.tsx rename to mon-entreprise/source/site/layout/Footer/Contact.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.css b/mon-entreprise/source/site/layout/Footer/Footer.css similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.css rename to mon-entreprise/source/site/layout/Footer/Footer.css diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx b/mon-entreprise/source/site/layout/Footer/Footer.tsx similarity index 98% rename from mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx rename to mon-entreprise/source/site/layout/Footer/Footer.tsx index 805c4a28b..86809fe1f 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Footer.tsx +++ b/mon-entreprise/source/site/layout/Footer/Footer.tsx @@ -9,7 +9,7 @@ import { Helmet } from 'react-helmet' import { Trans } from 'react-i18next' import { Link, useLocation } from 'react-router-dom' import useSimulatorsData from '../../pages/Simulateurs/metadata' -import i18n, { AvailableLangs } from '../../../../i18n' +import i18n, { AvailableLangs } from '../../../i18n' import { hrefLangLink } from '../../sitePaths' import './Footer.css' import Privacy from './Privacy' diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Privacy.tsx b/mon-entreprise/source/site/layout/Footer/Privacy.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/layout/Footer/Privacy.tsx rename to mon-entreprise/source/site/layout/Footer/Privacy.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/Header.tsx b/mon-entreprise/source/site/layout/Header.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/layout/Header.tsx rename to mon-entreprise/source/site/layout/Header.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx b/mon-entreprise/source/site/layout/NewsBanner.tsx similarity index 95% rename from mon-entreprise/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx rename to mon-entreprise/source/site/layout/NewsBanner.tsx index d8924ab5a..2f71e0e65 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx +++ b/mon-entreprise/source/site/layout/NewsBanner.tsx @@ -4,7 +4,7 @@ import { useContext } from 'react' import emoji from 'react-easy-emoji' import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' -import lastRelease from '../../../data/last-release.json' +import lastRelease from '../../data/last-release.json' const localStorageKey = 'last-viewed-release' diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/middlewares/trackSimulatorActions.ts b/mon-entreprise/source/site/middlewares/trackSimulatorActions.ts similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/middlewares/trackSimulatorActions.ts rename to mon-entreprise/source/site/middlewares/trackSimulatorActions.ts diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Budget/Budget.tsx b/mon-entreprise/source/site/pages/Budget/Budget.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Budget/Budget.tsx rename to mon-entreprise/source/site/pages/Budget/Budget.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Budget/budget.md b/mon-entreprise/source/site/pages/Budget/budget.md similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Budget/budget.md rename to mon-entreprise/source/site/pages/Budget/budget.md diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Budget/budget.yaml b/mon-entreprise/source/site/pages/Budget/budget.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Budget/budget.yaml rename to mon-entreprise/source/site/pages/Budget/budget.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/AfterRegistration.tsx b/mon-entreprise/source/site/pages/Créer/AfterRegistration.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/AfterRegistration.tsx rename to mon-entreprise/source/site/pages/Créer/AfterRegistration.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/CreationChecklist.tsx b/mon-entreprise/source/site/pages/Créer/CreationChecklist.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/CreationChecklist.tsx rename to mon-entreprise/source/site/pages/Créer/CreationChecklist.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/AutoEntrepreneur.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/AutoEntrepreneur.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/AutoEntrepreneur.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/AutoEntrepreneur.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/DirectorStatus.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/DirectorStatus.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/DirectorStatus.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/DirectorStatus.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/MinorityDirector.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/MinorityDirector.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/MinorityDirector.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/MinorityDirector.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/NumberOfAssociate.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/NumberOfAssociate.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/NumberOfAssociate.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/NumberOfAssociate.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/PickLegalStatus.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/PickLegalStatus.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/PickLegalStatus.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/PickLegalStatus.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/PreviousAnswers.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/PreviousAnswers.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/PreviousAnswers.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/PreviousAnswers.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/SoleProprietorship.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/SoleProprietorship.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/SoleProprietorship.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/SoleProprietorship.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/index.tsx b/mon-entreprise/source/site/pages/Créer/GuideStatut/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/GuideStatut/index.tsx rename to mon-entreprise/source/site/pages/Créer/GuideStatut/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/Guide_Auto-Entrepreneur.pdf b/mon-entreprise/source/site/pages/Créer/Guide_Auto-Entrepreneur.pdf similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/Guide_Auto-Entrepreneur.pdf rename to mon-entreprise/source/site/pages/Créer/Guide_Auto-Entrepreneur.pdf diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/Home.tsx b/mon-entreprise/source/site/pages/Créer/Home.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/Home.tsx rename to mon-entreprise/source/site/pages/Créer/Home.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/StatutDescription.tsx b/mon-entreprise/source/site/pages/Créer/StatutDescription.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/StatutDescription.tsx rename to mon-entreprise/source/site/pages/Créer/StatutDescription.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/créer.svg b/mon-entreprise/source/site/pages/Créer/créer.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/créer.svg rename to mon-entreprise/source/site/pages/Créer/créer.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/index.tsx b/mon-entreprise/source/site/pages/Créer/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/index.tsx rename to mon-entreprise/source/site/pages/Créer/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/siret.jpg b/mon-entreprise/source/site/pages/Créer/siret.jpg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Créer/siret.jpg rename to mon-entreprise/source/site/pages/Créer/siret.jpg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/ColorPicker.tsx b/mon-entreprise/source/site/pages/Dev/ColorPicker.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/ColorPicker.tsx rename to mon-entreprise/source/site/pages/Dev/ColorPicker.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/IntegrationTest.tsx b/mon-entreprise/source/site/pages/Dev/IntegrationTest.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/IntegrationTest.tsx rename to mon-entreprise/source/site/pages/Dev/IntegrationTest.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/Personas.tsx b/mon-entreprise/source/site/pages/Dev/Personas.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/Personas.tsx rename to mon-entreprise/source/site/pages/Dev/Personas.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/Sitemap.tsx b/mon-entreprise/source/site/pages/Dev/Sitemap.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Dev/Sitemap.tsx rename to mon-entreprise/source/site/pages/Dev/Sitemap.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Documentation.tsx b/mon-entreprise/source/site/pages/Documentation.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Documentation.tsx rename to mon-entreprise/source/site/pages/Documentation.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/AideDéclarationIndépendant/config.yaml b/mon-entreprise/source/site/pages/Gérer/AideDéclarationIndépendant/config.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/AideDéclarationIndépendant/config.yaml rename to mon-entreprise/source/site/pages/Gérer/AideDéclarationIndépendant/config.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/AideDéclarationIndépendant/index.tsx b/mon-entreprise/source/site/pages/Gérer/AideDéclarationIndépendant/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/AideDéclarationIndépendant/index.tsx rename to mon-entreprise/source/site/pages/Gérer/AideDéclarationIndépendant/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/AideOrganismeLocal.tsx b/mon-entreprise/source/site/pages/Gérer/AideOrganismeLocal.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/AideOrganismeLocal.tsx rename to mon-entreprise/source/site/pages/Gérer/AideOrganismeLocal.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/EndBlock.tsx b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/EndBlock.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/EndBlock.tsx rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/EndBlock.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/FieldsPDF.tsx b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/FieldsPDF.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/FieldsPDF.tsx rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/FieldsPDF.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/Montserrat-SemiBold.ttf b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/Montserrat-SemiBold.ttf similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/Montserrat-SemiBold.ttf rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/Montserrat-SemiBold.ttf diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/PDFDocument.tsx b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/PDFDocument.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/PDFDocument.tsx rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/PDFDocument.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/Roboto-Regular.ttf b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/Roboto-Regular.ttf similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/Roboto-Regular.ttf rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/Roboto-Regular.ttf diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/formulaire-détachement.yaml b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/formulaire-détachement.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/formulaire-détachement.yaml rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/formulaire-détachement.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/index.tsx b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/index.tsx similarity index 99% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/index.tsx rename to mon-entreprise/source/site/pages/Gérer/DemandeMobilite/index.tsx index 1ca7c46a2..4d02fbde6 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/DemandeMobilite/index.tsx +++ b/mon-entreprise/source/site/pages/Gérer/DemandeMobilite/index.tsx @@ -16,7 +16,7 @@ import { useContext, } from 'react' import emoji from 'react-easy-emoji' -import { hash } from '../../../../../utils' +import { hash } from '../../../../utils' import formulaire from './formulaire-détachement.yaml' const LazyEndBlock = lazy(() => import('./EndBlock')) diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/Embaucher.tsx b/mon-entreprise/source/site/pages/Gérer/Embaucher.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/Embaucher.tsx rename to mon-entreprise/source/site/pages/Gérer/Embaucher.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/Home.tsx b/mon-entreprise/source/site/pages/Gérer/Home.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/Home.tsx rename to mon-entreprise/source/site/pages/Gérer/Home.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/SchemeSelection.tsx b/mon-entreprise/source/site/pages/Gérer/SchemeSelection.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/SchemeSelection.tsx rename to mon-entreprise/source/site/pages/Gérer/SchemeSelection.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/SécuritéSociale.tsx b/mon-entreprise/source/site/pages/Gérer/SécuritéSociale.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/SécuritéSociale.tsx rename to mon-entreprise/source/site/pages/Gérer/SécuritéSociale.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/Video.tsx b/mon-entreprise/source/site/pages/Gérer/Video.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/Video.tsx rename to mon-entreprise/source/site/pages/Gérer/Video.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/aideOrganisme.svg b/mon-entreprise/source/site/pages/Gérer/aideOrganisme.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/aideOrganisme.svg rename to mon-entreprise/source/site/pages/Gérer/aideOrganisme.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/businessPlan.svg b/mon-entreprise/source/site/pages/Gérer/businessPlan.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/businessPlan.svg rename to mon-entreprise/source/site/pages/Gérer/businessPlan.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/index.tsx b/mon-entreprise/source/site/pages/Gérer/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Gérer/index.tsx rename to mon-entreprise/source/site/pages/Gérer/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Iframes/IframeFooter.tsx b/mon-entreprise/source/site/pages/Iframes/IframeFooter.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Iframes/IframeFooter.tsx rename to mon-entreprise/source/site/pages/Iframes/IframeFooter.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Iframes/index.tsx b/mon-entreprise/source/site/pages/Iframes/index.tsx similarity index 96% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Iframes/index.tsx rename to mon-entreprise/source/site/pages/Iframes/index.tsx index fd1dcc109..c66da7637 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Iframes/index.tsx +++ b/mon-entreprise/source/site/pages/Iframes/index.tsx @@ -1,6 +1,6 @@ import { IsEmbeddedContext } from 'Components/utils/embeddedContext' import { Route, Switch } from 'react-router-dom' -import { inIframe } from '../../../../utils' +import { inIframe } from '../../../utils' import useSimulatorsData from '../Simulateurs/metadata' import SimulateurPage from '../Simulateurs/Page' import IframeFooter from './IframeFooter' diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Landing/Landing.css b/mon-entreprise/source/site/pages/Landing/Landing.css similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Landing/Landing.css rename to mon-entreprise/source/site/pages/Landing/Landing.css diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Landing/Landing.tsx b/mon-entreprise/source/site/pages/Landing/Landing.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Landing/Landing.tsx rename to mon-entreprise/source/site/pages/Landing/Landing.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Landing/illustration.svg b/mon-entreprise/source/site/pages/Landing/illustration.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Landing/illustration.svg rename to mon-entreprise/source/site/pages/Landing/illustration.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Nouveautés/Nouveautés.tsx b/mon-entreprise/source/site/pages/Nouveautés/Nouveautés.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Nouveautés/Nouveautés.tsx rename to mon-entreprise/source/site/pages/Nouveautés/Nouveautés.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ArtisteAuteur.tsx b/mon-entreprise/source/site/pages/Simulateurs/ArtisteAuteur.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ArtisteAuteur.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ArtisteAuteur.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ChômagePartiel.tsx b/mon-entreprise/source/site/pages/Simulateurs/ChômagePartiel.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ChômagePartiel.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ChômagePartiel.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/Home.tsx b/mon-entreprise/source/site/pages/Simulateurs/Home.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/Home.tsx rename to mon-entreprise/source/site/pages/Simulateurs/Home.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/IndépendantSimulation.tsx b/mon-entreprise/source/site/pages/Simulateurs/IndépendantSimulation.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/IndépendantSimulation.tsx rename to mon-entreprise/source/site/pages/Simulateurs/IndépendantSimulation.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/PAMCHome.tsx b/mon-entreprise/source/site/pages/Simulateurs/PAMCHome.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/PAMCHome.tsx rename to mon-entreprise/source/site/pages/Simulateurs/PAMCHome.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/Page.tsx b/mon-entreprise/source/site/pages/Simulateurs/Page.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/Page.tsx rename to mon-entreprise/source/site/pages/Simulateurs/Page.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/SalariéSimulation.tsx b/mon-entreprise/source/site/pages/Simulateurs/SalariéSimulation.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/SalariéSimulation.tsx rename to mon-entreprise/source/site/pages/Simulateurs/SalariéSimulation.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/SchemeComparaison.tsx b/mon-entreprise/source/site/pages/Simulateurs/SchemeComparaison.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/SchemeComparaison.tsx rename to mon-entreprise/source/site/pages/Simulateurs/SchemeComparaison.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/artiste-auteur.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/artiste-auteur.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/artiste-auteur.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/artiste-auteur.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/auto-entrepreneur.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/auto-entrepreneur.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/auto-entrepreneur.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/auto-entrepreneur.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/chômage-partiel.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/chômage-partiel.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/chômage-partiel.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/chômage-partiel.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/dirigeant-sasu.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/dirigeant-sasu.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/dirigeant-sasu.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/dirigeant-sasu.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/indépendant.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/indépendant.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/indépendant.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/indépendant.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/profession-libérale.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/profession-libérale.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/profession-libérale.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/profession-libérale.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/rémunération-dirigeant.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/rémunération-dirigeant.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/rémunération-dirigeant.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/rémunération-dirigeant.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/salarié.yaml b/mon-entreprise/source/site/pages/Simulateurs/configs/salarié.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/configs/salarié.yaml rename to mon-entreprise/source/site/pages/Simulateurs/configs/salarié.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/AutoEntrepreneurPreview.png b/mon-entreprise/source/site/pages/Simulateurs/images/AutoEntrepreneurPreview.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/AutoEntrepreneurPreview.png rename to mon-entreprise/source/site/pages/Simulateurs/images/AutoEntrepreneurPreview.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/ChômagePartielPreview.png b/mon-entreprise/source/site/pages/Simulateurs/images/ChômagePartielPreview.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/ChômagePartielPreview.png rename to mon-entreprise/source/site/pages/Simulateurs/images/ChômagePartielPreview.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/RémunérationSASUPreview.png b/mon-entreprise/source/site/pages/Simulateurs/images/RémunérationSASUPreview.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/RémunérationSASUPreview.png rename to mon-entreprise/source/site/pages/Simulateurs/images/RémunérationSASUPreview.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/SalaireBrutNetPreviewEN.png b/mon-entreprise/source/site/pages/Simulateurs/images/SalaireBrutNetPreviewEN.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/SalaireBrutNetPreviewEN.png rename to mon-entreprise/source/site/pages/Simulateurs/images/SalaireBrutNetPreviewEN.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/SalaireBrutNetPreviewFR.png b/mon-entreprise/source/site/pages/Simulateurs/images/SalaireBrutNetPreviewFR.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/SalaireBrutNetPreviewFR.png rename to mon-entreprise/source/site/pages/Simulateurs/images/SalaireBrutNetPreviewFR.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/illustration-net-brut-en.png b/mon-entreprise/source/site/pages/Simulateurs/images/illustration-net-brut-en.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/illustration-net-brut-en.png rename to mon-entreprise/source/site/pages/Simulateurs/images/illustration-net-brut-en.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/illustration-net-brut.png b/mon-entreprise/source/site/pages/Simulateurs/images/illustration-net-brut.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/illustration-net-brut.png rename to mon-entreprise/source/site/pages/Simulateurs/images/illustration-net-brut.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/illustration-simulateur.svg b/mon-entreprise/source/site/pages/Simulateurs/images/illustration-simulateur.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/images/illustration-simulateur.svg rename to mon-entreprise/source/site/pages/Simulateurs/images/illustration-simulateur.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/index.tsx b/mon-entreprise/source/site/pages/Simulateurs/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/index.tsx rename to mon-entreprise/source/site/pages/Simulateurs/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/metadata.tsx b/mon-entreprise/source/site/pages/Simulateurs/metadata.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/metadata.tsx rename to mon-entreprise/source/site/pages/Simulateurs/metadata.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/Activité.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/Activité.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/Activité.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/Activité.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx similarity index 99% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx index fbc98c082..1bb650f5d 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx +++ b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/ActivitésSelection.tsx @@ -9,7 +9,7 @@ import React, { useCallback, useContext } from 'react' import emoji from 'react-easy-emoji' import { Trans, useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' -import { debounce } from '../../../../../utils' +import { debounce } from '../../../../utils' import { toggleActivité } from './actions' import { Activity } from './Activité' import { activités, getTranslatedActivité } from './activitésData' diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/ExceptionsExonération.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/ExceptionsExonération.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/ExceptionsExonération.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/ExceptionsExonération.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/NextButton.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/NextButton.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/NextButton.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/NextButton.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/StoreContext.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/StoreContext.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/StoreContext.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/StoreContext.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/VotreSituation.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/VotreSituation.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/VotreSituation.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/VotreSituation.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/actions.ts b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/actions.ts similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/actions.ts rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/actions.ts diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/activités.en.yaml b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/activités.en.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/activités.en.yaml rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/activités.en.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/activités.yaml b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/activités.yaml similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/activités.yaml rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/activités.yaml diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/activitésData.ts b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/activitésData.ts similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/activitésData.ts rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/activitésData.ts diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/car.svg b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/car.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/car.svg rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/car.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/checklist.svg b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/checklist.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/checklist.svg rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/checklist.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/multitasking.svg b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/multitasking.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/multitasking.svg rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/multitasking.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/pizzaSharing.svg b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/pizzaSharing.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/images/pizzaSharing.svg rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/images/pizzaSharing.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/index.tsx b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/index.tsx rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/reducer.ts b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/reducer.ts similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/reducer.ts rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/reducer.ts diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/selectors.js b/mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/selectors.js similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Simulateurs/ÉconomieCollaborative/selectors.js rename to mon-entreprise/source/site/pages/Simulateurs/ÉconomieCollaborative/selectors.js diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Stats/LazyStats.tsx b/mon-entreprise/source/site/pages/Stats/LazyStats.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Stats/LazyStats.tsx rename to mon-entreprise/source/site/pages/Stats/LazyStats.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Stats/Stats.tsx b/mon-entreprise/source/site/pages/Stats/Stats.tsx similarity index 98% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/Stats/Stats.tsx rename to mon-entreprise/source/site/pages/Stats/Stats.tsx index 4b3b18048..3e8688d91 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/pages/Stats/Stats.tsx +++ b/mon-entreprise/source/site/pages/Stats/Stats.tsx @@ -20,8 +20,8 @@ import { YAxis, } from 'recharts' import styled from 'styled-components' -import statsJson from '../../../../data/stats.json' -import { capitalise0 } from '../../../../utils' +import statsJson from '../../../data/stats.json' +import { capitalise0 } from '../../../utils' import Privacy from '../../layout/Footer/Privacy' import useSimulatorsData from '../Simulateurs/metadata' diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Iframe.tsx b/mon-entreprise/source/site/pages/integration/Iframe.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Iframe.tsx rename to mon-entreprise/source/site/pages/integration/Iframe.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Library.tsx b/mon-entreprise/source/site/pages/integration/Library.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Library.tsx rename to mon-entreprise/source/site/pages/integration/Library.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Options.tsx b/mon-entreprise/source/site/pages/integration/Options.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/Options.tsx rename to mon-entreprise/source/site/pages/integration/Options.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/iframe.css b/mon-entreprise/source/site/pages/integration/iframe.css similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/iframe.css rename to mon-entreprise/source/site/pages/integration/iframe.css diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/illustration.png b/mon-entreprise/source/site/pages/integration/illustration.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/illustration.png rename to mon-entreprise/source/site/pages/integration/illustration.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/apec.png b/mon-entreprise/source/site/pages/integration/images/apec.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/apec.png rename to mon-entreprise/source/site/pages/integration/images/apec.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/cci.png b/mon-entreprise/source/site/pages/integration/images/cci.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/cci.png rename to mon-entreprise/source/site/pages/integration/images/cci.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/logo-betagouv.svg b/mon-entreprise/source/site/pages/integration/images/logo-betagouv.svg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/logo-betagouv.svg rename to mon-entreprise/source/site/pages/integration/images/logo-betagouv.svg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/min-tra.jpg b/mon-entreprise/source/site/pages/integration/images/min-tra.jpg similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/min-tra.jpg rename to mon-entreprise/source/site/pages/integration/images/min-tra.jpg diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/pole-emploi.png b/mon-entreprise/source/site/pages/integration/images/pole-emploi.png similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/images/pole-emploi.png rename to mon-entreprise/source/site/pages/integration/images/pole-emploi.png diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/index.tsx b/mon-entreprise/source/site/pages/integration/index.tsx similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/pages/integration/index.tsx rename to mon-entreprise/source/site/pages/integration/index.tsx diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/redirects.js b/mon-entreprise/source/site/redirects.js similarity index 86% rename from mon-entreprise/source/sites/mon-entreprise.fr/redirects.js rename to mon-entreprise/source/site/redirects.js index 267dfc282..5a0cb542c 100644 --- a/mon-entreprise/source/sites/mon-entreprise.fr/redirects.js +++ b/mon-entreprise/source/site/redirects.js @@ -1,5 +1,5 @@ import { Redirect } from 'react-router-dom' -import netlifyToml from '../../../../netlify.toml' +import netlifyToml from '../../../netlify.toml' export default netlifyToml.redirects .filter(({ from, status }) => status === 301 && !from.startsWith('https')) diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/robots.txt b/mon-entreprise/source/site/robots.txt similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/robots.txt rename to mon-entreprise/source/site/robots.txt diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/sitePaths.ts b/mon-entreprise/source/site/sitePaths.ts similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/sitePaths.ts rename to mon-entreprise/source/site/sitePaths.ts diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/sitemap.en.txt b/mon-entreprise/source/site/sitemap.en.txt similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/sitemap.en.txt rename to mon-entreprise/source/site/sitemap.en.txt diff --git a/mon-entreprise/source/sites/mon-entreprise.fr/sitemap.fr.txt b/mon-entreprise/source/site/sitemap.fr.txt similarity index 100% rename from mon-entreprise/source/sites/mon-entreprise.fr/sitemap.fr.txt rename to mon-entreprise/source/site/sitemap.fr.txt diff --git a/mon-entreprise/source/sites/publi.codes/Communauté.tsx b/mon-entreprise/source/sites/publi.codes/Communauté.tsx deleted file mode 100644 index 6569af13b..000000000 --- a/mon-entreprise/source/sites/publi.codes/Communauté.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { MarkdownWithAnchorLinks } from 'Components/utils/markdown' -import { ScrollToTop } from 'Components/utils/Scroll' -import content from '../../../../publicodes/docs/communauté.md' -import { NavLink } from 'react-router-dom' -import { Navigation } from './Header' - -export default function Landing() { - return ( -
    - -
    - -
    -
    - ) -} diff --git a/mon-entreprise/test/regressions/simulations.jest.js b/mon-entreprise/test/regressions/simulations.jest.js index aa74a9312..9301b236b 100644 --- a/mon-entreprise/test/regressions/simulations.jest.js +++ b/mon-entreprise/test/regressions/simulations.jest.js @@ -8,13 +8,13 @@ /* eslint-disable no-undef */ import Engine, { evaluateRule } from 'publicodes' import rules from 'modele-social' -import artisteAuteurConfig from '../../source/sites/mon-entreprise.fr/pages/Simulateurs/configs/artiste-auteur.yaml' -import autoentrepreneurConfig from '../../source/sites/mon-entreprise.fr/pages/Simulateurs/configs/auto-entrepreneur.yaml' -import independantConfig from '../../source/sites/mon-entreprise.fr/pages/Simulateurs/configs/indépendant.yaml' -import remunerationDirigeantConfig from '../../source/sites/mon-entreprise.fr/pages/Simulateurs/configs/rémunération-dirigeant.yaml' -import employeeConfig from '../../source/sites/mon-entreprise.fr/pages/Simulateurs/configs/salarié.yaml' -import professionLibéraleConfig from '../../source/sites/mon-entreprise.fr/pages/Simulateurs/configs/profession-libérale.yaml' -import aideDéclarationConfig from '../../source/sites/mon-entreprise.fr/pages/Gérer/AideDéclarationIndépendant/config.yaml' +import artisteAuteurConfig from '../../source/site/pages/Simulateurs/configs/artiste-auteur.yaml' +import autoentrepreneurConfig from '../../source/site/pages/Simulateurs/configs/auto-entrepreneur.yaml' +import independantConfig from '../../source/site/pages/Simulateurs/configs/indépendant.yaml' +import remunerationDirigeantConfig from '../../source/site/pages/Simulateurs/configs/rémunération-dirigeant.yaml' +import employeeConfig from '../../source/site/pages/Simulateurs/configs/salarié.yaml' +import professionLibéraleConfig from '../../source/site/pages/Simulateurs/configs/profession-libérale.yaml' +import aideDéclarationConfig from '../../source/site/pages/Gérer/AideDéclarationIndépendant/config.yaml' import artisteAuteurSituations from './simulations-artiste-auteur.yaml' import autoEntrepreneurSituations from './simulations-auto-entrepreneur.yaml' import professionsLibéralesSituations from './simulations-professions-libérales.yaml' diff --git a/mon-entreprise/webpack.common.js b/mon-entreprise/webpack.common.js index 133070a81..336d66226 100644 --- a/mon-entreprise/webpack.common.js +++ b/mon-entreprise/webpack.common.js @@ -18,11 +18,11 @@ module.exports.default = { extensions: ['.js', '.ts', '.tsx'], }, entry: { - 'mon-entreprise': './source/sites/mon-entreprise.fr/entry.fr.tsx', - infrance: './source/sites/mon-entreprise.fr/entry.en.tsx', + 'mon-entreprise': './source/site/entry.fr.tsx', + infrance: './source/site/entry.en.tsx', 'simulateur-iframe-integration': - './source/sites/mon-entreprise.fr/iframe-integration-script.js', - publicodes: './source/sites/publi.codes/entry.tsx', + './source/site/iframe-integration-script.js', + publicodes: '../publicodes/site/entry.tsx', }, output: { globalObject: 'self', @@ -41,15 +41,15 @@ module.exports.default = { new CopyPlugin([ './manifest.webmanifest', { - from: './source/sites/mon-entreprise.fr/robots.txt', + from: './source/site/robots.txt', to: 'robots.infrance.txt', }, { - from: './source/sites/mon-entreprise.fr/sitemap.fr.txt', + from: './source/site/sitemap.fr.txt', to: 'sitemap.infrance.fr.txt', }, { - from: './source/sites/mon-entreprise.fr/sitemap.en.txt', + from: './source/site/sitemap.en.txt', to: 'sitemap.infrance.en.txt', }, { @@ -61,7 +61,7 @@ module.exports.default = { to: 'data', }, { - from: './source/sites/mon-entreprise.fr/favicon', + from: './source/site/favicon', to: 'favicon', }, ]), diff --git a/package.json b/package.json index a0499a670..b416cc1b9 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "workspaces": [ "publicodes/core", "publicodes/react", + "publicodes/site", "modele-social", "mon-entreprise" ] diff --git a/publicodes/react/package.json b/publicodes/react/package.json index 7376a0abd..4f7029aa4 100644 --- a/publicodes/react/package.json +++ b/publicodes/react/package.json @@ -4,6 +4,11 @@ "description": "UI to explore publicodes computations", "main": "dist/index.js", "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "prepare": "yarn run build", + "test": "echo \"Error: no test specified\"" + }, "dependencies": { "classnames": "^2.2.6", "focus-trap-react": "^3.1.2", @@ -21,11 +26,8 @@ "react-router-dom": "^5.1.1", "react-router-hash-link": "^1.2.2" }, - "scripts": { - "build": "tsc", - "prepare": "yarn run build", - "test": "echo \"Error: no test specified\"" + "devDependencies": { + "typescript": "^4.1.3" }, - "author": "", "license": "MIT" } diff --git a/mon-entreprise/source/sites/publi.codes/App.tsx b/publicodes/site/components/App.tsx similarity index 87% rename from mon-entreprise/source/sites/publi.codes/App.tsx rename to publicodes/site/components/App.tsx index b0bebcca6..851958c55 100644 --- a/mon-entreprise/source/sites/publi.codes/App.tsx +++ b/publicodes/site/components/App.tsx @@ -4,11 +4,11 @@ import 'iframe-resizer' import { useEffect } from 'react' import { hot } from 'react-hot-loader' import { Route, Switch } from 'react-router-dom' -import Provider from '../../Provider' -import Communauté from './Communauté' -import Documentation from './Documentation' +import Provider from './Provider' +import Communauté from '../pages/Communauté' +import Documentation from '../pages/Documentation' import { Header } from './Header' -import Landing from './Landing' +import Landing from '../pages/Landing' import LazyStudio from './LazyStudio' function Router() { diff --git a/mon-entreprise/source/sites/publi.codes/Header.tsx b/publicodes/site/components/Header.tsx similarity index 98% rename from mon-entreprise/source/sites/publi.codes/Header.tsx rename to publicodes/site/components/Header.tsx index 0be8e50fb..80e7a5be7 100644 --- a/mon-entreprise/source/sites/publi.codes/Header.tsx +++ b/publicodes/site/components/Header.tsx @@ -1,4 +1,3 @@ -import React from 'react' import { Link, NavLink } from 'react-router-dom' const items = [ diff --git a/mon-entreprise/source/sites/publi.codes/LazyStudio.tsx b/publicodes/site/components/LazyStudio.tsx similarity index 100% rename from mon-entreprise/source/sites/publi.codes/LazyStudio.tsx rename to publicodes/site/components/LazyStudio.tsx diff --git a/publicodes/site/components/Provider.tsx b/publicodes/site/components/Provider.tsx new file mode 100644 index 000000000..5c813f0e6 --- /dev/null +++ b/publicodes/site/components/Provider.tsx @@ -0,0 +1,64 @@ +// TODO: This code comes from mon-entreprise.fr and could be simplified for +// publi.codes + +import { createBrowserHistory } from 'history' +import React, { createContext, useMemo } from 'react' +import { Router } from 'react-router-dom' +import { ThemeColorsProvider } from './colors' + +if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + window.addEventListener('load', () => { + navigator.serviceWorker + .register('/sw.js') + .then((registration) => { + // eslint-disable-next-line no-console + console.log('SW registered: ', registration) + }) + .catch((registrationError) => { + // eslint-disable-next-line no-console + console.log('SW registration failed: ', registrationError) + }) + }) +} + +type SiteName = 'publicodes' + +export const SiteNameContext = createContext(null) + +export type ProviderProps = { + basename: SiteName + children: React.ReactNode +} + +export default function Provider({ basename, children }: ProviderProps) { + const history = useMemo( + () => + createBrowserHistory({ + basename: process.env.NODE_ENV === 'production' ? '' : basename, + }), + [] + ) + + // Remove loader + const css = document.createElement('style') + css.type = 'text/css' + css.innerHTML = ` +#js { + animation: appear 0.5s; + opacity: 1; +} +#loading { + display: none !important; +}` + document.body.appendChild(css) + + return ( + + + + <>{children} + + + + ) +} diff --git a/publicodes/site/components/Scroll.tsx b/publicodes/site/components/Scroll.tsx new file mode 100644 index 000000000..71cd51e12 --- /dev/null +++ b/publicodes/site/components/Scroll.tsx @@ -0,0 +1,92 @@ +import { useEffect, useRef } from 'react' + +const forEachParent = (node: Node | null, fn: (node: Node) => void) => { + if (!node) { + return + } + fn(node) + forEachParent(node.parentNode, fn) +} + +export function ScrollToTop({ + behavior = 'auto', +}: { + behavior?: ScrollBehavior +}) { + const ref = useRef(null) + + useEffect(() => { + if ('parentIFrame' in window) { + ;(window as any).parentIFrame.scrollToOffset(0, 0) + return + } + forEachParent(ref.current, (elem) => ((elem as any).scrollTop = 0)) + try { + window.scroll({ + top: 0, + behavior, + }) + } catch (e) { + window.scroll(0, 0) + } + }, []) + return
    +} + +type ScrollToElementProps = React.ComponentProps<'div'> & { + onlyIfNotVisible?: boolean + when?: boolean + behavior?: ScrollBehavior +} + +export function ScrollToElement({ + onlyIfNotVisible = false, + when, + behavior = 'smooth', + children, + style, + ...otherProps +}: ScrollToElementProps) { + const ref = useRef(null) + const scrollIfNeeded = () => { + if ( + when === false || + (onlyIfNotVisible && + ref.current && + ref.current.getBoundingClientRect().top >= 0 && + ref.current.getBoundingClientRect().bottom <= window.innerHeight) + ) { + return + } + try { + ref.current?.scrollIntoView({ + behavior, + block: 'nearest', + inline: 'nearest', + }) + } catch (error) { + ref.current?.scrollIntoView({ + behavior, + }) + } + } + useEffect(scrollIfNeeded) + + return ( +
    + {children} +
    + ) +} + +export default { + toElement: ScrollToElement, + toTop: ScrollToTop, +} diff --git a/mon-entreprise/source/sites/publi.codes/Studio.tsx b/publicodes/site/components/Studio.tsx similarity index 89% rename from mon-entreprise/source/sites/publi.codes/Studio.tsx rename to publicodes/site/components/Studio.tsx index b073f4161..89a41d424 100644 --- a/mon-entreprise/source/sites/publi.codes/Studio.tsx +++ b/publicodes/site/components/Studio.tsx @@ -7,7 +7,6 @@ import MonacoEditor from 'react-monaco-editor' import { useHistory, useLocation } from 'react-router-dom' import styled from 'styled-components' import yaml from 'yaml' -import { useDebounce } from 'Components/utils' const EXAMPLE_CODE = ` # Bienvenue dans le bac à sable du langage publicode ! @@ -236,3 +235,24 @@ class ErrorBoundary extends React.Component { return this.props.children } } + +function useDebounce(value: T, delay: number) { + const [debouncedValue, setDebouncedValue] = useState(value) + useEffect( + () => { + // Update debounced value after delay + const handler = setTimeout(() => { + setDebouncedValue(value) + }, delay) + + // Cancel the timeout if value changes (also on delay change or unmount) + // This is how we prevent debounced value from updating if value is changed ... + // .. within the delay period. Timeout gets cleared and restarted. + return () => { + clearTimeout(handler) + } + }, + [value, delay] // Only re-call effect if value or delay changes + ) + return debouncedValue +} diff --git a/mon-entreprise/source/components/SyntaxHighlighter.tsx b/publicodes/site/components/SyntaxHighlighter.tsx similarity index 100% rename from mon-entreprise/source/components/SyntaxHighlighter.tsx rename to publicodes/site/components/SyntaxHighlighter.tsx diff --git a/publicodes/site/components/colors.tsx b/publicodes/site/components/colors.tsx new file mode 100644 index 000000000..f4bfea533 --- /dev/null +++ b/publicodes/site/components/colors.tsx @@ -0,0 +1,127 @@ +import convert from 'color-convert' +import React, { createContext, useEffect, useRef } from 'react' + +/* + Hex to RGB conversion: + http://www.javascripter.net/faq/hextorgb.htm +*/ +const cutHex = (h: string) => (h.startsWith('#') ? h.substring(1, 7) : h), + hexToR = (h: string) => parseInt(cutHex(h).substring(0, 2), 16), + hexToG = (h: string) => parseInt(cutHex(h).substring(2, 4), 16), + hexToB = (h: string) => parseInt(cutHex(h).substring(4, 6), 16) + +/* + Given a background color, should you write on it in black or white ? + Taken from http://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color#comment61936401_3943023 +*/ +function findContrastedTextColor(color: string, simple: boolean) { + const r = hexToR(color), + g = hexToG(color), + b = hexToB(color) + + if (simple) { + // The YIQ formula + return r * 0.299 + g * 0.587 + b * 0.114 > 128 ? '#000000' : '#ffffff' + } // else complex formula + const uicolors = [r / 255, g / 255, b / 255], + c = uicolors.map((c) => + c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4) + ), + L = 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2] + + return L > 0.179 ? '#000000' : '#ffffff' +} + +const lightenColor = (hex: string, x: number) => { + const [h, s, l] = convert.hex.hsl(hex.split('#')[1]) + return '#' + convert.hsl.hex([h, s, Math.max(2, Math.min(l + x, 98))]) +} + +const generateDarkenVariations = ( + numberOfVariation: number, + [h, s, l]: [number, number, number] +) => { + return [...Array(numberOfVariation).keys()].map( + (i) => '#' + convert.hsl.hex([h, s, l * 0.8 ** i]) + ) +} + +const deriveAnalogousPalettes = (hex: string) => { + const [h, s, l] = convert.hex.hsl(hex.split('#')[1]) + return [ + generateDarkenVariations(4, [(h - 45) % 360, 0.75 * s, l]), + generateDarkenVariations(4, [(h + 45) % 360, 0.75 * s, l]), + generateDarkenVariations(4, [(h + 90) % 360, 0.75 * s, l]), + ] +} + +const generateTheme = (themeColor?: string) => { + const // Use the default theme color if the host page hasn't made a choice + color = themeColor || '#2975D1', + lightColor = lightenColor(color, 10), + darkColor = lightenColor(color, -20), + lighterColor = lightenColor(color, 45), + lightestColor = lightenColor(color, 100), + darkestColor = lightenColor(color, -100), + grayColor = '#00000099', + textColor = findContrastedTextColor(color, true), // the 'simple' version feels better... + inverseTextColor = textColor === '#ffffff' ? '#000' : '#fff', + lightenTextColor = (textColor: string) => + textColor === '#ffffff' ? 'rgba(255, 255, 255, .7)' : 'rgba(0, 0, 0, .7)', + lighterTextColor = darkColor + 'cc', + lighterInverseTextColor = lightenTextColor(inverseTextColor), + textColorOnWhite = textColor === '#ffffff' ? color : '#333', + palettes = deriveAnalogousPalettes(color) + + return { + color, + textColor, + inverseTextColor, + lighterTextColor, + lighterInverseTextColor, + textColorOnWhite, + grayColor, + darkColor, + lightColor, + lighterColor, + lightestColor, + darkestColor, + palettes, + } +} + +export type ThemeColors = ReturnType + +export const ThemeColorsContext = createContext(generateTheme()) + +type ProviderProps = { + color?: string + children: React.ReactNode +} + +export function ThemeColorsProvider({ color, children }: ProviderProps) { + const colors = generateTheme(color) + const divRef = useRef(null) + useEffect(() => { + Object.entries(colors).forEach(([key, value]) => { + if (typeof value === 'string') { + divRef.current?.style.setProperty(`--${key}`, value) + } + }, colors) + }, [colors]) + return ( + + {/* This div is only used to set the CSS variables */} +
    + {children} +
    +
    + ) +} diff --git a/publicodes/site/components/markdown.tsx b/publicodes/site/components/markdown.tsx new file mode 100644 index 000000000..28adc3078 --- /dev/null +++ b/publicodes/site/components/markdown.tsx @@ -0,0 +1,230 @@ +import React, { Suspense, useContext, useEffect } from 'react' +import emoji from 'react-easy-emoji' +import ReactMarkdown, { ReactMarkdownProps } from 'react-markdown' +import { useLocation } from 'react-router-dom' +import { HashLink as Link } from 'react-router-hash-link' +import { SiteNameContext } from './Provider' + +const internalURLs = { + 'mon-entreprise.fr': 'mon-entreprise', + 'mycompanyinfrance.fr': 'infrance', + 'publi.codes': 'publicodes', +} as const + +export function LinkRenderer({ + href, + children, + ...otherProps +}: Omit, 'ref'>) { + const siteName = useContext(SiteNameContext) + + if (href && !href.startsWith('http')) { + return ( + + {children} + + ) + } + + if (href && !href.startsWith('http')) { + return ( + + {children} + + ) + } + + // Convert absolute links that reload the full app into in-app links handled + // by react-router. + for (const domain of Object.keys(internalURLs)) { + if ( + href && + href.startsWith(`https://${domain}`) && + internalURLs[domain as keyof typeof internalURLs] === siteName + ) { + return ( + + {children} + + ) + } + } + + return ( + + {children} + + ) +} +const TextRenderer = ({ children }: { children: string }) => ( + <>{emoji(children)} +) + +type MarkdownProps = ReactMarkdownProps & { + source: string | undefined + className?: string +} + +const LazySyntaxHighlighter = React.lazy(() => import('./SyntaxHighlighter')) +const CodeBlock = ({ + value, + language, +}: { + value: string + language: string +}) => ( +
    + + {value} + + } + > + + + {language === 'yaml' && ( + + {emoji('⚡')} Lancer le calcul + + )} +
    +) + +export const Markdown = ({ + source, + className = '', + renderers = {}, + ...otherProps +}: MarkdownProps) => ( + src} + source={source} + className={`markdown ${className}`} + renderers={{ + link: LinkRenderer, + text: TextRenderer, + code: CodeBlock, + ...renderers, + }} + {...otherProps} + /> +) + +export const MarkdownWithAnchorLinks = ({ + renderers = {}, + ...otherProps +}: MarkdownProps) => ( + +) + +const flatMapChildren = (children: React.ReactNode): Array => { + return React.Children.toArray(children).flatMap((child) => + typeof child !== 'object' || !('props' in child) + ? child + : child.props?.value ?? flatMapChildren(child.props?.children) + ) +} +function useScrollToHash() { + useEffect(() => { + const { hash } = window.location + if (hash) { + const id = hash.replace('#', '') + const element = document.getElementById(id) + if (!element) { + return + } + element.scrollIntoView() + } + }, [window.location.hash]) +} + +export function HeadingWithAnchorLink({ + level, + children, +}: { + level: number + children: React.ReactNode +}) { + useScrollToHash() + const { pathname } = useLocation() + const headingId = flatMapChildren(children) + .join(' ') + .toLowerCase() + .replace(emojiesRegex, '') + .replace(/:|,/g, '') + .trim() + .replace(/\s+/g, '-') + + const childrenWithAnchor = headingId ? ( + <> + + # + + {children} + + ) : ( + children + ) + return ( + + {childrenWithAnchor} + + ) +} + +type HeadingProps = { + level: number + children: React.ReactNode +} & React.ComponentProps<'h1'> + +function Heading({ level, children, ...otherProps }: HeadingProps) { + return React.createElement(`h${level}`, otherProps, children) +} + +// https://stackoverflow.com/a/41164587/1652064 +const emojiesRegex = new RegExp( + `(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]| +[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71] +|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]| +\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51] +|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122| +\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55| +\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934| +\u2935|[\u2190-\u21ff])`.replace(/\r?\n/g, ''), + 'g' +) diff --git a/mon-entreprise/source/sites/publi.codes/entry.tsx b/publicodes/site/entry.tsx similarity index 51% rename from mon-entreprise/source/sites/publi.codes/entry.tsx rename to publicodes/site/entry.tsx index 71d6a3a32..7a6747156 100644 --- a/mon-entreprise/source/sites/publi.codes/entry.tsx +++ b/publicodes/site/entry.tsx @@ -1,7 +1,10 @@ +// TODO: The webpack configuration of the publi.codes site remains in the +// mon-entreprise.fr and should be dissociated. + import 'core-js/stable' import { render } from 'react-dom' import 'regenerator-runtime/runtime' -import App from './App' +import App from './components/App' const anchor = document.querySelector('#js') render(, anchor) diff --git a/publicodes/site/package.json b/publicodes/site/package.json new file mode 100644 index 000000000..c05baba1d --- /dev/null +++ b/publicodes/site/package.json @@ -0,0 +1,18 @@ +{ + "name": "publicodes-site", + "version": "1.0.0", + "description": "Site web de publicodes", + "author": "", + "license": "MIT", + "scripts": { + "prepare": "echo 1", + "test": "echo 1" + }, + "devDependencies": { + "core-js": "^3.8.1" + }, + "dependencies": { + "color-convert": "^2.0.1", + "styled-components": "^5.2.1" + } +} diff --git a/mon-entreprise/source/sites/publi.codes/Api.tsx b/publicodes/site/pages/Api.tsx similarity index 75% rename from mon-entreprise/source/sites/publi.codes/Api.tsx rename to publicodes/site/pages/Api.tsx index 05a348f6b..1b6ebd534 100644 --- a/mon-entreprise/source/sites/publi.codes/Api.tsx +++ b/publicodes/site/pages/Api.tsx @@ -1,7 +1,7 @@ -import { ScrollToTop } from 'Components/utils/Scroll' -import { Header } from './Header' -import api from '../../../../publicodes/docs/api.md' -import { MarkdownWithAnchorLinks } from 'Components/utils/markdown' +import { ScrollToTop } from '../components/Scroll' +import { Header } from '../components/Header' +import api from '../../docs/api.md' +import { MarkdownWithAnchorLinks } from '../components/markdown' import styled from 'styled-components' // TODO Améliorer l'affichage des blocs de code JS et les rendre executables diff --git a/publicodes/site/pages/Communauté.tsx b/publicodes/site/pages/Communauté.tsx new file mode 100644 index 000000000..ea9edd74a --- /dev/null +++ b/publicodes/site/pages/Communauté.tsx @@ -0,0 +1,14 @@ +import { MarkdownWithAnchorLinks } from '../components/markdown' +import { ScrollToTop } from '../components/Scroll' +import content from '../../docs/communauté.md' + +export default function Landing() { + return ( +
    + +
    + +
    +
    + ) +} diff --git a/mon-entreprise/source/sites/publi.codes/Documentation.tsx b/publicodes/site/pages/Documentation.tsx similarity index 73% rename from mon-entreprise/source/sites/publi.codes/Documentation.tsx rename to publicodes/site/pages/Documentation.tsx index be640b3bb..9f317d632 100644 --- a/mon-entreprise/source/sites/publi.codes/Documentation.tsx +++ b/publicodes/site/pages/Documentation.tsx @@ -1,10 +1,10 @@ -import { MarkdownWithAnchorLinks } from 'Components/utils/markdown' -import { ScrollToTop } from 'Components/utils/Scroll' +import { MarkdownWithAnchorLinks } from '../components/markdown' +import { ScrollToTop } from '../components/Scroll' import { Redirect, Route, Switch } from 'react-router-dom' -import api from '../../../../publicodes/docs/api.md' -import principes from '../../../../publicodes/docs/principes-de-base.md' -import start from '../../../../publicodes/docs/se-lancer.md' -import { Navigation } from './Header' +import api from '../../docs/api.md' +import principes from '../../docs/principes-de-base.md' +import start from '../../docs/se-lancer.md' +import { Navigation } from '../components/Header' import Mécanismes from './Mécanismes' const items = [ diff --git a/mon-entreprise/source/sites/publi.codes/Landing.tsx b/publicodes/site/pages/Landing.tsx similarity index 63% rename from mon-entreprise/source/sites/publi.codes/Landing.tsx rename to publicodes/site/pages/Landing.tsx index dae276b9a..8405d4ed7 100644 --- a/mon-entreprise/source/sites/publi.codes/Landing.tsx +++ b/publicodes/site/pages/Landing.tsx @@ -1,6 +1,6 @@ -import { MarkdownWithAnchorLinks } from 'Components/utils/markdown' -import { ScrollToTop } from 'Components/utils/Scroll' -import content from '../../../../publicodes/docs/introduction.md' +import { MarkdownWithAnchorLinks } from '../components/markdown' +import { ScrollToTop } from '../components/Scroll' +import content from '../../docs/introduction.md' export default function Landing() { return ( diff --git a/mon-entreprise/source/sites/publi.codes/Mécanismes.tsx b/publicodes/site/pages/Mécanismes.tsx similarity index 85% rename from mon-entreprise/source/sites/publi.codes/Mécanismes.tsx rename to publicodes/site/pages/Mécanismes.tsx index d478dd32b..3c9563c12 100644 --- a/mon-entreprise/source/sites/publi.codes/Mécanismes.tsx +++ b/publicodes/site/pages/Mécanismes.tsx @@ -1,11 +1,11 @@ -import { HeadingWithAnchorLink, Markdown } from 'Components/utils/markdown' -import { ScrollToTop } from 'Components/utils/Scroll' +import { HeadingWithAnchorLink, Markdown } from '../components/markdown' +import { ScrollToTop } from '../components/Scroll' import { Fragment, useEffect } from 'react' import { useLocation } from 'react-router-dom' import { HashLink as Link } from 'react-router-hash-link' -import mecanisms from '../../../../publicodes/docs/mecanisms.yaml' -import { capitalise0 } from '../../utils' -import { Header } from './Header' +import mecanisms from '../../docs/mecanisms.yaml' +import { capitalise0 } from 'publicodes' +import { Header } from '../components/Header' const sortedMecanisms = Object.entries(mecanisms).sort(([a], [b]) => a.localeCompare(b) ) diff --git a/publicodes/site/tsconfig.json b/publicodes/site/tsconfig.json new file mode 100644 index 000000000..31eb5f5cb --- /dev/null +++ b/publicodes/site/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["entry.tsx", "types"] +} diff --git a/publicodes/site/types/css-prop.d.ts b/publicodes/site/types/css-prop.d.ts new file mode 100644 index 000000000..02edd5301 --- /dev/null +++ b/publicodes/site/types/css-prop.d.ts @@ -0,0 +1 @@ +import {} from 'styled-components/cssprop' diff --git a/publicodes/site/types/import-markdown.d.ts b/publicodes/site/types/import-markdown.d.ts new file mode 100644 index 000000000..ad04bf18e --- /dev/null +++ b/publicodes/site/types/import-markdown.d.ts @@ -0,0 +1,9 @@ +declare module '*.md' { + const content: any + export default content +} + +declare module '*.yaml' { + const content: any + export default content +} diff --git a/yarn.lock b/yarn.lock index f56a35100..b353dfec9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4688,6 +4688,11 @@ core-js@^3.2.1: resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a" integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA== +core-js@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.8.1.tgz#f51523668ac8a294d1285c3b9db44025fda66d47" + integrity sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -12653,6 +12658,22 @@ styled-components@^5.1.0: shallowequal "^1.1.0" supports-color "^5.5.0" +styled-components@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.2.1.tgz#6ed7fad2dc233825f64c719ffbdedd84ad79101a" + integrity sha512-sBdgLWrCFTKtmZm/9x7jkIabjFNVzCUeKfoQsM6R3saImkUnjx0QYdLwJHBjY9ifEcmjDamJDVfknWm1yxZPxQ== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/traverse" "^7.4.5" + "@emotion/is-prop-valid" "^0.8.8" + "@emotion/stylis" "^0.8.4" + "@emotion/unitless" "^0.7.4" + babel-plugin-styled-components ">= 1" + css-to-react-native "^3.0.0" + hoist-non-react-statics "^3.0.0" + shallowequal "^1.1.0" + supports-color "^5.5.0" + supports-color@5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" @@ -13176,6 +13197,11 @@ typescript@^4.1.0: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== +typescript@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" + integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== + uglify-js@3.4.x: version "3.4.10" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f"