@tachui/core 0.8.0-alpha → 0.8.5-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 (176) hide show
  1. package/README.md +58 -2
  2. package/dist/assets/AssetCollection.d.ts.map +1 -1
  3. package/dist/assets/ColorAsset.d.ts.map +1 -1
  4. package/dist/assets/index.d.ts +1 -0
  5. package/dist/assets/index.d.ts.map +1 -1
  6. package/dist/assets/index.js +486 -0
  7. package/dist/assets/types.d.ts +8 -68
  8. package/dist/assets/types.d.ts.map +1 -1
  9. package/dist/binding-CYpEQquE.js +308 -0
  10. package/dist/build-plugins/index.d.ts +3 -0
  11. package/dist/build-plugins/index.d.ts.map +1 -0
  12. package/dist/build-plugins/modifier-types.d.ts +12 -0
  13. package/dist/build-plugins/modifier-types.d.ts.map +1 -0
  14. package/dist/build-tools/typegen-runner.d.ts +29 -0
  15. package/dist/build-tools/typegen-runner.d.ts.map +1 -0
  16. package/dist/bundles/assets.d.ts +19 -0
  17. package/dist/bundles/assets.d.ts.map +1 -0
  18. package/dist/bundles/context.d.ts +22 -0
  19. package/dist/bundles/context.d.ts.map +1 -0
  20. package/dist/bundles/minimal.d.ts +8 -2
  21. package/dist/bundles/minimal.d.ts.map +1 -1
  22. package/dist/common.js +427 -393
  23. package/dist/compiler/codegen.d.ts.map +1 -1
  24. package/dist/compiler/index.js +6 -1393
  25. package/dist/compiler/parser.d.ts +1 -1
  26. package/dist/compiler/parser.d.ts.map +1 -1
  27. package/dist/compiler/plugin.d.ts.map +1 -1
  28. package/dist/compiler/types.d.ts +28 -0
  29. package/dist/compiler/types.d.ts.map +1 -1
  30. package/dist/{component-XAzF1xqs.js → component-CECyfUOE.js} +80 -68
  31. package/dist/{component-base-x2XmHFjy.js → component-base-CJ__jTlr.js} +9 -7
  32. package/dist/component-context-B6qX_Qsg.js +176 -0
  33. package/dist/components/factory.d.ts +24 -0
  34. package/dist/components/factory.d.ts.map +1 -0
  35. package/dist/components/index.d.ts +3 -2
  36. package/dist/components/index.d.ts.map +1 -1
  37. package/dist/components/index.js +8 -6
  38. package/dist/components/wrapper.d.ts +70 -30
  39. package/dist/components/wrapper.d.ts.map +1 -1
  40. package/dist/concatenated-component-_tF1eMvy.js +2288 -0
  41. package/dist/concatenation/concatenated-component.d.ts +16 -2
  42. package/dist/concatenation/concatenated-component.d.ts.map +1 -1
  43. package/dist/concatenation/text-optimizer.d.ts.map +1 -1
  44. package/dist/config.d.ts +7 -0
  45. package/dist/config.d.ts.map +1 -0
  46. package/dist/constants/layout.d.ts +2 -9
  47. package/dist/constants/layout.d.ts.map +1 -1
  48. package/dist/css-classes/index.js +15 -173
  49. package/dist/{effect-B9Knft0b.js → effect-DGmdACI2.js} +3 -3
  50. package/dist/enhanced-renderer-Bwqsh8Ku.js +172 -0
  51. package/dist/essential.js +425 -391
  52. package/dist/{index-DIvMCJQO.js → factories-Co2Lv2kJ.js} +13 -13
  53. package/dist/factory-D7jAY5Kn.js +485 -0
  54. package/dist/gradients/css-generator.js +99 -0
  55. package/dist/gradients/index.js +56 -0
  56. package/dist/gradients/reactive.d.ts.map +1 -1
  57. package/dist/gradients/types.d.ts +3 -91
  58. package/dist/gradients/types.d.ts.map +1 -1
  59. package/dist/hooks-DeLasj54.js +446 -0
  60. package/dist/index-JQ1sW1SK.js +2049 -0
  61. package/dist/index-X8MVY78C.js +618 -0
  62. package/dist/index.d.ts +8 -1
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +426 -392
  65. package/dist/minimal-prod.js +94 -93
  66. package/dist/minimal.js +126 -106
  67. package/dist/modifiers/alignment.d.ts +5 -0
  68. package/dist/modifiers/alignment.d.ts.map +1 -0
  69. package/dist/modifiers/base.d.ts +6 -7
  70. package/dist/modifiers/base.d.ts.map +1 -1
  71. package/dist/modifiers/base.js +24 -16
  72. package/dist/modifiers/builder.d.ts +28 -165
  73. package/dist/modifiers/builder.d.ts.map +1 -1
  74. package/dist/modifiers/builder.js +7 -7
  75. package/dist/modifiers/core.d.ts +0 -1
  76. package/dist/modifiers/core.d.ts.map +1 -1
  77. package/dist/modifiers/corner-radius.d.ts +8 -0
  78. package/dist/modifiers/corner-radius.d.ts.map +1 -0
  79. package/dist/modifiers/index.d.ts +9 -6
  80. package/dist/modifiers/index.d.ts.map +1 -1
  81. package/dist/modifiers/index.js +36 -30
  82. package/dist/modifiers/layout-priority.d.ts +8 -0
  83. package/dist/modifiers/layout-priority.d.ts.map +1 -0
  84. package/dist/modifiers/opacity.d.ts +8 -0
  85. package/dist/modifiers/opacity.d.ts.map +1 -0
  86. package/dist/modifiers/presets.d.ts.map +1 -1
  87. package/dist/modifiers/proxy.d.ts +4 -0
  88. package/dist/modifiers/proxy.d.ts.map +1 -0
  89. package/dist/modifiers/registration-utils.d.ts +7 -0
  90. package/dist/modifiers/registration-utils.d.ts.map +1 -0
  91. package/dist/modifiers/registry.d.ts +18 -9
  92. package/dist/modifiers/registry.d.ts.map +1 -1
  93. package/dist/modifiers/registry.js +2 -2
  94. package/dist/modifiers/type-generator.d.ts +82 -0
  95. package/dist/modifiers/type-generator.d.ts.map +1 -0
  96. package/dist/modifiers/types.d.ts +2 -479
  97. package/dist/modifiers/types.d.ts.map +1 -1
  98. package/dist/modifiers/types.js +1 -4
  99. package/dist/observed-object-DepiqSgg.js +269 -0
  100. package/dist/optimization-CbKNA9w4.js +21 -0
  101. package/dist/plugin-BCAdZXKq.js +1680 -0
  102. package/dist/plugins/index.js +28 -8
  103. package/dist/plugins/simplified-lazy-loader.d.ts.map +1 -1
  104. package/dist/presets-B9x94uRn.js +381 -0
  105. package/dist/proxy-Cqmbiyx0.js +175 -0
  106. package/dist/reactive/cleanup.d.ts.map +1 -1
  107. package/dist/reactive/computed.d.ts +1 -1
  108. package/dist/reactive/computed.d.ts.map +1 -1
  109. package/dist/reactive/context.d.ts +4 -3
  110. package/dist/reactive/context.d.ts.map +1 -1
  111. package/dist/reactive/index.d.ts +1 -0
  112. package/dist/reactive/index.d.ts.map +1 -1
  113. package/dist/reactive/index.js +84 -490
  114. package/dist/reactive/signal-list.d.ts +100 -0
  115. package/dist/reactive/signal-list.d.ts.map +1 -0
  116. package/dist/reactive/signal.d.ts.map +1 -1
  117. package/dist/reactive/types.d.ts +2 -89
  118. package/dist/reactive/types.d.ts.map +1 -1
  119. package/dist/reactive/types.js +1 -4
  120. package/dist/registration-utils-CNsN4eoU.js +27 -0
  121. package/dist/runtime/component.d.ts.map +1 -1
  122. package/dist/runtime/concatenation-aria.d.ts +24 -0
  123. package/dist/runtime/concatenation-aria.d.ts.map +1 -0
  124. package/dist/runtime/concatenation-aria.js +58 -0
  125. package/dist/runtime/concatenation-full.d.ts +30 -0
  126. package/dist/runtime/concatenation-full.d.ts.map +1 -0
  127. package/dist/runtime/concatenation-full.js +85 -0
  128. package/dist/runtime/concatenation-minimal.d.ts +25 -0
  129. package/dist/runtime/concatenation-minimal.d.ts.map +1 -0
  130. package/dist/runtime/concatenation-minimal.js +45 -0
  131. package/dist/runtime/context.d.ts.map +1 -1
  132. package/dist/runtime/dom-bridge.d.ts +1 -1
  133. package/dist/runtime/dom-bridge.d.ts.map +1 -1
  134. package/dist/runtime/dom-bridge.js +239 -12
  135. package/dist/runtime/event-delegation.d.ts +59 -0
  136. package/dist/runtime/event-delegation.d.ts.map +1 -0
  137. package/dist/runtime/index.d.ts +3 -1
  138. package/dist/runtime/index.d.ts.map +1 -1
  139. package/dist/runtime/index.js +96 -0
  140. package/dist/runtime/layout-scheduler.d.ts +89 -0
  141. package/dist/runtime/layout-scheduler.d.ts.map +1 -0
  142. package/dist/runtime/props.d.ts.map +1 -1
  143. package/dist/runtime/renderer.d.ts +54 -2
  144. package/dist/runtime/renderer.d.ts.map +1 -1
  145. package/dist/runtime/renderer.js +11 -7
  146. package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
  147. package/dist/runtime/types.d.ts +2 -226
  148. package/dist/runtime/types.d.ts.map +1 -1
  149. package/dist/runtime/types.js +1 -1
  150. package/dist/scheduler-DI_8ykMk.js +169 -0
  151. package/dist/signal-list-BdpxSodS.js +525 -0
  152. package/dist/state/index.js +319 -0
  153. package/dist/theme-BFaKUcjZ.js +677 -0
  154. package/dist/utils/clone-helpers.d.ts +11 -0
  155. package/dist/utils/clone-helpers.d.ts.map +1 -0
  156. package/dist/validation/index.js +28 -26
  157. package/dist/version.d.ts +19 -0
  158. package/dist/version.d.ts.map +1 -0
  159. package/dist/version.js +6 -0
  160. package/package.json +69 -9
  161. package/dist/concatenated-component-ByPl3_FF.js +0 -2933
  162. package/dist/dom-bridge-CAa1N2zX.js +0 -406
  163. package/dist/index-DCPJFUm9.js +0 -1407
  164. package/dist/index-vdsiw6gQ.js +0 -777
  165. package/dist/modifiers/as-html-validator.d.ts +0 -20
  166. package/dist/modifiers/as-html-validator.d.ts.map +0 -1
  167. package/dist/modifiers/as-html.d.ts +0 -65
  168. package/dist/modifiers/as-html.d.ts.map +0 -1
  169. package/dist/modifiers/background.d.ts +0 -51
  170. package/dist/modifiers/background.d.ts.map +0 -1
  171. package/dist/modifiers/basic-sanitizer.d.ts +0 -54
  172. package/dist/modifiers/basic-sanitizer.d.ts.map +0 -1
  173. package/dist/modifiers/css.d.ts +0 -86
  174. package/dist/modifiers/css.d.ts.map +0 -1
  175. package/dist/production-minimal-BY_gMc-l.js +0 -2532
  176. package/dist/scheduler-BKeqwrYE.js +0 -814
@@ -0,0 +1,269 @@
1
+ import { c as l } from "./effect-DGmdACI2.js";
2
+ import { c as f, l as p } from "./theme-BFaKUcjZ.js";
3
+ import { d as a, g as d, p as g, c as y } from "./component-context-B6qX_Qsg.js";
4
+ var j = Object.defineProperty, O = (e, t, n) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, s = (e, t, n) => O(e, typeof t != "symbol" ? t + "" : t, n);
5
+ class v {
6
+ constructor(t) {
7
+ s(this, "_signal"), s(this, "_setter"), s(this, "_subscribers", /* @__PURE__ */ new Set());
8
+ const [n, i] = f(t);
9
+ this._signal = n, this._setter = i;
10
+ }
11
+ get value() {
12
+ return this._signal();
13
+ }
14
+ set value(t) {
15
+ this._setter(t), this.notifySubscribers();
16
+ }
17
+ /**
18
+ * Update a property of the environment object
19
+ */
20
+ updateProperty(t, n) {
21
+ const r = { ...this._signal(), [t]: n };
22
+ this._setter(r), this.notifySubscribers();
23
+ }
24
+ /**
25
+ * Subscribe to changes
26
+ */
27
+ subscribe(t) {
28
+ return this._subscribers.add(t), () => this._subscribers.delete(t);
29
+ }
30
+ notifySubscribers() {
31
+ for (const t of this._subscribers)
32
+ try {
33
+ t();
34
+ } catch (n) {
35
+ console.error("Error in environment object subscriber:", n);
36
+ }
37
+ }
38
+ /**
39
+ * Create a reactive effect that runs when this object changes
40
+ */
41
+ onChange(t) {
42
+ const n = l(() => {
43
+ t(this._signal());
44
+ });
45
+ return () => n.dispose();
46
+ }
47
+ }
48
+ class _ {
49
+ constructor(t, n) {
50
+ s(this, "key"), s(this, "componentContext"), s(this, "_cachedValue"), s(this, "_subscriptionCleanup"), this.key = t, this.componentContext = n, n.onCleanup(() => {
51
+ this._subscriptionCleanup && this._subscriptionCleanup();
52
+ });
53
+ }
54
+ get wrappedValue() {
55
+ if (this._cachedValue === void 0 && (this._cachedValue = y(this.key), this._cachedValue && typeof this._cachedValue == "object" && "subscribe" in this._cachedValue)) {
56
+ const t = this._cachedValue;
57
+ typeof t.subscribe == "function" && (this._subscriptionCleanup = t.subscribe(() => {
58
+ this.componentContext.setState(`_env_${this.key.name}_trigger`, Date.now());
59
+ }));
60
+ }
61
+ return this._cachedValue;
62
+ }
63
+ get projectedValue() {
64
+ return this;
65
+ }
66
+ }
67
+ function $(e) {
68
+ const t = d();
69
+ return new _(e, t);
70
+ }
71
+ function I(e, t) {
72
+ g(e, t);
73
+ }
74
+ function T(e, t) {
75
+ return new v(t);
76
+ }
77
+ function k(e) {
78
+ return e && typeof e == "object" && "wrappedValue" in e && "key" in e && "componentContext" in e && e instanceof _;
79
+ }
80
+ const z = {
81
+ /**
82
+ * Application theme
83
+ */
84
+ Theme: a("Theme", {
85
+ mode: "light",
86
+ primaryColor: "#007AFF",
87
+ secondaryColor: "#5856D6"
88
+ }),
89
+ /**
90
+ * Localization service
91
+ */
92
+ Localization: a("Localization"),
93
+ /**
94
+ * Navigation service
95
+ */
96
+ Navigation: a("Navigation"),
97
+ /**
98
+ * Application configuration
99
+ */
100
+ Config: a("Config"),
101
+ /**
102
+ * User authentication
103
+ */
104
+ Auth: a("Auth")
105
+ };
106
+ var w = Object.defineProperty, V = (e, t, n) => t in e ? w(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, c = (e, t, n) => V(e, typeof t != "symbol" ? t + "" : t, n);
107
+ class m {
108
+ constructor() {
109
+ c(this, "_objectWillChange"), c(this, "_notifyCount", 0);
110
+ const [t, n] = f(void 0);
111
+ this._objectWillChange = {
112
+ getValue: t,
113
+ peek: t
114
+ }, this._notifySetter = n;
115
+ }
116
+ get objectWillChange() {
117
+ return this._objectWillChange;
118
+ }
119
+ /**
120
+ * Notify observers that the object has changed
121
+ * Call this method whenever properties of the object change
122
+ */
123
+ notifyChange() {
124
+ this._notifyCount++;
125
+ const t = this._notifySetter;
126
+ t && t(void 0);
127
+ }
128
+ /**
129
+ * Get the current notification count (for debugging)
130
+ */
131
+ get notificationCount() {
132
+ return this._notifyCount;
133
+ }
134
+ }
135
+ class x {
136
+ constructor(t, n, i, r = {}) {
137
+ c(this, "_object"), c(this, "_metadata"), c(this, "_effectCleanup"), this._object = t, this._metadata = {
138
+ type: "ObservedObject",
139
+ propertyName: i,
140
+ componentId: n.id,
141
+ options: r
142
+ }, this.setupObservation();
143
+ const o = p();
144
+ o && o.cleanups.push(() => {
145
+ this.cleanup();
146
+ });
147
+ }
148
+ get wrappedValue() {
149
+ return this._object;
150
+ }
151
+ get projectedValue() {
152
+ return this;
153
+ }
154
+ /**
155
+ * Get property wrapper metadata
156
+ */
157
+ get metadata() {
158
+ return this._metadata;
159
+ }
160
+ /**
161
+ * Set up reactive observation of the object
162
+ */
163
+ setupObservation() {
164
+ const t = l(() => {
165
+ this._object.objectWillChange();
166
+ });
167
+ this._effectCleanup = () => t.dispose();
168
+ }
169
+ /**
170
+ * Cleanup observation
171
+ */
172
+ cleanup() {
173
+ this._effectCleanup && (this._effectCleanup(), this._effectCleanup = void 0);
174
+ }
175
+ /**
176
+ * Replace the observed object (advanced usage)
177
+ */
178
+ updateObject(t) {
179
+ this.cleanup(), this._object = t, this.setupObservation();
180
+ }
181
+ }
182
+ const E = (e, t = {}) => {
183
+ const n = W(), i = P() || "observedObject";
184
+ return new x(e, n, i, t);
185
+ };
186
+ function N(e, t = {}) {
187
+ const n = new m();
188
+ return new Proxy(e, {
189
+ set(r, o, u) {
190
+ const C = r[o], b = Reflect.set(r, o, u);
191
+ return b && C !== u && t.autoNotify !== !1 && n.notifyChange(), b;
192
+ },
193
+ get(r, o) {
194
+ return o === "objectWillChange" ? n.objectWillChange : o === "notifyChange" ? () => n.notifyChange() : o === "notificationCount" ? n.notificationCount : Reflect.get(r, o);
195
+ }
196
+ });
197
+ }
198
+ function D(e = {}) {
199
+ return (t) => class extends t {
200
+ constructor(...n) {
201
+ super(...n), c(this, "_observableBase", new m()), e.autoNotify !== !1 && this.setupAutoNotification();
202
+ }
203
+ get objectWillChange() {
204
+ return this._observableBase.objectWillChange;
205
+ }
206
+ get notificationCount() {
207
+ return this._observableBase.notificationCount;
208
+ }
209
+ notifyChange() {
210
+ this._observableBase.notifyChange();
211
+ }
212
+ setupAutoNotification() {
213
+ const n = Object.getOwnPropertyNames(this);
214
+ for (const i of n) {
215
+ if (i.startsWith("_") || typeof this[i] == "function")
216
+ continue;
217
+ let r = this[i];
218
+ Object.defineProperty(this, i, {
219
+ get: () => r,
220
+ set: (o) => {
221
+ r !== o && (r = o, this.notifyChange());
222
+ },
223
+ enumerable: !0,
224
+ configurable: !0
225
+ });
226
+ }
227
+ }
228
+ };
229
+ }
230
+ function W() {
231
+ const e = p();
232
+ if (!e?.context.has(h))
233
+ throw new Error("@ObservedObject can only be used within a component context");
234
+ return e.context.get(h);
235
+ }
236
+ function P() {
237
+ try {
238
+ const e = new Error().stack;
239
+ if (e)
240
+ return e.match(/at (\w+)\./)?.[1] || null;
241
+ } catch {
242
+ }
243
+ return null;
244
+ }
245
+ const h = Symbol("TachUI.ComponentContext");
246
+ function S(e) {
247
+ return e && typeof e == "object" && "objectWillChange" in e && "notifyChange" in e;
248
+ }
249
+ function K(e) {
250
+ return e && typeof e == "object" && "wrappedValue" in e && "projectedValue" in e && S(e.wrappedValue);
251
+ }
252
+ function L(e, t = {}) {
253
+ return N({ ...e }, t);
254
+ }
255
+ const R = E;
256
+ export {
257
+ z as C,
258
+ $ as E,
259
+ m as O,
260
+ L as a,
261
+ S as b,
262
+ T as c,
263
+ K as d,
264
+ R as e,
265
+ k as i,
266
+ N as m,
267
+ D as o,
268
+ I as p
269
+ };
@@ -0,0 +1,21 @@
1
+ class a {
2
+ // Placeholder implementation
3
+ }
4
+ function o() {
5
+ }
6
+ function u() {
7
+ }
8
+ function s() {
9
+ }
10
+ function t() {
11
+ }
12
+ function c() {
13
+ }
14
+ export {
15
+ a as L,
16
+ s as a,
17
+ t as b,
18
+ c as l,
19
+ o as m,
20
+ u
21
+ };