@hanzogui/react-native-web-internals 7.0.0 → 102.0.0-rc.41-hanzoai.1

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.
@@ -29,21 +29,8 @@ var import_isWebColor = require("../../modules/isWebColor/index.cjs");
29
29
  var import_processColor = require("../../modules/processColor/index.cjs");
30
30
  const normalizeColor = (color, opacity = 1) => {
31
31
  if (color == null) return;
32
- if (typeof color === "string" && (0, import_isWebColor.isWebColor)(color)) {
33
- return color;
34
- }
32
+ if (typeof color === "string" && (0, import_isWebColor.isWebColor)(color)) return color;
35
33
  const colorInt = (0, import_processColor.processColor)(color);
36
- if (colorInt != null) {
37
- const r = colorInt >> 16 & 255;
38
- const g = colorInt >> 8 & 255;
39
- const b = colorInt & 255;
40
- const a = (colorInt >> 24 & 255) / 255;
41
- const alpha = (a * opacity).toFixed(2);
42
- return `rgba(${r},${g},${b},${alpha})`;
43
- }
44
- if (true) {
45
- if (typeof color === "string") {
46
- return color;
47
- }
48
- }
34
+ if (colorInt != null) return `rgba(${colorInt >> 16 & 255},${colorInt >> 8 & 255},${colorInt & 255},${((colorInt >> 24 & 255) / 255 * opacity).toFixed(2)})`;
35
+ if (typeof color === "string") return color;
49
36
  };
@@ -2,23 +2,10 @@ import { isWebColor } from "../../modules/isWebColor/index.mjs";
2
2
  import { processColor } from "../../modules/processColor/index.mjs";
3
3
  const normalizeColor = (color, opacity = 1) => {
4
4
  if (color == null) return;
5
- if (typeof color === "string" && isWebColor(color)) {
6
- return color;
7
- }
5
+ if (typeof color === "string" && isWebColor(color)) return color;
8
6
  const colorInt = processColor(color);
9
- if (colorInt != null) {
10
- const r = colorInt >> 16 & 255;
11
- const g = colorInt >> 8 & 255;
12
- const b = colorInt & 255;
13
- const a = (colorInt >> 24 & 255) / 255;
14
- const alpha = (a * opacity).toFixed(2);
15
- return `rgba(${r},${g},${b},${alpha})`;
16
- }
17
- if (true) {
18
- if (typeof color === "string") {
19
- return color;
20
- }
21
- }
7
+ if (colorInt != null) return `rgba(${colorInt >> 16 & 255},${colorInt >> 8 & 255},${colorInt & 255},${((colorInt >> 24 & 255) / 255 * opacity).toFixed(2)})`;
8
+ if (typeof color === "string") return color;
22
9
  };
23
10
  export { normalizeColor };
24
11
  //# sourceMappingURL=normalizeColor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["isWebColor","processColor","normalizeColor","color","opacity","colorInt","r","g","b","a","alpha","toFixed"],"sources":["../../../../src/StyleSheet/compiler/normalizeColor.tsx"],"sourcesContent":[null],"mappings":"AASA,SAASA,UAAA,QAAkB;AAC3B,SAASC,YAAA,QAAoB;AAEtB,MAAMC,cAAA,GAAiBA,CAACC,KAAA,EAAyBC,OAAA,GAAU,MAAqB;EACrF,IAAID,KAAA,IAAS,MAAM;EAEnB,IAAI,OAAOA,KAAA,KAAU,YAAYH,UAAA,CAAWG,KAAK,GAAG;IAClD,OAAOA,KAAA;EACT;EAEA,MAAME,QAAA,GAAWJ,YAAA,CAAaE,KAAK;EACnC,IAAIE,QAAA,IAAY,MAAM;IACpB,MAAMC,CAAA,GAAKD,QAAA,IAAY,KAAM;IAC7B,MAAME,CAAA,GAAKF,QAAA,IAAY,IAAK;IAC5B,MAAMG,CAAA,GAAIH,QAAA,GAAW;IACrB,MAAMI,CAAA,IAAMJ,QAAA,IAAY,KAAM,OAAO;IACrC,MAAMK,KAAA,IAASD,CAAA,GAAIL,OAAA,EAASO,OAAA,CAAQ,CAAC;IACrC,OAAO,QAAQL,CAAC,IAAIC,CAAC,IAAIC,CAAC,IAAIE,KAAK;EACrC;EAEA,IAAI,MAAkC;IACpC,IAAI,OAAOP,KAAA,KAAU,UAAU;MAC7B,OAAOA,KAAA;IACT;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["isWebColor","processColor","normalizeColor","color","opacity","colorInt","toFixed"],"sources":["../../../../src/StyleSheet/compiler/normalizeColor.tsx"],"sourcesContent":[null],"mappings":"AASA,SAASA,UAAA,QAAkB;AAC3B,SAASC,YAAA,QAAoB;AAEtB,MAAMC,cAAA,GAAiBA,CAACC,KAAA,EAAyBC,OAAA,GAAU,MAAqB;EACrF,IAAAD,KAAI,QAAS,EAAM;EAEnB,WAAIA,KAAO,aAAU,IAAAH,UAAY,CAAAG,KAAW,CAAK,SAAGA,KAAA;EAClD,MAAAE,QAAO,GAAAJ,YAAA,CAAAE,KAAA;EAAA,IACTE,QAAA,yBAAAA,QAAA,gBAAAA,QAAA,eAAAA,QAAA,YAAAA,QAAA,sBAAAD,OAAA,EAAAE,OAAA;EAEA,WAAMH,KAAA,KAAW,UAAa,OAAKA,KAAA;AACnC;AACE,SAAAD,cAAW","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { enable, useElementLayout as useGuiElementLayout } from "@hanzogui/use-element-layout";
1
+ import { enable, useElementLayout as useHanzoguiElementLayout } from "@hanzogui/use-element-layout";
2
2
  import { useEffect, useMemo } from "react";
3
3
  function useElementLayout(ref, onLayout) {
4
4
  const wrappedRef = useMemo(() => {
@@ -13,7 +13,7 @@ function useElementLayout(ref, onLayout) {
13
13
  useEffect(() => {
14
14
  enable();
15
15
  }, []);
16
- return useGuiElementLayout(wrappedRef, onLayout);
16
+ return useHanzoguiElementLayout(wrappedRef, onLayout);
17
17
  }
18
18
  export { useElementLayout };
19
19
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["enable","useElementLayout","useGuiElementLayout","useEffect","useMemo","ref","onLayout","wrappedRef","current","host"],"sources":["../../../../src/modules/useElementLayout/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,SACEA,MAAA,EACAC,gBAAA,IAAoBC,mBAAA,QACf;AACP,SAAyBC,SAAA,EAAWC,OAAA,QAAe;AAG5C,SAASH,iBACdI,GAAA,EACAC,QAAA,EACA;EAEA,MAAMC,UAAA,GAAaH,OAAA,CAAQ,MAAM;IAC/B,OAAO;MACLI,OAAA,EAAS;QACP,IAAIC,KAAA,EAAO;UACT,OAAOJ,GAAA,CAAIG,OAAA;QACb;MACF;IACF;EACF,GAAG,CAACH,GAAG,CAAC;EAERF,SAAA,CAAU,MAAM;IACdH,MAAA,CAAO;EACT,GAAG,EAAE;EAEL,OAAOE,mBAAA,CAAoBK,UAAA,EAAYD,QAAQ;AACjD","ignoreList":[]}
1
+ {"version":3,"names":["enable","useElementLayout","useHanzoguiElementLayout","useEffect","useMemo","ref","onLayout","wrappedRef","current","host"],"sources":["../../../../src/modules/useElementLayout/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,SACEA,MAAA,EACAC,gBAAA,IAAoBC,wBAAA,QACf;AACP,SAAyBC,SAAA,EAAWC,OAAA,QAAe;AAG5C,SAASH,iBACdI,GAAA,EACAC,QAAA,EACA;EAEA,MAAMC,UAAA,GAAaH,OAAA,CAAQ,MAAM;IAC/B,OAAO;MACLI,OAAA,EAAS;QACP,IAAIC,KAAA,EAAO;UACT,OAAOJ,GAAA,CAAIG,OAAA;QACb;MACF;IACF;EACF,GAAG,CAACH,GAAG,CAAC;EAERF,SAAA,CAAU,MAAM;IACdH,MAAA,CAAO;EACT,GAAG,EAAE;EAEL,OAAOE,wBAAA,CAAyBK,UAAA,EAAYD,QAAQ;AACtD","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/react-native-web-internals",
3
- "version": "7.0.0",
3
+ "version": "102.0.0-rc.41-hanzoai.1",
4
4
  "description": "React Native for Web",
5
5
  "keywords": [
6
6
  "react",
@@ -30,21 +30,21 @@
30
30
  }
31
31
  },
32
32
  "scripts": {
33
- "build": "hanzo-gui-build --skip-native",
34
- "watch": "hanzo-gui-build --skip-native --watch",
35
- "clean": "hanzo-gui-build clean",
36
- "clean:build": "hanzo-gui-build clean:build"
33
+ "build": "hanzogui-build --skip-native",
34
+ "watch": "hanzogui-build --skip-native --watch",
35
+ "clean": "hanzogui-build clean",
36
+ "clean:build": "hanzogui-build clean:build"
37
37
  },
38
38
  "dependencies": {
39
- "@hanzogui/normalize-css-color": "^7.0.0",
40
- "@hanzogui/react-native-use-pressable": "^7.0.0",
41
- "@hanzogui/react-native-use-responder-events": "^7.0.0",
42
- "@hanzogui/simple-hash": "^7.0.0",
43
- "@hanzogui/use-element-layout": "^7.0.0",
44
- "@hanzogui/web": "^7.0.0"
39
+ "@hanzogui/normalize-css-color": "102.0.0-rc.41-hanzoai.1",
40
+ "@hanzogui/react-native-use-pressable": "102.0.0-rc.41-hanzoai.1",
41
+ "@hanzogui/react-native-use-responder-events": "102.0.0-rc.41-hanzoai.1",
42
+ "@hanzogui/simple-hash": "102.0.0-rc.41-hanzoai.1",
43
+ "@hanzogui/use-element-layout": "102.0.0-rc.41-hanzoai.1",
44
+ "@hanzogui/web": "102.0.0-rc.41-hanzoai.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@hanzogui/build": "^7.0.0",
47
+ "@hanzogui/build": "102.0.0-rc.41-hanzoai.1",
48
48
  "react": ">=19",
49
49
  "react-dom": "*"
50
50
  },
@@ -54,8 +54,5 @@
54
54
  },
55
55
  "tags": [
56
56
  "react"
57
- ],
58
- "publishConfig": {
59
- "access": "public"
60
- }
61
- }
57
+ ]
58
+ }
@@ -27,7 +27,7 @@ export const normalizeColor = (color?: number | string, opacity = 1): void | str
27
27
  return `rgba(${r},${g},${b},${alpha})`
28
28
  }
29
29
 
30
- if (process.env.GUI_TARGET === 'web') {
30
+ if (process.env.TAMAGUI_TARGET === 'web') {
31
31
  if (typeof color === 'string') {
32
32
  return color
33
33
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  enable,
3
- useElementLayout as useGuiElementLayout,
3
+ useElementLayout as useHanzoguiElementLayout,
4
4
  } from '@hanzogui/use-element-layout'
5
5
  import { type RefObject, useEffect, useMemo } from 'react'
6
6
  import type { LayoutEvent } from '../../types'
@@ -9,7 +9,7 @@ export function useElementLayout(
9
9
  ref: RefObject<any>,
10
10
  onLayout?: ((e: LayoutEvent) => void) | null
11
11
  ) {
12
- // translates to hanzo-gui style
12
+ // translates to hanzogui style
13
13
  const wrappedRef = useMemo(() => {
14
14
  return {
15
15
  current: {
@@ -24,5 +24,5 @@ export function useElementLayout(
24
24
  enable()
25
25
  }, [])
26
26
 
27
- return useGuiElementLayout(wrappedRef, onLayout)
27
+ return useHanzoguiElementLayout(wrappedRef, onLayout)
28
28
  }