@quenty/snackbar 11.21.0 → 11.21.2-canary.547.11ae689.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.21.2-canary.547.11ae689.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.21.0...@quenty/snackbar@11.21.2-canary.547.11ae689.0) (2025-04-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
12
+ * Bump package versions for republishing ([ba47c62](https://github.com/Quenty/NevermoreEngine/commit/ba47c62e32170bf74377b0c658c60b84306dc294))
13
+
14
+
15
+
16
+
17
+
18
+ ## [11.21.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.21.0...@quenty/snackbar@11.21.1) (2025-04-07)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
24
+
25
+
26
+
27
+
28
+
6
29
  # [11.21.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.20.2...@quenty/snackbar@11.21.0) (2025-04-02)
7
30
 
8
31
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2014-2024 James Onnen (Quenty)
3
+ Copyright (c) 2014-2025 James Onnen (Quenty)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/snackbar",
3
- "version": "11.21.0",
3
+ "version": "11.21.2-canary.547.11ae689.0",
4
4
  "description": "Snackbars provide lightweight feedback on an operation at the base of the screen. They automatically disappear after a timeout or user interaction. There can only be one on the screen at a time.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,33 +25,33 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/baseobject": "^10.8.0",
29
- "@quenty/basicpane": "^13.17.0",
30
- "@quenty/blend": "^12.18.0",
31
- "@quenty/buttondragmodel": "^1.15.0",
32
- "@quenty/buttonhighlightmodel": "^14.18.0",
33
- "@quenty/ducktype": "^5.8.1",
34
- "@quenty/genericscreenguiprovider": "^13.20.0",
35
- "@quenty/inputobjectutils": "^4.18.0",
36
- "@quenty/lipsum": "^14.18.0",
37
- "@quenty/loader": "^10.8.0",
38
- "@quenty/maid": "^3.4.0",
39
- "@quenty/math": "^2.7.1",
40
- "@quenty/promise": "^10.10.1",
41
- "@quenty/promisemaid": "^5.10.1",
42
- "@quenty/promptqueue": "^1.18.0",
43
- "@quenty/qgui": "^2.3.1",
44
- "@quenty/rx": "^13.17.0",
45
- "@quenty/servicebag": "^11.11.1",
46
- "@quenty/table": "^3.7.1",
47
- "@quenty/textserviceutils": "^13.18.0",
48
- "@quenty/transitionmodel": "^7.19.0",
49
- "@quenty/utf8": "^2.3.1",
50
- "@quenty/valueobject": "^13.17.0",
28
+ "@quenty/baseobject": "10.8.2-canary.547.11ae689.0",
29
+ "@quenty/basicpane": "13.17.2-canary.547.11ae689.0",
30
+ "@quenty/blend": "12.18.2-canary.547.11ae689.0",
31
+ "@quenty/buttondragmodel": "1.15.2-canary.547.11ae689.0",
32
+ "@quenty/buttonhighlightmodel": "14.18.2-canary.547.11ae689.0",
33
+ "@quenty/ducktype": "5.8.3-canary.547.11ae689.0",
34
+ "@quenty/genericscreenguiprovider": "13.20.2-canary.547.11ae689.0",
35
+ "@quenty/inputobjectutils": "4.18.2-canary.547.11ae689.0",
36
+ "@quenty/lipsum": "14.18.2-canary.547.11ae689.0",
37
+ "@quenty/loader": "10.8.2-canary.547.11ae689.0",
38
+ "@quenty/maid": "3.4.2-canary.547.11ae689.0",
39
+ "@quenty/math": "2.7.3-canary.547.11ae689.0",
40
+ "@quenty/promise": "10.10.3-canary.547.11ae689.0",
41
+ "@quenty/promisemaid": "5.10.3-canary.547.11ae689.0",
42
+ "@quenty/promptqueue": "1.18.2-canary.547.11ae689.0",
43
+ "@quenty/qgui": "2.3.3-canary.547.11ae689.0",
44
+ "@quenty/rx": "13.17.2-canary.547.11ae689.0",
45
+ "@quenty/servicebag": "11.11.3-canary.547.11ae689.0",
46
+ "@quenty/table": "3.7.3-canary.547.11ae689.0",
47
+ "@quenty/textserviceutils": "13.18.2-canary.547.11ae689.0",
48
+ "@quenty/transitionmodel": "7.19.2-canary.547.11ae689.0",
49
+ "@quenty/utf8": "2.3.3-canary.547.11ae689.0",
50
+ "@quenty/valueobject": "13.17.2-canary.547.11ae689.0",
51
51
  "@quentystudios/t": "^3.0.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "e8ea56930e65322fcffc05a1556d5df988068f0b"
56
+ "gitHead": "11ae6894c9c40c596e521dc1d2a71977af63752f"
57
57
  }
@@ -23,6 +23,7 @@ local UTF8 = require("UTF8")
23
23
  local ValueObject = require("ValueObject")
24
24
  local SpringObject = require("SpringObject")
25
25
  local Table = require("Table")
26
+ local _Promise = require("Promise")
26
27
 
27
28
  local SHADOW_RADIUS = 2
28
29
  local CORNER_RADIUS = 2
@@ -37,16 +38,18 @@ local PADDING_X = 24
37
38
  local DEFAULT_TEXT_COLOR = Color3.fromRGB(78, 205, 196)
38
39
 
39
40
  local SnackbarDragDirections = Table.readonly({
40
- HORIZONTAL = "horizontal";
41
- VERTICAL = "vertical";
42
- NONE = "none";
41
+ HORIZONTAL = "horizontal",
42
+ VERTICAL = "vertical",
43
+ NONE = "none",
43
44
  })
44
45
 
45
46
  local Snackbar = setmetatable({}, TransitionModel)
46
47
  Snackbar.ClassName = "Snackbar"
47
48
  Snackbar.__index = Snackbar
48
49
 
49
- function Snackbar.new(text, options)
50
+ export type Snackbar = typeof(setmetatable({} :: {}, Snackbar)) & TransitionModel.TransitionModel
51
+
52
+ function Snackbar.new(text: string, options: SnackbarOptionUtils.SnackbarOptions?): Snackbar
50
53
  assert(SnackbarOptionUtils.isSnackbarOptions(options) or options == nil, "Bad options")
51
54
  options = options or SnackbarOptionUtils.createSnackbarOptions({})
52
55
 
@@ -91,11 +94,11 @@ function Snackbar.new(text, options)
91
94
  return self
92
95
  end
93
96
 
94
- function Snackbar.isSnackbar(value)
97
+ function Snackbar.isSnackbar(value: any): boolean
95
98
  return DuckTypeUtils.isImplementation(Snackbar, value)
96
99
  end
97
100
 
98
- function Snackbar:PromiseSustain()
101
+ function Snackbar:PromiseSustain(): _Promise.Promise<()>
99
102
  local promise = PromiseUtils.delayed(DURATION)
100
103
 
101
104
  PromiseMaidUtils.whilePromise(promise, function(maid)
@@ -10,6 +10,7 @@ local SnackbarScreenGuiProvider = require("SnackbarScreenGuiProvider")
10
10
  local Maid = require("Maid")
11
11
  local SnackbarOptionUtils = require("SnackbarOptionUtils")
12
12
  local PromptQueue = require("PromptQueue")
13
+ local _ServiceBag = require("ServiceBag")
13
14
 
14
15
  local SnackbarServiceClient = {}
15
16
  SnackbarServiceClient.ServiceName = "SnackbarServiceClient"
@@ -19,7 +20,7 @@ SnackbarServiceClient.ServiceName = "SnackbarServiceClient"
19
20
 
20
21
  @param serviceBag ServiceBag
21
22
  ]=]
22
- function SnackbarServiceClient:Init(serviceBag)
23
+ function SnackbarServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
23
24
  assert(not self._serviceBag, "Already initialized")
24
25
  self._serviceBag = assert(serviceBag, "No serviceBag")
25
26
  self._maid = Maid.new()
@@ -61,7 +62,10 @@ end
61
62
  @param text string
62
63
  @param options SnackbarOptions
63
64
  ]=]
64
- function SnackbarServiceClient:ShowSnackbar(text, options)
65
+ function SnackbarServiceClient:ShowSnackbar(
66
+ text: string,
67
+ options: SnackbarOptionUtils.SnackbarOptions?
68
+ ): Snackbar.Snackbar
65
69
  assert(type(text) == "string", "text must be a string")
66
70
  assert(SnackbarOptionUtils.isSnackbarOptions(options) or options == nil, "Bad snackbarOptions")
67
71
 
@@ -70,10 +74,9 @@ function SnackbarServiceClient:ShowSnackbar(text, options)
70
74
 
71
75
  self._queue:HideCurrent()
72
76
 
73
- self._maid:GivePromise(self._queue:Queue(snackbar))
74
- :Finally(function()
75
- snackbar:Destroy()
76
- end)
77
+ self._maid:GivePromise(self._queue:Queue(snackbar)):Finally(function()
78
+ snackbar:Destroy()
79
+ end)
77
80
 
78
81
  return snackbar
79
82
  end
@@ -83,7 +86,7 @@ end
83
86
 
84
87
  @param doNotAnimate boolean
85
88
  ]=]
86
- function SnackbarServiceClient:HideCurrent(doNotAnimate)
89
+ function SnackbarServiceClient:HideCurrent(doNotAnimate: boolean?)
87
90
  return self._queue:HideCurrent(doNotAnimate)
88
91
  end
89
92
 
@@ -92,7 +95,7 @@ end
92
95
 
93
96
  @param doNotAnimate boolean
94
97
  ]=]
95
- function SnackbarServiceClient:ClearQueue(doNotAnimate)
98
+ function SnackbarServiceClient:ClearQueue(doNotAnimate: boolean?)
96
99
  self._queue:Clear(doNotAnimate)
97
100
  end
98
101
 
@@ -7,10 +7,12 @@
7
7
 
8
8
  local require = require(script.Parent.loader).load(script)
9
9
 
10
+ local _ServiceBag = require("ServiceBag")
11
+
10
12
  local SnackbarService = {}
11
13
  SnackbarService.ServiceName = "SnackbarService"
12
14
 
13
- function SnackbarService:Init(serviceBag)
15
+ function SnackbarService:Init(serviceBag: _ServiceBag.ServiceBag)
14
16
  assert(not self._serviceBag, "Already initialized")
15
17
  self._serviceBag = assert(serviceBag, "No serviceBag")
16
18
 
@@ -1,6 +1,6 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class SnackbarOptionUtils
3
-
4
4
  ]=]
5
5
 
6
6
  local require = require(script.Parent.loader).load(script)
@@ -9,7 +9,14 @@ local t = require("t")
9
9
 
10
10
  local SnackbarOptionUtils = {}
11
11
 
12
- function SnackbarOptionUtils.createSnackbarOptions(options)
12
+ export type SnackbarOptions = {
13
+ CallToAction: string | {
14
+ Text: string,
15
+ OnClick: ((any) -> any) | nil,
16
+ } | nil,
17
+ }
18
+
19
+ function SnackbarOptionUtils.createSnackbarOptions(options: SnackbarOptions): SnackbarOptions
13
20
  assert(SnackbarOptionUtils.isSnackbarOptions(options))
14
21
 
15
22
  return options