@fluentic/style 0.1.0-beta.0 → 0.1.0-beta.1

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 (68) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/compiler/transform/evaluator/evaluator.ts +4 -0
  3. package/dist/{assert-h_Zkqc4E.js → assert-BGdigdr5.js} +57 -23
  4. package/dist/assert-BGdigdr5.js.map +1 -0
  5. package/dist/compiler/index.mjs +1 -1
  6. package/dist/{compiler-DweanHoB.mjs → compiler-DENc3a2R.mjs} +24 -19
  7. package/dist/compiler-DENc3a2R.mjs.map +1 -0
  8. package/dist/{data-_te7t0M4.js → data-BsqOa5br.js} +2 -2
  9. package/dist/{data-_te7t0M4.js.map → data-BsqOa5br.js.map} +1 -1
  10. package/dist/entry/dev.js +2 -2
  11. package/dist/entry/prod.js +1 -1
  12. package/dist/entry/rsc-dev.js +53 -50
  13. package/dist/entry/rsc-dev.js.map +1 -1
  14. package/dist/entry/rsc-prod.js +1 -1
  15. package/dist/index.js +2 -2
  16. package/dist/{loader-DS61nRqr.mjs → loader-B5Kw0DD-.mjs} +3 -3
  17. package/dist/{loader-DS61nRqr.mjs.map → loader-B5Kw0DD-.mjs.map} +1 -1
  18. package/dist/{misc-B9kqEb2N.mjs → misc-DCdYYyhK.mjs} +2 -2
  19. package/dist/{misc-B9kqEb2N.mjs.map → misc-DCdYYyhK.mjs.map} +1 -1
  20. package/dist/plugin/farm/index.mjs +2 -2
  21. package/dist/plugin/nextjs/index.mjs +4 -4
  22. package/dist/plugin/nextjs/loader.mjs +4 -4
  23. package/dist/plugin/parcel/optimizer.cjs +1 -1
  24. package/dist/plugin/parcel/optimizer.mjs +2 -2
  25. package/dist/plugin/parcel/resolver.cjs +1 -1
  26. package/dist/plugin/parcel/resolver.mjs +2 -2
  27. package/dist/plugin/parcel/runtime.cjs +1 -1
  28. package/dist/plugin/parcel/runtime.mjs +1 -1
  29. package/dist/plugin/parcel/transformer.cjs +1 -1
  30. package/dist/plugin/parcel/transformer.mjs +2 -2
  31. package/dist/plugin/rspack/index.mjs +1 -1
  32. package/dist/plugin/vite/index.mjs +3 -3
  33. package/dist/plugin/vite/index.mjs.map +1 -1
  34. package/dist/plugin/webpack/index.mjs +1 -1
  35. package/dist/plugin/webpack/loader.mjs +2 -2
  36. package/dist/{presets-Bye3ea2x.js → presets-BhXa232U.js} +3 -34
  37. package/dist/presets-BhXa232U.js.map +1 -0
  38. package/dist/{registry-CyIj8LYK.mjs → registry-yHLRxyoo.mjs} +2 -2
  39. package/dist/{registry-CyIj8LYK.mjs.map → registry-yHLRxyoo.mjs.map} +1 -1
  40. package/dist/selector/index.js +3 -3
  41. package/dist/server.js +1 -1
  42. package/dist/{shared-BAL9peIw.cjs → shared-CBArHB9-.cjs} +24 -19
  43. package/dist/shared-CBArHB9-.cjs.map +1 -0
  44. package/dist/{shared-CCpq1zqA.mjs → shared-CxbHR89f.mjs} +4 -4
  45. package/dist/{shared-CCpq1zqA.mjs.map → shared-CxbHR89f.mjs.map} +1 -1
  46. package/dist/{sidecar-4u6GnlQG.mjs → sidecar-BFakLl0X.mjs} +3 -3
  47. package/dist/{sidecar-4u6GnlQG.mjs.map → sidecar-BFakLl0X.mjs.map} +1 -1
  48. package/dist/{style-Cw3NtvR0.js → style-B-6jHipw.js} +1 -1
  49. package/dist/{style-4rFUy-zW.js → style-DgHbdbdF.js} +3 -3
  50. package/dist/{style-4rFUy-zW.js.map → style-DgHbdbdF.js.map} +1 -1
  51. package/dist/{style-DNqQ6H-7.js → style-v2bf70TZ.js} +48 -34
  52. package/dist/style-v2bf70TZ.js.map +1 -0
  53. package/dist/{utils-DMFgOOtA.mjs → utils-Bdbqn0f8.mjs} +3 -3
  54. package/dist/{utils-DMFgOOtA.mjs.map → utils-Bdbqn0f8.mjs.map} +1 -1
  55. package/dist/{utils-C7xfDxtM.mjs → utils-CEaq_c-A.mjs} +4 -4
  56. package/dist/{utils-C7xfDxtM.mjs.map → utils-CEaq_c-A.mjs.map} +1 -1
  57. package/dist/utils.js +1 -1
  58. package/dist/{webpack-CxS2FDYU.mjs → webpack-Dh6lox2l.mjs} +5 -5
  59. package/dist/{webpack-CxS2FDYU.mjs.map → webpack-Dh6lox2l.mjs.map} +1 -1
  60. package/package.json +9 -11
  61. package/plugin/bundler/vite/state.ts +1 -1
  62. package/selector/assert.ts +24 -25
  63. package/selector/selector.ts +6 -0
  64. package/dist/assert-h_Zkqc4E.js.map +0 -1
  65. package/dist/compiler-DweanHoB.mjs.map +0 -1
  66. package/dist/presets-Bye3ea2x.js.map +0 -1
  67. package/dist/shared-BAL9peIw.cjs.map +0 -1
  68. package/dist/style-DNqQ6H-7.js.map +0 -1
@@ -3,7 +3,7 @@ import { d as getStyleTokenId, i as getTokenVar, m as isStyleTokenOverrideData,
3
3
  import { a as getCssVarRawFallback } from "./format-3nKBE_5t.js";
4
4
  import { r as isAtRuleRef } from "./valueRef-lshFk1Cs.js";
5
5
  import { l as getDebugFieldVarName, m as traceError, s as getDebugFieldCallsite } from "./debug-n2aZQBSa.js";
6
- import { c as assertSelector } from "./assert-h_Zkqc4E.js";
6
+ import { c as assertSelector } from "./assert-BGdigdr5.js";
7
7
  import { _ as BUILDER_SCOPE_ID, b as BUILDER_TYPE, d as isSlotData, f as isSlotOverrideData, g as BUILDER_SCOPE, h as BUILDER_CALLSITE, l as isScopeData, n as getClassNameDedupe, p as isStyleData, t as getAtomicClassName, v as BUILDER_SLOT_ID, y as BUILDER_STATE } from "./className-DC2Cq8p3.js";
8
8
  import { t as DEV_CONFIG } from "./dev-DfBbuLeE.js";
9
9
  import { t as DEBUG_CONFIG } from "./debug-DGki_v7g.js";
@@ -470,4 +470,4 @@ function normalizeSelectorArg(arg) {
470
470
  //#endregion
471
471
  export { mergeScopeData as a, createSlotData as c, createThemeData as d, checkSelector as f, mergeBuilderData as i, createSlotOverrideData as l, SELECTOR_MEDIA as n, createScopeData as o, normalizeSelectorArg as r, createScopeTargetData as s, SELECTOR_CONTAINER as t, createStyleData as u };
472
472
 
473
- //# sourceMappingURL=data-_te7t0M4.js.map
473
+ //# sourceMappingURL=data-BsqOa5br.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-_te7t0M4.js","names":["withDebugSource"],"sources":["../builder/data/check_selector.ts","../builder/data/create.ts","../builder/data/merge/utils.ts","../builder/data/merge/scope.ts","../builder/data/merge/style.ts","../builder/data/selector.ts"],"sourcesContent":["import { assertSelector } from '../../selector/assert';\nimport type { Selector } from '../../selector/types';\nimport { traceError } from '../../utils/trace';\n\nexport function checkSelector(\n fnPrefix: string,\n fnName: string,\n fnSelector: Selector,\n arg: string,\n) {\n let message: string | null = null;\n\n try {\n assertSelector(fnSelector.assert, arg);\n } catch (error) {\n if (typeof error === 'string' && error.trim()) {\n message = error;\n } else if (typeof error === 'object' && error && error instanceof Error) {\n message = (error.message || '').trim();\n } else {\n message = 'selector is invalid: ' + arg;\n }\n }\n\n if (!message) return;\n\n const error = `${fnPrefix}${fnName}(${arg || ''}): ${message}`;\n\n throw traceError(error);\n}\n","import type { StyleTokenOverride } from '../../style/token';\nimport {\n BUILDER_CALLSITE,\n BUILDER_SCOPE,\n BUILDER_SCOPE_ID,\n BUILDER_SLOT_ID,\n BUILDER_STATE,\n BUILDER_TYPE,\n BUILDER_TYPE_SCOPE,\n BUILDER_TYPE_SCOPE_TARGET,\n BUILDER_TYPE_SLOT,\n BUILDER_TYPE_SLOT_OVERRIDE,\n BUILDER_TYPE_STYLE,\n BUILDER_TYPE_THEME,\n} from './const';\nimport type {\n BuilderCallsite,\n BuilderData,\n ScopeData,\n ScopeTargetData,\n SlotData,\n SlotOverrideData,\n StyleData,\n ThemeData,\n} from './data';\n\nexport function createStyleData<Style>(\n callsite: BuilderCallsite | null,\n): StyleData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_STYLE,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n };\n}\n\nexport function createSlotData<Style>(\n callsite: BuilderCallsite | null,\n slotId: string,\n): SlotData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SLOT,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n [BUILDER_SLOT_ID]: slotId,\n };\n}\n\nexport function createSlotOverrideData<Style>(\n callsite: BuilderCallsite | null,\n slotId: string,\n): SlotOverrideData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SLOT_OVERRIDE,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n [BUILDER_SLOT_ID]: slotId,\n };\n}\n\nexport function createScopeData<Style>(\n callsite: BuilderCallsite | null,\n): BuilderData<Style, typeof BUILDER_TYPE_SCOPE> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SCOPE,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n };\n}\n\nexport function createScopeTargetData<Style>(\n scope: ScopeData<Style>,\n slot: SlotData<Style>,\n): ScopeTargetData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SCOPE_TARGET,\n [BUILDER_SCOPE]: scope,\n [BUILDER_SCOPE_ID]: slot[BUILDER_SLOT_ID],\n };\n}\n\nexport function createThemeData(\n callsite: BuilderCallsite | null,\n id: string,\n className: string,\n tokens: readonly StyleTokenOverride[],\n): ThemeData {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_THEME,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n id,\n className,\n tokens,\n };\n}\n","import { DEV_CONFIG } from '../../../config/config/dev';\nimport { traceError } from '../../../utils/trace';\nimport { BUILDER_STATE, ITEM_RUNTIME_DEV, ITEM_RUNTIME_DEV_PLUGIN, ITEM_RUNTIME_PROD } from '../const';\nimport type { BuilderData } from '../data';\nimport type { DebugData } from '../debug';\nimport type { ItemRuntimeType, StateItem, StateLookup } from '../state';\n\nexport function cloneData<Data extends BuilderData, Source extends BuilderData>(\n data: Data,\n source: Source,\n debug: DebugData | null,\n merge = true,\n): [runtimeType: ItemRuntimeType, data: Data, items: StateItem[], lookup: StateLookup] {\n const runtimeType = DEV_CONFIG.isDev\n ? (debug ? ITEM_RUNTIME_DEV_PLUGIN : ITEM_RUNTIME_DEV)\n : ITEM_RUNTIME_PROD;\n\n const state = data[BUILDER_STATE];\n\n state.items = merge ? source[BUILDER_STATE].items.slice() : [];\n\n state.lookup = Object.assign(\n Object.create(null),\n merge ? source[BUILDER_STATE].lookup : null,\n );\n\n const lookup = state.lookup!;\n const items = state.items;\n\n return [runtimeType, data, items, lookup];\n}\n\nexport function logInvalidData(message: string, data: object) {\n console.log(traceError(message), 'data:', data);\n}\n","import { getAtomicClassName, getClassNameDedupe } from '../../../atomic/className';\nimport { CSS_CONFIG } from '../../../config/config/css';\nimport { DEBUG_CONFIG } from '../../../config/config/debug';\nimport { DEV_CONFIG } from '../../../config/config/dev';\nimport { getStyleTokenId, isStyleTokenOverrideData, type StyleTokenOverride } from '../../../style/token';\nimport { BUILDER_SLOT_ID, BUILDER_STATE, BUILDER_TYPE_SCOPE, BUILDER_TYPE_SLOT_OVERRIDE } from '../const';\nimport type { BuilderCallsite, ScopeData, SlotOverrideData } from '../data';\nimport {\n getDebugFieldCallsite,\n TRACE_STYLE,\n TRACE_VALUE,\n type DebugData,\n type DebugLoc,\n} from '../debug';\nimport { isScopeData, isSlotOverrideData } from '../is';\nimport type { ItemSelector, ItemValue, RuntimeScopeItem, RuntimeSlotOverrideItem, StateItem } from '../state';\nimport { cloneData, logInvalidData } from './utils';\n\nexport type ScopeItem<Style = unknown> =\n | SlotOverrideData<Style>\n | ScopeData<Style>\n | StyleTokenOverride\n | false\n | null\n | undefined;\n\nexport type ScopeItems<Style = unknown> =\n | ScopeItem<Style>\n | ScopeItem<Style>[];\n\nexport function mergeScopeData<Style>(\n scope: ScopeData<Style>,\n callsite: BuilderCallsite | null,\n items: ScopeItems<Style> | null,\n debug: DebugData | null,\n parentSelector: ItemSelector | null,\n scopeAtRule: ItemSelector | null,\n): ScopeData<Style> {\n if (!items) return scope;\n\n const sourceItems = Array.isArray(items) ? items : [items];\n const [runtimeType, data, styles, lookup] = cloneData(\n scope,\n scope,\n debug,\n );\n\n let source: ScopeItem<Style>;\n let item: StateItem;\n let lookupIndex: number;\n let priority: number | null;\n let value: ItemValue;\n let atRule: ItemSelector[] | null;\n let dedupe: string;\n let className: string;\n let itemDebug: DebugData | null | undefined;\n let itemCallsite: BuilderCallsite | null;\n\n for (let i = 0, len = sourceItems.length; i < len; i++) {\n source = sourceItems[i];\n if (!source) continue;\n\n if (isStyleTokenOverrideData(source)) {\n addTokenOverride(source, styles, lookup);\n continue;\n }\n\n if (isScopeData(source)) {\n const scopeItems = source[BUILDER_STATE].items;\n\n for (let j = 0, len = scopeItems.length; j < len; j++) {\n item = scopeItems[j];\n\n if (isStyleTokenOverrideData(item)) {\n addTokenOverride(item, styles, lookup);\n continue;\n }\n\n if (Array.isArray(item) || item.type !== BUILDER_TYPE_SCOPE) {\n logInvalidData('invalid scope data', { source, item });\n continue;\n }\n\n const sourceScopeItem = item as RuntimeScopeItem;\n\n atRule = scopeAtRule\n ? (sourceScopeItem.atRule ? [scopeAtRule].concat(sourceScopeItem.atRule) : [scopeAtRule])\n : sourceScopeItem.atRule;\n\n const scopeItem: RuntimeScopeItem = {\n ...sourceScopeItem,\n runtime: runtimeType,\n atRule,\n parentSelector: parentSelector ?? sourceScopeItem.parentSelector,\n };\n itemDebug = getMergedScopeDebug(debug, scopeItem);\n itemCallsite = getDebugFieldCallsite(itemDebug ?? null, scopeItem.property) ??\n callsite ??\n scopeItem.callsite;\n\n value = scopeItem.value;\n priority = null;\n\n if (Array.isArray(value)) {\n priority = value[1];\n value = value[0];\n }\n\n dedupe = getClassNameDedupe(\n scopeItem.property,\n priority,\n scopeItem.selector,\n scopeItem.parentSelector,\n scopeItem.atRule,\n );\n\n className = getAtomicClassName(\n scopeItem.property,\n priority,\n value,\n scopeItem.selector,\n scopeItem.parentSelector,\n scopeItem.atRule,\n itemCallsite,\n DEV_CONFIG.isLocalClassNameEnabled,\n DEBUG_CONFIG.isDebugClassNameEnabled,\n CSS_CONFIG.classNameFormat ?? null,\n );\n\n scopeItem.dedupe = dedupe;\n scopeItem.className = className;\n scopeItem.callsite = itemCallsite;\n scopeItem.debug = itemDebug ?? null;\n scopeItem.debugField = itemDebug ? scopeItem.property : null;\n\n const lookupKey = getScopeLookupKey(scopeItem.slotId, dedupe);\n lookupIndex = lookup[lookupKey];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = scopeItem;\n } else {\n lookup[lookupKey] = styles.push(scopeItem) - 1;\n }\n }\n\n continue;\n }\n\n if (!isSlotOverrideData(source)) {\n logInvalidData('invalid scope data', { source });\n continue;\n }\n\n const slotId = source[BUILDER_SLOT_ID];\n const overrideItems = source[BUILDER_STATE].items;\n\n for (let j = 0, len = overrideItems.length; j < len; j++) {\n item = overrideItems[j];\n\n if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== BUILDER_TYPE_SLOT_OVERRIDE) {\n logInvalidData('invalid scope data', { source, item });\n continue;\n }\n\n const overrideItem = item as RuntimeSlotOverrideItem;\n\n atRule = scopeAtRule\n ? (overrideItem.atRule ? [scopeAtRule].concat(overrideItem.atRule) : [scopeAtRule])\n : overrideItem.atRule;\n\n const scopeItem: RuntimeScopeItem = {\n type: BUILDER_TYPE_SCOPE,\n slotId,\n runtime: runtimeType,\n dedupe: '',\n className: '',\n property: overrideItem.property,\n value: overrideItem.value,\n token: overrideItem.token,\n selector: overrideItem.selector,\n atRule,\n callsite: overrideItem.callsite ?? callsite,\n debug: overrideItem.debug,\n debugField: overrideItem.debugField,\n parentSelector,\n };\n\n value = scopeItem.value;\n priority = null;\n\n if (Array.isArray(value)) {\n priority = value[1];\n value = value[0];\n }\n\n dedupe = getClassNameDedupe(\n scopeItem.property,\n priority,\n scopeItem.selector,\n parentSelector,\n scopeItem.atRule,\n );\n\n className = getAtomicClassName(\n scopeItem.property,\n priority,\n value,\n scopeItem.selector,\n parentSelector,\n scopeItem.atRule,\n scopeItem.callsite,\n DEV_CONFIG.isLocalClassNameEnabled,\n DEBUG_CONFIG.isDebugClassNameEnabled,\n CSS_CONFIG.classNameFormat ?? null,\n );\n\n scopeItem.dedupe = dedupe;\n scopeItem.className = className;\n\n const lookupKey = getScopeLookupKey(slotId, dedupe);\n lookupIndex = lookup[lookupKey];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = scopeItem;\n } else {\n lookup[lookupKey] = styles.push(scopeItem) - 1;\n }\n }\n }\n\n return data as ScopeData<Style>;\n}\n\nfunction addTokenOverride(\n item: StyleTokenOverride,\n styles: StateItem[],\n lookup: Record<string, number>,\n) {\n const lookupKey = getTokenLookupKey(getStyleTokenId(item));\n const lookupIndex = lookup[lookupKey];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = item;\n } else {\n lookup[lookupKey] = styles.push(item) - 1;\n }\n}\n\nfunction getMergedScopeDebug(\n debug: DebugData | null,\n item: RuntimeScopeItem,\n): DebugData | null | undefined {\n if (!debug) return item.debug;\n if (debug.fields?.[item.property]) return debug;\n\n const valueLoc = getRuntimeScopeItemValueLoc(item);\n if (!valueLoc) return debug;\n\n return {\n ...debug,\n fields: {\n ...debug.fields,\n [item.property]: {\n [TRACE_STYLE]: debug.loc,\n [TRACE_VALUE]: valueLoc,\n },\n },\n };\n}\n\nfunction getRuntimeScopeItemValueLoc(item: RuntimeScopeItem): DebugLoc | null {\n if (item.debug && item.debugField) {\n const loc = item.debug.fields?.[item.debugField];\n if (Array.isArray(loc)) return withDebugSource(loc, item.debug.sourceUrl, item.debug.code);\n if (loc) {\n const valueLoc = loc[TRACE_VALUE] ?? loc[TRACE_STYLE] ?? null;\n return valueLoc ? withDebugSource(valueLoc, item.debug.sourceUrl, item.debug.code) : null;\n }\n }\n\n return item.callsite\n ? [item.callsite.line, item.callsite.column, undefined, item.callsite.sourceUrl, item.callsite.sourceContent]\n : null;\n}\n\nfunction withDebugSource(\n loc: DebugLoc,\n sourceUrl: string,\n sourceContent: string | undefined,\n): DebugLoc {\n return loc[3] ? loc : [loc[0], loc[1], loc[2], sourceUrl, sourceContent];\n}\n\nfunction getScopeLookupKey(slotId: string, dedupe: string) {\n return slotId + '\\0' + dedupe;\n}\n\nfunction getTokenLookupKey(tokenId: string) {\n return 'token\\0' + tokenId;\n}\n","import { getAtomicClassName, getClassNameDedupe } from '../../../atomic/className';\nimport { getTokenVar } from '../../../atomic/token';\nimport { getCssVarRawFallback } from '../../../atomic/utils/css';\nimport { shouldAppendCssPx } from '../../../atomic/value';\nimport { CSS_CONFIG } from '../../../config/config/css';\nimport { DEBUG_CONFIG } from '../../../config/config/debug';\nimport { DEV_CONFIG } from '../../../config/config/dev';\nimport { isStyleTokenData, isStyleTokenOverrideData, type StyleTokenData } from '../../../style/token';\nimport type { StyleObject, StyleValueTuple } from '../../../style/types';\nimport { type AtRuleRef, isAtRuleRef } from '../../../style/valueRef';\nimport {\n BUILDER_SLOT_ID,\n BUILDER_STATE,\n BUILDER_TYPE_SLOT,\n BUILDER_TYPE_SLOT_OVERRIDE,\n BUILDER_TYPE_STYLE,\n ITEM_VALUE_NUMBER_PX,\n ITEM_VALUE_TYPE_AT_RULE_REF,\n ITEM_VALUE_TYPE_VARIABLE,\n} from '../const';\nimport type { BuilderCallsite, BuilderData, StyleData } from '../data';\nimport {\n type DebugData,\n type DebugLoc,\n getDebugFieldCallsite,\n getDebugFieldVarName,\n TRACE_STYLE,\n TRACE_VALUE,\n} from '../debug';\nimport { isSlotData, isSlotOverrideData, isStyleData } from '../is';\nimport type { BuilderType, ItemSelector, ItemValue, RuntimeItem, RuntimeItemData, StateItem } from '../state';\nimport { cloneData, logInvalidData } from './utils';\n\nexport type CreateData<Data extends BuilderData> = (\n callsite: BuilderCallsite | null,\n data: Data,\n) => Data;\n\nexport function mergeBuilderData<Data extends BuilderData>(\n create: CreateData<Data>,\n callsite: BuilderCallsite | null,\n source: Data,\n style: StyleObject | StyleData | null,\n debug: DebugData | null,\n selector: ItemSelector | null,\n atRule: ItemSelector[] | null,\n type: BuilderType,\n): Data {\n if (!style) return source;\n\n const [runtimeType, data, styles, lookup] = cloneData(\n create(callsite, source),\n source,\n debug,\n );\n\n const slotId = isSlotData(source) || isSlotOverrideData(source)\n ? source[BUILDER_SLOT_ID]\n : null;\n\n const items: RuntimeItem[] = [];\n\n let item: StateItem;\n let itemData: RuntimeItemData;\n\n let valueRaw: unknown;\n let value: ItemValue;\n let priority: number | null;\n let itemCallsite: BuilderCallsite | null;\n let className: string;\n let dedupe: string;\n let token: StyleTokenData | null;\n let ref: AtRuleRef | null;\n let variableName: string | null;\n let lookupIndex: number;\n\n if (isStyleData(style)) {\n const stylesItems = style[BUILDER_STATE].items;\n\n for (let i = 0, len = stylesItems.length; i < len; i++) {\n item = stylesItems[i];\n\n if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== BUILDER_TYPE_STYLE) {\n logInvalidData('invalid style data', { item, style });\n continue;\n }\n\n if (atRule) {\n item = Object.assign({}, item, {\n atRule: item.atRule ? atRule.concat(item.atRule) : atRule,\n });\n }\n\n // Re-type to SLOT/SLOT_OVERRIDE when this StyleData is used inside a slot context.\n // Without this, style.slot(...).media('...', style({...})) would keep the inner\n // items as BUILDER_TYPE_STYLE and they would not be resolved when the slot is used.\n if (type === BUILDER_TYPE_SLOT && slotId !== null) {\n item = Object.assign({}, item, { type: BUILDER_TYPE_SLOT, slotId });\n } else if (type === BUILDER_TYPE_SLOT_OVERRIDE && slotId !== null) {\n item = Object.assign({}, item, { type: BUILDER_TYPE_SLOT_OVERRIDE, slotId });\n }\n\n const itemDebug = getMergedStyleDebug(debug, item);\n const debugCallsite = getDebugFieldCallsite(itemDebug, item.property);\n if (debugCallsite) {\n item = Object.assign({}, item, {\n callsite: debugCallsite,\n debug: itemDebug,\n debugField: item.property,\n });\n }\n\n items.push(item);\n }\n } else {\n for (const property in style) {\n valueRaw = style[property as keyof typeof style];\n priority = null;\n\n if (Array.isArray(valueRaw) && valueRaw.length === 2 && typeof valueRaw[0] === 'number') {\n priority = (valueRaw as StyleValueTuple)[0];\n valueRaw = (valueRaw as StyleValueTuple)[1];\n }\n\n ref = isAtRuleRef(valueRaw) ? valueRaw : null;\n if (ref) valueRaw = ref.value;\n\n token = isStyleTokenData(valueRaw) ? valueRaw : null;\n variableName = getDebugFieldVarName(debug, property);\n\n value = variableName && token\n ? getCssVarRawFallback(variableName, getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null))\n : token\n ? getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null)\n : String(valueRaw ?? '');\n\n value = priority !== null ? [value, priority] : value;\n itemCallsite = getDebugFieldCallsite(debug, property) ?? callsite;\n\n itemData = {\n runtime: runtimeType,\n debug,\n debugField: property,\n dedupe: '',\n className: '',\n property,\n value,\n variable: ref\n ? [ITEM_VALUE_TYPE_AT_RULE_REF, ref]\n : variableName && token\n ? [\n ITEM_VALUE_TYPE_VARIABLE,\n variableName,\n valueRaw,\n shouldAppendCssPx(property) ? ITEM_VALUE_NUMBER_PX : undefined,\n ]\n : ref\n ? [ITEM_VALUE_TYPE_AT_RULE_REF, ref]\n : undefined,\n token,\n selector,\n atRule,\n callsite: itemCallsite,\n };\n\n if (type === BUILDER_TYPE_STYLE) {\n items.push({ ...itemData, type: BUILDER_TYPE_STYLE });\n continue;\n }\n\n if (slotId === null) {\n logInvalidData('invalid style data', { property, style });\n continue;\n }\n\n if (type === BUILDER_TYPE_SLOT) {\n items.push({ ...itemData, type: BUILDER_TYPE_SLOT, slotId });\n continue;\n }\n\n if (type === BUILDER_TYPE_SLOT_OVERRIDE) {\n items.push({ ...itemData, type: BUILDER_TYPE_SLOT_OVERRIDE, slotId });\n continue;\n }\n\n logInvalidData('invalid style data', { property, style });\n }\n }\n\n if (!items.length) return data;\n\n for (let i = 0, len = items.length; i < len; i++) {\n item = items[i];\n\n if (Array.isArray(item) || isStyleTokenOverrideData(item)) {\n logInvalidData('invalid style data', { item, style });\n continue;\n }\n\n const runtimeItem = item as RuntimeItem;\n value = runtimeItem.value;\n priority = null;\n\n if (Array.isArray(value)) {\n priority = value[1];\n value = value[0];\n }\n\n dedupe = getClassNameDedupe(\n runtimeItem.property,\n priority,\n runtimeItem.selector,\n null,\n runtimeItem.atRule,\n );\n\n className = getAtomicClassName(\n runtimeItem.property,\n priority,\n value,\n runtimeItem.selector,\n null,\n runtimeItem.atRule,\n runtimeItem.callsite,\n DEV_CONFIG.isLocalClassNameEnabled,\n DEBUG_CONFIG.isDebugClassNameEnabled,\n CSS_CONFIG.classNameFormat ?? null,\n );\n\n runtimeItem.dedupe = dedupe;\n runtimeItem.className = className;\n\n lookupIndex = lookup[dedupe];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = runtimeItem;\n } else {\n lookup[dedupe] = styles.push(runtimeItem) - 1;\n }\n }\n\n return data;\n}\n\nfunction getMergedStyleDebug(\n debug: DebugData | null,\n item: RuntimeItem,\n) {\n if (!debug) return null;\n if (debug.fields?.[item.property]) return debug;\n\n const valueLoc = getMergedItemValueLoc(item);\n if (!valueLoc) return debug;\n\n return {\n ...debug,\n fields: {\n ...debug.fields,\n [item.property]: {\n [TRACE_STYLE]: withDebugSource(debug.loc, debug),\n [TRACE_VALUE]: valueLoc,\n },\n },\n };\n}\n\nfunction getMergedItemValueLoc(item: RuntimeItem): DebugLoc | null {\n if (item.debug && item.debugField) {\n const loc = item.debug.fields?.[item.debugField];\n if (Array.isArray(loc)) return withDebugSource(loc, item.debug);\n if (loc) {\n const traceLoc = loc[TRACE_VALUE] ?? loc[TRACE_STYLE] ?? null;\n return traceLoc ? withDebugSource(traceLoc, item.debug) : null;\n }\n }\n\n return item.callsite\n ? [item.callsite.line, item.callsite.column, undefined, item.callsite.sourceUrl, item.callsite.sourceContent]\n : null;\n}\n\nfunction withDebugSource(loc: DebugLoc, debug: DebugData): DebugLoc {\n return loc[3] ? loc : [loc[0], loc[1], loc[2], debug.sourceUrl, debug.code];\n}\n","export const SELECTOR_BASE = '';\nexport const SELECTOR_ARG = '$';\nexport const SELECTOR_ARGS = '$$';\nexport const SELECTOR_MERGE = '...';\nexport const SELECTOR_AT_RULE = '@';\nexport const SELECTOR_MEDIA = '@media';\nexport const SELECTOR_CONTAINER = '@container';\n\nexport function normalizeSelectorArg(arg: string) {\n return arg.includes('\\n') ? arg.replace(/\\n/g, '') : arg;\n}\n"],"mappings":";;;;;;;;;;AAIA,SAAgB,cACd,UACA,QACA,YACA,KACA;CACA,IAAI,UAAyB;CAE7B,IAAI;EACF,eAAe,WAAW,QAAQ,GAAG;CACvC,SAAS,OAAO;EACd,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,GAC1C,UAAU;OACL,IAAI,OAAO,UAAU,YAAY,SAAS,iBAAiB,OAChE,WAAW,MAAM,WAAW,IAAI,KAAK;OAErC,UAAU,0BAA0B;CAExC;CAEA,IAAI,CAAC,SAAS;CAId,MAAM,WAAW,GAFA,WAAW,OAAO,GAAG,OAAO,GAAG,KAAK,SAE/B;AACxB;;;ACHA,SAAgB,gBACd,UACkB;CAClB,OAAO;GACJ,eAAA;GACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;GACxC,mBAAmB;CACtB;AACF;AAEA,SAAgB,eACd,UACA,QACiB;CACjB,OAAO;GACJ,eAAA;GACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;GACxC,mBAAmB;GACnB,kBAAkB;CACrB;AACF;AAEA,SAAgB,uBACd,UACA,QACyB;CACzB,OAAO;GACJ,eAAA;GACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;GACxC,mBAAmB;GACnB,kBAAkB;CACrB;AACF;AAEA,SAAgB,gBACd,UAC+C;CAC/C,OAAO;GACJ,eAAA;GACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC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W,IAAA,MAAoB,IAAA,MAAoB;GACzD,OAAO,WAAW,gBAAgB,UAAU,KAAK,KAAK,IAAI;EAC5D;CACF;CAEA,OAAO,KAAK,WACR;EAAC,KAAK,SAAS;EAAM,KAAK,SAAS;EAAQ,KAAA;EAAW,KAAK,SAAS;EAAW,KAAK,SAAS;CAAa,IAC1G;AACN;AAEA,SAAS,gBAAgB,KAAe,OAA4B;CAClE,OAAO,IAAI,KAAK,MAAM;EAAC,IAAI;EAAI,IAAI;EAAI,IAAI;EAAI,MAAM;EAAW,MAAM;CAAI;AAC5E;;;ACtRA,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB;AAElC,SAAgB,qBAAqB,KAAa;CAChD,OAAO,IAAI,SAAS,IAAI,IAAI,IAAI,QAAQ,OAAO,EAAE,IAAI;AACvD"}
1
+ {"version":3,"file":"data-BsqOa5br.js","names":["withDebugSource"],"sources":["../builder/data/check_selector.ts","../builder/data/create.ts","../builder/data/merge/utils.ts","../builder/data/merge/scope.ts","../builder/data/merge/style.ts","../builder/data/selector.ts"],"sourcesContent":["import { assertSelector } from '../../selector/assert';\nimport type { Selector } from '../../selector/types';\nimport { traceError } from '../../utils/trace';\n\nexport function checkSelector(\n fnPrefix: string,\n fnName: string,\n fnSelector: Selector,\n arg: string,\n) {\n let message: string | null = null;\n\n try {\n assertSelector(fnSelector.assert, arg);\n } catch (error) {\n if (typeof error === 'string' && error.trim()) {\n message = error;\n } else if (typeof error === 'object' && error && error instanceof Error) {\n message = (error.message || '').trim();\n } else {\n message = 'selector is invalid: ' + arg;\n }\n }\n\n if (!message) return;\n\n const error = `${fnPrefix}${fnName}(${arg || ''}): ${message}`;\n\n throw traceError(error);\n}\n","import type { StyleTokenOverride } from '../../style/token';\nimport {\n BUILDER_CALLSITE,\n BUILDER_SCOPE,\n BUILDER_SCOPE_ID,\n BUILDER_SLOT_ID,\n BUILDER_STATE,\n BUILDER_TYPE,\n BUILDER_TYPE_SCOPE,\n BUILDER_TYPE_SCOPE_TARGET,\n BUILDER_TYPE_SLOT,\n BUILDER_TYPE_SLOT_OVERRIDE,\n BUILDER_TYPE_STYLE,\n BUILDER_TYPE_THEME,\n} from './const';\nimport type {\n BuilderCallsite,\n BuilderData,\n ScopeData,\n ScopeTargetData,\n SlotData,\n SlotOverrideData,\n StyleData,\n ThemeData,\n} from './data';\n\nexport function createStyleData<Style>(\n callsite: BuilderCallsite | null,\n): StyleData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_STYLE,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n };\n}\n\nexport function createSlotData<Style>(\n callsite: BuilderCallsite | null,\n slotId: string,\n): SlotData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SLOT,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n [BUILDER_SLOT_ID]: slotId,\n };\n}\n\nexport function createSlotOverrideData<Style>(\n callsite: BuilderCallsite | null,\n slotId: string,\n): SlotOverrideData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SLOT_OVERRIDE,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n [BUILDER_SLOT_ID]: slotId,\n };\n}\n\nexport function createScopeData<Style>(\n callsite: BuilderCallsite | null,\n): BuilderData<Style, typeof BUILDER_TYPE_SCOPE> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SCOPE,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n };\n}\n\nexport function createScopeTargetData<Style>(\n scope: ScopeData<Style>,\n slot: SlotData<Style>,\n): ScopeTargetData<Style> {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_SCOPE_TARGET,\n [BUILDER_SCOPE]: scope,\n [BUILDER_SCOPE_ID]: slot[BUILDER_SLOT_ID],\n };\n}\n\nexport function createThemeData(\n callsite: BuilderCallsite | null,\n id: string,\n className: string,\n tokens: readonly StyleTokenOverride[],\n): ThemeData {\n return {\n [BUILDER_TYPE]: BUILDER_TYPE_THEME,\n [BUILDER_STATE]: { items: [], lookup: {} },\n [BUILDER_CALLSITE]: callsite,\n id,\n className,\n tokens,\n };\n}\n","import { DEV_CONFIG } from '../../../config/config/dev';\nimport { traceError } from '../../../utils/trace';\nimport { BUILDER_STATE, ITEM_RUNTIME_DEV, ITEM_RUNTIME_DEV_PLUGIN, ITEM_RUNTIME_PROD } from '../const';\nimport type { BuilderData } from '../data';\nimport type { DebugData } from '../debug';\nimport type { ItemRuntimeType, StateItem, StateLookup } from '../state';\n\nexport function cloneData<Data extends BuilderData, Source extends BuilderData>(\n data: Data,\n source: Source,\n debug: DebugData | null,\n merge = true,\n): [runtimeType: ItemRuntimeType, data: Data, items: StateItem[], lookup: StateLookup] {\n const runtimeType = DEV_CONFIG.isDev\n ? (debug ? ITEM_RUNTIME_DEV_PLUGIN : ITEM_RUNTIME_DEV)\n : ITEM_RUNTIME_PROD;\n\n const state = data[BUILDER_STATE];\n\n state.items = merge ? source[BUILDER_STATE].items.slice() : [];\n\n state.lookup = Object.assign(\n Object.create(null),\n merge ? source[BUILDER_STATE].lookup : null,\n );\n\n const lookup = state.lookup!;\n const items = state.items;\n\n return [runtimeType, data, items, lookup];\n}\n\nexport function logInvalidData(message: string, data: object) {\n console.log(traceError(message), 'data:', data);\n}\n","import { getAtomicClassName, getClassNameDedupe } from '../../../atomic/className';\nimport { CSS_CONFIG } from '../../../config/config/css';\nimport { DEBUG_CONFIG } from '../../../config/config/debug';\nimport { DEV_CONFIG } from '../../../config/config/dev';\nimport { getStyleTokenId, isStyleTokenOverrideData, type StyleTokenOverride } from '../../../style/token';\nimport { BUILDER_SLOT_ID, BUILDER_STATE, BUILDER_TYPE_SCOPE, BUILDER_TYPE_SLOT_OVERRIDE } from '../const';\nimport type { BuilderCallsite, ScopeData, SlotOverrideData } from '../data';\nimport {\n getDebugFieldCallsite,\n TRACE_STYLE,\n TRACE_VALUE,\n type DebugData,\n type DebugLoc,\n} from '../debug';\nimport { isScopeData, isSlotOverrideData } from '../is';\nimport type { ItemSelector, ItemValue, RuntimeScopeItem, RuntimeSlotOverrideItem, StateItem } from '../state';\nimport { cloneData, logInvalidData } from './utils';\n\nexport type ScopeItem<Style = unknown> =\n | SlotOverrideData<Style>\n | ScopeData<Style>\n | StyleTokenOverride\n | false\n | null\n | undefined;\n\nexport type ScopeItems<Style = unknown> =\n | ScopeItem<Style>\n | ScopeItem<Style>[];\n\nexport function mergeScopeData<Style>(\n scope: ScopeData<Style>,\n callsite: BuilderCallsite | null,\n items: ScopeItems<Style> | null,\n debug: DebugData | null,\n parentSelector: ItemSelector | null,\n scopeAtRule: ItemSelector | null,\n): ScopeData<Style> {\n if (!items) return scope;\n\n const sourceItems = Array.isArray(items) ? items : [items];\n const [runtimeType, data, styles, lookup] = cloneData(\n scope,\n scope,\n debug,\n );\n\n let source: ScopeItem<Style>;\n let item: StateItem;\n let lookupIndex: number;\n let priority: number | null;\n let value: ItemValue;\n let atRule: ItemSelector[] | null;\n let dedupe: string;\n let className: string;\n let itemDebug: DebugData | null | undefined;\n let itemCallsite: BuilderCallsite | null;\n\n for (let i = 0, len = sourceItems.length; i < len; i++) {\n source = sourceItems[i];\n if (!source) continue;\n\n if (isStyleTokenOverrideData(source)) {\n addTokenOverride(source, styles, lookup);\n continue;\n }\n\n if (isScopeData(source)) {\n const scopeItems = source[BUILDER_STATE].items;\n\n for (let j = 0, len = scopeItems.length; j < len; j++) {\n item = scopeItems[j];\n\n if (isStyleTokenOverrideData(item)) {\n addTokenOverride(item, styles, lookup);\n continue;\n }\n\n if (Array.isArray(item) || item.type !== BUILDER_TYPE_SCOPE) {\n logInvalidData('invalid scope data', { source, item });\n continue;\n }\n\n const sourceScopeItem = item as RuntimeScopeItem;\n\n atRule = scopeAtRule\n ? (sourceScopeItem.atRule ? [scopeAtRule].concat(sourceScopeItem.atRule) : [scopeAtRule])\n : sourceScopeItem.atRule;\n\n const scopeItem: RuntimeScopeItem = {\n ...sourceScopeItem,\n runtime: runtimeType,\n atRule,\n parentSelector: parentSelector ?? sourceScopeItem.parentSelector,\n };\n itemDebug = getMergedScopeDebug(debug, scopeItem);\n itemCallsite = getDebugFieldCallsite(itemDebug ?? null, scopeItem.property) ??\n callsite ??\n scopeItem.callsite;\n\n value = scopeItem.value;\n priority = null;\n\n if (Array.isArray(value)) {\n priority = value[1];\n value = value[0];\n }\n\n dedupe = getClassNameDedupe(\n scopeItem.property,\n priority,\n scopeItem.selector,\n scopeItem.parentSelector,\n scopeItem.atRule,\n );\n\n className = getAtomicClassName(\n scopeItem.property,\n priority,\n value,\n scopeItem.selector,\n scopeItem.parentSelector,\n scopeItem.atRule,\n itemCallsite,\n DEV_CONFIG.isLocalClassNameEnabled,\n DEBUG_CONFIG.isDebugClassNameEnabled,\n CSS_CONFIG.classNameFormat ?? null,\n );\n\n scopeItem.dedupe = dedupe;\n scopeItem.className = className;\n scopeItem.callsite = itemCallsite;\n scopeItem.debug = itemDebug ?? null;\n scopeItem.debugField = itemDebug ? scopeItem.property : null;\n\n const lookupKey = getScopeLookupKey(scopeItem.slotId, dedupe);\n lookupIndex = lookup[lookupKey];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = scopeItem;\n } else {\n lookup[lookupKey] = styles.push(scopeItem) - 1;\n }\n }\n\n continue;\n }\n\n if (!isSlotOverrideData(source)) {\n logInvalidData('invalid scope data', { source });\n continue;\n }\n\n const slotId = source[BUILDER_SLOT_ID];\n const overrideItems = source[BUILDER_STATE].items;\n\n for (let j = 0, len = overrideItems.length; j < len; j++) {\n item = overrideItems[j];\n\n if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== BUILDER_TYPE_SLOT_OVERRIDE) {\n logInvalidData('invalid scope data', { source, item });\n continue;\n }\n\n const overrideItem = item as RuntimeSlotOverrideItem;\n\n atRule = scopeAtRule\n ? (overrideItem.atRule ? [scopeAtRule].concat(overrideItem.atRule) : [scopeAtRule])\n : overrideItem.atRule;\n\n const scopeItem: RuntimeScopeItem = {\n type: BUILDER_TYPE_SCOPE,\n slotId,\n runtime: runtimeType,\n dedupe: '',\n className: '',\n property: overrideItem.property,\n value: overrideItem.value,\n token: overrideItem.token,\n selector: overrideItem.selector,\n atRule,\n callsite: overrideItem.callsite ?? callsite,\n debug: overrideItem.debug,\n debugField: overrideItem.debugField,\n parentSelector,\n };\n\n value = scopeItem.value;\n priority = null;\n\n if (Array.isArray(value)) {\n priority = value[1];\n value = value[0];\n }\n\n dedupe = getClassNameDedupe(\n scopeItem.property,\n priority,\n scopeItem.selector,\n parentSelector,\n scopeItem.atRule,\n );\n\n className = getAtomicClassName(\n scopeItem.property,\n priority,\n value,\n scopeItem.selector,\n parentSelector,\n scopeItem.atRule,\n scopeItem.callsite,\n DEV_CONFIG.isLocalClassNameEnabled,\n DEBUG_CONFIG.isDebugClassNameEnabled,\n CSS_CONFIG.classNameFormat ?? null,\n );\n\n scopeItem.dedupe = dedupe;\n scopeItem.className = className;\n\n const lookupKey = getScopeLookupKey(slotId, dedupe);\n lookupIndex = lookup[lookupKey];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = scopeItem;\n } else {\n lookup[lookupKey] = styles.push(scopeItem) - 1;\n }\n }\n }\n\n return data as ScopeData<Style>;\n}\n\nfunction addTokenOverride(\n item: StyleTokenOverride,\n styles: StateItem[],\n lookup: Record<string, number>,\n) {\n const lookupKey = getTokenLookupKey(getStyleTokenId(item));\n const lookupIndex = lookup[lookupKey];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = item;\n } else {\n lookup[lookupKey] = styles.push(item) - 1;\n }\n}\n\nfunction getMergedScopeDebug(\n debug: DebugData | null,\n item: RuntimeScopeItem,\n): DebugData | null | undefined {\n if (!debug) return item.debug;\n if (debug.fields?.[item.property]) return debug;\n\n const valueLoc = getRuntimeScopeItemValueLoc(item);\n if (!valueLoc) return debug;\n\n return {\n ...debug,\n fields: {\n ...debug.fields,\n [item.property]: {\n [TRACE_STYLE]: debug.loc,\n [TRACE_VALUE]: valueLoc,\n },\n },\n };\n}\n\nfunction getRuntimeScopeItemValueLoc(item: RuntimeScopeItem): DebugLoc | null {\n if (item.debug && item.debugField) {\n const loc = item.debug.fields?.[item.debugField];\n if (Array.isArray(loc)) return withDebugSource(loc, item.debug.sourceUrl, item.debug.code);\n if (loc) {\n const valueLoc = loc[TRACE_VALUE] ?? loc[TRACE_STYLE] ?? null;\n return valueLoc ? withDebugSource(valueLoc, item.debug.sourceUrl, item.debug.code) : null;\n }\n }\n\n return item.callsite\n ? [item.callsite.line, item.callsite.column, undefined, item.callsite.sourceUrl, item.callsite.sourceContent]\n : null;\n}\n\nfunction withDebugSource(\n loc: DebugLoc,\n sourceUrl: string,\n sourceContent: string | undefined,\n): DebugLoc {\n return loc[3] ? loc : [loc[0], loc[1], loc[2], sourceUrl, sourceContent];\n}\n\nfunction getScopeLookupKey(slotId: string, dedupe: string) {\n return slotId + '\\0' + dedupe;\n}\n\nfunction getTokenLookupKey(tokenId: string) {\n return 'token\\0' + tokenId;\n}\n","import { getAtomicClassName, getClassNameDedupe } from '../../../atomic/className';\nimport { getTokenVar } from '../../../atomic/token';\nimport { getCssVarRawFallback } from '../../../atomic/utils/css';\nimport { shouldAppendCssPx } from '../../../atomic/value';\nimport { CSS_CONFIG } from '../../../config/config/css';\nimport { DEBUG_CONFIG } from '../../../config/config/debug';\nimport { DEV_CONFIG } from '../../../config/config/dev';\nimport { isStyleTokenData, isStyleTokenOverrideData, type StyleTokenData } from '../../../style/token';\nimport type { StyleObject, StyleValueTuple } from '../../../style/types';\nimport { type AtRuleRef, isAtRuleRef } from '../../../style/valueRef';\nimport {\n BUILDER_SLOT_ID,\n BUILDER_STATE,\n BUILDER_TYPE_SLOT,\n BUILDER_TYPE_SLOT_OVERRIDE,\n BUILDER_TYPE_STYLE,\n ITEM_VALUE_NUMBER_PX,\n ITEM_VALUE_TYPE_AT_RULE_REF,\n ITEM_VALUE_TYPE_VARIABLE,\n} from '../const';\nimport type { BuilderCallsite, BuilderData, StyleData } from '../data';\nimport {\n type DebugData,\n type DebugLoc,\n getDebugFieldCallsite,\n getDebugFieldVarName,\n TRACE_STYLE,\n TRACE_VALUE,\n} from '../debug';\nimport { isSlotData, isSlotOverrideData, isStyleData } from '../is';\nimport type { BuilderType, ItemSelector, ItemValue, RuntimeItem, RuntimeItemData, StateItem } from '../state';\nimport { cloneData, logInvalidData } from './utils';\n\nexport type CreateData<Data extends BuilderData> = (\n callsite: BuilderCallsite | null,\n data: Data,\n) => Data;\n\nexport function mergeBuilderData<Data extends BuilderData>(\n create: CreateData<Data>,\n callsite: BuilderCallsite | null,\n source: Data,\n style: StyleObject | StyleData | null,\n debug: DebugData | null,\n selector: ItemSelector | null,\n atRule: ItemSelector[] | null,\n type: BuilderType,\n): Data {\n if (!style) return source;\n\n const [runtimeType, data, styles, lookup] = cloneData(\n create(callsite, source),\n source,\n debug,\n );\n\n const slotId = isSlotData(source) || isSlotOverrideData(source)\n ? source[BUILDER_SLOT_ID]\n : null;\n\n const items: RuntimeItem[] = [];\n\n let item: StateItem;\n let itemData: RuntimeItemData;\n\n let valueRaw: unknown;\n let value: ItemValue;\n let priority: number | null;\n let itemCallsite: BuilderCallsite | null;\n let className: string;\n let dedupe: string;\n let token: StyleTokenData | null;\n let ref: AtRuleRef | null;\n let variableName: string | null;\n let lookupIndex: number;\n\n if (isStyleData(style)) {\n const stylesItems = style[BUILDER_STATE].items;\n\n for (let i = 0, len = stylesItems.length; i < len; i++) {\n item = stylesItems[i];\n\n if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== BUILDER_TYPE_STYLE) {\n logInvalidData('invalid style data', { item, style });\n continue;\n }\n\n if (atRule) {\n item = Object.assign({}, item, {\n atRule: item.atRule ? atRule.concat(item.atRule) : atRule,\n });\n }\n\n // Re-type to SLOT/SLOT_OVERRIDE when this StyleData is used inside a slot context.\n // Without this, style.slot(...).media('...', style({...})) would keep the inner\n // items as BUILDER_TYPE_STYLE and they would not be resolved when the slot is used.\n if (type === BUILDER_TYPE_SLOT && slotId !== null) {\n item = Object.assign({}, item, { type: BUILDER_TYPE_SLOT, slotId });\n } else if (type === BUILDER_TYPE_SLOT_OVERRIDE && slotId !== null) {\n item = Object.assign({}, item, { type: BUILDER_TYPE_SLOT_OVERRIDE, slotId });\n }\n\n const itemDebug = getMergedStyleDebug(debug, item);\n const debugCallsite = getDebugFieldCallsite(itemDebug, item.property);\n if (debugCallsite) {\n item = Object.assign({}, item, {\n callsite: debugCallsite,\n debug: itemDebug,\n debugField: item.property,\n });\n }\n\n items.push(item);\n }\n } else {\n for (const property in style) {\n valueRaw = style[property as keyof typeof style];\n priority = null;\n\n if (Array.isArray(valueRaw) && valueRaw.length === 2 && typeof valueRaw[0] === 'number') {\n priority = (valueRaw as StyleValueTuple)[0];\n valueRaw = (valueRaw as StyleValueTuple)[1];\n }\n\n ref = isAtRuleRef(valueRaw) ? valueRaw : null;\n if (ref) valueRaw = ref.value;\n\n token = isStyleTokenData(valueRaw) ? valueRaw : null;\n variableName = getDebugFieldVarName(debug, property);\n\n value = variableName && token\n ? getCssVarRawFallback(variableName, getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null))\n : token\n ? getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null)\n : String(valueRaw ?? '');\n\n value = priority !== null ? [value, priority] : value;\n itemCallsite = getDebugFieldCallsite(debug, property) ?? callsite;\n\n itemData = {\n runtime: runtimeType,\n debug,\n debugField: property,\n dedupe: '',\n className: '',\n property,\n value,\n variable: ref\n ? [ITEM_VALUE_TYPE_AT_RULE_REF, ref]\n : variableName && token\n ? [\n ITEM_VALUE_TYPE_VARIABLE,\n variableName,\n valueRaw,\n shouldAppendCssPx(property) ? ITEM_VALUE_NUMBER_PX : undefined,\n ]\n : ref\n ? [ITEM_VALUE_TYPE_AT_RULE_REF, ref]\n : undefined,\n token,\n selector,\n atRule,\n callsite: itemCallsite,\n };\n\n if (type === BUILDER_TYPE_STYLE) {\n items.push({ ...itemData, type: BUILDER_TYPE_STYLE });\n continue;\n }\n\n if (slotId === null) {\n logInvalidData('invalid style data', { property, style });\n continue;\n }\n\n if (type === BUILDER_TYPE_SLOT) {\n items.push({ ...itemData, type: BUILDER_TYPE_SLOT, slotId });\n continue;\n }\n\n if (type === BUILDER_TYPE_SLOT_OVERRIDE) {\n items.push({ ...itemData, type: BUILDER_TYPE_SLOT_OVERRIDE, slotId });\n continue;\n }\n\n logInvalidData('invalid style data', { property, style });\n }\n }\n\n if (!items.length) return data;\n\n for (let i = 0, len = items.length; i < len; i++) {\n item = items[i];\n\n if (Array.isArray(item) || isStyleTokenOverrideData(item)) {\n logInvalidData('invalid style data', { item, style });\n continue;\n }\n\n const runtimeItem = item as RuntimeItem;\n value = runtimeItem.value;\n priority = null;\n\n if (Array.isArray(value)) {\n priority = value[1];\n value = value[0];\n }\n\n dedupe = getClassNameDedupe(\n runtimeItem.property,\n priority,\n runtimeItem.selector,\n null,\n runtimeItem.atRule,\n );\n\n className = getAtomicClassName(\n runtimeItem.property,\n priority,\n value,\n runtimeItem.selector,\n null,\n runtimeItem.atRule,\n runtimeItem.callsite,\n DEV_CONFIG.isLocalClassNameEnabled,\n DEBUG_CONFIG.isDebugClassNameEnabled,\n CSS_CONFIG.classNameFormat ?? null,\n );\n\n runtimeItem.dedupe = dedupe;\n runtimeItem.className = className;\n\n lookupIndex = lookup[dedupe];\n\n if (typeof lookupIndex === 'number') {\n styles[lookupIndex] = runtimeItem;\n } else {\n lookup[dedupe] = styles.push(runtimeItem) - 1;\n }\n }\n\n return data;\n}\n\nfunction getMergedStyleDebug(\n debug: DebugData | null,\n item: RuntimeItem,\n) {\n if (!debug) return null;\n if (debug.fields?.[item.property]) return debug;\n\n const valueLoc = getMergedItemValueLoc(item);\n if (!valueLoc) return debug;\n\n return {\n ...debug,\n fields: {\n ...debug.fields,\n [item.property]: {\n [TRACE_STYLE]: withDebugSource(debug.loc, debug),\n [TRACE_VALUE]: valueLoc,\n },\n },\n };\n}\n\nfunction getMergedItemValueLoc(item: RuntimeItem): DebugLoc | null {\n if (item.debug && item.debugField) {\n const loc = item.debug.fields?.[item.debugField];\n if (Array.isArray(loc)) return withDebugSource(loc, item.debug);\n if (loc) {\n const traceLoc = loc[TRACE_VALUE] ?? loc[TRACE_STYLE] ?? null;\n return traceLoc ? withDebugSource(traceLoc, item.debug) : null;\n }\n }\n\n return item.callsite\n ? [item.callsite.line, item.callsite.column, undefined, item.callsite.sourceUrl, item.callsite.sourceContent]\n : null;\n}\n\nfunction withDebugSource(loc: DebugLoc, debug: DebugData): DebugLoc {\n return loc[3] ? loc : [loc[0], loc[1], loc[2], debug.sourceUrl, debug.code];\n}\n","export const SELECTOR_BASE = '';\nexport const SELECTOR_ARG = '$';\nexport const SELECTOR_ARGS = '$$';\nexport const SELECTOR_MERGE = '...';\nexport const SELECTOR_AT_RULE = '@';\nexport const SELECTOR_MEDIA = '@media';\nexport const SELECTOR_CONTAINER = '@container';\n\nexport function normalizeSelectorArg(arg: string) {\n return arg.includes('\\n') ? arg.replace(/\\n/g, '') : arg;\n}\n"],"mappings":";;;;;;;;;;AAIA,SAAgB,cACd,UACA,QACA,YACA,KACA;CACA,IAAI,UAAyB;CAE7B,IAAI;EACF,eAAe,WAAW,QAAQ,GAAG;CACvC,SAAS,OAAO;EACd,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,GAC1C,UAAU;OACL,IAAI,OAAO,UAAU,YAAY,SAAS,iBAAiB,OAChE,WAAW,MAAM,WAAW,IAAI,KAAK;OAErC,UAAU,0BAA0B;CAExC;CAEA,IAAI,CAAC,SAAS;CAId,MAAM,WAAW,GAFA,WAAW,OAAO,GAAG,OAAO,GAAG,KAAK,SAE/B;AACxB;;;ACHA,SAAgB,gBACd,UACkB;CAClB,OAAO;GACJ,eAAA;GACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;GACxC,mBAAmB;CACtB;AACF;AAEA,SAAgB,e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AW,sBAAsB,IAAI;CAC3C,IAAI,CAAC,UAAU,OAAO;CAEtB,OAAO;EACL,GAAG;EACH,QAAQ;GACN,GAAG,MAAM;IACR,KAAK,WAAW;SACA,gBAAgB,MAAM,KAAK,KAAK;SAChC;GACjB;EACF;CACF;AACF;AAEA,SAAS,sBAAsB,MAAoC;CACjE,IAAI,KAAK,SAAS,KAAK,YAAY;EACjC,MAAM,MAAM,KAAK,MAAM,SAAS,KAAK;EACrC,IAAI,MAAM,QAAQ,GAAG,GAAG,OAAO,gBAAgB,KAAK,KAAK,KAAK;EAC9D,IAAI,KAAK;GACP,MAAM,WAAW,IAAA,MAAoB,IAAA,MAAoB;GACzD,OAAO,WAAW,gBAAgB,UAAU,KAAK,KAAK,IAAI;EAC5D;CACF;CAEA,OAAO,KAAK,WACR;EAAC,KAAK,SAAS;EAAM,KAAK,SAAS;EAAQ,KAAA;EAAW,KAAK,SAAS;EAAW,KAAK,SAAS;CAAa,IAC1G;AACN;AAEA,SAAS,gBAAgB,KAAe,OAA4B;CAClE,OAAO,IAAI,KAAK,MAAM;EAAC,IAAI;EAAI,IAAI;EAAI,IAAI;EAAI,MAAM;EAAW,MAAM;CAAI;AAC5E;;;ACtRA,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB;AAElC,SAAgB,qBAAqB,KAAa;CAChD,OAAO,IAAI,SAAS,IAAI,IAAI,IAAI,QAAQ,OAAO,EAAE,IAAI;AACvD"}
package/dist/entry/dev.js CHANGED
@@ -2,9 +2,9 @@ import { o as LayerPlaceholder } from "../runtime-CYqNCiaM.js";
2
2
  import { t as configureStyleRuntime } from "../config-BryWDfQX.js";
3
3
  import { c as TOKEN_OVERRIDE, d as getStyleTokenId, f as getStyleTokenOverrideDebug, h as resetStyleTokenIdCounter, l as createStyleToken, m as isStyleTokenOverrideData, o as TOKEN_DEBUG, p as isStyleTokenData, s as TOKEN_ID, u as createStyleTokenOverride } from "../value-E8rEv2Oe.js";
4
4
  import { n as createAtRuleRef, r as isAtRuleRef, t as AT_RULE_REF } from "../valueRef-lshFk1Cs.js";
5
- import { a as styleTransform, c as createValues, d as createStyleFn, f as getStyleFnMeta, g as transformKeyframes, h as createStyleKeyframes, i as getToken, l as createTheme, m as type, n as bindScope, o as createTokens, p as style, r as combineScope, s as createToken, t as combineStyle, u as resetStyleThemeIdCounter } from "../style-4rFUy-zW.js";
5
+ import { a as styleTransform, c as createValues, d as createStyleFn, f as getStyleFnMeta, g as transformKeyframes, h as createStyleKeyframes, i as getToken, l as createTheme, m as type, n as bindScope, o as createTokens, p as style, r as combineScope, s as createToken, t as combineStyle, u as resetStyleThemeIdCounter } from "../style-DgHbdbdF.js";
6
6
  import { n as getClassName, t as transformElement } from "../jsx-D2BksHSv.js";
7
- import "../style-Cw3NtvR0.js";
7
+ import "../style-B-6jHipw.js";
8
8
  import { createElement } from "../jsx/jsx-runtime.js";
9
9
  import "../config-DloHOG6I.js";
10
10
  export { AT_RULE_REF, LayerPlaceholder, TOKEN_DEBUG, TOKEN_ID, TOKEN_OVERRIDE, bindScope, combineScope, combineStyle, configureStyleRuntime, createAtRuleRef, createElement, createStyleFn, createStyleKeyframes, createStyleToken, createStyleTokenOverride, createTheme, createToken, createTokens, createValues, getClassName, getStyleFnMeta, getStyleTokenId, getStyleTokenOverrideDebug, getToken, isAtRuleRef, isStyleTokenData, isStyleTokenOverrideData, resetStyleThemeIdCounter, resetStyleTokenIdCounter, style, styleTransform, transformElement, transformKeyframes, type };
@@ -2,7 +2,7 @@ import { a as createStyleTokenOverride, c as isStyleTokenData, d as globalData,
2
2
  import { _ as LayerPlaceholder, a as escapeCssIdent, c as getIdentifierSafeHash, f as RUNTIME_CONFIG, g as CSS_CONFIG_DEFAULT, h as CSS_CONFIG, i as createNameFormatter, n as getTokenVar, p as SIDECAR_URL_GLOBAL_SYMBOL, r as getTokenVarName } from "../token-u_tM-mtg.js";
3
3
  import "../config-DKHXWhe1.js";
4
4
  import { C as compareLayerPriority, S as LayerSelectorPriorities, T as configureStyleRuntime, _ as getLayerBlockCss, b as LayerDefaultPriority, c as AT_RULE_REF, g as getPropertyPriority, h as getCssPropertyName, l as createAtRuleRef, p as getCssPropertyValue, u as isAtRuleRef, v as getLayerOrderCss, w as createLayerPool, x as LayerMediaPriorities, y as LayerDefaultLayers } from "../css-ByOrugEX.js";
5
- import { a as createTheme, c as createStyleFn, d as type, f as getDebugFieldLoc, g as transformKeyframes, h as createStyleKeyframes, i as createValues, l as getStyleFnMeta, m as normalizeCallsiteSourceUrl, n as createTokens, o as resetStyleThemeIdCounter, p as DEV_CONFIG, r as createToken, s as getThemeRuleCss, t as styleTransform, u as style } from "../style-DNqQ6H-7.js";
5
+ import { a as createTheme, c as createStyleFn, d as type, f as getDebugFieldLoc, g as transformKeyframes, h as createStyleKeyframes, i as createValues, l as getStyleFnMeta, m as normalizeCallsiteSourceUrl, n as createTokens, o as resetStyleThemeIdCounter, p as DEV_CONFIG, r as createToken, s as getThemeRuleCss, t as styleTransform, u as style } from "../style-v2bf70TZ.js";
6
6
  import { c as BUILDER_CALLSITE, n as isExtractedTokenBoundData, t as getExtractedTokenBoundData } from "../withTokens-LRidu3Vc.js";
7
7
  import { a as mergeResolvedStyle, c as getStylePropCacheValue, h as hasOwn, i as mergeResolvedClassName, n as finishClassNameResult, s as walkRecursiveItems, t as createClassNameResult } from "../className-C1Ht5Wvv.js";
8
8
  import { C as isThemeData, S as isStyleData, _ as sanitizeDebugName, a as mergeTokenOverrides, b as isSlotData, c as createResolvedStyleItemFromItems, d as isResolvedStyleItem, g as getSelectorText, h as getSelectorPriority, i as getToken, l as getDirectStyleItem, m as getScopeClassName, n as bindScope, o as mergeTokenValues, r as combineScope, s as createResolvedStyleItem, t as combineStyle, u as getStyleTokenValues, v as isScopeData, x as isSlotOverrideData, y as isScopeTargetData } from "../style-B1UUqjj5.js";
@@ -277,6 +277,41 @@ function createStyleKeyframes(frames, transform, stableId) {
277
277
  return createKeyframes(transformKeyframes(frames, transform), stableId);
278
278
  }
279
279
  //#endregion
280
+ //#region selector/selector.ts
281
+ function selector(selector, ...args) {
282
+ let priority = null;
283
+ let assert = null;
284
+ if (typeof args[0] === "number") {
285
+ priority = args[0];
286
+ assert = args[1] || null;
287
+ } else assert = args[0] || null;
288
+ return {
289
+ selector,
290
+ priority,
291
+ assert
292
+ };
293
+ }
294
+ function selectorPriority(selectors, values) {
295
+ selectors = { ...selectors };
296
+ (Array.isArray(values) ? values.map((name, index) => ({
297
+ name,
298
+ priority: index + 1
299
+ })) : Object.keys(values).map((name) => ({
300
+ name,
301
+ priority: values[name]?.priority ?? null
302
+ }))).forEach(({ name, priority }) => {
303
+ if (!selectors[name]) return;
304
+ selectors[name] = {
305
+ ...selectors[name],
306
+ priority: priority ?? selectors[name].priority
307
+ };
308
+ });
309
+ return selectors;
310
+ }
311
+ function createSelectorAssert(fn) {
312
+ return fn;
313
+ }
314
+ //#endregion
280
315
  //#region selector/validate.ts
281
316
  function isLocalSelector(selector) {
282
317
  const groups = parseSelector(selector);
@@ -343,33 +378,33 @@ function assertSelector(type, value) {
343
378
  default: throw new Error("unsupported selector type: " + value);
344
379
  }
345
380
  }
346
- function assertSelectorNotEmpty(value) {
381
+ const assertSelectorNotEmpty = createSelectorAssert((value) => {
347
382
  if (!value) throw new Error("selector cannot be empty");
348
- }
349
- function assertLocalSelector(value) {
383
+ });
384
+ const assertLocalSelector = createSelectorAssert((value) => {
350
385
  if (!isLocalSelector(value)) throw new Error("selector must target the current element only and cannot contain tags, combinators, or multiple selectors");
351
- }
352
- function assertPseudoArgSelector(value) {
386
+ });
387
+ const assertPseudoArgSelector = createSelectorAssert((value) => {
353
388
  if (!isPseudoArgSelector(value)) throw new Error("pseudo selector argument must contain only tags or selectors targeting the current element");
354
- }
355
- function assertTagSelector(value) {
389
+ });
390
+ const assertTagSelector = createSelectorAssert((value) => {
356
391
  if (!isTagSelector(value)) throw new Error("selector must be a single tag selector");
357
- }
358
- function assertAttrSelector(value) {
392
+ });
393
+ const assertAttrSelector = createSelectorAssert((value) => {
359
394
  if (!isAttrArg(value)) throw new Error("attribute selector value must not include \"[\" or \"]\"");
360
- }
361
- function assertRawValue(value) {
395
+ });
396
+ const assertRawValue = createSelectorAssert((value) => {
362
397
  if (!isRawValue(value)) throw new Error("value must not contain \"{\" or \"}\"");
363
- }
364
- function assertMediaQuery(value) {
398
+ });
399
+ const assertMediaQuery = createSelectorAssert((value) => {
365
400
  if (!isRawValue(value)) throw new Error("media query must not contain \"{\" or \"}\"");
366
- }
367
- function assertSupportsQuery(value) {
401
+ });
402
+ const assertSupportsQuery = createSelectorAssert((value) => {
368
403
  if (!isRawValue(value)) throw new Error("supports query must not contain \"{\" or \"}\"");
369
- }
370
- function assertContainerQuery(value) {
404
+ });
405
+ const assertContainerQuery = createSelectorAssert((value) => {
371
406
  if (!isRawValue(value)) throw new Error("container query must not contain \"{\" or \"}\"");
372
- }
407
+ });
373
408
  //#endregion
374
409
  //#region builder/data/check_selector.ts
375
410
  function checkSelector(fnPrefix, fnName, fnSelector, arg) {
@@ -1162,38 +1197,6 @@ function cloneScope(source, callsite) {
1162
1197
  return scope;
1163
1198
  }
1164
1199
  //#endregion
1165
- //#region selector/selector.ts
1166
- function selector(selector, ...args) {
1167
- let priority = null;
1168
- let assert = null;
1169
- if (typeof args[0] === "number") {
1170
- priority = args[0];
1171
- assert = args[1] || null;
1172
- } else assert = args[0] || null;
1173
- return {
1174
- selector,
1175
- priority,
1176
- assert
1177
- };
1178
- }
1179
- function selectorPriority(selectors, values) {
1180
- selectors = { ...selectors };
1181
- (Array.isArray(values) ? values.map((name, index) => ({
1182
- name,
1183
- priority: index + 1
1184
- })) : Object.keys(values).map((name) => ({
1185
- name,
1186
- priority: values[name]?.priority ?? null
1187
- }))).forEach(({ name, priority }) => {
1188
- if (!selectors[name]) return;
1189
- selectors[name] = {
1190
- ...selectors[name],
1191
- priority: priority ?? selectors[name].priority
1192
- };
1193
- });
1194
- return selectors;
1195
- }
1196
- //#endregion
1197
1200
  //#region selector/presets/selectors.ts
1198
1201
  const PseudoSelectors = {
1199
1202
  hover: selector(":hover"),