Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Headless API #639

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
4832035
Add headless API
boatbomber Sep 25, 2022
be89259
Add Address and ProjectName when connected
boatbomber Sep 25, 2022
f3de0c3
Nicer notification formatting and info
boatbomber Sep 25, 2022
2a25193
Add CreateApiContext and more caller info
boatbomber Sep 27, 2022
17b2752
Add Changed event
boatbomber Sep 28, 2022
6284d83
Use full caller as key to avoid conflicts
boatbomber Sep 28, 2022
d7cee5c
Add api permissions
boatbomber Sep 28, 2022
e3a8152
Handle plugin state prior to headless
boatbomber Sep 30, 2022
e0c7b51
Support cloud plugins that have no folder
boatbomber Sep 30, 2022
ea08d28
Add assertions
boatbomber Sep 30, 2022
471215f
Add rate limiting
boatbomber Sep 30, 2022
6a5876c
Include source in Test output for debugging
boatbomber Sep 30, 2022
2a8cb11
Clearer names and titles
boatbomber Sep 30, 2022
7e7583b
Merge branch 'master' into headless-api
boatbomber Oct 1, 2022
7c0a67b
Merge branch 'master' of boatbomber/rojo into headless-api
boatbomber Oct 8, 2022
ebdffb0
Sanitiza requested APIs
boatbomber Oct 8, 2022
4275783
Add permissions page
boatbomber Jan 4, 2023
7c1afd5
Add permission management listings
boatbomber Jan 4, 2023
de33cf0
Genericize popup state
boatbomber Jan 4, 2023
d158ccb
Simplify popup handling
boatbomber Jan 4, 2023
6fddcc5
Generic popup titles
boatbomber Jan 5, 2023
cf5e13f
Add api conflict popup
boatbomber Jan 5, 2023
3b1aca2
Clearer button UX
boatbomber Jan 5, 2023
e24657c
Better light theme support
boatbomber Jan 5, 2023
9cf1956
Don't scroll the navbar
boatbomber Jan 5, 2023
d83543e
Handle falsy API values
boatbomber Jan 5, 2023
9d412a3
Merge branch 'master' of https://github.com/rojo-rbx/rojo into headle…
boatbomber Jan 5, 2023
5cf9a7d
Handle nil APIs
boatbomber Jan 9, 2023
8a8ee80
Move api descs to top
boatbomber Jan 9, 2023
36ec55d
Merge branch 'master' into headless-api
boatbomber Apr 2, 2023
ba634d4
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber May 31, 2023
b68b89b
Update changelog
boatbomber Jun 4, 2023
1ff018a
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Jul 4, 2023
a795e23
Fix typo in log
boatbomber Jul 4, 2023
7d1ee6e
Support actions on third party notifs
boatbomber Jul 4, 2023
2f78d94
Undo old notif changes
boatbomber Jul 4, 2023
dd30b16
Improve sanitization error messages
boatbomber Jul 4, 2023
5c0e1d0
Adjust the UI for third party notifications to include source
boatbomber Jul 4, 2023
91cba1b
Return dismiss function from Notify
boatbomber Jul 4, 2023
dcfdf7f
Prevent misuse of RequestAccess
boatbomber Jul 5, 2023
a0b9931
Fix editing permissions to use new request api
boatbomber Jul 8, 2023
1220b5c
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Jul 17, 2023
478cfba
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Jul 23, 2023
dda01ae
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Aug 15, 2023
4ab51e1
Merge branch 'master' into headless-api
boatbomber Aug 21, 2023
b401b6d
Use new setting input prop
boatbomber Aug 21, 2023
955b143
Change to a game.Rojo module instead of _G
boatbomber Sep 4, 2023
d1d7052
Properly handle changing and removing permissions
boatbomber Sep 4, 2023
c9ca6be
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Sep 18, 2023
5884247
Use latest plugingui component
boatbomber Sep 18, 2023
1042b36
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Sep 19, 2023
b8e5fda
Stylua formatting
boatbomber Sep 19, 2023
e7cf733
Remove unneeded frame
boatbomber Sep 19, 2023
3e0d850
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Oct 3, 2023
15f5a89
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Oct 30, 2023
7d8ba31
Merge branch 'headless-api' of https://github.com/boatbomber/rojo int…
boatbomber Oct 30, 2023
e066846
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Jan 2, 2024
1bb3c81
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Jan 6, 2024
34f920a
Merge branch 'master' into headless-api
boatbomber Jan 17, 2024
3a28b03
Merge branch 'master' into headless-api
boatbomber Jan 30, 2024
9397dba
Merge branch 'master' of https://github.com/rojo-rbx/rojo into headle…
boatbomber Feb 1, 2024
528e2f0
Merge branch 'master' of https://github.com/boatbomber/rojo into head…
boatbomber Feb 1, 2024
09bcef8
Remove unused vars
boatbomber Feb 1, 2024
5609205
Fix shadowed and unused theme
boatbomber Feb 1, 2024
997a040
Fix changelog pr link
boatbomber Feb 13, 2024
e459ae9
Merge branch 'master' of https://github.com/rojo-rbx/rojo into headle…
boatbomber Feb 13, 2024
b98af57
Validate settings type before passing them to set
boatbomber Feb 13, 2024
57b37f1
Strip duplicate APIs in request
boatbomber Feb 13, 2024
1cd2153
Move permissions above experimental section
boatbomber Feb 13, 2024
ab75e2b
Switch to userdata with locked metatable
boatbomber Feb 13, 2024
0de0610
Spawn action click callbacks in notifs
boatbomber Feb 13, 2024
9444c84
Improve UX/DX for requesting permissions
boatbomber Feb 13, 2024
a381479
Fix type signature
boatbomber Feb 13, 2024
fd2e309
Note that Test is for development
boatbomber Feb 13, 2024
d1078a1
Clearer text for users
boatbomber Feb 13, 2024
a7e15a0
Remove setsetting
boatbomber Feb 14, 2024
1af32ad
Ensure permissions are always listed in the same order
boatbomber Feb 14, 2024
177d480
Merge branch 'master' of https://github.com/rojo-rbx/rojo into headle…
boatbomber Nov 6, 2024
6f9fd5c
add images to assets
boatbomber Nov 6, 2024
eeb6f00
Move some image assets into icons dir
boatbomber Nov 6, 2024
cfea77e
Merge branch 'master' of https://github.com/rojo-rbx/rojo into headle…
boatbomber Dec 22, 2024
03fa1b3
Use new theme font/textsize
boatbomber Dec 22, 2024
a330c12
Fix theme usage
boatbomber Dec 22, 2024
12e3d2b
Add verified icon
boatbomber Dec 22, 2024
139b283
Improve displayed info about third party plugins
boatbomber Dec 22, 2024
37d893e
Remove unused service
boatbomber Dec 22, 2024
83a4fce
Simplify creator info and differentiate user/group
boatbomber Dec 22, 2024
742c2a3
Improved creator text style
boatbomber Dec 22, 2024
92a3044
Include creator info in notifs
boatbomber Dec 23, 2024
c45271b
Improve notification layout
boatbomber Dec 24, 2024
1ac8b9d
Merge branch 'fix-notif-widths' of https://github.com/boatbomber/rojo…
boatbomber Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Rojo Changelog

## Unreleased Changes
* Added headless API for Studio companion plugins. ([#639])
* Rojo now converts any line endings to LF, preventing spurious diffs when syncing Lua files on Windows ([#854])
* Fixed Rojo plugin failing to connect when project contains certain unreadable properties ([#848])
* Added popout diff visualizer for table properties like Attributes and Tags ([#834])
Expand Down Expand Up @@ -54,6 +55,7 @@

**All** sync rules are reset between project files, so they must be specified in each one when nesting them. This is to ensure that nothing can break other projects by changing how files are synced!

[#639]: https://github.com/rojo-rbx/rojo/pull/639
[#813]: https://github.com/rojo-rbx/rojo/pull/813
[#834]: https://github.com/rojo-rbx/rojo/pull/834
[#838]: https://github.com/rojo-rbx/rojo/pull/838
Expand Down Expand Up @@ -96,6 +98,7 @@

## [7.4.0-rc1] - October 3, 2023
### Additions

#### Project format
* Added support for `.toml` files to `$path` ([#633])
* Added support for `Font` and `CFrame` attributes ([rbx-dom#299], [rbx-dom#296])
Expand Down
Binary file added assets/thirdParty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions plugin/src/App/Components/ScrollingFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local function ScrollingFrame(props)
ElasticBehavior = Enum.ElasticBehavior.Always,
ScrollingDirection = props.scrollingDirection or Enum.ScrollingDirection.Y,

LayoutOrder = props.layoutOrder,
Size = props.size,
Position = props.position,
AnchorPoint = props.anchorPoint,
Expand Down
129 changes: 129 additions & 0 deletions plugin/src/App/ConflictAPIPopup.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin
local Packages = Rojo.Packages

local Roact = require(Packages.Roact)

local Config = require(Plugin.Config)
local Version = require(Plugin.Version)
local Theme = require(Plugin.App.Theme)

local TextButton = require(Plugin.App.Components.TextButton)

local e = Roact.createElement

local ConflictAPIPopup = Roact.Component:extend("ConflictAPIPopup")

function ConflictAPIPopup:render()
return Theme.with(function(theme)
theme = theme.Settings

return e("Frame", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 1, 0),
}, {
Padding = e("UIPadding", {
PaddingLeft = UDim.new(0, 20),
PaddingRight = UDim.new(0, 20),
PaddingTop = UDim.new(0, 15),
PaddingBottom = UDim.new(0, 15),
}),

Details = e("Frame", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 1, 0),
}, {
Layout = e("UIListLayout", {
FillDirection = Enum.FillDirection.Vertical,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 15),
HorizontalAlignment = Enum.HorizontalAlignment.Center,
}),

Info = e("TextLabel", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, 0),
AutomaticSize = Enum.AutomaticSize.Y,
Text = "There is already a Rojo API exposed by a Rojo plugin. Do you want to overwrite it with this one?",
Font = Enum.Font.GothamMedium,
TextSize = 17,
TextColor3 = theme.Setting.NameColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextWrapped = true,
TextTransparency = self.props.transparency,
LayoutOrder = 1,
}),

Existing = e("TextLabel", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, 0),
AutomaticSize = Enum.AutomaticSize.Y,
Text = string.format(
"Existing: Version %s, Protocol %d",
Version.display(self.props.existingAPI.Version),
self.props.existingAPI.ProtocolVersion
),
Font = Enum.Font.Gotham,
TextSize = 15,
TextColor3 = theme.Setting.DescriptionColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = self.props.transparency,
LayoutOrder = 2,
}),

Incoming = e("TextLabel", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, 0),
AutomaticSize = Enum.AutomaticSize.Y,
Text = string.format(
"Incoming: Version %s, Protocol %d",
Version.display(Config.version),
Config.protocolVersion
),
Font = Enum.Font.Gotham,
TextSize = 15,
TextColor3 = theme.Setting.DescriptionColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = self.props.transparency,
LayoutOrder = 3,
}),
}),

Actions = e("Frame", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, 34),
Position = UDim2.fromScale(0, 1),
AnchorPoint = Vector2.new(0, 1),
}, {
Layout = e("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 10),
HorizontalAlignment = Enum.HorizontalAlignment.Right,
}),

Keep = e(TextButton, {
text = "Keep",
style = "Bordered",
transparency = self.props.transparency,
layoutOrder = 1,
onClick = function()
self.props.onDeny()
end,
}),

Overwrite = e(TextButton, {
text = "Overwrite",
style = "Solid",
transparency = self.props.transparency,
layoutOrder = 2,
onClick = function()
self.props.onAccept()
end,
}),
}),
})
end)
end

return ConflictAPIPopup
105 changes: 62 additions & 43 deletions plugin/src/App/Notifications.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,18 @@ function Notification:render()
buttonsX += (count - 1) * 5
end

local paddingY, logoSize = 20, 32
local paddingX, paddingY, logoSize = 24, 20, 32
local sourceY = if self.props.source then logoSize + 5 else 0
local sourceX = if self.props.source
then TextService:GetTextSize(self.props.source, 15, Enum.Font.GothamMedium, Vector2.new(350, 15)).X + logoSize + 5
else 0
local actionsY = if self.props.actions then 35 else 0
local contentX = math.max(textBounds.X, buttonsX)
local contentX = math.max(textBounds.X, buttonsX, sourceX) + (if self.props.thirdParty then 0 else logoSize + 3) + 2

local size = self.binding:map(function(value)
return UDim2.fromOffset(
(35 + 40 + contentX) * value,
5 + actionsY + paddingY + math.max(logoSize, textBounds.Y)
(paddingX + contentX) * value,
5 + actionsY + sourceY + paddingY + math.max(logoSize, textBounds.Y)
)
end)

Expand All @@ -146,56 +150,69 @@ function Notification:render()
transparency = transparency,
size = UDim2.new(1, 0, 1, 0),
}, {
Contents = e("Frame", {
Size = UDim2.new(0, 35 + contentX, 1, -paddingY),
Position = UDim2.new(0, 0, 0, paddingY / 2),
Logo = e("ImageLabel", {
ImageTransparency = transparency,
Image = if self.props.thirdParty
then Assets.Images.ThirdPartyPlugin
else Assets.Images.PluginButton,
BackgroundTransparency = 1,
}, {
Logo = e("ImageLabel", {
ImageTransparency = transparency,
Image = Assets.Images.PluginButton,
BackgroundTransparency = 1,
Size = UDim2.new(0, logoSize, 0, logoSize),
Position = UDim2.new(0, 0, 0, 0),
AnchorPoint = Vector2.new(0, 0),
}),
Info = e("TextLabel", {
Text = self.props.text,
Size = UDim2.new(0, logoSize, 0, logoSize),
Position = UDim2.new(0, 0, 0, 0),
AnchorPoint = Vector2.new(0, 0),
}),
Source = if self.props.source
then e("TextLabel", {
Text = self.props.source,
Font = Enum.Font.GothamMedium,
TextSize = 15,
TextColor3 = theme.Notification.InfoColor,
TextTransparency = transparency,
TextXAlignment = Enum.TextXAlignment.Left,
TextWrapped = true,

Size = UDim2.new(0, textBounds.X, 0, textBounds.Y),
Position = UDim2.fromOffset(35, 0),
TextTruncate = Enum.TextTruncate.AtEnd,

LayoutOrder = 1,
Size = UDim2.new(1, -logoSize - 5, 0, logoSize),
Position = UDim2.fromOffset(logoSize + 5, 0),
BackgroundTransparency = 1,
}),
Actions = if self.props.actions
then e("Frame", {
Size = UDim2.new(1, -40, 0, 35),
Position = UDim2.new(1, 0, 1, 0),
AnchorPoint = Vector2.new(1, 1),
BackgroundTransparency = 1,
}, {
Layout = e("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
HorizontalAlignment = Enum.HorizontalAlignment.Right,
VerticalAlignment = Enum.VerticalAlignment.Center,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 5),
}),
Buttons = Roact.createFragment(actionButtons),
})
else nil,
})
else nil,
Message = e("TextLabel", {
Text = self.props.text,
Font = Enum.Font.GothamMedium,
TextSize = 15,
TextColor3 = theme.Notification.InfoColor,
TextTransparency = transparency,
TextXAlignment = Enum.TextXAlignment.Left,
TextWrapped = true,

Size = UDim2.new(0, textBounds.X, 0, textBounds.Y),
Position = if self.props.thirdParty
then UDim2.fromOffset(0, logoSize + 5)
else UDim2.fromOffset(logoSize + 3, 0),
BackgroundTransparency = 1,
}),
Actions = if self.props.actions
then e("Frame", {
Size = UDim2.new(1, -40, 0, 35),
Position = UDim2.new(1, 0, 1, 0),
AnchorPoint = Vector2.new(1, 1),
BackgroundTransparency = 1,
}, {
Layout = e("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
HorizontalAlignment = Enum.HorizontalAlignment.Right,
VerticalAlignment = Enum.VerticalAlignment.Center,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 5),
}),
Buttons = Roact.createFragment(actionButtons),
})
else nil,

Padding = e("UIPadding", {
PaddingLeft = UDim.new(0, 17),
PaddingRight = UDim.new(0, 15),
PaddingLeft = UDim.new(0, paddingX / 2),
PaddingRight = UDim.new(0, paddingX / 2),
PaddingTop = UDim.new(0, paddingY / 2),
PaddingBottom = UDim.new(0, paddingY / 2),
}),
}),
})
Expand All @@ -214,6 +231,8 @@ function Notifications:render()
timestamp = notif.timestamp,
timeout = notif.timeout,
actions = notif.actions,
source = notif.source,
thirdParty = notif.thirdParty,
layoutOrder = (notif.timestamp - baseClock),
onClose = function()
self.props.onClose(id)
Expand Down
Loading
Loading