@onesy/ui-react 1.0.151 → 1.0.152

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.
@@ -195,9 +195,6 @@ const Transition = props_ => {
195
195
  const add = async status_ => {
196
196
  if (!add_ || refs.status.current !== status_) return;
197
197
  updateStatus('add');
198
-
199
- // Reflow
200
- (0, _utils2.reflow)(refs.root.current);
201
198
  await delay('add');
202
199
 
203
200
  // Prevent update batches
@@ -212,9 +209,6 @@ const Transition = props_ => {
212
209
  var _refs$status$current;
213
210
  if (!enter_ || status_ !== 'appended' && (refs.status.current !== status_ || !refs.inProp.current)) return;
214
211
  updateStatus('enter');
215
-
216
- // Reflow
217
- (0, _utils2.reflow)(refs.root.current);
218
212
  await delay('enter');
219
213
 
220
214
  // Prevent update batches
@@ -227,9 +221,6 @@ const Transition = props_ => {
227
221
  var _refs$status$current2;
228
222
  if (!exit_ || refs.status.current !== status_ || refs.inProp.current) return;
229
223
  updateStatus('exit');
230
-
231
- // Reflow
232
- (0, _utils2.reflow)(refs.root.current);
233
224
  await delay('exit');
234
225
 
235
226
  // Prevent update batches
@@ -309,6 +300,9 @@ const Transition = props_ => {
309
300
  className_ = className_.replace(/ +/g, ' ').trim();
310
301
  if ((_refs$root$current$cl2 = refs.root.current.className) !== null && _refs$root$current$cl2 !== void 0 && _refs$root$current$cl2.baseVal) refs.root.current.className.baseVal = className_;else refs.root.current.className = className_;
311
302
  }
303
+
304
+ // reflow
305
+ (0, _utils2.reflow)(refs.root.current);
312
306
  };
313
307
  if (status === 'removed') return null;
314
308
  const value_ = {
@@ -43,9 +43,6 @@ const Transitions = props_ => {
43
43
  };
44
44
  refs.element.current = element;
45
45
  refs.status.current = status;
46
-
47
- // No transition controll
48
- // bug solve in nextjs
49
46
  _react.default.useEffect(() => {
50
47
  if (id !== undefined) {
51
48
  if (id !== refs.id.current) {
@@ -184,9 +184,6 @@ const Transition = props_ => {
184
184
  const add = async status_ => {
185
185
  if (!add_ || refs.status.current !== status_) return;
186
186
  updateStatus('add');
187
-
188
- // Reflow
189
- reflow(refs.root.current);
190
187
  await delay('add');
191
188
 
192
189
  // Prevent update batches
@@ -200,9 +197,6 @@ const Transition = props_ => {
200
197
  const enter = async status_ => {
201
198
  if (!enter_ || status_ !== 'appended' && (refs.status.current !== status_ || !refs.inProp.current)) return;
202
199
  updateStatus('enter');
203
-
204
- // Reflow
205
- reflow(refs.root.current);
206
200
  await delay('enter');
207
201
 
208
202
  // Prevent update batches
@@ -214,9 +208,6 @@ const Transition = props_ => {
214
208
  const exit = async status_ => {
215
209
  if (!exit_ || refs.status.current !== status_ || refs.inProp.current) return;
216
210
  updateStatus('exit');
217
-
218
- // Reflow
219
- reflow(refs.root.current);
220
211
  await delay('exit');
221
212
 
222
213
  // Prevent update batches
@@ -295,6 +286,9 @@ const Transition = props_ => {
295
286
  className_ = className_.replace(/ +/g, ' ').trim();
296
287
  if (refs.root.current.className?.baseVal) refs.root.current.className.baseVal = className_;else refs.root.current.className = className_;
297
288
  }
289
+
290
+ // reflow
291
+ reflow(refs.root.current);
298
292
  };
299
293
  if (status === 'removed') return null;
300
294
  const value_ = {
@@ -33,9 +33,6 @@ const Transitions = props_ => {
33
33
  };
34
34
  refs.element.current = element;
35
35
  refs.status.current = status;
36
-
37
- // No transition controll
38
- // bug solve in nextjs
39
36
  React.useEffect(() => {
40
37
  if (id !== undefined) {
41
38
  if (id !== refs.id.current) {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.150
1
+ /** @license UiReact v1.0.151
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/esm/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { is, canvasFilterBrightness, canvasFilterContrast, canvasFilterSaturation, canvasFilterFade, canvasFilterInvert, canvasFilterOldPhoto, download, clamp, isEnvironment } from '@onesy/utils';
2
2
  export function reflow(element) {
3
- element?.offsetHeight;
3
+ return element?.offsetHeight;
4
4
  }
5
5
  export const staticClassName = (name, theme) => {
6
6
  return theme?.ui?.elements?.[`onesy-${name}`]?.className?.static !== undefined ? theme?.ui?.elements?.[`onesy-${name}`]?.className?.static : theme?.ui?.className.static;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.150
1
+ /** @license UiReact v1.0.151
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onesy/ui-react",
3
- "version": "1.0.151",
3
+ "version": "1.0.152",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-me/onesy.git",
6
6
  "author": "Lazar Erić <lazareric1@proton.me>",
package/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IPoint } from './types';
2
- export declare function reflow(element: HTMLElement): void;
2
+ export declare function reflow(element: HTMLElement): number;
3
3
  export declare const staticClassName: (name: string, theme: any) => any;
4
4
  export declare const iconSizeToFontSize: (value: string | number) => any;
5
5
  export declare const valueBreakpoints: (item: any, value: any, breakpoints: any, theme: any) => any;
package/utils.js CHANGED
@@ -8,7 +8,7 @@ exports.reflow = reflow;
8
8
  exports.valueBreakpoints = exports.toNumber = exports.staticClassName = exports.save = exports.sanitize = exports.replace = void 0;
9
9
  var _utils = require("@onesy/utils");
10
10
  function reflow(element) {
11
- element === null || element === void 0 || element.offsetHeight;
11
+ return element === null || element === void 0 ? void 0 : element.offsetHeight;
12
12
  }
13
13
  const staticClassName = (name, theme) => {
14
14
  var _theme$ui, _theme$ui2, _theme$ui3;