@astryxdesign/native 0.7.4-canary.720bb10 → 0.7.5-canary.04434e7
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/README.md +116 -4
- package/apple/Sources/AstryxNative/Generated/AstryxBase.swift +1 -1
- package/apple/Sources/AstryxNative/Generated/AstryxNode.swift +69 -0
- package/apple/Sources/AstryxNative/Generated/AstryxWire.swift +67 -0
- package/apple/Sources/AstryxNative/Generated/Badge.swift +89 -0
- package/apple/Sources/AstryxNative/Generated/Button.swift +154 -0
- package/apple/Sources/AstryxNative/Generated/Card.swift +117 -0
- package/apple/Sources/AstryxNative/Generated/Divider.swift +97 -0
- package/apple/Sources/AstryxNative/Generated/HStack.swift +308 -0
- package/apple/Sources/AstryxNative/Generated/Heading.swift +169 -0
- package/apple/Sources/AstryxNative/Generated/ProgressBar.swift +144 -0
- package/apple/Sources/AstryxNative/Generated/Selector.swift +133 -9
- package/apple/Sources/AstryxNative/Generated/Switch.swift +202 -0
- package/apple/Sources/AstryxNative/Generated/Text.swift +172 -0
- package/apple/Sources/AstryxNative/Generated/TextInput.swift +243 -0
- package/apple/Sources/AstryxNative/Generated/VStack.swift +308 -0
- package/apple/Sources/AstryxNative/Logic/AstryxLogicHost.swift +102 -0
- package/apple/Tests/AstryxNativeTests/ControlPropsTests.swift +29 -0
- package/apple/Tests/AstryxNativeTests/LogicHostTests.swift +85 -0
- package/apple/Tests/AstryxNativeTests/WireTests.swift +53 -0
- package/dist/components/Badge.d.ts +10 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +7 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +15 -0
- package/dist/components/Card.d.ts +10 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +7 -0
- package/dist/components/Divider.d.ts +10 -0
- package/dist/components/Divider.d.ts.map +1 -0
- package/dist/components/Divider.js +6 -0
- package/dist/components/HStack.d.ts +10 -0
- package/dist/components/HStack.d.ts.map +1 -0
- package/dist/components/HStack.js +9 -0
- package/dist/components/Heading.d.ts +10 -0
- package/dist/components/Heading.d.ts.map +1 -0
- package/dist/components/Heading.js +14 -0
- package/dist/components/ProgressBar.d.ts +10 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +5 -0
- package/dist/components/Switch.d.ts +10 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +6 -0
- package/dist/components/Text.d.ts +10 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +13 -0
- package/dist/components/TextInput.d.ts +10 -0
- package/dist/components/TextInput.d.ts.map +1 -0
- package/dist/components/TextInput.js +9 -0
- package/dist/components/VStack.d.ts +10 -0
- package/dist/components/VStack.d.ts.map +1 -0
- package/dist/components/VStack.js +9 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +25 -1
- package/dist/components/stackShared.d.ts +9 -0
- package/dist/components/stackShared.d.ts.map +1 -0
- package/dist/components/stackShared.js +4 -0
- package/dist/contract/fromComponentDoc.d.ts +44 -5
- package/dist/contract/fromComponentDoc.d.ts.map +1 -1
- package/dist/contract/fromComponentDoc.js +47 -4
- package/dist/contract/generateSwift.d.ts.map +1 -1
- package/dist/contract/generateSwift.js +193 -10
- package/dist/contract/generateTypeScript.d.ts.map +1 -1
- package/dist/contract/generateTypeScript.js +69 -9
- package/dist/contract/index.d.ts +7 -3
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +2 -1
- package/dist/contract/parseDocType.d.ts +5 -2
- package/dist/contract/parseDocType.d.ts.map +1 -1
- package/dist/contract/parseDocType.js +34 -5
- package/dist/contract/rules.d.ts +5 -2
- package/dist/contract/rules.d.ts.map +1 -1
- package/dist/contract/rules.js +8 -4
- package/dist/contract/types.d.ts +11 -0
- package/dist/contract/types.d.ts.map +1 -1
- package/dist/logic/connectBridge.d.ts +29 -0
- package/dist/logic/connectBridge.d.ts.map +1 -0
- package/dist/logic/connectBridge.js +32 -0
- package/dist/logic/createLogicCore.d.ts +44 -0
- package/dist/logic/createLogicCore.d.ts.map +1 -0
- package/dist/logic/createLogicCore.js +40 -0
- package/dist/logic/index.d.ts +12 -0
- package/dist/logic/index.d.ts.map +1 -0
- package/dist/logic/index.js +10 -0
- package/dist/types/android.d.ts +136 -2
- package/dist/types/core.d.ts +150 -0
- package/dist/types/ios.d.ts +136 -2
- package/dist/types/macos.d.ts +136 -2
- package/dist/types/shared.d.ts +136 -2
- package/dist/types/windows.d.ts +136 -2
- package/package.json +10 -4
- package/src/components/Badge.ts +18 -0
- package/src/components/Button.ts +26 -0
- package/src/components/Card.ts +18 -0
- package/src/components/Divider.ts +17 -0
- package/src/components/HStack.ts +20 -0
- package/src/components/Heading.ts +25 -0
- package/src/components/ProgressBar.ts +16 -0
- package/src/components/Switch.ts +17 -0
- package/src/components/Text.ts +24 -0
- package/src/components/TextInput.ts +20 -0
- package/src/components/VStack.ts +20 -0
- package/src/components/index.ts +25 -1
- package/src/components/stackShared.ts +14 -0
- package/src/contract/contracts.test.ts +58 -0
- package/src/contract/fromComponentDoc.test.ts +97 -0
- package/src/contract/fromComponentDoc.ts +106 -9
- package/src/contract/generateSwift.ts +223 -10
- package/src/contract/generateTypeScript.ts +83 -10
- package/src/contract/index.ts +13 -4
- package/src/contract/parseDocType.test.ts +45 -0
- package/src/contract/parseDocType.ts +41 -6
- package/src/contract/rules.ts +11 -4
- package/src/contract/types.ts +6 -0
- package/src/logic/connectBridge.ts +72 -0
- package/src/logic/createLogicCore.ts +97 -0
- package/src/logic/index.ts +19 -0
- package/src/logic/logic.test.ts +160 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Generated by @astryxdesign/native. Do not edit.
|
|
2
|
+
public enum DividerOrientation: String, CaseIterable, Codable, Sendable {
|
|
3
|
+
case horizontal = "horizontal"
|
|
4
|
+
case vertical = "vertical"
|
|
5
|
+
}
|
|
6
|
+
public enum DividerVariant: String, CaseIterable, Codable, Sendable {
|
|
7
|
+
case subtle = "subtle"
|
|
8
|
+
case strong = "strong"
|
|
9
|
+
}
|
|
10
|
+
#if os(iOS)
|
|
11
|
+
public struct DividerProps {
|
|
12
|
+
/// Base props attach to this part on every platform.
|
|
13
|
+
public static let baseTarget: AstryxBaseTarget = .root
|
|
14
|
+
public var base: AstryxBaseProps
|
|
15
|
+
public var orientation: DividerOrientation?
|
|
16
|
+
public var label: String?
|
|
17
|
+
public var variant: DividerVariant?
|
|
18
|
+
public var isFullBleed: Bool?
|
|
19
|
+
public init(orientation: DividerOrientation? = nil, label: String? = nil, variant: DividerVariant? = nil, isFullBleed: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
|
|
20
|
+
self.orientation = orientation
|
|
21
|
+
self.label = label
|
|
22
|
+
self.variant = variant
|
|
23
|
+
self.isFullBleed = isFullBleed
|
|
24
|
+
self.base = base
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
public struct DividerNode: Decodable, Equatable, Sendable {
|
|
28
|
+
public struct Props: Decodable, Equatable, Sendable {
|
|
29
|
+
public var orientation: DividerOrientation?
|
|
30
|
+
public var label: String?
|
|
31
|
+
public var variant: DividerVariant?
|
|
32
|
+
public var isFullBleed: Bool?
|
|
33
|
+
}
|
|
34
|
+
public let key: String
|
|
35
|
+
public let base: AstryxBaseProps?
|
|
36
|
+
public let props: Props
|
|
37
|
+
/// The callbacks the core listens to, by prop name.
|
|
38
|
+
public let events: [String]?
|
|
39
|
+
|
|
40
|
+
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
|
|
41
|
+
|
|
42
|
+
/// The contract a Divider view takes; its callbacks send actions to the core.
|
|
43
|
+
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> DividerProps {
|
|
44
|
+
return DividerProps(
|
|
45
|
+
orientation: props.orientation,
|
|
46
|
+
label: props.label,
|
|
47
|
+
variant: props.variant,
|
|
48
|
+
isFullBleed: props.isFullBleed,
|
|
49
|
+
base: base ?? AstryxBaseProps()
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
#endif
|
|
54
|
+
#if os(macOS)
|
|
55
|
+
public struct DividerProps {
|
|
56
|
+
/// Base props attach to this part on every platform.
|
|
57
|
+
public static let baseTarget: AstryxBaseTarget = .root
|
|
58
|
+
public var base: AstryxBaseProps
|
|
59
|
+
public var orientation: DividerOrientation?
|
|
60
|
+
public var label: String?
|
|
61
|
+
public var variant: DividerVariant?
|
|
62
|
+
public var isFullBleed: Bool?
|
|
63
|
+
public init(orientation: DividerOrientation? = nil, label: String? = nil, variant: DividerVariant? = nil, isFullBleed: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
|
|
64
|
+
self.orientation = orientation
|
|
65
|
+
self.label = label
|
|
66
|
+
self.variant = variant
|
|
67
|
+
self.isFullBleed = isFullBleed
|
|
68
|
+
self.base = base
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
public struct DividerNode: Decodable, Equatable, Sendable {
|
|
72
|
+
public struct Props: Decodable, Equatable, Sendable {
|
|
73
|
+
public var orientation: DividerOrientation?
|
|
74
|
+
public var label: String?
|
|
75
|
+
public var variant: DividerVariant?
|
|
76
|
+
public var isFullBleed: Bool?
|
|
77
|
+
}
|
|
78
|
+
public let key: String
|
|
79
|
+
public let base: AstryxBaseProps?
|
|
80
|
+
public let props: Props
|
|
81
|
+
/// The callbacks the core listens to, by prop name.
|
|
82
|
+
public let events: [String]?
|
|
83
|
+
|
|
84
|
+
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
|
|
85
|
+
|
|
86
|
+
/// The contract a Divider view takes; its callbacks send actions to the core.
|
|
87
|
+
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> DividerProps {
|
|
88
|
+
return DividerProps(
|
|
89
|
+
orientation: props.orientation,
|
|
90
|
+
label: props.label,
|
|
91
|
+
variant: props.variant,
|
|
92
|
+
isFullBleed: props.isFullBleed,
|
|
93
|
+
base: base ?? AstryxBaseProps()
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
// Generated by @astryxdesign/native. Do not edit.
|
|
2
|
+
public enum HStackGap: Double, CaseIterable, Codable, Sendable {
|
|
3
|
+
case v0 = 0
|
|
4
|
+
case v0_5 = 0.5
|
|
5
|
+
case v1 = 1
|
|
6
|
+
case v1_5 = 1.5
|
|
7
|
+
case v2 = 2
|
|
8
|
+
case v3 = 3
|
|
9
|
+
case v4 = 4
|
|
10
|
+
case v5 = 5
|
|
11
|
+
case v6 = 6
|
|
12
|
+
case v8 = 8
|
|
13
|
+
case v10 = 10
|
|
14
|
+
}
|
|
15
|
+
public enum HStackPadding: Double, CaseIterable, Codable, Sendable {
|
|
16
|
+
case v0 = 0
|
|
17
|
+
case v0_5 = 0.5
|
|
18
|
+
case v1 = 1
|
|
19
|
+
case v1_5 = 1.5
|
|
20
|
+
case v2 = 2
|
|
21
|
+
case v3 = 3
|
|
22
|
+
case v4 = 4
|
|
23
|
+
case v5 = 5
|
|
24
|
+
case v6 = 6
|
|
25
|
+
case v8 = 8
|
|
26
|
+
case v10 = 10
|
|
27
|
+
}
|
|
28
|
+
public enum HStackPaddingInline: Double, CaseIterable, Codable, Sendable {
|
|
29
|
+
case v0 = 0
|
|
30
|
+
case v0_5 = 0.5
|
|
31
|
+
case v1 = 1
|
|
32
|
+
case v1_5 = 1.5
|
|
33
|
+
case v2 = 2
|
|
34
|
+
case v3 = 3
|
|
35
|
+
case v4 = 4
|
|
36
|
+
case v5 = 5
|
|
37
|
+
case v6 = 6
|
|
38
|
+
case v8 = 8
|
|
39
|
+
case v10 = 10
|
|
40
|
+
}
|
|
41
|
+
public enum HStackPaddingInlineStart: Double, CaseIterable, Codable, Sendable {
|
|
42
|
+
case v0 = 0
|
|
43
|
+
case v0_5 = 0.5
|
|
44
|
+
case v1 = 1
|
|
45
|
+
case v1_5 = 1.5
|
|
46
|
+
case v2 = 2
|
|
47
|
+
case v3 = 3
|
|
48
|
+
case v4 = 4
|
|
49
|
+
case v5 = 5
|
|
50
|
+
case v6 = 6
|
|
51
|
+
case v8 = 8
|
|
52
|
+
case v10 = 10
|
|
53
|
+
}
|
|
54
|
+
public enum HStackPaddingInlineEnd: Double, CaseIterable, Codable, Sendable {
|
|
55
|
+
case v0 = 0
|
|
56
|
+
case v0_5 = 0.5
|
|
57
|
+
case v1 = 1
|
|
58
|
+
case v1_5 = 1.5
|
|
59
|
+
case v2 = 2
|
|
60
|
+
case v3 = 3
|
|
61
|
+
case v4 = 4
|
|
62
|
+
case v5 = 5
|
|
63
|
+
case v6 = 6
|
|
64
|
+
case v8 = 8
|
|
65
|
+
case v10 = 10
|
|
66
|
+
}
|
|
67
|
+
public enum HStackPaddingBlock: Double, CaseIterable, Codable, Sendable {
|
|
68
|
+
case v0 = 0
|
|
69
|
+
case v0_5 = 0.5
|
|
70
|
+
case v1 = 1
|
|
71
|
+
case v1_5 = 1.5
|
|
72
|
+
case v2 = 2
|
|
73
|
+
case v3 = 3
|
|
74
|
+
case v4 = 4
|
|
75
|
+
case v5 = 5
|
|
76
|
+
case v6 = 6
|
|
77
|
+
case v8 = 8
|
|
78
|
+
case v10 = 10
|
|
79
|
+
}
|
|
80
|
+
public enum HStackPaddingBlockStart: Double, CaseIterable, Codable, Sendable {
|
|
81
|
+
case v0 = 0
|
|
82
|
+
case v0_5 = 0.5
|
|
83
|
+
case v1 = 1
|
|
84
|
+
case v1_5 = 1.5
|
|
85
|
+
case v2 = 2
|
|
86
|
+
case v3 = 3
|
|
87
|
+
case v4 = 4
|
|
88
|
+
case v5 = 5
|
|
89
|
+
case v6 = 6
|
|
90
|
+
case v8 = 8
|
|
91
|
+
case v10 = 10
|
|
92
|
+
}
|
|
93
|
+
public enum HStackPaddingBlockEnd: Double, CaseIterable, Codable, Sendable {
|
|
94
|
+
case v0 = 0
|
|
95
|
+
case v0_5 = 0.5
|
|
96
|
+
case v1 = 1
|
|
97
|
+
case v1_5 = 1.5
|
|
98
|
+
case v2 = 2
|
|
99
|
+
case v3 = 3
|
|
100
|
+
case v4 = 4
|
|
101
|
+
case v5 = 5
|
|
102
|
+
case v6 = 6
|
|
103
|
+
case v8 = 8
|
|
104
|
+
case v10 = 10
|
|
105
|
+
}
|
|
106
|
+
public enum HStackHAlign: String, CaseIterable, Codable, Sendable {
|
|
107
|
+
case start = "start"
|
|
108
|
+
case center = "center"
|
|
109
|
+
case end = "end"
|
|
110
|
+
case between = "between"
|
|
111
|
+
case around = "around"
|
|
112
|
+
case evenly = "evenly"
|
|
113
|
+
}
|
|
114
|
+
public enum HStackVAlign: String, CaseIterable, Codable, Sendable {
|
|
115
|
+
case start = "start"
|
|
116
|
+
case center = "center"
|
|
117
|
+
case end = "end"
|
|
118
|
+
case stretch = "stretch"
|
|
119
|
+
}
|
|
120
|
+
public enum HStackJustify: String, CaseIterable, Codable, Sendable {
|
|
121
|
+
case start = "start"
|
|
122
|
+
case center = "center"
|
|
123
|
+
case end = "end"
|
|
124
|
+
case between = "between"
|
|
125
|
+
case around = "around"
|
|
126
|
+
case evenly = "evenly"
|
|
127
|
+
}
|
|
128
|
+
public enum HStackAlign: String, CaseIterable, Codable, Sendable {
|
|
129
|
+
case start = "start"
|
|
130
|
+
case center = "center"
|
|
131
|
+
case end = "end"
|
|
132
|
+
case stretch = "stretch"
|
|
133
|
+
}
|
|
134
|
+
public enum HStackWrap: String, CaseIterable, Codable, Sendable {
|
|
135
|
+
case nowrap = "nowrap"
|
|
136
|
+
case wrap = "wrap"
|
|
137
|
+
case wrapReverse = "wrap-reverse"
|
|
138
|
+
}
|
|
139
|
+
#if os(iOS)
|
|
140
|
+
public struct HStackProps {
|
|
141
|
+
/// Base props attach to this part on every platform.
|
|
142
|
+
public static let baseTarget: AstryxBaseTarget = .container
|
|
143
|
+
public var base: AstryxBaseProps
|
|
144
|
+
public var gap: HStackGap?
|
|
145
|
+
public var padding: HStackPadding?
|
|
146
|
+
public var paddingInline: HStackPaddingInline?
|
|
147
|
+
public var paddingInlineStart: HStackPaddingInlineStart?
|
|
148
|
+
public var paddingInlineEnd: HStackPaddingInlineEnd?
|
|
149
|
+
public var paddingBlock: HStackPaddingBlock?
|
|
150
|
+
public var paddingBlockStart: HStackPaddingBlockStart?
|
|
151
|
+
public var paddingBlockEnd: HStackPaddingBlockEnd?
|
|
152
|
+
public var isScrollable: Bool?
|
|
153
|
+
public var hAlign: HStackHAlign?
|
|
154
|
+
public var vAlign: HStackVAlign?
|
|
155
|
+
public var justify: HStackJustify?
|
|
156
|
+
public var align: HStackAlign?
|
|
157
|
+
public var wrap: HStackWrap?
|
|
158
|
+
public init(gap: HStackGap? = nil, padding: HStackPadding? = nil, paddingInline: HStackPaddingInline? = nil, paddingInlineStart: HStackPaddingInlineStart? = nil, paddingInlineEnd: HStackPaddingInlineEnd? = nil, paddingBlock: HStackPaddingBlock? = nil, paddingBlockStart: HStackPaddingBlockStart? = nil, paddingBlockEnd: HStackPaddingBlockEnd? = nil, isScrollable: Bool? = nil, hAlign: HStackHAlign? = nil, vAlign: HStackVAlign? = nil, justify: HStackJustify? = nil, align: HStackAlign? = nil, wrap: HStackWrap? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
|
|
159
|
+
self.gap = gap
|
|
160
|
+
self.padding = padding
|
|
161
|
+
self.paddingInline = paddingInline
|
|
162
|
+
self.paddingInlineStart = paddingInlineStart
|
|
163
|
+
self.paddingInlineEnd = paddingInlineEnd
|
|
164
|
+
self.paddingBlock = paddingBlock
|
|
165
|
+
self.paddingBlockStart = paddingBlockStart
|
|
166
|
+
self.paddingBlockEnd = paddingBlockEnd
|
|
167
|
+
self.isScrollable = isScrollable
|
|
168
|
+
self.hAlign = hAlign
|
|
169
|
+
self.vAlign = vAlign
|
|
170
|
+
self.justify = justify
|
|
171
|
+
self.align = align
|
|
172
|
+
self.wrap = wrap
|
|
173
|
+
self.base = base
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
public struct HStackNode: Decodable, Equatable, Sendable {
|
|
177
|
+
public struct Props: Decodable, Equatable, Sendable {
|
|
178
|
+
public var gap: HStackGap?
|
|
179
|
+
public var padding: HStackPadding?
|
|
180
|
+
public var paddingInline: HStackPaddingInline?
|
|
181
|
+
public var paddingInlineStart: HStackPaddingInlineStart?
|
|
182
|
+
public var paddingInlineEnd: HStackPaddingInlineEnd?
|
|
183
|
+
public var paddingBlock: HStackPaddingBlock?
|
|
184
|
+
public var paddingBlockStart: HStackPaddingBlockStart?
|
|
185
|
+
public var paddingBlockEnd: HStackPaddingBlockEnd?
|
|
186
|
+
public var isScrollable: Bool?
|
|
187
|
+
public var hAlign: HStackHAlign?
|
|
188
|
+
public var vAlign: HStackVAlign?
|
|
189
|
+
public var justify: HStackJustify?
|
|
190
|
+
public var align: HStackAlign?
|
|
191
|
+
public var wrap: HStackWrap?
|
|
192
|
+
public var children: [AstryxNode]?
|
|
193
|
+
}
|
|
194
|
+
public let key: String
|
|
195
|
+
public let base: AstryxBaseProps?
|
|
196
|
+
public let props: Props
|
|
197
|
+
/// The callbacks the core listens to, by prop name.
|
|
198
|
+
public let events: [String]?
|
|
199
|
+
|
|
200
|
+
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
|
|
201
|
+
|
|
202
|
+
/// The contract a HStack view takes; its callbacks send actions to the core.
|
|
203
|
+
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> HStackProps {
|
|
204
|
+
return HStackProps(
|
|
205
|
+
gap: props.gap,
|
|
206
|
+
padding: props.padding,
|
|
207
|
+
paddingInline: props.paddingInline,
|
|
208
|
+
paddingInlineStart: props.paddingInlineStart,
|
|
209
|
+
paddingInlineEnd: props.paddingInlineEnd,
|
|
210
|
+
paddingBlock: props.paddingBlock,
|
|
211
|
+
paddingBlockStart: props.paddingBlockStart,
|
|
212
|
+
paddingBlockEnd: props.paddingBlockEnd,
|
|
213
|
+
isScrollable: props.isScrollable,
|
|
214
|
+
hAlign: props.hAlign,
|
|
215
|
+
vAlign: props.vAlign,
|
|
216
|
+
justify: props.justify,
|
|
217
|
+
align: props.align,
|
|
218
|
+
wrap: props.wrap,
|
|
219
|
+
base: base ?? AstryxBaseProps()
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
#endif
|
|
224
|
+
#if os(macOS)
|
|
225
|
+
public struct HStackProps {
|
|
226
|
+
/// Base props attach to this part on every platform.
|
|
227
|
+
public static let baseTarget: AstryxBaseTarget = .container
|
|
228
|
+
public var base: AstryxBaseProps
|
|
229
|
+
public var gap: HStackGap?
|
|
230
|
+
public var padding: HStackPadding?
|
|
231
|
+
public var paddingInline: HStackPaddingInline?
|
|
232
|
+
public var paddingInlineStart: HStackPaddingInlineStart?
|
|
233
|
+
public var paddingInlineEnd: HStackPaddingInlineEnd?
|
|
234
|
+
public var paddingBlock: HStackPaddingBlock?
|
|
235
|
+
public var paddingBlockStart: HStackPaddingBlockStart?
|
|
236
|
+
public var paddingBlockEnd: HStackPaddingBlockEnd?
|
|
237
|
+
public var isScrollable: Bool?
|
|
238
|
+
public var hAlign: HStackHAlign?
|
|
239
|
+
public var vAlign: HStackVAlign?
|
|
240
|
+
public var justify: HStackJustify?
|
|
241
|
+
public var align: HStackAlign?
|
|
242
|
+
public var wrap: HStackWrap?
|
|
243
|
+
public init(gap: HStackGap? = nil, padding: HStackPadding? = nil, paddingInline: HStackPaddingInline? = nil, paddingInlineStart: HStackPaddingInlineStart? = nil, paddingInlineEnd: HStackPaddingInlineEnd? = nil, paddingBlock: HStackPaddingBlock? = nil, paddingBlockStart: HStackPaddingBlockStart? = nil, paddingBlockEnd: HStackPaddingBlockEnd? = nil, isScrollable: Bool? = nil, hAlign: HStackHAlign? = nil, vAlign: HStackVAlign? = nil, justify: HStackJustify? = nil, align: HStackAlign? = nil, wrap: HStackWrap? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
|
|
244
|
+
self.gap = gap
|
|
245
|
+
self.padding = padding
|
|
246
|
+
self.paddingInline = paddingInline
|
|
247
|
+
self.paddingInlineStart = paddingInlineStart
|
|
248
|
+
self.paddingInlineEnd = paddingInlineEnd
|
|
249
|
+
self.paddingBlock = paddingBlock
|
|
250
|
+
self.paddingBlockStart = paddingBlockStart
|
|
251
|
+
self.paddingBlockEnd = paddingBlockEnd
|
|
252
|
+
self.isScrollable = isScrollable
|
|
253
|
+
self.hAlign = hAlign
|
|
254
|
+
self.vAlign = vAlign
|
|
255
|
+
self.justify = justify
|
|
256
|
+
self.align = align
|
|
257
|
+
self.wrap = wrap
|
|
258
|
+
self.base = base
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
public struct HStackNode: Decodable, Equatable, Sendable {
|
|
262
|
+
public struct Props: Decodable, Equatable, Sendable {
|
|
263
|
+
public var gap: HStackGap?
|
|
264
|
+
public var padding: HStackPadding?
|
|
265
|
+
public var paddingInline: HStackPaddingInline?
|
|
266
|
+
public var paddingInlineStart: HStackPaddingInlineStart?
|
|
267
|
+
public var paddingInlineEnd: HStackPaddingInlineEnd?
|
|
268
|
+
public var paddingBlock: HStackPaddingBlock?
|
|
269
|
+
public var paddingBlockStart: HStackPaddingBlockStart?
|
|
270
|
+
public var paddingBlockEnd: HStackPaddingBlockEnd?
|
|
271
|
+
public var isScrollable: Bool?
|
|
272
|
+
public var hAlign: HStackHAlign?
|
|
273
|
+
public var vAlign: HStackVAlign?
|
|
274
|
+
public var justify: HStackJustify?
|
|
275
|
+
public var align: HStackAlign?
|
|
276
|
+
public var wrap: HStackWrap?
|
|
277
|
+
public var children: [AstryxNode]?
|
|
278
|
+
}
|
|
279
|
+
public let key: String
|
|
280
|
+
public let base: AstryxBaseProps?
|
|
281
|
+
public let props: Props
|
|
282
|
+
/// The callbacks the core listens to, by prop name.
|
|
283
|
+
public let events: [String]?
|
|
284
|
+
|
|
285
|
+
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
|
|
286
|
+
|
|
287
|
+
/// The contract a HStack view takes; its callbacks send actions to the core.
|
|
288
|
+
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> HStackProps {
|
|
289
|
+
return HStackProps(
|
|
290
|
+
gap: props.gap,
|
|
291
|
+
padding: props.padding,
|
|
292
|
+
paddingInline: props.paddingInline,
|
|
293
|
+
paddingInlineStart: props.paddingInlineStart,
|
|
294
|
+
paddingInlineEnd: props.paddingInlineEnd,
|
|
295
|
+
paddingBlock: props.paddingBlock,
|
|
296
|
+
paddingBlockStart: props.paddingBlockStart,
|
|
297
|
+
paddingBlockEnd: props.paddingBlockEnd,
|
|
298
|
+
isScrollable: props.isScrollable,
|
|
299
|
+
hAlign: props.hAlign,
|
|
300
|
+
vAlign: props.vAlign,
|
|
301
|
+
justify: props.justify,
|
|
302
|
+
align: props.align,
|
|
303
|
+
wrap: props.wrap,
|
|
304
|
+
base: base ?? AstryxBaseProps()
|
|
305
|
+
)
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
#endif
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Generated by @astryxdesign/native. Do not edit.
|
|
2
|
+
public enum HeadingLevel: Int, CaseIterable, Codable, Sendable {
|
|
3
|
+
case v1 = 1
|
|
4
|
+
case v2 = 2
|
|
5
|
+
case v3 = 3
|
|
6
|
+
case v4 = 4
|
|
7
|
+
case v5 = 5
|
|
8
|
+
case v6 = 6
|
|
9
|
+
}
|
|
10
|
+
public enum HeadingType: String, CaseIterable, Codable, Sendable {
|
|
11
|
+
case display1 = "display-1"
|
|
12
|
+
case display2 = "display-2"
|
|
13
|
+
case display3 = "display-3"
|
|
14
|
+
}
|
|
15
|
+
public enum HeadingWeight: String, CaseIterable, Codable, Sendable {
|
|
16
|
+
case normal = "normal"
|
|
17
|
+
case medium = "medium"
|
|
18
|
+
case semibold = "semibold"
|
|
19
|
+
case bold = "bold"
|
|
20
|
+
}
|
|
21
|
+
public enum HeadingAccessibilityLevel: Int, CaseIterable, Codable, Sendable {
|
|
22
|
+
case v1 = 1
|
|
23
|
+
case v2 = 2
|
|
24
|
+
case v3 = 3
|
|
25
|
+
case v4 = 4
|
|
26
|
+
case v5 = 5
|
|
27
|
+
case v6 = 6
|
|
28
|
+
}
|
|
29
|
+
public enum HeadingColor: String, CaseIterable, Codable, Sendable {
|
|
30
|
+
case primary = "primary"
|
|
31
|
+
case secondary = "secondary"
|
|
32
|
+
case disabled = "disabled"
|
|
33
|
+
case placeholder = "placeholder"
|
|
34
|
+
case accent = "accent"
|
|
35
|
+
case inherit = "inherit"
|
|
36
|
+
}
|
|
37
|
+
public enum HeadingJustify: String, CaseIterable, Codable, Sendable {
|
|
38
|
+
case start = "start"
|
|
39
|
+
case center = "center"
|
|
40
|
+
case end = "end"
|
|
41
|
+
}
|
|
42
|
+
#if os(iOS)
|
|
43
|
+
public struct HeadingProps {
|
|
44
|
+
/// Base props attach to this part on every platform.
|
|
45
|
+
public static let baseTarget: AstryxBaseTarget = .root
|
|
46
|
+
public var base: AstryxBaseProps
|
|
47
|
+
public var level: HeadingLevel
|
|
48
|
+
public var type: HeadingType?
|
|
49
|
+
public var weight: HeadingWeight?
|
|
50
|
+
public var children: String
|
|
51
|
+
public var accessibilityLevel: HeadingAccessibilityLevel?
|
|
52
|
+
public var color: HeadingColor?
|
|
53
|
+
public var maxLines: Double?
|
|
54
|
+
public var justify: HeadingJustify?
|
|
55
|
+
public var hasStrikethrough: Bool?
|
|
56
|
+
public init(level: HeadingLevel, type: HeadingType? = nil, weight: HeadingWeight? = nil, children: String, accessibilityLevel: HeadingAccessibilityLevel? = nil, color: HeadingColor? = nil, maxLines: Double? = nil, justify: HeadingJustify? = nil, hasStrikethrough: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
|
|
57
|
+
self.level = level
|
|
58
|
+
self.type = type
|
|
59
|
+
self.weight = weight
|
|
60
|
+
self.children = children
|
|
61
|
+
self.accessibilityLevel = accessibilityLevel
|
|
62
|
+
self.color = color
|
|
63
|
+
self.maxLines = maxLines
|
|
64
|
+
self.justify = justify
|
|
65
|
+
self.hasStrikethrough = hasStrikethrough
|
|
66
|
+
self.base = base
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
public struct HeadingNode: Decodable, Equatable, Sendable {
|
|
70
|
+
public struct Props: Decodable, Equatable, Sendable {
|
|
71
|
+
public var level: HeadingLevel
|
|
72
|
+
public var type: HeadingType?
|
|
73
|
+
public var weight: HeadingWeight?
|
|
74
|
+
public var children: String
|
|
75
|
+
public var accessibilityLevel: HeadingAccessibilityLevel?
|
|
76
|
+
public var color: HeadingColor?
|
|
77
|
+
public var maxLines: Double?
|
|
78
|
+
public var justify: HeadingJustify?
|
|
79
|
+
public var hasStrikethrough: Bool?
|
|
80
|
+
}
|
|
81
|
+
public let key: String
|
|
82
|
+
public let base: AstryxBaseProps?
|
|
83
|
+
public let props: Props
|
|
84
|
+
/// The callbacks the core listens to, by prop name.
|
|
85
|
+
public let events: [String]?
|
|
86
|
+
|
|
87
|
+
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
|
|
88
|
+
|
|
89
|
+
/// The contract a Heading view takes; its callbacks send actions to the core.
|
|
90
|
+
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> HeadingProps {
|
|
91
|
+
return HeadingProps(
|
|
92
|
+
level: props.level,
|
|
93
|
+
type: props.type,
|
|
94
|
+
weight: props.weight,
|
|
95
|
+
children: props.children,
|
|
96
|
+
accessibilityLevel: props.accessibilityLevel,
|
|
97
|
+
color: props.color,
|
|
98
|
+
maxLines: props.maxLines,
|
|
99
|
+
justify: props.justify,
|
|
100
|
+
hasStrikethrough: props.hasStrikethrough,
|
|
101
|
+
base: base ?? AstryxBaseProps()
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
#endif
|
|
106
|
+
#if os(macOS)
|
|
107
|
+
public struct HeadingProps {
|
|
108
|
+
/// Base props attach to this part on every platform.
|
|
109
|
+
public static let baseTarget: AstryxBaseTarget = .root
|
|
110
|
+
public var base: AstryxBaseProps
|
|
111
|
+
public var level: HeadingLevel
|
|
112
|
+
public var type: HeadingType?
|
|
113
|
+
public var weight: HeadingWeight?
|
|
114
|
+
public var children: String
|
|
115
|
+
public var accessibilityLevel: HeadingAccessibilityLevel?
|
|
116
|
+
public var color: HeadingColor?
|
|
117
|
+
public var maxLines: Double?
|
|
118
|
+
public var justify: HeadingJustify?
|
|
119
|
+
public var hasStrikethrough: Bool?
|
|
120
|
+
public init(level: HeadingLevel, type: HeadingType? = nil, weight: HeadingWeight? = nil, children: String, accessibilityLevel: HeadingAccessibilityLevel? = nil, color: HeadingColor? = nil, maxLines: Double? = nil, justify: HeadingJustify? = nil, hasStrikethrough: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
|
|
121
|
+
self.level = level
|
|
122
|
+
self.type = type
|
|
123
|
+
self.weight = weight
|
|
124
|
+
self.children = children
|
|
125
|
+
self.accessibilityLevel = accessibilityLevel
|
|
126
|
+
self.color = color
|
|
127
|
+
self.maxLines = maxLines
|
|
128
|
+
self.justify = justify
|
|
129
|
+
self.hasStrikethrough = hasStrikethrough
|
|
130
|
+
self.base = base
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
public struct HeadingNode: Decodable, Equatable, Sendable {
|
|
134
|
+
public struct Props: Decodable, Equatable, Sendable {
|
|
135
|
+
public var level: HeadingLevel
|
|
136
|
+
public var type: HeadingType?
|
|
137
|
+
public var weight: HeadingWeight?
|
|
138
|
+
public var children: String
|
|
139
|
+
public var accessibilityLevel: HeadingAccessibilityLevel?
|
|
140
|
+
public var color: HeadingColor?
|
|
141
|
+
public var maxLines: Double?
|
|
142
|
+
public var justify: HeadingJustify?
|
|
143
|
+
public var hasStrikethrough: Bool?
|
|
144
|
+
}
|
|
145
|
+
public let key: String
|
|
146
|
+
public let base: AstryxBaseProps?
|
|
147
|
+
public let props: Props
|
|
148
|
+
/// The callbacks the core listens to, by prop name.
|
|
149
|
+
public let events: [String]?
|
|
150
|
+
|
|
151
|
+
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
|
|
152
|
+
|
|
153
|
+
/// The contract a Heading view takes; its callbacks send actions to the core.
|
|
154
|
+
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> HeadingProps {
|
|
155
|
+
return HeadingProps(
|
|
156
|
+
level: props.level,
|
|
157
|
+
type: props.type,
|
|
158
|
+
weight: props.weight,
|
|
159
|
+
children: props.children,
|
|
160
|
+
accessibilityLevel: props.accessibilityLevel,
|
|
161
|
+
color: props.color,
|
|
162
|
+
maxLines: props.maxLines,
|
|
163
|
+
justify: props.justify,
|
|
164
|
+
hasStrikethrough: props.hasStrikethrough,
|
|
165
|
+
base: base ?? AstryxBaseProps()
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
#endif
|