@tachui/core 0.7.1-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/README.md +20 -2
- package/dist/bundles/assets.d.ts +19 -0
- package/dist/bundles/assets.d.ts.map +1 -0
- package/dist/bundles/common.d.ts +1 -1
- package/dist/bundles/common.d.ts.map +1 -1
- package/dist/bundles/context.d.ts +22 -0
- package/dist/bundles/context.d.ts.map +1 -0
- package/dist/bundles/minimal.d.ts +8 -18
- package/dist/bundles/minimal.d.ts.map +1 -1
- package/dist/bundles/production-minimal.d.ts +2 -16
- package/dist/bundles/production-minimal.d.ts.map +1 -1
- package/dist/common.js +405 -828
- package/dist/compiler/advanced-parser.d.ts.map +1 -1
- package/dist/compiler/codegen.d.ts.map +1 -1
- package/dist/compiler/index.js +6 -1387
- 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 +487 -0
- package/dist/component-base-x2XmHFjy.js +255 -0
- package/dist/components/index.d.ts +4 -38
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -4167
- package/dist/components/wrapper.d.ts +5 -152
- package/dist/components/wrapper.d.ts.map +1 -1
- package/dist/concatenated-component-ByPl3_FF.js +2933 -0
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/layout.d.ts +47 -4
- package/dist/constants/layout.d.ts.map +1 -1
- package/dist/constants/layout.js +84 -0
- package/dist/css-classes/index.js +176 -0
- package/dist/{dom-bridge-Cx-s6Ihx.js → dom-bridge-CAa1N2zX.js} +28 -28
- package/dist/{effect-CytAc9em.js → effect-B9Knft0b.js} +3 -3
- package/dist/essential.js +397 -826
- package/dist/index-DEBd8cq7.js +1144 -0
- package/dist/index-DIvMCJQO.js +268 -0
- package/dist/index-vdsiw6gQ.js +777 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +397 -826
- package/dist/minimal-prod.js +101 -155
- package/dist/minimal.js +118 -170
- package/dist/modifiers/background.d.ts +41 -11
- package/dist/modifiers/background.d.ts.map +1 -1
- package/dist/modifiers/base.d.ts +6 -33
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +487 -0
- package/dist/modifiers/builder.d.ts +103 -195
- package/dist/modifiers/builder.d.ts.map +1 -1
- package/dist/modifiers/builder.js +9 -0
- package/dist/modifiers/core.d.ts +9 -401
- package/dist/modifiers/core.d.ts.map +1 -1
- package/dist/modifiers/{utils.d.ts → factories.d.ts} +18 -5
- package/dist/modifiers/factories.d.ts.map +1 -0
- package/dist/modifiers/index.d.ts +8 -52
- package/dist/modifiers/index.d.ts.map +1 -1
- package/dist/modifiers/index.js +38 -0
- package/dist/modifiers/presets.d.ts +368 -0
- package/dist/modifiers/presets.d.ts.map +1 -0
- package/dist/modifiers/registry.js +10 -0
- package/dist/modifiers/types.d.ts +39 -211
- package/dist/modifiers/types.d.ts.map +1 -1
- package/dist/modifiers/types.js +4 -0
- package/dist/observed-object-Cos-FtjP.js +269 -0
- package/dist/performance-optimizer-stub-CtfXUwl4.js +38 -0
- package/dist/plugin-BCAdZXKq.js +1680 -0
- package/dist/plugins/index.d.ts +5 -6
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +147 -297
- package/dist/plugins/simplified-index.d.ts +5 -6
- package/dist/plugins/simplified-index.d.ts.map +1 -1
- package/dist/production-minimal-BY_gMc-l.js +2532 -0
- package/dist/reactive/index.js +96 -95
- package/dist/reactive/types.js +4 -0
- 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 +53 -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 +77 -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 +40 -0
- package/dist/runtime/dom-bridge.js +5 -5
- package/dist/runtime/element-override.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +0 -7
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +7 -8
- package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
- package/dist/runtime/types.js +1 -0
- package/dist/{scheduler-7SvC3a21.js → scheduler-BKeqwrYE.js} +130 -130
- package/dist/validation/build-time-stub.d.ts +33 -0
- package/dist/validation/build-time-stub.d.ts.map +1 -0
- package/dist/validation/debug-tools-stub.d.ts +67 -0
- package/dist/validation/debug-tools-stub.d.ts.map +1 -0
- package/dist/validation/index.d.ts +23 -78
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +609 -6470
- package/dist/validation/lifecycle-validation.d.ts.map +1 -1
- package/dist/validation/performance-optimizer-stub.d.ts +50 -0
- package/dist/validation/performance-optimizer-stub.d.ts.map +1 -0
- package/dist/validation/plugin-registration.d.ts +5 -1
- package/dist/validation/plugin-registration.d.ts.map +1 -1
- package/dist/validation/production-bypass-core.d.ts +69 -0
- package/dist/validation/production-bypass-core.d.ts.map +1 -0
- package/package.json +61 -5
- package/dist/ScrollView-h-6wYMAm.js +0 -515
- package/dist/Spacer-BbteDQ9I.js +0 -5337
- package/dist/binding-CmdpowkI.js +0 -2276
- package/dist/components/BasicInput.d.ts +0 -116
- package/dist/components/BasicInput.d.ts.map +0 -1
- package/dist/components/Button.d.ts +0 -252
- package/dist/components/Button.d.ts.map +0 -1
- package/dist/components/Divider.d.ts +0 -141
- package/dist/components/Divider.d.ts.map +0 -1
- package/dist/components/EnhancedLink.d.ts +0 -365
- package/dist/components/EnhancedLink.d.ts.map +0 -1
- package/dist/components/Form.d.ts +0 -141
- package/dist/components/Form.d.ts.map +0 -1
- package/dist/components/Grid.d.ts +0 -698
- package/dist/components/Grid.d.ts.map +0 -1
- package/dist/components/GridResponsive.d.ts +0 -214
- package/dist/components/GridResponsive.d.ts.map +0 -1
- package/dist/components/Image.d.ts +0 -162
- package/dist/components/Image.d.ts.map +0 -1
- package/dist/components/List.d.ts +0 -287
- package/dist/components/List.d.ts.map +0 -1
- package/dist/components/Menu.d.ts +0 -159
- package/dist/components/Menu.d.ts.map +0 -1
- package/dist/components/Picker.d.ts +0 -153
- package/dist/components/Picker.d.ts.map +0 -1
- package/dist/components/ScrollView.d.ts +0 -222
- package/dist/components/ScrollView.d.ts.map +0 -1
- package/dist/components/Section.d.ts +0 -153
- package/dist/components/Section.d.ts.map +0 -1
- package/dist/components/Show.d.ts +0 -64
- package/dist/components/Show.d.ts.map +0 -1
- package/dist/components/Spacer.d.ts +0 -35
- package/dist/components/Spacer.d.ts.map +0 -1
- package/dist/components/Text.d.ts +0 -242
- package/dist/components/Text.d.ts.map +0 -1
- package/dist/components/Toggle.d.ts +0 -207
- package/dist/components/Toggle.d.ts.map +0 -1
- package/dist/concatenated-component-DPcl2TEO.js +0 -6779
- package/dist/context--zQFIImS.js +0 -283
- package/dist/debug/index.d.ts +0 -61
- package/dist/debug/index.d.ts.map +0 -1
- package/dist/debug.js +0 -178
- package/dist/developer-experience/enhanced-errors.d.ts +0 -128
- package/dist/developer-experience/enhanced-errors.d.ts.map +0 -1
- package/dist/developer-experience/enhanced-types.d.ts +0 -281
- package/dist/developer-experience/enhanced-types.d.ts.map +0 -1
- package/dist/developer-experience/index.d.ts +0 -44
- package/dist/developer-experience/index.d.ts.map +0 -1
- package/dist/index-Nfi2SBQh.js +0 -3268
- package/dist/modifiers/attributes.d.ts +0 -203
- package/dist/modifiers/attributes.d.ts.map +0 -1
- package/dist/modifiers/backdrop.d.ts +0 -59
- package/dist/modifiers/backdrop.d.ts.map +0 -1
- package/dist/modifiers/border.d.ts +0 -217
- package/dist/modifiers/border.d.ts.map +0 -1
- package/dist/modifiers/effects.d.ts +0 -159
- package/dist/modifiers/effects.d.ts.map +0 -1
- package/dist/modifiers/elements.d.ts +0 -240
- package/dist/modifiers/elements.d.ts.map +0 -1
- package/dist/modifiers/filters.d.ts +0 -275
- package/dist/modifiers/filters.d.ts.map +0 -1
- package/dist/modifiers/flexbox.d.ts +0 -82
- package/dist/modifiers/flexbox.d.ts.map +0 -1
- package/dist/modifiers/font.d.ts +0 -71
- package/dist/modifiers/font.d.ts.map +0 -1
- package/dist/modifiers/grid.d.ts +0 -92
- package/dist/modifiers/grid.d.ts.map +0 -1
- package/dist/modifiers/margin.d.ts +0 -128
- package/dist/modifiers/margin.d.ts.map +0 -1
- package/dist/modifiers/padding.d.ts +0 -204
- package/dist/modifiers/padding.d.ts.map +0 -1
- package/dist/modifiers/responsive/advanced-utilities.d.ts +0 -118
- package/dist/modifiers/responsive/advanced-utilities.d.ts.map +0 -1
- package/dist/modifiers/responsive/breakpoints.d.ts +0 -81
- package/dist/modifiers/responsive/breakpoints.d.ts.map +0 -1
- package/dist/modifiers/responsive/css-generator.d.ts +0 -100
- package/dist/modifiers/responsive/css-generator.d.ts.map +0 -1
- package/dist/modifiers/responsive/dev-tools.d.ts +0 -107
- package/dist/modifiers/responsive/dev-tools.d.ts.map +0 -1
- package/dist/modifiers/responsive/index.d.ts +0 -29
- package/dist/modifiers/responsive/index.d.ts.map +0 -1
- package/dist/modifiers/responsive/layout-patterns.d.ts +0 -230
- package/dist/modifiers/responsive/layout-patterns.d.ts.map +0 -1
- package/dist/modifiers/responsive/performance.d.ts +0 -130
- package/dist/modifiers/responsive/performance.d.ts.map +0 -1
- package/dist/modifiers/responsive/responsive-builder.d.ts +0 -133
- package/dist/modifiers/responsive/responsive-builder.d.ts.map +0 -1
- package/dist/modifiers/responsive/responsive-modifier.d.ts +0 -123
- package/dist/modifiers/responsive/responsive-modifier.d.ts.map +0 -1
- package/dist/modifiers/responsive/types.d.ts +0 -183
- package/dist/modifiers/responsive/types.d.ts.map +0 -1
- package/dist/modifiers/responsive/utilities.d.ts +0 -149
- package/dist/modifiers/responsive/utilities.d.ts.map +0 -1
- package/dist/modifiers/scroll.d.ts +0 -143
- package/dist/modifiers/scroll.d.ts.map +0 -1
- package/dist/modifiers/shadows.d.ts +0 -114
- package/dist/modifiers/shadows.d.ts.map +0 -1
- package/dist/modifiers/size.d.ts +0 -113
- package/dist/modifiers/size.d.ts.map +0 -1
- package/dist/modifiers/text.d.ts +0 -147
- package/dist/modifiers/text.d.ts.map +0 -1
- package/dist/modifiers/transformations.d.ts +0 -329
- package/dist/modifiers/transformations.d.ts.map +0 -1
- package/dist/modifiers/transitions.d.ts +0 -98
- package/dist/modifiers/transitions.d.ts.map +0 -1
- package/dist/modifiers/typography.d.ts +0 -192
- package/dist/modifiers/typography.d.ts.map +0 -1
- package/dist/modifiers/utility.d.ts +0 -69
- package/dist/modifiers/utility.d.ts.map +0 -1
- package/dist/modifiers/utils.d.ts.map +0 -1
- package/dist/plugins/simplified-error-handler.d.ts +0 -83
- package/dist/plugins/simplified-error-handler.d.ts.map +0 -1
- package/dist/runtime/dev-tools.d.ts +0 -240
- package/dist/runtime/dev-tools.d.ts.map +0 -1
- package/dist/runtime/development-warnings.d.ts +0 -42
- package/dist/runtime/development-warnings.d.ts.map +0 -1
- package/dist/runtime/error-boundary.d.ts +0 -302
- package/dist/runtime/error-boundary.d.ts.map +0 -1
- package/dist/runtime/error-recovery.d.ts +0 -267
- package/dist/runtime/error-recovery.d.ts.map +0 -1
- package/dist/runtime/error-reporting.d.ts +0 -287
- package/dist/runtime/error-reporting.d.ts.map +0 -1
- package/dist/runtime/error-utils.d.ts +0 -204
- package/dist/runtime/error-utils.d.ts.map +0 -1
- package/dist/runtime/performance.d.ts +0 -217
- package/dist/runtime/performance.d.ts.map +0 -1
- package/dist/sui-compat.d.ts +0 -110
- package/dist/sui-compat.d.ts.map +0 -1
- package/dist/validation/advanced-debugging.d.ts +0 -319
- package/dist/validation/advanced-debugging.d.ts.map +0 -1
- package/dist/validation/build-time/detection.d.ts +0 -32
- package/dist/validation/build-time/detection.d.ts.map +0 -1
- package/dist/validation/build-time/index.d.ts +0 -84
- package/dist/validation/build-time/index.d.ts.map +0 -1
- package/dist/validation/build-time/plugins.d.ts +0 -75
- package/dist/validation/build-time/plugins.d.ts.map +0 -1
- package/dist/validation/build-time/rules.d.ts +0 -73
- package/dist/validation/build-time/rules.d.ts.map +0 -1
- package/dist/validation/build-time/transformer.d.ts +0 -23
- package/dist/validation/build-time/transformer.d.ts.map +0 -1
- package/dist/validation/build-time/types.d.ts +0 -212
- package/dist/validation/build-time/types.d.ts.map +0 -1
- package/dist/validation/comprehensive.d.ts +0 -160
- package/dist/validation/comprehensive.d.ts.map +0 -1
- package/dist/validation/debug-tools.d.ts +0 -251
- package/dist/validation/debug-tools.d.ts.map +0 -1
- package/dist/validation/developer-experience.d.ts +0 -243
- package/dist/validation/developer-experience.d.ts.map +0 -1
- package/dist/validation/documentation-integration.d.ts +0 -269
- package/dist/validation/documentation-integration.d.ts.map +0 -1
- package/dist/validation/enhanced-runtime.d.ts +0 -279
- package/dist/validation/enhanced-runtime.d.ts.map +0 -1
- package/dist/validation/error-reporting.d.ts +0 -186
- package/dist/validation/error-reporting.d.ts.map +0 -1
- package/dist/validation/ide-integration.d.ts +0 -328
- package/dist/validation/ide-integration.d.ts.map +0 -1
- package/dist/validation/performance-optimizer.d.ts +0 -218
- package/dist/validation/performance-optimizer.d.ts.map +0 -1
- package/dist/validation/production-bypass.d.ts +0 -175
- package/dist/validation/production-bypass.d.ts.map +0 -1
- package/dist/validation/simple.d.ts +0 -111
- package/dist/validation/simple.d.ts.map +0 -1
- package/dist/viewport/adapters/web-adapter.d.ts +0 -227
- package/dist/viewport/adapters/web-adapter.d.ts.map +0 -1
- package/dist/viewport/components.d.ts +0 -131
- package/dist/viewport/components.d.ts.map +0 -1
- package/dist/viewport/environment.d.ts +0 -75
- package/dist/viewport/environment.d.ts.map +0 -1
- package/dist/viewport/index.d.ts +0 -138
- package/dist/viewport/index.d.ts.map +0 -1
- package/dist/viewport/index.js +0 -2085
- package/dist/viewport/platform-detection.d.ts +0 -59
- package/dist/viewport/platform-detection.d.ts.map +0 -1
- package/dist/viewport/types.d.ts +0 -301
- package/dist/viewport/types.d.ts.map +0 -1
- package/dist/viewport/viewport-manager.d.ts +0 -118
- package/dist/viewport/viewport-manager.d.ts.map +0 -1
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var a = Object.defineProperty, c = (t, e, i) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, o = (t, e, i) => c(t, e + "", i);
|
|
2
|
+
const r = class n {
|
|
3
|
+
static getInstance() {
|
|
4
|
+
return this.instance || (this.instance = new n()), this.instance;
|
|
5
|
+
}
|
|
6
|
+
configure(e) {
|
|
7
|
+
}
|
|
8
|
+
optimizeValidation(e, i) {
|
|
9
|
+
return i();
|
|
10
|
+
}
|
|
11
|
+
getMetrics(e) {
|
|
12
|
+
if (!e)
|
|
13
|
+
return /* @__PURE__ */ new Map();
|
|
14
|
+
}
|
|
15
|
+
resetMetrics() {
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
o(r, "instance");
|
|
19
|
+
let s = r;
|
|
20
|
+
s.getInstance();
|
|
21
|
+
const u = {
|
|
22
|
+
configure: (t) => {
|
|
23
|
+
},
|
|
24
|
+
getMetrics: (t) => t ? void 0 : /* @__PURE__ */ new Map(),
|
|
25
|
+
resetMetrics: () => {
|
|
26
|
+
},
|
|
27
|
+
getStats: () => ({
|
|
28
|
+
enabled: !1,
|
|
29
|
+
targetOverhead: 5,
|
|
30
|
+
batchSize: 10,
|
|
31
|
+
cacheStrategy: "moderate",
|
|
32
|
+
metricsCount: 0,
|
|
33
|
+
note: "Production stub - full implementation available in @tachui/devtools"
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
u as PerformanceOptimizationUtils
|
|
38
|
+
};
|