diff --git a/core/esy.json b/core/esy.json index 9b3ad84..2d1f312 100644 --- a/core/esy.json +++ b/core/esy.json @@ -9,7 +9,7 @@ "@esy-ocaml/reason": ">=3.4.0", "@opam/color": "^0.2.0", "@opam/dune": "^1.7.2", - "flex": "^1.2.2", + "flex": "briskml/flex#7042e49", "ocaml": "~4.7.1000" } } diff --git a/core/lib/Layout.re b/core/lib/Layout.re index 3d377e8..f414e5d 100644 --- a/core/lib/Layout.re +++ b/core/lib/Layout.re @@ -76,7 +76,7 @@ module Create = (Node: Flex.Spec.Node, Encoding: Flex.Spec.Encoding) => { | `CharWrap | `Clip | `TruncateHead - | `TruncateTale + | `TruncateTail | `TruncateMiddle ]; @@ -257,47 +257,47 @@ module Create = (Node: Flex.Spec.Node, Encoding: Flex.Spec.Encoding) => { { ...style, positionType, - left: !isUndefined(left) ? int_of_scalar(left) : style.left, - top: !isUndefined(top) ? int_of_scalar(top) : style.top, - right: !isUndefined(right) ? int_of_scalar(right) : style.right, - bottom: !isUndefined(bottom) ? int_of_scalar(bottom) : style.bottom, + left: !isUndefined(left) ? left : style.left, + top: !isUndefined(top) ? top : style.top, + right: !isUndefined(right) ? right : style.right, + bottom: !isUndefined(bottom) ? bottom : style.bottom, }; - | `Flex(f) => {...style, flex: int_of_scalar(f)} + | `Flex(flex) => {...style, flex} | `FlexDirection(flexDirection) => {...style, flexDirection} - | `FlexGrow(f) => {...style, flexGrow: int_of_scalar(f)} - | `FlexShrink(f) => {...style, flexShrink: int_of_scalar(f)} - | `FlexBasis(f) => {...style, flexBasis: int_of_scalar(f)} + | `FlexGrow(flexGrow) => {...style, flexGrow} + | `FlexShrink(flexShrink) => {...style, flexShrink} + | `FlexBasis(flexBasis) => {...style, flexBasis} | `JustifyContent(justifyContent) => {...style, justifyContent} | `AlignContent(alignContent) => {...style, alignContent} | `AlignItems(alignItems) => {...style, alignItems} | `AlignSelf(alignSelf) => {...style, alignSelf} - | `Width(w) => {...style, width: int_of_scalar(w)} - | `Height(h) => {...style, height: int_of_scalar(h)} + | `Width(w) => {...style, width: w} + | `Height(h) => {...style, height: h} | `Overflow(overflow) => {...style, overflow} | `Border({Border.width, _}) => { ...style, - border: !isUndefined(width) ? int_of_scalar(width) : style.border, + border: !isUndefined(width) ? width : style.border, } | `Padding({left, top, right, bottom}) => { ...style, paddingLeft: - !isUndefined(left) ? int_of_scalar(left) : style.paddingLeft, + !isUndefined(left) ? left : style.paddingLeft, paddingTop: - !isUndefined(top) ? int_of_scalar(top) : style.paddingTop, + !isUndefined(top) ? top : style.paddingTop, paddingRight: - !isUndefined(right) ? int_of_scalar(right) : style.paddingRight, + !isUndefined(right) ? right : style.paddingRight, paddingBottom: - !isUndefined(bottom) ? int_of_scalar(bottom) : style.paddingBottom, + !isUndefined(bottom) ? bottom : style.paddingBottom, } | `Margin({left, top, right, bottom}) => { ...style, marginLeft: - !isUndefined(left) ? int_of_scalar(left) : style.marginLeft, - marginTop: !isUndefined(top) ? int_of_scalar(top) : style.marginTop, + !isUndefined(left) ? left : style.marginLeft, + marginTop: !isUndefined(top) ? top : style.marginTop, marginRight: - !isUndefined(right) ? int_of_scalar(right) : style.marginRight, + !isUndefined(right) ? right : style.marginRight, marginBottom: - !isUndefined(bottom) ? int_of_scalar(bottom) : style.marginBottom, + !isUndefined(bottom) ? bottom : style.marginBottom, } | _ => style }; @@ -367,4 +367,10 @@ module Create = (Node: Flex.Spec.Node, Encoding: Flex.Spec.Encoding) => { markDirtyInternal(node); }; }; + + let get0IfUndefined = x => { + isUndefined(x) ? Encoding.zero : x; + } + + let cssUndefined = Encoding.cssUndefined; }; diff --git a/examples/hacker-news/app/TopStories.re b/examples/hacker-news/app/TopStories.re index 64c83be..28645d4 100644 --- a/examples/hacker-news/app/TopStories.re +++ b/examples/hacker-news/app/TopStories.re @@ -93,11 +93,12 @@ let story = style=[ alignItems(`Center), flexDirection(`Row), - position(~top=0., ~bottom=0., ~left=0., ~right=0., `Absolute), ]> ...{ diff --git a/examples/hacker-news/designs/macos.sketch b/examples/hacker-news/designs/macos.sketch index b710155..dfae4c0 100644 Binary files a/examples/hacker-news/designs/macos.sketch and b/examples/hacker-news/designs/macos.sketch differ diff --git a/examples/hacker-news/esy.json b/examples/hacker-news/esy.json index ccdd6d2..204ec47 100644 --- a/examples/hacker-news/esy.json +++ b/examples/hacker-news/esy.json @@ -10,7 +10,8 @@ "clean": "dune clean", "bundle": "dune build @bundle --only-packages hacker-news --root . --no-buffer --force", "run": "dune build @run --only-packages hacker-news --root . --no-buffer --force", - "watch": "esy run --watch" + "watch": "esy run --watch", + "open-xcode": "open ./_build/default/macos_app_bundle/project.xcodeproj" }, "dependencies": { "@esy-ocaml/reason": ">=3.4.0", diff --git a/examples/hacker-news/esy.lock/index.json b/examples/hacker-news/esy.lock/index.json index cd5d0a3..cc375fa 100644 --- a/examples/hacker-news/esy.lock/index.json +++ b/examples/hacker-news/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "daedea0257a71571a95ce5b57b5669a0", + "checksum": "acf416df4c806ea965166c27fd78a73a", "root": "hacker-news@link-dev:./esy.json", "node": { "xcpretty@0.2.8001@d41d8cd9": { @@ -30,23 +30,6 @@ "dependencies": [], "devDependencies": [] }, - "refmterr@3.1.10@d41d8cd9": { - "id": "refmterr@3.1.10@d41d8cd9", - "name": "refmterr", - "version": "3.1.10", - "source": { - "type": "install", - "source": [ - "archive:https://registry.npmjs.org/refmterr/-/refmterr-3.1.10.tgz#sha1:7c3e238022acb5de4e2254ab506d70eee13c0a46" - ] - }, - "overrides": [], - "dependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/re@opam:1.8.0@7baac1a7", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/reason@3.4.0@d41d8cd9" - ], - "devDependencies": [] - }, "pkg-config@archive:https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz#sha1:76e501663b29cb7580245720edfb6106164fad2b@6c89142d": { "id": "pkg-config@archive:https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz#sha1:76e501663b29cb7580245720edfb6106164fad2b@6c89142d", @@ -87,7 +70,7 @@ "ocaml@4.7.1004@d41d8cd9", "graphql_ppx@github:briskml/graphql_ppx#ee86d23@d41d8cd9", "@opam/httpkit-lwt@github:ostera/httpkit:httpkit-lwt.opam#5fd8ed4@d41d8cd9", - "@opam/dune@opam:1.7.3@72aad784", + "@opam/dune@opam:1.8.2@511996a8", "@opam/core_kernel@opam:v0.11.1@6a321198", "@esy-ocaml/reason@3.4.0@d41d8cd9", "@brisk/macos@link:../../renderer-macos" @@ -111,7 +94,7 @@ "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ppx_tools_versioned@opam:5.2.1@95275a75", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/dune@opam:1.7.3@72aad784" + "@opam/dune@opam:1.8.2@511996a8" ], "devDependencies": [] }, @@ -127,19 +110,17 @@ "dependencies": [], "devDependencies": [] }, - "flex@1.2.2@d41d8cd9": { - "id": "flex@1.2.2@d41d8cd9", + "flex@github:briskml/flex#7042e49@d41d8cd9": { + "id": "flex@github:briskml/flex#7042e49@d41d8cd9", "name": "flex", - "version": "1.2.2", + "version": "github:briskml/flex#7042e49", "source": { "type": "install", - "source": [ - "archive:https://registry.npmjs.org/flex/-/flex-1.2.2.tgz#sha1:6b46058d8c909f9ec1ece18ed21b28ae5e611b3e" - ] + "source": [ "github:briskml/flex#7042e49" ] }, "overrides": [], "dependencies": [ - "refmterr@3.1.10@d41d8cd9", "@opam/dune@opam:1.7.3@72aad784", + "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/reason@3.4.0@d41d8cd9" ], "devDependencies": [] @@ -155,7 +136,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.7.3@72aad784", + "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/reason@3.4.0@d41d8cd9" ], "devDependencies": [] @@ -195,7 +176,7 @@ "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/easy-format@opam:1.3.1@9abfd4ed", - "@opam/dune@opam:1.7.3@72aad784", "@opam/cppo@opam:1.6.5@bec3dbd9", + "@opam/dune@opam:1.8.2@511996a8", "@opam/cppo@opam:1.6.5@bec3dbd9", "@opam/biniou@opam:1.2.0@c8516f18", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], @@ -228,8 +209,8 @@ "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ocamlfind@opam:1.8.0@96572762", "@opam/ocamlbuild@opam:0.14.0@427a2331", - "@opam/nocrypto@opam:0.5.4-1@2b56b844", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/nocrypto@opam:0.5.4-1@e49893e8", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@opam/astring@opam:0.8.3@4e5e17d5", "@opam/asn1-combinators@opam:0.2.0@80d14b72", "@esy-ocaml/substs@0.0.1@d41d8cd9" @@ -238,8 +219,8 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/sexplib@opam:v0.11.0@bf5282c9", "@opam/result@opam:1.3@bee8bf2e", "@opam/ptime@opam:0.8.4@23eca65b", "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", - "@opam/nocrypto@opam:0.5.4-1@2b56b844", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/nocrypto@opam:0.5.4-1@e49893e8", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@opam/astring@opam:0.8.3@4e5e17d5", "@opam/asn1-combinators@opam:0.2.0@80d14b72" ] @@ -265,13 +246,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/uri@opam:2.2.0@dfca6d0f": { @@ -296,7 +277,7 @@ "@opam/sexplib0@opam:v0.11.0@9df6bcd1", "@opam/re@opam:1.8.0@7baac1a7", "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/stringext@opam:1.5.0@fc7e81d0", @@ -346,11 +327,11 @@ "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/base@opam:v0.11.1@0e54024e" + "ocaml@4.7.1004@d41d8cd9", "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/topkg@opam:1.0.0@61f4ccf9": { @@ -405,11 +386,11 @@ "@opam/result@opam:1.3@bee8bf2e", "@opam/ptime@opam:0.8.4@23eca65b", "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ppx_deriving@opam:4.2.1@7927b93a", - "@opam/ppx_cstruct@opam:3.6.0@83000559", + "@opam/ppx_cstruct@opam:3.7.0@ccfa584a", "@opam/ocamlfind@opam:1.8.0@96572762", "@opam/ocamlbuild@opam:0.14.0@427a2331", - "@opam/nocrypto@opam:0.5.4-1@2b56b844", - "@opam/lwt@opam:4.1.0@111fc2bf", "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/nocrypto@opam:0.5.4-1@e49893e8", + "@opam/lwt@opam:4.1.0@111fc2bf", "@opam/cstruct@opam:3.7.0@c00c7ad0", "@opam/astring@opam:0.8.3@4e5e17d5", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], @@ -419,9 +400,9 @@ "@opam/result@opam:1.3@bee8bf2e", "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ppx_deriving@opam:4.2.1@7927b93a", - "@opam/ppx_cstruct@opam:3.6.0@83000559", - "@opam/nocrypto@opam:0.5.4-1@2b56b844", - "@opam/cstruct@opam:3.3.0@5c8efef5" + "@opam/ppx_cstruct@opam:3.7.0@ccfa584a", + "@opam/nocrypto@opam:0.5.4-1@e49893e8", + "@opam/cstruct@opam:3.7.0@c00c7ad0" ] }, "@opam/stringext@opam:1.5.0@fc7e81d0": { @@ -469,11 +450,11 @@ "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/base@opam:v0.11.1@0e54024e" + "ocaml@4.7.1004@d41d8cd9", "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/splittable_random@opam:v0.11.0@6178cb9b": { @@ -497,13 +478,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppx_jane@opam:v0.11.0@687c4174", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppx_jane@opam:v0.11.0@687c4174", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/sexplib0@opam:v0.11.0@9df6bcd1": { @@ -622,7 +603,7 @@ "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/merlin-extend@opam:0.3@e1fc0d08", "@opam/menhir@opam:20181113@0c8257a8", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", @@ -707,7 +688,7 @@ "@opam/ppx_derivers@opam:1.0@78655ff8", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/ocaml-compiler-libs@opam:v0.11.0@7e9ced39", - "@opam/dune@opam:1.7.3@72aad784", "@opam/base@opam:v0.11.1@0e54024e", + "@opam/dune@opam:1.8.2@511996a8", "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -715,7 +696,7 @@ "@opam/ppx_derivers@opam:1.0@78655ff8", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/ocaml-compiler-libs@opam:v0.11.0@7e9ced39", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_variants_conv@opam:v0.11.1@32a56a8b": { @@ -740,14 +721,14 @@ "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/variantslib@opam:v0.11.0@141b8c3e", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_typerep_conv@opam:v0.11.1@07b7be7b": { @@ -772,14 +753,14 @@ "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/typerep@opam:v0.11.0@625676b6", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_tools_versioned@opam:5.2.1@95275a75": { @@ -858,7 +839,7 @@ "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -866,7 +847,7 @@ "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_sexp_message@opam:v0.11.0@86d53252": { @@ -892,7 +873,7 @@ "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -900,7 +881,7 @@ "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527": { @@ -924,13 +905,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_pipebang@opam:v0.11.0@adfd2eed": { @@ -982,13 +963,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_optcomp@opam:v0.11.0@9902d319": { @@ -1012,13 +993,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", "@opam/ppxlib@opam:0.5.0@674193ca", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_let@opam:v0.11.0@15f51b1c": { @@ -1042,13 +1023,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_js_style@opam:v0.11.0@4112bf88": { @@ -1073,14 +1054,14 @@ "@opam/octavius@opam:1.2.0@4840f5a0", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/octavius@opam:1.2.0@4840f5a0", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_jane@opam:v0.11.0@687c4174": { @@ -1168,13 +1149,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_here@opam:v0.11.0@c36c7116": { @@ -1198,13 +1179,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_hash@opam:v0.11.1@789e28d0": { @@ -1230,7 +1211,7 @@ "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -1238,7 +1219,7 @@ "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_fields_conv@opam:v0.11.0@13fd6109": { @@ -1263,14 +1244,14 @@ "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", "@opam/fieldslib@opam:v0.11.0@c86ba0e6", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/fieldslib@opam:v0.11.0@c86ba0e6", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_fail@opam:v0.11.0@01e1101f": { @@ -1295,14 +1276,14 @@ "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_expect@opam:v0.11.1@406d6035": { @@ -1335,7 +1316,7 @@ "@opam/ppx_assert@opam:v0.11.0@7cb8e43d", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -1350,7 +1331,7 @@ "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ppx_assert@opam:v0.11.0@7cb8e43d", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_enumerate@opam:v0.11.1@8ec456b6": { @@ -1374,13 +1355,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_deriving@opam:4.2.1@7927b93a": { @@ -1467,30 +1448,30 @@ "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ppx_sexp_conv@opam:v0.11.2@6626e527", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, - "@opam/ppx_cstruct@opam:3.6.0@83000559": { - "id": "@opam/ppx_cstruct@opam:3.6.0@83000559", + "@opam/ppx_cstruct@opam:3.7.0@ccfa584a": { + "id": "@opam/ppx_cstruct@opam:3.7.0@ccfa584a", "name": "@opam/ppx_cstruct", - "version": "opam:3.6.0", + "version": "opam:3.7.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/fa/fa3ab5c5029dcab94fac95c3eceb4198#md5:fa3ab5c5029dcab94fac95c3eceb4198", - "archive:https://github.com/mirage/ocaml-cstruct/releases/download/v3.6.0/cstruct-v3.6.0.tbz#md5:fa3ab5c5029dcab94fac95c3eceb4198" + "archive:https://opam.ocaml.org/cache/md5/60/60a83c96f5871a3caae091fd116f4f24#md5:60a83c96f5871a3caae091fd116f4f24", + "archive:https://github.com/mirage/ocaml-cstruct/releases/download/v3.7.0/cstruct-v3.7.0.tbz#md5:60a83c96f5871a3caae091fd116f4f24" ], "opam": { "name": "ppx_cstruct", - "version": "3.6.0", - "path": "esy.lock/opam/ppx_cstruct.3.6.0" + "version": "3.7.0", + "path": "esy.lock/opam/ppx_cstruct.3.7.0" } }, "overrides": [], @@ -1498,15 +1479,15 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppx_tools_versioned@opam:5.2.1@95275a75", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/dune@opam:1.7.3@72aad784", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/dune@opam:1.8.2@511996a8", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppx_tools_versioned@opam:5.2.1@95275a75", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/cstruct@opam:3.3.0@5c8efef5" + "@opam/cstruct@opam:3.7.0@c00c7ad0" ] }, "@opam/ppx_compare@opam:v0.11.1@9ddf10ff": { @@ -1530,13 +1511,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_bin_prot@opam:v0.11.1@add13090": { @@ -1562,7 +1543,7 @@ "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", "@opam/bin_prot@opam:v0.11.0@7a071ede", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -1570,7 +1551,7 @@ "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/bin_prot@opam:v0.11.0@7a071ede", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/ppx_bench@opam:v0.11.0@8961e4af": { @@ -1665,7 +1646,7 @@ "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -1674,7 +1655,7 @@ "@opam/ppx_here@opam:v0.11.0@c36c7116", "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/parsexp@opam:v0.11.0@7febd99d": { @@ -1787,7 +1768,7 @@ } ], "dependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/conf-m4@opam:1@3279850f", + "ocaml@4.7.1004@d41d8cd9", "@opam/conf-m4@opam:1@dd7dde42", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9" ] @@ -1839,7 +1820,7 @@ "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", "@opam/ppx_derivers@opam:1.0@78655ff8", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", @@ -1897,8 +1878,8 @@ ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9" ] }, - "@opam/nocrypto@opam:0.5.4-1@2b56b844": { - "id": "@opam/nocrypto@opam:0.5.4-1@2b56b844", + "@opam/nocrypto@opam:0.5.4-1@e49893e8": { + "id": "@opam/nocrypto@opam:0.5.4-1@e49893e8", "name": "@opam/nocrypto", "version": "opam:0.5.4-1", "source": { @@ -1927,8 +1908,8 @@ "@opam/mirage-no-xen@opam:1@953da806", "@opam/mirage-no-solo5@opam:1@f4472686", "@opam/lwt@opam:4.1.0@111fc2bf", - "@opam/cstruct-lwt@opam:3.6.0@059bf7a5", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/cstruct-lwt@opam:3.7.0@bb09f052", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@opam/cpuid@opam:0.1.1@0f367cdc", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -1940,8 +1921,8 @@ "@opam/mirage-no-xen@opam:1@953da806", "@opam/mirage-no-solo5@opam:1@f4472686", "@opam/lwt@opam:4.1.0@111fc2bf", - "@opam/cstruct-lwt@opam:3.6.0@059bf7a5", - "@opam/cstruct@opam:3.3.0@5c8efef5" + "@opam/cstruct-lwt@opam:3.7.0@bb09f052", + "@opam/cstruct@opam:3.7.0@c00c7ad0" ] }, "@opam/mirage-no-xen@opam:1@953da806": { @@ -2030,7 +2011,7 @@ "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/yojson@opam:1.7.0@2d92307e", "@opam/ocamlfind@opam:1.8.0@96572762", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/yojson@opam:1.7.0@2d92307e", @@ -2167,11 +2148,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.7.3@72aad784", + "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.7.3@72aad784" + "ocaml@4.7.1004@d41d8cd9", "@opam/dune@opam:1.8.2@511996a8" ] }, "@opam/jane-street-headers@opam:v0.11.0@f1cada02": { @@ -2211,7 +2192,7 @@ "@opam/reason@opam:3.4.0@9dac40ad", "@opam/lwt@opam:4.1.0@111fc2bf", "@opam/httpkit@github:ostera/httpkit:httpkit.opam#5fd8ed4@d41d8cd9", "@opam/httpaf-lwt@github:anmonteiro/httpaf:httpaf-lwt.opam#57e9dd2@d41d8cd9", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "@opam/lwt@opam:4.1.0@111fc2bf", @@ -2234,7 +2215,7 @@ "@opam/reason@opam:3.4.0@9dac40ad", "@opam/logs@opam:0.6.2@8f7a792d", "@opam/httpaf@github:anmonteiro/httpaf:httpaf.opam#57e9dd2@d41d8cd9", "@opam/fpath@opam:0.7.2@45477b93", "@opam/fmt@opam:0.8.5@01e38a4e", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "@opam/uri@opam:2.2.0@dfca6d0f", "@opam/tls@opam:0.10.1@b7d46b33", @@ -2257,7 +2238,7 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/lwt@opam:4.1.0@111fc2bf", "@opam/httpaf@github:anmonteiro/httpaf:httpaf.opam#57e9dd2@d41d8cd9", "@opam/faraday-lwt-unix@opam:0.7.0@b0dea04f", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/lwt@opam:4.1.0@111fc2bf", @@ -2278,14 +2259,14 @@ "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", "@opam/faraday@opam:0.7.0@6026a81f", - "@opam/dune@opam:1.7.3@72aad784", - "@opam/angstrom@opam:0.11.0@5a31b68d", + "@opam/dune@opam:1.8.2@511996a8", + "@opam/angstrom@opam:0.11.1@86534504", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", "@opam/faraday@opam:0.7.0@6026a81f", - "@opam/angstrom@opam:0.11.0@5a31b68d" + "@opam/angstrom@opam:0.11.1@86534504" ] }, "@opam/gg@opam:0.9.3@063e5657": { @@ -2397,13 +2378,13 @@ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/ppxlib@opam:0.5.0@674193ca", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/faraday-lwt-unix@opam:0.7.0@b0dea04f": { @@ -2513,26 +2494,26 @@ ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9" ] }, - "@opam/dune@opam:1.7.3@72aad784": { - "id": "@opam/dune@opam:1.7.3@72aad784", + "@opam/dune@opam:1.8.2@511996a8": { + "id": "@opam/dune@opam:1.8.2@511996a8", "name": "@opam/dune", - "version": "opam:1.7.3", + "version": "opam:1.8.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/64/644f0c1419d70b9daccac4b4e5664523#md5:644f0c1419d70b9daccac4b4e5664523", - "archive:https://github.com/ocaml/dune/releases/download/1.7.3/dune-1.7.3.tbz#md5:644f0c1419d70b9daccac4b4e5664523" + "archive:https://opam.ocaml.org/cache/md5/2b/2b7f45a6e14865f2318d34f12221ec1e#md5:2b7f45a6e14865f2318d34f12221ec1e", + "archive:https://github.com/ocaml/dune/releases/download/1.8.2/dune-1.8.2.tbz#md5:2b7f45a6e14865f2318d34f12221ec1e" ], "opam": { "name": "dune", - "version": "1.7.3", - "path": "esy.lock/opam/dune.1.7.3" + "version": "1.8.2", + "path": "esy.lock/opam/dune.1.8.2" } }, "overrides": [ { "opamoverride": - "esy.lock/overrides/opam__s__dune_opam__c__1.7.3_opam_override" + "esy.lock/overrides/opam__s__dune_opam__c__1.8.2_opam_override" } ], "dependencies": [ @@ -2545,56 +2526,56 @@ "@opam/base-threads@opam:base@36803084" ] }, - "@opam/cstruct-lwt@opam:3.6.0@059bf7a5": { - "id": "@opam/cstruct-lwt@opam:3.6.0@059bf7a5", + "@opam/cstruct-lwt@opam:3.7.0@bb09f052": { + "id": "@opam/cstruct-lwt@opam:3.7.0@bb09f052", "name": "@opam/cstruct-lwt", - "version": "opam:3.6.0", + "version": "opam:3.7.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/fa/fa3ab5c5029dcab94fac95c3eceb4198#md5:fa3ab5c5029dcab94fac95c3eceb4198", - "archive:https://github.com/mirage/ocaml-cstruct/releases/download/v3.6.0/cstruct-v3.6.0.tbz#md5:fa3ab5c5029dcab94fac95c3eceb4198" + "archive:https://opam.ocaml.org/cache/md5/60/60a83c96f5871a3caae091fd116f4f24#md5:60a83c96f5871a3caae091fd116f4f24", + "archive:https://github.com/mirage/ocaml-cstruct/releases/download/v3.7.0/cstruct-v3.7.0.tbz#md5:60a83c96f5871a3caae091fd116f4f24" ], "opam": { "name": "cstruct-lwt", - "version": "3.6.0", - "path": "esy.lock/opam/cstruct-lwt.3.6.0" + "version": "3.7.0", + "path": "esy.lock/opam/cstruct-lwt.3.7.0" } }, "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/lwt@opam:4.1.0@111fc2bf", - "@opam/dune@opam:1.7.3@72aad784", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/dune@opam:1.8.2@511996a8", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/lwt@opam:4.1.0@111fc2bf", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@opam/base-unix@opam:base@87d0b2eb" ] }, - "@opam/cstruct@opam:3.3.0@5c8efef5": { - "id": "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/cstruct@opam:3.7.0@c00c7ad0": { + "id": "@opam/cstruct@opam:3.7.0@c00c7ad0", "name": "@opam/cstruct", - "version": "opam:3.3.0", + "version": "opam:3.7.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/74/7451389f3941d938575f8887c55c5e6b#md5:7451389f3941d938575f8887c55c5e6b", - "archive:https://github.com/mirage/ocaml-cstruct/releases/download/v3.3.0/cstruct-v3.3.0.tbz#md5:7451389f3941d938575f8887c55c5e6b" + "archive:https://opam.ocaml.org/cache/md5/60/60a83c96f5871a3caae091fd116f4f24#md5:60a83c96f5871a3caae091fd116f4f24", + "archive:https://github.com/mirage/ocaml-cstruct/releases/download/v3.7.0/cstruct-v3.7.0.tbz#md5:60a83c96f5871a3caae091fd116f4f24" ], "opam": { "name": "cstruct", - "version": "3.3.0", - "path": "esy.lock/opam/cstruct.3.3.0" + "version": "3.7.0", + "path": "esy.lock/opam/cstruct.3.7.0" } }, "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/sexplib@opam:v0.11.0@bf5282c9", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/sexplib@opam:v0.11.0@bf5282c9" @@ -2725,7 +2706,7 @@ "@opam/fieldslib@opam:v0.11.0@c86ba0e6", "@opam/configurator@opam:v0.11.0@28a27c04", "@opam/bin_prot@opam:v0.11.0@7a071ede", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -2746,7 +2727,7 @@ "@opam/fieldslib@opam:v0.11.0@c86ba0e6", "@opam/configurator@opam:v0.11.0@28a27c04", "@opam/bin_prot@opam:v0.11.0@7a071ede", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/configurator@opam:v0.11.0@28a27c04": { @@ -2769,16 +2750,16 @@ "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/stdio@opam:v0.11.0@3b11cb88", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, - "@opam/conf-which@opam:1@1da7b8cf": { - "id": "@opam/conf-which@opam:1@1da7b8cf", + "@opam/conf-which@opam:1@56319cdb": { + "id": "@opam/conf-which@opam:1@56319cdb", "name": "@opam/conf-which", "version": "opam:1", "source": { @@ -2794,8 +2775,8 @@ "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [] }, - "@opam/conf-m4@opam:1@3279850f": { - "id": "@opam/conf-m4@opam:1@3279850f", + "@opam/conf-m4@opam:1@dd7dde42": { + "id": "@opam/conf-m4@opam:1@dd7dde42", "name": "@opam/conf-m4", "version": "opam:1", "source": { @@ -2830,7 +2811,7 @@ "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/gg@opam:0.9.3@063e5657", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/gg@opam:0.9.3@063e5657" @@ -2856,7 +2837,7 @@ "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/jbuilder@opam:transition@58bdfe0a", "@opam/easy-format@opam:1.3.1@9abfd4ed", - "@opam/conf-which@opam:1@1da7b8cf", + "@opam/conf-which@opam:1@56319cdb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -2889,7 +2870,7 @@ "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/jbuilder@opam:transition@58bdfe0a", - "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ @@ -2900,7 +2881,7 @@ "@opam/ppx_custom_printf@opam:v0.11.0@5af4e646", "@opam/ppx_compare@opam:v0.11.1@9ddf10ff", "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", - "@opam/base@opam:v0.11.1@0e54024e" + "@opam/base@opam:v0.11.1@6ff71eb3" ] }, "@opam/bigstringaf@opam:0.4.0@b3f409bd": { @@ -3002,8 +2983,8 @@ "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [] }, - "@opam/base@opam:v0.11.1@0e54024e": { - "id": "@opam/base@opam:v0.11.1@0e54024e", + "@opam/base@opam:v0.11.1@6ff71eb3": { + "id": "@opam/base@opam:v0.11.1@6ff71eb3", "name": "@opam/base", "version": "opam:v0.11.1", "source": { @@ -3085,36 +3066,36 @@ "@opam/ptime@opam:0.8.4@23eca65b", "@opam/ocamlfind@opam:1.8.0@96572762", "@opam/ocamlbuild@opam:0.14.0@427a2331", - "@opam/cstruct@opam:3.3.0@5c8efef5", + "@opam/cstruct@opam:3.7.0@c00c7ad0", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/zarith@github:briskml/zarith#3fe8bfc@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", "@opam/ptime@opam:0.8.4@23eca65b", - "@opam/cstruct@opam:3.3.0@5c8efef5" + "@opam/cstruct@opam:3.7.0@c00c7ad0" ] }, - "@opam/angstrom@opam:0.11.0@5a31b68d": { - "id": "@opam/angstrom@opam:0.11.0@5a31b68d", + "@opam/angstrom@opam:0.11.1@86534504": { + "id": "@opam/angstrom@opam:0.11.1@86534504", "name": "@opam/angstrom", - "version": "opam:0.11.0", + "version": "opam:0.11.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/f2/f28ef135ecf1c7b5683d9d482528699a#md5:f28ef135ecf1c7b5683d9d482528699a", - "archive:https://github.com/inhabitedtype/angstrom/archive/0.11.0.tar.gz#md5:f28ef135ecf1c7b5683d9d482528699a" + "archive:https://opam.ocaml.org/cache/md5/63/6328fb3422191cbbe58ca87556d2b42b#md5:6328fb3422191cbbe58ca87556d2b42b", + "archive:https://github.com/inhabitedtype/angstrom/archive/0.11.1.tar.gz#md5:6328fb3422191cbbe58ca87556d2b42b" ], "opam": { "name": "angstrom", - "version": "0.11.0", - "path": "esy.lock/opam/angstrom.0.11.0" + "version": "0.11.1", + "path": "esy.lock/opam/angstrom.0.11.1" } }, "overrides": [], "dependencies": [ "ocaml@4.7.1004@d41d8cd9", "@opam/result@opam:1.3@bee8bf2e", - "@opam/jbuilder@opam:transition@58bdfe0a", + "@opam/dune@opam:1.8.2@511996a8", "@opam/bigstringaf@opam:0.4.0@b3f409bd", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], @@ -3154,7 +3135,7 @@ "@opam/ocaml-migrate-parsetree@opam:1.2.0@5b3aa0d3", "@opam/merlin-extend@opam:0.3@e1fc0d08", "@opam/menhir@opam:20181113@0c8257a8", - "@opam/dune@opam:1.7.3@72aad784" + "@opam/dune@opam:1.8.2@511996a8" ], "devDependencies": [] }, @@ -3200,7 +3181,7 @@ "ocaml@4.7.1004@d41d8cd9", "brisk-reconciler@github:briskml/brisk-reconciler#be325c5@d41d8cd9", "@opam/lwt_ppx@opam:1.2.1@db1172a7", "@opam/lwt@opam:4.1.0@111fc2bf", - "@opam/dune@opam:1.7.3@72aad784", "@esy-ocaml/reason@3.4.0@d41d8cd9", + "@opam/dune@opam:1.8.2@511996a8", "@esy-ocaml/reason@3.4.0@d41d8cd9", "@brisk/core@link:../../core" ], "devDependencies": [] @@ -3212,8 +3193,9 @@ "source": { "type": "link", "path": "../../core" }, "overrides": [], "dependencies": [ - "ocaml@4.7.1004@d41d8cd9", "flex@1.2.2@d41d8cd9", - "@opam/dune@opam:1.7.3@72aad784", "@opam/color@opam:0.2.0@8ef09171", + "ocaml@4.7.1004@d41d8cd9", + "flex@github:briskml/flex#7042e49@d41d8cd9", + "@opam/dune@opam:1.8.2@511996a8", "@opam/color@opam:0.2.0@8ef09171", "@esy-ocaml/reason@3.4.0@d41d8cd9" ], "devDependencies": [] diff --git a/examples/hacker-news/esy.lock/opam/angstrom.0.11.0/opam b/examples/hacker-news/esy.lock/opam/angstrom.0.11.1/opam similarity index 78% rename from examples/hacker-news/esy.lock/opam/angstrom.0.11.0/opam rename to examples/hacker-news/esy.lock/opam/angstrom.0.11.1/opam index 77397d7..f3c7806 100644 --- a/examples/hacker-news/esy.lock/opam/angstrom.0.11.0/opam +++ b/examples/hacker-news/esy.lock/opam/angstrom.0.11.1/opam @@ -6,13 +6,13 @@ homepage: "https://github.com/inhabitedtype/angstrom" bug-reports: "https://github.com/inhabitedtype/angstrom/issues" dev-repo: "git+https://github.com/inhabitedtype/angstrom.git" build: [ - ["jbuilder" "subst" "-p" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] - ["jbuilder" "runtest" "-p" name] {with-test} + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ "ocaml" {>= "4.03.0"} - "jbuilder" {build & >= "1.0+beta10"} + "dune" {build & >= "1.0"} "alcotest" {with-test & >= "0.8.1"} "bigstringaf" "result" @@ -27,6 +27,6 @@ give the user total control over the blocking behavior of their application, with the unbuffered interface enabling zero-copy IO. Parsers are backtracking by default and support unbounded lookahead.""" url { - src: "https://github.com/inhabitedtype/angstrom/archive/0.11.0.tar.gz" - checksum: "md5=f28ef135ecf1c7b5683d9d482528699a" + src: "https://github.com/inhabitedtype/angstrom/archive/0.11.1.tar.gz" + checksum: "md5=6328fb3422191cbbe58ca87556d2b42b" } diff --git a/examples/hacker-news/esy.lock/opam/base.v0.11.1/opam b/examples/hacker-news/esy.lock/opam/base.v0.11.1/opam index 19b6ae9..67b922a 100644 --- a/examples/hacker-news/esy.lock/opam/base.v0.11.1/opam +++ b/examples/hacker-news/esy.lock/opam/base.v0.11.1/opam @@ -9,7 +9,7 @@ build: [ ["jbuilder" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.04.1"} + "ocaml" {>= "4.04.1" & < "4.08.0"} "sexplib0" {>= "v0.11" & < "v0.12"} "jbuilder" {build & >= "1.0+beta18.1"} ] diff --git a/examples/hacker-news/esy.lock/opam/conf-m4.1/opam b/examples/hacker-news/esy.lock/opam/conf-m4.1/opam index 8f2f90d..981e702 100644 --- a/examples/hacker-news/esy.lock/opam/conf-m4.1/opam +++ b/examples/hacker-news/esy.lock/opam/conf-m4.1/opam @@ -14,8 +14,8 @@ depexts: [ ["m4"] {os-distribution = "alpine"} ["m4"] {os-distribution = "nixos"} ["m4"] {os-family = "suse"} - ["m4"] {os-distribution = "oraclelinux"} - ["m4"] {os-distribution = "archlinux"} + ["m4"] {os-distribution = "ol"} + ["m4"] {os-distribution = "arch"} ] synopsis: "Virtual package relying on m4" description: diff --git a/examples/hacker-news/esy.lock/opam/conf-which.1/opam b/examples/hacker-news/esy.lock/opam/conf-which.1/opam index be5f74b..802239a 100644 --- a/examples/hacker-news/esy.lock/opam/conf-which.1/opam +++ b/examples/hacker-news/esy.lock/opam/conf-which.1/opam @@ -12,7 +12,7 @@ depexts: [ ["debianutils"] {os-distribution = "debian"} ["debianutils"] {os-distribution = "ubuntu"} ["which"] {os-distribution = "nixos"} - ["which"] {os-distribution = "archlinux"} + ["which"] {os-distribution = "arch"} ] synopsis: "Virtual package relying on which" description: diff --git a/examples/hacker-news/esy.lock/opam/cstruct-lwt.3.6.0/opam b/examples/hacker-news/esy.lock/opam/cstruct-lwt.3.7.0/opam similarity index 93% rename from examples/hacker-news/esy.lock/opam/cstruct-lwt.3.6.0/opam rename to examples/hacker-news/esy.lock/opam/cstruct-lwt.3.7.0/opam index 2740a0b..10f580c 100644 --- a/examples/hacker-news/esy.lock/opam/cstruct-lwt.3.6.0/opam +++ b/examples/hacker-news/esy.lock/opam/cstruct-lwt.3.7.0/opam @@ -27,6 +27,6 @@ structures directly from OCaml. It supports both reading and writing to these structures, and they are accessed via the `Bigarray` module.""" url { src: - "https://github.com/mirage/ocaml-cstruct/releases/download/v3.6.0/cstruct-v3.6.0.tbz" - checksum: "md5=fa3ab5c5029dcab94fac95c3eceb4198" + "https://github.com/mirage/ocaml-cstruct/releases/download/v3.7.0/cstruct-v3.7.0.tbz" + checksum: "md5=60a83c96f5871a3caae091fd116f4f24" } diff --git a/examples/hacker-news/esy.lock/opam/cstruct.3.3.0/opam b/examples/hacker-news/esy.lock/opam/cstruct.3.7.0/opam similarity index 87% rename from examples/hacker-news/esy.lock/opam/cstruct.3.3.0/opam rename to examples/hacker-news/esy.lock/opam/cstruct.3.7.0/opam index 038743d..2275dc6 100644 --- a/examples/hacker-news/esy.lock/opam/cstruct.3.3.0/opam +++ b/examples/hacker-news/esy.lock/opam/cstruct.3.7.0/opam @@ -2,7 +2,7 @@ opam-version: "2.0" maintainer: "anil@recoil.org" authors: ["Anil Madhavapeddy" "Richard Mortier" "Thomas Gazagnaire" "Pierre Chambart" "David Kaloper" "Jeremy Yallop" "David Scott" - "Mindy Preston" "Thomas Leonard" ] + "Mindy Preston" "Thomas Leonard" "Anton Kochkov" "Etienne Millon" ] homepage: "https://github.com/mirage/ocaml-cstruct" license: "ISC" dev-repo: "git+https://github.com/mirage/ocaml-cstruct.git" @@ -28,6 +28,6 @@ structures directly from OCaml. It supports both reading and writing to these structures, and they are accessed via the `Bigarray` module.""" url { src: - "https://github.com/mirage/ocaml-cstruct/releases/download/v3.3.0/cstruct-v3.3.0.tbz" - checksum: "md5=7451389f3941d938575f8887c55c5e6b" + "https://github.com/mirage/ocaml-cstruct/releases/download/v3.7.0/cstruct-v3.7.0.tbz" + checksum: "md5=60a83c96f5871a3caae091fd116f4f24" } diff --git a/examples/hacker-news/esy.lock/opam/dune.1.7.3/opam b/examples/hacker-news/esy.lock/opam/dune.1.8.2/opam similarity index 92% rename from examples/hacker-news/esy.lock/opam/dune.1.7.3/opam rename to examples/hacker-news/esy.lock/opam/dune.1.8.2/opam index 677670b..3e1720a 100644 --- a/examples/hacker-news/esy.lock/opam/dune.1.7.3/opam +++ b/examples/hacker-news/esy.lock/opam/dune.1.8.2/opam @@ -42,6 +42,6 @@ packages across several versions of OCaml and gives cross-compilation for free. """ url { - src: "https://github.com/ocaml/dune/releases/download/1.7.3/dune-1.7.3.tbz" - checksum: "md5=644f0c1419d70b9daccac4b4e5664523" + src: "https://github.com/ocaml/dune/releases/download/1.8.2/dune-1.8.2.tbz" + checksum: "md5=2b7f45a6e14865f2318d34f12221ec1e" } diff --git a/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/files/0005-use-modern-cstruct-findlib.patch b/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/files/0005-use-modern-cstruct-findlib.patch new file mode 100644 index 0000000..406df1c --- /dev/null +++ b/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/files/0005-use-modern-cstruct-findlib.patch @@ -0,0 +1,32 @@ +From 063b3496340fe4c3544b532ec0d27797b7917bb4 Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Tue, 12 Mar 2019 09:07:13 +0000 +Subject: [PATCH 5/5] use modern cstruct findlib + +see https://discuss.ocaml.org/t/psa-cstruct-3-4-0-removes-old-ocamlfind-subpackage-aliases/3275 + +--- a/_tags.orig 2019-03-12 09:03:58.000000000 +0000 ++++ b/_tags 2019-03-12 09:04:12.000000000 +0000 +@@ -13,7 +13,7 @@ + : package(unix), package(bytes) + + : include +-: package(lwt.unix), package(cstruct.lwt) ++: package(lwt.unix), package(cstruct-lwt) + + : include + : package(lwt), package(mirage-entropy) +--- a/pkg/META.in.orig 2019-03-12 09:03:19.000000000 +0000 ++++ b/pkg/META.in 2019-03-12 09:03:33.000000000 +0000 +@@ -23,7 +23,7 @@ + package "lwt" ( + version = "0.5.4" + description = "Simple crypto for the modern age" +- requires = "nocrypto nocrypto.unix lwt.unix cstruct.lwt" ++ requires = "nocrypto nocrypto.unix lwt.unix cstruct-lwt" + archive(byte) = "nocrypto_lwt.cma" + archive(native) = "nocrypto_lwt.cmxa" + plugin(byte) = "nocrypto_lwt.cma" +-- +2.18.0 + diff --git a/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/opam b/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/opam index f9adaf4..ff11721 100644 --- a/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/opam +++ b/examples/hacker-news/esy.lock/opam/nocrypto.0.5.4-1/opam @@ -23,7 +23,7 @@ depends: [ "ppx_deriving" "ppx_sexp_conv" {>= "113.33.01" & != "v0.11.0" & < "v0.12"} "ounit" {with-test} - "cstruct" {>= "2.4.0" & <"3.4.0"} + "cstruct" {>= "2.4.0"} "cstruct-lwt" "zarith" "lwt" @@ -44,6 +44,7 @@ patches: [ "0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch" "0003-Auto-detect-ppx_sexp_conv-runtime-library.patch" "0004-pack-package-workaround-ocamlbuild-272.patch" + "0005-use-modern-cstruct-findlib.patch" ] synopsis: "Simpler crypto" description: """ @@ -54,6 +55,10 @@ SHA1, SHA2), public-key primitives (RSA, DSA, DH) and a strong RNG (Fortuna). RSA timing attacks are countered by blinding. AES timing attacks are avoided by delegating to AES-NI.""" extra-files: [ + [ + "0005-use-modern-cstruct-findlib.patch" + "md5=4d4aab890f0ca9327d83548c32d64efc" + ] [ "0004-pack-package-workaround-ocamlbuild-272.patch" "md5=94615e4a8d5976e9e75c3b031d3484f1" diff --git a/examples/hacker-news/esy.lock/opam/ppx_cstruct.3.6.0/opam b/examples/hacker-news/esy.lock/opam/ppx_cstruct.3.7.0/opam similarity index 92% rename from examples/hacker-news/esy.lock/opam/ppx_cstruct.3.6.0/opam rename to examples/hacker-news/esy.lock/opam/ppx_cstruct.3.7.0/opam index 970b3e3..109e9e2 100644 --- a/examples/hacker-news/esy.lock/opam/ppx_cstruct.3.6.0/opam +++ b/examples/hacker-news/esy.lock/opam/ppx_cstruct.3.7.0/opam @@ -18,7 +18,7 @@ build: [ depends: [ "ocaml" {>= "4.03.0"} "dune" {build & >= "1.0"} - "cstruct" {>= "3.1.1"} + "cstruct" {="3.7.0"} "ounit" {with-test} "ppx_tools_versioned" {>= "5.0.1"} "ocaml-migrate-parsetree" @@ -33,6 +33,6 @@ structures directly from OCaml. It supports both reading and writing to these structures, and they are accessed via the `Bigarray` module.""" url { src: - "https://github.com/mirage/ocaml-cstruct/releases/download/v3.6.0/cstruct-v3.6.0.tbz" - checksum: "md5=fa3ab5c5029dcab94fac95c3eceb4198" + "https://github.com/mirage/ocaml-cstruct/releases/download/v3.7.0/cstruct-v3.7.0.tbz" + checksum: "md5=60a83c96f5871a3caae091fd116f4f24" } diff --git a/examples/hacker-news/esy.lock/overrides/opam__s__dune_opam__c__1.7.3_opam_override/package.json b/examples/hacker-news/esy.lock/overrides/opam__s__dune_opam__c__1.8.2_opam_override/package.json similarity index 100% rename from examples/hacker-news/esy.lock/overrides/opam__s__dune_opam__c__1.7.3_opam_override/package.json rename to examples/hacker-news/esy.lock/overrides/opam__s__dune_opam__c__1.8.2_opam_override/package.json diff --git a/renderer-macos/esy.json b/renderer-macos/esy.json index 1714833..baba9fd 100644 --- a/renderer-macos/esy.json +++ b/renderer-macos/esy.json @@ -16,6 +16,11 @@ "pkg-config": "briskml/pkg-config" }, "devDependencies": { - "@reason-native/rely": "*" + "@reason-native/rely": "*", + "@opam/merlin": "^3.2.2" + }, + "resolutions": { + "@brisk/core": "link-dev:../core", + "brisk-reconciler": "briskml/brisk-reconciler#be325c5" } } diff --git a/renderer-macos/lib/Brisk.re b/renderer-macos/lib/Brisk.re index 5dcc70e..449f8a7 100644 --- a/renderer-macos/lib/Brisk.re +++ b/renderer-macos/lib/Brisk.re @@ -83,23 +83,34 @@ module UI = { }; module Layout = { + let get0IfUndefined = x => { + let floatValue = x; + Layout.isUndefined(floatValue) ? 0. : floatValue; + } + let rec traverseAndApply = (~flip, ~height, node: Layout.Node.flexNode) => { let layout = node.layout; - let nodeHeight = layout.height |> float_of_int; - let nodeTop = nodeHeight +. float_of_int(layout.top); + let nodeHeight = layout.height; + let nodeTop = nodeHeight +. layout.top; let top = flip ? height >= nodeTop ? height -. nodeTop : height - : float_of_int(layout.top); + : layout.top; + + let style = node.style; BriskView.setFrame( node.context.view, - layout.left |> float_of_int, + layout.left, top, - layout.width |> float_of_int, + layout.width, nodeHeight, + style.paddingLeft |> get0IfUndefined, + style.paddingRight |> get0IfUndefined, + style.paddingBottom |> get0IfUndefined, + style.paddingTop |> get0IfUndefined, ); let flip = !node.context.isYAxisFlipped; @@ -113,11 +124,12 @@ module UI = { let node = root.layoutNode.container; let flip = node.context.isYAxisFlipped; + Layout.FlexLayout.( layoutNode( node, - Flex.FixedEncoding.cssUndefined, - Flex.FixedEncoding.cssUndefined, + Layout.cssUndefined, + Layout.cssUndefined, Ltr, ) ); diff --git a/renderer-macos/lib/Styles.re b/renderer-macos/lib/Styles.re index d8d05a9..50abf9d 100644 --- a/renderer-macos/lib/Styles.re +++ b/renderer-macos/lib/Styles.re @@ -18,6 +18,7 @@ type textStyle = [ | `LineSpacing(float) ]; +let beginTextStyleChanges = BriskStylableText.beginChanges; let commitTextStyle = BriskStylableText.applyChanges; let setViewStyle = (view: view, attribute: [< viewStyle]) => @@ -92,12 +93,12 @@ let setTextStyle = (txt: text, attribute: [< textStyle]) => setLineBreak( txt, switch (mode) { - | `WordWrap => 0 - | `CharWrap => 1 - | `Clip => 2 - | `TruncateHead => 3 - | `TruncateTale => 4 - | `TruncateMiddle => 5 + | `WordWrap => LineBreakMode.wordWrapping + | `CharWrap => LineBreakMode.charWrapping + | `Clip => LineBreakMode.clipping + | `TruncateHead => LineBreakMode.truncatingHead + | `TruncateTail => LineBreakMode.truncatingTail + | `TruncateMiddle => LineBreakMode.truncatingMiddle }, ) | `LineSpacing(spacing) => setLineSpacing(txt, spacing) diff --git a/renderer-macos/lib/bindings/BriskStylableText.re b/renderer-macos/lib/bindings/BriskStylableText.re index 4511b99..b64cb41 100644 --- a/renderer-macos/lib/bindings/BriskStylableText.re +++ b/renderer-macos/lib/bindings/BriskStylableText.re @@ -1,9 +1,28 @@ type text = CocoaTypes.view; +module LineBreakMode = { + type t = int; + /* NSLineBreakByWordWrapping = 0 */ + let wordWrapping: t = 0; + /* NSLineBreakByCharWrapping = 1 */ + let charWrapping: t = 1; + /* NSLineBreakByClipping = 2 */ + let clipping: t = 2; + /* NSLineBreakByTruncatingHead = 3 */ + let truncatingHead: t = 3; + /* NSLineBreakByTruncatingTail = 4 */ + let truncatingTail: t = 4; + /* NSLineBreakByTruncatingMiddle = 5 */ + let truncatingMiddle: t = 5; +}; + [@noalloc] external applyChanges: text => unit = "ml_BriskStylableText_applyChanges" "ml_BriskStylableText_applyChanges"; +external beginChanges: text => unit = + "ml_BriskStylableText_beginTextStyleChanges_bc" "ml_BriskStylableText_beginTextStyleChanges"; + [@noalloc] external setFont: (text, string, [@unboxed] float, [@unboxed] float) => unit = "ml_BriskStylableText_setFont" "ml_BriskStylableText_setFont"; @@ -29,7 +48,7 @@ external setAlignment: (text, [@untagged] int) => unit = "ml_BriskStylableText_setAlignment_bc" "ml_BriskStylableText_setAlignment"; [@noalloc] -external setLineBreak: (text, [@untagged] int) => unit = +external setLineBreak: (text, [@untagged] LineBreakMode.t) => unit = "ml_BriskStylableText_setLineBreakMode_bc" "ml_BriskStylableText_setLineBreakMode"; diff --git a/renderer-macos/lib/bindings/BriskTextView.re b/renderer-macos/lib/bindings/BriskTextView.re index b6e3c46..7324bef 100644 --- a/renderer-macos/lib/bindings/BriskTextView.re +++ b/renderer-macos/lib/bindings/BriskTextView.re @@ -32,18 +32,6 @@ external setBackgroundColor: "ml_BriskTextView_setBackgroundColor_bc" "ml_BriskTextView_setBackgroundColor"; -[@noalloc] -external setPadding: - ( - t, - [@unboxed] float, - [@unboxed] float, - [@unboxed] float, - [@unboxed] float - ) => - unit = - "ml_BriskTextView_setPadding_bc" "ml_BriskTextView_setPadding"; - let make = str => { let txt = make(); diff --git a/renderer-macos/lib/bindings/BriskView.re b/renderer-macos/lib/bindings/BriskView.re index 394ce39..03415db 100644 --- a/renderer-macos/lib/bindings/BriskView.re +++ b/renderer-macos/lib/bindings/BriskView.re @@ -11,9 +11,21 @@ external insertSubview: (t, t, [@untagged] int) => unit = external setFrame: ( t, + /* x */ [@unboxed] float, + /* y */ [@unboxed] float, + /* width */ [@unboxed] float, + /* height */ + [@unboxed] float, + /* paddingLeft */ + [@unboxed] float, + /* paddingRight */ + [@unboxed] float, + /* paddingBottom */ + [@unboxed] float, + /* paddingTop */ [@unboxed] float ) => unit = diff --git a/renderer-macos/lib/components/Button.re b/renderer-macos/lib/components/Button.re index f4d6285..d6713a2 100644 --- a/renderer-macos/lib/components/Button.re +++ b/renderer-macos/lib/components/Button.re @@ -28,6 +28,7 @@ let component = { {view, layoutNode}; }, configureInstance: (~isFirstRender as _, {view} as node) => { + Styles.beginTextStyleChanges(view); style |> List.iter(attribute => switch (attribute) { diff --git a/renderer-macos/lib/components/Image.re b/renderer-macos/lib/components/Image.re index ce47fad..ca1a694 100644 --- a/renderer-macos/lib/components/Image.re +++ b/renderer-macos/lib/components/Image.re @@ -9,8 +9,8 @@ let measure = (node, _, _, _, _) => { let {context: {view: img}}: node = node; - let width = BriskImage.getImageWidth(img) |> int_of_float; - let height = BriskImage.getImageHeight(img) |> int_of_float; + let width = BriskImage.getImageWidth(img); + let height = BriskImage.getImageHeight(img); {width, height}; }; diff --git a/renderer-macos/lib/components/Text.re b/renderer-macos/lib/components/Text.re index d3f33a9..2a6dcb6 100644 --- a/renderer-macos/lib/components/Text.re +++ b/renderer-macos/lib/components/Text.re @@ -16,32 +16,39 @@ let shouldMeasureForMode = let maxContainerSizeForMode = (mode, size) => switch (mode) { - | Exactly => float_of_int(size) + | Exactly => size | CSS_MEASURE_MODE_NEGATIVE_ONE_WHATEVER_THAT_MEANS => raise(Invalid_argument("not implemented")) | Undefined => max_float - | AtMost => float_of_int(size) + | AtMost => size }; let measure = (node, width, widthMode, height, heightMode) => { let shouldCalculateWidth = shouldMeasureForMode(widthMode); let shouldCalculateHeight = shouldMeasureForMode(heightMode); if (shouldCalculateWidth || shouldCalculateHeight) { - let containerWidth = maxContainerSizeForMode(widthMode, width) -. 1.; + let containerWidth = maxContainerSizeForMode(widthMode, width); let containerHeight = maxContainerSizeForMode(heightMode, height); BriskTextView.setTextContainerSize( node.context.view, containerWidth, containerHeight, ); + let paddingHorizontal = + Layout.get0IfUndefined(node.style.paddingLeft) + +. Layout.get0IfUndefined(node.style.paddingRight); + let paddingVertical = + Layout.get0IfUndefined(node.style.paddingTop) + +. Layout.get0IfUndefined(node.style.paddingBottom); { width: shouldCalculateWidth - ? int_of_float(BriskTextView.getTextWidth(node.context.view)) + 1 + ? BriskTextView.getTextWidth(node.context.view) + +. paddingHorizontal : width, height: shouldCalculateHeight - ? BriskTextView.getTextHeight(node.context.view) |> int_of_float + ? BriskTextView.getTextHeight(node.context.view) +. paddingVertical : height, }; } else { @@ -72,8 +79,6 @@ let component = { style |> List.iter(attribute => switch (attribute) { - | `Padding({left, top, right, bottom}) => - BriskTextView.setPadding(view, left, top, right, bottom) | `Background(({r, g, b, a}: Color.t)) => BriskTextView.setBackgroundColor(view, r, g, b, a) | #Styles.viewStyle as attr => diff --git a/renderer-macos/lib/stubs/BriskButton.c b/renderer-macos/lib/stubs/BriskButton.c index 6ea5651..d1650d8 100644 --- a/renderer-macos/lib/stubs/BriskButton.c +++ b/renderer-macos/lib/stubs/BriskButton.c @@ -2,6 +2,9 @@ @interface BriskButton : NSButton +@property(nonatomic, strong) NSMutableAttributedString *brisk_attributedString; +@property(nonatomic, strong) NSMutableDictionary *brisk_textAttributes; + - (void)setCallback:(value)action; @end @@ -10,29 +13,42 @@ value onClick; } -@synthesize attributedString; -@synthesize attributedProps; -@synthesize paragraphStyle; +@synthesize brisk_paragraphStyle; - (id)init { self = [super init]; if (self) { - self.attributedString = [[NSMutableAttributedString alloc] init]; - self.attributedProps = [NSMutableDictionary dictionary]; - self.paragraphStyle = + self.brisk_attributedString = [[NSMutableAttributedString alloc] init]; + self.brisk_textAttributes = [NSMutableDictionary dictionary]; + self.brisk_paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - self.attributedProps[NSParagraphStyleAttributeName] = self.paragraphStyle; + self.brisk_textAttributes[NSParagraphStyleAttributeName] = + self.brisk_paragraphStyle; } return self; } -- (void)applyTextStyle { - NSRange range = NSMakeRange(0, self.attributedString.length); - [self.attributedString setAttributes:self.attributedProps range:range]; - [self setAttributedTitle:self.attributedString]; +#pragma mark - BriskStylableText + +- (void)brisk_setLineBreakMode:(NSLineBreakMode)mode { + self.lineBreakMode = mode; +} + +- (void)brisk_addAttribute:(NSAttributedStringKey)key value:(id)value { + [self.brisk_attributedString + addAttribute:key + value:value + range:NSMakeRange(0, self.brisk_attributedString.length)]; +} + +- (void)brisk_applyTextStyle { + NSRange range = NSMakeRange(0, self.brisk_attributedString.length); + [self.brisk_attributedString setAttributes:self.brisk_textAttributes + range:range]; + [self setAttributedTitle:self.brisk_attributedString]; } - (void)setCallback:(value)callback { @@ -73,7 +89,7 @@ CAMLprim value ml_BriskButton_setTitle(BriskButton *btn, value str_v) { CAMLparam1(str_v); NSString *str = [NSString stringWithUTF8String:String_val(str_v)]; - [btn.attributedString.mutableString setString:str]; + [btn.brisk_attributedString.mutableString setString:str]; CAMLreturn(Val_unit); } diff --git a/renderer-macos/lib/stubs/BriskScrollView.c b/renderer-macos/lib/stubs/BriskScrollView.c index 41c10a8..550626e 100644 --- a/renderer-macos/lib/stubs/BriskScrollView.c +++ b/renderer-macos/lib/stubs/BriskScrollView.c @@ -1,6 +1,6 @@ #import "BriskViewable.h" -@interface BriskScrollView: NSScrollView +@interface BriskScrollView : NSScrollView @end @implementation BriskScrollView { @@ -17,20 +17,20 @@ caml_modify_generational_global_root(&onScroll, Field(callbackOption, 0)); } else { caml_remove_generational_global_root(&onScroll); - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:NSViewBoundsDidChangeNotification - object:self.contentView]; + [[NSNotificationCenter defaultCenter] + removeObserver:self + name:NSViewBoundsDidChangeNotification + object:self.contentView]; self.contentView.postsBoundsChangedNotifications = NO; onScroll = (value)NULL; } } else if (Is_block(callbackOption)) { self.contentView.postsBoundsChangedNotifications = YES; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(boundsDidChange) - name:NSViewBoundsDidChangeNotification - object:self.contentView]; + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(boundsDidChange) + name:NSViewBoundsDidChangeNotification + object:self.contentView]; onScroll = Field(callbackOption, 0); caml_register_generational_global_root(&onScroll); } @@ -39,27 +39,24 @@ - (void)boundsDidChange { if (onScroll) { NSRect visibleRect = [self.contentView documentVisibleRect]; - /* I know - this is confusing. self.contentSize is the size of the whole scrollable content (including the invisible area) */ + /* I know - this is confusing. self.contentSize is the size of the whole + * scrollable content (including the invisible area) */ NSSize contentSize = self.documentView.frame.size; /* The size of the content chunk visible to the user */ NSSize visibleAreaSize = self.contentSize; + /* TODO: Fix this to happen synchronously. Otherwise we'll end up with + * issues similar to RN with one frame late updates. + */ dispatch_async(dispatch_get_main_queue(), ^{ - value args[] = { - caml_copy_double(visibleRect.origin.x), - caml_copy_double(visibleRect.origin.y), - caml_copy_double(contentSize.width), - caml_copy_double(contentSize.height), - caml_copy_double(visibleAreaSize.width), - caml_copy_double(visibleAreaSize.height) - }; - brisk_caml_call_n( - onScroll, - 6, - args - ); + value args[] = {caml_copy_double(visibleRect.origin.x), + caml_copy_double(visibleRect.origin.y), + caml_copy_double(contentSize.width), + caml_copy_double(contentSize.height), + caml_copy_double(visibleAreaSize.width), + caml_copy_double(visibleAreaSize.height)}; + brisk_caml_call_n(onScroll, 6, args); + }); } - ); -} } @end @@ -91,7 +88,8 @@ NSView *ml_BriskScrollView_documentView(BriskScrollView *scroll) { return scroll.documentView; } -CAMLprim value ml_BriskScrollView_setOnScroll(BriskScrollView *scrollView, value callback_v) { +CAMLprim value ml_BriskScrollView_setOnScroll(BriskScrollView *scrollView, + value callback_v) { CAMLparam1(callback_v); value callback = callback_v; diff --git a/renderer-macos/lib/stubs/BriskStylableText.c b/renderer-macos/lib/stubs/BriskStylableText.c index 8fc9199..648a58f 100644 --- a/renderer-macos/lib/stubs/BriskStylableText.c +++ b/renderer-macos/lib/stubs/BriskStylableText.c @@ -1,7 +1,14 @@ #import "BriskStylableText.h" +void ml_BriskStylableText_beginTextStyleChanges( + NSObject *txt) { + if ([txt respondsToSelector:@selector(brisk_beginTextStyleChanges)]) { + [txt brisk_beginTextStyleChanges]; + } +} + void ml_BriskStylableText_applyChanges(id txt) { - [txt applyTextStyle]; + [txt brisk_applyTextStyle]; } CAMLprim value ml_BriskStylableText_setFont(id txt, @@ -27,15 +34,18 @@ CAMLprim value ml_BriskStylableText_setFont(id txt, font = [NSFont systemFontOfSize:(CGFloat)fontSize weight:fontWeight]; } - txt.attributedProps[NSFontAttributeName] = font; + [txt brisk_addAttribute:NSFontAttributeName value:font]; CAMLreturn(Val_unit); } void ml_BriskStylableText_setColor(id txt, double red, double green, double blue, double alpha) { - txt.attributedProps[NSForegroundColorAttributeName] = - [NSColor colorWithRed:red green:green blue:blue alpha:alpha]; + [txt brisk_addAttribute:NSForegroundColorAttributeName + value:[NSColor colorWithRed:red + green:green + blue:blue + alpha:alpha]]; } CAMLprim value ml_BriskStylableText_setColor_bc(id txt, @@ -50,8 +60,7 @@ CAMLprim value ml_BriskStylableText_setColor_bc(id txt, } void ml_BriskStylableText_setAlignment(id txt, int align) { - txt.paragraphStyle.alignment = align; - txt.attributedProps[NSParagraphStyleAttributeName] = txt.paragraphStyle; + txt.brisk_paragraphStyle.alignment = align; } CAMLprim value ml_BriskStylableText_setAlignment_bc(id txt, @@ -64,24 +73,13 @@ CAMLprim value ml_BriskStylableText_setAlignment_bc(id txt, } void ml_BriskStylableText_setLineBreakMode(id txt, - int mode) { - txt.paragraphStyle.lineBreakMode = mode; - txt.attributedProps[NSParagraphStyleAttributeName] = txt.paragraphStyle; -} - -CAMLprim value ml_BriskStylableText_setLineBreakMode_bc( - id txt, value mode_v) { - CAMLparam1(mode_v); - - ml_BriskStylableText_setLineBreakMode(txt, Int_val(mode_v)); - - CAMLreturn(Val_unit); + NSLineBreakMode mode) { + [txt brisk_setLineBreakMode:mode]; } void ml_BriskStylableText_setLineSpacing(id txt, double spacing) { - txt.paragraphStyle.lineSpacing = spacing; - txt.attributedProps[NSParagraphStyleAttributeName] = txt.paragraphStyle; + txt.brisk_paragraphStyle.lineSpacing = spacing; } CAMLprim value ml_BriskStylableText_setLineSpacing_bc(id txt, @@ -94,7 +92,8 @@ CAMLprim value ml_BriskStylableText_setLineSpacing_bc(id txt, } void ml_BriskStylableText_setKern(id txt, double kern) { - txt.attributedProps[NSKernAttributeName] = [NSNumber numberWithDouble:kern]; + [txt brisk_addAttribute:NSKernAttributeName + value:[NSNumber numberWithDouble:kern]]; } CAMLprim value ml_BriskStylableText_setKern_bc(id txt, diff --git a/renderer-macos/lib/stubs/BriskStylableText.h b/renderer-macos/lib/stubs/BriskStylableText.h index ea10064..1a0c13e 100644 --- a/renderer-macos/lib/stubs/BriskStylableText.h +++ b/renderer-macos/lib/stubs/BriskStylableText.h @@ -2,10 +2,12 @@ @protocol BriskStylableText -@property(nonatomic, retain) NSMutableAttributedString *attributedString; -@property(nonatomic, retain) NSMutableDictionary *attributedProps; -@property(nonatomic, retain) NSMutableParagraphStyle *paragraphStyle; +@property(nonatomic, retain) NSMutableParagraphStyle *brisk_paragraphStyle; -- (void)applyTextStyle; +- (void)brisk_addAttribute:(NSAttributedStringKey)attributeName value:(id)value; +- (void)brisk_applyTextStyle; +- (void)brisk_setLineBreakMode:(NSLineBreakMode)mode; +@optional +- (void)brisk_beginTextStyleChanges; @end diff --git a/renderer-macos/lib/stubs/BriskTextView.c b/renderer-macos/lib/stubs/BriskTextView.c index 03e4bf9..7717054 100644 --- a/renderer-macos/lib/stubs/BriskTextView.c +++ b/renderer-macos/lib/stubs/BriskTextView.c @@ -2,27 +2,39 @@ #import "BriskViewable.h" @interface BriskTextView : NSTextView - +@property(nonatomic, assign) CGFloat paddingLeft; +@property(nonatomic, assign) CGFloat paddingTop; @end @implementation BriskTextView -@synthesize attributedString; -@synthesize attributedProps; -@synthesize paragraphStyle; +@synthesize brisk_paragraphStyle; - (id)init { self = [super init]; if (self) { - self.attributedString = [[NSMutableAttributedString alloc] init]; - self.attributedProps = [NSMutableDictionary dictionary]; - self.paragraphStyle = + self.wantsLayer = YES; + /* This avoids automatic resizing by NSLayoutManager + * based on NSTextContainer's calculated text size alone + * which conflicts with our manual frame setting inside + * brisk_setFrame. + */ + self.verticallyResizable = NO; + self.horizontallyResizable = NO; + self.brisk_paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - - self.attributedProps[NSParagraphStyleAttributeName] = self.paragraphStyle; self.backgroundColor = [NSColor clearColor]; self.textContainer.widthTracksTextView = NO; self.textContainer.heightTracksTextView = NO; + /* It seems that if we don't track width and height of the view, + * the text container inset has no result + */ + self.textContainerInset = CGSizeZero; + // We calculate paddings manually and override textContainerOrigin + self.textContainer.lineFragmentPadding = 0.; + + self.paddingLeft = 0.; + self.paddingTop = 0.; } return self; } @@ -35,23 +47,54 @@ return NO; } -- (void)applyTextStyle { - NSRange range = NSMakeRange(0, self.attributedString.length); +#pragma mark - BriskStylableText - [self.attributedString setAttributes:self.attributedProps range:range]; - [[self textStorage] setAttributedString:self.attributedString]; +- (void)brisk_setLineBreakMode:(NSLineBreakMode)mode { + self.textContainer.lineBreakMode = mode; } -- (void)brisk_setFrame:(CGRect)nextFrame { +- (void)brisk_beginTextStyleChanges { + [self.textStorage beginEditing]; +} + +- (void)brisk_applyTextStyle { + [self brisk_addAttribute:NSParagraphStyleAttributeName + value:self.brisk_paragraphStyle]; + [self.textStorage endEditing]; +} + +- (void)brisk_addAttribute:(NSAttributedStringKey)attribute value:(id)value { + [self.textStorage addAttribute:attribute + value:value + range:NSMakeRange(0, self.textStorage.length)]; +} + +#pragma mark - BriskViewable + +- (void)brisk_setFrame:(CGRect)nextFrame + paddingLeft:(CGFloat)paddingLeft + paddingRight:(CGFloat)paddingRight + paddingTop:(CGFloat)paddingTop + paddingBottom:(CGFloat)paddingBottom { CGFloat width = nextFrame.size.width; CGFloat height = nextFrame.size.height; - self.textContainer.containerSize = CGSizeMake(width, height); - [self setFrame:CGRectMake(nextFrame.origin.x, nextFrame.origin.y, width, height)]; + self.textContainer.size = CGSizeMake(width - paddingLeft - paddingRight, + height - paddingBottom - paddingTop); + self.paddingTop = paddingTop; + self.paddingLeft = paddingLeft; + [self setFrame:nextFrame]; } -- (void)brisk_insertNode:(NSView *)child position:(intnat)position { - assert(child); - assert(position); +- (NSPoint)textContainerOrigin { + return NSMakePoint(self.paddingLeft, self.paddingTop); +} + +- (void)brisk_insertNode:(NSView __unused *)child + position:(intnat __unused)position { + @throw([NSException + exceptionWithName:@"Cannot insert a node to a TextView" + reason:@"Nesting views inside TextView is not supported" + userInfo:nil]); } @end @@ -63,17 +106,20 @@ BriskTextView *ml_BriskTextView_make() { return txt; } -void ml_BriskTextView_setTextContainerSize(BriskTextView *txt, double width, double height) { +void ml_BriskTextView_setTextContainerSize(BriskTextView *txt, double width, + double height) { txt.textContainer.containerSize = NSMakeSize(width, height); [txt.layoutManager ensureLayoutForTextContainer:txt.textContainer]; } double ml_BriskTextView_getTextWidth(BriskTextView *txt) { - return [txt.layoutManager usedRectForTextContainer:txt.textContainer].size.width + (txt.textContainerInset.width * 2); + return + [txt.layoutManager usedRectForTextContainer:txt.textContainer].size.width; } double ml_BriskTextView_getTextHeight(BriskTextView *txt) { - return [txt.layoutManager usedRectForTextContainer:txt.textContainer].size.height + (txt.textContainerInset.height * 2); + return [txt.layoutManager usedRectForTextContainer:txt.textContainer] + .size.height; } CAMLprim value ml_BriskTextView_getTextWidth_bc(BriskTextView *txt) { @@ -92,8 +138,8 @@ CAMLprim value ml_BriskTextView_setStringValue(BriskTextView *txt, NSString *str = [NSString stringWithUTF8String:String_val(str_v)]; - [txt.attributedString.mutableString setString:str]; - [txt applyTextStyle]; + [txt.textStorage.mutableString setString:str]; + [txt brisk_applyTextStyle]; CAMLreturn(Val_unit); } @@ -118,20 +164,3 @@ CAMLprim value ml_BriskTextView_setBackgroundColor_bc(BriskTextView *txt, CAMLreturn(Val_unit); } - -void ml_BriskTextView_setPadding(BriskTextView *txt, double left, double top, - __unused double right, - __unused double bottom) { - txt.textContainerInset = CGSizeMake(left, top); -} - -CAMLprim value ml_BriskTextView_setPadding_bc(BriskTextView *txt, value left_v, - value top_v, value right_v, - value bottom_v) { - CAMLparam4(left_v, top_v, right_v, bottom_v); - - ml_BriskTextView_setPadding(txt, Double_val(left_v), Double_val(top_v), - Double_val(right_v), Double_val(bottom_v)); - - CAMLreturn(Val_unit); -} diff --git a/renderer-macos/lib/stubs/BriskView.c b/renderer-macos/lib/stubs/BriskView.c index e3832ef..8f9a86d 100644 --- a/renderer-macos/lib/stubs/BriskView.c +++ b/renderer-macos/lib/stubs/BriskView.c @@ -24,27 +24,22 @@ void ml_BriskView_insertSubview(NSView *view, NSView *child, intnat position) { void ml_BriskView_removeSubview(NSView *child) { [child removeFromSuperview]; } -void ml_BriskView_setFrame(NSView *view, double x, double y, double w, - double h) { +void ml_BriskView_setFrame(NSView *view, double x, double y, double w, double h, + double paddingLeft, double paddingRight, + double paddingBottom, double paddingTop) { NSRect rect = NSMakeRect(x, y, w, h); if ([view conformsToProtocol:@protocol(BriskViewable)]) { NSView *viewable = (NSView *)view; - [viewable brisk_setFrame:rect]; + [viewable brisk_setFrame:rect + paddingLeft:paddingLeft + paddingRight:paddingRight + paddingTop:paddingTop + paddingBottom:paddingBottom]; } else { [view setFrame:rect]; } } -CAMLprim value ml_BriskView_setFrame_bc(NSView *view, value x_v, value y_v, - value w_v, value h_v) { - CAMLparam4(x_v, y_v, w_v, h_v); - - ml_BriskView_setFrame(view, Double_val(x_v), Double_val(y_v), Double_val(w_v), - Double_val(h_v)); - - CAMLreturn(Val_unit); -} - void ml_BriskView_setBorderWidth(NSView *view, double width) { [view.layer setBorderWidth:width]; } diff --git a/renderer-macos/lib/stubs/BriskViewable.h b/renderer-macos/lib/stubs/BriskViewable.h index 653579d..73813a2 100644 --- a/renderer-macos/lib/stubs/BriskViewable.h +++ b/renderer-macos/lib/stubs/BriskViewable.h @@ -4,6 +4,9 @@ - (void)brisk_insertNode:(NSView *)child position:(intnat)position; -- (void)brisk_setFrame:(NSRect)rect; - +- (void)brisk_setFrame:(NSRect)rect + paddingLeft:(CGFloat)left + paddingRight:(CGFloat)right + paddingTop:(CGFloat)top + paddingBottom:(CGFloat)bottom; @end