diff --git a/.pnp.cjs b/.pnp.cjs index 8343111a..da5aa9e8 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -110,7 +110,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-react-hooks", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:4.6.0"],\ ["eslint-plugin-storybook", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.6.4"],\ ["execa", "npm:6.1.0"],\ - ["flow-bin", "npm:0.176.3"],\ + ["flow-bin", "npm:0.183.0"],\ ["flow-typed", "npm:3.8.0"],\ ["glob", "npm:7.2.3"],\ ["http-server", "npm:14.1.1"],\ @@ -139,7 +139,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["slash", "npm:3.0.0"],\ ["source-map-loader", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:4.0.0"],\ ["styled-components", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:5.3.5"],\ - ["styled-components-theme-connector", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.7"],\ + ["styled-components-theme-connector", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.8"],\ ["stylelint", "npm:14.11.0"],\ ["stylelint-config-standard-scss", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:5.0.0"],\ ["stylelint-config-styled-components", "npm:0.1.1"],\ @@ -17626,10 +17626,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["flow-bin", [\ - ["npm:0.176.3", {\ - "packageLocation": "./.yarn/unplugged/flow-bin-npm-0.176.3-f744a6db8a/node_modules/flow-bin/",\ + ["npm:0.183.0", {\ + "packageLocation": "./.yarn/unplugged/flow-bin-npm-0.183.0-9e7bd6f66e/node_modules/flow-bin/",\ "packageDependencies": [\ - ["flow-bin", "npm:0.176.3"]\ + ["flow-bin", "npm:0.183.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -24585,7 +24585,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-react-hooks", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:4.6.0"],\ ["eslint-plugin-storybook", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.6.4"],\ ["execa", "npm:6.1.0"],\ - ["flow-bin", "npm:0.176.3"],\ + ["flow-bin", "npm:0.183.0"],\ ["flow-typed", "npm:3.8.0"],\ ["glob", "npm:7.2.3"],\ ["http-server", "npm:14.1.1"],\ @@ -24614,7 +24614,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["slash", "npm:3.0.0"],\ ["source-map-loader", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:4.0.0"],\ ["styled-components", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:5.3.5"],\ - ["styled-components-theme-connector", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.7"],\ + ["styled-components-theme-connector", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.8"],\ ["stylelint", "npm:14.11.0"],\ ["stylelint-config-standard-scss", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:5.0.0"],\ ["stylelint-config-styled-components", "npm:0.1.1"],\ @@ -26724,17 +26724,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["styled-components-theme-connector", [\ - ["npm:0.1.7", {\ - "packageLocation": "./.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip/node_modules/styled-components-theme-connector/",\ + ["npm:0.1.8", {\ + "packageLocation": "./.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip/node_modules/styled-components-theme-connector/",\ "packageDependencies": [\ - ["styled-components-theme-connector", "npm:0.1.7"]\ + ["styled-components-theme-connector", "npm:0.1.8"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.7", {\ - "packageLocation": "./.yarn/__virtual__/styled-components-theme-connector-virtual-689579e5d1/0/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip/node_modules/styled-components-theme-connector/",\ + ["virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.8", {\ + "packageLocation": "./.yarn/__virtual__/styled-components-theme-connector-virtual-c7c9ecceae/0/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip/node_modules/styled-components-theme-connector/",\ "packageDependencies": [\ - ["styled-components-theme-connector", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.7"],\ + ["styled-components-theme-connector", "virtual:8604178f483659a40fb50334a2f455ae376ab832fda9bb7e0452fc9fe058a329d0882f4bbce0d9c50c1c1c75814a649932d66214472c0a3e10b6ca5ba01e2d27#npm:0.1.8"],\ ["@types/react", null],\ ["@types/react-dom", null],\ ["@types/styled-components", null],\ diff --git a/.yarn/cache/flow-bin-npm-0.176.3-f744a6db8a-00b9ca55f2.zip b/.yarn/cache/flow-bin-npm-0.183.0-9e7bd6f66e-b9e0792ee4.zip similarity index 76% rename from .yarn/cache/flow-bin-npm-0.176.3-f744a6db8a-00b9ca55f2.zip rename to .yarn/cache/flow-bin-npm-0.183.0-9e7bd6f66e-b9e0792ee4.zip index a2c35ab6..dabe2558 100644 Binary files a/.yarn/cache/flow-bin-npm-0.176.3-f744a6db8a-00b9ca55f2.zip and b/.yarn/cache/flow-bin-npm-0.183.0-9e7bd6f66e-b9e0792ee4.zip differ diff --git a/.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip b/.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip deleted file mode 100644 index 588420ec..00000000 Binary files a/.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip and /dev/null differ diff --git a/.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip b/.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip new file mode 100644 index 00000000..3493261e Binary files /dev/null and b/.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip differ diff --git a/.yarn/sdks/flow-bin/cli.js b/.yarn/sdks/flow-bin/cli.js old mode 100644 new mode 100755 diff --git a/.yarn/sdks/flow-bin/package.json b/.yarn/sdks/flow-bin/package.json index c52eea40..91c2b9ec 100644 --- a/.yarn/sdks/flow-bin/package.json +++ b/.yarn/sdks/flow-bin/package.json @@ -1,5 +1,5 @@ { "name": "flow-bin", - "version": "0.176.3-sdk", + "version": "0.183.0-sdk", "type": "commonjs" } diff --git a/.yarn/sdks/integrations.yml b/.yarn/sdks/integrations.yml index 4e3df390..aa9d0d0a 100644 --- a/.yarn/sdks/integrations.yml +++ b/.yarn/sdks/integrations.yml @@ -1,5 +1,5 @@ -# This file is automatically generated by @yarnpkg/sdks. -# Manual changes might be lost! - -integrations: - - vscode +# This file is automatically generated by @yarnpkg/sdks. +# Manual changes might be lost! + +integrations: + - vscode diff --git a/package.json b/package.json index bb236326..b22bf7a5 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-storybook": "0.6.4", "execa": "6.1.0", - "flow-bin": "0.176.3", + "flow-bin": "0.183.0", "flow-typed": "3.8.0", "glob": "7.2.3", "http-server": "14.1.1", @@ -151,7 +151,7 @@ "slash": "3.0.0", "source-map-loader": "4.0.0", "styled-components": "5.3.5", - "styled-components-theme-connector": "0.1.7", + "styled-components-theme-connector": "0.1.8", "stylelint": "14.11.0", "stylelint-config-standard-scss": "5.0.0", "stylelint-config-styled-components": "0.1.1", diff --git a/shared/flow-deps/.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip b/shared/flow-deps/.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip deleted file mode 100644 index 588420ec..00000000 Binary files a/shared/flow-deps/.yarn/cache/styled-components-theme-connector-npm-0.1.7-32710b38cb-d15adec7c6.zip and /dev/null differ diff --git a/shared/flow-deps/.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip b/shared/flow-deps/.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip new file mode 100644 index 00000000..3493261e Binary files /dev/null and b/shared/flow-deps/.yarn/cache/styled-components-theme-connector-npm-0.1.8-7e5ebadcf6-828bbf2e30.zip differ diff --git a/shared/flow-deps/.yarn/install-state.gz b/shared/flow-deps/.yarn/install-state.gz index 338930dc..ddb11a5b 100644 Binary files a/shared/flow-deps/.yarn/install-state.gz and b/shared/flow-deps/.yarn/install-state.gz differ diff --git a/shared/flow-deps/package.json b/shared/flow-deps/package.json index 158a8db0..57fe54b8 100644 --- a/shared/flow-deps/package.json +++ b/shared/flow-deps/package.json @@ -4,6 +4,6 @@ "packageManager": "yarn@3.2.2", "dependencies": { "raf-schd": "4.0.3", - "styled-components-theme-connector": "0.1.7" + "styled-components-theme-connector": "0.1.8" } } diff --git a/shared/flow-deps/yarn.lock b/shared/flow-deps/yarn.lock index e9a33334..a0b2df2b 100644 --- a/shared/flow-deps/yarn.lock +++ b/shared/flow-deps/yarn.lock @@ -10,7 +10,7 @@ __metadata: resolution: "flow-deps@workspace:." dependencies: raf-schd: 4.0.3 - styled-components-theme-connector: 0.1.7 + styled-components-theme-connector: 0.1.8 languageName: unknown linkType: soft @@ -28,15 +28,15 @@ __metadata: languageName: node linkType: hard -"styled-components-theme-connector@npm:0.1.7": - version: 0.1.7 - resolution: "styled-components-theme-connector@npm:0.1.7" +"styled-components-theme-connector@npm:0.1.8": + version: 0.1.8 + resolution: "styled-components-theme-connector@npm:0.1.8" dependencies: lodash: 4.17.21 peerDependencies: - react: ^17.0.2 - react-dom: ^17.0.2 + react: ^17.0.2 || ^18.0.0 + react-dom: ^17.0.2 || ^18.0.0 styled-components: ^5.2.5 - checksum: d15adec7c6637e2efbb033ae1936cffed16b572695605f2cb93e7204003ee5a256ea39ca6f49d9fccf839af406722eac25821cc7749ccdaa7ef4362eb168bf04 + checksum: 828bbf2e3000875515bf231dd1264da5ee53564e43fa5c6e61af2fb6e458251251ff2ebaead5ef1c31000a7174b29b91832430e49a9a03d3b3c9ac12e509cb67 languageName: node linkType: hard diff --git a/src/PieMenu.component.js b/src/PieMenu.component.js index d6512b70..15790b17 100644 --- a/src/PieMenu.component.js +++ b/src/PieMenu.component.js @@ -14,14 +14,11 @@ export const PieCenter = (connectTheme('pieMenu.center')('div'): React.Component const inputMoveEvents = ['touchmove', 'mousemove']; const selectEvents = ['mouseup', 'touchend']; -const bindEvents = (events, listener) => events - // $FlowFixMe[speculation-ambiguous] +const bindEvents = (events: string[], listener: any) => events .forEach(event => document - // $FlowFixMe[incompatible-call] .addEventListener(event, listener, { pasive: false, cancelable: true, capture: true })); -const unbindEvents = (events, listener) => events - // $FlowFixMe[speculation-ambiguous] +const unbindEvents = (events: string[], listener: any) => events .forEach(event => document.removeEventListener(event, listener)); type Metadata = { @@ -32,7 +29,7 @@ type Metadata = { export type Props = { containerId: string, - slices: { itemId: string, slice: React.Node[] }[], + slices: { itemId: string, slice: React.Element }[], startOffsetAngle?: number, polar: boolean, Center?: React.ComponentType, @@ -69,7 +66,7 @@ const PieMenu = ({ return centerArea <= distance && distance <= pieArea; }; - const getItemAt = (x, y) => { + const getItemAt = (x: number, y: number) => { if (!isInsidePie(x, y)) return null; const elements = document.elementsFromPoint(x, y); for (let i = 0; i < elements.length; i += 1) { @@ -81,11 +78,11 @@ const PieMenu = ({ }; React.useEffect(() => { - const captureActiveSlice = rafSchedule(e => { + const captureActiveSlice = rafSchedule((e: MouseEvent & TouchEvent) => { if (!ref.current) return; - const x = (e.pageX !== undefined ? e.pageX : (e: TouchEvent).touches[0].clientX) + const x = (e.pageX !== undefined ? e.pageX : e.touches[0].clientX) - window.pageXOffset; - const y = (e.pageY !== undefined ? e.pageY : (e: TouchEvent).touches[0].clientY) + const y = (e.pageY !== undefined ? e.pageY : e.touches[0].clientY) - window.pageYOffset; if (x > -1 && y > -1) { const item = getItemAt(x, y); @@ -96,10 +93,10 @@ const PieMenu = ({ setActiveSlice(null); } }); - const selectActiveSlice = e => { + const selectActiveSlice = (e: MouseEvent & TouchEvent) => { if (!ref.current) return; - const x = e.pageX || (e: TouchEvent).changedTouches[0].clientX; - const y = e.pageY || (e: TouchEvent).changedTouches[0].clientY; + const x = e.pageX || e.changedTouches[0].clientX; + const y = e.pageY || e.changedTouches[0].clientY; if (x > -1 && y > -1) { const item = getItemAt(x, y); if (item && item.childNodes.length) { diff --git a/src/Slice/Slice.component.js b/src/Slice/Slice.component.js index 1f8bff11..846732ed 100644 --- a/src/Slice/Slice.component.js +++ b/src/Slice/Slice.component.js @@ -46,7 +46,7 @@ const Slice = ({ attrs = {}, }: Props) => { const { context: { active } } = React.useContext(ThemeContext); - const getCallback = callback => (active ? callback : undefined); + const getCallback = (callback: Callback) => (active ? callback : undefined); return (