@hyperframes/core 0.9.53 → 0.9.55

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.
@@ -25,7 +25,7 @@ export declare const EDITING_PROTOCOL_VERSION: 1;
25
25
  export declare const EDITING_CONNECT = "editing-connect";
26
26
  /** Frame to parent, on the window: carries the port in its transfer list. */
27
27
  export declare const EDITING_PORT = "editing-port";
28
- export declare const EDITING_REQUEST_KINDS: readonly ["hello", "runtime-snapshot", "wait-for-seek", "set-loop-start", "computed-styles", "elements-at-point", "pointer-targets", "describe", "ancestors", "query", "geometry", "layers", "draft", "gesture-start"];
28
+ export declare const EDITING_REQUEST_KINDS: readonly ["hello", "runtime-snapshot", "wait-for-seek", "set-loop-start", "computed-styles", "elements-at-point", "pointer-targets", "describe", "ancestors", "query", "geometry", "layers", "draft", "gesture-start", "console-errors"];
29
29
  export type EditingRequestKind = (typeof EDITING_REQUEST_KINDS)[number];
30
30
  export interface EditingRuntimeSnapshot {
31
31
  /** The runtime has installed its player API. */
@@ -186,6 +186,15 @@ export interface EditingRequests {
186
186
  snap: EditingElementBox[];
187
187
  };
188
188
  };
189
+ "console-errors": {
190
+ params: {
191
+ from: number;
192
+ };
193
+ result: {
194
+ errors: string[];
195
+ truncated: boolean;
196
+ };
197
+ };
189
198
  }
190
199
  export type EditingParams<K extends EditingRequestKind> = EditingRequests[K]["params"];
191
200
  export type EditingResult<K extends EditingRequestKind> = EditingRequests[K]["result"];
@@ -36,6 +36,7 @@ export const EDITING_REQUEST_KINDS = [
36
36
  "layers",
37
37
  "draft",
38
38
  "gesture-start",
39
+ "console-errors",
39
40
  ];
40
41
  export const MAX_DRAFT_PX = 100_000;
41
42
  export function isPlainRecord(value) {
@@ -160,6 +161,7 @@ const PARAM_PARSERS = {
160
161
  layers: (params) => noParams(params) ?? layerParams(params),
161
162
  draft: draftList,
162
163
  "gesture-start": handleList,
164
+ "console-errors": (params) => hasKeys(params, "from") && isOffset(params.from) ? { from: params.from } : null,
163
165
  };
164
166
  /** Validates one request off the wire. Never throws: anything unusable becomes a typed error. */
165
167
  export function parseEditingRequest(data) {
@@ -35,7 +35,7 @@ export declare function resolveWithinProject(base: string, relativePath: string)
35
35
  /** Segments as Windows opens them: any case, no trailing dots or spaces, no `:stream` suffix. */
36
36
  export declare function projectPathSegments(relPath: string): string[];
37
37
  export declare function isVcsOrSecretPath(relPath: string): boolean;
38
- /** Studio's private files, for a project-relative path with `/` separators: git, env, and the app's records. */
38
+ /** Files no composition loads, for a project-relative path in any spelling Windows opens: git, env, app records. */
39
39
  export declare function isStudioPrivatePath(relPath: string): boolean;
40
40
  /** Whether `isPrivate` holds for a file under `projectDir`, spelled as given or with its links resolved. */
41
41
  export declare function isPrivateFileUnder(projectDir: string, filePath: string, isPrivate: (relPath: string) => boolean): boolean;
package/dist/safePath.js CHANGED
@@ -119,18 +119,18 @@ function withoutTrailingDotsOrSpaces(segment) {
119
119
  export function isVcsOrSecretPath(relPath) {
120
120
  return projectPathSegments(relPath).some((segment) => segment === ".git" || segment.startsWith(".env"));
121
121
  }
122
- // `.hyperframes/` holds the desktop app's and the CLI's own records (a hand-off, chat history, read marks): Studio
123
- // reaches none of it, the folder itself included, but its own files and the app's request pictures.
122
+ // `.hyperframes/` holds the desktop app's and the CLI's own records (a hand-off, chat history, read marks): no file
123
+ // server serves any of it, the folder itself included, but Studio's own files and the assets compositions load.
124
124
  const STUDIO_FILES = new Set([
125
125
  ".hyperframes/studio-motion.json",
126
126
  ".hyperframes/studio-manual-edits.json",
127
127
  ]);
128
128
  const STUDIO_FOLDERS = [".hyperframes/prepared-assets", ".hyperframes/requests"];
129
- /** Studio's private files, for a project-relative path with `/` separators: git, env, and the app's records. */
129
+ /** Files no composition loads, for a project-relative path in any spelling Windows opens: git, env, app records. */
130
130
  export function isStudioPrivatePath(relPath) {
131
- const path = relPath.toLowerCase();
132
- if (isVcsOrSecretPath(path))
131
+ if (isVcsOrSecretPath(relPath))
133
132
  return true;
133
+ const path = projectPathSegments(relPath).join("/");
134
134
  return ((path === ".hyperframes" || path.startsWith(".hyperframes/")) &&
135
135
  !STUDIO_FILES.has(path) &&
136
136
  !STUDIO_FOLDERS.some((folder) => path === folder || path.startsWith(`${folder}/`)));
@@ -15,6 +15,7 @@ export declare const STUDIO_PREVIEW_UPCOMING_ATTR = "data-hf-upcoming";
15
15
  export declare const STUDIO_PREVIEW_LAZY_ATTR = "data-hf-preview-lazy";
16
16
  export declare const STUDIO_PREVIEW_ERRORS = "__hfPreviewErrors";
17
17
  export declare const STUDIO_PREVIEW_ERROR_KINDS = "__hfPreviewErrorKinds";
18
+ export declare function previewConsoleErrorText(args: readonly unknown[]): string | null;
18
19
  export declare const refusedPreviewMessage: (status: number) => string;
19
20
  export declare function refusedPreviewStatus(message: string): number | null;
20
21
  export declare const PREVIEW_RASTER_ATTR = "data-hf-preview-raster";
@@ -32,6 +32,10 @@ export const STUDIO_PREVIEW_UPCOMING_ATTR = "data-hf-upcoming";
32
32
  export const STUDIO_PREVIEW_LAZY_ATTR = "data-hf-preview-lazy";
33
33
  export const STUDIO_PREVIEW_ERRORS = "__hfPreviewErrors";
34
34
  export const STUDIO_PREVIEW_ERROR_KINDS = "__hfPreviewErrorKinds";
35
+ export function previewConsoleErrorText(args) {
36
+ const text = args.map((a) => (a instanceof Error ? a.message : String(a))).join(" ");
37
+ return text.includes("favicon") ? null : text;
38
+ }
35
39
  export const refusedPreviewMessage = (status) => `The preview page could not be loaded (HTTP ${status}).`;
36
40
  export function refusedPreviewStatus(message) {
37
41
  const status = /^The preview page could not be loaded \(HTTP (\d{3})\)\.$/.exec(message)?.[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/core",
3
- "version": "0.9.53",
3
+ "version": "0.9.55",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -457,9 +457,9 @@
457
457
  "linkedom": "^0.18.12",
458
458
  "postcss": "^8.5.8",
459
459
  "wawoff2": "^2.0.1",
460
- "@hyperframes/lint": "0.9.53",
461
- "@hyperframes/studio-server": "0.9.53",
462
- "@hyperframes/parsers": "0.9.53"
460
+ "@hyperframes/parsers": "0.9.55",
461
+ "@hyperframes/studio-server": "0.9.55",
462
+ "@hyperframes/lint": "0.9.55"
463
463
  },
464
464
  "devDependencies": {
465
465
  "@fontsource/archivo-black": "^5.2.8",