Skip to content

Releases: mark1russell7/layout-contract

v0.2.21

Choose a tag to compare

@github-actions github-actions released this 29 Oct 14:13
ddd67f0
  • PATCH: a fix of the speed of /text, with no change of the API. In 0.2.20, each call of layoutText made a new Intl.Segmenter. A consumer port saw its first load take 2 to 3 times longer.
  • The module makes only one Intl.Segmenter for each granularity.
  • A bounded memo keeps the words of the last 4096 texts. A page often asks for the same labels many times.
  • A test counts the segmenters of 500 layouts. The count is 2 or fewer.

v0.2.20

Choose a tag to compare

@github-actions github-actions released this 29 Oct 13:37
952ffa9
  • PATCH: a new subpath export, with no break. In a consumer profile, the text measures and the line breaks take approximately 3.1 s of a first load. Thus text layout is a layout step of the contract.
  • The subpath @mark1russell7/layout-contract/text has createMeasurer, canvasAdvance, fontKey, graphemesOf, layoutText, textMeasures and TEXT_MEASURES.
  • The measurer caches the advance of each font and word segment, in whole units of 1/64 pixel. Thus each port gets the same lines.
  • layoutText has a character clamp, a padding, a min and max width of one line and a wrap width. It also has a max line count with an ellipsis, a line height and a word break option.
  • docs/TEXT.md gives the rules, the units, the error and the measures.

v0.2.19

Choose a tag to compare

@github-actions github-actions released this 29 Oct 13:22
910067f
  • PATCH: new exports, with no break. The packing engine and the joint bench use the same balance and stability measures, so the contract computes them.
  • balanceOf(boxes, container) gives the balance of a layout: gapCv, centroidOffset, the empty share of each side and sideRange.
  • procrustesOf(base, next, { unit, rotate }) gives the move of the box centers after the best move and rotation, in units of W. perChange divides it by the change share.
  • balanceMeasureSpecs(stage) gives the specs of the 9 measures with the prefix of a stage, for example pack.balance.sideRange. balanceMeasures gives the values with the same ids.
  • docs/BALANCE.md gives the definitions and the reasons.

v0.2.18

Choose a tag to compare

@github-actions github-actions released this 29 Oct 00:47
267fe3f
  • PATCH: docs only, with no change to the API. The packing engine found that the npm package has no docs/ folder, but the comments name its files.
  • The TSDoc of ShapeBound has the table of what a bound value proves, so a consumer reads it in the package.
  • The package README has a table of each doc that the comments name, with its link in the repository.

v0.2.17

Choose a tag to compare

@github-actions github-actions released this 29 Oct 00:32
350e773
  • PATCH: a new optional field, new exports and a fix, with no break. The packing engine found the 2 gaps when it moved to 0.2.16.
  • The new exports are shapeLevel, ShapeLevel and ShapeBound. MeasureSpec and ShapeSupport have the new optional field bound.
  • bound lists the kinds where the value of a measure is a bound of the true value, and its side upper or lower. An example is a fill that reads w * h of a free box.
  • shapeLevel(use, kind) gives exact, safe, bound or none. ruleLevel does not read bound, and its result stays the same.
  • By default, checkShapes refuses a bound kind. Its break tells the side, for example "The value of pack.shapeFill is only an upper bound for free".
  • ShapeCheck.level has the new value bound. It accepts the exact, safe and bound kinds. The level safe accepts the exact and safe kinds only, as in 0.2.16.
  • shapeSupportProblems refuses a kind in two of the lists shapes, safe and bound.shapes. It also refuses an unknown kind, a repeated kind and a bad side.
  • docs/SHAPES.md tells what a bound value proves for each direction of a measure, and why the level is bound and not safe.
  • Fix: with meta: "sample" and shapes, a sample does not throw for a meta option without a member list. It draws again, as spaceSize gives that option 0.
  • A sample throws a RangeError only when the space has no config for the kinds. The error names the kinds, the stages without an option and the meta options without members. For such a meta option, it tells to set members.view to "bounds".
  • Each sample that 0.2.16 gave stays the same, byte for byte. A test pins the samples of 0.2.16 for 8 spaces.
  • Each input, manifest, record, hash and configId of 0.2.16 stays the same. JOINT_MEASURES has no bound.

v0.2.16

Choose a tag to compare

@github-actions github-actions released this 28 Oct 23:42
0dd4d18
  • PATCH: new optional exports and fields, with no break (L57). The packing engine found the 3 shape gaps when it packed shapes by their bounding boxes.
  • The new exports are regionArea, boxArea, ruleLevel, RuleLevel, shapeSupportProblems and ShapeCheck.
  • The new optional fields are ShapeSupport.safe, MemberRule.view and CorpusDimension.precision. checkShapes has a new optional third parameter options.
  • regionArea gives the exact area of a region. A polygon uses the shoelace formula, less its holes. SHAPE_KINDS gives geometry.area to polygon and circle.
  • boxArea gives the area of a box, or undefined for a free box. A box with an ellipse shape is free, so it gives undefined.
  • safe lists the kinds with a safe count. no-overlap and in-container of PACK_HARD_RULES are safe on polygon, circle and free.
  • checkShapes refuses a safe kind by default, as before. Its break also tells that the count is only safe. With { level: "safe" }, it accepts the kind.
  • shapeSupportProblems refuses a kind in shapes and in safe, an unknown kind and a repeated kind.
  • With view: "bounds", a meta option gives its members the bounding box of each item. A shape filter then checks the members with rect.
  • With view: "bounds", checkConfig, spaceSize, enumerateSpace and the pool entries use rect for the members. checkSpace refuses another view.
  • precision rounds a numeric value and its default before the invalidates compare. A margin of 0.0004 with precision: 3 keeps known.
  • precision changes only that compare. The registry, sharedDimension and ownerDimension refuse a bad precision, and precision on a dimension that is not numeric.
  • Each input, manifest, record, hash and configId of 0.2.15 stays the same.

v0.2.15

Choose a tag to compare

@github-actions github-actions released this 28 Oct 22:35
b6a12af
  • PATCH: new optional exports and fields, with no break. A family, a dimension or an input without them does not change.
  • The new exports are ownerDimension, OwnerDimensionSpec, dimensionSupports, SupportedValues, SupportedRange, INVALIDATED_FIELD and portPoint.
  • The new optional fields are CorpusDimension.supported, CorpusDimension.invalidates, CorpusFamily.hash, LayoutInput.invalidated and Port.along. resolveDimensions has a new optional fourth parameter by.
  • supported marks the values that one family accepts (L51). A list is for an enum or a bool, and a range { min?, max? } is for a numeric dimension.
  • resolve and generate of a registry refuse another value with a RangeError that has the text "not supported by". levelsOf and boundaryCells keep to the supported values.
  • dimensionSupports(dim, value) tells a site if a family accepts a value.
  • ownerDimension(name, spec) gives a dimension of one owner. It refuses a name of CORPUS_DIMENSIONS, the name kind and a bad default, level, supported or invalidates.
  • invalidates lists the output fields that a value other than the default makes wrong. generate of a registry removes them, lists them in invalidated and calculates the hash again.
  • Port.along fixes a port at a fraction of its side (L56). The start of left and right is the top end, and the start of top and bottom is the left end.
  • checkInput refuses along without a side, outside [0, 1] or with x or y. turnPort changes along of left and right to 1 - along.
  • Each input, manifest, record and hash of 0.2.14 stays the same. The tests pin the joint-v1 and joint-v2 manifests, RECT_SCATTERED_HASHES and an input with ports.

v0.2.14

Choose a tag to compare

@github-actions github-actions released this 28 Oct 21:49
d26c4f5
  • PATCH: new optional exports and fields, with no break: MemberRule.pool, PairGap, LayoutInput.pairGaps and canonicalInput. It also has a fix of generate.
  • MemberRule.pool is a fixed list of member lists (L39). Each entry is a list of whole configs of the space of the members.
  • With a pool, spaceSize counts each entry one time. enumerateSpace gives only entries of the pool, and checkConfig refuses another member list with the claim pool.
  • checkSpace checks each entry of a pool. The shape filter of 0.2.13 also applies to the members of each entry. A rule without pool does not change.
  • With a pool of 1 list on cell-portfolio, the meta count of packing at 3 levels goes from approximately 1.49e25 to approximately 1.72e15.
  • LayoutInput.pairGaps gives a minimum distance to a pair of boxes (L49). For its pair, it replaces the two margins and the gap. PackInput and toPackInput carry it.
  • checkInput refuses an unknown box, a pair of one box, a repeated pair in either order, a bad gap and bad lanes.
  • The hard rule no-overlap reads pairGaps. For a pair of the list, in either order, the gap replaces the two margins. countOverlaps has a new optional third parameter pairGaps.
  • A pair of the list breaks no-overlap only when the boxes are nearer than the gap on each axis. The other pairs keep their margins.
  • canonicalInput sorts the pairs. documentHash uses it for each layout-input/1 document, so the order of the pairs does not change the hash.
  • The fix: generate, resolve, cellOf and rngOf of a registry accept a cell of cellOf. They ignore a kind that is the familyKind of the family, and refuse another kind.
  • Each input, verdict, record, hash and configId of 0.2.13 stays the same.

v0.2.13

Choose a tag to compare

@github-actions github-actions released this 28 Oct 20:50
daba325
  • The shape kind of an item is a dimension of the contract (L46). docs/SHAPES.md tells the rules.
  • SHAPE_KINDS declares 4 kinds: rect, polygon, circle and free. Only rect has all of its geometry. The other kinds have their bounding box.
  • LayoutBox.shapeKind, the cell dimension itemShape and the record field shapes are new and optional. A box without them is a rect.
  • MeasureSpec.shapes and PACK_HARD_RULES give the kinds of each measure and rule. checkShapes refuses a run on a kind that a measure does not support.
  • StageOption.supports.shape gives the kinds of an option. checkConfig, spaceSize and enumerateSpace take shapes. spaceShapeKinds gives the kinds of a space.
  • Each input, record, hash and configId of 0.2.12 stays the same.

v0.2.12

Choose a tag to compare

@github-actions github-actions released this 28 Oct 19:06
2bdd05e
  • The result of verdict has 3 new fields: scope, breadth and summary. The label and the rule do not change.
  • scope is "these families". The test keeps the families as fixed, so the claim is about these families only.
  • breadth is { against, of, ties }: the count of the families against the side of the verdict, of all the families and of the ties.
  • summary gives the label, the scope and the breadth in one line, for example better on these families, worse on 2 of 6 (1 tie).