@tachui/core 0.7.1-alpha → 0.8.0-alpha

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 (265) hide show
  1. package/README.md +2 -2
  2. package/dist/bundles/common.d.ts +1 -1
  3. package/dist/bundles/common.d.ts.map +1 -1
  4. package/dist/bundles/minimal.d.ts +2 -16
  5. package/dist/bundles/minimal.d.ts.map +1 -1
  6. package/dist/bundles/production-minimal.d.ts +2 -16
  7. package/dist/bundles/production-minimal.d.ts.map +1 -1
  8. package/dist/common.js +403 -827
  9. package/dist/compiler/advanced-parser.d.ts.map +1 -1
  10. package/dist/compiler/index.js +14 -8
  11. package/dist/component-XAzF1xqs.js +487 -0
  12. package/dist/component-base-x2XmHFjy.js +255 -0
  13. package/dist/components/index.d.ts +4 -38
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/components/index.js +7 -4167
  16. package/dist/components/wrapper.d.ts +5 -152
  17. package/dist/components/wrapper.d.ts.map +1 -1
  18. package/dist/concatenated-component-ByPl3_FF.js +2933 -0
  19. package/dist/constants/index.d.ts +1 -1
  20. package/dist/constants/layout.d.ts +47 -4
  21. package/dist/constants/layout.d.ts.map +1 -1
  22. package/dist/constants/layout.js +84 -0
  23. package/dist/css-classes/index.js +176 -0
  24. package/dist/{dom-bridge-Cx-s6Ihx.js → dom-bridge-CAa1N2zX.js} +28 -28
  25. package/dist/{effect-CytAc9em.js → effect-B9Knft0b.js} +3 -3
  26. package/dist/essential.js +395 -825
  27. package/dist/index-DCPJFUm9.js +1407 -0
  28. package/dist/index-DIvMCJQO.js +268 -0
  29. package/dist/index-vdsiw6gQ.js +777 -0
  30. package/dist/index.d.ts +9 -9
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +395 -825
  33. package/dist/minimal-prod.js +101 -155
  34. package/dist/minimal.js +104 -170
  35. package/dist/modifiers/background.d.ts +41 -11
  36. package/dist/modifiers/background.d.ts.map +1 -1
  37. package/dist/modifiers/base.d.ts +6 -33
  38. package/dist/modifiers/base.d.ts.map +1 -1
  39. package/dist/modifiers/base.js +487 -0
  40. package/dist/modifiers/builder.d.ts +103 -195
  41. package/dist/modifiers/builder.d.ts.map +1 -1
  42. package/dist/modifiers/builder.js +9 -0
  43. package/dist/modifiers/core.d.ts +9 -401
  44. package/dist/modifiers/core.d.ts.map +1 -1
  45. package/dist/modifiers/{utils.d.ts → factories.d.ts} +18 -5
  46. package/dist/modifiers/factories.d.ts.map +1 -0
  47. package/dist/modifiers/index.d.ts +8 -52
  48. package/dist/modifiers/index.d.ts.map +1 -1
  49. package/dist/modifiers/index.js +38 -0
  50. package/dist/modifiers/presets.d.ts +368 -0
  51. package/dist/modifiers/presets.d.ts.map +1 -0
  52. package/dist/modifiers/registry.js +10 -0
  53. package/dist/modifiers/types.d.ts +39 -211
  54. package/dist/modifiers/types.d.ts.map +1 -1
  55. package/dist/modifiers/types.js +4 -0
  56. package/dist/performance-optimizer-stub-CtfXUwl4.js +38 -0
  57. package/dist/plugins/index.d.ts +5 -6
  58. package/dist/plugins/index.d.ts.map +1 -1
  59. package/dist/plugins/index.js +147 -297
  60. package/dist/plugins/simplified-index.d.ts +5 -6
  61. package/dist/plugins/simplified-index.d.ts.map +1 -1
  62. package/dist/production-minimal-BY_gMc-l.js +2532 -0
  63. package/dist/reactive/index.js +96 -95
  64. package/dist/reactive/types.js +4 -0
  65. package/dist/runtime/dom-bridge.js +5 -5
  66. package/dist/runtime/element-override.d.ts.map +1 -1
  67. package/dist/runtime/index.d.ts +0 -7
  68. package/dist/runtime/index.d.ts.map +1 -1
  69. package/dist/runtime/renderer.d.ts.map +1 -1
  70. package/dist/runtime/renderer.js +7 -8
  71. package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
  72. package/dist/runtime/types.js +1 -0
  73. package/dist/{scheduler-7SvC3a21.js → scheduler-BKeqwrYE.js} +130 -130
  74. package/dist/validation/build-time-stub.d.ts +33 -0
  75. package/dist/validation/build-time-stub.d.ts.map +1 -0
  76. package/dist/validation/debug-tools-stub.d.ts +67 -0
  77. package/dist/validation/debug-tools-stub.d.ts.map +1 -0
  78. package/dist/validation/index.d.ts +23 -78
  79. package/dist/validation/index.d.ts.map +1 -1
  80. package/dist/validation/index.js +609 -6470
  81. package/dist/validation/lifecycle-validation.d.ts.map +1 -1
  82. package/dist/validation/performance-optimizer-stub.d.ts +50 -0
  83. package/dist/validation/performance-optimizer-stub.d.ts.map +1 -0
  84. package/dist/validation/plugin-registration.d.ts +5 -1
  85. package/dist/validation/plugin-registration.d.ts.map +1 -1
  86. package/dist/validation/production-bypass-core.d.ts +69 -0
  87. package/dist/validation/production-bypass-core.d.ts.map +1 -0
  88. package/package.json +41 -5
  89. package/dist/ScrollView-h-6wYMAm.js +0 -515
  90. package/dist/Spacer-BbteDQ9I.js +0 -5337
  91. package/dist/binding-CmdpowkI.js +0 -2276
  92. package/dist/components/BasicInput.d.ts +0 -116
  93. package/dist/components/BasicInput.d.ts.map +0 -1
  94. package/dist/components/Button.d.ts +0 -252
  95. package/dist/components/Button.d.ts.map +0 -1
  96. package/dist/components/Divider.d.ts +0 -141
  97. package/dist/components/Divider.d.ts.map +0 -1
  98. package/dist/components/EnhancedLink.d.ts +0 -365
  99. package/dist/components/EnhancedLink.d.ts.map +0 -1
  100. package/dist/components/Form.d.ts +0 -141
  101. package/dist/components/Form.d.ts.map +0 -1
  102. package/dist/components/Grid.d.ts +0 -698
  103. package/dist/components/Grid.d.ts.map +0 -1
  104. package/dist/components/GridResponsive.d.ts +0 -214
  105. package/dist/components/GridResponsive.d.ts.map +0 -1
  106. package/dist/components/Image.d.ts +0 -162
  107. package/dist/components/Image.d.ts.map +0 -1
  108. package/dist/components/List.d.ts +0 -287
  109. package/dist/components/List.d.ts.map +0 -1
  110. package/dist/components/Menu.d.ts +0 -159
  111. package/dist/components/Menu.d.ts.map +0 -1
  112. package/dist/components/Picker.d.ts +0 -153
  113. package/dist/components/Picker.d.ts.map +0 -1
  114. package/dist/components/ScrollView.d.ts +0 -222
  115. package/dist/components/ScrollView.d.ts.map +0 -1
  116. package/dist/components/Section.d.ts +0 -153
  117. package/dist/components/Section.d.ts.map +0 -1
  118. package/dist/components/Show.d.ts +0 -64
  119. package/dist/components/Show.d.ts.map +0 -1
  120. package/dist/components/Spacer.d.ts +0 -35
  121. package/dist/components/Spacer.d.ts.map +0 -1
  122. package/dist/components/Text.d.ts +0 -242
  123. package/dist/components/Text.d.ts.map +0 -1
  124. package/dist/components/Toggle.d.ts +0 -207
  125. package/dist/components/Toggle.d.ts.map +0 -1
  126. package/dist/concatenated-component-DPcl2TEO.js +0 -6779
  127. package/dist/context--zQFIImS.js +0 -283
  128. package/dist/debug/index.d.ts +0 -61
  129. package/dist/debug/index.d.ts.map +0 -1
  130. package/dist/debug.js +0 -178
  131. package/dist/developer-experience/enhanced-errors.d.ts +0 -128
  132. package/dist/developer-experience/enhanced-errors.d.ts.map +0 -1
  133. package/dist/developer-experience/enhanced-types.d.ts +0 -281
  134. package/dist/developer-experience/enhanced-types.d.ts.map +0 -1
  135. package/dist/developer-experience/index.d.ts +0 -44
  136. package/dist/developer-experience/index.d.ts.map +0 -1
  137. package/dist/index-Nfi2SBQh.js +0 -3268
  138. package/dist/modifiers/attributes.d.ts +0 -203
  139. package/dist/modifiers/attributes.d.ts.map +0 -1
  140. package/dist/modifiers/backdrop.d.ts +0 -59
  141. package/dist/modifiers/backdrop.d.ts.map +0 -1
  142. package/dist/modifiers/border.d.ts +0 -217
  143. package/dist/modifiers/border.d.ts.map +0 -1
  144. package/dist/modifiers/effects.d.ts +0 -159
  145. package/dist/modifiers/effects.d.ts.map +0 -1
  146. package/dist/modifiers/elements.d.ts +0 -240
  147. package/dist/modifiers/elements.d.ts.map +0 -1
  148. package/dist/modifiers/filters.d.ts +0 -275
  149. package/dist/modifiers/filters.d.ts.map +0 -1
  150. package/dist/modifiers/flexbox.d.ts +0 -82
  151. package/dist/modifiers/flexbox.d.ts.map +0 -1
  152. package/dist/modifiers/font.d.ts +0 -71
  153. package/dist/modifiers/font.d.ts.map +0 -1
  154. package/dist/modifiers/grid.d.ts +0 -92
  155. package/dist/modifiers/grid.d.ts.map +0 -1
  156. package/dist/modifiers/margin.d.ts +0 -128
  157. package/dist/modifiers/margin.d.ts.map +0 -1
  158. package/dist/modifiers/padding.d.ts +0 -204
  159. package/dist/modifiers/padding.d.ts.map +0 -1
  160. package/dist/modifiers/responsive/advanced-utilities.d.ts +0 -118
  161. package/dist/modifiers/responsive/advanced-utilities.d.ts.map +0 -1
  162. package/dist/modifiers/responsive/breakpoints.d.ts +0 -81
  163. package/dist/modifiers/responsive/breakpoints.d.ts.map +0 -1
  164. package/dist/modifiers/responsive/css-generator.d.ts +0 -100
  165. package/dist/modifiers/responsive/css-generator.d.ts.map +0 -1
  166. package/dist/modifiers/responsive/dev-tools.d.ts +0 -107
  167. package/dist/modifiers/responsive/dev-tools.d.ts.map +0 -1
  168. package/dist/modifiers/responsive/index.d.ts +0 -29
  169. package/dist/modifiers/responsive/index.d.ts.map +0 -1
  170. package/dist/modifiers/responsive/layout-patterns.d.ts +0 -230
  171. package/dist/modifiers/responsive/layout-patterns.d.ts.map +0 -1
  172. package/dist/modifiers/responsive/performance.d.ts +0 -130
  173. package/dist/modifiers/responsive/performance.d.ts.map +0 -1
  174. package/dist/modifiers/responsive/responsive-builder.d.ts +0 -133
  175. package/dist/modifiers/responsive/responsive-builder.d.ts.map +0 -1
  176. package/dist/modifiers/responsive/responsive-modifier.d.ts +0 -123
  177. package/dist/modifiers/responsive/responsive-modifier.d.ts.map +0 -1
  178. package/dist/modifiers/responsive/types.d.ts +0 -183
  179. package/dist/modifiers/responsive/types.d.ts.map +0 -1
  180. package/dist/modifiers/responsive/utilities.d.ts +0 -149
  181. package/dist/modifiers/responsive/utilities.d.ts.map +0 -1
  182. package/dist/modifiers/scroll.d.ts +0 -143
  183. package/dist/modifiers/scroll.d.ts.map +0 -1
  184. package/dist/modifiers/shadows.d.ts +0 -114
  185. package/dist/modifiers/shadows.d.ts.map +0 -1
  186. package/dist/modifiers/size.d.ts +0 -113
  187. package/dist/modifiers/size.d.ts.map +0 -1
  188. package/dist/modifiers/text.d.ts +0 -147
  189. package/dist/modifiers/text.d.ts.map +0 -1
  190. package/dist/modifiers/transformations.d.ts +0 -329
  191. package/dist/modifiers/transformations.d.ts.map +0 -1
  192. package/dist/modifiers/transitions.d.ts +0 -98
  193. package/dist/modifiers/transitions.d.ts.map +0 -1
  194. package/dist/modifiers/typography.d.ts +0 -192
  195. package/dist/modifiers/typography.d.ts.map +0 -1
  196. package/dist/modifiers/utility.d.ts +0 -69
  197. package/dist/modifiers/utility.d.ts.map +0 -1
  198. package/dist/modifiers/utils.d.ts.map +0 -1
  199. package/dist/plugins/simplified-error-handler.d.ts +0 -83
  200. package/dist/plugins/simplified-error-handler.d.ts.map +0 -1
  201. package/dist/runtime/dev-tools.d.ts +0 -240
  202. package/dist/runtime/dev-tools.d.ts.map +0 -1
  203. package/dist/runtime/development-warnings.d.ts +0 -42
  204. package/dist/runtime/development-warnings.d.ts.map +0 -1
  205. package/dist/runtime/error-boundary.d.ts +0 -302
  206. package/dist/runtime/error-boundary.d.ts.map +0 -1
  207. package/dist/runtime/error-recovery.d.ts +0 -267
  208. package/dist/runtime/error-recovery.d.ts.map +0 -1
  209. package/dist/runtime/error-reporting.d.ts +0 -287
  210. package/dist/runtime/error-reporting.d.ts.map +0 -1
  211. package/dist/runtime/error-utils.d.ts +0 -204
  212. package/dist/runtime/error-utils.d.ts.map +0 -1
  213. package/dist/runtime/performance.d.ts +0 -217
  214. package/dist/runtime/performance.d.ts.map +0 -1
  215. package/dist/sui-compat.d.ts +0 -110
  216. package/dist/sui-compat.d.ts.map +0 -1
  217. package/dist/validation/advanced-debugging.d.ts +0 -319
  218. package/dist/validation/advanced-debugging.d.ts.map +0 -1
  219. package/dist/validation/build-time/detection.d.ts +0 -32
  220. package/dist/validation/build-time/detection.d.ts.map +0 -1
  221. package/dist/validation/build-time/index.d.ts +0 -84
  222. package/dist/validation/build-time/index.d.ts.map +0 -1
  223. package/dist/validation/build-time/plugins.d.ts +0 -75
  224. package/dist/validation/build-time/plugins.d.ts.map +0 -1
  225. package/dist/validation/build-time/rules.d.ts +0 -73
  226. package/dist/validation/build-time/rules.d.ts.map +0 -1
  227. package/dist/validation/build-time/transformer.d.ts +0 -23
  228. package/dist/validation/build-time/transformer.d.ts.map +0 -1
  229. package/dist/validation/build-time/types.d.ts +0 -212
  230. package/dist/validation/build-time/types.d.ts.map +0 -1
  231. package/dist/validation/comprehensive.d.ts +0 -160
  232. package/dist/validation/comprehensive.d.ts.map +0 -1
  233. package/dist/validation/debug-tools.d.ts +0 -251
  234. package/dist/validation/debug-tools.d.ts.map +0 -1
  235. package/dist/validation/developer-experience.d.ts +0 -243
  236. package/dist/validation/developer-experience.d.ts.map +0 -1
  237. package/dist/validation/documentation-integration.d.ts +0 -269
  238. package/dist/validation/documentation-integration.d.ts.map +0 -1
  239. package/dist/validation/enhanced-runtime.d.ts +0 -279
  240. package/dist/validation/enhanced-runtime.d.ts.map +0 -1
  241. package/dist/validation/error-reporting.d.ts +0 -186
  242. package/dist/validation/error-reporting.d.ts.map +0 -1
  243. package/dist/validation/ide-integration.d.ts +0 -328
  244. package/dist/validation/ide-integration.d.ts.map +0 -1
  245. package/dist/validation/performance-optimizer.d.ts +0 -218
  246. package/dist/validation/performance-optimizer.d.ts.map +0 -1
  247. package/dist/validation/production-bypass.d.ts +0 -175
  248. package/dist/validation/production-bypass.d.ts.map +0 -1
  249. package/dist/validation/simple.d.ts +0 -111
  250. package/dist/validation/simple.d.ts.map +0 -1
  251. package/dist/viewport/adapters/web-adapter.d.ts +0 -227
  252. package/dist/viewport/adapters/web-adapter.d.ts.map +0 -1
  253. package/dist/viewport/components.d.ts +0 -131
  254. package/dist/viewport/components.d.ts.map +0 -1
  255. package/dist/viewport/environment.d.ts +0 -75
  256. package/dist/viewport/environment.d.ts.map +0 -1
  257. package/dist/viewport/index.d.ts +0 -138
  258. package/dist/viewport/index.d.ts.map +0 -1
  259. package/dist/viewport/index.js +0 -2085
  260. package/dist/viewport/platform-detection.d.ts +0 -59
  261. package/dist/viewport/platform-detection.d.ts.map +0 -1
  262. package/dist/viewport/types.d.ts +0 -301
  263. package/dist/viewport/types.d.ts.map +0 -1
  264. package/dist/viewport/viewport-manager.d.ts +0 -118
  265. package/dist/viewport/viewport-manager.d.ts.map +0 -1
@@ -1,515 +0,0 @@
1
- import { i as m, a as v } from "./scheduler-7SvC3a21.js";
2
- import { c as E } from "./effect-CytAc9em.js";
3
- import { aa as w } from "./Spacer-BbteDQ9I.js";
4
- import "./context--zQFIImS.js";
5
- import "./dom-bridge-Cx-s6Ihx.js";
6
- import { dR as T } from "./concatenated-component-DPcl2TEO.js";
7
- var C = Object.defineProperty, R = (s, t, e) => t in s ? C(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, y = (s, t, e) => R(s, typeof t != "symbol" ? t + "" : t, e);
8
- const a = {
9
- colors: {
10
- default: "#E5E5E5",
11
- light: "#F0F0F0",
12
- medium: "#D1D1D1",
13
- heavy: "#A0A0A0"
14
- },
15
- thickness: {
16
- thin: 1,
17
- medium: 2,
18
- thick: 3
19
- },
20
- spacing: {
21
- small: 8,
22
- medium: 16,
23
- large: 24
24
- }
25
- };
26
- class O {
27
- constructor(t) {
28
- y(this, "type", "component"), y(this, "id"), y(this, "props"), y(this, "theme", a), this.props = t, this.id = `divider-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
29
- }
30
- resolveValue(t) {
31
- return m(t) ? t() : t;
32
- }
33
- getBaseStyles() {
34
- const t = this.props.orientation === "vertical", e = this.resolveValue(this.props.thickness ?? this.theme.thickness.thin), o = this.resolveValue(this.props.color ?? this.theme.colors.default), l = this.props.style ?? "solid", c = this.resolveValue(this.props.opacity ?? 1), h = this.resolveValue(this.props.margin ?? this.theme.spacing.medium), p = this.resolveValue(this.props.length), n = {
35
- border: "none",
36
- margin: "0",
37
- padding: "0",
38
- backgroundColor: o,
39
- opacity: String(c),
40
- flexShrink: "0"
41
- };
42
- return t ? (n.width = `${e}px`, n.height = p ? typeof p == "string" ? p : `${p}px` : "100%", n.marginLeft = `${h}px`, n.marginRight = `${h}px`, n.alignSelf = "stretch") : (n.height = `${e}px`, n.width = p ? typeof p == "string" ? p : `${p}px` : "100%", n.marginTop = `${h}px`, n.marginBottom = `${h}px`), (l === "dashed" || l === "dotted") && (n.backgroundColor = "transparent", t ? n.borderRight = `${e}px ${l} ${o}` : n.borderTop = `${e}px ${l} ${o}`), n;
43
- }
44
- render() {
45
- const t = T("div", {
46
- role: "separator",
47
- "aria-orientation": this.props.orientation ?? "horizontal",
48
- style: this.getBaseStyles()
49
- });
50
- return ["color", "thickness", "length", "margin", "opacity"].forEach((o) => {
51
- const l = this.props[o];
52
- m(l) && E(() => {
53
- const c = this.getBaseStyles(), h = t.element;
54
- h && Object.assign(h.style, c);
55
- });
56
- }), t.getAttribute = (o) => {
57
- const l = t.props?.[o];
58
- return l == null ? null : String(l);
59
- }, t.setAttribute = (o, l) => {
60
- t.props || (t.props = {}), t.props[o] = l;
61
- }, t;
62
- }
63
- }
64
- function u(s = {}) {
65
- return w(new O(s));
66
- }
67
- const B = {
68
- /**
69
- * Create a thin horizontal divider
70
- */
71
- thin(s) {
72
- return u({
73
- thickness: a.thickness.thin,
74
- color: s
75
- });
76
- },
77
- /**
78
- * Create a medium horizontal divider
79
- */
80
- medium(s) {
81
- return u({
82
- thickness: a.thickness.medium,
83
- color: s
84
- });
85
- },
86
- /**
87
- * Create a thick horizontal divider
88
- */
89
- thick(s) {
90
- return u({
91
- thickness: a.thickness.thick,
92
- color: s
93
- });
94
- },
95
- /**
96
- * Create a vertical divider
97
- */
98
- vertical(s, t) {
99
- return u({
100
- orientation: "vertical",
101
- length: s,
102
- thickness: t
103
- });
104
- },
105
- /**
106
- * Create a dashed divider
107
- */
108
- dashed(s, t) {
109
- return u({
110
- style: "dashed",
111
- color: s,
112
- thickness: t
113
- });
114
- },
115
- /**
116
- * Create a dotted divider
117
- */
118
- dotted(s, t) {
119
- return u({
120
- style: "dotted",
121
- color: s,
122
- thickness: t
123
- });
124
- },
125
- /**
126
- * Create a subtle divider with light color
127
- */
128
- subtle() {
129
- return u({
130
- color: a.colors.light,
131
- opacity: 0.6
132
- });
133
- },
134
- /**
135
- * Create a prominent divider with heavier color
136
- */
137
- prominent() {
138
- return u({
139
- color: a.colors.heavy,
140
- thickness: a.thickness.medium
141
- });
142
- }
143
- }, D = {
144
- theme: a,
145
- /**
146
- * Create a custom divider theme
147
- */
148
- createTheme(s) {
149
- return {
150
- colors: { ...a.colors, ...s.colors },
151
- thickness: { ...a.thickness, ...s.thickness },
152
- spacing: { ...a.spacing, ...s.spacing }
153
- };
154
- },
155
- /**
156
- * Preset color schemes
157
- */
158
- colors: {
159
- light: a.colors.light,
160
- medium: a.colors.medium,
161
- heavy: a.colors.heavy,
162
- primary: "#007AFF",
163
- success: "#34C759",
164
- warning: "#FF9500",
165
- danger: "#FF3B30"
166
- }
167
- };
168
- var $ = Object.defineProperty, P = (s, t, e) => t in s ? $(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, i = (s, t, e) => P(s, typeof t != "symbol" ? t + "" : t, e);
169
- class z {
170
- constructor(t) {
171
- this.props = t, i(this, "type", "component"), i(this, "id"), i(this, "mounted", !1), i(this, "cleanup", []), i(this, "scrollElement", null), i(this, "contentOffsetSignal"), i(this, "setContentOffset"), i(this, "contentSizeSignal"), i(this, "setContentSize"), i(this, "setIsScrolling"), i(this, "pullToRefreshStateSignal"), i(this, "setPullToRefreshState"), i(this, "scrollEventThrottle"), i(this, "lastScrollTime", 0), i(this, "scrollVelocity", { x: 0, y: 0 }), i(this, "lastScrollOffset", { x: 0, y: 0 }), i(this, "pullStartY", 0), i(this, "isPulling", !1), i(this, "handleScroll", (r) => {
172
- if (!this.scrollElement) return;
173
- const f = performance.now(), d = f - this.lastScrollTime;
174
- if (d < this.scrollEventThrottle) return;
175
- const S = {
176
- x: this.scrollElement.scrollLeft,
177
- y: this.scrollElement.scrollTop
178
- };
179
- this.scrollVelocity = this.calculateVelocity(S, d), this.setContentOffset(S), this.setContentSize({
180
- width: this.scrollElement.scrollWidth,
181
- height: this.scrollElement.scrollHeight
182
- });
183
- const g = this.detectScrollEdges(), x = {
184
- offset: S,
185
- velocity: this.scrollVelocity,
186
- contentSize: {
187
- width: this.scrollElement.scrollWidth,
188
- height: this.scrollElement.scrollHeight
189
- },
190
- containerSize: {
191
- width: this.scrollElement.clientWidth,
192
- height: this.scrollElement.clientHeight
193
- },
194
- edges: g
195
- };
196
- this.props.onScroll && this.props.onScroll(x), g.top && this.props.onReachTop && this.props.onReachTop(), g.bottom && this.props.onReachBottom && this.props.onReachBottom(), g.left && this.props.onReachLeft && this.props.onReachLeft(), g.right && this.props.onReachRight && this.props.onReachRight(), this.lastScrollOffset = S, this.lastScrollTime = f;
197
- }), i(this, "handleScrollStart", () => {
198
- this.setIsScrolling(!0), this.props.onScrollBegin && this.props.onScrollBegin();
199
- }), i(this, "handleScrollEnd", () => {
200
- this.setIsScrolling(!1), this.props.onScrollEnd && this.props.onScrollEnd();
201
- }), i(this, "handleTouchStart", (r) => {
202
- this.props.refreshControl?.enabled && (this.pullStartY = r.touches[0].clientY, this.isPulling = !1);
203
- }), i(this, "handleTouchMove", (r) => {
204
- if (!this.props.refreshControl?.enabled || !this.scrollElement) return;
205
- const d = r.touches[0].clientY - this.pullStartY, S = this.props.refreshControl.threshold || 80;
206
- this.scrollElement.scrollTop <= 0 && d > 0 && (this.isPulling = !0, d > S ? this.setPullToRefreshState("ready") : this.setPullToRefreshState("pulling"));
207
- }), i(this, "handleTouchEnd", async () => {
208
- if (!this.props.refreshControl?.enabled || !this.isPulling) return;
209
- if (this.pullToRefreshStateSignal() === "ready") {
210
- this.setPullToRefreshState("refreshing");
211
- try {
212
- await this.props.refreshControl.onRefresh();
213
- } catch (f) {
214
- console.error("Pull to refresh error:", f);
215
- } finally {
216
- this.setPullToRefreshState("idle");
217
- }
218
- } else
219
- this.setPullToRefreshState("idle");
220
- this.isPulling = !1;
221
- }), this.id = `scrollview-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.scrollEventThrottle = t.scrollEventThrottle || 16;
222
- const [e, o] = v({ x: 0, y: 0 });
223
- this.contentOffsetSignal = e, this.setContentOffset = o;
224
- const [l, c] = v({ width: 0, height: 0 });
225
- this.contentSizeSignal = l, this.setContentSize = c;
226
- const [, h] = v(!1);
227
- this.setIsScrolling = h;
228
- const [p, n] = v("idle");
229
- if (this.pullToRefreshStateSignal = p, this.setPullToRefreshState = n, t.contentOffset && m(t.contentOffset)) {
230
- this.setContentOffset(t.contentOffset());
231
- const r = E(() => {
232
- t.contentOffset && m(t.contentOffset) && this.setContentOffset(t.contentOffset());
233
- });
234
- this.cleanup.push(() => r.dispose());
235
- }
236
- if (t.contentSize && m(t.contentSize)) {
237
- this.setContentSize(t.contentSize());
238
- const r = E(() => {
239
- t.contentSize && m(t.contentSize) && this.setContentSize(t.contentSize());
240
- });
241
- this.cleanup.push(() => r.dispose());
242
- }
243
- }
244
- /**
245
- * Calculate scroll velocity
246
- */
247
- calculateVelocity(t, e) {
248
- const o = t.x - this.lastScrollOffset.x, l = t.y - this.lastScrollOffset.y;
249
- return {
250
- x: e > 0 ? o / e : 0,
251
- y: e > 0 ? l / e : 0
252
- };
253
- }
254
- /**
255
- * Detect scroll edges
256
- */
257
- detectScrollEdges() {
258
- if (!this.scrollElement)
259
- return { top: !1, bottom: !1, left: !1, right: !1 };
260
- const { scrollTop: t, scrollLeft: e, scrollHeight: o, scrollWidth: l, clientHeight: c, clientWidth: h } = this.scrollElement;
261
- return {
262
- top: t <= 0,
263
- bottom: t + c >= o - 1,
264
- left: e <= 0,
265
- right: e + h >= l - 1
266
- };
267
- }
268
- /**
269
- * Set up scroll event handlers
270
- */
271
- setupScrollHandlers(t) {
272
- let e;
273
- const o = () => {
274
- clearTimeout(e), this.handleScrollStart();
275
- }, l = () => {
276
- clearTimeout(e), e = setTimeout(() => {
277
- this.handleScrollEnd();
278
- }, 150);
279
- }, c = (h) => {
280
- o(), this.handleScroll(h), l();
281
- };
282
- t.addEventListener("scroll", c, { passive: !0 }), t.addEventListener("touchstart", this.handleTouchStart, { passive: !0 }), t.addEventListener("touchmove", this.handleTouchMove, { passive: !1 }), t.addEventListener("touchend", this.handleTouchEnd, { passive: !0 }), this.cleanup.push(() => {
283
- t.removeEventListener("scroll", c), t.removeEventListener("touchstart", this.handleTouchStart), t.removeEventListener("touchmove", this.handleTouchMove), t.removeEventListener("touchend", this.handleTouchEnd), clearTimeout(e);
284
- });
285
- }
286
- /**
287
- * Get overflow styles based on direction
288
- */
289
- getOverflowStyles(t) {
290
- switch (t) {
291
- case "vertical":
292
- return {
293
- overflowX: "hidden",
294
- overflowY: "auto"
295
- };
296
- case "horizontal":
297
- return {
298
- overflowX: "auto",
299
- overflowY: "hidden"
300
- };
301
- case "both":
302
- return {
303
- overflow: "auto"
304
- };
305
- default:
306
- return {
307
- overflowX: "hidden",
308
- overflowY: "auto"
309
- };
310
- }
311
- }
312
- /**
313
- * Apply additional scroll view styling (position and overflow already set in initial render)
314
- */
315
- applyScrollViewStyles(t) {
316
- const { showsScrollIndicator: e = !0, bounces: o = !0 } = this.props;
317
- if (!e) {
318
- t.style.scrollbarWidth = "none", t.style.msOverflowStyle = "none";
319
- const l = document.createElement("style");
320
- l.textContent = `
321
- #${t.id}::-webkit-scrollbar {
322
- display: none;
323
- }
324
- `, document.head.appendChild(l), this.cleanup.push(() => {
325
- document.head.removeChild(l);
326
- });
327
- }
328
- o ? t.style.webkitOverflowScrolling = "touch" : t.style.overscrollBehavior = "none", t.style.scrollBehavior = "smooth";
329
- }
330
- /**
331
- * Apply content insets
332
- */
333
- applyContentInsets(t) {
334
- const { contentInset: e } = this.props;
335
- if (e) {
336
- const { top: o = 0, bottom: l = 0, left: c = 0, right: h = 0 } = e;
337
- t.style.padding = `${o}px ${h}px ${l}px ${c}px`;
338
- }
339
- }
340
- /**
341
- * Create pull to refresh indicator
342
- */
343
- createPullToRefreshIndicator() {
344
- if (!this.props.refreshControl?.enabled) return null;
345
- const t = this.pullToRefreshStateSignal(), e = this.props.refreshControl.tintColor || "#007AFF";
346
- let o = "";
347
- switch (t) {
348
- case "pulling":
349
- o = "↓ Pull to refresh";
350
- break;
351
- case "ready":
352
- o = "↑ Release to refresh";
353
- break;
354
- case "refreshing":
355
- o = "⟳ Refreshing...";
356
- break;
357
- default:
358
- o = "";
359
- }
360
- return o ? {
361
- type: "component",
362
- id: `${this.id}-refresh`,
363
- mounted: !1,
364
- cleanup: [],
365
- props: {},
366
- render: () => [
367
- T(
368
- "div",
369
- {
370
- style: {
371
- position: "absolute",
372
- top: "-60px",
373
- left: "50%",
374
- transform: "translateX(-50%)",
375
- padding: "10px 20px",
376
- backgroundColor: "#f8f9fa",
377
- borderRadius: "20px",
378
- color: e,
379
- fontSize: "14px",
380
- fontWeight: "500",
381
- textAlign: "center",
382
- zIndex: 1e3,
383
- transition: "all 0.3s ease",
384
- opacity: t === "idle" ? 0 : 1
385
- }
386
- },
387
- o
388
- )
389
- ]
390
- } : null;
391
- }
392
- /**
393
- * Scroll to specific position
394
- */
395
- scrollTo(t, e = "smooth") {
396
- if (!this.scrollElement) return;
397
- const o = { behavior: e };
398
- t.x !== void 0 && (o.left = t.x), t.y !== void 0 && (o.top = t.y), this.scrollElement.scrollTo(o);
399
- }
400
- /**
401
- * Scroll to top
402
- */
403
- scrollToTop(t = "smooth") {
404
- this.scrollTo({ x: 0, y: 0 }, t);
405
- }
406
- /**
407
- * Scroll to bottom
408
- */
409
- scrollToBottom(t = "smooth") {
410
- this.scrollElement && this.scrollTo(
411
- {
412
- x: 0,
413
- y: this.scrollElement.scrollHeight - this.scrollElement.clientHeight
414
- },
415
- t
416
- );
417
- }
418
- /**
419
- * Render the scroll view component
420
- */
421
- render() {
422
- const { children: t = [], scrollEnabled: e = !0 } = this.props, o = T(
423
- "div",
424
- {
425
- class: "tachui-scrollview-content",
426
- style: {
427
- minHeight: "100%",
428
- minWidth: "100%"
429
- }
430
- },
431
- ...t.flatMap((r) => r.render())
432
- ), l = this.createPullToRefreshIndicator(), c = [];
433
- if (l) {
434
- const r = l.render(), f = Array.isArray(r) ? r : [r];
435
- c.push(...f.filter((d) => d));
436
- }
437
- c.push(o);
438
- const { direction: h = "vertical" } = this.props, p = this.getOverflowStyles(h), n = T(
439
- "div",
440
- {
441
- id: this.id,
442
- class: "tachui-scrollview",
443
- style: {
444
- height: "100%",
445
- width: "100%",
446
- position: "relative",
447
- ...p
448
- }
449
- },
450
- ...c
451
- );
452
- if (n.element) {
453
- const r = n.element;
454
- this.scrollElement = r, this.applyScrollViewStyles(r), this.setupScrollHandlers(r), o.element && this.applyContentInsets(o.element);
455
- const f = () => {
456
- const d = m(e) ? e() : e;
457
- r.style.overflow = d ? "auto" : "hidden", r.style.pointerEvents = d ? "auto" : "none";
458
- };
459
- if (m(e)) {
460
- const d = E(f);
461
- this.cleanup.push(() => d.dispose());
462
- } else
463
- f();
464
- }
465
- return [n];
466
- }
467
- }
468
- function b(s = {}) {
469
- const t = new z(s);
470
- return w(t);
471
- }
472
- const Y = {
473
- /**
474
- * Create a scroll view with pull to refresh
475
- */
476
- withRefresh(s, t, e = {}) {
477
- return b({
478
- children: s,
479
- refreshControl: {
480
- enabled: !0,
481
- onRefresh: t,
482
- ...e
483
- }
484
- });
485
- },
486
- /**
487
- * Create a horizontal scroll view
488
- */
489
- horizontal(s, t = {}) {
490
- return b({
491
- ...t,
492
- children: s,
493
- direction: "horizontal"
494
- });
495
- },
496
- /**
497
- * Create a paged scroll view
498
- */
499
- paged(s, t = {}) {
500
- return b({
501
- ...t,
502
- children: s,
503
- pagingEnabled: !0
504
- });
505
- }
506
- };
507
- export {
508
- u as D,
509
- z as E,
510
- b as S,
511
- D as a,
512
- B as b,
513
- Y as c,
514
- a as d
515
- };