@react-hive/honey-css 1.3.0 → 1.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.dev.cjs","mappings":";;;;;;;;;;;;;;;AAAiD;AA2HjD;;;;;;;;;GASG;AACI,MAAM,oBAAoB,GAAG,CAAC,MAAuB,EAAoB,EAAE;IAChF,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,MAAM,KAAK,GAAG,GAAY,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;IAEpD,MAAM,IAAI,GAAG,GAA8B,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,GAA8B,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAEtF,MAAM,IAAI,GAAG,GAAW,EAAE,CAAC,KAAK,CAAC;IAEjC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAQ,EAAE;QACnC,KAAK,GAAG,IAAI,CAAC;IACf,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,CAA8B,IAAO,EAAuC,EAAE;QAC3F,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;QAErB,+DAAM,CAAC,KAAK,EAAE,sCAAsC,IAAI,6BAA6B,CAAC,CAAC;QACvF,+DAAM,CACJ,KAAK,CAAC,IAAI,KAAK,IAAI,EACnB,sCAAsC,IAAI,cAAc,KAAK,CAAC,IAAI,IAAI,CACvE,CAAC;QAEF,OAAO,KAA4C,CAAC;IACtD,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,SAA8B,EAAU,EAAE;QAC3D,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,OAAO,CAA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,UAAU,sBAAsB,gCAAgC,oCAAoC,kDAAkD,4BAA4B,IAAI,qBAAqB,YAAY,oEAAoE,MAAM,qGAAqG,IAAI,6BAA6B,YAAY,8BAA8B,EAAE,wBAAwB,6CAA6C,2BAA2B,wBAAwB,WAAW,+CAA+C,EAAE,uCAAuC,oKAAoK,+BAA+B,GAAG,IAAI,eAAe,UAAU,eAAe,wDAAwD,eAAe,4BAA4B,eAAe,sCAAsC,gBAAgB,kBAAkB,uBAAuB,kDAAkD,WAAW,YAAY,WAAW,2BAA2B,2BAA2B,sEAAsE,qEAAqE,iCAAiC,iDAAiD,gBAAgB,GAAG,4HAA4H,2BAA2B,6EAA6E,YAAY,yBAAyB,6BAA6B,YAAY,WAAW,mCAAmC,SAAS,cAAc,uBAAuB,iBAAiB,YAAY,IAAI,KAAK,gBAAgB,iEAAiE,kBAAkB,kIAAkI,MAAM,WAAW,6BAA6B,WAAW,qDAAqD,KAAK,aAAa,mBAAmB,wEAAwE,4BAA4B,sBAAsB,0CAA0C,EAAE,wBAAwB,aAAa,eAAe,mCAAmC,4BAA4B,4DAA4D,UAAU,YAAY,4BAA4B,oCAAoC,GAAG,KAAK,KAAK,YAAY,6BAA6B,oBAAoB,6CAA6C,kGAAkG,eAAe,SAAS,MAA+uD;AACtlU,kC;;;;;;UCDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;;;;;;;;;;;ACNwB;AACO;AACW","sources":["webpack://@react-hive/honey-css/./src/create-css-token-cursor.ts","webpack://@react-hive/honey-css/./src/tokenize-css.ts","webpack://@react-hive/honey-css/./src/types.ts","webpack://@react-hive/honey-css/./node_modules/.pnpm/@react-hive+honey-utils@3.23.0/node_modules/@react-hive/honey-utils/dist/index.mjs","webpack://@react-hive/honey-css/webpack/bootstrap","webpack://@react-hive/honey-css/webpack/runtime/define property getters","webpack://@react-hive/honey-css/webpack/runtime/hasOwnProperty shorthand","webpack://@react-hive/honey-css/webpack/runtime/make namespace object","webpack://@react-hive/honey-css/./src/index.ts"],"sourcesContent":["import { assert } from '@react-hive/honey-utils';\n\nimport type { HoneyCssToken, HoneyCssTokenType } from './types';\n\n/**\n * A lightweight cursor abstraction over a token stream.\n *\n * This is the core navigation primitive used by the Honey CSS parser.\n * It provides safe sequential reading, lookahead, backtracking,\n * and small helper utilities for collecting selector/value text.\n */\nexport interface HoneyTokenCursor {\n /**\n * Returns `true` when the cursor has consumed all tokens.\n */\n isEof: () => boolean;\n /**\n * Returns the current token without consuming it.\n *\n * This is primarily used for lookahead decisions in the parser:\n *\n * ```ts\n * if (cursor.peek()?.type === 'braceOpen') {\n * // parse rule block\n * }\n * ```\n */\n peek: () => HoneyCssToken | undefined;\n /**\n * Consumes and returns the current token, advancing the cursor forward.\n *\n * Returns `undefined` if the cursor is already at EOF.\n *\n * ```ts\n * const token = cursor.next();\n * ```\n */\n next: () => HoneyCssToken | undefined;\n /**\n * Creates a checkpoint of the current cursor position.\n *\n * Useful for speculative parsing or backtracking:\n *\n * ```ts\n * const mark = cursor.mark();\n *\n * if (!tryParseSomething(cursor)) {\n * cursor.reset(mark);\n * }\n * ```\n */\n mark: () => number;\n /**\n * Restores the cursor back to a previously created mark.\n *\n * @param mark - Index returned from {@link mark}.\n */\n reset: (mark: number) => void;\n /**\n * Consumes the next token and asserts that it matches the expected type.\n *\n * This is the parser's main safety mechanism and helps produce\n * clear error messages during invalid input.\n *\n * Throws if:\n * - the token stream ends unexpectedly\n * - the next token has a different type\n *\n * ```ts\n * cursor.expect('braceOpen'); // must be \"{\"\n * ```\n *\n * @param type - Expected token type.\n *\n * @returns The consumed token, narrowed to the expected type.\n */\n expect: <T extends HoneyCssTokenType>(type: T) => Extract<HoneyCssToken, { type: T }>;\n /**\n * Reads and concatenates consecutive token values until one of the stop token\n * types is encountered.\n *\n * This helper is used to collect:\n * - selectors (`.btn:hover`)\n * - declaration values (`calc(100% - 1px)`)\n * - at-rule names (`media`)\n *\n * Stops **before consuming** the stop token.\n *\n * Supported token types:\n * - `text` → appended as-is\n * - `string` → wrapped in quotes\n * - `params` → appended verbatim including parentheses\n *\n * Example:\n *\n * Tokens:\n * ```\n * text(\"var\")\n * params(\"(--color)\")\n * ```\n *\n * Result:\n * ```\n * \"var(--color)\"\n * ```\n *\n * @param stopTypes - Token types that terminate reading.\n *\n * @returns Combined string value.\n */\n readUntil: (stopTypes: HoneyCssTokenType[]) => string;\n /**\n * Advances the cursor until one of the stop token types is reached.\n *\n * This is useful for error recovery and safely skipping unknown syntax.\n *\n * Stops before consuming the stop token.\n *\n * @param stopTypes - Token types that terminate skipping.\n */\n skipUntil: (stopTypes: HoneyCssTokenType[]) => void;\n}\n\n/**\n * Creates a cursor wrapper around a list of CSS tokens.\n *\n * The cursor provides a small API surface for building\n * recursive-descent parsers without needing complex parser generators.\n *\n * @param tokens - Token list produced by the Honey tokenizer.\n *\n * @returns A reusable cursor instance.\n */\nexport const createCssTokenCursor = (tokens: HoneyCssToken[]): HoneyTokenCursor => {\n let index = 0;\n\n const isEof = (): boolean => index >= tokens.length;\n\n const peek = (): HoneyCssToken | undefined => (isEof() ? undefined : tokens[index]);\n\n const next = (): HoneyCssToken | undefined => (isEof() ? undefined : tokens[index++]);\n\n const mark = (): number => index;\n\n const reset = (mark: number): void => {\n index = mark;\n };\n\n const expect = <T extends HoneyCssTokenType>(type: T): Extract<HoneyCssToken, { type: T }> => {\n const token = next();\n\n assert(token, `[@react-hive/honey-css]: Expected \"${type}\" but reached end of input.`);\n assert(\n token.type === type,\n `[@react-hive/honey-css]: Expected \"${type}\" but got \"${token.type}\".`,\n );\n\n return token as Extract<HoneyCssToken, { type: T }>;\n };\n\n const readUntil = (stopTypes: HoneyCssTokenType[]): string => {\n let result = '';\n\n while (!isEof()) {\n const token = peek();\n\n if (!token || stopTypes.includes(token.type)) {\n break;\n }\n\n if (token.type === 'text') {\n if (result) {\n result += ' ';\n }\n\n result += token.value;\n //\n } else if (token.type === 'string') {\n result += `\"${token.value}\"`;\n //\n } else if (token.type === 'params') {\n result += token.value;\n }\n\n next();\n }\n\n return result.trim();\n };\n\n const skipUntil = (stopTypes: HoneyCssTokenType[]): void => {\n while (!isEof()) {\n const token = peek();\n\n if (!token || stopTypes.includes(token.type)) {\n break;\n }\n\n next();\n }\n };\n\n return {\n isEof,\n peek,\n next,\n mark,\n reset,\n expect,\n readUntil,\n skipUntil,\n };\n};\n","import type { HoneyCssToken } from './types';\n\n/**\n * Determines whether a character should terminate a plain text read.\n *\n * These characters represent structural boundaries in CSS:\n * - Blocks: `{` `}`\n * - Declarations: `:` `;`\n * - At-rules: `@`\n * - Params: `(`\n * - Strings: `'` `\"`\n * - Comments: `/`\n */\nconst isBoundaryChar = (ch: string): boolean =>\n ch === '{' ||\n ch === '}' ||\n ch === ':' ||\n ch === ';' ||\n ch === '@' ||\n ch === '(' ||\n ch === '\"' ||\n ch === \"'\" ||\n ch === '/';\n\n/**\n * Tokenizes a CSS-like input string into a sequence of Honey CSS tokens.\n *\n * This function is the first stage of the Honey CSS compilation pipeline.\n * It performs a single-pass lexical scan and produces a flat stream of tokens\n * that can later be consumed by the recursive-descent parser.\n *\n * Unlike a strict CSS tokenizer, this implementation is intentional:\n *\n * - Lightweight (no external dependencies)\n * - Tolerant (fails safely on malformed input)\n * - Extended for CSS-in-JS use cases\n *\n * In addition to standard CSS constructs, it supports:\n *\n * - Custom at-rules (`@honey-media`, `@honey-stack`, etc.)\n * - Nested selectors (`&:hover`, `& > .child`)\n * - CSS variables (`--color: red`)\n * - JavaScript-style single-line comments (`// comment`)\n * - Multiline block comments (`/* comment *\\/`)\n * - Nested parentheses groups (`calc(...)`, `var(...)`)\n * - Escaped characters inside strings\n *\n * The tokenizer:\n *\n * - Skips all whitespace\n * - Skips both block (`/* *\\/`) and single-line (`//`) comments\n * - Preserves balanced parentheses as a single `params` token\n * - Preserves quoted strings as `string` tokens (without quotes)\n * - Emits structural tokens (`braceOpen`, `braceClose`, `colon`, `semicolon`, `at`)\n * - Emits all other text as trimmed `text` tokens\n *\n * Safety guarantees:\n *\n * - Unterminated comments do not crash tokenization\n * - Unterminated strings do not throw\n * - Infinite loops are prevented by fallback index advancement\n *\n * The returned token stream is order-preserving and does not perform\n * semantic validation. Structural correctness is handled by the parser stage.\n *\n * @param input - Raw CSS string to tokenize.\n *\n * @returns Ordered array of {@link HoneyCssToken} objects.\n */\nexport const tokenizeCss = (input: string): HoneyCssToken[] => {\n const tokens: HoneyCssToken[] = [];\n\n let index = 0;\n\n const isEof = (): boolean => index >= input.length;\n\n /**\n * Returns the current character without consuming it.\n */\n const peek = (): string | undefined => (isEof() ? undefined : input[index]);\n\n /**\n * Returns the next character without consuming it.\n */\n const peekNext = (): string | undefined =>\n index + 1 >= input.length ? undefined : input[index + 1];\n\n /**\n * Advances the cursor past any whitespace characters.\n */\n const skipWhitespace = () => {\n while (true) {\n const ch = peek();\n\n if (!ch || !/\\s/.test(ch)) {\n return;\n }\n\n index++;\n }\n };\n\n /**\n * Skips JavaScript-style single-line comments of the form:\n *\n * ```css\n * // comment text\n * ```\n *\n * This syntax is not part of standard CSS,\n * but is commonly used in CSS-in-JS template literals.\n *\n * The comment is skipped until a newline character (`\\n`)\n * or the end of input is reached.\n *\n * If the comment is unterminated (EOF without newline),\n * tokenization safely stops at the end of the input.\n *\n * @returns `true` if a single-line comment was detected and skipped,\n * otherwise `false`.\n */\n const skipSingleLineComment = (): boolean => {\n if (peek() !== '/' || peekNext() !== '/') {\n return false;\n }\n\n index += 2; // skip \"//\"\n\n while (!isEof()) {\n const ch = peek();\n\n if (ch === '\\n') {\n index++; // consume newline\n break;\n }\n\n index++;\n }\n\n return true;\n };\n\n /**\n * Skips CSS block comments of the form:\n *\n * ```css\n * /* comment *\\/\n * ```\n *\n * If the comment is unterminated, tokenization stops safely.\n *\n * @returns `true` if a comment was skipped.\n */\n const skipMultiLineComment = (): boolean => {\n if (peek() !== '/' || peekNext() !== '*') {\n return false;\n }\n\n index += 2; // skip \"/*\"\n\n while (!isEof()) {\n if (peek() === '*' && peekNext() === '/') {\n index += 2; // skip \"*/\"\n\n return true;\n }\n\n index++;\n }\n\n return true;\n };\n\n /**\n * Reads a quoted string token.\n *\n * Supports:\n * - Double quotes: `\"text\"`\n * - Single quotes: `'text'`\n * - Escaped characters: `\"a\\\\\\\"b\"`\n *\n * @returns The unwrapped string contents.\n */\n const readString = (): string => {\n const quote = peek();\n if (!quote) {\n return '';\n }\n\n index++; // skip opening quote\n let result = '';\n\n while (!isEof()) {\n const ch = peek();\n if (!ch) {\n break;\n }\n\n // Handle escape sequences\n if (ch === '\\\\') {\n result += ch;\n index++;\n\n const escaped = peek();\n if (escaped) {\n result += escaped;\n index++;\n }\n\n continue;\n }\n\n // Closing quote\n if (ch === quote) {\n index++;\n break;\n }\n\n result += ch;\n index++;\n }\n\n return result;\n };\n\n /**\n * Reads a balanced parentheses group.\n *\n * Examples:\n * - `(sm:down)`\n * - `(min-width: calc(100% - 1px))`\n *\n * Nested parentheses are supported.\n *\n * @returns The full params string including parentheses.\n */\n const readParamsGroup = (): string => {\n let depth = 0;\n let result = '';\n\n while (!isEof()) {\n const ch = peek();\n if (!ch) {\n break;\n }\n\n if (ch === '(') {\n depth++;\n }\n\n if (ch === ')') {\n depth--;\n }\n\n result += ch;\n index++;\n\n if (depth === 0) {\n break;\n }\n }\n\n return result;\n };\n\n /**\n * Reads a contiguous plain-text segment until a structural boundary\n * character is encountered.\n *\n * This function is responsible for collecting free-form CSS text such as:\n *\n * - Selectors (`.btn`, `&:hover`, `.parent > .child`)\n * - Property names (`color`, `border-bottom-width`)\n * - Values (`red`, `12px`, `100%`, `red!important`)\n *\n * Reading stops when a boundary character is reached.\n * Boundary characters represent structural syntax in CSS and include:\n *\n * - Block delimiters: `{` `}`\n * - Declaration delimiters: `:` `;`\n * - At-rule marker: `@`\n * - Parentheses start: `(`\n * - String delimiters: `'` `\"`\n * - Comment initiator: `/`\n *\n * The boundary character itself is NOT consumed here —\n * it is handled separately by the main tokenizer loop.\n *\n * The returned value is trimmed to remove leading/trailing whitespace,\n * ensuring clean token values without altering internal spacing.\n *\n * Safety:\n * - Stops at EOF safely\n * - Never throws\n * - Prevents infinite loops via boundary checks\n *\n * @returns Trimmed text segment, or an empty string if no text was read.\n */\n const readText = (): string => {\n let result = '';\n\n while (!isEof()) {\n const ch = peek();\n if (!ch) {\n break;\n }\n\n if (isBoundaryChar(ch)) {\n break;\n }\n\n result += ch;\n index++;\n }\n\n return result.trim();\n };\n\n // ============================\n // Main Token Loop\n // ============================\n while (!isEof()) {\n skipWhitespace();\n\n if (isEof()) {\n break;\n }\n\n if (skipSingleLineComment() || skipMultiLineComment()) {\n continue;\n }\n\n const ch = peek();\n if (!ch) {\n break;\n }\n\n if (ch === '{') {\n tokens.push({\n type: 'braceOpen',\n });\n\n index++;\n continue;\n }\n\n if (ch === '}') {\n tokens.push({\n type: 'braceClose',\n });\n\n index++;\n continue;\n }\n\n if (ch === ':') {\n tokens.push({\n type: 'colon',\n });\n\n index++;\n continue;\n }\n\n if (ch === ';') {\n tokens.push({\n type: 'semicolon',\n });\n\n index++;\n continue;\n }\n\n if (ch === '@') {\n tokens.push({\n type: 'at',\n });\n\n index++;\n continue;\n }\n\n // Params group\n if (ch === '(') {\n tokens.push({\n type: 'params',\n value: readParamsGroup(),\n });\n\n continue;\n }\n\n // Strings\n if (ch === '\"' || ch === \"'\") {\n tokens.push({\n type: 'string',\n value: readString(),\n });\n\n continue;\n }\n\n // Text chunk\n const value = readText();\n if (value) {\n tokens.push({\n type: 'text',\n value,\n });\n } else {\n // Safety fallback to prevent infinite loops\n index++;\n }\n }\n\n return tokens;\n};\n","/**\n * All supported token types produced by the Honey CSS tokenizer.\n *\n * These tokens represent the minimal syntax units needed for parsing:\n * - Structural braces (`{` / `}`)\n * - Punctuation (`:` / `;`)\n * - At-rules (`@`)\n * - Parenthesized groups (`(...)`)\n * - Strings (`\"...\"`, `'...'`)\n * - Plain text chunks (selectors, property names, values)\n */\nexport type HoneyCssTokenType =\n | 'braceOpen'\n | 'braceClose'\n | 'colon'\n | 'semicolon'\n | 'at'\n | 'params'\n | 'string'\n | 'text';\n\n/**\n * A single token produced by {@link tokenizeCss}.\n *\n * Some token types (like `text`, `params`, `string`) include a `value`,\n * while punctuation tokens do not.\n */\nexport interface HoneyCssToken {\n type: HoneyCssTokenType;\n value?: string;\n}\n","const e=e=>new Blob([e],{type:e.type}),t=e=>new DOMRect(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight),n=e=>\"A\"===e.tagName,r=e=>\"true\"===e.getAttribute(\"contenteditable\"),a=[\"INPUT\",\"SELECT\",\"TEXTAREA\",\"BUTTON\",\"A\"],l=e=>{if(!e)return!1;const t=window.getComputedStyle(e);if(\"hidden\"===t.visibility||\"none\"===t.display)return!1;if(\"disabled\"in e&&e.disabled)return!1;const l=e.getAttribute(\"tabindex\");return\"-1\"!==l&&(a.includes(e.tagName)?!n(e)||\"\"!==e.href:!!r(e)||null!==l)},i=e=>Array.from(e.querySelectorAll(\"*\")).filter(l),o=(e,t=null,{wrap:n=!0,getNextIndex:r}={})=>{const a=document.activeElement,l=t??a?.parentElement;if(!a||!l)return;const o=i(l);if(0===o.length)return;const s=o.indexOf(a);if(-1===s)return;let c;r?c=r(s,e,o):\"next\"===e?(c=s+1,c>=o.length&&(c=n?0:null)):(c=s-1,c<0&&(c=n?o.length-1:null)),null!==c&&o[c]?.focus()};function s(e,t){if(!e)throw new Error(t)}const c=e=>null===e,u=e=>null==e,h=e=>null!=e,f=e=>void 0===e,d=e=>\"number\"==typeof e,m=e=>\"boolean\"==typeof e,p=e=>\"object\"==typeof e,g=e=>p(e)&&!c(e)&&0===Object.keys(e).length,y=e=>e instanceof Date,w=e=>e instanceof Blob,b=e=>e instanceof Error,x=e=>y(e)&&!isNaN(e.getTime()),M=e=>e instanceof RegExp,S=e=>e instanceof Map,A=e=>e instanceof Set,v=e=>\"symbol\"==typeof e,C=e=>d(e)&&isFinite(e),I=e=>d(e)&&Number.isInteger(e),k=e=>C(e)&&!Number.isInteger(e),E=e=>Array.isArray(e),L=e=>E(e)&&0===e.length,P=e=>e.filter(Boolean),O=e=>[...new Set(e)],T=(e,t)=>(s(t>0,\"Chunk size must be greater than 0\"),Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t))),X=(...e)=>{if(0===e.length)return[];if(1===e.length)return[...e[0]];const[t,...n]=e;return O(t).filter(e=>n.every(t=>t.includes(e)))},_=(e,t)=>e.filter(e=>!t.includes(e)),z=(...e)=>t=>e.reduce((e,t)=>t(e),t),Y=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),R=()=>{},N=e=>\"function\"==typeof e,$=e=>(...t)=>!e(...t),F=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},j=e=>N(e?.then),U=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(await t(e[r],r,e));return n},W=async(e,t)=>Promise.all(e.map(t)),H=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const a=e[r];await t(a,r,e)&&n.push(a)}return n},B=async(e,t)=>{const n=await W(e,async(e,n,r)=>!!await t(e,n,r)&&e);return P(n)},D=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return!0;return!1},V=async(e,t)=>{for(let n=0;n<e.length;n++)if(!await t(e[n],n,e))return!1;return!0},Z=async(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++)r=await t(r,e[n],n,e);return r},G=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return e[n];return null},q=e=>new Promise(t=>setTimeout(t,e)),J=async(e,t,n=\"Operation timed out\")=>{try{return await Promise.race([e,q(t).then(()=>Promise.reject(new Error(n)))])}finally{}},K=(e,{maxAttempts:t=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...l)=>{let i;for(let o=1;o<=t;o++)try{return await e(...l)}catch(e){if(i=e,o<t){a?.(o,e);const t=r?n*2**(o-1):n;await q(t)}}throw i},Q=e=>\"string\"==typeof e,ee=(e,{fileName:t,target:n}={})=>{if(f(document))return;const r=document.createElement(\"a\");let a=null;try{const l=Q(e)?e:a=URL.createObjectURL(e);r.href=l,t&&(r.download=t),n&&(r.target=n),document.body.appendChild(r),r.click()}finally{r.remove(),a&&setTimeout(()=>{s(a,\"Object URL should not be null\"),URL.revokeObjectURL(a)},0)}},te=e=>e.scrollWidth>e.clientWidth,ne=e=>Math.max(0,e.scrollWidth-e.clientWidth),re=e=>e.scrollHeight>e.clientHeight,ae=e=>Math.max(0,e.scrollHeight-e.clientHeight),le=({overflowSize:e,containerSize:t,elementOffset:n,elementSize:r})=>{if(e<=0)return 0;const a=n+r/2-t/2;return-Math.max(0,Math.min(a,e))},ie=(e,t,{axis:n=\"both\"}={})=>{let r=0,a=0;\"x\"!==n&&\"both\"!==n||(r=le({overflowSize:ne(e),containerSize:e.clientWidth,elementOffset:t.offsetLeft,elementSize:t.clientWidth})),\"y\"!==n&&\"both\"!==n||(a=le({overflowSize:ae(e),containerSize:e.clientHeight,elementOffset:t.offsetTop,elementSize:t.clientHeight})),e.style.transform=`translate(${r}px, ${a}px)`},oe=e=>{const t=window.getComputedStyle(e).getPropertyValue(\"transform\").match(/^matrix\\((.+)\\)$/);if(!t)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,l,i,o]=t[1].split(\", \").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:l,skewX:a,skewY:r}},se=()=>{if(\"undefined\"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem(\"__non_existing_key__\"),!0}catch{return!1}},ce=()=>{if(!se())return{readable:!1,writable:!1};try{const e=\"__test_write__\";return window.localStorage.setItem(e,\"1\"),window.localStorage.removeItem(e),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}},ue=e=>e instanceof File,he=e=>{if(!e)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},fe=(e,t)=>new File([e],t,{type:e.type}),de=async(e,{skipFiles:t=[\".DS_Store\",\"Thumbs.db\",\"desktop.ini\",\"ehthumbs.db\",\".Spotlight-V100\",\".Trashes\",\".fseventsd\",\"__MACOSX\"]}={})=>{const n=new Set(t),r=await(async e=>{const t=e.createReader(),n=async()=>new Promise((e,r)=>{t.readEntries(async t=>{if(t.length)try{const r=await n();e([...t,...r])}catch(e){r(e)}else e([])},r)});return n()})(e);return(await W(r,async e=>e.isDirectory?de(e,{skipFiles:t}):n.has(e.name)?[]:[await new Promise((t,n)=>{e.file(t,n)})])).flat()},me=async(e,t={})=>{const n=e?.items;if(!n)return[];const r=[];for(let e=0;e<n.length;e++){const a=n[e];if(\"webkitGetAsEntry\"in a){const e=a.webkitGetAsEntry?.();if(e?.isDirectory){r.push(de(e,t));continue}if(e?.isFile){r.push(new Promise((t,n)=>e.file(e=>t([e]),n)));continue}}const l=a.getAsFile();l&&r.push(Promise.resolve([l]))}return(await Promise.all(r)).flat()},pe=(e,...t)=>\"function\"==typeof e?e(...t):e,ge=({delta:e,value:t,min:n,max:r})=>{if(0===e)return null;const a=t+e;return e<0?t<=n?null:Math.max(a,n):e>0?t>=r?null:Math.min(a,r):null},ye=({value:e,min:t,max:n,velocityPxMs:r,deltaTimeMs:a,friction:l=.002,minVelocityPxMs:i=.01,emaAlpha:o=.2})=>{if(Math.abs(r)<i)return null;const s=ge({delta:r*a,value:e,min:t,max:n});if(null===s)return null;const c=r*Math.exp(-l*a),u=o>0?r*(1-o)+c*o:c;return Math.abs(u)<i?null:{value:s,velocityPxMs:u}},we=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,be=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height),xe=(e,t,{allowFallback:n=!0,invert:r=!0}={})=>{const a=r?-1:1;switch(t){case\"x\":return{deltaX:a*(0!==e.deltaX?e.deltaX:n?e.deltaY:0),deltaY:0};case\"y\":return{deltaX:0,deltaY:a*e.deltaY};default:return{deltaX:a*e.deltaX,deltaY:a*e.deltaY}}},Me=(e,t,n,r)=>{const a=n-e,l=r-t;return Math.hypot(a,l)},Se=(e,t)=>Math.abs(e/t),Ae=(e,t)=>e*t/100,ve=e=>{let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)},Ce=e=>Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}),Ie=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1-$2\").toLowerCase(),ke=e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)},Ee=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\"),Le=e=>0===e.length?[]:e.split(\" \").filter(Boolean),Pe=e=>\"\"===e||u(e),Oe=e=>{const t=e.lastIndexOf(\".\");return t<=0||t===e.length-1?[e,\"\"]:[e.slice(0,t),e.slice(t+1).toLowerCase()]},Te=(e,t)=>{if(0===e.length)return[];const n=t.charCodeAt(0),r=[];for(let t=0;t<e.length;t++)e.charCodeAt(t)===n&&r.push(t);return r},Xe=(e,t,n)=>{if(0===e.length)return;const r=e.length;for(let a=0;a<r;a++){const l=e[a],i={charIndex:a,prevChar:a>0?e[a-1]:null,nextChar:a<r-1?e[a+1]:null};n?.(l,i)||t(l,i)}},_e=(e,t=1/0)=>0===e.length?\"\":Le(e).slice(0,t).map(e=>e[0]).join(\"\").toUpperCase(),ze=(e,t,n,r=[],a=void 0,l=0)=>(e?.forEach(e=>{const{[n]:i,...o}=e,s=e[n],c=Array.isArray(s);if(r.push({...o,parentId:a,depthLevel:l,childCount:c?s.length:0}),c){const a=e[t];ze(s,t,n,r,a,l+1)}}),r),Ye=(e,t,n)=>e.filter(e=>e.parentId===t&&(!n||n(e))),Re=(e,t,n,r)=>{const a=Le(r.toLowerCase());if(!a.length)return e;const l=e.reduce((e,n,r)=>(e[n[t]]=r,e),{});return e.reduce((r,i)=>{const o=i[n];if(!o)return r;if(r.some(e=>e[t]===i[t]))return r;const u=Le(o.toLowerCase());if(a.every(e=>u.some(t=>t.startsWith(e))))if(f(i.parentId)){r.push(i);const n=a=>{a.childCount&&e.forEach(e=>{e.parentId===a[t]&&(r.push(e),n(e))})};n(i)}else{const t=n=>{const a=l[n.parentId],i=e[a];f(i.parentId)||t(i);const o=r.length?r[r.length-1].parentId:null;(c(o)||o!==n.parentId)&&(s(i,\"[@react-hive/honey-utils]: Parent node was not found.\"),r.push(i))};t(i),r.push(i)}return r},[])};export{a as FOCUSABLE_HTML_TAGS,ye as applyInertiaStep,s as assert,fe as blobToFile,le as calculateCenterOffset,Me as calculateEuclideanDistance,Se as calculateMovingSpeed,Ae as calculatePercentage,ke as camelToDashCase,Ee as camelToWords,ie as centerElementInContainer,T as chunk,e as cloneBlob,P as compact,Y as compose,Ce as definedProps,q as delay,_ as difference,ee as downloadFile,V as everyAsync,he as fileListToFiles,B as filterParallel,H as filterSequential,G as findAsync,Te as findCharIndices,ze as flattenTree,Xe as forEachChar,we as generateEphemeralId,be as getDOMRectIntersectionRatio,t as getElementOffsetRect,i as getFocusableHtmlElements,ce as getLocalStorageCapabilities,Ye as getTreeChildren,_e as getWordsInitials,ne as getXOverflowWidth,ae as getYOverflowHeight,te as hasXOverflow,re as hasYOverflow,ve as hashString,X as intersection,pe as invokeIfFunction,n as isAnchorHtmlElement,E as isArray,w as isBlob,m as isBool,r as isContentEditableHtmlElement,y as isDate,k as isDecimal,h as isDefined,L as isEmptyArray,g as isEmptyObject,b as isError,ue as isFile,C as isFiniteNumber,N as isFunction,l as isHtmlElementFocusable,I as isInteger,se as isLocalStorageReadable,S as isMap,u as isNil,Pe as isNilOrEmptyString,c as isNull,d as isNumber,p as isObject,j as isPromise,M as isRegExp,A as isSet,Q as isString,v as isSymbol,f as isUndefined,x as isValidDate,o as moveFocusWithinContainer,R as noop,$ as not,F as once,oe as parse2DMatrix,Oe as parseFileName,z as pipe,me as readFilesFromDataTransfer,Z as reduceAsync,xe as resolveAxisDelta,ge as resolveBoundedDelta,K as retry,W as runParallel,U as runSequential,Re as searchTree,D as someAsync,Le as splitStringIntoWords,J as timeout,Ie as toKebabCase,de as traverseFileSystemDirectory,O as unique};\n//# sourceMappingURL=index.mjs.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './types';\nexport * from './tokenize-css';\nexport * from './create-css-token-cursor';\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"index.dev.cjs","mappings":";;;;;;;;;;;;;;;AAAiD;AA2HjD;;;;;;;;;GASG;AACI,MAAM,oBAAoB,GAAG,CAAC,MAAuB,EAAoB,EAAE;IAChF,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,MAAM,KAAK,GAAG,GAAY,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;IAEpD,MAAM,IAAI,GAAG,GAA8B,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,GAA8B,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAEtF,MAAM,IAAI,GAAG,GAAW,EAAE,CAAC,KAAK,CAAC;IAEjC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAQ,EAAE;QACnC,KAAK,GAAG,IAAI,CAAC;IACf,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,CAA8B,IAAO,EAAuC,EAAE;QAC3F,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;QAErB,+DAAM,CAAC,KAAK,EAAE,sCAAsC,IAAI,6BAA6B,CAAC,CAAC;QACvF,+DAAM,CACJ,KAAK,CAAC,IAAI,KAAK,IAAI,EACnB,sCAAsC,IAAI,cAAc,KAAK,CAAC,IAAI,IAAI,CACvE,CAAC;QAEF,OAAO,KAA4C,CAAC;IACtD,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,SAA8B,EAAU,EAAE;QAC3D,IAAI,MAAM,GAAG,EAA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AAgB,SAAS,cAAc,gDAAgD,UAAU,sBAAsB,gCAAgC,oCAAoC,kDAAkD,4BAA4B,IAAI,qBAAqB,YAAY,oEAAoE,MAAM,qGAAqG,IAAI,6BAA6B,YAAY,8BAA8B,EAAE,wBAAwB,6CAA6C,2BAA2B,wBAAwB,WAAW,+CAA+C,EAAE,uCAAuC,oKAAoK,+BAA+B,GAAG,IAAI,eAAe,UAAU,eAAe,wDAAwD,eAAe,4BAA4B,eAAe,sCAAsC,gBAAgB,kBAAkB,uBAAuB,kDAAkD,WAAW,YAAY,WAAW,2BAA2B,2BAA2B,sEAAsE,qEAAqE,iCAAiC,iDAAiD,gBAAgB,GAAG,4HAA4H,2BAA2B,6EAA6E,YAAY,yBAAyB,6BAA6B,YAAY,WAAW,mCAAmC,SAAS,cAAc,uBAAuB,iBAAiB,YAAY,IAAI,KAAK,gBAAgB,iEAAiE,kBAAkB,kIAAkI,MAAM,WAAW,6BAA6B,WAAW,qDAAqD,KAAK,aAAa,mBAAmB,wEAAwE,4BAA4B,sBAAsB,0CAA0C,EAAE,wBAAwB,aAAa,eAAe,mCAAmC,4BAA4B,4DAA4D,UAAU,YAAY,4BAA4B,oCAAoC,GAAG,KAAK,KAAK,YAAY,6BAA6B,oBAAoB,6CAA6C,kGAAkG,eAAe,SAAS,MAA+uD;AACtlU,kC;;;;;;UCDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;;;;;;;;;;;ACNwB;AACO;AACW","sources":["webpack://@react-hive/honey-css/./src/create-css-token-cursor.ts","webpack://@react-hive/honey-css/./src/tokenize-css.ts","webpack://@react-hive/honey-css/./src/types.ts","webpack://@react-hive/honey-css/./node_modules/.pnpm/@react-hive+honey-utils@3.23.0/node_modules/@react-hive/honey-utils/dist/index.mjs","webpack://@react-hive/honey-css/webpack/bootstrap","webpack://@react-hive/honey-css/webpack/runtime/define property getters","webpack://@react-hive/honey-css/webpack/runtime/hasOwnProperty shorthand","webpack://@react-hive/honey-css/webpack/runtime/make namespace object","webpack://@react-hive/honey-css/./src/index.ts"],"sourcesContent":["import { assert } from '@react-hive/honey-utils';\n\nimport type { HoneyCssToken, HoneyCssTokenType } from './types';\n\n/**\n * A lightweight cursor abstraction over a token stream.\n *\n * This is the core navigation primitive used by the Honey CSS parser.\n * It provides safe sequential reading, lookahead, backtracking,\n * and small helper utilities for collecting selector/value text.\n */\nexport interface HoneyTokenCursor {\n /**\n * Returns `true` when the cursor has consumed all tokens.\n */\n isEof: () => boolean;\n /**\n * Returns the current token without consuming it.\n *\n * This is primarily used for lookahead decisions in the parser:\n *\n * ```ts\n * if (cursor.peek()?.type === 'braceOpen') {\n * // parse rule block\n * }\n * ```\n */\n peek: () => HoneyCssToken | undefined;\n /**\n * Consumes and returns the current token, advancing the cursor forward.\n *\n * Returns `undefined` if the cursor is already at EOF.\n *\n * ```ts\n * const token = cursor.next();\n * ```\n */\n next: () => HoneyCssToken | undefined;\n /**\n * Creates a checkpoint of the current cursor position.\n *\n * Useful for speculative parsing or backtracking:\n *\n * ```ts\n * const mark = cursor.mark();\n *\n * if (!tryParseSomething(cursor)) {\n * cursor.reset(mark);\n * }\n * ```\n */\n mark: () => number;\n /**\n * Restores the cursor back to a previously created mark.\n *\n * @param mark - Index returned from {@link mark}.\n */\n reset: (mark: number) => void;\n /**\n * Consumes the next token and asserts that it matches the expected type.\n *\n * This is the parser's main safety mechanism and helps produce\n * clear error messages during invalid input.\n *\n * Throws if:\n * - the token stream ends unexpectedly\n * - the next token has a different type\n *\n * ```ts\n * cursor.expect('braceOpen'); // must be \"{\"\n * ```\n *\n * @param type - Expected token type.\n *\n * @returns The consumed token, narrowed to the expected type.\n */\n expect: <T extends HoneyCssTokenType>(type: T) => Extract<HoneyCssToken, { type: T }>;\n /**\n * Reads and concatenates consecutive token values until one of the stop token\n * types is encountered.\n *\n * This helper is used to collect:\n * - selectors (`.btn:hover`)\n * - declaration values (`calc(100% - 1px)`)\n * - at-rule names (`media`)\n *\n * Stops **before consuming** the stop token.\n *\n * Supported token types:\n * - `text` → appended as-is\n * - `string` → wrapped in quotes\n * - `params` → appended verbatim including parentheses\n *\n * Example:\n *\n * Tokens:\n * ```\n * text(\"var\")\n * params(\"(--color)\")\n * ```\n *\n * Result:\n * ```\n * \"var(--color)\"\n * ```\n *\n * @param stopTypes - Token types that terminate reading.\n *\n * @returns Combined string value.\n */\n readUntil: (stopTypes: HoneyCssTokenType[]) => string;\n /**\n * Advances the cursor until one of the stop token types is reached.\n *\n * This is useful for error recovery and safely skipping unknown syntax.\n *\n * Stops before consuming the stop token.\n *\n * @param stopTypes - Token types that terminate skipping.\n */\n skipUntil: (stopTypes: HoneyCssTokenType[]) => void;\n}\n\n/**\n * Creates a cursor wrapper around a list of CSS tokens.\n *\n * The cursor provides a small API surface for building\n * recursive-descent parsers without needing complex parser generators.\n *\n * @param tokens - Token list produced by the Honey tokenizer.\n *\n * @returns A reusable cursor instance.\n */\nexport const createCssTokenCursor = (tokens: HoneyCssToken[]): HoneyTokenCursor => {\n let index = 0;\n\n const isEof = (): boolean => index >= tokens.length;\n\n const peek = (): HoneyCssToken | undefined => (isEof() ? undefined : tokens[index]);\n\n const next = (): HoneyCssToken | undefined => (isEof() ? undefined : tokens[index++]);\n\n const mark = (): number => index;\n\n const reset = (mark: number): void => {\n index = mark;\n };\n\n const expect = <T extends HoneyCssTokenType>(type: T): Extract<HoneyCssToken, { type: T }> => {\n const token = next();\n\n assert(token, `[@react-hive/honey-css]: Expected \"${type}\" but reached end of input.`);\n assert(\n token.type === type,\n `[@react-hive/honey-css]: Expected \"${type}\" but got \"${token.type}\".`,\n );\n\n return token as Extract<HoneyCssToken, { type: T }>;\n };\n\n const readUntil = (stopTypes: HoneyCssTokenType[]): string => {\n let result = '';\n\n while (!isEof()) {\n const token = peek();\n\n if (!token || stopTypes.includes(token.type)) {\n break;\n }\n\n if (token.type === 'text') {\n if (result) {\n result += ' ';\n }\n\n result += token.value;\n //\n } else if (token.type === 'string') {\n result += `\"${token.value}\"`;\n //\n } else if (token.type === 'params') {\n result += token.value;\n }\n\n next();\n }\n\n return result.trim();\n };\n\n const skipUntil = (stopTypes: HoneyCssTokenType[]): void => {\n while (!isEof()) {\n const token = peek();\n\n if (!token || stopTypes.includes(token.type)) {\n break;\n }\n\n next();\n }\n };\n\n return {\n isEof,\n peek,\n next,\n mark,\n reset,\n expect,\n readUntil,\n skipUntil,\n };\n};\n","import type { HoneyCssToken } from './types';\n\n/**\n * Determines whether a character should terminate a plain text read.\n *\n * These characters represent structural boundaries in CSS:\n * - Blocks: `{` `}`\n * - Declarations: `:` `;`\n * - At-rules: `@`\n * - Params: `(`\n * - Strings: `'` `\"`\n * - Comments: `/`\n */\nconst isBoundaryChar = (ch: string): boolean =>\n ch === '{' ||\n ch === '}' ||\n ch === ':' ||\n ch === ';' ||\n ch === '@' ||\n ch === '(' ||\n ch === '\"' ||\n ch === \"'\" ||\n ch === '/';\n\n/**\n * Tokenizes a CSS-like input string into a sequence of Honey CSS tokens.\n *\n * This function is the first stage of the Honey CSS compilation pipeline.\n * It performs a single-pass lexical scan and produces a flat stream of tokens\n * that can later be consumed by the recursive-descent parser.\n *\n * Unlike a strict CSS tokenizer, this implementation is intentional:\n *\n * - Lightweight (no external dependencies)\n * - Tolerant (fails safely on malformed input)\n * - Extended for CSS-in-JS use cases\n *\n * In addition to standard CSS constructs, it supports:\n *\n * - Custom at-rules (`@honey-media`, `@honey-stack`, etc.)\n * - Nested selectors (`&:hover`, `& > .child`)\n * - CSS variables (`--color: red`)\n * - JavaScript-style single-line comments (`// comment`)\n * - Multiline block comments (`/* comment *\\/`)\n * - Nested parentheses groups (`calc(...)`, `var(...)`)\n * - Escaped characters inside strings\n *\n * The tokenizer:\n *\n * - Skips all whitespace\n * - Skips both block (`/* *\\/`) and single-line (`//`) comments\n * - Preserves balanced parentheses as a single `params` token\n * - Preserves quoted strings as `string` tokens (without quotes)\n * - Emits structural tokens (`braceOpen`, `braceClose`, `colon`, `semicolon`, `at`)\n * - Emits all other text as trimmed `text` tokens\n *\n * Safety guarantees:\n *\n * - Unterminated comments do not crash tokenization\n * - Unterminated strings do not throw\n * - Infinite loops are prevented by fallback index advancement\n *\n * The returned token stream is order-preserving and does not perform\n * semantic validation. Structural correctness is handled by the parser stage.\n *\n * @param input - Raw CSS string to tokenize.\n *\n * @returns Ordered array of {@link HoneyCssToken} objects.\n */\nexport const tokenizeCss = (input: string): HoneyCssToken[] => {\n const tokens: HoneyCssToken[] = [];\n\n let index = 0;\n\n const isEof = (): boolean => index >= input.length;\n\n /**\n * Returns the current character without consuming it.\n */\n const peek = (): string | undefined => (isEof() ? undefined : input[index]);\n\n /**\n * Returns the next character without consuming it.\n */\n const peekNext = (): string | undefined =>\n index + 1 >= input.length ? undefined : input[index + 1];\n\n /**\n * Advances the cursor past any whitespace characters.\n */\n const skipWhitespace = () => {\n while (true) {\n const ch = peek();\n\n if (!ch || !/\\s/.test(ch)) {\n return;\n }\n\n index++;\n }\n };\n\n /**\n * Skips JavaScript-style single-line comments of the form:\n *\n * ```css\n * // comment text\n * ```\n *\n * This syntax is not part of standard CSS,\n * but is commonly used in CSS-in-JS template literals.\n *\n * The comment is skipped until a newline character (`\\n`)\n * or the end of input is reached.\n *\n * If the comment is unterminated (EOF without newline),\n * tokenization safely stops at the end of the input.\n *\n * @returns `true` if a single-line comment was detected and skipped,\n * otherwise `false`.\n */\n const skipSingleLineComment = (): boolean => {\n if (peek() !== '/' || peekNext() !== '/') {\n return false;\n }\n\n index += 2; // skip \"//\"\n\n while (!isEof()) {\n const ch = peek();\n\n if (ch === '\\n') {\n index++; // consume newline\n break;\n }\n\n index++;\n }\n\n return true;\n };\n\n /**\n * Skips CSS block comments of the form:\n *\n * ```css\n * /* comment *\\/\n * ```\n *\n * If the comment is unterminated, tokenization stops safely.\n *\n * @returns `true` if a comment was skipped.\n */\n const skipMultiLineComment = (): boolean => {\n if (peek() !== '/' || peekNext() !== '*') {\n return false;\n }\n\n index += 2; // skip \"/*\"\n\n while (!isEof()) {\n if (peek() === '*' && peekNext() === '/') {\n index += 2; // skip \"*/\"\n\n return true;\n }\n\n index++;\n }\n\n return true;\n };\n\n /**\n * Reads a quoted string token.\n *\n * Supports:\n * - Double quotes: `\"text\"`\n * - Single quotes: `'text'`\n * - Escaped characters: `\"a\\\\\\\"b\"`\n *\n * @returns The unwrapped string contents.\n */\n const readString = (): string => {\n const quote = peek();\n if (!quote) {\n return '';\n }\n\n index++; // skip opening quote\n let result = '';\n\n while (!isEof()) {\n const ch = peek();\n if (!ch) {\n break;\n }\n\n // Handle escape sequences\n if (ch === '\\\\') {\n result += ch;\n index++;\n\n const escaped = peek();\n if (escaped) {\n result += escaped;\n index++;\n }\n\n continue;\n }\n\n // Closing quote\n if (ch === quote) {\n index++;\n break;\n }\n\n result += ch;\n index++;\n }\n\n return result;\n };\n\n /**\n * Reads a balanced parentheses group.\n *\n * Examples:\n * - `(sm:down)`\n * - `(min-width: calc(100% - 1px))`\n *\n * Nested parentheses are supported.\n *\n * @returns The full params string including parentheses.\n */\n const readParamsGroup = (): string => {\n let depth = 0;\n let result = '';\n\n while (!isEof()) {\n const ch = peek();\n if (!ch) {\n break;\n }\n\n if (ch === '(') {\n depth++;\n }\n\n if (ch === ')') {\n depth--;\n }\n\n result += ch;\n index++;\n\n if (depth === 0) {\n break;\n }\n }\n\n return result;\n };\n\n /**\n * Reads a contiguous plain-text segment until a structural boundary\n * character is encountered.\n *\n * This function is responsible for collecting free-form CSS text such as:\n *\n * - Selectors (`.btn`, `&:hover`, `.parent > .child`)\n * - Property names (`color`, `border-bottom-width`)\n * - Values (`red`, `12px`, `100%`, `red!important`)\n *\n * Reading stops when a boundary character is reached.\n * Boundary characters represent structural syntax in CSS and include:\n *\n * - Block delimiters: `{` `}`\n * - Declaration delimiters: `:` `;`\n * - At-rule marker: `@`\n * - Parentheses start: `(`\n * - String delimiters: `'` `\"`\n * - Comment initiator: `/`\n *\n * The boundary character itself is NOT consumed here —\n * it is handled separately by the main tokenizer loop.\n *\n * The returned value is trimmed to remove leading/trailing whitespace,\n * ensuring clean token values without altering internal spacing.\n *\n * Safety:\n * - Stops at EOF safely\n * - Never throws\n * - Prevents infinite loops via boundary checks\n *\n * @returns Trimmed text segment, or an empty string if no text was read.\n */\n const readText = (): string => {\n let result = '';\n\n while (!isEof()) {\n const ch = peek();\n if (!ch) {\n break;\n }\n\n if (isBoundaryChar(ch)) {\n break;\n }\n\n result += ch;\n index++;\n }\n\n return result.trim();\n };\n\n // ============================\n // Main Token Loop\n // ============================\n while (!isEof()) {\n skipWhitespace();\n\n if (isEof()) {\n break;\n }\n\n if (skipSingleLineComment() || skipMultiLineComment()) {\n continue;\n }\n\n const ch = peek();\n if (!ch) {\n break;\n }\n\n if (ch === '{') {\n tokens.push({\n type: 'braceOpen',\n });\n\n index++;\n continue;\n }\n\n if (ch === '}') {\n tokens.push({\n type: 'braceClose',\n });\n\n index++;\n continue;\n }\n\n if (ch === ':') {\n tokens.push({\n type: 'colon',\n });\n\n index++;\n continue;\n }\n\n if (ch === ';') {\n tokens.push({\n type: 'semicolon',\n });\n\n index++;\n continue;\n }\n\n if (ch === '@') {\n tokens.push({\n type: 'at',\n });\n\n index++;\n continue;\n }\n\n // Params group\n if (ch === '(') {\n tokens.push({\n type: 'params',\n value: readParamsGroup(),\n });\n\n continue;\n }\n\n // Strings\n if (ch === '\"' || ch === \"'\") {\n tokens.push({\n type: 'string',\n value: readString(),\n });\n\n continue;\n }\n\n // Text chunk\n const value = readText();\n if (value) {\n tokens.push({\n type: 'text',\n value,\n });\n } else {\n // Safety fallback to prevent infinite loops\n index++;\n }\n }\n\n return tokens;\n};\n","/**\n * A single lexical token produced by the Honey CSS tokenizer.\n *\n * This discriminated union represents the minimal syntax units\n * required by the Honey CSS parser.\n *\n * Token categories:\n *\n * Structural tokens (no value):\n * - `braceOpen` → `{`\n * - `braceClose` → `}`\n * - `colon` → `:`\n * - `semicolon` → `;`\n * - `at` → `@`\n *\n * Value tokens (contain `value`):\n * - `text` → Plain text fragments (selectors, property names, raw values)\n * - `params` → Parenthesized groups including parentheses (e.g. `(min-width: 768px)`)\n * - `string` → Quoted string contents without surrounding quotes\n *\n * This discriminated union ensures:\n * - Tokens that require a value always have one\n * - Punctuation tokens never carry unnecessary data\n * - TypeScript can safely narrow tokens based on `type`\n *\n * Used throughout:\n * - Selector parsing\n * - Declaration parsing\n * - At-rule parsing\n * - AST construction\n */\nexport type HoneyCssToken =\n | { type: 'braceOpen' }\n | { type: 'braceClose' }\n | { type: 'colon' }\n | { type: 'semicolon' }\n | { type: 'at' }\n | { type: 'text'; value: string }\n | { type: 'params'; value: string }\n | { type: 'string'; value: string };\n\n/**\n * Union of all supported Honey CSS token type names.\n *\n * This is derived automatically from {@link HoneyCssToken}\n * to ensure strong type consistency between token instances\n * and token-type comparisons.\n *\n * Useful for:\n * - Cursor expectations (`expect('braceOpen')`)\n * - Stop conditions in parsing helpers (`readUntil(['braceOpen'])`)\n * - Type narrowing in switch statements\n */\nexport type HoneyCssTokenType = HoneyCssToken['type'];\n","const e=e=>new Blob([e],{type:e.type}),t=e=>new DOMRect(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight),n=e=>\"A\"===e.tagName,r=e=>\"true\"===e.getAttribute(\"contenteditable\"),a=[\"INPUT\",\"SELECT\",\"TEXTAREA\",\"BUTTON\",\"A\"],l=e=>{if(!e)return!1;const t=window.getComputedStyle(e);if(\"hidden\"===t.visibility||\"none\"===t.display)return!1;if(\"disabled\"in e&&e.disabled)return!1;const l=e.getAttribute(\"tabindex\");return\"-1\"!==l&&(a.includes(e.tagName)?!n(e)||\"\"!==e.href:!!r(e)||null!==l)},i=e=>Array.from(e.querySelectorAll(\"*\")).filter(l),o=(e,t=null,{wrap:n=!0,getNextIndex:r}={})=>{const a=document.activeElement,l=t??a?.parentElement;if(!a||!l)return;const o=i(l);if(0===o.length)return;const s=o.indexOf(a);if(-1===s)return;let c;r?c=r(s,e,o):\"next\"===e?(c=s+1,c>=o.length&&(c=n?0:null)):(c=s-1,c<0&&(c=n?o.length-1:null)),null!==c&&o[c]?.focus()};function s(e,t){if(!e)throw new Error(t)}const c=e=>null===e,u=e=>null==e,h=e=>null!=e,f=e=>void 0===e,d=e=>\"number\"==typeof e,m=e=>\"boolean\"==typeof e,p=e=>\"object\"==typeof e,g=e=>p(e)&&!c(e)&&0===Object.keys(e).length,y=e=>e instanceof Date,w=e=>e instanceof Blob,b=e=>e instanceof Error,x=e=>y(e)&&!isNaN(e.getTime()),M=e=>e instanceof RegExp,S=e=>e instanceof Map,A=e=>e instanceof Set,v=e=>\"symbol\"==typeof e,C=e=>d(e)&&isFinite(e),I=e=>d(e)&&Number.isInteger(e),k=e=>C(e)&&!Number.isInteger(e),E=e=>Array.isArray(e),L=e=>E(e)&&0===e.length,P=e=>e.filter(Boolean),O=e=>[...new Set(e)],T=(e,t)=>(s(t>0,\"Chunk size must be greater than 0\"),Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t))),X=(...e)=>{if(0===e.length)return[];if(1===e.length)return[...e[0]];const[t,...n]=e;return O(t).filter(e=>n.every(t=>t.includes(e)))},_=(e,t)=>e.filter(e=>!t.includes(e)),z=(...e)=>t=>e.reduce((e,t)=>t(e),t),Y=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),R=()=>{},N=e=>\"function\"==typeof e,$=e=>(...t)=>!e(...t),F=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},j=e=>N(e?.then),U=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(await t(e[r],r,e));return n},W=async(e,t)=>Promise.all(e.map(t)),H=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const a=e[r];await t(a,r,e)&&n.push(a)}return n},B=async(e,t)=>{const n=await W(e,async(e,n,r)=>!!await t(e,n,r)&&e);return P(n)},D=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return!0;return!1},V=async(e,t)=>{for(let n=0;n<e.length;n++)if(!await t(e[n],n,e))return!1;return!0},Z=async(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++)r=await t(r,e[n],n,e);return r},G=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return e[n];return null},q=e=>new Promise(t=>setTimeout(t,e)),J=async(e,t,n=\"Operation timed out\")=>{try{return await Promise.race([e,q(t).then(()=>Promise.reject(new Error(n)))])}finally{}},K=(e,{maxAttempts:t=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...l)=>{let i;for(let o=1;o<=t;o++)try{return await e(...l)}catch(e){if(i=e,o<t){a?.(o,e);const t=r?n*2**(o-1):n;await q(t)}}throw i},Q=e=>\"string\"==typeof e,ee=(e,{fileName:t,target:n}={})=>{if(f(document))return;const r=document.createElement(\"a\");let a=null;try{const l=Q(e)?e:a=URL.createObjectURL(e);r.href=l,t&&(r.download=t),n&&(r.target=n),document.body.appendChild(r),r.click()}finally{r.remove(),a&&setTimeout(()=>{s(a,\"Object URL should not be null\"),URL.revokeObjectURL(a)},0)}},te=e=>e.scrollWidth>e.clientWidth,ne=e=>Math.max(0,e.scrollWidth-e.clientWidth),re=e=>e.scrollHeight>e.clientHeight,ae=e=>Math.max(0,e.scrollHeight-e.clientHeight),le=({overflowSize:e,containerSize:t,elementOffset:n,elementSize:r})=>{if(e<=0)return 0;const a=n+r/2-t/2;return-Math.max(0,Math.min(a,e))},ie=(e,t,{axis:n=\"both\"}={})=>{let r=0,a=0;\"x\"!==n&&\"both\"!==n||(r=le({overflowSize:ne(e),containerSize:e.clientWidth,elementOffset:t.offsetLeft,elementSize:t.clientWidth})),\"y\"!==n&&\"both\"!==n||(a=le({overflowSize:ae(e),containerSize:e.clientHeight,elementOffset:t.offsetTop,elementSize:t.clientHeight})),e.style.transform=`translate(${r}px, ${a}px)`},oe=e=>{const t=window.getComputedStyle(e).getPropertyValue(\"transform\").match(/^matrix\\((.+)\\)$/);if(!t)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,l,i,o]=t[1].split(\", \").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:l,skewX:a,skewY:r}},se=()=>{if(\"undefined\"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem(\"__non_existing_key__\"),!0}catch{return!1}},ce=()=>{if(!se())return{readable:!1,writable:!1};try{const e=\"__test_write__\";return window.localStorage.setItem(e,\"1\"),window.localStorage.removeItem(e),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}},ue=e=>e instanceof File,he=e=>{if(!e)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},fe=(e,t)=>new File([e],t,{type:e.type}),de=async(e,{skipFiles:t=[\".DS_Store\",\"Thumbs.db\",\"desktop.ini\",\"ehthumbs.db\",\".Spotlight-V100\",\".Trashes\",\".fseventsd\",\"__MACOSX\"]}={})=>{const n=new Set(t),r=await(async e=>{const t=e.createReader(),n=async()=>new Promise((e,r)=>{t.readEntries(async t=>{if(t.length)try{const r=await n();e([...t,...r])}catch(e){r(e)}else e([])},r)});return n()})(e);return(await W(r,async e=>e.isDirectory?de(e,{skipFiles:t}):n.has(e.name)?[]:[await new Promise((t,n)=>{e.file(t,n)})])).flat()},me=async(e,t={})=>{const n=e?.items;if(!n)return[];const r=[];for(let e=0;e<n.length;e++){const a=n[e];if(\"webkitGetAsEntry\"in a){const e=a.webkitGetAsEntry?.();if(e?.isDirectory){r.push(de(e,t));continue}if(e?.isFile){r.push(new Promise((t,n)=>e.file(e=>t([e]),n)));continue}}const l=a.getAsFile();l&&r.push(Promise.resolve([l]))}return(await Promise.all(r)).flat()},pe=(e,...t)=>\"function\"==typeof e?e(...t):e,ge=({delta:e,value:t,min:n,max:r})=>{if(0===e)return null;const a=t+e;return e<0?t<=n?null:Math.max(a,n):e>0?t>=r?null:Math.min(a,r):null},ye=({value:e,min:t,max:n,velocityPxMs:r,deltaTimeMs:a,friction:l=.002,minVelocityPxMs:i=.01,emaAlpha:o=.2})=>{if(Math.abs(r)<i)return null;const s=ge({delta:r*a,value:e,min:t,max:n});if(null===s)return null;const c=r*Math.exp(-l*a),u=o>0?r*(1-o)+c*o:c;return Math.abs(u)<i?null:{value:s,velocityPxMs:u}},we=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,be=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height),xe=(e,t,{allowFallback:n=!0,invert:r=!0}={})=>{const a=r?-1:1;switch(t){case\"x\":return{deltaX:a*(0!==e.deltaX?e.deltaX:n?e.deltaY:0),deltaY:0};case\"y\":return{deltaX:0,deltaY:a*e.deltaY};default:return{deltaX:a*e.deltaX,deltaY:a*e.deltaY}}},Me=(e,t,n,r)=>{const a=n-e,l=r-t;return Math.hypot(a,l)},Se=(e,t)=>Math.abs(e/t),Ae=(e,t)=>e*t/100,ve=e=>{let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)},Ce=e=>Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}),Ie=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1-$2\").toLowerCase(),ke=e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)},Ee=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\"),Le=e=>0===e.length?[]:e.split(\" \").filter(Boolean),Pe=e=>\"\"===e||u(e),Oe=e=>{const t=e.lastIndexOf(\".\");return t<=0||t===e.length-1?[e,\"\"]:[e.slice(0,t),e.slice(t+1).toLowerCase()]},Te=(e,t)=>{if(0===e.length)return[];const n=t.charCodeAt(0),r=[];for(let t=0;t<e.length;t++)e.charCodeAt(t)===n&&r.push(t);return r},Xe=(e,t,n)=>{if(0===e.length)return;const r=e.length;for(let a=0;a<r;a++){const l=e[a],i={charIndex:a,prevChar:a>0?e[a-1]:null,nextChar:a<r-1?e[a+1]:null};n?.(l,i)||t(l,i)}},_e=(e,t=1/0)=>0===e.length?\"\":Le(e).slice(0,t).map(e=>e[0]).join(\"\").toUpperCase(),ze=(e,t,n,r=[],a=void 0,l=0)=>(e?.forEach(e=>{const{[n]:i,...o}=e,s=e[n],c=Array.isArray(s);if(r.push({...o,parentId:a,depthLevel:l,childCount:c?s.length:0}),c){const a=e[t];ze(s,t,n,r,a,l+1)}}),r),Ye=(e,t,n)=>e.filter(e=>e.parentId===t&&(!n||n(e))),Re=(e,t,n,r)=>{const a=Le(r.toLowerCase());if(!a.length)return e;const l=e.reduce((e,n,r)=>(e[n[t]]=r,e),{});return e.reduce((r,i)=>{const o=i[n];if(!o)return r;if(r.some(e=>e[t]===i[t]))return r;const u=Le(o.toLowerCase());if(a.every(e=>u.some(t=>t.startsWith(e))))if(f(i.parentId)){r.push(i);const n=a=>{a.childCount&&e.forEach(e=>{e.parentId===a[t]&&(r.push(e),n(e))})};n(i)}else{const t=n=>{const a=l[n.parentId],i=e[a];f(i.parentId)||t(i);const o=r.length?r[r.length-1].parentId:null;(c(o)||o!==n.parentId)&&(s(i,\"[@react-hive/honey-utils]: Parent node was not found.\"),r.push(i))};t(i),r.push(i)}return r},[])};export{a as FOCUSABLE_HTML_TAGS,ye as applyInertiaStep,s as assert,fe as blobToFile,le as calculateCenterOffset,Me as calculateEuclideanDistance,Se as calculateMovingSpeed,Ae as calculatePercentage,ke as camelToDashCase,Ee as camelToWords,ie as centerElementInContainer,T as chunk,e as cloneBlob,P as compact,Y as compose,Ce as definedProps,q as delay,_ as difference,ee as downloadFile,V as everyAsync,he as fileListToFiles,B as filterParallel,H as filterSequential,G as findAsync,Te as findCharIndices,ze as flattenTree,Xe as forEachChar,we as generateEphemeralId,be as getDOMRectIntersectionRatio,t as getElementOffsetRect,i as getFocusableHtmlElements,ce as getLocalStorageCapabilities,Ye as getTreeChildren,_e as getWordsInitials,ne as getXOverflowWidth,ae as getYOverflowHeight,te as hasXOverflow,re as hasYOverflow,ve as hashString,X as intersection,pe as invokeIfFunction,n as isAnchorHtmlElement,E as isArray,w as isBlob,m as isBool,r as isContentEditableHtmlElement,y as isDate,k as isDecimal,h as isDefined,L as isEmptyArray,g as isEmptyObject,b as isError,ue as isFile,C as isFiniteNumber,N as isFunction,l as isHtmlElementFocusable,I as isInteger,se as isLocalStorageReadable,S as isMap,u as isNil,Pe as isNilOrEmptyString,c as isNull,d as isNumber,p as isObject,j as isPromise,M as isRegExp,A as isSet,Q as isString,v as isSymbol,f as isUndefined,x as isValidDate,o as moveFocusWithinContainer,R as noop,$ as not,F as once,oe as parse2DMatrix,Oe as parseFileName,z as pipe,me as readFilesFromDataTransfer,Z as reduceAsync,xe as resolveAxisDelta,ge as resolveBoundedDelta,K as retry,W as runParallel,U as runSequential,Re as searchTree,D as someAsync,Le as splitStringIntoWords,J as timeout,Ie as toKebabCase,de as traverseFileSystemDirectory,O as unique};\n//# sourceMappingURL=index.mjs.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './types';\nexport * from './tokenize-css';\nexport * from './create-css-token-cursor';\n"],"names":[],"sourceRoot":""}
package/dist/types.d.ts CHANGED
@@ -1,22 +1,64 @@
1
1
  /**
2
- * All supported token types produced by the Honey CSS tokenizer.
3
- *
4
- * These tokens represent the minimal syntax units needed for parsing:
5
- * - Structural braces (`{` / `}`)
6
- * - Punctuation (`:` / `;`)
7
- * - At-rules (`@`)
8
- * - Parenthesized groups (`(...)`)
9
- * - Strings (`"..."`, `'...'`)
10
- * - Plain text chunks (selectors, property names, values)
2
+ * A single lexical token produced by the Honey CSS tokenizer.
3
+ *
4
+ * This discriminated union represents the minimal syntax units
5
+ * required by the Honey CSS parser.
6
+ *
7
+ * Token categories:
8
+ *
9
+ * Structural tokens (no value):
10
+ * - `braceOpen` → `{`
11
+ * - `braceClose` → `}`
12
+ * - `colon` → `:`
13
+ * - `semicolon` → `;`
14
+ * - `at` → `@`
15
+ *
16
+ * Value tokens (contain `value`):
17
+ * - `text` → Plain text fragments (selectors, property names, raw values)
18
+ * - `params` → Parenthesized groups including parentheses (e.g. `(min-width: 768px)`)
19
+ * - `string` → Quoted string contents without surrounding quotes
20
+ *
21
+ * This discriminated union ensures:
22
+ * - Tokens that require a value always have one
23
+ * - Punctuation tokens never carry unnecessary data
24
+ * - TypeScript can safely narrow tokens based on `type`
25
+ *
26
+ * Used throughout:
27
+ * - Selector parsing
28
+ * - Declaration parsing
29
+ * - At-rule parsing
30
+ * - AST construction
11
31
  */
12
- export type HoneyCssTokenType = 'braceOpen' | 'braceClose' | 'colon' | 'semicolon' | 'at' | 'params' | 'string' | 'text';
32
+ export type HoneyCssToken = {
33
+ type: 'braceOpen';
34
+ } | {
35
+ type: 'braceClose';
36
+ } | {
37
+ type: 'colon';
38
+ } | {
39
+ type: 'semicolon';
40
+ } | {
41
+ type: 'at';
42
+ } | {
43
+ type: 'text';
44
+ value: string;
45
+ } | {
46
+ type: 'params';
47
+ value: string;
48
+ } | {
49
+ type: 'string';
50
+ value: string;
51
+ };
13
52
  /**
14
- * A single token produced by {@link tokenizeCss}.
53
+ * Union of all supported Honey CSS token type names.
54
+ *
55
+ * This is derived automatically from {@link HoneyCssToken}
56
+ * to ensure strong type consistency between token instances
57
+ * and token-type comparisons.
15
58
  *
16
- * Some token types (like `text`, `params`, `string`) include a `value`,
17
- * while punctuation tokens do not.
59
+ * Useful for:
60
+ * - Cursor expectations (`expect('braceOpen')`)
61
+ * - Stop conditions in parsing helpers (`readUntil(['braceOpen'])`)
62
+ * - Type narrowing in switch statements
18
63
  */
19
- export interface HoneyCssToken {
20
- type: HoneyCssTokenType;
21
- value?: string;
22
- }
64
+ export type HoneyCssTokenType = HoneyCssToken['type'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-hive/honey-css",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "A lightweight CSS tokenizer and parser that produces a simple AST for custom CSS processing.",
5
5
  "keywords": [
6
6
  "css",