react-native-skelo 0.0.1 → 0.0.2

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 (269) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -20
  3. package/lib/commonjs/Skelo.js +104 -0
  4. package/lib/commonjs/Skelo.js.map +1 -0
  5. package/lib/commonjs/animations/AnimationWrapper.js +76 -0
  6. package/lib/commonjs/animations/AnimationWrapper.js.map +1 -0
  7. package/lib/commonjs/animations/PulseAnimation.js +76 -0
  8. package/lib/commonjs/animations/PulseAnimation.js.map +1 -0
  9. package/lib/commonjs/animations/ShimmerAnimation.js +103 -0
  10. package/lib/commonjs/animations/ShimmerAnimation.js.map +1 -0
  11. package/lib/commonjs/animations/index.js +27 -0
  12. package/lib/commonjs/animations/index.js.map +1 -0
  13. package/lib/commonjs/components/MeasuredBlock.js +64 -0
  14. package/lib/commonjs/components/MeasuredBlock.js.map +1 -0
  15. package/lib/commonjs/components/Skeleton.js +144 -0
  16. package/lib/commonjs/components/Skeleton.js.map +1 -0
  17. package/lib/commonjs/components/SkeletonIgnore.js +30 -0
  18. package/lib/commonjs/components/SkeletonIgnore.js.map +1 -0
  19. package/lib/commonjs/components/SkeletonRenderer.js +270 -0
  20. package/lib/commonjs/components/SkeletonRenderer.js.map +1 -0
  21. package/lib/commonjs/components/primitives/SkeletonBox.js +47 -0
  22. package/lib/commonjs/components/primitives/SkeletonBox.js.map +1 -0
  23. package/lib/commonjs/components/primitives/SkeletonCircle.js +44 -0
  24. package/lib/commonjs/components/primitives/SkeletonCircle.js.map +1 -0
  25. package/lib/commonjs/components/primitives/SkeletonImage.js +46 -0
  26. package/lib/commonjs/components/primitives/SkeletonImage.js.map +1 -0
  27. package/lib/commonjs/components/primitives/SkeletonText.js +60 -0
  28. package/lib/commonjs/components/primitives/SkeletonText.js.map +1 -0
  29. package/lib/commonjs/components/primitives/index.js +34 -0
  30. package/lib/commonjs/components/primitives/index.js.map +1 -0
  31. package/lib/commonjs/components/withSkeleton.js +45 -0
  32. package/lib/commonjs/components/withSkeleton.js.map +1 -0
  33. package/lib/commonjs/constants/defaults.js +43 -0
  34. package/lib/commonjs/constants/defaults.js.map +1 -0
  35. package/lib/commonjs/core/deepRegistry.js +18 -0
  36. package/lib/commonjs/core/deepRegistry.js.map +1 -0
  37. package/lib/commonjs/core/generator/StyleSkeleton.js +101 -0
  38. package/lib/commonjs/core/generator/StyleSkeleton.js.map +1 -0
  39. package/lib/commonjs/core/parser/Parser.js +84 -0
  40. package/lib/commonjs/core/parser/Parser.js.map +1 -0
  41. package/lib/commonjs/core/parser/expandOffline.js +83 -0
  42. package/lib/commonjs/core/parser/expandOffline.js.map +1 -0
  43. package/lib/commonjs/core/parser/hostTreeReconciler.js +228 -0
  44. package/lib/commonjs/core/parser/hostTreeReconciler.js.map +1 -0
  45. package/lib/commonjs/core/parser/index.js +13 -0
  46. package/lib/commonjs/core/parser/index.js.map +1 -0
  47. package/lib/commonjs/core/registry/SkeletonRegistry.js +113 -0
  48. package/lib/commonjs/core/registry/SkeletonRegistry.js.map +1 -0
  49. package/lib/commonjs/core/registry/index.js +19 -0
  50. package/lib/commonjs/core/registry/index.js.map +1 -0
  51. package/lib/commonjs/core/resolver/StyleResolver.js +83 -0
  52. package/lib/commonjs/core/resolver/StyleResolver.js.map +1 -0
  53. package/lib/commonjs/core/resolver/index.js +13 -0
  54. package/lib/commonjs/core/resolver/index.js.map +1 -0
  55. package/lib/commonjs/deep.js +18 -0
  56. package/lib/commonjs/deep.js.map +1 -0
  57. package/lib/commonjs/index.js +66 -0
  58. package/lib/commonjs/index.js.map +1 -0
  59. package/lib/commonjs/plugins/ImagePlugin.js +60 -0
  60. package/lib/commonjs/plugins/ImagePlugin.js.map +1 -0
  61. package/lib/commonjs/plugins/TextPlugin.js +70 -0
  62. package/lib/commonjs/plugins/TextPlugin.js.map +1 -0
  63. package/lib/commonjs/plugins/ViewPlugin.js +71 -0
  64. package/lib/commonjs/plugins/ViewPlugin.js.map +1 -0
  65. package/lib/commonjs/plugins/index.js +27 -0
  66. package/lib/commonjs/plugins/index.js.map +1 -0
  67. package/lib/commonjs/types/index.js +2 -0
  68. package/lib/commonjs/types/index.js.map +1 -0
  69. package/lib/commonjs/types/plugin.js +6 -0
  70. package/lib/commonjs/types/plugin.js.map +1 -0
  71. package/lib/commonjs/types/skeleton.js +6 -0
  72. package/lib/commonjs/types/skeleton.js.map +1 -0
  73. package/lib/commonjs/utils/componentUtils.js +138 -0
  74. package/lib/commonjs/utils/componentUtils.js.map +1 -0
  75. package/lib/commonjs/utils/index.js +62 -0
  76. package/lib/commonjs/utils/index.js.map +1 -0
  77. package/lib/commonjs/utils/styleUtils.js +76 -0
  78. package/lib/commonjs/utils/styleUtils.js.map +1 -0
  79. package/lib/module/Skelo.js +98 -0
  80. package/lib/module/Skelo.js.map +1 -0
  81. package/lib/module/animations/AnimationWrapper.js +69 -0
  82. package/lib/module/animations/AnimationWrapper.js.map +1 -0
  83. package/lib/module/animations/PulseAnimation.js +69 -0
  84. package/lib/module/animations/PulseAnimation.js.map +1 -0
  85. package/lib/module/animations/ShimmerAnimation.js +96 -0
  86. package/lib/module/animations/ShimmerAnimation.js.map +1 -0
  87. package/lib/module/animations/index.js +4 -0
  88. package/lib/module/animations/index.js.map +1 -0
  89. package/lib/module/components/MeasuredBlock.js +57 -0
  90. package/lib/module/components/MeasuredBlock.js.map +1 -0
  91. package/lib/module/components/Skeleton.js +138 -0
  92. package/lib/module/components/Skeleton.js.map +1 -0
  93. package/lib/module/components/SkeletonIgnore.js +23 -0
  94. package/lib/module/components/SkeletonIgnore.js.map +1 -0
  95. package/lib/module/components/SkeletonRenderer.js +264 -0
  96. package/lib/module/components/SkeletonRenderer.js.map +1 -0
  97. package/lib/module/components/primitives/SkeletonBox.js +40 -0
  98. package/lib/module/components/primitives/SkeletonBox.js.map +1 -0
  99. package/lib/module/components/primitives/SkeletonCircle.js +37 -0
  100. package/lib/module/components/primitives/SkeletonCircle.js.map +1 -0
  101. package/lib/module/components/primitives/SkeletonImage.js +39 -0
  102. package/lib/module/components/primitives/SkeletonImage.js.map +1 -0
  103. package/lib/module/components/primitives/SkeletonText.js +53 -0
  104. package/lib/module/components/primitives/SkeletonText.js.map +1 -0
  105. package/lib/module/components/primitives/index.js +5 -0
  106. package/lib/module/components/primitives/index.js.map +1 -0
  107. package/lib/module/components/withSkeleton.js +38 -0
  108. package/lib/module/components/withSkeleton.js.map +1 -0
  109. package/lib/module/constants/defaults.js +37 -0
  110. package/lib/module/constants/defaults.js.map +1 -0
  111. package/lib/module/core/deepRegistry.js +11 -0
  112. package/lib/module/core/deepRegistry.js.map +1 -0
  113. package/lib/module/core/generator/StyleSkeleton.js +95 -0
  114. package/lib/module/core/generator/StyleSkeleton.js.map +1 -0
  115. package/lib/module/core/parser/Parser.js +77 -0
  116. package/lib/module/core/parser/Parser.js.map +1 -0
  117. package/lib/module/core/parser/expandOffline.js +77 -0
  118. package/lib/module/core/parser/expandOffline.js.map +1 -0
  119. package/lib/module/core/parser/hostTreeReconciler.js +222 -0
  120. package/lib/module/core/parser/hostTreeReconciler.js.map +1 -0
  121. package/lib/module/core/parser/index.js +2 -0
  122. package/lib/module/core/parser/index.js.map +1 -0
  123. package/lib/module/core/registry/SkeletonRegistry.js +106 -0
  124. package/lib/module/core/registry/SkeletonRegistry.js.map +1 -0
  125. package/lib/module/core/registry/index.js +2 -0
  126. package/lib/module/core/registry/index.js.map +1 -0
  127. package/lib/module/core/resolver/StyleResolver.js +77 -0
  128. package/lib/module/core/resolver/StyleResolver.js.map +1 -0
  129. package/lib/module/core/resolver/index.js +2 -0
  130. package/lib/module/core/resolver/index.js.map +1 -0
  131. package/lib/module/deep.js +11 -0
  132. package/lib/module/deep.js.map +1 -0
  133. package/lib/module/index.js +21 -0
  134. package/lib/module/index.js.map +1 -0
  135. package/lib/module/plugins/ImagePlugin.js +53 -0
  136. package/lib/module/plugins/ImagePlugin.js.map +1 -0
  137. package/lib/module/plugins/TextPlugin.js +63 -0
  138. package/lib/module/plugins/TextPlugin.js.map +1 -0
  139. package/lib/module/plugins/ViewPlugin.js +64 -0
  140. package/lib/module/plugins/ViewPlugin.js.map +1 -0
  141. package/lib/module/plugins/index.js +4 -0
  142. package/lib/module/plugins/index.js.map +1 -0
  143. package/lib/module/types/index.js +2 -0
  144. package/lib/module/types/index.js.map +1 -0
  145. package/lib/module/types/plugin.js +2 -0
  146. package/lib/module/types/plugin.js.map +1 -0
  147. package/lib/module/types/skeleton.js +2 -0
  148. package/lib/module/types/skeleton.js.map +1 -0
  149. package/lib/module/utils/componentUtils.js +123 -0
  150. package/lib/module/utils/componentUtils.js.map +1 -0
  151. package/lib/module/utils/index.js +3 -0
  152. package/lib/module/utils/index.js.map +1 -0
  153. package/lib/module/utils/styleUtils.js +66 -0
  154. package/lib/module/utils/styleUtils.js.map +1 -0
  155. package/lib/typescript/Skelo.d.ts +76 -0
  156. package/lib/typescript/Skelo.d.ts.map +1 -0
  157. package/lib/typescript/animations/AnimationWrapper.d.ts +66 -0
  158. package/lib/typescript/animations/AnimationWrapper.d.ts.map +1 -0
  159. package/lib/typescript/animations/PulseAnimation.d.ts +59 -0
  160. package/lib/typescript/animations/PulseAnimation.d.ts.map +1 -0
  161. package/lib/typescript/animations/ShimmerAnimation.d.ts +59 -0
  162. package/lib/typescript/animations/ShimmerAnimation.d.ts.map +1 -0
  163. package/lib/typescript/animations/index.d.ts +5 -0
  164. package/lib/typescript/animations/index.d.ts.map +1 -0
  165. package/lib/typescript/components/MeasuredBlock.d.ts +32 -0
  166. package/lib/typescript/components/MeasuredBlock.d.ts.map +1 -0
  167. package/lib/typescript/components/Skeleton.d.ts +37 -0
  168. package/lib/typescript/components/Skeleton.d.ts.map +1 -0
  169. package/lib/typescript/components/SkeletonIgnore.d.ts +26 -0
  170. package/lib/typescript/components/SkeletonIgnore.d.ts.map +1 -0
  171. package/lib/typescript/components/SkeletonRenderer.d.ts +39 -0
  172. package/lib/typescript/components/SkeletonRenderer.d.ts.map +1 -0
  173. package/lib/typescript/components/primitives/SkeletonBox.d.ts +21 -0
  174. package/lib/typescript/components/primitives/SkeletonBox.d.ts.map +1 -0
  175. package/lib/typescript/components/primitives/SkeletonCircle.d.ts +21 -0
  176. package/lib/typescript/components/primitives/SkeletonCircle.d.ts.map +1 -0
  177. package/lib/typescript/components/primitives/SkeletonImage.d.ts +21 -0
  178. package/lib/typescript/components/primitives/SkeletonImage.d.ts.map +1 -0
  179. package/lib/typescript/components/primitives/SkeletonText.d.ts +21 -0
  180. package/lib/typescript/components/primitives/SkeletonText.d.ts.map +1 -0
  181. package/lib/typescript/components/primitives/index.d.ts +5 -0
  182. package/lib/typescript/components/primitives/index.d.ts.map +1 -0
  183. package/lib/typescript/components/withSkeleton.d.ts +37 -0
  184. package/lib/typescript/components/withSkeleton.d.ts.map +1 -0
  185. package/lib/typescript/constants/defaults.d.ts +29 -0
  186. package/lib/typescript/constants/defaults.d.ts.map +1 -0
  187. package/lib/typescript/core/deepRegistry.d.ts +7 -0
  188. package/lib/typescript/core/deepRegistry.d.ts.map +1 -0
  189. package/lib/typescript/core/generator/StyleSkeleton.d.ts +36 -0
  190. package/lib/typescript/core/generator/StyleSkeleton.d.ts.map +1 -0
  191. package/lib/typescript/core/parser/Parser.d.ts +30 -0
  192. package/lib/typescript/core/parser/Parser.d.ts.map +1 -0
  193. package/lib/typescript/core/parser/expandOffline.d.ts +10 -0
  194. package/lib/typescript/core/parser/expandOffline.d.ts.map +1 -0
  195. package/lib/typescript/core/parser/hostTreeReconciler.d.ts +28 -0
  196. package/lib/typescript/core/parser/hostTreeReconciler.d.ts.map +1 -0
  197. package/lib/typescript/core/parser/index.d.ts +2 -0
  198. package/lib/typescript/core/parser/index.d.ts.map +1 -0
  199. package/lib/typescript/core/registry/SkeletonRegistry.d.ts +57 -0
  200. package/lib/typescript/core/registry/SkeletonRegistry.d.ts.map +1 -0
  201. package/lib/typescript/core/registry/index.d.ts +2 -0
  202. package/lib/typescript/core/registry/index.d.ts.map +1 -0
  203. package/lib/typescript/core/resolver/StyleResolver.d.ts +54 -0
  204. package/lib/typescript/core/resolver/StyleResolver.d.ts.map +1 -0
  205. package/lib/typescript/core/resolver/index.d.ts +2 -0
  206. package/lib/typescript/core/resolver/index.d.ts.map +1 -0
  207. package/lib/typescript/deep.d.ts +2 -0
  208. package/lib/typescript/deep.d.ts.map +1 -0
  209. package/lib/typescript/index.d.ts +17 -0
  210. package/lib/typescript/index.d.ts.map +1 -0
  211. package/lib/typescript/plugins/ImagePlugin.d.ts +11 -0
  212. package/lib/typescript/plugins/ImagePlugin.d.ts.map +1 -0
  213. package/lib/typescript/plugins/TextPlugin.d.ts +12 -0
  214. package/lib/typescript/plugins/TextPlugin.d.ts.map +1 -0
  215. package/lib/typescript/plugins/ViewPlugin.d.ts +11 -0
  216. package/lib/typescript/plugins/ViewPlugin.d.ts.map +1 -0
  217. package/lib/typescript/plugins/index.d.ts +4 -0
  218. package/lib/typescript/plugins/index.d.ts.map +1 -0
  219. package/lib/typescript/types/index.d.ts +3 -0
  220. package/lib/typescript/types/index.d.ts.map +1 -0
  221. package/lib/typescript/types/plugin.d.ts +144 -0
  222. package/lib/typescript/types/plugin.d.ts.map +1 -0
  223. package/lib/typescript/types/skeleton.d.ts +176 -0
  224. package/lib/typescript/types/skeleton.d.ts.map +1 -0
  225. package/lib/typescript/utils/componentUtils.d.ts +40 -0
  226. package/lib/typescript/utils/componentUtils.d.ts.map +1 -0
  227. package/lib/typescript/utils/index.d.ts +3 -0
  228. package/lib/typescript/utils/index.d.ts.map +1 -0
  229. package/lib/typescript/utils/styleUtils.d.ts +41 -0
  230. package/lib/typescript/utils/styleUtils.d.ts.map +1 -0
  231. package/package.json +171 -11
  232. package/src/Skelo.ts +103 -0
  233. package/src/animations/AnimationWrapper.tsx +139 -0
  234. package/src/animations/PulseAnimation.tsx +138 -0
  235. package/src/animations/ShimmerAnimation.tsx +169 -0
  236. package/src/animations/index.ts +4 -0
  237. package/src/components/MeasuredBlock.tsx +85 -0
  238. package/src/components/Skeleton.tsx +149 -0
  239. package/src/components/SkeletonIgnore.tsx +27 -0
  240. package/src/components/SkeletonRenderer.tsx +341 -0
  241. package/src/components/primitives/SkeletonBox.tsx +53 -0
  242. package/src/components/primitives/SkeletonCircle.tsx +48 -0
  243. package/src/components/primitives/SkeletonImage.tsx +50 -0
  244. package/src/components/primitives/SkeletonText.tsx +69 -0
  245. package/src/components/primitives/index.ts +4 -0
  246. package/src/components/withSkeleton.tsx +62 -0
  247. package/src/constants/defaults.ts +38 -0
  248. package/src/core/deepRegistry.ts +16 -0
  249. package/src/core/generator/StyleSkeleton.tsx +138 -0
  250. package/src/core/parser/Parser.ts +86 -0
  251. package/src/core/parser/expandOffline.tsx +83 -0
  252. package/src/core/parser/hostTreeReconciler.tsx +271 -0
  253. package/src/core/parser/index.ts +1 -0
  254. package/src/core/registry/SkeletonRegistry.ts +111 -0
  255. package/src/core/registry/index.ts +1 -0
  256. package/src/core/resolver/StyleResolver.ts +80 -0
  257. package/src/core/resolver/index.ts +1 -0
  258. package/src/deep.ts +12 -0
  259. package/src/index.ts +30 -0
  260. package/src/plugins/ImagePlugin.tsx +65 -0
  261. package/src/plugins/TextPlugin.tsx +71 -0
  262. package/src/plugins/ViewPlugin.tsx +67 -0
  263. package/src/plugins/index.ts +3 -0
  264. package/src/types/index.ts +14 -0
  265. package/src/types/plugin.ts +164 -0
  266. package/src/types/skeleton.ts +197 -0
  267. package/src/utils/componentUtils.ts +166 -0
  268. package/src/utils/index.ts +9 -0
  269. package/src/utils/styleUtils.ts +72 -0
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderToHostTree = renderToHostTree;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /**
10
+ * A JS-only React renderer built on `react-reconciler`.
11
+ *
12
+ * It renders any element (including opaque function/class components) into a
13
+ * plain host-node tree — no native views, no `act()`, no deprecated APIs. Used
14
+ * to introspect a component's real View/Text/Image structure + styles so Skelo
15
+ * can generate a matching skeleton.
16
+ *
17
+ * Rendered as a synchronous LegacyRoot, so `updateContainer` flushes inline and
18
+ * we can read the tree immediately.
19
+ */
20
+
21
+ const NO_CONTEXT = {};
22
+ const DefaultEventPriority = 32; // DefaultLane
23
+
24
+ function makeHostConfig() {
25
+ // Reconciler 0.31 (React 19) tracks update priority via host methods.
26
+ let currentUpdatePriority = 0; // NoLane
27
+ return {
28
+ supportsMutation: true,
29
+ supportsPersistence: false,
30
+ supportsHydration: false,
31
+ isPrimaryRenderer: false,
32
+ noTimeout: -1,
33
+ now: () => Date.now(),
34
+ scheduleTimeout: setTimeout,
35
+ cancelTimeout: clearTimeout,
36
+ // Must be false: microtask scheduling defers the render, leaving the tree
37
+ // empty when we read it synchronously. Disabling it makes the LegacyRoot
38
+ // render commit inline inside updateContainer.
39
+ supportsMicrotasks: false,
40
+ getRootHostContext: () => NO_CONTEXT,
41
+ getChildHostContext: parent => parent,
42
+ getPublicInstance: instance => instance,
43
+ prepareForCommit: () => null,
44
+ resetAfterCommit: () => {},
45
+ preparePortalMount: () => {},
46
+ createInstance(type, props) {
47
+ return {
48
+ type,
49
+ props,
50
+ children: []
51
+ };
52
+ },
53
+ createTextInstance(text) {
54
+ return {
55
+ type: '#text',
56
+ props: {},
57
+ children: [],
58
+ text
59
+ };
60
+ },
61
+ appendInitialChild(parent, child) {
62
+ parent.children.push(child);
63
+ },
64
+ appendChild(parent, child) {
65
+ parent.children.push(child);
66
+ },
67
+ appendChildToContainer(container, child) {
68
+ container.children.push(child);
69
+ },
70
+ insertBefore(parent, child, before) {
71
+ const i = parent.children.indexOf(before);
72
+ if (i === -1) parent.children.push(child);else parent.children.splice(i, 0, child);
73
+ },
74
+ insertInContainerBefore(container, child, before) {
75
+ const i = container.children.indexOf(before);
76
+ if (i === -1) container.children.push(child);else container.children.splice(i, 0, child);
77
+ },
78
+ removeChild(parent, child) {
79
+ const i = parent.children.indexOf(child);
80
+ if (i !== -1) parent.children.splice(i, 1);
81
+ },
82
+ removeChildFromContainer(container, child) {
83
+ const i = container.children.indexOf(child);
84
+ if (i !== -1) container.children.splice(i, 1);
85
+ },
86
+ finalizeInitialChildren: () => false,
87
+ shouldSetTextContent: () => false,
88
+ prepareUpdate: () => ({}),
89
+ commitUpdate(instance, _payload, _type, _old, newProps) {
90
+ instance.props = newProps;
91
+ },
92
+ commitTextUpdate(textInstance, _old, next) {
93
+ textInstance.text = next;
94
+ },
95
+ clearContainer(container) {
96
+ container.children = [];
97
+ },
98
+ detachDeletedInstance: () => {},
99
+ // Required by React 18/19 reconcilers:
100
+ getCurrentEventPriority: () => DefaultEventPriority,
101
+ // Reconciler 0.31 (React 19) replaced the above with update-priority hooks;
102
+ // requestUpdateLane() calls these, so they must exist or it throws
103
+ // "undefined is not a function".
104
+ setCurrentUpdatePriority: priority => {
105
+ currentUpdatePriority = priority;
106
+ },
107
+ getCurrentUpdatePriority: () => currentUpdatePriority,
108
+ resolveUpdatePriority: () => currentUpdatePriority || DefaultEventPriority,
109
+ beforeActiveInstanceBlur: () => {},
110
+ afterActiveInstanceBlur: () => {},
111
+ prepareScopeUpdate: () => {},
112
+ getInstanceFromScope: () => null,
113
+ getInstanceFromNode: () => null,
114
+ // Newer reconciler (0.31 / React 19) additions — harmless on older versions:
115
+ maySuspendCommit: () => false,
116
+ startSuspendingCommit: () => {},
117
+ suspendInstance: () => {},
118
+ waitForCommitToBeReady: () => null,
119
+ NotPendingTransition: null,
120
+ // React 19 reads this context during render; it must be a real context.
121
+ HostTransitionContext: /*#__PURE__*/_react.default.createContext(null),
122
+ resetFormInstance: () => {},
123
+ requestPostPaintCallback: () => {},
124
+ shouldAttemptEagerTransition: () => false,
125
+ trackSchedulerEvent: () => {},
126
+ resolveEventType: () => null,
127
+ resolveEventTimeStamp: () => -1.1
128
+ };
129
+ }
130
+ class RenderBoundary extends _react.default.Component {
131
+ static getDerivedStateFromError() {
132
+ return {};
133
+ }
134
+ render() {
135
+ return this.props.children;
136
+ }
137
+ }
138
+ let cachedReconciler = null;
139
+ function getReconciler() {
140
+ if (cachedReconciler) return cachedReconciler;
141
+ const Reconciler = require('react-reconciler');
142
+ cachedReconciler = Reconciler.default || Reconciler;
143
+ return cachedReconciler;
144
+ }
145
+
146
+ /**
147
+ * Render an element to a plain host-node tree, or return null if the reconciler
148
+ * is unavailable or rendering failed.
149
+ */
150
+ function renderToHostTree(element) {
151
+ let Reconciler;
152
+ try {
153
+ Reconciler = getReconciler();
154
+ } catch {
155
+ return null;
156
+ }
157
+ if (!Reconciler) {
158
+ return null;
159
+ }
160
+ try {
161
+ // Wrap the host config so any method a newer reconciler calls that we
162
+ // didn't explicitly define resolves to a safe no-op instead of `undefined`
163
+ // (which throws "undefined is not a function"). All value-returning methods
164
+ // are defined above, so only side-effect methods hit this fallback.
165
+ const baseConfig = makeHostConfig();
166
+ const noopFn = () => {};
167
+ const safeConfig = new Proxy(baseConfig, {
168
+ get(target, prop) {
169
+ if (prop in target) return target[prop];
170
+ return noopFn;
171
+ }
172
+ });
173
+ const reconciler = Reconciler(safeConfig);
174
+ const container = {
175
+ children: []
176
+ };
177
+ const noop = () => {};
178
+ // createContainer's signature differs across reconciler versions:
179
+ // React 19 (reconciler 0.31) added onUncaughtError/onCaughtError before
180
+ // onRecoverableError; React 18 (0.29) has a single onRecoverableError.
181
+ const isReact19 = parseInt(_react.default.version, 10) >= 19;
182
+ const root = isReact19 ? reconciler.createContainer(container, 0,
183
+ // LegacyRoot -> synchronous
184
+ null, false, null, '', noop,
185
+ // onUncaughtError
186
+ noop,
187
+ // onCaughtError
188
+ noop,
189
+ // onRecoverableError
190
+ null) : reconciler.createContainer(container, 0, null, false, null, '', noop,
191
+ // onRecoverableError
192
+ null);
193
+ const rc = reconciler;
194
+ const element0 = /*#__PURE__*/_react.default.createElement(RenderBoundary, null, element);
195
+
196
+ // Render synchronously so the tree is populated before we read it.
197
+ // react-reconciler 0.31 (React 19) defers `updateContainer`; it exposes
198
+ // `updateContainerSync` + `flushSyncWork` for a guaranteed inline commit.
199
+ // Older 0.29 flushes inline via `flushSync(updateContainer)`.
200
+ if (typeof rc.updateContainerSync === 'function') {
201
+ rc.updateContainerSync(element0, root, null, noop);
202
+ rc.flushSyncWork?.();
203
+ } else if (typeof rc.flushSync === 'function') {
204
+ rc.flushSync(() => rc.updateContainer(element0, root, null, noop));
205
+ } else {
206
+ rc.updateContainer(element0, root, null, noop);
207
+ }
208
+ const tree = container.children.slice();
209
+
210
+ // Unmount to run cleanup.
211
+ if (typeof rc.updateContainerSync === 'function') {
212
+ rc.updateContainerSync(null, root, null, noop);
213
+ rc.flushSyncWork?.();
214
+ } else {
215
+ rc.updateContainer(null, root, null, noop);
216
+ }
217
+ if (__DEV__ && tree.length === 0) {
218
+ console.warn('[Skelo] Offline render produced an empty tree; falling back to static parsing.');
219
+ }
220
+ return tree;
221
+ } catch (error) {
222
+ if (__DEV__) {
223
+ console.warn('[Skelo] Offline render failed:', error);
224
+ }
225
+ return null;
226
+ }
227
+ }
228
+ //# sourceMappingURL=hostTreeReconciler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","e","__esModule","default","NO_CONTEXT","DefaultEventPriority","makeHostConfig","currentUpdatePriority","supportsMutation","supportsPersistence","supportsHydration","isPrimaryRenderer","noTimeout","now","Date","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","supportsMicrotasks","getRootHostContext","getChildHostContext","parent","getPublicInstance","instance","prepareForCommit","resetAfterCommit","preparePortalMount","createInstance","type","props","children","createTextInstance","text","appendInitialChild","child","push","appendChild","appendChildToContainer","container","insertBefore","before","i","indexOf","splice","insertInContainerBefore","removeChild","removeChildFromContainer","finalizeInitialChildren","shouldSetTextContent","prepareUpdate","commitUpdate","_payload","_type","_old","newProps","commitTextUpdate","textInstance","next","clearContainer","detachDeletedInstance","getCurrentEventPriority","setCurrentUpdatePriority","priority","getCurrentUpdatePriority","resolveUpdatePriority","beforeActiveInstanceBlur","afterActiveInstanceBlur","prepareScopeUpdate","getInstanceFromScope","getInstanceFromNode","maySuspendCommit","startSuspendingCommit","suspendInstance","waitForCommitToBeReady","NotPendingTransition","HostTransitionContext","React","createContext","resetFormInstance","requestPostPaintCallback","shouldAttemptEagerTransition","trackSchedulerEvent","resolveEventType","resolveEventTimeStamp","RenderBoundary","Component","getDerivedStateFromError","render","cachedReconciler","getReconciler","Reconciler","renderToHostTree","element","baseConfig","noopFn","safeConfig","Proxy","get","target","prop","reconciler","noop","isReact19","parseInt","version","root","createContainer","rc","element0","createElement","updateContainerSync","flushSyncWork","flushSync","updateContainer","tree","slice","__DEV__","length","console","warn","error"],"sourceRoot":"../../../../src","sources":["core/parser/hostTreeReconciler.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAMG,UAAU,GAAG,CAAC,CAAC;AAErB,MAAMC,oBAAoB,GAAG,EAAE,CAAC,CAAC;;AAEjC,SAASC,cAAcA,CAAA,EAAG;EACxB;EACA,IAAIC,qBAAqB,GAAG,CAAC,CAAC,CAAC;EAC/B,OAAO;IACLC,gBAAgB,EAAE,IAAI;IACtBC,mBAAmB,EAAE,KAAK;IAC1BC,iBAAiB,EAAE,KAAK;IACxBC,iBAAiB,EAAE,KAAK;IACxBC,SAAS,EAAE,CAAC,CAAC;IACbC,GAAG,EAAEA,CAAA,KAAMC,IAAI,CAACD,GAAG,CAAC,CAAC;IACrBE,eAAe,EAAEC,UAAU;IAC3BC,aAAa,EAAEC,YAAY;IAC3B;IACA;IACA;IACAC,kBAAkB,EAAE,KAAK;IAEzB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,CAAC,MAAM;MACLJ,EAAE,CAACM,eAAe,CAAC,IAAI,EAAER,IAAI,EAAE,IAAI,EAAEJ,IAAI,CAAC;IAC5C;IAEA,IAAIe,OAAO,IAAIF,IAAI,CAACG,MAAM,KAAK,CAAC,EAAE;MAChCC,OAAO,CAACC,IAAI,CACV,gFACF,CAAC;IACH;IAEA,OAAOL,IAAI;EACb,CAAC,CAAC,OAAOM,KAAK,EAAE;IACd,IAAIJ,OAAO,EAAE;MACXE,OAAO,CAACC,IAAI,CAAC,gCAAgC,EAAEC,KAAK,CAAC;IACvD;IACA,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Parser", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Parser.Parser;
10
+ }
11
+ });
12
+ var _Parser = require("./Parser");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Parser","require"],"sourceRoot":"../../../../src","sources":["core/parser/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.registry = exports.SkeletonRegistry = void 0;
7
+ /**
8
+ * Registry for skeleton plugins
9
+ *
10
+ * Manages mapping between React components and their skeleton generation strategies
11
+ */
12
+ class SkeletonRegistry {
13
+ plugins = new Map();
14
+ nameIndex = new Map();
15
+
16
+ /**
17
+ * Register a plugin for a component
18
+ *
19
+ * @param plugin - Plugin configuration
20
+ * @throws Error if plugin is invalid
21
+ */
22
+ register(plugin) {
23
+ // Validation
24
+ if (!plugin.name) {
25
+ throw new Error('[Skelo] Plugin must have a name');
26
+ }
27
+ if (!plugin.component) {
28
+ throw new Error('[Skelo] Plugin must specify a component');
29
+ }
30
+ if (!plugin.strategy) {
31
+ throw new Error('[Skelo] Plugin must have a strategy function');
32
+ }
33
+
34
+ // Check for conflicts
35
+ if (this.plugins.has(plugin.component)) {
36
+ if (__DEV__) {
37
+ console.warn(`[Skelo] Plugin "${plugin.name}" is overriding existing plugin for component`);
38
+ }
39
+ }
40
+
41
+ // Register
42
+ this.plugins.set(plugin.component, plugin);
43
+ this.nameIndex.set(plugin.name, plugin);
44
+ if (__DEV__) {
45
+ console.log(`[Skelo] Registered plugin: ${plugin.name}`);
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Unregister a plugin
51
+ *
52
+ * @param component - Component to unregister
53
+ */
54
+ unregister(component) {
55
+ const plugin = this.plugins.get(component);
56
+ if (plugin) {
57
+ this.plugins.delete(component);
58
+ this.nameIndex.delete(plugin.name);
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Get plugin for a component
64
+ *
65
+ * @param component - Component type
66
+ * @returns Plugin or undefined
67
+ */
68
+ getPlugin(component) {
69
+ return this.plugins.get(component);
70
+ }
71
+
72
+ /**
73
+ * Get plugin by name
74
+ *
75
+ * @param name - Plugin name
76
+ * @returns Plugin or undefined
77
+ */
78
+ getPluginByName(name) {
79
+ return this.nameIndex.get(name);
80
+ }
81
+
82
+ /**
83
+ * Check if component has a plugin
84
+ *
85
+ * @param component - Component type
86
+ * @returns True if plugin exists
87
+ */
88
+ hasPlugin(component) {
89
+ return this.plugins.has(component);
90
+ }
91
+
92
+ /**
93
+ * Get all registered plugins
94
+ *
95
+ * @returns Array of all plugins
96
+ */
97
+ getAllPlugins() {
98
+ return Array.from(this.plugins.values());
99
+ }
100
+
101
+ /**
102
+ * Clear all plugins
103
+ */
104
+ clear() {
105
+ this.plugins.clear();
106
+ this.nameIndex.clear();
107
+ }
108
+ }
109
+
110
+ // Singleton instance
111
+ exports.SkeletonRegistry = SkeletonRegistry;
112
+ const registry = exports.registry = new SkeletonRegistry();
113
+ //# sourceMappingURL=SkeletonRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SkeletonRegistry","plugins","Map","nameIndex","register","plugin","name","Error","component","strategy","has","__DEV__","console","warn","set","log","unregister","get","delete","getPlugin","getPluginByName","hasPlugin","getAllPlugins","Array","from","values","clear","exports","registry"],"sourceRoot":"../../../../src","sources":["core/registry/SkeletonRegistry.ts"],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,CAAC;EACpBC,OAAO,GAA4C,IAAIC,GAAG,CAAC,CAAC;EAC5DC,SAAS,GAAgC,IAAID,GAAG,CAAC,CAAC;;EAE1D;AACF;AACA;AACA;AACA;AACA;EACEE,QAAQA,CAAIC,MAAyB,EAAQ;IAC3C;IACA,IAAI,CAACA,MAAM,CAACC,IAAI,EAAE;MAChB,MAAM,IAAIC,KAAK,CAAC,iCAAiC,CAAC;IACpD;IAEA,IAAI,CAACF,MAAM,CAACG,SAAS,EAAE;MACrB,MAAM,IAAID,KAAK,CAAC,yCAAyC,CAAC;IAC5D;IAEA,IAAI,CAACF,MAAM,CAACI,QAAQ,EAAE;MACpB,MAAM,IAAIF,KAAK,CAAC,8CAA8C,CAAC;IACjE;;IAEA;IACA,IAAI,IAAI,CAACN,OAAO,CAACS,GAAG,CAACL,MAAM,CAACG,SAAS,CAAC,EAAE;MACtC,IAAIG,OAAO,EAAE;QACXC,OAAO,CAACC,IAAI,CAAC,mBAAmBR,MAAM,CAACC,IAAI,+CAA+C,CAAC;MAC7F;IACF;;IAEA;IACA,IAAI,CAACL,OAAO,CAACa,GAAG,CAACT,MAAM,CAACG,SAAS,EAAEH,MAAM,CAAC;IAC1C,IAAI,CAACF,SAAS,CAACW,GAAG,CAACT,MAAM,CAACC,IAAI,EAAED,MAAM,CAAC;IAEvC,IAAIM,OAAO,EAAE;MACXC,OAAO,CAACG,GAAG,CAAC,8BAA8BV,MAAM,CAACC,IAAI,EAAE,CAAC;IAC1D;EACF;;EAEA;AACF;AACA;AACA;AACA;EACEU,UAAUA,CAACR,SAAwB,EAAQ;IACzC,MAAMH,MAAM,GAAG,IAAI,CAACJ,OAAO,CAACgB,GAAG,CAACT,SAAS,CAAC;IAC1C,IAAIH,MAAM,EAAE;MACV,IAAI,CAACJ,OAAO,CAACiB,MAAM,CAACV,SAAS,CAAC;MAC9B,IAAI,CAACL,SAAS,CAACe,MAAM,CAACb,MAAM,CAACC,IAAI,CAAC;IACpC;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEa,SAASA,CAACX,SAAwB,EAA8B;IAC9D,OAAO,IAAI,CAACP,OAAO,CAACgB,GAAG,CAACT,SAAS,CAAC;EACpC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEY,eAAeA,CAACd,IAAY,EAA8B;IACxD,OAAO,IAAI,CAACH,SAAS,CAACc,GAAG,CAACX,IAAI,CAAC;EACjC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEe,SAASA,CAACb,SAAwB,EAAW;IAC3C,OAAO,IAAI,CAACP,OAAO,CAACS,GAAG,CAACF,SAAS,CAAC;EACpC;;EAEA;AACF;AACA;AACA;AACA;EACEc,aAAaA,CAAA,EAAqB;IAChC,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACvB,OAAO,CAACwB,MAAM,CAAC,CAAC,CAAC;EAC1C;;EAEA;AACF;AACA;EACEC,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACzB,OAAO,CAACyB,KAAK,CAAC,CAAC;IACpB,IAAI,CAACvB,SAAS,CAACuB,KAAK,CAAC,CAAC;EACxB;AACF;;AAEA;AAAAC,OAAA,CAAA3B,gBAAA,GAAAA,gBAAA;AACO,MAAM4B,QAAQ,GAAAD,OAAA,CAAAC,QAAA,GAAG,IAAI5B,gBAAgB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SkeletonRegistry", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _SkeletonRegistry.SkeletonRegistry;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "registry", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _SkeletonRegistry.registry;
16
+ }
17
+ });
18
+ var _SkeletonRegistry = require("./SkeletonRegistry");
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_SkeletonRegistry","require"],"sourceRoot":"../../../../src","sources":["core/registry/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyleResolver = void 0;
7
+ var _utils = require("../../utils");
8
+ /**
9
+ * StyleResolver class for extracting and resolving component styles
10
+ */
11
+ class StyleResolver {
12
+ /**
13
+ * Resolve styles from a React element
14
+ *
15
+ * @param element - React element
16
+ * @returns Resolved style object
17
+ */
18
+ static resolve(element) {
19
+ const props = element.props || {};
20
+ const style = props.style;
21
+ return (0, _utils.resolveStyle)(style);
22
+ }
23
+
24
+ /**
25
+ * Get dimensions from element props and style
26
+ *
27
+ * @param element - React element
28
+ * @returns Object with width and height
29
+ */
30
+ static getDimensions(element) {
31
+ const style = this.resolve(element);
32
+ return (0, _utils.extractDimensions)(style);
33
+ }
34
+
35
+ /**
36
+ * Check if element has explicit dimensions
37
+ *
38
+ * @param element - React element
39
+ * @returns True if both width and height are defined
40
+ */
41
+ static hasExplicitDimensions(element) {
42
+ const {
43
+ width,
44
+ height
45
+ } = this.getDimensions(element);
46
+ return width !== undefined && height !== undefined;
47
+ }
48
+
49
+ /**
50
+ * Get border radius from style
51
+ *
52
+ * @param element - React element
53
+ * @returns Border radius value or undefined
54
+ */
55
+ static getBorderRadius(element) {
56
+ const style = this.resolve(element);
57
+ return style.borderRadius;
58
+ }
59
+
60
+ /**
61
+ * Get font size from style
62
+ *
63
+ * @param element - React element
64
+ * @returns Font size value or undefined
65
+ */
66
+ static getFontSize(element) {
67
+ const style = this.resolve(element);
68
+ return style.fontSize;
69
+ }
70
+
71
+ /**
72
+ * Get line height from style
73
+ *
74
+ * @param element - React element
75
+ * @returns Line height value or undefined
76
+ */
77
+ static getLineHeight(element) {
78
+ const style = this.resolve(element);
79
+ return style.lineHeight;
80
+ }
81
+ }
82
+ exports.StyleResolver = StyleResolver;
83
+ //# sourceMappingURL=StyleResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_utils","require","StyleResolver","resolve","element","props","style","resolveStyle","getDimensions","extractDimensions","hasExplicitDimensions","width","height","undefined","getBorderRadius","borderRadius","getFontSize","fontSize","getLineHeight","lineHeight","exports"],"sourceRoot":"../../../../src","sources":["core/resolver/StyleResolver.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACO,MAAMC,aAAa,CAAC;EACzB;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,OAAOA,CAACC,OAAqB,EAAiB;IACnD,MAAMC,KAAK,GAAGD,OAAO,CAACC,KAAK,IAAI,CAAC,CAAC;IACjC,MAAMC,KAAK,GAAGD,KAAK,CAACC,KAAK;IAEzB,OAAO,IAAAC,mBAAY,EAACD,KAAK,CAAC;EAC5B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOE,aAAaA,CAACJ,OAAqB,EAGxC;IACA,MAAME,KAAK,GAAG,IAAI,CAACH,OAAO,CAACC,OAAO,CAAC;IACnC,OAAO,IAAAK,wBAAiB,EAACH,KAAK,CAAC;EACjC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOI,qBAAqBA,CAACN,OAAqB,EAAW;IAC3D,MAAM;MAAEO,KAAK;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACJ,aAAa,CAACJ,OAAO,CAAC;IACrD,OAAOO,KAAK,KAAKE,SAAS,IAAID,MAAM,KAAKC,SAAS;EACpD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,eAAeA,CAACV,OAAqB,EAAsB;IAChE,MAAME,KAAK,GAAG,IAAI,CAACH,OAAO,CAACC,OAAO,CAAC;IACnC,OAAOE,KAAK,CAACS,YAAY;EAC3B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,WAAWA,CAACZ,OAAqB,EAAsB;IAC5D,MAAME,KAAK,GAAG,IAAI,CAACH,OAAO,CAACC,OAAO,CAAC;IACnC,OAAOE,KAAK,CAACW,QAAQ;EACvB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,aAAaA,CAACd,OAAqB,EAAsB;IAC9D,MAAME,KAAK,GAAG,IAAI,CAACH,OAAO,CAACC,OAAO,CAAC;IACnC,OAAOE,KAAK,CAACa,UAAU;EACzB;AACF;AAACC,OAAA,CAAAlB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "StyleResolver", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _StyleResolver.StyleResolver;
10
+ }
11
+ });
12
+ var _StyleResolver = require("./StyleResolver");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_StyleResolver","require"],"sourceRoot":"../../../../src","sources":["core/resolver/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.deepEnabled = void 0;
7
+ var _deepRegistry = require("./core/deepRegistry");
8
+ var _expandOffline = require("./core/parser/expandOffline");
9
+ // Opt-in deep mode. Import once in your app entry to enable `<Skeleton deep>`:
10
+ //
11
+ // import 'react-native-skelo/deep';
12
+ //
13
+ // This is the only module that pulls in react-reconciler, so apps that don't
14
+ // use deep mode never bundle it. Requires `react-reconciler` to be installed.
15
+
16
+ (0, _deepRegistry.setDeepExpander)(_expandOffline.expandToComponentNodes);
17
+ const deepEnabled = exports.deepEnabled = true;
18
+ //# sourceMappingURL=deep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_deepRegistry","require","_expandOffline","setDeepExpander","expandToComponentNodes","deepEnabled","exports"],"sourceRoot":"../../src","sources":["deep.ts"],"mappings":";;;;;;AAMA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAPA;AACA;AACA;AACA;AACA;AACA;;AAIA,IAAAE,6BAAe,EAACC,qCAAsB,CAAC;AAEhC,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAI","ignoreList":[]}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Skeleton", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Skeleton.Skeleton;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "SkeletonBox", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _primitives.SkeletonBox;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "SkeletonCircle", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _primitives.SkeletonCircle;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "SkeletonIgnore", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _SkeletonIgnore.SkeletonIgnore;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "SkeletonImage", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _primitives.SkeletonImage;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "SkeletonText", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _primitives.SkeletonText;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "Skelo", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _Skelo.Skelo;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "StyleSkeleton", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _StyleSkeleton.StyleSkeleton;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "withSkeleton", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _withSkeleton.withSkeleton;
58
+ }
59
+ });
60
+ var _Skeleton = require("./components/Skeleton");
61
+ var _SkeletonIgnore = require("./components/SkeletonIgnore");
62
+ var _withSkeleton = require("./components/withSkeleton");
63
+ var _StyleSkeleton = require("./core/generator/StyleSkeleton");
64
+ var _Skelo = require("./Skelo");
65
+ var _primitives = require("./components/primitives");
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Skeleton","require","_SkeletonIgnore","_withSkeleton","_StyleSkeleton","_Skelo","_primitives"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AAYA,IAAAK,WAAA,GAAAL,OAAA","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ImagePlugin = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /**
11
+ * Built-in plugin for React Native Image component
12
+ *
13
+ * Renders Image as:
14
+ * - SkeletonCircle if circular (avatar-like)
15
+ * - SkeletonImage otherwise
16
+ */
17
+ const ImagePlugin = exports.ImagePlugin = {
18
+ name: 'Image',
19
+ component: _reactNative.Image,
20
+ version: '1.0.0',
21
+ strategy: (props, context) => {
22
+ const {
23
+ primitives,
24
+ config
25
+ } = context;
26
+ const style = props.style || {};
27
+ const flatStyle = Array.isArray(style) ? Object.assign({}, ...style) : style;
28
+ const width = flatStyle.width ?? 100;
29
+ const height = flatStyle.height ?? 100;
30
+ const borderRadius = flatStyle.borderRadius ?? 0;
31
+
32
+ // Check if it's a circular image (avatar)
33
+ const isCircle = typeof width === 'number' && typeof height === 'number' && width === height && borderRadius === width / 2;
34
+ if (isCircle) {
35
+ return /*#__PURE__*/_react.default.createElement(primitives.Circle, {
36
+ size: width,
37
+ animation: config.animation,
38
+ baseColor: config.baseColor,
39
+ highlightColor: config.highlightColor,
40
+ duration: config.duration,
41
+ style: flatStyle
42
+ });
43
+ }
44
+ return /*#__PURE__*/_react.default.createElement(primitives.Image, {
45
+ width: width,
46
+ height: height,
47
+ borderRadius: borderRadius,
48
+ animation: config.animation,
49
+ baseColor: config.baseColor,
50
+ highlightColor: config.highlightColor,
51
+ duration: config.duration,
52
+ style: flatStyle
53
+ });
54
+ },
55
+ metadata: {
56
+ description: 'Automatic skeleton generation for Image components',
57
+ author: 'Skelo'
58
+ }
59
+ };
60
+ //# sourceMappingURL=ImagePlugin.js.map