@alpaca-headless/alpaca-headless-nextjs 1.0.3624 → 1.0.3625
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.
|
@@ -2,5 +2,6 @@ export type EditorIntegrationProps = {
|
|
|
2
2
|
timings?: {
|
|
3
3
|
[key: string]: number;
|
|
4
4
|
};
|
|
5
|
+
mode: "edit" | "preview" | "normal";
|
|
5
6
|
};
|
|
6
|
-
export declare function EditorIntegration(props: EditorIntegrationProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function EditorIntegration(props: EditorIntegrationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +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
|
-
|
|
4
|
+
if (props.mode !== "normal") {
|
|
5
|
+
return _jsx(EditorIntegrationClient, Object.assign({}, props));
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
5
8
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare function EditorIntegrationClient({ timings, }: {
|
|
1
|
+
export declare function EditorIntegrationClient({ timings, mode, }: {
|
|
2
2
|
timings?: {
|
|
3
3
|
[key: string]: number;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
mode: "edit" | "preview" | "normal";
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
6
7
|
export type ComponentSelectedEvent = {
|
|
7
8
|
type: "componentSelected";
|
|
8
9
|
componentIds: string[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import useExposeRefreshFunction from "./useExposeRefreshFunction";
|
|
5
|
-
export function EditorIntegrationClient({ timings, }) {
|
|
5
|
+
export function EditorIntegrationClient({ timings, mode, }) {
|
|
6
6
|
useExposeRefreshFunction();
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
const handleKeyDown = (event) => {
|
|
@@ -21,6 +21,8 @@ export function EditorIntegrationClient({ timings, }) {
|
|
|
21
21
|
window.removeEventListener("keydown", handleKeyDown);
|
|
22
22
|
};
|
|
23
23
|
}, []);
|
|
24
|
+
if (mode !== "edit")
|
|
25
|
+
return null;
|
|
24
26
|
return (_jsx(_Fragment, { children: _jsx("style", { children: `
|
|
25
27
|
.a-editor-mce {
|
|
26
28
|
display:flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpaca-headless/alpaca-headless-nextjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3625",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Alpaca Headless",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"typescript": "^5"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@alpaca-headless/alpaca-headless": "^1.0.
|
|
53
|
+
"@alpaca-headless/alpaca-headless": "^1.0.3625",
|
|
54
54
|
"axios": "^1.7.2",
|
|
55
55
|
"https-proxy-agent": "^7.0.4",
|
|
56
56
|
"next": "^14.2.4",
|
|
@@ -4,8 +4,12 @@ export type EditorIntegrationProps = {
|
|
|
4
4
|
timings?: {
|
|
5
5
|
[key: string]: number;
|
|
6
6
|
};
|
|
7
|
+
mode: "edit" | "preview" | "normal";
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export function EditorIntegration(props: EditorIntegrationProps) {
|
|
10
|
-
|
|
11
|
+
if (props.mode !== "normal") {
|
|
12
|
+
return <EditorIntegrationClient {...props} />;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
11
15
|
}
|
|
@@ -5,10 +5,12 @@ import useExposeRefreshFunction from "./useExposeRefreshFunction";
|
|
|
5
5
|
|
|
6
6
|
export function EditorIntegrationClient({
|
|
7
7
|
timings,
|
|
8
|
+
mode,
|
|
8
9
|
}: {
|
|
9
10
|
timings?: {
|
|
10
11
|
[key: string]: number;
|
|
11
12
|
};
|
|
13
|
+
mode: "edit" | "preview" | "normal";
|
|
12
14
|
}) {
|
|
13
15
|
useExposeRefreshFunction();
|
|
14
16
|
|
|
@@ -32,6 +34,8 @@ export function EditorIntegrationClient({
|
|
|
32
34
|
};
|
|
33
35
|
}, []);
|
|
34
36
|
|
|
37
|
+
if (mode !== "edit") return null;
|
|
38
|
+
|
|
35
39
|
return (
|
|
36
40
|
<>
|
|
37
41
|
<style>{`
|