@rbxts/centurion-ui 1.0.7 → 2.0.0-rc.1

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.
Files changed (141) hide show
  1. package/README.md +60 -15
  2. package/centurion.luau +10 -0
  3. package/package.json +13 -23
  4. package/src/analyse/cursor.luau +25 -0
  5. package/src/analyse/highlight.luau +91 -0
  6. package/src/analyse/init.luau +318 -0
  7. package/src/analyse/leventine.luau +298 -0
  8. package/src/analyse/match.luau +39 -0
  9. package/src/analyse/suggest.luau +41 -0
  10. package/src/app/header.luau +128 -0
  11. package/src/app/history.luau +258 -0
  12. package/src/app/init.luau +699 -0
  13. package/src/app/suggestions.luau +419 -0
  14. package/src/button.luau +13 -0
  15. package/src/components/background.luau +37 -0
  16. package/src/components/container.luau +33 -0
  17. package/src/components/corner.luau +11 -0
  18. package/src/components/divider.luau +28 -0
  19. package/src/components/flex.luau +108 -0
  20. package/src/components/gap.luau +25 -0
  21. package/src/components/image.luau +33 -0
  22. package/src/components/padding.luau +59 -0
  23. package/src/components/stroke.luau +20 -0
  24. package/src/components/text.luau +57 -0
  25. package/src/components/textbox.luau +186 -0
  26. package/src/fade.luau +23 -0
  27. package/src/init.luau +142 -0
  28. package/src/input.luau +16 -0
  29. package/src/px.luau +68 -0
  30. package/src/rich.luau +14 -0
  31. package/src/state.luau +33 -0
  32. package/src/theme.luau +70 -0
  33. package/src/ts/index.d.ts +60 -0
  34. package/src/ts/init.luau +5 -0
  35. package/src/types.luau +85 -0
  36. package/vide/init.luau +8 -0
  37. package/vide/src/action.luau +25 -0
  38. package/vide/src/apply.luau +162 -0
  39. package/vide/src/batch.luau +23 -0
  40. package/vide/src/branch.luau +40 -0
  41. package/vide/src/changed.luau +18 -0
  42. package/vide/src/cleanup.luau +43 -0
  43. package/vide/src/context.luau +74 -0
  44. package/vide/src/create.luau +107 -0
  45. package/vide/src/defaults.luau +113 -0
  46. package/vide/src/derive.luau +18 -0
  47. package/vide/src/effect.luau +12 -0
  48. package/vide/src/flags.luau +12 -0
  49. package/vide/src/graph.luau +321 -0
  50. package/vide/src/implicit_effect.luau +125 -0
  51. package/vide/src/indexes.luau +121 -0
  52. package/vide/src/init.luau +10 -0
  53. package/vide/src/lib.luau +120 -0
  54. package/vide/src/mount.luau +11 -0
  55. package/vide/src/read.luau +5 -0
  56. package/vide/src/root.luau +35 -0
  57. package/vide/src/show.luau +36 -0
  58. package/vide/src/source.luau +31 -0
  59. package/vide/src/spring.luau +328 -0
  60. package/vide/src/switch.luau +114 -0
  61. package/vide/src/timeout.luau +27 -0
  62. package/vide/src/untrack.luau +25 -0
  63. package/vide/src/values.luau +131 -0
  64. package/out/app/centurion-app.d.ts +0 -3
  65. package/out/app/centurion-app.luau +0 -86
  66. package/out/app/index.d.ts +0 -32
  67. package/out/app/init.luau +0 -105
  68. package/out/components/history/history-line.d.ts +0 -9
  69. package/out/components/history/history-line.luau +0 -88
  70. package/out/components/history/history-list.d.ts +0 -11
  71. package/out/components/history/history-list.luau +0 -67
  72. package/out/components/history/index.d.ts +0 -1
  73. package/out/components/history/init.luau +0 -7
  74. package/out/components/index.d.ts +0 -2
  75. package/out/components/init.luau +0 -10
  76. package/out/components/suggestions/badge.d.ts +0 -16
  77. package/out/components/suggestions/badge.luau +0 -40
  78. package/out/components/suggestions/index.d.ts +0 -1
  79. package/out/components/suggestions/init.luau +0 -7
  80. package/out/components/suggestions/main-suggestion.d.ts +0 -9
  81. package/out/components/suggestions/main-suggestion.luau +0 -232
  82. package/out/components/suggestions/suggestion-list.d.ts +0 -8
  83. package/out/components/suggestions/suggestion-list.luau +0 -96
  84. package/out/components/suggestions/suggestions.d.ts +0 -2
  85. package/out/components/suggestions/suggestions.luau +0 -64
  86. package/out/components/suggestions/types.d.ts +0 -6
  87. package/out/components/suggestions/types.luau +0 -2
  88. package/out/components/suggestions/util.d.ts +0 -1
  89. package/out/components/suggestions/util.luau +0 -22
  90. package/out/components/terminal/command.d.ts +0 -6
  91. package/out/components/terminal/command.luau +0 -74
  92. package/out/components/terminal/index.d.ts +0 -1
  93. package/out/components/terminal/init.luau +0 -7
  94. package/out/components/terminal/suggestion.d.ts +0 -26
  95. package/out/components/terminal/suggestion.luau +0 -205
  96. package/out/components/terminal/terminal-text-field/index.d.ts +0 -1
  97. package/out/components/terminal/terminal-text-field/init.luau +0 -7
  98. package/out/components/terminal/terminal-text-field/suggestion.d.ts +0 -5
  99. package/out/components/terminal/terminal-text-field/suggestion.luau +0 -124
  100. package/out/components/terminal/terminal-text-field/terminal-text-field.d.ts +0 -13
  101. package/out/components/terminal/terminal-text-field/terminal-text-field.luau +0 -273
  102. package/out/components/terminal/terminal.d.ts +0 -2
  103. package/out/components/terminal/terminal.luau +0 -304
  104. package/out/components/ui/frame.d.ts +0 -17
  105. package/out/components/ui/frame.luau +0 -32
  106. package/out/components/ui/group.d.ts +0 -15
  107. package/out/components/ui/group.luau +0 -29
  108. package/out/components/ui/layer.d.ts +0 -8
  109. package/out/components/ui/layer.luau +0 -26
  110. package/out/components/ui/outline.d.ts +0 -15
  111. package/out/components/ui/outline.luau +0 -116
  112. package/out/components/ui/padding.d.ts +0 -10
  113. package/out/components/ui/padding.luau +0 -19
  114. package/out/components/ui/scrolling-frame.d.ts +0 -14
  115. package/out/components/ui/scrolling-frame.luau +0 -44
  116. package/out/components/ui/text-field.d.ts +0 -12
  117. package/out/components/ui/text-field.luau +0 -60
  118. package/out/components/ui/text.d.ts +0 -17
  119. package/out/components/ui/text.luau +0 -61
  120. package/out/constants/options.d.ts +0 -2
  121. package/out/constants/options.luau +0 -27
  122. package/out/constants/text.d.ts +0 -3
  123. package/out/constants/text.luau +0 -9
  124. package/out/constants/util.d.ts +0 -1
  125. package/out/constants/util.luau +0 -7
  126. package/out/hooks/use-client.d.ts +0 -2
  127. package/out/hooks/use-client.luau +0 -17
  128. package/out/hooks/use-event.d.ts +0 -14
  129. package/out/hooks/use-event.luau +0 -58
  130. package/out/hooks/use-px.d.ts +0 -19
  131. package/out/hooks/use-px.luau +0 -78
  132. package/out/index.d.ts +0 -2
  133. package/out/init.luau +0 -10
  134. package/out/palette.d.ts +0 -47
  135. package/out/palette.luau +0 -42
  136. package/out/store.d.ts +0 -12
  137. package/out/store.luau +0 -26
  138. package/out/types.d.ts +0 -44
  139. package/out/types.luau +0 -2
  140. package/out/utils/string.d.ts +0 -5
  141. package/out/utils/string.luau +0 -25
package/out/palette.d.ts DELETED
@@ -1,47 +0,0 @@
1
- export interface InterfacePalette {
2
- background: Color3;
3
- surface: Color3;
4
- text: Color3;
5
- subtext: Color3;
6
- highlight: Color3;
7
- success: Color3;
8
- error: Color3;
9
- }
10
- export declare const DefaultPalette: {
11
- readonly mocha: {
12
- readonly background: Color3;
13
- readonly surface: Color3;
14
- readonly text: Color3;
15
- readonly subtext: Color3;
16
- readonly highlight: Color3;
17
- readonly success: Color3;
18
- readonly error: Color3;
19
- };
20
- readonly macchiato: {
21
- readonly background: Color3;
22
- readonly surface: Color3;
23
- readonly text: Color3;
24
- readonly subtext: Color3;
25
- readonly highlight: Color3;
26
- readonly success: Color3;
27
- readonly error: Color3;
28
- };
29
- readonly frappe: {
30
- readonly background: Color3;
31
- readonly surface: Color3;
32
- readonly text: Color3;
33
- readonly subtext: Color3;
34
- readonly highlight: Color3;
35
- readonly success: Color3;
36
- readonly error: Color3;
37
- };
38
- readonly latte: {
39
- readonly background: Color3;
40
- readonly surface: Color3;
41
- readonly text: Color3;
42
- readonly subtext: Color3;
43
- readonly highlight: Color3;
44
- readonly success: Color3;
45
- readonly error: Color3;
46
- };
47
- };
package/out/palette.luau DELETED
@@ -1,42 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local DefaultPalette = {
3
- mocha = {
4
- background = Color3.fromRGB(24, 24, 37),
5
- surface = Color3.fromRGB(30, 30, 46),
6
- text = Color3.fromRGB(205, 214, 244),
7
- subtext = Color3.fromRGB(166, 173, 200),
8
- highlight = Color3.fromRGB(137, 180, 250),
9
- success = Color3.fromRGB(166, 227, 161),
10
- error = Color3.fromRGB(243, 139, 168),
11
- },
12
- macchiato = {
13
- background = Color3.fromRGB(30, 32, 48),
14
- surface = Color3.fromRGB(36, 39, 58),
15
- text = Color3.fromRGB(202, 211, 245),
16
- subtext = Color3.fromRGB(165, 173, 203),
17
- highlight = Color3.fromRGB(138, 173, 244),
18
- success = Color3.fromRGB(166, 218, 149),
19
- error = Color3.fromRGB(237, 135, 150),
20
- },
21
- frappe = {
22
- background = Color3.fromRGB(41, 44, 60),
23
- surface = Color3.fromRGB(48, 52, 70),
24
- text = Color3.fromRGB(198, 208, 245),
25
- subtext = Color3.fromRGB(165, 173, 206),
26
- highlight = Color3.fromRGB(140, 170, 238),
27
- success = Color3.fromRGB(166, 209, 137),
28
- error = Color3.fromRGB(231, 130, 132),
29
- },
30
- latte = {
31
- background = Color3.fromRGB(230, 233, 239),
32
- surface = Color3.fromRGB(239, 241, 245),
33
- text = Color3.fromRGB(76, 79, 105),
34
- subtext = Color3.fromRGB(92, 95, 119),
35
- highlight = Color3.fromRGB(30, 102, 245),
36
- success = Color3.fromRGB(64, 160, 43),
37
- error = Color3.fromRGB(210, 15, 57),
38
- },
39
- }
40
- return {
41
- DefaultPalette = DefaultPalette,
42
- }
package/out/store.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { ImmutableRegistryPath } from "@rbxts/centurion";
2
- import { Suggestion } from "./types";
3
- export declare const visible: import("@rbxts/vide").Source<boolean>;
4
- export declare const options: import("@rbxts/vide").Source<import("./types").InterfaceOptions>;
5
- export declare const mouseOverInterface: import("@rbxts/vide").Source<boolean>;
6
- export declare const currentCommandPath: import("@rbxts/vide").Source<ImmutableRegistryPath | undefined>;
7
- export declare const commandArgIndex: import("@rbxts/vide").Source<number | undefined>;
8
- export declare const terminalArgIndex: import("@rbxts/vide").Source<number | undefined>;
9
- export declare const currentSuggestion: import("@rbxts/vide").Source<Suggestion | undefined>;
10
- export declare const terminalText: import("@rbxts/vide").Source<string>;
11
- export declare const terminalTextValid: import("@rbxts/vide").Source<boolean>;
12
- export declare const currentTextPart: import("@rbxts/vide").Source<string | undefined>;
package/out/store.luau DELETED
@@ -1,26 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- local source = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).source
4
- local DEFAULT_INTERFACE_OPTIONS = TS.import(script, script.Parent, "constants", "options").DEFAULT_INTERFACE_OPTIONS
5
- local visible = source(false)
6
- local options = source(DEFAULT_INTERFACE_OPTIONS)
7
- local mouseOverInterface = source(false)
8
- local currentCommandPath = source(nil)
9
- local commandArgIndex = source(nil)
10
- local terminalArgIndex = source(nil)
11
- local currentSuggestion = source(nil)
12
- local terminalText = source("")
13
- local terminalTextValid = source(false)
14
- local currentTextPart = source(nil)
15
- return {
16
- visible = visible,
17
- options = options,
18
- mouseOverInterface = mouseOverInterface,
19
- currentCommandPath = currentCommandPath,
20
- commandArgIndex = commandArgIndex,
21
- terminalArgIndex = terminalArgIndex,
22
- currentSuggestion = currentSuggestion,
23
- terminalText = terminalText,
24
- terminalTextValid = terminalTextValid,
25
- currentTextPart = currentTextPart,
26
- }
package/out/types.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import { CommandShortcut, HistoryEntry } from "@rbxts/centurion";
2
- import { ScaleFunction } from "./hooks/use-px";
3
- import { InterfacePalette } from "./palette";
4
- export interface InterfaceOptions {
5
- anchor: Vector2;
6
- position: UDim2 | ((px: ScaleFunction) => UDim2);
7
- size: UDim2 | ((px: ScaleFunction) => UDim2);
8
- displayOrder: number;
9
- backgroundTransparency: number;
10
- hideOnLostFocus: boolean;
11
- activationKeys: Enum.KeyCode[];
12
- font: {
13
- regular: Font;
14
- medium: Font;
15
- bold: Font;
16
- };
17
- palette: InterfacePalette;
18
- autoLocalize: boolean;
19
- }
20
- export interface HistoryLineData {
21
- entry: HistoryEntry;
22
- height: number;
23
- }
24
- export interface HistoryData {
25
- lines: HistoryLineData[];
26
- height: number;
27
- }
28
- export interface CommandSuggestion {
29
- type: "command";
30
- title: string;
31
- others: string[];
32
- description?: string;
33
- shortcuts?: CommandShortcut[];
34
- }
35
- export interface ArgumentSuggestion {
36
- type: "argument";
37
- title: string;
38
- others: string[];
39
- description?: string;
40
- dataType: string;
41
- optional: boolean;
42
- error?: string;
43
- }
44
- export type Suggestion = CommandSuggestion | ArgumentSuggestion;
package/out/types.luau DELETED
@@ -1,2 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- return nil
@@ -1,5 +0,0 @@
1
- export declare function containsSpace(text: string): boolean;
2
- export declare function stripQuotes(text: string): string;
3
- export declare function getQuoteChar(text: string): string;
4
- export declare function isQuoteStarted(text: string): boolean;
5
- export declare function isQuoteEnded(text: string): boolean;
@@ -1,25 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local START_QUOTE_PATTERN = `^(['"])`
3
- local END_QUOTE_PATTERN = `(['"])%s*$`
4
- local function containsSpace(text)
5
- return not (#{ string.match(text, "%s") } == 0)
6
- end
7
- local function stripQuotes(text)
8
- return (string.gsub((string.gsub(text, START_QUOTE_PATTERN, "")), END_QUOTE_PATTERN, ""))
9
- end
10
- local function getQuoteChar(text)
11
- return (string.match(text, START_QUOTE_PATTERN))
12
- end
13
- local function isQuoteStarted(text)
14
- return (string.match(text, START_QUOTE_PATTERN)) ~= nil
15
- end
16
- local function isQuoteEnded(text)
17
- return (string.match(text, END_QUOTE_PATTERN)) ~= nil
18
- end
19
- return {
20
- containsSpace = containsSpace,
21
- stripQuotes = stripQuotes,
22
- getQuoteChar = getQuoteChar,
23
- isQuoteStarted = isQuoteStarted,
24
- isQuoteEnded = isQuoteEnded,
25
- }