@livepreso/content-react 2.1.1 → 2.2.0
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/CHANGELOG.json +12 -0
- package/CHANGELOG.md +8 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/prep-editable.js +23 -0
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/content-react",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "2.2.0",
|
|
6
|
+
"tag": "@livepreso/content-react_v2.2.0",
|
|
7
|
+
"date": "Thu, 12 Feb 2026 22:59:11 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Add usePrepEditableImage hook to content-react"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "2.1.1",
|
|
6
18
|
"tag": "@livepreso/content-react_v2.1.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log - @livepreso/content-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 12 Feb 2026 22:59:11 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 2.2.0
|
|
6
|
+
Thu, 12 Feb 2026 22:59:11 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Add usePrepEditableImage hook to content-react
|
|
4
11
|
|
|
5
12
|
## 2.1.1
|
|
6
13
|
Mon, 08 Dec 2025 22:44:51 GMT
|
package/lib/hooks/index.js
CHANGED
|
@@ -65,3 +65,26 @@ export function usePrepEditableValue(id, defaultValue = null) {
|
|
|
65
65
|
const [value] = usePrepEditable(id);
|
|
66
66
|
return value ?? defaultValue;
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns the URL of a prep editable dynamic image on the current slide.
|
|
71
|
+
*/
|
|
72
|
+
export function usePrepEditableImage(editableKey) {
|
|
73
|
+
const { isPresomanager } = useModes();
|
|
74
|
+
const { slideID, isUserTemplateLibrary } = useSlide();
|
|
75
|
+
|
|
76
|
+
const key = useEditableFieldKey(editableKey, { isPrep: true });
|
|
77
|
+
|
|
78
|
+
const prepKey = `${slideID}--${key}`;
|
|
79
|
+
const keyPath = `dynamicImages.${prepKey}`;
|
|
80
|
+
|
|
81
|
+
const [obj] = useSlideContext(
|
|
82
|
+
keyPath,
|
|
83
|
+
{ image: null },
|
|
84
|
+
{
|
|
85
|
+
enabled: !isPresomanager || isUserTemplateLibrary,
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
return obj?.image ?? null;
|
|
90
|
+
}
|