@quenty/snackbar 11.21.0-canary.544.de8fcee.0 → 11.21.1-canary.545.2374fb2.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,7 +3,18 @@
|
|
|
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
|
-
|
|
6
|
+
## [11.21.1-canary.545.2374fb2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.21.0...@quenty/snackbar@11.21.1-canary.545.2374fb2.0) (2025-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [11.21.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.20.2...@quenty/snackbar@11.21.0) (2025-04-02)
|
|
7
18
|
|
|
8
19
|
|
|
9
20
|
### Bug Fixes
|
|
@@ -14,6 +25,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
14
25
|
|
|
15
26
|
|
|
16
27
|
|
|
28
|
+
## [11.20.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.20.1...@quenty/snackbar@11.20.2) (2025-03-31)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @quenty/snackbar
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
17
36
|
## [11.20.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/snackbar@11.20.0...@quenty/snackbar@11.20.1) (2025-03-21)
|
|
18
37
|
|
|
19
38
|
**Note:** Version bump only for package @quenty/snackbar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/snackbar",
|
|
3
|
-
"version": "11.21.
|
|
3
|
+
"version": "11.21.1-canary.545.2374fb2.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.
|
|
30
|
-
"@quenty/blend": "12.18.
|
|
31
|
-
"@quenty/buttondragmodel": "1.15.
|
|
32
|
-
"@quenty/buttonhighlightmodel": "14.18.
|
|
33
|
-
"@quenty/ducktype": "5.8.
|
|
34
|
-
"@quenty/genericscreenguiprovider": "13.20.
|
|
35
|
-
"@quenty/inputobjectutils": "4.18.
|
|
36
|
-
"@quenty/lipsum": "14.18.
|
|
37
|
-
"@quenty/loader": "10.8.0",
|
|
38
|
-
"@quenty/maid": "3.4.0",
|
|
39
|
-
"@quenty/math": "2.7.
|
|
40
|
-
"@quenty/promise": "10.10.
|
|
41
|
-
"@quenty/promisemaid": "5.10.
|
|
42
|
-
"@quenty/promptqueue": "1.18.
|
|
43
|
-
"@quenty/qgui": "2.3.
|
|
44
|
-
"@quenty/rx": "13.17.
|
|
45
|
-
"@quenty/servicebag": "11.11.
|
|
46
|
-
"@quenty/table": "3.7.
|
|
47
|
-
"@quenty/textserviceutils": "13.18.
|
|
48
|
-
"@quenty/transitionmodel": "7.19.
|
|
49
|
-
"@quenty/utf8": "2.3.
|
|
50
|
-
"@quenty/valueobject": "13.17.
|
|
28
|
+
"@quenty/baseobject": "10.8.1-canary.545.2374fb2.0",
|
|
29
|
+
"@quenty/basicpane": "13.17.1-canary.545.2374fb2.0",
|
|
30
|
+
"@quenty/blend": "12.18.1-canary.545.2374fb2.0",
|
|
31
|
+
"@quenty/buttondragmodel": "1.15.1-canary.545.2374fb2.0",
|
|
32
|
+
"@quenty/buttonhighlightmodel": "14.18.1-canary.545.2374fb2.0",
|
|
33
|
+
"@quenty/ducktype": "5.8.2-canary.545.2374fb2.0",
|
|
34
|
+
"@quenty/genericscreenguiprovider": "13.20.1-canary.545.2374fb2.0",
|
|
35
|
+
"@quenty/inputobjectutils": "4.18.1-canary.545.2374fb2.0",
|
|
36
|
+
"@quenty/lipsum": "14.18.1-canary.545.2374fb2.0",
|
|
37
|
+
"@quenty/loader": "10.8.1-canary.545.2374fb2.0",
|
|
38
|
+
"@quenty/maid": "3.4.1-canary.545.2374fb2.0",
|
|
39
|
+
"@quenty/math": "2.7.2-canary.545.2374fb2.0",
|
|
40
|
+
"@quenty/promise": "10.10.2-canary.545.2374fb2.0",
|
|
41
|
+
"@quenty/promisemaid": "5.10.2-canary.545.2374fb2.0",
|
|
42
|
+
"@quenty/promptqueue": "1.18.1-canary.545.2374fb2.0",
|
|
43
|
+
"@quenty/qgui": "2.3.2-canary.545.2374fb2.0",
|
|
44
|
+
"@quenty/rx": "13.17.1-canary.545.2374fb2.0",
|
|
45
|
+
"@quenty/servicebag": "11.11.2-canary.545.2374fb2.0",
|
|
46
|
+
"@quenty/table": "3.7.2-canary.545.2374fb2.0",
|
|
47
|
+
"@quenty/textserviceutils": "13.18.1-canary.545.2374fb2.0",
|
|
48
|
+
"@quenty/transitionmodel": "7.19.1-canary.545.2374fb2.0",
|
|
49
|
+
"@quenty/utf8": "2.3.2-canary.545.2374fb2.0",
|
|
50
|
+
"@quenty/valueobject": "13.17.1-canary.545.2374fb2.0",
|
|
51
51
|
"@quentystudios/t": "^3.0.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "2374fb2b043cfbe0e9b507b3316eec46a4e353a0"
|
|
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
|
-
|
|
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(
|
|
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
|
-
:
|
|
75
|
-
|
|
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
|
-
|
|
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
|