@nodehive/nextjs 0.1.1 → 0.1.3
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/puck-editor/internal/editor/canvas-add-picker.d.ts.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-add-picker.js +103 -130
- package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-quick-add.js +74 -69
- package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -1
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +6 -3
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +1 -1
- package/dist/puck-editor/internal/editor/grouped-entry-list.js +83 -54
- package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -1
- package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts +2 -0
- package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/use-frame-zoom.js +59 -0
- package/dist/puck-editor/internal/editor/use-frame-zoom.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +1 -1
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js +102 -105
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +1 -1
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.js +1 -1
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +30 -39
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +474 -291
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -1
- package/dist/puck-editor/internal/ui/search-control.d.ts +3 -2
- package/dist/puck-editor/internal/ui/search-control.d.ts.map +1 -1
- package/dist/puck-editor/internal/ui/search-control.js +26 -23
- package/dist/puck-editor/internal/ui/search-control.js.map +1 -1
- package/dist/shared/use-is-hydrated.d.ts +2 -0
- package/dist/shared/use-is-hydrated.d.ts.map +1 -0
- package/dist/shared/use-is-hydrated.js +14 -0
- package/dist/shared/use-is-hydrated.js.map +1 -0
- package/dist/shared/use-is-in-iframe.d.ts +2 -0
- package/dist/shared/use-is-in-iframe.d.ts.map +1 -0
- package/dist/shared/use-is-in-iframe.js +7 -0
- package/dist/shared/use-is-in-iframe.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +1 -1
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +144 -169
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -1
- package/dist/visual-editor/internal/bridge/connector.d.ts.map +1 -1
- package/dist/visual-editor/internal/bridge/connector.js +2 -3
- package/dist/visual-editor/internal/bridge/connector.js.map +1 -1
- package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +1 -1
- package/dist/visual-editor/internal/overlays/edit-button.js +63 -77
- package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -1
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +1 -1
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js +10 -24
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { useEffect, useState } from 'react';
|
|
5
4
|
import { usePathname } from 'next/navigation';
|
|
6
5
|
import { cn } from '../../../shared/cn';
|
|
6
|
+
import { useIsInIframe } from '../../../shared/use-is-in-iframe';
|
|
7
7
|
import { getDrupalOrigin } from './drupal-origin';
|
|
8
8
|
import { EditIcon } from './edit-icon';
|
|
9
9
|
import '../../../theme.css';
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
export default function EditButton(t0) {
|
|
12
|
-
const $ = _c(
|
|
12
|
+
const $ = _c(21);
|
|
13
13
|
const {
|
|
14
14
|
label,
|
|
15
15
|
message,
|
|
@@ -18,24 +18,10 @@ export default function EditButton(t0) {
|
|
|
18
18
|
} = t0;
|
|
19
19
|
const showLabel = t1 === undefined ? false : t1;
|
|
20
20
|
const pathname = usePathname();
|
|
21
|
-
const
|
|
21
|
+
const isInIframe = useIsInIframe();
|
|
22
22
|
let t2;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
t2 = () => {
|
|
26
|
-
setIsInIframe(typeof window !== "undefined" && window.self !== window.top);
|
|
27
|
-
};
|
|
28
|
-
t3 = [];
|
|
29
|
-
$[0] = t2;
|
|
30
|
-
$[1] = t3;
|
|
31
|
-
} else {
|
|
32
|
-
t2 = $[0];
|
|
33
|
-
t3 = $[1];
|
|
34
|
-
}
|
|
35
|
-
useEffect(t2, t3);
|
|
36
|
-
let t4;
|
|
37
|
-
if ($[2] !== message || $[3] !== pathname) {
|
|
38
|
-
t4 = e => {
|
|
23
|
+
if ($[0] !== message || $[1] !== pathname) {
|
|
24
|
+
t2 = e => {
|
|
39
25
|
e.preventDefault();
|
|
40
26
|
const targetOrigin = getDrupalOrigin();
|
|
41
27
|
if (!targetOrigin) {
|
|
@@ -46,93 +32,93 @@ export default function EditButton(t0) {
|
|
|
46
32
|
pathname
|
|
47
33
|
}, targetOrigin);
|
|
48
34
|
};
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
35
|
+
$[0] = message;
|
|
36
|
+
$[1] = pathname;
|
|
37
|
+
$[2] = t2;
|
|
52
38
|
} else {
|
|
53
|
-
|
|
39
|
+
t2 = $[2];
|
|
54
40
|
}
|
|
55
|
-
const editComponent =
|
|
41
|
+
const editComponent = t2;
|
|
56
42
|
if (!isInIframe) {
|
|
57
43
|
return null;
|
|
58
44
|
}
|
|
45
|
+
let t3;
|
|
46
|
+
if ($[3] !== position) {
|
|
47
|
+
t3 = cn("nh-root nh:absolute nh:flex nh:transform-gpu nh:gap-2 nh:antialiased nh:opacity-75 nh:transition-all nh:duration-75 nh:ease-in-out nh:hover:scale-105 nh:hover:opacity-100", position);
|
|
48
|
+
$[3] = position;
|
|
49
|
+
$[4] = t3;
|
|
50
|
+
} else {
|
|
51
|
+
t3 = $[4];
|
|
52
|
+
}
|
|
53
|
+
const t4 = !showLabel;
|
|
59
54
|
let t5;
|
|
60
|
-
if ($[5] !==
|
|
61
|
-
t5 = cn("nh
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
if ($[5] !== showLabel || $[6] !== t4) {
|
|
56
|
+
t5 = cn("nh:flex nh:gap-2 nh:rounded-(--nh-radius) nh:bg-(--nh-primary) nh:py-2 nh:text-xs nh:font-(--nh-font) nh:font-bold nh:text-(--nh-primary-fg) nh:shadow-lg nh:transition-colors nh:hover:bg-[color-mix(in_oklab,var(--nh-primary),black_20%)]", {
|
|
57
|
+
"nh:px-3": showLabel,
|
|
58
|
+
"nh:px-2": t4
|
|
59
|
+
});
|
|
60
|
+
$[5] = showLabel;
|
|
61
|
+
$[6] = t4;
|
|
62
|
+
$[7] = t5;
|
|
64
63
|
} else {
|
|
65
|
-
t5 = $[
|
|
64
|
+
t5 = $[7];
|
|
66
65
|
}
|
|
67
66
|
const t6 = !showLabel;
|
|
68
67
|
let t7;
|
|
69
|
-
if ($[
|
|
70
|
-
t7 = cn(
|
|
71
|
-
"nh:
|
|
72
|
-
"nh:px-2": t6
|
|
68
|
+
if ($[8] !== t6) {
|
|
69
|
+
t7 = cn({
|
|
70
|
+
"nh:sr-only": t6
|
|
73
71
|
});
|
|
74
|
-
$[7] = showLabel;
|
|
75
72
|
$[8] = t6;
|
|
76
73
|
$[9] = t7;
|
|
77
74
|
} else {
|
|
78
75
|
t7 = $[9];
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"nh:sr-only": t8
|
|
85
|
-
});
|
|
86
|
-
$[10] = t8;
|
|
87
|
-
$[11] = t9;
|
|
88
|
-
} else {
|
|
89
|
-
t9 = $[11];
|
|
90
|
-
}
|
|
91
|
-
let t10;
|
|
92
|
-
if ($[12] !== label || $[13] !== t9) {
|
|
93
|
-
t10 = /*#__PURE__*/_jsx("span", {
|
|
94
|
-
className: t9,
|
|
77
|
+
let t8;
|
|
78
|
+
if ($[10] !== label || $[11] !== t7) {
|
|
79
|
+
t8 = /*#__PURE__*/_jsx("span", {
|
|
80
|
+
className: t7,
|
|
95
81
|
children: label
|
|
96
82
|
});
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
83
|
+
$[10] = label;
|
|
84
|
+
$[11] = t7;
|
|
85
|
+
$[12] = t8;
|
|
100
86
|
} else {
|
|
101
|
-
|
|
87
|
+
t8 = $[12];
|
|
102
88
|
}
|
|
103
|
-
let
|
|
104
|
-
if ($[
|
|
105
|
-
|
|
106
|
-
$[
|
|
89
|
+
let t9;
|
|
90
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
91
|
+
t9 = /*#__PURE__*/_jsx(EditIcon, {});
|
|
92
|
+
$[13] = t9;
|
|
107
93
|
} else {
|
|
108
|
-
|
|
94
|
+
t9 = $[13];
|
|
109
95
|
}
|
|
110
|
-
let
|
|
111
|
-
if ($[
|
|
112
|
-
|
|
96
|
+
let t10;
|
|
97
|
+
if ($[14] !== editComponent || $[15] !== t5 || $[16] !== t8) {
|
|
98
|
+
t10 = /*#__PURE__*/_jsxs("button", {
|
|
113
99
|
onClick: editComponent,
|
|
114
|
-
className:
|
|
115
|
-
children: [
|
|
100
|
+
className: t5,
|
|
101
|
+
children: [t8, t9]
|
|
116
102
|
});
|
|
117
|
-
$[
|
|
103
|
+
$[14] = editComponent;
|
|
104
|
+
$[15] = t5;
|
|
105
|
+
$[16] = t8;
|
|
118
106
|
$[17] = t10;
|
|
119
|
-
$[18] = t7;
|
|
120
|
-
$[19] = t12;
|
|
121
107
|
} else {
|
|
122
|
-
|
|
108
|
+
t10 = $[17];
|
|
123
109
|
}
|
|
124
|
-
let
|
|
125
|
-
if ($[
|
|
126
|
-
|
|
127
|
-
className:
|
|
128
|
-
children:
|
|
110
|
+
let t11;
|
|
111
|
+
if ($[18] !== t10 || $[19] !== t3) {
|
|
112
|
+
t11 = /*#__PURE__*/_jsx("div", {
|
|
113
|
+
className: t3,
|
|
114
|
+
children: t10
|
|
129
115
|
});
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
116
|
+
$[18] = t10;
|
|
117
|
+
$[19] = t3;
|
|
118
|
+
$[20] = t11;
|
|
133
119
|
} else {
|
|
134
|
-
|
|
120
|
+
t11 = $[20];
|
|
135
121
|
}
|
|
136
|
-
return
|
|
122
|
+
return t11;
|
|
137
123
|
}
|
|
138
124
|
//# sourceMappingURL=edit-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-button.js","names":["c","_c","
|
|
1
|
+
{"version":3,"file":"edit-button.js","names":["c","_c","usePathname","cn","useIsInIframe","getDrupalOrigin","EditIcon","jsx","_jsx","jsxs","_jsxs","EditButton","t0","$","label","message","position","showLabel","t1","undefined","pathname","isInIframe","t2","e","preventDefault","targetOrigin","window","parent","postMessage","editComponent","t3","t4","t5","t6","t7","t8","className","children","t9","Symbol","for","t10","t11"],"sources":["../../../../src/visual-editor/internal/overlays/edit-button.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\n\nimport { cn } from '../../../shared/cn';\nimport { useIsInIframe } from '../../../shared/use-is-in-iframe';\nimport { getDrupalOrigin } from './drupal-origin';\nimport { EditIcon } from './edit-icon';\n\nimport '../../../theme.css';\n\ntype EditButtonProps = {\n label: string;\n message: Record<string, unknown>;\n position: string;\n showLabel?: boolean;\n};\n\nexport default function EditButton({\n label,\n message,\n position,\n showLabel = false,\n}: EditButtonProps) {\n const pathname = usePathname();\n const isInIframe = useIsInIframe();\n\n const editComponent = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n\n const targetOrigin = getDrupalOrigin();\n if (!targetOrigin) return;\n\n window.parent.postMessage({ ...message, pathname }, targetOrigin);\n };\n\n if (!isInIframe) {\n return null;\n }\n\n return (\n <div\n className={cn(\n 'nh-root nh:absolute nh:flex nh:transform-gpu nh:gap-2 nh:antialiased nh:opacity-75 nh:transition-all nh:duration-75 nh:ease-in-out nh:hover:scale-105 nh:hover:opacity-100',\n position\n )}\n >\n <button\n onClick={editComponent}\n className={cn(\n 'nh:flex nh:gap-2 nh:rounded-(--nh-radius) nh:bg-(--nh-primary) nh:py-2 nh:text-xs nh:font-(--nh-font) nh:font-bold nh:text-(--nh-primary-fg) nh:shadow-lg nh:transition-colors nh:hover:bg-[color-mix(in_oklab,var(--nh-primary),black_20%)]',\n { 'nh:px-3': showLabel, 'nh:px-2': !showLabel }\n )}\n >\n <span className={cn({ 'nh:sr-only': !showLabel })}>{label}</span>\n\n <EditIcon />\n </button>\n </div>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,SAASC,EAAE,QAAQ,oBAAoB;AACvC,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,QAAQ,aAAa;AAEtC,OAAO,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS5B,eAAe,SAAAC,WAAAC,EAA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A,OAAAsB,EAAA;IAAAtB,CAAA,OAAA4B,GAAA;EAAA;IAAAA,GAAA,GAAA5B,CAAA;EAAA;EAAA,IAAA6B,GAAA;EAAA,IAAA7B,CAAA,SAAA4B,GAAA,IAAA5B,CAAA,SAAAiB,EAAA;IAhBXY,GAAA,gBAAAlC,IAAA;MACa4B,SAGV,EAHUN,EAGV;MAAAO,QAAA,EAEDI;IAUS,CACN,CAAC;IAAA5B,CAAA,OAAA4B,GAAA;IAAA5B,CAAA,OAAAiB,EAAA;IAAAjB,CAAA,OAAA6B,GAAA;EAAA;IAAAA,GAAA,GAAA7B,CAAA;EAAA;EAAA,OAjBN6B,GAiBM;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/visual-editor/internal/overlays/iframe-wrapper.tsx"],"names":[],"mappings":"AAIA,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+
|
|
1
|
+
{"version":3,"file":"iframe-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/visual-editor/internal/overlays/iframe-wrapper.tsx"],"names":[],"mappings":"AAIA,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+VAYrE"}
|
|
@@ -1,42 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { useIsInIframe } from '../../../shared/use-is-in-iframe';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export default function IframeWrapper(t0) {
|
|
7
|
-
const $ = _c(
|
|
7
|
+
const $ = _c(2);
|
|
8
8
|
const {
|
|
9
9
|
children
|
|
10
10
|
} = t0;
|
|
11
|
-
const
|
|
12
|
-
let t1;
|
|
13
|
-
let t2;
|
|
14
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
15
|
-
t1 = () => {
|
|
16
|
-
setIsInIframe(typeof window !== "undefined" && window.self !== window.top);
|
|
17
|
-
};
|
|
18
|
-
t2 = [];
|
|
19
|
-
$[0] = t1;
|
|
20
|
-
$[1] = t2;
|
|
21
|
-
} else {
|
|
22
|
-
t1 = $[0];
|
|
23
|
-
t2 = $[1];
|
|
24
|
-
}
|
|
25
|
-
useEffect(t1, t2);
|
|
11
|
+
const isInIframe = useIsInIframe();
|
|
26
12
|
if (!isInIframe) {
|
|
27
13
|
return children;
|
|
28
14
|
}
|
|
29
|
-
let
|
|
30
|
-
if ($[
|
|
31
|
-
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== children) {
|
|
17
|
+
t1 = /*#__PURE__*/_jsx("div", {
|
|
32
18
|
className: "nh:rounded-lg nh:p-2 nh:outline-(--nh-primary) nh:hover:outline-2 nh:hover:-outline-offset-2 nh:hover:outline-dashed",
|
|
33
19
|
children: children
|
|
34
20
|
});
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
21
|
+
$[0] = children;
|
|
22
|
+
$[1] = t1;
|
|
37
23
|
} else {
|
|
38
|
-
|
|
24
|
+
t1 = $[1];
|
|
39
25
|
}
|
|
40
|
-
return
|
|
26
|
+
return t1;
|
|
41
27
|
}
|
|
42
28
|
//# sourceMappingURL=iframe-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe-wrapper.js","names":["c","_c","
|
|
1
|
+
{"version":3,"file":"iframe-wrapper.js","names":["c","_c","useIsInIframe","jsx","_jsx","IframeWrapper","t0","$","children","isInIframe","t1","className"],"sources":["../../../../src/visual-editor/internal/overlays/iframe-wrapper.tsx"],"sourcesContent":["'use client';\n\nimport { useIsInIframe } from '../../../shared/use-is-in-iframe';\n\ntype IframeWrapperProps = {\n children: React.ReactNode;\n};\n\nexport default function IframeWrapper({ children }: IframeWrapperProps) {\n const isInIframe = useIsInIframe();\n\n if (!isInIframe) {\n return children;\n }\n\n return (\n <div className=\"nh:rounded-lg nh:p-2 nh:outline-(--nh-primary) nh:hover:outline-2 nh:hover:-outline-offset-2 nh:hover:outline-dashed\">\n {children}\n </div>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,aAAa,QAAQ,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMjE,eAAe,SAAAC,cAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAAuB;IAAAO;EAAA,IAAAF,EAAgC;EACpE,MAAAG,UAAA,GAAmBP,aAAa,CAAC,CAAC;EAElC,IAAI,CAACO,UAAU;IAAA,OACND,QAAQ;EAAA;EAChB,IAAAE,EAAA;EAAA,IAAAH,CAAA,QAAAC,QAAA;IAGCE,EAAA,gBAAAN,IAAA;MAAeO,SAAsH,EAAtH,sHAAsH;MAAAH,QAAA,EAClIA;IAAQ,CACN,CAAC;IAAAD,CAAA,MAAAC,QAAA;IAAAD,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,OAFNG,EAEM;AAAA","ignoreList":[]}
|
package/package.json
CHANGED