-)
-
-/* La colonne peut au clic afficher une nouvelle colonne qui sera une autre somme imbriquée */
-function Row({ v, i, unit }) {
- let [folded, setFolded] = useState(true),
- rowFormula = path(['explanation', 'formule', 'explanation'], v),
- isSomme = rowFormula && rowFormula.name == 'somme'
-
- return [
- setFolded(!folded)}
- >
-
-
- {isSomme && (
-
- )}
-
- {v.nodeValue != null && (
-
-
-
- )}
- ,
- ...(isSomme && !folded
- ? [
-
-
-
,
- ]
- : []),
- ]
-}
-
-const StyledSomme = styled.div`
- /* mécanisme somme */
- table {
- width: 100%;
- border-collapse: collapse;
- }
- tr .element {
- text-align: left;
- padding: 0.2rem 0.4rem;
- }
- tr .value span {
- text-align: right;
- }
- .nested {
- padding: 0;
- }
-`
-const StyledRow = styled.div`
- display: flex;
- align-items: center;
- flex-flow: row nowrap;
- :nth-child(2n) {
- background-color: var(--lightestColor);
- }
-
- &.notApplicable {
- opacity: 0.6;
- }
-
- .element .result,
- .element > .variable > .nodeHead > .nodeValue {
- display: none;
- }
- :first-child {
- border-top: none;
- }
-
- .element {
- flex: 1;
- max-width: 100%;
- display: flex;
- align-items: baseline;
- padding: 0.1em 0.4em;
- padding-top: 0.2em;
- overflow: hidden;
- }
- .element .unfoldIndication {
- text-transform: capitalize;
- flex: 1;
- margin-left: 0.6rem;
- text-align: left;
- }
-
- .element .variable,
- .element .nodeHead {
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 100%;
- }
-
- .element .situationValue {
- display: none !important;
- }
-
- /* Nested Mecanism */
- + .nested {
- padding-left: 2em;
- border-top: 1px dashed rgba(51, 51, 80, 0.15);
- }
-`
diff --git a/publicodes/esm/index.js b/publicodes/core/esm/index.js
similarity index 100%
rename from publicodes/esm/index.js
rename to publicodes/core/esm/index.js
diff --git a/publicodes/esm/package.json b/publicodes/core/esm/package.json
similarity index 100%
rename from publicodes/esm/package.json
rename to publicodes/core/esm/package.json
diff --git a/publicodes/package.json b/publicodes/core/package.json
similarity index 100%
rename from publicodes/package.json
rename to publicodes/core/package.json
diff --git a/publicodes/source/AST/graph.ts b/publicodes/core/source/AST/graph.ts
similarity index 100%
rename from publicodes/source/AST/graph.ts
rename to publicodes/core/source/AST/graph.ts
diff --git a/publicodes/source/AST/index.ts b/publicodes/core/source/AST/index.ts
similarity index 100%
rename from publicodes/source/AST/index.ts
rename to publicodes/core/source/AST/index.ts
diff --git a/publicodes/source/AST/types.ts b/publicodes/core/source/AST/types.ts
similarity index 100%
rename from publicodes/source/AST/types.ts
rename to publicodes/core/source/AST/types.ts
diff --git a/publicodes/source/date.ts b/publicodes/core/source/date.ts
similarity index 100%
rename from publicodes/source/date.ts
rename to publicodes/core/source/date.ts
diff --git a/publicodes/source/error.ts b/publicodes/core/source/error.ts
similarity index 100%
rename from publicodes/source/error.ts
rename to publicodes/core/source/error.ts
diff --git a/publicodes/source/evaluation.ts b/publicodes/core/source/evaluation.ts
similarity index 100%
rename from publicodes/source/evaluation.ts
rename to publicodes/core/source/evaluation.ts
diff --git a/publicodes/source/evaluationFunctions.ts b/publicodes/core/source/evaluationFunctions.ts
similarity index 100%
rename from publicodes/source/evaluationFunctions.ts
rename to publicodes/core/source/evaluationFunctions.ts
diff --git a/publicodes/source/format.ts b/publicodes/core/source/format.ts
similarity index 100%
rename from publicodes/source/format.ts
rename to publicodes/core/source/format.ts
diff --git a/publicodes/source/grammar.ne b/publicodes/core/source/grammar.ne
similarity index 100%
rename from publicodes/source/grammar.ne
rename to publicodes/core/source/grammar.ne
diff --git a/publicodes/source/grammarFunctions.js b/publicodes/core/source/grammarFunctions.js
similarity index 100%
rename from publicodes/source/grammarFunctions.js
rename to publicodes/core/source/grammarFunctions.js
diff --git a/publicodes/source/i18n.ts b/publicodes/core/source/i18n.ts
similarity index 100%
rename from publicodes/source/i18n.ts
rename to publicodes/core/source/i18n.ts
diff --git a/publicodes/source/index.ts b/publicodes/core/source/index.ts
similarity index 99%
rename from publicodes/source/index.ts
rename to publicodes/core/source/index.ts
index b015d6f8d..217ef5a62 100644
--- a/publicodes/source/index.ts
+++ b/publicodes/core/source/index.ts
@@ -13,7 +13,7 @@ import {
import { Rule, RuleNode } from './rule'
import * as utils from './ruleUtils'
import { reduceAST } from './AST'
-import mecanismsDoc from '../docs/mecanisms.yaml'
+import mecanismsDoc from '../../docs/mecanisms.yaml'
const emptyCache = () => ({
_meta: { contextRule: [] },
diff --git a/publicodes/source/locales/units.yaml b/publicodes/core/source/locales/units.yaml
similarity index 100%
rename from publicodes/source/locales/units.yaml
rename to publicodes/core/source/locales/units.yaml
diff --git a/publicodes/source/mecanisms/applicable.ts b/publicodes/core/source/mecanisms/applicable.ts
similarity index 100%
rename from publicodes/source/mecanisms/applicable.ts
rename to publicodes/core/source/mecanisms/applicable.ts
diff --git a/publicodes/source/mecanisms/arrondi.ts b/publicodes/core/source/mecanisms/arrondi.ts
similarity index 100%
rename from publicodes/source/mecanisms/arrondi.ts
rename to publicodes/core/source/mecanisms/arrondi.ts
diff --git a/publicodes/source/mecanisms/barème.ts b/publicodes/core/source/mecanisms/barème.ts
similarity index 100%
rename from publicodes/source/mecanisms/barème.ts
rename to publicodes/core/source/mecanisms/barème.ts
diff --git a/publicodes/source/mecanisms/composantes.ts b/publicodes/core/source/mecanisms/composantes.ts
similarity index 100%
rename from publicodes/source/mecanisms/composantes.ts
rename to publicodes/core/source/mecanisms/composantes.ts
diff --git a/publicodes/source/mecanisms/condition-allof.ts b/publicodes/core/source/mecanisms/condition-allof.ts
similarity index 100%
rename from publicodes/source/mecanisms/condition-allof.ts
rename to publicodes/core/source/mecanisms/condition-allof.ts
diff --git a/publicodes/source/mecanisms/condition-oneof.ts b/publicodes/core/source/mecanisms/condition-oneof.ts
similarity index 100%
rename from publicodes/source/mecanisms/condition-oneof.ts
rename to publicodes/core/source/mecanisms/condition-oneof.ts
diff --git a/publicodes/source/mecanisms/durée.ts b/publicodes/core/source/mecanisms/durée.ts
similarity index 100%
rename from publicodes/source/mecanisms/durée.ts
rename to publicodes/core/source/mecanisms/durée.ts
diff --git a/publicodes/source/mecanisms/grille.ts b/publicodes/core/source/mecanisms/grille.ts
similarity index 100%
rename from publicodes/source/mecanisms/grille.ts
rename to publicodes/core/source/mecanisms/grille.ts
diff --git a/publicodes/source/mecanisms/inversion.ts b/publicodes/core/source/mecanisms/inversion.ts
similarity index 100%
rename from publicodes/source/mecanisms/inversion.ts
rename to publicodes/core/source/mecanisms/inversion.ts
diff --git a/publicodes/source/mecanisms/max.ts b/publicodes/core/source/mecanisms/max.ts
similarity index 100%
rename from publicodes/source/mecanisms/max.ts
rename to publicodes/core/source/mecanisms/max.ts
diff --git a/publicodes/source/mecanisms/min.ts b/publicodes/core/source/mecanisms/min.ts
similarity index 100%
rename from publicodes/source/mecanisms/min.ts
rename to publicodes/core/source/mecanisms/min.ts
diff --git a/publicodes/source/mecanisms/nonApplicable.ts b/publicodes/core/source/mecanisms/nonApplicable.ts
similarity index 100%
rename from publicodes/source/mecanisms/nonApplicable.ts
rename to publicodes/core/source/mecanisms/nonApplicable.ts
diff --git a/publicodes/source/mecanisms/one-possibility.ts b/publicodes/core/source/mecanisms/one-possibility.ts
similarity index 100%
rename from publicodes/source/mecanisms/one-possibility.ts
rename to publicodes/core/source/mecanisms/one-possibility.ts
diff --git a/publicodes/source/mecanisms/operation.ts b/publicodes/core/source/mecanisms/operation.ts
similarity index 100%
rename from publicodes/source/mecanisms/operation.ts
rename to publicodes/core/source/mecanisms/operation.ts
diff --git a/publicodes/source/mecanisms/parDéfaut.ts b/publicodes/core/source/mecanisms/parDéfaut.ts
similarity index 100%
rename from publicodes/source/mecanisms/parDéfaut.ts
rename to publicodes/core/source/mecanisms/parDéfaut.ts
diff --git a/publicodes/source/mecanisms/plafond.ts b/publicodes/core/source/mecanisms/plafond.ts
similarity index 100%
rename from publicodes/source/mecanisms/plafond.ts
rename to publicodes/core/source/mecanisms/plafond.ts
diff --git a/publicodes/source/mecanisms/plancher.ts b/publicodes/core/source/mecanisms/plancher.ts
similarity index 100%
rename from publicodes/source/mecanisms/plancher.ts
rename to publicodes/core/source/mecanisms/plancher.ts
diff --git a/publicodes/source/mecanisms/product.ts b/publicodes/core/source/mecanisms/product.ts
similarity index 100%
rename from publicodes/source/mecanisms/product.ts
rename to publicodes/core/source/mecanisms/product.ts
diff --git a/publicodes/source/mecanisms/recalcul.ts b/publicodes/core/source/mecanisms/recalcul.ts
similarity index 100%
rename from publicodes/source/mecanisms/recalcul.ts
rename to publicodes/core/source/mecanisms/recalcul.ts
diff --git a/publicodes/source/mecanisms/reduction.ts b/publicodes/core/source/mecanisms/reduction.ts
similarity index 100%
rename from publicodes/source/mecanisms/reduction.ts
rename to publicodes/core/source/mecanisms/reduction.ts
diff --git a/publicodes/source/mecanisms/situation.ts b/publicodes/core/source/mecanisms/situation.ts
similarity index 100%
rename from publicodes/source/mecanisms/situation.ts
rename to publicodes/core/source/mecanisms/situation.ts
diff --git a/publicodes/source/mecanisms/sum.tsx b/publicodes/core/source/mecanisms/sum.tsx
similarity index 100%
rename from publicodes/source/mecanisms/sum.tsx
rename to publicodes/core/source/mecanisms/sum.tsx
diff --git a/publicodes/source/mecanisms/synchronisation.ts b/publicodes/core/source/mecanisms/synchronisation.ts
similarity index 100%
rename from publicodes/source/mecanisms/synchronisation.ts
rename to publicodes/core/source/mecanisms/synchronisation.ts
diff --git a/publicodes/source/mecanisms/tauxProgressif.ts b/publicodes/core/source/mecanisms/tauxProgressif.ts
similarity index 100%
rename from publicodes/source/mecanisms/tauxProgressif.ts
rename to publicodes/core/source/mecanisms/tauxProgressif.ts
diff --git a/publicodes/source/mecanisms/trancheUtils.ts b/publicodes/core/source/mecanisms/trancheUtils.ts
similarity index 100%
rename from publicodes/source/mecanisms/trancheUtils.ts
rename to publicodes/core/source/mecanisms/trancheUtils.ts
diff --git a/publicodes/source/mecanisms/unité.ts b/publicodes/core/source/mecanisms/unité.ts
similarity index 100%
rename from publicodes/source/mecanisms/unité.ts
rename to publicodes/core/source/mecanisms/unité.ts
diff --git a/publicodes/source/mecanisms/variableTemporelle.ts b/publicodes/core/source/mecanisms/variableTemporelle.ts
similarity index 100%
rename from publicodes/source/mecanisms/variableTemporelle.ts
rename to publicodes/core/source/mecanisms/variableTemporelle.ts
diff --git a/publicodes/source/mecanisms/variations.ts b/publicodes/core/source/mecanisms/variations.ts
similarity index 98%
rename from publicodes/source/mecanisms/variations.ts
rename to publicodes/core/source/mecanisms/variations.ts
index 193d89c76..cb281ed43 100644
--- a/publicodes/source/mecanisms/variations.ts
+++ b/publicodes/core/source/mecanisms/variations.ts
@@ -13,7 +13,7 @@ import {
Temporal,
temporalAverage,
} from '../temporal'
-import { mergeAllMissing } from './../evaluation'
+import { mergeAllMissing } from '../evaluation'
export type VariationNode = {
explanation: Array<{
diff --git a/publicodes/source/nodeUnits.ts b/publicodes/core/source/nodeUnits.ts
similarity index 100%
rename from publicodes/source/nodeUnits.ts
rename to publicodes/core/source/nodeUnits.ts
diff --git a/publicodes/source/parse.ts b/publicodes/core/source/parse.ts
similarity index 100%
rename from publicodes/source/parse.ts
rename to publicodes/core/source/parse.ts
diff --git a/publicodes/source/parsePublicodes.ts b/publicodes/core/source/parsePublicodes.ts
similarity index 100%
rename from publicodes/source/parsePublicodes.ts
rename to publicodes/core/source/parsePublicodes.ts
diff --git a/publicodes/source/reference.ts b/publicodes/core/source/reference.ts
similarity index 100%
rename from publicodes/source/reference.ts
rename to publicodes/core/source/reference.ts
diff --git a/publicodes/source/replacement.tsx b/publicodes/core/source/replacement.tsx
similarity index 100%
rename from publicodes/source/replacement.tsx
rename to publicodes/core/source/replacement.tsx
diff --git a/publicodes/source/rule.ts b/publicodes/core/source/rule.ts
similarity index 100%
rename from publicodes/source/rule.ts
rename to publicodes/core/source/rule.ts
diff --git a/publicodes/source/ruleUtils.ts b/publicodes/core/source/ruleUtils.ts
similarity index 100%
rename from publicodes/source/ruleUtils.ts
rename to publicodes/core/source/ruleUtils.ts
diff --git a/publicodes/source/temporal.ts b/publicodes/core/source/temporal.ts
similarity index 100%
rename from publicodes/source/temporal.ts
rename to publicodes/core/source/temporal.ts
diff --git a/publicodes/source/translateRules.ts b/publicodes/core/source/translateRules.ts
similarity index 100%
rename from publicodes/source/translateRules.ts
rename to publicodes/core/source/translateRules.ts
diff --git a/publicodes/source/types/dagres.d.ts b/publicodes/core/source/types/dagres.d.ts
similarity index 100%
rename from publicodes/source/types/dagres.d.ts
rename to publicodes/core/source/types/dagres.d.ts
diff --git a/publicodes/source/types/import-markdown.d.ts b/publicodes/core/source/types/import-markdown.d.ts
similarity index 100%
rename from publicodes/source/types/import-markdown.d.ts
rename to publicodes/core/source/types/import-markdown.d.ts
diff --git a/publicodes-react/source/types/import-nearley.d.ts b/publicodes/core/source/types/import-nearley.d.ts
similarity index 100%
rename from publicodes-react/source/types/import-nearley.d.ts
rename to publicodes/core/source/types/import-nearley.d.ts
diff --git a/publicodes-react/source/types/import-yaml.d.ts b/publicodes/core/source/types/import-yaml.d.ts
similarity index 100%
rename from publicodes-react/source/types/import-yaml.d.ts
rename to publicodes/core/source/types/import-yaml.d.ts
diff --git a/publicodes/source/uniroot.ts b/publicodes/core/source/uniroot.ts
similarity index 100%
rename from publicodes/source/uniroot.ts
rename to publicodes/core/source/uniroot.ts
diff --git a/publicodes/source/units.ts b/publicodes/core/source/units.ts
similarity index 100%
rename from publicodes/source/units.ts
rename to publicodes/core/source/units.ts
diff --git a/publicodes/test/.eslintrc.yaml b/publicodes/core/test/.eslintrc.yaml
similarity index 100%
rename from publicodes/test/.eslintrc.yaml
rename to publicodes/core/test/.eslintrc.yaml
diff --git a/publicodes/test/cycles.test.js b/publicodes/core/test/cycles.test.js
similarity index 100%
rename from publicodes/test/cycles.test.js
rename to publicodes/core/test/cycles.test.js
diff --git a/publicodes/test/date.test.js b/publicodes/core/test/date.test.js
similarity index 100%
rename from publicodes/test/date.test.js
rename to publicodes/core/test/date.test.js
diff --git a/publicodes/test/format.test.js b/publicodes/core/test/format.test.js
similarity index 100%
rename from publicodes/test/format.test.js
rename to publicodes/core/test/format.test.js
diff --git a/publicodes/test/inversion.test.js b/publicodes/core/test/inversion.test.js
similarity index 100%
rename from publicodes/test/inversion.test.js
rename to publicodes/core/test/inversion.test.js
diff --git a/publicodes/test/library.test.js b/publicodes/core/test/library.test.js
similarity index 100%
rename from publicodes/test/library.test.js
rename to publicodes/core/test/library.test.js
diff --git a/publicodes/test/load-mecanism-tests.js b/publicodes/core/test/load-mecanism-tests.js
similarity index 100%
rename from publicodes/test/load-mecanism-tests.js
rename to publicodes/core/test/load-mecanism-tests.js
diff --git a/publicodes/test/mecanisms.test.js b/publicodes/core/test/mecanisms.test.js
similarity index 100%
rename from publicodes/test/mecanisms.test.js
rename to publicodes/core/test/mecanisms.test.js
diff --git a/publicodes/test/missingVariables.test.js b/publicodes/core/test/missingVariables.test.js
similarity index 100%
rename from publicodes/test/missingVariables.test.js
rename to publicodes/core/test/missingVariables.test.js
diff --git a/publicodes/test/mécanismes/allègement.yaml b/publicodes/core/test/mécanismes/allègement.yaml
similarity index 100%
rename from publicodes/test/mécanismes/allègement.yaml
rename to publicodes/core/test/mécanismes/allègement.yaml
diff --git a/publicodes/test/mécanismes/applicable.yaml b/publicodes/core/test/mécanismes/applicable.yaml
similarity index 100%
rename from publicodes/test/mécanismes/applicable.yaml
rename to publicodes/core/test/mécanismes/applicable.yaml
diff --git a/publicodes/test/mécanismes/arrondi.yaml b/publicodes/core/test/mécanismes/arrondi.yaml
similarity index 100%
rename from publicodes/test/mécanismes/arrondi.yaml
rename to publicodes/core/test/mécanismes/arrondi.yaml
diff --git a/publicodes/test/mécanismes/barème.yaml b/publicodes/core/test/mécanismes/barème.yaml
similarity index 100%
rename from publicodes/test/mécanismes/barème.yaml
rename to publicodes/core/test/mécanismes/barème.yaml
diff --git a/publicodes/test/mécanismes/composantes.yaml b/publicodes/core/test/mécanismes/composantes.yaml
similarity index 100%
rename from publicodes/test/mécanismes/composantes.yaml
rename to publicodes/core/test/mécanismes/composantes.yaml
diff --git a/publicodes/test/mécanismes/conversion-unité.yaml b/publicodes/core/test/mécanismes/conversion-unité.yaml
similarity index 100%
rename from publicodes/test/mécanismes/conversion-unité.yaml
rename to publicodes/core/test/mécanismes/conversion-unité.yaml
diff --git a/publicodes/test/mécanismes/date.yaml b/publicodes/core/test/mécanismes/date.yaml
similarity index 100%
rename from publicodes/test/mécanismes/date.yaml
rename to publicodes/core/test/mécanismes/date.yaml
diff --git a/publicodes/test/mécanismes/durée.yaml b/publicodes/core/test/mécanismes/durée.yaml
similarity index 100%
rename from publicodes/test/mécanismes/durée.yaml
rename to publicodes/core/test/mécanismes/durée.yaml
diff --git a/publicodes/test/mécanismes/encadrement.yaml b/publicodes/core/test/mécanismes/encadrement.yaml
similarity index 100%
rename from publicodes/test/mécanismes/encadrement.yaml
rename to publicodes/core/test/mécanismes/encadrement.yaml
diff --git a/publicodes/test/mécanismes/expressions.yaml b/publicodes/core/test/mécanismes/expressions.yaml
similarity index 100%
rename from publicodes/test/mécanismes/expressions.yaml
rename to publicodes/core/test/mécanismes/expressions.yaml
diff --git a/publicodes/test/mécanismes/grille.yaml b/publicodes/core/test/mécanismes/grille.yaml
similarity index 100%
rename from publicodes/test/mécanismes/grille.yaml
rename to publicodes/core/test/mécanismes/grille.yaml
diff --git a/publicodes/test/mécanismes/le-maximum-de.yaml b/publicodes/core/test/mécanismes/le-maximum-de.yaml
similarity index 100%
rename from publicodes/test/mécanismes/le-maximum-de.yaml
rename to publicodes/core/test/mécanismes/le-maximum-de.yaml
diff --git a/publicodes/test/mécanismes/le-minimum-de.yaml b/publicodes/core/test/mécanismes/le-minimum-de.yaml
similarity index 100%
rename from publicodes/test/mécanismes/le-minimum-de.yaml
rename to publicodes/core/test/mécanismes/le-minimum-de.yaml
diff --git a/publicodes/test/mécanismes/multiplication.yaml b/publicodes/core/test/mécanismes/multiplication.yaml
similarity index 100%
rename from publicodes/test/mécanismes/multiplication.yaml
rename to publicodes/core/test/mécanismes/multiplication.yaml
diff --git a/publicodes/test/mécanismes/paramètres-nommés.yaml b/publicodes/core/test/mécanismes/paramètres-nommés.yaml
similarity index 100%
rename from publicodes/test/mécanismes/paramètres-nommés.yaml
rename to publicodes/core/test/mécanismes/paramètres-nommés.yaml
diff --git a/publicodes/test/mécanismes/question-conditionelle.yaml b/publicodes/core/test/mécanismes/question-conditionelle.yaml
similarity index 100%
rename from publicodes/test/mécanismes/question-conditionelle.yaml
rename to publicodes/core/test/mécanismes/question-conditionelle.yaml
diff --git a/publicodes/test/mécanismes/recalcul.yaml b/publicodes/core/test/mécanismes/recalcul.yaml
similarity index 100%
rename from publicodes/test/mécanismes/recalcul.yaml
rename to publicodes/core/test/mécanismes/recalcul.yaml
diff --git a/publicodes/test/mécanismes/remplace.yaml b/publicodes/core/test/mécanismes/remplace.yaml
similarity index 100%
rename from publicodes/test/mécanismes/remplace.yaml
rename to publicodes/core/test/mécanismes/remplace.yaml
diff --git a/publicodes/test/mécanismes/rend-non-applicable.yaml b/publicodes/core/test/mécanismes/rend-non-applicable.yaml
similarity index 100%
rename from publicodes/test/mécanismes/rend-non-applicable.yaml
rename to publicodes/core/test/mécanismes/rend-non-applicable.yaml
diff --git a/publicodes/test/mécanismes/somme.yaml b/publicodes/core/test/mécanismes/somme.yaml
similarity index 100%
rename from publicodes/test/mécanismes/somme.yaml
rename to publicodes/core/test/mécanismes/somme.yaml
diff --git a/publicodes/test/mécanismes/synchronisation.yaml b/publicodes/core/test/mécanismes/synchronisation.yaml
similarity index 100%
rename from publicodes/test/mécanismes/synchronisation.yaml
rename to publicodes/core/test/mécanismes/synchronisation.yaml
diff --git a/publicodes/test/mécanismes/taux-progressif.yaml b/publicodes/core/test/mécanismes/taux-progressif.yaml
similarity index 100%
rename from publicodes/test/mécanismes/taux-progressif.yaml
rename to publicodes/core/test/mécanismes/taux-progressif.yaml
diff --git a/publicodes/test/mécanismes/toutes-ces-conditions.yaml b/publicodes/core/test/mécanismes/toutes-ces-conditions.yaml
similarity index 100%
rename from publicodes/test/mécanismes/toutes-ces-conditions.yaml
rename to publicodes/core/test/mécanismes/toutes-ces-conditions.yaml
diff --git a/publicodes/test/mécanismes/une-de-ces-conditions.yaml b/publicodes/core/test/mécanismes/une-de-ces-conditions.yaml
similarity index 100%
rename from publicodes/test/mécanismes/une-de-ces-conditions.yaml
rename to publicodes/core/test/mécanismes/une-de-ces-conditions.yaml
diff --git a/publicodes/test/mécanismes/unité.yaml b/publicodes/core/test/mécanismes/unité.yaml
similarity index 100%
rename from publicodes/test/mécanismes/unité.yaml
rename to publicodes/core/test/mécanismes/unité.yaml
diff --git a/publicodes/test/mécanismes/variations.yaml b/publicodes/core/test/mécanismes/variations.yaml
similarity index 100%
rename from publicodes/test/mécanismes/variations.yaml
rename to publicodes/core/test/mécanismes/variations.yaml
diff --git a/publicodes/test/period.test.js b/publicodes/core/test/period.test.js
similarity index 100%
rename from publicodes/test/period.test.js
rename to publicodes/core/test/period.test.js
diff --git a/publicodes/test/ruleUtils.test.js b/publicodes/core/test/ruleUtils.test.js
similarity index 100%
rename from publicodes/test/ruleUtils.test.js
rename to publicodes/core/test/ruleUtils.test.js
diff --git a/publicodes/test/rules/co2.yaml b/publicodes/core/test/rules/co2.yaml
similarity index 100%
rename from publicodes/test/rules/co2.yaml
rename to publicodes/core/test/rules/co2.yaml
diff --git a/publicodes/test/rules/sasu.yaml b/publicodes/core/test/rules/sasu.yaml
similarity index 100%
rename from publicodes/test/rules/sasu.yaml
rename to publicodes/core/test/rules/sasu.yaml
diff --git a/publicodes/test/setupIntl.js b/publicodes/core/test/setupIntl.js
similarity index 100%
rename from publicodes/test/setupIntl.js
rename to publicodes/core/test/setupIntl.js
diff --git a/publicodes/test/temporal.test.js b/publicodes/core/test/temporal.test.js
similarity index 100%
rename from publicodes/test/temporal.test.js
rename to publicodes/core/test/temporal.test.js
diff --git a/publicodes/test/units.test.js b/publicodes/core/test/units.test.js
similarity index 100%
rename from publicodes/test/units.test.js
rename to publicodes/core/test/units.test.js
diff --git a/publicodes/tsconfig.json b/publicodes/core/tsconfig.json
similarity index 81%
rename from publicodes/tsconfig.json
rename to publicodes/core/tsconfig.json
index 2d0178676..7c81df221 100644
--- a/publicodes/tsconfig.json
+++ b/publicodes/core/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../tsconfig.json",
+ "extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist/types",
"declaration": true,
diff --git a/publicodes/webpack.config.js b/publicodes/core/webpack.config.js
similarity index 92%
rename from publicodes/webpack.config.js
rename to publicodes/core/webpack.config.js
index 4d3cfb2a4..dda43c054 100644
--- a/publicodes/webpack.config.js
+++ b/publicodes/core/webpack.config.js
@@ -1,7 +1,7 @@
/* eslint-env node */
const path = require('path')
-const { commonLoaders } = require('../webpack/common')
+const { commonLoaders } = require('../../webpack/common')
const common = {
resolve: {
diff --git a/publicodes/webpack.test.js b/publicodes/core/webpack.test.js
similarity index 89%
rename from publicodes/webpack.test.js
rename to publicodes/core/webpack.test.js
index faf5d3781..92723c822 100644
--- a/publicodes/webpack.test.js
+++ b/publicodes/core/webpack.test.js
@@ -1,4 +1,4 @@
-const { commonLoaders } = require('../webpack/common')
+const { commonLoaders } = require('../../webpack/common')
const { EnvironmentPlugin } = require('webpack')
module.exports = {
diff --git a/publicodes-react/package.json b/publicodes/react/package.json
similarity index 100%
rename from publicodes-react/package.json
rename to publicodes/react/package.json
diff --git a/publicodes-react/source/Explanation.tsx b/publicodes/react/source/Explanation.tsx
similarity index 100%
rename from publicodes-react/source/Explanation.tsx
rename to publicodes/react/source/Explanation.tsx
diff --git a/publicodes-react/source/Markdown.tsx b/publicodes/react/source/Markdown.tsx
similarity index 100%
rename from publicodes-react/source/Markdown.tsx
rename to publicodes/react/source/Markdown.tsx
diff --git a/publicodes-react/source/Overlay.tsx b/publicodes/react/source/Overlay.tsx
similarity index 100%
rename from publicodes-react/source/Overlay.tsx
rename to publicodes/react/source/Overlay.tsx
diff --git a/publicodes-react/source/PublicodesBlock.tsx b/publicodes/react/source/PublicodesBlock.tsx
similarity index 100%
rename from publicodes-react/source/PublicodesBlock.tsx
rename to publicodes/react/source/PublicodesBlock.tsx
diff --git a/publicodes-react/source/RuleLink.tsx b/publicodes/react/source/RuleLink.tsx
similarity index 100%
rename from publicodes-react/source/RuleLink.tsx
rename to publicodes/react/source/RuleLink.tsx
diff --git a/publicodes-react/source/contexts.tsx b/publicodes/react/source/contexts.tsx
similarity index 100%
rename from publicodes-react/source/contexts.tsx
rename to publicodes/react/source/contexts.tsx
diff --git a/publicodes-react/source/index.tsx b/publicodes/react/source/index.tsx
similarity index 100%
rename from publicodes-react/source/index.tsx
rename to publicodes/react/source/index.tsx
diff --git a/publicodes-react/source/mecanisms/Allègement.js b/publicodes/react/source/mecanisms/Allègement.js
similarity index 100%
rename from publicodes-react/source/mecanisms/Allègement.js
rename to publicodes/react/source/mecanisms/Allègement.js
diff --git a/publicodes-react/source/mecanisms/Applicable.tsx b/publicodes/react/source/mecanisms/Applicable.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Applicable.tsx
rename to publicodes/react/source/mecanisms/Applicable.tsx
diff --git a/publicodes-react/source/mecanisms/Arrondi.tsx b/publicodes/react/source/mecanisms/Arrondi.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Arrondi.tsx
rename to publicodes/react/source/mecanisms/Arrondi.tsx
diff --git a/publicodes-react/source/mecanisms/Barème.tsx b/publicodes/react/source/mecanisms/Barème.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Barème.tsx
rename to publicodes/react/source/mecanisms/Barème.tsx
diff --git a/publicodes-react/source/mecanisms/Composantes.tsx b/publicodes/react/source/mecanisms/Composantes.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Composantes.tsx
rename to publicodes/react/source/mecanisms/Composantes.tsx
diff --git a/publicodes-react/source/mecanisms/Durée.tsx b/publicodes/react/source/mecanisms/Durée.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Durée.tsx
rename to publicodes/react/source/mecanisms/Durée.tsx
diff --git a/publicodes-react/source/mecanisms/Grille.tsx b/publicodes/react/source/mecanisms/Grille.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Grille.tsx
rename to publicodes/react/source/mecanisms/Grille.tsx
diff --git a/publicodes-react/source/mecanisms/InversionNumérique.js b/publicodes/react/source/mecanisms/InversionNumérique.js
similarity index 100%
rename from publicodes-react/source/mecanisms/InversionNumérique.js
rename to publicodes/react/source/mecanisms/InversionNumérique.js
diff --git a/publicodes-react/source/mecanisms/Maximum.tsx b/publicodes/react/source/mecanisms/Maximum.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Maximum.tsx
rename to publicodes/react/source/mecanisms/Maximum.tsx
diff --git a/publicodes-react/source/mecanisms/Minimum.tsx b/publicodes/react/source/mecanisms/Minimum.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Minimum.tsx
rename to publicodes/react/source/mecanisms/Minimum.tsx
diff --git a/publicodes-react/source/mecanisms/NonApplicable.tsx b/publicodes/react/source/mecanisms/NonApplicable.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/NonApplicable.tsx
rename to publicodes/react/source/mecanisms/NonApplicable.tsx
diff --git a/publicodes-react/source/mecanisms/Operation.tsx b/publicodes/react/source/mecanisms/Operation.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Operation.tsx
rename to publicodes/react/source/mecanisms/Operation.tsx
diff --git a/publicodes-react/source/mecanisms/ParDéfaut.tsx b/publicodes/react/source/mecanisms/ParDéfaut.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/ParDéfaut.tsx
rename to publicodes/react/source/mecanisms/ParDéfaut.tsx
diff --git a/publicodes-react/source/mecanisms/Plafond.tsx b/publicodes/react/source/mecanisms/Plafond.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Plafond.tsx
rename to publicodes/react/source/mecanisms/Plafond.tsx
diff --git a/publicodes-react/source/mecanisms/Plancher.tsx b/publicodes/react/source/mecanisms/Plancher.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Plancher.tsx
rename to publicodes/react/source/mecanisms/Plancher.tsx
diff --git a/publicodes-react/source/mecanisms/Product.tsx b/publicodes/react/source/mecanisms/Product.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Product.tsx
rename to publicodes/react/source/mecanisms/Product.tsx
diff --git a/publicodes-react/source/mecanisms/Recalcul.tsx b/publicodes/react/source/mecanisms/Recalcul.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Recalcul.tsx
rename to publicodes/react/source/mecanisms/Recalcul.tsx
diff --git a/publicodes-react/source/mecanisms/Replacement.tsx b/publicodes/react/source/mecanisms/Replacement.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Replacement.tsx
rename to publicodes/react/source/mecanisms/Replacement.tsx
diff --git a/publicodes-react/source/mecanisms/ReplacementRule.tsx b/publicodes/react/source/mecanisms/ReplacementRule.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/ReplacementRule.tsx
rename to publicodes/react/source/mecanisms/ReplacementRule.tsx
diff --git a/publicodes-react/source/mecanisms/Rule.tsx b/publicodes/react/source/mecanisms/Rule.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Rule.tsx
rename to publicodes/react/source/mecanisms/Rule.tsx
diff --git a/publicodes-react/source/mecanisms/Situation.tsx b/publicodes/react/source/mecanisms/Situation.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Situation.tsx
rename to publicodes/react/source/mecanisms/Situation.tsx
diff --git a/publicodes/source/components/mecanisms/Somme.tsx b/publicodes/react/source/mecanisms/Somme.tsx
similarity index 94%
rename from publicodes/source/components/mecanisms/Somme.tsx
rename to publicodes/react/source/mecanisms/Somme.tsx
index 72b9ea781..341d0ca58 100644
--- a/publicodes/source/components/mecanisms/Somme.tsx
+++ b/publicodes/react/source/mecanisms/Somme.tsx
@@ -1,7 +1,7 @@
import styled from 'styled-components'
-import { EvaluatedNode } from '../..'
+import { EvaluatedNode } from 'publicodes/source/AST/types'
import Explanation from '../Explanation'
-import { Mecanism, NodeValuePointer, UnfoldIsEnabledContext } from './common'
+import { Mecanism, UnfoldIsEnabledContext } from './common'
const SommeNode = ({ explanation, nodeValue, unit }) => (
diff --git a/publicodes-react/source/mecanisms/Synchronisation.tsx b/publicodes/react/source/mecanisms/Synchronisation.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Synchronisation.tsx
rename to publicodes/react/source/mecanisms/Synchronisation.tsx
diff --git a/publicodes-react/source/mecanisms/TauxProgressif.tsx b/publicodes/react/source/mecanisms/TauxProgressif.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/TauxProgressif.tsx
rename to publicodes/react/source/mecanisms/TauxProgressif.tsx
diff --git a/publicodes-react/source/mecanisms/ToutesCesConditions.tsx b/publicodes/react/source/mecanisms/ToutesCesConditions.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/ToutesCesConditions.tsx
rename to publicodes/react/source/mecanisms/ToutesCesConditions.tsx
diff --git a/publicodes-react/source/mecanisms/UneDeCesConditions.tsx b/publicodes/react/source/mecanisms/UneDeCesConditions.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/UneDeCesConditions.tsx
rename to publicodes/react/source/mecanisms/UneDeCesConditions.tsx
diff --git a/publicodes-react/source/mecanisms/UnePossibilité.tsx b/publicodes/react/source/mecanisms/UnePossibilité.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/UnePossibilité.tsx
rename to publicodes/react/source/mecanisms/UnePossibilité.tsx
diff --git a/publicodes-react/source/mecanisms/Unité.tsx b/publicodes/react/source/mecanisms/Unité.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/Unité.tsx
rename to publicodes/react/source/mecanisms/Unité.tsx
diff --git a/publicodes-react/source/mecanisms/Variations.js b/publicodes/react/source/mecanisms/Variations.js
similarity index 100%
rename from publicodes-react/source/mecanisms/Variations.js
rename to publicodes/react/source/mecanisms/Variations.js
diff --git a/publicodes-react/source/mecanisms/colors.ts b/publicodes/react/source/mecanisms/colors.ts
similarity index 100%
rename from publicodes-react/source/mecanisms/colors.ts
rename to publicodes/react/source/mecanisms/colors.ts
diff --git a/publicodes-react/source/mecanisms/common.tsx b/publicodes/react/source/mecanisms/common.tsx
similarity index 100%
rename from publicodes-react/source/mecanisms/common.tsx
rename to publicodes/react/source/mecanisms/common.tsx
diff --git a/publicodes-react/source/rule/Examples.js b/publicodes/react/source/rule/Examples.js
similarity index 100%
rename from publicodes-react/source/rule/Examples.js
rename to publicodes/react/source/rule/Examples.js
diff --git a/publicodes-react/source/rule/Header.tsx b/publicodes/react/source/rule/Header.tsx
similarity index 100%
rename from publicodes-react/source/rule/Header.tsx
rename to publicodes/react/source/rule/Header.tsx
diff --git a/publicodes-react/source/rule/References.tsx b/publicodes/react/source/rule/References.tsx
similarity index 100%
rename from publicodes-react/source/rule/References.tsx
rename to publicodes/react/source/rule/References.tsx
diff --git a/publicodes-react/source/rule/RulePage.tsx b/publicodes/react/source/rule/RulePage.tsx
similarity index 100%
rename from publicodes-react/source/rule/RulePage.tsx
rename to publicodes/react/source/rule/RulePage.tsx
diff --git a/publicodes-react/source/rule/RuleSource.tsx b/publicodes/react/source/rule/RuleSource.tsx
similarity index 100%
rename from publicodes-react/source/rule/RuleSource.tsx
rename to publicodes/react/source/rule/RuleSource.tsx
diff --git a/publicodes-react/source/types/css-prop.d.ts b/publicodes/react/source/types/css-prop.d.ts
similarity index 100%
rename from publicodes-react/source/types/css-prop.d.ts
rename to publicodes/react/source/types/css-prop.d.ts
diff --git a/publicodes/source/types/import-nearley.d.ts b/publicodes/react/source/types/import-nearley.d.ts
similarity index 100%
rename from publicodes/source/types/import-nearley.d.ts
rename to publicodes/react/source/types/import-nearley.d.ts
diff --git a/publicodes/source/types/import-yaml.d.ts b/publicodes/react/source/types/import-yaml.d.ts
similarity index 100%
rename from publicodes/source/types/import-yaml.d.ts
rename to publicodes/react/source/types/import-yaml.d.ts
diff --git a/publicodes-react/source/writtenNumbers.ts b/publicodes/react/source/writtenNumbers.ts
similarity index 100%
rename from publicodes-react/source/writtenNumbers.ts
rename to publicodes/react/source/writtenNumbers.ts
diff --git a/publicodes-react/tsconfig.json b/publicodes/react/tsconfig.json
similarity index 84%
rename from publicodes-react/tsconfig.json
rename to publicodes/react/tsconfig.json
index a1a9693bd..05026a1d1 100644
--- a/publicodes-react/tsconfig.json
+++ b/publicodes/react/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../tsconfig.json",
+ "extends": "../../tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"target": "es2015",