@lynx-js/lynx-ui-common 0.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.
Files changed (215) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -0
  3. package/dist/const/BaseScrollEventsMapping.d.ts +2 -0
  4. package/dist/const/BaseScrollEventsMapping.d.ts.map +1 -0
  5. package/dist/const/BaseScrollEventsMapping.jsx +13 -0
  6. package/dist/const/BaseScrollEventsMapping.jsx.map +1 -0
  7. package/dist/const/BaseUIEventsMapping.d.ts +4 -0
  8. package/dist/const/BaseUIEventsMapping.d.ts.map +1 -0
  9. package/dist/const/BaseUIEventsMapping.jsx +24 -0
  10. package/dist/const/BaseUIEventsMapping.jsx.map +1 -0
  11. package/dist/const/index.d.ts +3 -0
  12. package/dist/const/index.d.ts.map +1 -0
  13. package/dist/const/index.jsx +2 -0
  14. package/dist/hooks/docs/useBounce.jsx +0 -0
  15. package/dist/hooks/docs/useRefresh.jsx +0 -0
  16. package/dist/hooks/index.d.ts +19 -0
  17. package/dist/hooks/index.d.ts.map +1 -0
  18. package/dist/hooks/index.jsx +73 -0
  19. package/dist/hooks/index.jsx.map +1 -0
  20. package/dist/hooks/useBounce.d.ts +26 -0
  21. package/dist/hooks/useBounce.d.ts.map +1 -0
  22. package/dist/hooks/useBounce.jsx +383 -0
  23. package/dist/hooks/useBounce.jsx.map +1 -0
  24. package/dist/hooks/useGCCollector.d.ts +18 -0
  25. package/dist/hooks/useGCCollector.d.ts.map +1 -0
  26. package/dist/hooks/useGCCollector.jsx +48 -0
  27. package/dist/hooks/useGCCollector.jsx.map +1 -0
  28. package/dist/hooks/useGlobalEventListener.d.ts +9 -0
  29. package/dist/hooks/useGlobalEventListener.d.ts.map +1 -0
  30. package/dist/hooks/useGlobalEventListener.jsx +19 -0
  31. package/dist/hooks/useGlobalEventListener.jsx.map +1 -0
  32. package/dist/hooks/useLatest.d.ts +6 -0
  33. package/dist/hooks/useLatest.d.ts.map +1 -0
  34. package/dist/hooks/useLatest.jsx +9 -0
  35. package/dist/hooks/useLatest.jsx.map +1 -0
  36. package/dist/hooks/useMemoizedFn.d.ts +8 -0
  37. package/dist/hooks/useMemoizedFn.d.ts.map +1 -0
  38. package/dist/hooks/useMemoizedFn.jsx +15 -0
  39. package/dist/hooks/useMemoizedFn.jsx.map +1 -0
  40. package/dist/hooks/usePrevious.d.ts +16 -0
  41. package/dist/hooks/usePrevious.d.ts.map +1 -0
  42. package/dist/hooks/usePrevious.jsx +11 -0
  43. package/dist/hooks/usePrevious.jsx.map +1 -0
  44. package/dist/hooks/useRefresh.d.ts +24 -0
  45. package/dist/hooks/useRefresh.d.ts.map +1 -0
  46. package/dist/hooks/useRefresh.jsx +554 -0
  47. package/dist/hooks/useRefresh.jsx.map +1 -0
  48. package/dist/hooks/useRegisteredEvents.d.ts +19 -0
  49. package/dist/hooks/useRegisteredEvents.d.ts.map +1 -0
  50. package/dist/hooks/useRegisteredEvents.jsx +24 -0
  51. package/dist/hooks/useRegisteredEvents.jsx.map +1 -0
  52. package/dist/hooks/useUnmount.d.ts +2 -0
  53. package/dist/hooks/useUnmount.d.ts.map +1 -0
  54. package/dist/hooks/useUnmount.jsx +11 -0
  55. package/dist/hooks/useUnmount.jsx.map +1 -0
  56. package/dist/index.d.ts +8 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.jsx +6 -0
  59. package/dist/reactive/hooks/useReactiveValue.d.ts +22 -0
  60. package/dist/reactive/hooks/useReactiveValue.d.ts.map +1 -0
  61. package/dist/reactive/hooks/useReactiveValue.jsx +75 -0
  62. package/dist/reactive/hooks/useReactiveValue.jsx.map +1 -0
  63. package/dist/reactive/hooks/useReactiveValueChange.d.ts +4 -0
  64. package/dist/reactive/hooks/useReactiveValueChange.d.ts.map +1 -0
  65. package/dist/reactive/hooks/useReactiveValueChange.jsx +7 -0
  66. package/dist/reactive/hooks/useReactiveValueChange.jsx.map +1 -0
  67. package/dist/reactive/hooks/useReactiveValueEvent.d.ts +5 -0
  68. package/dist/reactive/hooks/useReactiveValueEvent.d.ts.map +1 -0
  69. package/dist/reactive/hooks/useReactiveValueEvent.jsx +15 -0
  70. package/dist/reactive/hooks/useReactiveValueEvent.jsx.map +1 -0
  71. package/dist/reactive/index.d.ts +6 -0
  72. package/dist/reactive/index.d.ts.map +1 -0
  73. package/dist/reactive/index.jsx +5 -0
  74. package/dist/reactive/types.d.ts +17 -0
  75. package/dist/reactive/types.d.ts.map +1 -0
  76. package/dist/reactive/types.jsx +0 -0
  77. package/dist/reactive/updateReactive.d.ts +4 -0
  78. package/dist/reactive/updateReactive.d.ts.map +1 -0
  79. package/dist/reactive/updateReactive.jsx +8 -0
  80. package/dist/reactive/updateReactive.jsx.map +1 -0
  81. package/dist/types/index.d.ts +2 -0
  82. package/dist/types/index.d.ts.map +1 -0
  83. package/dist/types/index.jsx +0 -0
  84. package/dist/types/interfaces/BaseScrollEvents.d.ts +40 -0
  85. package/dist/types/interfaces/BaseScrollEvents.d.ts.map +1 -0
  86. package/dist/types/interfaces/BaseScrollEvents.jsx +0 -0
  87. package/dist/types/interfaces/BaseUIEvents.d.ts +132 -0
  88. package/dist/types/interfaces/BaseUIEvents.d.ts.map +1 -0
  89. package/dist/types/interfaces/BaseUIEvents.jsx +0 -0
  90. package/dist/types/interfaces/BaseUIProps.d.ts +19 -0
  91. package/dist/types/interfaces/BaseUIProps.d.ts.map +1 -0
  92. package/dist/types/interfaces/BaseUIProps.jsx +0 -0
  93. package/dist/types/interfaces/BounceableInterface.d.ts +120 -0
  94. package/dist/types/interfaces/BounceableInterface.d.ts.map +1 -0
  95. package/dist/types/interfaces/BounceableInterface.jsx +0 -0
  96. package/dist/types/interfaces/EventMTSInterface.d.ts +1 -0
  97. package/dist/types/interfaces/EventMTSInterface.d.ts.map +1 -0
  98. package/dist/types/interfaces/EventMTSInterface.jsx +0 -0
  99. package/dist/types/interfaces/LazyInterface.d.ts +72 -0
  100. package/dist/types/interfaces/LazyInterface.d.ts.map +1 -0
  101. package/dist/types/interfaces/LazyInterface.jsx +0 -0
  102. package/dist/types/interfaces/RefreshInterface.d.ts +98 -0
  103. package/dist/types/interfaces/RefreshInterface.d.ts.map +1 -0
  104. package/dist/types/interfaces/RefreshInterface.jsx +10 -0
  105. package/dist/types/interfaces/RefreshInterface.jsx.map +1 -0
  106. package/dist/types/interfaces/index.d.ts +36 -0
  107. package/dist/types/interfaces/index.d.ts.map +1 -0
  108. package/dist/types/interfaces/index.jsx +0 -0
  109. package/dist/utils/common.d.ts +15 -0
  110. package/dist/utils/common.d.ts.map +1 -0
  111. package/dist/utils/common.jsx +12 -0
  112. package/dist/utils/common.jsx.map +1 -0
  113. package/dist/utils/common.test.jsx +55 -0
  114. package/dist/utils/common.test.jsx.map +1 -0
  115. package/dist/utils/convertToPx.d.ts +4 -0
  116. package/dist/utils/convertToPx.d.ts.map +1 -0
  117. package/dist/utils/convertToPx.jsx +20 -0
  118. package/dist/utils/convertToPx.jsx.map +1 -0
  119. package/dist/utils/delayFrames.d.ts +2 -0
  120. package/dist/utils/delayFrames.d.ts.map +1 -0
  121. package/dist/utils/delayFrames.jsx +12 -0
  122. package/dist/utils/delayFrames.jsx.map +1 -0
  123. package/dist/utils/getEventDetail.d.ts +23 -0
  124. package/dist/utils/getEventDetail.d.ts.map +1 -0
  125. package/dist/utils/getEventDetail.jsx +7 -0
  126. package/dist/utils/getEventDetail.jsx.map +1 -0
  127. package/dist/utils/index.d.ts +13 -0
  128. package/dist/utils/index.d.ts.map +1 -0
  129. package/dist/utils/index.jsx +12 -0
  130. package/dist/utils/interpolation.d.ts +40 -0
  131. package/dist/utils/interpolation.d.ts.map +1 -0
  132. package/dist/utils/interpolation.jsx +86 -0
  133. package/dist/utils/interpolation.jsx.map +1 -0
  134. package/dist/utils/interpolationJS.d.ts +39 -0
  135. package/dist/utils/interpolationJS.d.ts.map +1 -0
  136. package/dist/utils/interpolationJS.jsx +80 -0
  137. package/dist/utils/interpolationJS.jsx.map +1 -0
  138. package/dist/utils/log.d.ts +3 -0
  139. package/dist/utils/log.d.ts.map +1 -0
  140. package/dist/utils/log.jsx +10 -0
  141. package/dist/utils/log.jsx.map +1 -0
  142. package/dist/utils/mainThreadify.d.ts +2 -0
  143. package/dist/utils/mainThreadify.d.ts.map +1 -0
  144. package/dist/utils/mainThreadify.jsx +11 -0
  145. package/dist/utils/mainThreadify.jsx.map +1 -0
  146. package/dist/utils/popoverUtils.d.ts +3 -0
  147. package/dist/utils/popoverUtils.d.ts.map +1 -0
  148. package/dist/utils/popoverUtils.jsx +12 -0
  149. package/dist/utils/popoverUtils.jsx.map +1 -0
  150. package/dist/utils/renderContentWithExtraProps.d.ts +5 -0
  151. package/dist/utils/renderContentWithExtraProps.d.ts.map +1 -0
  152. package/dist/utils/renderContentWithExtraProps.jsx +10 -0
  153. package/dist/utils/renderContentWithExtraProps.jsx.map +1 -0
  154. package/dist/utils/selector.d.ts +36 -0
  155. package/dist/utils/selector.d.ts.map +1 -0
  156. package/dist/utils/selector.jsx +85 -0
  157. package/dist/utils/selector.jsx.map +1 -0
  158. package/dist/utils/selector.test.jsx +215 -0
  159. package/dist/utils/selector.test.jsx.map +1 -0
  160. package/dist/utils/version.d.ts +6 -0
  161. package/dist/utils/version.d.ts.map +1 -0
  162. package/dist/utils/version.jsx +28 -0
  163. package/dist/utils/version.jsx.map +1 -0
  164. package/dist/utils/version.test.jsx +77 -0
  165. package/dist/utils/version.test.jsx.map +1 -0
  166. package/package.json +52 -0
  167. package/src/const/BaseScrollEventsMapping.ts +14 -0
  168. package/src/const/BaseUIEventsMapping.ts +25 -0
  169. package/src/const/index.ts +6 -0
  170. package/src/hooks/docs/useBounce.mdx +2 -0
  171. package/src/hooks/docs/useRefresh.mdx +2 -0
  172. package/src/hooks/index.ts +96 -0
  173. package/src/hooks/useBounce.tsx +814 -0
  174. package/src/hooks/useGCCollector.tsx +76 -0
  175. package/src/hooks/useGlobalEventListener.ts +50 -0
  176. package/src/hooks/useLatest.ts +16 -0
  177. package/src/hooks/useMemoizedFn.ts +35 -0
  178. package/src/hooks/usePrevious.ts +28 -0
  179. package/src/hooks/useRefresh.ts +1054 -0
  180. package/src/hooks/useRegisteredEvents.ts +69 -0
  181. package/src/hooks/useUnmount.ts +18 -0
  182. package/src/index.tsx +25 -0
  183. package/src/reactive/hooks/useReactiveValue.ts +132 -0
  184. package/src/reactive/hooks/useReactiveValueChange.ts +15 -0
  185. package/src/reactive/hooks/useReactiveValueEvent.ts +26 -0
  186. package/src/reactive/index.ts +20 -0
  187. package/src/reactive/types.ts +29 -0
  188. package/src/reactive/updateReactive.ts +16 -0
  189. package/src/types/index.ts +5 -0
  190. package/src/types/interfaces/BaseScrollEvents.ts +47 -0
  191. package/src/types/interfaces/BaseUIEvents.ts +142 -0
  192. package/src/types/interfaces/BaseUIProps.ts +22 -0
  193. package/src/types/interfaces/BounceableInterface.ts +125 -0
  194. package/src/types/interfaces/EventMTSInterface.ts +35 -0
  195. package/src/types/interfaces/LazyInterface.tsx +78 -0
  196. package/src/types/interfaces/RefreshInterface.ts +105 -0
  197. package/src/types/interfaces/index.ts +44 -0
  198. package/src/utils/common.test.ts +64 -0
  199. package/src/utils/common.ts +35 -0
  200. package/src/utils/convertToPx.ts +32 -0
  201. package/src/utils/delayFrames.ts +24 -0
  202. package/src/utils/getEventDetail.ts +36 -0
  203. package/src/utils/index.ts +16 -0
  204. package/src/utils/interpolation.ts +222 -0
  205. package/src/utils/interpolationJS.ts +212 -0
  206. package/src/utils/log.ts +16 -0
  207. package/src/utils/mainThreadify.ts +17 -0
  208. package/src/utils/popoverUtils.ts +25 -0
  209. package/src/utils/renderContentWithExtraProps.ts +20 -0
  210. package/src/utils/selector.test.ts +237 -0
  211. package/src/utils/selector.ts +222 -0
  212. package/src/utils/version.test.ts +98 -0
  213. package/src/utils/version.ts +50 -0
  214. package/tsconfig.docs.json +7 -0
  215. package/tsconfig.json +12 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertToPx.d.ts","sourceRoot":"","sources":["../../src/utils/convertToPx.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,QAAgD,CAAA;AACxE,eAAO,MAAM,YAAY,QAAiD,CAAA;AAE1E,wBAAgB,WAAW,CACzB,KAAK,EACD,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,KAAK,GACd,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,SAAS,GACZ,MAAM,GAAG,SAAS,CAiBpB"}
@@ -0,0 +1,20 @@
1
+ const screenWidth = SystemInfo.pixelWidth / SystemInfo.pixelRatio;
2
+ const screenHeight = SystemInfo.pixelHeight / SystemInfo.pixelRatio;
3
+ function convertToPx(value) {
4
+ if (!value) return;
5
+ const num = Number.parseFloat(value);
6
+ const unit = value.slice(String(num).length).trim();
7
+ switch(unit){
8
+ case 'px':
9
+ return num;
10
+ case 'rpx':
11
+ return screenWidth / 750 * num;
12
+ case 'vw':
13
+ return screenWidth / 100 * num;
14
+ case 'vh':
15
+ return screenHeight / 100 * num;
16
+ }
17
+ }
18
+ export { convertToPx, screenHeight, screenWidth };
19
+
20
+ //# sourceMappingURL=convertToPx.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/convertToPx.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/convertToPx.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nexport const screenWidth = SystemInfo.pixelWidth / SystemInfo.pixelRatio\nexport const screenHeight = SystemInfo.pixelHeight / SystemInfo.pixelRatio\n\nexport function convertToPx(\n value:\n | `${number}px`\n | `${number}rpx`\n | `${number}vw`\n | `${number}vh`\n | undefined,\n): number | undefined {\n if (!value) {\n return undefined\n }\n const num = Number.parseFloat(value)\n\n const unit = value.slice(String(num).length).trim()\n switch (unit) {\n case 'px':\n return num\n case 'rpx':\n return num * (screenWidth / 750)\n case 'vw':\n return num * (screenWidth / 100)\n case 'vh':\n return num * (screenHeight / 100)\n }\n}\n"],"names":["screenWidth","SystemInfo","screenHeight","convertToPx","value","num","Number","unit","String"],"mappings":"AAIO,MAAMA,cAAcC,WAAW,UAAU,GAAGA,WAAW,UAAU;AACjE,MAAMC,eAAeD,WAAW,WAAW,GAAGA,WAAW,UAAU;AAEnE,SAASE,YACdC,KAKa;IAEb,IAAI,CAACA,OACH;IAEF,MAAMC,MAAMC,OAAO,UAAU,CAACF;IAE9B,MAAMG,OAAOH,MAAM,KAAK,CAACI,OAAOH,KAAK,MAAM,EAAE,IAAI;IACjD,OAAQE;QACN,KAAK;YACH,OAAOF;QACT,KAAK;YACH,OAAOA,AAAOL,cAAc,MAArBK;QACT,KAAK;YACH,OAAOA,AAAOL,cAAc,MAArBK;QACT,KAAK;YACH,OAAOA,AAAOH,eAAe,MAAtBG;IACX;AACF"}
@@ -0,0 +1,2 @@
1
+ export declare function delayFrames(frames: number, callback: () => void): void;
2
+ //# sourceMappingURL=delayFrames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delayFrames.d.ts","sourceRoot":"","sources":["../../src/utils/delayFrames.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAmBtE"}
@@ -0,0 +1,12 @@
1
+ function delayFrames(frames, callback) {
2
+ let count = 0;
3
+ const frameHandler = ()=>{
4
+ count++;
5
+ if (count >= frames) callback();
6
+ else lynx.requestAnimationFrame(frameHandler);
7
+ };
8
+ lynx.requestAnimationFrame(frameHandler);
9
+ }
10
+ export { delayFrames };
11
+
12
+ //# sourceMappingURL=delayFrames.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/delayFrames.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/delayFrames.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nexport function delayFrames(frames: number, callback: () => void): void {\n let count = 0\n\n const frameHandler = () => {\n count++\n if (count >= frames) {\n callback()\n } else {\n // (TODO) Currently the requestAnimation has bug on reactLynx 0.109.3. After it fixed, replace lynx.requestAnimationFrame with it.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n lynx.requestAnimationFrame(frameHandler)\n }\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n lynx.requestAnimationFrame(frameHandler)\n}\n"],"names":["delayFrames","frames","callback","count","frameHandler","lynx"],"mappings":"AAIO,SAASA,YAAYC,MAAc,EAAEC,QAAoB;IAC9D,IAAIC,QAAQ;IAEZ,MAAMC,eAAe;QACnBD;QACA,IAAIA,SAASF,QACXC;aAMAG,KAAK,qBAAqB,CAACD;IAE/B;IAIAC,KAAK,qBAAqB,CAACD;AAC7B"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A type representing event details that may contain layout and positioning information.
3
+ * It includes optional properties for dimensions and coordinates, and allows for other properties.
4
+ */
5
+ export type EventDetailWithLayout = {
6
+ left?: number;
7
+ top?: number;
8
+ right?: number;
9
+ bottom?: number;
10
+ width?: number;
11
+ height?: number;
12
+ } & Record<string, unknown>;
13
+ /**
14
+ * Safely retrieves detailed information from an event object.
15
+ * It attempts to access `event.detail` first. If `detail` is not available,
16
+ * it falls back to `event.params`. This is useful for maintaining
17
+ * compatibility across different event structures on different platforms and versions.
18
+ *
19
+ * @param event The event object, which can be of any type.
20
+ * @returns The `detail` or `params` object from the event, or an empty object if neither is found.
21
+ */
22
+ export declare function getEventDetail<T extends EventDetailWithLayout = EventDetailWithLayout>(event: any): T;
23
+ //# sourceMappingURL=getEventDetail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEventDetail.d.ts","sourceRoot":"","sources":["../../src/utils/getEventDetail.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE3B;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,EAExD,KAAK,EAAE,GAAG,GAAG,CAAC,CAMd"}
@@ -0,0 +1,7 @@
1
+ function getEventDetail(event) {
2
+ if (!event) return {};
3
+ return event.detail ?? event.params ?? {};
4
+ }
5
+ export { getEventDetail };
6
+
7
+ //# sourceMappingURL=getEventDetail.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/getEventDetail.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/getEventDetail.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\n/**\n * A type representing event details that may contain layout and positioning information.\n * It includes optional properties for dimensions and coordinates, and allows for other properties.\n */\nexport type EventDetailWithLayout = {\n left?: number\n top?: number\n right?: number\n bottom?: number\n width?: number\n height?: number\n} & Record<string, unknown>\n\n/**\n * Safely retrieves detailed information from an event object.\n * It attempts to access `event.detail` first. If `detail` is not available,\n * it falls back to `event.params`. This is useful for maintaining\n * compatibility across different event structures on different platforms and versions.\n *\n * @param event The event object, which can be of any type.\n * @returns The `detail` or `params` object from the event, or an empty object if neither is found.\n */\nexport function getEventDetail<\n T extends EventDetailWithLayout = EventDetailWithLayout,\n> // biome-ignore lint/suspicious/noExplicitAny: accept any type of events\n(event: any): T {\n if (!event) {\n return {} as T\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return (event.detail ?? event.params ?? {}) as T\n}\n"],"names":["getEventDetail","event"],"mappings":"AA0BO,SAASA,eAGfC,KAAU;IACT,IAAI,CAACA,OACH,OAAO,CAAC;IAGV,OAAQA,MAAM,MAAM,IAAIA,MAAM,MAAM,IAAI,CAAC;AAC3C"}
@@ -0,0 +1,13 @@
1
+ export * from './common';
2
+ export * from './version';
3
+ export * from './selector';
4
+ export * from './log';
5
+ export * from './mainThreadify';
6
+ export { convertOverlayMode, registerOverlayMode } from './popoverUtils';
7
+ export { convertToPx, screenWidth, screenHeight } from './convertToPx';
8
+ export { interpolate, interpolateJS } from './interpolation';
9
+ export { renderContentWithExtraProps } from './renderContentWithExtraProps';
10
+ export { delayFrames } from './delayFrames';
11
+ export { getEventDetail } from './getEventDetail';
12
+ export type { EventDetailWithLayout } from './getEventDetail';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { convertOverlayMode, registerOverlayMode } from "./popoverUtils.jsx";
2
+ import { convertToPx, screenHeight, screenWidth } from "./convertToPx.jsx";
3
+ import { interpolate, interpolateJS } from "./interpolation.jsx";
4
+ import { renderContentWithExtraProps } from "./renderContentWithExtraProps.jsx";
5
+ import { delayFrames } from "./delayFrames.jsx";
6
+ import { getEventDetail } from "./getEventDetail.jsx";
7
+ export * from "./common.jsx";
8
+ export * from "./version.jsx";
9
+ export * from "./selector.jsx";
10
+ export * from "./log.jsx";
11
+ export * from "./mainThreadify.jsx";
12
+ export { convertOverlayMode, convertToPx, delayFrames, getEventDetail, interpolate, interpolateJS, registerOverlayMode, renderContentWithExtraProps, screenHeight, screenWidth };
@@ -0,0 +1,40 @@
1
+ import { interpolateJS } from './interpolationJS';
2
+ /**
3
+ * Extrapolation type.
4
+ *
5
+ * @param IDENTITY - Returns the provided value as is.
6
+ * @param CLAMP - Clamps the value to the edge of the output range.
7
+ * @param EXTEND - Predicts the values beyond the output range.
8
+ */
9
+ export declare enum Extrapolation {
10
+ IDENTITY = "identity",
11
+ CLAMP = "clamp",
12
+ EXTEND = "extend"
13
+ }
14
+ /** Represents the possible values for extrapolation as a string. */
15
+ type ExtrapolationAsString = 'identity' | 'clamp' | 'extend';
16
+ /** Allows to specify extrapolation for left and right edge of the interpolation. */
17
+ export interface ExtrapolationConfig {
18
+ extrapolateLeft?: Extrapolation | string;
19
+ extrapolateRight?: Extrapolation | string;
20
+ }
21
+ /** Configuration options for extrapolation. */
22
+ export type ExtrapolationType = ExtrapolationConfig | Extrapolation | ExtrapolationAsString | undefined;
23
+ /**
24
+ * Lets you map a value from one range to another using linear interpolation.
25
+ *
26
+ * @param value - A number from the `input` range that is going to be mapped to
27
+ * the `output` range.
28
+ * @param inputRange - An array of numbers specifying the input range of the
29
+ * interpolation.
30
+ * @param outputRange - An array of numbers specifying the output range of the
31
+ * interpolation.
32
+ * @param extrapolate - Determines what happens when the `value` goes beyond the
33
+ * `input` range. Defaults to `Extrapolation.EXTEND` -
34
+ * {@link ExtrapolationType}.
35
+ * @returns A mapped value within the output range.
36
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolate
37
+ */
38
+ export declare function interpolate(x: number, inputRange: readonly number[], outputRange: readonly number[], type?: ExtrapolationType): number;
39
+ export { interpolateJS };
40
+ //# sourceMappingURL=interpolation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../src/utils/interpolation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD;;;;;;GAMG;AACH,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,oEAAoE;AACpE,KAAK,qBAAqB,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAS5D,oFAAoF;AACpF,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;IACxC,gBAAgB,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;CAC1C;AAOD,+CAA+C;AAC/C,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,aAAa,GACb,qBAAqB,GACrB,SAAS,CAAA;AAuHb;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,IAAI,CAAC,EAAE,iBAAiB,GACvB,MAAM,CAoCR;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,86 @@
1
+ import { interpolateJS } from "./interpolationJS.jsx";
2
+ var interpolation_Extrapolation = /*#__PURE__*/ function(Extrapolation) {
3
+ Extrapolation["IDENTITY"] = "identity";
4
+ Extrapolation["CLAMP"] = "clamp";
5
+ Extrapolation["EXTEND"] = "extend";
6
+ return Extrapolation;
7
+ }({});
8
+ function getVal(type, coefficient, val, leftEdgeOutput, rightEdgeOutput, x) {
9
+ 'main thread';
10
+ switch(type){
11
+ case "identity":
12
+ return x;
13
+ case "clamp":
14
+ if (coefficient * val < coefficient * leftEdgeOutput) return leftEdgeOutput;
15
+ return rightEdgeOutput;
16
+ default:
17
+ return val;
18
+ }
19
+ }
20
+ function isExtrapolate(value) {
21
+ 'main thread';
22
+ return "extend" === value || "clamp" === value || "identity" === value;
23
+ }
24
+ function validateType(type) {
25
+ 'main thread';
26
+ const extrapolationConfig = {
27
+ extrapolateLeft: "extend",
28
+ extrapolateRight: "extend"
29
+ };
30
+ if (!type) return extrapolationConfig;
31
+ if ('string' == typeof type) {
32
+ if (!isExtrapolate(type)) throw new Error(`Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\n Valid example:
33
+ interpolate(value, [inputRange], [outputRange], "clamp")`);
34
+ extrapolationConfig.extrapolateLeft = type;
35
+ extrapolationConfig.extrapolateRight = type;
36
+ return extrapolationConfig;
37
+ }
38
+ if (type.extrapolateLeft && !isExtrapolate(type.extrapolateLeft) || type.extrapolateRight && !isExtrapolate(type.extrapolateRight)) throw new Error(`Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\n Valid example:
39
+ interpolate(value, [inputRange], [outputRange], {
40
+ extrapolateLeft: Extrapolation.CLAMP,
41
+ extrapolateRight: Extrapolation.IDENTITY
42
+ }})`);
43
+ Object.assign(extrapolationConfig, type);
44
+ return extrapolationConfig;
45
+ }
46
+ function internalInterpolate(x, narrowedInput, extrapolationConfig) {
47
+ 'main thread';
48
+ const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } = narrowedInput;
49
+ if (rightEdgeInput - leftEdgeInput === 0) return leftEdgeOutput;
50
+ const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput);
51
+ const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput);
52
+ const coefficient = rightEdgeOutput >= leftEdgeOutput ? 1 : -1;
53
+ if (coefficient * val < coefficient * leftEdgeOutput) return getVal(extrapolationConfig.extrapolateLeft, coefficient, val, leftEdgeOutput, rightEdgeOutput, x);
54
+ if (coefficient * val > coefficient * rightEdgeOutput) return getVal(extrapolationConfig.extrapolateRight, coefficient, val, leftEdgeOutput, rightEdgeOutput, x);
55
+ return val;
56
+ }
57
+ function interpolate(x, inputRange, outputRange, type) {
58
+ 'main thread';
59
+ if (inputRange.length < 2 || outputRange.length < 2) throw new Error('Interpolation input and output ranges should contain at least two values.');
60
+ const extrapolationConfig = validateType(type);
61
+ const length = inputRange.length;
62
+ const narrowedInput = {
63
+ leftEdgeInput: inputRange[0],
64
+ rightEdgeInput: inputRange[1],
65
+ leftEdgeOutput: outputRange[0],
66
+ rightEdgeOutput: outputRange[1]
67
+ };
68
+ if (length > 2) {
69
+ if (x > inputRange[length - 1]) {
70
+ narrowedInput.leftEdgeInput = inputRange[length - 2];
71
+ narrowedInput.rightEdgeInput = inputRange[length - 1];
72
+ narrowedInput.leftEdgeOutput = outputRange[length - 2];
73
+ narrowedInput.rightEdgeOutput = outputRange[length - 1];
74
+ } else for(let i = 1; i < length; ++i)if (x <= inputRange[i]) {
75
+ narrowedInput.leftEdgeInput = inputRange[i - 1];
76
+ narrowedInput.rightEdgeInput = inputRange[i];
77
+ narrowedInput.leftEdgeOutput = outputRange[i - 1];
78
+ narrowedInput.rightEdgeOutput = outputRange[i];
79
+ break;
80
+ }
81
+ }
82
+ return internalInterpolate(x, narrowedInput, extrapolationConfig);
83
+ }
84
+ export { interpolation_Extrapolation as Extrapolation, interpolate, interpolateJS };
85
+
86
+ //# sourceMappingURL=interpolation.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/interpolation.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/interpolation.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\nimport { interpolateJS } from './interpolationJS'\n\n/**\n * Extrapolation type.\n *\n * @param IDENTITY - Returns the provided value as is.\n * @param CLAMP - Clamps the value to the edge of the output range.\n * @param EXTEND - Predicts the values beyond the output range.\n */\nexport enum Extrapolation {\n IDENTITY = 'identity',\n CLAMP = 'clamp',\n EXTEND = 'extend',\n}\n\n/** Represents the possible values for extrapolation as a string. */\ntype ExtrapolationAsString = 'identity' | 'clamp' | 'extend'\n\ninterface InterpolationNarrowedInput {\n leftEdgeInput: number\n rightEdgeInput: number\n leftEdgeOutput: number\n rightEdgeOutput: number\n}\n\n/** Allows to specify extrapolation for left and right edge of the interpolation. */\nexport interface ExtrapolationConfig {\n extrapolateLeft?: Extrapolation | string\n extrapolateRight?: Extrapolation | string\n}\n\ninterface RequiredExtrapolationConfig {\n extrapolateLeft: Extrapolation\n extrapolateRight: Extrapolation\n}\n\n/** Configuration options for extrapolation. */\nexport type ExtrapolationType =\n | ExtrapolationConfig\n | Extrapolation\n | ExtrapolationAsString\n | undefined\n\nfunction getVal(\n type: Extrapolation,\n coefficient: number,\n val: number,\n leftEdgeOutput: number,\n rightEdgeOutput: number,\n x: number,\n): number {\n 'main thread'\n\n switch (type) {\n case Extrapolation.IDENTITY:\n return x\n case Extrapolation.CLAMP:\n if (coefficient * val < coefficient * leftEdgeOutput) {\n return leftEdgeOutput\n }\n return rightEdgeOutput\n default:\n return val\n }\n}\n\nfunction isExtrapolate(value: string): value is Extrapolation {\n 'main thread'\n\n return (\n /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n value === Extrapolation.EXTEND\n || value === Extrapolation.CLAMP\n || value === Extrapolation.IDENTITY\n /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */\n )\n}\n\n// validates extrapolations type\n// if type is correct, converts it to ExtrapolationConfig\nfunction validateType(type: ExtrapolationType): RequiredExtrapolationConfig {\n 'main thread'\n // initialize extrapolationConfig with default extrapolation\n const extrapolationConfig: RequiredExtrapolationConfig = {\n extrapolateLeft: Extrapolation.EXTEND,\n extrapolateRight: Extrapolation.EXTEND,\n }\n\n if (!type) {\n return extrapolationConfig\n }\n\n if (typeof type === 'string') {\n if (!isExtrapolate(type)) {\n throw new Error(\n `Unsupported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], \"clamp\")`,\n )\n }\n extrapolationConfig.extrapolateLeft = type\n extrapolationConfig.extrapolateRight = type\n return extrapolationConfig\n }\n\n // otherwise type is extrapolation config object\n if (\n (type.extrapolateLeft && !isExtrapolate(type.extrapolateLeft))\n || (type.extrapolateRight && !isExtrapolate(type.extrapolateRight))\n ) {\n throw new Error(\n `Unsupported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})`,\n )\n }\n\n Object.assign(extrapolationConfig, type)\n return extrapolationConfig\n}\n\nfunction internalInterpolate(\n x: number,\n narrowedInput: InterpolationNarrowedInput,\n extrapolationConfig: RequiredExtrapolationConfig,\n) {\n 'main thread'\n const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } =\n narrowedInput\n if (rightEdgeInput - leftEdgeInput === 0) {\n return leftEdgeOutput\n }\n const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput)\n const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput)\n const coefficient = rightEdgeOutput >= leftEdgeOutput ? 1 : -1\n\n if (coefficient * val < coefficient * leftEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateLeft,\n coefficient,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x,\n )\n } else if (coefficient * val > coefficient * rightEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateRight,\n coefficient,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x,\n )\n }\n\n return val\n}\n\n/**\n * Lets you map a value from one range to another using linear interpolation.\n *\n * @param value - A number from the `input` range that is going to be mapped to\n * the `output` range.\n * @param inputRange - An array of numbers specifying the input range of the\n * interpolation.\n * @param outputRange - An array of numbers specifying the output range of the\n * interpolation.\n * @param extrapolate - Determines what happens when the `value` goes beyond the\n * `input` range. Defaults to `Extrapolation.EXTEND` -\n * {@link ExtrapolationType}.\n * @returns A mapped value within the output range.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolate\n */\nexport function interpolate(\n x: number,\n inputRange: readonly number[],\n outputRange: readonly number[],\n type?: ExtrapolationType,\n): number {\n 'main thread'\n if (inputRange.length < 2 || outputRange.length < 2) {\n throw new Error(\n 'Interpolation input and output ranges should contain at least two values.',\n )\n }\n\n const extrapolationConfig = validateType(type)\n const length = inputRange.length\n const narrowedInput: InterpolationNarrowedInput = {\n leftEdgeInput: inputRange[0],\n rightEdgeInput: inputRange[1],\n leftEdgeOutput: outputRange[0],\n rightEdgeOutput: outputRange[1],\n }\n if (length > 2) {\n if (x > inputRange[length - 1]) {\n narrowedInput.leftEdgeInput = inputRange[length - 2]\n narrowedInput.rightEdgeInput = inputRange[length - 1]\n narrowedInput.leftEdgeOutput = outputRange[length - 2]\n narrowedInput.rightEdgeOutput = outputRange[length - 1]\n } else {\n for (let i = 1; i < length; ++i) {\n if (x <= inputRange[i]) {\n narrowedInput.leftEdgeInput = inputRange[i - 1]\n narrowedInput.rightEdgeInput = inputRange[i]\n narrowedInput.leftEdgeOutput = outputRange[i - 1]\n narrowedInput.rightEdgeOutput = outputRange[i]\n break\n }\n }\n }\n }\n\n return internalInterpolate(x, narrowedInput, extrapolationConfig)\n}\n\nexport { interpolateJS }\n"],"names":["Extrapolation","getVal","type","coefficient","val","leftEdgeOutput","rightEdgeOutput","x","isExtrapolate","value","validateType","extrapolationConfig","Error","Object","internalInterpolate","narrowedInput","leftEdgeInput","rightEdgeInput","progress","interpolate","inputRange","outputRange","length","i"],"mappings":"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"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Extrapolation type.
3
+ *
4
+ * @param IDENTITY - Returns the provided value as is.
5
+ * @param CLAMP - Clamps the value to the edge of the output range.
6
+ * @param EXTEND - Predicts the values beyond the output range.
7
+ */
8
+ export declare enum Extrapolation {
9
+ IDENTITY = "identity",
10
+ CLAMP = "clamp",
11
+ EXTEND = "extend"
12
+ }
13
+ /** Represents the possible values for extrapolation as a string. */
14
+ type ExtrapolationAsString = 'identity' | 'clamp' | 'extend';
15
+ /** Allows to specify extrapolation for left and right edge of the interpolation. */
16
+ export interface ExtrapolationConfig {
17
+ extrapolateLeft?: Extrapolation | string;
18
+ extrapolateRight?: Extrapolation | string;
19
+ }
20
+ /** Configuration options for extrapolation. */
21
+ export type ExtrapolationType = ExtrapolationConfig | Extrapolation | ExtrapolationAsString | undefined;
22
+ /**
23
+ * Lets you map a value from one range to another using linear interpolation.
24
+ *
25
+ * @param value - A number from the `input` range that is going to be mapped to
26
+ * the `output` range.
27
+ * @param inputRange - An array of numbers specifying the input range of the
28
+ * interpolation.
29
+ * @param outputRange - An array of numbers specifying the output range of the
30
+ * interpolation.
31
+ * @param extrapolate - Determines what happens when the `value` goes beyond the
32
+ * `input` range. Defaults to `Extrapolation.EXTEND` -
33
+ * {@link ExtrapolationType}.
34
+ * @returns A mapped value within the output range.
35
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolate
36
+ */
37
+ export declare function interpolateJS(x: number, inputRange: readonly number[], outputRange: readonly number[], type?: ExtrapolationType): number;
38
+ export {};
39
+ //# sourceMappingURL=interpolationJS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpolationJS.d.ts","sourceRoot":"","sources":["../../src/utils/interpolationJS.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,oEAAoE;AACpE,KAAK,qBAAqB,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAS5D,oFAAoF;AACpF,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;IACxC,gBAAgB,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;CAC1C;AAOD,+CAA+C;AAC/C,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,aAAa,GACb,qBAAqB,GACrB,SAAS,CAAA;AAiHb;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,IAAI,CAAC,EAAE,iBAAiB,GACvB,MAAM,CAmCR"}
@@ -0,0 +1,80 @@
1
+ var interpolationJS_Extrapolation = /*#__PURE__*/ function(Extrapolation) {
2
+ Extrapolation["IDENTITY"] = "identity";
3
+ Extrapolation["CLAMP"] = "clamp";
4
+ Extrapolation["EXTEND"] = "extend";
5
+ return Extrapolation;
6
+ }({});
7
+ function getVal(type, coef, val, leftEdgeOutput, rightEdgeOutput, x) {
8
+ switch(type){
9
+ case "identity":
10
+ return x;
11
+ case "clamp":
12
+ if (coef * val < coef * leftEdgeOutput) return leftEdgeOutput;
13
+ return rightEdgeOutput;
14
+ default:
15
+ return val;
16
+ }
17
+ }
18
+ function isExtrapolate(value) {
19
+ return "extend" === value || "clamp" === value || "identity" === value;
20
+ }
21
+ function validateType(type) {
22
+ const extrapolationConfig = {
23
+ extrapolateLeft: "extend",
24
+ extrapolateRight: "extend"
25
+ };
26
+ if (!type) return extrapolationConfig;
27
+ if ('string' == typeof type) {
28
+ if (!isExtrapolate(type)) throw new Error(`Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\n Valid example:
29
+ interpolate(value, [inputRange], [outputRange], "clamp")`);
30
+ extrapolationConfig.extrapolateLeft = type;
31
+ extrapolationConfig.extrapolateRight = type;
32
+ return extrapolationConfig;
33
+ }
34
+ if (type.extrapolateLeft && !isExtrapolate(type.extrapolateLeft) || type.extrapolateRight && !isExtrapolate(type.extrapolateRight)) throw new Error(`Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\n Valid example:
35
+ interpolate(value, [inputRange], [outputRange], {
36
+ extrapolateLeft: Extrapolation.CLAMP,
37
+ extrapolateRight: Extrapolation.IDENTITY
38
+ }})`);
39
+ Object.assign(extrapolationConfig, type);
40
+ return extrapolationConfig;
41
+ }
42
+ function internalInterpolate(x, narrowedInput, extrapolationConfig) {
43
+ const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } = narrowedInput;
44
+ if (rightEdgeInput - leftEdgeInput === 0) return leftEdgeOutput;
45
+ const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput);
46
+ const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput);
47
+ const coef = rightEdgeOutput >= leftEdgeOutput ? 1 : -1;
48
+ if (coef * val < coef * leftEdgeOutput) return getVal(extrapolationConfig.extrapolateLeft, coef, val, leftEdgeOutput, rightEdgeOutput, x);
49
+ if (coef * val > coef * rightEdgeOutput) return getVal(extrapolationConfig.extrapolateRight, coef, val, leftEdgeOutput, rightEdgeOutput, x);
50
+ return val;
51
+ }
52
+ function interpolateJS(x, inputRange, outputRange, type) {
53
+ if (inputRange.length < 2 || outputRange.length < 2) throw new Error('Interpolation input and output ranges should contain at least two values.');
54
+ const extrapolationConfig = validateType(type);
55
+ const length = inputRange.length;
56
+ const narrowedInput = {
57
+ leftEdgeInput: inputRange[0],
58
+ rightEdgeInput: inputRange[1],
59
+ leftEdgeOutput: outputRange[0],
60
+ rightEdgeOutput: outputRange[1]
61
+ };
62
+ if (length > 2) {
63
+ if (x > inputRange[length - 1]) {
64
+ narrowedInput.leftEdgeInput = inputRange[length - 2];
65
+ narrowedInput.rightEdgeInput = inputRange[length - 1];
66
+ narrowedInput.leftEdgeOutput = outputRange[length - 2];
67
+ narrowedInput.rightEdgeOutput = outputRange[length - 1];
68
+ } else for(let i = 1; i < length; ++i)if (x <= inputRange[i]) {
69
+ narrowedInput.leftEdgeInput = inputRange[i - 1];
70
+ narrowedInput.rightEdgeInput = inputRange[i];
71
+ narrowedInput.leftEdgeOutput = outputRange[i - 1];
72
+ narrowedInput.rightEdgeOutput = outputRange[i];
73
+ break;
74
+ }
75
+ }
76
+ return internalInterpolate(x, narrowedInput, extrapolationConfig);
77
+ }
78
+ export { interpolationJS_Extrapolation as Extrapolation, interpolateJS };
79
+
80
+ //# sourceMappingURL=interpolationJS.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/interpolationJS.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/interpolationJS.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\n/**\n * Extrapolation type.\n *\n * @param IDENTITY - Returns the provided value as is.\n * @param CLAMP - Clamps the value to the edge of the output range.\n * @param EXTEND - Predicts the values beyond the output range.\n */\nexport enum Extrapolation {\n IDENTITY = 'identity',\n CLAMP = 'clamp',\n EXTEND = 'extend',\n}\n\n/** Represents the possible values for extrapolation as a string. */\ntype ExtrapolationAsString = 'identity' | 'clamp' | 'extend'\n\ninterface InterpolationNarrowedInput {\n leftEdgeInput: number\n rightEdgeInput: number\n leftEdgeOutput: number\n rightEdgeOutput: number\n}\n\n/** Allows to specify extrapolation for left and right edge of the interpolation. */\nexport interface ExtrapolationConfig {\n extrapolateLeft?: Extrapolation | string\n extrapolateRight?: Extrapolation | string\n}\n\ninterface RequiredExtrapolationConfig {\n extrapolateLeft: Extrapolation\n extrapolateRight: Extrapolation\n}\n\n/** Configuration options for extrapolation. */\nexport type ExtrapolationType =\n | ExtrapolationConfig\n | Extrapolation\n | ExtrapolationAsString\n | undefined\n\nfunction getVal(\n type: Extrapolation,\n coef: number,\n val: number,\n leftEdgeOutput: number,\n rightEdgeOutput: number,\n x: number,\n): number {\n switch (type) {\n case Extrapolation.IDENTITY:\n return x\n case Extrapolation.CLAMP:\n if (coef * val < coef * leftEdgeOutput) {\n return leftEdgeOutput\n }\n return rightEdgeOutput\n default:\n return val\n }\n}\n\nfunction isExtrapolate(value: string): value is Extrapolation {\n return (\n /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n value === Extrapolation.EXTEND\n || value === Extrapolation.CLAMP\n || value === Extrapolation.IDENTITY\n /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */\n )\n}\n\n// validates extrapolations type\n// if type is correct, converts it to ExtrapolationConfig\nfunction validateType(type: ExtrapolationType): RequiredExtrapolationConfig {\n // initialize extrapolationConfig with default extrapolation\n const extrapolationConfig: RequiredExtrapolationConfig = {\n extrapolateLeft: Extrapolation.EXTEND,\n extrapolateRight: Extrapolation.EXTEND,\n }\n\n if (!type) {\n return extrapolationConfig\n }\n\n if (typeof type === 'string') {\n if (!isExtrapolate(type)) {\n throw new Error(\n `Unsupported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], \"clamp\")`,\n )\n }\n extrapolationConfig.extrapolateLeft = type\n extrapolationConfig.extrapolateRight = type\n return extrapolationConfig\n }\n\n // otherwise type is extrapolation config object\n if (\n (type.extrapolateLeft && !isExtrapolate(type.extrapolateLeft))\n || (type.extrapolateRight && !isExtrapolate(type.extrapolateRight))\n ) {\n throw new Error(\n `Unsupported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolation.CLAMP, Extrapolation.EXTEND, Extrapolation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})`,\n )\n }\n\n Object.assign(extrapolationConfig, type)\n return extrapolationConfig\n}\n\nfunction internalInterpolate(\n x: number,\n narrowedInput: InterpolationNarrowedInput,\n extrapolationConfig: RequiredExtrapolationConfig,\n) {\n const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } =\n narrowedInput\n if (rightEdgeInput - leftEdgeInput === 0) {\n return leftEdgeOutput\n }\n const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput)\n const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput)\n const coef = rightEdgeOutput >= leftEdgeOutput ? 1 : -1\n\n if (coef * val < coef * leftEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateLeft,\n coef,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x,\n )\n } else if (coef * val > coef * rightEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateRight,\n coef,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x,\n )\n }\n\n return val\n}\n\n/**\n * Lets you map a value from one range to another using linear interpolation.\n *\n * @param value - A number from the `input` range that is going to be mapped to\n * the `output` range.\n * @param inputRange - An array of numbers specifying the input range of the\n * interpolation.\n * @param outputRange - An array of numbers specifying the output range of the\n * interpolation.\n * @param extrapolate - Determines what happens when the `value` goes beyond the\n * `input` range. Defaults to `Extrapolation.EXTEND` -\n * {@link ExtrapolationType}.\n * @returns A mapped value within the output range.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolate\n */\nexport function interpolateJS(\n x: number,\n inputRange: readonly number[],\n outputRange: readonly number[],\n type?: ExtrapolationType,\n): number {\n if (inputRange.length < 2 || outputRange.length < 2) {\n throw new Error(\n 'Interpolation input and output ranges should contain at least two values.',\n )\n }\n\n const extrapolationConfig = validateType(type)\n const length = inputRange.length\n const narrowedInput: InterpolationNarrowedInput = {\n leftEdgeInput: inputRange[0],\n rightEdgeInput: inputRange[1],\n leftEdgeOutput: outputRange[0],\n rightEdgeOutput: outputRange[1],\n }\n if (length > 2) {\n if (x > inputRange[length - 1]) {\n narrowedInput.leftEdgeInput = inputRange[length - 2]\n narrowedInput.rightEdgeInput = inputRange[length - 1]\n narrowedInput.leftEdgeOutput = outputRange[length - 2]\n narrowedInput.rightEdgeOutput = outputRange[length - 1]\n } else {\n for (let i = 1; i < length; ++i) {\n if (x <= inputRange[i]) {\n narrowedInput.leftEdgeInput = inputRange[i - 1]\n narrowedInput.rightEdgeInput = inputRange[i]\n narrowedInput.leftEdgeOutput = outputRange[i - 1]\n narrowedInput.rightEdgeOutput = outputRange[i]\n break\n }\n }\n }\n }\n\n return internalInterpolate(x, narrowedInput, extrapolationConfig)\n}\n"],"names":["Extrapolation","getVal","type","coef","val","leftEdgeOutput","rightEdgeOutput","x","isExtrapolate","value","validateType","extrapolationConfig","Error","Object","internalInterpolate","narrowedInput","leftEdgeInput","rightEdgeInput","progress","interpolateJS","inputRange","outputRange","length","i"],"mappings":"AAWO,IAAKA,gCAAaA,WAAAA,GAAAA,SAAbA,aAAa;;;;WAAbA;;AAkCZ,SAASC,OACPC,IAAmB,EACnBC,IAAY,EACZC,GAAW,EACXC,cAAsB,EACtBC,eAAuB,EACvBC,CAAS;IAET,OAAQL;QACN,KAAK;YACH,OAAOK;QACT,KAAK;YACH,IAAIJ,OAAOC,MAAMD,OAAOE,gBACtB,OAAOA;YAET,OAAOC;QACT;YACE,OAAOF;IACX;AACF;AAEA,SAASI,cAAcC,KAAa;IAClC,OAEEA,AAAU,aAAVA,SACGA,AAAU,YAAVA,SACAA,AAAU,eAAVA;AAGP;AAIA,SAASC,aAAaR,IAAuB;IAE3C,MAAMS,sBAAmD;QACvD,iBAAiB;QACjB,kBAAkB;IACpB;IAEA,IAAI,CAACT,MACH,OAAOS;IAGT,IAAI,AAAgB,YAAhB,OAAOT,MAAmB;QAC5B,IAAI,CAACM,cAAcN,OACjB,MAAM,IAAIU,MACR,CAAC;gEACuD,CAAC;QAG7DD,oBAAoB,eAAe,GAAGT;QACtCS,oBAAoB,gBAAgB,GAAGT;QACvC,OAAOS;IACT;IAGA,IACGT,KAAK,eAAe,IAAI,CAACM,cAAcN,KAAK,eAAe,KACxDA,KAAK,gBAAgB,IAAI,CAACM,cAAcN,KAAK,gBAAgB,GAEjE,MAAM,IAAIU,MACR,CAAC;;;;SAIE,CAAC;IAIRC,OAAO,MAAM,CAACF,qBAAqBT;IACnC,OAAOS;AACT;AAEA,SAASG,oBACPP,CAAS,EACTQ,aAAyC,EACzCJ,mBAAgD;IAEhD,MAAM,EAAEK,aAAa,EAAEC,cAAc,EAAEZ,cAAc,EAAEC,eAAe,EAAE,GACtES;IACF,IAAIE,iBAAiBD,kBAAkB,GACrC,OAAOX;IAET,MAAMa,WAAYX,AAAAA,CAAAA,IAAIS,aAAY,IAAMC,CAAAA,iBAAiBD,aAAY;IACrE,MAAMZ,MAAMC,iBAAiBa,WAAYZ,CAAAA,kBAAkBD,cAAa;IACxE,MAAMF,OAAOG,mBAAmBD,iBAAiB,IAAI;IAErD,IAAIF,OAAOC,MAAMD,OAAOE,gBACtB,OAAOJ,OACLU,oBAAoB,eAAe,EACnCR,MACAC,KACAC,gBACAC,iBACAC;IAEG,IAAIJ,OAAOC,MAAMD,OAAOG,iBAC7B,OAAOL,OACLU,oBAAoB,gBAAgB,EACpCR,MACAC,KACAC,gBACAC,iBACAC;IAIJ,OAAOH;AACT;AAiBO,SAASe,cACdZ,CAAS,EACTa,UAA6B,EAC7BC,WAA8B,EAC9BnB,IAAwB;IAExB,IAAIkB,WAAW,MAAM,GAAG,KAAKC,YAAY,MAAM,GAAG,GAChD,MAAM,IAAIT,MACR;IAIJ,MAAMD,sBAAsBD,aAAaR;IACzC,MAAMoB,SAASF,WAAW,MAAM;IAChC,MAAML,gBAA4C;QAChD,eAAeK,UAAU,CAAC,EAAE;QAC5B,gBAAgBA,UAAU,CAAC,EAAE;QAC7B,gBAAgBC,WAAW,CAAC,EAAE;QAC9B,iBAAiBA,WAAW,CAAC,EAAE;IACjC;IACA,IAAIC,SAAS,GACX;QAAA,IAAIf,IAAIa,UAAU,CAACE,SAAS,EAAE,EAAE;YAC9BP,cAAc,aAAa,GAAGK,UAAU,CAACE,SAAS,EAAE;YACpDP,cAAc,cAAc,GAAGK,UAAU,CAACE,SAAS,EAAE;YACrDP,cAAc,cAAc,GAAGM,WAAW,CAACC,SAAS,EAAE;YACtDP,cAAc,eAAe,GAAGM,WAAW,CAACC,SAAS,EAAE;QACzD,OACE,IAAK,IAAIC,IAAI,GAAGA,IAAID,QAAQ,EAAEC,EAC5B,IAAIhB,KAAKa,UAAU,CAACG,EAAE,EAAE;YACtBR,cAAc,aAAa,GAAGK,UAAU,CAACG,IAAI,EAAE;YAC/CR,cAAc,cAAc,GAAGK,UAAU,CAACG,EAAE;YAC5CR,cAAc,cAAc,GAAGM,WAAW,CAACE,IAAI,EAAE;YACjDR,cAAc,eAAe,GAAGM,WAAW,CAACE,EAAE;YAC9C;QACF;IAEJ;IAGF,OAAOT,oBAAoBP,GAAGQ,eAAeJ;AAC/C"}
@@ -0,0 +1,3 @@
1
+ export declare const log: (showLog: boolean, ...data: unknown[]) => void;
2
+ export declare const mtsLog: (showLog: boolean, ...data: unknown[]) => void;
3
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,GAAG,GAAI,SAAS,OAAO,EAAE,GAAG,MAAM,OAAO,EAAE,KAAG,IAI1D,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,EAAE,GAAG,MAAM,OAAO,EAAE,KAAG,IAK7D,CAAA"}
@@ -0,0 +1,10 @@
1
+ const log = (showLog, ...data)=>{
2
+ if (showLog) console.info(...data);
3
+ };
4
+ const mtsLog = (showLog, ...data)=>{
5
+ 'main thread';
6
+ if (showLog) console.info(...data);
7
+ };
8
+ export { log, mtsLog };
9
+
10
+ //# sourceMappingURL=log.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/log.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/log.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nexport const log = (showLog: boolean, ...data: unknown[]): void => {\n if (showLog) {\n console.info(...data)\n }\n}\n\nexport const mtsLog = (showLog: boolean, ...data: unknown[]): void => {\n 'main thread'\n if (showLog) {\n console.info(...data)\n }\n}\n"],"names":["log","showLog","data","console","mtsLog"],"mappings":"AAIO,MAAMA,MAAM,CAACC,SAAkB,GAAGC;IACvC,IAAID,SACFE,QAAQ,IAAI,IAAID;AAEpB;AAEO,MAAME,SAAS,CAACH,SAAkB,GAAGC;IAC1C;IACA,IAAID,SACFE,QAAQ,IAAI,IAAID;AAEpB"}
@@ -0,0 +1,2 @@
1
+ export declare const mainThreadifyEventsMapping: (rawEvents: Record<string, string>) => Record<string, string>;
2
+ //# sourceMappingURL=mainThreadify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mainThreadify.d.ts","sourceRoot":"","sources":["../../src/utils/mainThreadify.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,2BAWlC,CAAA"}
@@ -0,0 +1,11 @@
1
+ const mainThreadifyEventsMapping = (rawEvents)=>{
2
+ let mainThreadifyEvents = {};
3
+ mainThreadifyEvents = Object.entries(rawEvents).reduce((EventsWithMainThread, [key, value])=>{
4
+ EventsWithMainThread[`main-thread:${key}`] = `main-thread:${value}`;
5
+ return EventsWithMainThread;
6
+ }, {});
7
+ return mainThreadifyEvents;
8
+ };
9
+ export { mainThreadifyEventsMapping };
10
+
11
+ //# sourceMappingURL=mainThreadify.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/mainThreadify.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/mainThreadify.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nexport const mainThreadifyEventsMapping = (\n rawEvents: Record<string, string>,\n) => {\n let mainThreadifyEvents: Record<string, string> = {}\n mainThreadifyEvents = Object.entries(rawEvents).reduce(\n (EventsWithMainThread: Record<string, string>, [key, value]) => {\n EventsWithMainThread[`main-thread:${key}`] = `main-thread:${value}`\n return EventsWithMainThread\n },\n {},\n )\n return mainThreadifyEvents\n}\n"],"names":["mainThreadifyEventsMapping","rawEvents","mainThreadifyEvents","Object","EventsWithMainThread","key","value"],"mappings":"AAIO,MAAMA,6BAA6B,CACxCC;IAEA,IAAIC,sBAA8C,CAAC;IACnDA,sBAAsBC,OAAO,OAAO,CAACF,WAAW,MAAM,CACpD,CAACG,sBAA8C,CAACC,KAAKC,MAAM;QACzDF,oBAAoB,CAAC,CAAC,YAAY,EAAEC,KAAK,CAAC,GAAG,CAAC,YAAY,EAAEC,OAAO;QACnE,OAAOF;IACT,GACA,CAAC;IAEH,OAAOF;AACT"}
@@ -0,0 +1,3 @@
1
+ export declare const registerOverlayMode: (mode: string, controllerName: string) => void;
2
+ export declare const convertOverlayMode: (mode: string) => string | undefined;
3
+ //# sourceMappingURL=popoverUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popoverUtils.d.ts","sourceRoot":"","sources":["../../src/utils/popoverUtils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,GAC9B,MAAM,MAAM,EACZ,gBAAgB,MAAM,KACrB,IAEF,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,KACX,MAAM,GAAG,SASX,CAAA"}
@@ -0,0 +1,12 @@
1
+ const overlayModeMap = new Map();
2
+ const registerOverlayMode = (mode, controllerName)=>{
3
+ overlayModeMap.set(mode, controllerName);
4
+ };
5
+ const convertOverlayMode = (mode)=>{
6
+ if (!mode) return;
7
+ if (overlayModeMap.has(mode)) return overlayModeMap.get(mode);
8
+ return mode;
9
+ };
10
+ export { convertOverlayMode, registerOverlayMode };
11
+
12
+ //# sourceMappingURL=popoverUtils.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/popoverUtils.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/popoverUtils.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nconst overlayModeMap = new Map<string, string>()\n\nexport const registerOverlayMode = (\n mode: string,\n controllerName: string,\n): void => {\n overlayModeMap.set(mode, controllerName)\n}\n\nexport const convertOverlayMode = (\n mode: string,\n): string | undefined => {\n if (!mode) {\n return undefined\n }\n // only iOS need this info\n if (overlayModeMap.has(mode)) {\n return overlayModeMap.get(mode)\n }\n return mode\n}\n"],"names":["overlayModeMap","Map","registerOverlayMode","mode","controllerName","convertOverlayMode"],"mappings":"AAIA,MAAMA,iBAAiB,IAAIC;AAEpB,MAAMC,sBAAsB,CACjCC,MACAC;IAEAJ,eAAe,GAAG,CAACG,MAAMC;AAC3B;AAEO,MAAMC,qBAAqB,CAChCF;IAEA,IAAI,CAACA,MACH;IAGF,IAAIH,eAAe,GAAG,CAACG,OACrB,OAAOH,eAAe,GAAG,CAACG;IAE5B,OAAOA;AACT"}
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from '@lynx-js/react';
2
+ export declare function renderContentWithExtraProps<T, U = {
3
+ active: boolean;
4
+ }>(extraProps: T, renderFunction: ((innerProps: T & U) => ReactNode) | ReactNode): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | ((props: U) => ReactNode) | null | undefined;
5
+ //# sourceMappingURL=renderContentWithExtraProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderContentWithExtraProps.d.ts","sourceRoot":"","sources":["../../src/utils/renderContentWithExtraProps.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EACpE,UAAU,EAAE,CAAC,EACb,cAAc,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,SAAS,uJAMtD,CAAC,mCAKV"}
@@ -0,0 +1,10 @@
1
+ function renderContentWithExtraProps(extraProps, renderFunction) {
2
+ const createContent = (extraProps, renderFunction)=>(props)=>renderFunction({
3
+ ...extraProps,
4
+ ...props
5
+ });
6
+ return 'function' == typeof renderFunction ? createContent(extraProps, renderFunction) : renderFunction;
7
+ }
8
+ export { renderContentWithExtraProps };
9
+
10
+ //# sourceMappingURL=renderContentWithExtraProps.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/renderContentWithExtraProps.jsx","sources":["webpack://@lynx-js/lynx-ui-common/./src/utils/renderContentWithExtraProps.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport type { ReactNode } from '@lynx-js/react'\n\nexport function renderContentWithExtraProps<T, U = { active: boolean }>(\n extraProps: T,\n renderFunction: ((innerProps: T & U) => ReactNode) | ReactNode,\n) {\n const createContent = (\n extraProps: T,\n renderFunction: (innerProps: T & U) => ReactNode,\n ) =>\n (props: U) => renderFunction({ ...extraProps, ...props })\n\n return typeof renderFunction === 'function'\n ? createContent(extraProps, renderFunction)\n : renderFunction\n}\n"],"names":["renderContentWithExtraProps","extraProps","renderFunction","createContent","props"],"mappings":"AAMO,SAASA,4BACdC,UAAa,EACbC,cAA8D;IAE9D,MAAMC,gBAAgB,CACpBF,YACAC,iBAEF,CAACE,QAAaF,eAAe;gBAAE,GAAGD,UAAU;gBAAE,GAAGG,KAAK;YAAC;IAEvD,OAAO,AAA0B,cAA1B,OAAOF,iBACVC,cAAcF,YAAYC,kBAC1BA;AACN"}
@@ -0,0 +1,36 @@
1
+ import type { RefObject } from '@lynx-js/react';
2
+ import type { AnyObject, MainThread, NodesRef } from '@lynx-js/types';
3
+ export declare class InvokeRejectError extends Error {
4
+ errorCode: number;
5
+ detail?: object | string;
6
+ constructor(errorCode: number, errorMsg?: string);
7
+ }
8
+ export declare const setNativePropsByRef: (ref: RefObject<NodesRef> | undefined, props: Record<string, any>) => void;
9
+ export declare const setNativePropsById: (id: string, props: Record<string, any>) => void;
10
+ export declare const setNativeProps: (target: {
11
+ ref?: RefObject<NodesRef>;
12
+ id?: string;
13
+ }, props: Record<string, any>) => void;
14
+ export declare const invokeByRef: (ref: RefObject<NodesRef> | undefined, method: string, params?: AnyObject) => Promise<unknown>;
15
+ export declare const invokeById: (id: string, method: string, params?: AnyObject) => Promise<unknown>;
16
+ export declare const invoke: (target: {
17
+ ref?: RefObject<NodesRef>;
18
+ id?: string;
19
+ }, method: string, params?: AnyObject) => Promise<unknown>;
20
+ export interface GetRectPromise {
21
+ left: number;
22
+ top: number;
23
+ width: number;
24
+ height: number;
25
+ bottom: number;
26
+ right: number;
27
+ }
28
+ export declare const getRectByRef: (ref?: RefObject<NodesRef>, relativeToScreen?: boolean, relativeTo?: string) => Promise<GetRectPromise>;
29
+ export declare const getRootRect: (relativeToScreen?: boolean, relativeTo?: string) => Promise<GetRectPromise>;
30
+ export declare const getRectById: (id: string, relativeToScreen?: boolean, relativeTo?: string) => Promise<GetRectPromise>;
31
+ export declare const getRect: (target: {
32
+ ref?: RefObject<NodesRef>;
33
+ id?: string;
34
+ }, relativeToScreen?: boolean) => Promise<GetRectPromise>;
35
+ export declare const selectorMT: (selector: string) => MainThread.Element | null;
36
+ //# sourceMappingURL=selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/utils/selector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAErE,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;gBACZ,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAKjD;AAED,eAAO,MAAM,mBAAmB,GAC9B,KAAK,SAAS,CAAC,QAAQ,CAAC,GAAG,SAAS,EAEpC,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAG3B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EAEV,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAG3B,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,QAAQ;IACN,GAAG,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IACzB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,EAED,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAIgB,CAAA;AAE5C,eAAO,MAAM,WAAW,GACtB,KAAK,SAAS,CAAC,QAAQ,CAAC,GAAG,SAAS,EACpC,QAAQ,MAAM,EACd,SAAS,SAAS,KACjB,OAAO,CAAC,OAAO,CAmBd,CAAA;AAEJ,eAAO,MAAM,UAAU,GACrB,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,SAAS,SAAS,KACjB,OAAO,CAAC,OAAO,CAiBd,CAAA;AAEJ,eAAO,MAAM,MAAM,GACjB,QAAQ;IACN,GAAG,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IACzB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,EACD,QAAQ,MAAM,EACd,SAAS,SAAS,KACjB,OAAO,CAAC,OAAO,CAG2B,CAAA;AAE7C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,SAAS,CAAC,QAAQ,CAAC,EACzB,0BAAwB,EACxB,mBAAe,KACd,OAAO,CAAC,cAAc,CAqBrB,CAAA;AAEJ,eAAO,MAAM,WAAW,GACtB,0BAAwB,EACxB,mBAAe,KACd,OAAO,CAAC,cAAc,CA4BrB,CAAA;AAEJ,eAAO,MAAM,WAAW,GACtB,IAAI,MAAM,EACV,0BAAwB,EACxB,mBAAe,KACd,OAAO,CAAC,cAAc,CAqBrB,CAAA;AAEJ,eAAO,MAAM,OAAO,GAClB,QAAQ;IACN,GAAG,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IACzB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,EACD,0BAAwB,KACvB,OAAO,CAAC,cAAc,CAGuB,CAAA;AAEhD,eAAO,MAAM,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAC,OAAO,GAAG,IAQnE,CAAA"}