From a88e45815f498cbb865eb57f0e0ffae57de1c309 Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Thu, 10 Nov 2022 15:35:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96(release)=20bump=20to=20version=201?= =?UTF-8?q?.0.0-beta.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added - Fix bugs in the library and add setSchema action - Allow customisation of form options - Use a reducer to manage schema - Make translation overridable - Setup @formatjs to extract/compile translations - Add customization of verna render components - Add title and description edition on sections - Add tests on custom error feature - Add title and description edition for fields - Add translations on fields properties - Add uuid generation for component naming - Add language management feature - Rework playground widgets template - Functionality to customize error messages - Functionality to customize widget options - Functionality to drag and drop custom widgets - Functionality to select and display only a section of the schema - Functionality to add or remove widgets and sections Changed - Pin React to version less than 17 --- CHANGELOG.md | 5 +- examples/playground/i18n/locales/fr-CA.json | 50 +++++++++++++ examples/playground/i18n/locales/fr-FR.json | 16 ++--- examples/playground/package.json | 4 +- .../playground/src/translations/fr-CA.json | 14 ++++ .../playground/src/translations/fr-FR.json | 14 ++-- lib/i18n/locales/fr-CA.json | 70 +++++++++++++++++++ lib/i18n/locales/fr-FR.json | 34 ++++----- lib/package.json | 2 +- lib/src/translations/fr-CA.json | 19 +++++ lib/src/translations/fr-FR.json | 15 ++-- package.json | 2 +- yarn.lock | 2 +- 13 files changed, 199 insertions(+), 48 deletions(-) create mode 100644 examples/playground/i18n/locales/fr-CA.json create mode 100644 examples/playground/src/translations/fr-CA.json create mode 100644 lib/i18n/locales/fr-CA.json create mode 100644 lib/src/translations/fr-CA.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 27961145..51ccdfb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unrealeased] +## [1.0.0-beta.0] + ### Added - Fix bugs in the library and add setSchema action @@ -33,4 +35,5 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Pin React to version less than 17 -[unreleased]: https://github.com/openfun/verna +[unreleased]: https://github.com/openfun/verna/compare/v1.0.0-beta.0...main +[1.0.0-beta.0]: https://github.com/openfun/verna/compare/c7a5eb3b32a4a626f32fc9257019f297d72b85c7...v1.0.0-beta.0 diff --git a/examples/playground/i18n/locales/fr-CA.json b/examples/playground/i18n/locales/fr-CA.json new file mode 100644 index 00000000..a2253723 --- /dev/null +++ b/examples/playground/i18n/locales/fr-CA.json @@ -0,0 +1,50 @@ +{ + "components.App.loading": { + "description": "Message displayed while verna is loading", + "message": "Chargement..." + }, + "components.App.save": { + "description": "Label of the custom save button", + "message": "Sauvegarder" + }, + "components.App.title": { + "description": "Title of the playground application", + "message": "🧑‍💻 Bac à sable Verna" + }, + "components.EditorFieldTemplate.parameters": { + "description": "Label of the button to display the widget properties form", + "message": "Paramètres du champ" + }, + "components.FormWrapper.editorOptions": { + "description": "Title of the editor options block", + "message": "Options de l'éditeur" + }, + "components.FormWrapper.language": { + "description": "Title of the language selection block", + "message": "Langue" + }, + "components.FormWrapper.saveForm": { + "description": "Label of the save button", + "message": "Sauvegarder le formulaire" + }, + "components.FormWrapper.sectionName": { + "description": "Label of a the button to select a section", + "message": "Section {name}" + }, + "components.FormWrapper.selectSection": { + "description": "Title of the section selection block", + "message": "Sélectionner une section" + }, + "components.FormWrapper.turnOffEditorMode": { + "description": "Label of the button to switch to preview mode", + "message": "Basculer en mode prévisualisation" + }, + "components.FormWrapper.turnOnEditorMode": { + "description": "Label of the button to switch to editor mode", + "message": "Basculer en mode édition" + }, + "components.fields.section.parameters": { + "description": "Label of the button to display the section properties form", + "message": "Paramètres de section" + } +} diff --git a/examples/playground/i18n/locales/fr-FR.json b/examples/playground/i18n/locales/fr-FR.json index e8e29421..a2253723 100644 --- a/examples/playground/i18n/locales/fr-FR.json +++ b/examples/playground/i18n/locales/fr-FR.json @@ -9,15 +9,15 @@ }, "components.App.title": { "description": "Title of the playground application", - "message": "🧑‍💻 Playground Verna" + "message": "🧑‍💻 Bac à sable Verna" }, "components.EditorFieldTemplate.parameters": { "description": "Label of the button to display the widget properties form", - "message": "Paramètres du champs" + "message": "Paramètres du champ" }, "components.FormWrapper.editorOptions": { "description": "Title of the editor options block", - "message": "Options d'édition" + "message": "Options de l'éditeur" }, "components.FormWrapper.language": { "description": "Title of the language selection block", @@ -25,10 +25,10 @@ }, "components.FormWrapper.saveForm": { "description": "Label of the save button", - "message": "Soumettre le formulaire" + "message": "Sauvegarder le formulaire" }, "components.FormWrapper.sectionName": { - "description": "Label of the button to select a section", + "description": "Label of a the button to select a section", "message": "Section {name}" }, "components.FormWrapper.selectSection": { @@ -37,14 +37,14 @@ }, "components.FormWrapper.turnOffEditorMode": { "description": "Label of the button to switch to preview mode", - "message": "Prévisualiser le formulaire" + "message": "Basculer en mode prévisualisation" }, "components.FormWrapper.turnOnEditorMode": { "description": "Label of the button to switch to editor mode", - "message": "Éditer le formulaire" + "message": "Basculer en mode édition" }, "components.fields.section.parameters": { "description": "Label of the button to display the section properties form", - "message": "Paramètres de la section" + "message": "Paramètres de section" } } diff --git a/examples/playground/package.json b/examples/playground/package.json index c0d8988d..44603790 100644 --- a/examples/playground/package.json +++ b/examples/playground/package.json @@ -1,7 +1,7 @@ { "name": "verna-examples-playground", "private": true, - "version": "0.0.0", + "version": "1.0.0-beta.0", "scripts": { "build": "tsc && vite build", "verna:build:check": "yarn workspace @openfun/verna build:check", @@ -14,7 +14,7 @@ "lint": "yarn lint:stylelint && yarn lint:eslint" }, "dependencies": { - "@openfun/verna": "0.0.0", + "@openfun/verna": "1.0.0-beta.0", "@rjsf/core": "4.2.3", "react": "17.0.2", "react-dom": "17.0.2" diff --git a/examples/playground/src/translations/fr-CA.json b/examples/playground/src/translations/fr-CA.json new file mode 100644 index 00000000..cd61882a --- /dev/null +++ b/examples/playground/src/translations/fr-CA.json @@ -0,0 +1,14 @@ +{ + "components.App.loading": "Chargement...", + "components.App.save": "Sauvegarder", + "components.App.title": "🧑‍💻 Bac à sable Verna", + "components.EditorFieldTemplate.parameters": "Paramètres du champ", + "components.FormWrapper.editorOptions": "Options de l'éditeur", + "components.FormWrapper.language": "Langue", + "components.FormWrapper.saveForm": "Sauvegarder le formulaire", + "components.FormWrapper.sectionName": "Section {name}", + "components.FormWrapper.selectSection": "Sélectionner une section", + "components.FormWrapper.turnOffEditorMode": "Basculer en mode prévisualisation", + "components.FormWrapper.turnOnEditorMode": "Basculer en mode édition", + "components.fields.section.parameters": "Paramètres de section" +} \ No newline at end of file diff --git a/examples/playground/src/translations/fr-FR.json b/examples/playground/src/translations/fr-FR.json index 3e06a06c..cd61882a 100644 --- a/examples/playground/src/translations/fr-FR.json +++ b/examples/playground/src/translations/fr-FR.json @@ -1,14 +1,14 @@ { "components.App.loading": "Chargement...", "components.App.save": "Sauvegarder", - "components.App.title": "🧑‍💻 Playground Verna", - "components.EditorFieldTemplate.parameters": "Paramètres du champs", - "components.FormWrapper.editorOptions": "Options d'édition", + "components.App.title": "🧑‍💻 Bac à sable Verna", + "components.EditorFieldTemplate.parameters": "Paramètres du champ", + "components.FormWrapper.editorOptions": "Options de l'éditeur", "components.FormWrapper.language": "Langue", - "components.FormWrapper.saveForm": "Soumettre le formulaire", + "components.FormWrapper.saveForm": "Sauvegarder le formulaire", "components.FormWrapper.sectionName": "Section {name}", "components.FormWrapper.selectSection": "Sélectionner une section", - "components.FormWrapper.turnOffEditorMode": "Prévisualiser le formulaire", - "components.FormWrapper.turnOnEditorMode": "Éditer le formulaire", - "components.fields.section.parameters": "Paramètres de la section" + "components.FormWrapper.turnOffEditorMode": "Basculer en mode prévisualisation", + "components.FormWrapper.turnOnEditorMode": "Basculer en mode édition", + "components.fields.section.parameters": "Paramètres de section" } \ No newline at end of file diff --git a/lib/i18n/locales/fr-CA.json b/lib/i18n/locales/fr-CA.json new file mode 100644 index 00000000..47548ab2 --- /dev/null +++ b/lib/i18n/locales/fr-CA.json @@ -0,0 +1,70 @@ +{ + "components.EditorFieldTemplate.addInput": { + "description": "Label of the button to add an input", + "message": "Ajouter un champ" + }, + "components.EditorFieldTemplate.parameters": { + "description": "Label of the button to display the widget properties form", + "message": "Paramètres" + }, + "components.SectionPropertiesForm.submitWidgetParameter": { + "description": "Label of submit input", + "message": "Sauvegarder" + }, + "components.WidgetPropertiesForm.description": { + "description": "Description of the field", + "message": "description" + }, + "components.WidgetPropertiesForm.enum": { + "description": "Fieldset label to add/remove options of a widget using an array of strings", + "message": "Options" + }, + "components.WidgetPropertiesForm.items": { + "description": "Fieldset label containing customizable options to add widgets as items", + "message": "Options" + }, + "components.WidgetPropertiesForm.maxLength": { + "description": "Label of the maximum length input", + "message": "longueur maximale" + }, + "components.WidgetPropertiesForm.maximum": { + "description": "Label of the maximum input", + "message": "maximum" + }, + "components.WidgetPropertiesForm.minLength": { + "description": "Label of the minimum length input", + "message": "longueur minimale" + }, + "components.WidgetPropertiesForm.minimum": { + "description": "Label of the minimum input", + "message": "minimum" + }, + "components.WidgetPropertiesForm.required": { + "description": "Label of the required input", + "message": "requis" + }, + "components.WidgetPropertiesForm.submitWidgetParameter": { + "description": "Label of submit input", + "message": "sauvegarder" + }, + "components.WidgetPropertiesForm.title": { + "description": "Title of the field", + "message": "titre" + }, + "components.fields.section.addSection": { + "description": "Label of the button to add a section", + "message": "Ajouter une section" + }, + "components.fields.section.parameters": { + "description": "Label of the button to display the section properties form", + "message": "Paramètres" + }, + "templates.defaultSectionTitle": { + "description": "The default name of a newly created section", + "message": "Titre de section par défaut" + }, + "templates.defaultWidgetTitle": { + "description": "The default name of a newly created widget", + "message": "Titre du composant par défaut" + } +} diff --git a/lib/i18n/locales/fr-FR.json b/lib/i18n/locales/fr-FR.json index dbaaa325..47548ab2 100644 --- a/lib/i18n/locales/fr-FR.json +++ b/lib/i18n/locales/fr-FR.json @@ -1,32 +1,16 @@ { "components.EditorFieldTemplate.addInput": { "description": "Label of the button to add an input", - "message": "Ajouter un champs" - }, - "components.EditorFieldTemplate.addSection": { - "description": "Label of the button to add a section", - "message": "Ajouter une section" + "message": "Ajouter un champ" }, "components.EditorFieldTemplate.parameters": { "description": "Label of the button to display the widget properties form", "message": "Paramètres" }, - "components.SectionPropertiesForm.description": { - "description": "Description of the section", - "message": "Description" - }, - "components.SectionPropertiesForm.legend": { - "description": "Legend of the section", - "message": "Options" - }, "components.SectionPropertiesForm.submitWidgetParameter": { "description": "Label of submit input", "message": "Sauvegarder" }, - "components.SectionPropertiesForm.title": { - "description": "Title of the section", - "message": "Titre" - }, "components.WidgetPropertiesForm.description": { "description": "Description of the field", "message": "description" @@ -41,7 +25,7 @@ }, "components.WidgetPropertiesForm.maxLength": { "description": "Label of the maximum length input", - "message": "longueur maximum" + "message": "longueur maximale" }, "components.WidgetPropertiesForm.maximum": { "description": "Label of the maximum input", @@ -49,7 +33,7 @@ }, "components.WidgetPropertiesForm.minLength": { "description": "Label of the minimum length input", - "message": "longueur minimum" + "message": "longueur minimale" }, "components.WidgetPropertiesForm.minimum": { "description": "Label of the minimum input", @@ -67,8 +51,20 @@ "description": "Title of the field", "message": "titre" }, + "components.fields.section.addSection": { + "description": "Label of the button to add a section", + "message": "Ajouter une section" + }, "components.fields.section.parameters": { "description": "Label of the button to display the section properties form", "message": "Paramètres" + }, + "templates.defaultSectionTitle": { + "description": "The default name of a newly created section", + "message": "Titre de section par défaut" + }, + "templates.defaultWidgetTitle": { + "description": "The default name of a newly created widget", + "message": "Titre du composant par défaut" } } diff --git a/lib/package.json b/lib/package.json index bd71be17..fb83f24c 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@openfun/verna", - "version": "0.0.0", + "version": "1.0.0-beta.0", "private": false, "description": "An extensible form builder based on React JSON Schema Form.", "scripts": { diff --git a/lib/src/translations/fr-CA.json b/lib/src/translations/fr-CA.json new file mode 100644 index 00000000..3fb54db8 --- /dev/null +++ b/lib/src/translations/fr-CA.json @@ -0,0 +1,19 @@ +{ + "components.EditorFieldTemplate.addInput": "Ajouter un champ", + "components.EditorFieldTemplate.parameters": "Paramètres", + "components.SectionPropertiesForm.submitWidgetParameter": "Sauvegarder", + "components.WidgetPropertiesForm.description": "description", + "components.WidgetPropertiesForm.enum": "Options", + "components.WidgetPropertiesForm.items": "Options", + "components.WidgetPropertiesForm.maxLength": "longueur maximale", + "components.WidgetPropertiesForm.maximum": "maximum", + "components.WidgetPropertiesForm.minLength": "longueur minimale", + "components.WidgetPropertiesForm.minimum": "minimum", + "components.WidgetPropertiesForm.required": "requis", + "components.WidgetPropertiesForm.submitWidgetParameter": "sauvegarder", + "components.WidgetPropertiesForm.title": "titre", + "components.fields.section.addSection": "Ajouter une section", + "components.fields.section.parameters": "Paramètres", + "templates.defaultSectionTitle": "Titre de section par défaut", + "templates.defaultWidgetTitle": "Titre du composant par défaut" +} \ No newline at end of file diff --git a/lib/src/translations/fr-FR.json b/lib/src/translations/fr-FR.json index d63e6ecc..3fb54db8 100644 --- a/lib/src/translations/fr-FR.json +++ b/lib/src/translations/fr-FR.json @@ -1,20 +1,19 @@ { - "components.EditorFieldTemplate.addInput": "Ajouter un champs", - "components.EditorFieldTemplate.addSection": "Ajouter une section", + "components.EditorFieldTemplate.addInput": "Ajouter un champ", "components.EditorFieldTemplate.parameters": "Paramètres", - "components.SectionPropertiesForm.description": "Description", - "components.SectionPropertiesForm.legend": "Options", "components.SectionPropertiesForm.submitWidgetParameter": "Sauvegarder", - "components.SectionPropertiesForm.title": "Titre", "components.WidgetPropertiesForm.description": "description", "components.WidgetPropertiesForm.enum": "Options", "components.WidgetPropertiesForm.items": "Options", - "components.WidgetPropertiesForm.maxLength": "longueur maximum", + "components.WidgetPropertiesForm.maxLength": "longueur maximale", "components.WidgetPropertiesForm.maximum": "maximum", - "components.WidgetPropertiesForm.minLength": "longueur minimum", + "components.WidgetPropertiesForm.minLength": "longueur minimale", "components.WidgetPropertiesForm.minimum": "minimum", "components.WidgetPropertiesForm.required": "requis", "components.WidgetPropertiesForm.submitWidgetParameter": "sauvegarder", "components.WidgetPropertiesForm.title": "titre", - "components.fields.section.parameters": "Paramètres" + "components.fields.section.addSection": "Ajouter une section", + "components.fields.section.parameters": "Paramètres", + "templates.defaultSectionTitle": "Titre de section par défaut", + "templates.defaultWidgetTitle": "Titre du composant par défaut" } \ No newline at end of file diff --git a/package.json b/package.json index 0bbb5c35..8521b765 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "verna", - "version": "0.0.0", + "version": "1.0.0-beta.0", "description": "An extensible form builder based on React JSON Schema Form.", "main": "./lib/dist/index.js", "repository": "https://github.com/openfun/verna", diff --git a/yarn.lock b/yarn.lock index 88b4cbf5..047c1ac1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6360,7 +6360,7 @@ trim-newlines@^3.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== -tsc-alias@^1.7.0: +tsc-alias@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/tsc-alias/-/tsc-alias-1.7.0.tgz#733482751133a25b97608ee424f8a1f085fcaaef" integrity sha512-n/K6g8S7Ec7Y/A2Z77Ikp2Uv1S1ERtT63ni69XV4W1YPT4rnNmz8ItgIiJYvKfFnKfqcZQ81UPjoKpMTxaC/rg==