@william-callao/antonella-ui 1.0.5 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +122 -12
- package/dist/index.js +646 -472
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -148,10 +148,13 @@ __export(index_exports, {
|
|
|
148
148
|
hasCode: () => hasCode,
|
|
149
149
|
hostDirection: () => hostDirection,
|
|
150
150
|
iconMap: () => iconMap,
|
|
151
|
+
isLayoutDebug: () => isLayoutDebug,
|
|
152
|
+
layoutDebug: () => layoutDebug,
|
|
151
153
|
layoutStates: () => layoutStates,
|
|
152
154
|
removeNode: () => removeNode,
|
|
153
155
|
resolveComposition: () => resolveComposition,
|
|
154
156
|
resolveTransition: () => resolveTransition,
|
|
157
|
+
setLayoutDebug: () => setLayoutDebug,
|
|
155
158
|
updateNode: () => updateNode,
|
|
156
159
|
useAppNavigation: () => useAppNavigation,
|
|
157
160
|
useAppShell: () => useAppShell,
|
|
@@ -1656,19 +1659,27 @@ function SheetOverlay({
|
|
|
1656
1659
|
document.body.style.overflow = previousOverflow;
|
|
1657
1660
|
};
|
|
1658
1661
|
}, [embedded, mounted, dismissible, onClose]);
|
|
1659
|
-
const overlay = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1662
|
+
const overlay = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1663
|
+
import_react_native22.View,
|
|
1664
|
+
{
|
|
1665
|
+
style: styles21.container,
|
|
1666
|
+
pointerEvents: embedded ? "box-none" : void 0,
|
|
1667
|
+
accessibilityViewIsModal: embedded,
|
|
1668
|
+
children: [
|
|
1669
|
+
!embedded && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1670
|
+
import_react_native22.Pressable,
|
|
1671
|
+
{
|
|
1672
|
+
onPress: dismissible ? onClose : void 0,
|
|
1673
|
+
style: import_react_native22.StyleSheet.absoluteFill,
|
|
1674
|
+
accessibilityRole: "button",
|
|
1675
|
+
accessibilityLabel,
|
|
1676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native_reanimated3.default.View, { style: [styles21.backdrop, backdropStyle] })
|
|
1677
|
+
}
|
|
1678
|
+
),
|
|
1679
|
+
children
|
|
1680
|
+
]
|
|
1681
|
+
}
|
|
1682
|
+
);
|
|
1672
1683
|
if (embedded) {
|
|
1673
1684
|
return overlay;
|
|
1674
1685
|
}
|
|
@@ -3897,7 +3908,7 @@ var PALETTE_GROUPS = [
|
|
|
3897
3908
|
colors: Object.entries(import_antonella_theme38.danger).map(([label, value]) => ({ label, value }))
|
|
3898
3909
|
}
|
|
3899
3910
|
];
|
|
3900
|
-
var ALL_COLORS = PALETTE_GROUPS.flatMap((
|
|
3911
|
+
var ALL_COLORS = PALETTE_GROUPS.flatMap((g2) => g2.colors);
|
|
3901
3912
|
function findTokenLabel(hex) {
|
|
3902
3913
|
const upper = normalizeHex(hex);
|
|
3903
3914
|
const match = ALL_COLORS.find((c) => c.value.toUpperCase() === upper);
|
|
@@ -4795,6 +4806,8 @@ function ElementCard({
|
|
|
4795
4806
|
onPress,
|
|
4796
4807
|
trailing = "chevron-forward",
|
|
4797
4808
|
onTrailingPress,
|
|
4809
|
+
trailingLabel,
|
|
4810
|
+
trailingAccessibilityLabel,
|
|
4798
4811
|
dimmed = false,
|
|
4799
4812
|
style = "DEFAULT" /* DEFAULT */,
|
|
4800
4813
|
containerStyle,
|
|
@@ -4843,6 +4856,7 @@ function ElementCard({
|
|
|
4843
4856
|
onPress: onTrailingPress,
|
|
4844
4857
|
hitSlop: 8,
|
|
4845
4858
|
accessibilityRole: "button",
|
|
4859
|
+
accessibilityLabel: trailingLabel ?? trailingAccessibilityLabel,
|
|
4846
4860
|
style: styles42.trailingTouch,
|
|
4847
4861
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { name: trailing, size: 18, color: ctx.icon.subtle })
|
|
4848
4862
|
}
|
|
@@ -5306,28 +5320,28 @@ function buildSolidLUT(color) {
|
|
|
5306
5320
|
var Z_BUCKETS = 1024;
|
|
5307
5321
|
function recordPicture(buf, size, lut, rMin) {
|
|
5308
5322
|
"worklet";
|
|
5309
|
-
const
|
|
5310
|
-
let paint =
|
|
5323
|
+
const g2 = globalThis;
|
|
5324
|
+
let paint = g2.__expoThinkingOrbsPaint;
|
|
5311
5325
|
if (paint === void 0) {
|
|
5312
5326
|
paint = import_react_native_skia.Skia.Paint();
|
|
5313
5327
|
paint.setAntiAlias(true);
|
|
5314
|
-
|
|
5328
|
+
g2.__expoThinkingOrbsPaint = paint;
|
|
5315
5329
|
}
|
|
5316
5330
|
const n = buf.count;
|
|
5317
5331
|
const zs = buf.zs;
|
|
5318
|
-
let order =
|
|
5319
|
-
let bucket =
|
|
5332
|
+
let order = g2.__expoThinkingOrbsOrder;
|
|
5333
|
+
let bucket = g2.__expoThinkingOrbsBucket;
|
|
5320
5334
|
if (order === void 0 || order.length < n) {
|
|
5321
5335
|
order = new Int32Array(n);
|
|
5322
5336
|
bucket = new Int32Array(n);
|
|
5323
|
-
|
|
5324
|
-
|
|
5337
|
+
g2.__expoThinkingOrbsOrder = order;
|
|
5338
|
+
g2.__expoThinkingOrbsBucket = bucket;
|
|
5325
5339
|
}
|
|
5326
5340
|
const buckets = bucket;
|
|
5327
|
-
let counts =
|
|
5341
|
+
let counts = g2.__expoThinkingOrbsCounts;
|
|
5328
5342
|
if (counts === void 0) {
|
|
5329
5343
|
counts = new Int32Array(Z_BUCKETS);
|
|
5330
|
-
|
|
5344
|
+
g2.__expoThinkingOrbsCounts = counts;
|
|
5331
5345
|
} else {
|
|
5332
5346
|
counts.fill(0);
|
|
5333
5347
|
}
|
|
@@ -5351,11 +5365,11 @@ function recordPicture(buf, size, lut, rMin) {
|
|
|
5351
5365
|
running += c;
|
|
5352
5366
|
}
|
|
5353
5367
|
for (let i = 0; i < n; i++) order[counts[buckets[i]]++] = i;
|
|
5354
|
-
let rect =
|
|
5355
|
-
if (rect === void 0 ||
|
|
5368
|
+
let rect = g2.__expoThinkingOrbsRect;
|
|
5369
|
+
if (rect === void 0 || g2.__expoThinkingOrbsRectSize !== size) {
|
|
5356
5370
|
rect = import_react_native_skia.Skia.XYWHRect(0, 0, size, size);
|
|
5357
|
-
|
|
5358
|
-
|
|
5371
|
+
g2.__expoThinkingOrbsRect = rect;
|
|
5372
|
+
g2.__expoThinkingOrbsRectSize = size;
|
|
5359
5373
|
}
|
|
5360
5374
|
const rec = import_react_native_skia.Skia.PictureRecorder();
|
|
5361
5375
|
const canvas = rec.beginRecording(rect);
|
|
@@ -5383,11 +5397,11 @@ function recordPicture(buf, size, lut, rMin) {
|
|
|
5383
5397
|
// src/components/ComposingOrb/engine/scratch.ts
|
|
5384
5398
|
function acquireDynamics(amp, from, to, mix, yaw = 0, pitch = 0, roll = 0) {
|
|
5385
5399
|
"worklet";
|
|
5386
|
-
const
|
|
5387
|
-
let d =
|
|
5400
|
+
const g2 = globalThis;
|
|
5401
|
+
let d = g2.__expoThinkingOrbsDyn;
|
|
5388
5402
|
if (d === void 0) {
|
|
5389
5403
|
d = { amp, from, to, mix, yaw, pitch, roll };
|
|
5390
|
-
|
|
5404
|
+
g2.__expoThinkingOrbsDyn = d;
|
|
5391
5405
|
return d;
|
|
5392
5406
|
}
|
|
5393
5407
|
d.amp = amp;
|
|
@@ -5401,8 +5415,8 @@ function acquireDynamics(amp, from, to, mix, yaw = 0, pitch = 0, roll = 0) {
|
|
|
5401
5415
|
}
|
|
5402
5416
|
function acquireDotBuffer(capacity) {
|
|
5403
5417
|
"worklet";
|
|
5404
|
-
const
|
|
5405
|
-
let buf =
|
|
5418
|
+
const g2 = globalThis;
|
|
5419
|
+
let buf = g2.__expoThinkingOrbsScratch;
|
|
5406
5420
|
if (buf === void 0 || buf.capacity < capacity) {
|
|
5407
5421
|
buf = {
|
|
5408
5422
|
xs: new Float32Array(capacity),
|
|
@@ -5414,7 +5428,7 @@ function acquireDotBuffer(capacity) {
|
|
|
5414
5428
|
count: 0,
|
|
5415
5429
|
capacity
|
|
5416
5430
|
};
|
|
5417
|
-
|
|
5431
|
+
g2.__expoThinkingOrbsScratch = buf;
|
|
5418
5432
|
}
|
|
5419
5433
|
buf.count = 0;
|
|
5420
5434
|
return buf;
|
|
@@ -7133,27 +7147,40 @@ var TreeNodeItem = import_react27.default.memo(function TreeNodeItem2({
|
|
|
7133
7147
|
) : null
|
|
7134
7148
|
] })
|
|
7135
7149
|
] });
|
|
7150
|
+
const canToggle = hasChildren;
|
|
7151
|
+
const canOpenDetail = !hasChildren && ctx.onPressNode != null;
|
|
7152
|
+
const canOpenActions = ctx.isEdit;
|
|
7153
|
+
const interactive = canToggle || canOpenDetail || canOpenActions;
|
|
7154
|
+
const handlePress = canToggle ? () => ctx.onToggle(node.id) : canOpenDetail ? () => ctx.onPressNode?.(node) : void 0;
|
|
7155
|
+
const handleLongPress = ctx.isEdit ? () => ctx.onOpenActions(node.id) : void 0;
|
|
7136
7156
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
7137
7157
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_react_native63.View, { style: styles57.nodeRow, children: [
|
|
7138
7158
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(NodeGutter, { depth, lineColor: ctx.vt.lineColor, terminal: terminalElbow }),
|
|
7139
7159
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
7140
7160
|
import_react_native63.Pressable,
|
|
7141
7161
|
{
|
|
7142
|
-
onPress:
|
|
7143
|
-
|
|
7162
|
+
onPress: handlePress,
|
|
7163
|
+
onLongPress: handleLongPress,
|
|
7164
|
+
delayLongPress: 450,
|
|
7165
|
+
disabled: !interactive,
|
|
7144
7166
|
style: ({ pressed }) => [
|
|
7145
7167
|
styles57.nodeCard,
|
|
7146
7168
|
{
|
|
7147
7169
|
backgroundColor: pressed ? isActive ? ctx.vt.activePressedBg : ctx.vt.pressedBg : isActive ? ctx.vt.activeCardBg : ctx.vt.cardBg
|
|
7148
7170
|
}
|
|
7149
7171
|
],
|
|
7150
|
-
accessibilityRole:
|
|
7172
|
+
accessibilityRole: interactive ? "button" : void 0,
|
|
7151
7173
|
accessibilityState: hasChildren ? { expanded: !isCollapsed } : void 0,
|
|
7152
|
-
accessibilityLabel: hasChildren ? `${isCollapsed ? "Expandir" : "Colapsar"} ${node.name}` : void 0,
|
|
7174
|
+
accessibilityLabel: hasChildren ? `${isCollapsed ? "Expandir" : "Colapsar"} ${node.name}` : canOpenDetail ? `${node.name}, ver detalle` : void 0,
|
|
7175
|
+
accessibilityHint: ctx.isEdit ? "Manten\xE9 presionado para ver las acciones" : void 0,
|
|
7176
|
+
accessibilityActions: ctx.isEdit ? [{ name: "actions", label: "Acciones" }] : void 0,
|
|
7177
|
+
onAccessibilityAction: (event) => {
|
|
7178
|
+
if (event.nativeEvent.actionName === "actions") ctx.onOpenActions(node.id);
|
|
7179
|
+
},
|
|
7153
7180
|
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native63.View, { style: styles57.rowContent, children: ctx.renderNode ? ctx.renderNode(node, defaultContent) : defaultContent })
|
|
7154
7181
|
}
|
|
7155
7182
|
),
|
|
7156
|
-
ctx.isEdit ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
7183
|
+
ctx.isEdit && !ctx.actionsOnLongPress ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
7157
7184
|
import_react_native63.Pressable,
|
|
7158
7185
|
{
|
|
7159
7186
|
onPress: () => ctx.onOpenActions(node.id),
|
|
@@ -7168,7 +7195,7 @@ var TreeNodeItem = import_react27.default.memo(function TreeNodeItem2({
|
|
|
7168
7195
|
hasChildren && !isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native63.Animated.View, { style: [styles57.subtreeFade, { opacity: contentOpacity }], children: renderForest(ctx, node.children, depth + 1, node.name) }) : null
|
|
7169
7196
|
] });
|
|
7170
7197
|
});
|
|
7171
|
-
function TreeEditor({ value, onChange, mode = "view", variant = "default", collapsed: collapsedProp, onCollapsedChange, rootLabel = "Agregar ra\xEDz", renderNode, onRequestAdd, onRequestEdit, onRequestDelete, style }) {
|
|
7198
|
+
function TreeEditor({ value, onChange, mode = "view", variant = "default", collapsed: collapsedProp, onCollapsedChange, rootLabel = "Agregar ra\xEDz", renderNode, onRequestAdd, onRequestEdit, onRequestDelete, nodeActions = "menu", onPressNode, style }) {
|
|
7172
7199
|
const [internalCollapsed, setInternalCollapsed] = (0, import_react27.useState)({});
|
|
7173
7200
|
const source = collapsedProp ?? internalCollapsed;
|
|
7174
7201
|
const needsImplicitInit = value.length > 0 && Object.keys(source).length === 0;
|
|
@@ -7234,6 +7261,7 @@ function TreeEditor({ value, onChange, mode = "view", variant = "default", colla
|
|
|
7234
7261
|
}, [implicitInit]);
|
|
7235
7262
|
const vt = VARIANT_TOKENS[variant];
|
|
7236
7263
|
const isEdit = mode === "edit";
|
|
7264
|
+
const actionsOnLongPress = nodeActions === "longPress";
|
|
7237
7265
|
const getCollapsed = (0, import_react27.useCallback)(() => collapsedRef.current, []);
|
|
7238
7266
|
const getVersion = (0, import_react27.useCallback)((id) => versionRef.current.get(id) ?? 0, []);
|
|
7239
7267
|
const toggleCollapse = (0, import_react27.useCallback)((id) => {
|
|
@@ -7261,14 +7289,16 @@ function TreeEditor({ value, onChange, mode = "view", variant = "default", colla
|
|
|
7261
7289
|
const ctx = (0, import_react27.useMemo)(
|
|
7262
7290
|
() => ({
|
|
7263
7291
|
isEdit,
|
|
7292
|
+
actionsOnLongPress,
|
|
7264
7293
|
onToggle: toggleCollapse,
|
|
7265
7294
|
onOpenActions,
|
|
7295
|
+
onPressNode,
|
|
7266
7296
|
renderNode,
|
|
7267
7297
|
vt,
|
|
7268
7298
|
getCollapsed,
|
|
7269
7299
|
getVersion
|
|
7270
7300
|
}),
|
|
7271
|
-
[isEdit, toggleCollapse, onOpenActions, renderNode, vt, getCollapsed, getVersion]
|
|
7301
|
+
[isEdit, actionsOnLongPress, toggleCollapse, onOpenActions, onPressNode, renderNode, vt, getCollapsed, getVersion]
|
|
7272
7302
|
);
|
|
7273
7303
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
7274
7304
|
import_react_native63.View,
|
|
@@ -7304,6 +7334,10 @@ var styles57 = import_react_native63.StyleSheet.create({
|
|
|
7304
7334
|
alignItems: "center",
|
|
7305
7335
|
gap: import_antonella_theme59.space.space1,
|
|
7306
7336
|
minHeight: 44,
|
|
7337
|
+
// No dejar que el CTA de alta se comprima a altura cero cuando el árbol es
|
|
7338
|
+
// largo y el contenedor queda acotado (APP-002: "Agregar raíz" degeneraba a
|
|
7339
|
+
// bounds con y1 == y2 y dejaba de ser accionable).
|
|
7340
|
+
flexShrink: 0,
|
|
7307
7341
|
paddingHorizontal: import_antonella_theme59.space.space2,
|
|
7308
7342
|
borderRadius: import_antonella_theme59.radius.sm
|
|
7309
7343
|
},
|
|
@@ -7461,9 +7495,9 @@ var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
|
7461
7495
|
function contrast(hex) {
|
|
7462
7496
|
const h = hex.replace("#", "");
|
|
7463
7497
|
const r = parseInt(h.substring(0, 2), 16);
|
|
7464
|
-
const
|
|
7498
|
+
const g2 = parseInt(h.substring(2, 4), 16);
|
|
7465
7499
|
const b = parseInt(h.substring(4, 6), 16);
|
|
7466
|
-
return (r * 299 +
|
|
7500
|
+
return (r * 299 + g2 * 587 + b * 114) / 1e3 > 150 ? "#1C1C1E" : "#FFFFFF";
|
|
7467
7501
|
}
|
|
7468
7502
|
function SplitColorCard({
|
|
7469
7503
|
label,
|
|
@@ -7647,6 +7681,7 @@ var SINGLE_LINE_HEIGHT = 18;
|
|
|
7647
7681
|
function AppTextInput({
|
|
7648
7682
|
label,
|
|
7649
7683
|
labelWidth,
|
|
7684
|
+
error,
|
|
7650
7685
|
value,
|
|
7651
7686
|
onChangeText,
|
|
7652
7687
|
placeholder,
|
|
@@ -7670,77 +7705,83 @@ function AppTextInput({
|
|
|
7670
7705
|
const handleSubmitEditing = () => {
|
|
7671
7706
|
inputRef.current?.blur();
|
|
7672
7707
|
};
|
|
7673
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_native67.View, { style: styles61.wrapper, children: [
|
|
7709
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
7710
|
+
import_react_native67.TouchableOpacity,
|
|
7711
|
+
{
|
|
7712
|
+
style: [
|
|
7713
|
+
styles61.row,
|
|
7714
|
+
inputHeight != null && inputHeight > SINGLE_LINE_HEIGHT && styles61.rowGrown,
|
|
7715
|
+
!editable && styles61.rowDisabled
|
|
7716
|
+
],
|
|
7717
|
+
onPress: () => onPressOverride ? onPressOverride() : focus(),
|
|
7718
|
+
disabled: !editable && !readOnly,
|
|
7719
|
+
activeOpacity: 1,
|
|
7720
|
+
children: [
|
|
7721
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7722
|
+
Text,
|
|
7723
|
+
{
|
|
7724
|
+
variant: import_antonella_theme62.TextType.Label,
|
|
7725
|
+
numberOfLines: 1,
|
|
7726
|
+
style: [styles61.label, labelWidth != null && { width: labelWidth }],
|
|
7727
|
+
children: label
|
|
7728
|
+
}
|
|
7729
|
+
),
|
|
7730
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7731
|
+
import_react_native67.TextInput,
|
|
7732
|
+
{
|
|
7733
|
+
ref: inputRef,
|
|
7734
|
+
style: [
|
|
7735
|
+
styles61.value,
|
|
7736
|
+
{
|
|
7737
|
+
fontSize: import_antonella_theme62.texts.caption.fontSize,
|
|
7738
|
+
lineHeight: import_antonella_theme62.texts.caption.lineHeight,
|
|
7739
|
+
color: import_antonella_theme62.text.default
|
|
7740
|
+
},
|
|
7741
|
+
inputHeight != null && {
|
|
7742
|
+
height: Math.max(inputHeight, SINGLE_LINE_HEIGHT)
|
|
7743
|
+
}
|
|
7744
|
+
],
|
|
7745
|
+
value,
|
|
7746
|
+
onChangeText,
|
|
7747
|
+
onContentSizeChange: handleContentSizeChange,
|
|
7748
|
+
onSubmitEditing: handleSubmitEditing,
|
|
7749
|
+
placeholder,
|
|
7750
|
+
placeholderTextColor: import_antonella_theme62.texts.placeholder.color,
|
|
7751
|
+
autoCapitalize,
|
|
7752
|
+
keyboardType,
|
|
7753
|
+
maxLength,
|
|
7754
|
+
editable: canType,
|
|
7755
|
+
selectionColor: import_antonella_theme62.text.default,
|
|
7756
|
+
underlineColorAndroid: "transparent",
|
|
7757
|
+
multiline: true,
|
|
7758
|
+
scrollEnabled: false,
|
|
7759
|
+
textAlignVertical: "top",
|
|
7760
|
+
blurOnSubmit: true,
|
|
7761
|
+
submitBehavior: "blurAndSubmit"
|
|
7762
|
+
}
|
|
7763
|
+
),
|
|
7764
|
+
trailingAction ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7765
|
+
import_react_native67.Pressable,
|
|
7766
|
+
{
|
|
7767
|
+
onPress: trailingAction.onPress,
|
|
7768
|
+
hitSlop: 8,
|
|
7769
|
+
style: styles61.trailingAction,
|
|
7770
|
+
accessibilityRole: "button",
|
|
7771
|
+
accessibilityLabel: trailingAction.accessibilityLabel,
|
|
7772
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon, { name: trailingAction.icon, size: 20, color: import_antonella_theme62.text.secondary })
|
|
7773
|
+
}
|
|
7774
|
+
) : null
|
|
7775
|
+
]
|
|
7776
|
+
}
|
|
7777
|
+
),
|
|
7778
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Text, { variant: import_antonella_theme62.TextType.Caption, color: import_antonella_theme62.appInput.error, style: styles61.error, children: error }) : null
|
|
7779
|
+
] });
|
|
7742
7780
|
}
|
|
7743
7781
|
var styles61 = import_react_native67.StyleSheet.create({
|
|
7782
|
+
wrapper: {
|
|
7783
|
+
alignItems: "stretch"
|
|
7784
|
+
},
|
|
7744
7785
|
row: {
|
|
7745
7786
|
flexDirection: "row",
|
|
7746
7787
|
alignItems: "center",
|
|
@@ -7769,6 +7810,11 @@ var styles61 = import_react_native67.StyleSheet.create({
|
|
|
7769
7810
|
trailingAction: {
|
|
7770
7811
|
marginLeft: import_antonella_theme62.spacing.xs,
|
|
7771
7812
|
justifyContent: "center"
|
|
7813
|
+
},
|
|
7814
|
+
error: {
|
|
7815
|
+
marginTop: import_antonella_theme62.spacing.xs,
|
|
7816
|
+
paddingHorizontal: import_antonella_theme62.space.space4,
|
|
7817
|
+
textAlign: "right"
|
|
7772
7818
|
}
|
|
7773
7819
|
});
|
|
7774
7820
|
|
|
@@ -7781,6 +7827,7 @@ var SINGLE_LINE_HEIGHT2 = 18;
|
|
|
7781
7827
|
var MIN_AREA_HEIGHT = 72;
|
|
7782
7828
|
function AppTextArea({
|
|
7783
7829
|
label,
|
|
7830
|
+
error,
|
|
7784
7831
|
value,
|
|
7785
7832
|
onChangeText,
|
|
7786
7833
|
placeholder,
|
|
@@ -7800,58 +7847,64 @@ function AppTextArea({
|
|
|
7800
7847
|
const handleSubmitEditing = () => {
|
|
7801
7848
|
inputRef.current?.blur();
|
|
7802
7849
|
};
|
|
7803
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react_native68.View, { style: styles62.wrapper, children: [
|
|
7851
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
7852
|
+
import_react_native68.TouchableOpacity,
|
|
7853
|
+
{
|
|
7854
|
+
style: [
|
|
7855
|
+
styles62.container,
|
|
7856
|
+
inputHeight != null && inputHeight > SINGLE_LINE_HEIGHT2 && styles62.containerGrown,
|
|
7857
|
+
!editable && styles62.containerDisabled
|
|
7858
|
+
],
|
|
7859
|
+
onPress: focus,
|
|
7860
|
+
disabled: !editable,
|
|
7861
|
+
activeOpacity: 1,
|
|
7862
|
+
children: [
|
|
7863
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Text, { variant: import_antonella_theme63.TextType.Label, numberOfLines: 1, style: styles62.label, children: label }),
|
|
7864
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
7865
|
+
import_react_native68.TextInput,
|
|
7866
|
+
{
|
|
7867
|
+
ref: inputRef,
|
|
7868
|
+
style: [
|
|
7869
|
+
styles62.value,
|
|
7870
|
+
{
|
|
7871
|
+
fontSize: import_antonella_theme63.texts.caption.fontSize,
|
|
7872
|
+
lineHeight: import_antonella_theme63.texts.caption.lineHeight,
|
|
7873
|
+
color: import_antonella_theme63.text.default
|
|
7874
|
+
},
|
|
7875
|
+
inputHeight != null && {
|
|
7876
|
+
height: Math.max(inputHeight, SINGLE_LINE_HEIGHT2)
|
|
7877
|
+
}
|
|
7878
|
+
],
|
|
7879
|
+
value,
|
|
7880
|
+
onChangeText,
|
|
7881
|
+
onContentSizeChange: handleContentSizeChange,
|
|
7882
|
+
onSubmitEditing: handleSubmitEditing,
|
|
7883
|
+
placeholder,
|
|
7884
|
+
placeholderTextColor: import_antonella_theme63.texts.placeholder.color,
|
|
7885
|
+
autoCapitalize,
|
|
7886
|
+
keyboardType,
|
|
7887
|
+
maxLength,
|
|
7888
|
+
editable,
|
|
7889
|
+
selectionColor: import_antonella_theme63.text.default,
|
|
7890
|
+
underlineColorAndroid: "transparent",
|
|
7891
|
+
multiline: true,
|
|
7892
|
+
scrollEnabled: false,
|
|
7893
|
+
textAlignVertical: "top",
|
|
7894
|
+
blurOnSubmit: true,
|
|
7895
|
+
submitBehavior: "blurAndSubmit"
|
|
7896
|
+
}
|
|
7897
|
+
)
|
|
7898
|
+
]
|
|
7899
|
+
}
|
|
7900
|
+
),
|
|
7901
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Text, { variant: import_antonella_theme63.TextType.Caption, color: import_antonella_theme63.appInput.error, style: styles62.error, children: error }) : null
|
|
7902
|
+
] });
|
|
7853
7903
|
}
|
|
7854
7904
|
var styles62 = import_react_native68.StyleSheet.create({
|
|
7905
|
+
wrapper: {
|
|
7906
|
+
alignItems: "stretch"
|
|
7907
|
+
},
|
|
7855
7908
|
container: {
|
|
7856
7909
|
gap: import_antonella_theme63.space.space2,
|
|
7857
7910
|
minHeight: MIN_AREA_HEIGHT,
|
|
@@ -7874,6 +7927,12 @@ var styles62 = import_react_native68.StyleSheet.create({
|
|
|
7874
7927
|
paddingRight: 2,
|
|
7875
7928
|
textAlign: "left",
|
|
7876
7929
|
outlineWidth: 0
|
|
7930
|
+
},
|
|
7931
|
+
error: {
|
|
7932
|
+
marginTop: import_antonella_theme63.spacing.xs,
|
|
7933
|
+
paddingHorizontal: import_antonella_theme63.space.space4,
|
|
7934
|
+
paddingBottom: import_antonella_theme63.spacing.sm,
|
|
7935
|
+
textAlign: "left"
|
|
7877
7936
|
}
|
|
7878
7937
|
});
|
|
7879
7938
|
|
|
@@ -7888,6 +7947,7 @@ var ANIM_DURATION2 = 220;
|
|
|
7888
7947
|
function AppSelector({
|
|
7889
7948
|
label,
|
|
7890
7949
|
labelWidth,
|
|
7950
|
+
error,
|
|
7891
7951
|
value,
|
|
7892
7952
|
onChange,
|
|
7893
7953
|
options,
|
|
@@ -7931,6 +7991,7 @@ function AppSelector({
|
|
|
7931
7991
|
}, [open, contentHeight, options.length, height, contentOpacity]);
|
|
7932
7992
|
const toggle = () => {
|
|
7933
7993
|
if (disabled) return;
|
|
7994
|
+
if (!open) import_react_native69.Keyboard.dismiss();
|
|
7934
7995
|
setOpen((o) => !o);
|
|
7935
7996
|
};
|
|
7936
7997
|
const handleSelect = (option) => {
|
|
@@ -7971,6 +8032,7 @@ function AppSelector({
|
|
|
7971
8032
|
]
|
|
7972
8033
|
}
|
|
7973
8034
|
),
|
|
8035
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text, { variant: import_antonella_theme64.TextType.Caption, color: import_antonella_theme64.appInput.error, style: styles63.error, children: error }) : null,
|
|
7974
8036
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react_native69.Animated.View, { style: { height, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
7975
8037
|
import_react_native69.Animated.View,
|
|
7976
8038
|
{
|
|
@@ -8041,6 +8103,12 @@ var styles63 = import_react_native69.StyleSheet.create({
|
|
|
8041
8103
|
borderTopWidth: import_react_native69.StyleSheet.hairlineWidth,
|
|
8042
8104
|
borderTopColor: import_antonella_theme64.appInputCard.separator
|
|
8043
8105
|
},
|
|
8106
|
+
error: {
|
|
8107
|
+
marginTop: -import_antonella_theme64.spacing.sm,
|
|
8108
|
+
paddingHorizontal: import_antonella_theme64.space.space4,
|
|
8109
|
+
paddingBottom: import_antonella_theme64.spacing.sm,
|
|
8110
|
+
textAlign: "right"
|
|
8111
|
+
},
|
|
8044
8112
|
optionText: {
|
|
8045
8113
|
flex: 1
|
|
8046
8114
|
}
|
|
@@ -8170,12 +8238,14 @@ function AppButton({
|
|
|
8170
8238
|
label,
|
|
8171
8239
|
onPress,
|
|
8172
8240
|
disabled = false,
|
|
8241
|
+
loading = false,
|
|
8173
8242
|
variant = "solid",
|
|
8174
8243
|
backgroundColor,
|
|
8175
8244
|
textColor,
|
|
8176
8245
|
borderColor,
|
|
8177
8246
|
style
|
|
8178
8247
|
}) {
|
|
8248
|
+
const interactiveDisabled = disabled || loading;
|
|
8179
8249
|
const background15 = disabled ? import_antonella_theme66.appButton.background.disabled : backgroundColor ?? (variant === "solid" ? import_antonella_theme66.appButton.background.default : "transparent");
|
|
8180
8250
|
const foreground = disabled ? import_antonella_theme66.appButton.text.disabled : textColor ?? (variant === "solid" ? import_antonella_theme66.appButton.text.default : import_antonella_theme66.text.default);
|
|
8181
8251
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
@@ -8195,19 +8265,14 @@ function AppButton({
|
|
|
8195
8265
|
style
|
|
8196
8266
|
],
|
|
8197
8267
|
onPress,
|
|
8198
|
-
disabled,
|
|
8268
|
+
disabled: interactiveDisabled,
|
|
8199
8269
|
activeOpacity: 0.7,
|
|
8200
8270
|
accessibilityRole: "button",
|
|
8201
|
-
accessibilityState: { disabled },
|
|
8202
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime72.
|
|
8203
|
-
Text,
|
|
8204
|
-
{
|
|
8205
|
-
|
|
8206
|
-
color: foreground,
|
|
8207
|
-
style: styles65.label,
|
|
8208
|
-
children: label
|
|
8209
|
-
}
|
|
8210
|
-
)
|
|
8271
|
+
accessibilityState: { disabled: interactiveDisabled, busy: loading },
|
|
8272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_react_native71.View, { style: styles65.content, children: [
|
|
8273
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Text, { variant: "label", color: foreground, style: styles65.label, children: label }),
|
|
8274
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react_native71.ActivityIndicator, { size: "small", color: foreground, style: styles65.spinner }) : null
|
|
8275
|
+
] })
|
|
8211
8276
|
}
|
|
8212
8277
|
);
|
|
8213
8278
|
}
|
|
@@ -8220,8 +8285,16 @@ var styles65 = import_react_native71.StyleSheet.create({
|
|
|
8220
8285
|
alignItems: "center",
|
|
8221
8286
|
justifyContent: "center"
|
|
8222
8287
|
},
|
|
8288
|
+
content: {
|
|
8289
|
+
flexDirection: "row",
|
|
8290
|
+
alignItems: "center",
|
|
8291
|
+
justifyContent: "center"
|
|
8292
|
+
},
|
|
8223
8293
|
label: {
|
|
8224
8294
|
textAlign: "center"
|
|
8295
|
+
},
|
|
8296
|
+
spinner: {
|
|
8297
|
+
marginLeft: import_antonella_theme66.space.space2
|
|
8225
8298
|
}
|
|
8226
8299
|
});
|
|
8227
8300
|
|
|
@@ -8697,7 +8770,6 @@ var styles69 = import_react_native75.StyleSheet.create({
|
|
|
8697
8770
|
// src/layout/AppLayout.tsx
|
|
8698
8771
|
var import_react35 = require("react");
|
|
8699
8772
|
var import_react_native77 = require("react-native");
|
|
8700
|
-
var import_react_native78 = require("react-native");
|
|
8701
8773
|
var import_react_native_reanimated16 = __toESM(require("react-native-reanimated"));
|
|
8702
8774
|
|
|
8703
8775
|
// src/layout/Divisor.tsx
|
|
@@ -8761,12 +8833,62 @@ var styles70 = import_react_native76.StyleSheet.create({
|
|
|
8761
8833
|
}
|
|
8762
8834
|
});
|
|
8763
8835
|
|
|
8764
|
-
// src/layout/
|
|
8836
|
+
// src/layout/layoutDebug.ts
|
|
8837
|
+
var RING_MAX = 400;
|
|
8838
|
+
function g() {
|
|
8839
|
+
return globalThis;
|
|
8840
|
+
}
|
|
8841
|
+
function ring() {
|
|
8842
|
+
const global = g();
|
|
8843
|
+
global.__ANTONELLA_LAYOUT_LOG__ ??= [];
|
|
8844
|
+
return global.__ANTONELLA_LAYOUT_LOG__;
|
|
8845
|
+
}
|
|
8846
|
+
var envFlag = typeof process !== "undefined" && process.env ? String(process.env.EXPO_PUBLIC_LAYOUT_DEBUG ?? "").toLowerCase() : "";
|
|
8847
|
+
var forced = envFlag === "1" || envFlag === "true";
|
|
8848
|
+
function setLayoutDebug(on) {
|
|
8849
|
+
forced = on;
|
|
8850
|
+
if (on) {
|
|
8851
|
+
console.log("[APPLAYOUT] debug ON");
|
|
8852
|
+
}
|
|
8853
|
+
}
|
|
8854
|
+
function isLayoutDebug() {
|
|
8855
|
+
return forced;
|
|
8856
|
+
}
|
|
8857
|
+
function layoutDebug(event, data) {
|
|
8858
|
+
const entry = { t: Date.now(), event, data };
|
|
8859
|
+
const buffer = ring();
|
|
8860
|
+
buffer.push(entry);
|
|
8861
|
+
if (buffer.length > RING_MAX) {
|
|
8862
|
+
buffer.splice(0, buffer.length - RING_MAX);
|
|
8863
|
+
}
|
|
8864
|
+
if (forced) {
|
|
8865
|
+
console.log(`[APPLAYOUT ${event}]`, data ? JSON.stringify(data) : "");
|
|
8866
|
+
}
|
|
8867
|
+
}
|
|
8868
|
+
if (typeof globalThis !== "undefined") {
|
|
8869
|
+
const global = g();
|
|
8870
|
+
global.__ANTONELLA_LAYOUT_DEBUG__ = setLayoutDebug;
|
|
8871
|
+
global.__ANTONELLA_LAYOUT_DUMP__ = () => {
|
|
8872
|
+
const buffer = ring().slice();
|
|
8873
|
+
console.log(`[APPLAYOUT] ${buffer.length} eventos`);
|
|
8874
|
+
console.log(JSON.stringify(buffer, null, 2));
|
|
8875
|
+
return buffer;
|
|
8876
|
+
};
|
|
8877
|
+
}
|
|
8878
|
+
|
|
8879
|
+
// src/layout/layoutMath.ts
|
|
8765
8880
|
var import_antonella_theme71 = require("@william-callao/antonella-theme");
|
|
8766
|
-
var
|
|
8881
|
+
var SECTION_KEYS = ["top", "mid", "bottom"];
|
|
8767
8882
|
var _semantic12 = (0, import_antonella_theme71.resolveSemantic)(import_antonella_theme71.lightSemantic);
|
|
8768
8883
|
var DEFAULT_BG2 = _semantic12.default.bg.default;
|
|
8769
8884
|
var DARK_BG = _semantic12.darkness.bg.default;
|
|
8885
|
+
var SECTION_DEFAULT_COLORS = {
|
|
8886
|
+
top: DARK_BG,
|
|
8887
|
+
mid: DEFAULT_BG2,
|
|
8888
|
+
bottom: DARK_BG
|
|
8889
|
+
};
|
|
8890
|
+
var DEFAULT_PAGE_BG = DEFAULT_BG2;
|
|
8891
|
+
var FULLBOTTOM_DIVISOR_H = 25;
|
|
8770
8892
|
var layoutStates = {
|
|
8771
8893
|
stacked: {
|
|
8772
8894
|
pageScroll: false,
|
|
@@ -8815,25 +8937,83 @@ var layoutStates = {
|
|
|
8815
8937
|
}
|
|
8816
8938
|
}
|
|
8817
8939
|
};
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
}
|
|
8940
|
+
function resolveLayoutState(state, presets = layoutStates) {
|
|
8941
|
+
return typeof state === "string" ? presets[state] : state;
|
|
8942
|
+
}
|
|
8943
|
+
function isValidMeasurement(height) {
|
|
8944
|
+
return Number.isFinite(height) && height > 0;
|
|
8945
|
+
}
|
|
8946
|
+
function initialNaturals(H) {
|
|
8947
|
+
return { top: H / 3, mid: H / 3, bottom: H / 3 };
|
|
8948
|
+
}
|
|
8949
|
+
function bottomViewport(state, naturals, H) {
|
|
8950
|
+
const anchor = state.sections.bottom?.restsOn;
|
|
8951
|
+
if (!anchor) return H;
|
|
8952
|
+
const rest = H - naturals[anchor];
|
|
8953
|
+
return rest > 0 ? rest : H;
|
|
8954
|
+
}
|
|
8955
|
+
function bottomOverflows(state, naturals, H) {
|
|
8956
|
+
const b = state.sections.bottom;
|
|
8957
|
+
if (!b?.visible) return false;
|
|
8958
|
+
return naturals.bottom > bottomViewport(state, naturals, H);
|
|
8959
|
+
}
|
|
8960
|
+
function computeSectionTargets(state, naturals, H) {
|
|
8961
|
+
const out = { top: 0, mid: 0, bottom: 0 };
|
|
8962
|
+
for (const k of SECTION_KEYS) {
|
|
8963
|
+
const b = state.sections[k];
|
|
8964
|
+
if (!b?.visible) {
|
|
8965
|
+
out[k] = 0;
|
|
8966
|
+
continue;
|
|
8967
|
+
}
|
|
8968
|
+
const h = b.height ?? "content";
|
|
8969
|
+
if (h === "content") out[k] = naturals[k];
|
|
8970
|
+
else if (h === "third") out[k] = H / 3;
|
|
8971
|
+
else if (h === "fill") out[k] = H;
|
|
8972
|
+
else if (h === "fillRest") out[k] = b.restsOn ? H - naturals[b.restsOn] : 0;
|
|
8973
|
+
else if (h === "minFillRest") {
|
|
8974
|
+
const rest = b.restsOn ? H - naturals[b.restsOn] : 0;
|
|
8975
|
+
out[k] = Math.max(naturals[k], rest);
|
|
8976
|
+
} else out[k] = h;
|
|
8977
|
+
}
|
|
8978
|
+
const fullBottom = !state.sections.top?.visible && !state.sections.mid?.visible;
|
|
8979
|
+
if (fullBottom && state.sections.bottom?.visible) {
|
|
8980
|
+
out.bottom = Math.max(0, out.bottom - FULLBOTTOM_DIVISOR_H);
|
|
8981
|
+
}
|
|
8982
|
+
return out;
|
|
8983
|
+
}
|
|
8984
|
+
function selectPageBackground(state, colors = SECTION_DEFAULT_COLORS) {
|
|
8985
|
+
const mid = state.sections.mid;
|
|
8986
|
+
if (mid?.visible) {
|
|
8987
|
+
return mid.backgroundColor ?? colors.mid;
|
|
8988
|
+
}
|
|
8989
|
+
for (let i = SECTION_KEYS.length - 1; i >= 0; i--) {
|
|
8990
|
+
const k = SECTION_KEYS[i];
|
|
8991
|
+
if (state.sections[k]?.visible) {
|
|
8992
|
+
return state.sections[k]?.backgroundColor ?? colors[k];
|
|
8993
|
+
}
|
|
8994
|
+
}
|
|
8995
|
+
return DEFAULT_PAGE_BG;
|
|
8996
|
+
}
|
|
8997
|
+
function shouldResetScroll(prevRouteName, nextRouteName) {
|
|
8998
|
+
return prevRouteName !== nextRouteName;
|
|
8999
|
+
}
|
|
9000
|
+
function seedNaturals(snapshot, routeName, neutral) {
|
|
9001
|
+
const snap = snapshot.get(routeName);
|
|
9002
|
+
return snap ? { ...snap } : { ...neutral };
|
|
9003
|
+
}
|
|
9004
|
+
function writeNaturals(snapshot, routeName, naturals) {
|
|
9005
|
+
snapshot.set(routeName, { ...naturals });
|
|
9006
|
+
}
|
|
9007
|
+
|
|
9008
|
+
// src/layout/AppLayout.tsx
|
|
9009
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
8824
9010
|
var LAYOUT_DURATION = 300;
|
|
8825
9011
|
var REVEAL_DELAY_MS = 380;
|
|
8826
9012
|
var REVEAL_DURATION_MS = 200;
|
|
8827
|
-
var
|
|
8828
|
-
var
|
|
8829
|
-
var
|
|
8830
|
-
var
|
|
8831
|
-
var FULLBOTTOM_EXTEND = 5;
|
|
8832
|
-
var FULLBOTTOM_CUSHION = 5;
|
|
8833
|
-
var _withBottomHold = (t, cur) => {
|
|
8834
|
-
const held = t.bottom < cur.bottom ? cur.bottom : t.bottom;
|
|
8835
|
-
return held === t.bottom ? t : { ...t, bottom: held };
|
|
8836
|
-
};
|
|
9013
|
+
var PROBE_INTERVAL_MS = 150;
|
|
9014
|
+
var PROBE_STABLE_HITS = 2;
|
|
9015
|
+
var PROBE_MAX_MS = 4e3;
|
|
9016
|
+
var _sanitize = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 ? v : 0;
|
|
8837
9017
|
var AppNavigationContext = (0, import_react35.createContext)(null);
|
|
8838
9018
|
function useAppNavigation() {
|
|
8839
9019
|
const ctx = (0, import_react35.useContext)(AppNavigationContext);
|
|
@@ -8846,9 +9026,12 @@ function AppLayout({
|
|
|
8846
9026
|
initialRoute,
|
|
8847
9027
|
showBackButton = true,
|
|
8848
9028
|
animateTransitions = false,
|
|
8849
|
-
contentReveal = "always"
|
|
9029
|
+
contentReveal = "always",
|
|
9030
|
+
debug = false
|
|
8850
9031
|
}) {
|
|
8851
|
-
const { height: H } = (0,
|
|
9032
|
+
const { height: H } = (0, import_react_native77.useWindowDimensions)();
|
|
9033
|
+
const HRef = (0, import_react35.useRef)(H);
|
|
9034
|
+
HRef.current = H;
|
|
8852
9035
|
const reduceMotion = (0, import_react_native_reanimated16.useReducedMotion)();
|
|
8853
9036
|
const transition2 = reduceMotion ? import_react_native_reanimated16.LinearTransition.duration(0) : import_react_native_reanimated16.CurvedTransition.duration(LAYOUT_DURATION);
|
|
8854
9037
|
const revealProgress = (0, import_react_native_reanimated16.useSharedValue)(1);
|
|
@@ -8856,6 +9039,13 @@ function AppLayout({
|
|
|
8856
9039
|
const [stack, setStack] = (0, import_react35.useState)([initialRoute]);
|
|
8857
9040
|
const [prevRoute, setPrevRoute] = (0, import_react35.useState)(null);
|
|
8858
9041
|
const hasTransition = animateTransitions && prevRoute !== null;
|
|
9042
|
+
const initialNaturalsValue = (0, import_react35.useRef)(initialNaturals(H)).current;
|
|
9043
|
+
const [layoutHeights, setLayoutHeights] = (0, import_react35.useState)(
|
|
9044
|
+
() => computeSectionTargets(resolveLayoutState(initialRoute.state), initialNaturalsValue, H)
|
|
9045
|
+
);
|
|
9046
|
+
const appliedRef = (0, import_react35.useRef)(layoutHeights);
|
|
9047
|
+
const naturalsRef = (0, import_react35.useRef)({ ...initialNaturalsValue });
|
|
9048
|
+
const routeSnapshotRef = (0, import_react35.useRef)(/* @__PURE__ */ new Map());
|
|
8859
9049
|
const [revealHidden, setRevealHidden] = (0, import_react35.useState)(false);
|
|
8860
9050
|
const revealTimer = (0, import_react35.useRef)(null);
|
|
8861
9051
|
const startReveal = (0, import_react35.useCallback)(() => {
|
|
@@ -8868,11 +9058,27 @@ function AppLayout({
|
|
|
8868
9058
|
revealProgress.value = (0, import_react_native_reanimated16.withTiming)(1, { duration: REVEAL_DURATION_MS });
|
|
8869
9059
|
setRevealHidden(false);
|
|
8870
9060
|
}, REVEAL_DELAY_MS);
|
|
8871
|
-
}, [revealProgress
|
|
9061
|
+
}, [revealProgress]);
|
|
9062
|
+
const stateRef = (0, import_react35.useRef)(layoutStates.onlyCenter);
|
|
9063
|
+
const currentRouteNameRef = (0, import_react35.useRef)(initialRoute.name);
|
|
9064
|
+
const bodyOverflowRef = (0, import_react35.useRef)(false);
|
|
9065
|
+
const [pageCanScroll, setPageCanScroll] = (0, import_react35.useState)(false);
|
|
9066
|
+
const scrollRef = (0, import_react35.useRef)(null);
|
|
9067
|
+
const innerScrollRef = (0, import_react35.useRef)(null);
|
|
9068
|
+
const proxyRefs = (0, import_react35.useRef)({});
|
|
9069
|
+
const probeTimers = (0, import_react35.useRef)({});
|
|
9070
|
+
const probeLast = (0, import_react35.useRef)({});
|
|
9071
|
+
const probeStable = (0, import_react35.useRef)({});
|
|
9072
|
+
(0, import_react35.useEffect)(() => {
|
|
9073
|
+
if (debug) setLayoutDebug(true);
|
|
9074
|
+
}, [debug]);
|
|
8872
9075
|
(0, import_react35.useEffect)(() => {
|
|
8873
9076
|
return () => {
|
|
8874
9077
|
if (revealTimer.current) clearTimeout(revealTimer.current);
|
|
8875
|
-
|
|
9078
|
+
SECTION_KEYS.forEach((k) => {
|
|
9079
|
+
const t = probeTimers.current[k];
|
|
9080
|
+
if (t) clearInterval(t);
|
|
9081
|
+
});
|
|
8876
9082
|
};
|
|
8877
9083
|
}, []);
|
|
8878
9084
|
(0, import_react35.useEffect)(() => {
|
|
@@ -8913,137 +9119,143 @@ function AppLayout({
|
|
|
8913
9119
|
stack,
|
|
8914
9120
|
replace
|
|
8915
9121
|
};
|
|
8916
|
-
const
|
|
8917
|
-
const state = resolvedState ?? layoutStates.onlyCenter;
|
|
9122
|
+
const state = resolveLayoutState(currentRoute.state);
|
|
8918
9123
|
const slots = currentRoute.slots ?? {};
|
|
8919
|
-
|
|
8920
|
-
const
|
|
9124
|
+
stateRef.current = state;
|
|
9125
|
+
const prevLayoutState = prevRoute ? resolveLayoutState(prevRoute.state) : null;
|
|
9126
|
+
const pageBg = selectPageBackground(state);
|
|
8921
9127
|
const topVisible = !!state.sections.top?.visible;
|
|
8922
9128
|
const midVisible = !!state.sections.mid?.visible;
|
|
8923
9129
|
const bottomVisible = !!state.sections.bottom?.visible;
|
|
8924
9130
|
const showTopDivisor = topVisible && (midVisible || bottomVisible);
|
|
8925
9131
|
const showBottomDivisor = bottomVisible && (topVisible || midVisible);
|
|
8926
9132
|
const showFullBottomDivisor = bottomVisible && !topVisible && !midVisible;
|
|
8927
|
-
const
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
});
|
|
8932
|
-
const layoutHeightsRef = (0, import_react35.useRef)(layoutHeights);
|
|
8933
|
-
layoutHeightsRef.current = layoutHeights;
|
|
8934
|
-
const stateRef = (0, import_react35.useRef)(state);
|
|
8935
|
-
stateRef.current = state;
|
|
8936
|
-
const bodyOverflowRef = (0, import_react35.useRef)(false);
|
|
8937
|
-
const [pageCanScroll, setPageCanScroll] = (0, import_react35.useState)(false);
|
|
8938
|
-
const settleTimer = (0, import_react35.useRef)(null);
|
|
8939
|
-
const scrollRef = (0, import_react35.useRef)(null);
|
|
8940
|
-
const innerScrollRef = (0, import_react35.useRef)(null);
|
|
8941
|
-
const rootViewRef = (0, import_react35.useRef)(null);
|
|
8942
|
-
const capHolderRef = (0, import_react35.useRef)(null);
|
|
8943
|
-
const naturalsRef = (0, import_react35.useRef)({
|
|
8944
|
-
top: H / 3,
|
|
8945
|
-
mid: H / 3,
|
|
8946
|
-
bottom: H / 3
|
|
8947
|
-
});
|
|
8948
|
-
const lastMeasured = (0, import_react35.useRef)({ top: 0, mid: 0, bottom: 0 });
|
|
8949
|
-
const routeChangedAt = (0, import_react35.useRef)(0);
|
|
8950
|
-
const computeTargets = (st) => {
|
|
8951
|
-
const base = { top: 0, mid: 0, bottom: 0 };
|
|
8952
|
-
for (const k of SECTION_KEYS) {
|
|
8953
|
-
const b = st.sections[k];
|
|
8954
|
-
if (!b?.visible) {
|
|
8955
|
-
base[k] = 0;
|
|
8956
|
-
continue;
|
|
8957
|
-
}
|
|
8958
|
-
const h = b.height ?? "content";
|
|
8959
|
-
if (h === "content") base[k] = naturalsRef.current[k];
|
|
8960
|
-
else if (h === "third") base[k] = H / 3;
|
|
8961
|
-
else if (h === "fill") base[k] = H;
|
|
8962
|
-
else if (h === "fillRest") base[k] = b.restsOn ? H - naturalsRef.current[b.restsOn] : 0;
|
|
8963
|
-
else if (h === "minFillRest") {
|
|
8964
|
-
const rest = b.restsOn ? H - naturalsRef.current[b.restsOn] : 0;
|
|
8965
|
-
base[k] = Math.max(naturalsRef.current[k], rest);
|
|
8966
|
-
} else base[k] = h;
|
|
8967
|
-
}
|
|
8968
|
-
return base;
|
|
8969
|
-
};
|
|
8970
|
-
const bottomViewport = () => {
|
|
8971
|
-
const b = stateRef.current.sections.bottom;
|
|
8972
|
-
if (!b?.restsOn) return H;
|
|
8973
|
-
const rest = H - naturalsRef.current[b.restsOn];
|
|
8974
|
-
return rest > 0 ? rest : H;
|
|
8975
|
-
};
|
|
9133
|
+
const computeTargets = (0, import_react35.useCallback)(
|
|
9134
|
+
(st) => computeSectionTargets(st, naturalsRef.current, HRef.current),
|
|
9135
|
+
[]
|
|
9136
|
+
);
|
|
8976
9137
|
const applyTargets = (0, import_react35.useCallback)((next) => {
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
9138
|
+
const sanitized = {
|
|
9139
|
+
top: _sanitize(next.top),
|
|
9140
|
+
mid: _sanitize(next.mid),
|
|
9141
|
+
bottom: _sanitize(next.bottom)
|
|
9142
|
+
};
|
|
9143
|
+
if (SECTION_KEYS.every((k) => appliedRef.current[k] === sanitized[k])) return;
|
|
9144
|
+
appliedRef.current = sanitized;
|
|
9145
|
+
layoutDebug("apply", { targets: sanitized });
|
|
9146
|
+
setLayoutHeights(sanitized);
|
|
9147
|
+
}, []);
|
|
9148
|
+
const clearProbe = (0, import_react35.useCallback)((k) => {
|
|
9149
|
+
const timer = probeTimers.current[k];
|
|
9150
|
+
if (timer) {
|
|
9151
|
+
clearInterval(timer);
|
|
9152
|
+
probeTimers.current[k] = null;
|
|
8982
9153
|
}
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
if (
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
9154
|
+
}, []);
|
|
9155
|
+
const clearAllProbes = (0, import_react35.useCallback)(() => {
|
|
9156
|
+
SECTION_KEYS.forEach((k) => clearProbe(k));
|
|
9157
|
+
}, [clearProbe]);
|
|
9158
|
+
const recordMeasurement = (0, import_react35.useCallback)(
|
|
9159
|
+
(k, h, routeName) => {
|
|
9160
|
+
if (routeName !== currentRouteNameRef.current) return;
|
|
9161
|
+
if (!isValidMeasurement(h)) return;
|
|
9162
|
+
if (naturalsRef.current[k] === h) return;
|
|
9163
|
+
naturalsRef.current = { ...naturalsRef.current, [k]: h };
|
|
9164
|
+
writeNaturals(routeSnapshotRef.current, routeName, naturalsRef.current);
|
|
9165
|
+
layoutDebug("measure", {
|
|
9166
|
+
section: k,
|
|
9167
|
+
height: h,
|
|
9168
|
+
route: routeName,
|
|
9169
|
+
naturals: naturalsRef.current
|
|
9170
|
+
});
|
|
9171
|
+
applyTargets(computeTargets(stateRef.current));
|
|
9172
|
+
if (k === "bottom" && stateRef.current.pageScroll && stateRef.current.sections.bottom?.visible) {
|
|
9173
|
+
const overflows = bottomOverflows(stateRef.current, naturalsRef.current, HRef.current);
|
|
9174
|
+
setPageCanScroll(overflows);
|
|
9175
|
+
layoutDebug("pageScroll", { overflows });
|
|
9176
|
+
if (!overflows && bodyOverflowRef.current) {
|
|
9177
|
+
scrollRef.current?.scrollTo({ y: 0, animated: false });
|
|
9178
|
+
}
|
|
9179
|
+
bodyOverflowRef.current = overflows;
|
|
8995
9180
|
}
|
|
8996
|
-
}
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9181
|
+
},
|
|
9182
|
+
[applyTargets, computeTargets]
|
|
9183
|
+
);
|
|
9184
|
+
const startProbe = (0, import_react35.useCallback)(
|
|
9185
|
+
(k) => {
|
|
9186
|
+
clearProbe(k);
|
|
9187
|
+
const routeAtStart = currentRouteNameRef.current;
|
|
9188
|
+
const startedAt = Date.now();
|
|
9189
|
+
probeLast.current[k] = null;
|
|
9190
|
+
probeStable.current[k] = 0;
|
|
9191
|
+
probeTimers.current[k] = setInterval(() => {
|
|
9192
|
+
const view = proxyRefs.current[k];
|
|
9193
|
+
if (!view || currentRouteNameRef.current !== routeAtStart) {
|
|
9194
|
+
clearProbe(k);
|
|
9195
|
+
return;
|
|
9196
|
+
}
|
|
9197
|
+
view.measure((_x, _y, _w, h) => {
|
|
9198
|
+
if (currentRouteNameRef.current !== routeAtStart) {
|
|
9199
|
+
clearProbe(k);
|
|
9200
|
+
return;
|
|
9201
|
+
}
|
|
9202
|
+
if (!isValidMeasurement(h)) return;
|
|
9203
|
+
const last = probeLast.current[k];
|
|
9204
|
+
probeLast.current[k] = h;
|
|
9205
|
+
if (last === h) {
|
|
9206
|
+
probeStable.current[k] = (probeStable.current[k] ?? 0) + 1;
|
|
9207
|
+
} else {
|
|
9208
|
+
probeStable.current[k] = 0;
|
|
9209
|
+
recordMeasurement(k, h, routeAtStart);
|
|
9210
|
+
}
|
|
9211
|
+
if ((probeStable.current[k] ?? 0) >= PROBE_STABLE_HITS || Date.now() - startedAt > PROBE_MAX_MS) {
|
|
9212
|
+
clearProbe(k);
|
|
9213
|
+
}
|
|
9214
|
+
});
|
|
9215
|
+
}, PROBE_INTERVAL_MS);
|
|
9216
|
+
},
|
|
9217
|
+
[clearProbe, recordMeasurement]
|
|
9218
|
+
);
|
|
9219
|
+
const onProxyLayout = (0, import_react35.useCallback)(
|
|
9220
|
+
(k) => (e) => {
|
|
9221
|
+
const h = e.nativeEvent.layout.height;
|
|
9222
|
+
if (isValidMeasurement(h)) {
|
|
9223
|
+
recordMeasurement(k, h, currentRouteNameRef.current);
|
|
9016
9224
|
}
|
|
9017
|
-
|
|
9018
|
-
}
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
animateTransitions && prevRoute !== null && !reduceMotion && inRemountWindow ? _withBottomHold(targets, layoutHeightsRef.current) : targets
|
|
9022
|
-
);
|
|
9023
|
-
};
|
|
9225
|
+
startProbe(k);
|
|
9226
|
+
},
|
|
9227
|
+
[recordMeasurement, startProbe]
|
|
9228
|
+
);
|
|
9024
9229
|
(0, import_react35.useLayoutEffect)(() => {
|
|
9025
|
-
|
|
9230
|
+
const reset = shouldResetScroll(currentRouteNameRef.current, currentRoute.name);
|
|
9231
|
+
if (reset) {
|
|
9026
9232
|
scrollRef.current?.scrollTo({ y: 0, animated: false });
|
|
9027
9233
|
innerScrollRef.current?.scrollTo({ y: 0, animated: false });
|
|
9028
9234
|
}
|
|
9029
|
-
|
|
9030
|
-
|
|
9235
|
+
currentRouteNameRef.current = currentRoute.name;
|
|
9236
|
+
clearAllProbes();
|
|
9237
|
+
naturalsRef.current = seedNaturals(
|
|
9238
|
+
routeSnapshotRef.current,
|
|
9239
|
+
currentRoute.name,
|
|
9240
|
+
initialNaturals(HRef.current)
|
|
9031
9241
|
);
|
|
9032
|
-
|
|
9242
|
+
layoutDebug("seed", {
|
|
9243
|
+
route: currentRoute.name,
|
|
9244
|
+
lastRoute: prevRoute?.name ?? null,
|
|
9245
|
+
resetScroll: reset,
|
|
9246
|
+
naturals: naturalsRef.current
|
|
9247
|
+
});
|
|
9248
|
+
bodyOverflowRef.current = false;
|
|
9033
9249
|
const targets = computeTargets(state);
|
|
9034
|
-
|
|
9035
|
-
const
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
applyTargets(targets);
|
|
9044
|
-
}, LAYOUT_DURATION);
|
|
9045
|
-
}
|
|
9046
|
-
applyTargets(applied);
|
|
9250
|
+
applyTargets(targets);
|
|
9251
|
+
const overflows = !!state.pageScroll && bottomOverflows(state, naturalsRef.current, HRef.current);
|
|
9252
|
+
setPageCanScroll(overflows);
|
|
9253
|
+
layoutDebug("route", {
|
|
9254
|
+
route: currentRoute.name,
|
|
9255
|
+
state: currentRoute.state,
|
|
9256
|
+
targets,
|
|
9257
|
+
pageCanScroll: overflows
|
|
9258
|
+
});
|
|
9047
9259
|
if (revealEnabled && prevRoute) {
|
|
9048
9260
|
startReveal();
|
|
9049
9261
|
}
|
|
@@ -9053,51 +9265,25 @@ function AppLayout({
|
|
|
9053
9265
|
const cur = state.sections[k];
|
|
9054
9266
|
const prevB = prevLayoutState?.sections[k];
|
|
9055
9267
|
const prevVisible = !!prevB?.visible;
|
|
9056
|
-
|
|
9057
|
-
const
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
const
|
|
9061
|
-
const
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
style: styles71.innerScroll,
|
|
9076
|
-
showsVerticalScrollIndicator: false,
|
|
9077
|
-
children: content
|
|
9078
|
-
}
|
|
9079
|
-
) : selfMeasured ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: styles71.measureNatural, onLayout: makeOnMeasure(k), children: content }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: styles71.sectionContent, children: content });
|
|
9080
|
-
const revealContent = revealEnabled;
|
|
9081
|
-
inner = /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
9082
|
-
isDynamic && !selfMeasured && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9083
|
-
import_react_native77.View,
|
|
9084
|
-
{
|
|
9085
|
-
pointerEvents: "none",
|
|
9086
|
-
style: styles71.measureOuter,
|
|
9087
|
-
onLayout: makeOnMeasure(k),
|
|
9088
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: styles71.measureCopy, children: content })
|
|
9089
|
-
}
|
|
9090
|
-
),
|
|
9091
|
-
revealContent ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9092
|
-
import_react_native77.View,
|
|
9093
|
-
{
|
|
9094
|
-
style: [styles71.reveal, revealHidden && styles71.revealHidden],
|
|
9095
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native_reanimated16.default.View, { style: [styles71.reveal, revealStyle], children: body })
|
|
9096
|
-
}
|
|
9097
|
-
) : body
|
|
9098
|
-
] });
|
|
9099
|
-
}
|
|
9100
|
-
const bg = cur?.backgroundColor ?? prevB?.backgroundColor ?? DEFAULT_COLORS[k];
|
|
9268
|
+
if (!cur?.visible && !prevVisible) return null;
|
|
9269
|
+
const usePrevContent = !cur?.visible && prevVisible;
|
|
9270
|
+
const behavior = usePrevContent ? prevB : cur;
|
|
9271
|
+
const slot = behavior?.slot;
|
|
9272
|
+
const content = slot ? usePrevContent ? prevRoute?.slots?.[slot] : slots[slot] : null;
|
|
9273
|
+
const isDynamic = behavior?.height === "content" || behavior?.height === "minFillRest";
|
|
9274
|
+
const scroll = behavior?.scroll ?? false;
|
|
9275
|
+
const height = layoutHeights[k];
|
|
9276
|
+
const bg = behavior?.backgroundColor ?? SECTION_DEFAULT_COLORS[k];
|
|
9277
|
+
const measureCurrent = isDynamic && !usePrevContent;
|
|
9278
|
+
const body = scroll ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9279
|
+
import_react_native77.ScrollView,
|
|
9280
|
+
{
|
|
9281
|
+
ref: innerScrollRef,
|
|
9282
|
+
style: styles71.innerScroll,
|
|
9283
|
+
showsVerticalScrollIndicator: false,
|
|
9284
|
+
children: content
|
|
9285
|
+
}
|
|
9286
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: styles71.sectionContent, children: content });
|
|
9101
9287
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
9102
9288
|
import_react_native_reanimated16.default.View,
|
|
9103
9289
|
{
|
|
@@ -9105,90 +9291,71 @@ function AppLayout({
|
|
|
9105
9291
|
collapsable: false,
|
|
9106
9292
|
style: [
|
|
9107
9293
|
styles71.colBlock,
|
|
9108
|
-
{ backgroundColor: bg, height }
|
|
9109
|
-
hasTransition && animateTransitions && styles71.clip
|
|
9294
|
+
{ backgroundColor: bg, height }
|
|
9110
9295
|
],
|
|
9111
9296
|
children: [
|
|
9112
|
-
|
|
9297
|
+
measureCurrent && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9113
9298
|
import_react_native77.View,
|
|
9114
9299
|
{
|
|
9300
|
+
ref: (r) => {
|
|
9301
|
+
proxyRefs.current[k] = r;
|
|
9302
|
+
},
|
|
9115
9303
|
pointerEvents: "none",
|
|
9116
|
-
style:
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
right: 0,
|
|
9120
|
-
bottom: -FULLBOTTOM_CUSHION,
|
|
9121
|
-
height: FULLBOTTOM_CUSHION,
|
|
9122
|
-
backgroundColor: bg
|
|
9123
|
-
}
|
|
9304
|
+
style: styles71.measureOuter,
|
|
9305
|
+
onLayout: onProxyLayout(k),
|
|
9306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: styles71.measureCopy, children: content })
|
|
9124
9307
|
}
|
|
9125
9308
|
),
|
|
9126
|
-
|
|
9309
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: [styles71.sectionFill, hasTransition && animateTransitions && styles71.clip], children: revealEnabled ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: [styles71.reveal, revealHidden && styles71.revealHidden], children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native_reanimated16.default.View, { style: [styles71.reveal, revealStyle], children: body }) }) : body })
|
|
9127
9310
|
]
|
|
9128
9311
|
},
|
|
9129
9312
|
k
|
|
9130
9313
|
);
|
|
9131
9314
|
};
|
|
9132
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(AppNavigationContext.Provider, { value: navigationValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(AppNavigationContext.Provider, { value: navigationValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react_native77.View, { style: [styles71.root, { backgroundColor: pageBg }], children: [
|
|
9316
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
9317
|
+
import_react_native77.ScrollView,
|
|
9318
|
+
{
|
|
9319
|
+
ref: scrollRef,
|
|
9320
|
+
style: styles71.pageScroll,
|
|
9321
|
+
contentContainerStyle: [styles71.pageContent, { backgroundColor: pageBg }],
|
|
9322
|
+
scrollEnabled: !!state.pageScroll && pageCanScroll,
|
|
9323
|
+
bounces: false,
|
|
9324
|
+
overScrollMode: "never",
|
|
9325
|
+
showsVerticalScrollIndicator: false,
|
|
9326
|
+
children: [
|
|
9327
|
+
renderSection("top"),
|
|
9328
|
+
showTopDivisor && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9329
|
+
import_react_native_reanimated16.default.View,
|
|
9330
|
+
{
|
|
9331
|
+
layout: hasTransition && animateTransitions ? transition2 : void 0,
|
|
9332
|
+
collapsable: false,
|
|
9333
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Divisor, { position: "top", handle: currentRoute.state === "top" })
|
|
9334
|
+
}
|
|
9335
|
+
),
|
|
9336
|
+
renderSection("mid"),
|
|
9337
|
+
(showBottomDivisor || showFullBottomDivisor) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9338
|
+
import_react_native_reanimated16.default.View,
|
|
9339
|
+
{
|
|
9340
|
+
layout: hasTransition && animateTransitions ? transition2 : void 0,
|
|
9341
|
+
collapsable: false,
|
|
9342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9343
|
+
Divisor,
|
|
9161
9344
|
{
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
{
|
|
9167
|
-
position: "bottom",
|
|
9168
|
-
handle: currentRoute.state === "bottom" || showFullBottomDivisor,
|
|
9169
|
-
height: FULLBOTTOM_DIVISOR_H,
|
|
9170
|
-
extend: showFullBottomDivisor ? FULLBOTTOM_EXTEND : 0,
|
|
9171
|
-
style: (
|
|
9172
|
-
// El traslado de 5px es para ubicar el borde bajo el mid
|
|
9173
|
-
// (header). En full-bottom no hay header: el cap sobresale
|
|
9174
|
-
// FULLBOTTOM_OVERSCAN px por encima del tope (recortado por
|
|
9175
|
-
// el ScrollView) y FULLBOTTOM_EXTEND px sobre la hoja; la
|
|
9176
|
-
// hoja se contrae en (FULLBOTTOM_DIVISOR_H - OVERSCAN) para
|
|
9177
|
-
// que divisor + hoja sigan sumando exactamente una pantalla.
|
|
9178
|
-
showFullBottomDivisor ? { marginTop: -FULLBOTTOM_OVERSCAN } : { transform: [{ translateY: 5 }] }
|
|
9179
|
-
)
|
|
9180
|
-
}
|
|
9181
|
-
) })
|
|
9345
|
+
position: "bottom",
|
|
9346
|
+
handle: currentRoute.state === "bottom" || showFullBottomDivisor,
|
|
9347
|
+
height: FULLBOTTOM_DIVISOR_H,
|
|
9348
|
+
style: showFullBottomDivisor ? void 0 : { transform: [{ translateY: 5 }] }
|
|
9182
9349
|
}
|
|
9183
|
-
)
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
}
|
|
9191
|
-
) });
|
|
9350
|
+
)
|
|
9351
|
+
}
|
|
9352
|
+
),
|
|
9353
|
+
renderSection("bottom")
|
|
9354
|
+
]
|
|
9355
|
+
}
|
|
9356
|
+
),
|
|
9357
|
+
showBackButton && canGoBack && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_native77.View, { style: styles71.backBar, pointerEvents: "box-none", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Button, { variant: "secondary", size: "sm", label: "\u2190 Volver", onPress: back }) })
|
|
9358
|
+
] }) });
|
|
9192
9359
|
}
|
|
9193
9360
|
var styles71 = import_react_native77.StyleSheet.create({
|
|
9194
9361
|
root: {
|
|
@@ -9204,6 +9371,11 @@ var styles71 = import_react_native77.StyleSheet.create({
|
|
|
9204
9371
|
width: "100%",
|
|
9205
9372
|
position: "relative"
|
|
9206
9373
|
},
|
|
9374
|
+
// El contenido visible llena la sección de alto fijo. El recorte de la
|
|
9375
|
+
// transición se agrega encima (styles.clip) solo cuando hay morph.
|
|
9376
|
+
sectionFill: {
|
|
9377
|
+
flex: 1
|
|
9378
|
+
},
|
|
9207
9379
|
clip: {
|
|
9208
9380
|
overflow: "hidden"
|
|
9209
9381
|
},
|
|
@@ -9213,6 +9385,8 @@ var styles71 = import_react_native77.StyleSheet.create({
|
|
|
9213
9385
|
revealHidden: {
|
|
9214
9386
|
opacity: 0
|
|
9215
9387
|
},
|
|
9388
|
+
// Proxy de medición: absoluto, invisible y sin alto fijo. Mide la altura
|
|
9389
|
+
// intrínseca real del contenido sin que el alto de la sección lo restrinja.
|
|
9216
9390
|
measureOuter: {
|
|
9217
9391
|
position: "absolute",
|
|
9218
9392
|
top: 0,
|
|
@@ -9224,9 +9398,6 @@ var styles71 = import_react_native77.StyleSheet.create({
|
|
|
9224
9398
|
measureCopy: {
|
|
9225
9399
|
width: "100%"
|
|
9226
9400
|
},
|
|
9227
|
-
measureNatural: {
|
|
9228
|
-
width: "100%"
|
|
9229
|
-
},
|
|
9230
9401
|
sectionContent: {
|
|
9231
9402
|
flex: 1
|
|
9232
9403
|
},
|
|
@@ -9243,7 +9414,7 @@ var styles71 = import_react_native77.StyleSheet.create({
|
|
|
9243
9414
|
|
|
9244
9415
|
// src/layout/AppShell.tsx
|
|
9245
9416
|
var import_react36 = require("react");
|
|
9246
|
-
var
|
|
9417
|
+
var import_react_native78 = require("react-native");
|
|
9247
9418
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
9248
9419
|
var AppShellContext = (0, import_react36.createContext)(null);
|
|
9249
9420
|
function useAppShell() {
|
|
@@ -9295,7 +9466,7 @@ function AppShell({
|
|
|
9295
9466
|
setStack([name]);
|
|
9296
9467
|
}, []);
|
|
9297
9468
|
(0, import_react36.useEffect)(() => {
|
|
9298
|
-
const sub =
|
|
9469
|
+
const sub = import_react_native78.BackHandler.addEventListener("hardwareBackPress", () => {
|
|
9299
9470
|
if (stack.length > 1) {
|
|
9300
9471
|
back();
|
|
9301
9472
|
return true;
|
|
@@ -9341,7 +9512,7 @@ function directionSign(dir) {
|
|
|
9341
9512
|
}
|
|
9342
9513
|
|
|
9343
9514
|
// src/components/camera/CameraScreenContainer.tsx
|
|
9344
|
-
var
|
|
9515
|
+
var import_react_native79 = require("react-native");
|
|
9345
9516
|
|
|
9346
9517
|
// src/components/camera/palette.ts
|
|
9347
9518
|
var import_antonella_theme72 = require("@william-callao/antonella-theme");
|
|
@@ -9365,9 +9536,9 @@ var cameraPalette = {
|
|
|
9365
9536
|
// src/components/camera/CameraScreenContainer.tsx
|
|
9366
9537
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
9367
9538
|
function CameraScreenContainer({ children, style }) {
|
|
9368
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
9539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react_native79.View, { accessibilityViewIsModal: true, style: [styles72.root, style], testID: "camera-screen-container", children });
|
|
9369
9540
|
}
|
|
9370
|
-
var styles72 =
|
|
9541
|
+
var styles72 = import_react_native79.StyleSheet.create({
|
|
9371
9542
|
root: {
|
|
9372
9543
|
flex: 1,
|
|
9373
9544
|
backgroundColor: cameraPalette.background,
|
|
@@ -9378,12 +9549,12 @@ var styles72 = import_react_native80.StyleSheet.create({
|
|
|
9378
9549
|
// src/components/camera/CameraPermissionGate.tsx
|
|
9379
9550
|
var import_react37 = __toESM(require("react"));
|
|
9380
9551
|
var import_expo_camera = require("expo-camera");
|
|
9381
|
-
var
|
|
9552
|
+
var import_react_native81 = require("react-native");
|
|
9382
9553
|
var import_react_native_safe_area_context10 = require("react-native-safe-area-context");
|
|
9383
9554
|
var import_antonella_theme74 = require("@william-callao/antonella-theme");
|
|
9384
9555
|
|
|
9385
9556
|
// src/components/camera/CameraHud.tsx
|
|
9386
|
-
var
|
|
9557
|
+
var import_react_native80 = require("react-native");
|
|
9387
9558
|
var import_react_native_safe_area_context9 = require("react-native-safe-area-context");
|
|
9388
9559
|
var import_antonella_theme73 = require("@william-callao/antonella-theme");
|
|
9389
9560
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
@@ -9403,16 +9574,16 @@ function CameraHud({
|
|
|
9403
9574
|
}) {
|
|
9404
9575
|
const insets = (0, import_react_native_safe_area_context9.useSafeAreaInsets)();
|
|
9405
9576
|
const isCapture = onCapture != null;
|
|
9406
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
9577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_react_native80.View, { style: import_react_native80.StyleSheet.absoluteFill, pointerEvents: "box-none", children: [
|
|
9407
9578
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
9408
|
-
|
|
9579
|
+
import_react_native80.View,
|
|
9409
9580
|
{
|
|
9410
9581
|
style: [styles73.topBar, { paddingTop: insets.top + import_antonella_theme73.space.space2 }],
|
|
9411
9582
|
pointerEvents: "box-none",
|
|
9412
9583
|
children: [
|
|
9413
|
-
onClose ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(HudIconButton, { icon: closeIcon, label: "Volver", onPress: onClose }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9414
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9415
|
-
isCapture ? flash != null && onToggleFlash ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(FlashButton, { flash, onPress: onToggleFlash }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9584
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(HudIconButton, { icon: closeIcon, label: "Volver", onPress: onClose }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.topSlot }),
|
|
9585
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.topTitle, children: title ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Text, { variant: "label", color: cameraPalette.text, children: title }) : null }),
|
|
9586
|
+
isCapture ? flash != null && onToggleFlash ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(FlashButton, { flash, onPress: onToggleFlash }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.topSlot }) : torch != null && onToggleTorch ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9416
9587
|
HudIconButton,
|
|
9417
9588
|
{
|
|
9418
9589
|
icon: torch ? "torch" : "torch-off",
|
|
@@ -9420,19 +9591,19 @@ function CameraHud({
|
|
|
9420
9591
|
active: torch,
|
|
9421
9592
|
onPress: onToggleTorch
|
|
9422
9593
|
}
|
|
9423
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9594
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.topSlot })
|
|
9424
9595
|
]
|
|
9425
9596
|
}
|
|
9426
9597
|
),
|
|
9427
9598
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
9428
|
-
|
|
9599
|
+
import_react_native80.View,
|
|
9429
9600
|
{
|
|
9430
9601
|
style: [styles73.bottomBar, { paddingBottom: Math.max(insets.bottom, import_antonella_theme73.space.space4) }],
|
|
9431
9602
|
pointerEvents: "box-none",
|
|
9432
9603
|
children: [
|
|
9433
|
-
onFlipCamera && canFlipCamera ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(HudIconButton, { icon: "flip-camera", label: "Girar c\xE1mara", onPress: onFlipCamera }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9434
|
-
isCapture && onCapture ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ShutterButton, { busy: capturing, enabled: canCapture, onPress: onCapture }) : torch != null && onToggleTorch ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(BigTorchButton, { torch, onPress: onToggleTorch }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9435
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9604
|
+
onFlipCamera && canFlipCamera ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(HudIconButton, { icon: "flip-camera", label: "Girar c\xE1mara", onPress: onFlipCamera }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.bottomSlot }),
|
|
9605
|
+
isCapture && onCapture ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ShutterButton, { busy: capturing, enabled: canCapture, onPress: onCapture }) : torch != null && onToggleTorch ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(BigTorchButton, { torch, onPress: onToggleTorch }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.bottomSlot }),
|
|
9606
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.bottomSlot })
|
|
9436
9607
|
]
|
|
9437
9608
|
}
|
|
9438
9609
|
)
|
|
@@ -9440,7 +9611,7 @@ function CameraHud({
|
|
|
9440
9611
|
}
|
|
9441
9612
|
function HudIconButton({ icon, label, onPress, active = false, size = "md" }) {
|
|
9442
9613
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9443
|
-
|
|
9614
|
+
import_react_native80.Pressable,
|
|
9444
9615
|
{
|
|
9445
9616
|
accessibilityRole: "button",
|
|
9446
9617
|
accessibilityLabel: label,
|
|
@@ -9469,7 +9640,7 @@ function FlashButton({ flash, onPress }) {
|
|
|
9469
9640
|
const active = flash !== "off";
|
|
9470
9641
|
const label = flash === "auto" ? "Auto" : active ? "Flash" : "Apagado";
|
|
9471
9642
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
9472
|
-
|
|
9643
|
+
import_react_native80.Pressable,
|
|
9473
9644
|
{
|
|
9474
9645
|
accessibilityRole: "button",
|
|
9475
9646
|
accessibilityLabel: `Flash: ${label}`,
|
|
@@ -9503,7 +9674,7 @@ function ShutterButton({
|
|
|
9503
9674
|
}) {
|
|
9504
9675
|
const disabledShutter = busy || enabled === false || onPress == null;
|
|
9505
9676
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9506
|
-
|
|
9677
|
+
import_react_native80.Pressable,
|
|
9507
9678
|
{
|
|
9508
9679
|
accessibilityRole: "button",
|
|
9509
9680
|
accessibilityLabel: "Tomar foto",
|
|
@@ -9515,11 +9686,11 @@ function ShutterButton({
|
|
|
9515
9686
|
pressed && !disabledShutter && styles73.shutterPressed,
|
|
9516
9687
|
disabledShutter && styles73.shutterDisabled
|
|
9517
9688
|
],
|
|
9518
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.View, { style: styles73.shutterInner, children: busy ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_native80.ActivityIndicator, { color: cameraPalette.background }) : null })
|
|
9519
9690
|
}
|
|
9520
9691
|
);
|
|
9521
9692
|
}
|
|
9522
|
-
var styles73 =
|
|
9693
|
+
var styles73 = import_react_native80.StyleSheet.create({
|
|
9523
9694
|
topBar: {
|
|
9524
9695
|
position: "absolute",
|
|
9525
9696
|
top: 0,
|
|
@@ -9638,12 +9809,12 @@ function CameraStatus({
|
|
|
9638
9809
|
}) {
|
|
9639
9810
|
const insets = (0, import_react_native_safe_area_context10.useSafeAreaInsets)();
|
|
9640
9811
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(CameraScreenContainer, { children: [
|
|
9641
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
9642
|
-
onClose ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(HudIconButton, { icon: "arrow-back", label: "Volver", onPress: onClose }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
9643
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
9644
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
9812
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_react_native81.View, { style: [styles74.header, { paddingTop: insets.top + import_antonella_theme74.space.space2 }], children: [
|
|
9813
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(HudIconButton, { icon: "arrow-back", label: "Volver", onPress: onClose }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react_native81.View, { style: styles74.headerSlot }),
|
|
9814
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react_native81.View, { style: styles74.headerTitle, children: title ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { variant: "label", color: cameraPalette.text, children: title }) : null }),
|
|
9815
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react_native81.View, { style: styles74.headerSlot })
|
|
9645
9816
|
] }),
|
|
9646
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
9817
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_react_native81.View, { style: styles74.body, children: [
|
|
9647
9818
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
9648
9819
|
Icon,
|
|
9649
9820
|
{
|
|
@@ -9658,7 +9829,7 @@ function CameraStatus({
|
|
|
9658
9829
|
] })
|
|
9659
9830
|
] });
|
|
9660
9831
|
}
|
|
9661
|
-
var styles74 =
|
|
9832
|
+
var styles74 = import_react_native81.StyleSheet.create({
|
|
9662
9833
|
header: {
|
|
9663
9834
|
paddingHorizontal: import_antonella_theme74.space.space4,
|
|
9664
9835
|
paddingBottom: import_antonella_theme74.space.space3,
|
|
@@ -9698,7 +9869,7 @@ var styles74 = import_react_native82.StyleSheet.create({
|
|
|
9698
9869
|
// src/components/camera/CameraCaptureScreen.tsx
|
|
9699
9870
|
var import_react38 = require("react");
|
|
9700
9871
|
var import_expo_camera2 = require("expo-camera");
|
|
9701
|
-
var
|
|
9872
|
+
var import_react_native82 = require("react-native");
|
|
9702
9873
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
9703
9874
|
var FLASH_ORDER = ["off", "on", "auto"];
|
|
9704
9875
|
function CameraCaptureScreen({
|
|
@@ -9759,7 +9930,7 @@ function CameraCaptureScreen({
|
|
|
9759
9930
|
import_expo_camera2.CameraView,
|
|
9760
9931
|
{
|
|
9761
9932
|
ref: cameraRef,
|
|
9762
|
-
style:
|
|
9933
|
+
style: import_react_native82.StyleSheet.absoluteFill,
|
|
9763
9934
|
facing: facingState,
|
|
9764
9935
|
flash: flashState,
|
|
9765
9936
|
mirror: facingState === "front" ? mirrorFront : void 0,
|
|
@@ -9792,7 +9963,7 @@ function CameraCaptureScreen({
|
|
|
9792
9963
|
// src/components/camera/BarcodeScannerScreen.tsx
|
|
9793
9964
|
var import_react39 = require("react");
|
|
9794
9965
|
var import_expo_camera3 = require("expo-camera");
|
|
9795
|
-
var
|
|
9966
|
+
var import_react_native83 = require("react-native");
|
|
9796
9967
|
var import_react_native_reanimated17 = __toESM(require("react-native-reanimated"));
|
|
9797
9968
|
var import_antonella_theme75 = require("@william-callao/antonella-theme");
|
|
9798
9969
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
@@ -9827,7 +9998,7 @@ function BarcodeScannerScreen({
|
|
|
9827
9998
|
if (now - lastScanAt.current < throttleMs) return;
|
|
9828
9999
|
lastScanAt.current = now;
|
|
9829
10000
|
locked.current = true;
|
|
9830
|
-
if (haptics &&
|
|
10001
|
+
if (haptics && import_react_native83.Platform.OS !== "web") import_react_native83.Vibration.vibrate(80);
|
|
9831
10002
|
onScan?.({ type: result.type, value: result.data });
|
|
9832
10003
|
setTimeout(() => {
|
|
9833
10004
|
locked.current = false;
|
|
@@ -9845,7 +10016,7 @@ function BarcodeScannerScreen({
|
|
|
9845
10016
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9846
10017
|
import_expo_camera3.CameraView,
|
|
9847
10018
|
{
|
|
9848
|
-
style:
|
|
10019
|
+
style: import_react_native83.StyleSheet.absoluteFill,
|
|
9849
10020
|
facing: facingState,
|
|
9850
10021
|
enableTorch: torch,
|
|
9851
10022
|
mode: "picture",
|
|
@@ -9890,17 +10061,17 @@ function Viewfinder({ caption }) {
|
|
|
9890
10061
|
const lineStyle = (0, import_react_native_reanimated17.useAnimatedStyle)(() => ({
|
|
9891
10062
|
transform: [{ translateY: box ? progress.value * Math.max(0, box.h - 24) : 0 }]
|
|
9892
10063
|
}));
|
|
9893
|
-
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9894
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
10064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: import_react_native83.StyleSheet.absoluteFill, pointerEvents: "none", onLayout, children: box ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
|
|
10065
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: [styles75.dim, styles75.dimTop, { height: box.y }] }),
|
|
9895
10066
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9896
|
-
|
|
10067
|
+
import_react_native83.View,
|
|
9897
10068
|
{
|
|
9898
10069
|
style: [styles75.dim, styles75.dimBottom, { top: box.y + box.h }]
|
|
9899
10070
|
}
|
|
9900
10071
|
),
|
|
9901
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
10072
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: [styles75.dim, styles75.dimSide, { top: box.y, height: box.h, left: 0, width: box.x }] }),
|
|
9902
10073
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9903
|
-
|
|
10074
|
+
import_react_native83.View,
|
|
9904
10075
|
{
|
|
9905
10076
|
style: [
|
|
9906
10077
|
styles75.dim,
|
|
@@ -9910,7 +10081,7 @@ function Viewfinder({ caption }) {
|
|
|
9910
10081
|
}
|
|
9911
10082
|
),
|
|
9912
10083
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9913
|
-
|
|
10084
|
+
import_react_native83.View,
|
|
9914
10085
|
{
|
|
9915
10086
|
style: [
|
|
9916
10087
|
styles75.box,
|
|
@@ -9918,12 +10089,12 @@ function Viewfinder({ caption }) {
|
|
|
9918
10089
|
]
|
|
9919
10090
|
}
|
|
9920
10091
|
),
|
|
9921
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9922
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9923
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9924
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
10092
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: [styles75.corner, styles75.cornerTL, { left: box.x - 2, top: box.y - 2 }] }),
|
|
10093
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: [styles75.corner, styles75.cornerTR, { right: void 0, left: box.x + box.w - 22, top: box.y - 2 }] }),
|
|
10094
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: [styles75.corner, styles75.cornerBL, { left: box.x - 2, top: box.y + box.h - 22 }] }),
|
|
10095
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_native83.View, { style: [styles75.corner, styles75.cornerBR, { left: box.x + box.w - 22, top: box.y + box.h - 22 }] }),
|
|
9925
10096
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9926
|
-
|
|
10097
|
+
import_react_native83.View,
|
|
9927
10098
|
{
|
|
9928
10099
|
style: [
|
|
9929
10100
|
styles75.scanArea,
|
|
@@ -9943,7 +10114,7 @@ function Viewfinder({ caption }) {
|
|
|
9943
10114
|
) : null
|
|
9944
10115
|
] }) : null });
|
|
9945
10116
|
}
|
|
9946
|
-
var styles75 =
|
|
10117
|
+
var styles75 = import_react_native83.StyleSheet.create({
|
|
9947
10118
|
dim: {
|
|
9948
10119
|
position: "absolute",
|
|
9949
10120
|
backgroundColor: cameraPalette.overlay
|
|
@@ -10138,10 +10309,13 @@ var import_antonella_theme76 = require("@william-callao/antonella-theme");
|
|
|
10138
10309
|
hasCode,
|
|
10139
10310
|
hostDirection,
|
|
10140
10311
|
iconMap,
|
|
10312
|
+
isLayoutDebug,
|
|
10313
|
+
layoutDebug,
|
|
10141
10314
|
layoutStates,
|
|
10142
10315
|
removeNode,
|
|
10143
10316
|
resolveComposition,
|
|
10144
10317
|
resolveTransition,
|
|
10318
|
+
setLayoutDebug,
|
|
10145
10319
|
updateNode,
|
|
10146
10320
|
useAppNavigation,
|
|
10147
10321
|
useAppShell,
|