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 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
89 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
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. ([#631])
boatbomber marked this conversation as resolved.
Show resolved Hide resolved
* Added popout diff visualizer for table properties like Attributes and Tags ([#834])
* Updated Theme to use Studio colors ([#838])
* Added experimental setting for Auto Connect in playtests ([#840])
Expand Down Expand Up @@ -51,6 +52,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!

[#631]: https://github.com/rojo-rbx/rojo/pull/631
boatbomber marked this conversation as resolved.
Show resolved Hide resolved
[#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 @@ -89,6 +91,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
137 changes: 137 additions & 0 deletions plugin/src/App/Components/Toggle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
local TextService = game:GetService("TextService")

local Rojo = script:FindFirstAncestor("Rojo")
local Plugin = Rojo.Plugin
local Packages = Rojo.Packages

local Roact = require(Packages.Roact)

local Theme = require(Plugin.App.Theme)

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

local e = Roact.createElement

local DIVIDER_FADE_SIZE = 0.1

local function getTextBounds(text, textSize, font, lineHeight, bounds)
local textBounds = TextService:GetTextSize(text, textSize, font, bounds)

local lineCount = textBounds.Y / textSize
local lineHeightAbsolute = textSize * lineHeight

return Vector2.new(textBounds.X, lineHeightAbsolute * lineCount - (lineHeightAbsolute - textSize))
end

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

function Toggle:init()
self.contentSize, self.setContentSize = Roact.createBinding(Vector2.new(0, 0))
self.containerSize, self.setContainerSize = Roact.createBinding(Vector2.new(0, 0))
end

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

return e("Frame", {
Size = self.contentSize:map(function(value)
return UDim2.new(1, 0, 0, 20 + value.Y + 20)
end),
LayoutOrder = self.props.layoutOrder,
ZIndex = -self.props.layoutOrder,
BackgroundTransparency = 1,

[Roact.Change.AbsoluteSize] = function(object)
self.setContainerSize(object.AbsoluteSize)
end,
}, {
Input = e(Checkbox, {
active = self.props.active,
transparency = self.props.transparency,
position = UDim2.new(1, 0, 0.5, 0),
anchorPoint = Vector2.new(1, 0.5),
onClick = self.props.onClick,
}),

Text = e("Frame", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
}, {
Name = e("TextLabel", {
Text = self.props.name,
Font = Enum.Font.GothamBold,
TextSize = 17,
TextColor3 = theme.Setting.NameColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = self.props.transparency,

Size = UDim2.new(1, 0, 0, 17),

LayoutOrder = 1,
BackgroundTransparency = 1,
}),

Description = e("TextLabel", {
Text = self.props.description,
Font = Enum.Font.Gotham,
LineHeight = 1.2,
TextSize = 14,
TextColor3 = theme.Setting.DescriptionColor,
TextXAlignment = Enum.TextXAlignment.Left,
TextTransparency = self.props.transparency,
TextWrapped = true,

Size = self.containerSize:map(function(value)
local offset = self.props.options ~= nil and 120 or 40
local textBounds = getTextBounds(
self.props.description,
14,
Enum.Font.Gotham,
1.2,
Vector2.new(value.X - offset, math.huge)
)
return UDim2.new(1, -offset, 0, textBounds.Y)
end),

LayoutOrder = 2,
BackgroundTransparency = 1,
}),

Layout = e("UIListLayout", {
VerticalAlignment = Enum.VerticalAlignment.Center,
FillDirection = Enum.FillDirection.Vertical,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 6),

[Roact.Change.AbsoluteContentSize] = function(object)
self.setContentSize(object.AbsoluteContentSize)
end,
}),

Padding = e("UIPadding", {
PaddingTop = UDim.new(0, 20),
PaddingBottom = UDim.new(0, 20),
}),
}),

Divider = e("Frame", {
BackgroundColor3 = theme.DividerColor,
BackgroundTransparency = self.props.transparency,
Size = UDim2.new(1, 0, 0, 1),
BorderSizePixel = 0,
}, {
Gradient = e("UIGradient", {
Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1),
NumberSequenceKeypoint.new(DIVIDER_FADE_SIZE, 0),
NumberSequenceKeypoint.new(1 - DIVIDER_FADE_SIZE, 0),
NumberSequenceKeypoint.new(1, 1),
}),
}),
}),
})
end)
end

return Toggle
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
Loading
Loading