nn-widgets 0.1.2 → 0.1.4
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosWidget.d.ts","sourceRoot":"","sources":["../src/withIosWidget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"withIosWidget.d.ts","sourceRoot":"","sources":["../src/withIosWidget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AA8mDjB,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,oBAAoB,CAugB5D,CAAC;AAMF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GACvB,mBAAmB,CA2GrB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1044,11 +1044,10 @@ struct ${w.name}EntryView: View {
|
|
|
1044
1044
|
.background(${bgColor})
|
|
1045
1045
|
} else {
|
|
1046
1046
|
GeometryReader { geometry in
|
|
1047
|
-
let
|
|
1048
|
-
let
|
|
1049
|
-
let availableHeight = geometry.size.height - (padding * 2)
|
|
1047
|
+
let availableWidth = geometry.size.width
|
|
1048
|
+
let availableHeight = geometry.size.height
|
|
1050
1049
|
|
|
1051
|
-
VStack(spacing:
|
|
1050
|
+
VStack(spacing: 6) {
|
|
1052
1051
|
let layout = entry.layout
|
|
1053
1052
|
let totalSlots = layout.map { $0.ratios.count }.reduce(0, +)
|
|
1054
1053
|
let items = Array(entry.items.prefix(totalSlots))
|
|
@@ -1056,7 +1055,7 @@ struct ${w.name}EntryView: View {
|
|
|
1056
1055
|
ForEach(0..<layout.count, id: \\.self) { rowIndex in
|
|
1057
1056
|
let rowConfig = layout[rowIndex]
|
|
1058
1057
|
let rowRatios = rowConfig.ratios
|
|
1059
|
-
let rowHeight = (availableHeight - CGFloat(layout.count - 1) *
|
|
1058
|
+
let rowHeight = (availableHeight - CGFloat(layout.count - 1) * 6) / CGFloat(layout.count)
|
|
1060
1059
|
|
|
1061
1060
|
${w.name}FlexRow(
|
|
1062
1061
|
rowRatios: rowRatios,
|
|
@@ -1073,7 +1072,6 @@ struct ${w.name}EntryView: View {
|
|
|
1073
1072
|
)
|
|
1074
1073
|
}
|
|
1075
1074
|
}
|
|
1076
|
-
.padding(padding)
|
|
1077
1075
|
}
|
|
1078
1076
|
.background(${bgColor})
|
|
1079
1077
|
}
|
|
@@ -1105,7 +1103,7 @@ struct ${w.name}FlexRow: View {
|
|
|
1105
1103
|
|
|
1106
1104
|
var body: some View {
|
|
1107
1105
|
let itemCount = rowRatios.count
|
|
1108
|
-
let defaultSpacing: CGFloat =
|
|
1106
|
+
let defaultSpacing: CGFloat = 6
|
|
1109
1107
|
|
|
1110
1108
|
// For space-* modes, scale down cells to leave room for visible spacing
|
|
1111
1109
|
// Use 60% of width for content, 40% for spacing distribution
|
|
@@ -1228,7 +1226,6 @@ struct ${w.name}: Widget {
|
|
|
1228
1226
|
.widgetURL(deepLinkUrl)
|
|
1229
1227
|
} else {
|
|
1230
1228
|
${w.name}EntryView(entry: entry)
|
|
1231
|
-
.padding()
|
|
1232
1229
|
.background(${bgColor})
|
|
1233
1230
|
.widgetURL(deepLinkUrl)
|
|
1234
1231
|
}
|
|
@@ -1513,7 +1510,10 @@ extension Color {
|
|
|
1513
1510
|
`
|
|
1514
1511
|
: "";
|
|
1515
1512
|
// Determine if we need UIKit import (for UIImage check in icon rendering)
|
|
1516
|
-
const needsUIKit = props.widgets.some((w) => w.type === "list" ||
|
|
1513
|
+
const needsUIKit = props.widgets.some((w) => w.type === "list" ||
|
|
1514
|
+
w.type === "single" ||
|
|
1515
|
+
w.type === "flex-grid" ||
|
|
1516
|
+
w.type === "grid");
|
|
1517
1517
|
const uiKitImport = needsUIKit ? "\nimport UIKit" : "";
|
|
1518
1518
|
return `//
|
|
1519
1519
|
// Widgets.swift
|