@imposium-hub/components 1.24.5 → 1.24.7
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/components/compositions/CompositionRendererLayer.tsx +5 -5
- package/components/compositions/StaticCompositionRenderer.tsx +2 -2
- package/components/story-previewer/StoryPreviewer.tsx +3 -2
- package/dist/components.js +2 -2
- package/dist/components.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/styles.less +3 -3
- package/dist/styles.less.map +1 -1
- package/less/components/assets.less +3 -3
- package/package.json +1 -1
- package/services/API.ts +7 -2
|
@@ -43,8 +43,8 @@ class CompositionRendererLayer extends React.PureComponent<ICompositionRendererL
|
|
|
43
43
|
private handleDrag(e) {
|
|
44
44
|
|
|
45
45
|
const newLayer = {...this.props.layer};
|
|
46
|
-
newLayer.x = e.left;
|
|
47
|
-
newLayer.y = e.top;
|
|
46
|
+
newLayer.x = Math.round(e.left);
|
|
47
|
+
newLayer.y = Math.round(e.top);
|
|
48
48
|
|
|
49
49
|
this.props.onUpdate(newLayer);
|
|
50
50
|
}
|
|
@@ -52,8 +52,8 @@ class CompositionRendererLayer extends React.PureComponent<ICompositionRendererL
|
|
|
52
52
|
private handleResize(e) {
|
|
53
53
|
|
|
54
54
|
const newLayer = {...this.props.layer};
|
|
55
|
-
newLayer.width = e.width;
|
|
56
|
-
newLayer.height = e.height;
|
|
55
|
+
newLayer.width = Math.round(e.width);
|
|
56
|
+
newLayer.height = Math.round(e.height);
|
|
57
57
|
|
|
58
58
|
this.props.onUpdate(newLayer);
|
|
59
59
|
}
|
|
@@ -61,7 +61,7 @@ class CompositionRendererLayer extends React.PureComponent<ICompositionRendererL
|
|
|
61
61
|
private handleRotate(e) {
|
|
62
62
|
|
|
63
63
|
const newLayer = {...this.props.layer};
|
|
64
|
-
newLayer.rotation = e.beforeDelta + newLayer.rotation;
|
|
64
|
+
newLayer.rotation = Math.round(e.beforeDelta + newLayer.rotation);
|
|
65
65
|
|
|
66
66
|
this.props.onUpdate(newLayer);
|
|
67
67
|
}
|
|
@@ -36,7 +36,7 @@ class StaticCompositionRenderer extends React.PureComponent<IStaticCompositionRe
|
|
|
36
36
|
if (layers) {
|
|
37
37
|
layers.map((layer, i) => {
|
|
38
38
|
|
|
39
|
-
const selected = layer.id === selectedLayer;
|
|
39
|
+
const selected = layer.id && layer.id === selectedLayer;
|
|
40
40
|
|
|
41
41
|
let promiseResolve;
|
|
42
42
|
let promiseReject;
|
|
@@ -53,7 +53,7 @@ class StaticCompositionRenderer extends React.PureComponent<IStaticCompositionRe
|
|
|
53
53
|
selected = {selected}
|
|
54
54
|
layer = {layer}
|
|
55
55
|
inventory = {inventory}
|
|
56
|
-
key = {layer.id}/>
|
|
56
|
+
key = {layer.id || i}/>
|
|
57
57
|
);
|
|
58
58
|
});
|
|
59
59
|
} else {
|
|
@@ -25,6 +25,7 @@ import LogViewer from '../log-viewer/LogViewer';
|
|
|
25
25
|
interface IStoryPreviewerProps {
|
|
26
26
|
api : IImposiumAPI;
|
|
27
27
|
storyId : string;
|
|
28
|
+
useWorkingCopy ? : boolean;
|
|
28
29
|
compositionId ? : string;
|
|
29
30
|
variables : any;
|
|
30
31
|
experienceId? : string;
|
|
@@ -449,7 +450,7 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
449
450
|
|
|
450
451
|
private createExperience() {
|
|
451
452
|
|
|
452
|
-
const {storyId, onNotification, onError, api, onExperienceCreated, compositionId} = this.props;
|
|
453
|
+
const {storyId, onNotification, onError, api, onExperienceCreated, compositionId, useWorkingCopy} = this.props;
|
|
453
454
|
|
|
454
455
|
this.resetState(() => {
|
|
455
456
|
this.setState({
|
|
@@ -460,7 +461,7 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
460
461
|
if (onNotification) {
|
|
461
462
|
onNotification(copy.runExpStart);
|
|
462
463
|
}
|
|
463
|
-
api.createExperience(storyId, this.state.inventory, compositionId).then((resExp) => {
|
|
464
|
+
api.createExperience(storyId, this.state.inventory, compositionId, useWorkingCopy).then((resExp) => {
|
|
464
465
|
|
|
465
466
|
if (onNotification) {
|
|
466
467
|
onNotification(copy.expId.replace('[expId]', resExp.id));
|