@micromag/core 0.3.796 → 0.3.800
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/es/components.js +4 -1
- package/es/contexts.js +34 -8
- package/es/index.js +4 -0
- package/lib/components.js +4 -1
- package/lib/contexts.js +34 -8
- package/lib/index.js +4 -0
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -2804,7 +2804,7 @@ var visualElement = PropTypes.shape({
|
|
|
2804
2804
|
media: imageMedia
|
|
2805
2805
|
});
|
|
2806
2806
|
PropTypes.arrayOf(visualElement);
|
|
2807
|
-
PropTypes.shape({
|
|
2807
|
+
var audioElement = PropTypes.shape({
|
|
2808
2808
|
media: audioMedia,
|
|
2809
2809
|
autoPlay: PropTypes.bool,
|
|
2810
2810
|
loop: PropTypes.bool,
|
|
@@ -2907,6 +2907,9 @@ PropTypes.shape({
|
|
|
2907
2907
|
textStyle: textStyle,
|
|
2908
2908
|
messages: conversationMessages
|
|
2909
2909
|
});
|
|
2910
|
+
PropTypes.shape({
|
|
2911
|
+
audio: audioElement
|
|
2912
|
+
});
|
|
2910
2913
|
|
|
2911
2914
|
/**
|
|
2912
2915
|
* Definitions
|
package/es/contexts.js
CHANGED
|
@@ -1145,19 +1145,45 @@ var usePlaybackMediaRef = function usePlaybackMediaRef() {
|
|
|
1145
1145
|
media = _usePlaybackContext.media;
|
|
1146
1146
|
var mediaRef = useRef(null);
|
|
1147
1147
|
useEffect(function () {
|
|
1148
|
-
|
|
1149
|
-
if (
|
|
1148
|
+
return function () {
|
|
1149
|
+
if (active) {
|
|
1150
1150
|
setMedia(null);
|
|
1151
1151
|
setIsBackground(false);
|
|
1152
1152
|
}
|
|
1153
|
-
|
|
1153
|
+
};
|
|
1154
|
+
}, [active]);
|
|
1155
|
+
useEffect(function () {
|
|
1156
|
+
if (!active || mediaRef.current === null || media !== null) {
|
|
1157
|
+
return;
|
|
1154
1158
|
}
|
|
1155
1159
|
setIsBackground(background);
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1160
|
+
setMedia(mediaRef.current);
|
|
1161
|
+
}, [active, background, media]);
|
|
1162
|
+
|
|
1163
|
+
// const shouldSetMedia = active && media === null && mediaRef.current !== null;
|
|
1164
|
+
// useEffect(
|
|
1165
|
+
// () => () => {
|
|
1166
|
+
// if (active) {
|
|
1167
|
+
// console.log('DESTROY unset media');
|
|
1168
|
+
// setMedia(null);
|
|
1169
|
+
// setIsBackground(false);
|
|
1170
|
+
// }
|
|
1171
|
+
// },
|
|
1172
|
+
// [active],
|
|
1173
|
+
// );
|
|
1174
|
+
|
|
1175
|
+
// useEffect(() => {
|
|
1176
|
+
// if (active && mediaRef.current !== null && media === null) {
|
|
1177
|
+
// console.log('SET media');
|
|
1178
|
+
// setIsBackground(background);
|
|
1179
|
+
// setMedia(mediaRef.current);
|
|
1180
|
+
// } else if (!active && mediaRef.current === media && media !== null) {
|
|
1181
|
+
// console.log('Unset media');
|
|
1182
|
+
// setMedia(null);
|
|
1183
|
+
// setIsBackground(false);
|
|
1184
|
+
// }
|
|
1185
|
+
// }, [active, background, media]);
|
|
1186
|
+
|
|
1161
1187
|
return {
|
|
1162
1188
|
ref: mediaRef,
|
|
1163
1189
|
isCurrent: mediaRef.current === media
|
package/es/index.js
CHANGED
|
@@ -392,6 +392,9 @@ var conversation = PropTypes$1.shape({
|
|
|
392
392
|
textStyle: textStyle,
|
|
393
393
|
messages: conversationMessages
|
|
394
394
|
});
|
|
395
|
+
var alternatives = PropTypes$1.shape({
|
|
396
|
+
audio: audioElement
|
|
397
|
+
});
|
|
395
398
|
|
|
396
399
|
/**
|
|
397
400
|
* Definitions
|
|
@@ -635,6 +638,7 @@ var PropTypes = /*#__PURE__*/Object.freeze({
|
|
|
635
638
|
activeForm: activeForm,
|
|
636
639
|
adFormat: adFormat,
|
|
637
640
|
adFormats: adFormats,
|
|
641
|
+
alternatives: alternatives,
|
|
638
642
|
answer: answer,
|
|
639
643
|
answerShape: answerShape,
|
|
640
644
|
answers: answers,
|
package/lib/components.js
CHANGED
|
@@ -2806,7 +2806,7 @@ var visualElement = PropTypes.shape({
|
|
|
2806
2806
|
media: imageMedia
|
|
2807
2807
|
});
|
|
2808
2808
|
PropTypes.arrayOf(visualElement);
|
|
2809
|
-
PropTypes.shape({
|
|
2809
|
+
var audioElement = PropTypes.shape({
|
|
2810
2810
|
media: audioMedia,
|
|
2811
2811
|
autoPlay: PropTypes.bool,
|
|
2812
2812
|
loop: PropTypes.bool,
|
|
@@ -2909,6 +2909,9 @@ PropTypes.shape({
|
|
|
2909
2909
|
textStyle: textStyle,
|
|
2910
2910
|
messages: conversationMessages
|
|
2911
2911
|
});
|
|
2912
|
+
PropTypes.shape({
|
|
2913
|
+
audio: audioElement
|
|
2914
|
+
});
|
|
2912
2915
|
|
|
2913
2916
|
/**
|
|
2914
2917
|
* Definitions
|
package/lib/contexts.js
CHANGED
|
@@ -1145,19 +1145,45 @@ var usePlaybackMediaRef = function usePlaybackMediaRef() {
|
|
|
1145
1145
|
media = _usePlaybackContext.media;
|
|
1146
1146
|
var mediaRef = React.useRef(null);
|
|
1147
1147
|
React.useEffect(function () {
|
|
1148
|
-
|
|
1149
|
-
if (
|
|
1148
|
+
return function () {
|
|
1149
|
+
if (active) {
|
|
1150
1150
|
setMedia(null);
|
|
1151
1151
|
setIsBackground(false);
|
|
1152
1152
|
}
|
|
1153
|
-
|
|
1153
|
+
};
|
|
1154
|
+
}, [active]);
|
|
1155
|
+
React.useEffect(function () {
|
|
1156
|
+
if (!active || mediaRef.current === null || media !== null) {
|
|
1157
|
+
return;
|
|
1154
1158
|
}
|
|
1155
1159
|
setIsBackground(background);
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1160
|
+
setMedia(mediaRef.current);
|
|
1161
|
+
}, [active, background, media]);
|
|
1162
|
+
|
|
1163
|
+
// const shouldSetMedia = active && media === null && mediaRef.current !== null;
|
|
1164
|
+
// useEffect(
|
|
1165
|
+
// () => () => {
|
|
1166
|
+
// if (active) {
|
|
1167
|
+
// console.log('DESTROY unset media');
|
|
1168
|
+
// setMedia(null);
|
|
1169
|
+
// setIsBackground(false);
|
|
1170
|
+
// }
|
|
1171
|
+
// },
|
|
1172
|
+
// [active],
|
|
1173
|
+
// );
|
|
1174
|
+
|
|
1175
|
+
// useEffect(() => {
|
|
1176
|
+
// if (active && mediaRef.current !== null && media === null) {
|
|
1177
|
+
// console.log('SET media');
|
|
1178
|
+
// setIsBackground(background);
|
|
1179
|
+
// setMedia(mediaRef.current);
|
|
1180
|
+
// } else if (!active && mediaRef.current === media && media !== null) {
|
|
1181
|
+
// console.log('Unset media');
|
|
1182
|
+
// setMedia(null);
|
|
1183
|
+
// setIsBackground(false);
|
|
1184
|
+
// }
|
|
1185
|
+
// }, [active, background, media]);
|
|
1186
|
+
|
|
1161
1187
|
return {
|
|
1162
1188
|
ref: mediaRef,
|
|
1163
1189
|
isCurrent: mediaRef.current === media
|
package/lib/index.js
CHANGED
|
@@ -394,6 +394,9 @@ var conversation = PropTypes$1.shape({
|
|
|
394
394
|
textStyle: textStyle,
|
|
395
395
|
messages: conversationMessages
|
|
396
396
|
});
|
|
397
|
+
var alternatives = PropTypes$1.shape({
|
|
398
|
+
audio: audioElement
|
|
399
|
+
});
|
|
397
400
|
|
|
398
401
|
/**
|
|
399
402
|
* Definitions
|
|
@@ -637,6 +640,7 @@ var PropTypes = /*#__PURE__*/Object.freeze({
|
|
|
637
640
|
activeForm: activeForm,
|
|
638
641
|
adFormat: adFormat,
|
|
639
642
|
adFormats: adFormats,
|
|
643
|
+
alternatives: alternatives,
|
|
640
644
|
answer: answer,
|
|
641
645
|
answerShape: answerShape,
|
|
642
646
|
answers: answers,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.800",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"access": "public",
|
|
168
168
|
"registry": "https://registry.npmjs.org/"
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "7978db805ef7ced6123012130e2339b3ce8d36ed"
|
|
171
171
|
}
|