@tamagui/spacer 3.0.0-beta.922.1 → 3.0.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/cjs/Spacer.cjs +3 -4
- package/dist/cjs/Spacer.native.cjs +3 -6
- package/dist/cjs/Spacer.native.js +3 -6
- package/dist/cjs/Spacer.native.js.map +1 -1
- package/dist/cjs/index.cjs +0 -9
- package/dist/cjs/index.native.cjs +0 -9
- package/dist/cjs/index.native.js +0 -9
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Spacer.mjs +3 -4
- package/dist/esm/Spacer.mjs.map +1 -1
- package/dist/esm/Spacer.native.js +3 -6
- package/dist/esm/Spacer.native.js.map +1 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.mjs +0 -6
- package/dist/esm/index.native.js +0 -6
- package/package.json +7 -6
- package/src/Spacer.tsx +14 -13
- package/src/index.ts +0 -3
- package/types/Spacer.d.ts +5 -5
- package/types/Spacer.d.ts.map +1 -1
- package/types/index.d.ts +0 -3
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/Unspaced.cjs +0 -34
- package/dist/cjs/Unspaced.native.cjs +0 -36
- package/dist/cjs/Unspaced.native.js +0 -38
- package/dist/cjs/Unspaced.native.js.map +0 -1
- package/dist/cjs/spacedChildren.cjs +0 -119
- package/dist/cjs/spacedChildren.native.cjs +0 -141
- package/dist/cjs/spacedChildren.native.js +0 -143
- package/dist/cjs/spacedChildren.native.js.map +0 -1
- package/dist/cjs/types.cjs +0 -16
- package/dist/cjs/types.native.cjs +0 -18
- package/dist/cjs/types.native.js +0 -20
- package/dist/cjs/types.native.js.map +0 -1
- package/dist/esm/Unspaced.mjs +0 -11
- package/dist/esm/Unspaced.mjs.map +0 -1
- package/dist/esm/Unspaced.native.js +0 -11
- package/dist/esm/Unspaced.native.js.map +0 -1
- package/dist/esm/spacedChildren.mjs +0 -94
- package/dist/esm/spacedChildren.mjs.map +0 -1
- package/dist/esm/spacedChildren.native.js +0 -114
- package/dist/esm/spacedChildren.native.js.map +0 -1
- package/dist/esm/types.mjs +0 -0
- package/dist/esm/types.native.js +0 -0
- package/src/Unspaced.tsx +0 -11
- package/src/spacedChildren.tsx +0 -134
- package/src/types.ts +0 -21
- package/types/Unspaced.d.ts +0 -9
- package/types/Unspaced.d.ts.map +0 -1
- package/types/spacedChildren.d.ts +0 -4
- package/types/spacedChildren.d.ts.map +0 -1
- package/types/types.d.ts +0 -19
- package/types/types.d.ts.map +0 -1
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
-
get: () => from[key],
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
-
value: mod,
|
|
26
|
-
enumerable: true
|
|
27
|
-
}) : target, mod));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var spacedChildren_exports = {};
|
|
30
|
-
__export(spacedChildren_exports, { spacedChildren: () => spacedChildren });
|
|
31
|
-
module.exports = __toCommonJS(spacedChildren_exports);
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var import_web = require("@tamagui/web");
|
|
34
|
-
var import_react = __toESM(require("react"), 1);
|
|
35
|
-
var import_Spacer = require("./Spacer.native.js");
|
|
36
|
-
var import_Unspaced = require("./Unspaced.native.js");
|
|
37
|
-
function spacedChildren(props) {
|
|
38
|
-
var _childrenList__type, _childrenList_;
|
|
39
|
-
var { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;
|
|
40
|
-
var hasSpace = !!(space || spaceFlex);
|
|
41
|
-
var hasSeparator = !(separator === void 0 || separator === null);
|
|
42
|
-
var areChildrenArray = Array.isArray(children);
|
|
43
|
-
if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {
|
|
44
|
-
return children;
|
|
45
|
-
}
|
|
46
|
-
var childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);
|
|
47
|
-
var len = childrenList.length;
|
|
48
|
-
if (len <= 1 && !isZStack && !((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 ? void 0 : (_childrenList__type = _childrenList_["type"]) === null || _childrenList__type === void 0 ? void 0 : _childrenList__type["shouldForwardSpace"])) {
|
|
49
|
-
return children;
|
|
50
|
-
}
|
|
51
|
-
var final = [];
|
|
52
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
53
|
-
try {
|
|
54
|
-
for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
55
|
-
var [index, child] = _step.value;
|
|
56
|
-
var _child_type;
|
|
57
|
-
var isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
58
|
-
if (!isEmpty && /* @__PURE__ */ import_react.default.isValidElement(child) && ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type["shouldForwardSpace"])) {
|
|
59
|
-
child = /* @__PURE__ */ import_react.default.cloneElement(child, {
|
|
60
|
-
space,
|
|
61
|
-
spaceFlex,
|
|
62
|
-
separator,
|
|
63
|
-
key: child.key
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
67
|
-
final.push(child);
|
|
68
|
-
} else {
|
|
69
|
-
final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, { children: child }) : child }, `${index}0t`));
|
|
70
|
-
}
|
|
71
|
-
if ((0, import_Unspaced.isUnspaced)(child) && index === 0) continue;
|
|
72
|
-
if (isZStack) continue;
|
|
73
|
-
var next = childrenList[index + 1];
|
|
74
|
-
if (next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next)) {
|
|
75
|
-
if (separator) {
|
|
76
|
-
if (hasSpace) {
|
|
77
|
-
final.push(createSpacer({
|
|
78
|
-
key: `_${index}_00t`,
|
|
79
|
-
direction,
|
|
80
|
-
space,
|
|
81
|
-
spaceFlex
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: separator }, `${index}03t`));
|
|
85
|
-
if (hasSpace) {
|
|
86
|
-
final.push(createSpacer({
|
|
87
|
-
key: `_${index}01t`,
|
|
88
|
-
direction,
|
|
89
|
-
space,
|
|
90
|
-
spaceFlex
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
final.push(createSpacer({
|
|
95
|
-
key: `_${index}02t`,
|
|
96
|
-
direction,
|
|
97
|
-
space,
|
|
98
|
-
spaceFlex
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} catch (err) {
|
|
104
|
-
_didIteratorError = true;
|
|
105
|
-
_iteratorError = err;
|
|
106
|
-
} finally {
|
|
107
|
-
try {
|
|
108
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
109
|
-
_iterator.return();
|
|
110
|
-
}
|
|
111
|
-
} finally {
|
|
112
|
-
if (_didIteratorError) {
|
|
113
|
-
throw _iteratorError;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (process.env.NODE_ENV === "development") {
|
|
118
|
-
if (props.debug) {
|
|
119
|
-
console.info(` Spaced children`, final, props);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return final;
|
|
123
|
-
}
|
|
124
|
-
function createSpacer(param) {
|
|
125
|
-
var { key, direction, space, spaceFlex } = param;
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Spacer.Spacer, {
|
|
127
|
-
size: space,
|
|
128
|
-
direction,
|
|
129
|
-
...typeof spaceFlex !== "undefined" && { flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex }
|
|
130
|
-
}, key);
|
|
131
|
-
}
|
|
132
|
-
var AbsoluteFill = (0, import_web.createComponent)({ defaultProps: {
|
|
133
|
-
display: "flex",
|
|
134
|
-
flexDirection: "column",
|
|
135
|
-
position: "absolute",
|
|
136
|
-
top: 0,
|
|
137
|
-
right: 0,
|
|
138
|
-
bottom: 0,
|
|
139
|
-
left: 0,
|
|
140
|
-
pointerEvents: "box-none"
|
|
141
|
-
} });
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
-
get: () => from[key],
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
-
value: mod,
|
|
26
|
-
enumerable: true
|
|
27
|
-
}) : target, mod));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var spacedChildren_exports = {};
|
|
30
|
-
__export(spacedChildren_exports, { spacedChildren: () => spacedChildren });
|
|
31
|
-
module.exports = __toCommonJS(spacedChildren_exports);
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var import_web = require("@tamagui/web");
|
|
34
|
-
var import_react = __toESM(require("react"), 1);
|
|
35
|
-
var import_Spacer = require("./Spacer.native.js");
|
|
36
|
-
var import_Unspaced = require("./Unspaced.native.js");
|
|
37
|
-
function spacedChildren(props) {
|
|
38
|
-
var _childrenList__type, _childrenList_;
|
|
39
|
-
var { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;
|
|
40
|
-
var hasSpace = !!(space || spaceFlex);
|
|
41
|
-
var hasSeparator = !(separator === void 0 || separator === null);
|
|
42
|
-
var areChildrenArray = Array.isArray(children);
|
|
43
|
-
if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {
|
|
44
|
-
return children;
|
|
45
|
-
}
|
|
46
|
-
var childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);
|
|
47
|
-
var len = childrenList.length;
|
|
48
|
-
if (len <= 1 && !isZStack && !((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 ? void 0 : (_childrenList__type = _childrenList_["type"]) === null || _childrenList__type === void 0 ? void 0 : _childrenList__type["shouldForwardSpace"])) {
|
|
49
|
-
return children;
|
|
50
|
-
}
|
|
51
|
-
var final = [];
|
|
52
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
53
|
-
try {
|
|
54
|
-
for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
55
|
-
var [index, child] = _step.value;
|
|
56
|
-
var _child_type;
|
|
57
|
-
var isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
58
|
-
if (!isEmpty && /* @__PURE__ */ import_react.default.isValidElement(child) && ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type["shouldForwardSpace"])) {
|
|
59
|
-
child = /* @__PURE__ */ import_react.default.cloneElement(child, {
|
|
60
|
-
space,
|
|
61
|
-
spaceFlex,
|
|
62
|
-
separator,
|
|
63
|
-
key: child.key
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
67
|
-
final.push(child);
|
|
68
|
-
} else {
|
|
69
|
-
final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, { children: child }) : child }, `${index}0t`));
|
|
70
|
-
}
|
|
71
|
-
if ((0, import_Unspaced.isUnspaced)(child) && index === 0) continue;
|
|
72
|
-
if (isZStack) continue;
|
|
73
|
-
var next = childrenList[index + 1];
|
|
74
|
-
if (next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next)) {
|
|
75
|
-
if (separator) {
|
|
76
|
-
if (hasSpace) {
|
|
77
|
-
final.push(createSpacer({
|
|
78
|
-
key: `_${index}_00t`,
|
|
79
|
-
direction,
|
|
80
|
-
space,
|
|
81
|
-
spaceFlex
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: separator }, `${index}03t`));
|
|
85
|
-
if (hasSpace) {
|
|
86
|
-
final.push(createSpacer({
|
|
87
|
-
key: `_${index}01t`,
|
|
88
|
-
direction,
|
|
89
|
-
space,
|
|
90
|
-
spaceFlex
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
final.push(createSpacer({
|
|
95
|
-
key: `_${index}02t`,
|
|
96
|
-
direction,
|
|
97
|
-
space,
|
|
98
|
-
spaceFlex
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} catch (err) {
|
|
104
|
-
_didIteratorError = true;
|
|
105
|
-
_iteratorError = err;
|
|
106
|
-
} finally {
|
|
107
|
-
try {
|
|
108
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
109
|
-
_iterator.return();
|
|
110
|
-
}
|
|
111
|
-
} finally {
|
|
112
|
-
if (_didIteratorError) {
|
|
113
|
-
throw _iteratorError;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (process.env.NODE_ENV === "development") {
|
|
118
|
-
if (props.debug) {
|
|
119
|
-
console.info(` Spaced children`, final, props);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return final;
|
|
123
|
-
}
|
|
124
|
-
function createSpacer(param) {
|
|
125
|
-
var { key, direction, space, spaceFlex } = param;
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Spacer.Spacer, {
|
|
127
|
-
size: space,
|
|
128
|
-
direction,
|
|
129
|
-
...typeof spaceFlex !== "undefined" && { flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex }
|
|
130
|
-
}, key);
|
|
131
|
-
}
|
|
132
|
-
var AbsoluteFill = (0, import_web.createComponent)({ defaultProps: {
|
|
133
|
-
display: "flex",
|
|
134
|
-
flexDirection: "column",
|
|
135
|
-
position: "absolute",
|
|
136
|
-
top: 0,
|
|
137
|
-
right: 0,
|
|
138
|
-
bottom: 0,
|
|
139
|
-
left: 0,
|
|
140
|
-
pointerEvents: "box-none"
|
|
141
|
-
} });
|
|
142
|
-
|
|
143
|
-
//# sourceMappingURL=spacedChildren.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacedChildren.native.js","names":[],"sources":["cjs/spacedChildren.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar spacedChildren_exports = {};\n__export(spacedChildren_exports, {\n spacedChildren: () => spacedChildren\n});\nmodule.exports = __toCommonJS(spacedChildren_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_web = require(\"@tamagui/web\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_Spacer = require(\"./Spacer\");\nvar import_Unspaced = require(\"./Unspaced\");\nfunction spacedChildren(props) {\n var _childrenList__type, _childrenList_;\n var { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;\n var hasSpace = !!(space || spaceFlex);\n var hasSeparator = !(separator === void 0 || separator === null);\n var areChildrenArray = Array.isArray(children);\n if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {\n return children;\n }\n var childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);\n var len = childrenList.length;\n if (len <= 1 && !isZStack && !((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 ? void 0 : (_childrenList__type = _childrenList_[\"type\"]) === null || _childrenList__type === void 0 ? void 0 : _childrenList__type[\"shouldForwardSpace\"])) {\n return children;\n }\n var final = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [index, child] = _step.value;\n var _child_type;\n var isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;\n if (!isEmpty && /* @__PURE__ */ import_react.default.isValidElement(child) && ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type[\"shouldForwardSpace\"])) {\n child = /* @__PURE__ */ import_react.default.cloneElement(child, {\n space,\n spaceFlex,\n separator,\n key: child.key\n });\n }\n if (isEmpty || !child || child[\"key\"] && !isZStack) {\n final.push(child);\n } else {\n final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, {\n children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, {\n children: child\n }) : child\n }, `${index}0t`));\n }\n if ((0, import_Unspaced.isUnspaced)(child) && index === 0) continue;\n if (isZStack) continue;\n var next = childrenList[index + 1];\n if (next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(createSpacer({\n key: `_${index}_00t`,\n direction,\n space,\n spaceFlex\n }));\n }\n final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, {\n children: separator\n }, `${index}03t`));\n if (hasSpace) {\n final.push(createSpacer({\n key: `_${index}01t`,\n direction,\n space,\n spaceFlex\n }));\n }\n } else {\n final.push(createSpacer({\n key: `_${index}02t`,\n direction,\n space,\n spaceFlex\n }));\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props.debug) {\n console.info(` Spaced children`, final, props);\n }\n }\n return final;\n}\nfunction createSpacer(param) {\n var { key, direction, space, spaceFlex } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Spacer.Spacer, {\n // @ts-ignore\n size: space,\n // @ts-ignore\n direction,\n ...typeof spaceFlex !== \"undefined\" && {\n flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex\n }\n }, key);\n}\nvar AbsoluteFill = (0, import_web.createComponent)({\n defaultProps: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n pointerEvents: \"box-none\"\n }\n});\n//# sourceMappingURL=spacedChildren.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAA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CAAE,cAAc,QAAQ;EAEvE,MAAM;EAEN;EACA,GAAG,OAAO,cAAc,eAAe,EACrC,MAAM,cAAc,OAAO,IAAI,cAAc,QAAQ,IAAI,UAC3D;CACF,GAAG,GAAG;AACR;AACA,IAAI,gBAAgB,GAAG,WAAW,gBAAe,CAAE,EACjD,cAAc;CACZ,SAAS;CACT,eAAe;CACf,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,eAAe;AACjB,EACF,CAAC"}
|
package/dist/cjs/types.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
-
get: () => from[key],
|
|
9
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
-
get: () => from[key],
|
|
11
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
package/dist/cjs/types.native.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
-
get: () => from[key],
|
|
11
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=types.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.native.js","names":[],"sources":["cjs/types.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n//# sourceMappingURL=types.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa"}
|
package/dist/esm/Unspaced.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function Unspaced(props) {
|
|
2
|
-
return props.children;
|
|
3
|
-
}
|
|
4
|
-
Unspaced["isUnspaced"] = true;
|
|
5
|
-
function isUnspaced(child) {
|
|
6
|
-
const t = child?.["type"];
|
|
7
|
-
return t?.["isVisuallyHidden"] || t?.["isUnspaced"];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { Unspaced, isUnspaced };
|
|
11
|
-
//# sourceMappingURL=Unspaced.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Unspaced.js","names":[],"sources":["esm/Unspaced.js"],"sourcesContent":["function Unspaced(props) {\n return props.children;\n}\nUnspaced[\"isUnspaced\"] = true;\nfunction isUnspaced(child) {\n const t = child?.[\"type\"];\n return t?.[\"isVisuallyHidden\"] || t?.[\"isUnspaced\"];\n}\nexport {\n Unspaced,\n isUnspaced\n};\n//# sourceMappingURL=Unspaced.js.map\n"],"mappings":";AAAA,SAAS,SAAS,OAAO;CACvB,OAAO,MAAM;AACf;AACA,SAAS,gBAAgB;AACzB,SAAS,WAAW,OAAO;CACzB,MAAM,IAAI,QAAQ;CAClB,OAAO,IAAI,uBAAuB,IAAI;AACxC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function Unspaced(props) {
|
|
2
|
-
return props.children;
|
|
3
|
-
}
|
|
4
|
-
Unspaced["isUnspaced"] = true;
|
|
5
|
-
function isUnspaced(child) {
|
|
6
|
-
var t = child === null || child === void 0 ? void 0 : child["type"];
|
|
7
|
-
return (t === null || t === void 0 ? void 0 : t["isVisuallyHidden"]) || (t === null || t === void 0 ? void 0 : t["isUnspaced"]);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { Unspaced, isUnspaced };
|
|
11
|
-
//# sourceMappingURL=Unspaced.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Unspaced.native.js","names":[],"sources":["esm/Unspaced.native.js"],"sourcesContent":["function Unspaced(props) {\n return props.children;\n}\nUnspaced[\"isUnspaced\"] = true;\nfunction isUnspaced(child) {\n var t = child === null || child === void 0 ? void 0 : child[\"type\"];\n return (t === null || t === void 0 ? void 0 : t[\"isVisuallyHidden\"]) || (t === null || t === void 0 ? void 0 : t[\"isUnspaced\"]);\n}\nexport {\n Unspaced,\n isUnspaced\n};\n//# sourceMappingURL=Unspaced.js.map\n"],"mappings":";AAAA,SAAS,SAAS,OAAO;CACvB,OAAO,MAAM;AACf;AACA,SAAS,gBAAgB;AACzB,SAAS,WAAW,OAAO;CACzB,IAAI,IAAI,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;CAC5D,QAAQ,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,IAAI,EAAE,yBAAyB,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,IAAI,EAAE;AACnH"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { createComponent } from "@tamagui/web";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Spacer } from "./Spacer.mjs";
|
|
4
|
-
import { isUnspaced } from "./Unspaced.mjs";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
function spacedChildren(props) {
|
|
8
|
-
const { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;
|
|
9
|
-
const hasSpace = !!(space || spaceFlex);
|
|
10
|
-
const hasSeparator = !(separator === void 0 || separator === null);
|
|
11
|
-
const areChildrenArray = Array.isArray(children);
|
|
12
|
-
if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {
|
|
13
|
-
return children;
|
|
14
|
-
}
|
|
15
|
-
const childrenList = areChildrenArray ? children : React.Children.toArray(children);
|
|
16
|
-
const len = childrenList.length;
|
|
17
|
-
if (len <= 1 && !isZStack && !childrenList[0]?.["type"]?.["shouldForwardSpace"]) {
|
|
18
|
-
return children;
|
|
19
|
-
}
|
|
20
|
-
const final = [];
|
|
21
|
-
for (let [index, child] of childrenList.entries()) {
|
|
22
|
-
const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
23
|
-
if (!isEmpty && React.isValidElement(child) && child.type?.["shouldForwardSpace"]) {
|
|
24
|
-
child = React.cloneElement(child, {
|
|
25
|
-
space,
|
|
26
|
-
spaceFlex,
|
|
27
|
-
separator,
|
|
28
|
-
key: child.key
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
32
|
-
final.push(child);
|
|
33
|
-
} else {
|
|
34
|
-
final.push(/* @__PURE__ */ jsx(React.Fragment, { children: isZStack ? /* @__PURE__ */ jsx(AbsoluteFill, { children: child }) : child }, `${index}0t`));
|
|
35
|
-
}
|
|
36
|
-
if (isUnspaced(child) && index === 0) continue;
|
|
37
|
-
if (isZStack) continue;
|
|
38
|
-
const next = childrenList[index + 1];
|
|
39
|
-
if (next && !isEmpty && !isUnspaced(next)) {
|
|
40
|
-
if (separator) {
|
|
41
|
-
if (hasSpace) {
|
|
42
|
-
final.push(createSpacer({
|
|
43
|
-
key: `_${index}_00t`,
|
|
44
|
-
direction,
|
|
45
|
-
space,
|
|
46
|
-
spaceFlex
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
final.push(/* @__PURE__ */ jsx(React.Fragment, { children: separator }, `${index}03t`));
|
|
50
|
-
if (hasSpace) {
|
|
51
|
-
final.push(createSpacer({
|
|
52
|
-
key: `_${index}01t`,
|
|
53
|
-
direction,
|
|
54
|
-
space,
|
|
55
|
-
spaceFlex
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
final.push(createSpacer({
|
|
60
|
-
key: `_${index}02t`,
|
|
61
|
-
direction,
|
|
62
|
-
space,
|
|
63
|
-
spaceFlex
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (process.env.NODE_ENV === "development") {
|
|
69
|
-
if (props.debug) {
|
|
70
|
-
console.info(` Spaced children`, final, props);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return final;
|
|
74
|
-
}
|
|
75
|
-
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
76
|
-
return /* @__PURE__ */ jsx(Spacer, {
|
|
77
|
-
size: space,
|
|
78
|
-
direction,
|
|
79
|
-
...typeof spaceFlex !== "undefined" && { flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex }
|
|
80
|
-
}, key);
|
|
81
|
-
}
|
|
82
|
-
const AbsoluteFill = createComponent({ defaultProps: {
|
|
83
|
-
display: "flex",
|
|
84
|
-
flexDirection: "column",
|
|
85
|
-
position: "absolute",
|
|
86
|
-
top: 0,
|
|
87
|
-
right: 0,
|
|
88
|
-
bottom: 0,
|
|
89
|
-
left: 0,
|
|
90
|
-
pointerEvents: "box-none"
|
|
91
|
-
} });
|
|
92
|
-
|
|
93
|
-
export { spacedChildren };
|
|
94
|
-
//# sourceMappingURL=spacedChildren.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacedChildren.js","names":[],"sources":["esm/spacedChildren.js"],"sourcesContent":["import { createComponent } from \"@tamagui/web\";\nimport React from \"react\";\nimport { Spacer } from \"./Spacer\";\nimport { isUnspaced } from \"./Unspaced\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction spacedChildren(props) {\n const { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;\n const hasSpace = !!(space || spaceFlex);\n const hasSeparator = !(separator === void 0 || separator === null);\n const areChildrenArray = Array.isArray(children);\n if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {\n return children;\n }\n const childrenList = areChildrenArray ? children : React.Children.toArray(children);\n const len = childrenList.length;\n if (len <= 1 && !isZStack && !childrenList[0]?.[\"type\"]?.[\"shouldForwardSpace\"]) {\n return children;\n }\n const final = [];\n for (let [index, child] of childrenList.entries()) {\n const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;\n if (!isEmpty && React.isValidElement(child) && child.type?.[\"shouldForwardSpace\"]) {\n child = React.cloneElement(child, {\n space,\n spaceFlex,\n separator,\n key: child.key\n });\n }\n if (isEmpty || !child || child[\"key\"] && !isZStack) {\n final.push(child);\n } else {\n final.push(\n /* @__PURE__ */ jsx(React.Fragment, { children: isZStack ? /* @__PURE__ */ jsx(AbsoluteFill, { children: child }) : child }, `${index}0t`)\n );\n }\n if (isUnspaced(child) && index === 0) continue;\n if (isZStack) continue;\n const next = childrenList[index + 1];\n if (next && !isEmpty && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_00t`,\n direction,\n space,\n spaceFlex\n })\n );\n }\n final.push(/* @__PURE__ */ jsx(React.Fragment, { children: separator }, `${index}03t`));\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}01t`,\n direction,\n space,\n spaceFlex\n })\n );\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}02t`,\n direction,\n space,\n spaceFlex\n })\n );\n }\n }\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props.debug) {\n console.info(` Spaced children`, final, props);\n }\n }\n return final;\n}\nfunction createSpacer({ key, direction, space, spaceFlex }) {\n return /* @__PURE__ */ jsx(\n Spacer,\n {\n size: space,\n direction,\n ...typeof spaceFlex !== \"undefined\" && {\n flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex\n }\n },\n key\n );\n}\nconst AbsoluteFill = createComponent({\n defaultProps: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n pointerEvents: \"box-none\"\n }\n});\nexport {\n spacedChildren\n};\n//# sourceMappingURL=spacedChildren.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,eAAe,OAAO;CAC7B,MAAM,EAAE,UAAU,UAAU,OAAO,WAAW,WAAW,WAAW,eAAe;CACnF,MAAM,WAAW,CAAC,EAAE,SAAS;CAC7B,MAAM,eAAe,EAAE,cAAc,KAAK,KAAK,cAAc;CAC7D,MAAM,mBAAmB,MAAM,QAAQ,QAAQ;CAC/C,IAAI,CAAC,cAAc,EAAE,YAAY,gBAAgB,WAAW;EAC1D,OAAO;CACT;CACA,MAAM,eAAe,mBAAmB,WAAW,MAAM,SAAS,QAAQ,QAAQ;CAClF,MAAM,MAAM,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AC1C,IAAI,MAAM,OAAO;GACf,QAAQ,KAAK,qBAAqB,OAAO,KAAK;EAChD;CACF;CACA,OAAO;AACT;AACA,SAAS,aAAa,EAAE,KAAK,WAAW,OAAO,aAAa;CAC1D,OAAuB,oBACrB,QACA;EACE,MAAM;EACN;EACA,GAAG,OAAO,cAAc,eAAe,EACrC,MAAM,cAAc,OAAO,IAAI,cAAc,QAAQ,IAAI,UAC3D;CACF,GACA,GACF;AACF;AACA,MAAM,eAAe,gBAAgB,EACnC,cAAc;CACZ,SAAS;CACT,eAAe;CACf,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,eAAe;AACjB,EACF,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createComponent } from "@tamagui/web";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Spacer } from "./Spacer.native.js";
|
|
5
|
-
import { isUnspaced } from "./Unspaced.native.js";
|
|
6
|
-
|
|
7
|
-
function spacedChildren(props) {
|
|
8
|
-
var _childrenList__type, _childrenList_;
|
|
9
|
-
var { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;
|
|
10
|
-
var hasSpace = !!(space || spaceFlex);
|
|
11
|
-
var hasSeparator = !(separator === void 0 || separator === null);
|
|
12
|
-
var areChildrenArray = Array.isArray(children);
|
|
13
|
-
if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {
|
|
14
|
-
return children;
|
|
15
|
-
}
|
|
16
|
-
var childrenList = areChildrenArray ? children : React.Children.toArray(children);
|
|
17
|
-
var len = childrenList.length;
|
|
18
|
-
if (len <= 1 && !isZStack && !((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 ? void 0 : (_childrenList__type = _childrenList_["type"]) === null || _childrenList__type === void 0 ? void 0 : _childrenList__type["shouldForwardSpace"])) {
|
|
19
|
-
return children;
|
|
20
|
-
}
|
|
21
|
-
var final = [];
|
|
22
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
23
|
-
try {
|
|
24
|
-
for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
25
|
-
var [index, child] = _step.value;
|
|
26
|
-
var _child_type;
|
|
27
|
-
var isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
28
|
-
if (!isEmpty && /* @__PURE__ */ React.isValidElement(child) && ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type["shouldForwardSpace"])) {
|
|
29
|
-
child = /* @__PURE__ */ React.cloneElement(child, {
|
|
30
|
-
space,
|
|
31
|
-
spaceFlex,
|
|
32
|
-
separator,
|
|
33
|
-
key: child.key
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
37
|
-
final.push(child);
|
|
38
|
-
} else {
|
|
39
|
-
final.push(/* @__PURE__ */ jsx(React.Fragment, { children: isZStack ? /* @__PURE__ */ jsx(AbsoluteFill, { children: child }) : child }, `${index}0t`));
|
|
40
|
-
}
|
|
41
|
-
if (isUnspaced(child) && index === 0) continue;
|
|
42
|
-
if (isZStack) continue;
|
|
43
|
-
var next = childrenList[index + 1];
|
|
44
|
-
if (next && !isEmpty && !isUnspaced(next)) {
|
|
45
|
-
if (separator) {
|
|
46
|
-
if (hasSpace) {
|
|
47
|
-
final.push(createSpacer({
|
|
48
|
-
key: `_${index}_00t`,
|
|
49
|
-
direction,
|
|
50
|
-
space,
|
|
51
|
-
spaceFlex
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
final.push(/* @__PURE__ */ jsx(React.Fragment, { children: separator }, `${index}03t`));
|
|
55
|
-
if (hasSpace) {
|
|
56
|
-
final.push(createSpacer({
|
|
57
|
-
key: `_${index}01t`,
|
|
58
|
-
direction,
|
|
59
|
-
space,
|
|
60
|
-
spaceFlex
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
final.push(createSpacer({
|
|
65
|
-
key: `_${index}02t`,
|
|
66
|
-
direction,
|
|
67
|
-
space,
|
|
68
|
-
spaceFlex
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
} catch (err) {
|
|
74
|
-
_didIteratorError = true;
|
|
75
|
-
_iteratorError = err;
|
|
76
|
-
} finally {
|
|
77
|
-
try {
|
|
78
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
79
|
-
_iterator.return();
|
|
80
|
-
}
|
|
81
|
-
} finally {
|
|
82
|
-
if (_didIteratorError) {
|
|
83
|
-
throw _iteratorError;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (process.env.NODE_ENV === "development") {
|
|
88
|
-
if (props.debug) {
|
|
89
|
-
console.info(` Spaced children`, final, props);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return final;
|
|
93
|
-
}
|
|
94
|
-
function createSpacer(param) {
|
|
95
|
-
var { key, direction, space, spaceFlex } = param;
|
|
96
|
-
return /* @__PURE__ */ jsx(Spacer, {
|
|
97
|
-
size: space,
|
|
98
|
-
direction,
|
|
99
|
-
...typeof spaceFlex !== "undefined" && { flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex }
|
|
100
|
-
}, key);
|
|
101
|
-
}
|
|
102
|
-
var AbsoluteFill = createComponent({ defaultProps: {
|
|
103
|
-
display: "flex",
|
|
104
|
-
flexDirection: "column",
|
|
105
|
-
position: "absolute",
|
|
106
|
-
top: 0,
|
|
107
|
-
right: 0,
|
|
108
|
-
bottom: 0,
|
|
109
|
-
left: 0,
|
|
110
|
-
pointerEvents: "box-none"
|
|
111
|
-
} });
|
|
112
|
-
|
|
113
|
-
export { spacedChildren };
|
|
114
|
-
//# sourceMappingURL=spacedChildren.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacedChildren.native.js","names":[],"sources":["esm/spacedChildren.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createComponent } from \"@tamagui/web\";\nimport React from \"react\";\nimport { Spacer } from \"./Spacer\";\nimport { isUnspaced } from \"./Unspaced\";\nfunction spacedChildren(props) {\n var _childrenList__type, _childrenList_;\n var { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;\n var hasSpace = !!(space || spaceFlex);\n var hasSeparator = !(separator === void 0 || separator === null);\n var areChildrenArray = Array.isArray(children);\n if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {\n return children;\n }\n var childrenList = areChildrenArray ? children : React.Children.toArray(children);\n var len = childrenList.length;\n if (len <= 1 && !isZStack && !((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 ? void 0 : (_childrenList__type = _childrenList_[\"type\"]) === null || _childrenList__type === void 0 ? void 0 : _childrenList__type[\"shouldForwardSpace\"])) {\n return children;\n }\n var final = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [index, child] = _step.value;\n var _child_type;\n var isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;\n if (!isEmpty && /* @__PURE__ */ React.isValidElement(child) && ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type[\"shouldForwardSpace\"])) {\n child = /* @__PURE__ */ React.cloneElement(child, {\n space,\n spaceFlex,\n separator,\n key: child.key\n });\n }\n if (isEmpty || !child || child[\"key\"] && !isZStack) {\n final.push(child);\n } else {\n final.push(/* @__PURE__ */ _jsx(React.Fragment, {\n children: isZStack ? /* @__PURE__ */ _jsx(AbsoluteFill, {\n children: child\n }) : child\n }, `${index}0t`));\n }\n if (isUnspaced(child) && index === 0) continue;\n if (isZStack) continue;\n var next = childrenList[index + 1];\n if (next && !isEmpty && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(createSpacer({\n key: `_${index}_00t`,\n direction,\n space,\n spaceFlex\n }));\n }\n final.push(/* @__PURE__ */ _jsx(React.Fragment, {\n children: separator\n }, `${index}03t`));\n if (hasSpace) {\n final.push(createSpacer({\n key: `_${index}01t`,\n direction,\n space,\n spaceFlex\n }));\n }\n } else {\n final.push(createSpacer({\n key: `_${index}02t`,\n direction,\n space,\n spaceFlex\n }));\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props.debug) {\n console.info(` Spaced children`, final, props);\n }\n }\n return final;\n}\nfunction createSpacer(param) {\n var { key, direction, space, spaceFlex } = param;\n return /* @__PURE__ */ _jsx(Spacer, {\n // @ts-ignore\n size: space,\n // @ts-ignore\n direction,\n ...typeof spaceFlex !== \"undefined\" && {\n flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex\n }\n }, key);\n}\nvar AbsoluteFill = createComponent({\n defaultProps: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n pointerEvents: \"box-none\"\n }\n});\nexport {\n spacedChildren\n};\n//# sourceMappingURL=spacedChildren.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,eAAe,OAAO;CAC7B,IAAI,qBAAqB;CACzB,IAAI,EAAE,UAAU,UAAU,OAAO,WAAW,WAAW,WAAW,eAAe;CACjF,IAAI,WAAW,CAAC,EAAE,SAAS;CAC3B,IAAI,eAAe,EAAE,cAAc,KAAK,KAAK,cAAc;CAC3D,IAAI,mBAAmB,MAAM,QAAQ,QAAQ;CAC7C,IAAI,CAAC,cAAc,EAAE,YAAY,gBAAgB,WAAW;EAC1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,IAAI,GAAG;IACzC,IAAI,WAAW;KACb,IAAI,UAAU;MACZ,MAAM,KAAK,aAAa;OACtB,KAAK,IAAI,MAAM;OACf;OACA;OACA;MACF,CAAC,CAAC;KACJ;KACA,MAAM,KAAqB,oBAAK,MAAM,UAAU,EAC9C,UAAU,UACZ,GAAG,GAAG,MAAM,IAAI,CAAC;KACjB,IAAI,UAAU;MACZ,MAAM,KAAK,aAAa;OACtB,KAAK,IAAI,MAAM;OACf;OACA;OACA;MACF,CAAC,CAAC;KACJ;IACF,OAAO;KACL,MAAM,KAAK,aAAa;MACtB,KAAK,IAAI,MAAM;MACf;MACA;MACA;KACF,CAAC,CAAC;IACJ;GACF;EACF;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,IAAI,MAAM,OAAO;GACf,QAAQ,KAAK,qBAAqB,OAAO,KAAK;EAChD;CACF;CACA,OAAO;AACT;AACA,SAAS,aAAa,OAAO;CAC3B,IAAI,EAAE,KAAK,WAAW,OAAO,cAAc;CAC3C,OAAuB,oBAAK,QAAQ;EAElC,MAAM;EAEN;EACA,GAAG,OAAO,cAAc,eAAe,EACrC,MAAM,cAAc,OAAO,IAAI,cAAc,QAAQ,IAAI,UAC3D;CACF,GAAG,GAAG;AACR;AACA,IAAI,eAAe,gBAAgB,EACjC,cAAc;CACZ,SAAS;CACT,eAAe;CACf,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,eAAe;AACjB,EACF,CAAC"}
|
package/dist/esm/types.mjs
DELETED
|
File without changes
|
package/dist/esm/types.native.js
DELETED
|
File without changes
|
package/src/Unspaced.tsx
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// for elements to avoid spacing
|
|
2
|
-
export function Unspaced(props: { children?: any }) {
|
|
3
|
-
return props.children
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
Unspaced['isUnspaced'] = true
|
|
7
|
-
|
|
8
|
-
export function isUnspaced(child: React.ReactNode) {
|
|
9
|
-
const t = child?.['type']
|
|
10
|
-
return t?.['isVisuallyHidden'] || t?.['isUnspaced']
|
|
11
|
-
}
|