@tachui/core 0.8.0-alpha → 0.8.1-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.
package/dist/minimal.js CHANGED
@@ -1,11 +1,12 @@
1
- import { Y as t, $ as r, j as o, c as n, _ as i, g as c, S as d, Q as p, h as f, k as m, G as l, f as u, H as g, P as C, V as M, W as h, l as y, m as S, I as x, X as E, i as I, J as R, o as A, r as b, Z as v, u as B } from "./scheduler-BKeqwrYE.js";
2
- import { c as F, a as w, b as D, d as O, e as P, g as L, i as U } from "./effect-B9Knft0b.js";
3
- import { D as H, f as j, h as G, i as N, m as T, r as W, u as Q, j as _, k as z } from "./dom-bridge-CAa1N2zX.js";
4
- import { g as K, C as X, P as Y, R as Z, c as $, h as q, a as ee, l as ae, b as se, i as te, d as re, e as oe, j as ne, k as ie, f as ce, p as de, w as pe } from "./component-XAzF1xqs.js";
5
- import { f as me, h as le, i as ue, O as ge, P as Ce, Q as Me, R as he, j as ye, l as Se, N as xe, p as Ee } from "./concatenated-component-ByPl3_FF.js";
6
- import { c as Re, a as Ae, b as be, i as ve, d as Be, h as ke, e as Fe, f as we, m as De, r as Oe, s as Pe, g as Le } from "./index-DIvMCJQO.js";
7
- import { a as Ve, A as He, C as je, F as Ge, I as Ne, L as Te, a6 as We, a0 as Qe, f as _e, h as ze, g as Je, a1 as Ke, a5 as Xe, r as Ye, a7 as Ze } from "./production-minimal-BY_gMc-l.js";
8
- import { Layout as qe, infinity as ea, isInfinity as aa } from "./constants/layout.js";
1
+ import { Y as t, $ as r, j as n, c as o, _ as i, g as c, S as m, Q as d, h as p, k as f, G as l, K as C, f as u, H as g, P as M, V as h, W as x, L as y, l as b, m as E, I as S, X as v, i as I, J as O, o as R, r as A, Z as w, N as B, u as F } from "./scheduler-BKeqwrYE.js";
2
+ import { c as j, a as D, b as L, d as P, e as G, g as T, i as U } from "./effect-B9Knft0b.js";
3
+ import { D as H, b as N, d as K, f as W, g as Q, h as _, i as z, m as J, r as X, s as Y, u as Z, j as $, k as q, w as ee } from "./dom-bridge-CAa1N2zX.js";
4
+ import { g as se, C as te, P as re, R as ne, c as oe, h as ie, a as ce, l as me, b as de, i as pe, d as fe, e as le, j as Ce, k as ue, f as ge, p as Me, w as he } from "./component-XAzF1xqs.js";
5
+ import { E as ye, O as be, p as Ee } from "./observed-object-Cos-FtjP.js";
6
+ import { f as ve, h as Ie, i as Oe, O as Re, P as Ae, Q as we, R as Be, j as Fe, l as ke, N as je, p as De } from "./concatenated-component-ByPl3_FF.js";
7
+ import { c as Pe, a as Ge, b as Te, i as Ue, d as Ve, h as He, e as Ne, f as Ke, m as We, r as Qe, s as _e, g as ze } from "./index-DIvMCJQO.js";
8
+ import { a as Xe, A as Ye, C as Ze, F as $e, I as qe, L as ea, a6 as aa, w as sa, a0 as ta, f as ra, h as na, d as oa, g as ia, a1 as ca, a5 as ma, r as da, a7 as pa } from "./production-minimal-BY_gMc-l.js";
9
+ import { Layout as la, infinity as Ca, isInfinity as ua } from "./constants/layout.js";
9
10
  const e = {
10
11
  name: "@tachui/core/minimal",
11
12
  version: "0.1.0",
@@ -24,105 +25,118 @@ const e = {
24
25
  }
25
26
  };
26
27
  export {
27
- Ve as Asset,
28
- He as Assets,
28
+ Xe as Asset,
29
+ Ye as Assets,
29
30
  e as BUNDLE_INFO,
30
- K as ChildrenManager,
31
- je as ColorAsset,
32
- X as ComponentManager,
31
+ se as ChildrenManager,
32
+ Ze as ColorAsset,
33
+ te as ComponentManager,
33
34
  t as ComputationImpl,
34
35
  r as DEBUG,
35
36
  H as DOMBridgeDebug,
36
- Ge as FontAsset,
37
- Ne as ImageAsset,
38
- qe as Layout,
39
- Te as LinearGradient,
40
- Y as PropsManager,
41
- Z as RefManager,
42
- We as State,
43
- me as animationModifiers,
44
- le as appearanceModifiers,
45
- o as batch,
46
- Re as classModifier,
47
- Ae as combineModifiers,
48
- be as conditionalModifier,
49
- ue as coreModifiers,
50
- $ as createAdvancedComponent,
51
- Qe as createBinding,
52
- q as createChildrenManager,
53
- n as createCleanupGroup,
54
- _e as createColorAsset,
55
- ee as createComponent,
56
- ve as createComponentVariant,
37
+ ye as EnvironmentObject,
38
+ $e as FontAsset,
39
+ qe as ImageAsset,
40
+ la as Layout,
41
+ ea as LinearGradient,
42
+ be as ObservableObjectBase,
43
+ re as PropsManager,
44
+ ne as RefManager,
45
+ aa as State,
46
+ sa as StateGradient,
47
+ ve as animationModifiers,
48
+ Ie as appearanceModifiers,
49
+ n as batch,
50
+ Pe as classModifier,
51
+ Ge as combineModifiers,
52
+ Te as conditionalModifier,
53
+ Oe as coreModifiers,
54
+ oe as createAdvancedComponent,
55
+ ta as createBinding,
56
+ ie as createChildrenManager,
57
+ o as createCleanupGroup,
58
+ ra as createColorAsset,
59
+ ce as createComponent,
60
+ N as createComponentContext,
61
+ Ue as createComponentVariant,
57
62
  i as createComputation,
58
63
  c as createComputed,
59
- d as createConditionalComputed,
60
- Be as createCustomModifier,
61
- p as createDerivedSignal,
62
- F as createEffect,
63
- ae as createErrorBoundary,
64
- ze as createFontAsset,
65
- se as createFragment,
66
- Je as createImageAsset,
67
- f as createMemo,
68
- w as createOnceEffect,
69
- ke as createPresetModifier,
70
- te as createPropsManager,
71
- re as createReactiveComponent,
72
- oe as createRef,
73
- ne as createRefManager,
74
- D as createRenderEffect,
75
- m as createRoot,
64
+ m as createConditionalComputed,
65
+ Ve as createCustomModifier,
66
+ d as createDerivedSignal,
67
+ j as createEffect,
68
+ K as createEnvironmentKey,
69
+ me as createErrorBoundary,
70
+ na as createFontAsset,
71
+ de as createFragment,
72
+ oa as createGoogleFont,
73
+ ia as createImageAsset,
74
+ p as createMemo,
75
+ D as createOnceEffect,
76
+ He as createPresetModifier,
77
+ pe as createPropsManager,
78
+ fe as createReactiveComponent,
79
+ le as createRef,
80
+ Ce as createRefManager,
81
+ L as createRenderEffect,
82
+ f as createRoot,
76
83
  l as createSignal,
77
- Fe as createStyleModifier,
78
- O as createSyncEffect,
79
- ge as css,
80
- Ce as cssProperty,
81
- Me as cssVariable,
82
- he as cssVendor,
83
- ie as defaultChildrenRenderer,
84
+ Ne as createStyleModifier,
85
+ P as createSyncEffect,
86
+ Re as css,
87
+ Ae as cssProperty,
88
+ we as cssVariable,
89
+ Be as cssVendor,
90
+ ue as defaultChildrenRenderer,
91
+ C as detectSystemTheme,
84
92
  u as dispose,
85
- P as disposeEffect,
86
- we as eventModifier,
93
+ G as disposeEffect,
94
+ Ke as eventModifier,
87
95
  g as flushSync,
88
- ce as forwardRef,
89
- j as getComponentFromElement,
90
- C as getComputedImpl,
91
- M as getCurrentComputation,
92
- h as getCurrentOwner,
93
- L as getEffectInfo,
94
- y as getOwner,
95
- S as getReactiveContext,
96
- x as getSignalImpl,
97
- ea as infinity,
98
- ye as interactionModifiers,
99
- E as isBatchingUpdates,
100
- Ke as isBinding,
96
+ ge as forwardRef,
97
+ W as getComponentFromElement,
98
+ M as getComputedImpl,
99
+ Q as getCurrentComponentContext,
100
+ h as getCurrentComputation,
101
+ x as getCurrentOwner,
102
+ y as getCurrentTheme,
103
+ T as getEffectInfo,
104
+ b as getOwner,
105
+ E as getReactiveContext,
106
+ S as getSignalImpl,
107
+ Ca as infinity,
108
+ Fe as interactionModifiers,
109
+ v as isBatchingUpdates,
110
+ ca as isBinding,
101
111
  I as isComputed,
102
112
  U as isEffectDisposed,
103
- aa as isInfinity,
104
- R as isSignal,
105
- Xe as isState,
106
- Se as layoutModifiers,
107
- xe as lifecycleModifiers,
108
- De as modifierHelpers,
109
- G as mountComponentChildren,
110
- N as mountComponentTree,
111
- T as mountRoot,
112
- A as onCleanup,
113
- Ee as presetModifiers,
114
- de as propsUtils,
115
- Ye as registerAsset,
116
- W as registerComponentWithLifecycleHooks,
117
- Oe as responsiveModifier,
118
- b as runWithOwner,
119
- v as setFlushFunction,
120
- Pe as stateModifier,
121
- Le as styleModifier,
122
- Q as unmountComponent,
123
- _ as unmountComponentEnhanced,
124
- B as untrack,
125
- Ze as unwrapValue,
126
- z as updateComponent,
127
- pe as withLifecycle
113
+ ua as isInfinity,
114
+ O as isSignal,
115
+ ma as isState,
116
+ ke as layoutModifiers,
117
+ je as lifecycleModifiers,
118
+ We as modifierHelpers,
119
+ _ as mountComponentChildren,
120
+ z as mountComponentTree,
121
+ J as mountRoot,
122
+ R as onCleanup,
123
+ De as presetModifiers,
124
+ Me as propsUtils,
125
+ Ee as provideEnvironmentObject,
126
+ da as registerAsset,
127
+ X as registerComponentWithLifecycleHooks,
128
+ Qe as responsiveModifier,
129
+ A as runWithOwner,
130
+ Y as setCurrentComponentContext,
131
+ w as setFlushFunction,
132
+ B as setTheme,
133
+ _e as stateModifier,
134
+ ze as styleModifier,
135
+ Z as unmountComponent,
136
+ $ as unmountComponentEnhanced,
137
+ F as untrack,
138
+ pa as unwrapValue,
139
+ q as updateComponent,
140
+ ee as withComponentContext,
141
+ he as withLifecycle
128
142
  };
@@ -0,0 +1,269 @@
1
+ import { c as l } from "./effect-B9Knft0b.js";
2
+ import { G as f, W as p } from "./scheduler-BKeqwrYE.js";
3
+ import { d as a, g as d, p as g, c as y } from "./dom-bridge-CAa1N2zX.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
+ };