fashionable 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/data/index.mjs +1 -1
  2. package/dist/declaration/index.d.mts +1 -1
  3. package/dist/declaration/index.mjs +1 -1
  4. package/dist/fontFace/index.d.mts +1 -1
  5. package/dist/property/index.d.mts +1 -1
  6. package/dist/property/index.mjs +1 -1
  7. package/dist/query/index.d.mts +1 -1
  8. package/dist/query/index.mjs +137 -3
  9. package/dist/query/index.mjs.map +1 -1
  10. package/dist/rule/index.d.mts +1 -1
  11. package/dist/rule/index.mjs +1 -1
  12. package/dist/shared/{color.internal-Dts5ycTm.mjs → color.internal-9fpSiiJk.mjs} +3 -3
  13. package/dist/shared/color.internal-9fpSiiJk.mjs.map +1 -0
  14. package/dist/shared/{declaration-1DlO_ltT.d.mts → declaration-B-6Ykgs_.d.mts} +2 -2
  15. package/dist/shared/{declaration.internal-wLB4ssxC.mjs → declaration.internal-BeasYIJ0.mjs} +2 -2
  16. package/dist/shared/{declaration.internal-wLB4ssxC.mjs.map → declaration.internal-BeasYIJ0.mjs.map} +1 -1
  17. package/dist/shared/{fontFaceRule-C7nYgH6X.d.mts → fontFaceRule-DdnLAuVw.d.mts} +2 -2
  18. package/dist/shared/mediaQuery-DsBivHi0.d.mts +333 -0
  19. package/dist/shared/{mediaQuery.internal-B6iuMd75.mjs → mediaQuery.internal-CKTmLVxL.mjs} +70 -6
  20. package/dist/shared/mediaQuery.internal-CKTmLVxL.mjs.map +1 -0
  21. package/dist/shared/{mediaRule-BDB4WCYy.d.mts → mediaRule-4kY2IOq-.d.mts} +3 -3
  22. package/dist/shared/{propertyRule-BbkFh9b9.d.mts → propertyRule-B5pf7NgH.d.mts} +2 -2
  23. package/dist/shared/{propertyRule.internal-Bc_HrfcL.mjs → propertyRule.internal-CRyFLwbn.mjs} +2 -2
  24. package/dist/shared/{propertyRule.internal-Bc_HrfcL.mjs.map → propertyRule.internal-CRyFLwbn.mjs.map} +1 -1
  25. package/dist/shared/{ruleSet.internal-DodzVMUU.mjs → ruleSet.internal-a5m40W9E.mjs} +3 -3
  26. package/dist/shared/{ruleSet.internal-DodzVMUU.mjs.map → ruleSet.internal-a5m40W9E.mjs.map} +1 -1
  27. package/dist/stylesheet/index.d.mts +29 -10
  28. package/dist/stylesheet/index.mjs +83 -21
  29. package/dist/stylesheet/index.mjs.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/shared/color.internal-Dts5ycTm.mjs.map +0 -1
  32. package/dist/shared/mediaQuery-BYR1z-iD.d.mts +0 -145
  33. package/dist/shared/mediaQuery.internal-B6iuMd75.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { Pipeable, dual, invariant } from "../utils.mjs";
2
2
  import { a as hash, i as equals$3, n as HashTypeId, r as combine, s as hashString, t as EqualTypeId } from "./equal-U9G5LhtL.mjs";
3
3
  import { w as unionRefs } from "./calc-Cih4o2r7.mjs";
4
- import { c as renderWith, o as refsOf, r as isDeclaration } from "./declaration.internal-wLB4ssxC.mjs";
5
- import { o as render$3 } from "./mediaQuery.internal-B6iuMd75.mjs";
4
+ import { c as renderWith, o as refsOf, r as isDeclaration } from "./declaration.internal-BeasYIJ0.mjs";
5
+ import { h as render$3 } from "./mediaQuery.internal-CKTmLVxL.mjs";
6
6
  import { o as isSelector, u as render$4 } from "./selector.internal-ESe9s0IH.mjs";
7
7
  //#region src/rule/rule.internal.ts
8
8
  /** @internal */
@@ -215,4 +215,4 @@ const equals = dual(2, (self, that) => equals$3(self, that));
215
215
  //#endregion
216
216
  export { renderStyleRuleBlock as C, refSetOf as S, equals$2 as _, forMediaQuery as a, refs$2 as b, isRuleSet as c, render as d, equals$1 as f, render$1 as g, refs$1 as h, equals as i, make as l, make$1 as m, concat as n, forSelector as o, isStyleRule as p, empty as r, isEmpty as s, append as t, refs as u, isMediaRule as v, resolveRenderOptions as w, render$2 as x, make$2 as y };
217
217
 
218
- //# sourceMappingURL=ruleSet.internal-DodzVMUU.mjs.map
218
+ //# sourceMappingURL=ruleSet.internal-a5m40W9E.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ruleSet.internal-DodzVMUU.mjs","names":["declarationRefsOf","renderDeclaration","renderQuery","renderSelector","Equal.EqualTypeId","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","renderQuery","make","refs","render","equals","Equal.EqualTypeId","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","renderSelector","make","refs","render","equals","Equal.EqualTypeId","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","makeStyleRule","makeMediaRule"],"sources":["../../src/rule/rule.internal.ts","../../src/rule/mediaRule.internal.ts","../../src/rule/styleRule.internal.ts","../../src/rule/ruleSet.internal.ts"],"sourcesContent":["/**\n * Shared plumbing for the three mutually recursive rule types: the\n * cross-type ref accessors and the nested-form block renderer. The\n * per-type internals import from here, and never from each other — with\n * one sanctioned exception: `ruleSet.internal.ts` imports the StyleRule\n * and MediaRule constructors for its pair-form `append` overloads. That\n * import is one-directional (neither per-type internal imports the rule\n * set's), so the recursion stays in the types and out of the module\n * graph. Members are discriminated structurally here (`'query' in\n * member`) for the same reason: importing the per-type guards would\n * close the cycle.\n */\n\nimport type { Precision } from '#calc/precision'\nimport {\n isDeclaration,\n refsOf as declarationRefsOf,\n renderWith as renderDeclaration,\n} from '#declaration/declaration.internal'\nimport { DEFAULT_INDENT } from '#internal/render'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport { render as renderQuery } from '#query/mediaQuery.internal'\nimport type { Selector } from '#selector/selector'\nimport { render as renderSelector } from '#selector/selector.internal'\nimport { invariant } from '#util'\nimport type { MediaRule } from './mediaRule.ts'\nimport type { Member, RuleSet } from './ruleSet.ts'\nimport type { StyleRule } from './styleRule.ts'\n\n/** @internal */\nexport const refSetOf = (\n value: RuleSet<string> | StyleRule<string> | MediaRule<string>,\n): ReadonlySet<string> => (value as unknown as { readonly refSet: ReadonlySet<string> }).refSet\n\n/** @internal */\nexport const memberRefs = (member: Member<string>): ReadonlySet<string> =>\n isDeclaration(member) ? declarationRefsOf(member) : refSetOf(member)\n\n/** @internal */\nexport interface RenderContext {\n readonly indent: string\n readonly precision: Precision | undefined\n readonly mediaSyntax: 'prefix' | 'range'\n}\n\n/** @internal */\nexport const resolveRenderOptions = (options?: {\n readonly indent?: string\n readonly precision?: Precision\n readonly mediaSyntax?: 'prefix' | 'range'\n}): RenderContext => ({\n indent: options?.indent ?? DEFAULT_INDENT,\n precision: options?.precision,\n mediaSyntax: options?.mediaSyntax ?? 'prefix',\n})\n\n/** @internal */\nexport const requireMediaRule = (\n member: StyleRule<string> | MediaRule<string>,\n): MediaRule<string> => {\n invariant(\n 'query' in member,\n 'A nested style rule has no v1 rendering — selector composition is a later extension; lift the rule to the top level of the stylesheet',\n )\n return member\n}\n\n/**\n * The nested-form body of a block: one line per declaration, nested\n * media rules as indented `@media` sub-blocks, in member order. Empty\n * blocks contribute nothing.\n *\n * @internal\n */\nexport const blockBodyLines = (\n block: RuleSet<string>,\n depth: number,\n context: RenderContext,\n): Array<string> => {\n const pad = context.indent.repeat(depth)\n const lines: Array<string> = []\n for (const member of block.members) {\n if (isDeclaration(member)) {\n lines.push(`${pad}${renderDeclaration(member, context.precision)}`)\n continue\n }\n const media = requireMediaRule(member)\n const inner = blockBodyLines(media.block, depth + 1, context)\n if (inner.length > 0) {\n const prelude = renderQuery(media.query, { mediaSyntax: context.mediaSyntax })\n lines.push(`${pad}@media ${prelude} {`, ...inner, `${pad}}`)\n }\n }\n return lines\n}\n\n/** @internal */\nexport const renderStyleRuleBlock = (\n selector: Selector,\n block: RuleSet<string>,\n context: RenderContext,\n): string => {\n const lines = blockBodyLines(block, 1, context)\n return lines.length === 0 ? '' : `${renderSelector(selector)} {\\n${lines.join('\\n')}\\n}`\n}\n\n/** @internal */\nexport const renderMediaRuleBlock = (\n query: MediaQuery,\n block: RuleSet<string>,\n context: RenderContext,\n): string => {\n const lines = blockBodyLines(block, 1, context)\n if (lines.length === 0) {\n return ''\n }\n const prelude = renderQuery(query, { mediaSyntax: context.mediaSyntax })\n return `@media ${prelude} {\\n${lines.join('\\n')}\\n}`\n}\n","import * as Equal from '#internal/equal'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport { render as renderQuery } from '#query/mediaQuery.internal'\nimport { dual, Pipeable } from '#util'\nimport type { MediaRule, RenderOptions } from './mediaRule.ts'\nimport { refSetOf, renderMediaRuleBlock, resolveRenderOptions } from './rule.internal.ts'\nimport type { RuleSet } from './ruleSet.ts'\n\nexport const MediaRuleTypeId = Symbol.for('fashionable/rule/mediaRule')\nexport type MediaRuleTypeId = typeof MediaRuleTypeId\n\nclass MediaRuleImpl extends Pipeable implements MediaRule<string>, Equal.Equal {\n readonly [MediaRuleTypeId]: MediaRuleTypeId = MediaRuleTypeId\n\n readonly query: MediaQuery\n readonly block: RuleSet<string>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(query: MediaQuery, block: RuleSet<string>) {\n super()\n this.query = query\n this.block = block\n this.refSet = refSetOf(block)\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isMediaRule(that) &&\n Equal.equals(this.query, that.query) &&\n Equal.equals(this.block, that.block)\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/rule/mediaRule')\n h = Equal.combine(h, Equal.hash(this.query))\n h = Equal.combine(h, Equal.hash(this.block))\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `MediaRule(${renderQuery(this.query)})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isMediaRule = (u: unknown): u is MediaRule<string> =>\n typeof u === 'object' && u !== null && MediaRuleTypeId in u\n\n/** @internal */\nexport function make<Refs extends string>(\n query: MediaQuery,\n block: RuleSet<Refs>,\n): MediaRule<Refs> {\n return new MediaRuleImpl(query, block) as unknown as MediaRule<Refs>\n}\n\n/** @internal */\nexport function refs<Refs extends string>(rule: MediaRule<Refs>): ReadonlySet<Refs> {\n return refSetOf(rule) as ReadonlySet<Refs>\n}\n\n/** @internal */\nexport const render = (rule: MediaRule<string>, options?: RenderOptions): string =>\n renderMediaRuleBlock(rule.query, rule.block, resolveRenderOptions(options))\n\n/** @internal */\nexport const equals = dual<\n (that: MediaRule<string>) => (self: MediaRule<string>) => boolean,\n (self: MediaRule<string>, that: MediaRule<string>) => boolean\n>(2, (self: MediaRule<string>, that: MediaRule<string>): boolean => Equal.equals(self, that))\n","import * as Equal from '#internal/equal'\nimport type { Selector } from '#selector/selector'\nimport { render as renderSelector } from '#selector/selector.internal'\nimport { dual, Pipeable } from '#util'\nimport { refSetOf, renderStyleRuleBlock, resolveRenderOptions } from './rule.internal.ts'\nimport type { RuleSet } from './ruleSet.ts'\nimport type { RenderOptions, StyleRule } from './styleRule.ts'\n\nexport const StyleRuleTypeId = Symbol.for('fashionable/rule/styleRule')\nexport type StyleRuleTypeId = typeof StyleRuleTypeId\n\nclass StyleRuleImpl extends Pipeable implements StyleRule<string>, Equal.Equal {\n readonly [StyleRuleTypeId]: StyleRuleTypeId = StyleRuleTypeId\n\n readonly selector: Selector\n readonly block: RuleSet<string>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(selector: Selector, block: RuleSet<string>) {\n super()\n this.selector = selector\n this.block = block\n this.refSet = refSetOf(block)\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isStyleRule(that) &&\n Equal.equals(this.selector, that.selector) &&\n Equal.equals(this.block, that.block)\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/rule/styleRule')\n h = Equal.combine(h, Equal.hash(this.selector))\n h = Equal.combine(h, Equal.hash(this.block))\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `StyleRule(${renderSelector(this.selector)})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isStyleRule = (u: unknown): u is StyleRule<string> =>\n typeof u === 'object' && u !== null && StyleRuleTypeId in u\n\n/** @internal */\nexport function make<Refs extends string>(\n selector: Selector,\n block: RuleSet<Refs>,\n): StyleRule<Refs> {\n return new StyleRuleImpl(selector, block) as unknown as StyleRule<Refs>\n}\n\n/** @internal */\nexport function refs<Refs extends string>(rule: StyleRule<Refs>): ReadonlySet<Refs> {\n return refSetOf(rule) as ReadonlySet<Refs>\n}\n\n/** @internal */\nexport const render = (rule: StyleRule<string>, options?: RenderOptions): string =>\n renderStyleRuleBlock(rule.selector, rule.block, resolveRenderOptions(options))\n\n/** @internal */\nexport const equals = dual<\n (that: StyleRule<string>) => (self: StyleRule<string>) => boolean,\n (self: StyleRule<string>, that: StyleRule<string>) => boolean\n>(2, (self: StyleRule<string>, that: StyleRule<string>): boolean => Equal.equals(self, that))\n","import * as Equal from '#internal/equal'\nimport { unionRefs } from '#internal/refs'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport type { Selector } from '#selector/selector'\nimport { isSelector } from '#selector/selector.internal'\nimport { dual, Pipeable } from '#util'\nimport { make as makeMediaRule } from './mediaRule.internal.ts'\nimport type { MediaRule } from './mediaRule.ts'\nimport { blockBodyLines, memberRefs, refSetOf, resolveRenderOptions } from './rule.internal.ts'\nimport type { Member, MemberRefs, RenderOptions, RuleSet } from './ruleSet.ts'\nimport { make as makeStyleRule } from './styleRule.internal.ts'\nimport type { StyleRule } from './styleRule.ts'\n\nexport const RuleSetTypeId = Symbol.for('fashionable/rule/ruleSet')\nexport type RuleSetTypeId = typeof RuleSetTypeId\n\nclass RuleSetImpl extends Pipeable implements RuleSet<string>, Equal.Equal {\n readonly [RuleSetTypeId]: RuleSetTypeId = RuleSetTypeId\n\n readonly members: ReadonlyArray<Member<string>>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(members: ReadonlyArray<Member<string>>) {\n super()\n this.members = members\n this.refSet = unionRefs(...members.map(memberRefs))\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isRuleSet(that) &&\n this.members.length === that.members.length &&\n this.members.every((member, index) => Equal.equals(member, that.members[index]))\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/rule/ruleSet')\n for (const member of this.members) {\n h = Equal.combine(h, Equal.hash(member))\n }\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `RuleSet(${this.members.length})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isRuleSet = (u: unknown): u is RuleSet<string> =>\n typeof u === 'object' && u !== null && RuleSetTypeId in u\n\n/** @internal */\nexport const empty: RuleSet<never> = new RuleSetImpl([]) as unknown as RuleSet<never>\n\n/** @internal */\nexport const isEmpty = (set: RuleSet<string>): boolean => set.members.length === 0\n\n/** @internal */\nexport function make<Members extends ReadonlyArray<Member<string>>>(\n ...members: Members\n): RuleSet<MemberRefs<Members[number]>> {\n return (members.length === 0 ? empty : new RuleSetImpl(members)) as RuleSet<\n MemberRefs<Members[number]>\n >\n}\n\nconst resolveMember = (head: unknown, block: unknown): Member<string> => {\n if (block === undefined) {\n return head as Member<string>\n }\n return isSelector(head)\n ? makeStyleRule(head, block as RuleSet<string>)\n : makeMediaRule(head as MediaQuery, block as RuleSet<string>)\n}\n\n/** @internal */\nexport const append: {\n <M extends Member<string>>(\n member: M,\n ): <Refs extends string>(self: RuleSet<Refs>) => RuleSet<Refs | MemberRefs<M>>\n <B extends string>(\n selector: Selector,\n block: RuleSet<B>,\n ): <Refs extends string>(self: RuleSet<Refs>) => RuleSet<Refs | B>\n <B extends string>(\n query: MediaQuery,\n block: RuleSet<B>,\n ): <Refs extends string>(self: RuleSet<Refs>) => RuleSet<Refs | B>\n <Refs extends string, M extends Member<string>>(\n self: RuleSet<Refs>,\n member: M,\n ): RuleSet<Refs | MemberRefs<M>>\n <Refs extends string, B extends string>(\n self: RuleSet<Refs>,\n selector: Selector,\n block: RuleSet<B>,\n ): RuleSet<Refs | B>\n <Refs extends string, B extends string>(\n self: RuleSet<Refs>,\n query: MediaQuery,\n block: RuleSet<B>,\n ): RuleSet<Refs | B>\n} = dual(\n (args: IArguments) => isRuleSet(args[0]),\n (self: RuleSet<string>, head: unknown, block?: unknown): RuleSet<string> =>\n new RuleSetImpl([...self.members, resolveMember(head, block)]),\n)\n\n/** @internal */\nexport const concat: {\n <B extends string>(that: RuleSet<B>): <A extends string>(self: RuleSet<A>) => RuleSet<A | B>\n <A extends string, B extends string>(self: RuleSet<A>, that: RuleSet<B>): RuleSet<A | B>\n} = dual(\n 2,\n (self: RuleSet<string>, that: RuleSet<string>): RuleSet<string> =>\n new RuleSetImpl([...self.members, ...that.members]),\n)\n\n/** @internal */\nexport const forSelector: {\n (selector: Selector): <Refs extends string>(self: RuleSet<Refs>) => StyleRule<Refs>\n <Refs extends string>(self: RuleSet<Refs>, selector: Selector): StyleRule<Refs>\n} = dual(\n 2,\n (self: RuleSet<string>, selector: Selector): StyleRule<string> => makeStyleRule(selector, self),\n)\n\n/** @internal */\nexport const forMediaQuery: {\n (query: MediaQuery): <Refs extends string>(self: RuleSet<Refs>) => MediaRule<Refs>\n <Refs extends string>(self: RuleSet<Refs>, query: MediaQuery): MediaRule<Refs>\n} = dual(\n 2,\n (self: RuleSet<string>, query: MediaQuery): MediaRule<string> => makeMediaRule(query, self),\n)\n\n/** @internal */\nexport function refs<Refs extends string>(set: RuleSet<Refs>): ReadonlySet<Refs> {\n return refSetOf(set) as ReadonlySet<Refs>\n}\n\n/** @internal */\nexport const render = (set: RuleSet<string>, options?: RenderOptions): string =>\n blockBodyLines(set, 0, resolveRenderOptions(options)).join('\\n')\n\n/** @internal */\nexport const equals = dual<\n (that: RuleSet<string>) => (self: RuleSet<string>) => boolean,\n (self: RuleSet<string>, that: RuleSet<string>) => boolean\n>(2, (self: RuleSet<string>, that: RuleSet<string>): boolean => Equal.equals(self, that))\n"],"mappings":";;;;;;;;AA8BA,MAAa,YACX,UACyB,MAA8D;;AAGzF,MAAa,cAAc,WACzB,cAAc,MAAM,IAAIA,OAAkB,MAAM,IAAI,SAAS,MAAM;;AAUrE,MAAa,wBAAwB,aAIf;CACpB,QAAQ,SAAS,UAAA;CACjB,WAAW,SAAS;CACpB,aAAa,SAAS,eAAe;AACvC;;AAGA,MAAa,oBACX,WACsB;CACtB,UACE,WAAW,QACX,uIACF;CACA,OAAO;AACT;;;;;;;;AASA,MAAa,kBACX,OACA,OACA,YACkB;CAClB,MAAM,MAAM,QAAQ,OAAO,OAAO,KAAK;CACvC,MAAM,QAAuB,CAAC;CAC9B,KAAK,MAAM,UAAU,MAAM,SAAS;EAClC,IAAI,cAAc,MAAM,GAAG;GACzB,MAAM,KAAK,GAAG,MAAMC,WAAkB,QAAQ,QAAQ,SAAS,GAAG;GAClE;EACF;EACA,MAAM,QAAQ,iBAAiB,MAAM;EACrC,MAAM,QAAQ,eAAe,MAAM,OAAO,QAAQ,GAAG,OAAO;EAC5D,IAAI,MAAM,SAAS,GAAG;GACpB,MAAM,UAAUC,SAAY,MAAM,OAAO,EAAE,aAAa,QAAQ,YAAY,CAAC;GAC7E,MAAM,KAAK,GAAG,IAAI,SAAS,QAAQ,KAAK,GAAG,OAAO,GAAG,IAAI,EAAE;EAC7D;CACF;CACA,OAAO;AACT;;AAGA,MAAa,wBACX,UACA,OACA,YACW;CACX,MAAM,QAAQ,eAAe,OAAO,GAAG,OAAO;CAC9C,OAAO,MAAM,WAAW,IAAI,KAAK,GAAGC,SAAe,QAAQ,EAAE,MAAM,MAAM,KAAK,IAAI,EAAE;AACtF;;AAGA,MAAa,wBACX,OACA,OACA,YACW;CACX,MAAM,QAAQ,eAAe,OAAO,GAAG,OAAO;CA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C,CACjE;;AAGA,MAAa,SAGT,KACF,IACC,MAAuB,SACtB,IAAI,YAAY,CAAC,GAAG,KAAK,SAAS,GAAG,KAAK,OAAO,CAAC,CACtD;;AAGA,MAAa,cAGT,KACF,IACC,MAAuB,aAA0CD,OAAc,UAAU,IAAI,CAChG;;AAGA,MAAa,gBAGT,KACF,IACC,MAAuB,UAAyCC,OAAc,OAAO,IAAI,CAC5F;;AAGA,SAAgB,KAA0B,KAAuC;CAC/E,OAAO,SAAS,GAAG;AACrB;;AAGA,MAAa,UAAU,KAAsB,YAC3C,eAAe,KAAK,GAAG,qBAAqB,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI;;AAGjE,MAAa,SAAS,KAGpB,IAAI,MAAuB,SAAmCP,SAAa,MAAM,IAAI,CAAC"}
1
+ {"version":3,"file":"ruleSet.internal-a5m40W9E.mjs","names":["declarationRefsOf","renderDeclaration","renderQuery","renderSelector","Equal.EqualTypeId","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","renderQuery","make","refs","render","equals","Equal.EqualTypeId","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","renderSelector","make","refs","render","equals","Equal.EqualTypeId","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","makeStyleRule","makeMediaRule"],"sources":["../../src/rule/rule.internal.ts","../../src/rule/mediaRule.internal.ts","../../src/rule/styleRule.internal.ts","../../src/rule/ruleSet.internal.ts"],"sourcesContent":["/**\n * Shared plumbing for the three mutually recursive rule types: the\n * cross-type ref accessors and the nested-form block renderer. The\n * per-type internals import from here, and never from each other — with\n * one sanctioned exception: `ruleSet.internal.ts` imports the StyleRule\n * and MediaRule constructors for its pair-form `append` overloads. That\n * import is one-directional (neither per-type internal imports the rule\n * set's), so the recursion stays in the types and out of the module\n * graph. Members are discriminated structurally here (`'query' in\n * member`) for the same reason: importing the per-type guards would\n * close the cycle.\n */\n\nimport type { Precision } from '#calc/precision'\nimport {\n isDeclaration,\n refsOf as declarationRefsOf,\n renderWith as renderDeclaration,\n} from '#declaration/declaration.internal'\nimport { DEFAULT_INDENT } from '#internal/render'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport { render as renderQuery } from '#query/mediaQuery.internal'\nimport type { Selector } from '#selector/selector'\nimport { render as renderSelector } from '#selector/selector.internal'\nimport { invariant } from '#util'\nimport type { MediaRule } from './mediaRule.ts'\nimport type { Member, RuleSet } from './ruleSet.ts'\nimport type { StyleRule } from './styleRule.ts'\n\n/** @internal */\nexport const refSetOf = (\n value: RuleSet<string> | StyleRule<string> | MediaRule<string>,\n): ReadonlySet<string> => (value as unknown as { readonly refSet: ReadonlySet<string> }).refSet\n\n/** @internal */\nexport const memberRefs = (member: Member<string>): ReadonlySet<string> =>\n isDeclaration(member) ? declarationRefsOf(member) : refSetOf(member)\n\n/** @internal */\nexport interface RenderContext {\n readonly indent: string\n readonly precision: Precision | undefined\n readonly mediaSyntax: 'prefix' | 'range'\n}\n\n/** @internal */\nexport const resolveRenderOptions = (options?: {\n readonly indent?: string\n readonly precision?: Precision\n readonly mediaSyntax?: 'prefix' | 'range'\n}): RenderContext => ({\n indent: options?.indent ?? DEFAULT_INDENT,\n precision: options?.precision,\n mediaSyntax: options?.mediaSyntax ?? 'prefix',\n})\n\n/** @internal */\nexport const requireMediaRule = (\n member: StyleRule<string> | MediaRule<string>,\n): MediaRule<string> => {\n invariant(\n 'query' in member,\n 'A nested style rule has no v1 rendering — selector composition is a later extension; lift the rule to the top level of the stylesheet',\n )\n return member\n}\n\n/**\n * The nested-form body of a block: one line per declaration, nested\n * media rules as indented `@media` sub-blocks, in member order. Empty\n * blocks contribute nothing.\n *\n * @internal\n */\nexport const blockBodyLines = (\n block: RuleSet<string>,\n depth: number,\n context: RenderContext,\n): Array<string> => {\n const pad = context.indent.repeat(depth)\n const lines: Array<string> = []\n for (const member of block.members) {\n if (isDeclaration(member)) {\n lines.push(`${pad}${renderDeclaration(member, context.precision)}`)\n continue\n }\n const media = requireMediaRule(member)\n const inner = blockBodyLines(media.block, depth + 1, context)\n if (inner.length > 0) {\n const prelude = renderQuery(media.query, { mediaSyntax: context.mediaSyntax })\n lines.push(`${pad}@media ${prelude} {`, ...inner, `${pad}}`)\n }\n }\n return lines\n}\n\n/** @internal */\nexport const renderStyleRuleBlock = (\n selector: Selector,\n block: RuleSet<string>,\n context: RenderContext,\n): string => {\n const lines = blockBodyLines(block, 1, context)\n return lines.length === 0 ? '' : `${renderSelector(selector)} {\\n${lines.join('\\n')}\\n}`\n}\n\n/** @internal */\nexport const renderMediaRuleBlock = (\n query: MediaQuery,\n block: RuleSet<string>,\n context: RenderContext,\n): string => {\n const lines = blockBodyLines(block, 1, context)\n if (lines.length === 0) {\n return ''\n }\n const prelude = renderQuery(query, { mediaSyntax: context.mediaSyntax })\n return `@media ${prelude} {\\n${lines.join('\\n')}\\n}`\n}\n","import * as Equal from '#internal/equal'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport { render as renderQuery } from '#query/mediaQuery.internal'\nimport { dual, Pipeable } from '#util'\nimport type { MediaRule, RenderOptions } from './mediaRule.ts'\nimport { refSetOf, renderMediaRuleBlock, resolveRenderOptions } from './rule.internal.ts'\nimport type { RuleSet } from './ruleSet.ts'\n\nexport const MediaRuleTypeId = Symbol.for('fashionable/rule/mediaRule')\nexport type MediaRuleTypeId = typeof MediaRuleTypeId\n\nclass MediaRuleImpl extends Pipeable implements MediaRule<string>, Equal.Equal {\n readonly [MediaRuleTypeId]: MediaRuleTypeId = MediaRuleTypeId\n\n readonly query: MediaQuery\n readonly block: RuleSet<string>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(query: MediaQuery, block: RuleSet<string>) {\n super()\n this.query = query\n this.block = block\n this.refSet = refSetOf(block)\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isMediaRule(that) &&\n Equal.equals(this.query, that.query) &&\n Equal.equals(this.block, that.block)\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/rule/mediaRule')\n h = Equal.combine(h, Equal.hash(this.query))\n h = Equal.combine(h, Equal.hash(this.block))\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `MediaRule(${renderQuery(this.query)})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isMediaRule = (u: unknown): u is MediaRule<string> =>\n typeof u === 'object' && u !== null && MediaRuleTypeId in u\n\n/** @internal */\nexport function make<Refs extends string>(\n query: MediaQuery,\n block: RuleSet<Refs>,\n): MediaRule<Refs> {\n return new MediaRuleImpl(query, block) as unknown as MediaRule<Refs>\n}\n\n/** @internal */\nexport function refs<Refs extends string>(rule: MediaRule<Refs>): ReadonlySet<Refs> {\n return refSetOf(rule) as ReadonlySet<Refs>\n}\n\n/** @internal */\nexport const render = (rule: MediaRule<string>, options?: RenderOptions): string =>\n renderMediaRuleBlock(rule.query, rule.block, resolveRenderOptions(options))\n\n/** @internal */\nexport const equals = dual<\n (that: MediaRule<string>) => (self: MediaRule<string>) => boolean,\n (self: MediaRule<string>, that: MediaRule<string>) => boolean\n>(2, (self: MediaRule<string>, that: MediaRule<string>): boolean => Equal.equals(self, that))\n","import * as Equal from '#internal/equal'\nimport type { Selector } from '#selector/selector'\nimport { render as renderSelector } from '#selector/selector.internal'\nimport { dual, Pipeable } from '#util'\nimport { refSetOf, renderStyleRuleBlock, resolveRenderOptions } from './rule.internal.ts'\nimport type { RuleSet } from './ruleSet.ts'\nimport type { RenderOptions, StyleRule } from './styleRule.ts'\n\nexport const StyleRuleTypeId = Symbol.for('fashionable/rule/styleRule')\nexport type StyleRuleTypeId = typeof StyleRuleTypeId\n\nclass StyleRuleImpl extends Pipeable implements StyleRule<string>, Equal.Equal {\n readonly [StyleRuleTypeId]: StyleRuleTypeId = StyleRuleTypeId\n\n readonly selector: Selector\n readonly block: RuleSet<string>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(selector: Selector, block: RuleSet<string>) {\n super()\n this.selector = selector\n this.block = block\n this.refSet = refSetOf(block)\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isStyleRule(that) &&\n Equal.equals(this.selector, that.selector) &&\n Equal.equals(this.block, that.block)\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/rule/styleRule')\n h = Equal.combine(h, Equal.hash(this.selector))\n h = Equal.combine(h, Equal.hash(this.block))\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `StyleRule(${renderSelector(this.selector)})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isStyleRule = (u: unknown): u is StyleRule<string> =>\n typeof u === 'object' && u !== null && StyleRuleTypeId in u\n\n/** @internal */\nexport function make<Refs extends string>(\n selector: Selector,\n block: RuleSet<Refs>,\n): StyleRule<Refs> {\n return new StyleRuleImpl(selector, block) as unknown as StyleRule<Refs>\n}\n\n/** @internal */\nexport function refs<Refs extends string>(rule: StyleRule<Refs>): ReadonlySet<Refs> {\n return refSetOf(rule) as ReadonlySet<Refs>\n}\n\n/** @internal */\nexport const render = (rule: StyleRule<string>, options?: RenderOptions): string =>\n renderStyleRuleBlock(rule.selector, rule.block, resolveRenderOptions(options))\n\n/** @internal */\nexport const equals = dual<\n (that: StyleRule<string>) => (self: StyleRule<string>) => boolean,\n (self: StyleRule<string>, that: StyleRule<string>) => boolean\n>(2, (self: StyleRule<string>, that: StyleRule<string>): boolean => Equal.equals(self, that))\n","import * as Equal from '#internal/equal'\nimport { unionRefs } from '#internal/refs'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport type { Selector } from '#selector/selector'\nimport { isSelector } from '#selector/selector.internal'\nimport { dual, Pipeable } from '#util'\nimport { make as makeMediaRule } from './mediaRule.internal.ts'\nimport type { MediaRule } from './mediaRule.ts'\nimport { blockBodyLines, memberRefs, refSetOf, resolveRenderOptions } from './rule.internal.ts'\nimport type { Member, MemberRefs, RenderOptions, RuleSet } from './ruleSet.ts'\nimport { make as makeStyleRule } from './styleRule.internal.ts'\nimport type { StyleRule } from './styleRule.ts'\n\nexport const RuleSetTypeId = Symbol.for('fashionable/rule/ruleSet')\nexport type RuleSetTypeId = typeof RuleSetTypeId\n\nclass RuleSetImpl extends Pipeable implements RuleSet<string>, Equal.Equal {\n readonly [RuleSetTypeId]: RuleSetTypeId = RuleSetTypeId\n\n readonly members: ReadonlyArray<Member<string>>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(members: ReadonlyArray<Member<string>>) {\n super()\n this.members = members\n this.refSet = unionRefs(...members.map(memberRefs))\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isRuleSet(that) &&\n this.members.length === that.members.length &&\n this.members.every((member, index) => Equal.equals(member, that.members[index]))\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/rule/ruleSet')\n for (const member of this.members) {\n h = Equal.combine(h, Equal.hash(member))\n }\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `RuleSet(${this.members.length})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isRuleSet = (u: unknown): u is RuleSet<string> =>\n typeof u === 'object' && u !== null && RuleSetTypeId in u\n\n/** @internal */\nexport const empty: RuleSet<never> = new RuleSetImpl([]) as unknown as RuleSet<never>\n\n/** @internal */\nexport const isEmpty = (set: RuleSet<string>): boolean => set.members.length === 0\n\n/** @internal */\nexport function make<Members extends ReadonlyArray<Member<string>>>(\n ...members: Members\n): RuleSet<MemberRefs<Members[number]>> {\n return (members.length === 0 ? empty : new RuleSetImpl(members)) as RuleSet<\n MemberRefs<Members[number]>\n >\n}\n\nconst resolveMember = (head: unknown, block: unknown): Member<string> => {\n if (block === undefined) {\n return head as Member<string>\n }\n return isSelector(head)\n ? makeStyleRule(head, block as RuleSet<string>)\n : makeMediaRule(head as MediaQuery, block as RuleSet<string>)\n}\n\n/** @internal */\nexport const append: {\n <M extends Member<string>>(\n member: M,\n ): <Refs extends string>(self: RuleSet<Refs>) => RuleSet<Refs | MemberRefs<M>>\n <B extends string>(\n selector: Selector,\n block: RuleSet<B>,\n ): <Refs extends string>(self: RuleSet<Refs>) => RuleSet<Refs | B>\n <B extends string>(\n query: MediaQuery,\n block: RuleSet<B>,\n ): <Refs extends string>(self: RuleSet<Refs>) => RuleSet<Refs | B>\n <Refs extends string, M extends Member<string>>(\n self: RuleSet<Refs>,\n member: M,\n ): RuleSet<Refs | MemberRefs<M>>\n <Refs extends string, B extends string>(\n self: RuleSet<Refs>,\n selector: Selector,\n block: RuleSet<B>,\n ): RuleSet<Refs | B>\n <Refs extends string, B extends string>(\n self: RuleSet<Refs>,\n query: MediaQuery,\n block: RuleSet<B>,\n ): RuleSet<Refs | B>\n} = dual(\n (args: IArguments) => isRuleSet(args[0]),\n (self: RuleSet<string>, head: unknown, block?: unknown): RuleSet<string> =>\n new RuleSetImpl([...self.members, resolveMember(head, block)]),\n)\n\n/** @internal */\nexport const concat: {\n <B extends string>(that: RuleSet<B>): <A extends string>(self: RuleSet<A>) => RuleSet<A | B>\n <A extends string, B extends string>(self: RuleSet<A>, that: RuleSet<B>): RuleSet<A | B>\n} = dual(\n 2,\n (self: RuleSet<string>, that: RuleSet<string>): RuleSet<string> =>\n new RuleSetImpl([...self.members, ...that.members]),\n)\n\n/** @internal */\nexport const forSelector: {\n (selector: Selector): <Refs extends string>(self: RuleSet<Refs>) => StyleRule<Refs>\n <Refs extends string>(self: RuleSet<Refs>, selector: Selector): StyleRule<Refs>\n} = dual(\n 2,\n (self: RuleSet<string>, selector: Selector): StyleRule<string> => makeStyleRule(selector, self),\n)\n\n/** @internal */\nexport const forMediaQuery: {\n (query: MediaQuery): <Refs extends string>(self: RuleSet<Refs>) => MediaRule<Refs>\n <Refs extends string>(self: RuleSet<Refs>, query: MediaQuery): MediaRule<Refs>\n} = dual(\n 2,\n (self: RuleSet<string>, query: MediaQuery): MediaRule<string> => makeMediaRule(query, self),\n)\n\n/** @internal */\nexport function refs<Refs extends string>(set: RuleSet<Refs>): ReadonlySet<Refs> {\n return refSetOf(set) as ReadonlySet<Refs>\n}\n\n/** @internal */\nexport const render = (set: RuleSet<string>, options?: RenderOptions): string =>\n blockBodyLines(set, 0, resolveRenderOptions(options)).join('\\n')\n\n/** @internal */\nexport const equals = dual<\n (that: RuleSet<string>) => (self: RuleSet<string>) => boolean,\n (self: RuleSet<string>, that: RuleSet<string>) => boolean\n>(2, (self: RuleSet<string>, that: RuleSet<string>): boolean => Equal.equals(self, that))\n"],"mappings":";;;;;;;;AA8BA,MAAa,YACX,UACyB,MAA8D;;AAGzF,MAAa,cAAc,WACzB,cAAc,MAAM,IAAIA,OAAkB,MAAM,IAAI,SAAS,MAAM;;AAUrE,MAAa,wBAAwB,aAIf;CACpB,QAAQ,SAAS,UAAA;CACjB,WAAW,SAAS;CACpB,aAAa,SAAS,eAAe;AACvC;;AAGA,MAAa,oBACX,WACsB;CACtB,UACE,WAAW,QACX,uIACF;CACA,OAAO;AACT;;;;;;;;AASA,MAAa,kBACX,OACA,OACA,YACkB;CAClB,MAAM,MAAM,QAAQ,OAAO,OAAO,KAAK;CACvC,MAAM,QAAuB,CAAC;CAC9B,KAAK,MAAM,UAAU,MAAM,SAAS;EAClC,IAAI,cAAc,MAAM,GAAG;GACzB,MAAM,KAAK,GAAG,MAAMC,WAAkB,QAAQ,QAAQ,SAAS,GAAG;GAClE;EACF;EACA,MAAM,QAAQ,iBAAiB,MAAM;EACrC,MAAM,QAAQ,eAAe,MAAM,OAAO,QAAQ,GAAG,OAAO;EAC5D,IAAI,MAAM,SAAS,GAAG;GACpB,MAAM,UAAUC,SAAY,MAAM,OAAO,EAA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AAGjF,SAAgB,KACd,GAAG,SACmC;CACtC,OAAQ,QAAQ,WAAW,IAAI,QAAQ,IAAI,YAAY,OAAO;AAGhE;AAEA,MAAM,iBAAiB,MAAe,UAAmC;CACvE,IAAI,UAAU,KAAA,GACZ,OAAO;CAET,OAAO,WAAW,IAAI,IAClBI,OAAc,MAAM,KAAwB,IAC5CC,OAAc,MAAoB,KAAwB;AAChE;;AAGA,MAAa,SA0BT,MACD,SAAqB,UAAU,KAAK,EAAE,IACtC,MAAuB,MAAe,UACrC,IAAI,YAAY,CAAC,GAAG,KAAK,SAAS,cAAc,MAAM,KAAK,CAAC,CAAC,CACjE;;AAGA,MAAa,SAGT,KACF,IACC,MAAuB,SACtB,IAAI,YAAY,CAAC,GAAG,KAAK,SAAS,GAAG,KAAK,OAAO,CAAC,CACtD;;AAGA,MAAa,cAGT,KACF,IACC,MAAuB,aAA0CD,OAAc,UAAU,IAAI,CAChG;;AAGA,MAAa,gBAGT,KACF,IACC,MAAuB,UAAyCC,OAAc,OAAO,IAAI,CAC5F;;AAGA,SAAgB,KAA0B,KAAuC;CAC/E,OAAO,SAAS,GAAG;AACrB;;AAGA,MAAa,UAAU,KAAsB,YAC3C,eAAe,KAAK,GAAG,qBAAqB,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI;;AAGjE,MAAa,SAAS,KAGpB,IAAI,MAAuB,SAAmCP,SAAa,MAAM,IAAI,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { t as Pipeable } from "../shared/utils-BKm298I-.mjs";
2
- import { t as FontFaceRule } from "../shared/fontFaceRule-C7nYgH6X.mjs";
3
- import { t as PropertyRule } from "../shared/propertyRule-BbkFh9b9.mjs";
2
+ import { t as FontFaceRule } from "../shared/fontFaceRule-DdnLAuVw.mjs";
3
+ import { t as PropertyRule } from "../shared/propertyRule-B5pf7NgH.mjs";
4
4
  import { t as Selector } from "../shared/selector-HZY-W6l6.mjs";
5
- import { a as StyleRule, n as RenderOptions$1, r as RuleSet } from "../shared/mediaRule-BDB4WCYy.mjs";
5
+ import { a as StyleRule, n as RenderOptions$1, r as RuleSet } from "../shared/mediaRule-4kY2IOq-.mjs";
6
6
  //#region src/stylesheet/stylesheet.internal.d.ts
7
7
  declare const StylesheetTypeId: unique symbol;
8
8
  type StylesheetTypeId = typeof StylesheetTypeId;
@@ -208,12 +208,25 @@ declare const mergeAll: <Refs extends string>(sheets: ReadonlyArray<Stylesheet<R
208
208
  */
209
209
  interface CoalesceOptions {
210
210
  /**
211
- * When `true`, unsafe pulls throw instead of rewriting the cascade: a
212
- * pull is unsafe when the coalesced rule's block would move backward
213
- * across an intervening style rule whose selector ties the coalesced
214
- * selector on specificity. The check is conservative it cannot know
215
- * whether tying selectors can match the same element, so any tie
216
- * refuses. Defaults to `false`.
211
+ * When `true`, unsafe pulls throw instead of rewriting the cascade.
212
+ * Defaults to `false`.
213
+ *
214
+ * A pull moves the coalesced rule's block backward across every rule
215
+ * between the first occurrence of its selector and the later one. The
216
+ * pull throws when an intervening style rule ties the coalesced
217
+ * selector on specificity, unless every moved declaration is provably
218
+ * shadowed by that rule.
219
+ *
220
+ * Shadowed means the crossed rule, in its final coalesced form,
221
+ * re-establishes the declaration. It contains a structurally equal
222
+ * declaration under a media query implied by the moved one's query.
223
+ * No later member whose query can hold alongside the moved one's sets
224
+ * a different value.
225
+ *
226
+ * The check never reasons about whether tying selectors can match the
227
+ * same element. It refuses what it cannot prove: a crossing whose
228
+ * blocks nest style rules, or a moved declaration without a
229
+ * re-establishing twin.
217
230
  */
218
231
  readonly strict?: boolean;
219
232
  }
@@ -230,10 +243,16 @@ interface CoalesceOptions {
230
243
  * checked invariant — a build gate that proves the sheet's coalesce is
231
244
  * cascade-preserving.
232
245
  *
246
+ * Coalesce is a repair operation for sheets whose construction you
247
+ * don't control. If strict mode refuses a sheet you built yourself,
248
+ * don't weaken the check — assemble in the target shape instead:
249
+ * refusal usually means the operation is reconstructing an intent you
250
+ * could express directly.
251
+ *
233
252
  * @param sheet - The sheet to normalize.
234
253
  * @param options - Optional strictness.
235
254
  * @returns The coalesced sheet; the same instance when no selector repeats, so coalesce is idempotent.
236
- * @throws `Error` in strict mode, when a pull crosses an intervening rule that ties on specificity.
255
+ * @throws `Error` in strict mode, when a pull crosses an intervening tying rule that does not provably shadow every moved declaration.
237
256
  * @since 0.1.0
238
257
  */
239
258
  declare const coalesce: <Refs extends string>(sheet: Stylesheet<Refs>, options?: CoalesceOptions) => Stylesheet<Refs>;
@@ -2,10 +2,12 @@ import { t as __exportAll } from "../shared/rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { Pipeable, dual, invariant } from "../utils.mjs";
3
3
  import { a as hash, i as equals$2, n as HashTypeId, r as combine, s as hashString, t as EqualTypeId } from "../shared/equal-U9G5LhtL.mjs";
4
4
  import { C as EMPTY_REFS, w as unionRefs } from "../shared/calc-Cih4o2r7.mjs";
5
+ import { r as isDeclaration } from "../shared/declaration.internal-BeasYIJ0.mjs";
5
6
  import { n as isFontFaceRule, o as render$2 } from "../shared/fontFaceRule.internal-D5u48TUO.mjs";
6
- import { a as render$3, r as isPropertyRule } from "../shared/propertyRule.internal-Bc_HrfcL.mjs";
7
+ import { a as render$3, r as isPropertyRule } from "../shared/propertyRule.internal-CRyFLwbn.mjs";
8
+ import { n as coSatisfiable, u as implies } from "../shared/mediaQuery.internal-CKTmLVxL.mjs";
7
9
  import { f as specificity, h as compare, u as render$4 } from "../shared/selector.internal-ESe9s0IH.mjs";
8
- import { C as renderStyleRuleBlock, S as refSetOf, m as make$2, n as concat, p as isStyleRule, w as resolveRenderOptions } from "../shared/ruleSet.internal-DodzVMUU.mjs";
10
+ import { C as renderStyleRuleBlock, S as refSetOf, m as make$2, n as concat, p as isStyleRule, v as isMediaRule, w as resolveRenderOptions } from "../shared/ruleSet.internal-a5m40W9E.mjs";
9
11
  //#region src/stylesheet/stylesheet.internal.ts
10
12
  const StylesheetTypeId = Symbol.for("fashionable/stylesheet");
11
13
  const nodeRefs = (node) => isStyleRule(node) ? refSetOf(node) : EMPTY_REFS;
@@ -40,10 +42,10 @@ var StylesheetImpl = class extends Pipeable {
40
42
  /** @internal */
41
43
  const isStylesheet$1 = (u) => typeof u === "object" && u !== null && StylesheetTypeId in u;
42
44
  const appendDistinct = (kept, buckets, node) => {
43
- const hash$1 = hash(node);
44
- const bucket = buckets.get(hash$1);
45
+ const hash$2 = hash(node);
46
+ const bucket = buckets.get(hash$2);
45
47
  if (bucket?.some((existing) => equals$2(existing, node))) return false;
46
- if (bucket === void 0) buckets.set(hash$1, [node]);
48
+ if (bucket === void 0) buckets.set(hash$2, [node]);
47
49
  else bucket.push(node);
48
50
  kept.push(node);
49
51
  return true;
@@ -87,49 +89,103 @@ function mergeAll$1(sheets) {
87
89
  for (const sheet of sheets) merged = merge$1(merged, sheet);
88
90
  return merged;
89
91
  }
90
- /**
91
- * The strict-mode check: a pull is unsafe when any style rule between
92
- * the anchor and the sheet's tail ties the pulled selector on
93
- * specificity without being the same selector. Conservative — without
94
- * matching semantics there is no telling whether tying selectors can
95
- * reach the same element, so a tie always refuses.
96
- */
97
- const requireSafePull = (kept, anchor, selector) => {
98
- const pulled = specificity(selector);
92
+ const settersOf = (block) => {
93
+ const setters = [];
94
+ for (const member of block.members) if (isDeclaration(member)) setters.push({
95
+ declaration: member,
96
+ query: void 0
97
+ });
98
+ else if (isMediaRule(member)) for (const inner of member.block.members) {
99
+ if (!isDeclaration(inner)) return;
100
+ setters.push({
101
+ declaration: inner,
102
+ query: member.query
103
+ });
104
+ }
105
+ else return;
106
+ return setters;
107
+ };
108
+ const collectCrossings = (kept, anchor, rule, pending) => {
109
+ const pulled = specificity(rule.selector);
99
110
  for (let index = anchor + 1; index < kept.length; index++) {
100
111
  const node = kept[index];
101
- if (!isStyleRule(node) || equals$2(node.selector, selector)) continue;
102
- invariant(compare(specificity(node.selector), pulled) !== 0, `Coalescing '${render$4(selector)}' would pull its block across '${render$4(node.selector)}', which ties on specificity — the pull can change the cascade`);
112
+ if (!isStyleRule(node) || equals$2(node.selector, rule.selector)) continue;
113
+ if (compare(specificity(node.selector), pulled) === 0) pending.push({
114
+ selector: rule.selector,
115
+ block: rule.block,
116
+ crossedIndex: index
117
+ });
118
+ }
119
+ };
120
+ /**
121
+ * The strict-mode check: a pull is unsafe when the moved block crosses a
122
+ * style rule whose selector ties the pulled selector on specificity,
123
+ * unless every moved declaration is provably shadowed by the crossed
124
+ * rule. Shadowed means the crossed rule re-establishes the declaration —
125
+ * a structurally equal declaration under a query the moved one's query
126
+ * implies — and no later member under a co-satisfiable query sets a
127
+ * different value. Matching semantics stay out of scope: the check never
128
+ * asks whether tying selectors reach the same element, only whether the
129
+ * move could change a computed value if they did.
130
+ *
131
+ * Crossings are collected during the fold but verified afterwards,
132
+ * against each crossed rule's final member list: a re-establishing
133
+ * setter can arrive from a node after the moved block (the scheme
134
+ * mirror in docs/feedback-dtcg-resolver.md section 1), invisible to a
135
+ * check that fires at encounter time. The safety argument is therefore
136
+ * global rather than per-move — coalescing preserves member order
137
+ * within every selector family, so the shadow conditions over the final
138
+ * list pin the crossed family's last applicable setter in every state
139
+ * where the moved declaration applies.
140
+ */
141
+ const requireShadowedPull = (pull, nodes) => {
142
+ const crossed = nodes[pull.crossedIndex];
143
+ const moved = settersOf(pull.block);
144
+ const members = settersOf(crossed.block);
145
+ invariant(moved !== void 0 && members !== void 0, `Coalescing '${render$4(pull.selector)}' would pull its block across '${render$4(crossed.selector)}', which ties on specificity and nests beyond the shadow check — the pull can change the cascade`);
146
+ for (const setter of moved) {
147
+ const name = setter.declaration.name;
148
+ const competing = members.filter((member) => member.declaration.name === name);
149
+ if (competing.length === 0) continue;
150
+ const reestablished = competing.findLastIndex((member) => implies(setter.query, member.query) && equals$2(member.declaration, setter.declaration));
151
+ invariant(reestablished !== -1, `Coalescing '${render$4(pull.selector)}' would pull '${name}' across '${render$4(crossed.selector)}', which ties on specificity without re-establishing its value — the pull can change the cascade`);
152
+ for (let index = reestablished + 1; index < competing.length; index++) {
153
+ const later = competing[index];
154
+ invariant(!coSatisfiable(setter.query, later.query) || equals$2(later.declaration, setter.declaration), `Coalescing '${render$4(pull.selector)}' would pull '${name}' across '${render$4(crossed.selector)}', which ties on specificity and later diverges from its value — the pull can change the cascade`);
155
+ }
103
156
  }
104
157
  };
105
158
  /** @internal */
106
159
  function coalesce$1(sheet, options) {
160
+ const strict = options?.strict === true;
107
161
  const nodes = [];
108
162
  const seen = /* @__PURE__ */ new Map();
163
+ const pending = [];
109
164
  let changed = false;
110
165
  for (const node of sheet.nodes) {
111
166
  if (!isStyleRule(node)) {
112
167
  nodes.push(node);
113
168
  continue;
114
169
  }
115
- const hash$2 = hash(node.selector);
116
- const entries = seen.get(hash$2);
170
+ const hash$1 = hash(node.selector);
171
+ const entries = seen.get(hash$1);
117
172
  const first = entries?.find((entry) => equals$2(entry.selector, node.selector));
118
173
  if (first === void 0) {
119
174
  const entry = {
120
175
  selector: node.selector,
121
176
  index: nodes.length
122
177
  };
123
- if (entries === void 0) seen.set(hash$2, [entry]);
178
+ if (entries === void 0) seen.set(hash$1, [entry]);
124
179
  else entries.push(entry);
125
180
  nodes.push(node);
126
181
  continue;
127
182
  }
128
- if (options?.strict === true) requireSafePull(nodes, first.index, node.selector);
183
+ if (strict) collectCrossings(nodes, first.index, node, pending);
129
184
  const target = nodes[first.index];
130
185
  nodes[first.index] = make$2(target.selector, concat(target.block, node.block));
131
186
  changed = true;
132
187
  }
188
+ for (const pull of pending) requireShadowedPull(pull, nodes);
133
189
  return changed ? new StylesheetImpl(nodes) : sheet;
134
190
  }
135
191
  /** @internal */
@@ -241,10 +297,16 @@ const mergeAll = mergeAll$1;
241
297
  * checked invariant — a build gate that proves the sheet's coalesce is
242
298
  * cascade-preserving.
243
299
  *
300
+ * Coalesce is a repair operation for sheets whose construction you
301
+ * don't control. If strict mode refuses a sheet you built yourself,
302
+ * don't weaken the check — assemble in the target shape instead:
303
+ * refusal usually means the operation is reconstructing an intent you
304
+ * could express directly.
305
+ *
244
306
  * @param sheet - The sheet to normalize.
245
307
  * @param options - Optional strictness.
246
308
  * @returns The coalesced sheet; the same instance when no selector repeats, so coalesce is idempotent.
247
- * @throws `Error` in strict mode, when a pull crosses an intervening rule that ties on specificity.
309
+ * @throws `Error` in strict mode, when a pull crosses an intervening tying rule that does not provably shadow every moved declaration.
248
310
  * @since 0.1.0
249
311
  */
250
312
  const coalesce = coalesce$1;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Equal.EqualTypeId","isStylesheet","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","hash","empty","isEmpty","make","makeStyleRule","append","merge","mergeAll","compareSpecificity","renderSelector","coalesce","concatBlocks","refs","render","renderFontFace","renderPropertyRule","equals","internal.isStylesheet","internal.empty","internal.isEmpty","internal.make","internal.append","internal.merge","internal.mergeAll","internal.coalesce","internal.refs","internal.render","internal.equals"],"sources":["../../src/stylesheet/stylesheet.internal.ts","../../src/stylesheet/stylesheet.ts"],"sourcesContent":["import { isFontFaceRule, render as renderFontFace } from '#fontFace/fontFaceRule.internal'\nimport * as Equal from '#internal/equal'\nimport { EMPTY_REFS, unionRefs } from '#internal/refs'\nimport type { RenderOptions as PropertyRenderOptions } from '#property/propertyRule'\nimport { isPropertyRule, render as renderPropertyRule } from '#property/propertyRule.internal'\nimport {\n refSetOf,\n type RenderContext,\n renderStyleRuleBlock,\n resolveRenderOptions,\n} from '#rule/rule.internal'\nimport type { RuleSet } from '#rule/ruleSet'\nimport { concat as concatBlocks } from '#rule/ruleSet.internal'\nimport type { StyleRule } from '#rule/styleRule'\nimport { isStyleRule, make as makeStyleRule } from '#rule/styleRule.internal'\nimport type { Selector } from '#selector/selector'\nimport { render as renderSelector, specificity } from '#selector/selector.internal'\nimport { compare as compareSpecificity } from '#selector/specificity.internal'\nimport { dual, invariant, Pipeable } from '#util'\nimport type { CoalesceOptions, Node, NodeRefs, RenderOptions, Stylesheet } from './stylesheet.ts'\n\nexport const StylesheetTypeId = Symbol.for('fashionable/stylesheet')\nexport type StylesheetTypeId = typeof StylesheetTypeId\n\nconst nodeRefs = (node: Node<string>): ReadonlySet<string> =>\n isStyleRule(node) ? refSetOf(node) : EMPTY_REFS\n\nclass StylesheetImpl extends Pipeable implements Stylesheet<string>, Equal.Equal {\n readonly [StylesheetTypeId]: StylesheetTypeId = StylesheetTypeId\n\n readonly nodes: ReadonlyArray<Node<string>>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(nodes: ReadonlyArray<Node<string>>) {\n super()\n this.nodes = nodes\n this.refSet = unionRefs(...nodes.map(nodeRefs))\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isStylesheet(that) &&\n this.nodes.length === that.nodes.length &&\n this.nodes.every((node, index) => Equal.equals(node, that.nodes[index]))\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/stylesheet')\n for (const node of this.nodes) {\n h = Equal.combine(h, Equal.hash(node))\n }\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `Stylesheet(${this.nodes.length})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isStylesheet = (u: unknown): u is Stylesheet<string> =>\n typeof u === 'object' && u !== null && StylesheetTypeId in u\n\nconst appendDistinct = (\n kept: Array<Node<string>>,\n buckets: Map<number, Array<Node<string>>>,\n node: Node<string>,\n): boolean => {\n const hash = Equal.hash(node)\n const bucket = buckets.get(hash)\n if (bucket?.some((existing) => Equal.equals(existing, node))) {\n return false\n }\n if (bucket === undefined) {\n buckets.set(hash, [node])\n } else {\n bucket.push(node)\n }\n kept.push(node)\n return true\n}\n\nconst distinct = (nodes: ReadonlyArray<Node<string>>): Array<Node<string>> => {\n const kept: Array<Node<string>> = []\n const buckets = new Map<number, Array<Node<string>>>()\n for (const node of nodes) {\n appendDistinct(kept, buckets, node)\n }\n return kept\n}\n\n/** @internal */\nexport const empty: Stylesheet<never> = new StylesheetImpl([]) as unknown as Stylesheet<never>\n\n/** @internal */\nexport const isEmpty = (sheet: Stylesheet<string>): boolean => sheet.nodes.length === 0\n\n/** @internal */\nexport function make<Nodes extends ReadonlyArray<Node<string>>>(\n ...nodes: Nodes\n): Stylesheet<NodeRefs<Nodes[number]>> {\n const kept = distinct(nodes)\n return (kept.length === 0 ? empty : new StylesheetImpl(kept)) as Stylesheet<\n NodeRefs<Nodes[number]>\n >\n}\n\nconst resolveNode = (head: unknown, block: unknown): Node<string> =>\n block === undefined\n ? (head as Node<string>)\n : makeStyleRule(head as Selector, block as RuleSet<string>)\n\n/** @internal */\nexport const append: {\n <N extends Node<string>>(\n node: N,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | NodeRefs<N>>\n <B extends string>(\n selector: Selector,\n block: RuleSet<B>,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | B>\n <Refs extends string, N extends Node<string>>(\n self: Stylesheet<Refs>,\n node: N,\n ): Stylesheet<Refs | NodeRefs<N>>\n <Refs extends string, B extends string>(\n self: Stylesheet<Refs>,\n selector: Selector,\n block: RuleSet<B>,\n ): Stylesheet<Refs | B>\n} = dual(\n (args: IArguments) => isStylesheet(args[0]),\n (self: Stylesheet<string>, head: unknown, block?: unknown): Stylesheet<string> => {\n const node = resolveNode(head, block)\n if (self.nodes.some((existing) => Equal.equals(existing, node))) {\n return self\n }\n return new StylesheetImpl([...self.nodes, node])\n },\n)\n\n/** @internal */\nexport const merge: {\n <B extends string>(\n that: Stylesheet<B>,\n ): <A extends string>(self: Stylesheet<A>) => Stylesheet<A | B>\n <A extends string, B extends string>(self: Stylesheet<A>, that: Stylesheet<B>): Stylesheet<A | B>\n} = dual(2, (self: Stylesheet<string>, that: Stylesheet<string>): Stylesheet<string> => {\n if (that.nodes.length === 0) {\n return self\n }\n if (self.nodes.length === 0) {\n return that\n }\n const kept: Array<Node<string>> = []\n const buckets = new Map<number, Array<Node<string>>>()\n for (const node of self.nodes) {\n appendDistinct(kept, buckets, node)\n }\n let changed = false\n for (const node of that.nodes) {\n if (appendDistinct(kept, buckets, node)) {\n changed = true\n }\n }\n return changed ? new StylesheetImpl(kept) : self\n})\n\n/** @internal */\nexport function mergeAll<Refs extends string>(\n sheets: ReadonlyArray<Stylesheet<Refs>>,\n): Stylesheet<Refs> {\n let merged: Stylesheet<string> = empty\n for (const sheet of sheets) {\n merged = merge(merged, sheet)\n }\n return merged as Stylesheet<Refs>\n}\n\n/**\n * The strict-mode check: a pull is unsafe when any style rule between\n * the anchor and the sheet's tail ties the pulled selector on\n * specificity without being the same selector. Conservative — without\n * matching semantics there is no telling whether tying selectors can\n * reach the same element, so a tie always refuses.\n */\nconst requireSafePull = (\n kept: ReadonlyArray<Node<string>>,\n anchor: number,\n selector: Selector,\n): void => {\n const pulled = specificity(selector)\n for (let index = anchor + 1; index < kept.length; index++) {\n const node = kept[index] as Node<string>\n if (!isStyleRule(node) || Equal.equals(node.selector, selector)) {\n continue\n }\n invariant(\n compareSpecificity(specificity(node.selector), pulled) !== 0,\n `Coalescing '${renderSelector(selector)}' would pull its block across '${renderSelector(node.selector)}', which ties on specificity — the pull can change the cascade`,\n )\n }\n}\n\n/** @internal */\nexport function coalesce<Refs extends string>(\n sheet: Stylesheet<Refs>,\n options?: CoalesceOptions,\n): Stylesheet<Refs> {\n const nodes: Array<Node<string>> = []\n const seen = new Map<number, Array<{ readonly selector: Selector; readonly index: number }>>()\n let changed = false\n for (const node of sheet.nodes) {\n if (!isStyleRule(node)) {\n nodes.push(node)\n continue\n }\n const hash = Equal.hash(node.selector)\n const entries = seen.get(hash)\n const first = entries?.find((entry) => Equal.equals(entry.selector, node.selector))\n if (first === undefined) {\n const entry = { selector: node.selector, index: nodes.length }\n if (entries === undefined) {\n seen.set(hash, [entry])\n } else {\n entries.push(entry)\n }\n nodes.push(node)\n continue\n }\n if (options?.strict === true) {\n requireSafePull(nodes, first.index, node.selector)\n }\n const target = nodes[first.index] as StyleRule<string>\n nodes[first.index] = makeStyleRule(target.selector, concatBlocks(target.block, node.block))\n changed = true\n }\n return (changed ? new StylesheetImpl(nodes) : sheet) as Stylesheet<Refs>\n}\n\n/** @internal */\nexport function refs<Refs extends string>(sheet: Stylesheet<Refs>): ReadonlySet<Refs> {\n return (sheet as unknown as StylesheetImpl).refSet as ReadonlySet<Refs>\n}\n\nconst propertyRenderOptions = (context: RenderContext): PropertyRenderOptions =>\n context.precision === undefined\n ? { indent: context.indent }\n : { indent: context.indent, precision: context.precision }\n\n/** @internal */\nexport const render = (sheet: Stylesheet<string>, options?: RenderOptions): string => {\n const context = resolveRenderOptions(options)\n const sections: Array<string> = []\n for (const node of sheet.nodes) {\n if (isFontFaceRule(node)) {\n sections.push(renderFontFace(node, { indent: context.indent }))\n } else if (isPropertyRule(node)) {\n sections.push(renderPropertyRule(node, propertyRenderOptions(context)))\n } else {\n const section = renderStyleRuleBlock(node.selector, node.block, context)\n if (section !== '') {\n sections.push(section)\n }\n }\n }\n return sections.join('\\n\\n')\n}\n\n/** @internal */\nexport const equals = dual<\n (that: Stylesheet<string>) => (self: Stylesheet<string>) => boolean,\n (self: Stylesheet<string>, that: Stylesheet<string>) => boolean\n>(2, (self: Stylesheet<string>, that: Stylesheet<string>): boolean => Equal.equals(self, that))\n","import type { FontFaceRule } from '#fontFace/fontFaceRule'\nimport type { PropertyRule } from '#property/propertyRule'\nimport type { RenderOptions as RuleSetRenderOptions, RuleSet } from '#rule/ruleSet'\nimport type { StyleRule } from '#rule/styleRule'\nimport type { Selector } from '#selector/selector'\nimport type { Pipeable } from '#util'\nimport type { StylesheetTypeId } from './stylesheet.internal.ts'\nimport * as internal from './stylesheet.internal.ts'\n\n/**\n * The top level of a CSS file: an ordered sequence of style rules and\n * declaration-block at-rules, kept structurally distinct.\n *\n * Node order is preserved exactly as authored — never sorted, because\n * top-level order is cascade behavior — but a node structurally equal to\n * an earlier one is dropped at construction, the first occurrence\n * winning. That distinctness invariant is what makes `merge` a lawful\n * monoid: sheets from independent emitters fold without duplicating the\n * rules they share.\n *\n * The `Refs` parameter unions the nodes' unbound reference names, as on\n * `Calc` — read `Stylesheet<'depth'>` as \"this sheet reads\n * `var(--depth)`\": a dependency report, not an error state. `refs` is\n * the runtime set.\n *\n * Construct via `make` (or `empty` and `append`).\n *\n * @since 0.1.0\n */\nexport interface Stylesheet<out Refs extends string = string> extends Pipeable {\n readonly [StylesheetTypeId]: StylesheetTypeId\n /**\n * The sheet's nodes, in authored order, structurally distinct.\n */\n readonly nodes: ReadonlyArray<Node<Refs>>\n}\n\n/**\n * The forms a stylesheet may contain at its top level: style rules and\n * the declaration-block at-rules (`@font-face`, `@property`).\n *\n * Deliberately absent are `Declaration` — CSS has no top-level\n * declarations — and `MediaRule`: media enters the model nested inside a\n * style rule's block, and renders there. The full unrepresentability\n * scheme lives in `docs/design.md`.\n *\n * @since 0.1.0\n */\nexport type Node<Refs extends string = string> = StyleRule<Refs> | FontFaceRule | PropertyRule\n\n/**\n * The unbound reference names of a `Node`, or the union of them for a\n * union of nodes — the type-level counterpart of `refs`, used by the\n * constructors to thread node names into the result. Only style rules\n * carry references; the at-rule forms contribute `never`, since\n * `@property` initial values are closed by construction.\n *\n * @since 0.1.0\n */\nexport type NodeRefs<N extends Node<string>> = N extends StyleRule<infer R> ? R : never\n\n/**\n * Checks if a value is a `Stylesheet`.\n *\n * True only for values built by this module's constructors, which carry\n * the brand.\n *\n * @param u - The value to check.\n * @returns `true` if the value is a `Stylesheet`, `false` otherwise.\n * @since 0.1.0\n */\nexport const isStylesheet: (u: unknown) => u is Stylesheet<string> = internal.isStylesheet\n\n/**\n * The empty stylesheet — the identity for `merge`.\n *\n * @since 0.1.0\n */\nexport const empty: Stylesheet<never> = internal.empty\n\n/**\n * Checks if the sheet has no nodes.\n *\n * Structural emptiness only: a non-empty sheet can still *render* as the\n * empty string, when every node is a style rule whose block renders\n * empty — `render` guarantees the empty string in both cases.\n *\n * @param sheet - The sheet to inspect.\n * @returns `true` if the sheet has no nodes.\n * @since 0.2.0\n */\nexport const isEmpty: (sheet: Stylesheet<string>) => boolean = internal.isEmpty\n\n/**\n * Creates a stylesheet holding the given nodes, in the given order, with\n * structural duplicates dropped — the first occurrence wins.\n *\n * @param nodes - Style rules and at-rules, in authored order.\n * @returns A `Stylesheet` whose `Refs` unions the nodes' reference names.\n * @example\n * ```ts\n * const sheet = Stylesheet.make(\n * PropertyRule.make('--depth', PropertySyntax.number, 0),\n * StyleRule.make(\n * Selector.class('card'),\n * RuleSet.make(Declaration.make('--indent', Calc.multiply(Calc.ref('depth'), 8))),\n * ),\n * ) // Stylesheet<'depth'>\n * ```\n * @since 0.1.0\n */\nexport const make: <Nodes extends ReadonlyArray<Node<string>>>(\n ...nodes: Nodes\n) => Stylesheet<NodeRefs<Nodes[number]>> = internal.make\n\nexport const append: {\n /**\n * Returns a function that appends `node` to its argument's sheet.\n *\n * @param node - The node to append.\n * @returns A function producing the extended sheet.\n * @since 0.1.0\n */\n <N extends Node<string>>(\n node: N,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | NodeRefs<N>>\n /**\n * Returns a function that appends the style rule `selector { block }`\n * to its argument's sheet.\n *\n * @param selector - The rule's selector.\n * @param block - The rule's block.\n * @returns A function producing the extended sheet.\n * @since 0.1.0\n */\n <B extends string>(\n selector: Selector,\n block: RuleSet<B>,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | B>\n /**\n * Appends a node at the end of the sheet — unless a structurally equal\n * node is already present, in which case the same sheet comes back\n * unchanged (the first occurrence wins). Otherwise the result is a new\n * sheet; the original is untouched.\n *\n * @param self - The sheet to extend.\n * @param node - The node to append.\n * @returns The extended sheet, with the node's reference names joined in.\n * @since 0.1.0\n */\n <Refs extends string, N extends Node<string>>(\n self: Stylesheet<Refs>,\n node: N,\n ): Stylesheet<Refs | NodeRefs<N>>\n /**\n * Appends a style rule from its parts — sugar for\n * `append(self, StyleRule.make(selector, block))`, so sheets compose\n * without naming `StyleRule` at the call site. Deduplication applies\n * as usual: a sheet already carrying an equal rule comes back\n * unchanged.\n *\n * @param self - The sheet to extend.\n * @param selector - The rule's selector.\n * @param block - The rule's block.\n * @returns The extended sheet, with the block's reference names joined in.\n * @example\n * ```ts\n * Stylesheet.empty.pipe(\n * Stylesheet.append(Selector.root, RuleSet.make(Declaration.make('--depth', 0))),\n * )\n * ```\n * @since 0.1.0\n */\n <Refs extends string, B extends string>(\n self: Stylesheet<Refs>,\n selector: Selector,\n block: RuleSet<B>,\n ): Stylesheet<Refs | B>\n} = internal.append\n\nexport const merge: {\n /**\n * Returns a function that merges `that`'s novel nodes after its\n * argument's.\n *\n * @param that - The sheet whose novel nodes come second.\n * @returns A function producing the merged sheet.\n * @since 0.1.0\n */\n <B extends string>(\n that: Stylesheet<B>,\n ): <A extends string>(self: Stylesheet<A>) => Stylesheet<A | B>\n /**\n * Merges two sheets: `self`'s nodes followed by the nodes of `that`\n * not already present, order preserved on both sides — structural\n * duplicates collapse to their first occurrence. With `empty` as\n * identity this is a lawful monoid (associative, idempotent), which is\n * the multi-emitter fold: emitters that each register the rules they\n * share merge to a sheet carrying one copy.\n *\n * Identity and idempotence hold by reference, not just structurally:\n * merging `empty` on either side, or a sheet with itself, returns that\n * same instance.\n *\n * @param self - The sheet whose nodes come first.\n * @param that - The sheet whose novel nodes follow.\n * @returns The merged sheet, with both sides' reference names unioned.\n * @example\n * ```ts\n * const contract = Stylesheet.make(PropertyRule.make('--depth', PropertySyntax.number, 0))\n * Stylesheet.merge(contract, contract) // === contract — merge is idempotent\n * ```\n * @since 0.1.0\n */\n <A extends string, B extends string>(self: Stylesheet<A>, that: Stylesheet<B>): Stylesheet<A | B>\n} = internal.merge\n\n/**\n * Folds any number of sheets with `merge`, left to right — `empty` when\n * given none.\n *\n * @param sheets - The sheets to fold, in order.\n * @returns The merged sheet, with every sheet's reference names unioned.\n * @since 0.1.0\n */\nexport const mergeAll: <Refs extends string>(\n sheets: ReadonlyArray<Stylesheet<Refs>>,\n) => Stylesheet<Refs> = internal.mergeAll\n\n/**\n * Options for `coalesce`.\n *\n * @since 0.2.0\n */\nexport interface CoalesceOptions {\n /**\n * When `true`, unsafe pulls throw instead of rewriting the cascade: a\n * pull is unsafe when the coalesced rule's block would move backward\n * across an intervening style rule whose selector ties the coalesced\n * selector on specificity. The check is conservative — it cannot know\n * whether tying selectors can match the same element, so any tie\n * refuses. Defaults to `false`.\n */\n readonly strict?: boolean\n}\n\n/**\n * Coalesces style rules that share a selector: each later rule's block\n * is concatenated onto the first rule with a structurally equal selector\n * (in sheet order, as `RuleSet.concat` would), and the later rule is\n * dropped. Other node kinds pass through untouched.\n *\n * Deliberately separate from `merge`, and order-sensitive: pulling a\n * block backward past an intervening rule can change the cascade when\n * the intervening selector ties on specificity, so coalescing is an\n * explicit opt-in normalization. `strict` turns that caution into a\n * checked invariant — a build gate that proves the sheet's coalesce is\n * cascade-preserving.\n *\n * @param sheet - The sheet to normalize.\n * @param options - Optional strictness.\n * @returns The coalesced sheet; the same instance when no selector repeats, so coalesce is idempotent.\n * @throws `Error` in strict mode, when a pull crosses an intervening rule that ties on specificity.\n * @since 0.1.0\n */\nexport const coalesce: <Refs extends string>(\n sheet: Stylesheet<Refs>,\n options?: CoalesceOptions,\n) => Stylesheet<Refs> = internal.coalesce\n\n/**\n * The sheet's unbound reference names, unioned across nodes — the custom\n * properties the sheet reads via `var()`, including everything nested\n * rules contribute.\n *\n * @param sheet - The sheet to inspect.\n * @returns The set of unbound reference names.\n * @since 0.1.0\n */\nexport const refs: <Refs extends string>(sheet: Stylesheet<Refs>) => ReadonlySet<Refs> =\n internal.refs\n\n/**\n * Options for `render`: the indentation unit, precision context, and\n * media syntax, shared with the rule renderers. One options value\n * composes across every `render` in the library — the renderers that\n * take fewer keys accept it and ignore the rest.\n *\n * Options change text, never meaning: the same sheet renders the same\n * cascade under any of them.\n *\n * @since 0.1.0\n */\nexport type RenderOptions = RuleSetRenderOptions\n\n/**\n * Renders the whole sheet as CSS text: at-rule nodes as their own\n * blocks, style rules in nested form with their `@media` blocks kept\n * inside, in member order.\n *\n * Empty blocks emit nothing, so a sheet whose every node renders empty —\n * `empty` itself, or style rules with empty blocks — renders the empty\n * string; composing renders into a larger file never needs to reach into\n * `nodes`. Top-level sections join with one blank line, without a\n * trailing newline. Unbound references render as `var(--name)`.\n *\n * @param sheet - The stylesheet to render.\n * @param options - Optional indentation unit, precision context, and media syntax.\n * @returns Deterministic CSS text.\n * @throws `Error` when a style rule nests inside another rule's block — selector composition (`&`) is a later extension, not part of v1 rendering.\n * @example\n * ```ts\n * const sheet = Stylesheet.empty.pipe(\n * Stylesheet.append(\n * Selector.root,\n * RuleSet.make(Declaration.make('--gutter', 16)).pipe(\n * RuleSet.append(MediaQuery.minWidth(768), RuleSet.make(Declaration.make('--gutter', 24))),\n * ),\n * ),\n * )\n * Stylesheet.render(sheet)\n * // \":root {\\n\\t--gutter: 16;\\n\\t@media (min-width: 768px) {\\n\\t\\t--gutter: 24;\\n\\t}\\n}\"\n * ```\n * @since 0.1.0\n */\nexport const render: (sheet: Stylesheet<string>, options?: RenderOptions) => string =\n internal.render\n\nexport const equals: {\n /**\n * Returns a function that checks structural equality against `that`.\n *\n * @param that - The sheet to compare against.\n * @returns A function testing its argument for structural equality with `that`.\n * @since 0.1.0\n */\n (that: Stylesheet<string>): (self: Stylesheet<string>) => boolean\n /**\n * Structural equality over nodes, in order. Order participates —\n * sheets holding the same nodes in different orders cascade\n * differently, so they compare unequal.\n *\n * @param self - The first sheet.\n * @param that - The second sheet.\n * @returns `true` if the sheets are structurally equal.\n * @since 0.1.0\n */\n (self: Stylesheet<string>, that: Stylesheet<string>): boolean\n} = internal.equals\n"],"mappings":";;;;;;;;;AAqBA,MAAa,mBAAmB,OAAO,IAAI,wBAAwB;AAGnE,MAAM,YAAY,SAChB,YAAY,IAAI,IAAI,SAAS,IAAI,IAAI;AAEvC,IAAM,iBAAN,cAA6B,SAAoD;CAC/E,CA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AAU,OAA2B,YAAoC;CACpF,MAAM,UAAU,qBAAqB,OAAO;CAC5C,MAAM,WAA0B,CAAC;CACjC,KAAK,MAAM,QAAQ,MAAM,OACvB,IAAI,eAAe,IAAI,GACrB,SAAS,KAAKC,SAAe,MAAM,EAAE,QAAQ,QAAQ,OAAO,CAAC,CAAC;MACzD,IAAI,eAAe,IAAI,GAC5B,SAAS,KAAKC,SAAmB,MAAM,sBAAsB,OAAO,CAAC,CAAC;MACjE;EACL,MAAM,UAAU,qBAAqB,KAAK,UAAU,KAAK,OAAO,OAAO;EACvE,IAAI,YAAY,IACd,SAAS,KAAK,OAAO;CAEzB;CAEF,OAAO,SAAS,KAAK,MAAM;AAC7B;;AAGA,MAAaC,WAAS,KAGpB,IAAI,MAA0B,SAAsCtB,SAAa,MAAM,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;ACnN9F,MAAa,eAAwDuB;;;;;;AAOrE,MAAa,QAA2BC;;;;;;;;;;;;AAaxC,MAAa,UAAkDC;;;;;;;;;;;;;;;;;;;AAoB/D,MAAa,OAE8BC;AAE3C,MAAa,SA+DTC;AAEJ,MAAa,QAmCTC;;;;;;;;;AAUJ,MAAa,WAEWC;;;;;;;;;;;;;;;;;;;;AAsCxB,MAAa,WAGWC;;;;;;;;;;AAWxB,MAAa,OACXC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CF,MAAa,SACXC;AAEF,MAAa,SAoBTC"}
1
+ {"version":3,"file":"index.mjs","names":["Equal.EqualTypeId","isStylesheet","Equal.equals","Equal.HashTypeId","#hash","Equal.hashString","Equal.combine","Equal.hash","hash","empty","isEmpty","make","makeStyleRule","append","merge","mergeAll","compareSpecificity","renderSelector","coalesce","concatBlocks","refs","render","renderFontFace","renderPropertyRule","equals","internal.isStylesheet","internal.empty","internal.isEmpty","internal.make","internal.append","internal.merge","internal.mergeAll","internal.coalesce","internal.refs","internal.render","internal.equals"],"sources":["../../src/stylesheet/stylesheet.internal.ts","../../src/stylesheet/stylesheet.ts"],"sourcesContent":["import type { Declaration } from '#declaration/declaration'\nimport { isDeclaration } from '#declaration/declaration.internal'\nimport { isFontFaceRule, render as renderFontFace } from '#fontFace/fontFaceRule.internal'\nimport * as Equal from '#internal/equal'\nimport { EMPTY_REFS, unionRefs } from '#internal/refs'\nimport type { RenderOptions as PropertyRenderOptions } from '#property/propertyRule'\nimport { isPropertyRule, render as renderPropertyRule } from '#property/propertyRule.internal'\nimport type { MediaQuery } from '#query/mediaQuery'\nimport { coSatisfiable, implies } from '#query/mediaQuery.internal'\nimport { isMediaRule } from '#rule/mediaRule.internal'\nimport {\n refSetOf,\n type RenderContext,\n renderStyleRuleBlock,\n resolveRenderOptions,\n} from '#rule/rule.internal'\nimport type { RuleSet } from '#rule/ruleSet'\nimport { concat as concatBlocks } from '#rule/ruleSet.internal'\nimport type { StyleRule } from '#rule/styleRule'\nimport { isStyleRule, make as makeStyleRule } from '#rule/styleRule.internal'\nimport type { Selector } from '#selector/selector'\nimport { render as renderSelector, specificity } from '#selector/selector.internal'\nimport { compare as compareSpecificity } from '#selector/specificity.internal'\nimport { dual, invariant, Pipeable } from '#util'\nimport type { CoalesceOptions, Node, NodeRefs, RenderOptions, Stylesheet } from './stylesheet.ts'\n\nexport const StylesheetTypeId = Symbol.for('fashionable/stylesheet')\nexport type StylesheetTypeId = typeof StylesheetTypeId\n\nconst nodeRefs = (node: Node<string>): ReadonlySet<string> =>\n isStyleRule(node) ? refSetOf(node) : EMPTY_REFS\n\nclass StylesheetImpl extends Pipeable implements Stylesheet<string>, Equal.Equal {\n readonly [StylesheetTypeId]: StylesheetTypeId = StylesheetTypeId\n\n readonly nodes: ReadonlyArray<Node<string>>\n readonly refSet: ReadonlySet<string>\n #hash: number | undefined\n\n constructor(nodes: ReadonlyArray<Node<string>>) {\n super()\n this.nodes = nodes\n this.refSet = unionRefs(...nodes.map(nodeRefs))\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isStylesheet(that) &&\n this.nodes.length === that.nodes.length &&\n this.nodes.every((node, index) => Equal.equals(node, that.nodes[index]))\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/stylesheet')\n for (const node of this.nodes) {\n h = Equal.combine(h, Equal.hash(node))\n }\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `Stylesheet(${this.nodes.length})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isStylesheet = (u: unknown): u is Stylesheet<string> =>\n typeof u === 'object' && u !== null && StylesheetTypeId in u\n\nconst appendDistinct = (\n kept: Array<Node<string>>,\n buckets: Map<number, Array<Node<string>>>,\n node: Node<string>,\n): boolean => {\n const hash = Equal.hash(node)\n const bucket = buckets.get(hash)\n if (bucket?.some((existing) => Equal.equals(existing, node))) {\n return false\n }\n if (bucket === undefined) {\n buckets.set(hash, [node])\n } else {\n bucket.push(node)\n }\n kept.push(node)\n return true\n}\n\nconst distinct = (nodes: ReadonlyArray<Node<string>>): Array<Node<string>> => {\n const kept: Array<Node<string>> = []\n const buckets = new Map<number, Array<Node<string>>>()\n for (const node of nodes) {\n appendDistinct(kept, buckets, node)\n }\n return kept\n}\n\n/** @internal */\nexport const empty: Stylesheet<never> = new StylesheetImpl([]) as unknown as Stylesheet<never>\n\n/** @internal */\nexport const isEmpty = (sheet: Stylesheet<string>): boolean => sheet.nodes.length === 0\n\n/** @internal */\nexport function make<Nodes extends ReadonlyArray<Node<string>>>(\n ...nodes: Nodes\n): Stylesheet<NodeRefs<Nodes[number]>> {\n const kept = distinct(nodes)\n return (kept.length === 0 ? empty : new StylesheetImpl(kept)) as Stylesheet<\n NodeRefs<Nodes[number]>\n >\n}\n\nconst resolveNode = (head: unknown, block: unknown): Node<string> =>\n block === undefined\n ? (head as Node<string>)\n : makeStyleRule(head as Selector, block as RuleSet<string>)\n\n/** @internal */\nexport const append: {\n <N extends Node<string>>(\n node: N,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | NodeRefs<N>>\n <B extends string>(\n selector: Selector,\n block: RuleSet<B>,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | B>\n <Refs extends string, N extends Node<string>>(\n self: Stylesheet<Refs>,\n node: N,\n ): Stylesheet<Refs | NodeRefs<N>>\n <Refs extends string, B extends string>(\n self: Stylesheet<Refs>,\n selector: Selector,\n block: RuleSet<B>,\n ): Stylesheet<Refs | B>\n} = dual(\n (args: IArguments) => isStylesheet(args[0]),\n (self: Stylesheet<string>, head: unknown, block?: unknown): Stylesheet<string> => {\n const node = resolveNode(head, block)\n if (self.nodes.some((existing) => Equal.equals(existing, node))) {\n return self\n }\n return new StylesheetImpl([...self.nodes, node])\n },\n)\n\n/** @internal */\nexport const merge: {\n <B extends string>(\n that: Stylesheet<B>,\n ): <A extends string>(self: Stylesheet<A>) => Stylesheet<A | B>\n <A extends string, B extends string>(self: Stylesheet<A>, that: Stylesheet<B>): Stylesheet<A | B>\n} = dual(2, (self: Stylesheet<string>, that: Stylesheet<string>): Stylesheet<string> => {\n if (that.nodes.length === 0) {\n return self\n }\n if (self.nodes.length === 0) {\n return that\n }\n const kept: Array<Node<string>> = []\n const buckets = new Map<number, Array<Node<string>>>()\n for (const node of self.nodes) {\n appendDistinct(kept, buckets, node)\n }\n let changed = false\n for (const node of that.nodes) {\n if (appendDistinct(kept, buckets, node)) {\n changed = true\n }\n }\n return changed ? new StylesheetImpl(kept) : self\n})\n\n/** @internal */\nexport function mergeAll<Refs extends string>(\n sheets: ReadonlyArray<Stylesheet<Refs>>,\n): Stylesheet<Refs> {\n let merged: Stylesheet<string> = empty\n for (const sheet of sheets) {\n merged = merge(merged, sheet)\n }\n return merged as Stylesheet<Refs>\n}\n\ninterface PendingPull {\n readonly selector: Selector\n readonly block: RuleSet<string>\n readonly crossedIndex: number\n}\n\ninterface Setter {\n readonly declaration: Declaration<string>\n readonly query: MediaQuery | undefined\n}\n\n// A block flattened to (declaration, query) setters, `undefined` query\n// meaning the declaration applies in every state. `undefined` result: the\n// block nests beyond declarations and one-level `@media` blocks, which\n// the shadow check refuses rather than reasons through.\nconst settersOf = (block: RuleSet<string>): Array<Setter> | undefined => {\n const setters: Array<Setter> = []\n for (const member of block.members) {\n if (isDeclaration(member)) {\n setters.push({ declaration: member, query: undefined })\n } else if (isMediaRule(member)) {\n for (const inner of member.block.members) {\n if (!isDeclaration(inner)) {\n return undefined\n }\n setters.push({ declaration: inner, query: member.query })\n }\n } else {\n return undefined\n }\n }\n return setters\n}\n\nconst collectCrossings = (\n kept: ReadonlyArray<Node<string>>,\n anchor: number,\n rule: StyleRule<string>,\n pending: Array<PendingPull>,\n): void => {\n const pulled = specificity(rule.selector)\n for (let index = anchor + 1; index < kept.length; index++) {\n const node = kept[index] as Node<string>\n if (!isStyleRule(node) || Equal.equals(node.selector, rule.selector)) {\n continue\n }\n if (compareSpecificity(specificity(node.selector), pulled) === 0) {\n pending.push({ selector: rule.selector, block: rule.block, crossedIndex: index })\n }\n }\n}\n\n/**\n * The strict-mode check: a pull is unsafe when the moved block crosses a\n * style rule whose selector ties the pulled selector on specificity,\n * unless every moved declaration is provably shadowed by the crossed\n * rule. Shadowed means the crossed rule re-establishes the declaration —\n * a structurally equal declaration under a query the moved one's query\n * implies — and no later member under a co-satisfiable query sets a\n * different value. Matching semantics stay out of scope: the check never\n * asks whether tying selectors reach the same element, only whether the\n * move could change a computed value if they did.\n *\n * Crossings are collected during the fold but verified afterwards,\n * against each crossed rule's final member list: a re-establishing\n * setter can arrive from a node after the moved block (the scheme\n * mirror in docs/feedback-dtcg-resolver.md section 1), invisible to a\n * check that fires at encounter time. The safety argument is therefore\n * global rather than per-move — coalescing preserves member order\n * within every selector family, so the shadow conditions over the final\n * list pin the crossed family's last applicable setter in every state\n * where the moved declaration applies.\n */\nconst requireShadowedPull = (pull: PendingPull, nodes: ReadonlyArray<Node<string>>): void => {\n const crossed = nodes[pull.crossedIndex] as StyleRule<string>\n const moved = settersOf(pull.block)\n const members = settersOf(crossed.block)\n invariant(\n moved !== undefined && members !== undefined,\n `Coalescing '${renderSelector(pull.selector)}' would pull its block across '${renderSelector(crossed.selector)}', which ties on specificity and nests beyond the shadow check — the pull can change the cascade`,\n )\n for (const setter of moved) {\n const name = setter.declaration.name\n const competing = members.filter((member) => member.declaration.name === name)\n if (competing.length === 0) {\n continue\n }\n const reestablished = competing.findLastIndex(\n (member) =>\n implies(setter.query, member.query) && Equal.equals(member.declaration, setter.declaration),\n )\n invariant(\n reestablished !== -1,\n `Coalescing '${renderSelector(pull.selector)}' would pull '${name}' across '${renderSelector(crossed.selector)}', which ties on specificity without re-establishing its value — the pull can change the cascade`,\n )\n for (let index = reestablished + 1; index < competing.length; index++) {\n const later = competing[index] as Setter\n invariant(\n !coSatisfiable(setter.query, later.query) ||\n Equal.equals(later.declaration, setter.declaration),\n `Coalescing '${renderSelector(pull.selector)}' would pull '${name}' across '${renderSelector(crossed.selector)}', which ties on specificity and later diverges from its value — the pull can change the cascade`,\n )\n }\n }\n}\n\n/** @internal */\nexport function coalesce<Refs extends string>(\n sheet: Stylesheet<Refs>,\n options?: CoalesceOptions,\n): Stylesheet<Refs> {\n const strict = options?.strict === true\n const nodes: Array<Node<string>> = []\n const seen = new Map<number, Array<{ readonly selector: Selector; readonly index: number }>>()\n const pending: Array<PendingPull> = []\n let changed = false\n for (const node of sheet.nodes) {\n if (!isStyleRule(node)) {\n nodes.push(node)\n continue\n }\n const hash = Equal.hash(node.selector)\n const entries = seen.get(hash)\n const first = entries?.find((entry) => Equal.equals(entry.selector, node.selector))\n if (first === undefined) {\n const entry = { selector: node.selector, index: nodes.length }\n if (entries === undefined) {\n seen.set(hash, [entry])\n } else {\n entries.push(entry)\n }\n nodes.push(node)\n continue\n }\n if (strict) {\n collectCrossings(nodes, first.index, node, pending)\n }\n const target = nodes[first.index] as StyleRule<string>\n nodes[first.index] = makeStyleRule(target.selector, concatBlocks(target.block, node.block))\n changed = true\n }\n for (const pull of pending) {\n requireShadowedPull(pull, nodes)\n }\n return (changed ? new StylesheetImpl(nodes) : sheet) as Stylesheet<Refs>\n}\n\n/** @internal */\nexport function refs<Refs extends string>(sheet: Stylesheet<Refs>): ReadonlySet<Refs> {\n return (sheet as unknown as StylesheetImpl).refSet as ReadonlySet<Refs>\n}\n\nconst propertyRenderOptions = (context: RenderContext): PropertyRenderOptions =>\n context.precision === undefined\n ? { indent: context.indent }\n : { indent: context.indent, precision: context.precision }\n\n/** @internal */\nexport const render = (sheet: Stylesheet<string>, options?: RenderOptions): string => {\n const context = resolveRenderOptions(options)\n const sections: Array<string> = []\n for (const node of sheet.nodes) {\n if (isFontFaceRule(node)) {\n sections.push(renderFontFace(node, { indent: context.indent }))\n } else if (isPropertyRule(node)) {\n sections.push(renderPropertyRule(node, propertyRenderOptions(context)))\n } else {\n const section = renderStyleRuleBlock(node.selector, node.block, context)\n if (section !== '') {\n sections.push(section)\n }\n }\n }\n return sections.join('\\n\\n')\n}\n\n/** @internal */\nexport const equals = dual<\n (that: Stylesheet<string>) => (self: Stylesheet<string>) => boolean,\n (self: Stylesheet<string>, that: Stylesheet<string>) => boolean\n>(2, (self: Stylesheet<string>, that: Stylesheet<string>): boolean => Equal.equals(self, that))\n","import type { FontFaceRule } from '#fontFace/fontFaceRule'\nimport type { PropertyRule } from '#property/propertyRule'\nimport type { RenderOptions as RuleSetRenderOptions, RuleSet } from '#rule/ruleSet'\nimport type { StyleRule } from '#rule/styleRule'\nimport type { Selector } from '#selector/selector'\nimport type { Pipeable } from '#util'\nimport type { StylesheetTypeId } from './stylesheet.internal.ts'\nimport * as internal from './stylesheet.internal.ts'\n\n/**\n * The top level of a CSS file: an ordered sequence of style rules and\n * declaration-block at-rules, kept structurally distinct.\n *\n * Node order is preserved exactly as authored — never sorted, because\n * top-level order is cascade behavior — but a node structurally equal to\n * an earlier one is dropped at construction, the first occurrence\n * winning. That distinctness invariant is what makes `merge` a lawful\n * monoid: sheets from independent emitters fold without duplicating the\n * rules they share.\n *\n * The `Refs` parameter unions the nodes' unbound reference names, as on\n * `Calc` — read `Stylesheet<'depth'>` as \"this sheet reads\n * `var(--depth)`\": a dependency report, not an error state. `refs` is\n * the runtime set.\n *\n * Construct via `make` (or `empty` and `append`).\n *\n * @since 0.1.0\n */\nexport interface Stylesheet<out Refs extends string = string> extends Pipeable {\n readonly [StylesheetTypeId]: StylesheetTypeId\n /**\n * The sheet's nodes, in authored order, structurally distinct.\n */\n readonly nodes: ReadonlyArray<Node<Refs>>\n}\n\n/**\n * The forms a stylesheet may contain at its top level: style rules and\n * the declaration-block at-rules (`@font-face`, `@property`).\n *\n * Deliberately absent are `Declaration` — CSS has no top-level\n * declarations — and `MediaRule`: media enters the model nested inside a\n * style rule's block, and renders there. The full unrepresentability\n * scheme lives in `docs/design.md`.\n *\n * @since 0.1.0\n */\nexport type Node<Refs extends string = string> = StyleRule<Refs> | FontFaceRule | PropertyRule\n\n/**\n * The unbound reference names of a `Node`, or the union of them for a\n * union of nodes — the type-level counterpart of `refs`, used by the\n * constructors to thread node names into the result. Only style rules\n * carry references; the at-rule forms contribute `never`, since\n * `@property` initial values are closed by construction.\n *\n * @since 0.1.0\n */\nexport type NodeRefs<N extends Node<string>> = N extends StyleRule<infer R> ? R : never\n\n/**\n * Checks if a value is a `Stylesheet`.\n *\n * True only for values built by this module's constructors, which carry\n * the brand.\n *\n * @param u - The value to check.\n * @returns `true` if the value is a `Stylesheet`, `false` otherwise.\n * @since 0.1.0\n */\nexport const isStylesheet: (u: unknown) => u is Stylesheet<string> = internal.isStylesheet\n\n/**\n * The empty stylesheet — the identity for `merge`.\n *\n * @since 0.1.0\n */\nexport const empty: Stylesheet<never> = internal.empty\n\n/**\n * Checks if the sheet has no nodes.\n *\n * Structural emptiness only: a non-empty sheet can still *render* as the\n * empty string, when every node is a style rule whose block renders\n * empty — `render` guarantees the empty string in both cases.\n *\n * @param sheet - The sheet to inspect.\n * @returns `true` if the sheet has no nodes.\n * @since 0.2.0\n */\nexport const isEmpty: (sheet: Stylesheet<string>) => boolean = internal.isEmpty\n\n/**\n * Creates a stylesheet holding the given nodes, in the given order, with\n * structural duplicates dropped — the first occurrence wins.\n *\n * @param nodes - Style rules and at-rules, in authored order.\n * @returns A `Stylesheet` whose `Refs` unions the nodes' reference names.\n * @example\n * ```ts\n * const sheet = Stylesheet.make(\n * PropertyRule.make('--depth', PropertySyntax.number, 0),\n * StyleRule.make(\n * Selector.class('card'),\n * RuleSet.make(Declaration.make('--indent', Calc.multiply(Calc.ref('depth'), 8))),\n * ),\n * ) // Stylesheet<'depth'>\n * ```\n * @since 0.1.0\n */\nexport const make: <Nodes extends ReadonlyArray<Node<string>>>(\n ...nodes: Nodes\n) => Stylesheet<NodeRefs<Nodes[number]>> = internal.make\n\nexport const append: {\n /**\n * Returns a function that appends `node` to its argument's sheet.\n *\n * @param node - The node to append.\n * @returns A function producing the extended sheet.\n * @since 0.1.0\n */\n <N extends Node<string>>(\n node: N,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | NodeRefs<N>>\n /**\n * Returns a function that appends the style rule `selector { block }`\n * to its argument's sheet.\n *\n * @param selector - The rule's selector.\n * @param block - The rule's block.\n * @returns A function producing the extended sheet.\n * @since 0.1.0\n */\n <B extends string>(\n selector: Selector,\n block: RuleSet<B>,\n ): <Refs extends string>(self: Stylesheet<Refs>) => Stylesheet<Refs | B>\n /**\n * Appends a node at the end of the sheet — unless a structurally equal\n * node is already present, in which case the same sheet comes back\n * unchanged (the first occurrence wins). Otherwise the result is a new\n * sheet; the original is untouched.\n *\n * @param self - The sheet to extend.\n * @param node - The node to append.\n * @returns The extended sheet, with the node's reference names joined in.\n * @since 0.1.0\n */\n <Refs extends string, N extends Node<string>>(\n self: Stylesheet<Refs>,\n node: N,\n ): Stylesheet<Refs | NodeRefs<N>>\n /**\n * Appends a style rule from its parts — sugar for\n * `append(self, StyleRule.make(selector, block))`, so sheets compose\n * without naming `StyleRule` at the call site. Deduplication applies\n * as usual: a sheet already carrying an equal rule comes back\n * unchanged.\n *\n * @param self - The sheet to extend.\n * @param selector - The rule's selector.\n * @param block - The rule's block.\n * @returns The extended sheet, with the block's reference names joined in.\n * @example\n * ```ts\n * Stylesheet.empty.pipe(\n * Stylesheet.append(Selector.root, RuleSet.make(Declaration.make('--depth', 0))),\n * )\n * ```\n * @since 0.1.0\n */\n <Refs extends string, B extends string>(\n self: Stylesheet<Refs>,\n selector: Selector,\n block: RuleSet<B>,\n ): Stylesheet<Refs | B>\n} = internal.append\n\nexport const merge: {\n /**\n * Returns a function that merges `that`'s novel nodes after its\n * argument's.\n *\n * @param that - The sheet whose novel nodes come second.\n * @returns A function producing the merged sheet.\n * @since 0.1.0\n */\n <B extends string>(\n that: Stylesheet<B>,\n ): <A extends string>(self: Stylesheet<A>) => Stylesheet<A | B>\n /**\n * Merges two sheets: `self`'s nodes followed by the nodes of `that`\n * not already present, order preserved on both sides — structural\n * duplicates collapse to their first occurrence. With `empty` as\n * identity this is a lawful monoid (associative, idempotent), which is\n * the multi-emitter fold: emitters that each register the rules they\n * share merge to a sheet carrying one copy.\n *\n * Identity and idempotence hold by reference, not just structurally:\n * merging `empty` on either side, or a sheet with itself, returns that\n * same instance.\n *\n * @param self - The sheet whose nodes come first.\n * @param that - The sheet whose novel nodes follow.\n * @returns The merged sheet, with both sides' reference names unioned.\n * @example\n * ```ts\n * const contract = Stylesheet.make(PropertyRule.make('--depth', PropertySyntax.number, 0))\n * Stylesheet.merge(contract, contract) // === contract — merge is idempotent\n * ```\n * @since 0.1.0\n */\n <A extends string, B extends string>(self: Stylesheet<A>, that: Stylesheet<B>): Stylesheet<A | B>\n} = internal.merge\n\n/**\n * Folds any number of sheets with `merge`, left to right — `empty` when\n * given none.\n *\n * @param sheets - The sheets to fold, in order.\n * @returns The merged sheet, with every sheet's reference names unioned.\n * @since 0.1.0\n */\nexport const mergeAll: <Refs extends string>(\n sheets: ReadonlyArray<Stylesheet<Refs>>,\n) => Stylesheet<Refs> = internal.mergeAll\n\n/**\n * Options for `coalesce`.\n *\n * @since 0.2.0\n */\nexport interface CoalesceOptions {\n /**\n * When `true`, unsafe pulls throw instead of rewriting the cascade.\n * Defaults to `false`.\n *\n * A pull moves the coalesced rule's block backward across every rule\n * between the first occurrence of its selector and the later one. The\n * pull throws when an intervening style rule ties the coalesced\n * selector on specificity, unless every moved declaration is provably\n * shadowed by that rule.\n *\n * Shadowed means the crossed rule, in its final coalesced form,\n * re-establishes the declaration. It contains a structurally equal\n * declaration under a media query implied by the moved one's query.\n * No later member whose query can hold alongside the moved one's sets\n * a different value.\n *\n * The check never reasons about whether tying selectors can match the\n * same element. It refuses what it cannot prove: a crossing whose\n * blocks nest style rules, or a moved declaration without a\n * re-establishing twin.\n */\n readonly strict?: boolean\n}\n\n/**\n * Coalesces style rules that share a selector: each later rule's block\n * is concatenated onto the first rule with a structurally equal selector\n * (in sheet order, as `RuleSet.concat` would), and the later rule is\n * dropped. Other node kinds pass through untouched.\n *\n * Deliberately separate from `merge`, and order-sensitive: pulling a\n * block backward past an intervening rule can change the cascade when\n * the intervening selector ties on specificity, so coalescing is an\n * explicit opt-in normalization. `strict` turns that caution into a\n * checked invariant — a build gate that proves the sheet's coalesce is\n * cascade-preserving.\n *\n * Coalesce is a repair operation for sheets whose construction you\n * don't control. If strict mode refuses a sheet you built yourself,\n * don't weaken the check — assemble in the target shape instead:\n * refusal usually means the operation is reconstructing an intent you\n * could express directly.\n *\n * @param sheet - The sheet to normalize.\n * @param options - Optional strictness.\n * @returns The coalesced sheet; the same instance when no selector repeats, so coalesce is idempotent.\n * @throws `Error` in strict mode, when a pull crosses an intervening tying rule that does not provably shadow every moved declaration.\n * @since 0.1.0\n */\nexport const coalesce: <Refs extends string>(\n sheet: Stylesheet<Refs>,\n options?: CoalesceOptions,\n) => Stylesheet<Refs> = internal.coalesce\n\n/**\n * The sheet's unbound reference names, unioned across nodes — the custom\n * properties the sheet reads via `var()`, including everything nested\n * rules contribute.\n *\n * @param sheet - The sheet to inspect.\n * @returns The set of unbound reference names.\n * @since 0.1.0\n */\nexport const refs: <Refs extends string>(sheet: Stylesheet<Refs>) => ReadonlySet<Refs> =\n internal.refs\n\n/**\n * Options for `render`: the indentation unit, precision context, and\n * media syntax, shared with the rule renderers. One options value\n * composes across every `render` in the library — the renderers that\n * take fewer keys accept it and ignore the rest.\n *\n * Options change text, never meaning: the same sheet renders the same\n * cascade under any of them.\n *\n * @since 0.1.0\n */\nexport type RenderOptions = RuleSetRenderOptions\n\n/**\n * Renders the whole sheet as CSS text: at-rule nodes as their own\n * blocks, style rules in nested form with their `@media` blocks kept\n * inside, in member order.\n *\n * Empty blocks emit nothing, so a sheet whose every node renders empty —\n * `empty` itself, or style rules with empty blocks — renders the empty\n * string; composing renders into a larger file never needs to reach into\n * `nodes`. Top-level sections join with one blank line, without a\n * trailing newline. Unbound references render as `var(--name)`.\n *\n * @param sheet - The stylesheet to render.\n * @param options - Optional indentation unit, precision context, and media syntax.\n * @returns Deterministic CSS text.\n * @throws `Error` when a style rule nests inside another rule's block — selector composition (`&`) is a later extension, not part of v1 rendering.\n * @example\n * ```ts\n * const sheet = Stylesheet.empty.pipe(\n * Stylesheet.append(\n * Selector.root,\n * RuleSet.make(Declaration.make('--gutter', 16)).pipe(\n * RuleSet.append(MediaQuery.minWidth(768), RuleSet.make(Declaration.make('--gutter', 24))),\n * ),\n * ),\n * )\n * Stylesheet.render(sheet)\n * // \":root {\\n\\t--gutter: 16;\\n\\t@media (min-width: 768px) {\\n\\t\\t--gutter: 24;\\n\\t}\\n}\"\n * ```\n * @since 0.1.0\n */\nexport const render: (sheet: Stylesheet<string>, options?: RenderOptions) => string =\n internal.render\n\nexport const equals: {\n /**\n * Returns a function that checks structural equality against `that`.\n *\n * @param that - The sheet to compare against.\n * @returns A function testing its argument for structural equality with `that`.\n * @since 0.1.0\n */\n (that: Stylesheet<string>): (self: Stylesheet<string>) => boolean\n /**\n * Structural equality over nodes, in order. Order participates —\n * sheets holding the same nodes in different orders cascade\n * differently, so they compare unequal.\n *\n * @param self - The first sheet.\n * @param that - The second sheet.\n * @returns `true` if the sheets are structurally equal.\n * @since 0.1.0\n */\n (self: Stylesheet<string>, that: Stylesheet<string>): boolean\n} = internal.equals\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,mBAAmB,OAAO,IAAI,wBAAwB;AAGnE,MAAM,YAAY,SAChB,YAAY,IAAI,IAAI,SAAS,IAAI,IAAI;AAEvC,IAAM,iBAAN,cAA6B,SAAoD;CAC/E,CAAU,oBAAsC;CAEhD;CACA;CACA;CAEA,YAAY,OAAoC;EAC9C,MAAM;EACN,KAAK,QAAQ;EACb,KAAK,SAAS,UAAU,GAAG,MAAM,IAAI,QAAQ,CAAC;CAChD;CAEA,CAACA,aAAmB,MAAwB;EAC1C,OACEC,eAAa,IAAI,KACjB,KAAK,MAAM,WAAW,KAAK,MAAM,UACjC,KAAK,MAAM,OAAO,MAAM,UAAUC,SAAa,MAAM,KAAK,MAAM,MAAM,CAAC;CAE3E;CAEA,CAACC,cAA4B;EAC3B,IAAI,KAAKC,UAAU,KAAA,GAAW;GAC5B,IAAI,IAAIC,WAAiB,wBAAwB;GACjD,KAAK,MAAM,QAAQ,KAAK,OACtB,IAAIC,QAAc,GAAGC,KAAW,IAAI,CAAC;GAEvC,KAAKH,QAAQ;EACf;EACA,OAAO,KAAKA;CACd;CAEA,KAAK,OAAO,eAAe;EACzB,OAAO,cAAc,KAAK,MAAM,OAAO;CACzC;CAEA,KAAK,OAAO,IAAI,4BAA4B,KAAK;EAC/C,OAAO,KAAK,OAAO;CACrB;AACF;;AAGA,MAAaH,kBAAgB,MAC3B,OAAO,MAAM,YAAY,MAAM,QAAQ,oBAAoB;AAE7D,MAAM,kBACJ,MACA,SACA,SACY;CACZ,MAAMO,SAAOD,KAAW,IAAI;CAC5B,MAAM,SAAS,QAAQ,IAAIC,MAAI;CAC/B,IAAI,QAAQ,MAAM,aAAaN,SAAa,UA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AAEJ,MAAa,QAmCTC;;;;;;;;;AAUJ,MAAa,WAEWC;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDxB,MAAa,WAGWC;;;;;;;;;;AAWxB,MAAa,OACXC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CF,MAAa,SACXC;AAEF,MAAa,SAoBTC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fashionable",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Structural stylesheet modeling and calc expression evaluation",
5
5
  "homepage": "https://github.com/tkofh/fashionable#readme",
6
6
  "bugs": {