Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.Fuselage
Commits
2cb5aaaf
Unverified
Commit
2cb5aaaf
authored
Feb 11, 2020
by
Guilherme Gazzo
Committed by
GitHub
Feb 11, 2020
Browse files
fix: Safari not triggering buttons anchors (#146)
parent
60080da8
Changes
17
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package Rocket.Chat.Fuselage
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
...
...
lerna.json
View file @
2cb5aaaf
{
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"npmClient"
:
"yarn"
,
"useWorkspaces"
:
true
,
"packages"
:
[
...
...
packages/fuselage-hooks/CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage-hooks
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage-hooks
...
...
packages/fuselage-hooks/package.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/fuselage-hooks"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"description"
:
"React Hooks for Fuselage, Rocket.Chat's design system"
,
"homepage"
:
"https://rocket.chat/Rocket.Chat.Fuselage"
,
"author"
:
{
...
...
packages/fuselage-tokens/CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage-tokens
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage-tokens
...
...
packages/fuselage-tokens/package.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/fuselage-tokens"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"description"
:
"Design tokens for Fuselage, Rocket.Chat's design system"
,
"homepage"
:
"https://rocket.chat/Rocket.Chat.Fuselage"
,
"author"
:
{
...
...
packages/fuselage-ui-kit/CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage-ui-kit
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage-ui-kit
...
...
packages/fuselage-ui-kit/package-lock.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/fuselage-ui-kit"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
...
...
packages/fuselage-ui-kit/package.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/fuselage-ui-kit"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"description"
:
"Package ui kit "
,
"author"
:
"Guilherme Gazzo <guilhermegazzo@gmail.com>"
,
"homepage"
:
"https://github.com/RocketChat/Rocket.Chat.Fuselage#readme"
,
...
...
@@ -35,7 +35,7 @@
"url"
:
"https://github.com/RocketChat/Rocket.Chat.Fuselage/issues"
},
"dependencies"
:
{
"@rocket.chat/ui-kit"
:
"^0.2.0-alpha.2
8
"
"@rocket.chat/ui-kit"
:
"^0.2.0-alpha.2
9
"
},
"peerDependencies"
:
{
"@rocket.chat/fuselage"
:
"^0.2.0-alpha.23"
,
...
...
@@ -47,7 +47,7 @@
"@babel/plugin-transform-runtime"
:
"^7.5.0"
,
"@babel/preset-env"
:
"^7.4.5"
,
"@babel/preset-react"
:
"^7.7.4"
,
"@rocket.chat/fuselage"
:
"^0.2.0-alpha.2
8
"
,
"@rocket.chat/fuselage"
:
"^0.2.0-alpha.2
9
"
,
"@storybook/addon-actions"
:
"5.2.4"
,
"@storybook/addon-backgrounds"
:
"5.2.4"
,
"@storybook/addon-centered"
:
"5.2.4"
,
...
...
packages/fuselage-ui-kit/src/Overflow.js
View file @
2cb5aaaf
...
...
@@ -22,18 +22,21 @@ export const Overflow = ({ context, options, parser, ...element }) => {
hide
();
});
const
ref
=
useRef
();
const
onClick
=
useCallback
(()
=>
ref
.
current
.
focus
()
&
show
(),
[]);
const
handleSelection
=
useCallback
((...
args
)
=>
{
fireChange
(...
args
);
reset
();
hide
();
},
[]);
const
ref
=
useRef
();
return
(
<>
<
Button
ref
=
{
ref
}
small
ghost
onClick
=
{
show
}
ghost
onClick
=
{
onClick
}
onBlur
=
{
hide
}
onKeyUp
=
{
handleKeyUp
}
onKeyDown
=
{
handleKeyDown
}
...
...
packages/fuselage/CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/fuselage
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
...
...
packages/fuselage/package.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/fuselage"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"author"
:
{
"name"
:
"Rocket.Chat"
,
"url"
:
"https://rocket.chat/"
...
...
@@ -48,7 +48,7 @@
"@babel/preset-env"
:
"^7.7.6"
,
"@babel/preset-react"
:
"^7.7.4"
,
"@rocket.chat/eslint-config"
:
"^0.4.0"
,
"@rocket.chat/fuselage-hooks"
:
"^0.2.0-alpha.2
8
"
,
"@rocket.chat/fuselage-hooks"
:
"^0.2.0-alpha.2
9
"
,
"@storybook/addon-actions"
:
"5.2.8"
,
"@storybook/addon-backgrounds"
:
"5.2.8"
,
"@storybook/addon-centered"
:
"5.2.8"
,
...
...
@@ -120,8 +120,8 @@
}
},
"dependencies"
:
{
"@rocket.chat/fuselage-tokens"
:
"^0.2.0-alpha.2
8
"
,
"@rocket.chat/icons"
:
"^0.2.0-alpha.2
8
"
"@rocket.chat/fuselage-tokens"
:
"^0.2.0-alpha.2
9
"
,
"@rocket.chat/icons"
:
"^0.2.0-alpha.2
9
"
},
"browserslist"
:
{
"production"
:
[
...
...
packages/fuselage/src/components/Box/Position/index.js
View file @
2cb5aaaf
...
...
@@ -58,20 +58,19 @@ export const Position = ({ anchor, width = 'stretch', style, className, children
const
[
position
,
setPosition
]
=
useState
();
const
ref
=
useRef
();
const
{
offsetWidth
}
=
anchor
.
current
||
{}
;
const
resizer
=
useRef
()
;
const
{
offsetWidth
}
=
anchor
.
current
||
{};
useLayoutEffect
(()
=>
{
if
(
!
ref
.
current
||
!
anchor
.
current
)
{
return
;
}
const
[
vertical
,
horizontal
]
=
placement
.
split
(
'
'
);
if
(
typeof
ResizeObserver
===
'
undefined
'
)
{
return
;
}
const
handlePosition
=
throttle
(()
=>
{
const
anchorPosition
=
offset
(
anchor
.
current
);
const
elementPosition
=
offset
(
ref
.
current
.
parentElement
);
setPosition
({
...
width
===
'
stretch
'
&&
anchor
.
current
&&
{
width
:
offsetWidth
,
...
...
@@ -87,20 +86,23 @@ export const Position = ({ anchor, width = 'stretch', style, className, children
},
30
);
handlePosition
();
const
resizeObserver
=
new
ResizeObserver
(
handlePosition
);
const
{
current
}
=
anchor
;
if
(
typeof
ResizeObserver
!==
'
undefined
'
)
{
resizer
.
current
=
new
ResizeObserver
(
handlePosition
);
resizer
.
current
.
observe
(
current
);
}
window
.
addEventListener
(
'
scroll
'
,
handlePosition
);
window
.
addEventListener
(
'
resize
'
,
handlePosition
);
const
{
current
}
=
anchor
;
resizeObserver
.
observe
(
current
);
return
()
=>
{
window
.
removeEventListener
(
'
scroll
'
,
handlePosition
);
window
.
removeEventListener
(
'
resize
'
,
handlePosition
);
resize
Observer
.
unobserve
(
current
);
resize
r
.
current
&&
resizer
.
current
.
unobserve
(
current
);
};
},
[
anchor
.
current
,
anchor
.
current
,
placement
,
offsetWidth
]);
},
[
anchor
.
current
,
placement
,
offsetWidth
]);
const
portalContainer
=
useMemo
(()
=>
{
const
element
=
document
.
createElement
(
'
div
'
);
...
...
packages/icons/CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/icons
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/icons
...
...
packages/icons/package.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/icons"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"author"
:
{
"name"
:
"Rocket.Chat"
,
"url"
:
"https://rocket.chat/"
...
...
packages/ui-kit/CHANGELOG.md
View file @
2cb5aaaf
...
...
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See
[
Conventional Commits
](
https://conventionalcommits.org
)
for commit guidelines.
# [0.2.0-alpha.29](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.28...v0.2.0-alpha.29) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/ui-kit
# [0.2.0-alpha.28](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.2.0-alpha.27...v0.2.0-alpha.28) (2020-02-10)
**Note:**
Version bump only for package @rocket.chat/ui-kit
...
...
packages/ui-kit/package.json
View file @
2cb5aaaf
{
"name"
:
"@rocket.chat/ui-kit"
,
"version"
:
"0.2.0-alpha.2
8
"
,
"version"
:
"0.2.0-alpha.2
9
"
,
"description"
:
"Package Fuselage ui kit "
,
"author"
:
"Guilherme Gazzo <guilhermegazzo@gmail.com>"
,
"homepage"
:
"https://github.com/RocketChat/Rocket.Chat.Fuselage#readme"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment