bleam 0.0.12 → 0.0.13
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/ai.cjs +5 -4
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +4 -3
- package/dist/app-storage-D8W4n8ey.cjs +39 -0
- package/dist/app-storage-Isi5Bo0R.js +34 -0
- package/dist/cli.cjs +148 -22
- package/dist/cli.d.cts +13 -0
- package/dist/cli.d.ts +14 -1
- package/dist/cli.js +148 -22
- package/dist/config.d.ts +1 -1
- package/dist/elements-CFk0QHw0.d.cts +127 -0
- package/dist/elements-ClGQ41Sc.d.ts +127 -0
- package/dist/{ui.cjs → elements.cjs} +307 -168
- package/dist/elements.d.cts +2 -0
- package/dist/elements.d.ts +2 -0
- package/dist/{ui.js → elements.js} +306 -169
- package/dist/{files-BXVkPrPN.js → files-DErLhzCB.js} +5 -11
- package/dist/{files-DxaQ-Nv0.cjs → files-lMk-CpL_.cjs} +5 -11
- package/dist/files.cjs +1 -1
- package/dist/files.d.ts +1 -1
- package/dist/files.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.d.cts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/dist/secrets.cjs +146 -0
- package/dist/secrets.d.cts +14 -0
- package/dist/secrets.d.ts +14 -0
- package/dist/secrets.js +142 -0
- package/dist/{state-LssDgpff.cjs → state-BZYyrE2-.cjs} +4 -41
- package/dist/{state-Dh3HLixb.js → state-DkaRFkZJ.js} +4 -35
- package/dist/state.cjs +3 -2
- package/dist/state.d.cts +1 -1
- package/dist/state.d.ts +1 -1
- package/dist/state.js +3 -2
- package/dist/window.d.cts +1 -1
- package/dist/window.d.ts +3 -3
- package/package.json +11 -6
- package/templates/basic/app/index.tsx +2 -2
- package/templates/foundation-models/app/index.tsx +4 -4
- package/templates/image-generation/app/index.tsx +2 -2
- package/templates/native/modules/bleam-runtime/ios/AIModule.swift +7 -8
- package/templates/state/app/index.tsx +2 -2
- package/templates/text-generation/app/index.tsx +4 -4
- package/templates/updates/README.md +1 -1
- package/dist/ui-1WepaMS4.d.cts +0 -92
- package/dist/ui-D7bRLYee.d.ts +0 -92
- package/dist/ui.d.cts +0 -2
- package/dist/ui.d.ts +0 -2
- /package/dist/{config-Chi-flpJ.d.ts → config-Cms0rvqg.d.ts} +0 -0
- /package/dist/{files-VrkQlKIT.d.ts → files-4ZEoAWiv.d.ts} +0 -0
- /package/dist/{native-sqlite-yQLD5s9i.cjs → native-sqlite-Dw--FI9a.cjs} +0 -0
- /package/dist/{native-sqlite-xcGdamRD.js → native-sqlite-WzRNzCSh.js} +0 -0
- /package/dist/{schema-B5BfdswF.js → schema-B7ELMpuI.js} +0 -0
- /package/dist/{schema-BnVZOXfu.cjs → schema-B7SLUBLN.cjs} +0 -0
- /package/dist/{schema-D5eImHxu.d.cts → schema-BWsDPc6c.d.cts} +0 -0
- /package/dist/{schema-SSjokbtw.d.ts → schema-LxnzAfgw.d.ts} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as ensureNativeScript } from "./native-runtime-C85Nuc4F.js";
|
|
2
|
-
import { StyleSheet, processColor } from "react-native";
|
|
2
|
+
import { ActivityIndicator, PlatformColor, Pressable, StyleSheet, Text, View, processColor } from "react-native";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
|
|
4
|
-
//#region src/
|
|
5
|
+
//#region src/elements/shared.ts
|
|
5
6
|
function textFromChildren(children) {
|
|
6
7
|
if (typeof children === "string" || typeof children === "number") return String(children);
|
|
7
8
|
if (Array.isArray(children)) return children.filter((child) => typeof child === "string" || typeof child === "number").join("");
|
|
@@ -40,142 +41,90 @@ function fontFromStyle(style) {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
//#endregion
|
|
43
|
-
//#region src/
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
//#region src/elements/blur-view.tsx
|
|
45
|
+
function blurStyle(intensity, colorScheme) {
|
|
46
|
+
const scheme = colorScheme ?? "auto";
|
|
47
|
+
const level = intensity ?? "regular";
|
|
48
|
+
if (scheme === "light") switch (level) {
|
|
49
|
+
case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterialLight;
|
|
50
|
+
case "thin": return UIBlurEffectStyle.SystemThinMaterialLight;
|
|
51
|
+
case "thick": return UIBlurEffectStyle.SystemThickMaterialLight;
|
|
52
|
+
case "chrome": return UIBlurEffectStyle.SystemChromeMaterialLight;
|
|
53
|
+
default: return UIBlurEffectStyle.SystemMaterialLight;
|
|
54
|
+
}
|
|
55
|
+
if (scheme === "dark") switch (level) {
|
|
56
|
+
case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterialDark;
|
|
57
|
+
case "thin": return UIBlurEffectStyle.SystemThinMaterialDark;
|
|
58
|
+
case "thick": return UIBlurEffectStyle.SystemThickMaterialDark;
|
|
59
|
+
case "chrome": return UIBlurEffectStyle.SystemChromeMaterialDark;
|
|
60
|
+
default: return UIBlurEffectStyle.SystemMaterialDark;
|
|
61
|
+
}
|
|
62
|
+
switch (level) {
|
|
63
|
+
case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterial;
|
|
64
|
+
case "thin": return UIBlurEffectStyle.SystemThinMaterial;
|
|
65
|
+
case "thick": return UIBlurEffectStyle.SystemThickMaterial;
|
|
66
|
+
case "chrome": return UIBlurEffectStyle.SystemChromeMaterial;
|
|
67
|
+
default: return UIBlurEffectStyle.SystemMaterial;
|
|
68
|
+
}
|
|
51
69
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
function createEffectHost(effect) {
|
|
71
|
+
const rootView = UIVisualEffectView.alloc().initWithEffect(effect);
|
|
72
|
+
rootView.backgroundColor = UIColor.clearColor;
|
|
73
|
+
rootView.contentView.backgroundColor = UIColor.clearColor;
|
|
74
|
+
rootView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
|
|
75
|
+
rootView.contentView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
|
|
76
|
+
return {
|
|
77
|
+
rootView,
|
|
78
|
+
childrenView: rootView.contentView
|
|
79
|
+
};
|
|
56
80
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
defaultSize: {
|
|
62
|
-
width: 1,
|
|
63
|
-
height: 34
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
create(ctx) {
|
|
67
|
-
const button = UIButton.buttonWithType(UIButtonType.System);
|
|
68
|
-
ctx.targetAction(button, UIControlEvents.TouchUpInside, () => {
|
|
69
|
-
ctx.emit("onPress");
|
|
70
|
-
});
|
|
71
|
-
return button;
|
|
72
|
-
},
|
|
73
|
-
update(button, props, _previousProps, ctx) {
|
|
74
|
-
const style = styleFromProps(props.style);
|
|
75
|
-
const configuration = buttonConfiguration(props.variant);
|
|
76
|
-
configuration.title = buttonTitle(props);
|
|
77
|
-
configuration.buttonSize = buttonSize(props.size);
|
|
78
|
-
configuration.showsActivityIndicator = props.loading ?? false;
|
|
79
|
-
const foregroundColor = colorFromStyle(style?.color);
|
|
80
|
-
if (foregroundColor) configuration.baseForegroundColor = foregroundColor;
|
|
81
|
-
const backgroundColor = colorFromStyle(style?.backgroundColor);
|
|
82
|
-
if (backgroundColor) configuration.baseBackgroundColor = backgroundColor;
|
|
83
|
-
button.configuration = configuration;
|
|
84
|
-
button.enabled = !(props.disabled || props.loading);
|
|
85
|
-
ctx?.invalidateLayout();
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/ui/label.tsx
|
|
91
|
-
function labelText(props) {
|
|
92
|
-
return props.text ?? textFromChildren(props.children) ?? "";
|
|
81
|
+
function applyContainerStyle(view, style) {
|
|
82
|
+
const borderRadius = style?.borderRadius;
|
|
83
|
+
if (typeof borderRadius === "number") view.layer.cornerRadius = borderRadius;
|
|
84
|
+
view.clipsToBounds = style?.overflow === "hidden" || typeof borderRadius === "number";
|
|
93
85
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
if (tone === "tertiary") return UIColor.tertiaryLabelColor;
|
|
97
|
-
return UIColor.labelColor;
|
|
86
|
+
function updateBlurEffect(view, props) {
|
|
87
|
+
view.effect = UIBlurEffect.effectWithStyle(blurStyle(props.intensity, props.colorScheme));
|
|
98
88
|
}
|
|
99
|
-
const
|
|
100
|
-
name: "
|
|
89
|
+
const BlurView = ensureNativeScript().defineUIKitContainer({
|
|
90
|
+
name: "BlurView",
|
|
101
91
|
layout: {
|
|
102
|
-
sizing: "
|
|
92
|
+
sizing: "fill",
|
|
103
93
|
defaultSize: {
|
|
104
|
-
width:
|
|
105
|
-
height:
|
|
94
|
+
width: 0,
|
|
95
|
+
height: 0
|
|
106
96
|
}
|
|
107
97
|
},
|
|
108
98
|
create() {
|
|
109
|
-
|
|
110
|
-
label.adjustsFontForContentSizeCategory = true;
|
|
111
|
-
return label;
|
|
99
|
+
return createEffectHost(UIBlurEffect.effectWithStyle(UIBlurEffectStyle.SystemMaterial));
|
|
112
100
|
},
|
|
113
|
-
update(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
label.textColor = colorFromStyle(style?.color) ?? defaultLabelColor(props.tone);
|
|
117
|
-
label.font = fontFromStyle(style) ?? UIFont.preferredFontForTextStyle(UIFontTextStyleBody);
|
|
118
|
-
label.numberOfLines = props.numberOfLines ?? 0;
|
|
119
|
-
if (style?.textAlign === "center") label.textAlignment = NSTextAlignment.Center;
|
|
120
|
-
else if (style?.textAlign === "right") label.textAlignment = NSTextAlignment.Right;
|
|
121
|
-
else label.textAlignment = NSTextAlignment.Left;
|
|
101
|
+
update(view, props, _previousProps, ctx) {
|
|
102
|
+
updateBlurEffect(view.rootView, props);
|
|
103
|
+
applyContainerStyle(view.rootView, styleFromProps(props.style));
|
|
122
104
|
ctx?.invalidateLayout();
|
|
123
105
|
}
|
|
124
106
|
});
|
|
125
107
|
|
|
126
108
|
//#endregion
|
|
127
|
-
//#region src/
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
case "ultraLight": return UIImageSymbolWeight.UltraLight;
|
|
131
|
-
case "thin": return UIImageSymbolWeight.Thin;
|
|
132
|
-
case "light": return UIImageSymbolWeight.Light;
|
|
133
|
-
case "medium": return UIImageSymbolWeight.Medium;
|
|
134
|
-
case "semibold": return UIImageSymbolWeight.Semibold;
|
|
135
|
-
case "bold": return UIImageSymbolWeight.Bold;
|
|
136
|
-
case "heavy": return UIImageSymbolWeight.Heavy;
|
|
137
|
-
case "black": return UIImageSymbolWeight.Black;
|
|
138
|
-
default: return UIImageSymbolWeight.Regular;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function symbolScale(scale) {
|
|
142
|
-
if (scale === "small") return UIImageSymbolScale.Small;
|
|
143
|
-
if (scale === "large") return UIImageSymbolScale.Large;
|
|
144
|
-
return UIImageSymbolScale.Medium;
|
|
109
|
+
//#region src/elements/button-state.ts
|
|
110
|
+
function buttonDisabled(disabled, loading) {
|
|
111
|
+
return disabled || loading;
|
|
145
112
|
}
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
113
|
+
function buttonOpacity(options) {
|
|
114
|
+
if (buttonDisabled(options.disabled, options.loading)) return .45;
|
|
115
|
+
if (!options.pressed) return 1;
|
|
116
|
+
return Math.min(1, Math.max(0, options.activeOpacity));
|
|
149
117
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
118
|
+
function buttonAccessibilityState(state, disabled, loading) {
|
|
119
|
+
return {
|
|
120
|
+
...state,
|
|
121
|
+
disabled: buttonDisabled(disabled, loading),
|
|
122
|
+
busy: loading
|
|
123
|
+
};
|
|
153
124
|
}
|
|
154
|
-
const Symbol = ensureNativeScript().defineUIKitView({
|
|
155
|
-
name: "Symbol",
|
|
156
|
-
layout: {
|
|
157
|
-
sizing: "intrinsic",
|
|
158
|
-
defaultSize: {
|
|
159
|
-
width: 17,
|
|
160
|
-
height: 17
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
create() {
|
|
164
|
-
const imageView = UIImageView.new();
|
|
165
|
-
imageView.contentMode = UIViewContentMode.ScaleAspectFit;
|
|
166
|
-
return imageView;
|
|
167
|
-
},
|
|
168
|
-
update(imageView, props, _previousProps, ctx) {
|
|
169
|
-
const style = styleFromProps(props.style);
|
|
170
|
-
const configuration = symbolConfiguration(props, style);
|
|
171
|
-
imageView.image = symbolImage(props.symbol, configuration);
|
|
172
|
-
imageView.tintColor = colorFromStyle(props.color) ?? colorFromStyle(style?.tintColor) ?? colorFromStyle(style?.color) ?? UIColor.labelColor;
|
|
173
|
-
ctx?.invalidateLayout();
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
125
|
|
|
177
126
|
//#endregion
|
|
178
|
-
//#region src/
|
|
127
|
+
//#region src/elements/glass-shared.ts
|
|
179
128
|
function glassStyleValue(style) {
|
|
180
129
|
return typeof style === "object" ? style.style : style ?? "regular";
|
|
181
130
|
}
|
|
@@ -245,7 +194,7 @@ function updateGlassContainerEffect(view, spacing) {
|
|
|
245
194
|
}
|
|
246
195
|
|
|
247
196
|
//#endregion
|
|
248
|
-
//#region src/
|
|
197
|
+
//#region src/elements/glass-view.tsx
|
|
249
198
|
const GlassView = ensureNativeScript().defineUIKitContainer({
|
|
250
199
|
name: "GlassView",
|
|
251
200
|
layout: {
|
|
@@ -266,7 +215,172 @@ const GlassView = ensureNativeScript().defineUIKitContainer({
|
|
|
266
215
|
});
|
|
267
216
|
|
|
268
217
|
//#endregion
|
|
269
|
-
//#region src/
|
|
218
|
+
//#region src/elements/button.tsx
|
|
219
|
+
const sizeStyles = {
|
|
220
|
+
small: {
|
|
221
|
+
minHeight: 28,
|
|
222
|
+
minWidth: 28,
|
|
223
|
+
paddingHorizontal: 10
|
|
224
|
+
},
|
|
225
|
+
regular: {
|
|
226
|
+
minHeight: 36,
|
|
227
|
+
minWidth: 36,
|
|
228
|
+
paddingHorizontal: 14
|
|
229
|
+
},
|
|
230
|
+
large: {
|
|
231
|
+
minHeight: 44,
|
|
232
|
+
minWidth: 44,
|
|
233
|
+
paddingHorizontal: 18
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const labelSizeStyles = {
|
|
237
|
+
small: { fontSize: 13 },
|
|
238
|
+
regular: { fontSize: 15 },
|
|
239
|
+
large: { fontSize: 17 }
|
|
240
|
+
};
|
|
241
|
+
const glassCornerRadius = {
|
|
242
|
+
small: 8,
|
|
243
|
+
regular: 10,
|
|
244
|
+
large: 12
|
|
245
|
+
};
|
|
246
|
+
function resolveStyle(style, state) {
|
|
247
|
+
return typeof style === "function" ? style(state) : style;
|
|
248
|
+
}
|
|
249
|
+
function ButtonContent({ icon, label, labelStyle, loading, size, variant }) {
|
|
250
|
+
const indicatorColor = variant === "primary" ? "#ffffff" : PlatformColor("systemBlue");
|
|
251
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [loading ? /* @__PURE__ */ jsx(ActivityIndicator, {
|
|
252
|
+
accessibilityElementsHidden: true,
|
|
253
|
+
color: indicatorColor,
|
|
254
|
+
size: "small"
|
|
255
|
+
}) : icon ? /* @__PURE__ */ jsx(View, {
|
|
256
|
+
accessibilityElementsHidden: true,
|
|
257
|
+
children: icon
|
|
258
|
+
}) : null, label ? /* @__PURE__ */ jsx(Text, {
|
|
259
|
+
numberOfLines: 1,
|
|
260
|
+
style: [
|
|
261
|
+
styles.label,
|
|
262
|
+
labelSizeStyles[size],
|
|
263
|
+
variant ? labelVariantStyles[variant] : styles.glassLabel,
|
|
264
|
+
labelStyle
|
|
265
|
+
],
|
|
266
|
+
children: label
|
|
267
|
+
}) : null] });
|
|
268
|
+
}
|
|
269
|
+
function Button({ accessibilityRole = "button", accessibilityState, activeOpacity = .2, disabled = false, icon, label, labelStyle, loading = false, size = "regular", style, variant = "primary",...props }) {
|
|
270
|
+
const inactive = buttonDisabled(disabled, loading);
|
|
271
|
+
return /* @__PURE__ */ jsx(Pressable, {
|
|
272
|
+
...props,
|
|
273
|
+
accessibilityRole,
|
|
274
|
+
accessibilityState: buttonAccessibilityState(accessibilityState, disabled, loading),
|
|
275
|
+
disabled: inactive,
|
|
276
|
+
style: (state) => [
|
|
277
|
+
styles.button,
|
|
278
|
+
sizeStyles[size],
|
|
279
|
+
buttonVariantStyles[variant],
|
|
280
|
+
resolveStyle(style, state),
|
|
281
|
+
{ opacity: buttonOpacity({
|
|
282
|
+
...state,
|
|
283
|
+
disabled,
|
|
284
|
+
loading,
|
|
285
|
+
activeOpacity
|
|
286
|
+
}) }
|
|
287
|
+
],
|
|
288
|
+
children: /* @__PURE__ */ jsx(View, {
|
|
289
|
+
pointerEvents: "none",
|
|
290
|
+
style: styles.content,
|
|
291
|
+
children: /* @__PURE__ */ jsx(ButtonContent, {
|
|
292
|
+
icon,
|
|
293
|
+
label,
|
|
294
|
+
labelStyle,
|
|
295
|
+
loading,
|
|
296
|
+
size,
|
|
297
|
+
variant
|
|
298
|
+
})
|
|
299
|
+
})
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function GlassButton({ accessibilityRole = "button", accessibilityState, activeOpacity = .2, disabled = false, glassEffectStyle, glassStyle, icon, label, labelStyle, loading = false, size = "regular", style, tintColor,...props }) {
|
|
303
|
+
const inactive = buttonDisabled(disabled, loading);
|
|
304
|
+
return /* @__PURE__ */ jsxs(Pressable, {
|
|
305
|
+
...props,
|
|
306
|
+
accessibilityRole,
|
|
307
|
+
accessibilityState: buttonAccessibilityState(accessibilityState, disabled, loading),
|
|
308
|
+
disabled: inactive,
|
|
309
|
+
style: (state) => [
|
|
310
|
+
styles.button,
|
|
311
|
+
sizeStyles[size],
|
|
312
|
+
styles.glassButton,
|
|
313
|
+
resolveStyle(style, state),
|
|
314
|
+
{ opacity: buttonOpacity({
|
|
315
|
+
...state,
|
|
316
|
+
disabled,
|
|
317
|
+
loading,
|
|
318
|
+
activeOpacity
|
|
319
|
+
}) }
|
|
320
|
+
],
|
|
321
|
+
children: [/* @__PURE__ */ jsx(View, {
|
|
322
|
+
pointerEvents: "none",
|
|
323
|
+
style: styles.glassBackground,
|
|
324
|
+
children: /* @__PURE__ */ jsx(GlassView, {
|
|
325
|
+
glassEffectStyle,
|
|
326
|
+
glassStyle: {
|
|
327
|
+
cornerRadius: glassCornerRadius[size],
|
|
328
|
+
...glassStyle
|
|
329
|
+
},
|
|
330
|
+
isInteractive: false,
|
|
331
|
+
style: styles.glass,
|
|
332
|
+
tintColor
|
|
333
|
+
})
|
|
334
|
+
}), /* @__PURE__ */ jsx(View, {
|
|
335
|
+
pointerEvents: "none",
|
|
336
|
+
style: styles.content,
|
|
337
|
+
children: /* @__PURE__ */ jsx(ButtonContent, {
|
|
338
|
+
icon,
|
|
339
|
+
label,
|
|
340
|
+
labelStyle,
|
|
341
|
+
loading,
|
|
342
|
+
size
|
|
343
|
+
})
|
|
344
|
+
})]
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
const styles = StyleSheet.create({
|
|
348
|
+
button: {
|
|
349
|
+
alignItems: "center",
|
|
350
|
+
borderRadius: 10,
|
|
351
|
+
justifyContent: "center"
|
|
352
|
+
},
|
|
353
|
+
glassButton: { backgroundColor: "transparent" },
|
|
354
|
+
glass: { flex: 1 },
|
|
355
|
+
glassBackground: {
|
|
356
|
+
bottom: 0,
|
|
357
|
+
left: 0,
|
|
358
|
+
position: "absolute",
|
|
359
|
+
right: 0,
|
|
360
|
+
top: 0
|
|
361
|
+
},
|
|
362
|
+
content: {
|
|
363
|
+
alignItems: "center",
|
|
364
|
+
flexDirection: "row",
|
|
365
|
+
gap: 7,
|
|
366
|
+
justifyContent: "center"
|
|
367
|
+
},
|
|
368
|
+
label: { fontWeight: "600" },
|
|
369
|
+
glassLabel: { color: PlatformColor("label") }
|
|
370
|
+
});
|
|
371
|
+
const buttonVariantStyles = StyleSheet.create({
|
|
372
|
+
primary: { backgroundColor: PlatformColor("systemBlue") },
|
|
373
|
+
secondary: { backgroundColor: PlatformColor("secondarySystemFill") },
|
|
374
|
+
plain: { backgroundColor: "transparent" }
|
|
375
|
+
});
|
|
376
|
+
const labelVariantStyles = StyleSheet.create({
|
|
377
|
+
primary: { color: "#ffffff" },
|
|
378
|
+
secondary: { color: PlatformColor("label") },
|
|
379
|
+
plain: { color: PlatformColor("systemBlue") }
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/elements/glass-container.tsx
|
|
270
384
|
const GlassContainer = ensureNativeScript().defineUIKitContainer({
|
|
271
385
|
name: "GlassContainer",
|
|
272
386
|
layout: {
|
|
@@ -289,69 +403,92 @@ const GlassContainer = ensureNativeScript().defineUIKitContainer({
|
|
|
289
403
|
});
|
|
290
404
|
|
|
291
405
|
//#endregion
|
|
292
|
-
//#region src/
|
|
293
|
-
function
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
406
|
+
//#region src/elements/label.tsx
|
|
407
|
+
function labelText(props) {
|
|
408
|
+
return props.text ?? textFromChildren(props.children) ?? "";
|
|
409
|
+
}
|
|
410
|
+
function defaultLabelColor(tone) {
|
|
411
|
+
if (tone === "secondary") return UIColor.secondaryLabelColor;
|
|
412
|
+
if (tone === "tertiary") return UIColor.tertiaryLabelColor;
|
|
413
|
+
return UIColor.labelColor;
|
|
414
|
+
}
|
|
415
|
+
const Label = ensureNativeScript().defineUIKitView({
|
|
416
|
+
name: "Label",
|
|
417
|
+
layout: {
|
|
418
|
+
sizing: "intrinsic",
|
|
419
|
+
defaultSize: {
|
|
420
|
+
width: 1,
|
|
421
|
+
height: 24
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
create() {
|
|
425
|
+
const label = UILabel.new();
|
|
426
|
+
label.adjustsFontForContentSizeCategory = true;
|
|
427
|
+
return label;
|
|
428
|
+
},
|
|
429
|
+
update(label, props, _previousProps, ctx) {
|
|
430
|
+
const style = styleFromProps(props.style);
|
|
431
|
+
label.text = labelText(props);
|
|
432
|
+
label.textColor = colorFromStyle(style?.color) ?? defaultLabelColor(props.tone);
|
|
433
|
+
label.font = fontFromStyle(style) ?? UIFont.preferredFontForTextStyle(UIFontTextStyleBody);
|
|
434
|
+
label.numberOfLines = props.numberOfLines ?? 0;
|
|
435
|
+
if (style?.textAlign === "center") label.textAlignment = NSTextAlignment.Center;
|
|
436
|
+
else if (style?.textAlign === "right") label.textAlignment = NSTextAlignment.Right;
|
|
437
|
+
else label.textAlignment = NSTextAlignment.Left;
|
|
438
|
+
ctx?.invalidateLayout();
|
|
309
439
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region src/elements/symbol.tsx
|
|
444
|
+
function symbolWeight(weight) {
|
|
445
|
+
switch (weight) {
|
|
446
|
+
case "ultraLight": return UIImageSymbolWeight.UltraLight;
|
|
447
|
+
case "thin": return UIImageSymbolWeight.Thin;
|
|
448
|
+
case "light": return UIImageSymbolWeight.Light;
|
|
449
|
+
case "medium": return UIImageSymbolWeight.Medium;
|
|
450
|
+
case "semibold": return UIImageSymbolWeight.Semibold;
|
|
451
|
+
case "bold": return UIImageSymbolWeight.Bold;
|
|
452
|
+
case "heavy": return UIImageSymbolWeight.Heavy;
|
|
453
|
+
case "black": return UIImageSymbolWeight.Black;
|
|
454
|
+
default: return UIImageSymbolWeight.Regular;
|
|
316
455
|
}
|
|
317
456
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
rootView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
|
|
323
|
-
rootView.contentView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
|
|
324
|
-
return {
|
|
325
|
-
rootView,
|
|
326
|
-
childrenView: rootView.contentView
|
|
327
|
-
};
|
|
457
|
+
function symbolScale(scale) {
|
|
458
|
+
if (scale === "small") return UIImageSymbolScale.Small;
|
|
459
|
+
if (scale === "large") return UIImageSymbolScale.Large;
|
|
460
|
+
return UIImageSymbolScale.Medium;
|
|
328
461
|
}
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
view.clipsToBounds = style?.overflow === "hidden" || typeof borderRadius === "number";
|
|
462
|
+
function symbolConfiguration(props, style) {
|
|
463
|
+
const size = props.size ?? style?.fontSize ?? 17;
|
|
464
|
+
return UIImageSymbolConfiguration.configurationWithPointSizeWeightScale(size, symbolWeight(props.weight), symbolScale(props.scale));
|
|
333
465
|
}
|
|
334
|
-
function
|
|
335
|
-
|
|
466
|
+
function symbolImage(name, configuration) {
|
|
467
|
+
if (configuration) return UIImage.systemImageNamedWithConfiguration(name, configuration);
|
|
468
|
+
return UIImage.systemImageNamed(name);
|
|
336
469
|
}
|
|
337
|
-
const
|
|
338
|
-
name: "
|
|
470
|
+
const SFSymbol = ensureNativeScript().defineUIKitView({
|
|
471
|
+
name: "Symbol",
|
|
339
472
|
layout: {
|
|
340
|
-
sizing: "
|
|
473
|
+
sizing: "intrinsic",
|
|
341
474
|
defaultSize: {
|
|
342
|
-
width:
|
|
343
|
-
height:
|
|
475
|
+
width: 17,
|
|
476
|
+
height: 17
|
|
344
477
|
}
|
|
345
478
|
},
|
|
346
479
|
create() {
|
|
347
|
-
|
|
480
|
+
const imageView = UIImageView.new();
|
|
481
|
+
imageView.contentMode = UIViewContentMode.ScaleAspectFit;
|
|
482
|
+
return imageView;
|
|
348
483
|
},
|
|
349
|
-
update(
|
|
350
|
-
|
|
351
|
-
|
|
484
|
+
update(imageView, props, _previousProps, ctx) {
|
|
485
|
+
const style = styleFromProps(props.style);
|
|
486
|
+
const configuration = symbolConfiguration(props, style);
|
|
487
|
+
imageView.image = symbolImage(props.symbol, configuration);
|
|
488
|
+
imageView.tintColor = colorFromStyle(props.color) ?? colorFromStyle(style?.tintColor) ?? colorFromStyle(style?.color) ?? UIColor.labelColor;
|
|
352
489
|
ctx?.invalidateLayout();
|
|
353
490
|
}
|
|
354
491
|
});
|
|
355
492
|
|
|
356
493
|
//#endregion
|
|
357
|
-
export { BlurView, Button, GlassContainer, GlassView, Label, Symbol };
|
|
494
|
+
export { BlurView, Button, GlassButton, GlassContainer, GlassView, Label, SFSymbol as Symbol };
|
|
@@ -28,26 +28,20 @@ function ensureDirectory(path) {
|
|
|
28
28
|
function parentDirectory(path) {
|
|
29
29
|
return nsString(path).stringByDeletingLastPathComponent;
|
|
30
30
|
}
|
|
31
|
-
function appGroupIdentifier() {
|
|
32
|
-
return String(NSBundle.mainBundle.objectForInfoDictionaryKey("AppGroupIdentifier") ?? "group.dev.bleam.app");
|
|
33
|
-
}
|
|
34
|
-
function containerPath() {
|
|
35
|
-
const url = fileManager().containerURLForSecurityApplicationGroupIdentifier(appGroupIdentifier());
|
|
36
|
-
if (!url?.path) throw new Error("Shared container is unavailable");
|
|
37
|
-
return String(url.path);
|
|
38
|
-
}
|
|
39
31
|
function searchPath(directory) {
|
|
40
32
|
const value = NSSearchPathForDirectoriesInDomains(directory, NSSearchPathDomainMask.UserDomain, true)?.objectAtIndex(0);
|
|
41
33
|
if (typeof value !== "string") throw new Error("Native directory unavailable");
|
|
42
34
|
return value;
|
|
43
35
|
}
|
|
36
|
+
function bleamDirectory(directory, name) {
|
|
37
|
+
return nsString(searchPath(directory)).stringByAppendingPathComponent(`Bleam/${name}`);
|
|
38
|
+
}
|
|
44
39
|
function nativeDirectories() {
|
|
45
|
-
const shared = containerPath();
|
|
46
40
|
return {
|
|
47
41
|
cache: searchPath(NSSearchPathDirectory.Caches),
|
|
48
42
|
documents: searchPath(NSSearchPathDirectory.Document),
|
|
49
|
-
models:
|
|
50
|
-
shared,
|
|
43
|
+
models: bleamDirectory(NSSearchPathDirectory.Caches, "Models"),
|
|
44
|
+
shared: bleamDirectory(NSSearchPathDirectory.ApplicationSupport, "Shared"),
|
|
51
45
|
temporary: NSTemporaryDirectory()
|
|
52
46
|
};
|
|
53
47
|
}
|
|
@@ -28,26 +28,20 @@ function ensureDirectory(path) {
|
|
|
28
28
|
function parentDirectory(path) {
|
|
29
29
|
return nsString(path).stringByDeletingLastPathComponent;
|
|
30
30
|
}
|
|
31
|
-
function appGroupIdentifier() {
|
|
32
|
-
return String(NSBundle.mainBundle.objectForInfoDictionaryKey("AppGroupIdentifier") ?? "group.dev.bleam.app");
|
|
33
|
-
}
|
|
34
|
-
function containerPath() {
|
|
35
|
-
const url = fileManager().containerURLForSecurityApplicationGroupIdentifier(appGroupIdentifier());
|
|
36
|
-
if (!url?.path) throw new Error("Shared container is unavailable");
|
|
37
|
-
return String(url.path);
|
|
38
|
-
}
|
|
39
31
|
function searchPath(directory) {
|
|
40
32
|
const value = NSSearchPathForDirectoriesInDomains(directory, NSSearchPathDomainMask.UserDomain, true)?.objectAtIndex(0);
|
|
41
33
|
if (typeof value !== "string") throw new Error("Native directory unavailable");
|
|
42
34
|
return value;
|
|
43
35
|
}
|
|
36
|
+
function bleamDirectory(directory, name) {
|
|
37
|
+
return nsString(searchPath(directory)).stringByAppendingPathComponent(`Bleam/${name}`);
|
|
38
|
+
}
|
|
44
39
|
function nativeDirectories() {
|
|
45
|
-
const shared = containerPath();
|
|
46
40
|
return {
|
|
47
41
|
cache: searchPath(NSSearchPathDirectory.Caches),
|
|
48
42
|
documents: searchPath(NSSearchPathDirectory.Document),
|
|
49
|
-
models:
|
|
50
|
-
shared,
|
|
43
|
+
models: bleamDirectory(NSSearchPathDirectory.Caches, "Models"),
|
|
44
|
+
shared: bleamDirectory(NSSearchPathDirectory.ApplicationSupport, "Shared"),
|
|
51
45
|
temporary: NSTemporaryDirectory()
|
|
52
46
|
};
|
|
53
47
|
}
|
package/dist/files.cjs
CHANGED
package/dist/files.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DownloadTask, c as FileStat, d as PickOptions, f as RemoveOptions, i as DownloadProgress, l as FileType, m as files, n as DirectoryRef, o as FilePaths, p as WriteOptions, r as DownloadOptions, s as FileRef, t as CreateDirectoryOptions, u as PickFileType } from "./files-
|
|
1
|
+
import { a as DownloadTask, c as FileStat, d as PickOptions, f as RemoveOptions, i as DownloadProgress, l as FileType, m as files, n as DirectoryRef, o as FilePaths, p as WriteOptions, r as DownloadOptions, s as FileRef, t as CreateDirectoryOptions, u as PickFileType } from "./files-4ZEoAWiv.js";
|
|
2
2
|
export { CreateDirectoryOptions, DirectoryRef, DownloadOptions, DownloadProgress, DownloadTask, FilePaths, FileRef, FileStat, FileType, PickFileType, PickOptions, RemoveOptions, WriteOptions, files };
|
package/dist/files.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./native-runtime-C85Nuc4F.js";
|
|
2
|
-
import { i as files, n as DownloadTask, r as FileRef, t as DirectoryRef } from "./files-
|
|
2
|
+
import { i as files, n as DownloadTask, r as FileRef, t as DirectoryRef } from "./files-DErLhzCB.js";
|
|
3
3
|
|
|
4
4
|
export { DirectoryRef, DownloadTask, FileRef, files };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as HexColor, c as defineConfig, i as BleamUserInterfaceStyle, n as BleamConfig, o as appConfig, r as BleamInternalExpoConfig, s as createExpoConfig, t as BleamAppearance } from "./config-
|
|
1
|
+
import { a as HexColor, c as defineConfig, i as BleamUserInterfaceStyle, n as BleamConfig, o as appConfig, r as BleamInternalExpoConfig, s as createExpoConfig, t as BleamAppearance } from "./config-Cms0rvqg.js";
|
|
2
2
|
export { BleamAppearance, BleamConfig, BleamInternalExpoConfig, BleamUserInterfaceStyle, HexColor, appConfig, createExpoConfig, defineConfig };
|
package/dist/schema.cjs
CHANGED
package/dist/schema.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as array, C as SchemaOutput, D as StandardSchema, E as SchemaShape, F as number, I as object, L as schema, M as getFieldSchema, N as getValueAtPath, O as StringField, P as literal, R as string, S as SchemaJSONSchema, T as SchemaResult, _ as ObjectField, a as FieldAtFieldPath, b as SchemaInput, c as FieldPath, d as FieldValue, f as InferInput, g as NumberField, h as LiteralField, i as DeepPartial, j as boolean, k as ValueAtFieldPath, l as FieldSchema, m as JSONValue, n as BleamSchema, o as FieldInput, p as InferOutput, r as BooleanField, s as FieldOutput, t as ArrayField, u as FieldToken, v as PrimitiveValue, w as SchemaPatch, x as SchemaIssue, y as SchemaError } from "./schema-
|
|
1
|
+
import { A as array, C as SchemaOutput, D as StandardSchema, E as SchemaShape, F as number, I as object, L as schema, M as getFieldSchema, N as getValueAtPath, O as StringField, P as literal, R as string, S as SchemaJSONSchema, T as SchemaResult, _ as ObjectField, a as FieldAtFieldPath, b as SchemaInput, c as FieldPath, d as FieldValue, f as InferInput, g as NumberField, h as LiteralField, i as DeepPartial, j as boolean, k as ValueAtFieldPath, l as FieldSchema, m as JSONValue, n as BleamSchema, o as FieldInput, p as InferOutput, r as BooleanField, s as FieldOutput, t as ArrayField, u as FieldToken, v as PrimitiveValue, w as SchemaPatch, x as SchemaIssue, y as SchemaError } from "./schema-BWsDPc6c.cjs";
|
|
2
2
|
export { ArrayField, BleamSchema, BooleanField, DeepPartial, FieldAtFieldPath, FieldInput, FieldOutput, FieldPath, FieldSchema, FieldToken, FieldValue, InferInput, InferOutput, JSONValue, LiteralField, NumberField, ObjectField, PrimitiveValue, SchemaError, SchemaInput, SchemaIssue, SchemaJSONSchema, SchemaOutput, SchemaPatch, SchemaResult, SchemaShape, StandardSchema, StringField, ValueAtFieldPath, array, boolean, getFieldSchema, getValueAtPath, literal, number, object, schema, string };
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as array, C as SchemaOutput, D as StandardSchema, E as SchemaShape, F as number, I as object, L as schema, M as getFieldSchema, N as getValueAtPath, O as StringField, P as literal, R as string, S as SchemaJSONSchema, T as SchemaResult, _ as ObjectField, a as FieldAtFieldPath, b as SchemaInput, c as FieldPath, d as FieldValue, f as InferInput, g as NumberField, h as LiteralField, i as DeepPartial, j as boolean, k as ValueAtFieldPath, l as FieldSchema, m as JSONValue, n as BleamSchema, o as FieldInput, p as InferOutput, r as BooleanField, s as FieldOutput, t as ArrayField, u as FieldToken, v as PrimitiveValue, w as SchemaPatch, x as SchemaIssue, y as SchemaError } from "./schema-
|
|
1
|
+
import { A as array, C as SchemaOutput, D as StandardSchema, E as SchemaShape, F as number, I as object, L as schema, M as getFieldSchema, N as getValueAtPath, O as StringField, P as literal, R as string, S as SchemaJSONSchema, T as SchemaResult, _ as ObjectField, a as FieldAtFieldPath, b as SchemaInput, c as FieldPath, d as FieldValue, f as InferInput, g as NumberField, h as LiteralField, i as DeepPartial, j as boolean, k as ValueAtFieldPath, l as FieldSchema, m as JSONValue, n as BleamSchema, o as FieldInput, p as InferOutput, r as BooleanField, s as FieldOutput, t as ArrayField, u as FieldToken, v as PrimitiveValue, w as SchemaPatch, x as SchemaIssue, y as SchemaError } from "./schema-LxnzAfgw.js";
|
|
2
2
|
export { ArrayField, BleamSchema, BooleanField, DeepPartial, FieldAtFieldPath, FieldInput, FieldOutput, FieldPath, FieldSchema, FieldToken, FieldValue, InferInput, InferOutput, JSONValue, LiteralField, NumberField, ObjectField, PrimitiveValue, SchemaError, SchemaInput, SchemaIssue, SchemaJSONSchema, SchemaOutput, SchemaPatch, SchemaResult, SchemaShape, StandardSchema, StringField, ValueAtFieldPath, array, boolean, getFieldSchema, getValueAtPath, literal, number, object, schema, string };
|
package/dist/schema.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as getValueAtPath, c as object, i as getFieldSchema, l as schema, n as array, o as literal, r as boolean, s as number, t as SchemaError, u as string } from "./schema-
|
|
1
|
+
import { a as getValueAtPath, c as object, i as getFieldSchema, l as schema, n as array, o as literal, r as boolean, s as number, t as SchemaError, u as string } from "./schema-B7ELMpuI.js";
|
|
2
2
|
|
|
3
3
|
export { SchemaError, array, boolean, getFieldSchema, getValueAtPath, literal, number, object, schema, string };
|