From f2653ce01df20c35d338e1ae89a28d9f5aa6e717 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Mon, 22 Jul 2024 15:31:32 +0100 Subject: [PATCH] update planx-core refs and add basic info for new @planx comp --- api.planx.uk/package.json | 2 +- api.planx.uk/pnpm-lock.yaml | 28 ++++++++-- e2e/tests/api-driven/package.json | 4 +- e2e/tests/api-driven/pnpm-lock.yaml | 28 ++++++++-- e2e/tests/ui-driven/package.json | 4 +- e2e/tests/ui-driven/pnpm-lock.yaml | 28 ++++++++-- editor.planx.uk/package.json | 2 +- editor.planx.uk/pnpm-lock.yaml | 52 +++++++++++++++++-- .../@planx/components/MapAndLabel/Editor.tsx | 28 ++++++++++ .../@planx/components/MapAndLabel/Public.tsx | 20 +++++++ .../@planx/components/MapAndLabel/model.ts | 12 +++++ .../components/shared/Preview/SummaryList.tsx | 2 + editor.planx.uk/src/@planx/components/ui.tsx | 2 + .../components/Flow/components/Node.tsx | 2 + .../FlowEditor/components/forms/FormModal.tsx | 1 + .../FlowEditor/components/forms/index.ts | 2 + .../src/pages/FlowEditor/data/types.ts | 1 + editor.planx.uk/src/pages/Preview/Node.tsx | 4 ++ 18 files changed, 199 insertions(+), 23 deletions(-) create mode 100644 editor.planx.uk/src/@planx/components/MapAndLabel/Editor.tsx create mode 100644 editor.planx.uk/src/@planx/components/MapAndLabel/Public.tsx create mode 100644 editor.planx.uk/src/@planx/components/MapAndLabel/model.ts diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index 617aa4130c..d35338ac47 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -5,7 +5,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6c2cc59", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#fc14234", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index 2684cc811b..c0afecda63 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#6c2cc59 - version: github.com/theopensystemslab/planx-core/6c2cc59 + specifier: git+https://github.com/theopensystemslab/planx-core#fc14234 + version: github.com/theopensystemslab/planx-core/fc14234 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -2307,6 +2307,7 @@ packages: - supports-color dev: false + /ajv-formats@2.1.1(ajv@8.17.1): /ajv-formats@2.1.1(ajv@8.17.1): resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -2316,6 +2317,7 @@ packages: optional: true dependencies: ajv: 8.17.1 + ajv: 8.17.1 dev: false /ajv@6.12.6: @@ -2326,11 +2328,14 @@ packages: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + /ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} /ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.0.1 + fast-uri: 3.0.1 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 dev: false @@ -4066,6 +4071,10 @@ packages: resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} dev: false + /fast-uri@3.0.1: + resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + dev: false + /fast-url-parser@1.1.3: resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} dependencies: @@ -5587,6 +5596,7 @@ packages: mkdirp: 3.0.1 node-fetch: 3.3.2 prettier: 3.3.3 + prettier: 3.3.3 dev: false /json-schema-traverse@0.4.1: @@ -6619,6 +6629,8 @@ packages: engines: {node: '>=14'} dev: true + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} @@ -7768,6 +7780,8 @@ packages: /type-fest@4.23.0: resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} + /type-fest@4.22.1: + resolution: {integrity: sha512-9tHNEa0Ov81YOopiVkcCJVz5TM6AEQ+CHHjFIktqPnE3NV0AHIkx+gh9tiCl58m/66wWxkOC9eltpa75J4lQPA==} engines: {node: '>=16'} dev: false @@ -8192,8 +8206,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/6c2cc59: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/6c2cc59} + github.com/theopensystemslab/planx-core/fc14234: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/fc14234} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -8205,6 +8219,9 @@ packages: '@mui/material': 5.16.4(@emotion/react@11.13.0)(@emotion/styled@11.13.0)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 ajv-formats: 2.1.1(ajv@8.17.1) + '@mui/material': 5.15.21(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(react-dom@18.3.1)(react@18.3.1) + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) cheerio: 1.0.0-rc.12 copyfiles: 2.4.1 docx: 8.5.0 @@ -8216,9 +8233,12 @@ packages: lodash: 4.17.21 marked: 13.0.2 prettier: 3.3.3 + marked: 13.0.1 + prettier: 3.3.3 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.23.0 + type-fest: 4.22.1 uuid: 10.0.0 zod: 3.23.8 transitivePeerDependencies: diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index bac1bf673a..8b9c585c7f 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -7,8 +7,8 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6c2cc59", - "axios": "^1.7.2", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#fc14234", + "axios": "^1.6.8", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", "graphql": "^16.8.1", diff --git a/e2e/tests/api-driven/pnpm-lock.yaml b/e2e/tests/api-driven/pnpm-lock.yaml index 8c57a71d40..ca1c493f1d 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#6c2cc59 - version: github.com/theopensystemslab/planx-core/6c2cc59 + specifier: git+https://github.com/theopensystemslab/planx-core#fc14234 + version: github.com/theopensystemslab/planx-core/fc14234 axios: specifier: ^1.7.2 version: 1.7.2 @@ -874,6 +874,7 @@ packages: hasBin: true dev: false + /ajv-formats@2.1.1(ajv@8.17.1): /ajv-formats@2.1.1(ajv@8.17.1): resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -883,6 +884,7 @@ packages: optional: true dependencies: ajv: 8.17.1 + ajv: 8.17.1 dev: false /ajv@6.12.6: @@ -894,11 +896,14 @@ packages: uri-js: 4.4.1 dev: false + /ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} /ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.0.1 + fast-uri: 3.0.1 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 dev: false @@ -1552,6 +1557,10 @@ packages: resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} dev: false + /fast-uri@3.0.1: + resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + dev: false + /fast-xml-parser@4.4.0: resolution: {integrity: sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg==} hasBin: true @@ -1938,6 +1947,7 @@ packages: mkdirp: 3.0.1 node-fetch: 3.3.2 prettier: 3.3.3 + prettier: 3.3.3 dev: false /json-schema-traverse@0.4.1: @@ -2402,6 +2412,8 @@ packages: engines: {node: '>= 0.8.0'} dev: false + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} @@ -2846,6 +2858,8 @@ packages: /type-fest@4.23.0: resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} + /type-fest@4.22.1: + resolution: {integrity: sha512-9tHNEa0Ov81YOopiVkcCJVz5TM6AEQ+CHHjFIktqPnE3NV0AHIkx+gh9tiCl58m/66wWxkOC9eltpa75J4lQPA==} engines: {node: '>=16'} dev: false @@ -3045,8 +3059,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/6c2cc59: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/6c2cc59} + github.com/theopensystemslab/planx-core/fc14234: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/fc14234} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -3058,6 +3072,9 @@ packages: '@mui/material': 5.16.4(@emotion/react@11.13.0)(@emotion/styled@11.13.0)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 ajv-formats: 2.1.1(ajv@8.17.1) + '@mui/material': 5.15.21(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(react-dom@18.3.1)(react@18.3.1) + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) cheerio: 1.0.0-rc.12 copyfiles: 2.4.1 docx: 8.5.0 @@ -3069,9 +3086,12 @@ packages: lodash: 4.17.21 marked: 13.0.2 prettier: 3.3.3 + marked: 13.0.1 + prettier: 3.3.3 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.23.0 + type-fest: 4.22.1 uuid: 10.0.0 zod: 3.23.8 transitivePeerDependencies: diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index 3216500a78..e17fcb0987 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,8 +8,8 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6c2cc59", - "axios": "^1.7.2", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#fc14234", + "axios": "^1.6.8", "dotenv": "^16.3.1", "eslint": "^8.56.0", "graphql": "^16.9.0", diff --git a/e2e/tests/ui-driven/pnpm-lock.yaml b/e2e/tests/ui-driven/pnpm-lock.yaml index 02d8385c17..f3cb16463c 100644 --- a/e2e/tests/ui-driven/pnpm-lock.yaml +++ b/e2e/tests/ui-driven/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#6c2cc59 - version: github.com/theopensystemslab/planx-core/6c2cc59 + specifier: git+https://github.com/theopensystemslab/planx-core#fc14234 + version: github.com/theopensystemslab/planx-core/fc14234 axios: specifier: ^1.7.2 version: 1.7.2 @@ -680,6 +680,7 @@ packages: resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} engines: {node: '>=0.4.0'} + /ajv-formats@2.1.1(ajv@8.17.1): /ajv-formats@2.1.1(ajv@8.17.1): resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -689,6 +690,7 @@ packages: optional: true dependencies: ajv: 8.17.1 + ajv: 8.17.1 dev: false /ajv@6.12.6: @@ -708,11 +710,14 @@ packages: uri-js: 4.4.1 dev: false + /ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} /ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.0.1 + fast-uri: 3.0.1 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 dev: false @@ -1433,6 +1438,10 @@ packages: resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} dev: false + /fast-uri@3.0.1: + resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + dev: false + /fast-url-parser@1.1.3: resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} dependencies: @@ -1798,6 +1807,7 @@ packages: mkdirp: 3.0.1 node-fetch: 3.3.2 prettier: 3.3.3 + prettier: 3.3.3 dev: false /json-schema-traverse@0.4.1: @@ -2232,6 +2242,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} @@ -2606,6 +2618,8 @@ packages: /type-fest@4.23.0: resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} + /type-fest@4.22.1: + resolution: {integrity: sha512-9tHNEa0Ov81YOopiVkcCJVz5TM6AEQ+CHHjFIktqPnE3NV0AHIkx+gh9tiCl58m/66wWxkOC9eltpa75J4lQPA==} engines: {node: '>=16'} dev: false @@ -2762,8 +2776,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/6c2cc59: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/6c2cc59} + github.com/theopensystemslab/planx-core/fc14234: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/fc14234} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -2775,6 +2789,9 @@ packages: '@mui/material': 5.16.4(@emotion/react@11.13.0)(@emotion/styled@11.13.0)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 ajv-formats: 2.1.1(ajv@8.17.1) + '@mui/material': 5.15.21(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(react-dom@18.3.1)(react@18.3.1) + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) cheerio: 1.0.0-rc.12 copyfiles: 2.4.1 docx: 8.5.0 @@ -2786,9 +2803,12 @@ packages: lodash: 4.17.21 marked: 13.0.2 prettier: 3.3.3 + marked: 13.0.1 + prettier: 3.3.3 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.23.0 + type-fest: 4.22.1 uuid: 10.0.0 zod: 3.23.8 transitivePeerDependencies: diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 359c449e10..90244f818a 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -13,7 +13,7 @@ "@mui/material": "^5.15.2", "@mui/utils": "^5.15.2", "@opensystemslab/map": "^0.8.3", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6c2cc59", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#fc14234", "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.0.3", "@tiptap/extension-bubble-menu": "^2.1.13", diff --git a/editor.planx.uk/pnpm-lock.yaml b/editor.planx.uk/pnpm-lock.yaml index 02ed8dd00d..8ecceb9dbc 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -43,8 +43,8 @@ dependencies: specifier: ^0.8.3 version: 0.8.3 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#6c2cc59 - version: github.com/theopensystemslab/planx-core/6c2cc59(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#fc14234 + version: github.com/theopensystemslab/planx-core/fc14234(@types/react@18.2.45) '@tiptap/core': specifier: ^2.4.0 version: 2.4.0(@tiptap/pm@2.0.3) @@ -9380,6 +9380,17 @@ packages: dependencies: ajv: 8.17.1 + /ajv-formats@2.1.1(ajv@8.17.1): + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.17.1 + dev: false + /ajv-keywords@3.5.2(ajv@6.12.6): resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} peerDependencies: @@ -9411,6 +9422,15 @@ packages: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 + /ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.0.1 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + dev: false + /ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} @@ -12796,6 +12816,10 @@ packages: /fast-uri@3.0.1: resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + /fast-uri@3.0.1: + resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + dev: false + /fast-xml-parser@4.4.0: resolution: {integrity: sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg==} hasBin: true @@ -15255,6 +15279,7 @@ packages: mkdirp: 3.0.1 node-fetch: 3.3.2 prettier: 3.3.3 + prettier: 3.3.3 dev: false /json-schema-traverse@0.4.1: @@ -17822,6 +17847,13 @@ packages: hasBin: true dev: true + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + dev: false + dev: true + /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} @@ -20785,6 +20817,11 @@ packages: engines: {node: '>=16'} dev: false + /type-fest@4.22.1: + resolution: {integrity: sha512-9tHNEa0Ov81YOopiVkcCJVz5TM6AEQ+CHHjFIktqPnE3NV0AHIkx+gh9tiCl58m/66wWxkOC9eltpa75J4lQPA==} + engines: {node: '>=16'} + dev: false + /type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -21962,9 +21999,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/6c2cc59(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/6c2cc59} - id: github.com/theopensystemslab/planx-core/6c2cc59 + github.com/theopensystemslab/planx-core/fc14234(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/fc14234} + id: github.com/theopensystemslab/planx-core/fc14234 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true @@ -21976,6 +22013,9 @@ packages: '@mui/material': 5.15.2(@emotion/react@11.13.0)(@emotion/styled@11.13.0)(@types/react@18.2.45)(react-dom@18.3.1)(react@18.3.1) ajv: 8.17.1 ajv-formats: 2.1.1(ajv@8.17.1) + '@mui/material': 5.15.2(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.2.45)(react-dom@18.3.1)(react@18.3.1) + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) cheerio: 1.0.0-rc.12 copyfiles: 2.4.1 docx: 8.5.0 @@ -21987,9 +22027,11 @@ packages: lodash: 4.17.21 marked: 13.0.2 prettier: 3.3.3 + prettier: 3.3.3 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) type-fest: 4.23.0 + type-fest: 4.22.1 uuid: 10.0.0 zod: 3.23.8 transitivePeerDependencies: diff --git a/editor.planx.uk/src/@planx/components/MapAndLabel/Editor.tsx b/editor.planx.uk/src/@planx/components/MapAndLabel/Editor.tsx new file mode 100644 index 0000000000..43cb6a3db2 --- /dev/null +++ b/editor.planx.uk/src/@planx/components/MapAndLabel/Editor.tsx @@ -0,0 +1,28 @@ +import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; +import { useFormik } from "formik"; +import React from "react"; + +import { EditorProps } from "../ui"; +import { MapAndLabel, parseContent } from "./model"; + +type Props = EditorProps; + +export default MapAndLabelComponent; + +function MapAndLabelComponent(props: Props) { + const formik = useFormik({ + initialValues: parseContent(props.node?.data), + onSubmit: (newValues) => { + props.handleSubmit?.({ + type: TYPES.MapAndLabel, + data: newValues, + }); + }, + }); + + return ( + + ); +} diff --git a/editor.planx.uk/src/@planx/components/MapAndLabel/Public.tsx b/editor.planx.uk/src/@planx/components/MapAndLabel/Public.tsx new file mode 100644 index 0000000000..d6ec5ee9ef --- /dev/null +++ b/editor.planx.uk/src/@planx/components/MapAndLabel/Public.tsx @@ -0,0 +1,20 @@ +import React from "react"; + +import Card from "../shared/Preview/Card"; +import CardHeader from "../shared/Preview/CardHeader"; +import { PublicProps } from "../ui"; +import { MapAndLabel } from "./model"; + +type Props = PublicProps; + +function MapAndLabelComponent(props: Props) { + return ( + + + + ); +} diff --git a/editor.planx.uk/src/@planx/components/MapAndLabel/model.ts b/editor.planx.uk/src/@planx/components/MapAndLabel/model.ts new file mode 100644 index 0000000000..729ae3691e --- /dev/null +++ b/editor.planx.uk/src/@planx/components/MapAndLabel/model.ts @@ -0,0 +1,12 @@ +import { MoreInformation, parseMoreInformation } from "../shared"; + +export interface MapAndLabel extends MoreInformation { + fn: string; +} + +export const parseContent = ( + data: Record | undefined, +): MapAndLabel => ({ + fn: data?.fn || "", + ...parseMoreInformation(data), +}); diff --git a/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx b/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx index 48c4255933..a0fb267749 100644 --- a/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx +++ b/editor.planx.uk/src/@planx/components/shared/Preview/SummaryList.tsx @@ -6,6 +6,7 @@ import { visuallyHidden } from "@mui/utils"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; import { PASSPORT_UPLOAD_KEY } from "@planx/components/DrawBoundary/model"; import { PASSPORT_REQUESTED_FILES_KEY } from "@planx/components/FileUploadAndLabel/model"; +import MapAndLabelComponent from "@planx/components/MapAndLabel/Editor"; import { ConfirmationDialog } from "components/ConfirmationDialog"; import format from "date-fns/format"; import { useAnalyticsTracking } from "pages/FlowEditor/lib/analytics/provider"; @@ -101,6 +102,7 @@ const presentationalComponents: { [TYPES.InternalPortal]: undefined, [TYPES.FileUploadAndLabel]: FileUploadAndLabel, [TYPES.List]: List, + [TYPES.MapAndLabel]: MapAndLabelComponent, [TYPES.Notice]: undefined, [TYPES.NextSteps]: undefined, [TYPES.NumberInput]: NumberInput, diff --git a/editor.planx.uk/src/@planx/components/ui.tsx b/editor.planx.uk/src/@planx/components/ui.tsx index 3707d3eb05..ad8464b001 100644 --- a/editor.planx.uk/src/@planx/components/ui.tsx +++ b/editor.planx.uk/src/@planx/components/ui.tsx @@ -1,3 +1,4 @@ +import AddLocationAltIcon from "@mui/icons-material/AddLocationAlt"; import ArrowForwardIcon from "@mui/icons-material/ArrowForward"; import BorderColorIcon from "@mui/icons-material/BorderColor"; import CallSplit from "@mui/icons-material/CallSplit"; @@ -75,6 +76,7 @@ export const ICONS: { [TYPES.Flow]: undefined, [TYPES.InternalPortal]: undefined, [TYPES.List]: ListAlt, + [TYPES.MapAndLabel]: AddLocationAltIcon, [TYPES.Notice]: ReportProblemOutlined, [TYPES.NextSteps]: ArrowForwardIcon, [TYPES.NumberInput]: Pin, diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Node.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Node.tsx index e7600a7cc1..ffad33884e 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Node.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Node.tsx @@ -66,6 +66,8 @@ const Node: React.FC = (props) => { return ; case TYPES.List: return ; + case TYPES.MapAndLabel: + return ; case TYPES.NextSteps: return ; case TYPES.Notice: diff --git a/editor.planx.uk/src/pages/FlowEditor/components/forms/FormModal.tsx b/editor.planx.uk/src/pages/FlowEditor/components/forms/FormModal.tsx index 1aae0ee578..9c2476fd50 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/forms/FormModal.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/forms/FormModal.tsx @@ -62,6 +62,7 @@ const NodeTypeSelect: React.FC<{ + diff --git a/editor.planx.uk/src/pages/FlowEditor/components/forms/index.ts b/editor.planx.uk/src/pages/FlowEditor/components/forms/index.ts index ea89e890bb..591490cf39 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/forms/index.ts +++ b/editor.planx.uk/src/pages/FlowEditor/components/forms/index.ts @@ -14,6 +14,7 @@ import Filter from "@planx/components/Filter/Editor"; import FindProperty from "@planx/components/FindProperty/Editor"; import InternalPortal from "@planx/components/InternalPortal/Editor"; import List from "@planx/components/List/Editor"; +import MapAndLabelComponent from "@planx/components/MapAndLabel/Editor"; import NextSteps from "@planx/components/NextSteps/Editor"; import Notice from "@planx/components/Notice/Editor"; import NumberInput from "@planx/components/NumberInput/Editor"; @@ -53,6 +54,7 @@ const components: { "internal-portal": InternalPortal, "file-upload-and-label": FileUploadAndLabel, list: List, + "map-and-label": MapAndLabelComponent, "next-steps": NextSteps, notice: Notice, "number-input": NumberInput, diff --git a/editor.planx.uk/src/pages/FlowEditor/data/types.ts b/editor.planx.uk/src/pages/FlowEditor/data/types.ts index d613fe0f9e..c048b95f1c 100644 --- a/editor.planx.uk/src/pages/FlowEditor/data/types.ts +++ b/editor.planx.uk/src/pages/FlowEditor/data/types.ts @@ -19,6 +19,7 @@ export const SLUGS: { [TYPES.InternalPortal]: "internal-portal", [TYPES.FileUploadAndLabel]: "file-upload-and-label", [TYPES.List]: "list", + [TYPES.MapAndLabel]: "map-and-label", [TYPES.NextSteps]: "next-steps", [TYPES.Notice]: "notice", [TYPES.NumberInput]: "number-input", diff --git a/editor.planx.uk/src/pages/Preview/Node.tsx b/editor.planx.uk/src/pages/Preview/Node.tsx index 827b2633b5..2b2816be67 100644 --- a/editor.planx.uk/src/pages/Preview/Node.tsx +++ b/editor.planx.uk/src/pages/Preview/Node.tsx @@ -16,6 +16,7 @@ import FileUpload from "@planx/components/FileUpload/Public"; import FileUploadAndLabel from "@planx/components/FileUploadAndLabel/Public"; import FindProperty from "@planx/components/FindProperty/Public"; import List from "@planx/components/List/Public"; +import MapAndLabelComponent from "@planx/components/MapAndLabel/Editor"; import NextSteps from "@planx/components/NextSteps/Public"; import Notice from "@planx/components/Notice/Public"; import NumberInput from "@planx/components/NumberInput/Public"; @@ -172,6 +173,9 @@ const Node: React.FC = (props: Props) => { case TYPES.List: return ; + case TYPES.MapAndLabel: + return ; + case TYPES.NextSteps: return ;