@rbxts/centurion-ui 1.0.0-dev-a7b773c → 1.0.0-dev-47fa67f

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.
@@ -1,6 +1,7 @@
1
1
  import { ClientAPI } from "@rbxts/centurion";
2
2
  import { InterfaceOptions } from "../types";
3
3
  export declare namespace CenturionUI {
4
+ function setVisible(visible: boolean): void;
4
5
  function updateOptions(options: Partial<InterfaceOptions>): void;
5
6
  function create(options?: Partial<InterfaceOptions>): (api: ClientAPI) => void;
6
7
  }
package/out/app/init.lua CHANGED
@@ -7,13 +7,19 @@ local Players = _services.Players
7
7
  local mount = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).mount
8
8
  local DEFAULT_INTERFACE_OPTIONS = TS.import(script, script.Parent, "constants", "options").DEFAULT_INTERFACE_OPTIONS
9
9
  local DefaultPalette = TS.import(script, script.Parent, "palette").DefaultPalette
10
- local interfaceOptions = TS.import(script, script.Parent, "store").interfaceOptions
10
+ local _store = TS.import(script, script.Parent, "store")
11
+ local interfaceOptions = _store.interfaceOptions
12
+ local interfaceVisible = _store.interfaceVisible
11
13
  local CenturionApp = TS.import(script, script, "centurion-app").CenturionApp
12
14
  local CenturionUI = {}
13
15
  do
14
16
  local _container = CenturionUI
15
17
  local MAX_PRELOAD_ATTEMPTS = 3
16
18
  local PRELOAD_ATTEMPT_INTERVAL = 3
19
+ local function setVisible(visible)
20
+ interfaceVisible(visible)
21
+ end
22
+ _container.setVisible = setVisible
17
23
  local function updateOptions(options)
18
24
  interfaceOptions(function(prev)
19
25
  local _object = table.clone(prev)
@@ -25,33 +31,13 @@ do
25
31
  end)
26
32
  end
27
33
  _container.updateOptions = updateOptions
28
- local function registerCommands(registry)
29
- registry:registerCommand({
30
- name = "theme",
31
- description = "Change the terminal's theme",
32
- arguments = { {
33
- name = "name",
34
- description = "The name of the theme",
35
- type = CenturionType.String,
36
- suggestions = { "mocha", "macchiato", "frappe", "latte" },
37
- } },
38
- }, function(ctx, theme)
39
- if not (DefaultPalette[theme] ~= nil) then
40
- ctx:error("Invalid theme")
41
- return nil
42
- end
43
- updateOptions({
44
- palette = DefaultPalette[theme],
45
- })
46
- ctx:reply(`Set theme to '{theme}'`)
47
- end, { "centurion" })
48
- end
34
+ local registerCommands
49
35
  local function create(options)
50
36
  if options == nil then
51
37
  options = {}
52
38
  end
53
39
  return function(api)
54
- if api.options.registerBuiltInCommands then
40
+ if api.config.registerBuiltInCommands then
55
41
  registerCommands(api.registry)
56
42
  end
57
43
  updateOptions(options)
@@ -87,6 +73,27 @@ do
87
73
  end
88
74
  end
89
75
  _container.create = create
76
+ function registerCommands(registry)
77
+ registry:registerCommand({
78
+ name = "theme",
79
+ description = "Change the terminal's theme",
80
+ arguments = { {
81
+ name = "name",
82
+ description = "The name of the theme",
83
+ type = CenturionType.String,
84
+ suggestions = { "mocha", "macchiato", "frappe", "latte" },
85
+ } },
86
+ }, function(ctx, theme)
87
+ if not (DefaultPalette[theme] ~= nil) then
88
+ ctx:error("Invalid theme")
89
+ return nil
90
+ end
91
+ updateOptions({
92
+ palette = DefaultPalette[theme],
93
+ })
94
+ ctx:reply(`Set theme to '{theme}'`)
95
+ end, { "centurion" })
96
+ end
90
97
  end
91
98
  return {
92
99
  CenturionUI = CenturionUI,
@@ -45,7 +45,8 @@ local px = setmetatable({
45
45
  ]]
46
46
  local function usePx()
47
47
  local camera = Workspace.CurrentCamera
48
- assert(camera, "CurrentCamera is not set")
48
+ local _arg0 = camera ~= nil
49
+ assert(_arg0, "CurrentCamera is not set")
49
50
  local updateScale = debounce(function()
50
51
  local viewport = camera.ViewportSize
51
52
  local width = math.log(viewport.X / BASE_RESOLUTION.X, 2)
package/out/store.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ImmutableRegistryPath } from "@rbxts/centurion";
2
- import { InterfaceOptions, Suggestion } from "./types";
2
+ import { Suggestion } from "./types";
3
3
  export declare const interfaceVisible: import("@rbxts/charm").Atom<boolean>;
4
- export declare const interfaceOptions: import("@rbxts/charm").Atom<InterfaceOptions>;
4
+ export declare const interfaceOptions: import("@rbxts/charm").Atom<import("./types").InterfaceOptions>;
5
5
  export declare const mouseOverInterface: import("@rbxts/charm").Atom<boolean>;
6
6
  export declare const currentCommandPath: import("@rbxts/charm").Atom<ImmutableRegistryPath | undefined>;
7
7
  export declare const currentArgIndex: import("@rbxts/charm").Atom<number | undefined>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rbxts/centurion-ui",
3
3
  "description": "Terminal UI for the Centurion command framework",
4
- "version": "1.0.0-dev-a7b773c",
4
+ "version": "1.0.0-dev-47fa67f",
5
5
  "author": "paradoxuum",
6
6
  "license": "MIT",
7
7
  "main": "out/init.lua",
@@ -32,22 +32,22 @@
32
32
  "dev": "shx rm -rf out && rbxtsc -w"
33
33
  },
34
34
  "devDependencies": {
35
- "@rbxts/centurion": "^1.0.0-dev-a7b773c",
35
+ "@rbxts/centurion": "^1.0.0-dev-47fa67f",
36
36
  "@rbxts/compiler-types": "2.3.0-types.1",
37
- "@rbxts/types": "^1.0.790",
37
+ "@rbxts/types": "^1.0.792",
38
38
  "roblox-ts": "2.3.0-dev-26ec859",
39
39
  "shx": "^0.3.4",
40
- "typescript": "~5.5.3"
40
+ "typescript": "~5.5.4"
41
41
  },
42
42
  "dependencies": {
43
43
  "@rbxts/charm": "^0.5.2",
44
44
  "@rbxts/ripple": "^0.8.2",
45
45
  "@rbxts/services": "^1.5.4",
46
46
  "@rbxts/set-timeout": "^1.1.2",
47
- "@rbxts/vide": "^0.4.1"
47
+ "@rbxts/vide": "^0.4.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "@rbxts/centurion": "^1.0.0-dev-a7b773c"
50
+ "@rbxts/centurion": "^1.0.0-dev"
51
51
  },
52
52
  "stableVersion": "1.0.0"
53
53
  }