flutter_html_css_all 0.2.0
flutter_html_css_all: ^0.2.0 copied to clipboard
Re-exports twenty-one flutter_html companion packages, nineteen of them CSS extensions, and returns a nineteen-entry extension list in the one order all their rules allow.
0.2.0 #
- Renamed from
flutter_html_css_bundle_extensionon pub.flutter-io.cn. The old package stays published and is marked discontinued with this one as its replacement. Class names are unchanged. utilityClassExtensions, aList<HtmlExtension>with aconstempty default, replacesutilityClassExtensioninBundledCssExtensionsand inbundledCssExtensions(). It registers in the slot the single one had, in the order you give, so both utility-class packages can be registered together.utilityClassExtensionstill works, is@Deprecated('Use utilityClassExtensions'), and is registered first when given. Three class names are defined by both frameworks,rounded,borderandtext-truncate, and they resolve to different CSS: Bootstrap'sroundedis aborder-radiusof 0.375rem, Vuetify's is 4px. Each extension appends its declarations to the element's inline style, so for a shared class name the later registration wins, because its declaration is appended last.- Every sibling constraint is now a range,
>=<current floor> <0.4.0, where it was a caret. The floor is each sibling's renamed release. The ceiling is the next major of the family's current highest minor, 0.3.x, so<0.4.0. The rule is written down in doc/order.md. - What that buys: a sibling's in-range release now reaches a bundle user on its own, without waiting for a bundle release. So the bundle releases only when an ordering rule changes, when the export set changes, or when a constraint floor moves. It no longer follows every sibling release.
.gitlab/renovate.json5drops therangeStrategy: 'bump'rule on the siblings and useswideninstead.bumpexisted to raise an MR for an in-caret release, which is the thing that no longer needs one.widenstill raises an MR when a sibling escapes the range, which is when the ceiling has to be looked at by a human.
0.1.5 #
flutter_html_css_text_metricsandflutter_html_css_unitsboth move to^0.2.0. The caret on0.1.xno longer admits either release, so a bundle user would never have seen them.- text-metrics 0.2.0 renders a
text-decoration-thicknessthat states a length or a percentage. 0.1.0 dropped both without a word, because Flutter'sdecorationThicknessis a multiplier of the line the font itself draws and not a length. It is an approximation now: the length divided by one twelfth of the element's ownfont-size. Measured on a red underline atfont-size: 40px, the painted line was 1.00 px for10px, for0.25emand for50%in 0.1.0, because all three were ignored, and it is 2.50 px, 2.50 px and 4.75 px now.auto,from-fontand the unitless multiple are what they were, and that package on its own still leavespt,pc,in,cm,mm,Q,vw,ex,chand a negative length alone. - Which is where the other release comes in. units 0.2.0 rewrites five more
properties,
text-decoration-thickness,transform,transform-origin,flexandgrid-template-columns, andCssUnitsHtmlExtensionis position 0 of this list and writes at thepreStylingstep, so a bundle user'stext-decoration-thickness: 30ptreaches the text metrics as40px. Measured on the same red underline: 79 red pixels, one row tall, before, and 720 pixels, nine rows tall, now, which is what40pxpaints on its own. text-metrics 0.2.0's owndoc/limitations.mdstill calls that gap open; it shipped before the release that closes it, and registering this bundle closes it. - The same rewrite reaches the two siblings that read a transform length and a
flex length, and neither needed a change to get it.
transform: translate(1in, 0)displaced the element by 0 and displaces it by 96 logical pixels now.flex: 0 0 2inin adisplay: flexcontainer gives an item 14.25 wide before and 192 now.grid-template-columns: 2in 1frgoes from 584 and 584 to 192 and 392. - One limitation arrives with the thickness, documented upstream, which the
extension does not cause and cannot fix: a child that declares its own
text-decorationerases the ancestor's line over the child's own text, and paints its own line in the ancestor's colour. OneTextStylecannot carry both. Measured atfont-size: 40pxwith a parentunderline redand a childoverline blue: 320 red pixels, against 560 with no declaration on the child. - Nothing about the registration changed.
CssTextMetricsHtmlExtensionandCssUnitsHtmlExtensionkeep their class names, which is what the Bootstrap and Vuetify registries match on, and each matches at the same step as before. units 0.2.0 states no new ordering rule: it writes atpreStylingand every sibling that reads what it wrote acts later, so both orders render alike.kCssLengthPropertiesonly gained entries, andkCssAbsoluteUnitsInPx,kCssViewportUnits,CssSpacingandCssSpacingUnitare untouched. The nineteen registered instances, their order andkBundledCssExtensionNamesare exactly those of 0.1.4, anddoc/order.mdstill carries the same fourteen rules. doc/order.mdcarries the qualifier the two releases ask for, at positions 0 and 8: the units rewrite reaches five more properties at the same step, and the text metrics now read a thickness length that arrives already converted.
0.1.4 #
flutter_html_css_flexmoves to^0.2.0. The caret on0.1.xno longer admits that release, so a bundle user would never have seen it.- 0.2.0 repairs the rest of the
displaykeywordsflutter_html3.0.0 reads asDisplay.inline, which demoted a block element to inline text and is worse than dropping the declaration.tablenow renders as a table display,table-row, the row, header and footer groups andtable-captionas block,table-cellandinline-tableas a shrink-to-fit box in the line, so two cells sit side by side.table-columnandtable-column-grouprender nothing, as a column box does in CSS.flowandrun-inrender block, andflow-root,contentsand the fiverubykeywords keep their ownDisplay. The two-value syntax is read as well, soinline flow-rootgets the inline-block box it asks for. Measured upstream on a<div>in an 800 pxHtml: 34 px and an 800x17 box, where each of those keywords used to give 17 px and no box of its own. - What it does not bring: no table layout, so no column widths, no shared row
height and no borders between cells; a two-value inner
flexorgridkeyword sets the box level only, so use the one-word form for the layout; an unknown keyword is left alone. One cost comes with it, documented upstream:tablemaps to the table display rather than to block, andflutter_htmltrims white space next to a block child only, so a space on either side of the box survives. - Nothing about the registration changed.
CssFlexHtmlExtensionkeeps its class name, which is what the Bootstrap and Vuetify registries match on; itsbuildingstep still claims only a flex or grid container, so it is terminal for the same elements as before; andkCssFlexDisplayValuesandkCssFlexPropertiesare unchanged. The nineteen registered instances, their order andkBundledCssExtensionNamesare exactly those of 0.1.3. doc/order.mdcarries the one qualifier the release asks for: the Bootstrap and Vuetifyd-*-table*classes stay suppressed, which is still correct because a suppressed declaration leaves a<div>block anyway, but adisplay: tablewritten into an inline style no longer demotes its element.
0.1.3 #
- Documentation only. No code change, no order change, no new dependency: the nineteen registered instances and their sequence are exactly those of 0.1.2.
- The README's limitation on utility-class suppression was stale. Both packages
used to recognise seven of the nineteen;
flutter_html_bootstrap0.1.3 recognises nine, withCssObjectFitHtmlExtensionandCssTransformHtmlExtensionadded, andflutter_html_vuetify0.1.2 recognises eight, withCssTextMetricsHtmlExtensionadded. The two counts are stated separately now because they are no longer the same number. - What that leaves suppressed is shorter than it was: the
borderlonghands andoverflow, in both packages. Bootstrap's 30object-fit-*classes and its threetranslate-middle*classes render once their companions are registered, and Vuetify'sletter-spacingrenders on twelve of its thirteentext-*typography classes —text-h5states none. None of them is named throughFlutterErrorany more. - This package is released for a documentation change, unlike its siblings, because its documentation is what describes the family.
0.1.2 #
- Three new siblings, so the bundle re-exports twenty-one packages and registers nineteen instances.
flutter_html_css_units0.1.0 is the new first entry, ahead ofCssBorderHtmlExtension. It rewritespt,pc,in,cm,mm,Q,vw,vh,vminandvmaxintopx, which is the one length unitflutter_html3.0.0 reads without loss:12ptused to render 12 logical pixels and50vwused to render 0. It has to come first, because a declaration written into the inline style after it has run keeps its unit and is then discarded, and because the border extension reads a length as its bare number. The stylesheet and utility-class arguments still go ahead of it, which is what its README asks for.flutter_html_css_background0.1.0 goes between the border extension andCssColorHtmlExtension. It rewrites thebackgroundshorthand, whichflutter_htmldrops whole, intobackground-color. Listed after the colour rewrite it would handflutter_htmla rawhsl(0 100% 50%)token, which renders black; in this order it renders red.flutter_html_css_text_transform0.1.0 goes next toCssTextMetricsHtmlExtension, in thepreProcessinggroup. It renderstext-transform, whichflutter_htmlparses and then never applies. It states no order rule, so the position is only there to keep the group together.flutter_html_css_percent_sizemoves to^0.2.0. That release adds percentagepaddingandmarginto the percentagewidthandheightit already resolved. It states no new order rule: the clamp survives either order against the size constraints, so the pinned position beforeCssObjectFitHtmlExtensionis unchanged.- New argument:
viewportSize. Pass aSizeandvw,vh,vminandvmaxresolve against it instead of againstMediaQuery, which is whatCssUnitsHtmlExtensionreads by default. Use it under aLayoutBuilder, or where there is noMediaQueryat all. doc/order.mdcarries fourteen ordering rules now rather than twelve, each with the render failure it prevents, andtest/order_test.dartpins the three new positions by name.parseInlineCssDeclarationsandstripImportantare hidden on the text-transform export.flutter_html_css_font_sizeexports both names already, and re-exporting two of each would make the name ambiguous for anyone importing this bundle. Import the text-transform package directly to reach its own pair.
0.1.1 #
- Wrote down how this package is released: a
Releasingsection inCONTRIBUTING.md, which ships in the archive. The short version: av*tag is the publish, this package ships for doc-only changes too, and every sibling release is followed by a constraint bump and a patch release here. - Renovate now raises a merge request for every sibling release, not only the
ones that escape the caret.
.gitlab/renovate.json5setsrangeStrategy: 'bump'on the eighteen re-exported packages, so^0.1.0becomes^0.1.1instead of staying silent.
0.1.0 #
- This release depends on the hosted siblings on pub.flutter-io.cn, every one of the eighteen as a caret constraint, and on no path dependency.
- Initial release. One dependency and one import for the
flutter_htmlextension packages of this family: it re-exports eighteen packages, andBundledCssExtensionsregisters sixteen instances, in the one registration order all of their rules allow. - The bundle is a class, not a function that hands back a list.
BundledCssExtensionsis aList<HtmlExtension>throughListMixin, so it drops straight intoHtml(extensions:), and every constructor on it isconst. That was the whole point:constcode is better optimised, aconstconstructor is still callable withoutconst, and a composed bundle stays a compile-time constant.kBundledCssExtensionsis aconstinstance of the defaults andbundledCssExtensions()is the function form, for the call with a dozen arguments. If you saw the earlier working tree, the names used to becssBundleExtensions(),kCssBundleExtensionsandkCssBundleExtensionNames; nothing was published under those, so they are simply gone rather than deprecated. - Your own extensions go in through
before,afterandinserts, allconst. AnInsertnames its anchor with aType, because a constructor cannot take a type parameter and the family already identifies an extension by its class.Insert.attakes a top-level function from the current list to an index, which is a constant expression, so even that staysconst.BundledCssExtensions.insertedBefore,.insertedAfterand.insertedAtare the one-point sugar. An anchor that is not in the list throws anArgumentErrorwhen the list is read, so a typo cannot quietly land your extension at the end, where ten of the sixteen lose the step they need. The list itself is read-only;[]=, thelengthsetter andaddall throw. - There is no
prependedByorfollowedBysugar, because plain Dart already covers the non-const case:[...const BundledCssExtensions(), MyExtension()]. That spread cannot beconst, which we checked rather than assumed. On Dart 3.13.0const [...kBundledCssExtensions, X()]is the compile errorconst_spread_expected_list_or_set: aconstspread needs a constant list value, and aconstobject that implementsListthroughListMixinis not one.beforeandafterexist for exactly that case. - The sixteen instances are created on the first read of the list, not at
construction, which is what lets the constructors be
const. They are then held in anExpandokeyed on the instance, which is the only cache aconstclass can have. That is not a precaution:HtmlParserreads the list once per element at each of its four extension steps, andListMixinreadslengthandoperator []once per entry of each pass. Measured bytest/composition_test.dart, group "the build cost": oneHtmlbuild of the short document there reads the list 1,830 times. - It re-exports the sibling classes rather than wrapping them. That is not a
style choice: the Bootstrap and Vuetify packages recognise a companion by
runtimeType.toString(), so a wrapper would carry the wrong name and quietly switch their suppression back on. - Arguments for the settings that change what gets rendered:
resolvePercentagesfor both extensions that resolve one,rootFontSizefor all three that resolve arem,extraCursorsfor interaction,imgAltfor the alt-text extension, and the full set of eleven image arguments, which go to object-fit. Eight of the eleven reachImgAltHtmlExtensionas well, because the images it renders as text are exactly the ones the renderer declines; onlyimageNetworkHeaders,imageAssetBundleandimageAssetPackagestop at object-fit. Anything beyond that means building the list by hand, anddoc/order.mdsays what such a list has to respect. flutter_html_css_stylesheetis in, as an opt-instylesheetExtension:argument that goes ahead of everything else. It is not on by default because registering it changes whatflutter_htmlitself renders: it resolves the cascade for<style>blocks and empties each block it reads.flutter_html_css_percent_sizeis in, after the size constraint and before object-fit. Neither percentage order is CSS. Measured by the group "the two building step rules, in both orders" intest/render_test.dart, in a containing block of 784, and recorded indoc/order.md:width: 50%; max-width: 100pxrenders 50 in this order and 384 in the other, and CSS says 100. This order keeps the clamp and errs small.flutter_html_img_altis in, last, and on by default. It is not acss_*package, but it is the family's comfort default: it renders thealttext of an<img>thatflutter_htmldeclines and would otherwise render as nothing at all, and it declines every image the built-in renderer renders, so no picture becomes text. One trap comes with it. It is the last entry, so anImageExtensionregistered after the bundle sits behind it, and anImageExtensionwith a customassetSchemaloses its image to thealttext. Put that one inbefore, or passimgAlt: false. The README andexample/example.mdboth show it.flutter_html_css_font_sizesits first among the pre-processing extensions, because it writes the element's font size into itsStyleandflutter_html_css_text_metricsresolves anemletter-spacing against that same field at the same step. Neither README says so; that one came out of the code.rootFontSizegoes to every extension that resolves arem, so aremlength, aremline height and aremfont size share a basis.flutter_html_css_coloris in, right after the border extension and ahead of border-radius. Its README states the second half of that: border-radius readsborderwith a colour parser that knows six names and nohsl(), so the rewrite torgba()has to land first. The first half is ours, and we found it by measuring rather than by reading. The colour extension used to skipborder-color, becauseflutter_htmlhas no case for it, and the border extension is what folds that longhand into aborder:shorthand the rewrite can see. Listed the other way round,border-color: hsl(0 100% 50%)rendered black. That finding went upstream: colour 0.1.0 rewrites the longhand too, so the order is no longer required. We keep it anyway, andtest/render_test.dartrenders the markup in both orders and expects red from each.flutter_html_css_line_heightis in, last of thepreProcessingstep extensions. It is the first sibling with no order rule at all: its README measured it against the font size, the text metrics, aTagExtension, Bootstrap and Vuetify, and nothing moved. It takesrootFontSizeas well, so that argument now reaches three extensions instead of two.flutter_html_css_interaction0.1.1 goes beforeflutter_html_css_size_constraints, which was that release's own measured rule against size-constraints 0.1.0: in the other order the size constraint ran twice and wrapped twice, 3ConstrainedBoxwidgets against 2. Size-constraints 0.1.1, which this bundle depends on, guards its own node as well, so either order now builds 2 and the position is kept by history. The two 0.1.1 releases also fix theStackOverflowErrorthatmax-width: 100px; cursor: pointeron one element used to throw, and the render test that pinned that crash now asserts the element renders.- The root font size reaches you as
kFlutterHtmlRootFontSize, fromflutter_html_css_font_size. Four packages used to export the same value askFlutterHtmlDefaultFontSize, which made two of them a compile error to import together; three have dropped the name andflutter_html_css_size_constraintsdeprecates it in its 0.1.1, which is the release this bundle depends on. It is hidden here as well, so one import of this bundle hands you one root font size constant and not two. Import the size-constraints package directly if you still need the old name.