@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/README.md +20 -2
- 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 +6 -2
- package/dist/bundles/minimal.d.ts.map +1 -1
- package/dist/common.js +394 -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/essential.js +394 -393
- package/dist/{index-DCPJFUm9.js → index-DEBd8cq7.js} +315 -578
- package/dist/index.js +394 -393
- package/dist/minimal.js +112 -98
- package/dist/observed-object-Cos-FtjP.js +269 -0
- package/dist/plugin-BCAdZXKq.js +1680 -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/package.json +24 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ARIA Runtime Concatenation (Phase 2)
|
|
3
|
+
* Mid-level concatenation with essential accessibility support
|
|
4
|
+
* Includes ARIA labels and roles, but not full semantic analysis
|
|
5
|
+
*/
|
|
6
|
+
import type { ComponentInstance } from './types';
|
|
7
|
+
export interface ARIAConcatenationResult extends ComponentInstance {
|
|
8
|
+
type: 'component';
|
|
9
|
+
optimized: true;
|
|
10
|
+
concatenationType: 'aria';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates an optimized concatenation with ARIA accessibility support
|
|
14
|
+
*/
|
|
15
|
+
export declare function createOptimizedConcatenation(left: ComponentInstance, right: ComponentInstance, _level: 'aria'): ARIAConcatenationResult;
|
|
16
|
+
/**
|
|
17
|
+
* Analyzes accessibility requirements for concatenation
|
|
18
|
+
*/
|
|
19
|
+
export declare function analyzeAccessibilityRequirements(left: ComponentInstance, right: ComponentInstance): {
|
|
20
|
+
needsGroupRole: boolean;
|
|
21
|
+
needsLabeling: boolean;
|
|
22
|
+
conflictingRoles: boolean;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=concatenation-aria.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concatenation-aria.d.ts","sourceRoot":"","sources":["../../src/runtime/concatenation-aria.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,IAAI,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,GACb,uBAAuB,CA0DzB;AA8BD;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,iBAAiB,GACvB;IACD,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAYA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function p(e, n, r) {
|
|
2
|
+
return {
|
|
3
|
+
type: "component",
|
|
4
|
+
optimized: !0,
|
|
5
|
+
concatenationType: "aria",
|
|
6
|
+
id: `concat_aria_${e.id}_${n.id}`,
|
|
7
|
+
render: (() => {
|
|
8
|
+
const t = {
|
|
9
|
+
type: "element",
|
|
10
|
+
tag: "span",
|
|
11
|
+
props: {
|
|
12
|
+
className: "tachui-concat-aria",
|
|
13
|
+
role: "group",
|
|
14
|
+
"aria-label": "Combined content"
|
|
15
|
+
},
|
|
16
|
+
children: []
|
|
17
|
+
}, i = e.render(), c = n.render(), o = [];
|
|
18
|
+
return Array.isArray(i) ? o.push(...i) : o.push(i), Array.isArray(c) ? o.push(...c) : o.push(c), t.children = o, t;
|
|
19
|
+
}),
|
|
20
|
+
props: {
|
|
21
|
+
// Merge props with ARIA considerations
|
|
22
|
+
...e.props,
|
|
23
|
+
...n.props,
|
|
24
|
+
"aria-expanded": void 0,
|
|
25
|
+
// Reset conflicting ARIA props
|
|
26
|
+
"aria-selected": void 0
|
|
27
|
+
},
|
|
28
|
+
cleanup: [
|
|
29
|
+
() => {
|
|
30
|
+
e.cleanup?.forEach((t) => t()), n.cleanup?.forEach((t) => t());
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function s(e) {
|
|
36
|
+
return !!(e?.onClick || e?.onTap || e?.href || e?.disabled !== void 0 || e?.selected !== void 0);
|
|
37
|
+
}
|
|
38
|
+
function d(e) {
|
|
39
|
+
const n = e.props;
|
|
40
|
+
return n?.href ? "link" : n?.onClick || n?.onTap ? "button" : n?.selected !== void 0 ? "option" : "text";
|
|
41
|
+
}
|
|
42
|
+
function l(e, n) {
|
|
43
|
+
const r = s(e.props), a = s(n.props);
|
|
44
|
+
return {
|
|
45
|
+
needsGroupRole: r || a,
|
|
46
|
+
needsLabeling: r && a,
|
|
47
|
+
conflictingRoles: r && a && d(e) !== d(n)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
l as analyzeAccessibilityRequirements,
|
|
52
|
+
p as createOptimizedConcatenation
|
|
53
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full Runtime Concatenation (Phase 2)
|
|
3
|
+
* Complete concatenation with full accessibility, semantic analysis, and ARIA support
|
|
4
|
+
* Fallback for complex cases that can't be statically optimized
|
|
5
|
+
*/
|
|
6
|
+
import type { ComponentInstance } from './types';
|
|
7
|
+
export interface FullConcatenationResult extends ComponentInstance {
|
|
8
|
+
type: 'component';
|
|
9
|
+
optimized: true;
|
|
10
|
+
concatenationType: 'full';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates an optimized concatenation with full accessibility support
|
|
14
|
+
* Uses the existing ConcatenatedComponent but with optimized creation path
|
|
15
|
+
*/
|
|
16
|
+
export declare function createOptimizedConcatenation(left: ComponentInstance, right: ComponentInstance, _level: 'full'): FullConcatenationResult;
|
|
17
|
+
/**
|
|
18
|
+
* Provides fallback to existing concatenation system for unsupported cases
|
|
19
|
+
*/
|
|
20
|
+
export declare function fallbackToRuntimeConcatenation(left: ComponentInstance, right: ComponentInstance): ComponentInstance;
|
|
21
|
+
declare module '../concatenation/types' {
|
|
22
|
+
interface ConcatenationMetadata {
|
|
23
|
+
optimizationHints?: {
|
|
24
|
+
canFlatten: boolean;
|
|
25
|
+
needsGroupWrapper: boolean;
|
|
26
|
+
hasConflictingRoles: boolean;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=concatenation-full.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concatenation-full.d.ts","sourceRoot":"","sources":["../../src/runtime/concatenation-full.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,SAAS,CAAA;AAOhB,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,IAAI,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,GACb,uBAAuB,CA6DzB;AAsED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,iBAAiB,GACvB,iBAAiB,CAQnB;AAGD,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,qBAAqB;QAC7B,iBAAiB,CAAC,EAAE;YAClB,UAAU,EAAE,OAAO,CAAA;YACnB,iBAAiB,EAAE,OAAO,CAAA;YAC1B,mBAAmB,EAAE,OAAO,CAAA;SAC7B,CAAA;KACF;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function l(e, t, s) {
|
|
2
|
+
const a = {
|
|
3
|
+
id: e.id,
|
|
4
|
+
component: e,
|
|
5
|
+
modifiers: e.modifiers || [],
|
|
6
|
+
render: () => {
|
|
7
|
+
const n = e.render();
|
|
8
|
+
return Array.isArray(n) ? n[0] : n;
|
|
9
|
+
}
|
|
10
|
+
}, i = {
|
|
11
|
+
id: t.id,
|
|
12
|
+
component: t,
|
|
13
|
+
modifiers: t.modifiers || [],
|
|
14
|
+
render: () => {
|
|
15
|
+
const n = t.render();
|
|
16
|
+
return Array.isArray(n) ? n[0] : n;
|
|
17
|
+
}
|
|
18
|
+
}, o = u(e, t);
|
|
19
|
+
return {
|
|
20
|
+
type: "component",
|
|
21
|
+
id: `concat_full_${e.id}_${t.id}`,
|
|
22
|
+
mounted: !1,
|
|
23
|
+
optimized: !0,
|
|
24
|
+
concatenationType: "full",
|
|
25
|
+
render: (() => {
|
|
26
|
+
const n = e.render(), r = t.render();
|
|
27
|
+
return {
|
|
28
|
+
type: "element",
|
|
29
|
+
tag: "div",
|
|
30
|
+
props: { className: "tachui-concat-full" },
|
|
31
|
+
children: [
|
|
32
|
+
...Array.isArray(n) ? n : [n],
|
|
33
|
+
...Array.isArray(r) ? r : [r]
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
props: {
|
|
38
|
+
...e.props,
|
|
39
|
+
...t.props
|
|
40
|
+
},
|
|
41
|
+
cleanup: [
|
|
42
|
+
() => {
|
|
43
|
+
e.cleanup?.forEach((n) => n()), t.cleanup?.forEach((n) => n());
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
segments: [a, i],
|
|
47
|
+
metadata: o
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function u(e, t) {
|
|
51
|
+
const s = c(e), a = c(t), i = d(e), o = d(t);
|
|
52
|
+
let n, r;
|
|
53
|
+
return s && a ? (n = "text", r = "inline") : i || o ? (n = "composite", r = i && o ? "block" : "inline") : (n = "group", r = "inline"), {
|
|
54
|
+
totalSegments: 2,
|
|
55
|
+
accessibilityRole: n,
|
|
56
|
+
semanticStructure: r,
|
|
57
|
+
// Add optimization hints
|
|
58
|
+
optimizationHints: {
|
|
59
|
+
canFlatten: s && a,
|
|
60
|
+
needsGroupWrapper: i || o,
|
|
61
|
+
hasConflictingRoles: i && o
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function c(e) {
|
|
66
|
+
return !!(e.id?.includes("text") || e.props?.textContent || e.textContent);
|
|
67
|
+
}
|
|
68
|
+
function d(e) {
|
|
69
|
+
return !!(e.props?.onClick || e.props?.onTap || e.props?.href || e.interactive || e.id?.includes("button") || e.id?.includes("link"));
|
|
70
|
+
}
|
|
71
|
+
function m(e, t) {
|
|
72
|
+
return typeof e.concat == "function" ? e.concat(t) : l(e, t);
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
l as createOptimizedConcatenation,
|
|
76
|
+
m as fallbackToRuntimeConcatenation
|
|
77
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Runtime Concatenation (Phase 2)
|
|
3
|
+
* Ultra-lightweight concatenation for simple text-only components
|
|
4
|
+
* No ARIA support, no complex accessibility - just DOM manipulation
|
|
5
|
+
*/
|
|
6
|
+
import type { ComponentInstance } from './types';
|
|
7
|
+
export interface MinimalConcatenationResult extends ComponentInstance {
|
|
8
|
+
type: 'component';
|
|
9
|
+
optimized: true;
|
|
10
|
+
concatenationType: 'minimal';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates an optimized concatenation with minimal overhead
|
|
14
|
+
* Eliminates the ConcatenatedComponent runtime system for static cases
|
|
15
|
+
*/
|
|
16
|
+
export declare function createOptimizedConcatenation(left: ComponentInstance, right: ComponentInstance, _level: 'minimal'): MinimalConcatenationResult;
|
|
17
|
+
/**
|
|
18
|
+
* Static concatenation analyzer - determines if concatenation can be pre-computed
|
|
19
|
+
*/
|
|
20
|
+
export declare function canOptimizeStatically(leftComponent: string, rightComponent: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Pre-computes static concatenation at build time
|
|
23
|
+
*/
|
|
24
|
+
export declare function precomputeStaticConcatenation(leftComponent: string, rightComponent: string): string;
|
|
25
|
+
//# sourceMappingURL=concatenation-minimal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concatenation-minimal.d.ts","sourceRoot":"","sources":["../../src/runtime/concatenation-minimal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACnE,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,IAAI,CAAA;IACf,iBAAiB,EAAE,SAAS,CAAA;CAC7B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,SAAS,GAChB,0BAA0B,CAqD5B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACrB,OAAO,CAOT;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACrB,MAAM,CAWR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function s(e, t, c) {
|
|
2
|
+
return {
|
|
3
|
+
type: "component",
|
|
4
|
+
optimized: !0,
|
|
5
|
+
concatenationType: "minimal",
|
|
6
|
+
id: `concat_${e.id}_${t.id}`,
|
|
7
|
+
render: (() => {
|
|
8
|
+
const n = {
|
|
9
|
+
type: "element",
|
|
10
|
+
tag: "span",
|
|
11
|
+
props: { className: "tachui-concat-minimal" },
|
|
12
|
+
children: []
|
|
13
|
+
}, r = e.render(), o = t.render(), a = [];
|
|
14
|
+
return Array.isArray(r) ? a.push(...r) : a.push(r), Array.isArray(o) ? a.push(...o) : a.push(o), n.children = a, n;
|
|
15
|
+
}),
|
|
16
|
+
props: {
|
|
17
|
+
// Merge props from both components (simplified)
|
|
18
|
+
...e.props,
|
|
19
|
+
...t.props
|
|
20
|
+
},
|
|
21
|
+
cleanup: [
|
|
22
|
+
() => {
|
|
23
|
+
e.cleanup?.forEach((n) => n()), t.cleanup?.forEach((n) => n());
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function p(e, t) {
|
|
29
|
+
const c = /^Text\s*\(\s*["']([^"']+)["']\s*\)/;
|
|
30
|
+
return c.test(e) && c.test(t);
|
|
31
|
+
}
|
|
32
|
+
function d(e, t) {
|
|
33
|
+
const c = e.match(/^Text\s*\(\s*["']([^"']+)["']\s*\)/), i = t.match(/^Text\s*\(\s*["']([^"']+)["']\s*\)/);
|
|
34
|
+
return c && i ? `Text("${c[1] + i[1]}")` : `createOptimizedConcatenation(${e}.build(), ${t}.build(), 'minimal')`;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
p as canOptimizeStatically,
|
|
38
|
+
s as createOptimizedConcatenation,
|
|
39
|
+
d as precomputeStaticConcatenation
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachui/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-alpha",
|
|
4
4
|
"description": "tachUI core framework with reactive system and compiler",
|
|
5
5
|
"homepage": "https://tachui.dev/",
|
|
6
6
|
"type": "module",
|
|
@@ -60,6 +60,18 @@
|
|
|
60
60
|
"types": "./dist/runtime/types.d.ts",
|
|
61
61
|
"import": "./dist/runtime/types.js"
|
|
62
62
|
},
|
|
63
|
+
"./runtime/concatenation-minimal": {
|
|
64
|
+
"types": "./dist/runtime/concatenation-minimal.d.ts",
|
|
65
|
+
"import": "./dist/runtime/concatenation-minimal.js"
|
|
66
|
+
},
|
|
67
|
+
"./runtime/concatenation-aria": {
|
|
68
|
+
"types": "./dist/runtime/concatenation-aria.d.ts",
|
|
69
|
+
"import": "./dist/runtime/concatenation-aria.js"
|
|
70
|
+
},
|
|
71
|
+
"./runtime/concatenation-full": {
|
|
72
|
+
"types": "./dist/runtime/concatenation-full.d.ts",
|
|
73
|
+
"import": "./dist/runtime/concatenation-full.js"
|
|
74
|
+
},
|
|
63
75
|
"./reactive/types": {
|
|
64
76
|
"types": "./dist/reactive/types.d.ts",
|
|
65
77
|
"import": "./dist/reactive/types.js"
|
|
@@ -83,15 +95,23 @@
|
|
|
83
95
|
"./viewport": {
|
|
84
96
|
"types": "./dist/viewport/index.d.ts",
|
|
85
97
|
"import": "./dist/viewport/index.js"
|
|
98
|
+
},
|
|
99
|
+
"./assets": {
|
|
100
|
+
"types": "./dist/bundles/assets.d.ts",
|
|
101
|
+
"import": "./dist/bundles/assets.js"
|
|
102
|
+
},
|
|
103
|
+
"./context": {
|
|
104
|
+
"types": "./dist/bundles/context.d.ts",
|
|
105
|
+
"import": "./dist/bundles/context.js"
|
|
86
106
|
}
|
|
87
107
|
},
|
|
88
108
|
"files": [
|
|
89
109
|
"dist"
|
|
90
110
|
],
|
|
91
111
|
"dependencies": {
|
|
92
|
-
"@tachui/devtools": "0.8.
|
|
93
|
-
"@tachui/primitives": "0.8.
|
|
94
|
-
"@tachui/modifiers": "0.8.
|
|
112
|
+
"@tachui/devtools": "0.8.1-alpha",
|
|
113
|
+
"@tachui/primitives": "0.8.1-alpha",
|
|
114
|
+
"@tachui/modifiers": "0.8.1-alpha"
|
|
95
115
|
},
|
|
96
116
|
"devDependencies": {
|
|
97
117
|
"@types/node": "^20.0.0",
|