@hyperframes/parsers 0.8.42 → 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
@@ -135,6 +135,17 @@ declare function unrollComputedTimeline(script: string): string;
135
135
 
136
136
  declare function queryByAttr(root: ParentNode, attr: string, value: string, tag?: string): Element | null;
137
137
 
138
+ /**
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.
141
+ */
142
+ /** html/body CSS, width first. Groups 1/3 are the surrounding text, 2/4 the digits. */
143
+ declare const HTML_BODY_CSS_WIDTH_FIRST_RE: RegExp;
144
+ /** Same block, height authored first. */
145
+ declare const HTML_BODY_CSS_HEIGHT_FIRST_RE: RegExp;
146
+ /** Viewport meta content. Shared by lint (reads groups 2/4) and cli (replaces via 1/3). */
147
+ declare const VIEWPORT_META_SIZE_RE: RegExp;
148
+
138
149
  interface MediaSrcMutation {
139
150
  selector: string;
140
151
  operation: "src_assignment" | "set_attribute";
@@ -143,4 +154,4 @@ interface MediaSrcMutation {
143
154
  /** Find literal source writes whose target is a statically resolvable DOM lookup. */
144
155
  declare function extractMediaSrcMutations(script: string): MediaSrcMutation[];
145
156
 
146
- export { CanvasResolution, CompositionHtmlParseError, type CompositionMetadata, CompositionVariable, Keyframe, type MediaSrcMutation, type OutputResolutionCompatibility, type OutputResolutionIssueKind, type ParsedHtml, StageZoomKeyframe, TimelineElement, ValidationResult, addElementToHtml, checkOutputResolutionCompatibility, extractCompositionMetadata, extractMediaSrcMutations, parseHtml, queryByAttr, removeElementFromHtml, removeElementWithGsapCascade, suggestMatchingPreset, unrollComputedTimeline, updateElementInHtml, validateCompositionHtml };
157
+ export { CanvasResolution, CompositionHtmlParseError, type CompositionMetadata, CompositionVariable, HTML_BODY_CSS_HEIGHT_FIRST_RE, HTML_BODY_CSS_WIDTH_FIRST_RE, Keyframe, type MediaSrcMutation, type OutputResolutionCompatibility, type OutputResolutionIssueKind, type ParsedHtml, StageZoomKeyframe, TimelineElement, VIEWPORT_META_SIZE_RE, ValidationResult, addElementToHtml, checkOutputResolutionCompatibility, extractCompositionMetadata, extractMediaSrcMutations, parseHtml, queryByAttr, removeElementFromHtml, removeElementWithGsapCascade, suggestMatchingPreset, unrollComputedTimeline, updateElementInHtml, validateCompositionHtml };
package/dist/index.js CHANGED
@@ -3521,6 +3521,11 @@ function unrollComputedTimeline(script) {
3521
3521
  return ms.toString();
3522
3522
  }
3523
3523
 
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;
3528
+
3524
3529
  // src/utils/urlPath.ts
3525
3530
  function decodeUrlPathVariants(path) {
3526
3531
  const variants = [path];
@@ -3829,6 +3834,8 @@ export {
3829
3834
  EXCLUDED_TAGS,
3830
3835
  FONT_ALIAS_KEYS,
3831
3836
  FONT_ALIAS_MAP,
3837
+ HTML_BODY_CSS_HEIGHT_FIRST_RE,
3838
+ HTML_BODY_CSS_WIDTH_FIRST_RE,
3832
3839
  LEGACY_TIMING_ATTRIBUTES,
3833
3840
  PROPERTY_GROUPS,
3834
3841
  SPRING_PRESETS,
@@ -3836,6 +3843,7 @@ export {
3836
3843
  SUPPORTED_PROPS,
3837
3844
  TIMELINE_COLORS,
3838
3845
  VALID_CANVAS_RESOLUTIONS,
3846
+ VIEWPORT_META_SIZE_RE,
3839
3847
  addElementToHtml,
3840
3848
  checkOutputResolutionCompatibility,
3841
3849
  checkSubCompositionUsability,