Skip to content

Commit

Permalink
Releasing v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Judo Release Bot 🤖 authored and seanrucker committed Mar 11, 2024
1 parent 038f4a2 commit c511d77
Show file tree
Hide file tree
Showing 38 changed files with 452 additions and 53 deletions.
15 changes: 14 additions & 1 deletion Sources/JudoDocument/Layers/CollectionLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ public struct CollectionLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var keyPath: String
public var filters: [Condition]
public var sortDescriptors: [SortDescriptor]
public var limit: Limit?

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, keyPath: String, filters: [Condition], sortDescriptors: [SortDescriptor], limit: Limit?) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, keyPath: String, filters: [Condition], sortDescriptors: [SortDescriptor], limit: Limit?) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.keyPath = keyPath
self.filters = filters
Expand All @@ -46,6 +48,7 @@ public struct CollectionLayer: Layer {
case name
case children
case position
case frame
case isLocked
case keyPath
case filters
Expand All @@ -59,6 +62,15 @@ public struct CollectionLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false
keyPath = try container.decode(String.self, forKey: .keyPath)
filters = try container.decode([Condition].self, forKey: .filters)
Expand All @@ -73,6 +85,7 @@ public struct CollectionLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(keyPath, forKey: .keyPath)
try container.encode(filters, forKey: .filters)
Expand Down
16 changes: 14 additions & 2 deletions Sources/JudoDocument/Layers/ComponentInstanceLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ public struct ComponentInstanceLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var value: Variable<UUID>
public var overrides: Overrides

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, value: Variable<UUID>, overrides: Overrides) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, value: Variable<UUID>, overrides: Overrides) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.value = value
self.overrides = overrides
Expand All @@ -44,6 +46,7 @@ public struct ComponentInstanceLayer: Layer {
case name
case children
case position
case frame
case isLocked
case value
case overrides
Expand Down Expand Up @@ -118,9 +121,17 @@ public struct ComponentInstanceLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)
isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

if meta.version >= 18 {
value = try container.decode(Variable<UUID>.self, forKey: .value)
overrides = try container.decode(Overrides.self, forKey: .overrides)
Expand Down Expand Up @@ -288,6 +299,7 @@ public struct ComponentInstanceLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(value, forKey: .value)
try container.encode(overrides, forKey: .overrides)
Expand Down
15 changes: 14 additions & 1 deletion Sources/JudoDocument/Layers/ConditionalLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ public struct ConditionalLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var conditions: [Condition]

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, conditions: [Condition]) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, conditions: [Condition]) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.conditions = conditions
}
Expand All @@ -40,6 +42,7 @@ public struct ConditionalLayer: Layer {
case name
case children
case position
case frame
case isLocked
case conditions
}
Expand All @@ -50,6 +53,15 @@ public struct ConditionalLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false
conditions = try container.decode([Condition].self, forKey: .conditions)
}
Expand All @@ -61,6 +73,7 @@ public struct ConditionalLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(conditions, forKey: .conditions)
}
Expand Down
16 changes: 14 additions & 2 deletions Sources/JudoDocument/Layers/Controls/ButtonLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ public struct ButtonLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var role: ButtonRole
public var actions: [Action]

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, role: ButtonRole, actions: [Action]) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, role: ButtonRole, actions: [Action]) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.role = role
self.actions = actions
Expand All @@ -42,6 +44,7 @@ public struct ButtonLayer: Layer {
case name
case children
case position
case frame
case isLocked
case role
case actions
Expand All @@ -56,10 +59,18 @@ public struct ButtonLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false
role = try container.decode(ButtonRole.self, forKey: .role)

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<14:
let legacyAction = try container.decode(LegacyAction.self, forKey: .buttonAction)
Expand All @@ -79,6 +90,7 @@ public struct ButtonLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(role, forKey: .role)
try container.encodeActions(actions, forKey: .actions)
Expand Down
16 changes: 14 additions & 2 deletions Sources/JudoDocument/Layers/Controls/PickerLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ public struct PickerLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var label: Variable<String>
public var textSelection: Variable<String>?
public var numberSelection: Variable<Double>?
public var options: [PickerOption]
public var pickerType: PickerType

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, label: Variable<String>, textSelection: Variable<String>?, numberSelection: Variable<Double>?, options: [PickerOption], pickerType: PickerType) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, label: Variable<String>, textSelection: Variable<String>?, numberSelection: Variable<Double>?, options: [PickerOption], pickerType: PickerType) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.label = label
self.textSelection = textSelection
Expand All @@ -48,6 +50,7 @@ public struct PickerLayer: Layer {
case name
case children
case position
case frame
case isLocked
case label
case textSelection
Expand All @@ -62,9 +65,17 @@ public struct PickerLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)
isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

switch meta.version {
case ..<17:
label = try Variable(container.decode(LegacyTextValue.self, forKey: .label))
Expand Down Expand Up @@ -98,6 +109,7 @@ public struct PickerLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(label, forKey: .label)
try container.encode(textSelection, forKey: .textSelection)
Expand Down
16 changes: 14 additions & 2 deletions Sources/JudoDocument/Layers/Controls/SliderLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public struct SliderLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var label: Variable<String>
public var minLabel: Variable<String>?
Expand All @@ -29,11 +30,12 @@ public struct SliderLayer: Layer {
public var maxValue: Variable<Double>?
public var step: Variable<Double>?

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, label: Variable<String>, minLabel: Variable<String>?, maxLabel: Variable<String>?, value: Variable<Double>, minValue: Variable<Double>?, maxValue: Variable<Double>?, step: Variable<Double>?) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, label: Variable<String>, minLabel: Variable<String>?, maxLabel: Variable<String>?, value: Variable<Double>, minValue: Variable<Double>?, maxValue: Variable<Double>?, step: Variable<Double>?) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.label = label
self.minLabel = minLabel
Expand All @@ -52,6 +54,7 @@ public struct SliderLayer: Layer {
case name
case children
case position
case frame
case isLocked
case label
case minLabel
Expand All @@ -68,9 +71,17 @@ public struct SliderLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)
isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

switch meta.version {
case ..<17:
label = try Variable(container.decode(LegacyTextValue.self, forKey: .label))
Expand Down Expand Up @@ -114,6 +125,7 @@ public struct SliderLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(label, forKey: .label)
try container.encode(minLabel, forKey: .minLabel)
Expand Down
16 changes: 14 additions & 2 deletions Sources/JudoDocument/Layers/Controls/StepperLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ public struct StepperLayer: Layer {
public var name: String?
public var children: [Node]
public var position: CGPoint
public var frame: Frame
public var isLocked: Bool
public var label: Variable<String>
public var value: Variable<Double>
public var minValue: Variable<Double>?
public var maxValue: Variable<Double>?
public var step: Variable<Double>?

public init(id: UUID, name: String?, children: [Node], position: CGPoint, isLocked: Bool, label: Variable<String>, value: Variable<Double>, minValue: Variable<Double>?, maxValue: Variable<Double>?, step: Variable<Double>?) {
public init(id: UUID, name: String?, children: [Node], position: CGPoint, frame: Frame, isLocked: Bool, label: Variable<String>, value: Variable<Double>, minValue: Variable<Double>?, maxValue: Variable<Double>?, step: Variable<Double>?) {
self.id = id
self.name = name
self.children = children
self.position = position
self.frame = frame
self.isLocked = isLocked
self.label = label
self.value = value
Expand All @@ -48,6 +50,7 @@ public struct StepperLayer: Layer {
case name
case children
case position
case frame
case isLocked
case label
case value
Expand All @@ -62,9 +65,17 @@ public struct StepperLayer: Layer {
name = try container.decodeIfPresent(String.self, forKey: .name)
children = try container.decodeNodes(forKey: .children)
position = try container.decode(CGPoint.self, forKey: .position)
isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

let meta = decoder.userInfo[.meta] as! Meta
switch meta.version {
case ..<23:
frame = Frame()
default:
frame = try container.decode(Frame.self, forKey: .frame)
}

isLocked = try container.decodeIfPresent(Bool.self, forKey: .isLocked) ?? false

switch meta.version {
case ..<17:
label = try Variable(container.decode(LegacyTextValue.self, forKey: .label))
Expand Down Expand Up @@ -97,6 +108,7 @@ public struct StepperLayer: Layer {
try container.encodeIfPresent(name, forKey: .name)
try container.encodeNodes(children, forKey: .children)
try container.encode(position, forKey: .position)
try container.encode(frame, forKey: .frame)
try container.encode(isLocked, forKey: .isLocked)
try container.encode(label, forKey: .label)
try container.encode(value, forKey: .value)
Expand Down
Loading

0 comments on commit c511d77

Please sign in to comment.