@alpaca-headless/alpaca-headless-nextjs 1.0.4231 → 1.0.4233

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,12 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { EditorIntegrationClient } from "./EditorIntegrationClient";
3
3
  export function EditorIntegration(props) {
4
- // Server-side log (will appear in server logs)
5
- console.log(`[HEADLESS-SERVER] EditorIntegration render, mode: ${props.mode}`);
6
4
  if (props.mode !== "normal") {
7
- console.log(`[HEADLESS-SERVER] Rendering EditorIntegrationClient`);
8
5
  return _jsx(EditorIntegrationClient, Object.assign({}, props));
9
6
  }
10
- console.log(`[HEADLESS-SERVER] Mode is normal, returning null (no client integration)`);
11
7
  return null;
12
8
  }
@@ -1,24 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useEffect, useRef } from "react";
3
+ import { useEffect } from "react";
4
4
  import useExposeRefreshFunction from "./useExposeRefreshFunction";
5
- // Helper for consistent logging with timestamps
6
- const log = (message, data) => {
7
- const timestamp = new Date().toISOString();
8
- if (data !== undefined) {
9
- console.log(`[HEADLESS ${timestamp}] ${message}`, data);
10
- }
11
- else {
12
- console.log(`[HEADLESS ${timestamp}] ${message}`);
13
- }
14
- };
15
5
  export function EditorIntegrationClient({ timings, mode, }) {
16
- const instanceIdRef = useRef(Math.random().toString(36).substring(7));
17
- log(`EditorIntegrationClient RENDER, mode: ${mode}, instance: ${instanceIdRef.current}`);
18
- log(`window.parent === window:`, window.parent === window);
19
6
  useExposeRefreshFunction();
20
7
  useEffect(() => {
21
- log(`EditorIntegrationClient useEffect RUNNING, instance: ${instanceIdRef.current}`);
22
8
  const handleKeyDown = (event) => {
23
9
  if (event.ctrlKey && event.key === "F11") {
24
10
  event.preventDefault();
@@ -30,10 +16,8 @@ export function EditorIntegrationClient({ timings, mode, }) {
30
16
  }
31
17
  };
32
18
  window.addEventListener("keydown", handleKeyDown);
33
- log(`Sending editor-timings postMessage to parent`);
34
19
  window.parent.postMessage({ type: "editor-timings", timings }, "*");
35
20
  return () => {
36
- log(`EditorIntegrationClient useEffect CLEANUP, instance: ${instanceIdRef.current}`);
37
21
  window.removeEventListener("keydown", handleKeyDown);
38
22
  };
39
23
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpaca-headless/alpaca-headless-nextjs",
3
- "version": "1.0.4231",
3
+ "version": "1.0.4233",
4
4
  "type": "module",
5
5
  "description": "Alpaca Headless",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "typescript": "^5"
53
53
  },
54
54
  "dependencies": {
55
- "@alpaca-headless/alpaca-headless": "^1.0.4231",
55
+ "@alpaca-headless/alpaca-headless": "^1.0.4233",
56
56
  "axios": "^1.8.1",
57
57
  "https-proxy-agent": "^7.0.4",
58
58
  "next": "^14.2.4",
@@ -8,17 +8,8 @@ export type EditorIntegrationProps = {
8
8
  };
9
9
 
10
10
  export function EditorIntegration(props: EditorIntegrationProps) {
11
- // Server-side log (will appear in server logs)
12
- console.log(
13
- `[HEADLESS-SERVER] EditorIntegration render, mode: ${props.mode}`
14
- );
15
-
16
11
  if (props.mode !== "normal") {
17
- console.log(`[HEADLESS-SERVER] Rendering EditorIntegrationClient`);
18
12
  return <EditorIntegrationClient {...props} />;
19
13
  }
20
- console.log(
21
- `[HEADLESS-SERVER] Mode is normal, returning null (no client integration)`
22
- );
23
14
  return null;
24
15
  }
@@ -1,18 +1,8 @@
1
1
  "use client";
2
2
 
3
- import { useEffect, useRef } from "react";
3
+ import { useEffect } from "react";
4
4
  import useExposeRefreshFunction from "./useExposeRefreshFunction";
5
5
 
6
- // Helper for consistent logging with timestamps
7
- const log = (message: string, data?: any) => {
8
- const timestamp = new Date().toISOString();
9
- if (data !== undefined) {
10
- console.log(`[HEADLESS ${timestamp}] ${message}`, data);
11
- } else {
12
- console.log(`[HEADLESS ${timestamp}] ${message}`);
13
- }
14
- };
15
-
16
6
  export function EditorIntegrationClient({
17
7
  timings,
18
8
  mode,
@@ -22,20 +12,9 @@ export function EditorIntegrationClient({
22
12
  };
23
13
  mode: "edit" | "preview" | "normal";
24
14
  }) {
25
- const instanceIdRef = useRef(Math.random().toString(36).substring(7));
26
-
27
- log(
28
- `EditorIntegrationClient RENDER, mode: ${mode}, instance: ${instanceIdRef.current}`
29
- );
30
- log(`window.parent === window:`, window.parent === window);
31
-
32
15
  useExposeRefreshFunction();
33
16
 
34
17
  useEffect(() => {
35
- log(
36
- `EditorIntegrationClient useEffect RUNNING, instance: ${instanceIdRef.current}`
37
- );
38
-
39
18
  const handleKeyDown = (event: KeyboardEvent) => {
40
19
  if (event.ctrlKey && event.key === "F11") {
41
20
  event.preventDefault();
@@ -48,13 +27,9 @@ export function EditorIntegrationClient({
48
27
  };
49
28
 
50
29
  window.addEventListener("keydown", handleKeyDown);
51
- log(`Sending editor-timings postMessage to parent`);
52
30
  window.parent.postMessage({ type: "editor-timings", timings }, "*");
53
31
 
54
32
  return () => {
55
- log(
56
- `EditorIntegrationClient useEffect CLEANUP, instance: ${instanceIdRef.current}`
57
- );
58
33
  window.removeEventListener("keydown", handleKeyDown);
59
34
  };
60
35
  }, []);