From 2e7da50cc3a8f8bcd52ee7c3cc20fd4132dad0a5 Mon Sep 17 00:00:00 2001 From: Jean Ribeiro Date: Wed, 30 Aug 2023 18:19:00 -0300 Subject: [PATCH] fix/chore: migrate DateTimePicker (#538) * chore: replace DateTimePicker from bloom for bloom-ui * Add patch for svelty-picker --------- Co-authored-by: Matthew Maxwell --- .../views/components/DateTimePicker.svelte | 2 +- packages/shared/package.json | 3 +- .../components/inputs/DateTimePicker.svelte | 122 ------------------ .../inputs/ExpirationDateTimePicker.svelte | 2 +- .../shared/src/components/inputs/index.js | 1 - .../molecules/DateInputButton.svelte | 3 +- patches/svelty-picker+4.1.3.patch | 48 +++++++ yarn.lock | 29 +++-- 8 files changed, 73 insertions(+), 137 deletions(-) delete mode 100644 packages/shared/src/components/inputs/DateTimePicker.svelte create mode 100644 patches/svelty-picker+4.1.3.patch diff --git a/packages/desktop/views/dashboard/send-flow/views/components/DateTimePicker.svelte b/packages/desktop/views/dashboard/send-flow/views/components/DateTimePicker.svelte index 93e4476dc1..ebf506f1ac 100644 --- a/packages/desktop/views/dashboard/send-flow/views/components/DateTimePicker.svelte +++ b/packages/desktop/views/dashboard/send-flow/views/components/DateTimePicker.svelte @@ -1,6 +1,6 @@ - - - -
- - -
-
- - diff --git a/packages/shared/src/components/inputs/ExpirationDateTimePicker.svelte b/packages/shared/src/components/inputs/ExpirationDateTimePicker.svelte index 93e4476dc1..ebf506f1ac 100644 --- a/packages/shared/src/components/inputs/ExpirationDateTimePicker.svelte +++ b/packages/shared/src/components/inputs/ExpirationDateTimePicker.svelte @@ -1,6 +1,6 @@ + +@@ -12,10 +12,10 @@ + import { fade } from "svelte/transition"; + import Calendar from "./Calendar.svelte"; + import Time from "./Time.svelte"; +- import { formatDate, parseDate } from "../utils/dateUtils"; ++ import { formatDate, parseDate } from "../utils/dateUtils.js"; + import { usePosition } from "../utils/actions.js"; +- import { computeResolvedMode, initProps } from "../utils/state"; +- import { MODE_MONTH, STARTVIEW_TIME } from "../utils/constants"; ++ import { computeResolvedMode, initProps } from "../utils/state.js"; ++ import { MODE_MONTH, STARTVIEW_TIME } from "../utils/constants.js"; + + // html + export let inputId = ''; +diff --git a/node_modules/svelty-picker/dist/utils/grid.js b/node_modules/svelty-picker/dist/utils/grid.js +index 19c3403..5318956 100644 +--- a/node_modules/svelty-picker/dist/utils/grid.js ++++ b/node_modules/svelty-picker/dist/utils/grid.js +@@ -1,6 +1,6 @@ + +-import { MODE_YEAR, MODE_DECADE } from "./constants"; +-import { getDaysInMonth } from "./dateUtils"; ++import { MODE_YEAR, MODE_DECADE } from "./constants.js"; ++import { getDaysInMonth } from "./dateUtils.js"; + + /** + * @typedef {object} Dataset +diff --git a/node_modules/svelty-picker/dist/utils/state.js b/node_modules/svelty-picker/dist/utils/state.js +index e264172..c6101a2 100644 +--- a/node_modules/svelty-picker/dist/utils/state.js ++++ b/node_modules/svelty-picker/dist/utils/state.js +@@ -1,4 +1,4 @@ +-import { formatDate, parseDate } from "./dateUtils"; ++import { formatDate, parseDate } from "./dateUtils.js"; + + /** + * @typedef {object} ValueInit diff --git a/yarn.lock b/yarn.lock index 3ef85160b7..c03bfb30ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -342,16 +342,17 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bloomwalletio/ui@0.7.10": - version "0.7.10" - resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.7.10/517dde2cd81244de9848c41d202bc93d21bfd393#517dde2cd81244de9848c41d202bc93d21bfd393" - integrity sha512-7lfkfCAvpwQd6otDeSoLJ47RYNjvRwCcHJ9Y96EMq8nfRXfGfsR5aPJWDgqTFw2AW020k0YLK41WpXhgpUD0SQ== +"@bloomwalletio/ui@0.7.12": + version "0.7.12" + resolved "https://npm.pkg.github.com/download/@bloomwalletio/ui/0.7.12/80419dcec6f6031dc888a5defabdc69cf7926722#80419dcec6f6031dc888a5defabdc69cf7926722" + integrity sha512-384Eci/XxTGxw/aA/wfzehu0trMg3eTiQr6c7cZhng9S75WsRxnB0kOTlRde9dwawAeo5rTHtEXOTz5xA/PIEw== dependencies: "@floating-ui/dom" "1.4.3" "@popperjs/core" "2.11.8" flowbite "1.7.0" flowbite-svelte "0.39.2" svelte-json-tree "2.1.0" + svelty-picker "4.1.3" tailwind-merge "1.13.2" "@chainsafe/as-sha256@^0.4.1": @@ -1114,7 +1115,7 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@floating-ui/core@^1.3.1": +"@floating-ui/core@^1.3.1", "@floating-ui/core@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.4.1.tgz#0d633f4b76052668afb932492ac452f7ebe97f17" integrity sha512-jk3WqquEJRlcyu7997NtR5PibI+y5bi+LS3hPmguVClypenMsCY3CBa3LAQnozRCtCrYWSEtAdiskpamuJRFOQ== @@ -1128,6 +1129,14 @@ dependencies: "@floating-ui/core" "^1.3.1" +"@floating-ui/dom@^1.4.5": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.5.1.tgz#88b70defd002fe851f17b4a25efb2d3c04d7a8d7" + integrity sha512-KwvVcPSXg6mQygvA1TjbN/gh///36kKtllIF8SUm0qpFj8+rvYrpvlYdL1JoA71SHpDqgSSdGOSoQ0Mp3uY5aw== + dependencies: + "@floating-ui/core" "^1.4.1" + "@floating-ui/utils" "^0.1.1" + "@floating-ui/utils@^0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.1.tgz#1a5b1959a528e374e8037c4396c3e825d6cf4a83" @@ -9996,10 +10005,12 @@ svelte@3.58.0: resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.58.0.tgz#d3e6f103efd6129e51c7d709225ad3b4c052b64e" integrity sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A== -svelty-picker@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/svelty-picker/-/svelty-picker-3.5.0.tgz#003e602489ba66f82745bd517d926a85879d1015" - integrity sha512-URxe82uJshx1I2mYdHU1/b2DysexvDZhgnfBP3p/aL5VBCa/PN0YltDR5VXQduW4EqxfQAJ9V/7w+adXqfx1rQ== +svelty-picker@4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/svelty-picker/-/svelty-picker-4.1.3.tgz#a19ca75459b5a6f2bc2387567b33b7048427645e" + integrity sha512-83gaWpwn16zhJctNEUuUMA883vvgsdbyj+Eil/nTWrRZ9b+xg2McQIRMcG4KxE+jvS10AdUO5pduxT1HLBBMpQ== + dependencies: + "@floating-ui/dom" "^1.4.5" swarm-js@^0.1.40: version "0.1.42"