@hyperframes/parsers 0.8.43 → 0.8.44

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.
package/dist/index.d.ts CHANGED
@@ -136,23 +136,14 @@ declare function unrollComputedTimeline(script: string): string;
136
136
  declare function queryByAttr(root: ParentNode, attr: string, value: string, tag?: string): Element | null;
137
137
 
138
138
  /**
139
- * Where a scaffolded project's canvas resolution lives besides the composition
140
- * root's own `data-width`/`data-height`: the inline `html, body { width;
141
- * height }` CSS block and the `<meta name="viewport">` `content` attribute.
142
- * `@hyperframes/cli`'s `applyResolutionPreset` rewrites those same two places
143
- * when a project scaffolds with `--resolution`, but keeps its own
144
- * prefix-capturing regexes for that replace — these are a separate read-only
145
- * definition of the same locations, not the literal patterns it uses.
146
- *
147
- * Lives in `@hyperframes/parsers` rather than `@hyperframes/cli` because
148
- * `@hyperframes/lint` cannot depend on `cli` (`cli` depends on `lint`, not the
149
- * reverse), and `parsers` is a dependency both already share.
139
+ * Where a scaffolded project's canvas resolution lives besides the root's own
140
+ * data-width/data-height: the html/body CSS size and the meta viewport content.
150
141
  */
151
- /** Matches `html, body { ...width: <n>px... height: <n>px... }`. */
142
+ /** html/body CSS, width first. Groups 1/3 are the surrounding text, 2/4 the digits. */
152
143
  declare const HTML_BODY_CSS_WIDTH_FIRST_RE: RegExp;
153
- /** Matches the same block with height authored before width. */
144
+ /** Same block, height authored first. */
154
145
  declare const HTML_BODY_CSS_HEIGHT_FIRST_RE: RegExp;
155
- /** Matches `<meta ... name="viewport" ... content="width=<n>, height=<n>">`. */
146
+ /** Viewport meta content. Shared by lint (reads groups 2/4) and cli (replaces via 1/3). */
156
147
  declare const VIEWPORT_META_SIZE_RE: RegExp;
157
148
 
158
149
  interface MediaSrcMutation {
package/dist/index.js CHANGED
@@ -3522,9 +3522,9 @@ function unrollComputedTimeline(script) {
3522
3522
  }
3523
3523
 
3524
3524
  // src/canvasScaffoldPatterns.ts
3525
- var HTML_BODY_CSS_WIDTH_FIRST_RE = /html\s*,\s*body\s*\{[^}]*?width:\s*(\d+)px[^}]*?height:\s*(\d+)px/i;
3526
- var HTML_BODY_CSS_HEIGHT_FIRST_RE = /html\s*,\s*body\s*\{[^}]*?height:\s*(\d+)px[^}]*?width:\s*(\d+)px/i;
3527
- var VIEWPORT_META_SIZE_RE = /<meta[^>]*name=["']viewport["'][^>]*content=["']width=(\d+),\s*height=(\d+)/i;
3525
+ var HTML_BODY_CSS_WIDTH_FIRST_RE = /(html\s*,\s*body\s*\{[^}]*?width:\s*)(\d+)px([^}]*?height:\s*)(\d+)px/i;
3526
+ var HTML_BODY_CSS_HEIGHT_FIRST_RE = /(html\s*,\s*body\s*\{[^}]*?height:\s*)(\d+)px([^}]*?width:\s*)(\d+)px/i;
3527
+ var VIEWPORT_META_SIZE_RE = /(<meta[^>]*name=["']viewport["'][^>]*content=["']width=)(\d+)(,\s*height=)(\d+)/i;
3528
3528
 
3529
3529
  // src/utils/urlPath.ts
3530
3530
  function decodeUrlPathVariants(path) {