hyperframes 0.6.0-alpha.11 → 0.6.0-alpha.12

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/cli.js CHANGED
@@ -54,7 +54,7 @@ var VERSION;
54
54
  var init_version = __esm({
55
55
  "src/version.ts"() {
56
56
  "use strict";
57
- VERSION = true ? "0.6.0-alpha.11" : "0.0.0-dev";
57
+ VERSION = true ? "0.6.0-alpha.12" : "0.0.0-dev";
58
58
  }
59
59
  });
60
60
 
@@ -2339,7 +2339,9 @@ var init_core_types = __esm({
2339
2339
  landscape: { width: 1920, height: 1080 },
2340
2340
  portrait: { width: 1080, height: 1920 },
2341
2341
  "landscape-4k": { width: 3840, height: 2160 },
2342
- "portrait-4k": { width: 2160, height: 3840 }
2342
+ "portrait-4k": { width: 2160, height: 3840 },
2343
+ square: { width: 1080, height: 1080 },
2344
+ "square-4k": { width: 2160, height: 2160 }
2343
2345
  };
2344
2346
  VALID_CANVAS_RESOLUTIONS = Object.keys(
2345
2347
  CANVAS_DIMENSIONS
@@ -2351,7 +2353,10 @@ var init_core_types = __esm({
2351
2353
  "portrait-1080p": "portrait",
2352
2354
  "4k": "landscape-4k",
2353
2355
  uhd: "landscape-4k",
2354
- "4k-portrait": "portrait-4k"
2356
+ "4k-portrait": "portrait-4k",
2357
+ "1080p-square": "square",
2358
+ "square-1080p": "square",
2359
+ "4k-square": "square-4k"
2355
2360
  };
2356
2361
  COMPOSITION_VARIABLE_TYPES = [
2357
2362
  "string",
@@ -2886,7 +2891,7 @@ function parseResolutionFromCss(doc, cssText) {
2886
2891
  function parseResolutionFromHtml(doc) {
2887
2892
  const htmlEl = doc.documentElement;
2888
2893
  const resolutionAttr = htmlEl.getAttribute("data-resolution");
2889
- if (resolutionAttr === "landscape" || resolutionAttr === "portrait" || resolutionAttr === "landscape-4k" || resolutionAttr === "portrait-4k") {
2894
+ if (resolutionAttr === "landscape" || resolutionAttr === "portrait" || resolutionAttr === "landscape-4k" || resolutionAttr === "portrait-4k" || resolutionAttr === "square" || resolutionAttr === "square-4k") {
2890
2895
  return resolutionAttr;
2891
2896
  }
2892
2897
  const widthAttr = htmlEl.getAttribute("data-composition-width");
@@ -2901,8 +2906,11 @@ function parseResolutionFromHtml(doc) {
2901
2906
  return null;
2902
2907
  }
2903
2908
  function resolveResolutionFromDimensions(width, height) {
2904
- const isLandscape = width > height;
2905
2909
  const longSide = Math.max(width, height);
2910
+ if (width === height) {
2911
+ return longSide >= 2160 ? "square-4k" : "square";
2912
+ }
2913
+ const isLandscape = width > height;
2906
2914
  const isUhd = longSide >= 3840;
2907
2915
  if (isLandscape) return isUhd ? "landscape-4k" : "landscape";
2908
2916
  return isUhd ? "portrait-4k" : "portrait";
@@ -40596,7 +40604,7 @@ var init_init = __esm({
40596
40604
  },
40597
40605
  resolution: {
40598
40606
  type: "string",
40599
- description: "Canvas resolution preset: landscape (1920x1080), portrait (1080x1920), landscape-4k (3840x2160), portrait-4k (2160x3840). Aliases: 1080p, 4k, uhd. Default: keep template dimensions (typically 1920x1080)."
40607
+ description: "Canvas resolution preset: landscape (1920x1080), portrait (1080x1920), landscape-4k (3840x2160), portrait-4k (2160x3840), square (1080x1080), square-4k (2160x2160). Aliases: 1080p, 4k, uhd, 1080p-square, square-1080p, 4k-square. Default: keep template dimensions (typically 1920x1080)."
40600
40608
  }
40601
40609
  },
40602
40610
  async run({ args }) {
@@ -40625,7 +40633,7 @@ var init_init = __esm({
40625
40633
  if (!resolutionPreset) {
40626
40634
  console.error(
40627
40635
  c.error(
40628
- `Invalid --resolution: "${args.resolution}". Use one of: landscape, portrait, landscape-4k, portrait-4k (or aliases 1080p, 4k, uhd).`
40636
+ `Invalid --resolution: "${args.resolution}". Use one of: landscape, portrait, landscape-4k, portrait-4k, square, square-4k (or aliases 1080p, 4k, uhd, 1080p-square, square-1080p, 4k-square).`
40629
40637
  )
40630
40638
  );
40631
40639
  process.exit(1);
@@ -42595,7 +42603,7 @@ var init_render2 = __esm({
42595
42603
  },
42596
42604
  resolution: {
42597
42605
  type: "string",
42598
- description: "Output resolution preset: landscape (1920x1080), portrait (1080x1920), landscape-4k (3840x2160), portrait-4k (2160x3840). Aliases: 1080p, 4k, uhd. The composition is unchanged \u2014 Chrome renders at higher DPR (deviceScaleFactor) so the captured screenshot lands at the requested dimensions. Aspect ratio must match the composition; the scale must be an integer multiple. Not yet supported with --hdr."
42606
+ description: "Output resolution preset: landscape (1920x1080), portrait (1080x1920), landscape-4k (3840x2160), portrait-4k (2160x3840), square (1080x1080), square-4k (2160x2160). Aliases: 1080p, 4k, uhd, 1080p-square, square-1080p, 4k-square. The composition is unchanged \u2014 Chrome renders at higher DPR (deviceScaleFactor) so the captured screenshot lands at the requested dimensions. Aspect ratio must match the composition; the scale must be an integer multiple. Not yet supported with --hdr."
42599
42607
  }
42600
42608
  },
42601
42609
  async run({ args }) {
@@ -42624,7 +42632,7 @@ var init_render2 = __esm({
42624
42632
  if (!outputResolution) {
42625
42633
  errorBox(
42626
42634
  "Invalid resolution",
42627
- `Got "${args.resolution}". Must be one of: landscape, portrait, landscape-4k, portrait-4k (or aliases 1080p, 4k, uhd).`
42635
+ `Got "${args.resolution}". Must be one of: landscape, portrait, landscape-4k, portrait-4k, square, square-4k (or aliases 1080p, 4k, uhd, 1080p-square, square-1080p, 4k-square).`
42628
42636
  );
42629
42637
  process.exit(1);
42630
42638
  }