├── .gitignore ├── LICENSE ├── Package.resolved ├── Package.swift ├── README.md └── Sources ├── Sailor ├── README.md └── Sources │ ├── Custom │ ├── Attributes │ │ ├── Element+Custom.swift │ │ ├── Element+Head.swift │ │ └── Page+Custom.swift │ ├── Builders │ │ ├── BodyBuilder.swift │ │ ├── ClassBuilder.swift │ │ ├── HeadBuilder.swift │ │ ├── PageBuilder.swift │ │ └── StyleBuilder.swift │ ├── Events │ │ └── Page+SailorEvents.swift │ ├── Misc │ │ ├── CustomPage.swift │ │ ├── EmptyRenderer.swift │ │ ├── HTML.swift │ │ └── SailorPageTypes.swift │ ├── Styling │ │ ├── Classes │ │ │ ├── DynamicClass.swift │ │ │ └── DynamicClassContainer.swift │ │ └── Style │ │ │ ├── Property.swift │ │ │ ├── Style.swift │ │ │ └── StyleContainer.swift │ └── Tags │ │ ├── HTMLElements │ │ ├── Input+Inits.swift │ │ ├── Select+Init.swift │ │ └── TextArea+Init.swift │ │ ├── SpecialElements │ │ ├── Body.swift │ │ └── Head.swift │ │ └── String+Element.swift │ ├── ExportedFunctionality │ ├── ExternalSailboatTypes.swift │ └── TargetSpecificAdditions.swift │ ├── Generated │ ├── CSS+Properties.swift │ ├── GlobalAttributeGroup.swift │ ├── Tags │ │ ├── HTML+A.swift │ │ ├── HTML+Address.swift │ │ ├── HTML+Area.swift │ │ ├── HTML+Article.swift │ │ ├── HTML+Aside.swift │ │ ├── HTML+Audio.swift │ │ ├── HTML+B.swift │ │ ├── HTML+Base.swift │ │ ├── HTML+Bdi.swift │ │ ├── HTML+Bdo.swift │ │ ├── HTML+Blockquote.swift │ │ ├── HTML+Br.swift │ │ ├── HTML+Button.swift │ │ ├── HTML+Canvas.swift │ │ ├── HTML+Caption.swift │ │ ├── HTML+Cite.swift │ │ ├── HTML+Code.swift │ │ ├── HTML+Col.swift │ │ ├── HTML+Colgroup.swift │ │ ├── HTML+Datalist.swift │ │ ├── HTML+Dd.swift │ │ ├── HTML+Del.swift │ │ ├── HTML+Details.swift │ │ ├── HTML+Dfn.swift │ │ ├── HTML+Dialog.swift │ │ ├── HTML+Div.swift │ │ ├── HTML+Dl.swift │ │ ├── HTML+Dt.swift │ │ ├── HTML+Em.swift │ │ ├── HTML+Embed.swift │ │ ├── HTML+Fieldset.swift │ │ ├── HTML+Figcaption.swift │ │ ├── HTML+Figure.swift │ │ ├── HTML+Footer.swift │ │ ├── HTML+Form.swift │ │ ├── HTML+H1.swift │ │ ├── HTML+H2.swift │ │ ├── HTML+H3.swift │ │ ├── HTML+H4.swift │ │ ├── HTML+H5.swift │ │ ├── HTML+H6.swift │ │ ├── HTML+Header.swift │ │ ├── HTML+Headinggroup.swift │ │ ├── HTML+Hr.swift │ │ ├── HTML+I.swift │ │ ├── HTML+Iframe.swift │ │ ├── HTML+Img.swift │ │ ├── HTML+Input.swift │ │ ├── HTML+Ins.swift │ │ ├── HTML+Kbd.swift │ │ ├── HTML+Label.swift │ │ ├── HTML+Legend.swift │ │ ├── HTML+Li.swift │ │ ├── HTML+Link.swift │ │ ├── HTML+Map.swift │ │ ├── HTML+Mark.swift │ │ ├── HTML+Menu.swift │ │ ├── HTML+Meta.swift │ │ ├── HTML+Meter.swift │ │ ├── HTML+Nav.swift │ │ ├── HTML+Object.swift │ │ ├── HTML+Ol.swift │ │ ├── HTML+Optgroup.swift │ │ ├── HTML+Option.swift │ │ ├── HTML+Output.swift │ │ ├── HTML+P.swift │ │ ├── HTML+Picture.swift │ │ ├── HTML+Preformattedtext.swift │ │ ├── HTML+Progress.swift │ │ ├── HTML+Q.swift │ │ ├── HTML+Rp.swift │ │ ├── HTML+Rt.swift │ │ ├── HTML+Ruby.swift │ │ ├── HTML+S.swift │ │ ├── HTML+Samp.swift │ │ ├── HTML+Search.swift │ │ ├── HTML+Section.swift │ │ ├── HTML+Select.swift │ │ ├── HTML+Slot.swift │ │ ├── HTML+Small.swift │ │ ├── HTML+Source.swift │ │ ├── HTML+Span.swift │ │ ├── HTML+Strong.swift │ │ ├── HTML+Sub.swift │ │ ├── HTML+Summary.swift │ │ ├── HTML+Sup.swift │ │ ├── HTML+Table.swift │ │ ├── HTML+Tbody.swift │ │ ├── HTML+Td.swift │ │ ├── HTML+Template.swift │ │ ├── HTML+Textarea.swift │ │ ├── HTML+Tfoot.swift │ │ ├── HTML+Th.swift │ │ ├── HTML+Thead.swift │ │ ├── HTML+Time.swift │ │ ├── HTML+Title.swift │ │ ├── HTML+Tr.swift │ │ ├── HTML+Track.swift │ │ ├── HTML+U.swift │ │ ├── HTML+Ul.swift │ │ ├── HTML+Var.swift │ │ ├── HTML+Video.swift │ │ └── HTML+Wbr.swift │ └── Units │ │ ├── Unit+AlignContent.swift │ │ ├── Unit+AlignItems.swift │ │ ├── Unit+AlignSelf.swift │ │ ├── Unit+AllOrNone.swift │ │ ├── Unit+Angle.swift │ │ ├── Unit+Appearance.swift │ │ ├── Unit+AreaShape.swift │ │ ├── Unit+AspectRatio.swift │ │ ├── Unit+Attachment.swift │ │ ├── Unit+Auto.swift │ │ ├── Unit+AutoBool.swift │ │ ├── Unit+AutoColor.swift │ │ ├── Unit+AutoInt.swift │ │ ├── Unit+AutoLengthPercentage.swift │ │ ├── Unit+AutoLineStyle.swift │ │ ├── Unit+Axis.swift │ │ ├── Unit+BackfaceVisibility.swift │ │ ├── Unit+BackgroundImage.swift │ │ ├── Unit+BackgroundSize.swift │ │ ├── Unit+BgSize.swift │ │ ├── Unit+BlendMode.swift │ │ ├── Unit+BlockSize.swift │ │ ├── Unit+BorderCollapse.swift │ │ ├── Unit+BorderLineWidth.swift │ │ ├── Unit+BorderRadius.swift │ │ ├── Unit+BorderWidth.swift │ │ ├── Unit+BoxShadow.swift │ │ ├── Unit+BoxShadowPosition.swift │ │ ├── Unit+BoxSizing.swift │ │ ├── Unit+Break.swift │ │ ├── Unit+BreakInside.swift │ │ ├── Unit+ButtonType.swift │ │ ├── Unit+CaptionSide.swift │ │ ├── Unit+Clear.swift │ │ ├── Unit+Color.swift │ │ ├── Unit+ColorInterpolation.swift │ │ ├── Unit+ColorScheme.swift │ │ ├── Unit+ColumnFill.swift │ │ ├── Unit+ColumnWidth.swift │ │ ├── Unit+CombineUpright.swift │ │ ├── Unit+CompatAuto.swift │ │ ├── Unit+CompatSpecial.swift │ │ ├── Unit+Contain.swift │ │ ├── Unit+ContainerName.swift │ │ ├── Unit+ContainerType.swift │ │ ├── Unit+ContentPosition.swift │ │ ├── Unit+ContentSafety.swift │ │ ├── Unit+CounterIncrement.swift │ │ ├── Unit+CounterReset.swift │ │ ├── Unit+CounterSet.swift │ │ ├── Unit+CrossOrigin.swift │ │ ├── Unit+CursorAccent.swift │ │ ├── Unit+Direction.swift │ │ ├── Unit+DirectionBreak.swift │ │ ├── Unit+Display.swift │ │ ├── Unit+EachLine.swift │ │ ├── Unit+EnterKeyHint.swift │ │ ├── Unit+Filter.swift │ │ ├── Unit+FirstOrLast.swift │ │ ├── Unit+FlexBasis.swift │ │ ├── Unit+FlexDirection.swift │ │ ├── Unit+FlexWrap.swift │ │ ├── Unit+Float.swift │ │ ├── Unit+FontFamily.swift │ │ ├── Unit+ForcedColorAdjust.swift │ │ ├── Unit+FormEncType.swift │ │ ├── Unit+FormMethod.swift │ │ ├── Unit+GeometryBox.swift │ │ ├── Unit+Global.swift │ │ ├── Unit+Gradient.swift │ │ ├── Unit+GridLine.swift │ │ ├── Unit+Hanging.swift │ │ ├── Unit+HangingPunctuation.swift │ │ ├── Unit+HangingPunctuationForced.swift │ │ ├── Unit+HorrizontalRelativeDirection.swift │ │ ├── Unit+HyphenateCharacter.swift │ │ ├── Unit+HyphenateLimitChars.swift │ │ ├── Unit+Hyphens.swift │ │ ├── Unit+Image.swift │ │ ├── Unit+ImageOrientation.swift │ │ ├── Unit+ImageRendering.swift │ │ ├── Unit+ImageSource.swift │ │ ├── Unit+Indent.swift │ │ ├── Unit+InlineSize.swift │ │ ├── Unit+InnerRepeat.swift │ │ ├── Unit+InputMode.swift │ │ ├── Unit+InputQuantity.swift │ │ ├── Unit+InputType.swift │ │ ├── Unit+Integer.swift │ │ ├── Unit+IsolationMode.swift │ │ ├── Unit+ItemsPosition.swift │ │ ├── Unit+JustifyContent.swift │ │ ├── Unit+JustifyItems.swift │ │ ├── Unit+JustifySelf.swift │ │ ├── Unit+Language.swift │ │ ├── Unit+Length.swift │ │ ├── Unit+LengthNumber.swift │ │ ├── Unit+LengthPercentage.swift │ │ ├── Unit+LetterSpacing.swift │ │ ├── Unit+LineBreak.swift │ │ ├── Unit+LineHeight.swift │ │ ├── Unit+LineStyle.swift │ │ ├── Unit+LineWidth.swift │ │ ├── Unit+ListStylePosition.swift │ │ ├── Unit+ListStyleType.swift │ │ ├── Unit+Loading.swift │ │ ├── Unit+Location.swift │ │ ├── Unit+MathDepth.swift │ │ ├── Unit+MathStyle.swift │ │ ├── Unit+MixBlendMode.swift │ │ ├── Unit+None.swift │ │ ├── Unit+NoneImage.swift │ │ ├── Unit+NoneLength.swift │ │ ├── Unit+Normal.swift │ │ ├── Unit+NormalLengthPercentage.swift │ │ ├── Unit+Number.swift │ │ ├── Unit+NumberPercentage.swift │ │ ├── Unit+OPC.swift │ │ ├── Unit+OPFull.swift │ │ ├── Unit+OPLCR.swift │ │ ├── Unit+OPLCRLP.swift │ │ ├── Unit+OPLR.swift │ │ ├── Unit+OPTB.swift │ │ ├── Unit+OPTCB.swift │ │ ├── Unit+OPTCBLP.swift │ │ ├── Unit+ObjectFit.swift │ │ ├── Unit+ObjectPosition.swift │ │ ├── Unit+OverflowAnchor.swift │ │ ├── Unit+OverflowClipMargin.swift │ │ ├── Unit+OverflowValue.swift │ │ ├── Unit+OverflowWrap.swift │ │ ├── Unit+OverscrollBehavior.swift │ │ ├── Unit+Page.swift │ │ ├── Unit+PaintOrder.swift │ │ ├── Unit+Pair.swift │ │ ├── Unit+Percentage.swift │ │ ├── Unit+PlaceContent.swift │ │ ├── Unit+PlaceItems.swift │ │ ├── Unit+PlaceSelf.swift │ │ ├── Unit+PointerEvents.swift │ │ ├── Unit+PopoverTargetAction.swift │ │ ├── Unit+Position.swift │ │ ├── Unit+PositionType.swift │ │ ├── Unit+PositionX.swift │ │ ├── Unit+PositionY.swift │ │ ├── Unit+Preload.swift │ │ ├── Unit+PrintColorAdjust.swift │ │ ├── Unit+Question.swift │ │ ├── Unit+Quotes.swift │ │ ├── Unit+ReferrerPolicy.swift │ │ ├── Unit+Repeat.swift │ │ ├── Unit+RepeatImage.swift │ │ ├── Unit+Resize.swift │ │ ├── Unit+Rotate.swift │ │ ├── Unit+RowGap.swift │ │ ├── Unit+Sandbox.swift │ │ ├── Unit+Scale.swift │ │ ├── Unit+Scope.swift │ │ ├── Unit+ShadowRootMode.swift │ │ ├── Unit+Shape.swift │ │ ├── Unit+Shown.swift │ │ ├── Unit+Size.swift │ │ ├── Unit+SliceImage.swift │ │ ├── Unit+Source.swift │ │ ├── Unit+TableLayout.swift │ │ ├── Unit+Target.swift │ │ ├── Unit+TextAlign.swift │ │ ├── Unit+TextDecorationLine.swift │ │ ├── Unit+TextDecorationSkipInk.swift │ │ ├── Unit+TextDecorationStyle.swift │ │ ├── Unit+TextDecorationThickness.swift │ │ ├── Unit+TextEmphasisPosition.swift │ │ ├── Unit+TextEmphasisStyle.swift │ │ ├── Unit+TextJustify.swift │ │ ├── Unit+TextOrientation.swift │ │ ├── Unit+TextOverflow.swift │ │ ├── Unit+TextRendering.swift │ │ ├── Unit+TextTrackKind.swift │ │ ├── Unit+TextTransform.swift │ │ ├── Unit+TextWrap.swift │ │ ├── Unit+Toggle.swift │ │ ├── Unit+TouchAction.swift │ │ ├── Unit+Translate.swift │ │ ├── Unit+UnderlineTextPosition.swift │ │ ├── Unit+UnicodeBidi.swift │ │ ├── Unit+UnidirectionalWidth.swift │ │ ├── Unit+UserSelect.swift │ │ ├── Unit+VerticalAlign.swift │ │ ├── Unit+VerticalRelativeDirection.swift │ │ ├── Unit+Visibility.swift │ │ ├── Unit+VisualBox.swift │ │ ├── Unit+WhiteSpace.swift │ │ ├── Unit+WhiteSpaceCollapse.swift │ │ ├── Unit+Width.swift │ │ ├── Unit+WordBreak.swift │ │ ├── Unit+WritingMode.swift │ │ ├── Unit+XYValue.swift │ │ └── Unit+Zoom.swift │ ├── SailorGlobal.swift │ ├── Targets │ └── Website.swift │ ├── ToGenerate │ └── Events │ │ ├── Page+onBlur.swift │ │ ├── Page+onChange.swift │ │ ├── Page+onClick.swift │ │ ├── Page+onDoubleClick.swift │ │ ├── Page+onFocus.swift │ │ ├── Page+onKeyDown.swift │ │ ├── Page+onKeyPress.swift │ │ ├── Page+onKeyUp.swift │ │ ├── Page+onMouseOut.swift │ │ ├── Page+onMouseOver.swift │ │ ├── Page+onScroll.swift │ │ └── Page+onSubmit.swift │ └── Utils │ └── Unit.swift ├── SailorShared └── Sources │ ├── AttributeValues.swift │ ├── Promise.swift │ └── SailorEnvironment.swift └── SailorWeb └── Sources ├── EventScheduler └── WebEventScheduler.swift ├── Events └── EventResult+JSClosure.swift ├── JSNode ├── JSNode+Global.swift ├── JSNode+Renderable.swift ├── JSNode.swift └── StringRenderer.swift ├── JavaScriptKitSupport.swift ├── WebManager ├── SailorWebManager.swift └── WebEnvironment.swift └── toGenerate └── EventResult+ResultMap.swift /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /Playground 5 | /*.xcodeproj 6 | xcuserdata/ 7 | DerivedData/ 8 | .swiftpm/config/registries.json 9 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 10 | .netrc 11 | /Bundle -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "javascriptkit", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/swiftwasm/JavaScriptKit", 7 | "state" : { 8 | "revision" : "da7e39ca5967ba8690f1e88974c3c4984b999699", 9 | "version" : "0.19.1" 10 | } 11 | } 12 | ], 13 | "version" : 2 14 | } 15 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.9 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "Sailor", 6 | platforms: [ 7 | .macOS(.v13) 8 | ], 9 | products: [ 10 | .library( 11 | name: "Sailor", 12 | targets: ["Sailor"] 13 | ) 14 | ], 15 | dependencies: [ 16 | .package(url:"https://github.com/swiftwasm/JavaScriptKit", from: "0.18.0"), 17 | .package(url:"https://github.com/SailorWebFramework/Sailboat", from: "0.3.0"), 18 | // .package(name: "Sailboat", path: "../Sailboat") 19 | ], 20 | targets: [ 21 | .target( 22 | name: "Sailor", 23 | dependencies: [ 24 | "Sailboat", 25 | "SailorShared", 26 | .target(name: "SailorWeb", condition: .when(platforms: [.wasi])) 27 | // more targets here 28 | ] 29 | ), 30 | .target( 31 | name: "SailorShared", 32 | dependencies: [ 33 | "Sailboat" 34 | ] 35 | ), 36 | .target( 37 | name: "SailorWeb", 38 | dependencies: [ 39 | "Sailboat", 40 | "SailorShared", 41 | .product(name: "JavaScriptKit", package: "JavaScriptKit"), 42 | .product(name: "JavaScriptEventLoop", package: "JavaScriptKit") 43 | ] 44 | ), 45 | ] 46 | ) 47 | -------------------------------------------------------------------------------- /Sources/Sailor/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Sailor Web Framework 3 | 4 | A web-framework built with Swift + SwiftWASM 5 | 6 | 7 | ## Sailboat Virtual DOM 8 | 9 | 10 | ## JSNode + JavascriptKit 11 | 12 | 13 | ## Shipwright Generated Code 14 | 15 | 16 | ## Tailwind 17 | 18 | 19 | ## Targets 20 | 21 | 22 | ## Routing 23 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Attributes/Element+Custom.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 2/9/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | #if os(WASI) 11 | import SailorWeb 12 | #else 13 | // 14 | #endif 15 | 16 | public extension Element { 17 | 18 | /// Inline css styles 19 | func style(@StyleBuilder _ value: @escaping () -> any StyleContainer) -> Self { 20 | attribute(.init(name: "style", value: value), override: false) 21 | } 22 | 23 | /// One or more class names defined as a class style. 24 | func classes(@ClassBuilder _ value: @escaping () -> any DynamicClassContainer) -> Self { 25 | attribute(.init(name: "class", value: value), override: false) 26 | } 27 | 28 | /// Unique key used when building for loops 29 | func key(_ value: @autoclosure @escaping () -> any AttributeValue) -> Self { 30 | attribute(.init(name: "_key", value: value), override: true) 31 | } 32 | 33 | // TODO: more custom methods? 34 | // ... 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Attributes/Page+Custom.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/17/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | extension Page { 11 | /// Unique key used when building for loops 12 | func key(_ completion: @escaping () -> any AttributeValue) -> any Element { 13 | traversePage(self) { 14 | $0.key { 15 | completion() 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Builders/BodyBuilder.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// BodyBuilder.swift 3 | //// 4 | //// 5 | //// Created by Joshua Davis on 10/3/23. 6 | //// 7 | // 8 | //import Sailboat 9 | // 10 | //// TODO: make body builder work instead of PageBuilder 11 | //@resultBuilder 12 | //public struct BodyBuilder { 13 | // 14 | // // TODO: should this allowed , should it be stateful? 15 | // public static func buildArray(_ components: [any BodyPage]) -> any Fragment { 16 | // let keys = components.filter("") { $0 + $1 } 17 | // return List(components, hash: String(components.count)) 18 | // } 19 | // 20 | // public static func buildBlock(_ components: any BodyPage...) -> any Fragment { 21 | // return List(components, hash: "") 22 | // } 23 | // 24 | // public static func buildOptional(_ component: (any Fragment)?) -> any Fragment { 25 | // guard let component = component else { 26 | // return List([], hash: "-") 27 | // } 28 | // 29 | // return component 30 | // } 31 | // 32 | // public static func buildEither(first component: any Fragment) -> any Fragment { 33 | // if let component = component as? List { 34 | // // TODO: add then shift? 35 | // return List(component.children, hash: component.hash + "1") 36 | // } 37 | // 38 | // return component 39 | // } 40 | // 41 | // public static func buildEither(second component: any Fragment) -> any Fragment { 42 | // if let component = component as? List { 43 | // return List(component.children, hash: component.hash + "0") 44 | // } 45 | // 46 | // return component 47 | // } 48 | // 49 | //} 50 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Builders/ClassBuilder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ClassBuilder.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/13/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | @resultBuilder 11 | public struct ClassBuilder { 12 | 13 | public static func buildArray(_ components: [any DynamicClass]) -> any DynamicClassContainer { 14 | ClassGroup(components) 15 | } 16 | 17 | public static func buildBlock(_ components: (any DynamicClass)...) -> any DynamicClassContainer { 18 | ClassGroup(components) 19 | 20 | } 21 | 22 | public static func buildOptional(_ component: (any DynamicClassContainer)?) -> any DynamicClassContainer { 23 | return component ?? ClassGroup([]) 24 | } 25 | 26 | public static func buildEither(first component: any DynamicClassContainer) -> any DynamicClassContainer { 27 | return component 28 | } 29 | 30 | public static func buildEither(second component: any DynamicClassContainer) -> any DynamicClassContainer { 31 | return component 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Builders/HeadBuilder.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// HeadBuilder.swift 3 | //// 4 | //// 5 | //// Created by Joshua Davis on 10/3/23. 6 | //// 7 | // 8 | //import Sailboat 9 | // 10 | //@resultBuilder 11 | //public struct HeadBuilder { 12 | // 13 | // // TODO: should this allowed , should it be stateful? 14 | // 15 | // public static func buildArray(_ components: [any HeadPage]) -> any Fragment { 16 | // return List(components, hash: components.count) 17 | // } 18 | // 19 | // public static func buildBlock(_ components: any HeadPage...) -> any Fragment { 20 | // return List(components, hash: 0) 21 | // } 22 | // 23 | // public static func buildOptional(_ component: (any Fragment)?) -> any Fragment { 24 | // guard let component = component else { 25 | // return List([], hash: -1) 26 | // } 27 | // 28 | // return component 29 | // } 30 | // 31 | // public static func buildEither(first component: any Fragment) -> any Fragment { 32 | // if let component = component as? List { 33 | // // TODO: add then shift? 34 | // return List(component.children, hash: (component.hash << 1) + 1) 35 | // } 36 | // 37 | // return component 38 | // } 39 | // 40 | // public static func buildEither(second component: any Fragment) -> any Fragment { 41 | // if let component = component as? List { 42 | // return List(component.children, hash: (component.hash << 1)) 43 | // } 44 | // 45 | // return component 46 | // } 47 | // 48 | //} 49 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Builders/StyleBuilder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StyleBuilder.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/29/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | @resultBuilder 11 | public struct StyleBuilder { 12 | 13 | public static func buildArray(_ components: [any Style]) -> any StyleContainer { 14 | return StyleGroup(components) 15 | } 16 | 17 | public static func buildBlock(_ components: (any Style)...) -> any StyleContainer { 18 | return StyleGroup(components) 19 | } 20 | 21 | public static func buildOptional(_ component: (any StyleContainer)?) -> any StyleContainer { 22 | return component ?? StyleGroup([]) 23 | } 24 | 25 | public static func buildEither(first component: any StyleContainer) -> any StyleContainer { 26 | return component 27 | } 28 | 29 | public static func buildEither(second component: any StyleContainer) -> any StyleContainer { 30 | return component 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Misc/EmptyRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyRenderer.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/12/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | struct EmptyRenderer: Renderable { 11 | var sailboatID: SailboatID? = nil 12 | 13 | func addToParent(_ parent: any Renderable) { } 14 | 15 | func setSailboatID(_ value: SailboatID?) { } 16 | 17 | func insertAfter(_ deepIndex: Int, parent: any Renderable) { } 18 | 19 | func insertBefore(_ deepIndex: Int, parent: any Renderable) { } 20 | 21 | func replace(at: Int, with: any Renderable) { } 22 | 23 | func remove() { } 24 | 25 | func remove(at deepIndex: Int) { } 26 | 27 | func addEvent(name: String, value: @escaping (EventResult) -> Void) { } 28 | 29 | func updateAttribute(name: String, value: any AttributeValue) { } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Misc/HTML.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTML.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/23/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | /// All tags usable in default HTML 11 | public enum HTML { /* TODO: anything in here? */ } 12 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Misc/SailorPageTypes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ElementTypes.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/18/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | /// This element can be placed in the head of the component 11 | protocol HeadElement: Element, HeadPage {} 12 | 13 | /// 14 | public protocol HeadPage: Sailboat.Page {} 15 | 16 | /// 17 | protocol BodyElement: Element, BodyPage {} 18 | 19 | /// This element can be placed in the body 20 | public protocol BodyPage: Sailboat.Page {} 21 | 22 | 23 | // TODO: make this conform to Page not ELement and change Website 24 | /// 25 | public protocol Body: Element { } 26 | 27 | /// 28 | public protocol Head: Element { 29 | var content: () -> any Fragment { get set } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Styling/Classes/DynamicClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicClass.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/13/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | public protocol DynamicClass: AttributeValue, CustomStringConvertible { 11 | associatedtype ClassBody: DynamicClass 12 | // TODO: consider renaming 13 | var classes: ClassBody { get } 14 | } 15 | 16 | public extension DynamicClass { 17 | var description: String { 18 | classes.description 19 | } 20 | 21 | static func == (lhs: Self, rhs: Self) -> Bool { 22 | lhs.description == rhs.description 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Styling/Classes/DynamicClassContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicClassContainer.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/13/24. 6 | // 7 | 8 | import Sailboat 9 | import SailorShared 10 | 11 | public protocol DynamicClassContainer: DynamicClass { 12 | var names: [any DynamicClass] { get set } 13 | 14 | } 15 | 16 | extension DynamicClassContainer { 17 | var description: String { 18 | classes.description 19 | } 20 | 21 | @_spi(Private) 22 | public var classes: some DynamicClass { 23 | fatalError("DynamicClassContainer does not have body") 24 | return "" 25 | } 26 | } 27 | 28 | public struct ClassGroup: DynamicClassContainer { 29 | public var description: String { 30 | names.reduce("") { 31 | if $0 == "" { 32 | return $1.description 33 | } 34 | 35 | return "\($0) \($1.description)" 36 | } 37 | } 38 | 39 | @_spi(Private) public var names: [any DynamicClass] 40 | 41 | internal init(_ classes: [any DynamicClass]) { 42 | self.names = classes 43 | } 44 | 45 | public init(@ClassBuilder _ classContainer: () -> any DynamicClassContainer) { 46 | self.names = classContainer().names 47 | } 48 | 49 | } 50 | 51 | extension String: DynamicClass { 52 | @_spi(Private) 53 | public var classes: some DynamicClass { 54 | fatalError("String Dynamic class does not have body") 55 | return "" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Styling/Style/Property.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Style+Property.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 10/5/23. 6 | // 7 | 8 | import Sailboat 9 | 10 | public struct Property: Style, Hashable { 11 | var name: String 12 | var value: String 13 | 14 | public var description: String { 15 | "\(name): \(value);" 16 | } 17 | 18 | public func hash(into hasher: inout Hasher) { 19 | hasher.combine(description) 20 | } 21 | 22 | public var style: some Style { 23 | fatalError("Property does not contain a body of styles") 24 | return self 25 | } 26 | 27 | internal init(name: String, value: String) { 28 | self.name = name 29 | self.value = value 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Styling/Style/Style.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StylePack.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/9/24. 6 | // 7 | 8 | import Sailboat 9 | import SailorShared 10 | 11 | public protocol Style: AttributeValue, CustomStringConvertible { 12 | associatedtype StyleBody: Style 13 | var style: StyleBody { get } 14 | 15 | } 16 | 17 | public extension Style { 18 | var description: String { 19 | self.style.description 20 | } 21 | 22 | static func == (lhs: Self, rhs: Self) -> Bool { 23 | lhs.description == rhs.description 24 | } 25 | } 26 | 27 | // TODO: consider removing later on, neccisary for total CSS elements right now 28 | extension String: Style { 29 | 30 | public var style: some Style { 31 | fatalError("String Style causing infinite recursion") 32 | return self 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Styling/Style/StyleContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StyleContainer.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 10/3/23. 6 | // 7 | 8 | public protocol StyleContainer: Style, CustomStringConvertible { 9 | var properties: [any Style] { get set } 10 | } 11 | 12 | public extension StyleContainer { 13 | // static func == (lhs: Self, rhs: Self) -> Bool { 14 | // lhs.description == rhs.description 15 | // } 16 | var description: String { 17 | var output = "" 18 | for property in self.properties { 19 | output += property.description 20 | } 21 | 22 | return output 23 | } 24 | 25 | @_spi(Private) 26 | var style: Self { 27 | fatalError("style container has no body") 28 | return self 29 | } 30 | } 31 | 32 | public struct StyleGroup: StyleContainer { 33 | 34 | public var properties: [any Style] 35 | 36 | internal init(_ properties: [any Style]) { 37 | self.properties = properties 38 | } 39 | 40 | public init(@StyleBuilder _ style: () -> any StyleContainer) { 41 | self.properties = style().properties 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Tags/HTMLElements/Select+Init.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/22/24. 6 | // 7 | import Sailboat 8 | 9 | public extension HTML.Select { 10 | 11 | init(_ value: Binding) { 12 | self.init(bodyValue: nil) 13 | 14 | self.attributes[".value"] = { value.wrappedValue.description } 15 | self.events["input:value"] = { eventResult in 16 | guard case let .string(bindedValue) = eventResult else { return } 17 | value.set(bindedValue) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Tags/HTMLElements/TextArea+Init.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/22/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | public extension HTML.Textarea { 11 | 12 | init(_ value: Binding) { 13 | self.init(bodyValue: nil) 14 | 15 | self.attributes[".value"] = { value.wrappedValue.description } 16 | self.events["input:value"] = { eventResult in 17 | guard case let .string(bindedValue) = eventResult else { return } 18 | value.set(bindedValue) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Custom/Tags/String+Element.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/13/24. 6 | // 7 | 8 | import Sailboat 9 | #if os(WASI) 10 | import SailorWeb 11 | #else 12 | // 13 | #endif 14 | 15 | // TODO: get string to work properly 16 | extension String: ValueElement, BodyPage, HeadPage { 17 | 18 | public var value: String { self } 19 | 20 | public var renderer: any Renderable { 21 | get { 22 | #if os(WASI) 23 | StringRenderer(self) 24 | #else 25 | EmptyRenderer() 26 | #endif 27 | } 28 | set(newValue) { } 29 | } 30 | 31 | @_spi(Private) 32 | public var body: Never { 33 | .error() 34 | } 35 | 36 | public var attributes: [String : () -> any AttributeValue] { 37 | get { [:] } 38 | set(newValue) { } 39 | } 40 | 41 | public var events: [String : (EventResult) -> Void] { 42 | get { [:] } 43 | set(newValue) { } 44 | } 45 | 46 | public var content: () -> any Fragment { 47 | get { { List() } } 48 | set(newValue) { } 49 | } 50 | 51 | public var sid: SailboatID? { 52 | get { nil } 53 | set(newValue) { } 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ExportedFunctionality/ExternalSailboatTypes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 12/29/23. 6 | // 7 | 8 | import Sailboat 9 | 10 | //public typealias Page = Sailboat.Page 11 | //public typealias State = Sailboat.State 12 | //public typealias Binding = Sailboat.Binding 13 | // 14 | //public typealias EnvironmentObject = Sailboat.EnvironmentObject 15 | //public typealias StateObject = Sailboat.StateObject 16 | //public typealias ObservedObject = Sailboat.ObservedObject 17 | // 18 | //public typealias ObservableObject = Sailboat.ObservableObject 19 | //public typealias Published = Sailboat.Published 20 | // 21 | //public typealias Environment = Sailboat.Environment 22 | 23 | public typealias Page = Sailboat.Page 24 | public typealias Signal = Sailboat.State 25 | public typealias Binding = Sailboat.Binding 26 | 27 | public typealias GlobalStore = Sailboat.EnvironmentObject 28 | public typealias Store = Sailboat.StateObject 29 | public typealias ObservedStore = Sailboat.ObservedObject 30 | public typealias Environment = Sailboat.Environment 31 | 32 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Tags/HTML+Br.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Br.swift 4 | // 5 | 6 | 7 | import Sailboat 8 | import SailorShared 9 | 10 | #if os(WASI) 11 | import SailorWeb 12 | #else 13 | // if any other target are created 14 | #endif 15 | 16 | extension HTML { 17 | /// The br element represents a line break. 18 | public struct Br: BodyElement { 19 | /// name of the html tag associated with this type 20 | @_spi(Private) public static var name: String { "br" } 21 | 22 | /// attributes associated with this type 23 | @_spi(Private) public var attributes: [String: () -> any AttributeValue] 24 | 25 | /// events associated with this type 26 | @_spi(Private) public var events: [String: (EventResult) -> Void] 27 | 28 | /// content that is contained by this html element 29 | @_spi(Private) public var content: () -> any Fragment 30 | 31 | /// renderer that is used to render this element 32 | @_spi(Private) public var renderer: any Renderable 33 | 34 | @_spi(Private) 35 | public var body: Never { 36 | .error() 37 | } 38 | 39 | internal init(bodyValue: (() -> any Fragment)?) { 40 | self.attributes = [:] 41 | self.events = [:] 42 | self.content = bodyValue ?? { List() } 43 | #if os(WASI) 44 | self.renderer = JSNode(named: Self.name) 45 | #else 46 | self.renderer = EmptyRenderer() 47 | #endif 48 | } 49 | 50 | public init() { 51 | self.init(bodyValue: nil) 52 | } 53 | 54 | 55 | } 56 | } 57 | // MARK: - Attributes 58 | public extension HTML.Br { 59 | } -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Tags/HTML+Hr.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Hr.swift 4 | // 5 | 6 | 7 | import Sailboat 8 | import SailorShared 9 | 10 | #if os(WASI) 11 | import SailorWeb 12 | #else 13 | // if any other target are created 14 | #endif 15 | 16 | extension HTML { 17 | /// The hr element represents a thematic break between paragraph-level elements. 18 | public struct Hr: BodyElement { 19 | /// name of the html tag associated with this type 20 | @_spi(Private) public static var name: String { "hr" } 21 | 22 | /// attributes associated with this type 23 | @_spi(Private) public var attributes: [String: () -> any AttributeValue] 24 | 25 | /// events associated with this type 26 | @_spi(Private) public var events: [String: (EventResult) -> Void] 27 | 28 | /// content that is contained by this html element 29 | @_spi(Private) public var content: () -> any Fragment 30 | 31 | /// renderer that is used to render this element 32 | @_spi(Private) public var renderer: any Renderable 33 | 34 | @_spi(Private) 35 | public var body: Never { 36 | .error() 37 | } 38 | 39 | internal init(bodyValue: (() -> any Fragment)?) { 40 | self.attributes = [:] 41 | self.events = [:] 42 | self.content = bodyValue ?? { List() } 43 | #if os(WASI) 44 | self.renderer = JSNode(named: Self.name) 45 | #else 46 | self.renderer = EmptyRenderer() 47 | #endif 48 | } 49 | 50 | public init() { 51 | self.init(bodyValue: nil) 52 | } 53 | 54 | 55 | } 56 | } 57 | // MARK: - Attributes 58 | public extension HTML.Hr { 59 | } -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Tags/HTML+Wbr.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Wbr.swift 4 | // 5 | 6 | 7 | import Sailboat 8 | import SailorShared 9 | 10 | #if os(WASI) 11 | import SailorWeb 12 | #else 13 | // if any other target are created 14 | #endif 15 | 16 | extension HTML { 17 | /// The wbr element represents a word break opportunity. 18 | public struct Wbr: BodyElement { 19 | /// name of the html tag associated with this type 20 | @_spi(Private) public static var name: String { "wbr" } 21 | 22 | /// attributes associated with this type 23 | @_spi(Private) public var attributes: [String: () -> any AttributeValue] 24 | 25 | /// events associated with this type 26 | @_spi(Private) public var events: [String: (EventResult) -> Void] 27 | 28 | /// content that is contained by this html element 29 | @_spi(Private) public var content: () -> any Fragment 30 | 31 | /// renderer that is used to render this element 32 | @_spi(Private) public var renderer: any Renderable 33 | 34 | @_spi(Private) 35 | public var body: Never { 36 | .error() 37 | } 38 | 39 | internal init(bodyValue: (() -> any Fragment)?) { 40 | self.attributes = [:] 41 | self.events = [:] 42 | self.content = bodyValue ?? { List() } 43 | #if os(WASI) 44 | self.renderer = JSNode(named: Self.name) 45 | #else 46 | self.renderer = EmptyRenderer() 47 | #endif 48 | } 49 | 50 | public init() { 51 | self.init(bodyValue: nil) 52 | } 53 | 54 | 55 | } 56 | } 57 | // MARK: - Attributes 58 | public extension HTML.Wbr { 59 | } -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AlignContent.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AlignContent.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AlignContent: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Aligns the content in the center. 19 | public static var `center`: Self { 20 | return .init("center") 21 | } 22 | 23 | ///Aligns the content at the end. 24 | public static var `flexEnd`: Self { 25 | return .init("flex-end") 26 | } 27 | 28 | ///Aligns the content at the start. 29 | public static var `flexStart`: Self { 30 | return .init("flex-start") 31 | } 32 | 33 | ///Distributes the content evenly with space around. 34 | public static var `spaceAround`: Self { 35 | return .init("space-around") 36 | } 37 | 38 | ///Distributes the content evenly with space between. 39 | public static var `spaceBetween`: Self { 40 | return .init("space-between") 41 | } 42 | 43 | ///Stretches the content to fill the container. 44 | public static var `stretch`: Self { 45 | return .init("stretch") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AlignItems.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AlignItems.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AlignItems: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Aligns the items to the baseline. 19 | public static var `baseline`: Self { 20 | return .init("baseline") 21 | } 22 | 23 | ///Aligns the items in the center. 24 | public static var `center`: Self { 25 | return .init("center") 26 | } 27 | 28 | ///Aligns the items at the end. 29 | public static var `flexEnd`: Self { 30 | return .init("flex-end") 31 | } 32 | 33 | ///Aligns the items at the start. 34 | public static var `flexStart`: Self { 35 | return .init("flex-start") 36 | } 37 | 38 | ///Stretches the items to fill the container. 39 | public static var `stretch`: Self { 40 | return .init("stretch") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AlignSelf.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AlignSelf.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AlignSelf: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The default value. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///Aligns the item to the baseline. 24 | public static var `baseline`: Self { 25 | return .init("baseline") 26 | } 27 | 28 | ///Aligns the item in the center. 29 | public static var `center`: Self { 30 | return .init("center") 31 | } 32 | 33 | ///Aligns the item at the end. 34 | public static var `flexEnd`: Self { 35 | return .init("flex-end") 36 | } 37 | 38 | ///Aligns the item at the start. 39 | public static var `flexStart`: Self { 40 | return .init("flex-start") 41 | } 42 | 43 | ///Stretches the item to fill the container. 44 | public static var `stretch`: Self { 45 | return .init("stretch") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AllOrNone.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AllOrNone.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AllOrNone: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///All elements are affected. 19 | public static var `all`: Self { 20 | return .init("all") 21 | } 22 | 23 | ///No elements are affected. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Angle.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Angle.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Angle: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Defines an angle in degrees. 19 | public static func `deg`(_ value: Int) -> Self { 20 | return .init("\(value)deg") 21 | } 22 | 23 | ///Defines an angle in gradians. 24 | public static func `grad`(_ value: Int) -> Self { 25 | return .init("\(value)grad") 26 | } 27 | 28 | ///Defines an angle in radians. 29 | public static func `rad`(_ value: Int) -> Self { 30 | return .init("\(value)rad") 31 | } 32 | 33 | ///Defines an angle in turns. 34 | public static func `turn`(_ value: Int) -> Self { 35 | return .init("\(value)turn") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AreaShape.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AreaShape.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AreaShape: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The shape is rectangle. 19 | public static var `rect`: Self { 20 | return .init("rect") 21 | } 22 | 23 | ///The shape is circle. 24 | public static var `circle`: Self { 25 | return .init("circle") 26 | } 27 | 28 | ///The shape is ellipse. 29 | public static var `ellipse`: Self { 30 | return .init("ellipse") 31 | } 32 | 33 | ///The shape is polygon. 34 | public static var `polygon`: Self { 35 | return .init("polygon") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AspectRatio.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AspectRatio.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AspectRatio: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Defines the aspect ratio. 19 | public static func `ratio`(_ width: Int, _ height: Int) -> Self { 20 | return .init("\(width) / \(height)") 21 | } 22 | 23 | ///The default value. 24 | public static var `auto`: Self { 25 | return .init("auto") 26 | } 27 | 28 | ///Defines the aspect ratio using a float. 29 | public static func `float`(_ value: Double) -> Self { 30 | return .init("\(value)") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Attachment.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Attachment.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Attachment: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The background is fixed. 19 | public static var `fixed`: Self { 20 | return .init("fixed") 21 | } 22 | 23 | ///The background is local. 24 | public static var `local`: Self { 25 | return .init("local") 26 | } 27 | 28 | ///The background scrolls with the content. 29 | public static var `scroll`: Self { 30 | return .init("scroll") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Auto.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Auto.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Auto: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the value. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AutoBool.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AutoBool.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AutoBool: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///true value for auto-bool. 19 | public static var `true`: Self { 20 | return .init("true") 21 | } 22 | 23 | ///false value for auto-bool. 24 | public static var `false`: Self { 25 | return .init("false") 26 | } 27 | 28 | ///default behavior of this element on this browser. 29 | public static var `auto`: Self { 30 | return .init("auto") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AutoColor.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AutoColor.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AutoColor: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the color. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The color of the element. 24 | public static func `color`(_ color: Unit.Color) -> Self { 25 | return .init("color(\(color))") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+AutoInt.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+AutoInt.swift 4 | // 5 | 6 | extension Unit { 7 | public struct AutoInt: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the integer. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///A raw integer. 24 | public static func `int`(_ int: Int) -> Self { 25 | return .init("{{number}}%") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Axis.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Axis.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Axis: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The axis is x. 19 | public static var `x`: Self { 20 | return .init("x") 21 | } 22 | 23 | ///The axis is y. 24 | public static var `y`: Self { 25 | return .init("y") 26 | } 27 | 28 | ///The axis is z. 29 | public static var `z`: Self { 30 | return .init("z") 31 | } 32 | 33 | ///The axis. 34 | public static func `vector`(_ x: Double, _ y: Double, _ z: Double) -> Self { 35 | return .init("\(x) \(y) \(z)") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BackfaceVisibility.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BackfaceVisibility.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BackfaceVisibility: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is hidden. 19 | public static var `hidden`: Self { 20 | return .init("hidden") 21 | } 22 | 23 | ///The element is visible. 24 | public static var `visible`: Self { 25 | return .init("visible") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BackgroundImage.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BackgroundImage.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BackgroundImage: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A URL image. 19 | public static func `image`(_ image: Unit.Image) -> Self { 20 | return .init("\(image)") 21 | } 22 | 23 | ///A source image. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BackgroundSize.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BackgroundSize.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BackgroundSize: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the size. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The image covers the element. 24 | public static var `cover`: Self { 25 | return .init("cover") 26 | } 27 | 28 | ///The image is contained in the element. 29 | public static var `contain`: Self { 30 | return .init("contain") 31 | } 32 | 33 | ///both directions specified 34 | public static func `size`(_ widthAndHeight: Unit.AutoLengthPercentage) -> Self { 35 | return .init("{{both}}") 36 | } 37 | 38 | ///both directions specified 39 | public static func `size`(_ width: Unit.AutoLengthPercentage, _ height: Unit.AutoLengthPercentage) -> Self { 40 | return .init("\(width) \(height)") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BgSize.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BgSize.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BgSize: Equatable { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the size. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The image covers the element. 24 | public static var `cover`: Self { 25 | return .init("cover") 26 | } 27 | 28 | ///The image is contained in the element. 29 | public static var `contain`: Self { 30 | return .init("contain") 31 | } 32 | 33 | ///both directions specified 34 | public static func `size`(_ widthAndHeight: Unit.AutoLengthPercentage) -> Self { 35 | return .init("{{both}}") 36 | } 37 | 38 | ///both directions specified 39 | public static func `size`(_ width: Unit.AutoLengthPercentage, _ height: Unit.AutoLengthPercentage) -> Self { 40 | return .init("\(width.description) \(height.description)") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BorderCollapse.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BorderCollapse.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BorderCollapse: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The borders are collapsed. 19 | public static var `collapse`: Self { 20 | return .init("collapse") 21 | } 22 | 23 | ///The borders are separate. 24 | public static var `separate`: Self { 25 | return .init("separate") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BorderLineWidth.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BorderLineWidth.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BorderLineWidth: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The border width for all four sides. 19 | public static func `with`(allSides: Unit.LineWidth) -> Self { 20 | return .init("\(allSides)") 21 | } 22 | 23 | ///The border width for the top, right, bottom, and left sides. 24 | public static func `with`(vertical: Unit.LineWidth, horizontal: Unit.LineWidth) -> Self { 25 | return .init("\(vertical) \(horizontal)") 26 | } 27 | 28 | ///The border width for the top, right, bottom, and left sides. 29 | public static func `with`(top: Unit.LineWidth, horizontal: Unit.LineWidth, bottom: Unit.LineWidth) -> Self { 30 | return .init("\(top) \(horizontal) \(bottom)") 31 | } 32 | 33 | ///The border width for the top, right, bottom, and left sides. 34 | public static func `with`(top: Unit.LineWidth, right: Unit.LineWidth, bottom: Unit.LineWidth, left: Unit.LineWidth) -> Self { 35 | return .init("\(top) \(right) \(bottom) \(left)") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BorderRadius.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BorderRadius.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BorderRadius: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The radius of the border. 19 | public static func `all`(_ all: Unit.LengthPercentage) -> Self { 20 | return .init("\(all)") 21 | } 22 | 23 | ///The radius of the border. 24 | public static func `each`(_ topLeft: Unit.LengthPercentage, _ topRight: Unit.LengthPercentage, _ bottomRight: Unit.LengthPercentage, _ bottomLeft: Unit.LengthPercentage) -> Self { 25 | return .init("\(topLeft) \(topRight) \(bottomRight) \(bottomLeft)") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BorderWidth.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BorderWidth.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BorderWidth: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The border width for all four sides. 19 | public static func `with`(allSides: Unit.AutoLengthPercentage) -> Self { 20 | return .init("\(allSides)") 21 | } 22 | 23 | ///The border width for the top, right, bottom, and left sides. 24 | public static func `with`(vertical: Unit.AutoLengthPercentage, horizontal: Unit.AutoLengthPercentage) -> Self { 25 | return .init("\(vertical) \(horizontal)") 26 | } 27 | 28 | ///The border width for the top, right, bottom, and left sides. 29 | public static func `with`(top: Unit.AutoLengthPercentage, horizontal: Unit.AutoLengthPercentage, bottom: Unit.AutoLengthPercentage) -> Self { 30 | return .init("\(top) \(horizontal) \(bottom)") 31 | } 32 | 33 | ///The border width for the top, right, bottom, and left sides. 34 | public static func `with`(top: Unit.AutoLengthPercentage, right: Unit.AutoLengthPercentage, bottom: Unit.AutoLengthPercentage, left: Unit.AutoLengthPercentage) -> Self { 35 | return .init("\(top) \(right) \(bottom) \(left)") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BoxShadow.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BoxShadow.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BoxShadow: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Defines the shadow effect around an element's frame. 19 | public static func `with`(_ color: Unit.Color, _ offsetX: Unit.Length, _ offsetY: Unit.Length, _ blur: Unit.Length, _ spread: Unit.Length, _ position: Unit.BoxShadowPosition? = nil) -> Self { 20 | return .init("\(color) \(offsetX) \(offsetY) \(blur) \(spread) \(Utils.unwrapUnit(position))") 21 | } 22 | 23 | ///Defines the shadow effect around an element's frame. 24 | public static func `with`(_ color: Unit.Color, _ offsetX: Unit.Length, _ offsetY: Unit.Length, _ position: Unit.BoxShadowPosition? = nil) -> Self { 25 | return .init("\(color) \(offsetX) \(offsetY) \(Utils.unwrapUnit(position))") 26 | } 27 | 28 | ///Defines the shadow effect around an element's frame. 29 | public static func `with`(_ color: Unit.Color, _ offsetX: Unit.Length, _ offsetY: Unit.Length, _ blur: Unit.Length, _ position: Unit.BoxShadowPosition? = nil) -> Self { 30 | return .init("\(color) \(offsetX) \(offsetY) \(blur) \(Utils.unwrapUnit(position))") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BoxShadowPosition.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BoxShadowPosition.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BoxShadowPosition: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The shadow is inset. 19 | public static var `inset`: Self { 20 | return .init("inset") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BoxSizing.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BoxSizing.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BoxSizing: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The box sizing is content box. 19 | public static var `contentBox`: Self { 20 | return .init("content-box") 21 | } 22 | 23 | ///The box sizing is border box. 24 | public static var `borderBox`: Self { 25 | return .init("border-box") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+BreakInside.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+BreakInside.swift 4 | // 5 | 6 | extension Unit { 7 | public struct BreakInside: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the break behavior. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The break is avoided. 24 | public static var `avoid`: Self { 25 | return .init("avoid") 26 | } 27 | 28 | ///The break is avoided on a page. 29 | public static var `avoidPage`: Self { 30 | return .init("avoid-page") 31 | } 32 | 33 | ///The break is avoided on a column. 34 | public static var `avoidColumn`: Self { 35 | return .init("avoid-column") 36 | } 37 | 38 | ///The break is avoided on a region. 39 | public static var `avoidRegion`: Self { 40 | return .init("avoid-region") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ButtonType.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ButtonType.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ButtonType: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A clickable button. 19 | public static var `button`: Self { 20 | return .init("button") 21 | } 22 | 23 | ///A reset button. 24 | public static var `reset`: Self { 25 | return .init("reset") 26 | } 27 | 28 | ///A submit button. 29 | public static var `submit`: Self { 30 | return .init("submit") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CaptionSide.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CaptionSide.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CaptionSide: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The caption is on top. 19 | public static var `top`: Self { 20 | return .init("top") 21 | } 22 | 23 | ///The caption is on bottom. 24 | public static var `bottom`: Self { 25 | return .init("bottom") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ColorInterpolation.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ColorInterpolation.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ColorInterpolation: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the color interpolation. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The color interpolation is sRGB. 24 | public static var `sRGB`: Self { 25 | return .init("sRGB") 26 | } 27 | 28 | ///The color interpolation is linear RGB. 29 | public static var `linearRGB`: Self { 30 | return .init("linearRGB") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ColorScheme.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ColorScheme.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ColorScheme: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The color scheme is light. 19 | public static var `light`: Self { 20 | return .init("light") 21 | } 22 | 23 | ///The color scheme is dark. 24 | public static var `dark`: Self { 25 | return .init("dark") 26 | } 27 | 28 | ///The color scheme is normal. 29 | public static var `normal`: Self { 30 | return .init("normal") 31 | } 32 | 33 | ///The color scheme is only. 34 | public static var `only`: Self { 35 | return .init("only") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ColumnFill.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ColumnFill.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ColumnFill: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the column fill. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The column fill is balanced. 24 | public static var `balance`: Self { 25 | return .init("balance") 26 | } 27 | 28 | ///The column fill is balanced all. 29 | public static var `balanceAll`: Self { 30 | return .init("balance-all") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CombineUpright.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CombineUpright.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CombineUpright: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is combined upright. 19 | public static var `all`: Self { 20 | return .init("all") 21 | } 22 | 23 | ///The text is not combined. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CompatSpecial.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CompatSpecial.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CompatSpecial: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not special. 19 | public static var `textfield`: Self { 20 | return .init("textfield") 21 | } 22 | 23 | ///The element is a button. 24 | public static var `menulistButton`: Self { 25 | return .init("menulist-button") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Contain.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Contain.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Contain: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not contained. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The element is strictly contained. 24 | public static var `strict`: Self { 25 | return .init("strict") 26 | } 27 | 28 | ///The element is contained in content. 29 | public static var `content`: Self { 30 | return .init("content") 31 | } 32 | 33 | ///The element is contained in size. 34 | public static var `size`: Self { 35 | return .init("size") 36 | } 37 | 38 | ///The element is contained in layout. 39 | public static var `layout`: Self { 40 | return .init("layout") 41 | } 42 | 43 | ///The element is contained in style. 44 | public static var `style`: Self { 45 | return .init("style") 46 | } 47 | 48 | ///The element is contained in paint. 49 | public static var `paint`: Self { 50 | return .init("paint") 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ContainerName.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ContainerName.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ContainerName: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The container is name. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The container is custom name. 24 | public static func `string`(_ value: String) -> Self { 25 | return .init("\(value)") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ContainerType.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ContainerType.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ContainerType: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The container is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The container is sized. 24 | public static var `size`: Self { 25 | return .init("size") 26 | } 27 | 28 | ///The container is inline size. 29 | public static var `inlineSize`: Self { 30 | return .init("inline-size") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ContentPosition.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ContentPosition.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ContentPosition: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The content is centered. 19 | public static var `center`: Self { 20 | return .init("center") 21 | } 22 | 23 | ///The content is at the start. 24 | public static var `start`: Self { 25 | return .init("start") 26 | } 27 | 28 | ///The content is at the end. 29 | public static var `end`: Self { 30 | return .init("end") 31 | } 32 | 33 | ///The content is at the start. 34 | public static var `flexStart`: Self { 35 | return .init("flex-start") 36 | } 37 | 38 | ///The content is at the end. 39 | public static var `flexEnd`: Self { 40 | return .init("flex-end") 41 | } 42 | 43 | ///The content is at the left. 44 | public static var `left`: Self { 45 | return .init("left") 46 | } 47 | 48 | ///The content is at the right. 49 | public static var `right`: Self { 50 | return .init("right") 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ContentSafety.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ContentSafety.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ContentSafety: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The content is safe. 19 | public static var `safe`: Self { 20 | return .init("safe") 21 | } 22 | 23 | ///The content is unsafe. 24 | public static var `unsafe`: Self { 25 | return .init("unsafe") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CounterIncrement.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CounterIncrement.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CounterIncrement: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The counter set is a name. 19 | public static func `with`(_ identifier: String, by: Int? = nil) -> Self { 20 | return .init("\(identifier) \(Utils.unwrapUnit(by))") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CounterReset.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CounterReset.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CounterReset: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The counter reset is a name. 19 | public static func `with`(_ identifier: String, to: Int? = nil) -> Self { 20 | return .init("\(identifier) \(Utils.unwrapUnit(to))") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CounterSet.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CounterSet.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CounterSet: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The counter set is a name. 19 | public static func `with`(_ identifier: String, to: Int) -> Self { 20 | return .init("\(identifier) \(to)") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+CrossOrigin.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+CrossOrigin.swift 4 | // 5 | 6 | extension Unit { 7 | public struct CrossOrigin: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The request does not include credentials. 19 | public static var `anonymous`: Self { 20 | return .init("anonymous") 21 | } 22 | 23 | ///The request includes credentials. 24 | public static var `useCredentials`: Self { 25 | return .init("use-credentials") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Direction.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Direction.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Direction: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The default value. Defines left to right text rendering. 19 | public static var `ltr`: Self { 20 | return .init("ltr") 21 | } 22 | 23 | ///Defines right to left text rendering. 24 | public static var `rtl`: Self { 25 | return .init("rtl") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+DirectionBreak.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+DirectionBreak.swift 4 | // 5 | 6 | extension Unit { 7 | public struct DirectionBreak: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The break is sliced. 19 | public static var `slice`: Self { 20 | return .init("slice") 21 | } 22 | 23 | ///The break is cloned. 24 | public static var `clone`: Self { 25 | return .init("clone") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+EachLine.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+EachLine.swift 4 | // 5 | 6 | extension Unit { 7 | public struct EachLine: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text combination. 19 | public static var `eachLine`: Self { 20 | return .init("each-line") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+EnterKeyHint.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+EnterKeyHint.swift 4 | // 5 | 6 | extension Unit { 7 | public struct EnterKeyHint: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The user is done with this text field. 19 | public static var `done`: Self { 20 | return .init("done") 21 | } 22 | 23 | ///The user is done with this text field. 24 | public static var `enter`: Self { 25 | return .init("enter") 26 | } 27 | 28 | ///The user is done with this text field. 29 | public static var `go`: Self { 30 | return .init("go") 31 | } 32 | 33 | ///The user is done with this text field. 34 | public static var `next`: Self { 35 | return .init("next") 36 | } 37 | 38 | ///The user is done with this text field. 39 | public static var `previous`: Self { 40 | return .init("previous") 41 | } 42 | 43 | ///The user is done with this text field. 44 | public static var `search`: Self { 45 | return .init("search") 46 | } 47 | 48 | ///The user is done with this text field. 49 | public static var `send`: Self { 50 | return .init("send") 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FirstOrLast.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FirstOrLast.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FirstOrLast: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The first line. 19 | public static var `first`: Self { 20 | return .init("first") 21 | } 22 | 23 | ///The last line. 24 | public static var `last`: Self { 25 | return .init("last") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FlexBasis.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FlexBasis.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FlexBasis: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The flex basis is the content width. 19 | public static var `content`: Self { 20 | return .init("content") 21 | } 22 | 23 | ///The browser decides the column width. 24 | public static var `auto`: Self { 25 | return .init("auto") 26 | } 27 | 28 | ///The column width is the minimum content width. 29 | public static var `minContent`: Self { 30 | return .init("min-content") 31 | } 32 | 33 | ///The column width is the maximum content width. 34 | public static var `maxContent`: Self { 35 | return .init("max-content") 36 | } 37 | 38 | ///The column width is the fit content width. 39 | public static func `fitContent`(_ lengthPercentage: Unit.LengthPercentage) -> Self { 40 | return .init("fit-content(\(lengthPercentage))") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FlexDirection.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FlexDirection.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FlexDirection: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The flex direction is row. 19 | public static var `row`: Self { 20 | return .init("row") 21 | } 22 | 23 | ///The flex direction is row reverse. 24 | public static var `rowReverse`: Self { 25 | return .init("row-reverse") 26 | } 27 | 28 | ///The flex direction is column. 29 | public static var `column`: Self { 30 | return .init("column") 31 | } 32 | 33 | ///The flex direction is column reverse. 34 | public static var `columnReverse`: Self { 35 | return .init("column-reverse") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FlexWrap.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FlexWrap.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FlexWrap: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The flex wrap is no wrap. 19 | public static var `nowrap`: Self { 20 | return .init("nowrap") 21 | } 22 | 23 | ///The flex wrap is wrap. 24 | public static var `wrap`: Self { 25 | return .init("wrap") 26 | } 27 | 28 | ///The flex wrap is wrap reverse. 29 | public static var `wrapReverse`: Self { 30 | return .init("wrap-reverse") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FontFamily.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FontFamily.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FontFamily: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is named. 19 | public static func `named`(_ name: String) -> Self { 20 | return .init("\(name)") 21 | } 22 | 23 | ///The element is named. 24 | public static func `customIdent`(_ ident: String) -> Self { 25 | return .init("\(ident)") 26 | } 27 | 28 | ///The element is named. 29 | public static func `generic`(_ name: String) -> Self { 30 | return .init("generic(\(name))") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ForcedColorAdjust.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ForcedColorAdjust.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ForcedColorAdjust: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the color adjustment. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The color adjustment is none. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | ///The parent color. 29 | public static var `preserveParentColor`: Self { 30 | return .init("preserve-parent-color") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FormEncType.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FormEncType.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FormEncType: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The form data is URL encoded. 19 | public static var `applicationXWwwFormUrlencoded`: Self { 20 | return .init("application/x-www-form-urlencoded") 21 | } 22 | 23 | ///The form data is sent as a multipart form. 24 | public static var `multipartFormData`: Self { 25 | return .init("multipart/form-data") 26 | } 27 | 28 | ///The form data is sent as plain text. 29 | public static var `textPlain`: Self { 30 | return .init("text/plain") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+FormMethod.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+FormMethod.swift 4 | // 5 | 6 | extension Unit { 7 | public struct FormMethod: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The form data is appended to the URL. 19 | public static var `get`: Self { 20 | return .init("get") 21 | } 22 | 23 | ///The form data is sent to the server. 24 | public static var `post`: Self { 25 | return .init("post") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+GeometryBox.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+GeometryBox.swift 4 | // 5 | 6 | extension Unit { 7 | public struct GeometryBox: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The geometry box is the fill box. 19 | public static var `fillBox`: Self { 20 | return .init("fill-box") 21 | } 22 | 23 | ///The geometry box is the stroke box. 24 | public static var `strokeBox`: Self { 25 | return .init("stroke-box") 26 | } 27 | 28 | ///The geometry box is the view box. 29 | public static var `viewBox`: Self { 30 | return .init("view-box") 31 | } 32 | 33 | ///The geometry box is the content box. 34 | public static var `contentBox`: Self { 35 | return .init("content-box") 36 | } 37 | 38 | ///The geometry box is the padding box. 39 | public static var `paddingBox`: Self { 40 | return .init("padding-box") 41 | } 42 | 43 | ///The geometry box is the border box. 44 | public static var `borderBox`: Self { 45 | return .init("border-box") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Global.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Global.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Global: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Specifies that all the element's properties should be changed to their initial values. 19 | public static var `initial`: Self { 20 | return .init("initial") 21 | } 22 | 23 | ///Specifies that all the element's properties should be changed to their inherited values. 24 | public static var `inherit`: Self { 25 | return .init("inherit") 26 | } 27 | 28 | ///Reverts the filter to the parent. 29 | public static var `revert`: Self { 30 | return .init("revert") 31 | } 32 | 33 | ///Specifies that all the element's properties should roll back the cascade to a previous cascade layer, if one exists. If no other cascade layer exists, the element's properties will roll back to the matching rule, if one exists, in the current layer or to a previous style origin. 34 | public static var `revertLayer`: Self { 35 | return .init("revert-layer") 36 | } 37 | 38 | ///Specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not. 39 | public static var `unset`: Self { 40 | return .init("unset") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Gradient.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Gradient.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Gradient: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A linear gradient. 19 | public static func `linear`(_ angle: Unit.Angle) -> Self { 20 | return .init("linear-gradient(\(angle))") 21 | } 22 | 23 | ///A radial gradient. 24 | public static func `radial`(_ shape: Unit.Length, _ size: Unit.Length, _ position: Unit.Length, _ shape2: Unit.Length, _ size2: Unit.Length, _ position2: Unit.Length) -> Self { 25 | return .init("radial-gradient(\(shape) \(size) at \(position), \(shape2) \(size2) at \(position2))") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+GridLine.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+GridLine.swift 4 | // 5 | 6 | extension Unit { 7 | public struct GridLine: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the grid line. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The grid line is custom. 24 | public static func `custom`(_ customIdent: String) -> Self { 25 | return .init("\(customIdent)") 26 | } 27 | 28 | ///The grid line is an integer. 29 | public static func `custom`(_ value: Int, _ customIdent: String) -> Self { 30 | return .init("\(value) \(customIdent)") 31 | } 32 | 33 | ///The grid line spans. 34 | public static func `span`(_ customIdent: String) -> Self { 35 | return .init("span \(customIdent)") 36 | } 37 | 38 | ///The grid line spans. 39 | public static func `span`(_ value: Int) -> Self { 40 | return .init("span \(value)") 41 | } 42 | 43 | ///A raw integer. 44 | public static func `int`(_ int: Int) -> Self { 45 | return .init("{{number}}%") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Hanging.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Hanging.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Hanging: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text combination. 19 | public static var `hanging`: Self { 20 | return .init("hanging") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+HangingPunctuation.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+HangingPunctuation.swift 4 | // 5 | 6 | extension Unit { 7 | public struct HangingPunctuation: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The first line has hanging punctuation. 19 | public static var `first`: Self { 20 | return .init("first") 21 | } 22 | 23 | ///The last line has hanging punctuation. 24 | public static var `last`: Self { 25 | return .init("last") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+HangingPunctuationForced.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+HangingPunctuationForced.swift 4 | // 5 | 6 | extension Unit { 7 | public struct HangingPunctuationForced: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The last line has hanging punctuation. 19 | public static var `forceEnd`: Self { 20 | return .init("force-end") 21 | } 22 | 23 | ///The last line has hanging punctuation. 24 | public static var `allowEnd`: Self { 25 | return .init("allow-end") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+HorrizontalRelativeDirection.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+HorrizontalRelativeDirection.swift 4 | // 5 | 6 | extension Unit { 7 | public struct HorrizontalRelativeDirection: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is positioned to the left. 19 | public static var `left`: Self { 20 | return .init("left") 21 | } 22 | 23 | ///The element is positioned to the right. 24 | public static var `center`: Self { 25 | return .init("center") 26 | } 27 | 28 | ///The element is positioned to the right. 29 | public static var `right`: Self { 30 | return .init("right") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+HyphenateCharacter.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+HyphenateCharacter.swift 4 | // 5 | 6 | extension Unit { 7 | public struct HyphenateCharacter: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The hyphenate character is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The hyphenate character is a string. 24 | public static func `string`(_ string: String) -> Self { 25 | return .init("\(string)") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+HyphenateLimitChars.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+HyphenateLimitChars.swift 4 | // 5 | 6 | extension Unit { 7 | public struct HyphenateLimitChars: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The hyphenate limit chars is a length. 19 | public static func `by`(x: Unit.AutoInt, y: Unit.AutoInt? = nil, z: Unit.AutoInt? = nil) -> Self { 20 | return .init("\(x) \(Utils.unwrapUnit(y)) \(Utils.unwrapUnit(z))") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Hyphens.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Hyphens.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Hyphens: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The hyphens are none. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The hyphens are manual. 24 | public static var `manual`: Self { 25 | return .init("manual") 26 | } 27 | 28 | ///The hyphens are auto. 29 | public static var `auto`: Self { 30 | return .init("auto") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Image.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Image.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Image: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A URL image. 19 | public static func `url`(_ url: String) -> Self { 20 | return .init("url(\(url))") 21 | } 22 | 23 | ///A source image. 24 | public static func `src`(_ src: String) -> Self { 25 | return .init("src(\(src))") 26 | } 27 | 28 | ///A gradient image. 29 | public static func `gradient`(_ gradient: Unit.Gradient) -> Self { 30 | return .init("\(gradient)") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ImageOrientation.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ImageOrientation.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ImageOrientation: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image orientation is from image. 19 | public static var `fromImage`: Self { 20 | return .init("from-image") 21 | } 22 | 23 | ///The image orientation is flip. 24 | public static var `flip`: Self { 25 | return .init("flip") 26 | } 27 | 28 | ///The image orientation is none. 29 | public static var `none`: Self { 30 | return .init("none") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ImageRendering.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ImageRendering.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ImageRendering: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image rendering is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The image rendering is crisp edges. 24 | public static var `crispEdges`: Self { 25 | return .init("crisp-edges") 26 | } 27 | 28 | ///The image rendering is pixelated. 29 | public static var `pixelated`: Self { 30 | return .init("pixelated") 31 | } 32 | 33 | ///The image rendering is high quality. 34 | public static var `highQuality`: Self { 35 | return .init("high-quality") 36 | } 37 | 38 | ///The image rendering is smooth. 39 | public static var `smooth`: Self { 40 | return .init("smooth") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ImageSource.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ImageSource.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ImageSource: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A URL image source. 19 | public static func `url`(_ url: String) -> Self { 20 | return .init("url(\(url))") 21 | } 22 | 23 | ///A source image. 24 | public static func `src`(_ src: String) -> Self { 25 | return .init("src(\(src))") 26 | } 27 | 28 | ///A linear gradient. 29 | public static func `linear`(_ angle: Unit.Angle) -> Self { 30 | return .init("linear-gradient(\(angle))") 31 | } 32 | 33 | ///A radial gradient. 34 | public static func `radial`(_ shape: Unit.Length, _ size: Unit.Length, _ position: Unit.Length, _ shape2: Unit.Length, _ size2: Unit.Length, _ position2: Unit.Length) -> Self { 35 | return .init("radial-gradient(\(shape) \(size) at \(position), \(shape2) \(size2) at \(position2))") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Indent.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Indent.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Indent: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not indented. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The indentation of the element. 24 | public static func `with`(_ length: Unit.LengthPercentage, hanging: Bool? = nil, eachLine: Bool? = nil) -> Self { 25 | return .init("\(length) \(Utils.when(hanging, ret: "hanging")) \(Utils.when(eachLine, ret: "each-line"))") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+InnerRepeat.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+InnerRepeat.swift 4 | // 5 | 6 | extension Unit { 7 | public struct InnerRepeat: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image is repeated. 19 | public static var `repeat`: Self { 20 | return .init("repeat") 21 | } 22 | 23 | ///The image is not repeated. 24 | public static var `noRepeat`: Self { 25 | return .init("no-repeat") 26 | } 27 | 28 | ///The image is repeated with space. 29 | public static var `space`: Self { 30 | return .init("space") 31 | } 32 | 33 | ///The image is repeated with rounding. 34 | public static var `round`: Self { 35 | return .init("round") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+InputMode.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+InputMode.swift 4 | // 5 | 6 | extension Unit { 7 | public struct InputMode: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A numeric value with a decimal point. 19 | public static var `decimal`: Self { 20 | return .init("decimal") 21 | } 22 | 23 | ///An email address. 24 | public static var `email`: Self { 25 | return .init("email") 26 | } 27 | 28 | ///No input mode. 29 | public static var `none`: Self { 30 | return .init("none") 31 | } 32 | 33 | ///A numeric value. 34 | public static var `numeric`: Self { 35 | return .init("numeric") 36 | } 37 | 38 | ///A search field. 39 | public static var `search`: Self { 40 | return .init("search") 41 | } 42 | 43 | ///A telephone number. 44 | public static var `tel`: Self { 45 | return .init("tel") 46 | } 47 | 48 | ///A free-form text field. 49 | public static var `text`: Self { 50 | return .init("text") 51 | } 52 | 53 | ///A URL. 54 | public static var `url`: Self { 55 | return .init("url") 56 | } 57 | 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+InputQuantity.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+InputQuantity.swift 4 | // 5 | 6 | extension Unit { 7 | public struct InputQuantity: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The minimum value for a number. 19 | public static func `number`(_ value: Int) -> Self { 20 | return .init("number(\(value))") 21 | } 22 | 23 | ///The minimum date for a date input. 24 | public static func `date`(_ value: String) -> Self { 25 | return .init("date(\(value))") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Integer.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Integer.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Integer: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A raw integer. 19 | public static func `int`(_ int: Int) -> Self { 20 | return .init("{{number}}%") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+IsolationMode.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+IsolationMode.swift 4 | // 5 | 6 | extension Unit { 7 | public struct IsolationMode: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The isolation mode is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The isolation mode is isolate. 24 | public static var `isolate`: Self { 25 | return .init("isolate") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+LineBreak.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+LineBreak.swift 4 | // 5 | 6 | extension Unit { 7 | public struct LineBreak: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The default behavior. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The line break is loose. 24 | public static var `loose`: Self { 25 | return .init("loose") 26 | } 27 | 28 | ///The line break is normal. 29 | public static var `normal`: Self { 30 | return .init("normal") 31 | } 32 | 33 | ///The line break is strict. 34 | public static var `strict`: Self { 35 | return .init("strict") 36 | } 37 | 38 | ///The line break can occur anywhere. 39 | public static var `anywhere`: Self { 40 | return .init("anywhere") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+LineHeight.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+LineHeight.swift 4 | // 5 | 6 | extension Unit { 7 | public struct LineHeight: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The default line height. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///A number. 24 | public static func `number`(_ number: Double) -> Self { 25 | return .init("number(\(number))") 26 | } 27 | 28 | ///A length. 29 | public static func `length`(_ length: Unit.Length) -> Self { 30 | return .init("length(\(length))") 31 | } 32 | 33 | ///A percentage. 34 | public static func `percent`(_ percent: Int) -> Self { 35 | return .init("percent(\(percent))") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ListStylePosition.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ListStylePosition.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ListStylePosition: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The list style position is inside. 19 | public static var `inside`: Self { 20 | return .init("inside") 21 | } 22 | 23 | ///The list style position is outside. 24 | public static var `outside`: Self { 25 | return .init("outside") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ListStyleType.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ListStyleType.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ListStyleType: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The list style type is an image. 19 | public static func `image`(_ image: Unit.Image) -> Self { 20 | return .init("\(image)") 21 | } 22 | 23 | ///The list style type is none. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | ///The list style type is a string. 29 | public static func `string`(_ string: String) -> Self { 30 | return .init("\(string)") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Loading.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Loading.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Loading: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser will load the image immediately. 19 | public static var `eager`: Self { 20 | return .init("eager") 21 | } 22 | 23 | ///The browser will load the image when it is in the viewport. 24 | public static var `lazy`: Self { 25 | return .init("lazy") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Location.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Location.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Location: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is located at the start. 19 | public static var `start`: Self { 20 | return .init("start") 21 | } 22 | 23 | ///The element is located at the end. 24 | public static var `end`: Self { 25 | return .init("end") 26 | } 27 | 28 | ///The element is located near. 29 | public static var `near`: Self { 30 | return .init("near") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+MathDepth.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+MathDepth.swift 4 | // 5 | 6 | extension Unit { 7 | public struct MathDepth: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The math depth is auto. 19 | public static var `autoAdd`: Self { 20 | return .init("auto-add") 21 | } 22 | 23 | ///The math depth is a string. 24 | public static func `integer`(_ integer: Int) -> Self { 25 | return .init("\(integer)") 26 | } 27 | 28 | ///The math depth is a string. 29 | public static func `add`(_ integer: Int) -> Self { 30 | return .init("add(\(integer))") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+MathStyle.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+MathStyle.swift 4 | // 5 | 6 | extension Unit { 7 | public struct MathStyle: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The math style is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The math style is compact. 24 | public static var `compact`: Self { 25 | return .init("compact") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+None.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+None.swift 4 | // 5 | 6 | extension Unit { 7 | public struct None: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///No value. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+NoneImage.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+NoneImage.swift 4 | // 5 | 6 | extension Unit { 7 | public struct NoneImage: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///No value. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///A URL image. 24 | public static func `url`(_ url: String) -> Self { 25 | return .init("url(\(url))") 26 | } 27 | 28 | ///A source image. 29 | public static func `src`(_ src: String) -> Self { 30 | return .init("src(\(src))") 31 | } 32 | 33 | ///A gradient image. 34 | public static func `gradient`(_ gradient: Unit.Gradient) -> Self { 35 | return .init("\(gradient)") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Normal.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Normal.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Normal: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The normal value. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Number.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Number.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Number: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A raw number. 19 | public static func `number`(_ number: Double) -> Self { 20 | return .init("\(number)%") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+NumberPercentage.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+NumberPercentage.swift 4 | // 5 | 6 | extension Unit { 7 | public struct NumberPercentage: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A raw number. 19 | public static func `number`(_ number: Double) -> Self { 20 | return .init("\(number)%") 21 | } 22 | 23 | ///The image is a specific percentage of the element. 24 | public static func `percent`(_ percent: Int) -> Self { 25 | return .init("\(percent)%") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPC.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPC.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPC: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is center. 19 | public static var `center`: Self { 20 | return .init("center") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPFull.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPFull.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPFull: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is top. 19 | public static var `top`: Self { 20 | return .init("top") 21 | } 22 | 23 | ///The object position is bottom. 24 | public static var `bottom`: Self { 25 | return .init("bottom") 26 | } 27 | 28 | ///The object position is left. 29 | public static var `left`: Self { 30 | return .init("left") 31 | } 32 | 33 | ///The object position is right. 34 | public static var `right`: Self { 35 | return .init("right") 36 | } 37 | 38 | ///The object position is center. 39 | public static var `center`: Self { 40 | return .init("center") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPLCR.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPLCR.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPLCR: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is left. 19 | public static var `left`: Self { 20 | return .init("left") 21 | } 22 | 23 | ///The object position is right. 24 | public static var `right`: Self { 25 | return .init("right") 26 | } 27 | 28 | ///The object position is center. 29 | public static var `center`: Self { 30 | return .init("center") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPLCRLP.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPLCRLP.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPLCRLP: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is left. 19 | public static var `left`: Self { 20 | return .init("left") 21 | } 22 | 23 | ///The object position is right. 24 | public static var `right`: Self { 25 | return .init("right") 26 | } 27 | 28 | ///The object position is center. 29 | public static var `center`: Self { 30 | return .init("center") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPLR.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPLR.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPLR: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is left. 19 | public static var `left`: Self { 20 | return .init("left") 21 | } 22 | 23 | ///The object position is right. 24 | public static var `right`: Self { 25 | return .init("right") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPTB.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPTB.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPTB: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is top. 19 | public static var `top`: Self { 20 | return .init("top") 21 | } 22 | 23 | ///The object position is bottom. 24 | public static var `bottom`: Self { 25 | return .init("bottom") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPTCB.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPTCB.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPTCB: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is top. 19 | public static var `top`: Self { 20 | return .init("top") 21 | } 22 | 23 | ///The object position is bottom. 24 | public static var `bottom`: Self { 25 | return .init("bottom") 26 | } 27 | 28 | ///The object position is center. 29 | public static var `center`: Self { 30 | return .init("center") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OPTCBLP.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OPTCBLP.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OPTCBLP: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object position is top. 19 | public static var `top`: Self { 20 | return .init("top") 21 | } 22 | 23 | ///The object position is bottom. 24 | public static var `bottom`: Self { 25 | return .init("bottom") 26 | } 27 | 28 | ///The object position is center. 29 | public static var `center`: Self { 30 | return .init("center") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ObjectFit.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ObjectFit.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ObjectFit: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The object fit is fill. 19 | public static var `fill`: Self { 20 | return .init("fill") 21 | } 22 | 23 | ///The object fit is contain. 24 | public static var `contain`: Self { 25 | return .init("contain") 26 | } 27 | 28 | ///The object fit is cover. 29 | public static var `cover`: Self { 30 | return .init("cover") 31 | } 32 | 33 | ///The object fit is none. 34 | public static var `none`: Self { 35 | return .init("none") 36 | } 37 | 38 | ///The object fit is scale down. 39 | public static var `scaleDown`: Self { 40 | return .init("scale-down") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OverflowAnchor.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OverflowAnchor.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OverflowAnchor: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The overflow anchor is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The overflow anchor is none. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OverflowClipMargin.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OverflowClipMargin.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OverflowClipMargin: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The overflow clip margin is a box. 19 | public static func `box`(_ box: Unit.VisualBox) -> Self { 20 | return .init("\(box)") 21 | } 22 | 23 | ///The overflow clip margin is a length. 24 | public static func `length`(_ length: Unit.Length) -> Self { 25 | return .init("\(length)") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OverflowValue.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OverflowValue.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OverflowValue: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The overflow position is visible. 19 | public static var `visible`: Self { 20 | return .init("visible") 21 | } 22 | 23 | ///The overflow position is hidden. 24 | public static var `hidden`: Self { 25 | return .init("hidden") 26 | } 27 | 28 | ///The overflow position is clip. 29 | public static var `clip`: Self { 30 | return .init("clip") 31 | } 32 | 33 | ///The overflow position is scroll. 34 | public static var `scroll`: Self { 35 | return .init("scroll") 36 | } 37 | 38 | ///The overflow position is auto. 39 | public static var `auto`: Self { 40 | return .init("auto") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OverflowWrap.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OverflowWrap.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OverflowWrap: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The overflow wrap is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The overflow wrap is break word. 24 | public static var `breakWord`: Self { 25 | return .init("break-word") 26 | } 27 | 28 | ///The overflow wrap is anywhere. 29 | public static var `anywhere`: Self { 30 | return .init("anywhere") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+OverscrollBehavior.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+OverscrollBehavior.swift 4 | // 5 | 6 | extension Unit { 7 | public struct OverscrollBehavior: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The overscroll value is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The overscroll value is contain. 24 | public static var `contain`: Self { 25 | return .init("contain") 26 | } 27 | 28 | ///The overscroll value is none. 29 | public static var `none`: Self { 30 | return .init("none") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Page.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Page.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Page: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The page is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The page is a name. 24 | public static func `string`(_ identifier: String) -> Self { 25 | return .init("\(identifier)") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PaintOrder.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PaintOrder.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PaintOrder: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The paint order is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The paint order is fill. 24 | public static var `fill`: Self { 25 | return .init("fill") 26 | } 27 | 28 | ///The paint order is stroke. 29 | public static var `stroke`: Self { 30 | return .init("stroke") 31 | } 32 | 33 | ///The paint order is markers. 34 | public static var `markers`: Self { 35 | return .init("markers") 36 | } 37 | 38 | ///The paint order is custom. 39 | public static func `with`(fill: Bool? = nil, stroke: Bool? = nil, markers: Bool? = nil) -> Self { 40 | return .init("\(Utils.when(fill, ret: "fill")) \(Utils.when(stroke, ret: "stroke")) \(Utils.when(markers, ret: "markers"))") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Pair.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Pair.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Pair: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The pair is custom. 19 | public static func `pair`(_ open: String, _ close: String) -> Self { 20 | return .init("'\(open)' '\(close)'") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Percentage.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Percentage.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Percentage: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image is a specific percentage of the element. 19 | public static func `percent`(_ percent: Int) -> Self { 20 | return .init("\(percent)%") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PlaceContent.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PlaceContent.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PlaceContent: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The content is placed with a length. 19 | public static func `with`(_ alignContent: Unit.AlignContent, _ justifyContent: Unit.JustifyContent? = nil) -> Self { 20 | return .init("\(alignContent) \(Utils.unwrapUnit(justifyContent))") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PlaceItems.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PlaceItems.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PlaceItems: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The items are placed with a length. 19 | public static func `with`(_ alignItems: Unit.AlignItems, _ justifyItems: Unit.JustifyItems? = nil) -> Self { 20 | return .init("\(alignItems) \(Utils.unwrapUnit(justifyItems))") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PlaceSelf.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PlaceSelf.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PlaceSelf: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The self is placed with a length. 19 | public static func `with`(_ alignSelf: Unit.AlignSelf, _ justifySelf: Unit.JustifySelf? = nil) -> Self { 20 | return .init("\(alignSelf) \(Utils.unwrapUnit(justifySelf))") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PopoverTargetAction.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PopoverTargetAction.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PopoverTargetAction: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Hides the popover. 19 | public static var `hide`: Self { 20 | return .init("hide") 21 | } 22 | 23 | ///Shows the popover. 24 | public static var `show`: Self { 25 | return .init("show") 26 | } 27 | 28 | ///Toggles the visibility of the popover. 29 | public static var `toggle`: Self { 30 | return .init("toggle") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Position.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Position.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Position: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is positioned at a specific length. 19 | public static func `x`(_ value: Unit.PositionX) -> Self { 20 | return .init("\(value)") 21 | } 22 | 23 | ///The element is positioned at a specific length. 24 | public static func `y`(_ value: Unit.PositionY) -> Self { 25 | return .init("\(value)") 26 | } 27 | 28 | ///The element is positioned. 29 | public static func `xy`(_ x: Unit.PositionX, _ y: Unit.PositionY) -> Self { 30 | return .init("\(x) \(y)") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PositionType.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PositionType.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PositionType: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is static. 19 | public static var `static`: Self { 20 | return .init("static") 21 | } 22 | 23 | ///The element is relative. 24 | public static var `relative`: Self { 25 | return .init("relative") 26 | } 27 | 28 | ///The element is absolute. 29 | public static var `absolute`: Self { 30 | return .init("absolute") 31 | } 32 | 33 | ///The element is fixed. 34 | public static var `fixed`: Self { 35 | return .init("fixed") 36 | } 37 | 38 | ///The element is sticky. 39 | public static var `sticky`: Self { 40 | return .init("sticky") 41 | } 42 | 43 | ///The element is running. 44 | public static func `running`(_ customIdent: String) -> Self { 45 | return .init("running(\(customIdent))") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PositionX.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PositionX.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PositionX: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is positioned at a specific length. 19 | public static func `direction`(_ value: Unit.HorrizontalRelativeDirection) -> Self { 20 | return .init("\(value)") 21 | } 22 | 23 | ///The element is positioned at a specific length. 24 | public static func `offset`(_ value: Unit.Length) -> Self { 25 | return .init("\(value)") 26 | } 27 | 28 | ///The element is positioned at a specific percentage. 29 | public static func `percent`(_ value: Percent) -> Self { 30 | return .init("\(value)%") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PositionY.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PositionY.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PositionY: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is positioned at a specific length. 19 | public static func `direction`(_ value: Unit.VerticalRelativeDirection) -> Self { 20 | return .init("\(value)") 21 | } 22 | 23 | ///The element is positioned at a specific length. 24 | public static func `offset`(_ value: Unit.Length) -> Self { 25 | return .init("\(value)") 26 | } 27 | 28 | ///The element is positioned at a specific percentage. 29 | public static func `percent`(_ value: Percent) -> Self { 30 | return .init("\(value)%") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Preload.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Preload.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Preload: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not preloaded. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The element is preloaded with metadata. 24 | public static var `metadata`: Self { 25 | return .init("metadata") 26 | } 27 | 28 | ///The element is preloaded. 29 | public static var `auto`: Self { 30 | return .init("auto") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+PrintColorAdjust.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+PrintColorAdjust.swift 4 | // 5 | 6 | extension Unit { 7 | public struct PrintColorAdjust: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The color adjustment is economy. 19 | public static var `economy`: Self { 20 | return .init("economy") 21 | } 22 | 23 | ///The color adjustment is exact. 24 | public static var `exact`: Self { 25 | return .init("exact") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Question.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Question.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Question: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The answer is yes. 19 | public static var `yes`: Self { 20 | return .init("yes") 21 | } 22 | 23 | ///The answer is no. 24 | public static var `no`: Self { 25 | return .init("no") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Quotes.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Quotes.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Quotes: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The quotes are none. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The quotes are auto. 24 | public static var `auto`: Self { 25 | return .init("auto") 26 | } 27 | 28 | ///Custom quotes. 29 | public static func `with`(_ pairs: Unit.Pair...) -> Self { 30 | return .init("\(pairs.map { $0.description }.joined(separator: " ")) ") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Repeat.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Repeat.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Repeat: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image is repeated. 19 | public static var `repeat`: Self { 20 | return .init("repeat") 21 | } 22 | 23 | ///The image is repeated horizontally. 24 | public static var `repeatX`: Self { 25 | return .init("repeat-x") 26 | } 27 | 28 | ///The image is repeated vertically. 29 | public static var `repeatY`: Self { 30 | return .init("repeat-y") 31 | } 32 | 33 | ///The image is not repeated. 34 | public static var `noRepeat`: Self { 35 | return .init("no-repeat") 36 | } 37 | 38 | ///The image is repeated with space. 39 | public static var `space`: Self { 40 | return .init("space") 41 | } 42 | 43 | ///The image is repeated with rounding. 44 | public static var `round`: Self { 45 | return .init("round") 46 | } 47 | 48 | ///both directions specified 49 | public static func `both`(_ horizontal: Unit.InnerRepeat, _ vertical: Unit.InnerRepeat) -> Self { 50 | return .init("\(horizontal) \(vertical)") 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+RepeatImage.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+RepeatImage.swift 4 | // 5 | 6 | extension Unit { 7 | public struct RepeatImage: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image is stretched. 19 | public static var `stretch`: Self { 20 | return .init("stretch") 21 | } 22 | 23 | ///The image is repeated. 24 | public static var `repeat`: Self { 25 | return .init("repeat") 26 | } 27 | 28 | ///The image is repeated with rounding. 29 | public static var `round`: Self { 30 | return .init("round") 31 | } 32 | 33 | ///The image is repeated with space. 34 | public static var `space`: Self { 35 | return .init("space") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Resize.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Resize.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Resize: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not resizable. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The element is resizable. 24 | public static var `both`: Self { 25 | return .init("both") 26 | } 27 | 28 | ///The element is resizable horizontally. 29 | public static var `horizontal`: Self { 30 | return .init("horizontal") 31 | } 32 | 33 | ///The element is resizable vertically. 34 | public static var `vertical`: Self { 35 | return .init("vertical") 36 | } 37 | 38 | ///The element is resizable in block. 39 | public static var `block`: Self { 40 | return .init("block") 41 | } 42 | 43 | ///The element is resizable in inline. 44 | public static var `inline`: Self { 45 | return .init("inline") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Rotate.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Rotate.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Rotate: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not rotated. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The rotation of the element. 24 | public static func `angle`(_ angle: Unit.Angle) -> Self { 25 | return .init("\(angle)") 26 | } 27 | 28 | ///The rotation of the element. 29 | public static func `by`(axis: Unit.Axis, angle: Unit.Angle) -> Self { 30 | return .init("\(axis) \(angle)") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Scale.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Scale.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Scale: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not scaled. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The scaling of the element in the x-axis. 24 | public static func `by`(xy: Unit.NumberPercentage) -> Self { 25 | return .init("\(xy)") 26 | } 27 | 28 | ///The scaling of the element. 29 | public static func `by`(x: Unit.NumberPercentage, y: Unit.NumberPercentage) -> Self { 30 | return .init("\(x) \(y)") 31 | } 32 | 33 | ///The scaling of the element in the y, x and z axis. 34 | public static func `by`(x: Unit.NumberPercentage, y: Unit.NumberPercentage, z: Unit.NumberPercentage) -> Self { 35 | return .init("\(x) \(y) \(z)") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Scope.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Scope.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Scope: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The scope is row. 19 | public static var `row`: Self { 20 | return .init("row") 21 | } 22 | 23 | ///The scope is column. 24 | public static var `col`: Self { 25 | return .init("col") 26 | } 27 | 28 | ///The scope is row group. 29 | public static var `rowgroup`: Self { 30 | return .init("rowgroup") 31 | } 32 | 33 | ///The scope is column group. 34 | public static var `colgroup`: Self { 35 | return .init("colgroup") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+ShadowRootMode.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+ShadowRootMode.swift 4 | // 5 | 6 | extension Unit { 7 | public struct ShadowRootMode: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The shadow root is open. 19 | public static var `open`: Self { 20 | return .init("open") 21 | } 22 | 23 | ///The shadow root is closed. 24 | public static var `closed`: Self { 25 | return .init("closed") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Shape.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Shape.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Shape: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A rectangle shape. 19 | public static func `rect`(top: Unit.AutoLengthPercentage, right: Unit.AutoLengthPercentage, bottom: Unit.AutoLengthPercentage, left: Unit.AutoLengthPercentage) -> Self { 20 | return .init("rect(\(top), \(right), \(bottom), \(left))") 21 | } 22 | 23 | ///A rectangle shape. 24 | public static func `rect`(top: Unit.AutoLengthPercentage, right: Unit.AutoLengthPercentage, bottom: Unit.AutoLengthPercentage, left: Unit.AutoLengthPercentage, cornerRadius: Unit.AutoLengthPercentage) -> Self { 25 | return .init("rect(\(top), \(right), \(bottom), \(left) round \(cornerRadius))") 26 | } 27 | 28 | ///A circle shape. 29 | public static func `circle`(radius: Unit.AutoLengthPercentage) -> Self { 30 | return .init("circle(\(radius))") 31 | } 32 | 33 | ///A circle shape. 34 | public static func `circle`(radius: Unit.AutoLengthPercentage, position: Unit.Position) -> Self { 35 | return .init("circle(\(radius) at \(position))") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Shown.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Shown.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Shown: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is shown. 19 | public static var `shown`: Self { 20 | return .init("shown") 21 | } 22 | 23 | ///The element is hidden. 24 | public static var `hide`: Self { 25 | return .init("hide") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Size.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Size.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Size: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The width is the maximum content width. 19 | public static var `maxContent`: Self { 20 | return .init("max-content") 21 | } 22 | 23 | ///The width is the minimum content width. 24 | public static var `minContent`: Self { 25 | return .init("min-content") 26 | } 27 | 28 | ///The width is the fit content width. 29 | public static var `fitContent`: Self { 30 | return .init("fit-content") 31 | } 32 | 33 | ///The width is the fit content width. 34 | public static func `fitContent`(_ value: Unit.LengthPercentage) -> Self { 35 | return .init("fit-content(\(value))") 36 | } 37 | 38 | ///the auto value 39 | public static var `auto`: Self { 40 | return .init("auto") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+SliceImage.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+SliceImage.swift 4 | // 5 | 6 | extension Unit { 7 | public struct SliceImage: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The image is filled. 19 | public static var `fill`: Self { 20 | return .init("fill") 21 | } 22 | 23 | ///A raw number. 24 | public static func `number`(_ number: Double) -> Self { 25 | return .init("\(number)%") 26 | } 27 | 28 | ///The image is a specific percentage of the element. 29 | public static func `percent`(_ percent: Int) -> Self { 30 | return .init("\(percent)%") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Source.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Source.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Source: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///A URL image source. 19 | public static func `url`(_ url: String) -> Self { 20 | return .init("url(\(url))") 21 | } 22 | 23 | ///A source image. 24 | public static func `src`(_ src: String) -> Self { 25 | return .init("src(\(src))") 26 | } 27 | 28 | ///A linear gradient. 29 | public static func `linear`(_ angle: Unit.Angle) -> Self { 30 | return .init("linear-gradient(\(angle))") 31 | } 32 | 33 | ///A radial gradient. 34 | public static func `radial`(_ shape: Unit.Length, _ size: Unit.Length, _ position: Unit.Length, _ shape2: Unit.Length, _ size2: Unit.Length, _ position2: Unit.Length) -> Self { 35 | return .init("radial-gradient(\(shape) \(size) at \(position), \(shape2) \(size2) at \(position2))") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TableLayout.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TableLayout.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TableLayout: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The table layout is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The table layout is fixed. 24 | public static var `fixed`: Self { 25 | return .init("fixed") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Target.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Target.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Target: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///Opens the link in a new window or tab. 19 | public static var `blank`: Self { 20 | return .init("_blank") 21 | } 22 | 23 | ///Opens the link in the same frame as it was clicked. 24 | public static var `self`: Self { 25 | return .init("_self") 26 | } 27 | 28 | ///Opens the link in the parent frame. 29 | public static var `parent`: Self { 30 | return .init("_parent") 31 | } 32 | 33 | ///Opens the link in the full body of the window. 34 | public static var `top`: Self { 35 | return .init("_top") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextAlign.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextAlign.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextAlign: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is aligned to the start. 19 | public static var `start`: Self { 20 | return .init("start") 21 | } 22 | 23 | ///The text is aligned to the end. 24 | public static var `end`: Self { 25 | return .init("end") 26 | } 27 | 28 | ///The text is aligned to the left. 29 | public static var `left`: Self { 30 | return .init("left") 31 | } 32 | 33 | ///The text is aligned to the right. 34 | public static var `right`: Self { 35 | return .init("right") 36 | } 37 | 38 | ///The text is aligned to the center. 39 | public static var `center`: Self { 40 | return .init("center") 41 | } 42 | 43 | ///The text is justified. 44 | public static var `justify`: Self { 45 | return .init("justify") 46 | } 47 | 48 | ///The text is matched to the parent. 49 | public static var `matchParent`: Self { 50 | return .init("match-parent") 51 | } 52 | 53 | ///The text is justified all. 54 | public static var `justifyAll`: Self { 55 | return .init("justify-all") 56 | } 57 | 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextDecorationLine.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextDecorationLine.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextDecorationLine: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is underlined. 19 | public static var `underline`: Self { 20 | return .init("underline") 21 | } 22 | 23 | ///The text is overlined. 24 | public static var `overline`: Self { 25 | return .init("overline") 26 | } 27 | 28 | ///The text is line through. 29 | public static var `lineThrough`: Self { 30 | return .init("line-through") 31 | } 32 | 33 | ///The text blinks. 34 | public static var `blink`: Self { 35 | return .init("blink") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextDecorationSkipInk.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextDecorationSkipInk.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextDecorationSkipInk: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The text is combined upright. 24 | public static var `all`: Self { 25 | return .init("all") 26 | } 27 | 28 | ///The text is not combined. 29 | public static var `none`: Self { 30 | return .init("none") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextDecorationStyle.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextDecorationStyle.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextDecorationStyle: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is solid. 19 | public static var `solid`: Self { 20 | return .init("solid") 21 | } 22 | 23 | ///The text is double. 24 | public static var `double`: Self { 25 | return .init("double") 26 | } 27 | 28 | ///The text is dotted. 29 | public static var `dotted`: Self { 30 | return .init("dotted") 31 | } 32 | 33 | ///The text is dashed. 34 | public static var `dashed`: Self { 35 | return .init("dashed") 36 | } 37 | 38 | ///The text is wavy. 39 | public static var `wavy`: Self { 40 | return .init("wavy") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextEmphasisPosition.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextEmphasisPosition.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextEmphasisPosition: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text emphasis is over. 19 | public static var `over`: Self { 20 | return .init("over") 21 | } 22 | 23 | ///The text emphasis is under. 24 | public static var `under`: Self { 25 | return .init("under") 26 | } 27 | 28 | ///The text emphasis is right. 29 | public static var `right`: Self { 30 | return .init("right") 31 | } 32 | 33 | ///The text emphasis is left. 34 | public static var `left`: Self { 35 | return .init("left") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextJustify.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextJustify.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextJustify: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is justified. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The text is not justified. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | ///The text is inter word. 29 | public static var `interWord`: Self { 30 | return .init("inter-word") 31 | } 32 | 33 | ///The text is inter ideograph. 34 | public static var `interCharacter`: Self { 35 | return .init("inter-character") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextOrientation.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextOrientation.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextOrientation: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | /// 19 | public static var `mixed`: Self { 20 | return .init("mixed") 21 | } 22 | 23 | /// 24 | public static var `upright`: Self { 25 | return .init("upright") 26 | } 27 | 28 | /// 29 | public static var `sideways`: Self { 30 | return .init("sideways") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextOverflow.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextOverflow.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextOverflow: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | /// 19 | public static var `clip`: Self { 20 | return .init("clip") 21 | } 22 | 23 | /// 24 | public static var `elipsis`: Self { 25 | return .init("elipsis") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextRendering.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextRendering.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextRendering: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The browser decides the text rendering. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The text rendering is optimized for speed. 24 | public static var `optimizeSpeed`: Self { 25 | return .init("optimizeSpeed") 26 | } 27 | 28 | ///The text rendering is optimized for legibility. 29 | public static var `optimizeLegibility`: Self { 30 | return .init("optimizeLegibility") 31 | } 32 | 33 | ///The text rendering is geometric precision. 34 | public static var `geometricPrecision`: Self { 35 | return .init("geometricPrecision") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextTrackKind.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextTrackKind.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextTrackKind: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text track is subtitles. 19 | public static var `subtitles`: Self { 20 | return .init("subtitles") 21 | } 22 | 23 | ///The text track is captions. 24 | public static var `captions`: Self { 25 | return .init("captions") 26 | } 27 | 28 | ///The text track is descriptions. 29 | public static var `descriptions`: Self { 30 | return .init("descriptions") 31 | } 32 | 33 | ///The text track is chapters. 34 | public static var `chapters`: Self { 35 | return .init("chapters") 36 | } 37 | 38 | ///The text track is metadata. 39 | public static var `metadata`: Self { 40 | return .init("metadata") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextTransform.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextTransform.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextTransform: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///No capitalization or transformation. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///Capitalize the first letter of each word. 24 | public static var `capitalize`: Self { 25 | return .init("capitalize") 26 | } 27 | 28 | ///Transform all characters to uppercase. 29 | public static var `uppercase`: Self { 30 | return .init("uppercase") 31 | } 32 | 33 | ///Transform all characters to lowercase. 34 | public static var `lowercase`: Self { 35 | return .init("lowercase") 36 | } 37 | 38 | ///Transform characters to full-width form. 39 | public static var `fullWidth`: Self { 40 | return .init("full-width") 41 | } 42 | 43 | ///Transform characters to full-size kana. 44 | public static var `fullSizeKana`: Self { 45 | return .init("full-size-kana") 46 | } 47 | 48 | ///Automatically adjust text for mathematical typesetting. 49 | public static var `mathAuto`: Self { 50 | return .init("math-auto") 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TextWrap.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TextWrap.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TextWrap: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is wrapped. 19 | public static var `hard`: Self { 20 | return .init("hard") 21 | } 22 | 23 | ///The text is not wrapped. 24 | public static var `soft`: Self { 25 | return .init("soft") 26 | } 27 | 28 | ///The text is balanced. 29 | public static var `off`: Self { 30 | return .init("off") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Toggle.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Toggle.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Toggle: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The toggle is on. 19 | public static var `on`: Self { 20 | return .init("on") 21 | } 22 | 23 | ///The toggle is off. 24 | public static var `off`: Self { 25 | return .init("off") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+TouchAction.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+TouchAction.swift 4 | // 5 | 6 | extension Unit { 7 | public struct TouchAction: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The touch action is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The touch action is none. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | ///The touch action is pan x. 29 | public static var `panX`: Self { 30 | return .init("pan-x") 31 | } 32 | 33 | ///The touch action is pan y. 34 | public static var `panY`: Self { 35 | return .init("pan-y") 36 | } 37 | 38 | ///The touch action is manipulation. 39 | public static var `manipulation`: Self { 40 | return .init("manipulation") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Translate.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Translate.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Translate: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is not translated. 19 | public static var `none`: Self { 20 | return .init("none") 21 | } 22 | 23 | ///The translation of the element in the x-axis. 24 | public static func `translateX`(_ x: Unit.LengthPercentage) -> Self { 25 | return .init("\(x)") 26 | } 27 | 28 | ///The translation of the element. 29 | public static func `translateXy`(_ x: Unit.LengthPercentage, _ y: Unit.LengthPercentage) -> Self { 30 | return .init("\(x) \(y)") 31 | } 32 | 33 | ///The translation of the element in the y, x and z axis. 34 | public static func `translateXyz`(_ x: Unit.LengthPercentage, _ y: Unit.LengthPercentage, _ z: Unit.Length) -> Self { 35 | return .init("\(x) \(y) \(z)") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+UnderlineTextPosition.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+UnderlineTextPosition.swift 4 | // 5 | 6 | extension Unit { 7 | public struct UnderlineTextPosition: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The text is over. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The text is under. 24 | public static var `under`: Self { 25 | return .init("under") 26 | } 27 | 28 | ///The text is left. 29 | public static var `left`: Self { 30 | return .init("left") 31 | } 32 | 33 | ///The text is right. 34 | public static var `right`: Self { 35 | return .init("right") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+UnicodeBidi.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+UnicodeBidi.swift 4 | // 5 | 6 | extension Unit { 7 | public struct UnicodeBidi: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The element is embedded. 24 | public static var `embed`: Self { 25 | return .init("embed") 26 | } 27 | 28 | ///The element is isolated. 29 | public static var `isolate`: Self { 30 | return .init("isolate") 31 | } 32 | 33 | ///The element is bidi override. 34 | public static var `bidiOverride`: Self { 35 | return .init("bidi-override") 36 | } 37 | 38 | ///The element is isolated override. 39 | public static var `isolateOverride`: Self { 40 | return .init("isolate-override") 41 | } 42 | 43 | ///The element is plaintext. 44 | public static var `plaintext`: Self { 45 | return .init("plaintext") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+UnidirectionalWidth.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+UnidirectionalWidth.swift 4 | // 5 | 6 | extension Unit { 7 | public struct UnidirectionalWidth: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The border width for all four sides. 19 | public static func `both`(_ startAndEndWidth: Unit.LineWidth) -> Self { 20 | return .init("\(startAndEndWidth)") 21 | } 22 | 23 | ///The border width for the top, right, bottom, and left sides. 24 | public static func `each`(_ start: Unit.LineWidth, _ end: Unit.LineWidth) -> Self { 25 | return .init("\(start) \(end)") 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+UserSelect.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+UserSelect.swift 4 | // 5 | 6 | extension Unit { 7 | public struct UserSelect: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The user select is auto. 19 | public static var `auto`: Self { 20 | return .init("auto") 21 | } 22 | 23 | ///The user select is none. 24 | public static var `none`: Self { 25 | return .init("none") 26 | } 27 | 28 | ///The user select is text. 29 | public static var `text`: Self { 30 | return .init("text") 31 | } 32 | 33 | ///The user select is all. 34 | public static var `all`: Self { 35 | return .init("all") 36 | } 37 | 38 | ///The user select is contain. 39 | public static var `contain`: Self { 40 | return .init("contain") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+VerticalRelativeDirection.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+VerticalRelativeDirection.swift 4 | // 5 | 6 | extension Unit { 7 | public struct VerticalRelativeDirection: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is positioned to the left. 19 | public static var `top`: Self { 20 | return .init("top") 21 | } 22 | 23 | ///The element is positioned to the right. 24 | public static var `center`: Self { 25 | return .init("center") 26 | } 27 | 28 | ///The element is positioned to the right. 29 | public static var `bottom`: Self { 30 | return .init("bottom") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Visibility.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Visibility.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Visibility: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The element is hidden. 19 | public static var `hidden`: Self { 20 | return .init("hidden") 21 | } 22 | 23 | ///The element is visible. 24 | public static var `visible`: Self { 25 | return .init("visible") 26 | } 27 | 28 | ///The element is collapsed. 29 | public static var `collapse`: Self { 30 | return .init("collapse") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+VisualBox.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+VisualBox.swift 4 | // 5 | 6 | extension Unit { 7 | public struct VisualBox: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The border is included in the box. 19 | public static var `borderBox`: Self { 20 | return .init("border-box") 21 | } 22 | 23 | ///The border is not included in the box. 24 | public static var `contentBox`: Self { 25 | return .init("content-box") 26 | } 27 | 28 | ///The padding is included in the box. 29 | public static var `paddingBox`: Self { 30 | return .init("padding-box") 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+WhiteSpace.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+WhiteSpace.swift 4 | // 5 | 6 | extension Unit { 7 | public struct WhiteSpace: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The white space is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The white space is no wrap. 24 | public static var `nowrap`: Self { 25 | return .init("nowrap") 26 | } 27 | 28 | ///The white space is pre. 29 | public static var `pre`: Self { 30 | return .init("pre") 31 | } 32 | 33 | ///The white space is pre wrap. 34 | public static var `preWrap`: Self { 35 | return .init("pre-wrap") 36 | } 37 | 38 | ///The white space is pre line. 39 | public static var `preLine`: Self { 40 | return .init("pre-line") 41 | } 42 | 43 | ///The white space is break spaces. 44 | public static var `breakSpaces`: Self { 45 | return .init("break-spaces") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+WhiteSpaceCollapse.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+WhiteSpaceCollapse.swift 4 | // 5 | 6 | extension Unit { 7 | public struct WhiteSpaceCollapse: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The white space is collapsed. 19 | public static var `collapse`: Self { 20 | return .init("collapse") 21 | } 22 | 23 | ///The white space is preserved. 24 | public static var `preserve`: Self { 25 | return .init("preserve") 26 | } 27 | 28 | ///The white space is discarded. 29 | public static var `discard`: Self { 30 | return .init("discard") 31 | } 32 | 33 | ///The white space is preserved breaks. 34 | public static var `preserveBreaks`: Self { 35 | return .init("preserve-breaks") 36 | } 37 | 38 | ///The white space is preserved spaces. 39 | public static var `preserveSpaces`: Self { 40 | return .init("preserve-spaces") 41 | } 42 | 43 | ///The white space is break spaces. 44 | public static var `breakSpaces`: Self { 45 | return .init("break-spaces") 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+WordBreak.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+WordBreak.swift 4 | // 5 | 6 | extension Unit { 7 | public struct WordBreak: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The word break is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The word break is break all. 24 | public static var `breakAll`: Self { 25 | return .init("break-all") 26 | } 27 | 28 | ///The word break is keep all. 29 | public static var `keepAll`: Self { 30 | return .init("keep-all") 31 | } 32 | 33 | ///The word break is break word. 34 | public static var `breakWord`: Self { 35 | return .init("break-word") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+WritingMode.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+WritingMode.swift 4 | // 5 | 6 | extension Unit { 7 | public struct WritingMode: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The writing mode is horizontal tb. 19 | public static var `horizontalTb`: Self { 20 | return .init("horizontal-tb") 21 | } 22 | 23 | ///The writing mode is vertical rl. 24 | public static var `verticalRl`: Self { 25 | return .init("vertical-rl") 26 | } 27 | 28 | ///The writing mode is vertical lr. 29 | public static var `verticalLr`: Self { 30 | return .init("vertical-lr") 31 | } 32 | 33 | ///The writing mode is sideways rl. 34 | public static var `sidewaysRl`: Self { 35 | return .init("sideways-rl") 36 | } 37 | 38 | ///The writing mode is sideways lr. 39 | public static var `sidewaysLr`: Self { 40 | return .init("sideways-lr") 41 | } 42 | 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+XYValue.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+XYValue.swift 4 | // 5 | 6 | extension Unit { 7 | public struct XYValue: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The x and y value. 19 | public static func `with`(x: Int, y: Int) -> Self { 20 | return .init("\(x) \(y)") 21 | } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Generated/Units/Unit+Zoom.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Shipwright. DO NOT CHANGE. 2 | // 3 | // Unit+Zoom.swift 4 | // 5 | 6 | extension Unit { 7 | public struct Zoom: Equatable, CustomStringConvertible { 8 | var value: String 9 | 10 | public var description: String { 11 | self.value 12 | } 13 | 14 | init(_ value: String) { 15 | self.value = value 16 | } 17 | 18 | ///The zooming is normal. 19 | public static var `normal`: Self { 20 | return .init("normal") 21 | } 22 | 23 | ///The zooming is reset. 24 | public static var `reset`: Self { 25 | return .init("reset") 26 | } 27 | 28 | ///A raw number. 29 | public static func `number`(_ number: Double) -> Self { 30 | return .init("\(number)%") 31 | } 32 | 33 | ///The image is a specific percentage of the element. 34 | public static func `percent`(_ percent: Int) -> Self { 35 | return .init("\(percent)%") 36 | } 37 | 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/SailorGlobal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SailorGlobal.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/8/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | /// Sailor Specific global environment 11 | enum SailorGlobal { 12 | /// global head page/element refrence in sailor 13 | static var headRef: (any Head)! = nil 14 | 15 | static func initialize(head: any Head) { 16 | Self.headRef = head 17 | 18 | RenderableUtils.build( 19 | page: headRef.content(), 20 | parent: Self.headRef 21 | ) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Targets/Website.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 12/30/23. 6 | // 7 | 8 | import Sailboat 9 | import SailorShared 10 | import JavaScriptKit 11 | 12 | #if os(WASI) 13 | import SailorWeb 14 | #endif 15 | 16 | public protocol Website: Page { 17 | static func main() 18 | 19 | associatedtype Body: Sailor.Body 20 | associatedtype Head: Sailor.Head 21 | 22 | var body: Body { get } 23 | var head: Head { get } 24 | 25 | init() 26 | } 27 | 28 | #if os(WASI) 29 | 30 | extension Website { 31 | public static func main() { 32 | JSNode.installGlobalExecutor() 33 | 34 | SailboatGlobal.initialize(SailorWebManager()) 35 | 36 | let mainPage = Self() 37 | let bodyElement = mainPage.body 38 | let headElement = mainPage.head 39 | 40 | //TODO: add with Sailboat 0.2.1 41 | //SailboatGlobal.initialize(body: bodyElement) 42 | SailboatGlobal.manager.build(page: bodyElement) 43 | 44 | SailorGlobal.initialize(head: headElement) 45 | 46 | // runs the onAppear event for the Body and Head 47 | if let bodyRenderer = bodyElement.renderer as? JSNode { 48 | bodyRenderer.shallowEnterEvents() 49 | } 50 | 51 | if let headRenderer = headElement.renderer as? JSNode { 52 | headRenderer.shallowEnterEvents() 53 | } 54 | } 55 | } 56 | 57 | #else 58 | 59 | extension Website { 60 | public static func main() { 61 | fatalError("To conform to Website your project must build to WASI") 62 | } 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onBlur.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | public func onBlur(_ completion: @escaping () -> Void) -> Self { 6 | var copy = self 7 | 8 | copy.events["blur"] = { _ in 9 | completion() 10 | } 11 | 12 | return copy 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onChange.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onChange(_ completion: @escaping (String) -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["change"] = { eventResult in 10 | if case let EventResult.string(value) = eventResult { 11 | completion(value) 12 | } 13 | } 14 | 15 | return copy 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onClick.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | // TODO: make all events like this 6 | public func onClick(_ completion: @escaping () -> Void) -> Self { 7 | withEvent(name: "click") { _ in 8 | completion() 9 | } 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onDoubleClick.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onDoubleClick(_ completion: @escaping () -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["doubleclick"] = { _ in 10 | completion() 11 | } 12 | 13 | return copy 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onFocus.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onFocus(_ completion: @escaping () -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["focus"] = { _ in 10 | completion() 11 | } 12 | 13 | return copy 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onKeyDown.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onKeyDown(_ completion: @escaping (String) -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["keydown"] = { eventResult in 10 | 11 | if case let EventResult.string(value) = eventResult { 12 | completion(value) 13 | } 14 | } 15 | 16 | return copy 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onKeyPress.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onKeyPress(_ completion: @escaping (String) -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["keypress"] = { eventResult in 10 | if case let EventResult.string(value) = eventResult { 11 | completion(value) 12 | } 13 | } 14 | 15 | return copy 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onKeyUp.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onKeyUp(_ completion: @escaping (String) -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["keyup"] = { eventResult in 10 | if case let EventResult.string(value) = eventResult { 11 | completion(value) 12 | } 13 | } 14 | 15 | return copy 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onMouseOut.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onMouseOut(_ completion: @escaping () -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["mouseout"] = { _ in 10 | completion() 11 | } 12 | 13 | return copy 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onMouseOver.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onMouseOver(_ completion: @escaping () -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["mouseover"] = { _ in 10 | completion() 11 | } 12 | 13 | return copy 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onScroll.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onScroll(_ completion: @escaping () -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["scroll"] = { _ in 10 | completion() 11 | } 12 | 13 | return copy 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/ToGenerate/Events/Page+onSubmit.swift: -------------------------------------------------------------------------------- 1 | // This file was autogenerated by Mustache. DO NOT CHANGE. 2 | import Sailboat 3 | 4 | extension Element { 5 | 6 | public func onSubmit(_ completion: @escaping () -> Void) -> Self { 7 | var copy = self 8 | 9 | copy.events["submit"] = { _ in 10 | completion() 11 | } 12 | 13 | return copy 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Sailor/Sources/Utils/Unit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Unit.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 10/6/23. 6 | // 7 | 8 | /// Units used as values for CSS properties 9 | public enum PropUnit { } 10 | 11 | /// Umbrella for all attributes+style units 12 | public enum Unit { } 13 | 14 | //public typealias Percent = Int 15 | 16 | // TODO: remove? 17 | // TODO: do i put description with percent? 18 | 19 | //public typealias Percent = Double 20 | public struct Percent: CustomStringConvertible, Equatable { 21 | public var description: String { 22 | "\(self.value)" // "\(self.value)%" 23 | } 24 | 25 | var value: Int 26 | 27 | // init(_ value: Double) { 28 | // self.value = Int(value * 100) 29 | // } 30 | 31 | public init(_ value: Int) { 32 | self.value = value 33 | } 34 | } 35 | 36 | enum Utils { 37 | public static func unwrapUnit(_ item: (any CustomStringConvertible)?) -> String { 38 | var output = "" 39 | 40 | if let item = item { 41 | output += item.description 42 | } 43 | 44 | return output 45 | } 46 | 47 | public static func when(_ cond: (Bool)?, ret value: String) -> String { 48 | var output = "" 49 | 50 | if let cond = cond, cond { 51 | output += value 52 | } 53 | 54 | return output 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Sources/SailorShared/Sources/AttributeValues.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/28/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | extension Int: AttributeValue { } 11 | extension String: AttributeValue { } 12 | extension Bool: AttributeValue { } 13 | extension Double: AttributeValue { } 14 | -------------------------------------------------------------------------------- /Sources/SailorShared/Sources/Promise.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 4/26/24. 6 | // 7 | 8 | public enum Promise { 9 | case success(ResponseType) 10 | case failure(any Error) 11 | } 12 | 13 | public enum FetchType: String { 14 | case get, post, patch, options, put, delete, head 15 | } 16 | -------------------------------------------------------------------------------- /Sources/SailorShared/Sources/SailorEnvironment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 3/13/24. 6 | // 7 | 8 | import Sailboat 9 | 10 | public protocol SailorEnvironment: SomeEnvironment { 11 | var url: String { get } 12 | 13 | init() 14 | } 15 | 16 | public struct EmptyEnvironment: SailorEnvironment { 17 | public var url: String { "/" } 18 | 19 | public init() { } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/SailorWeb/Sources/Events/EventResult+JSClosure.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EventResult+JSClosure.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 12/17/23. 6 | // 7 | 8 | import JavaScriptKit 9 | import Sailboat 10 | 11 | extension EventResult { 12 | 13 | static func getClosure(_ eventName: String, action: @escaping (EventResult) -> Void) -> JSClosure { 14 | JSClosure { event in 15 | SailboatGlobal.manager.eventScheduler.registerEvent() 16 | 17 | guard let firstEvent = event.first else { 18 | // TODO: error better 19 | fatalError("EVENT UPDATE FAILED") 20 | return .undefined 21 | } 22 | 23 | let resultValue = Self.getResultValue(eventName, firstEvent) 24 | 25 | 26 | action(resultValue) 27 | 28 | SailboatGlobal.manager.eventScheduler.update() 29 | 30 | return .undefined 31 | } 32 | } 33 | 34 | // TODO: return the values needed by which events as EventResults, nil if error? 35 | private static func getResultValue(_ eventName: String, _ eventJSValue: JSValue) -> EventResult { 36 | return resultMap[eventName]?(eventJSValue) ?? EventResult.none 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Sources/SailorWeb/Sources/JSNode/StringRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Page.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 10/5/23. 6 | // 7 | 8 | import Sailboat 9 | 10 | // TODO: this whole file make strings work as renderable elements 11 | 12 | public struct StringRenderer: Renderable { 13 | 14 | public var sailboatID: Sailboat.SailboatID? = nil 15 | 16 | public var value: String 17 | 18 | public init(_ value: String) { 19 | self.value = value 20 | } 21 | 22 | public func addToParent(_ parent: any Renderable) { 23 | guard let parentNode = parent as? JSNode else { return } 24 | 25 | parentNode.appendContent(text: self.value) 26 | } 27 | 28 | public func setSailboatID(_ value: SailboatID?) { } 29 | 30 | public func remove() { } 31 | 32 | public func remove(at deepIndex: Int) { } 33 | 34 | public func updateAttribute(name: String, value: any AttributeValue) { } 35 | 36 | public func addEvent(name: String, value: (EventResult) -> Void) { } 37 | 38 | public func insertAfter(_ deepIndex: Int, parent: any Renderable) { } 39 | 40 | public func insertBefore(_ deepIndex: Int, parent: any Renderable) { } 41 | 42 | public func replace(at: Int, with: any Renderable) { } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Sources/SailorWeb/Sources/WebManager/SailorWebManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 12/30/23. 6 | // 7 | 8 | import Sailboat 9 | 10 | public final class SailorWebManager: TargetManager { 11 | 12 | public init() { 13 | super.init(WebEventScheduler()) 14 | self.environment = WebEnvironment() 15 | 16 | // i dont know why i have to do this 17 | JSNode.body.innerHTML = .string("") 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Sources/SailorWeb/Sources/WebManager/WebEnvironment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 2/12/24. 6 | // 7 | 8 | import Sailboat 9 | import SailorShared 10 | import JavaScriptKit 11 | 12 | public final class WebEnvironment: SailorEnvironment { 13 | 14 | public var url: String { 15 | JSNode.window.location.object!.href.string! 16 | } 17 | 18 | public init() { 19 | // navigation = .init( 20 | // route: .defaultRoute, 21 | // assignRoute: { route in 22 | // let window = JSObject.global.window 23 | // let history = window.history.object! 24 | // 25 | // // Define the new URL you want to navigate to 26 | // let newUrl = Self.buildRoute(route) 27 | // 28 | // // Create an empty JavaScript object for the state 29 | // let stateObject = JSObject.global.Object.function!.new() 30 | // 31 | // // Define the title (even though browsers currently ignore this parameter) 32 | // let title = JSValue.string("") 33 | // 34 | // // Directly call `pushState` with the arguments 35 | // history.pushState?(stateObject, title, JSValue.string(newUrl)) 36 | // } 37 | // ) 38 | } 39 | 40 | //TODO: EDIT THIS 41 | // private static func buildRoute(_ route: MyRoutes) -> String { 42 | // 43 | // if route.description == "/" { 44 | // return "/" 45 | // } 46 | // 47 | // return "/\(route.description)" 48 | // } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Sources/SailorWeb/Sources/toGenerate/EventResult+ResultMap.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EventResult+ResultMap.swift 3 | // 4 | // 5 | // Created by Joshua Davis on 2/2/24. 6 | // 7 | 8 | import JavaScriptKit 9 | import Sailboat 10 | 11 | extension EventResult { 12 | 13 | //TODO: fix force unwrapping? 14 | static var resultMap: [String: (JSValue) -> EventResult] { 15 | [ 16 | "input:value": { EventResult.string($0.target.value.string!) }, 17 | "input:checked": { EventResult.bool($0.target.checked.boolean!) }, 18 | ] 19 | } 20 | 21 | } 22 | --------------------------------------------------------------------------------