Repository navigation
Releases: mark1russell7/layout-contract
Releases · mark1russell7/layout-contract
Release list
v0.2.21
- PATCH: a fix of the speed of
/text, with no change of the API. In 0.2.20, each call oflayoutTextmade a newIntl.Segmenter. A consumer port saw its first load take 2 to 3 times longer. - The module makes only one
Intl.Segmenterfor 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
- 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/texthascreateMeasurer,canvasAdvance,fontKey,graphemesOf,layoutText,textMeasuresandTEXT_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.
layoutTexthas 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.mdgives the rules, the units, the error and the measures.
v0.2.19
- 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 andsideRange.procrustesOf(base, next, { unit, rotate })gives the move of the box centers after the best move and rotation, in units ofW.perChangedivides it by the change share.balanceMeasureSpecs(stage)gives the specs of the 9 measures with the prefix of a stage, for examplepack.balance.sideRange.balanceMeasuresgives the values with the same ids.docs/BALANCE.mdgives the definitions and the reasons.
v0.2.18
- 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
ShapeBoundhas 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
- 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,ShapeLevelandShapeBound.MeasureSpecandShapeSupporthave the new optional fieldbound. boundlists the kinds where the value of a measure is a bound of the true value, and its sideupperorlower. An example is a fill that readsw * hof afreebox.shapeLevel(use, kind)givesexact,safe,boundornone.ruleLeveldoes not readbound, and its result stays the same.- By default,
checkShapesrefuses a bound kind. Its break tells the side, for example "The value of pack.shapeFill is only an upper bound for free". ShapeCheck.levelhas the new valuebound. It accepts the exact, safe and bound kinds. The levelsafeaccepts the exact and safe kinds only, as in 0.2.16.shapeSupportProblemsrefuses a kind in two of the listsshapes,safeandbound.shapes. It also refuses an unknown kind, a repeated kind and a badside.docs/SHAPES.mdtells what a bound value proves for eachdirectionof a measure, and why the level isboundand notsafe.- Fix: with
meta: "sample"andshapes, a sample does not throw for a meta option without a member list. It draws again, asspaceSizegives that option 0. - A sample throws a
RangeErroronly 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 setmembers.viewto"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
configIdof 0.2.16 stays the same.JOINT_MEASUREShas nobound.
v0.2.16
- 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,shapeSupportProblemsandShapeCheck. - The new optional fields are
ShapeSupport.safe,MemberRule.viewandCorpusDimension.precision.checkShapeshas a new optional third parameteroptions. regionAreagives the exact area of a region. A polygon uses the shoelace formula, less its holes.SHAPE_KINDSgivesgeometry.areatopolygonandcircle.boxAreagives the area of a box, orundefinedfor afreebox. A box with an ellipse shape isfree, so it givesundefined.safelists the kinds with a safe count.no-overlapandin-containerofPACK_HARD_RULESare safe onpolygon,circleandfree.checkShapesrefuses a safe kind by default, as before. Its break also tells that the count is only safe. With{ level: "safe" }, it accepts the kind.shapeSupportProblemsrefuses a kind inshapesand insafe, 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 withrect. - With
view: "bounds",checkConfig,spaceSize,enumerateSpaceand the pool entries userectfor the members.checkSpacerefuses anotherview. precisionrounds a numeric value and its default before theinvalidatescompare. A margin of 0.0004 withprecision: 3keepsknown.precisionchanges only that compare. The registry,sharedDimensionandownerDimensionrefuse a badprecision, andprecisionon a dimension that is not numeric.- Each input, manifest, record, hash and
configIdof 0.2.15 stays the same.
v0.2.15
- 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_FIELDandportPoint. - The new optional fields are
CorpusDimension.supported,CorpusDimension.invalidates,CorpusFamily.hash,LayoutInput.invalidatedandPort.along.resolveDimensionshas a new optional fourth parameterby. supportedmarks the values that one family accepts (L51). A list is for anenumor abool, and a range{ min?, max? }is for a numeric dimension.resolveandgenerateof a registry refuse another value with aRangeErrorthat has the text "not supported by".levelsOfandboundaryCellskeep 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 ofCORPUS_DIMENSIONS, the namekindand a bad default, level,supportedorinvalidates.invalidateslists the output fields that a value other than the default makes wrong.generateof a registry removes them, lists them ininvalidatedand calculates thehashagain.Port.alongfixes a port at a fraction of its side (L56). The start ofleftandrightis the top end, and the start oftopandbottomis the left end.checkInputrefusesalongwithout a side, outside [0, 1] or withxory.turnPortchangesalongofleftandrightto1 - along.- Each input, manifest, record and hash of 0.2.14 stays the same. The tests pin the
joint-v1andjoint-v2manifests,RECT_SCATTERED_HASHESand an input with ports.
v0.2.14
- PATCH: new optional exports and fields, with no break:
MemberRule.pool,PairGap,LayoutInput.pairGapsandcanonicalInput. It also has a fix ofgenerate. MemberRule.poolis a fixed list of member lists (L39). Each entry is a list of whole configs of the space of the members.- With a
pool,spaceSizecounts each entry one time.enumerateSpacegives only entries of the pool, andcheckConfigrefuses another member list with the claimpool. checkSpacechecks each entry of a pool. The shape filter of 0.2.13 also applies to the members of each entry. A rule withoutpooldoes not change.- With a pool of 1 list on
cell-portfolio, the meta count ofpackingat 3 levels goes from approximately 1.49e25 to approximately 1.72e15. LayoutInput.pairGapsgives a minimum distance to a pair of boxes (L49). For its pair, it replaces the two margins and thegap.PackInputandtoPackInputcarry it.checkInputrefuses an unknown box, a pair of one box, a repeated pair in either order, a badgapand badlanes.- The hard rule
no-overlapreadspairGaps. For a pair of the list, in either order, thegapreplaces the two margins.countOverlapshas a new optional third parameterpairGaps. - A pair of the list breaks
no-overlaponly when the boxes are nearer than the gap on each axis. The other pairs keep their margins. canonicalInputsorts the pairs.documentHashuses it for eachlayout-input/1document, so the order of the pairs does not change the hash.- The fix:
generate,resolve,cellOfandrngOfof a registry accept a cell ofcellOf. They ignore akindthat is thefamilyKindof the family, and refuse anotherkind. - Each input, verdict, record, hash and
configIdof 0.2.13 stays the same.
v0.2.13
- The shape kind of an item is a dimension of the contract (L46).
docs/SHAPES.mdtells the rules. SHAPE_KINDSdeclares 4 kinds:rect,polygon,circleandfree. Onlyrecthas all of its geometry. The other kinds have their bounding box.LayoutBox.shapeKind, the cell dimensionitemShapeand the record fieldshapesare new and optional. A box without them is arect.MeasureSpec.shapesandPACK_HARD_RULESgive the kinds of each measure and rule.checkShapesrefuses a run on a kind that a measure does not support.StageOption.supports.shapegives the kinds of an option.checkConfig,spaceSizeandenumerateSpacetakeshapes.spaceShapeKindsgives the kinds of a space.- Each input, record, hash and
configIdof 0.2.12 stays the same.
v0.2.12
- The result of
verdicthas 3 new fields:scope,breadthandsummary. The label and the rule do not change. scopeis"these families". The test keeps the families as fixed, so the claim is about these families only.breadthis{ against, of, ties }: the count of the families against the side of the verdict, of all the families and of the ties.summarygives the label, the scope and the breadth in one line, for examplebetter on these families, worse on 2 of 6 (1 tie).