@ankhorage/zora 21.0.8 → 21.0.10
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.d.ts +4 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js +171 -85
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js.map +1 -1
- package/dist/features/tabs/adapters/inbound/TabList.js +3 -3
- package/dist/features/tabs/adapters/inbound/TabList.js.map +1 -1
- package/dist/features/tabs/tabListMeta.d.ts +8 -1
- package/dist/features/tabs/tabListMeta.d.ts.map +1 -1
- package/dist/features/tabs/tabListMeta.js +3 -1
- package/dist/features/tabs/tabListMeta.js.map +1 -1
- package/dist/types/tabs.d.ts +3 -7
- package/dist/types/tabs.d.ts.map +1 -1
- package/dist/types/tabs.js.map +1 -1
- package/package.json +2 -2
- package/src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.test.ts +60 -25
- package/src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts +243 -93
- package/src/features/tabs/adapters/inbound/TabList.tsx +3 -4
- package/src/features/tabs/adapters/inbound/Tabs.layout.test.tsx +33 -0
- package/src/features/tabs/tabListMeta.ts +3 -1
- package/src/types/tabs.ts +5 -7
- package/web-dist/chunks/{Accordion-aj6fsjhv.js → Accordion-j4d58grp.js} +62 -37
- package/web-dist/components/graph-view/GraphView.js +189 -72
- package/web-dist/components/tab/Tab.js +1 -1
- package/web-dist/components/tab-list/TabList.js +1 -1
- package/web-dist/components/tab-panel/TabPanel.js +1 -1
- package/web-dist/components/tabs/Tabs.js +1 -1
- package/web-dist/manifest.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 21.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ebb74d7: Expose Surface-owned equal-width tab filling and trailing tab content through the canonical ZORA Tabs boundary.
|
|
8
|
+
|
|
9
|
+
## 21.0.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0d84538: Compact GraphView spacing around renderer-measured label readability bounds while preserving compound group separation.
|
|
14
|
+
|
|
3
15
|
## 21.0.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/zora
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
|
|
9
9
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Core } from 'cytoscape';
|
|
2
2
|
/***
|
|
3
|
-
* Optimize settled layout spacing
|
|
4
|
-
* Compound containment
|
|
5
|
-
* @performance
|
|
6
|
-
*
|
|
7
|
-
* non-uniformly overlapping views retain their original positions.
|
|
3
|
+
* Optimize settled layout spacing around readable label bounds instead of full node clearance.
|
|
4
|
+
* Compound containment stays intentional while sibling groups retain non-overlapping boundaries.
|
|
5
|
+
* @performance Cytoscape geometry is measured once, then bounded pure numeric trials reuse the
|
|
6
|
+
* immutable snapshot. No layout reruns, zoom work, or intermediate frames are painted.
|
|
8
7
|
*/
|
|
9
8
|
export declare function compactGraphSpacing(cy: Core, spacingFactor: number): number;
|
|
10
9
|
//# sourceMappingURL=compactGraphSpacing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compactGraphSpacing.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compactGraphSpacing.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAgB,MAAM,WAAW,CAAC;AAQpD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAiC3E"}
|
|
@@ -1,68 +1,185 @@
|
|
|
1
|
+
import { findMinimumAcceptedNumber } from '@ankhorage/utility/algorithms';
|
|
2
|
+
const LABEL_OVERLAP_RATIO = 0.12;
|
|
3
|
+
const MAX_EXPANSION_ATTEMPTS = 8;
|
|
4
|
+
const MAX_NODE_COUNT = 2000;
|
|
5
|
+
const MAX_PAIR_CHECKS = 200000;
|
|
6
|
+
const SEARCH_ITERATIONS = 8;
|
|
1
7
|
/***
|
|
2
|
-
* Optimize settled layout spacing
|
|
3
|
-
* Compound containment
|
|
4
|
-
* @performance
|
|
5
|
-
*
|
|
6
|
-
* non-uniformly overlapping views retain their original positions.
|
|
8
|
+
* Optimize settled layout spacing around readable label bounds instead of full node clearance.
|
|
9
|
+
* Compound containment stays intentional while sibling groups retain non-overlapping boundaries.
|
|
10
|
+
* @performance Cytoscape geometry is measured once, then bounded pure numeric trials reuse the
|
|
11
|
+
* immutable snapshot. No layout reruns, zoom work, or intermediate frames are painted.
|
|
7
12
|
*/
|
|
8
13
|
export function compactGraphSpacing(cy, spacingFactor) {
|
|
9
14
|
const leaves = cy.nodes(':childless');
|
|
10
|
-
if (leaves.length < 2 || cy.nodes().length >
|
|
15
|
+
if (leaves.length < 2 || cy.nodes().length > MAX_NODE_COUNT || cy.nodes(':locked').length > 0)
|
|
11
16
|
return spacingFactor;
|
|
12
|
-
const ancestors = new Map(cy.nodes().map((node) => [node.id(), new Set(node.ancestors().map((parent) => parent.id()))]));
|
|
13
|
-
const positions = new Map(leaves.map((node) => [node.id(), { ...node.position() }]));
|
|
14
17
|
const bounds = leaves.boundingBox();
|
|
15
18
|
const center = { x: (bounds.x1 + bounds.x2) / 2, y: (bounds.y1 + bounds.y2) / 2 };
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const leafGeometry = leaves.map(readLeafGeometry);
|
|
20
|
+
const groups = cy.nodes(':parent').map((node) => readGroupGeometry(node.id(), node.ancestors().map((parent) => parent.id()), node.boundingBox(), leafGeometry));
|
|
21
|
+
const accepts = (factor) => !hasUnsafeCollisions(resolveCollisionBoxes(leafGeometry, groups, center, factor));
|
|
22
|
+
const currentAccepted = accepts(1);
|
|
23
|
+
const minimum = currentAccepted ? Math.min(1, 0.1 / spacingFactor) : 1;
|
|
24
|
+
const maximum = currentAccepted ? 1 : findExpansionMaximum(accepts);
|
|
25
|
+
if (maximum === undefined)
|
|
26
|
+
return spacingFactor;
|
|
27
|
+
const factor = findMinimumAcceptedNumber({
|
|
28
|
+
minimum,
|
|
29
|
+
maximum,
|
|
30
|
+
iterations: SEARCH_ITERATIONS,
|
|
31
|
+
accepts,
|
|
32
|
+
});
|
|
33
|
+
if (factor === undefined)
|
|
34
|
+
return spacingFactor;
|
|
35
|
+
applyScale(cy, leafGeometry, center, factor);
|
|
36
|
+
return spacingFactor * factor;
|
|
19
37
|
}
|
|
20
|
-
/***
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
38
|
+
/*** Read one leaf's immutable position, hierarchy and renderer-measured label geometry. */
|
|
39
|
+
function readLeafGeometry(node) {
|
|
40
|
+
const nodeBox = node.boundingBox({
|
|
41
|
+
includeLabels: true,
|
|
42
|
+
includeOverlays: false,
|
|
43
|
+
includeUnderlays: false,
|
|
44
|
+
});
|
|
45
|
+
const labelBox = node.boundingBox({
|
|
46
|
+
includeNodes: false,
|
|
47
|
+
includeEdges: false,
|
|
48
|
+
includeLabels: true,
|
|
49
|
+
includeOverlays: false,
|
|
50
|
+
includeUnderlays: false,
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
id: node.id(),
|
|
54
|
+
ancestors: new Set(node.ancestors().map((parent) => parent.id())),
|
|
55
|
+
position: { ...node.position() },
|
|
56
|
+
labelBox: isUsableBox(labelBox) ? labelBox : nodeBox,
|
|
57
|
+
nodeBox,
|
|
58
|
+
};
|
|
35
59
|
}
|
|
36
|
-
/***
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
/*** Capture one compound group's descendant geometry and constant renderer-owned outer insets. */
|
|
61
|
+
function readGroupGeometry(id, ancestorIds, parentBox, leaves) {
|
|
62
|
+
const descendants = leaves.filter((leaf) => leaf.ancestors.has(id));
|
|
63
|
+
const descendantUnion = unionBounds(descendants.map((leaf) => leaf.nodeBox)) ?? parentBox;
|
|
64
|
+
return {
|
|
65
|
+
id,
|
|
66
|
+
ancestors: new Set(ancestorIds),
|
|
67
|
+
descendants,
|
|
68
|
+
insets: {
|
|
69
|
+
left: Math.max(0, descendantUnion.x1 - parentBox.x1),
|
|
70
|
+
right: Math.max(0, parentBox.x2 - descendantUnion.x2),
|
|
71
|
+
top: Math.max(0, descendantUnion.y1 - parentBox.y1),
|
|
72
|
+
bottom: Math.max(0, parentBox.y2 - descendantUnion.y2),
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/*** Resolve immutable label and compound boxes for one candidate uniform spacing factor. */
|
|
77
|
+
function resolveCollisionBoxes(leaves, groups, center, factor) {
|
|
78
|
+
const labels = leaves.map((leaf) => ({
|
|
79
|
+
id: leaf.id,
|
|
80
|
+
ancestors: leaf.ancestors,
|
|
81
|
+
kind: 'label',
|
|
82
|
+
box: shiftBounds(leaf.labelBox, leaf.position, center, factor),
|
|
83
|
+
}));
|
|
84
|
+
const compoundBoxes = groups.flatMap((group) => {
|
|
85
|
+
const descendants = group.descendants.map((leaf) => shiftBounds(leaf.nodeBox, leaf.position, center, factor));
|
|
86
|
+
const union = unionBounds(descendants);
|
|
87
|
+
if (!union)
|
|
88
|
+
return [];
|
|
89
|
+
return [
|
|
90
|
+
{
|
|
91
|
+
id: group.id,
|
|
92
|
+
ancestors: group.ancestors,
|
|
93
|
+
kind: 'group',
|
|
94
|
+
box: expandBounds(union, group.insets),
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
});
|
|
98
|
+
return [...labels, ...compoundBoxes];
|
|
99
|
+
}
|
|
100
|
+
/*** Find the first bounded expansion factor that makes the pure geometry snapshot acceptable. */
|
|
101
|
+
function findExpansionMaximum(accepts) {
|
|
102
|
+
return Array.from({ length: MAX_EXPANSION_ATTEMPTS }, (_, index) => 2 ** (index + 1)).find(accepts);
|
|
103
|
+
}
|
|
104
|
+
/***
|
|
105
|
+
* Sweep resolved boxes by x extent and stop conservatively if the pair-check budget is exhausted.
|
|
106
|
+
* Local loop counters are intentionally mutable on this performance-critical boundary.
|
|
107
|
+
*/
|
|
108
|
+
function hasUnsafeCollisions(boxes) {
|
|
109
|
+
const sorted = [...boxes].sort((first, second) => first.box.x1 - second.box.x1);
|
|
110
|
+
const budget = { remaining: MAX_PAIR_CHECKS };
|
|
111
|
+
for (const [index, first] of sorted.entries()) {
|
|
112
|
+
for (let next = index + 1; next < sorted.length; next += 1) {
|
|
113
|
+
const second = sorted.at(next);
|
|
114
|
+
if (!second)
|
|
115
|
+
break;
|
|
116
|
+
if (second.box.x1 >= first.box.x2)
|
|
117
|
+
break;
|
|
118
|
+
budget.remaining -= 1;
|
|
119
|
+
if (budget.remaining < 0)
|
|
120
|
+
return true;
|
|
121
|
+
if (isIntentionalContainment(first, second))
|
|
122
|
+
continue;
|
|
123
|
+
if (isUnsafeOverlap(first, second))
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
60
126
|
}
|
|
61
|
-
|
|
62
|
-
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
/*** Ignore intentional compound containment while retaining sibling and unrelated separation. */
|
|
130
|
+
function isIntentionalContainment(first, second) {
|
|
131
|
+
return first.ancestors.has(second.id) || second.ancestors.has(first.id);
|
|
132
|
+
}
|
|
133
|
+
/*** Permit only a small bounded label-label overlap; every other intersection remains unsafe. */
|
|
134
|
+
function isUnsafeOverlap(first, second) {
|
|
135
|
+
const overlapWidth = Math.min(first.box.x2, second.box.x2) - Math.max(first.box.x1, second.box.x1);
|
|
136
|
+
const overlapHeight = Math.min(first.box.y2, second.box.y2) - Math.max(first.box.y1, second.box.y1);
|
|
137
|
+
if (overlapWidth <= 0 || overlapHeight <= 0)
|
|
138
|
+
return false;
|
|
139
|
+
if (first.kind !== 'label' || second.kind !== 'label')
|
|
140
|
+
return true;
|
|
141
|
+
const widthRatio = overlapWidth / Math.min(first.box.w, second.box.w);
|
|
142
|
+
const heightRatio = overlapHeight / Math.min(first.box.h, second.box.h);
|
|
143
|
+
return widthRatio > LABEL_OVERLAP_RATIO && heightRatio > LABEL_OVERLAP_RATIO;
|
|
63
144
|
}
|
|
64
|
-
/***
|
|
65
|
-
function
|
|
145
|
+
/*** Shift one fixed renderer box with its leaf center under uniform radial scaling. */
|
|
146
|
+
function shiftBounds(box, position, center, factor) {
|
|
147
|
+
const dx = (position.x - center.x) * (factor - 1);
|
|
148
|
+
const dy = (position.y - center.y) * (factor - 1);
|
|
149
|
+
return {
|
|
150
|
+
x1: box.x1 + dx,
|
|
151
|
+
y1: box.y1 + dy,
|
|
152
|
+
x2: box.x2 + dx,
|
|
153
|
+
y2: box.y2 + dy,
|
|
154
|
+
w: box.w,
|
|
155
|
+
h: box.h,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/*** Expand a descendant union by the compound renderer's measured outer insets. */
|
|
159
|
+
function expandBounds(box, insets) {
|
|
160
|
+
const x1 = box.x1 - insets.left;
|
|
161
|
+
const y1 = box.y1 - insets.top;
|
|
162
|
+
const x2 = box.x2 + insets.right;
|
|
163
|
+
const y2 = box.y2 + insets.bottom;
|
|
164
|
+
return { x1, y1, x2, y2, w: x2 - x1, h: y2 - y1 };
|
|
165
|
+
}
|
|
166
|
+
/*** Return the immutable union of measured boxes, or undefined for an empty collection. */
|
|
167
|
+
function unionBounds(boxes) {
|
|
168
|
+
if (boxes.length === 0)
|
|
169
|
+
return undefined;
|
|
170
|
+
const x1 = Math.min(...boxes.map((box) => box.x1));
|
|
171
|
+
const y1 = Math.min(...boxes.map((box) => box.y1));
|
|
172
|
+
const x2 = Math.max(...boxes.map((box) => box.x2));
|
|
173
|
+
const y2 = Math.max(...boxes.map((box) => box.y2));
|
|
174
|
+
return { x1, y1, x2, y2, w: x2 - x1, h: y2 - y1 };
|
|
175
|
+
}
|
|
176
|
+
/*** Return whether renderer measurement produced a non-empty label box. */
|
|
177
|
+
function isUsableBox(box) {
|
|
178
|
+
return box.w > 0 && box.h > 0;
|
|
179
|
+
}
|
|
180
|
+
/*** Apply the accepted factor once, preserving node dimensions, hierarchy, ordering and edge data. */
|
|
181
|
+
function applyScale(cy, leaves, center, factor) {
|
|
182
|
+
const positions = new Map(leaves.map((leaf) => [leaf.id, leaf.position]));
|
|
66
183
|
cy.batch(() => {
|
|
67
184
|
cy.nodes()
|
|
68
185
|
.not(':parent')
|
|
@@ -75,35 +192,4 @@ function applyScale(cy, positions, center, factor) {
|
|
|
75
192
|
});
|
|
76
193
|
});
|
|
77
194
|
}
|
|
78
|
-
/*** Sweep measured bounds, ignoring intentional containment and stopping conservatively at budget. */
|
|
79
|
-
function hasCollisions(cy, ancestors) {
|
|
80
|
-
const boxes = cy
|
|
81
|
-
.nodes()
|
|
82
|
-
.map((node) => ({
|
|
83
|
-
id: node.id(),
|
|
84
|
-
box: node.boundingBox({
|
|
85
|
-
includeLabels: true,
|
|
86
|
-
includeOverlays: false,
|
|
87
|
-
includeUnderlays: false,
|
|
88
|
-
}),
|
|
89
|
-
}))
|
|
90
|
-
.sort((a, b) => a.box.x1 - b.box.x1);
|
|
91
|
-
const budget = { remaining: 200000 };
|
|
92
|
-
for (const [index, first] of boxes.entries()) {
|
|
93
|
-
for (let next = index + 1; next < boxes.length; next += 1) {
|
|
94
|
-
const second = boxes.at(next);
|
|
95
|
-
if (!second)
|
|
96
|
-
break;
|
|
97
|
-
if (second.box.x1 >= first.box.x2 + 8)
|
|
98
|
-
break;
|
|
99
|
-
if (--budget.remaining < 0)
|
|
100
|
-
return true;
|
|
101
|
-
if (ancestors.get(first.id)?.has(second.id) || ancestors.get(second.id)?.has(first.id))
|
|
102
|
-
continue;
|
|
103
|
-
if (first.box.y1 < second.box.y2 + 8 && second.box.y1 < first.box.y2 + 8)
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
195
|
//# sourceMappingURL=compactGraphSpacing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compactGraphSpacing.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAQ,EAAE,aAAqB;IACjE,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;QACtF,OAAO,aAAa,CAAC;IACvB,MAAM,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,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpF,SAAS;YACX,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;QACxF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { Core } from 'cytoscape';\n\n/***\n * Optimize settled layout spacing uniformly until measured node and label bounds clear.\n * Compound containment is intentional; sibling and unrelated compound intersections are not.\n * @performance At most eight synchronous trials and 200,000 pair checks per trial. No layout\n * algorithm reruns, no work on zoom, and no intermediate frame is painted. Large, locked, or\n * non-uniformly overlapping views retain their original positions.\n */\nexport function compactGraphSpacing(cy: Core, spacingFactor: number): number {\n const leaves = cy.nodes(':childless');\n if (leaves.length < 2 || cy.nodes().length > 2000 || leaves.filter(':locked').length > 0)\n return spacingFactor;\n const ancestors = new Map(\n cy.nodes().map((node) => [node.id(), new Set(node.ancestors().map((parent) => parent.id()))]),\n );\n const positions = new Map(leaves.map((node) => [node.id(), { ...node.position() }]));\n const bounds = leaves.boundingBox();\n const center = { x: (bounds.x1 + bounds.x2) / 2, y: (bounds.y1 + bounds.y2) / 2 };\n if (hasCollisions(cy, ancestors))\n return expandGraphSpacing(cy, ancestors, center, positions, spacingFactor);\n return compressGraphSpacing(cy, ancestors, center, positions, spacingFactor);\n}\n\n/*** Compress a collision-free settled layout to its smallest measured clearance. */\nfunction compressGraphSpacing(\n cy: Core,\n ancestors: ReadonlyMap<string, ReadonlySet<string>>,\n center: { x: number; y: number },\n positions: ReadonlyMap<string, { x: number; y: number }>,\n spacingFactor: number,\n): number {\n const search = { low: Math.min(1, 0.1 / spacingFactor), high: 1 };\n for (const attempt of Array.from({ length: 8 }, (_, index) => index)) {\n const factor = attempt === 0 ? search.low : (search.low + search.high) / 2;\n applyScale(cy, positions, center, factor);\n if (hasCollisions(cy, ancestors)) search.low = factor;\n else search.high = factor;\n if (search.high === search.low) break;\n }\n applyScale(cy, positions, center, search.high);\n return spacingFactor * search.high;\n}\n\n/*** Expand a uniformly cramped layout until measured node and label bounds clear. */\nfunction expandGraphSpacing(\n cy: Core,\n ancestors: ReadonlyMap<string, ReadonlySet<string>>,\n center: { x: number; y: number },\n positions: ReadonlyMap<string, { x: number; y: number }>,\n spacingFactor: number,\n): number {\n let low = 1;\n let high = 1;\n let attempts = 0;\n while (attempts < 8) {\n high *= 2;\n attempts += 1;\n applyScale(cy, positions, center, high);\n if (!hasCollisions(cy, ancestors)) break;\n low = high;\n }\n if (hasCollisions(cy, ancestors)) {\n applyScale(cy, positions, center, 1);\n return spacingFactor;\n }\n for (const _attempt of Array.from({ length: 8 - attempts }, (_, index) => index)) {\n const factor = (low + high) / 2;\n applyScale(cy, positions, center, factor);\n if (hasCollisions(cy, ancestors)) low = factor;\n else high = factor;\n }\n applyScale(cy, positions, center, high);\n return spacingFactor * high;\n}\n\n/*** Transform leaf centers, preserving ordering, dimensions, compound membership and edge data. */\nfunction applyScale(\n cy: Core,\n positions: ReadonlyMap<string, { x: number; y: number }>,\n center: { x: number; y: number },\n factor: number,\n) {\n cy.batch(() => {\n cy.nodes()\n .not(':parent')\n .positions((node) => {\n const original = positions.get(node.id()) ?? node.position();\n return {\n x: center.x + (original.x - center.x) * factor,\n y: center.y + (original.y - center.y) * factor,\n };\n });\n });\n}\n\n/*** Sweep measured bounds, ignoring intentional containment and stopping conservatively at budget. */\nfunction hasCollisions(cy: Core, ancestors: ReadonlyMap<string, ReadonlySet<string>>): boolean {\n const boxes = cy\n .nodes()\n .map((node) => ({\n id: node.id(),\n box: node.boundingBox({\n includeLabels: true,\n includeOverlays: false,\n includeUnderlays: false,\n }),\n }))\n .sort((a, b) => a.box.x1 - b.box.x1);\n const budget = { remaining: 200000 };\n for (const [index, first] of boxes.entries()) {\n for (let next = index + 1; next < boxes.length; next += 1) {\n const second = boxes.at(next);\n if (!second) break;\n if (second.box.x1 >= first.box.x2 + 8) break;\n if (--budget.remaining < 0) return true;\n if (ancestors.get(first.id)?.has(second.id) || ancestors.get(second.id)?.has(first.id))\n continue;\n if (first.box.y1 < second.box.y2 + 8 && second.box.y1 < first.box.y2 + 8) return true;\n }\n }\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compactGraphSpacing.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAQ,EAAE,aAAqB;IACjE,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,cAAc,IAAI,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;QAC3F,OAAO,aAAa,CAAC;IAEvB,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,M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G;AACtG,SAAS,UAAU,CACjB,EAAQ,EACR,MAA+B,EAC/B,MAAa,EACb,MAAc;IAEd,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1E,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;QACZ,EAAE,CAAC,KAAK,EAAE;aACP,GAAG,CAAC,SAAS,CAAC;aACd,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7D,OAAO;gBACL,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM;gBAC9C,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM;aAC/C,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { findMinimumAcceptedNumber } from '@ankhorage/utility/algorithms';\nimport type { Core, NodeSingular } from 'cytoscape';\n\nconst LABEL_OVERLAP_RATIO = 0.12;\nconst MAX_EXPANSION_ATTEMPTS = 8;\nconst MAX_NODE_COUNT = 2000;\nconst MAX_PAIR_CHECKS = 200000;\nconst SEARCH_ITERATIONS = 8;\n\n/***\n * Optimize settled layout spacing around readable label bounds instead of full node clearance.\n * Compound containment stays intentional while sibling groups retain non-overlapping boundaries.\n * @performance Cytoscape geometry is measured once, then bounded pure numeric trials reuse the\n * immutable snapshot. No layout reruns, zoom work, or intermediate frames are painted.\n */\nexport function compactGraphSpacing(cy: Core, spacingFactor: number): number {\n const leaves = cy.nodes(':childless');\n if (leaves.length < 2 || cy.nodes().length > MAX_NODE_COUNT || cy.nodes(':locked').length > 0)\n return spacingFactor;\n\n const bounds = leaves.boundingBox();\n const center = { x: (bounds.x1 + bounds.x2) / 2, y: (bounds.y1 + bounds.y2) / 2 };\n const leafGeometry = leaves.map(readLeafGeometry);\n const groups = cy.nodes(':parent').map((node) =>\n readGroupGeometry(\n node.id(),\n node.ancestors().map((parent) => parent.id()),\n node.boundingBox(),\n leafGeometry,\n ),\n );\n const accepts = (factor: number) =>\n !hasUnsafeCollisions(resolveCollisionBoxes(leafGeometry, groups, center, factor));\n const currentAccepted = accepts(1);\n const minimum = currentAccepted ? Math.min(1, 0.1 / spacingFactor) : 1;\n const maximum = currentAccepted ? 1 : findExpansionMaximum(accepts);\n if (maximum === undefined) return spacingFactor;\n\n const factor = findMinimumAcceptedNumber({\n minimum,\n maximum,\n iterations: SEARCH_ITERATIONS,\n accepts,\n });\n if (factor === undefined) return spacingFactor;\n\n applyScale(cy, leafGeometry, center, factor);\n return spacingFactor * factor;\n}\n\ninterface Point {\n readonly x: number;\n readonly y: number;\n}\n\ninterface Bounds {\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n readonly w: number;\n readonly h: number;\n}\n\ninterface Insets {\n readonly left: number;\n readonly right: number;\n readonly top: number;\n readonly bottom: number;\n}\n\ninterface LeafGeometry {\n readonly id: string;\n readonly ancestors: ReadonlySet<string>;\n readonly position: Point;\n readonly labelBox: Bounds;\n readonly nodeBox: Bounds;\n}\n\ninterface GroupGeometry {\n readonly id: string;\n readonly ancestors: ReadonlySet<string>;\n readonly descendants: readonly LeafGeometry[];\n readonly insets: Insets;\n}\n\ninterface CollisionBox {\n readonly id: string;\n readonly ancestors: ReadonlySet<string>;\n readonly kind: 'label' | 'group';\n readonly box: Bounds;\n}\n\n/*** Read one leaf's immutable position, hierarchy and renderer-measured label geometry. */\nfunction readLeafGeometry(node: NodeSingular): LeafGeometry {\n const nodeBox = node.boundingBox({\n includeLabels: true,\n includeOverlays: false,\n includeUnderlays: false,\n });\n const labelBox = node.boundingBox({\n includeNodes: false,\n includeEdges: false,\n includeLabels: true,\n includeOverlays: false,\n includeUnderlays: false,\n });\n return {\n id: node.id(),\n ancestors: new Set(node.ancestors().map((parent) => parent.id())),\n position: { ...node.position() },\n labelBox: isUsableBox(labelBox) ? labelBox : nodeBox,\n nodeBox,\n };\n}\n\n/*** Capture one compound group's descendant geometry and constant renderer-owned outer insets. */\nfunction readGroupGeometry(\n id: string,\n ancestorIds: readonly string[],\n parentBox: Bounds,\n leaves: readonly LeafGeometry[],\n): GroupGeometry {\n const descendants = leaves.filter((leaf) => leaf.ancestors.has(id));\n const descendantUnion = unionBounds(descendants.map((leaf) => leaf.nodeBox)) ?? parentBox;\n return {\n id,\n ancestors: new Set(ancestorIds),\n descendants,\n insets: {\n left: Math.max(0, descendantUnion.x1 - parentBox.x1),\n right: Math.max(0, parentBox.x2 - descendantUnion.x2),\n top: Math.max(0, descendantUnion.y1 - parentBox.y1),\n bottom: Math.max(0, parentBox.y2 - descendantUnion.y2),\n },\n };\n}\n\n/*** Resolve immutable label and compound boxes for one candidate uniform spacing factor. */\nfunction resolveCollisionBoxes(\n leaves: readonly LeafGeometry[],\n groups: readonly GroupGeometry[],\n center: Point,\n factor: number,\n): readonly CollisionBox[] {\n const labels = leaves.map((leaf) => ({\n id: leaf.id,\n ancestors: leaf.ancestors,\n kind: 'label' as const,\n box: shiftBounds(leaf.labelBox, leaf.position, center, factor),\n }));\n const compoundBoxes = groups.flatMap((group) => {\n const descendants = group.descendants.map((leaf) =>\n shiftBounds(leaf.nodeBox, leaf.position, center, factor),\n );\n const union = unionBounds(descendants);\n if (!union) return [];\n return [\n {\n id: group.id,\n ancestors: group.ancestors,\n kind: 'group' as const,\n box: expandBounds(union, group.insets),\n },\n ];\n });\n return [...labels, ...compoundBoxes];\n}\n\n/*** Find the first bounded expansion factor that makes the pure geometry snapshot acceptable. */\nfunction findExpansionMaximum(accepts: (factor: number) => boolean): number | undefined {\n return Array.from({ length: MAX_EXPANSION_ATTEMPTS }, (_, index) => 2 ** (index + 1)).find(\n accepts,\n );\n}\n\n/***\n * Sweep resolved boxes by x extent and stop conservatively if the pair-check budget is exhausted.\n * Local loop counters are intentionally mutable on this performance-critical boundary.\n */\nfunction hasUnsafeCollisions(boxes: readonly CollisionBox[]): boolean {\n const sorted = [...boxes].sort((first, second) => first.box.x1 - second.box.x1);\n const budget = { remaining: MAX_PAIR_CHECKS };\n for (const [index, first] of sorted.entries()) {\n for (let next = index + 1; next < sorted.length; next += 1) {\n const second = sorted.at(next);\n if (!second) break;\n if (second.box.x1 >= first.box.x2) break;\n budget.remaining -= 1;\n if (budget.remaining < 0) return true;\n if (isIntentionalContainment(first, second)) continue;\n if (isUnsafeOverlap(first, second)) return true;\n }\n }\n return false;\n}\n\n/*** Ignore intentional compound containment while retaining sibling and unrelated separation. */\nfunction isIntentionalContainment(first: CollisionBox, second: CollisionBox): boolean {\n return first.ancestors.has(second.id) || second.ancestors.has(first.id);\n}\n\n/*** Permit only a small bounded label-label overlap; every other intersection remains unsafe. */\nfunction isUnsafeOverlap(first: CollisionBox, second: CollisionBox): boolean {\n const overlapWidth =\n Math.min(first.box.x2, second.box.x2) - Math.max(first.box.x1, second.box.x1);\n const overlapHeight =\n Math.min(first.box.y2, second.box.y2) - Math.max(first.box.y1, second.box.y1);\n if (overlapWidth <= 0 || overlapHeight <= 0) return false;\n if (first.kind !== 'label' || second.kind !== 'label') return true;\n const widthRatio = overlapWidth / Math.min(first.box.w, second.box.w);\n const heightRatio = overlapHeight / Math.min(first.box.h, second.box.h);\n return widthRatio > LABEL_OVERLAP_RATIO && heightRatio > LABEL_OVERLAP_RATIO;\n}\n\n/*** Shift one fixed renderer box with its leaf center under uniform radial scaling. */\nfunction shiftBounds(box: Bounds, position: Point, center: Point, factor: number): Bounds {\n const dx = (position.x - center.x) * (factor - 1);\n const dy = (position.y - center.y) * (factor - 1);\n return {\n x1: box.x1 + dx,\n y1: box.y1 + dy,\n x2: box.x2 + dx,\n y2: box.y2 + dy,\n w: box.w,\n h: box.h,\n };\n}\n\n/*** Expand a descendant union by the compound renderer's measured outer insets. */\nfunction expandBounds(box: Bounds, insets: Insets): Bounds {\n const x1 = box.x1 - insets.left;\n const y1 = box.y1 - insets.top;\n const x2 = box.x2 + insets.right;\n const y2 = box.y2 + insets.bottom;\n return { x1, y1, x2, y2, w: x2 - x1, h: y2 - y1 };\n}\n\n/*** Return the immutable union of measured boxes, or undefined for an empty collection. */\nfunction unionBounds(boxes: readonly Bounds[]): Bounds | undefined {\n if (boxes.length === 0) return undefined;\n const x1 = Math.min(...boxes.map((box) => box.x1));\n const y1 = Math.min(...boxes.map((box) => box.y1));\n const x2 = Math.max(...boxes.map((box) => box.x2));\n const y2 = Math.max(...boxes.map((box) => box.y2));\n return { x1, y1, x2, y2, w: x2 - x1, h: y2 - y1 };\n}\n\n/*** Return whether renderer measurement produced a non-empty label box. */\nfunction isUsableBox(box: Bounds): boolean {\n return box.w > 0 && box.h > 0;\n}\n\n/*** Apply the accepted factor once, preserving node dimensions, hierarchy, ordering and edge data. */\nfunction applyScale(\n cy: Core,\n leaves: readonly LeafGeometry[],\n center: Point,\n factor: number,\n): void {\n const positions = new Map(leaves.map((leaf) => [leaf.id, leaf.position]));\n cy.batch(() => {\n cy.nodes()\n .not(':parent')\n .positions((node) => {\n const original = positions.get(node.id()) ?? node.position();\n return {\n x: center.x + (original.x - center.x) * factor,\n y: center.y + (original.y - center.y) * factor,\n };\n });\n });\n}\n"]}
|
|
@@ -2,8 +2,8 @@ import { TabList as SurfaceTabList } from '@ankhorage/surface';
|
|
|
2
2
|
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
3
3
|
/*** Renders the accessible list of tabs for a Tabs composition. */
|
|
4
4
|
export const TabList = withZoraThemeScope(TabListInner);
|
|
5
|
-
/*** Delegates tablist semantics
|
|
6
|
-
function TabListInner({ themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy,
|
|
7
|
-
return <SurfaceTabList
|
|
5
|
+
/*** Delegates tablist semantics, keyboard navigation, and fill distribution to Surface. */
|
|
6
|
+
function TabListInner({ themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy, ...props }) {
|
|
7
|
+
return <SurfaceTabList {...props}/>;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=TabList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,mEAAmE;AACnE,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,mEAAmE;AACnE,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAExD,2FAA2F;AAC3F,SAAS,YAAY,CAAC,EACpB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,KAAK,EACK;IACb,OAAO,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACvC,CAAC","sourcesContent":["import { TabList as SurfaceTabList } from '@ankhorage/surface';\n\nimport type { TabListProps } from '../../../../types/tabs';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\n\n/*** Renders the accessible list of tabs for a Tabs composition. */\nexport const TabList = withZoraThemeScope(TabListInner);\n\n/*** Delegates tablist semantics, keyboard navigation, and fill distribution to Surface. */\nfunction TabListInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n ...props\n}: TabListProps) {\n return <SurfaceTabList {...props} />;\n}\n"]}
|
|
@@ -4,6 +4,13 @@ export declare const tabListMeta: {
|
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
5
|
readonly allowedChildren: readonly ["Tab"];
|
|
6
6
|
readonly description: "Accessible list of selectable tabs.";
|
|
7
|
-
readonly props: {
|
|
7
|
+
readonly props: {
|
|
8
|
+
readonly fill: {
|
|
9
|
+
readonly type: "boolean";
|
|
10
|
+
readonly category: "Layout";
|
|
11
|
+
readonly label: "Fill";
|
|
12
|
+
readonly default: false;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
8
15
|
};
|
|
9
16
|
//# sourceMappingURL=tabListMeta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabListMeta.d.ts","sourceRoot":"","sources":["../../../src/features/tabs/tabListMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"tabListMeta.d.ts","sourceRoot":"","sources":["../../../src/features/tabs/tabListMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;CASc,CAAC"}
|
|
@@ -4,6 +4,8 @@ export const tabListMeta = {
|
|
|
4
4
|
directManifestNode: true,
|
|
5
5
|
allowedChildren: ['Tab'],
|
|
6
6
|
description: 'Accessible list of selectable tabs.',
|
|
7
|
-
props: {
|
|
7
|
+
props: {
|
|
8
|
+
fill: { type: 'boolean', category: 'Layout', label: 'Fill', default: false },
|
|
9
|
+
},
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=tabListMeta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabListMeta.js","sourceRoot":"","sources":["../../../src/features/tabs/tabListMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,WAAW,EAAE,qCAAqC;IAClD,KAAK,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"tabListMeta.js","sourceRoot":"","sources":["../../../src/features/tabs/tabListMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,WAAW,EAAE,qCAAqC;IAClD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;KAC7E;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const tabListMeta = {\n name: 'TabList',\n category: 'component',\n directManifestNode: true,\n allowedChildren: ['Tab'],\n description: 'Accessible list of selectable tabs.',\n props: {\n fill: { type: 'boolean', category: 'Layout', label: 'Fill', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
package/dist/types/tabs.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type { TabPanelProps as SurfaceTabPanelProps, TabsProps as SurfaceTabsProps } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
1
|
+
import type { TabListProps as SurfaceTabListProps, TabPanelProps as SurfaceTabPanelProps, TabProps as SurfaceTabProps, TabsProps as SurfaceTabsProps } from '@ankhorage/surface';
|
|
3
2
|
import type { ZoraBaseProps } from './base';
|
|
4
3
|
export interface TabsProps extends ZoraBaseProps, Omit<SurfaceTabsProps, 'testID'> {
|
|
5
4
|
}
|
|
6
|
-
export interface TabListProps extends ZoraBaseProps {
|
|
7
|
-
children?: React.ReactNode;
|
|
5
|
+
export interface TabListProps extends ZoraBaseProps, Omit<SurfaceTabListProps, 'testID'> {
|
|
8
6
|
}
|
|
9
|
-
export interface TabProps extends ZoraBaseProps {
|
|
10
|
-
value: string;
|
|
7
|
+
export interface TabProps extends ZoraBaseProps, Omit<SurfaceTabProps, 'children' | 'interactionPolicy' | 'testID'> {
|
|
11
8
|
label: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
9
|
}
|
|
14
10
|
export interface TabPanelProps extends ZoraBaseProps, Omit<SurfaceTabPanelProps, 'testID'> {
|
|
15
11
|
}
|
package/dist/types/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,IAAI,oBAAoB,EACrC,SAAS,IAAI,gBAAgB,EAC9B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,mBAAmB,EACnC,aAAa,IAAI,oBAAoB,EACrC,QAAQ,IAAI,eAAe,EAC3B,SAAS,IAAI,gBAAgB,EAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC;CAAG;AAErF,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;CAAG;AAE3F,MAAM,WAAW,QACf,SAAQ,aAAa,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,mBAAmB,GAAG,QAAQ,CAAC;IACzF,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC;CAAG"}
|
package/dist/types/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n TabPanelProps as SurfaceTabPanelProps,\n TabsProps as SurfaceTabsProps,\n} from '@ankhorage/surface';\
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n TabListProps as SurfaceTabListProps,\n TabPanelProps as SurfaceTabPanelProps,\n TabProps as SurfaceTabProps,\n TabsProps as SurfaceTabsProps,\n} from '@ankhorage/surface';\n\nimport type { ZoraBaseProps } from './base';\n\nexport interface TabsProps extends ZoraBaseProps, Omit<SurfaceTabsProps, 'testID'> {}\n\nexport interface TabListProps extends ZoraBaseProps, Omit<SurfaceTabListProps, 'testID'> {}\n\nexport interface TabProps\n extends ZoraBaseProps, Omit<SurfaceTabProps, 'children' | 'interactionPolicy' | 'testID'> {\n label: string;\n}\n\nexport interface TabPanelProps extends ZoraBaseProps, Omit<SurfaceTabPanelProps, 'testID'> {}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "21.0.
|
|
4
|
+
"version": "21.0.10",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ankhorage/color-theory": "^0.3.1",
|
|
44
44
|
"@ankhorage/contracts": "^22.5.0",
|
|
45
|
-
"@ankhorage/surface": "^9.0
|
|
45
|
+
"@ankhorage/surface": "^9.1.0",
|
|
46
46
|
"@ankhorage/utility": "^1.5.0",
|
|
47
47
|
"expo-document-picker": "~57.0.1",
|
|
48
48
|
"expo-image-picker": "~57.0.16"
|