@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.
- package/README.md +58 -2
- package/dist/assets/AssetCollection.d.ts.map +1 -1
- package/dist/assets/ColorAsset.d.ts.map +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +486 -0
- package/dist/assets/types.d.ts +8 -68
- package/dist/assets/types.d.ts.map +1 -1
- package/dist/binding-CYpEQquE.js +308 -0
- package/dist/build-plugins/index.d.ts +3 -0
- package/dist/build-plugins/index.d.ts.map +1 -0
- package/dist/build-plugins/modifier-types.d.ts +12 -0
- package/dist/build-plugins/modifier-types.d.ts.map +1 -0
- package/dist/build-tools/typegen-runner.d.ts +29 -0
- package/dist/build-tools/typegen-runner.d.ts.map +1 -0
- package/dist/bundles/assets.d.ts +19 -0
- package/dist/bundles/assets.d.ts.map +1 -0
- package/dist/bundles/context.d.ts +22 -0
- package/dist/bundles/context.d.ts.map +1 -0
- package/dist/bundles/minimal.d.ts +8 -2
- package/dist/bundles/minimal.d.ts.map +1 -1
- package/dist/common.js +427 -393
- package/dist/compiler/codegen.d.ts.map +1 -1
- package/dist/compiler/index.js +6 -1393
- package/dist/compiler/parser.d.ts +1 -1
- package/dist/compiler/parser.d.ts.map +1 -1
- package/dist/compiler/plugin.d.ts.map +1 -1
- package/dist/compiler/types.d.ts +28 -0
- package/dist/compiler/types.d.ts.map +1 -1
- package/dist/{component-XAzF1xqs.js → component-CECyfUOE.js} +80 -68
- package/dist/{component-base-x2XmHFjy.js → component-base-CJ__jTlr.js} +9 -7
- package/dist/component-context-B6qX_Qsg.js +176 -0
- package/dist/components/factory.d.ts +24 -0
- package/dist/components/factory.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -6
- package/dist/components/wrapper.d.ts +70 -30
- package/dist/components/wrapper.d.ts.map +1 -1
- package/dist/concatenated-component-_tF1eMvy.js +2288 -0
- package/dist/concatenation/concatenated-component.d.ts +16 -2
- package/dist/concatenation/concatenated-component.d.ts.map +1 -1
- package/dist/concatenation/text-optimizer.d.ts.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/constants/layout.d.ts +2 -9
- package/dist/constants/layout.d.ts.map +1 -1
- package/dist/css-classes/index.js +15 -173
- package/dist/{effect-B9Knft0b.js → effect-DGmdACI2.js} +3 -3
- package/dist/enhanced-renderer-Bwqsh8Ku.js +172 -0
- package/dist/essential.js +425 -391
- package/dist/{index-DIvMCJQO.js → factories-Co2Lv2kJ.js} +13 -13
- package/dist/factory-D7jAY5Kn.js +485 -0
- package/dist/gradients/css-generator.js +99 -0
- package/dist/gradients/index.js +56 -0
- package/dist/gradients/reactive.d.ts.map +1 -1
- package/dist/gradients/types.d.ts +3 -91
- package/dist/gradients/types.d.ts.map +1 -1
- package/dist/hooks-DeLasj54.js +446 -0
- package/dist/index-JQ1sW1SK.js +2049 -0
- package/dist/index-X8MVY78C.js +618 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +426 -392
- package/dist/minimal-prod.js +94 -93
- package/dist/minimal.js +126 -106
- package/dist/modifiers/alignment.d.ts +5 -0
- package/dist/modifiers/alignment.d.ts.map +1 -0
- package/dist/modifiers/base.d.ts +6 -7
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +24 -16
- package/dist/modifiers/builder.d.ts +28 -165
- package/dist/modifiers/builder.d.ts.map +1 -1
- package/dist/modifiers/builder.js +7 -7
- package/dist/modifiers/core.d.ts +0 -1
- package/dist/modifiers/core.d.ts.map +1 -1
- package/dist/modifiers/corner-radius.d.ts +8 -0
- package/dist/modifiers/corner-radius.d.ts.map +1 -0
- package/dist/modifiers/index.d.ts +9 -6
- package/dist/modifiers/index.d.ts.map +1 -1
- package/dist/modifiers/index.js +36 -30
- package/dist/modifiers/layout-priority.d.ts +8 -0
- package/dist/modifiers/layout-priority.d.ts.map +1 -0
- package/dist/modifiers/opacity.d.ts +8 -0
- package/dist/modifiers/opacity.d.ts.map +1 -0
- package/dist/modifiers/presets.d.ts.map +1 -1
- package/dist/modifiers/proxy.d.ts +4 -0
- package/dist/modifiers/proxy.d.ts.map +1 -0
- package/dist/modifiers/registration-utils.d.ts +7 -0
- package/dist/modifiers/registration-utils.d.ts.map +1 -0
- package/dist/modifiers/registry.d.ts +18 -9
- package/dist/modifiers/registry.d.ts.map +1 -1
- package/dist/modifiers/registry.js +2 -2
- package/dist/modifiers/type-generator.d.ts +82 -0
- package/dist/modifiers/type-generator.d.ts.map +1 -0
- package/dist/modifiers/types.d.ts +2 -479
- package/dist/modifiers/types.d.ts.map +1 -1
- package/dist/modifiers/types.js +1 -4
- package/dist/observed-object-DepiqSgg.js +269 -0
- package/dist/optimization-CbKNA9w4.js +21 -0
- package/dist/plugin-BCAdZXKq.js +1680 -0
- package/dist/plugins/index.js +28 -8
- package/dist/plugins/simplified-lazy-loader.d.ts.map +1 -1
- package/dist/presets-B9x94uRn.js +381 -0
- package/dist/proxy-Cqmbiyx0.js +175 -0
- package/dist/reactive/cleanup.d.ts.map +1 -1
- package/dist/reactive/computed.d.ts +1 -1
- package/dist/reactive/computed.d.ts.map +1 -1
- package/dist/reactive/context.d.ts +4 -3
- package/dist/reactive/context.d.ts.map +1 -1
- package/dist/reactive/index.d.ts +1 -0
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/index.js +84 -490
- package/dist/reactive/signal-list.d.ts +100 -0
- package/dist/reactive/signal-list.d.ts.map +1 -0
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive/types.d.ts +2 -89
- package/dist/reactive/types.d.ts.map +1 -1
- package/dist/reactive/types.js +1 -4
- package/dist/registration-utils-CNsN4eoU.js +27 -0
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/concatenation-aria.d.ts +24 -0
- package/dist/runtime/concatenation-aria.d.ts.map +1 -0
- package/dist/runtime/concatenation-aria.js +58 -0
- package/dist/runtime/concatenation-full.d.ts +30 -0
- package/dist/runtime/concatenation-full.d.ts.map +1 -0
- package/dist/runtime/concatenation-full.js +85 -0
- package/dist/runtime/concatenation-minimal.d.ts +25 -0
- package/dist/runtime/concatenation-minimal.d.ts.map +1 -0
- package/dist/runtime/concatenation-minimal.js +45 -0
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.d.ts +1 -1
- package/dist/runtime/dom-bridge.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.js +239 -12
- package/dist/runtime/event-delegation.d.ts +59 -0
- package/dist/runtime/event-delegation.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +96 -0
- package/dist/runtime/layout-scheduler.d.ts +89 -0
- package/dist/runtime/layout-scheduler.d.ts.map +1 -0
- package/dist/runtime/props.d.ts.map +1 -1
- package/dist/runtime/renderer.d.ts +54 -2
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +11 -7
- package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +2 -226
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js +1 -1
- package/dist/scheduler-DI_8ykMk.js +169 -0
- package/dist/signal-list-BdpxSodS.js +525 -0
- package/dist/state/index.js +319 -0
- package/dist/theme-BFaKUcjZ.js +677 -0
- package/dist/utils/clone-helpers.d.ts +11 -0
- package/dist/utils/clone-helpers.d.ts.map +1 -0
- package/dist/validation/index.js +28 -26
- package/dist/version.d.ts +19 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/package.json +69 -9
- package/dist/concatenated-component-ByPl3_FF.js +0 -2933
- package/dist/dom-bridge-CAa1N2zX.js +0 -406
- package/dist/index-DCPJFUm9.js +0 -1407
- package/dist/index-vdsiw6gQ.js +0 -777
- package/dist/modifiers/as-html-validator.d.ts +0 -20
- package/dist/modifiers/as-html-validator.d.ts.map +0 -1
- package/dist/modifiers/as-html.d.ts +0 -65
- package/dist/modifiers/as-html.d.ts.map +0 -1
- package/dist/modifiers/background.d.ts +0 -51
- package/dist/modifiers/background.d.ts.map +0 -1
- package/dist/modifiers/basic-sanitizer.d.ts +0 -54
- package/dist/modifiers/basic-sanitizer.d.ts.map +0 -1
- package/dist/modifiers/css.d.ts +0 -86
- package/dist/modifiers/css.d.ts.map +0 -1
- package/dist/production-minimal-BY_gMc-l.js +0 -2532
- 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
|
+
};
|