@livepreso/content-react 2.2.1 → 2.3.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 +24 -0
- package/CHANGELOG.md +15 -1
- package/lib/contexts.js +1 -0
- package/lib/hooks/cmsvals.js +20 -4
- package/lib/hooks/slide.js +2 -0
- package/lib/hooks/use-root-slide.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/content-react",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "2.3.0",
|
|
6
|
+
"tag": "@livepreso/content-react_v2.3.0",
|
|
7
|
+
"date": "Tue, 08 Sep 2026 00:30:21 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Surface slidePath in useSlide() hook"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "2.2.2",
|
|
18
|
+
"tag": "@livepreso/content-react_v2.2.2",
|
|
19
|
+
"date": "Thu, 03 Sep 2026 03:12:08 GMT",
|
|
20
|
+
"comments": {
|
|
21
|
+
"patch": [
|
|
22
|
+
{
|
|
23
|
+
"comment": "Point useCMSVal() React hook at Bridge.CMSVals.get() when screenshotting for thumbnails"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
4
28
|
{
|
|
5
29
|
"version": "2.2.1",
|
|
6
30
|
"tag": "@livepreso/content-react_v2.2.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# Change Log - @livepreso/content-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 08 Sep 2026 00:30:21 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 2.3.0
|
|
6
|
+
Tue, 08 Sep 2026 00:30:21 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Surface slidePath in useSlide() hook
|
|
11
|
+
|
|
12
|
+
## 2.2.2
|
|
13
|
+
Thu, 03 Sep 2026 03:12:08 GMT
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
- Point useCMSVal() React hook at Bridge.CMSVals.get() when screenshotting for thumbnails
|
|
4
18
|
|
|
5
19
|
## 2.2.1
|
|
6
20
|
Thu, 12 Mar 2026 02:50:05 GMT
|
package/lib/contexts.js
CHANGED
package/lib/hooks/cmsvals.js
CHANGED
|
@@ -53,10 +53,21 @@ function useDefaultCMSValueFromPresomanager(id, { slidePath = null } = {}) {
|
|
|
53
53
|
return cmsVals?.find?.((c) => c.key === key)?.value ?? null;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export function useCMSVal(
|
|
56
|
+
export function useCMSVal(
|
|
57
|
+
id,
|
|
58
|
+
{ enabled = true, slidePath: slidePathOverride = null } = {},
|
|
59
|
+
) {
|
|
57
60
|
const { entered, entering } = useTransitions();
|
|
58
|
-
const { isPresomanager, isEmptyPreview, isCdk } =
|
|
59
|
-
|
|
61
|
+
const { isPresomanager, isEmptyPreview, isCdk, isThumbnailScreenshot } =
|
|
62
|
+
useModes();
|
|
63
|
+
const {
|
|
64
|
+
isUserTemplate,
|
|
65
|
+
isUserTemplateLibrary,
|
|
66
|
+
slidePath: ownSlidePath,
|
|
67
|
+
} = useSlide();
|
|
68
|
+
|
|
69
|
+
// Defaults to the calling slide's path.
|
|
70
|
+
const slidePath = slidePathOverride ?? ownSlidePath;
|
|
60
71
|
const [userTemplateValue, setUserTemplateValue] = useUserTemplateCMS(id);
|
|
61
72
|
const defaultFromPM = useDefaultCMSValueFromPresomanager(id, { slidePath });
|
|
62
73
|
|
|
@@ -74,7 +85,12 @@ export function useCMSVal(id, { enabled = true, slidePath = null } = {}) {
|
|
|
74
85
|
return userTemplateValue;
|
|
75
86
|
}
|
|
76
87
|
|
|
77
|
-
if (
|
|
88
|
+
if (
|
|
89
|
+
!isCdk &&
|
|
90
|
+
!isPresomanager &&
|
|
91
|
+
!isEmptyPreview &&
|
|
92
|
+
!isThumbnailScreenshot
|
|
93
|
+
) {
|
|
78
94
|
return defaultFromPM;
|
|
79
95
|
}
|
|
80
96
|
|
package/lib/hooks/slide.js
CHANGED
|
@@ -7,6 +7,7 @@ export function useSlide() {
|
|
|
7
7
|
slideID,
|
|
8
8
|
slideKey,
|
|
9
9
|
presentationKey,
|
|
10
|
+
slidePath,
|
|
10
11
|
isSlideReady,
|
|
11
12
|
doneRegister,
|
|
12
13
|
isCurrentSlide,
|
|
@@ -22,6 +23,7 @@ export function useSlide() {
|
|
|
22
23
|
slideID,
|
|
23
24
|
slideKey,
|
|
24
25
|
presentationKey,
|
|
26
|
+
slidePath,
|
|
25
27
|
isSlideReady,
|
|
26
28
|
doneRegister,
|
|
27
29
|
isCurrentSlide,
|
|
@@ -25,6 +25,7 @@ export function useRootSlide(article) {
|
|
|
25
25
|
const slideID = article.attr("id");
|
|
26
26
|
const key = article.data("slide-key");
|
|
27
27
|
const presentationKey = article.data("presentation-key") || slideID;
|
|
28
|
+
const slidePath = article.data("slide-path") || null;
|
|
28
29
|
const isCurrent = article.closest(".presoSlide").hasClass("current");
|
|
29
30
|
const [synced, setSynced] = useState(!isRemote);
|
|
30
31
|
const [internalSlideState, setInternalSlideState] = useAsyncReference({});
|
|
@@ -45,7 +46,7 @@ export function useRootSlide(article) {
|
|
|
45
46
|
exited: !isCurrent,
|
|
46
47
|
});
|
|
47
48
|
|
|
48
|
-
const updateState = (stateName) => (
|
|
49
|
+
const updateState = (stateName) => () => {
|
|
49
50
|
setTransitions({
|
|
50
51
|
...DEFAULT_TRANSITION_STATE,
|
|
51
52
|
[stateName]: true,
|
|
@@ -163,6 +164,10 @@ export function useRootSlide(article) {
|
|
|
163
164
|
// If for whatever reason this isn't in the dom, we fall back to the ID.
|
|
164
165
|
presentationKey,
|
|
165
166
|
|
|
167
|
+
// This is the data-slide-path on the article. Slide path represented as
|
|
168
|
+
// "deck/section/slide". Useful for Bridge commands that require a path.
|
|
169
|
+
slidePath,
|
|
170
|
+
|
|
166
171
|
isCurrentSlide: isCurrent,
|
|
167
172
|
doneRegister,
|
|
168
173
|
rootElement: article.get(0),
|