@rbxts/centurion-ui 1.0.0-dev-284510d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/app/app.d.ts +6 -0
- package/out/app/app.lua +83 -0
- package/out/app/index.d.ts +1 -0
- package/out/app/init.lua +7 -0
- package/out/app/terminal-app.d.ts +1 -0
- package/out/app/terminal-app.lua +61 -0
- package/out/components/history/history-line.d.ts +10 -0
- package/out/components/history/history-line.lua +63 -0
- package/out/components/history/history-list.d.ts +15 -0
- package/out/components/history/history-list.lua +62 -0
- package/out/components/history/index.d.ts +1 -0
- package/out/components/history/init.lua +7 -0
- package/out/components/index.d.ts +1 -0
- package/out/components/init.lua +7 -0
- package/out/components/suggestions/badge.d.ts +16 -0
- package/out/components/suggestions/badge.lua +52 -0
- package/out/components/suggestions/index.d.ts +1 -0
- package/out/components/suggestions/init.lua +7 -0
- package/out/components/suggestions/main-suggestion.d.ts +12 -0
- package/out/components/suggestions/main-suggestion.lua +180 -0
- package/out/components/suggestions/suggestion-list.d.ts +8 -0
- package/out/components/suggestions/suggestion-list.lua +70 -0
- package/out/components/suggestions/suggestions.d.ts +1 -0
- package/out/components/suggestions/suggestions.lua +117 -0
- package/out/components/suggestions/types.d.ts +6 -0
- package/out/components/suggestions/types.lua +2 -0
- package/out/components/suggestions/util.d.ts +4 -0
- package/out/components/suggestions/util.lua +72 -0
- package/out/components/terminal-text-field.d.ts +11 -0
- package/out/components/terminal-text-field.lua +289 -0
- package/out/components/terminal-window.d.ts +1 -0
- package/out/components/terminal-window.lua +265 -0
- package/out/components/terminal.d.ts +1 -0
- package/out/components/terminal.lua +26 -0
- package/out/components/ui/frame.d.ts +20 -0
- package/out/components/ui/frame.lua +29 -0
- package/out/components/ui/group.d.ts +17 -0
- package/out/components/ui/group.lua +24 -0
- package/out/components/ui/layer.d.ts +7 -0
- package/out/components/ui/layer.lua +23 -0
- package/out/components/ui/outline.d.ts +14 -0
- package/out/components/ui/outline.lua +106 -0
- package/out/components/ui/padding.d.ts +10 -0
- package/out/components/ui/padding.lua +19 -0
- package/out/components/ui/scrolling-frame.d.ts +15 -0
- package/out/components/ui/scrolling-frame.lua +42 -0
- package/out/components/ui/shortcut-group.d.ts +6 -0
- package/out/components/ui/shortcut-group.lua +100 -0
- package/out/components/ui/text-field.d.ts +13 -0
- package/out/components/ui/text-field.lua +53 -0
- package/out/components/ui/text.d.ts +20 -0
- package/out/components/ui/text.lua +55 -0
- package/out/constants/options.d.ts +2 -0
- package/out/constants/options.lua +19 -0
- package/out/constants/springs.d.ts +19 -0
- package/out/constants/springs.lua +20 -0
- package/out/constants/text.d.ts +3 -0
- package/out/constants/text.lua +9 -0
- package/out/constants/util.d.ts +1 -0
- package/out/constants/util.lua +7 -0
- package/out/hooks/use-motion.d.ts +4 -0
- package/out/hooks/use-motion.lua +24 -0
- package/out/hooks/use-px.d.ts +24 -0
- package/out/hooks/use-px.lua +56 -0
- package/out/hooks/use-store.d.ts +3 -0
- package/out/hooks/use-store.lua +7 -0
- package/out/index.d.ts +2 -0
- package/out/init.lua +10 -0
- package/out/palette.d.ts +56 -0
- package/out/palette.lua +51 -0
- package/out/providers/api-provider.d.ts +8 -0
- package/out/providers/api-provider.lua +17 -0
- package/out/providers/options-provider.d.ts +13 -0
- package/out/providers/options-provider.lua +39 -0
- package/out/providers/root-provider.d.ts +11 -0
- package/out/providers/root-provider.lua +24 -0
- package/out/store/app/app-selectors.d.ts +2 -0
- package/out/store/app/app-selectors.lua +7 -0
- package/out/store/app/app-slice.d.ts +8 -0
- package/out/store/app/app-slice.lua +17 -0
- package/out/store/app/index.d.ts +2 -0
- package/out/store/app/init.lua +10 -0
- package/out/store/command/command-selectors.d.ts +2 -0
- package/out/store/command/command-selectors.lua +7 -0
- package/out/store/command/command-slice.d.ts +15 -0
- package/out/store/command/command-slice.lua +21 -0
- package/out/store/command/index.d.ts +2 -0
- package/out/store/command/init.lua +10 -0
- package/out/store/history/history-slice.d.ts +11 -0
- package/out/store/history/history-slice.lua +52 -0
- package/out/store/history/index.d.ts +1 -0
- package/out/store/history/init.lua +7 -0
- package/out/store/index.d.ts +46 -0
- package/out/store/init.lua +18 -0
- package/out/store/suggestion/index.d.ts +2 -0
- package/out/store/suggestion/init.lua +10 -0
- package/out/store/suggestion/suggestion-selectors.d.ts +2 -0
- package/out/store/suggestion/suggestion-selectors.lua +7 -0
- package/out/store/suggestion/suggestion-slice.d.ts +9 -0
- package/out/store/suggestion/suggestion-slice.lua +15 -0
- package/out/store/text/index.d.ts +2 -0
- package/out/store/text/init.lua +10 -0
- package/out/store/text/text-selectors.d.ts +3 -0
- package/out/store/text/text-selectors.lua +11 -0
- package/out/store/text/text-slice.d.ts +20 -0
- package/out/store/text/text-slice.lua +29 -0
- package/out/types.d.ts +40 -0
- package/out/types.lua +2 -0
- package/out/util/argument.d.ts +2 -0
- package/out/util/argument.lua +26 -0
- package/out/util/suggestion.d.ts +4 -0
- package/out/util/suggestion.lua +208 -0
- package/package.json +54 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Signal } from "@rbxts/beacon";
|
|
2
|
+
import { ClientAPI } from "@rbxts/centurion";
|
|
3
|
+
import React from "@rbxts/react";
|
|
4
|
+
import { InterfaceOptions } from "../types";
|
|
5
|
+
interface RootProviderProps extends React.PropsWithChildren {
|
|
6
|
+
api: ClientAPI;
|
|
7
|
+
options: InterfaceOptions;
|
|
8
|
+
optionsChanged: Signal<[options: Partial<InterfaceOptions>]>;
|
|
9
|
+
}
|
|
10
|
+
export declare function RootProvider({ api, options, optionsChanged, children, }: RootProviderProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local ReflexProvider = TS.import(script, TS.getModule(script, "@rbxts", "react-reflex")).ReflexProvider
|
|
5
|
+
local store = TS.import(script, script.Parent.Parent, "store").store
|
|
6
|
+
local ApiProvider = TS.import(script, script.Parent, "api-provider").ApiProvider
|
|
7
|
+
local OptionsProvider = TS.import(script, script.Parent, "options-provider").OptionsProvider
|
|
8
|
+
local function RootProvider(_param)
|
|
9
|
+
local api = _param.api
|
|
10
|
+
local options = _param.options
|
|
11
|
+
local optionsChanged = _param.optionsChanged
|
|
12
|
+
local children = _param.children
|
|
13
|
+
return React.createElement(ReflexProvider, {
|
|
14
|
+
producer = store,
|
|
15
|
+
}, React.createElement(ApiProvider, {
|
|
16
|
+
api = api,
|
|
17
|
+
}, React.createElement(OptionsProvider, {
|
|
18
|
+
value = options,
|
|
19
|
+
changed = optionsChanged,
|
|
20
|
+
}, children)))
|
|
21
|
+
end
|
|
22
|
+
return {
|
|
23
|
+
RootProvider = RootProvider,
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
|
|
4
|
+
local initialAppState = {
|
|
5
|
+
visible = false,
|
|
6
|
+
}
|
|
7
|
+
local appSlice = createProducer(initialAppState, {
|
|
8
|
+
setVisible = function(state, visible)
|
|
9
|
+
local _object = table.clone(state)
|
|
10
|
+
setmetatable(_object, nil)
|
|
11
|
+
_object.visible = visible
|
|
12
|
+
return _object
|
|
13
|
+
end,
|
|
14
|
+
})
|
|
15
|
+
return {
|
|
16
|
+
appSlice = appSlice,
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "app-selectors") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "app-slice") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
return exports
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ImmutableRegistryPath } from "@rbxts/centurion";
|
|
2
|
+
export interface CommandState {
|
|
3
|
+
path?: ImmutableRegistryPath;
|
|
4
|
+
argIndex?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const commandSlice: import("@rbxts/reflex").Producer<CommandState, {
|
|
7
|
+
setCommand: (state: CommandState, path?: ImmutableRegistryPath) => {
|
|
8
|
+
path: ImmutableRegistryPath | undefined;
|
|
9
|
+
argIndex?: number;
|
|
10
|
+
};
|
|
11
|
+
setArgIndex: (state: CommandState, index?: number) => {
|
|
12
|
+
argIndex: number | undefined;
|
|
13
|
+
path?: ImmutableRegistryPath;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
|
|
4
|
+
local initialCommandState = {}
|
|
5
|
+
local commandSlice = createProducer(initialCommandState, {
|
|
6
|
+
setCommand = function(state, path)
|
|
7
|
+
local _object = table.clone(state)
|
|
8
|
+
setmetatable(_object, nil)
|
|
9
|
+
_object.path = path
|
|
10
|
+
return _object
|
|
11
|
+
end,
|
|
12
|
+
setArgIndex = function(state, index)
|
|
13
|
+
local _object = table.clone(state)
|
|
14
|
+
setmetatable(_object, nil)
|
|
15
|
+
_object.argIndex = index
|
|
16
|
+
return _object
|
|
17
|
+
end,
|
|
18
|
+
})
|
|
19
|
+
return {
|
|
20
|
+
commandSlice = commandSlice,
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "command-selectors") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "command-slice") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
return exports
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface HistoryState {
|
|
2
|
+
commandHistory: string[];
|
|
3
|
+
commandHistoryIndex: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const historySlice: import("@rbxts/reflex").Producer<HistoryState, {
|
|
6
|
+
addCommandHistory: (state: HistoryState, command: string, limit: number) => HistoryState;
|
|
7
|
+
setCommandHistoryIndex: (state: HistoryState, index: number) => {
|
|
8
|
+
commandHistoryIndex: number;
|
|
9
|
+
commandHistory: string[];
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
|
|
4
|
+
local initialHistoryState = {
|
|
5
|
+
commandHistory = {},
|
|
6
|
+
commandHistoryIndex = -1,
|
|
7
|
+
}
|
|
8
|
+
--[[
|
|
9
|
+
*
|
|
10
|
+
* Limits an array by removing the first n (limit) elements if
|
|
11
|
+
* the array's size exceeds the limit.
|
|
12
|
+
*
|
|
13
|
+
* @param array The array to limit
|
|
14
|
+
* @param limit The limit
|
|
15
|
+
|
|
16
|
+
]]
|
|
17
|
+
local function limitArray(array, limit)
|
|
18
|
+
if #array <= limit then
|
|
19
|
+
return nil
|
|
20
|
+
end
|
|
21
|
+
for i = 0, math.min(#array - 1, limit - 1) do
|
|
22
|
+
table.remove(array, i + 1)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
local historySlice = createProducer(initialHistoryState, {
|
|
26
|
+
addCommandHistory = function(state, command, limit)
|
|
27
|
+
if #state.commandHistory > 0 and state.commandHistory[#state.commandHistory] == command then
|
|
28
|
+
return state
|
|
29
|
+
end
|
|
30
|
+
local _array = {}
|
|
31
|
+
local _length = #_array
|
|
32
|
+
local _array_1 = state.commandHistory
|
|
33
|
+
table.move(_array_1, 1, #_array_1, _length + 1, _array)
|
|
34
|
+
local commandHistory = _array
|
|
35
|
+
limitArray(commandHistory, limit)
|
|
36
|
+
local _command = command
|
|
37
|
+
table.insert(commandHistory, _command)
|
|
38
|
+
local _object = table.clone(state)
|
|
39
|
+
setmetatable(_object, nil)
|
|
40
|
+
_object.commandHistory = commandHistory
|
|
41
|
+
return _object
|
|
42
|
+
end,
|
|
43
|
+
setCommandHistoryIndex = function(state, index)
|
|
44
|
+
local _object = table.clone(state)
|
|
45
|
+
setmetatable(_object, nil)
|
|
46
|
+
_object.commandHistoryIndex = index
|
|
47
|
+
return _object
|
|
48
|
+
end,
|
|
49
|
+
})
|
|
50
|
+
return {
|
|
51
|
+
historySlice = historySlice,
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./history-slice";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InferState } from "@rbxts/reflex";
|
|
2
|
+
export type RootStore = typeof store;
|
|
3
|
+
export type RootState = InferState<RootStore>;
|
|
4
|
+
export declare const store: import("@rbxts/reflex").CombineProducers<{
|
|
5
|
+
app: import("@rbxts/reflex").Producer<import("./app").AppState, {
|
|
6
|
+
setVisible: (state: import("./app").AppState, visible: boolean) => {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
command: import("@rbxts/reflex").Producer<import("./command").CommandState, {
|
|
11
|
+
setCommand: (state: import("./command").CommandState, path?: import("@rbxts/centurion").ImmutableRegistryPath) => {
|
|
12
|
+
path: import("@rbxts/centurion").ImmutableRegistryPath | undefined;
|
|
13
|
+
argIndex?: number;
|
|
14
|
+
};
|
|
15
|
+
setArgIndex: (state: import("./command").CommandState, index?: number) => {
|
|
16
|
+
argIndex: number | undefined;
|
|
17
|
+
path?: import("@rbxts/centurion").ImmutableRegistryPath;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
history: import("@rbxts/reflex").Producer<import("./history").HistoryState, {
|
|
21
|
+
addCommandHistory: (state: import("./history").HistoryState, command: string, limit: number) => import("./history").HistoryState;
|
|
22
|
+
setCommandHistoryIndex: (state: import("./history").HistoryState, index: number) => {
|
|
23
|
+
commandHistoryIndex: number;
|
|
24
|
+
commandHistory: string[];
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
suggestion: import("@rbxts/reflex").Producer<import("./suggestion").SuggestionState, {
|
|
28
|
+
setSuggestion: (state: import("./suggestion").SuggestionState, suggestion?: import("../types").Suggestion) => {
|
|
29
|
+
current: import("../types").Suggestion | undefined;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
text: import("@rbxts/reflex").Producer<import("./text").TextState, {
|
|
33
|
+
setText: (state: import("./text").TextState, text: string, textParts: string[]) => {
|
|
34
|
+
value: string;
|
|
35
|
+
parts: string[];
|
|
36
|
+
index: number;
|
|
37
|
+
valid: boolean;
|
|
38
|
+
};
|
|
39
|
+
setTextValid: (state: import("./text").TextState, valid: boolean) => {
|
|
40
|
+
valid: boolean;
|
|
41
|
+
value: string;
|
|
42
|
+
parts: string[];
|
|
43
|
+
index: number;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local combineProducers = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).combineProducers
|
|
4
|
+
local appSlice = TS.import(script, script, "app").appSlice
|
|
5
|
+
local commandSlice = TS.import(script, script, "command").commandSlice
|
|
6
|
+
local historySlice = TS.import(script, script, "history").historySlice
|
|
7
|
+
local suggestionSlice = TS.import(script, script, "suggestion").suggestionSlice
|
|
8
|
+
local textSlice = TS.import(script, script, "text").textSlice
|
|
9
|
+
local store = combineProducers({
|
|
10
|
+
app = appSlice,
|
|
11
|
+
command = commandSlice,
|
|
12
|
+
history = historySlice,
|
|
13
|
+
suggestion = suggestionSlice,
|
|
14
|
+
text = textSlice,
|
|
15
|
+
})
|
|
16
|
+
return {
|
|
17
|
+
store = store,
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "suggestion-selectors") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "suggestion-slice") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
return exports
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Suggestion } from "../../types";
|
|
2
|
+
export interface SuggestionState {
|
|
3
|
+
current?: Suggestion;
|
|
4
|
+
}
|
|
5
|
+
export declare const suggestionSlice: import("@rbxts/reflex").Producer<SuggestionState, {
|
|
6
|
+
setSuggestion: (state: SuggestionState, suggestion?: Suggestion) => {
|
|
7
|
+
current: Suggestion | undefined;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
|
|
4
|
+
local initialSuggestionState = {}
|
|
5
|
+
local suggestionSlice = createProducer(initialSuggestionState, {
|
|
6
|
+
setSuggestion = function(state, suggestion)
|
|
7
|
+
local _object = table.clone(state)
|
|
8
|
+
setmetatable(_object, nil)
|
|
9
|
+
_object.current = suggestion
|
|
10
|
+
return _object
|
|
11
|
+
end,
|
|
12
|
+
})
|
|
13
|
+
return {
|
|
14
|
+
suggestionSlice = suggestionSlice,
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
for _k, _v in TS.import(script, script, "text-selectors") or {} do
|
|
5
|
+
exports[_k] = _v
|
|
6
|
+
end
|
|
7
|
+
for _k, _v in TS.import(script, script, "text-slice") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
return exports
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TextState {
|
|
2
|
+
value: string;
|
|
3
|
+
parts: string[];
|
|
4
|
+
index: number;
|
|
5
|
+
valid: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const textSlice: import("@rbxts/reflex").Producer<TextState, {
|
|
8
|
+
setText: (state: TextState, text: string, textParts: string[]) => {
|
|
9
|
+
value: string;
|
|
10
|
+
parts: string[];
|
|
11
|
+
index: number;
|
|
12
|
+
valid: boolean;
|
|
13
|
+
};
|
|
14
|
+
setTextValid: (state: TextState, valid: boolean) => {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
value: string;
|
|
17
|
+
parts: string[];
|
|
18
|
+
index: number;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
|
|
4
|
+
local initialTextState = {
|
|
5
|
+
value = "",
|
|
6
|
+
parts = {},
|
|
7
|
+
index = -1,
|
|
8
|
+
valid = false,
|
|
9
|
+
}
|
|
10
|
+
local textSlice = createProducer(initialTextState, {
|
|
11
|
+
setText = function(state, text, textParts)
|
|
12
|
+
local endsWithSpace = #textParts > 0 and #{ string.match(text, "%s$") } > 0
|
|
13
|
+
local _object = table.clone(state)
|
|
14
|
+
setmetatable(_object, nil)
|
|
15
|
+
_object.value = text
|
|
16
|
+
_object.parts = textParts
|
|
17
|
+
_object.index = if endsWithSpace then #textParts else #textParts - 1
|
|
18
|
+
return _object
|
|
19
|
+
end,
|
|
20
|
+
setTextValid = function(state, valid)
|
|
21
|
+
local _object = table.clone(state)
|
|
22
|
+
setmetatable(_object, nil)
|
|
23
|
+
_object.valid = valid
|
|
24
|
+
return _object
|
|
25
|
+
end,
|
|
26
|
+
})
|
|
27
|
+
return {
|
|
28
|
+
textSlice = textSlice,
|
|
29
|
+
}
|
package/out/types.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CommandShortcut, HistoryEntry } from "@rbxts/centurion";
|
|
2
|
+
import { InterfacePalette } from "./palette";
|
|
3
|
+
export interface InterfaceOptions {
|
|
4
|
+
anchorPoint?: Vector2;
|
|
5
|
+
size?: UDim2;
|
|
6
|
+
position?: UDim2;
|
|
7
|
+
backgroundTransparency?: number;
|
|
8
|
+
displayOrder?: number;
|
|
9
|
+
hideOnLostFocus: boolean;
|
|
10
|
+
activationKeys: Enum.KeyCode[];
|
|
11
|
+
font: {
|
|
12
|
+
regular: Font;
|
|
13
|
+
medium: Font;
|
|
14
|
+
bold: Font;
|
|
15
|
+
};
|
|
16
|
+
palette: InterfacePalette;
|
|
17
|
+
showShortcutSuggestions?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface HistoryLineData {
|
|
20
|
+
entry: HistoryEntry;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
export interface CommandSuggestion {
|
|
24
|
+
type: "command";
|
|
25
|
+
title: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
shortcuts?: CommandShortcut[];
|
|
28
|
+
}
|
|
29
|
+
export interface ArgumentSuggestion {
|
|
30
|
+
type: "argument";
|
|
31
|
+
title: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
dataType: string;
|
|
34
|
+
optional: boolean;
|
|
35
|
+
error?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface Suggestion {
|
|
38
|
+
main: ArgumentSuggestion | CommandSuggestion;
|
|
39
|
+
others: string[];
|
|
40
|
+
}
|
package/out/types.lua
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local IS_EDIT = TS.import(script, script.Parent.Parent, "constants", "util").IS_EDIT
|
|
4
|
+
local function getArgumentNames(registry, path)
|
|
5
|
+
if IS_EDIT then
|
|
6
|
+
return {}
|
|
7
|
+
end
|
|
8
|
+
local command = registry:getCommand(path)
|
|
9
|
+
if command == nil or command.options.arguments == nil then
|
|
10
|
+
return {}
|
|
11
|
+
end
|
|
12
|
+
local _exp = command.options.arguments
|
|
13
|
+
-- ▼ ReadonlyArray.map ▼
|
|
14
|
+
local _newValue = table.create(#_exp)
|
|
15
|
+
local _callback = function(arg)
|
|
16
|
+
return arg.name
|
|
17
|
+
end
|
|
18
|
+
for _k, _v in _exp do
|
|
19
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp)
|
|
20
|
+
end
|
|
21
|
+
-- ▲ ReadonlyArray.map ▲
|
|
22
|
+
return _newValue
|
|
23
|
+
end
|
|
24
|
+
return {
|
|
25
|
+
getArgumentNames = getArgumentNames,
|
|
26
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BaseRegistry, RegistryPath } from "@rbxts/centurion";
|
|
2
|
+
import { Suggestion } from "../types";
|
|
3
|
+
export declare function getArgumentSuggestion(registry: BaseRegistry, path: RegistryPath, index: number, text?: string): Suggestion | undefined;
|
|
4
|
+
export declare function getCommandSuggestion(registry: BaseRegistry, parentPath?: RegistryPath, text?: string): Suggestion | undefined;
|