@livepreso/content-react 2.1.0 → 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/.rush/temp/shrinkwrap-deps.json +1 -5
- package/CHANGELOG.json +24 -0
- package/CHANGELOG.md +15 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/prep-editable.js +23 -0
- package/lib/hooks/use-slide-context.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"../../content/content-react": "../../content/content-react:
|
|
2
|
+
"../../content/content-react": "../../content/content-react:hZbLgoBvoTN2WoUTDRoax1wBup8ZZOUPY8uNx3C0+H8=:",
|
|
3
3
|
"/@ampproject/remapping@2.3.0": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
|
|
4
4
|
"/@babel/code-frame@7.26.2": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
|
|
5
5
|
"/@babel/code-frame@7.27.1": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
|
|
@@ -120,7 +120,6 @@
|
|
|
120
120
|
"/lodash.merge@4.6.2": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
|
121
121
|
"/lodash.set@4.3.2": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==",
|
|
122
122
|
"/lodash.unescape@4.0.1": "sha512-DhhGRshNS1aX6s5YdBE3njCCouPgnG29ebyHvImlZzXZf2SHgt+J08DHgytTPnpywNbO1Y8mNUFyQuIDBq2JZg==",
|
|
123
|
-
"/loose-envify@1.4.0": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
|
|
124
123
|
"/lru-cache@5.1.1": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
|
|
125
124
|
"/minimatch@3.1.2": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
|
126
125
|
"/ms@2.1.3": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
|
@@ -135,10 +134,7 @@
|
|
|
135
134
|
"/picocolors@1.1.1": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
|
136
135
|
"/prelude-ls@1.2.1": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
|
|
137
136
|
"/punycode@2.3.1": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
|
138
|
-
"/react-dom@18.2.0(react@18.2.0)": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
|
|
139
|
-
"/react@18.2.0": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
|
|
140
137
|
"/resolve-from@4.0.0": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
|
|
141
|
-
"/scheduler@0.23.2": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
|
|
142
138
|
"/semver@6.3.1": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
|
143
139
|
"/shebang-command@2.0.0": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
|
144
140
|
"/shebang-regex@3.0.0": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
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
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "2.1.1",
|
|
18
|
+
"tag": "@livepreso/content-react_v2.1.1",
|
|
19
|
+
"date": "Mon, 08 Dec 2025 22:44:51 GMT",
|
|
20
|
+
"comments": {
|
|
21
|
+
"patch": [
|
|
22
|
+
{
|
|
23
|
+
"comment": "Reduce useSlideContext state updates by testing for changes in value before setting state"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
4
28
|
{
|
|
5
29
|
"version": "2.1.0",
|
|
6
30
|
"tag": "@livepreso/content-react_v2.1.0",
|
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 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
|
|
11
|
+
|
|
12
|
+
## 2.1.1
|
|
13
|
+
Mon, 08 Dec 2025 22:44:51 GMT
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
- Reduce useSlideContext state updates by testing for changes in value before setting state
|
|
4
18
|
|
|
5
19
|
## 2.1.0
|
|
6
20
|
Tue, 25 Nov 2025 06:55:05 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
|
+
}
|
|
@@ -3,6 +3,7 @@ import { useEffect, useState, useCallback } from "react";
|
|
|
3
3
|
import { useModes } from "./use-modes";
|
|
4
4
|
|
|
5
5
|
import isPlainObject from "lodash.isplainobject";
|
|
6
|
+
import isEqual from "lodash.isequal";
|
|
6
7
|
|
|
7
8
|
export function useSlideContext(
|
|
8
9
|
contextPath = null,
|
|
@@ -57,6 +58,7 @@ export function useSlideContext(
|
|
|
57
58
|
|
|
58
59
|
function onContextChange() {
|
|
59
60
|
const newValue = getValue();
|
|
61
|
+
if (isEqual(newValue, context)) return;
|
|
60
62
|
setContextState(newValue);
|
|
61
63
|
}
|
|
62
64
|
|