@quenty/basicpane 9.0.0 → 10.0.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,58 @@
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
+ # [10.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/basicpane@9.0.0...@quenty/basicpane@10.0.0) (2024-02-13)
7
+
8
+
9
+ ### Features
10
+
11
+ * New loader (breaking changes), fixing loader issues ([#439](https://github.com/Quenty/NevermoreEngine/issues/439)) ([3534345](https://github.com/Quenty/NevermoreEngine/commit/353434522918812953bd9f13fece73e27a4d034d))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * Standard loader
17
+
18
+ Adds new loader version which replicates full structure instead of some partial structure. This allows us to have hot-reloading (in the future), as well as generally do less computation, handle dependencies more carefully, and other changes.
19
+
20
+ This means you'll need to change you how require client-side modules, as we export a simple `loader` module instead of all modules available.
21
+
22
+ Signed-off-by: James Onnen <jonnen0@gmail.com>
23
+
24
+ * fix: Fix missing dependency in ResetService
25
+
26
+ * feat: Add RxPhysicsUtils.observePartMass
27
+
28
+ * fix: Fix package discovery for games
29
+
30
+ * feat: Add UIAlignmentUtils.verticalToHorizontalAlignment(verticalAlignment) and UIAlignmentUtils.horizontalToVerticalAlignment(horizontalAlignment)
31
+
32
+ * feat: AdorneeData:InitAttributes() does not require data as a secondparameter
33
+
34
+ * ci: Upgrade to new rojo 7.4.0
35
+
36
+ * fix: Update loader to handle hoarcekat properly
37
+
38
+ * docs: Fix spacing in Maid
39
+
40
+ * fix: Add new ragdoll constants
41
+
42
+ * fix: Compress influxDB sends
43
+
44
+ * style: Errors use string.format
45
+
46
+ * fix: Handle motor animations
47
+
48
+ * ci: Upgrade rojo version
49
+
50
+ * feat!: Maid no longer is includd in ValueObject.Changed event
51
+
52
+ * docs: Fix docs
53
+
54
+
55
+
56
+
57
+
6
58
  # [9.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/basicpane@8.4.0...@quenty/basicpane@9.0.0) (2024-01-10)
7
59
 
8
60
  **Note:** Version bump only for package @quenty/basicpane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/basicpane",
3
- "version": "9.0.0",
3
+ "version": "10.0.0",
4
4
  "description": "Base UI object with visibility and a maid",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,14 +25,16 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/brio": "^10.0.0",
29
- "@quenty/loader": "^7.3.0",
30
- "@quenty/maid": "^2.6.0",
31
- "@quenty/rx": "^9.0.0",
32
- "@quenty/signal": "^4.0.0"
28
+ "@quenty/brio": "^11.0.0",
29
+ "@quenty/ducktype": "^3.0.0",
30
+ "@quenty/loader": "^8.0.0",
31
+ "@quenty/maid": "^3.0.0",
32
+ "@quenty/rx": "^10.0.0",
33
+ "@quenty/signal": "^5.0.0",
34
+ "@quenty/valueobject": "^10.0.0"
33
35
  },
34
36
  "publishConfig": {
35
37
  "access": "public"
36
38
  },
37
- "gitHead": "bf8135721716c976201cb82133e0186ea606b166"
39
+ "gitHead": "5736b108e4d23cd4c9e761bbe4cc9fed6fb32dfa"
38
40
  }
@@ -23,7 +23,8 @@ local require = require(script.Parent.loader).load(script)
23
23
 
24
24
  local Signal = require("Signal")
25
25
  local Maid = require("Maid")
26
- local Observable = require("Observable")
26
+ local DuckTypeUtils = require("DuckTypeUtils")
27
+ local ValueObject = require("ValueObject")
27
28
 
28
29
  local BasicPane = {}
29
30
  BasicPane.__index = BasicPane
@@ -35,35 +36,9 @@ BasicPane.ClassName = "BasicPane"
35
36
  @return boolean
36
37
  ]=]
37
38
  function BasicPane.isBasicPane(value)
38
- return type(value) == "table"
39
- and Maid.isMaid(value._maid)
40
- and Signal.isSignal(value.VisibleChanged)
41
- and type(value.SetVisible) == "function"
42
- and type(value.IsVisible) == "function"
43
- and type(value.Show) == "function"
44
- and type(value.ObserveVisible) == "function"
45
- and type(value.Hide) == "function"
46
- and type(value.Toggle) == "function"
47
- and type(value.Destroy) == "function"
39
+ return DuckTypeUtils.isImplementation(BasicPane, value)
48
40
  end
49
41
 
50
- --[=[
51
- Gui object which can be reparented or whatever
52
-
53
- @prop Gui Instance?
54
- @within BasicPane
55
- ]=]
56
- --[=[
57
- Fires whenever visibility changes. FIres with isVisible, doNotAnimate, and a maid which
58
- has the lifetime of the visibility.
59
-
60
- :::info
61
- Do not use the Maid if you want the code to work in Deferred signal mode.
62
- :::
63
-
64
- @prop VisibleChanged Signal<boolean, boolean, Maid>
65
- @within BasicPane
66
- ]=]
67
42
 
68
43
  --[=[
69
44
  Constructs a new BasicPane with the .Gui property set.
@@ -75,16 +50,33 @@ function BasicPane.new(gui)
75
50
  local self = setmetatable({}, BasicPane)
76
51
 
77
52
  self._maid = Maid.new()
78
- self.Maid = self._maid
53
+ self._visible = self._maid:Add(ValueObject.new(false, "boolean"))
54
+
55
+ --[=[
56
+ Fires whenever visibility changes. FIres with isVisible, doNotAnimate, and a maid which
57
+ has the lifetime of the visibility.
79
58
 
80
- self._visible = false
59
+ :::info
60
+ Do not use the Maid if you want the code to work in Deferred signal mode.
61
+ :::
81
62
 
82
- self.VisibleChanged = self._maid:Add(Signal.new()) -- :Fire(isVisible, doNotAnimate, maid)
63
+ @prop VisibleChanged Signal<boolean, boolean>
64
+ @within BasicPane
65
+ ]=]
66
+ self.VisibleChanged = self._maid:Add(Signal.new()) -- :Fire(isVisible, doNotAnimate)
67
+
68
+ self._maid:GiveTask(self._visible.Changed:Connect(function(isVisible, _, doNotAnimate)
69
+ self.VisibleChanged:Fire(isVisible, doNotAnimate)
70
+ end))
83
71
 
84
72
  if gui then
85
- self._gui = gui
86
- self.Gui = gui
87
- self._maid:GiveTask(gui)
73
+ --[=[
74
+ Gui object which can be reparented or whatever
75
+
76
+ @prop Gui Instance?
77
+ @within BasicPane
78
+ ]=]
79
+ self.Gui = self._maid:Add(gui)
88
80
  end
89
81
 
90
82
  return self
@@ -99,25 +91,27 @@ end
99
91
  function BasicPane:SetVisible(isVisible, doNotAnimate)
100
92
  assert(type(isVisible) == "boolean", "Bad isVisible")
101
93
 
102
- if self._visible ~= isVisible then
103
- self._visible = isVisible
104
-
105
- local maid = Maid.new()
106
- self._maid._paneVisibleMaid = maid
107
- self.VisibleChanged:Fire(self._visible, doNotAnimate, maid)
108
- end
94
+ self._visible:SetValue(isVisible, doNotAnimate)
109
95
  end
110
96
 
97
+ --[=[
98
+ Returns an observable that observes visibility
99
+
100
+ @return Observable<boolean>
101
+ ]=]
111
102
  function BasicPane:ObserveVisible()
112
- return Observable.new(function(sub)
113
- local maid = Maid.new()
103
+ return self._visible:Observe()
104
+ end
114
105
 
115
- maid:GiveTask(self.VisibleChanged:Connect(function(isVisible, doNotAnimate)
116
- sub:Fire(isVisible, doNotAnimate)
117
- end))
118
- sub:Fire(self:IsVisible())
106
+ --[=[
107
+ Returns an observable that observes visibility
119
108
 
120
- return maid
109
+ @param predicate function | nil -- Optional predicate. If not includeded returns the value.
110
+ @return Observable<Brio<boolean>>
111
+ ]=]
112
+ function BasicPane:ObserveVisibleBrio(predicate)
113
+ return self._visible:ObserveBrio(predicate or function(value)
114
+ return value
121
115
  end)
122
116
  end
123
117
 
@@ -142,7 +136,7 @@ end
142
136
  @param doNotAnimate boolean? -- True if this visiblity should not animate
143
137
  ]=]
144
138
  function BasicPane:Toggle(doNotAnimate)
145
- self:SetVisible(not self._visible, doNotAnimate)
139
+ self:SetVisible(not self._visible.Value, doNotAnimate)
146
140
  end
147
141
 
148
142
  --[=[
@@ -150,7 +144,7 @@ end
150
144
  @return boolean
151
145
  ]=]
152
146
  function BasicPane:IsVisible()
153
- return self._visible
147
+ return self._visible.Value
154
148
  end
155
149
 
156
150
  --[=[
@@ -27,16 +27,7 @@ local BasicPaneUtils = {}
27
27
  function BasicPaneUtils.observeVisible(basicPane)
28
28
  assert(BasicPane.isBasicPane(basicPane), "Bad BasicPane")
29
29
 
30
- return Observable.new(function(sub)
31
- local maid = Maid.new()
32
-
33
- maid:GiveTask(basicPane.VisibleChanged:Connect(function(isVisible)
34
- sub:Fire(isVisible)
35
- end))
36
- sub:Fire(basicPane:IsVisible())
37
-
38
- return maid
39
- end)
30
+ return basicPane:ObserveVisible()
40
31
  end
41
32
 
42
33
  --[=[