react-native-unistyles 3.0.0-alpha.43 → 3.0.0-alpha.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,15 +34,12 @@ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
34
34
  passedRef.current = ref;
35
35
  }
36
36
  const returnFn = typeof passedRef === 'function' ? passedRef(ref) : () => {};
37
- const unistyles = (rawStyle ?? []).map((style, index) => {
38
- if (fnArgs[index]) {
39
- return style;
40
- }
41
- return undefined;
42
- }).filter(Boolean);
37
+ const unistyles = typeof rawStyle === 'function' ? rawStyle({
38
+ pressed: false
39
+ }) : rawStyle ?? [];
43
40
 
44
41
  // @ts-expect-error - this is hidden from TS
45
- _specs.UnistylesShadowRegistry.add(ref, unistyles, variants, [...fnArgs]);
42
+ _specs.UnistylesShadowRegistry.add(ref, unistyles, variants, Array.isArray(styleResult) ? fnArgs : [fnArgs]);
46
43
  return () => {
47
44
  // @ts-expect-error - this is hidden from TS
48
45
  _specs.UnistylesShadowRegistry.remove(ref);
@@ -59,17 +56,12 @@ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
59
56
  // @ts-expect-error - this is hidden from TS
60
57
  .map(style => typeof style === 'function' ? style.getBoundArgs() : []) : [];
61
58
  const pressId = (0, _core.getId)();
62
- const unistyles = (rawStyle ?? []).map((style, index) => {
63
- if (fnArgs[index]) {
64
- return style;
65
- }
66
- return undefined;
67
- }).filter(Boolean);
59
+ const unistyles = typeof rawStyle === 'function' ? rawStyle(state) : rawStyle ?? [];
68
60
  if (storedRef.current) {
69
61
  // @ts-expect-error - this is hidden from TS
70
62
  _specs.UnistylesShadowRegistry.remove(storedRef.current);
71
63
  // @ts-expect-error - this is hidden from TS
72
- _specs.UnistylesShadowRegistry.add(storedRef.current, unistyles, variants, [...fnArgs], pressId);
64
+ _specs.UnistylesShadowRegistry.add(storedRef.current, unistyles, variants, Array.isArray(styleResult) ? fnArgs : [fnArgs], pressId);
73
65
  }
74
66
  return typeof styleResult === 'function'
75
67
  // @ts-expect-error - this is hidden from TS
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_specs","_core","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Pressable","exports","forwardRef","variants","style","rawStyle","props","passedRef","storedRef","useRef","jsx","ref","current","styleResult","pressed","fnArgs","getBoundArgs","Array","isArray","map","returnFn","unistyles","index","undefined","filter","Boolean","UnistylesShadowRegistry","add","remove","state","pressId","getId"],"sourceRoot":"../../../src","sources":["components/Pressable.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAA+B,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA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AC5Bc,GAAG,CAAC,CAACf,KAAK,EAAEkB,KAAK,KAAK;QACnB,IAAIP,MAAM,CAACO,KAAK,CAAC,EAAE;UACf,OAAOlB,KAAK;QAChB;QAEA,OAAOmB,SAAS;MACpB,CAAC,CAAC,CACDC,MAAM,CAACC,OAAO,CAAC;MAEpB,IAAIjB,SAAS,CAACI,OAAO,EAAE;QACnB;QACAc,8BAAuB,CAACE,MAAM,CAACpB,SAAS,CAACI,OAAO,CAAC;QACjD;QACAc,8BAAuB,CAACC,GAAG,CAACnB,SAAS,CAACI,OAAO,EAAES,SAAS,EAAElB,QAAQ,EAAE,CAAC,GAAGY,MAAM,CAAC,EAAEe,OAAO,CAAC;MAC7F;MAEA,OAAO,OAAOjB,WAAW,KAAK;MAC1B;MAAA,EACEA,WAAW,CAACiB,OAAO,CAAC,GACpBb,KAAK,CAACC,OAAO,CAACL,WAAW;MACvB;MAAA,EACEA,WAAW,CAACM,GAAG,CAACf,KAAK,IAAI,OAAOA,KAAK,KAAK,UAAU,GAAGA,KAAK,CAAC0B,OAAO,CAAC,GAAG1B,KAAK,CAAC,GAC9ES,WAAW;IACzB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_specs","_core","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Pressable","exports","forwardRef","variants","style","rawStyle","props","passedRef","storedRef","useRef","jsx","ref","current","styleResult","pressed","fnArgs","getBoundArgs","Array","isArray","map","returnFn","unistyles","UnistylesShadowRegistry","add","remove","state","pressId","getId"],"sourceRoot":"../../../src","sources":["components/Pressable.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,K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CAAC,GAC9ES,WAAW;IACzB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
@@ -35,12 +35,34 @@ const events = {
35
35
  focused: false
36
36
  }
37
37
  };
38
+ const isFunctionWithBoundArgs = fn => {
39
+ return typeof fn === 'function' && 'getBoundArgs' in fn;
40
+ };
41
+ const extractFunctionArgs = styleResult => {
42
+ return isFunctionWithBoundArgs(styleResult) ? [styleResult.getBoundArgs()] : Array.isArray(styleResult) ? styleResult.map(style => isFunctionWithBoundArgs(style) ? style.getBoundArgs() : []) : [];
43
+ };
44
+ const extractStyleResult = style => {
45
+ return typeof style === 'function' ? [style()] : Array.isArray(style) ? style.map(style => typeof style === 'function' ? style() : style) : [style];
46
+ };
47
+ const updateStyles = ({
48
+ ref,
49
+ style,
50
+ variants,
51
+ state
52
+ }) => {
53
+ const styleResult = typeof style === 'function' ? style(state) : style;
54
+ const fnArgs = extractFunctionArgs(styleResult);
55
+ const extractedResult = extractStyleResult(styleResult);
56
+
57
+ // @ts-expect-error - this is hidden from TS
58
+ _specs.UnistylesShadowRegistry.add(ref, extractedResult, variants, fnArgs);
59
+ };
38
60
  const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
39
61
  variants,
40
62
  style,
41
63
  ...props
42
64
  }, passedRef) => {
43
- const storedRef = (0, _react.useRef)();
65
+ const storedRef = (0, _react.useRef)(null);
44
66
  const state = (0, _react.useRef)(initialState);
45
67
  const styleRef = (0, _react.useRef)(style);
46
68
  (0, _react.useEffect)(() => {
@@ -52,14 +74,12 @@ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
52
74
  ...state.current,
53
75
  ...newState
54
76
  };
55
- const styleResult = typeof styleRef.current === 'function' ? styleRef.current(state.current) : styleRef.current;
56
- const fnArgs = typeof styleResult === 'function'
57
- // @ts-expect-error - this is hidden from TS
58
- ? styleResult.getBoundArgs() : [];
59
- const extractedResult = typeof styleResult === 'function' ? styleResult() : styleResult;
60
-
61
- // @ts-expect-error - this is hidden from TS
62
- _specs.UnistylesShadowRegistry.add(storedRef.current, [extractedResult], variants, [fnArgs]);
77
+ updateStyles({
78
+ ref: storedRef.current,
79
+ style: styleRef.current,
80
+ variants,
81
+ state: state.current
82
+ });
63
83
  };
64
84
  if (!storedRef.current) {
65
85
  return;
@@ -80,17 +100,15 @@ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
80
100
  ...props,
81
101
  ref: ref => {
82
102
  storedRef.current = ref;
83
- const styleResult = typeof style === 'function' ? style(initialState) : style;
84
- const fnArgs = typeof styleResult === 'function'
85
- // @ts-expect-error - this is hidden from TS
86
- ? styleResult.getBoundArgs() : [];
87
- const extractedResult = typeof styleResult === 'function' ? styleResult() : styleResult;
103
+ updateStyles({
104
+ ref,
105
+ style: style,
106
+ variants,
107
+ state: initialState
108
+ });
88
109
  if (typeof passedRef === 'object' && passedRef !== null) {
89
110
  passedRef.current = ref;
90
111
  }
91
-
92
- // @ts-expect-error - this is hidden from TS
93
- _specs.UnistylesShadowRegistry.add(ref, [extractedResult], variants, [fnArgs]);
94
112
  }
95
113
  });
96
114
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","initialState","pressed","hovered","focused","events","Pressable","exports","forwardRef","variants","style","props","passedRef","storedRef","useRef","state","styleRef","useEffect","current","handler","newState","styleResult","fnArgs","getBoundArgs","extractedResult","UnistylesShadowRegistry","add","ref","entries","forEach","event","addEventListener","removeEventListener","jsx"],"sourceRoot":"../../../src","sources":["components/Pressable.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAAkD,IAAAG,WAAA,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I,EAAE;QACrDA,SAAS,CAACM,OAAO,GAAGS,GAAG;MAC3B;;MAEA;MACAF,8BAAuB,CAACC,GAAG,CAACC,GAAG,EAAE,CAACH,eAAe,CAAC,EAAEf,QAAQ,EAAE,CAACa,MAAM,CAAC,CAAC;IAC3E;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","initialState","pressed","hovered","focused","events","isFunctionWithBoundArgs","fn","extractFunctionArgs","styleResult","getBoundArgs","Array","isArray","map","style","extractStyleResult","updateStyles","ref","variants","state","fnArgs","extractedResult","UnistylesShadowRegistry","add","Pressable","exports","forwardRef","props","passedRef","storedRef","useRef","styleRef","useEffect","current","handler","newState","entries","forEach","event","addEventListener","removeEventListener","jsx"],"sourceRoot":"../../../src","sources":["components/Pressable.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAAkD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA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IAAA,GACnBG,KAAK;IACTV,GAAG,EAAEA,GAAG,IAAI;MACRY,SAAS,CAACI,OAAO,GAAGhB,GAAG;MACvBD,YAAY,CAAC;QACTC,GAAG;QACHH,KAAK,EAAEA,KAA0B;QACjCI,QAAQ;QACRC,KAAK,EAAElB;MACX,CAAC,CAAC;MAEF,IAAI,OAAO2B,SAAS,KAAK,QAAQ,IAAIA,SAAS,KAAK,IAAI,EAAE;QACrDA,SAAS,CAACK,OAAO,GAAGhB,GAAG;MAC3B;IACJ;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
@@ -22,16 +22,15 @@ class UnistylesShadowRegistryBuilder {
22
22
  resultsMap = new Map();
23
23
  hashMap = new Map();
24
24
  classNamesMap = new Map();
25
- add = (ref, _style, _variants, _args) => {
26
- // Style is not provided
27
- if (!_style) {
25
+ add = (ref, styles, _variants, _args) => {
26
+ // Styles are not provided
27
+ if (!styles) {
28
28
  return;
29
29
  }
30
30
 
31
31
  // Ref is unmounted, remove style tags from the document
32
32
  if (ref === null) {
33
- const secrets = (0, _utils2.extractSecrets)(_style);
34
- secrets.forEach(({
33
+ (0, _utils2.extractSecrets)(styles).forEach(({
35
34
  __uni__refs
36
35
  }) => {
37
36
  __uni__refs.forEach(ref => {
@@ -53,58 +52,60 @@ class UnistylesShadowRegistryBuilder {
53
52
  if (!(ref instanceof HTMLElement)) {
54
53
  return;
55
54
  }
56
- const styles = _style.filter(style => Object.keys(style ?? {}).some(key => key.startsWith('__uni__')));
55
+ const parsedStyles = styles.flatMap((style, styleIndex) => {
56
+ const secrets = (0, _utils2.extractSecrets)(style);
57
57
 
58
- // No unistyles
59
- if (styles.length === 0) {
60
- return;
61
- }
62
- const parsedStyles = styles.flatMap((style, styleIndex) => (0, _utils2.extractSecrets)(style).map(secret => {
63
- const {
64
- __uni__key,
65
- __uni__stylesheet,
66
- __uni__variants,
67
- __uni__args = [],
68
- __uni__refs
69
- } = secret;
70
- const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
71
- const style = newComputedStylesheet[__uni__key];
72
- const variants = _variants && Object.keys(_variants).length > 0 ? _variants : __uni__variants;
73
- const args = _args[styleIndex] && _args[styleIndex].length > 0 ? _args[styleIndex] : __uni__args;
74
- const result = typeof style === 'function' ? style(...args) : style;
75
- const {
76
- variantsResult
77
- } = Object.fromEntries((0, _variants2.getVariants)({
78
- variantsResult: result
79
- }, variants));
80
- const resultWithVariants = (0, _utils.deepMergeObjects)(result, variantsResult ?? {});
81
- const dependencies = (0, _utils2.extractUnistyleDependencies)(resultWithVariants);
82
- if (typeof __uni__stylesheet === 'function') {
83
- // Add dependencies from dynamic styles to stylesheet
84
- _registry.UnistylesRegistry.addDependenciesToStylesheet(__uni__stylesheet, dependencies);
58
+ // Regular style
59
+ if (secrets.length === 0) {
60
+ return style;
85
61
  }
86
- __uni__refs.add(ref);
87
- const dispose = _listener.UnistylesListener.addListeners((0, _utils2.extractUnistyleDependencies)(resultWithVariants), () => {
88
- const hash = this.hashMap.get(ref);
89
-
90
- // Dispose listener if there is no hash
91
- if (!hash) {
92
- dispose();
93
- return;
94
- }
95
- const newComputedStyleSheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
96
- const newValue = newComputedStyleSheet[__uni__key];
97
- const result = typeof newValue === 'function' ? newValue(...args) : newValue;
62
+ return secrets.map(secret => {
63
+ const {
64
+ __uni__key,
65
+ __uni__stylesheet,
66
+ __uni__variants,
67
+ __uni__args = [],
68
+ __uni__refs
69
+ } = secret;
70
+ const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
71
+ const style = newComputedStylesheet[__uni__key];
72
+ const variants = _variants && Object.keys(_variants).length > 0 ? _variants : __uni__variants;
73
+ const args = _args[styleIndex] && _args[styleIndex].length > 0 ? _args[styleIndex] : __uni__args;
74
+ const result = typeof style === 'function' ? style(...args) : style;
98
75
  const {
99
76
  variantsResult
100
77
  } = Object.fromEntries((0, _variants2.getVariants)({
101
78
  variantsResult: result
102
79
  }, variants));
103
80
  const resultWithVariants = (0, _utils.deepMergeObjects)(result, variantsResult ?? {});
104
- _registry.UnistylesRegistry.applyStyles(hash, (0, _convert.convertUnistyles)(resultWithVariants));
81
+ const dependencies = (0, _utils2.extractUnistyleDependencies)(resultWithVariants);
82
+ if (typeof __uni__stylesheet === 'function') {
83
+ // Add dependencies from dynamic styles to stylesheet
84
+ _registry.UnistylesRegistry.addDependenciesToStylesheet(__uni__stylesheet, dependencies);
85
+ }
86
+ __uni__refs.add(ref);
87
+ const dispose = _listener.UnistylesListener.addListeners((0, _utils2.extractUnistyleDependencies)(resultWithVariants), () => {
88
+ const hash = this.hashMap.get(ref);
89
+
90
+ // Dispose listener if there is no hash
91
+ if (!hash) {
92
+ dispose();
93
+ return;
94
+ }
95
+ const newComputedStyleSheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
96
+ const newValue = newComputedStyleSheet[__uni__key];
97
+ const result = typeof newValue === 'function' ? newValue(...args) : newValue;
98
+ const {
99
+ variantsResult
100
+ } = Object.fromEntries((0, _variants2.getVariants)({
101
+ variantsResult: result
102
+ }, variants));
103
+ const resultWithVariants = (0, _utils.deepMergeObjects)(result, variantsResult ?? {});
104
+ _registry.UnistylesRegistry.applyStyles(hash, (0, _convert.convertUnistyles)(resultWithVariants));
105
+ });
106
+ return resultWithVariants;
105
107
  });
106
- return resultWithVariants;
107
- }));
108
+ });
108
109
  const combinedStyles = (0, _utils.deepMergeObjects)(...parsedStyles);
109
110
  const oldStyles = this.resultsMap.get(ref);
110
111
  if ((0, _utils2.equal)(combinedStyles, oldStyles)) {
@@ -1 +1 @@
1
- {"version":3,"names":["_convert","require","_listener","_registry","_utils","_utils2","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","Map","hashMap","classNamesMap","add","ref","_style","_variants","_args","secrets","extractSecrets","forEach","__uni__refs","isInDocument","oldResult","get","delete","UnistylesRegistry","remove","HTMLElement","styles","filter","style","Object","keys","some","key","startsWith","length","parsedStyles","flatMap","styleIndex","map","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","variants","args","result","variantsResult","fromEntries","getVariants","resultWithVariants","deepMergeObjects","dependencies","extractUnistyleDependencies","addDependenciesToStylesheet","UnistylesListener","addListeners","hash","newComputedStyleSheet","newValue","applyStyles","convertUnistyles","combinedStyles","oldStyles","equal","oldClassNames","className","classList","set","existingHash","injectedClassNames","_web","_classNames","newClassNames","Array","isArray","concat","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAIA,MAAMM,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;EAChCC,MAAM,GAAG,KAAK;EACdC,MAAM,GAAGA,CAAA,KAAM,IAAI;EACnBC,QAAQ,GAAGA,CAAA,KAAM,yBAAyB;EAC1CC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB;;EAEQC,UAAU,GAAG,IAAIC,GAAG,CAA+B,CAAC;EACpDC,OAAO,GAAG,IAAID,GAAG,CAAsB,CAAC;EACxCE,aAAa,GAAG,IAAIF,GAAG,CAA6B,CAAC;EAE7DG,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAAoB,EAAEC,SAA0C,EAAEC,KAAwB,KAAK;IAC5G;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAID,GAAG,KAAK,IAAI,EAAE;MACd,MAAMI,OAAO,GAAG,IAAAC,sBAAc,EAACJ,MAAM,CAAC;MAEtCG,OAAO,CAACE,OAAO,CAAC,CAAC;QAAEC;M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AO,CAACL,kBAAkB,CAAC,GAAGA,kBAAkB,GAAG,CAACA,kBAAkB,CAAC,EAAEM,MAAM,CAACnB,IAAI,CAAC;IAElH,IAAI,CAAClD,aAAa,CAAC6D,GAAG,CAAC3D,GAAG,EAAEgE,aAAa,CAAC;IAC1C;IACAhE,GAAG,CAAC0D,SAAS,CAAC3D,GAAG,CAAC,GAAGiE,aAAa,CAAC;;IAEnC;IACA,IAAI,CAACJ,YAAY,EAAE;MACf,IAAI,CAAC/D,OAAO,CAAC8D,GAAG,CAAC3D,GAAG,EAAEgD,IAAI,CAAC;IAC/B;IAEA,OAAOgB,aAAa;EACxB,CAAC;EAEDnD,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEO,MAAMuD,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAI/E,8BAA8B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_convert","require","_listener","_registry","_utils","_utils2","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","Map","hashMap","classNamesMap","add","ref","styles","_variants","_args","extractSecrets","forEach","__uni__refs","isInDocument","oldResult","get","delete","UnistylesRegistry","remove","HTMLElement","parsedStyles","flatMap","style","styleIndex","secrets","length","map","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","variants","Object","keys","args","result","variantsResult","fromEntries","getVariants","resultWithVariants","deepMergeObjects","dependencies","extractUnistyleDependencies","addDependenciesToStylesheet","UnistylesListener","addListeners","hash","newComputedStyleSheet","newValue","applyStyles","convertUnistyles","combinedStyles","oldStyles","equal","oldClassNames","className","classList","set","existingHash","injectedClassNames","_web","_classNames","newClassNames","Array","isArray","concat","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,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IAEA,MAAME,aAAa,GAAG,IAAI,CAACrD,aAAa,CAACW,GAAG,CAACT,GAAG,CAAC;;IAEjD;IACA,IAAIiD,SAAS,EAAE;MACXtC,2BAAiB,CAACC,MAAM,CAACqC,SAAS,CAAC;IACvC;;IAEA;IACAE,aAAa,EAAE9C,OAAO,CAAC+C,SAAS,IAAIpD,GAAG,CAACqD,SAAS,CAACzC,MAAM,CAACwC,SAAS,CAAC,CAAC;IACpE,IAAI,CAACzD,UAAU,CAAC2D,GAAG,CAACtD,GAAG,EAAEgD,cAAc,CAAC;IAExC,MAAM;MAAEL,IAAI;MAAEY;IAAa,CAAC,GAAG5C,2BAAiB,CAACZ,GAAG,CAACiD,cAAc,CAAC;IACpE,MAAMQ,kBAAkB,GAAGR,cAAc,EAAES,IAAI,EAAEC,WAAW,IAAI,EAAE;IAClE,MAAMC,aAAa,GAAG,CAACC,KAAK,CAACC,OAAO,CAACL,kBAAkB,CAAC,GAAGA,kBAAkB,GAAG,CAACA,kBAAkB,CAAC,EAAEM,MAAM,CAACnB,IAAI,CAAC;IAElH,IAAI,CAAC7C,aAAa,CAACwD,GAAG,CAACtD,GAAG,EAAE2D,aAAa,CAAC;IAC1C;IACA3D,GAAG,CAACqD,SAAS,CAACtD,GAAG,CAAC,GAAG4D,aAAa,CAAC;;IAEnC;IACA,IAAI,CAACJ,YAAY,EAAE;MACf,IAAI,CAAC1D,OAAO,CAACyD,GAAG,CAACtD,GAAG,EAAE2C,IAAI,CAAC;IAC/B;IAEA,OAAOgB,aAAa;EACxB,CAAC;EAED/C,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEO,MAAMmD,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAI1E,8BAA8B,CAAC,CAAC","ignoreList":[]}
@@ -28,15 +28,12 @@ export const Pressable = /*#__PURE__*/forwardRef(({
28
28
  passedRef.current = ref;
29
29
  }
30
30
  const returnFn = typeof passedRef === 'function' ? passedRef(ref) : () => {};
31
- const unistyles = (rawStyle ?? []).map((style, index) => {
32
- if (fnArgs[index]) {
33
- return style;
34
- }
35
- return undefined;
36
- }).filter(Boolean);
31
+ const unistyles = typeof rawStyle === 'function' ? rawStyle({
32
+ pressed: false
33
+ }) : rawStyle ?? [];
37
34
 
38
35
  // @ts-expect-error - this is hidden from TS
39
- UnistylesShadowRegistry.add(ref, unistyles, variants, [...fnArgs]);
36
+ UnistylesShadowRegistry.add(ref, unistyles, variants, Array.isArray(styleResult) ? fnArgs : [fnArgs]);
40
37
  return () => {
41
38
  // @ts-expect-error - this is hidden from TS
42
39
  UnistylesShadowRegistry.remove(ref);
@@ -53,17 +50,12 @@ export const Pressable = /*#__PURE__*/forwardRef(({
53
50
  // @ts-expect-error - this is hidden from TS
54
51
  .map(style => typeof style === 'function' ? style.getBoundArgs() : []) : [];
55
52
  const pressId = getId();
56
- const unistyles = (rawStyle ?? []).map((style, index) => {
57
- if (fnArgs[index]) {
58
- return style;
59
- }
60
- return undefined;
61
- }).filter(Boolean);
53
+ const unistyles = typeof rawStyle === 'function' ? rawStyle(state) : rawStyle ?? [];
62
54
  if (storedRef.current) {
63
55
  // @ts-expect-error - this is hidden from TS
64
56
  UnistylesShadowRegistry.remove(storedRef.current);
65
57
  // @ts-expect-error - this is hidden from TS
66
- UnistylesShadowRegistry.add(storedRef.current, unistyles, variants, [...fnArgs], pressId);
58
+ UnistylesShadowRegistry.add(storedRef.current, unistyles, variants, Array.isArray(styleResult) ? fnArgs : [fnArgs], pressId);
67
59
  }
68
60
  return typeof styleResult === 'function'
69
61
  // @ts-expect-error - this is hidden from TS
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","getId","jsx","_jsx","variants","style","rawStyle","props","passedRef","storedRef","ref","current","styleResult","pressed","fnArgs","getBoundArgs","Array","isArray","map","returnFn","unistyles","index","undefined","filter","Boolean","add","remove","state","pressId"],"sourceRoot":"../../../src","sources":["components/Pressable.tsx"],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CAAC;QACjD;QACAX,uBAAuB,CAACyB,GAAG,CAAChB,SAAS,CAACE,OAAO,EAAES,SAAS,EAAEhB,QAAQ,EAAE,CAAC,GAAGU,MAAM,CAAC,EAAEc,OAAO,CAAC;MAC7F;MAEA,OAAO,OAAOhB,WAAW,KAAK;MAC1B;MAAA,EACEA,WAAW,CAACgB,OAAO,CAAC,GACpBZ,KAAK,CAACC,OAAO,CAACL,WAAW;MACvB;MAAA,EACEA,WAAW,CAACM,GAAG,CAACb,KAAK,IAAI,OAAOA,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACuB,OAAO,CAAC,GAAGvB,KAAK,CAAC,GAC9EO,WAAW;IACzB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","forwardRef","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","getId","jsx","_jsx","variants","style","rawStyle","props","passedRef","storedRef","ref","current","styleResult","pressed","fnArgs","getBoundArgs","Array","isArray","map","returnFn","unistyles","add","remove","state","pressId"],"sourceRoot":"../../../src","sources":["components/Pressable.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AACjD,SAASC,SAAS,IAAIC,0BAA0B,QAAyC,cAAc;AAEvG,SAASC,uBAAuB,QAAQ,UAAU;AAClD,SAASC,KAAK,QAAQ,SAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAO/B,OAAO,MAAML,SAAS,gBAAGF,UAAU,CAAuB,CAAC;EAAEQ,QAAQ;EAAEC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,SAAS,KAAK;EAC9G,MAAMC,SAAS,GAAGZ,MAAM,CAAc,CAAC;EAEvC,oBACIM,IAAA,CAACJ,0BAA0B;IAAA,GACnBQ,KAAK;IACTG,GAAG,EAAEA,GAAG,IAAI;MACRD,SAAS,CAACE,OAAO,GAAGD,GAAG;MACvB,MAAME,WAAW,GAAG,OA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AAK;MAClC;MAAA,EACEA,WAAW,CAACG,YAAY,CAAC,CAAC,GAC1BC,KAAK,CAACC,OAAO,CAACL,WAAW,CAAC,GACtBA;MACE;MAAA,CACCM,GAAG,CAACb,KAAK,IAAI,OAAOA,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACU,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,GACxE,EAAE;MACZ,MAAMS,OAAO,GAAGvB,KAAK,CAAC,CAAC;MACvB,MAAMmB,SAAS,GAAG,OAAOd,QAAQ,KAAK,UAAU,GAC1CA,QAAQ,CAACiB,KAAK,CAAC,GACdjB,QAAQ,IAAI,EAAG;MAEtB,IAAIG,SAAS,CAACE,OAAO,EAAE;QACnB;QACAX,uBAAuB,CAACsB,MAAM,CAACb,SAAS,CAACE,OAAO,CAAC;QACjD;QACAX,uBAAuB,CAACqB,GAAG,CAACZ,SAAS,CAACE,OAAO,EAAES,SAAS,EAAEhB,QAAQ,EAAEY,KAAK,CAACC,OAAO,CAACL,WAAW,CAAC,GAAGE,MAAM,GAAG,CAACA,MAAM,CAAC,EAAEU,OAAO,CAAC;MAChI;MAEA,OAAO,OAAOZ,WAAW,KAAK;MAC1B;MAAA,EACEA,WAAW,CAACY,OAAO,CAAC,GACpBR,KAAK,CAACC,OAAO,CAACL,WAAW;MACvB;MAAA,EACEA,WAAW,CAACM,GAAG,CAACb,KAAK,IAAI,OAAOA,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACmB,OAAO,CAAC,GAAGnB,KAAK,CAAC,GAC9EO,WAAW;IACzB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
@@ -29,12 +29,34 @@ const events = {
29
29
  focused: false
30
30
  }
31
31
  };
32
+ const isFunctionWithBoundArgs = fn => {
33
+ return typeof fn === 'function' && 'getBoundArgs' in fn;
34
+ };
35
+ const extractFunctionArgs = styleResult => {
36
+ return isFunctionWithBoundArgs(styleResult) ? [styleResult.getBoundArgs()] : Array.isArray(styleResult) ? styleResult.map(style => isFunctionWithBoundArgs(style) ? style.getBoundArgs() : []) : [];
37
+ };
38
+ const extractStyleResult = style => {
39
+ return typeof style === 'function' ? [style()] : Array.isArray(style) ? style.map(style => typeof style === 'function' ? style() : style) : [style];
40
+ };
41
+ const updateStyles = ({
42
+ ref,
43
+ style,
44
+ variants,
45
+ state
46
+ }) => {
47
+ const styleResult = typeof style === 'function' ? style(state) : style;
48
+ const fnArgs = extractFunctionArgs(styleResult);
49
+ const extractedResult = extractStyleResult(styleResult);
50
+
51
+ // @ts-expect-error - this is hidden from TS
52
+ UnistylesShadowRegistry.add(ref, extractedResult, variants, fnArgs);
53
+ };
32
54
  export const Pressable = /*#__PURE__*/forwardRef(({
33
55
  variants,
34
56
  style,
35
57
  ...props
36
58
  }, passedRef) => {
37
- const storedRef = useRef();
59
+ const storedRef = useRef(null);
38
60
  const state = useRef(initialState);
39
61
  const styleRef = useRef(style);
40
62
  useEffect(() => {
@@ -46,14 +68,12 @@ export const Pressable = /*#__PURE__*/forwardRef(({
46
68
  ...state.current,
47
69
  ...newState
48
70
  };
49
- const styleResult = typeof styleRef.current === 'function' ? styleRef.current(state.current) : styleRef.current;
50
- const fnArgs = typeof styleResult === 'function'
51
- // @ts-expect-error - this is hidden from TS
52
- ? styleResult.getBoundArgs() : [];
53
- const extractedResult = typeof styleResult === 'function' ? styleResult() : styleResult;
54
-
55
- // @ts-expect-error - this is hidden from TS
56
- UnistylesShadowRegistry.add(storedRef.current, [extractedResult], variants, [fnArgs]);
71
+ updateStyles({
72
+ ref: storedRef.current,
73
+ style: styleRef.current,
74
+ variants,
75
+ state: state.current
76
+ });
57
77
  };
58
78
  if (!storedRef.current) {
59
79
  return;
@@ -74,17 +94,15 @@ export const Pressable = /*#__PURE__*/forwardRef(({
74
94
  ...props,
75
95
  ref: ref => {
76
96
  storedRef.current = ref;
77
- const styleResult = typeof style === 'function' ? style(initialState) : style;
78
- const fnArgs = typeof styleResult === 'function'
79
- // @ts-expect-error - this is hidden from TS
80
- ? styleResult.getBoundArgs() : [];
81
- const extractedResult = typeof styleResult === 'function' ? styleResult() : styleResult;
97
+ updateStyles({
98
+ ref,
99
+ style: style,
100
+ variants,
101
+ state: initialState
102
+ });
82
103
  if (typeof passedRef === 'object' && passedRef !== null) {
83
104
  passedRef.current = ref;
84
105
  }
85
-
86
- // @ts-expect-error - this is hidden from TS
87
- UnistylesShadowRegistry.add(ref, [extractedResult], variants, [fnArgs]);
88
106
  }
89
107
  });
90
108
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","useEffect","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","jsx","_jsx","initialState","pressed","hovered","focused","events","variants","style","props","passedRef","storedRef","state","styleRef","current","handler","newState","styleResult","fnArgs","getBoundArgs","extractedResult","add","ref","Object","entries","forEach","event","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["components/Pressable.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC5D,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,uBAAuB,QAAQ,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAalD,MAAMC,YAA+B,GAAG;EACpCC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE;AACb,CAAC;AAED,MAAMC,MAAM,GAAG;EACX,aAAa,EAAE;IAAEH,OAAO,EAAE;EAAK,CAAC;EAChC,WAAW,EAAE;IAAEA,OAAO,EAAE;EAAM,CAAC;EAC/B,cAAc,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EACjC,cAAc,EAAE;IAAEA,OAAO,EAAE;EAAM,CAAC;EAClC,OAAO,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EAC1B,MAAM,EAAE;IAAEA,OAAO,EAAE;EAAM;AAC7B,CAAkF;AAElF,OAAO,MAAMR,SAAS,gBAAGH,UAAU,CAA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AAgB,CAACD,KAAK,EAAEX,OAAO,CAACH,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,OAAO,MAAM;MACTW,MAAM,CAACC,OAAO,CAAClB,MAAM,CAAC,CAACmB,OAAO,CAAC,CAAC,CAACC,KAAK,EAAEd,KAAK,CAAC,KAAK;QAC/CU,GAAG,CAACM,mBAAmB,CAACF,KAAK,EAAEX,OAAO,CAACH,KAAK,CAAC,CAAC;MAClD,CAAC,CAAC;IACN,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBACIX,IAAA,CAACH,0BAA0B;IAAA,GACnBW,KAAK;IACTa,GAAG,EAAEA,GAAG,IAAI;MACRX,SAAS,CAACG,OAAO,GAAGQ,GAAG;MACvB,MAAML,WAAW,GAAG,OAAOT,KAAK,KAAK,UAAU,GACzCA,KAAK,CAACN,YAAY,CAAC,GACnBM,KAAK;MACX,MAAMU,MAAM,GAAG,OAAOD,WAAW,KAAK;MAClC;MAAA,EACEA,WAAW,CAACE,YAAY,CAAC,CAAC,GAC1B,EAAE;MACR,MAAMC,eAAe,GAAG,OAAOH,WAAW,KAAK,UAAU,GAClDA,WAAW,CAAc,CAAC,GAC3BA,WAAW;MAEjB,IAAI,OAAOP,SAAS,KAAK,QAAQ,IAAIA,SAAS,KAAK,IAAI,EAAE;QACrDA,SAAS,CAACI,OAAO,GAAGQ,GAAG;MAC3B;;MAEA;MACAvB,uBAAuB,CAACsB,GAAG,CAACC,GAAG,EAAE,CAACF,eAAe,CAAC,EAAEb,QAAQ,EAAE,CAACW,MAAM,CAAC,CAAC;IAC3E;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","forwardRef","useEffect","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","jsx","_jsx","initialState","pressed","hovered","focused","events","isFunctionWithBoundArgs","fn","extractFunctionArgs","styleResult","getBoundArgs","Array","isArray","map","style","extractStyleResult","updateStyles","ref","variants","state","fnArgs","extractedResult","add","props","passedRef","storedRef","styleRef","current","handler","newState","Object","entries","forEach","event","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["components/Pressable.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC5D,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,uBAAuB,QAAQ,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAelD,MAAMC,YAA+B,GAAG;EACpCC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE;AACb,CAAC;AAED,MAAMC,MAAM,GAAG;EACX,aAAa,EAAE;IAAEH,OAAO,EAAE;EAAK,CAAC;EAChC,WAAW,EAAE;IAAEA,OAAO,EAAE;EAAM,CAAC;EAC/B,cAAc,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EACjC,cAAc,EAAE;IAAEA,OAAO,EAAE;EAAM,CAAC;EAClC,OAAO,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EAC1B,MAAM,EAAE;IAAEA,OAAO,EAAE;EAAM;AAC7B,CAAkF;AASlF,MAAME,uBAAuB,GAAIC,EAAO,IAAkD;EACtF,OAAO,OAAOA,EAAE,KAAK,UAAU,IAAI,cAAc,IAAIA,EAAE;AAC3D,CAAC;AAED,MAAMC,mBAAmB,GAAIC,WAAgB,IAAK;EAC9C,OAAOH,uBAAuB,CAACG,WAAW,CAAC,GACrC,CAACA,WAAW,CAACC,YAAY,CAAC,CAAC,CAAC,GAC5BC,KAAK,CAACC,OAAO,CAACH,WAAW,CAAC,GACtBA,WAAW,CAACI,GAAG,CAACC,KAAK,IAAIR,uBAAuB,CAACQ,KAAK,CAAC,GAAGA,KAAK,CAACJ,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,GACpF,EAAE;AAChB,CAAC;AAED,MAAMK,kBAAkB,GAAID,KAAU,IAAK;EACvC,OAAO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